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
|
@@ -64,40 +64,41 @@ export default cB('dropdown-menu', `
|
|
|
64
64
|
right: 4px;
|
|
65
65
|
transition: background-color .3s var(--n-bezier);
|
|
66
66
|
border-radius: var(--n-border-radius);
|
|
67
|
-
`), cNotM('disabled', [cM('pending',
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
67
|
+
`), cNotM('disabled', [cM('pending', `
|
|
68
|
+
color: var(--n-option-text-color-hover);
|
|
69
|
+
`, [cE('prefix, suffix', `
|
|
70
|
+
color: var(--n-option-text-color-hover);
|
|
71
|
+
`), c('&::before', 'background-color: var(--n-option-color-hover);')]), cM('active', `
|
|
72
|
+
color: var(--n-option-text-color-active);
|
|
73
|
+
`, [cE('prefix, suffix', `
|
|
74
|
+
color: var(--n-option-text-color-active);
|
|
75
|
+
`), c('&::before', 'background-color: var(--n-option-color-active);')]), cM('child-active', `
|
|
76
|
+
color: var(--n-option-text-color-child-active);
|
|
77
|
+
`, [cE('prefix, suffix', `
|
|
78
|
+
color: var(--n-option-text-color-child-active);
|
|
79
|
+
`)])]), cM('disabled', `
|
|
80
|
+
cursor: not-allowed;
|
|
81
|
+
opacity: var(--n-option-opacity-disabled);
|
|
82
|
+
`), cM('group', `
|
|
83
|
+
font-size: calc(var(--n-font-size) - 1px);
|
|
84
|
+
color: var(--n-group-header-text-color);
|
|
85
|
+
`, [cE('prefix', `
|
|
86
|
+
width: calc(var(--n-option-prefix-width) / 2);
|
|
87
|
+
`, [cM('show-icon', `
|
|
88
|
+
width: calc(var(--n-option-icon-prefix-width) / 2);
|
|
89
|
+
`)])]), cE('prefix', `
|
|
90
90
|
width: var(--n-option-prefix-width);
|
|
91
91
|
display: flex;
|
|
92
92
|
justify-content: center;
|
|
93
93
|
align-items: center;
|
|
94
94
|
color: var(--n-prefix-color);
|
|
95
95
|
transition: color .3s var(--n-bezier);
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
z-index: 1;
|
|
97
|
+
`, [cM('show-icon', `
|
|
98
|
+
width: var(--n-option-icon-prefix-width);
|
|
99
|
+
`), cB('icon', `
|
|
100
|
+
font-size: var(--n-option-icon-size);
|
|
101
|
+
`)]), cE('label', `
|
|
101
102
|
white-space: nowrap;
|
|
102
103
|
flex: 1;
|
|
103
104
|
z-index: 1;
|
|
@@ -112,11 +113,12 @@ export default cB('dropdown-menu', `
|
|
|
112
113
|
padding: 0 8px;
|
|
113
114
|
transition: color .3s var(--n-bezier);
|
|
114
115
|
color: var(--n-suffix-color);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
z-index: 1;
|
|
117
|
+
`, [cM('has-submenu', `
|
|
118
|
+
width: var(--n-option-icon-suffix-width);
|
|
119
|
+
`), cB('icon', `
|
|
120
|
+
font-size: var(--n-option-icon-size);
|
|
121
|
+
`)]), cB('dropdown-menu', 'pointer-events: all;')]), cB('dropdown-offset-container', `
|
|
120
122
|
pointer-events: none;
|
|
121
123
|
position: absolute;
|
|
122
124
|
left: 0;
|
|
@@ -44,6 +44,7 @@ export declare const dynamicInputProps: {
|
|
|
44
44
|
actionMarginRtl: string;
|
|
45
45
|
}, {
|
|
46
46
|
Input: import("../../_mixins").Theme<"Input", {
|
|
47
|
+
countTextColorDisabled: string;
|
|
47
48
|
countTextColor: string;
|
|
48
49
|
heightTiny: string;
|
|
49
50
|
heightSmall: string;
|
|
@@ -313,6 +314,7 @@ export declare const dynamicInputProps: {
|
|
|
313
314
|
actionMarginRtl: string;
|
|
314
315
|
}, {
|
|
315
316
|
Input: import("../../_mixins").Theme<"Input", {
|
|
317
|
+
countTextColorDisabled: string;
|
|
316
318
|
countTextColor: string;
|
|
317
319
|
heightTiny: string;
|
|
318
320
|
heightSmall: string;
|
|
@@ -582,6 +584,7 @@ export declare const dynamicInputProps: {
|
|
|
582
584
|
actionMarginRtl: string;
|
|
583
585
|
}, {
|
|
584
586
|
Input: import("../../_mixins").Theme<"Input", {
|
|
587
|
+
countTextColorDisabled: string;
|
|
585
588
|
countTextColor: string;
|
|
586
589
|
heightTiny: string;
|
|
587
590
|
heightSmall: string;
|
|
@@ -890,6 +893,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
890
893
|
actionMarginRtl: string;
|
|
891
894
|
}, {
|
|
892
895
|
Input: import("../../_mixins").Theme<"Input", {
|
|
896
|
+
countTextColorDisabled: string;
|
|
893
897
|
countTextColor: string;
|
|
894
898
|
heightTiny: string;
|
|
895
899
|
heightSmall: string;
|
|
@@ -1159,6 +1163,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1159
1163
|
actionMarginRtl: string;
|
|
1160
1164
|
}, {
|
|
1161
1165
|
Input: import("../../_mixins").Theme<"Input", {
|
|
1166
|
+
countTextColorDisabled: string;
|
|
1162
1167
|
countTextColor: string;
|
|
1163
1168
|
heightTiny: string;
|
|
1164
1169
|
heightSmall: string;
|
|
@@ -1428,6 +1433,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1428
1433
|
actionMarginRtl: string;
|
|
1429
1434
|
}, {
|
|
1430
1435
|
Input: import("../../_mixins").Theme<"Input", {
|
|
1436
|
+
countTextColorDisabled: string;
|
|
1431
1437
|
countTextColor: string;
|
|
1432
1438
|
heightTiny: string;
|
|
1433
1439
|
heightSmall: string;
|
|
@@ -1822,6 +1828,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1822
1828
|
};
|
|
1823
1829
|
peers: {
|
|
1824
1830
|
Input: import("../../_mixins").Theme<"Input", {
|
|
1831
|
+
countTextColorDisabled: string;
|
|
1825
1832
|
countTextColor: string;
|
|
1826
1833
|
heightTiny: string;
|
|
1827
1834
|
heightSmall: string;
|
|
@@ -2147,6 +2154,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2147
2154
|
actionMarginRtl: string;
|
|
2148
2155
|
}, {
|
|
2149
2156
|
Input: import("../../_mixins").Theme<"Input", {
|
|
2157
|
+
countTextColorDisabled: string;
|
|
2150
2158
|
countTextColor: string;
|
|
2151
2159
|
heightTiny: string;
|
|
2152
2160
|
heightSmall: string;
|
|
@@ -2416,6 +2424,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2416
2424
|
actionMarginRtl: string;
|
|
2417
2425
|
}, {
|
|
2418
2426
|
Input: import("../../_mixins").Theme<"Input", {
|
|
2427
|
+
countTextColorDisabled: string;
|
|
2419
2428
|
countTextColor: string;
|
|
2420
2429
|
heightTiny: string;
|
|
2421
2430
|
heightSmall: string;
|
|
@@ -2685,6 +2694,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2685
2694
|
actionMarginRtl: string;
|
|
2686
2695
|
}, {
|
|
2687
2696
|
Input: import("../../_mixins").Theme<"Input", {
|
|
2697
|
+
countTextColorDisabled: string;
|
|
2688
2698
|
countTextColor: string;
|
|
2689
2699
|
heightTiny: string;
|
|
2690
2700
|
heightSmall: string;
|
|
@@ -8,6 +8,7 @@ declare const dynamicInputLight: import("../../_mixins").Theme<"DynamicInput", {
|
|
|
8
8
|
actionMarginRtl: string;
|
|
9
9
|
}, {
|
|
10
10
|
Input: import("../../_mixins").Theme<"Input", {
|
|
11
|
+
countTextColorDisabled: string;
|
|
11
12
|
countTextColor: string;
|
|
12
13
|
heightTiny: string;
|
|
13
14
|
heightSmall: string;
|
|
@@ -42,6 +42,7 @@ export declare const dynamicTagsProps: {
|
|
|
42
42
|
inputWidth: string;
|
|
43
43
|
}, {
|
|
44
44
|
Input: import("../../_mixins").Theme<"Input", {
|
|
45
|
+
countTextColorDisabled: string;
|
|
45
46
|
countTextColor: string;
|
|
46
47
|
heightTiny: string;
|
|
47
48
|
heightSmall: string;
|
|
@@ -404,6 +405,7 @@ export declare const dynamicTagsProps: {
|
|
|
404
405
|
inputWidth: string;
|
|
405
406
|
}, {
|
|
406
407
|
Input: import("../../_mixins").Theme<"Input", {
|
|
408
|
+
countTextColorDisabled: string;
|
|
407
409
|
countTextColor: string;
|
|
408
410
|
heightTiny: string;
|
|
409
411
|
heightSmall: string;
|
|
@@ -766,6 +768,7 @@ export declare const dynamicTagsProps: {
|
|
|
766
768
|
inputWidth: string;
|
|
767
769
|
}, {
|
|
768
770
|
Input: import("../../_mixins").Theme<"Input", {
|
|
771
|
+
countTextColorDisabled: string;
|
|
769
772
|
countTextColor: string;
|
|
770
773
|
heightTiny: string;
|
|
771
774
|
heightSmall: string;
|
|
@@ -1166,6 +1169,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1166
1169
|
inputWidth: string;
|
|
1167
1170
|
}, {
|
|
1168
1171
|
Input: import("../../_mixins").Theme<"Input", {
|
|
1172
|
+
countTextColorDisabled: string;
|
|
1169
1173
|
countTextColor: string;
|
|
1170
1174
|
heightTiny: string;
|
|
1171
1175
|
heightSmall: string;
|
|
@@ -1528,6 +1532,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1528
1532
|
inputWidth: string;
|
|
1529
1533
|
}, {
|
|
1530
1534
|
Input: import("../../_mixins").Theme<"Input", {
|
|
1535
|
+
countTextColorDisabled: string;
|
|
1531
1536
|
countTextColor: string;
|
|
1532
1537
|
heightTiny: string;
|
|
1533
1538
|
heightSmall: string;
|
|
@@ -1890,6 +1895,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1890
1895
|
inputWidth: string;
|
|
1891
1896
|
}, {
|
|
1892
1897
|
Input: import("../../_mixins").Theme<"Input", {
|
|
1898
|
+
countTextColorDisabled: string;
|
|
1893
1899
|
countTextColor: string;
|
|
1894
1900
|
heightTiny: string;
|
|
1895
1901
|
heightSmall: string;
|
|
@@ -2389,6 +2395,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2389
2395
|
};
|
|
2390
2396
|
peers: {
|
|
2391
2397
|
Input: import("../../_mixins").Theme<"Input", {
|
|
2398
|
+
countTextColorDisabled: string;
|
|
2392
2399
|
countTextColor: string;
|
|
2393
2400
|
heightTiny: string;
|
|
2394
2401
|
heightSmall: string;
|
|
@@ -2815,6 +2822,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2815
2822
|
inputWidth: string;
|
|
2816
2823
|
}, {
|
|
2817
2824
|
Input: import("../../_mixins").Theme<"Input", {
|
|
2825
|
+
countTextColorDisabled: string;
|
|
2818
2826
|
countTextColor: string;
|
|
2819
2827
|
heightTiny: string;
|
|
2820
2828
|
heightSmall: string;
|
|
@@ -3177,6 +3185,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3177
3185
|
inputWidth: string;
|
|
3178
3186
|
}, {
|
|
3179
3187
|
Input: import("../../_mixins").Theme<"Input", {
|
|
3188
|
+
countTextColorDisabled: string;
|
|
3180
3189
|
countTextColor: string;
|
|
3181
3190
|
heightTiny: string;
|
|
3182
3191
|
heightSmall: string;
|
|
@@ -3539,6 +3548,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3539
3548
|
inputWidth: string;
|
|
3540
3549
|
}, {
|
|
3541
3550
|
Input: import("../../_mixins").Theme<"Input", {
|
|
3551
|
+
countTextColorDisabled: string;
|
|
3542
3552
|
countTextColor: string;
|
|
3543
3553
|
heightTiny: string;
|
|
3544
3554
|
heightSmall: string;
|
package/es/empty/styles/light.js
CHANGED
|
@@ -5,7 +5,7 @@ export const self = (vars) => {
|
|
|
5
5
|
return Object.assign(Object.assign({}, commonVars), { fontSizeSmall,
|
|
6
6
|
fontSizeMedium,
|
|
7
7
|
fontSizeLarge,
|
|
8
|
-
fontSizeHuge, textColor: textColorDisabled, iconColor
|
|
8
|
+
fontSizeHuge, textColor: textColorDisabled, iconColor, extraTextColor: textColor2 });
|
|
9
9
|
};
|
|
10
10
|
const emptyLight = {
|
|
11
11
|
name: 'Empty',
|
package/es/grid/src/Grid.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { CSSProperties, PropType, Ref } from 'vue';
|
|
|
2
2
|
import { VResizeObserverOnResize } from 'vueuc';
|
|
3
3
|
import { ExtractPublicPropTypes } from '../../_utils';
|
|
4
4
|
export declare const gridProps: {
|
|
5
|
+
readonly layoutShiftDisabled: BooleanConstructor;
|
|
5
6
|
readonly responsive: {
|
|
6
7
|
readonly type: PropType<"screen" | "self">;
|
|
7
8
|
readonly default: "self";
|
|
@@ -31,9 +32,11 @@ export interface NGridInjection {
|
|
|
31
32
|
itemStyleRef: Ref<CSSProperties | string | undefined>;
|
|
32
33
|
xGapRef: Ref<string | undefined>;
|
|
33
34
|
overflowRef: Ref<boolean>;
|
|
35
|
+
layoutShiftDisabledRef: Ref<boolean>;
|
|
34
36
|
}
|
|
35
37
|
export declare type GridProps = ExtractPublicPropTypes<typeof gridProps>;
|
|
36
38
|
declare const _default: import("vue").DefineComponent<{
|
|
39
|
+
readonly layoutShiftDisabled: BooleanConstructor;
|
|
37
40
|
readonly responsive: {
|
|
38
41
|
readonly type: PropType<"screen" | "self">;
|
|
39
42
|
readonly default: "self";
|
|
@@ -68,6 +71,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
68
71
|
handleResize: import("vue").ComputedRef<VResizeObserverOnResize | undefined>;
|
|
69
72
|
overflow: Ref<boolean>;
|
|
70
73
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
74
|
+
readonly layoutShiftDisabled: BooleanConstructor;
|
|
71
75
|
readonly responsive: {
|
|
72
76
|
readonly type: PropType<"screen" | "self">;
|
|
73
77
|
readonly default: "self";
|
|
@@ -95,6 +99,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
95
99
|
readonly cols: string | number;
|
|
96
100
|
readonly responsive: "screen" | "self";
|
|
97
101
|
readonly collapsed: boolean;
|
|
102
|
+
readonly layoutShiftDisabled: boolean;
|
|
98
103
|
readonly itemResponsive: boolean;
|
|
99
104
|
readonly collapsedRows: number;
|
|
100
105
|
readonly xGap: string | number;
|
package/es/grid/src/Grid.js
CHANGED
|
@@ -9,6 +9,7 @@ import { defaultSpan, gridInjectionKey } from './config';
|
|
|
9
9
|
const defaultCols = 24;
|
|
10
10
|
const SSR_ATTR_NAME = '__ssr__';
|
|
11
11
|
export const gridProps = {
|
|
12
|
+
layoutShiftDisabled: Boolean,
|
|
12
13
|
responsive: {
|
|
13
14
|
type: [String, Boolean],
|
|
14
15
|
default: 'self'
|
|
@@ -91,6 +92,7 @@ export default defineComponent({
|
|
|
91
92
|
}
|
|
92
93
|
});
|
|
93
94
|
provide(gridInjectionKey, {
|
|
95
|
+
layoutShiftDisabledRef: toRef(props, 'layoutShiftDisabled'),
|
|
94
96
|
isSsrRef,
|
|
95
97
|
itemStyleRef: toRef(props, 'itemStyle'),
|
|
96
98
|
xGapRef: responsiveXGapRef,
|
|
@@ -101,6 +103,15 @@ export default defineComponent({
|
|
|
101
103
|
contentEl: contentElRef,
|
|
102
104
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
103
105
|
style: computed(() => {
|
|
106
|
+
if (props.layoutShiftDisabled) {
|
|
107
|
+
return {
|
|
108
|
+
width: '100%',
|
|
109
|
+
display: 'grid',
|
|
110
|
+
gridTemplateColumns: `repeat(${props.cols}, minmax(0, 1fr))`,
|
|
111
|
+
columnGap: pxfy(props.xGap),
|
|
112
|
+
rowGap: pxfy(props.yGap)
|
|
113
|
+
};
|
|
114
|
+
}
|
|
104
115
|
return {
|
|
105
116
|
width: '100%',
|
|
106
117
|
display: 'grid',
|
|
@@ -117,6 +128,13 @@ export default defineComponent({
|
|
|
117
128
|
};
|
|
118
129
|
},
|
|
119
130
|
render() {
|
|
131
|
+
if (this.layoutShiftDisabled) {
|
|
132
|
+
return h('div', mergeProps({
|
|
133
|
+
ref: 'contentEl',
|
|
134
|
+
class: `${this.mergedClsPrefix}-grid`,
|
|
135
|
+
style: this.style
|
|
136
|
+
}, this.$attrs), this.$slots);
|
|
137
|
+
}
|
|
120
138
|
const renderContent = () => {
|
|
121
139
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
122
140
|
this.overflow = false;
|
|
@@ -41,6 +41,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
41
41
|
}, {
|
|
42
42
|
overflow: import("vue").Ref<boolean>;
|
|
43
43
|
itemStyle: import("vue").Ref<string | import("vue").CSSProperties | undefined>;
|
|
44
|
+
layoutShiftDisabled: import("vue").Ref<boolean>;
|
|
45
|
+
mergedXGap: import("vue").ComputedRef<string>;
|
|
44
46
|
deriveStyle: () => {
|
|
45
47
|
display: string;
|
|
46
48
|
gridColumn: string;
|
package/es/grid/src/GridItem.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, defineComponent, inject, getCurrentInstance } from 'vue';
|
|
1
|
+
import { h, defineComponent, inject, getCurrentInstance, computed } from 'vue';
|
|
2
2
|
import { pxfy } from 'seemly';
|
|
3
3
|
import { keysOf } from '../../_utils';
|
|
4
4
|
import { gridInjectionKey } from './config';
|
|
@@ -29,13 +29,17 @@ export default defineComponent({
|
|
|
29
29
|
alias: ['Gi'],
|
|
30
30
|
props: gridItemProps,
|
|
31
31
|
setup() {
|
|
32
|
-
const { isSsrRef, xGapRef, itemStyleRef, overflowRef
|
|
32
|
+
const { isSsrRef, xGapRef, itemStyleRef, overflowRef, layoutShiftDisabledRef
|
|
33
33
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
34
34
|
} = inject(gridInjectionKey);
|
|
35
35
|
const self = getCurrentInstance();
|
|
36
36
|
return {
|
|
37
37
|
overflow: overflowRef,
|
|
38
38
|
itemStyle: itemStyleRef,
|
|
39
|
+
layoutShiftDisabled: layoutShiftDisabledRef,
|
|
40
|
+
mergedXGap: computed(() => {
|
|
41
|
+
return pxfy(xGapRef.value || 0);
|
|
42
|
+
}),
|
|
39
43
|
deriveStyle: () => {
|
|
40
44
|
void isSsrRef.value;
|
|
41
45
|
// Here is quite a hack, I hope there is a better way to solve it
|
|
@@ -56,6 +60,15 @@ export default defineComponent({
|
|
|
56
60
|
},
|
|
57
61
|
render() {
|
|
58
62
|
var _a, _b;
|
|
63
|
+
if (this.layoutShiftDisabled) {
|
|
64
|
+
const { span, offset, mergedXGap } = this;
|
|
65
|
+
return (h("div", { style: {
|
|
66
|
+
gridColumn: `span ${span} / span ${span}`,
|
|
67
|
+
marginLeft: offset
|
|
68
|
+
? `calc((100% - (${span} - 1) * ${mergedXGap}) / ${span} * ${offset} + ${mergedXGap} * ${offset})`
|
|
69
|
+
: ''
|
|
70
|
+
} }, this.$slots));
|
|
71
|
+
}
|
|
59
72
|
return (h("div", { style: [this.itemStyle, this.deriveStyle()] }, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a, { overflow: this.overflow })));
|
|
60
73
|
}
|
|
61
74
|
});
|
package/es/input/src/Input.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropType, InputHTMLAttributes, TextareaHTMLAttributes } from 'vue';
|
|
1
|
+
import { PropType, InputHTMLAttributes, TextareaHTMLAttributes, VNodeChild } from 'vue';
|
|
2
2
|
import type { FormValidationStatus } from '../../form/src/interface';
|
|
3
3
|
import { ExtractPublicPropTypes } from '../../_utils';
|
|
4
4
|
import type { MaybeArray } from '../../_utils';
|
|
@@ -62,6 +62,9 @@ export declare const inputProps: {
|
|
|
62
62
|
default: undefined;
|
|
63
63
|
};
|
|
64
64
|
allowInput: PropType<(value: string) => boolean>;
|
|
65
|
+
renderCount: PropType<(props: {
|
|
66
|
+
value: string;
|
|
67
|
+
}) => VNodeChild>;
|
|
65
68
|
onMousedown: PropType<(e: MouseEvent) => void>;
|
|
66
69
|
onKeydown: PropType<(e: KeyboardEvent) => void>;
|
|
67
70
|
onKeyup: PropType<(e: KeyboardEvent) => void>;
|
|
@@ -92,6 +95,7 @@ export declare const inputProps: {
|
|
|
92
95
|
/** deprecated */
|
|
93
96
|
showPasswordToggle: BooleanConstructor;
|
|
94
97
|
theme: PropType<import("../../_mixins").Theme<"Input", {
|
|
98
|
+
countTextColorDisabled: string;
|
|
95
99
|
countTextColor: string;
|
|
96
100
|
heightTiny: string;
|
|
97
101
|
heightSmall: string;
|
|
@@ -152,6 +156,7 @@ export declare const inputProps: {
|
|
|
152
156
|
clearSize: string;
|
|
153
157
|
}, any>>;
|
|
154
158
|
themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Input", {
|
|
159
|
+
countTextColorDisabled: string;
|
|
155
160
|
countTextColor: string;
|
|
156
161
|
heightTiny: string;
|
|
157
162
|
heightSmall: string;
|
|
@@ -212,6 +217,7 @@ export declare const inputProps: {
|
|
|
212
217
|
clearSize: string;
|
|
213
218
|
}, any>>>;
|
|
214
219
|
builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Input", {
|
|
220
|
+
countTextColorDisabled: string;
|
|
215
221
|
countTextColor: string;
|
|
216
222
|
heightTiny: string;
|
|
217
223
|
heightSmall: string;
|
|
@@ -332,6 +338,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
332
338
|
default: undefined;
|
|
333
339
|
};
|
|
334
340
|
allowInput: PropType<(value: string) => boolean>;
|
|
341
|
+
renderCount: PropType<(props: {
|
|
342
|
+
value: string;
|
|
343
|
+
}) => VNodeChild>;
|
|
335
344
|
onMousedown: PropType<(e: MouseEvent) => void>;
|
|
336
345
|
onKeydown: PropType<(e: KeyboardEvent) => void>;
|
|
337
346
|
onKeyup: PropType<(e: KeyboardEvent) => void>;
|
|
@@ -362,6 +371,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
362
371
|
/** deprecated */
|
|
363
372
|
showPasswordToggle: BooleanConstructor;
|
|
364
373
|
theme: PropType<import("../../_mixins").Theme<"Input", {
|
|
374
|
+
countTextColorDisabled: string;
|
|
365
375
|
countTextColor: string;
|
|
366
376
|
heightTiny: string;
|
|
367
377
|
heightSmall: string;
|
|
@@ -422,6 +432,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
422
432
|
clearSize: string;
|
|
423
433
|
}, any>>;
|
|
424
434
|
themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Input", {
|
|
435
|
+
countTextColorDisabled: string;
|
|
425
436
|
countTextColor: string;
|
|
426
437
|
heightTiny: string;
|
|
427
438
|
heightSmall: string;
|
|
@@ -482,6 +493,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
482
493
|
clearSize: string;
|
|
483
494
|
}, any>>>;
|
|
484
495
|
builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Input", {
|
|
496
|
+
countTextColorDisabled: string;
|
|
485
497
|
countTextColor: string;
|
|
486
498
|
heightTiny: string;
|
|
487
499
|
heightSmall: string;
|
|
@@ -710,6 +722,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
710
722
|
name: "common";
|
|
711
723
|
};
|
|
712
724
|
self: {
|
|
725
|
+
countTextColorDisabled: string;
|
|
713
726
|
countTextColor: string;
|
|
714
727
|
heightTiny: string;
|
|
715
728
|
heightSmall: string;
|
|
@@ -777,6 +790,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
777
790
|
cssVars: import("vue").ComputedRef<{
|
|
778
791
|
'--n-bezier': string;
|
|
779
792
|
'--n-count-text-color': string;
|
|
793
|
+
'--n-count-text-color-disabled': string;
|
|
780
794
|
'--n-color': string;
|
|
781
795
|
'--n-font-size': string;
|
|
782
796
|
'--n-border-radius': string;
|
|
@@ -891,6 +905,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
891
905
|
default: undefined;
|
|
892
906
|
};
|
|
893
907
|
allowInput: PropType<(value: string) => boolean>;
|
|
908
|
+
renderCount: PropType<(props: {
|
|
909
|
+
value: string;
|
|
910
|
+
}) => VNodeChild>;
|
|
894
911
|
onMousedown: PropType<(e: MouseEvent) => void>;
|
|
895
912
|
onKeydown: PropType<(e: KeyboardEvent) => void>;
|
|
896
913
|
onKeyup: PropType<(e: KeyboardEvent) => void>;
|
|
@@ -921,6 +938,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
921
938
|
/** deprecated */
|
|
922
939
|
showPasswordToggle: BooleanConstructor;
|
|
923
940
|
theme: PropType<import("../../_mixins").Theme<"Input", {
|
|
941
|
+
countTextColorDisabled: string;
|
|
924
942
|
countTextColor: string;
|
|
925
943
|
heightTiny: string;
|
|
926
944
|
heightSmall: string;
|
|
@@ -981,6 +999,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
981
999
|
clearSize: string;
|
|
982
1000
|
}, any>>;
|
|
983
1001
|
themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Input", {
|
|
1002
|
+
countTextColorDisabled: string;
|
|
984
1003
|
countTextColor: string;
|
|
985
1004
|
heightTiny: string;
|
|
986
1005
|
heightSmall: string;
|
|
@@ -1041,6 +1060,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1041
1060
|
clearSize: string;
|
|
1042
1061
|
}, any>>>;
|
|
1043
1062
|
builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Input", {
|
|
1063
|
+
countTextColorDisabled: string;
|
|
1044
1064
|
countTextColor: string;
|
|
1045
1065
|
heightTiny: string;
|
|
1046
1066
|
heightSmall: string;
|
package/es/input/src/Input.js
CHANGED
|
@@ -3,16 +3,17 @@ import { useMergedState, useMemo } from 'vooks';
|
|
|
3
3
|
import { getPadding } from 'seemly';
|
|
4
4
|
import { VResizeObserver } from 'vueuc';
|
|
5
5
|
import { off, on } from 'evtd';
|
|
6
|
+
import { isSafari } from '../../_utils/env/browser';
|
|
6
7
|
import { EyeIcon, EyeOffIcon } from '../../_internal/icons';
|
|
7
8
|
import { useRtl } from '../../_mixins/use-rtl';
|
|
8
9
|
import { NBaseClear, NBaseIcon, NBaseSuffix, NScrollbar } from '../../_internal';
|
|
9
|
-
import { useTheme, useLocale, useFormItem, useConfig, useThemeClass } from '../../_mixins';
|
|
10
|
+
import { useTheme, useLocale, useFormItem, useConfig, useThemeClass, useStyle } from '../../_mixins';
|
|
10
11
|
import { call, createKey, resolveSlot, resolveWrappedSlot, warnOnce } from '../../_utils';
|
|
11
12
|
import { inputLight } from '../styles';
|
|
12
13
|
import { inputInjectionKey } from './interface';
|
|
13
14
|
import { isEmptyInputValue, useCursor } from './utils';
|
|
14
15
|
import WordCount from './WordCount';
|
|
15
|
-
import style from './styles/input.cssr';
|
|
16
|
+
import style, { safariStyle } from './styles/input.cssr';
|
|
16
17
|
export const inputProps = Object.assign(Object.assign({}, useTheme.props), { bordered: {
|
|
17
18
|
type: Boolean,
|
|
18
19
|
default: undefined
|
|
@@ -43,7 +44,7 @@ export const inputProps = Object.assign(Object.assign({}, useTheme.props), { bor
|
|
|
43
44
|
}, showCount: Boolean, loading: {
|
|
44
45
|
type: Boolean,
|
|
45
46
|
default: undefined
|
|
46
|
-
}, allowInput: Function, onMousedown: Function, onKeydown: Function, onKeyup: Function, onInput: [Function, Array], onFocus: [Function, Array], onBlur: [Function, Array], onClick: [Function, Array], onChange: [Function, Array], onClear: [Function, Array], status: String, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array],
|
|
47
|
+
}, allowInput: Function, renderCount: Function, onMousedown: Function, onKeydown: Function, onKeyup: Function, onInput: [Function, Array], onFocus: [Function, Array], onBlur: [Function, Array], onClick: [Function, Array], onChange: [Function, Array], onClear: [Function, Array], status: String, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array],
|
|
47
48
|
/** private */
|
|
48
49
|
textDecoration: [String, Array], attrSize: {
|
|
49
50
|
type: Number,
|
|
@@ -64,6 +65,9 @@ export default defineComponent({
|
|
|
64
65
|
}
|
|
65
66
|
const { mergedClsPrefixRef, mergedBorderedRef, inlineThemeDisabled, mergedRtlRef } = useConfig(props);
|
|
66
67
|
const themeRef = useTheme('Input', '-input', style, inputLight, props, mergedClsPrefixRef);
|
|
68
|
+
if (isSafari) {
|
|
69
|
+
useStyle('-input-safari', safariStyle, mergedClsPrefixRef);
|
|
70
|
+
}
|
|
67
71
|
// dom refs
|
|
68
72
|
const wrapperElRef = ref(null);
|
|
69
73
|
const textareaElRef = ref(null);
|
|
@@ -313,6 +317,9 @@ export default defineComponent({
|
|
|
313
317
|
function handleInput(e, index = 0, event = 'input') {
|
|
314
318
|
const targetValue = e.target.value;
|
|
315
319
|
syncMirror(targetValue);
|
|
320
|
+
if (e instanceof InputEvent && !e.isComposing) {
|
|
321
|
+
isComposingRef.value = false;
|
|
322
|
+
}
|
|
316
323
|
if (props.type === 'textarea') {
|
|
317
324
|
const { value: textareaScrollbarInst } = textareaScrollbarInstRef;
|
|
318
325
|
if (textareaScrollbarInst) {
|
|
@@ -447,7 +454,7 @@ export default defineComponent({
|
|
|
447
454
|
const { left, top, width, height } = wrapperEl.getBoundingClientRect();
|
|
448
455
|
const resizeHandleSize = 14;
|
|
449
456
|
if (left + width - resizeHandleSize < e.clientX &&
|
|
450
|
-
e.
|
|
457
|
+
e.clientX < left + width &&
|
|
451
458
|
top + height - resizeHandleSize < e.clientY &&
|
|
452
459
|
e.clientY < top + height) {
|
|
453
460
|
// touching resize handle, just let it go.
|
|
@@ -673,11 +680,12 @@ export default defineComponent({
|
|
|
673
680
|
const rtlEnabledRef = useRtl('Input', mergedRtlRef, mergedClsPrefixRef);
|
|
674
681
|
const cssVarsRef = computed(() => {
|
|
675
682
|
const { value: size } = mergedSizeRef;
|
|
676
|
-
const { common: { cubicBezierEaseInOut }, self: { color, borderRadius, textColor, caretColor, caretColorError, caretColorWarning, textDecorationColor, border, borderDisabled, borderHover, borderFocus, placeholderColor, placeholderColorDisabled, lineHeightTextarea, colorDisabled, colorFocus, textColorDisabled, boxShadowFocus, iconSize, colorFocusWarning, boxShadowFocusWarning, borderWarning, borderFocusWarning, borderHoverWarning, colorFocusError, boxShadowFocusError, borderError, borderFocusError, borderHoverError, clearSize, clearColor, clearColorHover, clearColorPressed, iconColor, iconColorDisabled, suffixTextColor, countTextColor, iconColorHover, iconColorPressed, loadingColor, loadingColorError, loadingColorWarning, [createKey('padding', size)]: padding, [createKey('fontSize', size)]: fontSize, [createKey('height', size)]: height } } = themeRef.value;
|
|
683
|
+
const { common: { cubicBezierEaseInOut }, self: { color, borderRadius, textColor, caretColor, caretColorError, caretColorWarning, textDecorationColor, border, borderDisabled, borderHover, borderFocus, placeholderColor, placeholderColorDisabled, lineHeightTextarea, colorDisabled, colorFocus, textColorDisabled, boxShadowFocus, iconSize, colorFocusWarning, boxShadowFocusWarning, borderWarning, borderFocusWarning, borderHoverWarning, colorFocusError, boxShadowFocusError, borderError, borderFocusError, borderHoverError, clearSize, clearColor, clearColorHover, clearColorPressed, iconColor, iconColorDisabled, suffixTextColor, countTextColor, countTextColorDisabled, iconColorHover, iconColorPressed, loadingColor, loadingColorError, loadingColorWarning, [createKey('padding', size)]: padding, [createKey('fontSize', size)]: fontSize, [createKey('height', size)]: height } } = themeRef.value;
|
|
677
684
|
const { left: paddingLeft, right: paddingRight } = getPadding(padding);
|
|
678
685
|
return {
|
|
679
686
|
'--n-bezier': cubicBezierEaseInOut,
|
|
680
687
|
'--n-count-text-color': countTextColor,
|
|
688
|
+
'--n-count-text-color-disabled': countTextColorDisabled,
|
|
681
689
|
'--n-color': color,
|
|
682
690
|
'--n-font-size': fontSize,
|
|
683
691
|
'--n-border-radius': borderRadius,
|
|
@@ -884,6 +892,15 @@ export default defineComponent({
|
|
|
884
892
|
}))) : null,
|
|
885
893
|
this.mergedBordered ? (h("div", { class: `${mergedClsPrefix}-input__border` })) : null,
|
|
886
894
|
this.mergedBordered ? (h("div", { class: `${mergedClsPrefix}-input__state-border` })) : null,
|
|
887
|
-
this.showCount && type === 'textarea' ? (h(WordCount, null, {
|
|
895
|
+
this.showCount && type === 'textarea' ? (h(WordCount, null, {
|
|
896
|
+
default: (props) => {
|
|
897
|
+
var _a;
|
|
898
|
+
const { renderCount } = this;
|
|
899
|
+
if (renderCount) {
|
|
900
|
+
return renderCount(props);
|
|
901
|
+
}
|
|
902
|
+
return (_a = $slots.count) === null || _a === void 0 ? void 0 : _a.call($slots, props);
|
|
903
|
+
}
|
|
904
|
+
})) : null));
|
|
888
905
|
}
|
|
889
906
|
});
|