vue-devui 1.0.0-pre.0 → 1.0.0-rc.2
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 +126 -187
- package/alert/index.es.js +28 -30
- package/alert/index.umd.js +1 -1
- package/auto-complete/index.es.js +67 -82
- package/auto-complete/index.umd.js +3 -1
- package/auto-complete/style.css +1 -1
- package/badge/index.es.js +1 -1
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +39 -40
- package/button/index.umd.js +1 -1
- package/countdown/index.es.js +2 -1
- package/editable-select/index.es.js +122 -163
- package/editable-select/index.umd.js +1 -1
- package/fullscreen/index.es.js +13 -16
- package/fullscreen/index.umd.js +1 -1
- package/icon/index.es.js +39 -57
- package/icon/index.umd.js +1 -1
- package/image-preview/index.es.js +2 -1
- package/modal/index.es.js +81 -76
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +38 -40
- package/notification/index.umd.js +1 -1
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.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/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +2 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/overlay/index.es.js +44 -37
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +8 -43
- package/pagination/index.es.js +10 -12
- package/pagination/index.umd.js +1 -1
- package/panel/index.es.js +45 -32
- package/panel/index.umd.js +1 -1
- package/popover/index.es.js +46 -39
- package/popover/index.umd.js +6 -6
- package/popover/style.css +1 -1
- package/progress/index.es.js +1 -1
- package/progress/index.umd.js +1 -1
- package/progress/style.css +1 -1
- package/radio/index.es.js +11 -11
- package/radio/index.umd.js +1 -1
- package/radio/style.css +1 -1
- package/read-tip/index.es.js +6 -3
- package/result/index.es.js +38 -53
- package/result/index.umd.js +1 -1
- package/ripple/index.es.js +47 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +2 -5
- package/search/index.umd.js +4 -4
- package/skeleton/index.es.js +17 -17
- package/skeleton/index.umd.js +1 -1
- package/slider/index.es.js +60 -59
- package/slider/index.umd.js +1 -1
- package/splitter/index.es.js +215 -160
- package/splitter/index.umd.js +11 -11
- package/splitter/style.css +1 -1
- package/status/index.es.js +1 -4
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/style.css +1 -1
- package/tag/index.es.js +15 -18
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/tag-input/index.es.js +4 -2
- package/{accordion → timeline}/index.d.ts +0 -0
- package/{time-axis → timeline}/index.es.js +65 -78
- package/timeline/index.umd.js +1 -0
- package/{anchor → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/upload/index.es.js +38 -40
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +1478 -1196
- package/vue-devui.umd.js +19 -17
- 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.d.ts +0 -7
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/back-top/index.d.ts +0 -7
- package/back-top/index.es.js +0 -128
- package/back-top/index.umd.js +0 -1
- package/back-top/package.json +0 -7
- package/back-top/style.css +0 -1
- package/breadcrumb/index.d.ts +0 -7
- package/breadcrumb/index.es.js +0 -127
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/package.json +0 -7
- package/breadcrumb/style.css +0 -1
- package/carousel/index.d.ts +0 -7
- package/carousel/index.es.js +0 -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.es.js +0 -8187
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/date-picker/index.d.ts +0 -7
- package/date-picker/index.es.js +0 -1171
- 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/drawer/index.d.ts +0 -7
- package/drawer/index.es.js +0 -234
- package/drawer/index.umd.js +0 -1
- package/drawer/package.json +0 -7
- package/drawer/style.css +0 -1
- package/dropdown/index.d.ts +0 -7
- package/dropdown/index.es.js +0 -638
- package/dropdown/index.umd.js +0 -1
- package/dropdown/package.json +0 -7
- package/dropdown/style.css +0 -1
- package/form/index.d.ts +0 -7
- package/form/index.es.js +0 -7865
- package/form/index.umd.js +0 -27
- package/form/package.json +0 -7
- package/form/style.css +0 -1
- 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/input-number/index.d.ts +0 -7
- package/input-number/index.es.js +0 -240
- package/input-number/index.umd.js +0 -1
- package/input-number/package.json +0 -7
- package/input-number/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/Column.js +0 -3
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/Drawer.js +0 -3
- package/nuxt/components/DrawerService.js +0 -3
- package/nuxt/components/Dropdown.js +0 -3
- package/nuxt/components/DropdownMenu.js +0 -3
- package/nuxt/components/Form.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormItem.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/FormOperation.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/InputNumber.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/Select.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/Table.js +0 -3
- package/nuxt/components/Tabs.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/Tooltip.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/Tree.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/dropdownMenuProps.js +0 -3
- package/nuxt/components/tooltipProps.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/select/index.d.ts +0 -7
- package/select/index.es.js +0 -706
- package/select/index.umd.js +0 -1
- package/select/package.json +0 -7
- package/select/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/table/index.d.ts +0 -7
- package/table/index.es.js +0 -1969
- package/table/index.umd.js +0 -1
- package/table/package.json +0 -7
- package/table/style.css +0 -1
- package/tabs/index.d.ts +0 -7
- package/tabs/index.es.js +0 -194
- package/tabs/index.umd.js +0 -1
- package/tabs/package.json +0 -7
- package/tabs/style.css +0 -1
- package/time-axis/index.d.ts +0 -7
- 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/tooltip/index.d.ts +0 -7
- package/tooltip/index.es.js +0 -5828
- package/tooltip/index.umd.js +0 -27
- package/tooltip/package.json +0 -7
- package/tooltip/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/index.d.ts +0 -7
- package/tree/index.es.js +0 -6490
- package/tree/index.umd.js +0 -27
- package/tree/package.json +0 -7
- package/tree/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/modal/index.es.js
CHANGED
|
@@ -33,8 +33,8 @@ var __publicField = (obj, key, value) => {
|
|
|
33
33
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
34
|
return value;
|
|
35
35
|
};
|
|
36
|
-
import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref,
|
|
37
|
-
import { offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
|
|
36
|
+
import { defineComponent, toRefs, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref, unref, nextTick, mergeProps, h, render } from "vue";
|
|
37
|
+
import { shift, offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
|
|
38
38
|
const modalProps = {
|
|
39
39
|
modelValue: {
|
|
40
40
|
type: Boolean,
|
|
@@ -56,56 +56,54 @@ const modalProps = {
|
|
|
56
56
|
type: Function
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
+
const iconProps = {
|
|
60
|
+
name: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: "",
|
|
63
|
+
required: true
|
|
64
|
+
},
|
|
65
|
+
size: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: "inherit"
|
|
68
|
+
},
|
|
69
|
+
color: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: "inherit"
|
|
72
|
+
},
|
|
73
|
+
classPrefix: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: "icon"
|
|
76
|
+
}
|
|
77
|
+
};
|
|
59
78
|
var Icon = defineComponent({
|
|
60
79
|
name: "DIcon",
|
|
61
|
-
props:
|
|
62
|
-
name: {
|
|
63
|
-
type: String,
|
|
64
|
-
required: true
|
|
65
|
-
},
|
|
66
|
-
size: {
|
|
67
|
-
type: String,
|
|
68
|
-
default: "inherit"
|
|
69
|
-
},
|
|
70
|
-
color: {
|
|
71
|
-
type: String,
|
|
72
|
-
default: "inherit"
|
|
73
|
-
},
|
|
74
|
-
classPrefix: {
|
|
75
|
-
type: String,
|
|
76
|
-
default: "icon"
|
|
77
|
-
}
|
|
78
|
-
},
|
|
80
|
+
props: iconProps,
|
|
79
81
|
setup(props) {
|
|
80
|
-
return __spreadValues({}, props);
|
|
81
|
-
},
|
|
82
|
-
render() {
|
|
83
82
|
const {
|
|
84
83
|
name,
|
|
85
84
|
size,
|
|
86
85
|
color,
|
|
87
86
|
classPrefix
|
|
88
|
-
} =
|
|
89
|
-
return
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
87
|
+
} = toRefs(props);
|
|
88
|
+
return () => {
|
|
89
|
+
return /^((https?):)?\/\//.test(name.value) ? createVNode("img", {
|
|
90
|
+
"src": name.value,
|
|
91
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
92
|
+
"style": {
|
|
93
|
+
width: size.value,
|
|
94
|
+
verticalAlign: "text-bottom"
|
|
95
|
+
}
|
|
96
|
+
}, null) : createVNode("i", {
|
|
97
|
+
"class": `${classPrefix.value} ${classPrefix.value}-${name.value}`,
|
|
98
|
+
"style": {
|
|
99
|
+
fontSize: size.value,
|
|
100
|
+
color: color.value
|
|
101
|
+
}
|
|
102
|
+
}, null);
|
|
103
|
+
};
|
|
103
104
|
}
|
|
104
105
|
});
|
|
105
|
-
|
|
106
|
-
app.component(Icon.name, Icon);
|
|
107
|
-
};
|
|
108
|
-
var overlay = "";
|
|
106
|
+
var baseOverlay = "";
|
|
109
107
|
function _isSlot(s) {
|
|
110
108
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
111
109
|
}
|
|
@@ -152,43 +150,13 @@ const overlayProps = {
|
|
|
152
150
|
default: true
|
|
153
151
|
}
|
|
154
152
|
};
|
|
155
|
-
const overlayEmits = ["update:visible", "backdropClick"];
|
|
156
153
|
const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
|
|
157
154
|
overlayStyle: {
|
|
158
155
|
type: [String, Object],
|
|
159
156
|
default: void 0
|
|
160
157
|
}
|
|
161
158
|
});
|
|
162
|
-
const
|
|
163
|
-
modelValue: {
|
|
164
|
-
type: Boolean,
|
|
165
|
-
default: false
|
|
166
|
-
},
|
|
167
|
-
origin: {
|
|
168
|
-
type: Object,
|
|
169
|
-
require: true
|
|
170
|
-
},
|
|
171
|
-
position: {
|
|
172
|
-
type: Array,
|
|
173
|
-
default: ["bottom"]
|
|
174
|
-
},
|
|
175
|
-
offset: {
|
|
176
|
-
type: [Number, Object],
|
|
177
|
-
default: 8
|
|
178
|
-
},
|
|
179
|
-
align: {
|
|
180
|
-
type: String,
|
|
181
|
-
default: null
|
|
182
|
-
},
|
|
183
|
-
showArrow: {
|
|
184
|
-
type: Boolean,
|
|
185
|
-
default: false
|
|
186
|
-
},
|
|
187
|
-
isArrowCenter: {
|
|
188
|
-
type: Boolean,
|
|
189
|
-
default: true
|
|
190
|
-
}
|
|
191
|
-
};
|
|
159
|
+
const overlayEmits = ["update:visible", "backdropClick"];
|
|
192
160
|
function useOverlayLogic(props, ctx) {
|
|
193
161
|
const backgroundClass = computed(() => {
|
|
194
162
|
return [
|
|
@@ -239,6 +207,7 @@ function useOverlayLogic(props, ctx) {
|
|
|
239
207
|
handleOverlayBubbleCancel
|
|
240
208
|
};
|
|
241
209
|
}
|
|
210
|
+
var fixedOverlay = "";
|
|
242
211
|
const FixedOverlay = defineComponent({
|
|
243
212
|
name: "DFixedOverlay",
|
|
244
213
|
props: fixedOverlayProps,
|
|
@@ -263,6 +232,36 @@ const FixedOverlay = defineComponent({
|
|
|
263
232
|
});
|
|
264
233
|
}
|
|
265
234
|
});
|
|
235
|
+
const flexibleOverlayProps = {
|
|
236
|
+
modelValue: {
|
|
237
|
+
type: Boolean,
|
|
238
|
+
default: false
|
|
239
|
+
},
|
|
240
|
+
origin: {
|
|
241
|
+
type: Object,
|
|
242
|
+
require: true
|
|
243
|
+
},
|
|
244
|
+
position: {
|
|
245
|
+
type: Array,
|
|
246
|
+
default: ["bottom"]
|
|
247
|
+
},
|
|
248
|
+
offset: {
|
|
249
|
+
type: [Number, Object],
|
|
250
|
+
default: 8
|
|
251
|
+
},
|
|
252
|
+
align: {
|
|
253
|
+
type: String,
|
|
254
|
+
default: null
|
|
255
|
+
},
|
|
256
|
+
showArrow: {
|
|
257
|
+
type: Boolean,
|
|
258
|
+
default: false
|
|
259
|
+
},
|
|
260
|
+
isArrowCenter: {
|
|
261
|
+
type: Boolean,
|
|
262
|
+
default: true
|
|
263
|
+
}
|
|
264
|
+
};
|
|
266
265
|
function getScrollParent(element) {
|
|
267
266
|
const overflowRegex = /(auto|scroll|hidden)/;
|
|
268
267
|
for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
|
|
@@ -316,6 +315,7 @@ function useOverlay(props, emit) {
|
|
|
316
315
|
const overlayEl = unref(overlayRef.value);
|
|
317
316
|
const arrowEl = unref(arrowRef.value);
|
|
318
317
|
const middleware = [
|
|
318
|
+
shift(),
|
|
319
319
|
offset(props.offset),
|
|
320
320
|
autoPlacement({
|
|
321
321
|
alignment: props.align,
|
|
@@ -350,7 +350,7 @@ function useOverlay(props, emit) {
|
|
|
350
350
|
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
351
351
|
window.removeEventListener("resize", updatePosition);
|
|
352
352
|
});
|
|
353
|
-
return { arrowRef, overlayRef };
|
|
353
|
+
return { arrowRef, overlayRef, updatePosition };
|
|
354
354
|
}
|
|
355
355
|
var flexibleOverlay = "";
|
|
356
356
|
defineComponent({
|
|
@@ -361,12 +361,17 @@ defineComponent({
|
|
|
361
361
|
setup(props, {
|
|
362
362
|
slots,
|
|
363
363
|
attrs,
|
|
364
|
-
emit
|
|
364
|
+
emit,
|
|
365
|
+
expose
|
|
365
366
|
}) {
|
|
366
367
|
const {
|
|
367
368
|
arrowRef,
|
|
368
|
-
overlayRef
|
|
369
|
+
overlayRef,
|
|
370
|
+
updatePosition
|
|
369
371
|
} = useOverlay(props, emit);
|
|
372
|
+
expose({
|
|
373
|
+
updatePosition
|
|
374
|
+
});
|
|
370
375
|
return () => {
|
|
371
376
|
var _a;
|
|
372
377
|
return props.modelValue && createVNode("div", mergeProps({
|
package/modal/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var X=Object.defineProperty,G=Object.defineProperties;var J=Object.getOwnPropertyDescriptors;var
|
|
1
|
+
var X=Object.defineProperty,G=Object.defineProperties;var J=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var x=(r,e,c)=>e in r?X(r,e,{enumerable:!0,configurable:!0,writable:!0,value:c}):r[e]=c,w=(r,e)=>{for(var c in e||(e={}))P.call(e,c)&&x(r,c,e[c]);if(g)for(var c of g(e))E.call(e,c)&&x(r,c,e[c]);return r},h=(r,e)=>G(r,J(e));var M=(r,e)=>{var c={};for(var p in r)P.call(r,p)&&e.indexOf(p)<0&&(c[p]=r[p]);if(r!=null&&g)for(var p of g(r))e.indexOf(p)<0&&E.call(r,p)&&(c[p]=r[p]);return c};var A=(r,e,c)=>(x(r,typeof e!="symbol"?e+"":e,c),c);(function(r,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],e):(r=typeof globalThis!="undefined"?globalThis:r||self,e(r.index={},r.Vue,r.dom))})(this,function(r,e,c){"use strict";const p={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},beforeClose:{type:Function}},j={name:{type:String,default:"",required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}};var D=e.defineComponent({name:"DIcon",props:j,setup(o){const{name:t,size:n,color:d,classPrefix:i}=e.toRefs(o);return()=>/^((https?):)?\/\//.test(t.value)?e.createVNode("img",{src:t.value,alt:t.value.split("/")[t.value.split("/").length-1],style:{width:n.value,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${i.value} ${i.value}-${t.value}`,style:{fontSize:n.value,color:d.value}},null)}}),Q="";function L(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!e.isVNode(o)}const R=e.defineComponent({setup(o,t){return()=>{let n;return e.createVNode(e.Teleport,{to:"#d-overlay-anchor"},{default:()=>[e.createVNode(e.Transition,{name:"devui-overlay-fade"},L(n=e.renderSlot(t.slots,"default"))?n:{default:()=>[n]})]})}}}),T=h(w({},{visible:{type:Boolean},backgroundBlock:{type:Boolean,default:!1},backgroundClass:{type:String,default:""},backgroundStyle:{type:[String,Object]},onBackdropClick:{type:Function},backdropClose:{type:Boolean,default:!0},hasBackdrop:{type:Boolean,default:!0}}),{overlayStyle:{type:[String,Object],default:void 0}}),_=["update:visible","backdropClick"];function z(o,t){const n=e.computed(()=>["devui-overlay-background",o.backgroundClass,o.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),d=e.computed(()=>"devui-overlay"),i=l=>{var s;l.preventDefault(),(s=o.onBackdropClick)==null||s.call(o),o.backdropClose&&t.emit("update:visible",!1)},a=l=>l.cancelBubble=!0;return e.onMounted(()=>{const l=document.body,s=l.style.overflow,f=l.style.position;e.watch([()=>o.visible,()=>o.backgroundBlock],([m,y])=>{if(y){const u=l.getBoundingClientRect().y;m?(l.style.overflowY="scroll",l.style.position=m?"fixed":"",l.style.top=`${u}px`):(l.style.overflowY=s,l.style.position=f,l.style.top="",window.scrollTo(0,-u))}}),e.onUnmounted(()=>{document.body.style.overflow=s})}),{backgroundClass:n,overlayClass:d,handleBackdropClick:i,handleOverlayBubbleCancel:a}}var Z="";const F=e.defineComponent({name:"DFixedOverlay",props:T,emits:_,setup(o,t){const{backgroundClass:n,overlayClass:d,handleBackdropClick:i,handleOverlayBubbleCancel:a}=z(o,t);return()=>e.createVNode(R,null,{default:()=>[o.visible&&e.createVNode("div",{class:n.value,style:o.backgroundStyle,onClick:i},[e.createVNode("div",{class:d.value,style:o.overlayStyle,onClick:a},[e.renderSlot(t.slots,"default")])])]})}}),$={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function B(o){const t=/(auto|scroll|hidden)/;for(let n=o;n=n.parentElement;n.parentElement!==document.body){const d=window.getComputedStyle(n);if(t.test(d.overflow+d.overflowX+d.overflowY))return n}return window}function q(o,t,n,d){let{x:i,y:a}=t;if(!o){const{width:l,height:s}=d;i&&n.includes("start")&&(i=12),i&&n.includes("end")&&(i=Math.round(l-24)),a&&n.includes("start")&&(a=10),a&&n.includes("end")&&(a=s-14)}return{x:i,y:a}}function I(o,t){const n=e.ref(),d=e.ref(),i=(l,s,f,m)=>{const{x:y,y:u}=q(o.isArrowCenter,f,s,m.getBoundingClientRect()),v={top:"bottom",right:"left",bottom:"top",left:"right"}[s.split("-")[0]];Object.assign(l.style,{left:y?`${y}px`:"",top:u?`${u}px`:"",right:"",bottom:"",[v]:"-4px"})},a=async()=>{const l=o.origin,s=e.unref(n.value),f=e.unref(d.value),m=[c.shift(),c.offset(o.offset),c.autoPlacement({alignment:o.align,allowedPlacements:o.position})];o.showArrow&&m.push(c.arrow({element:f}));const{x:y,y:u,placement:v,middlewareData:O}=await c.computePosition(l,s,{strategy:"fixed",middleware:m});t("positionChange",v),Object.assign(s.style,{top:`${u}px`,left:`${y}px`}),o.showArrow&&i(f,v,O.arrow,s)};return e.watch(()=>o.modelValue,()=>{const l=B(o.origin);o.modelValue&&o.origin?(e.nextTick(a),l.addEventListener("scroll",a),l!==window&&window.addEventListener("scroll",a),window.addEventListener("resize",a)):(l.removeEventListener("scroll",a),l!==window&&window.removeEventListener("scroll",a),window.removeEventListener("resize",a))}),e.onUnmounted(()=>{const l=B(o.origin);l.removeEventListener("scroll",a),l!==window&&window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}),{arrowRef:d,overlayRef:n,updatePosition:a}}var ee="";e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:$,emits:["update:modelValue","positionChange"],setup(o,{slots:t,attrs:n,emit:d,expose:i}){const{arrowRef:a,overlayRef:l,updatePosition:s}=I(o,d);return i({updatePosition:s}),()=>{var f;return o.modelValue&&e.createVNode("div",e.mergeProps({ref:l,class:"devui-flexible-overlay"},n),[(f=t.default)==null?void 0:f.call(t),o.showArrow&&e.createVNode("div",{ref:a,class:"devui-flexible-overlay-arrow"},null)])}}});const U=typeof window!="undefined";function H(o,t){function n(){t("update:modelValue",!1)}function d(i){i||(o.beforeClose?o.beforeClose(n):n())}return{handleVisibleChange:d}}var C=e.defineComponent({name:"DModalHeader",setup(o,{slots:t}){return()=>{var n;return e.createVNode("div",{class:"devui-modal-header"},[(n=t.default)==null?void 0:n.call(t)])}}}),k=e.defineComponent({name:"DModalBody",setup(o,{slots:t}){return()=>{var n;return e.createVNode("div",{class:"devui-modal-body"},[(n=t.default)==null?void 0:n.call(t)])}}}),te="",b=e.defineComponent({name:"DModal",inheritAttrs:!1,props:p,emits:["update:modelValue"],setup(o,{slots:t,attrs:n,emit:d,expose:i}){const{modelValue:a,lockScroll:l,closeOnClickOverlay:s,title:f}=e.toRefs(o),{handleVisibleChange:m}=H(o,d);return i({handleVisibleChange:m}),()=>e.createVNode(F,{visible:a.value,"onUpdate:visible":m,"background-class":"devui-modal-mask","background-block":l.value,"backdrop-close":s.value},{default:()=>[e.createVNode(e.Transition,{name:"devui-modal-wipe"},{default:()=>{var y;return[e.createVNode("div",e.mergeProps({class:"devui-modal"},n),[e.createVNode(D,{name:"close",class:"btn-close",size:"var(--devui-font-size-md,12px)",onClick:()=>m(!1)},null),t.header?t.header():f.value&&e.createVNode(C,null,{default:()=>[f.value]}),e.createVNode(k,null,{default:()=>{var u;return[(u=t.default)==null?void 0:u.call(t)]}}),(y=t.footer)==null?void 0:y.call(t)])]}})]})}}),S=e.defineComponent({name:"DModalFooter",setup(o,{slots:t}){return()=>{var n;return e.createVNode("div",{class:"devui-modal-footer"},[(n=t.default)==null?void 0:n.call(t)])}}});class Y{constructor(t){this.anchorContainer=t}renderModal(t,n,d){const i=e.h(this.component(),n,d);return e.render(i,t),i}renderNull(t){setTimeout(()=>{e.render(null,t)},500)}}let N;class V extends Y{component(){return b}open(t={}){const n=document.createElement("div");this.anchorContainer.appendChild(n);const y=t,{header:d,content:i,footer:a}=y,l=M(y,["header","content","footer"]),s=u=>{u||m()},f=(u,v=s)=>this.renderModal(n,h(w({},u),{modelValue:!0,"onUpdate:modelValue":v}),{header:d,default:i,footer:a}),m=()=>{var u,v;f(l,O=>{O?f(l):(this.renderModal(n,h(w({},l),{modelValue:!1})),this.renderNull(n))}),(v=(u=N.component.exposed).handleVisibleChange)==null||v.call(u,!1)};return this.renderModal(n,{modelValue:!1}),N=f(l),{hide:m}}}A(V,"token","MODAL_SERVICE_TOKEN");var K={title:"Modal \u5F39\u7A97",category:"\u53CD\u9988",status:"100%",install(o){if(o.component(b.name,b),o.component(C.name,C),o.component(k.name,k),o.component(S.name,S),!U)return;let t=document.getElementById("d-modal-anchors-container");t||(t=document.createElement("div"),t.setAttribute("id","d-modal-anchors-container"),document.body.appendChild(t)),o.provide(V.token,new V(t))}};r.Modal=b,r.default=K,Object.defineProperty(r,"__esModule",{value:!0}),r[Symbol.toStringTag]="Module"});
|
package/modal/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
@keyframes d-overlay-fade{0%{opacity:0}to{opacity:1}}.devui-overlay-fade-enter{opacity:0}.devui-overlay-fade-enter-active{animation-name:d-overlay-fade;animation-duration:.3s}.devui-overlay-fade-leave{opacity:1}.devui-overlay-fade-leave-active{animation-name:d-overlay-fade;animation-duration:.3s;animation-direction:reverse}.devui-overlay-background{position:fixed;top:0;left:0;height:100vh;width:100vw;display:flex}.devui-overlay-background__color{background:rgba(0,0,0,.4)}.devui-overlay-background .devui-overlay{position:relative;z-index:1000;pointer-events:auto}.devui-overlay-background__disabled{pointer-events:none}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 2px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-connected-overlay, 0 2px 8px 0) var(--devui-shadow, rgba(0, 0, 0, .2));z-index:1000}.devui-flexible-overlay-arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}.devui-modal-mask{justify-content:center;align-items:center;background-color:var(--devui-shadow, rgba(0, 0, 0, .2))}.devui-modal{position:relative;width:300px;background-color:var(--devui-global-bg-normal, #ffffff)}.devui-modal .btn-close{position:absolute;right:20px;top:20px;width:20px;height:20px;line-height:20px;text-align:center;color:#000;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.devui-modal .btn-close:hover{color:var(--devui-icon-fill-active-hover, #526ecc);background-color:var(--devui-list-item-hover-bg, #f2f5fc)}.devui-modal-content{background:var(--devui-fullscreen-overlay-bg, #ffffff);border-radius:var(--devui-border-radius, 2px)}.devui-modal-header{width:100%;height:56px;padding:32px 32px 0;font-size:var(--devui-font-size-card-title, 14px);font-weight:700;box-sizing:border-box;border:none;user-select:none}.devui-modal-header .header-alert-icon{display:inline-block;vertical-align:middle;margin-right:8px;line-height:16px;text-align:center}.devui-modal-body{padding:20px 32px;font-size:var(--devui-font-size, 12px);color:var(--devui-text-weak, #575d6c);box-sizing:border-box}.devui-modal-footer{width:100%;border-top:none;text-align:center;padding:0 32px 24px;box-sizing:border-box}.devui-modal-footer>*{margin:0 4px}@keyframes wipe-in-out{0%{opacity:.2;transform:translateY(-24px)}to{opacity:1;transform:translateY(0)}}.devui-modal-wipe-enter-from{opacity:.2}.devui-modal-wipe-enter-active{animation-name:wipe-in-out;animation-duration:.3s}.devui-modal-wipe-leave-to{opacity:1}.devui-modal-wipe-leave-active{animation-name:wipe-in-out;animation-duration:.3s;animation-direction:reverse}
|
package/notification/index.es.js
CHANGED
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent,
|
|
20
|
+
import { defineComponent, toRefs, createVNode, computed, watch, Transition, reactive, createApp, onUnmounted, mergeProps, isVNode } from "vue";
|
|
21
21
|
const notificationProps = {
|
|
22
22
|
modelValue: {
|
|
23
23
|
type: Boolean,
|
|
@@ -39,55 +39,53 @@ const notificationProps = {
|
|
|
39
39
|
type: Function
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
+
const iconProps = {
|
|
43
|
+
name: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "",
|
|
46
|
+
required: true
|
|
47
|
+
},
|
|
48
|
+
size: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: "inherit"
|
|
51
|
+
},
|
|
52
|
+
color: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: "inherit"
|
|
55
|
+
},
|
|
56
|
+
classPrefix: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: "icon"
|
|
59
|
+
}
|
|
60
|
+
};
|
|
42
61
|
var Icon = defineComponent({
|
|
43
62
|
name: "DIcon",
|
|
44
|
-
props:
|
|
45
|
-
name: {
|
|
46
|
-
type: String,
|
|
47
|
-
required: true
|
|
48
|
-
},
|
|
49
|
-
size: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: "inherit"
|
|
52
|
-
},
|
|
53
|
-
color: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: "inherit"
|
|
56
|
-
},
|
|
57
|
-
classPrefix: {
|
|
58
|
-
type: String,
|
|
59
|
-
default: "icon"
|
|
60
|
-
}
|
|
61
|
-
},
|
|
63
|
+
props: iconProps,
|
|
62
64
|
setup(props) {
|
|
63
|
-
return __spreadValues({}, props);
|
|
64
|
-
},
|
|
65
|
-
render() {
|
|
66
65
|
const {
|
|
67
66
|
name,
|
|
68
67
|
size,
|
|
69
68
|
color,
|
|
70
69
|
classPrefix
|
|
71
|
-
} =
|
|
72
|
-
return
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
70
|
+
} = toRefs(props);
|
|
71
|
+
return () => {
|
|
72
|
+
return /^((https?):)?\/\//.test(name.value) ? createVNode("img", {
|
|
73
|
+
"src": name.value,
|
|
74
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
75
|
+
"style": {
|
|
76
|
+
width: size.value,
|
|
77
|
+
verticalAlign: "text-bottom"
|
|
78
|
+
}
|
|
79
|
+
}, null) : createVNode("i", {
|
|
80
|
+
"class": `${classPrefix.value} ${classPrefix.value}-${name.value}`,
|
|
81
|
+
"style": {
|
|
82
|
+
fontSize: size.value,
|
|
83
|
+
color: color.value
|
|
84
|
+
}
|
|
85
|
+
}, null);
|
|
86
|
+
};
|
|
86
87
|
}
|
|
87
88
|
});
|
|
88
|
-
Icon.install = function(app) {
|
|
89
|
-
app.component(Icon.name, Icon);
|
|
90
|
-
};
|
|
91
89
|
var Close = defineComponent({
|
|
92
90
|
emits: ["click"],
|
|
93
91
|
setup(props, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var I=Object.defineProperty,M=Object.defineProperties;var R=Object.getOwnPropertyDescriptors;var v=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var N=(i,e,l)=>e in i?I(i,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[e]=l,m=(i,e)=>{for(var l in e||(e={}))k.call(e,l)&&N(i,l,e[l]);if(v)for(var l of v(e))A.call(e,l)&&N(i,l,e[l]);return i},g=(i,e)=>M(i,R(e));(function(i,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis!="undefined"?globalThis:i||self,e(i.index={},i.Vue))})(this,function(i,e){"use strict";const l={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},type:{type:String,default:"normal"},duration:{type:Number,default:3e3},onClose:{type:Function}},S={name:{type:String,default:"",required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}};var p=e.defineComponent({name:"DIcon",props:S,setup(n){const{name:t,size:o,color:a,classPrefix:c}=e.toRefs(n);return()=>/^((https?):)?\/\//.test(t.value)?e.createVNode("img",{src:t.value,alt:t.value.split("/")[t.value.split("/").length-1],style:{width:o.value,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${c.value} ${c.value}-${t.value}`,style:{fontSize:o.value,color:a.value}},null)}}),h=e.defineComponent({emits:["click"],setup(n,{emit:t}){return()=>e.createVNode("div",{class:"devui-notification-icon-close",onClick:o=>t("click",o)},[e.createVNode(p,{name:"close",size:"14px"},null)])}}),C=e.defineComponent({props:{type:{type:String,default:"normal"}},setup(n){const{type:t}=e.toRefs(n),o=e.computed(()=>({"devui-notification-image":!0,[`devui-notification-image-${t.value}`]:!0})),a={info:"info-o",success:"right-o",warning:"warning-o",error:"error-o"};return()=>e.createVNode("span",{class:o.value},[t.value!=="normal"&&e.createVNode(p,{name:a[t.value],size:"16px"},null)])}});function T(n){return{classes:e.computed(()=>({"devui-notification-item-container":!0,[`devui-notification-message-${n.type}`]:!0}))}}function b(n,t){let o=null,a;const c=()=>{var s;clearTimeout(o),o=null,(s=n.onClose)==null||s.call(n),t("update:modelValue",!1)},r=()=>{o&&(clearTimeout(o),o=null)},d=()=>{if(!n.modelValue){const s=n.duration-(Date.now()-a);o=setTimeout(c,s)}},f=()=>{t("destroy")};return e.watch(()=>n.modelValue,s=>{s&&(a=Date.now(),n.duration&&(o=setTimeout(c,n.duration)))}),{interrupt:r,removeReset:d,close:c,handleDestroy:f}}var E="",u=e.defineComponent({name:"DNotification",props:l,emits:["update:modelValue","destroy"],setup(n,{emit:t,slots:o}){const{modelValue:a,title:c,type:r}=e.toRefs(n),{classes:d}=T(n),{interrupt:f,removeReset:s,close:x,handleDestroy:z}=b(n,t);return()=>e.createVNode(e.Transition,{name:"notification-fade",onAfterLeave:z},{default:()=>{var V;return[a.value&&e.createVNode("div",{class:"devui-notification"},[e.createVNode("div",{class:d.value,onMouseenter:f,onMouseleave:s},[e.createVNode("div",{class:"devui-notification-item"},[e.createVNode(h,{onClick:x},null),c.value&&e.createVNode(C,{type:r.value},null),e.createVNode("div",{class:"devui-notification-message"},[e.createVNode("span",{class:"devui-notification-title"},[c.value]),e.createVNode("span",{class:"devui-notification-content"},[(V=o.default)==null?void 0:V.call(o)])])])])])]}})}});function D(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const P={modelValue:!1,duration:3e3,type:"normal"};function w(n,t){const o=document.createElement("div"),a=e.createApp({setup(){return e.onUnmounted(()=>{document.body.removeChild(o)}),()=>e.createVNode(u,e.mergeProps(n,{onDestroy:a.unmount}),D(t)?t:{default:()=>[t]})}});return document.body.appendChild(o),a.mount(o),a}function $(n,t){n.modelValue=!1,t==null||t()}class y{static open(t){const o=t.onClose||null,a=t.content;let c;delete t.content;const r=e.reactive(g(m(m({},P),t),{onClose:()=>{$(r,o)}}));w(r,a),r.modelValue=!0,clearTimeout(c),t.duration&&(c=setTimeout(r.onClose,t.duration))}}var j={title:"Notification \u5168\u5C40\u901A\u77E5",category:"\u53CD\u9988",status:"100%",install(n){n.component(u.name,u),n.config.globalProperties.$notificationService=y}};i.Notification=u,i.NotificationService=y,i.default=j,i.notificationProps=l,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
|
package/overlay/index.es.js
CHANGED
|
@@ -17,9 +17,9 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref,
|
|
21
|
-
import { offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
|
|
22
|
-
var
|
|
20
|
+
import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref, unref, nextTick, mergeProps } from "vue";
|
|
21
|
+
import { shift, offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
|
|
22
|
+
var baseOverlay = "";
|
|
23
23
|
function _isSlot(s) {
|
|
24
24
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
25
25
|
}
|
|
@@ -66,43 +66,13 @@ const overlayProps = {
|
|
|
66
66
|
default: true
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
const overlayEmits = ["update:visible", "backdropClick"];
|
|
70
69
|
const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
|
|
71
70
|
overlayStyle: {
|
|
72
71
|
type: [String, Object],
|
|
73
72
|
default: void 0
|
|
74
73
|
}
|
|
75
74
|
});
|
|
76
|
-
const
|
|
77
|
-
modelValue: {
|
|
78
|
-
type: Boolean,
|
|
79
|
-
default: false
|
|
80
|
-
},
|
|
81
|
-
origin: {
|
|
82
|
-
type: Object,
|
|
83
|
-
require: true
|
|
84
|
-
},
|
|
85
|
-
position: {
|
|
86
|
-
type: Array,
|
|
87
|
-
default: ["bottom"]
|
|
88
|
-
},
|
|
89
|
-
offset: {
|
|
90
|
-
type: [Number, Object],
|
|
91
|
-
default: 8
|
|
92
|
-
},
|
|
93
|
-
align: {
|
|
94
|
-
type: String,
|
|
95
|
-
default: null
|
|
96
|
-
},
|
|
97
|
-
showArrow: {
|
|
98
|
-
type: Boolean,
|
|
99
|
-
default: false
|
|
100
|
-
},
|
|
101
|
-
isArrowCenter: {
|
|
102
|
-
type: Boolean,
|
|
103
|
-
default: true
|
|
104
|
-
}
|
|
105
|
-
};
|
|
75
|
+
const overlayEmits = ["update:visible", "backdropClick"];
|
|
106
76
|
function useOverlayLogic(props, ctx) {
|
|
107
77
|
const backgroundClass = computed(() => {
|
|
108
78
|
return [
|
|
@@ -153,6 +123,7 @@ function useOverlayLogic(props, ctx) {
|
|
|
153
123
|
handleOverlayBubbleCancel
|
|
154
124
|
};
|
|
155
125
|
}
|
|
126
|
+
var fixedOverlay = "";
|
|
156
127
|
const FixedOverlay = defineComponent({
|
|
157
128
|
name: "DFixedOverlay",
|
|
158
129
|
props: fixedOverlayProps,
|
|
@@ -177,6 +148,36 @@ const FixedOverlay = defineComponent({
|
|
|
177
148
|
});
|
|
178
149
|
}
|
|
179
150
|
});
|
|
151
|
+
const flexibleOverlayProps = {
|
|
152
|
+
modelValue: {
|
|
153
|
+
type: Boolean,
|
|
154
|
+
default: false
|
|
155
|
+
},
|
|
156
|
+
origin: {
|
|
157
|
+
type: Object,
|
|
158
|
+
require: true
|
|
159
|
+
},
|
|
160
|
+
position: {
|
|
161
|
+
type: Array,
|
|
162
|
+
default: ["bottom"]
|
|
163
|
+
},
|
|
164
|
+
offset: {
|
|
165
|
+
type: [Number, Object],
|
|
166
|
+
default: 8
|
|
167
|
+
},
|
|
168
|
+
align: {
|
|
169
|
+
type: String,
|
|
170
|
+
default: null
|
|
171
|
+
},
|
|
172
|
+
showArrow: {
|
|
173
|
+
type: Boolean,
|
|
174
|
+
default: false
|
|
175
|
+
},
|
|
176
|
+
isArrowCenter: {
|
|
177
|
+
type: Boolean,
|
|
178
|
+
default: true
|
|
179
|
+
}
|
|
180
|
+
};
|
|
180
181
|
function getScrollParent(element) {
|
|
181
182
|
const overflowRegex = /(auto|scroll|hidden)/;
|
|
182
183
|
for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
|
|
@@ -230,6 +231,7 @@ function useOverlay(props, emit) {
|
|
|
230
231
|
const overlayEl = unref(overlayRef.value);
|
|
231
232
|
const arrowEl = unref(arrowRef.value);
|
|
232
233
|
const middleware = [
|
|
234
|
+
shift(),
|
|
233
235
|
offset(props.offset),
|
|
234
236
|
autoPlacement({
|
|
235
237
|
alignment: props.align,
|
|
@@ -264,7 +266,7 @@ function useOverlay(props, emit) {
|
|
|
264
266
|
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
265
267
|
window.removeEventListener("resize", updatePosition);
|
|
266
268
|
});
|
|
267
|
-
return { arrowRef, overlayRef };
|
|
269
|
+
return { arrowRef, overlayRef, updatePosition };
|
|
268
270
|
}
|
|
269
271
|
var flexibleOverlay = "";
|
|
270
272
|
const FlexibleOverlay = defineComponent({
|
|
@@ -275,12 +277,17 @@ const FlexibleOverlay = defineComponent({
|
|
|
275
277
|
setup(props, {
|
|
276
278
|
slots,
|
|
277
279
|
attrs,
|
|
278
|
-
emit
|
|
280
|
+
emit,
|
|
281
|
+
expose
|
|
279
282
|
}) {
|
|
280
283
|
const {
|
|
281
284
|
arrowRef,
|
|
282
|
-
overlayRef
|
|
285
|
+
overlayRef,
|
|
286
|
+
updatePosition
|
|
283
287
|
} = useOverlay(props, emit);
|
|
288
|
+
expose({
|
|
289
|
+
updatePosition
|
|
290
|
+
});
|
|
284
291
|
return () => {
|
|
285
292
|
var _a;
|
|
286
293
|
return props.modelValue && createVNode("div", mergeProps({
|