vue-devui 1.0.0-rc.1 → 1.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +149 -200
- package/alert/index.es.js +46 -15
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8166 -287
- package/auto-complete/index.umd.js +29 -1
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +153 -146
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.es.js +29 -4
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5726 -111
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +59 -35
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8060 -255
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/{accordion → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +379 -0
- package/collapse/index.umd.js +1 -0
- package/{anchor → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +3 -6
- package/countdown/index.umd.js +1 -1
- package/date-picker/index.es.js +8130 -242
- package/date-picker/index.umd.js +27 -1
- package/date-picker/style.css +1 -1
- package/drawer/index.es.js +31 -4
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +209 -148
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +521 -153
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +1040 -1187
- package/form/index.umd.js +16 -16
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +29 -5
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.es.js +101 -86
- package/grid/index.umd.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +182 -23
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +53 -30
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8066 -144
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +274 -177
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +40 -25
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.es.js +74 -35
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/modal/index.es.js +374 -171
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +292 -40
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/Icon.js +1 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/iconProps.js +1 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/overlay/index.es.js +104 -133
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +3 -2
- package/pagination/index.es.js +148 -136
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +294 -230
- package/popover/index.umd.js +15 -15
- package/popover/style.css +1 -1
- package/progress/index.es.js +110 -56
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.es.js +7959 -146
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +77 -55
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +169 -27
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/ripple/index.es.js +43 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +3620 -1095
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9131 -584
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +46 -24
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +108 -75
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +443 -335
- package/splitter/index.umd.js +15 -15
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +7 -18
- package/statistic/index.umd.js +1 -1
- package/status/index.es.js +26 -2
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +7794 -64
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +10038 -1180
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +342 -141
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +47 -23
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +7913 -83
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/timeline/index.es.js +176 -37
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +285 -220
- package/tooltip/index.umd.js +15 -15
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +4190 -1857
- package/tree/index.umd.js +18 -18
- package/tree/style.css +1 -1
- package/upload/index.es.js +365 -106
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +20102 -25264
- package/vue-devui.umd.js +25 -15
- package/accordion/index.es.js +0 -723
- package/accordion/index.umd.js +0 -1
- package/accordion/package.json +0 -7
- package/accordion/style.css +0 -1
- package/anchor/index.d.ts +0 -7
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/back-top/index.d.ts +0 -7
- package/back-top/index.es.js +0 -130
- package/back-top/index.umd.js +0 -1
- package/back-top/package.json +0 -7
- package/back-top/style.css +0 -1
- package/breadcrumb/index.d.ts +0 -7
- package/breadcrumb/index.es.js +0 -128
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/package.json +0 -7
- package/breadcrumb/style.css +0 -1
- package/carousel/index.d.ts +0 -7
- package/carousel/index.es.js +0 -314
- package/carousel/index.umd.js +0 -1
- package/carousel/package.json +0 -7
- package/carousel/style.css +0 -1
- package/cascader/index.d.ts +0 -7
- package/cascader/index.es.js +0 -5971
- package/cascader/index.umd.js +0 -27
- package/cascader/package.json +0 -7
- package/cascader/style.css +0 -1
- package/color-picker/index.d.ts +0 -7
- package/color-picker/index.es.js +0 -8196
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/comment/index.d.ts +0 -7
- package/comment/index.es.js +0 -86
- package/comment/index.umd.js +0 -1
- package/comment/package.json +0 -7
- package/comment/style.css +0 -1
- package/dragdrop/index.d.ts +0 -7
- package/dragdrop/index.es.js +0 -157
- package/dragdrop/index.umd.js +0 -1
- package/dragdrop/package.json +0 -7
- package/gantt/index.d.ts +0 -7
- package/gantt/index.es.js +0 -523
- package/gantt/index.umd.js +0 -1
- package/gantt/package.json +0 -7
- package/gantt/style.css +0 -1
- package/input-icon/index.d.ts +0 -7
- package/input-icon/index.es.js +0 -332
- package/input-icon/index.umd.js +0 -1
- package/input-icon/package.json +0 -7
- package/input-icon/style.css +0 -1
- package/list/index.d.ts +0 -7
- package/list/index.es.js +0 -39
- package/list/index.umd.js +0 -1
- package/list/package.json +0 -7
- package/list/style.css +0 -1
- package/nav-sprite/index.d.ts +0 -7
- package/nav-sprite/index.es.js +0 -68
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/nuxt/components/Accordion.js +0 -3
- package/nuxt/components/Anchor.js +0 -3
- package/nuxt/components/BackTop.js +0 -3
- package/nuxt/components/Breadcrumb.js +0 -3
- package/nuxt/components/Carousel.js +0 -3
- package/nuxt/components/CarouselItem.js +0 -3
- package/nuxt/components/Cascader.js +0 -3
- package/nuxt/components/ColorPicker.js +0 -3
- package/nuxt/components/Comment.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/List.js +0 -3
- package/nuxt/components/ListItem.js +0 -3
- package/nuxt/components/NavSprite.js +0 -2
- package/nuxt/components/QuadrantDiagram.js +0 -3
- package/nuxt/components/ReadTip.js +0 -3
- package/nuxt/components/StepsGuide.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/TagInput.js +0 -3
- package/nuxt/components/TimePicker.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/overlayEmits.js +0 -3
- package/nuxt/components/overlayProps.js +0 -3
- package/quadrant-diagram/index.d.ts +0 -7
- package/quadrant-diagram/index.es.js +0 -5728
- package/quadrant-diagram/index.umd.js +0 -27
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/read-tip/index.d.ts +0 -7
- package/read-tip/index.es.js +0 -261
- package/read-tip/index.umd.js +0 -1
- package/read-tip/package.json +0 -7
- package/read-tip/style.css +0 -1
- package/steps-guide/index.d.ts +0 -7
- package/steps-guide/index.es.js +0 -242
- package/steps-guide/index.umd.js +0 -1
- package/steps-guide/package.json +0 -7
- package/steps-guide/style.css +0 -1
- package/sticky/index.d.ts +0 -7
- package/sticky/index.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/sticky/package.json +0 -7
- package/tag-input/index.d.ts +0 -7
- package/tag-input/index.es.js +0 -331
- package/tag-input/index.umd.js +0 -1
- package/tag-input/package.json +0 -7
- package/tag-input/style.css +0 -1
- package/time-picker/index.d.ts +0 -7
- package/time-picker/index.es.js +0 -1238
- package/time-picker/index.umd.js +0 -1
- package/time-picker/package.json +0 -7
- package/time-picker/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7615
- package/transfer/index.umd.js +0 -27
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree-select/index.d.ts +0 -7
- package/tree-select/index.es.js +0 -627
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
package/splitter/index.es.js
CHANGED
|
@@ -1,172 +1,114 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
3
|
var __publicField = (obj, key, value) => {
|
|
21
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
5
|
return value;
|
|
23
6
|
};
|
|
24
|
-
import { defineComponent,
|
|
25
|
-
import {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
type: String,
|
|
29
|
-
default: "horizontal"
|
|
30
|
-
},
|
|
31
|
-
splitBarSize: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: "2px"
|
|
34
|
-
},
|
|
35
|
-
disabledBarSize: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: "1px"
|
|
38
|
-
},
|
|
39
|
-
showCollapseButton: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
default: true
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var baseOverlay = "";
|
|
45
|
-
function _isSlot(s) {
|
|
46
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
47
|
-
}
|
|
48
|
-
const CommonOverlay = defineComponent({
|
|
49
|
-
setup(props, ctx) {
|
|
50
|
-
return () => {
|
|
51
|
-
let _slot;
|
|
52
|
-
return createVNode(Teleport, {
|
|
53
|
-
"to": "#d-overlay-anchor"
|
|
54
|
-
}, {
|
|
55
|
-
default: () => [createVNode(Transition, {
|
|
56
|
-
"name": "devui-overlay-fade"
|
|
57
|
-
}, _isSlot(_slot = renderSlot(ctx.slots, "default")) ? _slot : {
|
|
58
|
-
default: () => [_slot]
|
|
59
|
-
})]
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
const overlayProps = {
|
|
65
|
-
visible: {
|
|
66
|
-
type: Boolean
|
|
67
|
-
},
|
|
68
|
-
backgroundBlock: {
|
|
7
|
+
import { watch, onUnmounted, defineComponent, toRefs, createVNode, Transition, mergeProps, ref, unref, nextTick, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, computed, onMounted, provide, Teleport, reactive, resolveComponent, onUpdated } from "vue";
|
|
8
|
+
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
9
|
+
const fixedOverlayProps = {
|
|
10
|
+
modelValue: {
|
|
69
11
|
type: Boolean,
|
|
70
12
|
default: false
|
|
71
13
|
},
|
|
72
|
-
|
|
73
|
-
type: String,
|
|
74
|
-
default: ""
|
|
75
|
-
},
|
|
76
|
-
backgroundStyle: {
|
|
77
|
-
type: [String, Object]
|
|
78
|
-
},
|
|
79
|
-
onBackdropClick: {
|
|
80
|
-
type: Function
|
|
81
|
-
},
|
|
82
|
-
backdropClose: {
|
|
14
|
+
lockScroll: {
|
|
83
15
|
type: Boolean,
|
|
84
16
|
default: true
|
|
85
17
|
},
|
|
86
|
-
|
|
18
|
+
closeOnClickOverlay: {
|
|
87
19
|
type: Boolean,
|
|
88
20
|
default: true
|
|
89
21
|
}
|
|
90
22
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
23
|
+
function lockScroll() {
|
|
24
|
+
if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
|
|
25
|
+
const scrollTop = document.documentElement.scrollTop;
|
|
26
|
+
const style = document.documentElement.getAttribute("style");
|
|
27
|
+
document.documentElement.style.position = "fixed";
|
|
28
|
+
document.documentElement.style.top = `-${scrollTop}px`;
|
|
29
|
+
document.documentElement.style.width = document.documentElement.style.width || "100%";
|
|
30
|
+
document.documentElement.style.overflowY = "scroll";
|
|
31
|
+
return () => {
|
|
32
|
+
if (style) {
|
|
33
|
+
document.documentElement.setAttribute("style", style);
|
|
34
|
+
} else {
|
|
35
|
+
document.documentElement.removeAttribute("style");
|
|
36
|
+
}
|
|
37
|
+
document.documentElement.scrollTop = scrollTop;
|
|
38
|
+
};
|
|
95
39
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
function
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
"devui-overlay-background",
|
|
102
|
-
props.backgroundClass,
|
|
103
|
-
!props.hasBackdrop ? "devui-overlay-background__disabled" : "devui-overlay-background__color"
|
|
104
|
-
];
|
|
105
|
-
});
|
|
106
|
-
const overlayClass = computed(() => {
|
|
107
|
-
return "devui-overlay";
|
|
108
|
-
});
|
|
109
|
-
const handleBackdropClick = (event) => {
|
|
110
|
-
var _a;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
function useFixedOverlay(props, ctx) {
|
|
43
|
+
let lockScrollCb;
|
|
44
|
+
const onClick = (event) => {
|
|
111
45
|
event.preventDefault();
|
|
112
|
-
(
|
|
113
|
-
if (props.
|
|
114
|
-
ctx.emit("update:
|
|
46
|
+
ctx.emit("click", event);
|
|
47
|
+
if (props.closeOnClickOverlay) {
|
|
48
|
+
ctx.emit("update:modelValue", false);
|
|
115
49
|
}
|
|
116
50
|
};
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
body.style.overflowY = "scroll";
|
|
127
|
-
body.style.position = visible ? "fixed" : "";
|
|
128
|
-
body.style.top = `${top}px`;
|
|
129
|
-
} else {
|
|
130
|
-
body.style.overflowY = originOverflow;
|
|
131
|
-
body.style.position = originPosition;
|
|
132
|
-
body.style.top = "";
|
|
133
|
-
window.scrollTo(0, -top);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
onUnmounted(() => {
|
|
138
|
-
document.body.style.overflow = originOverflow;
|
|
139
|
-
});
|
|
51
|
+
const removeBodyAdditions = () => {
|
|
52
|
+
lockScrollCb == null ? void 0 : lockScrollCb();
|
|
53
|
+
};
|
|
54
|
+
watch(() => props.modelValue, (val) => {
|
|
55
|
+
if (val) {
|
|
56
|
+
props.lockScroll && (lockScrollCb = lockScroll());
|
|
57
|
+
} else {
|
|
58
|
+
removeBodyAdditions();
|
|
59
|
+
}
|
|
140
60
|
});
|
|
61
|
+
onUnmounted(removeBodyAdditions);
|
|
62
|
+
return { onClick };
|
|
63
|
+
}
|
|
64
|
+
function createBem(namespace, element, modifier) {
|
|
65
|
+
let cls = namespace;
|
|
66
|
+
if (element) {
|
|
67
|
+
cls += `__${element}`;
|
|
68
|
+
}
|
|
69
|
+
if (modifier) {
|
|
70
|
+
cls += `--${modifier}`;
|
|
71
|
+
}
|
|
72
|
+
return cls;
|
|
73
|
+
}
|
|
74
|
+
function useNamespace(block, needDot = false) {
|
|
75
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
76
|
+
const b = () => createBem(namespace);
|
|
77
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
78
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
79
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
141
80
|
return {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
81
|
+
b,
|
|
82
|
+
e,
|
|
83
|
+
m,
|
|
84
|
+
em
|
|
146
85
|
};
|
|
147
86
|
}
|
|
148
87
|
var fixedOverlay = "";
|
|
149
88
|
defineComponent({
|
|
150
89
|
name: "DFixedOverlay",
|
|
90
|
+
inheritAttrs: false,
|
|
151
91
|
props: fixedOverlayProps,
|
|
152
|
-
emits:
|
|
92
|
+
emits: ["update:modelValue", "click"],
|
|
153
93
|
setup(props, ctx) {
|
|
154
94
|
const {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
95
|
+
modelValue
|
|
96
|
+
} = toRefs(props);
|
|
97
|
+
const ns2 = useNamespace("fixed-overlay");
|
|
98
|
+
const {
|
|
99
|
+
onClick
|
|
100
|
+
} = useFixedOverlay(props, ctx);
|
|
101
|
+
return () => createVNode(Transition, {
|
|
102
|
+
"name": ns2.m("fade")
|
|
103
|
+
}, {
|
|
104
|
+
default: () => {
|
|
105
|
+
var _a, _b;
|
|
106
|
+
return [modelValue.value && createVNode("div", mergeProps({
|
|
107
|
+
"class": ns2.b()
|
|
108
|
+
}, ctx.attrs, {
|
|
109
|
+
"onClick": onClick
|
|
110
|
+
}), [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])];
|
|
111
|
+
}
|
|
170
112
|
});
|
|
171
113
|
}
|
|
172
114
|
});
|
|
@@ -187,6 +129,9 @@ const flexibleOverlayProps = {
|
|
|
187
129
|
type: [Number, Object],
|
|
188
130
|
default: 8
|
|
189
131
|
},
|
|
132
|
+
shiftOffset: {
|
|
133
|
+
type: Number
|
|
134
|
+
},
|
|
190
135
|
align: {
|
|
191
136
|
type: String,
|
|
192
137
|
default: null
|
|
@@ -232,6 +177,7 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
|
232
177
|
function useOverlay(props, emit) {
|
|
233
178
|
const overlayRef = ref();
|
|
234
179
|
const arrowRef = ref();
|
|
180
|
+
let originParent = null;
|
|
235
181
|
const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
|
|
236
182
|
const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
|
|
237
183
|
const staticSide = {
|
|
@@ -253,7 +199,6 @@ function useOverlay(props, emit) {
|
|
|
253
199
|
const overlayEl = unref(overlayRef.value);
|
|
254
200
|
const arrowEl = unref(arrowRef.value);
|
|
255
201
|
const middleware = [
|
|
256
|
-
shift(),
|
|
257
202
|
offset(props.offset),
|
|
258
203
|
autoPlacement({
|
|
259
204
|
alignment: props.align,
|
|
@@ -261,30 +206,39 @@ function useOverlay(props, emit) {
|
|
|
261
206
|
})
|
|
262
207
|
];
|
|
263
208
|
props.showArrow && middleware.push(arrow({ element: arrowEl }));
|
|
209
|
+
props.shiftOffset !== void 0 && middleware.push(shift());
|
|
264
210
|
const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
|
|
265
211
|
strategy: "fixed",
|
|
266
212
|
middleware
|
|
267
213
|
});
|
|
214
|
+
let applyX = x;
|
|
215
|
+
let applyY = y;
|
|
216
|
+
if (props.shiftOffset !== void 0) {
|
|
217
|
+
const { x: shiftX, y: shiftY } = middlewareData.shift;
|
|
218
|
+
shiftX < 0 && (applyX -= props.shiftOffset);
|
|
219
|
+
shiftX > 0 && (applyX += props.shiftOffset);
|
|
220
|
+
shiftY < 0 && (applyY -= props.shiftOffset);
|
|
221
|
+
shiftY > 0 && (applyY += props.shiftOffset);
|
|
222
|
+
}
|
|
268
223
|
emit("positionChange", placement);
|
|
269
|
-
Object.assign(overlayEl.style, { top: `${
|
|
224
|
+
Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
|
|
270
225
|
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
271
226
|
};
|
|
272
227
|
watch(() => props.modelValue, () => {
|
|
273
|
-
const originParent = getScrollParent(props.origin);
|
|
274
228
|
if (props.modelValue && props.origin) {
|
|
229
|
+
originParent = getScrollParent(props.origin);
|
|
275
230
|
nextTick(updatePosition);
|
|
276
|
-
originParent.addEventListener("scroll", updatePosition);
|
|
231
|
+
originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
|
|
277
232
|
originParent !== window && window.addEventListener("scroll", updatePosition);
|
|
278
233
|
window.addEventListener("resize", updatePosition);
|
|
279
234
|
} else {
|
|
280
|
-
originParent.removeEventListener("scroll", updatePosition);
|
|
235
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
281
236
|
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
282
237
|
window.removeEventListener("resize", updatePosition);
|
|
283
238
|
}
|
|
284
239
|
});
|
|
285
240
|
onUnmounted(() => {
|
|
286
|
-
|
|
287
|
-
originParent.removeEventListener("scroll", updatePosition);
|
|
241
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
288
242
|
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
289
243
|
window.removeEventListener("resize", updatePosition);
|
|
290
244
|
});
|
|
@@ -302,6 +256,7 @@ const FlexibleOverlay = defineComponent({
|
|
|
302
256
|
emit,
|
|
303
257
|
expose
|
|
304
258
|
}) {
|
|
259
|
+
const ns2 = useNamespace("flexible-overlay");
|
|
305
260
|
const {
|
|
306
261
|
arrowRef,
|
|
307
262
|
overlayRef,
|
|
@@ -314,14 +269,70 @@ const FlexibleOverlay = defineComponent({
|
|
|
314
269
|
var _a;
|
|
315
270
|
return props.modelValue && createVNode("div", mergeProps({
|
|
316
271
|
"ref": overlayRef,
|
|
317
|
-
"class":
|
|
272
|
+
"class": ns2.b()
|
|
318
273
|
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
|
|
319
274
|
"ref": arrowRef,
|
|
320
|
-
"class": "
|
|
275
|
+
"class": ns2.e("arrow")
|
|
321
276
|
}, null)]);
|
|
322
277
|
};
|
|
323
278
|
}
|
|
324
279
|
});
|
|
280
|
+
const POPPER_TRIGGER_TOKEN = Symbol("popper-trigger");
|
|
281
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
|
282
|
+
const ns = useNamespace("popper-trigger");
|
|
283
|
+
function wrapContent(content) {
|
|
284
|
+
return h("span", { class: ns.b() }, content);
|
|
285
|
+
}
|
|
286
|
+
function getFirstValidChild(nodes) {
|
|
287
|
+
for (const child of nodes) {
|
|
288
|
+
if (isObject(child)) {
|
|
289
|
+
if (child.type === Comment) {
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
if (child.type === "svg" || child.type === Text) {
|
|
293
|
+
return wrapContent(child);
|
|
294
|
+
}
|
|
295
|
+
if (child.type === Fragment) {
|
|
296
|
+
return getFirstValidChild(child.children);
|
|
297
|
+
}
|
|
298
|
+
return child;
|
|
299
|
+
}
|
|
300
|
+
return wrapContent(child);
|
|
301
|
+
}
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
var PopperTrigger = defineComponent({
|
|
305
|
+
name: "DPopperTrigger",
|
|
306
|
+
setup(_, ctx) {
|
|
307
|
+
const {
|
|
308
|
+
slots,
|
|
309
|
+
attrs
|
|
310
|
+
} = ctx;
|
|
311
|
+
return () => {
|
|
312
|
+
var _a;
|
|
313
|
+
const defaultSlot = (_a = slots.default) == null ? void 0 : _a.call(slots, attrs);
|
|
314
|
+
const triggerRef = inject(POPPER_TRIGGER_TOKEN);
|
|
315
|
+
if (!defaultSlot) {
|
|
316
|
+
return null;
|
|
317
|
+
}
|
|
318
|
+
const firstValidChild = getFirstValidChild(defaultSlot);
|
|
319
|
+
if (!firstValidChild) {
|
|
320
|
+
return null;
|
|
321
|
+
}
|
|
322
|
+
return withDirectives(cloneVNode(firstValidChild, attrs), [[{
|
|
323
|
+
mounted(el) {
|
|
324
|
+
triggerRef.value = el;
|
|
325
|
+
},
|
|
326
|
+
updated(el) {
|
|
327
|
+
triggerRef.value = el;
|
|
328
|
+
},
|
|
329
|
+
unmounted() {
|
|
330
|
+
triggerRef.value = null;
|
|
331
|
+
}
|
|
332
|
+
}]]);
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
});
|
|
325
336
|
const tooltipProps = {
|
|
326
337
|
content: {
|
|
327
338
|
type: String,
|
|
@@ -342,6 +353,18 @@ const tooltipProps = {
|
|
|
342
353
|
mouseLeaveDelay: {
|
|
343
354
|
type: Number,
|
|
344
355
|
default: 100
|
|
356
|
+
},
|
|
357
|
+
enterable: {
|
|
358
|
+
type: Boolean,
|
|
359
|
+
default: true
|
|
360
|
+
},
|
|
361
|
+
disabled: {
|
|
362
|
+
type: Boolean,
|
|
363
|
+
default: false
|
|
364
|
+
},
|
|
365
|
+
hideAfter: {
|
|
366
|
+
type: Number,
|
|
367
|
+
default: 0
|
|
345
368
|
}
|
|
346
369
|
};
|
|
347
370
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
@@ -1055,7 +1078,7 @@ var lodash = { exports: {} };
|
|
|
1055
1078
|
var objectCtorString = funcToString.call(Object2);
|
|
1056
1079
|
var oldDash = root._;
|
|
1057
1080
|
var reIsNative = RegExp2("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
1058
|
-
var Buffer2 = moduleExports ? context.Buffer : undefined$1,
|
|
1081
|
+
var Buffer2 = moduleExports ? context.Buffer : undefined$1, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined$1, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined$1, symIterator = Symbol2 ? Symbol2.iterator : undefined$1, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined$1;
|
|
1059
1082
|
var defineProperty = function() {
|
|
1060
1083
|
try {
|
|
1061
1084
|
var func = getNative(Object2, "defineProperty");
|
|
@@ -1070,7 +1093,7 @@ var lodash = { exports: {} };
|
|
|
1070
1093
|
var metaMap = WeakMap2 && new WeakMap2();
|
|
1071
1094
|
var realNames = {};
|
|
1072
1095
|
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap2);
|
|
1073
|
-
var symbolProto =
|
|
1096
|
+
var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
|
|
1074
1097
|
function lodash2(value) {
|
|
1075
1098
|
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
|
|
1076
1099
|
if (value instanceof LodashWrapper) {
|
|
@@ -1086,7 +1109,7 @@ var lodash = { exports: {} };
|
|
|
1086
1109
|
function object() {
|
|
1087
1110
|
}
|
|
1088
1111
|
return function(proto) {
|
|
1089
|
-
if (!
|
|
1112
|
+
if (!isObject2(proto)) {
|
|
1090
1113
|
return {};
|
|
1091
1114
|
}
|
|
1092
1115
|
if (objectCreate) {
|
|
@@ -1448,7 +1471,7 @@ var lodash = { exports: {} };
|
|
|
1448
1471
|
if (result2 !== undefined$1) {
|
|
1449
1472
|
return result2;
|
|
1450
1473
|
}
|
|
1451
|
-
if (!
|
|
1474
|
+
if (!isObject2(value)) {
|
|
1452
1475
|
return value;
|
|
1453
1476
|
}
|
|
1454
1477
|
var isArr = isArray(value);
|
|
@@ -1524,7 +1547,7 @@ var lodash = { exports: {} };
|
|
|
1524
1547
|
if (typeof func != "function") {
|
|
1525
1548
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
1526
1549
|
}
|
|
1527
|
-
return
|
|
1550
|
+
return setTimeout2(function() {
|
|
1528
1551
|
func.apply(undefined$1, args);
|
|
1529
1552
|
}, wait);
|
|
1530
1553
|
}
|
|
@@ -1795,7 +1818,7 @@ var lodash = { exports: {} };
|
|
|
1795
1818
|
return true;
|
|
1796
1819
|
}
|
|
1797
1820
|
function baseIsNative(value) {
|
|
1798
|
-
if (!
|
|
1821
|
+
if (!isObject2(value) || isMasked(value)) {
|
|
1799
1822
|
return false;
|
|
1800
1823
|
}
|
|
1801
1824
|
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
@@ -1835,7 +1858,7 @@ var lodash = { exports: {} };
|
|
|
1835
1858
|
return result2;
|
|
1836
1859
|
}
|
|
1837
1860
|
function baseKeysIn(object) {
|
|
1838
|
-
if (!
|
|
1861
|
+
if (!isObject2(object)) {
|
|
1839
1862
|
return nativeKeysIn(object);
|
|
1840
1863
|
}
|
|
1841
1864
|
var isProto = isPrototype(object), result2 = [];
|
|
@@ -1880,7 +1903,7 @@ var lodash = { exports: {} };
|
|
|
1880
1903
|
}
|
|
1881
1904
|
baseFor(source, function(srcValue, key) {
|
|
1882
1905
|
stack || (stack = new Stack());
|
|
1883
|
-
if (
|
|
1906
|
+
if (isObject2(srcValue)) {
|
|
1884
1907
|
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
|
1885
1908
|
} else {
|
|
1886
1909
|
var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined$1;
|
|
@@ -1920,7 +1943,7 @@ var lodash = { exports: {} };
|
|
|
1920
1943
|
newValue = objValue;
|
|
1921
1944
|
if (isArguments(objValue)) {
|
|
1922
1945
|
newValue = toPlainObject(objValue);
|
|
1923
|
-
} else if (!
|
|
1946
|
+
} else if (!isObject2(objValue) || isFunction(objValue)) {
|
|
1924
1947
|
newValue = initCloneObject(srcValue);
|
|
1925
1948
|
}
|
|
1926
1949
|
} else {
|
|
@@ -2059,7 +2082,7 @@ var lodash = { exports: {} };
|
|
|
2059
2082
|
return shuffleSelf(array, baseClamp(n, 0, array.length));
|
|
2060
2083
|
}
|
|
2061
2084
|
function baseSet(object, path, value, customizer) {
|
|
2062
|
-
if (!
|
|
2085
|
+
if (!isObject2(object)) {
|
|
2063
2086
|
return object;
|
|
2064
2087
|
}
|
|
2065
2088
|
path = castPath(path, object);
|
|
@@ -2073,7 +2096,7 @@ var lodash = { exports: {} };
|
|
|
2073
2096
|
var objValue = nested[key];
|
|
2074
2097
|
newValue = customizer ? customizer(objValue, key, nested) : undefined$1;
|
|
2075
2098
|
if (newValue === undefined$1) {
|
|
2076
|
-
newValue =
|
|
2099
|
+
newValue = isObject2(objValue) ? objValue : isIndex(path[index2 + 1]) ? [] : {};
|
|
2077
2100
|
}
|
|
2078
2101
|
}
|
|
2079
2102
|
assignValue(nested, key, newValue);
|
|
@@ -2304,7 +2327,7 @@ var lodash = { exports: {} };
|
|
|
2304
2327
|
end = end === undefined$1 ? length : end;
|
|
2305
2328
|
return !start && end >= length ? array : baseSlice(array, start, end);
|
|
2306
2329
|
}
|
|
2307
|
-
var
|
|
2330
|
+
var clearTimeout2 = ctxClearTimeout || function(id) {
|
|
2308
2331
|
return root.clearTimeout(id);
|
|
2309
2332
|
};
|
|
2310
2333
|
function cloneBuffer(buffer, isDeep) {
|
|
@@ -2523,7 +2546,7 @@ var lodash = { exports: {} };
|
|
|
2523
2546
|
return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
|
|
2524
2547
|
}
|
|
2525
2548
|
var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
|
|
2526
|
-
return
|
|
2549
|
+
return isObject2(result2) ? result2 : thisBinding;
|
|
2527
2550
|
};
|
|
2528
2551
|
}
|
|
2529
2552
|
function createCurry(func, bitmask, arity) {
|
|
@@ -2837,7 +2860,7 @@ var lodash = { exports: {} };
|
|
|
2837
2860
|
return objValue;
|
|
2838
2861
|
}
|
|
2839
2862
|
function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
|
|
2840
|
-
if (
|
|
2863
|
+
if (isObject2(objValue) && isObject2(srcValue)) {
|
|
2841
2864
|
stack.set(srcValue, objValue);
|
|
2842
2865
|
baseMerge(objValue, srcValue, undefined$1, customDefaultsMerge, stack);
|
|
2843
2866
|
stack["delete"](srcValue);
|
|
@@ -3185,7 +3208,7 @@ var lodash = { exports: {} };
|
|
|
3185
3208
|
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
3186
3209
|
}
|
|
3187
3210
|
function isIterateeCall(value, index2, object) {
|
|
3188
|
-
if (!
|
|
3211
|
+
if (!isObject2(object)) {
|
|
3189
3212
|
return false;
|
|
3190
3213
|
}
|
|
3191
3214
|
var type = typeof index2;
|
|
@@ -3228,7 +3251,7 @@ var lodash = { exports: {} };
|
|
|
3228
3251
|
return value === proto;
|
|
3229
3252
|
}
|
|
3230
3253
|
function isStrictComparable(value) {
|
|
3231
|
-
return value === value && !
|
|
3254
|
+
return value === value && !isObject2(value);
|
|
3232
3255
|
}
|
|
3233
3256
|
function matchesStrictComparable(key, srcValue) {
|
|
3234
3257
|
return function(object) {
|
|
@@ -3333,7 +3356,7 @@ var lodash = { exports: {} };
|
|
|
3333
3356
|
return object[key];
|
|
3334
3357
|
}
|
|
3335
3358
|
var setData = shortOut(baseSetData);
|
|
3336
|
-
var
|
|
3359
|
+
var setTimeout2 = ctxSetTimeout || function(func, wait) {
|
|
3337
3360
|
return root.setTimeout(func, wait);
|
|
3338
3361
|
};
|
|
3339
3362
|
var setToString = shortOut(baseSetToString);
|
|
@@ -4110,7 +4133,7 @@ var lodash = { exports: {} };
|
|
|
4110
4133
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
4111
4134
|
}
|
|
4112
4135
|
wait = toNumber(wait) || 0;
|
|
4113
|
-
if (
|
|
4136
|
+
if (isObject2(options)) {
|
|
4114
4137
|
leading = !!options.leading;
|
|
4115
4138
|
maxing = "maxWait" in options;
|
|
4116
4139
|
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
@@ -4125,7 +4148,7 @@ var lodash = { exports: {} };
|
|
|
4125
4148
|
}
|
|
4126
4149
|
function leadingEdge(time) {
|
|
4127
4150
|
lastInvokeTime = time;
|
|
4128
|
-
timerId =
|
|
4151
|
+
timerId = setTimeout2(timerExpired, wait);
|
|
4129
4152
|
return leading ? invokeFunc(time) : result2;
|
|
4130
4153
|
}
|
|
4131
4154
|
function remainingWait(time) {
|
|
@@ -4141,7 +4164,7 @@ var lodash = { exports: {} };
|
|
|
4141
4164
|
if (shouldInvoke(time)) {
|
|
4142
4165
|
return trailingEdge(time);
|
|
4143
4166
|
}
|
|
4144
|
-
timerId =
|
|
4167
|
+
timerId = setTimeout2(timerExpired, remainingWait(time));
|
|
4145
4168
|
}
|
|
4146
4169
|
function trailingEdge(time) {
|
|
4147
4170
|
timerId = undefined$1;
|
|
@@ -4153,7 +4176,7 @@ var lodash = { exports: {} };
|
|
|
4153
4176
|
}
|
|
4154
4177
|
function cancel() {
|
|
4155
4178
|
if (timerId !== undefined$1) {
|
|
4156
|
-
|
|
4179
|
+
clearTimeout2(timerId);
|
|
4157
4180
|
}
|
|
4158
4181
|
lastInvokeTime = 0;
|
|
4159
4182
|
lastArgs = lastCallTime = lastThis = timerId = undefined$1;
|
|
@@ -4171,13 +4194,13 @@ var lodash = { exports: {} };
|
|
|
4171
4194
|
return leadingEdge(lastCallTime);
|
|
4172
4195
|
}
|
|
4173
4196
|
if (maxing) {
|
|
4174
|
-
|
|
4175
|
-
timerId =
|
|
4197
|
+
clearTimeout2(timerId);
|
|
4198
|
+
timerId = setTimeout2(timerExpired, wait);
|
|
4176
4199
|
return invokeFunc(lastCallTime);
|
|
4177
4200
|
}
|
|
4178
4201
|
}
|
|
4179
4202
|
if (timerId === undefined$1) {
|
|
4180
|
-
timerId =
|
|
4203
|
+
timerId = setTimeout2(timerExpired, wait);
|
|
4181
4204
|
}
|
|
4182
4205
|
return result2;
|
|
4183
4206
|
}
|
|
@@ -4280,7 +4303,7 @@ var lodash = { exports: {} };
|
|
|
4280
4303
|
if (typeof func != "function") {
|
|
4281
4304
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
4282
4305
|
}
|
|
4283
|
-
if (
|
|
4306
|
+
if (isObject2(options)) {
|
|
4284
4307
|
leading = "leading" in options ? !!options.leading : leading;
|
|
4285
4308
|
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
4286
4309
|
}
|
|
@@ -4388,7 +4411,7 @@ var lodash = { exports: {} };
|
|
|
4388
4411
|
return typeof value == "number" && nativeIsFinite(value);
|
|
4389
4412
|
}
|
|
4390
4413
|
function isFunction(value) {
|
|
4391
|
-
if (!
|
|
4414
|
+
if (!isObject2(value)) {
|
|
4392
4415
|
return false;
|
|
4393
4416
|
}
|
|
4394
4417
|
var tag = baseGetTag(value);
|
|
@@ -4400,7 +4423,7 @@ var lodash = { exports: {} };
|
|
|
4400
4423
|
function isLength(value) {
|
|
4401
4424
|
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
4402
4425
|
}
|
|
4403
|
-
function
|
|
4426
|
+
function isObject2(value) {
|
|
4404
4427
|
var type = typeof value;
|
|
4405
4428
|
return value != null && (type == "object" || type == "function");
|
|
4406
4429
|
}
|
|
@@ -4507,9 +4530,9 @@ var lodash = { exports: {} };
|
|
|
4507
4530
|
if (isSymbol(value)) {
|
|
4508
4531
|
return NAN;
|
|
4509
4532
|
}
|
|
4510
|
-
if (
|
|
4533
|
+
if (isObject2(value)) {
|
|
4511
4534
|
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
4512
|
-
value =
|
|
4535
|
+
value = isObject2(other) ? other + "" : other;
|
|
4513
4536
|
}
|
|
4514
4537
|
if (typeof value != "string") {
|
|
4515
4538
|
return value === 0 ? value : +value;
|
|
@@ -4730,7 +4753,7 @@ var lodash = { exports: {} };
|
|
|
4730
4753
|
var Ctor = object && object.constructor;
|
|
4731
4754
|
if (isArrLike) {
|
|
4732
4755
|
accumulator = isArr ? new Ctor() : [];
|
|
4733
|
-
} else if (
|
|
4756
|
+
} else if (isObject2(object)) {
|
|
4734
4757
|
accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
|
|
4735
4758
|
} else {
|
|
4736
4759
|
accumulator = {};
|
|
@@ -5012,7 +5035,7 @@ var lodash = { exports: {} };
|
|
|
5012
5035
|
}
|
|
5013
5036
|
function truncate(string, options) {
|
|
5014
5037
|
var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
|
|
5015
|
-
if (
|
|
5038
|
+
if (isObject2(options)) {
|
|
5016
5039
|
var separator = "separator" in options ? options.separator : separator;
|
|
5017
5040
|
length = "length" in options ? toInteger(options.length) : length;
|
|
5018
5041
|
omission = "omission" in options ? baseToString(options.omission) : omission;
|
|
@@ -5142,13 +5165,13 @@ var lodash = { exports: {} };
|
|
|
5142
5165
|
});
|
|
5143
5166
|
function mixin(object, source, options) {
|
|
5144
5167
|
var props = keys(source), methodNames = baseFunctions(source, props);
|
|
5145
|
-
if (options == null && !(
|
|
5168
|
+
if (options == null && !(isObject2(source) && (methodNames.length || !props.length))) {
|
|
5146
5169
|
options = source;
|
|
5147
5170
|
source = object;
|
|
5148
5171
|
object = this;
|
|
5149
5172
|
methodNames = baseFunctions(source, keys(source));
|
|
5150
5173
|
}
|
|
5151
|
-
var chain2 = !(
|
|
5174
|
+
var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object);
|
|
5152
5175
|
arrayEach(methodNames, function(methodName) {
|
|
5153
5176
|
var func = source[methodName];
|
|
5154
5177
|
object[methodName] = func;
|
|
@@ -5494,7 +5517,7 @@ var lodash = { exports: {} };
|
|
|
5494
5517
|
lodash2.isNil = isNil;
|
|
5495
5518
|
lodash2.isNull = isNull;
|
|
5496
5519
|
lodash2.isNumber = isNumber;
|
|
5497
|
-
lodash2.isObject =
|
|
5520
|
+
lodash2.isObject = isObject2;
|
|
5498
5521
|
lodash2.isObjectLike = isObjectLike;
|
|
5499
5522
|
lodash2.isPlainObject = isPlainObject;
|
|
5500
5523
|
lodash2.isRegExp = isRegExp;
|
|
@@ -5763,7 +5786,7 @@ const TransformOriginMap = {
|
|
|
5763
5786
|
right: "-8px 50%"
|
|
5764
5787
|
};
|
|
5765
5788
|
function useTooltip(origin, props) {
|
|
5766
|
-
const { position, mouseEnterDelay, mouseLeaveDelay } = toRefs(props);
|
|
5789
|
+
const { position, mouseEnterDelay, mouseLeaveDelay, enterable, disabled, hideAfter } = toRefs(props);
|
|
5767
5790
|
const visible = ref(false);
|
|
5768
5791
|
const isEnter = ref(false);
|
|
5769
5792
|
const positionArr = computed(() => typeof position.value === "string" ? [position.value] : position.value);
|
|
@@ -5778,6 +5801,9 @@ function useTooltip(origin, props) {
|
|
|
5778
5801
|
!isEnter.value && (visible.value = false);
|
|
5779
5802
|
}, mouseLeaveDelay.value);
|
|
5780
5803
|
const onMouseenter = () => {
|
|
5804
|
+
if (disabled.value) {
|
|
5805
|
+
return;
|
|
5806
|
+
}
|
|
5781
5807
|
isEnter.value = true;
|
|
5782
5808
|
enter();
|
|
5783
5809
|
};
|
|
@@ -5788,11 +5814,29 @@ function useTooltip(origin, props) {
|
|
|
5788
5814
|
const onPositionChange = (pos) => {
|
|
5789
5815
|
placement.value = pos;
|
|
5790
5816
|
};
|
|
5817
|
+
const quickLeave = () => {
|
|
5818
|
+
isEnter.value = false;
|
|
5819
|
+
visible.value = false;
|
|
5820
|
+
};
|
|
5821
|
+
const onMouseenterOverlay = () => {
|
|
5822
|
+
if (!enterable.value) {
|
|
5823
|
+
quickLeave();
|
|
5824
|
+
} else {
|
|
5825
|
+
onMouseenter();
|
|
5826
|
+
}
|
|
5827
|
+
};
|
|
5791
5828
|
onMounted(() => {
|
|
5792
5829
|
origin.value.addEventListener("mouseenter", onMouseenter);
|
|
5793
5830
|
origin.value.addEventListener("mouseleave", onMouseleave);
|
|
5794
5831
|
});
|
|
5795
|
-
|
|
5832
|
+
let timer;
|
|
5833
|
+
watch(visible, (newVal) => {
|
|
5834
|
+
if (newVal && hideAfter.value) {
|
|
5835
|
+
timer && clearTimeout(timer);
|
|
5836
|
+
timer = setTimeout(quickLeave, hideAfter.value);
|
|
5837
|
+
}
|
|
5838
|
+
});
|
|
5839
|
+
return { visible, placement, positionArr, overlayStyles, onPositionChange, onMouseenter, onMouseleave, onMouseenterOverlay };
|
|
5796
5840
|
}
|
|
5797
5841
|
var tooltip = "";
|
|
5798
5842
|
var DToolTip = defineComponent({
|
|
@@ -5812,38 +5856,43 @@ var DToolTip = defineComponent({
|
|
|
5812
5856
|
placement,
|
|
5813
5857
|
positionArr,
|
|
5814
5858
|
overlayStyles,
|
|
5815
|
-
onPositionChange
|
|
5859
|
+
onPositionChange,
|
|
5860
|
+
onMouseleave,
|
|
5861
|
+
onMouseenterOverlay
|
|
5816
5862
|
} = useTooltip(origin, props);
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5863
|
+
const ns2 = useNamespace("tooltip");
|
|
5864
|
+
provide(POPPER_TRIGGER_TOKEN, origin);
|
|
5865
|
+
return () => createVNode(Fragment, null, [createVNode(PopperTrigger, null, {
|
|
5866
|
+
default: () => {
|
|
5867
|
+
var _a;
|
|
5868
|
+
return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
|
|
5869
|
+
}
|
|
5870
|
+
}), createVNode(Teleport, {
|
|
5871
|
+
"to": "body"
|
|
5872
|
+
}, {
|
|
5873
|
+
default: () => [createVNode(Transition, {
|
|
5874
|
+
"name": showAnimation.value ? ns2.m(`fade-${placement.value}`) : ""
|
|
5824
5875
|
}, {
|
|
5825
|
-
default: () => [createVNode(
|
|
5826
|
-
"
|
|
5876
|
+
default: () => [createVNode(FlexibleOverlay, {
|
|
5877
|
+
"modelValue": visible.value,
|
|
5878
|
+
"onUpdate:modelValue": ($event) => visible.value = $event,
|
|
5879
|
+
"ref": tooltipRef,
|
|
5880
|
+
"class": ns2.b(),
|
|
5881
|
+
"origin": origin.value,
|
|
5882
|
+
"position": positionArr.value,
|
|
5883
|
+
"offset": 6,
|
|
5884
|
+
"show-arrow": true,
|
|
5885
|
+
"style": overlayStyles.value,
|
|
5886
|
+
"onPositionChange": onPositionChange,
|
|
5887
|
+
"onMouseenter": onMouseenterOverlay,
|
|
5888
|
+
"onMouseleave": onMouseleave
|
|
5827
5889
|
}, {
|
|
5828
|
-
default: () => [createVNode(
|
|
5829
|
-
"
|
|
5830
|
-
|
|
5831
|
-
"ref": tooltipRef,
|
|
5832
|
-
"class": "devui-tooltip",
|
|
5833
|
-
"origin": origin.value,
|
|
5834
|
-
"position": positionArr.value,
|
|
5835
|
-
"offset": 6,
|
|
5836
|
-
"show-arrow": true,
|
|
5837
|
-
"style": overlayStyles.value,
|
|
5838
|
-
"onPositionChange": onPositionChange
|
|
5839
|
-
}, {
|
|
5840
|
-
default: () => [createVNode("span", {
|
|
5841
|
-
"innerHTML": content.value
|
|
5842
|
-
}, null)]
|
|
5843
|
-
})]
|
|
5890
|
+
default: () => [createVNode("span", {
|
|
5891
|
+
"innerHTML": content.value
|
|
5892
|
+
}, null)]
|
|
5844
5893
|
})]
|
|
5845
|
-
})]
|
|
5846
|
-
};
|
|
5894
|
+
})]
|
|
5895
|
+
})]);
|
|
5847
5896
|
}
|
|
5848
5897
|
});
|
|
5849
5898
|
function setStyle(element, style) {
|
|
@@ -5883,58 +5932,58 @@ function removeClass(el, className) {
|
|
|
5883
5932
|
}
|
|
5884
5933
|
}
|
|
5885
5934
|
}
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
}
|
|
5898
|
-
};
|
|
5899
|
-
function bindEvent(el) {
|
|
5900
|
-
bind(el, "mousedown", onMousedown);
|
|
5935
|
+
function normalizeEvent(evt) {
|
|
5936
|
+
return {
|
|
5937
|
+
pageX: evt.pageX,
|
|
5938
|
+
pageY: evt.pageY,
|
|
5939
|
+
clientX: evt.clientX,
|
|
5940
|
+
clientY: evt.clientY,
|
|
5941
|
+
offsetX: evt.offsetX,
|
|
5942
|
+
offsetY: evt.offsetY,
|
|
5943
|
+
type: evt.type,
|
|
5944
|
+
originalEvent: evt
|
|
5945
|
+
};
|
|
5901
5946
|
}
|
|
5902
|
-
function bind(el,
|
|
5903
|
-
el.addEventListener && el.addEventListener(
|
|
5947
|
+
function bind(el, eventName, callback) {
|
|
5948
|
+
el.addEventListener && el.addEventListener(eventName, callback);
|
|
5904
5949
|
}
|
|
5905
|
-
function unbind(el,
|
|
5906
|
-
el.removeEventListener && el.removeEventListener(
|
|
5950
|
+
function unbind(el, eventName, callback) {
|
|
5951
|
+
el.removeEventListener && el.removeEventListener(eventName, callback);
|
|
5907
5952
|
}
|
|
5908
5953
|
function onMousedown(e) {
|
|
5909
5954
|
var _a;
|
|
5910
|
-
const
|
|
5911
|
-
if (
|
|
5955
|
+
const resizeProps = (_a = e == null ? void 0 : e.target) == null ? void 0 : _a.resizeProps;
|
|
5956
|
+
if (!resizeProps) {
|
|
5912
5957
|
return;
|
|
5913
5958
|
}
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
$value.onPressEvent(normalizeEvent(e));
|
|
5917
|
-
function onMousemove(e2) {
|
|
5918
|
-
$value.onDragEvent(normalizeEvent(e2));
|
|
5959
|
+
function onMousemove(evt) {
|
|
5960
|
+
resizeProps.onDragEvent(normalizeEvent(evt));
|
|
5919
5961
|
}
|
|
5920
|
-
function onMouseup(
|
|
5962
|
+
function onMouseup(evt) {
|
|
5921
5963
|
unbind(document, "mousemove", onMousemove);
|
|
5922
5964
|
unbind(document, "mouseup", onMouseup);
|
|
5923
|
-
|
|
5965
|
+
resizeProps.onReleaseEvent(normalizeEvent(evt));
|
|
5924
5966
|
}
|
|
5967
|
+
bind(document, "mousemove", onMousemove);
|
|
5968
|
+
bind(document, "mouseup", onMouseup);
|
|
5969
|
+
resizeProps.onPressEvent(normalizeEvent(e));
|
|
5925
5970
|
}
|
|
5926
|
-
function
|
|
5927
|
-
|
|
5928
|
-
pageX: e.pageX,
|
|
5929
|
-
pageY: e.pageY,
|
|
5930
|
-
clientX: e.clientX,
|
|
5931
|
-
clientY: e.clientY,
|
|
5932
|
-
offsetX: e.offsetX,
|
|
5933
|
-
offsetY: e.offsetY,
|
|
5934
|
-
type: e.type,
|
|
5935
|
-
originalEvent: e
|
|
5936
|
-
};
|
|
5971
|
+
function bindEvent(el) {
|
|
5972
|
+
bind(el, "mousedown", onMousedown);
|
|
5937
5973
|
}
|
|
5974
|
+
const resize = {
|
|
5975
|
+
mounted(el, { value }) {
|
|
5976
|
+
el.resizeProps = value;
|
|
5977
|
+
if (value.enableResize) {
|
|
5978
|
+
bindEvent(el);
|
|
5979
|
+
}
|
|
5980
|
+
},
|
|
5981
|
+
unmounted(el, { value }) {
|
|
5982
|
+
if (value.enableResize) {
|
|
5983
|
+
unbind(el, "mousedown", onMousedown);
|
|
5984
|
+
}
|
|
5985
|
+
}
|
|
5986
|
+
};
|
|
5938
5987
|
const splitterBarProps = {
|
|
5939
5988
|
index: {
|
|
5940
5989
|
type: Number
|
|
@@ -5963,9 +6012,10 @@ var DSplitterBar = defineComponent({
|
|
|
5963
6012
|
},
|
|
5964
6013
|
props: splitterBarProps,
|
|
5965
6014
|
setup(props) {
|
|
6015
|
+
const ns2 = useNamespace("splitter");
|
|
5966
6016
|
const store = inject("splitterStore");
|
|
5967
6017
|
const state = reactive({
|
|
5968
|
-
wrapperClass:
|
|
6018
|
+
wrapperClass: `${ns2.e("bar")} ${ns2.em("bar", props.orientation)} `
|
|
5969
6019
|
});
|
|
5970
6020
|
const domRef = ref();
|
|
5971
6021
|
watch([() => props.splitBarSize, domRef], ([curSplitBarSize, ele]) => {
|
|
@@ -5978,10 +6028,13 @@ var DSplitterBar = defineComponent({
|
|
|
5978
6028
|
}, {
|
|
5979
6029
|
immediate: true
|
|
5980
6030
|
});
|
|
5981
|
-
watch([() => store.state.panes, domRef], ([
|
|
6031
|
+
watch([() => store == null ? void 0 : store.state.panes, domRef], ([, ele]) => {
|
|
6032
|
+
if (!store || !props || props.index === void 0) {
|
|
6033
|
+
return;
|
|
6034
|
+
}
|
|
5982
6035
|
if (!store.isStaticBar(props.index)) {
|
|
5983
6036
|
state.wrapperClass += " resizable";
|
|
5984
|
-
} else {
|
|
6037
|
+
} else if (ele) {
|
|
5985
6038
|
setStyle(ele, {
|
|
5986
6039
|
flexBasis: props.disabledBarSize
|
|
5987
6040
|
});
|
|
@@ -5989,62 +6042,10 @@ var DSplitterBar = defineComponent({
|
|
|
5989
6042
|
}, {
|
|
5990
6043
|
deep: true
|
|
5991
6044
|
});
|
|
5992
|
-
const coordinate = {
|
|
5993
|
-
pageX: 0,
|
|
5994
|
-
pageY: 0,
|
|
5995
|
-
originalX: 0,
|
|
5996
|
-
originalY: 0
|
|
5997
|
-
};
|
|
5998
|
-
let initState;
|
|
5999
|
-
const resizeProp = {
|
|
6000
|
-
enableResize: true,
|
|
6001
|
-
onPressEvent: function({
|
|
6002
|
-
originalEvent
|
|
6003
|
-
}) {
|
|
6004
|
-
originalEvent.stopPropagation();
|
|
6005
|
-
if (!store.isResizable(props.index)) {
|
|
6006
|
-
return;
|
|
6007
|
-
}
|
|
6008
|
-
initState = store.dragState(props.index);
|
|
6009
|
-
coordinate.originalX = originalEvent.pageX;
|
|
6010
|
-
coordinate.originalY = originalEvent.pageY;
|
|
6011
|
-
},
|
|
6012
|
-
onDragEvent: function({
|
|
6013
|
-
originalEvent
|
|
6014
|
-
}) {
|
|
6015
|
-
originalEvent.stopPropagation();
|
|
6016
|
-
if (!store.isResizable(props.index)) {
|
|
6017
|
-
return;
|
|
6018
|
-
}
|
|
6019
|
-
coordinate.pageX = originalEvent.pageX;
|
|
6020
|
-
coordinate.pageY = originalEvent.pageY;
|
|
6021
|
-
let distance;
|
|
6022
|
-
if (props.orientation === "vertical") {
|
|
6023
|
-
distance = coordinate.pageY - coordinate.originalY;
|
|
6024
|
-
} else {
|
|
6025
|
-
distance = coordinate.pageX - coordinate.originalX;
|
|
6026
|
-
}
|
|
6027
|
-
store.setSize(initState, distance);
|
|
6028
|
-
},
|
|
6029
|
-
onReleaseEvent: function({
|
|
6030
|
-
originalEvent
|
|
6031
|
-
}) {
|
|
6032
|
-
originalEvent.stopPropagation();
|
|
6033
|
-
if (!store.isResizable(props.index)) {
|
|
6034
|
-
return;
|
|
6035
|
-
}
|
|
6036
|
-
coordinate.pageX = originalEvent.pageX;
|
|
6037
|
-
coordinate.pageY = originalEvent.pageY;
|
|
6038
|
-
let distance;
|
|
6039
|
-
if (props.orientation === "vertical") {
|
|
6040
|
-
distance = coordinate.pageY - coordinate.originalY;
|
|
6041
|
-
} else {
|
|
6042
|
-
distance = coordinate.pageX - coordinate.originalX;
|
|
6043
|
-
}
|
|
6044
|
-
store.setSize(initState, distance);
|
|
6045
|
-
}
|
|
6046
|
-
};
|
|
6047
6045
|
const queryPanes = (index2, nearIndex) => {
|
|
6046
|
+
if (!store) {
|
|
6047
|
+
return {};
|
|
6048
|
+
}
|
|
6048
6049
|
const pane = store.getPane(index2);
|
|
6049
6050
|
const nearPane = store.getPane(nearIndex);
|
|
6050
6051
|
return {
|
|
@@ -6056,15 +6057,18 @@ var DSplitterBar = defineComponent({
|
|
|
6056
6057
|
var _a, _b, _c, _d;
|
|
6057
6058
|
const isCollapsible = ((_b = (_a = pane == null ? void 0 : pane.component) == null ? void 0 : _a.props) == null ? void 0 : _b.collapsible) && showIcon;
|
|
6058
6059
|
const isCollapsed = (_d = (_c = pane == null ? void 0 : pane.component) == null ? void 0 : _c.props) == null ? void 0 : _d.collapsed;
|
|
6059
|
-
const isNearPaneCollapsed = nearPane.collapsed;
|
|
6060
|
+
const isNearPaneCollapsed = nearPane == null ? void 0 : nearPane.collapsed;
|
|
6060
6061
|
return {
|
|
6061
|
-
"
|
|
6062
|
+
[ns2.e("collapse")]: isCollapsible,
|
|
6062
6063
|
collapsed: isCollapsed,
|
|
6063
6064
|
hidden: isNearPaneCollapsed
|
|
6064
6065
|
};
|
|
6065
6066
|
};
|
|
6066
6067
|
const prevClass = computed(() => {
|
|
6067
6068
|
var _a, _b;
|
|
6069
|
+
if (!props || props.index === void 0) {
|
|
6070
|
+
return {};
|
|
6071
|
+
}
|
|
6068
6072
|
const {
|
|
6069
6073
|
pane,
|
|
6070
6074
|
nearPane
|
|
@@ -6074,6 +6078,9 @@ var DSplitterBar = defineComponent({
|
|
|
6074
6078
|
});
|
|
6075
6079
|
const nextClass = computed(() => {
|
|
6076
6080
|
var _a, _b;
|
|
6081
|
+
if (!store || !props || props.index === void 0) {
|
|
6082
|
+
return {};
|
|
6083
|
+
}
|
|
6077
6084
|
const {
|
|
6078
6085
|
pane,
|
|
6079
6086
|
nearPane
|
|
@@ -6083,6 +6090,9 @@ var DSplitterBar = defineComponent({
|
|
|
6083
6090
|
});
|
|
6084
6091
|
const toggleResize = () => {
|
|
6085
6092
|
var _a, _b, _c, _d;
|
|
6093
|
+
if (!domRef.value || !props || props.index === void 0) {
|
|
6094
|
+
return;
|
|
6095
|
+
}
|
|
6086
6096
|
const {
|
|
6087
6097
|
pane,
|
|
6088
6098
|
nearPane
|
|
@@ -6095,10 +6105,16 @@ var DSplitterBar = defineComponent({
|
|
|
6095
6105
|
}
|
|
6096
6106
|
};
|
|
6097
6107
|
const handleCollapsePrePane = (lockStatus) => {
|
|
6108
|
+
if (!store || !props || props.index === void 0) {
|
|
6109
|
+
return;
|
|
6110
|
+
}
|
|
6098
6111
|
store.tooglePane(props.index, props.index + 1, lockStatus);
|
|
6099
6112
|
toggleResize();
|
|
6100
6113
|
};
|
|
6101
6114
|
const handleCollapseNextPane = (lockStatus) => {
|
|
6115
|
+
if (!store || !props || props.index === void 0) {
|
|
6116
|
+
return;
|
|
6117
|
+
}
|
|
6102
6118
|
store.tooglePane(props.index + 1, props.index, lockStatus);
|
|
6103
6119
|
toggleResize();
|
|
6104
6120
|
};
|
|
@@ -6106,11 +6122,78 @@ var DSplitterBar = defineComponent({
|
|
|
6106
6122
|
handleCollapsePrePane(true);
|
|
6107
6123
|
handleCollapseNextPane(true);
|
|
6108
6124
|
};
|
|
6125
|
+
const coordinate = {
|
|
6126
|
+
pageX: 0,
|
|
6127
|
+
pageY: 0,
|
|
6128
|
+
originalX: 0,
|
|
6129
|
+
originalY: 0
|
|
6130
|
+
};
|
|
6131
|
+
let initState;
|
|
6132
|
+
const resizeProp = {
|
|
6133
|
+
enableResize: true,
|
|
6134
|
+
onPressEvent: function({
|
|
6135
|
+
originalEvent
|
|
6136
|
+
}) {
|
|
6137
|
+
originalEvent.stopPropagation();
|
|
6138
|
+
if (!store || !props || props.index === void 0) {
|
|
6139
|
+
return;
|
|
6140
|
+
}
|
|
6141
|
+
if (!store.isResizable(props.index)) {
|
|
6142
|
+
return;
|
|
6143
|
+
}
|
|
6144
|
+
initState = store.dragState(props.index);
|
|
6145
|
+
coordinate.originalX = originalEvent.pageX;
|
|
6146
|
+
coordinate.originalY = originalEvent.pageY;
|
|
6147
|
+
},
|
|
6148
|
+
onDragEvent: function({
|
|
6149
|
+
originalEvent
|
|
6150
|
+
}) {
|
|
6151
|
+
originalEvent.stopPropagation();
|
|
6152
|
+
if (!store || !props || props.index === void 0) {
|
|
6153
|
+
return;
|
|
6154
|
+
}
|
|
6155
|
+
if (!store.isResizable(props.index)) {
|
|
6156
|
+
return;
|
|
6157
|
+
}
|
|
6158
|
+
coordinate.pageX = originalEvent.pageX;
|
|
6159
|
+
coordinate.pageY = originalEvent.pageY;
|
|
6160
|
+
let distance;
|
|
6161
|
+
if (props.orientation === "vertical") {
|
|
6162
|
+
distance = coordinate.pageY - coordinate.originalY;
|
|
6163
|
+
} else {
|
|
6164
|
+
distance = coordinate.pageX - coordinate.originalX;
|
|
6165
|
+
}
|
|
6166
|
+
store.setSize(initState, distance);
|
|
6167
|
+
},
|
|
6168
|
+
onReleaseEvent: function({
|
|
6169
|
+
originalEvent
|
|
6170
|
+
}) {
|
|
6171
|
+
originalEvent.stopPropagation();
|
|
6172
|
+
if (!store || !props || props.index === void 0) {
|
|
6173
|
+
return;
|
|
6174
|
+
}
|
|
6175
|
+
if (!store.isResizable(props.index)) {
|
|
6176
|
+
return;
|
|
6177
|
+
}
|
|
6178
|
+
coordinate.pageX = originalEvent.pageX;
|
|
6179
|
+
coordinate.pageY = originalEvent.pageY;
|
|
6180
|
+
let distance;
|
|
6181
|
+
if (props.orientation === "vertical") {
|
|
6182
|
+
distance = coordinate.pageY - coordinate.originalY;
|
|
6183
|
+
} else {
|
|
6184
|
+
distance = coordinate.pageX - coordinate.originalX;
|
|
6185
|
+
}
|
|
6186
|
+
store.setSize(initState, distance);
|
|
6187
|
+
}
|
|
6188
|
+
};
|
|
6109
6189
|
onMounted(() => {
|
|
6110
6190
|
initialCollapseStatus();
|
|
6111
6191
|
});
|
|
6112
6192
|
const renderCollapsedTip = () => {
|
|
6113
6193
|
var _a, _b, _c, _d;
|
|
6194
|
+
if (!props || props.index === void 0) {
|
|
6195
|
+
return "\u6536\u8D77";
|
|
6196
|
+
}
|
|
6114
6197
|
const {
|
|
6115
6198
|
pane,
|
|
6116
6199
|
nearPane
|
|
@@ -6131,9 +6214,7 @@ var DSplitterBar = defineComponent({
|
|
|
6131
6214
|
handleCollapsePrePane();
|
|
6132
6215
|
}
|
|
6133
6216
|
}, null)]
|
|
6134
|
-
}), createVNode(
|
|
6135
|
-
"class": "devui-resize-handle"
|
|
6136
|
-
}, null), props.showCollapseButton && createVNode(DToolTip, {
|
|
6217
|
+
}), props.showCollapseButton && createVNode(DToolTip, {
|
|
6137
6218
|
"content": renderCollapsedTip()
|
|
6138
6219
|
}, {
|
|
6139
6220
|
default: () => [createVNode("div", {
|
|
@@ -6254,6 +6335,24 @@ class SplitterStore {
|
|
|
6254
6335
|
}
|
|
6255
6336
|
}
|
|
6256
6337
|
}
|
|
6338
|
+
const splitterProps = {
|
|
6339
|
+
orientation: {
|
|
6340
|
+
type: String,
|
|
6341
|
+
default: "horizontal"
|
|
6342
|
+
},
|
|
6343
|
+
splitBarSize: {
|
|
6344
|
+
type: String,
|
|
6345
|
+
default: "2px"
|
|
6346
|
+
},
|
|
6347
|
+
disabledBarSize: {
|
|
6348
|
+
type: String,
|
|
6349
|
+
default: "1px"
|
|
6350
|
+
},
|
|
6351
|
+
showCollapseButton: {
|
|
6352
|
+
type: Boolean,
|
|
6353
|
+
default: true
|
|
6354
|
+
}
|
|
6355
|
+
};
|
|
6257
6356
|
var splitter = "";
|
|
6258
6357
|
var Splitter = defineComponent({
|
|
6259
6358
|
name: "DSplitter",
|
|
@@ -6268,6 +6367,7 @@ var Splitter = defineComponent({
|
|
|
6268
6367
|
const state = reactive({
|
|
6269
6368
|
panes: []
|
|
6270
6369
|
});
|
|
6370
|
+
const ns2 = useNamespace("splitter");
|
|
6271
6371
|
state.panes = ((_b = (_a = ctx.slots).DSplitterPane) == null ? void 0 : _b.call(_a)) || [];
|
|
6272
6372
|
store.setPanes({
|
|
6273
6373
|
panes: state.panes
|
|
@@ -6295,7 +6395,9 @@ var Splitter = defineComponent({
|
|
|
6295
6395
|
return;
|
|
6296
6396
|
}
|
|
6297
6397
|
refreshSplitterContainerSize();
|
|
6298
|
-
|
|
6398
|
+
if (domRef.value) {
|
|
6399
|
+
observer.observe(domRef.value);
|
|
6400
|
+
}
|
|
6299
6401
|
});
|
|
6300
6402
|
onUnmounted(() => {
|
|
6301
6403
|
observer.disconnect();
|
|
@@ -6306,7 +6408,7 @@ var Splitter = defineComponent({
|
|
|
6306
6408
|
orientation,
|
|
6307
6409
|
showCollapseButton
|
|
6308
6410
|
} = props;
|
|
6309
|
-
const wrapperClass = [
|
|
6411
|
+
const wrapperClass = [ns2.b(), ns2.m(orientation)];
|
|
6310
6412
|
return createVNode("div", {
|
|
6311
6413
|
"class": wrapperClass,
|
|
6312
6414
|
"ref": domRef
|
|
@@ -6370,6 +6472,7 @@ var SplitterPane = defineComponent({
|
|
|
6370
6472
|
const store = inject("splitterStore");
|
|
6371
6473
|
const domRef = ref();
|
|
6372
6474
|
const orderRef = ref();
|
|
6475
|
+
const ns2 = useNamespace("splitter");
|
|
6373
6476
|
watch([orderRef, domRef], ([order, ele]) => {
|
|
6374
6477
|
if (!ele) {
|
|
6375
6478
|
return;
|
|
@@ -6383,7 +6486,7 @@ var SplitterPane = defineComponent({
|
|
|
6383
6486
|
return;
|
|
6384
6487
|
}
|
|
6385
6488
|
ele.style.flexBasis = curSize;
|
|
6386
|
-
const paneFixedClass = "
|
|
6489
|
+
const paneFixedClass = ns2.em("pane", "fixed");
|
|
6387
6490
|
if (curSize) {
|
|
6388
6491
|
addClass(ele, paneFixedClass);
|
|
6389
6492
|
} else {
|
|
@@ -6391,27 +6494,35 @@ var SplitterPane = defineComponent({
|
|
|
6391
6494
|
}
|
|
6392
6495
|
};
|
|
6393
6496
|
watch([() => props.size, domRef], ([size, ele]) => {
|
|
6394
|
-
|
|
6497
|
+
if (size && ele) {
|
|
6498
|
+
setSizeStyle(size, ele);
|
|
6499
|
+
}
|
|
6395
6500
|
}, {
|
|
6396
6501
|
immediate: true
|
|
6397
6502
|
});
|
|
6398
6503
|
const orientation = inject("orientation");
|
|
6399
6504
|
let initialSize = "";
|
|
6400
6505
|
onMounted(() => {
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6506
|
+
if (props.size) {
|
|
6507
|
+
initialSize = props.size;
|
|
6508
|
+
}
|
|
6509
|
+
if (store) {
|
|
6510
|
+
store.setPanes({
|
|
6511
|
+
panes: store.state.panes
|
|
6512
|
+
});
|
|
6513
|
+
}
|
|
6405
6514
|
});
|
|
6406
6515
|
onUpdated(() => {
|
|
6407
|
-
store
|
|
6408
|
-
|
|
6409
|
-
|
|
6516
|
+
if (store) {
|
|
6517
|
+
store.setPanes({
|
|
6518
|
+
panes: store.state.panes
|
|
6519
|
+
});
|
|
6520
|
+
}
|
|
6410
6521
|
});
|
|
6411
6522
|
const getPaneSize = () => {
|
|
6412
6523
|
const ele = domRef.value;
|
|
6413
6524
|
if (!ele) {
|
|
6414
|
-
return;
|
|
6525
|
+
return 0;
|
|
6415
6526
|
}
|
|
6416
6527
|
if (orientation === "vertical") {
|
|
6417
6528
|
return ele.offsetHeight;
|
|
@@ -6423,7 +6534,7 @@ var SplitterPane = defineComponent({
|
|
|
6423
6534
|
if (!ele) {
|
|
6424
6535
|
return;
|
|
6425
6536
|
}
|
|
6426
|
-
const paneHiddenClass = "
|
|
6537
|
+
const paneHiddenClass = ns2.em("pane", "hidden");
|
|
6427
6538
|
if (!collapsed) {
|
|
6428
6539
|
removeClass(ele, paneHiddenClass);
|
|
6429
6540
|
} else {
|
|
@@ -6447,7 +6558,7 @@ var SplitterPane = defineComponent({
|
|
|
6447
6558
|
if (!(ele instanceof HTMLElement)) {
|
|
6448
6559
|
return;
|
|
6449
6560
|
}
|
|
6450
|
-
const flexGrowClass = "
|
|
6561
|
+
const flexGrowClass = ns2.em("pane", "grow");
|
|
6451
6562
|
if (hasClass(ele, flexGrowClass)) {
|
|
6452
6563
|
removeClass(ele, flexGrowClass);
|
|
6453
6564
|
} else if (collapsed) {
|
|
@@ -6462,22 +6573,19 @@ var SplitterPane = defineComponent({
|
|
|
6462
6573
|
return () => {
|
|
6463
6574
|
var _a;
|
|
6464
6575
|
return createVNode("div", {
|
|
6465
|
-
"class": "
|
|
6576
|
+
"class": ns2.e("pane"),
|
|
6466
6577
|
"ref": domRef
|
|
6467
6578
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
6468
6579
|
};
|
|
6469
6580
|
}
|
|
6470
6581
|
});
|
|
6471
|
-
Splitter.install = function(app) {
|
|
6472
|
-
app.component(Splitter.name, Splitter);
|
|
6473
|
-
app.component(SplitterPane.name, SplitterPane);
|
|
6474
|
-
};
|
|
6475
6582
|
var index = {
|
|
6476
6583
|
title: "Splitter \u5206\u5272\u5668",
|
|
6477
6584
|
category: "\u5E03\u5C40",
|
|
6478
6585
|
status: "100%",
|
|
6479
6586
|
install(app) {
|
|
6480
|
-
app.
|
|
6587
|
+
app.component(Splitter.name, Splitter);
|
|
6588
|
+
app.component(SplitterPane.name, SplitterPane);
|
|
6481
6589
|
}
|
|
6482
6590
|
};
|
|
6483
|
-
export { Splitter, index as default };
|
|
6591
|
+
export { Splitter, index as default, splitterProps };
|