naive-ui 2.35.0 → 2.36.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/README.md +2 -0
- package/README.zh-CN.md +1 -0
- package/dist/index.js +2433 -667
- package/dist/index.prod.js +2 -2
- package/es/_internal/fade-in-expand-transition/src/FadeInExpandTransition.js +1 -0
- package/es/_internal/scrollbar/src/Scrollbar.js +11 -6
- package/es/_internal/select-menu/src/SelectMenu.d.ts +3 -3
- package/es/_internal/select-menu/src/SelectMenu.js +1 -0
- package/es/_internal/select-menu/src/styles/index.cssr.js +8 -0
- package/es/_internal/selection/src/Selection.d.ts +3 -1
- package/es/_internal/selection/src/Selection.js +4 -2
- package/es/_styles/common/_common.js +1 -1
- package/es/_styles/common/light.js +2 -2
- package/es/_utils/composable/use-collection.d.ts +1 -1
- package/es/_utils/composable/use-collection.js +2 -0
- package/es/_utils/css/color-to-class.js +1 -1
- package/es/affix/src/Affix.d.ts +2 -2
- package/es/affix/src/Affix.js +4 -2
- package/es/alert/src/Alert.js +3 -1
- package/es/anchor/src/AnchorAdapter.d.ts +1 -1
- package/es/auto-complete/src/AutoComplete.d.ts +1 -1
- package/es/button/src/Button.d.ts +1 -1
- package/es/button/src/Button.js +1 -1
- package/es/card/src/Card.d.ts +17 -1
- package/es/card/src/Card.js +12 -5
- package/es/carousel/src/Carousel.d.ts +5 -5
- package/es/carousel/src/Carousel.js +2 -1
- package/es/checkbox/src/Checkbox.d.ts +6 -6
- package/es/color-picker/src/ColorPickerSwatches.js +4 -3
- package/es/components.d.ts +3 -0
- package/es/components.js +3 -0
- package/es/config-provider/src/config.js +5 -5
- package/es/config-provider/src/internal-interface.d.ts +4 -0
- package/es/data-table/src/DataTable.d.ts +3 -3
- package/es/data-table/src/DataTable.js +1 -0
- package/es/data-table/src/MainTable.js +1 -0
- package/es/data-table/src/TableParts/Body.d.ts +3 -3
- package/es/data-table/src/TableParts/Body.js +5 -3
- package/es/data-table/src/interface.d.ts +1 -1
- package/es/date-picker/src/panel/date.d.ts +2 -2
- package/es/date-picker/src/panel/daterange.d.ts +2 -2
- package/es/date-picker/src/panel/datetime.d.ts +2 -2
- package/es/date-picker/src/panel/datetimerange.d.ts +2 -2
- package/es/date-picker/src/panel/month.d.ts +2 -2
- package/es/date-picker/src/panel/monthrange.d.ts +2 -2
- package/es/date-picker/src/panel/panelHeader.d.ts +720 -773
- package/es/date-picker/src/panel/use-calendar.d.ts +2 -2
- package/es/date-picker/src/panel/use-calendar.js +2 -2
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +2 -2
- package/es/date-picker/src/panel/use-dual-calendar.js +4 -4
- package/es/date-picker/src/utils.js +1 -6
- package/es/date-picker/styles/_common.js +1 -1
- package/es/descriptions/src/Descriptions.d.ts +6 -0
- package/es/descriptions/src/Descriptions.js +22 -7
- package/es/descriptions/src/DescriptionsItem.d.ts +6 -0
- package/es/descriptions/src/DescriptionsItem.js +2 -0
- package/es/dialog/src/Dialog.js +6 -2
- package/es/dialog/src/DialogEnvironment.d.ts +1 -1
- package/es/dialog/src/DialogProvider.d.ts +3 -3
- package/es/dialog/src/dialogProps.d.ts +1 -1
- package/es/dropdown/src/Dropdown.d.ts +18 -0
- package/es/dropdown/src/Dropdown.js +1 -1
- package/es/dropdown/src/DropdownMenu.js +4 -1
- package/es/dropdown/src/DropdownOption.d.ts +5 -4
- package/es/dropdown/src/DropdownOption.js +2 -4
- package/es/dynamic-input/src/DynamicInput.d.ts +3 -0
- package/es/dynamic-input/src/DynamicInput.js +3 -3
- package/es/dynamic-tags/src/DynamicTags.d.ts +6 -0
- package/es/dynamic-tags/src/DynamicTags.js +4 -4
- package/es/equation/index.d.ts +1 -0
- package/es/equation/src/Equation.d.ts +2 -0
- package/es/form/src/FormItem.d.ts +1 -1
- package/es/form/src/utils.d.ts +1 -1
- package/es/input/src/Input.d.ts +4 -4
- package/es/input/src/styles/input.cssr.js +1 -1
- package/es/layout/src/Layout.d.ts +6 -0
- package/es/layout/src/Layout.js +8 -1
- package/es/layout/src/LayoutContent.d.ts +2 -0
- package/es/layout/src/LayoutSider.d.ts +9 -0
- package/es/layout/src/LayoutSider.js +12 -3
- package/es/legacy-grid/src/styles/index.cssr.js +2 -3
- package/es/legacy-grid/src/styles/rtl.cssr.js +2 -3
- package/es/loading-bar/src/LoadingBar.d.ts +2 -0
- package/es/loading-bar/src/LoadingBar.js +3 -1
- package/es/loading-bar/src/LoadingBarProvider.d.ts +3 -0
- package/es/loading-bar/src/LoadingBarProvider.js +2 -2
- package/es/locales/common/frFR.js +1 -1
- package/es/log/src/Log.d.ts +3 -3
- package/es/mention/src/Mention.d.ts +1 -1
- package/es/mention/src/utils.js +4 -4
- package/es/menu/src/Menu.d.ts +30 -13
- package/es/menu/src/Menu.js +101 -7
- package/es/menu/src/MenuOptionContent.d.ts +3 -0
- package/es/menu/src/MenuOptionContent.js +7 -2
- package/es/menu/src/Submenu.d.ts +23 -12
- package/es/menu/src/Submenu.js +9 -8
- package/es/menu/src/interface.d.ts +1 -0
- package/es/menu/src/styles/index.cssr.js +8 -4
- package/es/menu/src/use-menu-child.js +5 -5
- package/es/message/src/Message.d.ts +1 -1
- package/es/message/src/MessageProvider.d.ts +7 -4
- package/es/message/src/MessageProvider.js +3 -2
- package/es/modal/src/BodyWrapper.d.ts +12 -4
- package/es/modal/src/Modal.d.ts +16 -4
- package/es/modal/src/presetProps.d.ts +5 -1
- package/es/notification/src/NotificationEnvironment.js +1 -1
- package/es/notification/src/NotificationProvider.d.ts +3 -0
- package/es/notification/src/NotificationProvider.js +2 -2
- package/es/popconfirm/src/Popconfirm.d.ts +18 -0
- package/es/popover/src/Popover.d.ts +24 -0
- package/es/popover/src/Popover.js +7 -0
- package/es/popover/src/PopoverBody.d.ts +22 -1
- package/es/popover/src/PopoverBody.js +26 -10
- package/es/popover/src/interface.d.ts +1 -1
- package/es/popselect/src/Popselect.d.ts +18 -0
- package/es/popselect/src/Popselect.js +2 -1
- package/es/popselect/src/PopselectPanel.js +1 -0
- package/es/progress/src/Progress.d.ts +1 -1
- package/es/qr-code/index.d.ts +2 -0
- package/es/qr-code/index.js +1 -0
- package/es/qr-code/src/QrCode.d.ts +154 -0
- package/es/qr-code/src/QrCode.js +146 -0
- package/es/qr-code/src/qrcodegen.d.ts +94 -0
- package/es/qr-code/src/qrcodegen.js +948 -0
- package/es/qr-code/src/styles/index.cssr.d.ts +2 -0
- package/es/qr-code/src/styles/index.cssr.js +8 -0
- package/es/qr-code/styles/dark.d.ts +3 -0
- package/es/qr-code/styles/dark.js +11 -0
- package/es/qr-code/styles/index.d.ts +3 -0
- package/es/qr-code/styles/index.js +2 -0
- package/es/qr-code/styles/light.d.ts +9 -0
- package/es/qr-code/styles/light.js +12 -0
- package/es/radio/src/RadioGroup.d.ts +1 -0
- package/es/radio/src/RadioGroup.js +2 -1
- package/es/radio/src/styles/radio-group.cssr.js +1 -0
- package/es/result/src/Result.d.ts +1 -1
- package/es/scrollbar/src/Scrollbar.js +2 -0
- package/es/select/src/Select.d.ts +1 -1
- package/es/skeleton/src/Skeleton.js +4 -7
- package/es/slider/src/Slider.d.ts +6 -0
- package/es/slider/src/Slider.js +10 -3
- package/es/slider/src/utils.d.ts +2 -2
- package/es/slider/src/utils.js +4 -4
- package/es/space/src/Space.d.ts +3 -0
- package/es/space/src/Space.js +3 -3
- package/es/spin/src/Spin.d.ts +7 -1
- package/es/spin/src/Spin.js +4 -3
- package/es/split/index.d.ts +2 -0
- package/es/split/index.js +1 -0
- package/es/split/src/Split.d.ts +135 -0
- package/es/split/src/Split.js +145 -0
- package/es/split/src/styles/index.cssr.d.ts +2 -0
- package/es/split/src/styles/index.cssr.js +25 -0
- package/es/split/styles/dark.d.ts +3 -0
- package/es/split/styles/dark.js +6 -0
- package/es/split/styles/index.d.ts +3 -0
- package/es/split/styles/index.js +2 -0
- package/es/split/styles/light.d.ts +9 -0
- package/es/split/styles/light.js +13 -0
- package/es/steps/src/Steps.d.ts +1 -1
- package/es/tabs/src/Tab.js +3 -1
- package/es/tabs/src/Tabs.d.ts +6 -6
- package/es/tabs/src/Tabs.js +2 -2
- package/es/tabs/src/styles/index.cssr.js +12 -2
- package/es/theme-editor/src/ThemeEditor.d.ts +2 -2
- package/es/themes/dark.js +5 -1
- package/es/themes/light.js +5 -1
- package/es/thing/src/Thing.d.ts +6 -0
- package/es/thing/src/Thing.js +13 -4
- package/es/tooltip/src/Tooltip.d.ts +18 -0
- package/es/tree/index.d.ts +1 -0
- package/es/tree/index.js +1 -0
- package/es/tree/src/Tree.d.ts +11 -0
- package/es/tree/src/Tree.js +6 -3
- package/es/tree/src/TreeNode.js +30 -19
- package/es/tree/src/TreeNodeCheckbox.d.ts +1 -0
- package/es/tree/src/TreeNodeSwitcher.d.ts +1 -1
- package/es/tree/src/styles/index.cssr.js +4 -3
- package/es/tree/src/utils.d.ts +1 -0
- package/es/tree/src/utils.js +12 -0
- package/es/tree/styles/light.d.ts +2 -0
- package/es/tree/styles/light.js +3 -2
- package/es/tree-select/src/TreeSelect.d.ts +17 -10
- package/es/tree-select/src/TreeSelect.js +2 -2
- package/es/tree-select/styles/light.d.ts +1 -0
- package/es/upload/src/Upload.d.ts +6 -0
- package/es/upload/src/Upload.js +8 -3
- package/es/upload/src/UploadFileList.js +3 -2
- package/es/upload/src/UploadTrigger.js +3 -2
- package/es/upload/src/interface.d.ts +2 -0
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/es/virtual-list/index.d.ts +2 -0
- package/es/virtual-list/index.js +1 -0
- package/es/virtual-list/src/VirtualList.d.ts +146 -0
- package/es/virtual-list/src/VirtualList.js +102 -0
- package/es/watermark/src/Watermark.js +7 -0
- package/lib/_internal/fade-in-expand-transition/src/FadeInExpandTransition.js +1 -0
- package/lib/_internal/scrollbar/src/Scrollbar.js +11 -6
- package/lib/_internal/select-menu/src/SelectMenu.d.ts +3 -3
- package/lib/_internal/select-menu/src/SelectMenu.js +1 -0
- package/lib/_internal/select-menu/src/styles/index.cssr.js +8 -0
- package/lib/_internal/selection/src/Selection.d.ts +3 -1
- package/lib/_internal/selection/src/Selection.js +4 -2
- package/lib/_styles/common/_common.js +1 -1
- package/lib/_styles/common/light.js +2 -2
- package/lib/_utils/composable/use-collection.d.ts +1 -1
- package/lib/_utils/composable/use-collection.js +2 -0
- package/lib/_utils/css/color-to-class.js +1 -1
- package/lib/affix/src/Affix.d.ts +2 -2
- package/lib/affix/src/Affix.js +4 -2
- package/lib/alert/src/Alert.js +3 -1
- package/lib/anchor/src/AnchorAdapter.d.ts +1 -1
- package/lib/auto-complete/src/AutoComplete.d.ts +1 -1
- package/lib/button/src/Button.d.ts +1 -1
- package/lib/button/src/Button.js +1 -1
- package/lib/card/src/Card.d.ts +17 -1
- package/lib/card/src/Card.js +12 -5
- package/lib/carousel/src/Carousel.d.ts +5 -5
- package/lib/carousel/src/Carousel.js +2 -1
- package/lib/checkbox/src/Checkbox.d.ts +6 -6
- package/lib/color-picker/src/ColorPickerSwatches.js +4 -3
- package/lib/components.d.ts +3 -0
- package/lib/components.js +3 -0
- package/lib/config-provider/src/config.js +5 -5
- package/lib/config-provider/src/internal-interface.d.ts +4 -0
- package/lib/data-table/src/DataTable.d.ts +3 -3
- package/lib/data-table/src/DataTable.js +1 -0
- package/lib/data-table/src/MainTable.js +1 -0
- package/lib/data-table/src/TableParts/Body.d.ts +3 -3
- package/lib/data-table/src/TableParts/Body.js +5 -3
- package/lib/data-table/src/interface.d.ts +1 -1
- package/lib/date-picker/src/panel/date.d.ts +2 -2
- package/lib/date-picker/src/panel/daterange.d.ts +2 -2
- package/lib/date-picker/src/panel/datetime.d.ts +2 -2
- package/lib/date-picker/src/panel/datetimerange.d.ts +2 -2
- package/lib/date-picker/src/panel/month.d.ts +2 -2
- package/lib/date-picker/src/panel/monthrange.d.ts +2 -2
- package/lib/date-picker/src/panel/panelHeader.d.ts +720 -773
- package/lib/date-picker/src/panel/use-calendar.d.ts +2 -2
- package/lib/date-picker/src/panel/use-calendar.js +2 -2
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +2 -2
- package/lib/date-picker/src/panel/use-dual-calendar.js +4 -4
- package/lib/date-picker/src/utils.js +1 -6
- package/lib/date-picker/styles/_common.js +1 -1
- package/lib/descriptions/src/Descriptions.d.ts +6 -0
- package/lib/descriptions/src/Descriptions.js +22 -7
- package/lib/descriptions/src/DescriptionsItem.d.ts +6 -0
- package/lib/descriptions/src/DescriptionsItem.js +2 -0
- package/lib/dialog/src/Dialog.js +6 -2
- package/lib/dialog/src/DialogEnvironment.d.ts +1 -1
- package/lib/dialog/src/DialogProvider.d.ts +3 -3
- package/lib/dialog/src/dialogProps.d.ts +1 -1
- package/lib/dropdown/src/Dropdown.d.ts +18 -0
- package/lib/dropdown/src/Dropdown.js +1 -1
- package/lib/dropdown/src/DropdownMenu.js +4 -1
- package/lib/dropdown/src/DropdownOption.d.ts +5 -4
- package/lib/dropdown/src/DropdownOption.js +2 -4
- package/lib/dynamic-input/src/DynamicInput.d.ts +3 -0
- package/lib/dynamic-input/src/DynamicInput.js +3 -3
- package/lib/dynamic-tags/src/DynamicTags.d.ts +6 -0
- package/lib/dynamic-tags/src/DynamicTags.js +4 -4
- package/lib/equation/index.d.ts +1 -0
- package/lib/equation/src/Equation.d.ts +2 -0
- package/lib/form/src/FormItem.d.ts +1 -1
- package/lib/form/src/utils.d.ts +1 -1
- package/lib/input/src/Input.d.ts +4 -4
- package/lib/input/src/styles/input.cssr.js +1 -1
- package/lib/layout/src/Layout.d.ts +6 -0
- package/lib/layout/src/Layout.js +8 -1
- package/lib/layout/src/LayoutContent.d.ts +2 -0
- package/lib/layout/src/LayoutSider.d.ts +9 -0
- package/lib/layout/src/LayoutSider.js +12 -3
- package/lib/legacy-grid/src/styles/index.cssr.js +2 -3
- package/lib/legacy-grid/src/styles/rtl.cssr.js +2 -3
- package/lib/loading-bar/src/LoadingBar.d.ts +2 -0
- package/lib/loading-bar/src/LoadingBar.js +3 -1
- package/lib/loading-bar/src/LoadingBarProvider.d.ts +3 -0
- package/lib/loading-bar/src/LoadingBarProvider.js +2 -2
- package/lib/locales/common/frFR.js +1 -1
- package/lib/log/src/Log.d.ts +3 -3
- package/lib/mention/src/Mention.d.ts +1 -1
- package/lib/mention/src/utils.js +4 -4
- package/lib/menu/src/Menu.d.ts +30 -13
- package/lib/menu/src/Menu.js +101 -7
- package/lib/menu/src/MenuOptionContent.d.ts +3 -0
- package/lib/menu/src/MenuOptionContent.js +7 -2
- package/lib/menu/src/Submenu.d.ts +23 -12
- package/lib/menu/src/Submenu.js +9 -8
- package/lib/menu/src/interface.d.ts +1 -0
- package/lib/menu/src/styles/index.cssr.js +8 -4
- package/lib/menu/src/use-menu-child.js +5 -5
- package/lib/message/src/Message.d.ts +1 -1
- package/lib/message/src/MessageProvider.d.ts +7 -4
- package/lib/message/src/MessageProvider.js +3 -2
- package/lib/modal/src/BodyWrapper.d.ts +12 -4
- package/lib/modal/src/Modal.d.ts +16 -4
- package/lib/modal/src/presetProps.d.ts +5 -1
- package/lib/notification/src/NotificationEnvironment.js +1 -1
- package/lib/notification/src/NotificationProvider.d.ts +3 -0
- package/lib/notification/src/NotificationProvider.js +2 -2
- package/lib/popconfirm/src/Popconfirm.d.ts +18 -0
- package/lib/popover/src/Popover.d.ts +24 -0
- package/lib/popover/src/Popover.js +7 -0
- package/lib/popover/src/PopoverBody.d.ts +22 -1
- package/lib/popover/src/PopoverBody.js +26 -10
- package/lib/popover/src/interface.d.ts +1 -1
- package/lib/popselect/src/Popselect.d.ts +18 -0
- package/lib/popselect/src/Popselect.js +2 -1
- package/lib/popselect/src/PopselectPanel.js +1 -0
- package/lib/progress/src/Progress.d.ts +1 -1
- package/lib/qr-code/index.d.ts +2 -0
- package/lib/qr-code/index.js +9 -0
- package/lib/qr-code/src/QrCode.d.ts +154 -0
- package/lib/qr-code/src/QrCode.js +152 -0
- package/lib/qr-code/src/qrcodegen.d.ts +94 -0
- package/lib/qr-code/src/qrcodegen.js +949 -0
- package/lib/qr-code/src/styles/index.cssr.d.ts +2 -0
- package/lib/qr-code/src/styles/index.cssr.js +13 -0
- package/lib/qr-code/styles/dark.d.ts +3 -0
- package/lib/qr-code/styles/dark.js +13 -0
- package/lib/qr-code/styles/index.d.ts +3 -0
- package/lib/qr-code/styles/index.js +10 -0
- package/lib/qr-code/styles/light.d.ts +9 -0
- package/lib/qr-code/styles/light.js +14 -0
- package/lib/radio/src/RadioGroup.d.ts +1 -0
- package/lib/radio/src/RadioGroup.js +2 -1
- package/lib/radio/src/styles/radio-group.cssr.js +1 -0
- package/lib/result/src/Result.d.ts +1 -1
- package/lib/scrollbar/src/Scrollbar.js +2 -0
- package/lib/select/src/Select.d.ts +1 -1
- package/lib/skeleton/src/Skeleton.js +3 -6
- package/lib/slider/src/Slider.d.ts +6 -0
- package/lib/slider/src/Slider.js +10 -3
- package/lib/slider/src/utils.d.ts +2 -2
- package/lib/slider/src/utils.js +3 -3
- package/lib/space/src/Space.d.ts +3 -0
- package/lib/space/src/Space.js +3 -3
- package/lib/spin/src/Spin.d.ts +7 -1
- package/lib/spin/src/Spin.js +4 -3
- package/lib/split/index.d.ts +2 -0
- package/lib/split/index.js +9 -0
- package/lib/split/src/Split.d.ts +135 -0
- package/lib/split/src/Split.js +151 -0
- package/lib/split/src/styles/index.cssr.d.ts +2 -0
- package/lib/split/src/styles/index.cssr.js +30 -0
- package/lib/split/styles/dark.d.ts +3 -0
- package/lib/split/styles/dark.js +8 -0
- package/lib/split/styles/index.d.ts +3 -0
- package/lib/split/styles/index.js +10 -0
- package/lib/split/styles/light.d.ts +9 -0
- package/lib/split/styles/light.js +17 -0
- package/lib/steps/src/Steps.d.ts +1 -1
- package/lib/tabs/src/Tab.js +3 -1
- package/lib/tabs/src/Tabs.d.ts +6 -6
- package/lib/tabs/src/Tabs.js +2 -2
- package/lib/tabs/src/styles/index.cssr.js +12 -2
- package/lib/theme-editor/src/ThemeEditor.d.ts +2 -2
- package/lib/themes/dark.js +56 -52
- package/lib/themes/light.js +56 -52
- package/lib/thing/src/Thing.d.ts +6 -0
- package/lib/thing/src/Thing.js +13 -4
- package/lib/tooltip/src/Tooltip.d.ts +18 -0
- package/lib/tree/index.d.ts +1 -0
- package/lib/tree/index.js +3 -1
- package/lib/tree/src/Tree.d.ts +11 -0
- package/lib/tree/src/Tree.js +6 -3
- package/lib/tree/src/TreeNode.js +30 -19
- package/lib/tree/src/TreeNodeCheckbox.d.ts +1 -0
- package/lib/tree/src/TreeNodeSwitcher.d.ts +1 -1
- package/lib/tree/src/styles/index.cssr.js +4 -3
- package/lib/tree/src/utils.d.ts +1 -0
- package/lib/tree/src/utils.js +14 -1
- package/lib/tree/styles/light.d.ts +2 -0
- package/lib/tree/styles/light.js +3 -2
- package/lib/tree-select/src/TreeSelect.d.ts +17 -10
- package/lib/tree-select/src/TreeSelect.js +2 -2
- package/lib/tree-select/styles/light.d.ts +1 -0
- package/lib/upload/src/Upload.d.ts +6 -0
- package/lib/upload/src/Upload.js +8 -3
- package/lib/upload/src/UploadFileList.js +3 -2
- package/lib/upload/src/UploadTrigger.js +3 -2
- package/lib/upload/src/interface.d.ts +2 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/virtual-list/index.d.ts +2 -0
- package/lib/virtual-list/index.js +9 -0
- package/lib/virtual-list/src/VirtualList.d.ts +146 -0
- package/lib/virtual-list/src/VirtualList.js +105 -0
- package/lib/watermark/src/Watermark.js +7 -0
- package/package.json +15 -15
- package/volar.d.ts +4 -0
- package/web-types.json +773 -18
package/lib/menu/src/Menu.js
CHANGED
|
@@ -7,6 +7,8 @@ exports.menuProps = void 0;
|
|
|
7
7
|
const vue_1 = require("vue");
|
|
8
8
|
const treemate_1 = require("treemate");
|
|
9
9
|
const vooks_1 = require("vooks");
|
|
10
|
+
const vueuc_1 = require("vueuc");
|
|
11
|
+
const seemly_1 = require("seemly");
|
|
10
12
|
const interface_1 = require("../../layout/src/interface");
|
|
11
13
|
const _mixins_1 = require("../../_mixins");
|
|
12
14
|
const _utils_1 = require("../../_utils");
|
|
@@ -14,6 +16,7 @@ const utils_1 = require("./utils");
|
|
|
14
16
|
const styles_1 = require("../styles");
|
|
15
17
|
const useCheckDeprecated_1 = require("./useCheckDeprecated");
|
|
16
18
|
const context_1 = require("./context");
|
|
19
|
+
const Submenu_1 = require("./Submenu");
|
|
17
20
|
const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
|
|
18
21
|
exports.menuProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { options: {
|
|
19
22
|
type: Array,
|
|
@@ -57,12 +60,12 @@ exports.menuProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), {
|
|
|
57
60
|
}, disabled: Boolean, show: {
|
|
58
61
|
type: Boolean,
|
|
59
62
|
default: true
|
|
60
|
-
}, inverted: Boolean, 'onUpdate:expandedKeys': [Function, Array], onUpdateExpandedKeys: [Function, Array], onUpdateValue: [Function, Array], 'onUpdate:value': [Function, Array], expandIcon: Function, renderIcon: Function, renderLabel: Function, renderExtra: Function, dropdownProps: Object, accordion: Boolean, nodeProps: Function,
|
|
61
|
-
// deprecated
|
|
62
|
-
items: Array, onOpenNamesChange: [Function, Array], onSelect: [Function, Array], onExpandedNamesChange: [Function, Array], expandedNames: Array, defaultExpandedNames: Array, dropdownPlacement: {
|
|
63
|
+
}, inverted: Boolean, 'onUpdate:expandedKeys': [Function, Array], onUpdateExpandedKeys: [Function, Array], onUpdateValue: [Function, Array], 'onUpdate:value': [Function, Array], expandIcon: Function, renderIcon: Function, renderLabel: Function, renderExtra: Function, dropdownProps: Object, accordion: Boolean, nodeProps: Function, dropdownPlacement: {
|
|
63
64
|
type: String,
|
|
64
65
|
default: 'bottom'
|
|
65
|
-
}
|
|
66
|
+
}, responsive: Boolean,
|
|
67
|
+
// deprecated
|
|
68
|
+
items: Array, onOpenNamesChange: [Function, Array], onSelect: [Function, Array], onExpandedNamesChange: [Function, Array], expandedNames: Array, defaultExpandedNames: Array });
|
|
66
69
|
exports.default = (0, vue_1.defineComponent)({
|
|
67
70
|
name: 'Menu',
|
|
68
71
|
props: exports.menuProps,
|
|
@@ -356,6 +359,76 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
356
359
|
const themeClassHandle = inlineThemeDisabled
|
|
357
360
|
? (0, _mixins_1.useThemeClass)('menu', (0, vue_1.computed)(() => (props.inverted ? 'a' : 'b')), cssVarsRef, props)
|
|
358
361
|
: undefined;
|
|
362
|
+
const ellipsisNodeId = (0, seemly_1.createId)();
|
|
363
|
+
const overflowRef = (0, vue_1.ref)(null);
|
|
364
|
+
const counterRef = (0, vue_1.ref)(null);
|
|
365
|
+
let isFirstResize = true;
|
|
366
|
+
const onResize = () => {
|
|
367
|
+
var _a;
|
|
368
|
+
if (isFirstResize) {
|
|
369
|
+
isFirstResize = false;
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
(_a = overflowRef.value) === null || _a === void 0 ? void 0 : _a.sync({
|
|
373
|
+
showAllItemsBeforeCalculate: true
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
function getCounter() {
|
|
378
|
+
return document.getElementById(ellipsisNodeId);
|
|
379
|
+
}
|
|
380
|
+
const ellipsisFromIndexRef = (0, vue_1.ref)(-1);
|
|
381
|
+
function onUpdateCount(count) {
|
|
382
|
+
ellipsisFromIndexRef.value = props.options.length - count;
|
|
383
|
+
}
|
|
384
|
+
function onUpdateOverflow(overflow) {
|
|
385
|
+
if (!overflow) {
|
|
386
|
+
ellipsisFromIndexRef.value = -1;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
const ellipsisOptionRef = (0, vue_1.computed)(() => {
|
|
390
|
+
const ellipsisFromIndex = ellipsisFromIndexRef.value;
|
|
391
|
+
const option = {
|
|
392
|
+
children: ellipsisFromIndex === -1 ? [] : props.options.slice(ellipsisFromIndex)
|
|
393
|
+
};
|
|
394
|
+
return option;
|
|
395
|
+
});
|
|
396
|
+
const ellipsisTreeMateRef = (0, vue_1.computed)(() => {
|
|
397
|
+
const { childrenField, disabledField, keyField } = props;
|
|
398
|
+
return (0, treemate_1.createTreeMate)([ellipsisOptionRef.value], {
|
|
399
|
+
getIgnored(node) {
|
|
400
|
+
return (0, utils_1.isIgnoredNode)(node);
|
|
401
|
+
},
|
|
402
|
+
getChildren(node) {
|
|
403
|
+
return node[childrenField];
|
|
404
|
+
},
|
|
405
|
+
getDisabled(node) {
|
|
406
|
+
return node[disabledField];
|
|
407
|
+
},
|
|
408
|
+
getKey(node) {
|
|
409
|
+
var _a;
|
|
410
|
+
return (_a = node[keyField]) !== null && _a !== void 0 ? _a : node.name;
|
|
411
|
+
}
|
|
412
|
+
});
|
|
413
|
+
});
|
|
414
|
+
const emptyTmNodeRef = (0, vue_1.computed)(() => {
|
|
415
|
+
return (0, treemate_1.createTreeMate)([
|
|
416
|
+
{}
|
|
417
|
+
]).treeNodes[0];
|
|
418
|
+
});
|
|
419
|
+
function renderCounter() {
|
|
420
|
+
var _a;
|
|
421
|
+
if (ellipsisFromIndexRef.value === -1) {
|
|
422
|
+
// Only a placeholder
|
|
423
|
+
return ((0, vue_1.h)(Submenu_1.NSubmenu, { root: true, level: 0, key: "__ellpisisGroupPlaceholder__", internalKey: "__ellpisisGroupPlaceholder__", title: "\u00B7\u00B7\u00B7", tmNode: emptyTmNodeRef.value, domId: ellipsisNodeId, isEllipsisPlaceholder: true }));
|
|
424
|
+
}
|
|
425
|
+
const tmNode = ellipsisTreeMateRef.value.treeNodes[0];
|
|
426
|
+
const activePath = activePathRef.value;
|
|
427
|
+
const childActive = !!((_a = tmNode.children) === null || _a === void 0 ? void 0 : _a.some((tmNode) => {
|
|
428
|
+
return activePath.includes(tmNode.key);
|
|
429
|
+
}));
|
|
430
|
+
return ((0, vue_1.h)(Submenu_1.NSubmenu, { level: 0, root: true, key: "__ellpisisGroup__", internalKey: "__ellpisisGroup__", title: "\u00B7\u00B7\u00B7", virtualChildActive: childActive, tmNode: tmNode, domId: ellipsisNodeId, rawNodes: tmNode.rawNode.children || [], tmNodes: tmNode.children || [], isEllipsisPlaceholder: true }));
|
|
431
|
+
}
|
|
359
432
|
return {
|
|
360
433
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
361
434
|
controlledExpandedKeys: controlledExpandedKeysRef,
|
|
@@ -369,18 +442,39 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
369
442
|
mergedCollapsed: mergedCollapsedRef,
|
|
370
443
|
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
371
444
|
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
445
|
+
overflowRef,
|
|
446
|
+
counterRef,
|
|
447
|
+
updateCounter: () => { },
|
|
448
|
+
onResize,
|
|
449
|
+
onUpdateOverflow,
|
|
450
|
+
onUpdateCount,
|
|
451
|
+
renderCounter,
|
|
452
|
+
getCounter,
|
|
372
453
|
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender,
|
|
373
|
-
showOption
|
|
454
|
+
showOption,
|
|
455
|
+
deriveResponsiveState: onResize
|
|
374
456
|
};
|
|
375
457
|
},
|
|
376
458
|
render() {
|
|
377
459
|
const { mergedClsPrefix, mode, themeClass, onRender } = this;
|
|
378
460
|
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
379
|
-
|
|
461
|
+
const renderMenuItemNodes = () => this.tmNodes.map((tmNode) => (0, utils_1.itemRenderer)(tmNode, this.$props));
|
|
462
|
+
const horizontal = mode === 'horizontal';
|
|
463
|
+
const finalResponsive = horizontal && this.responsive;
|
|
464
|
+
const renderMainNode = () => ((0, vue_1.h)("div", { role: mode === 'horizontal' ? 'menubar' : 'menu', class: [
|
|
380
465
|
`${mergedClsPrefix}-menu`,
|
|
381
466
|
themeClass,
|
|
382
467
|
`${mergedClsPrefix}-menu--${mode}`,
|
|
468
|
+
finalResponsive && `${mergedClsPrefix}-menu--responsive`,
|
|
383
469
|
this.mergedCollapsed && `${mergedClsPrefix}-menu--collapsed`
|
|
384
|
-
], style: this.cssVars },
|
|
470
|
+
], style: this.cssVars }, finalResponsive ? ((0, vue_1.h)(vueuc_1.VOverflow, { ref: "overflowRef", onUpdateOverflow: this.onUpdateOverflow, getCounter: this.getCounter, onUpdateCount: this.onUpdateCount, updateCounter: this.updateCounter, style: {
|
|
471
|
+
width: '100%',
|
|
472
|
+
display: 'flex',
|
|
473
|
+
overflow: 'hidden'
|
|
474
|
+
} }, {
|
|
475
|
+
default: renderMenuItemNodes,
|
|
476
|
+
counter: this.renderCounter
|
|
477
|
+
})) : (renderMenuItemNodes())));
|
|
478
|
+
return finalResponsive ? ((0, vue_1.h)(vueuc_1.VResizeObserver, { onResize: this.onResize }, { default: renderMainNode })) : (renderMainNode());
|
|
385
479
|
}
|
|
386
480
|
});
|
|
@@ -32,6 +32,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
32
32
|
type: PropType<TmNode>;
|
|
33
33
|
required: true;
|
|
34
34
|
};
|
|
35
|
+
isEllipsisPlaceholder: BooleanConstructor;
|
|
35
36
|
}, {
|
|
36
37
|
menuProps: import("./Menu").MenuSetupProps;
|
|
37
38
|
style: import("vue").ComputedRef<{
|
|
@@ -75,6 +76,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
75
76
|
type: PropType<TmNode>;
|
|
76
77
|
required: true;
|
|
77
78
|
};
|
|
79
|
+
isEllipsisPlaceholder: BooleanConstructor;
|
|
78
80
|
}>>, {
|
|
79
81
|
disabled: boolean;
|
|
80
82
|
selected: boolean;
|
|
@@ -82,5 +84,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
82
84
|
showArrow: boolean;
|
|
83
85
|
childActive: boolean;
|
|
84
86
|
collapsed: boolean;
|
|
87
|
+
isEllipsisPlaceholder: boolean;
|
|
85
88
|
}, {}>;
|
|
86
89
|
export default _default;
|
|
@@ -38,7 +38,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
38
38
|
tmNode: {
|
|
39
39
|
type: Object,
|
|
40
40
|
required: true
|
|
41
|
-
}
|
|
41
|
+
},
|
|
42
|
+
isEllipsisPlaceholder: Boolean
|
|
42
43
|
},
|
|
43
44
|
setup(props) {
|
|
44
45
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -78,7 +79,11 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
78
79
|
], style: this.style },
|
|
79
80
|
icon && ((0, vue_1.h)("div", { class: `${clsPrefix}-menu-item-content__icon`, style: this.iconStyle, role: "none" }, [icon])),
|
|
80
81
|
(0, vue_1.h)("div", { class: `${clsPrefix}-menu-item-content-header`, role: "none" },
|
|
81
|
-
|
|
82
|
+
this.isEllipsisPlaceholder
|
|
83
|
+
? this.title
|
|
84
|
+
: renderLabel
|
|
85
|
+
? renderLabel(tmNode.rawNode)
|
|
86
|
+
: (0, _utils_1.render)(this.title),
|
|
82
87
|
this.extra || renderExtra ? ((0, vue_1.h)("span", { class: `${clsPrefix}-menu-item-content-header__extra` },
|
|
83
88
|
' ',
|
|
84
89
|
renderExtra ? renderExtra(tmNode.rawNode) : (0, _utils_1.render)(this.extra))) : null),
|
|
@@ -13,12 +13,15 @@ export declare const submenuProps: {
|
|
|
13
13
|
readonly type: PropType<TmNode>;
|
|
14
14
|
readonly required: true;
|
|
15
15
|
};
|
|
16
|
-
readonly disabled:
|
|
17
|
-
readonly type: BooleanConstructor;
|
|
18
|
-
readonly default: false;
|
|
19
|
-
};
|
|
16
|
+
readonly disabled: BooleanConstructor;
|
|
20
17
|
readonly icon: PropType<() => VNodeChild>;
|
|
21
18
|
readonly onClick: PropType<() => void>;
|
|
19
|
+
readonly domId: StringConstructor;
|
|
20
|
+
readonly virtualChildActive: {
|
|
21
|
+
readonly type: BooleanConstructor;
|
|
22
|
+
readonly default: undefined;
|
|
23
|
+
};
|
|
24
|
+
readonly isEllipsisPlaceholder: BooleanConstructor;
|
|
22
25
|
readonly internalKey: {
|
|
23
26
|
readonly type: PropType<import("treemate").Key>;
|
|
24
27
|
readonly required: true;
|
|
@@ -45,12 +48,15 @@ export declare const NSubmenu: import("vue").DefineComponent<{
|
|
|
45
48
|
readonly type: PropType<TmNode>;
|
|
46
49
|
readonly required: true;
|
|
47
50
|
};
|
|
48
|
-
readonly disabled:
|
|
49
|
-
readonly type: BooleanConstructor;
|
|
50
|
-
readonly default: false;
|
|
51
|
-
};
|
|
51
|
+
readonly disabled: BooleanConstructor;
|
|
52
52
|
readonly icon: PropType<() => VNodeChild>;
|
|
53
53
|
readonly onClick: PropType<() => void>;
|
|
54
|
+
readonly domId: StringConstructor;
|
|
55
|
+
readonly virtualChildActive: {
|
|
56
|
+
readonly type: BooleanConstructor;
|
|
57
|
+
readonly default: undefined;
|
|
58
|
+
};
|
|
59
|
+
readonly isEllipsisPlaceholder: BooleanConstructor;
|
|
54
60
|
readonly internalKey: {
|
|
55
61
|
readonly type: PropType<import("treemate").Key>;
|
|
56
62
|
readonly required: true;
|
|
@@ -415,12 +421,15 @@ export declare const NSubmenu: import("vue").DefineComponent<{
|
|
|
415
421
|
readonly type: PropType<TmNode>;
|
|
416
422
|
readonly required: true;
|
|
417
423
|
};
|
|
418
|
-
readonly disabled:
|
|
419
|
-
readonly type: BooleanConstructor;
|
|
420
|
-
readonly default: false;
|
|
421
|
-
};
|
|
424
|
+
readonly disabled: BooleanConstructor;
|
|
422
425
|
readonly icon: PropType<() => VNodeChild>;
|
|
423
426
|
readonly onClick: PropType<() => void>;
|
|
427
|
+
readonly domId: StringConstructor;
|
|
428
|
+
readonly virtualChildActive: {
|
|
429
|
+
readonly type: BooleanConstructor;
|
|
430
|
+
readonly default: undefined;
|
|
431
|
+
};
|
|
432
|
+
readonly isEllipsisPlaceholder: BooleanConstructor;
|
|
424
433
|
readonly internalKey: {
|
|
425
434
|
readonly type: PropType<import("treemate").Key>;
|
|
426
435
|
readonly required: true;
|
|
@@ -438,5 +447,7 @@ export declare const NSubmenu: import("vue").DefineComponent<{
|
|
|
438
447
|
readonly disabled: boolean;
|
|
439
448
|
readonly isGroup: boolean;
|
|
440
449
|
readonly tmNodes: TmNode[];
|
|
450
|
+
readonly isEllipsisPlaceholder: boolean;
|
|
441
451
|
readonly rawNodes: MenuMixedOption[];
|
|
452
|
+
readonly virtualChildActive: boolean;
|
|
442
453
|
}, {}>;
|
package/lib/menu/src/Submenu.js
CHANGED
|
@@ -23,10 +23,10 @@ exports.submenuProps = Object.assign(Object.assign({}, use_menu_child_props_1.us
|
|
|
23
23
|
}, tmNode: {
|
|
24
24
|
type: Object,
|
|
25
25
|
required: true
|
|
26
|
-
}, disabled: {
|
|
26
|
+
}, disabled: Boolean, icon: Function, onClick: Function, domId: String, virtualChildActive: {
|
|
27
27
|
type: Boolean,
|
|
28
|
-
default:
|
|
29
|
-
},
|
|
28
|
+
default: undefined
|
|
29
|
+
}, isEllipsisPlaceholder: Boolean });
|
|
30
30
|
exports.NSubmenu = (0, vue_1.defineComponent)({
|
|
31
31
|
name: 'Submenu',
|
|
32
32
|
props: exports.submenuProps,
|
|
@@ -80,7 +80,8 @@ exports.NSubmenu = (0, vue_1.defineComponent)({
|
|
|
80
80
|
mergedDisabled: mergedDisabledRef,
|
|
81
81
|
mergedValue: NMenu.mergedValueRef,
|
|
82
82
|
childActive: (0, vooks_1.useMemo)(() => {
|
|
83
|
-
|
|
83
|
+
var _a;
|
|
84
|
+
return ((_a = props.virtualChildActive) !== null && _a !== void 0 ? _a : NMenu.activePathRef.value.includes(props.internalKey));
|
|
84
85
|
}),
|
|
85
86
|
collapsed: (0, vue_1.computed)(() => {
|
|
86
87
|
if (menuProps.mode === 'horizontal')
|
|
@@ -102,10 +103,10 @@ exports.NSubmenu = (0, vue_1.defineComponent)({
|
|
|
102
103
|
var _a;
|
|
103
104
|
const { mergedClsPrefix, menuProps: { renderIcon, renderLabel } } = this;
|
|
104
105
|
const createSubmenuItem = () => {
|
|
105
|
-
const { isHorizontal, paddingLeft, collapsed, mergedDisabled, maxIconSize, activeIconSize, title, childActive, icon, handleClick, menuProps: { nodeProps }, dropdownShow, iconMarginRight, tmNode, mergedClsPrefix } = this;
|
|
106
|
+
const { isHorizontal, paddingLeft, collapsed, mergedDisabled, maxIconSize, activeIconSize, title, childActive, icon, handleClick, menuProps: { nodeProps }, dropdownShow, iconMarginRight, tmNode, mergedClsPrefix, isEllipsisPlaceholder, extra } = this;
|
|
106
107
|
const attrs = nodeProps === null || nodeProps === void 0 ? void 0 : nodeProps(tmNode.rawNode);
|
|
107
108
|
return ((0, vue_1.h)("div", Object.assign({}, attrs, { class: [`${mergedClsPrefix}-menu-item`, attrs === null || attrs === void 0 ? void 0 : attrs.class], role: "menuitem" }),
|
|
108
|
-
(0, vue_1.h)(MenuOptionContent_1.default, { tmNode: tmNode, paddingLeft: paddingLeft, collapsed: collapsed, disabled: mergedDisabled, iconMarginRight: iconMarginRight, maxIconSize: maxIconSize, activeIconSize: activeIconSize, title: title, extra:
|
|
109
|
+
(0, vue_1.h)(MenuOptionContent_1.default, { tmNode: tmNode, paddingLeft: paddingLeft, collapsed: collapsed, disabled: mergedDisabled, iconMarginRight: iconMarginRight, maxIconSize: maxIconSize, activeIconSize: activeIconSize, title: title, extra: extra, showArrow: !isHorizontal, childActive: childActive, clsPrefix: mergedClsPrefix, icon: icon, hover: dropdownShow, onClick: handleClick, isEllipsisPlaceholder: isEllipsisPlaceholder })));
|
|
109
110
|
};
|
|
110
111
|
const createSubmenuChildren = () => {
|
|
111
112
|
return ((0, vue_1.h)(_internal_1.NFadeInExpandTransition, null, {
|
|
@@ -119,10 +120,10 @@ exports.NSubmenu = (0, vue_1.defineComponent)({
|
|
|
119
120
|
fontSizeLarge: '14px',
|
|
120
121
|
optionIconSizeLarge: '18px'
|
|
121
122
|
}, value: this.mergedValue, disabled: !this.dropdownEnabled, placement: this.dropdownPlacement, keyField: this.menuProps.keyField, labelField: this.menuProps.labelField, childrenField: this.menuProps.childrenField, onUpdateShow: this.handlePopoverShowChange, options: this.rawNodes, onSelect: this.doSelect, inverted: this.inverted, renderIcon: renderIcon, renderLabel: renderLabel }), {
|
|
122
|
-
default: () => ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-submenu`, role: "menuitem", "aria-expanded": !this.collapsed },
|
|
123
|
+
default: () => ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-submenu`, role: "menuitem", "aria-expanded": !this.collapsed, id: this.domId },
|
|
123
124
|
createSubmenuItem(),
|
|
124
125
|
this.isHorizontal ? null : createSubmenuChildren()))
|
|
125
|
-
})) : ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-submenu`, role: "menuitem", "aria-expanded": !this.collapsed },
|
|
126
|
+
})) : ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-submenu`, role: "menuitem", "aria-expanded": !this.collapsed, id: this.domId },
|
|
126
127
|
createSubmenuItem(),
|
|
127
128
|
createSubmenuChildren()));
|
|
128
129
|
}
|
|
@@ -55,4 +55,5 @@ export type OnUpdateKeysImpl = (keys: string[] | number[] | Array<string | numbe
|
|
|
55
55
|
export type MenuNodeProps = (option: MenuOption | MenuGroupOption) => HTMLAttributes & Record<string, string | number | undefined>;
|
|
56
56
|
export interface MenuInst {
|
|
57
57
|
showOption: (key?: Key) => void;
|
|
58
|
+
deriveResponsiveState: () => void;
|
|
58
59
|
}
|
|
@@ -77,7 +77,10 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('menu', `
|
|
|
77
77
|
font-size: var(--n-font-size);
|
|
78
78
|
padding-bottom: 6px;
|
|
79
79
|
`, [(0, cssr_1.cM)('horizontal', `
|
|
80
|
-
|
|
80
|
+
max-width: 100%;
|
|
81
|
+
width: 100%;
|
|
82
|
+
display: flex;
|
|
83
|
+
overflow: hidden;
|
|
81
84
|
padding-bottom: 0;
|
|
82
85
|
`, [(0, cssr_1.cB)('submenu', 'margin: 0;'), (0, cssr_1.cB)('menu-item', 'margin: 0;'), (0, cssr_1.cB)('menu-item-content', `
|
|
83
86
|
padding: 0 20px;
|
|
@@ -98,7 +101,10 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('menu', `
|
|
|
98
101
|
color: var(--n-item-text-color-active-hover-horizontal);
|
|
99
102
|
`, [(0, cssr_1.c)('a', 'color: var(--n-item-text-color-active-hover-horizontal);'), (0, cssr_1.cE)('extra', 'color: var(--n-item-text-color-active-hover-horizontal);')])])]), (0, cssr_1.cM)('child-active', [hoverStyle(null, [(0, cssr_1.cE)('icon', 'color: var(--n-item-icon-color-child-active-hover-horizontal);'), (0, cssr_1.cB)('menu-item-content-header', `
|
|
100
103
|
color: var(--n-item-text-color-child-active-hover-horizontal);
|
|
101
|
-
`, [(0, cssr_1.c)('a', 'color: var(--n-item-text-color-child-active-hover-horizontal);'), (0, cssr_1.cE)('extra', 'color: var(--n-item-text-color-child-active-hover-horizontal);')])])]), hoverStyle('border-bottom: 2px solid var(--n-border-color-horizontal);', horizontalHoverStyleChildren)]), (0, cssr_1.cB)('menu-item-content-header', [(0, cssr_1.c)('a', 'color: var(--n-item-text-color-horizontal);')])])]), (0, cssr_1.
|
|
104
|
+
`, [(0, cssr_1.c)('a', 'color: var(--n-item-text-color-child-active-hover-horizontal);'), (0, cssr_1.cE)('extra', 'color: var(--n-item-text-color-child-active-hover-horizontal);')])])]), hoverStyle('border-bottom: 2px solid var(--n-border-color-horizontal);', horizontalHoverStyleChildren)]), (0, cssr_1.cB)('menu-item-content-header', [(0, cssr_1.c)('a', 'color: var(--n-item-text-color-horizontal);')])])]), (0, cssr_1.cNotM)('responsive', [(0, cssr_1.cB)('menu-item-content-header', `
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
text-overflow: ellipsis;
|
|
107
|
+
`)]), (0, cssr_1.cM)('collapsed', [(0, cssr_1.cB)('menu-item-content', [(0, cssr_1.cM)('selected', [(0, cssr_1.c)('&::before', `
|
|
102
108
|
background-color: var(--n-item-color-active-collapsed) !important;
|
|
103
109
|
`)]), (0, cssr_1.cB)('menu-item-content-header', 'opacity: 0;'), (0, cssr_1.cE)('arrow', 'opacity: 0;'), (0, cssr_1.cE)('icon', 'color: var(--n-item-icon-color-collapsed);')])]), (0, cssr_1.cB)('menu-item', `
|
|
104
110
|
height: var(--n-item-height);
|
|
@@ -178,8 +184,6 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('menu', `
|
|
|
178
184
|
opacity .3s var(--n-bezier);
|
|
179
185
|
opacity: 1;
|
|
180
186
|
white-space: nowrap;
|
|
181
|
-
overflow: hidden;
|
|
182
|
-
text-overflow: ellipsis;
|
|
183
187
|
color: var(--n-item-text-color);
|
|
184
188
|
`, [(0, cssr_1.c)('a', `
|
|
185
189
|
outline: none;
|
|
@@ -46,14 +46,14 @@ function useMenuChild(props) {
|
|
|
46
46
|
}
|
|
47
47
|
return mergedRootIndent;
|
|
48
48
|
}
|
|
49
|
-
if (NMenuOptionGroup
|
|
49
|
+
if (NMenuOptionGroup &&
|
|
50
|
+
typeof NMenuOptionGroup.paddingLeftRef.value === 'number') {
|
|
50
51
|
return indent / 2 + NMenuOptionGroup.paddingLeftRef.value;
|
|
51
52
|
}
|
|
52
|
-
if (NSubmenu) {
|
|
53
|
-
return (
|
|
54
|
-
NSubmenu.paddingLeftRef.value);
|
|
53
|
+
if (NSubmenu && typeof NSubmenu.paddingLeftRef.value === 'number') {
|
|
54
|
+
return (isGroup ? indent / 2 : indent) + NSubmenu.paddingLeftRef.value;
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return 0;
|
|
57
57
|
});
|
|
58
58
|
const iconMarginRightRef = (0, vue_1.computed)(() => {
|
|
59
59
|
const { collapsedWidth, indent, rootIndent } = menuProps;
|
|
@@ -52,7 +52,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
52
52
|
}> | undefined;
|
|
53
53
|
themeClass: import("vue").Ref<string> | undefined;
|
|
54
54
|
onRender: (() => void) | undefined;
|
|
55
|
-
placement: "
|
|
55
|
+
placement: "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
56
56
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
57
57
|
render: PropType<MessageRenderMessage>;
|
|
58
58
|
icon: PropType<() => VNodeChild>;
|
|
@@ -36,10 +36,11 @@ export declare const messageProviderProps: {
|
|
|
36
36
|
keepAliveOnHover: BooleanConstructor;
|
|
37
37
|
max: NumberConstructor;
|
|
38
38
|
placement: {
|
|
39
|
-
type: PropType<"
|
|
39
|
+
type: PropType<"top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
|
|
40
40
|
default: string;
|
|
41
41
|
};
|
|
42
42
|
closable: BooleanConstructor;
|
|
43
|
+
containerClass: StringConstructor;
|
|
43
44
|
containerStyle: PropType<string | CSSProperties>;
|
|
44
45
|
theme: PropType<import("../../_mixins").Theme<"Message", {
|
|
45
46
|
closeBorderRadius: string;
|
|
@@ -263,10 +264,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
263
264
|
keepAliveOnHover: BooleanConstructor;
|
|
264
265
|
max: NumberConstructor;
|
|
265
266
|
placement: {
|
|
266
|
-
type: PropType<"
|
|
267
|
+
type: PropType<"top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
|
|
267
268
|
default: string;
|
|
268
269
|
};
|
|
269
270
|
closable: BooleanConstructor;
|
|
271
|
+
containerClass: StringConstructor;
|
|
270
272
|
containerStyle: PropType<string | CSSProperties>;
|
|
271
273
|
theme: PropType<import("../../_mixins").Theme<"Message", {
|
|
272
274
|
closeBorderRadius: string;
|
|
@@ -503,10 +505,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
503
505
|
keepAliveOnHover: BooleanConstructor;
|
|
504
506
|
max: NumberConstructor;
|
|
505
507
|
placement: {
|
|
506
|
-
type: PropType<"
|
|
508
|
+
type: PropType<"top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
|
|
507
509
|
default: string;
|
|
508
510
|
};
|
|
509
511
|
closable: BooleanConstructor;
|
|
512
|
+
containerClass: StringConstructor;
|
|
510
513
|
containerStyle: PropType<string | CSSProperties>;
|
|
511
514
|
theme: PropType<import("../../_mixins").Theme<"Message", {
|
|
512
515
|
closeBorderRadius: string;
|
|
@@ -721,7 +724,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
721
724
|
}>>, {
|
|
722
725
|
duration: number;
|
|
723
726
|
closable: boolean;
|
|
724
|
-
placement: "
|
|
727
|
+
placement: "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
725
728
|
keepAliveOnHover: boolean;
|
|
726
729
|
}, {}>;
|
|
727
730
|
export default _default;
|
|
@@ -16,7 +16,7 @@ exports.messageProviderProps = Object.assign(Object.assign({}, _mixins_1.useThem
|
|
|
16
16
|
}, keepAliveOnHover: Boolean, max: Number, placement: {
|
|
17
17
|
type: String,
|
|
18
18
|
default: 'top'
|
|
19
|
-
}, closable: Boolean, containerStyle: [String, Object] });
|
|
19
|
+
}, closable: Boolean, containerClass: String, containerStyle: [String, Object] });
|
|
20
20
|
exports.default = (0, vue_1.defineComponent)({
|
|
21
21
|
name: 'MessageProvider',
|
|
22
22
|
props: exports.messageProviderProps,
|
|
@@ -88,7 +88,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
88
88
|
this.messageList.length ? ((0, vue_1.h)(vue_1.Teleport, { to: (_c = this.to) !== null && _c !== void 0 ? _c : 'body' },
|
|
89
89
|
(0, vue_1.h)("div", { class: [
|
|
90
90
|
`${this.mergedClsPrefix}-message-container`,
|
|
91
|
-
`${this.mergedClsPrefix}-message-container--${this.placement}
|
|
91
|
+
`${this.mergedClsPrefix}-message-container--${this.placement}`,
|
|
92
|
+
this.containerClass
|
|
92
93
|
], key: "message-container", style: this.containerStyle }, this.messageList.map((message) => {
|
|
93
94
|
return ((0, vue_1.h)(MessageEnvironment_1.default, Object.assign({ ref: ((inst) => {
|
|
94
95
|
if (inst) {
|
|
@@ -47,9 +47,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
47
47
|
loading: BooleanConstructor;
|
|
48
48
|
bordered: BooleanConstructor;
|
|
49
49
|
iconPlacement: PropType<import("../../dialog/src/interface").IconPlacement>;
|
|
50
|
+
contentClass: StringConstructor;
|
|
50
51
|
contentStyle: PropType<string | import("vue").CSSProperties>;
|
|
52
|
+
headerClass: StringConstructor;
|
|
51
53
|
headerStyle: PropType<string | import("vue").CSSProperties>;
|
|
54
|
+
headerExtraClass: StringConstructor;
|
|
52
55
|
headerExtraStyle: PropType<string | import("vue").CSSProperties>;
|
|
56
|
+
footerClass: StringConstructor;
|
|
53
57
|
footerStyle: PropType<string | import("vue").CSSProperties>;
|
|
54
58
|
embedded: BooleanConstructor;
|
|
55
59
|
segmented: {
|
|
@@ -70,7 +74,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
70
74
|
type: BooleanConstructor;
|
|
71
75
|
required: true;
|
|
72
76
|
};
|
|
73
|
-
preset: PropType<"
|
|
77
|
+
preset: PropType<"confirm" | "dialog" | "card">;
|
|
74
78
|
displayDirective: {
|
|
75
79
|
type: PropType<"show" | "if">;
|
|
76
80
|
required: true;
|
|
@@ -700,7 +704,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
700
704
|
appear: import("vue").Ref<boolean | undefined>;
|
|
701
705
|
isMounted: import("vue").Ref<boolean>;
|
|
702
706
|
mergedClsPrefix: import("vue").Ref<string>;
|
|
703
|
-
bodyRef: import("vue").Ref<
|
|
707
|
+
bodyRef: import("vue").Ref<HTMLElement | ComponentPublicInstance | null>;
|
|
704
708
|
scrollbarRef: import("vue").Ref<{
|
|
705
709
|
$el: HTMLElement;
|
|
706
710
|
containerRef: HTMLElement | null;
|
|
@@ -771,9 +775,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
771
775
|
loading: BooleanConstructor;
|
|
772
776
|
bordered: BooleanConstructor;
|
|
773
777
|
iconPlacement: PropType<import("../../dialog/src/interface").IconPlacement>;
|
|
778
|
+
contentClass: StringConstructor;
|
|
774
779
|
contentStyle: PropType<string | import("vue").CSSProperties>;
|
|
780
|
+
headerClass: StringConstructor;
|
|
775
781
|
headerStyle: PropType<string | import("vue").CSSProperties>;
|
|
782
|
+
headerExtraClass: StringConstructor;
|
|
776
783
|
headerExtraStyle: PropType<string | import("vue").CSSProperties>;
|
|
784
|
+
footerClass: StringConstructor;
|
|
777
785
|
footerStyle: PropType<string | import("vue").CSSProperties>;
|
|
778
786
|
embedded: BooleanConstructor;
|
|
779
787
|
segmented: {
|
|
@@ -794,7 +802,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
794
802
|
type: BooleanConstructor;
|
|
795
803
|
required: true;
|
|
796
804
|
};
|
|
797
|
-
preset: PropType<"
|
|
805
|
+
preset: PropType<"confirm" | "dialog" | "card">;
|
|
798
806
|
displayDirective: {
|
|
799
807
|
type: PropType<"show" | "if">;
|
|
800
808
|
required: true;
|
|
@@ -812,8 +820,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
812
820
|
type: "default" | "error" | "info" | "success" | "warning";
|
|
813
821
|
tag: keyof HTMLElementTagNameMap;
|
|
814
822
|
size: "small" | "medium" | "large" | "huge";
|
|
815
|
-
autoFocus: boolean;
|
|
816
823
|
loading: boolean;
|
|
824
|
+
autoFocus: boolean;
|
|
817
825
|
bordered: boolean;
|
|
818
826
|
showIcon: boolean;
|
|
819
827
|
closable: boolean;
|
package/lib/modal/src/Modal.d.ts
CHANGED
|
@@ -43,9 +43,13 @@ export declare const modalProps: {
|
|
|
43
43
|
loading: BooleanConstructor;
|
|
44
44
|
bordered: BooleanConstructor;
|
|
45
45
|
iconPlacement: PropType<import("../../dialog/src/interface").IconPlacement>;
|
|
46
|
+
contentClass: StringConstructor;
|
|
46
47
|
contentStyle: PropType<string | CSSProperties>;
|
|
48
|
+
headerClass: StringConstructor;
|
|
47
49
|
headerStyle: PropType<string | CSSProperties>;
|
|
50
|
+
headerExtraClass: StringConstructor;
|
|
48
51
|
headerExtraStyle: PropType<string | CSSProperties>;
|
|
52
|
+
footerClass: StringConstructor;
|
|
49
53
|
footerStyle: PropType<string | CSSProperties>;
|
|
50
54
|
embedded: BooleanConstructor;
|
|
51
55
|
segmented: {
|
|
@@ -71,7 +75,7 @@ export declare const modalProps: {
|
|
|
71
75
|
type: BooleanConstructor;
|
|
72
76
|
default: boolean;
|
|
73
77
|
};
|
|
74
|
-
preset: PropType<"
|
|
78
|
+
preset: PropType<"confirm" | "dialog" | "card">;
|
|
75
79
|
to: PropType<string | HTMLElement>;
|
|
76
80
|
displayDirective: {
|
|
77
81
|
type: PropType<"show" | "if">;
|
|
@@ -995,9 +999,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
995
999
|
loading: BooleanConstructor;
|
|
996
1000
|
bordered: BooleanConstructor;
|
|
997
1001
|
iconPlacement: PropType<import("../../dialog/src/interface").IconPlacement>;
|
|
1002
|
+
contentClass: StringConstructor;
|
|
998
1003
|
contentStyle: PropType<string | CSSProperties>;
|
|
1004
|
+
headerClass: StringConstructor;
|
|
999
1005
|
headerStyle: PropType<string | CSSProperties>;
|
|
1006
|
+
headerExtraClass: StringConstructor;
|
|
1000
1007
|
headerExtraStyle: PropType<string | CSSProperties>;
|
|
1008
|
+
footerClass: StringConstructor;
|
|
1001
1009
|
footerStyle: PropType<string | CSSProperties>;
|
|
1002
1010
|
embedded: BooleanConstructor;
|
|
1003
1011
|
segmented: {
|
|
@@ -1023,7 +1031,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1023
1031
|
type: BooleanConstructor;
|
|
1024
1032
|
default: boolean;
|
|
1025
1033
|
};
|
|
1026
|
-
preset: PropType<"
|
|
1034
|
+
preset: PropType<"confirm" | "dialog" | "card">;
|
|
1027
1035
|
to: PropType<string | HTMLElement>;
|
|
1028
1036
|
displayDirective: {
|
|
1029
1037
|
type: PropType<"show" | "if">;
|
|
@@ -1967,9 +1975,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1967
1975
|
loading: BooleanConstructor;
|
|
1968
1976
|
bordered: BooleanConstructor;
|
|
1969
1977
|
iconPlacement: PropType<import("../../dialog/src/interface").IconPlacement>;
|
|
1978
|
+
contentClass: StringConstructor;
|
|
1970
1979
|
contentStyle: PropType<string | CSSProperties>;
|
|
1980
|
+
headerClass: StringConstructor;
|
|
1971
1981
|
headerStyle: PropType<string | CSSProperties>;
|
|
1982
|
+
headerExtraClass: StringConstructor;
|
|
1972
1983
|
headerExtraStyle: PropType<string | CSSProperties>;
|
|
1984
|
+
footerClass: StringConstructor;
|
|
1973
1985
|
footerStyle: PropType<string | CSSProperties>;
|
|
1974
1986
|
embedded: BooleanConstructor;
|
|
1975
1987
|
segmented: {
|
|
@@ -1995,7 +2007,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1995
2007
|
type: BooleanConstructor;
|
|
1996
2008
|
default: boolean;
|
|
1997
2009
|
};
|
|
1998
|
-
preset: PropType<"
|
|
2010
|
+
preset: PropType<"confirm" | "dialog" | "card">;
|
|
1999
2011
|
to: PropType<string | HTMLElement>;
|
|
2000
2012
|
displayDirective: {
|
|
2001
2013
|
type: PropType<"show" | "if">;
|
|
@@ -2880,8 +2892,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2880
2892
|
size: "small" | "medium" | "large" | "huge";
|
|
2881
2893
|
show: boolean;
|
|
2882
2894
|
transformOrigin: "center" | "mouse";
|
|
2883
|
-
autoFocus: boolean;
|
|
2884
2895
|
loading: boolean;
|
|
2896
|
+
autoFocus: boolean;
|
|
2885
2897
|
bordered: boolean;
|
|
2886
2898
|
showIcon: boolean;
|
|
2887
2899
|
closable: boolean;
|
|
@@ -25,9 +25,13 @@ declare const presetProps: {
|
|
|
25
25
|
onPositiveClick: import("vue").PropType<(e: MouseEvent) => void>;
|
|
26
26
|
onNegativeClick: import("vue").PropType<(e: MouseEvent) => void>;
|
|
27
27
|
onClose: import("vue").PropType<() => void>;
|
|
28
|
+
contentClass: StringConstructor;
|
|
28
29
|
contentStyle: import("vue").PropType<string | import("vue").CSSProperties>;
|
|
30
|
+
headerClass: StringConstructor;
|
|
29
31
|
headerStyle: import("vue").PropType<string | import("vue").CSSProperties>;
|
|
32
|
+
headerExtraClass: StringConstructor;
|
|
30
33
|
headerExtraStyle: import("vue").PropType<string | import("vue").CSSProperties>;
|
|
34
|
+
footerClass: StringConstructor;
|
|
31
35
|
footerStyle: import("vue").PropType<string | import("vue").CSSProperties>;
|
|
32
36
|
embedded: BooleanConstructor;
|
|
33
37
|
segmented: {
|
|
@@ -45,5 +49,5 @@ declare const presetProps: {
|
|
|
45
49
|
readonly default: "div";
|
|
46
50
|
};
|
|
47
51
|
};
|
|
48
|
-
declare const presetPropsKeys: ("type" | "tag" | "content" | "size" | "icon" | "title" | "role" | "action" | "
|
|
52
|
+
declare const presetPropsKeys: ("type" | "tag" | "content" | "size" | "icon" | "title" | "role" | "action" | "loading" | "positiveText" | "negativeText" | "bordered" | "showIcon" | "closable" | "contentClass" | "contentStyle" | "onClose" | "headerClass" | "headerStyle" | "footerClass" | "footerStyle" | "iconPlacement" | "hoverable" | "embedded" | "headerExtraClass" | "headerExtraStyle" | "segmented" | "positiveButtonProps" | "negativeButtonProps" | "onPositiveClick" | "onNegativeClick")[];
|
|
49
53
|
export { presetProps, presetPropsKeys };
|
|
@@ -132,7 +132,7 @@ exports.NotificationEnvironment = (0, vue_1.defineComponent)({
|
|
|
132
132
|
},
|
|
133
133
|
render() {
|
|
134
134
|
return ((0, vue_1.h)(vue_1.Transition, { name: "notification-transition", appear: true,
|
|
135
|
-
// convert to any since Element is not
|
|
135
|
+
// convert to any since Element is not compatible with HTMLElement
|
|
136
136
|
onBeforeEnter: this.handleBeforeEnter, onAfterEnter: this.handleAfterEnter, onBeforeLeave: this.handleBeforeLeave, onLeave: this.handleLeave, onAfterLeave: this.handleAfterLeave }, {
|
|
137
137
|
default: () => {
|
|
138
138
|
return this.show ? ((0, vue_1.h)(Notification_1.Notification, Object.assign({}, (0, _utils_1.keep)(this.$props, Notification_1.notificationPropKeys), { onClose: this.handleClose, onMouseenter: this.duration && this.keepAliveOnHover
|