@aifuxi/semi-ui-vue 0.1.0-alpha.0
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/LICENSE +21 -0
- package/README.md +22 -0
- package/dist/Button-RCaDTqHh.js +249 -0
- package/dist/Collapsible-DeV0aJ4n.js +199 -0
- package/dist/Cropper-Dy1LPBDN.js +587 -0
- package/dist/Divider-BQmwhGfH.js +57 -0
- package/dist/Input-BYWFIgNn.js +593 -0
- package/dist/InputNumber-BaeViVtG.js +856 -0
- package/dist/Modal-BhmFYVFw.js +975 -0
- package/dist/Pagination-4JvS-gHR.js +572 -0
- package/dist/Progress-BulSV_JR.js +523 -0
- package/dist/SBOM.spdx.json +165 -0
- package/dist/SelectOption-Ce-Lst-e.js +1473 -0
- package/dist/Slider-w9sbxzBw.js +707 -0
- package/dist/Spin-CuFLkqev.js +222 -0
- package/dist/THIRD_PARTY_LICENSES/Semi-Design.txt +83 -0
- package/dist/THIRD_PARTY_LICENSES/async-validator.txt +9 -0
- package/dist/THIRD_PARTY_LICENSES/bezier-easing.txt +22 -0
- package/dist/THIRD_PARTY_LICENSES/date-fns-tz.txt +21 -0
- package/dist/THIRD_PARTY_LICENSES/date-fns.txt +21 -0
- package/dist/THIRD_PARTY_LICENSES/lodash.txt +47 -0
- package/dist/THIRD_PARTY_LICENSES/scroll-into-view-if-needed.txt +21 -0
- package/dist/THIRD_PARTY_NOTICES.md +23 -0
- package/dist/Tooltip-Bq7HZwnS.js +1321 -0
- package/dist/Tree-tqy5xBYJ.js +1275 -0
- package/dist/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
- package/dist/anchor/Anchor.vue.d.ts +29 -0
- package/dist/anchor/AnchorLink.vue.d.ts +16 -0
- package/dist/anchor/AnchorNodeRenderer.d.ts +15 -0
- package/dist/anchor/anchor-context.d.ts +18 -0
- package/dist/anchor/index.d.ts +11 -0
- package/dist/anchor/index.js +2 -0
- package/dist/anchor/types.d.ts +43 -0
- package/dist/anchor-DW0p2t-I.js +503 -0
- package/dist/arrayMove-ByVCXfhS.js +7 -0
- package/dist/auto-complete/AutoComplete.vue.d.ts +33 -0
- package/dist/auto-complete/AutoCompleteNodeRenderer.d.ts +15 -0
- package/dist/auto-complete/AutoCompleteOption.vue.d.ts +19 -0
- package/dist/auto-complete/index.d.ts +10 -0
- package/dist/auto-complete/index.js +2 -0
- package/dist/auto-complete/types.d.ts +117 -0
- package/dist/auto-complete/use-auto-complete-foundation.d.ts +40 -0
- package/dist/auto-complete-BeahBlt9.js +765 -0
- package/dist/avatar/Avatar.vue.d.ts +26 -0
- package/dist/avatar/AvatarGroup.d.ts +54 -0
- package/dist/avatar/AvatarNodeRenderer.d.ts +15 -0
- package/dist/avatar/TopSlotSvg.vue.d.ts +7 -0
- package/dist/avatar/index.d.ts +10 -0
- package/dist/avatar/index.js +2 -0
- package/dist/avatar/types.d.ts +86 -0
- package/dist/avatar-B00xjEzD.js +551 -0
- package/dist/back-top/BackTop.vue.d.ts +19 -0
- package/dist/back-top/index.d.ts +3 -0
- package/dist/back-top/index.js +2 -0
- package/dist/back-top/types.d.ts +15 -0
- package/dist/back-top-C2XqUzoN.js +123 -0
- package/dist/badge/Badge.vue.d.ts +23 -0
- package/dist/badge/BadgeNodeRenderer.d.ts +15 -0
- package/dist/badge/index.d.ts +6 -0
- package/dist/badge/index.js +2 -0
- package/dist/badge/types.d.ts +29 -0
- package/dist/badge-gWsDkzyt.js +120 -0
- package/dist/banner/Banner.vue.d.ts +19 -0
- package/dist/banner/BannerNodeRenderer.d.ts +15 -0
- package/dist/banner/index.d.ts +6 -0
- package/dist/banner/index.js +2 -0
- package/dist/banner/types.d.ts +25 -0
- package/dist/banner-B3O4uDoR.js +220 -0
- package/dist/breadcrumb/Breadcrumb.d.ts +129 -0
- package/dist/breadcrumb/BreadcrumbIconRenderer.d.ts +23 -0
- package/dist/breadcrumb/BreadcrumbItem.vue.d.ts +19 -0
- package/dist/breadcrumb/BreadcrumbNodeRenderer.d.ts +15 -0
- package/dist/breadcrumb/BreadcrumbPopover.vue.d.ts +17 -0
- package/dist/breadcrumb/BreadcrumbPopoverArrow.vue.d.ts +3 -0
- package/dist/breadcrumb/breadcrumb-context.d.ts +9 -0
- package/dist/breadcrumb/index.d.ts +11 -0
- package/dist/breadcrumb/index.js +2 -0
- package/dist/breadcrumb/types.d.ts +72 -0
- package/dist/breadcrumb-BmBbFmGK.js +451 -0
- package/dist/button/Button.vue.d.ts +34 -0
- package/dist/button/ButtonAiLoadingIcon.vue.d.ts +3 -0
- package/dist/button/ButtonGroup.d.ts +69 -0
- package/dist/button/ButtonIconRenderer.d.ts +28 -0
- package/dist/button/ButtonLoadingIcon.vue.d.ts +3 -0
- package/dist/button/SplitButtonGroup.vue.d.ts +16 -0
- package/dist/button/index.d.ts +5 -0
- package/dist/button/index.js +3 -0
- package/dist/button/types.d.ts +57 -0
- package/dist/button-Rcn5pYGh.js +134 -0
- package/dist/calendar/Calendar.vue.d.ts +29 -0
- package/dist/calendar/CalendarDay.vue.d.ts +3 -0
- package/dist/calendar/CalendarMonth.vue.d.ts +3 -0
- package/dist/calendar/CalendarNodeRenderer.d.ts +15 -0
- package/dist/calendar/CalendarTimeColumn.vue.d.ts +6 -0
- package/dist/calendar/CalendarWeek.vue.d.ts +8 -0
- package/dist/calendar/index.d.ts +6 -0
- package/dist/calendar/index.js +2 -0
- package/dist/calendar/types.d.ts +67 -0
- package/dist/calendar-CJTrr4y5.js +1172 -0
- package/dist/card/Card.vue.d.ts +16 -0
- package/dist/card/CardGroup.vue.d.ts +13 -0
- package/dist/card/CardMeta.vue.d.ts +11 -0
- package/dist/card/CardNodeRenderer.d.ts +15 -0
- package/dist/card/CardSkeleton.vue.d.ts +3 -0
- package/dist/card/card-content.d.ts +2 -0
- package/dist/card/index.d.ts +11 -0
- package/dist/card/index.js +2 -0
- package/dist/card/types.d.ts +56 -0
- package/dist/card-DwMOFi6_.js +348 -0
- package/dist/carousel/Carousel.vue.d.ts +29 -0
- package/dist/carousel/CarouselArrow.vue.d.ts +15 -0
- package/dist/carousel/CarouselIndicator.vue.d.ts +17 -0
- package/dist/carousel/CarouselItemRenderer.d.ts +34 -0
- package/dist/carousel/CarouselNodeRenderer.d.ts +15 -0
- package/dist/carousel/index.d.ts +6 -0
- package/dist/carousel/index.js +2 -0
- package/dist/carousel/types.d.ts +70 -0
- package/dist/carousel/use-carousel-foundation.d.ts +19 -0
- package/dist/carousel-B4WlIRJH.js +458 -0
- package/dist/cascader/Cascader.vue.d.ts +71 -0
- package/dist/cascader/CascaderNodeRenderer.d.ts +15 -0
- package/dist/cascader/CascaderPanel.vue.d.ts +36 -0
- package/dist/cascader/index.d.ts +6 -0
- package/dist/cascader/index.js +2 -0
- package/dist/cascader/types.d.ts +192 -0
- package/dist/cascader-Ch6clCeh.js +1525 -0
- package/dist/checkbox/Checkbox.vue.d.ts +19 -0
- package/dist/checkbox/CheckboxGroup.d.ts +161 -0
- package/dist/checkbox/CheckboxNodeRenderer.d.ts +15 -0
- package/dist/checkbox/checkbox-context.d.ts +11 -0
- package/dist/checkbox/index.d.ts +10 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox/types.d.ts +92 -0
- package/dist/checkbox-mJD1ou6k.js +479 -0
- package/dist/collapse/Collapse.vue.d.ts +140 -0
- package/dist/collapse/CollapseNodeRenderer.d.ts +15 -0
- package/dist/collapse/CollapsePanel.vue.d.ts +99 -0
- package/dist/collapse/collapse-context.d.ts +14 -0
- package/dist/collapse/index.d.ts +10 -0
- package/dist/collapse/index.js +2 -0
- package/dist/collapse/types.d.ts +50 -0
- package/dist/collapse-7YtQLWqt.js +278 -0
- package/dist/collapsible/Collapsible.vue.d.ts +136 -0
- package/dist/collapsible/index.d.ts +5 -0
- package/dist/collapsible/index.js +5 -0
- package/dist/collapsible/types.d.ts +28 -0
- package/dist/color-picker/AlphaSlider.vue.d.ts +14 -0
- package/dist/color-picker/ColorChooseArea.vue.d.ts +20 -0
- package/dist/color-picker/ColorDataPart.vue.d.ts +15 -0
- package/dist/color-picker/ColorPicker.vue.d.ts +28 -0
- package/dist/color-picker/ColorPickerNodeRenderer.d.ts +17 -0
- package/dist/color-picker/ColorPickerPanel.vue.d.ts +37 -0
- package/dist/color-picker/ColorSlider.vue.d.ts +13 -0
- package/dist/color-picker/index.d.ts +10 -0
- package/dist/color-picker/index.js +2 -0
- package/dist/color-picker/types.d.ts +67 -0
- package/dist/color-picker-ChC7qsx0.js +885 -0
- package/dist/config-context-CyynTtDb.js +4 -0
- package/dist/config-provider/ConfigConsumer.vue.d.ts +11 -0
- package/dist/config-provider/ConfigProvider.vue.d.ts +16 -0
- package/dist/config-provider/config-context.d.ts +3 -0
- package/dist/config-provider/constants.d.ts +4 -0
- package/dist/config-provider/index.d.ts +13 -0
- package/dist/config-provider/index.js +3 -0
- package/dist/config-provider/semi-global.d.ts +6 -0
- package/dist/config-provider/types.d.ts +74 -0
- package/dist/config-provider/use-responsive-observe.d.ts +6 -0
- package/dist/config-provider-VMfNNSF1.js +188 -0
- package/dist/constants-BF9bZJyc.js +45 -0
- package/dist/constants-BNwzO87W.js +9 -0
- package/dist/cropper/Cropper.vue.d.ts +18 -0
- package/dist/cropper/index.d.ts +4 -0
- package/dist/cropper/index.js +5 -0
- package/dist/cropper/types.d.ts +51 -0
- package/dist/date-picker/DatePicker.vue.d.ts +41 -0
- package/dist/date-picker/DatePickerMonth.vue.d.ts +25 -0
- package/dist/date-picker/DatePickerNodeRenderer.d.ts +17 -0
- package/dist/date-picker/DatePickerPanel.vue.d.ts +33 -0
- package/dist/date-picker/index.d.ts +5 -0
- package/dist/date-picker/index.js +2 -0
- package/dist/date-picker/types.d.ts +211 -0
- package/dist/date-picker-B2lhlKHD.js +2207 -0
- package/dist/descriptions/Descriptions.vue.d.ts +96 -0
- package/dist/descriptions/DescriptionsItem.vue.d.ts +96 -0
- package/dist/descriptions/DescriptionsNodeRenderer.d.ts +15 -0
- package/dist/descriptions/descriptions-context.d.ts +7 -0
- package/dist/descriptions/index.d.ts +10 -0
- package/dist/descriptions/index.js +2 -0
- package/dist/descriptions/types.d.ts +45 -0
- package/dist/descriptions-BU6ahbge.js +272 -0
- package/dist/divider/Divider.vue.d.ts +15 -0
- package/dist/divider/DividerContentRenderer.d.ts +17 -0
- package/dist/divider/index.d.ts +3 -0
- package/dist/divider/index.js +3 -0
- package/dist/divider/types.d.ts +13 -0
- package/dist/divider-DA9U4uOl.js +8 -0
- package/dist/dropdown/Dropdown.vue.d.ts +23 -0
- package/dist/dropdown/DropdownDivider.vue.d.ts +4 -0
- package/dist/dropdown/DropdownItem.vue.d.ts +28 -0
- package/dist/dropdown/DropdownMenu.vue.d.ts +11 -0
- package/dist/dropdown/DropdownNodeRenderer.d.ts +15 -0
- package/dist/dropdown/DropdownTitle.vue.d.ts +11 -0
- package/dist/dropdown/DropdownTriggerRenderer.d.ts +45 -0
- package/dist/dropdown/dropdown-context.d.ts +8 -0
- package/dist/dropdown/index.d.ts +17 -0
- package/dist/dropdown/index.js +2 -0
- package/dist/dropdown/types.d.ts +98 -0
- package/dist/dropdown-D0-UWd65.js +665 -0
- package/dist/empty/Empty.vue.d.ts +13 -0
- package/dist/empty/EmptyNodeRenderer.d.ts +15 -0
- package/dist/empty/index.d.ts +6 -0
- package/dist/empty/index.js +2 -0
- package/dist/empty/types.d.ts +27 -0
- package/dist/empty-Bpms8Z5w.js +152 -0
- package/dist/env-BeIzjQx7.js +4 -0
- package/dist/es-CAWQuPuV.js +93 -0
- package/dist/float-button/FloatButton.vue.d.ts +20 -0
- package/dist/float-button/FloatButtonBadge.vue.d.ts +18 -0
- package/dist/float-button/FloatButtonGroup.vue.d.ts +17 -0
- package/dist/float-button/FloatButtonNodeRenderer.d.ts +17 -0
- package/dist/float-button/index.d.ts +4 -0
- package/dist/float-button/index.js +2 -0
- package/dist/float-button/types.d.ts +59 -0
- package/dist/float-button-qU3b0WBX.js +190 -0
- package/dist/form/ArrayField.d.ts +24 -0
- package/dist/form/Form.vue.d.ts +38 -0
- package/dist/form/FormErrorMessage.vue.d.ts +4 -0
- package/dist/form/FormField.d.ts +9 -0
- package/dist/form/FormInputGroup.d.ts +62 -0
- package/dist/form/FormLabel.vue.d.ts +18 -0
- package/dist/form/FormNodeRenderer.d.ts +15 -0
- package/dist/form/FormSection.vue.d.ts +16 -0
- package/dist/form/FormSlot.d.ts +3 -0
- package/dist/form/form-context.d.ts +4 -0
- package/dist/form/index.d.ts +68 -0
- package/dist/form/index.js +3 -0
- package/dist/form/internal-types.d.ts +67 -0
- package/dist/form/types.d.ts +273 -0
- package/dist/form/use-form.d.ts +11 -0
- package/dist/form/with-form.d.ts +3 -0
- package/dist/form-CLhGuORQ.js +2030 -0
- package/dist/foundation-Cawx37mp.js +1819 -0
- package/dist/grid/Col.vue.d.ts +13 -0
- package/dist/grid/Row.vue.d.ts +14 -0
- package/dist/grid/grid-context.d.ts +6 -0
- package/dist/grid/index.d.ts +5 -0
- package/dist/grid/index.js +2 -0
- package/dist/grid/media-query.d.ts +2 -0
- package/dist/grid/types.d.ts +44 -0
- package/dist/grid-Cn2uBhRd.js +161 -0
- package/dist/highlight/Highlight.vue.d.ts +10 -0
- package/dist/highlight/HighlightNodeRenderer.d.ts +49 -0
- package/dist/highlight/index.d.ts +4 -0
- package/dist/highlight/index.js +2 -0
- package/dist/highlight/internal-types.d.ts +8 -0
- package/dist/highlight/types.d.ts +17 -0
- package/dist/highlight-DHX3RV0C.js +158 -0
- package/dist/icon/index.d.ts +2 -0
- package/dist/icon/index.js +2 -0
- package/dist/image/Image.vue.d.ts +21 -0
- package/dist/image/ImageNodeRenderer.d.ts +15 -0
- package/dist/image/ImagePreview.vue.d.ts +56 -0
- package/dist/image/ImagePreviewFooter.vue.d.ts +38 -0
- package/dist/image/ImagePreviewHeader.vue.d.ts +17 -0
- package/dist/image/ImagePreviewImage.vue.d.ts +27 -0
- package/dist/image/ImagePreviewInner.vue.d.ts +54 -0
- package/dist/image/image-context.d.ts +14 -0
- package/dist/image/index.d.ts +6 -0
- package/dist/image/index.js +2 -0
- package/dist/image/types.d.ts +183 -0
- package/dist/image-C-ifCh_9.js +1615 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +75 -0
- package/dist/input/Input.vue.d.ts +58 -0
- package/dist/input/InputGroup.d.ts +69 -0
- package/dist/input/InputNodeRenderer.d.ts +15 -0
- package/dist/input/TextArea.vue.d.ts +50 -0
- package/dist/input/index.d.ts +11 -0
- package/dist/input/index.js +2 -0
- package/dist/input/types.d.ts +168 -0
- package/dist/input-number/InputNumber.vue.d.ts +52 -0
- package/dist/input-number/index.d.ts +10 -0
- package/dist/input-number/index.js +5 -0
- package/dist/input-number/types.d.ts +56 -0
- package/dist/input-wf0nZCRS.js +747 -0
- package/dist/isBefore-BG1hiM9f.js +37 -0
- package/dist/isElement-Cx0AsIov.js +11 -0
- package/dist/isEnterPress-HTy0eCBp.js +8 -0
- package/dist/isNullOrUndefined-Cg6MZ8r3.js +6 -0
- package/dist/isPromise-D2v3Ejff.js +11 -0
- package/dist/keyCode-DMNg63wX.js +110 -0
- package/dist/layout/Layout.vue.d.ts +14 -0
- package/dist/layout/LayoutContent.vue.d.ts +14 -0
- package/dist/layout/LayoutFooter.vue.d.ts +14 -0
- package/dist/layout/LayoutHeader.vue.d.ts +14 -0
- package/dist/layout/LayoutSection.vue.d.ts +17 -0
- package/dist/layout/LayoutSider.vue.d.ts +18 -0
- package/dist/layout/index.d.ts +17 -0
- package/dist/layout/index.js +2 -0
- package/dist/layout/layout-context.d.ts +6 -0
- package/dist/layout/media-query.d.ts +4 -0
- package/dist/layout/types.d.ts +31 -0
- package/dist/layout-tq-_l_O3.js +171 -0
- package/dist/list/List.vue.d.ts +22 -0
- package/dist/list/ListItem.vue.d.ts +88 -0
- package/dist/list/ListNodeRenderer.d.ts +15 -0
- package/dist/list/ListSpin.vue.d.ts +16 -0
- package/dist/list/index.d.ts +10 -0
- package/dist/list/index.js +2 -0
- package/dist/list/list-context.d.ts +8 -0
- package/dist/list/types.d.ts +66 -0
- package/dist/list-DHIOE2Y-.js +387 -0
- package/dist/modal/ConfirmModal.vue.d.ts +14 -0
- package/dist/modal/Modal.vue.d.ts +15 -0
- package/dist/modal/ModalDefaultFooter.vue.d.ts +22 -0
- package/dist/modal/ModalDialog.vue.d.ts +53 -0
- package/dist/modal/ModalInnerContent.vue.d.ts +38 -0
- package/dist/modal/ModalNodeRenderer.d.ts +15 -0
- package/dist/modal/imperative.d.ts +9 -0
- package/dist/modal/index.d.ts +8 -0
- package/dist/modal/index.js +2 -0
- package/dist/modal/types.d.ts +92 -0
- package/dist/modal/use-modal.d.ts +2 -0
- package/dist/modal-YVolL7Hz.js +221 -0
- package/dist/navigation/CollapseButton.vue.d.ts +12 -0
- package/dist/navigation/NavFooter.vue.d.ts +15 -0
- package/dist/navigation/NavHeader.vue.d.ts +13 -0
- package/dist/navigation/NavItem.d.ts +177 -0
- package/dist/navigation/Navigation.vue.d.ts +29 -0
- package/dist/navigation/NavigationContextProvider.d.ts +16 -0
- package/dist/navigation/NavigationIconRenderer.d.ts +45 -0
- package/dist/navigation/NavigationItemTree.vue.d.ts +8 -0
- package/dist/navigation/NavigationNodeRenderer.d.ts +18 -0
- package/dist/navigation/SubNav.vue.d.ts +18 -0
- package/dist/navigation/index.d.ts +14 -0
- package/dist/navigation/index.js +2 -0
- package/dist/navigation/navigation-context.d.ts +35 -0
- package/dist/navigation/types.d.ts +177 -0
- package/dist/navigation-DF8R5jFK.js +1479 -0
- package/dist/notification/NotificationHost.vue.d.ts +7 -0
- package/dist/notification/NotificationNodeRenderer.d.ts +15 -0
- package/dist/notification/NotificationNotice.vue.d.ts +16 -0
- package/dist/notification/imperative.d.ts +12 -0
- package/dist/notification/index.d.ts +6 -0
- package/dist/notification/index.js +2 -0
- package/dist/notification/notification-store.d.ts +24 -0
- package/dist/notification/types.d.ts +63 -0
- package/dist/notification/use-notification.d.ts +2 -0
- package/dist/notification-DIsvgiIO.js +445 -0
- package/dist/overflow-list/OverflowList.vue.d.ts +131 -0
- package/dist/overflow-list/OverflowListNodeRenderer.d.ts +35 -0
- package/dist/overflow-list/index.d.ts +5 -0
- package/dist/overflow-list/index.js +2 -0
- package/dist/overflow-list/types.d.ts +35 -0
- package/dist/overflow-list-Df6ixrtB.js +413 -0
- package/dist/pagination/Pagination.vue.d.ts +25 -0
- package/dist/pagination/PaginationNodeRenderer.d.ts +15 -0
- package/dist/pagination/PaginationPopover.vue.d.ts +25 -0
- package/dist/pagination/PaginationRestList.vue.d.ts +11 -0
- package/dist/pagination/index.d.ts +3 -0
- package/dist/pagination/index.js +2 -0
- package/dist/pagination/types.d.ts +46 -0
- package/dist/pin-code/PinCode.vue.d.ts +20 -0
- package/dist/pin-code/index.d.ts +10 -0
- package/dist/pin-code/index.js +2 -0
- package/dist/pin-code/types.d.ts +25 -0
- package/dist/pin-code-wY5g0KLD.js +193 -0
- package/dist/popconfirm/Popconfirm.vue.d.ts +25 -0
- package/dist/popconfirm/PopconfirmNodeRenderer.d.ts +15 -0
- package/dist/popconfirm/index.d.ts +4 -0
- package/dist/popconfirm/index.js +2 -0
- package/dist/popconfirm/types.d.ts +57 -0
- package/dist/popconfirm-DQUtvI0A.js +389 -0
- package/dist/popover/Popover.vue.d.ts +23 -0
- package/dist/popover/PopoverArrow.vue.d.ts +10 -0
- package/dist/popover/index.d.ts +4 -0
- package/dist/popover/index.js +2 -0
- package/dist/popover/types.d.ts +35 -0
- package/dist/popover-hD77YpUM.js +292 -0
- package/dist/progress/Progress.vue.d.ts +24 -0
- package/dist/progress/ProgressCircle.vue.d.ts +26 -0
- package/dist/progress/ProgressLine.vue.d.ts +23 -0
- package/dist/progress/ProgressNodeRenderer.d.ts +15 -0
- package/dist/progress/index.d.ts +6 -0
- package/dist/progress/index.js +2 -0
- package/dist/progress/types.d.ts +44 -0
- package/dist/progress-DIIyWKKD.js +9 -0
- package/dist/radio/Radio.vue.d.ts +30 -0
- package/dist/radio/RadioGroup.d.ts +201 -0
- package/dist/radio/RadioNodeRenderer.d.ts +15 -0
- package/dist/radio/index.d.ts +10 -0
- package/dist/radio/index.js +2 -0
- package/dist/radio/radio-context.d.ts +15 -0
- package/dist/radio/types.d.ts +100 -0
- package/dist/radio-y9iAI359.js +565 -0
- package/dist/rating/Rating.vue.d.ts +39 -0
- package/dist/rating/RatingItem.vue.d.ts +33 -0
- package/dist/rating/RatingNodeRenderer.d.ts +17 -0
- package/dist/rating/index.d.ts +6 -0
- package/dist/rating/index.js +2 -0
- package/dist/rating/types.d.ts +57 -0
- package/dist/rating-CJkb4pkD.js +542 -0
- package/dist/resizable/Resizable.vue.d.ts +31 -0
- package/dist/resizable/ResizableNodeRenderer.d.ts +17 -0
- package/dist/resizable/ResizeGroup.vue.d.ts +13 -0
- package/dist/resizable/ResizeHandler.vue.d.ts +11 -0
- package/dist/resizable/ResizeItem.vue.d.ts +19 -0
- package/dist/resizable/SingleResizeHandle.vue.d.ts +21 -0
- package/dist/resizable/index.d.ts +6 -0
- package/dist/resizable/index.js +2 -0
- package/dist/resizable/resizable-context.d.ts +27 -0
- package/dist/resizable/types.d.ts +87 -0
- package/dist/resizable/use-resize-group.d.ts +21 -0
- package/dist/resizable/use-single-resize.d.ts +30 -0
- package/dist/resizable-CEB0ZdGT.js +814 -0
- package/dist/scroll-list/ScrollItem.vue.d.ts +21 -0
- package/dist/scroll-list/ScrollList.vue.d.ts +11 -0
- package/dist/scroll-list/ScrollListNodeRenderer.d.ts +15 -0
- package/dist/scroll-list/index.d.ts +10 -0
- package/dist/scroll-list/index.js +2 -0
- package/dist/scroll-list/types.d.ts +54 -0
- package/dist/scroll-list-BSXksNOR.js +466 -0
- package/dist/select/Select.vue.d.ts +39 -0
- package/dist/select/SelectFragment.d.ts +4 -0
- package/dist/select/SelectNodeRenderer.d.ts +15 -0
- package/dist/select/SelectOption.vue.d.ts +13 -0
- package/dist/select/SelectOptionCollector.d.ts +13 -0
- package/dist/select/SelectOptionGroup.vue.d.ts +14 -0
- package/dist/select/index.d.ts +12 -0
- package/dist/select/index.js +3 -0
- package/dist/select/types.d.ts +165 -0
- package/dist/select/use-select-foundation.d.ts +64 -0
- package/dist/select-BeM6gxAU.js +40 -0
- package/dist/side-sheet/SideSheet.vue.d.ts +19 -0
- package/dist/side-sheet/SideSheetContent.vue.d.ts +37 -0
- package/dist/side-sheet/SideSheetNodeRenderer.d.ts +15 -0
- package/dist/side-sheet/index.d.ts +4 -0
- package/dist/side-sheet/index.js +2 -0
- package/dist/side-sheet/types.d.ts +46 -0
- package/dist/side-sheet-9CBTk23r.js +542 -0
- package/dist/skeleton/Skeleton.vue.d.ts +15 -0
- package/dist/skeleton/SkeletonAvatar.vue.d.ts +9 -0
- package/dist/skeleton/SkeletonButton.vue.d.ts +7 -0
- package/dist/skeleton/SkeletonImage.vue.d.ts +7 -0
- package/dist/skeleton/SkeletonNodeRenderer.d.ts +15 -0
- package/dist/skeleton/SkeletonParagraph.vue.d.ts +8 -0
- package/dist/skeleton/SkeletonTitle.vue.d.ts +7 -0
- package/dist/skeleton/index.d.ts +18 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/skeleton/types.d.ts +36 -0
- package/dist/skeleton-p61lfhoz.js +302 -0
- package/dist/slider/Slider.vue.d.ts +32 -0
- package/dist/slider/SliderFragment.d.ts +4 -0
- package/dist/slider/index.d.ts +5 -0
- package/dist/slider/index.js +5 -0
- package/dist/slider/types.d.ts +57 -0
- package/dist/slider/use-slider-foundation.d.ts +47 -0
- package/dist/space/Space.vue.d.ts +16 -0
- package/dist/space/index.d.ts +3 -0
- package/dist/space/index.js +2 -0
- package/dist/space/types.d.ts +15 -0
- package/dist/space-DVnFbkCz.js +63 -0
- package/dist/spin/Spin.vue.d.ts +105 -0
- package/dist/spin/SpinNodeRenderer.d.ts +15 -0
- package/dist/spin/index.d.ts +6 -0
- package/dist/spin/index.js +2 -0
- package/dist/spin/types.d.ts +20 -0
- package/dist/spin-D-1P0WMW.js +9 -0
- package/dist/src-DNBBthjO.js +490 -0
- package/dist/steps/Step.vue.d.ts +22 -0
- package/dist/steps/Steps.vue.d.ts +24 -0
- package/dist/steps/StepsNodeRenderer.d.ts +17 -0
- package/dist/steps/index.d.ts +9 -0
- package/dist/steps/index.js +2 -0
- package/dist/steps/steps-context.d.ts +6 -0
- package/dist/steps/types.d.ts +54 -0
- package/dist/steps-6p04q-Lz.js +303 -0
- package/dist/switch/Switch.vue.d.ts +27 -0
- package/dist/switch/SwitchNodeRenderer.d.ts +15 -0
- package/dist/switch/SwitchSpin.vue.d.ts +7 -0
- package/dist/switch/index.d.ts +7 -0
- package/dist/switch/index.js +2 -0
- package/dist/switch/types.d.ts +28 -0
- package/dist/switch-Dte2Fl3l.js +284 -0
- package/dist/table/Table.vue.d.ts +29 -0
- package/dist/table/TableBody.vue.d.ts +70 -0
- package/dist/table/TableCell.vue.d.ts +37 -0
- package/dist/table/TableColumn.d.ts +81 -0
- package/dist/table/TableFilterMenu.vue.d.ts +18 -0
- package/dist/table/TableHeader.vue.d.ts +46 -0
- package/dist/table/TableNativeElement.d.ts +9 -0
- package/dist/table/TableNodeRenderer.d.ts +13 -0
- package/dist/table/TableSpin.vue.d.ts +16 -0
- package/dist/table/index.d.ts +13 -0
- package/dist/table/index.js +2 -0
- package/dist/table/table-utils.d.ts +43 -0
- package/dist/table/types.d.ts +323 -0
- package/dist/table-jZkHjf-W.js +2097 -0
- package/dist/tabs/TabBar.vue.d.ts +38 -0
- package/dist/tabs/TabItem.vue.d.ts +26 -0
- package/dist/tabs/TabPane.vue.d.ts +13 -0
- package/dist/tabs/Tabs.vue.d.ts +36 -0
- package/dist/tabs/TabsDropdown.vue.d.ts +27 -0
- package/dist/tabs/TabsNodeRenderer.d.ts +15 -0
- package/dist/tabs/index.d.ts +6 -0
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/tabs-context.d.ts +12 -0
- package/dist/tabs/types.d.ts +110 -0
- package/dist/tabs-CezuYzIu.js +874 -0
- package/dist/tag/SplitTagGroup.d.ts +36 -0
- package/dist/tag/Tag.vue.d.ts +33 -0
- package/dist/tag/TagGroup.d.ts +115 -0
- package/dist/tag/TagNodeRenderer.d.ts +15 -0
- package/dist/tag/index.d.ts +8 -0
- package/dist/tag/index.js +2 -0
- package/dist/tag/types.d.ts +82 -0
- package/dist/tag-BPD0bELU.js +348 -0
- package/dist/tag-input/TagInput.vue.d.ts +51 -0
- package/dist/tag-input/TagInputNodeRenderer.d.ts +17 -0
- package/dist/tag-input/TagInputRestPopover.vue.d.ts +19 -0
- package/dist/tag-input/TagInputTag.vue.d.ts +27 -0
- package/dist/tag-input/index.d.ts +5 -0
- package/dist/tag-input/index.js +2 -0
- package/dist/tag-input/types.d.ts +95 -0
- package/dist/tag-input/use-tag-input-foundation.d.ts +47 -0
- package/dist/tag-input-SxUfNqF0.js +784 -0
- package/dist/time-picker/TimePicker.vue.d.ts +27 -0
- package/dist/time-picker/TimePickerColumn.vue.d.ts +29 -0
- package/dist/time-picker/TimePickerNodeRenderer.d.ts +17 -0
- package/dist/time-picker/TimePickerPanel.vue.d.ts +32 -0
- package/dist/time-picker/index.d.ts +5 -0
- package/dist/time-picker/index.js +2 -0
- package/dist/time-picker/types.d.ts +146 -0
- package/dist/time-picker/use-time-picker-foundation.d.ts +36 -0
- package/dist/time-picker-D6p36ea8.js +3587 -0
- package/dist/timeline/Timeline.vue.d.ts +69 -0
- package/dist/timeline/TimelineItem.vue.d.ts +100 -0
- package/dist/timeline/TimelineNodeRenderer.d.ts +15 -0
- package/dist/timeline/index.d.ts +10 -0
- package/dist/timeline/index.js +2 -0
- package/dist/timeline/types.d.ts +43 -0
- package/dist/timeline-2D5xCZsU.js +191 -0
- package/dist/toast/ToastHost.vue.d.ts +7 -0
- package/dist/toast/ToastIconRenderer.d.ts +17 -0
- package/dist/toast/ToastNodeRenderer.d.ts +15 -0
- package/dist/toast/ToastNotice.vue.d.ts +20 -0
- package/dist/toast/imperative.d.ts +3 -0
- package/dist/toast/index.d.ts +6 -0
- package/dist/toast/index.js +2 -0
- package/dist/toast/toast-store.d.ts +30 -0
- package/dist/toast/types.d.ts +65 -0
- package/dist/toast/use-toast.d.ts +2 -0
- package/dist/toast-s8nFLf8t.js +523 -0
- package/dist/tooltip/Tooltip.vue.d.ts +23 -0
- package/dist/tooltip/TooltipArrow.vue.d.ts +8 -0
- package/dist/tooltip/TooltipNodeRenderer.d.ts +15 -0
- package/dist/tooltip/TooltipPortal.vue.d.ts +44 -0
- package/dist/tooltip/TooltipTriggerRenderer.d.ts +66 -0
- package/dist/tooltip/index.d.ts +5 -0
- package/dist/tooltip/index.js +3 -0
- package/dist/tooltip/types.d.ts +117 -0
- package/dist/tooltip/use-tooltip-foundation.d.ts +25 -0
- package/dist/tooltip-en9bvXRp.js +28 -0
- package/dist/transfer/Transfer.vue.d.ts +35 -0
- package/dist/transfer/TransferNodeRenderer.d.ts +15 -0
- package/dist/transfer/index.d.ts +5 -0
- package/dist/transfer/index.js +2 -0
- package/dist/transfer/types.d.ts +159 -0
- package/dist/transfer-Doq1sI9z.js +695 -0
- package/dist/tree/Tree.vue.d.ts +73 -0
- package/dist/tree/TreeNode.vue.d.ts +77 -0
- package/dist/tree/TreeNodeMotion.vue.d.ts +20 -0
- package/dist/tree/TreeNodeRenderer.d.ts +15 -0
- package/dist/tree/index.d.ts +9 -0
- package/dist/tree/index.js +5 -0
- package/dist/tree/types.d.ts +180 -0
- package/dist/tree-select/TreeSelect.vue.d.ts +76 -0
- package/dist/tree-select/TreeSelectNodeRenderer.d.ts +15 -0
- package/dist/tree-select/index.d.ts +6 -0
- package/dist/tree-select/index.js +2 -0
- package/dist/tree-select/types.d.ts +156 -0
- package/dist/tree-select-BIu6Owuq.js +1237 -0
- package/dist/treeUtil-IUdRJ6Ws.js +277 -0
- package/dist/typography/Numeral.vue.d.ts +32 -0
- package/dist/typography/Paragraph.vue.d.ts +30 -0
- package/dist/typography/Text.vue.d.ts +30 -0
- package/dist/typography/Title.vue.d.ts +28 -0
- package/dist/typography/Typography.vue.d.ts +13 -0
- package/dist/typography/TypographyBase.vue.d.ts +40 -0
- package/dist/typography/TypographyCopyable.vue.d.ts +29 -0
- package/dist/typography/TypographyDecorations.d.ts +34 -0
- package/dist/typography/TypographyNodeRenderer.d.ts +17 -0
- package/dist/typography/index.d.ts +17 -0
- package/dist/typography/index.js +2 -0
- package/dist/typography/types.d.ts +108 -0
- package/dist/typography/typography-locale.d.ts +5 -0
- package/dist/typography/typography-utils.d.ts +4 -0
- package/dist/typography-DF8KwKuL.js +914 -0
- package/dist/upload/Upload.vue.d.ts +69 -0
- package/dist/upload/UploadFileCard.vue.d.ts +4 -0
- package/dist/upload/UploadNodeRenderer.d.ts +15 -0
- package/dist/upload/index.d.ts +10 -0
- package/dist/upload/index.js +2 -0
- package/dist/upload/types.d.ts +250 -0
- package/dist/upload-BzdpoGJX.js +1777 -0
- package/dist/uuid-BUHV1G8U.js +21 -0
- package/dist/warning-naSiE8G7.js +6 -0
- package/dist/zh-CN-CCu7YvUA.js +1623 -0
- package/package.json +336 -0
|
@@ -0,0 +1,1473 @@
|
|
|
1
|
+
import "./src-DNBBthjO.js";
|
|
2
|
+
import { _ as e, f as t, h as n, t as r, x as i } from "./foundation-Cawx37mp.js";
|
|
3
|
+
import { t as a } from "./env-BeIzjQx7.js";
|
|
4
|
+
import { t as o } from "./constants-BNwzO87W.js";
|
|
5
|
+
import { t as s } from "./warning-naSiE8G7.js";
|
|
6
|
+
import { r as c } from "./keyCode-DMNg63wX.js";
|
|
7
|
+
import { t as l } from "./isEnterPress-HTy0eCBp.js";
|
|
8
|
+
import { o as u, t as d } from "./Tooltip-Bq7HZwnS.js";
|
|
9
|
+
import { n as f } from "./constants-BF9bZJyc.js";
|
|
10
|
+
import { t as p } from "./isNullOrUndefined-Cg6MZ8r3.js";
|
|
11
|
+
import { t as ee } from "./config-context-CyynTtDb.js";
|
|
12
|
+
import { n as te } from "./config-provider-VMfNNSF1.js";
|
|
13
|
+
import { Fragment as m, Text as ne, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createTextVNode as re, createVNode as b, defineComponent as x, getCurrentInstance as ie, guardReactiveProps as ae, inject as oe, isVNode as se, markRaw as ce, mergeProps as S, nextTick as C, normalizeClass as w, normalizeProps as le, normalizeStyle as T, onBeforeUnmount as ue, onMounted as de, openBlock as E, renderList as D, renderSlot as O, resolveDynamicComponent as fe, shallowReactive as k, shallowRef as pe, toDisplayString as A, unref as j, useAttrs as me, useId as he, useSlots as ge, useTemplateRef as _e, watch as ve, withCtx as M, withModifiers as ye } from "vue";
|
|
14
|
+
import { IconChevronDown as be, IconClear as xe, IconClose as Se, IconSearch as Ce, IconTick as we } from "@aifuxi/semi-icons-vue";
|
|
15
|
+
`${a}`, `${a}`, `${a}`;
|
|
16
|
+
var N = {
|
|
17
|
+
SIZE_SET: [
|
|
18
|
+
"small",
|
|
19
|
+
"large",
|
|
20
|
+
"default"
|
|
21
|
+
],
|
|
22
|
+
POSITION_SET: f.POSITION_SET,
|
|
23
|
+
MODE_SELECT: "select",
|
|
24
|
+
MODE_AUTOCOMPLETE: "autoComplete",
|
|
25
|
+
STATUS: o,
|
|
26
|
+
SEARCH_POSITION_TRIGGER: "trigger",
|
|
27
|
+
SEARCH_POSITION_DROPDOWN: "dropdown"
|
|
28
|
+
}, P = class extends r {
|
|
29
|
+
constructor(e) {
|
|
30
|
+
super({ ...e }), this._keydownHandler = null;
|
|
31
|
+
}
|
|
32
|
+
init() {
|
|
33
|
+
this._setDropdownWidth();
|
|
34
|
+
let e = this.getProp("defaultOpen"), t = this.getProp("open"), n = this._collectOptions();
|
|
35
|
+
this._setDefaultSelection(n), (e || t) && this.open(void 0, n), this.getProp("autoFocus") && this.focus(n);
|
|
36
|
+
}
|
|
37
|
+
focus(e, t) {
|
|
38
|
+
let n = this._isFilterable(), r = this._isMultiple(), { isOpen: i } = this.getStates(), { searchPosition: a } = this.getProps(), o = t !== !1;
|
|
39
|
+
if (this._adapter.updateFocusState(!0), this._adapter.setIsFocusInContainer(!1), n) {
|
|
40
|
+
if (!o) {
|
|
41
|
+
a === N.SEARCH_POSITION_TRIGGER ? r ? this.focusInput() : this.toggle2SearchInput(!0) : this._focusTrigger();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
r ? (this.focusInput(), i || this.open(void 0, e)) : (this.toggle2SearchInput(!0), i || this.open(void 0, e));
|
|
45
|
+
} else this._focusTrigger();
|
|
46
|
+
}
|
|
47
|
+
_focusTrigger() {
|
|
48
|
+
this._adapter.focusTrigger();
|
|
49
|
+
}
|
|
50
|
+
destroy() {
|
|
51
|
+
this._adapter.unregisterClickOutsideHandler();
|
|
52
|
+
}
|
|
53
|
+
_setDropdownWidth() {
|
|
54
|
+
let { style: t, dropdownMatchSelectWidth: r } = this.getProps(), i;
|
|
55
|
+
r && (i = t && (0, n.default)(t.width) || t && (0, e.default)(t.width) && !t.width.includes("%") ? t.width : this._adapter.getTriggerWidth(), this._adapter.setOptionWrapperWidth(i));
|
|
56
|
+
}
|
|
57
|
+
_collectOptions() {
|
|
58
|
+
let e = this._adapter.getOptionsFromChildren();
|
|
59
|
+
return this._adapter.updateOptions(e), this._adapter.rePositionDropdown(), e;
|
|
60
|
+
}
|
|
61
|
+
_setDefaultSelection(e) {
|
|
62
|
+
let { value: t } = this.getProps(), { defaultValue: n } = this.getProps();
|
|
63
|
+
this._isControlledComponent() || (t = n), this._update(t, e);
|
|
64
|
+
}
|
|
65
|
+
handleOptionListChange() {
|
|
66
|
+
let e = this._collectOptions(), { selections: t } = this.getStates();
|
|
67
|
+
this.updateOptionsActiveStatus(t, e);
|
|
68
|
+
let { defaultActiveFirstOption: n } = this.getProps();
|
|
69
|
+
n && this._adapter.updateFocusIndex(0);
|
|
70
|
+
}
|
|
71
|
+
handleOptionListChangeHadDefaultValue() {
|
|
72
|
+
let e = this.getState("selections"), t, { onChangeWithObject: n } = this.getProps(), r = this._isMultiple();
|
|
73
|
+
switch (!0) {
|
|
74
|
+
case r && !!e.size:
|
|
75
|
+
try {
|
|
76
|
+
t = [...e].map((e) => n ? e[1] : e[1].value);
|
|
77
|
+
} catch {
|
|
78
|
+
t = [];
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
case r && !e.size:
|
|
82
|
+
t = [];
|
|
83
|
+
break;
|
|
84
|
+
case !r && !!e.size:
|
|
85
|
+
try {
|
|
86
|
+
t = n ? [...e][0][1] : [...e][0][1].value;
|
|
87
|
+
} catch {}
|
|
88
|
+
break;
|
|
89
|
+
case !r && !e.size:
|
|
90
|
+
}
|
|
91
|
+
let i = this._adapter.getOptionsFromChildren();
|
|
92
|
+
this._update(t, i);
|
|
93
|
+
}
|
|
94
|
+
handleValueChange(e) {
|
|
95
|
+
let { allowCreate: t, autoClearSearchValue: n, remote: r } = this.getProps(), { inputValue: i } = this.getStates(), a;
|
|
96
|
+
t && this._isControlledComponent() ? (a = this.getState("options"), a.forEach((e) => e._show = !0)) : a = this._adapter.getOptionsFromChildren(), this._adapter.rePositionDropdown(), this._isFilterable() && !n && i && !r && (a = this._filterOption(a, i)), this._update(e, a);
|
|
97
|
+
}
|
|
98
|
+
_update(e, t) {
|
|
99
|
+
let n;
|
|
100
|
+
this._isMultiple() ? (n = this._updateMultiple(e, t), this.updateOverflowItemCount(n.size)) : n = this._updateSingle(e, t), this._adapter.updateSelection(n), this.updateOptionsActiveStatus(n, t);
|
|
101
|
+
}
|
|
102
|
+
_updateSingle(e, t) {
|
|
103
|
+
let n = /* @__PURE__ */ new Map(), { onChangeWithObject: r } = this.getProps(), i = r && e !== void 0 ? e.value : e, a = t.filter((e) => e.value === i), o = !a.length && i != null;
|
|
104
|
+
if (a.length) {
|
|
105
|
+
let e = { ...a[0] };
|
|
106
|
+
n.set(e.label, e);
|
|
107
|
+
} else if (o) {
|
|
108
|
+
let t = {
|
|
109
|
+
value: e,
|
|
110
|
+
label: e,
|
|
111
|
+
_notExist: !0,
|
|
112
|
+
_scrollIndex: -1
|
|
113
|
+
};
|
|
114
|
+
r && (t = {
|
|
115
|
+
...e,
|
|
116
|
+
_notExist: !0,
|
|
117
|
+
_scrollIndex: -1
|
|
118
|
+
}), n.set(t.label, t);
|
|
119
|
+
}
|
|
120
|
+
return n;
|
|
121
|
+
}
|
|
122
|
+
_updateMultiple(e, n) {
|
|
123
|
+
let r = this.getState("selections"), i = [], a = Array.isArray(e);
|
|
124
|
+
this.checkMultipleProps(), r.size && (i = [...r].map((e) => e[1]));
|
|
125
|
+
let o = /* @__PURE__ */ new Map(), s = e, { onChangeWithObject: c } = this.getProps();
|
|
126
|
+
return c && a && (s = e.map((e) => e.value)), a && s.length && s.forEach((r, a) => {
|
|
127
|
+
let s = n.findIndex((e) => e.value === r);
|
|
128
|
+
if (s !== -1) o.set(n[s].label, n[s]);
|
|
129
|
+
else {
|
|
130
|
+
let n = i.findIndex((e) => e.value === r);
|
|
131
|
+
if (n !== -1) {
|
|
132
|
+
let r = i[n];
|
|
133
|
+
if (c) {
|
|
134
|
+
let n = { ...e[a] };
|
|
135
|
+
(0, t.default)(n, r) ? o.set(r.label, r) : o.set(n.label, n);
|
|
136
|
+
} else o.set(r.label, r);
|
|
137
|
+
} else {
|
|
138
|
+
let t = {
|
|
139
|
+
value: r,
|
|
140
|
+
label: r,
|
|
141
|
+
_notExist: !0
|
|
142
|
+
};
|
|
143
|
+
c && (t = {
|
|
144
|
+
...e[a],
|
|
145
|
+
_notExist: !0
|
|
146
|
+
}), o.set(t.label, {
|
|
147
|
+
...t,
|
|
148
|
+
_scrollIndex: -1
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}), o;
|
|
153
|
+
}
|
|
154
|
+
_isMultiple() {
|
|
155
|
+
return this.getProp("multiple");
|
|
156
|
+
}
|
|
157
|
+
_isDisabled() {
|
|
158
|
+
return this.getProp("disabled");
|
|
159
|
+
}
|
|
160
|
+
_isFilterable() {
|
|
161
|
+
return !!this.getProp("filter");
|
|
162
|
+
}
|
|
163
|
+
handleClick(e) {
|
|
164
|
+
let { clickToHide: t } = this.getProps(), { isOpen: n } = this.getStates();
|
|
165
|
+
this._isDisabled() || (n ? n && t ? this.close({ event: e }) : n && !t && this.focusInput() : (this.open(), this._notifyFocus(e)));
|
|
166
|
+
}
|
|
167
|
+
open(e, t) {
|
|
168
|
+
let n = this._isFilterable(), r = t || this.getState("options");
|
|
169
|
+
if (n) {
|
|
170
|
+
let e = this._filterOption(r, "").filter((e) => !e._inputCreateOnly);
|
|
171
|
+
this._adapter.updateOptions(e), this.toggle2SearchInput(!0);
|
|
172
|
+
} else this._adapter.updateFocusState(!0);
|
|
173
|
+
this._adapter.openMenu(() => {
|
|
174
|
+
let { searchPosition: e, autoFocus: t } = this.getProps();
|
|
175
|
+
t && e === N.SEARCH_POSITION_DROPDOWN && this._adapter.focusDropdownInput();
|
|
176
|
+
}), this._setDropdownWidth(), this._adapter.notifyDropdownVisibleChange(!0), this.bindKeyBoardEvent(), this._adapter.registerClickOutsideHandler((e) => {
|
|
177
|
+
this.close({ event: e }), this._notifyBlur(e), this._adapter.updateFocusState(!1);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
toggle2SearchInput(e) {
|
|
181
|
+
e ? this._adapter.toggleInputShow(e, () => this.focusInput()) : this._adapter.toggleInputShow(e, () => void 0);
|
|
182
|
+
}
|
|
183
|
+
close(e) {
|
|
184
|
+
let { event: t, closeCb: n, notToggleInput: r } = e || {}, { isFocus: i } = this.getStates();
|
|
185
|
+
this._adapter.closeMenu(), this._adapter.notifyDropdownVisibleChange(!1), this._adapter.setIsFocusInContainer(!1), i && this._focusTrigger(), this._adapter.unregisterClickOutsideHandler();
|
|
186
|
+
let a = this._isFilterable();
|
|
187
|
+
a && !r && this.toggle2SearchInput(!1), this._adapter.once("popoverClose", () => {
|
|
188
|
+
a && this.clearInput(t), n && n();
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
onSelect(e, t, n) {
|
|
192
|
+
this._isDisabled() || (e._inputCreateOnly && this._adapter.notifyCreate(e), this._isMultiple() ? this._handleMultipleSelect(e, n) : this._handleSingleSelect(e, n), this._adapter.updateFocusIndex(t));
|
|
193
|
+
}
|
|
194
|
+
_handleSingleSelect({ value: e, label: t, ...n }, r) {
|
|
195
|
+
let i = (/* @__PURE__ */ new Map()).set(t, {
|
|
196
|
+
value: e,
|
|
197
|
+
label: t,
|
|
198
|
+
...n
|
|
199
|
+
});
|
|
200
|
+
this._notifySelect(e, {
|
|
201
|
+
value: e,
|
|
202
|
+
label: t,
|
|
203
|
+
...n
|
|
204
|
+
});
|
|
205
|
+
let a = this._isFilterable();
|
|
206
|
+
this._isControlledComponent() ? this.close({
|
|
207
|
+
event: r,
|
|
208
|
+
notToggleInput: !0,
|
|
209
|
+
closeCb: () => {
|
|
210
|
+
this._notifyChange(i), a && this.toggle2SearchInput(!1);
|
|
211
|
+
}
|
|
212
|
+
}) : (this._adapter.updateSelection(i), this._notifyChange(i), this.close({
|
|
213
|
+
event: r,
|
|
214
|
+
closeCb: () => {
|
|
215
|
+
this.updateOptionsActiveStatus(i);
|
|
216
|
+
}
|
|
217
|
+
}));
|
|
218
|
+
}
|
|
219
|
+
_handleMultipleSelect({ value: e, label: t, ...n }, r) {
|
|
220
|
+
let a = this._adapter.getMaxLimit(), o = this._adapter.getSelections(), { autoClearSearchValue: s } = this.getProps();
|
|
221
|
+
if (o.has(t)) this._notifyDeselect(e, {
|
|
222
|
+
value: e,
|
|
223
|
+
label: t,
|
|
224
|
+
...n
|
|
225
|
+
}), o.delete(t);
|
|
226
|
+
else if (a && o.size >= a) {
|
|
227
|
+
this._adapter.notifyMaxLimit({
|
|
228
|
+
value: e,
|
|
229
|
+
label: t,
|
|
230
|
+
...(0, i.default)(n, "_scrollIndex")
|
|
231
|
+
});
|
|
232
|
+
return;
|
|
233
|
+
} else this._notifySelect(e, {
|
|
234
|
+
value: e,
|
|
235
|
+
label: t,
|
|
236
|
+
...n
|
|
237
|
+
}), o.set(t, {
|
|
238
|
+
value: e,
|
|
239
|
+
label: t,
|
|
240
|
+
...n
|
|
241
|
+
});
|
|
242
|
+
if (this._isControlledComponent()) this._notifyChange(o), this._isFilterable() && (s && this.clearInput(r), this.focusInput());
|
|
243
|
+
else {
|
|
244
|
+
this._adapter.updateSelection(o), this.updateOverflowItemCount(o.size), this._adapter.rePositionDropdown();
|
|
245
|
+
let { options: e } = this.getStates();
|
|
246
|
+
this._isFilterable() && (s && (this.clearInput(r), e = this._filterOption(e, "")), this.focusInput()), this.updateOptionsActiveStatus(o, e), this._notifyChange(o);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
clearSelected() {
|
|
250
|
+
let e = /* @__PURE__ */ new Map();
|
|
251
|
+
this._isControlledComponent() ? (this._notifyChange(e), this._adapter.notifyClear()) : (this._adapter.updateSelection(e), this.updateOptionsActiveStatus(e), this._notifyChange(e), this._adapter.notifyClear());
|
|
252
|
+
let { isOpen: t } = this.getStates();
|
|
253
|
+
t && this._adapter.rePositionDropdown();
|
|
254
|
+
}
|
|
255
|
+
updateOptionsActiveStatus(e, t = this.getState("options")) {
|
|
256
|
+
let { allowCreate: n } = this.getProps(), r = t.map((t) => (e.has(t.label) ? (t._selected = !0, n && delete t._inputCreateOnly) : (t._inputCreateOnly && (t._show = !1), t._selected = !1), t));
|
|
257
|
+
this._adapter.updateOptions(r);
|
|
258
|
+
}
|
|
259
|
+
removeTag(e) {
|
|
260
|
+
let t = this._adapter.getSelections();
|
|
261
|
+
t.delete(e.label), this._isControlledComponent() ? (this._notifyDeselect(e.value, e), this._notifyChange(t)) : (this._notifyDeselect(e.value, e), this._adapter.updateSelection(t), this.updateOverflowItemCount(t.size), this.updateOptionsActiveStatus(t), this._adapter.rePositionDropdown(), this._notifyChange(t));
|
|
262
|
+
}
|
|
263
|
+
clearInput(e) {
|
|
264
|
+
let { inputValue: t } = this.getStates();
|
|
265
|
+
if (t !== "") {
|
|
266
|
+
this._adapter.updateInputValue(""), this._adapter.notifySearch("", e);
|
|
267
|
+
let { options: t } = this.getStates(), { remote: n } = this.getProps(), r = t;
|
|
268
|
+
n || (r = this._filterOption(t, "")), this._adapter.updateOptions(r);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
focusInput() {
|
|
272
|
+
this._adapter.focusInput(), this._adapter.updateFocusState(!0), this._adapter.setIsFocusInContainer(!1);
|
|
273
|
+
}
|
|
274
|
+
handleInputChange(e, t) {
|
|
275
|
+
this._adapter.updateInputValue(e);
|
|
276
|
+
let { options: n, isOpen: r } = this.getStates(), { allowCreate: i, remote: a } = this.getProps(), o = n;
|
|
277
|
+
a || (o = this._filterOption(n, e)), o = this._createOptionByInput(i, o, e), this._adapter.updateOptions(o), this._adapter.notifySearch(e, t), this._isMultiple() && this._adapter.rePositionDropdown();
|
|
278
|
+
}
|
|
279
|
+
_filterOption(t, n) {
|
|
280
|
+
let r = this.getProp("filter");
|
|
281
|
+
if (!r) return t;
|
|
282
|
+
if (typeof r == "boolean" && r) {
|
|
283
|
+
let r = n.toLowerCase();
|
|
284
|
+
return t.map((t) => {
|
|
285
|
+
let n = t.label.toString().toLowerCase(), i = t._parentGroup && t._parentGroup.label, a = n.includes(r), o = (0, e.default)(i) && i.toLowerCase().includes(r);
|
|
286
|
+
return t._show = !!(a || o), t;
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
if (typeof r == "function") return t.map((e) => (e._show = !!r(n, e), e));
|
|
290
|
+
}
|
|
291
|
+
_createOptionByInput(e, t, n) {
|
|
292
|
+
if (e) {
|
|
293
|
+
if (n) {
|
|
294
|
+
let e = {
|
|
295
|
+
_show: !0,
|
|
296
|
+
_selected: !1,
|
|
297
|
+
value: n,
|
|
298
|
+
label: n,
|
|
299
|
+
_inputCreateOnly: !0
|
|
300
|
+
}, r = -1, i = -1;
|
|
301
|
+
t.forEach((e, t) => {
|
|
302
|
+
!e._show && !e._inputCreateOnly || (e.label === n && (i = t), e._inputCreateOnly && (r = t, e.value = n, e.label = n, e._show = !0));
|
|
303
|
+
}), r === -1 && i === -1 && t.push(e), i !== -1 && (t = t.filter((e) => !e._inputCreateOnly));
|
|
304
|
+
} else t = t.filter((e) => !e._inputCreateOnly);
|
|
305
|
+
}
|
|
306
|
+
return t;
|
|
307
|
+
}
|
|
308
|
+
bindKeyBoardEvent() {
|
|
309
|
+
this._keydownHandler = (e) => {
|
|
310
|
+
this._handleKeyDown(e);
|
|
311
|
+
}, this._adapter.registerKeyDown(this._keydownHandler);
|
|
312
|
+
}
|
|
313
|
+
unBindKeyBoardEvent() {
|
|
314
|
+
this._keydownHandler && this._adapter.unregisterKeyDown();
|
|
315
|
+
}
|
|
316
|
+
_handleKeyDown(e) {
|
|
317
|
+
let t = e.keyCode, { loading: n, filter: r, multiple: i, disabled: a } = this.getProps(), { isOpen: o } = this.getStates();
|
|
318
|
+
if (!(n || a)) switch (t) {
|
|
319
|
+
case c.UP:
|
|
320
|
+
e.preventDefault(), this._handleArrowKeyDown(-1);
|
|
321
|
+
break;
|
|
322
|
+
case c.DOWN:
|
|
323
|
+
e.preventDefault(), this._handleArrowKeyDown(1);
|
|
324
|
+
break;
|
|
325
|
+
case c.BACKSPACE:
|
|
326
|
+
this._handleBackspaceKeyDown();
|
|
327
|
+
break;
|
|
328
|
+
case c.ENTER:
|
|
329
|
+
u(e), this._handleEnterKeyDown(e);
|
|
330
|
+
break;
|
|
331
|
+
case c.ESC:
|
|
332
|
+
o && this.close({ event: e }), r && !i && this._focusTrigger();
|
|
333
|
+
break;
|
|
334
|
+
case c.TAB: this._handleTabKeyDown(e);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
handleContainerKeyDown(e) {
|
|
338
|
+
let t = e.keyCode, { isOpen: n } = this.getStates();
|
|
339
|
+
switch (t) {
|
|
340
|
+
case c.TAB: n && this._handleTabKeyDown(e);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
_getEnableFocusIndex(e) {
|
|
344
|
+
let { focusIndex: t, options: n } = this.getStates(), r = n.filter((e) => e._show), i = r.length, a = t + e;
|
|
345
|
+
if (a < 0 && (a = i - 1), a >= i && (a = 0), e > 0) {
|
|
346
|
+
let e = -1;
|
|
347
|
+
for (let t = 0; t < r.length && (r[t].disabled || (e = t), !(e >= a)); t++);
|
|
348
|
+
a = e;
|
|
349
|
+
} else {
|
|
350
|
+
let e = r.length;
|
|
351
|
+
for (let t = i - 1; t >= 0 && (r[t].disabled || (e = t), !(e <= a)); t--);
|
|
352
|
+
a = e;
|
|
353
|
+
}
|
|
354
|
+
this._adapter.updateFocusIndex(a), this._adapter.updateScrollTop(a);
|
|
355
|
+
}
|
|
356
|
+
_handleArrowKeyDown(e) {
|
|
357
|
+
let { isOpen: t } = this.getStates();
|
|
358
|
+
t ? this._getEnableFocusIndex(e) : this.open();
|
|
359
|
+
}
|
|
360
|
+
_handleTabKeyDown(e) {
|
|
361
|
+
let { isOpen: t } = this.getStates();
|
|
362
|
+
if (this._adapter.updateFocusState(!1), t) {
|
|
363
|
+
let t = this._adapter.getContainer(), n = this._adapter.getFocusableElements(t);
|
|
364
|
+
n.length > 0 ? e.shiftKey ? this._handlePanelOpenShiftTabKeyDown(n, e) : this._handlePanelOpenTabKeyDown(n, e) : (this.close({ event: e }), this._notifyBlur(e));
|
|
365
|
+
} else this._notifyBlur(e);
|
|
366
|
+
}
|
|
367
|
+
_handlePanelOpenTabKeyDown(e, t) {
|
|
368
|
+
let n = this._adapter.getActiveElement();
|
|
369
|
+
this._adapter.getIsFocusInContainer() ? n === e[e.length - 1] && (this._focusTrigger(), this.close({ event: t }), u(t)) : (e[0].focus(), this._adapter.setIsFocusInContainer(!0), u(t));
|
|
370
|
+
}
|
|
371
|
+
_handlePanelOpenShiftTabKeyDown(e, t) {
|
|
372
|
+
let n = this._adapter.getActiveElement();
|
|
373
|
+
this._adapter.getIsFocusInContainer() ? n === e[0] && (this._focusTrigger(), this._adapter.setIsFocusInContainer(!1), u(t)) : (this.close({ event: t }), this._notifyBlur(t));
|
|
374
|
+
}
|
|
375
|
+
_handleEnterKeyDown(e) {
|
|
376
|
+
let { isOpen: t, options: n, focusIndex: r } = this.getStates();
|
|
377
|
+
if (!t) this.open();
|
|
378
|
+
else if (r !== -1) {
|
|
379
|
+
let t = n.filter((e) => e._show), { length: i } = t;
|
|
380
|
+
if (i <= r) return;
|
|
381
|
+
if (t && i) {
|
|
382
|
+
let n = t[r];
|
|
383
|
+
if (n.disabled) return;
|
|
384
|
+
this.onSelect(n, r, e);
|
|
385
|
+
}
|
|
386
|
+
} else this.close({ event: e });
|
|
387
|
+
}
|
|
388
|
+
_handleBackspaceKeyDown() {
|
|
389
|
+
if (this._isMultiple()) {
|
|
390
|
+
let e = this._adapter.getSelections(), { inputValue: t } = this.getStates(), n = e.size;
|
|
391
|
+
if (n && !t) {
|
|
392
|
+
let t = [...e.keys()], r = n - 1, i = t[r], a = e.get(i), o = !1;
|
|
393
|
+
if (a.disabled && r === 0) return;
|
|
394
|
+
for (; a.disabled && r !== 0;) --r, i = t[r], a = e.get(i), r == 0 && a.disabled && (o = !0);
|
|
395
|
+
o || this.removeTag(a);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
_notifyChange(e) {
|
|
400
|
+
let { onChangeWithObject: t } = this.getProps(), n = this.getState("selections"), r, i = [...e.values()], a = this._isMultiple();
|
|
401
|
+
if (this._diffSelections(e, n, a)) switch (!0) {
|
|
402
|
+
case t:
|
|
403
|
+
this._notifyChangeWithObject(e);
|
|
404
|
+
break;
|
|
405
|
+
case !t && !a:
|
|
406
|
+
r = i.length ? i[0].value : void 0, this._adapter.notifyChange(r);
|
|
407
|
+
break;
|
|
408
|
+
case !t && a: r = i.length ? i.map((e) => e.value) : [], this._adapter.notifyChange(r);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
_removeInternalKey(e) {
|
|
412
|
+
let t = { ...e };
|
|
413
|
+
return delete t._parentGroup, delete t._show, delete t._selected, delete t._scrollIndex, delete t._keyInJsx, "_keyInOptionList" in t && (t.key = t._keyInOptionList, delete t._keyInOptionList), t;
|
|
414
|
+
}
|
|
415
|
+
_notifySelect(e, t) {
|
|
416
|
+
let n = this._removeInternalKey(t);
|
|
417
|
+
this._adapter.notifySelect(e, n);
|
|
418
|
+
}
|
|
419
|
+
_notifyDeselect(e, t) {
|
|
420
|
+
let n = this._removeInternalKey(t);
|
|
421
|
+
this._adapter.notifyDeselect(e, n);
|
|
422
|
+
}
|
|
423
|
+
_diffSelections(e, n, r) {
|
|
424
|
+
let i = !0, a = !0;
|
|
425
|
+
if (!r) {
|
|
426
|
+
let r = [...e.values()], o = [...n.values()], s = r[0] ? r[0].value : r[0], c = o[0] ? o[0].value : o[0];
|
|
427
|
+
a = !(0, t.default)(s, c);
|
|
428
|
+
let l = r[0] ? r[0].label : r[0], u = o[0] ? o[0].label : o[0];
|
|
429
|
+
i = !(0, t.default)(l, u);
|
|
430
|
+
}
|
|
431
|
+
return a || i;
|
|
432
|
+
}
|
|
433
|
+
_notifyChangeWithObject(e) {
|
|
434
|
+
this.getState("selections");
|
|
435
|
+
let t = [];
|
|
436
|
+
for (let n of e.entries()) {
|
|
437
|
+
let e = {
|
|
438
|
+
label: n[0],
|
|
439
|
+
...n[1]
|
|
440
|
+
};
|
|
441
|
+
e = this._removeInternalKey(e), t.push(e);
|
|
442
|
+
}
|
|
443
|
+
this._isMultiple() ? this._adapter.notifyChange(t) : this._adapter.notifyChange(t[0]);
|
|
444
|
+
}
|
|
445
|
+
_notifyBlur(e) {
|
|
446
|
+
this._adapter.notifyBlur(e);
|
|
447
|
+
}
|
|
448
|
+
_notifyFocus(e) {
|
|
449
|
+
this._adapter.notifyFocus(e);
|
|
450
|
+
}
|
|
451
|
+
handleMouseEnter(e) {
|
|
452
|
+
this._adapter.updateHovering(!0), this._adapter.notifyMouseEnter(e);
|
|
453
|
+
}
|
|
454
|
+
handleMouseLeave(e) {
|
|
455
|
+
this._adapter.updateHovering(!1), this._adapter.notifyMouseLeave(e);
|
|
456
|
+
}
|
|
457
|
+
handleClearClick(e) {
|
|
458
|
+
let { filter: t, searchPosition: n } = this.getProps();
|
|
459
|
+
t && n === N.SEARCH_POSITION_TRIGGER && this.clearInput(e), this.focus(void 0, !1), this.clearSelected(), e.stopPropagation();
|
|
460
|
+
}
|
|
461
|
+
handleKeyPress(e) {
|
|
462
|
+
e && e.key === "Enter" && this.handleClick(e);
|
|
463
|
+
}
|
|
464
|
+
/* istanbul ignore next */
|
|
465
|
+
handleClearBtnEnterPress(e) {
|
|
466
|
+
l(e) && this.handleClearClick(e);
|
|
467
|
+
}
|
|
468
|
+
handleOptionMouseEnter(e) {
|
|
469
|
+
this._adapter.updateFocusIndex(e);
|
|
470
|
+
}
|
|
471
|
+
handleListScroll(e) {
|
|
472
|
+
this._adapter.notifyListScroll(e);
|
|
473
|
+
}
|
|
474
|
+
handleTriggerFocus(e) {
|
|
475
|
+
this.bindKeyBoardEvent(), this._adapter.setIsFocusInContainer(!1);
|
|
476
|
+
}
|
|
477
|
+
handleTriggerBlur(e) {
|
|
478
|
+
let { filter: t, autoFocus: n } = this.getProps(), { isOpen: r, isFocus: i } = this.getStates();
|
|
479
|
+
i && !r && (this._notifyBlur(e), this._adapter.updateFocusState(!1));
|
|
480
|
+
}
|
|
481
|
+
handleInputBlur(e) {
|
|
482
|
+
let { filter: t, autoFocus: n } = this.getProps(), { showInput: r, isOpen: i } = this.getStates(), a = this._isMultiple();
|
|
483
|
+
t && !a && (r || n) && !i && this.toggle2SearchInput(!1);
|
|
484
|
+
}
|
|
485
|
+
selectAll() {
|
|
486
|
+
let { options: e } = this.getStates(), { onChangeWithObject: t } = this.getProps(), n = [];
|
|
487
|
+
if (!this._isMultiple()) {
|
|
488
|
+
console.warn("[Semi Select]: It seems that you have called the selectAll method in the single-selection Select.\n Please note that this is not a legal way to use it");
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
n = t ? e : e.map((e) => e.value), this.handleValueChange(n), this._adapter.notifyChange(n);
|
|
492
|
+
}
|
|
493
|
+
checkMultipleProps(e) {
|
|
494
|
+
if (this._isMultiple()) {
|
|
495
|
+
let { defaultValue: t, value: n } = e || this.getProps(), r = n || t;
|
|
496
|
+
!p(r) && !Array.isArray(r) &&
|
|
497
|
+
/* istanbul ignore next */
|
|
498
|
+
s(!0, "[Semi Select] defaultValue/value should be array type in multiple mode");
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
updateScrollTop() {
|
|
502
|
+
this._adapter.updateScrollTop();
|
|
503
|
+
}
|
|
504
|
+
updateOverflowItemCount(e, t) {
|
|
505
|
+
let { maxTagCount: n, ellipsisTrigger: r } = this.getProps();
|
|
506
|
+
r && (t ? this._adapter.updateOverflowItemCount(t) : typeof n == "number" && (e - n > 0 ? this._adapter.updateOverflowItemCount(e - n) : this._adapter.updateOverflowItemCount(0)));
|
|
507
|
+
}
|
|
508
|
+
updateIsFullTags() {
|
|
509
|
+
let { isFullTags: e } = this.getStates();
|
|
510
|
+
e || this._adapter.setState({ isFullTags: !0 });
|
|
511
|
+
}
|
|
512
|
+
handlePopoverClose() {
|
|
513
|
+
this._adapter.emit("popoverClose");
|
|
514
|
+
}
|
|
515
|
+
handleSlotMouseEnter() {
|
|
516
|
+
this._adapter.updateFocusIndex(-1);
|
|
517
|
+
}
|
|
518
|
+
}, F = x({
|
|
519
|
+
name: "SelectNodeRenderer",
|
|
520
|
+
props: { content: {
|
|
521
|
+
type: null,
|
|
522
|
+
default: void 0
|
|
523
|
+
} },
|
|
524
|
+
setup: (e) => () => e.content
|
|
525
|
+
}), Te = x({
|
|
526
|
+
name: "SelectOptionCollector",
|
|
527
|
+
props: { collect: {
|
|
528
|
+
type: Function,
|
|
529
|
+
required: !0
|
|
530
|
+
} },
|
|
531
|
+
setup(e, { slots: t }) {
|
|
532
|
+
return () => {
|
|
533
|
+
let n = t.default?.() ?? [];
|
|
534
|
+
return e.collect(n), null;
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
}), Ee = x({
|
|
538
|
+
name: "SelectFragment",
|
|
539
|
+
inheritAttrs: !1,
|
|
540
|
+
setup(e, { slots: t }) {
|
|
541
|
+
return () => t.default?.();
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
//#endregion
|
|
545
|
+
//#region src/select/use-select-foundation.ts
|
|
546
|
+
function I(e) {
|
|
547
|
+
let t = { ...e };
|
|
548
|
+
for (let e of Object.keys(t)) (e.startsWith("_") || e === "children") && delete t[e];
|
|
549
|
+
return t;
|
|
550
|
+
}
|
|
551
|
+
function De(e) {
|
|
552
|
+
let { controlled: t, emit: n, getOptions: r, listElement: i, runtimeProps: a, triggerElement: o } = e, s = k({
|
|
553
|
+
isOpen: !1,
|
|
554
|
+
isFocus: !1,
|
|
555
|
+
options: [],
|
|
556
|
+
selections: /* @__PURE__ */ new Map(),
|
|
557
|
+
dropdownMinWidth: void 0,
|
|
558
|
+
optionKey: 0,
|
|
559
|
+
inputValue: "",
|
|
560
|
+
showInput: !1,
|
|
561
|
+
focusIndex: a.value.defaultActiveFirstOption ? 0 : -1,
|
|
562
|
+
keyboardEventSet: {},
|
|
563
|
+
optionGroups: [],
|
|
564
|
+
isHovering: !1,
|
|
565
|
+
isFocusInContainer: !1,
|
|
566
|
+
isFullTags: !1,
|
|
567
|
+
overflowItemCount: 0
|
|
568
|
+
}), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u, d;
|
|
569
|
+
function f() {
|
|
570
|
+
let e = { ...a.value };
|
|
571
|
+
return t.value ? e.value = a.value.value ?? a.value.modelValue : delete e.value, e;
|
|
572
|
+
}
|
|
573
|
+
let p = ce(new P({
|
|
574
|
+
getContext: () => void 0,
|
|
575
|
+
getContexts: () => void 0,
|
|
576
|
+
getProp: (e) => f()[String(e)],
|
|
577
|
+
getProps: f,
|
|
578
|
+
getState: (e) => e === "selections" && d !== void 0 ? d : s[e],
|
|
579
|
+
getStates: () => s,
|
|
580
|
+
setState: (e, t) => {
|
|
581
|
+
Object.assign(s, e), t?.();
|
|
582
|
+
},
|
|
583
|
+
getCache: (e) => c.get(e),
|
|
584
|
+
getCaches: () => c,
|
|
585
|
+
setCache: (e, t) => c.set(e, t),
|
|
586
|
+
stopPropagation: (e) => e?.stopPropagation(),
|
|
587
|
+
persistEvent: () => void 0,
|
|
588
|
+
getTriggerWidth: () => o.value?.getBoundingClientRect().width ?? 0,
|
|
589
|
+
updateFocusState: (e) => {
|
|
590
|
+
s.isFocus = e;
|
|
591
|
+
},
|
|
592
|
+
focusTrigger: () => o.value?.focus({ preventScroll: a.value.preventScroll ?? !1 }),
|
|
593
|
+
unregisterClickOutsideHandler: () => {
|
|
594
|
+
u && typeof document < "u" && document.removeEventListener("mousedown", u), u = void 0;
|
|
595
|
+
},
|
|
596
|
+
setOptionWrapperWidth: (e) => {
|
|
597
|
+
s.dropdownMinWidth = e;
|
|
598
|
+
},
|
|
599
|
+
getOptionsFromChildren: () => r().map((e) => ({ ...e })),
|
|
600
|
+
updateOptions: (e) => {
|
|
601
|
+
s.options = e;
|
|
602
|
+
},
|
|
603
|
+
rePositionDropdown: () => {
|
|
604
|
+
s.optionKey += 1;
|
|
605
|
+
},
|
|
606
|
+
updateFocusIndex: (e) => {
|
|
607
|
+
s.focusIndex = e;
|
|
608
|
+
},
|
|
609
|
+
updateSelection: (e) => {
|
|
610
|
+
d = s.selections, s.selections = e, C(() => {
|
|
611
|
+
d = void 0;
|
|
612
|
+
});
|
|
613
|
+
},
|
|
614
|
+
openMenu: (e) => {
|
|
615
|
+
s.isOpen = !0, C(() => e?.());
|
|
616
|
+
},
|
|
617
|
+
notifyDropdownVisibleChange: (e) => n("dropdownVisibleChange", e),
|
|
618
|
+
registerClickOutsideHandler: (e) => {
|
|
619
|
+
typeof document > "u" || (u = (t) => {
|
|
620
|
+
let n = t.target;
|
|
621
|
+
n instanceof Node && (o.value?.contains(n) || i.value?.contains(n) || e(t));
|
|
622
|
+
}, document.addEventListener("mousedown", u));
|
|
623
|
+
},
|
|
624
|
+
toggleInputShow: (e, t) => {
|
|
625
|
+
s.showInput = e, C(t);
|
|
626
|
+
},
|
|
627
|
+
closeMenu: () => {
|
|
628
|
+
s.isOpen = !1, a.value.motion || C(() => l.get("popoverClose")?.forEach((e) => e()));
|
|
629
|
+
},
|
|
630
|
+
notifyCreate: (e) => n("create", I(e)),
|
|
631
|
+
getMaxLimit: () => a.value.max,
|
|
632
|
+
getSelections: () => new Map(s.selections),
|
|
633
|
+
notifyMaxLimit: (e) => n("exceed", I(e)),
|
|
634
|
+
notifyClear: () => n("clear"),
|
|
635
|
+
updateInputValue: (e) => {
|
|
636
|
+
s.inputValue = e;
|
|
637
|
+
},
|
|
638
|
+
focusInput: () => {
|
|
639
|
+
C(() => o.value?.querySelector("input")?.focus({ preventScroll: a.value.preventScroll ?? !1 }));
|
|
640
|
+
},
|
|
641
|
+
focusDropdownInput: () => {
|
|
642
|
+
C(() => i.value?.querySelector("input")?.focus({ preventScroll: a.value.preventScroll ?? !1 }));
|
|
643
|
+
},
|
|
644
|
+
notifySearch: (e, t) => n("search", e, t),
|
|
645
|
+
registerKeyDown: (e) => {
|
|
646
|
+
s.keyboardEventSet = { keydown: e };
|
|
647
|
+
},
|
|
648
|
+
unregisterKeyDown: () => {
|
|
649
|
+
s.keyboardEventSet = {};
|
|
650
|
+
},
|
|
651
|
+
notifyChange: (e) => {
|
|
652
|
+
n("change", e), n("update:modelValue", e), n("update:value", e);
|
|
653
|
+
},
|
|
654
|
+
notifySelect: (e, t) => {
|
|
655
|
+
n("select", e, I(t));
|
|
656
|
+
},
|
|
657
|
+
notifyDeselect: (e, t) => {
|
|
658
|
+
n("deselect", e, I(t));
|
|
659
|
+
},
|
|
660
|
+
notifyBlur: (e) => n("blur", e),
|
|
661
|
+
notifyFocus: (e) => n("focus", e),
|
|
662
|
+
notifyListScroll: (e) => n("listScroll", e),
|
|
663
|
+
notifyMouseLeave: () => void 0,
|
|
664
|
+
notifyMouseEnter: () => void 0,
|
|
665
|
+
updateHovering: (e) => {
|
|
666
|
+
s.isHovering = e;
|
|
667
|
+
},
|
|
668
|
+
updateScrollTop: (e) => {
|
|
669
|
+
let t = e ?? [...s.selections.values()][0]?._scrollIndex;
|
|
670
|
+
if (t === void 0 || t < 0) return;
|
|
671
|
+
let n = i.value?.querySelector(`[data-option-index="${t}"]`);
|
|
672
|
+
n && i.value && (i.value.scrollTop = n.offsetTop - i.value.clientHeight / 2 + n.clientHeight / 2);
|
|
673
|
+
},
|
|
674
|
+
updateOverflowItemCount: (e) => {
|
|
675
|
+
s.overflowItemCount = e;
|
|
676
|
+
},
|
|
677
|
+
getContainer: () => i.value,
|
|
678
|
+
getFocusableElements: (e) => e ? Array.from(e.querySelectorAll("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])")) : [],
|
|
679
|
+
getActiveElement: () => typeof document > "u" ? void 0 : document.activeElement,
|
|
680
|
+
setIsFocusInContainer: (e) => {
|
|
681
|
+
s.isFocusInContainer = e;
|
|
682
|
+
},
|
|
683
|
+
getIsFocusInContainer: () => s.isFocusInContainer,
|
|
684
|
+
on: (e, t) => {
|
|
685
|
+
let n = l.get(e) ?? /* @__PURE__ */ new Set();
|
|
686
|
+
n.add(t), l.set(e, n);
|
|
687
|
+
},
|
|
688
|
+
off: (e) => l.delete(e),
|
|
689
|
+
once: (e, t) => {
|
|
690
|
+
let n = () => {
|
|
691
|
+
t(), l.get(e)?.delete(n);
|
|
692
|
+
}, r = l.get(e) ?? /* @__PURE__ */ new Set();
|
|
693
|
+
r.add(n), l.set(e, r);
|
|
694
|
+
},
|
|
695
|
+
emit: (e) => l.get(e)?.forEach((e) => e())
|
|
696
|
+
}));
|
|
697
|
+
return ve(() => a.value.value ?? a.value.modelValue, (e) => {
|
|
698
|
+
t.value && p.handleValueChange(e);
|
|
699
|
+
}, { deep: !0 }), ve(() => a.value.optionList, () => {
|
|
700
|
+
p.handleOptionListChange(), t.value || p.handleOptionListChangeHadDefaultValue();
|
|
701
|
+
}, { deep: !0 }), de(() => p.init()), ue(() => p.destroy()), {
|
|
702
|
+
foundation: p,
|
|
703
|
+
state: s
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
//#endregion
|
|
707
|
+
//#region src/select/Select.vue?vue&type=script&setup=true&lang.ts
|
|
708
|
+
var Oe = {
|
|
709
|
+
key: 1,
|
|
710
|
+
class: "semi-select-dropdown-search-wrapper"
|
|
711
|
+
}, ke = { class: "semi-input-wrapper semi-input-wrapper-default semi-input-wrapper-prefix" }, Ae = { class: "semi-input-prefix" }, je = [
|
|
712
|
+
"value",
|
|
713
|
+
"placeholder",
|
|
714
|
+
"aria-activedescendant"
|
|
715
|
+
], Me = ["aria-multiselectable"], Ne = {
|
|
716
|
+
key: 1,
|
|
717
|
+
class: "semi-select-loading-wrapper"
|
|
718
|
+
}, Pe = ["onClick", "onMouseenter"], Fe = [
|
|
719
|
+
"id",
|
|
720
|
+
"data-option-index",
|
|
721
|
+
"aria-selected",
|
|
722
|
+
"aria-disabled",
|
|
723
|
+
"onClick",
|
|
724
|
+
"onMouseenter"
|
|
725
|
+
], Ie = {
|
|
726
|
+
key: 0,
|
|
727
|
+
class: "semi-select-option-icon"
|
|
728
|
+
}, Le = { class: "semi-select-option-text" }, Re = { class: "semi-select-create-tips" }, ze = {
|
|
729
|
+
key: 0,
|
|
730
|
+
class: "semi-select-option-keyword"
|
|
731
|
+
}, Be = {
|
|
732
|
+
key: 3,
|
|
733
|
+
class: "semi-select-option semi-select-option-empty",
|
|
734
|
+
"x-semi-prop": "emptyContent"
|
|
735
|
+
}, Ve = [
|
|
736
|
+
"id",
|
|
737
|
+
"aria-disabled",
|
|
738
|
+
"aria-expanded",
|
|
739
|
+
"aria-label",
|
|
740
|
+
"aria-invalid",
|
|
741
|
+
"aria-errormessage",
|
|
742
|
+
"aria-labelledby",
|
|
743
|
+
"aria-describedby",
|
|
744
|
+
"aria-required",
|
|
745
|
+
"aria-activedescendant",
|
|
746
|
+
"tabindex"
|
|
747
|
+
], He = ["id"], Ue = { class: "semi-select-selection" }, We = [
|
|
748
|
+
"data-select-tag-index",
|
|
749
|
+
"aria-label",
|
|
750
|
+
"aria-disabled"
|
|
751
|
+
], Ge = { class: "semi-tag-content semi-tag-content-ellipsis" }, Ke = ["onClick"], qe = {
|
|
752
|
+
class: "semi-tag-group",
|
|
753
|
+
style: {
|
|
754
|
+
display: "flex",
|
|
755
|
+
"flex-wrap": "wrap",
|
|
756
|
+
gap: "2px",
|
|
757
|
+
"max-width": "400px"
|
|
758
|
+
}
|
|
759
|
+
}, Je = { class: "semi-tag-content semi-tag-content-ellipsis" }, Ye = { class: "semi-tag-content semi-tag-content-ellipsis" }, Xe = { class: "semi-tag-content semi-tag-content-ellipsis" }, Ze = {
|
|
760
|
+
key: 1,
|
|
761
|
+
class: "semi-select-selection-text semi-select-selection-placeholder"
|
|
762
|
+
}, Qe = ["value", "aria-activedescendant"], $e = {
|
|
763
|
+
key: 1,
|
|
764
|
+
class: "semi-select-content-wrapper"
|
|
765
|
+
}, et = {
|
|
766
|
+
key: 0,
|
|
767
|
+
class: "semi-input-wrapper semi-input-wrapper-default"
|
|
768
|
+
}, tt = ["value", "aria-activedescendant"], nt = {
|
|
769
|
+
key: 1,
|
|
770
|
+
class: "semi-select-suffix"
|
|
771
|
+
}, rt = {
|
|
772
|
+
key: 3,
|
|
773
|
+
class: "semi-select-arrow"
|
|
774
|
+
}, it = {
|
|
775
|
+
key: 4,
|
|
776
|
+
class: "semi-select-arrow-empty"
|
|
777
|
+
}, L = /* @__PURE__ */ x({
|
|
778
|
+
name: "Select",
|
|
779
|
+
inheritAttrs: !1,
|
|
780
|
+
__name: "Select",
|
|
781
|
+
props: {
|
|
782
|
+
ariaDescribedby: {},
|
|
783
|
+
ariaErrormessage: {},
|
|
784
|
+
ariaInvalid: { type: [Boolean, String] },
|
|
785
|
+
ariaLabelledby: {},
|
|
786
|
+
ariaRequired: { type: Boolean },
|
|
787
|
+
id: {},
|
|
788
|
+
autoFocus: { type: Boolean },
|
|
789
|
+
autoClearSearchValue: { type: Boolean },
|
|
790
|
+
autoAdjustOverflow: { type: Boolean },
|
|
791
|
+
allowCreate: { type: Boolean },
|
|
792
|
+
borderless: { type: Boolean },
|
|
793
|
+
clickToHide: { type: Boolean },
|
|
794
|
+
defaultActiveFirstOption: { type: Boolean },
|
|
795
|
+
defaultOpen: { type: Boolean },
|
|
796
|
+
defaultValue: {},
|
|
797
|
+
disabled: { type: Boolean },
|
|
798
|
+
dropdownClassName: { type: [
|
|
799
|
+
Boolean,
|
|
800
|
+
null,
|
|
801
|
+
String,
|
|
802
|
+
Object,
|
|
803
|
+
Array
|
|
804
|
+
] },
|
|
805
|
+
dropdownMargin: {},
|
|
806
|
+
dropdownMatchSelectWidth: { type: Boolean },
|
|
807
|
+
dropdownStyle: { type: [
|
|
808
|
+
Boolean,
|
|
809
|
+
null,
|
|
810
|
+
String,
|
|
811
|
+
Object,
|
|
812
|
+
Array
|
|
813
|
+
] },
|
|
814
|
+
ellipsisTrigger: { type: Boolean },
|
|
815
|
+
emptyContent: { type: [
|
|
816
|
+
Object,
|
|
817
|
+
String,
|
|
818
|
+
Number,
|
|
819
|
+
Boolean,
|
|
820
|
+
null,
|
|
821
|
+
Array
|
|
822
|
+
] },
|
|
823
|
+
expandRestTagsOnClick: { type: Boolean },
|
|
824
|
+
filter: { type: [Boolean, Function] },
|
|
825
|
+
getPopupContainer: { type: Function },
|
|
826
|
+
inputProps: {},
|
|
827
|
+
insetLabelId: {},
|
|
828
|
+
loading: { type: Boolean },
|
|
829
|
+
max: {},
|
|
830
|
+
maxHeight: {},
|
|
831
|
+
maxTagCount: {},
|
|
832
|
+
modelValue: {},
|
|
833
|
+
motion: { type: Boolean },
|
|
834
|
+
mouseEnterDelay: {},
|
|
835
|
+
mouseLeaveDelay: {},
|
|
836
|
+
multiple: { type: Boolean },
|
|
837
|
+
onChangeWithObject: { type: Boolean },
|
|
838
|
+
optionList: {},
|
|
839
|
+
placeholder: { type: [
|
|
840
|
+
Object,
|
|
841
|
+
String,
|
|
842
|
+
Number,
|
|
843
|
+
Boolean,
|
|
844
|
+
null,
|
|
845
|
+
Array
|
|
846
|
+
] },
|
|
847
|
+
position: {},
|
|
848
|
+
preventScroll: { type: Boolean },
|
|
849
|
+
rePosKey: {},
|
|
850
|
+
restTagsPopoverProps: {},
|
|
851
|
+
remote: { type: Boolean },
|
|
852
|
+
searchPlaceholder: {},
|
|
853
|
+
searchPosition: {},
|
|
854
|
+
showArrow: { type: Boolean },
|
|
855
|
+
showClear: { type: Boolean },
|
|
856
|
+
showRestTagsPopover: { type: Boolean },
|
|
857
|
+
size: {},
|
|
858
|
+
spacing: {},
|
|
859
|
+
stopPropagation: { type: Boolean },
|
|
860
|
+
validateStatus: {},
|
|
861
|
+
value: {},
|
|
862
|
+
virtualize: {},
|
|
863
|
+
zIndex: {}
|
|
864
|
+
},
|
|
865
|
+
emits: [
|
|
866
|
+
"blur",
|
|
867
|
+
"change",
|
|
868
|
+
"clear",
|
|
869
|
+
"create",
|
|
870
|
+
"deselect",
|
|
871
|
+
"dropdownVisibleChange",
|
|
872
|
+
"exceed",
|
|
873
|
+
"focus",
|
|
874
|
+
"listScroll",
|
|
875
|
+
"search",
|
|
876
|
+
"select",
|
|
877
|
+
"update:modelValue",
|
|
878
|
+
"update:value"
|
|
879
|
+
],
|
|
880
|
+
setup(e, { expose: t, emit: n }) {
|
|
881
|
+
let r = e, i = n, a = me(), o = ge(), s = ie(), c = oe(ee, void 0), l = _e("triggerElement"), u = _e("listElement"), f = _e("multipleContentElement"), p = r.id ?? `semi-select-${he().replaceAll(":", "")}`, x = `${p}-list`, ce = pe(0), k = pe(), N = /* @__PURE__ */ new Map(), P, I = [], L = "", R = !1, z = h(() => c?.value ?? {
|
|
882
|
+
direction: "ltr",
|
|
883
|
+
getPopupContainer: void 0
|
|
884
|
+
}), at = h(() => z.value.locale?.Select ?? {});
|
|
885
|
+
function B(e, t) {
|
|
886
|
+
let n = String(e).replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), i = s?.vnode.props;
|
|
887
|
+
if (i && (Object.prototype.hasOwnProperty.call(i, e) || Object.prototype.hasOwnProperty.call(i, n)) && r[e] !== void 0) return r[e];
|
|
888
|
+
let a = te.config.overrideDefaultProps?.Select?.[e];
|
|
889
|
+
return a === void 0 ? t : a;
|
|
890
|
+
}
|
|
891
|
+
let V = h(() => ({
|
|
892
|
+
...r,
|
|
893
|
+
allowCreate: B("allowCreate", !1),
|
|
894
|
+
autoAdjustOverflow: B("autoAdjustOverflow", !0),
|
|
895
|
+
autoClearSearchValue: B("autoClearSearchValue", !0),
|
|
896
|
+
borderless: B("borderless", !1),
|
|
897
|
+
defaultActiveFirstOption: B("defaultActiveFirstOption", !0),
|
|
898
|
+
defaultOpen: B("defaultOpen", !1),
|
|
899
|
+
disabled: B("disabled", !1),
|
|
900
|
+
dropdownMatchSelectWidth: B("dropdownMatchSelectWidth", !0),
|
|
901
|
+
filter: B("filter", !1),
|
|
902
|
+
maxHeight: B("maxHeight", 270),
|
|
903
|
+
motion: B("motion", !0),
|
|
904
|
+
multiple: B("multiple", !1),
|
|
905
|
+
onChangeWithObject: B("onChangeWithObject", !1),
|
|
906
|
+
placeholder: B("placeholder", ""),
|
|
907
|
+
remote: B("remote", !1),
|
|
908
|
+
searchPosition: B("searchPosition", "trigger"),
|
|
909
|
+
showArrow: B("showArrow", !0),
|
|
910
|
+
showClear: B("showClear", !1),
|
|
911
|
+
showRestTagsPopover: B("showRestTagsPopover", !1),
|
|
912
|
+
size: B("size", "default"),
|
|
913
|
+
stopPropagation: B("stopPropagation", !0),
|
|
914
|
+
validateStatus: B("validateStatus", "default"),
|
|
915
|
+
zIndex: B("zIndex", 1030)
|
|
916
|
+
})), H = h(() => {
|
|
917
|
+
let e = s?.vnode.props;
|
|
918
|
+
return !!(e && (Object.prototype.hasOwnProperty.call(e, "value") || Object.prototype.hasOwnProperty.call(e, "modelValue") || Object.prototype.hasOwnProperty.call(e, "model-value")));
|
|
919
|
+
});
|
|
920
|
+
function U(e) {
|
|
921
|
+
let t = [], n = (e) => {
|
|
922
|
+
if (Array.isArray(e)) return e.forEach(n);
|
|
923
|
+
if (se(e)) {
|
|
924
|
+
if (e.type === m && Array.isArray(e.children)) return e.children.forEach((e) => n(e));
|
|
925
|
+
t.push(e);
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
return n(e), t;
|
|
929
|
+
}
|
|
930
|
+
function W(e) {
|
|
931
|
+
let t = e.children;
|
|
932
|
+
if (t && typeof t == "object" && !Array.isArray(t)) {
|
|
933
|
+
let e = t.default;
|
|
934
|
+
if (e) return e();
|
|
935
|
+
}
|
|
936
|
+
return t;
|
|
937
|
+
}
|
|
938
|
+
function G(e) {
|
|
939
|
+
if (typeof e.type != "object") return;
|
|
940
|
+
let t = e.type;
|
|
941
|
+
return t.name ?? t.__name;
|
|
942
|
+
}
|
|
943
|
+
function ot(e) {
|
|
944
|
+
let t = "", n = !1, r = (e) => Array.isArray(e) ? e.every(r) : typeof e == "string" || typeof e == "number" ? (t += String(e), n = !0, !0) : se(e) ? e.type === ne ? r(e.children) : e.type === m && Array.isArray(e.children) ? e.children.every((e) => r(e)) : !1 : e == null;
|
|
945
|
+
return r(e) && n ? t : void 0;
|
|
946
|
+
}
|
|
947
|
+
function st() {
|
|
948
|
+
if (V.value.optionList?.length) return V.value.optionList.map((e, t) => ({
|
|
949
|
+
_scrollIndex: t,
|
|
950
|
+
_selected: !1,
|
|
951
|
+
_show: !0,
|
|
952
|
+
showTick: !0,
|
|
953
|
+
...e,
|
|
954
|
+
label: e.label ?? e.value
|
|
955
|
+
}));
|
|
956
|
+
let e = [], t = (t, n) => {
|
|
957
|
+
let r = t.props ?? {}, i = W(t), a = ot(i), o = Object.prototype.hasOwnProperty.call(r, "disabled") && r.disabled !== !1, s = !Object.prototype.hasOwnProperty.call(r, "showTick") || r.showTick !== !1;
|
|
958
|
+
e.push({
|
|
959
|
+
...r,
|
|
960
|
+
_key: t.key ?? e.length,
|
|
961
|
+
...n ? { _parentGroup: n } : {},
|
|
962
|
+
_scrollIndex: e.length,
|
|
963
|
+
_selected: !1,
|
|
964
|
+
_show: !0,
|
|
965
|
+
children: i,
|
|
966
|
+
disabled: o,
|
|
967
|
+
label: r.label ?? a ?? i ?? r.value,
|
|
968
|
+
showTick: s,
|
|
969
|
+
...r.value === void 0 ? {} : { value: r.value }
|
|
970
|
+
});
|
|
971
|
+
};
|
|
972
|
+
for (let n of U(I)) {
|
|
973
|
+
let r = G(n);
|
|
974
|
+
if (r === "SelectOption" && t(n), r === "SelectOptionGroup") {
|
|
975
|
+
let r = n.props ?? {}, i = {
|
|
976
|
+
_key: n.key ?? e.length,
|
|
977
|
+
class: r.class,
|
|
978
|
+
label: r.label,
|
|
979
|
+
style: r.style
|
|
980
|
+
};
|
|
981
|
+
for (let e of U(W(n))) G(e) === "SelectOption" && t(e, i);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
return e;
|
|
985
|
+
}
|
|
986
|
+
function ct(e) {
|
|
987
|
+
I = e;
|
|
988
|
+
let t = U(e).map((e) => ({
|
|
989
|
+
key: e.key,
|
|
990
|
+
name: G(e),
|
|
991
|
+
value: e.props?.value,
|
|
992
|
+
label: typeof e.props?.label == "string" || typeof e.props?.label == "number" ? e.props.label : e.props?.label === void 0 ? void 0 : "[VNode]",
|
|
993
|
+
disabled: e.props?.disabled,
|
|
994
|
+
children: String(W(e))
|
|
995
|
+
})), n = JSON.stringify(t);
|
|
996
|
+
if (n !== L) {
|
|
997
|
+
if (L = n, typeof document > "u" && q.options.length === 0) {
|
|
998
|
+
let e = st(), t = H.value ? V.value.value ?? V.value.modelValue : V.value.defaultValue, n = V.value.multiple && Array.isArray(t) ? t : t === void 0 ? [] : [t], r = /* @__PURE__ */ new Map();
|
|
999
|
+
q.options = e.map((e) => {
|
|
1000
|
+
let t = n.some((t) => V.value.onChangeWithObject && typeof t == "object" && t ? t.value === e.value : t === e.value), i = {
|
|
1001
|
+
...e,
|
|
1002
|
+
_selected: t
|
|
1003
|
+
};
|
|
1004
|
+
return t && r.set(e.value, i), i;
|
|
1005
|
+
}), q.selections = r;
|
|
1006
|
+
}
|
|
1007
|
+
R && queueMicrotask(() => {
|
|
1008
|
+
K.handleOptionListChange(), H.value || K.handleOptionListChangeHadDefaultValue();
|
|
1009
|
+
});
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
let { foundation: K, state: q } = De({
|
|
1013
|
+
controlled: H,
|
|
1014
|
+
emit: i,
|
|
1015
|
+
getOptions: st,
|
|
1016
|
+
listElement: u,
|
|
1017
|
+
runtimeProps: V,
|
|
1018
|
+
triggerElement: l
|
|
1019
|
+
});
|
|
1020
|
+
queueMicrotask(() => {
|
|
1021
|
+
R = !0;
|
|
1022
|
+
});
|
|
1023
|
+
let lt = h(() => q.options.filter((e) => e._show)), J = h(() => [...q.selections.values()]), Y = h(() => {
|
|
1024
|
+
if (V.value.expandRestTagsOnClick && q.isOpen) return J.value;
|
|
1025
|
+
let e = V.value.maxTagCount ?? J.value.length, t = V.value.ellipsisTrigger ? k.value ?? e : e;
|
|
1026
|
+
return J.value.slice(0, Math.min(e, t));
|
|
1027
|
+
}), X = h(() => J.value.length - Y.value.length), Z = h(() => !!V.value.ellipsisTrigger && !(V.value.expandRestTagsOnClick && q.isOpen)), ut = h(() => !!V.value.maxTagCount && !Z.value && !(V.value.expandRestTagsOnClick && q.isOpen)), dt = h(() => ut.value || Z.value ? "div" : Ee), ft = h(() => ut.value ? { class: "semi-tag-group semi-tag-group-max semi-tag-group-large" } : Z.value ? { class: "semi-select-content-wrapper-collapse" } : {}), pt = h(() => Z.value ? "div" : Ee), mt = h(() => Z.value ? { class: "semi-overflow-list" } : {}), ht = h(() => {
|
|
1028
|
+
let e = [], t = /* @__PURE__ */ new Set();
|
|
1029
|
+
return lt.value.forEach((n, r) => {
|
|
1030
|
+
let i = n._parentGroup?._key ?? n._parentGroup?.label, a = n._parentGroup !== void 0 && !t.has(i);
|
|
1031
|
+
a && t.add(i), e.push({
|
|
1032
|
+
group: n._parentGroup,
|
|
1033
|
+
option: n,
|
|
1034
|
+
index: r,
|
|
1035
|
+
first: a
|
|
1036
|
+
});
|
|
1037
|
+
}), e;
|
|
1038
|
+
}), gt = h(() => {
|
|
1039
|
+
if (!V.value.virtualize) return ht.value;
|
|
1040
|
+
let e = V.value.virtualize.itemSize ?? 32, t = V.value.virtualize.height ?? 270, n = Math.max(0, Math.floor(ce.value / e) - 2), r = Math.ceil(t / e) + 4;
|
|
1041
|
+
return ht.value.slice(n, n + r);
|
|
1042
|
+
}), _t = h(() => [
|
|
1043
|
+
a.class,
|
|
1044
|
+
"semi-select",
|
|
1045
|
+
V.value.borderless ? "semi-select-borderless" : void 0,
|
|
1046
|
+
q.isOpen ? "semi-select-open" : void 0,
|
|
1047
|
+
q.isFocus ? "semi-select-focus" : void 0,
|
|
1048
|
+
V.value.disabled ? "semi-select-disabled" : void 0,
|
|
1049
|
+
V.value.multiple ? "semi-select-multiple" : "semi-select-single",
|
|
1050
|
+
V.value.filter ? "semi-select-filterable" : void 0,
|
|
1051
|
+
V.value.size === "small" ? "semi-select-small" : void 0,
|
|
1052
|
+
V.value.size === "large" ? "semi-select-large" : void 0,
|
|
1053
|
+
V.value.validateStatus === "error" ? "semi-select-error" : void 0,
|
|
1054
|
+
V.value.validateStatus === "warning" ? "semi-select-warning" : void 0,
|
|
1055
|
+
V.value.showArrow ? void 0 : "semi-select-no-arrow",
|
|
1056
|
+
o.prefix || o.insetLabel ? "semi-select-with-prefix" : void 0,
|
|
1057
|
+
o.suffix ? "semi-select-with-suffix" : void 0
|
|
1058
|
+
]), vt = h(() => V.value.showClear && !V.value.disabled && (J.value.length > 0 || q.inputValue) && (q.isHovering || q.isOpen)), yt = h(() => ({
|
|
1059
|
+
maxHeight: typeof V.value.maxHeight == "number" ? `${V.value.maxHeight}px` : V.value.maxHeight,
|
|
1060
|
+
...V.value.virtualize ? {
|
|
1061
|
+
height: `${V.value.virtualize.height ?? 270}px`,
|
|
1062
|
+
position: "relative"
|
|
1063
|
+
} : {}
|
|
1064
|
+
})), bt = h(() => [{ minWidth: typeof q.dropdownMinWidth == "number" ? `${q.dropdownMinWidth}px` : q.dropdownMinWidth }, V.value.dropdownStyle]), xt = h(() => V.value.getPopupContainer ?? z.value.getPopupContainer), Q = h(() => q.focusIndex >= 0 ? `${p}-option-${q.focusIndex}` : "");
|
|
1065
|
+
function St(e) {
|
|
1066
|
+
let t = getComputedStyle(e);
|
|
1067
|
+
return e.getBoundingClientRect().width + Number.parseFloat(t.marginLeft || "0") + Number.parseFloat(t.marginRight || "0");
|
|
1068
|
+
}
|
|
1069
|
+
function Ct() {
|
|
1070
|
+
if (!V.value.ellipsisTrigger) {
|
|
1071
|
+
k.value = void 0, N.clear();
|
|
1072
|
+
return;
|
|
1073
|
+
}
|
|
1074
|
+
let e = f.value;
|
|
1075
|
+
if (!e) return;
|
|
1076
|
+
for (let t of e.querySelectorAll("[data-select-tag-index]")) {
|
|
1077
|
+
let e = Number(t.dataset.selectTagIndex);
|
|
1078
|
+
Number.isInteger(e) && N.set(e, St(t));
|
|
1079
|
+
}
|
|
1080
|
+
let t = J.value.length, n = Math.min(V.value.maxTagCount ?? t, t), r = e.querySelector("[data-select-collapse-tag]"), i = r ? St(r) : 28, a = e.clientWidth, o = 0, s = 0;
|
|
1081
|
+
for (let e = 0; e < n; e += 1) {
|
|
1082
|
+
let n = N.get(e);
|
|
1083
|
+
if (n === void 0) break;
|
|
1084
|
+
let r = e + 1 < t;
|
|
1085
|
+
if (o + n + (r ? i : 0) > a) break;
|
|
1086
|
+
o += n, s += 1;
|
|
1087
|
+
}
|
|
1088
|
+
k.value = s;
|
|
1089
|
+
}
|
|
1090
|
+
function $() {
|
|
1091
|
+
C(() => Ct());
|
|
1092
|
+
}
|
|
1093
|
+
de(() => {
|
|
1094
|
+
typeof ResizeObserver < "u" && f.value && (P = new ResizeObserver($), P.observe(f.value)), window.addEventListener("resize", $), $();
|
|
1095
|
+
}), ue(() => {
|
|
1096
|
+
P?.disconnect(), window.removeEventListener("resize", $);
|
|
1097
|
+
}), ve(() => [
|
|
1098
|
+
J.value.map((e) => e.value),
|
|
1099
|
+
V.value.ellipsisTrigger,
|
|
1100
|
+
V.value.maxTagCount
|
|
1101
|
+
], $, { deep: !0 });
|
|
1102
|
+
function wt(e) {
|
|
1103
|
+
K.handleInputChange(e.target.value, e);
|
|
1104
|
+
}
|
|
1105
|
+
function Tt(e) {
|
|
1106
|
+
K.handleClearClick(e);
|
|
1107
|
+
}
|
|
1108
|
+
function Et(e, t, n) {
|
|
1109
|
+
e.disabled || K.onSelect(e, t, n);
|
|
1110
|
+
}
|
|
1111
|
+
function Dt(e) {
|
|
1112
|
+
return e.label ?? e.children ?? e.value;
|
|
1113
|
+
}
|
|
1114
|
+
function Ot(e) {
|
|
1115
|
+
if (!V.value.virtualize) return;
|
|
1116
|
+
let t = V.value.virtualize.itemSize ?? 32;
|
|
1117
|
+
return {
|
|
1118
|
+
position: "absolute",
|
|
1119
|
+
left: 0,
|
|
1120
|
+
right: 0,
|
|
1121
|
+
top: `${e * t}px`,
|
|
1122
|
+
height: `${t}px`
|
|
1123
|
+
};
|
|
1124
|
+
}
|
|
1125
|
+
function kt(e) {
|
|
1126
|
+
ce.value = e.currentTarget.scrollTop, K.handleListScroll(e);
|
|
1127
|
+
}
|
|
1128
|
+
function At() {
|
|
1129
|
+
K.open();
|
|
1130
|
+
}
|
|
1131
|
+
function jt() {
|
|
1132
|
+
K.close();
|
|
1133
|
+
}
|
|
1134
|
+
function Mt() {
|
|
1135
|
+
K.focus(void 0, !1);
|
|
1136
|
+
}
|
|
1137
|
+
function Nt() {
|
|
1138
|
+
K.clearInput();
|
|
1139
|
+
}
|
|
1140
|
+
function Pt() {
|
|
1141
|
+
K.clearSelected();
|
|
1142
|
+
}
|
|
1143
|
+
function Ft() {
|
|
1144
|
+
K.selectAll();
|
|
1145
|
+
}
|
|
1146
|
+
function It(e, t) {
|
|
1147
|
+
K.handleInputChange(e, t);
|
|
1148
|
+
}
|
|
1149
|
+
function Lt() {
|
|
1150
|
+
q.optionKey += 1;
|
|
1151
|
+
}
|
|
1152
|
+
return t({
|
|
1153
|
+
clearInput: Nt,
|
|
1154
|
+
close: jt,
|
|
1155
|
+
deselectAll: Pt,
|
|
1156
|
+
focus: Mt,
|
|
1157
|
+
open: At,
|
|
1158
|
+
rePosition: Lt,
|
|
1159
|
+
search: It,
|
|
1160
|
+
selectAll: Ft
|
|
1161
|
+
}), (e, t) => (E(), v(m, null, [b(j(Te), { collect: ct }, {
|
|
1162
|
+
default: M(() => [O(e.$slots, "default")]),
|
|
1163
|
+
_: 3
|
|
1164
|
+
}), b(d, S({
|
|
1165
|
+
"prefix-cls": "semi-popover",
|
|
1166
|
+
role: "presentation",
|
|
1167
|
+
trigger: "custom",
|
|
1168
|
+
visible: j(q).isOpen,
|
|
1169
|
+
position: V.value.position ?? (z.value.direction === "rtl" ? "bottomRight" : "bottomLeft"),
|
|
1170
|
+
"show-arrow": !1,
|
|
1171
|
+
spacing: V.value.spacing ?? 4,
|
|
1172
|
+
"z-index": V.value.zIndex,
|
|
1173
|
+
motion: V.value.motion,
|
|
1174
|
+
"auto-adjust-overflow": V.value.autoAdjustOverflow,
|
|
1175
|
+
margin: V.value.dropdownMargin ?? 0,
|
|
1176
|
+
"mouse-enter-delay": V.value.mouseEnterDelay ?? 0,
|
|
1177
|
+
"mouse-leave-delay": V.value.mouseLeaveDelay ?? 0,
|
|
1178
|
+
"stop-propagation": V.value.stopPropagation,
|
|
1179
|
+
"re-pos-key": `${j(q).optionKey}-${V.value.rePosKey ?? ""}`
|
|
1180
|
+
}, xt.value ? { getPopupContainer: xt.value } : {}, {
|
|
1181
|
+
onAfterClose: t[16] ||= () => j(K).handlePopoverClose(),
|
|
1182
|
+
"onUpdate:visible": t[17] ||= (e) => {
|
|
1183
|
+
!e && j(q).isOpen && j(K).close();
|
|
1184
|
+
}
|
|
1185
|
+
}), {
|
|
1186
|
+
content: M(() => [y("div", {
|
|
1187
|
+
class: w(["semi-select-option-list-wrapper", V.value.dropdownClassName]),
|
|
1188
|
+
style: T(bt.value),
|
|
1189
|
+
onKeydown: t[5] ||= (...e) => j(K).handleContainerKeyDown && j(K).handleContainerKeyDown(...e)
|
|
1190
|
+
}, [
|
|
1191
|
+
e.$slots.outerTop ? (E(), v("div", {
|
|
1192
|
+
key: 0,
|
|
1193
|
+
class: "semi-select-option-list-outer-top-slot",
|
|
1194
|
+
onMouseenter: t[0] ||= (e) => j(K).handleSlotMouseEnter()
|
|
1195
|
+
}, [O(e.$slots, "outerTop")], 32)) : _("", !0),
|
|
1196
|
+
V.value.filter && V.value.searchPosition === "dropdown" ? (E(), v("div", Oe, [y("div", ke, [y("span", Ae, [b(j(Ce))]), y("input", {
|
|
1197
|
+
class: "semi-input semi-input-default semi-select-dropdown-input",
|
|
1198
|
+
value: j(q).inputValue,
|
|
1199
|
+
placeholder: V.value.searchPlaceholder,
|
|
1200
|
+
"aria-activedescendant": Q.value,
|
|
1201
|
+
onInput: wt,
|
|
1202
|
+
onKeydown: t[1] ||= (...e) => j(K)._handleKeyDown && j(K)._handleKeyDown(...e)
|
|
1203
|
+
}, null, 40, je)])])) : _("", !0),
|
|
1204
|
+
y("div", {
|
|
1205
|
+
id: x,
|
|
1206
|
+
ref_key: "listElement",
|
|
1207
|
+
ref: u,
|
|
1208
|
+
class: w(["semi-select-option-list", J.value.length ? "semi-select-option-list-chosen" : void 0]),
|
|
1209
|
+
style: T(yt.value),
|
|
1210
|
+
role: "listbox",
|
|
1211
|
+
"aria-multiselectable": V.value.multiple,
|
|
1212
|
+
onScroll: kt
|
|
1213
|
+
}, [
|
|
1214
|
+
e.$slots.innerTop ? (E(), v("div", {
|
|
1215
|
+
key: 0,
|
|
1216
|
+
class: "semi-select-option-list-inner-top-slot",
|
|
1217
|
+
onMouseenter: t[2] ||= (e) => j(K).handleSlotMouseEnter()
|
|
1218
|
+
}, [O(e.$slots, "innerTop")], 32)) : _("", !0),
|
|
1219
|
+
V.value.loading ? (E(), v("div", Ne, [...t[18] ||= [y("span", { class: "semi-spin semi-spin-middle" }, [y("span", { class: "semi-spin-wrapper" }, [y("span", { class: "semi-spin-spinIcon" })])], -1)]])) : lt.value.length ? (E(), v(m, { key: 2 }, [V.value.virtualize ? (E(), v("div", {
|
|
1220
|
+
key: 0,
|
|
1221
|
+
"aria-hidden": "true",
|
|
1222
|
+
style: T({ height: `${ht.value.length * (V.value.virtualize.itemSize ?? 32)}px` })
|
|
1223
|
+
}, null, 4)) : _("", !0), (E(!0), v(m, null, D(gt.value, (t) => (E(), v(m, { key: t.option._key ?? `${t.option.label}-${t.option.value}-${t.index}` }, [t.first ? (E(), v("div", {
|
|
1224
|
+
key: 0,
|
|
1225
|
+
class: w(["semi-select-group", t.group?.class]),
|
|
1226
|
+
style: T(t.group?.style)
|
|
1227
|
+
}, [b(j(F), { content: t.group?.label }, null, 8, ["content"])], 6)) : _("", !0), t.option._inputCreateOnly && e.$slots.createItem ? (E(), v("div", {
|
|
1228
|
+
key: 1,
|
|
1229
|
+
role: "button",
|
|
1230
|
+
"aria-label": "Use the input box to create an optional item",
|
|
1231
|
+
onClick: (e) => Et(t.option, t.index, e),
|
|
1232
|
+
onMouseenter: (e) => j(K).handleOptionMouseEnter(t.index)
|
|
1233
|
+
}, [O(e.$slots, "createItem", {
|
|
1234
|
+
inputValue: t.option.value ?? j(q).inputValue,
|
|
1235
|
+
focused: t.index === j(q).focusIndex,
|
|
1236
|
+
style: T(t.option.style)
|
|
1237
|
+
})], 40, Pe)) : e.$slots.option ? O(e.$slots, "option", S({ ref_for: !0 }, t.option, {
|
|
1238
|
+
focused: t.index === j(q).focusIndex,
|
|
1239
|
+
selected: t.option._selected,
|
|
1240
|
+
inputValue: j(q).inputValue,
|
|
1241
|
+
onClick: (e) => Et(t.option, t.index, e),
|
|
1242
|
+
onMouseenter: () => j(K).handleOptionMouseEnter(t.index)
|
|
1243
|
+
}), void 0, void 0, 2) : (E(), v("div", {
|
|
1244
|
+
key: 3,
|
|
1245
|
+
id: `${j(p)}-option-${t.index}`,
|
|
1246
|
+
class: w([
|
|
1247
|
+
"semi-select-option",
|
|
1248
|
+
t.option.class,
|
|
1249
|
+
t.option.disabled ? "semi-select-option-disabled" : void 0,
|
|
1250
|
+
t.option._selected ? "semi-select-option-selected" : void 0,
|
|
1251
|
+
t.index === j(q).focusIndex ? "semi-select-option-focused" : void 0
|
|
1252
|
+
]),
|
|
1253
|
+
style: T([t.option.style, Ot(t.index)]),
|
|
1254
|
+
"data-option-index": t.index,
|
|
1255
|
+
role: "option",
|
|
1256
|
+
"aria-selected": t.option._selected,
|
|
1257
|
+
"aria-disabled": !!t.option.disabled,
|
|
1258
|
+
onClick: (e) => Et(t.option, t.index, e),
|
|
1259
|
+
onMouseenter: (e) => j(K).handleOptionMouseEnter(t.index)
|
|
1260
|
+
}, [t.option.showTick === !1 ? _("", !0) : (E(), v("div", Ie, [b(j(we))])), y("div", Le, [t.option._inputCreateOnly ? (E(), v(m, { key: 0 }, [y("span", Re, A(at.value.createText ?? "创建"), 1), re(A(t.option.value), 1)], 64)) : typeof Dt(t.option) == "string" && j(q).inputValue ? (E(!0), v(m, { key: 1 }, D(String(Dt(t.option)).split(RegExp(`(${j(q).inputValue.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "ig")), (e, t) => (E(), v(m, { key: t }, [e.toLocaleLowerCase() === j(q).inputValue.toLocaleLowerCase() ? (E(), v("span", ze, A(e), 1)) : (E(), v(m, { key: 1 }, [re(A(e), 1)], 64))], 64))), 128)) : (E(), g(j(F), {
|
|
1261
|
+
key: 2,
|
|
1262
|
+
content: Dt(t.option)
|
|
1263
|
+
}, null, 8, ["content"]))])], 46, Fe))], 64))), 128))], 64)) : V.value.emptyContent === null ? _("", !0) : (E(), v("div", Be, [O(e.$slots, "emptyContent", {}, () => [b(j(F), { content: V.value.emptyContent ?? at.value.emptyContent ?? "暂无数据" }, null, 8, ["content"])])])),
|
|
1264
|
+
e.$slots.innerBottom ? (E(), v("div", {
|
|
1265
|
+
key: 4,
|
|
1266
|
+
class: "semi-select-option-list-inner-bottom-slot",
|
|
1267
|
+
onMouseenter: t[3] ||= (e) => j(K).handleSlotMouseEnter()
|
|
1268
|
+
}, [O(e.$slots, "innerBottom")], 32)) : _("", !0)
|
|
1269
|
+
], 46, Me),
|
|
1270
|
+
e.$slots.outerBottom ? (E(), v("div", {
|
|
1271
|
+
key: 2,
|
|
1272
|
+
class: "semi-select-option-list-outer-bottom-slot",
|
|
1273
|
+
onMouseenter: t[4] ||= (e) => j(K).handleSlotMouseEnter()
|
|
1274
|
+
}, [O(e.$slots, "outerBottom")], 32)) : _("", !0)
|
|
1275
|
+
], 38)]),
|
|
1276
|
+
default: M(() => [y("div", S({
|
|
1277
|
+
id: j(p),
|
|
1278
|
+
ref_key: "triggerElement",
|
|
1279
|
+
ref: l,
|
|
1280
|
+
role: "combobox",
|
|
1281
|
+
"aria-disabled": V.value.disabled,
|
|
1282
|
+
"aria-expanded": j(q).isOpen,
|
|
1283
|
+
"aria-controls": x,
|
|
1284
|
+
"aria-haspopup": "listbox",
|
|
1285
|
+
"aria-label": J.value.length ? "selected" : "",
|
|
1286
|
+
"aria-invalid": r.ariaInvalid,
|
|
1287
|
+
"aria-errormessage": r.ariaErrormessage,
|
|
1288
|
+
"aria-labelledby": r.ariaLabelledby,
|
|
1289
|
+
"aria-describedby": r.ariaDescribedby,
|
|
1290
|
+
"aria-required": r.ariaRequired,
|
|
1291
|
+
"aria-activedescendant": Q.value,
|
|
1292
|
+
class: _t.value,
|
|
1293
|
+
style: j(a).style,
|
|
1294
|
+
tabindex: V.value.disabled || V.value.filter && (j(q).showInput || V.value.multiple) ? -1 : 0
|
|
1295
|
+
}, Object.fromEntries(Object.entries(j(a)).filter(([e]) => e.startsWith("data-"))), {
|
|
1296
|
+
onClick: t[10] ||= (...e) => j(K).handleClick && j(K).handleClick(...e),
|
|
1297
|
+
onMouseenter: t[11] ||= (...e) => j(K).handleMouseEnter && j(K).handleMouseEnter(...e),
|
|
1298
|
+
onMouseleave: t[12] ||= (...e) => j(K).handleMouseLeave && j(K).handleMouseLeave(...e),
|
|
1299
|
+
onFocus: t[13] ||= (...e) => j(K).handleTriggerFocus && j(K).handleTriggerFocus(...e),
|
|
1300
|
+
onBlur: t[14] ||= (...e) => j(K).handleTriggerBlur && j(K).handleTriggerBlur(...e),
|
|
1301
|
+
onKeydown: t[15] ||= (e) => j(q).keyboardEventSet.keydown?.(e)
|
|
1302
|
+
}), [e.$slots.trigger ? O(e.$slots, "trigger", {
|
|
1303
|
+
value: J.value,
|
|
1304
|
+
inputValue: j(q).inputValue,
|
|
1305
|
+
disabled: V.value.disabled,
|
|
1306
|
+
placeholder: V.value.placeholder,
|
|
1307
|
+
onSearch: It,
|
|
1308
|
+
onClear: Tt,
|
|
1309
|
+
onRemove: j(K).removeTag.bind(j(K))
|
|
1310
|
+
}, void 0, void 0, 0) : (E(), v(m, { key: 1 }, [
|
|
1311
|
+
e.$slots.prefix || e.$slots.insetLabel ? (E(), v("div", {
|
|
1312
|
+
key: 0,
|
|
1313
|
+
id: r.insetLabelId,
|
|
1314
|
+
class: w([
|
|
1315
|
+
"semi-select-prefix",
|
|
1316
|
+
e.$slots.insetLabel ? "semi-select-inset-label" : void 0,
|
|
1317
|
+
"semi-select-prefix-text"
|
|
1318
|
+
]),
|
|
1319
|
+
"x-semi-prop": "prefix,insetLabel"
|
|
1320
|
+
}, [e.$slots.prefix ? O(e.$slots, "prefix", {}, void 0, void 0, 0) : O(e.$slots, "insetLabel", {}, void 0, void 0, 1)], 10, He)) : _("", !0),
|
|
1321
|
+
y("div", Ue, [V.value.multiple ? (E(), v("div", {
|
|
1322
|
+
key: 0,
|
|
1323
|
+
ref_key: "multipleContentElement",
|
|
1324
|
+
ref: f,
|
|
1325
|
+
class: w([
|
|
1326
|
+
"semi-select-content-wrapper",
|
|
1327
|
+
J.value.length ? void 0 : "semi-select-content-wrapper-empty",
|
|
1328
|
+
(V.value.maxTagCount || V.value.ellipsisTrigger) && !j(q).isOpen ? "semi-select-content-wrapper-one-line" : void 0
|
|
1329
|
+
])
|
|
1330
|
+
}, [J.value.length ? (E(), g(fe(dt.value), le(S({ key: 0 }, ft.value)), {
|
|
1331
|
+
default: M(() => [
|
|
1332
|
+
(E(), g(fe(pt.value), le(ae(mt.value)), {
|
|
1333
|
+
default: M(() => [(E(!0), v(m, null, D(Y.value, (t, n) => (E(), v("div", {
|
|
1334
|
+
key: t.value ?? n,
|
|
1335
|
+
"data-select-tag-index": n,
|
|
1336
|
+
class: w(["semi-tag semi-tag-large semi-tag-light semi-tag-white-light semi-tag-closable", t.disabled || V.value.disabled ? "semi-tag-disabled" : void 0]),
|
|
1337
|
+
"aria-label": `Closable Tag: ${String(t.label ?? t.value ?? "")}`,
|
|
1338
|
+
"aria-disabled": t.disabled || V.value.disabled,
|
|
1339
|
+
role: "button",
|
|
1340
|
+
tabindex: "-1"
|
|
1341
|
+
}, [y("div", Ge, [O(e.$slots, "selectedItem", {
|
|
1342
|
+
option: t,
|
|
1343
|
+
index: n
|
|
1344
|
+
}, () => [b(j(F), { content: t.label }, null, 8, ["content"])])]), !t.disabled && !V.value.disabled ? (E(), v("div", {
|
|
1345
|
+
key: 0,
|
|
1346
|
+
class: "semi-tag-close",
|
|
1347
|
+
onClick: ye((e) => j(K).removeTag(t), ["stop", "prevent"])
|
|
1348
|
+
}, [b(j(Se), { size: "small" })], 8, Ke)) : _("", !0)], 10, We))), 128))]),
|
|
1349
|
+
_: 3
|
|
1350
|
+
}, 16)),
|
|
1351
|
+
X.value > 0 && V.value.showRestTagsPopover ? (E(), g(d, S({
|
|
1352
|
+
key: 0,
|
|
1353
|
+
"prefix-cls": "semi-popover",
|
|
1354
|
+
position: "top",
|
|
1355
|
+
"show-arrow": !0,
|
|
1356
|
+
"auto-adjust-overflow": !0
|
|
1357
|
+
}, V.value.restTagsPopoverProps), {
|
|
1358
|
+
content: M(() => [y("div", qe, [(E(!0), v(m, null, D(J.value.slice(Y.value.length), (e, t) => (E(), v("div", {
|
|
1359
|
+
key: e.value ?? t,
|
|
1360
|
+
class: "semi-tag semi-tag-large semi-tag-light semi-tag-white-light"
|
|
1361
|
+
}, [y("div", Je, [b(j(F), { content: e.label }, null, 8, ["content"])])]))), 128))])]),
|
|
1362
|
+
default: M(() => [y("div", {
|
|
1363
|
+
class: w(["semi-tag semi-tag-large semi-tag-light semi-tag-grey-light", Z.value ? "semi-select-content-wrapper-collapse-tag" : void 0]),
|
|
1364
|
+
"data-select-collapse-tag": "",
|
|
1365
|
+
style: {
|
|
1366
|
+
"margin-right": "0",
|
|
1367
|
+
"flex-shrink": "0",
|
|
1368
|
+
"background-color": "transparent"
|
|
1369
|
+
}
|
|
1370
|
+
}, [y("div", Ye, " +" + A(X.value), 1)], 2)]),
|
|
1371
|
+
_: 1
|
|
1372
|
+
}, 16)) : _("", !0),
|
|
1373
|
+
X.value > 0 && !V.value.showRestTagsPopover ? (E(), v("div", {
|
|
1374
|
+
key: 1,
|
|
1375
|
+
class: w(["semi-tag semi-tag-large semi-tag-light semi-tag-grey-light", Z.value ? "semi-select-content-wrapper-collapse-tag" : void 0]),
|
|
1376
|
+
"data-select-collapse-tag": "",
|
|
1377
|
+
style: {
|
|
1378
|
+
"margin-right": "0",
|
|
1379
|
+
"flex-shrink": "0",
|
|
1380
|
+
"background-color": "transparent"
|
|
1381
|
+
}
|
|
1382
|
+
}, [y("div", Xe, "+" + A(X.value), 1)], 2)) : _("", !0)
|
|
1383
|
+
]),
|
|
1384
|
+
_: 3
|
|
1385
|
+
}, 16)) : j(q).inputValue ? _("", !0) : (E(), v("span", Ze, [b(j(F), { content: V.value.placeholder }, null, 8, ["content"])])), V.value.filter && V.value.searchPosition === "trigger" ? (E(), v("div", {
|
|
1386
|
+
key: 2,
|
|
1387
|
+
class: "semi-input-wrapper semi-input-wrapper-default",
|
|
1388
|
+
style: T({ width: j(q).inputValue ? `${j(q).inputValue.length * 16}px` : "2px" })
|
|
1389
|
+
}, [y("input", S({
|
|
1390
|
+
class: "semi-input semi-input-default semi-select-input semi-select-input-multiple",
|
|
1391
|
+
value: j(q).inputValue,
|
|
1392
|
+
"aria-activedescendant": Q.value
|
|
1393
|
+
}, V.value.inputProps, {
|
|
1394
|
+
onInput: wt,
|
|
1395
|
+
onFocus: t[6] ||= ye(() => {}, ["stop"]),
|
|
1396
|
+
onBlur: t[7] ||= (...e) => j(K).handleInputBlur && j(K).handleInputBlur(...e)
|
|
1397
|
+
}), null, 16, Qe)], 4)) : _("", !0)], 2)) : (E(), v("div", $e, [y("span", { class: w([
|
|
1398
|
+
"semi-select-selection-text",
|
|
1399
|
+
J.value.length || j(q).inputValue ? void 0 : "semi-select-selection-placeholder",
|
|
1400
|
+
j(q).showInput ? "semi-select-selection-text-inactive" : void 0
|
|
1401
|
+
]) }, [J.value[0] ? O(e.$slots, "selectedItem", {
|
|
1402
|
+
option: J.value[0],
|
|
1403
|
+
index: 0
|
|
1404
|
+
}, () => [b(j(F), { content: J.value[0].label }, null, 8, ["content"])], void 0, 0) : j(q).inputValue ? _("", !0) : (E(), g(j(F), {
|
|
1405
|
+
key: 1,
|
|
1406
|
+
content: V.value.placeholder
|
|
1407
|
+
}, null, 8, ["content"]))], 2), V.value.filter && V.value.searchPosition === "trigger" && j(q).showInput ? (E(), v("div", et, [y("input", S({
|
|
1408
|
+
class: "semi-input semi-input-default semi-select-input semi-select-input-single",
|
|
1409
|
+
value: j(q).inputValue,
|
|
1410
|
+
"aria-activedescendant": Q.value
|
|
1411
|
+
}, V.value.inputProps, {
|
|
1412
|
+
onInput: wt,
|
|
1413
|
+
onFocus: t[8] ||= ye(() => {}, ["stop"]),
|
|
1414
|
+
onBlur: t[9] ||= (...e) => j(K).handleInputBlur && j(K).handleInputBlur(...e)
|
|
1415
|
+
}), null, 16, tt)])) : _("", !0)]))]),
|
|
1416
|
+
e.$slots.suffix ? (E(), v("div", nt, [O(e.$slots, "suffix")])) : _("", !0),
|
|
1417
|
+
vt.value ? (E(), v("div", {
|
|
1418
|
+
key: 2,
|
|
1419
|
+
class: "semi-select-clear",
|
|
1420
|
+
onClick: Tt
|
|
1421
|
+
}, [O(e.$slots, "clearIcon", {}, () => [b(j(xe))])])) : V.value.showArrow ? (E(), v("div", rt, [O(e.$slots, "arrowIcon", {}, () => [b(j(be), { "aria-label": "" })])])) : (E(), v("div", it))
|
|
1422
|
+
], 64))], 16, Ve)]),
|
|
1423
|
+
_: 3
|
|
1424
|
+
}, 16, [
|
|
1425
|
+
"visible",
|
|
1426
|
+
"position",
|
|
1427
|
+
"spacing",
|
|
1428
|
+
"z-index",
|
|
1429
|
+
"motion",
|
|
1430
|
+
"auto-adjust-overflow",
|
|
1431
|
+
"margin",
|
|
1432
|
+
"mouse-enter-delay",
|
|
1433
|
+
"mouse-leave-delay",
|
|
1434
|
+
"stop-propagation",
|
|
1435
|
+
"re-pos-key"
|
|
1436
|
+
])], 64));
|
|
1437
|
+
}
|
|
1438
|
+
}), R = /* @__PURE__ */ x({
|
|
1439
|
+
name: "SelectOption",
|
|
1440
|
+
__name: "SelectOption",
|
|
1441
|
+
props: {
|
|
1442
|
+
value: {},
|
|
1443
|
+
label: { type: [
|
|
1444
|
+
Object,
|
|
1445
|
+
String,
|
|
1446
|
+
Number,
|
|
1447
|
+
Boolean,
|
|
1448
|
+
null,
|
|
1449
|
+
Array
|
|
1450
|
+
] },
|
|
1451
|
+
disabled: { type: Boolean },
|
|
1452
|
+
showTick: { type: Boolean },
|
|
1453
|
+
class: { type: [
|
|
1454
|
+
Boolean,
|
|
1455
|
+
null,
|
|
1456
|
+
String,
|
|
1457
|
+
Object,
|
|
1458
|
+
Array
|
|
1459
|
+
] },
|
|
1460
|
+
style: { type: [
|
|
1461
|
+
Boolean,
|
|
1462
|
+
null,
|
|
1463
|
+
String,
|
|
1464
|
+
Object,
|
|
1465
|
+
Array
|
|
1466
|
+
] }
|
|
1467
|
+
},
|
|
1468
|
+
setup(e) {
|
|
1469
|
+
return (e, t) => O(e.$slots, "default");
|
|
1470
|
+
}
|
|
1471
|
+
});
|
|
1472
|
+
//#endregion
|
|
1473
|
+
export { L as n, R as t };
|