naive-ui 2.24.7 → 2.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +5 -5
- package/es/_internal/select-menu/src/SelectMenu.js +32 -16
- package/es/_internal/selection/src/Selection.d.ts +13 -5
- package/es/_internal/selection/src/Selection.js +24 -15
- package/es/_internal/selection/src/interface.d.ts +2 -2
- package/es/_internal/selection/src/styles/index.cssr.js +16 -31
- package/es/_internal/slot-machine/src/SlotMachine.js +1 -1
- package/es/_internal/wave/src/Wave.js +1 -1
- package/es/_mixins/use-config.js +1 -1
- package/es/_mixins/use-css-vars-class.d.ts +4 -2
- package/es/_mixins/use-css-vars-class.js +26 -11
- 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/cssr/index.d.ts +1 -2
- package/es/_utils/cssr/index.js +1 -14
- package/es/_utils/index.d.ts +1 -1
- package/es/_utils/index.js +1 -1
- 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 +18 -1
- package/es/affix/src/Affix.js +1 -1
- package/es/alert/src/Alert.d.ts +4 -4
- package/es/alert/src/Alert.js +1 -1
- package/es/anchor/src/AnchorAdapter.js +1 -1
- package/es/auto-complete/src/AutoComplete.d.ts +17 -2
- 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.d.ts +4 -4
- package/es/badge/src/Badge.js +1 -1
- package/es/breadcrumb/src/Breadcrumb.js +1 -1
- package/es/button/src/Button.d.ts +4 -3
- package/es/button/src/Button.js +265 -229
- package/es/button/src/ButtonGroup.js +1 -1
- package/es/button/src/styles/button.cssr.js +1 -0
- package/es/calendar/src/Calendar.js +1 -1
- package/es/card/src/Card.d.ts +5 -1
- package/es/card/src/Card.js +3 -2
- 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 +6 -4
- package/es/cascader/src/Cascader.js +6 -6
- package/es/checkbox/src/Checkbox.js +1 -1
- 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 +1 -1
- package/es/data-table/src/DataTable.js +1 -1
- 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/date-picker/src/DatePicker.d.ts +2 -1
- package/es/date-picker/src/DatePicker.js +6 -6
- package/es/descriptions/src/Descriptions.d.ts +2 -2
- 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 +28 -61
- package/es/dialog/src/Dialog.js +4 -31
- package/es/dialog/src/DialogEnvironment.d.ts +12 -13
- package/es/dialog/src/DialogEnvironment.js +3 -2
- package/es/dialog/src/DialogProvider.d.ts +4 -6
- 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 +11 -20
- 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 +5 -5
- package/es/form/src/FormItem.js +3 -2
- package/es/form/src/FormItemCol.d.ts +4 -4
- package/es/form/src/FormItemGridItem.d.ts +5 -5
- package/es/form/src/FormItemRow.d.ts +3 -3
- 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.d.ts +1 -1
- package/es/form/src/utils.js +1 -1
- package/es/global-style/src/GlobalStyle.js +1 -1
- package/es/gradient-text/src/GradientText.d.ts +5 -5
- 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 +48 -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/ImagePreview.js +1 -1
- package/es/input/src/Input.d.ts +7 -2
- 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 +3 -2
- 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/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 +17 -2
- package/es/mention/src/Mention.js +7 -3
- package/es/menu/src/Menu.d.ts +2 -4
- 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 +6 -4
- package/es/modal/src/BodyWrapper.js +2 -2
- package/es/modal/src/Modal.d.ts +8 -5
- package/es/modal/src/Modal.js +2 -2
- package/es/modal/src/presetProps.d.ts +3 -2
- package/es/modal/src/presetProps.js +1 -1
- package/es/notification/index.d.ts +1 -1
- package/es/notification/src/Notification.d.ts +5 -6
- 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 +7 -8
- package/es/notification/src/NotificationEnvironment.js +3 -3
- package/es/notification/src/NotificationProvider.d.ts +11 -7
- 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.js +1 -1
- 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 +18 -5
- package/es/popselect/src/Popselect.js +5 -2
- package/es/popselect/src/PopselectPanel.d.ts +2 -2
- package/es/popselect/src/PopselectPanel.js +4 -1
- package/es/progress/src/Progress.d.ts +1 -1
- package/es/progress/src/Progress.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.d.ts +4 -4
- package/es/result/src/Result.js +1 -1
- package/es/select/index.d.ts +2 -0
- package/es/select/src/Select.d.ts +27 -24
- package/es/select/src/Select.js +71 -41
- package/es/select/src/interface.d.ts +2 -0
- 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 +4 -4
- package/es/tag/src/Tag.js +1 -1
- package/es/tag/src/common-props.d.ts +1 -1
- package/es/tag/src/styles/index.cssr.js +5 -17
- 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/timeline/src/TimelineItem.d.ts +4 -4
- 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-select/src/TreeSelect.d.ts +16 -14
- package/es/tree-select/src/TreeSelect.js +8 -5
- package/es/typography/src/a.js +1 -1
- package/es/typography/src/blockquote.js +1 -1
- package/es/typography/src/create-header.d.ts +4 -4
- package/es/typography/src/create-header.js +1 -1
- package/es/typography/src/headers.d.ts +18 -18
- 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/upload/src/UploadFile.d.ts +1 -1
- package/es/upload/src/UploadProgress.d.ts +2 -2
- 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 +5 -5
- package/lib/_internal/select-menu/src/SelectMenu.js +31 -15
- package/lib/_internal/selection/src/Selection.d.ts +13 -5
- package/lib/_internal/selection/src/Selection.js +24 -15
- package/lib/_internal/selection/src/interface.d.ts +2 -2
- package/lib/_internal/selection/src/styles/index.cssr.js +15 -30
- package/lib/_internal/slot-machine/src/SlotMachine.js +1 -1
- package/lib/_internal/wave/src/Wave.js +1 -1
- package/lib/_mixins/use-config.js +2 -2
- package/lib/_mixins/use-css-vars-class.d.ts +4 -2
- package/lib/_mixins/use-css-vars-class.js +25 -13
- 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/cssr/index.d.ts +1 -2
- package/lib/_utils/cssr/index.js +1 -15
- package/lib/_utils/index.d.ts +1 -1
- package/lib/_utils/index.js +5 -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 +22 -2
- package/lib/affix/src/Affix.js +1 -1
- package/lib/alert/src/Alert.d.ts +4 -4
- package/lib/alert/src/Alert.js +1 -1
- package/lib/anchor/src/AnchorAdapter.js +1 -1
- package/lib/auto-complete/src/AutoComplete.d.ts +17 -2
- 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.d.ts +4 -4
- package/lib/badge/src/Badge.js +1 -1
- package/lib/breadcrumb/src/Breadcrumb.js +1 -1
- package/lib/button/src/Button.d.ts +4 -3
- package/lib/button/src/Button.js +264 -228
- package/lib/button/src/ButtonGroup.js +1 -1
- package/lib/button/src/styles/button.cssr.js +1 -0
- package/lib/calendar/src/Calendar.js +1 -1
- package/lib/card/src/Card.d.ts +5 -1
- package/lib/card/src/Card.js +3 -2
- 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 +6 -4
- package/lib/cascader/src/Cascader.js +6 -6
- package/lib/checkbox/src/Checkbox.js +1 -1
- 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 +1 -1
- package/lib/data-table/src/DataTable.js +1 -1
- 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/date-picker/src/DatePicker.d.ts +2 -1
- package/lib/date-picker/src/DatePicker.js +6 -6
- package/lib/descriptions/src/Descriptions.d.ts +2 -2
- 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 +28 -61
- package/lib/dialog/src/Dialog.js +5 -32
- package/lib/dialog/src/DialogEnvironment.d.ts +12 -13
- package/lib/dialog/src/DialogEnvironment.js +6 -24
- package/lib/dialog/src/DialogProvider.d.ts +4 -6
- 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 +11 -20
- 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 +5 -5
- package/lib/form/src/FormItem.js +5 -4
- package/lib/form/src/FormItemCol.d.ts +4 -4
- package/lib/form/src/FormItemGridItem.d.ts +5 -5
- package/lib/form/src/FormItemRow.d.ts +3 -3
- 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.d.ts +1 -1
- package/lib/form/src/utils.js +4 -4
- package/lib/global-style/src/GlobalStyle.js +2 -2
- package/lib/gradient-text/src/GradientText.d.ts +5 -5
- 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 +54 -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/ImagePreview.js +1 -1
- package/lib/input/src/Input.d.ts +7 -2
- 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 +3 -2
- 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/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 +17 -2
- package/lib/mention/src/Mention.js +7 -3
- package/lib/menu/src/Menu.d.ts +2 -4
- 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 +6 -4
- package/lib/modal/src/BodyWrapper.js +3 -3
- package/lib/modal/src/Modal.d.ts +8 -5
- package/lib/modal/src/Modal.js +3 -3
- package/lib/modal/src/presetProps.d.ts +3 -2
- package/lib/modal/src/presetProps.js +2 -2
- package/lib/notification/index.d.ts +1 -1
- package/lib/notification/src/Notification.d.ts +5 -6
- 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 +7 -8
- package/lib/notification/src/NotificationEnvironment.js +4 -23
- package/lib/notification/src/NotificationProvider.d.ts +11 -7
- 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.js +1 -1
- 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 +18 -5
- package/lib/popselect/src/Popselect.js +5 -2
- package/lib/popselect/src/PopselectPanel.d.ts +2 -2
- package/lib/popselect/src/PopselectPanel.js +4 -1
- package/lib/progress/src/Progress.d.ts +1 -1
- package/lib/progress/src/Progress.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.d.ts +4 -4
- package/lib/result/src/Result.js +1 -1
- package/lib/select/index.d.ts +2 -0
- package/lib/select/src/Select.d.ts +27 -24
- package/lib/select/src/Select.js +71 -41
- package/lib/select/src/interface.d.ts +2 -0
- 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 +4 -4
- package/lib/tag/src/Tag.js +1 -1
- package/lib/tag/src/common-props.d.ts +1 -1
- package/lib/tag/src/styles/index.cssr.js +5 -17
- 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/timeline/src/TimelineItem.d.ts +4 -4
- 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-select/src/TreeSelect.d.ts +16 -14
- package/lib/tree-select/src/TreeSelect.js +8 -5
- package/lib/typography/src/a.js +1 -1
- package/lib/typography/src/blockquote.js +1 -1
- package/lib/typography/src/create-header.d.ts +4 -4
- package/lib/typography/src/create-header.js +1 -1
- package/lib/typography/src/headers.d.ts +18 -18
- 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/upload/src/UploadFile.d.ts +1 -1
- package/lib/upload/src/UploadProgress.d.ts +2 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +7 -8
- package/volar.d.ts +1 -0
- package/web-types.json +425 -220
|
@@ -15,7 +15,7 @@ export default defineComponent({
|
|
|
15
15
|
onClear: Function
|
|
16
16
|
},
|
|
17
17
|
setup(props) {
|
|
18
|
-
useStyle('
|
|
18
|
+
useStyle('-base-clear', style, toRef(props, 'clsPrefix'));
|
|
19
19
|
const { NConfigProvider } = useConfig();
|
|
20
20
|
return {
|
|
21
21
|
NConfigProvider,
|
|
@@ -29,9 +29,10 @@ export default defineComponent({
|
|
|
29
29
|
return (h("div", { class: `${clsPrefix}-base-clear` },
|
|
30
30
|
h(NIconSwitchTransition, null, {
|
|
31
31
|
default: () => {
|
|
32
|
+
var _a, _b;
|
|
32
33
|
return this.show ? (h(NBaseIcon, { clsPrefix: clsPrefix, key: "dismiss", class: `${clsPrefix}-base-clear__clear`, onClick: this.onClear, onMousedown: this.handleMouseDown, "data-clear": true }, {
|
|
33
34
|
default: () => h(ClearIcon, null)
|
|
34
|
-
})) : (h("div", { key: "icon", class: `${clsPrefix}-base-clear__placeholder` }, this.$slots));
|
|
35
|
+
})) : (h("div", { key: "icon", class: `${clsPrefix}-base-clear__placeholder` }, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a)));
|
|
35
36
|
}
|
|
36
37
|
})));
|
|
37
38
|
}
|
|
@@ -17,7 +17,7 @@ export default defineComponent({
|
|
|
17
17
|
onClick: Function
|
|
18
18
|
},
|
|
19
19
|
setup(props) {
|
|
20
|
-
useStyle('
|
|
20
|
+
useStyle('-base-close', style, toRef(props, 'clsPrefix'));
|
|
21
21
|
return () => {
|
|
22
22
|
const { clsPrefix, disabled } = props;
|
|
23
23
|
return (h(NBaseIcon, { role: "button", ariaDisabled: disabled, ariaLabel: "close", clsPrefix: clsPrefix, class: [
|
|
@@ -23,7 +23,7 @@ export default defineComponent({
|
|
|
23
23
|
onMouseup: Function
|
|
24
24
|
},
|
|
25
25
|
setup(props) {
|
|
26
|
-
useStyle('
|
|
26
|
+
useStyle('-base-icon', style, toRef(props, 'clsPrefix'));
|
|
27
27
|
},
|
|
28
28
|
render() {
|
|
29
29
|
return (h("i", { class: `${this.clsPrefix}-base-icon`, onClick: this.onClick, onMousedown: this.onMousedown, onMouseup: this.onMouseup, role: this.role, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, "aria-disabled": this.ariaDisabled }, this.$slots));
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { h, defineComponent } from 'vue';
|
|
2
|
+
export default defineComponent({
|
|
3
|
+
name: 'ArrowUp',
|
|
4
|
+
render() {
|
|
5
|
+
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20" },
|
|
6
|
+
h("g", { fill: "none" },
|
|
7
|
+
h("path", { d: "M3.13 9.163a.5.5 0 1 0 .74.674L9.5 3.67V17.5a.5.5 0 0 0 1 0V3.672l5.63 6.165a.5.5 0 0 0 .738-.674l-6.315-6.916a.746.746 0 0 0-.632-.24a.746.746 0 0 0-.476.24L3.131 9.163z", fill: "currentColor" }))));
|
|
8
|
+
}
|
|
9
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as AddIcon } from './Add';
|
|
2
2
|
export { default as ArrowDownIcon } from './ArrowDown';
|
|
3
|
+
export { default as ArrowUpIcon } from './ArrowUp';
|
|
3
4
|
export { default as AttachIcon } from './Attach';
|
|
4
5
|
export { default as BackwardIcon } from './Backward';
|
|
5
6
|
export { default as DateIcon } from './Date';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as AddIcon } from './Add';
|
|
2
2
|
export { default as ArrowDownIcon } from './ArrowDown';
|
|
3
|
+
export { default as ArrowUpIcon } from './ArrowUp';
|
|
3
4
|
export { default as AttachIcon } from './Attach';
|
|
4
5
|
export { default as BackwardIcon } from './Backward';
|
|
5
6
|
export { default as DateIcon } from './Date';
|
|
@@ -33,7 +33,7 @@ export default defineComponent({
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
setup(props) {
|
|
36
|
-
useStyle('
|
|
36
|
+
useStyle('-base-loading', style, toRef(props, 'clsPrefix'));
|
|
37
37
|
},
|
|
38
38
|
render() {
|
|
39
39
|
const { clsPrefix, radius, strokeWidth, stroke, scale } = this;
|
|
@@ -10,7 +10,7 @@ export default defineComponent({
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
setup(props) {
|
|
13
|
-
useStyle('
|
|
13
|
+
useStyle('-base-menu-mask', style, toRef(props, 'clsPrefix'));
|
|
14
14
|
const messageRef = ref(null);
|
|
15
15
|
let timerId = null;
|
|
16
16
|
const uncontrolledShowRef = ref(false);
|
|
@@ -454,7 +454,7 @@ const Scrollbar = defineComponent({
|
|
|
454
454
|
off('mousemove', window, handleYScrollMouseMove, true);
|
|
455
455
|
off('mouseup', window, handleYScrollMouseUp, true);
|
|
456
456
|
});
|
|
457
|
-
const themeRef = useTheme('Scrollbar', '
|
|
457
|
+
const themeRef = useTheme('Scrollbar', '-scrollbar', style, scrollbarLight, props, mergedClsPrefixRef);
|
|
458
458
|
const exposedMethods = {
|
|
459
459
|
scrollTo,
|
|
460
460
|
sync,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
import { TreeNode } from 'treemate';
|
|
3
|
-
import type {
|
|
3
|
+
import type { SelectOption, SelectGroupOption, SelectIgnoredOption, Value, SelectTreeMate } from '../../../select/src/interface';
|
|
4
4
|
import type { RenderLabel, Size, RenderOption } from './interface';
|
|
5
5
|
declare const _default: import("vue").DefineComponent<{
|
|
6
6
|
clsPrefix: {
|
|
@@ -51,7 +51,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
51
51
|
type: BooleanConstructor;
|
|
52
52
|
default: boolean;
|
|
53
53
|
};
|
|
54
|
-
onToggle: PropType<(tmNode: TreeNode<
|
|
54
|
+
onToggle: PropType<(tmNode: TreeNode<SelectOption>) => void>;
|
|
55
55
|
theme: PropType<import("../../../_mixins").Theme<"InternalSelectMenu", {
|
|
56
56
|
optionFontSizeSmall: string;
|
|
57
57
|
optionFontSizeMedium: string;
|
|
@@ -210,7 +210,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
210
210
|
}>>>;
|
|
211
211
|
}, {
|
|
212
212
|
selfRef: import("vue").Ref<HTMLElement | null>;
|
|
213
|
-
getPendingTmNode: () => TreeNode<SelectBaseOption<string | number, string | ((option: SelectBaseOption<string | number, string | any>, selected: boolean) => import("vue").VNodeChild)>, SelectBaseOption<string | number, string | ((option: SelectBaseOption<string | number, string | any>, selected: boolean) => import("vue").VNodeChild)>, SelectBaseOption<string | number, string | ((option: SelectBaseOption<string | number, string | any>, selected: boolean) => import("vue").VNodeChild)>> | null;
|
|
213
|
+
getPendingTmNode: () => TreeNode<import("../../../select/src/interface").SelectBaseOption<string | number, string | ((option: import("../../../select/src/interface").SelectBaseOption<string | number, string | any>, selected: boolean) => import("vue").VNodeChild)>, import("../../../select/src/interface").SelectBaseOption<string | number, string | ((option: import("../../../select/src/interface").SelectBaseOption<string | number, string | any>, selected: boolean) => import("vue").VNodeChild)>, import("../../../select/src/interface").SelectBaseOption<string | number, string | ((option: import("../../../select/src/interface").SelectBaseOption<string | number, string | any>, selected: boolean) => import("vue").VNodeChild)>> | null;
|
|
214
214
|
prev: () => void;
|
|
215
215
|
next: () => void;
|
|
216
216
|
mergedTheme: import("vue").ComputedRef<{
|
|
@@ -425,7 +425,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
425
425
|
})[]>;
|
|
426
426
|
itemSize: import("vue").ComputedRef<number>;
|
|
427
427
|
padding: import("vue").ComputedRef<import("seemly").Margin>;
|
|
428
|
-
flattenedNodes: import("vue").ComputedRef<TreeNode<SelectBaseOption<string | number, string | ((option: SelectBaseOption<string | number, string | any>, selected: boolean) => import("vue").VNodeChild)>, SelectGroupOption, SelectIgnoredOption>[]>;
|
|
428
|
+
flattenedNodes: import("vue").ComputedRef<TreeNode<import("../../../select/src/interface").SelectBaseOption<string | number, string | ((option: import("../../../select/src/interface").SelectBaseOption<string | number, string | any>, selected: boolean) => import("vue").VNodeChild)>, SelectGroupOption, SelectIgnoredOption>[]>;
|
|
429
429
|
empty: import("vue").ComputedRef<boolean>;
|
|
430
430
|
virtualListContainer(): HTMLElement;
|
|
431
431
|
virtualListContent(): HTMLElement;
|
|
@@ -486,7 +486,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
486
486
|
type: BooleanConstructor;
|
|
487
487
|
default: boolean;
|
|
488
488
|
};
|
|
489
|
-
onToggle: PropType<(tmNode: TreeNode<
|
|
489
|
+
onToggle: PropType<(tmNode: TreeNode<SelectOption>) => void>;
|
|
490
490
|
theme: PropType<import("../../../_mixins").Theme<"InternalSelectMenu", {
|
|
491
491
|
optionFontSizeSmall: string;
|
|
492
492
|
optionFontSizeMedium: string;
|
|
@@ -4,16 +4,16 @@ import { VirtualList } from 'vueuc';
|
|
|
4
4
|
import { depx, getPadding, happensIn } from 'seemly';
|
|
5
5
|
import { NEmpty } from '../../../empty';
|
|
6
6
|
import { NScrollbar } from '../../scrollbar';
|
|
7
|
-
import { formatLength } from '../../../_utils';
|
|
7
|
+
import { formatLength, resolveSlot, resolveWrappedSlot } from '../../../_utils';
|
|
8
8
|
import { createKey } from '../../../_utils/cssr';
|
|
9
9
|
import { useTheme } from '../../../_mixins';
|
|
10
10
|
import NInternalLoading from '../../loading';
|
|
11
11
|
import NFocusDetector from '../../focus-detector';
|
|
12
|
+
import { internalSelectMenuLight } from '../styles';
|
|
12
13
|
import NSelectOption from './SelectOption';
|
|
13
14
|
import NSelectGroupHeader from './SelectGroupHeader';
|
|
14
|
-
import style from './styles/index.cssr';
|
|
15
|
-
import { internalSelectMenuLight } from '../styles';
|
|
16
15
|
import { internalSelectionMenuInjectionKey, internalSelectionMenuBodyInjectionKey } from './interface';
|
|
16
|
+
import style from './styles/index.cssr';
|
|
17
17
|
export default defineComponent({
|
|
18
18
|
name: 'InternalSelectMenu',
|
|
19
19
|
props: Object.assign(Object.assign({}, useTheme.props), { clsPrefix: {
|
|
@@ -46,7 +46,7 @@ export default defineComponent({
|
|
|
46
46
|
// deprecated
|
|
47
47
|
onToggle: Function }),
|
|
48
48
|
setup(props) {
|
|
49
|
-
const themeRef = useTheme('InternalSelectMenu', '
|
|
49
|
+
const themeRef = useTheme('InternalSelectMenu', '-internal-select-menu', style, internalSelectMenuLight, props, toRef(props, 'clsPrefix'));
|
|
50
50
|
const selfRef = ref(null);
|
|
51
51
|
const virtualListRef = ref(null);
|
|
52
52
|
const scrollbarRef = ref(null);
|
|
@@ -55,15 +55,27 @@ export default defineComponent({
|
|
|
55
55
|
const pendingNodeRef = ref(null);
|
|
56
56
|
function initPendingNode() {
|
|
57
57
|
const { treeMate } = props;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
let defaultPendingNode = null;
|
|
59
|
+
if (props.autoPending) {
|
|
60
|
+
const { value } = props;
|
|
61
|
+
if (value === null) {
|
|
62
|
+
defaultPendingNode = treeMate.getFirstAvailableNode();
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
if (props.multiple) {
|
|
66
|
+
defaultPendingNode = treeMate.getNode((value || [])[(value || []).length - 1]);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
defaultPendingNode = treeMate.getNode(value);
|
|
70
|
+
}
|
|
71
|
+
if (!defaultPendingNode || defaultPendingNode.disabled) {
|
|
72
|
+
defaultPendingNode = treeMate.getFirstAvailableNode();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (defaultPendingNode) {
|
|
76
|
+
setPendingTmNode(defaultPendingNode);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
67
79
|
}
|
|
68
80
|
let initPendingNodeWatchStopHandle;
|
|
69
81
|
watch(toRef(props, 'show'), (value) => {
|
|
@@ -290,8 +302,12 @@ export default defineComponent({
|
|
|
290
302
|
paddingBottom: this.padding.bottom
|
|
291
303
|
} }, this.flattenedNodes.map((tmNode) => tmNode.isGroup ? (h(NSelectGroupHeader, { key: tmNode.key, clsPrefix: clsPrefix, tmNode: tmNode })) : (h(NSelectOption, { clsPrefix: clsPrefix, key: tmNode.key, tmNode: tmNode })))));
|
|
292
304
|
}
|
|
293
|
-
})) : (h("div", { class: `${clsPrefix}-base-select-menu__empty` }, $slots.empty
|
|
294
|
-
|
|
295
|
-
|
|
305
|
+
})) : (h("div", { class: `${clsPrefix}-base-select-menu__empty` }, resolveSlot($slots.empty, () => [
|
|
306
|
+
h(NEmpty, { theme: mergedTheme.peers.Empty, themeOverrides: mergedTheme.peerOverrides.Empty })
|
|
307
|
+
]))),
|
|
308
|
+
resolveWrappedSlot($slots.action, (children) => [
|
|
309
|
+
h("div", { class: `${clsPrefix}-base-select-menu__action`, "data-action": true, key: "action" }, children),
|
|
310
|
+
h(NFocusDetector, { onFocus: this.onTabOut, key: "focus-detector" })
|
|
311
|
+
])));
|
|
296
312
|
}
|
|
297
313
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { PropType, InputHTMLAttributes } from 'vue';
|
|
2
2
|
import type { SelectBaseOption } from '../../../select/src/interface';
|
|
3
|
-
import {
|
|
3
|
+
import type { FormValidationStatus } from '../../../form/src/interface';
|
|
4
|
+
import type { RenderTag } from './interface';
|
|
4
5
|
import type { RenderLabel, RenderLabelImpl } from '../../select-menu/src/interface';
|
|
5
6
|
export interface InternalSelectionInst {
|
|
7
|
+
isCompositing: boolean;
|
|
6
8
|
focus: () => void;
|
|
7
9
|
focusInput: () => void;
|
|
8
10
|
blur: () => void;
|
|
@@ -20,7 +22,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
20
22
|
active: BooleanConstructor;
|
|
21
23
|
pattern: {
|
|
22
24
|
type: StringConstructor;
|
|
23
|
-
default:
|
|
25
|
+
default: string;
|
|
24
26
|
};
|
|
25
27
|
placeholder: StringConstructor;
|
|
26
28
|
selectedOption: {
|
|
@@ -57,7 +59,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
57
59
|
maxTagCount: PropType<number | "responsive">;
|
|
58
60
|
onClear: PropType<(e: MouseEvent) => void>;
|
|
59
61
|
onPatternInput: PropType<(e: InputEvent) => void>;
|
|
62
|
+
onPatternFocus: PropType<(e: FocusEvent) => void>;
|
|
63
|
+
onPatternBlur: PropType<(e: FocusEvent) => void>;
|
|
60
64
|
renderLabel: PropType<RenderLabel>;
|
|
65
|
+
status: PropType<FormValidationStatus>;
|
|
61
66
|
theme: PropType<import("../../../_mixins").Theme<"InternalSelection", {
|
|
62
67
|
fontSizeTiny: string;
|
|
63
68
|
fontSizeSmall: string;
|
|
@@ -479,7 +484,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
479
484
|
handlePatternKeyDown: (e: KeyboardEvent) => void;
|
|
480
485
|
handlePatternInputInput: (e: InputEvent) => void;
|
|
481
486
|
handlePatternInputBlur: (e: FocusEvent) => void;
|
|
482
|
-
handlePatternInputFocus: () => void;
|
|
487
|
+
handlePatternInputFocus: (e: FocusEvent) => void;
|
|
483
488
|
handleMouseEnterCounter: () => void;
|
|
484
489
|
handleMouseLeaveCounter: () => void;
|
|
485
490
|
handleFocusout: (e: FocusEvent) => void;
|
|
@@ -553,7 +558,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
553
558
|
active: BooleanConstructor;
|
|
554
559
|
pattern: {
|
|
555
560
|
type: StringConstructor;
|
|
556
|
-
default:
|
|
561
|
+
default: string;
|
|
557
562
|
};
|
|
558
563
|
placeholder: StringConstructor;
|
|
559
564
|
selectedOption: {
|
|
@@ -590,7 +595,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
590
595
|
maxTagCount: PropType<number | "responsive">;
|
|
591
596
|
onClear: PropType<(e: MouseEvent) => void>;
|
|
592
597
|
onPatternInput: PropType<(e: InputEvent) => void>;
|
|
598
|
+
onPatternFocus: PropType<(e: FocusEvent) => void>;
|
|
599
|
+
onPatternBlur: PropType<(e: FocusEvent) => void>;
|
|
593
600
|
renderLabel: PropType<RenderLabel>;
|
|
601
|
+
status: PropType<FormValidationStatus>;
|
|
594
602
|
theme: PropType<import("../../../_mixins").Theme<"InternalSelection", {
|
|
595
603
|
fontSizeTiny: string;
|
|
596
604
|
fontSizeSmall: string;
|
|
@@ -805,8 +813,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
805
813
|
active: boolean;
|
|
806
814
|
disabled: boolean;
|
|
807
815
|
autofocus: boolean;
|
|
808
|
-
loading: boolean;
|
|
809
816
|
bordered: boolean | undefined;
|
|
817
|
+
loading: boolean;
|
|
810
818
|
showArrow: boolean;
|
|
811
819
|
selectedOption: SelectBaseOption<string | number, string | ((option: SelectBaseOption<string | number, string | any>, selected: boolean) => import("vue").VNodeChild)> | null;
|
|
812
820
|
selectedOptions: SelectBaseOption<string | number, string | ((option: SelectBaseOption<string | number, string | any>, selected: boolean) => import("vue").VNodeChild)>[] | null;
|
|
@@ -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 }),
|
|
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;
|
|
@@ -404,7 +408,7 @@ export default defineComponent({
|
|
|
404
408
|
};
|
|
405
409
|
},
|
|
406
410
|
render() {
|
|
407
|
-
const { multiple, size, disabled, filterable, maxTagCount, bordered, clsPrefix, renderTag, renderLabel } = this;
|
|
411
|
+
const { status, multiple, size, disabled, filterable, maxTagCount, bordered, clsPrefix, renderTag, renderLabel } = this;
|
|
408
412
|
const maxTagCountResponsive = maxTagCount === 'responsive';
|
|
409
413
|
const maxTagCountNumeric = typeof maxTagCount === 'number';
|
|
410
414
|
const useMaxTagCount = maxTagCountResponsive || maxTagCountNumeric;
|
|
@@ -426,7 +430,7 @@ export default defineComponent({
|
|
|
426
430
|
: this.selectedOptions).map(createTag);
|
|
427
431
|
const input = filterable ? (h("div", { class: `${clsPrefix}-base-selection-input-tag`, ref: "inputTagElRef", key: "__input-tag__" },
|
|
428
432
|
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
|
|
433
|
+
h("span", { ref: "patternInputMirrorRef", class: `${clsPrefix}-base-selection-input-tag__mirror` }, this.pattern))) : null;
|
|
430
434
|
// May Overflow
|
|
431
435
|
const renderCounter = maxTagCountResponsive
|
|
432
436
|
? () => (h("div", { class: `${clsPrefix}-base-selection-tag-wrapper`, ref: "counterWrapperRef" },
|
|
@@ -475,7 +479,12 @@ export default defineComponent({
|
|
|
475
479
|
themeOverrides: this.mergedTheme.peerOverrides.Popover
|
|
476
480
|
}
|
|
477
481
|
: null;
|
|
478
|
-
const
|
|
482
|
+
const showPlaceholder = this.selected
|
|
483
|
+
? false
|
|
484
|
+
: this.active
|
|
485
|
+
? !this.pattern && !this.isCompositing
|
|
486
|
+
: true;
|
|
487
|
+
const placeholder = showPlaceholder ? (h("div", { class: `${clsPrefix}-base-selection-placeholder ${clsPrefix}-base-selection-overlay` }, this.placeholder)) : null;
|
|
479
488
|
if (filterable) {
|
|
480
489
|
const popoverTrigger = (h("div", { ref: "patternInputWrapperRef", class: `${clsPrefix}-base-selection-tags` },
|
|
481
490
|
tags,
|
|
@@ -502,13 +511,12 @@ export default defineComponent({
|
|
|
502
511
|
}
|
|
503
512
|
else {
|
|
504
513
|
if (filterable) {
|
|
505
|
-
const
|
|
506
|
-
|
|
507
|
-
|
|
514
|
+
const hasInput = this.pattern || this.isCompositing;
|
|
515
|
+
const showPlaceholder = this.active ? !hasInput : !this.selected;
|
|
516
|
+
const showSelectedLabel = this.active ? false : this.selected;
|
|
508
517
|
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" },
|
|
518
|
+
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 })),
|
|
519
|
+
showSelectedLabel ? (h("div", { class: `${clsPrefix}-base-selection-label__render-label ${clsPrefix}-base-selection-overlay`, key: "input" },
|
|
512
520
|
h("div", { class: `${clsPrefix}-base-selection-overlay__wrapper` }, renderTag
|
|
513
521
|
? renderTag({
|
|
514
522
|
option: this.selectedOption,
|
|
@@ -516,7 +524,7 @@ export default defineComponent({
|
|
|
516
524
|
})
|
|
517
525
|
: renderLabel
|
|
518
526
|
? renderLabel(this.selectedOption, true)
|
|
519
|
-
: render(this.label, this.selectedOption, true)))),
|
|
527
|
+
: render(this.label, this.selectedOption, true)))) : null,
|
|
520
528
|
showPlaceholder ? (h("div", { class: `${clsPrefix}-base-selection-placeholder ${clsPrefix}-base-selection-overlay`, key: "placeholder" },
|
|
521
529
|
h("div", { class: `${clsPrefix}-base-selection-overlay__wrapper` }, this.filterablePlaceholder))) : null,
|
|
522
530
|
suffix));
|
|
@@ -537,6 +545,7 @@ export default defineComponent({
|
|
|
537
545
|
}
|
|
538
546
|
return (h("div", { ref: "selfRef", class: [
|
|
539
547
|
`${clsPrefix}-base-selection`,
|
|
548
|
+
status && `${clsPrefix}-base-selection--${status}-status`,
|
|
540
549
|
{
|
|
541
550
|
[`${clsPrefix}-base-selection--active`]: this.active,
|
|
542
551
|
[`${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
|
+
`)])])]);
|
|
@@ -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/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,4 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
|
-
export declare function useCssVarsClass(
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
export declare function useCssVarsClass(componentName: string, hashRef: Ref<string> | undefined, cssVarsRef: ComputedRef<Record<string, string>> | undefined, props: {
|
|
3
|
+
themeOverrides?: unknown;
|
|
4
|
+
}): Ref<string>;
|
|
@@ -1,22 +1,37 @@
|
|
|
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 { configProviderInjectionKey } from '../config-provider/src/context';
|
|
4
|
+
import { throwError } from '../_utils';
|
|
3
5
|
import { c } from '../_utils/cssr';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
export function useCssVarsClass(componentName, hashRef, cssVarsRef, props) {
|
|
7
|
+
var _a;
|
|
8
|
+
if (!cssVarsRef)
|
|
9
|
+
throwError('useCssVarsClass', 'cssVarsRef is not passed');
|
|
10
|
+
const mergedThemeHashRef = (_a = inject(configProviderInjectionKey, null)) === null || _a === void 0 ? void 0 : _a.mergedThemeHashRef;
|
|
6
11
|
const cssVarsClassRef = ref('');
|
|
7
|
-
|
|
8
|
-
// window.xxx -= performance.now()
|
|
12
|
+
const mountStyle = () => {
|
|
9
13
|
const cssVars = cssVarsRef.value;
|
|
10
14
|
let style = '';
|
|
11
15
|
for (const key in cssVars) {
|
|
12
16
|
style += `${key}: ${cssVars[key]};`;
|
|
13
17
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
let finalThemeHash = componentName;
|
|
19
|
+
const hashValue = hashRef ? hashRef.value : undefined;
|
|
20
|
+
const themeHash = mergedThemeHashRef === null || mergedThemeHashRef === void 0 ? void 0 : mergedThemeHashRef.value;
|
|
21
|
+
if (themeHash)
|
|
22
|
+
finalThemeHash += '-' + themeHash;
|
|
23
|
+
if (hashValue)
|
|
24
|
+
finalThemeHash += '-' + hashValue;
|
|
25
|
+
if (props.themeOverrides) {
|
|
26
|
+
finalThemeHash += '-' + hash(JSON.stringify(props.themeOverrides));
|
|
27
|
+
}
|
|
28
|
+
cssVarsClassRef.value = finalThemeHash;
|
|
29
|
+
c(`.${finalThemeHash}`, style).mount({
|
|
30
|
+
id: finalThemeHash
|
|
18
31
|
});
|
|
19
|
-
|
|
32
|
+
};
|
|
33
|
+
watchEffect(() => {
|
|
34
|
+
mountStyle();
|
|
20
35
|
});
|
|
21
36
|
return cssVarsClassRef;
|
|
22
37
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { FormValidationStatus } from '../form/src/interface';
|
|
2
3
|
declare type FormItemSize = 'small' | 'medium' | 'large';
|
|
3
4
|
declare type AllowedSize = 'tiny' | 'small' | 'medium' | 'large' | 'huge' | number;
|
|
4
5
|
export interface FormItemInjection {
|
|
5
6
|
path: Ref<string | undefined>;
|
|
6
7
|
disabled: Ref<boolean>;
|
|
7
8
|
mergedSize: ComputedRef<FormItemSize>;
|
|
9
|
+
mergedValidationStatus: ComputedRef<FormValidationStatus | undefined>;
|
|
8
10
|
restoreValidation: () => void;
|
|
9
11
|
handleContentBlur: () => void;
|
|
10
12
|
handleContentFocus: () => void;
|
|
@@ -20,10 +22,12 @@ interface UseFormItemOptions<T> {
|
|
|
20
22
|
interface UseFormItemProps<T> {
|
|
21
23
|
size?: T;
|
|
22
24
|
disabled?: boolean;
|
|
25
|
+
status?: FormValidationStatus;
|
|
23
26
|
}
|
|
24
27
|
export interface UseFormItem<T> {
|
|
25
28
|
mergedSizeRef: ComputedRef<T>;
|
|
26
29
|
mergedDisabledRef: ComputedRef<boolean>;
|
|
30
|
+
mergedStatusRef: ComputedRef<FormValidationStatus | undefined>;
|
|
27
31
|
nTriggerFormBlur: () => void;
|
|
28
32
|
nTriggerFormChange: () => void;
|
|
29
33
|
nTriggerFormFocus: () => void;
|