init
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
import { w as withInstall } from "../badge/index2.js";
|
||||
import { defineComponent, ref, onMounted, watch, provide, openBlock, createElementBlock, mergeProps, unref, toHandlers, renderSlot } from "vue";
|
||||
import { f as useMousePressed } from "../_chunks/@vueuse/index.js";
|
||||
var index = /* @__PURE__ */ (() => '.lay-split-panel{height:100%;display:flex;position:relative}.lay-split-panel .lay-split-panel-item{height:100%;border:1px #eeeeee solid}.lay-split-panel .lay-split-panel-item-move{user-select:none;pointer-events:none;cursor:col-resize}.lay-split-panel .lay-split-panel-line{height:100%;width:3px;border:1px #eeeeee solid;background-color:var(--global-neutral-color-1);border-left:none;border-right:none;cursor:col-resize;display:flex;align-items:center}.lay-split-panel .lay-split-panel-line:before{content:"";height:6px;width:100%;border:2px solid #dcdee2;border-left:0;border-right:0}.lay-split-panel-vertical{flex-direction:column;position:relative}.lay-split-panel-vertical .lay-split-panel-item-move{user-select:none;pointer-events:none;cursor:row-resize}.lay-split-panel-vertical .lay-split-panel-line{display:flex;justify-content:center;width:100%;height:3px;cursor:row-resize;border:1px #eeeeee solid;background-color:var(--global-neutral-color-1);border-top:none;border-bottom:none}.lay-split-panel-vertical .lay-split-panel-line:before{content:"";height:100%;width:6px;border:2px solid #dcdee2;border-top:none;border-bottom:none}\n')();
|
||||
const __default__ = {
|
||||
name: "LaySplitPanel"
|
||||
};
|
||||
const _sfc_main = defineComponent({
|
||||
...__default__,
|
||||
props: {
|
||||
vertical: { type: Boolean, default: false },
|
||||
minSize: { default: 50 }
|
||||
},
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const target = ref();
|
||||
const { pressed } = useMousePressed({ target });
|
||||
let domEvent = ref();
|
||||
let domStatus = ref(pressed);
|
||||
let parentVertical = ref();
|
||||
onMounted(() => {
|
||||
const boxWidth = target.value.offsetWidth;
|
||||
const boxHeight = target.value.offsetHeight;
|
||||
target.value.addEventListener("mousemove", (event) => {
|
||||
if (domStatus.value && domEvent.value) {
|
||||
const prevDom = domEvent.value.target.previousElementSibling;
|
||||
const nextDom = domEvent.value.target.nextElementSibling;
|
||||
if (!props.vertical) {
|
||||
const prevDomLeft = domEvent.value.target.previousElementSibling.offsetLeft;
|
||||
const prevDomWidth = domEvent.value.target.previousElementSibling.offsetWidth;
|
||||
const nextDomWidth = domEvent.value.target.nextElementSibling.offsetWidth;
|
||||
const otherWidth = boxWidth - (prevDomWidth + nextDomWidth + 5);
|
||||
const otherWidthPercentage = (prevDomWidth + nextDomWidth + 5) / boxWidth * 100;
|
||||
if (event.layerX - prevDomLeft < props.minSize || boxWidth - (event.layerX - prevDomLeft) - otherWidth < props.minSize) {
|
||||
return false;
|
||||
}
|
||||
prevDom.style.flexBasis = (event.layerX - prevDomLeft) / (prevDomWidth + nextDomWidth + 5) * otherWidthPercentage + "%";
|
||||
nextDom.style.flexBasis = (boxWidth - (event.layerX - prevDomLeft) - otherWidth) / (prevDomWidth + nextDomWidth + 5) * otherWidthPercentage + "%";
|
||||
} else {
|
||||
const prevDomTop = domEvent.value.target.previousElementSibling.offsetTop;
|
||||
const prevDomHeight = domEvent.value.target.previousElementSibling.offsetHeight;
|
||||
const nextDomHeight = domEvent.value.target.nextElementSibling.offsetHeight;
|
||||
const otherHeight = boxHeight - (prevDomHeight + nextDomHeight + 5);
|
||||
const otherHeightPercentage = (prevDomHeight + nextDomHeight + 5) / boxHeight * 100;
|
||||
if (event.layerY - prevDomTop < props.minSize || boxHeight - (event.layerY - prevDomTop) - otherHeight < props.minSize) {
|
||||
return false;
|
||||
}
|
||||
prevDom.style.flexBasis = (event.layerY - prevDomTop) / (prevDomHeight + nextDomHeight + 5) * otherHeightPercentage + "%";
|
||||
nextDom.style.flexBasis = (boxHeight - (event.layerY - prevDomTop) - otherHeight) / (prevDomHeight + nextDomHeight + 5) * otherHeightPercentage + "%";
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
const moveChange = (event, status, isVertical) => {
|
||||
domEvent.value = event;
|
||||
domStatus.value = status;
|
||||
parentVertical.value = isVertical;
|
||||
};
|
||||
const mouseup = () => {
|
||||
domStatus.value = false;
|
||||
domEvent.value = null;
|
||||
parentVertical.value = false;
|
||||
};
|
||||
const steps = ref([]);
|
||||
watch(steps, () => {
|
||||
steps.value.forEach((instance, index2) => {
|
||||
instance.setIndex(index2);
|
||||
});
|
||||
});
|
||||
provide("laySplitPanel", {
|
||||
props,
|
||||
steps,
|
||||
target,
|
||||
moveChange
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return openBlock(), createElementBlock("div", mergeProps({
|
||||
ref_key: "target",
|
||||
ref: target,
|
||||
class: ["lay-split-panel", __props.vertical ? "lay-split-panel-vertical" : ""],
|
||||
style: {
|
||||
cursor: unref(domStatus) ? !__props.vertical ? "col-resize" : "row-resize" : ""
|
||||
}
|
||||
}, toHandlers({ mouseup }, true)), [
|
||||
renderSlot(_ctx.$slots, "default")
|
||||
], 16);
|
||||
};
|
||||
}
|
||||
});
|
||||
const component = withInstall(_sfc_main);
|
||||
export { component as default };
|
||||
Binary file not shown.
@@ -0,0 +1,55 @@
|
||||
.layui-line {
|
||||
&-horizontal {
|
||||
position: relative;
|
||||
clear: both;
|
||||
width: 100%;
|
||||
min-width: 100%;
|
||||
max-width: 100%;
|
||||
margin: var(--layui-line-margin) 0;
|
||||
border-bottom: var(--layui-line-border-width) var(--layui-line-border-style) var(--global-neutral-color-5);
|
||||
border-top-style: none;
|
||||
border-left-style: none;
|
||||
border-right-style: none;
|
||||
|
||||
&.layui-line-with-text {
|
||||
margin: 14px 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-vertical {
|
||||
display: inline-block;
|
||||
min-width: 1px;
|
||||
max-width: 1px;
|
||||
height: 1em;
|
||||
margin: 0 var(--layui-line-margin);
|
||||
vertical-align: middle;
|
||||
border-left: var(--layui-line-border-width) var(--layui-line-border-style) var(--global-neutral-color-5);
|
||||
border-top-style: none;
|
||||
border-bottom-style: none;
|
||||
border-right-style: none;
|
||||
}
|
||||
|
||||
&-text {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
box-sizing: border-box;
|
||||
padding: 0 10px;
|
||||
color: currentColor;
|
||||
line-height: 2;
|
||||
background-color: #FFF;
|
||||
transform: translateY(-50%);
|
||||
|
||||
&-center {
|
||||
left: var(--layui-line-text-offset);
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
&-left {
|
||||
left: var(--layui-line-text-offset);
|
||||
}
|
||||
|
||||
&-right {
|
||||
right: var(--layui-line-text-offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
x}<7D>1<0B>0<10><><EFBFBD>+nTpi<17>ťtH<74><48><06>Ii<49><69><EFBFBD><EFBFBD>ݦ<EFBFBD><DDA6>8t{<7B><><EFBFBD><EFBFBD>;N<><4E>z<EFBFBD><7A><EFBFBD><EFBFBD>ҵ<05><><10>H<EFBFBD><48>+#<23>?o<><6F>Z<EFBFBD>;|z<>f<EFBFBD>T<EFBFBD><54>X<07>{DI<14>0<EFBFBD>,<2C>7<EFBFBD>ģ<><12>@<40>ѻ<EFBFBD>?(iW<69>8R<38>R<EFBFBD>(<28><05>f<EFBFBD>FH<46>8<EFBFBD>hϸքLy<4C>tdeE<65><1B><>d<EFBFBD>S<><53>k47<34>Ͼ<EFBFBD>P<EFBFBD><50>%H<>/0<30><7F>14Z<34>$<24><><EFBFBD><EFBFBD>)<29><>#<23><0F>φ<EFBFBD>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
x<01>U<EFBFBD>r<EFBFBD> <10><><EFBFBD><EFBFBD><EFBFBD>әvZ+i<>Dy<44><79>
|
||||
|
||||
<20>i&<26><><EFBFBD>",98<39>CG<43><0B><><EFBFBD>s<EFBFBD>.<2E><>-<2D><><EFBFBD><EFBFBD><EFBFBD>/<2F><1B>q<EFBFBD>b<EFBFBD><62>lG紺<14><><EFBFBD>J2k/<2F><><EFBFBD>~׳<><D7B3>Շ剪1Z;<3B>\!<21><>3DY<44><0C>c<EFBFBD>3<14>B<>h<1B>'<27><0B>[HM<48>r<EFBFBD><72>}<7D>RU+I<>F<EFBFBD>C<EFBFBD><43>T<EFBFBD><01><1B>%;O<><4F>Z<EFBFBD><5A>74{<7B>xv<78>l<EFBFBD>qנu<D7A0>s<EFBFBD><73><EFBFBD>if<69>3<02>_<EFBFBD>[FL<46>`<60><>GA]b#<23><><EFBFBD>{<7B><>AVKA<4B>DZ<44><5A>ԦA<D4A6>c瀄<63><E78084><EFBFBD><EFBFBD> <09>d<>$N<><4E>x<0E><><EFBFBD>p<><70> 9(<28><><EFBFBD>0<EFBFBD><30> <20><>S<EFBFBD><53><EFBFBD>R<EFBFBD><04><><EFBFBD>{<7B>=*<2A>'<27><><EFBFBD><EFBFBD><EFBFBD><13>\<5C><1D><>*<2A>@<40>ן}<7D>(
|
||||
p<EFBFBD>>F<><11><>A<EFBFBD>
|
||||
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "TempleateOneIcon",
|
||||
};
|
||||
</script>
|
||||
<script setup lang="ts">
|
||||
import LayIcon from "../component/icon/index";
|
||||
|
||||
const props = defineProps<{
|
||||
color?: string;
|
||||
size?: string;
|
||||
}>();
|
||||
</script>
|
||||
<template>
|
||||
<lay-icon
|
||||
:color="props.color"
|
||||
:size="props.size"
|
||||
type="layui-icon-templeate-one"
|
||||
/>
|
||||
</template>
|
||||
Binary file not shown.
Reference in New Issue
Block a user