naive-ui 2.24.6 → 2.25.2
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/es/_internal/clear/src/Clear.js +3 -2
- package/es/_internal/close/src/Close.js +1 -1
- package/es/_internal/icon/src/Icon.js +1 -1
- package/es/_internal/icons/ArrowUp.d.ts +2 -0
- package/es/_internal/icons/ArrowUp.js +9 -0
- package/es/_internal/icons/index.d.ts +1 -0
- package/es/_internal/icons/index.js +1 -0
- package/es/_internal/loading/src/Loading.js +1 -1
- package/es/_internal/menu-mask/src/MenuMask.js +1 -1
- package/es/_internal/scrollbar/src/ScrollBar.js +1 -1
- package/es/_internal/select-menu/src/SelectMenu.d.ts +11 -6
- package/es/_internal/select-menu/src/SelectMenu.js +49 -24
- package/es/_internal/selection/src/Selection.d.ts +42 -29
- package/es/_internal/selection/src/Selection.js +100 -93
- package/es/_internal/selection/src/interface.d.ts +2 -2
- package/es/_internal/selection/src/styles/index.cssr.js +16 -31
- package/es/_internal/selection/styles/dark.js +3 -3
- package/es/_internal/selection/styles/light.d.ts +6 -6
- package/es/_internal/selection/styles/light.js +3 -3
- package/es/_internal/slot-machine/src/SlotMachine.js +1 -1
- package/es/_internal/wave/src/Wave.js +1 -1
- package/es/_mixins/index.d.ts +1 -1
- package/es/_mixins/index.js +1 -1
- package/es/_mixins/use-config.js +1 -1
- package/es/_mixins/use-css-vars-class.d.ts +11 -2
- package/es/_mixins/use-css-vars-class.js +49 -18
- package/es/_mixins/use-form-item.d.ts +4 -0
- package/es/_mixins/use-form-item.js +7 -0
- package/es/_mixins/use-hljs.js +1 -1
- package/es/_mixins/use-locale.js +1 -1
- package/es/_mixins/use-style.js +1 -1
- package/es/_mixins/use-theme.d.ts +1 -1
- package/es/_mixins/use-theme.js +2 -2
- package/es/_utils/css/color-to-class.d.ts +1 -0
- package/es/_utils/css/color-to-class.js +3 -0
- package/es/_utils/css/format-length.d.ts +2 -2
- package/es/_utils/css/format-length.js +1 -2
- package/es/_utils/css/index.d.ts +2 -1
- package/es/_utils/css/index.js +2 -1
- package/es/_utils/cssr/index.d.ts +1 -2
- package/es/_utils/cssr/index.js +1 -14
- package/es/_utils/index.d.ts +2 -2
- package/es/_utils/index.js +2 -2
- package/es/_utils/vue/index.d.ts +1 -1
- package/es/_utils/vue/index.js +1 -1
- package/es/_utils/vue/resolve-slot.d.ts +8 -2
- package/es/_utils/vue/resolve-slot.js +17 -1
- package/es/affix/src/Affix.js +1 -1
- package/es/alert/src/Alert.js +1 -1
- package/es/anchor/src/AnchorAdapter.js +1 -1
- package/es/auto-complete/src/AutoComplete.d.ts +16 -1
- package/es/auto-complete/src/AutoComplete.js +9 -5
- package/es/avatar/src/Avatar.js +2 -2
- package/es/avatar/src/AvatarGroup.d.ts +0 -1
- package/es/avatar/src/AvatarGroup.js +2 -3
- package/es/avatar/src/context.d.ts +2 -0
- package/es/avatar/src/context.js +2 -0
- package/es/back-top/src/BackTop.js +1 -1
- package/es/badge/src/Badge.js +1 -1
- package/es/breadcrumb/src/Breadcrumb.js +1 -1
- package/es/button/src/Button.d.ts +4 -2
- package/es/button/src/Button.js +270 -245
- package/es/button/src/ButtonGroup.js +1 -1
- package/es/button/src/styles/button.cssr.js +1 -0
- package/es/button/styles/index.d.ts +1 -1
- package/es/button/styles/index.js +1 -1
- package/es/button/styles/rtl.d.ts +2 -5
- package/es/button/styles/rtl.js +1 -1
- package/es/calendar/src/Calendar.js +1 -1
- package/es/card/src/Card.d.ts +8 -2
- package/es/card/src/Card.js +44 -40
- package/es/card/styles/index.d.ts +1 -1
- package/es/card/styles/index.js +1 -1
- package/es/card/styles/rtl.d.ts +2 -5
- package/es/card/styles/rtl.js +1 -1
- package/es/carousel/src/Carousel.js +4 -1
- package/es/carousel/src/CarouselArrow.js +6 -9
- package/es/carousel/src/styles/index.cssr.js +59 -48
- package/es/carousel/styles/light.js +2 -2
- package/es/cascader/src/Cascader.d.ts +36 -34
- package/es/cascader/src/Cascader.js +6 -6
- package/es/cascader/src/CascaderMenu.d.ts +3 -3
- package/es/cascader/src/CascaderOption.d.ts +3 -3
- package/es/cascader/src/CascaderSelectMenu.d.ts +3 -3
- package/es/cascader/src/CascaderSubmenu.d.ts +3 -3
- package/es/cascader/styles/light.d.ts +3 -3
- package/es/checkbox/src/Checkbox.js +1 -1
- package/es/checkbox/src/styles/index.cssr.js +12 -12
- package/es/code/src/Code.js +1 -1
- package/es/collapse/src/Collapse.js +1 -1
- package/es/collapse-transition/src/CollapseTransition.js +1 -1
- package/es/color-picker/src/ColorInputUnit.js +1 -1
- package/es/color-picker/src/ColorPicker.d.ts +24 -17
- package/es/color-picker/src/ColorPicker.js +7 -4
- package/es/color-picker/src/ColorPickerTrigger.js +1 -1
- package/es/color-picker/src/context.d.ts +9 -0
- package/es/color-picker/src/context.js +2 -0
- package/es/color-picker/src/styles/index.cssr.js +1 -0
- package/es/components.d.ts +2 -1
- package/es/components.js +2 -1
- package/es/composables/use-theme-vars.js +1 -1
- package/es/config-provider/src/ConfigProvider.d.ts +15 -3
- package/es/config-provider/src/ConfigProvider.js +29 -3
- package/es/config-provider/src/context.d.ts +2 -0
- package/es/config-provider/src/context.js +2 -0
- package/es/config-provider/src/interface.d.ts +2 -1
- package/es/config-provider/src/internal-interface.d.ts +4 -0
- package/es/data-table/src/DataTable.d.ts +33 -33
- package/es/data-table/src/DataTable.js +1 -1
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +6 -6
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +6 -6
- package/es/data-table/src/TableParts/Body.d.ts +6 -6
- package/es/data-table/src/TableParts/Cell.d.ts +12 -12
- package/es/data-table/src/TableParts/Header.d.ts +6 -6
- package/es/data-table/src/interface.d.ts +2 -2
- package/es/data-table/src/use-check.d.ts +2 -2
- package/es/data-table/src/use-group-header.d.ts +1 -1
- package/es/data-table/src/use-scroll.d.ts +1 -1
- package/es/data-table/src/use-scroll.js +3 -3
- package/es/data-table/src/use-sorter.d.ts +1 -1
- package/es/data-table/src/use-table-data.d.ts +1 -1
- package/es/data-table/src/utils.d.ts +2 -1
- package/es/data-table/src/utils.js +13 -3
- package/es/data-table/styles/light.d.ts +3 -3
- package/es/date-picker/src/DatePicker.d.ts +2 -1
- package/es/date-picker/src/DatePicker.js +6 -6
- package/es/descriptions/src/Descriptions.d.ts +1 -1
- package/es/descriptions/src/Descriptions.js +1 -1
- package/es/dialog/index.d.ts +3 -3
- package/es/dialog/index.js +2 -2
- package/es/dialog/src/Dialog.d.ts +27 -60
- package/es/dialog/src/Dialog.js +4 -31
- package/es/dialog/src/DialogEnvironment.d.ts +8 -9
- package/es/dialog/src/DialogEnvironment.js +3 -2
- package/es/dialog/src/DialogProvider.d.ts +3 -5
- package/es/dialog/src/DialogProvider.js +5 -6
- package/es/dialog/src/context.d.ts +3 -0
- package/es/dialog/src/context.js +3 -0
- package/es/dialog/src/dialogProps.d.ts +32 -0
- package/es/dialog/src/dialogProps.js +29 -0
- package/es/dialog/src/use-dialog.js +1 -1
- package/es/divider/src/Divider.js +1 -1
- package/es/drawer/index.d.ts +1 -0
- package/es/drawer/src/Drawer.js +1 -1
- package/es/dropdown/src/Dropdown.d.ts +17 -5
- package/es/dropdown/src/Dropdown.js +6 -5
- package/es/dropdown/src/DropdownGroup.js +1 -0
- package/es/dropdown/src/DropdownGroupHeader.js +1 -2
- package/es/dropdown/src/DropdownMenu.d.ts +0 -1
- package/es/dropdown/src/DropdownMenu.js +4 -4
- package/es/dropdown/src/DropdownOption.d.ts +3 -0
- package/es/dropdown/src/DropdownOption.js +4 -4
- package/es/dropdown/src/context.d.ts +6 -0
- package/es/dropdown/src/context.js +4 -0
- package/es/dropdown/src/interface.d.ts +1 -1
- package/es/dynamic-input/src/DynamicInput.d.ts +10 -1
- package/es/dynamic-input/src/DynamicInput.js +61 -18
- package/es/dynamic-tags/src/DynamicTags.d.ts +7 -16
- package/es/dynamic-tags/src/DynamicTags.js +14 -16
- package/es/element/src/Element.js +1 -1
- package/es/ellipsis/src/Ellipsis.js +1 -1
- package/es/empty/src/Empty.js +2 -2
- package/es/form/src/Form.d.ts +1 -1
- package/es/form/src/Form.js +2 -2
- package/es/form/src/FormItem.d.ts +1 -1
- package/es/form/src/FormItem.js +3 -2
- package/es/form/src/FormItemCol.d.ts +1 -1
- package/es/form/src/FormItemGridItem.d.ts +1 -1
- package/es/form/src/context.d.ts +3 -0
- package/es/form/src/context.js +3 -0
- package/es/form/src/interface.d.ts +4 -3
- package/es/form/src/interface.js +1 -3
- package/es/form/src/styles/form-item.cssr.js +6 -5
- package/es/form/src/utils.js +1 -1
- package/es/global-style/src/GlobalStyle.js +1 -1
- package/es/gradient-text/src/GradientText.js +1 -1
- package/es/grid/src/Grid.d.ts +0 -1
- package/es/grid/src/Grid.js +2 -3
- package/es/grid/src/GridItem.js +1 -1
- package/es/grid/src/config.d.ts +3 -0
- package/es/grid/src/config.js +3 -0
- package/es/icon/index.d.ts +1 -1
- package/es/icon/index.js +1 -1
- package/es/icon/src/Icon.d.ts +1 -2
- package/es/icon/src/Icon.js +2 -2
- package/es/icon-wrapper/index.d.ts +1 -0
- package/es/icon-wrapper/index.js +1 -0
- package/es/icon-wrapper/src/IconWrapper.d.ts +50 -0
- package/es/icon-wrapper/src/IconWrapper.js +50 -0
- package/es/icon-wrapper/src/styles/index.cssr.d.ts +2 -0
- package/es/icon-wrapper/src/styles/index.cssr.js +16 -0
- package/es/icon-wrapper/styles/dark.d.ts +3 -0
- package/es/icon-wrapper/styles/dark.js +8 -0
- package/es/icon-wrapper/styles/index.d.ts +3 -0
- package/es/icon-wrapper/styles/index.js +2 -0
- package/es/icon-wrapper/styles/light.d.ts +10 -0
- package/es/icon-wrapper/styles/light.js +14 -0
- package/es/image/src/Image.d.ts +1 -1
- package/es/image/src/ImagePreview.js +1 -1
- package/es/input/src/Input.d.ts +6 -1
- package/es/input/src/Input.js +21 -17
- package/es/input/src/InputGroup.js +1 -1
- package/es/input/src/InputGroupLabel.js +1 -1
- package/es/input/src/WordCount.js +9 -8
- package/es/input/src/styles/input.cssr.js +5 -5
- package/es/input-number/src/InputNumber.d.ts +2 -1
- package/es/input-number/src/InputNumber.js +23 -21
- package/es/layout/src/Layout.js +1 -1
- package/es/layout/src/LayoutFooter.js +1 -1
- package/es/layout/src/LayoutHeader.js +1 -1
- package/es/layout/src/LayoutSider.js +1 -1
- package/es/legacy-grid/src/Col.js +0 -3
- package/es/legacy-grid/src/Row.js +1 -1
- package/es/list/src/List.js +1 -1
- package/es/loading-bar/src/LoadingBar.js +2 -2
- package/es/loading-bar/src/LoadingBarProvider.d.ts +3 -8
- package/es/loading-bar/src/LoadingBarProvider.js +1 -3
- package/es/loading-bar/src/context.d.ts +7 -0
- package/es/loading-bar/src/context.js +3 -0
- package/es/loading-bar/src/use-loading-bar.js +1 -1
- package/es/locales/common/deDE.js +13 -15
- package/es/locales/common/enGB.d.ts +109 -0
- package/es/locales/common/enGB.js +109 -0
- package/es/locales/common/eo.d.ts +109 -0
- package/es/locales/common/eo.js +109 -0
- package/es/locales/common/jaJP.js +12 -14
- package/es/locales/common/plPL.d.ts +3 -0
- package/es/locales/common/plPL.js +109 -0
- package/es/locales/date/enGB.d.ts +3 -0
- package/es/locales/date/enGB.js +6 -0
- package/es/locales/date/eo.d.ts +3 -0
- package/es/locales/date/eo.js +6 -0
- package/es/locales/date/plPL.d.ts +3 -0
- package/es/locales/date/plPL.js +6 -0
- package/es/locales/index.d.ts +6 -0
- package/es/locales/index.js +6 -0
- package/es/log/index.d.ts +1 -1
- package/es/log/src/Log.d.ts +17 -12
- package/es/log/src/Log.js +10 -17
- package/es/log/src/LogLine.js +1 -1
- package/es/log/src/context.d.ts +2 -0
- package/es/log/src/context.js +2 -0
- package/es/log/src/styles/index.cssr.js +2 -3
- package/es/mention/src/Mention.d.ts +16 -1
- package/es/mention/src/Mention.js +7 -3
- package/es/menu/src/Menu.d.ts +3 -5
- package/es/menu/src/Menu.js +3 -3
- package/es/menu/src/MenuDivider.js +1 -1
- package/es/menu/src/MenuOption.d.ts +1 -2
- package/es/menu/src/MenuOption.js +1 -1
- package/es/menu/src/MenuOptionContent.js +1 -1
- package/es/menu/src/MenuOptionGroup.d.ts +1 -4
- package/es/menu/src/MenuOptionGroup.js +4 -5
- package/es/menu/src/Submenu.d.ts +1 -4
- package/es/menu/src/Submenu.js +3 -4
- package/es/menu/src/context.d.ts +4 -0
- package/es/menu/src/context.js +4 -0
- package/es/menu/src/use-menu-child.js +1 -3
- package/es/menu/src/useCheckDeprecated.d.ts +1 -1
- package/es/menu/src/utils.d.ts +1 -1
- package/es/menu/src/utils.js +5 -3
- package/es/message/src/Message.d.ts +2 -158
- package/es/message/src/Message.js +2 -2
- package/es/message/src/MessageProvider.d.ts +4 -9
- package/es/message/src/MessageProvider.js +2 -3
- package/es/message/src/context.d.ts +7 -0
- package/es/message/src/context.js +3 -0
- package/es/message/src/types.d.ts +1 -1
- package/es/message/src/use-message.js +1 -1
- package/es/modal/src/BodyWrapper.d.ts +5 -3
- package/es/modal/src/BodyWrapper.js +2 -2
- package/es/modal/src/Modal.d.ts +7 -4
- package/es/modal/src/Modal.js +2 -2
- package/es/modal/src/presetProps.d.ts +2 -1
- package/es/modal/src/presetProps.js +1 -1
- package/es/notification/index.d.ts +1 -1
- package/es/notification/src/Notification.d.ts +1 -2
- package/es/notification/src/Notification.js +3 -5
- package/es/notification/src/NotificationContainer.d.ts +1 -2
- package/es/notification/src/NotificationContainer.js +2 -2
- package/es/notification/src/NotificationEnvironment.d.ts +3 -4
- package/es/notification/src/NotificationEnvironment.js +3 -3
- package/es/notification/src/NotificationProvider.d.ts +10 -6
- package/es/notification/src/NotificationProvider.js +6 -6
- package/es/notification/src/context.d.ts +2 -0
- package/es/notification/src/context.js +2 -0
- package/es/page-header/src/PageHeader.js +1 -1
- package/es/pagination/src/Pagination.d.ts +33 -33
- package/es/pagination/src/Pagination.js +1 -1
- package/es/pagination/styles/light.d.ts +3 -3
- package/es/popconfirm/src/Popconfirm.d.ts +21 -8
- package/es/popconfirm/src/Popconfirm.js +1 -1
- package/es/popover/index.d.ts +1 -0
- package/es/popover/src/Popover.d.ts +21 -4
- package/es/popover/src/Popover.js +9 -2
- package/es/popover/src/PopoverBody.d.ts +4 -0
- package/es/popover/src/PopoverBody.js +13 -11
- package/es/popover/src/styles/index.cssr.js +2 -2
- package/es/popselect/src/Popselect.d.ts +31 -8
- package/es/popselect/src/Popselect.js +8 -6
- package/es/popselect/src/PopselectPanel.d.ts +2 -5
- package/es/popselect/src/PopselectPanel.js +4 -2
- package/es/progress/src/Circle.d.ts +19 -3
- package/es/progress/src/Circle.js +41 -22
- package/es/progress/src/Progress.d.ts +15 -6
- package/es/progress/src/Progress.js +44 -30
- package/es/progress/src/styles/index.cssr.js +1 -1
- package/es/radio/src/Radio.js +1 -1
- package/es/radio/src/RadioGroup.js +1 -1
- package/es/rate/src/Rate.js +1 -1
- package/es/result/src/Result.js +1 -1
- package/es/select/index.d.ts +2 -0
- package/es/select/src/Select.d.ts +71 -54
- package/es/select/src/Select.js +82 -47
- package/es/select/src/interface.d.ts +2 -0
- package/es/select/styles/light.d.ts +3 -3
- package/es/skeleton/src/Skeleton.js +1 -1
- package/es/slider/src/Slider.js +1 -1
- package/es/space/src/Space.js +1 -1
- package/es/spin/src/Spin.js +1 -1
- package/es/statistic/src/Statistic.js +1 -1
- package/es/steps/src/Steps.js +1 -1
- package/es/switch/src/Switch.js +1 -1
- package/es/table/src/Table.js +1 -1
- package/es/tabs/src/Tabs.d.ts +7 -4
- package/es/tabs/src/Tabs.js +12 -4
- package/es/tag/src/Tag.d.ts +3 -1
- package/es/tag/src/Tag.js +61 -41
- package/es/tag/src/styles/index.cssr.js +5 -17
- package/es/tag/styles/index.d.ts +1 -1
- package/es/tag/styles/index.js +1 -1
- package/es/tag/styles/rtl.d.ts +2 -5
- package/es/tag/styles/rtl.js +1 -1
- package/es/themes/dark.js +3 -0
- package/es/themes/light.js +3 -0
- package/es/themes/utils.d.ts +2 -1
- package/es/themes/utils.js +16 -4
- package/es/thing/src/Thing.js +1 -1
- package/es/time-picker/src/TimePicker.d.ts +7 -5
- package/es/time-picker/src/TimePicker.js +5 -5
- package/es/timeline/src/Timeline.js +1 -1
- package/es/tooltip/src/Tooltip.d.ts +20 -7
- package/es/tooltip/src/Tooltip.js +1 -1
- package/es/transfer/src/Transfer.d.ts +1 -1
- package/es/transfer/src/Transfer.js +1 -1
- package/es/tree/src/Tree.d.ts +6 -2
- package/es/tree/src/Tree.js +15 -8
- package/es/tree/src/TreeNode.d.ts +2 -0
- package/es/tree/src/TreeNode.js +37 -10
- package/es/tree/src/TreeNodeContent.d.ts +3 -1
- package/es/tree/src/TreeNodeContent.js +4 -3
- package/es/tree/src/interface.d.ts +5 -1
- package/es/tree/src/utils.js +1 -1
- package/es/tree-select/src/TreeSelect.d.ts +46 -44
- package/es/tree-select/src/TreeSelect.js +8 -5
- package/es/tree-select/styles/light.d.ts +3 -3
- package/es/typography/src/a.js +1 -1
- package/es/typography/src/blockquote.js +1 -1
- package/es/typography/src/create-header.js +1 -1
- package/es/typography/src/hr.js +1 -1
- package/es/typography/src/ol.js +1 -1
- package/es/typography/src/p.js +1 -1
- package/es/typography/src/text.js +1 -1
- package/es/typography/src/ul.js +1 -1
- package/es/upload/src/Upload.js +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/clear/src/Clear.js +3 -2
- package/lib/_internal/close/src/Close.js +1 -1
- package/lib/_internal/icon/src/Icon.js +1 -1
- package/lib/_internal/icons/ArrowUp.d.ts +2 -0
- package/lib/_internal/icons/ArrowUp.js +11 -0
- package/lib/_internal/icons/index.d.ts +1 -0
- package/lib/_internal/icons/index.js +3 -1
- package/lib/_internal/loading/src/Loading.js +1 -1
- package/lib/_internal/menu-mask/src/MenuMask.js +1 -1
- package/lib/_internal/scrollbar/src/ScrollBar.js +1 -1
- package/lib/_internal/select-menu/src/SelectMenu.d.ts +11 -6
- package/lib/_internal/select-menu/src/SelectMenu.js +47 -22
- package/lib/_internal/selection/src/Selection.d.ts +42 -29
- package/lib/_internal/selection/src/Selection.js +99 -92
- package/lib/_internal/selection/src/interface.d.ts +2 -2
- package/lib/_internal/selection/src/styles/index.cssr.js +15 -30
- package/lib/_internal/selection/styles/dark.js +3 -3
- package/lib/_internal/selection/styles/light.d.ts +6 -6
- package/lib/_internal/selection/styles/light.js +3 -3
- package/lib/_internal/slot-machine/src/SlotMachine.js +1 -1
- package/lib/_internal/wave/src/Wave.js +1 -1
- package/lib/_mixins/index.d.ts +1 -1
- package/lib/_mixins/index.js +3 -2
- package/lib/_mixins/use-config.js +2 -2
- package/lib/_mixins/use-css-vars-class.d.ts +11 -2
- package/lib/_mixins/use-css-vars-class.js +50 -22
- package/lib/_mixins/use-form-item.d.ts +4 -0
- package/lib/_mixins/use-form-item.js +7 -0
- package/lib/_mixins/use-hljs.js +2 -2
- package/lib/_mixins/use-locale.js +2 -2
- package/lib/_mixins/use-style.js +1 -1
- package/lib/_mixins/use-theme.d.ts +1 -1
- package/lib/_mixins/use-theme.js +3 -3
- package/lib/_utils/css/color-to-class.d.ts +1 -0
- package/lib/_utils/css/color-to-class.js +7 -0
- package/lib/_utils/css/format-length.d.ts +2 -2
- package/lib/_utils/css/format-length.js +2 -1
- package/lib/_utils/css/index.d.ts +2 -1
- package/lib/_utils/css/index.js +4 -5
- package/lib/_utils/cssr/index.d.ts +1 -2
- package/lib/_utils/cssr/index.js +1 -15
- package/lib/_utils/index.d.ts +2 -2
- package/lib/_utils/index.js +6 -1
- package/lib/_utils/vue/index.d.ts +1 -1
- package/lib/_utils/vue/index.js +4 -1
- package/lib/_utils/vue/resolve-slot.d.ts +8 -2
- package/lib/_utils/vue/resolve-slot.js +21 -2
- package/lib/affix/src/Affix.js +1 -1
- package/lib/alert/src/Alert.js +1 -1
- package/lib/anchor/src/AnchorAdapter.js +1 -1
- package/lib/auto-complete/src/AutoComplete.d.ts +16 -1
- package/lib/auto-complete/src/AutoComplete.js +9 -5
- package/lib/avatar/src/Avatar.js +3 -3
- package/lib/avatar/src/AvatarGroup.d.ts +0 -1
- package/lib/avatar/src/AvatarGroup.js +3 -5
- package/lib/avatar/src/context.d.ts +2 -0
- package/lib/avatar/src/context.js +5 -0
- package/lib/back-top/src/BackTop.js +1 -1
- package/lib/badge/src/Badge.js +1 -1
- package/lib/breadcrumb/src/Breadcrumb.js +1 -1
- package/lib/button/src/Button.d.ts +4 -2
- package/lib/button/src/Button.js +268 -243
- package/lib/button/src/ButtonGroup.js +1 -1
- package/lib/button/src/styles/button.cssr.js +1 -0
- package/lib/button/styles/index.d.ts +1 -1
- package/lib/button/styles/index.js +1 -1
- package/lib/button/styles/rtl.d.ts +2 -5
- package/lib/button/styles/rtl.js +2 -1
- package/lib/calendar/src/Calendar.js +1 -1
- package/lib/card/src/Card.d.ts +8 -2
- package/lib/card/src/Card.js +43 -39
- package/lib/card/styles/index.d.ts +1 -1
- package/lib/card/styles/index.js +1 -1
- package/lib/card/styles/rtl.d.ts +2 -5
- package/lib/card/styles/rtl.js +2 -1
- package/lib/carousel/src/Carousel.js +4 -1
- package/lib/carousel/src/CarouselArrow.js +5 -8
- package/lib/carousel/src/styles/index.cssr.js +59 -48
- package/lib/carousel/styles/light.js +2 -2
- package/lib/cascader/src/Cascader.d.ts +36 -34
- package/lib/cascader/src/Cascader.js +6 -6
- package/lib/cascader/src/CascaderMenu.d.ts +3 -3
- package/lib/cascader/src/CascaderOption.d.ts +3 -3
- package/lib/cascader/src/CascaderSelectMenu.d.ts +3 -3
- package/lib/cascader/src/CascaderSubmenu.d.ts +3 -3
- package/lib/cascader/styles/light.d.ts +3 -3
- package/lib/checkbox/src/Checkbox.js +1 -1
- package/lib/checkbox/src/styles/index.cssr.js +12 -12
- package/lib/code/src/Code.js +1 -1
- package/lib/collapse/src/Collapse.js +1 -1
- package/lib/collapse-transition/src/CollapseTransition.js +1 -1
- package/lib/color-picker/src/ColorInputUnit.js +2 -2
- package/lib/color-picker/src/ColorPicker.d.ts +24 -17
- package/lib/color-picker/src/ColorPicker.js +8 -5
- package/lib/color-picker/src/ColorPickerTrigger.js +2 -2
- package/lib/color-picker/src/context.d.ts +9 -0
- package/lib/color-picker/src/context.js +5 -0
- package/lib/color-picker/src/styles/index.cssr.js +1 -0
- package/lib/components.d.ts +2 -1
- package/lib/components.js +2 -1
- package/lib/composables/use-theme-vars.js +2 -2
- package/lib/config-provider/src/ConfigProvider.d.ts +15 -3
- package/lib/config-provider/src/ConfigProvider.js +31 -5
- package/lib/config-provider/src/context.d.ts +2 -0
- package/lib/config-provider/src/context.js +5 -0
- package/lib/config-provider/src/interface.d.ts +2 -1
- package/lib/config-provider/src/internal-interface.d.ts +4 -0
- package/lib/data-table/src/DataTable.d.ts +33 -33
- package/lib/data-table/src/DataTable.js +1 -1
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +6 -6
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +6 -6
- package/lib/data-table/src/TableParts/Body.d.ts +6 -6
- package/lib/data-table/src/TableParts/Cell.d.ts +12 -12
- package/lib/data-table/src/TableParts/Header.d.ts +6 -6
- package/lib/data-table/src/interface.d.ts +2 -2
- package/lib/data-table/src/use-check.d.ts +2 -2
- package/lib/data-table/src/use-group-header.d.ts +1 -1
- package/lib/data-table/src/use-scroll.d.ts +1 -1
- package/lib/data-table/src/use-scroll.js +2 -2
- package/lib/data-table/src/use-sorter.d.ts +1 -1
- package/lib/data-table/src/use-table-data.d.ts +1 -1
- package/lib/data-table/src/utils.d.ts +2 -1
- package/lib/data-table/src/utils.js +15 -4
- package/lib/data-table/styles/light.d.ts +3 -3
- package/lib/date-picker/src/DatePicker.d.ts +2 -1
- package/lib/date-picker/src/DatePicker.js +6 -6
- package/lib/descriptions/src/Descriptions.d.ts +1 -1
- package/lib/descriptions/src/Descriptions.js +1 -1
- package/lib/dialog/index.d.ts +3 -3
- package/lib/dialog/index.js +2 -5
- package/lib/dialog/src/Dialog.d.ts +27 -60
- package/lib/dialog/src/Dialog.js +5 -32
- package/lib/dialog/src/DialogEnvironment.d.ts +8 -9
- package/lib/dialog/src/DialogEnvironment.js +6 -24
- package/lib/dialog/src/DialogProvider.d.ts +3 -5
- package/lib/dialog/src/DialogProvider.js +8 -12
- package/lib/dialog/src/context.d.ts +3 -0
- package/lib/dialog/src/context.js +6 -0
- package/lib/dialog/src/dialogProps.d.ts +32 -0
- package/lib/dialog/src/dialogProps.js +32 -0
- package/lib/dialog/src/use-dialog.js +2 -2
- package/lib/divider/src/Divider.js +1 -1
- package/lib/drawer/index.d.ts +1 -0
- package/lib/drawer/src/Drawer.js +1 -1
- package/lib/dropdown/src/Dropdown.d.ts +17 -5
- package/lib/dropdown/src/Dropdown.js +6 -6
- package/lib/dropdown/src/DropdownGroup.js +1 -0
- package/lib/dropdown/src/DropdownGroupHeader.js +3 -4
- package/lib/dropdown/src/DropdownMenu.d.ts +0 -1
- package/lib/dropdown/src/DropdownMenu.js +6 -7
- package/lib/dropdown/src/DropdownOption.d.ts +3 -0
- package/lib/dropdown/src/DropdownOption.js +9 -25
- package/lib/dropdown/src/context.d.ts +6 -0
- package/lib/dropdown/src/context.js +7 -0
- package/lib/dropdown/src/interface.d.ts +1 -1
- package/lib/dynamic-input/src/DynamicInput.d.ts +10 -1
- package/lib/dynamic-input/src/DynamicInput.js +59 -16
- package/lib/dynamic-tags/src/DynamicTags.d.ts +7 -16
- package/lib/dynamic-tags/src/DynamicTags.js +12 -14
- package/lib/element/src/Element.js +1 -1
- package/lib/ellipsis/src/Ellipsis.js +1 -1
- package/lib/empty/src/Empty.js +3 -3
- package/lib/form/src/Form.d.ts +1 -1
- package/lib/form/src/Form.js +4 -4
- package/lib/form/src/FormItem.d.ts +1 -1
- package/lib/form/src/FormItem.js +5 -4
- package/lib/form/src/FormItemCol.d.ts +1 -1
- package/lib/form/src/FormItemGridItem.d.ts +1 -1
- package/lib/form/src/context.d.ts +3 -0
- package/lib/form/src/context.js +6 -0
- package/lib/form/src/interface.d.ts +4 -3
- package/lib/form/src/interface.js +0 -4
- package/lib/form/src/styles/form-item.cssr.js +3 -2
- package/lib/form/src/utils.js +4 -4
- package/lib/global-style/src/GlobalStyle.js +2 -2
- package/lib/gradient-text/src/GradientText.js +1 -1
- package/lib/grid/src/Grid.d.ts +0 -1
- package/lib/grid/src/Grid.js +4 -6
- package/lib/grid/src/GridItem.js +2 -2
- package/lib/grid/src/config.d.ts +3 -0
- package/lib/grid/src/config.js +6 -0
- package/lib/icon/index.d.ts +1 -1
- package/lib/icon/index.js +1 -4
- package/lib/icon/src/Icon.d.ts +1 -2
- package/lib/icon/src/Icon.js +3 -2
- package/lib/icon-wrapper/index.d.ts +1 -0
- package/lib/icon-wrapper/index.js +5 -0
- package/lib/icon-wrapper/src/IconWrapper.d.ts +50 -0
- package/lib/icon-wrapper/src/IconWrapper.js +56 -0
- package/lib/icon-wrapper/src/styles/index.cssr.d.ts +2 -0
- package/lib/icon-wrapper/src/styles/index.cssr.js +23 -0
- package/lib/icon-wrapper/styles/dark.d.ts +3 -0
- package/lib/icon-wrapper/styles/dark.js +10 -0
- package/lib/icon-wrapper/styles/index.d.ts +3 -0
- package/lib/icon-wrapper/styles/index.js +10 -0
- package/lib/icon-wrapper/styles/light.d.ts +10 -0
- package/lib/icon-wrapper/styles/light.js +18 -0
- package/lib/image/src/Image.d.ts +1 -1
- package/lib/image/src/ImagePreview.js +1 -1
- package/lib/input/src/Input.d.ts +6 -1
- package/lib/input/src/Input.js +20 -16
- package/lib/input/src/InputGroup.js +1 -1
- package/lib/input/src/InputGroupLabel.js +1 -1
- package/lib/input/src/WordCount.js +9 -8
- package/lib/input/src/styles/input.cssr.js +4 -4
- package/lib/input-number/src/InputNumber.d.ts +2 -1
- package/lib/input-number/src/InputNumber.js +23 -21
- package/lib/layout/src/Layout.js +1 -1
- package/lib/layout/src/LayoutFooter.js +1 -1
- package/lib/layout/src/LayoutHeader.js +1 -1
- package/lib/layout/src/LayoutSider.js +1 -1
- package/lib/legacy-grid/src/Col.js +0 -6
- package/lib/legacy-grid/src/Row.js +1 -1
- package/lib/list/src/List.js +1 -1
- package/lib/loading-bar/src/LoadingBar.js +3 -3
- package/lib/loading-bar/src/LoadingBarProvider.d.ts +3 -8
- package/lib/loading-bar/src/LoadingBarProvider.js +3 -6
- package/lib/loading-bar/src/context.d.ts +7 -0
- package/lib/loading-bar/src/context.js +6 -0
- package/lib/loading-bar/src/use-loading-bar.js +2 -2
- package/lib/locales/common/deDE.js +13 -15
- package/lib/locales/common/enGB.d.ts +109 -0
- package/lib/locales/common/enGB.js +111 -0
- package/lib/locales/common/eo.d.ts +109 -0
- package/lib/locales/common/eo.js +111 -0
- package/lib/locales/common/jaJP.js +12 -14
- package/lib/locales/common/plPL.d.ts +3 -0
- package/lib/locales/common/plPL.js +111 -0
- package/lib/locales/date/enGB.d.ts +3 -0
- package/lib/locales/date/enGB.js +11 -0
- package/lib/locales/date/eo.d.ts +3 -0
- package/lib/locales/date/eo.js +11 -0
- package/lib/locales/date/plPL.d.ts +3 -0
- package/lib/locales/date/plPL.js +11 -0
- package/lib/locales/index.d.ts +6 -0
- package/lib/locales/index.js +13 -1
- package/lib/log/index.d.ts +1 -1
- package/lib/log/src/Log.d.ts +17 -12
- package/lib/log/src/Log.js +10 -18
- package/lib/log/src/LogLine.js +2 -2
- package/lib/log/src/context.d.ts +2 -0
- package/lib/log/src/context.js +5 -0
- package/lib/log/src/styles/index.cssr.js +2 -3
- package/lib/mention/src/Mention.d.ts +16 -1
- package/lib/mention/src/Mention.js +7 -3
- package/lib/menu/src/Menu.d.ts +3 -5
- package/lib/menu/src/Menu.js +3 -4
- package/lib/menu/src/MenuDivider.js +2 -2
- package/lib/menu/src/MenuOption.d.ts +1 -2
- package/lib/menu/src/MenuOption.js +2 -2
- package/lib/menu/src/MenuOptionContent.js +2 -2
- package/lib/menu/src/MenuOptionGroup.d.ts +1 -4
- package/lib/menu/src/MenuOptionGroup.js +7 -8
- package/lib/menu/src/Submenu.d.ts +1 -4
- package/lib/menu/src/Submenu.js +6 -7
- package/lib/menu/src/context.d.ts +4 -0
- package/lib/menu/src/context.js +7 -0
- package/lib/menu/src/use-menu-child.js +4 -6
- package/lib/menu/src/useCheckDeprecated.d.ts +1 -1
- package/lib/menu/src/utils.d.ts +1 -1
- package/lib/menu/src/utils.js +8 -25
- package/lib/message/src/Message.d.ts +2 -158
- package/lib/message/src/Message.js +3 -3
- package/lib/message/src/MessageProvider.d.ts +4 -9
- package/lib/message/src/MessageProvider.js +3 -5
- package/lib/message/src/context.d.ts +7 -0
- package/lib/message/src/context.js +6 -0
- package/lib/message/src/types.d.ts +1 -1
- package/lib/message/src/use-message.js +2 -2
- package/lib/modal/src/BodyWrapper.d.ts +5 -3
- package/lib/modal/src/BodyWrapper.js +3 -3
- package/lib/modal/src/Modal.d.ts +7 -4
- package/lib/modal/src/Modal.js +3 -3
- package/lib/modal/src/presetProps.d.ts +2 -1
- package/lib/modal/src/presetProps.js +2 -2
- package/lib/notification/index.d.ts +1 -1
- package/lib/notification/src/Notification.d.ts +1 -2
- package/lib/notification/src/Notification.js +5 -7
- package/lib/notification/src/NotificationContainer.d.ts +1 -2
- package/lib/notification/src/NotificationContainer.js +4 -3
- package/lib/notification/src/NotificationEnvironment.d.ts +3 -4
- package/lib/notification/src/NotificationEnvironment.js +4 -23
- package/lib/notification/src/NotificationProvider.d.ts +10 -6
- package/lib/notification/src/NotificationProvider.js +9 -9
- package/lib/notification/src/context.d.ts +2 -0
- package/lib/notification/src/context.js +5 -0
- package/lib/page-header/src/PageHeader.js +1 -1
- package/lib/pagination/src/Pagination.d.ts +33 -33
- package/lib/pagination/src/Pagination.js +1 -1
- package/lib/pagination/styles/light.d.ts +3 -3
- package/lib/popconfirm/src/Popconfirm.d.ts +21 -8
- package/lib/popconfirm/src/Popconfirm.js +1 -1
- package/lib/popover/index.d.ts +1 -0
- package/lib/popover/src/Popover.d.ts +21 -4
- package/lib/popover/src/Popover.js +9 -2
- package/lib/popover/src/PopoverBody.d.ts +4 -0
- package/lib/popover/src/PopoverBody.js +11 -9
- package/lib/popover/src/styles/index.cssr.js +2 -2
- package/lib/popselect/src/Popselect.d.ts +31 -8
- package/lib/popselect/src/Popselect.js +8 -6
- package/lib/popselect/src/PopselectPanel.d.ts +2 -5
- package/lib/popselect/src/PopselectPanel.js +4 -2
- package/lib/progress/src/Circle.d.ts +19 -3
- package/lib/progress/src/Circle.js +40 -21
- package/lib/progress/src/Progress.d.ts +15 -6
- package/lib/progress/src/Progress.js +43 -29
- package/lib/progress/src/styles/index.cssr.js +1 -1
- package/lib/radio/src/Radio.js +1 -1
- package/lib/radio/src/RadioGroup.js +1 -1
- package/lib/rate/src/Rate.js +1 -1
- package/lib/result/src/Result.js +1 -1
- package/lib/select/index.d.ts +2 -0
- package/lib/select/src/Select.d.ts +71 -54
- package/lib/select/src/Select.js +82 -47
- package/lib/select/src/interface.d.ts +2 -0
- package/lib/select/styles/light.d.ts +3 -3
- package/lib/skeleton/src/Skeleton.js +1 -1
- package/lib/slider/src/Slider.js +1 -1
- package/lib/space/src/Space.js +1 -1
- package/lib/spin/src/Spin.js +1 -1
- package/lib/statistic/src/Statistic.js +1 -1
- package/lib/steps/src/Steps.js +1 -1
- package/lib/switch/src/Switch.js +1 -1
- package/lib/table/src/Table.js +1 -1
- package/lib/tabs/src/Tabs.d.ts +7 -4
- package/lib/tabs/src/Tabs.js +12 -4
- package/lib/tag/src/Tag.d.ts +3 -1
- package/lib/tag/src/Tag.js +59 -39
- package/lib/tag/src/styles/index.cssr.js +5 -17
- package/lib/tag/styles/index.d.ts +1 -1
- package/lib/tag/styles/index.js +1 -1
- package/lib/tag/styles/rtl.d.ts +2 -5
- package/lib/tag/styles/rtl.js +2 -1
- package/lib/themes/dark.js +87 -84
- package/lib/themes/light.js +87 -84
- package/lib/themes/utils.d.ts +2 -1
- package/lib/themes/utils.js +16 -4
- package/lib/thing/src/Thing.js +1 -1
- package/lib/time-picker/src/TimePicker.d.ts +7 -5
- package/lib/time-picker/src/TimePicker.js +5 -5
- package/lib/timeline/src/Timeline.js +1 -1
- package/lib/tooltip/src/Tooltip.d.ts +20 -7
- package/lib/tooltip/src/Tooltip.js +1 -1
- package/lib/transfer/src/Transfer.d.ts +1 -1
- package/lib/transfer/src/Transfer.js +1 -1
- package/lib/tree/src/Tree.d.ts +6 -2
- package/lib/tree/src/Tree.js +15 -8
- package/lib/tree/src/TreeNode.d.ts +2 -0
- package/lib/tree/src/TreeNode.js +37 -10
- package/lib/tree/src/TreeNodeContent.d.ts +3 -1
- package/lib/tree/src/TreeNodeContent.js +4 -3
- package/lib/tree/src/interface.d.ts +5 -1
- package/lib/tree/src/utils.js +1 -1
- package/lib/tree-select/src/TreeSelect.d.ts +46 -44
- package/lib/tree-select/src/TreeSelect.js +8 -5
- package/lib/tree-select/styles/light.d.ts +3 -3
- package/lib/typography/src/a.js +1 -1
- package/lib/typography/src/blockquote.js +1 -1
- package/lib/typography/src/create-header.js +1 -1
- package/lib/typography/src/hr.js +1 -1
- package/lib/typography/src/ol.js +1 -1
- package/lib/typography/src/p.js +1 -1
- package/lib/typography/src/text.js +1 -1
- package/lib/typography/src/ul.js +1 -1
- package/lib/upload/src/Upload.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +8 -9
- package/volar.d.ts +1 -0
- package/web-types.json +452 -220
package/es/select/src/Select.js
CHANGED
|
@@ -13,7 +13,10 @@ import style from './styles/index.cssr';
|
|
|
13
13
|
const selectProps = Object.assign(Object.assign({}, useTheme.props), { to: useAdjustedTo.propTo, bordered: {
|
|
14
14
|
type: Boolean,
|
|
15
15
|
default: undefined
|
|
16
|
-
}, clearable: Boolean,
|
|
16
|
+
}, clearable: Boolean, clearFilterAfterSelect: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: true
|
|
19
|
+
}, options: {
|
|
17
20
|
type: Array,
|
|
18
21
|
default: () => []
|
|
19
22
|
}, defaultValue: {
|
|
@@ -80,8 +83,8 @@ export default defineComponent({
|
|
|
80
83
|
}
|
|
81
84
|
});
|
|
82
85
|
}
|
|
83
|
-
const { mergedClsPrefixRef, mergedBorderedRef, namespaceRef } = useConfig(props);
|
|
84
|
-
const themeRef = useTheme('Select', '
|
|
86
|
+
const { mergedClsPrefixRef, mergedBorderedRef, namespaceRef, NConfigProvider } = useConfig(props);
|
|
87
|
+
const themeRef = useTheme('Select', '-select', style, selectLight, props, mergedClsPrefixRef);
|
|
85
88
|
const uncontrolledValueRef = ref(props.defaultValue);
|
|
86
89
|
const controlledValueRef = toRef(props, 'value');
|
|
87
90
|
const mergedValueRef = useMergedState(controlledValueRef, uncontrolledValueRef);
|
|
@@ -175,7 +178,7 @@ export default defineComponent({
|
|
|
175
178
|
return null;
|
|
176
179
|
});
|
|
177
180
|
const formItem = useFormItem(props);
|
|
178
|
-
const { mergedSizeRef, mergedDisabledRef } = formItem;
|
|
181
|
+
const { mergedSizeRef, mergedDisabledRef, mergedStatusRef } = formItem;
|
|
179
182
|
function doUpdateValue(value, option) {
|
|
180
183
|
const { onChange, 'onUpdate:value': _onUpdateValue, onUpdateValue } = props;
|
|
181
184
|
const { nTriggerFormChange, nTriggerFormInput } = formItem;
|
|
@@ -249,7 +252,6 @@ export default defineComponent({
|
|
|
249
252
|
}
|
|
250
253
|
function openMenu() {
|
|
251
254
|
if (!mergedDisabledRef.value) {
|
|
252
|
-
patternRef.value = '';
|
|
253
255
|
doUpdateShow(true);
|
|
254
256
|
uncontrolledShowRef.value = true;
|
|
255
257
|
if (props.filterable) {
|
|
@@ -262,6 +264,21 @@ export default defineComponent({
|
|
|
262
264
|
}
|
|
263
265
|
function handleMenuAfterLeave() {
|
|
264
266
|
patternRef.value = '';
|
|
267
|
+
beingCreatedOptionsRef.value = [];
|
|
268
|
+
}
|
|
269
|
+
const activeWithoutMenuOpenRef = ref(false);
|
|
270
|
+
function onTriggerInputFocus() {
|
|
271
|
+
if (props.filterable) {
|
|
272
|
+
activeWithoutMenuOpenRef.value = true;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
function onTriggerInputBlur() {
|
|
276
|
+
if (props.filterable) {
|
|
277
|
+
activeWithoutMenuOpenRef.value = false;
|
|
278
|
+
if (!mergedShowRef.value) {
|
|
279
|
+
handleMenuAfterLeave();
|
|
280
|
+
}
|
|
281
|
+
}
|
|
265
282
|
}
|
|
266
283
|
function handleTriggerClick() {
|
|
267
284
|
if (mergedDisabledRef.value)
|
|
@@ -342,7 +359,7 @@ export default defineComponent({
|
|
|
342
359
|
function handleToggleByOption(option) {
|
|
343
360
|
if (mergedDisabledRef.value)
|
|
344
361
|
return;
|
|
345
|
-
const { tag, remote } = props;
|
|
362
|
+
const { tag, remote, clearFilterAfterSelect } = props;
|
|
346
363
|
if (tag && !remote) {
|
|
347
364
|
const { value: beingCreatedOptions } = beingCreatedOptionsRef;
|
|
348
365
|
const beingCreatedOption = beingCreatedOptions[0] || null;
|
|
@@ -363,13 +380,15 @@ export default defineComponent({
|
|
|
363
380
|
const createdOptionIndex = getCreatedOptionIndex(option.value);
|
|
364
381
|
if (~createdOptionIndex) {
|
|
365
382
|
createdOptionsRef.value.splice(createdOptionIndex, 1);
|
|
366
|
-
|
|
383
|
+
if (clearFilterAfterSelect)
|
|
384
|
+
patternRef.value = '';
|
|
367
385
|
}
|
|
368
386
|
}
|
|
369
387
|
}
|
|
370
388
|
else {
|
|
371
389
|
changedValue.push(option.value);
|
|
372
|
-
|
|
390
|
+
if (clearFilterAfterSelect)
|
|
391
|
+
patternRef.value = '';
|
|
373
392
|
}
|
|
374
393
|
doUpdateValue(changedValue, getMergedOptions(changedValue));
|
|
375
394
|
}
|
|
@@ -440,43 +459,69 @@ export default defineComponent({
|
|
|
440
459
|
doScroll(e);
|
|
441
460
|
}
|
|
442
461
|
// keyboard events
|
|
443
|
-
// also for menu
|
|
444
|
-
function
|
|
445
|
-
var _a, _b, _c, _d;
|
|
462
|
+
// also for menu keydown
|
|
463
|
+
function handleKeydown(e) {
|
|
464
|
+
var _a, _b, _c, _d, _e;
|
|
446
465
|
switch (e.code) {
|
|
447
466
|
case 'Space':
|
|
448
467
|
if (props.filterable)
|
|
449
468
|
break;
|
|
469
|
+
else {
|
|
470
|
+
e.preventDefault();
|
|
471
|
+
}
|
|
450
472
|
// eslint-disable-next-line no-fallthrough
|
|
451
473
|
case 'Enter':
|
|
452
474
|
case 'NumpadEnter':
|
|
453
|
-
if (
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
475
|
+
if (!((_a = triggerRef.value) === null || _a === void 0 ? void 0 : _a.isCompositing)) {
|
|
476
|
+
if (mergedShowRef.value) {
|
|
477
|
+
const pendingTmNode = (_b = menuRef.value) === null || _b === void 0 ? void 0 : _b.getPendingTmNode();
|
|
478
|
+
if (pendingTmNode) {
|
|
479
|
+
handleToggleByTmNode(pendingTmNode);
|
|
480
|
+
}
|
|
481
|
+
else if (!props.filterable) {
|
|
482
|
+
closeMenu();
|
|
483
|
+
focusSelection();
|
|
484
|
+
}
|
|
457
485
|
}
|
|
458
|
-
else
|
|
459
|
-
|
|
460
|
-
|
|
486
|
+
else {
|
|
487
|
+
openMenu();
|
|
488
|
+
if (props.tag && activeWithoutMenuOpenRef.value) {
|
|
489
|
+
const beingCreatedOption = beingCreatedOptionsRef.value[0];
|
|
490
|
+
if (beingCreatedOption) {
|
|
491
|
+
const optionValue = beingCreatedOption.value;
|
|
492
|
+
const { value: mergedValue } = mergedValueRef;
|
|
493
|
+
if (props.multiple) {
|
|
494
|
+
if (Array.isArray(mergedValue) &&
|
|
495
|
+
mergedValue.some((value) => value === optionValue)) {
|
|
496
|
+
// do nothing
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
handleToggleByOption(beingCreatedOption);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
handleToggleByOption(beingCreatedOption);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
461
507
|
}
|
|
462
508
|
}
|
|
463
|
-
else {
|
|
464
|
-
openMenu();
|
|
465
|
-
}
|
|
466
509
|
e.preventDefault();
|
|
467
510
|
break;
|
|
468
511
|
case 'ArrowUp':
|
|
512
|
+
e.preventDefault();
|
|
469
513
|
if (props.loading)
|
|
470
514
|
return;
|
|
471
515
|
if (mergedShowRef.value) {
|
|
472
|
-
(
|
|
516
|
+
(_c = menuRef.value) === null || _c === void 0 ? void 0 : _c.prev();
|
|
473
517
|
}
|
|
474
518
|
break;
|
|
475
519
|
case 'ArrowDown':
|
|
520
|
+
e.preventDefault();
|
|
476
521
|
if (props.loading)
|
|
477
522
|
return;
|
|
478
523
|
if (mergedShowRef.value) {
|
|
479
|
-
(
|
|
524
|
+
(_d = menuRef.value) === null || _d === void 0 ? void 0 : _d.next();
|
|
480
525
|
}
|
|
481
526
|
else {
|
|
482
527
|
openMenu();
|
|
@@ -484,21 +529,7 @@ export default defineComponent({
|
|
|
484
529
|
break;
|
|
485
530
|
case 'Escape':
|
|
486
531
|
closeMenu();
|
|
487
|
-
(
|
|
488
|
-
break;
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
// also for menu
|
|
492
|
-
function handleKeyDown(e) {
|
|
493
|
-
switch (e.code) {
|
|
494
|
-
case 'Space':
|
|
495
|
-
if (!props.filterable) {
|
|
496
|
-
e.preventDefault();
|
|
497
|
-
}
|
|
498
|
-
break;
|
|
499
|
-
case 'ArrowUp':
|
|
500
|
-
case 'ArrowDown':
|
|
501
|
-
e.preventDefault();
|
|
532
|
+
(_e = triggerRef.value) === null || _e === void 0 ? void 0 : _e.focus();
|
|
502
533
|
break;
|
|
503
534
|
}
|
|
504
535
|
}
|
|
@@ -536,20 +567,21 @@ export default defineComponent({
|
|
|
536
567
|
(_a = triggerRef.value) === null || _a === void 0 ? void 0 : _a.blur();
|
|
537
568
|
}
|
|
538
569
|
};
|
|
539
|
-
return Object.assign(Object.assign({}, exposedMethods), { mergedClsPrefix: mergedClsPrefixRef, mergedBordered: mergedBorderedRef, namespace: namespaceRef, treeMate: treeMateRef, isMounted: useIsMounted(), triggerRef,
|
|
540
|
-
menuRef, pattern: patternRef, uncontrolledShow: uncontrolledShowRef, mergedShow: mergedShowRef, adjustedTo: useAdjustedTo(props), uncontrolledValue: uncontrolledValueRef, mergedValue: mergedValueRef, followerRef, localizedPlaceholder: localizedPlaceholderRef, selectedOption: selectedOptionRef, selectedOptions: selectedOptionsRef, mergedSize: mergedSizeRef, mergedDisabled: mergedDisabledRef, focused: focusedRef,
|
|
570
|
+
return Object.assign(Object.assign({}, exposedMethods), { mergedStatus: mergedStatusRef, mergedClsPrefix: mergedClsPrefixRef, mergedBordered: mergedBorderedRef, namespace: namespaceRef, treeMate: treeMateRef, isMounted: useIsMounted(), triggerRef,
|
|
571
|
+
menuRef, pattern: patternRef, uncontrolledShow: uncontrolledShowRef, mergedShow: mergedShowRef, adjustedTo: useAdjustedTo(props), uncontrolledValue: uncontrolledValueRef, mergedValue: mergedValueRef, followerRef, localizedPlaceholder: localizedPlaceholderRef, selectedOption: selectedOptionRef, selectedOptions: selectedOptionsRef, mergedSize: mergedSizeRef, mergedDisabled: mergedDisabledRef, focused: focusedRef, activeWithoutMenuOpen: activeWithoutMenuOpenRef, disableInlineTheme: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.disableInlineTheme, onTriggerInputFocus,
|
|
572
|
+
onTriggerInputBlur,
|
|
573
|
+
handleMenuFocus,
|
|
541
574
|
handleMenuBlur,
|
|
542
575
|
handleMenuTabOut,
|
|
543
576
|
handleTriggerClick, handleToggle: handleToggleByTmNode, handleDeleteOption: handleToggleByOption, handlePatternInput,
|
|
544
577
|
handleClear,
|
|
545
578
|
handleTriggerBlur,
|
|
546
579
|
handleTriggerFocus,
|
|
547
|
-
|
|
548
|
-
handleKeyUp,
|
|
580
|
+
handleKeydown,
|
|
549
581
|
syncPosition,
|
|
550
582
|
handleMenuAfterLeave,
|
|
551
583
|
handleMenuClickOutside,
|
|
552
|
-
handleMenuScroll,
|
|
584
|
+
handleMenuScroll, handleMenuKeydown: handleKeydown, handleMenuMousedown, mergedTheme: themeRef, cssVars: computed(() => {
|
|
553
585
|
const { self: { menuBoxShadow } } = themeRef.value;
|
|
554
586
|
return {
|
|
555
587
|
'--n-menu-box-shadow': menuBoxShadow
|
|
@@ -561,8 +593,8 @@ export default defineComponent({
|
|
|
561
593
|
h(VBinder, null, {
|
|
562
594
|
default: () => [
|
|
563
595
|
h(VTarget, null, {
|
|
564
|
-
default: () => (h(NInternalSelection, { ref: "triggerRef", inputProps: this.inputProps, clsPrefix: this.mergedClsPrefix, showArrow: this.showArrow, maxTagCount: this.maxTagCount, bordered: this.mergedBordered, active: this.mergedShow, pattern: this.pattern, placeholder: this.localizedPlaceholder, selectedOption: this.selectedOption, selectedOptions: this.selectedOptions, multiple: this.multiple, renderTag: this.renderTag, renderLabel: this.renderLabel, filterable: this.filterable, clearable: this.clearable, disabled: this.mergedDisabled, size: this.mergedSize, theme: this.mergedTheme.peers.InternalSelection, themeOverrides: this.mergedTheme.peerOverrides.InternalSelection, loading: this.loading, focused: this.focused, onClick: this.handleTriggerClick, onDeleteOption: this.handleDeleteOption, onPatternInput: this.handlePatternInput, onClear: this.handleClear, onBlur: this.handleTriggerBlur, onFocus: this.handleTriggerFocus, onKeydown: this.
|
|
565
|
-
arrow: () => { var _a, _b; return (_b = (_a = this.$slots).arrow) === null || _b === void 0 ? void 0 : _b.call(_a); }
|
|
596
|
+
default: () => (h(NInternalSelection, { ref: "triggerRef", disableInlineTheme: this.disableInlineTheme, status: this.mergedStatus, inputProps: this.inputProps, clsPrefix: this.mergedClsPrefix, showArrow: this.showArrow, maxTagCount: this.maxTagCount, bordered: this.mergedBordered, active: this.activeWithoutMenuOpen || this.mergedShow, pattern: this.pattern, placeholder: this.localizedPlaceholder, selectedOption: this.selectedOption, selectedOptions: this.selectedOptions, multiple: this.multiple, renderTag: this.renderTag, renderLabel: this.renderLabel, filterable: this.filterable, clearable: this.clearable, disabled: this.mergedDisabled, size: this.mergedSize, theme: this.mergedTheme.peers.InternalSelection, themeOverrides: this.mergedTheme.peerOverrides.InternalSelection, loading: this.loading, focused: this.focused, onClick: this.handleTriggerClick, onDeleteOption: this.handleDeleteOption, onPatternInput: this.handlePatternInput, onClear: this.handleClear, onBlur: this.handleTriggerBlur, onFocus: this.handleTriggerFocus, onKeydown: this.handleKeydown, onPatternBlur: this.onTriggerInputBlur, onPatternFocus: this.onTriggerInputFocus }, {
|
|
597
|
+
arrow: () => { var _a, _b; return [(_b = (_a = this.$slots).arrow) === null || _b === void 0 ? void 0 : _b.call(_a)]; }
|
|
566
598
|
}))
|
|
567
599
|
}),
|
|
568
600
|
h(VFollower, { ref: "followerRef", show: this.mergedShow, to: this.adjustedTo, teleportDisabled: this.adjustedTo === useAdjustedTo.tdkey, containerClass: this.namespace, width: this.consistentMenuWidth ? 'target' : undefined, minWidth: "target", placement: this.placement }, {
|
|
@@ -571,11 +603,14 @@ export default defineComponent({
|
|
|
571
603
|
var _a, _b;
|
|
572
604
|
return (this.mergedShow ||
|
|
573
605
|
this.displayDirective === 'show') &&
|
|
574
|
-
withDirectives(h(NInternalSelectMenu, Object.assign({}, this.menuProps, { ref: "menuRef", virtualScroll: this.consistentMenuWidth && this.virtualScroll, class: [
|
|
606
|
+
withDirectives(h(NInternalSelectMenu, Object.assign({}, this.menuProps, { ref: "menuRef", disableInlineTheme: this.disableInlineTheme, virtualScroll: this.consistentMenuWidth && this.virtualScroll, class: [
|
|
575
607
|
`${this.mergedClsPrefix}-select-menu`,
|
|
576
608
|
(_a = this.menuProps) === null || _a === void 0 ? void 0 : _a.class
|
|
577
609
|
], clsPrefix: this.mergedClsPrefix, focusable: true, autoPending: true, theme: this.mergedTheme.peers.InternalSelectMenu, themeOverrides: this.mergedTheme.peerOverrides
|
|
578
|
-
.InternalSelectMenu, treeMate: this.treeMate, multiple: this.multiple, size: 'medium', renderOption: this.renderOption, renderLabel: this.renderLabel, value: this.mergedValue, style: [(_b = this.menuProps) === null || _b === void 0 ? void 0 : _b.style, this.cssVars], onToggle: this.handleToggle, onScroll: this.handleMenuScroll, onFocus: this.handleMenuFocus, onBlur: this.handleMenuBlur,
|
|
610
|
+
.InternalSelectMenu, treeMate: this.treeMate, multiple: this.multiple, size: 'medium', renderOption: this.renderOption, renderLabel: this.renderLabel, value: this.mergedValue, style: [(_b = this.menuProps) === null || _b === void 0 ? void 0 : _b.style, this.cssVars], onToggle: this.handleToggle, onScroll: this.handleMenuScroll, onFocus: this.handleMenuFocus, onBlur: this.handleMenuBlur, onKeydown: this.handleMenuKeydown, onTabOut: this.handleMenuTabOut, onMousedown: this.handleMenuMousedown, show: this.mergedShow, resetMenuOnOptionsChange: this.resetMenuOnOptionsChange }), {
|
|
611
|
+
empty: () => { var _a, _b; return [(_b = (_a = this.$slots).empty) === null || _b === void 0 ? void 0 : _b.call(_a)]; },
|
|
612
|
+
action: () => { var _a, _b; return [(_b = (_a = this.$slots).action) === null || _b === void 0 ? void 0 : _b.call(_a)]; }
|
|
613
|
+
}), this.displayDirective === 'show'
|
|
579
614
|
? [
|
|
580
615
|
[vShow, this.mergedShow],
|
|
581
616
|
[clickoutside, this.handleMenuClickOutside]
|
|
@@ -26,7 +26,7 @@ declare const selectLight: import("../../_mixins").Theme<"Select", {
|
|
|
26
26
|
borderHover: string;
|
|
27
27
|
borderActive: string;
|
|
28
28
|
borderFocus: string;
|
|
29
|
-
boxShadowHover:
|
|
29
|
+
boxShadowHover: string;
|
|
30
30
|
boxShadowActive: string;
|
|
31
31
|
boxShadowFocus: string;
|
|
32
32
|
caretColor: string;
|
|
@@ -37,7 +37,7 @@ declare const selectLight: import("../../_mixins").Theme<"Select", {
|
|
|
37
37
|
borderHoverWarning: string;
|
|
38
38
|
borderActiveWarning: string;
|
|
39
39
|
borderFocusWarning: string;
|
|
40
|
-
boxShadowHoverWarning:
|
|
40
|
+
boxShadowHoverWarning: string;
|
|
41
41
|
boxShadowActiveWarning: string;
|
|
42
42
|
boxShadowFocusWarning: string;
|
|
43
43
|
colorActiveWarning: string;
|
|
@@ -46,7 +46,7 @@ declare const selectLight: import("../../_mixins").Theme<"Select", {
|
|
|
46
46
|
borderHoverError: string;
|
|
47
47
|
borderActiveError: string;
|
|
48
48
|
borderFocusError: string;
|
|
49
|
-
boxShadowHoverError:
|
|
49
|
+
boxShadowHoverError: string;
|
|
50
50
|
boxShadowActiveError: string;
|
|
51
51
|
boxShadowFocusError: string;
|
|
52
52
|
colorActiveError: string;
|
|
@@ -21,7 +21,7 @@ export default defineComponent({
|
|
|
21
21
|
setup(props) {
|
|
22
22
|
useHoudini();
|
|
23
23
|
const { mergedClsPrefixRef } = useConfig(props);
|
|
24
|
-
const themeRef = useTheme('Skeleton', '
|
|
24
|
+
const themeRef = useTheme('Skeleton', '-skeleton', style, skeletonLight, props, mergedClsPrefixRef);
|
|
25
25
|
return {
|
|
26
26
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
27
27
|
style: computed(() => {
|
package/es/slider/src/Slider.js
CHANGED
|
@@ -36,7 +36,7 @@ export default defineComponent({
|
|
|
36
36
|
props: sliderProps,
|
|
37
37
|
setup(props) {
|
|
38
38
|
const { mergedClsPrefixRef, namespaceRef } = useConfig(props);
|
|
39
|
-
const themeRef = useTheme('Slider', '
|
|
39
|
+
const themeRef = useTheme('Slider', '-slider', style, sliderLight, props, mergedClsPrefixRef);
|
|
40
40
|
// dom ref
|
|
41
41
|
const handleRailRef = ref(null);
|
|
42
42
|
const [handleRefs, setHandleRefs] = useRefs();
|
package/es/space/src/Space.js
CHANGED
|
@@ -18,7 +18,7 @@ export default defineComponent({
|
|
|
18
18
|
props: spaceProps,
|
|
19
19
|
setup(props) {
|
|
20
20
|
const { mergedClsPrefixRef } = useConfig(props);
|
|
21
|
-
const themeRef = useTheme('Space', '
|
|
21
|
+
const themeRef = useTheme('Space', '-space', undefined, spaceLight, props, mergedClsPrefixRef);
|
|
22
22
|
return {
|
|
23
23
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
24
24
|
margin: computed(() => {
|
package/es/spin/src/Spin.js
CHANGED
|
@@ -39,7 +39,7 @@ export default defineComponent({
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
const { mergedClsPrefixRef } = useConfig(props);
|
|
42
|
-
const themeRef = useTheme('Spin', '
|
|
42
|
+
const themeRef = useTheme('Spin', '-spin', style, spinLight, props, mergedClsPrefixRef);
|
|
43
43
|
return {
|
|
44
44
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
45
45
|
compitableShow: useCompitable(props, ['spinning', 'show']),
|
|
@@ -8,7 +8,7 @@ export default defineComponent({
|
|
|
8
8
|
props: statisticProps,
|
|
9
9
|
setup(props) {
|
|
10
10
|
const { mergedClsPrefixRef } = useConfig(props);
|
|
11
|
-
const themeRef = useTheme('Statistic', '
|
|
11
|
+
const themeRef = useTheme('Statistic', '-statistic', style, statisticLight, props, mergedClsPrefixRef);
|
|
12
12
|
return {
|
|
13
13
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
14
14
|
cssVars: computed(() => {
|
package/es/steps/src/Steps.js
CHANGED
|
@@ -28,7 +28,7 @@ export default defineComponent({
|
|
|
28
28
|
props: stepsProps,
|
|
29
29
|
setup(props, { slots }) {
|
|
30
30
|
const { mergedClsPrefixRef } = useConfig(props);
|
|
31
|
-
const themeRef = useTheme('Steps', '
|
|
31
|
+
const themeRef = useTheme('Steps', '-steps', style, stepsLight, props, mergedClsPrefixRef);
|
|
32
32
|
provide(stepsInjectionKey, {
|
|
33
33
|
props,
|
|
34
34
|
mergedThemeRef: themeRef,
|
package/es/switch/src/Switch.js
CHANGED
|
@@ -42,7 +42,7 @@ export default defineComponent({
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
const { mergedClsPrefixRef } = useConfig(props);
|
|
45
|
-
const themeRef = useTheme('Switch', '
|
|
45
|
+
const themeRef = useTheme('Switch', '-switch', style, switchLight, props, mergedClsPrefixRef);
|
|
46
46
|
const formItem = useFormItem(props);
|
|
47
47
|
const { mergedSizeRef, mergedDisabledRef } = formItem;
|
|
48
48
|
const uncontrolledValueRef = ref(props.defaultValue);
|
package/es/table/src/Table.js
CHANGED
|
@@ -21,7 +21,7 @@ export default defineComponent({
|
|
|
21
21
|
props: tableProps,
|
|
22
22
|
setup(props) {
|
|
23
23
|
const { mergedClsPrefixRef } = useConfig(props);
|
|
24
|
-
const themeRef = useTheme('Table', '
|
|
24
|
+
const themeRef = useTheme('Table', '-table', style, tableLight, props, mergedClsPrefixRef);
|
|
25
25
|
return {
|
|
26
26
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
27
27
|
cssVars: computed(() => {
|
package/es/tabs/src/Tabs.d.ts
CHANGED
|
@@ -11,12 +11,13 @@ declare const tabsProps: {
|
|
|
11
11
|
readonly default: "bar";
|
|
12
12
|
};
|
|
13
13
|
readonly closable: BooleanConstructor;
|
|
14
|
-
readonly justifyContent: PropType<"space-around" | "space-between" | "space-evenly">;
|
|
14
|
+
readonly justifyContent: PropType<"start" | "end" | "space-around" | "space-between" | "space-evenly" | "center">;
|
|
15
15
|
readonly size: {
|
|
16
16
|
readonly type: PropType<"small" | "medium" | "large">;
|
|
17
17
|
readonly default: "medium";
|
|
18
18
|
};
|
|
19
19
|
readonly tabStyle: PropType<string | CSSProperties>;
|
|
20
|
+
readonly barWidth: NumberConstructor;
|
|
20
21
|
readonly paneClass: StringConstructor;
|
|
21
22
|
readonly paneStyle: PropType<string | CSSProperties>;
|
|
22
23
|
readonly addable: PropType<Addable>;
|
|
@@ -228,12 +229,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
228
229
|
readonly default: "bar";
|
|
229
230
|
};
|
|
230
231
|
readonly closable: BooleanConstructor;
|
|
231
|
-
readonly justifyContent: PropType<"space-around" | "space-between" | "space-evenly">;
|
|
232
|
+
readonly justifyContent: PropType<"start" | "end" | "space-around" | "space-between" | "space-evenly" | "center">;
|
|
232
233
|
readonly size: {
|
|
233
234
|
readonly type: PropType<"small" | "medium" | "large">;
|
|
234
235
|
readonly default: "medium";
|
|
235
236
|
};
|
|
236
237
|
readonly tabStyle: PropType<string | CSSProperties>;
|
|
238
|
+
readonly barWidth: NumberConstructor;
|
|
237
239
|
readonly paneClass: StringConstructor;
|
|
238
240
|
readonly paneStyle: PropType<string | CSSProperties>;
|
|
239
241
|
readonly addable: PropType<Addable>;
|
|
@@ -485,7 +487,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
485
487
|
addTabFixed: import("vue").Ref<boolean>;
|
|
486
488
|
tabWrapperStyle: import("vue").ComputedRef<{
|
|
487
489
|
display: string;
|
|
488
|
-
justifyContent: "space-around" | "space-between" | "space-evenly";
|
|
490
|
+
justifyContent: "start" | "end" | "space-around" | "space-between" | "space-evenly" | "center";
|
|
489
491
|
} | undefined>;
|
|
490
492
|
handleNavResize: import("lodash").DebouncedFunc<() => void>;
|
|
491
493
|
mergedSize: import("vue").ComputedRef<"small" | "medium" | "large">;
|
|
@@ -523,12 +525,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
523
525
|
readonly default: "bar";
|
|
524
526
|
};
|
|
525
527
|
readonly closable: BooleanConstructor;
|
|
526
|
-
readonly justifyContent: PropType<"space-around" | "space-between" | "space-evenly">;
|
|
528
|
+
readonly justifyContent: PropType<"start" | "end" | "space-around" | "space-between" | "space-evenly" | "center">;
|
|
527
529
|
readonly size: {
|
|
528
530
|
readonly type: PropType<"small" | "medium" | "large">;
|
|
529
531
|
readonly default: "medium";
|
|
530
532
|
};
|
|
531
533
|
readonly tabStyle: PropType<string | CSSProperties>;
|
|
534
|
+
readonly barWidth: NumberConstructor;
|
|
532
535
|
readonly paneClass: StringConstructor;
|
|
533
536
|
readonly paneStyle: PropType<string | CSSProperties>;
|
|
534
537
|
readonly addable: PropType<Addable>;
|
package/es/tabs/src/Tabs.js
CHANGED
|
@@ -14,7 +14,7 @@ const tabsProps = Object.assign(Object.assign({}, useTheme.props), { value: [Str
|
|
|
14
14
|
}, closable: Boolean, justifyContent: String, size: {
|
|
15
15
|
type: String,
|
|
16
16
|
default: 'medium'
|
|
17
|
-
}, tabStyle: [String, Object], paneClass: String, paneStyle: [String, Object], addable: [Boolean, Object], tabsPadding: {
|
|
17
|
+
}, tabStyle: [String, Object], barWidth: Number, paneClass: String, paneStyle: [String, Object], addable: [Boolean, Object], tabsPadding: {
|
|
18
18
|
type: Number,
|
|
19
19
|
default: 0
|
|
20
20
|
}, onBeforeLeave: Function, onAdd: Function, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array], onClose: [Function, Array],
|
|
@@ -39,7 +39,7 @@ export default defineComponent({
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
const { mergedClsPrefixRef } = useConfig(props);
|
|
42
|
-
const themeRef = useTheme('Tabs', '
|
|
42
|
+
const themeRef = useTheme('Tabs', '-tabs', style, tabsLight, props, mergedClsPrefixRef);
|
|
43
43
|
const tabsElRef = ref(null);
|
|
44
44
|
const barElRef = ref(null);
|
|
45
45
|
const scrollWrapperElRef = ref(null);
|
|
@@ -82,15 +82,23 @@ export default defineComponent({
|
|
|
82
82
|
return;
|
|
83
83
|
if (tabEl) {
|
|
84
84
|
const disabledClassName = `${mergedClsPrefixRef.value}-tabs-bar--disabled`;
|
|
85
|
+
const { barWidth } = props;
|
|
85
86
|
if (tabEl.dataset.disabled === 'true') {
|
|
86
87
|
barEl.classList.add(disabledClassName);
|
|
87
88
|
}
|
|
88
89
|
else {
|
|
89
90
|
barEl.classList.remove(disabledClassName);
|
|
90
91
|
}
|
|
91
|
-
|
|
92
|
+
if (barWidth && tabEl.offsetWidth >= barWidth) {
|
|
93
|
+
const offsetDiffLeft = Math.floor((tabEl.offsetWidth - barWidth) / 2) + tabEl.offsetLeft;
|
|
94
|
+
barEl.style.left = `${offsetDiffLeft}px`;
|
|
95
|
+
barEl.style.maxWidth = `${barWidth}px`;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
barEl.style.left = `${tabEl.offsetLeft}px`;
|
|
99
|
+
barEl.style.maxWidth = `${tabEl.offsetWidth}px`;
|
|
100
|
+
}
|
|
92
101
|
barEl.style.width = '8192px';
|
|
93
|
-
barEl.style.maxWidth = `${tabEl.offsetWidth + 1}px`;
|
|
94
102
|
}
|
|
95
103
|
}
|
|
96
104
|
function updateCurrentBarStyle() {
|
package/es/tag/src/Tag.d.ts
CHANGED
|
@@ -451,6 +451,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
451
451
|
closeMarginRtl: string;
|
|
452
452
|
}, any>>>;
|
|
453
453
|
}, {
|
|
454
|
+
themeClass?: Ref<string> | undefined;
|
|
455
|
+
onRender?: (() => void) | undefined;
|
|
454
456
|
rtlEnabled: Ref<import("../../config-provider/src/internal-interface").RtlItem | undefined> | undefined;
|
|
455
457
|
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
456
458
|
contentRef: Ref<HTMLElement | null>;
|
|
@@ -485,7 +487,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
485
487
|
'--n-text-color-checked': string;
|
|
486
488
|
'--n-text-color-hover-checkable': string;
|
|
487
489
|
'--n-text-color-pressed-checkable': string;
|
|
488
|
-
}
|
|
490
|
+
}> | undefined;
|
|
489
491
|
setTextContent: (textContent: string) => void;
|
|
490
492
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
491
493
|
bordered: {
|
package/es/tag/src/Tag.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, defineComponent, computed, ref, provide, toRef } from 'vue';
|
|
2
|
-
import { useConfig, useTheme } from '../../_mixins';
|
|
2
|
+
import { useConfig, useThemeClass, useTheme, emptyThemeClassHandle } from '../../_mixins';
|
|
3
3
|
import { NBaseClose } from '../../_internal';
|
|
4
|
-
import { warn, createKey, call, createInjectionKey } from '../../_utils';
|
|
4
|
+
import { warn, createKey, call, createInjectionKey, color2Class, resolveWrappedSlot } from '../../_utils';
|
|
5
5
|
import { tagLight } from '../styles';
|
|
6
6
|
import commonProps from './common-props';
|
|
7
7
|
import style from './styles/index.cssr';
|
|
@@ -30,7 +30,7 @@ export default defineComponent({
|
|
|
30
30
|
setup(props) {
|
|
31
31
|
const contentRef = ref(null);
|
|
32
32
|
const { mergedBorderedRef, mergedClsPrefixRef, NConfigProvider } = useConfig(props);
|
|
33
|
-
const themeRef = useTheme('Tag', '
|
|
33
|
+
const themeRef = useTheme('Tag', '-tag', style, tagLight, props, mergedClsPrefixRef);
|
|
34
34
|
provide(tagInjectionKey, {
|
|
35
35
|
roundRef: toRef(props, 'round')
|
|
36
36
|
});
|
|
@@ -66,45 +66,65 @@ export default defineComponent({
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
const rtlEnabledRef = useRtl('Tag', NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedRtlRef, mergedClsPrefixRef);
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
const disableInlineTheme = NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.disableInlineTheme;
|
|
70
|
+
const cssVarsRef = computed(() => {
|
|
71
|
+
const { type, size, color: { color, textColor } = {} } = props;
|
|
72
|
+
const { common: { cubicBezierEaseInOut }, self: { padding, closeMargin, closeMarginRtl, borderRadius, opacityDisabled, textColorCheckable, textColorHoverCheckable, textColorPressedCheckable, textColorChecked, colorCheckable, colorHoverCheckable, colorPressedCheckable, colorChecked, colorCheckedHover, colorCheckedPressed, [createKey('closeSize', size)]: closeSize, [createKey('fontSize', size)]: fontSize, [createKey('height', size)]: height, [createKey('color', type)]: typedColor, [createKey('textColor', type)]: typeTextColor, [createKey('border', type)]: border, [createKey('closeColor', type)]: closeColor, [createKey('closeColorHover', type)]: closeColorHover, [createKey('closeColorPressed', type)]: closeColorPressed } } = themeRef.value;
|
|
73
|
+
return {
|
|
74
|
+
'--n-avatar-size-override': `calc(${height} - 8px)`,
|
|
75
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
76
|
+
'--n-border-radius': borderRadius,
|
|
77
|
+
'--n-border': border,
|
|
78
|
+
'--n-close-color': closeColor,
|
|
79
|
+
'--n-close-color-hover': closeColorHover,
|
|
80
|
+
'--n-close-color-pressed': closeColorPressed,
|
|
81
|
+
'--n-close-color-disabled': closeColor,
|
|
82
|
+
'--n-close-margin': closeMargin,
|
|
83
|
+
'--n-close-margin-rtl': closeMarginRtl,
|
|
84
|
+
'--n-close-size': closeSize,
|
|
85
|
+
'--n-color': color || typedColor,
|
|
86
|
+
'--n-color-checkable': colorCheckable,
|
|
87
|
+
'--n-color-checked': colorChecked,
|
|
88
|
+
'--n-color-checked-hover': colorCheckedHover,
|
|
89
|
+
'--n-color-checked-pressed': colorCheckedPressed,
|
|
90
|
+
'--n-color-hover-checkable': colorHoverCheckable,
|
|
91
|
+
'--n-color-pressed-checkable': colorPressedCheckable,
|
|
92
|
+
'--n-font-size': fontSize,
|
|
93
|
+
'--n-height': height,
|
|
94
|
+
'--n-opacity-disabled': opacityDisabled,
|
|
95
|
+
'--n-padding': padding,
|
|
96
|
+
'--n-text-color': textColor || typeTextColor,
|
|
97
|
+
'--n-text-color-checkable': textColorCheckable,
|
|
98
|
+
'--n-text-color-checked': textColorChecked,
|
|
99
|
+
'--n-text-color-hover-checkable': textColorHoverCheckable,
|
|
100
|
+
'--n-text-color-pressed-checkable': textColorPressedCheckable
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
const themeClassHandle = disableInlineTheme
|
|
104
|
+
? useThemeClass('tag', computed(() => {
|
|
105
|
+
let hash = '';
|
|
71
106
|
const { type, size, color: { color, textColor } = {} } = props;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
'--n-color': color || typedColor,
|
|
86
|
-
'--n-color-checkable': colorCheckable,
|
|
87
|
-
'--n-color-checked': colorChecked,
|
|
88
|
-
'--n-color-checked-hover': colorCheckedHover,
|
|
89
|
-
'--n-color-checked-pressed': colorCheckedPressed,
|
|
90
|
-
'--n-color-hover-checkable': colorHoverCheckable,
|
|
91
|
-
'--n-color-pressed-checkable': colorPressedCheckable,
|
|
92
|
-
'--n-font-size': fontSize,
|
|
93
|
-
'--n-height': height,
|
|
94
|
-
'--n-opacity-disabled': opacityDisabled,
|
|
95
|
-
'--n-padding': padding,
|
|
96
|
-
'--n-text-color': textColor || typeTextColor,
|
|
97
|
-
'--n-text-color-checkable': textColorCheckable,
|
|
98
|
-
'--n-text-color-checked': textColorChecked,
|
|
99
|
-
'--n-text-color-hover-checkable': textColorHoverCheckable,
|
|
100
|
-
'--n-text-color-pressed-checkable': textColorPressedCheckable
|
|
101
|
-
};
|
|
102
|
-
}) });
|
|
107
|
+
hash += type[0];
|
|
108
|
+
hash += size[0];
|
|
109
|
+
if (color) {
|
|
110
|
+
hash += `a${color2Class(color)}`;
|
|
111
|
+
}
|
|
112
|
+
if (textColor) {
|
|
113
|
+
hash += `b${color2Class(textColor)}`;
|
|
114
|
+
}
|
|
115
|
+
return hash;
|
|
116
|
+
}), cssVarsRef, props)
|
|
117
|
+
: emptyThemeClassHandle;
|
|
118
|
+
return Object.assign(Object.assign(Object.assign({}, tagPublicMethods), { rtlEnabled: rtlEnabledRef, mergedClsPrefix: mergedClsPrefixRef, contentRef, mergedBordered: mergedBorderedRef, handleClick,
|
|
119
|
+
handleCloseClick, cssVars: disableInlineTheme ? undefined : cssVarsRef }), themeClassHandle);
|
|
103
120
|
},
|
|
104
121
|
render() {
|
|
105
|
-
|
|
122
|
+
var _a, _b;
|
|
123
|
+
const { mergedClsPrefix, rtlEnabled, color: { borderColor } = {}, onRender, $slots } = this;
|
|
124
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
106
125
|
return (h("div", { class: [
|
|
107
126
|
`${mergedClsPrefix}-tag`,
|
|
127
|
+
this.themeClass,
|
|
108
128
|
{
|
|
109
129
|
[`${mergedClsPrefix}-tag--rtl`]: rtlEnabled,
|
|
110
130
|
[`${mergedClsPrefix}-tag--disabled`]: this.disabled,
|
|
@@ -113,10 +133,10 @@ export default defineComponent({
|
|
|
113
133
|
[`${mergedClsPrefix}-tag--round`]: this.round
|
|
114
134
|
}
|
|
115
135
|
], style: this.cssVars, onClick: this.handleClick, onMouseenter: this.onMouseenter, onMouseleave: this.onMouseleave },
|
|
116
|
-
$slots.avatar
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
h("span", { class: `${mergedClsPrefix}-tag__content`, ref: "contentRef" }, this.$slots),
|
|
136
|
+
resolveWrappedSlot($slots.avatar, (children) => [
|
|
137
|
+
h("div", { class: `${mergedClsPrefix}-tag__avatar` }, children)
|
|
138
|
+
]),
|
|
139
|
+
h("span", { class: `${mergedClsPrefix}-tag__content`, ref: "contentRef" }, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a)),
|
|
120
140
|
!this.checkable && this.closable ? (h(NBaseClose, { clsPrefix: mergedClsPrefix, class: `${mergedClsPrefix}-tag__close`, disabled: this.disabled, onClick: this.handleCloseClick })) : null,
|
|
121
141
|
!this.checkable && this.mergedBordered ? (h("div", { class: `${mergedClsPrefix}-tag__border`, style: { borderColor } })) : null));
|
|
122
142
|
}
|