vft 0.0.74 → 0.0.77
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/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/es/component.js +67 -48
- package/es/components/affix/affix.js +45 -0
- package/es/components/affix/affix.vue.js +4 -0
- package/es/components/affix/affix.vue2.js +83 -0
- package/es/components/affix/index.js +12 -0
- package/es/components/affix/style/css.js +2 -0
- package/es/components/affix/style/index.js +2 -0
- package/es/components/back-top/back-top.vue2.js +10 -2
- package/es/components/button/button.vue2.js +58 -59
- package/es/components/button/use-button.js +26 -20
- package/es/components/card/card.vue.js +4 -0
- package/es/components/card/card.vue2.js +44 -0
- package/es/components/card/index.js +12 -0
- package/es/components/card/instance.js +1 -0
- package/es/components/card/style/css.js +2 -0
- package/es/components/card/style/index.js +2 -0
- package/es/components/check-tag/check-tag.vue.js +4 -0
- package/es/components/check-tag/check-tag.vue2.js +35 -0
- package/es/components/check-tag/index.js +12 -0
- package/es/components/check-tag/style/css.js +2 -0
- package/es/components/check-tag/style/index.js +2 -0
- package/es/components/color-picker/color-picker.vue2.js +1 -1
- package/es/components/context-menu/context-menu.vue2.js +10 -2
- package/es/components/date-picker/composables/use-month-range-header.js +1 -1
- package/es/components/date-picker/constants.js +16 -2
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +37 -34
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +0 -1
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +177 -178
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +328 -336
- package/es/components/date-picker/date-picker.js +18 -18
- package/es/components/date-picker/index.js +5 -4
- package/es/components/date-picker/props/shared.js +1 -1
- package/es/components/date-time-select/date-time-select.vue2.js +59 -59
- package/es/components/dialog/dialog.vue2.js +12 -12
- package/es/components/dialog/hooks/use-dialog.js +4 -4
- package/es/components/dropdown/dropdown-menu.vue2.js +4 -4
- package/es/components/footer-layout/footer-layout.vue2.js +10 -2
- package/es/components/header-layout/header-layout.vue2.js +10 -2
- package/es/components/horizontal-menu/constants.js +4 -0
- package/es/components/horizontal-menu/horizontal-menu.vue2.js +153 -86
- package/es/components/horizontal-menu/index.js +7 -5
- package/es/components/horizontal-menu/style/css.js +3 -0
- package/es/components/horizontal-menu/style/index.js +3 -0
- package/es/components/index.js +228 -194
- package/es/components/md-container/md-container.vue2.js +10 -2
- package/es/components/menu/menu-item.vue2.js +58 -58
- package/es/components/menu/menu.vue2.js +72 -68
- package/es/components/menu/style/css.js +3 -0
- package/es/components/menu/style/index.js +3 -0
- package/es/components/menu/sub-menu.vue2.js +139 -117
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +35 -26
- package/es/components/option/style/css.js +2 -0
- package/es/components/option/style/index.js +2 -0
- package/es/components/option-group/style/css.js +2 -0
- package/es/components/option-group/style/index.js +2 -0
- package/es/components/popconfirm/index.js +12 -0
- package/es/components/popconfirm/popconfirm.vue.js +4 -0
- package/es/components/popconfirm/popconfirm.vue2.js +112 -0
- package/es/components/popconfirm/style/css.js +6 -0
- package/es/components/popconfirm/style/index.js +6 -0
- package/es/components/result/result.vue2.js +10 -2
- package/es/components/roving-focus-group/roving-focus-item.vue2.js +1 -1
- package/es/components/select/index.js +22 -0
- package/es/components/select/option-group.vue.js +25 -0
- package/es/components/select/option-group.vue2.js +53 -0
- package/es/components/select/option.vue.js +27 -0
- package/es/components/select/option.vue2.js +58 -0
- package/es/components/select/options.js +34 -0
- package/es/components/select/select-dropdown.vue.js +15 -0
- package/es/components/select/select-dropdown.vue2.js +32 -0
- package/es/components/select/select.vue.js +327 -0
- package/es/components/select/select.vue2.js +348 -0
- package/es/components/select/style/css.js +8 -0
- package/es/components/select/style/index.js +8 -0
- package/es/components/select/token.js +5 -0
- package/es/components/select/useOption.js +71 -0
- package/es/components/select/useSelect.js +414 -0
- package/es/components/select-v2/select-dropdown.js +1 -1
- package/es/components/select-v2/useSelect.js +269 -269
- package/es/components/side-menu/side-menu.vue2.js +153 -142
- package/es/components/side-menu/style/css.js +3 -0
- package/es/components/side-menu/style/index.js +3 -0
- package/es/components/skeleton/index.js +16 -0
- package/es/components/skeleton/skeleton-item.vue.js +4 -0
- package/es/components/skeleton/skeleton-item.vue2.js +31 -0
- package/es/components/skeleton/skeleton.vue.js +4 -0
- package/es/components/skeleton/skeleton.vue2.js +55 -0
- package/es/components/skeleton/style/css.js +3 -0
- package/es/components/skeleton/style/index.js +3 -0
- package/es/components/skeleton-item/style/css.js +2 -0
- package/es/components/skeleton-item/style/index.js +2 -0
- package/es/components/space/index.js +17 -0
- package/es/components/space/item.js +24 -0
- package/es/components/space/space.js +182 -0
- package/es/components/space/style/css.js +2 -0
- package/es/components/space/style/index.js +2 -0
- package/es/components/space/use-space.js +44 -0
- package/es/components/switch/switch.vue2.js +1 -1
- package/es/components/tabs/tab-nav.vue2.js +30 -22
- package/es/components/tabs/tabs.vue2.js +37 -37
- package/es/components/time-picker/common/picker.vue2.js +241 -257
- package/es/components/time-picker/common/props.js +10 -6
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +1 -1
- package/es/components/time-picker/time-picker.js +10 -10
- package/es/components/time-select/time-select.vue2.js +38 -42
- package/es/components/tooltip/content.vue2.js +1 -1
- package/es/components/tree/index.js +14 -0
- package/es/components/tree/model/node.js +248 -0
- package/es/components/tree/model/tree-store.js +197 -0
- package/es/components/tree/model/useDragNode.js +71 -0
- package/es/components/tree/model/useKeydown.js +81 -0
- package/es/components/tree/model/useNodeExpandEventBroadcast.js +19 -0
- package/es/components/tree/model/util.js +21 -0
- package/es/components/tree/style/css.js +3 -0
- package/es/components/tree/style/index.js +3 -0
- package/es/components/tree/tree-node-content.vue.js +4 -0
- package/es/components/tree/tree-node-content.vue2.js +28 -0
- package/es/components/tree/tree-node.vue.js +98 -0
- package/es/components/tree/tree-node.vue2.js +152 -0
- package/es/components/tree/tree.type.js +1 -0
- package/es/components/tree/tree.vue.js +48 -0
- package/es/components/tree/tree.vue2.js +268 -0
- package/es/components/tree-select/cache-options.js +32 -0
- package/es/components/tree-select/index.js +9 -0
- package/es/components/tree-select/select.js +38 -0
- package/es/components/tree-select/style/css.js +11 -0
- package/es/components/tree-select/style/index.js +11 -0
- package/es/components/tree-select/tree-select-option.js +21 -0
- package/es/components/tree-select/tree-select.vue.js +4 -0
- package/es/components/tree-select/tree-select.vue2.js +81 -0
- package/es/components/tree-select/tree.js +137 -0
- package/es/components/tree-select/utils.js +45 -0
- package/es/hooks/index.js +25 -21
- package/es/hooks/use-focus/index.js +9 -0
- package/es/hooks/use-throttle-render/index.js +21 -0
- package/es/index.js +408 -368
- package/es/package.json.js +1 -1
- package/es/utils/helper.js +5 -2
- package/es/utils/index.js +48 -46
- package/lib/component.cjs +1 -1
- package/lib/components/affix/affix.cjs +1 -0
- package/lib/components/affix/affix.vue.cjs +1 -0
- package/lib/components/affix/affix.vue2.cjs +1 -0
- package/lib/components/affix/index.cjs +1 -0
- package/lib/components/affix/style/css.cjs +1 -0
- package/lib/components/affix/style/index.cjs +1 -0
- package/lib/components/back-top/back-top.vue2.cjs +1 -1
- package/lib/components/button/button.vue2.cjs +1 -1
- package/lib/components/button/use-button.cjs +1 -1
- package/lib/components/card/card.vue.cjs +1 -0
- package/lib/components/card/card.vue2.cjs +1 -0
- package/lib/components/card/index.cjs +1 -0
- package/lib/components/card/instance.cjs +1 -0
- package/lib/components/card/style/css.cjs +1 -0
- package/lib/components/card/style/index.cjs +1 -0
- package/lib/components/check-tag/check-tag.vue.cjs +1 -0
- package/lib/components/check-tag/check-tag.vue2.cjs +1 -0
- package/lib/components/check-tag/index.cjs +1 -0
- package/lib/components/check-tag/style/css.cjs +1 -0
- package/lib/components/check-tag/style/index.cjs +1 -0
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/context-menu/context-menu.vue2.cjs +1 -1
- package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
- package/lib/components/date-picker/constants.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker.cjs +1 -1
- package/lib/components/date-picker/index.cjs +1 -1
- package/lib/components/date-picker/props/shared.cjs +1 -1
- package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
- package/lib/components/dialog/dialog.vue2.cjs +1 -1
- package/lib/components/dialog/hooks/use-dialog.cjs +1 -1
- package/lib/components/dropdown/dropdown-menu.vue2.cjs +1 -1
- package/lib/components/footer-layout/footer-layout.vue2.cjs +1 -1
- package/lib/components/header-layout/header-layout.vue2.cjs +1 -1
- package/lib/components/horizontal-menu/constants.cjs +1 -0
- package/lib/components/horizontal-menu/horizontal-menu.vue2.cjs +1 -1
- package/lib/components/horizontal-menu/index.cjs +1 -1
- package/lib/components/horizontal-menu/style/css.cjs +1 -1
- package/lib/components/horizontal-menu/style/index.cjs +1 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/menu/menu-item.vue2.cjs +1 -1
- package/lib/components/menu/menu.vue2.cjs +1 -1
- package/lib/components/menu/style/css.cjs +1 -1
- package/lib/components/menu/style/index.cjs +1 -1
- package/lib/components/menu/sub-menu.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/option/style/css.cjs +1 -0
- package/lib/components/option/style/index.cjs +1 -0
- package/lib/components/option-group/style/css.cjs +1 -0
- package/lib/components/option-group/style/index.cjs +1 -0
- package/lib/components/popconfirm/index.cjs +1 -0
- package/lib/components/popconfirm/popconfirm.vue.cjs +1 -0
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -0
- package/lib/components/popconfirm/style/css.cjs +1 -0
- package/lib/components/popconfirm/style/index.cjs +1 -0
- package/lib/components/result/result.vue2.cjs +1 -1
- package/lib/components/roving-focus-group/roving-focus-item.vue2.cjs +1 -1
- package/lib/components/select/index.cjs +1 -0
- package/lib/components/select/option-group.vue.cjs +1 -0
- package/lib/components/select/option-group.vue2.cjs +1 -0
- package/lib/components/select/option.vue.cjs +1 -0
- package/lib/components/select/option.vue2.cjs +1 -0
- package/lib/components/select/options.cjs +1 -0
- package/lib/components/select/select-dropdown.vue.cjs +1 -0
- package/lib/components/select/select-dropdown.vue2.cjs +1 -0
- package/lib/components/select/select.vue.cjs +1 -0
- package/lib/components/select/select.vue2.cjs +1 -0
- package/lib/components/select/style/css.cjs +1 -0
- package/lib/components/select/style/index.cjs +1 -0
- package/lib/components/select/token.cjs +1 -0
- package/lib/components/select/useOption.cjs +1 -0
- package/lib/components/select/useSelect.cjs +1 -0
- package/lib/components/select-v2/select-dropdown.cjs +1 -1
- package/lib/components/select-v2/useSelect.cjs +1 -1
- package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
- package/lib/components/side-menu/style/css.cjs +1 -1
- package/lib/components/side-menu/style/index.cjs +1 -1
- package/lib/components/skeleton/index.cjs +1 -0
- package/lib/components/skeleton/skeleton-item.vue.cjs +1 -0
- package/lib/components/skeleton/skeleton-item.vue2.cjs +1 -0
- package/lib/components/skeleton/skeleton.vue.cjs +1 -0
- package/lib/components/skeleton/skeleton.vue2.cjs +1 -0
- package/lib/components/skeleton/style/css.cjs +1 -0
- package/lib/components/skeleton/style/index.cjs +1 -0
- package/lib/components/skeleton-item/style/css.cjs +1 -0
- package/lib/components/skeleton-item/style/index.cjs +1 -0
- package/lib/components/space/index.cjs +1 -0
- package/lib/components/space/item.cjs +1 -0
- package/lib/components/space/space.cjs +1 -0
- package/lib/components/space/style/css.cjs +1 -0
- package/lib/components/space/style/index.cjs +1 -0
- package/lib/components/space/use-space.cjs +1 -0
- package/lib/components/switch/switch.vue2.cjs +1 -1
- package/lib/components/tabs/tab-nav.vue2.cjs +1 -1
- package/lib/components/tabs/tabs.vue2.cjs +1 -1
- package/lib/components/time-picker/common/picker.vue2.cjs +1 -1
- package/lib/components/time-picker/common/props.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker.cjs +1 -1
- package/lib/components/time-select/time-select.vue2.cjs +1 -1
- package/lib/components/tooltip/content.vue2.cjs +1 -1
- package/lib/components/tree/index.cjs +1 -0
- package/lib/components/tree/model/node.cjs +1 -0
- package/lib/components/tree/model/tree-store.cjs +1 -0
- package/lib/components/tree/model/useDragNode.cjs +1 -0
- package/lib/components/tree/model/useKeydown.cjs +1 -0
- package/lib/components/tree/model/useNodeExpandEventBroadcast.cjs +1 -0
- package/lib/components/tree/model/util.cjs +1 -0
- package/lib/components/tree/style/css.cjs +1 -0
- package/lib/components/tree/style/index.cjs +1 -0
- package/lib/components/tree/tree-node-content.vue.cjs +1 -0
- package/lib/components/tree/tree-node-content.vue2.cjs +1 -0
- package/lib/components/tree/tree-node.vue.cjs +1 -0
- package/lib/components/tree/tree-node.vue2.cjs +1 -0
- package/lib/components/tree/tree.type.cjs +1 -0
- package/lib/components/tree/tree.vue.cjs +1 -0
- package/lib/components/tree/tree.vue2.cjs +1 -0
- package/lib/components/tree-select/cache-options.cjs +1 -0
- package/lib/components/tree-select/index.cjs +1 -0
- package/lib/components/tree-select/select.cjs +1 -0
- package/lib/components/tree-select/style/css.cjs +1 -0
- package/lib/components/tree-select/style/index.cjs +1 -0
- package/lib/components/tree-select/tree-select-option.cjs +1 -0
- package/lib/components/tree-select/tree-select.vue.cjs +1 -0
- package/lib/components/tree-select/tree-select.vue2.cjs +1 -0
- package/lib/components/tree-select/tree.cjs +1 -0
- package/lib/components/tree-select/utils.cjs +1 -0
- package/lib/hooks/index.cjs +1 -1
- package/lib/hooks/use-focus/index.cjs +1 -0
- package/lib/hooks/use-throttle-render/index.cjs +1 -0
- package/lib/index.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/utils/helper.cjs +1 -1
- package/lib/utils/index.cjs +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/theme-style/base.css +1 -1
- package/theme-style/index.css +1 -1
- package/theme-style/src/alert.scss +1 -1
- package/theme-style/src/autocomplete.scss +2 -2
- package/theme-style/src/breadcrumb.scss +4 -4
- package/theme-style/src/calendar.scss +2 -2
- package/theme-style/src/card.scss +1 -1
- package/theme-style/src/carousel.scss +1 -1
- package/theme-style/src/cascader.scss +3 -3
- package/theme-style/src/check-tag.scss +3 -3
- package/theme-style/src/checkbox.scss +1 -1
- package/theme-style/src/color-picker.scss +2 -2
- package/theme-style/src/common/var.scss +527 -521
- package/theme-style/src/date-picker/date-picker.scss +1 -1
- package/theme-style/src/date-picker/date-range-picker.scss +2 -2
- package/theme-style/src/date-picker/date-table.scss +1 -1
- package/theme-style/src/date-picker/month-table.scss +2 -2
- package/theme-style/src/date-picker/picker-panel.scss +4 -5
- package/theme-style/src/date-picker/picker.scss +7 -9
- package/theme-style/src/date-picker/time-picker.scss +2 -2
- package/theme-style/src/date-picker/time-spinner.scss +6 -8
- package/theme-style/src/date-picker/year-table.scss +3 -3
- package/theme-style/src/date-time-select.scss +3 -4
- package/theme-style/src/descriptions-item.scss +4 -4
- package/theme-style/src/descriptions.scss +2 -2
- package/theme-style/src/header-layout.scss +1 -1
- package/theme-style/src/horizontal-menu.scss +27 -39
- package/theme-style/src/image-viewer.scss +1 -1
- package/theme-style/src/index.scss +3 -0
- package/theme-style/src/input-number.scss +1 -1
- package/theme-style/src/menu.scss +76 -66
- package/theme-style/src/mixins/_var.scss +2 -2
- package/theme-style/src/mixins/mixins.scss +2 -2
- package/theme-style/src/popconfirm.scss +16 -0
- package/theme-style/src/popper.scss +4 -2
- package/theme-style/src/progress.scss +1 -1
- package/theme-style/src/reset.scss +3 -3
- package/theme-style/src/result.scss +2 -2
- package/theme-style/src/select-dropdown-v2.scss +1 -1
- package/theme-style/src/select-dropdown.scss +1 -1
- package/theme-style/src/select-v2.scss +2 -2
- package/theme-style/src/select.scss +4 -5
- package/theme-style/src/skeleton-item.scss +83 -0
- package/theme-style/src/skeleton.scss +44 -0
- package/theme-style/src/step.scss +10 -10
- package/theme-style/src/tabs.scss +15 -155
- package/theme-style/src/timeline-item.scss +2 -2
- package/theme-style/src/transfer.scss +5 -5
- package/theme-style/src/tree.scss +2 -5
- package/theme-style/src/upload.scss +11 -11
- package/theme-style/src/var.scss +1 -1
- package/theme-style/vft-alert.css +1 -1
- package/theme-style/vft-autocomplete.css +1 -1
- package/theme-style/vft-breadcrumb.css +1 -1
- package/theme-style/vft-calendar.css +1 -1
- package/theme-style/vft-card.css +1 -1
- package/theme-style/vft-carousel.css +1 -1
- package/theme-style/vft-cascader.css +1 -1
- package/theme-style/vft-check-tag.css +1 -1
- package/theme-style/vft-checkbox.css +1 -1
- package/theme-style/vft-color-picker.css +1 -1
- package/theme-style/vft-date-picker.css +1 -1
- package/theme-style/vft-date-time-select.css +1 -1
- package/theme-style/vft-descriptions-item.css +1 -1
- package/theme-style/vft-descriptions.css +1 -1
- package/theme-style/vft-header-layout.css +1 -1
- package/theme-style/vft-horizontal-menu.css +1 -1
- package/theme-style/vft-image-viewer.css +1 -1
- package/theme-style/vft-input-number.css +1 -1
- package/theme-style/vft-menu.css +1 -1
- package/theme-style/vft-popconfirm.css +1 -0
- package/theme-style/vft-popper.css +1 -1
- package/theme-style/vft-progress.css +1 -1
- package/theme-style/vft-reset.css +1 -1
- package/theme-style/vft-result.css +1 -1
- package/theme-style/vft-select-dropdown-v2.css +1 -1
- package/theme-style/vft-select-dropdown.css +1 -1
- package/theme-style/vft-select-v2.css +1 -1
- package/theme-style/vft-select.css +1 -1
- package/theme-style/vft-skeleton-item.css +1 -0
- package/theme-style/vft-skeleton.css +1 -0
- package/theme-style/vft-step.css +1 -1
- package/theme-style/vft-tabs.css +1 -1
- package/theme-style/vft-time-picker.css +1 -1
- package/theme-style/vft-time-select.css +1 -1
- package/theme-style/vft-timeline-item.css +1 -1
- package/theme-style/vft-transfer.css +1 -1
- package/theme-style/vft-tree.css +1 -1
- package/theme-style/vft-upload.css +1 -1
- package/theme-style/vft-var.css +1 -1
- package/web-types.json +1 -1
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { defineComponent as Le, toRefs as We, computed as s, unref as n, provide as ze, reactive as Fe, onMounted as Pe, nextTick as _e } from "vue";
|
|
2
|
+
import { useResizeObserver as De, isIOS as Ke } from "@vueuse/core";
|
|
3
|
+
import { placements as He } from "@popperjs/core";
|
|
4
|
+
import { ClickOutside as $e } from "@vft/directives";
|
|
5
|
+
import { useNamespace as B } from "../../hooks/use-namespace/index.js";
|
|
6
|
+
import "lodash";
|
|
7
|
+
import "../../hooks/use-z-index/index.js";
|
|
8
|
+
import "@vft/utils";
|
|
9
|
+
import { isValidComponentSize as ke } from "../../utils/helper.js";
|
|
10
|
+
import "../../utils/ns-cover.js";
|
|
11
|
+
import { useFocus as qe } from "../../hooks/use-focus/index.js";
|
|
12
|
+
import { VftInput as je } from "../input/index.js";
|
|
13
|
+
import { VftScrollbar as Qe } from "../scrollbar/index.js";
|
|
14
|
+
import { VftTooltip as Ge } from "../tooltip/index.js";
|
|
15
|
+
import { VftTag as Ue } from "../tag/index.js";
|
|
16
|
+
import { VftIcon as Je } from "../icon/index.js";
|
|
17
|
+
import { UPDATE_MODEL_EVENT as c, CHANGE_EVENT as Xe } from "../../constants/event.js";
|
|
18
|
+
import Ye from "./option.vue.js";
|
|
19
|
+
import Ze from "./select-dropdown.vue.js";
|
|
20
|
+
import { useSelectStates as et, useSelect as tt } from "./useSelect.js";
|
|
21
|
+
import { selectKey as ot } from "./token.js";
|
|
22
|
+
import lt from "./options.js";
|
|
23
|
+
const x = "VftSelect", wt = Le({
|
|
24
|
+
name: x,
|
|
25
|
+
componentName: x,
|
|
26
|
+
components: {
|
|
27
|
+
VftInput: je,
|
|
28
|
+
SelectMenu: Ze,
|
|
29
|
+
VftOption: Ye,
|
|
30
|
+
Options: lt,
|
|
31
|
+
VftTag: Ue,
|
|
32
|
+
VftScrollbar: Qe,
|
|
33
|
+
VftTooltip: Ge,
|
|
34
|
+
VftIcon: Je
|
|
35
|
+
},
|
|
36
|
+
directives: { ClickOutside: $e },
|
|
37
|
+
props: {
|
|
38
|
+
name: String,
|
|
39
|
+
id: String,
|
|
40
|
+
modelValue: {
|
|
41
|
+
type: [Array, String, Number, Boolean, Object],
|
|
42
|
+
default: void 0
|
|
43
|
+
},
|
|
44
|
+
autocomplete: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: "off"
|
|
47
|
+
},
|
|
48
|
+
automaticDropdown: Boolean,
|
|
49
|
+
size: {
|
|
50
|
+
type: String,
|
|
51
|
+
validator: ke
|
|
52
|
+
},
|
|
53
|
+
effect: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "light"
|
|
56
|
+
},
|
|
57
|
+
disabled: Boolean,
|
|
58
|
+
clearable: Boolean,
|
|
59
|
+
filterable: Boolean,
|
|
60
|
+
allowCreate: Boolean,
|
|
61
|
+
loading: Boolean,
|
|
62
|
+
popperClass: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: ""
|
|
65
|
+
},
|
|
66
|
+
popperOptions: {
|
|
67
|
+
type: Object,
|
|
68
|
+
default: () => ({})
|
|
69
|
+
},
|
|
70
|
+
remote: Boolean,
|
|
71
|
+
loadingText: String,
|
|
72
|
+
noMatchText: String,
|
|
73
|
+
noDataText: String,
|
|
74
|
+
remoteMethod: Function,
|
|
75
|
+
filterMethod: Function,
|
|
76
|
+
multiple: Boolean,
|
|
77
|
+
multipleLimit: {
|
|
78
|
+
type: Number,
|
|
79
|
+
default: 0
|
|
80
|
+
},
|
|
81
|
+
placeholder: {
|
|
82
|
+
type: String
|
|
83
|
+
},
|
|
84
|
+
defaultFirstOption: Boolean,
|
|
85
|
+
reserveKeyword: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: !0
|
|
88
|
+
},
|
|
89
|
+
valueKey: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: "value"
|
|
92
|
+
},
|
|
93
|
+
collapseTags: Boolean,
|
|
94
|
+
collapseTagsTooltip: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: !1
|
|
97
|
+
},
|
|
98
|
+
maxCollapseTags: {
|
|
99
|
+
type: Number,
|
|
100
|
+
default: 1
|
|
101
|
+
},
|
|
102
|
+
teleported: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
default: !0
|
|
105
|
+
},
|
|
106
|
+
persistent: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
default: !0
|
|
109
|
+
},
|
|
110
|
+
clearIcon: {
|
|
111
|
+
type: String,
|
|
112
|
+
default: "ico-ep:circle-close"
|
|
113
|
+
},
|
|
114
|
+
fitInputWidth: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: !1
|
|
117
|
+
},
|
|
118
|
+
suffixIcon: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: "ico-ep:arrow-down"
|
|
121
|
+
},
|
|
122
|
+
// eslint-disable-next-line vue/require-prop-types
|
|
123
|
+
tagType: {
|
|
124
|
+
type: String,
|
|
125
|
+
default: "info"
|
|
126
|
+
},
|
|
127
|
+
validateEvent: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
default: !0
|
|
130
|
+
},
|
|
131
|
+
remoteShowSuffix: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
default: !1
|
|
134
|
+
},
|
|
135
|
+
suffixTransition: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
default: !0
|
|
138
|
+
},
|
|
139
|
+
placement: {
|
|
140
|
+
type: String,
|
|
141
|
+
values: He,
|
|
142
|
+
default: "bottom-start"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
emits: [
|
|
146
|
+
c,
|
|
147
|
+
Xe,
|
|
148
|
+
"remove-tag",
|
|
149
|
+
"clear",
|
|
150
|
+
"visible-change",
|
|
151
|
+
"focus",
|
|
152
|
+
"blur"
|
|
153
|
+
],
|
|
154
|
+
setup(e, i) {
|
|
155
|
+
const a = B("select"), V = B("input"), u = et(e), {
|
|
156
|
+
optionList: w,
|
|
157
|
+
optionsArray: M,
|
|
158
|
+
selectSize: m,
|
|
159
|
+
readonly: E,
|
|
160
|
+
handleResize: f,
|
|
161
|
+
collapseTagSize: I,
|
|
162
|
+
debouncedOnInputChange: N,
|
|
163
|
+
debouncedQueryChange: R,
|
|
164
|
+
deletePrevTag: A,
|
|
165
|
+
deleteTag: L,
|
|
166
|
+
deleteSelected: W,
|
|
167
|
+
handleOptionSelect: g,
|
|
168
|
+
scrollToOption: z,
|
|
169
|
+
setSelected: h,
|
|
170
|
+
resetInputHeight: y,
|
|
171
|
+
managePlaceholder: F,
|
|
172
|
+
showClose: P,
|
|
173
|
+
selectDisabled: _,
|
|
174
|
+
iconComponent: D,
|
|
175
|
+
iconReverse: K,
|
|
176
|
+
showNewOption: H,
|
|
177
|
+
emptyText: $,
|
|
178
|
+
toggleLastOptionHitState: k,
|
|
179
|
+
resetInputState: q,
|
|
180
|
+
handleComposition: j,
|
|
181
|
+
onOptionCreate: Q,
|
|
182
|
+
onOptionDestroy: G,
|
|
183
|
+
handleMenuEnter: U,
|
|
184
|
+
handleFocus: J,
|
|
185
|
+
blur: X,
|
|
186
|
+
handleBlur: Y,
|
|
187
|
+
handleClearClick: Z,
|
|
188
|
+
handleClose: ee,
|
|
189
|
+
handleKeydownEscape: te,
|
|
190
|
+
toggleMenu: oe,
|
|
191
|
+
selectOption: le,
|
|
192
|
+
getValueKey: ne,
|
|
193
|
+
navigateOptions: ie,
|
|
194
|
+
dropMenuVisible: ae,
|
|
195
|
+
reference: r,
|
|
196
|
+
input: re,
|
|
197
|
+
iOSInput: se,
|
|
198
|
+
tooltipRef: S,
|
|
199
|
+
tags: ue,
|
|
200
|
+
selectWrapper: p,
|
|
201
|
+
scrollbar: pe,
|
|
202
|
+
queryChange: de,
|
|
203
|
+
groupQueryChange: ce,
|
|
204
|
+
handleMouseEnter: me,
|
|
205
|
+
handleMouseLeave: fe,
|
|
206
|
+
showTagList: ge,
|
|
207
|
+
collapseTagList: he
|
|
208
|
+
} = tt(e, u, i), { focus: ye } = qe(r), {
|
|
209
|
+
inputWidth: l,
|
|
210
|
+
selected: v,
|
|
211
|
+
inputLength: Se,
|
|
212
|
+
filteredOptionsCount: O,
|
|
213
|
+
visible: ve,
|
|
214
|
+
softFocus: Oe,
|
|
215
|
+
selectedLabel: be,
|
|
216
|
+
hoverIndex: b,
|
|
217
|
+
query: Te,
|
|
218
|
+
inputHovering: Ce,
|
|
219
|
+
currentPlaceholder: d,
|
|
220
|
+
menuVisibleOnFocus: Be,
|
|
221
|
+
isOnComposition: xe,
|
|
222
|
+
isSilentBlur: Ve,
|
|
223
|
+
options: T,
|
|
224
|
+
cachedOptions: we,
|
|
225
|
+
optionsCount: Me,
|
|
226
|
+
prefixWidth: C,
|
|
227
|
+
tagInMultiLine: Ee
|
|
228
|
+
} = We(u), Ie = s(() => {
|
|
229
|
+
const t = [a.b()], o = n(m);
|
|
230
|
+
return o && t.push(a.m(o)), e.disabled && t.push(a.m("disabled")), t;
|
|
231
|
+
}), Ne = s(() => ({
|
|
232
|
+
maxWidth: `${n(l) - 32}px`,
|
|
233
|
+
width: "100%"
|
|
234
|
+
})), Re = s(() => ({ maxWidth: `${n(l) > 123 ? n(l) - 123 : n(l) - 75}px` }));
|
|
235
|
+
ze(
|
|
236
|
+
ot,
|
|
237
|
+
Fe({
|
|
238
|
+
props: e,
|
|
239
|
+
options: T,
|
|
240
|
+
optionsArray: M,
|
|
241
|
+
cachedOptions: we,
|
|
242
|
+
optionsCount: Me,
|
|
243
|
+
filteredOptionsCount: O,
|
|
244
|
+
hoverIndex: b,
|
|
245
|
+
handleOptionSelect: g,
|
|
246
|
+
onOptionCreate: Q,
|
|
247
|
+
onOptionDestroy: G,
|
|
248
|
+
selectWrapper: p,
|
|
249
|
+
selected: v,
|
|
250
|
+
setSelected: h,
|
|
251
|
+
queryChange: de,
|
|
252
|
+
groupQueryChange: ce
|
|
253
|
+
})
|
|
254
|
+
), Pe(() => {
|
|
255
|
+
u.cachedPlaceHolder = d.value = e.placeholder || "请选择", e.multiple && Array.isArray(e.modelValue) && e.modelValue.length > 0 && (d.value = ""), De(p, f), e.remote && e.multiple && y(), _e(() => {
|
|
256
|
+
const t = r.value && r.value.$el;
|
|
257
|
+
if (t && (l.value = t.getBoundingClientRect().width, i.slots.prefix)) {
|
|
258
|
+
const o = t.querySelector(`.${V.e("prefix")}`);
|
|
259
|
+
C.value = Math.max(
|
|
260
|
+
o.getBoundingClientRect().width + 5,
|
|
261
|
+
30
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
}), h();
|
|
265
|
+
}), e.multiple && !Array.isArray(e.modelValue) && i.emit(c, []), !e.multiple && Array.isArray(e.modelValue) && i.emit(c, "");
|
|
266
|
+
const Ae = s(() => {
|
|
267
|
+
var t, o;
|
|
268
|
+
return (o = (t = S.value) == null ? void 0 : t.popperRef) == null ? void 0 : o.contentRef;
|
|
269
|
+
});
|
|
270
|
+
return {
|
|
271
|
+
isIOS: Ke,
|
|
272
|
+
onOptionsRendered: (t) => {
|
|
273
|
+
w.value = t;
|
|
274
|
+
},
|
|
275
|
+
tagInMultiLine: Ee,
|
|
276
|
+
prefixWidth: C,
|
|
277
|
+
selectSize: m,
|
|
278
|
+
readonly: E,
|
|
279
|
+
handleResize: f,
|
|
280
|
+
collapseTagSize: I,
|
|
281
|
+
debouncedOnInputChange: N,
|
|
282
|
+
debouncedQueryChange: R,
|
|
283
|
+
deletePrevTag: A,
|
|
284
|
+
deleteTag: L,
|
|
285
|
+
deleteSelected: W,
|
|
286
|
+
handleOptionSelect: g,
|
|
287
|
+
scrollToOption: z,
|
|
288
|
+
inputWidth: l,
|
|
289
|
+
selected: v,
|
|
290
|
+
inputLength: Se,
|
|
291
|
+
filteredOptionsCount: O,
|
|
292
|
+
visible: ve,
|
|
293
|
+
softFocus: Oe,
|
|
294
|
+
selectedLabel: be,
|
|
295
|
+
hoverIndex: b,
|
|
296
|
+
query: Te,
|
|
297
|
+
inputHovering: Ce,
|
|
298
|
+
currentPlaceholder: d,
|
|
299
|
+
menuVisibleOnFocus: Be,
|
|
300
|
+
isOnComposition: xe,
|
|
301
|
+
isSilentBlur: Ve,
|
|
302
|
+
options: T,
|
|
303
|
+
resetInputHeight: y,
|
|
304
|
+
managePlaceholder: F,
|
|
305
|
+
showClose: P,
|
|
306
|
+
selectDisabled: _,
|
|
307
|
+
iconComponent: D,
|
|
308
|
+
iconReverse: K,
|
|
309
|
+
showNewOption: H,
|
|
310
|
+
emptyText: $,
|
|
311
|
+
toggleLastOptionHitState: k,
|
|
312
|
+
resetInputState: q,
|
|
313
|
+
handleComposition: j,
|
|
314
|
+
handleMenuEnter: U,
|
|
315
|
+
handleFocus: J,
|
|
316
|
+
blur: X,
|
|
317
|
+
handleBlur: Y,
|
|
318
|
+
handleClearClick: Z,
|
|
319
|
+
handleClose: ee,
|
|
320
|
+
handleKeydownEscape: te,
|
|
321
|
+
toggleMenu: oe,
|
|
322
|
+
selectOption: le,
|
|
323
|
+
getValueKey: ne,
|
|
324
|
+
navigateOptions: ie,
|
|
325
|
+
dropMenuVisible: ae,
|
|
326
|
+
focus: ye,
|
|
327
|
+
reference: r,
|
|
328
|
+
input: re,
|
|
329
|
+
iOSInput: se,
|
|
330
|
+
tooltipRef: S,
|
|
331
|
+
popperPaneRef: Ae,
|
|
332
|
+
tags: ue,
|
|
333
|
+
selectWrapper: p,
|
|
334
|
+
scrollbar: pe,
|
|
335
|
+
wrapperKls: Ie,
|
|
336
|
+
selectTagsStyle: Ne,
|
|
337
|
+
nsSelect: a,
|
|
338
|
+
tagTextStyle: Re,
|
|
339
|
+
handleMouseEnter: me,
|
|
340
|
+
handleMouseLeave: fe,
|
|
341
|
+
showTagList: ge,
|
|
342
|
+
collapseTagList: he
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
export {
|
|
347
|
+
wt as default
|
|
348
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "vft/theme-style/base.css";
|
|
2
|
+
import "vft/theme-style/vft-input.css";
|
|
3
|
+
import "vft/theme-style/vft-tag.css";
|
|
4
|
+
import "vft/theme-style/el-option.css";
|
|
5
|
+
import "vft/theme-style/el-option-group.css";
|
|
6
|
+
import "vft/theme-style/vft-scrollbar.css";
|
|
7
|
+
import "vft/theme-style/vft-popper.css";
|
|
8
|
+
import "vft/theme-style/el-select.css";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "vft/theme-style/src/base.scss";
|
|
2
|
+
import "vft/theme-style/src/input.scss";
|
|
3
|
+
import "vft/theme-style/src/tag.scss";
|
|
4
|
+
import "vft/theme-style/src/option.scss";
|
|
5
|
+
import "vft/theme-style/src/option-group.scss";
|
|
6
|
+
import "vft/theme-style/src/scrollbar.scss";
|
|
7
|
+
import "vft/theme-style/src/popper.scss";
|
|
8
|
+
import "vft/theme-style/src/select.scss";
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { inject as b, computed as n, getCurrentInstance as C, toRaw as v, watch as s, unref as S } from "vue";
|
|
2
|
+
import { get as c } from "lodash";
|
|
3
|
+
import "@vft/utils";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import { escapeStringRegexp as w } from "../../utils/vue/data-helper.js";
|
|
6
|
+
import "../../utils/ns-cover.js";
|
|
7
|
+
import { selectKey as D, selectGroupKey as L } from "./token.js";
|
|
8
|
+
function k(r, u) {
|
|
9
|
+
const e = b(D), a = b(L, { disabled: !1 }), m = n(() => Object.prototype.toString.call(r.value).toLowerCase() === "[object object]"), f = n(() => e.props.multiple ? j(e.props.modelValue, r.value) : O(r.value, e.props.modelValue)), y = n(() => {
|
|
10
|
+
if (e.props.multiple) {
|
|
11
|
+
const t = e.props.modelValue || [];
|
|
12
|
+
return !f.value && t.length >= e.props.multipleLimit && e.props.multipleLimit > 0;
|
|
13
|
+
} else
|
|
14
|
+
return !1;
|
|
15
|
+
}), p = n(() => r.label || (m.value ? "" : r.value)), g = n(() => r.value || r.label || ""), x = n(() => r.disabled || u.groupDisabled || y.value), d = C(), j = (t = [], o) => {
|
|
16
|
+
if (m.value) {
|
|
17
|
+
const i = e.props.valueKey;
|
|
18
|
+
return t && t.some((l) => v(c(l, i)) === c(o, i));
|
|
19
|
+
} else
|
|
20
|
+
return t && t.includes(o);
|
|
21
|
+
}, O = (t, o) => {
|
|
22
|
+
if (m.value) {
|
|
23
|
+
const { valueKey: i } = e.props;
|
|
24
|
+
return c(t, i) === c(o, i);
|
|
25
|
+
} else
|
|
26
|
+
return t === o;
|
|
27
|
+
}, h = () => {
|
|
28
|
+
!r.disabled && !a.disabled && (e.hoverIndex = e.optionsArray.indexOf(d.proxy));
|
|
29
|
+
};
|
|
30
|
+
s(
|
|
31
|
+
() => p.value,
|
|
32
|
+
() => {
|
|
33
|
+
!r.created && !e.props.remote && e.setSelected();
|
|
34
|
+
}
|
|
35
|
+
), s(
|
|
36
|
+
() => r.value,
|
|
37
|
+
(t, o) => {
|
|
38
|
+
const { remote: i, valueKey: l } = e.props;
|
|
39
|
+
if (Object.is(t, o) || (e.onOptionDestroy(o, d.proxy), e.onOptionCreate(d.proxy)), !r.created && !i) {
|
|
40
|
+
if (l && typeof t == "object" && typeof o == "object" && t[l] === o[l])
|
|
41
|
+
return;
|
|
42
|
+
e.setSelected();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
), s(
|
|
46
|
+
() => a.disabled,
|
|
47
|
+
() => {
|
|
48
|
+
u.groupDisabled = a.disabled;
|
|
49
|
+
},
|
|
50
|
+
{ immediate: !0 }
|
|
51
|
+
);
|
|
52
|
+
const { queryChange: K } = v(e);
|
|
53
|
+
return s(
|
|
54
|
+
K,
|
|
55
|
+
(t) => {
|
|
56
|
+
const { query: o } = S(t), i = new RegExp(w(o), "i");
|
|
57
|
+
u.visible = i.test(p.value) || r.created, u.visible || e.filteredOptionsCount--;
|
|
58
|
+
},
|
|
59
|
+
{ immediate: !0 }
|
|
60
|
+
), {
|
|
61
|
+
select: e,
|
|
62
|
+
currentLabel: p,
|
|
63
|
+
currentValue: g,
|
|
64
|
+
itemSelected: f,
|
|
65
|
+
isDisabled: x,
|
|
66
|
+
hoverItem: h
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
k as useOption
|
|
71
|
+
};
|