naive-ui 2.18.0 → 2.19.1
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 +8 -0
- 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 -0
- package/es/_internal/selection/styles/_common.js +2 -1
- package/es/_internal/selection/styles/light.d.ts +2 -0
- package/es/_styles/common/light.js +1 -1
- package/es/_utils/naive/mutable.d.ts +2 -2
- 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 +20 -0
- package/es/cascader/src/Cascader.js +28 -19
- package/es/cascader/src/CascaderMenu.js +17 -15
- package/es/cascader/src/CascaderOption.d.ts +2 -0
- package/es/cascader/src/CascaderSelectMenu.d.ts +2 -0
- package/es/cascader/src/CascaderSubmenu.d.ts +2 -0
- 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 +2 -0
- 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 +22 -0
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +4 -0
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +4 -0
- package/es/data-table/src/TableParts/Body.d.ts +4 -0
- package/es/data-table/src/TableParts/Cell.d.ts +8 -0
- package/es/data-table/src/TableParts/Header.d.ts +4 -0
- package/es/data-table/styles/light.d.ts +2 -0
- 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/Dialog.d.ts +4 -16
- package/es/dialog/src/Dialog.js +2 -8
- package/es/dialog/src/DialogEnvironment.d.ts +28 -36
- package/es/dialog/src/DialogEnvironment.js +2 -2
- package/es/dialog/src/DialogProvider.d.ts +18 -15
- package/es/dialog/src/DialogProvider.js +2 -1
- 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/grid/src/GridItem.d.ts +2 -2
- package/es/grid/src/GridItem.js +1 -1
- package/es/input-number/src/InputNumber.d.ts +5 -0
- package/es/input-number/src/InputNumber.js +9 -8
- 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/zhCN.js +1 -1
- 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 +7 -8
- package/es/modal/src/Modal.d.ts +40 -71
- package/es/modal/src/Modal.js +18 -39
- package/es/modal/src/presetProps.d.ts +4 -9
- 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 +23 -1
- package/es/pagination/styles/light.d.ts +2 -0
- 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 +31 -3
- package/es/select/src/Select.js +55 -56
- package/es/select/src/interface.d.ts +2 -2
- package/es/select/styles/light.d.ts +2 -0
- 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/steps/src/Steps.js +2 -2
- 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/timeline/src/Timeline.d.ts +67 -0
- package/es/timeline/src/Timeline.js +1 -1
- package/es/timeline/src/TimelineItem.d.ts +2 -0
- package/es/timeline/src/TimelineItem.js +11 -11
- package/es/timeline/src/styles/index.cssr.js +26 -17
- package/es/timeline/styles/_common.d.ts +2 -0
- package/es/timeline/styles/_common.js +3 -1
- package/es/timeline/styles/dark.js +1 -1
- package/es/timeline/styles/light.d.ts +7 -0
- package/es/timeline/styles/light.js +1 -1
- 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 +23 -1
- 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 +1 -0
- 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 +8 -0
- 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 -0
- package/lib/_internal/selection/styles/_common.js +2 -1
- package/lib/_internal/selection/styles/light.d.ts +2 -0
- package/lib/_styles/common/light.js +1 -1
- package/lib/_utils/naive/mutable.d.ts +2 -2
- 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 +20 -0
- package/lib/cascader/src/Cascader.js +28 -19
- package/lib/cascader/src/CascaderMenu.js +16 -14
- package/lib/cascader/src/CascaderOption.d.ts +2 -0
- package/lib/cascader/src/CascaderSelectMenu.d.ts +2 -0
- package/lib/cascader/src/CascaderSubmenu.d.ts +2 -0
- 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 +2 -0
- 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 +22 -0
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +4 -0
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +4 -0
- package/lib/data-table/src/TableParts/Body.d.ts +4 -0
- package/lib/data-table/src/TableParts/Cell.d.ts +8 -0
- package/lib/data-table/src/TableParts/Header.d.ts +4 -0
- package/lib/data-table/styles/light.d.ts +2 -0
- 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/Dialog.d.ts +4 -16
- package/lib/dialog/src/Dialog.js +2 -8
- package/lib/dialog/src/DialogEnvironment.d.ts +28 -36
- package/lib/dialog/src/DialogEnvironment.js +2 -2
- package/lib/dialog/src/DialogProvider.d.ts +18 -15
- package/lib/dialog/src/DialogProvider.js +2 -1
- 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/grid/src/GridItem.d.ts +2 -2
- package/lib/grid/src/GridItem.js +1 -1
- package/lib/input-number/src/InputNumber.d.ts +5 -0
- package/lib/input-number/src/InputNumber.js +9 -8
- 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/zhCN.js +1 -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 +7 -8
- package/lib/modal/src/Modal.d.ts +40 -71
- package/lib/modal/src/Modal.js +17 -38
- package/lib/modal/src/presetProps.d.ts +4 -9
- 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 +23 -1
- package/lib/pagination/styles/light.d.ts +2 -0
- 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 +31 -3
- package/lib/select/src/Select.js +55 -56
- package/lib/select/src/interface.d.ts +2 -2
- package/lib/select/styles/light.d.ts +2 -0
- 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/steps/src/Steps.js +1 -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/timeline/src/Timeline.d.ts +67 -0
- package/lib/timeline/src/Timeline.js +1 -1
- package/lib/timeline/src/TimelineItem.d.ts +2 -0
- package/lib/timeline/src/TimelineItem.js +10 -10
- package/lib/timeline/src/styles/index.cssr.js +27 -18
- package/lib/timeline/styles/_common.d.ts +2 -0
- package/lib/timeline/styles/_common.js +3 -1
- package/lib/timeline/styles/dark.js +1 -1
- package/lib/timeline/styles/light.d.ts +7 -0
- package/lib/timeline/styles/light.js +1 -1
- 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 +23 -1
- 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 +1 -0
- 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 +8 -6
- package/web-types.json +248 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, computed, inject, h, renderSlot } from 'vue';
|
|
2
|
-
import { createKey, throwError } from '../../_utils';
|
|
2
|
+
import { createKey, formatLength, throwError } from '../../_utils';
|
|
3
3
|
import { timelineInjectionKey } from './Timeline';
|
|
4
4
|
const timelineItemProps = {
|
|
5
5
|
time: [String, Number],
|
|
@@ -22,12 +22,13 @@ export default defineComponent({
|
|
|
22
22
|
return {
|
|
23
23
|
mergedClsPrefix: NTimeline.mergedClsPrefixRef,
|
|
24
24
|
cssVars: computed(() => {
|
|
25
|
-
const { props: { size }, mergedThemeRef } = NTimeline;
|
|
25
|
+
const { props: { size, iconSize: iconSizeProp }, mergedThemeRef } = NTimeline;
|
|
26
26
|
const { type } = props;
|
|
27
|
-
const { self: { titleTextColor, contentTextColor, metaTextColor, lineColor, titleFontWeight, contentFontSize, [createKey('titleMargin', size)]: titleMargin, [createKey('titleFontSize', size)]: titleFontSize, [createKey('circleBorder', type)]: circleBorder }, common: { cubicBezierEaseInOut } } = mergedThemeRef.value;
|
|
27
|
+
const { self: { titleTextColor, contentTextColor, metaTextColor, lineColor, titleFontWeight, contentFontSize, [createKey('iconSize', size)]: iconSize, [createKey('titleMargin', size)]: titleMargin, [createKey('titleFontSize', size)]: titleFontSize, [createKey('circleBorder', type)]: circleBorder, [createKey('iconColor', type)]: iconColor }, common: { cubicBezierEaseInOut } } = mergedThemeRef.value;
|
|
28
28
|
return {
|
|
29
29
|
'--bezier': cubicBezierEaseInOut,
|
|
30
30
|
'--circle-border': circleBorder,
|
|
31
|
+
'--icon-color': iconColor,
|
|
31
32
|
'--content-font-size': contentFontSize,
|
|
32
33
|
'--content-text-color': contentTextColor,
|
|
33
34
|
'--line-color': lineColor,
|
|
@@ -35,25 +36,24 @@ export default defineComponent({
|
|
|
35
36
|
'--title-font-size': titleFontSize,
|
|
36
37
|
'--title-font-weight': titleFontWeight,
|
|
37
38
|
'--title-margin': titleMargin,
|
|
38
|
-
'--title-text-color': titleTextColor
|
|
39
|
+
'--title-text-color': titleTextColor,
|
|
40
|
+
'--icon-size': formatLength(iconSizeProp) || iconSize
|
|
39
41
|
};
|
|
40
42
|
})
|
|
41
43
|
};
|
|
42
44
|
},
|
|
43
45
|
render() {
|
|
44
|
-
const { mergedClsPrefix, color } = this;
|
|
46
|
+
const { mergedClsPrefix, color, $slots } = this;
|
|
45
47
|
return (h("div", { class: [
|
|
46
48
|
`${mergedClsPrefix}-timeline-item`,
|
|
47
49
|
`${mergedClsPrefix}-timeline-item--${this.type}-type`
|
|
48
50
|
], style: this.cssVars },
|
|
49
51
|
h("div", { class: `${mergedClsPrefix}-timeline-item-timeline` },
|
|
50
52
|
h("div", { class: `${mergedClsPrefix}-timeline-item-timeline__line` }),
|
|
51
|
-
h("div", { class: `${mergedClsPrefix}-timeline-item-timeline__circle`, style: { borderColor: color } })),
|
|
53
|
+
$slots.icon ? (h("div", { class: `${mergedClsPrefix}-timeline-item-timeline__icon`, style: { color: color } }, $slots.icon())) : (h("div", { class: `${mergedClsPrefix}-timeline-item-timeline__circle`, style: { borderColor: color } }))),
|
|
52
54
|
h("div", { class: `${mergedClsPrefix}-timeline-item-content` },
|
|
53
|
-
this.title ||
|
|
54
|
-
h("div", { class: `${mergedClsPrefix}-timeline-item-content__content` }, renderSlot(
|
|
55
|
-
|
|
56
|
-
])),
|
|
57
|
-
h("div", { class: `${mergedClsPrefix}-timeline-item-content__meta` }, renderSlot(this.$slots, 'footer', undefined, () => [this.time])))));
|
|
55
|
+
this.title || $slots.header ? (h("div", { class: `${mergedClsPrefix}-timeline-item-content__title` }, renderSlot($slots, 'header', undefined, () => [this.title]))) : null,
|
|
56
|
+
h("div", { class: `${mergedClsPrefix}-timeline-item-content__content` }, renderSlot($slots, 'default', undefined, () => [this.content])),
|
|
57
|
+
h("div", { class: `${mergedClsPrefix}-timeline-item-content__meta` }, renderSlot($slots, 'footer', undefined, () => [this.time])))));
|
|
58
58
|
}
|
|
59
59
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { c, cB, cE, cM } from '../../../_utils/cssr';
|
|
1
|
+
import { c, cB, cE, cM } from '../../../_utils/cssr';
|
|
2
|
+
const lineHeight = 1.25; // vars:
|
|
2
3
|
// --bezier
|
|
3
4
|
// --circle-border
|
|
4
5
|
// --content-font-size
|
|
@@ -9,40 +10,41 @@ import { c, cB, cE, cM } from '../../../_utils/cssr'; // vars:
|
|
|
9
10
|
// --title-font-weight
|
|
10
11
|
// --title-margin
|
|
11
12
|
// --title-text-color
|
|
13
|
+
// --icon-size
|
|
12
14
|
|
|
13
15
|
export default cB('timeline', `
|
|
14
16
|
position: relative;
|
|
15
17
|
width: 100%;
|
|
16
18
|
display: flex;
|
|
17
19
|
flex-direction: column;
|
|
18
|
-
line-height:
|
|
20
|
+
line-height: ${lineHeight};
|
|
19
21
|
`, [cM('horizontal', `
|
|
20
22
|
flex-direction: row;
|
|
21
23
|
`, [cB('timeline-item', `
|
|
22
24
|
flex-shrink: 0;
|
|
23
25
|
padding-right: 40px;
|
|
24
26
|
`, [cB('timeline-item-content', `
|
|
25
|
-
margin-top:
|
|
27
|
+
margin-top: calc(var(--icon-size) + 12px);
|
|
26
28
|
`, [cE('meta', `
|
|
27
29
|
margin-top: 6px;
|
|
28
30
|
margin-bottom: unset;
|
|
29
31
|
`)]), cB('timeline-item-timeline', `
|
|
30
32
|
width: 100%;
|
|
31
|
-
height:
|
|
33
|
+
height: calc(var(--icon-size) + 12px);
|
|
32
34
|
`, [cE('line', `
|
|
33
|
-
left:
|
|
34
|
-
top:
|
|
35
|
+
left: var(--icon-size);
|
|
36
|
+
top: calc(var(--icon-size) / 2 - 1px);
|
|
35
37
|
right: 0px;
|
|
36
38
|
width: unset;
|
|
37
39
|
height: 2px;
|
|
38
40
|
`)])])]), cM('right-placement', [cB('timeline-item', [cB('timeline-item-content', `
|
|
39
41
|
text-align: right;
|
|
40
|
-
margin-right:
|
|
42
|
+
margin-right: calc(var(--icon-size) + 12px);
|
|
41
43
|
`), cB('timeline-item-timeline', `
|
|
42
|
-
width:
|
|
44
|
+
width: var(--icon-size);
|
|
43
45
|
right: 0;
|
|
44
46
|
`)])]), cM('left-placement', [cB('timeline-item', [cB('timeline-item-content', `
|
|
45
|
-
margin-left:
|
|
47
|
+
margin-left: calc(var(--icon-size) + 12px);
|
|
46
48
|
`), cB('timeline-item-timeline', `
|
|
47
49
|
left: 0;
|
|
48
50
|
`)])]), cB('timeline-item', `
|
|
@@ -69,25 +71,32 @@ export default cB('timeline', `
|
|
|
69
71
|
margin-bottom: 20px;
|
|
70
72
|
color: var(--meta-text-color);
|
|
71
73
|
`)]), cB('timeline-item-timeline', `
|
|
72
|
-
width:
|
|
74
|
+
width: calc(var(--icon-size) + 12px);
|
|
73
75
|
position: absolute;
|
|
74
|
-
top:
|
|
75
|
-
bottom: 0;
|
|
76
|
+
top: calc(var(--title-font-size) * ${lineHeight} / 2 - var(--icon-size) / 2);
|
|
76
77
|
height: 100%;
|
|
77
78
|
`, [cE('circle', `
|
|
78
79
|
border: var(--circle-border);
|
|
79
80
|
transition:
|
|
80
81
|
background-color .3s var(--bezier),
|
|
81
82
|
border-color .3s var(--bezier);
|
|
82
|
-
width:
|
|
83
|
-
height:
|
|
84
|
-
border-radius:
|
|
83
|
+
width: var(--icon-size);
|
|
84
|
+
height: var(--icon-size);
|
|
85
|
+
border-radius: var(--icon-size);
|
|
85
86
|
box-sizing: border-box;
|
|
87
|
+
`), cE('icon', `
|
|
88
|
+
color: var(--icon-color);
|
|
89
|
+
font-size: var(--icon-size);
|
|
90
|
+
height: var(--icon-size);
|
|
91
|
+
width: var(--icon-size);
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
justify-content: center;
|
|
86
95
|
`), cE('line', `
|
|
87
96
|
transition: background-color .3s var(--bezier);
|
|
88
97
|
position: absolute;
|
|
89
|
-
top:
|
|
90
|
-
left:
|
|
98
|
+
top: var(--icon-size);
|
|
99
|
+
left: calc(var(--icon-size) / 2 - 1px);
|
|
91
100
|
bottom: 0px;
|
|
92
101
|
width: 2px;
|
|
93
102
|
background-color: var(--line-color);
|
|
@@ -5,7 +5,7 @@ const timelineDark = {
|
|
|
5
5
|
common: commonDark,
|
|
6
6
|
self(vars) {
|
|
7
7
|
const { textColor3, infoColorSuppl, errorColorSuppl, successColorSuppl, warningColorSuppl, textColor1, textColor2, railColor, fontWeightStrong, fontSize } = vars;
|
|
8
|
-
return Object.assign(Object.assign({}, sizeVariables), { contentFontSize: fontSize, titleFontWeight: fontWeightStrong, circleBorder: `2px solid ${textColor3}`, circleBorderInfo: `2px solid ${infoColorSuppl}`, circleBorderError: `2px solid ${errorColorSuppl}`, circleBorderSuccess: `2px solid ${successColorSuppl}`, circleBorderWarning: `2px solid ${warningColorSuppl}`, titleTextColor: textColor1, contentTextColor: textColor2, metaTextColor: textColor3, lineColor: railColor });
|
|
8
|
+
return Object.assign(Object.assign({}, sizeVariables), { contentFontSize: fontSize, titleFontWeight: fontWeightStrong, circleBorder: `2px solid ${textColor3}`, circleBorderInfo: `2px solid ${infoColorSuppl}`, circleBorderError: `2px solid ${errorColorSuppl}`, circleBorderSuccess: `2px solid ${successColorSuppl}`, circleBorderWarning: `2px solid ${warningColorSuppl}`, iconColor: textColor3, iconColorInfo: infoColorSuppl, iconColorError: errorColorSuppl, iconColorSuccess: successColorSuppl, iconColorWarning: warningColorSuppl, titleTextColor: textColor1, contentTextColor: textColor2, metaTextColor: textColor3, lineColor: railColor });
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
11
|
export default timelineDark;
|
|
@@ -8,6 +8,11 @@ declare const self: (vars: ThemeCommonVars) => {
|
|
|
8
8
|
circleBorderError: string;
|
|
9
9
|
circleBorderSuccess: string;
|
|
10
10
|
circleBorderWarning: string;
|
|
11
|
+
iconColor: string;
|
|
12
|
+
iconColorInfo: string;
|
|
13
|
+
iconColorError: string;
|
|
14
|
+
iconColorSuccess: string;
|
|
15
|
+
iconColorWarning: string;
|
|
11
16
|
titleTextColor: string;
|
|
12
17
|
contentTextColor: string;
|
|
13
18
|
metaTextColor: string;
|
|
@@ -16,6 +21,8 @@ declare const self: (vars: ThemeCommonVars) => {
|
|
|
16
21
|
titleMarginLarge: string;
|
|
17
22
|
titleFontSizeMedium: string;
|
|
18
23
|
titleFontSizeLarge: string;
|
|
24
|
+
iconSizeMedium: string;
|
|
25
|
+
iconSizeLarge: string;
|
|
19
26
|
};
|
|
20
27
|
export declare type TimelineThemeVars = ReturnType<typeof self>;
|
|
21
28
|
declare const timelineLight: Theme<'Timeline', TimelineThemeVars>;
|
|
@@ -2,7 +2,7 @@ import sizeVariables from './_common';
|
|
|
2
2
|
import { commonLight } from '../../_styles/common';
|
|
3
3
|
const self = (vars) => {
|
|
4
4
|
const { textColor3, infoColor, errorColor, successColor, warningColor, textColor1, textColor2, railColor, fontWeightStrong, fontSize } = vars;
|
|
5
|
-
return Object.assign(Object.assign({}, sizeVariables), { contentFontSize: fontSize, titleFontWeight: fontWeightStrong, circleBorder: `2px solid ${textColor3}`, circleBorderInfo: `2px solid ${infoColor}`, circleBorderError: `2px solid ${errorColor}`, circleBorderSuccess: `2px solid ${successColor}`, circleBorderWarning: `2px solid ${warningColor}`, titleTextColor: textColor1, contentTextColor: textColor2, metaTextColor: textColor3, lineColor: railColor });
|
|
5
|
+
return Object.assign(Object.assign({}, sizeVariables), { contentFontSize: fontSize, titleFontWeight: fontWeightStrong, circleBorder: `2px solid ${textColor3}`, circleBorderInfo: `2px solid ${infoColor}`, circleBorderError: `2px solid ${errorColor}`, circleBorderSuccess: `2px solid ${successColor}`, circleBorderWarning: `2px solid ${warningColor}`, iconColor: textColor3, iconColorInfo: infoColor, iconColorError: errorColor, iconColorSuccess: successColor, iconColorWarning: warningColor, titleTextColor: textColor1, contentTextColor: textColor2, metaTextColor: textColor3, lineColor: railColor });
|
|
6
6
|
};
|
|
7
7
|
const timelineLight = {
|
|
8
8
|
name: 'Timeline',
|
|
@@ -123,16 +123,9 @@ declare const tooltipProps: {
|
|
|
123
123
|
onClickoutside: import("vue").PropType<(e: MouseEvent) => void>;
|
|
124
124
|
'onUpdate:show': import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void>>;
|
|
125
125
|
onUpdateShow: import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void>>;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
default: undefined;
|
|
130
|
-
};
|
|
131
|
-
onHide: {
|
|
132
|
-
type: import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void> | undefined>;
|
|
133
|
-
validator: () => boolean;
|
|
134
|
-
default: undefined;
|
|
135
|
-
};
|
|
126
|
+
zIndex: NumberConstructor;
|
|
127
|
+
onShow: import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void> | undefined>;
|
|
128
|
+
onHide: import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void> | undefined>;
|
|
136
129
|
arrow: {
|
|
137
130
|
type: import("vue").PropType<boolean | undefined>;
|
|
138
131
|
default: undefined;
|
|
@@ -263,16 +256,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
263
256
|
onClickoutside: import("vue").PropType<(e: MouseEvent) => void>;
|
|
264
257
|
'onUpdate:show': import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void>>;
|
|
265
258
|
onUpdateShow: import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void>>;
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
default: undefined;
|
|
270
|
-
};
|
|
271
|
-
onHide: {
|
|
272
|
-
type: import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void> | undefined>;
|
|
273
|
-
validator: () => boolean;
|
|
274
|
-
default: undefined;
|
|
275
|
-
};
|
|
259
|
+
zIndex: NumberConstructor;
|
|
260
|
+
onShow: import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void> | undefined>;
|
|
261
|
+
onHide: import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void> | undefined>;
|
|
276
262
|
arrow: {
|
|
277
263
|
type: import("vue").PropType<boolean | undefined>;
|
|
278
264
|
default: undefined;
|
|
@@ -450,6 +436,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
450
436
|
onClickoutside?: unknown;
|
|
451
437
|
'onUpdate:show'?: unknown;
|
|
452
438
|
onUpdateShow?: unknown;
|
|
439
|
+
zIndex?: unknown;
|
|
453
440
|
onShow?: unknown;
|
|
454
441
|
onHide?: unknown;
|
|
455
442
|
arrow?: unknown;
|
|
@@ -476,6 +463,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
476
463
|
maxWidth?: number | undefined;
|
|
477
464
|
minWidth?: number | undefined;
|
|
478
465
|
width?: number | "trigger" | undefined;
|
|
466
|
+
zIndex?: number | undefined;
|
|
479
467
|
theme?: import("../../_mixins").Theme<"Tooltip", {
|
|
480
468
|
borderRadius: string;
|
|
481
469
|
boxShadow: string;
|
|
@@ -566,8 +554,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
566
554
|
animated: boolean;
|
|
567
555
|
defaultShow: boolean;
|
|
568
556
|
internalExtraClass: string[];
|
|
569
|
-
onShow: import("../../_utils").MaybeArray<(value: boolean) => void> | undefined;
|
|
570
|
-
onHide: import("../../_utils").MaybeArray<(value: boolean) => void> | undefined;
|
|
571
557
|
arrow: boolean | undefined;
|
|
572
558
|
}>;
|
|
573
559
|
export default _default;
|
|
@@ -513,8 +513,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
513
513
|
disabled: boolean;
|
|
514
514
|
itemSize: number;
|
|
515
515
|
virtualScroll: boolean;
|
|
516
|
-
options: Option[];
|
|
517
516
|
isMounted: boolean;
|
|
517
|
+
options: Option[];
|
|
518
518
|
isInputing: boolean;
|
|
519
519
|
} & {}>, {
|
|
520
520
|
source: boolean;
|
package/es/tree/src/Tree.d.ts
CHANGED
|
@@ -24,6 +24,9 @@ export declare const treeSharedProps: {
|
|
|
24
24
|
readonly type: PropType<Key[]>;
|
|
25
25
|
readonly default: () => never[];
|
|
26
26
|
};
|
|
27
|
+
readonly indeterminateKeys: PropType<Key[]>;
|
|
28
|
+
readonly onUpdateIndeterminateKeys: PropType<MaybeArray<(value: Key[]) => void>>;
|
|
29
|
+
readonly 'onUpdate:indeterminateKeys': PropType<MaybeArray<(value: Key[]) => void>>;
|
|
27
30
|
readonly onUpdateExpandedKeys: PropType<MaybeArray<(value: Key[]) => void>>;
|
|
28
31
|
readonly 'onUpdate:expandedKeys': PropType<MaybeArray<(value: Key[]) => void>>;
|
|
29
32
|
};
|
|
@@ -33,7 +36,7 @@ declare const treeProps: {
|
|
|
33
36
|
readonly internalDataTreeMate: PropType<TreeMate<TreeOption, TreeOption, TreeOption>>;
|
|
34
37
|
readonly internalDisplayTreeMate: PropType<TreeMate<TreeOption, TreeOption, TreeOption>>;
|
|
35
38
|
readonly internalHighlightKeySet: PropType<Set<Key>>;
|
|
36
|
-
readonly
|
|
39
|
+
readonly internalUnifySelectCheck: BooleanConstructor;
|
|
37
40
|
readonly internalHideFilteredNode: BooleanConstructor;
|
|
38
41
|
readonly internalCheckboxFocusable: {
|
|
39
42
|
readonly type: BooleanConstructor;
|
|
@@ -43,7 +46,7 @@ declare const treeProps: {
|
|
|
43
46
|
readonly type: BooleanConstructor;
|
|
44
47
|
readonly default: true;
|
|
45
48
|
};
|
|
46
|
-
readonly
|
|
49
|
+
readonly checkStrategy: {
|
|
47
50
|
readonly type: PropType<CheckStrategy>;
|
|
48
51
|
readonly default: "all";
|
|
49
52
|
};
|
|
@@ -66,6 +69,9 @@ declare const treeProps: {
|
|
|
66
69
|
readonly type: PropType<Key[]>;
|
|
67
70
|
readonly default: () => never[];
|
|
68
71
|
};
|
|
72
|
+
readonly indeterminateKeys: PropType<Key[]>;
|
|
73
|
+
readonly onUpdateIndeterminateKeys: PropType<MaybeArray<(value: Key[]) => void>>;
|
|
74
|
+
readonly 'onUpdate:indeterminateKeys': PropType<MaybeArray<(value: Key[]) => void>>;
|
|
69
75
|
readonly onUpdateExpandedKeys: PropType<MaybeArray<(value: Key[]) => void>>;
|
|
70
76
|
readonly 'onUpdate:expandedKeys': PropType<MaybeArray<(value: Key[]) => void>>;
|
|
71
77
|
readonly data: {
|
|
@@ -277,7 +283,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
277
283
|
readonly internalDataTreeMate: PropType<TreeMate<TreeOption, TreeOption, TreeOption>>;
|
|
278
284
|
readonly internalDisplayTreeMate: PropType<TreeMate<TreeOption, TreeOption, TreeOption>>;
|
|
279
285
|
readonly internalHighlightKeySet: PropType<Set<Key>>;
|
|
280
|
-
readonly
|
|
286
|
+
readonly internalUnifySelectCheck: BooleanConstructor;
|
|
281
287
|
readonly internalHideFilteredNode: BooleanConstructor;
|
|
282
288
|
readonly internalCheckboxFocusable: {
|
|
283
289
|
readonly type: BooleanConstructor;
|
|
@@ -287,7 +293,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
287
293
|
readonly type: BooleanConstructor;
|
|
288
294
|
readonly default: true;
|
|
289
295
|
};
|
|
290
|
-
readonly
|
|
296
|
+
readonly checkStrategy: {
|
|
291
297
|
readonly type: PropType<CheckStrategy>;
|
|
292
298
|
readonly default: "all";
|
|
293
299
|
};
|
|
@@ -310,6 +316,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
310
316
|
readonly type: PropType<Key[]>;
|
|
311
317
|
readonly default: () => never[];
|
|
312
318
|
};
|
|
319
|
+
readonly indeterminateKeys: PropType<Key[]>;
|
|
320
|
+
readonly onUpdateIndeterminateKeys: PropType<MaybeArray<(value: Key[]) => void>>;
|
|
321
|
+
readonly 'onUpdate:indeterminateKeys': PropType<MaybeArray<(value: Key[]) => void>>;
|
|
313
322
|
readonly onUpdateExpandedKeys: PropType<MaybeArray<(value: Key[]) => void>>;
|
|
314
323
|
readonly 'onUpdate:expandedKeys': PropType<MaybeArray<(value: Key[]) => void>>;
|
|
315
324
|
readonly data: {
|
|
@@ -962,11 +971,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
962
971
|
readonly internalDataTreeMate?: unknown;
|
|
963
972
|
readonly internalDisplayTreeMate?: unknown;
|
|
964
973
|
readonly internalHighlightKeySet?: unknown;
|
|
965
|
-
readonly
|
|
974
|
+
readonly internalUnifySelectCheck?: unknown;
|
|
966
975
|
readonly internalHideFilteredNode?: unknown;
|
|
967
976
|
readonly internalCheckboxFocusable?: unknown;
|
|
968
977
|
readonly internalFocusable?: unknown;
|
|
969
|
-
readonly
|
|
978
|
+
readonly checkStrategy?: unknown;
|
|
970
979
|
readonly filter?: unknown;
|
|
971
980
|
readonly defaultExpandAll?: unknown;
|
|
972
981
|
readonly expandedKeys?: unknown;
|
|
@@ -974,6 +983,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
974
983
|
readonly labelField?: unknown;
|
|
975
984
|
readonly childrenField?: unknown;
|
|
976
985
|
readonly defaultExpandedKeys?: unknown;
|
|
986
|
+
readonly indeterminateKeys?: unknown;
|
|
987
|
+
readonly onUpdateIndeterminateKeys?: unknown;
|
|
988
|
+
readonly 'onUpdate:indeterminateKeys'?: unknown;
|
|
977
989
|
readonly onUpdateExpandedKeys?: unknown;
|
|
978
990
|
readonly 'onUpdate:expandedKeys'?: unknown;
|
|
979
991
|
readonly data?: unknown;
|
|
@@ -1028,6 +1040,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1028
1040
|
remote: boolean;
|
|
1029
1041
|
cascade: boolean;
|
|
1030
1042
|
indent: number;
|
|
1043
|
+
checkStrategy: CheckStrategy;
|
|
1031
1044
|
leafOnly: boolean;
|
|
1032
1045
|
labelField: string;
|
|
1033
1046
|
childrenField: string;
|
|
@@ -1037,11 +1050,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1037
1050
|
internalScrollable: boolean;
|
|
1038
1051
|
blockLine: boolean;
|
|
1039
1052
|
selectable: boolean;
|
|
1040
|
-
|
|
1053
|
+
internalUnifySelectCheck: boolean;
|
|
1041
1054
|
internalHideFilteredNode: boolean;
|
|
1042
1055
|
internalCheckboxFocusable: boolean;
|
|
1043
1056
|
internalFocusable: boolean;
|
|
1044
|
-
internalCheckStrategy: CheckStrategy;
|
|
1045
1057
|
expandOnDragenter: boolean;
|
|
1046
1058
|
blockNode: boolean;
|
|
1047
1059
|
defaultCheckedKeys: Key[];
|
|
@@ -1202,6 +1214,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1202
1214
|
internalDataTreeMate?: TreeMate<TreeOption, TreeOption, TreeOption> | undefined;
|
|
1203
1215
|
internalDisplayTreeMate?: TreeMate<TreeOption, TreeOption, TreeOption> | undefined;
|
|
1204
1216
|
internalHighlightKeySet?: Set<Key> | undefined;
|
|
1217
|
+
indeterminateKeys?: Key[] | undefined;
|
|
1218
|
+
onUpdateIndeterminateKeys?: MaybeArray<(value: Key[]) => void> | undefined;
|
|
1219
|
+
"onUpdate:indeterminateKeys"?: MaybeArray<(value: Key[]) => void> | undefined;
|
|
1205
1220
|
selectedKeys?: Key[] | undefined;
|
|
1206
1221
|
onUpdateCheckedKeys?: MaybeArray<(value: Key[]) => void> | undefined;
|
|
1207
1222
|
"onUpdate:checkedKeys"?: MaybeArray<(value: Key[]) => void> | undefined;
|
|
@@ -1220,6 +1235,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1220
1235
|
remote: boolean;
|
|
1221
1236
|
cascade: boolean;
|
|
1222
1237
|
indent: number;
|
|
1238
|
+
checkStrategy: CheckStrategy;
|
|
1223
1239
|
leafOnly: boolean;
|
|
1224
1240
|
labelField: string;
|
|
1225
1241
|
childrenField: string;
|
|
@@ -1229,11 +1245,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1229
1245
|
internalScrollable: boolean;
|
|
1230
1246
|
blockLine: boolean;
|
|
1231
1247
|
selectable: boolean;
|
|
1232
|
-
|
|
1248
|
+
internalUnifySelectCheck: boolean;
|
|
1233
1249
|
internalHideFilteredNode: boolean;
|
|
1234
1250
|
internalCheckboxFocusable: boolean;
|
|
1235
1251
|
internalFocusable: boolean;
|
|
1236
|
-
internalCheckStrategy: CheckStrategy;
|
|
1237
1252
|
expandOnDragenter: boolean;
|
|
1238
1253
|
blockNode: boolean;
|
|
1239
1254
|
defaultCheckedKeys: Key[];
|
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>;
|