vue-devui 1.0.0-alpha.0 → 1.0.0-alpha.11
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 +140 -38
- package/alert/index.d.ts +7 -0
- package/alert/index.es.js +204 -1
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.d.ts +7 -0
- package/auto-complete/index.es.js +9051 -0
- package/auto-complete/index.umd.js +40 -0
- package/auto-complete/package.json +7 -0
- package/auto-complete/style.css +1 -0
- package/avatar/index.d.ts +7 -0
- package/avatar/index.es.js +308 -1
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.d.ts +7 -0
- package/badge/index.es.js +120 -1
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.d.ts +7 -0
- package/button/index.es.js +5964 -1
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.d.ts +7 -0
- package/card/index.es.js +89 -1
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.d.ts +7 -0
- package/checkbox/index.es.js +8207 -1
- package/checkbox/index.umd.js +38 -1
- package/checkbox/style.css +1 -1
- package/collapse/index.d.ts +7 -0
- package/collapse/index.es.js +195 -0
- package/collapse/index.umd.js +1 -0
- package/{carousel → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.d.ts +7 -0
- package/countdown/index.es.js +217 -0
- package/countdown/index.umd.js +1 -0
- package/{accordion → countdown}/package.json +1 -1
- package/countdown/style.css +1 -0
- package/date-picker-pro/index.d.ts +7 -0
- package/date-picker-pro/index.es.js +12031 -0
- package/date-picker-pro/index.umd.js +38 -0
- package/date-picker-pro/package.json +7 -0
- package/date-picker-pro/style.css +1 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +248 -0
- package/drawer/index.umd.js +1 -0
- package/{anchor → drawer}/package.json +1 -1
- package/drawer/style.css +1 -0
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +743 -0
- package/dropdown/index.umd.js +1 -0
- package/dropdown/package.json +7 -0
- package/dropdown/style.css +1 -0
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +991 -0
- package/editable-select/index.umd.js +1 -0
- package/editable-select/package.json +7 -0
- package/editable-select/style.css +1 -0
- package/form/index.d.ts +7 -0
- package/form/index.es.js +7751 -0
- package/form/index.umd.js +38 -0
- package/{theme → form}/package.json +1 -1
- package/form/style.css +1 -0
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +166 -0
- package/fullscreen/index.umd.js +1 -0
- package/fullscreen/package.json +7 -0
- package/fullscreen/style.css +1 -0
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +271 -0
- package/grid/index.umd.js +1 -0
- package/{toast → grid}/package.json +1 -1
- package/grid/style.css +1 -0
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +218 -1
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.d.ts +7 -0
- package/image-preview/index.es.js +511 -1
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/index.d.ts +7 -0
- package/input/index.d.ts +7 -0
- package/input/index.es.js +8311 -1
- package/input/index.umd.js +38 -1
- package/input/style.css +1 -1
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +308 -0
- package/input-number/index.umd.js +1 -0
- package/input-number/package.json +7 -0
- package/input-number/style.css +1 -0
- package/layout/index.d.ts +7 -0
- package/layout/index.es.js +115 -0
- package/layout/index.umd.js +1 -0
- package/layout/package.json +7 -0
- package/layout/style.css +1 -0
- package/loading/index.d.ts +7 -0
- package/loading/index.es.js +272 -1
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/message/index.d.ts +7 -0
- package/message/index.es.js +534 -0
- package/message/index.umd.js +1 -0
- package/message/package.json +7 -0
- package/message/style.css +1 -0
- package/modal/index.d.ts +7 -0
- package/modal/index.es.js +741 -0
- package/modal/index.umd.js +1 -0
- package/modal/package.json +7 -0
- package/modal/style.css +1 -0
- package/notification/index.d.ts +7 -0
- package/notification/index.es.js +528 -0
- package/notification/index.umd.js +1 -0
- package/notification/package.json +7 -0
- package/notification/style.css +1 -0
- package/nuxt/components/Alert.js +3 -0
- package/nuxt/components/Aside.js +3 -0
- package/nuxt/components/AutoComplete.js +3 -0
- package/nuxt/components/Avatar.js +3 -0
- package/nuxt/components/Badge.js +3 -0
- package/nuxt/components/Button.js +3 -0
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/Card.js +3 -0
- package/nuxt/components/Checkbox.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Col.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/Content.js +3 -0
- package/nuxt/components/Countdown.js +3 -0
- package/nuxt/components/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.js +3 -0
- package/nuxt/components/Drawer.js +3 -0
- package/nuxt/components/DrawerService.js +3 -0
- package/nuxt/components/Dropdown.js +3 -0
- package/nuxt/components/DropdownMenu.js +3 -0
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/EditableSelect.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/FixedOverlay.js +3 -0
- package/nuxt/components/FlexibleOverlay.js +3 -0
- package/nuxt/components/Footer.js +3 -0
- package/nuxt/components/Form.js +3 -0
- package/nuxt/components/FormItem.js +3 -0
- package/nuxt/components/FormOperation.js +3 -0
- package/nuxt/components/Fullscreen.js +3 -0
- package/nuxt/components/Header.js +3 -0
- package/nuxt/components/IFileOptions.js +3 -0
- package/nuxt/components/IUploadOptions.js +3 -0
- package/nuxt/components/Icon.js +3 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/ImagePreviewService.js +3 -0
- package/nuxt/components/Input.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/Layout.js +3 -0
- package/nuxt/components/Loading.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/LoadingService.js +3 -0
- package/nuxt/components/Message.js +3 -0
- package/nuxt/components/Modal.js +3 -0
- package/nuxt/components/Notification.js +3 -0
- package/nuxt/components/NotificationService.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/OptionGroup.js +3 -0
- package/nuxt/components/Pagination.js +3 -0
- package/nuxt/components/Panel.js +3 -0
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.js +3 -0
- package/nuxt/components/Popover.js +3 -0
- package/nuxt/components/Progress.js +3 -0
- package/nuxt/components/Radio.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/RadioGroup.js +3 -0
- package/nuxt/components/Rate.js +3 -0
- package/nuxt/components/Result.js +3 -0
- package/nuxt/components/Row.js +3 -0
- package/nuxt/components/Search.js +3 -0
- package/nuxt/components/Select.js +3 -0
- package/nuxt/components/Skeleton.js +3 -0
- package/nuxt/components/SkeletonItem.js +3 -0
- package/nuxt/components/Slider.js +3 -0
- package/nuxt/components/Splitter.js +3 -0
- package/nuxt/components/Statistic.js +3 -0
- package/nuxt/components/Status.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/Switch.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/Table.js +3 -0
- package/nuxt/components/Tabs.js +3 -0
- package/nuxt/components/Tag.js +3 -0
- package/nuxt/components/Textarea.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/TimeSelect.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/Tooltip.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/Upload.js +3 -0
- package/nuxt/components/UploadStatus.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/animationInjectionKey.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/badgeProps.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/buttonProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.js +3 -0
- package/nuxt/components/dropdownMenuProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/fixedOverlayProps.js +3 -0
- package/nuxt/components/flexibleOverlayProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +3 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/messageProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/notificationProps.js +3 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/popoverProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/roundInjectionKey.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/skeletonItemProps.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tableProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/nuxt/components/tooltipProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/nuxt/components/uploadProps.js +3 -0
- package/nuxt/index.js +13 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +293 -1
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +17 -78
- package/pagination/index.d.ts +7 -0
- package/pagination/index.es.js +820 -1
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/index.d.ts +7 -0
- package/panel/index.es.js +218 -1
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.d.ts +7 -0
- package/popover/index.es.js +6062 -0
- package/popover/index.umd.js +27 -0
- package/popover/package.json +7 -0
- package/popover/style.css +1 -0
- package/progress/index.d.ts +7 -0
- package/progress/index.es.js +207 -1
- package/progress/index.umd.js +3 -1
- package/progress/style.css +1 -1
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +8056 -1
- package/radio/index.umd.js +38 -1
- package/radio/style.css +1 -1
- package/rate/index.d.ts +7 -0
- package/rate/index.es.js +242 -1
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.d.ts +7 -0
- package/result/index.es.js +248 -0
- package/result/index.umd.js +1 -0
- package/result/package.json +7 -0
- package/result/style.css +1 -0
- package/ripple/index.d.ts +7 -0
- package/ripple/index.es.js +173 -0
- package/ripple/index.umd.js +1 -0
- package/ripple/package.json +7 -0
- package/search/index.d.ts +7 -0
- package/search/index.es.js +8504 -2
- package/search/index.umd.js +38 -10
- package/search/style.css +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +9423 -1
- package/select/index.umd.js +38 -1
- package/select/style.css +1 -1
- package/skeleton/index.d.ts +7 -0
- package/skeleton/index.es.js +145 -0
- package/skeleton/index.umd.js +1 -0
- package/skeleton/package.json +7 -0
- package/skeleton/style.css +1 -0
- package/slider/index.d.ts +7 -0
- package/slider/index.es.js +203 -1
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.d.ts +7 -0
- package/splitter/index.es.js +6754 -0
- package/splitter/index.umd.js +27 -0
- package/splitter/package.json +7 -0
- package/splitter/style.css +1 -0
- package/statistic/index.d.ts +7 -0
- package/statistic/index.es.js +253 -0
- package/statistic/index.umd.js +1 -0
- package/{tag-input → statistic}/package.json +1 -1
- package/statistic/style.css +1 -0
- package/status/index.d.ts +7 -0
- package/status/index.es.js +63 -1
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/steps/index.d.ts +7 -0
- package/steps/index.es.js +386 -0
- package/steps/index.umd.js +1 -0
- package/steps/package.json +7 -0
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.d.ts +7 -0
- package/switch/index.es.js +7852 -1
- package/switch/index.umd.js +38 -1
- package/switch/style.css +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +11527 -0
- package/table/index.umd.js +38 -0
- package/table/package.json +7 -0
- package/table/style.css +1 -0
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +407 -1
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.d.ts +7 -0
- package/tag/index.es.js +156 -0
- package/tag/index.umd.js +1 -0
- package/tag/package.json +7 -0
- package/tag/style.css +1 -0
- package/textarea/index.d.ts +7 -0
- package/textarea/index.es.js +7986 -0
- package/textarea/index.umd.js +46 -0
- package/textarea/package.json +7 -0
- package/textarea/style.css +1 -0
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +9556 -0
- package/time-picker/index.umd.js +38 -0
- package/{date-picker → time-picker}/package.json +1 -1
- package/time-picker/style.css +1 -0
- package/time-select/index.d.ts +7 -0
- package/time-select/index.es.js +9604 -0
- package/time-select/index.umd.js +38 -0
- package/time-select/package.json +7 -0
- package/time-select/style.css +1 -0
- package/timeline/index.d.ts +7 -0
- package/timeline/index.es.js +427 -0
- package/timeline/index.umd.js +1 -0
- package/timeline/package.json +7 -0
- package/timeline/style.css +1 -0
- package/tooltip/index.d.ts +7 -0
- package/tooltip/index.es.js +5900 -0
- package/tooltip/index.umd.js +27 -0
- package/tooltip/package.json +7 -0
- package/tooltip/style.css +1 -0
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +10336 -0
- package/tree/index.umd.js +38 -0
- package/tree/package.json +7 -0
- package/tree/style.css +1 -0
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +1398 -15
- package/upload/index.umd.js +1 -15
- package/upload/style.css +1 -1
- package/vue-devui.es.js +27443 -16
- package/vue-devui.umd.js +50 -24
- package/accordion/index.es.js +0 -1
- package/accordion/index.umd.js +0 -1
- package/accordion/style.css +0 -1
- package/anchor/index.es.js +0 -1
- package/anchor/index.umd.js +0 -1
- package/carousel/index.es.js +0 -1
- package/carousel/index.umd.js +0 -1
- package/carousel/style.css +0 -1
- package/date-picker/index.es.js +0 -1
- package/date-picker/index.umd.js +0 -1
- package/date-picker/style.css +0 -1
- package/quadrant-diagram/index.es.js +0 -10
- package/quadrant-diagram/index.umd.js +0 -10
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/tag-input/index.es.js +0 -1
- package/tag-input/index.umd.js +0 -1
- package/tag-input/style.css +0 -1
- package/theme/index.es.js +0 -1
- package/theme/index.umd.js +0 -1
- package/toast/index.es.js +0 -1
- package/toast/index.umd.js +0 -1
- package/toast/style.css +0 -1
package/upload/index.es.js
CHANGED
|
@@ -1,15 +1,1398 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
***************************************************************************** */var T=function(e,t){return(T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function A(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}T(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function E(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{l(r.next(e))}catch(t){i(t)}}function a(e){try{l(r.throw(e))}catch(t){i(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}l((r=r.apply(e,t||[])).next())}))}function I(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(a){i=[6,a],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function k(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function D(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}function P(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e}function C(e){return this instanceof C?(this.v=e,this):new C(e)}function U(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=o[e](t)).value instanceof C?Promise.resolve(n.value.v).then(l,c):s(i[0][2],n)}catch(r){s(i[0][3],r)}var n}function l(e){a("next",e)}function c(e){a("throw",e)}function s(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}function M(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=k(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}var $=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function z(e){return F(null==e?void 0:e.then)}var B="function"==typeof Symbol&&Symbol.observable||"@@observable";function N(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var L=N((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function R(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var q=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._teardowns=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,r,o;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var u=k(i),a=u.next();!a.done;a=u.next()){a.value.remove(this)}}catch(p){e={error:p}}finally{try{a&&!a.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}else i.remove(this);var l=this.initialTeardown;if(F(l))try{l()}catch(v){o=v instanceof L?v.errors:[v]}var c=this._teardowns;if(c){this._teardowns=null;try{for(var s=k(c),f=s.next();!f.done;f=s.next()){var d=f.value;try{W(d)}catch(h){o=null!=o?o:[],h instanceof L?o=P(P([],D(o)),D(h.errors)):o.push(h)}}}catch(y){n={error:y}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}if(o)throw new L(o)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)W(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&R(t,e)},e.prototype.remove=function(t){var n=this._teardowns;n&&R(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function V(e){return e instanceof q||e&&"closed"in e&&F(e.remove)&&F(e.add)&&F(e.unsubscribe)}function W(e){F(e)?e():e.unsubscribe()}var H=null,X=null,G=void 0,Y=!1,J=!1,K={setTimeout:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=K.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,P([],D(e)))},clearTimeout:function(e){var t=K.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Q(e){K.setTimeout((function(){if(!H)throw e;H(e)}))}function Z(){}var ee=te("C",void 0,void 0);function te(e,t,n){return{kind:e,value:t,error:n}}var ne=null;function re(e){Y&&ne&&(ne.errorThrown=!0,ne.error=e)}var oe=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,V(t)&&t.add(n)):n.destination=ce,n}return A(t,e),t.create=function(e,t,n){return new ie(e,t,n)},t.prototype.next=function(e){this.isStopped?le(function(e){return te("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?le(te("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?le(ee,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(q),ie=function(e){function t(t,n,r){var o,i=e.call(this)||this;if(F(t))o=t;else if(t){var u;o=t.next,n=t.error,r=t.complete,i&&J?(u=Object.create(t)).unsubscribe=function(){return i.unsubscribe()}:u=t,o=null==o?void 0:o.bind(u),n=null==n?void 0:n.bind(u),r=null==r?void 0:r.bind(u)}return i.destination={next:o?ue(o):Z,error:ue(null!=n?n:ae),complete:r?ue(r):Z},i}return A(t,e),t}(oe);function ue(e,t){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{e.apply(void 0,P([],D(t)))}catch(r){Y?re(r):Q(r)}}}function ae(e){throw e}function le(e,t){var n=X;n&&K.setTimeout((function(){return n(e,t)}))}var ce={closed:!0,next:Z,error:ae,complete:Z};function se(e){return e}function fe(e){return 0===e.length?se:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var de=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r,o=this,i=(r=e)&&r instanceof oe||function(e){return e&&F(e.next)&&F(e.error)&&F(e.complete)}(r)&&V(r)?e:new ie(e,t,n);return function(e){if(Y){var t=!ne;if(t&&(ne={errorThrown:!1,error:null}),e(),t){var n=ne,r=n.errorThrown,o=n.error;if(ne=null,r)throw o}}else e()}((function(){var e=o,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?o._subscribe(i):o._trySubscribe(i))})),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=pe(t))((function(t,r){var o;o=n.subscribe((function(t){try{e(t)}catch(n){r(n),null==o||o.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[B]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fe(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=pe(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function pe(e){var t;return null!==(t=null!=e?e:G)&&void 0!==t?t:Promise}function ve(e,t){return new de((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}var he="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function ye(e,t){if(!e)throw new Error("Iterable cannot be null");return new de((function(n){var r=new q;return r.add(t.schedule((function(){var o=e[Symbol.asyncIterator]();r.add(t.schedule((function(){var e=this;o.next().then((function(t){t.done?n.complete():(n.next(t.value),e.schedule())}))})))}))),r}))}function be(e){return F(e[B])}function me(e){return F(null==e?void 0:e[he])}function ge(e){return Symbol.asyncIterator&&F(null==e?void 0:e[Symbol.asyncIterator])}function we(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function _e(e){return U(this,arguments,(function(){var t,n,r;return I(this,(function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,C(t.read())];case 3:return n=o.sent(),r=n.value,n.done?[4,C(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,C(r)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function je(e){return F(null==e?void 0:e.getReader)}function xe(e,t){if(null!=e){if(be(e))return function(e,t){return new de((function(n){var r=new q;return r.add(t.schedule((function(){var o=e[B]();r.add(o.subscribe({next:function(e){r.add(t.schedule((function(){return n.next(e)})))},error:function(e){r.add(t.schedule((function(){return n.error(e)})))},complete:function(){r.add(t.schedule((function(){return n.complete()})))}}))}))),r}))}(e,t);if($(e))return ve(e,t);if(z(e))return function(e,t){return new de((function(n){return t.schedule((function(){return e.then((function(e){n.add(t.schedule((function(){n.next(e),n.add(t.schedule((function(){return n.complete()})))})))}),(function(e){n.add(t.schedule((function(){return n.error(e)})))}))}))}))}(e,t);if(ge(e))return ye(e,t);if(me(e))return function(e,t){return new de((function(n){var r;return n.add(t.schedule((function(){r=e[he](),function(e,t,n,r){void 0===r&&(r=0);var o=t.schedule((function(){try{n.call(this)}catch(t){e.error(t)}}),r);e.add(o)}(n,t,(function(){var e=r.next(),t=e.value;e.done?n.complete():(n.next(t),this.schedule())}))}))),function(){return F(null==r?void 0:r.return)&&r.return()}}))}(e,t);if(je(e))return function(e,t){return ye(_e(e),t)}(e,t)}throw we(e)}function Oe(e,t){return t?xe(e,t):Fe(e)}function Fe(e){if(e instanceof de)return e;if(null!=e){if(be(e))return r=e,new de((function(e){var t=r[B]();if(F(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if($(e))return Se(e);if(z(e))return n=e,new de((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,Q)}));if(ge(e))return Te(e);if(me(e))return t=e,new de((function(e){var n,r;try{for(var o=k(t),i=o.next();!i.done;i=o.next()){var u=i.value;if(e.next(u),e.closed)return}}catch(a){n={error:a}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}e.complete()}));if(je(e))return Te(_e(e))}var t,n,r;throw we(e)}function Se(e){return new de((function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()}))}function Te(e){return new de((function(t){(function(e,t){var n,r,o,i;return E(this,void 0,void 0,(function(){var u,a;return I(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=M(e),l.label=1;case 1:return[4,n.next()];case 2:if((r=l.sent()).done)return[3,4];if(u=r.value,t.next(u),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=l.sent(),o={error:a},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(i=n.return)?[4,i.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}var Ae=function(e){function t(t,n,r,o,i){var u=e.call(this,t)||this;return u.onFinalize=i,u._next=n?function(e){try{n(e)}catch(r){t.error(r)}}:e.prototype._next,u._error=o?function(e){try{o(e)}catch(n){t.error(n)}finally{this.unsubscribe()}}:e.prototype._error,u._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,u}return A(t,e),t.prototype.unsubscribe=function(){var t,n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))},t}(oe),Ee=function(e){function t(t,n){return e.call(this)||this}return A(t,e),t.prototype.schedule=function(e,t){return this},t}(q),Ie={setInterval:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Ie.delegate;return((null==n?void 0:n.setInterval)||setInterval).apply(void 0,P([],D(e)))},clearInterval:function(e){var t=Ie.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},ke=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return A(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),Ie.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;Ie.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(o){r=!0,n=!!o&&o||new Error(o)}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,R(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Ee),De={now:function(){return(De.delegate||Date).now()},delegate:void 0},Pe=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=De.now,e}(),Ce=new(function(e){function t(t,n){void 0===n&&(n=Pe.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return A(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(Pe))(ke);function Ue(e){return e[e.length-1]}function Me(e){return(t=Ue(e))&&F(t.schedule)?e.pop():void 0;var t}function $e(e,t){return"number"==typeof Ue(e)?e.pop():t}function ze(e,t){return S((function(n,r){var o=0;n.subscribe(new Ae(r,(function(n){r.next(e.call(t,n,o++))})))}))}function Be(e,t,n){return void 0===n&&(n=1/0),F(t)?Be((function(n,r){return ze((function(e,o){return t(n,e,r,o)}))(Fe(e(n,r)))}),n):("number"==typeof t&&(n=t),S((function(t,r){return function(e,t,n,r,o,i,u,a){var l=[],c=0,s=0,f=!1,d=function(){!f||l.length||c||t.complete()},p=function(e){return c<r?v(e):l.push(e)},v=function(e){i&&t.next(e),c++;var a=!1;Fe(n(e,s++)).subscribe(new Ae(t,(function(e){null==o||o(e),i?p(e):t.next(e)}),(function(){a=!0}),void 0,(function(){if(a)try{c--;for(var e=function(){var e=l.shift();u?t.add(u.schedule((function(){return v(e)}))):v(e)};l.length&&c<r;)e();d()}catch(n){t.error(n)}})))};return e.subscribe(new Ae(t,p,(function(){f=!0,d()}))),function(){null==a||a()}}(t,r,e,n)})))}function Ne(e,t,n,r,o){return function(i,u){var a=n,l=t,c=0;i.subscribe(new Ae(u,(function(t){var n=c++;l=a?e(l,t,n):(a=!0,t),r&&u.next(l)}),o&&function(){a&&u.next(l),u.complete()}))}}var Le=function(e,t){return e.push(t),e};function Re(){return S((function(e,t){(function(e,t){return S(Ne(e,t,arguments.length>=2,!1,!0))})(Le,[])(e).subscribe(t)}))}function qe(e){return void 0===e&&(e=1/0),Be(se,e)}function Ve(e,t){return t?ve(e,t):Se(e)}function We(e){return S((function(t,n){var r=!1;t.subscribe(new Ae(n,(function(e){r=!0,n.next(e)}),(function(){r||n.next(e),n.complete()})))}))}var He=new de((function(e){return e.complete()}));function Xe(e,t){return S((function(n,r){var o=0;n.subscribe(new Ae(r,(function(n){return e.call(t,n,o++)&&r.next(n)})))}))}var Ge=N((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));function Ye(e){return void 0===e&&(e=Je),S((function(t,n){var r=!1;t.subscribe(new Ae(n,(function(e){r=!0,n.next(e)}),(function(){return r?n.complete():n.error(e())})))}))}function Je(){return new Ge}function Ke(e){return e<=0?function(){return He}:S((function(t,n){var r=[];t.subscribe(new Ae(n,(function(t){r.push(t),e<r.length&&r.shift()}),(function(){var e,t;try{for(var o=k(r),i=o.next();!i.done;i=o.next()){var u=i.value;n.next(u)}}catch(a){e={error:a}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}n.complete()}),void 0,(function(){r=null})))}))}function Qe(e,t){var n=arguments.length>=2;return function(r){return r.pipe(e?Xe((function(t,n){return e(t,n,r)})):se,Ke(1),n?We(t):Ye((function(){return new Ge})))}}const Ze={value:{type:Array,required:!0,default:()=>[]},life:{type:Number,default:null},lifeMode:{type:String,default:"global"},sticky:{type:Boolean,default:!1},style:{type:Object,default:()=>({})},styleClass:{type:String},onCloseEvent:{type:Function},onValueChange:{type:Function}};var et=l({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup:e=>a({},e),render(){const{name:e,size:t,color:n,classPrefix:r}=this;return c("i",{class:`${r} ${r}-${e}`,style:{fontSize:t,color:n}},null)}});et.install=function(e){e.component(et.name,et)};var tt=l({name:"DToastIconClose",props:{prefixCls:String,onClick:Function},emits:["click"],render(){const{prefixCls:e,$emit:t}=this;return c("div",{class:`${e}-icon-close`,onClick:e=>t("click",e)},[c(et,{name:"close",size:"14px"},null)])}}),nt=l({name:"DToastImage",props:{prefixCls:String,severity:String},render(){const{prefixCls:e,severity:t}=this;return c("span",{class:[`${e}-image`,`${e}-image-${t||"common"}`]},["common"!==t?c(et,{name:{info:"info-o",success:"right-o",warn:"warning-o",error:"error-o"}[t],size:"14px"},null):null])}}),rt="object"==typeof global&&global&&global.Object===Object&&global,ot="object"==typeof self&&self&&self.Object===Object&&self,it=rt||ot||Function("return this")(),ut=it.Symbol,at=Object.prototype,lt=at.hasOwnProperty,ct=at.toString,st=ut?ut.toStringTag:void 0;var ft=Object.prototype.toString;var dt=ut?ut.toStringTag:void 0;function pt(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":dt&&dt in Object(e)?function(e){var t=lt.call(e,st),n=e[st];try{e[st]=void 0;var r=!0}catch(i){}var o=ct.call(e);return r&&(t?e[st]=n:delete e[st]),o}(e):function(e){return ft.call(e)}(e)}function vt(e){return null!=e&&"object"==typeof e}function ht(e){return"symbol"==typeof e||vt(e)&&"[object Symbol]"==pt(e)}function yt(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var bt=Array.isArray,mt=ut?ut.prototype:void 0,gt=mt?mt.toString:void 0;function wt(e){if("string"==typeof e)return e;if(bt(e))return yt(e,wt)+"";if(ht(e))return gt?gt.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}var _t=/\s/;var jt=/^\s+/;function xt(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&_t.test(e.charAt(t)););return t}(e)+1).replace(jt,""):e}function Ot(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var Ft=/^[-+]0x[0-9a-f]+$/i,St=/^0b[01]+$/i,Tt=/^0o[0-7]+$/i,At=parseInt;function Et(e){if("number"==typeof e)return e;if(ht(e))return NaN;if(Ot(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ot(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=xt(e);var n=St.test(e);return n||Tt.test(e)?At(e.slice(2),n?2:8):Ft.test(e)?NaN:+e}function It(e){return e}function kt(e){if(!Ot(e))return!1;var t=pt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var Dt,Pt=it["__core-js_shared__"],Ct=(Dt=/[^.]+$/.exec(Pt&&Pt.keys&&Pt.keys.IE_PROTO||""))?"Symbol(src)_1."+Dt:"";var Ut=Function.prototype.toString;function Mt(e){if(null!=e){try{return Ut.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var $t=/^\[object .+?Constructor\]$/,zt=Function.prototype,Bt=Object.prototype,Nt=zt.toString,Lt=Bt.hasOwnProperty,Rt=RegExp("^"+Nt.call(Lt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qt(e){return!(!Ot(e)||(t=e,Ct&&Ct in t))&&(kt(e)?Rt:$t).test(Mt(e));var t}function Vt(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return qt(n)?n:void 0}var Wt=Vt(it,"WeakMap"),Ht=Object.create,Xt=function(){function e(){}return function(t){if(!Ot(t))return{};if(Ht)return Ht(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Gt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Yt(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Jt=Date.now;var Kt,Qt,Zt,en=function(){try{var e=Vt(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),tn=(Kt=en?function(e,t){return en(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:It,Qt=0,Zt=0,function(){var e=Jt(),t=16-(e-Zt);if(Zt=e,t>0){if(++Qt>=800)return arguments[0]}else Qt=0;return Kt.apply(void 0,arguments)});var nn=/^(?:0|[1-9]\d*)$/;function rn(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&nn.test(e))&&e>-1&&e%1==0&&e<t}function on(e,t,n){"__proto__"==t&&en?en(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function un(e,t){return e===t||e!=e&&t!=t}var an=Object.prototype.hasOwnProperty;function ln(e,t,n){var r=e[t];an.call(e,t)&&un(r,n)&&(void 0!==n||t in e)||on(e,t,n)}function cn(e,t,n,r){var o=!n;n||(n={});for(var i=-1,u=t.length;++i<u;){var a=t[i],l=r?r(n[a],e[a],a,n,e):void 0;void 0===l&&(l=e[a]),o?on(n,a,l):ln(n,a,l)}return n}var sn=Math.max;function fn(e,t,n){return t=sn(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=sn(r.length-t,0),u=Array(i);++o<i;)u[o]=r[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=r[o];return a[t]=n(u),Gt(e,this,a)}}function dn(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function pn(e){return null!=e&&dn(e.length)&&!kt(e)}var vn=Object.prototype;function hn(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||vn)}function yn(e){return vt(e)&&"[object Arguments]"==pt(e)}var bn=Object.prototype,mn=bn.hasOwnProperty,gn=bn.propertyIsEnumerable,wn=yn(function(){return arguments}())?yn:function(e){return vt(e)&&mn.call(e,"callee")&&!gn.call(e,"callee")};var _n="object"==typeof exports&&exports&&!exports.nodeType&&exports,jn=_n&&"object"==typeof module&&module&&!module.nodeType&&module,xn=jn&&jn.exports===_n?it.Buffer:void 0,On=(xn?xn.isBuffer:void 0)||function(){return!1},Fn={};function Sn(e){return function(t){return e(t)}}Fn["[object Float32Array]"]=Fn["[object Float64Array]"]=Fn["[object Int8Array]"]=Fn["[object Int16Array]"]=Fn["[object Int32Array]"]=Fn["[object Uint8Array]"]=Fn["[object Uint8ClampedArray]"]=Fn["[object Uint16Array]"]=Fn["[object Uint32Array]"]=!0,Fn["[object Arguments]"]=Fn["[object Array]"]=Fn["[object ArrayBuffer]"]=Fn["[object Boolean]"]=Fn["[object DataView]"]=Fn["[object Date]"]=Fn["[object Error]"]=Fn["[object Function]"]=Fn["[object Map]"]=Fn["[object Number]"]=Fn["[object Object]"]=Fn["[object RegExp]"]=Fn["[object Set]"]=Fn["[object String]"]=Fn["[object WeakMap]"]=!1;var Tn="object"==typeof exports&&exports&&!exports.nodeType&&exports,An=Tn&&"object"==typeof module&&module&&!module.nodeType&&module,En=An&&An.exports===Tn&&rt.process,In=function(){try{var e=An&&An.require&&An.require("util").types;return e||En&&En.binding&&En.binding("util")}catch(t){}}(),kn=In&&In.isTypedArray,Dn=kn?Sn(kn):function(e){return vt(e)&&dn(e.length)&&!!Fn[pt(e)]},Pn=Object.prototype.hasOwnProperty;function Cn(e,t){var n=bt(e),r=!n&&wn(e),o=!n&&!r&&On(e),i=!n&&!r&&!o&&Dn(e),u=n||r||o||i,a=u?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=a.length;for(var c in e)!t&&!Pn.call(e,c)||u&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||rn(c,l))||a.push(c);return a}function Un(e,t){return function(n){return e(t(n))}}var Mn=Un(Object.keys,Object),$n=Object.prototype.hasOwnProperty;function zn(e){return pn(e)?Cn(e):function(e){if(!hn(e))return Mn(e);var t=[];for(var n in Object(e))$n.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}var Bn=Object.prototype.hasOwnProperty;function Nn(e){if(!Ot(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=hn(e),n=[];for(var r in e)("constructor"!=r||!t&&Bn.call(e,r))&&n.push(r);return n}function Ln(e){return pn(e)?Cn(e,!0):Nn(e)}var Rn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qn=/^\w*$/;var Vn=Vt(Object,"create");var Wn=Object.prototype.hasOwnProperty;var Hn=Object.prototype.hasOwnProperty;function Xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Gn(e,t){for(var n=e.length;n--;)if(un(e[n][0],t))return n;return-1}Xn.prototype.clear=function(){this.__data__=Vn?Vn(null):{},this.size=0},Xn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Xn.prototype.get=function(e){var t=this.__data__;if(Vn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Wn.call(t,e)?t[e]:void 0},Xn.prototype.has=function(e){var t=this.__data__;return Vn?void 0!==t[e]:Hn.call(t,e)},Xn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Vn&&void 0===t?"__lodash_hash_undefined__":t,this};var Yn=Array.prototype.splice;function Jn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Jn.prototype.clear=function(){this.__data__=[],this.size=0},Jn.prototype.delete=function(e){var t=this.__data__,n=Gn(t,e);return!(n<0)&&(n==t.length-1?t.pop():Yn.call(t,n,1),--this.size,!0)},Jn.prototype.get=function(e){var t=this.__data__,n=Gn(t,e);return n<0?void 0:t[n][1]},Jn.prototype.has=function(e){return Gn(this.__data__,e)>-1},Jn.prototype.set=function(e,t){var n=this.__data__,r=Gn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Kn=Vt(it,"Map");function Qn(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Zn.prototype.clear=function(){this.size=0,this.__data__={hash:new Xn,map:new(Kn||Jn),string:new Xn}},Zn.prototype.delete=function(e){var t=Qn(this,e).delete(e);return this.size-=t?1:0,t},Zn.prototype.get=function(e){return Qn(this,e).get(e)},Zn.prototype.has=function(e){return Qn(this,e).has(e)},Zn.prototype.set=function(e,t){var n=Qn(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function er(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var u=e.apply(this,r);return n.cache=i.set(o,u)||i,u};return n.cache=new(er.Cache||Zn),n}er.Cache=Zn;var tr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nr=/\\(\\)?/g,rr=function(e){var t=er(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(tr,(function(e,n,r,o){t.push(r?o.replace(nr,"$1"):n||e)})),t}));function or(e,t){return bt(e)?e:function(e,t){if(bt(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ht(e))||qn.test(e)||!Rn.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:rr(function(e){return null==e?"":wt(e)}(e))}function ir(e){if("string"==typeof e||ht(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function ur(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var ar=ut?ut.isConcatSpreadable:void 0;function lr(e){return bt(e)||wn(e)||!!(ar&&e&&e[ar])}function cr(e,t,n,r,o){var i=-1,u=e.length;for(n||(n=lr),o||(o=[]);++i<u;){var a=e[i];t>0&&n(a)?t>1?cr(a,t-1,n,r,o):ur(o,a):r||(o[o.length]=a)}return o}function sr(e){return(null==e?0:e.length)?cr(e,1):[]}var fr=Un(Object.getPrototypeOf,Object),dr=Function.prototype,pr=Object.prototype,vr=dr.toString,hr=pr.hasOwnProperty,yr=vr.call(Object);function br(e){if(!vt(e)||"[object Object]"!=pt(e))return!1;var t=fr(e);if(null===t)return!0;var n=hr.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&vr.call(n)==yr}function mr(e){var t=this.__data__=new Jn(e);this.size=t.size}mr.prototype.clear=function(){this.__data__=new Jn,this.size=0},mr.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},mr.prototype.get=function(e){return this.__data__.get(e)},mr.prototype.has=function(e){return this.__data__.has(e)},mr.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Jn){var r=n.__data__;if(!Kn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Zn(r)}return n.set(e,t),this.size=n.size,this};var gr="object"==typeof exports&&exports&&!exports.nodeType&&exports,wr=gr&&"object"==typeof module&&module&&!module.nodeType&&module,_r=wr&&wr.exports===gr?it.Buffer:void 0,jr=_r?_r.allocUnsafe:void 0;function xr(e,t){if(t)return e.slice();var n=e.length,r=jr?jr(n):new e.constructor(n);return e.copy(r),r}function Or(){return[]}var Fr=Object.prototype.propertyIsEnumerable,Sr=Object.getOwnPropertySymbols,Tr=Sr?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var u=e[n];t(u,n,e)&&(i[o++]=u)}return i}(Sr(e),(function(t){return Fr.call(e,t)})))}:Or;var Ar=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)ur(t,Tr(e)),e=fr(e);return t}:Or;function Er(e,t,n){var r=t(e);return bt(e)?r:ur(r,n(e))}function Ir(e){return Er(e,zn,Tr)}function kr(e){return Er(e,Ln,Ar)}var Dr=Vt(it,"DataView"),Pr=Vt(it,"Promise"),Cr=Vt(it,"Set"),Ur=Mt(Dr),Mr=Mt(Kn),$r=Mt(Pr),zr=Mt(Cr),Br=Mt(Wt),Nr=pt;(Dr&&"[object DataView]"!=Nr(new Dr(new ArrayBuffer(1)))||Kn&&"[object Map]"!=Nr(new Kn)||Pr&&"[object Promise]"!=Nr(Pr.resolve())||Cr&&"[object Set]"!=Nr(new Cr)||Wt&&"[object WeakMap]"!=Nr(new Wt))&&(Nr=function(e){var t=pt(e),n="[object Object]"==t?e.constructor:void 0,r=n?Mt(n):"";if(r)switch(r){case Ur:return"[object DataView]";case Mr:return"[object Map]";case $r:return"[object Promise]";case zr:return"[object Set]";case Br:return"[object WeakMap]"}return t});var Lr=Nr,Rr=Object.prototype.hasOwnProperty;var qr=it.Uint8Array;function Vr(e){var t=new e.constructor(e.byteLength);return new qr(t).set(new qr(e)),t}var Wr=/\w*$/;var Hr=ut?ut.prototype:void 0,Xr=Hr?Hr.valueOf:void 0;function Gr(e,t){var n=t?Vr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Yr(e,t,n){var r,o,i,u=e.constructor;switch(t){case"[object ArrayBuffer]":return Vr(e);case"[object Boolean]":case"[object Date]":return new u(+e);case"[object DataView]":return function(e,t){var n=t?Vr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Gr(e,n);case"[object Map]":return new u;case"[object Number]":case"[object String]":return new u(e);case"[object RegExp]":return(i=new(o=e).constructor(o.source,Wr.exec(o))).lastIndex=o.lastIndex,i;case"[object Set]":return new u;case"[object Symbol]":return r=e,Xr?Object(Xr.call(r)):{}}}function Jr(e){return"function"!=typeof e.constructor||hn(e)?{}:Xt(fr(e))}var Kr=In&&In.isMap,Qr=Kr?Sn(Kr):function(e){return vt(e)&&"[object Map]"==Lr(e)};var Zr=In&&In.isSet,eo=Zr?Sn(Zr):function(e){return vt(e)&&"[object Set]"==Lr(e)},to={};function no(e,t,n,r,o,i){var u,a=1&t,l=2&t,c=4&t;if(n&&(u=o?n(e,r,o,i):n(e)),void 0!==u)return u;if(!Ot(e))return e;var s=bt(e);if(s){if(u=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Rr.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!a)return Yt(e,u)}else{var f=Lr(e),d="[object Function]"==f||"[object GeneratorFunction]"==f;if(On(e))return xr(e,a);if("[object Object]"==f||"[object Arguments]"==f||d&&!o){if(u=l||d?{}:Jr(e),!a)return l?function(e,t){return cn(e,Ar(e),t)}(e,function(e,t){return e&&cn(t,Ln(t),e)}(u,e)):function(e,t){return cn(e,Tr(e),t)}(e,function(e,t){return e&&cn(t,zn(t),e)}(u,e))}else{if(!to[f])return o?e:{};u=Yr(e,f,a)}}i||(i=new mr);var p=i.get(e);if(p)return p;i.set(e,u),eo(e)?e.forEach((function(r){u.add(no(r,t,n,r,e,i))})):Qr(e)&&e.forEach((function(r,o){u.set(o,no(r,t,n,o,e,i))}));var v=s?void 0:(c?l?kr:Ir:l?Ln:zn)(e);return function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););}(v||e,(function(r,o){v&&(r=e[o=r]),ln(u,o,no(r,t,n,o,e,i))})),u}to["[object Arguments]"]=to["[object Array]"]=to["[object ArrayBuffer]"]=to["[object DataView]"]=to["[object Boolean]"]=to["[object Date]"]=to["[object Float32Array]"]=to["[object Float64Array]"]=to["[object Int8Array]"]=to["[object Int16Array]"]=to["[object Int32Array]"]=to["[object Map]"]=to["[object Number]"]=to["[object Object]"]=to["[object RegExp]"]=to["[object Set]"]=to["[object String]"]=to["[object Symbol]"]=to["[object Uint8Array]"]=to["[object Uint8ClampedArray]"]=to["[object Uint16Array]"]=to["[object Uint32Array]"]=!0,to["[object Error]"]=to["[object Function]"]=to["[object WeakMap]"]=!1;function ro(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Zn;++t<n;)this.add(e[t])}function oo(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}ro.prototype.add=ro.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ro.prototype.has=function(e){return this.__data__.has(e)};function io(e,t,n,r,o,i){var u=1&n,a=e.length,l=t.length;if(a!=l&&!(u&&l>a))return!1;var c=i.get(e),s=i.get(t);if(c&&s)return c==t&&s==e;var f=-1,d=!0,p=2&n?new ro:void 0;for(i.set(e,t),i.set(t,e);++f<a;){var v=e[f],h=t[f];if(r)var y=u?r(h,v,f,t,e,i):r(v,h,f,e,t,i);if(void 0!==y){if(y)continue;d=!1;break}if(p){if(!oo(t,(function(e,t){if(u=t,!p.has(u)&&(v===e||o(v,e,n,r,i)))return p.push(t);var u}))){d=!1;break}}else if(v!==h&&!o(v,h,n,r,i)){d=!1;break}}return i.delete(e),i.delete(t),d}function uo(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function ao(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var lo=ut?ut.prototype:void 0,co=lo?lo.valueOf:void 0;var so=Object.prototype.hasOwnProperty;var fo="[object Object]",po=Object.prototype.hasOwnProperty;function vo(e,t,n,r,o,i){var u=bt(e),a=bt(t),l=u?"[object Array]":Lr(e),c=a?"[object Array]":Lr(t),s=(l="[object Arguments]"==l?fo:l)==fo,f=(c="[object Arguments]"==c?fo:c)==fo,d=l==c;if(d&&On(e)){if(!On(t))return!1;u=!0,s=!1}if(d&&!s)return i||(i=new mr),u||Dn(e)?io(e,t,n,r,o,i):function(e,t,n,r,o,i,u){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new qr(e),new qr(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return un(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=uo;case"[object Set]":var l=1&r;if(a||(a=ao),e.size!=t.size&&!l)return!1;var c=u.get(e);if(c)return c==t;r|=2,u.set(e,t);var s=io(a(e),a(t),r,o,i,u);return u.delete(e),s;case"[object Symbol]":if(co)return co.call(e)==co.call(t)}return!1}(e,t,l,n,r,o,i);if(!(1&n)){var p=s&&po.call(e,"__wrapped__"),v=f&&po.call(t,"__wrapped__");if(p||v){var h=p?e.value():e,y=v?t.value():t;return i||(i=new mr),o(h,y,n,r,i)}}return!!d&&(i||(i=new mr),function(e,t,n,r,o,i){var u=1&n,a=Ir(e),l=a.length;if(l!=Ir(t).length&&!u)return!1;for(var c=l;c--;){var s=a[c];if(!(u?s in t:so.call(t,s)))return!1}var f=i.get(e),d=i.get(t);if(f&&d)return f==t&&d==e;var p=!0;i.set(e,t),i.set(t,e);for(var v=u;++c<l;){var h=e[s=a[c]],y=t[s];if(r)var b=u?r(y,h,s,t,e,i):r(h,y,s,e,t,i);if(!(void 0===b?h===y||o(h,y,n,r,i):b)){p=!1;break}v||(v="constructor"==s)}if(p&&!v){var m=e.constructor,g=t.constructor;m==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof g&&g instanceof g||(p=!1)}return i.delete(e),i.delete(t),p}(e,t,n,r,o,i))}function ho(e,t,n,r,o){return e===t||(null==e||null==t||!vt(e)&&!vt(t)?e!=e&&t!=t:vo(e,t,n,r,ho,o))}var yo,bo=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),u=i.length;u--;){var a=i[yo?u:++r];if(!1===t(o[a],a,o))break}return e},mo=function(){return it.Date.now()},go=Math.max,wo=Math.min;function _o(e,t,n){var r,o,i,u,a,l,c=0,s=!1,f=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,i=o;return r=o=void 0,c=t,u=e.apply(i,n)}function v(e){return c=e,a=setTimeout(y,t),s?p(e):u}function h(e){var n=e-l;return void 0===l||n>=t||n<0||f&&e-c>=i}function y(){var e=mo();if(h(e))return b(e);a=setTimeout(y,function(e){var n=t-(e-l);return f?wo(n,i-(e-c)):n}(e))}function b(e){return a=void 0,d&&r?p(e):(r=o=void 0,u)}function m(){var e=mo(),n=h(e);if(r=arguments,o=this,l=e,n){if(void 0===a)return v(l);if(f)return clearTimeout(a),a=setTimeout(y,t),p(l)}return void 0===a&&(a=setTimeout(y,t)),u}return t=Et(t)||0,Ot(n)&&(s=!!n.leading,i=(f="maxWait"in n)?go(Et(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d),m.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=l=o=a=void 0},m.flush=function(){return void 0===a?u:b(mo())},m}function jo(e,t,n){(void 0!==n&&!un(e[t],n)||void 0===n&&!(t in e))&&on(e,t,n)}function xo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function Oo(e,t,n,r,o,i,u){var a=xo(e,n),l=xo(t,n),c=u.get(l);if(c)jo(e,n,c);else{var s,f=i?i(a,l,n+"",e,t,u):void 0,d=void 0===f;if(d){var p=bt(l),v=!p&&On(l),h=!p&&!v&&Dn(l);f=l,p||v||h?bt(a)?f=a:vt(s=a)&&pn(s)?f=Yt(a):v?(d=!1,f=xr(l,!0)):h?(d=!1,f=Gr(l,!0)):f=[]:br(l)||wn(l)?(f=a,wn(a)?f=function(e){return cn(e,Ln(e))}(a):Ot(a)&&!kt(a)||(f=Jr(l))):d=!1}d&&(u.set(l,f),o(f,l,r,i,u),u.delete(l)),jo(e,n,f)}}function Fo(e,t,n,r,o){e!==t&&bo(t,(function(i,u){if(o||(o=new mr),Ot(i))Oo(e,t,u,n,Fo,r,o);else{var a=r?r(xo(e,u),i,u+"",e,t,o):void 0;void 0===a&&(a=i),jo(e,u,a)}}),Ln)}function So(e,t){return t.length<2?e:function(e,t){for(var n=0,r=(t=or(t,e)).length;null!=e&&n<r;)e=e[ir(t[n++])];return n&&n==r?e:void 0}(e,function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}(t,0,-1))}var To,Ao=(To=function(e,t,n){Fo(e,t,n)},function(e,t){return tn(fn(e,t,It),e+"")}((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(o=To.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(e,t,n){if(!Ot(n))return!1;var r=typeof t;return!!("number"==r?pn(n)&&rn(t,n.length):"string"==r&&t in n)&&un(n[t],e)}(t[0],t[1],i)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var u=t[n];u&&To(e,u,n,o)}return e})));function Eo(e,t){return null==(e=So(e,t=or(t,e)))||delete e[ir((n=t,r=null==n?0:n.length,r?n[r-1]:void 0))];var n,r}function Io(e){return br(e)?void 0:e}var ko=function(e){return tn(fn(e,void 0,sr),e+"")}((function(e,t){var n={};if(null==e)return n;var r=!1;t=yt(t,(function(t){return t=or(t,e),r||(r=t.length>1),t})),cn(e,kr(e),n),r&&(n=no(n,7,Io));for(var o=t.length;o--;)Eo(n,t[o]);return n}));const{ANIMATION_TIME:Do}={ANIMATION_TIME:300,ANIMATION_NAME:"slide-in",ID_PREFIX:"toast-message"};let Po=1060;const{ANIMATION_NAME:Co,ANIMATION_TIME:Uo,ID_PREFIX:Mo}={ANIMATION_TIME:300,ANIMATION_NAME:"slide-in",ID_PREFIX:"toast-message"};var $o,zo,Bo=l({name:"DToast",inheritAttrs:!1,props:Ze,emits:["closeEvent","valueChange"],setup(e,t){const{onCloseEvent:n,onHidden:r,onValueChange:o}=function(){const e=s();return{onCloseEvent:function(t){e.emit("closeEvent",t)},onValueChange:function(t){e.emit("valueChange",t)},onHidden:function(){setTimeout((()=>{var t,n;return null==(n=(t=e.attrs).onHidden)?void 0:n.call(t)}),Do)}}}(),{severityDelay:i}={severityDelay:function(e){switch(e.severity){case"warn":case"error":return 1e4;default:return 5e3}}},u=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Ot(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),_o(e,t,{leading:r,maxWait:t,trailing:o})}((function(t){"single"===e.lifeMode&&g[t]&&(g[t]=clearTimeout(g[t]),g.splice(t,1));A(a.value[t]),setTimeout((()=>{n(a.value[t]),a.value.splice(t,1),o(a.value),"global"===e.lifeMode&&F()}),Uo)}),Uo),a=f([]),l=f([]),c=f(),y=f([]);let b,m=Date.now();const g=[],w=d((()=>null!==e.life?e.life:a.value.length>0?i(a.value[0]):5e3));function _(e=[]){const t=function(e){return no(e,5)}(e);a.value=t.map(((e,t)=>Ao(e,{id:`${Mo}-${t}`}))),l.value=[]}function j(e,t){A(e),setTimeout((()=>{n(e),E()?a.value.splice(t,1):a.value=[],o(a.value)}),Uo)}function x(t){if(!e.sticky&&b){b=clearTimeout(b);const e=w.value-(Date.now()-m);b=setTimeout((()=>t()),e)}}function O(){a.value.length>0&&(l.value=[],setTimeout((()=>{a.value.forEach((e=>n(e))),a.value=[],o(a.value)}),Uo))}function F(t,n){if(!(-1===a.value.findIndex((e=>e===n)))&&(void 0===n||l.value.includes(n)))if("single"===e.lifeMode){const e=(n.life||i(n))-(Date.now()-m);g[t]=setTimeout((()=>j(n,t)),e)}else x((()=>O()))}function S(e){e<y.value.length&&e>-1&&u(e)}function T(e){const t=["id"];S(a.value.findIndex((n=>{return r=ko(n,t),o=ko(e,t),ho(r,o);var r,o})))}function A(e){l.value=l.value.filter((t=>t!==e))}function E(){return l.value.length>0}return p((()=>e.value),(t=>{0!==t.length&&(E()&&_(),v((()=>{_(t),function(){if(function(){Po++}(),setTimeout((()=>{a.value.forEach((e=>l.value.push(e)))}),0),e.sticky)return;b&&(b=clearTimeout(b));g.length>0&&g.splice(0).forEach((e=>clearTimeout(e)));m=Date.now(),"single"===e.lifeMode?setTimeout((()=>{a.value.forEach(((e,t)=>{g[t]=setTimeout((()=>j(e,t)),e.life||i(e))}))})):b=setTimeout((()=>O()),w.value)}()})))}),{deep:!0,immediate:!0}),p(a,(e=>{0===e.length&&l.value.length>0&&(l.value=[])})),p(l,((e,t)=>{t.length>0&&0===e.length&&r()})),h((()=>{e.sticky||("single"===e.lifeMode?g.forEach((e=>e&&clearTimeout(e))):clearTimeout(b))})),{messages:a,msgAnimations:l,containerRef:c,msgItemRefs:y,interrupt:function(t){l.value.includes(a.value[t])&&("single"===e.lifeMode?g[t]&&(g[t]=clearTimeout(g[t])):x((()=>{a.value.forEach(((e,n)=>t!==n&&A(e)))})))},removeReset:F,removeThrottle:u,close:function(e){if(void 0===e)return O();"number"==typeof e?S(e):T(e)},msgItemRef:function(e){return y.value[e]}}},render(){const{style:e,styleClass:t,messages:n,msgAnimations:r,msgItemRefs:o,life:i,interrupt:u,removeReset:a,removeThrottle:l,$attrs:s,$slots:f}=this,d="devui-toast",p=e=>["devui-toast-item-container",`devui-toast-message-${e.severity}`,{[Co]:r.includes(e)}],v=e=>!(!e.summary&&null!==i),h=e=>"common"!==e.severity,b=e=>!!e.summary,m=e=>!!e.content,g=e=>!m(e)&&!!e.detail,w=e=>{var t;if("function"==typeof e.content)return e.content(e);if([null,void 0].includes(e.content))return null;const n="slot:";return String(e.content).startsWith(n)?null==(t=f[e.content.slice(n.length)])?void 0:t.call(f,e):e.content};return c("div",y({ref:"containerRef",style:[`z-index: ${Po}`,e],class:[d,t]},s),[n.map(((e,t)=>c("div",{ref:e=>o[t]=e,key:e.id,class:p(e),"aria-live":"polite",onMouseenter:()=>u(t),onMouseleave:()=>a(t,e)},[c("div",{class:"devui-toast-item"},[v(e)?c(tt,{prefixCls:d,onClick:()=>l(t)},null):null,h(e)?c(nt,{prefixCls:d,severity:e.severity},null):null,c("div",{class:"devui-toast-message"},[b(e)?c("span",{class:"devui-toast-title"},[e.summary]):null,m(e)?w(e):null,g(e)?c("p",{innerHTML:e.detail},null):null])])])))])}});class No{static open(e){let r=document.body,o=document.createElement("div");r.appendChild(o);let i=function(e){return b(Bo,e)}((u=a({},null!=e?e:{}),t(u,n({onHidden:()=>null==i?void 0:i.unmount()}))));var u;let l=i.mount(o);return h((()=>{r.removeChild(o),r=null,o=null,i=null,l=null}),l.$),{toastInstance:l}}}Bo.install=function(e){e.component(Bo.name,Bo)},(zo=$o||($o={}))[zo.preLoad=0]="preLoad",zo[zo.uploading=1]="uploading",zo[zo.uploaded=2]="uploaded",zo[zo.failed=3]="failed";const Lo={uploadOptions:{type:Object,required:!0},fileOptions:{type:Object,required:!0},filePath:{type:String,required:!0},autoUpload:{type:Boolean,default:!1},placeholderText:{type:String,default:"选择文件"},preloadFilesRef:{type:Object},uploadText:{type:String,default:"上传"},uploadedFiles:{type:Array,default:()=>[]},uploadedFilesRef:{type:Object},withoutBtn:{type:Boolean,default:!1},enableDrop:{type:Boolean,default:!1},beforeUpload:{type:Function},dynamicUploadOptionsFn:{type:Function},disabled:{type:Boolean,default:!1},showTip:{type:Boolean,default:!1},onChange:{type:Function},fileDrop:{type:Function,default:void 0},fileOver:{type:Function,default:void 0},fileSelect:{type:Function,default:void 0},errorEvent:{type:Function,default:void 0},successEvent:{type:Function,default:void 0},deleteUploadedFileEvent:{type:Function,default:void 0}},Ro={uploadOptions:{type:Object,required:!0},fileOptions:{type:Object,required:!0},filePath:{type:String,required:!0},autoUpload:{type:Boolean,default:!1},withoutBtn:{type:Boolean,default:!1},showTip:{type:Boolean,default:!1},uploadedFiles:{type:Array,default:()=>[]},enableDrop:{type:Boolean,default:!1},uploadedFilesRef:{type:Object},preloadFilesRef:{type:Object},placeholderText:{type:String,default:"选择文件"},uploadText:{type:String,default:"上传"},oneTimeUpload:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},beforeUpload:{type:Function},fileDrop:{type:Function,default:void 0},fileOver:{type:Function,default:void 0},fileSelect:{type:Function,default:void 0},errorEvent:{type:Function,default:void 0},successEvent:{type:Function,default:void 0},deleteUploadedFileEvent:{type:Function,default:void 0},setCustomUploadOptions:{type:Function,default:void 0}};class qo{constructor(e,t){this.file=e,this.uploadOptions=t,this.percentage=0,this.file=e,this.uploadOptions=t,this.status=$o.preLoad}send(e){return new Promise(((t,n)=>{const{uri:r,method:o,headers:i,authToken:u,authTokenHeader:a,additionalParameter:l,fileFieldName:c,withCredentials:s,responseType:f}=this.uploadOptions,d=a||"Authorization",p=c||"file";this.xhr=new XMLHttpRequest,this.xhr.open(o||"POST",r),s&&(this.xhr.withCredentials=s),f&&(this.xhr.responseType=f),u&&this.xhr.setRequestHeader(d,u),i&&Object.keys(i).forEach((e=>{this.xhr.setRequestHeader(e,i[e])})),this.xhr.upload.onprogress=e=>{this.percentage=Math.round(100*e.loaded/e.total)};const v=e&&e.length?this.oneTimeUploadFiles(p,l,e):this.parallelUploadFiles(p,l);this.xhr.send(v),this.status=$o.uploading,this.xhr.onabort=()=>{this.status=$o.preLoad,this.xhr=null},this.xhr.onerror=()=>{this.response=this.xhr.response,this.status=$o.failed,n({file:this.file,response:this.xhr.response})},this.xhr.onload=()=>{4===this.xhr.readyState&&this.xhr.status>=200&&this.xhr.status<300?(this.response=this.xhr.response,this.status=$o.uploaded,t({file:this.file,response:this.xhr.response})):(this.response=this.xhr.response,this.status=$o.failed,n({file:this.file,response:this.xhr.response}))}}))}parallelUploadFiles(e,t){const n=new FormData;return n.append(e,this.file,this.file.name),t&&Object.keys(t).forEach((e=>{n.append(e,t[e])})),n}oneTimeUploadFiles(e,t,n){const r=new FormData;return n.forEach((n=>{r.append(e,n.file,n.file.name),t&&Object.keys(t).forEach((e=>{r.append(e,t[e])}))})),r}cancel(){this.xhr&&this.xhr.abort()}}const Vo=()=>{const e=f([]),t=f([]);return{fileUploaders:e,getFiles:()=>e.value.map((e=>e.file)),addFile:(n,r)=>{r&&r.checkSameName?(n=>{let r=!0;for(let o=0;o<e.value.length;o++)if(n===e.value[o].file.name){r=!1,-1===t.value.indexOf(n)&&t.value.push(n);break}return r})(n.name)&&e.value.push(new qo(n,r)):e.value.push(new qo(n,r))},getFullFiles:()=>e.value.map((e=>e)),deleteFile:t=>{e.value.find((e=>e.file===t)).cancel(),e.value=e.value.filter((e=>t!==e.file))},upload:t=>{let n=[];if(t)t.percentage=0,n.push(Oe(t.send()));else{const t=e.value.filter((e=>e.status===$o.preLoad)),r=e.value.filter((e=>e.status===$o.failed));n=(t.length>0?t:r).map((e=>(e.percentage=0,Oe(e.send()))))}return n.length>0?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Me(e),r=$e(e,1/0),o=e;return o.length?1===o.length?Fe(o[0]):qe(r)(Ve(o,n)):He}(...n).pipe(Re()):Oe(Promise.reject("no files"))},removeFiles:()=>{e.value=[],t.value=[]},getSameNameFiles:()=>t.value.join(),resetSameNameFiles:()=>{t.value=[]},_oneTimeUpload:()=>Oe((async e=>{if(!e||!e.length)return Promise.reject("no files");let t=[];return await e[0].send(e).finally((()=>t=e.map((t=>(t.status=e[0].status,t.percentage=e[0].percentage,{file:t.file,response:e[0].response}))))),t})(e.value.filter((e=>e.status!==$o.uploaded))))}},Wo="上传中...",Ho="上传失败",Xo="上传成功!",Go="重新上传",Yo="取消上传",Jo=(e,t)=>`最大支持上传${t}MB的文件, 您上传的文件"${e}"超过可上传文件大小`,Ko=()=>{const e=f(""),t=({multiple:e,accept:t,webkitdirectory:n})=>new Promise((r=>{const o=document.getElementById("d-upload-temp");o&&document.body.removeChild(o);const i=document.createElement("input");i.style.position="fixed",i.style.left="-2000px",i.style.top="-2000px",i.setAttribute("id","d-upload-temp"),i.setAttribute("type","file"),e&&i.setAttribute("multiple",""),t&&i.setAttribute("accept",t),n&&i.setAttribute("webkitdirectory",""),i.addEventListener("change",(e=>{r(Array.prototype.slice.call(e.target.files))})),document.body.appendChild(i),(e=>{const t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(t)})(i)})),n=(e,t)=>!!t&&e>1048576*t;return{triggerSelectFiles:e=>{const{multiple:n,accept:r,webkitdirectory:o}=e;return Oe(t({multiple:n,accept:r,webkitdirectory:o})).pipe(Be((e=>e)))},_validateFiles:(e,t,r)=>{return((e,t)=>{if(e){const n=e.split(","),r=t.type.replace(/\/.*$/,"");return n.some((e=>{const n=e.trim();return n.startsWith(".")?t.name.toLowerCase().indexOf(n.toLowerCase(),t.name.toLowerCase().length-n.toLowerCase().length)>-1:/\/\*$/.test(n)?r===n.replace(/\/.*$/,""):t.type===n}))}return!0})(t,e)?r&&n(e.size,r.maximumSize)?{checkError:!0,errorMsg:Jo(e.name,r.maximumSize)}:{checkError:!1,errorMsg:void 0}:{checkError:!0,errorMsg:(o=e.name,i=t,`支持的文件类型: "${i}", 您上传的文件"${o}"不在允许范围内,请重新选择文件`)};var o,i},triggerDropFiles:(e,t,n)=>new de((e=>e.next(n))).pipe(Be((e=>e))),checkAllFilesSize:(t,r)=>{if(n(t,r))return e.value=`最大支持上传${r}MB的文件, 您本次上传的所有文件超过可上传文件大小`,{checkError:!0,errorMsg:e.value}}}};var Qo=l({name:"DSingleUpload",props:Lo,emits:["fileDrop","fileOver","fileSelect","successEvent","errorEvent","update:uploadedFiles"],setup(e,t){const{uploadOptions:n,fileOptions:r,placeholderText:o,autoUpload:i,withoutBtn:u,uploadText:a,disabled:l,beforeUpload:c,enableDrop:s,showTip:p,uploadedFiles:v}=m(e),h=f(!1),{getFiles:y,fileUploaders:b,addFile:g,getFullFiles:w,deleteFile:_,upload:j}=Vo(),{triggerSelectFiles:x,_validateFiles:O,triggerDropFiles:F}=Ko(),S=d((()=>(y()[0]||{}).name||"")),T=e=>{No.open({value:[{severity:"warn",content:e}]})},A=()=>{(()=>{let e=Promise.resolve(!0);if(c.value){const t=c.value(w()[0]||{});void 0!==t&&(e=t.then?t:t.subscribe?t.toPromise():Promise.resolve(t))}return e})().then((e=>{e&&j().pipe(Qe()).subscribe((e=>{t.emit("successEvent",e);const n=[...e.map((e=>e.file)),...v.value];t.emit("update:uploadedFiles",n)}),(e=>{console.error(e),b.value[0]&&(b.value[0].percentage=0),t.emit("errorEvent",e)}))}))},E=o=>{o.pipe(ze((e=>(g(e,n.value),e)))).subscribe((()=>{var n;b.value.forEach((e=>{const t=O(e.file,r.value.accept,e.uploadOptions);t.checkError&&(_(e.file),T(t.errorMsg))}));const o=null==(n=b[0])?void 0:n.file;e.onChange&&e.onChange(o),o&&t.emit("fileSelect",o),i.value&&A()}),(e=>{T(e.message)}))};return{placeholderText:o,filename:S,autoUpload:i,withoutBtn:u,fileUploaders:b,uploadText:a,handleClick:()=>{var e;l.value||b.value[0]&&(null==(e=b.value[0])?void 0:e.status)===$o.uploading||E(x(r.value))},onDeleteFile:e=>{e.stopPropagation();const t=y();_(t[0])},fileUpload:A,enableDrop:s,onFileDrop:e=>{h.value=!1,E(F(r.value,n.value,e)),t.emit("fileDrop",e[0])},onFileOver:e=>{h.value=e,t.emit("fileOver",e)},isDropOVer:h,showTip:p}},render(){var e,t,n,r,o,i,u,a,l,s;const{placeholderText:f,filename:d,autoUpload:p,withoutBtn:v,fileUploaders:h,uploadText:y,handleClick:b,onDeleteFile:m,fileUpload:O,enableDrop:F,onFileDrop:S,onFileOver:T,isDropOVer:A,disabled:E,showTip:I}=this;return c(g,null,[w(c("div",{class:"devui-upload",style:"border: "+(A?"1px solid #15bf15":"0")},[c("div",{class:"devui-input-group "+(E||(null==(e=h[0])?void 0:e.status)===$o.uploading?"disabled":""),onClick:b},[c("div",{class:"devui-form-control devui-files-list"},[!d&&c("div",{class:"devui-file-item devui-upload-placeholder"},[f]),!!d&&c("div",{class:"devui-file-tag devui-file-item",title:d,style:"display: inline-block; margin: 0 2px 2px 0"},[c("span",{class:"devui-filename "+((null==(t=h[0])?void 0:t.status)===$o.failed?"devui-failed-color":"")},[d]),c(_("d-icon"),{name:"close",class:`${(null==(n=h[0])?void 0:n.status)===$o.failed?"devui-upload-delete-file-button":""} ${(null==(r=h[0])?void 0:r.status)===$o.uploading||(null==(o=h[0])?void 0:o.status)===$o.uploaded?"devui-uploading-delete":""}`,onClick:e=>m(e)},null),(null==(i=h[0])?void 0:i.status)===$o.uploading&&c("div",{class:"icon devui-upload-progress"},[c(_("d-progress"),{isCircle:!0,percentage:h[0].percentage,barbgcolor:"#50D4AB",strokeWidth:8,showContent:!1},null)]),h[0].status===$o.failed&&c(_("d-icon"),{name:"running",onClick:O},null),h[0].status===$o.uploaded&&c(_("d-icon"),{name:"right",color:"#50d4ab"},null)])]),c("span",{class:"devui-input-group-addon"},[c("svg",{class:"svg-icon-dot",height:"1em",width:"1em",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[c("path",{d:"m400.31892 176.970574c0-61.574381 50.113351-111.680569 111.679545-111.680569 61.576427 0 111.680569 50.106188 111.680569 111.680569 0 61.568241-50.104141 111.679545-111.680569 111.679545-61.566194 0-111.679545-50.111304-111.679545-111.679545zm0 335.028403c0-61.568241 50.113351-111.678522 111.679545-111.678522 61.576427 0 111.680569 50.110281 111.680569 111.678522 0 61.574381-50.105165 111.682615-111.680569 111.682615-61.566194 0-111.679545-50.108235-111.679545-111.682615zm0 335.037612c0-61.572334 50.113351-111.679545 111.679545-111.679545 61.575404 0 111.680569 50.107211 111.680569 111.679545 0 61.567217-50.105165 111.672382-111.680569 111.672382-61.566194 0-111.679545-50.105164-111.679545-111.672382zm0 0"},null)])])]),!p&&!v&&c(_("d-button"),{style:"marginLeft: 8px",bsStyle:"common",onClick:O,disabled:E||(null==(u=h[0])?void 0:u.status)===$o.uploading},{default:()=>{var e,t,n,r;return[(!h[0]||!(null==(e=h[0])?void 0:e.status))&&c("span",null,[y]),(null==(t=h[0])?void 0:t.status)===$o.uploading&&c("span",null,[j("上传中...")]),(null==(n=h[0])?void 0:n.status)===$o.uploaded&&c("span",null,[j("已上传")]),(null==(r=h[0])?void 0:r.status)===$o.failed&&c("span",null,[j("上传失败")])]}})]),[[x("file-drop"),{enableDrop:F,isSingle:!0,onFileDrop:S,onFileOver:T}]]),I&&c("div",{class:"devui-upload-tip"},[(null==(a=h[0])?void 0:a.status)===$o.uploading&&c("span",{class:"devui-loading"},[Wo]),(null==(l=h[0])?void 0:l.status)===$o.uploaded&&c("div",{class:"devui-loaded"},[c(_("d-icon"),{name:"right-o",color:"#50d4ab"},null),c("span",{style:"vertical-align: middle"},[Xo])]),(null==(s=h[0])?void 0:s.status)===$o.failed&&c("div",{class:"devui-upload-failed"},[c(_("d-icon"),{name:"info-o",color:"#f66f6a"},null),c("span",{style:"vertical-align: middle"},[c("span",{style:"margin-right: 8px"},[Ho]),c("a",{onClick:O},[Go])])])])])}});var Zo=l({name:"DMultipleUpload",props:Ro,emits:["fileDrop","fileOver","fileSelect","successEvent","errorEvent","deleteUploadedFileEvent","update:uploadedFiles"],setup(e,t){const{uploadOptions:n,fileOptions:r,placeholderText:o,autoUpload:i,withoutBtn:u,uploadText:a,disabled:l,beforeUpload:c,enableDrop:s,oneTimeUpload:d,showTip:p,uploadedFiles:v}=m(e),{triggerSelectFiles:h,_validateFiles:y,triggerDropFiles:b,checkAllFilesSize:g}=Ko(),{getFiles:w,fileUploaders:_,addFile:j,getFullFiles:x,deleteFile:O,upload:F,resetSameNameFiles:T,removeFiles:A,_oneTimeUpload:E,getSameNameFiles:I}=Vo(),k=f(!1),D=f(""),P=e=>{No.open({value:[{severity:"warn",content:e}]})},C=e=>{var o,u;T(),e.pipe(ze((e=>(j(e,n.value),e))),(o=100,void 0===u&&(u=Ce),S((function(e,t){var n=null,r=null,i=null,a=function(){if(n){n.unsubscribe(),n=null;var e=r;r=null,t.next(e)}};function l(){var e=i+o,r=u.now();if(r<e)return n=this.schedule(void 0,e-r),void t.add(n);a()}e.subscribe(new Ae(t,(function(e){r=e,i=u.now(),n||(n=u.schedule(l,o),t.add(n))}),(function(){a(),t.complete()}),void 0,(function(){r=n=null})))})))).subscribe((()=>{(()=>{let e=0;if(_.value.forEach((t=>{e+=t.file.size;const n=y(t.file,r.value.accept,t.uploadOptions);if(n&&n.checkError)return O(t.file),void P(n.errorMsg)})),d.value){const t=g(e,n.value.maximumSize);t&&t.checkError&&(A(),P(t.errorMsg))}})();const e=I();n.value.checkSameName&&e.length&&P(`您上传的 "${e}" 存在重名文件, 请重新选择文件`);const o=_.value.filter((e=>e.status===$o.preLoad)).map((e=>e.file));t.emit("fileSelect",o),i.value&&F()}),(e=>{P(e.message)}))};return{uploadOptions:n,fileOptions:r,placeholderText:o,autoUpload:i,withoutBtn:u,uploadText:a,disabled:l,beforeUpload:c,enableDrop:s,isDropOVer:k,onFileDrop:e=>{k.value=!1,C(b(r.value,n.value,e)),t.emit("fileDrop",e)},onFileOver:e=>{k.value=e,t.emit("fileOver",e)},handleClick:()=>{l.value||C(h(r.value))},fileUploaders:_,onDeleteFile:(e,t)=>{e.stopPropagation(),O(t)},fileUpload:(e,n)=>{e&&e.stopPropagation(),(()=>{let e=Promise.resolve(!0);if(c.value){const t=c.value(x());void 0!==t&&(e=t.then?t:t.subscribe?t.toPromise():Promise.resolve(t))}return e})().then((e=>{if(!e)return void A();(d.value?E():F(n)).pipe(Qe()).subscribe((e=>{t.emit("successEvent",e);const n=[...e.map((e=>e.file)),...v.value];t.emit("update:uploadedFiles",n)}),(e=>{t.emit("errorEvent",e)}))}))},showTip:p,getStatus:()=>{let e=0,t=0,n=0;const r=_.value.length;return _.value.forEach((r=>{r.status===$o.uploading?e++:r.status===$o.uploaded?t++:r.status===$o.failed&&n++})),n>0?(D.value=(e=>`${e}个文件上传失败!`)(n),"failed"):e>0?(D.value=((e,t)=>`${e}/${t}正在上传`)(e,r),"uploading"):t===r&&0!==t?"uploaded":0!==r?(D.value=(e=>`已添加${e}个文件`)(r),"selected"):void 0},uploadTips:D,cancelUpload:()=>{_.value=_.value.map((e=>(e.status===$o.uploading&&(e.cancel(),e.status=$o.failed),e)))},deleteUploadedFile:e=>{const n=v.value.filter((t=>t.name!==e.name));t.emit("deleteUploadedFileEvent",e),t.emit("update:uploadedFiles",n)}}},render(){var e,t,n,r;const{placeholderText:o,autoUpload:i,withoutBtn:u,uploadText:a,disabled:l,beforeUpload:s,enableDrop:f,isDropOVer:d,onFileDrop:p,onFileOver:v,handleClick:h,fileUploaders:y,onDeleteFile:b,fileUpload:m,showTip:j,getStatus:F,uploadTips:S,cancelUpload:T,uploadedFiles:A,deleteUploadedFile:E}=this;return c(g,null,[w(c("div",{class:"devui-upload",style:"border: "+(d?"1px solid #15bf15":"0")},[c("div",{class:"devui-input-group "+(l?"disabled":""),onClick:h},[0===y.length&&c("div",{class:"devui-form-control devui-upload-placeholder"},[o]),y.length>0&&c("ul",{class:"devui-form-control devui-files-list"},[y.map(((e,t)=>c("li",{key:t,class:"devui-file-item devui-file-tag",style:"display: inline-block; margin: 0 2px 2px 0",title:e.file.name},[c("span",{class:"evui-filename "+(e.status===$o.failed?"devui-failed-color":"")},[e.file.name]),c(_("d-icon"),{name:"close",class:`${(null==e?void 0:e.status)===$o.failed?"devui-upload-delete-file-button":""} ${(null==e?void 0:e.status)===$o.uploading||(null==e?void 0:e.status)===$o.uploaded?"devui-uploading-delete":""}`,onClick:t=>b(t,e.file)},null),e.status===$o.uploading&&c("div",{class:"icon devui-upload-progress"},[c(_("d-progress"),{isCircle:!0,percentage:e.percentage,barbgcolor:"#50D4AB",strokeWidth:8,showContent:!1},null)]),e.status===$o.failed&&c(_("d-icon"),{name:"running",onClick:m},null),e.status===$o.uploaded&&c(_("d-icon"),{name:"right",color:"#50d4ab"},null)])))]),c("span",{class:"devui-input-group-addon"},[c("svg",{class:"svg-icon-dot",height:"1em",width:"1em",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[c("path",{d:"m400.31892 176.970574c0-61.574381 50.113351-111.680569 111.679545-111.680569 61.576427 0 111.680569 50.106188 111.680569 111.680569 0 61.568241-50.104141 111.679545-111.680569 111.679545-61.566194 0-111.679545-50.111304-111.679545-111.679545zm0 335.028403c0-61.568241 50.113351-111.678522 111.679545-111.678522 61.576427 0 111.680569 50.110281 111.680569 111.678522 0 61.574381-50.105165 111.682615-111.680569 111.682615-61.566194 0-111.679545-50.108235-111.679545-111.682615zm0 335.037612c0-61.572334 50.113351-111.679545 111.679545-111.679545 61.575404 0 111.680569 50.107211 111.680569 111.679545 0 61.567217-50.105165 111.672382-111.680569 111.672382-61.566194 0-111.679545-50.105164-111.679545-111.672382zm0 0"},null)])])]),!i&&!u&&c(_("d-button"),{style:"marginLeft: 8px",bsStyle:"common",disabled:l,onClick:m},(I=a,"function"==typeof I||"[object Object]"===Object.prototype.toString.call(I)&&!O(I)?a:{default:()=>[a]}))]),[[x("file-drop"),{enableDrop:f,isSingle:!1,onFileDrop:p,onFileOver:v}]]),j&&c("div",{class:"devui-upload-tip"},["selected"===F()&&c("span",{class:"devui-loading"},[S]),"uploading"===F()&&c("span",{class:"devui-loading"},[c("span",{style:"margin-right: 8px"},[S]),c("a",{onClick:T},[Yo])]),"uploaded"===F()&&c("div",{class:"devui-loaded"},[c(_("d-icon"),{name:"right-o",color:"#50d4ab"},null),c("span",{style:"vertical-align: middle"},[Xo])]),"failed"===F()&&c("div",{class:"devui-upload-failed"},[c(_("d-icon"),{name:"info-o",color:"#f66f6a"},null),c("span",{style:"vertical-align: middle"},[c("span",{style:"margin-right: 8px"},[S]),c("a",{onClick:m},[Go])])])]),c("div",null,[null==(t=(e=this.$slots).preloadFiles)?void 0:t.call(e,{fileUploaders:y,deleteFile:b})]),c("div",null,[null==(r=(n=this.$slots).uploadedFiles)?void 0:r.call(n,{uploadedFiles:A,deleteFile:E})])]);var I}});const ei=e=>e.dataTransfer?e.dataTransfer:e.originalEvent.dataTransfer,ti=e=>{e.preventDefault(),e.stopPropagation()},ni={mounted:(e,t)=>{const{enableDrop:n}=t.value;n&&(((e,t)=>{const{onFileOver:n}=t.value;e.addEventListener("dragover",(e=>{var t;(t=ei(e).types)&&(t.indexOf?-1!==t.indexOf("Files"):t.contains&&t.contains("Files"))&&(ti(e),n&&n(!0))}))})(e,t),((e,t)=>{const{onFileOver:n}=t.value;e.addEventListener("dragleave",(t=>{t.currentTarget!==e&&(ti(t),n&&n(!0))}))})(e,t),((e,t)=>{const{onFileDrop:n,isSingle:r}=t.value;e.addEventListener("drop",(e=>{const t=ei(e);t&&(ti(e),r?n&&n([t.files[0]]):n&&n(t.files))}))})(e,t))}};Qo.install=function(e){e.directive("file-drop",ni),e.component(Qo.name,Qo),e.component(Zo.name,Zo)};var ri={title:"Upload 上传",category:"数据录入",install(e){e.use(Qo)}};export{Zo as MultiUpload,Qo as Upload,ri as 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"
|
|
14
|
+
},
|
|
15
|
+
duration: {
|
|
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,
|
|
40
|
+
default: null
|
|
41
|
+
},
|
|
42
|
+
classPrefix: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: DEFAULT_PREFIX
|
|
45
|
+
},
|
|
46
|
+
operable: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false
|
|
49
|
+
},
|
|
50
|
+
disabled: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
53
|
+
},
|
|
54
|
+
rotate: {
|
|
55
|
+
type: [Number, String]
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const svgIconProps = {
|
|
59
|
+
name: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: "",
|
|
62
|
+
required: true
|
|
63
|
+
},
|
|
64
|
+
color: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "inherit"
|
|
67
|
+
},
|
|
68
|
+
size: {
|
|
69
|
+
type: [Number, String],
|
|
70
|
+
default: "inherit"
|
|
71
|
+
}
|
|
72
|
+
};
|
|
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,
|
|
100
|
+
setup(props) {
|
|
101
|
+
const {
|
|
102
|
+
name,
|
|
103
|
+
color,
|
|
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")],
|
|
148
|
+
"style": {
|
|
149
|
+
width: iconSize.value || "",
|
|
150
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`,
|
|
151
|
+
verticalAlign: "middle"
|
|
152
|
+
}
|
|
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")],
|
|
161
|
+
"style": {
|
|
162
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
163
|
+
}
|
|
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
|
+
};
|
|
215
|
+
}
|
|
216
|
+
});
|
|
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({
|
|
231
|
+
emits: ["click"],
|
|
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)
|
|
239
|
+
}, [createVNode(Icon, {
|
|
240
|
+
"name": "close",
|
|
241
|
+
"size": "14px"
|
|
242
|
+
}, null)]);
|
|
243
|
+
}
|
|
244
|
+
});
|
|
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({
|
|
342
|
+
props: {
|
|
343
|
+
type: {
|
|
344
|
+
type: String,
|
|
345
|
+
default: "normal"
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
setup(props) {
|
|
349
|
+
const {
|
|
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))]);
|
|
360
|
+
}
|
|
361
|
+
});
|
|
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);
|
|
378
|
+
};
|
|
379
|
+
const interrupt = () => {
|
|
380
|
+
if (timer) {
|
|
381
|
+
clearTimeout(timer);
|
|
382
|
+
timer = null;
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
const removeReset = () => {
|
|
386
|
+
if (!props.modelValue) {
|
|
387
|
+
const remainTime = props.duration - (Date.now() - timestamp);
|
|
388
|
+
timer = setTimeout(close2, remainTime);
|
|
389
|
+
}
|
|
390
|
+
};
|
|
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);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
});
|
|
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
|
+
});
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
function _isSlot(s) {
|
|
458
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
459
|
+
}
|
|
460
|
+
const defaultOptions = {
|
|
461
|
+
modelValue: false,
|
|
462
|
+
duration: 3e3,
|
|
463
|
+
type: "normal"
|
|
464
|
+
};
|
|
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
|
+
});
|
|
488
|
+
}
|
|
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);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
class IUploadOptions {
|
|
520
|
+
}
|
|
521
|
+
class IFileOptions {
|
|
522
|
+
}
|
|
523
|
+
var UploadStatus = /* @__PURE__ */ ((UploadStatus2) => {
|
|
524
|
+
UploadStatus2[UploadStatus2["preLoad"] = 0] = "preLoad";
|
|
525
|
+
UploadStatus2[UploadStatus2["uploading"] = 1] = "uploading";
|
|
526
|
+
UploadStatus2[UploadStatus2["uploaded"] = 2] = "uploaded";
|
|
527
|
+
UploadStatus2[UploadStatus2["failed"] = 3] = "failed";
|
|
528
|
+
return UploadStatus2;
|
|
529
|
+
})(UploadStatus || {});
|
|
530
|
+
const uploadProps = {
|
|
531
|
+
accept: {
|
|
532
|
+
type: String
|
|
533
|
+
},
|
|
534
|
+
webkitdirectory: {
|
|
535
|
+
type: Boolean,
|
|
536
|
+
default: false
|
|
537
|
+
},
|
|
538
|
+
uploadOptions: {
|
|
539
|
+
type: Object
|
|
540
|
+
},
|
|
541
|
+
multiple: {
|
|
542
|
+
type: Boolean,
|
|
543
|
+
default: false
|
|
544
|
+
},
|
|
545
|
+
autoUpload: {
|
|
546
|
+
type: Boolean,
|
|
547
|
+
default: true
|
|
548
|
+
},
|
|
549
|
+
placeholder: {
|
|
550
|
+
type: String,
|
|
551
|
+
default: ""
|
|
552
|
+
},
|
|
553
|
+
modelValue: {
|
|
554
|
+
type: Array,
|
|
555
|
+
default: () => []
|
|
556
|
+
},
|
|
557
|
+
droppable: {
|
|
558
|
+
type: Boolean,
|
|
559
|
+
default: false
|
|
560
|
+
},
|
|
561
|
+
beforeUpload: {
|
|
562
|
+
type: Function
|
|
563
|
+
},
|
|
564
|
+
dynamicUploadOptionsFn: {
|
|
565
|
+
type: Function
|
|
566
|
+
},
|
|
567
|
+
disabled: {
|
|
568
|
+
type: Boolean,
|
|
569
|
+
default: false
|
|
570
|
+
},
|
|
571
|
+
onChange: {
|
|
572
|
+
type: Function
|
|
573
|
+
},
|
|
574
|
+
fileDrop: {
|
|
575
|
+
type: Function,
|
|
576
|
+
default: void 0
|
|
577
|
+
},
|
|
578
|
+
fileOver: {
|
|
579
|
+
type: Function,
|
|
580
|
+
default: void 0
|
|
581
|
+
},
|
|
582
|
+
fileSelect: {
|
|
583
|
+
type: Function,
|
|
584
|
+
default: void 0
|
|
585
|
+
},
|
|
586
|
+
deleteUploadedFile: {
|
|
587
|
+
type: Function,
|
|
588
|
+
default: void 0
|
|
589
|
+
},
|
|
590
|
+
onError: {
|
|
591
|
+
type: Function,
|
|
592
|
+
default: void 0
|
|
593
|
+
},
|
|
594
|
+
onSuccess: {
|
|
595
|
+
type: Function,
|
|
596
|
+
default: void 0
|
|
597
|
+
},
|
|
598
|
+
onExceed: {
|
|
599
|
+
type: Function,
|
|
600
|
+
default: void 0
|
|
601
|
+
},
|
|
602
|
+
onProgress: {
|
|
603
|
+
type: Function,
|
|
604
|
+
default: void 0
|
|
605
|
+
},
|
|
606
|
+
onPreview: {
|
|
607
|
+
type: Function,
|
|
608
|
+
default: void 0
|
|
609
|
+
},
|
|
610
|
+
oneTimeUpload: {
|
|
611
|
+
type: Boolean,
|
|
612
|
+
default: false
|
|
613
|
+
},
|
|
614
|
+
limit: {
|
|
615
|
+
type: Number,
|
|
616
|
+
default: 0
|
|
617
|
+
},
|
|
618
|
+
httpRequest: {
|
|
619
|
+
type: Function,
|
|
620
|
+
default: void 0
|
|
621
|
+
}
|
|
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
|
+
};
|
|
715
|
+
class FileUploader {
|
|
716
|
+
constructor(file, uploadOptions) {
|
|
717
|
+
this.file = file;
|
|
718
|
+
this.uploadOptions = uploadOptions;
|
|
719
|
+
this.percentage = 0;
|
|
720
|
+
this.file = file;
|
|
721
|
+
this.uploadOptions = uploadOptions;
|
|
722
|
+
this.status = UploadStatus.preLoad;
|
|
723
|
+
}
|
|
724
|
+
send(uploadFiles) {
|
|
725
|
+
return new Promise((resolve, reject) => {
|
|
726
|
+
const { uri, method, headers, authToken, authTokenHeader, additionalParameter, fileFieldName, withCredentials, responseType } = this.uploadOptions || {};
|
|
727
|
+
const authTokenHeader_ = authTokenHeader || "Authorization";
|
|
728
|
+
const fileFieldName_ = fileFieldName || "file";
|
|
729
|
+
this.xhr = new XMLHttpRequest();
|
|
730
|
+
this.xhr.open(method || "POST", uri || "");
|
|
731
|
+
if (withCredentials) {
|
|
732
|
+
this.xhr.withCredentials = withCredentials;
|
|
733
|
+
}
|
|
734
|
+
if (responseType) {
|
|
735
|
+
this.xhr.responseType = responseType;
|
|
736
|
+
}
|
|
737
|
+
if (authToken) {
|
|
738
|
+
this.xhr.setRequestHeader(authTokenHeader_, authToken);
|
|
739
|
+
}
|
|
740
|
+
if (headers) {
|
|
741
|
+
Object.keys(headers).forEach((key) => {
|
|
742
|
+
var _a;
|
|
743
|
+
(_a = this.xhr) == null ? void 0 : _a.setRequestHeader(key, headers[key]);
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
this.xhr.upload.onprogress = (e) => {
|
|
747
|
+
this.percentage = Math.round(e.loaded * 100 / e.total);
|
|
748
|
+
};
|
|
749
|
+
const formData = uploadFiles && uploadFiles.length ? this.oneTimeUploadFiles(fileFieldName_, additionalParameter, uploadFiles) : this.parallelUploadFiles(fileFieldName_, additionalParameter);
|
|
750
|
+
this.xhr.send(formData);
|
|
751
|
+
this.status = UploadStatus.uploading;
|
|
752
|
+
this.xhr.onabort = () => {
|
|
753
|
+
this.status = UploadStatus.preLoad;
|
|
754
|
+
this.xhr = null;
|
|
755
|
+
};
|
|
756
|
+
this.xhr.onerror = () => {
|
|
757
|
+
var _a, _b;
|
|
758
|
+
this.response = (_a = this.xhr) == null ? void 0 : _a.response;
|
|
759
|
+
this.status = UploadStatus.failed;
|
|
760
|
+
reject({ file: this.file, response: (_b = this.xhr) == null ? void 0 : _b.response });
|
|
761
|
+
};
|
|
762
|
+
this.xhr.onload = () => {
|
|
763
|
+
var _a, _b, _c;
|
|
764
|
+
if (((_a = this.xhr) == null ? void 0 : _a.readyState) === 4 && this.xhr.status >= 200 && this.xhr.status < 300) {
|
|
765
|
+
this.response = this.xhr.response;
|
|
766
|
+
this.status = UploadStatus.uploaded;
|
|
767
|
+
resolve({ file: this.file, response: this.xhr.response });
|
|
768
|
+
} else {
|
|
769
|
+
this.response = (_b = this.xhr) == null ? void 0 : _b.response;
|
|
770
|
+
this.status = UploadStatus.failed;
|
|
771
|
+
reject({ file: this.file, response: (_c = this.xhr) == null ? void 0 : _c.response });
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
parallelUploadFiles(fileFieldName_, additionalParameter) {
|
|
777
|
+
const formData = new FormData();
|
|
778
|
+
formData.append(fileFieldName_, this.file, this.file.name);
|
|
779
|
+
if (additionalParameter) {
|
|
780
|
+
Object.keys(additionalParameter).forEach((key) => {
|
|
781
|
+
formData.append(key, additionalParameter[key]);
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
return formData;
|
|
785
|
+
}
|
|
786
|
+
oneTimeUploadFiles(fileFieldName_, additionalParameter, uploadFiles) {
|
|
787
|
+
const formData = new FormData();
|
|
788
|
+
uploadFiles.forEach((element) => {
|
|
789
|
+
formData.append(fileFieldName_, element.file, element.file.name);
|
|
790
|
+
if (additionalParameter) {
|
|
791
|
+
Object.keys(additionalParameter).forEach((key) => {
|
|
792
|
+
formData.append(key, additionalParameter[key]);
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
return formData;
|
|
797
|
+
}
|
|
798
|
+
cancel() {
|
|
799
|
+
if (this.xhr) {
|
|
800
|
+
this.xhr.abort();
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
const useUpload = () => {
|
|
805
|
+
const fileUploaders = ref([]);
|
|
806
|
+
const filesWithSameName = ref([]);
|
|
807
|
+
const checkFileSame = (fileName) => {
|
|
808
|
+
let checkRel = true;
|
|
809
|
+
for (let i = 0; i < fileUploaders.value.length; i++) {
|
|
810
|
+
if (fileName === fileUploaders.value[i].file.name) {
|
|
811
|
+
checkRel = false;
|
|
812
|
+
if (filesWithSameName.value.indexOf(fileName) === -1) {
|
|
813
|
+
filesWithSameName.value.push(fileName);
|
|
814
|
+
}
|
|
815
|
+
break;
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
return checkRel;
|
|
819
|
+
};
|
|
820
|
+
const addFile = (file, options) => {
|
|
821
|
+
if (options && options.checkSameName) {
|
|
822
|
+
if (checkFileSame(file.name)) {
|
|
823
|
+
fileUploaders.value.push(new FileUploader(file, options));
|
|
824
|
+
}
|
|
825
|
+
} else {
|
|
826
|
+
fileUploaders.value.push(new FileUploader(file, options));
|
|
827
|
+
}
|
|
828
|
+
};
|
|
829
|
+
const getFiles = () => {
|
|
830
|
+
return fileUploaders.value.map((fileUploader) => {
|
|
831
|
+
return fileUploader.file;
|
|
832
|
+
});
|
|
833
|
+
};
|
|
834
|
+
const getFullFiles = () => {
|
|
835
|
+
return fileUploaders.value.map((fileUploader) => {
|
|
836
|
+
return fileUploader;
|
|
837
|
+
});
|
|
838
|
+
};
|
|
839
|
+
const dealOneTimeUploadFiles = async (uploads) => {
|
|
840
|
+
if (!uploads || !uploads.length) {
|
|
841
|
+
return Promise.reject("no files");
|
|
842
|
+
}
|
|
843
|
+
let finalUploads = [];
|
|
844
|
+
await uploads[0].send(uploads).finally(() => finalUploads = uploads.map((file) => {
|
|
845
|
+
file.status = uploads[0].status;
|
|
846
|
+
file.percentage = uploads[0].percentage;
|
|
847
|
+
return { file: file.file, response: uploads[0].response };
|
|
848
|
+
}));
|
|
849
|
+
return finalUploads;
|
|
850
|
+
};
|
|
851
|
+
const upload2 = async (oneFile) => {
|
|
852
|
+
let uploads = [];
|
|
853
|
+
if (oneFile) {
|
|
854
|
+
oneFile.percentage = 0;
|
|
855
|
+
const uploadedFile = await oneFile.send();
|
|
856
|
+
uploads.push(uploadedFile);
|
|
857
|
+
} else {
|
|
858
|
+
const preFiles = fileUploaders.value.filter((fileUploader) => fileUploader.status === UploadStatus.preLoad);
|
|
859
|
+
const failedFiles = fileUploaders.value.filter((fileUploader) => fileUploader.status === UploadStatus.failed);
|
|
860
|
+
const uploadFiles = preFiles.length > 0 ? preFiles : failedFiles;
|
|
861
|
+
uploads = await Promise.all(uploadFiles.map(async (fileUploader) => {
|
|
862
|
+
fileUploader.percentage = 0;
|
|
863
|
+
const uploadedFile = await fileUploader.send();
|
|
864
|
+
return uploadedFile;
|
|
865
|
+
}));
|
|
866
|
+
}
|
|
867
|
+
if (uploads.length > 0) {
|
|
868
|
+
return Promise.resolve(uploads);
|
|
869
|
+
}
|
|
870
|
+
return Promise.reject("no files");
|
|
871
|
+
};
|
|
872
|
+
const _oneTimeUpload = () => {
|
|
873
|
+
const uploads = fileUploaders.value.filter((fileUploader) => fileUploader.status !== UploadStatus.uploaded);
|
|
874
|
+
return dealOneTimeUploadFiles(uploads);
|
|
875
|
+
};
|
|
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
|
+
});
|
|
882
|
+
};
|
|
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 = [];
|
|
892
|
+
};
|
|
893
|
+
return {
|
|
894
|
+
fileUploaders,
|
|
895
|
+
getFiles,
|
|
896
|
+
addFile,
|
|
897
|
+
getFullFiles,
|
|
898
|
+
deleteFile,
|
|
899
|
+
upload: upload2,
|
|
900
|
+
removeFiles,
|
|
901
|
+
getSameNameFiles,
|
|
902
|
+
resetSameNameFiles,
|
|
903
|
+
_oneTimeUpload
|
|
904
|
+
};
|
|
905
|
+
};
|
|
906
|
+
var upload = "";
|
|
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;
|
|
919
|
+
}
|
|
920
|
+
});
|
|
921
|
+
return prev;
|
|
922
|
+
}, {});
|
|
923
|
+
}
|
|
924
|
+
var zhCN = {
|
|
925
|
+
pagination: {
|
|
926
|
+
totalItemText: "\u6240\u6709\u6761\u76EE",
|
|
927
|
+
goToText: "\u8DF3\u81F3"
|
|
928
|
+
},
|
|
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"
|
|
1035
|
+
}
|
|
1036
|
+
};
|
|
1037
|
+
const lang = ref("zh-CN");
|
|
1038
|
+
let langMessages = reactive({
|
|
1039
|
+
[lang.value]: zhCN
|
|
1040
|
+
});
|
|
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
|
+
};
|
|
1074
|
+
}
|
|
1075
|
+
var Upload = defineComponent({
|
|
1076
|
+
name: "DUpload",
|
|
1077
|
+
props: uploadProps,
|
|
1078
|
+
emits: ["fileDrop", "fileOver", "fileSelect", "deleteUploadedFile", "update:modelValue"],
|
|
1079
|
+
setup(props, ctx) {
|
|
1080
|
+
const app = getCurrentInstance();
|
|
1081
|
+
const t = createI18nTranslate("DUpload", app);
|
|
1082
|
+
const {
|
|
1083
|
+
uploadOptions,
|
|
1084
|
+
placeholder,
|
|
1085
|
+
autoUpload,
|
|
1086
|
+
disabled,
|
|
1087
|
+
beforeUpload,
|
|
1088
|
+
droppable,
|
|
1089
|
+
oneTimeUpload,
|
|
1090
|
+
modelValue,
|
|
1091
|
+
multiple,
|
|
1092
|
+
accept,
|
|
1093
|
+
webkitdirectory,
|
|
1094
|
+
limit,
|
|
1095
|
+
httpRequest
|
|
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");
|
|
1101
|
+
const {
|
|
1102
|
+
triggerSelectFiles,
|
|
1103
|
+
_validateFiles,
|
|
1104
|
+
triggerDropFiles,
|
|
1105
|
+
checkAllFilesSize
|
|
1106
|
+
} = useSelectFiles(t);
|
|
1107
|
+
const {
|
|
1108
|
+
fileUploaders,
|
|
1109
|
+
addFile,
|
|
1110
|
+
getFullFiles,
|
|
1111
|
+
deleteFile,
|
|
1112
|
+
upload: upload2,
|
|
1113
|
+
resetSameNameFiles,
|
|
1114
|
+
removeFiles,
|
|
1115
|
+
_oneTimeUpload,
|
|
1116
|
+
getSameNameFiles
|
|
1117
|
+
} = useUpload();
|
|
1118
|
+
const isDropOver = ref(false);
|
|
1119
|
+
const selectedFiles = ref([]);
|
|
1120
|
+
const alertMsg = (errorMsg) => {
|
|
1121
|
+
NotificationService.open({
|
|
1122
|
+
type: "warning",
|
|
1123
|
+
content: errorMsg
|
|
1124
|
+
});
|
|
1125
|
+
};
|
|
1126
|
+
const checkValid = () => {
|
|
1127
|
+
var _a;
|
|
1128
|
+
let totalFileSize = 0;
|
|
1129
|
+
fileUploaders.value.forEach((fileUploader) => {
|
|
1130
|
+
totalFileSize += fileUploader.file.size;
|
|
1131
|
+
const checkResult = _validateFiles(fileUploader.file, (accept == null ? void 0 : accept.value) || "", fileUploader.uploadOptions);
|
|
1132
|
+
if (checkResult && checkResult.checkError) {
|
|
1133
|
+
deleteFile(fileUploader.file);
|
|
1134
|
+
alertMsg(checkResult.errorMsg);
|
|
1135
|
+
return;
|
|
1136
|
+
}
|
|
1137
|
+
});
|
|
1138
|
+
if (oneTimeUpload.value) {
|
|
1139
|
+
const checkResult = checkAllFilesSize(totalFileSize, ((_a = uploadOptions == null ? void 0 : uploadOptions.value) == null ? void 0 : _a.maximumSize) || 0);
|
|
1140
|
+
if (checkResult && checkResult.checkError) {
|
|
1141
|
+
removeFiles();
|
|
1142
|
+
alertMsg(checkResult.errorMsg);
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
};
|
|
1146
|
+
const onFileOver = (event) => {
|
|
1147
|
+
isDropOver.value = event;
|
|
1148
|
+
ctx.emit("fileOver", event);
|
|
1149
|
+
};
|
|
1150
|
+
const deleteUploadedFile = (file) => {
|
|
1151
|
+
const newUploadedFiles = modelValue.value.filter((uploadedFile) => {
|
|
1152
|
+
return uploadedFile.name !== file.name;
|
|
1153
|
+
});
|
|
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);
|
|
1163
|
+
};
|
|
1164
|
+
const canUpload = () => {
|
|
1165
|
+
let uploadResult = Promise.resolve(true);
|
|
1166
|
+
if (beforeUpload == null ? void 0 : beforeUpload.value) {
|
|
1167
|
+
const result = beforeUpload == null ? void 0 : beforeUpload.value(getFullFiles());
|
|
1168
|
+
if (typeof result !== "undefined") {
|
|
1169
|
+
if (typeof result === "boolean") {
|
|
1170
|
+
uploadResult = Promise.resolve(result);
|
|
1171
|
+
} else {
|
|
1172
|
+
uploadResult = result;
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
return uploadResult;
|
|
1177
|
+
};
|
|
1178
|
+
const fileUpload = (event, fileUploader) => {
|
|
1179
|
+
if (event) {
|
|
1180
|
+
event.stopPropagation();
|
|
1181
|
+
}
|
|
1182
|
+
canUpload().then((_canUpload) => {
|
|
1183
|
+
if (!_canUpload) {
|
|
1184
|
+
removeFiles();
|
|
1185
|
+
return;
|
|
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
|
+
}
|
|
1192
|
+
const uploadObservable = oneTimeUpload.value ? _oneTimeUpload() : upload2(fileUploader);
|
|
1193
|
+
props.onProgress && props.onProgress(selectedFiles.value, modelValue.value);
|
|
1194
|
+
uploadObservable == null ? void 0 : uploadObservable.then((results) => {
|
|
1195
|
+
props.onSuccess && props.onSuccess(results);
|
|
1196
|
+
const newFiles = results.map((result) => result.file);
|
|
1197
|
+
const newUploadedFiles = [...newFiles, ...modelValue.value];
|
|
1198
|
+
ctx.emit("update:modelValue", newUploadedFiles);
|
|
1199
|
+
props.onChange && props.onChange(newFiles, newUploadedFiles);
|
|
1200
|
+
}).catch((error) => {
|
|
1201
|
+
props.onError && props.onError(error);
|
|
1202
|
+
props.onChange && props.onChange([error.file], modelValue.value);
|
|
1203
|
+
});
|
|
1204
|
+
});
|
|
1205
|
+
};
|
|
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));
|
|
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);
|
|
1232
|
+
});
|
|
1233
|
+
};
|
|
1234
|
+
const handleClick = () => {
|
|
1235
|
+
if (disabled.value) {
|
|
1236
|
+
return;
|
|
1237
|
+
}
|
|
1238
|
+
_dealFiles(triggerSelectFiles({
|
|
1239
|
+
accept: accept == null ? void 0 : accept.value,
|
|
1240
|
+
multiple: multiple.value,
|
|
1241
|
+
webkitdirectory: webkitdirectory.value
|
|
1242
|
+
}));
|
|
1243
|
+
};
|
|
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);
|
|
1255
|
+
});
|
|
1256
|
+
};
|
|
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
|
+
})])]);
|
|
1319
|
+
};
|
|
1320
|
+
}
|
|
1321
|
+
});
|
|
1322
|
+
const getTransfer = (event) => {
|
|
1323
|
+
var _a;
|
|
1324
|
+
return event.dataTransfer ? event.dataTransfer : (_a = event.originalEvent) == null ? void 0 : _a.dataTransfer;
|
|
1325
|
+
};
|
|
1326
|
+
const haveFiles = (types) => {
|
|
1327
|
+
if (!types) {
|
|
1328
|
+
return false;
|
|
1329
|
+
}
|
|
1330
|
+
if (types.indexOf) {
|
|
1331
|
+
return types.indexOf("Files") !== -1;
|
|
1332
|
+
} else if (types.contains) {
|
|
1333
|
+
return types.contains("Files");
|
|
1334
|
+
} else {
|
|
1335
|
+
return false;
|
|
1336
|
+
}
|
|
1337
|
+
};
|
|
1338
|
+
const preventAndStop = (event) => {
|
|
1339
|
+
event.preventDefault();
|
|
1340
|
+
event.stopPropagation();
|
|
1341
|
+
};
|
|
1342
|
+
const onDragOver = (el, binding) => {
|
|
1343
|
+
const { onFileOver } = binding.value;
|
|
1344
|
+
el.addEventListener("dragover", (event) => {
|
|
1345
|
+
const transfer = getTransfer(event);
|
|
1346
|
+
if (!haveFiles(transfer.types)) {
|
|
1347
|
+
return;
|
|
1348
|
+
}
|
|
1349
|
+
preventAndStop(event);
|
|
1350
|
+
onFileOver && onFileOver(true);
|
|
1351
|
+
});
|
|
1352
|
+
};
|
|
1353
|
+
const onDragLeave = (el, binding) => {
|
|
1354
|
+
const { onFileOver } = binding.value;
|
|
1355
|
+
el.addEventListener("dragleave", (event) => {
|
|
1356
|
+
if (event.currentTarget === el) {
|
|
1357
|
+
return;
|
|
1358
|
+
}
|
|
1359
|
+
preventAndStop(event);
|
|
1360
|
+
onFileOver && onFileOver(true);
|
|
1361
|
+
});
|
|
1362
|
+
};
|
|
1363
|
+
const onDrop = (el, binding) => {
|
|
1364
|
+
const { onFileDrop, isSingle } = binding.value;
|
|
1365
|
+
el.addEventListener("drop", (event) => {
|
|
1366
|
+
const transfer = getTransfer(event);
|
|
1367
|
+
if (!transfer) {
|
|
1368
|
+
return;
|
|
1369
|
+
}
|
|
1370
|
+
preventAndStop(event);
|
|
1371
|
+
if (isSingle) {
|
|
1372
|
+
onFileDrop && onFileDrop([transfer.files[0]]);
|
|
1373
|
+
} else {
|
|
1374
|
+
onFileDrop && onFileDrop(Array.from(transfer.files));
|
|
1375
|
+
}
|
|
1376
|
+
});
|
|
1377
|
+
};
|
|
1378
|
+
const fileDropDirective = {
|
|
1379
|
+
mounted: (el, binding) => {
|
|
1380
|
+
const { droppable } = binding.value;
|
|
1381
|
+
if (!droppable) {
|
|
1382
|
+
return;
|
|
1383
|
+
}
|
|
1384
|
+
onDragOver(el, binding);
|
|
1385
|
+
onDragLeave(el, binding);
|
|
1386
|
+
onDrop(el, binding);
|
|
1387
|
+
}
|
|
1388
|
+
};
|
|
1389
|
+
var index = {
|
|
1390
|
+
title: "Upload \u4E0A\u4F20",
|
|
1391
|
+
category: "\u6570\u636E\u5F55\u5165",
|
|
1392
|
+
status: "100%",
|
|
1393
|
+
install(app) {
|
|
1394
|
+
app.directive("file-drop", fileDropDirective);
|
|
1395
|
+
app.component(Upload.name, Upload);
|
|
1396
|
+
}
|
|
1397
|
+
};
|
|
1398
|
+
export { IFileOptions, IUploadOptions, Upload, UploadStatus, index as default, uploadProps };
|