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
|
@@ -3,7 +3,7 @@ import { h, defineComponent, Fragment, ref, computed, watch, toRef, nextTick, wa
|
|
|
3
3
|
import { VOverflow } from 'vueuc';
|
|
4
4
|
import { NPopover } from '../../../popover';
|
|
5
5
|
import { NTag } from '../../../tag';
|
|
6
|
-
import { useTheme } from '../../../_mixins';
|
|
6
|
+
import { useThemeClass, useTheme, emptyThemeClassHandle } from '../../../_mixins';
|
|
7
7
|
import { createKey, getTitleAttribute, render } from '../../../_utils';
|
|
8
8
|
import Suffix from '../../suffix';
|
|
9
9
|
import { internalSelectionLight } from '../styles';
|
|
@@ -18,7 +18,7 @@ export default defineComponent({
|
|
|
18
18
|
default: undefined
|
|
19
19
|
}, active: Boolean, pattern: {
|
|
20
20
|
type: String,
|
|
21
|
-
default:
|
|
21
|
+
default: ''
|
|
22
22
|
}, placeholder: String, selectedOption: {
|
|
23
23
|
type: Object,
|
|
24
24
|
default: null
|
|
@@ -31,7 +31,7 @@ export default defineComponent({
|
|
|
31
31
|
}, loading: Boolean, autofocus: Boolean, showArrow: {
|
|
32
32
|
type: Boolean,
|
|
33
33
|
default: true
|
|
34
|
-
}, inputProps: Object, focused: Boolean, renderTag: Function, onKeyup: Function, onKeydown: Function, onClick: Function, onBlur: Function, onFocus: Function, onDeleteOption: Function, maxTagCount: [String, Number], onClear: Function, onPatternInput: Function, renderLabel: Function }),
|
|
34
|
+
}, inputProps: Object, focused: Boolean, renderTag: Function, onKeyup: Function, onKeydown: Function, onClick: Function, onBlur: Function, onFocus: Function, onDeleteOption: Function, maxTagCount: [String, Number], onClear: Function, onPatternInput: Function, onPatternFocus: Function, onPatternBlur: Function, renderLabel: Function, status: String, disableInlineTheme: Boolean }),
|
|
35
35
|
setup(props) {
|
|
36
36
|
const patternInputMirrorRef = ref(null);
|
|
37
37
|
const patternInputRef = ref(null);
|
|
@@ -46,7 +46,7 @@ export default defineComponent({
|
|
|
46
46
|
const showTagsPopoverRef = ref(false);
|
|
47
47
|
const patternInputFocusedRef = ref(false);
|
|
48
48
|
const hoverRef = ref(false);
|
|
49
|
-
const themeRef = useTheme('InternalSelection', '
|
|
49
|
+
const themeRef = useTheme('InternalSelection', '-internal-selection', style, internalSelectionLight, props, toRef(props, 'clsPrefix'));
|
|
50
50
|
const mergedClearableRef = computed(() => {
|
|
51
51
|
return (props.clearable && !props.disabled && (hoverRef.value || props.active));
|
|
52
52
|
});
|
|
@@ -166,7 +166,7 @@ export default defineComponent({
|
|
|
166
166
|
doDeleteOption(option);
|
|
167
167
|
}
|
|
168
168
|
function handlePatternKeyDown(e) {
|
|
169
|
-
if (e.code === 'Backspace') {
|
|
169
|
+
if (e.code === 'Backspace' && !isCompositingRef.value) {
|
|
170
170
|
if (!props.pattern.length) {
|
|
171
171
|
const { selectedOptions } = props;
|
|
172
172
|
if (selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.length) {
|
|
@@ -202,11 +202,15 @@ export default defineComponent({
|
|
|
202
202
|
doPatternInput(cachedInputEvent);
|
|
203
203
|
cachedInputEvent = null;
|
|
204
204
|
}
|
|
205
|
-
function handlePatternInputFocus() {
|
|
205
|
+
function handlePatternInputFocus(e) {
|
|
206
|
+
var _a;
|
|
206
207
|
patternInputFocusedRef.value = true;
|
|
208
|
+
(_a = props.onPatternFocus) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
207
209
|
}
|
|
208
210
|
function handlePatternInputBlur(e) {
|
|
211
|
+
var _a;
|
|
209
212
|
patternInputFocusedRef.value = false;
|
|
213
|
+
(_a = props.onPatternBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
210
214
|
}
|
|
211
215
|
function blur() {
|
|
212
216
|
var _a, _b;
|
|
@@ -294,15 +298,76 @@ export default defineComponent({
|
|
|
294
298
|
props.disabled || patternInputFocusedRef.value ? -1 : 0;
|
|
295
299
|
});
|
|
296
300
|
});
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
301
|
+
const { disableInlineTheme } = props;
|
|
302
|
+
const cssVarsRef = computed(() => {
|
|
303
|
+
const { size } = props;
|
|
304
|
+
const { common: { cubicBezierEaseInOut }, self: { borderRadius, color, placeholderColor, textColor, paddingSingle, paddingMultiple, caretColor, colorDisabled, textColorDisabled, placeholderColorDisabled, colorActive, boxShadowFocus, boxShadowActive, boxShadowHover, border, borderFocus, borderHover, borderActive, arrowColor, arrowColorDisabled, loadingColor,
|
|
305
|
+
// form warning
|
|
306
|
+
colorActiveWarning, boxShadowFocusWarning, boxShadowActiveWarning, boxShadowHoverWarning, borderWarning, borderFocusWarning, borderHoverWarning, borderActiveWarning,
|
|
307
|
+
// form error
|
|
308
|
+
colorActiveError, boxShadowFocusError, boxShadowActiveError, boxShadowHoverError, borderError, borderFocusError, borderHoverError, borderActiveError,
|
|
309
|
+
// clear
|
|
310
|
+
clearColor, clearColorHover, clearColorPressed, clearSize,
|
|
311
|
+
// arrow
|
|
312
|
+
arrowSize, [createKey('height', size)]: height, [createKey('fontSize', size)]: fontSize } } = themeRef.value;
|
|
313
|
+
return {
|
|
314
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
315
|
+
'--n-border': border,
|
|
316
|
+
'--n-border-active': borderActive,
|
|
317
|
+
'--n-border-focus': borderFocus,
|
|
318
|
+
'--n-border-hover': borderHover,
|
|
319
|
+
'--n-border-radius': borderRadius,
|
|
320
|
+
'--n-box-shadow-active': boxShadowActive,
|
|
321
|
+
'--n-box-shadow-focus': boxShadowFocus,
|
|
322
|
+
'--n-box-shadow-hover': boxShadowHover,
|
|
323
|
+
'--n-caret-color': caretColor,
|
|
324
|
+
'--n-color': color,
|
|
325
|
+
'--n-color-active': colorActive,
|
|
326
|
+
'--n-color-disabled': colorDisabled,
|
|
327
|
+
'--n-font-size': fontSize,
|
|
328
|
+
'--n-height': height,
|
|
329
|
+
'--n-padding-single': paddingSingle,
|
|
330
|
+
'--n-padding-multiple': paddingMultiple,
|
|
331
|
+
'--n-placeholder-color': placeholderColor,
|
|
332
|
+
'--n-placeholder-color-disabled': placeholderColorDisabled,
|
|
333
|
+
'--n-text-color': textColor,
|
|
334
|
+
'--n-text-color-disabled': textColorDisabled,
|
|
335
|
+
'--n-arrow-color': arrowColor,
|
|
336
|
+
'--n-arrow-color-disabled': arrowColorDisabled,
|
|
337
|
+
'--n-loading-color': loadingColor,
|
|
338
|
+
// form warning
|
|
339
|
+
'--n-color-active-warning': colorActiveWarning,
|
|
340
|
+
'--n-box-shadow-focus-warning': boxShadowFocusWarning,
|
|
341
|
+
'--n-box-shadow-active-warning': boxShadowActiveWarning,
|
|
342
|
+
'--n-box-shadow-hover-warning': boxShadowHoverWarning,
|
|
343
|
+
'--n-border-warning': borderWarning,
|
|
344
|
+
'--n-border-focus-warning': borderFocusWarning,
|
|
345
|
+
'--n-border-hover-warning': borderHoverWarning,
|
|
346
|
+
'--n-border-active-warning': borderActiveWarning,
|
|
347
|
+
// form error
|
|
348
|
+
'--n-color-active-error': colorActiveError,
|
|
349
|
+
'--n-box-shadow-focus-error': boxShadowFocusError,
|
|
350
|
+
'--n-box-shadow-active-error': boxShadowActiveError,
|
|
351
|
+
'--n-box-shadow-hover-error': boxShadowHoverError,
|
|
352
|
+
'--n-border-error': borderError,
|
|
353
|
+
'--n-border-focus-error': borderFocusError,
|
|
354
|
+
'--n-border-hover-error': borderHoverError,
|
|
355
|
+
'--n-border-active-error': borderActiveError,
|
|
356
|
+
// clear
|
|
357
|
+
'--n-clear-size': clearSize,
|
|
358
|
+
'--n-clear-color': clearColor,
|
|
359
|
+
'--n-clear-color-hover': clearColorHover,
|
|
360
|
+
'--n-clear-color-pressed': clearColorPressed,
|
|
361
|
+
// arrow-size
|
|
362
|
+
'--n-arrow-size': arrowSize
|
|
363
|
+
};
|
|
364
|
+
});
|
|
365
|
+
const themeClassHandle = disableInlineTheme
|
|
366
|
+
? useThemeClass('internal-selection', computed(() => {
|
|
367
|
+
return props.size[0];
|
|
368
|
+
}), cssVarsRef, props)
|
|
369
|
+
: emptyThemeClassHandle;
|
|
370
|
+
return Object.assign({ mergedTheme: themeRef, mergedClearable: mergedClearableRef, patternInputFocused: patternInputFocusedRef, filterablePlaceholder: filterablePlaceholderRef, label: labelRef, selected: selectedRef, showTagsPanel: showTagsPopoverRef, isCompositing: isCompositingRef,
|
|
306
371
|
// dom ref
|
|
307
372
|
counterRef,
|
|
308
373
|
counterWrapperRef,
|
|
@@ -336,75 +401,11 @@ export default defineComponent({
|
|
|
336
401
|
blurInput,
|
|
337
402
|
updateCounter,
|
|
338
403
|
getCounter,
|
|
339
|
-
getTail,
|
|
340
|
-
renderLabel: props.renderLabel,
|
|
341
|
-
cssVars: computed(() => {
|
|
342
|
-
const { size } = props;
|
|
343
|
-
const { common: { cubicBezierEaseInOut }, self: { borderRadius, color, placeholderColor, textColor, paddingSingle, paddingMultiple, caretColor, colorDisabled, textColorDisabled, placeholderColorDisabled, colorActive, boxShadowFocus, boxShadowActive, boxShadowHover, border, borderFocus, borderHover, borderActive, arrowColor, arrowColorDisabled, loadingColor,
|
|
344
|
-
// form warning
|
|
345
|
-
colorActiveWarning, boxShadowFocusWarning, boxShadowActiveWarning, boxShadowHoverWarning, borderWarning, borderFocusWarning, borderHoverWarning, borderActiveWarning,
|
|
346
|
-
// form error
|
|
347
|
-
colorActiveError, boxShadowFocusError, boxShadowActiveError, boxShadowHoverError, borderError, borderFocusError, borderHoverError, borderActiveError,
|
|
348
|
-
// clear
|
|
349
|
-
clearColor, clearColorHover, clearColorPressed, clearSize,
|
|
350
|
-
// arrow
|
|
351
|
-
arrowSize, [createKey('height', size)]: height, [createKey('fontSize', size)]: fontSize } } = themeRef.value;
|
|
352
|
-
return {
|
|
353
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
354
|
-
'--n-border': border,
|
|
355
|
-
'--n-border-active': borderActive,
|
|
356
|
-
'--n-border-focus': borderFocus,
|
|
357
|
-
'--n-border-hover': borderHover,
|
|
358
|
-
'--n-border-radius': borderRadius,
|
|
359
|
-
'--n-box-shadow-active': boxShadowActive,
|
|
360
|
-
'--n-box-shadow-focus': boxShadowFocus,
|
|
361
|
-
'--n-box-shadow-hover': boxShadowHover,
|
|
362
|
-
'--n-caret-color': caretColor,
|
|
363
|
-
'--n-color': color,
|
|
364
|
-
'--n-color-active': colorActive,
|
|
365
|
-
'--n-color-disabled': colorDisabled,
|
|
366
|
-
'--n-font-size': fontSize,
|
|
367
|
-
'--n-height': height,
|
|
368
|
-
'--n-padding-single': paddingSingle,
|
|
369
|
-
'--n-padding-multiple': paddingMultiple,
|
|
370
|
-
'--n-placeholder-color': placeholderColor,
|
|
371
|
-
'--n-placeholder-color-disabled': placeholderColorDisabled,
|
|
372
|
-
'--n-text-color': textColor,
|
|
373
|
-
'--n-text-color-disabled': textColorDisabled,
|
|
374
|
-
'--n-arrow-color': arrowColor,
|
|
375
|
-
'--n-arrow-color-disabled': arrowColorDisabled,
|
|
376
|
-
'--n-loading-color': loadingColor,
|
|
377
|
-
// form warning
|
|
378
|
-
'--n-color-active-warning': colorActiveWarning,
|
|
379
|
-
'--n-box-shadow-focus-warning': boxShadowFocusWarning,
|
|
380
|
-
'--n-box-shadow-active-warning': boxShadowActiveWarning,
|
|
381
|
-
'--n-box-shadow-hover-warning': boxShadowHoverWarning,
|
|
382
|
-
'--n-border-warning': borderWarning,
|
|
383
|
-
'--n-border-focus-warning': borderFocusWarning,
|
|
384
|
-
'--n-border-hover-warning': borderHoverWarning,
|
|
385
|
-
'--n-border-active-warning': borderActiveWarning,
|
|
386
|
-
// form error
|
|
387
|
-
'--n-color-active-error': colorActiveError,
|
|
388
|
-
'--n-box-shadow-focus-error': boxShadowFocusError,
|
|
389
|
-
'--n-box-shadow-active-error': boxShadowActiveError,
|
|
390
|
-
'--n-box-shadow-hover-error': boxShadowHoverError,
|
|
391
|
-
'--n-border-error': borderError,
|
|
392
|
-
'--n-border-focus-error': borderFocusError,
|
|
393
|
-
'--n-border-hover-error': borderHoverError,
|
|
394
|
-
'--n-border-active-error': borderActiveError,
|
|
395
|
-
// clear
|
|
396
|
-
'--n-clear-size': clearSize,
|
|
397
|
-
'--n-clear-color': clearColor,
|
|
398
|
-
'--n-clear-color-hover': clearColorHover,
|
|
399
|
-
'--n-clear-color-pressed': clearColorPressed,
|
|
400
|
-
// arrow-size
|
|
401
|
-
'--n-arrow-size': arrowSize
|
|
402
|
-
};
|
|
403
|
-
})
|
|
404
|
-
};
|
|
404
|
+
getTail, renderLabel: props.renderLabel, cssVars: disableInlineTheme ? undefined : cssVarsRef }, themeClassHandle);
|
|
405
405
|
},
|
|
406
406
|
render() {
|
|
407
|
-
const { multiple, size, disabled, filterable, maxTagCount, bordered, clsPrefix, renderTag, renderLabel } = this;
|
|
407
|
+
const { status, multiple, size, disabled, filterable, maxTagCount, bordered, clsPrefix, onRender, renderTag, renderLabel } = this;
|
|
408
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
408
409
|
const maxTagCountResponsive = maxTagCount === 'responsive';
|
|
409
410
|
const maxTagCountNumeric = typeof maxTagCount === 'number';
|
|
410
411
|
const useMaxTagCount = maxTagCountResponsive || maxTagCountNumeric;
|
|
@@ -426,18 +427,18 @@ export default defineComponent({
|
|
|
426
427
|
: this.selectedOptions).map(createTag);
|
|
427
428
|
const input = filterable ? (h("div", { class: `${clsPrefix}-base-selection-input-tag`, ref: "inputTagElRef", key: "__input-tag__" },
|
|
428
429
|
h("input", Object.assign({}, this.inputProps, { ref: "patternInputRef", tabindex: -1, disabled: disabled, value: this.pattern, autofocus: this.autofocus, class: `${clsPrefix}-base-selection-input-tag__input`, onBlur: this.handlePatternInputBlur, onFocus: this.handlePatternInputFocus, onKeydown: this.handlePatternKeyDown, onInput: this.handlePatternInputInput, onCompositionstart: this.handleCompositionStart, onCompositionend: this.handleCompositionEnd })),
|
|
429
|
-
h("span", { ref: "patternInputMirrorRef", class: `${clsPrefix}-base-selection-input-tag__mirror` }, this.pattern
|
|
430
|
+
h("span", { ref: "patternInputMirrorRef", class: `${clsPrefix}-base-selection-input-tag__mirror` }, this.pattern))) : null;
|
|
430
431
|
// May Overflow
|
|
431
432
|
const renderCounter = maxTagCountResponsive
|
|
432
433
|
? () => (h("div", { class: `${clsPrefix}-base-selection-tag-wrapper`, ref: "counterWrapperRef" },
|
|
433
|
-
h(NTag, { ref: "counterRef", onMouseenter: this.handleMouseEnterCounter, onMouseleave: this.handleMouseLeaveCounter, disabled: disabled })))
|
|
434
|
+
h(NTag, { size: size, ref: "counterRef", onMouseenter: this.handleMouseEnterCounter, onMouseleave: this.handleMouseLeaveCounter, disabled: disabled })))
|
|
434
435
|
: undefined;
|
|
435
436
|
let counter;
|
|
436
437
|
if (maxTagCountNumeric) {
|
|
437
438
|
const rest = this.selectedOptions.length - maxTagCount;
|
|
438
439
|
if (rest > 0) {
|
|
439
440
|
counter = (h("div", { class: `${clsPrefix}-base-selection-tag-wrapper`, key: "__counter__" },
|
|
440
|
-
h(NTag, { ref: "counterRef", onMouseenter: this.handleMouseEnterCounter, disabled: disabled }, {
|
|
441
|
+
h(NTag, { size: size, ref: "counterRef", onMouseenter: this.handleMouseEnterCounter, disabled: disabled }, {
|
|
441
442
|
default: () => `+${rest}`
|
|
442
443
|
})));
|
|
443
444
|
}
|
|
@@ -475,7 +476,12 @@ export default defineComponent({
|
|
|
475
476
|
themeOverrides: this.mergedTheme.peerOverrides.Popover
|
|
476
477
|
}
|
|
477
478
|
: null;
|
|
478
|
-
const
|
|
479
|
+
const showPlaceholder = this.selected
|
|
480
|
+
? false
|
|
481
|
+
: this.active
|
|
482
|
+
? !this.pattern && !this.isCompositing
|
|
483
|
+
: true;
|
|
484
|
+
const placeholder = showPlaceholder ? (h("div", { class: `${clsPrefix}-base-selection-placeholder ${clsPrefix}-base-selection-overlay` }, this.placeholder)) : null;
|
|
479
485
|
if (filterable) {
|
|
480
486
|
const popoverTrigger = (h("div", { ref: "patternInputWrapperRef", class: `${clsPrefix}-base-selection-tags` },
|
|
481
487
|
tags,
|
|
@@ -502,13 +508,12 @@ export default defineComponent({
|
|
|
502
508
|
}
|
|
503
509
|
else {
|
|
504
510
|
if (filterable) {
|
|
505
|
-
const
|
|
506
|
-
|
|
507
|
-
|
|
511
|
+
const hasInput = this.pattern || this.isCompositing;
|
|
512
|
+
const showPlaceholder = this.active ? !hasInput : !this.selected;
|
|
513
|
+
const showSelectedLabel = this.active ? false : this.selected;
|
|
508
514
|
body = (h("div", { ref: "patternInputWrapperRef", class: `${clsPrefix}-base-selection-label` },
|
|
509
|
-
h("input", Object.assign({}, this.inputProps, { ref: "patternInputRef", class: `${clsPrefix}-base-selection-input`, value: this.
|
|
510
|
-
|
|
511
|
-
this.active ? null : (h("div", { class: `${clsPrefix}-base-selection-label__render-label ${clsPrefix}-base-selection-overlay`, key: "input" },
|
|
515
|
+
h("input", Object.assign({}, this.inputProps, { ref: "patternInputRef", class: `${clsPrefix}-base-selection-input`, value: this.active ? this.pattern : '', placeholder: "", readonly: disabled, disabled: disabled, tabindex: -1, autofocus: this.autofocus, onFocus: this.handlePatternInputFocus, onBlur: this.handlePatternInputBlur, onInput: this.handlePatternInputInput, onCompositionstart: this.handleCompositionStart, onCompositionend: this.handleCompositionEnd })),
|
|
516
|
+
showSelectedLabel ? (h("div", { class: `${clsPrefix}-base-selection-label__render-label ${clsPrefix}-base-selection-overlay`, key: "input" },
|
|
512
517
|
h("div", { class: `${clsPrefix}-base-selection-overlay__wrapper` }, renderTag
|
|
513
518
|
? renderTag({
|
|
514
519
|
option: this.selectedOption,
|
|
@@ -516,7 +521,7 @@ export default defineComponent({
|
|
|
516
521
|
})
|
|
517
522
|
: renderLabel
|
|
518
523
|
? renderLabel(this.selectedOption, true)
|
|
519
|
-
: render(this.label, this.selectedOption, true)))),
|
|
524
|
+
: render(this.label, this.selectedOption, true)))) : null,
|
|
520
525
|
showPlaceholder ? (h("div", { class: `${clsPrefix}-base-selection-placeholder ${clsPrefix}-base-selection-overlay`, key: "placeholder" },
|
|
521
526
|
h("div", { class: `${clsPrefix}-base-selection-overlay__wrapper` }, this.filterablePlaceholder))) : null,
|
|
522
527
|
suffix));
|
|
@@ -537,6 +542,8 @@ export default defineComponent({
|
|
|
537
542
|
}
|
|
538
543
|
return (h("div", { ref: "selfRef", class: [
|
|
539
544
|
`${clsPrefix}-base-selection`,
|
|
545
|
+
this.themeClass,
|
|
546
|
+
status && `${clsPrefix}-base-selection--${status}-status`,
|
|
540
547
|
{
|
|
541
548
|
[`${clsPrefix}-base-selection--active`]: this.active,
|
|
542
549
|
[`${clsPrefix}-base-selection--selected`]: this.selected || (this.active && this.pattern),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VNodeChild } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SelectOption } from '../../../select/src/interface';
|
|
3
3
|
export declare type RenderTag = (props: {
|
|
4
|
-
option:
|
|
4
|
+
option: SelectOption;
|
|
5
5
|
handleClose: () => void;
|
|
6
6
|
}) => VNodeChild;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c, cB, cE, cM, cNotM
|
|
1
|
+
import { c, cB, cE, cM, cNotM } from '../../../../_utils/cssr'; // vars:
|
|
2
2
|
// --n-bezier
|
|
3
3
|
// --n-border
|
|
4
4
|
// --n-border-active
|
|
@@ -40,9 +40,7 @@ export default c([cB('base-selection', `
|
|
|
40
40
|
font-size: var(--n-font-size);
|
|
41
41
|
`, [cB('base-loading', `
|
|
42
42
|
color: var(--n-loading-color);
|
|
43
|
-
`), cB('base-selection-tags',
|
|
44
|
-
minHeight: 'var(--n-height)'
|
|
45
|
-
}), cE('border, state-border', `
|
|
43
|
+
`), cB('base-selection-tags', 'min-height: var(--n-height);'), cE('border, state-border', `
|
|
46
44
|
position: absolute;
|
|
47
45
|
left: 0;
|
|
48
46
|
right: 0;
|
|
@@ -148,13 +146,7 @@ export default c([cB('base-selection', `
|
|
|
148
146
|
`)]), cM('active', [cE('state-border', `
|
|
149
147
|
box-shadow: var(--n-box-shadow-active);
|
|
150
148
|
border: var(--n-border-active);
|
|
151
|
-
`), cB('base-selection-label',
|
|
152
|
-
backgroundColor: 'var(--n-color-active)'
|
|
153
|
-
}), cB('base-selection-tags', {
|
|
154
|
-
backgroundColor: 'var(--n-color-active)'
|
|
155
|
-
})])]), cM('disabled', {
|
|
156
|
-
cursor: 'not-allowed'
|
|
157
|
-
}, [cE('arrow', `
|
|
149
|
+
`), cB('base-selection-label', 'background-color: var(--n-color-active);'), cB('base-selection-tags', 'background-color: var(--n-color-active);')])]), cM('disabled', 'cursor: not-allowed;', [cE('arrow', `
|
|
158
150
|
color: var(--n-arrow-color-disabled);
|
|
159
151
|
`), cB('base-selection-label', `
|
|
160
152
|
cursor: not-allowed;
|
|
@@ -200,7 +192,16 @@ export default c([cB('base-selection', `
|
|
|
200
192
|
visibility: hidden;
|
|
201
193
|
user-select: none;
|
|
202
194
|
opacity: 0;
|
|
203
|
-
`)])]),
|
|
195
|
+
`)]), ['warning', 'error'].map(status => cM(`${status}-status`, [cE('state-border', `border: var(--n-border-${status});`), cNotM('disabled', [c('&:hover', [cE('state-border', `
|
|
196
|
+
box-shadow: var(--n-box-shadow-hover-${status});
|
|
197
|
+
border: var(--n-border-hover-${status});
|
|
198
|
+
`)]), cM('active', [cE('state-border', `
|
|
199
|
+
box-shadow: var(--n-box-shadow-active-${status});
|
|
200
|
+
border: var(--n-border-active-${status});
|
|
201
|
+
`), cB('base-selection-label', `background-color: var(--n-color-active-${status});`), cB('base-selection-tags', `background-color: var(--n-color-active-${status});`)]), cM('focus', [cE('state-border', `
|
|
202
|
+
box-shadow: var(--n-box-shadow-focus-${status});
|
|
203
|
+
border: var(--n-border-focus-${status});
|
|
204
|
+
`)])])]))]), cB('base-selection-popover', `
|
|
204
205
|
margin-bottom: -3px;
|
|
205
206
|
display: flex;
|
|
206
207
|
flex-wrap: wrap;
|
|
@@ -208,27 +209,11 @@ export default c([cB('base-selection', `
|
|
|
208
209
|
max-width: 100%;
|
|
209
210
|
display: inline-flex;
|
|
210
211
|
padding: 0 7px 3px 0;
|
|
211
|
-
`, [c('&:last-child',
|
|
212
|
-
paddingRight: 0
|
|
213
|
-
}), cB('tag', `
|
|
212
|
+
`, [c('&:last-child', 'padding-right: 0;'), cB('tag', `
|
|
214
213
|
font-size: 14px;
|
|
215
214
|
max-width: 100%;
|
|
216
215
|
`, [cE('content', `
|
|
216
|
+
line-height: 1.25;
|
|
217
217
|
text-overflow: ellipsis;
|
|
218
218
|
overflow: hidden;
|
|
219
|
-
`)])])
|
|
220
|
-
border: `var(--n-border-${status})`
|
|
221
|
-
}), cNotM('disabled', [c('&:hover', [cE('state-border', `
|
|
222
|
-
box-shadow: var(--n-box-shadow-hover-${status});
|
|
223
|
-
border: var(--n-border-hover-${status});
|
|
224
|
-
`)]), cM('active', [cE('state-border', `
|
|
225
|
-
box-shadow: var(--n-box-shadow-active-${status});
|
|
226
|
-
border: var(--n-border-active-${status});
|
|
227
|
-
`), cB('base-selection-label', {
|
|
228
|
-
backgroundColor: `var(--n-color-active-${status})`
|
|
229
|
-
}), cB('base-selection-tags', {
|
|
230
|
-
backgroundColor: `var(--n-box-shadow-active-${status})`
|
|
231
|
-
})]), cM('focus', [cE('state-border', `
|
|
232
|
-
box-shadow: var(--n-box-shadow-focus-${status});
|
|
233
|
-
border: var(--n-border-focus-${status});
|
|
234
|
-
`)])])])))]);
|
|
219
|
+
`)])])]);
|
|
@@ -22,19 +22,19 @@ const internalSelectionDark = {
|
|
|
22
22
|
// default
|
|
23
23
|
textColor: textColor2, textColorDisabled,
|
|
24
24
|
placeholderColor,
|
|
25
|
-
placeholderColorDisabled, color: inputColor, colorDisabled: inputColorDisabled, colorActive: changeColor(primaryColor, { alpha: 0.1 }), border: '1px solid #0000', borderHover: `1px solid ${primaryColorHover}`, borderActive: `1px solid ${primaryColor}`, borderFocus: `1px solid ${primaryColorHover}`, boxShadowHover:
|
|
25
|
+
placeholderColorDisabled, color: inputColor, colorDisabled: inputColorDisabled, colorActive: changeColor(primaryColor, { alpha: 0.1 }), border: '1px solid #0000', borderHover: `1px solid ${primaryColorHover}`, borderActive: `1px solid ${primaryColor}`, borderFocus: `1px solid ${primaryColorHover}`, boxShadowHover: 'none', boxShadowActive: `0 0 8px 0 ${changeColor(primaryColor, {
|
|
26
26
|
alpha: 0.4
|
|
27
27
|
})}`, boxShadowFocus: `0 0 8px 0 ${changeColor(primaryColor, {
|
|
28
28
|
alpha: 0.4
|
|
29
29
|
})}`, caretColor: primaryColor, arrowColor: iconColor, arrowColorDisabled: iconColorDisabled, loadingColor: primaryColor,
|
|
30
30
|
// warning
|
|
31
|
-
borderWarning: `1px solid ${warningColor}`, borderHoverWarning: `1px solid ${warningColorHover}`, borderActiveWarning: `1px solid ${warningColor}`, borderFocusWarning: `1px solid ${warningColorHover}`, boxShadowHoverWarning:
|
|
31
|
+
borderWarning: `1px solid ${warningColor}`, borderHoverWarning: `1px solid ${warningColorHover}`, borderActiveWarning: `1px solid ${warningColor}`, borderFocusWarning: `1px solid ${warningColorHover}`, boxShadowHoverWarning: 'none', boxShadowActiveWarning: `0 0 8px 0 ${changeColor(warningColor, {
|
|
32
32
|
alpha: 0.4
|
|
33
33
|
})}`, boxShadowFocusWarning: `0 0 8px 0 ${changeColor(warningColor, {
|
|
34
34
|
alpha: 0.4
|
|
35
35
|
})}`, colorActiveWarning: changeColor(warningColor, { alpha: 0.1 }), caretColorWarning: warningColor,
|
|
36
36
|
// error
|
|
37
|
-
borderError: `1px solid ${errorColor}`, borderHoverError: `1px solid ${errorColorHover}`, borderActiveError: `1px solid ${errorColor}`, borderFocusError: `1px solid ${errorColorHover}`, boxShadowHoverError:
|
|
37
|
+
borderError: `1px solid ${errorColor}`, borderHoverError: `1px solid ${errorColorHover}`, borderActiveError: `1px solid ${errorColor}`, borderFocusError: `1px solid ${errorColorHover}`, boxShadowHoverError: 'none', boxShadowActiveError: `0 0 8px 0 ${changeColor(errorColor, {
|
|
38
38
|
alpha: 0.4
|
|
39
39
|
})}`, boxShadowFocusError: `0 0 8px 0 ${changeColor(errorColor, {
|
|
40
40
|
alpha: 0.4
|
|
@@ -20,7 +20,7 @@ declare const self: (vars: ThemeCommonVars) => {
|
|
|
20
20
|
borderHover: string;
|
|
21
21
|
borderActive: string;
|
|
22
22
|
borderFocus: string;
|
|
23
|
-
boxShadowHover:
|
|
23
|
+
boxShadowHover: string;
|
|
24
24
|
boxShadowActive: string;
|
|
25
25
|
boxShadowFocus: string;
|
|
26
26
|
caretColor: string;
|
|
@@ -31,7 +31,7 @@ declare const self: (vars: ThemeCommonVars) => {
|
|
|
31
31
|
borderHoverWarning: string;
|
|
32
32
|
borderActiveWarning: string;
|
|
33
33
|
borderFocusWarning: string;
|
|
34
|
-
boxShadowHoverWarning:
|
|
34
|
+
boxShadowHoverWarning: string;
|
|
35
35
|
boxShadowActiveWarning: string;
|
|
36
36
|
boxShadowFocusWarning: string;
|
|
37
37
|
colorActiveWarning: string;
|
|
@@ -40,7 +40,7 @@ declare const self: (vars: ThemeCommonVars) => {
|
|
|
40
40
|
borderHoverError: string;
|
|
41
41
|
borderActiveError: string;
|
|
42
42
|
borderFocusError: string;
|
|
43
|
-
boxShadowHoverError:
|
|
43
|
+
boxShadowHoverError: string;
|
|
44
44
|
boxShadowActiveError: string;
|
|
45
45
|
boxShadowFocusError: string;
|
|
46
46
|
colorActiveError: string;
|
|
@@ -75,7 +75,7 @@ declare const internalSelectionLight: import("../../../_mixins").Theme<"Internal
|
|
|
75
75
|
borderHover: string;
|
|
76
76
|
borderActive: string;
|
|
77
77
|
borderFocus: string;
|
|
78
|
-
boxShadowHover:
|
|
78
|
+
boxShadowHover: string;
|
|
79
79
|
boxShadowActive: string;
|
|
80
80
|
boxShadowFocus: string;
|
|
81
81
|
caretColor: string;
|
|
@@ -86,7 +86,7 @@ declare const internalSelectionLight: import("../../../_mixins").Theme<"Internal
|
|
|
86
86
|
borderHoverWarning: string;
|
|
87
87
|
borderActiveWarning: string;
|
|
88
88
|
borderFocusWarning: string;
|
|
89
|
-
boxShadowHoverWarning:
|
|
89
|
+
boxShadowHoverWarning: string;
|
|
90
90
|
boxShadowActiveWarning: string;
|
|
91
91
|
boxShadowFocusWarning: string;
|
|
92
92
|
colorActiveWarning: string;
|
|
@@ -95,7 +95,7 @@ declare const internalSelectionLight: import("../../../_mixins").Theme<"Internal
|
|
|
95
95
|
borderHoverError: string;
|
|
96
96
|
borderActiveError: string;
|
|
97
97
|
borderFocusError: string;
|
|
98
|
-
boxShadowHoverError:
|
|
98
|
+
boxShadowHoverError: string;
|
|
99
99
|
boxShadowActiveError: string;
|
|
100
100
|
boxShadowFocusError: string;
|
|
101
101
|
colorActiveError: string;
|
|
@@ -17,19 +17,19 @@ const self = (vars) => {
|
|
|
17
17
|
// default
|
|
18
18
|
textColor: textColor2, textColorDisabled,
|
|
19
19
|
placeholderColor,
|
|
20
|
-
placeholderColorDisabled, color: inputColor, colorDisabled: inputColorDisabled, colorActive: inputColor, border: `1px solid ${borderColor}`, borderHover: `1px solid ${primaryColorHover}`, borderActive: `1px solid ${primaryColor}`, borderFocus: `1px solid ${primaryColorHover}`, boxShadowHover:
|
|
20
|
+
placeholderColorDisabled, color: inputColor, colorDisabled: inputColorDisabled, colorActive: inputColor, border: `1px solid ${borderColor}`, borderHover: `1px solid ${primaryColorHover}`, borderActive: `1px solid ${primaryColor}`, borderFocus: `1px solid ${primaryColorHover}`, boxShadowHover: 'none', boxShadowActive: `0 0 0 2px ${changeColor(primaryColor, {
|
|
21
21
|
alpha: 0.2
|
|
22
22
|
})}`, boxShadowFocus: `0 0 0 2px ${changeColor(primaryColor, {
|
|
23
23
|
alpha: 0.2
|
|
24
24
|
})}`, caretColor: primaryColor, arrowColor: iconColor, arrowColorDisabled: iconColorDisabled, loadingColor: primaryColor,
|
|
25
25
|
// warning
|
|
26
|
-
borderWarning: `1px solid ${warningColor}`, borderHoverWarning: `1px solid ${warningColorHover}`, borderActiveWarning: `1px solid ${warningColor}`, borderFocusWarning: `1px solid ${warningColorHover}`, boxShadowHoverWarning:
|
|
26
|
+
borderWarning: `1px solid ${warningColor}`, borderHoverWarning: `1px solid ${warningColorHover}`, borderActiveWarning: `1px solid ${warningColor}`, borderFocusWarning: `1px solid ${warningColorHover}`, boxShadowHoverWarning: 'none', boxShadowActiveWarning: `0 0 0 2px ${changeColor(warningColor, {
|
|
27
27
|
alpha: 0.2
|
|
28
28
|
})}`, boxShadowFocusWarning: `0 0 0 2px ${changeColor(warningColor, {
|
|
29
29
|
alpha: 0.2
|
|
30
30
|
})}`, colorActiveWarning: inputColor, caretColorWarning: warningColor,
|
|
31
31
|
// error
|
|
32
|
-
borderError: `1px solid ${errorColor}`, borderHoverError: `1px solid ${errorColorHover}`, borderActiveError: `1px solid ${errorColor}`, borderFocusError: `1px solid ${errorColorHover}`, boxShadowHoverError:
|
|
32
|
+
borderError: `1px solid ${errorColor}`, borderHoverError: `1px solid ${errorColorHover}`, borderActiveError: `1px solid ${errorColor}`, borderFocusError: `1px solid ${errorColorHover}`, boxShadowHoverError: 'none', boxShadowActiveError: `0 0 0 2px ${changeColor(errorColor, {
|
|
33
33
|
alpha: 0.2
|
|
34
34
|
})}`, boxShadowFocusError: `0 0 0 2px ${changeColor(errorColor, {
|
|
35
35
|
alpha: 0.2
|
|
@@ -24,7 +24,7 @@ export default defineComponent({
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
setup(props) {
|
|
27
|
-
useStyle('
|
|
27
|
+
useStyle('-base-slot-machine', style, toRef(props, 'clsPrefix'));
|
|
28
28
|
const oldValueRef = ref();
|
|
29
29
|
const newValueRef = ref();
|
|
30
30
|
const numbersRef = computed(() => {
|
|
@@ -10,7 +10,7 @@ export default defineComponent({
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
setup(props) {
|
|
13
|
-
useStyle('
|
|
13
|
+
useStyle('-base-wave', style, toRef(props, 'clsPrefix'));
|
|
14
14
|
const selfRef = ref(null);
|
|
15
15
|
const activeRef = ref(false);
|
|
16
16
|
let animationTimerId = null;
|
package/es/_mixins/index.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export { default as useLocale } from './use-locale';
|
|
|
6
6
|
export { default as useStyle } from './use-style';
|
|
7
7
|
export { default as useHljs } from './use-hljs';
|
|
8
8
|
export type { Hljs } from './use-hljs';
|
|
9
|
-
export {
|
|
9
|
+
export { useThemeClass, emptyThemeClassHandle } from './use-css-vars-class';
|
package/es/_mixins/index.js
CHANGED
|
@@ -4,4 +4,4 @@ export { default as useConfig, defaultClsPrefix } from './use-config';
|
|
|
4
4
|
export { default as useLocale } from './use-locale';
|
|
5
5
|
export { default as useStyle } from './use-style';
|
|
6
6
|
export { default as useHljs } from './use-hljs';
|
|
7
|
-
export {
|
|
7
|
+
export { useThemeClass, emptyThemeClassHandle } from './use-css-vars-class';
|
package/es/_mixins/use-config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inject, computed } from 'vue';
|
|
2
|
-
import { configProviderInjectionKey } from '../config-provider/src/
|
|
2
|
+
import { configProviderInjectionKey } from '../config-provider/src/context';
|
|
3
3
|
export const defaultClsPrefix = 'n';
|
|
4
4
|
export default function useConfig(props = {}, options = {
|
|
5
5
|
defaultBordered: true
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
|
-
export declare function
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
export declare function useThemeClass(componentName: string, hashRef: Ref<string> | undefined, cssVarsRef: ComputedRef<Record<string, string>> | undefined, props: {
|
|
3
|
+
themeOverrides?: unknown;
|
|
4
|
+
}): {
|
|
5
|
+
themeClass: Ref<string>;
|
|
6
|
+
onRender: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const emptyThemeClassHandle: {
|
|
9
|
+
themeClass?: Ref<string>;
|
|
10
|
+
onRender?: () => void;
|
|
11
|
+
};
|
|
@@ -1,22 +1,53 @@
|
|
|
1
|
-
import { ref, watchEffect } from 'vue';
|
|
2
|
-
import hash from '
|
|
1
|
+
import { ref, inject, watchEffect } from 'vue';
|
|
2
|
+
import { hash } from 'css-render';
|
|
3
|
+
import { useSsrAdapter } from '@css-render/vue3-ssr';
|
|
4
|
+
import { configProviderInjectionKey } from '../config-provider/src/context';
|
|
5
|
+
import { throwError } from '../_utils';
|
|
3
6
|
import { c } from '../_utils/cssr';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
export function useThemeClass(componentName, hashRef, cssVarsRef, props) {
|
|
8
|
+
var _a;
|
|
9
|
+
if (!cssVarsRef)
|
|
10
|
+
throwError('useThemeClass', 'cssVarsRef is not passed');
|
|
11
|
+
const mergedThemeHashRef = (_a = inject(configProviderInjectionKey, null)) === null || _a === void 0 ? void 0 : _a.mergedThemeHashRef;
|
|
12
|
+
const themeClassRef = ref('');
|
|
13
|
+
const ssrAdapter = useSsrAdapter();
|
|
14
|
+
let renderCallback;
|
|
15
|
+
const mountStyle = () => {
|
|
16
|
+
let finalThemeHash = componentName;
|
|
17
|
+
const hashValue = hashRef ? hashRef.value : undefined;
|
|
18
|
+
const themeHash = mergedThemeHashRef === null || mergedThemeHashRef === void 0 ? void 0 : mergedThemeHashRef.value;
|
|
19
|
+
if (themeHash)
|
|
20
|
+
finalThemeHash += '-' + themeHash;
|
|
21
|
+
if (hashValue)
|
|
22
|
+
finalThemeHash += '-' + hashValue;
|
|
23
|
+
if (props.themeOverrides) {
|
|
24
|
+
finalThemeHash += '-' + hash(JSON.stringify(props.themeOverrides));
|
|
13
25
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
themeClassRef.value = finalThemeHash;
|
|
27
|
+
renderCallback = () => {
|
|
28
|
+
const cssVars = cssVarsRef.value;
|
|
29
|
+
let style = '';
|
|
30
|
+
for (const key in cssVars) {
|
|
31
|
+
style += `${key}: ${cssVars[key]};`;
|
|
32
|
+
}
|
|
33
|
+
c(`.${finalThemeHash}`, style).mount({
|
|
34
|
+
id: finalThemeHash,
|
|
35
|
+
ssr: ssrAdapter
|
|
36
|
+
});
|
|
37
|
+
renderCallback = undefined;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
watchEffect(() => {
|
|
41
|
+
mountStyle();
|
|
20
42
|
});
|
|
21
|
-
return
|
|
43
|
+
return {
|
|
44
|
+
themeClass: themeClassRef,
|
|
45
|
+
onRender: () => {
|
|
46
|
+
renderCallback === null || renderCallback === void 0 ? void 0 : renderCallback();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
22
49
|
}
|
|
50
|
+
export const emptyThemeClassHandle = {
|
|
51
|
+
themeClass: undefined,
|
|
52
|
+
onRender: undefined
|
|
53
|
+
};
|