vue-devui 1.0.0-beta.1 → 1.0.0-beta.13
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 +62 -45
- package/accordion/index.d.ts +7 -0
- package/accordion/index.es.js +460 -142
- package/accordion/index.umd.js +1 -1
- package/accordion/style.css +1 -1
- package/alert/index.d.ts +7 -0
- package/alert/index.es.js +7 -5
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/anchor/index.d.ts +7 -0
- package/avatar/index.d.ts +7 -0
- package/avatar/index.es.js +1 -1
- package/avatar/index.umd.js +1 -1
- package/back-top/index.d.ts +7 -0
- package/back-top/index.es.js +128 -0
- package/back-top/index.umd.js +1 -0
- package/back-top/package.json +7 -0
- package/back-top/style.css +1 -0
- package/badge/index.d.ts +7 -0
- package/badge/index.es.js +1 -1
- package/badge/index.umd.js +1 -1
- package/breadcrumb/index.d.ts +7 -0
- package/button/index.d.ts +7 -0
- package/button/index.es.js +218 -12
- package/button/index.umd.js +1 -1
- package/button/style.css +1 -1
- package/card/index.d.ts +7 -0
- package/card/index.es.js +1 -1
- package/card/index.umd.js +1 -1
- package/carousel/index.d.ts +7 -0
- package/carousel/index.es.js +5 -4
- package/carousel/index.umd.js +1 -1
- package/cascader/index.d.ts +7 -0
- package/cascader/index.es.js +1239 -83
- package/cascader/index.umd.js +1 -1
- package/cascader/style.css +1 -1
- package/checkbox/index.d.ts +7 -0
- package/checkbox/index.es.js +43 -8
- package/checkbox/index.umd.js +1 -1
- package/color-picker/index.d.ts +7 -0
- package/color-picker/index.es.js +2960 -0
- package/color-picker/index.umd.js +1 -0
- package/color-picker/package.json +7 -0
- package/color-picker/style.css +1 -0
- package/comment/index.d.ts +7 -0
- package/comment/index.es.js +85 -0
- package/comment/index.umd.js +1 -0
- package/comment/package.json +7 -0
- package/comment/style.css +1 -0
- package/countdown/index.d.ts +7 -0
- package/countdown/index.es.js +176 -0
- package/countdown/index.umd.js +1 -0
- package/countdown/package.json +7 -0
- package/countdown/style.css +1 -0
- package/date-picker/index.d.ts +7 -0
- package/date-picker/index.es.js +32 -21
- package/date-picker/index.umd.js +1 -1
- package/date-picker/style.css +1 -1
- package/dragdrop/index.d.ts +7 -0
- package/dragdrop/index.es.js +157 -0
- package/dragdrop/index.umd.js +1 -0
- package/dragdrop/package.json +7 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +194 -42
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +535 -0
- package/dropdown/index.umd.js +1 -0
- package/dropdown/package.json +7 -0
- package/dropdown/style.css +1 -0
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +5782 -469
- package/editable-select/index.umd.js +27 -1
- package/editable-select/style.css +1 -1
- package/form/index.d.ts +7 -0
- package/form/index.es.js +2257 -0
- package/form/index.umd.js +1 -0
- package/form/package.json +7 -0
- package/form/style.css +1 -0
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +14 -4
- package/fullscreen/index.umd.js +1 -1
- package/gantt/index.d.ts +7 -0
- package/gantt/index.es.js +535 -0
- package/gantt/index.umd.js +1 -0
- package/gantt/package.json +7 -0
- package/gantt/style.css +1 -0
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +269 -0
- package/grid/index.umd.js +1 -0
- package/grid/package.json +7 -0
- package/grid/style.css +1 -0
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +6 -5
- package/icon/index.umd.js +1 -1
- package/image-preview/index.d.ts +7 -0
- package/image-preview/index.es.js +99 -20
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/index.d.ts +7 -0
- package/input/index.d.ts +7 -0
- package/input/index.es.js +24 -13
- package/input/index.umd.js +1 -1
- package/input-icon/index.d.ts +7 -0
- package/input-icon/index.es.js +332 -0
- package/input-icon/index.umd.js +1 -0
- package/input-icon/package.json +7 -0
- package/input-icon/style.css +1 -0
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +5 -4
- package/input-number/index.umd.js +1 -1
- package/layout/index.d.ts +7 -0
- package/layout/index.es.js +1 -1
- package/layout/index.umd.js +1 -1
- package/loading/index.d.ts +7 -0
- package/loading/index.es.js +1 -1
- package/loading/index.umd.js +1 -1
- package/modal/index.d.ts +7 -0
- package/modal/index.es.js +328 -109
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/nav-sprite/index.d.ts +7 -0
- package/nuxt/components/Accordion.js +3 -0
- package/nuxt/components/Alert.js +3 -0
- package/nuxt/components/Anchor.js +3 -0
- package/nuxt/components/Aside.js +3 -0
- package/nuxt/components/Avatar.js +3 -0
- package/nuxt/components/BackTop.js +3 -0
- package/nuxt/components/Badge.js +3 -0
- package/nuxt/components/Breadcrumb.js +3 -0
- package/nuxt/components/Button.js +3 -0
- package/nuxt/components/Card.js +3 -0
- package/nuxt/components/Carousel.js +3 -0
- package/nuxt/components/Cascader.js +3 -0
- package/nuxt/components/Checkbox.js +3 -0
- package/nuxt/components/Col.js +3 -0
- package/nuxt/components/ColorPicker.js +3 -0
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/Comment.js +3 -0
- package/nuxt/components/Content.js +3 -0
- package/nuxt/components/Countdown.js +3 -0
- package/nuxt/components/DatePicker.js +3 -0
- package/nuxt/components/Drawer.js +3 -0
- package/nuxt/components/DrawerService.js +3 -0
- package/nuxt/components/Dropdown.js +3 -0
- package/nuxt/components/EditableSelect.js +3 -0
- package/nuxt/components/FixedOverlay.js +3 -0
- package/nuxt/components/FlexibleOverlay.js +3 -0
- package/nuxt/components/Footer.js +3 -0
- package/nuxt/components/Form.js +3 -0
- package/nuxt/components/FormControl.js +3 -0
- package/nuxt/components/FormItem.js +3 -0
- package/nuxt/components/FormLabel.js +3 -0
- package/nuxt/components/FormOperation.js +3 -0
- package/nuxt/components/Fullscreen.js +3 -0
- package/nuxt/components/Gantt.js +3 -0
- package/nuxt/components/Header.js +3 -0
- package/nuxt/components/Icon.js +2 -0
- package/nuxt/components/ImagePreviewService.js +3 -0
- package/nuxt/components/Input.js +3 -0
- package/nuxt/components/InputIcon.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/Layout.js +3 -0
- package/nuxt/components/Loading.js +3 -0
- package/nuxt/components/LoadingService.js +3 -0
- package/nuxt/components/Modal.js +3 -0
- package/nuxt/components/NavSprite.js +2 -0
- package/nuxt/components/Pagination.js +3 -0
- package/nuxt/components/Panel.js +3 -0
- package/nuxt/components/Popover.js +3 -0
- package/nuxt/components/Progress.js +3 -0
- package/nuxt/components/QuadrantDiagram.js +3 -0
- package/nuxt/components/Radio.js +3 -0
- package/nuxt/components/RadioGroup.js +3 -0
- package/nuxt/components/Rate.js +3 -0
- package/nuxt/components/ReadTip.js +3 -0
- package/nuxt/components/Result.js +3 -0
- package/nuxt/components/Row.js +3 -0
- package/nuxt/components/Search.js +3 -0
- package/nuxt/components/Select.js +3 -0
- package/nuxt/components/Skeleton.js +3 -0
- package/nuxt/components/SkeletonItem.js +3 -0
- package/nuxt/components/Slider.js +3 -0
- package/nuxt/components/Splitter.js +3 -0
- package/nuxt/components/Statistic.js +3 -0
- package/nuxt/components/Status.js +3 -0
- package/nuxt/components/StepsGuide.js +3 -0
- package/nuxt/components/StickSlider.js +3 -0
- package/nuxt/components/Sticky.js +2 -0
- package/nuxt/components/Switch.js +3 -0
- package/nuxt/components/Table.js +3 -0
- package/nuxt/components/Tabs.js +3 -0
- package/nuxt/components/Tag.js +3 -0
- package/nuxt/components/TagInput.js +3 -0
- package/nuxt/components/Textarea.js +3 -0
- package/nuxt/components/TimeAxis.js +3 -0
- package/nuxt/components/TimeAxisItem.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/Toast.js +3 -0
- package/nuxt/components/ToastService.js +3 -0
- package/nuxt/components/Tooltip.js +3 -0
- package/nuxt/components/Transfer.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/TreeSelect.js +3 -0
- package/nuxt/components/Upload.js +3 -0
- package/nuxt/components/buttonProps.js +3 -0
- package/nuxt/index.js +13 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +111 -94
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +5 -47
- package/pagination/index.d.ts +7 -0
- package/pagination/index.es.js +3 -3
- package/pagination/index.umd.js +1 -1
- package/panel/index.d.ts +7 -0
- package/panel/index.es.js +25 -22
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.d.ts +7 -0
- package/popover/index.es.js +18 -6
- package/popover/index.umd.js +1 -1
- package/progress/index.d.ts +7 -0
- package/progress/index.es.js +9 -9
- package/progress/index.umd.js +3 -3
- package/quadrant-diagram/index.d.ts +7 -0
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +6 -6
- package/radio/index.umd.js +1 -1
- package/rate/index.d.ts +7 -0
- package/rate/index.es.js +1 -1
- package/rate/index.umd.js +1 -1
- package/read-tip/index.d.ts +7 -0
- package/read-tip/index.es.js +258 -0
- package/read-tip/index.umd.js +1 -0
- package/read-tip/package.json +7 -0
- package/read-tip/style.css +1 -0
- package/result/index.d.ts +7 -0
- package/result/index.es.js +119 -0
- package/result/index.umd.js +1 -0
- package/result/package.json +7 -0
- package/result/style.css +1 -0
- package/ripple/index.d.ts +7 -0
- package/ripple/index.es.js +5 -2
- package/ripple/index.umd.js +1 -1
- package/search/index.d.ts +7 -0
- package/search/index.es.js +35 -21
- package/search/index.umd.js +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +47 -11
- package/select/index.umd.js +1 -1
- package/skeleton/index.d.ts +7 -0
- package/skeleton/index.es.js +148 -26
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.d.ts +7 -0
- package/slider/index.es.js +32 -182
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.d.ts +7 -0
- package/splitter/index.es.js +295 -100
- package/splitter/index.umd.js +1 -1
- package/splitter/style.css +1 -1
- package/statistic/index.d.ts +7 -0
- package/statistic/index.es.js +280 -0
- package/statistic/index.umd.js +1 -0
- package/statistic/package.json +7 -0
- package/statistic/style.css +1 -0
- package/status/index.d.ts +7 -0
- package/status/index.es.js +2 -2
- package/status/index.umd.js +1 -1
- package/steps-guide/index.d.ts +7 -0
- package/steps-guide/index.es.js +101 -73
- package/steps-guide/index.umd.js +1 -1
- package/steps-guide/style.css +1 -1
- package/sticky/index.d.ts +7 -0
- package/style.css +1 -1
- package/switch/index.d.ts +7 -0
- package/switch/index.es.js +1 -1
- package/switch/index.umd.js +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +1708 -156
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +6 -3
- package/tabs/index.umd.js +1 -1
- package/tag/index.d.ts +7 -0
- package/tag/index.es.js +131 -0
- package/tag/index.umd.js +1 -0
- package/tag/package.json +7 -0
- package/tag/style.css +1 -0
- package/tag-input/index.d.ts +7 -0
- package/tag-input/index.es.js +1 -13
- package/tag-input/index.umd.js +1 -1
- package/textarea/index.d.ts +7 -0
- package/textarea/index.es.js +132 -0
- package/textarea/index.umd.js +1 -0
- package/textarea/package.json +7 -0
- package/textarea/style.css +1 -0
- package/time-axis/index.d.ts +7 -0
- package/time-axis/index.es.js +241 -21
- package/time-axis/index.umd.js +1 -1
- package/time-axis/style.css +1 -1
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +266 -32
- package/time-picker/index.umd.js +1 -1
- package/time-picker/style.css +1 -1
- package/toast/index.d.ts +7 -0
- package/toast/index.es.js +16 -12
- package/toast/index.umd.js +1 -1
- package/toast/style.css +1 -1
- package/tooltip/index.d.ts +7 -0
- package/transfer/index.d.ts +7 -0
- package/transfer/index.es.js +575 -83
- package/transfer/index.umd.js +1 -1
- package/transfer/style.css +1 -1
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +171 -35
- package/tree/index.umd.js +1 -1
- package/tree-select/index.d.ts +7 -0
- package/tree-select/index.es.js +528 -0
- package/tree-select/index.umd.js +1 -0
- package/tree-select/package.json +7 -0
- package/tree-select/style.css +1 -0
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +172 -513
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +22079 -8773
- package/vue-devui.umd.js +29 -3
package/modal/index.es.js
CHANGED
|
@@ -33,7 +33,7 @@ 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, withDirectives, vShow, ref, reactive,
|
|
36
|
+
import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, withDirectives, vShow, ref, reactive, toRef, isRef, h, render, readonly, mergeProps, resolveDirective } from "vue";
|
|
37
37
|
const modalProps = {
|
|
38
38
|
width: {
|
|
39
39
|
type: String,
|
|
@@ -68,7 +68,7 @@ const modalProps = {
|
|
|
68
68
|
},
|
|
69
69
|
backdropCloseable: {
|
|
70
70
|
type: Boolean,
|
|
71
|
-
default:
|
|
71
|
+
default: true
|
|
72
72
|
},
|
|
73
73
|
bodyScrollable: {
|
|
74
74
|
type: Boolean,
|
|
@@ -115,9 +115,6 @@ const overlayProps = {
|
|
|
115
115
|
visible: {
|
|
116
116
|
type: Boolean
|
|
117
117
|
},
|
|
118
|
-
"onUpdate:visible": {
|
|
119
|
-
type: Function
|
|
120
|
-
},
|
|
121
118
|
backgroundBlock: {
|
|
122
119
|
type: Boolean,
|
|
123
120
|
default: false
|
|
@@ -129,27 +126,57 @@ const overlayProps = {
|
|
|
129
126
|
backgroundStyle: {
|
|
130
127
|
type: [String, Object]
|
|
131
128
|
},
|
|
132
|
-
|
|
129
|
+
onBackdropClick: {
|
|
133
130
|
type: Function
|
|
134
131
|
},
|
|
135
132
|
backdropClose: {
|
|
136
133
|
type: Boolean,
|
|
137
134
|
default: true
|
|
135
|
+
},
|
|
136
|
+
hasBackdrop: {
|
|
137
|
+
type: Boolean,
|
|
138
|
+
default: true
|
|
138
139
|
}
|
|
139
140
|
};
|
|
140
|
-
|
|
141
|
+
const overlayEmits = ["update:visible", "backdropClick"];
|
|
142
|
+
const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
|
|
143
|
+
overlayStyle: {
|
|
144
|
+
type: [String, Object],
|
|
145
|
+
default: void 0
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
const flexibleOverlayProps = __spreadValues({
|
|
149
|
+
origin: {
|
|
150
|
+
type: Object,
|
|
151
|
+
require: true
|
|
152
|
+
},
|
|
153
|
+
position: {
|
|
154
|
+
type: Object,
|
|
155
|
+
default: () => ({
|
|
156
|
+
originX: "left",
|
|
157
|
+
originY: "top",
|
|
158
|
+
overlayX: "left",
|
|
159
|
+
overlayY: "top"
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
}, overlayProps);
|
|
163
|
+
function useOverlayLogic(props, ctx) {
|
|
141
164
|
const backgroundClass = computed(() => {
|
|
142
|
-
return [
|
|
165
|
+
return [
|
|
166
|
+
"devui-overlay-background",
|
|
167
|
+
props.backgroundClass,
|
|
168
|
+
!props.hasBackdrop ? "devui-overlay-background__disabled" : "devui-overlay-background__color"
|
|
169
|
+
];
|
|
143
170
|
});
|
|
144
171
|
const overlayClass = computed(() => {
|
|
145
172
|
return "devui-overlay";
|
|
146
173
|
});
|
|
147
174
|
const handleBackdropClick = (event) => {
|
|
148
|
-
var _a
|
|
175
|
+
var _a;
|
|
149
176
|
event.preventDefault();
|
|
150
|
-
(_a = props.
|
|
177
|
+
(_a = props.onBackdropClick) == null ? void 0 : _a.call(props);
|
|
151
178
|
if (props.backdropClose) {
|
|
152
|
-
(
|
|
179
|
+
ctx.emit("update:visible", false);
|
|
153
180
|
}
|
|
154
181
|
};
|
|
155
182
|
const handleOverlayBubbleCancel = (event) => event.cancelBubble = true;
|
|
@@ -185,19 +212,15 @@ function useOverlayLogic(props) {
|
|
|
185
212
|
}
|
|
186
213
|
const FixedOverlay = defineComponent({
|
|
187
214
|
name: "DFixedOverlay",
|
|
188
|
-
props:
|
|
189
|
-
|
|
190
|
-
type: Object,
|
|
191
|
-
default: void 0
|
|
192
|
-
}
|
|
193
|
-
}),
|
|
215
|
+
props: fixedOverlayProps,
|
|
216
|
+
emits: overlayEmits,
|
|
194
217
|
setup(props, ctx) {
|
|
195
218
|
const {
|
|
196
219
|
backgroundClass,
|
|
197
220
|
overlayClass,
|
|
198
221
|
handleBackdropClick,
|
|
199
222
|
handleOverlayBubbleCancel
|
|
200
|
-
} = useOverlayLogic(props);
|
|
223
|
+
} = useOverlayLogic(props, ctx);
|
|
201
224
|
return () => createVNode(CommonOverlay, null, {
|
|
202
225
|
default: () => [withDirectives(createVNode("div", {
|
|
203
226
|
"class": backgroundClass.value,
|
|
@@ -211,84 +234,70 @@ const FixedOverlay = defineComponent({
|
|
|
211
234
|
});
|
|
212
235
|
}
|
|
213
236
|
});
|
|
237
|
+
function isComponent(target) {
|
|
238
|
+
return !!(target == null ? void 0 : target.$el);
|
|
239
|
+
}
|
|
240
|
+
function getElement(element) {
|
|
241
|
+
if (element instanceof Element) {
|
|
242
|
+
return element;
|
|
243
|
+
}
|
|
244
|
+
if (element && typeof element === "object" && element.$el instanceof Element) {
|
|
245
|
+
return element.$el;
|
|
246
|
+
}
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
214
249
|
const FlexibleOverlay = defineComponent({
|
|
215
250
|
name: "DFlexibleOverlay",
|
|
216
|
-
props:
|
|
217
|
-
|
|
218
|
-
type: Object,
|
|
219
|
-
require: true
|
|
220
|
-
},
|
|
221
|
-
position: {
|
|
222
|
-
type: Object,
|
|
223
|
-
default: () => ({
|
|
224
|
-
originX: "left",
|
|
225
|
-
originY: "top",
|
|
226
|
-
overlayX: "left",
|
|
227
|
-
overlayY: "top"
|
|
228
|
-
})
|
|
229
|
-
}
|
|
230
|
-
}, overlayProps),
|
|
231
|
-
emits: ["onUpdate:visible"],
|
|
251
|
+
props: flexibleOverlayProps,
|
|
252
|
+
emits: overlayEmits,
|
|
232
253
|
setup(props, ctx) {
|
|
233
254
|
const overlayRef = ref(null);
|
|
234
255
|
const positionedStyle = reactive({
|
|
235
256
|
position: "absolute"
|
|
236
257
|
});
|
|
237
|
-
const instance = getCurrentInstance();
|
|
238
258
|
onMounted(async () => {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
if (!overlay2) {
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
const origin = getOrigin(props.origin);
|
|
245
|
-
if (!origin) {
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
const handleRectChange = (rect) => {
|
|
249
|
-
const point = calculatePosition(props.position, rect, origin);
|
|
259
|
+
const handleRectChange = (position, rect, origin) => {
|
|
260
|
+
const point = calculatePosition(position, rect, origin);
|
|
250
261
|
positionedStyle.left = `${point.x}px`;
|
|
251
262
|
positionedStyle.top = `${point.y}px`;
|
|
252
263
|
};
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
unsbscribeLayoutEvent(handleChange);
|
|
264
|
+
const locationElements = computed(() => {
|
|
265
|
+
const overlay2 = overlayRef.value;
|
|
266
|
+
const origin = getOrigin(props.origin);
|
|
267
|
+
if (!overlay2 || !origin) {
|
|
268
|
+
return;
|
|
259
269
|
}
|
|
270
|
+
return {
|
|
271
|
+
origin,
|
|
272
|
+
overlay: overlay2
|
|
273
|
+
};
|
|
274
|
+
});
|
|
275
|
+
const visibleRef = toRef(props, "visible");
|
|
276
|
+
const positionRef = toRef(props, "position");
|
|
277
|
+
watch([locationElements, visibleRef, positionRef], async ([locationElements2, visible, position], ov, onInvalidate) => {
|
|
278
|
+
if (!visible || !locationElements2) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
const {
|
|
282
|
+
origin,
|
|
283
|
+
overlay: overlay2
|
|
284
|
+
} = locationElements2;
|
|
285
|
+
handleRectChange(position, overlay2.getBoundingClientRect(), origin);
|
|
286
|
+
const unsubscriptions = [subscribeLayoutEvent(() => handleRectChange(position, overlay2.getBoundingClientRect(), origin)), subscribeOverlayResize(overlay2, (entries) => handleRectChange(position, entries[0].contentRect, origin)), subscribeOriginResize(origin, () => handleRectChange(position, overlay2.getBoundingClientRect(), origin))];
|
|
260
287
|
onInvalidate(() => {
|
|
261
|
-
|
|
288
|
+
unsubscriptions.forEach((fn) => fn());
|
|
262
289
|
});
|
|
263
290
|
});
|
|
264
|
-
|
|
265
|
-
handleChange();
|
|
266
|
-
});
|
|
267
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
268
|
-
handleRectChange(entries[0].contentRect);
|
|
269
|
-
});
|
|
270
|
-
resizeObserver.observe(overlay2);
|
|
271
|
-
onBeforeUnmount(() => {
|
|
272
|
-
resizeObserver.disconnect();
|
|
273
|
-
}, instance);
|
|
274
|
-
if (origin instanceof Element) {
|
|
275
|
-
const observer = new MutationObserver(handleChange);
|
|
276
|
-
observer.observe(origin, {
|
|
277
|
-
attributeFilter: ["style"]
|
|
278
|
-
});
|
|
279
|
-
onBeforeUnmount(() => {
|
|
280
|
-
observer.disconnect();
|
|
281
|
-
}, instance);
|
|
282
|
-
}
|
|
283
|
-
}, instance);
|
|
291
|
+
});
|
|
284
292
|
const {
|
|
285
293
|
backgroundClass,
|
|
286
294
|
overlayClass,
|
|
287
295
|
handleBackdropClick,
|
|
288
296
|
handleOverlayBubbleCancel
|
|
289
|
-
} = useOverlayLogic(props);
|
|
297
|
+
} = useOverlayLogic(props, ctx);
|
|
290
298
|
return () => createVNode(CommonOverlay, null, {
|
|
291
299
|
default: () => [withDirectives(createVNode("div", {
|
|
300
|
+
"style": props.backgroundStyle,
|
|
292
301
|
"class": backgroundClass.value,
|
|
293
302
|
"onClick": handleBackdropClick
|
|
294
303
|
}, [createVNode("div", {
|
|
@@ -300,15 +309,6 @@ const FlexibleOverlay = defineComponent({
|
|
|
300
309
|
});
|
|
301
310
|
}
|
|
302
311
|
});
|
|
303
|
-
function getElement(element) {
|
|
304
|
-
if (element instanceof Element) {
|
|
305
|
-
return element;
|
|
306
|
-
}
|
|
307
|
-
if (element && typeof element === "object" && element.$el instanceof Element) {
|
|
308
|
-
return element.$el;
|
|
309
|
-
}
|
|
310
|
-
return null;
|
|
311
|
-
}
|
|
312
312
|
function getOrigin(origin) {
|
|
313
313
|
if (origin instanceof Element) {
|
|
314
314
|
return origin;
|
|
@@ -316,17 +316,14 @@ function getOrigin(origin) {
|
|
|
316
316
|
if (isRef(origin)) {
|
|
317
317
|
return getElement(origin.value);
|
|
318
318
|
}
|
|
319
|
+
if (isComponent(origin)) {
|
|
320
|
+
return getElement(origin);
|
|
321
|
+
}
|
|
319
322
|
return origin;
|
|
320
323
|
}
|
|
321
|
-
function calculatePosition(position,
|
|
324
|
+
function calculatePosition(position, rect, origin) {
|
|
322
325
|
const originRect = getOriginRect(origin);
|
|
323
326
|
const originPoint = getOriginRelativePoint(originRect, position);
|
|
324
|
-
let rect;
|
|
325
|
-
if (panelOrRect instanceof HTMLElement) {
|
|
326
|
-
rect = panelOrRect.getBoundingClientRect();
|
|
327
|
-
} else {
|
|
328
|
-
rect = panelOrRect;
|
|
329
|
-
}
|
|
330
327
|
return getOverlayPoint(originPoint, rect, position);
|
|
331
328
|
}
|
|
332
329
|
function getOriginRect(origin) {
|
|
@@ -390,11 +387,31 @@ function subscribeLayoutEvent(event) {
|
|
|
390
387
|
window.addEventListener("scroll", event, true);
|
|
391
388
|
window.addEventListener("resize", event);
|
|
392
389
|
window.addEventListener("orientationchange", event);
|
|
390
|
+
return () => {
|
|
391
|
+
window.removeEventListener("scroll", event, true);
|
|
392
|
+
window.removeEventListener("resize", event);
|
|
393
|
+
window.removeEventListener("orientationchange", event);
|
|
394
|
+
};
|
|
393
395
|
}
|
|
394
|
-
function
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
396
|
+
function subscribeOverlayResize(overlay2, callback) {
|
|
397
|
+
if (overlay2 instanceof Element) {
|
|
398
|
+
const resizeObserver = new ResizeObserver(callback);
|
|
399
|
+
resizeObserver.observe(overlay2);
|
|
400
|
+
return () => resizeObserver.disconnect();
|
|
401
|
+
}
|
|
402
|
+
return () => {
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
function subscribeOriginResize(origin, callback) {
|
|
406
|
+
if (origin instanceof Element) {
|
|
407
|
+
const observer = new MutationObserver(callback);
|
|
408
|
+
observer.observe(origin, {
|
|
409
|
+
attributeFilter: ["style"]
|
|
410
|
+
});
|
|
411
|
+
return () => observer.disconnect();
|
|
412
|
+
}
|
|
413
|
+
return () => {
|
|
414
|
+
};
|
|
398
415
|
}
|
|
399
416
|
const inBrowser = typeof window !== "undefined";
|
|
400
417
|
FlexibleOverlay.install = function(app) {
|
|
@@ -544,7 +561,7 @@ const dialogProps = {
|
|
|
544
561
|
},
|
|
545
562
|
backdropCloseable: {
|
|
546
563
|
type: Boolean,
|
|
547
|
-
default:
|
|
564
|
+
default: true
|
|
548
565
|
},
|
|
549
566
|
bodyScrollable: {
|
|
550
567
|
type: Boolean,
|
|
@@ -688,11 +705,12 @@ var Icon = defineComponent({
|
|
|
688
705
|
color,
|
|
689
706
|
classPrefix
|
|
690
707
|
} = this;
|
|
691
|
-
return
|
|
708
|
+
return /^((https?):)?\/\//.test(name) ? createVNode("img", {
|
|
692
709
|
"src": name,
|
|
693
710
|
"alt": name.split("/")[name.split("/").length - 1],
|
|
694
711
|
"style": {
|
|
695
|
-
width: size
|
|
712
|
+
width: size,
|
|
713
|
+
verticalAlign: "text-bottom"
|
|
696
714
|
}
|
|
697
715
|
}, null) : createVNode("i", {
|
|
698
716
|
"class": `${classPrefix} ${classPrefix}-${name}`,
|
|
@@ -700,18 +718,214 @@ var Icon = defineComponent({
|
|
|
700
718
|
fontSize: size,
|
|
701
719
|
color
|
|
702
720
|
}
|
|
703
|
-
}, null)
|
|
721
|
+
}, null);
|
|
704
722
|
}
|
|
705
723
|
});
|
|
706
724
|
Icon.install = function(app) {
|
|
707
725
|
app.component(Icon.name, Icon);
|
|
708
726
|
};
|
|
727
|
+
class View {
|
|
728
|
+
constructor() {
|
|
729
|
+
__publicField(this, "top", "50%");
|
|
730
|
+
__publicField(this, "left", "50%");
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
const componentProps = {
|
|
734
|
+
message: String,
|
|
735
|
+
backdrop: Boolean,
|
|
736
|
+
view: {
|
|
737
|
+
type: Object,
|
|
738
|
+
default: () => new View()
|
|
739
|
+
},
|
|
740
|
+
zIndex: Number,
|
|
741
|
+
isFull: {
|
|
742
|
+
type: Boolean,
|
|
743
|
+
default: false
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
class LoadingProps {
|
|
747
|
+
constructor() {
|
|
748
|
+
__publicField(this, "target");
|
|
749
|
+
__publicField(this, "message");
|
|
750
|
+
__publicField(this, "loadingTemplateRef");
|
|
751
|
+
__publicField(this, "backdrop", true);
|
|
752
|
+
__publicField(this, "positionType", "relative");
|
|
753
|
+
__publicField(this, "view", new View());
|
|
754
|
+
__publicField(this, "zIndex");
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
var loading = "";
|
|
758
|
+
var Loading = defineComponent({
|
|
759
|
+
name: "DLoading",
|
|
760
|
+
inheritAttrs: false,
|
|
761
|
+
props: componentProps,
|
|
762
|
+
setup(props) {
|
|
763
|
+
const style = {
|
|
764
|
+
top: props.view.top,
|
|
765
|
+
left: props.view.left,
|
|
766
|
+
zIndex: props.zIndex
|
|
767
|
+
};
|
|
768
|
+
if (!props.message) {
|
|
769
|
+
style.background = "none";
|
|
770
|
+
}
|
|
771
|
+
const isShow = ref(false);
|
|
772
|
+
const open = () => {
|
|
773
|
+
isShow.value = true;
|
|
774
|
+
};
|
|
775
|
+
const close = () => {
|
|
776
|
+
isShow.value = false;
|
|
777
|
+
};
|
|
778
|
+
return {
|
|
779
|
+
style,
|
|
780
|
+
isShow,
|
|
781
|
+
open,
|
|
782
|
+
close
|
|
783
|
+
};
|
|
784
|
+
},
|
|
785
|
+
render() {
|
|
786
|
+
var _a;
|
|
787
|
+
const {
|
|
788
|
+
isShow,
|
|
789
|
+
isFull,
|
|
790
|
+
backdrop,
|
|
791
|
+
style,
|
|
792
|
+
message,
|
|
793
|
+
$slots
|
|
794
|
+
} = this;
|
|
795
|
+
return isShow && createVNode("div", {
|
|
796
|
+
"class": ["devui-loading-contanier", isFull ? "devui-loading--full" : ""]
|
|
797
|
+
}, [((_a = $slots.default) == null ? void 0 : _a.call($slots)) || createVNode("div", {
|
|
798
|
+
"class": "devui-loading-wrapper"
|
|
799
|
+
}, [backdrop ? createVNode("div", {
|
|
800
|
+
"class": "devui-loading-mask"
|
|
801
|
+
}, null) : null, createVNode("div", {
|
|
802
|
+
"style": style,
|
|
803
|
+
"class": "devui-loading-area"
|
|
804
|
+
}, [createVNode("div", {
|
|
805
|
+
"class": "devui-busy-default-spinner"
|
|
806
|
+
}, [createVNode("div", {
|
|
807
|
+
"class": "devui-loading-bar1"
|
|
808
|
+
}, null), createVNode("div", {
|
|
809
|
+
"class": "devui-loading-bar2"
|
|
810
|
+
}, null), createVNode("div", {
|
|
811
|
+
"class": "devui-loading-bar3"
|
|
812
|
+
}, null), createVNode("div", {
|
|
813
|
+
"class": "devui-loading-bar4"
|
|
814
|
+
}, null)]), message ? createVNode("span", {
|
|
815
|
+
"class": "devui-loading-text"
|
|
816
|
+
}, [message]) : null])])]);
|
|
817
|
+
}
|
|
818
|
+
});
|
|
819
|
+
const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
|
|
820
|
+
function createComponent(Component, props, children = null) {
|
|
821
|
+
const vnode = h(Component, __spreadValues({}, props), children);
|
|
822
|
+
const container = document.createElement("div");
|
|
823
|
+
vnode[COMPONENT_CONTAINER_SYMBOL] = container;
|
|
824
|
+
render(vnode, container);
|
|
825
|
+
return vnode.component;
|
|
826
|
+
}
|
|
827
|
+
function unmountComponent(ComponnetInstance) {
|
|
828
|
+
render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
|
|
829
|
+
}
|
|
830
|
+
const loadingConstructor = defineComponent(Loading);
|
|
831
|
+
const cacheInstance = new WeakSet();
|
|
832
|
+
const isEmpty = (val) => {
|
|
833
|
+
if (!val)
|
|
834
|
+
return true;
|
|
835
|
+
if (Array.isArray(val))
|
|
836
|
+
return val.length === 0;
|
|
837
|
+
if (val instanceof Set || val instanceof Map)
|
|
838
|
+
return val.size === 0;
|
|
839
|
+
if (val instanceof Promise)
|
|
840
|
+
return false;
|
|
841
|
+
if (typeof val === "object") {
|
|
842
|
+
try {
|
|
843
|
+
return Object.keys(val).length === 0;
|
|
844
|
+
} catch (e) {
|
|
845
|
+
return false;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
return false;
|
|
849
|
+
};
|
|
850
|
+
const getType = (vari) => {
|
|
851
|
+
return Object.prototype.toString.call(vari).slice(8, -1).toLowerCase();
|
|
852
|
+
};
|
|
853
|
+
const isPromise = (value) => {
|
|
854
|
+
const type = getType(value);
|
|
855
|
+
switch (type) {
|
|
856
|
+
case "promise":
|
|
857
|
+
return [value];
|
|
858
|
+
case "array":
|
|
859
|
+
if (value.some((val) => getType(val) !== "promise")) {
|
|
860
|
+
console.error(new TypeError("Binding values should all be of type Promise"));
|
|
861
|
+
return "error";
|
|
862
|
+
}
|
|
863
|
+
return value;
|
|
864
|
+
default:
|
|
865
|
+
return false;
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
const unmount = (el) => {
|
|
869
|
+
cacheInstance.delete(el);
|
|
870
|
+
el.instance.proxy.close();
|
|
871
|
+
unmountComponent(el.instance);
|
|
872
|
+
};
|
|
873
|
+
const toggleLoading = (el, binding) => {
|
|
874
|
+
if (binding.value) {
|
|
875
|
+
const vals = isPromise(binding.value);
|
|
876
|
+
if (vals === "error")
|
|
877
|
+
return;
|
|
878
|
+
el.instance.proxy.open();
|
|
879
|
+
el.appendChild(el.mask);
|
|
880
|
+
cacheInstance.add(el);
|
|
881
|
+
if (vals) {
|
|
882
|
+
Promise.all(vals).catch((err) => {
|
|
883
|
+
console.error(new Error("Promise handling errors"), err);
|
|
884
|
+
}).finally(() => {
|
|
885
|
+
unmount(el);
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
} else {
|
|
889
|
+
unmount(el);
|
|
890
|
+
}
|
|
891
|
+
};
|
|
892
|
+
const removeAttribute = (el) => {
|
|
893
|
+
el.removeAttribute("zindex");
|
|
894
|
+
el.removeAttribute("positiontype");
|
|
895
|
+
el.removeAttribute("backdrop");
|
|
896
|
+
el.removeAttribute("message");
|
|
897
|
+
el.removeAttribute("view");
|
|
898
|
+
el.removeAttribute("loadingtemplateref");
|
|
899
|
+
};
|
|
900
|
+
const handleProps = (el, vprops) => {
|
|
901
|
+
const props = __spreadValues(__spreadValues({}, new LoadingProps()), vprops);
|
|
902
|
+
const loadingTemplateRef = props.loadingTemplateRef;
|
|
903
|
+
const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
|
|
904
|
+
el.style.position = props.positionType;
|
|
905
|
+
el.options = props;
|
|
906
|
+
el.instance = loadingInstance;
|
|
907
|
+
el.mask = loadingInstance.proxy.$el;
|
|
908
|
+
};
|
|
909
|
+
const loadingDirective = {
|
|
910
|
+
mounted: function(el, binding, vnode) {
|
|
911
|
+
handleProps(el, vnode.props);
|
|
912
|
+
removeAttribute(el);
|
|
913
|
+
!isEmpty(binding.value) && toggleLoading(el, binding);
|
|
914
|
+
},
|
|
915
|
+
updated: function(el, binding, vnode) {
|
|
916
|
+
if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el))
|
|
917
|
+
return;
|
|
918
|
+
!cacheInstance.has(el) && handleProps(el, vnode.props);
|
|
919
|
+
removeAttribute(el);
|
|
920
|
+
toggleLoading(el, binding);
|
|
921
|
+
}
|
|
922
|
+
};
|
|
709
923
|
const buttonProps = {
|
|
710
924
|
type: {
|
|
711
925
|
type: String,
|
|
712
926
|
default: "button"
|
|
713
927
|
},
|
|
714
|
-
|
|
928
|
+
variant: {
|
|
715
929
|
type: String,
|
|
716
930
|
default: "primary"
|
|
717
931
|
},
|
|
@@ -753,6 +967,9 @@ const buttonProps = {
|
|
|
753
967
|
var button = "";
|
|
754
968
|
var Button = defineComponent({
|
|
755
969
|
name: "DButton",
|
|
970
|
+
directives: {
|
|
971
|
+
devLoading: loadingDirective
|
|
972
|
+
},
|
|
756
973
|
props: buttonProps,
|
|
757
974
|
setup(props, ctx) {
|
|
758
975
|
const buttonContent = ref(null);
|
|
@@ -766,15 +983,15 @@ var Button = defineComponent({
|
|
|
766
983
|
const hasContent = computed(() => ctx.slots.default);
|
|
767
984
|
const btnClass = computed(() => {
|
|
768
985
|
const {
|
|
769
|
-
|
|
986
|
+
variant,
|
|
770
987
|
size,
|
|
771
988
|
position,
|
|
772
989
|
bordered,
|
|
773
990
|
icon
|
|
774
991
|
} = props;
|
|
775
|
-
const origin = `devui-btn devui-btn-${
|
|
992
|
+
const origin = `devui-btn devui-btn-${variant} devui-btn-${size} devui-btn-${position}`;
|
|
776
993
|
const borderedClass = bordered ? "bordered" : "";
|
|
777
|
-
const btnIcon = !!icon && !hasContent.value &&
|
|
994
|
+
const btnIcon = !!icon && !hasContent.value && variant !== "primary" ? "d-btn-icon" : "";
|
|
778
995
|
const btnIconWrap = !!icon ? "d-btn-icon-wrap" : "";
|
|
779
996
|
return `${origin} ${borderedClass} ${btnIcon} ${btnIconWrap}`;
|
|
780
997
|
});
|
|
@@ -800,7 +1017,7 @@ var Button = defineComponent({
|
|
|
800
1017
|
} = props;
|
|
801
1018
|
return createVNode("div", mergeProps({
|
|
802
1019
|
"class": "devui-btn-host"
|
|
803
|
-
}, ctx.attrs), [createVNode("button", {
|
|
1020
|
+
}, ctx.attrs), [withDirectives(createVNode("button", {
|
|
804
1021
|
"class": btnClass.value,
|
|
805
1022
|
"type": type,
|
|
806
1023
|
"disabled": disabled,
|
|
@@ -809,16 +1026,18 @@ var Button = defineComponent({
|
|
|
809
1026
|
},
|
|
810
1027
|
"onClick": onClick
|
|
811
1028
|
}, [!!icon ? createVNode(Icon, {
|
|
812
|
-
"name":
|
|
1029
|
+
"name": icon,
|
|
813
1030
|
"class": iconClass.value
|
|
814
1031
|
}, null) : null, createVNode("span", {
|
|
815
1032
|
"class": "button-content",
|
|
816
1033
|
"ref": buttonContent
|
|
817
|
-
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])])]);
|
|
1034
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])]), [[resolveDirective("devLoading"), showLoading]])]);
|
|
818
1035
|
};
|
|
819
1036
|
}
|
|
820
1037
|
});
|
|
1038
|
+
defineComponent(Loading);
|
|
821
1039
|
Button.install = function(app) {
|
|
1040
|
+
app.directive("dLoading", loadingDirective);
|
|
822
1041
|
app.component(Button.name, Button);
|
|
823
1042
|
};
|
|
824
1043
|
function _isSlot(s) {
|
|
@@ -872,7 +1091,7 @@ var Dialog = defineComponent({
|
|
|
872
1091
|
const buttonsRef = computed(() => {
|
|
873
1092
|
return props.buttons.map((buttonProps2, index2) => {
|
|
874
1093
|
const {
|
|
875
|
-
|
|
1094
|
+
variant,
|
|
876
1095
|
disabled,
|
|
877
1096
|
handler,
|
|
878
1097
|
text
|
|
@@ -883,7 +1102,7 @@ var Dialog = defineComponent({
|
|
|
883
1102
|
display: "inline-block",
|
|
884
1103
|
margin: "0 5px"
|
|
885
1104
|
},
|
|
886
|
-
"
|
|
1105
|
+
"variant": variant,
|
|
887
1106
|
"disabled": disabled,
|
|
888
1107
|
"onClick": handler
|
|
889
1108
|
}, _isSlot(text) ? text : {
|
|
@@ -931,7 +1150,7 @@ var Dialog = defineComponent({
|
|
|
931
1150
|
}, null) : null, createVNode("span", null, [props.title]), createVNode(Button, {
|
|
932
1151
|
"class": "btn-close",
|
|
933
1152
|
"icon": "close",
|
|
934
|
-
"
|
|
1153
|
+
"variant": "text-dark",
|
|
935
1154
|
"onClick": closeModal
|
|
936
1155
|
}, null)]), createVNode("div", {
|
|
937
1156
|
"class": "devui-modal-body"
|
|
@@ -990,7 +1209,7 @@ Modal.install = function(app) {
|
|
|
990
1209
|
var index = {
|
|
991
1210
|
title: "Modal \u5F39\u7A97",
|
|
992
1211
|
category: "\u53CD\u9988",
|
|
993
|
-
status: "
|
|
1212
|
+
status: "100%",
|
|
994
1213
|
install(app) {
|
|
995
1214
|
app.use(Modal);
|
|
996
1215
|
if (!inBrowser) {
|