vue-devui 1.0.0-beta.18 → 1.0.0-beta.20220808
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 +94 -118
- 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 +8395 -463
- package/auto-complete/index.umd.js +40 -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 +45 -20
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5751 -156
- 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 +8110 -278
- package/checkbox/index.umd.js +38 -1
- package/checkbox/style.css +1 -1
- package/{accordion → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +195 -0
- package/collapse/index.umd.js +1 -0
- package/{back-top → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +60 -19
- package/countdown/index.umd.js +1 -1
- package/{anchor → date-picker-pro}/index.d.ts +0 -0
- package/date-picker-pro/index.es.js +12035 -0
- package/date-picker-pro/index.umd.js +38 -0
- package/date-picker-pro/package.json +7 -0
- package/date-picker-pro/style.css +1 -0
- package/drawer/index.es.js +191 -5756
- package/drawer/index.umd.js +1 -27
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +616 -415
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +779 -211
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +2405 -2125
- package/form/index.umd.js +28 -17
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +137 -134
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.es.js +105 -103
- package/grid/index.umd.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +199 -56
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +67 -54
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8268 -144
- package/input/index.umd.js +38 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +260 -192
- 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 +86 -70
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/{back-top → mention}/index.d.ts +0 -0
- package/{color-picker → mention}/index.es.js +3036 -2898
- package/mention/index.umd.js +47 -0
- package/{anchor → mention}/package.json +1 -1
- package/mention/style.css +1 -0
- package/{breadcrumb → menu}/index.d.ts +0 -0
- package/menu/index.es.js +891 -0
- package/menu/index.umd.js +1 -0
- package/{toast → menu}/package.json +1 -1
- package/menu/style.css +1 -0
- package/{carousel → message}/index.d.ts +0 -0
- package/message/index.es.js +533 -0
- package/message/index.umd.js +1 -0
- package/{comment → message}/package.json +1 -1
- package/message/style.css +1 -0
- package/modal/index.es.js +602 -1061
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/{cascader → notification}/index.d.ts +0 -0
- package/notification/index.es.js +528 -0
- package/notification/index.umd.js +1 -0
- package/{accordion → notification}/package.json +1 -1
- package/notification/style.css +1 -0
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.js +3 -0
- package/nuxt/components/DropdownMenu.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/IFileOptions.js +3 -0
- package/nuxt/components/IUploadOptions.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/Mention.js +3 -0
- package/nuxt/components/Menu.js +3 -0
- package/nuxt/components/MenuItem.js +3 -0
- package/nuxt/components/Message.js +3 -0
- package/nuxt/components/Notification.js +3 -0
- package/nuxt/components/NotificationService.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/OptionGroup.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/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/SubMenu.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/UploadStatus.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/animationInjectionKey.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/badgeProps.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.js +3 -0
- package/nuxt/components/dropdownMenuProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/fixedOverlayProps.js +3 -0
- package/nuxt/components/flexibleOverlayProps.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/mentionProps.js +3 -0
- package/nuxt/components/messageProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/notificationProps.js +3 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/popoverProps.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/roundInjectionKey.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/skeletonItemProps.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tableProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/nuxt/components/tooltipProps.js +3 -0
- package/nuxt/components/treeNodeProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/nuxt/components/uploadProps.js +3 -0
- package/overlay/index.es.js +239 -314
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +44 -87
- package/pagination/index.es.js +331 -153
- 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 +6034 -215
- package/popover/index.umd.js +27 -1
- 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 +8013 -180
- package/radio/index.umd.js +38 -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 +186 -57
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/ripple/index.es.js +52 -60
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +3885 -1152
- package/search/index.umd.js +29 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9235 -516
- package/select/index.umd.js +38 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +113 -265
- 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 +6219 -232
- package/splitter/index.umd.js +27 -1
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +41 -55
- 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/{color-picker → steps}/index.d.ts +0 -0
- package/steps/index.es.js +386 -0
- package/steps/index.umd.js +1 -0
- package/{gantt → steps}/package.json +1 -1
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.es.js +7818 -64
- package/switch/index.umd.js +38 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +11109 -1451
- package/table/index.umd.js +38 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +356 -144
- 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 +7940 -83
- package/textarea/index.umd.js +46 -1
- package/textarea/style.css +1 -1
- package/time-picker/index.es.js +8953 -632
- package/time-picker/index.umd.js +38 -1
- package/time-picker/style.css +1 -1
- package/{comment → time-select}/index.d.ts +0 -0
- package/time-select/index.es.js +9606 -0
- package/time-select/index.umd.js +38 -0
- package/{breadcrumb → time-select}/package.json +1 -1
- package/time-select/style.css +1 -0
- package/{date-picker → timeline}/index.d.ts +0 -0
- package/timeline/index.es.js +427 -0
- package/timeline/index.umd.js +1 -0
- package/{carousel → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/tooltip/index.es.js +5871 -96
- package/tooltip/index.umd.js +27 -1
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +7601 -2508
- package/tree/index.umd.js +29 -18
- package/tree/style.css +1 -1
- package/upload/index.es.js +849 -6143
- package/upload/index.umd.js +1 -27
- package/upload/style.css +1 -1
- package/vue-devui.es.js +20537 -19051
- package/vue-devui.umd.js +41 -19
- package/accordion/index.es.js +0 -508
- package/accordion/index.umd.js +0 -1
- 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.es.js +0 -127
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/style.css +0 -1
- package/carousel/index.es.js +0 -329
- package/carousel/index.umd.js +0 -1
- package/carousel/style.css +0 -1
- 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.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/comment/index.es.js +0 -86
- package/comment/index.umd.js +0 -1
- package/comment/style.css +0 -1
- 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/gantt/index.d.ts +0 -7
- package/gantt/index.es.js +0 -523
- package/gantt/index.umd.js +0 -1
- package/gantt/style.css +0 -1
- package/input-icon/index.d.ts +0 -7
- package/input-icon/index.es.js +0 -331
- package/input-icon/index.umd.js +0 -1
- package/input-icon/package.json +0 -7
- package/input-icon/style.css +0 -1
- package/nav-sprite/index.d.ts +0 -7
- package/nav-sprite/index.es.js +0 -68
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/nuxt/components/Accordion.js +0 -3
- package/nuxt/components/Anchor.js +0 -3
- package/nuxt/components/BackTop.js +0 -3
- package/nuxt/components/Breadcrumb.js +0 -3
- package/nuxt/components/Carousel.js +0 -3
- package/nuxt/components/CarouselItem.js +0 -3
- package/nuxt/components/Cascader.js +0 -3
- package/nuxt/components/ColorPicker.js +0 -3
- package/nuxt/components/Comment.js +0 -3
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/NavSprite.js +0 -2
- package/nuxt/components/QuadrantDiagram.js +0 -3
- package/nuxt/components/ReadTip.js +0 -3
- package/nuxt/components/StepsGuide.js +0 -3
- package/nuxt/components/StickSlider.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/TagInput.js +0 -3
- package/nuxt/components/TimeAxis.js +0 -3
- package/nuxt/components/TimeAxisItem.js +0 -3
- package/nuxt/components/Toast.js +0 -3
- package/nuxt/components/ToastService.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/TreeSelect.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/toast/index.d.ts +0 -7
- package/toast/index.es.js +0 -5918
- package/toast/index.umd.js +0 -27
- package/toast/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7340
- 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/modal/index.es.js
CHANGED
|
@@ -1,1191 +1,733 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
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
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
var __publicField = (obj, key, value) => {
|
|
33
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
|
-
return value;
|
|
35
|
-
};
|
|
36
|
-
import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, withDirectives, vShow, ref, reactive, toRef, isRef, h, render, readonly, toRefs, resolveDirective } from "vue";
|
|
1
|
+
import { defineComponent, toRefs, computed, createVNode, resolveDynamicComponent, mergeProps, watch, onUnmounted, Transition, ref, nextTick, unref, onMounted, Teleport, h, render } from "vue";
|
|
2
|
+
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
37
3
|
const modalProps = {
|
|
38
|
-
|
|
39
|
-
type:
|
|
40
|
-
default:
|
|
41
|
-
},
|
|
42
|
-
maxHeight: {
|
|
43
|
-
type: String
|
|
44
|
-
},
|
|
45
|
-
zIndex: {
|
|
46
|
-
type: Number,
|
|
47
|
-
default: 1050
|
|
48
|
-
},
|
|
49
|
-
backdropZIndex: {
|
|
50
|
-
type: Number,
|
|
51
|
-
default: 1049
|
|
52
|
-
},
|
|
53
|
-
placement: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: "center"
|
|
56
|
-
},
|
|
57
|
-
offsetX: {
|
|
58
|
-
type: String,
|
|
59
|
-
default: "0px"
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: Boolean,
|
|
6
|
+
default: false
|
|
60
7
|
},
|
|
61
|
-
|
|
8
|
+
title: {
|
|
62
9
|
type: String,
|
|
63
|
-
default: "
|
|
10
|
+
default: ""
|
|
64
11
|
},
|
|
65
|
-
|
|
12
|
+
lockScroll: {
|
|
66
13
|
type: Boolean,
|
|
67
14
|
default: true
|
|
68
15
|
},
|
|
69
|
-
|
|
16
|
+
closeOnClickOverlay: {
|
|
70
17
|
type: Boolean,
|
|
71
18
|
default: true
|
|
72
19
|
},
|
|
73
|
-
|
|
20
|
+
beforeClose: {
|
|
21
|
+
type: Function
|
|
22
|
+
},
|
|
23
|
+
escapable: {
|
|
74
24
|
type: Boolean,
|
|
75
25
|
default: true
|
|
76
26
|
},
|
|
77
|
-
|
|
27
|
+
showClose: {
|
|
78
28
|
type: Boolean,
|
|
79
29
|
default: true
|
|
80
30
|
},
|
|
81
|
-
|
|
82
|
-
type:
|
|
83
|
-
|
|
84
|
-
beforeHidden: {
|
|
85
|
-
type: [Object, Function]
|
|
86
|
-
},
|
|
87
|
-
modelValue: {
|
|
88
|
-
type: Boolean
|
|
31
|
+
showOverlay: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: true
|
|
89
34
|
},
|
|
90
|
-
|
|
91
|
-
type:
|
|
35
|
+
appendToBody: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: true
|
|
92
38
|
}
|
|
93
39
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return () => {
|
|
101
|
-
let _slot;
|
|
102
|
-
return createVNode(Teleport, {
|
|
103
|
-
"to": "#d-overlay-anchor"
|
|
104
|
-
}, {
|
|
105
|
-
default: () => [createVNode(Transition, {
|
|
106
|
-
"name": "devui-overlay-fade"
|
|
107
|
-
}, _isSlot$1(_slot = renderSlot(ctx.slots, "default")) ? _slot : {
|
|
108
|
-
default: () => [_slot]
|
|
109
|
-
})]
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
const overlayProps = {
|
|
115
|
-
visible: {
|
|
116
|
-
type: Boolean
|
|
40
|
+
const DEFAULT_PREFIX = "icon";
|
|
41
|
+
const iconProps = {
|
|
42
|
+
name: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: "",
|
|
45
|
+
required: true
|
|
117
46
|
},
|
|
118
|
-
|
|
119
|
-
type:
|
|
120
|
-
default:
|
|
47
|
+
size: {
|
|
48
|
+
type: [Number, String],
|
|
49
|
+
default: "inherit"
|
|
121
50
|
},
|
|
122
|
-
|
|
51
|
+
color: {
|
|
123
52
|
type: String,
|
|
124
|
-
default: ""
|
|
53
|
+
default: "inherit"
|
|
125
54
|
},
|
|
126
|
-
|
|
127
|
-
type:
|
|
55
|
+
component: {
|
|
56
|
+
type: Object,
|
|
57
|
+
default: null
|
|
128
58
|
},
|
|
129
|
-
|
|
130
|
-
type:
|
|
59
|
+
classPrefix: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: DEFAULT_PREFIX
|
|
131
62
|
},
|
|
132
|
-
|
|
63
|
+
operable: {
|
|
133
64
|
type: Boolean,
|
|
134
|
-
default:
|
|
65
|
+
default: false
|
|
135
66
|
},
|
|
136
|
-
|
|
67
|
+
disabled: {
|
|
137
68
|
type: Boolean,
|
|
138
|
-
default:
|
|
69
|
+
default: false
|
|
70
|
+
},
|
|
71
|
+
rotate: {
|
|
72
|
+
type: [Number, String]
|
|
139
73
|
}
|
|
140
74
|
};
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
const flexibleOverlayProps = __spreadValues({
|
|
149
|
-
origin: {
|
|
150
|
-
type: Object,
|
|
151
|
-
require: true
|
|
75
|
+
const svgIconProps = {
|
|
76
|
+
name: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: "",
|
|
79
|
+
required: true
|
|
152
80
|
},
|
|
153
|
-
|
|
154
|
-
type:
|
|
155
|
-
default:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
})
|
|
161
|
-
}
|
|
162
|
-
}, overlayProps);
|
|
163
|
-
function useOverlayLogic(props, ctx) {
|
|
164
|
-
const backgroundClass = computed(() => {
|
|
165
|
-
return [
|
|
166
|
-
"devui-overlay-background",
|
|
167
|
-
props.backgroundClass,
|
|
168
|
-
!props.hasBackdrop ? "devui-overlay-background__disabled" : "devui-overlay-background__color"
|
|
169
|
-
];
|
|
170
|
-
});
|
|
171
|
-
const overlayClass = computed(() => {
|
|
172
|
-
return "devui-overlay";
|
|
173
|
-
});
|
|
174
|
-
const handleBackdropClick = (event) => {
|
|
175
|
-
var _a;
|
|
176
|
-
event.preventDefault();
|
|
177
|
-
(_a = props.onBackdropClick) == null ? void 0 : _a.call(props);
|
|
178
|
-
if (props.backdropClose) {
|
|
179
|
-
ctx.emit("update:visible", false);
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
const handleOverlayBubbleCancel = (event) => event.cancelBubble = true;
|
|
183
|
-
onMounted(() => {
|
|
184
|
-
const body = document.body;
|
|
185
|
-
const originOverflow = body.style.overflow;
|
|
186
|
-
const originPosition = body.style.position;
|
|
187
|
-
watch([() => props.visible, () => props.backgroundBlock], ([visible, backgroundBlock]) => {
|
|
188
|
-
if (backgroundBlock) {
|
|
189
|
-
const top = body.getBoundingClientRect().y;
|
|
190
|
-
if (visible) {
|
|
191
|
-
body.style.overflowY = "scroll";
|
|
192
|
-
body.style.position = visible ? "fixed" : "";
|
|
193
|
-
body.style.top = `${top}px`;
|
|
194
|
-
} else {
|
|
195
|
-
body.style.overflowY = originOverflow;
|
|
196
|
-
body.style.position = originPosition;
|
|
197
|
-
body.style.top = "";
|
|
198
|
-
window.scrollTo(0, -top);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
onUnmounted(() => {
|
|
203
|
-
document.body.style.overflow = originOverflow;
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
return {
|
|
207
|
-
backgroundClass,
|
|
208
|
-
overlayClass,
|
|
209
|
-
handleBackdropClick,
|
|
210
|
-
handleOverlayBubbleCancel
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
const FixedOverlay = defineComponent({
|
|
214
|
-
name: "DFixedOverlay",
|
|
215
|
-
props: fixedOverlayProps,
|
|
216
|
-
emits: overlayEmits,
|
|
217
|
-
setup(props, ctx) {
|
|
218
|
-
const {
|
|
219
|
-
backgroundClass,
|
|
220
|
-
overlayClass,
|
|
221
|
-
handleBackdropClick,
|
|
222
|
-
handleOverlayBubbleCancel
|
|
223
|
-
} = useOverlayLogic(props, ctx);
|
|
224
|
-
return () => createVNode(CommonOverlay, null, {
|
|
225
|
-
default: () => [withDirectives(createVNode("div", {
|
|
226
|
-
"class": backgroundClass.value,
|
|
227
|
-
"style": props.backgroundStyle,
|
|
228
|
-
"onClick": handleBackdropClick
|
|
229
|
-
}, [createVNode("div", {
|
|
230
|
-
"class": overlayClass.value,
|
|
231
|
-
"style": props.overlayStyle,
|
|
232
|
-
"onClick": handleOverlayBubbleCancel
|
|
233
|
-
}, [renderSlot(ctx.slots, "default")])]), [[vShow, props.visible]])]
|
|
234
|
-
});
|
|
81
|
+
color: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: "inherit"
|
|
84
|
+
},
|
|
85
|
+
size: {
|
|
86
|
+
type: [Number, String],
|
|
87
|
+
default: "inherit"
|
|
235
88
|
}
|
|
236
|
-
}
|
|
237
|
-
function
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
if (element instanceof Element) {
|
|
242
|
-
return element;
|
|
89
|
+
};
|
|
90
|
+
function createBem(namespace, element, modifier) {
|
|
91
|
+
let cls = namespace;
|
|
92
|
+
if (element) {
|
|
93
|
+
cls += `__${element}`;
|
|
243
94
|
}
|
|
244
|
-
if (
|
|
245
|
-
|
|
95
|
+
if (modifier) {
|
|
96
|
+
cls += `--${modifier}`;
|
|
246
97
|
}
|
|
247
|
-
return
|
|
98
|
+
return cls;
|
|
248
99
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
if (!overlay2 || !origin) {
|
|
268
|
-
return;
|
|
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))];
|
|
287
|
-
onInvalidate(() => {
|
|
288
|
-
unsubscriptions.forEach((fn) => fn());
|
|
289
|
-
});
|
|
290
|
-
});
|
|
291
|
-
});
|
|
100
|
+
function useNamespace(block, needDot = false) {
|
|
101
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
102
|
+
const b = () => createBem(namespace);
|
|
103
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
104
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
105
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
106
|
+
return {
|
|
107
|
+
b,
|
|
108
|
+
e,
|
|
109
|
+
m,
|
|
110
|
+
em
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
var icon = "";
|
|
114
|
+
var svgIcon = defineComponent({
|
|
115
|
+
name: "DSvgIcon",
|
|
116
|
+
props: svgIconProps,
|
|
117
|
+
setup(props) {
|
|
292
118
|
const {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
"class": backgroundClass.value,
|
|
302
|
-
"onClick": handleBackdropClick
|
|
303
|
-
}, [createVNode("div", {
|
|
304
|
-
"ref": overlayRef,
|
|
305
|
-
"class": overlayClass.value,
|
|
306
|
-
"style": positionedStyle,
|
|
307
|
-
"onClick": handleOverlayBubbleCancel
|
|
308
|
-
}, [renderSlot(ctx.slots, "default")])]), [[vShow, props.visible]])]
|
|
119
|
+
name,
|
|
120
|
+
color,
|
|
121
|
+
size
|
|
122
|
+
} = toRefs(props);
|
|
123
|
+
const ns = useNamespace("svg-icon");
|
|
124
|
+
const iconName = computed(() => `#icon-${name.value}`);
|
|
125
|
+
const iconSize = computed(() => {
|
|
126
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
309
127
|
});
|
|
128
|
+
const styles = {
|
|
129
|
+
width: iconSize.value,
|
|
130
|
+
height: iconSize.value
|
|
131
|
+
};
|
|
132
|
+
return () => {
|
|
133
|
+
return createVNode("svg", {
|
|
134
|
+
"class": ns.b(),
|
|
135
|
+
"style": styles
|
|
136
|
+
}, [createVNode("use", {
|
|
137
|
+
"xlink:href": iconName.value,
|
|
138
|
+
"fill": color.value
|
|
139
|
+
}, null)]);
|
|
140
|
+
};
|
|
310
141
|
}
|
|
311
142
|
});
|
|
312
|
-
function
|
|
313
|
-
|
|
314
|
-
return origin;
|
|
315
|
-
}
|
|
316
|
-
if (isRef(origin)) {
|
|
317
|
-
return getElement(origin.value);
|
|
318
|
-
}
|
|
319
|
-
if (isComponent(origin)) {
|
|
320
|
-
return getElement(origin);
|
|
321
|
-
}
|
|
322
|
-
return origin;
|
|
323
|
-
}
|
|
324
|
-
function calculatePosition(position, rect, origin) {
|
|
325
|
-
const originRect = getOriginRect(origin);
|
|
326
|
-
const originPoint = getOriginRelativePoint(originRect, position);
|
|
327
|
-
return getOverlayPoint(originPoint, rect, position);
|
|
143
|
+
function isUrl(value) {
|
|
144
|
+
return /^((http|https):)?\/\//.test(value);
|
|
328
145
|
}
|
|
329
|
-
function
|
|
330
|
-
if (origin instanceof Element) {
|
|
331
|
-
return origin.getBoundingClientRect();
|
|
332
|
-
}
|
|
333
|
-
const width = origin.width || 0;
|
|
334
|
-
const height = origin.height || 0;
|
|
335
|
-
return {
|
|
336
|
-
top: origin.y,
|
|
337
|
-
bottom: origin.y + height,
|
|
338
|
-
left: origin.x,
|
|
339
|
-
right: origin.x + width,
|
|
340
|
-
height,
|
|
341
|
-
width
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
function getOverlayPoint(originPoint, rect, position) {
|
|
345
|
-
let x;
|
|
146
|
+
function useIconDom(props, ctx) {
|
|
346
147
|
const {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
148
|
+
component,
|
|
149
|
+
name,
|
|
150
|
+
size,
|
|
151
|
+
color,
|
|
152
|
+
classPrefix,
|
|
153
|
+
rotate
|
|
154
|
+
} = toRefs(props);
|
|
155
|
+
const ns = useNamespace("icon");
|
|
156
|
+
const iconSize = computed(() => {
|
|
157
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
158
|
+
});
|
|
159
|
+
const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
|
|
160
|
+
const imgIconDom = () => {
|
|
161
|
+
return createVNode("img", mergeProps({
|
|
162
|
+
"src": name.value,
|
|
163
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
164
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
165
|
+
"style": {
|
|
166
|
+
width: iconSize.value || "",
|
|
167
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`,
|
|
168
|
+
verticalAlign: "middle"
|
|
169
|
+
}
|
|
170
|
+
}, ctx.attrs), null);
|
|
364
171
|
};
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
let y;
|
|
376
|
-
if (position.originY == "center") {
|
|
377
|
-
y = originRect.top + originRect.height / 2;
|
|
378
|
-
} else {
|
|
379
|
-
y = position.originY == "top" ? originRect.top : originRect.bottom;
|
|
380
|
-
}
|
|
381
|
-
return {
|
|
382
|
-
x,
|
|
383
|
-
y
|
|
172
|
+
const svgIconDom = () => {
|
|
173
|
+
return createVNode(IconComponent, mergeProps({
|
|
174
|
+
"name": name.value,
|
|
175
|
+
"color": color.value,
|
|
176
|
+
"size": iconSize.value,
|
|
177
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
178
|
+
"style": {
|
|
179
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
180
|
+
}
|
|
181
|
+
}, ctx.attrs), null);
|
|
384
182
|
};
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
183
|
+
const fontIconDom = () => {
|
|
184
|
+
const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
|
|
185
|
+
return createVNode("i", mergeProps({
|
|
186
|
+
"class": [classPrefix.value, fontIconClass, (rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
187
|
+
"style": {
|
|
188
|
+
fontSize: iconSize.value,
|
|
189
|
+
color: color.value,
|
|
190
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
191
|
+
}
|
|
192
|
+
}, ctx.attrs), null);
|
|
394
193
|
};
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
if (overlay2 instanceof Element) {
|
|
398
|
-
const resizeObserver = new ResizeObserver(callback);
|
|
399
|
-
resizeObserver.observe(overlay2);
|
|
400
|
-
return () => resizeObserver.disconnect();
|
|
401
|
-
}
|
|
402
|
-
return () => {
|
|
194
|
+
const iconDom = () => {
|
|
195
|
+
return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
|
|
403
196
|
};
|
|
404
|
-
|
|
405
|
-
|
|
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 () => {
|
|
197
|
+
return {
|
|
198
|
+
iconDom
|
|
414
199
|
};
|
|
415
200
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
FixedOverlay.install = function(app) {
|
|
421
|
-
app.component(FixedOverlay.name, FixedOverlay);
|
|
422
|
-
};
|
|
423
|
-
var modal = "";
|
|
424
|
-
var Modal = defineComponent({
|
|
425
|
-
name: "DModal",
|
|
426
|
-
props: modalProps,
|
|
427
|
-
emits: ["onUpdate:modelValue"],
|
|
201
|
+
var Icon = defineComponent({
|
|
202
|
+
name: "DIcon",
|
|
203
|
+
props: iconProps,
|
|
204
|
+
emits: ["click"],
|
|
428
205
|
setup(props, ctx) {
|
|
429
|
-
const
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
};
|
|
446
|
-
const result = (_a = typeof beforeHidden === "function" ? beforeHidden() : beforeHidden) != null ? _a : true;
|
|
447
|
-
if (result instanceof Promise) {
|
|
448
|
-
result.then(close);
|
|
449
|
-
} else {
|
|
450
|
-
close(result);
|
|
451
|
-
}
|
|
206
|
+
const {
|
|
207
|
+
disabled,
|
|
208
|
+
operable
|
|
209
|
+
} = toRefs(props);
|
|
210
|
+
const {
|
|
211
|
+
iconDom
|
|
212
|
+
} = useIconDom(props, ctx);
|
|
213
|
+
const ns = useNamespace("icon");
|
|
214
|
+
const wrapClassed = computed(() => ({
|
|
215
|
+
[ns.e("container")]: true,
|
|
216
|
+
[ns.m("disabled")]: disabled.value,
|
|
217
|
+
[ns.m("operable")]: operable.value
|
|
218
|
+
}));
|
|
219
|
+
const onClick = (e) => {
|
|
220
|
+
if (disabled.value) {
|
|
221
|
+
return;
|
|
452
222
|
}
|
|
223
|
+
ctx.emit("click", e);
|
|
224
|
+
};
|
|
225
|
+
return () => {
|
|
226
|
+
var _a, _b, _c, _d;
|
|
227
|
+
return createVNode("div", {
|
|
228
|
+
"class": wrapClassed.value,
|
|
229
|
+
"onClick": onClick
|
|
230
|
+
}, [(_b = (_a = ctx.slots).prefix) == null ? void 0 : _b.call(_a), iconDom(), (_d = (_c = ctx.slots).suffix) == null ? void 0 : _d.call(_c)]);
|
|
453
231
|
};
|
|
454
|
-
ctx.expose({
|
|
455
|
-
onVisibleChange
|
|
456
|
-
});
|
|
457
|
-
return () => createVNode(FixedOverlay, {
|
|
458
|
-
"visible": props.modelValue,
|
|
459
|
-
"onUpdate:visible": onVisibleChange,
|
|
460
|
-
"backgroundClass": "devui-modal-wrapper",
|
|
461
|
-
"backgroundBlock": !props.bodyScrollable,
|
|
462
|
-
"backdropClose": props.backdropCloseable
|
|
463
|
-
}, {
|
|
464
|
-
default: () => [createVNode(Transition, {
|
|
465
|
-
"name": "devui-modal-wipe"
|
|
466
|
-
}, {
|
|
467
|
-
default: () => {
|
|
468
|
-
var _a, _b;
|
|
469
|
-
return [animatedVisible.value ? (_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a) : null];
|
|
470
|
-
}
|
|
471
|
-
})]
|
|
472
|
-
});
|
|
473
232
|
}
|
|
474
233
|
});
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
setTimeout(() => {
|
|
486
|
-
render(null, anchor);
|
|
487
|
-
}, 500);
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
class ModalService extends CommonModalService {
|
|
491
|
-
component() {
|
|
492
|
-
return Modal;
|
|
493
|
-
}
|
|
494
|
-
open(props = {}) {
|
|
495
|
-
const anchor = document.createElement("div");
|
|
496
|
-
this.anchorContainer.appendChild(anchor);
|
|
497
|
-
const _a = props, { content } = _a, resProps = __objRest(_a, ["content"]);
|
|
498
|
-
const needHideOrNot = (value) => {
|
|
499
|
-
if (!value) {
|
|
500
|
-
hide();
|
|
501
|
-
}
|
|
502
|
-
};
|
|
503
|
-
const renderOrigin = (props2, onUpdateModelValue = needHideOrNot) => {
|
|
504
|
-
return this.renderModal(anchor, __spreadProps(__spreadValues({}, props2), {
|
|
505
|
-
modelValue: true,
|
|
506
|
-
"onUpdate:modelValue": onUpdateModelValue
|
|
507
|
-
}), { default: content });
|
|
508
|
-
};
|
|
509
|
-
const hide = () => {
|
|
510
|
-
var _a2, _b;
|
|
511
|
-
const vnode = renderOrigin(resProps, (value) => {
|
|
512
|
-
if (!value) {
|
|
513
|
-
this.renderModal(anchor, __spreadProps(__spreadValues({}, resProps), { modelValue: false }));
|
|
514
|
-
this.renderNull(anchor);
|
|
515
|
-
} else {
|
|
516
|
-
renderOrigin(resProps);
|
|
517
|
-
}
|
|
518
|
-
});
|
|
519
|
-
(_b = (_a2 = vnode.component.exposed).onVisibleChange) == null ? void 0 : _b.call(_a2, false);
|
|
234
|
+
var iconGroup = "";
|
|
235
|
+
defineComponent({
|
|
236
|
+
name: "DIconGroup",
|
|
237
|
+
setup(_, ctx) {
|
|
238
|
+
const ns = useNamespace("icon-group");
|
|
239
|
+
return () => {
|
|
240
|
+
var _a, _b;
|
|
241
|
+
return createVNode("div", {
|
|
242
|
+
"class": ns.b()
|
|
243
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
|
|
520
244
|
};
|
|
521
|
-
this.renderModal(anchor, { modelValue: false });
|
|
522
|
-
renderOrigin(resProps);
|
|
523
|
-
return { hide };
|
|
524
245
|
}
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
width: {
|
|
529
|
-
type: String,
|
|
530
|
-
default: "300px"
|
|
531
|
-
},
|
|
532
|
-
maxHeight: {
|
|
533
|
-
type: String
|
|
534
|
-
},
|
|
535
|
-
zIndex: {
|
|
536
|
-
type: Number,
|
|
537
|
-
default: 1050
|
|
538
|
-
},
|
|
539
|
-
backdropZIndex: {
|
|
540
|
-
type: Number,
|
|
541
|
-
default: 1049
|
|
542
|
-
},
|
|
543
|
-
placement: {
|
|
544
|
-
type: String,
|
|
545
|
-
default: "center"
|
|
546
|
-
},
|
|
547
|
-
offsetX: {
|
|
548
|
-
type: String,
|
|
549
|
-
default: "0px"
|
|
550
|
-
},
|
|
551
|
-
offsetY: {
|
|
552
|
-
type: String,
|
|
553
|
-
default: "0px"
|
|
554
|
-
},
|
|
555
|
-
title: {
|
|
556
|
-
type: String
|
|
557
|
-
},
|
|
558
|
-
showAnimation: {
|
|
559
|
-
type: Boolean,
|
|
560
|
-
default: true
|
|
561
|
-
},
|
|
562
|
-
backdropCloseable: {
|
|
246
|
+
});
|
|
247
|
+
const fixedOverlayProps = {
|
|
248
|
+
modelValue: {
|
|
563
249
|
type: Boolean,
|
|
564
|
-
default:
|
|
250
|
+
default: false
|
|
565
251
|
},
|
|
566
|
-
|
|
252
|
+
lockScroll: {
|
|
567
253
|
type: Boolean,
|
|
568
254
|
default: true
|
|
569
255
|
},
|
|
570
|
-
|
|
256
|
+
closeOnClickOverlay: {
|
|
571
257
|
type: Boolean,
|
|
572
258
|
default: true
|
|
573
|
-
},
|
|
574
|
-
onClose: {
|
|
575
|
-
type: Function
|
|
576
|
-
},
|
|
577
|
-
beforeHidden: {
|
|
578
|
-
type: [Promise, Function]
|
|
579
|
-
},
|
|
580
|
-
buttons: {
|
|
581
|
-
type: Array,
|
|
582
|
-
default: []
|
|
583
|
-
},
|
|
584
|
-
dialogType: {
|
|
585
|
-
type: String,
|
|
586
|
-
default: "standard"
|
|
587
|
-
},
|
|
588
|
-
modelValue: {
|
|
589
|
-
type: Boolean
|
|
590
|
-
},
|
|
591
|
-
"onUpdate:modelValue": {
|
|
592
|
-
type: Function
|
|
593
259
|
}
|
|
594
260
|
};
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
}
|
|
609
|
-
target.style.cursor = "all-scroll";
|
|
610
|
-
let startX = 0;
|
|
611
|
-
let startY = 0;
|
|
612
|
-
let prevMovingX = 0;
|
|
613
|
-
let prevMovingY = 0;
|
|
614
|
-
let containerRect = container.getBoundingClientRect();
|
|
615
|
-
let bodyRect = document.body.getBoundingClientRect();
|
|
616
|
-
let isDown = false;
|
|
617
|
-
const handleMouseDown = (event) => {
|
|
618
|
-
event.preventDefault();
|
|
619
|
-
if (!enabledMoving.value) {
|
|
620
|
-
return;
|
|
621
|
-
}
|
|
622
|
-
startX = event.clientX;
|
|
623
|
-
startY = event.clientY;
|
|
624
|
-
const targetRect = target.getBoundingClientRect();
|
|
625
|
-
if ((target === event.target || target.contains(event.target)) && targetRect.x < startX && targetRect.y < startY && targetRect.width + targetRect.x >= startX && targetRect.height + targetRect.y >= startY) {
|
|
626
|
-
isDown = true;
|
|
627
|
-
prevMovingX = movingX.value;
|
|
628
|
-
prevMovingY = movingY.value;
|
|
629
|
-
bodyRect = document.body.getBoundingClientRect();
|
|
630
|
-
containerRect = container.getBoundingClientRect();
|
|
631
|
-
}
|
|
632
|
-
};
|
|
633
|
-
const handleMouseMove = (event) => {
|
|
634
|
-
event.preventDefault();
|
|
635
|
-
if (!isDown) {
|
|
636
|
-
return;
|
|
637
|
-
}
|
|
638
|
-
const currentX = prevMovingX + event.clientX - startX;
|
|
639
|
-
const currentY = prevMovingY + event.clientY - startY;
|
|
640
|
-
const containerOriginX = containerRect.x - prevMovingX;
|
|
641
|
-
const containerOriginY = containerRect.y - prevMovingY;
|
|
642
|
-
movingX.value = getRangeValueOf(currentX, -containerOriginX, bodyRect.width - containerRect.width - containerOriginX);
|
|
643
|
-
movingY.value = getRangeValueOf(currentY, -containerOriginY, bodyRect.height - containerRect.height - containerOriginY);
|
|
644
|
-
};
|
|
645
|
-
const handleMouseUp = (event) => {
|
|
646
|
-
event.preventDefault();
|
|
647
|
-
if (!isDown) {
|
|
648
|
-
return;
|
|
261
|
+
function lockScroll() {
|
|
262
|
+
if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
|
|
263
|
+
const scrollTop = document.documentElement.scrollTop;
|
|
264
|
+
const style = document.documentElement.getAttribute("style");
|
|
265
|
+
document.documentElement.style.position = "fixed";
|
|
266
|
+
document.documentElement.style.top = `-${scrollTop}px`;
|
|
267
|
+
document.documentElement.style.width = document.documentElement.style.width || "100%";
|
|
268
|
+
document.documentElement.style.overflowY = "scroll";
|
|
269
|
+
return () => {
|
|
270
|
+
if (style) {
|
|
271
|
+
document.documentElement.setAttribute("style", style);
|
|
272
|
+
} else {
|
|
273
|
+
document.documentElement.removeAttribute("style");
|
|
649
274
|
}
|
|
650
|
-
|
|
275
|
+
document.documentElement.scrollTop = scrollTop;
|
|
651
276
|
};
|
|
652
|
-
window.addEventListener("mousedown", handleMouseDown);
|
|
653
|
-
window.addEventListener("mousemove", handleMouseMove);
|
|
654
|
-
window.addEventListener("mouseup", handleMouseUp);
|
|
655
|
-
onInvalidate(() => {
|
|
656
|
-
window.removeEventListener("mousedown", handleMouseDown);
|
|
657
|
-
window.removeEventListener("mousemove", handleMouseMove);
|
|
658
|
-
window.removeEventListener("mouseup", handleMouseUp);
|
|
659
|
-
});
|
|
660
|
-
});
|
|
661
|
-
return {
|
|
662
|
-
movingX: readonly(movingX),
|
|
663
|
-
movingY: readonly(movingY),
|
|
664
|
-
handleRef,
|
|
665
|
-
moveElRef,
|
|
666
|
-
reset
|
|
667
|
-
};
|
|
668
|
-
};
|
|
669
|
-
const getRangeValueOf = (value, min, max) => {
|
|
670
|
-
if (value < min) {
|
|
671
|
-
return min;
|
|
672
277
|
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
type: String,
|
|
683
|
-
required: true
|
|
684
|
-
},
|
|
685
|
-
size: {
|
|
686
|
-
type: String,
|
|
687
|
-
default: "inherit"
|
|
688
|
-
},
|
|
689
|
-
color: {
|
|
690
|
-
type: String,
|
|
691
|
-
default: "inherit"
|
|
692
|
-
},
|
|
693
|
-
classPrefix: {
|
|
694
|
-
type: String,
|
|
695
|
-
default: "icon"
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
function useFixedOverlay(props, ctx) {
|
|
281
|
+
let lockScrollCb;
|
|
282
|
+
const onClick = (event) => {
|
|
283
|
+
event.preventDefault();
|
|
284
|
+
ctx.emit("click", event);
|
|
285
|
+
if (props.closeOnClickOverlay) {
|
|
286
|
+
ctx.emit("update:modelValue", false);
|
|
696
287
|
}
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
}
|
|
701
|
-
|
|
288
|
+
};
|
|
289
|
+
const removeBodyAdditions = () => {
|
|
290
|
+
lockScrollCb == null ? void 0 : lockScrollCb();
|
|
291
|
+
};
|
|
292
|
+
watch(() => props.modelValue, (val) => {
|
|
293
|
+
if (val) {
|
|
294
|
+
props.lockScroll && (lockScrollCb = lockScroll());
|
|
295
|
+
} else {
|
|
296
|
+
removeBodyAdditions();
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
onUnmounted(removeBodyAdditions);
|
|
300
|
+
return { onClick };
|
|
301
|
+
}
|
|
302
|
+
var fixedOverlay = "";
|
|
303
|
+
const FixedOverlay = defineComponent({
|
|
304
|
+
name: "DFixedOverlay",
|
|
305
|
+
inheritAttrs: false,
|
|
306
|
+
props: fixedOverlayProps,
|
|
307
|
+
emits: ["update:modelValue", "click"],
|
|
308
|
+
setup(props, ctx) {
|
|
702
309
|
const {
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
"
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
color
|
|
310
|
+
modelValue
|
|
311
|
+
} = toRefs(props);
|
|
312
|
+
const ns = useNamespace("fixed-overlay");
|
|
313
|
+
const {
|
|
314
|
+
onClick
|
|
315
|
+
} = useFixedOverlay(props, ctx);
|
|
316
|
+
return () => createVNode(Transition, {
|
|
317
|
+
"name": ns.m("fade")
|
|
318
|
+
}, {
|
|
319
|
+
default: () => {
|
|
320
|
+
var _a, _b;
|
|
321
|
+
return [modelValue.value && createVNode("div", mergeProps({
|
|
322
|
+
"class": ns.b()
|
|
323
|
+
}, ctx.attrs, {
|
|
324
|
+
"onClick": onClick
|
|
325
|
+
}), [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])];
|
|
720
326
|
}
|
|
721
|
-
}
|
|
327
|
+
});
|
|
722
328
|
}
|
|
723
329
|
});
|
|
724
|
-
|
|
725
|
-
|
|
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: {
|
|
330
|
+
const flexibleOverlayProps = {
|
|
331
|
+
modelValue: {
|
|
742
332
|
type: Boolean,
|
|
743
333
|
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
334
|
},
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
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 = /* @__PURE__ */ 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);
|
|
335
|
+
origin: {
|
|
336
|
+
type: Object,
|
|
337
|
+
require: true
|
|
914
338
|
},
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
!cacheInstance.has(el) && handleProps(el, vnode.props);
|
|
919
|
-
removeAttribute(el);
|
|
920
|
-
toggleLoading(el, binding);
|
|
921
|
-
}
|
|
922
|
-
};
|
|
923
|
-
const buttonProps = {
|
|
924
|
-
variant: {
|
|
925
|
-
type: String,
|
|
926
|
-
default: "outline"
|
|
339
|
+
position: {
|
|
340
|
+
type: Array,
|
|
341
|
+
default: ["bottom"]
|
|
927
342
|
},
|
|
928
|
-
|
|
929
|
-
type:
|
|
930
|
-
default:
|
|
343
|
+
offset: {
|
|
344
|
+
type: [Number, Object],
|
|
345
|
+
default: 8
|
|
931
346
|
},
|
|
932
|
-
|
|
933
|
-
type:
|
|
347
|
+
shiftOffset: {
|
|
348
|
+
type: Number
|
|
934
349
|
},
|
|
935
|
-
|
|
350
|
+
align: {
|
|
936
351
|
type: String,
|
|
937
|
-
default:
|
|
352
|
+
default: null
|
|
938
353
|
},
|
|
939
|
-
|
|
354
|
+
showArrow: {
|
|
940
355
|
type: Boolean,
|
|
941
356
|
default: false
|
|
942
357
|
},
|
|
943
|
-
|
|
358
|
+
isArrowCenter: {
|
|
944
359
|
type: Boolean,
|
|
945
|
-
default:
|
|
360
|
+
default: true
|
|
946
361
|
}
|
|
947
362
|
};
|
|
948
|
-
function
|
|
949
|
-
const
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
363
|
+
function getScrollParent(element) {
|
|
364
|
+
const overflowRegex = /(auto|scroll|hidden)/;
|
|
365
|
+
for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
|
|
366
|
+
const style = window.getComputedStyle(parent);
|
|
367
|
+
if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
|
|
368
|
+
return parent;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return window;
|
|
372
|
+
}
|
|
373
|
+
function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
374
|
+
let { x, y } = point;
|
|
375
|
+
if (!isArrowCenter) {
|
|
376
|
+
const { width, height } = originRect;
|
|
377
|
+
if (x && placement.includes("start")) {
|
|
378
|
+
x = 12;
|
|
379
|
+
}
|
|
380
|
+
if (x && placement.includes("end")) {
|
|
381
|
+
x = Math.round(width - 24);
|
|
382
|
+
}
|
|
383
|
+
if (y && placement.includes("start")) {
|
|
384
|
+
y = 10;
|
|
385
|
+
}
|
|
386
|
+
if (y && placement.includes("end")) {
|
|
387
|
+
y = height - 14;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return { x, y };
|
|
391
|
+
}
|
|
392
|
+
function useOverlay(props, emit) {
|
|
393
|
+
const overlayRef = ref();
|
|
394
|
+
const arrowRef = ref();
|
|
395
|
+
let originParent = null;
|
|
396
|
+
const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
|
|
397
|
+
const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
|
|
398
|
+
const staticSide = {
|
|
399
|
+
top: "bottom",
|
|
400
|
+
right: "left",
|
|
401
|
+
bottom: "top",
|
|
402
|
+
left: "right"
|
|
403
|
+
}[placement.split("-")[0]];
|
|
404
|
+
Object.assign(arrowEl.style, {
|
|
405
|
+
left: x ? `${x}px` : "",
|
|
406
|
+
top: y ? `${y}px` : "",
|
|
407
|
+
right: "",
|
|
408
|
+
bottom: "",
|
|
409
|
+
[staticSide]: "-4px"
|
|
410
|
+
});
|
|
954
411
|
};
|
|
955
|
-
const
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
412
|
+
const updatePosition = async () => {
|
|
413
|
+
const hostEl = props.origin;
|
|
414
|
+
const overlayEl = unref(overlayRef.value);
|
|
415
|
+
const arrowEl = unref(arrowRef.value);
|
|
416
|
+
const middleware = [
|
|
417
|
+
offset(props.offset),
|
|
418
|
+
autoPlacement({
|
|
419
|
+
alignment: props.align,
|
|
420
|
+
allowedPlacements: props.position
|
|
421
|
+
})
|
|
422
|
+
];
|
|
423
|
+
props.showArrow && middleware.push(arrow({ element: arrowEl }));
|
|
424
|
+
props.shiftOffset !== void 0 && middleware.push(shift());
|
|
425
|
+
const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
|
|
426
|
+
strategy: "fixed",
|
|
427
|
+
middleware
|
|
428
|
+
});
|
|
429
|
+
let applyX = x;
|
|
430
|
+
let applyY = y;
|
|
431
|
+
if (props.shiftOffset !== void 0) {
|
|
432
|
+
const { x: shiftX, y: shiftY } = middlewareData.shift;
|
|
433
|
+
shiftX < 0 && (applyX -= props.shiftOffset);
|
|
434
|
+
shiftX > 0 && (applyX += props.shiftOffset);
|
|
435
|
+
shiftY < 0 && (applyY -= props.shiftOffset);
|
|
436
|
+
shiftY > 0 && (applyY += props.shiftOffset);
|
|
967
437
|
}
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
438
|
+
emit("positionChange", placement);
|
|
439
|
+
Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
|
|
440
|
+
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
441
|
+
};
|
|
442
|
+
watch(() => props.modelValue, () => {
|
|
443
|
+
if (props.modelValue && props.origin) {
|
|
444
|
+
originParent = getScrollParent(props.origin);
|
|
445
|
+
nextTick(updatePosition);
|
|
446
|
+
originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
|
|
447
|
+
originParent !== window && window.addEventListener("scroll", updatePosition);
|
|
448
|
+
window.addEventListener("resize", updatePosition);
|
|
971
449
|
} else {
|
|
972
|
-
|
|
450
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
451
|
+
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
452
|
+
window.removeEventListener("resize", updatePosition);
|
|
973
453
|
}
|
|
974
454
|
});
|
|
975
|
-
|
|
455
|
+
onUnmounted(() => {
|
|
456
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
457
|
+
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
458
|
+
window.removeEventListener("resize", updatePosition);
|
|
459
|
+
});
|
|
460
|
+
return { arrowRef, overlayRef, updatePosition };
|
|
976
461
|
}
|
|
977
|
-
var
|
|
978
|
-
|
|
979
|
-
name: "
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
props
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
} = toRefs(props);
|
|
462
|
+
var flexibleOverlay = "";
|
|
463
|
+
defineComponent({
|
|
464
|
+
name: "DFlexibleOverlay",
|
|
465
|
+
inheritAttrs: false,
|
|
466
|
+
props: flexibleOverlayProps,
|
|
467
|
+
emits: ["update:modelValue", "positionChange"],
|
|
468
|
+
setup(props, {
|
|
469
|
+
slots,
|
|
470
|
+
attrs,
|
|
471
|
+
emit,
|
|
472
|
+
expose
|
|
473
|
+
}) {
|
|
474
|
+
const ns = useNamespace("flexible-overlay");
|
|
991
475
|
const {
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
ctx.emit("click", e);
|
|
1000
|
-
};
|
|
476
|
+
arrowRef,
|
|
477
|
+
overlayRef,
|
|
478
|
+
updatePosition
|
|
479
|
+
} = useOverlay(props, emit);
|
|
480
|
+
expose({
|
|
481
|
+
updatePosition
|
|
482
|
+
});
|
|
1001
483
|
return () => {
|
|
1002
|
-
var _a
|
|
1003
|
-
return
|
|
1004
|
-
"
|
|
1005
|
-
"
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
"
|
|
1009
|
-
|
|
1010
|
-
"class": iconClass.value
|
|
1011
|
-
}, null), createVNode("span", {
|
|
1012
|
-
"class": "button-content"
|
|
1013
|
-
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])]), [[resolveDirective("dLoading"), loading2.value]]);
|
|
484
|
+
var _a;
|
|
485
|
+
return props.modelValue && createVNode("div", mergeProps({
|
|
486
|
+
"ref": overlayRef,
|
|
487
|
+
"class": ns.b()
|
|
488
|
+
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
|
|
489
|
+
"ref": arrowRef,
|
|
490
|
+
"class": ns.e("arrow")
|
|
491
|
+
}, null)]);
|
|
1014
492
|
};
|
|
1015
493
|
}
|
|
1016
494
|
});
|
|
1017
|
-
|
|
1018
|
-
|
|
495
|
+
const inBrowser = typeof window !== "undefined";
|
|
496
|
+
function useModal(props, emit) {
|
|
497
|
+
function close() {
|
|
498
|
+
emit("update:modelValue", false);
|
|
499
|
+
}
|
|
500
|
+
function execClose() {
|
|
501
|
+
props.beforeClose ? props.beforeClose(close) : close();
|
|
502
|
+
}
|
|
503
|
+
function onOverlayClick() {
|
|
504
|
+
props.closeOnClickOverlay && execClose();
|
|
505
|
+
}
|
|
506
|
+
function onCloseBtnClick() {
|
|
507
|
+
execClose();
|
|
508
|
+
}
|
|
509
|
+
function onKeydown(event) {
|
|
510
|
+
if (event["keyCode"] === 27) {
|
|
511
|
+
execClose();
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
onMounted(() => {
|
|
515
|
+
if (props.escapable) {
|
|
516
|
+
window.addEventListener("keydown", onKeydown);
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
onUnmounted(() => {
|
|
520
|
+
if (props.escapable) {
|
|
521
|
+
window.addEventListener("keydown", onKeydown);
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
return { onCloseBtnClick, onOverlayClick };
|
|
1019
525
|
}
|
|
1020
|
-
|
|
526
|
+
function useModalRender(props) {
|
|
527
|
+
const showContainer = ref(false);
|
|
528
|
+
const showModal = ref(false);
|
|
529
|
+
let lockScrollCb;
|
|
530
|
+
const removeBodyAdditions = () => {
|
|
531
|
+
lockScrollCb == null ? void 0 : lockScrollCb();
|
|
532
|
+
};
|
|
533
|
+
watch(() => props.modelValue, (val) => {
|
|
534
|
+
if (val) {
|
|
535
|
+
props.lockScroll && (lockScrollCb = lockScroll());
|
|
536
|
+
showContainer.value = true;
|
|
537
|
+
nextTick(() => {
|
|
538
|
+
showModal.value = true;
|
|
539
|
+
});
|
|
540
|
+
} else {
|
|
541
|
+
removeBodyAdditions();
|
|
542
|
+
showModal.value = false;
|
|
543
|
+
setTimeout(() => {
|
|
544
|
+
showContainer.value = false;
|
|
545
|
+
}, 100);
|
|
546
|
+
}
|
|
547
|
+
}, {
|
|
548
|
+
immediate: true
|
|
549
|
+
});
|
|
550
|
+
onUnmounted(removeBodyAdditions);
|
|
551
|
+
return { showContainer, showModal };
|
|
552
|
+
}
|
|
553
|
+
var Header = defineComponent({
|
|
554
|
+
name: "DModalHeader",
|
|
555
|
+
setup(props, {
|
|
556
|
+
slots
|
|
557
|
+
}) {
|
|
558
|
+
const ns = useNamespace("modal");
|
|
559
|
+
return () => {
|
|
560
|
+
var _a;
|
|
561
|
+
return createVNode("div", {
|
|
562
|
+
"class": ns.e("header")
|
|
563
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
var Body = defineComponent({
|
|
568
|
+
name: "DModalBody",
|
|
569
|
+
setup(props, {
|
|
570
|
+
slots
|
|
571
|
+
}) {
|
|
572
|
+
const ns = useNamespace("modal");
|
|
573
|
+
return () => {
|
|
574
|
+
var _a;
|
|
575
|
+
return createVNode("div", {
|
|
576
|
+
"class": ns.e("body")
|
|
577
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
var modal = "";
|
|
582
|
+
var Modal = defineComponent({
|
|
1021
583
|
name: "DModal",
|
|
1022
584
|
inheritAttrs: false,
|
|
1023
|
-
props:
|
|
1024
|
-
emits: ["
|
|
1025
|
-
setup(props,
|
|
585
|
+
props: modalProps,
|
|
586
|
+
emits: ["update:modelValue"],
|
|
587
|
+
setup(props, {
|
|
588
|
+
slots,
|
|
589
|
+
attrs,
|
|
590
|
+
emit
|
|
591
|
+
}) {
|
|
592
|
+
const ns = useNamespace("modal");
|
|
1026
593
|
const {
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
} =
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
width: props.width,
|
|
1045
|
-
maxHeight: props.maxHeight,
|
|
1046
|
-
transform: `translate(${props.offsetX}, ${props.offsetY})`,
|
|
1047
|
-
zIndex: props.zIndex
|
|
1048
|
-
}));
|
|
1049
|
-
const iconName = computed(() => {
|
|
1050
|
-
switch (props.dialogType) {
|
|
1051
|
-
case "standard":
|
|
1052
|
-
return "";
|
|
1053
|
-
case "info":
|
|
1054
|
-
return "icon-info-o";
|
|
1055
|
-
case "success":
|
|
1056
|
-
return "icon-right-o";
|
|
1057
|
-
case "warning":
|
|
1058
|
-
return "icon-warning-o";
|
|
1059
|
-
case "failed":
|
|
1060
|
-
return "icon-error-o";
|
|
1061
|
-
default:
|
|
1062
|
-
return "";
|
|
1063
|
-
}
|
|
1064
|
-
});
|
|
1065
|
-
const buttonsRef = computed(() => {
|
|
1066
|
-
return props.buttons.map((buttonProps2, index2) => {
|
|
1067
|
-
const {
|
|
1068
|
-
variant,
|
|
1069
|
-
disabled,
|
|
1070
|
-
handler,
|
|
1071
|
-
text
|
|
1072
|
-
} = buttonProps2;
|
|
1073
|
-
return createVNode(Button, {
|
|
1074
|
-
"key": index2,
|
|
1075
|
-
"style": {
|
|
1076
|
-
display: "inline-block",
|
|
1077
|
-
margin: "0 5px"
|
|
1078
|
-
},
|
|
1079
|
-
"variant": variant,
|
|
1080
|
-
"disabled": disabled,
|
|
1081
|
-
"onClick": handler
|
|
1082
|
-
}, _isSlot(text) ? text : {
|
|
1083
|
-
default: () => [text]
|
|
1084
|
-
});
|
|
1085
|
-
});
|
|
1086
|
-
});
|
|
1087
|
-
const modalRef = ref();
|
|
1088
|
-
const closeModal = () => {
|
|
1089
|
-
var _a, _b;
|
|
1090
|
-
(_b = (_a = modalRef.value) == null ? void 0 : _a.onVisibleChange) == null ? void 0 : _b.call(_a, false);
|
|
1091
|
-
};
|
|
1092
|
-
ctx.expose({
|
|
1093
|
-
closeModal
|
|
1094
|
-
});
|
|
1095
|
-
return () => createVNode(Modal, {
|
|
1096
|
-
"ref": modalRef,
|
|
1097
|
-
"width": props.width,
|
|
1098
|
-
"maxHeight": props.maxHeight,
|
|
1099
|
-
"offsetX": props.offsetX,
|
|
1100
|
-
"offsetY": props.offsetY,
|
|
1101
|
-
"zIndex": props.zIndex,
|
|
1102
|
-
"backdropZIndex": props.backdropZIndex,
|
|
1103
|
-
"backdropCloseable": props.backdropCloseable,
|
|
1104
|
-
"bodyScrollable": props.bodyScrollable,
|
|
1105
|
-
"placement": props.placement,
|
|
1106
|
-
"onClose": props.onClose,
|
|
1107
|
-
"beforeHidden": props.beforeHidden,
|
|
1108
|
-
"modelValue": props.modelValue,
|
|
1109
|
-
"onUpdate:modelValue": props["onUpdate:modelValue"]
|
|
594
|
+
modelValue,
|
|
595
|
+
title,
|
|
596
|
+
showClose,
|
|
597
|
+
showOverlay,
|
|
598
|
+
appendToBody
|
|
599
|
+
} = toRefs(props);
|
|
600
|
+
const {
|
|
601
|
+
onCloseBtnClick,
|
|
602
|
+
onOverlayClick
|
|
603
|
+
} = useModal(props, emit);
|
|
604
|
+
const {
|
|
605
|
+
showContainer,
|
|
606
|
+
showModal
|
|
607
|
+
} = useModalRender(props);
|
|
608
|
+
return () => createVNode(Teleport, {
|
|
609
|
+
"to": "body",
|
|
610
|
+
"disabled": !appendToBody.value
|
|
1110
611
|
}, {
|
|
1111
|
-
default: () => {
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
"
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
612
|
+
default: () => [showOverlay.value && createVNode(FixedOverlay, {
|
|
613
|
+
"modelValue": modelValue.value,
|
|
614
|
+
"onUpdate:modelValue": ($event) => modelValue.value = $event,
|
|
615
|
+
"lock-scroll": false,
|
|
616
|
+
"style": {
|
|
617
|
+
zIndex: "calc(var(--devui-z-index-modal, 1050) - 1)"
|
|
618
|
+
}
|
|
619
|
+
}, null), showContainer.value && createVNode("div", {
|
|
620
|
+
"class": ns.e("container"),
|
|
621
|
+
"onClick": onOverlayClick
|
|
622
|
+
}, [createVNode(Transition, {
|
|
623
|
+
"name": ns.m("wipe")
|
|
624
|
+
}, {
|
|
625
|
+
default: () => {
|
|
626
|
+
var _a;
|
|
627
|
+
return [showModal.value && createVNode("div", mergeProps({
|
|
628
|
+
"class": ns.b()
|
|
629
|
+
}, attrs, {
|
|
630
|
+
"onClick": (e) => e.stopPropagation()
|
|
631
|
+
}), [showClose.value && createVNode(Icon, {
|
|
632
|
+
"name": "close",
|
|
633
|
+
"class": "btn-close",
|
|
634
|
+
"size": "var(--devui-font-size-md,12px)",
|
|
635
|
+
"onClick": onCloseBtnClick
|
|
636
|
+
}, null), slots.header ? slots.header() : title.value && createVNode(Header, null, {
|
|
637
|
+
default: () => [title.value]
|
|
638
|
+
}), createVNode(Body, null, {
|
|
639
|
+
default: () => {
|
|
640
|
+
var _a2;
|
|
641
|
+
return [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)];
|
|
642
|
+
}
|
|
643
|
+
}), (_a = slots.footer) == null ? void 0 : _a.call(slots)])];
|
|
644
|
+
}
|
|
645
|
+
})])]
|
|
1135
646
|
});
|
|
1136
647
|
}
|
|
1137
648
|
});
|
|
1138
|
-
|
|
649
|
+
var Footer = defineComponent({
|
|
650
|
+
name: "DModalFooter",
|
|
651
|
+
setup(props, {
|
|
652
|
+
slots
|
|
653
|
+
}) {
|
|
654
|
+
const ns = useNamespace("modal");
|
|
655
|
+
return () => {
|
|
656
|
+
var _a;
|
|
657
|
+
return createVNode("div", {
|
|
658
|
+
"class": ns.e("footer")
|
|
659
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
class CommonModalService {
|
|
664
|
+
constructor(anchorContainer) {
|
|
665
|
+
this.anchorContainer = anchorContainer;
|
|
666
|
+
}
|
|
667
|
+
renderModal(anchor, props, children) {
|
|
668
|
+
const vnode = h(this.component(), props, children);
|
|
669
|
+
render(vnode, anchor);
|
|
670
|
+
return vnode;
|
|
671
|
+
}
|
|
672
|
+
renderNull(anchor) {
|
|
673
|
+
setTimeout(() => {
|
|
674
|
+
render(null, anchor);
|
|
675
|
+
}, 500);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
let vm;
|
|
679
|
+
class ModalService extends CommonModalService {
|
|
1139
680
|
component() {
|
|
1140
|
-
return
|
|
681
|
+
return Modal;
|
|
1141
682
|
}
|
|
1142
683
|
open(props = {}) {
|
|
1143
684
|
const anchor = document.createElement("div");
|
|
1144
685
|
this.anchorContainer.appendChild(anchor);
|
|
1145
|
-
const
|
|
1146
|
-
const
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
}
|
|
1150
|
-
};
|
|
1151
|
-
const renderOrigin = (props2, onUpdateModelValue = needHideOrNot) => {
|
|
1152
|
-
return this.renderModal(anchor, __spreadProps(__spreadValues({}, props2), {
|
|
686
|
+
const { header, content, footer, ...resProps } = props;
|
|
687
|
+
const renderOrigin = (propsValue, onUpdateModelValue) => {
|
|
688
|
+
return this.renderModal(anchor, {
|
|
689
|
+
...propsValue,
|
|
1153
690
|
modelValue: true,
|
|
1154
691
|
"onUpdate:modelValue": onUpdateModelValue
|
|
1155
|
-
}
|
|
692
|
+
}, { header, default: content, footer });
|
|
1156
693
|
};
|
|
1157
694
|
const hide = () => {
|
|
1158
|
-
var
|
|
1159
|
-
const
|
|
695
|
+
var _a, _b, _c;
|
|
696
|
+
const innerNeedHideOrNot = (value) => {
|
|
697
|
+
if (!value) {
|
|
698
|
+
hide();
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
renderOrigin(resProps, (value) => {
|
|
1160
702
|
if (!value) {
|
|
1161
|
-
this.renderModal(anchor,
|
|
703
|
+
this.renderModal(anchor, { ...resProps, modelValue: false });
|
|
1162
704
|
this.renderNull(anchor);
|
|
1163
705
|
} else {
|
|
1164
|
-
renderOrigin(resProps);
|
|
706
|
+
renderOrigin(resProps, innerNeedHideOrNot);
|
|
1165
707
|
}
|
|
1166
708
|
});
|
|
1167
|
-
(_b = (
|
|
709
|
+
(_c = (_b = (_a = vm == null ? void 0 : vm.component) == null ? void 0 : _a.exposed) == null ? void 0 : _b.handleVisibleChange) == null ? void 0 : _c.call(_b, false);
|
|
1168
710
|
};
|
|
1169
|
-
const
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
711
|
+
const needHideOrNot = (value) => {
|
|
712
|
+
if (!value) {
|
|
713
|
+
hide();
|
|
714
|
+
}
|
|
1173
715
|
};
|
|
1174
716
|
this.renderModal(anchor, { modelValue: false });
|
|
1175
|
-
renderOrigin(resProps);
|
|
1176
|
-
return { hide
|
|
717
|
+
vm = renderOrigin(resProps, needHideOrNot);
|
|
718
|
+
return { hide };
|
|
1177
719
|
}
|
|
1178
720
|
}
|
|
1179
|
-
|
|
1180
|
-
Modal.install = function(app) {
|
|
1181
|
-
app.component(Modal.name, Modal);
|
|
1182
|
-
};
|
|
721
|
+
ModalService.token = "MODAL_SERVICE_TOKEN";
|
|
1183
722
|
var index = {
|
|
1184
723
|
title: "Modal \u5F39\u7A97",
|
|
1185
724
|
category: "\u53CD\u9988",
|
|
1186
725
|
status: "100%",
|
|
1187
726
|
install(app) {
|
|
1188
|
-
app.
|
|
727
|
+
app.component(Modal.name, Modal);
|
|
728
|
+
app.component(Header.name, Header);
|
|
729
|
+
app.component(Body.name, Body);
|
|
730
|
+
app.component(Footer.name, Footer);
|
|
1189
731
|
if (!inBrowser) {
|
|
1190
732
|
return;
|
|
1191
733
|
}
|
|
@@ -1196,7 +738,6 @@ var index = {
|
|
|
1196
738
|
document.body.appendChild(anchorsContainer);
|
|
1197
739
|
}
|
|
1198
740
|
app.provide(ModalService.token, new ModalService(anchorsContainer));
|
|
1199
|
-
app.provide(DialogService.token, new DialogService(anchorsContainer));
|
|
1200
741
|
}
|
|
1201
742
|
};
|
|
1202
|
-
export { Modal, index as default };
|
|
743
|
+
export { Modal, index as default, modalProps };
|