naive-ui 2.21.2 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/_internal/close/src/styles/index.cssr.js +6 -5
- package/es/_internal/scrollbar/src/ScrollBar.d.ts +15 -0
- package/es/_internal/scrollbar/src/ScrollBar.js +13 -7
- package/es/_internal/selection/src/Selection.js +11 -9
- package/es/_internal/selection/src/styles/index.cssr.js +6 -2
- package/es/alert/src/Alert.d.ts +20 -20
- package/es/alert/src/Alert.js +22 -22
- package/es/alert/src/styles/index.cssr.js +45 -45
- package/es/anchor/src/AnchorAdapter.js +12 -12
- package/es/anchor/src/styles/index.cssr.js +41 -41
- package/es/avatar/src/Avatar.d.ts +5 -3
- package/es/avatar/src/Avatar.js +7 -5
- package/es/avatar/src/styles/index.cssr.js +3 -5
- package/es/button/src/Button.d.ts +60 -60
- package/es/button/src/Button.js +107 -106
- package/es/button/src/styles/button.cssr.js +83 -80
- package/es/button/styles/dark.js +3 -3
- package/es/button/styles/light.d.ts +3 -3
- package/es/button/styles/light.js +1 -1
- package/es/calendar/src/Calendar.d.ts +37 -30
- package/es/calendar/styles/light.d.ts +3 -3
- package/es/cascader/src/Cascader.d.ts +135 -0
- package/es/cascader/src/Cascader.js +2 -4
- package/es/cascader/src/CascaderMenu.d.ts +345 -0
- package/es/cascader/src/CascaderMenu.js +6 -5
- package/es/cascader/src/CascaderOption.d.ts +18 -0
- package/es/cascader/src/CascaderSelectMenu.d.ts +18 -0
- package/es/cascader/src/CascaderSubmenu.d.ts +18 -0
- package/es/cascader/styles/dark.js +3 -1
- package/es/cascader/styles/light.d.ts +13 -0
- package/es/cascader/styles/light.js +3 -1
- package/es/color-picker/src/ColorInputUnit.d.ts +3 -3
- package/es/color-picker/src/ColorPicker.d.ts +27 -27
- package/es/color-picker/styles/light.d.ts +3 -3
- package/es/config-provider/src/ConfigProvider.d.ts +21 -0
- package/es/data-table/src/DataTable.d.ts +30 -30
- package/es/data-table/src/DataTable.js +7 -14
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +3 -3
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +3 -3
- package/es/data-table/src/MainTable.js +2 -3
- package/es/data-table/src/TableParts/Body.d.ts +18 -7
- package/es/data-table/src/TableParts/Body.js +80 -28
- package/es/data-table/src/TableParts/Cell.d.ts +6 -6
- package/es/data-table/src/TableParts/Header.d.ts +3 -3
- package/es/data-table/src/TableParts/Header.js +1 -1
- package/es/data-table/src/interface.d.ts +4 -1
- package/es/data-table/src/styles/index.cssr.js +9 -12
- package/es/data-table/src/use-check.js +6 -2
- package/es/data-table/src/use-scroll.d.ts +2 -0
- package/es/data-table/src/use-scroll.js +34 -4
- package/es/data-table/src/use-table-data.js +4 -1
- package/es/data-table/styles/_common.js +1 -1
- package/es/data-table/styles/light.d.ts +3 -3
- package/es/date-picker/src/DatePicker.d.ts +94 -69
- package/es/date-picker/src/DatePicker.js +47 -20
- package/es/date-picker/src/config.d.ts +1 -9
- package/es/date-picker/src/config.js +0 -8
- package/es/date-picker/src/interface.d.ts +2 -1
- package/es/date-picker/src/panel/date.d.ts +23 -10
- package/es/date-picker/src/panel/date.js +2 -2
- package/es/date-picker/src/panel/daterange.d.ts +21 -9
- package/es/date-picker/src/panel/daterange.js +2 -2
- package/es/date-picker/src/panel/datetime.d.ts +23 -16
- package/es/date-picker/src/panel/datetime.js +2 -2
- package/es/date-picker/src/panel/datetimerange.d.ts +21 -9
- package/es/date-picker/src/panel/datetimerange.js +2 -2
- package/es/date-picker/src/panel/month.d.ts +27 -20
- package/es/date-picker/src/panel/month.js +23 -12
- package/es/date-picker/src/panel/use-calendar.d.ts +25 -43
- package/es/date-picker/src/panel/use-calendar.js +35 -18
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +21 -40
- package/es/date-picker/src/panel/use-dual-calendar.js +23 -8
- package/es/date-picker/src/panel/use-panel-common.d.ts +21 -36
- package/es/date-picker/src/panel/use-panel-common.js +2 -2
- package/es/date-picker/src/utils.d.ts +19 -3
- package/es/date-picker/src/utils.js +40 -5
- package/es/date-picker/styles/_common.d.ts +2 -0
- package/es/date-picker/styles/_common.js +3 -1
- package/es/date-picker/styles/light.d.ts +10 -6
- package/es/dialog/src/Dialog.d.ts +21 -21
- package/es/dialog/src/styles/index.cssr.js +1 -0
- package/es/dialog/styles/light.d.ts +3 -3
- package/es/dynamic-input/src/DynamicInput.d.ts +30 -30
- package/es/dynamic-input/src/InputPreset.d.ts +3 -3
- package/es/dynamic-input/src/PairPreset.d.ts +3 -3
- package/es/dynamic-input/styles/light.d.ts +3 -3
- package/es/dynamic-tags/src/DynamicTags.d.ts +30 -30
- package/es/dynamic-tags/styles/light.d.ts +3 -3
- package/es/element/index.d.ts +1 -0
- package/es/element/index.js +1 -0
- package/es/form/src/interface.d.ts +5 -4
- package/es/image/src/Image.d.ts +25 -16
- package/es/image/src/Image.js +35 -11
- package/es/image/src/ImageGroup.js +2 -2
- package/es/image/src/styles/index.cssr.js +4 -3
- package/es/input/src/Input.js +2 -0
- package/es/input/src/styles/input.cssr.js +2 -1
- package/es/input-number/src/InputNumber.d.ts +30 -30
- package/es/input-number/src/InputNumber.js +10 -5
- package/es/input-number/src/utils.d.ts +1 -0
- package/es/input-number/src/utils.js +4 -0
- package/es/input-number/styles/light.d.ts +3 -3
- package/es/locales/common/deDE.js +8 -0
- package/es/locales/common/enUS.d.ts +7 -0
- package/es/locales/common/enUS.js +8 -1
- package/es/locales/common/frFR.d.ts +3 -0
- package/es/locales/common/frFR.js +101 -0
- package/es/locales/common/idID.d.ts +2 -93
- package/es/locales/common/idID.js +8 -0
- package/es/locales/common/jaJP.js +8 -0
- package/es/locales/common/nbNO.js +8 -0
- package/es/locales/common/ruRU.js +8 -0
- package/es/locales/common/ukUA.js +8 -0
- package/es/locales/common/zhCN.js +7 -0
- package/es/locales/common/zhTW.d.ts +3 -0
- package/es/locales/common/zhTW.js +100 -0
- package/es/locales/date/frFR.d.ts +3 -0
- package/es/locales/date/frFR.js +6 -0
- package/es/locales/date/idID.d.ts +1 -6
- package/es/locales/date/zhTW.d.ts +3 -0
- package/es/locales/date/zhTW.js +6 -0
- package/es/locales/index.d.ts +4 -0
- package/es/locales/index.js +4 -0
- package/es/modal/src/BodyWrapper.d.ts +6 -6
- package/es/modal/src/Modal.d.ts +36 -36
- package/es/modal/styles/light.d.ts +3 -3
- package/es/page-header/src/PageHeader.js +3 -3
- package/es/page-header/src/styles/index.cssr.js +2 -4
- package/es/popconfirm/src/Popconfirm.d.ts +30 -30
- package/es/popconfirm/styles/light.d.ts +3 -3
- package/es/popover/src/Popover.js +4 -1
- package/es/popover/src/PopoverBody.js +3 -3
- package/es/popselect/src/Popselect.d.ts +2 -11
- package/es/popselect/src/Popselect.js +2 -2
- package/es/popselect/src/PopselectPanel.d.ts +3 -11
- package/es/popselect/src/PopselectPanel.js +17 -11
- package/es/radio/src/Radio.js +3 -3
- package/es/radio/src/RadioButton.js +4 -5
- package/es/radio/src/styles/radio-group.cssr.js +8 -4
- package/es/radio/src/styles/radio.cssr.js +8 -4
- package/es/radio/src/use-radio.d.ts +0 -3
- package/es/radio/src/use-radio.js +1 -26
- package/es/switch/src/Switch.d.ts +16 -1
- package/es/switch/src/Switch.js +17 -4
- package/es/switch/src/styles/index.cssr.js +1 -1
- package/es/tabs/src/styles/index.cssr.js +1 -0
- package/es/tag/src/styles/index.cssr.js +1 -1
- package/es/theme-editor/src/ThemeEditor.js +9 -2
- package/es/time-picker/src/Panel.d.ts +3 -3
- package/es/time-picker/src/TimePicker.d.ts +30 -30
- package/es/time-picker/styles/light.d.ts +3 -3
- package/es/transfer/src/Transfer.d.ts +30 -30
- package/es/transfer/src/TransferFilter.d.ts +3 -3
- package/es/transfer/src/TransferList.d.ts +3 -3
- package/es/transfer/src/TransferListItem.d.ts +3 -3
- package/es/transfer/styles/light.d.ts +3 -3
- package/es/tree/src/Tree.d.ts +8 -4
- package/es/tree/src/Tree.js +32 -6
- package/es/tree-select/src/TreeSelect.d.ts +38 -1
- package/es/tree-select/src/TreeSelect.js +25 -10
- package/es/tree-select/src/styles/index.cssr.js +11 -2
- package/es/tree-select/styles/light.d.ts +6 -0
- package/es/tree-select/styles/light.js +5 -2
- package/es/upload/src/Upload.d.ts +41 -30
- package/es/upload/src/Upload.js +33 -23
- package/es/upload/src/UploadFile.d.ts +4 -4
- package/es/upload/src/UploadFileList.js +4 -2
- package/es/upload/src/UploadProgress.d.ts +3 -3
- package/es/upload/src/interface.d.ts +1 -0
- package/es/upload/src/styles/index.cssr.js +2 -3
- package/es/upload/styles/light.d.ts +3 -3
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/close/src/styles/index.cssr.js +6 -5
- package/lib/_internal/scrollbar/src/ScrollBar.d.ts +15 -0
- package/lib/_internal/scrollbar/src/ScrollBar.js +13 -7
- package/lib/_internal/selection/src/Selection.js +11 -9
- package/lib/_internal/selection/src/styles/index.cssr.js +6 -2
- package/lib/alert/src/Alert.d.ts +20 -20
- package/lib/alert/src/Alert.js +22 -22
- package/lib/alert/src/styles/index.cssr.js +45 -45
- package/lib/anchor/src/AnchorAdapter.js +12 -12
- package/lib/anchor/src/styles/index.cssr.js +41 -41
- package/lib/avatar/src/Avatar.d.ts +5 -3
- package/lib/avatar/src/Avatar.js +7 -5
- package/lib/avatar/src/styles/index.cssr.js +3 -5
- package/lib/button/src/Button.d.ts +60 -60
- package/lib/button/src/Button.js +107 -106
- package/lib/button/src/styles/button.cssr.js +83 -80
- package/lib/button/styles/dark.js +3 -3
- package/lib/button/styles/light.d.ts +3 -3
- package/lib/button/styles/light.js +1 -1
- package/lib/calendar/src/Calendar.d.ts +37 -30
- package/lib/calendar/styles/light.d.ts +3 -3
- package/lib/cascader/src/Cascader.d.ts +135 -0
- package/lib/cascader/src/Cascader.js +2 -4
- package/lib/cascader/src/CascaderMenu.d.ts +345 -0
- package/lib/cascader/src/CascaderMenu.js +6 -5
- package/lib/cascader/src/CascaderOption.d.ts +18 -0
- package/lib/cascader/src/CascaderSelectMenu.d.ts +18 -0
- package/lib/cascader/src/CascaderSubmenu.d.ts +18 -0
- package/lib/cascader/styles/dark.js +3 -1
- package/lib/cascader/styles/light.d.ts +13 -0
- package/lib/cascader/styles/light.js +3 -1
- package/lib/color-picker/src/ColorInputUnit.d.ts +3 -3
- package/lib/color-picker/src/ColorPicker.d.ts +27 -27
- package/lib/color-picker/styles/light.d.ts +3 -3
- package/lib/config-provider/src/ConfigProvider.d.ts +21 -0
- package/lib/data-table/src/DataTable.d.ts +30 -30
- package/lib/data-table/src/DataTable.js +6 -13
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +3 -3
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +3 -3
- package/lib/data-table/src/MainTable.js +1 -2
- package/lib/data-table/src/TableParts/Body.d.ts +18 -7
- package/lib/data-table/src/TableParts/Body.js +78 -26
- package/lib/data-table/src/TableParts/Cell.d.ts +6 -6
- package/lib/data-table/src/TableParts/Header.d.ts +3 -3
- package/lib/data-table/src/TableParts/Header.js +1 -1
- package/lib/data-table/src/interface.d.ts +4 -1
- package/lib/data-table/src/styles/index.cssr.js +9 -12
- package/lib/data-table/src/use-check.js +6 -2
- package/lib/data-table/src/use-scroll.d.ts +2 -0
- package/lib/data-table/src/use-scroll.js +34 -4
- package/lib/data-table/src/use-table-data.js +4 -1
- package/lib/data-table/styles/_common.js +1 -1
- package/lib/data-table/styles/light.d.ts +3 -3
- package/lib/date-picker/src/DatePicker.d.ts +94 -69
- package/lib/date-picker/src/DatePicker.js +46 -19
- package/lib/date-picker/src/config.d.ts +1 -9
- package/lib/date-picker/src/config.js +1 -9
- package/lib/date-picker/src/interface.d.ts +2 -1
- package/lib/date-picker/src/panel/date.d.ts +23 -10
- package/lib/date-picker/src/panel/date.js +1 -1
- package/lib/date-picker/src/panel/daterange.d.ts +21 -9
- package/lib/date-picker/src/panel/daterange.js +1 -1
- package/lib/date-picker/src/panel/datetime.d.ts +23 -16
- package/lib/date-picker/src/panel/datetime.js +1 -1
- package/lib/date-picker/src/panel/datetimerange.d.ts +21 -9
- package/lib/date-picker/src/panel/datetimerange.js +2 -2
- package/lib/date-picker/src/panel/month.d.ts +27 -20
- package/lib/date-picker/src/panel/month.js +23 -12
- package/lib/date-picker/src/panel/use-calendar.d.ts +25 -43
- package/lib/date-picker/src/panel/use-calendar.js +34 -16
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +21 -40
- package/lib/date-picker/src/panel/use-dual-calendar.js +22 -6
- package/lib/date-picker/src/panel/use-panel-common.d.ts +21 -36
- package/lib/date-picker/src/panel/use-panel-common.js +3 -2
- package/lib/date-picker/src/utils.d.ts +19 -3
- package/lib/date-picker/src/utils.js +41 -4
- package/lib/date-picker/styles/_common.d.ts +2 -0
- package/lib/date-picker/styles/_common.js +3 -1
- package/lib/date-picker/styles/light.d.ts +10 -6
- package/lib/dialog/src/Dialog.d.ts +21 -21
- package/lib/dialog/src/styles/index.cssr.js +1 -0
- package/lib/dialog/styles/light.d.ts +3 -3
- package/lib/dynamic-input/src/DynamicInput.d.ts +30 -30
- package/lib/dynamic-input/src/InputPreset.d.ts +3 -3
- package/lib/dynamic-input/src/PairPreset.d.ts +3 -3
- package/lib/dynamic-input/styles/light.d.ts +3 -3
- package/lib/dynamic-tags/src/DynamicTags.d.ts +30 -30
- package/lib/dynamic-tags/styles/light.d.ts +3 -3
- package/lib/element/index.d.ts +1 -0
- package/lib/element/index.js +3 -1
- package/lib/form/src/interface.d.ts +5 -4
- package/lib/image/src/Image.d.ts +25 -16
- package/lib/image/src/Image.js +34 -10
- package/lib/image/src/ImageGroup.js +2 -2
- package/lib/image/src/styles/index.cssr.js +3 -2
- package/lib/input/src/Input.js +2 -0
- package/lib/input/src/styles/input.cssr.js +2 -1
- package/lib/input-number/src/InputNumber.d.ts +30 -30
- package/lib/input-number/src/InputNumber.js +9 -4
- package/lib/input-number/src/utils.d.ts +1 -0
- package/lib/input-number/src/utils.js +6 -1
- package/lib/input-number/styles/light.d.ts +3 -3
- package/lib/locales/common/deDE.js +8 -0
- package/lib/locales/common/enUS.d.ts +7 -0
- package/lib/locales/common/enUS.js +8 -1
- package/lib/locales/common/frFR.d.ts +3 -0
- package/lib/locales/common/frFR.js +103 -0
- package/lib/locales/common/idID.d.ts +2 -93
- package/lib/locales/common/idID.js +8 -0
- package/lib/locales/common/jaJP.js +8 -0
- package/lib/locales/common/nbNO.js +8 -0
- package/lib/locales/common/ruRU.js +8 -0
- package/lib/locales/common/ukUA.js +8 -0
- package/lib/locales/common/zhCN.js +7 -0
- package/lib/locales/common/zhTW.d.ts +3 -0
- package/lib/locales/common/zhTW.js +102 -0
- package/lib/locales/date/frFR.d.ts +3 -0
- package/lib/locales/date/frFR.js +11 -0
- package/lib/locales/date/idID.d.ts +1 -6
- package/lib/locales/date/zhTW.d.ts +3 -0
- package/lib/locales/date/zhTW.js +11 -0
- package/lib/locales/index.d.ts +4 -0
- package/lib/locales/index.js +9 -1
- package/lib/modal/src/BodyWrapper.d.ts +6 -6
- package/lib/modal/src/Modal.d.ts +36 -36
- package/lib/modal/styles/light.d.ts +3 -3
- package/lib/page-header/src/PageHeader.js +3 -3
- package/lib/page-header/src/styles/index.cssr.js +2 -4
- package/lib/popconfirm/src/Popconfirm.d.ts +30 -30
- package/lib/popconfirm/styles/light.d.ts +3 -3
- package/lib/popover/src/Popover.js +4 -1
- package/lib/popover/src/PopoverBody.js +3 -3
- package/lib/popselect/src/Popselect.d.ts +2 -11
- package/lib/popselect/src/Popselect.js +2 -2
- package/lib/popselect/src/PopselectPanel.d.ts +3 -11
- package/lib/popselect/src/PopselectPanel.js +16 -10
- package/lib/radio/src/Radio.js +3 -3
- package/lib/radio/src/RadioButton.js +4 -5
- package/lib/radio/src/styles/radio-group.cssr.js +8 -4
- package/lib/radio/src/styles/radio.cssr.js +8 -4
- package/lib/radio/src/use-radio.d.ts +0 -3
- package/lib/radio/src/use-radio.js +1 -26
- package/lib/switch/src/Switch.d.ts +16 -1
- package/lib/switch/src/Switch.js +17 -4
- package/lib/switch/src/styles/index.cssr.js +1 -1
- package/lib/tabs/src/styles/index.cssr.js +1 -0
- package/lib/tag/src/styles/index.cssr.js +1 -1
- package/lib/theme-editor/src/ThemeEditor.js +9 -2
- package/lib/time-picker/src/Panel.d.ts +3 -3
- package/lib/time-picker/src/TimePicker.d.ts +30 -30
- package/lib/time-picker/styles/light.d.ts +3 -3
- package/lib/transfer/src/Transfer.d.ts +30 -30
- package/lib/transfer/src/TransferFilter.d.ts +3 -3
- package/lib/transfer/src/TransferList.d.ts +3 -3
- package/lib/transfer/src/TransferListItem.d.ts +3 -3
- package/lib/transfer/styles/light.d.ts +3 -3
- package/lib/tree/src/Tree.d.ts +8 -4
- package/lib/tree/src/Tree.js +32 -6
- package/lib/tree-select/src/TreeSelect.d.ts +38 -1
- package/lib/tree-select/src/TreeSelect.js +24 -9
- package/lib/tree-select/src/styles/index.cssr.js +11 -2
- package/lib/tree-select/styles/light.d.ts +6 -0
- package/lib/tree-select/styles/light.js +5 -2
- package/lib/upload/src/Upload.d.ts +41 -30
- package/lib/upload/src/Upload.js +33 -23
- package/lib/upload/src/UploadFile.d.ts +4 -4
- package/lib/upload/src/UploadFileList.js +4 -2
- package/lib/upload/src/UploadProgress.d.ts +3 -3
- package/lib/upload/src/interface.d.ts +1 -0
- package/lib/upload/src/styles/index.cssr.js +2 -3
- package/lib/upload/styles/light.d.ts +3 -3
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +5 -4
- package/web-types.json +99 -7
|
@@ -8,6 +8,7 @@ export declare type FormItemRuleValidatorParams = Parameters<NonNullable<RuleIte
|
|
|
8
8
|
export declare type FormItemRuleValidator = (...args: FormItemRuleValidatorParams) => boolean | Error | Error[] | Promise<void> | undefined;
|
|
9
9
|
export declare type FormItemRuleAsyncValidator = (...args: FormItemRuleValidatorParams) => Promise<void> | undefined;
|
|
10
10
|
export declare type FormItemRule = Omit<RuleItem, 'validator' | 'asyncValidator'> & {
|
|
11
|
+
key?: string;
|
|
11
12
|
trigger?: ValidationTrigger | string | Array<ValidationTrigger | string>;
|
|
12
13
|
validator?: FormItemRuleValidator;
|
|
13
14
|
asyncValidator?: FormItemRuleAsyncValidator;
|
|
@@ -15,10 +16,10 @@ export declare type FormItemRule = Omit<RuleItem, 'validator' | 'asyncValidator'
|
|
|
15
16
|
export interface FormItemValidateOptions {
|
|
16
17
|
trigger?: ValidationTrigger | string;
|
|
17
18
|
callback?: ValidateCallback;
|
|
18
|
-
shouldRuleBeApplied?:
|
|
19
|
+
shouldRuleBeApplied?: ShouldRuleBeApplied;
|
|
19
20
|
options?: ValidateOption;
|
|
20
21
|
}
|
|
21
|
-
export declare type FormItemInternalValidate = (trigger: ValidationTrigger | string | null | undefined, shouldRuleBeApplied?:
|
|
22
|
+
export declare type FormItemInternalValidate = (trigger: ValidationTrigger | string | null | undefined, shouldRuleBeApplied?: ShouldRuleBeApplied, options?: ValidateOption) => Promise<{
|
|
22
23
|
valid: boolean;
|
|
23
24
|
errors?: ValidateError[];
|
|
24
25
|
}>;
|
|
@@ -38,10 +39,10 @@ export declare type LabelAlign = 'left' | 'center' | 'right';
|
|
|
38
39
|
export declare type LabelPlacement = 'left' | 'top';
|
|
39
40
|
export declare type Size = 'small' | 'medium' | 'large';
|
|
40
41
|
export declare type ValidationTrigger = 'input' | 'change' | 'blur' | 'focus';
|
|
41
|
-
export declare type
|
|
42
|
+
export declare type ShouldRuleBeApplied = (rule: FormItemRule) => boolean;
|
|
42
43
|
export declare type ValidateCallback = (errors?: ValidateError[]) => void;
|
|
43
44
|
export declare type FormValidateCallback = (errors?: ValidateError[][]) => void;
|
|
44
|
-
export declare type FormValidate = (
|
|
45
|
+
export declare type FormValidate = (callback?: FormValidateCallback, shouldRuleBeApplied?: ShouldRuleBeApplied) => Promise<void>;
|
|
45
46
|
export declare type FormValidationError = ValidateError[];
|
|
46
47
|
export interface FormInst {
|
|
47
48
|
validate: FormValidate;
|
package/lib/image/src/Image.d.ts
CHANGED
|
@@ -1,53 +1,50 @@
|
|
|
1
|
-
import { PropType } from 'vue';
|
|
1
|
+
import { PropType, ImgHTMLAttributes } from 'vue';
|
|
2
2
|
import { ExtractPublicPropTypes } from '../../_utils';
|
|
3
|
-
interface imgProps {
|
|
4
|
-
alt?: string;
|
|
5
|
-
crossorigin?: 'anonymous' | 'use-credentials' | '';
|
|
6
|
-
decoding?: 'async' | 'auto' | 'sync';
|
|
7
|
-
height?: number;
|
|
8
|
-
sizes?: string;
|
|
9
|
-
src?: string;
|
|
10
|
-
srcset?: string;
|
|
11
|
-
usemap?: string;
|
|
12
|
-
width?: number;
|
|
13
|
-
}
|
|
14
3
|
export interface ImageInst {
|
|
15
4
|
click: () => void;
|
|
16
5
|
}
|
|
17
6
|
declare const imageProps: {
|
|
18
7
|
alt: StringConstructor;
|
|
19
8
|
height: PropType<string | number>;
|
|
20
|
-
imgProps: PropType<
|
|
9
|
+
imgProps: PropType<ImgHTMLAttributes>;
|
|
21
10
|
objectFit: {
|
|
22
11
|
type: PropType<"fill" | "none" | "contain" | "cover" | "scale-down">;
|
|
23
12
|
default: string;
|
|
24
13
|
};
|
|
25
14
|
previewSrc: StringConstructor;
|
|
15
|
+
fallbackSrc: StringConstructor;
|
|
26
16
|
width: PropType<string | number>;
|
|
27
17
|
src: StringConstructor;
|
|
28
18
|
showToolbar: {
|
|
29
19
|
type: BooleanConstructor;
|
|
30
20
|
default: boolean;
|
|
31
21
|
};
|
|
22
|
+
previewDisabled: BooleanConstructor;
|
|
23
|
+
loadDescription: StringConstructor;
|
|
32
24
|
onError: PropType<(e: Event) => void>;
|
|
25
|
+
onLoad: PropType<(e: Event) => void>;
|
|
33
26
|
};
|
|
34
27
|
export declare type ImageProps = ExtractPublicPropTypes<typeof imageProps>;
|
|
35
28
|
declare const _default: import("vue").DefineComponent<{
|
|
36
29
|
alt: StringConstructor;
|
|
37
30
|
height: PropType<string | number>;
|
|
38
|
-
imgProps: PropType<
|
|
31
|
+
imgProps: PropType<ImgHTMLAttributes>;
|
|
39
32
|
objectFit: {
|
|
40
33
|
type: PropType<"fill" | "none" | "contain" | "cover" | "scale-down">;
|
|
41
34
|
default: string;
|
|
42
35
|
};
|
|
43
36
|
previewSrc: StringConstructor;
|
|
37
|
+
fallbackSrc: StringConstructor;
|
|
44
38
|
width: PropType<string | number>;
|
|
45
39
|
src: StringConstructor;
|
|
46
40
|
showToolbar: {
|
|
47
41
|
type: BooleanConstructor;
|
|
48
42
|
default: boolean;
|
|
49
43
|
};
|
|
44
|
+
previewDisabled: BooleanConstructor;
|
|
45
|
+
loadDescription: StringConstructor;
|
|
50
46
|
onError: PropType<(e: Event) => void>;
|
|
47
|
+
onLoad: PropType<(e: Event) => void>;
|
|
51
48
|
}, {
|
|
52
49
|
click: () => void;
|
|
53
50
|
mergedClsPrefix: import("vue").Ref<string> | import("vue").ComputedRef<string>;
|
|
@@ -58,30 +55,42 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
58
55
|
toggleShow: () => void;
|
|
59
56
|
} | null>;
|
|
60
57
|
imageRef: import("vue").Ref<HTMLImageElement | null>;
|
|
61
|
-
imgProps: import("vue").Ref<
|
|
58
|
+
imgProps: import("vue").Ref<ImgHTMLAttributes | undefined>;
|
|
59
|
+
showError: import("vue").Ref<boolean>;
|
|
60
|
+
mergedOnError: (e: Event) => void;
|
|
61
|
+
mergedOnLoad: (e: Event) => void;
|
|
62
62
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
63
63
|
alt?: unknown;
|
|
64
64
|
height?: unknown;
|
|
65
65
|
imgProps?: unknown;
|
|
66
66
|
objectFit?: unknown;
|
|
67
67
|
previewSrc?: unknown;
|
|
68
|
+
fallbackSrc?: unknown;
|
|
68
69
|
width?: unknown;
|
|
69
70
|
src?: unknown;
|
|
70
71
|
showToolbar?: unknown;
|
|
72
|
+
previewDisabled?: unknown;
|
|
73
|
+
loadDescription?: unknown;
|
|
71
74
|
onError?: unknown;
|
|
75
|
+
onLoad?: unknown;
|
|
72
76
|
} & {
|
|
73
77
|
objectFit: "fill" | "none" | "contain" | "cover" | "scale-down";
|
|
74
78
|
showToolbar: boolean;
|
|
79
|
+
previewDisabled: boolean;
|
|
75
80
|
} & {
|
|
76
81
|
onError?: ((e: Event) => void) | undefined;
|
|
77
82
|
height?: string | number | undefined;
|
|
78
83
|
width?: string | number | undefined;
|
|
84
|
+
onLoad?: ((e: Event) => void) | undefined;
|
|
79
85
|
alt?: string | undefined;
|
|
80
86
|
src?: string | undefined;
|
|
87
|
+
fallbackSrc?: string | undefined;
|
|
81
88
|
previewSrc?: string | undefined;
|
|
82
|
-
imgProps?:
|
|
89
|
+
imgProps?: ImgHTMLAttributes | undefined;
|
|
90
|
+
loadDescription?: string | undefined;
|
|
83
91
|
}>, {
|
|
84
92
|
objectFit: "fill" | "none" | "contain" | "cover" | "scale-down";
|
|
85
93
|
showToolbar: boolean;
|
|
94
|
+
previewDisabled: boolean;
|
|
86
95
|
}>;
|
|
87
96
|
export default _default;
|
package/lib/image/src/Image.js
CHANGED
|
@@ -16,10 +16,14 @@ const imageProps = {
|
|
|
16
16
|
default: 'fill'
|
|
17
17
|
},
|
|
18
18
|
previewSrc: String,
|
|
19
|
+
fallbackSrc: String,
|
|
19
20
|
width: [String, Number],
|
|
20
21
|
src: String,
|
|
21
22
|
showToolbar: { type: Boolean, default: true },
|
|
22
|
-
|
|
23
|
+
previewDisabled: Boolean,
|
|
24
|
+
loadDescription: String,
|
|
25
|
+
onError: Function,
|
|
26
|
+
onLoad: Function
|
|
23
27
|
};
|
|
24
28
|
exports.default = (0, vue_1.defineComponent)({
|
|
25
29
|
name: 'Image',
|
|
@@ -27,12 +31,15 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
27
31
|
inheritAttrs: false,
|
|
28
32
|
setup(props) {
|
|
29
33
|
const imageRef = (0, vue_1.ref)(null);
|
|
34
|
+
const showErrorRef = (0, vue_1.ref)(false);
|
|
30
35
|
const imgPropsRef = (0, vue_1.toRef)(props, 'imgProps');
|
|
31
36
|
const previewInstRef = (0, vue_1.ref)(null);
|
|
32
37
|
const imageGroupHandle = (0, vue_1.inject)(ImageGroup_1.imageGroupInjectionKey, null);
|
|
33
38
|
const { mergedClsPrefixRef } = imageGroupHandle || (0, _mixins_1.useConfig)(props);
|
|
34
39
|
const exposedMethods = {
|
|
35
40
|
click: () => {
|
|
41
|
+
if (props.previewDisabled || showErrorRef.value)
|
|
42
|
+
return;
|
|
36
43
|
const mergedPreviewSrc = props.previewSrc || props.src;
|
|
37
44
|
if (imageGroupHandle) {
|
|
38
45
|
imageGroupHandle.setPreviewSrc(mergedPreviewSrc);
|
|
@@ -48,17 +55,34 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
48
55
|
previewInst.toggleShow();
|
|
49
56
|
}
|
|
50
57
|
};
|
|
58
|
+
(0, vue_1.watchEffect)(() => {
|
|
59
|
+
var _a;
|
|
60
|
+
void props.src;
|
|
61
|
+
void ((_a = props.imgProps) === null || _a === void 0 ? void 0 : _a.src);
|
|
62
|
+
showErrorRef.value = false;
|
|
63
|
+
});
|
|
51
64
|
return Object.assign({ mergedClsPrefix: mergedClsPrefixRef, groupId: imageGroupHandle === null || imageGroupHandle === void 0 ? void 0 : imageGroupHandle.groupId, previewInstRef,
|
|
52
|
-
imageRef, imgProps: imgPropsRef
|
|
65
|
+
imageRef, imgProps: imgPropsRef, showError: showErrorRef, mergedOnError: (e) => {
|
|
66
|
+
showErrorRef.value = true;
|
|
67
|
+
const { onError, imgProps: { onError: imgPropsOnError } = {} } = props;
|
|
68
|
+
onError === null || onError === void 0 ? void 0 : onError(e);
|
|
69
|
+
imgPropsOnError === null || imgPropsOnError === void 0 ? void 0 : imgPropsOnError(e);
|
|
70
|
+
}, mergedOnLoad: (e) => {
|
|
71
|
+
const { onLoad, imgProps: { onLoad: imgPropsOnLoad } = {} } = props;
|
|
72
|
+
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e);
|
|
73
|
+
imgPropsOnLoad === null || imgPropsOnLoad === void 0 ? void 0 : imgPropsOnLoad(e);
|
|
74
|
+
} }, exposedMethods);
|
|
53
75
|
},
|
|
54
76
|
render() {
|
|
55
|
-
const { mergedClsPrefix, imgProps = {} } = this;
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
77
|
+
const { mergedClsPrefix, imgProps = {}, $attrs } = this;
|
|
78
|
+
const imgNode = ((0, vue_1.h)("img", Object.assign({}, imgProps, { class: [this.groupId, imgProps.class], ref: "imageRef", width: this.width || imgProps.width, height: this.height || imgProps.height, src: this.showError ? this.fallbackSrc : this.src || imgProps.src, alt: this.alt || imgProps.alt, "aria-label": this.alt || imgProps.alt, onClick: this.click, onError: this.mergedOnError, onLoad: this.mergedOnLoad, style: [imgProps.style || '', { objectFit: this.objectFit }], "data-error": this.showError, "data-preview-src": this.previewSrc || this.src })));
|
|
79
|
+
return ((0, vue_1.h)("div", Object.assign({}, $attrs, { role: "none", class: [
|
|
80
|
+
$attrs.class,
|
|
81
|
+
`${mergedClsPrefix}-image`,
|
|
82
|
+
(this.previewDisabled || this.showError) &&
|
|
83
|
+
`${mergedClsPrefix}-image--preview-disabled`
|
|
84
|
+
] }), this.groupId ? (imgNode) : ((0, vue_1.h)(ImagePreview_1.default, { clsPrefix: mergedClsPrefix, ref: "previewInstRef", showToolbar: this.showToolbar }, {
|
|
85
|
+
default: () => imgNode
|
|
86
|
+
}))));
|
|
63
87
|
}
|
|
64
88
|
});
|
|
@@ -18,7 +18,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
18
18
|
setup(props) {
|
|
19
19
|
let currentSrc;
|
|
20
20
|
const { mergedClsPrefixRef } = (0, _mixins_1.useConfig)(props);
|
|
21
|
-
const groupId = (0, seemly_1.createId)()
|
|
21
|
+
const groupId = `c${(0, seemly_1.createId)()}`;
|
|
22
22
|
const vm = (0, vue_1.getCurrentInstance)();
|
|
23
23
|
const setPreviewSrc = (src) => {
|
|
24
24
|
var _a;
|
|
@@ -30,7 +30,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
30
30
|
return;
|
|
31
31
|
const container = vm.proxy.$el.parentElement;
|
|
32
32
|
// use dom api since we can't get the correct order before all children are rendered
|
|
33
|
-
const imgs = container.
|
|
33
|
+
const imgs = container.querySelectorAll(`.${groupId}:not([data-error=true])`);
|
|
34
34
|
if (!imgs.length)
|
|
35
35
|
return;
|
|
36
36
|
const index = Array.from(imgs).findIndex((img) => img.dataset.previewSrc === currentSrc);
|
|
@@ -69,9 +69,10 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.c)('body >', [(0, cssr_1.cB)('image-
|
|
|
69
69
|
transition: transform .3s var(--bezier);
|
|
70
70
|
`), (0, cssr_1.cB)('image', `
|
|
71
71
|
display: inline-flex;
|
|
72
|
-
cursor: pointer;
|
|
73
72
|
max-height: 100%;
|
|
74
73
|
max-width: 100%;
|
|
75
|
-
`, [(0, cssr_1.
|
|
74
|
+
`, [(0, cssr_1.cNotM)('preview-disabled', `
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
`), (0, cssr_1.c)('img', `
|
|
76
77
|
border-radius: inherit;
|
|
77
78
|
`)])]);
|
package/lib/input/src/Input.js
CHANGED
|
@@ -395,9 +395,11 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
395
395
|
doClear(e);
|
|
396
396
|
if (props.pair) {
|
|
397
397
|
doUpdateValue(['', '']);
|
|
398
|
+
doChange(['', '']);
|
|
398
399
|
}
|
|
399
400
|
else {
|
|
400
401
|
doUpdateValue('');
|
|
402
|
+
doChange('');
|
|
401
403
|
}
|
|
402
404
|
}
|
|
403
405
|
function handleMouseDown(e) {
|
|
@@ -79,6 +79,7 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('input', `
|
|
|
79
79
|
text-decoration-color: var(--text-decoration-color);
|
|
80
80
|
color: var(--text-color);
|
|
81
81
|
caret-color: var(--caret-color);
|
|
82
|
+
background-color: transparent;
|
|
82
83
|
`, [(0, cssr_1.c)('&::placeholder', {
|
|
83
84
|
color: '#0000'
|
|
84
85
|
})]), (0, cssr_1.cM)('round', [(0, cssr_1.cNotM)('textarea', {
|
|
@@ -208,7 +209,7 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('input', `
|
|
|
208
209
|
border: 'var(--border-focus)',
|
|
209
210
|
boxShadow: 'var(--box-shadow-focus)'
|
|
210
211
|
})]), (0, cssr_1.c)('&:hover', [(0, cssr_1.cE)('state-border', {
|
|
211
|
-
border: 'var(--border-
|
|
212
|
+
border: 'var(--border-hover)'
|
|
212
213
|
})])]), (0, cssr_1.cE)('border, state-border', `
|
|
213
214
|
box-sizing: border-box;
|
|
214
215
|
position: absolute;
|
|
@@ -68,9 +68,9 @@ declare const inputNumberProps: {
|
|
|
68
68
|
fontSizeMedium: string;
|
|
69
69
|
fontSizeLarge: string;
|
|
70
70
|
opacityDisabled: string;
|
|
71
|
-
colorOpacitySecondary:
|
|
72
|
-
colorOpacitySecondaryHover:
|
|
73
|
-
colorOpacitySecondaryPressed:
|
|
71
|
+
colorOpacitySecondary: string;
|
|
72
|
+
colorOpacitySecondaryHover: string;
|
|
73
|
+
colorOpacitySecondaryPressed: string;
|
|
74
74
|
colorSecondary: string;
|
|
75
75
|
colorSecondaryHover: string;
|
|
76
76
|
colorSecondaryPressed: string;
|
|
@@ -336,9 +336,9 @@ declare const inputNumberProps: {
|
|
|
336
336
|
fontSizeMedium: string;
|
|
337
337
|
fontSizeLarge: string;
|
|
338
338
|
opacityDisabled: string;
|
|
339
|
-
colorOpacitySecondary:
|
|
340
|
-
colorOpacitySecondaryHover:
|
|
341
|
-
colorOpacitySecondaryPressed:
|
|
339
|
+
colorOpacitySecondary: string;
|
|
340
|
+
colorOpacitySecondaryHover: string;
|
|
341
|
+
colorOpacitySecondaryPressed: string;
|
|
342
342
|
colorSecondary: string;
|
|
343
343
|
colorSecondaryHover: string;
|
|
344
344
|
colorSecondaryPressed: string;
|
|
@@ -604,9 +604,9 @@ declare const inputNumberProps: {
|
|
|
604
604
|
fontSizeMedium: string;
|
|
605
605
|
fontSizeLarge: string;
|
|
606
606
|
opacityDisabled: string;
|
|
607
|
-
colorOpacitySecondary:
|
|
608
|
-
colorOpacitySecondaryHover:
|
|
609
|
-
colorOpacitySecondaryPressed:
|
|
607
|
+
colorOpacitySecondary: string;
|
|
608
|
+
colorOpacitySecondaryHover: string;
|
|
609
|
+
colorOpacitySecondaryPressed: string;
|
|
610
610
|
colorSecondary: string;
|
|
611
611
|
colorSecondaryHover: string;
|
|
612
612
|
colorSecondaryPressed: string;
|
|
@@ -924,9 +924,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
924
924
|
fontSizeMedium: string;
|
|
925
925
|
fontSizeLarge: string;
|
|
926
926
|
opacityDisabled: string;
|
|
927
|
-
colorOpacitySecondary:
|
|
928
|
-
colorOpacitySecondaryHover:
|
|
929
|
-
colorOpacitySecondaryPressed:
|
|
927
|
+
colorOpacitySecondary: string;
|
|
928
|
+
colorOpacitySecondaryHover: string;
|
|
929
|
+
colorOpacitySecondaryPressed: string;
|
|
930
930
|
colorSecondary: string;
|
|
931
931
|
colorSecondaryHover: string;
|
|
932
932
|
colorSecondaryPressed: string;
|
|
@@ -1192,9 +1192,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1192
1192
|
fontSizeMedium: string;
|
|
1193
1193
|
fontSizeLarge: string;
|
|
1194
1194
|
opacityDisabled: string;
|
|
1195
|
-
colorOpacitySecondary:
|
|
1196
|
-
colorOpacitySecondaryHover:
|
|
1197
|
-
colorOpacitySecondaryPressed:
|
|
1195
|
+
colorOpacitySecondary: string;
|
|
1196
|
+
colorOpacitySecondaryHover: string;
|
|
1197
|
+
colorOpacitySecondaryPressed: string;
|
|
1198
1198
|
colorSecondary: string;
|
|
1199
1199
|
colorSecondaryHover: string;
|
|
1200
1200
|
colorSecondaryPressed: string;
|
|
@@ -1460,9 +1460,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1460
1460
|
fontSizeMedium: string;
|
|
1461
1461
|
fontSizeLarge: string;
|
|
1462
1462
|
opacityDisabled: string;
|
|
1463
|
-
colorOpacitySecondary:
|
|
1464
|
-
colorOpacitySecondaryHover:
|
|
1465
|
-
colorOpacitySecondaryPressed:
|
|
1463
|
+
colorOpacitySecondary: string;
|
|
1464
|
+
colorOpacitySecondaryHover: string;
|
|
1465
|
+
colorOpacitySecondaryPressed: string;
|
|
1466
1466
|
colorSecondary: string;
|
|
1467
1467
|
colorSecondaryHover: string;
|
|
1468
1468
|
colorSecondaryPressed: string;
|
|
@@ -1870,9 +1870,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1870
1870
|
fontSizeMedium: string;
|
|
1871
1871
|
fontSizeLarge: string;
|
|
1872
1872
|
opacityDisabled: string;
|
|
1873
|
-
colorOpacitySecondary:
|
|
1874
|
-
colorOpacitySecondaryHover:
|
|
1875
|
-
colorOpacitySecondaryPressed:
|
|
1873
|
+
colorOpacitySecondary: string;
|
|
1874
|
+
colorOpacitySecondaryHover: string;
|
|
1875
|
+
colorOpacitySecondaryPressed: string;
|
|
1876
1876
|
colorSecondary: string;
|
|
1877
1877
|
colorSecondaryHover: string;
|
|
1878
1878
|
colorSecondaryPressed: string;
|
|
@@ -2208,9 +2208,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2208
2208
|
fontSizeMedium: string;
|
|
2209
2209
|
fontSizeLarge: string;
|
|
2210
2210
|
opacityDisabled: string;
|
|
2211
|
-
colorOpacitySecondary:
|
|
2212
|
-
colorOpacitySecondaryHover:
|
|
2213
|
-
colorOpacitySecondaryPressed:
|
|
2211
|
+
colorOpacitySecondary: string;
|
|
2212
|
+
colorOpacitySecondaryHover: string;
|
|
2213
|
+
colorOpacitySecondaryPressed: string;
|
|
2214
2214
|
colorSecondary: string;
|
|
2215
2215
|
colorSecondaryHover: string;
|
|
2216
2216
|
colorSecondaryPressed: string;
|
|
@@ -2476,9 +2476,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2476
2476
|
fontSizeMedium: string;
|
|
2477
2477
|
fontSizeLarge: string;
|
|
2478
2478
|
opacityDisabled: string;
|
|
2479
|
-
colorOpacitySecondary:
|
|
2480
|
-
colorOpacitySecondaryHover:
|
|
2481
|
-
colorOpacitySecondaryPressed:
|
|
2479
|
+
colorOpacitySecondary: string;
|
|
2480
|
+
colorOpacitySecondaryHover: string;
|
|
2481
|
+
colorOpacitySecondaryPressed: string;
|
|
2482
2482
|
colorSecondary: string;
|
|
2483
2483
|
colorSecondaryHover: string;
|
|
2484
2484
|
colorSecondaryPressed: string;
|
|
@@ -2744,9 +2744,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2744
2744
|
fontSizeMedium: string;
|
|
2745
2745
|
fontSizeLarge: string;
|
|
2746
2746
|
opacityDisabled: string;
|
|
2747
|
-
colorOpacitySecondary:
|
|
2748
|
-
colorOpacitySecondaryHover:
|
|
2749
|
-
colorOpacitySecondaryPressed:
|
|
2747
|
+
colorOpacitySecondary: string;
|
|
2748
|
+
colorOpacitySecondaryHover: string;
|
|
2749
|
+
colorOpacitySecondaryPressed: string;
|
|
2750
2750
|
colorSecondary: string;
|
|
2751
2751
|
colorSecondaryHover: string;
|
|
2752
2752
|
colorSecondaryPressed: string;
|
|
@@ -118,8 +118,11 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
118
118
|
nTriggerFormInput();
|
|
119
119
|
nTriggerFormChange();
|
|
120
120
|
};
|
|
121
|
-
const deriveValueFromDisplayedValue = (offset = 0, doUpdateIfValid = true,
|
|
121
|
+
const deriveValueFromDisplayedValue = (offset = 0, doUpdateIfValid = true, isInputing = false) => {
|
|
122
122
|
const { value: displayedValue } = displayedValueRef;
|
|
123
|
+
if (isInputing && (0, utils_1.isWipValue)(displayedValue)) {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
123
126
|
const parsedValue = (0, utils_1.parse)(displayedValue);
|
|
124
127
|
if (parsedValue === null) {
|
|
125
128
|
if (doUpdateIfValid)
|
|
@@ -133,13 +136,13 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
133
136
|
const { value: mergedMax } = mergedMaxRef;
|
|
134
137
|
const { value: mergedMin } = mergedMinRef;
|
|
135
138
|
if (mergedMax !== null && nextValue > mergedMax) {
|
|
136
|
-
if (!doUpdateIfValid ||
|
|
139
|
+
if (!doUpdateIfValid || isInputing)
|
|
137
140
|
return false;
|
|
138
141
|
// if doUpdateIfValid=true, we try to make it a valid value
|
|
139
142
|
nextValue = mergedMax;
|
|
140
143
|
}
|
|
141
144
|
if (mergedMin !== null && nextValue < mergedMin) {
|
|
142
|
-
if (!doUpdateIfValid ||
|
|
145
|
+
if (!doUpdateIfValid || isInputing)
|
|
143
146
|
return false;
|
|
144
147
|
// if doUpdateIfValid=true, we try to make it a valid value
|
|
145
148
|
nextValue = mergedMin;
|
|
@@ -311,6 +314,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
311
314
|
else if (e.code === 'ArrowUp') {
|
|
312
315
|
if (props.keyboard.ArrowUp === false)
|
|
313
316
|
return;
|
|
317
|
+
e.preventDefault();
|
|
314
318
|
const value = deriveValueFromDisplayedValue();
|
|
315
319
|
if (value !== false) {
|
|
316
320
|
doAdd();
|
|
@@ -319,6 +323,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
319
323
|
else if (e.code === 'ArrowDown') {
|
|
320
324
|
if (props.keyboard.ArrowDown === false)
|
|
321
325
|
return;
|
|
326
|
+
e.preventDefault();
|
|
322
327
|
const value = deriveValueFromDisplayedValue();
|
|
323
328
|
if (value !== false) {
|
|
324
329
|
doMinus();
|
|
@@ -328,7 +333,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
328
333
|
function handleUpdateDisplayedValue(value) {
|
|
329
334
|
displayedValueRef.value = value;
|
|
330
335
|
if (props.updateValueOnInput) {
|
|
331
|
-
deriveValueFromDisplayedValue(0, true,
|
|
336
|
+
deriveValueFromDisplayedValue(0, true, true);
|
|
332
337
|
}
|
|
333
338
|
}
|
|
334
339
|
(0, vue_1.watch)(mergedValueRef, () => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function parse(value: string): number | null;
|
|
2
|
+
export declare function isWipValue(value: string): boolean;
|
|
2
3
|
export declare function validator(value: number | undefined | null): boolean;
|
|
3
4
|
export declare function format(value: number | undefined | null): string;
|
|
4
5
|
export declare function parseNumber(number: number | null | undefined | string): number | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseNumber = exports.format = exports.validator = exports.parse = void 0;
|
|
3
|
+
exports.parseNumber = exports.format = exports.validator = exports.isWipValue = exports.parse = void 0;
|
|
4
4
|
// string => string (expected, not implemented)
|
|
5
5
|
// string => number (legacy)
|
|
6
6
|
function parse(value) {
|
|
@@ -12,6 +12,11 @@ function parse(value) {
|
|
|
12
12
|
return Number(value);
|
|
13
13
|
}
|
|
14
14
|
exports.parse = parse;
|
|
15
|
+
// can be parsed to number but shouldn't be applied when inputing
|
|
16
|
+
function isWipValue(value) {
|
|
17
|
+
return /^\d+\.$/.test(value) || /^\.\d+$/.test(value);
|
|
18
|
+
}
|
|
19
|
+
exports.isWipValue = isWipValue;
|
|
15
20
|
// string => boolean (expected, not implemented)
|
|
16
21
|
// number => boolean (legacy)
|
|
17
22
|
function validator(value) {
|
|
@@ -20,9 +20,9 @@ declare const inputNumberLight: import("../../_mixins").Theme<"InputNumber", {
|
|
|
20
20
|
fontSizeMedium: string;
|
|
21
21
|
fontSizeLarge: string;
|
|
22
22
|
opacityDisabled: string;
|
|
23
|
-
colorOpacitySecondary:
|
|
24
|
-
colorOpacitySecondaryHover:
|
|
25
|
-
colorOpacitySecondaryPressed:
|
|
23
|
+
colorOpacitySecondary: string;
|
|
24
|
+
colorOpacitySecondaryHover: string;
|
|
25
|
+
colorOpacitySecondaryPressed: string;
|
|
26
26
|
colorSecondary: string;
|
|
27
27
|
colorSecondaryHover: string;
|
|
28
28
|
colorSecondaryPressed: string;
|
|
@@ -24,6 +24,11 @@ const deDE = {
|
|
|
24
24
|
yearFormat: 'yyyy',
|
|
25
25
|
monthFormat: 'MMM',
|
|
26
26
|
dayFormat: 'eeeeee',
|
|
27
|
+
yearTypeFormat: 'yyyy',
|
|
28
|
+
monthTypeFormat: 'MM-yyyy',
|
|
29
|
+
dateFormat: 'dd-MM-yyyy',
|
|
30
|
+
dateTimeFormat: 'dd-MM-yyyy HH:mm:ss',
|
|
31
|
+
quarterFormat: 'yyyy-qqq',
|
|
27
32
|
clear: 'Löschen',
|
|
28
33
|
now: 'Jetzt',
|
|
29
34
|
confirm: 'Bestätigen',
|
|
@@ -32,6 +37,9 @@ const deDE = {
|
|
|
32
37
|
datePlaceholder: 'Datum auswählen',
|
|
33
38
|
datetimePlaceholder: 'Datum und Uhrzeit auswählen',
|
|
34
39
|
monthPlaceholder: 'Monat auswählen',
|
|
40
|
+
// FIXME: translation needed
|
|
41
|
+
yearPlaceholder: 'Select Year',
|
|
42
|
+
quarterPlaceholder: 'Select Quarter',
|
|
35
43
|
startDatePlaceholder: 'Anfangsdatum',
|
|
36
44
|
endDatePlaceholder: 'Enddatum',
|
|
37
45
|
startDatetimePlaceholder: 'Anfangsdatum und Uhrzeit',
|
|
@@ -22,6 +22,11 @@ declare const enUS: {
|
|
|
22
22
|
yearFormat: string;
|
|
23
23
|
monthFormat: string;
|
|
24
24
|
dayFormat: string;
|
|
25
|
+
yearTypeFormat: string;
|
|
26
|
+
monthTypeFormat: string;
|
|
27
|
+
dateFormat: string;
|
|
28
|
+
dateTimeFormat: string;
|
|
29
|
+
quarterFormat: string;
|
|
25
30
|
clear: string;
|
|
26
31
|
now: string;
|
|
27
32
|
confirm: string;
|
|
@@ -30,6 +35,8 @@ declare const enUS: {
|
|
|
30
35
|
datePlaceholder: string;
|
|
31
36
|
datetimePlaceholder: string;
|
|
32
37
|
monthPlaceholder: string;
|
|
38
|
+
yearPlaceholder: string;
|
|
39
|
+
quarterPlaceholder: string;
|
|
33
40
|
startDatePlaceholder: string;
|
|
34
41
|
endDatePlaceholder: string;
|
|
35
42
|
startDatetimePlaceholder: string;
|
|
@@ -14,7 +14,7 @@ const enUS = {
|
|
|
14
14
|
Cascader: {
|
|
15
15
|
placeholder: 'Please Select',
|
|
16
16
|
loading: 'Loading',
|
|
17
|
-
loadingRequiredMessage: (label) => `Please load all ${label}'s
|
|
17
|
+
loadingRequiredMessage: (label) => `Please load all ${label}'s descendants before checking it.`
|
|
18
18
|
},
|
|
19
19
|
Time: {
|
|
20
20
|
dateFormat: 'yyyy-MM-dd',
|
|
@@ -24,6 +24,11 @@ const enUS = {
|
|
|
24
24
|
yearFormat: 'yyyy',
|
|
25
25
|
monthFormat: 'MMM',
|
|
26
26
|
dayFormat: 'eeeeee',
|
|
27
|
+
yearTypeFormat: 'yyyy',
|
|
28
|
+
monthTypeFormat: 'yyyy-MM',
|
|
29
|
+
dateFormat: 'yyyy-MM-dd',
|
|
30
|
+
dateTimeFormat: 'yyyy-MM-dd HH:mm:ss',
|
|
31
|
+
quarterFormat: 'yyyy-qqq',
|
|
27
32
|
clear: 'Clear',
|
|
28
33
|
now: 'Now',
|
|
29
34
|
confirm: 'Confirm',
|
|
@@ -32,6 +37,8 @@ const enUS = {
|
|
|
32
37
|
datePlaceholder: 'Select Date',
|
|
33
38
|
datetimePlaceholder: 'Select Date and Time',
|
|
34
39
|
monthPlaceholder: 'Select Month',
|
|
40
|
+
yearPlaceholder: 'Select Year',
|
|
41
|
+
quarterPlaceholder: 'Select Quarter',
|
|
35
42
|
startDatePlaceholder: 'Start Date',
|
|
36
43
|
endDatePlaceholder: 'End Date',
|
|
37
44
|
startDatetimePlaceholder: 'Start Date and Time',
|