naive-ui 2.25.3 → 2.25.6
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/dynamic-input/src/DynamicInput.d.ts +3 -1
- package/es/dynamic-input/src/DynamicInput.js +17 -10
- 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/legacy-grid/src/styles/index.cssr.js +1 -1
- 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.d.ts +3 -1
- package/es/mention/src/Mention.js +20 -10
- 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/tabs/src/styles/index.cssr.js +2 -0
- 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/dynamic-input/src/DynamicInput.d.ts +3 -1
- package/lib/dynamic-input/src/DynamicInput.js +16 -9
- 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/legacy-grid/src/styles/index.cssr.js +1 -1
- 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.d.ts +3 -1
- package/lib/mention/src/Mention.js +19 -9
- 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/tabs/src/styles/index.cssr.js +2 -0
- 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
|
@@ -59,7 +59,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
const { mergedComponentPropsRef, mergedClsPrefixRef } = (0, _mixins_1.useConfig)();
|
|
62
|
+
const { mergedComponentPropsRef, mergedClsPrefixRef, inlineThemeDisabled } = (0, _mixins_1.useConfig)();
|
|
63
63
|
const NFormItem = (0, vue_1.inject)(use_form_item_1.formItemInjectionKey, null);
|
|
64
64
|
const uncontrolledValueRef = (0, vue_1.ref)(props.defaultValue);
|
|
65
65
|
const controlledValueRef = (0, vue_1.toRef)(props, 'value');
|
|
@@ -201,6 +201,15 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
201
201
|
valuePlaceholderRef: (0, vue_1.toRef)(props, 'valuePlaceholder'),
|
|
202
202
|
placeholderRef: (0, vue_1.toRef)(props, 'placeholder')
|
|
203
203
|
});
|
|
204
|
+
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
205
|
+
const { self: { actionMargin } } = themeRef.value;
|
|
206
|
+
return {
|
|
207
|
+
'--action-margin': actionMargin
|
|
208
|
+
};
|
|
209
|
+
});
|
|
210
|
+
const themeClassHandle = inlineThemeDisabled
|
|
211
|
+
? (0, _mixins_1.useThemeClass)('dynamic-input', undefined, cssVarsRef, props)
|
|
212
|
+
: undefined;
|
|
204
213
|
return {
|
|
205
214
|
locale: (0, _mixins_1.useLocale)('DynamicInput').localeRef,
|
|
206
215
|
buttonSize: buttonSizeRef,
|
|
@@ -217,17 +226,15 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
217
226
|
move,
|
|
218
227
|
createItem,
|
|
219
228
|
mergedTheme: themeRef,
|
|
220
|
-
cssVars:
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
'--action-margin': actionMargin
|
|
224
|
-
};
|
|
225
|
-
})
|
|
229
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
230
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
231
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
226
232
|
};
|
|
227
233
|
},
|
|
228
234
|
render() {
|
|
229
|
-
const { $slots, buttonSize, mergedClsPrefix, mergedValue, locale, mergedTheme, keyField, itemStyle, preset, showSortButton, NFormItem, ensureKey, handleValueChange, remove, createItem, move } = this;
|
|
230
|
-
|
|
235
|
+
const { $slots, buttonSize, mergedClsPrefix, mergedValue, locale, mergedTheme, keyField, itemStyle, preset, showSortButton, NFormItem, ensureKey, handleValueChange, remove, createItem, move, onRender } = this;
|
|
236
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
237
|
+
return ((0, vue_1.h)("div", { class: [`${mergedClsPrefix}-dynamic-input`, this.themeClass], style: this.cssVars }, !Array.isArray(mergedValue) || mergedValue.length === 0 ? ((0, vue_1.h)(button_1.NButton, Object.assign({ block: true, ghost: true, dashed: true, size: buttonSize }, this.createButtonProps, { disabled: this.insertionDisabled, theme: mergedTheme.peers.Button, themeOverrides: mergedTheme.peerOverrides.Button, onClick: this.handleCreateClick }), {
|
|
231
238
|
default: () => (0, _utils_1.resolveSlot)($slots['create-button-default'], () => [
|
|
232
239
|
locale.create
|
|
233
240
|
]),
|
|
@@ -266,7 +266,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
266
266
|
'--n-feedback-text-color': string;
|
|
267
267
|
'--n-feedback-text-color-warning': string;
|
|
268
268
|
'--n-feedback-text-color-error': string;
|
|
269
|
-
}
|
|
269
|
+
}> | undefined;
|
|
270
|
+
themeClass: import("vue").Ref<string>;
|
|
271
|
+
onRender: () => void;
|
|
270
272
|
validate: import("./interface").FormItemValidate;
|
|
271
273
|
restoreValidation: () => void;
|
|
272
274
|
path?: string | undefined;
|
package/lib/form/src/FormItem.js
CHANGED
|
@@ -76,7 +76,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
76
76
|
props: exports.formItemProps,
|
|
77
77
|
setup(props) {
|
|
78
78
|
(0, _utils_1.useInjectionInstanceCollection)(context_1.formItemInstsInjectionKey, 'formItems', (0, vue_1.toRef)(props, 'path'));
|
|
79
|
-
const { mergedClsPrefixRef } = (0, _mixins_1.useConfig)(props);
|
|
79
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = (0, _mixins_1.useConfig)(props);
|
|
80
80
|
const NForm = (0, vue_1.inject)(context_1.formInjectionKey, null);
|
|
81
81
|
const formItemSizeRefs = (0, utils_1.formItemSize)(props);
|
|
82
82
|
const formItemMiscRefs = (0, utils_1.formItemMisc)(props);
|
|
@@ -238,45 +238,52 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
238
238
|
NForm === null || NForm === void 0 ? void 0 : NForm.deriveMaxChildLabelWidth(Number(getComputedStyle(labelElementRef.value).width.slice(0, -2)));
|
|
239
239
|
}
|
|
240
240
|
});
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
241
|
+
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
242
|
+
var _a;
|
|
243
|
+
const { value: size } = mergedSizeRef;
|
|
244
|
+
const { value: labelPlacement } = labelPlacementRef;
|
|
245
|
+
const direction = labelPlacement === 'top' ? 'vertical' : 'horizontal';
|
|
246
|
+
const { common: { cubicBezierEaseInOut }, self: { labelTextColor, asteriskColor, lineHeight, feedbackTextColor, feedbackTextColorWarning, feedbackTextColorError, feedbackPadding, [(0, _utils_1.createKey)('labelHeight', size)]: labelHeight, [(0, _utils_1.createKey)('blankHeight', size)]: blankHeight, [(0, _utils_1.createKey)('feedbackFontSize', size)]: feedbackFontSize, [(0, _utils_1.createKey)('feedbackHeight', size)]: feedbackHeight, [(0, _utils_1.createKey)('labelPadding', direction)]: labelPadding, [(0, _utils_1.createKey)('labelTextAlign', direction)]: labelTextAlign, [(0, _utils_1.createKey)((0, _utils_1.createKey)('labelFontSize', labelPlacement), size)]: labelFontSize } } = themeRef.value;
|
|
247
|
+
let mergedLabelTextAlign = (_a = labelTextAlignRef.value) !== null && _a !== void 0 ? _a : labelTextAlign;
|
|
248
|
+
if (labelPlacement === 'top') {
|
|
249
|
+
mergedLabelTextAlign =
|
|
250
|
+
mergedLabelTextAlign === 'right' ? 'flex-end' : 'flex-start';
|
|
251
|
+
}
|
|
252
|
+
const cssVars = {
|
|
253
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
254
|
+
'--n-line-height': lineHeight,
|
|
255
|
+
'--n-blank-height': blankHeight,
|
|
256
|
+
'--n-label-font-size': labelFontSize,
|
|
257
|
+
'--n-label-text-align': mergedLabelTextAlign,
|
|
258
|
+
'--n-label-height': labelHeight,
|
|
259
|
+
'--n-label-padding': labelPadding,
|
|
260
|
+
'--n-asterisk-color': asteriskColor,
|
|
261
|
+
'--n-label-text-color': labelTextColor,
|
|
262
|
+
'--n-feedback-padding': feedbackPadding,
|
|
263
|
+
'--n-feedback-font-size': feedbackFontSize,
|
|
264
|
+
'--n-feedback-height': feedbackHeight,
|
|
265
|
+
'--n-feedback-text-color': feedbackTextColor,
|
|
266
|
+
'--n-feedback-text-color-warning': feedbackTextColorWarning,
|
|
267
|
+
'--n-feedback-text-color-error': feedbackTextColorError
|
|
268
|
+
};
|
|
269
|
+
return cssVars;
|
|
270
|
+
});
|
|
271
|
+
const themeClassHandle = (0, _mixins_1.useThemeClass)('form-item', (0, vue_1.computed)(() => {
|
|
272
|
+
var _a;
|
|
273
|
+
return `${mergedSizeRef.value[0]}${labelPlacementRef.value[0]}${((_a = labelTextAlignRef.value) === null || _a === void 0 ? void 0 : _a[0]) || ''}`;
|
|
274
|
+
}), cssVarsRef, props);
|
|
275
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({ labelElementRef, mergedClsPrefix: mergedClsPrefixRef, mergedRequired: mergedRequiredRef, hasFeedback: hasFeedbackRef, feedbackId: feedbackIdRef, explains: explainsRef }, formItemMiscRefs), formItemSizeRefs), exposedRef), { cssVars: inlineThemeDisabled ? undefined : cssVarsRef, themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass, onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender });
|
|
271
276
|
},
|
|
272
277
|
render() {
|
|
273
278
|
var _a;
|
|
274
|
-
const { $slots, mergedClsPrefix, mergedShowLabel, mergedShowRequireMark, mergedRequireMarkPlacement } = this;
|
|
279
|
+
const { $slots, mergedClsPrefix, mergedShowLabel, mergedShowRequireMark, mergedRequireMarkPlacement, onRender } = this;
|
|
275
280
|
const renderedShowRequireMark = mergedShowRequireMark !== undefined
|
|
276
281
|
? mergedShowRequireMark
|
|
277
282
|
: this.mergedRequired;
|
|
283
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
278
284
|
return ((0, vue_1.h)("div", { class: [
|
|
279
285
|
`${mergedClsPrefix}-form-item`,
|
|
286
|
+
this.themeClass,
|
|
280
287
|
`${mergedClsPrefix}-form-item--${this.mergedSize}-size`,
|
|
281
288
|
`${mergedClsPrefix}-form-item--${this.mergedLabelPlacement}-labelled`,
|
|
282
289
|
!mergedShowLabel && `${mergedClsPrefix}-form-item--no-label`
|
|
@@ -51,7 +51,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
51
51
|
return (0, vue_1.h)(Row_1.default, (0, _utils_1.keep)(this.$props, Row_1.rowPropKeys), {
|
|
52
52
|
default: () => {
|
|
53
53
|
const colProps = (0, _utils_1.keep)(this.$props, FormItemCol_1.formItemColPropKeys);
|
|
54
|
-
return (0, vue_1.h)(FormItemCol_1.default, Object.assign(Object.assign({ ref: '
|
|
54
|
+
return (0, vue_1.h)(FormItemCol_1.default, Object.assign(Object.assign({ ref: 'formItemColInstRef' }, colProps), { span: 24 }), this.$slots);
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
}
|
|
@@ -120,7 +120,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
120
120
|
'--n-color-start': string;
|
|
121
121
|
'--n-color-end': string;
|
|
122
122
|
'--n-font-weight': string;
|
|
123
|
-
}
|
|
123
|
+
}> | undefined;
|
|
124
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
125
|
+
onRender: (() => void) | undefined;
|
|
124
126
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
125
127
|
readonly size: PropType<string | number>;
|
|
126
128
|
readonly fontSize: PropType<string | number>;
|
|
@@ -17,7 +17,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
17
17
|
props: gradientTextProps,
|
|
18
18
|
setup(props) {
|
|
19
19
|
(0, _utils_1.useHoudini)();
|
|
20
|
-
const { mergedClsPrefixRef } = (0, _mixins_1.useConfig)(props);
|
|
20
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = (0, _mixins_1.useConfig)(props);
|
|
21
21
|
const compatibleTypeRef = (0, vue_1.computed)(() => {
|
|
22
22
|
const { type } = props;
|
|
23
23
|
if (type === 'danger')
|
|
@@ -44,29 +44,37 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
44
44
|
return undefined;
|
|
45
45
|
});
|
|
46
46
|
const themeRef = (0, _mixins_1.useTheme)('GradientText', '-gradient-text', index_cssr_1.default, styles_1.gradientTextLight, props, mergedClsPrefixRef);
|
|
47
|
+
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
48
|
+
const { value: type } = compatibleTypeRef;
|
|
49
|
+
const { common: { cubicBezierEaseInOut }, self: { rotate, [(0, _utils_1.createKey)('colorStart', type)]: colorStart, [(0, _utils_1.createKey)('colorEnd', type)]: colorEnd, fontWeight } } = themeRef.value;
|
|
50
|
+
return {
|
|
51
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
52
|
+
'--n-rotate': rotate,
|
|
53
|
+
'--n-color-start': colorStart,
|
|
54
|
+
'--n-color-end': colorEnd,
|
|
55
|
+
'--n-font-weight': fontWeight
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
const themeClassHandle = inlineThemeDisabled
|
|
59
|
+
? (0, _mixins_1.useThemeClass)('gradient-text', (0, vue_1.computed)(() => compatibleTypeRef.value[0]), cssVarsRef, props)
|
|
60
|
+
: undefined;
|
|
47
61
|
return {
|
|
48
62
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
49
63
|
compatibleType: compatibleTypeRef,
|
|
50
64
|
styleFontSize: styleFontSizeRef,
|
|
51
65
|
styleBgImage: styleBgImageRef,
|
|
52
|
-
cssVars:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return {
|
|
56
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
57
|
-
'--n-rotate': rotate,
|
|
58
|
-
'--n-color-start': colorStart,
|
|
59
|
-
'--n-color-end': colorEnd,
|
|
60
|
-
'--n-font-weight': fontWeight
|
|
61
|
-
};
|
|
62
|
-
})
|
|
66
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
67
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
68
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
63
69
|
};
|
|
64
70
|
},
|
|
65
71
|
render() {
|
|
66
|
-
const { mergedClsPrefix } = this;
|
|
72
|
+
const { mergedClsPrefix, onRender } = this;
|
|
73
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
67
74
|
return ((0, vue_1.h)("span", { class: [
|
|
68
75
|
`${mergedClsPrefix}-gradient-text`,
|
|
69
|
-
`${mergedClsPrefix}-gradient-text--${this.compatibleType}-type
|
|
76
|
+
`${mergedClsPrefix}-gradient-text--${this.compatibleType}-type`,
|
|
77
|
+
this.themeClass
|
|
70
78
|
], style: [
|
|
71
79
|
{
|
|
72
80
|
fontSize: this.styleFontSize,
|
package/lib/icon/src/Icon.d.ts
CHANGED
|
@@ -39,11 +39,9 @@ export declare const NIcon: import("vue").DefineComponent<{
|
|
|
39
39
|
'--n-bezier': string;
|
|
40
40
|
'--n-color': string;
|
|
41
41
|
'--n-opacity': string;
|
|
42
|
-
} |
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
'--n-opacity'?: undefined;
|
|
46
|
-
}>;
|
|
42
|
+
}> | undefined;
|
|
43
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
44
|
+
onRender: (() => void) | undefined;
|
|
47
45
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
48
46
|
depth: PropType<Depth>;
|
|
49
47
|
size: (StringConstructor | NumberConstructor)[];
|
package/lib/icon/src/Icon.js
CHANGED
|
@@ -15,8 +15,28 @@ exports.NIcon = (0, vue_1.defineComponent)({
|
|
|
15
15
|
inheritAttrs: false,
|
|
16
16
|
props: Object.assign(Object.assign({}, _mixins_1.useTheme.props), { depth: [String, Number], size: [Number, String], color: String, component: Object }),
|
|
17
17
|
setup(props) {
|
|
18
|
-
const { mergedClsPrefixRef } = (0, _mixins_1.useConfig)(props);
|
|
18
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = (0, _mixins_1.useConfig)(props);
|
|
19
19
|
const themeRef = (0, _mixins_1.useTheme)('Icon', '-icon', index_cssr_1.default, styles_1.iconLight, props, mergedClsPrefixRef);
|
|
20
|
+
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
21
|
+
const { depth } = props;
|
|
22
|
+
const { common: { cubicBezierEaseInOut }, self } = themeRef.value;
|
|
23
|
+
if (depth !== undefined) {
|
|
24
|
+
const { color, [`opacity${depth}Depth`]: opacity } = self;
|
|
25
|
+
return {
|
|
26
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
27
|
+
'--n-color': color,
|
|
28
|
+
'--n-opacity': opacity
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
33
|
+
'--n-color': '',
|
|
34
|
+
'--n-opacity': ''
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
const themeClassHandle = inlineThemeDisabled
|
|
38
|
+
? (0, _mixins_1.useThemeClass)('icon', (0, vue_1.computed)(() => `${props.depth || 'd'}`), cssVarsRef, props)
|
|
39
|
+
: undefined;
|
|
20
40
|
return {
|
|
21
41
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
22
42
|
mergedStyle: (0, vue_1.computed)(() => {
|
|
@@ -26,39 +46,29 @@ exports.NIcon = (0, vue_1.defineComponent)({
|
|
|
26
46
|
color
|
|
27
47
|
};
|
|
28
48
|
}),
|
|
29
|
-
cssVars:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (depth !== undefined) {
|
|
33
|
-
const { color, [`opacity${depth}Depth`]: opacity } = self;
|
|
34
|
-
return {
|
|
35
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
36
|
-
'--n-color': color,
|
|
37
|
-
'--n-opacity': opacity
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
'--n-bezier': cubicBezierEaseInOut
|
|
42
|
-
};
|
|
43
|
-
})
|
|
49
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
50
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
51
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
44
52
|
};
|
|
45
53
|
},
|
|
46
54
|
render() {
|
|
47
55
|
var _a;
|
|
48
|
-
const { $parent, depth, mergedClsPrefix, component } = this;
|
|
56
|
+
const { $parent, depth, mergedClsPrefix, component, onRender, themeClass } = this;
|
|
49
57
|
if ((_a = $parent === null || $parent === void 0 ? void 0 : $parent.$options) === null || _a === void 0 ? void 0 : _a._n_icon__) {
|
|
50
58
|
(0, _utils_1.warn)('icon', "don't wrap `n-icon` inside `n-icon`");
|
|
51
59
|
}
|
|
60
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
52
61
|
return (0, vue_1.h)('i', (0, vue_1.mergeProps)(this.$attrs, {
|
|
53
62
|
role: 'img',
|
|
54
63
|
class: [
|
|
55
64
|
`${mergedClsPrefix}-icon`,
|
|
65
|
+
themeClass,
|
|
56
66
|
{
|
|
57
67
|
[`${mergedClsPrefix}-icon--depth`]: depth,
|
|
58
68
|
[`${mergedClsPrefix}-icon--color-transition`]: depth !== undefined
|
|
59
69
|
}
|
|
60
70
|
],
|
|
61
|
-
style:
|
|
71
|
+
style: [this.cssVars, this.mergedStyle]
|
|
62
72
|
}), component ? (0, vue_1.h)(component) : this.$slots);
|
|
63
73
|
}
|
|
64
74
|
});
|
|
@@ -132,7 +132,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
132
132
|
'--n-toolbar-color': string;
|
|
133
133
|
'--n-toolbar-border-radius': string;
|
|
134
134
|
'--n-toolbar-box-shadow': string;
|
|
135
|
-
}
|
|
135
|
+
}> | undefined;
|
|
136
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
137
|
+
onRender: (() => void) | undefined;
|
|
136
138
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
137
139
|
onNext: PropType<() => void>;
|
|
138
140
|
onPrev: PropType<() => void>;
|
|
@@ -257,6 +257,20 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
257
257
|
return node;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
+
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
261
|
+
const { common: { cubicBezierEaseInOut }, self: { toolbarIconColor, toolbarBorderRadius, toolbarBoxShadow, toolbarColor } } = themeRef.value;
|
|
262
|
+
return {
|
|
263
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
264
|
+
'--n-toolbar-icon-color': toolbarIconColor,
|
|
265
|
+
'--n-toolbar-color': toolbarColor,
|
|
266
|
+
'--n-toolbar-border-radius': toolbarBorderRadius,
|
|
267
|
+
'--n-toolbar-box-shadow': toolbarBoxShadow
|
|
268
|
+
};
|
|
269
|
+
});
|
|
270
|
+
const { inlineThemeDisabled } = (0, _mixins_1.useConfig)();
|
|
271
|
+
const themeClassHandle = inlineThemeDisabled
|
|
272
|
+
? (0, _mixins_1.useThemeClass)('image-preview', undefined, cssVarsRef, props)
|
|
273
|
+
: undefined;
|
|
260
274
|
return Object.assign({ previewRef,
|
|
261
275
|
previewWrapperRef, previewSrc: previewSrcRef, show: showRef, appear: (0, vooks_1.useIsMounted)(), displayed: displayedRef, handleWheel(e) {
|
|
262
276
|
e.preventDefault();
|
|
@@ -275,16 +289,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
275
289
|
rotateClockwise,
|
|
276
290
|
handleSwitchPrev,
|
|
277
291
|
handleSwitchNext,
|
|
278
|
-
withTooltip, cssVars:
|
|
279
|
-
const { common: { cubicBezierEaseInOut }, self: { toolbarIconColor, toolbarBorderRadius, toolbarBoxShadow, toolbarColor } } = themeRef.value;
|
|
280
|
-
return {
|
|
281
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
282
|
-
'--n-toolbar-icon-color': toolbarIconColor,
|
|
283
|
-
'--n-toolbar-color': toolbarColor,
|
|
284
|
-
'--n-toolbar-border-radius': toolbarBorderRadius,
|
|
285
|
-
'--n-toolbar-box-shadow': toolbarBoxShadow
|
|
286
|
-
};
|
|
287
|
-
}) }, exposedMethods);
|
|
292
|
+
withTooltip, 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);
|
|
288
293
|
},
|
|
289
294
|
render() {
|
|
290
295
|
var _a, _b;
|
|
@@ -292,8 +297,16 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
292
297
|
return ((0, vue_1.h)(vue_1.Fragment, null, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 :
|
|
293
298
|
_b.call(_a),
|
|
294
299
|
(0, vue_1.h)(vueuc_1.LazyTeleport, { show: this.show }, {
|
|
295
|
-
default: () =>
|
|
296
|
-
|
|
300
|
+
default: () => {
|
|
301
|
+
var _a;
|
|
302
|
+
if (!(this.show || this.displayed)) {
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
305
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
306
|
+
return (0, vue_1.withDirectives)((0, vue_1.h)("div", { class: [
|
|
307
|
+
`${clsPrefix}-image-preview-container`,
|
|
308
|
+
this.themeClass
|
|
309
|
+
], style: this.cssVars, onWheel: this.handleWheel },
|
|
297
310
|
(0, vue_1.h)(vue_1.Transition, { name: "fade-in-transition", appear: this.appear }, {
|
|
298
311
|
default: () => this.show ? ((0, vue_1.h)("div", { class: `${clsPrefix}-image-preview-overlay`, onClick: this.toggleShow })) : null
|
|
299
312
|
}),
|
|
@@ -324,8 +337,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
324
337
|
onEnter: this.syncTransformOrigin, onBeforeLeave: this.syncTransformOrigin }, {
|
|
325
338
|
default: () => (0, vue_1.withDirectives)((0, vue_1.h)("div", { class: `${clsPrefix}-image-preview-wrapper`, ref: "previewWrapperRef" },
|
|
326
339
|
(0, vue_1.h)("img", { draggable: false, onMousedown: this.handlePreviewMousedown, onDblclick: this.handlePreviewDblclick, class: `${clsPrefix}-image-preview`, key: this.previewSrc, src: this.previewSrc, ref: "previewRef", onDragstart: this.handleDragStart })), [[vue_1.vShow, this.show]])
|
|
327
|
-
})), [[vdirs_1.zindexable, { enabled: this.show }]])
|
|
328
|
-
|
|
340
|
+
})), [[vdirs_1.zindexable, { enabled: this.show }]]);
|
|
341
|
+
}
|
|
329
342
|
})));
|
|
330
343
|
}
|
|
331
344
|
});
|
package/lib/input/src/Input.d.ts
CHANGED
|
@@ -547,6 +547,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
547
547
|
textareaElRef: import("vue").Ref<HTMLTextAreaElement | null>;
|
|
548
548
|
textareaMirrorElRef: import("vue").Ref<HTMLElement | null>;
|
|
549
549
|
textareaScrollbarInstRef: import("vue").Ref<{
|
|
550
|
+
$el: HTMLElement;
|
|
550
551
|
containerRef: HTMLElement | null;
|
|
551
552
|
contentRef: HTMLElement | null;
|
|
552
553
|
containerScrollTop: number;
|
|
@@ -557,6 +558,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
557
558
|
handleMouseEnterWrapper: () => void;
|
|
558
559
|
handleMouseLeaveWrapper: () => void;
|
|
559
560
|
} | null>;
|
|
561
|
+
rtlEnabled: import("vue").Ref<import("../../config-provider/src/internal-interface").RtlItem | undefined> | undefined;
|
|
560
562
|
uncontrolledValue: import("vue").Ref<string | [string, string] | null>;
|
|
561
563
|
mergedValue: import("vue").ComputedRef<string | [string, string] | null>;
|
|
562
564
|
passwordVisible: import("vue").Ref<boolean>;
|
|
@@ -579,6 +581,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
579
581
|
top: string;
|
|
580
582
|
}>;
|
|
581
583
|
mergedStatus: import("vue").ComputedRef<FormValidationStatus | undefined>;
|
|
584
|
+
textAreaScrollContainerWidth: import("vue").Ref<number | undefined>;
|
|
582
585
|
handleTextAreaScroll: (e: Event) => void;
|
|
583
586
|
handleCompositionStart: () => void;
|
|
584
587
|
handleCompositionEnd: (e: CompositionEvent) => void;
|
|
@@ -635,7 +638,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
635
638
|
opacity1: string;
|
|
636
639
|
opacity2: string;
|
|
637
640
|
opacity3: string;
|
|
638
|
-
opacity4: string;
|
|
641
|
+
opacity4: string;
|
|
639
642
|
opacity5: string;
|
|
640
643
|
dividerColor: string;
|
|
641
644
|
borderColor: string;
|
package/lib/input/src/Input.js
CHANGED
|
@@ -17,6 +17,7 @@ const interface_1 = require("./interface");
|
|
|
17
17
|
const utils_1 = require("./utils");
|
|
18
18
|
const WordCount_1 = __importDefault(require("./WordCount"));
|
|
19
19
|
const input_cssr_1 = __importDefault(require("./styles/input.cssr"));
|
|
20
|
+
const use_rtl_1 = __importDefault(require("../../_mixins/use-rtl"));
|
|
20
21
|
const inputProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { bordered: {
|
|
21
22
|
type: Boolean,
|
|
22
23
|
default: undefined
|
|
@@ -66,7 +67,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
66
67
|
}
|
|
67
68
|
});
|
|
68
69
|
}
|
|
69
|
-
const { mergedClsPrefixRef, mergedBorderedRef, inlineThemeDisabled } = (0, _mixins_1.useConfig)(props);
|
|
70
|
+
const { mergedClsPrefixRef, mergedBorderedRef, inlineThemeDisabled, mergedRtlRef } = (0, _mixins_1.useConfig)(props);
|
|
70
71
|
const themeRef = (0, _mixins_1.useTheme)('Input', '-input', input_cssr_1.default, styles_1.inputLight, props, mergedClsPrefixRef);
|
|
71
72
|
// dom refs
|
|
72
73
|
const wrapperElRef = (0, vue_1.ref)(null);
|
|
@@ -178,14 +179,20 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
178
179
|
}
|
|
179
180
|
];
|
|
180
181
|
});
|
|
182
|
+
const textAreaScrollContainerWidthRef = (0, vue_1.ref)(undefined);
|
|
181
183
|
// textarea autosize
|
|
182
184
|
const updateTextAreaStyle = () => {
|
|
185
|
+
var _a, _b;
|
|
183
186
|
if (props.type === 'textarea') {
|
|
184
187
|
const { autosize } = props;
|
|
185
|
-
if (
|
|
186
|
-
|
|
188
|
+
if (autosize) {
|
|
189
|
+
textAreaScrollContainerWidthRef.value =
|
|
190
|
+
(_b = (_a = textareaScrollbarInstRef.value) === null || _a === void 0 ? void 0 : _a.$el) === null || _b === void 0 ? void 0 : _b.offsetWidth;
|
|
191
|
+
}
|
|
187
192
|
if (!textareaElRef.value)
|
|
188
193
|
return;
|
|
194
|
+
if (typeof autosize === 'boolean')
|
|
195
|
+
return;
|
|
189
196
|
const { paddingTop: stylePaddingTop, paddingBottom: stylePaddingBottom, lineHeight: styleLineHeight } = window.getComputedStyle(textareaElRef.value);
|
|
190
197
|
const paddingTop = Number(stylePaddingTop.slice(0, -2));
|
|
191
198
|
const paddingBottom = Number(stylePaddingBottom.slice(0, -2));
|
|
@@ -633,6 +640,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
633
640
|
deactivate,
|
|
634
641
|
activate
|
|
635
642
|
};
|
|
643
|
+
const rtlEnabledRef = (0, use_rtl_1.default)('Input', mergedRtlRef, mergedClsPrefixRef);
|
|
636
644
|
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
637
645
|
const { value: size } = mergedSizeRef;
|
|
638
646
|
const { common: { cubicBezierEaseInOut }, self: { color, borderRadius, textColor, caretColor, caretColorError, caretColorWarning, textDecorationColor, border, borderDisabled, borderHover, borderFocus, placeholderColor, placeholderColorDisabled, lineHeightTextarea, colorDisabled, colorFocus, textColorDisabled, boxShadowFocus, iconSize, colorFocusWarning, boxShadowFocusWarning, borderWarning, borderFocusWarning, borderHoverWarning, colorFocusError, boxShadowFocusError, borderError, borderFocusError, borderHoverError, clearSize, clearColor, clearColorHover, clearColorPressed, iconColor, iconColorDisabled, suffixTextColor, countTextColor, iconColorHover, iconColorPressed, loadingColor, loadingColorError, loadingColorWarning, [(0, _utils_1.createKey)('padding', size)]: padding, [(0, _utils_1.createKey)('fontSize', size)]: fontSize, [(0, _utils_1.createKey)('height', size)]: height } } = themeRef.value;
|
|
@@ -706,7 +714,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
706
714
|
textareaMirrorElRef,
|
|
707
715
|
textareaScrollbarInstRef,
|
|
708
716
|
// value
|
|
709
|
-
uncontrolledValue: uncontrolledValueRef, mergedValue: mergedValueRef, passwordVisible: passwordVisibleRef, mergedPlaceholder: mergedPlaceholderRef, showPlaceholder1: showPlaceholder1Ref, showPlaceholder2: showPlaceholder2Ref, mergedFocus: mergedFocusRef, isComposing: isComposingRef, activated: activatedRef, showClearButton, mergedSize: mergedSizeRef, mergedDisabled: mergedDisabledRef, textDecorationStyle: textDecorationStyleRef, mergedClsPrefix: mergedClsPrefixRef, mergedBordered: mergedBorderedRef, mergedShowPasswordOn: mergedShowPasswordOnRef, placeholderStyle: placeholderStyleRef, mergedStatus: mergedStatusRef,
|
|
717
|
+
rtlEnabled: rtlEnabledRef, uncontrolledValue: uncontrolledValueRef, mergedValue: mergedValueRef, passwordVisible: passwordVisibleRef, mergedPlaceholder: mergedPlaceholderRef, showPlaceholder1: showPlaceholder1Ref, showPlaceholder2: showPlaceholder2Ref, mergedFocus: mergedFocusRef, isComposing: isComposingRef, activated: activatedRef, showClearButton, mergedSize: mergedSizeRef, mergedDisabled: mergedDisabledRef, textDecorationStyle: textDecorationStyleRef, mergedClsPrefix: mergedClsPrefixRef, mergedBordered: mergedBorderedRef, mergedShowPasswordOn: mergedShowPasswordOnRef, placeholderStyle: placeholderStyleRef, mergedStatus: mergedStatusRef, textAreaScrollContainerWidth: textAreaScrollContainerWidthRef,
|
|
710
718
|
// methods
|
|
711
719
|
handleTextAreaScroll,
|
|
712
720
|
handleCompositionStart,
|
|
@@ -737,6 +745,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
737
745
|
themeClass,
|
|
738
746
|
mergedStatus && `${mergedClsPrefix}-input--${mergedStatus}-status`,
|
|
739
747
|
{
|
|
748
|
+
[`${mergedClsPrefix}-input--rtl`]: this.rtlEnabled,
|
|
740
749
|
[`${mergedClsPrefix}-input--disabled`]: this.mergedDisabled,
|
|
741
750
|
[`${mergedClsPrefix}-input--textarea`]: this.type === 'textarea',
|
|
742
751
|
[`${mergedClsPrefix}-input--resizable`]: this.resizable && !this.autosize,
|
|
@@ -753,11 +762,23 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
753
762
|
(0, _utils_1.resolveWrappedSlot)($slots.prefix, (children) => children && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-input__prefix` }, children))),
|
|
754
763
|
this.type === 'textarea' ? ((0, vue_1.h)(_internal_1.NScrollbar, { ref: "textareaScrollbarInstRef", class: `${mergedClsPrefix}-input__textarea`, container: this.getTextareaScrollContainer, triggerDisplayManually: true, useUnifiedContainer: true }, {
|
|
755
764
|
default: () => {
|
|
765
|
+
const { textAreaScrollContainerWidth } = this;
|
|
766
|
+
const scrollContainerWidthStyle = {
|
|
767
|
+
width: this.autosize &&
|
|
768
|
+
textAreaScrollContainerWidth &&
|
|
769
|
+
`${textAreaScrollContainerWidth}px`
|
|
770
|
+
};
|
|
756
771
|
return ((0, vue_1.h)(vue_1.Fragment, null,
|
|
757
772
|
(0, vue_1.h)("textarea", Object.assign({}, this.inputProps, { ref: "textareaElRef", class: `${mergedClsPrefix}-input__textarea-el`, autofocus: this.autofocus, rows: Number(this.rows), placeholder: this.placeholder, value: this.mergedValue, disabled: this.mergedDisabled, maxlength: this.maxlength, minlength: this.minlength, readonly: this.readonly, tabindex: this.passivelyActivated && !this.activated
|
|
758
773
|
? -1
|
|
759
|
-
: undefined, style:
|
|
760
|
-
|
|
774
|
+
: undefined, style: [
|
|
775
|
+
this.textDecorationStyle[0],
|
|
776
|
+
scrollContainerWidthStyle
|
|
777
|
+
], onBlur: this.handleInputBlur, onFocus: this.handleInputFocus, onInput: this.handleInput, onChange: this.handleChange, onScroll: this.handleTextAreaScroll })),
|
|
778
|
+
this.showPlaceholder1 ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-input__placeholder`, style: [
|
|
779
|
+
this.placeholderStyle,
|
|
780
|
+
scrollContainerWidthStyle
|
|
781
|
+
], key: "placeholder" }, this.mergedPlaceholder[0])) : null,
|
|
761
782
|
this.autosize ? ((0, vue_1.h)(vueuc_1.VResizeObserver, { onResize: this.handleTextAreaMirrorResize }, {
|
|
762
783
|
default: () => ((0, vue_1.h)("div", { ref: "textareaMirrorElRef", class: `${mergedClsPrefix}-input__textarea-mirror`, key: "mirror" }))
|
|
763
784
|
})) : null));
|
|
@@ -393,7 +393,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
393
393
|
'--n-font-size': string;
|
|
394
394
|
'--n-line-height': string;
|
|
395
395
|
'--n-height': string;
|
|
396
|
-
}
|
|
396
|
+
}> | undefined;
|
|
397
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
398
|
+
onRender: (() => void) | undefined;
|
|
397
399
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
398
400
|
readonly size: {
|
|
399
401
|
readonly type: PropType<Size>;
|
|
@@ -19,32 +19,39 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
19
19
|
name: 'InputGroupLabel',
|
|
20
20
|
props: inputGroupLabelProps,
|
|
21
21
|
setup(props) {
|
|
22
|
-
const { mergedBorderedRef, mergedClsPrefixRef } = (0, _mixins_1.useConfig)(props);
|
|
22
|
+
const { mergedBorderedRef, mergedClsPrefixRef, inlineThemeDisabled } = (0, _mixins_1.useConfig)(props);
|
|
23
23
|
const themeRef = (0, _mixins_1.useTheme)('Input', '-input-group-label', input_group_label_cssr_1.default, styles_1.inputLight, props, mergedClsPrefixRef);
|
|
24
|
+
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
25
|
+
const { size } = props;
|
|
26
|
+
const { common: { cubicBezierEaseInOut }, self: { groupLabelColor, borderRadius, groupLabelTextColor, lineHeight, groupLabelBorder, [(0, _utils_1.createKey)('fontSize', size)]: fontSize, [(0, _utils_1.createKey)('height', size)]: height } } = themeRef.value;
|
|
27
|
+
return {
|
|
28
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
29
|
+
'--n-group-label-color': groupLabelColor,
|
|
30
|
+
'--n-group-label-border': groupLabelBorder,
|
|
31
|
+
'--n-border-radius': borderRadius,
|
|
32
|
+
'--n-group-label-text-color': groupLabelTextColor,
|
|
33
|
+
'--n-font-size': fontSize,
|
|
34
|
+
'--n-line-height': lineHeight,
|
|
35
|
+
'--n-height': height
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
const themeClassHandle = inlineThemeDisabled
|
|
39
|
+
? (0, _mixins_1.useThemeClass)('input-group-label', (0, vue_1.computed)(() => props.size[0]), cssVarsRef, props)
|
|
40
|
+
: undefined;
|
|
24
41
|
return {
|
|
25
42
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
26
43
|
mergedBordered: mergedBorderedRef,
|
|
27
|
-
cssVars:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
32
|
-
'--n-group-label-color': groupLabelColor,
|
|
33
|
-
'--n-group-label-border': groupLabelBorder,
|
|
34
|
-
'--n-border-radius': borderRadius,
|
|
35
|
-
'--n-group-label-text-color': groupLabelTextColor,
|
|
36
|
-
'--n-font-size': fontSize,
|
|
37
|
-
'--n-line-height': lineHeight,
|
|
38
|
-
'--n-height': height
|
|
39
|
-
};
|
|
40
|
-
})
|
|
44
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
45
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
46
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
41
47
|
};
|
|
42
48
|
},
|
|
43
49
|
render() {
|
|
44
|
-
var _a, _b;
|
|
50
|
+
var _a, _b, _c;
|
|
45
51
|
const { mergedClsPrefix } = this;
|
|
46
|
-
|
|
47
|
-
|
|
52
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
53
|
+
return ((0, vue_1.h)("div", { class: [`${mergedClsPrefix}-input-group-label`, this.themeClass], style: this.cssVars }, (_c = (_b = this.$slots).default) === null || _c === void 0 ? void 0 :
|
|
54
|
+
_c.call(_b),
|
|
48
55
|
this.mergedBordered ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-input-group-label__border` })) : null));
|
|
49
56
|
}
|
|
50
57
|
});
|