vue-devui 1.0.0-rc.0 → 1.0.0-rc.11
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 +78 -116
- package/alert/index.es.js +74 -45
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8190 -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 +34 -5
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5741 -127
- 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 +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 +5 -7
- package/countdown/index.umd.js +1 -1
- package/date-picker/index.es.js +8167 -288
- 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 +297 -181
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +525 -154
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +1048 -1176
- package/form/index.umd.js +16 -16
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +42 -21
- 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 +197 -56
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +55 -31
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8074 -144
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +269 -183
- 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 +412 -204
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +307 -57
- 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/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.js +3 -0
- package/nuxt/components/RadioButton.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/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/alertProps.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/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +3 -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/paginationProps.js +3 -0
- package/nuxt/components/panelProps.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/searchProps.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/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/treeProps.js +3 -0
- package/overlay/index.es.js +127 -149
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +11 -44
- package/pagination/index.es.js +158 -148
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/index.es.js +45 -32
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +317 -246
- 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 +7972 -157
- 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 +184 -57
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/ripple/index.es.js +47 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +3653 -1122
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9170 -596
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +63 -41
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +144 -137
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +469 -349
- package/splitter/index.umd.js +15 -15
- 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 +27 -6
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- 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 +10459 -1511
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +344 -141
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +49 -24
- 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/{anchor → time-select}/index.d.ts +0 -0
- package/{color-picker → time-select}/index.es.js +4171 -2898
- package/time-select/index.umd.js +27 -0
- package/{breadcrumb → time-select}/package.json +1 -1
- package/time-select/style.css +1 -0
- package/{back-top → timeline}/index.d.ts +0 -0
- package/timeline/index.es.js +425 -0
- package/timeline/index.umd.js +1 -0
- package/{back-top → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/tooltip/index.es.js +308 -236
- package/tooltip/index.umd.js +15 -15
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +5198 -1850
- package/tree/index.umd.js +18 -18
- package/tree/style.css +1 -1
- package/upload/index.es.js +427 -132
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +12064 -15841
- package/vue-devui.umd.js +30 -20
- package/accordion/index.es.js +0 -720
- 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 -128
- package/back-top/index.umd.js +0 -1
- package/back-top/style.css +0 -1
- package/breadcrumb/index.d.ts +0 -7
- package/breadcrumb/index.es.js +0 -127
- 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 -329
- 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 -5963
- 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/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 -331
- 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/TimeAxis.js +0 -3
- package/nuxt/components/TimeAxisItem.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 -258
- 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 -239
- 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 -329
- package/tag-input/index.umd.js +0 -1
- package/tag-input/package.json +0 -7
- package/tag-input/style.css +0 -1
- package/time-axis/index.d.ts +0 -7
- package/time-axis/index.es.js +0 -299
- package/time-axis/index.umd.js +0 -1
- package/time-axis/package.json +0 -7
- package/time-axis/style.css +0 -1
- package/time-picker/index.d.ts +0 -7
- package/time-picker/index.es.js +0 -1237
- 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 -7608
- 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 -623
- 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,98 +1,115 @@
|
|
|
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 { offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
|
|
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 overlay = "";
|
|
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
|
-
|
|
95
|
-
|
|
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
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
function useFixedOverlay(props, ctx) {
|
|
43
|
+
let lockScrollCb;
|
|
44
|
+
const onClick = (event) => {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
ctx.emit("click", event);
|
|
47
|
+
if (props.closeOnClickOverlay) {
|
|
48
|
+
ctx.emit("update:modelValue", false);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
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
|
+
}
|
|
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) : "";
|
|
80
|
+
return {
|
|
81
|
+
b,
|
|
82
|
+
e,
|
|
83
|
+
m,
|
|
84
|
+
em
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
var fixedOverlay = "";
|
|
88
|
+
defineComponent({
|
|
89
|
+
name: "DFixedOverlay",
|
|
90
|
+
inheritAttrs: false,
|
|
91
|
+
props: fixedOverlayProps,
|
|
92
|
+
emits: ["update:modelValue", "click"],
|
|
93
|
+
setup(props, ctx) {
|
|
94
|
+
const {
|
|
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
|
+
}
|
|
112
|
+
});
|
|
96
113
|
}
|
|
97
114
|
});
|
|
98
115
|
const flexibleOverlayProps = {
|
|
@@ -112,6 +129,9 @@ const flexibleOverlayProps = {
|
|
|
112
129
|
type: [Number, Object],
|
|
113
130
|
default: 8
|
|
114
131
|
},
|
|
132
|
+
shiftOffset: {
|
|
133
|
+
type: Number
|
|
134
|
+
},
|
|
115
135
|
align: {
|
|
116
136
|
type: String,
|
|
117
137
|
default: null
|
|
@@ -125,80 +145,6 @@ const flexibleOverlayProps = {
|
|
|
125
145
|
default: true
|
|
126
146
|
}
|
|
127
147
|
};
|
|
128
|
-
function useOverlayLogic(props, ctx) {
|
|
129
|
-
const backgroundClass = computed(() => {
|
|
130
|
-
return [
|
|
131
|
-
"devui-overlay-background",
|
|
132
|
-
props.backgroundClass,
|
|
133
|
-
!props.hasBackdrop ? "devui-overlay-background__disabled" : "devui-overlay-background__color"
|
|
134
|
-
];
|
|
135
|
-
});
|
|
136
|
-
const overlayClass = computed(() => {
|
|
137
|
-
return "devui-overlay";
|
|
138
|
-
});
|
|
139
|
-
const handleBackdropClick = (event) => {
|
|
140
|
-
var _a;
|
|
141
|
-
event.preventDefault();
|
|
142
|
-
(_a = props.onBackdropClick) == null ? void 0 : _a.call(props);
|
|
143
|
-
if (props.backdropClose) {
|
|
144
|
-
ctx.emit("update:visible", false);
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
const handleOverlayBubbleCancel = (event) => event.cancelBubble = true;
|
|
148
|
-
onMounted(() => {
|
|
149
|
-
const body = document.body;
|
|
150
|
-
const originOverflow = body.style.overflow;
|
|
151
|
-
const originPosition = body.style.position;
|
|
152
|
-
watch([() => props.visible, () => props.backgroundBlock], ([visible, backgroundBlock]) => {
|
|
153
|
-
if (backgroundBlock) {
|
|
154
|
-
const top = body.getBoundingClientRect().y;
|
|
155
|
-
if (visible) {
|
|
156
|
-
body.style.overflowY = "scroll";
|
|
157
|
-
body.style.position = visible ? "fixed" : "";
|
|
158
|
-
body.style.top = `${top}px`;
|
|
159
|
-
} else {
|
|
160
|
-
body.style.overflowY = originOverflow;
|
|
161
|
-
body.style.position = originPosition;
|
|
162
|
-
body.style.top = "";
|
|
163
|
-
window.scrollTo(0, -top);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
onUnmounted(() => {
|
|
168
|
-
document.body.style.overflow = originOverflow;
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
return {
|
|
172
|
-
backgroundClass,
|
|
173
|
-
overlayClass,
|
|
174
|
-
handleBackdropClick,
|
|
175
|
-
handleOverlayBubbleCancel
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
defineComponent({
|
|
179
|
-
name: "DFixedOverlay",
|
|
180
|
-
props: fixedOverlayProps,
|
|
181
|
-
emits: overlayEmits,
|
|
182
|
-
setup(props, ctx) {
|
|
183
|
-
const {
|
|
184
|
-
backgroundClass,
|
|
185
|
-
overlayClass,
|
|
186
|
-
handleBackdropClick,
|
|
187
|
-
handleOverlayBubbleCancel
|
|
188
|
-
} = useOverlayLogic(props, ctx);
|
|
189
|
-
return () => createVNode(CommonOverlay, null, {
|
|
190
|
-
default: () => [props.visible && createVNode("div", {
|
|
191
|
-
"class": backgroundClass.value,
|
|
192
|
-
"style": props.backgroundStyle,
|
|
193
|
-
"onClick": handleBackdropClick
|
|
194
|
-
}, [createVNode("div", {
|
|
195
|
-
"class": overlayClass.value,
|
|
196
|
-
"style": props.overlayStyle,
|
|
197
|
-
"onClick": handleOverlayBubbleCancel
|
|
198
|
-
}, [renderSlot(ctx.slots, "default")])])]
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
148
|
function getScrollParent(element) {
|
|
203
149
|
const overflowRegex = /(auto|scroll|hidden)/;
|
|
204
150
|
for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
|
|
@@ -231,6 +177,7 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
|
231
177
|
function useOverlay(props, emit) {
|
|
232
178
|
const overlayRef = ref();
|
|
233
179
|
const arrowRef = ref();
|
|
180
|
+
let originParent = null;
|
|
234
181
|
const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
|
|
235
182
|
const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
|
|
236
183
|
const staticSide = {
|
|
@@ -259,34 +206,43 @@ function useOverlay(props, emit) {
|
|
|
259
206
|
})
|
|
260
207
|
];
|
|
261
208
|
props.showArrow && middleware.push(arrow({ element: arrowEl }));
|
|
209
|
+
props.shiftOffset !== void 0 && middleware.push(shift());
|
|
262
210
|
const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
|
|
263
211
|
strategy: "fixed",
|
|
264
212
|
middleware
|
|
265
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
|
+
}
|
|
266
223
|
emit("positionChange", placement);
|
|
267
|
-
Object.assign(overlayEl.style, { top: `${
|
|
224
|
+
Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
|
|
268
225
|
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
269
226
|
};
|
|
270
227
|
watch(() => props.modelValue, () => {
|
|
271
|
-
const originParent = getScrollParent(props.origin);
|
|
272
228
|
if (props.modelValue && props.origin) {
|
|
229
|
+
originParent = getScrollParent(props.origin);
|
|
273
230
|
nextTick(updatePosition);
|
|
274
|
-
originParent.addEventListener("scroll", updatePosition);
|
|
231
|
+
originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
|
|
275
232
|
originParent !== window && window.addEventListener("scroll", updatePosition);
|
|
276
233
|
window.addEventListener("resize", updatePosition);
|
|
277
234
|
} else {
|
|
278
|
-
originParent.removeEventListener("scroll", updatePosition);
|
|
235
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
279
236
|
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
280
237
|
window.removeEventListener("resize", updatePosition);
|
|
281
238
|
}
|
|
282
239
|
});
|
|
283
240
|
onUnmounted(() => {
|
|
284
|
-
|
|
285
|
-
originParent.removeEventListener("scroll", updatePosition);
|
|
241
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
286
242
|
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
287
243
|
window.removeEventListener("resize", updatePosition);
|
|
288
244
|
});
|
|
289
|
-
return { arrowRef, overlayRef };
|
|
245
|
+
return { arrowRef, overlayRef, updatePosition };
|
|
290
246
|
}
|
|
291
247
|
var flexibleOverlay = "";
|
|
292
248
|
const FlexibleOverlay = defineComponent({
|
|
@@ -297,24 +253,86 @@ const FlexibleOverlay = defineComponent({
|
|
|
297
253
|
setup(props, {
|
|
298
254
|
slots,
|
|
299
255
|
attrs,
|
|
300
|
-
emit
|
|
256
|
+
emit,
|
|
257
|
+
expose
|
|
301
258
|
}) {
|
|
259
|
+
const ns2 = useNamespace("flexible-overlay");
|
|
302
260
|
const {
|
|
303
261
|
arrowRef,
|
|
304
|
-
overlayRef
|
|
262
|
+
overlayRef,
|
|
263
|
+
updatePosition
|
|
305
264
|
} = useOverlay(props, emit);
|
|
265
|
+
expose({
|
|
266
|
+
updatePosition
|
|
267
|
+
});
|
|
306
268
|
return () => {
|
|
307
269
|
var _a;
|
|
308
270
|
return props.modelValue && createVNode("div", mergeProps({
|
|
309
271
|
"ref": overlayRef,
|
|
310
|
-
"class":
|
|
272
|
+
"class": ns2.b()
|
|
311
273
|
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
|
|
312
274
|
"ref": arrowRef,
|
|
313
|
-
"class": "
|
|
275
|
+
"class": ns2.e("arrow")
|
|
314
276
|
}, null)]);
|
|
315
277
|
};
|
|
316
278
|
}
|
|
317
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
|
+
});
|
|
318
336
|
const tooltipProps = {
|
|
319
337
|
content: {
|
|
320
338
|
type: String,
|
|
@@ -335,6 +353,18 @@ const tooltipProps = {
|
|
|
335
353
|
mouseLeaveDelay: {
|
|
336
354
|
type: Number,
|
|
337
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
|
|
338
368
|
}
|
|
339
369
|
};
|
|
340
370
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
@@ -1048,7 +1078,7 @@ var lodash = { exports: {} };
|
|
|
1048
1078
|
var objectCtorString = funcToString.call(Object2);
|
|
1049
1079
|
var oldDash = root._;
|
|
1050
1080
|
var reIsNative = RegExp2("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
1051
|
-
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;
|
|
1052
1082
|
var defineProperty = function() {
|
|
1053
1083
|
try {
|
|
1054
1084
|
var func = getNative(Object2, "defineProperty");
|
|
@@ -1063,7 +1093,7 @@ var lodash = { exports: {} };
|
|
|
1063
1093
|
var metaMap = WeakMap2 && new WeakMap2();
|
|
1064
1094
|
var realNames = {};
|
|
1065
1095
|
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap2);
|
|
1066
|
-
var symbolProto =
|
|
1096
|
+
var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
|
|
1067
1097
|
function lodash2(value) {
|
|
1068
1098
|
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
|
|
1069
1099
|
if (value instanceof LodashWrapper) {
|
|
@@ -1079,7 +1109,7 @@ var lodash = { exports: {} };
|
|
|
1079
1109
|
function object() {
|
|
1080
1110
|
}
|
|
1081
1111
|
return function(proto) {
|
|
1082
|
-
if (!
|
|
1112
|
+
if (!isObject2(proto)) {
|
|
1083
1113
|
return {};
|
|
1084
1114
|
}
|
|
1085
1115
|
if (objectCreate) {
|
|
@@ -1441,7 +1471,7 @@ var lodash = { exports: {} };
|
|
|
1441
1471
|
if (result2 !== undefined$1) {
|
|
1442
1472
|
return result2;
|
|
1443
1473
|
}
|
|
1444
|
-
if (!
|
|
1474
|
+
if (!isObject2(value)) {
|
|
1445
1475
|
return value;
|
|
1446
1476
|
}
|
|
1447
1477
|
var isArr = isArray(value);
|
|
@@ -1517,7 +1547,7 @@ var lodash = { exports: {} };
|
|
|
1517
1547
|
if (typeof func != "function") {
|
|
1518
1548
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
1519
1549
|
}
|
|
1520
|
-
return
|
|
1550
|
+
return setTimeout2(function() {
|
|
1521
1551
|
func.apply(undefined$1, args);
|
|
1522
1552
|
}, wait);
|
|
1523
1553
|
}
|
|
@@ -1788,7 +1818,7 @@ var lodash = { exports: {} };
|
|
|
1788
1818
|
return true;
|
|
1789
1819
|
}
|
|
1790
1820
|
function baseIsNative(value) {
|
|
1791
|
-
if (!
|
|
1821
|
+
if (!isObject2(value) || isMasked(value)) {
|
|
1792
1822
|
return false;
|
|
1793
1823
|
}
|
|
1794
1824
|
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
@@ -1828,7 +1858,7 @@ var lodash = { exports: {} };
|
|
|
1828
1858
|
return result2;
|
|
1829
1859
|
}
|
|
1830
1860
|
function baseKeysIn(object) {
|
|
1831
|
-
if (!
|
|
1861
|
+
if (!isObject2(object)) {
|
|
1832
1862
|
return nativeKeysIn(object);
|
|
1833
1863
|
}
|
|
1834
1864
|
var isProto = isPrototype(object), result2 = [];
|
|
@@ -1873,7 +1903,7 @@ var lodash = { exports: {} };
|
|
|
1873
1903
|
}
|
|
1874
1904
|
baseFor(source, function(srcValue, key) {
|
|
1875
1905
|
stack || (stack = new Stack());
|
|
1876
|
-
if (
|
|
1906
|
+
if (isObject2(srcValue)) {
|
|
1877
1907
|
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
|
1878
1908
|
} else {
|
|
1879
1909
|
var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined$1;
|
|
@@ -1913,7 +1943,7 @@ var lodash = { exports: {} };
|
|
|
1913
1943
|
newValue = objValue;
|
|
1914
1944
|
if (isArguments(objValue)) {
|
|
1915
1945
|
newValue = toPlainObject(objValue);
|
|
1916
|
-
} else if (!
|
|
1946
|
+
} else if (!isObject2(objValue) || isFunction(objValue)) {
|
|
1917
1947
|
newValue = initCloneObject(srcValue);
|
|
1918
1948
|
}
|
|
1919
1949
|
} else {
|
|
@@ -2052,7 +2082,7 @@ var lodash = { exports: {} };
|
|
|
2052
2082
|
return shuffleSelf(array, baseClamp(n, 0, array.length));
|
|
2053
2083
|
}
|
|
2054
2084
|
function baseSet(object, path, value, customizer) {
|
|
2055
|
-
if (!
|
|
2085
|
+
if (!isObject2(object)) {
|
|
2056
2086
|
return object;
|
|
2057
2087
|
}
|
|
2058
2088
|
path = castPath(path, object);
|
|
@@ -2066,7 +2096,7 @@ var lodash = { exports: {} };
|
|
|
2066
2096
|
var objValue = nested[key];
|
|
2067
2097
|
newValue = customizer ? customizer(objValue, key, nested) : undefined$1;
|
|
2068
2098
|
if (newValue === undefined$1) {
|
|
2069
|
-
newValue =
|
|
2099
|
+
newValue = isObject2(objValue) ? objValue : isIndex(path[index2 + 1]) ? [] : {};
|
|
2070
2100
|
}
|
|
2071
2101
|
}
|
|
2072
2102
|
assignValue(nested, key, newValue);
|
|
@@ -2297,7 +2327,7 @@ var lodash = { exports: {} };
|
|
|
2297
2327
|
end = end === undefined$1 ? length : end;
|
|
2298
2328
|
return !start && end >= length ? array : baseSlice(array, start, end);
|
|
2299
2329
|
}
|
|
2300
|
-
var
|
|
2330
|
+
var clearTimeout2 = ctxClearTimeout || function(id) {
|
|
2301
2331
|
return root.clearTimeout(id);
|
|
2302
2332
|
};
|
|
2303
2333
|
function cloneBuffer(buffer, isDeep) {
|
|
@@ -2516,7 +2546,7 @@ var lodash = { exports: {} };
|
|
|
2516
2546
|
return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
|
|
2517
2547
|
}
|
|
2518
2548
|
var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
|
|
2519
|
-
return
|
|
2549
|
+
return isObject2(result2) ? result2 : thisBinding;
|
|
2520
2550
|
};
|
|
2521
2551
|
}
|
|
2522
2552
|
function createCurry(func, bitmask, arity) {
|
|
@@ -2830,7 +2860,7 @@ var lodash = { exports: {} };
|
|
|
2830
2860
|
return objValue;
|
|
2831
2861
|
}
|
|
2832
2862
|
function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
|
|
2833
|
-
if (
|
|
2863
|
+
if (isObject2(objValue) && isObject2(srcValue)) {
|
|
2834
2864
|
stack.set(srcValue, objValue);
|
|
2835
2865
|
baseMerge(objValue, srcValue, undefined$1, customDefaultsMerge, stack);
|
|
2836
2866
|
stack["delete"](srcValue);
|
|
@@ -3178,7 +3208,7 @@ var lodash = { exports: {} };
|
|
|
3178
3208
|
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
3179
3209
|
}
|
|
3180
3210
|
function isIterateeCall(value, index2, object) {
|
|
3181
|
-
if (!
|
|
3211
|
+
if (!isObject2(object)) {
|
|
3182
3212
|
return false;
|
|
3183
3213
|
}
|
|
3184
3214
|
var type = typeof index2;
|
|
@@ -3221,7 +3251,7 @@ var lodash = { exports: {} };
|
|
|
3221
3251
|
return value === proto;
|
|
3222
3252
|
}
|
|
3223
3253
|
function isStrictComparable(value) {
|
|
3224
|
-
return value === value && !
|
|
3254
|
+
return value === value && !isObject2(value);
|
|
3225
3255
|
}
|
|
3226
3256
|
function matchesStrictComparable(key, srcValue) {
|
|
3227
3257
|
return function(object) {
|
|
@@ -3326,7 +3356,7 @@ var lodash = { exports: {} };
|
|
|
3326
3356
|
return object[key];
|
|
3327
3357
|
}
|
|
3328
3358
|
var setData = shortOut(baseSetData);
|
|
3329
|
-
var
|
|
3359
|
+
var setTimeout2 = ctxSetTimeout || function(func, wait) {
|
|
3330
3360
|
return root.setTimeout(func, wait);
|
|
3331
3361
|
};
|
|
3332
3362
|
var setToString = shortOut(baseSetToString);
|
|
@@ -4103,7 +4133,7 @@ var lodash = { exports: {} };
|
|
|
4103
4133
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
4104
4134
|
}
|
|
4105
4135
|
wait = toNumber(wait) || 0;
|
|
4106
|
-
if (
|
|
4136
|
+
if (isObject2(options)) {
|
|
4107
4137
|
leading = !!options.leading;
|
|
4108
4138
|
maxing = "maxWait" in options;
|
|
4109
4139
|
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
@@ -4118,7 +4148,7 @@ var lodash = { exports: {} };
|
|
|
4118
4148
|
}
|
|
4119
4149
|
function leadingEdge(time) {
|
|
4120
4150
|
lastInvokeTime = time;
|
|
4121
|
-
timerId =
|
|
4151
|
+
timerId = setTimeout2(timerExpired, wait);
|
|
4122
4152
|
return leading ? invokeFunc(time) : result2;
|
|
4123
4153
|
}
|
|
4124
4154
|
function remainingWait(time) {
|
|
@@ -4134,7 +4164,7 @@ var lodash = { exports: {} };
|
|
|
4134
4164
|
if (shouldInvoke(time)) {
|
|
4135
4165
|
return trailingEdge(time);
|
|
4136
4166
|
}
|
|
4137
|
-
timerId =
|
|
4167
|
+
timerId = setTimeout2(timerExpired, remainingWait(time));
|
|
4138
4168
|
}
|
|
4139
4169
|
function trailingEdge(time) {
|
|
4140
4170
|
timerId = undefined$1;
|
|
@@ -4146,7 +4176,7 @@ var lodash = { exports: {} };
|
|
|
4146
4176
|
}
|
|
4147
4177
|
function cancel() {
|
|
4148
4178
|
if (timerId !== undefined$1) {
|
|
4149
|
-
|
|
4179
|
+
clearTimeout2(timerId);
|
|
4150
4180
|
}
|
|
4151
4181
|
lastInvokeTime = 0;
|
|
4152
4182
|
lastArgs = lastCallTime = lastThis = timerId = undefined$1;
|
|
@@ -4164,13 +4194,13 @@ var lodash = { exports: {} };
|
|
|
4164
4194
|
return leadingEdge(lastCallTime);
|
|
4165
4195
|
}
|
|
4166
4196
|
if (maxing) {
|
|
4167
|
-
|
|
4168
|
-
timerId =
|
|
4197
|
+
clearTimeout2(timerId);
|
|
4198
|
+
timerId = setTimeout2(timerExpired, wait);
|
|
4169
4199
|
return invokeFunc(lastCallTime);
|
|
4170
4200
|
}
|
|
4171
4201
|
}
|
|
4172
4202
|
if (timerId === undefined$1) {
|
|
4173
|
-
timerId =
|
|
4203
|
+
timerId = setTimeout2(timerExpired, wait);
|
|
4174
4204
|
}
|
|
4175
4205
|
return result2;
|
|
4176
4206
|
}
|
|
@@ -4273,7 +4303,7 @@ var lodash = { exports: {} };
|
|
|
4273
4303
|
if (typeof func != "function") {
|
|
4274
4304
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
4275
4305
|
}
|
|
4276
|
-
if (
|
|
4306
|
+
if (isObject2(options)) {
|
|
4277
4307
|
leading = "leading" in options ? !!options.leading : leading;
|
|
4278
4308
|
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
4279
4309
|
}
|
|
@@ -4381,7 +4411,7 @@ var lodash = { exports: {} };
|
|
|
4381
4411
|
return typeof value == "number" && nativeIsFinite(value);
|
|
4382
4412
|
}
|
|
4383
4413
|
function isFunction(value) {
|
|
4384
|
-
if (!
|
|
4414
|
+
if (!isObject2(value)) {
|
|
4385
4415
|
return false;
|
|
4386
4416
|
}
|
|
4387
4417
|
var tag = baseGetTag(value);
|
|
@@ -4393,7 +4423,7 @@ var lodash = { exports: {} };
|
|
|
4393
4423
|
function isLength(value) {
|
|
4394
4424
|
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
4395
4425
|
}
|
|
4396
|
-
function
|
|
4426
|
+
function isObject2(value) {
|
|
4397
4427
|
var type = typeof value;
|
|
4398
4428
|
return value != null && (type == "object" || type == "function");
|
|
4399
4429
|
}
|
|
@@ -4500,9 +4530,9 @@ var lodash = { exports: {} };
|
|
|
4500
4530
|
if (isSymbol(value)) {
|
|
4501
4531
|
return NAN;
|
|
4502
4532
|
}
|
|
4503
|
-
if (
|
|
4533
|
+
if (isObject2(value)) {
|
|
4504
4534
|
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
4505
|
-
value =
|
|
4535
|
+
value = isObject2(other) ? other + "" : other;
|
|
4506
4536
|
}
|
|
4507
4537
|
if (typeof value != "string") {
|
|
4508
4538
|
return value === 0 ? value : +value;
|
|
@@ -4723,7 +4753,7 @@ var lodash = { exports: {} };
|
|
|
4723
4753
|
var Ctor = object && object.constructor;
|
|
4724
4754
|
if (isArrLike) {
|
|
4725
4755
|
accumulator = isArr ? new Ctor() : [];
|
|
4726
|
-
} else if (
|
|
4756
|
+
} else if (isObject2(object)) {
|
|
4727
4757
|
accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
|
|
4728
4758
|
} else {
|
|
4729
4759
|
accumulator = {};
|
|
@@ -5005,7 +5035,7 @@ var lodash = { exports: {} };
|
|
|
5005
5035
|
}
|
|
5006
5036
|
function truncate(string, options) {
|
|
5007
5037
|
var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
|
|
5008
|
-
if (
|
|
5038
|
+
if (isObject2(options)) {
|
|
5009
5039
|
var separator = "separator" in options ? options.separator : separator;
|
|
5010
5040
|
length = "length" in options ? toInteger(options.length) : length;
|
|
5011
5041
|
omission = "omission" in options ? baseToString(options.omission) : omission;
|
|
@@ -5135,13 +5165,13 @@ var lodash = { exports: {} };
|
|
|
5135
5165
|
});
|
|
5136
5166
|
function mixin(object, source, options) {
|
|
5137
5167
|
var props = keys(source), methodNames = baseFunctions(source, props);
|
|
5138
|
-
if (options == null && !(
|
|
5168
|
+
if (options == null && !(isObject2(source) && (methodNames.length || !props.length))) {
|
|
5139
5169
|
options = source;
|
|
5140
5170
|
source = object;
|
|
5141
5171
|
object = this;
|
|
5142
5172
|
methodNames = baseFunctions(source, keys(source));
|
|
5143
5173
|
}
|
|
5144
|
-
var chain2 = !(
|
|
5174
|
+
var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object);
|
|
5145
5175
|
arrayEach(methodNames, function(methodName) {
|
|
5146
5176
|
var func = source[methodName];
|
|
5147
5177
|
object[methodName] = func;
|
|
@@ -5487,7 +5517,7 @@ var lodash = { exports: {} };
|
|
|
5487
5517
|
lodash2.isNil = isNil;
|
|
5488
5518
|
lodash2.isNull = isNull;
|
|
5489
5519
|
lodash2.isNumber = isNumber;
|
|
5490
|
-
lodash2.isObject =
|
|
5520
|
+
lodash2.isObject = isObject2;
|
|
5491
5521
|
lodash2.isObjectLike = isObjectLike;
|
|
5492
5522
|
lodash2.isPlainObject = isPlainObject;
|
|
5493
5523
|
lodash2.isRegExp = isRegExp;
|
|
@@ -5756,7 +5786,7 @@ const TransformOriginMap = {
|
|
|
5756
5786
|
right: "-8px 50%"
|
|
5757
5787
|
};
|
|
5758
5788
|
function useTooltip(origin, props) {
|
|
5759
|
-
const { position, mouseEnterDelay, mouseLeaveDelay } = toRefs(props);
|
|
5789
|
+
const { position, mouseEnterDelay, mouseLeaveDelay, enterable, disabled, hideAfter } = toRefs(props);
|
|
5760
5790
|
const visible = ref(false);
|
|
5761
5791
|
const isEnter = ref(false);
|
|
5762
5792
|
const positionArr = computed(() => typeof position.value === "string" ? [position.value] : position.value);
|
|
@@ -5771,6 +5801,9 @@ function useTooltip(origin, props) {
|
|
|
5771
5801
|
!isEnter.value && (visible.value = false);
|
|
5772
5802
|
}, mouseLeaveDelay.value);
|
|
5773
5803
|
const onMouseenter = () => {
|
|
5804
|
+
if (disabled.value) {
|
|
5805
|
+
return;
|
|
5806
|
+
}
|
|
5774
5807
|
isEnter.value = true;
|
|
5775
5808
|
enter();
|
|
5776
5809
|
};
|
|
@@ -5781,11 +5814,29 @@ function useTooltip(origin, props) {
|
|
|
5781
5814
|
const onPositionChange = (pos) => {
|
|
5782
5815
|
placement.value = pos;
|
|
5783
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
|
+
};
|
|
5784
5828
|
onMounted(() => {
|
|
5785
5829
|
origin.value.addEventListener("mouseenter", onMouseenter);
|
|
5786
5830
|
origin.value.addEventListener("mouseleave", onMouseleave);
|
|
5787
5831
|
});
|
|
5788
|
-
|
|
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 };
|
|
5789
5840
|
}
|
|
5790
5841
|
var tooltip = "";
|
|
5791
5842
|
var DToolTip = defineComponent({
|
|
@@ -5805,38 +5856,43 @@ var DToolTip = defineComponent({
|
|
|
5805
5856
|
placement,
|
|
5806
5857
|
positionArr,
|
|
5807
5858
|
overlayStyles,
|
|
5808
|
-
onPositionChange
|
|
5859
|
+
onPositionChange,
|
|
5860
|
+
onMouseleave,
|
|
5861
|
+
onMouseenterOverlay
|
|
5809
5862
|
} = useTooltip(origin, props);
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
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}`) : ""
|
|
5817
5875
|
}, {
|
|
5818
|
-
default: () => [createVNode(
|
|
5819
|
-
"
|
|
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
|
|
5820
5889
|
}, {
|
|
5821
|
-
default: () => [createVNode(
|
|
5822
|
-
"
|
|
5823
|
-
|
|
5824
|
-
"ref": tooltipRef,
|
|
5825
|
-
"class": "devui-tooltip",
|
|
5826
|
-
"origin": origin.value,
|
|
5827
|
-
"position": positionArr.value,
|
|
5828
|
-
"offset": 6,
|
|
5829
|
-
"show-arrow": true,
|
|
5830
|
-
"style": overlayStyles.value,
|
|
5831
|
-
"onPositionChange": onPositionChange
|
|
5832
|
-
}, {
|
|
5833
|
-
default: () => [createVNode("span", {
|
|
5834
|
-
"innerHTML": content.value
|
|
5835
|
-
}, null)]
|
|
5836
|
-
})]
|
|
5890
|
+
default: () => [createVNode("span", {
|
|
5891
|
+
"innerHTML": content.value
|
|
5892
|
+
}, null)]
|
|
5837
5893
|
})]
|
|
5838
|
-
})]
|
|
5839
|
-
};
|
|
5894
|
+
})]
|
|
5895
|
+
})]);
|
|
5840
5896
|
}
|
|
5841
5897
|
});
|
|
5842
5898
|
function setStyle(element, style) {
|
|
@@ -5876,57 +5932,58 @@ function removeClass(el, className) {
|
|
|
5876
5932
|
}
|
|
5877
5933
|
}
|
|
5878
5934
|
}
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
}
|
|
5891
|
-
};
|
|
5892
|
-
function bindEvent(el) {
|
|
5893
|
-
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
|
+
};
|
|
5894
5946
|
}
|
|
5895
|
-
function bind(el,
|
|
5896
|
-
el.addEventListener && el.addEventListener(
|
|
5947
|
+
function bind(el, eventName, callback) {
|
|
5948
|
+
el.addEventListener && el.addEventListener(eventName, callback);
|
|
5897
5949
|
}
|
|
5898
|
-
function unbind(el,
|
|
5899
|
-
el.removeEventListener && el.removeEventListener(
|
|
5950
|
+
function unbind(el, eventName, callback) {
|
|
5951
|
+
el.removeEventListener && el.removeEventListener(eventName, callback);
|
|
5900
5952
|
}
|
|
5901
5953
|
function onMousedown(e) {
|
|
5902
5954
|
var _a;
|
|
5903
|
-
const
|
|
5904
|
-
if (
|
|
5955
|
+
const resizeProps = (_a = e == null ? void 0 : e.target) == null ? void 0 : _a.resizeProps;
|
|
5956
|
+
if (!resizeProps) {
|
|
5905
5957
|
return;
|
|
5906
|
-
bind(document, "mousemove", onMousemove);
|
|
5907
|
-
bind(document, "mouseup", onMouseup);
|
|
5908
|
-
$value.onPressEvent(normalizeEvent(e));
|
|
5909
|
-
function onMousemove(e2) {
|
|
5910
|
-
$value.onDragEvent(normalizeEvent(e2));
|
|
5911
5958
|
}
|
|
5912
|
-
function
|
|
5959
|
+
function onMousemove(evt) {
|
|
5960
|
+
resizeProps.onDragEvent(normalizeEvent(evt));
|
|
5961
|
+
}
|
|
5962
|
+
function onMouseup(evt) {
|
|
5913
5963
|
unbind(document, "mousemove", onMousemove);
|
|
5914
5964
|
unbind(document, "mouseup", onMouseup);
|
|
5915
|
-
|
|
5965
|
+
resizeProps.onReleaseEvent(normalizeEvent(evt));
|
|
5916
5966
|
}
|
|
5967
|
+
bind(document, "mousemove", onMousemove);
|
|
5968
|
+
bind(document, "mouseup", onMouseup);
|
|
5969
|
+
resizeProps.onPressEvent(normalizeEvent(e));
|
|
5917
5970
|
}
|
|
5918
|
-
function
|
|
5919
|
-
|
|
5920
|
-
pageX: e.pageX,
|
|
5921
|
-
pageY: e.pageY,
|
|
5922
|
-
clientX: e.clientX,
|
|
5923
|
-
clientY: e.clientY,
|
|
5924
|
-
offsetX: e.offsetX,
|
|
5925
|
-
offsetY: e.offsetY,
|
|
5926
|
-
type: e.type,
|
|
5927
|
-
originalEvent: e
|
|
5928
|
-
};
|
|
5971
|
+
function bindEvent(el) {
|
|
5972
|
+
bind(el, "mousedown", onMousedown);
|
|
5929
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
|
+
};
|
|
5930
5987
|
const splitterBarProps = {
|
|
5931
5988
|
index: {
|
|
5932
5989
|
type: Number
|
|
@@ -5955,9 +6012,10 @@ var DSplitterBar = defineComponent({
|
|
|
5955
6012
|
},
|
|
5956
6013
|
props: splitterBarProps,
|
|
5957
6014
|
setup(props) {
|
|
6015
|
+
const ns2 = useNamespace("splitter");
|
|
5958
6016
|
const store = inject("splitterStore");
|
|
5959
6017
|
const state = reactive({
|
|
5960
|
-
wrapperClass:
|
|
6018
|
+
wrapperClass: `${ns2.e("bar")} ${ns2.em("bar", props.orientation)} `
|
|
5961
6019
|
});
|
|
5962
6020
|
const domRef = ref();
|
|
5963
6021
|
watch([() => props.splitBarSize, domRef], ([curSplitBarSize, ele]) => {
|
|
@@ -5970,10 +6028,13 @@ var DSplitterBar = defineComponent({
|
|
|
5970
6028
|
}, {
|
|
5971
6029
|
immediate: true
|
|
5972
6030
|
});
|
|
5973
|
-
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
|
+
}
|
|
5974
6035
|
if (!store.isStaticBar(props.index)) {
|
|
5975
6036
|
state.wrapperClass += " resizable";
|
|
5976
|
-
} else {
|
|
6037
|
+
} else if (ele) {
|
|
5977
6038
|
setStyle(ele, {
|
|
5978
6039
|
flexBasis: props.disabledBarSize
|
|
5979
6040
|
});
|
|
@@ -5981,59 +6042,10 @@ var DSplitterBar = defineComponent({
|
|
|
5981
6042
|
}, {
|
|
5982
6043
|
deep: true
|
|
5983
6044
|
});
|
|
5984
|
-
const coordinate = {
|
|
5985
|
-
pageX: 0,
|
|
5986
|
-
pageY: 0,
|
|
5987
|
-
originalX: 0,
|
|
5988
|
-
originalY: 0
|
|
5989
|
-
};
|
|
5990
|
-
let initState;
|
|
5991
|
-
const resizeProp = {
|
|
5992
|
-
enableResize: true,
|
|
5993
|
-
onPressEvent: function({
|
|
5994
|
-
originalEvent
|
|
5995
|
-
}) {
|
|
5996
|
-
originalEvent.stopPropagation();
|
|
5997
|
-
if (!store.isResizable(props.index))
|
|
5998
|
-
return;
|
|
5999
|
-
initState = store.dragState(props.index);
|
|
6000
|
-
coordinate.originalX = originalEvent.pageX;
|
|
6001
|
-
coordinate.originalY = originalEvent.pageY;
|
|
6002
|
-
},
|
|
6003
|
-
onDragEvent: function({
|
|
6004
|
-
originalEvent
|
|
6005
|
-
}) {
|
|
6006
|
-
originalEvent.stopPropagation();
|
|
6007
|
-
if (!store.isResizable(props.index))
|
|
6008
|
-
return;
|
|
6009
|
-
coordinate.pageX = originalEvent.pageX;
|
|
6010
|
-
coordinate.pageY = originalEvent.pageY;
|
|
6011
|
-
let distance;
|
|
6012
|
-
if (props.orientation === "vertical") {
|
|
6013
|
-
distance = coordinate.pageY - coordinate.originalY;
|
|
6014
|
-
} else {
|
|
6015
|
-
distance = coordinate.pageX - coordinate.originalX;
|
|
6016
|
-
}
|
|
6017
|
-
store.setSize(initState, distance);
|
|
6018
|
-
},
|
|
6019
|
-
onReleaseEvent: function({
|
|
6020
|
-
originalEvent
|
|
6021
|
-
}) {
|
|
6022
|
-
originalEvent.stopPropagation();
|
|
6023
|
-
if (!store.isResizable(props.index))
|
|
6024
|
-
return;
|
|
6025
|
-
coordinate.pageX = originalEvent.pageX;
|
|
6026
|
-
coordinate.pageY = originalEvent.pageY;
|
|
6027
|
-
let distance;
|
|
6028
|
-
if (props.orientation === "vertical") {
|
|
6029
|
-
distance = coordinate.pageY - coordinate.originalY;
|
|
6030
|
-
} else {
|
|
6031
|
-
distance = coordinate.pageX - coordinate.originalX;
|
|
6032
|
-
}
|
|
6033
|
-
store.setSize(initState, distance);
|
|
6034
|
-
}
|
|
6035
|
-
};
|
|
6036
6045
|
const queryPanes = (index2, nearIndex) => {
|
|
6046
|
+
if (!store) {
|
|
6047
|
+
return {};
|
|
6048
|
+
}
|
|
6037
6049
|
const pane = store.getPane(index2);
|
|
6038
6050
|
const nearPane = store.getPane(nearIndex);
|
|
6039
6051
|
return {
|
|
@@ -6045,15 +6057,18 @@ var DSplitterBar = defineComponent({
|
|
|
6045
6057
|
var _a, _b, _c, _d;
|
|
6046
6058
|
const isCollapsible = ((_b = (_a = pane == null ? void 0 : pane.component) == null ? void 0 : _a.props) == null ? void 0 : _b.collapsible) && showIcon;
|
|
6047
6059
|
const isCollapsed = (_d = (_c = pane == null ? void 0 : pane.component) == null ? void 0 : _c.props) == null ? void 0 : _d.collapsed;
|
|
6048
|
-
const isNearPaneCollapsed = nearPane.collapsed;
|
|
6060
|
+
const isNearPaneCollapsed = nearPane == null ? void 0 : nearPane.collapsed;
|
|
6049
6061
|
return {
|
|
6050
|
-
"
|
|
6062
|
+
[ns2.e("collapse")]: isCollapsible,
|
|
6051
6063
|
collapsed: isCollapsed,
|
|
6052
6064
|
hidden: isNearPaneCollapsed
|
|
6053
6065
|
};
|
|
6054
6066
|
};
|
|
6055
6067
|
const prevClass = computed(() => {
|
|
6056
6068
|
var _a, _b;
|
|
6069
|
+
if (!props || props.index === void 0) {
|
|
6070
|
+
return {};
|
|
6071
|
+
}
|
|
6057
6072
|
const {
|
|
6058
6073
|
pane,
|
|
6059
6074
|
nearPane
|
|
@@ -6063,6 +6078,9 @@ var DSplitterBar = defineComponent({
|
|
|
6063
6078
|
});
|
|
6064
6079
|
const nextClass = computed(() => {
|
|
6065
6080
|
var _a, _b;
|
|
6081
|
+
if (!store || !props || props.index === void 0) {
|
|
6082
|
+
return {};
|
|
6083
|
+
}
|
|
6066
6084
|
const {
|
|
6067
6085
|
pane,
|
|
6068
6086
|
nearPane
|
|
@@ -6072,6 +6090,9 @@ var DSplitterBar = defineComponent({
|
|
|
6072
6090
|
});
|
|
6073
6091
|
const toggleResize = () => {
|
|
6074
6092
|
var _a, _b, _c, _d;
|
|
6093
|
+
if (!domRef.value || !props || props.index === void 0) {
|
|
6094
|
+
return;
|
|
6095
|
+
}
|
|
6075
6096
|
const {
|
|
6076
6097
|
pane,
|
|
6077
6098
|
nearPane
|
|
@@ -6084,10 +6105,16 @@ var DSplitterBar = defineComponent({
|
|
|
6084
6105
|
}
|
|
6085
6106
|
};
|
|
6086
6107
|
const handleCollapsePrePane = (lockStatus) => {
|
|
6108
|
+
if (!store || !props || props.index === void 0) {
|
|
6109
|
+
return;
|
|
6110
|
+
}
|
|
6087
6111
|
store.tooglePane(props.index, props.index + 1, lockStatus);
|
|
6088
6112
|
toggleResize();
|
|
6089
6113
|
};
|
|
6090
6114
|
const handleCollapseNextPane = (lockStatus) => {
|
|
6115
|
+
if (!store || !props || props.index === void 0) {
|
|
6116
|
+
return;
|
|
6117
|
+
}
|
|
6091
6118
|
store.tooglePane(props.index + 1, props.index, lockStatus);
|
|
6092
6119
|
toggleResize();
|
|
6093
6120
|
};
|
|
@@ -6095,11 +6122,78 @@ var DSplitterBar = defineComponent({
|
|
|
6095
6122
|
handleCollapsePrePane(true);
|
|
6096
6123
|
handleCollapseNextPane(true);
|
|
6097
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
|
+
};
|
|
6098
6189
|
onMounted(() => {
|
|
6099
6190
|
initialCollapseStatus();
|
|
6100
6191
|
});
|
|
6101
6192
|
const renderCollapsedTip = () => {
|
|
6102
6193
|
var _a, _b, _c, _d;
|
|
6194
|
+
if (!props || props.index === void 0) {
|
|
6195
|
+
return "\u6536\u8D77";
|
|
6196
|
+
}
|
|
6103
6197
|
const {
|
|
6104
6198
|
pane,
|
|
6105
6199
|
nearPane
|
|
@@ -6120,9 +6214,7 @@ var DSplitterBar = defineComponent({
|
|
|
6120
6214
|
handleCollapsePrePane();
|
|
6121
6215
|
}
|
|
6122
6216
|
}, null)]
|
|
6123
|
-
}), createVNode(
|
|
6124
|
-
"class": "devui-resize-handle"
|
|
6125
|
-
}, null), props.showCollapseButton && createVNode(DToolTip, {
|
|
6217
|
+
}), props.showCollapseButton && createVNode(DToolTip, {
|
|
6126
6218
|
"content": renderCollapsedTip()
|
|
6127
6219
|
}, {
|
|
6128
6220
|
default: () => [createVNode("div", {
|
|
@@ -6243,6 +6335,24 @@ class SplitterStore {
|
|
|
6243
6335
|
}
|
|
6244
6336
|
}
|
|
6245
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
|
+
};
|
|
6246
6356
|
var splitter = "";
|
|
6247
6357
|
var Splitter = defineComponent({
|
|
6248
6358
|
name: "DSplitter",
|
|
@@ -6257,6 +6367,7 @@ var Splitter = defineComponent({
|
|
|
6257
6367
|
const state = reactive({
|
|
6258
6368
|
panes: []
|
|
6259
6369
|
});
|
|
6370
|
+
const ns2 = useNamespace("splitter");
|
|
6260
6371
|
state.panes = ((_b = (_a = ctx.slots).DSplitterPane) == null ? void 0 : _b.call(_a)) || [];
|
|
6261
6372
|
store.setPanes({
|
|
6262
6373
|
panes: state.panes
|
|
@@ -6265,8 +6376,9 @@ var Splitter = defineComponent({
|
|
|
6265
6376
|
provide("splitterStore", store);
|
|
6266
6377
|
const domRef = ref();
|
|
6267
6378
|
const refreshSplitterContainerSize = () => {
|
|
6268
|
-
if (!domRef.value)
|
|
6379
|
+
if (!domRef.value) {
|
|
6269
6380
|
return;
|
|
6381
|
+
}
|
|
6270
6382
|
let containerSize = 0;
|
|
6271
6383
|
if (props.orientation === "vertical") {
|
|
6272
6384
|
containerSize = domRef.value.clientHeight;
|
|
@@ -6283,7 +6395,9 @@ var Splitter = defineComponent({
|
|
|
6283
6395
|
return;
|
|
6284
6396
|
}
|
|
6285
6397
|
refreshSplitterContainerSize();
|
|
6286
|
-
|
|
6398
|
+
if (domRef.value) {
|
|
6399
|
+
observer.observe(domRef.value);
|
|
6400
|
+
}
|
|
6287
6401
|
});
|
|
6288
6402
|
onUnmounted(() => {
|
|
6289
6403
|
observer.disconnect();
|
|
@@ -6294,7 +6408,7 @@ var Splitter = defineComponent({
|
|
|
6294
6408
|
orientation,
|
|
6295
6409
|
showCollapseButton
|
|
6296
6410
|
} = props;
|
|
6297
|
-
const wrapperClass = [
|
|
6411
|
+
const wrapperClass = [ns2.b(), ns2.m(orientation)];
|
|
6298
6412
|
return createVNode("div", {
|
|
6299
6413
|
"class": wrapperClass,
|
|
6300
6414
|
"ref": domRef
|
|
@@ -6358,6 +6472,7 @@ var SplitterPane = defineComponent({
|
|
|
6358
6472
|
const store = inject("splitterStore");
|
|
6359
6473
|
const domRef = ref();
|
|
6360
6474
|
const orderRef = ref();
|
|
6475
|
+
const ns2 = useNamespace("splitter");
|
|
6361
6476
|
watch([orderRef, domRef], ([order, ele]) => {
|
|
6362
6477
|
if (!ele) {
|
|
6363
6478
|
return;
|
|
@@ -6371,7 +6486,7 @@ var SplitterPane = defineComponent({
|
|
|
6371
6486
|
return;
|
|
6372
6487
|
}
|
|
6373
6488
|
ele.style.flexBasis = curSize;
|
|
6374
|
-
const paneFixedClass = "
|
|
6489
|
+
const paneFixedClass = ns2.em("pane", "fixed");
|
|
6375
6490
|
if (curSize) {
|
|
6376
6491
|
addClass(ele, paneFixedClass);
|
|
6377
6492
|
} else {
|
|
@@ -6379,27 +6494,35 @@ var SplitterPane = defineComponent({
|
|
|
6379
6494
|
}
|
|
6380
6495
|
};
|
|
6381
6496
|
watch([() => props.size, domRef], ([size, ele]) => {
|
|
6382
|
-
|
|
6497
|
+
if (size && ele) {
|
|
6498
|
+
setSizeStyle(size, ele);
|
|
6499
|
+
}
|
|
6383
6500
|
}, {
|
|
6384
6501
|
immediate: true
|
|
6385
6502
|
});
|
|
6386
6503
|
const orientation = inject("orientation");
|
|
6387
6504
|
let initialSize = "";
|
|
6388
6505
|
onMounted(() => {
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6506
|
+
if (props.size) {
|
|
6507
|
+
initialSize = props.size;
|
|
6508
|
+
}
|
|
6509
|
+
if (store) {
|
|
6510
|
+
store.setPanes({
|
|
6511
|
+
panes: store.state.panes
|
|
6512
|
+
});
|
|
6513
|
+
}
|
|
6393
6514
|
});
|
|
6394
6515
|
onUpdated(() => {
|
|
6395
|
-
store
|
|
6396
|
-
|
|
6397
|
-
|
|
6516
|
+
if (store) {
|
|
6517
|
+
store.setPanes({
|
|
6518
|
+
panes: store.state.panes
|
|
6519
|
+
});
|
|
6520
|
+
}
|
|
6398
6521
|
});
|
|
6399
6522
|
const getPaneSize = () => {
|
|
6400
6523
|
const ele = domRef.value;
|
|
6401
6524
|
if (!ele) {
|
|
6402
|
-
return;
|
|
6525
|
+
return 0;
|
|
6403
6526
|
}
|
|
6404
6527
|
if (orientation === "vertical") {
|
|
6405
6528
|
return ele.offsetHeight;
|
|
@@ -6411,7 +6534,7 @@ var SplitterPane = defineComponent({
|
|
|
6411
6534
|
if (!ele) {
|
|
6412
6535
|
return;
|
|
6413
6536
|
}
|
|
6414
|
-
const paneHiddenClass = "
|
|
6537
|
+
const paneHiddenClass = ns2.em("pane", "hidden");
|
|
6415
6538
|
if (!collapsed) {
|
|
6416
6539
|
removeClass(ele, paneHiddenClass);
|
|
6417
6540
|
} else {
|
|
@@ -6435,7 +6558,7 @@ var SplitterPane = defineComponent({
|
|
|
6435
6558
|
if (!(ele instanceof HTMLElement)) {
|
|
6436
6559
|
return;
|
|
6437
6560
|
}
|
|
6438
|
-
const flexGrowClass = "
|
|
6561
|
+
const flexGrowClass = ns2.em("pane", "grow");
|
|
6439
6562
|
if (hasClass(ele, flexGrowClass)) {
|
|
6440
6563
|
removeClass(ele, flexGrowClass);
|
|
6441
6564
|
} else if (collapsed) {
|
|
@@ -6450,22 +6573,19 @@ var SplitterPane = defineComponent({
|
|
|
6450
6573
|
return () => {
|
|
6451
6574
|
var _a;
|
|
6452
6575
|
return createVNode("div", {
|
|
6453
|
-
"class": "
|
|
6576
|
+
"class": ns2.e("pane"),
|
|
6454
6577
|
"ref": domRef
|
|
6455
6578
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
6456
6579
|
};
|
|
6457
6580
|
}
|
|
6458
6581
|
});
|
|
6459
|
-
Splitter.install = function(app) {
|
|
6460
|
-
app.component(Splitter.name, Splitter);
|
|
6461
|
-
app.component(SplitterPane.name, SplitterPane);
|
|
6462
|
-
};
|
|
6463
6582
|
var index = {
|
|
6464
6583
|
title: "Splitter \u5206\u5272\u5668",
|
|
6465
6584
|
category: "\u5E03\u5C40",
|
|
6466
6585
|
status: "100%",
|
|
6467
6586
|
install(app) {
|
|
6468
|
-
app.
|
|
6587
|
+
app.component(Splitter.name, Splitter);
|
|
6588
|
+
app.component(SplitterPane.name, SplitterPane);
|
|
6469
6589
|
}
|
|
6470
6590
|
};
|
|
6471
|
-
export { Splitter, index as default };
|
|
6591
|
+
export { Splitter, index as default, splitterProps };
|