vue-devui 1.0.0-beta.2 → 1.0.0-beta.220801
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 +9044 -0
- package/auto-complete/index.umd.js +29 -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 +5927 -131
- 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 +8082 -232
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/collapse/index.d.ts +7 -0
- package/collapse/index.es.js +213 -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 +12018 -0
- package/date-picker-pro/index.umd.js +27 -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 +203 -139
- 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 +754 -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 +912 -442
- 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 +2415 -1985
- package/form/index.umd.js +18 -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 +284 -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 +142 -39
- 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 +8255 -145
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +270 -186
- 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 +77 -38
- 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 +8310 -0
- package/mention/index.umd.js +36 -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 +870 -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 +538 -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 +607 -841
- 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 +545 -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 +7976 -159
- package/radio/index.umd.js +27 -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 +51 -43
- package/ripple/index.umd.js +1 -1
- package/search/index.d.ts +7 -0
- package/search/index.es.js +8411 -450
- package/search/index.umd.js +27 -1
- package/search/style.css +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +9295 -561
- package/select/index.umd.js +27 -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 +6301 -167
- 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 +274 -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 +7805 -65
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +11423 -207
- package/table/index.umd.js +27 -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 +7973 -0
- package/textarea/index.umd.js +35 -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 +9101 -581
- package/time-picker/index.umd.js +27 -1
- package/time-picker/style.css +1 -1
- package/time-select/index.d.ts +7 -0
- package/time-select/index.es.js +9585 -0
- package/time-select/index.umd.js +27 -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 +11438 -654
- package/tree/index.umd.js +27 -1
- package/tree/style.css +1 -1
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +981 -2719
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +22794 -16605
- package/vue-devui.umd.js +31 -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
|
@@ -17,528 +17,998 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
var __publicField = (obj, key, value) => {
|
|
21
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
import { defineComponent, ref, createVNode, h, render, computed, nextTick, unref, watch, onUnmounted, mergeProps, reactive, getCurrentInstance, withDirectives, withModifiers, resolveComponent, Teleport, Transition, vShow, resolveDirective } from "vue";
|
|
25
|
+
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
22
26
|
const editableSelectProps = {
|
|
23
|
-
|
|
24
|
-
type:
|
|
25
|
-
default:
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ""
|
|
30
|
+
},
|
|
31
|
+
options: {
|
|
32
|
+
type: Array,
|
|
33
|
+
default: () => []
|
|
26
34
|
},
|
|
27
|
-
|
|
35
|
+
allowClear: {
|
|
28
36
|
type: Boolean,
|
|
29
|
-
default:
|
|
37
|
+
default: false
|
|
38
|
+
},
|
|
39
|
+
disabled: {
|
|
40
|
+
type: Boolean
|
|
41
|
+
},
|
|
42
|
+
disabledKey: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: ""
|
|
45
|
+
},
|
|
46
|
+
placeholder: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: "Search"
|
|
49
|
+
},
|
|
50
|
+
width: {
|
|
51
|
+
type: Number
|
|
30
52
|
},
|
|
31
53
|
maxHeight: {
|
|
32
|
-
type: Number
|
|
33
|
-
default: 300
|
|
54
|
+
type: Number
|
|
34
55
|
},
|
|
35
|
-
|
|
56
|
+
loading: {
|
|
57
|
+
type: Boolean
|
|
58
|
+
},
|
|
59
|
+
enableLazyLoad: {
|
|
36
60
|
type: Boolean,
|
|
37
61
|
default: false
|
|
38
62
|
},
|
|
39
|
-
|
|
40
|
-
type: [String, Number, Array]
|
|
41
|
-
},
|
|
42
|
-
"onUpdate:modelValue": {
|
|
63
|
+
searchFn: {
|
|
43
64
|
type: Function
|
|
65
|
+
},
|
|
66
|
+
filterOption: {
|
|
67
|
+
type: [Function, Boolean]
|
|
44
68
|
}
|
|
45
69
|
};
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
type: String,
|
|
52
|
-
required: true
|
|
53
|
-
},
|
|
54
|
-
size: {
|
|
55
|
-
type: String,
|
|
56
|
-
default: "inherit"
|
|
57
|
-
},
|
|
58
|
-
color: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: "inherit"
|
|
61
|
-
},
|
|
62
|
-
classPrefix: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: "icon"
|
|
70
|
+
const inBrowser = typeof window !== "undefined";
|
|
71
|
+
function on(element, eventName, handler) {
|
|
72
|
+
if (document.addEventListener) {
|
|
73
|
+
if (element && eventName && handler) {
|
|
74
|
+
element.addEventListener(eventName, handler, false);
|
|
65
75
|
}
|
|
76
|
+
} else {
|
|
77
|
+
if (element && eventName && handler) {
|
|
78
|
+
element.attachEvent("on" + eventName, handler);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const ctx = Symbol("@@clickoutside");
|
|
83
|
+
const nodeList = /* @__PURE__ */ new Map();
|
|
84
|
+
let startClick;
|
|
85
|
+
let nid = 0;
|
|
86
|
+
let isFirst = true;
|
|
87
|
+
function createDocumentHandler(el, binding, vnode) {
|
|
88
|
+
if (inBrowser && isFirst) {
|
|
89
|
+
isFirst = false;
|
|
90
|
+
on(document, "mousedown", (e) => {
|
|
91
|
+
startClick = e;
|
|
92
|
+
});
|
|
93
|
+
on(document, "mouseup", (e) => {
|
|
94
|
+
for (const [id, node] of nodeList) {
|
|
95
|
+
node[ctx].documentHandler(e, startClick);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return function(mouseup, mousedown) {
|
|
100
|
+
if (!vnode || !binding.instance || !mouseup.target || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
el[ctx].bindingFn && el[ctx].bindingFn();
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
const clickoutsideDirective = {
|
|
107
|
+
beforeMount: function(el, binding, vnode) {
|
|
108
|
+
nid++;
|
|
109
|
+
nodeList.set(nid, el);
|
|
110
|
+
el[ctx] = {
|
|
111
|
+
nid,
|
|
112
|
+
documentHandler: createDocumentHandler(el, binding, vnode),
|
|
113
|
+
bindingFn: binding.value
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
updated: function(el, binding, vnode) {
|
|
117
|
+
el[ctx].documentHandler = createDocumentHandler(el, binding, vnode);
|
|
118
|
+
el[ctx].bindingFn = binding.value;
|
|
119
|
+
},
|
|
120
|
+
unmounted: function(el) {
|
|
121
|
+
nodeList.delete(el[ctx].nid);
|
|
122
|
+
delete el[ctx];
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
class View {
|
|
126
|
+
constructor() {
|
|
127
|
+
__publicField(this, "top", "50%");
|
|
128
|
+
__publicField(this, "left", "50%");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const loadingProps = {
|
|
132
|
+
message: String,
|
|
133
|
+
backdrop: Boolean,
|
|
134
|
+
view: {
|
|
135
|
+
type: Object,
|
|
136
|
+
default: () => new View()
|
|
66
137
|
},
|
|
138
|
+
zIndex: Number,
|
|
139
|
+
isFull: {
|
|
140
|
+
type: Boolean,
|
|
141
|
+
default: false
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
class LoadingOptions {
|
|
145
|
+
constructor() {
|
|
146
|
+
__publicField(this, "target");
|
|
147
|
+
__publicField(this, "message");
|
|
148
|
+
__publicField(this, "loadingTemplateRef");
|
|
149
|
+
__publicField(this, "backdrop", true);
|
|
150
|
+
__publicField(this, "positionType", "relative");
|
|
151
|
+
__publicField(this, "view", new View());
|
|
152
|
+
__publicField(this, "zIndex");
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function createBem(namespace, element, modifier) {
|
|
156
|
+
let cls = namespace;
|
|
157
|
+
if (element) {
|
|
158
|
+
cls += `__${element}`;
|
|
159
|
+
}
|
|
160
|
+
if (modifier) {
|
|
161
|
+
cls += `--${modifier}`;
|
|
162
|
+
}
|
|
163
|
+
return cls;
|
|
164
|
+
}
|
|
165
|
+
function useNamespace(block, needDot = false) {
|
|
166
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
167
|
+
const b = () => createBem(namespace);
|
|
168
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
169
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
170
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
171
|
+
return {
|
|
172
|
+
b,
|
|
173
|
+
e,
|
|
174
|
+
m,
|
|
175
|
+
em
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
var loading = "";
|
|
179
|
+
var Loading = defineComponent({
|
|
180
|
+
name: "DLoading",
|
|
181
|
+
inheritAttrs: false,
|
|
182
|
+
props: loadingProps,
|
|
67
183
|
setup(props) {
|
|
68
|
-
|
|
184
|
+
const style = {
|
|
185
|
+
top: props.view.top,
|
|
186
|
+
left: props.view.left,
|
|
187
|
+
zIndex: props.zIndex
|
|
188
|
+
};
|
|
189
|
+
if (!props.message) {
|
|
190
|
+
style.background = "none";
|
|
191
|
+
}
|
|
192
|
+
const isShow = ref(false);
|
|
193
|
+
const open = () => {
|
|
194
|
+
isShow.value = true;
|
|
195
|
+
};
|
|
196
|
+
const close = () => {
|
|
197
|
+
isShow.value = false;
|
|
198
|
+
};
|
|
199
|
+
return {
|
|
200
|
+
style,
|
|
201
|
+
isShow,
|
|
202
|
+
open,
|
|
203
|
+
close
|
|
204
|
+
};
|
|
69
205
|
},
|
|
70
206
|
render() {
|
|
207
|
+
var _a;
|
|
71
208
|
const {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
209
|
+
isShow,
|
|
210
|
+
isFull,
|
|
211
|
+
backdrop,
|
|
212
|
+
style,
|
|
213
|
+
message,
|
|
214
|
+
$slots
|
|
76
215
|
} = this;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"style":
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
},
|
|
216
|
+
const ns = useNamespace("loading");
|
|
217
|
+
return isShow && createVNode("div", {
|
|
218
|
+
"class": [ns.b(), isFull ? ns.m("full") : ""]
|
|
219
|
+
}, [((_a = $slots.default) == null ? void 0 : _a.call($slots)) || createVNode("div", {
|
|
220
|
+
"class": ns.e("wrapper")
|
|
221
|
+
}, [backdrop ? createVNode("div", {
|
|
222
|
+
"class": ns.e("mask")
|
|
223
|
+
}, null) : null, createVNode("div", {
|
|
224
|
+
"style": style,
|
|
225
|
+
"class": ns.e("area")
|
|
226
|
+
}, [createVNode("div", {
|
|
227
|
+
"class": ns.e("busy-default-spinner")
|
|
228
|
+
}, [createVNode("div", {
|
|
229
|
+
"class": ns.e("bar1")
|
|
230
|
+
}, null), createVNode("div", {
|
|
231
|
+
"class": ns.e("bar2")
|
|
232
|
+
}, null), createVNode("div", {
|
|
233
|
+
"class": ns.e("bar3")
|
|
234
|
+
}, null), createVNode("div", {
|
|
235
|
+
"class": ns.e("bar4")
|
|
236
|
+
}, null)]), message ? createVNode("span", {
|
|
237
|
+
"class": ns.e("text")
|
|
238
|
+
}, [message]) : null])])]);
|
|
90
239
|
}
|
|
91
240
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
241
|
+
const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
|
|
242
|
+
function createComponent(component, props, children = null) {
|
|
243
|
+
const vnode = h(component, __spreadValues({}, props), children);
|
|
244
|
+
const container = document.createElement("div");
|
|
245
|
+
vnode[COMPONENT_CONTAINER_SYMBOL] = container;
|
|
246
|
+
render(vnode, container);
|
|
247
|
+
return vnode.component;
|
|
98
248
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
249
|
+
function unmountComponent(ComponnetInstance) {
|
|
250
|
+
render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
|
|
251
|
+
}
|
|
252
|
+
const loadingConstructor = defineComponent(Loading);
|
|
253
|
+
const cacheInstance = /* @__PURE__ */ new WeakSet();
|
|
254
|
+
const isEmpty = (val) => {
|
|
255
|
+
if (!val) {
|
|
256
|
+
return true;
|
|
257
|
+
}
|
|
258
|
+
if (Array.isArray(val)) {
|
|
259
|
+
return val.length === 0;
|
|
260
|
+
}
|
|
261
|
+
if (val instanceof Set || val instanceof Map) {
|
|
262
|
+
return val.size === 0;
|
|
263
|
+
}
|
|
264
|
+
if (val instanceof Promise) {
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
if (typeof val === "object") {
|
|
268
|
+
try {
|
|
269
|
+
return Object.keys(val).length === 0;
|
|
270
|
+
} catch (e) {
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return false;
|
|
275
|
+
};
|
|
276
|
+
const getType = (vari) => {
|
|
277
|
+
return Object.prototype.toString.call(vari).slice(8, -1).toLowerCase();
|
|
278
|
+
};
|
|
279
|
+
const isPromise = (value) => {
|
|
280
|
+
const type = getType(value);
|
|
281
|
+
switch (type) {
|
|
282
|
+
case "promise":
|
|
283
|
+
return [value];
|
|
284
|
+
case "array":
|
|
285
|
+
if (value.some((val) => getType(val) !== "promise")) {
|
|
286
|
+
console.error(new TypeError("Binding values should all be of type Promise"));
|
|
287
|
+
return "error";
|
|
288
|
+
}
|
|
289
|
+
return value;
|
|
290
|
+
default:
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
const unmount = (el) => {
|
|
295
|
+
cacheInstance.delete(el);
|
|
296
|
+
el.instance.proxy.close();
|
|
297
|
+
unmountComponent(el.instance);
|
|
298
|
+
};
|
|
299
|
+
const toggleLoading = (el, binding) => {
|
|
300
|
+
var _a, _b, _c;
|
|
301
|
+
if (binding.value) {
|
|
302
|
+
const vals = isPromise(binding.value);
|
|
303
|
+
if (vals === "error") {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
(_c = (_b = (_a = el == null ? void 0 : el.instance) == null ? void 0 : _a.proxy) == null ? void 0 : _b.open) == null ? void 0 : _c.call(_b);
|
|
307
|
+
el.appendChild(el.mask);
|
|
308
|
+
cacheInstance.add(el);
|
|
309
|
+
if (vals) {
|
|
310
|
+
Promise.all(vals).catch((err) => {
|
|
311
|
+
console.error(new Error("Promise handling errors"), err);
|
|
312
|
+
}).finally(() => {
|
|
313
|
+
unmount(el);
|
|
111
314
|
});
|
|
112
|
-
}
|
|
315
|
+
}
|
|
316
|
+
} else {
|
|
317
|
+
unmount(el);
|
|
113
318
|
}
|
|
114
|
-
}
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
"
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
319
|
+
};
|
|
320
|
+
const removeAttribute = (el) => {
|
|
321
|
+
el.removeAttribute("zindex");
|
|
322
|
+
el.removeAttribute("positiontype");
|
|
323
|
+
el.removeAttribute("backdrop");
|
|
324
|
+
el.removeAttribute("message");
|
|
325
|
+
el.removeAttribute("view");
|
|
326
|
+
el.removeAttribute("loadingtemplateref");
|
|
327
|
+
};
|
|
328
|
+
const handleProps = (el, vprops) => {
|
|
329
|
+
var _a;
|
|
330
|
+
const props = __spreadValues(__spreadValues({}, new LoadingOptions()), vprops);
|
|
331
|
+
const loadingTemplateRef = props.loadingTemplateRef;
|
|
332
|
+
const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
|
|
333
|
+
el.style.position = props.positionType;
|
|
334
|
+
el.options = props;
|
|
335
|
+
el.instance = loadingInstance;
|
|
336
|
+
el.mask = (_a = loadingInstance == null ? void 0 : loadingInstance.proxy) == null ? void 0 : _a.$el;
|
|
337
|
+
};
|
|
338
|
+
const loadingDirective = {
|
|
339
|
+
mounted: function(el, binding, vnode) {
|
|
340
|
+
handleProps(el, vnode.props);
|
|
341
|
+
removeAttribute(el);
|
|
342
|
+
!isEmpty(binding.value) && toggleLoading(el, binding);
|
|
135
343
|
},
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
344
|
+
updated: function(el, binding, vnode) {
|
|
345
|
+
if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el)) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
!cacheInstance.has(el) && handleProps(el, vnode.props);
|
|
349
|
+
removeAttribute(el);
|
|
350
|
+
toggleLoading(el, binding);
|
|
139
351
|
}
|
|
140
352
|
};
|
|
141
|
-
function
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
body.style.overflowY = "scroll";
|
|
166
|
-
body.style.position = visible ? "fixed" : "";
|
|
167
|
-
body.style.top = `${top}px`;
|
|
168
|
-
} else {
|
|
169
|
-
body.style.overflowY = originOverflow;
|
|
170
|
-
body.style.position = originPosition;
|
|
171
|
-
body.style.top = "";
|
|
172
|
-
window.scrollTo(0, -top);
|
|
173
|
-
}
|
|
353
|
+
function className(classStr, classOpt) {
|
|
354
|
+
let classname = classStr;
|
|
355
|
+
if (typeof classOpt === "object") {
|
|
356
|
+
Object.keys(classOpt).forEach((key) => {
|
|
357
|
+
classOpt[key] && (classname += ` ${key}`);
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
return classname;
|
|
361
|
+
}
|
|
362
|
+
var editableSelect = "";
|
|
363
|
+
function useSelect(props) {
|
|
364
|
+
const normalizeOptions = computed(() => {
|
|
365
|
+
return props.options.map((option) => {
|
|
366
|
+
let res;
|
|
367
|
+
if (option !== "null" && typeof option === "object") {
|
|
368
|
+
res = __spreadProps(__spreadValues({}, option), {
|
|
369
|
+
label: option.label || "",
|
|
370
|
+
value: option.value !== void 0 ? option.value : option.label || ""
|
|
371
|
+
});
|
|
372
|
+
} else {
|
|
373
|
+
res = {
|
|
374
|
+
label: String(option),
|
|
375
|
+
value: option
|
|
376
|
+
};
|
|
174
377
|
}
|
|
378
|
+
return res;
|
|
175
379
|
});
|
|
176
|
-
|
|
177
|
-
|
|
380
|
+
});
|
|
381
|
+
return { normalizeOptions };
|
|
382
|
+
}
|
|
383
|
+
function useFilterOptions(enableLazyLoad, normalizeOptions, inputValue, searchFn) {
|
|
384
|
+
const filteredOptions = computed(() => {
|
|
385
|
+
if (!inputValue.value || enableLazyLoad) {
|
|
386
|
+
return normalizeOptions.value;
|
|
387
|
+
}
|
|
388
|
+
return normalizeOptions.value.filter((option) => {
|
|
389
|
+
return searchFn(option, inputValue.value);
|
|
178
390
|
});
|
|
179
391
|
});
|
|
392
|
+
return { filteredOptions };
|
|
393
|
+
}
|
|
394
|
+
function useInput(inputValue, ctx2) {
|
|
395
|
+
const onInputChange = (value) => {
|
|
396
|
+
ctx2.emit("search", value);
|
|
397
|
+
};
|
|
398
|
+
const handleInput = (event) => {
|
|
399
|
+
const value = event.target.value;
|
|
400
|
+
inputValue.value = value;
|
|
401
|
+
onInputChange(value);
|
|
402
|
+
};
|
|
180
403
|
return {
|
|
181
|
-
|
|
182
|
-
overlayClass,
|
|
183
|
-
handleBackdropClick,
|
|
184
|
-
handleOverlayBubbleCancel
|
|
404
|
+
handleInput
|
|
185
405
|
};
|
|
186
406
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
default: void 0
|
|
407
|
+
function useLazyLoad(dropdownRef, enableLazyLoad, ctx2) {
|
|
408
|
+
const loadMore = () => {
|
|
409
|
+
const dropdownVal = dropdownRef.value;
|
|
410
|
+
if (!enableLazyLoad) {
|
|
411
|
+
return;
|
|
193
412
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const {
|
|
197
|
-
backgroundClass,
|
|
198
|
-
overlayClass,
|
|
199
|
-
handleBackdropClick,
|
|
200
|
-
handleOverlayBubbleCancel
|
|
201
|
-
} = useOverlayLogic(props);
|
|
202
|
-
return () => createVNode(CommonOverlay, null, {
|
|
203
|
-
default: () => [withDirectives(createVNode("div", {
|
|
204
|
-
"class": backgroundClass.value,
|
|
205
|
-
"style": props.backgroundStyle,
|
|
206
|
-
"onClick": handleBackdropClick
|
|
207
|
-
}, [createVNode("div", {
|
|
208
|
-
"class": overlayClass.value,
|
|
209
|
-
"style": props.overlayStyle,
|
|
210
|
-
"onClick": handleOverlayBubbleCancel
|
|
211
|
-
}, [renderSlot(ctx.slots, "default")])]), [[vShow, props.visible]])]
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
const FlexibleOverlay = defineComponent({
|
|
216
|
-
name: "DFlexibleOverlay",
|
|
217
|
-
props: __spreadValues({
|
|
218
|
-
origin: {
|
|
219
|
-
type: Object,
|
|
220
|
-
require: true
|
|
221
|
-
},
|
|
222
|
-
position: {
|
|
223
|
-
type: Object,
|
|
224
|
-
default: () => ({
|
|
225
|
-
originX: "left",
|
|
226
|
-
originY: "top",
|
|
227
|
-
overlayX: "left",
|
|
228
|
-
overlayY: "top"
|
|
229
|
-
})
|
|
413
|
+
if (dropdownVal.clientHeight + dropdownVal.scrollTop >= dropdownVal.scrollHeight) {
|
|
414
|
+
ctx2.emit("loadMore");
|
|
230
415
|
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
positionedStyle.left = `${point.x}px`;
|
|
252
|
-
positionedStyle.top = `${point.y}px`;
|
|
253
|
-
};
|
|
254
|
-
const handleChange = () => handleRectChange(overlay2.getBoundingClientRect());
|
|
255
|
-
watch(toRef(props, "visible"), (visible, ov, onInvalidate) => {
|
|
256
|
-
if (visible) {
|
|
257
|
-
subscribeLayoutEvent(handleChange);
|
|
258
|
-
} else {
|
|
259
|
-
unsbscribeLayoutEvent(handleChange);
|
|
416
|
+
};
|
|
417
|
+
return { loadMore };
|
|
418
|
+
}
|
|
419
|
+
function useKeyboardSelect(dropdownRef, visible, inputValue, cacheInput, filteredOptions, optionDisabledKey, filterOption, loading2, handleClick, closeMenu, toggleMenu) {
|
|
420
|
+
const hoverIndex = ref(0);
|
|
421
|
+
const selectedIndex = ref(0);
|
|
422
|
+
const updateHoveringIndex = (index2) => {
|
|
423
|
+
hoverIndex.value = index2;
|
|
424
|
+
};
|
|
425
|
+
const scrollToItem = (index2) => {
|
|
426
|
+
const ul = dropdownRef.value;
|
|
427
|
+
const li = ul.children[index2];
|
|
428
|
+
nextTick(() => {
|
|
429
|
+
if (li.scrollIntoViewIfNeeded) {
|
|
430
|
+
li.scrollIntoViewIfNeeded(false);
|
|
431
|
+
} else {
|
|
432
|
+
const containerInfo = ul.getBoundingClientRect();
|
|
433
|
+
const elementInfo = li.getBoundingClientRect();
|
|
434
|
+
if (elementInfo.bottom > containerInfo.bottom || elementInfo.top < containerInfo.top) {
|
|
435
|
+
li.scrollIntoView(false);
|
|
260
436
|
}
|
|
261
|
-
onInvalidate(() => {
|
|
262
|
-
unsbscribeLayoutEvent(handleChange);
|
|
263
|
-
});
|
|
264
|
-
});
|
|
265
|
-
watch(toRef(props, "position"), () => {
|
|
266
|
-
handleChange();
|
|
267
|
-
});
|
|
268
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
269
|
-
handleRectChange(entries[0].contentRect);
|
|
270
|
-
});
|
|
271
|
-
resizeObserver.observe(overlay2);
|
|
272
|
-
onBeforeUnmount(() => {
|
|
273
|
-
resizeObserver.disconnect();
|
|
274
|
-
}, instance);
|
|
275
|
-
if (origin instanceof Element) {
|
|
276
|
-
const observer = new MutationObserver(handleChange);
|
|
277
|
-
observer.observe(origin, {
|
|
278
|
-
attributeFilter: ["style"]
|
|
279
|
-
});
|
|
280
|
-
onBeforeUnmount(() => {
|
|
281
|
-
observer.disconnect();
|
|
282
|
-
}, instance);
|
|
283
437
|
}
|
|
284
|
-
}, instance);
|
|
285
|
-
const {
|
|
286
|
-
backgroundClass,
|
|
287
|
-
overlayClass,
|
|
288
|
-
handleBackdropClick,
|
|
289
|
-
handleOverlayBubbleCancel
|
|
290
|
-
} = useOverlayLogic(props);
|
|
291
|
-
return () => createVNode(CommonOverlay, null, {
|
|
292
|
-
default: () => [withDirectives(createVNode("div", {
|
|
293
|
-
"class": backgroundClass.value,
|
|
294
|
-
"onClick": handleBackdropClick
|
|
295
|
-
}, [createVNode("div", {
|
|
296
|
-
"ref": overlayRef,
|
|
297
|
-
"class": overlayClass.value,
|
|
298
|
-
"style": positionedStyle,
|
|
299
|
-
"onClick": handleOverlayBubbleCancel
|
|
300
|
-
}, [renderSlot(ctx.slots, "default")])]), [[vShow, props.visible]])]
|
|
301
438
|
});
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
439
|
+
};
|
|
440
|
+
const handleEscape = () => {
|
|
441
|
+
inputValue.value = cacheInput.value;
|
|
442
|
+
closeMenu();
|
|
443
|
+
};
|
|
444
|
+
const handleEnter = () => {
|
|
445
|
+
const len = filteredOptions.value.length;
|
|
446
|
+
if (!visible.value || !len) {
|
|
447
|
+
return toggleMenu();
|
|
448
|
+
}
|
|
449
|
+
len && len === 1 ? handleClick(filteredOptions.value[0], 1) : handleClick(filteredOptions.value[hoverIndex.value], hoverIndex.value);
|
|
450
|
+
return closeMenu();
|
|
451
|
+
};
|
|
452
|
+
const handleKeyboardNavigation = (direction) => {
|
|
453
|
+
const len = filteredOptions.value.length;
|
|
454
|
+
if (!len || len === 1) {
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
if (!["ArrowDown", "ArrowUp"].includes(direction)) {
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
if (filterOption === false && loading2.value) {
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
let newIndex = 0;
|
|
464
|
+
newIndex = hoverIndex.value;
|
|
465
|
+
if (direction === "ArrowUp") {
|
|
466
|
+
newIndex -= 1;
|
|
467
|
+
if (newIndex === -1) {
|
|
468
|
+
newIndex = len - 1;
|
|
469
|
+
}
|
|
470
|
+
} else if (direction === "ArrowDown") {
|
|
471
|
+
newIndex += 1;
|
|
472
|
+
if (newIndex === len) {
|
|
473
|
+
newIndex = 0;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
hoverIndex.value = newIndex;
|
|
477
|
+
const option = filteredOptions.value[newIndex];
|
|
478
|
+
if (option[optionDisabledKey]) {
|
|
479
|
+
return handleKeyboardNavigation(direction);
|
|
480
|
+
}
|
|
481
|
+
updateHoveringIndex(newIndex);
|
|
482
|
+
scrollToItem(newIndex);
|
|
483
|
+
};
|
|
484
|
+
const handleKeydown = (event) => {
|
|
485
|
+
const keyCode = event.key || event.code;
|
|
486
|
+
switch (keyCode) {
|
|
487
|
+
case "Escape":
|
|
488
|
+
handleEscape();
|
|
489
|
+
break;
|
|
490
|
+
case "Enter":
|
|
491
|
+
handleEnter();
|
|
492
|
+
break;
|
|
493
|
+
default:
|
|
494
|
+
handleKeyboardNavigation(keyCode);
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
return { handleKeydown, hoverIndex, selectedIndex };
|
|
312
498
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
499
|
+
const flexibleOverlayProps = {
|
|
500
|
+
modelValue: {
|
|
501
|
+
type: Boolean,
|
|
502
|
+
default: false
|
|
503
|
+
},
|
|
504
|
+
origin: {
|
|
505
|
+
type: Object,
|
|
506
|
+
require: true
|
|
507
|
+
},
|
|
508
|
+
position: {
|
|
509
|
+
type: Array,
|
|
510
|
+
default: ["bottom"]
|
|
511
|
+
},
|
|
512
|
+
offset: {
|
|
513
|
+
type: [Number, Object],
|
|
514
|
+
default: 8
|
|
515
|
+
},
|
|
516
|
+
shiftOffset: {
|
|
517
|
+
type: Number
|
|
518
|
+
},
|
|
519
|
+
align: {
|
|
520
|
+
type: String,
|
|
521
|
+
default: null
|
|
522
|
+
},
|
|
523
|
+
showArrow: {
|
|
524
|
+
type: Boolean,
|
|
525
|
+
default: false
|
|
526
|
+
},
|
|
527
|
+
isArrowCenter: {
|
|
528
|
+
type: Boolean,
|
|
529
|
+
default: true
|
|
316
530
|
}
|
|
317
|
-
|
|
318
|
-
|
|
531
|
+
};
|
|
532
|
+
function getScrollParent(element) {
|
|
533
|
+
const overflowRegex = /(auto|scroll|hidden)/;
|
|
534
|
+
for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
|
|
535
|
+
const style = window.getComputedStyle(parent);
|
|
536
|
+
if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
|
|
537
|
+
return parent;
|
|
538
|
+
}
|
|
319
539
|
}
|
|
320
|
-
return
|
|
540
|
+
return window;
|
|
321
541
|
}
|
|
322
|
-
function
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
542
|
+
function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
543
|
+
let { x, y } = point;
|
|
544
|
+
if (!isArrowCenter) {
|
|
545
|
+
const { width, height } = originRect;
|
|
546
|
+
if (x && placement.includes("start")) {
|
|
547
|
+
x = 12;
|
|
548
|
+
}
|
|
549
|
+
if (x && placement.includes("end")) {
|
|
550
|
+
x = Math.round(width - 24);
|
|
551
|
+
}
|
|
552
|
+
if (y && placement.includes("start")) {
|
|
553
|
+
y = 10;
|
|
554
|
+
}
|
|
555
|
+
if (y && placement.includes("end")) {
|
|
556
|
+
y = height - 14;
|
|
557
|
+
}
|
|
330
558
|
}
|
|
331
|
-
return
|
|
559
|
+
return { x, y };
|
|
332
560
|
}
|
|
333
|
-
function
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
561
|
+
function useOverlay(props, emit) {
|
|
562
|
+
const overlayRef = ref();
|
|
563
|
+
const arrowRef = ref();
|
|
564
|
+
let originParent = null;
|
|
565
|
+
const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
|
|
566
|
+
const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
|
|
567
|
+
const staticSide = {
|
|
568
|
+
top: "bottom",
|
|
569
|
+
right: "left",
|
|
570
|
+
bottom: "top",
|
|
571
|
+
left: "right"
|
|
572
|
+
}[placement.split("-")[0]];
|
|
573
|
+
Object.assign(arrowEl.style, {
|
|
574
|
+
left: x ? `${x}px` : "",
|
|
575
|
+
top: y ? `${y}px` : "",
|
|
576
|
+
right: "",
|
|
577
|
+
bottom: "",
|
|
578
|
+
[staticSide]: "-4px"
|
|
579
|
+
});
|
|
346
580
|
};
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
581
|
+
const updatePosition = async () => {
|
|
582
|
+
const hostEl = props.origin;
|
|
583
|
+
const overlayEl = unref(overlayRef.value);
|
|
584
|
+
const arrowEl = unref(arrowRef.value);
|
|
585
|
+
const middleware = [
|
|
586
|
+
offset(props.offset),
|
|
587
|
+
autoPlacement({
|
|
588
|
+
alignment: props.align,
|
|
589
|
+
allowedPlacements: props.position
|
|
590
|
+
})
|
|
591
|
+
];
|
|
592
|
+
props.showArrow && middleware.push(arrow({ element: arrowEl }));
|
|
593
|
+
props.shiftOffset !== void 0 && middleware.push(shift());
|
|
594
|
+
const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
|
|
595
|
+
strategy: "fixed",
|
|
596
|
+
middleware
|
|
597
|
+
});
|
|
598
|
+
let applyX = x;
|
|
599
|
+
let applyY = y;
|
|
600
|
+
if (props.shiftOffset !== void 0) {
|
|
601
|
+
const { x: shiftX, y: shiftY } = middlewareData.shift;
|
|
602
|
+
shiftX < 0 && (applyX -= props.shiftOffset);
|
|
603
|
+
shiftX > 0 && (applyX += props.shiftOffset);
|
|
604
|
+
shiftY < 0 && (applyY -= props.shiftOffset);
|
|
605
|
+
shiftY > 0 && (applyY += props.shiftOffset);
|
|
606
|
+
}
|
|
607
|
+
emit("positionChange", placement);
|
|
608
|
+
Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
|
|
609
|
+
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
368
610
|
};
|
|
611
|
+
watch(() => props.modelValue, () => {
|
|
612
|
+
if (props.modelValue && props.origin) {
|
|
613
|
+
originParent = getScrollParent(props.origin);
|
|
614
|
+
nextTick(updatePosition);
|
|
615
|
+
originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
|
|
616
|
+
originParent !== window && window.addEventListener("scroll", updatePosition);
|
|
617
|
+
window.addEventListener("resize", updatePosition);
|
|
618
|
+
} else {
|
|
619
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
620
|
+
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
621
|
+
window.removeEventListener("resize", updatePosition);
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
onUnmounted(() => {
|
|
625
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
626
|
+
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
627
|
+
window.removeEventListener("resize", updatePosition);
|
|
628
|
+
});
|
|
629
|
+
return { arrowRef, overlayRef, updatePosition };
|
|
369
630
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
631
|
+
var flexibleOverlay = "";
|
|
632
|
+
const FlexibleOverlay = defineComponent({
|
|
633
|
+
name: "DFlexibleOverlay",
|
|
634
|
+
inheritAttrs: false,
|
|
635
|
+
props: flexibleOverlayProps,
|
|
636
|
+
emits: ["update:modelValue", "positionChange"],
|
|
637
|
+
setup(props, {
|
|
638
|
+
slots,
|
|
639
|
+
attrs,
|
|
640
|
+
emit,
|
|
641
|
+
expose
|
|
642
|
+
}) {
|
|
643
|
+
const ns = useNamespace("flexible-overlay");
|
|
644
|
+
const {
|
|
645
|
+
arrowRef,
|
|
646
|
+
overlayRef,
|
|
647
|
+
updatePosition
|
|
648
|
+
} = useOverlay(props, emit);
|
|
649
|
+
expose({
|
|
650
|
+
updatePosition
|
|
651
|
+
});
|
|
652
|
+
return () => {
|
|
653
|
+
var _a;
|
|
654
|
+
return props.modelValue && createVNode("div", mergeProps({
|
|
655
|
+
"ref": overlayRef,
|
|
656
|
+
"class": ns.b()
|
|
657
|
+
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
|
|
658
|
+
"ref": arrowRef,
|
|
659
|
+
"class": ns.e("arrow")
|
|
660
|
+
}, null)]);
|
|
661
|
+
};
|
|
384
662
|
}
|
|
663
|
+
});
|
|
664
|
+
function useCacheFilteredOptions(filteredOptions) {
|
|
665
|
+
const cacheFilteredOptions = computed(() => {
|
|
666
|
+
const map = /* @__PURE__ */ new Map();
|
|
667
|
+
filteredOptions.value.forEach((item) => {
|
|
668
|
+
map.set(item, item.value);
|
|
669
|
+
});
|
|
670
|
+
return map;
|
|
671
|
+
});
|
|
672
|
+
const getOptionValue = (option) => cacheFilteredOptions.value.get(option);
|
|
385
673
|
return {
|
|
386
|
-
|
|
387
|
-
y
|
|
674
|
+
getOptionValue
|
|
388
675
|
};
|
|
389
676
|
}
|
|
390
|
-
function
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
677
|
+
function deepAssign(...objects) {
|
|
678
|
+
const isObject = (obj) => obj && typeof obj === "object";
|
|
679
|
+
return objects.reduce((prev, from) => {
|
|
680
|
+
Object.keys(from).forEach((key) => {
|
|
681
|
+
const pVal = prev[key];
|
|
682
|
+
const oVal = from[key];
|
|
683
|
+
if (Array.isArray(pVal) && Array.isArray(oVal)) {
|
|
684
|
+
prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
|
|
685
|
+
} else if (isObject(pVal) && isObject(oVal)) {
|
|
686
|
+
prev[key] = deepAssign(pVal, oVal);
|
|
687
|
+
} else {
|
|
688
|
+
prev[key] = oVal;
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
return prev;
|
|
692
|
+
}, {});
|
|
399
693
|
}
|
|
400
|
-
|
|
401
|
-
|
|
694
|
+
var zhCN = {
|
|
695
|
+
pagination: {
|
|
696
|
+
totalItemText: "\u6240\u6709\u6761\u76EE",
|
|
697
|
+
goToText: "\u8DF3\u81F3"
|
|
698
|
+
},
|
|
699
|
+
accordion: {
|
|
700
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
701
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
702
|
+
},
|
|
703
|
+
autoCompleteDropdown: {
|
|
704
|
+
latestInput: "\u6700\u8FD1\u8F93\u5165"
|
|
705
|
+
},
|
|
706
|
+
cascaderList: {
|
|
707
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
708
|
+
},
|
|
709
|
+
colorPicker: {
|
|
710
|
+
foundationPanel: "\u57FA\u7840\u9762\u677F",
|
|
711
|
+
advancedPanel: "\u9AD8\u7EA7\u9762\u677F"
|
|
712
|
+
},
|
|
713
|
+
datePickerPro: {
|
|
714
|
+
ok: "\u786E\u5B9A",
|
|
715
|
+
placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F",
|
|
716
|
+
month1: "1\u6708",
|
|
717
|
+
month2: "2\u6708",
|
|
718
|
+
month3: "3\u6708",
|
|
719
|
+
month4: "4\u6708",
|
|
720
|
+
month5: "5\u6708",
|
|
721
|
+
month6: "6\u6708",
|
|
722
|
+
month7: "7\u6708",
|
|
723
|
+
month8: "8\u6708",
|
|
724
|
+
month9: "9\u6708",
|
|
725
|
+
month10: "10\u6708",
|
|
726
|
+
month11: "11\u6708",
|
|
727
|
+
month12: "12\u6708",
|
|
728
|
+
year: "\u5E74",
|
|
729
|
+
startPlaceholder: "\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",
|
|
730
|
+
endPlaceholder: "\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",
|
|
731
|
+
getWeekDays() {
|
|
732
|
+
return ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
|
|
733
|
+
},
|
|
734
|
+
getTimeArr() {
|
|
735
|
+
return ["\u65F6", "\u5206", "\u79D2"];
|
|
736
|
+
},
|
|
737
|
+
getYearMonthStr(year, month) {
|
|
738
|
+
return `${year}\u5E74${month}\u6708`;
|
|
739
|
+
}
|
|
740
|
+
},
|
|
741
|
+
editableSelect: {
|
|
742
|
+
noRelatedRecords: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
743
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
744
|
+
},
|
|
745
|
+
input: {
|
|
746
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
747
|
+
},
|
|
748
|
+
splitterBar: {
|
|
749
|
+
collapse: "\u6536\u8D77",
|
|
750
|
+
expand: "\u5C55\u5F00"
|
|
751
|
+
},
|
|
752
|
+
stepsGuide: {
|
|
753
|
+
previous: "\u4E0A\u4E00\u6B65",
|
|
754
|
+
continue: "\u6211\u77E5\u9053\u5566\uFF0C\u7EE7\u7EED",
|
|
755
|
+
ok: "\u6211\u77E5\u9053\u5566"
|
|
756
|
+
},
|
|
757
|
+
table: {
|
|
758
|
+
selectAll: "\u5168\u9009",
|
|
759
|
+
ok: "\u786E\u5B9A"
|
|
760
|
+
},
|
|
761
|
+
timePopup: {
|
|
762
|
+
ok: "\u786E\u5B9A"
|
|
763
|
+
},
|
|
764
|
+
transfer: {
|
|
765
|
+
unit: "\u9879",
|
|
766
|
+
panelUnit: "\u9879",
|
|
767
|
+
headerUnit: "\u9879",
|
|
768
|
+
noData: "\u6682\u65E0\u6570\u636E",
|
|
769
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"
|
|
770
|
+
},
|
|
771
|
+
tree: {
|
|
772
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
773
|
+
newNode: "\u65B0\u8282\u70B9",
|
|
774
|
+
selectPlaceholder: "\u8BF7\u9009\u62E9"
|
|
775
|
+
},
|
|
776
|
+
upload: {
|
|
777
|
+
placeholder: "\u9009\u62E9\u6587\u4EF6",
|
|
778
|
+
getExistSameNameFilesMsg(sameNames) {
|
|
779
|
+
return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
780
|
+
},
|
|
781
|
+
getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
|
|
782
|
+
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`;
|
|
783
|
+
},
|
|
784
|
+
getBeyondMaximalFileSizeMsg(filename, maximalSize) {
|
|
785
|
+
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`;
|
|
786
|
+
},
|
|
787
|
+
getNotAllowedFileTypeMsg(filename, scope) {
|
|
788
|
+
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`;
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
search: {
|
|
792
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57"
|
|
793
|
+
},
|
|
794
|
+
select: {
|
|
795
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
796
|
+
noDataText: "\u65E0\u6570\u636E",
|
|
797
|
+
noMatchText: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
798
|
+
loadingText: "\u52A0\u8F7D\u4E2D..."
|
|
799
|
+
},
|
|
800
|
+
tagInput: {
|
|
801
|
+
maxTagsText: "\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"
|
|
802
|
+
},
|
|
803
|
+
timeSelect: {
|
|
804
|
+
placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
|
|
805
|
+
}
|
|
402
806
|
};
|
|
403
|
-
|
|
404
|
-
|
|
807
|
+
const lang = ref("zh-CN");
|
|
808
|
+
let langMessages = reactive({
|
|
809
|
+
[lang.value]: zhCN
|
|
810
|
+
});
|
|
811
|
+
const Locale = {
|
|
812
|
+
messages() {
|
|
813
|
+
return langMessages[lang.value];
|
|
814
|
+
},
|
|
815
|
+
lang() {
|
|
816
|
+
return lang.value;
|
|
817
|
+
},
|
|
818
|
+
use(newLang, newMessages) {
|
|
819
|
+
lang.value = newLang;
|
|
820
|
+
this.add({ [newLang]: newMessages });
|
|
821
|
+
},
|
|
822
|
+
add(newMessages = {}) {
|
|
823
|
+
langMessages = deepAssign(langMessages, newMessages);
|
|
824
|
+
}
|
|
405
825
|
};
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
overlayX: "left",
|
|
414
|
-
overlayY: "top"
|
|
415
|
-
}
|
|
826
|
+
const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
|
|
827
|
+
function get(object, path) {
|
|
828
|
+
const keys = path.split(".");
|
|
829
|
+
let result = object;
|
|
830
|
+
keys.forEach((key) => {
|
|
831
|
+
var _a;
|
|
832
|
+
result = (_a = result[key]) != null ? _a : "";
|
|
416
833
|
});
|
|
834
|
+
return result;
|
|
417
835
|
}
|
|
418
|
-
function
|
|
419
|
-
const
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
836
|
+
function createI18nTranslate(name, app, newPrefix) {
|
|
837
|
+
const prefix = newPrefix || camelize(name) + ".";
|
|
838
|
+
return (path) => {
|
|
839
|
+
var _a;
|
|
840
|
+
const messages = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
|
|
841
|
+
const message = get(messages, prefix + path) || get(messages, path);
|
|
842
|
+
return message;
|
|
424
843
|
};
|
|
425
|
-
const handleOptionSelect = (optionInstance) => {
|
|
426
|
-
ctx.emit("update:modelValue", optionInstance.proxy.label);
|
|
427
|
-
states.visible = false;
|
|
428
|
-
};
|
|
429
|
-
return {
|
|
430
|
-
toggleMenu,
|
|
431
|
-
handleOptionSelect
|
|
432
|
-
};
|
|
433
|
-
}
|
|
434
|
-
function className(classStr, classOpt) {
|
|
435
|
-
let classname = classStr;
|
|
436
|
-
if (typeof classOpt === "object") {
|
|
437
|
-
Object.keys(classOpt).forEach((key) => {
|
|
438
|
-
classOpt[key] && (classname += ` ${key}`);
|
|
439
|
-
});
|
|
440
|
-
}
|
|
441
|
-
return classname;
|
|
442
844
|
}
|
|
443
845
|
var EditableSelect = defineComponent({
|
|
444
846
|
name: "DEditableSelect",
|
|
847
|
+
directives: {
|
|
848
|
+
clickOutside: clickoutsideDirective,
|
|
849
|
+
dLoading: loadingDirective
|
|
850
|
+
},
|
|
445
851
|
props: editableSelectProps,
|
|
446
|
-
emits: ["update:modelValue"],
|
|
447
|
-
setup(props,
|
|
448
|
-
const
|
|
852
|
+
emits: ["update:modelValue", "search", "loadMore"],
|
|
853
|
+
setup(props, ctx2) {
|
|
854
|
+
const app = getCurrentInstance();
|
|
855
|
+
const t = createI18nTranslate("DEditableSelect", app);
|
|
856
|
+
const ns = useNamespace("editable-select");
|
|
857
|
+
const dropdownRef = ref();
|
|
858
|
+
const origin = ref();
|
|
859
|
+
const position = ref(["bottom"]);
|
|
860
|
+
const visible = ref(false);
|
|
861
|
+
const inputValue = ref(props.modelValue);
|
|
862
|
+
const cacheInput = ref();
|
|
863
|
+
const loading2 = ref(props.loading);
|
|
864
|
+
const {
|
|
865
|
+
normalizeOptions
|
|
866
|
+
} = useSelect(props);
|
|
867
|
+
const searchFn = props.searchFn || ((option, term) => option.label.toLocaleLowerCase().includes(term.trim().toLocaleLowerCase()));
|
|
449
868
|
const {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
869
|
+
filteredOptions
|
|
870
|
+
} = useFilterOptions(props.enableLazyLoad, normalizeOptions, inputValue, searchFn);
|
|
871
|
+
const {
|
|
872
|
+
getOptionValue
|
|
873
|
+
} = useCacheFilteredOptions(filteredOptions);
|
|
874
|
+
const emptyText = computed(() => {
|
|
875
|
+
let text;
|
|
876
|
+
if (props.enableLazyLoad) {
|
|
877
|
+
text = t("noData");
|
|
878
|
+
} else {
|
|
879
|
+
text = t("noRelatedRecords");
|
|
880
|
+
}
|
|
881
|
+
return text;
|
|
455
882
|
});
|
|
883
|
+
watch(() => props.loading, (newVal) => {
|
|
884
|
+
loading2.value = newVal;
|
|
885
|
+
});
|
|
886
|
+
const toggleMenu = () => {
|
|
887
|
+
visible.value = !visible.value;
|
|
888
|
+
};
|
|
889
|
+
const closeMenu = () => {
|
|
890
|
+
visible.value = false;
|
|
891
|
+
};
|
|
892
|
+
const {
|
|
893
|
+
loadMore
|
|
894
|
+
} = useLazyLoad(dropdownRef, props.enableLazyLoad, ctx2);
|
|
895
|
+
const {
|
|
896
|
+
handleInput
|
|
897
|
+
} = useInput(inputValue, ctx2);
|
|
898
|
+
const handleClick = (option, index2, curSelectedIndex) => {
|
|
899
|
+
const {
|
|
900
|
+
disabledKey
|
|
901
|
+
} = props;
|
|
902
|
+
if (disabledKey && !!option[disabledKey]) {
|
|
903
|
+
return;
|
|
904
|
+
}
|
|
905
|
+
inputValue.value = option.label;
|
|
906
|
+
cacheInput.value = option.label;
|
|
907
|
+
curSelectedIndex.value = index2;
|
|
908
|
+
const value = getOptionValue(option);
|
|
909
|
+
ctx2.emit("update:modelValue", value + "");
|
|
910
|
+
closeMenu();
|
|
911
|
+
};
|
|
912
|
+
const handleClear = () => {
|
|
913
|
+
inputValue.value = "";
|
|
914
|
+
};
|
|
456
915
|
const {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
916
|
+
handleKeydown,
|
|
917
|
+
hoverIndex,
|
|
918
|
+
selectedIndex
|
|
919
|
+
} = useKeyboardSelect(dropdownRef, visible, inputValue, cacheInput, filteredOptions, props.disabledKey, props.filterOption, loading2, (option, index2) => handleClick(option, index2, selectedIndex), closeMenu, toggleMenu);
|
|
920
|
+
const getItemCls = (option, index2) => {
|
|
921
|
+
const {
|
|
922
|
+
disabledKey
|
|
923
|
+
} = props;
|
|
924
|
+
return className(`devui-dropdown-item`, {
|
|
925
|
+
disabled: disabledKey ? !!option[disabledKey] : false,
|
|
926
|
+
selected: index2 === selectedIndex.value,
|
|
927
|
+
[`${ns.em("dropdown", "bg")}`]: index2 === hoverIndex.value
|
|
928
|
+
});
|
|
929
|
+
};
|
|
463
930
|
return () => {
|
|
464
|
-
|
|
465
|
-
"
|
|
466
|
-
|
|
467
|
-
|
|
931
|
+
const selectCls = className(`${ns.b()} devui-form-group devui-has-feedback ${inputValue.value && props.allowClear && "allow-clear"}`, {
|
|
932
|
+
[`${ns.m("open")}`]: visible.value === true
|
|
933
|
+
});
|
|
934
|
+
const inputCls = className(`devui-form-control devui-dropdown-origin`, {
|
|
935
|
+
"devui-dropdown-origin-open": visible.value === true
|
|
936
|
+
});
|
|
937
|
+
return withDirectives(createVNode("div", {
|
|
938
|
+
"class": selectCls,
|
|
939
|
+
"ref": origin,
|
|
940
|
+
"style": {
|
|
941
|
+
width: props.width + "px"
|
|
942
|
+
}
|
|
468
943
|
}, [createVNode("input", {
|
|
469
|
-
"type": "text",
|
|
470
944
|
"class": inputCls,
|
|
471
|
-
"
|
|
945
|
+
"onClick": withModifiers(toggleMenu, ["self"]),
|
|
946
|
+
"onInput": handleInput,
|
|
947
|
+
"onKeydown": handleKeydown,
|
|
948
|
+
"value": inputValue.value,
|
|
949
|
+
"disabled": props.disabled,
|
|
950
|
+
"placeholder": props.placeholder,
|
|
951
|
+
"type": "text"
|
|
472
952
|
}, null), createVNode("span", {
|
|
473
953
|
"class": "devui-form-control-feedback"
|
|
474
954
|
}, [createVNode("span", {
|
|
955
|
+
"class": "devui-select-clear-icon",
|
|
956
|
+
"onClick": handleClear
|
|
957
|
+
}, [createVNode(resolveComponent("d-icon"), {
|
|
958
|
+
"name": "icon-remove"
|
|
959
|
+
}, null)]), createVNode("span", {
|
|
475
960
|
"class": "devui-select-chevron-icon"
|
|
476
|
-
}, [createVNode(
|
|
961
|
+
}, [createVNode(resolveComponent("d-icon"), {
|
|
477
962
|
"name": "select-arrow"
|
|
478
|
-
}, null)])])
|
|
479
|
-
"
|
|
480
|
-
"origin": origin,
|
|
481
|
-
"visible": visible.value,
|
|
482
|
-
"onUpdate:visible": ($event) => visible.value = $event,
|
|
483
|
-
"position": states.position
|
|
963
|
+
}, null)])]), createVNode(Teleport, {
|
|
964
|
+
"to": "body"
|
|
484
965
|
}, {
|
|
485
|
-
default: () => [createVNode(
|
|
486
|
-
"
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
}
|
|
523
|
-
};
|
|
524
|
-
return () => {
|
|
525
|
-
return createVNode("li", {
|
|
526
|
-
"class": optionsClassName,
|
|
527
|
-
"onClick": selectOptionClick
|
|
528
|
-
}, [props.label ? props.label : renderSlot(ctx.slots, "default")]);
|
|
966
|
+
default: () => [createVNode(Transition, {
|
|
967
|
+
"name": "fade"
|
|
968
|
+
}, {
|
|
969
|
+
default: () => [createVNode(FlexibleOverlay, {
|
|
970
|
+
"origin": origin.value,
|
|
971
|
+
"modelValue": visible.value,
|
|
972
|
+
"onUpdate:modelValue": ($event) => visible.value = $event,
|
|
973
|
+
"position": position.value
|
|
974
|
+
}, {
|
|
975
|
+
default: () => [createVNode("div", {
|
|
976
|
+
"style": {
|
|
977
|
+
width: props.width + "px"
|
|
978
|
+
},
|
|
979
|
+
"class": `${ns.e("menu")}`
|
|
980
|
+
}, [withDirectives(createVNode("div", {
|
|
981
|
+
"class": `devui-dropdown-menu`
|
|
982
|
+
}, [createVNode("ul", {
|
|
983
|
+
"ref": dropdownRef,
|
|
984
|
+
"class": `${ns.em("list", "unstyled")} devui-scrollbar scroll-height`,
|
|
985
|
+
"style": {
|
|
986
|
+
maxHeight: props.maxHeight + "px"
|
|
987
|
+
},
|
|
988
|
+
"onScroll": loadMore
|
|
989
|
+
}, [filteredOptions.value.map((option, index2) => {
|
|
990
|
+
return createVNode("li", {
|
|
991
|
+
"class": getItemCls(option, index2),
|
|
992
|
+
"onClick": (e) => {
|
|
993
|
+
e.stopPropagation();
|
|
994
|
+
handleClick(option, index2, selectedIndex);
|
|
995
|
+
}
|
|
996
|
+
}, [ctx2.slots.item ? ctx2.slots.item(option) : option.label]);
|
|
997
|
+
}), withDirectives(createVNode("div", {
|
|
998
|
+
"class": "devui-no-data-tip"
|
|
999
|
+
}, [ctx2.slots.noResultItem ? ctx2.slots.noResultItem(inputValue.value) : emptyText.value]), [[vShow, !filteredOptions.value.length]])])]), [[vShow, visible.value], [resolveDirective("d-loading"), props.loading]])])]
|
|
1000
|
+
})]
|
|
1001
|
+
})]
|
|
1002
|
+
})]), [[resolveDirective("click-outside"), closeMenu]]);
|
|
529
1003
|
};
|
|
530
1004
|
}
|
|
531
1005
|
});
|
|
532
|
-
EditableSelect.install = function(app) {
|
|
533
|
-
app.component(EditableSelect.name, EditableSelect);
|
|
534
|
-
app.component(EditableSelectOption.name, EditableSelectOption);
|
|
535
|
-
};
|
|
536
1006
|
var index = {
|
|
537
1007
|
title: "EditableSelect \u53EF\u8F93\u5165\u4E0B\u62C9\u9009\u62E9\u6846",
|
|
538
1008
|
category: "\u6570\u636E\u5F55\u5165",
|
|
539
|
-
status: "
|
|
1009
|
+
status: "100%",
|
|
540
1010
|
install(app) {
|
|
541
|
-
app.
|
|
1011
|
+
app.component(EditableSelect.name, EditableSelect);
|
|
542
1012
|
}
|
|
543
1013
|
};
|
|
544
|
-
export { EditableSelect,
|
|
1014
|
+
export { EditableSelect, index as default, editableSelectProps };
|