vue-devui 1.0.0-beta.2 → 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 +163 -172
- package/alert/index.d.ts +7 -0
- package/alert/index.es.js +79 -51
- 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 +9053 -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 +154 -147
- 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 +46 -21
- 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 +5921 -146
- 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 +64 -36
- 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 +8122 -255
- 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/{cascader → 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 +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.d.ts +7 -0
- package/drawer/index.es.js +205 -154
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +736 -0
- package/dropdown/index.umd.js +1 -0
- package/{carousel → dropdown}/package.json +1 -1
- package/dropdown/style.css +1 -0
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +908 -461
- 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 +2439 -1995
- package/form/index.umd.js +29 -18
- package/form/style.css +1 -1
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +138 -125
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +271 -0
- package/grid/index.umd.js +1 -0
- package/{toast → grid}/package.json +1 -1
- package/grid/style.css +1 -0
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +200 -56
- 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 +154 -62
- 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 +8269 -145
- 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 +260 -191
- 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 +41 -26
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.d.ts +7 -0
- package/loading/index.es.js +89 -73
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/mention/index.d.ts +7 -0
- package/mention/index.es.js +8326 -0
- package/mention/index.umd.js +47 -0
- package/mention/package.json +7 -0
- package/mention/style.css +1 -0
- package/menu/index.d.ts +7 -0
- package/menu/index.es.js +891 -0
- package/menu/index.umd.js +1 -0
- package/{anchor → menu}/package.json +1 -1
- package/menu/style.css +1 -0
- package/message/index.d.ts +7 -0
- package/message/index.es.js +533 -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 +611 -877
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- 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/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/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/SubMenu.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/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/nuxt/index.js +13 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +245 -303
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +16 -84
- package/pagination/index.d.ts +7 -0
- package/pagination/index.es.js +333 -155
- 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 +48 -35
- 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 +6035 -204
- 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 +111 -57
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +8015 -182
- 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 +78 -56
- 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/{sticky → result}/package.json +1 -1
- package/result/style.css +1 -0
- package/ripple/index.d.ts +7 -0
- package/ripple/index.es.js +56 -61
- package/ripple/index.umd.js +1 -1
- package/search/index.d.ts +7 -0
- package/search/index.es.js +8381 -406
- package/search/index.umd.js +38 -1
- package/search/style.css +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +9331 -576
- 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 +115 -145
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.d.ts +7 -0
- package/slider/index.es.js +148 -142
- 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 +6308 -181
- 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 +29 -8
- 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 +7819 -65
- 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 +11435 -204
- package/table/index.umd.js +38 -1
- package/table/style.css +1 -1
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +356 -143
- 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 +7989 -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 +9126 -597
- package/time-picker/index.umd.js +38 -1
- package/time-picker/style.css +1 -1
- package/time-select/index.d.ts +7 -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/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 +5870 -141
- 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 +11504 -692
- 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 +968 -2748
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +22816 -16568
- package/vue-devui.umd.js +42 -20
- package/accordion/index.es.js +0 -190
- 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/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 -328
- package/carousel/index.umd.js +0 -1
- package/carousel/style.css +0 -1
- package/cascader/index.es.js +0 -187
- package/cascader/index.umd.js +0 -1
- package/cascader/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/nav-sprite/index.es.js +0 -742
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/quadrant-diagram/index.es.js +0 -489
- package/quadrant-diagram/index.umd.js +0 -1
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/steps-guide/index.es.js +0 -211
- 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.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/tag-input/index.es.js +0 -341
- 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.es.js +0 -79
- 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.es.js +0 -2059
- package/toast/index.umd.js +0 -1
- package/toast/style.css +0 -1
- package/transfer/index.es.js +0 -1446
- package/transfer/index.umd.js +0 -1
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree-select/index.es.js +0 -203
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
package/upload/index.es.js
CHANGED
|
@@ -1,2093 +1,560 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 __publicField = (obj, key, value) => {
|
|
21
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
-
return value;
|
|
23
|
-
};
|
|
24
|
-
import { defineComponent, createVNode, Fragment, getCurrentInstance, ref, computed, watch, nextTick, onUnmounted, mergeProps, createApp, toRefs, withDirectives, resolveComponent, createTextVNode, resolveDirective, isVNode } from "vue";
|
|
25
|
-
var toast = "";
|
|
26
|
-
const toastProps = {
|
|
27
|
-
value: {
|
|
28
|
-
type: Array,
|
|
29
|
-
required: true,
|
|
30
|
-
default: () => []
|
|
1
|
+
import { defineComponent, toRefs, computed, createVNode, resolveDynamicComponent, mergeProps, watch, Transition, reactive, createApp, onUnmounted, isVNode, ref, getCurrentInstance, withDirectives, resolveComponent, resolveDirective } from "vue";
|
|
2
|
+
const notificationProps = {
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: Boolean,
|
|
5
|
+
default: false
|
|
6
|
+
},
|
|
7
|
+
title: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: ""
|
|
10
|
+
},
|
|
11
|
+
type: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "normal"
|
|
31
14
|
},
|
|
32
|
-
|
|
15
|
+
duration: {
|
|
33
16
|
type: Number,
|
|
17
|
+
default: 3e3
|
|
18
|
+
},
|
|
19
|
+
onClose: {
|
|
20
|
+
type: Function
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const DEFAULT_PREFIX = "icon";
|
|
24
|
+
const iconProps = {
|
|
25
|
+
name: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "",
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
type: [Number, String],
|
|
32
|
+
default: "inherit"
|
|
33
|
+
},
|
|
34
|
+
color: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "inherit"
|
|
37
|
+
},
|
|
38
|
+
component: {
|
|
39
|
+
type: Object,
|
|
34
40
|
default: null
|
|
35
41
|
},
|
|
36
|
-
|
|
42
|
+
classPrefix: {
|
|
37
43
|
type: String,
|
|
38
|
-
default:
|
|
44
|
+
default: DEFAULT_PREFIX
|
|
39
45
|
},
|
|
40
|
-
|
|
46
|
+
operable: {
|
|
41
47
|
type: Boolean,
|
|
42
48
|
default: false
|
|
43
49
|
},
|
|
44
|
-
|
|
45
|
-
type:
|
|
46
|
-
default:
|
|
50
|
+
disabled: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
47
53
|
},
|
|
48
|
-
|
|
49
|
-
type: String
|
|
54
|
+
rotate: {
|
|
55
|
+
type: [Number, String]
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const svgIconProps = {
|
|
59
|
+
name: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: "",
|
|
62
|
+
required: true
|
|
50
63
|
},
|
|
51
|
-
|
|
52
|
-
type:
|
|
64
|
+
color: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "inherit"
|
|
53
67
|
},
|
|
54
|
-
|
|
55
|
-
type:
|
|
68
|
+
size: {
|
|
69
|
+
type: [Number, String],
|
|
70
|
+
default: "inherit"
|
|
56
71
|
}
|
|
57
72
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
function createBem(namespace, element, modifier) {
|
|
74
|
+
let cls = namespace;
|
|
75
|
+
if (element) {
|
|
76
|
+
cls += `__${element}`;
|
|
77
|
+
}
|
|
78
|
+
if (modifier) {
|
|
79
|
+
cls += `--${modifier}`;
|
|
80
|
+
}
|
|
81
|
+
return cls;
|
|
82
|
+
}
|
|
83
|
+
function useNamespace(block, needDot = false) {
|
|
84
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
85
|
+
const b = () => createBem(namespace);
|
|
86
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
87
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
88
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
89
|
+
return {
|
|
90
|
+
b,
|
|
91
|
+
e,
|
|
92
|
+
m,
|
|
93
|
+
em
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
var icon = "";
|
|
97
|
+
var svgIcon = defineComponent({
|
|
98
|
+
name: "DSvgIcon",
|
|
99
|
+
props: svgIconProps,
|
|
78
100
|
setup(props) {
|
|
79
|
-
return __spreadValues({}, props);
|
|
80
|
-
},
|
|
81
|
-
render() {
|
|
82
101
|
const {
|
|
83
102
|
name,
|
|
84
|
-
size,
|
|
85
103
|
color,
|
|
86
|
-
|
|
87
|
-
} =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
104
|
+
size
|
|
105
|
+
} = toRefs(props);
|
|
106
|
+
const ns2 = useNamespace("svg-icon");
|
|
107
|
+
const iconName = computed(() => `#icon-${name.value}`);
|
|
108
|
+
const iconSize = computed(() => {
|
|
109
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
110
|
+
});
|
|
111
|
+
const styles = {
|
|
112
|
+
width: iconSize.value,
|
|
113
|
+
height: iconSize.value
|
|
114
|
+
};
|
|
115
|
+
return () => {
|
|
116
|
+
return createVNode("svg", {
|
|
117
|
+
"class": ns2.b(),
|
|
118
|
+
"style": styles
|
|
119
|
+
}, [createVNode("use", {
|
|
120
|
+
"xlink:href": iconName.value,
|
|
121
|
+
"fill": color.value
|
|
122
|
+
}, null)]);
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
function isUrl(value) {
|
|
127
|
+
return /^((http|https):)?\/\//.test(value);
|
|
128
|
+
}
|
|
129
|
+
function useIconDom(props, ctx) {
|
|
130
|
+
const {
|
|
131
|
+
component,
|
|
132
|
+
name,
|
|
133
|
+
size,
|
|
134
|
+
color,
|
|
135
|
+
classPrefix,
|
|
136
|
+
rotate
|
|
137
|
+
} = toRefs(props);
|
|
138
|
+
const ns2 = useNamespace("icon");
|
|
139
|
+
const iconSize = computed(() => {
|
|
140
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
141
|
+
});
|
|
142
|
+
const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
|
|
143
|
+
const imgIconDom = () => {
|
|
144
|
+
return createVNode("img", mergeProps({
|
|
145
|
+
"src": name.value,
|
|
146
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
147
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
|
|
91
148
|
"style": {
|
|
92
|
-
width:
|
|
149
|
+
width: iconSize.value || "",
|
|
150
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`,
|
|
151
|
+
verticalAlign: "middle"
|
|
93
152
|
}
|
|
94
|
-
},
|
|
95
|
-
|
|
153
|
+
}, ctx.attrs), null);
|
|
154
|
+
};
|
|
155
|
+
const svgIconDom = () => {
|
|
156
|
+
return createVNode(IconComponent, mergeProps({
|
|
157
|
+
"name": name.value,
|
|
158
|
+
"color": color.value,
|
|
159
|
+
"size": iconSize.value,
|
|
160
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
|
|
96
161
|
"style": {
|
|
97
|
-
|
|
98
|
-
color
|
|
162
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
99
163
|
}
|
|
100
|
-
}, null)
|
|
164
|
+
}, ctx.attrs), null);
|
|
165
|
+
};
|
|
166
|
+
const fontIconDom = () => {
|
|
167
|
+
const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
|
|
168
|
+
return createVNode("i", mergeProps({
|
|
169
|
+
"class": [classPrefix.value, fontIconClass, (rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
|
|
170
|
+
"style": {
|
|
171
|
+
fontSize: iconSize.value,
|
|
172
|
+
color: color.value,
|
|
173
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
174
|
+
}
|
|
175
|
+
}, ctx.attrs), null);
|
|
176
|
+
};
|
|
177
|
+
const iconDom = () => {
|
|
178
|
+
return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
|
|
179
|
+
};
|
|
180
|
+
return {
|
|
181
|
+
iconDom
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
var Icon = defineComponent({
|
|
185
|
+
name: "DIcon",
|
|
186
|
+
props: iconProps,
|
|
187
|
+
emits: ["click"],
|
|
188
|
+
setup(props, ctx) {
|
|
189
|
+
const {
|
|
190
|
+
disabled,
|
|
191
|
+
operable
|
|
192
|
+
} = toRefs(props);
|
|
193
|
+
const {
|
|
194
|
+
iconDom
|
|
195
|
+
} = useIconDom(props, ctx);
|
|
196
|
+
const ns2 = useNamespace("icon");
|
|
197
|
+
const wrapClassed = computed(() => ({
|
|
198
|
+
[ns2.e("container")]: true,
|
|
199
|
+
[ns2.m("disabled")]: disabled.value,
|
|
200
|
+
[ns2.m("operable")]: operable.value
|
|
201
|
+
}));
|
|
202
|
+
const onClick = (e) => {
|
|
203
|
+
if (disabled.value) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
ctx.emit("click", e);
|
|
207
|
+
};
|
|
208
|
+
return () => {
|
|
209
|
+
var _a, _b, _c, _d;
|
|
210
|
+
return createVNode("div", {
|
|
211
|
+
"class": wrapClassed.value,
|
|
212
|
+
"onClick": onClick
|
|
213
|
+
}, [(_b = (_a = ctx.slots).prefix) == null ? void 0 : _b.call(_a), iconDom(), (_d = (_c = ctx.slots).suffix) == null ? void 0 : _d.call(_c)]);
|
|
214
|
+
};
|
|
101
215
|
}
|
|
102
216
|
});
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
217
|
+
var iconGroup = "";
|
|
218
|
+
defineComponent({
|
|
219
|
+
name: "DIconGroup",
|
|
220
|
+
setup(_, ctx) {
|
|
221
|
+
const ns2 = useNamespace("icon-group");
|
|
222
|
+
return () => {
|
|
223
|
+
var _a, _b;
|
|
224
|
+
return createVNode("div", {
|
|
225
|
+
"class": ns2.b()
|
|
226
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
var Close = defineComponent({
|
|
112
231
|
emits: ["click"],
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
"class": wrapperCls,
|
|
121
|
-
"onClick": (e) => $emit("click", e)
|
|
232
|
+
setup(props, {
|
|
233
|
+
emit
|
|
234
|
+
}) {
|
|
235
|
+
const ns2 = useNamespace("notification");
|
|
236
|
+
return () => createVNode("div", {
|
|
237
|
+
"class": ns2.e("icon-close"),
|
|
238
|
+
"onClick": (e) => emit("click", e)
|
|
122
239
|
}, [createVNode(Icon, {
|
|
123
240
|
"name": "close",
|
|
124
241
|
"size": "14px"
|
|
125
242
|
}, null)]);
|
|
126
243
|
}
|
|
127
244
|
});
|
|
128
|
-
|
|
129
|
-
|
|
245
|
+
const ns = useNamespace("notification");
|
|
246
|
+
const XLINK = {
|
|
247
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
248
|
+
};
|
|
249
|
+
const XLINK_HREF = {
|
|
250
|
+
"xlink:href": "#path-s"
|
|
251
|
+
};
|
|
252
|
+
function SuccessIcon() {
|
|
253
|
+
return createVNode("svg", mergeProps({
|
|
254
|
+
"width": "16px",
|
|
255
|
+
"height": "16px",
|
|
256
|
+
"viewBox": "0 0 16 16",
|
|
257
|
+
"version": "1.1",
|
|
258
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
259
|
+
}, XLINK), [createVNode("defs", null, [createVNode("polygon", {
|
|
260
|
+
"id": "path-s",
|
|
261
|
+
"points": "6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459"
|
|
262
|
+
}, null)]), createVNode("g", {
|
|
263
|
+
"id": "correct",
|
|
264
|
+
"stroke": "none",
|
|
265
|
+
"stroke-width": "1",
|
|
266
|
+
"fill": "none",
|
|
267
|
+
"fill-rule": "evenodd"
|
|
268
|
+
}, [createVNode("mask", {
|
|
269
|
+
"id": "mask-2",
|
|
270
|
+
"fill": "white"
|
|
271
|
+
}, [createVNode("use", XLINK_HREF, null)]), createVNode("use", mergeProps({
|
|
272
|
+
"id": "Mask",
|
|
273
|
+
"class": ns.e("image-success-path")
|
|
274
|
+
}, XLINK_HREF), null)])]);
|
|
275
|
+
}
|
|
276
|
+
function WarningIcon() {
|
|
277
|
+
return createVNode("svg", mergeProps({
|
|
278
|
+
"width": "16px",
|
|
279
|
+
"height": "16px",
|
|
280
|
+
"viewBox": "0 0 16 16",
|
|
281
|
+
"version": "1.1",
|
|
282
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
283
|
+
}, XLINK), [createVNode("g", {
|
|
284
|
+
"stroke": "none",
|
|
285
|
+
"stroke-width": "1",
|
|
286
|
+
"fill": "none",
|
|
287
|
+
"fill-rule": "evenodd"
|
|
288
|
+
}, [createVNode("path", {
|
|
289
|
+
"class": ns.e("warning-outer"),
|
|
290
|
+
"d": "M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506, 15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049, 0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071, 0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"
|
|
291
|
+
}, null), createVNode("path", {
|
|
292
|
+
"class": ns.e("warning-inner"),
|
|
293
|
+
"stroke-width": "0.3",
|
|
294
|
+
"fill-rule": "nonzero",
|
|
295
|
+
"d": "M8.87894737,13 L7.08947368,13 L7.08947368,11.2105263 L8.87894737,11.2105263 L8.87894737,13 Z M8.62102372,9.86842105 L7.32800539,9.86842105 L7,4.5 L8.96842105,4.5 L8.62102372,9.86842105 Z"
|
|
296
|
+
}, null)])]);
|
|
297
|
+
}
|
|
298
|
+
function InfoIcon() {
|
|
299
|
+
return createVNode("svg", mergeProps({
|
|
300
|
+
"width": "16px",
|
|
301
|
+
"height": "16px",
|
|
302
|
+
"viewBox": "0 0 16 16",
|
|
303
|
+
"version": "1.1",
|
|
304
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
305
|
+
}, XLINK), [createVNode("g", {
|
|
306
|
+
"id": "info",
|
|
307
|
+
"stroke": "none",
|
|
308
|
+
"stroke-width": "1",
|
|
309
|
+
"fill": "none",
|
|
310
|
+
"fill-rule": "evenodd"
|
|
311
|
+
}, [createVNode("path", {
|
|
312
|
+
"class": ns.e("image-info-path"),
|
|
313
|
+
"d": "M7,13 L7,6 L9,6 L9,13 L7,13 Z M7,5 L7,3 L9,3 L9,5 L7,5 Z",
|
|
314
|
+
"id": "info"
|
|
315
|
+
}, null)])]);
|
|
316
|
+
}
|
|
317
|
+
function ErrorIcon() {
|
|
318
|
+
return createVNode("svg", mergeProps({
|
|
319
|
+
"width": "16px",
|
|
320
|
+
"height": "16px",
|
|
321
|
+
"viewBox": "0 0 16 16",
|
|
322
|
+
"version": "1.1",
|
|
323
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
324
|
+
}, XLINK), [createVNode("defs", null, [createVNode("polygon", {
|
|
325
|
+
"id": "path-e",
|
|
326
|
+
"points": "8.07106781 6.65685425 10.8994949 3.82842712 12.3137085 5.24264069 9.48528137 8.07106781 12.3137085 10.8994949 10.8994949 12.3137085 8.07106781 9.48528137 5.24264069 12.3137085 3.82842712 10.8994949 6.65685425 8.07106781 3.82842712 5.24264069 5.24264069 3.82842712"
|
|
327
|
+
}, null)]), createVNode("g", {
|
|
328
|
+
"id": "error",
|
|
329
|
+
"stroke": "none",
|
|
330
|
+
"stroke-width": "1",
|
|
331
|
+
"fill": "none",
|
|
332
|
+
"fill-rule": "evenodd"
|
|
333
|
+
}, [createVNode("mask", {
|
|
334
|
+
"id": "mask-2",
|
|
335
|
+
"fill": "white"
|
|
336
|
+
}, [createVNode("use", XLINK_HREF, null)]), createVNode("use", mergeProps({
|
|
337
|
+
"id": "Mask",
|
|
338
|
+
"class": ns.e("image-error-path")
|
|
339
|
+
}, XLINK_HREF), null)])]);
|
|
340
|
+
}
|
|
341
|
+
var TypeIcon = defineComponent({
|
|
130
342
|
props: {
|
|
131
|
-
|
|
132
|
-
|
|
343
|
+
type: {
|
|
344
|
+
type: String,
|
|
345
|
+
default: "normal"
|
|
346
|
+
}
|
|
133
347
|
},
|
|
134
|
-
|
|
348
|
+
setup(props) {
|
|
135
349
|
const {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
};
|
|
146
|
-
const showIcon = () => severity !== "common";
|
|
147
|
-
return createVNode("span", {
|
|
148
|
-
"class": wrapperCls
|
|
149
|
-
}, [showIcon() ? createVNode(Icon, {
|
|
150
|
-
"name": severityIconMap[severity],
|
|
151
|
-
"size": "14px"
|
|
152
|
-
}, null) : null]);
|
|
350
|
+
type
|
|
351
|
+
} = toRefs(props);
|
|
352
|
+
const ns2 = useNamespace("notification");
|
|
353
|
+
const classes = computed(() => ({
|
|
354
|
+
[ns2.e("image")]: true,
|
|
355
|
+
[ns2.em("image", type.value)]: true
|
|
356
|
+
}));
|
|
357
|
+
return () => createVNode("span", {
|
|
358
|
+
"class": classes.value
|
|
359
|
+
}, [type.value && type.value !== "normal" && (type.value === "success" && createVNode(SuccessIcon, null, null) || type.value === "info" && createVNode(InfoIcon, null, null) || type.value === "warning" && createVNode(WarningIcon, null, null) || type.value === "error" && createVNode(ErrorIcon, null, null))]);
|
|
153
360
|
}
|
|
154
361
|
});
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
} catch (e) {
|
|
172
|
-
}
|
|
173
|
-
var result = nativeObjectToString$1.call(value);
|
|
174
|
-
if (unmasked) {
|
|
175
|
-
if (isOwn) {
|
|
176
|
-
value[symToStringTag$1] = tag;
|
|
177
|
-
} else {
|
|
178
|
-
delete value[symToStringTag$1];
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return result;
|
|
182
|
-
}
|
|
183
|
-
var objectProto$e = Object.prototype;
|
|
184
|
-
var nativeObjectToString = objectProto$e.toString;
|
|
185
|
-
function objectToString(value) {
|
|
186
|
-
return nativeObjectToString.call(value);
|
|
187
|
-
}
|
|
188
|
-
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
|
189
|
-
var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
|
|
190
|
-
function baseGetTag(value) {
|
|
191
|
-
if (value == null) {
|
|
192
|
-
return value === void 0 ? undefinedTag : nullTag;
|
|
193
|
-
}
|
|
194
|
-
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
195
|
-
}
|
|
196
|
-
function isObjectLike(value) {
|
|
197
|
-
return value != null && typeof value == "object";
|
|
198
|
-
}
|
|
199
|
-
var symbolTag$3 = "[object Symbol]";
|
|
200
|
-
function isSymbol(value) {
|
|
201
|
-
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$3;
|
|
202
|
-
}
|
|
203
|
-
function arrayMap(array, iteratee) {
|
|
204
|
-
var index2 = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
205
|
-
while (++index2 < length) {
|
|
206
|
-
result[index2] = iteratee(array[index2], index2, array);
|
|
207
|
-
}
|
|
208
|
-
return result;
|
|
209
|
-
}
|
|
210
|
-
var isArray = Array.isArray;
|
|
211
|
-
var isArray$1 = isArray;
|
|
212
|
-
var INFINITY$1 = 1 / 0;
|
|
213
|
-
var symbolProto$2 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$2 ? symbolProto$2.toString : void 0;
|
|
214
|
-
function baseToString(value) {
|
|
215
|
-
if (typeof value == "string") {
|
|
216
|
-
return value;
|
|
217
|
-
}
|
|
218
|
-
if (isArray$1(value)) {
|
|
219
|
-
return arrayMap(value, baseToString) + "";
|
|
220
|
-
}
|
|
221
|
-
if (isSymbol(value)) {
|
|
222
|
-
return symbolToString ? symbolToString.call(value) : "";
|
|
223
|
-
}
|
|
224
|
-
var result = value + "";
|
|
225
|
-
return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
|
|
226
|
-
}
|
|
227
|
-
var reWhitespace = /\s/;
|
|
228
|
-
function trimmedEndIndex(string) {
|
|
229
|
-
var index2 = string.length;
|
|
230
|
-
while (index2-- && reWhitespace.test(string.charAt(index2))) {
|
|
231
|
-
}
|
|
232
|
-
return index2;
|
|
233
|
-
}
|
|
234
|
-
var reTrimStart = /^\s+/;
|
|
235
|
-
function baseTrim(string) {
|
|
236
|
-
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
237
|
-
}
|
|
238
|
-
function isObject(value) {
|
|
239
|
-
var type = typeof value;
|
|
240
|
-
return value != null && (type == "object" || type == "function");
|
|
241
|
-
}
|
|
242
|
-
var NAN = 0 / 0;
|
|
243
|
-
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
244
|
-
var reIsBinary = /^0b[01]+$/i;
|
|
245
|
-
var reIsOctal = /^0o[0-7]+$/i;
|
|
246
|
-
var freeParseInt = parseInt;
|
|
247
|
-
function toNumber(value) {
|
|
248
|
-
if (typeof value == "number") {
|
|
249
|
-
return value;
|
|
250
|
-
}
|
|
251
|
-
if (isSymbol(value)) {
|
|
252
|
-
return NAN;
|
|
253
|
-
}
|
|
254
|
-
if (isObject(value)) {
|
|
255
|
-
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
256
|
-
value = isObject(other) ? other + "" : other;
|
|
257
|
-
}
|
|
258
|
-
if (typeof value != "string") {
|
|
259
|
-
return value === 0 ? value : +value;
|
|
260
|
-
}
|
|
261
|
-
value = baseTrim(value);
|
|
262
|
-
var isBinary = reIsBinary.test(value);
|
|
263
|
-
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
264
|
-
}
|
|
265
|
-
function identity(value) {
|
|
266
|
-
return value;
|
|
267
|
-
}
|
|
268
|
-
var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
|
|
269
|
-
function isFunction(value) {
|
|
270
|
-
if (!isObject(value)) {
|
|
271
|
-
return false;
|
|
272
|
-
}
|
|
273
|
-
var tag = baseGetTag(value);
|
|
274
|
-
return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
|
|
275
|
-
}
|
|
276
|
-
var coreJsData = root$1["__core-js_shared__"];
|
|
277
|
-
var coreJsData$1 = coreJsData;
|
|
278
|
-
var maskSrcKey = function() {
|
|
279
|
-
var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || "");
|
|
280
|
-
return uid ? "Symbol(src)_1." + uid : "";
|
|
281
|
-
}();
|
|
282
|
-
function isMasked(func) {
|
|
283
|
-
return !!maskSrcKey && maskSrcKey in func;
|
|
284
|
-
}
|
|
285
|
-
var funcProto$2 = Function.prototype;
|
|
286
|
-
var funcToString$2 = funcProto$2.toString;
|
|
287
|
-
function toSource(func) {
|
|
288
|
-
if (func != null) {
|
|
289
|
-
try {
|
|
290
|
-
return funcToString$2.call(func);
|
|
291
|
-
} catch (e) {
|
|
292
|
-
}
|
|
293
|
-
try {
|
|
294
|
-
return func + "";
|
|
295
|
-
} catch (e) {
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
return "";
|
|
299
|
-
}
|
|
300
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
301
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
302
|
-
var funcProto$1 = Function.prototype, objectProto$d = Object.prototype;
|
|
303
|
-
var funcToString$1 = funcProto$1.toString;
|
|
304
|
-
var hasOwnProperty$b = objectProto$d.hasOwnProperty;
|
|
305
|
-
var reIsNative = RegExp("^" + funcToString$1.call(hasOwnProperty$b).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
306
|
-
function baseIsNative(value) {
|
|
307
|
-
if (!isObject(value) || isMasked(value)) {
|
|
308
|
-
return false;
|
|
309
|
-
}
|
|
310
|
-
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
311
|
-
return pattern.test(toSource(value));
|
|
312
|
-
}
|
|
313
|
-
function getValue(object, key) {
|
|
314
|
-
return object == null ? void 0 : object[key];
|
|
315
|
-
}
|
|
316
|
-
function getNative(object, key) {
|
|
317
|
-
var value = getValue(object, key);
|
|
318
|
-
return baseIsNative(value) ? value : void 0;
|
|
319
|
-
}
|
|
320
|
-
var WeakMap = getNative(root$1, "WeakMap");
|
|
321
|
-
var WeakMap$1 = WeakMap;
|
|
322
|
-
var objectCreate = Object.create;
|
|
323
|
-
var baseCreate = function() {
|
|
324
|
-
function object() {
|
|
325
|
-
}
|
|
326
|
-
return function(proto) {
|
|
327
|
-
if (!isObject(proto)) {
|
|
328
|
-
return {};
|
|
329
|
-
}
|
|
330
|
-
if (objectCreate) {
|
|
331
|
-
return objectCreate(proto);
|
|
332
|
-
}
|
|
333
|
-
object.prototype = proto;
|
|
334
|
-
var result = new object();
|
|
335
|
-
object.prototype = void 0;
|
|
336
|
-
return result;
|
|
362
|
+
function useNotification(props) {
|
|
363
|
+
const classes = computed(() => ({
|
|
364
|
+
"devui-notification-item-container": true,
|
|
365
|
+
[`devui-notification-message-${props.type}`]: true
|
|
366
|
+
}));
|
|
367
|
+
return { classes };
|
|
368
|
+
}
|
|
369
|
+
function useEvent(props, emit) {
|
|
370
|
+
let timer = null;
|
|
371
|
+
let timestamp;
|
|
372
|
+
const close2 = () => {
|
|
373
|
+
var _a;
|
|
374
|
+
timer && clearTimeout(timer);
|
|
375
|
+
timer = null;
|
|
376
|
+
(_a = props.onClose) == null ? void 0 : _a.call(props);
|
|
377
|
+
emit("update:modelValue", false);
|
|
337
378
|
};
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
case 0:
|
|
343
|
-
return func.call(thisArg);
|
|
344
|
-
case 1:
|
|
345
|
-
return func.call(thisArg, args[0]);
|
|
346
|
-
case 2:
|
|
347
|
-
return func.call(thisArg, args[0], args[1]);
|
|
348
|
-
case 3:
|
|
349
|
-
return func.call(thisArg, args[0], args[1], args[2]);
|
|
350
|
-
}
|
|
351
|
-
return func.apply(thisArg, args);
|
|
352
|
-
}
|
|
353
|
-
function copyArray(source, array) {
|
|
354
|
-
var index2 = -1, length = source.length;
|
|
355
|
-
array || (array = Array(length));
|
|
356
|
-
while (++index2 < length) {
|
|
357
|
-
array[index2] = source[index2];
|
|
358
|
-
}
|
|
359
|
-
return array;
|
|
360
|
-
}
|
|
361
|
-
var HOT_COUNT = 800, HOT_SPAN = 16;
|
|
362
|
-
var nativeNow = Date.now;
|
|
363
|
-
function shortOut(func) {
|
|
364
|
-
var count = 0, lastCalled = 0;
|
|
365
|
-
return function() {
|
|
366
|
-
var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
|
|
367
|
-
lastCalled = stamp;
|
|
368
|
-
if (remaining > 0) {
|
|
369
|
-
if (++count >= HOT_COUNT) {
|
|
370
|
-
return arguments[0];
|
|
371
|
-
}
|
|
372
|
-
} else {
|
|
373
|
-
count = 0;
|
|
379
|
+
const interrupt = () => {
|
|
380
|
+
if (timer) {
|
|
381
|
+
clearTimeout(timer);
|
|
382
|
+
timer = null;
|
|
374
383
|
}
|
|
375
|
-
return func.apply(void 0, arguments);
|
|
376
384
|
};
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
var defineProperty = function() {
|
|
384
|
-
try {
|
|
385
|
-
var func = getNative(Object, "defineProperty");
|
|
386
|
-
func({}, "", {});
|
|
387
|
-
return func;
|
|
388
|
-
} catch (e) {
|
|
389
|
-
}
|
|
390
|
-
}();
|
|
391
|
-
var defineProperty$1 = defineProperty;
|
|
392
|
-
var baseSetToString = !defineProperty$1 ? identity : function(func, string) {
|
|
393
|
-
return defineProperty$1(func, "toString", {
|
|
394
|
-
"configurable": true,
|
|
395
|
-
"enumerable": false,
|
|
396
|
-
"value": constant(string),
|
|
397
|
-
"writable": true
|
|
398
|
-
});
|
|
399
|
-
};
|
|
400
|
-
var baseSetToString$1 = baseSetToString;
|
|
401
|
-
var setToString = shortOut(baseSetToString$1);
|
|
402
|
-
var setToString$1 = setToString;
|
|
403
|
-
function arrayEach(array, iteratee) {
|
|
404
|
-
var index2 = -1, length = array == null ? 0 : array.length;
|
|
405
|
-
while (++index2 < length) {
|
|
406
|
-
if (iteratee(array[index2], index2, array) === false) {
|
|
407
|
-
break;
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
return array;
|
|
411
|
-
}
|
|
412
|
-
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
413
|
-
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
414
|
-
function isIndex(value, length) {
|
|
415
|
-
var type = typeof value;
|
|
416
|
-
length = length == null ? MAX_SAFE_INTEGER$1 : length;
|
|
417
|
-
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
418
|
-
}
|
|
419
|
-
function baseAssignValue(object, key, value) {
|
|
420
|
-
if (key == "__proto__" && defineProperty$1) {
|
|
421
|
-
defineProperty$1(object, key, {
|
|
422
|
-
"configurable": true,
|
|
423
|
-
"enumerable": true,
|
|
424
|
-
"value": value,
|
|
425
|
-
"writable": true
|
|
426
|
-
});
|
|
427
|
-
} else {
|
|
428
|
-
object[key] = value;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
function eq(value, other) {
|
|
432
|
-
return value === other || value !== value && other !== other;
|
|
433
|
-
}
|
|
434
|
-
var objectProto$c = Object.prototype;
|
|
435
|
-
var hasOwnProperty$a = objectProto$c.hasOwnProperty;
|
|
436
|
-
function assignValue(object, key, value) {
|
|
437
|
-
var objValue = object[key];
|
|
438
|
-
if (!(hasOwnProperty$a.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
|
|
439
|
-
baseAssignValue(object, key, value);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
function copyObject(source, props, object, customizer) {
|
|
443
|
-
var isNew = !object;
|
|
444
|
-
object || (object = {});
|
|
445
|
-
var index2 = -1, length = props.length;
|
|
446
|
-
while (++index2 < length) {
|
|
447
|
-
var key = props[index2];
|
|
448
|
-
var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
|
|
449
|
-
if (newValue === void 0) {
|
|
450
|
-
newValue = source[key];
|
|
451
|
-
}
|
|
452
|
-
if (isNew) {
|
|
453
|
-
baseAssignValue(object, key, newValue);
|
|
454
|
-
} else {
|
|
455
|
-
assignValue(object, key, newValue);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
return object;
|
|
459
|
-
}
|
|
460
|
-
var nativeMax$1 = Math.max;
|
|
461
|
-
function overRest(func, start, transform) {
|
|
462
|
-
start = nativeMax$1(start === void 0 ? func.length - 1 : start, 0);
|
|
463
|
-
return function() {
|
|
464
|
-
var args = arguments, index2 = -1, length = nativeMax$1(args.length - start, 0), array = Array(length);
|
|
465
|
-
while (++index2 < length) {
|
|
466
|
-
array[index2] = args[start + index2];
|
|
385
|
+
const removeReset = () => {
|
|
386
|
+
if (!props.modelValue) {
|
|
387
|
+
const remainTime = props.duration - (Date.now() - timestamp);
|
|
388
|
+
timer = setTimeout(close2, remainTime);
|
|
467
389
|
}
|
|
468
|
-
index2 = -1;
|
|
469
|
-
var otherArgs = Array(start + 1);
|
|
470
|
-
while (++index2 < start) {
|
|
471
|
-
otherArgs[index2] = args[index2];
|
|
472
|
-
}
|
|
473
|
-
otherArgs[start] = transform(array);
|
|
474
|
-
return apply(func, this, otherArgs);
|
|
475
390
|
};
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
function isArrayLike(value) {
|
|
485
|
-
return value != null && isLength(value.length) && !isFunction(value);
|
|
486
|
-
}
|
|
487
|
-
function isIterateeCall(value, index2, object) {
|
|
488
|
-
if (!isObject(object)) {
|
|
489
|
-
return false;
|
|
490
|
-
}
|
|
491
|
-
var type = typeof index2;
|
|
492
|
-
if (type == "number" ? isArrayLike(object) && isIndex(index2, object.length) : type == "string" && index2 in object) {
|
|
493
|
-
return eq(object[index2], value);
|
|
494
|
-
}
|
|
495
|
-
return false;
|
|
496
|
-
}
|
|
497
|
-
function createAssigner(assigner) {
|
|
498
|
-
return baseRest(function(object, sources) {
|
|
499
|
-
var index2 = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
|
|
500
|
-
customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
|
|
501
|
-
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
|
502
|
-
customizer = length < 3 ? void 0 : customizer;
|
|
503
|
-
length = 1;
|
|
504
|
-
}
|
|
505
|
-
object = Object(object);
|
|
506
|
-
while (++index2 < length) {
|
|
507
|
-
var source = sources[index2];
|
|
508
|
-
if (source) {
|
|
509
|
-
assigner(object, source, index2, customizer);
|
|
391
|
+
const handleDestroy = () => {
|
|
392
|
+
emit("destroy");
|
|
393
|
+
};
|
|
394
|
+
watch(() => props.modelValue, (val) => {
|
|
395
|
+
if (val) {
|
|
396
|
+
timestamp = Date.now();
|
|
397
|
+
if (props.duration) {
|
|
398
|
+
timer = setTimeout(close2, props.duration);
|
|
510
399
|
}
|
|
511
400
|
}
|
|
512
|
-
return object;
|
|
513
401
|
});
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
402
|
+
return { interrupt, removeReset, close: close2, handleDestroy };
|
|
403
|
+
}
|
|
404
|
+
var notification = "";
|
|
405
|
+
var Notification = defineComponent({
|
|
406
|
+
name: "DNotification",
|
|
407
|
+
props: notificationProps,
|
|
408
|
+
emits: ["update:modelValue", "destroy"],
|
|
409
|
+
setup(props, {
|
|
410
|
+
emit,
|
|
411
|
+
slots
|
|
412
|
+
}) {
|
|
413
|
+
const {
|
|
414
|
+
modelValue,
|
|
415
|
+
title,
|
|
416
|
+
type
|
|
417
|
+
} = toRefs(props);
|
|
418
|
+
const {
|
|
419
|
+
classes
|
|
420
|
+
} = useNotification(props);
|
|
421
|
+
const {
|
|
422
|
+
interrupt,
|
|
423
|
+
removeReset,
|
|
424
|
+
close: close2,
|
|
425
|
+
handleDestroy
|
|
426
|
+
} = useEvent(props, emit);
|
|
427
|
+
const ns2 = useNamespace("notification");
|
|
428
|
+
return () => createVNode(Transition, {
|
|
429
|
+
"name": "notification-fade",
|
|
430
|
+
"onAfterLeave": handleDestroy
|
|
431
|
+
}, {
|
|
432
|
+
default: () => {
|
|
433
|
+
var _a;
|
|
434
|
+
return [modelValue.value && createVNode("div", {
|
|
435
|
+
"class": ns2.b()
|
|
436
|
+
}, [createVNode("div", {
|
|
437
|
+
"class": classes.value,
|
|
438
|
+
"onMouseenter": interrupt,
|
|
439
|
+
"onMouseleave": removeReset
|
|
440
|
+
}, [createVNode("div", {
|
|
441
|
+
"class": ns2.e("item")
|
|
442
|
+
}, [createVNode(Close, {
|
|
443
|
+
"onClick": close2
|
|
444
|
+
}, null), title.value && createVNode(TypeIcon, {
|
|
445
|
+
"type": type.value
|
|
446
|
+
}, null), createVNode("div", {
|
|
447
|
+
"class": ns2.e("message")
|
|
448
|
+
}, [createVNode("span", {
|
|
449
|
+
"class": ns2.e("title")
|
|
450
|
+
}, [title.value]), createVNode("span", {
|
|
451
|
+
"class": ns2.e("content")
|
|
452
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)])])])])])];
|
|
453
|
+
}
|
|
454
|
+
});
|
|
524
455
|
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
function baseIsArguments(value) {
|
|
529
|
-
return isObjectLike(value) && baseGetTag(value) == argsTag$3;
|
|
456
|
+
});
|
|
457
|
+
function _isSlot(s) {
|
|
458
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
530
459
|
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
return arguments;
|
|
536
|
-
}()) ? baseIsArguments : function(value) {
|
|
537
|
-
return isObjectLike(value) && hasOwnProperty$9.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
|
|
460
|
+
const defaultOptions = {
|
|
461
|
+
modelValue: false,
|
|
462
|
+
duration: 3e3,
|
|
463
|
+
type: "normal"
|
|
538
464
|
};
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
}
|
|
563
|
-
var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
564
|
-
var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
|
|
565
|
-
var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
|
|
566
|
-
var freeProcess = moduleExports$1 && freeGlobal$1.process;
|
|
567
|
-
var nodeUtil = function() {
|
|
568
|
-
try {
|
|
569
|
-
var types = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types;
|
|
570
|
-
if (types) {
|
|
571
|
-
return types;
|
|
572
|
-
}
|
|
573
|
-
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
574
|
-
} catch (e) {
|
|
575
|
-
}
|
|
576
|
-
}();
|
|
577
|
-
var nodeUtil$1 = nodeUtil;
|
|
578
|
-
var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
|
|
579
|
-
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
580
|
-
var isTypedArray$1 = isTypedArray;
|
|
581
|
-
var objectProto$9 = Object.prototype;
|
|
582
|
-
var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
|
|
583
|
-
function arrayLikeKeys(value, inherited) {
|
|
584
|
-
var isArr = isArray$1(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
585
|
-
for (var key in value) {
|
|
586
|
-
if ((inherited || hasOwnProperty$8.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
|
|
587
|
-
result.push(key);
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
return result;
|
|
591
|
-
}
|
|
592
|
-
function overArg(func, transform) {
|
|
593
|
-
return function(arg) {
|
|
594
|
-
return func(transform(arg));
|
|
595
|
-
};
|
|
596
|
-
}
|
|
597
|
-
var nativeKeys = overArg(Object.keys, Object);
|
|
598
|
-
var nativeKeys$1 = nativeKeys;
|
|
599
|
-
var objectProto$8 = Object.prototype;
|
|
600
|
-
var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
|
|
601
|
-
function baseKeys(object) {
|
|
602
|
-
if (!isPrototype(object)) {
|
|
603
|
-
return nativeKeys$1(object);
|
|
604
|
-
}
|
|
605
|
-
var result = [];
|
|
606
|
-
for (var key in Object(object)) {
|
|
607
|
-
if (hasOwnProperty$7.call(object, key) && key != "constructor") {
|
|
608
|
-
result.push(key);
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
return result;
|
|
612
|
-
}
|
|
613
|
-
function keys(object) {
|
|
614
|
-
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
615
|
-
}
|
|
616
|
-
function nativeKeysIn(object) {
|
|
617
|
-
var result = [];
|
|
618
|
-
if (object != null) {
|
|
619
|
-
for (var key in Object(object)) {
|
|
620
|
-
result.push(key);
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
return result;
|
|
624
|
-
}
|
|
625
|
-
var objectProto$7 = Object.prototype;
|
|
626
|
-
var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
|
|
627
|
-
function baseKeysIn(object) {
|
|
628
|
-
if (!isObject(object)) {
|
|
629
|
-
return nativeKeysIn(object);
|
|
630
|
-
}
|
|
631
|
-
var isProto = isPrototype(object), result = [];
|
|
632
|
-
for (var key in object) {
|
|
633
|
-
if (!(key == "constructor" && (isProto || !hasOwnProperty$6.call(object, key)))) {
|
|
634
|
-
result.push(key);
|
|
465
|
+
function initInstance(props, content) {
|
|
466
|
+
const container = document.createElement("div");
|
|
467
|
+
container.classList.add("notification__warpper");
|
|
468
|
+
const lastChild = document.body.lastElementChild;
|
|
469
|
+
let offset_Top = 50;
|
|
470
|
+
if (lastChild == null ? void 0 : lastChild.classList.contains("notification__warpper")) {
|
|
471
|
+
const notification2 = lastChild.lastElementChild;
|
|
472
|
+
const rects = notification2.getBoundingClientRect();
|
|
473
|
+
const height = rects.height;
|
|
474
|
+
const top = rects.top;
|
|
475
|
+
offset_Top = height + top;
|
|
476
|
+
}
|
|
477
|
+
const app = createApp({
|
|
478
|
+
setup() {
|
|
479
|
+
onUnmounted(() => {
|
|
480
|
+
document.body.removeChild(container);
|
|
481
|
+
});
|
|
482
|
+
return () => createVNode(Notification, mergeProps(props, {
|
|
483
|
+
"onDestroy": app.unmount,
|
|
484
|
+
"style": [`top: ${offset_Top}px`]
|
|
485
|
+
}), _isSlot(content) ? content : {
|
|
486
|
+
default: () => [content]
|
|
487
|
+
});
|
|
635
488
|
}
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
}
|
|
664
|
-
var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
|
|
665
|
-
var objectProto$6 = Object.prototype;
|
|
666
|
-
var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
|
|
667
|
-
function hashGet(key) {
|
|
668
|
-
var data = this.__data__;
|
|
669
|
-
if (nativeCreate$1) {
|
|
670
|
-
var result = data[key];
|
|
671
|
-
return result === HASH_UNDEFINED$2 ? void 0 : result;
|
|
672
|
-
}
|
|
673
|
-
return hasOwnProperty$5.call(data, key) ? data[key] : void 0;
|
|
674
|
-
}
|
|
675
|
-
var objectProto$5 = Object.prototype;
|
|
676
|
-
var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
|
|
677
|
-
function hashHas(key) {
|
|
678
|
-
var data = this.__data__;
|
|
679
|
-
return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$4.call(data, key);
|
|
680
|
-
}
|
|
681
|
-
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
|
682
|
-
function hashSet(key, value) {
|
|
683
|
-
var data = this.__data__;
|
|
684
|
-
this.size += this.has(key) ? 0 : 1;
|
|
685
|
-
data[key] = nativeCreate$1 && value === void 0 ? HASH_UNDEFINED$1 : value;
|
|
686
|
-
return this;
|
|
687
|
-
}
|
|
688
|
-
function Hash(entries) {
|
|
689
|
-
var index2 = -1, length = entries == null ? 0 : entries.length;
|
|
690
|
-
this.clear();
|
|
691
|
-
while (++index2 < length) {
|
|
692
|
-
var entry = entries[index2];
|
|
693
|
-
this.set(entry[0], entry[1]);
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
Hash.prototype.clear = hashClear;
|
|
697
|
-
Hash.prototype["delete"] = hashDelete;
|
|
698
|
-
Hash.prototype.get = hashGet;
|
|
699
|
-
Hash.prototype.has = hashHas;
|
|
700
|
-
Hash.prototype.set = hashSet;
|
|
701
|
-
function listCacheClear() {
|
|
702
|
-
this.__data__ = [];
|
|
703
|
-
this.size = 0;
|
|
704
|
-
}
|
|
705
|
-
function assocIndexOf(array, key) {
|
|
706
|
-
var length = array.length;
|
|
707
|
-
while (length--) {
|
|
708
|
-
if (eq(array[length][0], key)) {
|
|
709
|
-
return length;
|
|
489
|
+
});
|
|
490
|
+
document.body.appendChild(container);
|
|
491
|
+
app.mount(container);
|
|
492
|
+
return app;
|
|
493
|
+
}
|
|
494
|
+
function close(props, originOnClose) {
|
|
495
|
+
props.modelValue = false;
|
|
496
|
+
originOnClose == null ? void 0 : originOnClose();
|
|
497
|
+
}
|
|
498
|
+
class NotificationService {
|
|
499
|
+
static open(options) {
|
|
500
|
+
const originOnClose = options.onClose || null;
|
|
501
|
+
const content = options.content;
|
|
502
|
+
let timer;
|
|
503
|
+
delete options.content;
|
|
504
|
+
const props = reactive({
|
|
505
|
+
...defaultOptions,
|
|
506
|
+
...options,
|
|
507
|
+
onClose: () => {
|
|
508
|
+
close(props, originOnClose);
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
initInstance(props, content);
|
|
512
|
+
props.modelValue = true;
|
|
513
|
+
clearTimeout(timer);
|
|
514
|
+
if (options.duration && props.onClose) {
|
|
515
|
+
timer = setTimeout(props.onClose, options.duration);
|
|
710
516
|
}
|
|
711
517
|
}
|
|
712
|
-
return -1;
|
|
713
|
-
}
|
|
714
|
-
var arrayProto = Array.prototype;
|
|
715
|
-
var splice = arrayProto.splice;
|
|
716
|
-
function listCacheDelete(key) {
|
|
717
|
-
var data = this.__data__, index2 = assocIndexOf(data, key);
|
|
718
|
-
if (index2 < 0) {
|
|
719
|
-
return false;
|
|
720
|
-
}
|
|
721
|
-
var lastIndex = data.length - 1;
|
|
722
|
-
if (index2 == lastIndex) {
|
|
723
|
-
data.pop();
|
|
724
|
-
} else {
|
|
725
|
-
splice.call(data, index2, 1);
|
|
726
|
-
}
|
|
727
|
-
--this.size;
|
|
728
|
-
return true;
|
|
729
518
|
}
|
|
730
|
-
|
|
731
|
-
var data = this.__data__, index2 = assocIndexOf(data, key);
|
|
732
|
-
return index2 < 0 ? void 0 : data[index2][1];
|
|
519
|
+
class IUploadOptions {
|
|
733
520
|
}
|
|
734
|
-
|
|
735
|
-
return assocIndexOf(this.__data__, key) > -1;
|
|
521
|
+
class IFileOptions {
|
|
736
522
|
}
|
|
737
|
-
|
|
738
|
-
var data = this.__data__, index2 = assocIndexOf(data, key);
|
|
739
|
-
if (index2 < 0) {
|
|
740
|
-
++this.size;
|
|
741
|
-
data.push([key, value]);
|
|
742
|
-
} else {
|
|
743
|
-
data[index2][1] = value;
|
|
744
|
-
}
|
|
745
|
-
return this;
|
|
746
|
-
}
|
|
747
|
-
function ListCache(entries) {
|
|
748
|
-
var index2 = -1, length = entries == null ? 0 : entries.length;
|
|
749
|
-
this.clear();
|
|
750
|
-
while (++index2 < length) {
|
|
751
|
-
var entry = entries[index2];
|
|
752
|
-
this.set(entry[0], entry[1]);
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
ListCache.prototype.clear = listCacheClear;
|
|
756
|
-
ListCache.prototype["delete"] = listCacheDelete;
|
|
757
|
-
ListCache.prototype.get = listCacheGet;
|
|
758
|
-
ListCache.prototype.has = listCacheHas;
|
|
759
|
-
ListCache.prototype.set = listCacheSet;
|
|
760
|
-
var Map = getNative(root$1, "Map");
|
|
761
|
-
var Map$1 = Map;
|
|
762
|
-
function mapCacheClear() {
|
|
763
|
-
this.size = 0;
|
|
764
|
-
this.__data__ = {
|
|
765
|
-
"hash": new Hash(),
|
|
766
|
-
"map": new (Map$1 || ListCache)(),
|
|
767
|
-
"string": new Hash()
|
|
768
|
-
};
|
|
769
|
-
}
|
|
770
|
-
function isKeyable(value) {
|
|
771
|
-
var type = typeof value;
|
|
772
|
-
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
773
|
-
}
|
|
774
|
-
function getMapData(map, key) {
|
|
775
|
-
var data = map.__data__;
|
|
776
|
-
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
777
|
-
}
|
|
778
|
-
function mapCacheDelete(key) {
|
|
779
|
-
var result = getMapData(this, key)["delete"](key);
|
|
780
|
-
this.size -= result ? 1 : 0;
|
|
781
|
-
return result;
|
|
782
|
-
}
|
|
783
|
-
function mapCacheGet(key) {
|
|
784
|
-
return getMapData(this, key).get(key);
|
|
785
|
-
}
|
|
786
|
-
function mapCacheHas(key) {
|
|
787
|
-
return getMapData(this, key).has(key);
|
|
788
|
-
}
|
|
789
|
-
function mapCacheSet(key, value) {
|
|
790
|
-
var data = getMapData(this, key), size = data.size;
|
|
791
|
-
data.set(key, value);
|
|
792
|
-
this.size += data.size == size ? 0 : 1;
|
|
793
|
-
return this;
|
|
794
|
-
}
|
|
795
|
-
function MapCache(entries) {
|
|
796
|
-
var index2 = -1, length = entries == null ? 0 : entries.length;
|
|
797
|
-
this.clear();
|
|
798
|
-
while (++index2 < length) {
|
|
799
|
-
var entry = entries[index2];
|
|
800
|
-
this.set(entry[0], entry[1]);
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
MapCache.prototype.clear = mapCacheClear;
|
|
804
|
-
MapCache.prototype["delete"] = mapCacheDelete;
|
|
805
|
-
MapCache.prototype.get = mapCacheGet;
|
|
806
|
-
MapCache.prototype.has = mapCacheHas;
|
|
807
|
-
MapCache.prototype.set = mapCacheSet;
|
|
808
|
-
var FUNC_ERROR_TEXT$2 = "Expected a function";
|
|
809
|
-
function memoize(func, resolver) {
|
|
810
|
-
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
|
|
811
|
-
throw new TypeError(FUNC_ERROR_TEXT$2);
|
|
812
|
-
}
|
|
813
|
-
var memoized = function() {
|
|
814
|
-
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
815
|
-
if (cache.has(key)) {
|
|
816
|
-
return cache.get(key);
|
|
817
|
-
}
|
|
818
|
-
var result = func.apply(this, args);
|
|
819
|
-
memoized.cache = cache.set(key, result) || cache;
|
|
820
|
-
return result;
|
|
821
|
-
};
|
|
822
|
-
memoized.cache = new (memoize.Cache || MapCache)();
|
|
823
|
-
return memoized;
|
|
824
|
-
}
|
|
825
|
-
memoize.Cache = MapCache;
|
|
826
|
-
var MAX_MEMOIZE_SIZE = 500;
|
|
827
|
-
function memoizeCapped(func) {
|
|
828
|
-
var result = memoize(func, function(key) {
|
|
829
|
-
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
830
|
-
cache.clear();
|
|
831
|
-
}
|
|
832
|
-
return key;
|
|
833
|
-
});
|
|
834
|
-
var cache = result.cache;
|
|
835
|
-
return result;
|
|
836
|
-
}
|
|
837
|
-
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
838
|
-
var reEscapeChar = /\\(\\)?/g;
|
|
839
|
-
var stringToPath = memoizeCapped(function(string) {
|
|
840
|
-
var result = [];
|
|
841
|
-
if (string.charCodeAt(0) === 46) {
|
|
842
|
-
result.push("");
|
|
843
|
-
}
|
|
844
|
-
string.replace(rePropName, function(match, number, quote, subString) {
|
|
845
|
-
result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
|
|
846
|
-
});
|
|
847
|
-
return result;
|
|
848
|
-
});
|
|
849
|
-
var stringToPath$1 = stringToPath;
|
|
850
|
-
function toString(value) {
|
|
851
|
-
return value == null ? "" : baseToString(value);
|
|
852
|
-
}
|
|
853
|
-
function castPath(value, object) {
|
|
854
|
-
if (isArray$1(value)) {
|
|
855
|
-
return value;
|
|
856
|
-
}
|
|
857
|
-
return isKey(value, object) ? [value] : stringToPath$1(toString(value));
|
|
858
|
-
}
|
|
859
|
-
var INFINITY = 1 / 0;
|
|
860
|
-
function toKey(value) {
|
|
861
|
-
if (typeof value == "string" || isSymbol(value)) {
|
|
862
|
-
return value;
|
|
863
|
-
}
|
|
864
|
-
var result = value + "";
|
|
865
|
-
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
866
|
-
}
|
|
867
|
-
function baseGet(object, path) {
|
|
868
|
-
path = castPath(path, object);
|
|
869
|
-
var index2 = 0, length = path.length;
|
|
870
|
-
while (object != null && index2 < length) {
|
|
871
|
-
object = object[toKey(path[index2++])];
|
|
872
|
-
}
|
|
873
|
-
return index2 && index2 == length ? object : void 0;
|
|
874
|
-
}
|
|
875
|
-
function arrayPush(array, values) {
|
|
876
|
-
var index2 = -1, length = values.length, offset = array.length;
|
|
877
|
-
while (++index2 < length) {
|
|
878
|
-
array[offset + index2] = values[index2];
|
|
879
|
-
}
|
|
880
|
-
return array;
|
|
881
|
-
}
|
|
882
|
-
var spreadableSymbol = Symbol$2 ? Symbol$2.isConcatSpreadable : void 0;
|
|
883
|
-
function isFlattenable(value) {
|
|
884
|
-
return isArray$1(value) || isArguments$1(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
|
|
885
|
-
}
|
|
886
|
-
function baseFlatten(array, depth, predicate, isStrict, result) {
|
|
887
|
-
var index2 = -1, length = array.length;
|
|
888
|
-
predicate || (predicate = isFlattenable);
|
|
889
|
-
result || (result = []);
|
|
890
|
-
while (++index2 < length) {
|
|
891
|
-
var value = array[index2];
|
|
892
|
-
if (depth > 0 && predicate(value)) {
|
|
893
|
-
if (depth > 1) {
|
|
894
|
-
baseFlatten(value, depth - 1, predicate, isStrict, result);
|
|
895
|
-
} else {
|
|
896
|
-
arrayPush(result, value);
|
|
897
|
-
}
|
|
898
|
-
} else if (!isStrict) {
|
|
899
|
-
result[result.length] = value;
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
return result;
|
|
903
|
-
}
|
|
904
|
-
function flatten(array) {
|
|
905
|
-
var length = array == null ? 0 : array.length;
|
|
906
|
-
return length ? baseFlatten(array, 1) : [];
|
|
907
|
-
}
|
|
908
|
-
function flatRest(func) {
|
|
909
|
-
return setToString$1(overRest(func, void 0, flatten), func + "");
|
|
910
|
-
}
|
|
911
|
-
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
|
912
|
-
var getPrototype$1 = getPrototype;
|
|
913
|
-
var objectTag$3 = "[object Object]";
|
|
914
|
-
var funcProto = Function.prototype, objectProto$4 = Object.prototype;
|
|
915
|
-
var funcToString = funcProto.toString;
|
|
916
|
-
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
917
|
-
var objectCtorString = funcToString.call(Object);
|
|
918
|
-
function isPlainObject(value) {
|
|
919
|
-
if (!isObjectLike(value) || baseGetTag(value) != objectTag$3) {
|
|
920
|
-
return false;
|
|
921
|
-
}
|
|
922
|
-
var proto = getPrototype$1(value);
|
|
923
|
-
if (proto === null) {
|
|
924
|
-
return true;
|
|
925
|
-
}
|
|
926
|
-
var Ctor = hasOwnProperty$3.call(proto, "constructor") && proto.constructor;
|
|
927
|
-
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
928
|
-
}
|
|
929
|
-
function baseSlice(array, start, end) {
|
|
930
|
-
var index2 = -1, length = array.length;
|
|
931
|
-
if (start < 0) {
|
|
932
|
-
start = -start > length ? 0 : length + start;
|
|
933
|
-
}
|
|
934
|
-
end = end > length ? length : end;
|
|
935
|
-
if (end < 0) {
|
|
936
|
-
end += length;
|
|
937
|
-
}
|
|
938
|
-
length = start > end ? 0 : end - start >>> 0;
|
|
939
|
-
start >>>= 0;
|
|
940
|
-
var result = Array(length);
|
|
941
|
-
while (++index2 < length) {
|
|
942
|
-
result[index2] = array[index2 + start];
|
|
943
|
-
}
|
|
944
|
-
return result;
|
|
945
|
-
}
|
|
946
|
-
function stackClear() {
|
|
947
|
-
this.__data__ = new ListCache();
|
|
948
|
-
this.size = 0;
|
|
949
|
-
}
|
|
950
|
-
function stackDelete(key) {
|
|
951
|
-
var data = this.__data__, result = data["delete"](key);
|
|
952
|
-
this.size = data.size;
|
|
953
|
-
return result;
|
|
954
|
-
}
|
|
955
|
-
function stackGet(key) {
|
|
956
|
-
return this.__data__.get(key);
|
|
957
|
-
}
|
|
958
|
-
function stackHas(key) {
|
|
959
|
-
return this.__data__.has(key);
|
|
960
|
-
}
|
|
961
|
-
var LARGE_ARRAY_SIZE = 200;
|
|
962
|
-
function stackSet(key, value) {
|
|
963
|
-
var data = this.__data__;
|
|
964
|
-
if (data instanceof ListCache) {
|
|
965
|
-
var pairs = data.__data__;
|
|
966
|
-
if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
967
|
-
pairs.push([key, value]);
|
|
968
|
-
this.size = ++data.size;
|
|
969
|
-
return this;
|
|
970
|
-
}
|
|
971
|
-
data = this.__data__ = new MapCache(pairs);
|
|
972
|
-
}
|
|
973
|
-
data.set(key, value);
|
|
974
|
-
this.size = data.size;
|
|
975
|
-
return this;
|
|
976
|
-
}
|
|
977
|
-
function Stack(entries) {
|
|
978
|
-
var data = this.__data__ = new ListCache(entries);
|
|
979
|
-
this.size = data.size;
|
|
980
|
-
}
|
|
981
|
-
Stack.prototype.clear = stackClear;
|
|
982
|
-
Stack.prototype["delete"] = stackDelete;
|
|
983
|
-
Stack.prototype.get = stackGet;
|
|
984
|
-
Stack.prototype.has = stackHas;
|
|
985
|
-
Stack.prototype.set = stackSet;
|
|
986
|
-
function baseAssign(object, source) {
|
|
987
|
-
return object && copyObject(source, keys(source), object);
|
|
988
|
-
}
|
|
989
|
-
function baseAssignIn(object, source) {
|
|
990
|
-
return object && copyObject(source, keysIn(source), object);
|
|
991
|
-
}
|
|
992
|
-
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
993
|
-
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
994
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
995
|
-
var Buffer2 = moduleExports ? root$1.Buffer : void 0, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
|
|
996
|
-
function cloneBuffer(buffer, isDeep) {
|
|
997
|
-
if (isDeep) {
|
|
998
|
-
return buffer.slice();
|
|
999
|
-
}
|
|
1000
|
-
var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
1001
|
-
buffer.copy(result);
|
|
1002
|
-
return result;
|
|
1003
|
-
}
|
|
1004
|
-
function arrayFilter(array, predicate) {
|
|
1005
|
-
var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
|
|
1006
|
-
while (++index2 < length) {
|
|
1007
|
-
var value = array[index2];
|
|
1008
|
-
if (predicate(value, index2, array)) {
|
|
1009
|
-
result[resIndex++] = value;
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
return result;
|
|
1013
|
-
}
|
|
1014
|
-
function stubArray() {
|
|
1015
|
-
return [];
|
|
1016
|
-
}
|
|
1017
|
-
var objectProto$3 = Object.prototype;
|
|
1018
|
-
var propertyIsEnumerable = objectProto$3.propertyIsEnumerable;
|
|
1019
|
-
var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
|
|
1020
|
-
var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object) {
|
|
1021
|
-
if (object == null) {
|
|
1022
|
-
return [];
|
|
1023
|
-
}
|
|
1024
|
-
object = Object(object);
|
|
1025
|
-
return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
|
|
1026
|
-
return propertyIsEnumerable.call(object, symbol);
|
|
1027
|
-
});
|
|
1028
|
-
};
|
|
1029
|
-
var getSymbols$1 = getSymbols;
|
|
1030
|
-
function copySymbols(source, object) {
|
|
1031
|
-
return copyObject(source, getSymbols$1(source), object);
|
|
1032
|
-
}
|
|
1033
|
-
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
1034
|
-
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
|
|
1035
|
-
var result = [];
|
|
1036
|
-
while (object) {
|
|
1037
|
-
arrayPush(result, getSymbols$1(object));
|
|
1038
|
-
object = getPrototype$1(object);
|
|
1039
|
-
}
|
|
1040
|
-
return result;
|
|
1041
|
-
};
|
|
1042
|
-
var getSymbolsIn$1 = getSymbolsIn;
|
|
1043
|
-
function copySymbolsIn(source, object) {
|
|
1044
|
-
return copyObject(source, getSymbolsIn$1(source), object);
|
|
1045
|
-
}
|
|
1046
|
-
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
1047
|
-
var result = keysFunc(object);
|
|
1048
|
-
return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
1049
|
-
}
|
|
1050
|
-
function getAllKeys(object) {
|
|
1051
|
-
return baseGetAllKeys(object, keys, getSymbols$1);
|
|
1052
|
-
}
|
|
1053
|
-
function getAllKeysIn(object) {
|
|
1054
|
-
return baseGetAllKeys(object, keysIn, getSymbolsIn$1);
|
|
1055
|
-
}
|
|
1056
|
-
var DataView = getNative(root$1, "DataView");
|
|
1057
|
-
var DataView$1 = DataView;
|
|
1058
|
-
var Promise$1 = getNative(root$1, "Promise");
|
|
1059
|
-
var Promise$2 = Promise$1;
|
|
1060
|
-
var Set = getNative(root$1, "Set");
|
|
1061
|
-
var Set$1 = Set;
|
|
1062
|
-
var mapTag$4 = "[object Map]", objectTag$2 = "[object Object]", promiseTag = "[object Promise]", setTag$4 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
|
|
1063
|
-
var dataViewTag$3 = "[object DataView]";
|
|
1064
|
-
var dataViewCtorString = toSource(DataView$1), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$2), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1);
|
|
1065
|
-
var getTag = baseGetTag;
|
|
1066
|
-
if (DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$3 || Map$1 && getTag(new Map$1()) != mapTag$4 || Promise$2 && getTag(Promise$2.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$4 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$1) {
|
|
1067
|
-
getTag = function(value) {
|
|
1068
|
-
var result = baseGetTag(value), Ctor = result == objectTag$2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
|
1069
|
-
if (ctorString) {
|
|
1070
|
-
switch (ctorString) {
|
|
1071
|
-
case dataViewCtorString:
|
|
1072
|
-
return dataViewTag$3;
|
|
1073
|
-
case mapCtorString:
|
|
1074
|
-
return mapTag$4;
|
|
1075
|
-
case promiseCtorString:
|
|
1076
|
-
return promiseTag;
|
|
1077
|
-
case setCtorString:
|
|
1078
|
-
return setTag$4;
|
|
1079
|
-
case weakMapCtorString:
|
|
1080
|
-
return weakMapTag$1;
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
return result;
|
|
1084
|
-
};
|
|
1085
|
-
}
|
|
1086
|
-
var getTag$1 = getTag;
|
|
1087
|
-
var objectProto$2 = Object.prototype;
|
|
1088
|
-
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
1089
|
-
function initCloneArray(array) {
|
|
1090
|
-
var length = array.length, result = new array.constructor(length);
|
|
1091
|
-
if (length && typeof array[0] == "string" && hasOwnProperty$2.call(array, "index")) {
|
|
1092
|
-
result.index = array.index;
|
|
1093
|
-
result.input = array.input;
|
|
1094
|
-
}
|
|
1095
|
-
return result;
|
|
1096
|
-
}
|
|
1097
|
-
var Uint8Array2 = root$1.Uint8Array;
|
|
1098
|
-
var Uint8Array$1 = Uint8Array2;
|
|
1099
|
-
function cloneArrayBuffer(arrayBuffer) {
|
|
1100
|
-
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
1101
|
-
new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
|
|
1102
|
-
return result;
|
|
1103
|
-
}
|
|
1104
|
-
function cloneDataView(dataView, isDeep) {
|
|
1105
|
-
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
|
|
1106
|
-
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
|
|
1107
|
-
}
|
|
1108
|
-
var reFlags = /\w*$/;
|
|
1109
|
-
function cloneRegExp(regexp) {
|
|
1110
|
-
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
|
|
1111
|
-
result.lastIndex = regexp.lastIndex;
|
|
1112
|
-
return result;
|
|
1113
|
-
}
|
|
1114
|
-
var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : void 0;
|
|
1115
|
-
function cloneSymbol(symbol) {
|
|
1116
|
-
return symbolValueOf$1 ? Object(symbolValueOf$1.call(symbol)) : {};
|
|
1117
|
-
}
|
|
1118
|
-
function cloneTypedArray(typedArray, isDeep) {
|
|
1119
|
-
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
|
1120
|
-
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
1121
|
-
}
|
|
1122
|
-
var boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", mapTag$3 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$2 = "[object RegExp]", setTag$3 = "[object Set]", stringTag$2 = "[object String]", symbolTag$2 = "[object Symbol]";
|
|
1123
|
-
var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
|
|
1124
|
-
function initCloneByTag(object, tag, isDeep) {
|
|
1125
|
-
var Ctor = object.constructor;
|
|
1126
|
-
switch (tag) {
|
|
1127
|
-
case arrayBufferTag$2:
|
|
1128
|
-
return cloneArrayBuffer(object);
|
|
1129
|
-
case boolTag$2:
|
|
1130
|
-
case dateTag$2:
|
|
1131
|
-
return new Ctor(+object);
|
|
1132
|
-
case dataViewTag$2:
|
|
1133
|
-
return cloneDataView(object, isDeep);
|
|
1134
|
-
case float32Tag$1:
|
|
1135
|
-
case float64Tag$1:
|
|
1136
|
-
case int8Tag$1:
|
|
1137
|
-
case int16Tag$1:
|
|
1138
|
-
case int32Tag$1:
|
|
1139
|
-
case uint8Tag$1:
|
|
1140
|
-
case uint8ClampedTag$1:
|
|
1141
|
-
case uint16Tag$1:
|
|
1142
|
-
case uint32Tag$1:
|
|
1143
|
-
return cloneTypedArray(object, isDeep);
|
|
1144
|
-
case mapTag$3:
|
|
1145
|
-
return new Ctor();
|
|
1146
|
-
case numberTag$2:
|
|
1147
|
-
case stringTag$2:
|
|
1148
|
-
return new Ctor(object);
|
|
1149
|
-
case regexpTag$2:
|
|
1150
|
-
return cloneRegExp(object);
|
|
1151
|
-
case setTag$3:
|
|
1152
|
-
return new Ctor();
|
|
1153
|
-
case symbolTag$2:
|
|
1154
|
-
return cloneSymbol(object);
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
|
-
function initCloneObject(object) {
|
|
1158
|
-
return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate$1(getPrototype$1(object)) : {};
|
|
1159
|
-
}
|
|
1160
|
-
var mapTag$2 = "[object Map]";
|
|
1161
|
-
function baseIsMap(value) {
|
|
1162
|
-
return isObjectLike(value) && getTag$1(value) == mapTag$2;
|
|
1163
|
-
}
|
|
1164
|
-
var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
|
|
1165
|
-
var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
|
|
1166
|
-
var isMap$1 = isMap;
|
|
1167
|
-
var setTag$2 = "[object Set]";
|
|
1168
|
-
function baseIsSet(value) {
|
|
1169
|
-
return isObjectLike(value) && getTag$1(value) == setTag$2;
|
|
1170
|
-
}
|
|
1171
|
-
var nodeIsSet = nodeUtil$1 && nodeUtil$1.isSet;
|
|
1172
|
-
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
1173
|
-
var isSet$1 = isSet;
|
|
1174
|
-
var CLONE_DEEP_FLAG$2 = 1, CLONE_FLAT_FLAG$1 = 2, CLONE_SYMBOLS_FLAG$2 = 4;
|
|
1175
|
-
var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag$1 = "[object Map]", numberTag$1 = "[object Number]", objectTag$1 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$1 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]", weakMapTag = "[object WeakMap]";
|
|
1176
|
-
var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
|
1177
|
-
var cloneableTags = {};
|
|
1178
|
-
cloneableTags[argsTag$1] = cloneableTags[arrayTag$1] = cloneableTags[arrayBufferTag$1] = cloneableTags[dataViewTag$1] = cloneableTags[boolTag$1] = cloneableTags[dateTag$1] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag$1] = cloneableTags[objectTag$1] = cloneableTags[regexpTag$1] = cloneableTags[setTag$1] = cloneableTags[stringTag$1] = cloneableTags[symbolTag$1] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
|
1179
|
-
cloneableTags[errorTag$1] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
|
|
1180
|
-
function baseClone(value, bitmask, customizer, key, object, stack) {
|
|
1181
|
-
var result, isDeep = bitmask & CLONE_DEEP_FLAG$2, isFlat = bitmask & CLONE_FLAT_FLAG$1, isFull = bitmask & CLONE_SYMBOLS_FLAG$2;
|
|
1182
|
-
if (customizer) {
|
|
1183
|
-
result = object ? customizer(value, key, object, stack) : customizer(value);
|
|
1184
|
-
}
|
|
1185
|
-
if (result !== void 0) {
|
|
1186
|
-
return result;
|
|
1187
|
-
}
|
|
1188
|
-
if (!isObject(value)) {
|
|
1189
|
-
return value;
|
|
1190
|
-
}
|
|
1191
|
-
var isArr = isArray$1(value);
|
|
1192
|
-
if (isArr) {
|
|
1193
|
-
result = initCloneArray(value);
|
|
1194
|
-
if (!isDeep) {
|
|
1195
|
-
return copyArray(value, result);
|
|
1196
|
-
}
|
|
1197
|
-
} else {
|
|
1198
|
-
var tag = getTag$1(value), isFunc = tag == funcTag || tag == genTag;
|
|
1199
|
-
if (isBuffer$1(value)) {
|
|
1200
|
-
return cloneBuffer(value, isDeep);
|
|
1201
|
-
}
|
|
1202
|
-
if (tag == objectTag$1 || tag == argsTag$1 || isFunc && !object) {
|
|
1203
|
-
result = isFlat || isFunc ? {} : initCloneObject(value);
|
|
1204
|
-
if (!isDeep) {
|
|
1205
|
-
return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
|
|
1206
|
-
}
|
|
1207
|
-
} else {
|
|
1208
|
-
if (!cloneableTags[tag]) {
|
|
1209
|
-
return object ? value : {};
|
|
1210
|
-
}
|
|
1211
|
-
result = initCloneByTag(value, tag, isDeep);
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
|
-
stack || (stack = new Stack());
|
|
1215
|
-
var stacked = stack.get(value);
|
|
1216
|
-
if (stacked) {
|
|
1217
|
-
return stacked;
|
|
1218
|
-
}
|
|
1219
|
-
stack.set(value, result);
|
|
1220
|
-
if (isSet$1(value)) {
|
|
1221
|
-
value.forEach(function(subValue) {
|
|
1222
|
-
result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
|
|
1223
|
-
});
|
|
1224
|
-
} else if (isMap$1(value)) {
|
|
1225
|
-
value.forEach(function(subValue, key2) {
|
|
1226
|
-
result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
|
|
1227
|
-
});
|
|
1228
|
-
}
|
|
1229
|
-
var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
|
|
1230
|
-
var props = isArr ? void 0 : keysFunc(value);
|
|
1231
|
-
arrayEach(props || value, function(subValue, key2) {
|
|
1232
|
-
if (props) {
|
|
1233
|
-
key2 = subValue;
|
|
1234
|
-
subValue = value[key2];
|
|
1235
|
-
}
|
|
1236
|
-
assignValue(result, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
|
|
1237
|
-
});
|
|
1238
|
-
return result;
|
|
1239
|
-
}
|
|
1240
|
-
var CLONE_DEEP_FLAG$1 = 1, CLONE_SYMBOLS_FLAG$1 = 4;
|
|
1241
|
-
function cloneDeep(value) {
|
|
1242
|
-
return baseClone(value, CLONE_DEEP_FLAG$1 | CLONE_SYMBOLS_FLAG$1);
|
|
1243
|
-
}
|
|
1244
|
-
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
1245
|
-
function setCacheAdd(value) {
|
|
1246
|
-
this.__data__.set(value, HASH_UNDEFINED);
|
|
1247
|
-
return this;
|
|
1248
|
-
}
|
|
1249
|
-
function setCacheHas(value) {
|
|
1250
|
-
return this.__data__.has(value);
|
|
1251
|
-
}
|
|
1252
|
-
function SetCache(values) {
|
|
1253
|
-
var index2 = -1, length = values == null ? 0 : values.length;
|
|
1254
|
-
this.__data__ = new MapCache();
|
|
1255
|
-
while (++index2 < length) {
|
|
1256
|
-
this.add(values[index2]);
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
|
1260
|
-
SetCache.prototype.has = setCacheHas;
|
|
1261
|
-
function arraySome(array, predicate) {
|
|
1262
|
-
var index2 = -1, length = array == null ? 0 : array.length;
|
|
1263
|
-
while (++index2 < length) {
|
|
1264
|
-
if (predicate(array[index2], index2, array)) {
|
|
1265
|
-
return true;
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1268
|
-
return false;
|
|
1269
|
-
}
|
|
1270
|
-
function cacheHas(cache, key) {
|
|
1271
|
-
return cache.has(key);
|
|
1272
|
-
}
|
|
1273
|
-
var COMPARE_PARTIAL_FLAG$3 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
|
|
1274
|
-
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
1275
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, arrLength = array.length, othLength = other.length;
|
|
1276
|
-
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
1277
|
-
return false;
|
|
1278
|
-
}
|
|
1279
|
-
var arrStacked = stack.get(array);
|
|
1280
|
-
var othStacked = stack.get(other);
|
|
1281
|
-
if (arrStacked && othStacked) {
|
|
1282
|
-
return arrStacked == other && othStacked == array;
|
|
1283
|
-
}
|
|
1284
|
-
var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$1 ? new SetCache() : void 0;
|
|
1285
|
-
stack.set(array, other);
|
|
1286
|
-
stack.set(other, array);
|
|
1287
|
-
while (++index2 < arrLength) {
|
|
1288
|
-
var arrValue = array[index2], othValue = other[index2];
|
|
1289
|
-
if (customizer) {
|
|
1290
|
-
var compared = isPartial ? customizer(othValue, arrValue, index2, other, array, stack) : customizer(arrValue, othValue, index2, array, other, stack);
|
|
1291
|
-
}
|
|
1292
|
-
if (compared !== void 0) {
|
|
1293
|
-
if (compared) {
|
|
1294
|
-
continue;
|
|
1295
|
-
}
|
|
1296
|
-
result = false;
|
|
1297
|
-
break;
|
|
1298
|
-
}
|
|
1299
|
-
if (seen) {
|
|
1300
|
-
if (!arraySome(other, function(othValue2, othIndex) {
|
|
1301
|
-
if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
|
|
1302
|
-
return seen.push(othIndex);
|
|
1303
|
-
}
|
|
1304
|
-
})) {
|
|
1305
|
-
result = false;
|
|
1306
|
-
break;
|
|
1307
|
-
}
|
|
1308
|
-
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
1309
|
-
result = false;
|
|
1310
|
-
break;
|
|
1311
|
-
}
|
|
1312
|
-
}
|
|
1313
|
-
stack["delete"](array);
|
|
1314
|
-
stack["delete"](other);
|
|
1315
|
-
return result;
|
|
1316
|
-
}
|
|
1317
|
-
function mapToArray(map) {
|
|
1318
|
-
var index2 = -1, result = Array(map.size);
|
|
1319
|
-
map.forEach(function(value, key) {
|
|
1320
|
-
result[++index2] = [key, value];
|
|
1321
|
-
});
|
|
1322
|
-
return result;
|
|
1323
|
-
}
|
|
1324
|
-
function setToArray(set) {
|
|
1325
|
-
var index2 = -1, result = Array(set.size);
|
|
1326
|
-
set.forEach(function(value) {
|
|
1327
|
-
result[++index2] = value;
|
|
1328
|
-
});
|
|
1329
|
-
return result;
|
|
1330
|
-
}
|
|
1331
|
-
var COMPARE_PARTIAL_FLAG$2 = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
1332
|
-
var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
|
|
1333
|
-
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
|
|
1334
|
-
var symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
1335
|
-
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
1336
|
-
switch (tag) {
|
|
1337
|
-
case dataViewTag:
|
|
1338
|
-
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
|
|
1339
|
-
return false;
|
|
1340
|
-
}
|
|
1341
|
-
object = object.buffer;
|
|
1342
|
-
other = other.buffer;
|
|
1343
|
-
case arrayBufferTag:
|
|
1344
|
-
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) {
|
|
1345
|
-
return false;
|
|
1346
|
-
}
|
|
1347
|
-
return true;
|
|
1348
|
-
case boolTag:
|
|
1349
|
-
case dateTag:
|
|
1350
|
-
case numberTag:
|
|
1351
|
-
return eq(+object, +other);
|
|
1352
|
-
case errorTag:
|
|
1353
|
-
return object.name == other.name && object.message == other.message;
|
|
1354
|
-
case regexpTag:
|
|
1355
|
-
case stringTag:
|
|
1356
|
-
return object == other + "";
|
|
1357
|
-
case mapTag:
|
|
1358
|
-
var convert = mapToArray;
|
|
1359
|
-
case setTag:
|
|
1360
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
|
|
1361
|
-
convert || (convert = setToArray);
|
|
1362
|
-
if (object.size != other.size && !isPartial) {
|
|
1363
|
-
return false;
|
|
1364
|
-
}
|
|
1365
|
-
var stacked = stack.get(object);
|
|
1366
|
-
if (stacked) {
|
|
1367
|
-
return stacked == other;
|
|
1368
|
-
}
|
|
1369
|
-
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
1370
|
-
stack.set(object, other);
|
|
1371
|
-
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
1372
|
-
stack["delete"](object);
|
|
1373
|
-
return result;
|
|
1374
|
-
case symbolTag:
|
|
1375
|
-
if (symbolValueOf) {
|
|
1376
|
-
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
return false;
|
|
1380
|
-
}
|
|
1381
|
-
var COMPARE_PARTIAL_FLAG$1 = 1;
|
|
1382
|
-
var objectProto$1 = Object.prototype;
|
|
1383
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
1384
|
-
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
1385
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
|
|
1386
|
-
if (objLength != othLength && !isPartial) {
|
|
1387
|
-
return false;
|
|
1388
|
-
}
|
|
1389
|
-
var index2 = objLength;
|
|
1390
|
-
while (index2--) {
|
|
1391
|
-
var key = objProps[index2];
|
|
1392
|
-
if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
|
|
1393
|
-
return false;
|
|
1394
|
-
}
|
|
1395
|
-
}
|
|
1396
|
-
var objStacked = stack.get(object);
|
|
1397
|
-
var othStacked = stack.get(other);
|
|
1398
|
-
if (objStacked && othStacked) {
|
|
1399
|
-
return objStacked == other && othStacked == object;
|
|
1400
|
-
}
|
|
1401
|
-
var result = true;
|
|
1402
|
-
stack.set(object, other);
|
|
1403
|
-
stack.set(other, object);
|
|
1404
|
-
var skipCtor = isPartial;
|
|
1405
|
-
while (++index2 < objLength) {
|
|
1406
|
-
key = objProps[index2];
|
|
1407
|
-
var objValue = object[key], othValue = other[key];
|
|
1408
|
-
if (customizer) {
|
|
1409
|
-
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
|
|
1410
|
-
}
|
|
1411
|
-
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
|
|
1412
|
-
result = false;
|
|
1413
|
-
break;
|
|
1414
|
-
}
|
|
1415
|
-
skipCtor || (skipCtor = key == "constructor");
|
|
1416
|
-
}
|
|
1417
|
-
if (result && !skipCtor) {
|
|
1418
|
-
var objCtor = object.constructor, othCtor = other.constructor;
|
|
1419
|
-
if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
|
|
1420
|
-
result = false;
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1423
|
-
stack["delete"](object);
|
|
1424
|
-
stack["delete"](other);
|
|
1425
|
-
return result;
|
|
1426
|
-
}
|
|
1427
|
-
var COMPARE_PARTIAL_FLAG = 1;
|
|
1428
|
-
var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
|
|
1429
|
-
var objectProto = Object.prototype;
|
|
1430
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1431
|
-
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
1432
|
-
var objIsArr = isArray$1(object), othIsArr = isArray$1(other), objTag = objIsArr ? arrayTag : getTag$1(object), othTag = othIsArr ? arrayTag : getTag$1(other);
|
|
1433
|
-
objTag = objTag == argsTag ? objectTag : objTag;
|
|
1434
|
-
othTag = othTag == argsTag ? objectTag : othTag;
|
|
1435
|
-
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
1436
|
-
if (isSameTag && isBuffer$1(object)) {
|
|
1437
|
-
if (!isBuffer$1(other)) {
|
|
1438
|
-
return false;
|
|
1439
|
-
}
|
|
1440
|
-
objIsArr = true;
|
|
1441
|
-
objIsObj = false;
|
|
1442
|
-
}
|
|
1443
|
-
if (isSameTag && !objIsObj) {
|
|
1444
|
-
stack || (stack = new Stack());
|
|
1445
|
-
return objIsArr || isTypedArray$1(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
1446
|
-
}
|
|
1447
|
-
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
1448
|
-
var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
|
|
1449
|
-
if (objIsWrapped || othIsWrapped) {
|
|
1450
|
-
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
1451
|
-
stack || (stack = new Stack());
|
|
1452
|
-
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
1453
|
-
}
|
|
1454
|
-
}
|
|
1455
|
-
if (!isSameTag) {
|
|
1456
|
-
return false;
|
|
1457
|
-
}
|
|
1458
|
-
stack || (stack = new Stack());
|
|
1459
|
-
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
1460
|
-
}
|
|
1461
|
-
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
1462
|
-
if (value === other) {
|
|
1463
|
-
return true;
|
|
1464
|
-
}
|
|
1465
|
-
if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
|
|
1466
|
-
return value !== value && other !== other;
|
|
1467
|
-
}
|
|
1468
|
-
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
1469
|
-
}
|
|
1470
|
-
function createBaseFor(fromRight) {
|
|
1471
|
-
return function(object, iteratee, keysFunc) {
|
|
1472
|
-
var index2 = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
|
|
1473
|
-
while (length--) {
|
|
1474
|
-
var key = props[fromRight ? length : ++index2];
|
|
1475
|
-
if (iteratee(iterable[key], key, iterable) === false) {
|
|
1476
|
-
break;
|
|
1477
|
-
}
|
|
1478
|
-
}
|
|
1479
|
-
return object;
|
|
1480
|
-
};
|
|
1481
|
-
}
|
|
1482
|
-
var baseFor = createBaseFor();
|
|
1483
|
-
var baseFor$1 = baseFor;
|
|
1484
|
-
var now = function() {
|
|
1485
|
-
return root$1.Date.now();
|
|
1486
|
-
};
|
|
1487
|
-
var now$1 = now;
|
|
1488
|
-
var FUNC_ERROR_TEXT$1 = "Expected a function";
|
|
1489
|
-
var nativeMax = Math.max, nativeMin = Math.min;
|
|
1490
|
-
function debounce(func, wait, options) {
|
|
1491
|
-
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
1492
|
-
if (typeof func != "function") {
|
|
1493
|
-
throw new TypeError(FUNC_ERROR_TEXT$1);
|
|
1494
|
-
}
|
|
1495
|
-
wait = toNumber(wait) || 0;
|
|
1496
|
-
if (isObject(options)) {
|
|
1497
|
-
leading = !!options.leading;
|
|
1498
|
-
maxing = "maxWait" in options;
|
|
1499
|
-
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
1500
|
-
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
1501
|
-
}
|
|
1502
|
-
function invokeFunc(time) {
|
|
1503
|
-
var args = lastArgs, thisArg = lastThis;
|
|
1504
|
-
lastArgs = lastThis = void 0;
|
|
1505
|
-
lastInvokeTime = time;
|
|
1506
|
-
result = func.apply(thisArg, args);
|
|
1507
|
-
return result;
|
|
1508
|
-
}
|
|
1509
|
-
function leadingEdge(time) {
|
|
1510
|
-
lastInvokeTime = time;
|
|
1511
|
-
timerId = setTimeout(timerExpired, wait);
|
|
1512
|
-
return leading ? invokeFunc(time) : result;
|
|
1513
|
-
}
|
|
1514
|
-
function remainingWait(time) {
|
|
1515
|
-
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
|
|
1516
|
-
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
|
|
1517
|
-
}
|
|
1518
|
-
function shouldInvoke(time) {
|
|
1519
|
-
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
|
|
1520
|
-
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
|
|
1521
|
-
}
|
|
1522
|
-
function timerExpired() {
|
|
1523
|
-
var time = now$1();
|
|
1524
|
-
if (shouldInvoke(time)) {
|
|
1525
|
-
return trailingEdge(time);
|
|
1526
|
-
}
|
|
1527
|
-
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
1528
|
-
}
|
|
1529
|
-
function trailingEdge(time) {
|
|
1530
|
-
timerId = void 0;
|
|
1531
|
-
if (trailing && lastArgs) {
|
|
1532
|
-
return invokeFunc(time);
|
|
1533
|
-
}
|
|
1534
|
-
lastArgs = lastThis = void 0;
|
|
1535
|
-
return result;
|
|
1536
|
-
}
|
|
1537
|
-
function cancel() {
|
|
1538
|
-
if (timerId !== void 0) {
|
|
1539
|
-
clearTimeout(timerId);
|
|
1540
|
-
}
|
|
1541
|
-
lastInvokeTime = 0;
|
|
1542
|
-
lastArgs = lastCallTime = lastThis = timerId = void 0;
|
|
1543
|
-
}
|
|
1544
|
-
function flush() {
|
|
1545
|
-
return timerId === void 0 ? result : trailingEdge(now$1());
|
|
1546
|
-
}
|
|
1547
|
-
function debounced() {
|
|
1548
|
-
var time = now$1(), isInvoking = shouldInvoke(time);
|
|
1549
|
-
lastArgs = arguments;
|
|
1550
|
-
lastThis = this;
|
|
1551
|
-
lastCallTime = time;
|
|
1552
|
-
if (isInvoking) {
|
|
1553
|
-
if (timerId === void 0) {
|
|
1554
|
-
return leadingEdge(lastCallTime);
|
|
1555
|
-
}
|
|
1556
|
-
if (maxing) {
|
|
1557
|
-
clearTimeout(timerId);
|
|
1558
|
-
timerId = setTimeout(timerExpired, wait);
|
|
1559
|
-
return invokeFunc(lastCallTime);
|
|
1560
|
-
}
|
|
1561
|
-
}
|
|
1562
|
-
if (timerId === void 0) {
|
|
1563
|
-
timerId = setTimeout(timerExpired, wait);
|
|
1564
|
-
}
|
|
1565
|
-
return result;
|
|
1566
|
-
}
|
|
1567
|
-
debounced.cancel = cancel;
|
|
1568
|
-
debounced.flush = flush;
|
|
1569
|
-
return debounced;
|
|
1570
|
-
}
|
|
1571
|
-
function assignMergeValue(object, key, value) {
|
|
1572
|
-
if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) {
|
|
1573
|
-
baseAssignValue(object, key, value);
|
|
1574
|
-
}
|
|
1575
|
-
}
|
|
1576
|
-
function isArrayLikeObject(value) {
|
|
1577
|
-
return isObjectLike(value) && isArrayLike(value);
|
|
1578
|
-
}
|
|
1579
|
-
function safeGet(object, key) {
|
|
1580
|
-
if (key === "constructor" && typeof object[key] === "function") {
|
|
1581
|
-
return;
|
|
1582
|
-
}
|
|
1583
|
-
if (key == "__proto__") {
|
|
1584
|
-
return;
|
|
1585
|
-
}
|
|
1586
|
-
return object[key];
|
|
1587
|
-
}
|
|
1588
|
-
function toPlainObject(value) {
|
|
1589
|
-
return copyObject(value, keysIn(value));
|
|
1590
|
-
}
|
|
1591
|
-
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
|
1592
|
-
var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
|
|
1593
|
-
if (stacked) {
|
|
1594
|
-
assignMergeValue(object, key, stacked);
|
|
1595
|
-
return;
|
|
1596
|
-
}
|
|
1597
|
-
var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
|
|
1598
|
-
var isCommon = newValue === void 0;
|
|
1599
|
-
if (isCommon) {
|
|
1600
|
-
var isArr = isArray$1(srcValue), isBuff = !isArr && isBuffer$1(srcValue), isTyped = !isArr && !isBuff && isTypedArray$1(srcValue);
|
|
1601
|
-
newValue = srcValue;
|
|
1602
|
-
if (isArr || isBuff || isTyped) {
|
|
1603
|
-
if (isArray$1(objValue)) {
|
|
1604
|
-
newValue = objValue;
|
|
1605
|
-
} else if (isArrayLikeObject(objValue)) {
|
|
1606
|
-
newValue = copyArray(objValue);
|
|
1607
|
-
} else if (isBuff) {
|
|
1608
|
-
isCommon = false;
|
|
1609
|
-
newValue = cloneBuffer(srcValue, true);
|
|
1610
|
-
} else if (isTyped) {
|
|
1611
|
-
isCommon = false;
|
|
1612
|
-
newValue = cloneTypedArray(srcValue, true);
|
|
1613
|
-
} else {
|
|
1614
|
-
newValue = [];
|
|
1615
|
-
}
|
|
1616
|
-
} else if (isPlainObject(srcValue) || isArguments$1(srcValue)) {
|
|
1617
|
-
newValue = objValue;
|
|
1618
|
-
if (isArguments$1(objValue)) {
|
|
1619
|
-
newValue = toPlainObject(objValue);
|
|
1620
|
-
} else if (!isObject(objValue) || isFunction(objValue)) {
|
|
1621
|
-
newValue = initCloneObject(srcValue);
|
|
1622
|
-
}
|
|
1623
|
-
} else {
|
|
1624
|
-
isCommon = false;
|
|
1625
|
-
}
|
|
1626
|
-
}
|
|
1627
|
-
if (isCommon) {
|
|
1628
|
-
stack.set(srcValue, newValue);
|
|
1629
|
-
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
|
1630
|
-
stack["delete"](srcValue);
|
|
1631
|
-
}
|
|
1632
|
-
assignMergeValue(object, key, newValue);
|
|
1633
|
-
}
|
|
1634
|
-
function baseMerge(object, source, srcIndex, customizer, stack) {
|
|
1635
|
-
if (object === source) {
|
|
1636
|
-
return;
|
|
1637
|
-
}
|
|
1638
|
-
baseFor$1(source, function(srcValue, key) {
|
|
1639
|
-
stack || (stack = new Stack());
|
|
1640
|
-
if (isObject(srcValue)) {
|
|
1641
|
-
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
|
1642
|
-
} else {
|
|
1643
|
-
var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
|
|
1644
|
-
if (newValue === void 0) {
|
|
1645
|
-
newValue = srcValue;
|
|
1646
|
-
}
|
|
1647
|
-
assignMergeValue(object, key, newValue);
|
|
1648
|
-
}
|
|
1649
|
-
}, keysIn);
|
|
1650
|
-
}
|
|
1651
|
-
function last(array) {
|
|
1652
|
-
var length = array == null ? 0 : array.length;
|
|
1653
|
-
return length ? array[length - 1] : void 0;
|
|
1654
|
-
}
|
|
1655
|
-
function parent(object, path) {
|
|
1656
|
-
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
|
|
1657
|
-
}
|
|
1658
|
-
function isEqual(value, other) {
|
|
1659
|
-
return baseIsEqual(value, other);
|
|
1660
|
-
}
|
|
1661
|
-
var merge = createAssigner(function(object, source, srcIndex) {
|
|
1662
|
-
baseMerge(object, source, srcIndex);
|
|
1663
|
-
});
|
|
1664
|
-
var merge$1 = merge;
|
|
1665
|
-
function baseUnset(object, path) {
|
|
1666
|
-
path = castPath(path, object);
|
|
1667
|
-
object = parent(object, path);
|
|
1668
|
-
return object == null || delete object[toKey(last(path))];
|
|
1669
|
-
}
|
|
1670
|
-
function customOmitClone(value) {
|
|
1671
|
-
return isPlainObject(value) ? void 0 : value;
|
|
1672
|
-
}
|
|
1673
|
-
var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
|
|
1674
|
-
var omit = flatRest(function(object, paths) {
|
|
1675
|
-
var result = {};
|
|
1676
|
-
if (object == null) {
|
|
1677
|
-
return result;
|
|
1678
|
-
}
|
|
1679
|
-
var isDeep = false;
|
|
1680
|
-
paths = arrayMap(paths, function(path) {
|
|
1681
|
-
path = castPath(path, object);
|
|
1682
|
-
isDeep || (isDeep = path.length > 1);
|
|
1683
|
-
return path;
|
|
1684
|
-
});
|
|
1685
|
-
copyObject(object, getAllKeysIn(object), result);
|
|
1686
|
-
if (isDeep) {
|
|
1687
|
-
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
|
|
1688
|
-
}
|
|
1689
|
-
var length = paths.length;
|
|
1690
|
-
while (length--) {
|
|
1691
|
-
baseUnset(result, paths[length]);
|
|
1692
|
-
}
|
|
1693
|
-
return result;
|
|
1694
|
-
});
|
|
1695
|
-
var omit$1 = omit;
|
|
1696
|
-
var FUNC_ERROR_TEXT = "Expected a function";
|
|
1697
|
-
function throttle(func, wait, options) {
|
|
1698
|
-
var leading = true, trailing = true;
|
|
1699
|
-
if (typeof func != "function") {
|
|
1700
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
1701
|
-
}
|
|
1702
|
-
if (isObject(options)) {
|
|
1703
|
-
leading = "leading" in options ? !!options.leading : leading;
|
|
1704
|
-
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
1705
|
-
}
|
|
1706
|
-
return debounce(func, wait, {
|
|
1707
|
-
"leading": leading,
|
|
1708
|
-
"maxWait": wait,
|
|
1709
|
-
"trailing": trailing
|
|
1710
|
-
});
|
|
1711
|
-
}
|
|
1712
|
-
function useToastConstant() {
|
|
1713
|
-
const ANIMATION_NAME2 = "slide-in";
|
|
1714
|
-
const ANIMATION_TIME2 = 300;
|
|
1715
|
-
const ID_PREFIX2 = "toast-message";
|
|
1716
|
-
return {
|
|
1717
|
-
ANIMATION_TIME: ANIMATION_TIME2,
|
|
1718
|
-
ANIMATION_NAME: ANIMATION_NAME2,
|
|
1719
|
-
ID_PREFIX: ID_PREFIX2
|
|
1720
|
-
};
|
|
1721
|
-
}
|
|
1722
|
-
const { ANIMATION_TIME: ANIMATION_TIME$1 } = useToastConstant();
|
|
1723
|
-
function useToastEvent() {
|
|
1724
|
-
const ctx = getCurrentInstance();
|
|
1725
|
-
function onCloseEvent(msg) {
|
|
1726
|
-
ctx.emit("closeEvent", msg);
|
|
1727
|
-
}
|
|
1728
|
-
function onValueChange(msgs) {
|
|
1729
|
-
ctx.emit("valueChange", msgs);
|
|
1730
|
-
}
|
|
1731
|
-
function onHidden() {
|
|
1732
|
-
setTimeout(() => {
|
|
1733
|
-
var _a, _b;
|
|
1734
|
-
return (_b = (_a = ctx.attrs).onHidden) == null ? void 0 : _b.call(_a);
|
|
1735
|
-
}, ANIMATION_TIME$1);
|
|
1736
|
-
}
|
|
1737
|
-
return { onCloseEvent, onValueChange, onHidden };
|
|
1738
|
-
}
|
|
1739
|
-
function useToastHelper() {
|
|
1740
|
-
function severityDelay(msg) {
|
|
1741
|
-
switch (msg.severity) {
|
|
1742
|
-
case "warn":
|
|
1743
|
-
case "error":
|
|
1744
|
-
return 1e4;
|
|
1745
|
-
default:
|
|
1746
|
-
return 5e3;
|
|
1747
|
-
}
|
|
1748
|
-
}
|
|
1749
|
-
return { severityDelay };
|
|
1750
|
-
}
|
|
1751
|
-
let toastZIndex = 1060;
|
|
1752
|
-
function toastIncrease() {
|
|
1753
|
-
toastZIndex++;
|
|
1754
|
-
}
|
|
1755
|
-
const {
|
|
1756
|
-
ANIMATION_NAME,
|
|
1757
|
-
ANIMATION_TIME,
|
|
1758
|
-
ID_PREFIX
|
|
1759
|
-
} = useToastConstant();
|
|
1760
|
-
var Toast = defineComponent({
|
|
1761
|
-
name: "DToast",
|
|
1762
|
-
inheritAttrs: false,
|
|
1763
|
-
props: toastProps,
|
|
1764
|
-
emits: ["closeEvent", "valueChange"],
|
|
1765
|
-
setup(props, ctx) {
|
|
1766
|
-
const {
|
|
1767
|
-
onCloseEvent,
|
|
1768
|
-
onHidden,
|
|
1769
|
-
onValueChange
|
|
1770
|
-
} = useToastEvent();
|
|
1771
|
-
const {
|
|
1772
|
-
severityDelay
|
|
1773
|
-
} = useToastHelper();
|
|
1774
|
-
const removeThrottle = throttle(remove, ANIMATION_TIME);
|
|
1775
|
-
const messages = ref([]);
|
|
1776
|
-
const msgAnimations = ref([]);
|
|
1777
|
-
const containerRef = ref();
|
|
1778
|
-
const msgItemRefs = ref([]);
|
|
1779
|
-
let timestamp = Date.now();
|
|
1780
|
-
let timeout;
|
|
1781
|
-
const timeoutArr = [];
|
|
1782
|
-
const defaultLife = computed(() => {
|
|
1783
|
-
if (props.life !== null)
|
|
1784
|
-
return props.life;
|
|
1785
|
-
if (messages.value.length > 0)
|
|
1786
|
-
return severityDelay(messages.value[0]);
|
|
1787
|
-
return 5e3;
|
|
1788
|
-
});
|
|
1789
|
-
watch(() => props.value, (value) => {
|
|
1790
|
-
if (value.length === 0)
|
|
1791
|
-
return;
|
|
1792
|
-
if (hasMsgAnimation()) {
|
|
1793
|
-
initValue();
|
|
1794
|
-
}
|
|
1795
|
-
nextTick(() => {
|
|
1796
|
-
initValue(value);
|
|
1797
|
-
handleValueChange();
|
|
1798
|
-
});
|
|
1799
|
-
}, {
|
|
1800
|
-
deep: true,
|
|
1801
|
-
immediate: true
|
|
1802
|
-
});
|
|
1803
|
-
watch(messages, (value) => {
|
|
1804
|
-
value.length === 0 && msgAnimations.value.length > 0 && (msgAnimations.value = []);
|
|
1805
|
-
});
|
|
1806
|
-
watch(msgAnimations, (value, oldValue) => {
|
|
1807
|
-
oldValue.length > 0 && value.length === 0 && onHidden();
|
|
1808
|
-
});
|
|
1809
|
-
onUnmounted(() => {
|
|
1810
|
-
if (props.sticky) {
|
|
1811
|
-
return;
|
|
1812
|
-
}
|
|
1813
|
-
if (props.lifeMode === "single") {
|
|
1814
|
-
timeoutArr.forEach((t) => t && clearTimeout(t));
|
|
1815
|
-
} else {
|
|
1816
|
-
clearTimeout(timeout);
|
|
1817
|
-
}
|
|
1818
|
-
});
|
|
1819
|
-
function initValue(value = []) {
|
|
1820
|
-
const cloneValue = cloneDeep(value);
|
|
1821
|
-
messages.value = cloneValue.map((v, i) => merge$1(v, {
|
|
1822
|
-
id: `${ID_PREFIX}-${i}`
|
|
1823
|
-
}));
|
|
1824
|
-
msgAnimations.value = [];
|
|
1825
|
-
}
|
|
1826
|
-
function handleValueChange() {
|
|
1827
|
-
toastIncrease();
|
|
1828
|
-
setTimeout(() => {
|
|
1829
|
-
messages.value.forEach((msg) => msgAnimations.value.push(msg));
|
|
1830
|
-
}, 0);
|
|
1831
|
-
if (props.sticky)
|
|
1832
|
-
return;
|
|
1833
|
-
if (timeout) {
|
|
1834
|
-
timeout = clearTimeout(timeout);
|
|
1835
|
-
}
|
|
1836
|
-
if (timeoutArr.length > 0) {
|
|
1837
|
-
timeoutArr.splice(0).forEach((t) => clearTimeout(t));
|
|
1838
|
-
}
|
|
1839
|
-
timestamp = Date.now();
|
|
1840
|
-
if (props.lifeMode === "single") {
|
|
1841
|
-
setTimeout(() => {
|
|
1842
|
-
messages.value.forEach((msg, i) => {
|
|
1843
|
-
timeoutArr[i] = setTimeout(() => singleModeRemove(msg, i), msg.life || severityDelay(msg));
|
|
1844
|
-
});
|
|
1845
|
-
});
|
|
1846
|
-
} else {
|
|
1847
|
-
timeout = setTimeout(() => removeAll(), defaultLife.value);
|
|
1848
|
-
}
|
|
1849
|
-
}
|
|
1850
|
-
function singleModeRemove(msg, i) {
|
|
1851
|
-
removeMsgAnimation(msg);
|
|
1852
|
-
setTimeout(() => {
|
|
1853
|
-
onCloseEvent(msg);
|
|
1854
|
-
if (hasMsgAnimation()) {
|
|
1855
|
-
messages.value.splice(i, 1);
|
|
1856
|
-
} else {
|
|
1857
|
-
messages.value = [];
|
|
1858
|
-
}
|
|
1859
|
-
onValueChange(messages.value);
|
|
1860
|
-
}, ANIMATION_TIME);
|
|
1861
|
-
}
|
|
1862
|
-
function interrupt(i) {
|
|
1863
|
-
if (!msgAnimations.value.includes(messages.value[i]))
|
|
1864
|
-
return;
|
|
1865
|
-
if (props.lifeMode === "single") {
|
|
1866
|
-
if (timeoutArr[i]) {
|
|
1867
|
-
timeoutArr[i] = clearTimeout(timeoutArr[i]);
|
|
1868
|
-
}
|
|
1869
|
-
} else {
|
|
1870
|
-
resetDelay(() => {
|
|
1871
|
-
messages.value.forEach((msg, _i) => i !== _i && removeMsgAnimation(msg));
|
|
1872
|
-
});
|
|
1873
|
-
}
|
|
1874
|
-
}
|
|
1875
|
-
function resetDelay(fn) {
|
|
1876
|
-
if (!props.sticky && timeout) {
|
|
1877
|
-
timeout = clearTimeout(timeout);
|
|
1878
|
-
const remainTime = defaultLife.value - (Date.now() - timestamp);
|
|
1879
|
-
timeout = setTimeout(() => fn(), remainTime);
|
|
1880
|
-
}
|
|
1881
|
-
}
|
|
1882
|
-
function remove(i) {
|
|
1883
|
-
if (props.lifeMode === "single" && timeoutArr[i]) {
|
|
1884
|
-
timeoutArr[i] = clearTimeout(timeoutArr[i]);
|
|
1885
|
-
timeoutArr.splice(i, 1);
|
|
1886
|
-
}
|
|
1887
|
-
removeMsgAnimation(messages.value[i]);
|
|
1888
|
-
setTimeout(() => {
|
|
1889
|
-
onCloseEvent(messages.value[i]);
|
|
1890
|
-
messages.value.splice(i, 1);
|
|
1891
|
-
onValueChange(messages.value);
|
|
1892
|
-
if (props.lifeMode === "global") {
|
|
1893
|
-
removeReset();
|
|
1894
|
-
}
|
|
1895
|
-
}, ANIMATION_TIME);
|
|
1896
|
-
}
|
|
1897
|
-
function removeAll() {
|
|
1898
|
-
if (messages.value.length > 0) {
|
|
1899
|
-
msgAnimations.value = [];
|
|
1900
|
-
setTimeout(() => {
|
|
1901
|
-
messages.value.forEach((msg) => onCloseEvent(msg));
|
|
1902
|
-
messages.value = [];
|
|
1903
|
-
onValueChange(messages.value);
|
|
1904
|
-
}, ANIMATION_TIME);
|
|
1905
|
-
}
|
|
1906
|
-
}
|
|
1907
|
-
function removeReset(i, msg) {
|
|
1908
|
-
const removed = messages.value.findIndex((_msg) => _msg === msg) === -1;
|
|
1909
|
-
if (removed || msg !== void 0 && !msgAnimations.value.includes(msg)) {
|
|
1910
|
-
return;
|
|
1911
|
-
}
|
|
1912
|
-
if (props.lifeMode === "single") {
|
|
1913
|
-
const msgLife = msg.life || severityDelay(msg);
|
|
1914
|
-
const remainTime = msgLife - (Date.now() - timestamp);
|
|
1915
|
-
timeoutArr[i] = setTimeout(() => singleModeRemove(msg, i), remainTime);
|
|
1916
|
-
} else {
|
|
1917
|
-
resetDelay(() => removeAll());
|
|
1918
|
-
}
|
|
1919
|
-
}
|
|
1920
|
-
function removeIndexThrottle(i) {
|
|
1921
|
-
if (i < msgItemRefs.value.length && i > -1) {
|
|
1922
|
-
removeThrottle(i);
|
|
1923
|
-
}
|
|
1924
|
-
}
|
|
1925
|
-
function removeMsgThrottle(msg) {
|
|
1926
|
-
const ignoreDiffKeys = ["id"];
|
|
1927
|
-
const index2 = messages.value.findIndex((_msg) => isEqual(omit$1(_msg, ignoreDiffKeys), omit$1(msg, ignoreDiffKeys)));
|
|
1928
|
-
removeIndexThrottle(index2);
|
|
1929
|
-
}
|
|
1930
|
-
function removeMsgAnimation(msg) {
|
|
1931
|
-
msgAnimations.value = msgAnimations.value.filter((_msg) => _msg !== msg);
|
|
1932
|
-
}
|
|
1933
|
-
function close(params) {
|
|
1934
|
-
if (params === void 0) {
|
|
1935
|
-
return removeAll();
|
|
1936
|
-
}
|
|
1937
|
-
if (typeof params === "number") {
|
|
1938
|
-
removeIndexThrottle(params);
|
|
1939
|
-
} else {
|
|
1940
|
-
removeMsgThrottle(params);
|
|
1941
|
-
}
|
|
1942
|
-
}
|
|
1943
|
-
function msgItemRef(i) {
|
|
1944
|
-
return msgItemRefs.value[i];
|
|
1945
|
-
}
|
|
1946
|
-
function hasMsgAnimation() {
|
|
1947
|
-
return msgAnimations.value.length > 0;
|
|
1948
|
-
}
|
|
1949
|
-
return {
|
|
1950
|
-
messages,
|
|
1951
|
-
msgAnimations,
|
|
1952
|
-
containerRef,
|
|
1953
|
-
msgItemRefs,
|
|
1954
|
-
interrupt,
|
|
1955
|
-
removeReset,
|
|
1956
|
-
removeThrottle,
|
|
1957
|
-
close,
|
|
1958
|
-
msgItemRef
|
|
1959
|
-
};
|
|
1960
|
-
},
|
|
1961
|
-
render() {
|
|
1962
|
-
const {
|
|
1963
|
-
style: extraStyle,
|
|
1964
|
-
styleClass: extraClass,
|
|
1965
|
-
messages,
|
|
1966
|
-
msgAnimations,
|
|
1967
|
-
msgItemRefs,
|
|
1968
|
-
life,
|
|
1969
|
-
interrupt,
|
|
1970
|
-
removeReset,
|
|
1971
|
-
removeThrottle,
|
|
1972
|
-
$attrs,
|
|
1973
|
-
$slots
|
|
1974
|
-
} = this;
|
|
1975
|
-
const prefixCls = "devui-toast";
|
|
1976
|
-
const wrapperStyles = [`z-index: ${toastZIndex}`, extraStyle];
|
|
1977
|
-
const wrapperCls = [prefixCls, extraClass];
|
|
1978
|
-
const msgCls = (msg) => [`${prefixCls}-item-container`, `${prefixCls}-message-${msg.severity}`, {
|
|
1979
|
-
[ANIMATION_NAME]: msgAnimations.includes(msg)
|
|
1980
|
-
}];
|
|
1981
|
-
const showClose = (msg) => !(!msg.summary && life !== null);
|
|
1982
|
-
const showImage = (msg) => msg.severity !== "common";
|
|
1983
|
-
const showSummary = (msg) => !!msg.summary;
|
|
1984
|
-
const showContent = (msg) => !!msg.content;
|
|
1985
|
-
const showDetail = (msg) => !showContent(msg) && !!msg.detail;
|
|
1986
|
-
const msgContent = (msg) => {
|
|
1987
|
-
var _a;
|
|
1988
|
-
if (typeof msg.content === "function") {
|
|
1989
|
-
return msg.content(msg);
|
|
1990
|
-
}
|
|
1991
|
-
if ([null, void 0].includes(msg.content)) {
|
|
1992
|
-
return null;
|
|
1993
|
-
}
|
|
1994
|
-
const slotPrefix = "slot:";
|
|
1995
|
-
const isSlot = String(msg.content).startsWith(slotPrefix);
|
|
1996
|
-
if (isSlot) {
|
|
1997
|
-
return (_a = $slots[msg.content.slice(slotPrefix.length)]) == null ? void 0 : _a.call($slots, msg);
|
|
1998
|
-
}
|
|
1999
|
-
return msg.content;
|
|
2000
|
-
};
|
|
2001
|
-
return createVNode("div", mergeProps({
|
|
2002
|
-
"ref": "containerRef",
|
|
2003
|
-
"style": wrapperStyles,
|
|
2004
|
-
"class": wrapperCls
|
|
2005
|
-
}, $attrs), [messages.map((msg, i) => createVNode("div", {
|
|
2006
|
-
"ref": (el) => msgItemRefs[i] = el,
|
|
2007
|
-
"key": msg.id,
|
|
2008
|
-
"class": msgCls(msg),
|
|
2009
|
-
"aria-live": "polite",
|
|
2010
|
-
"onMouseenter": () => interrupt(i),
|
|
2011
|
-
"onMouseleave": () => removeReset(i, msg)
|
|
2012
|
-
}, [createVNode("div", {
|
|
2013
|
-
"class": `${prefixCls}-item`
|
|
2014
|
-
}, [showClose(msg) ? createVNode(ToastIconClose, {
|
|
2015
|
-
"prefixCls": prefixCls,
|
|
2016
|
-
"onClick": () => removeThrottle(i)
|
|
2017
|
-
}, null) : null, showImage(msg) ? createVNode(ToastImage, {
|
|
2018
|
-
"prefixCls": prefixCls,
|
|
2019
|
-
"severity": msg.severity
|
|
2020
|
-
}, null) : null, createVNode("div", {
|
|
2021
|
-
"class": "devui-toast-message"
|
|
2022
|
-
}, [showSummary(msg) ? createVNode("span", {
|
|
2023
|
-
"class": "devui-toast-title"
|
|
2024
|
-
}, [msg.summary]) : null, showContent(msg) ? msgContent(msg) : null, showDetail(msg) ? createVNode("p", {
|
|
2025
|
-
"innerHTML": msg.detail
|
|
2026
|
-
}, null) : null])])]))]);
|
|
2027
|
-
}
|
|
2028
|
-
});
|
|
2029
|
-
function createToastApp(props) {
|
|
2030
|
-
return createApp(Toast, props);
|
|
2031
|
-
}
|
|
2032
|
-
class ToastService {
|
|
2033
|
-
static open(props) {
|
|
2034
|
-
let $body = document.body;
|
|
2035
|
-
let $div = document.createElement("div");
|
|
2036
|
-
$body.appendChild($div);
|
|
2037
|
-
let app = createToastApp(__spreadProps(__spreadValues({}, props != null ? props : {}), { onHidden: () => app == null ? void 0 : app.unmount() }));
|
|
2038
|
-
let toastInstance = app.mount($div);
|
|
2039
|
-
onUnmounted(() => {
|
|
2040
|
-
$body.removeChild($div);
|
|
2041
|
-
$body = null;
|
|
2042
|
-
$div = null;
|
|
2043
|
-
app = null;
|
|
2044
|
-
toastInstance = null;
|
|
2045
|
-
}, toastInstance.$);
|
|
2046
|
-
return {
|
|
2047
|
-
toastInstance
|
|
2048
|
-
};
|
|
2049
|
-
}
|
|
2050
|
-
}
|
|
2051
|
-
Toast.install = function(app) {
|
|
2052
|
-
app.component(Toast.name, Toast);
|
|
2053
|
-
};
|
|
2054
|
-
var UploadStatus;
|
|
2055
|
-
(function(UploadStatus2) {
|
|
523
|
+
var UploadStatus = /* @__PURE__ */ ((UploadStatus2) => {
|
|
2056
524
|
UploadStatus2[UploadStatus2["preLoad"] = 0] = "preLoad";
|
|
2057
525
|
UploadStatus2[UploadStatus2["uploading"] = 1] = "uploading";
|
|
2058
526
|
UploadStatus2[UploadStatus2["uploaded"] = 2] = "uploaded";
|
|
2059
527
|
UploadStatus2[UploadStatus2["failed"] = 3] = "failed";
|
|
2060
|
-
|
|
528
|
+
return UploadStatus2;
|
|
529
|
+
})(UploadStatus || {});
|
|
2061
530
|
const uploadProps = {
|
|
2062
|
-
|
|
2063
|
-
type:
|
|
2064
|
-
required: true
|
|
531
|
+
accept: {
|
|
532
|
+
type: String
|
|
2065
533
|
},
|
|
2066
|
-
|
|
2067
|
-
type:
|
|
2068
|
-
|
|
534
|
+
webkitdirectory: {
|
|
535
|
+
type: Boolean,
|
|
536
|
+
default: false
|
|
2069
537
|
},
|
|
2070
|
-
|
|
538
|
+
uploadOptions: {
|
|
539
|
+
type: Object
|
|
540
|
+
},
|
|
541
|
+
multiple: {
|
|
2071
542
|
type: Boolean,
|
|
2072
543
|
default: false
|
|
2073
544
|
},
|
|
2074
|
-
|
|
2075
|
-
type:
|
|
2076
|
-
default:
|
|
545
|
+
autoUpload: {
|
|
546
|
+
type: Boolean,
|
|
547
|
+
default: true
|
|
2077
548
|
},
|
|
2078
|
-
|
|
549
|
+
placeholder: {
|
|
2079
550
|
type: String,
|
|
2080
|
-
default: "
|
|
551
|
+
default: ""
|
|
2081
552
|
},
|
|
2082
|
-
|
|
553
|
+
modelValue: {
|
|
2083
554
|
type: Array,
|
|
2084
555
|
default: () => []
|
|
2085
556
|
},
|
|
2086
|
-
|
|
2087
|
-
type: Boolean,
|
|
2088
|
-
default: false
|
|
2089
|
-
},
|
|
2090
|
-
enableDrop: {
|
|
557
|
+
droppable: {
|
|
2091
558
|
type: Boolean,
|
|
2092
559
|
default: false
|
|
2093
560
|
},
|
|
@@ -2101,10 +568,6 @@ const uploadProps = {
|
|
|
2101
568
|
type: Boolean,
|
|
2102
569
|
default: false
|
|
2103
570
|
},
|
|
2104
|
-
showTip: {
|
|
2105
|
-
type: Boolean,
|
|
2106
|
-
default: false
|
|
2107
|
-
},
|
|
2108
571
|
onChange: {
|
|
2109
572
|
type: Function
|
|
2110
573
|
},
|
|
@@ -2120,125 +583,151 @@ const uploadProps = {
|
|
|
2120
583
|
type: Function,
|
|
2121
584
|
default: void 0
|
|
2122
585
|
},
|
|
2123
|
-
|
|
2124
|
-
type: Function,
|
|
2125
|
-
default: void 0
|
|
2126
|
-
},
|
|
2127
|
-
successEvent: {
|
|
586
|
+
deleteUploadedFile: {
|
|
2128
587
|
type: Function,
|
|
2129
588
|
default: void 0
|
|
2130
589
|
},
|
|
2131
|
-
|
|
590
|
+
onError: {
|
|
2132
591
|
type: Function,
|
|
2133
592
|
default: void 0
|
|
2134
|
-
}
|
|
2135
|
-
};
|
|
2136
|
-
const multiUploadProps = {
|
|
2137
|
-
uploadOptions: {
|
|
2138
|
-
type: Object,
|
|
2139
|
-
required: true
|
|
2140
|
-
},
|
|
2141
|
-
fileOptions: {
|
|
2142
|
-
type: Object,
|
|
2143
|
-
required: true
|
|
2144
|
-
},
|
|
2145
|
-
autoUpload: {
|
|
2146
|
-
type: Boolean,
|
|
2147
|
-
default: false
|
|
2148
|
-
},
|
|
2149
|
-
withoutBtn: {
|
|
2150
|
-
type: Boolean,
|
|
2151
|
-
default: false
|
|
2152
|
-
},
|
|
2153
|
-
showTip: {
|
|
2154
|
-
type: Boolean,
|
|
2155
|
-
default: false
|
|
2156
|
-
},
|
|
2157
|
-
uploadedFiles: {
|
|
2158
|
-
type: Array,
|
|
2159
|
-
default: () => []
|
|
2160
|
-
},
|
|
2161
|
-
enableDrop: {
|
|
2162
|
-
type: Boolean,
|
|
2163
|
-
default: false
|
|
2164
|
-
},
|
|
2165
|
-
placeholderText: {
|
|
2166
|
-
type: String,
|
|
2167
|
-
default: "\u9009\u62E9\u6587\u4EF6"
|
|
2168
|
-
},
|
|
2169
|
-
uploadText: {
|
|
2170
|
-
type: String,
|
|
2171
|
-
default: "\u4E0A\u4F20"
|
|
2172
|
-
},
|
|
2173
|
-
oneTimeUpload: {
|
|
2174
|
-
type: Boolean,
|
|
2175
|
-
default: false
|
|
2176
|
-
},
|
|
2177
|
-
disabled: {
|
|
2178
|
-
type: Boolean,
|
|
2179
|
-
default: false
|
|
2180
593
|
},
|
|
2181
|
-
|
|
2182
|
-
type: Function
|
|
2183
|
-
},
|
|
2184
|
-
fileDrop: {
|
|
594
|
+
onSuccess: {
|
|
2185
595
|
type: Function,
|
|
2186
596
|
default: void 0
|
|
2187
597
|
},
|
|
2188
|
-
|
|
598
|
+
onExceed: {
|
|
2189
599
|
type: Function,
|
|
2190
600
|
default: void 0
|
|
2191
601
|
},
|
|
2192
|
-
|
|
602
|
+
onProgress: {
|
|
2193
603
|
type: Function,
|
|
2194
604
|
default: void 0
|
|
2195
605
|
},
|
|
2196
|
-
|
|
606
|
+
onPreview: {
|
|
2197
607
|
type: Function,
|
|
2198
608
|
default: void 0
|
|
2199
609
|
},
|
|
2200
|
-
|
|
2201
|
-
type:
|
|
2202
|
-
default:
|
|
610
|
+
oneTimeUpload: {
|
|
611
|
+
type: Boolean,
|
|
612
|
+
default: false
|
|
2203
613
|
},
|
|
2204
|
-
|
|
2205
|
-
type:
|
|
2206
|
-
default:
|
|
614
|
+
limit: {
|
|
615
|
+
type: Number,
|
|
616
|
+
default: 0
|
|
2207
617
|
},
|
|
2208
|
-
|
|
618
|
+
httpRequest: {
|
|
2209
619
|
type: Function,
|
|
2210
620
|
default: void 0
|
|
2211
621
|
}
|
|
2212
622
|
};
|
|
623
|
+
const useSelectFiles = (t) => {
|
|
624
|
+
const BEYOND_MAXIMAL_FILE_SIZE_MSG = ref("");
|
|
625
|
+
const simulateClickEvent = (input) => {
|
|
626
|
+
const evt = document.createEvent("MouseEvents");
|
|
627
|
+
evt.initMouseEvent("click", true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
|
|
628
|
+
input.dispatchEvent(evt);
|
|
629
|
+
};
|
|
630
|
+
const selectFiles = ({ multiple, accept, webkitdirectory }) => {
|
|
631
|
+
return new Promise((resolve) => {
|
|
632
|
+
const tempNode = document.getElementById("d-upload-temp");
|
|
633
|
+
if (tempNode) {
|
|
634
|
+
document.body.removeChild(tempNode);
|
|
635
|
+
}
|
|
636
|
+
const input = document.createElement("input");
|
|
637
|
+
input.style.position = "fixed";
|
|
638
|
+
input.style.left = "-2000px";
|
|
639
|
+
input.style.top = "-2000px";
|
|
640
|
+
input.setAttribute("id", "d-upload-temp");
|
|
641
|
+
input.setAttribute("type", "file");
|
|
642
|
+
if (multiple) {
|
|
643
|
+
input.setAttribute("multiple", "");
|
|
644
|
+
}
|
|
645
|
+
if (accept) {
|
|
646
|
+
input.setAttribute("accept", accept);
|
|
647
|
+
}
|
|
648
|
+
if (webkitdirectory) {
|
|
649
|
+
input.setAttribute("webkitdirectory", "");
|
|
650
|
+
}
|
|
651
|
+
input.addEventListener("change", (event) => {
|
|
652
|
+
resolve(Array.prototype.slice.call(event.target.files));
|
|
653
|
+
});
|
|
654
|
+
document.body.appendChild(input);
|
|
655
|
+
simulateClickEvent(input);
|
|
656
|
+
});
|
|
657
|
+
};
|
|
658
|
+
const isAllowedFileType = (accept, file) => {
|
|
659
|
+
if (accept) {
|
|
660
|
+
const acceptArr = accept.split(",");
|
|
661
|
+
const baseMimeType = file.type.replace(/\/.*$/, "");
|
|
662
|
+
return acceptArr.some((type) => {
|
|
663
|
+
const validType = type.trim();
|
|
664
|
+
if (validType.startsWith(".")) {
|
|
665
|
+
return file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.toLowerCase().length - validType.toLowerCase().length) > -1;
|
|
666
|
+
} else if (/\/\*$/.test(validType)) {
|
|
667
|
+
return baseMimeType === validType.replace(/\/.*$/, "");
|
|
668
|
+
}
|
|
669
|
+
return file.type === validType;
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
return true;
|
|
673
|
+
};
|
|
674
|
+
const beyondMaximalSize = (fileSize, maximumSize) => {
|
|
675
|
+
if (maximumSize) {
|
|
676
|
+
return fileSize > 1024 * 1024 * maximumSize;
|
|
677
|
+
}
|
|
678
|
+
return false;
|
|
679
|
+
};
|
|
680
|
+
const _validateFiles = (file, accept, uploadOptions) => {
|
|
681
|
+
if (!isAllowedFileType(accept, file)) {
|
|
682
|
+
return {
|
|
683
|
+
checkError: true,
|
|
684
|
+
errorMsg: t("getNotAllowedFileTypeMsg")(file.name, accept)
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
if (uploadOptions && beyondMaximalSize(file.size, uploadOptions.maximumSize)) {
|
|
688
|
+
return {
|
|
689
|
+
checkError: true,
|
|
690
|
+
errorMsg: t("getBeyondMaximalFileSizeMsg")(file.name, uploadOptions.maximumSize || 0)
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
return { checkError: false, errorMsg: void 0 };
|
|
694
|
+
};
|
|
695
|
+
const triggerSelectFiles = (fileOptions) => {
|
|
696
|
+
const { multiple, accept, webkitdirectory } = fileOptions;
|
|
697
|
+
return selectFiles({ multiple, accept, webkitdirectory });
|
|
698
|
+
};
|
|
699
|
+
const triggerDropFiles = (files) => {
|
|
700
|
+
return Promise.resolve(files);
|
|
701
|
+
};
|
|
702
|
+
const checkAllFilesSize = (fileSize, maximumSize) => {
|
|
703
|
+
if (beyondMaximalSize(fileSize, maximumSize)) {
|
|
704
|
+
BEYOND_MAXIMAL_FILE_SIZE_MSG.value = t("getAllFilesBeyondMaximalFileSizeMsg")(maximumSize);
|
|
705
|
+
return { checkError: true, errorMsg: BEYOND_MAXIMAL_FILE_SIZE_MSG.value };
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
return {
|
|
709
|
+
triggerSelectFiles,
|
|
710
|
+
_validateFiles,
|
|
711
|
+
triggerDropFiles,
|
|
712
|
+
checkAllFilesSize
|
|
713
|
+
};
|
|
714
|
+
};
|
|
2213
715
|
class FileUploader {
|
|
2214
716
|
constructor(file, uploadOptions) {
|
|
2215
|
-
__publicField(this, "xhr");
|
|
2216
|
-
__publicField(this, "status");
|
|
2217
|
-
__publicField(this, "response");
|
|
2218
|
-
__publicField(this, "percentage", 0);
|
|
2219
717
|
this.file = file;
|
|
2220
718
|
this.uploadOptions = uploadOptions;
|
|
719
|
+
this.percentage = 0;
|
|
2221
720
|
this.file = file;
|
|
2222
721
|
this.uploadOptions = uploadOptions;
|
|
2223
722
|
this.status = UploadStatus.preLoad;
|
|
2224
723
|
}
|
|
2225
724
|
send(uploadFiles) {
|
|
2226
725
|
return new Promise((resolve, reject) => {
|
|
2227
|
-
const {
|
|
2228
|
-
uri,
|
|
2229
|
-
method,
|
|
2230
|
-
headers,
|
|
2231
|
-
authToken,
|
|
2232
|
-
authTokenHeader,
|
|
2233
|
-
additionalParameter,
|
|
2234
|
-
fileFieldName,
|
|
2235
|
-
withCredentials,
|
|
2236
|
-
responseType
|
|
2237
|
-
} = this.uploadOptions;
|
|
726
|
+
const { uri, method, headers, authToken, authTokenHeader, additionalParameter, fileFieldName, withCredentials, responseType } = this.uploadOptions || {};
|
|
2238
727
|
const authTokenHeader_ = authTokenHeader || "Authorization";
|
|
2239
728
|
const fileFieldName_ = fileFieldName || "file";
|
|
2240
729
|
this.xhr = new XMLHttpRequest();
|
|
2241
|
-
this.xhr.open(method || "POST", uri);
|
|
730
|
+
this.xhr.open(method || "POST", uri || "");
|
|
2242
731
|
if (withCredentials) {
|
|
2243
732
|
this.xhr.withCredentials = withCredentials;
|
|
2244
733
|
}
|
|
@@ -2250,7 +739,8 @@ class FileUploader {
|
|
|
2250
739
|
}
|
|
2251
740
|
if (headers) {
|
|
2252
741
|
Object.keys(headers).forEach((key) => {
|
|
2253
|
-
|
|
742
|
+
var _a;
|
|
743
|
+
(_a = this.xhr) == null ? void 0 : _a.setRequestHeader(key, headers[key]);
|
|
2254
744
|
});
|
|
2255
745
|
}
|
|
2256
746
|
this.xhr.upload.onprogress = (e) => {
|
|
@@ -2264,19 +754,21 @@ class FileUploader {
|
|
|
2264
754
|
this.xhr = null;
|
|
2265
755
|
};
|
|
2266
756
|
this.xhr.onerror = () => {
|
|
2267
|
-
|
|
757
|
+
var _a, _b;
|
|
758
|
+
this.response = (_a = this.xhr) == null ? void 0 : _a.response;
|
|
2268
759
|
this.status = UploadStatus.failed;
|
|
2269
|
-
reject({ file: this.file, response: this.xhr.response });
|
|
760
|
+
reject({ file: this.file, response: (_b = this.xhr) == null ? void 0 : _b.response });
|
|
2270
761
|
};
|
|
2271
762
|
this.xhr.onload = () => {
|
|
2272
|
-
|
|
763
|
+
var _a, _b, _c;
|
|
764
|
+
if (((_a = this.xhr) == null ? void 0 : _a.readyState) === 4 && this.xhr.status >= 200 && this.xhr.status < 300) {
|
|
2273
765
|
this.response = this.xhr.response;
|
|
2274
766
|
this.status = UploadStatus.uploaded;
|
|
2275
767
|
resolve({ file: this.file, response: this.xhr.response });
|
|
2276
768
|
} else {
|
|
2277
|
-
this.response = this.xhr.response;
|
|
769
|
+
this.response = (_b = this.xhr) == null ? void 0 : _b.response;
|
|
2278
770
|
this.status = UploadStatus.failed;
|
|
2279
|
-
reject({ file: this.file, response: this.xhr.response });
|
|
771
|
+
reject({ file: this.file, response: (_c = this.xhr) == null ? void 0 : _c.response });
|
|
2280
772
|
}
|
|
2281
773
|
};
|
|
2282
774
|
});
|
|
@@ -2373,459 +865,246 @@ const useUpload = () => {
|
|
|
2373
865
|
}));
|
|
2374
866
|
}
|
|
2375
867
|
if (uploads.length > 0) {
|
|
2376
|
-
return Promise.resolve(uploads);
|
|
2377
|
-
}
|
|
2378
|
-
return Promise.reject("no files");
|
|
2379
|
-
};
|
|
2380
|
-
const _oneTimeUpload = () => {
|
|
2381
|
-
const uploads = fileUploaders.value.filter((fileUploader) => fileUploader.status !== UploadStatus.uploaded);
|
|
2382
|
-
return dealOneTimeUploadFiles(uploads);
|
|
2383
|
-
};
|
|
2384
|
-
const deleteFile = (file) => {
|
|
2385
|
-
const deleteUploadFile = fileUploaders.value.find((fileUploader) => fileUploader.file === file);
|
|
2386
|
-
deleteUploadFile.cancel();
|
|
2387
|
-
fileUploaders.value = fileUploaders.value.filter((fileUploader) => {
|
|
2388
|
-
return file !== fileUploader.file;
|
|
2389
|
-
});
|
|
2390
|
-
};
|
|
2391
|
-
const removeFiles = () => {
|
|
2392
|
-
fileUploaders.value = [];
|
|
2393
|
-
filesWithSameName.value = [];
|
|
2394
|
-
};
|
|
2395
|
-
const getSameNameFiles = () => {
|
|
2396
|
-
return filesWithSameName.value.join();
|
|
2397
|
-
};
|
|
2398
|
-
const resetSameNameFiles = () => {
|
|
2399
|
-
filesWithSameName.value = [];
|
|
2400
|
-
};
|
|
2401
|
-
return {
|
|
2402
|
-
fileUploaders,
|
|
2403
|
-
getFiles,
|
|
2404
|
-
addFile,
|
|
2405
|
-
getFullFiles,
|
|
2406
|
-
deleteFile,
|
|
2407
|
-
upload: upload2,
|
|
2408
|
-
removeFiles,
|
|
2409
|
-
getSameNameFiles,
|
|
2410
|
-
resetSameNameFiles,
|
|
2411
|
-
_oneTimeUpload
|
|
2412
|
-
};
|
|
2413
|
-
};
|
|
2414
|
-
const i18nText = {
|
|
2415
|
-
warning: "\u63D0\u9192",
|
|
2416
|
-
upload: "\u4E0A\u4F20",
|
|
2417
|
-
chooseFile: "\u9009\u62E9\u6587\u4EF6",
|
|
2418
|
-
chooseFiles: "\u9009\u62E9\u591A\u4E2A\u6587\u4EF6",
|
|
2419
|
-
preload: "\u9884\u52A0\u8F7D",
|
|
2420
|
-
uploading: "\u4E0A\u4F20\u4E2D...",
|
|
2421
|
-
uploaded: "\u5DF2\u4E0A\u4F20",
|
|
2422
|
-
uploadFailed: "\u4E0A\u4F20\u5931\u8D25",
|
|
2423
|
-
uploadSuccess: "\u4E0A\u4F20\u6210\u529F!",
|
|
2424
|
-
delete: "\u5220\u9664",
|
|
2425
|
-
reUpload: "\u91CD\u65B0\u4E0A\u4F20",
|
|
2426
|
-
cancelUpload: "\u53D6\u6D88\u4E0A\u4F20"
|
|
2427
|
-
};
|
|
2428
|
-
const getFailedFilesCount = (failedCount) => `${failedCount}\u4E2A\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF01`;
|
|
2429
|
-
const getUploadingFilesCount = (uploadingCount, filesCount) => `${uploadingCount}/${filesCount}\u6B63\u5728\u4E0A\u4F20`;
|
|
2430
|
-
const getSelectedFilesCount = (filesCount) => `\u5DF2\u6DFB\u52A0${filesCount}\u4E2A\u6587\u4EF6`;
|
|
2431
|
-
const getAllFilesBeyondMaximalFileSizeMsg = (maximalSize) => `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u672C\u6B21\u4E0A\u4F20\u7684\u6240\u6709\u6587\u4EF6\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
|
|
2432
|
-
const getBeyondMaximalFileSizeMsg = (filename, maximalSize) => {
|
|
2433
|
-
return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
|
|
2434
|
-
};
|
|
2435
|
-
const getNotAllowedFileTypeMsg = (filename, scope) => {
|
|
2436
|
-
return `\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B: "${scope}", \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u4E0D\u5728\u5141\u8BB8\u8303\u56F4\u5185\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
2437
|
-
};
|
|
2438
|
-
const getExistSameNameFilesMsg = (sameNames) => {
|
|
2439
|
-
return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
2440
|
-
};
|
|
2441
|
-
const useSelectFiles = () => {
|
|
2442
|
-
const BEYOND_MAXIMAL_FILE_SIZE_MSG = ref("");
|
|
2443
|
-
const simulateClickEvent = (input) => {
|
|
2444
|
-
const evt = document.createEvent("MouseEvents");
|
|
2445
|
-
evt.initMouseEvent("click", true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
|
|
2446
|
-
input.dispatchEvent(evt);
|
|
2447
|
-
};
|
|
2448
|
-
const selectFiles = ({
|
|
2449
|
-
multiple,
|
|
2450
|
-
accept,
|
|
2451
|
-
webkitdirectory
|
|
2452
|
-
}) => {
|
|
2453
|
-
return new Promise((resolve) => {
|
|
2454
|
-
const tempNode = document.getElementById("d-upload-temp");
|
|
2455
|
-
if (tempNode) {
|
|
2456
|
-
document.body.removeChild(tempNode);
|
|
2457
|
-
}
|
|
2458
|
-
const input = document.createElement("input");
|
|
2459
|
-
input.style.position = "fixed";
|
|
2460
|
-
input.style.left = "-2000px";
|
|
2461
|
-
input.style.top = "-2000px";
|
|
2462
|
-
input.setAttribute("id", "d-upload-temp");
|
|
2463
|
-
input.setAttribute("type", "file");
|
|
2464
|
-
if (multiple) {
|
|
2465
|
-
input.setAttribute("multiple", "");
|
|
2466
|
-
}
|
|
2467
|
-
if (accept) {
|
|
2468
|
-
input.setAttribute("accept", accept);
|
|
2469
|
-
}
|
|
2470
|
-
if (webkitdirectory) {
|
|
2471
|
-
input.setAttribute("webkitdirectory", "");
|
|
2472
|
-
}
|
|
2473
|
-
input.addEventListener("change", (event) => {
|
|
2474
|
-
resolve(Array.prototype.slice.call(event.target.files));
|
|
2475
|
-
});
|
|
2476
|
-
document.body.appendChild(input);
|
|
2477
|
-
simulateClickEvent(input);
|
|
2478
|
-
});
|
|
2479
|
-
};
|
|
2480
|
-
const isAllowedFileType = (accept, file) => {
|
|
2481
|
-
if (accept) {
|
|
2482
|
-
const acceptArr = accept.split(",");
|
|
2483
|
-
const baseMimeType = file.type.replace(/\/.*$/, "");
|
|
2484
|
-
return acceptArr.some((type) => {
|
|
2485
|
-
const validType = type.trim();
|
|
2486
|
-
if (validType.startsWith(".")) {
|
|
2487
|
-
return file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.toLowerCase().length - validType.toLowerCase().length) > -1;
|
|
2488
|
-
} else if (/\/\*$/.test(validType)) {
|
|
2489
|
-
return baseMimeType === validType.replace(/\/.*$/, "");
|
|
2490
|
-
}
|
|
2491
|
-
return file.type === validType;
|
|
2492
|
-
});
|
|
2493
|
-
}
|
|
2494
|
-
return true;
|
|
2495
|
-
};
|
|
2496
|
-
const beyondMaximalSize = (fileSize, maximumSize) => {
|
|
2497
|
-
if (maximumSize) {
|
|
2498
|
-
return fileSize > 1024 * 1024 * maximumSize;
|
|
2499
|
-
}
|
|
2500
|
-
return false;
|
|
2501
|
-
};
|
|
2502
|
-
const _validateFiles = (file, accept, uploadOptions) => {
|
|
2503
|
-
if (!isAllowedFileType(accept, file)) {
|
|
2504
|
-
return {
|
|
2505
|
-
checkError: true,
|
|
2506
|
-
errorMsg: getNotAllowedFileTypeMsg(file.name, accept)
|
|
2507
|
-
};
|
|
2508
|
-
}
|
|
2509
|
-
if (uploadOptions && beyondMaximalSize(file.size, uploadOptions.maximumSize)) {
|
|
2510
|
-
return {
|
|
2511
|
-
checkError: true,
|
|
2512
|
-
errorMsg: getBeyondMaximalFileSizeMsg(file.name, uploadOptions.maximumSize)
|
|
2513
|
-
};
|
|
868
|
+
return Promise.resolve(uploads);
|
|
2514
869
|
}
|
|
2515
|
-
return
|
|
870
|
+
return Promise.reject("no files");
|
|
2516
871
|
};
|
|
2517
|
-
const
|
|
2518
|
-
const
|
|
2519
|
-
return
|
|
872
|
+
const _oneTimeUpload = () => {
|
|
873
|
+
const uploads = fileUploaders.value.filter((fileUploader) => fileUploader.status !== UploadStatus.uploaded);
|
|
874
|
+
return dealOneTimeUploadFiles(uploads);
|
|
2520
875
|
};
|
|
2521
|
-
const
|
|
2522
|
-
|
|
876
|
+
const deleteFile = (file) => {
|
|
877
|
+
const deleteUploadFile = fileUploaders.value.find((fileUploader) => fileUploader.file === file);
|
|
878
|
+
deleteUploadFile == null ? void 0 : deleteUploadFile.cancel();
|
|
879
|
+
fileUploaders.value = fileUploaders.value.filter((fileUploader) => {
|
|
880
|
+
return file !== fileUploader.file;
|
|
881
|
+
});
|
|
2523
882
|
};
|
|
2524
|
-
const
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
883
|
+
const removeFiles = () => {
|
|
884
|
+
fileUploaders.value = [];
|
|
885
|
+
filesWithSameName.value = [];
|
|
886
|
+
};
|
|
887
|
+
const getSameNameFiles = () => {
|
|
888
|
+
return filesWithSameName.value.join();
|
|
889
|
+
};
|
|
890
|
+
const resetSameNameFiles = () => {
|
|
891
|
+
filesWithSameName.value = [];
|
|
2529
892
|
};
|
|
2530
893
|
return {
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
894
|
+
fileUploaders,
|
|
895
|
+
getFiles,
|
|
896
|
+
addFile,
|
|
897
|
+
getFullFiles,
|
|
898
|
+
deleteFile,
|
|
899
|
+
upload: upload2,
|
|
900
|
+
removeFiles,
|
|
901
|
+
getSameNameFiles,
|
|
902
|
+
resetSameNameFiles,
|
|
903
|
+
_oneTimeUpload
|
|
2535
904
|
};
|
|
2536
905
|
};
|
|
2537
906
|
var upload = "";
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
disabled,
|
|
2551
|
-
beforeUpload,
|
|
2552
|
-
enableDrop,
|
|
2553
|
-
showTip,
|
|
2554
|
-
uploadedFiles
|
|
2555
|
-
} = toRefs(props);
|
|
2556
|
-
const isDropOVer = ref(false);
|
|
2557
|
-
const {
|
|
2558
|
-
getFiles,
|
|
2559
|
-
fileUploaders,
|
|
2560
|
-
addFile,
|
|
2561
|
-
getFullFiles,
|
|
2562
|
-
deleteFile,
|
|
2563
|
-
upload: upload2,
|
|
2564
|
-
removeFiles
|
|
2565
|
-
} = useUpload();
|
|
2566
|
-
const {
|
|
2567
|
-
triggerSelectFiles,
|
|
2568
|
-
_validateFiles,
|
|
2569
|
-
triggerDropFiles
|
|
2570
|
-
} = useSelectFiles();
|
|
2571
|
-
const filename = computed(() => (getFiles()[0] || {}).name || "");
|
|
2572
|
-
const alertMsg = (errorMsg) => {
|
|
2573
|
-
ToastService.open({
|
|
2574
|
-
value: [{
|
|
2575
|
-
severity: "warn",
|
|
2576
|
-
content: errorMsg
|
|
2577
|
-
}]
|
|
2578
|
-
});
|
|
2579
|
-
};
|
|
2580
|
-
const canUpload = () => {
|
|
2581
|
-
let uploadResult = Promise.resolve(true);
|
|
2582
|
-
if (beforeUpload.value) {
|
|
2583
|
-
const result = beforeUpload.value(getFullFiles()[0] || {});
|
|
2584
|
-
if (typeof result !== "undefined") {
|
|
2585
|
-
if (result.then) {
|
|
2586
|
-
uploadResult = result;
|
|
2587
|
-
} else {
|
|
2588
|
-
uploadResult = Promise.resolve(result);
|
|
2589
|
-
}
|
|
2590
|
-
}
|
|
2591
|
-
}
|
|
2592
|
-
return uploadResult;
|
|
2593
|
-
};
|
|
2594
|
-
const fileUpload = () => {
|
|
2595
|
-
canUpload().then((canUpload2) => {
|
|
2596
|
-
if (!canUpload2) {
|
|
2597
|
-
return;
|
|
2598
|
-
}
|
|
2599
|
-
upload2().then((results) => {
|
|
2600
|
-
ctx.emit("successEvent", results);
|
|
2601
|
-
const newFiles = results.map((result) => result.file);
|
|
2602
|
-
const newUploadedFiles = [...newFiles, ...uploadedFiles.value];
|
|
2603
|
-
ctx.emit("update:uploadedFiles", newUploadedFiles);
|
|
2604
|
-
}).catch((error) => {
|
|
2605
|
-
console.error(error);
|
|
2606
|
-
if (fileUploaders.value[0]) {
|
|
2607
|
-
fileUploaders.value[0].percentage = 0;
|
|
2608
|
-
}
|
|
2609
|
-
ctx.emit("errorEvent", error);
|
|
2610
|
-
});
|
|
2611
|
-
});
|
|
2612
|
-
};
|
|
2613
|
-
const checkValid = () => {
|
|
2614
|
-
fileUploaders.value.forEach((fileUploader) => {
|
|
2615
|
-
const checkResult = _validateFiles(fileUploader.file, fileOptions.value.accept, fileUploader.uploadOptions);
|
|
2616
|
-
if (checkResult.checkError) {
|
|
2617
|
-
deleteFile(fileUploader.file);
|
|
2618
|
-
alertMsg(checkResult.errorMsg);
|
|
2619
|
-
}
|
|
2620
|
-
});
|
|
2621
|
-
};
|
|
2622
|
-
const _dealFiles = (promise) => {
|
|
2623
|
-
promise.then((files) => {
|
|
2624
|
-
var _a;
|
|
2625
|
-
files.forEach((file2) => {
|
|
2626
|
-
removeFiles();
|
|
2627
|
-
addFile(file2, uploadOptions.value);
|
|
2628
|
-
});
|
|
2629
|
-
checkValid();
|
|
2630
|
-
const file = (_a = fileUploaders.value[0]) == null ? void 0 : _a.file;
|
|
2631
|
-
if (props.onChange) {
|
|
2632
|
-
props.onChange(file);
|
|
2633
|
-
}
|
|
2634
|
-
if (file) {
|
|
2635
|
-
ctx.emit("fileSelect", file);
|
|
2636
|
-
}
|
|
2637
|
-
if (autoUpload.value) {
|
|
2638
|
-
fileUpload();
|
|
2639
|
-
}
|
|
2640
|
-
}).catch((error) => {
|
|
2641
|
-
alertMsg(error.message);
|
|
2642
|
-
});
|
|
2643
|
-
};
|
|
2644
|
-
const handleClick = () => {
|
|
2645
|
-
var _a;
|
|
2646
|
-
if (disabled.value || fileUploaders.value[0] && ((_a = fileUploaders.value[0]) == null ? void 0 : _a.status) === UploadStatus.uploading) {
|
|
2647
|
-
return;
|
|
907
|
+
function deepAssign(...objects) {
|
|
908
|
+
const isObject = (obj) => obj && typeof obj === "object";
|
|
909
|
+
return objects.reduce((prev, from) => {
|
|
910
|
+
Object.keys(from).forEach((key) => {
|
|
911
|
+
const pVal = prev[key];
|
|
912
|
+
const oVal = from[key];
|
|
913
|
+
if (Array.isArray(pVal) && Array.isArray(oVal)) {
|
|
914
|
+
prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
|
|
915
|
+
} else if (isObject(pVal) && isObject(oVal)) {
|
|
916
|
+
prev[key] = deepAssign(pVal, oVal);
|
|
917
|
+
} else {
|
|
918
|
+
prev[key] = oVal;
|
|
2648
919
|
}
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
const newUploadedFiles = uploadedFiles.value.filter((uploadedFile) => {
|
|
2658
|
-
return uploadedFile.name !== file.name;
|
|
2659
|
-
});
|
|
2660
|
-
ctx.emit("deleteUploadedFileEvent", file);
|
|
2661
|
-
ctx.emit("update:uploadedFiles", newUploadedFiles);
|
|
2662
|
-
};
|
|
2663
|
-
const onFileDrop = (files) => {
|
|
2664
|
-
isDropOVer.value = false;
|
|
2665
|
-
_dealFiles(triggerDropFiles(files));
|
|
2666
|
-
ctx.emit("fileDrop", files[0]);
|
|
2667
|
-
};
|
|
2668
|
-
const onFileOver = (event) => {
|
|
2669
|
-
isDropOVer.value = event;
|
|
2670
|
-
ctx.emit("fileOver", event);
|
|
2671
|
-
};
|
|
2672
|
-
return {
|
|
2673
|
-
placeholderText,
|
|
2674
|
-
filename,
|
|
2675
|
-
autoUpload,
|
|
2676
|
-
withoutBtn,
|
|
2677
|
-
fileUploaders,
|
|
2678
|
-
uploadText,
|
|
2679
|
-
handleClick,
|
|
2680
|
-
onDeleteFile,
|
|
2681
|
-
fileUpload,
|
|
2682
|
-
enableDrop,
|
|
2683
|
-
onFileDrop,
|
|
2684
|
-
onFileOver,
|
|
2685
|
-
isDropOVer,
|
|
2686
|
-
showTip,
|
|
2687
|
-
uploadedFiles,
|
|
2688
|
-
deleteUploadedFile
|
|
2689
|
-
};
|
|
920
|
+
});
|
|
921
|
+
return prev;
|
|
922
|
+
}, {});
|
|
923
|
+
}
|
|
924
|
+
var zhCN = {
|
|
925
|
+
pagination: {
|
|
926
|
+
totalItemText: "\u6240\u6709\u6761\u76EE",
|
|
927
|
+
goToText: "\u8DF3\u81F3"
|
|
2690
928
|
},
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
"
|
|
2728
|
-
},
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
"
|
|
2772
|
-
},
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
"
|
|
2781
|
-
}
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
929
|
+
accordion: {
|
|
930
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
931
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
932
|
+
},
|
|
933
|
+
autoCompleteDropdown: {
|
|
934
|
+
latestInput: "\u6700\u8FD1\u8F93\u5165"
|
|
935
|
+
},
|
|
936
|
+
cascaderList: {
|
|
937
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
938
|
+
},
|
|
939
|
+
colorPicker: {
|
|
940
|
+
foundationPanel: "\u57FA\u7840\u9762\u677F",
|
|
941
|
+
advancedPanel: "\u9AD8\u7EA7\u9762\u677F"
|
|
942
|
+
},
|
|
943
|
+
datePickerPro: {
|
|
944
|
+
ok: "\u786E\u5B9A",
|
|
945
|
+
placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F",
|
|
946
|
+
month1: "1\u6708",
|
|
947
|
+
month2: "2\u6708",
|
|
948
|
+
month3: "3\u6708",
|
|
949
|
+
month4: "4\u6708",
|
|
950
|
+
month5: "5\u6708",
|
|
951
|
+
month6: "6\u6708",
|
|
952
|
+
month7: "7\u6708",
|
|
953
|
+
month8: "8\u6708",
|
|
954
|
+
month9: "9\u6708",
|
|
955
|
+
month10: "10\u6708",
|
|
956
|
+
month11: "11\u6708",
|
|
957
|
+
month12: "12\u6708",
|
|
958
|
+
year: "\u5E74",
|
|
959
|
+
startPlaceholder: "\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",
|
|
960
|
+
endPlaceholder: "\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",
|
|
961
|
+
getWeekDays() {
|
|
962
|
+
return ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
|
|
963
|
+
},
|
|
964
|
+
getTimeArr() {
|
|
965
|
+
return ["\u65F6", "\u5206", "\u79D2"];
|
|
966
|
+
},
|
|
967
|
+
getYearMonthStr(year, month) {
|
|
968
|
+
return `${year}\u5E74${month}\u6708`;
|
|
969
|
+
}
|
|
970
|
+
},
|
|
971
|
+
editableSelect: {
|
|
972
|
+
noRelatedRecords: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
973
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
974
|
+
},
|
|
975
|
+
input: {
|
|
976
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
977
|
+
},
|
|
978
|
+
splitterBar: {
|
|
979
|
+
collapse: "\u6536\u8D77",
|
|
980
|
+
expand: "\u5C55\u5F00"
|
|
981
|
+
},
|
|
982
|
+
stepsGuide: {
|
|
983
|
+
previous: "\u4E0A\u4E00\u6B65",
|
|
984
|
+
continue: "\u6211\u77E5\u9053\u5566\uFF0C\u7EE7\u7EED",
|
|
985
|
+
ok: "\u6211\u77E5\u9053\u5566"
|
|
986
|
+
},
|
|
987
|
+
table: {
|
|
988
|
+
selectAll: "\u5168\u9009",
|
|
989
|
+
ok: "\u786E\u5B9A"
|
|
990
|
+
},
|
|
991
|
+
timePopup: {
|
|
992
|
+
ok: "\u786E\u5B9A"
|
|
993
|
+
},
|
|
994
|
+
transfer: {
|
|
995
|
+
unit: "\u9879",
|
|
996
|
+
panelUnit: "\u9879",
|
|
997
|
+
headerUnit: "\u9879",
|
|
998
|
+
noData: "\u6682\u65E0\u6570\u636E",
|
|
999
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"
|
|
1000
|
+
},
|
|
1001
|
+
tree: {
|
|
1002
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
1003
|
+
newNode: "\u65B0\u8282\u70B9",
|
|
1004
|
+
selectPlaceholder: "\u8BF7\u9009\u62E9"
|
|
1005
|
+
},
|
|
1006
|
+
upload: {
|
|
1007
|
+
placeholder: "\u9009\u62E9\u6587\u4EF6",
|
|
1008
|
+
getExistSameNameFilesMsg(sameNames) {
|
|
1009
|
+
return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
1010
|
+
},
|
|
1011
|
+
getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
|
|
1012
|
+
return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u672C\u6B21\u4E0A\u4F20\u7684\u6240\u6709\u6587\u4EF6\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
|
|
1013
|
+
},
|
|
1014
|
+
getBeyondMaximalFileSizeMsg(filename, maximalSize) {
|
|
1015
|
+
return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
|
|
1016
|
+
},
|
|
1017
|
+
getNotAllowedFileTypeMsg(filename, scope) {
|
|
1018
|
+
return `\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B: "${scope}", \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u4E0D\u5728\u5141\u8BB8\u8303\u56F4\u5185\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
1019
|
+
}
|
|
1020
|
+
},
|
|
1021
|
+
search: {
|
|
1022
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57"
|
|
1023
|
+
},
|
|
1024
|
+
select: {
|
|
1025
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
1026
|
+
noDataText: "\u65E0\u6570\u636E",
|
|
1027
|
+
noMatchText: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
1028
|
+
loadingText: "\u52A0\u8F7D\u4E2D..."
|
|
1029
|
+
},
|
|
1030
|
+
tagInput: {
|
|
1031
|
+
maxTagsText: "\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"
|
|
1032
|
+
},
|
|
1033
|
+
timeSelect: {
|
|
1034
|
+
placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
|
|
2797
1035
|
}
|
|
1036
|
+
};
|
|
1037
|
+
const lang = ref("zh-CN");
|
|
1038
|
+
let langMessages = reactive({
|
|
1039
|
+
[lang.value]: zhCN
|
|
2798
1040
|
});
|
|
2799
|
-
|
|
2800
|
-
|
|
1041
|
+
const Locale = {
|
|
1042
|
+
messages() {
|
|
1043
|
+
return langMessages[lang.value];
|
|
1044
|
+
},
|
|
1045
|
+
lang() {
|
|
1046
|
+
return lang.value;
|
|
1047
|
+
},
|
|
1048
|
+
use(newLang, newMessages) {
|
|
1049
|
+
lang.value = newLang;
|
|
1050
|
+
this.add({ [newLang]: newMessages });
|
|
1051
|
+
},
|
|
1052
|
+
add(newMessages = {}) {
|
|
1053
|
+
langMessages = deepAssign(langMessages, newMessages);
|
|
1054
|
+
}
|
|
1055
|
+
};
|
|
1056
|
+
const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
|
|
1057
|
+
function get(object, path) {
|
|
1058
|
+
const keys = path.split(".");
|
|
1059
|
+
let result = object;
|
|
1060
|
+
keys.forEach((key) => {
|
|
1061
|
+
var _a;
|
|
1062
|
+
result = (_a = result[key]) != null ? _a : "";
|
|
1063
|
+
});
|
|
1064
|
+
return result;
|
|
1065
|
+
}
|
|
1066
|
+
function createI18nTranslate(name, app, newPrefix) {
|
|
1067
|
+
const prefix = newPrefix || camelize(name) + ".";
|
|
1068
|
+
return (path) => {
|
|
1069
|
+
var _a;
|
|
1070
|
+
const messages = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
|
|
1071
|
+
const message = get(messages, prefix + path) || get(messages, path);
|
|
1072
|
+
return message;
|
|
1073
|
+
};
|
|
2801
1074
|
}
|
|
2802
|
-
var
|
|
2803
|
-
name: "
|
|
2804
|
-
props:
|
|
2805
|
-
emits: ["fileDrop", "fileOver", "fileSelect", "
|
|
1075
|
+
var Upload = defineComponent({
|
|
1076
|
+
name: "DUpload",
|
|
1077
|
+
props: uploadProps,
|
|
1078
|
+
emits: ["fileDrop", "fileOver", "fileSelect", "deleteUploadedFile", "update:modelValue"],
|
|
2806
1079
|
setup(props, ctx) {
|
|
1080
|
+
const app = getCurrentInstance();
|
|
1081
|
+
const t = createI18nTranslate("DUpload", app);
|
|
2807
1082
|
const {
|
|
2808
1083
|
uploadOptions,
|
|
2809
|
-
|
|
2810
|
-
placeholderText,
|
|
1084
|
+
placeholder,
|
|
2811
1085
|
autoUpload,
|
|
2812
|
-
withoutBtn,
|
|
2813
|
-
uploadText,
|
|
2814
1086
|
disabled,
|
|
2815
1087
|
beforeUpload,
|
|
2816
|
-
|
|
1088
|
+
droppable,
|
|
2817
1089
|
oneTimeUpload,
|
|
2818
|
-
|
|
2819
|
-
|
|
1090
|
+
modelValue,
|
|
1091
|
+
multiple,
|
|
1092
|
+
accept,
|
|
1093
|
+
webkitdirectory,
|
|
1094
|
+
limit,
|
|
1095
|
+
httpRequest
|
|
2820
1096
|
} = toRefs(props);
|
|
1097
|
+
const ns2 = useNamespace("upload");
|
|
1098
|
+
const inputGroupNs = useNamespace("input-group");
|
|
1099
|
+
const formControlNs = useNamespace("form-control");
|
|
1100
|
+
const inputGroupAddOnNs = useNamespace("input-group-addon");
|
|
2821
1101
|
const {
|
|
2822
1102
|
triggerSelectFiles,
|
|
2823
1103
|
_validateFiles,
|
|
2824
1104
|
triggerDropFiles,
|
|
2825
1105
|
checkAllFilesSize
|
|
2826
|
-
} = useSelectFiles();
|
|
1106
|
+
} = useSelectFiles(t);
|
|
2827
1107
|
const {
|
|
2828
|
-
getFiles,
|
|
2829
1108
|
fileUploaders,
|
|
2830
1109
|
addFile,
|
|
2831
1110
|
getFullFiles,
|
|
@@ -2836,21 +1115,20 @@ var MultiUpload = defineComponent({
|
|
|
2836
1115
|
_oneTimeUpload,
|
|
2837
1116
|
getSameNameFiles
|
|
2838
1117
|
} = useUpload();
|
|
2839
|
-
const
|
|
2840
|
-
const
|
|
1118
|
+
const isDropOver = ref(false);
|
|
1119
|
+
const selectedFiles = ref([]);
|
|
2841
1120
|
const alertMsg = (errorMsg) => {
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
content: errorMsg
|
|
2846
|
-
}]
|
|
1121
|
+
NotificationService.open({
|
|
1122
|
+
type: "warning",
|
|
1123
|
+
content: errorMsg
|
|
2847
1124
|
});
|
|
2848
1125
|
};
|
|
2849
1126
|
const checkValid = () => {
|
|
1127
|
+
var _a;
|
|
2850
1128
|
let totalFileSize = 0;
|
|
2851
1129
|
fileUploaders.value.forEach((fileUploader) => {
|
|
2852
1130
|
totalFileSize += fileUploader.file.size;
|
|
2853
|
-
const checkResult = _validateFiles(fileUploader.file,
|
|
1131
|
+
const checkResult = _validateFiles(fileUploader.file, (accept == null ? void 0 : accept.value) || "", fileUploader.uploadOptions);
|
|
2854
1132
|
if (checkResult && checkResult.checkError) {
|
|
2855
1133
|
deleteFile(fileUploader.file);
|
|
2856
1134
|
alertMsg(checkResult.errorMsg);
|
|
@@ -2858,68 +1136,40 @@ var MultiUpload = defineComponent({
|
|
|
2858
1136
|
}
|
|
2859
1137
|
});
|
|
2860
1138
|
if (oneTimeUpload.value) {
|
|
2861
|
-
const checkResult = checkAllFilesSize(totalFileSize, uploadOptions.value.maximumSize);
|
|
1139
|
+
const checkResult = checkAllFilesSize(totalFileSize, ((_a = uploadOptions == null ? void 0 : uploadOptions.value) == null ? void 0 : _a.maximumSize) || 0);
|
|
2862
1140
|
if (checkResult && checkResult.checkError) {
|
|
2863
1141
|
removeFiles();
|
|
2864
1142
|
alertMsg(checkResult.errorMsg);
|
|
2865
1143
|
}
|
|
2866
1144
|
}
|
|
2867
1145
|
};
|
|
2868
|
-
const _dealFiles = (promise) => {
|
|
2869
|
-
resetSameNameFiles();
|
|
2870
|
-
promise.then((files) => {
|
|
2871
|
-
files.forEach((file) => {
|
|
2872
|
-
addFile(file, uploadOptions.value);
|
|
2873
|
-
});
|
|
2874
|
-
checkValid();
|
|
2875
|
-
const sameNameFiles = getSameNameFiles();
|
|
2876
|
-
if (uploadOptions.value.checkSameName && sameNameFiles.length) {
|
|
2877
|
-
alertMsg(getExistSameNameFilesMsg(sameNameFiles));
|
|
2878
|
-
}
|
|
2879
|
-
const selectedFiles = fileUploaders.value.filter((fileUploader) => fileUploader.status === UploadStatus.preLoad).map((fileUploader) => fileUploader.file);
|
|
2880
|
-
ctx.emit("fileSelect", selectedFiles);
|
|
2881
|
-
if (autoUpload.value) {
|
|
2882
|
-
upload2();
|
|
2883
|
-
}
|
|
2884
|
-
}).catch((error) => {
|
|
2885
|
-
alertMsg(error.message);
|
|
2886
|
-
});
|
|
2887
|
-
};
|
|
2888
|
-
const handleClick = () => {
|
|
2889
|
-
if (disabled.value) {
|
|
2890
|
-
return;
|
|
2891
|
-
}
|
|
2892
|
-
_dealFiles(triggerSelectFiles(fileOptions.value));
|
|
2893
|
-
};
|
|
2894
|
-
const onFileDrop = (files) => {
|
|
2895
|
-
isDropOVer.value = false;
|
|
2896
|
-
_dealFiles(triggerDropFiles(files));
|
|
2897
|
-
ctx.emit("fileDrop", files);
|
|
2898
|
-
};
|
|
2899
1146
|
const onFileOver = (event) => {
|
|
2900
|
-
|
|
1147
|
+
isDropOver.value = event;
|
|
2901
1148
|
ctx.emit("fileOver", event);
|
|
2902
1149
|
};
|
|
2903
|
-
const onDeleteFile = (event, file) => {
|
|
2904
|
-
event.stopPropagation();
|
|
2905
|
-
deleteFile(file);
|
|
2906
|
-
};
|
|
2907
1150
|
const deleteUploadedFile = (file) => {
|
|
2908
|
-
const newUploadedFiles =
|
|
1151
|
+
const newUploadedFiles = modelValue.value.filter((uploadedFile) => {
|
|
2909
1152
|
return uploadedFile.name !== file.name;
|
|
2910
1153
|
});
|
|
2911
|
-
ctx.emit("
|
|
2912
|
-
ctx.emit("update:
|
|
1154
|
+
ctx.emit("deleteUploadedFile", file);
|
|
1155
|
+
ctx.emit("update:modelValue", newUploadedFiles);
|
|
1156
|
+
};
|
|
1157
|
+
const onDeleteFile = (event, file, status) => {
|
|
1158
|
+
event == null ? void 0 : event.stopPropagation();
|
|
1159
|
+
if (status === UploadStatus.uploaded) {
|
|
1160
|
+
deleteUploadedFile(file);
|
|
1161
|
+
}
|
|
1162
|
+
deleteFile(file);
|
|
2913
1163
|
};
|
|
2914
1164
|
const canUpload = () => {
|
|
2915
1165
|
let uploadResult = Promise.resolve(true);
|
|
2916
|
-
if (beforeUpload.value) {
|
|
2917
|
-
const result = beforeUpload.value(getFullFiles());
|
|
1166
|
+
if (beforeUpload == null ? void 0 : beforeUpload.value) {
|
|
1167
|
+
const result = beforeUpload == null ? void 0 : beforeUpload.value(getFullFiles());
|
|
2918
1168
|
if (typeof result !== "undefined") {
|
|
2919
|
-
if (result
|
|
2920
|
-
uploadResult = result;
|
|
2921
|
-
} else {
|
|
1169
|
+
if (typeof result === "boolean") {
|
|
2922
1170
|
uploadResult = Promise.resolve(result);
|
|
1171
|
+
} else {
|
|
1172
|
+
uploadResult = result;
|
|
2923
1173
|
}
|
|
2924
1174
|
}
|
|
2925
1175
|
}
|
|
@@ -2934,165 +1184,139 @@ var MultiUpload = defineComponent({
|
|
|
2934
1184
|
removeFiles();
|
|
2935
1185
|
return;
|
|
2936
1186
|
}
|
|
1187
|
+
if (typeof (httpRequest == null ? void 0 : httpRequest.value) === "function") {
|
|
1188
|
+
const files = fileUploaders.value.map((tempFileUploader) => tempFileUploader.file);
|
|
1189
|
+
httpRequest.value(files);
|
|
1190
|
+
return;
|
|
1191
|
+
}
|
|
2937
1192
|
const uploadObservable = oneTimeUpload.value ? _oneTimeUpload() : upload2(fileUploader);
|
|
2938
|
-
|
|
2939
|
-
|
|
1193
|
+
props.onProgress && props.onProgress(selectedFiles.value, modelValue.value);
|
|
1194
|
+
uploadObservable == null ? void 0 : uploadObservable.then((results) => {
|
|
1195
|
+
props.onSuccess && props.onSuccess(results);
|
|
2940
1196
|
const newFiles = results.map((result) => result.file);
|
|
2941
|
-
const newUploadedFiles = [...newFiles, ...
|
|
2942
|
-
ctx.emit("update:
|
|
1197
|
+
const newUploadedFiles = [...newFiles, ...modelValue.value];
|
|
1198
|
+
ctx.emit("update:modelValue", newUploadedFiles);
|
|
1199
|
+
props.onChange && props.onChange(newFiles, newUploadedFiles);
|
|
2943
1200
|
}).catch((error) => {
|
|
2944
|
-
|
|
1201
|
+
props.onError && props.onError(error);
|
|
1202
|
+
props.onChange && props.onChange([error.file], modelValue.value);
|
|
2945
1203
|
});
|
|
2946
1204
|
});
|
|
2947
1205
|
};
|
|
2948
|
-
const
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
1206
|
+
const _dealFiles = (promise) => {
|
|
1207
|
+
resetSameNameFiles();
|
|
1208
|
+
promise.then((files) => {
|
|
1209
|
+
if (limit.value && modelValue.value.length + files.length > limit.value) {
|
|
1210
|
+
props.onExceed && props.onExceed(files, modelValue.value);
|
|
1211
|
+
return;
|
|
1212
|
+
}
|
|
1213
|
+
props.onChange && props.onChange(files, modelValue.value);
|
|
1214
|
+
files.forEach((file) => {
|
|
1215
|
+
if (!multiple.value) {
|
|
1216
|
+
removeFiles();
|
|
1217
|
+
}
|
|
1218
|
+
addFile(file, uploadOptions == null ? void 0 : uploadOptions.value);
|
|
1219
|
+
});
|
|
1220
|
+
checkValid();
|
|
1221
|
+
const sameNameFiles = getSameNameFiles();
|
|
1222
|
+
if ((uploadOptions == null ? void 0 : uploadOptions.value) && uploadOptions.value.checkSameName && sameNameFiles.length) {
|
|
1223
|
+
alertMsg(t("getExistSameNameFilesMsg")(sameNameFiles));
|
|
2960
1224
|
}
|
|
1225
|
+
selectedFiles.value = fileUploaders.value.filter((fileUploader) => fileUploader.status === UploadStatus.preLoad).map((fileUploader) => fileUploader.file);
|
|
1226
|
+
ctx.emit("fileSelect", selectedFiles.value);
|
|
1227
|
+
if (autoUpload.value) {
|
|
1228
|
+
fileUpload();
|
|
1229
|
+
}
|
|
1230
|
+
}).catch((error) => {
|
|
1231
|
+
alertMsg(error.message);
|
|
2961
1232
|
});
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
if (uploadingCount > 0) {
|
|
2967
|
-
uploadTips.value = getUploadingFilesCount(uploadingCount, filesCount);
|
|
2968
|
-
return "uploading";
|
|
2969
|
-
}
|
|
2970
|
-
if (uploadedCount === filesCount && uploadedCount !== 0) {
|
|
2971
|
-
return "uploaded";
|
|
2972
|
-
}
|
|
2973
|
-
if (filesCount !== 0) {
|
|
2974
|
-
uploadTips.value = getSelectedFilesCount(filesCount);
|
|
2975
|
-
return "selected";
|
|
1233
|
+
};
|
|
1234
|
+
const handleClick = () => {
|
|
1235
|
+
if (disabled.value) {
|
|
1236
|
+
return;
|
|
2976
1237
|
}
|
|
1238
|
+
_dealFiles(triggerSelectFiles({
|
|
1239
|
+
accept: accept == null ? void 0 : accept.value,
|
|
1240
|
+
multiple: multiple.value,
|
|
1241
|
+
webkitdirectory: webkitdirectory.value
|
|
1242
|
+
}));
|
|
2977
1243
|
};
|
|
2978
|
-
const
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
1244
|
+
const onFileDrop = (files) => {
|
|
1245
|
+
isDropOver.value = false;
|
|
1246
|
+
_dealFiles(triggerDropFiles(files));
|
|
1247
|
+
ctx.emit("fileDrop", files);
|
|
1248
|
+
};
|
|
1249
|
+
const submit = (event, fileUploader) => {
|
|
1250
|
+
fileUpload(event, fileUploader);
|
|
1251
|
+
};
|
|
1252
|
+
const clearFiles = (event) => {
|
|
1253
|
+
fileUploaders.value.forEach((fileUploader) => {
|
|
1254
|
+
onDeleteFile(event, fileUploader.file, fileUploader.status);
|
|
2985
1255
|
});
|
|
2986
1256
|
};
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
1257
|
+
const clickSelectedFile = (event, file) => {
|
|
1258
|
+
event == null ? void 0 : event.stopPropagation();
|
|
1259
|
+
props.onPreview && props.onPreview(file);
|
|
1260
|
+
};
|
|
1261
|
+
ctx.expose({
|
|
1262
|
+
submit,
|
|
1263
|
+
clearFiles
|
|
1264
|
+
});
|
|
1265
|
+
return () => {
|
|
1266
|
+
var _a, _b, _c, _d;
|
|
1267
|
+
return createVNode("div", null, [withDirectives(createVNode("div", {
|
|
1268
|
+
"class": ns2.b(),
|
|
1269
|
+
"style": `border: ${isDropOver.value ? "1px solid #15bf15" : "0"}`
|
|
1270
|
+
}, [((_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)) ? createVNode("div", {
|
|
1271
|
+
"onClick": handleClick
|
|
1272
|
+
}, [ctx.slots.default()]) : createVNode("div", {
|
|
1273
|
+
"class": [inputGroupNs.b(), disabled.value ? "disabled" : ""],
|
|
1274
|
+
"onClick": handleClick
|
|
1275
|
+
}, [fileUploaders.value.length === 0 && createVNode("div", {
|
|
1276
|
+
"class": [formControlNs.b(), ns2.e("placeholder")]
|
|
1277
|
+
}, [placeholder.value || t("placeholder")]), fileUploaders.value.length > 0 && createVNode("ul", {
|
|
1278
|
+
"class": [formControlNs.b(), ns2.e("files-list")]
|
|
1279
|
+
}, [fileUploaders.value.map((fileUploader, index2) => createVNode("li", {
|
|
1280
|
+
"key": index2,
|
|
1281
|
+
"class": [ns2.e("file-item"), ns2.e("file-tag")],
|
|
1282
|
+
"style": "display: inline-block;",
|
|
1283
|
+
"title": fileUploader.file.name,
|
|
1284
|
+
"onClick": (event) => clickSelectedFile(event, fileUploader.file)
|
|
1285
|
+
}, [createVNode("span", {
|
|
1286
|
+
"class": [ns2.e("filename"), fileUploader.status === UploadStatus.failed ? ns2.m("failed-color") : ""]
|
|
1287
|
+
}, [fileUploader.file.name]), createVNode(resolveComponent("d-icon"), {
|
|
1288
|
+
"name": "close",
|
|
1289
|
+
"class": [(fileUploader == null ? void 0 : fileUploader.status) === UploadStatus.failed ? ns2.e("delete-file-button") : "", (fileUploader == null ? void 0 : fileUploader.status) === UploadStatus.uploading || (fileUploader == null ? void 0 : fileUploader.status) === UploadStatus.uploaded ? ns2.e("delete") : ""],
|
|
1290
|
+
"onClick": (event) => onDeleteFile(event, fileUploader.file, fileUploader.status)
|
|
1291
|
+
}, null), fileUploader.status === UploadStatus.uploading && createVNode("div", {
|
|
1292
|
+
"class": ["icon", ns2.e("progress")]
|
|
1293
|
+
}, [createVNode(resolveComponent("d-progress"), {
|
|
1294
|
+
"isCircle": true,
|
|
1295
|
+
"percentage": fileUploader.percentage,
|
|
1296
|
+
"barbgcolor": "#50D4AB",
|
|
1297
|
+
"strokeWidth": 8,
|
|
1298
|
+
"showContent": false
|
|
1299
|
+
}, null)]), fileUploader.status === UploadStatus.failed && createVNode(resolveComponent("d-icon"), {
|
|
1300
|
+
"name": "running",
|
|
1301
|
+
"onClick": fileUpload
|
|
1302
|
+
}, null), fileUploader.status === UploadStatus.uploaded && createVNode(resolveComponent("d-icon"), {
|
|
1303
|
+
"name": "right",
|
|
1304
|
+
"color": "#50d4ab"
|
|
1305
|
+
}, null)]))]), createVNode("span", {
|
|
1306
|
+
"class": inputGroupAddOnNs.b()
|
|
1307
|
+
}, [createVNode(resolveComponent("d-icon"), {
|
|
1308
|
+
"name": "more-operate",
|
|
1309
|
+
"color": "#252b3a"
|
|
1310
|
+
}, null)])])]), [[resolveDirective("file-drop"), {
|
|
1311
|
+
droppable,
|
|
1312
|
+
isSingle: !multiple,
|
|
1313
|
+
onFileDrop,
|
|
1314
|
+
onFileOver
|
|
1315
|
+
}]]), createVNode("div", null, [(_d = (_c = ctx.slots)["uploaded-files"]) == null ? void 0 : _d.call(_c, {
|
|
1316
|
+
uploadedFiles: modelValue.value,
|
|
1317
|
+
deleteFile: deleteUploadedFile
|
|
1318
|
+
})])]);
|
|
3009
1319
|
};
|
|
3010
|
-
},
|
|
3011
|
-
render() {
|
|
3012
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3013
|
-
const {
|
|
3014
|
-
placeholderText,
|
|
3015
|
-
autoUpload,
|
|
3016
|
-
withoutBtn,
|
|
3017
|
-
uploadText,
|
|
3018
|
-
disabled,
|
|
3019
|
-
beforeUpload,
|
|
3020
|
-
enableDrop,
|
|
3021
|
-
isDropOVer,
|
|
3022
|
-
onFileDrop,
|
|
3023
|
-
onFileOver,
|
|
3024
|
-
handleClick,
|
|
3025
|
-
fileUploaders,
|
|
3026
|
-
onDeleteFile,
|
|
3027
|
-
fileUpload,
|
|
3028
|
-
showTip,
|
|
3029
|
-
getStatus,
|
|
3030
|
-
uploadTips,
|
|
3031
|
-
cancelUpload,
|
|
3032
|
-
uploadedFiles,
|
|
3033
|
-
deleteUploadedFile
|
|
3034
|
-
} = this;
|
|
3035
|
-
return createVNode(Fragment, null, [withDirectives(createVNode("div", {
|
|
3036
|
-
"class": "devui-upload",
|
|
3037
|
-
"style": `border: ${isDropOVer ? "1px solid #15bf15" : "0"}`
|
|
3038
|
-
}, [((_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)) ? createVNode("div", {
|
|
3039
|
-
"onClick": handleClick
|
|
3040
|
-
}, [this.$slots.default()]) : createVNode("div", {
|
|
3041
|
-
"class": `devui-input-group ${disabled ? "disabled" : ""}`,
|
|
3042
|
-
"onClick": handleClick
|
|
3043
|
-
}, [fileUploaders.length === 0 && createVNode("div", {
|
|
3044
|
-
"class": "devui-form-control devui-upload-placeholder"
|
|
3045
|
-
}, [placeholderText]), fileUploaders.length > 0 && createVNode("ul", {
|
|
3046
|
-
"class": "devui-form-control devui-files-list"
|
|
3047
|
-
}, [fileUploaders.map((fileUploader, index2) => createVNode("li", {
|
|
3048
|
-
"key": index2,
|
|
3049
|
-
"class": "devui-file-item devui-file-tag",
|
|
3050
|
-
"style": "display: inline-block; margin: 0 2px 2px 0",
|
|
3051
|
-
"title": fileUploader.file.name
|
|
3052
|
-
}, [createVNode("span", {
|
|
3053
|
-
"class": `evui-filename ${fileUploader.status === UploadStatus.failed ? "devui-failed-color" : ""}`
|
|
3054
|
-
}, [fileUploader.file.name]), createVNode(resolveComponent("d-icon"), {
|
|
3055
|
-
"name": "close",
|
|
3056
|
-
"class": `${(fileUploader == null ? void 0 : fileUploader.status) === UploadStatus.failed ? "devui-upload-delete-file-button" : ""} ${(fileUploader == null ? void 0 : fileUploader.status) === UploadStatus.uploading || (fileUploader == null ? void 0 : fileUploader.status) === UploadStatus.uploaded ? "devui-uploading-delete" : ""}`,
|
|
3057
|
-
"onClick": (event) => onDeleteFile(event, fileUploader.file)
|
|
3058
|
-
}, null), fileUploader.status === UploadStatus.uploading && createVNode("div", {
|
|
3059
|
-
"class": "icon devui-upload-progress"
|
|
3060
|
-
}, [createVNode(resolveComponent("d-progress"), {
|
|
3061
|
-
"isCircle": true,
|
|
3062
|
-
"percentage": fileUploader.percentage,
|
|
3063
|
-
"barbgcolor": "#50D4AB",
|
|
3064
|
-
"strokeWidth": 8,
|
|
3065
|
-
"showContent": false
|
|
3066
|
-
}, null)]), fileUploader.status === UploadStatus.failed && createVNode(resolveComponent("d-icon"), {
|
|
3067
|
-
"name": "running",
|
|
3068
|
-
"onClick": fileUpload
|
|
3069
|
-
}, null), fileUploader.status === UploadStatus.uploaded && createVNode(resolveComponent("d-icon"), {
|
|
3070
|
-
"name": "right",
|
|
3071
|
-
"color": "#50d4ab"
|
|
3072
|
-
}, null)]))]), createVNode("span", {
|
|
3073
|
-
"class": "devui-input-group-addon"
|
|
3074
|
-
}, [createVNode(resolveComponent("d-icon"), {
|
|
3075
|
-
"name": "more-operate",
|
|
3076
|
-
"color": "#252b3a"
|
|
3077
|
-
}, null)])]), !autoUpload && !withoutBtn && createVNode(resolveComponent("d-button"), {
|
|
3078
|
-
"style": "marginLeft: 8px",
|
|
3079
|
-
"bsStyle": "common",
|
|
3080
|
-
"disabled": disabled,
|
|
3081
|
-
"onClick": fileUpload
|
|
3082
|
-
}, _isSlot(uploadText) ? uploadText : {
|
|
3083
|
-
default: () => [uploadText]
|
|
3084
|
-
})]), [[resolveDirective("file-drop"), {
|
|
3085
|
-
enableDrop,
|
|
3086
|
-
isSingle: false,
|
|
3087
|
-
onFileDrop,
|
|
3088
|
-
onFileOver
|
|
3089
|
-
}]]), createVNode("div", null, [(_d = (_c = this.$slots).preloadFiles) == null ? void 0 : _d.call(_c, {
|
|
3090
|
-
fileUploaders,
|
|
3091
|
-
deleteFile: onDeleteFile
|
|
3092
|
-
})]), createVNode("div", null, [(_f = (_e = this.$slots).uploadedFiles) == null ? void 0 : _f.call(_e, {
|
|
3093
|
-
uploadedFiles,
|
|
3094
|
-
deleteFile: deleteUploadedFile
|
|
3095
|
-
})])]);
|
|
3096
1320
|
}
|
|
3097
1321
|
});
|
|
3098
1322
|
const getTransfer = (event) => {
|
|
@@ -3147,14 +1371,14 @@ const onDrop = (el, binding) => {
|
|
|
3147
1371
|
if (isSingle) {
|
|
3148
1372
|
onFileDrop && onFileDrop([transfer.files[0]]);
|
|
3149
1373
|
} else {
|
|
3150
|
-
onFileDrop && onFileDrop(transfer.files);
|
|
1374
|
+
onFileDrop && onFileDrop(Array.from(transfer.files));
|
|
3151
1375
|
}
|
|
3152
1376
|
});
|
|
3153
1377
|
};
|
|
3154
1378
|
const fileDropDirective = {
|
|
3155
1379
|
mounted: (el, binding) => {
|
|
3156
|
-
const {
|
|
3157
|
-
if (!
|
|
1380
|
+
const { droppable } = binding.value;
|
|
1381
|
+
if (!droppable) {
|
|
3158
1382
|
return;
|
|
3159
1383
|
}
|
|
3160
1384
|
onDragOver(el, binding);
|
|
@@ -3162,17 +1386,13 @@ const fileDropDirective = {
|
|
|
3162
1386
|
onDrop(el, binding);
|
|
3163
1387
|
}
|
|
3164
1388
|
};
|
|
3165
|
-
Upload.install = function(app) {
|
|
3166
|
-
app.directive("file-drop", fileDropDirective);
|
|
3167
|
-
app.component(Upload.name, Upload);
|
|
3168
|
-
app.component(MultiUpload.name, MultiUpload);
|
|
3169
|
-
};
|
|
3170
1389
|
var index = {
|
|
3171
1390
|
title: "Upload \u4E0A\u4F20",
|
|
3172
1391
|
category: "\u6570\u636E\u5F55\u5165",
|
|
3173
|
-
status: "
|
|
1392
|
+
status: "100%",
|
|
3174
1393
|
install(app) {
|
|
3175
|
-
app.
|
|
1394
|
+
app.directive("file-drop", fileDropDirective);
|
|
1395
|
+
app.component(Upload.name, Upload);
|
|
3176
1396
|
}
|
|
3177
1397
|
};
|
|
3178
|
-
export {
|
|
1398
|
+
export { IFileOptions, IUploadOptions, Upload, UploadStatus, index as default, uploadProps };
|