naive-ui 2.18.1 → 2.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/_internal/clear/src/Clear.d.ts +1 -4
- package/es/_internal/clear/src/Clear.js +1 -4
- package/es/_internal/icons/Checkmark.js +3 -2
- package/es/_internal/select-menu/src/SelectMenu.d.ts +173 -0
- package/es/_internal/select-menu/src/SelectMenu.js +9 -6
- package/es/_internal/select-menu/src/SelectOption.js +2 -1
- package/es/_internal/select-menu/src/styles/index.cssr.js +32 -28
- package/es/_internal/select-menu/styles/light.d.ts +2 -0
- package/es/_internal/select-menu/styles/light.js +1 -1
- package/es/_internal/selection/src/Selection.d.ts +64 -56
- package/es/_internal/selection/src/Selection.js +34 -14
- package/es/_internal/selection/src/styles/index.cssr.js +16 -14
- package/es/_internal/selection/styles/_common.d.ts +1 -8
- package/es/_internal/selection/styles/_common.js +2 -9
- package/es/_internal/selection/styles/dark.js +10 -2
- package/es/_internal/selection/styles/light.d.ts +18 -16
- package/es/_internal/selection/styles/light.js +10 -2
- package/es/_mixins/use-rtl.js +1 -1
- package/es/_styles/common/light.js +1 -1
- package/es/_utils/naive/mutable.d.ts +2 -2
- package/es/alert/src/Alert.js +15 -16
- package/es/anchor/src/AnchorAdapter.d.ts +13 -8
- package/es/anchor/src/AnchorAdapter.js +3 -5
- package/es/anchor/src/BaseAnchor.d.ts +14 -1
- package/es/anchor/src/BaseAnchor.js +20 -7
- package/es/anchor/src/Link.js +5 -5
- package/es/anchor/src/styles/index.cssr.js +25 -16
- package/es/auto-complete/index.d.ts +1 -0
- package/es/auto-complete/src/AutoComplete.d.ts +10 -0
- package/es/auto-complete/src/interface.d.ts +1 -1
- package/es/auto-complete/styles/light.d.ts +1 -0
- package/es/badge/src/styles/index.cssr.js +1 -0
- package/es/card/src/Card.d.ts +17 -1
- package/es/card/src/Card.js +3 -2
- package/es/card/styles/dark.js +6 -1
- package/es/card/styles/light.d.ts +1 -0
- package/es/card/styles/light.js +2 -2
- package/es/cascader/src/Cascader.d.ts +100 -80
- package/es/cascader/src/Cascader.js +28 -19
- package/es/cascader/src/CascaderMenu.js +17 -15
- package/es/cascader/src/CascaderOption.d.ts +10 -8
- package/es/cascader/src/CascaderSelectMenu.d.ts +10 -8
- package/es/cascader/src/CascaderSubmenu.d.ts +10 -8
- package/es/cascader/src/interface.d.ts +2 -2
- package/es/cascader/src/styles/index.cssr.js +6 -1
- package/es/cascader/styles/light.d.ts +10 -8
- package/es/checkbox/src/Checkbox.d.ts +1 -0
- package/es/checkbox/src/Checkbox.js +5 -3
- package/es/checkbox/src/CheckboxGroup.js +1 -1
- package/es/composables/use-theme-vars.js +5 -5
- package/es/config-provider/src/internal-interface.d.ts +2 -0
- package/es/data-table/src/DataTable.d.ts +110 -88
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +20 -16
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +20 -16
- package/es/data-table/src/TableParts/Body.d.ts +20 -16
- package/es/data-table/src/TableParts/Cell.d.ts +40 -32
- package/es/data-table/src/TableParts/Header.d.ts +20 -16
- package/es/data-table/styles/light.d.ts +10 -8
- package/es/date-picker/src/DatePicker.d.ts +8 -3
- package/es/date-picker/src/DatePicker.js +2 -2
- package/es/date-picker/src/panel/date.d.ts +3 -3
- package/es/date-picker/src/panel/date.js +10 -1
- package/es/date-picker/src/panel/daterange.js +10 -1
- package/es/date-picker/src/panel/datetimerange.js +10 -1
- package/es/descriptions/src/Descriptions.d.ts +4 -17
- package/es/descriptions/src/Descriptions.js +2 -8
- package/es/dialog/src/DialogProvider.d.ts +20 -20
- package/es/drawer/src/styles/index.cssr.js +2 -0
- package/es/dropdown/src/Dropdown.d.ts +9 -23
- package/es/dynamic-tags/src/DynamicTags.js +2 -1
- package/es/empty/src/Empty.d.ts +6 -1
- package/es/empty/src/Empty.js +16 -4
- package/es/form/src/FormItemGridItem.d.ts +1 -1
- package/es/form/src/FormItemGridItem.js +2 -2
- package/es/global-style/src/GlobalStyle.js +13 -3
- package/es/grid/src/GridItem.d.ts +2 -2
- package/es/grid/src/GridItem.js +1 -1
- package/es/input-number/src/InputNumber.d.ts +8 -3
- package/es/input-number/src/InputNumber.js +4 -4
- package/es/jest-setup.js +3 -1
- package/es/layout/src/Layout.d.ts +18 -4
- package/es/layout/src/LayoutContent.d.ts +9 -2
- package/es/layout/src/LayoutFooter.d.ts +9 -0
- package/es/layout/src/LayoutHeader.d.ts +6 -0
- package/es/layout/src/LayoutSider.d.ts +11 -0
- package/es/layout/src/LayoutSider.js +4 -2
- package/es/layout/src/ToggleButton.js +7 -3
- package/es/layout/src/styles/layout-sider.cssr.js +31 -15
- package/es/layout/styles/dark.js +3 -2
- package/es/layout/styles/light.d.ts +2 -0
- package/es/layout/styles/light.js +3 -2
- package/es/locales/common/enUS.js +1 -1
- package/es/locales/common/ruRU.js +1 -1
- package/es/locales/common/ukUA.d.ts +3 -0
- package/es/locales/common/ukUA.js +92 -0
- package/es/locales/common/zhCN.js +1 -1
- package/es/locales/date/ukUA.d.ts +3 -0
- package/es/locales/date/ukUA.js +6 -0
- package/es/locales/index.d.ts +2 -0
- package/es/locales/index.js +2 -0
- package/es/mention/src/Mention.d.ts +10 -0
- package/es/mention/styles/light.d.ts +1 -0
- package/es/menu/src/Menu.d.ts +6 -1
- package/es/menu/src/Menu.js +10 -1
- package/es/menu/src/MenuOption.d.ts +3 -1
- package/es/menu/src/MenuOptionContent.d.ts +3 -1
- package/es/menu/src/Submenu.d.ts +3 -1
- package/es/modal/src/BodyWrapper.d.ts +5 -0
- package/es/modal/src/Modal.d.ts +36 -55
- package/es/modal/src/Modal.js +18 -39
- package/es/modal/src/presetProps.d.ts +2 -1
- package/es/modal/styles/light.d.ts +1 -0
- package/es/notification/src/Notification.d.ts +1 -1
- package/es/notification/src/NotificationEnvironment.d.ts +1 -1
- package/es/notification/src/NotificationProvider.d.ts +16 -16
- package/es/page-header/src/PageHeader.d.ts +1 -0
- package/es/page-header/src/PageHeader.js +8 -2
- package/es/page-header/src/styles/rtl.cssr.d.ts +2 -0
- package/es/page-header/src/styles/rtl.cssr.js +19 -0
- package/es/page-header/styles/index.d.ts +1 -0
- package/es/page-header/styles/index.js +1 -0
- package/es/page-header/styles/rtl.d.ts +5 -0
- package/es/page-header/styles/rtl.js +5 -0
- package/es/pagination/src/Pagination.d.ts +111 -100
- package/es/pagination/styles/light.d.ts +10 -8
- package/es/popconfirm/src/Popconfirm.d.ts +8 -22
- package/es/popover/src/Popover.d.ts +12 -32
- package/es/popover/src/Popover.js +25 -18
- package/es/popover/src/PopoverBody.d.ts +2 -2
- package/es/popover/src/PopoverBody.js +4 -2
- package/es/popselect/src/Popselect.d.ts +18 -22
- package/es/popselect/src/PopselectPanel.d.ts +1 -0
- package/es/popselect/src/PopselectPanel.js +38 -19
- package/es/popselect/styles/light.d.ts +1 -0
- package/es/select/src/Select.d.ts +111 -83
- package/es/select/src/Select.js +55 -56
- package/es/select/src/interface.d.ts +2 -2
- package/es/select/styles/light.d.ts +10 -8
- package/es/spin/src/Spin.d.ts +34 -25
- package/es/spin/src/Spin.js +27 -20
- package/es/spin/src/styles/index.cssr.js +23 -9
- package/es/spin/styles/light.d.ts +2 -0
- package/es/spin/styles/light.js +3 -1
- package/es/styles.d.ts +1 -0
- package/es/styles.js +1 -0
- package/es/tabs/src/Tab.d.ts +1 -1
- package/es/tabs/src/Tab.js +4 -6
- package/es/tabs/src/Tabs.d.ts +133 -42
- package/es/tabs/src/Tabs.js +37 -38
- package/es/tabs/src/interface.d.ts +2 -1
- package/es/tabs/src/styles/index.cssr.js +34 -10
- package/es/tabs/styles/_common.d.ts +6 -0
- package/es/tabs/styles/_common.js +6 -0
- package/es/tabs/styles/dark.js +7 -1
- package/es/tabs/styles/light.d.ts +13 -0
- package/es/tabs/styles/light.js +3 -3
- package/es/tag/src/styles/index.cssr.js +1 -1
- package/es/time/src/Time.d.ts +14 -22
- package/es/time/src/Time.js +32 -18
- package/es/time-picker/src/TimePicker.d.ts +5 -0
- package/es/time-picker/src/TimePicker.js +2 -2
- package/es/tooltip/src/Tooltip.d.ts +8 -22
- package/es/transfer/src/TransferList.d.ts +1 -1
- package/es/tree/src/Tree.d.ts +25 -10
- package/es/tree/src/Tree.js +34 -11
- package/es/tree/src/TreeNode.js +5 -2
- package/es/tree/src/interface.d.ts +2 -2
- package/es/tree-select/src/TreeSelect.d.ts +103 -81
- package/es/tree-select/src/TreeSelect.js +36 -40
- package/es/tree-select/src/interface.d.ts +2 -2
- package/es/tree-select/styles/light.d.ts +9 -8
- package/es/typography/src/blockquote.d.ts +2 -8
- package/es/typography/src/blockquote.js +1 -4
- package/es/typography/src/ol.d.ts +2 -8
- package/es/typography/src/ol.js +1 -4
- package/es/typography/src/p.d.ts +2 -2
- package/es/typography/src/p.js +1 -1
- package/es/typography/src/text.d.ts +14 -58
- package/es/typography/src/text.js +2 -23
- package/es/typography/src/ul.d.ts +2 -8
- package/es/typography/src/ul.js +1 -4
- package/es/upload/index.d.ts +2 -0
- package/es/upload/index.js +2 -0
- package/es/upload/src/Upload.d.ts +16 -68
- package/es/upload/src/Upload.js +71 -98
- package/es/upload/src/UploadDragger.js +7 -1
- package/es/upload/src/UploadFileList.d.ts +2 -0
- package/es/upload/src/UploadFileList.js +34 -0
- package/es/upload/src/UploadProgress.d.ts +0 -7
- package/es/upload/src/UploadProgress.js +1 -5
- package/es/upload/src/UploadTrigger.d.ts +12 -0
- package/es/upload/src/UploadTrigger.js +63 -0
- package/es/upload/src/interface.d.ts +13 -2
- package/es/upload/src/styles/index.cssr.js +40 -32
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/clear/src/Clear.d.ts +1 -4
- package/lib/_internal/clear/src/Clear.js +1 -4
- package/lib/_internal/icons/Checkmark.js +3 -2
- package/lib/_internal/select-menu/src/SelectMenu.d.ts +173 -0
- package/lib/_internal/select-menu/src/SelectMenu.js +9 -6
- package/lib/_internal/select-menu/src/SelectOption.js +2 -1
- package/lib/_internal/select-menu/src/styles/index.cssr.js +32 -28
- package/lib/_internal/select-menu/styles/light.d.ts +2 -0
- package/lib/_internal/select-menu/styles/light.js +1 -1
- package/lib/_internal/selection/src/Selection.d.ts +64 -56
- package/lib/_internal/selection/src/Selection.js +34 -14
- package/lib/_internal/selection/src/styles/index.cssr.js +16 -14
- package/lib/_internal/selection/styles/_common.d.ts +1 -8
- package/lib/_internal/selection/styles/_common.js +2 -9
- package/lib/_internal/selection/styles/dark.js +10 -2
- package/lib/_internal/selection/styles/light.d.ts +18 -16
- package/lib/_internal/selection/styles/light.js +10 -2
- package/lib/_mixins/use-rtl.js +1 -1
- package/lib/_styles/common/light.js +1 -1
- package/lib/_utils/naive/mutable.d.ts +2 -2
- package/lib/alert/src/Alert.js +15 -16
- package/lib/anchor/src/AnchorAdapter.d.ts +13 -8
- package/lib/anchor/src/AnchorAdapter.js +3 -5
- package/lib/anchor/src/BaseAnchor.d.ts +14 -1
- package/lib/anchor/src/BaseAnchor.js +19 -6
- package/lib/anchor/src/Link.js +5 -5
- package/lib/anchor/src/styles/index.cssr.js +25 -16
- package/lib/auto-complete/index.d.ts +1 -0
- package/lib/auto-complete/src/AutoComplete.d.ts +10 -0
- package/lib/auto-complete/src/interface.d.ts +1 -1
- package/lib/auto-complete/styles/light.d.ts +1 -0
- package/lib/badge/src/styles/index.cssr.js +1 -0
- package/lib/card/src/Card.d.ts +17 -1
- package/lib/card/src/Card.js +3 -2
- package/lib/card/styles/dark.js +6 -1
- package/lib/card/styles/light.d.ts +1 -0
- package/lib/card/styles/light.js +2 -2
- package/lib/cascader/src/Cascader.d.ts +100 -80
- package/lib/cascader/src/Cascader.js +28 -19
- package/lib/cascader/src/CascaderMenu.js +16 -14
- package/lib/cascader/src/CascaderOption.d.ts +10 -8
- package/lib/cascader/src/CascaderSelectMenu.d.ts +10 -8
- package/lib/cascader/src/CascaderSubmenu.d.ts +10 -8
- package/lib/cascader/src/interface.d.ts +2 -2
- package/lib/cascader/src/styles/index.cssr.js +6 -1
- package/lib/cascader/styles/light.d.ts +10 -8
- package/lib/checkbox/src/Checkbox.d.ts +1 -0
- package/lib/checkbox/src/Checkbox.js +5 -3
- package/lib/checkbox/src/CheckboxGroup.js +1 -1
- package/lib/composables/use-theme-vars.js +5 -5
- package/lib/config-provider/src/internal-interface.d.ts +2 -0
- package/lib/data-table/src/DataTable.d.ts +110 -88
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +20 -16
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +20 -16
- package/lib/data-table/src/TableParts/Body.d.ts +20 -16
- package/lib/data-table/src/TableParts/Cell.d.ts +40 -32
- package/lib/data-table/src/TableParts/Header.d.ts +20 -16
- package/lib/data-table/styles/light.d.ts +10 -8
- package/lib/date-picker/src/DatePicker.d.ts +8 -3
- package/lib/date-picker/src/DatePicker.js +2 -2
- package/lib/date-picker/src/panel/date.d.ts +3 -3
- package/lib/date-picker/src/panel/date.js +9 -0
- package/lib/date-picker/src/panel/daterange.js +9 -0
- package/lib/date-picker/src/panel/datetimerange.js +9 -0
- package/lib/descriptions/src/Descriptions.d.ts +4 -17
- package/lib/descriptions/src/Descriptions.js +2 -8
- package/lib/dialog/src/DialogProvider.d.ts +20 -20
- package/lib/drawer/src/styles/index.cssr.js +2 -0
- package/lib/dropdown/src/Dropdown.d.ts +9 -23
- package/lib/dynamic-tags/src/DynamicTags.js +2 -1
- package/lib/empty/src/Empty.d.ts +6 -1
- package/lib/empty/src/Empty.js +15 -3
- package/lib/form/src/FormItemGridItem.d.ts +1 -1
- package/lib/form/src/FormItemGridItem.js +2 -2
- package/lib/global-style/src/GlobalStyle.js +13 -3
- package/lib/grid/src/GridItem.d.ts +2 -2
- package/lib/grid/src/GridItem.js +1 -1
- package/lib/input-number/src/InputNumber.d.ts +8 -3
- package/lib/input-number/src/InputNumber.js +4 -4
- package/lib/jest-setup.js +3 -1
- package/lib/layout/src/Layout.d.ts +18 -4
- package/lib/layout/src/LayoutContent.d.ts +9 -2
- package/lib/layout/src/LayoutFooter.d.ts +9 -0
- package/lib/layout/src/LayoutHeader.d.ts +6 -0
- package/lib/layout/src/LayoutSider.d.ts +11 -0
- package/lib/layout/src/LayoutSider.js +4 -2
- package/lib/layout/src/ToggleButton.js +7 -3
- package/lib/layout/src/styles/layout-sider.cssr.js +31 -15
- package/lib/layout/styles/dark.js +3 -2
- package/lib/layout/styles/light.d.ts +2 -0
- package/lib/layout/styles/light.js +3 -2
- package/lib/locales/common/enUS.js +1 -1
- package/lib/locales/common/ruRU.js +1 -1
- package/lib/locales/common/ukUA.d.ts +3 -0
- package/lib/locales/common/ukUA.js +94 -0
- package/lib/locales/common/zhCN.js +1 -1
- package/lib/locales/date/ukUA.d.ts +3 -0
- package/lib/locales/date/ukUA.js +8 -0
- package/lib/locales/index.d.ts +2 -0
- package/lib/locales/index.js +5 -1
- package/lib/mention/src/Mention.d.ts +10 -0
- package/lib/mention/styles/light.d.ts +1 -0
- package/lib/menu/src/Menu.d.ts +6 -1
- package/lib/menu/src/Menu.js +10 -1
- package/lib/menu/src/MenuOption.d.ts +3 -1
- package/lib/menu/src/MenuOptionContent.d.ts +3 -1
- package/lib/menu/src/Submenu.d.ts +3 -1
- package/lib/modal/src/BodyWrapper.d.ts +5 -0
- package/lib/modal/src/Modal.d.ts +36 -55
- package/lib/modal/src/Modal.js +17 -38
- package/lib/modal/src/presetProps.d.ts +2 -1
- package/lib/modal/styles/light.d.ts +1 -0
- package/lib/notification/src/Notification.d.ts +1 -1
- package/lib/notification/src/NotificationEnvironment.d.ts +1 -1
- package/lib/notification/src/NotificationProvider.d.ts +16 -16
- package/lib/page-header/src/PageHeader.d.ts +1 -0
- package/lib/page-header/src/PageHeader.js +8 -2
- package/lib/page-header/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/page-header/src/styles/rtl.cssr.js +26 -0
- package/lib/page-header/styles/index.d.ts +1 -0
- package/lib/page-header/styles/index.js +3 -1
- package/lib/page-header/styles/rtl.d.ts +5 -0
- package/lib/page-header/styles/rtl.js +7 -0
- package/lib/pagination/src/Pagination.d.ts +111 -100
- package/lib/pagination/styles/light.d.ts +10 -8
- package/lib/popconfirm/src/Popconfirm.d.ts +8 -22
- package/lib/popover/src/Popover.d.ts +12 -32
- package/lib/popover/src/Popover.js +23 -16
- package/lib/popover/src/PopoverBody.d.ts +2 -2
- package/lib/popover/src/PopoverBody.js +4 -2
- package/lib/popselect/src/Popselect.d.ts +18 -22
- package/lib/popselect/src/PopselectPanel.d.ts +1 -0
- package/lib/popselect/src/PopselectPanel.js +38 -19
- package/lib/popselect/styles/light.d.ts +1 -0
- package/lib/select/src/Select.d.ts +111 -83
- package/lib/select/src/Select.js +55 -56
- package/lib/select/src/interface.d.ts +2 -2
- package/lib/select/styles/light.d.ts +10 -8
- package/lib/spin/src/Spin.d.ts +34 -25
- package/lib/spin/src/Spin.js +25 -18
- package/lib/spin/src/styles/index.cssr.js +23 -9
- package/lib/spin/styles/light.d.ts +2 -0
- package/lib/spin/styles/light.js +3 -1
- package/lib/styles.d.ts +1 -0
- package/lib/styles.js +63 -61
- package/lib/tabs/src/Tab.d.ts +1 -1
- package/lib/tabs/src/Tab.js +4 -6
- package/lib/tabs/src/Tabs.d.ts +133 -42
- package/lib/tabs/src/Tabs.js +36 -37
- package/lib/tabs/src/interface.d.ts +2 -1
- package/lib/tabs/src/styles/index.cssr.js +34 -10
- package/lib/tabs/styles/_common.d.ts +6 -0
- package/lib/tabs/styles/_common.js +6 -0
- package/lib/tabs/styles/dark.js +7 -1
- package/lib/tabs/styles/light.d.ts +13 -0
- package/lib/tabs/styles/light.js +3 -3
- package/lib/tag/src/styles/index.cssr.js +1 -1
- package/lib/time/src/Time.d.ts +14 -22
- package/lib/time/src/Time.js +31 -17
- package/lib/time-picker/src/TimePicker.d.ts +5 -0
- package/lib/time-picker/src/TimePicker.js +2 -2
- package/lib/tooltip/src/Tooltip.d.ts +8 -22
- package/lib/transfer/src/TransferList.d.ts +1 -1
- package/lib/tree/src/Tree.d.ts +25 -10
- package/lib/tree/src/Tree.js +34 -11
- package/lib/tree/src/TreeNode.js +5 -2
- package/lib/tree/src/interface.d.ts +2 -2
- package/lib/tree-select/src/TreeSelect.d.ts +103 -81
- package/lib/tree-select/src/TreeSelect.js +36 -40
- package/lib/tree-select/src/interface.d.ts +2 -2
- package/lib/tree-select/styles/light.d.ts +9 -8
- package/lib/typography/src/blockquote.d.ts +2 -8
- package/lib/typography/src/blockquote.js +1 -4
- package/lib/typography/src/ol.d.ts +2 -8
- package/lib/typography/src/ol.js +1 -4
- package/lib/typography/src/p.d.ts +2 -2
- package/lib/typography/src/p.js +1 -1
- package/lib/typography/src/text.d.ts +14 -58
- package/lib/typography/src/text.js +2 -23
- package/lib/typography/src/ul.d.ts +2 -8
- package/lib/typography/src/ul.js +1 -4
- package/lib/upload/index.d.ts +2 -0
- package/lib/upload/index.js +5 -1
- package/lib/upload/src/Upload.d.ts +16 -68
- package/lib/upload/src/Upload.js +68 -95
- package/lib/upload/src/UploadDragger.js +7 -1
- package/lib/upload/src/UploadFileList.d.ts +2 -0
- package/lib/upload/src/UploadFileList.js +36 -0
- package/lib/upload/src/UploadProgress.d.ts +0 -7
- package/lib/upload/src/UploadProgress.js +1 -5
- package/lib/upload/src/UploadTrigger.d.ts +12 -0
- package/lib/upload/src/UploadTrigger.js +65 -0
- package/lib/upload/src/interface.d.ts +13 -2
- package/lib/upload/src/styles/index.cssr.js +40 -32
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +9 -7
- package/web-types.json +239 -13
package/es/tree/src/Tree.js
CHANGED
|
@@ -52,6 +52,9 @@ export const treeSharedProps = {
|
|
|
52
52
|
type: Array,
|
|
53
53
|
default: () => []
|
|
54
54
|
},
|
|
55
|
+
indeterminateKeys: Array,
|
|
56
|
+
onUpdateIndeterminateKeys: [Function, Array],
|
|
57
|
+
'onUpdate:indeterminateKeys': [Function, Array],
|
|
55
58
|
onUpdateExpandedKeys: [Function, Array],
|
|
56
59
|
'onUpdate:expandedKeys': [Function, Array]
|
|
57
60
|
};
|
|
@@ -91,14 +94,14 @@ const treeProps = Object.assign(Object.assign(Object.assign(Object.assign({}, us
|
|
|
91
94
|
// use it to do check
|
|
92
95
|
internalDataTreeMate: Object,
|
|
93
96
|
// use it to display
|
|
94
|
-
internalDisplayTreeMate: Object, internalHighlightKeySet: Object,
|
|
97
|
+
internalDisplayTreeMate: Object, internalHighlightKeySet: Object, internalUnifySelectCheck: Boolean, internalHideFilteredNode: Boolean, internalCheckboxFocusable: {
|
|
95
98
|
type: Boolean,
|
|
96
99
|
default: true
|
|
97
100
|
}, internalFocusable: {
|
|
98
101
|
// Make tree-select take over keyboard operations
|
|
99
102
|
type: Boolean,
|
|
100
103
|
default: true
|
|
101
|
-
},
|
|
104
|
+
}, checkStrategy: {
|
|
102
105
|
type: String,
|
|
103
106
|
default: 'all'
|
|
104
107
|
} });
|
|
@@ -130,15 +133,19 @@ export default defineComponent({
|
|
|
130
133
|
const controlledCheckedKeysRef = toRef(props, 'checkedKeys');
|
|
131
134
|
const mergedCheckedKeysRef = useMergedState(controlledCheckedKeysRef, uncontrolledCheckedKeysRef);
|
|
132
135
|
const checkedStatusRef = computed(() => {
|
|
133
|
-
|
|
136
|
+
const value = dataTreeMateRef.value.getCheckedKeys(mergedCheckedKeysRef.value, {
|
|
134
137
|
cascade: props.cascade
|
|
135
138
|
});
|
|
139
|
+
return value;
|
|
136
140
|
});
|
|
137
|
-
const mergedCheckStrategyRef = computed(() => props.leafOnly ? 'child' : props.
|
|
141
|
+
const mergedCheckStrategyRef = computed(() => props.leafOnly ? 'child' : props.checkStrategy);
|
|
138
142
|
const displayedCheckedKeysRef = computed(() => {
|
|
139
143
|
return checkedStatusRef.value.checkedKeys;
|
|
140
144
|
});
|
|
141
145
|
const displayedIndeterminateKeysRef = computed(() => {
|
|
146
|
+
const { indeterminateKeys } = props;
|
|
147
|
+
if (indeterminateKeys !== undefined)
|
|
148
|
+
return indeterminateKeys;
|
|
142
149
|
return checkedStatusRef.value.indeterminateKeys;
|
|
143
150
|
});
|
|
144
151
|
const uncontrolledSelectedKeysRef = ref(props.defaultSelectedKeys || props.selectedKeys);
|
|
@@ -333,6 +340,13 @@ export default defineComponent({
|
|
|
333
340
|
if (_onUpdateCheckedKeys)
|
|
334
341
|
call(_onUpdateCheckedKeys, value);
|
|
335
342
|
}
|
|
343
|
+
function doUpdateIndeterminateKeys(value) {
|
|
344
|
+
const { 'onUpdate:indeterminateKeys': _onUpdateIndeterminateKeys, onUpdateIndeterminateKeys } = props;
|
|
345
|
+
if (_onUpdateIndeterminateKeys)
|
|
346
|
+
call(_onUpdateIndeterminateKeys, value);
|
|
347
|
+
if (onUpdateIndeterminateKeys)
|
|
348
|
+
call(onUpdateIndeterminateKeys, value);
|
|
349
|
+
}
|
|
336
350
|
function doUpdateSelectedKeys(value) {
|
|
337
351
|
const { 'onUpdate:selectedKeys': _onUpdateSelectedKeys, onUpdateSelectedKeys } = props;
|
|
338
352
|
uncontrolledSelectedKeysRef.value = value;
|
|
@@ -398,12 +412,16 @@ export default defineComponent({
|
|
|
398
412
|
if (props.disabled || node.disabled) {
|
|
399
413
|
return;
|
|
400
414
|
}
|
|
401
|
-
|
|
415
|
+
if (props.internalUnifySelectCheck && !props.multiple) {
|
|
416
|
+
handleSelect(node);
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
const { checkedKeys, indeterminateKeys } = dataTreeMateRef.value[checked ? 'check' : 'uncheck'](node.key, displayedCheckedKeysRef.value, {
|
|
402
420
|
cascade: props.cascade,
|
|
403
|
-
leafOnly: props.leafOnly,
|
|
404
421
|
checkStrategy: mergedCheckStrategyRef.value
|
|
405
422
|
});
|
|
406
423
|
doUpdateCheckedKeys(checkedKeys);
|
|
424
|
+
doUpdateIndeterminateKeys(indeterminateKeys);
|
|
407
425
|
}
|
|
408
426
|
function toggleExpand(key) {
|
|
409
427
|
if (props.disabled)
|
|
@@ -432,14 +450,19 @@ export default defineComponent({
|
|
|
432
450
|
if (props.disabled ||
|
|
433
451
|
node.disabled ||
|
|
434
452
|
!props.selectable ||
|
|
435
|
-
(
|
|
453
|
+
(mergedCheckStrategyRef.value === 'child' && !node.isLeaf)) {
|
|
436
454
|
return;
|
|
437
455
|
}
|
|
438
456
|
pendingNodeKeyRef.value = node.key;
|
|
439
|
-
if (props.
|
|
457
|
+
if (props.internalUnifySelectCheck) {
|
|
440
458
|
const { value: { checkedKeys, indeterminateKeys } } = checkedStatusRef;
|
|
441
|
-
|
|
442
|
-
|
|
459
|
+
if (props.multiple) {
|
|
460
|
+
handleCheck(node, !(checkedKeys.includes(node.key) ||
|
|
461
|
+
indeterminateKeys.includes(node.key)));
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
doUpdateCheckedKeys([node.key]);
|
|
465
|
+
}
|
|
443
466
|
}
|
|
444
467
|
if (props.multiple) {
|
|
445
468
|
const selectedKeys = Array.from(mergedSelectedKeysRef.value);
|
|
@@ -839,9 +862,9 @@ export default defineComponent({
|
|
|
839
862
|
mergedSelectedKeysRef,
|
|
840
863
|
mergedExpandedKeysRef,
|
|
841
864
|
mergedThemeRef: themeRef,
|
|
865
|
+
mergedCheckStrategyRef,
|
|
842
866
|
disabledRef: toRef(props, 'disabled'),
|
|
843
867
|
checkableRef: toRef(props, 'checkable'),
|
|
844
|
-
leafOnlyRef: toRef(props, 'leafOnly'),
|
|
845
868
|
selectableRef: toRef(props, 'selectable'),
|
|
846
869
|
remoteRef: toRef(props, 'remote'),
|
|
847
870
|
onLoadRef: toRef(props, 'onLoad'),
|
package/es/tree/src/TreeNode.js
CHANGED
|
@@ -146,10 +146,13 @@ const TreeNode = defineComponent({
|
|
|
146
146
|
disabled: computed(() => NTree.disabledRef.value || props.tmNode.disabled),
|
|
147
147
|
checkable: computed(() => NTree.checkableRef.value &&
|
|
148
148
|
(NTree.cascadeRef.value ||
|
|
149
|
-
|
|
149
|
+
NTree.mergedCheckStrategyRef.value !== 'child' ||
|
|
150
|
+
props.tmNode.isLeaf)),
|
|
150
151
|
checkboxDisabled: computed(() => !!props.tmNode.rawNode.checkboxDisabled),
|
|
151
152
|
selectable: computed(() => NTree.selectableRef.value &&
|
|
152
|
-
(NTree.
|
|
153
|
+
(NTree.mergedCheckStrategyRef.value === 'child'
|
|
154
|
+
? props.tmNode.isLeaf
|
|
155
|
+
: true)),
|
|
153
156
|
internalScrollable: NTree.internalScrollableRef,
|
|
154
157
|
draggable: NTree.draggableRef,
|
|
155
158
|
blockLine: NTree.blockLineRef,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TreeNode } from 'treemate';
|
|
1
|
+
import { CheckStrategy, TreeNode } from 'treemate';
|
|
2
2
|
import { InjectionKey, Ref, VNodeChild } from 'vue';
|
|
3
3
|
import type { MergedTheme } from '../../_mixins';
|
|
4
4
|
import type { TreeTheme } from '../styles';
|
|
@@ -73,7 +73,7 @@ export interface TreeInjection {
|
|
|
73
73
|
disabledRef: Ref<boolean>;
|
|
74
74
|
checkableRef: Ref<boolean>;
|
|
75
75
|
cascadeRef: Ref<boolean>;
|
|
76
|
-
|
|
76
|
+
mergedCheckStrategyRef: Ref<CheckStrategy>;
|
|
77
77
|
selectableRef: Ref<boolean>;
|
|
78
78
|
pendingNodeKeyRef: Ref<null | Key>;
|
|
79
79
|
internalScrollableRef: Ref<boolean>;
|
|
@@ -38,6 +38,9 @@ declare const props: {
|
|
|
38
38
|
readonly type: PropType<Key[]>;
|
|
39
39
|
readonly default: () => never[];
|
|
40
40
|
};
|
|
41
|
+
readonly indeterminateKeys: PropType<Key[]>;
|
|
42
|
+
readonly onUpdateIndeterminateKeys: PropType<MaybeArray<(value: Key[]) => void>>;
|
|
43
|
+
readonly 'onUpdate:indeterminateKeys': PropType<MaybeArray<(value: Key[]) => void>>;
|
|
41
44
|
readonly onUpdateExpandedKeys: PropType<MaybeArray<(value: Key[]) => void>>;
|
|
42
45
|
readonly 'onUpdate:expandedKeys': PropType<MaybeArray<(value: Key[]) => void>>;
|
|
43
46
|
readonly bordered: {
|
|
@@ -161,6 +164,14 @@ declare const props: {
|
|
|
161
164
|
iconSizeHuge: string;
|
|
162
165
|
}, any>;
|
|
163
166
|
InternalSelection: import("../../_mixins").Theme<"InternalSelection", {
|
|
167
|
+
fontSizeTiny: string;
|
|
168
|
+
fontSizeSmall: string;
|
|
169
|
+
fontSizeMedium: string;
|
|
170
|
+
fontSizeLarge: string;
|
|
171
|
+
heightTiny: string;
|
|
172
|
+
heightSmall: string;
|
|
173
|
+
heightMedium: string;
|
|
174
|
+
heightLarge: string;
|
|
164
175
|
borderRadius: string;
|
|
165
176
|
textColor: string;
|
|
166
177
|
textColorDisabled: string;
|
|
@@ -201,16 +212,9 @@ declare const props: {
|
|
|
201
212
|
clearColor: string;
|
|
202
213
|
clearColorHover: string;
|
|
203
214
|
clearColorPressed: string;
|
|
204
|
-
heightTiny: string;
|
|
205
|
-
heightSmall: string;
|
|
206
|
-
heightMedium: string;
|
|
207
|
-
heightLarge: string;
|
|
208
|
-
fontSizeTiny: string;
|
|
209
|
-
fontSizeSmall: string;
|
|
210
|
-
fontSizeMedium: string;
|
|
211
|
-
fontSizeLarge: string;
|
|
212
215
|
paddingSingle: string;
|
|
213
216
|
clearSize: string;
|
|
217
|
+
arrowSize: string;
|
|
214
218
|
}, {
|
|
215
219
|
Popover: import("../../_mixins").Theme<"Popover", {
|
|
216
220
|
fontSize: string;
|
|
@@ -294,6 +298,14 @@ declare const props: {
|
|
|
294
298
|
iconSizeHuge: string;
|
|
295
299
|
}, any>;
|
|
296
300
|
InternalSelection: import("../../_mixins").Theme<"InternalSelection", {
|
|
301
|
+
fontSizeTiny: string;
|
|
302
|
+
fontSizeSmall: string;
|
|
303
|
+
fontSizeMedium: string;
|
|
304
|
+
fontSizeLarge: string;
|
|
305
|
+
heightTiny: string;
|
|
306
|
+
heightSmall: string;
|
|
307
|
+
heightMedium: string;
|
|
308
|
+
heightLarge: string;
|
|
297
309
|
borderRadius: string;
|
|
298
310
|
textColor: string;
|
|
299
311
|
textColorDisabled: string;
|
|
@@ -334,16 +346,9 @@ declare const props: {
|
|
|
334
346
|
clearColor: string;
|
|
335
347
|
clearColorHover: string;
|
|
336
348
|
clearColorPressed: string;
|
|
337
|
-
heightTiny: string;
|
|
338
|
-
heightSmall: string;
|
|
339
|
-
heightMedium: string;
|
|
340
|
-
heightLarge: string;
|
|
341
|
-
fontSizeTiny: string;
|
|
342
|
-
fontSizeSmall: string;
|
|
343
|
-
fontSizeMedium: string;
|
|
344
|
-
fontSizeLarge: string;
|
|
345
349
|
paddingSingle: string;
|
|
346
350
|
clearSize: string;
|
|
351
|
+
arrowSize: string;
|
|
347
352
|
}, {
|
|
348
353
|
Popover: import("../../_mixins").Theme<"Popover", {
|
|
349
354
|
fontSize: string;
|
|
@@ -427,6 +432,14 @@ declare const props: {
|
|
|
427
432
|
iconSizeHuge: string;
|
|
428
433
|
}, any>;
|
|
429
434
|
InternalSelection: import("../../_mixins").Theme<"InternalSelection", {
|
|
435
|
+
fontSizeTiny: string;
|
|
436
|
+
fontSizeSmall: string;
|
|
437
|
+
fontSizeMedium: string;
|
|
438
|
+
fontSizeLarge: string;
|
|
439
|
+
heightTiny: string;
|
|
440
|
+
heightSmall: string;
|
|
441
|
+
heightMedium: string;
|
|
442
|
+
heightLarge: string;
|
|
430
443
|
borderRadius: string;
|
|
431
444
|
textColor: string;
|
|
432
445
|
textColorDisabled: string;
|
|
@@ -467,16 +480,9 @@ declare const props: {
|
|
|
467
480
|
clearColor: string;
|
|
468
481
|
clearColorHover: string;
|
|
469
482
|
clearColorPressed: string;
|
|
470
|
-
heightTiny: string;
|
|
471
|
-
heightSmall: string;
|
|
472
|
-
heightMedium: string;
|
|
473
|
-
heightLarge: string;
|
|
474
|
-
fontSizeTiny: string;
|
|
475
|
-
fontSizeSmall: string;
|
|
476
|
-
fontSizeMedium: string;
|
|
477
|
-
fontSizeLarge: string;
|
|
478
483
|
paddingSingle: string;
|
|
479
484
|
clearSize: string;
|
|
485
|
+
arrowSize: string;
|
|
480
486
|
}, {
|
|
481
487
|
Popover: import("../../_mixins").Theme<"Popover", {
|
|
482
488
|
fontSize: string;
|
|
@@ -529,6 +535,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
529
535
|
readonly type: PropType<Key[]>;
|
|
530
536
|
readonly default: () => never[];
|
|
531
537
|
};
|
|
538
|
+
readonly indeterminateKeys: PropType<Key[]>;
|
|
539
|
+
readonly onUpdateIndeterminateKeys: PropType<MaybeArray<(value: Key[]) => void>>;
|
|
540
|
+
readonly 'onUpdate:indeterminateKeys': PropType<MaybeArray<(value: Key[]) => void>>;
|
|
532
541
|
readonly onUpdateExpandedKeys: PropType<MaybeArray<(value: Key[]) => void>>;
|
|
533
542
|
readonly 'onUpdate:expandedKeys': PropType<MaybeArray<(value: Key[]) => void>>;
|
|
534
543
|
readonly bordered: {
|
|
@@ -652,6 +661,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
652
661
|
iconSizeHuge: string;
|
|
653
662
|
}, any>;
|
|
654
663
|
InternalSelection: import("../../_mixins").Theme<"InternalSelection", {
|
|
664
|
+
fontSizeTiny: string;
|
|
665
|
+
fontSizeSmall: string;
|
|
666
|
+
fontSizeMedium: string;
|
|
667
|
+
fontSizeLarge: string;
|
|
668
|
+
heightTiny: string;
|
|
669
|
+
heightSmall: string;
|
|
670
|
+
heightMedium: string;
|
|
671
|
+
heightLarge: string;
|
|
655
672
|
borderRadius: string;
|
|
656
673
|
textColor: string;
|
|
657
674
|
textColorDisabled: string;
|
|
@@ -692,16 +709,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
692
709
|
clearColor: string;
|
|
693
710
|
clearColorHover: string;
|
|
694
711
|
clearColorPressed: string;
|
|
695
|
-
heightTiny: string;
|
|
696
|
-
heightSmall: string;
|
|
697
|
-
heightMedium: string;
|
|
698
|
-
heightLarge: string;
|
|
699
|
-
fontSizeTiny: string;
|
|
700
|
-
fontSizeSmall: string;
|
|
701
|
-
fontSizeMedium: string;
|
|
702
|
-
fontSizeLarge: string;
|
|
703
712
|
paddingSingle: string;
|
|
704
713
|
clearSize: string;
|
|
714
|
+
arrowSize: string;
|
|
705
715
|
}, {
|
|
706
716
|
Popover: import("../../_mixins").Theme<"Popover", {
|
|
707
717
|
fontSize: string;
|
|
@@ -785,6 +795,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
785
795
|
iconSizeHuge: string;
|
|
786
796
|
}, any>;
|
|
787
797
|
InternalSelection: import("../../_mixins").Theme<"InternalSelection", {
|
|
798
|
+
fontSizeTiny: string;
|
|
799
|
+
fontSizeSmall: string;
|
|
800
|
+
fontSizeMedium: string;
|
|
801
|
+
fontSizeLarge: string;
|
|
802
|
+
heightTiny: string;
|
|
803
|
+
heightSmall: string;
|
|
804
|
+
heightMedium: string;
|
|
805
|
+
heightLarge: string;
|
|
788
806
|
borderRadius: string;
|
|
789
807
|
textColor: string;
|
|
790
808
|
textColorDisabled: string;
|
|
@@ -825,16 +843,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
825
843
|
clearColor: string;
|
|
826
844
|
clearColorHover: string;
|
|
827
845
|
clearColorPressed: string;
|
|
828
|
-
heightTiny: string;
|
|
829
|
-
heightSmall: string;
|
|
830
|
-
heightMedium: string;
|
|
831
|
-
heightLarge: string;
|
|
832
|
-
fontSizeTiny: string;
|
|
833
|
-
fontSizeSmall: string;
|
|
834
|
-
fontSizeMedium: string;
|
|
835
|
-
fontSizeLarge: string;
|
|
836
846
|
paddingSingle: string;
|
|
837
847
|
clearSize: string;
|
|
848
|
+
arrowSize: string;
|
|
838
849
|
}, {
|
|
839
850
|
Popover: import("../../_mixins").Theme<"Popover", {
|
|
840
851
|
fontSize: string;
|
|
@@ -918,6 +929,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
918
929
|
iconSizeHuge: string;
|
|
919
930
|
}, any>;
|
|
920
931
|
InternalSelection: import("../../_mixins").Theme<"InternalSelection", {
|
|
932
|
+
fontSizeTiny: string;
|
|
933
|
+
fontSizeSmall: string;
|
|
934
|
+
fontSizeMedium: string;
|
|
935
|
+
fontSizeLarge: string;
|
|
936
|
+
heightTiny: string;
|
|
937
|
+
heightSmall: string;
|
|
938
|
+
heightMedium: string;
|
|
939
|
+
heightLarge: string;
|
|
921
940
|
borderRadius: string;
|
|
922
941
|
textColor: string;
|
|
923
942
|
textColorDisabled: string;
|
|
@@ -958,16 +977,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
958
977
|
clearColor: string;
|
|
959
978
|
clearColorHover: string;
|
|
960
979
|
clearColorPressed: string;
|
|
961
|
-
heightTiny: string;
|
|
962
|
-
heightSmall: string;
|
|
963
|
-
heightMedium: string;
|
|
964
|
-
heightLarge: string;
|
|
965
|
-
fontSizeTiny: string;
|
|
966
|
-
fontSizeSmall: string;
|
|
967
|
-
fontSizeMedium: string;
|
|
968
|
-
fontSizeLarge: string;
|
|
969
980
|
paddingSingle: string;
|
|
970
981
|
clearSize: string;
|
|
982
|
+
arrowSize: string;
|
|
971
983
|
}, {
|
|
972
984
|
Popover: import("../../_mixins").Theme<"Popover", {
|
|
973
985
|
fontSize: string;
|
|
@@ -1029,8 +1041,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1029
1041
|
handleMenuLeave: () => void;
|
|
1030
1042
|
handleTriggerClick: () => void;
|
|
1031
1043
|
handleMenuClickoutside: (e: MouseEvent) => void;
|
|
1032
|
-
handleUpdateSelectedKeys: (keys: Key[]) => void;
|
|
1033
1044
|
handleUpdateCheckedKeys: (keys: Key[]) => void;
|
|
1045
|
+
handleUpdateIndeterminateKeys: (keys: Key[]) => void;
|
|
1034
1046
|
handleTriggerFocus: (e: FocusEvent) => void;
|
|
1035
1047
|
handleTriggerBlur: (e: FocusEvent) => void;
|
|
1036
1048
|
handleMenuFocusin: (e: FocusEvent) => void;
|
|
@@ -1216,6 +1228,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1216
1228
|
iconSizeHuge: string;
|
|
1217
1229
|
}, any>;
|
|
1218
1230
|
InternalSelection: import("../../_mixins").Theme<"InternalSelection", {
|
|
1231
|
+
fontSizeTiny: string;
|
|
1232
|
+
fontSizeSmall: string;
|
|
1233
|
+
fontSizeMedium: string;
|
|
1234
|
+
fontSizeLarge: string;
|
|
1235
|
+
heightTiny: string;
|
|
1236
|
+
heightSmall: string;
|
|
1237
|
+
heightMedium: string;
|
|
1238
|
+
heightLarge: string;
|
|
1219
1239
|
borderRadius: string;
|
|
1220
1240
|
textColor: string;
|
|
1221
1241
|
textColorDisabled: string;
|
|
@@ -1256,16 +1276,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1256
1276
|
clearColor: string;
|
|
1257
1277
|
clearColorHover: string;
|
|
1258
1278
|
clearColorPressed: string;
|
|
1259
|
-
heightTiny: string;
|
|
1260
|
-
heightSmall: string;
|
|
1261
|
-
heightMedium: string;
|
|
1262
|
-
heightLarge: string;
|
|
1263
|
-
fontSizeTiny: string;
|
|
1264
|
-
fontSizeSmall: string;
|
|
1265
|
-
fontSizeMedium: string;
|
|
1266
|
-
fontSizeLarge: string;
|
|
1267
1279
|
paddingSingle: string;
|
|
1268
1280
|
clearSize: string;
|
|
1281
|
+
arrowSize: string;
|
|
1269
1282
|
}, {
|
|
1270
1283
|
Popover: import("../../_mixins").Theme<"Popover", {
|
|
1271
1284
|
fontSize: string;
|
|
@@ -1360,6 +1373,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1360
1373
|
readonly labelField?: unknown;
|
|
1361
1374
|
readonly childrenField?: unknown;
|
|
1362
1375
|
readonly defaultExpandedKeys?: unknown;
|
|
1376
|
+
readonly indeterminateKeys?: unknown;
|
|
1377
|
+
readonly onUpdateIndeterminateKeys?: unknown;
|
|
1378
|
+
readonly 'onUpdate:indeterminateKeys'?: unknown;
|
|
1363
1379
|
readonly onUpdateExpandedKeys?: unknown;
|
|
1364
1380
|
readonly 'onUpdate:expandedKeys'?: unknown;
|
|
1365
1381
|
readonly bordered?: unknown;
|
|
@@ -1484,6 +1500,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1484
1500
|
iconSizeHuge: string;
|
|
1485
1501
|
}, any>;
|
|
1486
1502
|
InternalSelection: import("../../_mixins").Theme<"InternalSelection", {
|
|
1503
|
+
fontSizeTiny: string;
|
|
1504
|
+
fontSizeSmall: string;
|
|
1505
|
+
fontSizeMedium: string;
|
|
1506
|
+
fontSizeLarge: string;
|
|
1507
|
+
heightTiny: string;
|
|
1508
|
+
heightSmall: string;
|
|
1509
|
+
heightMedium: string;
|
|
1510
|
+
heightLarge: string;
|
|
1487
1511
|
borderRadius: string;
|
|
1488
1512
|
textColor: string;
|
|
1489
1513
|
textColorDisabled: string;
|
|
@@ -1524,16 +1548,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1524
1548
|
clearColor: string;
|
|
1525
1549
|
clearColorHover: string;
|
|
1526
1550
|
clearColorPressed: string;
|
|
1527
|
-
heightTiny: string;
|
|
1528
|
-
heightSmall: string;
|
|
1529
|
-
heightMedium: string;
|
|
1530
|
-
heightLarge: string;
|
|
1531
|
-
fontSizeTiny: string;
|
|
1532
|
-
fontSizeSmall: string;
|
|
1533
|
-
fontSizeMedium: string;
|
|
1534
|
-
fontSizeLarge: string;
|
|
1535
1551
|
paddingSingle: string;
|
|
1536
1552
|
clearSize: string;
|
|
1553
|
+
arrowSize: string;
|
|
1537
1554
|
}, {
|
|
1538
1555
|
Popover: import("../../_mixins").Theme<"Popover", {
|
|
1539
1556
|
fontSize: string;
|
|
@@ -1617,6 +1634,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1617
1634
|
iconSizeHuge: string;
|
|
1618
1635
|
}, any>;
|
|
1619
1636
|
InternalSelection: import("../../_mixins").Theme<"InternalSelection", {
|
|
1637
|
+
fontSizeTiny: string;
|
|
1638
|
+
fontSizeSmall: string;
|
|
1639
|
+
fontSizeMedium: string;
|
|
1640
|
+
fontSizeLarge: string;
|
|
1641
|
+
heightTiny: string;
|
|
1642
|
+
heightSmall: string;
|
|
1643
|
+
heightMedium: string;
|
|
1644
|
+
heightLarge: string;
|
|
1620
1645
|
borderRadius: string;
|
|
1621
1646
|
textColor: string;
|
|
1622
1647
|
textColorDisabled: string;
|
|
@@ -1657,16 +1682,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1657
1682
|
clearColor: string;
|
|
1658
1683
|
clearColorHover: string;
|
|
1659
1684
|
clearColorPressed: string;
|
|
1660
|
-
heightTiny: string;
|
|
1661
|
-
heightSmall: string;
|
|
1662
|
-
heightMedium: string;
|
|
1663
|
-
heightLarge: string;
|
|
1664
|
-
fontSizeTiny: string;
|
|
1665
|
-
fontSizeSmall: string;
|
|
1666
|
-
fontSizeMedium: string;
|
|
1667
|
-
fontSizeLarge: string;
|
|
1668
1685
|
paddingSingle: string;
|
|
1669
1686
|
clearSize: string;
|
|
1687
|
+
arrowSize: string;
|
|
1670
1688
|
}, {
|
|
1671
1689
|
Popover: import("../../_mixins").Theme<"Popover", {
|
|
1672
1690
|
fontSize: string;
|
|
@@ -1750,6 +1768,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1750
1768
|
iconSizeHuge: string;
|
|
1751
1769
|
}, any>;
|
|
1752
1770
|
InternalSelection: import("../../_mixins").Theme<"InternalSelection", {
|
|
1771
|
+
fontSizeTiny: string;
|
|
1772
|
+
fontSizeSmall: string;
|
|
1773
|
+
fontSizeMedium: string;
|
|
1774
|
+
fontSizeLarge: string;
|
|
1775
|
+
heightTiny: string;
|
|
1776
|
+
heightSmall: string;
|
|
1777
|
+
heightMedium: string;
|
|
1778
|
+
heightLarge: string;
|
|
1753
1779
|
borderRadius: string;
|
|
1754
1780
|
textColor: string;
|
|
1755
1781
|
textColorDisabled: string;
|
|
@@ -1790,16 +1816,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1790
1816
|
clearColor: string;
|
|
1791
1817
|
clearColorHover: string;
|
|
1792
1818
|
clearColorPressed: string;
|
|
1793
|
-
heightTiny: string;
|
|
1794
|
-
heightSmall: string;
|
|
1795
|
-
heightMedium: string;
|
|
1796
|
-
heightLarge: string;
|
|
1797
|
-
fontSizeTiny: string;
|
|
1798
|
-
fontSizeSmall: string;
|
|
1799
|
-
fontSizeMedium: string;
|
|
1800
|
-
fontSizeLarge: string;
|
|
1801
1819
|
paddingSingle: string;
|
|
1802
1820
|
clearSize: string;
|
|
1821
|
+
arrowSize: string;
|
|
1803
1822
|
}, {
|
|
1804
1823
|
Popover: import("../../_mixins").Theme<"Popover", {
|
|
1805
1824
|
fontSize: string;
|
|
@@ -1826,6 +1845,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1826
1845
|
expandedKeys?: Key[] | undefined;
|
|
1827
1846
|
"onUpdate:expandedKeys"?: MaybeArray<(value: Key[]) => void> | undefined;
|
|
1828
1847
|
onUpdateExpandedKeys?: MaybeArray<(value: Key[]) => void> | undefined;
|
|
1848
|
+
indeterminateKeys?: Key[] | undefined;
|
|
1849
|
+
onUpdateIndeterminateKeys?: MaybeArray<(value: Key[]) => void> | undefined;
|
|
1850
|
+
"onUpdate:indeterminateKeys"?: MaybeArray<(value: Key[]) => void> | undefined;
|
|
1829
1851
|
}>, {
|
|
1830
1852
|
show: boolean | undefined;
|
|
1831
1853
|
separator: string;
|
|
@@ -117,7 +117,7 @@ export default defineComponent({
|
|
|
117
117
|
? initMergedValue[initMergedValue.length - 1]
|
|
118
118
|
: null);
|
|
119
119
|
const mergedCascadeRef = computed(() => {
|
|
120
|
-
return props.multiple && props.cascade;
|
|
120
|
+
return props.multiple && props.cascade && props.checkable;
|
|
121
121
|
});
|
|
122
122
|
// The same logic as tree, now it's not that complex so I don't extract a
|
|
123
123
|
// function to reuse it.
|
|
@@ -136,21 +136,9 @@ export default defineComponent({
|
|
|
136
136
|
const treeSelectedKeysRef = computed(() => {
|
|
137
137
|
if (props.checkable)
|
|
138
138
|
return [];
|
|
139
|
-
|
|
140
|
-
const { multiple } = props;
|
|
141
|
-
return Array.isArray(mergedValue)
|
|
142
|
-
? multiple
|
|
143
|
-
? mergedValue
|
|
144
|
-
: []
|
|
145
|
-
: multiple
|
|
146
|
-
? []
|
|
147
|
-
: mergedValue === null
|
|
148
|
-
? []
|
|
149
|
-
: [mergedValue];
|
|
139
|
+
return treeCheckedKeysRef.value;
|
|
150
140
|
});
|
|
151
141
|
const treeCheckedKeysRef = computed(() => {
|
|
152
|
-
if (!props.checkable)
|
|
153
|
-
return [];
|
|
154
142
|
const { value: mergedValue } = mergedValueRef;
|
|
155
143
|
if (props.multiple) {
|
|
156
144
|
if (Array.isArray(mergedValue))
|
|
@@ -226,16 +214,26 @@ export default defineComponent({
|
|
|
226
214
|
call(_onUpdateShow, value);
|
|
227
215
|
uncontrolledShowRef.value = value;
|
|
228
216
|
}
|
|
229
|
-
function doUpdateValue(value) {
|
|
217
|
+
function doUpdateValue(value, option) {
|
|
230
218
|
const { onUpdateValue, 'onUpdate:value': _onUpdateValue } = props;
|
|
231
219
|
if (onUpdateValue)
|
|
232
|
-
call(onUpdateValue, value);
|
|
233
|
-
if (_onUpdateValue)
|
|
234
|
-
call(_onUpdateValue, value);
|
|
220
|
+
call(onUpdateValue, value, option);
|
|
221
|
+
if (_onUpdateValue) {
|
|
222
|
+
call(_onUpdateValue, value, option);
|
|
223
|
+
}
|
|
235
224
|
uncontrolledValueRef.value = value;
|
|
236
225
|
nTriggerFormInput();
|
|
237
226
|
nTriggerFormChange();
|
|
238
227
|
}
|
|
228
|
+
function doUpdateIndeterminateKeys(value, option) {
|
|
229
|
+
const { onUpdateIndeterminateKeys, 'onUpdate:indeterminateKeys': _onUpdateIndeterminateKeys } = props;
|
|
230
|
+
if (onUpdateIndeterminateKeys) {
|
|
231
|
+
call(onUpdateIndeterminateKeys, value, option);
|
|
232
|
+
}
|
|
233
|
+
if (_onUpdateIndeterminateKeys) {
|
|
234
|
+
call(_onUpdateIndeterminateKeys, value, option);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
239
237
|
function doUpdateExpandedKeys(keys) {
|
|
240
238
|
const { onUpdateExpandedKeys, 'onUpdate:expandedKeys': _onUpdateExpandedKeys } = props;
|
|
241
239
|
if (onUpdateExpandedKeys)
|
|
@@ -294,16 +292,19 @@ export default defineComponent({
|
|
|
294
292
|
}
|
|
295
293
|
}
|
|
296
294
|
}
|
|
297
|
-
function
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
295
|
+
function getOptionsByKeys(keys) {
|
|
296
|
+
const { value: { getNode } } = dataTreeMateRef;
|
|
297
|
+
return keys.map((key) => { var _a; return ((_a = getNode(key)) === null || _a === void 0 ? void 0 : _a.rawNode) || null; });
|
|
298
|
+
}
|
|
299
|
+
function handleUpdateCheckedKeys(keys) {
|
|
300
|
+
const options = getOptionsByKeys(keys);
|
|
302
301
|
if (props.multiple) {
|
|
303
|
-
doUpdateValue(keys);
|
|
302
|
+
doUpdateValue(keys, options);
|
|
304
303
|
}
|
|
305
304
|
else {
|
|
306
|
-
|
|
305
|
+
keys.length
|
|
306
|
+
? doUpdateValue(keys[0], options[0] || null)
|
|
307
|
+
: doUpdateValue(null, null);
|
|
307
308
|
closeMenu();
|
|
308
309
|
if (!props.filterable) {
|
|
309
310
|
// Currently it is not necessary. However if there is an action slot,
|
|
@@ -316,14 +317,9 @@ export default defineComponent({
|
|
|
316
317
|
patternRef.value = '';
|
|
317
318
|
}
|
|
318
319
|
}
|
|
319
|
-
function
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
doUpdateValue(keys);
|
|
323
|
-
if (props.filterable) {
|
|
324
|
-
focusSelectionInput();
|
|
325
|
-
patternRef.value = '';
|
|
326
|
-
}
|
|
320
|
+
function handleUpdateIndeterminateKeys(keys) {
|
|
321
|
+
if (props.checkable) {
|
|
322
|
+
doUpdateIndeterminateKeys(keys, getOptionsByKeys(keys));
|
|
327
323
|
}
|
|
328
324
|
}
|
|
329
325
|
function handleTriggerFocus(e) {
|
|
@@ -365,10 +361,10 @@ export default defineComponent({
|
|
|
365
361
|
closeMenu();
|
|
366
362
|
}
|
|
367
363
|
if (multiple) {
|
|
368
|
-
doUpdateValue([]);
|
|
364
|
+
doUpdateValue([], []);
|
|
369
365
|
}
|
|
370
366
|
else {
|
|
371
|
-
doUpdateValue(null);
|
|
367
|
+
doUpdateValue(null, null);
|
|
372
368
|
}
|
|
373
369
|
}
|
|
374
370
|
function handleDeleteOption(option) {
|
|
@@ -381,12 +377,12 @@ export default defineComponent({
|
|
|
381
377
|
const { checkedKeys } = dataTreeMateRef.value.uncheck(option.value, mergedValue, {
|
|
382
378
|
cascade: mergedCascadeRef.value
|
|
383
379
|
});
|
|
384
|
-
doUpdateValue(checkedKeys);
|
|
380
|
+
doUpdateValue(checkedKeys, getOptionsByKeys(checkedKeys));
|
|
385
381
|
}
|
|
386
382
|
else {
|
|
387
383
|
const nextValue = Array.from(mergedValue);
|
|
388
384
|
nextValue.splice(index, 1);
|
|
389
|
-
doUpdateValue(nextValue);
|
|
385
|
+
doUpdateValue(nextValue, getOptionsByKeys(nextValue));
|
|
390
386
|
}
|
|
391
387
|
}
|
|
392
388
|
}
|
|
@@ -504,8 +500,8 @@ export default defineComponent({
|
|
|
504
500
|
handleMenuLeave,
|
|
505
501
|
handleTriggerClick,
|
|
506
502
|
handleMenuClickoutside,
|
|
507
|
-
handleUpdateSelectedKeys,
|
|
508
503
|
handleUpdateCheckedKeys,
|
|
504
|
+
handleUpdateIndeterminateKeys,
|
|
509
505
|
handleTriggerFocus,
|
|
510
506
|
handleTriggerBlur,
|
|
511
507
|
handleMenuFocusin,
|
|
@@ -545,8 +541,8 @@ export default defineComponent({
|
|
|
545
541
|
return null;
|
|
546
542
|
const { mergedClsPrefix, filteredTreeInfo, checkable, multiple } = this;
|
|
547
543
|
return withDirectives(h("div", { class: `${mergedClsPrefix}-tree-select-menu`, ref: "menuElRef", style: this.cssVars, tabindex: 0, onMousedown: this.handleMenuMousedown, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown, onFocusin: this.handleMenuFocusin, onFocusout: this.handleMenuFocusout },
|
|
548
|
-
filteredTreeInfo.filteredTree.length ? (h(NTree, { ref: "treeInstRef", blockLine: true, animated: false, data: filteredTreeInfo.filteredTree, cancelable: multiple, labelField: this.labelField, theme: mergedTheme.peers.Tree, themeOverrides: mergedTheme.peerOverrides.Tree, defaultExpandAll: this.defaultExpandAll, defaultExpandedKeys: this.defaultExpandedKeys, expandedKeys: this.mergedExpandedKeys, checkedKeys: this.treeCheckedKeys, selectedKeys: this.treeSelectedKeys, checkable: checkable,
|
|
549
|
-
this.virtualScroll, internalDataTreeMate: this.dataTreeMate, internalDisplayTreeMate: this.displayTreeMate, internalHighlightKeySet: filteredTreeInfo.highlightKeySet,
|
|
544
|
+
filteredTreeInfo.filteredTree.length ? (h(NTree, { ref: "treeInstRef", blockLine: true, animated: false, data: filteredTreeInfo.filteredTree, cancelable: multiple, labelField: this.labelField, theme: mergedTheme.peers.Tree, themeOverrides: mergedTheme.peerOverrides.Tree, defaultExpandAll: this.defaultExpandAll, defaultExpandedKeys: this.defaultExpandedKeys, expandedKeys: this.mergedExpandedKeys, checkedKeys: this.treeCheckedKeys, selectedKeys: this.treeSelectedKeys, checkable: checkable, checkStrategy: this.checkStrategy, cascade: this.mergedCascade, leafOnly: this.leafOnly, multiple: this.multiple, virtualScroll: this.consistentMenuWidth &&
|
|
545
|
+
this.virtualScroll, internalDataTreeMate: this.dataTreeMate, internalDisplayTreeMate: this.displayTreeMate, internalHighlightKeySet: filteredTreeInfo.highlightKeySet, internalUnifySelectCheck: true, internalScrollable: true, internalScrollablePadding: this.menuPadding, internalFocusable: false, internalCheckboxFocusable: false, onUpdateCheckedKeys: this.handleUpdateCheckedKeys, onUpdateIndeterminateKeys: this.handleUpdateIndeterminateKeys, onUpdateExpandedKeys: this.doUpdateExpandedKeys })) : (h("div", { class: `${mergedClsPrefix}-tree-select-menu__empty` },
|
|
550
546
|
h(NEmpty, { theme: mergedTheme.peers.Empty, themeOverrides: mergedTheme.peerOverrides.Empty }))),
|
|
551
547
|
h(NBaseFocusDetector, { onFocus: this.handleTabOut })), [[clickoutside, this.handleMenuClickoutside]]);
|
|
552
548
|
}
|