naive-ui 2.21.2 → 2.22.0
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/close/src/styles/index.cssr.js +6 -5
- package/es/_internal/scrollbar/src/ScrollBar.d.ts +15 -0
- package/es/_internal/scrollbar/src/ScrollBar.js +13 -7
- package/es/_internal/selection/src/Selection.js +11 -9
- package/es/_internal/selection/src/styles/index.cssr.js +6 -2
- package/es/alert/src/Alert.d.ts +20 -20
- package/es/alert/src/Alert.js +22 -22
- package/es/alert/src/styles/index.cssr.js +45 -45
- package/es/anchor/src/AnchorAdapter.js +12 -12
- package/es/anchor/src/styles/index.cssr.js +41 -41
- package/es/avatar/src/Avatar.d.ts +5 -3
- package/es/avatar/src/Avatar.js +7 -5
- package/es/avatar/src/styles/index.cssr.js +3 -5
- package/es/button/src/Button.d.ts +60 -60
- package/es/button/src/Button.js +107 -106
- package/es/button/src/styles/button.cssr.js +83 -80
- package/es/button/styles/dark.js +3 -3
- package/es/button/styles/light.d.ts +3 -3
- package/es/button/styles/light.js +1 -1
- package/es/calendar/src/Calendar.d.ts +37 -30
- package/es/calendar/styles/light.d.ts +3 -3
- package/es/cascader/src/Cascader.d.ts +135 -0
- package/es/cascader/src/Cascader.js +2 -4
- package/es/cascader/src/CascaderMenu.d.ts +345 -0
- package/es/cascader/src/CascaderMenu.js +6 -5
- package/es/cascader/src/CascaderOption.d.ts +18 -0
- package/es/cascader/src/CascaderSelectMenu.d.ts +18 -0
- package/es/cascader/src/CascaderSubmenu.d.ts +18 -0
- package/es/cascader/styles/dark.js +3 -1
- package/es/cascader/styles/light.d.ts +13 -0
- package/es/cascader/styles/light.js +3 -1
- package/es/color-picker/src/ColorInputUnit.d.ts +3 -3
- package/es/color-picker/src/ColorPicker.d.ts +27 -27
- package/es/color-picker/styles/light.d.ts +3 -3
- package/es/config-provider/src/ConfigProvider.d.ts +21 -0
- package/es/data-table/src/DataTable.d.ts +30 -30
- package/es/data-table/src/DataTable.js +7 -14
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +3 -3
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +3 -3
- package/es/data-table/src/MainTable.js +2 -3
- package/es/data-table/src/TableParts/Body.d.ts +18 -7
- package/es/data-table/src/TableParts/Body.js +80 -28
- package/es/data-table/src/TableParts/Cell.d.ts +6 -6
- package/es/data-table/src/TableParts/Header.d.ts +3 -3
- 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 -12
- package/es/data-table/src/use-check.js +6 -2
- package/es/data-table/src/use-scroll.d.ts +2 -0
- package/es/data-table/src/use-scroll.js +34 -4
- package/es/data-table/src/use-table-data.js +4 -1
- package/es/data-table/styles/_common.js +1 -1
- package/es/data-table/styles/light.d.ts +3 -3
- package/es/date-picker/src/DatePicker.d.ts +94 -69
- package/es/date-picker/src/DatePicker.js +47 -20
- package/es/date-picker/src/config.d.ts +1 -9
- package/es/date-picker/src/config.js +0 -8
- package/es/date-picker/src/interface.d.ts +2 -1
- package/es/date-picker/src/panel/date.d.ts +23 -10
- package/es/date-picker/src/panel/date.js +2 -2
- package/es/date-picker/src/panel/daterange.d.ts +21 -9
- package/es/date-picker/src/panel/daterange.js +2 -2
- package/es/date-picker/src/panel/datetime.d.ts +23 -16
- package/es/date-picker/src/panel/datetime.js +2 -2
- package/es/date-picker/src/panel/datetimerange.d.ts +21 -9
- package/es/date-picker/src/panel/datetimerange.js +2 -2
- package/es/date-picker/src/panel/month.d.ts +27 -20
- package/es/date-picker/src/panel/month.js +23 -12
- package/es/date-picker/src/panel/use-calendar.d.ts +25 -43
- package/es/date-picker/src/panel/use-calendar.js +35 -18
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +21 -40
- package/es/date-picker/src/panel/use-dual-calendar.js +23 -8
- package/es/date-picker/src/panel/use-panel-common.d.ts +21 -36
- package/es/date-picker/src/panel/use-panel-common.js +2 -2
- package/es/date-picker/src/utils.d.ts +19 -3
- package/es/date-picker/src/utils.js +40 -5
- 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 +10 -6
- package/es/dialog/src/Dialog.d.ts +21 -21
- package/es/dialog/src/styles/index.cssr.js +1 -0
- package/es/dialog/styles/light.d.ts +3 -3
- package/es/dynamic-input/src/DynamicInput.d.ts +30 -30
- package/es/dynamic-input/src/InputPreset.d.ts +3 -3
- package/es/dynamic-input/src/PairPreset.d.ts +3 -3
- package/es/dynamic-input/styles/light.d.ts +3 -3
- package/es/dynamic-tags/src/DynamicTags.d.ts +30 -30
- package/es/dynamic-tags/styles/light.d.ts +3 -3
- package/es/element/index.d.ts +1 -0
- package/es/element/index.js +1 -0
- package/es/form/src/interface.d.ts +5 -4
- package/es/image/src/Image.d.ts +25 -16
- package/es/image/src/Image.js +35 -11
- package/es/image/src/ImageGroup.js +2 -2
- package/es/image/src/styles/index.cssr.js +4 -3
- package/es/input/src/Input.js +2 -0
- package/es/input/src/styles/input.cssr.js +2 -1
- package/es/input-number/src/InputNumber.d.ts +30 -30
- package/es/input-number/src/InputNumber.js +10 -5
- package/es/input-number/src/utils.d.ts +1 -0
- package/es/input-number/src/utils.js +4 -0
- package/es/input-number/styles/light.d.ts +3 -3
- package/es/locales/common/deDE.js +8 -0
- package/es/locales/common/enUS.d.ts +7 -0
- package/es/locales/common/enUS.js +8 -1
- package/es/locales/common/frFR.d.ts +3 -0
- package/es/locales/common/frFR.js +101 -0
- package/es/locales/common/idID.d.ts +2 -93
- package/es/locales/common/idID.js +8 -0
- package/es/locales/common/jaJP.js +8 -0
- package/es/locales/common/nbNO.js +8 -0
- package/es/locales/common/ruRU.js +8 -0
- package/es/locales/common/ukUA.js +8 -0
- package/es/locales/common/zhCN.js +7 -0
- package/es/locales/common/zhTW.d.ts +3 -0
- package/es/locales/common/zhTW.js +100 -0
- package/es/locales/date/frFR.d.ts +3 -0
- package/es/locales/date/frFR.js +6 -0
- package/es/locales/date/idID.d.ts +1 -6
- package/es/locales/date/zhTW.d.ts +3 -0
- package/es/locales/date/zhTW.js +6 -0
- package/es/locales/index.d.ts +4 -0
- package/es/locales/index.js +4 -0
- package/es/modal/src/BodyWrapper.d.ts +6 -6
- package/es/modal/src/Modal.d.ts +36 -36
- package/es/modal/styles/light.d.ts +3 -3
- package/es/page-header/src/PageHeader.js +3 -3
- package/es/page-header/src/styles/index.cssr.js +2 -4
- package/es/popconfirm/src/Popconfirm.d.ts +30 -30
- package/es/popconfirm/styles/light.d.ts +3 -3
- package/es/popover/src/Popover.js +4 -1
- package/es/popover/src/PopoverBody.js +3 -3
- package/es/popselect/src/Popselect.d.ts +2 -11
- package/es/popselect/src/Popselect.js +2 -2
- package/es/popselect/src/PopselectPanel.d.ts +3 -11
- package/es/popselect/src/PopselectPanel.js +17 -11
- package/es/radio/src/Radio.js +3 -3
- package/es/radio/src/RadioButton.js +4 -5
- package/es/radio/src/styles/radio-group.cssr.js +8 -4
- package/es/radio/src/styles/radio.cssr.js +8 -4
- package/es/radio/src/use-radio.d.ts +0 -3
- package/es/radio/src/use-radio.js +1 -26
- package/es/switch/src/Switch.d.ts +16 -1
- package/es/switch/src/Switch.js +17 -4
- package/es/switch/src/styles/index.cssr.js +1 -1
- package/es/tabs/src/styles/index.cssr.js +1 -0
- package/es/tag/src/styles/index.cssr.js +1 -1
- package/es/theme-editor/src/ThemeEditor.js +9 -2
- package/es/time-picker/src/Panel.d.ts +3 -3
- package/es/time-picker/src/TimePicker.d.ts +30 -30
- package/es/time-picker/styles/light.d.ts +3 -3
- package/es/transfer/src/Transfer.d.ts +30 -30
- package/es/transfer/src/TransferFilter.d.ts +3 -3
- package/es/transfer/src/TransferList.d.ts +3 -3
- package/es/transfer/src/TransferListItem.d.ts +3 -3
- package/es/transfer/styles/light.d.ts +3 -3
- package/es/tree/src/Tree.d.ts +8 -4
- package/es/tree/src/Tree.js +32 -6
- package/es/tree-select/src/TreeSelect.d.ts +38 -1
- package/es/tree-select/src/TreeSelect.js +25 -10
- package/es/tree-select/src/styles/index.cssr.js +11 -2
- package/es/tree-select/styles/light.d.ts +6 -0
- package/es/tree-select/styles/light.js +5 -2
- package/es/upload/src/Upload.d.ts +41 -30
- package/es/upload/src/Upload.js +33 -23
- package/es/upload/src/UploadFile.d.ts +4 -4
- package/es/upload/src/UploadFileList.js +4 -2
- package/es/upload/src/UploadProgress.d.ts +3 -3
- package/es/upload/src/interface.d.ts +1 -0
- package/es/upload/src/styles/index.cssr.js +2 -3
- package/es/upload/styles/light.d.ts +3 -3
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/close/src/styles/index.cssr.js +6 -5
- package/lib/_internal/scrollbar/src/ScrollBar.d.ts +15 -0
- package/lib/_internal/scrollbar/src/ScrollBar.js +13 -7
- package/lib/_internal/selection/src/Selection.js +11 -9
- package/lib/_internal/selection/src/styles/index.cssr.js +6 -2
- package/lib/alert/src/Alert.d.ts +20 -20
- package/lib/alert/src/Alert.js +22 -22
- package/lib/alert/src/styles/index.cssr.js +45 -45
- package/lib/anchor/src/AnchorAdapter.js +12 -12
- package/lib/anchor/src/styles/index.cssr.js +41 -41
- package/lib/avatar/src/Avatar.d.ts +5 -3
- package/lib/avatar/src/Avatar.js +7 -5
- package/lib/avatar/src/styles/index.cssr.js +3 -5
- package/lib/button/src/Button.d.ts +60 -60
- package/lib/button/src/Button.js +107 -106
- package/lib/button/src/styles/button.cssr.js +83 -80
- package/lib/button/styles/dark.js +3 -3
- package/lib/button/styles/light.d.ts +3 -3
- package/lib/button/styles/light.js +1 -1
- package/lib/calendar/src/Calendar.d.ts +37 -30
- package/lib/calendar/styles/light.d.ts +3 -3
- package/lib/cascader/src/Cascader.d.ts +135 -0
- package/lib/cascader/src/Cascader.js +2 -4
- package/lib/cascader/src/CascaderMenu.d.ts +345 -0
- package/lib/cascader/src/CascaderMenu.js +6 -5
- package/lib/cascader/src/CascaderOption.d.ts +18 -0
- package/lib/cascader/src/CascaderSelectMenu.d.ts +18 -0
- package/lib/cascader/src/CascaderSubmenu.d.ts +18 -0
- package/lib/cascader/styles/dark.js +3 -1
- package/lib/cascader/styles/light.d.ts +13 -0
- package/lib/cascader/styles/light.js +3 -1
- package/lib/color-picker/src/ColorInputUnit.d.ts +3 -3
- package/lib/color-picker/src/ColorPicker.d.ts +27 -27
- package/lib/color-picker/styles/light.d.ts +3 -3
- package/lib/config-provider/src/ConfigProvider.d.ts +21 -0
- package/lib/data-table/src/DataTable.d.ts +30 -30
- package/lib/data-table/src/DataTable.js +6 -13
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +3 -3
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +3 -3
- package/lib/data-table/src/MainTable.js +1 -2
- package/lib/data-table/src/TableParts/Body.d.ts +18 -7
- package/lib/data-table/src/TableParts/Body.js +78 -26
- package/lib/data-table/src/TableParts/Cell.d.ts +6 -6
- package/lib/data-table/src/TableParts/Header.d.ts +3 -3
- 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 -12
- package/lib/data-table/src/use-check.js +6 -2
- package/lib/data-table/src/use-scroll.d.ts +2 -0
- package/lib/data-table/src/use-scroll.js +34 -4
- package/lib/data-table/src/use-table-data.js +4 -1
- package/lib/data-table/styles/_common.js +1 -1
- package/lib/data-table/styles/light.d.ts +3 -3
- package/lib/date-picker/src/DatePicker.d.ts +94 -69
- package/lib/date-picker/src/DatePicker.js +46 -19
- package/lib/date-picker/src/config.d.ts +1 -9
- package/lib/date-picker/src/config.js +1 -9
- package/lib/date-picker/src/interface.d.ts +2 -1
- package/lib/date-picker/src/panel/date.d.ts +23 -10
- package/lib/date-picker/src/panel/date.js +1 -1
- package/lib/date-picker/src/panel/daterange.d.ts +21 -9
- package/lib/date-picker/src/panel/daterange.js +1 -1
- package/lib/date-picker/src/panel/datetime.d.ts +23 -16
- package/lib/date-picker/src/panel/datetime.js +1 -1
- package/lib/date-picker/src/panel/datetimerange.d.ts +21 -9
- package/lib/date-picker/src/panel/datetimerange.js +2 -2
- package/lib/date-picker/src/panel/month.d.ts +27 -20
- package/lib/date-picker/src/panel/month.js +23 -12
- package/lib/date-picker/src/panel/use-calendar.d.ts +25 -43
- package/lib/date-picker/src/panel/use-calendar.js +34 -16
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +21 -40
- package/lib/date-picker/src/panel/use-dual-calendar.js +22 -6
- package/lib/date-picker/src/panel/use-panel-common.d.ts +21 -36
- package/lib/date-picker/src/panel/use-panel-common.js +3 -2
- package/lib/date-picker/src/utils.d.ts +19 -3
- package/lib/date-picker/src/utils.js +41 -4
- 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 +10 -6
- package/lib/dialog/src/Dialog.d.ts +21 -21
- package/lib/dialog/src/styles/index.cssr.js +1 -0
- package/lib/dialog/styles/light.d.ts +3 -3
- package/lib/dynamic-input/src/DynamicInput.d.ts +30 -30
- package/lib/dynamic-input/src/InputPreset.d.ts +3 -3
- package/lib/dynamic-input/src/PairPreset.d.ts +3 -3
- package/lib/dynamic-input/styles/light.d.ts +3 -3
- package/lib/dynamic-tags/src/DynamicTags.d.ts +30 -30
- package/lib/dynamic-tags/styles/light.d.ts +3 -3
- package/lib/element/index.d.ts +1 -0
- package/lib/element/index.js +3 -1
- package/lib/form/src/interface.d.ts +5 -4
- package/lib/image/src/Image.d.ts +25 -16
- package/lib/image/src/Image.js +34 -10
- package/lib/image/src/ImageGroup.js +2 -2
- package/lib/image/src/styles/index.cssr.js +3 -2
- package/lib/input/src/Input.js +2 -0
- package/lib/input/src/styles/input.cssr.js +2 -1
- package/lib/input-number/src/InputNumber.d.ts +30 -30
- package/lib/input-number/src/InputNumber.js +9 -4
- package/lib/input-number/src/utils.d.ts +1 -0
- package/lib/input-number/src/utils.js +6 -1
- package/lib/input-number/styles/light.d.ts +3 -3
- package/lib/locales/common/deDE.js +8 -0
- package/lib/locales/common/enUS.d.ts +7 -0
- package/lib/locales/common/enUS.js +8 -1
- package/lib/locales/common/frFR.d.ts +3 -0
- package/lib/locales/common/frFR.js +103 -0
- package/lib/locales/common/idID.d.ts +2 -93
- package/lib/locales/common/idID.js +8 -0
- package/lib/locales/common/jaJP.js +8 -0
- package/lib/locales/common/nbNO.js +8 -0
- package/lib/locales/common/ruRU.js +8 -0
- package/lib/locales/common/ukUA.js +8 -0
- package/lib/locales/common/zhCN.js +7 -0
- package/lib/locales/common/zhTW.d.ts +3 -0
- package/lib/locales/common/zhTW.js +102 -0
- package/lib/locales/date/frFR.d.ts +3 -0
- package/lib/locales/date/frFR.js +11 -0
- package/lib/locales/date/idID.d.ts +1 -6
- package/lib/locales/date/zhTW.d.ts +3 -0
- package/lib/locales/date/zhTW.js +11 -0
- package/lib/locales/index.d.ts +4 -0
- package/lib/locales/index.js +9 -1
- package/lib/modal/src/BodyWrapper.d.ts +6 -6
- package/lib/modal/src/Modal.d.ts +36 -36
- package/lib/modal/styles/light.d.ts +3 -3
- package/lib/page-header/src/PageHeader.js +3 -3
- package/lib/page-header/src/styles/index.cssr.js +2 -4
- package/lib/popconfirm/src/Popconfirm.d.ts +30 -30
- package/lib/popconfirm/styles/light.d.ts +3 -3
- package/lib/popover/src/Popover.js +4 -1
- package/lib/popover/src/PopoverBody.js +3 -3
- package/lib/popselect/src/Popselect.d.ts +2 -11
- package/lib/popselect/src/Popselect.js +2 -2
- package/lib/popselect/src/PopselectPanel.d.ts +3 -11
- package/lib/popselect/src/PopselectPanel.js +16 -10
- package/lib/radio/src/Radio.js +3 -3
- package/lib/radio/src/RadioButton.js +4 -5
- package/lib/radio/src/styles/radio-group.cssr.js +8 -4
- package/lib/radio/src/styles/radio.cssr.js +8 -4
- package/lib/radio/src/use-radio.d.ts +0 -3
- package/lib/radio/src/use-radio.js +1 -26
- package/lib/switch/src/Switch.d.ts +16 -1
- package/lib/switch/src/Switch.js +17 -4
- package/lib/switch/src/styles/index.cssr.js +1 -1
- package/lib/tabs/src/styles/index.cssr.js +1 -0
- package/lib/tag/src/styles/index.cssr.js +1 -1
- package/lib/theme-editor/src/ThemeEditor.js +9 -2
- package/lib/time-picker/src/Panel.d.ts +3 -3
- package/lib/time-picker/src/TimePicker.d.ts +30 -30
- package/lib/time-picker/styles/light.d.ts +3 -3
- package/lib/transfer/src/Transfer.d.ts +30 -30
- package/lib/transfer/src/TransferFilter.d.ts +3 -3
- package/lib/transfer/src/TransferList.d.ts +3 -3
- package/lib/transfer/src/TransferListItem.d.ts +3 -3
- package/lib/transfer/styles/light.d.ts +3 -3
- package/lib/tree/src/Tree.d.ts +8 -4
- package/lib/tree/src/Tree.js +32 -6
- package/lib/tree-select/src/TreeSelect.d.ts +38 -1
- package/lib/tree-select/src/TreeSelect.js +24 -9
- package/lib/tree-select/src/styles/index.cssr.js +11 -2
- package/lib/tree-select/styles/light.d.ts +6 -0
- package/lib/tree-select/styles/light.js +5 -2
- package/lib/upload/src/Upload.d.ts +41 -30
- package/lib/upload/src/Upload.js +33 -23
- package/lib/upload/src/UploadFile.d.ts +4 -4
- package/lib/upload/src/UploadFileList.js +4 -2
- package/lib/upload/src/UploadProgress.d.ts +3 -3
- package/lib/upload/src/interface.d.ts +1 -0
- package/lib/upload/src/styles/index.cssr.js +2 -3
- package/lib/upload/styles/light.d.ts +3 -3
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +5 -4
- package/web-types.json +99 -7
package/lib/tree/src/Tree.js
CHANGED
|
@@ -104,7 +104,7 @@ const treeProps = Object.assign(Object.assign(Object.assign(Object.assign({}, _m
|
|
|
104
104
|
}, animated: {
|
|
105
105
|
type: Boolean,
|
|
106
106
|
default: true
|
|
107
|
-
}, virtualScroll: Boolean, renderLabel: Function, renderPrefix: Function, renderSuffix: Function, onDragenter: [Function, Array], onDragleave: [Function, Array], onDragend: [Function, Array], onDragstart: [Function, Array], onDragover: [Function, Array], onDrop: [Function, Array], onUpdateCheckedKeys: [Function, Array], 'onUpdate:checkedKeys': [Function, Array], onUpdateSelectedKeys: [Function, Array], 'onUpdate:selectedKeys': [Function, Array] }), exports.treeSharedProps), {
|
|
107
|
+
}, virtualScroll: Boolean, watchProps: Array, renderLabel: Function, renderPrefix: Function, renderSuffix: Function, onDragenter: [Function, Array], onDragleave: [Function, Array], onDragend: [Function, Array], onDragstart: [Function, Array], onDragover: [Function, Array], onDrop: [Function, Array], onUpdateCheckedKeys: [Function, Array], 'onUpdate:checkedKeys': [Function, Array], onUpdateSelectedKeys: [Function, Array], 'onUpdate:selectedKeys': [Function, Array] }), exports.treeSharedProps), {
|
|
108
108
|
// internal props for tree-select
|
|
109
109
|
internalScrollable: Boolean, internalScrollablePadding: String,
|
|
110
110
|
// use it to do check
|
|
@@ -145,7 +145,16 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
145
145
|
const dataTreeMateRef = props.internalDataTreeMate
|
|
146
146
|
? (0, vue_1.toRef)(props, 'internalDataTreeMate')
|
|
147
147
|
: displayTreeMateRef;
|
|
148
|
-
const
|
|
148
|
+
const { watchProps } = props;
|
|
149
|
+
const uncontrolledCheckedKeysRef = (0, vue_1.ref)([]);
|
|
150
|
+
if (watchProps === null || watchProps === void 0 ? void 0 : watchProps.includes('defaultCheckedKeys')) {
|
|
151
|
+
(0, vue_1.watchEffect)(() => {
|
|
152
|
+
uncontrolledCheckedKeysRef.value = props.defaultCheckedKeys;
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
uncontrolledCheckedKeysRef.value = props.defaultCheckedKeys;
|
|
157
|
+
}
|
|
149
158
|
const controlledCheckedKeysRef = (0, vue_1.toRef)(props, 'checkedKeys');
|
|
150
159
|
const mergedCheckedKeysRef = (0, vooks_1.useMergedState)(controlledCheckedKeysRef, uncontrolledCheckedKeysRef);
|
|
151
160
|
const checkedStatusRef = (0, vue_1.computed)(() => {
|
|
@@ -164,12 +173,29 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
164
173
|
return indeterminateKeys;
|
|
165
174
|
return checkedStatusRef.value.indeterminateKeys;
|
|
166
175
|
});
|
|
167
|
-
const uncontrolledSelectedKeysRef = (0, vue_1.ref)(
|
|
176
|
+
const uncontrolledSelectedKeysRef = (0, vue_1.ref)([]);
|
|
177
|
+
if (watchProps === null || watchProps === void 0 ? void 0 : watchProps.includes('defaultSelectedKeys')) {
|
|
178
|
+
(0, vue_1.watchEffect)(() => {
|
|
179
|
+
uncontrolledSelectedKeysRef.value = props.defaultSelectedKeys;
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
uncontrolledSelectedKeysRef.value = props.defaultSelectedKeys;
|
|
184
|
+
}
|
|
168
185
|
const controlledSelectedKeysRef = (0, vue_1.toRef)(props, 'selectedKeys');
|
|
169
186
|
const mergedSelectedKeysRef = (0, vooks_1.useMergedState)(controlledSelectedKeysRef, uncontrolledSelectedKeysRef);
|
|
170
|
-
const uncontrolledExpandedKeysRef = (0, vue_1.ref)(
|
|
171
|
-
|
|
172
|
-
|
|
187
|
+
const uncontrolledExpandedKeysRef = (0, vue_1.ref)([]);
|
|
188
|
+
const initUncontrolledExpandedKeys = () => {
|
|
189
|
+
uncontrolledExpandedKeysRef.value = props.defaultExpandAll
|
|
190
|
+
? dataTreeMateRef.value.getNonLeafKeys()
|
|
191
|
+
: props.defaultExpandedKeys;
|
|
192
|
+
};
|
|
193
|
+
if (watchProps === null || watchProps === void 0 ? void 0 : watchProps.includes('defaultExpandedKeys')) {
|
|
194
|
+
(0, vue_1.watchEffect)(initUncontrolledExpandedKeys);
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
initUncontrolledExpandedKeys();
|
|
198
|
+
}
|
|
173
199
|
const controlledExpandedKeysRef = (0, vue_1.toRef)(props, 'expandedKeys');
|
|
174
200
|
const mergedExpandedKeysRef = (0, vooks_1.useMergedState)(controlledExpandedKeysRef, uncontrolledExpandedKeysRef);
|
|
175
201
|
const fNodesRef = (0, vue_1.computed)(() => displayTreeMateRef.value.getFlattenedNodes(mergedExpandedKeysRef.value));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropType } from 'vue';
|
|
1
|
+
import { PropType, HTMLAttributes } from 'vue';
|
|
2
2
|
import { FollowerPlacement } from 'vueuc';
|
|
3
3
|
import { CheckStrategy } from 'treemate';
|
|
4
4
|
import { Key } from '../../tree/src/interface';
|
|
@@ -94,6 +94,7 @@ declare const props: {
|
|
|
94
94
|
type: PropType<string | boolean | HTMLElement>;
|
|
95
95
|
default: undefined;
|
|
96
96
|
};
|
|
97
|
+
readonly menuProps: PropType<HTMLAttributes>;
|
|
97
98
|
readonly virtualScroll: {
|
|
98
99
|
readonly type: BooleanConstructor;
|
|
99
100
|
readonly default: true;
|
|
@@ -104,6 +105,9 @@ declare const props: {
|
|
|
104
105
|
menuBoxShadow: string;
|
|
105
106
|
menuBorderRadius: string;
|
|
106
107
|
menuHeight: string;
|
|
108
|
+
actionDividerColor: string;
|
|
109
|
+
actionTextColor: string;
|
|
110
|
+
actionPadding: string;
|
|
107
111
|
}, {
|
|
108
112
|
Tree: import("../../_mixins").Theme<"Tree", {
|
|
109
113
|
fontSize: string;
|
|
@@ -238,6 +242,9 @@ declare const props: {
|
|
|
238
242
|
menuBoxShadow: string;
|
|
239
243
|
menuBorderRadius: string;
|
|
240
244
|
menuHeight: string;
|
|
245
|
+
actionDividerColor: string;
|
|
246
|
+
actionTextColor: string;
|
|
247
|
+
actionPadding: string;
|
|
241
248
|
}, {
|
|
242
249
|
Tree: import("../../_mixins").Theme<"Tree", {
|
|
243
250
|
fontSize: string;
|
|
@@ -372,6 +379,9 @@ declare const props: {
|
|
|
372
379
|
menuBoxShadow: string;
|
|
373
380
|
menuBorderRadius: string;
|
|
374
381
|
menuHeight: string;
|
|
382
|
+
actionDividerColor: string;
|
|
383
|
+
actionTextColor: string;
|
|
384
|
+
actionPadding: string;
|
|
375
385
|
}, {
|
|
376
386
|
Tree: import("../../_mixins").Theme<"Tree", {
|
|
377
387
|
fontSize: string;
|
|
@@ -591,6 +601,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
591
601
|
type: PropType<string | boolean | HTMLElement>;
|
|
592
602
|
default: undefined;
|
|
593
603
|
};
|
|
604
|
+
readonly menuProps: PropType<HTMLAttributes>;
|
|
594
605
|
readonly virtualScroll: {
|
|
595
606
|
readonly type: BooleanConstructor;
|
|
596
607
|
readonly default: true;
|
|
@@ -601,6 +612,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
601
612
|
menuBoxShadow: string;
|
|
602
613
|
menuBorderRadius: string;
|
|
603
614
|
menuHeight: string;
|
|
615
|
+
actionDividerColor: string;
|
|
616
|
+
actionTextColor: string;
|
|
617
|
+
actionPadding: string;
|
|
604
618
|
}, {
|
|
605
619
|
Tree: import("../../_mixins").Theme<"Tree", {
|
|
606
620
|
fontSize: string;
|
|
@@ -735,6 +749,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
735
749
|
menuBoxShadow: string;
|
|
736
750
|
menuBorderRadius: string;
|
|
737
751
|
menuHeight: string;
|
|
752
|
+
actionDividerColor: string;
|
|
753
|
+
actionTextColor: string;
|
|
754
|
+
actionPadding: string;
|
|
738
755
|
}, {
|
|
739
756
|
Tree: import("../../_mixins").Theme<"Tree", {
|
|
740
757
|
fontSize: string;
|
|
@@ -869,6 +886,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
869
886
|
menuBoxShadow: string;
|
|
870
887
|
menuBorderRadius: string;
|
|
871
888
|
menuHeight: string;
|
|
889
|
+
actionDividerColor: string;
|
|
890
|
+
actionTextColor: string;
|
|
891
|
+
actionPadding: string;
|
|
872
892
|
}, {
|
|
873
893
|
Tree: import("../../_mixins").Theme<"Tree", {
|
|
874
894
|
fontSize: string;
|
|
@@ -1060,6 +1080,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1060
1080
|
'--menu-color': string;
|
|
1061
1081
|
'--menu-height': string;
|
|
1062
1082
|
'--bezier': string;
|
|
1083
|
+
'--action-padding': string;
|
|
1084
|
+
'--action-text-color': string;
|
|
1085
|
+
'--action-divider-color': string;
|
|
1063
1086
|
}>;
|
|
1064
1087
|
mergedTheme: import("vue").ComputedRef<{
|
|
1065
1088
|
common: {
|
|
@@ -1171,6 +1194,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1171
1194
|
menuBoxShadow: string;
|
|
1172
1195
|
menuBorderRadius: string;
|
|
1173
1196
|
menuHeight: string;
|
|
1197
|
+
actionDividerColor: string;
|
|
1198
|
+
actionTextColor: string;
|
|
1199
|
+
actionPadding: string;
|
|
1174
1200
|
};
|
|
1175
1201
|
peers: {
|
|
1176
1202
|
Tree: import("../../_mixins").Theme<"Tree", {
|
|
@@ -1403,6 +1429,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1403
1429
|
readonly size?: unknown;
|
|
1404
1430
|
readonly value?: unknown;
|
|
1405
1431
|
readonly to?: unknown;
|
|
1432
|
+
readonly menuProps?: unknown;
|
|
1406
1433
|
readonly virtualScroll?: unknown;
|
|
1407
1434
|
readonly theme?: unknown;
|
|
1408
1435
|
readonly themeOverrides?: unknown;
|
|
@@ -1444,6 +1471,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1444
1471
|
menuBoxShadow: string;
|
|
1445
1472
|
menuBorderRadius: string;
|
|
1446
1473
|
menuHeight: string;
|
|
1474
|
+
actionDividerColor: string;
|
|
1475
|
+
actionTextColor: string;
|
|
1476
|
+
actionPadding: string;
|
|
1447
1477
|
}, {
|
|
1448
1478
|
Tree: import("../../_mixins").Theme<"Tree", {
|
|
1449
1479
|
fontSize: string;
|
|
@@ -1578,6 +1608,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1578
1608
|
menuBoxShadow: string;
|
|
1579
1609
|
menuBorderRadius: string;
|
|
1580
1610
|
menuHeight: string;
|
|
1611
|
+
actionDividerColor: string;
|
|
1612
|
+
actionTextColor: string;
|
|
1613
|
+
actionPadding: string;
|
|
1581
1614
|
}, {
|
|
1582
1615
|
Tree: import("../../_mixins").Theme<"Tree", {
|
|
1583
1616
|
fontSize: string;
|
|
@@ -1712,6 +1745,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1712
1745
|
menuBoxShadow: string;
|
|
1713
1746
|
menuBorderRadius: string;
|
|
1714
1747
|
menuHeight: string;
|
|
1748
|
+
actionDividerColor: string;
|
|
1749
|
+
actionTextColor: string;
|
|
1750
|
+
actionPadding: string;
|
|
1715
1751
|
}, {
|
|
1716
1752
|
Tree: import("../../_mixins").Theme<"Tree", {
|
|
1717
1753
|
fontSize: string;
|
|
@@ -1843,6 +1879,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1843
1879
|
"onUpdate:show"?: MaybeArray<(show: boolean) => void> | undefined;
|
|
1844
1880
|
onUpdateShow?: MaybeArray<(show: boolean) => void> | undefined;
|
|
1845
1881
|
maxTagCount?: number | "responsive" | undefined;
|
|
1882
|
+
menuProps?: HTMLAttributes | undefined;
|
|
1846
1883
|
"onUpdate:value"?: MaybeArray<OnUpdateValue> | undefined;
|
|
1847
1884
|
onUpdateValue?: MaybeArray<OnUpdateValue> | undefined;
|
|
1848
1885
|
leafOnly?: boolean | undefined;
|
|
@@ -8,6 +8,7 @@ const vueuc_1 = require("vueuc");
|
|
|
8
8
|
const vooks_1 = require("vooks");
|
|
9
9
|
const vdirs_1 = require("vdirs");
|
|
10
10
|
const treemate_1 = require("treemate");
|
|
11
|
+
const seemly_1 = require("seemly");
|
|
11
12
|
const Tree_1 = require("../../tree/src/Tree");
|
|
12
13
|
const _internal_1 = require("../../_internal");
|
|
13
14
|
const tree_1 = require("../../tree");
|
|
@@ -45,7 +46,7 @@ const props = Object.assign(Object.assign(Object.assign(Object.assign({}, _mixin
|
|
|
45
46
|
}, show: {
|
|
46
47
|
type: Boolean,
|
|
47
48
|
default: undefined
|
|
48
|
-
}, size: String, value: [String, Number, Array], to: _utils_1.useAdjustedTo.propTo, virtualScroll: {
|
|
49
|
+
}, size: String, value: [String, Number, Array], to: _utils_1.useAdjustedTo.propTo, menuProps: Object, virtualScroll: {
|
|
49
50
|
type: Boolean,
|
|
50
51
|
default: true
|
|
51
52
|
} }), Tree_1.treeSharedProps), { onBlur: Function, onFocus: Function, onUpdateShow: [Function, Array], onUpdateValue: [Function, Array], 'onUpdate:value': [Function, Array], 'onUpdate:show': [Function, Array],
|
|
@@ -442,7 +443,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
442
443
|
function handleMenuMousedown(e) {
|
|
443
444
|
// If there's an action slot later, we need to check if mousedown happens
|
|
444
445
|
// in action panel
|
|
445
|
-
|
|
446
|
+
if (!(0, seemly_1.happensIn)(e, 'action'))
|
|
447
|
+
e.preventDefault();
|
|
446
448
|
}
|
|
447
449
|
(0, vue_1.provide)(interface_1.treeSelectInjectionKey, {
|
|
448
450
|
pendingNodeKeyRef
|
|
@@ -519,20 +521,23 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
519
521
|
handleTabOut,
|
|
520
522
|
handleMenuMousedown,
|
|
521
523
|
cssVars: (0, vue_1.computed)(() => {
|
|
522
|
-
const { common: { cubicBezierEaseInOut }, self: { menuBoxShadow, menuBorderRadius, menuColor, menuHeight } } = themeRef.value;
|
|
524
|
+
const { common: { cubicBezierEaseInOut }, self: { menuBoxShadow, menuBorderRadius, menuColor, menuHeight, actionPadding, actionDividerColor, actionTextColor } } = themeRef.value;
|
|
523
525
|
return {
|
|
524
526
|
'--menu-box-shadow': menuBoxShadow,
|
|
525
527
|
'--menu-border-radius': menuBorderRadius,
|
|
526
528
|
'--menu-color': menuColor,
|
|
527
529
|
'--menu-height': menuHeight,
|
|
528
|
-
'--bezier': cubicBezierEaseInOut
|
|
530
|
+
'--bezier': cubicBezierEaseInOut,
|
|
531
|
+
'--action-padding': actionPadding,
|
|
532
|
+
'--action-text-color': actionTextColor,
|
|
533
|
+
'--action-divider-color': actionDividerColor
|
|
529
534
|
};
|
|
530
535
|
}),
|
|
531
536
|
mergedTheme: themeRef
|
|
532
537
|
};
|
|
533
538
|
},
|
|
534
539
|
render() {
|
|
535
|
-
const { mergedTheme, mergedClsPrefix } = this;
|
|
540
|
+
const { mergedTheme, mergedClsPrefix, $slots } = this;
|
|
536
541
|
return ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-tree-select` },
|
|
537
542
|
(0, vue_1.h)(vueuc_1.VBinder, null, {
|
|
538
543
|
default: () => [
|
|
@@ -544,11 +549,21 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
544
549
|
default: () => {
|
|
545
550
|
if (!this.mergedShow)
|
|
546
551
|
return null;
|
|
547
|
-
const { mergedClsPrefix, filteredTreeInfo, checkable, multiple } = this;
|
|
548
|
-
return (0, vue_1.withDirectives)((0, vue_1.h)("div", {
|
|
552
|
+
const { mergedClsPrefix, filteredTreeInfo, checkable, multiple, menuProps } = this;
|
|
553
|
+
return (0, vue_1.withDirectives)((0, vue_1.h)("div", Object.assign({}, menuProps, { class: [
|
|
554
|
+
`${mergedClsPrefix}-tree-select-menu`,
|
|
555
|
+
menuProps === null || menuProps === void 0 ? void 0 : menuProps.class
|
|
556
|
+
], ref: "menuElRef", style: [
|
|
557
|
+
(menuProps === null || menuProps === void 0 ? void 0 : menuProps.style) || '',
|
|
558
|
+
this.cssVars
|
|
559
|
+
], tabindex: 0, onMousedown: this.handleMenuMousedown, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown, onFocusin: this.handleMenuFocusin, onFocusout: this.handleMenuFocusout }),
|
|
549
560
|
filteredTreeInfo.filteredTree.length ? ((0, vue_1.h)(tree_1.NTree, { ref: "treeInstRef", blockLine: true, animated: false, data: filteredTreeInfo.filteredTree, cancelable: multiple, labelField: this.labelField, theme: mergedTheme.peers.Tree, themeOverrides: mergedTheme.peerOverrides.Tree, defaultExpandAll: this.defaultExpandAll, defaultExpandedKeys: this.defaultExpandedKeys, expandedKeys: this.mergedExpandedKeys, checkedKeys: this.treeCheckedKeys, selectedKeys: this.treeSelectedKeys, checkable: checkable, checkStrategy: this.checkStrategy, cascade: this.mergedCascade, leafOnly: this.leafOnly, multiple: this.multiple, virtualScroll: this.consistentMenuWidth &&
|
|
550
|
-
this.virtualScroll, internalDataTreeMate: this.dataTreeMate, internalDisplayTreeMate: this.displayTreeMate, internalHighlightKeySet: filteredTreeInfo.highlightKeySet, internalUnifySelectCheck: true, internalScrollable: true, internalScrollablePadding: this.menuPadding, internalFocusable: false, internalCheckboxFocusable: false, onUpdateCheckedKeys: this.handleUpdateCheckedKeys, onUpdateIndeterminateKeys: this.handleUpdateIndeterminateKeys, onUpdateExpandedKeys: this.doUpdateExpandedKeys })) : ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-tree-select-menu__empty` },
|
|
551
|
-
(0, vue_1.h)(empty_1.NEmpty, { theme: mergedTheme.peers.Empty, themeOverrides: mergedTheme.peerOverrides.Empty })
|
|
561
|
+
this.virtualScroll, internalDataTreeMate: this.dataTreeMate, internalDisplayTreeMate: this.displayTreeMate, internalHighlightKeySet: filteredTreeInfo.highlightKeySet, internalUnifySelectCheck: true, internalScrollable: true, internalScrollablePadding: this.menuPadding, internalFocusable: false, internalCheckboxFocusable: false, onUpdateCheckedKeys: this.handleUpdateCheckedKeys, onUpdateIndeterminateKeys: this.handleUpdateIndeterminateKeys, onUpdateExpandedKeys: this.doUpdateExpandedKeys })) : ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-tree-select-menu__empty` }, (0, vue_1.renderSlot)($slots, 'empty', undefined, () => [
|
|
562
|
+
(0, vue_1.h)(empty_1.NEmpty, { theme: mergedTheme.peers.Empty, themeOverrides: mergedTheme.peerOverrides.Empty })
|
|
563
|
+
]))),
|
|
564
|
+
$slots.action && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-tree-select-menu__action`, "data-action": true }, {
|
|
565
|
+
default: $slots.action
|
|
566
|
+
})),
|
|
552
567
|
(0, vue_1.h)(_internal_1.NBaseFocusDetector, { onFocus: this.handleTabOut })), [[vdirs_1.clickoutside, this.handleMenuClickoutside]]);
|
|
553
568
|
}
|
|
554
569
|
}))
|
|
@@ -18,6 +18,9 @@ const cssr_1 = require("../../../_utils/cssr"); // vars:
|
|
|
18
18
|
// --menu-border-radius
|
|
19
19
|
// --menu-box-shadow
|
|
20
20
|
// --menu-color
|
|
21
|
+
// --action-padding
|
|
22
|
+
// --action-text-color
|
|
23
|
+
// --action-divider-color
|
|
21
24
|
|
|
22
25
|
|
|
23
26
|
exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('tree-select', `
|
|
@@ -29,15 +32,21 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('tree-select', `
|
|
|
29
32
|
position: relative;
|
|
30
33
|
overflow: hidden;
|
|
31
34
|
margin: 4px 0;
|
|
32
|
-
max-height: var(--menu-height);
|
|
33
35
|
transition: box-shadow .3s var(--bezier), background-color .3s var(--bezier);
|
|
34
36
|
border-radius: var(--menu-border-radius);
|
|
35
37
|
box-shadow: var(--menu-box-shadow);
|
|
36
38
|
background-color: var(--menu-color);
|
|
37
39
|
outline: none;
|
|
38
|
-
`, [(0, cssr_1.cB)('tree', 'max-height:
|
|
40
|
+
`, [(0, cssr_1.cB)('tree', 'max-height: var(--menu-height);'), (0, cssr_1.cE)('empty', `
|
|
39
41
|
display: flex;
|
|
40
42
|
padding: 12px 32px;
|
|
41
43
|
flex: 1;
|
|
42
44
|
justify-content: center;
|
|
45
|
+
`), (0, cssr_1.cE)('action', `
|
|
46
|
+
padding: var(--action-padding);
|
|
47
|
+
transition:
|
|
48
|
+
color .3s var(--bezier);
|
|
49
|
+
border-color .3s var(--bezier);
|
|
50
|
+
border-top: 1px solid var(--action-divider-color);
|
|
51
|
+
color: var(--action-text-color);
|
|
43
52
|
`), (0, fade_in_scale_up_cssr_1.default)()])]);
|
|
@@ -5,6 +5,9 @@ export declare const self: (vars: ThemeCommonVars) => {
|
|
|
5
5
|
menuBoxShadow: string;
|
|
6
6
|
menuBorderRadius: string;
|
|
7
7
|
menuHeight: string;
|
|
8
|
+
actionDividerColor: string;
|
|
9
|
+
actionTextColor: string;
|
|
10
|
+
actionPadding: string;
|
|
8
11
|
};
|
|
9
12
|
export declare type TreeSelectThemeVars = ReturnType<typeof self>;
|
|
10
13
|
declare const treeSelectLight: import("../../_mixins/use-theme").Theme<"TreeSelect", {
|
|
@@ -13,6 +16,9 @@ declare const treeSelectLight: import("../../_mixins/use-theme").Theme<"TreeSele
|
|
|
13
16
|
menuBoxShadow: string;
|
|
14
17
|
menuBorderRadius: string;
|
|
15
18
|
menuHeight: string;
|
|
19
|
+
actionDividerColor: string;
|
|
20
|
+
actionTextColor: string;
|
|
21
|
+
actionPadding: string;
|
|
16
22
|
}, {
|
|
17
23
|
Tree: import("../../_mixins/use-theme").Theme<"Tree", {
|
|
18
24
|
fontSize: string;
|
|
@@ -7,13 +7,16 @@ const styles_1 = require("../../tree/styles");
|
|
|
7
7
|
const styles_2 = require("../../empty/styles");
|
|
8
8
|
const styles_3 = require("../../_internal/selection/styles");
|
|
9
9
|
const self = (vars) => {
|
|
10
|
-
const { popoverColor, boxShadow2, borderRadius, heightMedium } = vars;
|
|
10
|
+
const { popoverColor, boxShadow2, borderRadius, heightMedium, dividerColor, textColor2 } = vars;
|
|
11
11
|
return {
|
|
12
12
|
menuPadding: '4px',
|
|
13
13
|
menuColor: popoverColor,
|
|
14
14
|
menuBoxShadow: boxShadow2,
|
|
15
15
|
menuBorderRadius: borderRadius,
|
|
16
|
-
menuHeight: `calc(${heightMedium} * 7.6)
|
|
16
|
+
menuHeight: `calc(${heightMedium} * 7.6)`,
|
|
17
|
+
actionDividerColor: dividerColor,
|
|
18
|
+
actionTextColor: textColor2,
|
|
19
|
+
actionPadding: '8px 12px'
|
|
17
20
|
};
|
|
18
21
|
};
|
|
19
22
|
exports.self = self;
|
|
@@ -68,6 +68,10 @@ declare const uploadProps: {
|
|
|
68
68
|
readonly createThumbnailUrl: PropType<CreateThumbnailUrl>;
|
|
69
69
|
readonly abstract: BooleanConstructor;
|
|
70
70
|
readonly max: NumberConstructor;
|
|
71
|
+
readonly showTrigger: {
|
|
72
|
+
readonly type: BooleanConstructor;
|
|
73
|
+
readonly default: true;
|
|
74
|
+
};
|
|
71
75
|
readonly theme: PropType<import("../../_mixins").Theme<"Upload", {
|
|
72
76
|
fontSize: string;
|
|
73
77
|
lineHeight: string;
|
|
@@ -99,9 +103,9 @@ declare const uploadProps: {
|
|
|
99
103
|
fontSizeMedium: string;
|
|
100
104
|
fontSizeLarge: string;
|
|
101
105
|
opacityDisabled: string;
|
|
102
|
-
colorOpacitySecondary:
|
|
103
|
-
colorOpacitySecondaryHover:
|
|
104
|
-
colorOpacitySecondaryPressed:
|
|
106
|
+
colorOpacitySecondary: string;
|
|
107
|
+
colorOpacitySecondaryHover: string;
|
|
108
|
+
colorOpacitySecondaryPressed: string;
|
|
105
109
|
colorSecondary: string;
|
|
106
110
|
colorSecondaryHover: string;
|
|
107
111
|
colorSecondaryPressed: string;
|
|
@@ -344,9 +348,9 @@ declare const uploadProps: {
|
|
|
344
348
|
fontSizeMedium: string;
|
|
345
349
|
fontSizeLarge: string;
|
|
346
350
|
opacityDisabled: string;
|
|
347
|
-
colorOpacitySecondary:
|
|
348
|
-
colorOpacitySecondaryHover:
|
|
349
|
-
colorOpacitySecondaryPressed:
|
|
351
|
+
colorOpacitySecondary: string;
|
|
352
|
+
colorOpacitySecondaryHover: string;
|
|
353
|
+
colorOpacitySecondaryPressed: string;
|
|
350
354
|
colorSecondary: string;
|
|
351
355
|
colorSecondaryHover: string;
|
|
352
356
|
colorSecondaryPressed: string;
|
|
@@ -589,9 +593,9 @@ declare const uploadProps: {
|
|
|
589
593
|
fontSizeMedium: string;
|
|
590
594
|
fontSizeLarge: string;
|
|
591
595
|
opacityDisabled: string;
|
|
592
|
-
colorOpacitySecondary:
|
|
593
|
-
colorOpacitySecondaryHover:
|
|
594
|
-
colorOpacitySecondaryPressed:
|
|
596
|
+
colorOpacitySecondary: string;
|
|
597
|
+
colorOpacitySecondaryHover: string;
|
|
598
|
+
colorOpacitySecondaryPressed: string;
|
|
595
599
|
colorSecondary: string;
|
|
596
600
|
colorSecondaryHover: string;
|
|
597
601
|
colorSecondaryPressed: string;
|
|
@@ -872,6 +876,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
872
876
|
readonly createThumbnailUrl: PropType<CreateThumbnailUrl>;
|
|
873
877
|
readonly abstract: BooleanConstructor;
|
|
874
878
|
readonly max: NumberConstructor;
|
|
879
|
+
readonly showTrigger: {
|
|
880
|
+
readonly type: BooleanConstructor;
|
|
881
|
+
readonly default: true;
|
|
882
|
+
};
|
|
875
883
|
readonly theme: PropType<import("../../_mixins").Theme<"Upload", {
|
|
876
884
|
fontSize: string;
|
|
877
885
|
lineHeight: string;
|
|
@@ -903,9 +911,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
903
911
|
fontSizeMedium: string;
|
|
904
912
|
fontSizeLarge: string;
|
|
905
913
|
opacityDisabled: string;
|
|
906
|
-
colorOpacitySecondary:
|
|
907
|
-
colorOpacitySecondaryHover:
|
|
908
|
-
colorOpacitySecondaryPressed:
|
|
914
|
+
colorOpacitySecondary: string;
|
|
915
|
+
colorOpacitySecondaryHover: string;
|
|
916
|
+
colorOpacitySecondaryPressed: string;
|
|
909
917
|
colorSecondary: string;
|
|
910
918
|
colorSecondaryHover: string;
|
|
911
919
|
colorSecondaryPressed: string;
|
|
@@ -1148,9 +1156,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1148
1156
|
fontSizeMedium: string;
|
|
1149
1157
|
fontSizeLarge: string;
|
|
1150
1158
|
opacityDisabled: string;
|
|
1151
|
-
colorOpacitySecondary:
|
|
1152
|
-
colorOpacitySecondaryHover:
|
|
1153
|
-
colorOpacitySecondaryPressed:
|
|
1159
|
+
colorOpacitySecondary: string;
|
|
1160
|
+
colorOpacitySecondaryHover: string;
|
|
1161
|
+
colorOpacitySecondaryPressed: string;
|
|
1154
1162
|
colorSecondary: string;
|
|
1155
1163
|
colorSecondaryHover: string;
|
|
1156
1164
|
colorSecondaryPressed: string;
|
|
@@ -1393,9 +1401,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1393
1401
|
fontSizeMedium: string;
|
|
1394
1402
|
fontSizeLarge: string;
|
|
1395
1403
|
opacityDisabled: string;
|
|
1396
|
-
colorOpacitySecondary:
|
|
1397
|
-
colorOpacitySecondaryHover:
|
|
1398
|
-
colorOpacitySecondaryPressed:
|
|
1404
|
+
colorOpacitySecondary: string;
|
|
1405
|
+
colorOpacitySecondaryHover: string;
|
|
1406
|
+
colorOpacitySecondaryPressed: string;
|
|
1399
1407
|
colorSecondary: string;
|
|
1400
1408
|
colorSecondaryHover: string;
|
|
1401
1409
|
colorSecondaryPressed: string;
|
|
@@ -1751,9 +1759,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1751
1759
|
fontSizeMedium: string;
|
|
1752
1760
|
fontSizeLarge: string;
|
|
1753
1761
|
opacityDisabled: string;
|
|
1754
|
-
colorOpacitySecondary:
|
|
1755
|
-
colorOpacitySecondaryHover:
|
|
1756
|
-
colorOpacitySecondaryPressed:
|
|
1762
|
+
colorOpacitySecondary: string;
|
|
1763
|
+
colorOpacitySecondaryHover: string;
|
|
1764
|
+
colorOpacitySecondaryPressed: string;
|
|
1757
1765
|
colorSecondary: string;
|
|
1758
1766
|
colorSecondaryHover: string;
|
|
1759
1767
|
colorSecondaryPressed: string;
|
|
@@ -2014,6 +2022,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2014
2022
|
readonly createThumbnailUrl?: unknown;
|
|
2015
2023
|
readonly abstract?: unknown;
|
|
2016
2024
|
readonly max?: unknown;
|
|
2025
|
+
readonly showTrigger?: unknown;
|
|
2017
2026
|
readonly theme?: unknown;
|
|
2018
2027
|
readonly themeOverrides?: unknown;
|
|
2019
2028
|
readonly builtinThemeOverrides?: unknown;
|
|
@@ -2022,6 +2031,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2022
2031
|
abstract: boolean;
|
|
2023
2032
|
name: string;
|
|
2024
2033
|
multiple: boolean;
|
|
2034
|
+
showTrigger: boolean;
|
|
2025
2035
|
listType: listType;
|
|
2026
2036
|
showCancelButton: boolean;
|
|
2027
2037
|
showRemoveButton: boolean;
|
|
@@ -2071,9 +2081,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2071
2081
|
fontSizeMedium: string;
|
|
2072
2082
|
fontSizeLarge: string;
|
|
2073
2083
|
opacityDisabled: string;
|
|
2074
|
-
colorOpacitySecondary:
|
|
2075
|
-
colorOpacitySecondaryHover:
|
|
2076
|
-
colorOpacitySecondaryPressed:
|
|
2084
|
+
colorOpacitySecondary: string;
|
|
2085
|
+
colorOpacitySecondaryHover: string;
|
|
2086
|
+
colorOpacitySecondaryPressed: string;
|
|
2077
2087
|
colorSecondary: string;
|
|
2078
2088
|
colorSecondaryHover: string;
|
|
2079
2089
|
colorSecondaryPressed: string;
|
|
@@ -2316,9 +2326,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2316
2326
|
fontSizeMedium: string;
|
|
2317
2327
|
fontSizeLarge: string;
|
|
2318
2328
|
opacityDisabled: string;
|
|
2319
|
-
colorOpacitySecondary:
|
|
2320
|
-
colorOpacitySecondaryHover:
|
|
2321
|
-
colorOpacitySecondaryPressed:
|
|
2329
|
+
colorOpacitySecondary: string;
|
|
2330
|
+
colorOpacitySecondaryHover: string;
|
|
2331
|
+
colorOpacitySecondaryPressed: string;
|
|
2322
2332
|
colorSecondary: string;
|
|
2323
2333
|
colorSecondaryHover: string;
|
|
2324
2334
|
colorSecondaryPressed: string;
|
|
@@ -2561,9 +2571,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2561
2571
|
fontSizeMedium: string;
|
|
2562
2572
|
fontSizeLarge: string;
|
|
2563
2573
|
opacityDisabled: string;
|
|
2564
|
-
colorOpacitySecondary:
|
|
2565
|
-
colorOpacitySecondaryHover:
|
|
2566
|
-
colorOpacitySecondaryPressed:
|
|
2574
|
+
colorOpacitySecondary: string;
|
|
2575
|
+
colorOpacitySecondaryHover: string;
|
|
2576
|
+
colorOpacitySecondaryPressed: string;
|
|
2567
2577
|
colorSecondary: string;
|
|
2568
2578
|
colorSecondaryHover: string;
|
|
2569
2579
|
colorSecondaryPressed: string;
|
|
@@ -2792,6 +2802,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2792
2802
|
name: string;
|
|
2793
2803
|
multiple: boolean;
|
|
2794
2804
|
disabled: boolean | undefined;
|
|
2805
|
+
showTrigger: boolean;
|
|
2795
2806
|
listType: listType;
|
|
2796
2807
|
showCancelButton: boolean;
|
|
2797
2808
|
showRemoveButton: boolean;
|
package/lib/upload/src/Upload.js
CHANGED
|
@@ -30,19 +30,33 @@ const UploadFileList_1 = __importDefault(require("./UploadFileList"));
|
|
|
30
30
|
function createXhrHandlers(inst, file, XHR) {
|
|
31
31
|
const { doChange, XhrMap } = inst;
|
|
32
32
|
let percentage = 0;
|
|
33
|
+
function handleXHRError(e) {
|
|
34
|
+
const fileAfterChange = Object.assign({}, file, {
|
|
35
|
+
status: 'error',
|
|
36
|
+
percentage
|
|
37
|
+
});
|
|
38
|
+
XhrMap.delete(file.id);
|
|
39
|
+
doChange(fileAfterChange, e);
|
|
40
|
+
}
|
|
41
|
+
function handleXHRLoad(e) {
|
|
42
|
+
var _a;
|
|
43
|
+
if (XHR.status !== 200) {
|
|
44
|
+
handleXHRError(e);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
let fileAfterChange = Object.assign({}, file, {
|
|
48
|
+
status: 'finished',
|
|
49
|
+
percentage,
|
|
50
|
+
file: null
|
|
51
|
+
});
|
|
52
|
+
XhrMap.delete(file.id);
|
|
53
|
+
fileAfterChange =
|
|
54
|
+
((_a = inst.onFinish) === null || _a === void 0 ? void 0 : _a.call(inst, { file: fileAfterChange, event: e })) || fileAfterChange;
|
|
55
|
+
doChange(fileAfterChange, e);
|
|
56
|
+
}
|
|
33
57
|
return {
|
|
34
|
-
handleXHRLoad
|
|
35
|
-
|
|
36
|
-
let fileAfterChange = Object.assign({}, file, {
|
|
37
|
-
status: 'finished',
|
|
38
|
-
percentage,
|
|
39
|
-
file: null
|
|
40
|
-
});
|
|
41
|
-
XhrMap.delete(file.id);
|
|
42
|
-
fileAfterChange =
|
|
43
|
-
((_a = inst.onFinish) === null || _a === void 0 ? void 0 : _a.call(inst, { file: fileAfterChange, event: e })) || fileAfterChange;
|
|
44
|
-
doChange(fileAfterChange, e);
|
|
45
|
-
},
|
|
58
|
+
handleXHRLoad,
|
|
59
|
+
handleXHRError,
|
|
46
60
|
handleXHRAbort(e) {
|
|
47
61
|
const fileAfterChange = Object.assign({}, file, {
|
|
48
62
|
status: 'removed',
|
|
@@ -52,14 +66,6 @@ function createXhrHandlers(inst, file, XHR) {
|
|
|
52
66
|
XhrMap.delete(file.id);
|
|
53
67
|
doChange(fileAfterChange, e);
|
|
54
68
|
},
|
|
55
|
-
handleXHRError(e) {
|
|
56
|
-
const fileAfterChange = Object.assign({}, file, {
|
|
57
|
-
status: 'error',
|
|
58
|
-
percentage
|
|
59
|
-
});
|
|
60
|
-
XhrMap.delete(file.id);
|
|
61
|
-
doChange(fileAfterChange, e);
|
|
62
|
-
},
|
|
63
69
|
handleXHRProgress(e) {
|
|
64
70
|
const fileAfterChange = Object.assign({}, file, {
|
|
65
71
|
status: 'uploading'
|
|
@@ -202,7 +208,10 @@ const uploadProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), {
|
|
|
202
208
|
}, listType: {
|
|
203
209
|
type: String,
|
|
204
210
|
default: 'text'
|
|
205
|
-
}, onPreview: Function, createThumbnailUrl: Function, abstract: Boolean, max: Number
|
|
211
|
+
}, onPreview: Function, createThumbnailUrl: Function, abstract: Boolean, max: Number, showTrigger: {
|
|
212
|
+
type: Boolean,
|
|
213
|
+
default: true
|
|
214
|
+
} });
|
|
206
215
|
exports.default = (0, vue_1.defineComponent)({
|
|
207
216
|
name: 'Upload',
|
|
208
217
|
props: uploadProps,
|
|
@@ -421,7 +430,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
421
430
|
maxReachedRef,
|
|
422
431
|
fileListStyleRef: (0, vue_1.toRef)(props, 'fileListStyle'),
|
|
423
432
|
abstractRef: (0, vue_1.toRef)(props, 'abstract'),
|
|
424
|
-
cssVarsRef
|
|
433
|
+
cssVarsRef,
|
|
434
|
+
showTriggerRef: (0, vue_1.toRef)(props, 'showTrigger')
|
|
425
435
|
});
|
|
426
436
|
const exposedMethods = {
|
|
427
437
|
submit,
|
|
@@ -448,7 +458,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
448
458
|
this.dragOver && `${mergedClsPrefix}-upload--drag-over`
|
|
449
459
|
], style: this.cssVars },
|
|
450
460
|
inputNode,
|
|
451
|
-
this.listType !== 'image-card' && ((0, vue_1.h)(UploadTrigger_1.default, null, $slots)),
|
|
461
|
+
this.showTrigger && this.listType !== 'image-card' && ((0, vue_1.h)(UploadTrigger_1.default, null, $slots)),
|
|
452
462
|
this.showFileList && (0, vue_1.h)(UploadFileList_1.default, null, $slots)));
|
|
453
463
|
}
|
|
454
464
|
});
|
|
@@ -150,9 +150,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
150
150
|
fontSizeMedium: string;
|
|
151
151
|
fontSizeLarge: string;
|
|
152
152
|
opacityDisabled: string;
|
|
153
|
-
colorOpacitySecondary:
|
|
154
|
-
colorOpacitySecondaryHover:
|
|
155
|
-
colorOpacitySecondaryPressed:
|
|
153
|
+
colorOpacitySecondary: string;
|
|
154
|
+
colorOpacitySecondaryHover: string;
|
|
155
|
+
colorOpacitySecondaryPressed: string;
|
|
156
156
|
colorSecondary: string;
|
|
157
157
|
colorSecondaryHover: string;
|
|
158
158
|
colorSecondaryPressed: string;
|
|
@@ -219,7 +219,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
219
219
|
colorHoverInfo: string;
|
|
220
220
|
colorPressedInfo: string;
|
|
221
221
|
colorFocusInfo: string;
|
|
222
|
-
colorDisabledInfo: string;
|
|
222
|
+
colorDisabledInfo: string;
|
|
223
223
|
textColorInfo: string;
|
|
224
224
|
textColorHoverInfo: string;
|
|
225
225
|
textColorPressedInfo: string;
|