vue-devui 1.0.0-beta.2 → 1.0.0-beta.20220808
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +163 -172
- package/alert/index.d.ts +7 -0
- package/alert/index.es.js +79 -51
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.d.ts +7 -0
- package/auto-complete/index.es.js +9053 -0
- package/auto-complete/index.umd.js +40 -0
- package/auto-complete/package.json +7 -0
- package/auto-complete/style.css +1 -0
- package/avatar/index.d.ts +7 -0
- package/avatar/index.es.js +154 -147
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.d.ts +7 -0
- package/badge/index.es.js +46 -21
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.d.ts +7 -0
- package/button/index.es.js +5921 -146
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.d.ts +7 -0
- package/card/index.es.js +64 -36
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.d.ts +7 -0
- package/checkbox/index.es.js +8122 -255
- package/checkbox/index.umd.js +38 -1
- package/checkbox/style.css +1 -1
- package/collapse/index.d.ts +7 -0
- package/collapse/index.es.js +195 -0
- package/collapse/index.umd.js +1 -0
- package/{cascader → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.d.ts +7 -0
- package/countdown/index.es.js +217 -0
- package/countdown/index.umd.js +1 -0
- package/{accordion → countdown}/package.json +1 -1
- package/countdown/style.css +1 -0
- package/date-picker-pro/index.d.ts +7 -0
- package/date-picker-pro/index.es.js +12035 -0
- package/date-picker-pro/index.umd.js +38 -0
- package/date-picker-pro/package.json +7 -0
- package/date-picker-pro/style.css +1 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +205 -154
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +736 -0
- package/dropdown/index.umd.js +1 -0
- package/{carousel → dropdown}/package.json +1 -1
- package/dropdown/style.css +1 -0
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +908 -461
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.d.ts +7 -0
- package/form/index.es.js +2439 -1995
- package/form/index.umd.js +29 -18
- package/form/style.css +1 -1
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +138 -125
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +271 -0
- package/grid/index.umd.js +1 -0
- package/{toast → grid}/package.json +1 -1
- package/grid/style.css +1 -0
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +200 -56
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.d.ts +7 -0
- package/image-preview/index.es.js +154 -62
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/index.d.ts +7 -0
- package/input/index.d.ts +7 -0
- package/input/index.es.js +8269 -145
- package/input/index.umd.js +38 -1
- package/input/style.css +1 -1
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +260 -191
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.d.ts +7 -0
- package/layout/index.es.js +41 -26
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.d.ts +7 -0
- package/loading/index.es.js +89 -73
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/mention/index.d.ts +7 -0
- package/mention/index.es.js +8326 -0
- package/mention/index.umd.js +47 -0
- package/mention/package.json +7 -0
- package/mention/style.css +1 -0
- package/menu/index.d.ts +7 -0
- package/menu/index.es.js +891 -0
- package/menu/index.umd.js +1 -0
- package/{anchor → menu}/package.json +1 -1
- package/menu/style.css +1 -0
- package/message/index.d.ts +7 -0
- package/message/index.es.js +533 -0
- package/message/index.umd.js +1 -0
- package/message/package.json +7 -0
- package/message/style.css +1 -0
- package/modal/index.d.ts +7 -0
- package/modal/index.es.js +611 -877
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.d.ts +7 -0
- package/notification/index.es.js +528 -0
- package/notification/index.umd.js +1 -0
- package/notification/package.json +7 -0
- package/notification/style.css +1 -0
- package/nuxt/components/Alert.js +3 -0
- package/nuxt/components/Aside.js +3 -0
- package/nuxt/components/AutoComplete.js +3 -0
- package/nuxt/components/Avatar.js +3 -0
- package/nuxt/components/Badge.js +3 -0
- package/nuxt/components/Button.js +3 -0
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/Card.js +3 -0
- package/nuxt/components/Checkbox.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Col.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/Content.js +3 -0
- package/nuxt/components/Countdown.js +3 -0
- package/nuxt/components/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.js +3 -0
- package/nuxt/components/Drawer.js +3 -0
- package/nuxt/components/DrawerService.js +3 -0
- package/nuxt/components/Dropdown.js +3 -0
- package/nuxt/components/DropdownMenu.js +3 -0
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/EditableSelect.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/FixedOverlay.js +3 -0
- package/nuxt/components/FlexibleOverlay.js +3 -0
- package/nuxt/components/Footer.js +3 -0
- package/nuxt/components/Form.js +3 -0
- package/nuxt/components/FormItem.js +3 -0
- package/nuxt/components/FormOperation.js +3 -0
- package/nuxt/components/Fullscreen.js +3 -0
- package/nuxt/components/Header.js +3 -0
- package/nuxt/components/IFileOptions.js +3 -0
- package/nuxt/components/IUploadOptions.js +3 -0
- package/nuxt/components/Icon.js +3 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/ImagePreviewService.js +3 -0
- package/nuxt/components/Input.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/Layout.js +3 -0
- package/nuxt/components/Loading.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/LoadingService.js +3 -0
- package/nuxt/components/Mention.js +3 -0
- package/nuxt/components/Menu.js +3 -0
- package/nuxt/components/MenuItem.js +3 -0
- package/nuxt/components/Message.js +3 -0
- package/nuxt/components/Modal.js +3 -0
- package/nuxt/components/Notification.js +3 -0
- package/nuxt/components/NotificationService.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/OptionGroup.js +3 -0
- package/nuxt/components/Pagination.js +3 -0
- package/nuxt/components/Panel.js +3 -0
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.js +3 -0
- package/nuxt/components/Popover.js +3 -0
- package/nuxt/components/Progress.js +3 -0
- package/nuxt/components/Radio.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/RadioGroup.js +3 -0
- package/nuxt/components/Rate.js +3 -0
- package/nuxt/components/Result.js +3 -0
- package/nuxt/components/Row.js +3 -0
- package/nuxt/components/Search.js +3 -0
- package/nuxt/components/Select.js +3 -0
- package/nuxt/components/Skeleton.js +3 -0
- package/nuxt/components/SkeletonItem.js +3 -0
- package/nuxt/components/Slider.js +3 -0
- package/nuxt/components/Splitter.js +3 -0
- package/nuxt/components/Statistic.js +3 -0
- package/nuxt/components/Status.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/SubMenu.js +3 -0
- package/nuxt/components/Switch.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/Table.js +3 -0
- package/nuxt/components/Tabs.js +3 -0
- package/nuxt/components/Tag.js +3 -0
- package/nuxt/components/Textarea.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/TimeSelect.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/Tooltip.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/Upload.js +3 -0
- package/nuxt/components/UploadStatus.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/animationInjectionKey.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/badgeProps.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/buttonProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.js +3 -0
- package/nuxt/components/dropdownMenuProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/fixedOverlayProps.js +3 -0
- package/nuxt/components/flexibleOverlayProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +3 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/mentionProps.js +3 -0
- package/nuxt/components/messageProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/notificationProps.js +3 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/popoverProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/roundInjectionKey.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/skeletonItemProps.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tableProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/nuxt/components/tooltipProps.js +3 -0
- package/nuxt/components/treeNodeProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/nuxt/components/uploadProps.js +3 -0
- package/nuxt/index.js +13 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +245 -303
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +16 -84
- package/pagination/index.d.ts +7 -0
- package/pagination/index.es.js +333 -155
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/index.d.ts +7 -0
- package/panel/index.es.js +48 -35
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.d.ts +7 -0
- package/popover/index.es.js +6035 -204
- package/popover/index.umd.js +27 -1
- package/popover/style.css +1 -1
- package/progress/index.d.ts +7 -0
- package/progress/index.es.js +111 -57
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +8015 -182
- package/radio/index.umd.js +38 -1
- package/radio/style.css +1 -1
- package/rate/index.d.ts +7 -0
- package/rate/index.es.js +78 -56
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.d.ts +7 -0
- package/result/index.es.js +248 -0
- package/result/index.umd.js +1 -0
- package/{sticky → result}/package.json +1 -1
- package/result/style.css +1 -0
- package/ripple/index.d.ts +7 -0
- package/ripple/index.es.js +56 -61
- package/ripple/index.umd.js +1 -1
- package/search/index.d.ts +7 -0
- package/search/index.es.js +8381 -406
- package/search/index.umd.js +38 -1
- package/search/style.css +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +9331 -576
- package/select/index.umd.js +38 -1
- package/select/style.css +1 -1
- package/skeleton/index.d.ts +7 -0
- package/skeleton/index.es.js +115 -145
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.d.ts +7 -0
- package/slider/index.es.js +148 -142
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.d.ts +7 -0
- package/splitter/index.es.js +6308 -181
- package/splitter/index.umd.js +27 -1
- package/splitter/style.css +1 -1
- package/statistic/index.d.ts +7 -0
- package/statistic/index.es.js +253 -0
- package/statistic/index.umd.js +1 -0
- package/statistic/package.json +7 -0
- package/statistic/style.css +1 -0
- package/status/index.d.ts +7 -0
- package/status/index.es.js +29 -8
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/steps/index.d.ts +7 -0
- package/steps/index.es.js +386 -0
- package/steps/index.umd.js +1 -0
- package/steps/package.json +7 -0
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.d.ts +7 -0
- package/switch/index.es.js +7819 -65
- package/switch/index.umd.js +38 -1
- package/switch/style.css +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +11435 -204
- package/table/index.umd.js +38 -1
- package/table/style.css +1 -1
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +356 -143
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.d.ts +7 -0
- package/tag/index.es.js +156 -0
- package/tag/index.umd.js +1 -0
- package/tag/package.json +7 -0
- package/tag/style.css +1 -0
- package/textarea/index.d.ts +7 -0
- package/textarea/index.es.js +7989 -0
- package/textarea/index.umd.js +46 -0
- package/textarea/package.json +7 -0
- package/textarea/style.css +1 -0
- package/{theme → theme/theme.scss} +0 -0
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +9126 -597
- package/time-picker/index.umd.js +38 -1
- package/time-picker/style.css +1 -1
- package/time-select/index.d.ts +7 -0
- package/time-select/index.es.js +9606 -0
- package/time-select/index.umd.js +38 -0
- package/{breadcrumb → time-select}/package.json +1 -1
- package/time-select/style.css +1 -0
- package/timeline/index.d.ts +7 -0
- package/timeline/index.es.js +427 -0
- package/timeline/index.umd.js +1 -0
- package/timeline/package.json +7 -0
- package/timeline/style.css +1 -0
- package/tooltip/index.d.ts +7 -0
- package/tooltip/index.es.js +5870 -141
- package/tooltip/index.umd.js +27 -1
- package/tooltip/style.css +1 -1
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +11504 -692
- package/tree/index.umd.js +38 -1
- package/tree/style.css +1 -1
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +968 -2748
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +22816 -16568
- package/vue-devui.umd.js +42 -20
- package/accordion/index.es.js +0 -190
- package/accordion/index.umd.js +0 -1
- package/accordion/style.css +0 -1
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/breadcrumb/index.es.js +0 -127
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/style.css +0 -1
- package/carousel/index.es.js +0 -328
- package/carousel/index.umd.js +0 -1
- package/carousel/style.css +0 -1
- package/cascader/index.es.js +0 -187
- package/cascader/index.umd.js +0 -1
- package/cascader/style.css +0 -1
- package/date-picker/index.es.js +0 -1171
- package/date-picker/index.umd.js +0 -1
- package/date-picker/package.json +0 -7
- package/date-picker/style.css +0 -1
- package/nav-sprite/index.es.js +0 -742
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/quadrant-diagram/index.es.js +0 -489
- package/quadrant-diagram/index.umd.js +0 -1
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/steps-guide/index.es.js +0 -211
- package/steps-guide/index.umd.js +0 -1
- package/steps-guide/package.json +0 -7
- package/steps-guide/style.css +0 -1
- package/sticky/index.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/tag-input/index.es.js +0 -341
- package/tag-input/index.umd.js +0 -1
- package/tag-input/package.json +0 -7
- package/tag-input/style.css +0 -1
- package/time-axis/index.es.js +0 -79
- package/time-axis/index.umd.js +0 -1
- package/time-axis/package.json +0 -7
- package/time-axis/style.css +0 -1
- package/toast/index.es.js +0 -2059
- package/toast/index.umd.js +0 -1
- package/toast/style.css +0 -1
- package/transfer/index.es.js +0 -1446
- package/transfer/index.umd.js +0 -1
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree-select/index.es.js +0 -203
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
package/modal/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var fe=Object.defineProperty,ye=Object.defineProperties;var me=Object.getOwnPropertyDescriptors;var R=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var I=(d,t,g)=>t in d?fe(d,t,{enumerable:!0,configurable:!0,writable:!0,value:g}):d[t]=g,C=(d,t)=>{for(var g in t||(t={}))q.call(t,g)&&I(d,g,t[g]);if(R)for(var g of R(t))K.call(t,g)&&I(d,g,t[g]);return d},x=(d,t)=>ye(d,me(t));var L=(d,t)=>{var g={};for(var v in d)q.call(d,v)&&t.indexOf(v)<0&&(g[v]=d[v]);if(d!=null&&R)for(var v of R(d))t.indexOf(v)<0&&K.call(d,v)&&(g[v]=d[v]);return g};var D=(d,t,g)=>(I(d,typeof t!="symbol"?t+"":t,g),g);(function(d,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(d=typeof globalThis!="undefined"?globalThis:d||self,t(d.index={},d.Vue))})(this,function(d,t){"use strict";const g={width:{type:String,default:"300px"},maxHeight:{type:String},zIndex:{type:Number,default:1050},backdropZIndex:{type:Number,default:1049},placement:{type:String,default:"center"},offsetX:{type:String,default:"0px"},offsetY:{type:String,default:"0px"},showAnimation:{type:Boolean,default:!0},backdropCloseable:{type:Boolean,default:!1},bodyScrollable:{type:Boolean,default:!0},escapeable:{type:Boolean,default:!0},onClose:{type:Function},beforeHidden:{type:[Object,Function]},modelValue:{type:Boolean},"onUpdate:modelValue":{type:Function}};var v="";function W(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const F=t.defineComponent({setup(e,n){return()=>{let o;return t.createVNode(t.Teleport,{to:"#d-overlay-anchor"},{default:()=>[t.createVNode(t.Transition,{name:"devui-overlay-fade"},W(o=t.renderSlot(n.slots,"default"))?o:{default:()=>[o]})]})}}}),H={visible:{type:Boolean},"onUpdate:visible":{type:Function},backgroundBlock:{type:Boolean,default:!1},backgroundClass:{type:String,default:""},backgroundStyle:{type:[String,Object]},backdropClick:{type:Function},backdropClose:{type:Boolean,default:!0}};function U(e){const n=t.computed(()=>["devui-overlay-background","devui-overlay-background__color",e.backgroundClass]),o=t.computed(()=>"devui-overlay"),i=l=>{var c,r;l.preventDefault(),(c=e.backdropClick)==null||c.call(e),e.backdropClose&&((r=e["onUpdate:visible"])==null||r.call(e,!1))},a=l=>l.cancelBubble=!0;return t.onMounted(()=>{const l=document.body,c=l.style.overflow,r=l.style.position;t.watch([()=>e.visible,()=>e.backgroundBlock],([f,m])=>{if(m){const s=l.getBoundingClientRect().y;f?(l.style.overflowY="scroll",l.style.position=f?"fixed":"",l.style.top=`${s}px`):(l.style.overflowY=c,l.style.position=r,l.style.top="",window.scrollTo(0,-s))}}),t.onUnmounted(()=>{document.body.style.overflow=c})}),{backgroundClass:n,overlayClass:o,handleBackdropClick:i,handleOverlayBubbleCancel:a}}const M=t.defineComponent({name:"DFixedOverlay",props:x(C({},H),{overlayStyle:{type:Object,default:void 0}}),setup(e,n){const{backgroundClass:o,overlayClass:i,handleBackdropClick:a,handleOverlayBubbleCancel:l}=U(e);return()=>t.createVNode(F,null,{default:()=>[t.withDirectives(t.createVNode("div",{class:o.value,style:e.backgroundStyle,onClick:a},[t.createVNode("div",{class:i.value,style:e.overlayStyle,onClick:l},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}}),X=t.defineComponent({name:"DFlexibleOverlay",props:C({origin:{type:Object,require:!0},position:{type:Object,default:()=>({originX:"left",originY:"top",overlayX:"left",overlayY:"top"})}},H),emits:["onUpdate:visible"],setup(e,n){const o=t.ref(null),i=t.reactive({position:"absolute"}),a=t.getCurrentInstance();t.onMounted(async()=>{await t.nextTick();const m=o.value;if(!m)return;const s=J(e.origin);if(!s)return;const u=h=>{const p=Q(e.position,h,s);i.left=`${p.x}px`,i.top=`${p.y}px`},b=()=>u(m.getBoundingClientRect());t.watch(t.toRef(e,"visible"),(h,p,V)=>{h?oe(b):z(b),V(()=>{z(b)})}),t.watch(t.toRef(e,"position"),()=>{b()});const y=new ResizeObserver(h=>{u(h[0].contentRect)});if(y.observe(m),t.onBeforeUnmount(()=>{y.disconnect()},a),s instanceof Element){const h=new MutationObserver(b);h.observe(s,{attributeFilter:["style"]}),t.onBeforeUnmount(()=>{h.disconnect()},a)}},a);const{backgroundClass:l,overlayClass:c,handleBackdropClick:r,handleOverlayBubbleCancel:f}=U(e);return()=>t.createVNode(F,null,{default:()=>[t.withDirectives(t.createVNode("div",{class:l.value,onClick:r},[t.createVNode("div",{ref:o,class:c.value,style:i,onClick:f},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}});function G(e){return e instanceof Element?e:e&&typeof e=="object"&&e.$el instanceof Element?e.$el:null}function J(e){return e instanceof Element?e:t.isRef(e)?G(e.value):e}function Q(e,n,o){const i=ee(o),a=ne(i,e);let l;return n instanceof HTMLElement?l=n.getBoundingClientRect():l=n,te(a,l,e)}function ee(e){if(e instanceof Element)return e.getBoundingClientRect();const n=e.width||0,o=e.height||0;return{top:e.y,bottom:e.y+o,left:e.x,right:e.x+n,height:o,width:n}}function te(e,n,o){let i;const{width:a,height:l}=n;o.overlayX=="center"?i=e.x-a/2:i=o.overlayX=="left"?e.x:e.x-a;let c;return o.overlayY=="center"?c=e.y-l/2:c=o.overlayY=="top"?e.y:e.y-l,{x:i,y:c}}function ne(e,n){let o;if(n.originX=="center")o=e.left+e.width/2;else{const a=e.left,l=e.right;o=n.originX=="left"?a:l}let i;return n.originY=="center"?i=e.top+e.height/2:i=n.originY=="top"?e.top:e.bottom,{x:o,y:i}}function oe(e){window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),window.addEventListener("orientationchange",e)}function z(e){window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}const le=typeof window!="undefined";X.install=function(e){e.component(X.name,X)},M.install=function(e){e.component(M.name,M)};var be="",S=t.defineComponent({name:"DModal",props:g,emits:["onUpdate:modelValue"],setup(e,n){const o=t.computed(()=>e.showAnimation?e.modelValue:!0),i=a=>{var c;const l=e["onUpdate:modelValue"];if(a)l==null||l(a);else{const r=e.beforeHidden,f=s=>{var u;s&&(l==null||l(!1),(u=e.onClose)==null||u.call(e))},m=(c=typeof r=="function"?r():r)!=null?c:!0;m instanceof Promise?m.then(f):f(m)}};return n.expose({onVisibleChange:i}),()=>t.createVNode(M,{visible:e.modelValue,"onUpdate:visible":i,backgroundClass:"devui-modal-wrapper",backgroundBlock:!e.bodyScrollable,backdropClose:e.backdropCloseable},{default:()=>[t.createVNode(t.Transition,{name:"devui-modal-wipe"},{default:()=>{var a,l;return[o.value?(l=(a=n.slots).default)==null?void 0:l.call(a):null]}})]})}});class T{constructor(n){this.anchorContainer=n}renderModal(n,o,i){const a=t.h(this.component(),o,i);return t.render(a,n),a}renderNull(n){setTimeout(()=>{t.render(null,n)},500)}}class Y extends T{component(){return S}open(n={}){const o=document.createElement("div");this.anchorContainer.appendChild(o);const f=n,{content:i}=f,a=L(f,["content"]),l=m=>{m||r()},c=(m,s=l)=>this.renderModal(o,x(C({},m),{modelValue:!0,"onUpdate:modelValue":s}),{default:i}),r=()=>{var s,u;(u=(s=c(a,b=>{b?c(a):(this.renderModal(o,x(C({},a),{modelValue:!1})),this.renderNull(o))}).component.exposed).onVisibleChange)==null||u.call(s,!1)};return this.renderModal(o,{modelValue:!1}),c(a),{hide:r}}}D(Y,"token","MODAL_SERVICE_TOKEN");const ae={width:{type:String,default:"300px"},maxHeight:{type:String},zIndex:{type:Number,default:1050},backdropZIndex:{type:Number,default:1049},placement:{type:String,default:"center"},offsetX:{type:String,default:"0px"},offsetY:{type:String,default:"0px"},title:{type:String},showAnimation:{type:Boolean,default:!0},backdropCloseable:{type:Boolean,default:!1},bodyScrollable:{type:Boolean,default:!0},escapeable:{type:Boolean,default:!0},onClose:{type:Function},beforeHidden:{type:[Promise,Function]},buttons:{type:Array,default:[]},dialogType:{type:String,default:"standard"},modelValue:{type:Boolean},"onUpdate:modelValue":{type:Function}},ie=(e=!0)=>{const n=t.ref(0),o=t.ref(0),i=()=>{n.value=0,o.value=0},a=t.ref(),l=t.ref(),c=t.isRef(e)?e:t.ref(e);return t.watch([l,a],([r,f],m,s)=>{if(!(f instanceof HTMLElement&&r instanceof HTMLElement))return;f.style.cursor="all-scroll";let u=0,b=0,y=0,h=0,p=r.getBoundingClientRect(),V=document.body.getBoundingClientRect(),B=!1;const N=w=>{if(w.preventDefault(),!c.value)return;u=w.clientX,b=w.clientY;const k=f.getBoundingClientRect();(f===w.target||f.contains(w.target))&&k.x<u&&k.y<b&&k.width+k.x>=u&&k.height+k.y>=b&&(B=!0,y=n.value,h=o.value,V=document.body.getBoundingClientRect(),p=r.getBoundingClientRect())},P=w=>{if(w.preventDefault(),!B)return;const k=y+w.clientX-u,ue=h+w.clientY-b,A=p.x-y,Z=p.y-h;n.value=j(k,-A,V.width-p.width-A),o.value=j(ue,-Z,V.height-p.height-Z)},_=w=>{w.preventDefault(),!!B&&(B=!1)};window.addEventListener("mousedown",N),window.addEventListener("mousemove",P),window.addEventListener("mouseup",_),s(()=>{window.removeEventListener("mousedown",N),window.removeEventListener("mousemove",P),window.removeEventListener("mouseup",_)})}),{movingX:t.readonly(n),movingY:t.readonly(o),handleRef:a,moveElRef:l,reset:i}},j=(e,n,o)=>e<n?n:e>o?o:e;var O=t.defineComponent({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){return C({},e)},render(){const{name:e,size:n,color:o,classPrefix:i}=this;return t.createVNode(t.Fragment,null,[/^((https?):)?\/\//.test(e)?t.createVNode("img",{src:e,alt:e.split("/")[e.split("/").length-1],style:{width:n}},null):t.createVNode("i",{class:`${i} ${i}-${e}`,style:{fontSize:n,color:o}},null)])}});O.install=function(e){e.component(O.name,O)};const re={type:{type:String,default:"button"},btnStyle:{type:String,default:"primary"},size:{type:String,default:"md"},position:{type:String,default:"default"},bordered:{type:Boolean,default:!1},icon:{type:String,default:""},showLoading:{type:Boolean,default:!1},width:{type:String},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},onClick:{type:Function}};var he="",E=t.defineComponent({name:"DButton",props:re,setup(e,n){const o=t.ref(null),i=r=>{var f;e.showLoading||(f=e.onClick)==null||f.call(e,r)},a=t.computed(()=>n.slots.default),l=t.computed(()=>{const{btnStyle:r,size:f,position:m,bordered:s,icon:u}=e,b=`devui-btn devui-btn-${r} devui-btn-${f} devui-btn-${m}`,y=s?"bordered":"",h=!!u&&!a.value&&r!=="primary"?"d-btn-icon":"";return`${b} ${y} ${h} ${u?"d-btn-icon-wrap":""}`}),c=t.computed(()=>{if(!e.icon)return;const r="devui-icon-fix icon";return a.value?`${r} clear-right-5`:r});return()=>{var b,y;const{icon:r,type:f,disabled:m,showLoading:s,width:u}=e;return t.createVNode("div",t.mergeProps({class:"devui-btn-host"},n.attrs),[t.createVNode("button",{class:l.value,type:f,disabled:m,style:{width:u},onClick:i},[r?t.createVNode(O,{name:e.icon,class:c.value},null):null,t.createVNode("span",{class:"button-content",ref:o},[(y=(b=n.slots).default)==null?void 0:y.call(b)])])])}}});E.install=function(e){e.component(E.name,E)};function de(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}var ce=t.defineComponent({name:"DModal",inheritAttrs:!1,props:ae,emits:["onUpdate:modelValue"],setup(e,n){const{movingX:o,movingY:i,handleRef:a,moveElRef:l,reset:c}=ie();t.watch(()=>e.modelValue,y=>{y&&c()});const r=t.computed(()=>({position:"relative",left:`${o.value}px`,top:`${i.value}px`})),f=t.computed(()=>({width:e.width,maxHeight:e.maxHeight,transform:`translate(${e.offsetX}, ${e.offsetY})`,zIndex:e.zIndex})),m=t.computed(()=>{switch(e.dialogType){case"standard":return"";case"info":return"icon-info-o";case"success":return"icon-right-o";case"warning":return"icon-warning-o";case"failed":return"icon-error-o";default:return""}}),s=t.computed(()=>e.buttons.map((y,h)=>{const{btnStyle:p,disabled:V,handler:B,text:N}=y;return t.createVNode(E,{key:h,style:{display:"inline-block",margin:"0 5px"},btnStyle:p,disabled:V,onClick:B},de(N)?N:{default:()=>[N]})})),u=t.ref(),b=()=>{var y,h;(h=(y=u.value)==null?void 0:y.onVisibleChange)==null||h.call(y,!1)};return n.expose({closeModal:b}),()=>t.createVNode(S,{ref:u,width:e.width,maxHeight:e.maxHeight,offsetX:e.offsetX,offsetY:e.offsetY,zIndex:e.zIndex,backdropZIndex:e.backdropZIndex,backdropCloseable:e.backdropCloseable,bodyScrollable:e.bodyScrollable,placement:e.placement,onClose:e.onClose,beforeHidden:e.beforeHidden,modelValue:e.modelValue,"onUpdate:modelValue":e["onUpdate:modelValue"]},{default:()=>{var y,h;return[t.createVNode("div",{class:"devui-modal-content",style:[f.value,r.value],ref:l},[t.createVNode("div",{class:"devui-modal-header",ref:a},[m.value?t.createVNode(O,{name:m.value,size:"24px",class:"header-alert-icon"},null):null,t.createVNode("span",null,[e.title]),t.createVNode(E,{class:"btn-close",icon:"close",btnStyle:"text-dark",onClick:b},null)]),t.createVNode("div",{class:"devui-modal-body"},[(h=(y=n.slots).default)==null?void 0:h.call(y)]),t.createVNode("div",{class:"devui-modal-footer"},[s.value])])]}})}});class $ extends T{component(){return ce}open(n={}){const o=document.createElement("div");this.anchorContainer.appendChild(o);const m=n,{content:i}=m,a=L(m,["content"]),l=s=>{s||r()},c=(s,u=l)=>this.renderModal(o,x(C({},s),{modelValue:!0,"onUpdate:modelValue":u}),{default:i}),r=()=>{var u,b;(b=(u=c(a,y=>{y?c(a):(this.renderModal(o,x(C({},a),{modelValue:!1})),this.renderNull(o))}).component.exposed).closeModal)==null||b.call(u)},f=s=>{const h=a,{buttons:u}=h,b=L(h,["buttons"]),y=u.map((p,V)=>C(C({},p),s[V]));c(x(C({},b),{buttons:y}))};return this.renderModal(o,{modelValue:!1}),c(a),{hide:r,updateButtonOptions:f}}}D($,"token","DIALOG_SERVICE_TOKEN"),S.install=function(e){e.component(S.name,S)};var se={title:"Modal \u5F39\u7A97",category:"\u53CD\u9988",status:"\u5DF2\u5B8C\u6210",install(e){if(e.use(S),!le)return;let n=document.getElementById("d-modal-anchors-container");n||(n=document.createElement("div"),n.setAttribute("id","d-modal-anchors-container"),document.body.appendChild(n)),e.provide(Y.token,new Y(n)),e.provide($.token,new $(n))}};d.Modal=S,d.default=se,Object.defineProperty(d,"__esModule",{value:!0}),d[Symbol.toStringTag]="Module"});
|
|
1
|
+
(function(h,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],t):(h=typeof globalThis!="undefined"?globalThis:h||self,t(h.index={},h.Vue,h.dom))})(this,function(h,t,g){"use strict";const k={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},beforeClose:{type:Function},escapable:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!0}},M={name:{type:String,default:"",required:!0},size:{type:[Number,String],default:"inherit"},color:{type:String,default:"inherit"},component:{type:Object,default:null},classPrefix:{type:String,default:"icon"},operable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rotate:{type:[Number,String]}},P={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};function C(n,e,o){let l=n;return e&&(l+=`__${e}`),o&&(l+=`--${o}`),l}function v(n,e=!1){const o=e?`.devui-${n}`:`devui-${n}`;return{b:()=>C(o),e:r=>r?C(o,r):"",m:r=>r?C(o,"",r):"",em:(r,d)=>r&&d?C(o,r,d):""}}var Q="",T=t.defineComponent({name:"DSvgIcon",props:P,setup(n){const{name:e,color:o,size:l}=t.toRefs(n),a=v("svg-icon"),s=t.computed(()=>`#icon-${e.value}`),i=t.computed(()=>typeof l.value=="number"?`${l.value}px`:l.value),r={width:i.value,height:i.value};return()=>t.createVNode("svg",{class:a.b(),style:r},[t.createVNode("use",{"xlink:href":s.value,fill:o.value},null)])}});function I(n){return/^((http|https):)?\/\//.test(n)}function $(n,e){const{component:o,name:l,size:a,color:s,classPrefix:i,rotate:r}=t.toRefs(n),d=v("icon"),c=t.computed(()=>typeof a.value=="number"?`${a.value}px`:a.value),u=o.value?t.resolveDynamicComponent(o.value):t.resolveDynamicComponent(T),f=()=>t.createVNode("img",t.mergeProps({src:l.value,alt:l.value.split("/")[l.value.split("/").length-1],class:[(r==null?void 0:r.value)==="infinite"&&d.m("spin")],style:{width:c.value||"",transform:`rotate(${r==null?void 0:r.value}deg)`,verticalAlign:"middle"}},e.attrs),null),m=()=>t.createVNode(u,t.mergeProps({name:l.value,color:s.value,size:c.value,class:[(r==null?void 0:r.value)==="infinite"&&d.m("spin")],style:{transform:`rotate(${r==null?void 0:r.value}deg)`}},e.attrs),null),y=()=>{const w=/^icon-/.test(l.value)?l.value:`${i.value}-${l.value}`;return t.createVNode("i",t.mergeProps({class:[i.value,w,(r==null?void 0:r.value)==="infinite"&&d.m("spin")],style:{fontSize:c.value,color:s.value,transform:`rotate(${r==null?void 0:r.value}deg)`}},e.attrs),null)};return{iconDom:()=>o.value?m():I(l.value)?f():y()}}var z=t.defineComponent({name:"DIcon",props:M,emits:["click"],setup(n,e){const{disabled:o,operable:l}=t.toRefs(n),{iconDom:a}=$(n,e),s=v("icon"),i=t.computed(()=>({[s.e("container")]:!0,[s.m("disabled")]:o.value,[s.m("operable")]:l.value})),r=d=>{o.value||e.emit("click",d)};return()=>{var d,c,u,f;return t.createVNode("div",{class:i.value,onClick:r},[(c=(d=e.slots).prefix)==null?void 0:c.call(d),a(),(f=(u=e.slots).suffix)==null?void 0:f.call(u)])}}}),W="";t.defineComponent({name:"DIconGroup",setup(n,e){const o=v("icon-group");return()=>{var l,a;return t.createVNode("div",{class:o.b()},[(a=(l=e.slots).default)==null?void 0:a.call(l)])}}});const R={modelValue:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}};function B(){if(document.documentElement.scrollHeight>document.documentElement.clientHeight){const n=document.documentElement.scrollTop,e=document.documentElement.getAttribute("style");return document.documentElement.style.position="fixed",document.documentElement.style.top=`-${n}px`,document.documentElement.style.width=document.documentElement.style.width||"100%",document.documentElement.style.overflowY="scroll",()=>{e?document.documentElement.setAttribute("style",e):document.documentElement.removeAttribute("style"),document.documentElement.scrollTop=n}}}function L(n,e){let o;const l=s=>{s.preventDefault(),e.emit("click",s),n.closeOnClickOverlay&&e.emit("update:modelValue",!1)},a=()=>{o==null||o()};return t.watch(()=>n.modelValue,s=>{s?n.lockScroll&&(o=B()):a()}),t.onUnmounted(a),{onClick:l}}var Z="";const F=t.defineComponent({name:"DFixedOverlay",inheritAttrs:!1,props:R,emits:["update:modelValue","click"],setup(n,e){const{modelValue:o}=t.toRefs(n),l=v("fixed-overlay"),{onClick:a}=L(n,e);return()=>t.createVNode(t.Transition,{name:l.m("fade")},{default:()=>{var s,i;return[o.value&&t.createVNode("div",t.mergeProps({class:l.b()},e.attrs,{onClick:a}),[(i=(s=e.slots).default)==null?void 0:i.call(s)])]}})}}),U={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},shiftOffset:{type:Number},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function _(n){const e=/(auto|scroll|hidden)/;for(let o=n;o=o.parentElement;o.parentElement!==document.body){const l=window.getComputedStyle(o);if(e.test(l.overflow+l.overflowX+l.overflowY))return o}return window}function j(n,e,o,l){let{x:a,y:s}=e;if(!n){const{width:i,height:r}=l;a&&o.includes("start")&&(a=12),a&&o.includes("end")&&(a=Math.round(i-24)),s&&o.includes("start")&&(s=10),s&&o.includes("end")&&(s=r-14)}return{x:a,y:s}}function H(n,e){const o=t.ref(),l=t.ref();let a=null;const s=(r,d,c,u)=>{const{x:f,y:m}=j(n.isArrowCenter,c,d,u.getBoundingClientRect()),y={top:"bottom",right:"left",bottom:"top",left:"right"}[d.split("-")[0]];Object.assign(r.style,{left:f?`${f}px`:"",top:m?`${m}px`:"",right:"",bottom:"",[y]:"-4px"})},i=async()=>{const r=n.origin,d=t.unref(o.value),c=t.unref(l.value),u=[g.offset(n.offset),g.autoPlacement({alignment:n.align,allowedPlacements:n.position})];n.showArrow&&u.push(g.arrow({element:c})),n.shiftOffset!==void 0&&u.push(g.shift());const{x:f,y:m,placement:y,middlewareData:p}=await g.computePosition(r,d,{strategy:"fixed",middleware:u});let w=f,x=m;if(n.shiftOffset!==void 0){const{x:D,y:A}=p.shift;D<0&&(w-=n.shiftOffset),D>0&&(w+=n.shiftOffset),A<0&&(x-=n.shiftOffset),A>0&&(x+=n.shiftOffset)}e("positionChange",y),Object.assign(d.style,{top:`${x}px`,left:`${w}px`}),n.showArrow&&s(c,y,p.arrow,d)};return t.watch(()=>n.modelValue,()=>{n.modelValue&&n.origin?(a=_(n.origin),t.nextTick(i),a==null||a.addEventListener("scroll",i),a!==window&&window.addEventListener("scroll",i),window.addEventListener("resize",i)):(a==null||a.removeEventListener("scroll",i),a!==window&&window.removeEventListener("scroll",i),window.removeEventListener("resize",i))}),t.onUnmounted(()=>{a==null||a.removeEventListener("scroll",i),a!==window&&window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}),{arrowRef:l,overlayRef:o,updatePosition:i}}var ee="";t.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:U,emits:["update:modelValue","positionChange"],setup(n,{slots:e,attrs:o,emit:l,expose:a}){const s=v("flexible-overlay"),{arrowRef:i,overlayRef:r,updatePosition:d}=H(n,l);return a({updatePosition:d}),()=>{var c;return n.modelValue&&t.createVNode("div",t.mergeProps({ref:r,class:s.b()},o),[(c=e.default)==null?void 0:c.call(e),n.showArrow&&t.createVNode("div",{ref:i,class:s.e("arrow")},null)])}}});const q=typeof window!="undefined";function X(n,e){function o(){e("update:modelValue",!1)}function l(){n.beforeClose?n.beforeClose(o):o()}function a(){n.closeOnClickOverlay&&l()}function s(){l()}function i(r){r.keyCode===27&&l()}return t.onMounted(()=>{n.escapable&&window.addEventListener("keydown",i)}),t.onUnmounted(()=>{n.escapable&&window.addEventListener("keydown",i)}),{onCloseBtnClick:s,onOverlayClick:a}}function Y(n){const e=t.ref(!1),o=t.ref(!1);let l;const a=()=>{l==null||l()};return t.watch(()=>n.modelValue,s=>{s?(n.lockScroll&&(l=B()),e.value=!0,t.nextTick(()=>{o.value=!0})):(a(),o.value=!1,setTimeout(()=>{e.value=!1},100))},{immediate:!0}),t.onUnmounted(a),{showContainer:e,showModal:o}}var O=t.defineComponent({name:"DModalHeader",setup(n,{slots:e}){const o=v("modal");return()=>{var l;return t.createVNode("div",{class:o.e("header")},[(l=e.default)==null?void 0:l.call(e)])}}}),E=t.defineComponent({name:"DModalBody",setup(n,{slots:e}){const o=v("modal");return()=>{var l;return t.createVNode("div",{class:o.e("body")},[(l=e.default)==null?void 0:l.call(e)])}}}),te="",b=t.defineComponent({name:"DModal",inheritAttrs:!1,props:k,emits:["update:modelValue"],setup(n,{slots:e,attrs:o,emit:l}){const a=v("modal"),{modelValue:s,title:i,showClose:r,showOverlay:d,appendToBody:c}=t.toRefs(n),{onCloseBtnClick:u,onOverlayClick:f}=X(n,l),{showContainer:m,showModal:y}=Y(n);return()=>t.createVNode(t.Teleport,{to:"body",disabled:!c.value},{default:()=>[d.value&&t.createVNode(F,{modelValue:s.value,"onUpdate:modelValue":p=>s.value=p,"lock-scroll":!1,style:{zIndex:"calc(var(--devui-z-index-modal, 1050) - 1)"}},null),m.value&&t.createVNode("div",{class:a.e("container"),onClick:f},[t.createVNode(t.Transition,{name:a.m("wipe")},{default:()=>{var p;return[y.value&&t.createVNode("div",t.mergeProps({class:a.b()},o,{onClick:w=>w.stopPropagation()}),[r.value&&t.createVNode(z,{name:"close",class:"btn-close",size:"var(--devui-font-size-md,12px)",onClick:u},null),e.header?e.header():i.value&&t.createVNode(O,null,{default:()=>[i.value]}),t.createVNode(E,null,{default:()=>{var w;return[(w=e.default)==null?void 0:w.call(e)]}}),(p=e.footer)==null?void 0:p.call(e)])]}})])]})}}),S=t.defineComponent({name:"DModalFooter",setup(n,{slots:e}){const o=v("modal");return()=>{var l;return t.createVNode("div",{class:o.e("footer")},[(l=e.default)==null?void 0:l.call(e)])}}});class G{constructor(e){this.anchorContainer=e}renderModal(e,o,l){const a=t.h(this.component(),o,l);return t.render(a,e),a}renderNull(e){setTimeout(()=>{t.render(null,e)},500)}}let V;class N extends G{component(){return b}open(e={}){const o=document.createElement("div");this.anchorContainer.appendChild(o);const{header:l,content:a,footer:s,...i}=e,r=(u,f)=>this.renderModal(o,{...u,modelValue:!0,"onUpdate:modelValue":f},{header:l,default:a,footer:s}),d=()=>{var f,m,y;const u=p=>{p||d()};r(i,p=>{p?r(i,u):(this.renderModal(o,{...i,modelValue:!1}),this.renderNull(o))}),(y=(m=(f=V==null?void 0:V.component)==null?void 0:f.exposed)==null?void 0:m.handleVisibleChange)==null||y.call(m,!1)},c=u=>{u||d()};return this.renderModal(o,{modelValue:!1}),V=r(i,c),{hide:d}}}N.token="MODAL_SERVICE_TOKEN";var K={title:"Modal \u5F39\u7A97",category:"\u53CD\u9988",status:"100%",install(n){if(n.component(b.name,b),n.component(O.name,O),n.component(E.name,E),n.component(S.name,S),!q)return;let e=document.getElementById("d-modal-anchors-container");e||(e=document.createElement("div"),e.setAttribute("id","d-modal-anchors-container"),document.body.appendChild(e)),n.provide(N.token,new N(e))}};h.Modal=b,h.default=K,h.modalProps=k,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/modal/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-
|
|
1
|
+
.devui-icon__container{display:inline-block;color:var(--devui-icon-fill, #71757f)}.devui-icon__container>*:not(:last-child){vertical-align:middle;margin-right:8px}.devui-icon__container i{vertical-align:middle;transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--disabled{color:var(--devui-disabled-text, #adb0b8);cursor:not-allowed}.devui-icon--disabled i{color:var(--devui-disabled-text, #adb0b8)}.devui-icon--operable:not(.devui-icon--disabled){cursor:pointer;transition:color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--operable:not(.devui-icon--disabled) i{cursor:pointer}.devui-icon--operable:hover:not(.devui-icon--disabled){color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:hover:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-hover, var(--devui-list-item-hover-bg, #f2f2f3))}.devui-icon--operable:hover:not(.devui-icon--disabled) i{color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:active:not(.devui-icon--disabled){color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable:active:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-active, var(--devui-list-item-active-bg, #f2f5fc))}.devui-icon--operable:active:not(.devui-icon--disabled) i{color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable.devui-icon__container{height:32px;line-height:32px;padding:0 8px;margin-left:-8px;border-radius:var(--devui-border-radius, 4px);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--spin{animation:iconSpin 2.5s linear infinite}.devui-svg-icon{vertical-align:middle}@keyframes iconSpin{0%{transform:rotate(0)}50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}.devui-icon-group{display:inline-flex;align-items:center}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable){padding:8px;margin-left:0}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable):first-child{margin-left:-8px}.devui-icon-group>*:not(:first-child){margin-left:0}.devui-fixed-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--devui-shadow, rgba(37, 43, 58, .2));z-index:1050}.devui-fixed-overlay--fade-enter-active,.devui-fixed-overlay--fade-leave-active{transition:opacity .1s cubic-bezier(0,0,1,1)}.devui-fixed-overlay--fade-enter-from,.devui-fixed-overlay--fade-leave-to{opacity:0}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 4px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-length-connected-overlay, 0 4px 8px 0) var(--devui-shadow, rgba(37, 43, 58, .2));z-index:1000}.devui-flexible-overlay__arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}.devui-modal__container{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--devui-z-index-modal, 1050);outline:0;overflow-y:auto;display:flex;flex-direction:column}.devui-modal{position:relative;width:300px;margin:auto;border-radius:var(--devui-border-radius, 4px);border:none;opacity:1;transform:translateY(0);background-color:var(--devui-fullscreen-overlay-bg, #ffffff);background-clip:padding-box;outline:0;box-shadow:var(--devui-shadow-length-fullscreen-overlay, 0 12px 24px 0) var(--devui-shadow, rgba(37, 43, 58, .2))}.devui-modal .btn-close{position:absolute;right:16px;top:16px;width:20px;height:20px;line-height:20px;text-align:center;color:#000;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.devui-modal .btn-close:hover{color:var(--devui-icon-fill-active-hover, #252b3a);background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.devui-modal .btn-close i{position:absolute;right:0;top:0}.devui-modal-content{background:var(--devui-fullscreen-overlay-bg, #ffffff);border-radius:var(--devui-border-radius, 4px)}.devui-modal__header{width:100%;height:56px;padding:32px 32px 0;font-size:var(--devui-font-size-card-title, 16px);font-weight:700;box-sizing:border-box;border:none;user-select:none}.devui-modal__header .header-alert-icon{display:inline-block;vertical-align:middle;margin-right:8px;line-height:16px;text-align:center}.devui-modal__body{padding:20px 32px;font-size:var(--devui-font-size, 14px);color:var(--devui-text-weak, #575d6c);box-sizing:border-box}.devui-modal__footer{width:100%;border-top:none;text-align:center;padding:0 32px 24px;box-sizing:border-box}.devui-modal__footer>*{margin:0 4px}.devui-modal--wipe-enter-active{transition:opacity .1s cubic-bezier(.16,.75,.5,1),transform .1s cubic-bezier(0,0,1,1)}.devui-modal--wipe-leave-active{transition:opacity .1s cubic-bezier(.5,0,.84,.25),transform .1s cubic-bezier(0,0,1,1)}.devui-modal--wipe-enter-from,.devui-modal--wipe-leave-to{opacity:.2;transform:translateY(-24px)}
|
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
import { defineComponent, toRefs, computed, createVNode, resolveDynamicComponent, mergeProps, watch, Transition, reactive, createApp, onUnmounted, isVNode } 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
|
+
var index = {
|
|
520
|
+
title: "Notification \u5168\u5C40\u901A\u77E5",
|
|
521
|
+
category: "\u53CD\u9988",
|
|
522
|
+
status: "100%",
|
|
523
|
+
install(app) {
|
|
524
|
+
app.component(Notification.name, Notification);
|
|
525
|
+
app.config.globalProperties.$notificationService = NotificationService;
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
export { Notification, NotificationService, index as default, notificationProps };
|