naive-ui 2.20.2 → 2.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/_internal/scrollbar/src/ScrollBar.d.ts +1 -0
- package/es/_internal/scrollbar/src/ScrollBar.js +9 -4
- package/es/_internal/select-menu/src/SelectMenu.d.ts +5 -1
- package/es/_internal/selection/src/Selection.d.ts +5 -1
- package/es/_internal/suffix/src/Suffix.d.ts +5 -2
- package/es/_internal/suffix/src/Suffix.js +4 -1
- package/es/_styles/common/dark.js +2 -1
- package/es/_styles/common/light.d.ts +4 -0
- package/es/_styles/common/light.js +5 -2
- package/es/_styles/global/index.cssr.js +9 -4
- package/es/_styles/transitions/icon-switch.cssr.js +6 -2
- package/es/_utils/naive/extract-public-props.d.ts +1 -1
- package/es/alert/src/Alert.d.ts +4 -0
- package/es/auto-complete/src/AutoComplete.d.ts +9 -1
- package/es/auto-complete/src/AutoComplete.js +5 -2
- package/es/avatar/src/Avatar.d.ts +8 -1
- package/es/avatar/src/Avatar.js +41 -9
- package/es/avatar/src/styles/index.cssr.js +2 -2
- package/es/button/src/Button.d.ts +149 -52
- package/es/button/src/Button.js +128 -56
- package/es/button/src/interface.d.ts +1 -1
- package/es/button/src/styles/button.cssr.js +1 -0
- package/es/button/styles/dark.js +3 -0
- package/es/button/styles/light.d.ts +14 -5
- package/es/button/styles/light.js +10 -3
- package/es/calendar/src/Calendar.d.ts +144 -50
- package/es/calendar/styles/light.d.ts +14 -5
- package/es/card/src/Card.d.ts +4 -0
- package/es/cascader/src/Cascader.d.ts +4 -0
- package/es/cascader/src/CascaderOption.d.ts +4 -0
- package/es/cascader/src/CascaderSelectMenu.d.ts +4 -0
- package/es/cascader/src/CascaderSubmenu.d.ts +4 -0
- package/es/checkbox/src/Checkbox.d.ts +9 -5
- package/es/checkbox/src/Checkbox.js +8 -9
- package/es/collapse/src/Collapse.d.ts +4 -0
- package/es/color-picker/src/ColorInputUnit.d.ts +18 -5
- package/es/color-picker/src/ColorPicker.d.ts +126 -45
- package/es/color-picker/styles/light.d.ts +14 -5
- package/es/data-table/src/DataTable.d.ts +184 -51
- package/es/data-table/src/DataTable.js +11 -6
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +21 -5
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +22 -6
- package/es/data-table/src/TableParts/Body.d.ts +26 -6
- package/es/data-table/src/TableParts/Body.js +77 -39
- package/es/data-table/src/TableParts/BodyCheckbox.js +1 -1
- package/es/data-table/src/TableParts/Cell.d.ts +42 -10
- package/es/data-table/src/TableParts/Header.d.ts +21 -5
- package/es/data-table/src/TableParts/Header.js +1 -1
- package/es/data-table/src/interface.d.ts +4 -1
- package/es/data-table/src/styles/index.cssr.js +9 -10
- package/es/data-table/src/use-table-data.js +3 -3
- package/es/data-table/styles/light.d.ts +20 -5
- package/es/data-table/styles/light.js +4 -4
- package/es/date-picker/src/DatePicker.d.ts +329 -127
- package/es/date-picker/src/DatePicker.js +7 -17
- package/es/date-picker/src/config.d.ts +9 -0
- package/es/date-picker/src/config.js +8 -0
- package/es/date-picker/src/panel/date.d.ts +53 -20
- package/es/date-picker/src/panel/daterange.d.ts +52 -19
- package/es/date-picker/src/panel/datetime.d.ts +53 -20
- package/es/date-picker/src/panel/datetimerange.d.ts +52 -19
- package/es/date-picker/src/panel/month.d.ts +88 -61
- package/es/date-picker/src/panel/month.js +9 -6
- package/es/date-picker/src/panel/use-calendar.d.ts +61 -28
- package/es/date-picker/src/panel/use-calendar.js +9 -2
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +50 -17
- package/es/date-picker/src/panel/use-dual-calendar.js +4 -0
- package/es/date-picker/src/panel/use-panel-common.d.ts +48 -15
- package/es/date-picker/styles/_common.d.ts +2 -0
- package/es/date-picker/styles/_common.js +3 -1
- package/es/date-picker/styles/light.d.ts +32 -10
- package/es/dialog/src/Dialog.d.ts +105 -38
- package/es/dialog/src/DialogEnvironment.d.ts +2 -2
- package/es/dialog/src/DialogProvider.d.ts +2 -2
- package/es/dialog/styles/light.d.ts +14 -5
- package/es/drawer/src/Drawer.d.ts +4 -0
- package/es/drawer/src/DrawerBodyWrapper.d.ts +4 -0
- package/es/drawer/src/DrawerContent.d.ts +4 -0
- package/es/dropdown/index.d.ts +1 -1
- package/es/dropdown/src/Dropdown.d.ts +11 -7
- package/es/dropdown/src/DropdownGroup.d.ts +2 -3
- package/es/dropdown/src/DropdownGroupHeader.js +3 -3
- package/es/dropdown/src/DropdownMenu.d.ts +3 -4
- package/es/dropdown/src/DropdownMenu.js +5 -4
- package/es/dropdown/src/DropdownOption.d.ts +3 -4
- package/es/dropdown/src/DropdownOption.js +5 -4
- package/es/dropdown/src/DropdownRenderOption.d.ts +2 -3
- package/es/dropdown/src/interface.d.ts +9 -30
- package/es/dynamic-input/src/DynamicInput.d.ts +144 -50
- package/es/dynamic-input/src/InputPreset.d.ts +18 -5
- package/es/dynamic-input/src/PairPreset.d.ts +18 -5
- package/es/dynamic-input/styles/light.d.ts +14 -5
- package/es/dynamic-tags/src/DynamicTags.d.ts +145 -50
- package/es/dynamic-tags/styles/light.d.ts +14 -5
- package/es/ellipsis/src/Ellipsis.d.ts +4 -0
- package/es/form/src/FormItemGridItem.d.ts +2 -2
- package/es/global-style/src/GlobalStyle.js +2 -0
- package/es/grid/src/Grid.js +1 -0
- package/es/grid/src/GridItem.d.ts +2 -2
- package/es/image/src/ImagePreview.d.ts +1 -0
- package/es/image/src/ImagePreview.js +51 -4
- package/es/image/src/interface.d.ts +6 -0
- package/es/image/src/interface.js +1 -0
- package/es/input/src/Input.d.ts +5 -0
- package/es/input/src/Input.js +9 -3
- package/es/input/src/interface.d.ts +1 -0
- package/es/input-number/src/InputNumber.d.ts +179 -50
- package/es/input-number/src/InputNumber.js +22 -6
- package/es/input-number/styles/light.d.ts +14 -5
- package/es/layout/src/Layout.d.ts +8 -0
- package/es/layout/src/LayoutContent.d.ts +4 -0
- package/es/layout/src/LayoutSider.d.ts +4 -0
- package/es/locales/index.d.ts +2 -0
- package/es/locales/index.js +1 -0
- package/es/locales/utils/index.d.ts +8 -0
- package/es/locales/utils/index.js +4 -0
- package/es/log/src/Log.d.ts +10 -25
- package/es/log/src/Log.js +2 -11
- package/es/log/src/LogLine.d.ts +1 -0
- package/es/log/src/LogLine.js +12 -10
- package/es/mention/src/Mention.d.ts +5 -0
- package/es/menu/index.d.ts +1 -1
- package/es/menu/src/Menu.d.ts +33 -8
- package/es/menu/src/Menu.js +32 -10
- package/es/menu/src/MenuDivider.d.ts +2 -0
- package/es/menu/src/MenuDivider.js +11 -0
- package/es/menu/src/MenuOption.d.ts +12 -2
- package/es/menu/src/MenuOptionContent.d.ts +7 -2
- package/es/menu/src/Submenu.d.ts +21 -17
- package/es/menu/src/interface.d.ts +23 -4
- package/es/menu/src/styles/index.cssr.js +6 -1
- package/es/menu/src/utils.d.ts +4 -2
- package/es/menu/src/utils.js +16 -2
- package/es/menu/styles/light.d.ts +2 -0
- package/es/menu/styles/light.js +3 -2
- package/es/modal/src/BodyWrapper.d.ts +34 -12
- package/es/modal/src/Modal.d.ts +174 -66
- package/es/modal/src/presetProps.d.ts +1 -1
- package/es/modal/styles/light.d.ts +14 -5
- package/es/notification/src/NotificationContainer.d.ts +11 -0
- package/es/notification/src/NotificationContainer.js +7 -2
- package/es/notification/src/NotificationProvider.d.ts +17 -0
- package/es/notification/src/NotificationProvider.js +38 -3
- package/es/notification/src/styles/index.cssr.d.ts +2 -1
- package/es/notification/src/styles/index.cssr.js +41 -12
- package/es/pagination/index.d.ts +1 -1
- package/es/pagination/src/Pagination.d.ts +21 -12
- package/es/pagination/src/Pagination.js +16 -6
- package/es/pagination/src/interface.d.ts +2 -0
- package/es/popconfirm/src/Popconfirm.d.ts +151 -57
- package/es/popconfirm/src/PopconfirmPanel.d.ts +2 -2
- package/es/popconfirm/styles/light.d.ts +14 -5
- package/es/popover/src/Popover.d.ts +6 -6
- package/es/popover/src/Popover.js +2 -5
- package/es/popover/src/PopoverBody.d.ts +5 -5
- package/es/popover/src/PopoverBody.js +2 -1
- package/es/popover/src/styles/index.cssr.js +0 -1
- package/es/popselect/src/Popselect.d.ts +9 -5
- package/es/popselect/src/PopselectPanel.d.ts +4 -0
- package/es/radio/src/Radio.d.ts +3 -0
- package/es/radio/src/RadioButton.d.ts +3 -0
- package/es/radio/src/use-radio.d.ts +2 -0
- package/es/radio/src/use-radio.js +6 -3
- package/es/select/src/Select.d.ts +4 -0
- package/es/slider/src/Slider.d.ts +71 -91
- package/es/slider/src/Slider.js +342 -583
- package/es/slider/src/interface.d.ts +1 -1
- package/es/slider/src/styles/index.cssr.js +86 -16
- package/es/slider/src/utils.d.ts +10 -1
- package/es/slider/src/utils.js +9 -0
- package/es/slider/styles/_common.d.ts +1 -0
- package/es/slider/styles/_common.js +1 -0
- package/es/slider/styles/light.d.ts +1 -0
- package/es/space/src/Space.js +2 -0
- package/es/steps/src/Step.js +1 -1
- package/es/table/src/Table.d.ts +35 -0
- package/es/table/src/Table.js +8 -4
- package/es/table/src/styles/index.cssr.js +1 -1
- package/es/table/styles/light.d.ts +3 -0
- package/es/table/styles/light.js +2 -2
- package/es/tabs/index.d.ts +2 -0
- package/es/tabs/index.js +1 -0
- package/es/tabs/src/Tab.d.ts +35 -18
- package/es/tabs/src/Tab.js +11 -12
- package/es/tabs/src/Tabs.js +58 -18
- package/es/tag/src/Tag.d.ts +8 -3
- package/es/tag/src/Tag.js +10 -2
- package/es/tag/src/styles/index.cssr.js +10 -5
- package/es/tag/src/styles/rtl.cssr.js +7 -1
- package/es/theme-editor/src/ThemeEditor.d.ts +4 -0
- package/es/time-picker/src/Panel.d.ts +18 -5
- package/es/time-picker/src/TimePicker.d.ts +145 -50
- package/es/time-picker/src/TimePicker.js +3 -0
- package/es/time-picker/styles/light.d.ts +14 -5
- package/es/tooltip/src/Tooltip.d.ts +9 -5
- package/es/transfer/src/Transfer.d.ts +146 -52
- package/es/transfer/src/TransferFilter.d.ts +18 -5
- package/es/transfer/src/TransferList.d.ts +18 -5
- package/es/transfer/src/TransferListItem.d.ts +18 -5
- package/es/transfer/styles/light.d.ts +14 -5
- package/es/tree/src/Tree.d.ts +10 -6
- package/es/tree/src/TreeNodeCheckbox.d.ts +4 -0
- package/es/tree/src/TreeNodeSwitcher.d.ts +1 -1
- package/es/tree-select/src/TreeSelect.d.ts +6 -2
- package/es/upload/index.d.ts +1 -2
- package/es/upload/src/Upload.d.ts +151 -59
- package/es/upload/src/Upload.js +69 -16
- package/es/upload/src/UploadFile.d.ts +19 -6
- package/es/upload/src/UploadProgress.d.ts +18 -5
- package/es/upload/src/interface.d.ts +14 -1
- package/es/upload/styles/light.d.ts +14 -5
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/scrollbar/src/ScrollBar.d.ts +1 -0
- package/lib/_internal/scrollbar/src/ScrollBar.js +9 -4
- package/lib/_internal/select-menu/src/SelectMenu.d.ts +5 -1
- package/lib/_internal/selection/src/Selection.d.ts +5 -1
- package/lib/_internal/suffix/src/Suffix.d.ts +5 -2
- package/lib/_internal/suffix/src/Suffix.js +4 -1
- package/lib/_styles/common/dark.js +2 -1
- package/lib/_styles/common/light.d.ts +4 -0
- package/lib/_styles/common/light.js +5 -2
- package/lib/_styles/global/index.cssr.js +10 -5
- package/lib/_styles/transitions/icon-switch.cssr.js +7 -2
- package/lib/_utils/naive/extract-public-props.d.ts +1 -1
- package/lib/alert/src/Alert.d.ts +4 -0
- package/lib/auto-complete/src/AutoComplete.d.ts +9 -1
- package/lib/auto-complete/src/AutoComplete.js +5 -2
- package/lib/avatar/src/Avatar.d.ts +8 -1
- package/lib/avatar/src/Avatar.js +40 -8
- package/lib/avatar/src/styles/index.cssr.js +2 -2
- package/lib/button/src/Button.d.ts +149 -52
- package/lib/button/src/Button.js +126 -54
- package/lib/button/src/interface.d.ts +1 -1
- package/lib/button/src/styles/button.cssr.js +1 -0
- package/lib/button/styles/dark.js +3 -0
- package/lib/button/styles/light.d.ts +14 -5
- package/lib/button/styles/light.js +10 -3
- package/lib/calendar/src/Calendar.d.ts +144 -50
- package/lib/calendar/styles/light.d.ts +14 -5
- package/lib/card/src/Card.d.ts +4 -0
- package/lib/cascader/src/Cascader.d.ts +4 -0
- package/lib/cascader/src/CascaderOption.d.ts +4 -0
- package/lib/cascader/src/CascaderSelectMenu.d.ts +4 -0
- package/lib/cascader/src/CascaderSubmenu.d.ts +4 -0
- package/lib/checkbox/src/Checkbox.d.ts +9 -5
- package/lib/checkbox/src/Checkbox.js +8 -9
- package/lib/collapse/src/Collapse.d.ts +4 -0
- package/lib/color-picker/src/ColorInputUnit.d.ts +18 -5
- package/lib/color-picker/src/ColorPicker.d.ts +126 -45
- package/lib/color-picker/styles/light.d.ts +14 -5
- package/lib/data-table/src/DataTable.d.ts +184 -51
- package/lib/data-table/src/DataTable.js +11 -6
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +21 -5
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +22 -6
- package/lib/data-table/src/TableParts/Body.d.ts +26 -6
- package/lib/data-table/src/TableParts/Body.js +77 -39
- package/lib/data-table/src/TableParts/BodyCheckbox.js +1 -1
- package/lib/data-table/src/TableParts/Cell.d.ts +42 -10
- package/lib/data-table/src/TableParts/Header.d.ts +21 -5
- package/lib/data-table/src/TableParts/Header.js +1 -1
- package/lib/data-table/src/interface.d.ts +4 -1
- package/lib/data-table/src/styles/index.cssr.js +9 -10
- package/lib/data-table/src/use-table-data.js +3 -3
- package/lib/data-table/styles/light.d.ts +20 -5
- package/lib/data-table/styles/light.js +4 -4
- package/lib/date-picker/src/DatePicker.d.ts +329 -127
- package/lib/date-picker/src/DatePicker.js +7 -17
- package/lib/date-picker/src/config.d.ts +9 -0
- package/lib/date-picker/src/config.js +9 -1
- package/lib/date-picker/src/panel/date.d.ts +53 -20
- package/lib/date-picker/src/panel/daterange.d.ts +52 -19
- package/lib/date-picker/src/panel/datetime.d.ts +53 -20
- package/lib/date-picker/src/panel/datetimerange.d.ts +52 -19
- package/lib/date-picker/src/panel/month.d.ts +88 -61
- package/lib/date-picker/src/panel/month.js +9 -6
- package/lib/date-picker/src/panel/use-calendar.d.ts +61 -28
- package/lib/date-picker/src/panel/use-calendar.js +8 -1
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +50 -17
- package/lib/date-picker/src/panel/use-dual-calendar.js +4 -0
- package/lib/date-picker/src/panel/use-panel-common.d.ts +48 -15
- package/lib/date-picker/styles/_common.d.ts +2 -0
- package/lib/date-picker/styles/_common.js +3 -1
- package/lib/date-picker/styles/light.d.ts +32 -10
- package/lib/dialog/src/Dialog.d.ts +105 -38
- package/lib/dialog/src/DialogEnvironment.d.ts +2 -2
- package/lib/dialog/src/DialogProvider.d.ts +2 -2
- package/lib/dialog/styles/light.d.ts +14 -5
- package/lib/drawer/src/Drawer.d.ts +4 -0
- package/lib/drawer/src/DrawerBodyWrapper.d.ts +4 -0
- package/lib/drawer/src/DrawerContent.d.ts +4 -0
- package/lib/dropdown/index.d.ts +1 -1
- package/lib/dropdown/src/Dropdown.d.ts +11 -7
- package/lib/dropdown/src/DropdownGroup.d.ts +2 -3
- package/lib/dropdown/src/DropdownGroupHeader.js +3 -3
- package/lib/dropdown/src/DropdownMenu.d.ts +3 -4
- package/lib/dropdown/src/DropdownMenu.js +5 -4
- package/lib/dropdown/src/DropdownOption.d.ts +3 -4
- package/lib/dropdown/src/DropdownOption.js +5 -4
- package/lib/dropdown/src/DropdownRenderOption.d.ts +2 -3
- package/lib/dropdown/src/interface.d.ts +9 -30
- package/lib/dynamic-input/src/DynamicInput.d.ts +144 -50
- package/lib/dynamic-input/src/InputPreset.d.ts +18 -5
- package/lib/dynamic-input/src/PairPreset.d.ts +18 -5
- package/lib/dynamic-input/styles/light.d.ts +14 -5
- package/lib/dynamic-tags/src/DynamicTags.d.ts +145 -50
- package/lib/dynamic-tags/styles/light.d.ts +14 -5
- package/lib/ellipsis/src/Ellipsis.d.ts +4 -0
- package/lib/form/src/FormItemGridItem.d.ts +2 -2
- package/lib/global-style/src/GlobalStyle.js +2 -0
- package/lib/grid/src/Grid.js +1 -0
- package/lib/grid/src/GridItem.d.ts +2 -2
- package/lib/image/src/ImagePreview.d.ts +1 -0
- package/lib/image/src/ImagePreview.js +51 -4
- package/lib/image/src/interface.d.ts +6 -0
- package/lib/image/src/interface.js +2 -0
- package/lib/input/src/Input.d.ts +5 -0
- package/lib/input/src/Input.js +9 -3
- package/lib/input/src/interface.d.ts +1 -0
- package/lib/input-number/src/InputNumber.d.ts +179 -50
- package/lib/input-number/src/InputNumber.js +22 -6
- package/lib/input-number/styles/light.d.ts +14 -5
- package/lib/layout/src/Layout.d.ts +8 -0
- package/lib/layout/src/LayoutContent.d.ts +4 -0
- package/lib/layout/src/LayoutSider.d.ts +4 -0
- package/lib/locales/index.d.ts +2 -0
- package/lib/locales/index.js +3 -1
- package/lib/locales/utils/index.d.ts +8 -0
- package/lib/locales/utils/index.js +8 -0
- package/lib/log/src/Log.d.ts +10 -25
- package/lib/log/src/Log.js +2 -11
- package/lib/log/src/LogLine.d.ts +1 -0
- package/lib/log/src/LogLine.js +11 -9
- package/lib/mention/src/Mention.d.ts +5 -0
- package/lib/menu/index.d.ts +1 -1
- package/lib/menu/src/Menu.d.ts +33 -8
- package/lib/menu/src/Menu.js +31 -9
- package/lib/menu/src/MenuDivider.d.ts +2 -0
- package/lib/menu/src/MenuDivider.js +13 -0
- package/lib/menu/src/MenuOption.d.ts +12 -2
- package/lib/menu/src/MenuOptionContent.d.ts +7 -2
- package/lib/menu/src/Submenu.d.ts +21 -17
- package/lib/menu/src/interface.d.ts +23 -4
- package/lib/menu/src/styles/index.cssr.js +6 -1
- package/lib/menu/src/utils.d.ts +4 -2
- package/lib/menu/src/utils.js +22 -3
- package/lib/menu/styles/light.d.ts +2 -0
- package/lib/menu/styles/light.js +3 -2
- package/lib/modal/src/BodyWrapper.d.ts +34 -12
- package/lib/modal/src/Modal.d.ts +174 -66
- package/lib/modal/src/presetProps.d.ts +1 -1
- package/lib/modal/styles/light.d.ts +14 -5
- package/lib/notification/src/NotificationContainer.d.ts +11 -0
- package/lib/notification/src/NotificationContainer.js +7 -2
- package/lib/notification/src/NotificationProvider.d.ts +17 -0
- package/lib/notification/src/NotificationProvider.js +38 -3
- package/lib/notification/src/styles/index.cssr.d.ts +2 -1
- package/lib/notification/src/styles/index.cssr.js +41 -12
- package/lib/pagination/index.d.ts +1 -1
- package/lib/pagination/src/Pagination.d.ts +21 -12
- package/lib/pagination/src/Pagination.js +16 -6
- package/lib/pagination/src/interface.d.ts +2 -0
- package/lib/popconfirm/src/Popconfirm.d.ts +151 -57
- package/lib/popconfirm/src/PopconfirmPanel.d.ts +2 -2
- package/lib/popconfirm/styles/light.d.ts +14 -5
- package/lib/popover/src/Popover.d.ts +6 -6
- package/lib/popover/src/Popover.js +2 -5
- package/lib/popover/src/PopoverBody.d.ts +5 -5
- package/lib/popover/src/PopoverBody.js +2 -1
- package/lib/popover/src/styles/index.cssr.js +0 -1
- package/lib/popselect/src/Popselect.d.ts +9 -5
- package/lib/popselect/src/PopselectPanel.d.ts +4 -0
- package/lib/radio/src/Radio.d.ts +3 -0
- package/lib/radio/src/RadioButton.d.ts +3 -0
- package/lib/radio/src/use-radio.d.ts +2 -0
- package/lib/radio/src/use-radio.js +6 -3
- package/lib/select/src/Select.d.ts +4 -0
- package/lib/slider/src/Slider.d.ts +71 -91
- package/lib/slider/src/Slider.js +340 -581
- package/lib/slider/src/interface.d.ts +1 -1
- package/lib/slider/src/styles/index.cssr.js +86 -16
- package/lib/slider/src/utils.d.ts +10 -1
- package/lib/slider/src/utils.js +11 -1
- package/lib/slider/styles/_common.d.ts +1 -0
- package/lib/slider/styles/_common.js +1 -0
- package/lib/slider/styles/light.d.ts +1 -0
- package/lib/space/src/Space.js +2 -0
- package/lib/steps/src/Step.js +1 -1
- package/lib/table/src/Table.d.ts +35 -0
- package/lib/table/src/Table.js +8 -4
- package/lib/table/src/styles/index.cssr.js +1 -1
- package/lib/table/styles/light.d.ts +3 -0
- package/lib/table/styles/light.js +2 -2
- package/lib/tabs/index.d.ts +2 -0
- package/lib/tabs/index.js +3 -1
- package/lib/tabs/src/Tab.d.ts +35 -18
- package/lib/tabs/src/Tab.js +10 -11
- package/lib/tabs/src/Tabs.js +57 -17
- package/lib/tag/src/Tag.d.ts +8 -3
- package/lib/tag/src/Tag.js +10 -1
- package/lib/tag/src/styles/index.cssr.js +10 -5
- package/lib/tag/src/styles/rtl.cssr.js +7 -1
- package/lib/theme-editor/src/ThemeEditor.d.ts +4 -0
- package/lib/time-picker/src/Panel.d.ts +18 -5
- package/lib/time-picker/src/TimePicker.d.ts +145 -50
- package/lib/time-picker/src/TimePicker.js +3 -0
- package/lib/time-picker/styles/light.d.ts +14 -5
- package/lib/tooltip/src/Tooltip.d.ts +9 -5
- package/lib/transfer/src/Transfer.d.ts +146 -52
- package/lib/transfer/src/TransferFilter.d.ts +18 -5
- package/lib/transfer/src/TransferList.d.ts +18 -5
- package/lib/transfer/src/TransferListItem.d.ts +18 -5
- package/lib/transfer/styles/light.d.ts +14 -5
- package/lib/tree/src/Tree.d.ts +10 -6
- package/lib/tree/src/TreeNodeCheckbox.d.ts +4 -0
- package/lib/tree/src/TreeNodeSwitcher.d.ts +1 -1
- package/lib/tree-select/src/TreeSelect.d.ts +6 -2
- package/lib/upload/index.d.ts +1 -2
- package/lib/upload/src/Upload.d.ts +151 -59
- package/lib/upload/src/Upload.js +69 -16
- package/lib/upload/src/UploadFile.d.ts +19 -6
- package/lib/upload/src/UploadProgress.d.ts +18 -5
- package/lib/upload/src/interface.d.ts +14 -1
- package/lib/upload/styles/light.d.ts +14 -5
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +10 -9
- package/web-types.json +205 -14
|
@@ -120,6 +120,7 @@ declare const Scrollbar: import("vue").DefineComponent<{
|
|
|
120
120
|
scrollTo: ScrollTo;
|
|
121
121
|
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
122
122
|
containerScrollTop: import("vue").Ref<number>;
|
|
123
|
+
wrapperRef: import("vue").Ref<HTMLElement | null>;
|
|
123
124
|
containerRef: import("vue").Ref<HTMLElement | null>;
|
|
124
125
|
contentRef: import("vue").Ref<HTMLElement | null>;
|
|
125
126
|
yRailRef: import("vue").Ref<HTMLElement | null>;
|
|
@@ -27,6 +27,7 @@ const Scrollbar = defineComponent({
|
|
|
27
27
|
setup(props) {
|
|
28
28
|
const { mergedClsPrefixRef } = useConfig(props);
|
|
29
29
|
// dom ref
|
|
30
|
+
const wrapperRef = ref(null);
|
|
30
31
|
const containerRef = ref(null);
|
|
31
32
|
const contentRef = ref(null);
|
|
32
33
|
const yRailRef = ref(null);
|
|
@@ -285,6 +286,10 @@ const Scrollbar = defineComponent({
|
|
|
285
286
|
syncPositionState();
|
|
286
287
|
syncScrollState();
|
|
287
288
|
}
|
|
289
|
+
function isMouseUpAway(e) {
|
|
290
|
+
var _a;
|
|
291
|
+
return !((_a = wrapperRef.value) === null || _a === void 0 ? void 0 : _a.contains(e.target));
|
|
292
|
+
}
|
|
288
293
|
function handleXScrollMouseDown(e) {
|
|
289
294
|
e.preventDefault();
|
|
290
295
|
e.stopPropagation();
|
|
@@ -329,8 +334,7 @@ const Scrollbar = defineComponent({
|
|
|
329
334
|
off('mouseup', window, handleXScrollMouseUp, true);
|
|
330
335
|
xBarPressed = false;
|
|
331
336
|
sync();
|
|
332
|
-
|
|
333
|
-
if (!(container === null || container === void 0 ? void 0 : container.contains(e.target))) {
|
|
337
|
+
if (isMouseUpAway(e)) {
|
|
334
338
|
hideBar();
|
|
335
339
|
}
|
|
336
340
|
}
|
|
@@ -375,8 +379,7 @@ const Scrollbar = defineComponent({
|
|
|
375
379
|
off('mouseup', window, handleYScrollMouseUp, true);
|
|
376
380
|
yBarPressed = false;
|
|
377
381
|
sync();
|
|
378
|
-
|
|
379
|
-
if (!(container === null || container === void 0 ? void 0 : container.contains(e.target))) {
|
|
382
|
+
if (isMouseUpAway(e)) {
|
|
380
383
|
hideBar();
|
|
381
384
|
}
|
|
382
385
|
}
|
|
@@ -432,6 +435,7 @@ const Scrollbar = defineComponent({
|
|
|
432
435
|
scrollTo,
|
|
433
436
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
434
437
|
containerScrollTop: containerScrollTopRef,
|
|
438
|
+
wrapperRef,
|
|
435
439
|
containerRef,
|
|
436
440
|
contentRef,
|
|
437
441
|
yRailRef,
|
|
@@ -470,6 +474,7 @@ const Scrollbar = defineComponent({
|
|
|
470
474
|
if (!this.scrollable)
|
|
471
475
|
return renderSlot($slots, 'default');
|
|
472
476
|
const createChildren = () => h('div', mergeProps(this.$attrs, {
|
|
477
|
+
ref: 'wrapperRef',
|
|
473
478
|
class: `${mergedClsPrefix}-scrollbar`,
|
|
474
479
|
style: this.cssVars,
|
|
475
480
|
onMouseenter: this.handleMouseEnterWrapper,
|
|
@@ -279,9 +279,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
279
279
|
tableHeaderColor: string;
|
|
280
280
|
hoverColor: string;
|
|
281
281
|
tableColorHover: string;
|
|
282
|
+
tableColorStriped: string;
|
|
282
283
|
pressedColor: string;
|
|
283
284
|
opacityDisabled: string;
|
|
284
285
|
inputColorDisabled: string;
|
|
286
|
+
buttonColor2: string;
|
|
287
|
+
buttonColor2Hover: string;
|
|
288
|
+
buttonColor2Pressed: string;
|
|
285
289
|
boxShadow1: string;
|
|
286
290
|
boxShadow2: string;
|
|
287
291
|
boxShadow3: string;
|
|
@@ -460,8 +464,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
460
464
|
show: boolean;
|
|
461
465
|
multiple: boolean;
|
|
462
466
|
focusable: boolean;
|
|
463
|
-
clsPrefix: string;
|
|
464
467
|
loading: boolean;
|
|
468
|
+
clsPrefix: string;
|
|
465
469
|
scrollable: boolean;
|
|
466
470
|
treeMate: SelectTreeMate;
|
|
467
471
|
autoPending: boolean;
|
|
@@ -332,9 +332,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
332
332
|
tableHeaderColor: string;
|
|
333
333
|
hoverColor: string;
|
|
334
334
|
tableColorHover: string;
|
|
335
|
+
tableColorStriped: string;
|
|
335
336
|
pressedColor: string;
|
|
336
337
|
opacityDisabled: string;
|
|
337
338
|
inputColorDisabled: string;
|
|
339
|
+
buttonColor2: string;
|
|
340
|
+
buttonColor2Hover: string;
|
|
341
|
+
buttonColor2Pressed: string;
|
|
338
342
|
boxShadow1: string;
|
|
339
343
|
boxShadow2: string;
|
|
340
344
|
boxShadow3: string;
|
|
@@ -569,8 +573,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
569
573
|
active: boolean;
|
|
570
574
|
disabled: boolean;
|
|
571
575
|
autofocus: boolean;
|
|
572
|
-
clsPrefix: string;
|
|
573
576
|
loading: boolean;
|
|
577
|
+
clsPrefix: string;
|
|
574
578
|
showArrow: boolean;
|
|
575
579
|
selectedOption: SelectBaseOption<string | number, string | ((option: SelectBaseOption<string | number, string | any>, selected: boolean) => import("vue").VNodeChild)> | null;
|
|
576
580
|
selectedOptions: SelectBaseOption<string | number, string | ((option: SelectBaseOption<string | number, string | any>, selected: boolean) => import("vue").VNodeChild)>[] | null;
|
|
@@ -12,7 +12,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
12
12
|
type: BooleanConstructor;
|
|
13
13
|
default: undefined;
|
|
14
14
|
};
|
|
15
|
-
loading:
|
|
15
|
+
loading: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
16
19
|
onClear: PropType<(e: MouseEvent) => void>;
|
|
17
20
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
18
21
|
clsPrefix?: unknown;
|
|
@@ -21,8 +24,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
21
24
|
loading?: unknown;
|
|
22
25
|
onClear?: unknown;
|
|
23
26
|
} & {
|
|
24
|
-
clsPrefix: string;
|
|
25
27
|
loading: boolean;
|
|
28
|
+
clsPrefix: string;
|
|
26
29
|
} & {
|
|
27
30
|
showArrow?: boolean | undefined;
|
|
28
31
|
onClear?: ((e: MouseEvent) => void) | undefined;
|
|
@@ -18,6 +18,7 @@ const base = {
|
|
|
18
18
|
alphaDisabledInput: '0.06',
|
|
19
19
|
alphaPending: '0.09',
|
|
20
20
|
alphaTablePending: '0.06',
|
|
21
|
+
alphaTableStriped: '0.05',
|
|
21
22
|
alphaPressed: '0.05',
|
|
22
23
|
alphaAvatar: '0.18',
|
|
23
24
|
alphaRail: '0.2',
|
|
@@ -87,5 +88,5 @@ const derived = Object.assign(Object.assign({ name: 'common' }, commonVariables)
|
|
|
87
88
|
// close
|
|
88
89
|
closeColorHover: overlay(Number(base.alphaClose) * 1.25), closeColor: overlay(Number(base.alphaClose)), closeColorPressed: overlay(Number(base.alphaClose) * 0.8), closeColorDisabled: overlay(base.alpha4),
|
|
89
90
|
// clear
|
|
90
|
-
clearColor: overlay(base.alpha4), clearColorHover: scaleColor(overlay(base.alpha4), { alpha: 1.25 }), clearColorPressed: scaleColor(overlay(base.alpha4), { alpha: 0.8 }), scrollbarColor: overlay(base.alphaScrollbar), scrollbarColorHover: overlay(base.alphaScrollbarHover), scrollbarWidth: '5px', scrollbarHeight: '5px', scrollbarBorderRadius: '5px', progressRailColor: overlay(base.alphaProgressRail), railColor: overlay(base.alphaRail), popoverColor: base.neutralPopover, tableColor: base.neutralCard, cardColor: base.neutralCard, modalColor: base.neutralModal, bodyColor: base.neutralBody, tagColor: neutral(base.alphaTag), avatarColor: overlay(base.alphaAvatar), invertedColor: base.neutralBase, inputColor: overlay(base.alphaInput), codeColor: overlay(base.alphaCode), tabColor: overlay(base.alphaTab), actionColor: overlay(base.alphaAction), tableHeaderColor: overlay(base.alphaAction), hoverColor: overlay(base.alphaPending), tableColorHover: overlay(base.alphaTablePending), pressedColor: overlay(base.alphaPressed), opacityDisabled: base.alphaDisabled, inputColorDisabled: overlay(base.alphaDisabledInput), boxShadow1: '0 1px 2px -2px rgba(0, 0, 0, .24), 0 3px 6px 0 rgba(0, 0, 0, .18), 0 5px 12px 4px rgba(0, 0, 0, .12)', boxShadow2: '0 3px 6px -4px rgba(0, 0, 0, .24), 0 6px 12px 0 rgba(0, 0, 0, .16), 0 9px 18px 8px rgba(0, 0, 0, .10)', boxShadow3: '0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)' });
|
|
91
|
+
clearColor: overlay(base.alpha4), clearColorHover: scaleColor(overlay(base.alpha4), { alpha: 1.25 }), clearColorPressed: scaleColor(overlay(base.alpha4), { alpha: 0.8 }), scrollbarColor: overlay(base.alphaScrollbar), scrollbarColorHover: overlay(base.alphaScrollbarHover), scrollbarWidth: '5px', scrollbarHeight: '5px', scrollbarBorderRadius: '5px', progressRailColor: overlay(base.alphaProgressRail), railColor: overlay(base.alphaRail), popoverColor: base.neutralPopover, tableColor: base.neutralCard, cardColor: base.neutralCard, modalColor: base.neutralModal, bodyColor: base.neutralBody, tagColor: neutral(base.alphaTag), avatarColor: overlay(base.alphaAvatar), invertedColor: base.neutralBase, inputColor: overlay(base.alphaInput), codeColor: overlay(base.alphaCode), tabColor: overlay(base.alphaTab), actionColor: overlay(base.alphaAction), tableHeaderColor: overlay(base.alphaAction), hoverColor: overlay(base.alphaPending), tableColorHover: overlay(base.alphaTablePending), tableColorStriped: overlay(base.alphaTableStriped), pressedColor: overlay(base.alphaPressed), opacityDisabled: base.alphaDisabled, inputColorDisabled: overlay(base.alphaDisabledInput), buttonColor2: 'rgba(255, 255, 255, .06)', buttonColor2Hover: 'rgba(255, 255, 255, .09)', buttonColor2Pressed: 'rgba(255, 255, 255, .05)', boxShadow1: '0 1px 2px -2px rgba(0, 0, 0, .24), 0 3px 6px 0 rgba(0, 0, 0, .18), 0 5px 12px 4px rgba(0, 0, 0, .12)', boxShadow2: '0 3px 6px -4px rgba(0, 0, 0, .24), 0 6px 12px 0 rgba(0, 0, 0, .16), 0 9px 18px 8px rgba(0, 0, 0, .10)', boxShadow3: '0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)' });
|
|
91
92
|
export default derived;
|
|
@@ -67,9 +67,13 @@ declare const derived: {
|
|
|
67
67
|
tableHeaderColor: string;
|
|
68
68
|
hoverColor: string;
|
|
69
69
|
tableColorHover: string;
|
|
70
|
+
tableColorStriped: string;
|
|
70
71
|
pressedColor: string;
|
|
71
72
|
opacityDisabled: string;
|
|
72
73
|
inputColorDisabled: string;
|
|
74
|
+
buttonColor2: string;
|
|
75
|
+
buttonColor2Hover: string;
|
|
76
|
+
buttonColor2Pressed: string;
|
|
73
77
|
boxShadow1: string;
|
|
74
78
|
boxShadow2: string;
|
|
75
79
|
boxShadow3: string;
|
|
@@ -80,7 +80,7 @@ const derived = Object.assign(Object.assign({ name: 'common' }, commonVariables)
|
|
|
80
80
|
// error color
|
|
81
81
|
errorColor: base.errorDefault, errorColorHover: base.errorHover, errorColorPressed: base.errorActive, errorColorSuppl: base.errorSuppl,
|
|
82
82
|
// text color
|
|
83
|
-
textColorBase: base.neutralTextBase, textColor1: 'rgb(31, 34, 37)', textColor2: 'rgb(51, 54, 57)', textColor3: 'rgb(
|
|
83
|
+
textColorBase: base.neutralTextBase, textColor1: 'rgb(31, 34, 37)', textColor2: 'rgb(51, 54, 57)', textColor3: 'rgb(118, 124, 130)',
|
|
84
84
|
// textColor4: neutral(base.alpha4), // disabled, placeholder, icon
|
|
85
85
|
// textColor5: neutral(base.alpha5),
|
|
86
86
|
textColorDisabled: neutral(base.alpha4), placeholderColor: neutral(base.alpha4), placeholderColorDisabled: neutral(base.alpha5), iconColor: neutral(base.alpha4), iconColorHover: scaleColor(neutral(base.alpha4), { lightness: 0.75 }), iconColorPressed: scaleColor(neutral(base.alpha4), { lightness: 0.9 }), iconColorDisabled: neutral(base.alpha5), opacity1: base.alpha1, opacity2: base.alpha2, opacity3: base.alpha3, opacity4: base.alpha4, opacity5: base.alpha5, dividerColor: 'rgb(239, 239, 245)', borderColor: 'rgb(224, 224, 230)',
|
|
@@ -89,5 +89,8 @@ const derived = Object.assign(Object.assign({ name: 'common' }, commonVariables)
|
|
|
89
89
|
// clear
|
|
90
90
|
clearColor: neutral(base.alpha4), clearColorHover: scaleColor(neutral(base.alpha4), { lightness: 0.75 }), clearColorPressed: scaleColor(neutral(base.alpha4), { lightness: 0.9 }), scrollbarColor: overlay(base.alphaScrollbar), scrollbarColorHover: overlay(base.alphaScrollbarHover), scrollbarWidth: '5px', scrollbarHeight: '5px', scrollbarBorderRadius: '5px', progressRailColor: neutral(base.alphaProgressRail), railColor: 'rgb(219, 219, 223)', popoverColor: base.neutralPopover, tableColor: base.neutralCard, cardColor: base.neutralCard, modalColor: base.neutralModal, bodyColor: base.neutralBody, tagColor: 'rgb(250, 250, 252)', avatarColor: neutral(base.alphaAvatar), invertedColor: 'rgb(0, 20, 40)', inputColor: neutral(base.alphaInput), codeColor: 'rgb(244, 244, 248)', tabColor: 'rgb(247, 247, 250)', actionColor: 'rgb(250, 250, 252)', tableHeaderColor: 'rgb(250, 250, 252)', hoverColor: 'rgb(243, 243, 245)',
|
|
91
91
|
// use color with alpha since it can be nested with header filter & sorter effect
|
|
92
|
-
tableColorHover: 'rgba(0, 0, 100, 0.
|
|
92
|
+
tableColorHover: 'rgba(0, 0, 100, 0.03)', tableColorStriped: 'rgba(0, 0, 100, 0.02)', pressedColor: 'rgb(237, 237, 239)', opacityDisabled: base.alphaDisabled, inputColorDisabled: 'rgb(250, 250, 252)',
|
|
93
|
+
// secondary button color
|
|
94
|
+
// can also be used in tertiary button & quaternary button
|
|
95
|
+
buttonColor2: 'rgba(46, 51, 56, .05)', buttonColor2Hover: 'rgba(46, 51, 56, .09)', buttonColor2Pressed: 'rgba(46, 51, 56, .13)', boxShadow1: '0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)', boxShadow2: '0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)', boxShadow3: '0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)' });
|
|
93
96
|
export default derived;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { c } from '../../_utils/cssr';
|
|
2
|
-
import commonVariables from '../common/_common';
|
|
2
|
+
import commonVariables from '../common/_common';
|
|
3
|
+
const {
|
|
4
|
+
fontSize,
|
|
5
|
+
fontFamily,
|
|
6
|
+
lineHeight
|
|
7
|
+
} = commonVariables; // All the components need the style
|
|
3
8
|
// It is static and won't be changed in the app's lifetime
|
|
4
9
|
// If user want to overrides it they need to use `n-global-style` is provided
|
|
5
10
|
//
|
|
@@ -12,9 +17,9 @@ import commonVariables from '../common/_common'; // All the components need the
|
|
|
12
17
|
|
|
13
18
|
export default c('body', `
|
|
14
19
|
margin: 0;
|
|
15
|
-
font-size: ${
|
|
16
|
-
font-family: ${
|
|
17
|
-
line-height: ${
|
|
20
|
+
font-size: ${fontSize};
|
|
21
|
+
font-family: ${fontFamily};
|
|
22
|
+
line-height: ${lineHeight};
|
|
18
23
|
-webkit-text-size-adjust: 100%;
|
|
19
24
|
-webkit-tap-highlight-color: transparent;
|
|
20
25
|
`, [c('input', `
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { c } from '../../_utils/cssr';
|
|
2
2
|
import commonVariables from '../common/_common';
|
|
3
|
+
const {
|
|
4
|
+
cubicBezierEaseInOut,
|
|
5
|
+
transformDebounceScale
|
|
6
|
+
} = commonVariables;
|
|
3
7
|
export default function ({
|
|
4
8
|
originalTransform = '',
|
|
5
9
|
left = 0,
|
|
6
10
|
top = 0,
|
|
7
|
-
transition = `all .3s ${
|
|
11
|
+
transition = `all .3s ${cubicBezierEaseInOut} !important`
|
|
8
12
|
} = {}) {
|
|
9
13
|
return [c('&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to', {
|
|
10
14
|
transform: originalTransform + ' scale(0.75)',
|
|
@@ -12,7 +16,7 @@ export default function ({
|
|
|
12
16
|
top,
|
|
13
17
|
opacity: 0
|
|
14
18
|
}), c('&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from', {
|
|
15
|
-
transform: `${
|
|
19
|
+
transform: `${transformDebounceScale} ${originalTransform}`,
|
|
16
20
|
left,
|
|
17
21
|
top,
|
|
18
22
|
opacity: 1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExtractPropTypes } from 'vue';
|
|
2
2
|
import { useTheme } from '../../_mixins';
|
|
3
3
|
declare type themePropKeys = keyof typeof useTheme.props;
|
|
4
|
-
export declare type ExtractPublicPropTypes<T> = Omit<Partial<ExtractPropTypes<T>>, themePropKeys | Extract<keyof T, `internal${string}`>>;
|
|
4
|
+
export declare type ExtractPublicPropTypes<T> = Omit<Partial<ExtractPropTypes<T>>, Exclude<themePropKeys, 'themeOverrides'> | Extract<keyof T, `internal${string}`>>;
|
|
5
5
|
export declare type ExtractInternalPropTypes<T> = Partial<ExtractPropTypes<T>>;
|
|
6
6
|
export {};
|
package/es/alert/src/Alert.d.ts
CHANGED
|
@@ -437,9 +437,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
437
437
|
tableHeaderColor: string;
|
|
438
438
|
hoverColor: string;
|
|
439
439
|
tableColorHover: string;
|
|
440
|
+
tableColorStriped: string;
|
|
440
441
|
pressedColor: string;
|
|
441
442
|
opacityDisabled: string;
|
|
442
443
|
inputColorDisabled: string;
|
|
444
|
+
buttonColor2: string;
|
|
445
|
+
buttonColor2Hover: string;
|
|
446
|
+
buttonColor2Pressed: string;
|
|
443
447
|
boxShadow1: string;
|
|
444
448
|
boxShadow2: string;
|
|
445
449
|
boxShadow3: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropType } from 'vue';
|
|
1
|
+
import { PropType, InputHTMLAttributes } from 'vue';
|
|
2
2
|
import { TreeNode } from 'treemate';
|
|
3
3
|
import { MaybeArray } from '../../_utils';
|
|
4
4
|
import type { ExtractPublicPropTypes } from '../../_utils';
|
|
@@ -34,6 +34,7 @@ declare const autoCompleteProps: {
|
|
|
34
34
|
readonly blurAfterSelect: BooleanConstructor;
|
|
35
35
|
readonly clearAfterSelect: BooleanConstructor;
|
|
36
36
|
readonly getShow: PropType<(inputValue: string) => boolean>;
|
|
37
|
+
readonly inputProps: PropType<InputHTMLAttributes>;
|
|
37
38
|
readonly size: PropType<"small" | "medium" | "large">;
|
|
38
39
|
readonly options: {
|
|
39
40
|
readonly type: PropType<AutoCompleteOptions>;
|
|
@@ -430,6 +431,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
430
431
|
readonly blurAfterSelect: BooleanConstructor;
|
|
431
432
|
readonly clearAfterSelect: BooleanConstructor;
|
|
432
433
|
readonly getShow: PropType<(inputValue: string) => boolean>;
|
|
434
|
+
readonly inputProps: PropType<InputHTMLAttributes>;
|
|
433
435
|
readonly size: PropType<"small" | "medium" | "large">;
|
|
434
436
|
readonly options: {
|
|
435
437
|
readonly type: PropType<AutoCompleteOptions>;
|
|
@@ -889,9 +891,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
889
891
|
tableHeaderColor: string;
|
|
890
892
|
hoverColor: string;
|
|
891
893
|
tableColorHover: string;
|
|
894
|
+
tableColorStriped: string;
|
|
892
895
|
pressedColor: string;
|
|
893
896
|
opacityDisabled: string;
|
|
894
897
|
inputColorDisabled: string;
|
|
898
|
+
buttonColor2: string;
|
|
899
|
+
buttonColor2Hover: string;
|
|
900
|
+
buttonColor2Pressed: string;
|
|
895
901
|
boxShadow1: string;
|
|
896
902
|
boxShadow2: string;
|
|
897
903
|
boxShadow3: string;
|
|
@@ -1084,6 +1090,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1084
1090
|
readonly blurAfterSelect?: unknown;
|
|
1085
1091
|
readonly clearAfterSelect?: unknown;
|
|
1086
1092
|
readonly getShow?: unknown;
|
|
1093
|
+
readonly inputProps?: unknown;
|
|
1087
1094
|
readonly size?: unknown;
|
|
1088
1095
|
readonly options?: unknown;
|
|
1089
1096
|
readonly zIndex?: unknown;
|
|
@@ -1463,6 +1470,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1463
1470
|
loading?: boolean | undefined;
|
|
1464
1471
|
bordered?: boolean | undefined;
|
|
1465
1472
|
clearable?: boolean | undefined;
|
|
1473
|
+
inputProps?: InputHTMLAttributes | undefined;
|
|
1466
1474
|
"onUpdate:value"?: MaybeArray<OnUpdateValue> | undefined;
|
|
1467
1475
|
onUpdateValue?: MaybeArray<OnUpdateValue> | undefined;
|
|
1468
1476
|
getShow?: ((inputValue: string) => boolean) | undefined;
|
|
@@ -26,7 +26,7 @@ const autoCompleteProps = Object.assign(Object.assign({}, useTheme.props), { to:
|
|
|
26
26
|
}, disabled: {
|
|
27
27
|
type: Boolean,
|
|
28
28
|
default: undefined
|
|
29
|
-
}, placeholder: String, value: String, blurAfterSelect: Boolean, clearAfterSelect: Boolean, getShow: Function, size: String, options: {
|
|
29
|
+
}, placeholder: String, value: String, blurAfterSelect: Boolean, clearAfterSelect: Boolean, getShow: Function, inputProps: Object, size: String, options: {
|
|
30
30
|
type: Array,
|
|
31
31
|
default: () => []
|
|
32
32
|
}, zIndex: Number, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array], onSelect: [Function, Array], onBlur: [Function, Array], onFocus: [Function, Array],
|
|
@@ -232,7 +232,10 @@ export default defineComponent({
|
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
234
|
const { mergedTheme } = this;
|
|
235
|
-
return (h(NInput, { theme: mergedTheme.peers.Input, themeOverrides: mergedTheme.peerOverrides.Input, bordered: this.mergedBordered, value: this.mergedValue, placeholder: this.placeholder, size: this.mergedSize, disabled: this.mergedDisabled, clearable: this.clearable, loading: this.loading, onClear: this.handleClear, onFocus: this.handleFocus, onUpdateValue: this.handleInput, onBlur: this.handleBlur }
|
|
235
|
+
return (h(NInput, { theme: mergedTheme.peers.Input, themeOverrides: mergedTheme.peerOverrides.Input, bordered: this.mergedBordered, value: this.mergedValue, placeholder: this.placeholder, size: this.mergedSize, disabled: this.mergedDisabled, clearable: this.clearable, loading: this.loading, inputProps: this.inputProps, onClear: this.handleClear, onFocus: this.handleFocus, onUpdateValue: this.handleInput, onBlur: this.handleBlur }, {
|
|
236
|
+
suffix: this.$slots.suffix,
|
|
237
|
+
prefix: this.$slots.prefix
|
|
238
|
+
}));
|
|
236
239
|
}
|
|
237
240
|
}),
|
|
238
241
|
h(VFollower, { show: this.active, to: this.adjustedTo, containerClass: this.namespace, zIndex: this.zIndex, teleportDisabled: this.adjustedTo === useAdjustedTo.tdkey, placement: "bottom-start", width: "target" }, {
|
|
@@ -14,6 +14,7 @@ declare const avatarProps: {
|
|
|
14
14
|
};
|
|
15
15
|
readonly round: BooleanConstructor;
|
|
16
16
|
readonly onError: PropType<(e: Event) => void>;
|
|
17
|
+
readonly fallbackSrc: StringConstructor;
|
|
17
18
|
readonly theme: PropType<import("../../_mixins").Theme<"Avatar", {
|
|
18
19
|
borderRadius: string;
|
|
19
20
|
fontSize: string;
|
|
@@ -60,6 +61,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
60
61
|
};
|
|
61
62
|
readonly round: BooleanConstructor;
|
|
62
63
|
readonly onError: PropType<(e: Event) => void>;
|
|
64
|
+
readonly fallbackSrc: StringConstructor;
|
|
63
65
|
readonly theme: PropType<import("../../_mixins").Theme<"Avatar", {
|
|
64
66
|
borderRadius: string;
|
|
65
67
|
fontSize: string;
|
|
@@ -93,6 +95,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
93
95
|
}, {
|
|
94
96
|
textRef: import("vue").Ref<HTMLElement | null>;
|
|
95
97
|
selfRef: import("vue").Ref<HTMLElement | null>;
|
|
98
|
+
mergedRoundRef: import("vue").ComputedRef<boolean>;
|
|
96
99
|
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
97
100
|
fitTextTransform: () => void;
|
|
98
101
|
cssVars: import("vue").ComputedRef<{
|
|
@@ -100,8 +103,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
100
103
|
'--border-radius': string;
|
|
101
104
|
'--color': string;
|
|
102
105
|
'--bezier': string;
|
|
103
|
-
'--size': string;
|
|
106
|
+
'--merged-size': string;
|
|
104
107
|
}>;
|
|
108
|
+
hasLoadError: import("vue").Ref<boolean>;
|
|
109
|
+
handleError: (e: Event) => void;
|
|
105
110
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
106
111
|
readonly size?: unknown;
|
|
107
112
|
readonly src?: unknown;
|
|
@@ -110,6 +115,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
110
115
|
readonly objectFit?: unknown;
|
|
111
116
|
readonly round?: unknown;
|
|
112
117
|
readonly onError?: unknown;
|
|
118
|
+
readonly fallbackSrc?: unknown;
|
|
113
119
|
readonly theme?: unknown;
|
|
114
120
|
readonly themeOverrides?: unknown;
|
|
115
121
|
readonly builtinThemeOverrides?: unknown;
|
|
@@ -152,6 +158,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
152
158
|
heightHuge: string;
|
|
153
159
|
color: string;
|
|
154
160
|
}, any>> | undefined;
|
|
161
|
+
fallbackSrc?: string | undefined;
|
|
155
162
|
}>, {
|
|
156
163
|
round: boolean;
|
|
157
164
|
size: number | "small" | "medium" | "large";
|
package/es/avatar/src/Avatar.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { h, ref, computed, defineComponent } from 'vue';
|
|
1
|
+
import { h, ref, computed, defineComponent, inject, watch } from 'vue';
|
|
2
2
|
import { VResizeObserver } from 'vueuc';
|
|
3
|
+
import { tagInjectionKey } from '../../tag/src/Tag';
|
|
3
4
|
import { useConfig, useTheme } from '../../_mixins';
|
|
4
5
|
import { avatarLight } from '../styles';
|
|
5
6
|
import { createKey } from '../../_utils';
|
|
@@ -10,12 +11,13 @@ const avatarProps = Object.assign(Object.assign({}, useTheme.props), { size: {
|
|
|
10
11
|
}, src: String, circle: Boolean, color: String, objectFit: {
|
|
11
12
|
type: String,
|
|
12
13
|
default: 'fill'
|
|
13
|
-
}, round: Boolean, onError: Function });
|
|
14
|
+
}, round: Boolean, onError: Function, fallbackSrc: String });
|
|
14
15
|
export default defineComponent({
|
|
15
16
|
name: 'Avatar',
|
|
16
17
|
props: avatarProps,
|
|
17
18
|
setup(props) {
|
|
18
19
|
const { mergedClsPrefixRef } = useConfig(props);
|
|
20
|
+
const hasLoadErrorRef = ref(false);
|
|
19
21
|
let memoedTextHtml = null;
|
|
20
22
|
const textRef = ref(null);
|
|
21
23
|
const selfRef = ref(null);
|
|
@@ -36,13 +38,31 @@ export default defineComponent({
|
|
|
36
38
|
}
|
|
37
39
|
};
|
|
38
40
|
const themeRef = useTheme('Avatar', 'Avatar', style, avatarLight, props, mergedClsPrefixRef);
|
|
41
|
+
const TagInjection = inject(tagInjectionKey, null);
|
|
42
|
+
const mergedRoundRef = computed(() => {
|
|
43
|
+
if (props.round || props.circle)
|
|
44
|
+
return true;
|
|
45
|
+
if (TagInjection) {
|
|
46
|
+
return TagInjection.roundRef.value;
|
|
47
|
+
}
|
|
48
|
+
return false;
|
|
49
|
+
});
|
|
50
|
+
const handleError = (e) => {
|
|
51
|
+
hasLoadErrorRef.value = true;
|
|
52
|
+
const { onError } = props;
|
|
53
|
+
if (onError) {
|
|
54
|
+
onError(e);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
watch(() => props.src, () => (hasLoadErrorRef.value = false));
|
|
39
58
|
return {
|
|
40
59
|
textRef,
|
|
41
60
|
selfRef,
|
|
61
|
+
mergedRoundRef,
|
|
42
62
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
43
63
|
fitTextTransform,
|
|
44
64
|
cssVars: computed(() => {
|
|
45
|
-
const { size
|
|
65
|
+
const { size } = props;
|
|
46
66
|
const { self: { borderRadius, fontSize, color }, common: { cubicBezierEaseInOut } } = themeRef.value;
|
|
47
67
|
let height;
|
|
48
68
|
if (typeof size === 'number') {
|
|
@@ -53,18 +73,30 @@ export default defineComponent({
|
|
|
53
73
|
}
|
|
54
74
|
return {
|
|
55
75
|
'--font-size': fontSize,
|
|
56
|
-
'--border-radius':
|
|
76
|
+
'--border-radius': mergedRoundRef.value ? '50%' : borderRadius,
|
|
57
77
|
'--color': color,
|
|
58
78
|
'--bezier': cubicBezierEaseInOut,
|
|
59
|
-
'--size': height
|
|
79
|
+
'--merged-size': `var(--avatar-size-override, ${height})`
|
|
60
80
|
};
|
|
61
|
-
})
|
|
81
|
+
}),
|
|
82
|
+
hasLoadError: hasLoadErrorRef,
|
|
83
|
+
handleError
|
|
62
84
|
};
|
|
63
85
|
},
|
|
64
86
|
render() {
|
|
65
87
|
const { $slots, src, mergedClsPrefix } = this;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
88
|
+
let img;
|
|
89
|
+
if (this.hasLoadError) {
|
|
90
|
+
img = h("img", { src: this.fallbackSrc, style: { objectFit: this.objectFit } });
|
|
91
|
+
}
|
|
92
|
+
else if (!(!$slots.default && src)) {
|
|
93
|
+
img = (h(VResizeObserver, { onResize: this.fitTextTransform }, {
|
|
94
|
+
default: () => (h("span", { ref: "textRef", class: `${mergedClsPrefix}-avatar__text`, style: { background: this.color } }, $slots))
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
img = (h("img", { src: src, onError: this.handleError, style: { objectFit: this.objectFit } }));
|
|
99
|
+
}
|
|
100
|
+
return (h("span", { ref: "selfRef", class: `${mergedClsPrefix}-avatar`, style: this.cssVars }, img));
|
|
69
101
|
}
|
|
70
102
|
});
|
|
@@ -6,8 +6,8 @@ import { c, cE, cB } from '../../../_utils/cssr'; // vars:
|
|
|
6
6
|
// --size
|
|
7
7
|
|
|
8
8
|
export default cB('avatar', `
|
|
9
|
-
width: var(--size);
|
|
10
|
-
height: var(--size);
|
|
9
|
+
width: var(--merged-size);
|
|
10
|
+
height: var(--merged-size);
|
|
11
11
|
color: #FFF;
|
|
12
12
|
font-size: var(--font-size);
|
|
13
13
|
display: inline-flex;
|