vue-devui 1.0.0-alpha.1 → 1.0.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +161 -172
- package/alert/index.d.ts +7 -0
- package/alert/index.es.js +204 -1
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.d.ts +7 -0
- package/auto-complete/index.es.js +9051 -0
- package/auto-complete/index.umd.js +40 -0
- package/auto-complete/package.json +7 -0
- package/auto-complete/style.css +1 -0
- package/avatar/index.d.ts +7 -0
- package/avatar/index.es.js +308 -1
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.d.ts +7 -0
- package/badge/index.es.js +120 -1
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.d.ts +7 -0
- package/button/index.es.js +5964 -1
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.d.ts +7 -0
- package/card/index.es.js +89 -1
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.d.ts +7 -0
- package/checkbox/index.es.js +8207 -1
- package/checkbox/index.umd.js +38 -1
- package/checkbox/style.css +1 -1
- package/collapse/index.d.ts +7 -0
- package/collapse/index.es.js +195 -0
- package/collapse/index.umd.js +1 -0
- package/{carousel → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.d.ts +7 -0
- package/countdown/index.es.js +217 -0
- package/countdown/index.umd.js +1 -0
- package/{accordion → countdown}/package.json +1 -1
- package/countdown/style.css +1 -0
- package/date-picker-pro/index.d.ts +7 -0
- package/date-picker-pro/index.es.js +12031 -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.d.ts +7 -0
- package/drawer/index.es.js +248 -0
- package/drawer/index.umd.js +1 -0
- package/{anchor → drawer}/package.json +1 -1
- package/drawer/style.css +1 -0
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +743 -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 +991 -1
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.d.ts +7 -0
- package/form/index.es.js +7751 -0
- package/form/index.umd.js +38 -0
- package/{toast → form}/package.json +1 -1
- package/form/style.css +1 -0
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +166 -0
- package/fullscreen/index.umd.js +1 -0
- package/fullscreen/package.json +7 -0
- package/fullscreen/style.css +1 -0
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +271 -0
- package/grid/index.umd.js +1 -0
- package/{sticky → grid}/package.json +1 -1
- package/grid/style.css +1 -0
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +218 -1
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.d.ts +7 -0
- package/image-preview/index.es.js +511 -1
- 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 +8311 -1
- package/input/index.umd.js +38 -1
- package/input/style.css +1 -1
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +308 -1
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.d.ts +7 -0
- package/layout/index.es.js +115 -0
- package/layout/index.umd.js +1 -0
- package/layout/package.json +7 -0
- package/layout/style.css +1 -0
- package/loading/index.d.ts +7 -0
- package/loading/index.es.js +272 -1
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/message/index.d.ts +7 -0
- package/message/index.es.js +534 -0
- package/message/index.umd.js +1 -0
- package/message/package.json +7 -0
- package/message/style.css +1 -0
- package/modal/index.d.ts +7 -0
- package/modal/index.es.js +741 -0
- package/modal/index.umd.js +1 -0
- package/modal/package.json +7 -0
- package/modal/style.css +1 -0
- package/notification/index.d.ts +7 -0
- package/notification/index.es.js +528 -0
- package/notification/index.umd.js +1 -0
- package/notification/package.json +7 -0
- package/notification/style.css +1 -0
- package/nuxt/components/Alert.js +3 -0
- package/nuxt/components/Aside.js +3 -0
- package/nuxt/components/AutoComplete.js +3 -0
- package/nuxt/components/Avatar.js +3 -0
- package/nuxt/components/Badge.js +3 -0
- package/nuxt/components/Button.js +3 -0
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/Card.js +3 -0
- package/nuxt/components/Checkbox.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Col.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/Content.js +3 -0
- package/nuxt/components/Countdown.js +3 -0
- package/nuxt/components/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.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/DropdownMenu.js +3 -0
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/EditableSelect.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.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/FormItem.js +3 -0
- package/nuxt/components/FormOperation.js +3 -0
- package/nuxt/components/Fullscreen.js +3 -0
- package/nuxt/components/Header.js +3 -0
- package/nuxt/components/IFileOptions.js +3 -0
- package/nuxt/components/IUploadOptions.js +3 -0
- package/nuxt/components/Icon.js +3 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/ImagePreviewService.js +3 -0
- package/nuxt/components/Input.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/Layout.js +3 -0
- package/nuxt/components/Loading.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/LoadingService.js +3 -0
- package/nuxt/components/Message.js +3 -0
- package/nuxt/components/Modal.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/Pagination.js +3 -0
- package/nuxt/components/Panel.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/Popover.js +3 -0
- package/nuxt/components/Progress.js +3 -0
- package/nuxt/components/Radio.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/RadioGroup.js +3 -0
- package/nuxt/components/Rate.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/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/Switch.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/Tab.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/Textarea.js +3 -0
- package/nuxt/components/TimePicker.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/Tooltip.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/Upload.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/buttonProps.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/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/treeProps.js +3 -0
- package/nuxt/components/uploadProps.js +3 -0
- package/nuxt/index.js +13 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +293 -1
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +19 -82
- package/pagination/index.d.ts +7 -0
- package/pagination/index.es.js +820 -1
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/index.d.ts +7 -0
- package/panel/index.es.js +218 -1
- 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 +6062 -1
- package/popover/index.umd.js +27 -1
- package/popover/style.css +1 -1
- package/progress/index.d.ts +7 -0
- package/progress/index.es.js +207 -1
- package/progress/index.umd.js +3 -1
- package/progress/style.css +1 -1
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +8056 -1
- package/radio/index.umd.js +38 -1
- package/radio/style.css +1 -1
- package/rate/index.d.ts +7 -0
- package/rate/index.es.js +242 -1
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.d.ts +7 -0
- package/result/index.es.js +248 -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 +173 -1
- package/ripple/index.umd.js +1 -1
- package/search/index.d.ts +7 -0
- package/search/index.es.js +8504 -2
- package/search/index.umd.js +38 -10
- package/search/style.css +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +9423 -1
- package/select/index.umd.js +38 -1
- package/select/style.css +1 -1
- package/skeleton/index.d.ts +7 -0
- package/skeleton/index.es.js +145 -0
- package/skeleton/index.umd.js +1 -0
- package/skeleton/package.json +7 -0
- package/skeleton/style.css +1 -0
- package/slider/index.d.ts +7 -0
- package/slider/index.es.js +203 -1
- 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 +6754 -1
- package/splitter/index.umd.js +27 -1
- package/splitter/style.css +1 -1
- package/statistic/index.d.ts +7 -0
- package/statistic/index.es.js +253 -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 +63 -1
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/steps/index.d.ts +7 -0
- package/steps/index.es.js +386 -0
- package/steps/index.umd.js +1 -0
- package/steps/package.json +7 -0
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.d.ts +7 -0
- package/switch/index.es.js +7852 -1
- package/switch/index.umd.js +38 -1
- package/switch/style.css +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +11527 -0
- package/table/index.umd.js +38 -0
- package/table/package.json +7 -0
- package/table/style.css +1 -0
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +407 -1
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.d.ts +7 -0
- package/tag/index.es.js +156 -0
- package/tag/index.umd.js +1 -0
- package/tag/package.json +7 -0
- package/tag/style.css +1 -0
- package/textarea/index.d.ts +7 -0
- package/textarea/index.es.js +7986 -0
- package/textarea/index.umd.js +46 -0
- package/textarea/package.json +7 -0
- package/textarea/style.css +1 -0
- package/{theme → theme/theme.scss} +0 -0
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +9556 -0
- package/time-picker/index.umd.js +38 -0
- package/{date-picker → time-picker}/package.json +1 -1
- package/time-picker/style.css +1 -0
- package/time-select/index.d.ts +7 -0
- package/time-select/index.es.js +9604 -0
- package/time-select/index.umd.js +38 -0
- package/time-select/package.json +7 -0
- package/time-select/style.css +1 -0
- package/timeline/index.d.ts +7 -0
- package/timeline/index.es.js +427 -0
- package/timeline/index.umd.js +1 -0
- package/timeline/package.json +7 -0
- package/timeline/style.css +1 -0
- package/tooltip/index.d.ts +7 -0
- package/tooltip/index.es.js +5900 -1
- package/tooltip/index.umd.js +27 -1
- package/tooltip/style.css +1 -1
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +10336 -1
- package/tree/index.umd.js +38 -1
- package/tree/style.css +1 -1
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +1398 -1
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +27443 -2
- package/vue-devui.umd.js +50 -10
- package/accordion/index.es.js +0 -1
- package/accordion/index.umd.js +0 -1
- package/accordion/style.css +0 -1
- package/anchor/index.es.js +0 -1
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/carousel/index.es.js +0 -1
- package/carousel/index.umd.js +0 -1
- package/carousel/style.css +0 -1
- package/date-picker/index.es.js +0 -1
- package/date-picker/index.umd.js +0 -1
- package/date-picker/style.css +0 -1
- package/quadrant-diagram/index.es.js +0 -10
- package/quadrant-diagram/index.umd.js +0 -10
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/sticky/index.es.js +0 -1
- package/sticky/index.umd.js +0 -1
- package/tag-input/index.es.js +0 -1
- package/tag-input/index.umd.js +0 -1
- package/tag-input/package.json +0 -7
- package/tag-input/style.css +0 -1
- package/toast/index.es.js +0 -1
- package/toast/index.umd.js +0 -1
- package/toast/style.css +0 -1
- package/transfer/index.es.js +0 -10
- package/transfer/index.umd.js +0 -10
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
package/loading/index.es.js
CHANGED
|
@@ -1 +1,272 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineComponent, ref, createVNode, h, render } from "vue";
|
|
2
|
+
class View {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.top = "50%";
|
|
5
|
+
this.left = "50%";
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
const loadingProps = {
|
|
9
|
+
message: String,
|
|
10
|
+
backdrop: Boolean,
|
|
11
|
+
view: {
|
|
12
|
+
type: Object,
|
|
13
|
+
default: () => new View()
|
|
14
|
+
},
|
|
15
|
+
zIndex: Number,
|
|
16
|
+
isFull: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
class LoadingOptions {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.backdrop = true;
|
|
24
|
+
this.positionType = "relative";
|
|
25
|
+
this.view = new View();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function createBem(namespace, element, modifier) {
|
|
29
|
+
let cls = namespace;
|
|
30
|
+
if (element) {
|
|
31
|
+
cls += `__${element}`;
|
|
32
|
+
}
|
|
33
|
+
if (modifier) {
|
|
34
|
+
cls += `--${modifier}`;
|
|
35
|
+
}
|
|
36
|
+
return cls;
|
|
37
|
+
}
|
|
38
|
+
function useNamespace(block, needDot = false) {
|
|
39
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
40
|
+
const b = () => createBem(namespace);
|
|
41
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
42
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
43
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
44
|
+
return {
|
|
45
|
+
b,
|
|
46
|
+
e,
|
|
47
|
+
m,
|
|
48
|
+
em
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
var loading$1 = "";
|
|
52
|
+
var Loading = defineComponent({
|
|
53
|
+
name: "DLoading",
|
|
54
|
+
inheritAttrs: false,
|
|
55
|
+
props: loadingProps,
|
|
56
|
+
setup(props) {
|
|
57
|
+
const style = {
|
|
58
|
+
top: props.view.top,
|
|
59
|
+
left: props.view.left,
|
|
60
|
+
zIndex: props.zIndex
|
|
61
|
+
};
|
|
62
|
+
if (!props.message) {
|
|
63
|
+
style.background = "none";
|
|
64
|
+
}
|
|
65
|
+
const isShow = ref(false);
|
|
66
|
+
const open = () => {
|
|
67
|
+
isShow.value = true;
|
|
68
|
+
};
|
|
69
|
+
const close = () => {
|
|
70
|
+
isShow.value = false;
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
style,
|
|
74
|
+
isShow,
|
|
75
|
+
open,
|
|
76
|
+
close
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
render() {
|
|
80
|
+
var _a;
|
|
81
|
+
const {
|
|
82
|
+
isShow,
|
|
83
|
+
isFull,
|
|
84
|
+
backdrop,
|
|
85
|
+
style,
|
|
86
|
+
message,
|
|
87
|
+
$slots
|
|
88
|
+
} = this;
|
|
89
|
+
const ns = useNamespace("loading");
|
|
90
|
+
return isShow && createVNode("div", {
|
|
91
|
+
"class": [ns.b(), isFull ? ns.m("full") : ""]
|
|
92
|
+
}, [((_a = $slots.default) == null ? void 0 : _a.call($slots)) || createVNode("div", {
|
|
93
|
+
"class": ns.e("wrapper")
|
|
94
|
+
}, [backdrop ? createVNode("div", {
|
|
95
|
+
"class": ns.e("mask")
|
|
96
|
+
}, null) : null, createVNode("div", {
|
|
97
|
+
"style": style,
|
|
98
|
+
"class": ns.e("area")
|
|
99
|
+
}, [createVNode("div", {
|
|
100
|
+
"class": ns.e("busy-default-spinner")
|
|
101
|
+
}, [createVNode("div", {
|
|
102
|
+
"class": ns.e("bar1")
|
|
103
|
+
}, null), createVNode("div", {
|
|
104
|
+
"class": ns.e("bar2")
|
|
105
|
+
}, null), createVNode("div", {
|
|
106
|
+
"class": ns.e("bar3")
|
|
107
|
+
}, null), createVNode("div", {
|
|
108
|
+
"class": ns.e("bar4")
|
|
109
|
+
}, null)]), message ? createVNode("span", {
|
|
110
|
+
"class": ns.e("text")
|
|
111
|
+
}, [message]) : null])])]);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
|
|
115
|
+
function createComponent(component, props, children = null) {
|
|
116
|
+
const vnode = h(component, { ...props }, children);
|
|
117
|
+
const container = document.createElement("div");
|
|
118
|
+
vnode[COMPONENT_CONTAINER_SYMBOL] = container;
|
|
119
|
+
render(vnode, container);
|
|
120
|
+
return vnode.component;
|
|
121
|
+
}
|
|
122
|
+
function unmountComponent(ComponnetInstance) {
|
|
123
|
+
render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
|
|
124
|
+
}
|
|
125
|
+
const loadingConstructor$1 = defineComponent(Loading);
|
|
126
|
+
const cacheInstance = /* @__PURE__ */ new WeakSet();
|
|
127
|
+
const isEmpty = (val) => {
|
|
128
|
+
if (!val) {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
if (Array.isArray(val)) {
|
|
132
|
+
return val.length === 0;
|
|
133
|
+
}
|
|
134
|
+
if (val instanceof Set || val instanceof Map) {
|
|
135
|
+
return val.size === 0;
|
|
136
|
+
}
|
|
137
|
+
if (val instanceof Promise) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
if (typeof val === "object") {
|
|
141
|
+
try {
|
|
142
|
+
return Object.keys(val).length === 0;
|
|
143
|
+
} catch (e) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return false;
|
|
148
|
+
};
|
|
149
|
+
const getType = (vari) => {
|
|
150
|
+
return Object.prototype.toString.call(vari).slice(8, -1).toLowerCase();
|
|
151
|
+
};
|
|
152
|
+
const isPromise = (value) => {
|
|
153
|
+
const type = getType(value);
|
|
154
|
+
switch (type) {
|
|
155
|
+
case "promise":
|
|
156
|
+
return [value];
|
|
157
|
+
case "array":
|
|
158
|
+
if (value.some((val) => getType(val) !== "promise")) {
|
|
159
|
+
console.error(new TypeError("Binding values should all be of type Promise"));
|
|
160
|
+
return "error";
|
|
161
|
+
}
|
|
162
|
+
return value;
|
|
163
|
+
default:
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
const unmount = (el) => {
|
|
168
|
+
cacheInstance.delete(el);
|
|
169
|
+
el.instance.proxy.close();
|
|
170
|
+
unmountComponent(el.instance);
|
|
171
|
+
};
|
|
172
|
+
const toggleLoading = (el, binding) => {
|
|
173
|
+
var _a, _b, _c;
|
|
174
|
+
if (binding.value) {
|
|
175
|
+
const vals = isPromise(binding.value);
|
|
176
|
+
if (vals === "error") {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
(_c = (_b = (_a = el == null ? void 0 : el.instance) == null ? void 0 : _a.proxy) == null ? void 0 : _b.open) == null ? void 0 : _c.call(_b);
|
|
180
|
+
el.appendChild(el.mask);
|
|
181
|
+
cacheInstance.add(el);
|
|
182
|
+
if (vals) {
|
|
183
|
+
Promise.all(vals).catch((err) => {
|
|
184
|
+
console.error(new Error("Promise handling errors"), err);
|
|
185
|
+
}).finally(() => {
|
|
186
|
+
unmount(el);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
} else {
|
|
190
|
+
unmount(el);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
const removeAttribute = (el) => {
|
|
194
|
+
el.removeAttribute("zindex");
|
|
195
|
+
el.removeAttribute("positiontype");
|
|
196
|
+
el.removeAttribute("backdrop");
|
|
197
|
+
el.removeAttribute("message");
|
|
198
|
+
el.removeAttribute("view");
|
|
199
|
+
el.removeAttribute("loadingtemplateref");
|
|
200
|
+
};
|
|
201
|
+
const handleProps = (el, vprops) => {
|
|
202
|
+
var _a;
|
|
203
|
+
const props = {
|
|
204
|
+
...new LoadingOptions(),
|
|
205
|
+
...vprops
|
|
206
|
+
};
|
|
207
|
+
const loadingTemplateRef = props.loadingTemplateRef;
|
|
208
|
+
const loadingInstance = createComponent(loadingConstructor$1, { ...props }, loadingTemplateRef ? () => loadingTemplateRef : null);
|
|
209
|
+
el.style.position = props.positionType;
|
|
210
|
+
el.options = props;
|
|
211
|
+
el.instance = loadingInstance;
|
|
212
|
+
el.mask = (_a = loadingInstance == null ? void 0 : loadingInstance.proxy) == null ? void 0 : _a.$el;
|
|
213
|
+
};
|
|
214
|
+
const loadingDirective = {
|
|
215
|
+
mounted: function(el, binding, vnode) {
|
|
216
|
+
handleProps(el, vnode.props);
|
|
217
|
+
removeAttribute(el);
|
|
218
|
+
!isEmpty(binding.value) && toggleLoading(el, binding);
|
|
219
|
+
},
|
|
220
|
+
updated: function(el, binding, vnode) {
|
|
221
|
+
if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el)) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
!cacheInstance.has(el) && handleProps(el, vnode.props);
|
|
225
|
+
removeAttribute(el);
|
|
226
|
+
toggleLoading(el, binding);
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
const loadingConstructor = defineComponent(Loading);
|
|
230
|
+
const cacheTarget = /* @__PURE__ */ new WeakMap();
|
|
231
|
+
const loading = {
|
|
232
|
+
open(options = {}) {
|
|
233
|
+
var _a, _b, _c;
|
|
234
|
+
const parent = options.target || document.body;
|
|
235
|
+
if (cacheTarget.has(parent)) {
|
|
236
|
+
return cacheTarget.get(parent);
|
|
237
|
+
}
|
|
238
|
+
if (parent.style) {
|
|
239
|
+
parent.style.position = options.positionType;
|
|
240
|
+
}
|
|
241
|
+
const isFull = document.body === parent;
|
|
242
|
+
options = { ...new LoadingOptions(), ...options };
|
|
243
|
+
const instance = createComponent(loadingConstructor, {
|
|
244
|
+
...options,
|
|
245
|
+
isFull
|
|
246
|
+
}, options.loadingTemplateRef ? () => options.loadingTemplateRef : null);
|
|
247
|
+
cacheTarget.set(parent, instance);
|
|
248
|
+
(_a = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a.open();
|
|
249
|
+
parent.appendChild((_b = instance == null ? void 0 : instance.proxy) == null ? void 0 : _b.$el);
|
|
250
|
+
const close = (_c = instance == null ? void 0 : instance.proxy) == null ? void 0 : _c.close;
|
|
251
|
+
if (instance) {
|
|
252
|
+
instance.loadingInstance = instance == null ? void 0 : instance.proxy;
|
|
253
|
+
if (instance.loadingInstance) {
|
|
254
|
+
instance.loadingInstance.close = (...args) => {
|
|
255
|
+
cacheTarget.delete(parent);
|
|
256
|
+
close == null ? void 0 : close(...args);
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return instance;
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
var index = {
|
|
264
|
+
title: "Loading \u52A0\u8F7D\u63D0\u793A",
|
|
265
|
+
category: "\u53CD\u9988",
|
|
266
|
+
status: "100%",
|
|
267
|
+
install(app) {
|
|
268
|
+
app.directive("dLoading", loadingDirective);
|
|
269
|
+
app.config.globalProperties.$loadingService = loading;
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
export { loadingDirective as Loading, LoadingOptions, loading as LoadingService, index as default, loadingProps };
|
package/loading/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(d,r){typeof exports=="object"&&typeof module!="undefined"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(d=typeof globalThis!="undefined"?globalThis:d||self,r(d.index={},d.Vue))})(this,function(d,r){"use strict";class y{constructor(){this.top="50%",this.left="50%"}}const h={message:String,backdrop:Boolean,view:{type:Object,default:()=>new y},zIndex:Number,isFull:{type:Boolean,default:!1}};class m{constructor(){this.backdrop=!0,this.positionType="relative",this.view=new y}}function u(e,o,n){let t=e;return o&&(t+=`__${o}`),n&&(t+=`--${n}`),t}function P(e,o=!1){const n=o?`.devui-${e}`:`devui-${e}`;return{b:()=>u(n),e:c=>c?u(n,c):"",m:c=>c?u(n,"",c):"",em:(c,f)=>c&&f?u(n,c,f):""}}var j="",b=r.defineComponent({name:"DLoading",inheritAttrs:!1,props:h,setup(e){const o={top:e.view.top,left:e.view.left,zIndex:e.zIndex};e.message||(o.background="none");const n=r.ref(!1);return{style:o,isShow:n,open:()=>{n.value=!0},close:()=>{n.value=!1}}},render(){var c;const{isShow:e,isFull:o,backdrop:n,style:t,message:s,$slots:a}=this,i=P("loading");return e&&r.createVNode("div",{class:[i.b(),o?i.m("full"):""]},[((c=a.default)==null?void 0:c.call(a))||r.createVNode("div",{class:i.e("wrapper")},[n?r.createVNode("div",{class:i.e("mask")},null):null,r.createVNode("div",{style:t,class:i.e("area")},[r.createVNode("div",{class:i.e("busy-default-spinner")},[r.createVNode("div",{class:i.e("bar1")},null),r.createVNode("div",{class:i.e("bar2")},null),r.createVNode("div",{class:i.e("bar3")},null),r.createVNode("div",{class:i.e("bar4")},null)]),s?r.createVNode("span",{class:i.e("text")},[s]):null])])])}});const v=Symbol("dev_component_container");function w(e,o,n=null){const t=r.h(e,{...o},n),s=document.createElement("div");return t[v]=s,r.render(t,s),t.component}function k(e){r.render(null,e==null?void 0:e.vnode[v])}const O=r.defineComponent(b),l=new WeakSet,g=e=>{if(!e)return!0;if(Array.isArray(e))return e.length===0;if(e instanceof Set||e instanceof Map)return e.size===0;if(e instanceof Promise)return!1;if(typeof e=="object")try{return Object.keys(e).length===0}catch{return!1}return!1},N=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),C=e=>{switch(N(e)){case"promise":return[e];case"array":return e.some(n=>N(n)!=="promise")?(console.error(new TypeError("Binding values should all be of type Promise")),"error"):e;default:return!1}},T=e=>{l.delete(e),e.instance.proxy.close(),k(e.instance)},A=(e,o)=>{var n,t,s;if(o.value){const a=C(o.value);if(a==="error")return;(s=(t=(n=e==null?void 0:e.instance)==null?void 0:n.proxy)==null?void 0:t.open)==null||s.call(t),e.appendChild(e.mask),l.add(e),a&&Promise.all(a).catch(i=>{console.error(new Error("Promise handling errors"),i)}).finally(()=>{T(e)})}else T(e)},x=e=>{e.removeAttribute("zindex"),e.removeAttribute("positiontype"),e.removeAttribute("backdrop"),e.removeAttribute("message"),e.removeAttribute("view"),e.removeAttribute("loadingtemplateref")},S=(e,o)=>{var a;const n={...new m,...o},t=n.loadingTemplateRef,s=w(O,{...n},t?()=>t:null);e.style.position=n.positionType,e.options=n,e.instance=s,e.mask=(a=s==null?void 0:s.proxy)==null?void 0:a.$el},V={mounted:function(e,o,n){S(e,n.props),x(e),!g(o.value)&&A(e,o)},updated:function(e,o,n){!g(o.value)&&l.has(e)||g(o.value)&&!l.has(e)||(!l.has(e)&&S(e,n.props),x(e),A(e,o))}},_=r.defineComponent(b),p=new WeakMap,L={open(e={}){var a,i,c;const o=e.target||document.body;if(p.has(o))return p.get(o);o.style&&(o.style.position=e.positionType);const n=document.body===o;e={...new m,...e};const t=w(_,{...e,isFull:n},e.loadingTemplateRef?()=>e.loadingTemplateRef:null);p.set(o,t),(a=t==null?void 0:t.proxy)==null||a.open(),o.appendChild((i=t==null?void 0:t.proxy)==null?void 0:i.$el);const s=(c=t==null?void 0:t.proxy)==null?void 0:c.close;return t&&(t.loadingInstance=t==null?void 0:t.proxy,t.loadingInstance&&(t.loadingInstance.close=(...f)=>{p.delete(o),s==null||s(...f)})),t}};var $={title:"Loading \u52A0\u8F7D\u63D0\u793A",category:"\u53CD\u9988",status:"100%",install(e){e.directive("dLoading",V),e.config.globalProperties.$loadingService=L}};d.Loading=V,d.LoadingOptions=m,d.LoadingService=L,d.default=$,d.loadingProps=h,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/loading/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@keyframes devui-busy-spinner-anim{0%{transform:rotate(0) scale(1)}50%{transform:rotate(
|
|
1
|
+
@keyframes devui-busy-spinner-anim{0%{transform:rotate(0) scale(1)}50%{transform:rotate(180deg) scale(1.5)}to{transform:rotate(360deg) scale(1)}}.devui-loading__mask{position:absolute;left:0;right:0;bottom:0;top:0;background-color:var(--devui-line, #d7d8da);opacity:.3}.devui-loading__wrapper{text-align:center}.devui-loading--full{position:fixed;left:0;right:0;bottom:0;top:0;z-index:9999}.devui-loading--hidden{overflow:hidden}.devui-loading__text{margin-left:10px}.devui-loading__area{position:absolute;transform:translate(-50%,-50%);padding:12px 14px;background:var(--devui-base-bg, #ffffff);border-radius:var(--devui-border-radius-card, 6px)}.devui-loading__busy-default-spinner{position:relative;display:inline-block;width:15px;height:15px;animation:devui-busy-spinner-anim 1s linear infinite}.devui-loading__busy-default-spinner div{position:absolute;left:44.5%;top:37%;width:6px;height:6px;border-radius:50%}.devui-loading__busy-default-spinner .devui-loading__bar1{top:0;left:0;background:#5e7ce0;background:var(--devui-brand, #5e7ce0)}.devui-loading__busy-default-spinner .devui-loading__bar2{top:0;left:9px;background:#859bff;background:var(--devui-brand-foil, #859bff)}.devui-loading__busy-default-spinner .devui-loading__bar3{top:9px;left:0;background:#859bff;background:var(--devui-brand-foil, #859bff)}.devui-loading__busy-default-spinner .devui-loading__bar4{top:9px;left:9px;background:#5e7ce0;background:var(--devui-brand, #5e7ce0)}
|