naive-ui 2.25.4 → 2.25.7
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/select-menu/src/SelectMenu.d.ts +1 -0
- package/es/_mixins/use-css-vars-class.js +2 -1
- package/es/button/src/styles/button-rtl.cssr.js +2 -2
- package/es/cascader/src/Cascader.d.ts +10 -0
- package/es/cascader/src/CascaderMenu.d.ts +1 -0
- package/es/cascader/src/CascaderOption.d.ts +1 -0
- package/es/cascader/src/CascaderSelectMenu.d.ts +1 -0
- package/es/cascader/src/CascaderSubmenu.d.ts +2 -0
- package/es/cascader/styles/light.d.ts +1 -0
- package/es/checkbox/src/Checkbox.d.ts +12 -0
- package/es/checkbox/src/Checkbox.js +14 -7
- package/es/checkbox/src/styles/index.cssr.js +16 -8
- package/es/checkbox/src/styles/rtl.cssr.d.ts +2 -0
- package/es/checkbox/src/styles/rtl.cssr.js +4 -0
- package/es/checkbox/styles/index.d.ts +1 -0
- package/es/checkbox/styles/index.js +1 -0
- package/es/checkbox/styles/light.d.ts +1 -0
- package/es/checkbox/styles/light.js +2 -2
- package/es/checkbox/styles/rtl.d.ts +2 -0
- package/es/checkbox/styles/rtl.js +5 -0
- package/es/code/src/Code.js +3 -1
- package/es/collapse/src/Collapse.d.ts +1 -0
- package/es/collapse/src/Collapse.js +9 -2
- package/es/collapse/src/CollapseItem.d.ts +1 -0
- package/es/collapse/src/CollapseItem.js +8 -3
- package/es/collapse/src/styles/rtl.cssr.d.ts +2 -0
- package/es/collapse/src/styles/rtl.cssr.js +15 -0
- package/es/collapse/styles/index.d.ts +1 -0
- package/es/collapse/styles/index.js +1 -0
- package/es/collapse/styles/rtl.d.ts +2 -0
- package/es/collapse/styles/rtl.js +5 -0
- package/es/collapse-transition/src/CollapseTransition.d.ts +3 -1
- package/es/collapse-transition/src/CollapseTransition.js +27 -14
- package/es/config-provider/src/ConfigProvider.js +6 -0
- package/es/config-provider/src/internal-interface.d.ts +1 -0
- package/es/data-table/src/DataTable.d.ts +20 -0
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +2 -0
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +2 -0
- package/es/data-table/src/TableParts/Body.d.ts +3 -0
- package/es/data-table/src/TableParts/Cell.d.ts +4 -0
- package/es/data-table/src/TableParts/Header.d.ts +2 -0
- package/es/data-table/styles/light.d.ts +2 -0
- package/es/date-picker/src/DatePicker.d.ts +7 -2
- package/es/date-picker/src/DatePicker.js +80 -68
- package/es/date-picker/src/panel/date.d.ts +6 -0
- package/es/date-picker/src/panel/date.js +7 -2
- package/es/date-picker/src/panel/daterange.d.ts +4 -0
- package/es/date-picker/src/panel/daterange.js +7 -2
- package/es/date-picker/src/panel/datetime.d.ts +6 -0
- package/es/date-picker/src/panel/datetime.js +7 -2
- package/es/date-picker/src/panel/datetimerange.d.ts +4 -0
- package/es/date-picker/src/panel/datetimerange.js +7 -2
- package/es/date-picker/src/panel/month.d.ts +6 -0
- package/es/date-picker/src/panel/month.js +4 -2
- package/es/date-picker/src/panel/panelHeader.d.ts +10 -0
- package/es/date-picker/src/panel/use-calendar.d.ts +4 -0
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +2 -0
- package/es/date-picker/src/panel/use-panel-common.d.ts +2 -0
- package/es/date-picker/src/panel/use-panel-common.js +3 -1
- package/es/drawer/src/Drawer.d.ts +3 -1
- package/es/drawer/src/Drawer.js +39 -27
- package/es/dropdown/src/Dropdown.d.ts +7 -5
- package/es/dropdown/src/Dropdown.js +59 -52
- package/es/form/src/FormItem.d.ts +3 -1
- package/es/form/src/FormItem.js +40 -33
- package/es/form/src/FormItemRow.js +1 -1
- package/es/gradient-text/src/GradientText.d.ts +3 -1
- package/es/gradient-text/src/GradientText.js +23 -15
- package/es/icon/src/Icon.d.ts +3 -5
- package/es/icon/src/Icon.js +29 -19
- package/es/image/src/ImagePreview.d.ts +3 -1
- package/es/image/src/ImagePreview.js +28 -15
- package/es/input/src/Input.d.ts +4 -1
- package/es/input/src/Input.js +27 -6
- package/es/input/src/InputGroupLabel.d.ts +3 -1
- package/es/input/src/InputGroupLabel.js +26 -19
- package/es/input/src/styles/input.cssr.js +1 -0
- package/es/input/src/styles/rtl.cssr.d.ts +2 -0
- package/es/input/src/styles/rtl.cssr.js +16 -0
- package/es/input/styles/index.d.ts +1 -0
- package/es/input/styles/index.js +1 -0
- package/es/input/styles/rtl.d.ts +2 -0
- package/es/input/styles/rtl.js +5 -0
- package/es/input-number/src/InputNumber.d.ts +1 -0
- package/es/input-number/src/InputNumber.js +8 -3
- package/es/input-number/src/styles/rtl.cssr.d.ts +2 -0
- package/es/input-number/src/styles/rtl.cssr.js +4 -0
- package/es/input-number/styles/index.d.ts +1 -0
- package/es/input-number/styles/index.js +1 -0
- package/es/input-number/styles/rtl.d.ts +2 -0
- package/es/input-number/styles/rtl.js +8 -0
- package/es/layout/src/Layout.d.ts +2 -0
- package/es/layout/src/LayoutContent.d.ts +1 -0
- package/es/layout/src/LayoutSider.d.ts +1 -0
- package/es/list/src/List.d.ts +3 -1
- package/es/list/src/List.js +27 -19
- package/es/loading-bar/src/LoadingBar.d.ts +3 -1
- package/es/loading-bar/src/LoadingBar.js +29 -15
- package/es/log/src/Log.d.ts +1 -0
- package/es/mention/src/Mention.js +6 -4
- package/es/message/src/Message.d.ts +12 -24
- package/es/message/src/Message.js +57 -40
- package/es/message/src/MessageEnvironment.d.ts +9 -0
- package/es/message/src/MessageEnvironment.js +1 -1
- package/es/message/src/MessageProvider.d.ts +67 -0
- package/es/message/src/MessageProvider.js +3 -0
- package/es/message/src/message-props.d.ts +4 -0
- package/es/message/src/message-props.js +4 -0
- package/es/message/src/styles/index.cssr.js +2 -1
- package/es/message/src/types.d.ts +3 -1
- package/es/message/styles/light.d.ts +7 -0
- package/es/message/styles/light.js +1 -1
- package/es/modal/src/BodyWrapper.d.ts +1 -0
- package/es/notification/src/Notification.d.ts +3 -1
- package/es/notification/src/Notification.js +44 -32
- package/es/notification/src/NotificationProvider.d.ts +1 -0
- package/es/notification/src/NotificationProvider.js +1 -0
- package/es/popconfirm/src/Popconfirm.d.ts +3 -2
- package/es/popconfirm/src/Popconfirm.js +2 -1
- package/es/popconfirm/src/PopconfirmPanel.d.ts +3 -1
- package/es/popconfirm/src/PopconfirmPanel.js +32 -25
- package/es/popconfirm/src/interface.d.ts +2 -0
- package/es/popover/src/PopoverBody.d.ts +4 -0
- package/es/popover/src/PopoverBody.js +3 -2
- package/es/popover/src/styles/index.cssr.js +49 -29
- package/es/radio/src/Radio.d.ts +7 -0
- package/es/radio/src/Radio.js +14 -7
- package/es/radio/src/RadioGroup.d.ts +9 -0
- package/es/radio/src/styles/radio.cssr.js +16 -9
- package/es/radio/styles/dark.js +2 -2
- package/es/radio/styles/light.d.ts +1 -0
- package/es/radio/styles/light.js +2 -2
- package/es/scrollbar/src/ScrollBar.d.ts +1 -0
- package/es/select/src/Select.d.ts +3 -1
- package/es/select/src/Select.js +31 -23
- package/es/slider/src/Slider.d.ts +6 -2
- package/es/slider/src/Slider.js +74 -51
- package/es/steps/src/Step.d.ts +3 -1
- package/es/steps/src/Step.js +32 -20
- package/es/styles.d.ts +4 -4
- package/es/styles.js +4 -4
- package/es/time-picker/src/Panel.js +4 -4
- package/es/time-picker/src/TimePicker.d.ts +12 -4
- package/es/time-picker/src/TimePicker.js +90 -35
- package/es/timeline/src/Timeline.d.ts +9 -9
- package/es/timeline/src/TimelineItem.d.ts +4 -2
- package/es/timeline/src/TimelineItem.js +34 -20
- package/es/timeline/styles/_common.d.ts +1 -1
- package/es/timeline/styles/_common.js +1 -1
- package/es/timeline/styles/light.d.ts +1 -1
- package/es/transfer/src/Transfer.d.ts +10 -0
- package/es/transfer/src/TransferFilter.d.ts +1 -0
- package/es/transfer/src/TransferList.d.ts +2 -0
- package/es/transfer/src/TransferListItem.d.ts +1 -0
- package/es/transfer/styles/light.d.ts +1 -0
- package/es/tree/src/Tree.d.ts +16 -3
- package/es/tree/src/Tree.js +50 -28
- package/es/tree/src/TreeNodeCheckbox.d.ts +1 -0
- package/es/tree/styles/light.d.ts +1 -0
- package/es/tree-select/src/TreeSelect.d.ts +23 -10
- package/es/tree-select/src/TreeSelect.js +26 -17
- package/es/tree-select/styles/light.d.ts +1 -0
- package/es/upload/src/Upload.d.ts +3 -1
- package/es/upload/src/Upload.js +23 -13
- package/es/upload/src/UploadFileList.js +8 -3
- package/es/upload/src/interface.d.ts +3 -1
- 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/select-menu/src/SelectMenu.d.ts +1 -0
- package/lib/_mixins/use-css-vars-class.js +2 -1
- package/lib/button/src/styles/button-rtl.cssr.js +2 -2
- package/lib/cascader/src/Cascader.d.ts +10 -0
- package/lib/cascader/src/CascaderMenu.d.ts +1 -0
- package/lib/cascader/src/CascaderOption.d.ts +1 -0
- package/lib/cascader/src/CascaderSelectMenu.d.ts +1 -0
- package/lib/cascader/src/CascaderSubmenu.d.ts +2 -0
- package/lib/cascader/styles/light.d.ts +1 -0
- package/lib/checkbox/src/Checkbox.d.ts +12 -0
- package/lib/checkbox/src/Checkbox.js +14 -7
- package/lib/checkbox/src/styles/index.cssr.js +16 -8
- package/lib/checkbox/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/checkbox/src/styles/rtl.cssr.js +11 -0
- package/lib/checkbox/styles/index.d.ts +1 -0
- package/lib/checkbox/styles/index.js +3 -1
- package/lib/checkbox/styles/light.d.ts +1 -0
- package/lib/checkbox/styles/light.js +2 -2
- package/lib/checkbox/styles/rtl.d.ts +2 -0
- package/lib/checkbox/styles/rtl.js +11 -0
- package/lib/code/src/Code.js +3 -1
- package/lib/collapse/src/Collapse.d.ts +1 -0
- package/lib/collapse/src/Collapse.js +9 -2
- package/lib/collapse/src/CollapseItem.d.ts +1 -0
- package/lib/collapse/src/CollapseItem.js +7 -2
- package/lib/collapse/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/collapse/src/styles/rtl.cssr.js +22 -0
- package/lib/collapse/styles/index.d.ts +1 -0
- package/lib/collapse/styles/index.js +3 -1
- package/lib/collapse/styles/rtl.d.ts +2 -0
- package/lib/collapse/styles/rtl.js +11 -0
- package/lib/collapse-transition/src/CollapseTransition.d.ts +3 -1
- package/lib/collapse-transition/src/CollapseTransition.js +26 -13
- package/lib/config-provider/src/ConfigProvider.js +6 -0
- package/lib/config-provider/src/internal-interface.d.ts +1 -0
- package/lib/data-table/src/DataTable.d.ts +20 -0
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +2 -0
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +2 -0
- package/lib/data-table/src/TableParts/Body.d.ts +3 -0
- package/lib/data-table/src/TableParts/Cell.d.ts +4 -0
- package/lib/data-table/src/TableParts/Header.d.ts +2 -0
- package/lib/data-table/styles/light.d.ts +2 -0
- package/lib/date-picker/src/DatePicker.d.ts +7 -2
- package/lib/date-picker/src/DatePicker.js +79 -67
- package/lib/date-picker/src/panel/date.d.ts +6 -0
- package/lib/date-picker/src/panel/date.js +7 -2
- package/lib/date-picker/src/panel/daterange.d.ts +4 -0
- package/lib/date-picker/src/panel/daterange.js +7 -2
- package/lib/date-picker/src/panel/datetime.d.ts +6 -0
- package/lib/date-picker/src/panel/datetime.js +7 -2
- package/lib/date-picker/src/panel/datetimerange.d.ts +4 -0
- package/lib/date-picker/src/panel/datetimerange.js +7 -2
- package/lib/date-picker/src/panel/month.d.ts +6 -0
- package/lib/date-picker/src/panel/month.js +4 -2
- package/lib/date-picker/src/panel/panelHeader.d.ts +10 -0
- package/lib/date-picker/src/panel/use-calendar.d.ts +4 -0
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +2 -0
- package/lib/date-picker/src/panel/use-panel-common.d.ts +2 -0
- package/lib/date-picker/src/panel/use-panel-common.js +3 -1
- package/lib/drawer/src/Drawer.d.ts +4 -1
- package/lib/drawer/src/Drawer.js +38 -26
- package/lib/dropdown/src/Dropdown.d.ts +7 -5
- package/lib/dropdown/src/Dropdown.js +58 -51
- package/lib/form/src/FormItem.d.ts +3 -1
- package/lib/form/src/FormItem.js +39 -32
- package/lib/form/src/FormItemRow.js +1 -1
- package/lib/gradient-text/src/GradientText.d.ts +3 -1
- package/lib/gradient-text/src/GradientText.js +22 -14
- package/lib/icon/src/Icon.d.ts +3 -5
- package/lib/icon/src/Icon.js +28 -18
- package/lib/image/src/ImagePreview.d.ts +3 -1
- package/lib/image/src/ImagePreview.js +27 -14
- package/lib/input/src/Input.d.ts +4 -1
- package/lib/input/src/Input.js +27 -6
- package/lib/input/src/InputGroupLabel.d.ts +3 -1
- package/lib/input/src/InputGroupLabel.js +25 -18
- package/lib/input/src/styles/input.cssr.js +1 -0
- package/lib/input/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/input/src/styles/rtl.cssr.js +23 -0
- package/lib/input/styles/index.d.ts +1 -0
- package/lib/input/styles/index.js +3 -1
- package/lib/input/styles/rtl.d.ts +2 -0
- package/lib/input/styles/rtl.js +11 -0
- package/lib/input-number/src/InputNumber.d.ts +1 -0
- package/lib/input-number/src/InputNumber.js +8 -3
- package/lib/input-number/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/input-number/src/styles/rtl.cssr.js +11 -0
- package/lib/input-number/styles/index.d.ts +1 -0
- package/lib/input-number/styles/index.js +3 -1
- package/lib/input-number/styles/rtl.d.ts +2 -0
- package/lib/input-number/styles/rtl.js +14 -0
- package/lib/layout/src/Layout.d.ts +2 -0
- package/lib/layout/src/LayoutContent.d.ts +1 -0
- package/lib/layout/src/LayoutSider.d.ts +1 -0
- package/lib/list/src/List.d.ts +3 -1
- package/lib/list/src/List.js +26 -18
- package/lib/loading-bar/src/LoadingBar.d.ts +3 -1
- package/lib/loading-bar/src/LoadingBar.js +28 -14
- package/lib/log/src/Log.d.ts +1 -0
- package/lib/mention/src/Mention.js +6 -4
- package/lib/message/src/Message.d.ts +12 -24
- package/lib/message/src/Message.js +56 -39
- package/lib/message/src/MessageEnvironment.d.ts +9 -0
- package/lib/message/src/MessageEnvironment.js +1 -1
- package/lib/message/src/MessageProvider.d.ts +67 -0
- package/lib/message/src/MessageProvider.js +3 -0
- package/lib/message/src/message-props.d.ts +4 -0
- package/lib/message/src/message-props.js +4 -0
- package/lib/message/src/styles/index.cssr.js +2 -1
- package/lib/message/src/types.d.ts +3 -1
- package/lib/message/styles/light.d.ts +7 -0
- package/lib/message/styles/light.js +1 -1
- package/lib/modal/src/BodyWrapper.d.ts +1 -0
- package/lib/notification/src/Notification.d.ts +3 -1
- package/lib/notification/src/Notification.js +44 -32
- package/lib/notification/src/NotificationProvider.d.ts +1 -0
- package/lib/notification/src/NotificationProvider.js +1 -0
- package/lib/popconfirm/src/Popconfirm.d.ts +3 -2
- package/lib/popconfirm/src/Popconfirm.js +2 -1
- package/lib/popconfirm/src/PopconfirmPanel.d.ts +3 -1
- package/lib/popconfirm/src/PopconfirmPanel.js +30 -23
- package/lib/popconfirm/src/interface.d.ts +2 -0
- package/lib/popover/src/PopoverBody.d.ts +4 -0
- package/lib/popover/src/PopoverBody.js +3 -2
- package/lib/popover/src/styles/index.cssr.js +50 -29
- package/lib/radio/src/Radio.d.ts +7 -0
- package/lib/radio/src/Radio.js +13 -6
- package/lib/radio/src/RadioGroup.d.ts +9 -0
- package/lib/radio/src/styles/radio.cssr.js +16 -9
- package/lib/radio/styles/dark.js +2 -2
- package/lib/radio/styles/light.d.ts +1 -0
- package/lib/radio/styles/light.js +2 -2
- package/lib/scrollbar/src/ScrollBar.d.ts +1 -0
- package/lib/select/src/Select.d.ts +3 -1
- package/lib/select/src/Select.js +30 -22
- package/lib/slider/src/Slider.d.ts +6 -2
- package/lib/slider/src/Slider.js +73 -50
- package/lib/steps/src/Step.d.ts +3 -1
- package/lib/steps/src/Step.js +32 -20
- package/lib/styles.d.ts +4 -4
- package/lib/styles.js +6 -2
- package/lib/time-picker/src/Panel.js +4 -4
- package/lib/time-picker/src/TimePicker.d.ts +12 -4
- package/lib/time-picker/src/TimePicker.js +89 -34
- package/lib/timeline/src/Timeline.d.ts +9 -9
- package/lib/timeline/src/TimelineItem.d.ts +4 -2
- package/lib/timeline/src/TimelineItem.js +34 -20
- package/lib/timeline/styles/_common.d.ts +1 -1
- package/lib/timeline/styles/_common.js +1 -1
- package/lib/timeline/styles/light.d.ts +1 -1
- package/lib/transfer/src/Transfer.d.ts +10 -0
- package/lib/transfer/src/TransferFilter.d.ts +1 -0
- package/lib/transfer/src/TransferList.d.ts +2 -0
- package/lib/transfer/src/TransferListItem.d.ts +1 -0
- package/lib/transfer/styles/light.d.ts +1 -0
- package/lib/tree/src/Tree.d.ts +16 -3
- package/lib/tree/src/Tree.js +49 -27
- package/lib/tree/src/TreeNodeCheckbox.d.ts +1 -0
- package/lib/tree/styles/light.d.ts +1 -0
- package/lib/tree-select/src/TreeSelect.d.ts +23 -10
- package/lib/tree-select/src/TreeSelect.js +25 -16
- package/lib/tree-select/styles/light.d.ts +1 -0
- package/lib/upload/src/Upload.d.ts +3 -1
- package/lib/upload/src/Upload.js +22 -12
- package/lib/upload/src/UploadFileList.js +8 -3
- package/lib/upload/src/interface.d.ts +3 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
package/es/tree/src/Tree.js
CHANGED
|
@@ -13,7 +13,7 @@ import { createTreeMate, flatten, createIndexGetter } from 'treemate';
|
|
|
13
13
|
import { useMergedState } from 'vooks';
|
|
14
14
|
import { VVirtualList } from 'vueuc';
|
|
15
15
|
import { getPadding } from 'seemly';
|
|
16
|
-
import { useConfig, useTheme } from '../../_mixins';
|
|
16
|
+
import { useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
17
17
|
import { call, createDataKey, warn } from '../../_utils';
|
|
18
18
|
import { NxScrollbar } from '../../_internal';
|
|
19
19
|
import { treeLight } from '../styles';
|
|
@@ -118,7 +118,7 @@ export default defineComponent({
|
|
|
118
118
|
name: 'Tree',
|
|
119
119
|
props: treeProps,
|
|
120
120
|
setup(props) {
|
|
121
|
-
const { mergedClsPrefixRef } = useConfig(props);
|
|
121
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props);
|
|
122
122
|
const themeRef = useTheme('Tree', '-tree', style, treeLight, props, mergedClsPrefixRef);
|
|
123
123
|
const selfElRef = ref(null);
|
|
124
124
|
const scrollbarInstRef = ref(null);
|
|
@@ -981,7 +981,31 @@ export default defineComponent({
|
|
|
981
981
|
handleKeydown,
|
|
982
982
|
handleKeyup
|
|
983
983
|
};
|
|
984
|
-
|
|
984
|
+
const cssVarsRef = computed(() => {
|
|
985
|
+
const { common: { cubicBezierEaseInOut }, self: { fontSize, nodeBorderRadius, nodeColorHover, nodeColorPressed, nodeColorActive, arrowColor, loadingColor, nodeTextColor, nodeTextColorDisabled, dropMarkColor } } = themeRef.value;
|
|
986
|
+
return {
|
|
987
|
+
'--n-arrow-color': arrowColor,
|
|
988
|
+
'--n-loading-color': loadingColor,
|
|
989
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
990
|
+
'--n-font-size': fontSize,
|
|
991
|
+
'--n-node-border-radius': nodeBorderRadius,
|
|
992
|
+
'--n-node-color-active': nodeColorActive,
|
|
993
|
+
'--n-node-color-hover': nodeColorHover,
|
|
994
|
+
'--n-node-color-pressed': nodeColorPressed,
|
|
995
|
+
'--n-node-text-color': nodeTextColor,
|
|
996
|
+
'--n-node-text-color-disabled': nodeTextColorDisabled,
|
|
997
|
+
'--n-drop-mark-color': dropMarkColor
|
|
998
|
+
};
|
|
999
|
+
});
|
|
1000
|
+
const themeClassHandle = inlineThemeDisabled
|
|
1001
|
+
? useThemeClass('tree', undefined, cssVarsRef, props)
|
|
1002
|
+
: undefined;
|
|
1003
|
+
return {
|
|
1004
|
+
mergedClsPrefix: mergedClsPrefixRef,
|
|
1005
|
+
mergedTheme: themeRef,
|
|
1006
|
+
fNodes: mergedFNodesRef,
|
|
1007
|
+
aip: aipRef,
|
|
1008
|
+
selfElRef,
|
|
985
1009
|
virtualListInstRef,
|
|
986
1010
|
scrollbarInstRef,
|
|
987
1011
|
handleFocusout,
|
|
@@ -990,24 +1014,16 @@ export default defineComponent({
|
|
|
990
1014
|
getScrollContainer,
|
|
991
1015
|
getScrollContent,
|
|
992
1016
|
handleAfterEnter,
|
|
993
|
-
handleResize,
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
'--n-node-border-radius': nodeBorderRadius,
|
|
1001
|
-
'--n-node-color-active': nodeColorActive,
|
|
1002
|
-
'--n-node-color-hover': nodeColorHover,
|
|
1003
|
-
'--n-node-color-pressed': nodeColorPressed,
|
|
1004
|
-
'--n-node-text-color': nodeTextColor,
|
|
1005
|
-
'--n-node-text-color-disabled': nodeTextColorDisabled,
|
|
1006
|
-
'--n-drop-mark-color': dropMarkColor
|
|
1007
|
-
};
|
|
1008
|
-
}) }, exposedMethods);
|
|
1017
|
+
handleResize,
|
|
1018
|
+
handleKeydown: exposedMethods.handleKeydown,
|
|
1019
|
+
handleKeyup: exposedMethods.handleKeyup,
|
|
1020
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
1021
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
1022
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
1023
|
+
};
|
|
1009
1024
|
},
|
|
1010
1025
|
render() {
|
|
1026
|
+
var _a;
|
|
1011
1027
|
const { mergedClsPrefix, blockNode, blockLine, draggable, disabled, internalFocusable, checkable, handleKeyup, handleKeydown, handleFocusout } = this;
|
|
1012
1028
|
const mergedFocusable = internalFocusable && !disabled;
|
|
1013
1029
|
const tabindex = mergedFocusable ? '0' : undefined;
|
|
@@ -1024,18 +1040,24 @@ export default defineComponent({
|
|
|
1024
1040
|
const { mergedTheme, internalScrollablePadding } = this;
|
|
1025
1041
|
const padding = getPadding(internalScrollablePadding || '0');
|
|
1026
1042
|
return (h(NxScrollbar, { ref: "scrollbarInstRef", onDragleave: draggable ? this.handleDragLeaveTree : undefined, container: this.getScrollContainer, content: this.getScrollContent, class: treeClass, theme: mergedTheme.peers.Scrollbar, themeOverrides: mergedTheme.peerOverrides.Scrollbar, tabindex: tabindex, onKeyup: mergedFocusable ? handleKeyup : undefined, onKeydown: mergedFocusable ? handleKeydown : undefined, onFocusout: mergedFocusable ? handleFocusout : undefined }, {
|
|
1027
|
-
default: () =>
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1043
|
+
default: () => {
|
|
1044
|
+
var _a;
|
|
1045
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
1046
|
+
return (h(VVirtualList, { ref: "virtualListInstRef", items: this.fNodes, itemSize: ITEM_SIZE, ignoreItemResize: this.aip, paddingTop: padding.top, paddingBottom: padding.bottom, class: this.themeClass, style: [
|
|
1047
|
+
this.cssVars,
|
|
1048
|
+
{
|
|
1049
|
+
paddingLeft: padding.left,
|
|
1050
|
+
paddingRight: padding.right
|
|
1051
|
+
}
|
|
1052
|
+
], onScroll: this.handleScroll, onResize: this.handleResize, showScrollbar: false, itemResizable: true }, {
|
|
1053
|
+
default: ({ item }) => createNode(item)
|
|
1054
|
+
}));
|
|
1055
|
+
}
|
|
1036
1056
|
}));
|
|
1037
1057
|
}
|
|
1038
1058
|
const { internalScrollable } = this;
|
|
1059
|
+
treeClass.push(this.themeClass);
|
|
1060
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
1039
1061
|
if (internalScrollable) {
|
|
1040
1062
|
return (h(NxScrollbar, { class: treeClass, tabindex: tabindex, onKeyup: mergedFocusable ? handleKeyup : undefined, onKeydown: mergedFocusable ? handleKeydown : undefined, onFocusout: mergedFocusable ? handleFocusout : undefined, style: this.cssVars, contentStyle: { padding: this.internalScrollablePadding } }, {
|
|
1041
1063
|
default: () => (h("div", { onDragleave: draggable ? this.handleDragLeaveTree : undefined, ref: "selfElRef" }, this.fNodes.map(createNode)))
|
|
@@ -25,6 +25,7 @@ declare const treeLight: import("../../_mixins/use-theme").Theme<"Tree", {
|
|
|
25
25
|
dropMarkColor: string;
|
|
26
26
|
}, {
|
|
27
27
|
Checkbox: import("../../_mixins/use-theme").Theme<"Checkbox", {
|
|
28
|
+
labelLineHeight: string;
|
|
28
29
|
fontSizeSmall: string;
|
|
29
30
|
fontSizeMedium: string;
|
|
30
31
|
fontSizeLarge: string;
|
|
@@ -126,6 +126,7 @@ declare const props: {
|
|
|
126
126
|
dropMarkColor: string;
|
|
127
127
|
}, {
|
|
128
128
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
129
|
+
labelLineHeight: string;
|
|
129
130
|
fontSizeSmall: string;
|
|
130
131
|
fontSizeMedium: string;
|
|
131
132
|
fontSizeLarge: string;
|
|
@@ -264,6 +265,7 @@ declare const props: {
|
|
|
264
265
|
dropMarkColor: string;
|
|
265
266
|
}, {
|
|
266
267
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
268
|
+
labelLineHeight: string;
|
|
267
269
|
fontSizeSmall: string;
|
|
268
270
|
fontSizeMedium: string;
|
|
269
271
|
fontSizeLarge: string;
|
|
@@ -402,6 +404,7 @@ declare const props: {
|
|
|
402
404
|
dropMarkColor: string;
|
|
403
405
|
}, {
|
|
404
406
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
407
|
+
labelLineHeight: string;
|
|
405
408
|
fontSizeSmall: string;
|
|
406
409
|
fontSizeMedium: string;
|
|
407
410
|
fontSizeLarge: string;
|
|
@@ -640,6 +643,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
640
643
|
dropMarkColor: string;
|
|
641
644
|
}, {
|
|
642
645
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
646
|
+
labelLineHeight: string;
|
|
643
647
|
fontSizeSmall: string;
|
|
644
648
|
fontSizeMedium: string;
|
|
645
649
|
fontSizeLarge: string;
|
|
@@ -778,6 +782,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
778
782
|
dropMarkColor: string;
|
|
779
783
|
}, {
|
|
780
784
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
785
|
+
labelLineHeight: string;
|
|
781
786
|
fontSizeSmall: string;
|
|
782
787
|
fontSizeMedium: string;
|
|
783
788
|
fontSizeLarge: string;
|
|
@@ -916,6 +921,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
916
921
|
dropMarkColor: string;
|
|
917
922
|
}, {
|
|
918
923
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
924
|
+
labelLineHeight: string;
|
|
919
925
|
fontSizeSmall: string;
|
|
920
926
|
fontSizeMedium: string;
|
|
921
927
|
fontSizeLarge: string;
|
|
@@ -1091,16 +1097,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1091
1097
|
handleKeyup: (e: KeyboardEvent) => void;
|
|
1092
1098
|
handleTabOut: () => void;
|
|
1093
1099
|
handleMenuMousedown: (e: MouseEvent) => void;
|
|
1094
|
-
cssVars: import("vue").ComputedRef<{
|
|
1095
|
-
'--n-menu-box-shadow': string;
|
|
1096
|
-
'--n-menu-border-radius': string;
|
|
1097
|
-
'--n-menu-color': string;
|
|
1098
|
-
'--n-menu-height': string;
|
|
1099
|
-
'--n-bezier': string;
|
|
1100
|
-
'--n-action-padding': string;
|
|
1101
|
-
'--n-action-text-color': string;
|
|
1102
|
-
'--n-action-divider-color': string;
|
|
1103
|
-
}>;
|
|
1104
1100
|
mergedTheme: import("vue").ComputedRef<{
|
|
1105
1101
|
common: {
|
|
1106
1102
|
baseColor: string;
|
|
@@ -1229,6 +1225,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1229
1225
|
dropMarkColor: string;
|
|
1230
1226
|
}, {
|
|
1231
1227
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
1228
|
+
labelLineHeight: string;
|
|
1232
1229
|
fontSizeSmall: string;
|
|
1233
1230
|
fontSizeMedium: string;
|
|
1234
1231
|
fontSizeLarge: string;
|
|
@@ -1348,6 +1345,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1348
1345
|
Tree?: {
|
|
1349
1346
|
peers?: {
|
|
1350
1347
|
Checkbox?: import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Checkbox", {
|
|
1348
|
+
labelLineHeight: string;
|
|
1351
1349
|
fontSizeSmall: string;
|
|
1352
1350
|
fontSizeMedium: string;
|
|
1353
1351
|
fontSizeLarge: string;
|
|
@@ -1406,6 +1404,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1406
1404
|
} | undefined;
|
|
1407
1405
|
};
|
|
1408
1406
|
}>;
|
|
1407
|
+
cssVars: import("vue").ComputedRef<{
|
|
1408
|
+
'--n-menu-box-shadow': string;
|
|
1409
|
+
'--n-menu-border-radius': string;
|
|
1410
|
+
'--n-menu-color': string;
|
|
1411
|
+
'--n-menu-height': string;
|
|
1412
|
+
'--n-bezier': string;
|
|
1413
|
+
'--n-action-padding': string;
|
|
1414
|
+
'--n-action-text-color': string;
|
|
1415
|
+
'--n-action-divider-color': string;
|
|
1416
|
+
}> | undefined;
|
|
1417
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
1418
|
+
onRender: (() => void) | undefined;
|
|
1409
1419
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1410
1420
|
readonly onBlur: PropType<(e: FocusEvent) => void>;
|
|
1411
1421
|
readonly onFocus: PropType<(e: FocusEvent) => void>;
|
|
@@ -1527,6 +1537,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1527
1537
|
dropMarkColor: string;
|
|
1528
1538
|
}, {
|
|
1529
1539
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
1540
|
+
labelLineHeight: string;
|
|
1530
1541
|
fontSizeSmall: string;
|
|
1531
1542
|
fontSizeMedium: string;
|
|
1532
1543
|
fontSizeLarge: string;
|
|
@@ -1665,6 +1676,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1665
1676
|
dropMarkColor: string;
|
|
1666
1677
|
}, {
|
|
1667
1678
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
1679
|
+
labelLineHeight: string;
|
|
1668
1680
|
fontSizeSmall: string;
|
|
1669
1681
|
fontSizeMedium: string;
|
|
1670
1682
|
fontSizeLarge: string;
|
|
@@ -1803,6 +1815,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1803
1815
|
dropMarkColor: string;
|
|
1804
1816
|
}, {
|
|
1805
1817
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
1818
|
+
labelLineHeight: string;
|
|
1806
1819
|
fontSizeSmall: string;
|
|
1807
1820
|
fontSizeMedium: string;
|
|
1808
1821
|
fontSizeLarge: string;
|
|
@@ -8,7 +8,7 @@ import { createTreeMateOptions, treeSharedProps } from '../../tree/src/Tree';
|
|
|
8
8
|
import { NInternalSelection, NBaseFocusDetector } from '../../_internal';
|
|
9
9
|
import { NTree } from '../../tree';
|
|
10
10
|
import { NEmpty } from '../../empty';
|
|
11
|
-
import { useConfig, useFormItem, useLocale, useTheme } from '../../_mixins';
|
|
11
|
+
import { useConfig, useFormItem, useLocale, useTheme, useThemeClass } from '../../_mixins';
|
|
12
12
|
import { call, useAdjustedTo, warnOnce } from '../../_utils';
|
|
13
13
|
import { treeSelectLight } from '../styles';
|
|
14
14
|
import { treeSelectInjectionKey } from './interface';
|
|
@@ -70,7 +70,7 @@ export default defineComponent({
|
|
|
70
70
|
const triggerInstRef = ref(null);
|
|
71
71
|
const treeInstRef = ref(null);
|
|
72
72
|
const menuElRef = ref(null);
|
|
73
|
-
const { mergedClsPrefixRef, namespaceRef } = useConfig(props);
|
|
73
|
+
const { mergedClsPrefixRef, namespaceRef, inlineThemeDisabled } = useConfig(props);
|
|
74
74
|
const { localeRef } = useLocale('Select');
|
|
75
75
|
const { mergedSizeRef, mergedDisabledRef, mergedStatusRef, nTriggerFormBlur, nTriggerFormChange, nTriggerFormFocus, nTriggerFormInput } = useFormItem(props);
|
|
76
76
|
const uncontrolledValueRef = ref(props.defaultValue);
|
|
@@ -477,6 +477,22 @@ export default defineComponent({
|
|
|
477
477
|
}
|
|
478
478
|
});
|
|
479
479
|
const themeRef = useTheme('TreeSelect', '-tree-select', style, treeSelectLight, props, mergedClsPrefixRef);
|
|
480
|
+
const cssVarsRef = computed(() => {
|
|
481
|
+
const { common: { cubicBezierEaseInOut }, self: { menuBoxShadow, menuBorderRadius, menuColor, menuHeight, actionPadding, actionDividerColor, actionTextColor } } = themeRef.value;
|
|
482
|
+
return {
|
|
483
|
+
'--n-menu-box-shadow': menuBoxShadow,
|
|
484
|
+
'--n-menu-border-radius': menuBorderRadius,
|
|
485
|
+
'--n-menu-color': menuColor,
|
|
486
|
+
'--n-menu-height': menuHeight,
|
|
487
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
488
|
+
'--n-action-padding': actionPadding,
|
|
489
|
+
'--n-action-text-color': actionTextColor,
|
|
490
|
+
'--n-action-divider-color': actionDividerColor
|
|
491
|
+
};
|
|
492
|
+
});
|
|
493
|
+
const themeClassHandle = inlineThemeDisabled
|
|
494
|
+
? useThemeClass('tree-select', undefined, cssVarsRef, props)
|
|
495
|
+
: undefined;
|
|
480
496
|
return {
|
|
481
497
|
menuElRef,
|
|
482
498
|
mergedStatus: mergedStatusRef,
|
|
@@ -522,20 +538,10 @@ export default defineComponent({
|
|
|
522
538
|
handleKeyup,
|
|
523
539
|
handleTabOut,
|
|
524
540
|
handleMenuMousedown,
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
'--n-menu-border-radius': menuBorderRadius,
|
|
530
|
-
'--n-menu-color': menuColor,
|
|
531
|
-
'--n-menu-height': menuHeight,
|
|
532
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
533
|
-
'--n-action-padding': actionPadding,
|
|
534
|
-
'--n-action-text-color': actionTextColor,
|
|
535
|
-
'--n-action-divider-color': actionDividerColor
|
|
536
|
-
};
|
|
537
|
-
}),
|
|
538
|
-
mergedTheme: themeRef
|
|
541
|
+
mergedTheme: themeRef,
|
|
542
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
543
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
544
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
539
545
|
};
|
|
540
546
|
},
|
|
541
547
|
render() {
|
|
@@ -549,12 +555,15 @@ export default defineComponent({
|
|
|
549
555
|
h(VFollower, { ref: "followerInstRef", show: this.mergedShow, placement: this.placement, to: this.adjustedTo, teleportDisabled: this.adjustedTo === useAdjustedTo.tdkey, containerClass: this.namespace, width: this.consistentMenuWidth ? 'target' : undefined, minWidth: "target" }, {
|
|
550
556
|
default: () => (h(Transition, { name: "fade-in-scale-up-transition", appear: this.isMounted, onLeave: this.handleMenuLeave }, {
|
|
551
557
|
default: () => {
|
|
558
|
+
var _a;
|
|
552
559
|
if (!this.mergedShow)
|
|
553
560
|
return null;
|
|
554
561
|
const { mergedClsPrefix, filteredTreeInfo, checkable, multiple, menuProps } = this;
|
|
562
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
555
563
|
return withDirectives(h("div", Object.assign({}, menuProps, { class: [
|
|
556
564
|
`${mergedClsPrefix}-tree-select-menu`,
|
|
557
|
-
menuProps === null || menuProps === void 0 ? void 0 : menuProps.class
|
|
565
|
+
menuProps === null || menuProps === void 0 ? void 0 : menuProps.class,
|
|
566
|
+
this.themeClass
|
|
558
567
|
], ref: "menuElRef", style: [
|
|
559
568
|
(menuProps === null || menuProps === void 0 ? void 0 : menuProps.style) || '',
|
|
560
569
|
this.cssVars
|
|
@@ -33,6 +33,7 @@ declare const treeSelectLight: import("../../_mixins/use-theme").Theme<"TreeSele
|
|
|
33
33
|
dropMarkColor: string;
|
|
34
34
|
}, {
|
|
35
35
|
Checkbox: import("../../_mixins/use-theme").Theme<"Checkbox", {
|
|
36
|
+
labelLineHeight: string;
|
|
36
37
|
fontSizeSmall: string;
|
|
37
38
|
fontSizeMedium: string;
|
|
38
39
|
fontSizeLarge: string;
|
|
@@ -1996,7 +1996,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1996
1996
|
}>;
|
|
1997
1997
|
dragOver: import("vue").Ref<boolean>;
|
|
1998
1998
|
handleFileInputChange: (e: Event) => void;
|
|
1999
|
-
cssVars: import("vue").ComputedRef<any
|
|
1999
|
+
cssVars: import("vue").ComputedRef<any> | undefined;
|
|
2000
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
2001
|
+
onRender: (() => void) | undefined;
|
|
2000
2002
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
2001
2003
|
readonly name: {
|
|
2002
2004
|
readonly type: StringConstructor;
|
package/es/upload/src/Upload.js
CHANGED
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { h, defineComponent, computed, provide, toRef, ref, Fragment, Teleport, nextTick } from 'vue';
|
|
11
11
|
import { createId } from 'seemly';
|
|
12
12
|
import { useMergedState } from 'vooks';
|
|
13
|
-
import { useConfig, useTheme, useFormItem } from '../../_mixins';
|
|
13
|
+
import { useConfig, useTheme, useFormItem, useThemeClass } from '../../_mixins';
|
|
14
14
|
import { warn, call, throwError } from '../../_utils';
|
|
15
15
|
import { uploadLight } from '../styles';
|
|
16
16
|
import { uploadDraggerKey } from './UploadDragger';
|
|
@@ -152,11 +152,13 @@ function appendData(formData, data, file) {
|
|
|
152
152
|
formData.append(key, dataObject[key]);
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
|
-
function submitImpl(inst,
|
|
155
|
+
function submitImpl(inst, fieldName, file, { method, action, withCredentials, headers, data }) {
|
|
156
156
|
const request = new XMLHttpRequest();
|
|
157
157
|
inst.XhrMap.set(file.id, request);
|
|
158
158
|
request.withCredentials = withCredentials;
|
|
159
|
+
const formData = new FormData();
|
|
159
160
|
appendData(formData, data, file);
|
|
161
|
+
formData.append(fieldName, file.file);
|
|
160
162
|
registerHandler(inst, file, request);
|
|
161
163
|
if (action !== undefined) {
|
|
162
164
|
request.open(method.toUpperCase(), action);
|
|
@@ -220,7 +222,7 @@ export default defineComponent({
|
|
|
220
222
|
if (props.abstract && props.listType === 'image-card') {
|
|
221
223
|
throwError('upload', 'when the list-type is image-card, abstract is not supported.');
|
|
222
224
|
}
|
|
223
|
-
const { mergedClsPrefixRef } = useConfig(props);
|
|
225
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props);
|
|
224
226
|
const themeRef = useTheme('Upload', '-upload', style, uploadLight, props, mergedClsPrefixRef);
|
|
225
227
|
const formItem = useFormItem(props);
|
|
226
228
|
const maxReachedRef = computed(() => {
|
|
@@ -313,8 +315,6 @@ export default defineComponent({
|
|
|
313
315
|
filesToUpload.forEach((file) => {
|
|
314
316
|
const { status } = file;
|
|
315
317
|
if (status === 'pending' || (status === 'error' && shouldReupload)) {
|
|
316
|
-
const formData = new FormData();
|
|
317
|
-
formData.append(fieldName, file.file);
|
|
318
318
|
if (props.customRequest) {
|
|
319
319
|
customSubmitImpl({
|
|
320
320
|
inst: {
|
|
@@ -337,7 +337,7 @@ export default defineComponent({
|
|
|
337
337
|
XhrMap,
|
|
338
338
|
onFinish: props.onFinish,
|
|
339
339
|
onError: props.onError
|
|
340
|
-
},
|
|
340
|
+
}, fieldName, file, {
|
|
341
341
|
method,
|
|
342
342
|
action,
|
|
343
343
|
withCredentials,
|
|
@@ -408,6 +408,9 @@ export default defineComponent({
|
|
|
408
408
|
'--n-item-border-image-card': itemBorderImageCard
|
|
409
409
|
};
|
|
410
410
|
});
|
|
411
|
+
const themeClassHandle = inlineThemeDisabled
|
|
412
|
+
? useThemeClass('upload', undefined, cssVarsRef, props)
|
|
413
|
+
: undefined;
|
|
411
414
|
provide(uploadInjectionKey, {
|
|
412
415
|
mergedClsPrefixRef,
|
|
413
416
|
mergedThemeRef: themeRef,
|
|
@@ -433,7 +436,9 @@ export default defineComponent({
|
|
|
433
436
|
maxReachedRef,
|
|
434
437
|
fileListStyleRef: toRef(props, 'fileListStyle'),
|
|
435
438
|
abstractRef: toRef(props, 'abstract'),
|
|
436
|
-
cssVarsRef,
|
|
439
|
+
cssVarsRef: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
440
|
+
themeClassRef: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
441
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender,
|
|
437
442
|
showTriggerRef: toRef(props, 'showTrigger'),
|
|
438
443
|
imageGroupPropsRef: toRef(props, 'imageGroupProps')
|
|
439
444
|
});
|
|
@@ -445,11 +450,11 @@ export default defineComponent({
|
|
|
445
450
|
openOpenFileDialog
|
|
446
451
|
};
|
|
447
452
|
return Object.assign({ mergedClsPrefix: mergedClsPrefixRef, draggerInsideRef,
|
|
448
|
-
inputElRef, mergedTheme: themeRef, dragOver: dragOverRef, handleFileInputChange, cssVars: cssVarsRef }, exposedMethods);
|
|
453
|
+
inputElRef, mergedTheme: themeRef, dragOver: dragOverRef, handleFileInputChange, cssVars: inlineThemeDisabled ? undefined : cssVarsRef, themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass, onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender }, exposedMethods);
|
|
449
454
|
},
|
|
450
455
|
render() {
|
|
451
456
|
var _a, _b, _c;
|
|
452
|
-
const { draggerInsideRef, mergedClsPrefix, $slots } = this;
|
|
457
|
+
const { draggerInsideRef, mergedClsPrefix, $slots, onRender } = this;
|
|
453
458
|
if ($slots.default && !this.abstract) {
|
|
454
459
|
const firstChild = $slots.default()[0];
|
|
455
460
|
if ((_b = (_a = firstChild) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b[uploadDraggerKey]) {
|
|
@@ -457,12 +462,17 @@ export default defineComponent({
|
|
|
457
462
|
}
|
|
458
463
|
}
|
|
459
464
|
const inputNode = (h("input", Object.assign({}, this.inputProps, { ref: "inputElRef", type: "file", class: `${mergedClsPrefix}-upload-file-input`, accept: this.accept, multiple: this.multiple, onChange: this.handleFileInputChange })));
|
|
460
|
-
|
|
461
|
-
_c
|
|
462
|
-
|
|
465
|
+
if (this.abstract) {
|
|
466
|
+
return (h(Fragment, null, (_c = $slots.default) === null || _c === void 0 ? void 0 :
|
|
467
|
+
_c.call($slots),
|
|
468
|
+
h(Teleport, { to: "body" }, inputNode)));
|
|
469
|
+
}
|
|
470
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
471
|
+
return (h("div", { class: [
|
|
463
472
|
`${mergedClsPrefix}-upload`,
|
|
464
473
|
draggerInsideRef.value && `${mergedClsPrefix}-upload--dragger-inside`,
|
|
465
|
-
this.dragOver && `${mergedClsPrefix}-upload--drag-over
|
|
474
|
+
this.dragOver && `${mergedClsPrefix}-upload--drag-over`,
|
|
475
|
+
this.themeClass
|
|
466
476
|
], style: this.cssVars },
|
|
467
477
|
inputNode,
|
|
468
478
|
this.showTrigger && this.listType !== 'image-card' && (h(NUploadTrigger, null, $slots)),
|
|
@@ -12,7 +12,7 @@ export default defineComponent({
|
|
|
12
12
|
if (!NUpload) {
|
|
13
13
|
throwError('upload-file-list', '`n-upload-file-list` must be placed inside `n-upload`.');
|
|
14
14
|
}
|
|
15
|
-
const { mergedClsPrefixRef, listTypeRef, mergedFileListRef, fileListStyleRef, cssVarsRef, maxReachedRef, showTriggerRef, imageGroupPropsRef } = NUpload;
|
|
15
|
+
const { abstractRef, mergedClsPrefixRef, listTypeRef, mergedFileListRef, fileListStyleRef, cssVarsRef, themeClassRef, maxReachedRef, showTriggerRef, imageGroupPropsRef } = NUpload;
|
|
16
16
|
const isImageCardTypeRef = computed(() => listTypeRef.value === 'image-card');
|
|
17
17
|
const renderFileList = () => mergedFileListRef.value.map((file) => (h(NUploadFile, { clsPrefix: mergedClsPrefixRef.value, key: file.id, file: file, listType: listTypeRef.value })));
|
|
18
18
|
const renderUploadFileList = () => isImageCardTypeRef.value ? (h(NImageGroup, Object.assign({}, imageGroupPropsRef.value), { default: renderFileList })) : (h(NFadeInExpandTransition, { group: true }, {
|
|
@@ -20,11 +20,16 @@ export default defineComponent({
|
|
|
20
20
|
}));
|
|
21
21
|
return () => {
|
|
22
22
|
const { value: mergedClsPrefix } = mergedClsPrefixRef;
|
|
23
|
+
const { value: abstract } = abstractRef;
|
|
23
24
|
return (h("div", { class: [
|
|
24
25
|
`${mergedClsPrefix}-upload-file-list`,
|
|
25
26
|
isImageCardTypeRef.value &&
|
|
26
|
-
`${mergedClsPrefix}-upload-file-list--grid
|
|
27
|
-
|
|
27
|
+
`${mergedClsPrefix}-upload-file-list--grid`,
|
|
28
|
+
abstract ? themeClassRef === null || themeClassRef === void 0 ? void 0 : themeClassRef.value : undefined
|
|
29
|
+
], style: [
|
|
30
|
+
abstract && cssVarsRef ? cssVarsRef.value : '',
|
|
31
|
+
fileListStyleRef.value
|
|
32
|
+
] },
|
|
28
33
|
renderUploadFileList(),
|
|
29
34
|
showTriggerRef.value &&
|
|
30
35
|
!maxReachedRef.value &&
|
|
@@ -65,7 +65,9 @@ export interface UploadInjection {
|
|
|
65
65
|
maxReachedRef: Ref<boolean>;
|
|
66
66
|
abstractRef: Ref<boolean>;
|
|
67
67
|
imageGroupPropsRef: Ref<ImageGroupProps | undefined>;
|
|
68
|
-
cssVarsRef: Ref<CSSProperties>;
|
|
68
|
+
cssVarsRef: undefined | Ref<CSSProperties>;
|
|
69
|
+
themeClassRef: undefined | Ref<string>;
|
|
70
|
+
onRender: undefined | (() => void);
|
|
69
71
|
submit: (fileId?: string) => void;
|
|
70
72
|
getFileThumbnailUrl: (file: FileInfo) => Promise<string>;
|
|
71
73
|
handleFileAddition: (files: FileList | null, e?: Event) => void;
|
package/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "2.25.
|
|
1
|
+
declare const _default: "2.25.7";
|
|
2
2
|
export default _default;
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '2.25.
|
|
1
|
+
export default '2.25.7';
|
|
@@ -42,6 +42,7 @@ export interface ScrollbarInstMethods {
|
|
|
42
42
|
handleMouseLeaveWrapper: () => void;
|
|
43
43
|
}
|
|
44
44
|
export interface ScrollbarInst extends ScrollbarInstMethods {
|
|
45
|
+
$el: HTMLElement;
|
|
45
46
|
containerRef: HTMLElement | null;
|
|
46
47
|
contentRef: HTMLElement | null;
|
|
47
48
|
containerScrollTop: number;
|
|
@@ -390,6 +390,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
390
390
|
scrollTo: import("vueuc/lib/virtual-list/src/VirtualList").ScrollTo;
|
|
391
391
|
} | null>;
|
|
392
392
|
scrollbarRef: import("vue").Ref<{
|
|
393
|
+
$el: HTMLElement;
|
|
393
394
|
containerRef: HTMLElement | null;
|
|
394
395
|
contentRef: HTMLElement | null;
|
|
395
396
|
containerScrollTop: number;
|
|
@@ -15,8 +15,9 @@ function useThemeClass(componentName, hashRef, cssVarsRef, props) {
|
|
|
15
15
|
const themeClassRef = (0, vue_1.ref)('');
|
|
16
16
|
const ssrAdapter = (0, vue3_ssr_1.useSsrAdapter)();
|
|
17
17
|
let renderCallback;
|
|
18
|
+
const hashClassPrefix = `__${componentName}`;
|
|
18
19
|
const mountStyle = () => {
|
|
19
|
-
let finalThemeHash =
|
|
20
|
+
let finalThemeHash = hashClassPrefix;
|
|
20
21
|
const hashValue = hashRef ? hashRef.value : undefined;
|
|
21
22
|
const themeHash = mergedThemeHashRef === null || mergedThemeHashRef === void 0 ? void 0 : mergedThemeHashRef.value;
|
|
22
23
|
if (themeHash)
|
|
@@ -9,9 +9,9 @@ const cssr_1 = require("../../../_utils/cssr");
|
|
|
9
9
|
exports.default = (0, cssr_1.cB)('button', [(0, cssr_1.cM)('rtl', `
|
|
10
10
|
direction: rtl;
|
|
11
11
|
`, [(0, cssr_1.cE)('icon', {
|
|
12
|
-
margin: 'var(--icon-margin)',
|
|
12
|
+
margin: 'var(--n-icon-margin)',
|
|
13
13
|
marginRight: 0
|
|
14
14
|
}), (0, cssr_1.cE)('content', [(0, cssr_1.c)('~', [(0, cssr_1.cE)('icon', {
|
|
15
|
-
margin: 'var(--icon-margin)',
|
|
15
|
+
margin: 'var(--n-icon-margin)',
|
|
16
16
|
marginLeft: 0
|
|
17
17
|
})])])])]);
|
|
@@ -235,6 +235,7 @@ declare const cascaderProps: {
|
|
|
235
235
|
colorHover: string;
|
|
236
236
|
}, any>;
|
|
237
237
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
238
|
+
labelLineHeight: string;
|
|
238
239
|
fontSizeSmall: string;
|
|
239
240
|
fontSizeMedium: string;
|
|
240
241
|
fontSizeLarge: string;
|
|
@@ -419,6 +420,7 @@ declare const cascaderProps: {
|
|
|
419
420
|
colorHover: string;
|
|
420
421
|
}, any>;
|
|
421
422
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
423
|
+
labelLineHeight: string;
|
|
422
424
|
fontSizeSmall: string;
|
|
423
425
|
fontSizeMedium: string;
|
|
424
426
|
fontSizeLarge: string;
|
|
@@ -603,6 +605,7 @@ declare const cascaderProps: {
|
|
|
603
605
|
colorHover: string;
|
|
604
606
|
}, any>;
|
|
605
607
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
608
|
+
labelLineHeight: string;
|
|
606
609
|
fontSizeSmall: string;
|
|
607
610
|
fontSizeMedium: string;
|
|
608
611
|
fontSizeLarge: string;
|
|
@@ -877,6 +880,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
877
880
|
colorHover: string;
|
|
878
881
|
}, any>;
|
|
879
882
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
883
|
+
labelLineHeight: string;
|
|
880
884
|
fontSizeSmall: string;
|
|
881
885
|
fontSizeMedium: string;
|
|
882
886
|
fontSizeLarge: string;
|
|
@@ -1061,6 +1065,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1061
1065
|
colorHover: string;
|
|
1062
1066
|
}, any>;
|
|
1063
1067
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
1068
|
+
labelLineHeight: string;
|
|
1064
1069
|
fontSizeSmall: string;
|
|
1065
1070
|
fontSizeMedium: string;
|
|
1066
1071
|
fontSizeLarge: string;
|
|
@@ -1245,6 +1250,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1245
1250
|
colorHover: string;
|
|
1246
1251
|
}, any>;
|
|
1247
1252
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
1253
|
+
labelLineHeight: string;
|
|
1248
1254
|
fontSizeSmall: string;
|
|
1249
1255
|
fontSizeMedium: string;
|
|
1250
1256
|
fontSizeLarge: string;
|
|
@@ -1595,6 +1601,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1595
1601
|
colorHover: string;
|
|
1596
1602
|
}, any>;
|
|
1597
1603
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
1604
|
+
labelLineHeight: string;
|
|
1598
1605
|
fontSizeSmall: string;
|
|
1599
1606
|
fontSizeMedium: string;
|
|
1600
1607
|
fontSizeLarge: string;
|
|
@@ -1947,6 +1954,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1947
1954
|
colorHover: string;
|
|
1948
1955
|
}, any>;
|
|
1949
1956
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
1957
|
+
labelLineHeight: string;
|
|
1950
1958
|
fontSizeSmall: string;
|
|
1951
1959
|
fontSizeMedium: string;
|
|
1952
1960
|
fontSizeLarge: string;
|
|
@@ -2131,6 +2139,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2131
2139
|
colorHover: string;
|
|
2132
2140
|
}, any>;
|
|
2133
2141
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
2142
|
+
labelLineHeight: string;
|
|
2134
2143
|
fontSizeSmall: string;
|
|
2135
2144
|
fontSizeMedium: string;
|
|
2136
2145
|
fontSizeLarge: string;
|
|
@@ -2315,6 +2324,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2315
2324
|
colorHover: string;
|
|
2316
2325
|
}, any>;
|
|
2317
2326
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
2327
|
+
labelLineHeight: string;
|
|
2318
2328
|
fontSizeSmall: string;
|
|
2319
2329
|
fontSizeMedium: string;
|
|
2320
2330
|
fontSizeLarge: string;
|
|
@@ -291,6 +291,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
291
291
|
colorHover: string;
|
|
292
292
|
}, any>;
|
|
293
293
|
Checkbox: import("../../_mixins").Theme<"Checkbox", {
|
|
294
|
+
labelLineHeight: string;
|
|
294
295
|
fontSizeSmall: string;
|
|
295
296
|
fontSizeMedium: string;
|
|
296
297
|
fontSizeLarge: string;
|