vue-devui 1.0.0-rc.1 → 1.0.0-rc.12
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 +70 -121
- 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 +8204 -296
- 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 +36 -5
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5727 -111
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +63 -35
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8068 -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 +213 -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 +59 -19
- package/countdown/index.umd.js +1 -1
- package/{anchor → date-picker-pro}/index.d.ts +0 -0
- package/date-picker-pro/index.es.js +10856 -0
- package/date-picker-pro/index.umd.js +27 -0
- package/{breadcrumb → date-picker-pro}/package.json +1 -1
- package/date-picker-pro/style.css +1 -0
- 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 +210 -149
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +569 -159
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +1048 -1187
- package/form/index.umd.js +15 -15
- 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 +183 -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 +8101 -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 +375 -171
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +293 -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/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.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/OptionGroup.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/TimeSelect.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/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.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/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tableProps.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/timerPickerPanelProps.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 +4 -2
- package/pagination/index.es.js +171 -141
- 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 +7967 -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 +170 -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 +3660 -1097
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +8998 -487
- 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 +144 -138
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +468 -340
- package/splitter/index.umd.js +16 -16
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +41 -34
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/index.es.js +26 -2
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/{back-top → steps}/index.d.ts +0 -0
- package/steps/index.es.js +385 -0
- package/steps/index.umd.js +1 -0
- package/{gantt → steps}/package.json +1 -1
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.es.js +7802 -64
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +10315 -1147
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +345 -142
- 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 +7921 -83
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/time-picker/index.es.js +8704 -559
- package/time-picker/index.umd.js +27 -1
- package/time-picker/style.css +1 -1
- package/{breadcrumb → time-select}/index.d.ts +0 -0
- package/{color-picker → time-select}/index.es.js +4116 -2914
- package/time-select/index.umd.js +27 -0
- package/{back-top → time-select}/package.json +1 -1
- package/time-select/style.css +1 -0
- package/timeline/index.es.js +177 -37
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +286 -221
- package/tooltip/index.umd.js +15 -15
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +5325 -1855
- package/tree/index.umd.js +18 -18
- package/tree/style.css +1 -1
- package/upload/index.es.js +456 -133
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +14986 -16343
- package/vue-devui.umd.js +30 -20
- 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.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/back-top/index.es.js +0 -130
- package/back-top/index.umd.js +0 -1
- package/back-top/style.css +0 -1
- package/breadcrumb/index.es.js +0 -128
- package/breadcrumb/index.umd.js +0 -1
- 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.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/date-picker/index.d.ts +0 -7
- package/date-picker/index.es.js +0 -1154
- package/date-picker/index.umd.js +0 -1
- package/date-picker/package.json +0 -7
- package/date-picker/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/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/DatePicker.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/StickSlider.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/TagInput.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/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, getCurrentInstance, 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) {
|
|
@@ -1425,7 +1448,7 @@ var lodash = { exports: {} };
|
|
|
1425
1448
|
function baseAt(object, paths) {
|
|
1426
1449
|
var index2 = -1, length = paths.length, result2 = Array2(length), skip = object == null;
|
|
1427
1450
|
while (++index2 < length) {
|
|
1428
|
-
result2[index2] = skip ? undefined$1 :
|
|
1451
|
+
result2[index2] = skip ? undefined$1 : get2(object, paths[index2]);
|
|
1429
1452
|
}
|
|
1430
1453
|
return result2;
|
|
1431
1454
|
}
|
|
@@ -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 = [];
|
|
@@ -1870,7 +1893,7 @@ var lodash = { exports: {} };
|
|
|
1870
1893
|
return matchesStrictComparable(toKey(path), srcValue);
|
|
1871
1894
|
}
|
|
1872
1895
|
return function(object) {
|
|
1873
|
-
var objValue =
|
|
1896
|
+
var objValue = get2(object, path);
|
|
1874
1897
|
return objValue === undefined$1 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
1875
1898
|
};
|
|
1876
1899
|
}
|
|
@@ -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;
|
|
@@ -4603,7 +4626,7 @@ var lodash = { exports: {} };
|
|
|
4603
4626
|
function functionsIn(object) {
|
|
4604
4627
|
return object == null ? [] : baseFunctions(object, keysIn(object));
|
|
4605
4628
|
}
|
|
4606
|
-
function
|
|
4629
|
+
function get2(object, path, defaultValue) {
|
|
4607
4630
|
var result2 = object == null ? undefined$1 : baseGet(object, path);
|
|
4608
4631
|
return result2 === undefined$1 ? defaultValue : result2;
|
|
4609
4632
|
}
|
|
@@ -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;
|
|
@@ -5458,7 +5481,7 @@ var lodash = { exports: {} };
|
|
|
5458
5481
|
lodash2.forInRight = forInRight;
|
|
5459
5482
|
lodash2.forOwn = forOwn;
|
|
5460
5483
|
lodash2.forOwnRight = forOwnRight;
|
|
5461
|
-
lodash2.get =
|
|
5484
|
+
lodash2.get = get2;
|
|
5462
5485
|
lodash2.gt = gt;
|
|
5463
5486
|
lodash2.gte = gte;
|
|
5464
5487
|
lodash2.has = has;
|
|
@@ -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
|
|
@@ -5956,6 +6005,24 @@ const splitterBarProps = {
|
|
|
5956
6005
|
}
|
|
5957
6006
|
};
|
|
5958
6007
|
var splitterBar = "";
|
|
6008
|
+
const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
|
|
6009
|
+
function get(object, path) {
|
|
6010
|
+
const keys = path.split(".");
|
|
6011
|
+
let result = object;
|
|
6012
|
+
keys.forEach((key) => {
|
|
6013
|
+
var _a;
|
|
6014
|
+
result = (_a = result[key]) != null ? _a : "";
|
|
6015
|
+
});
|
|
6016
|
+
return result;
|
|
6017
|
+
}
|
|
6018
|
+
function createI18nTranslate(name, app, newPrefix) {
|
|
6019
|
+
const prefix = newPrefix || camelize(name) + ".";
|
|
6020
|
+
return (path) => {
|
|
6021
|
+
const messages = app == null ? void 0 : app.appContext.config.globalProperties.langMessages.value;
|
|
6022
|
+
const message = get(messages, prefix + path) || get(messages, path);
|
|
6023
|
+
return message;
|
|
6024
|
+
};
|
|
6025
|
+
}
|
|
5959
6026
|
var DSplitterBar = defineComponent({
|
|
5960
6027
|
name: "DSplitterBar",
|
|
5961
6028
|
components: {
|
|
@@ -5963,9 +6030,12 @@ var DSplitterBar = defineComponent({
|
|
|
5963
6030
|
},
|
|
5964
6031
|
props: splitterBarProps,
|
|
5965
6032
|
setup(props) {
|
|
6033
|
+
const app = getCurrentInstance();
|
|
6034
|
+
const t = createI18nTranslate("DSplitterBar", app);
|
|
6035
|
+
const ns2 = useNamespace("splitter");
|
|
5966
6036
|
const store = inject("splitterStore");
|
|
5967
6037
|
const state = reactive({
|
|
5968
|
-
wrapperClass:
|
|
6038
|
+
wrapperClass: `${ns2.e("bar")} ${ns2.em("bar", props.orientation)} `
|
|
5969
6039
|
});
|
|
5970
6040
|
const domRef = ref();
|
|
5971
6041
|
watch([() => props.splitBarSize, domRef], ([curSplitBarSize, ele]) => {
|
|
@@ -5978,10 +6048,13 @@ var DSplitterBar = defineComponent({
|
|
|
5978
6048
|
}, {
|
|
5979
6049
|
immediate: true
|
|
5980
6050
|
});
|
|
5981
|
-
watch([() => store.state.panes, domRef], ([
|
|
6051
|
+
watch([() => store == null ? void 0 : store.state.panes, domRef], ([, ele]) => {
|
|
6052
|
+
if (!store || !props || props.index === void 0) {
|
|
6053
|
+
return;
|
|
6054
|
+
}
|
|
5982
6055
|
if (!store.isStaticBar(props.index)) {
|
|
5983
6056
|
state.wrapperClass += " resizable";
|
|
5984
|
-
} else {
|
|
6057
|
+
} else if (ele) {
|
|
5985
6058
|
setStyle(ele, {
|
|
5986
6059
|
flexBasis: props.disabledBarSize
|
|
5987
6060
|
});
|
|
@@ -5989,62 +6062,10 @@ var DSplitterBar = defineComponent({
|
|
|
5989
6062
|
}, {
|
|
5990
6063
|
deep: true
|
|
5991
6064
|
});
|
|
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
6065
|
const queryPanes = (index2, nearIndex) => {
|
|
6066
|
+
if (!store) {
|
|
6067
|
+
return {};
|
|
6068
|
+
}
|
|
6048
6069
|
const pane = store.getPane(index2);
|
|
6049
6070
|
const nearPane = store.getPane(nearIndex);
|
|
6050
6071
|
return {
|
|
@@ -6056,15 +6077,18 @@ var DSplitterBar = defineComponent({
|
|
|
6056
6077
|
var _a, _b, _c, _d;
|
|
6057
6078
|
const isCollapsible = ((_b = (_a = pane == null ? void 0 : pane.component) == null ? void 0 : _a.props) == null ? void 0 : _b.collapsible) && showIcon;
|
|
6058
6079
|
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;
|
|
6080
|
+
const isNearPaneCollapsed = nearPane == null ? void 0 : nearPane.collapsed;
|
|
6060
6081
|
return {
|
|
6061
|
-
"
|
|
6082
|
+
[ns2.e("collapse")]: isCollapsible,
|
|
6062
6083
|
collapsed: isCollapsed,
|
|
6063
6084
|
hidden: isNearPaneCollapsed
|
|
6064
6085
|
};
|
|
6065
6086
|
};
|
|
6066
6087
|
const prevClass = computed(() => {
|
|
6067
6088
|
var _a, _b;
|
|
6089
|
+
if (!props || props.index === void 0) {
|
|
6090
|
+
return {};
|
|
6091
|
+
}
|
|
6068
6092
|
const {
|
|
6069
6093
|
pane,
|
|
6070
6094
|
nearPane
|
|
@@ -6074,6 +6098,9 @@ var DSplitterBar = defineComponent({
|
|
|
6074
6098
|
});
|
|
6075
6099
|
const nextClass = computed(() => {
|
|
6076
6100
|
var _a, _b;
|
|
6101
|
+
if (!store || !props || props.index === void 0) {
|
|
6102
|
+
return {};
|
|
6103
|
+
}
|
|
6077
6104
|
const {
|
|
6078
6105
|
pane,
|
|
6079
6106
|
nearPane
|
|
@@ -6083,6 +6110,9 @@ var DSplitterBar = defineComponent({
|
|
|
6083
6110
|
});
|
|
6084
6111
|
const toggleResize = () => {
|
|
6085
6112
|
var _a, _b, _c, _d;
|
|
6113
|
+
if (!domRef.value || !props || props.index === void 0) {
|
|
6114
|
+
return;
|
|
6115
|
+
}
|
|
6086
6116
|
const {
|
|
6087
6117
|
pane,
|
|
6088
6118
|
nearPane
|
|
@@ -6095,10 +6125,16 @@ var DSplitterBar = defineComponent({
|
|
|
6095
6125
|
}
|
|
6096
6126
|
};
|
|
6097
6127
|
const handleCollapsePrePane = (lockStatus) => {
|
|
6128
|
+
if (!store || !props || props.index === void 0) {
|
|
6129
|
+
return;
|
|
6130
|
+
}
|
|
6098
6131
|
store.tooglePane(props.index, props.index + 1, lockStatus);
|
|
6099
6132
|
toggleResize();
|
|
6100
6133
|
};
|
|
6101
6134
|
const handleCollapseNextPane = (lockStatus) => {
|
|
6135
|
+
if (!store || !props || props.index === void 0) {
|
|
6136
|
+
return;
|
|
6137
|
+
}
|
|
6102
6138
|
store.tooglePane(props.index + 1, props.index, lockStatus);
|
|
6103
6139
|
toggleResize();
|
|
6104
6140
|
};
|
|
@@ -6106,17 +6142,84 @@ var DSplitterBar = defineComponent({
|
|
|
6106
6142
|
handleCollapsePrePane(true);
|
|
6107
6143
|
handleCollapseNextPane(true);
|
|
6108
6144
|
};
|
|
6145
|
+
const coordinate = {
|
|
6146
|
+
pageX: 0,
|
|
6147
|
+
pageY: 0,
|
|
6148
|
+
originalX: 0,
|
|
6149
|
+
originalY: 0
|
|
6150
|
+
};
|
|
6151
|
+
let initState;
|
|
6152
|
+
const resizeProp = {
|
|
6153
|
+
enableResize: true,
|
|
6154
|
+
onPressEvent: function({
|
|
6155
|
+
originalEvent
|
|
6156
|
+
}) {
|
|
6157
|
+
originalEvent.stopPropagation();
|
|
6158
|
+
if (!store || !props || props.index === void 0) {
|
|
6159
|
+
return;
|
|
6160
|
+
}
|
|
6161
|
+
if (!store.isResizable(props.index)) {
|
|
6162
|
+
return;
|
|
6163
|
+
}
|
|
6164
|
+
initState = store.dragState(props.index);
|
|
6165
|
+
coordinate.originalX = originalEvent.pageX;
|
|
6166
|
+
coordinate.originalY = originalEvent.pageY;
|
|
6167
|
+
},
|
|
6168
|
+
onDragEvent: 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
|
+
onReleaseEvent: function({
|
|
6189
|
+
originalEvent
|
|
6190
|
+
}) {
|
|
6191
|
+
originalEvent.stopPropagation();
|
|
6192
|
+
if (!store || !props || props.index === void 0) {
|
|
6193
|
+
return;
|
|
6194
|
+
}
|
|
6195
|
+
if (!store.isResizable(props.index)) {
|
|
6196
|
+
return;
|
|
6197
|
+
}
|
|
6198
|
+
coordinate.pageX = originalEvent.pageX;
|
|
6199
|
+
coordinate.pageY = originalEvent.pageY;
|
|
6200
|
+
let distance;
|
|
6201
|
+
if (props.orientation === "vertical") {
|
|
6202
|
+
distance = coordinate.pageY - coordinate.originalY;
|
|
6203
|
+
} else {
|
|
6204
|
+
distance = coordinate.pageX - coordinate.originalX;
|
|
6205
|
+
}
|
|
6206
|
+
store.setSize(initState, distance);
|
|
6207
|
+
}
|
|
6208
|
+
};
|
|
6109
6209
|
onMounted(() => {
|
|
6110
6210
|
initialCollapseStatus();
|
|
6111
6211
|
});
|
|
6112
6212
|
const renderCollapsedTip = () => {
|
|
6113
6213
|
var _a, _b, _c, _d;
|
|
6214
|
+
if (!props || props.index === void 0) {
|
|
6215
|
+
return t("collapse");
|
|
6216
|
+
}
|
|
6114
6217
|
const {
|
|
6115
6218
|
pane,
|
|
6116
6219
|
nearPane
|
|
6117
6220
|
} = queryPanes(props.index, props.index + 1);
|
|
6118
6221
|
const isCollapsed = ((_b = (_a = pane == null ? void 0 : pane.component) == null ? void 0 : _a.props) == null ? void 0 : _b.collapsed) || ((_d = (_c = nearPane == null ? void 0 : nearPane.component) == null ? void 0 : _c.props) == null ? void 0 : _d.collapsed);
|
|
6119
|
-
return isCollapsed ? "
|
|
6222
|
+
return isCollapsed ? t("expand") : t("collapse");
|
|
6120
6223
|
};
|
|
6121
6224
|
return () => {
|
|
6122
6225
|
return withDirectives(createVNode("div", {
|
|
@@ -6131,9 +6234,7 @@ var DSplitterBar = defineComponent({
|
|
|
6131
6234
|
handleCollapsePrePane();
|
|
6132
6235
|
}
|
|
6133
6236
|
}, null)]
|
|
6134
|
-
}), createVNode(
|
|
6135
|
-
"class": "devui-resize-handle"
|
|
6136
|
-
}, null), props.showCollapseButton && createVNode(DToolTip, {
|
|
6237
|
+
}), props.showCollapseButton && createVNode(DToolTip, {
|
|
6137
6238
|
"content": renderCollapsedTip()
|
|
6138
6239
|
}, {
|
|
6139
6240
|
default: () => [createVNode("div", {
|
|
@@ -6254,6 +6355,24 @@ class SplitterStore {
|
|
|
6254
6355
|
}
|
|
6255
6356
|
}
|
|
6256
6357
|
}
|
|
6358
|
+
const splitterProps = {
|
|
6359
|
+
orientation: {
|
|
6360
|
+
type: String,
|
|
6361
|
+
default: "horizontal"
|
|
6362
|
+
},
|
|
6363
|
+
splitBarSize: {
|
|
6364
|
+
type: String,
|
|
6365
|
+
default: "2px"
|
|
6366
|
+
},
|
|
6367
|
+
disabledBarSize: {
|
|
6368
|
+
type: String,
|
|
6369
|
+
default: "1px"
|
|
6370
|
+
},
|
|
6371
|
+
showCollapseButton: {
|
|
6372
|
+
type: Boolean,
|
|
6373
|
+
default: true
|
|
6374
|
+
}
|
|
6375
|
+
};
|
|
6257
6376
|
var splitter = "";
|
|
6258
6377
|
var Splitter = defineComponent({
|
|
6259
6378
|
name: "DSplitter",
|
|
@@ -6268,6 +6387,7 @@ var Splitter = defineComponent({
|
|
|
6268
6387
|
const state = reactive({
|
|
6269
6388
|
panes: []
|
|
6270
6389
|
});
|
|
6390
|
+
const ns2 = useNamespace("splitter");
|
|
6271
6391
|
state.panes = ((_b = (_a = ctx.slots).DSplitterPane) == null ? void 0 : _b.call(_a)) || [];
|
|
6272
6392
|
store.setPanes({
|
|
6273
6393
|
panes: state.panes
|
|
@@ -6295,7 +6415,9 @@ var Splitter = defineComponent({
|
|
|
6295
6415
|
return;
|
|
6296
6416
|
}
|
|
6297
6417
|
refreshSplitterContainerSize();
|
|
6298
|
-
|
|
6418
|
+
if (domRef.value) {
|
|
6419
|
+
observer.observe(domRef.value);
|
|
6420
|
+
}
|
|
6299
6421
|
});
|
|
6300
6422
|
onUnmounted(() => {
|
|
6301
6423
|
observer.disconnect();
|
|
@@ -6306,7 +6428,7 @@ var Splitter = defineComponent({
|
|
|
6306
6428
|
orientation,
|
|
6307
6429
|
showCollapseButton
|
|
6308
6430
|
} = props;
|
|
6309
|
-
const wrapperClass = [
|
|
6431
|
+
const wrapperClass = [ns2.b(), ns2.m(orientation)];
|
|
6310
6432
|
return createVNode("div", {
|
|
6311
6433
|
"class": wrapperClass,
|
|
6312
6434
|
"ref": domRef
|
|
@@ -6370,6 +6492,7 @@ var SplitterPane = defineComponent({
|
|
|
6370
6492
|
const store = inject("splitterStore");
|
|
6371
6493
|
const domRef = ref();
|
|
6372
6494
|
const orderRef = ref();
|
|
6495
|
+
const ns2 = useNamespace("splitter");
|
|
6373
6496
|
watch([orderRef, domRef], ([order, ele]) => {
|
|
6374
6497
|
if (!ele) {
|
|
6375
6498
|
return;
|
|
@@ -6383,7 +6506,7 @@ var SplitterPane = defineComponent({
|
|
|
6383
6506
|
return;
|
|
6384
6507
|
}
|
|
6385
6508
|
ele.style.flexBasis = curSize;
|
|
6386
|
-
const paneFixedClass = "
|
|
6509
|
+
const paneFixedClass = ns2.em("pane", "fixed");
|
|
6387
6510
|
if (curSize) {
|
|
6388
6511
|
addClass(ele, paneFixedClass);
|
|
6389
6512
|
} else {
|
|
@@ -6391,27 +6514,35 @@ var SplitterPane = defineComponent({
|
|
|
6391
6514
|
}
|
|
6392
6515
|
};
|
|
6393
6516
|
watch([() => props.size, domRef], ([size, ele]) => {
|
|
6394
|
-
|
|
6517
|
+
if (size && ele) {
|
|
6518
|
+
setSizeStyle(size, ele);
|
|
6519
|
+
}
|
|
6395
6520
|
}, {
|
|
6396
6521
|
immediate: true
|
|
6397
6522
|
});
|
|
6398
6523
|
const orientation = inject("orientation");
|
|
6399
6524
|
let initialSize = "";
|
|
6400
6525
|
onMounted(() => {
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6526
|
+
if (props.size) {
|
|
6527
|
+
initialSize = props.size;
|
|
6528
|
+
}
|
|
6529
|
+
if (store) {
|
|
6530
|
+
store.setPanes({
|
|
6531
|
+
panes: store.state.panes
|
|
6532
|
+
});
|
|
6533
|
+
}
|
|
6405
6534
|
});
|
|
6406
6535
|
onUpdated(() => {
|
|
6407
|
-
store
|
|
6408
|
-
|
|
6409
|
-
|
|
6536
|
+
if (store) {
|
|
6537
|
+
store.setPanes({
|
|
6538
|
+
panes: store.state.panes
|
|
6539
|
+
});
|
|
6540
|
+
}
|
|
6410
6541
|
});
|
|
6411
6542
|
const getPaneSize = () => {
|
|
6412
6543
|
const ele = domRef.value;
|
|
6413
6544
|
if (!ele) {
|
|
6414
|
-
return;
|
|
6545
|
+
return 0;
|
|
6415
6546
|
}
|
|
6416
6547
|
if (orientation === "vertical") {
|
|
6417
6548
|
return ele.offsetHeight;
|
|
@@ -6423,7 +6554,7 @@ var SplitterPane = defineComponent({
|
|
|
6423
6554
|
if (!ele) {
|
|
6424
6555
|
return;
|
|
6425
6556
|
}
|
|
6426
|
-
const paneHiddenClass = "
|
|
6557
|
+
const paneHiddenClass = ns2.em("pane", "hidden");
|
|
6427
6558
|
if (!collapsed) {
|
|
6428
6559
|
removeClass(ele, paneHiddenClass);
|
|
6429
6560
|
} else {
|
|
@@ -6447,7 +6578,7 @@ var SplitterPane = defineComponent({
|
|
|
6447
6578
|
if (!(ele instanceof HTMLElement)) {
|
|
6448
6579
|
return;
|
|
6449
6580
|
}
|
|
6450
|
-
const flexGrowClass = "
|
|
6581
|
+
const flexGrowClass = ns2.em("pane", "grow");
|
|
6451
6582
|
if (hasClass(ele, flexGrowClass)) {
|
|
6452
6583
|
removeClass(ele, flexGrowClass);
|
|
6453
6584
|
} else if (collapsed) {
|
|
@@ -6462,22 +6593,19 @@ var SplitterPane = defineComponent({
|
|
|
6462
6593
|
return () => {
|
|
6463
6594
|
var _a;
|
|
6464
6595
|
return createVNode("div", {
|
|
6465
|
-
"class": "
|
|
6596
|
+
"class": ns2.e("pane"),
|
|
6466
6597
|
"ref": domRef
|
|
6467
6598
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
6468
6599
|
};
|
|
6469
6600
|
}
|
|
6470
6601
|
});
|
|
6471
|
-
Splitter.install = function(app) {
|
|
6472
|
-
app.component(Splitter.name, Splitter);
|
|
6473
|
-
app.component(SplitterPane.name, SplitterPane);
|
|
6474
|
-
};
|
|
6475
6602
|
var index = {
|
|
6476
6603
|
title: "Splitter \u5206\u5272\u5668",
|
|
6477
6604
|
category: "\u5E03\u5C40",
|
|
6478
6605
|
status: "100%",
|
|
6479
6606
|
install(app) {
|
|
6480
|
-
app.
|
|
6607
|
+
app.component(Splitter.name, Splitter);
|
|
6608
|
+
app.component(SplitterPane.name, SplitterPane);
|
|
6481
6609
|
}
|
|
6482
6610
|
};
|
|
6483
|
-
export { Splitter, index as default };
|
|
6611
|
+
export { Splitter, index as default, splitterProps };
|