naive-ui 2.32.0 → 2.32.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/README.zh-CN.md +1 -1
- package/dist/index.js +46388 -42920
- package/dist/index.prod.js +2 -2
- package/es/_internal/scrollbar/src/Scrollbar.js +2 -1
- package/es/_internal/select-menu/styles/light.js +1 -1
- package/es/_internal/selection/src/Selection.js +1 -1
- package/es/_utils/cssr/index.js +4 -4
- package/es/alert/src/Alert.d.ts +14 -0
- package/es/alert/src/Alert.js +11 -2
- package/es/alert/src/styles/index.cssr.js +11 -2
- package/es/alert/styles/dark.js +5 -1
- package/es/anchor/styles/light.js +2 -1
- package/es/auto-complete/src/AutoComplete.d.ts +14 -1
- package/es/auto-complete/src/AutoComplete.js +22 -16
- package/es/auto-complete/styles/light.d.ts +1 -0
- package/es/breadcrumb/styles/light.js +1 -1
- package/es/button/styles/light.js +5 -1
- package/es/card/styles/light.js +1 -1
- package/es/carousel/src/Carousel.js +7 -5
- package/es/cascader/src/Cascader.d.ts +13 -0
- package/es/cascader/src/Cascader.js +12 -4
- package/es/checkbox/src/CheckboxGroup.js +2 -2
- package/es/checkbox/styles/light.js +1 -1
- package/es/collapse/src/Collapse.d.ts +22 -0
- package/es/collapse/src/Collapse.js +4 -2
- package/es/collapse/src/CollapseItem.d.ts +6 -1
- package/es/collapse/src/CollapseItem.js +4 -2
- package/es/collapse/src/styles/index.cssr.js +10 -21
- package/es/collapse/styles/light.d.ts +2 -0
- package/es/collapse/styles/light.js +5 -3
- package/es/color-picker/src/ColorInputUnit.d.ts +1 -0
- package/es/color-picker/src/ColorPicker.d.ts +9 -0
- package/es/color-picker/src/ColorPicker.js +3 -2
- package/es/color-picker/styles/light.d.ts +1 -0
- package/es/countdown/src/Countdown.js +1 -1
- package/es/data-table/src/DataTable.d.ts +18 -0
- package/es/data-table/src/DataTable.js +6 -3
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +2 -0
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +4 -2
- package/es/data-table/src/TableParts/Body.d.ts +6 -0
- package/es/data-table/src/TableParts/Body.js +22 -14
- package/es/data-table/src/TableParts/Cell.d.ts +4 -0
- package/es/data-table/src/TableParts/ExpandTrigger.d.ts +7 -1
- package/es/data-table/src/TableParts/ExpandTrigger.js +15 -9
- package/es/data-table/src/TableParts/Header.d.ts +3 -1
- package/es/data-table/src/interface.d.ts +6 -3
- package/es/data-table/src/styles/index.cssr.js +25 -7
- package/es/data-table/src/use-expand.d.ts +3 -1
- package/es/data-table/src/use-expand.js +15 -8
- package/es/data-table/src/use-group-header.js +1 -1
- package/es/data-table/src/use-sorter.js +1 -1
- package/es/data-table/src/use-table-data.js +1 -1
- package/es/data-table/styles/light.d.ts +1 -0
- package/es/date-picker/src/DatePicker.d.ts +23 -2
- package/es/date-picker/src/DatePicker.js +4 -4
- package/es/date-picker/src/panel/date.d.ts +6 -3
- package/es/date-picker/src/panel/daterange.d.ts +3 -0
- package/es/date-picker/src/panel/datetime.d.ts +3 -0
- package/es/date-picker/src/panel/datetimerange.d.ts +3 -0
- package/es/date-picker/src/panel/month.d.ts +3 -0
- package/es/date-picker/src/panel/monthrange.d.ts +3 -0
- package/es/date-picker/src/panel/panelHeader.d.ts +6 -0
- package/es/date-picker/src/panel/panelHeader.js +3 -1
- package/es/date-picker/src/panel/use-calendar.d.ts +3 -0
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +3 -0
- package/es/date-picker/src/panel/use-panel-common.d.ts +3 -0
- package/es/date-picker/src/styles/index.cssr.js +6 -6
- package/es/date-picker/styles/light.d.ts +2 -0
- package/es/descriptions/styles/light.js +1 -1
- package/es/drawer/src/Drawer.d.ts +8 -8
- package/es/drawer/src/Drawer.js +3 -3
- package/es/drawer/src/DrawerBodyWrapper.d.ts +1 -0
- package/es/drawer/src/DrawerBodyWrapper.js +6 -0
- package/es/drawer/src/styles/rtl.cssr.d.ts +2 -0
- package/es/drawer/src/styles/rtl.cssr.js +8 -0
- package/es/drawer/styles/index.d.ts +1 -0
- package/es/drawer/styles/index.js +1 -0
- package/es/drawer/styles/rtl.d.ts +3 -0
- package/es/drawer/styles/rtl.js +8 -0
- package/es/dropdown/src/Dropdown.js +6 -6
- package/es/dropdown/src/styles/index.cssr.js +35 -33
- package/es/dynamic-input/src/DynamicInput.d.ts +10 -0
- package/es/dynamic-input/src/InputPreset.d.ts +1 -0
- package/es/dynamic-input/src/PairPreset.d.ts +1 -0
- package/es/dynamic-input/styles/light.d.ts +1 -0
- package/es/dynamic-tags/src/DynamicTags.d.ts +10 -0
- package/es/dynamic-tags/styles/light.d.ts +1 -0
- package/es/empty/styles/light.js +1 -1
- package/es/grid/src/Grid.d.ts +5 -0
- package/es/grid/src/Grid.js +18 -0
- package/es/grid/src/GridItem.d.ts +2 -0
- package/es/grid/src/GridItem.js +15 -2
- package/es/input/src/Input.d.ts +21 -1
- package/es/input/src/Input.js +23 -6
- package/es/input/src/InputGroupLabel.d.ts +9 -0
- package/es/input/src/styles/input.cssr.d.ts +1 -0
- package/es/input/src/styles/input.cssr.js +12 -4
- package/es/input/styles/dark.js +1 -1
- package/es/input/styles/light.d.ts +1 -0
- package/es/input/styles/light.js +1 -1
- package/es/input-number/src/InputNumber.d.ts +15 -5
- package/es/input-number/src/InputNumber.js +6 -8
- package/es/input-number/src/interface.d.ts +1 -0
- package/es/input-number/styles/light.d.ts +1 -0
- package/es/layout/src/Layout.js +3 -1
- package/es/legacy-grid/src/Row.js +2 -2
- package/es/legacy-transfer/src/Transfer.d.ts +10 -0
- package/es/legacy-transfer/src/TransferFilter.d.ts +1 -0
- package/es/legacy-transfer/src/TransferList.d.ts +1 -0
- package/es/legacy-transfer/src/TransferListItem.d.ts +1 -0
- package/es/legacy-transfer/styles/light.d.ts +1 -0
- package/es/list/src/List.d.ts +47 -3
- package/es/list/src/List.js +17 -7
- package/es/list/src/ListItem.d.ts +1 -0
- package/es/list/src/ListItem.js +3 -1
- package/es/list/src/styles/index.cssr.js +35 -12
- package/es/list/src/styles/rtl.cssr.d.ts +2 -0
- package/es/list/src/styles/rtl.cssr.js +11 -0
- package/es/list/styles/index.d.ts +1 -0
- package/es/list/styles/index.js +1 -0
- package/es/list/styles/light.d.ts +3 -0
- package/es/list/styles/light.js +4 -1
- package/es/list/styles/rtl.d.ts +2 -0
- package/es/list/styles/rtl.js +5 -0
- package/es/locales/common/viVN.js +7 -9
- 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 +13 -0
- package/es/menu/src/Menu.js +4 -1
- package/es/menu/src/Submenu.js +1 -1
- package/es/menu/src/utils.d.ts +1 -1
- package/es/menu/src/utils.js +5 -1
- package/es/message/src/Message.d.ts +1 -0
- package/es/message/src/Message.js +8 -3
- package/es/message/src/styles/rtl.cssr.d.ts +2 -0
- package/es/message/src/styles/rtl.cssr.js +8 -0
- package/es/message/styles/index.d.ts +1 -0
- package/es/message/styles/index.js +1 -0
- package/es/message/styles/light.js +4 -1
- package/es/message/styles/rtl.d.ts +2 -0
- package/es/message/styles/rtl.js +5 -0
- package/es/modal/src/Modal.js +2 -1
- package/es/notification/styles/light.js +3 -1
- package/es/number-animation/src/NumberAnimation.js +1 -1
- package/es/pagination/src/Pagination.d.ts +31 -26
- package/es/pagination/src/Pagination.js +207 -164
- package/es/pagination/src/styles/index.cssr.js +7 -1
- package/es/pagination/styles/light.d.ts +1 -0
- package/es/popover/src/Popover.js +2 -2
- package/es/popover/src/PopoverBody.js +3 -2
- package/es/popselect/src/Popselect.d.ts +3 -3
- package/es/radio/styles/dark.js +1 -1
- package/es/radio/styles/light.js +1 -1
- package/es/select/index.d.ts +1 -1
- package/es/select/src/Select.d.ts +4 -1
- package/es/select/src/Select.js +4 -4
- package/es/skeleton/src/Skeleton.js +1 -1
- package/es/slider/styles/dark.js +2 -1
- package/es/slider/styles/light.js +2 -1
- package/es/statistic/src/Statistic.d.ts +10 -0
- package/es/statistic/src/Statistic.js +2 -1
- package/es/statistic/src/styles/index.cssr.js +4 -3
- package/es/statistic/styles/light.d.ts +1 -0
- package/es/statistic/styles/light.js +1 -0
- package/es/steps/src/Steps.d.ts +1 -0
- package/es/steps/src/Steps.js +6 -3
- package/es/steps/src/styles/rtl.cssr.d.ts +2 -0
- package/es/steps/src/styles/rtl.cssr.js +14 -0
- package/es/steps/styles/index.d.ts +1 -0
- package/es/steps/styles/index.js +1 -0
- package/es/steps/styles/rtl.d.ts +2 -0
- package/es/steps/styles/rtl.js +5 -0
- package/es/styles.d.ts +4 -3
- package/es/styles.js +4 -3
- package/es/switch/src/Switch.js +32 -5
- package/es/switch/src/styles/index.cssr.js +2 -2
- package/es/tag/src/Tag.d.ts +4 -4
- package/es/tag/src/Tag.js +3 -3
- package/es/tag/src/styles/index.cssr.js +0 -1
- package/es/tag/styles/light.js +4 -1
- package/es/thing/src/Thing.d.ts +19 -21
- package/es/thing/src/Thing.js +4 -7
- package/es/time-picker/src/Panel.d.ts +1 -0
- package/es/time-picker/src/TimePicker.d.ts +12 -2
- package/es/time-picker/src/TimePicker.js +4 -4
- package/es/time-picker/src/styles/index.cssr.js +12 -12
- package/es/time-picker/styles/light.d.ts +1 -0
- package/es/timeline/src/TimelineItem.js +1 -1
- package/es/tooltip/styles/dark.js +1 -1
- package/es/tooltip/styles/light.js +1 -1
- package/es/transfer/src/Transfer.d.ts +37 -6
- package/es/transfer/src/Transfer.js +32 -23
- package/es/transfer/src/TransferFilter.d.ts +1 -0
- package/es/transfer/src/TransferList.d.ts +1 -0
- package/es/transfer/src/TransferList.js +1 -1
- package/es/transfer/src/TransferListItem.d.ts +1 -0
- package/es/transfer/src/interface.d.ts +1 -1
- package/es/transfer/src/use-transfer-data.d.ts +11 -4
- package/es/transfer/src/use-transfer-data.js +59 -16
- package/es/transfer/styles/light.d.ts +1 -0
- package/es/tree/index.d.ts +1 -1
- package/es/tree/src/Tree.d.ts +34 -1
- package/es/tree/src/Tree.js +25 -11
- package/es/tree/src/interface.d.ts +5 -0
- package/es/tree/src/keyboard.d.ts +4 -1
- package/es/tree/src/keyboard.js +3 -1
- package/es/tree-select/src/TreeSelect.d.ts +13 -0
- package/es/tree-select/src/TreeSelect.js +4 -4
- package/es/typography/styles/light.js +1 -1
- package/es/upload/src/Upload.d.ts +10 -0
- package/es/upload/src/Upload.js +1 -1
- package/es/upload/src/UploadFile.js +4 -2
- package/es/upload/src/utils.d.ts +1 -0
- package/es/upload/src/utils.js +12 -0
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/scrollbar/src/Scrollbar.js +2 -1
- package/lib/_internal/select-menu/styles/light.js +1 -1
- package/lib/_internal/selection/src/Selection.js +1 -1
- package/lib/_utils/cssr/index.js +2 -2
- package/lib/alert/src/Alert.d.ts +14 -0
- package/lib/alert/src/Alert.js +11 -2
- package/lib/alert/src/styles/index.cssr.js +11 -2
- package/lib/alert/styles/dark.js +5 -1
- package/lib/anchor/styles/light.js +2 -1
- package/lib/auto-complete/src/AutoComplete.d.ts +14 -1
- package/lib/auto-complete/src/AutoComplete.js +22 -16
- package/lib/auto-complete/styles/light.d.ts +1 -0
- package/lib/breadcrumb/styles/light.js +1 -1
- package/lib/button/styles/light.js +5 -1
- package/lib/card/styles/light.js +1 -1
- package/lib/carousel/src/Carousel.js +7 -5
- package/lib/cascader/src/Cascader.d.ts +13 -0
- package/lib/cascader/src/Cascader.js +11 -3
- package/lib/checkbox/src/CheckboxGroup.js +2 -2
- package/lib/checkbox/styles/light.js +1 -1
- package/lib/collapse/src/Collapse.d.ts +22 -0
- package/lib/collapse/src/Collapse.js +4 -2
- package/lib/collapse/src/CollapseItem.d.ts +6 -1
- package/lib/collapse/src/CollapseItem.js +4 -2
- package/lib/collapse/src/styles/index.cssr.js +10 -21
- package/lib/collapse/styles/light.d.ts +2 -0
- package/lib/collapse/styles/light.js +5 -3
- package/lib/color-picker/src/ColorInputUnit.d.ts +1 -0
- package/lib/color-picker/src/ColorPicker.d.ts +9 -0
- package/lib/color-picker/src/ColorPicker.js +2 -1
- package/lib/color-picker/styles/light.d.ts +1 -0
- package/lib/countdown/src/Countdown.js +1 -1
- package/lib/data-table/src/DataTable.d.ts +18 -0
- package/lib/data-table/src/DataTable.js +6 -3
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +2 -0
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +4 -2
- package/lib/data-table/src/TableParts/Body.d.ts +6 -0
- package/lib/data-table/src/TableParts/Body.js +22 -14
- package/lib/data-table/src/TableParts/Cell.d.ts +4 -0
- package/lib/data-table/src/TableParts/ExpandTrigger.d.ts +7 -1
- package/lib/data-table/src/TableParts/ExpandTrigger.js +15 -9
- package/lib/data-table/src/TableParts/Header.d.ts +3 -1
- package/lib/data-table/src/interface.d.ts +6 -3
- package/lib/data-table/src/styles/index.cssr.js +25 -7
- package/lib/data-table/src/use-expand.d.ts +3 -1
- package/lib/data-table/src/use-expand.js +15 -8
- package/lib/data-table/src/use-group-header.js +1 -1
- package/lib/data-table/src/use-sorter.js +1 -1
- package/lib/data-table/src/use-table-data.js +1 -1
- package/lib/data-table/styles/light.d.ts +1 -0
- package/lib/date-picker/src/DatePicker.d.ts +23 -2
- package/lib/date-picker/src/DatePicker.js +3 -3
- package/lib/date-picker/src/panel/date.d.ts +6 -3
- package/lib/date-picker/src/panel/daterange.d.ts +3 -0
- package/lib/date-picker/src/panel/datetime.d.ts +3 -0
- package/lib/date-picker/src/panel/datetimerange.d.ts +3 -0
- package/lib/date-picker/src/panel/month.d.ts +3 -0
- package/lib/date-picker/src/panel/monthrange.d.ts +3 -0
- package/lib/date-picker/src/panel/panelHeader.d.ts +6 -0
- package/lib/date-picker/src/panel/panelHeader.js +3 -1
- package/lib/date-picker/src/panel/use-calendar.d.ts +3 -0
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +3 -0
- package/lib/date-picker/src/panel/use-panel-common.d.ts +3 -0
- package/lib/date-picker/src/styles/index.cssr.js +6 -6
- package/lib/date-picker/styles/light.d.ts +2 -0
- package/lib/descriptions/styles/light.js +1 -1
- package/lib/drawer/src/Drawer.d.ts +8 -8
- package/lib/drawer/src/Drawer.js +3 -3
- package/lib/drawer/src/DrawerBodyWrapper.d.ts +1 -0
- package/lib/drawer/src/DrawerBodyWrapper.js +6 -0
- package/lib/drawer/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/drawer/src/styles/rtl.cssr.js +15 -0
- package/lib/drawer/styles/index.d.ts +1 -0
- package/lib/drawer/styles/index.js +3 -1
- package/lib/drawer/styles/rtl.d.ts +3 -0
- package/lib/drawer/styles/rtl.js +14 -0
- package/lib/dropdown/src/Dropdown.js +6 -6
- package/lib/dropdown/src/styles/index.cssr.js +35 -33
- package/lib/dynamic-input/src/DynamicInput.d.ts +10 -0
- package/lib/dynamic-input/src/InputPreset.d.ts +1 -0
- package/lib/dynamic-input/src/PairPreset.d.ts +1 -0
- package/lib/dynamic-input/styles/light.d.ts +1 -0
- package/lib/dynamic-tags/src/DynamicTags.d.ts +10 -0
- package/lib/dynamic-tags/styles/light.d.ts +1 -0
- package/lib/empty/styles/light.js +1 -1
- package/lib/grid/src/Grid.d.ts +5 -0
- package/lib/grid/src/Grid.js +18 -0
- package/lib/grid/src/GridItem.d.ts +2 -0
- package/lib/grid/src/GridItem.js +14 -1
- package/lib/input/src/Input.d.ts +21 -1
- package/lib/input/src/Input.js +45 -5
- package/lib/input/src/InputGroupLabel.d.ts +9 -0
- package/lib/input/src/styles/input.cssr.d.ts +1 -0
- package/lib/input/src/styles/input.cssr.js +13 -4
- package/lib/input/styles/dark.js +1 -1
- package/lib/input/styles/light.d.ts +1 -0
- package/lib/input/styles/light.js +1 -1
- package/lib/input-number/src/InputNumber.d.ts +15 -5
- package/lib/input-number/src/InputNumber.js +6 -8
- package/lib/input-number/src/interface.d.ts +1 -0
- package/lib/input-number/styles/light.d.ts +1 -0
- package/lib/layout/src/Layout.js +3 -1
- package/lib/legacy-grid/src/Row.js +2 -2
- package/lib/legacy-transfer/src/Transfer.d.ts +10 -0
- package/lib/legacy-transfer/src/TransferFilter.d.ts +1 -0
- package/lib/legacy-transfer/src/TransferList.d.ts +1 -0
- package/lib/legacy-transfer/src/TransferListItem.d.ts +1 -0
- package/lib/legacy-transfer/styles/light.d.ts +1 -0
- package/lib/list/src/List.d.ts +47 -3
- package/lib/list/src/List.js +15 -5
- package/lib/list/src/ListItem.d.ts +1 -0
- package/lib/list/src/ListItem.js +3 -1
- package/lib/list/src/styles/index.cssr.js +35 -12
- package/lib/list/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/list/src/styles/rtl.cssr.js +18 -0
- package/lib/list/styles/index.d.ts +1 -0
- package/lib/list/styles/index.js +3 -1
- package/lib/list/styles/light.d.ts +3 -0
- package/lib/list/styles/light.js +4 -1
- package/lib/list/styles/rtl.d.ts +2 -0
- package/lib/list/styles/rtl.js +11 -0
- package/lib/locales/common/viVN.js +7 -9
- 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 +13 -0
- package/lib/menu/src/Menu.js +4 -1
- package/lib/menu/src/Submenu.js +1 -1
- package/lib/menu/src/utils.d.ts +1 -1
- package/lib/menu/src/utils.js +5 -1
- package/lib/message/src/Message.d.ts +1 -0
- package/lib/message/src/Message.js +7 -2
- package/lib/message/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/message/src/styles/rtl.cssr.js +15 -0
- package/lib/message/styles/index.d.ts +1 -0
- package/lib/message/styles/index.js +3 -1
- package/lib/message/styles/light.js +4 -1
- package/lib/message/styles/rtl.d.ts +2 -0
- package/lib/message/styles/rtl.js +11 -0
- package/lib/modal/src/Modal.js +2 -1
- package/lib/notification/styles/light.js +3 -1
- package/lib/number-animation/src/NumberAnimation.js +1 -1
- package/lib/pagination/src/Pagination.d.ts +31 -26
- package/lib/pagination/src/Pagination.js +206 -163
- package/lib/pagination/src/styles/index.cssr.js +7 -1
- package/lib/pagination/styles/light.d.ts +1 -0
- package/lib/popover/src/Popover.js +2 -2
- package/lib/popover/src/PopoverBody.js +3 -2
- package/lib/popselect/src/Popselect.d.ts +3 -3
- package/lib/radio/styles/dark.js +1 -1
- package/lib/radio/styles/light.js +1 -1
- package/lib/select/index.d.ts +1 -1
- package/lib/select/src/Select.d.ts +4 -1
- package/lib/select/src/Select.js +3 -3
- package/lib/skeleton/src/Skeleton.js +1 -1
- package/lib/slider/styles/dark.js +2 -1
- package/lib/slider/styles/light.js +2 -1
- package/lib/statistic/src/Statistic.d.ts +10 -0
- package/lib/statistic/src/Statistic.js +2 -1
- package/lib/statistic/src/styles/index.cssr.js +4 -3
- package/lib/statistic/styles/light.d.ts +1 -0
- package/lib/statistic/styles/light.js +1 -0
- package/lib/steps/src/Steps.d.ts +1 -0
- package/lib/steps/src/Steps.js +5 -2
- package/lib/steps/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/steps/src/styles/rtl.cssr.js +21 -0
- package/lib/steps/styles/index.d.ts +1 -0
- package/lib/steps/styles/index.js +3 -1
- package/lib/steps/styles/rtl.d.ts +2 -0
- package/lib/steps/styles/rtl.js +11 -0
- package/lib/styles.d.ts +4 -3
- package/lib/styles.js +154 -149
- package/lib/switch/src/Switch.js +32 -5
- package/lib/switch/src/styles/index.cssr.js +2 -2
- package/lib/tag/src/Tag.d.ts +4 -4
- package/lib/tag/src/Tag.js +3 -3
- package/lib/tag/src/styles/index.cssr.js +0 -1
- package/lib/tag/styles/light.js +4 -1
- package/lib/thing/src/Thing.d.ts +19 -21
- package/lib/thing/src/Thing.js +4 -7
- package/lib/time-picker/src/Panel.d.ts +1 -0
- package/lib/time-picker/src/TimePicker.d.ts +12 -2
- package/lib/time-picker/src/TimePicker.js +3 -3
- package/lib/time-picker/src/styles/index.cssr.js +12 -12
- package/lib/time-picker/styles/light.d.ts +1 -0
- package/lib/timeline/src/TimelineItem.js +1 -1
- package/lib/tooltip/styles/dark.js +1 -1
- package/lib/tooltip/styles/light.js +1 -1
- package/lib/transfer/src/Transfer.d.ts +37 -6
- package/lib/transfer/src/Transfer.js +32 -23
- package/lib/transfer/src/TransferFilter.d.ts +1 -0
- package/lib/transfer/src/TransferList.d.ts +1 -0
- package/lib/transfer/src/TransferList.js +1 -1
- package/lib/transfer/src/TransferListItem.d.ts +1 -0
- package/lib/transfer/src/interface.d.ts +1 -1
- package/lib/transfer/src/use-transfer-data.d.ts +11 -4
- package/lib/transfer/src/use-transfer-data.js +59 -16
- package/lib/transfer/styles/light.d.ts +1 -0
- package/lib/tree/index.d.ts +1 -1
- package/lib/tree/src/Tree.d.ts +34 -1
- package/lib/tree/src/Tree.js +25 -11
- package/lib/tree/src/interface.d.ts +5 -0
- package/lib/tree/src/keyboard.d.ts +4 -1
- package/lib/tree/src/keyboard.js +3 -1
- package/lib/tree-select/src/TreeSelect.d.ts +13 -0
- package/lib/tree-select/src/TreeSelect.js +3 -3
- package/lib/typography/styles/light.js +1 -1
- package/lib/upload/src/Upload.d.ts +10 -0
- package/lib/upload/src/Upload.js +1 -1
- package/lib/upload/src/UploadFile.js +3 -1
- package/lib/upload/src/utils.d.ts +1 -0
- package/lib/upload/src/utils.js +14 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +25 -19
- package/volar.d.ts +1 -1
- package/web-types.json +210 -3
|
@@ -195,6 +195,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
195
195
|
colorHover: string;
|
|
196
196
|
}, any>;
|
|
197
197
|
Input: import("../../_mixins").Theme<"Input", {
|
|
198
|
+
countTextColorDisabled: string;
|
|
198
199
|
countTextColor: string;
|
|
199
200
|
heightTiny: string;
|
|
200
201
|
heightSmall: string;
|
|
@@ -7,7 +7,7 @@ export interface Option {
|
|
|
7
7
|
value: OptionValue;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export declare type Filter = (pattern: string, option: Option) => boolean;
|
|
10
|
+
export declare type Filter = (pattern: string, option: Option, from: 'source' | 'target') => boolean;
|
|
11
11
|
export interface RenderLabelProps {
|
|
12
12
|
option: Option;
|
|
13
13
|
}
|
|
@@ -3,21 +3,28 @@ interface UseTransferDataProps {
|
|
|
3
3
|
defaultValue: OptionValue[] | null;
|
|
4
4
|
value?: OptionValue[] | null;
|
|
5
5
|
options: Option[];
|
|
6
|
-
filterable: boolean;
|
|
6
|
+
filterable: boolean | undefined;
|
|
7
|
+
sourceFilterable: Boolean;
|
|
8
|
+
targetFilterable: Boolean;
|
|
7
9
|
filter: Filter;
|
|
8
10
|
}
|
|
9
11
|
export declare function useTransferData(props: UseTransferDataProps): {
|
|
10
12
|
uncontrolledValueRef: import("vue").Ref<OptionValue[] | null>;
|
|
11
13
|
mergedValueRef: import("vue").ComputedRef<OptionValue[] | null>;
|
|
12
14
|
targetValueSetRef: import("vue").ComputedRef<Set<OptionValue>>;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
valueSetForCheckAllRef: import("vue").ComputedRef<Set<string | number>>;
|
|
16
|
+
valueSetForUncheckAllRef: import("vue").ComputedRef<Set<string | number>>;
|
|
17
|
+
valueSetForClearRef: import("vue").ComputedRef<Set<string | number>>;
|
|
18
|
+
filteredTgtOptionsRef: import("vue").ComputedRef<Option[]>;
|
|
16
19
|
filteredSrcOptionsRef: import("vue").ComputedRef<Option[]>;
|
|
20
|
+
targetOptionsRef: import("vue").ComputedRef<Option[]>;
|
|
17
21
|
canNotSelectAnythingRef: import("vue").ComputedRef<boolean>;
|
|
18
22
|
canBeClearedRef: import("vue").ComputedRef<boolean>;
|
|
19
23
|
allCheckedRef: import("vue").ComputedRef<boolean>;
|
|
20
24
|
srcPatternRef: import("vue").Ref<string>;
|
|
25
|
+
tgtPatternRef: import("vue").Ref<string>;
|
|
26
|
+
mergedSrcFilterableRef: import("vue").ComputedRef<Boolean>;
|
|
21
27
|
handleSrcFilterUpdateValue: (value: string | null) => void;
|
|
28
|
+
handleTgtFilterUpdateValue: (value: string | null) => void;
|
|
22
29
|
};
|
|
23
30
|
export {};
|
|
@@ -12,14 +12,31 @@ export function useTransferData(props) {
|
|
|
12
12
|
const targetValueSetRef = computed(() => new Set(mergedValueRef.value || []));
|
|
13
13
|
const targetOptionsRef = computed(() => {
|
|
14
14
|
const optionMap = optionsMapRef.value;
|
|
15
|
-
|
|
15
|
+
const targetOptions = [];
|
|
16
|
+
(mergedValueRef.value || []).forEach((v) => {
|
|
17
|
+
const option = optionMap.get(v);
|
|
18
|
+
if (option) {
|
|
19
|
+
targetOptions.push(option);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return targetOptions;
|
|
16
23
|
});
|
|
17
24
|
const srcPatternRef = ref('');
|
|
25
|
+
const tgtPatternRef = ref('');
|
|
26
|
+
const mergedSrcFilterableRef = computed(() => {
|
|
27
|
+
return props.sourceFilterable || !!props.filterable;
|
|
28
|
+
});
|
|
18
29
|
const filteredSrcOptionsRef = computed(() => {
|
|
19
|
-
if (!
|
|
30
|
+
if (!mergedSrcFilterableRef.value)
|
|
20
31
|
return props.options;
|
|
21
32
|
const { filter } = props;
|
|
22
|
-
return props.options.filter((opt) => filter(srcPatternRef.value, opt));
|
|
33
|
+
return props.options.filter((opt) => filter(srcPatternRef.value, opt, 'source'));
|
|
34
|
+
});
|
|
35
|
+
const filteredTgtOptionsRef = computed(() => {
|
|
36
|
+
if (!props.targetFilterable)
|
|
37
|
+
return targetOptionsRef.value;
|
|
38
|
+
const { filter } = props;
|
|
39
|
+
return targetOptionsRef.value.filter((opt) => filter(tgtPatternRef.value, opt, 'target'));
|
|
23
40
|
});
|
|
24
41
|
const mergedValueSetRef = computed(() => {
|
|
25
42
|
const { value } = mergedValueRef;
|
|
@@ -27,15 +44,33 @@ export function useTransferData(props) {
|
|
|
27
44
|
return new Set();
|
|
28
45
|
return new Set(value);
|
|
29
46
|
});
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
47
|
+
const valueSetForCheckAllRef = computed(() => {
|
|
48
|
+
const values = new Set(mergedValueSetRef.value);
|
|
49
|
+
filteredSrcOptionsRef.value.forEach((option) => {
|
|
50
|
+
if (!option.disabled && !values.has(option.value)) {
|
|
51
|
+
values.add(option.value);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return values;
|
|
55
|
+
});
|
|
56
|
+
const valueSetForUncheckAllRef = computed(() => {
|
|
57
|
+
const values = new Set(mergedValueSetRef.value);
|
|
58
|
+
filteredSrcOptionsRef.value.forEach((option) => {
|
|
59
|
+
if (!option.disabled && values.has(option.value)) {
|
|
60
|
+
values.delete(option.value);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
return values;
|
|
64
|
+
});
|
|
65
|
+
const valueSetForClearRef = computed(() => {
|
|
66
|
+
const values = new Set(mergedValueSetRef.value);
|
|
67
|
+
filteredTgtOptionsRef.value.forEach((option) => {
|
|
68
|
+
if (!option.disabled) {
|
|
69
|
+
values.delete(option.value);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return values;
|
|
35
73
|
});
|
|
36
|
-
const valueSetForUnselectAllRef = computed(() => new Set(targetOptionsRef.value
|
|
37
|
-
.filter((option) => option.disabled)
|
|
38
|
-
.map((option) => option.value)));
|
|
39
74
|
const canNotSelectAnythingRef = computed(() => {
|
|
40
75
|
return filteredSrcOptionsRef.value.every((option) => option.disabled);
|
|
41
76
|
});
|
|
@@ -47,23 +82,31 @@ export function useTransferData(props) {
|
|
|
47
82
|
return filteredSrcOptionsRef.value.every((option) => option.disabled || mergedValueSet.has(option.value));
|
|
48
83
|
});
|
|
49
84
|
const canBeClearedRef = computed(() => {
|
|
50
|
-
return
|
|
85
|
+
return filteredTgtOptionsRef.value.some((option) => !option.disabled);
|
|
51
86
|
});
|
|
52
87
|
function handleSrcFilterUpdateValue(value) {
|
|
53
88
|
srcPatternRef.value = value !== null && value !== void 0 ? value : '';
|
|
54
89
|
}
|
|
90
|
+
function handleTgtFilterUpdateValue(value) {
|
|
91
|
+
tgtPatternRef.value = value !== null && value !== void 0 ? value : '';
|
|
92
|
+
}
|
|
55
93
|
return {
|
|
56
94
|
uncontrolledValueRef,
|
|
57
95
|
mergedValueRef,
|
|
58
96
|
targetValueSetRef,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
97
|
+
valueSetForCheckAllRef,
|
|
98
|
+
valueSetForUncheckAllRef,
|
|
99
|
+
valueSetForClearRef,
|
|
100
|
+
filteredTgtOptionsRef,
|
|
62
101
|
filteredSrcOptionsRef,
|
|
102
|
+
targetOptionsRef,
|
|
63
103
|
canNotSelectAnythingRef,
|
|
64
104
|
canBeClearedRef,
|
|
65
105
|
allCheckedRef,
|
|
66
106
|
srcPatternRef,
|
|
67
|
-
|
|
107
|
+
tgtPatternRef,
|
|
108
|
+
mergedSrcFilterableRef,
|
|
109
|
+
handleSrcFilterUpdateValue,
|
|
110
|
+
handleTgtFilterUpdateValue
|
|
68
111
|
};
|
|
69
112
|
}
|
|
@@ -108,6 +108,7 @@ declare const transferLight: import("../../_mixins").Theme<"Transfer", {
|
|
|
108
108
|
colorHover: string;
|
|
109
109
|
}, any>;
|
|
110
110
|
Input: import("../../_mixins").Theme<"Input", {
|
|
111
|
+
countTextColorDisabled: string;
|
|
111
112
|
countTextColor: string;
|
|
112
113
|
heightTiny: string;
|
|
113
114
|
heightSmall: string;
|
package/es/tree/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as NTree, treeProps } from './src/Tree';
|
|
2
2
|
export type { TreeProps } from './src/Tree';
|
|
3
|
-
export type { TreeOption, TreeDragInfo, TreeDropInfo } from './src/interface';
|
|
3
|
+
export type { TreeOption, TreeDragInfo, TreeDropInfo, TreeInst } from './src/interface';
|
package/es/tree/src/Tree.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { TreeMateOptions, CheckStrategy } from 'treemate';
|
|
|
3
3
|
import type { ExtractPublicPropTypes, MaybeArray } from '../../_utils';
|
|
4
4
|
import type { TreeDragInfo, TreeDropInfo, TreeOptions, Key, TreeOption, AllowDrop, RenderSwitcherIcon, TreeNodeProps, CheckOnClick } from './interface';
|
|
5
5
|
import { defaultAllowDrop } from './dnd';
|
|
6
|
-
export declare function createTreeMateOptions<T>(keyField: string, childrenField: string): TreeMateOptions<T, T, T>;
|
|
6
|
+
export declare function createTreeMateOptions<T>(keyField: string, childrenField: string, disabledField: string): TreeMateOptions<T, T, T>;
|
|
7
7
|
export declare type OnUpdateKeys = (value: Array<string & number>, option: Array<TreeOption | null>) => void;
|
|
8
8
|
export declare type OnUpdateKeysImpl = (value: Key[], option: Array<TreeOption | null>) => void;
|
|
9
9
|
declare type OnLoad = (node: TreeOption) => Promise<void>;
|
|
@@ -24,6 +24,10 @@ export declare const treeSharedProps: {
|
|
|
24
24
|
readonly type: StringConstructor;
|
|
25
25
|
readonly default: "children";
|
|
26
26
|
};
|
|
27
|
+
readonly disabledField: {
|
|
28
|
+
readonly type: StringConstructor;
|
|
29
|
+
readonly default: "disabled";
|
|
30
|
+
};
|
|
27
31
|
readonly defaultExpandedKeys: {
|
|
28
32
|
readonly type: PropType<Key[]>;
|
|
29
33
|
readonly default: () => never[];
|
|
@@ -74,6 +78,10 @@ export declare const treeProps: {
|
|
|
74
78
|
readonly type: StringConstructor;
|
|
75
79
|
readonly default: "children";
|
|
76
80
|
};
|
|
81
|
+
readonly disabledField: {
|
|
82
|
+
readonly type: StringConstructor;
|
|
83
|
+
readonly default: "disabled";
|
|
84
|
+
};
|
|
77
85
|
readonly defaultExpandedKeys: {
|
|
78
86
|
readonly type: PropType<Key[]>;
|
|
79
87
|
readonly default: () => never[];
|
|
@@ -154,6 +162,10 @@ export declare const treeProps: {
|
|
|
154
162
|
readonly renderPrefix: PropType<({ option, checked, selected }: import("./interface").TreeRenderProps) => VNodeChild>;
|
|
155
163
|
readonly renderSuffix: PropType<({ option, checked, selected }: import("./interface").TreeRenderProps) => VNodeChild>;
|
|
156
164
|
readonly nodeProps: PropType<TreeNodeProps>;
|
|
165
|
+
readonly keyboard: {
|
|
166
|
+
readonly type: BooleanConstructor;
|
|
167
|
+
readonly default: true;
|
|
168
|
+
};
|
|
157
169
|
readonly onDragenter: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
|
|
158
170
|
readonly onDragleave: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
|
|
159
171
|
readonly onDragend: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
|
|
@@ -382,6 +394,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
382
394
|
readonly type: StringConstructor;
|
|
383
395
|
readonly default: "children";
|
|
384
396
|
};
|
|
397
|
+
readonly disabledField: {
|
|
398
|
+
readonly type: StringConstructor;
|
|
399
|
+
readonly default: "disabled";
|
|
400
|
+
};
|
|
385
401
|
readonly defaultExpandedKeys: {
|
|
386
402
|
readonly type: PropType<Key[]>;
|
|
387
403
|
readonly default: () => never[];
|
|
@@ -462,6 +478,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
462
478
|
readonly renderPrefix: PropType<({ option, checked, selected }: import("./interface").TreeRenderProps) => VNodeChild>;
|
|
463
479
|
readonly renderSuffix: PropType<({ option, checked, selected }: import("./interface").TreeRenderProps) => VNodeChild>;
|
|
464
480
|
readonly nodeProps: PropType<TreeNodeProps>;
|
|
481
|
+
readonly keyboard: {
|
|
482
|
+
readonly type: BooleanConstructor;
|
|
483
|
+
readonly default: true;
|
|
484
|
+
};
|
|
465
485
|
readonly onDragenter: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
|
|
466
486
|
readonly onDragleave: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
|
|
467
487
|
readonly onDragend: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
|
|
@@ -1109,6 +1129,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1109
1129
|
handleAfterEnter: () => void;
|
|
1110
1130
|
handleResize: () => void;
|
|
1111
1131
|
handleKeydown: (e: KeyboardEvent) => void;
|
|
1132
|
+
scrollTo: (options: {
|
|
1133
|
+
key: Key;
|
|
1134
|
+
}) => void;
|
|
1112
1135
|
cssVars: import("vue").ComputedRef<{
|
|
1113
1136
|
'--n-arrow-color': string;
|
|
1114
1137
|
'--n-loading-color': string;
|
|
@@ -1163,6 +1186,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1163
1186
|
readonly type: StringConstructor;
|
|
1164
1187
|
readonly default: "children";
|
|
1165
1188
|
};
|
|
1189
|
+
readonly disabledField: {
|
|
1190
|
+
readonly type: StringConstructor;
|
|
1191
|
+
readonly default: "disabled";
|
|
1192
|
+
};
|
|
1166
1193
|
readonly defaultExpandedKeys: {
|
|
1167
1194
|
readonly type: PropType<Key[]>;
|
|
1168
1195
|
readonly default: () => never[];
|
|
@@ -1243,6 +1270,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1243
1270
|
readonly renderPrefix: PropType<({ option, checked, selected }: import("./interface").TreeRenderProps) => VNodeChild>;
|
|
1244
1271
|
readonly renderSuffix: PropType<({ option, checked, selected }: import("./interface").TreeRenderProps) => VNodeChild>;
|
|
1245
1272
|
readonly nodeProps: PropType<TreeNodeProps>;
|
|
1273
|
+
readonly keyboard: {
|
|
1274
|
+
readonly type: BooleanConstructor;
|
|
1275
|
+
readonly default: true;
|
|
1276
|
+
};
|
|
1246
1277
|
readonly onDragenter: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
|
|
1247
1278
|
readonly onDragleave: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
|
|
1248
1279
|
readonly onDragend: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
|
|
@@ -1447,8 +1478,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1447
1478
|
readonly allowCheckingNotLoaded: boolean;
|
|
1448
1479
|
readonly cascade: boolean;
|
|
1449
1480
|
readonly indent: number;
|
|
1481
|
+
readonly keyboard: boolean;
|
|
1450
1482
|
readonly internalScrollable: boolean;
|
|
1451
1483
|
readonly checkStrategy: CheckStrategy;
|
|
1484
|
+
readonly disabledField: string;
|
|
1452
1485
|
readonly leafOnly: boolean;
|
|
1453
1486
|
readonly accordion: boolean;
|
|
1454
1487
|
readonly defaultExpandedKeys: Key[];
|
package/es/tree/src/Tree.js
CHANGED
|
@@ -30,8 +30,11 @@ import { NEmpty } from '../../empty';
|
|
|
30
30
|
// During expanding, some node are mis-applied with :active style
|
|
31
31
|
// Async dnd has bug
|
|
32
32
|
const ITEM_SIZE = 30; // 24 + 3 + 3
|
|
33
|
-
export function createTreeMateOptions(keyField, childrenField) {
|
|
33
|
+
export function createTreeMateOptions(keyField, childrenField, disabledField) {
|
|
34
34
|
return {
|
|
35
|
+
getIsGroup() {
|
|
36
|
+
return false;
|
|
37
|
+
},
|
|
35
38
|
getKey(node) {
|
|
36
39
|
return node[keyField];
|
|
37
40
|
},
|
|
@@ -39,7 +42,7 @@ export function createTreeMateOptions(keyField, childrenField) {
|
|
|
39
42
|
return node[childrenField];
|
|
40
43
|
},
|
|
41
44
|
getDisabled(node) {
|
|
42
|
-
return !!(node
|
|
45
|
+
return !!(node[disabledField] || node.checkboxDisabled);
|
|
43
46
|
}
|
|
44
47
|
};
|
|
45
48
|
}
|
|
@@ -60,6 +63,10 @@ export const treeSharedProps = {
|
|
|
60
63
|
type: String,
|
|
61
64
|
default: 'children'
|
|
62
65
|
},
|
|
66
|
+
disabledField: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: 'disabled'
|
|
69
|
+
},
|
|
63
70
|
defaultExpandedKeys: {
|
|
64
71
|
type: Array,
|
|
65
72
|
default: () => []
|
|
@@ -107,7 +114,10 @@ export const treeProps = Object.assign(Object.assign(Object.assign(Object.assign
|
|
|
107
114
|
}, checkboxPlacement: {
|
|
108
115
|
type: String,
|
|
109
116
|
default: 'left'
|
|
110
|
-
}, virtualScroll: Boolean, watchProps: Array, renderLabel: Function, renderPrefix: Function, renderSuffix: Function, nodeProps: Function,
|
|
117
|
+
}, virtualScroll: Boolean, watchProps: Array, renderLabel: Function, renderPrefix: Function, renderSuffix: Function, nodeProps: Function, keyboard: {
|
|
118
|
+
type: Boolean,
|
|
119
|
+
default: true
|
|
120
|
+
}, onDragenter: [Function, Array], onDragleave: [Function, Array], onDragend: [Function, Array], onDragstart: [Function, Array], onDragover: [Function, Array], onDrop: [Function, Array], onUpdateCheckedKeys: [Function, Array], 'onUpdate:checkedKeys': [Function, Array], onUpdateSelectedKeys: [Function, Array], 'onUpdate:selectedKeys': [Function, Array] }), treeSharedProps), {
|
|
111
121
|
// internal props for tree-select
|
|
112
122
|
internalTreeSelect: Boolean, internalScrollable: Boolean, internalScrollablePadding: String,
|
|
113
123
|
// use it to display
|
|
@@ -172,7 +182,7 @@ export default defineComponent({
|
|
|
172
182
|
// We don't expect data source to change so we just determine it once
|
|
173
183
|
const displayTreeMateRef = computed(() => createTreeMate(props.showIrrelevantNodes
|
|
174
184
|
? props.data
|
|
175
|
-
: filteredTreeInfoRef.value.filteredTree, createTreeMateOptions(props.keyField, props.childrenField)));
|
|
185
|
+
: filteredTreeInfoRef.value.filteredTree, createTreeMateOptions(props.keyField, props.childrenField, props.disabledField)));
|
|
176
186
|
const treeSelectInjection = inject(treeSelectInjectionKey, null);
|
|
177
187
|
const dataTreeMateRef = props.internalTreeSelect
|
|
178
188
|
? treeSelectInjection.dataTreeMate
|
|
@@ -237,6 +247,7 @@ export default defineComponent({
|
|
|
237
247
|
const mergedExpandedKeysRef = useMergedState(controlledExpandedKeysRef, uncontrolledExpandedKeysRef);
|
|
238
248
|
const fNodesRef = computed(() => displayTreeMateRef.value.getFlattenedNodes(mergedExpandedKeysRef.value));
|
|
239
249
|
const { pendingNodeKeyRef, handleKeydown } = useKeyboard({
|
|
250
|
+
props,
|
|
240
251
|
mergedSelectedKeysRef,
|
|
241
252
|
fNodesRef,
|
|
242
253
|
mergedExpandedKeysRef,
|
|
@@ -1072,8 +1083,13 @@ export default defineComponent({
|
|
|
1072
1083
|
handleSelect,
|
|
1073
1084
|
handleCheck
|
|
1074
1085
|
});
|
|
1086
|
+
function scrollTo(options) {
|
|
1087
|
+
var _a;
|
|
1088
|
+
(_a = virtualListInstRef.value) === null || _a === void 0 ? void 0 : _a.scrollTo(options);
|
|
1089
|
+
}
|
|
1075
1090
|
const exposedMethods = {
|
|
1076
|
-
handleKeydown
|
|
1091
|
+
handleKeydown,
|
|
1092
|
+
scrollTo
|
|
1077
1093
|
};
|
|
1078
1094
|
const cssVarsRef = computed(() => {
|
|
1079
1095
|
const { common: { cubicBezierEaseInOut }, self: { fontSize, nodeBorderRadius, nodeColorHover, nodeColorPressed, nodeColorActive, arrowColor, loadingColor, nodeTextColor, nodeTextColorDisabled, dropMarkColor } } = themeRef.value;
|
|
@@ -1111,6 +1127,7 @@ export default defineComponent({
|
|
|
1111
1127
|
handleAfterEnter,
|
|
1112
1128
|
handleResize,
|
|
1113
1129
|
handleKeydown: exposedMethods.handleKeydown,
|
|
1130
|
+
scrollTo: exposedMethods.scrollTo,
|
|
1114
1131
|
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
1115
1132
|
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
1116
1133
|
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
@@ -1164,12 +1181,9 @@ export default defineComponent({
|
|
|
1164
1181
|
}
|
|
1165
1182
|
else {
|
|
1166
1183
|
return (h("div", { class: treeClass, tabindex: tabindex, ref: "selfElRef", style: this.cssVars, onKeydown: mergedFocusable ? handleKeydown : undefined, onFocusout: mergedFocusable ? handleFocusout : undefined, onDragleave: draggable ? this.handleDragLeaveTree : undefined }, !fNodes.length
|
|
1167
|
-
? resolveSlot(this.$slots.empty, () =>
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
h(NEmpty, { class: `${mergedClsPrefix}-tree__empty`, theme: (_b = (_a = this.theme) === null || _a === void 0 ? void 0 : _a.peers) === null || _b === void 0 ? void 0 : _b.Empty, themeOverrides: (_d = (_c = this.themeOverrides) === null || _c === void 0 ? void 0 : _c.peers) === null || _d === void 0 ? void 0 : _d.Empty })
|
|
1171
|
-
];
|
|
1172
|
-
})
|
|
1184
|
+
? resolveSlot(this.$slots.empty, () => [
|
|
1185
|
+
h(NEmpty, { class: `${mergedClsPrefix}-tree__empty`, theme: this.mergedTheme.peers.Empty, themeOverrides: this.mergedTheme.peerOverrides.Empty })
|
|
1186
|
+
])
|
|
1173
1187
|
: fNodes.map(createNode)));
|
|
1174
1188
|
}
|
|
1175
1189
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { TreeNode } from 'treemate';
|
|
3
3
|
import { Key, TmNode, TreeOption } from './interface';
|
|
4
|
-
export declare function useKeyboard({ fNodesRef, mergedExpandedKeysRef, mergedSelectedKeysRef, handleSelect, handleSwitcherClick }: {
|
|
4
|
+
export declare function useKeyboard({ props, fNodesRef, mergedExpandedKeysRef, mergedSelectedKeysRef, handleSelect, handleSwitcherClick }: {
|
|
5
|
+
props: {
|
|
6
|
+
keyboard: boolean;
|
|
7
|
+
};
|
|
5
8
|
fNodesRef: Ref<Array<TreeNode<TreeOption>>>;
|
|
6
9
|
mergedExpandedKeysRef: Ref<Key[]>;
|
|
7
10
|
mergedSelectedKeysRef: Ref<Key[]>;
|
package/es/tree/src/keyboard.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inject, ref } from 'vue';
|
|
2
2
|
import { treeSelectInjectionKey } from '../../tree-select/src/interface';
|
|
3
|
-
export function useKeyboard({ fNodesRef, mergedExpandedKeysRef, mergedSelectedKeysRef, handleSelect, handleSwitcherClick }) {
|
|
3
|
+
export function useKeyboard({ props, fNodesRef, mergedExpandedKeysRef, mergedSelectedKeysRef, handleSelect, handleSwitcherClick }) {
|
|
4
4
|
const { value: mergedSelectedKeys } = mergedSelectedKeysRef;
|
|
5
5
|
// If it's used in tree-select, make it take over pending state
|
|
6
6
|
const treeSelectInjection = inject(treeSelectInjectionKey, null);
|
|
@@ -10,6 +10,8 @@ export function useKeyboard({ fNodesRef, mergedExpandedKeysRef, mergedSelectedKe
|
|
|
10
10
|
? mergedSelectedKeys[mergedSelectedKeys.length - 1]
|
|
11
11
|
: null);
|
|
12
12
|
function handleKeydown(e) {
|
|
13
|
+
if (!props.keyboard)
|
|
14
|
+
return;
|
|
13
15
|
const { value: pendingNodeKey } = pendingNodeKeyRef;
|
|
14
16
|
if (pendingNodeKey === null) {
|
|
15
17
|
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
|
@@ -39,6 +39,10 @@ export declare const treeSelectProps: {
|
|
|
39
39
|
readonly type: StringConstructor;
|
|
40
40
|
readonly default: "children";
|
|
41
41
|
};
|
|
42
|
+
readonly disabledField: {
|
|
43
|
+
readonly type: StringConstructor;
|
|
44
|
+
readonly default: "disabled";
|
|
45
|
+
};
|
|
42
46
|
readonly defaultExpandedKeys: {
|
|
43
47
|
readonly type: PropType<Key[]>;
|
|
44
48
|
readonly default: () => never[];
|
|
@@ -602,6 +606,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
602
606
|
readonly type: StringConstructor;
|
|
603
607
|
readonly default: "children";
|
|
604
608
|
};
|
|
609
|
+
readonly disabledField: {
|
|
610
|
+
readonly type: StringConstructor;
|
|
611
|
+
readonly default: "disabled";
|
|
612
|
+
};
|
|
605
613
|
readonly defaultExpandedKeys: {
|
|
606
614
|
readonly type: PropType<Key[]>;
|
|
607
615
|
readonly default: () => never[];
|
|
@@ -1567,6 +1575,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1567
1575
|
readonly type: StringConstructor;
|
|
1568
1576
|
readonly default: "children";
|
|
1569
1577
|
};
|
|
1578
|
+
readonly disabledField: {
|
|
1579
|
+
readonly type: StringConstructor;
|
|
1580
|
+
readonly default: "disabled";
|
|
1581
|
+
};
|
|
1570
1582
|
readonly defaultExpandedKeys: {
|
|
1571
1583
|
readonly type: PropType<Key[]>;
|
|
1572
1584
|
readonly default: () => never[];
|
|
@@ -2121,6 +2133,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2121
2133
|
readonly allowCheckingNotLoaded: boolean;
|
|
2122
2134
|
readonly cascade: boolean;
|
|
2123
2135
|
readonly checkStrategy: CheckStrategy;
|
|
2136
|
+
readonly disabledField: string;
|
|
2124
2137
|
readonly leafOnly: boolean;
|
|
2125
2138
|
readonly showPath: boolean;
|
|
2126
2139
|
readonly defaultExpandedKeys: Key[];
|
|
@@ -3,7 +3,7 @@ import { VBinder, VFollower, VTarget } from 'vueuc';
|
|
|
3
3
|
import { useIsMounted, useMergedState } from 'vooks';
|
|
4
4
|
import { clickoutside } from 'vdirs';
|
|
5
5
|
import { createTreeMate } from 'treemate';
|
|
6
|
-
import { happensIn } from 'seemly';
|
|
6
|
+
import { getPreciseEventTarget, happensIn } from 'seemly';
|
|
7
7
|
import { createTreeMateOptions, treeSharedProps } from '../../tree/src/Tree';
|
|
8
8
|
import { NInternalSelection, NBaseFocusDetector } from '../../_internal';
|
|
9
9
|
import { NTree } from '../../tree';
|
|
@@ -91,7 +91,7 @@ export default defineComponent({
|
|
|
91
91
|
};
|
|
92
92
|
});
|
|
93
93
|
// used to resolve selected options
|
|
94
|
-
const dataTreeMateRef = computed(() => createTreeMate(props.options, createTreeMateOptions(props.keyField, props.childrenField)));
|
|
94
|
+
const dataTreeMateRef = computed(() => createTreeMate(props.options, createTreeMateOptions(props.keyField, props.childrenField, props.disabledField)));
|
|
95
95
|
const { value: initMergedValue } = mergedValueRef;
|
|
96
96
|
const pendingNodeKeyRef = ref(props.checkable
|
|
97
97
|
? null
|
|
@@ -258,7 +258,7 @@ export default defineComponent({
|
|
|
258
258
|
function handleMenuClickoutside(e) {
|
|
259
259
|
var _a;
|
|
260
260
|
if (mergedShowRef.value) {
|
|
261
|
-
if (!((_a = triggerInstRef.value) === null || _a === void 0 ? void 0 : _a.$el.contains(e
|
|
261
|
+
if (!((_a = triggerInstRef.value) === null || _a === void 0 ? void 0 : _a.$el.contains(getPreciseEventTarget(e)))) {
|
|
262
262
|
// outside select, don't need to return focus
|
|
263
263
|
closeMenu();
|
|
264
264
|
}
|
|
@@ -550,7 +550,7 @@ export default defineComponent({
|
|
|
550
550
|
(menuProps === null || menuProps === void 0 ? void 0 : menuProps.style) || '',
|
|
551
551
|
this.cssVars
|
|
552
552
|
], tabindex: 0, onMousedown: this.handleMenuMousedown, onKeydown: this.handleKeydown, onFocusin: this.handleMenuFocusin, onFocusout: this.handleMenuFocusout }),
|
|
553
|
-
h(NTree, { ref: "treeInstRef", blockLine: true, allowCheckingNotLoaded: this.allowCheckingNotLoaded, showIrrelevantNodes: false, animated: false, pattern: this.pattern, filter: this.mergedFilter, data: options, cancelable: multiple, labelField: this.labelField, keyField: this.keyField, childrenField: this.childrenField, 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, renderLabel: this.renderLabel, renderPrefix: this.renderPrefix, renderSuffix: this.renderSuffix, renderSwitcherIcon: this.renderSwitcherIcon, nodeProps: this.nodeProps, virtualScroll: this.consistentMenuWidth && this.virtualScroll, internalTreeSelect: true, internalUnifySelectCheck: true, internalScrollable: true, internalScrollablePadding: this.menuPadding, internalFocusable: false, internalCheckboxFocusable: false, internalRenderEmpty: () => (h("div", { class: `${mergedClsPrefix}-tree-select-menu__empty` }, resolveSlot($slots.empty, () => [
|
|
553
|
+
h(NTree, { ref: "treeInstRef", blockLine: true, allowCheckingNotLoaded: this.allowCheckingNotLoaded, showIrrelevantNodes: false, animated: false, pattern: this.pattern, filter: this.mergedFilter, data: options, cancelable: multiple, labelField: this.labelField, keyField: this.keyField, disabledField: this.disabledField, childrenField: this.childrenField, 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, renderLabel: this.renderLabel, renderPrefix: this.renderPrefix, renderSuffix: this.renderSuffix, renderSwitcherIcon: this.renderSwitcherIcon, nodeProps: this.nodeProps, virtualScroll: this.consistentMenuWidth && this.virtualScroll, internalTreeSelect: true, internalUnifySelectCheck: true, internalScrollable: true, internalScrollablePadding: this.menuPadding, internalFocusable: false, internalCheckboxFocusable: false, internalRenderEmpty: () => (h("div", { class: `${mergedClsPrefix}-tree-select-menu__empty` }, resolveSlot($slots.empty, () => [
|
|
554
554
|
h(NEmpty, { theme: mergedTheme.peers.Empty, themeOverrides: mergedTheme.peerOverrides.Empty })
|
|
555
555
|
]))), onLoad: this.onLoad, onUpdateCheckedKeys: this.handleUpdateCheckedKeys, onUpdateIndeterminateKeys: this.handleUpdateIndeterminateKeys, onUpdateExpandedKeys: this.doUpdateExpandedKeys }),
|
|
556
556
|
resolveWrappedSlot($slots.action, (children) => {
|
|
@@ -2,7 +2,7 @@ import commonVars from './_common';
|
|
|
2
2
|
import { commonLight } from '../../_styles/common';
|
|
3
3
|
export const self = (vars) => {
|
|
4
4
|
const { primaryColor, textColor2, borderColor, lineHeight, fontSize, borderRadiusSmall, dividerColor, fontWeightStrong, textColor1, textColor3, infoColor, warningColor, errorColor, successColor, codeColor } = vars;
|
|
5
|
-
return Object.assign(Object.assign({}, commonVars), { aTextColor: primaryColor, blockquoteTextColor: textColor2, blockquotePrefixColor: borderColor, blockquoteLineHeight: lineHeight, blockquoteFontSize: fontSize, codeBorderRadius: borderRadiusSmall, liTextColor: textColor2, liLineHeight: lineHeight, liFontSize: fontSize, hrColor: dividerColor, headerFontWeight: fontWeightStrong, headerTextColor: textColor1, pTextColor: textColor2, pTextColor1Depth: textColor1, pTextColor2Depth: textColor2, pTextColor3Depth: textColor3, pLineHeight: lineHeight, pFontSize: fontSize, headerBarColor: primaryColor, headerBarColorPrimary: primaryColor, headerBarColorInfo: infoColor, headerBarColorError: errorColor, headerBarColorWarning: warningColor, headerBarColorSuccess: successColor, textColor: textColor2, textColor1Depth: textColor1, textColor2Depth: textColor2, textColor3Depth: textColor3, textColorPrimary: primaryColor, textColorInfo: infoColor, textColorSuccess: successColor, textColorWarning: warningColor, textColorError: errorColor, codeTextColor: textColor2, codeColor
|
|
5
|
+
return Object.assign(Object.assign({}, commonVars), { aTextColor: primaryColor, blockquoteTextColor: textColor2, blockquotePrefixColor: borderColor, blockquoteLineHeight: lineHeight, blockquoteFontSize: fontSize, codeBorderRadius: borderRadiusSmall, liTextColor: textColor2, liLineHeight: lineHeight, liFontSize: fontSize, hrColor: dividerColor, headerFontWeight: fontWeightStrong, headerTextColor: textColor1, pTextColor: textColor2, pTextColor1Depth: textColor1, pTextColor2Depth: textColor2, pTextColor3Depth: textColor3, pLineHeight: lineHeight, pFontSize: fontSize, headerBarColor: primaryColor, headerBarColorPrimary: primaryColor, headerBarColorInfo: infoColor, headerBarColorError: errorColor, headerBarColorWarning: warningColor, headerBarColorSuccess: successColor, textColor: textColor2, textColor1Depth: textColor1, textColor2Depth: textColor2, textColor3Depth: textColor3, textColorPrimary: primaryColor, textColorInfo: infoColor, textColorSuccess: successColor, textColorWarning: warningColor, textColorError: errorColor, codeTextColor: textColor2, codeColor, codeBorder: '1px solid #0000' });
|
|
6
6
|
};
|
|
7
7
|
const typographyLight = {
|
|
8
8
|
name: 'Typography',
|
|
@@ -258,6 +258,7 @@ export declare const uploadProps: {
|
|
|
258
258
|
borderDisabledWarning: string;
|
|
259
259
|
rippleColorWarning: string;
|
|
260
260
|
colorError: string;
|
|
261
|
+
/** currently not used */
|
|
261
262
|
colorHoverError: string;
|
|
262
263
|
colorPressedError: string;
|
|
263
264
|
colorFocusError: string;
|
|
@@ -503,6 +504,7 @@ export declare const uploadProps: {
|
|
|
503
504
|
borderDisabledWarning: string;
|
|
504
505
|
rippleColorWarning: string;
|
|
505
506
|
colorError: string;
|
|
507
|
+
/** currently not used */
|
|
506
508
|
colorHoverError: string;
|
|
507
509
|
colorPressedError: string;
|
|
508
510
|
colorFocusError: string;
|
|
@@ -748,6 +750,7 @@ export declare const uploadProps: {
|
|
|
748
750
|
borderDisabledWarning: string;
|
|
749
751
|
rippleColorWarning: string;
|
|
750
752
|
colorError: string;
|
|
753
|
+
/** currently not used */
|
|
751
754
|
colorHoverError: string;
|
|
752
755
|
colorPressedError: string;
|
|
753
756
|
colorFocusError: string;
|
|
@@ -1076,6 +1079,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1076
1079
|
borderDisabledWarning: string;
|
|
1077
1080
|
rippleColorWarning: string;
|
|
1078
1081
|
colorError: string;
|
|
1082
|
+
/** currently not used */
|
|
1079
1083
|
colorHoverError: string;
|
|
1080
1084
|
colorPressedError: string;
|
|
1081
1085
|
colorFocusError: string;
|
|
@@ -1321,6 +1325,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1321
1325
|
borderDisabledWarning: string;
|
|
1322
1326
|
rippleColorWarning: string;
|
|
1323
1327
|
colorError: string;
|
|
1328
|
+
/** currently not used */
|
|
1324
1329
|
colorHoverError: string;
|
|
1325
1330
|
colorPressedError: string;
|
|
1326
1331
|
colorFocusError: string;
|
|
@@ -1566,6 +1571,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1566
1571
|
borderDisabledWarning: string;
|
|
1567
1572
|
rippleColorWarning: string;
|
|
1568
1573
|
colorError: string;
|
|
1574
|
+
/** currently not used */
|
|
1569
1575
|
colorHoverError: string;
|
|
1570
1576
|
colorPressedError: string;
|
|
1571
1577
|
colorFocusError: string;
|
|
@@ -1927,6 +1933,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1927
1933
|
borderDisabledWarning: string;
|
|
1928
1934
|
rippleColorWarning: string;
|
|
1929
1935
|
colorError: string;
|
|
1936
|
+
/** currently not used */
|
|
1930
1937
|
colorHoverError: string;
|
|
1931
1938
|
colorPressedError: string;
|
|
1932
1939
|
colorFocusError: string;
|
|
@@ -2272,6 +2279,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2272
2279
|
borderDisabledWarning: string;
|
|
2273
2280
|
rippleColorWarning: string;
|
|
2274
2281
|
colorError: string;
|
|
2282
|
+
/** currently not used */
|
|
2275
2283
|
colorHoverError: string;
|
|
2276
2284
|
colorPressedError: string;
|
|
2277
2285
|
colorFocusError: string;
|
|
@@ -2517,6 +2525,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2517
2525
|
borderDisabledWarning: string;
|
|
2518
2526
|
rippleColorWarning: string;
|
|
2519
2527
|
colorError: string;
|
|
2528
|
+
/** currently not used */
|
|
2520
2529
|
colorHoverError: string;
|
|
2521
2530
|
colorPressedError: string;
|
|
2522
2531
|
colorFocusError: string;
|
|
@@ -2762,6 +2771,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2762
2771
|
borderDisabledWarning: string;
|
|
2763
2772
|
rippleColorWarning: string;
|
|
2764
2773
|
colorError: string;
|
|
2774
|
+
/** currently not used */
|
|
2765
2775
|
colorHoverError: string;
|
|
2766
2776
|
colorPressedError: string;
|
|
2767
2777
|
colorFocusError: string;
|
package/es/upload/src/Upload.js
CHANGED
|
@@ -17,7 +17,7 @@ import { warn } from '../../_utils';
|
|
|
17
17
|
import NUploadProgress from './UploadProgress';
|
|
18
18
|
import { uploadInjectionKey } from './interface';
|
|
19
19
|
import { imageIcon, documentIcon } from './icons';
|
|
20
|
-
import { environmentSupportFile, isImageFile } from './utils';
|
|
20
|
+
import { download, environmentSupportFile, isImageFile } from './utils';
|
|
21
21
|
const buttonThemeOverrides = {
|
|
22
22
|
paddingMedium: '0 3px',
|
|
23
23
|
heightMedium: '24px',
|
|
@@ -139,7 +139,9 @@ export default defineComponent({
|
|
|
139
139
|
function handleDownload(file) {
|
|
140
140
|
const { onDownloadRef: { value: onDownload } } = NUpload;
|
|
141
141
|
void Promise.resolve(onDownload ? onDownload(Object.assign({}, file)) : true).then((res) => {
|
|
142
|
-
|
|
142
|
+
if (res !== false) {
|
|
143
|
+
download(file.url, file.name);
|
|
144
|
+
}
|
|
143
145
|
});
|
|
144
146
|
}
|
|
145
147
|
function handleAbort(file) {
|
package/es/upload/src/utils.d.ts
CHANGED
|
@@ -16,3 +16,4 @@ export declare function createSettledFileInfo(fileInfo: FileInfo): SettledFileIn
|
|
|
16
16
|
* version, so I can't simply use it.
|
|
17
17
|
*/
|
|
18
18
|
export declare function matchType(name: string, mimeType: string, accept: string): boolean;
|
|
19
|
+
export declare const download: (url: string | null, name: string | undefined) => void;
|
package/es/upload/src/utils.js
CHANGED
|
@@ -151,3 +151,15 @@ export function matchType(name, mimeType, accept) {
|
|
|
151
151
|
return false;
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
|
+
export const download = (url, name) => {
|
|
155
|
+
if (!url)
|
|
156
|
+
return;
|
|
157
|
+
const a = document.createElement('a');
|
|
158
|
+
a.href = url;
|
|
159
|
+
if (name !== undefined) {
|
|
160
|
+
a.download = name;
|
|
161
|
+
}
|
|
162
|
+
document.body.appendChild(a);
|
|
163
|
+
a.click();
|
|
164
|
+
document.body.removeChild(a);
|
|
165
|
+
};
|