@kdcloudjs/kdesign 1.7.69 → 1.7.71
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/dist/kdesign.css +1 -1
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +140 -65
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +1 -1
- package/dist/kdesign.min.js +12 -12
- package/dist/kdesign.min.js.map +1 -1
- package/es/_utils/hooks.js +1 -1
- package/es/base-data/base-data.js +11 -5
- package/es/carousel/carousel.js +1 -1
- package/es/cascader/cascader.js +8 -3
- package/es/city-picker/city-picker.js +2 -1
- package/es/collapse/collapse.js +1 -1
- package/es/config-provider/compDefaultProps.d.ts +0 -4
- package/es/config-provider/compDefaultProps.js +1 -5
- package/es/date-picker/calendar.d.ts +3 -2
- package/es/date-picker/date-panel.d.ts +2 -1
- package/es/date-picker/date-picker.d.ts +4 -0
- package/es/date-picker/hooks/use-range-disabled.d.ts +3 -2
- package/es/date-picker/hooks/use-range-disabled.js +4 -2
- package/es/date-picker/interface.d.ts +2 -1
- package/es/date-picker/panel/month/month.d.ts +2 -2
- package/es/date-picker/panel/month/month.js +7 -3
- package/es/date-picker/panel/quarter/quarter.d.ts +2 -2
- package/es/date-picker/panel/quarter/quarter.js +7 -3
- package/es/date-picker/panel/week/week.d.ts +2 -1
- package/es/date-picker/panel/year/year.d.ts +2 -1
- package/es/date-picker/panel/year/year.js +7 -3
- package/es/date-picker/range-picker.js +3 -1
- package/es/date-picker/single/input-date.d.ts +2 -1
- package/es/image/preview.js +6 -2
- package/es/image-cropper/image-cropper.js +4 -2
- package/es/input-number/inputNumber.js +1 -1
- package/es/locale/locale.d.ts +22 -1
- package/es/locale/locale.js +1 -1
- package/es/locale/zh-CN.d.ts +19 -0
- package/es/locale/zh-CN.js +21 -2
- package/es/notification/content.js +6 -2
- package/es/notification/index.js +1 -3
- package/es/qr-code/qr-code.js +7 -3
- package/es/search/search-panel.js +11 -5
- package/es/select/select.js +7 -3
- package/es/split-panel/split-panel.js +1 -1
- package/es/stepper/stepper.js +1 -1
- package/es/tree-select/tree-select.js +9 -4
- package/es/upload/upload.js +11 -6
- package/lib/_utils/hooks.js +1 -1
- package/lib/base-data/base-data.js +11 -5
- package/lib/carousel/carousel.js +1 -1
- package/lib/cascader/cascader.js +8 -3
- package/lib/city-picker/city-picker.js +2 -1
- package/lib/collapse/collapse.js +1 -1
- package/lib/config-provider/compDefaultProps.d.ts +0 -4
- package/lib/config-provider/compDefaultProps.js +1 -5
- package/lib/date-picker/calendar.d.ts +3 -2
- package/lib/date-picker/date-panel.d.ts +2 -1
- package/lib/date-picker/date-picker.d.ts +4 -0
- package/lib/date-picker/hooks/use-range-disabled.d.ts +3 -2
- package/lib/date-picker/hooks/use-range-disabled.js +4 -2
- package/lib/date-picker/interface.d.ts +2 -1
- package/lib/date-picker/panel/month/month.d.ts +2 -2
- package/lib/date-picker/panel/month/month.js +7 -3
- package/lib/date-picker/panel/quarter/quarter.d.ts +2 -2
- package/lib/date-picker/panel/quarter/quarter.js +7 -3
- package/lib/date-picker/panel/week/week.d.ts +2 -1
- package/lib/date-picker/panel/year/year.d.ts +2 -1
- package/lib/date-picker/panel/year/year.js +7 -3
- package/lib/date-picker/range-picker.js +3 -1
- package/lib/date-picker/single/input-date.d.ts +2 -1
- package/lib/image/preview.js +6 -2
- package/lib/image-cropper/image-cropper.js +4 -2
- package/lib/input-number/inputNumber.js +1 -1
- package/lib/locale/locale.d.ts +22 -1
- package/lib/locale/locale.js +1 -1
- package/lib/locale/zh-CN.d.ts +19 -0
- package/lib/locale/zh-CN.js +21 -2
- package/lib/notification/content.js +6 -2
- package/lib/notification/index.js +1 -3
- package/lib/qr-code/qr-code.js +7 -3
- package/lib/search/search-panel.js +11 -5
- package/lib/select/select.js +7 -3
- package/lib/split-panel/split-panel.js +1 -1
- package/lib/stepper/stepper.js +1 -1
- package/lib/tree-select/tree-select.js +9 -4
- package/lib/upload/upload.js +11 -6
- package/package.json +1 -1
|
@@ -59,6 +59,10 @@ export interface PickerTimeProps extends PickerSharedProps, Omit<OmitPanelProps<
|
|
|
59
59
|
}
|
|
60
60
|
export declare type PickerProps = PickerBaseProps | PickerDateProps | PickerTimeProps;
|
|
61
61
|
export declare type IInnerPicker = undefined | 'year' | 'month';
|
|
62
|
+
export declare type DisabledDataProps = (date: DateType, info?: {
|
|
63
|
+
panelType?: 'month' | 'quarter' | 'year';
|
|
64
|
+
range?: 'start' | 'end';
|
|
65
|
+
}) => boolean;
|
|
62
66
|
export declare const mergeDateLocale: (globalLocale: InnerLocale, locale?: {}) => InnerLocale;
|
|
63
67
|
declare const DatePicker: React.ForwardRefExoticComponent<(Partial<PickerBaseProps> & React.RefAttributes<unknown>) | (Partial<PickerDateProps> & React.RefAttributes<unknown>) | (Partial<PickerTimeProps> & React.RefAttributes<unknown>)>;
|
|
64
68
|
export default DatePicker;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { RangeValue, PickerMode, DateType } from '../interface';
|
|
2
|
+
import { DisabledDataProps } from '../date-picker';
|
|
2
3
|
export default function useRangeDisabled({ picker, selectedValue, disabledDate, disabled, }: {
|
|
3
4
|
picker: PickerMode;
|
|
4
5
|
selectedValue: RangeValue;
|
|
5
|
-
disabledDate?:
|
|
6
|
+
disabledDate?: DisabledDataProps;
|
|
6
7
|
disabled: [boolean, boolean];
|
|
7
|
-
}, disabledStart: boolean, disabledEnd: boolean): ((date: DateType) => boolean)[];
|
|
8
|
+
}, disabledStart: boolean, disabledEnd: boolean): ((date: DateType, info?: any) => boolean)[];
|
|
@@ -35,7 +35,8 @@ function useRangeDisabled(_ref, disabledStart, disabledEnd) {
|
|
|
35
35
|
return year * 10 + quarter;
|
|
36
36
|
}
|
|
37
37
|
var disabledStartDate = React.useCallback(function (date) {
|
|
38
|
-
|
|
38
|
+
var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
39
|
+
if (disabledDate && disabledDate(date, info)) {
|
|
39
40
|
return true;
|
|
40
41
|
}
|
|
41
42
|
if (disabled[1] && endDate) {
|
|
@@ -58,7 +59,8 @@ function useRangeDisabled(_ref, disabledStart, disabledEnd) {
|
|
|
58
59
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59
60
|
[disabledDate, disabled[1], endDate, disabledStart]);
|
|
60
61
|
var disabledEndDate = React.useCallback(function (date) {
|
|
61
|
-
|
|
62
|
+
var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
63
|
+
if (disabledDate && disabledDate(date, info)) {
|
|
62
64
|
return true;
|
|
63
65
|
}
|
|
64
66
|
if (disabled[0] && startDate) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BorderType, InputSiteType } from '../input/input';
|
|
3
|
+
import { DisabledDataProps } from './date-picker';
|
|
3
4
|
export declare type WeekTitleType = [string, string, string, string, string, string, string];
|
|
4
5
|
export declare type MonthTitleType = [string, string, string, string, string, string, string, string, string, string, string, string];
|
|
5
6
|
export interface Locale {
|
|
@@ -77,7 +78,7 @@ export interface PanelSharedProps {
|
|
|
77
78
|
value?: NullableDateType;
|
|
78
79
|
defaultPickerValue?: DateType;
|
|
79
80
|
locale: InnerLocale;
|
|
80
|
-
disabledDate?:
|
|
81
|
+
disabledDate?: DisabledDataProps;
|
|
81
82
|
prevIcon?: React.ReactNode;
|
|
82
83
|
nextIcon?: React.ReactNode;
|
|
83
84
|
superPrevIcon?: React.ReactNode;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { DisabledDataProps } from '../../date-picker';
|
|
3
3
|
export interface MonthProps {
|
|
4
4
|
showFullMonth?: boolean;
|
|
5
|
-
disabledDate
|
|
5
|
+
disabledDate?: DisabledDataProps;
|
|
6
6
|
}
|
|
7
7
|
declare function Month(props: MonthProps): JSX.Element;
|
|
8
8
|
export default Month;
|
|
@@ -35,6 +35,10 @@ function Month(props) {
|
|
|
35
35
|
setInnerPicker = context.setInnerPicker,
|
|
36
36
|
cellRender = context.cellRender,
|
|
37
37
|
range = context.range;
|
|
38
|
+
var disabledInfo = {
|
|
39
|
+
panelType: 'month',
|
|
40
|
+
range: range
|
|
41
|
+
};
|
|
38
42
|
var disabledDate = props.disabledDate;
|
|
39
43
|
var _dateValue;
|
|
40
44
|
if (panelPosition) {
|
|
@@ -91,7 +95,7 @@ function Month(props) {
|
|
|
91
95
|
});
|
|
92
96
|
var handleClick = function handleClick(date) {
|
|
93
97
|
if (innerPicker === undefined) {
|
|
94
|
-
if (!(disabledDate && disabledDate(date))) {
|
|
98
|
+
if (!(disabledDate && disabledDate(date, disabledInfo))) {
|
|
95
99
|
onSelect(date, 'mouse');
|
|
96
100
|
}
|
|
97
101
|
} else {
|
|
@@ -115,7 +119,7 @@ function Month(props) {
|
|
|
115
119
|
return handleClick(month);
|
|
116
120
|
},
|
|
117
121
|
onMouseEnter: function onMouseEnter() {
|
|
118
|
-
if (onDateMouseEnter && !(disabledDate && disabledDate(month))) {
|
|
122
|
+
if (onDateMouseEnter && !(disabledDate && disabledDate(month, disabledInfo))) {
|
|
119
123
|
onDateMouseEnter(month);
|
|
120
124
|
}
|
|
121
125
|
},
|
|
@@ -125,7 +129,7 @@ function Month(props) {
|
|
|
125
129
|
}
|
|
126
130
|
}
|
|
127
131
|
};
|
|
128
|
-
var monthItemCls = (0, _classnames3.default)("".concat(prefixCls, "-month-item"), (0, _defineProperty2.default)({}, "".concat(prefixCls, "-month-item-disabled"), disabledDate && disabledDate(month)), getRangeCls(month));
|
|
132
|
+
var monthItemCls = (0, _classnames3.default)("".concat(prefixCls, "-month-item"), (0, _defineProperty2.default)({}, "".concat(prefixCls, "-month-item-disabled"), disabledDate && disabledDate(month, disabledInfo)), getRangeCls(month));
|
|
129
133
|
var originNode = /*#__PURE__*/_react.default.createElement("span", {
|
|
130
134
|
className: getMonthClassNames(m)
|
|
131
135
|
}, "".concat(locale.monthTitle[m]));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { DisabledDataProps } from '../../date-picker';
|
|
3
3
|
interface QuarterProps {
|
|
4
|
-
disabledDate?:
|
|
4
|
+
disabledDate?: DisabledDataProps;
|
|
5
5
|
}
|
|
6
6
|
declare function Quarter(props: QuarterProps): JSX.Element;
|
|
7
7
|
export default Quarter;
|
|
@@ -32,6 +32,10 @@ function Quarter(props) {
|
|
|
32
32
|
hoverRangedValue = context.hoverRangedValue,
|
|
33
33
|
cellRender = context.cellRender,
|
|
34
34
|
range = context.range;
|
|
35
|
+
var disabledInfo = {
|
|
36
|
+
panelType: 'quarter',
|
|
37
|
+
range: range
|
|
38
|
+
};
|
|
35
39
|
var disabledDate = props.disabledDate;
|
|
36
40
|
var _dateValue;
|
|
37
41
|
if (panelPosition) {
|
|
@@ -87,7 +91,7 @@ function Quarter(props) {
|
|
|
87
91
|
}
|
|
88
92
|
});
|
|
89
93
|
var handleClick = function handleClick(date) {
|
|
90
|
-
if (!(disabledDate && disabledDate(date))) {
|
|
94
|
+
if (!(disabledDate && disabledDate(date, disabledInfo))) {
|
|
91
95
|
onSelect(date, 'mouse');
|
|
92
96
|
}
|
|
93
97
|
};
|
|
@@ -99,7 +103,7 @@ function Quarter(props) {
|
|
|
99
103
|
return handleClick(quarter);
|
|
100
104
|
},
|
|
101
105
|
onMouseEnter: function onMouseEnter() {
|
|
102
|
-
if (onDateMouseEnter && !(disabledDate && disabledDate(quarter))) {
|
|
106
|
+
if (onDateMouseEnter && !(disabledDate && disabledDate(quarter, disabledInfo))) {
|
|
103
107
|
onDateMouseEnter(quarter);
|
|
104
108
|
}
|
|
105
109
|
},
|
|
@@ -109,7 +113,7 @@ function Quarter(props) {
|
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
115
|
};
|
|
112
|
-
var quarterCls = (0, _classnames3.default)("".concat(prefixCls, "-quarter-item"), (0, _defineProperty2.default)({}, "".concat(prefixCls, "-quarter-item-disabled"), disabledDate && disabledDate(quarter)), getRangeCls(quarter));
|
|
116
|
+
var quarterCls = (0, _classnames3.default)("".concat(prefixCls, "-quarter-item"), (0, _defineProperty2.default)({}, "".concat(prefixCls, "-quarter-item-disabled"), disabledDate && disabledDate(quarter, disabledInfo)), getRangeCls(quarter));
|
|
113
117
|
var originNode = /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
114
118
|
className: getQuarterClassNames(i + 1)
|
|
115
119
|
}, _props), n);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DateType, PickerMode } from '../../interface';
|
|
3
|
+
import { DisabledDataProps } from '../../date-picker';
|
|
3
4
|
export interface WeekProps {
|
|
4
5
|
day: DateType;
|
|
5
6
|
picker: PickerMode;
|
|
6
7
|
showWeekNumber?: boolean;
|
|
7
8
|
showTime?: boolean;
|
|
8
|
-
disabledDate?:
|
|
9
|
+
disabledDate?: DisabledDataProps;
|
|
9
10
|
}
|
|
10
11
|
declare function Week(props: WeekProps): JSX.Element;
|
|
11
12
|
export default Week;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DateType, PickerMode } from '../../interface';
|
|
3
|
+
import { DisabledDataProps } from '../../date-picker';
|
|
3
4
|
export interface YearProps {
|
|
4
5
|
yearItemNumber: number;
|
|
5
6
|
minDate?: DateType;
|
|
6
7
|
maxDate?: DateType;
|
|
7
|
-
disabledDate?:
|
|
8
|
+
disabledDate?: DisabledDataProps;
|
|
8
9
|
picker?: PickerMode;
|
|
9
10
|
}
|
|
10
11
|
declare function Year(props: YearProps): JSX.Element;
|
|
@@ -33,6 +33,10 @@ function Year(props) {
|
|
|
33
33
|
setInnerPicker = context.setInnerPicker,
|
|
34
34
|
cellRender = context.cellRender,
|
|
35
35
|
range = context.range;
|
|
36
|
+
var disabledInfo = {
|
|
37
|
+
panelType: 'year',
|
|
38
|
+
range: range
|
|
39
|
+
};
|
|
36
40
|
var yearItemNumber = props.yearItemNumber,
|
|
37
41
|
disabledDate = props.disabledDate,
|
|
38
42
|
_props$picker = props.picker,
|
|
@@ -92,7 +96,7 @@ function Year(props) {
|
|
|
92
96
|
});
|
|
93
97
|
var handleClick = function handleClick(date) {
|
|
94
98
|
if (innerPicker === undefined) {
|
|
95
|
-
if (!(disabledDate && disabledDate(date))) {
|
|
99
|
+
if (!(disabledDate && disabledDate(date, disabledInfo))) {
|
|
96
100
|
onSelect(date, 'mouse');
|
|
97
101
|
}
|
|
98
102
|
} else {
|
|
@@ -118,7 +122,7 @@ function Year(props) {
|
|
|
118
122
|
return handleClick(year);
|
|
119
123
|
},
|
|
120
124
|
onMouseEnter: function onMouseEnter() {
|
|
121
|
-
if (onDateMouseEnter && !(disabledDate && disabledDate(year))) {
|
|
125
|
+
if (onDateMouseEnter && !(disabledDate && disabledDate(year, disabledInfo))) {
|
|
122
126
|
onDateMouseEnter(year);
|
|
123
127
|
}
|
|
124
128
|
},
|
|
@@ -132,7 +136,7 @@ function Year(props) {
|
|
|
132
136
|
className: getYearClassNames(y)
|
|
133
137
|
}, y);
|
|
134
138
|
yearsList.push( /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
135
|
-
className: (0, _classnames3.default)("".concat(prefixCls, "-year-item"), (0, _defineProperty2.default)({}, "".concat(prefixCls, "-year-item-disabled"), disabledDate && disabledDate(year)), getRangeCls(year)),
|
|
139
|
+
className: (0, _classnames3.default)("".concat(prefixCls, "-year-item"), (0, _defineProperty2.default)({}, "".concat(prefixCls, "-year-item-disabled"), disabledDate && disabledDate(year, disabledInfo)), getRangeCls(year)),
|
|
136
140
|
key: y
|
|
137
141
|
}, _props), typeof cellRender === 'function' ? cellRender(y, {
|
|
138
142
|
originNode: originNode,
|
|
@@ -477,7 +477,9 @@ var InternalRangePicker = function InternalRangePicker(props, ref) {
|
|
|
477
477
|
prefixCls: datePickerPrefixCls,
|
|
478
478
|
components: components,
|
|
479
479
|
needConfirmButton: needConfirmButton,
|
|
480
|
-
okDisabled: !(0, _utils2.getValue)(selectedValue, mergedActivePickerIndex) || !!(selectedValue && selectedValue[mergedActivePickerIndex] && disabledDate && disabledDate(selectedValue[mergedActivePickerIndex]
|
|
480
|
+
okDisabled: !(0, _utils2.getValue)(selectedValue, mergedActivePickerIndex) || !!(selectedValue && selectedValue[mergedActivePickerIndex] && disabledDate && disabledDate(selectedValue[mergedActivePickerIndex], {
|
|
481
|
+
range: mergedActivePickerIndex === 0 ? 'start' : 'end'
|
|
482
|
+
})),
|
|
481
483
|
locale: datePickerLang,
|
|
482
484
|
// rangeList,
|
|
483
485
|
onOk: function onOk() {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DateType, InputCommonProps, OutInputCommonProps } from '../interface';
|
|
3
|
+
import { DisabledDataProps } from '../date-picker';
|
|
3
4
|
export interface InputDateProps extends OutInputCommonProps, InputCommonProps {
|
|
4
5
|
inputRef: React.RefObject<HTMLInputElement>;
|
|
5
6
|
text: string;
|
|
@@ -8,7 +9,7 @@ export interface InputDateProps extends OutInputCommonProps, InputCommonProps {
|
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
hoverValue?: string;
|
|
10
11
|
placeholder?: string;
|
|
11
|
-
disabledDate?:
|
|
12
|
+
disabledDate?: DisabledDataProps;
|
|
12
13
|
resetText: () => void;
|
|
13
14
|
setSelectedValue: (date: DateType | null) => void;
|
|
14
15
|
triggerTextChange: (value: string) => void;
|
package/lib/image/preview.js
CHANGED
|
@@ -28,9 +28,13 @@ var Preview = function Preview(props) {
|
|
|
28
28
|
var _React$useContext = React.useContext(_configProvider.ConfigContext),
|
|
29
29
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
30
30
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
31
|
-
userDefaultProps = _React$useContext.compDefaultProps
|
|
31
|
+
userDefaultProps = _React$useContext.compDefaultProps,
|
|
32
|
+
locale = _React$useContext.locale;
|
|
32
33
|
// 属性需要合并一遍用户定义的默认属性
|
|
33
34
|
var allProps = (0, _utils.getCompProps)('Image', userDefaultProps, props);
|
|
35
|
+
var imageLangMsg = locale.getCompLangMsg({
|
|
36
|
+
componentName: 'Image'
|
|
37
|
+
});
|
|
34
38
|
var src = allProps.src,
|
|
35
39
|
alt = allProps.alt,
|
|
36
40
|
name = allProps.name,
|
|
@@ -197,7 +201,7 @@ var Preview = function Preview(props) {
|
|
|
197
201
|
onClick: onClose
|
|
198
202
|
}, /*#__PURE__*/React.createElement(_icon.default, {
|
|
199
203
|
type: "close-solid"
|
|
200
|
-
}),
|
|
204
|
+
}), imageLangMsg.close))));
|
|
201
205
|
return /*#__PURE__*/_reactDom.default.createPortal(peviewContainer, document.body);
|
|
202
206
|
};
|
|
203
207
|
var _default = Preview;
|
|
@@ -67,7 +67,8 @@ var InternalImageCropper = function InternalImageCropper(props, forwardedRef) {
|
|
|
67
67
|
var _React$useContext = _react.default.useContext(_ConfigContext.default),
|
|
68
68
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
69
69
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
70
|
-
userDefaultProps = _React$useContext.compDefaultProps
|
|
70
|
+
userDefaultProps = _React$useContext.compDefaultProps,
|
|
71
|
+
locale = _React$useContext.locale;
|
|
71
72
|
var _a = (0, _utils.getCompProps)('ImageCropper', userDefaultProps, props),
|
|
72
73
|
customPrefixcls = _a.prefixCls,
|
|
73
74
|
containerWidth = _a.containerWidth,
|
|
@@ -81,7 +82,8 @@ var InternalImageCropper = function InternalImageCropper(props, forwardedRef) {
|
|
|
81
82
|
viewMode = _a.viewMode,
|
|
82
83
|
aspectRatio = _a.aspectRatio,
|
|
83
84
|
modal = _a.modal,
|
|
84
|
-
okText = _a.okText,
|
|
85
|
+
_a$okText = _a.okText,
|
|
86
|
+
okText = _a$okText === void 0 ? locale.getLangMsg('ImageCropper', 'okText') : _a$okText,
|
|
85
87
|
okBtn = _a.okBtn,
|
|
86
88
|
_a$image = _a.image,
|
|
87
89
|
image = _a$image === void 0 ? '' : _a$image,
|
|
@@ -208,7 +208,7 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
208
208
|
var _a, _b;
|
|
209
209
|
var step = stepOption.step === undefined ? 1 : parseFloat(stepOption.step);
|
|
210
210
|
if (typeof step !== 'number') {
|
|
211
|
-
(0, _devwarning.default)(true, 'inputNumber', "stepOption.step
|
|
211
|
+
(0, _devwarning.default)(true, 'inputNumber', "stepOption.step must be a number.");
|
|
212
212
|
return false;
|
|
213
213
|
}
|
|
214
214
|
var startingNumber = parseFloat((_b = (_a = inputNumberRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value) || 0;
|
package/lib/locale/locale.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ declare class LocaleCache {
|
|
|
29
29
|
'global.placeholder': string;
|
|
30
30
|
'global.cancel': string;
|
|
31
31
|
'global.confirm': string;
|
|
32
|
+
'global.emptyText': string;
|
|
32
33
|
'Button.text': string;
|
|
33
34
|
'Progress.circleLoadingDesc': string;
|
|
34
35
|
'Progress.loading': string;
|
|
@@ -61,16 +62,21 @@ declare class LocaleCache {
|
|
|
61
62
|
'QuickSearch.emptyTip': string;
|
|
62
63
|
'QuickSearch.or': string;
|
|
63
64
|
'CityPicker.domestic': string;
|
|
64
|
-
'CityPicker.common': string;
|
|
65
|
+
'CityPicker.common': string; /**
|
|
66
|
+
* 获取当前语言类型
|
|
67
|
+
*/
|
|
65
68
|
'CityPicker.emptyText': string;
|
|
66
69
|
'CityPicker.commonEmptyText': string;
|
|
67
70
|
'CityPicker.tabsDomestic': string;
|
|
68
71
|
'CityPicker.tabsInternation': string;
|
|
72
|
+
'CityPicker.title': string;
|
|
69
73
|
'ColorPicker.followFunctionalColor': string;
|
|
70
74
|
'Search.placeholder': string;
|
|
71
75
|
'Search.desc': string[];
|
|
72
76
|
'Search.nplDesc': string;
|
|
73
77
|
'Search.emptyTip': string;
|
|
78
|
+
'Search.viewMoreResult': string;
|
|
79
|
+
'Search.range': string;
|
|
74
80
|
'Search.or': string;
|
|
75
81
|
'Filter.filterCondition': string;
|
|
76
82
|
'Filter.commonCondition': string;
|
|
@@ -100,11 +106,26 @@ declare class LocaleCache {
|
|
|
100
106
|
'Table.confirmFilter': string;
|
|
101
107
|
'Select.selectAll': string;
|
|
102
108
|
'Select.seleted': string;
|
|
109
|
+
'Select.total': string;
|
|
103
110
|
'Signature.clickToSign': string;
|
|
104
111
|
'Signature.pleaseWriteHere': string;
|
|
105
112
|
'Signature.okText': string;
|
|
106
113
|
'Signature.cancelText': string;
|
|
107
114
|
'Signature.handwrittenSignature': string;
|
|
115
|
+
'QRCode.qrCodeExpired': string;
|
|
116
|
+
'QRCode.clickRefresh': string;
|
|
117
|
+
'Cascader.total': string;
|
|
118
|
+
'BaseData.total': string;
|
|
119
|
+
'BaseData.history': string;
|
|
120
|
+
'BaseData.favorites': string;
|
|
121
|
+
'Image.close': string;
|
|
122
|
+
'Upload.reUpload': string;
|
|
123
|
+
'Upload.uploading': string;
|
|
124
|
+
'Upload.fail': string;
|
|
125
|
+
'Upload.delete': string;
|
|
126
|
+
'Notification.title': string;
|
|
127
|
+
'TreeSelect.total': string;
|
|
128
|
+
'ImageCropper.okText': string;
|
|
108
129
|
'DatePicker.placeholder': string;
|
|
109
130
|
'DatePicker.yearPlaceholder': string;
|
|
110
131
|
'DatePicker.quarterPlaceholder': string;
|
package/lib/locale/locale.js
CHANGED
|
@@ -36,7 +36,7 @@ var LocaleCache = /*#__PURE__*/function () {
|
|
|
36
36
|
key: "setLocalesData",
|
|
37
37
|
value: function setLocalesData(locale, localeData) {
|
|
38
38
|
if (!(localeData || this.localesData[locale])) {
|
|
39
|
-
console.error("
|
|
39
|
+
console.error("Missing language pack for ".concat(locale, ". Please check and reconfigure."));
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
var newLocaleData = (0, _extends2.default)((0, _extends2.default)({}, _zhCN.default), localeData);
|
package/lib/locale/zh-CN.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ declare const locale: {
|
|
|
3
3
|
'global.placeholder': string;
|
|
4
4
|
'global.cancel': string;
|
|
5
5
|
'global.confirm': string;
|
|
6
|
+
'global.emptyText': string;
|
|
6
7
|
'Button.text': string;
|
|
7
8
|
'Progress.circleLoadingDesc': string;
|
|
8
9
|
'Progress.loading': string;
|
|
@@ -40,11 +41,14 @@ declare const locale: {
|
|
|
40
41
|
'CityPicker.commonEmptyText': string;
|
|
41
42
|
'CityPicker.tabsDomestic': string;
|
|
42
43
|
'CityPicker.tabsInternation': string;
|
|
44
|
+
'CityPicker.title': string;
|
|
43
45
|
'ColorPicker.followFunctionalColor': string;
|
|
44
46
|
'Search.placeholder': string;
|
|
45
47
|
'Search.desc': string[];
|
|
46
48
|
'Search.nplDesc': string;
|
|
47
49
|
'Search.emptyTip': string;
|
|
50
|
+
'Search.viewMoreResult': string;
|
|
51
|
+
'Search.range': string;
|
|
48
52
|
'Search.or': string;
|
|
49
53
|
'Filter.filterCondition': string;
|
|
50
54
|
'Filter.commonCondition': string;
|
|
@@ -74,11 +78,26 @@ declare const locale: {
|
|
|
74
78
|
'Table.confirmFilter': string;
|
|
75
79
|
'Select.selectAll': string;
|
|
76
80
|
'Select.seleted': string;
|
|
81
|
+
'Select.total': string;
|
|
77
82
|
'Signature.clickToSign': string;
|
|
78
83
|
'Signature.pleaseWriteHere': string;
|
|
79
84
|
'Signature.okText': string;
|
|
80
85
|
'Signature.cancelText': string;
|
|
81
86
|
'Signature.handwrittenSignature': string;
|
|
87
|
+
'QRCode.qrCodeExpired': string;
|
|
88
|
+
'QRCode.clickRefresh': string;
|
|
89
|
+
'Cascader.total': string;
|
|
90
|
+
'BaseData.total': string;
|
|
91
|
+
'BaseData.history': string;
|
|
92
|
+
'BaseData.favorites': string;
|
|
93
|
+
'Image.close': string;
|
|
94
|
+
'Upload.reUpload': string;
|
|
95
|
+
'Upload.uploading': string;
|
|
96
|
+
'Upload.fail': string;
|
|
97
|
+
'Upload.delete': string;
|
|
98
|
+
'Notification.title': string;
|
|
99
|
+
'TreeSelect.total': string;
|
|
100
|
+
'ImageCropper.okText': string;
|
|
82
101
|
'DatePicker.placeholder': string;
|
|
83
102
|
'DatePicker.yearPlaceholder': string;
|
|
84
103
|
'DatePicker.quarterPlaceholder': string;
|
package/lib/locale/zh-CN.js
CHANGED
|
@@ -11,9 +11,10 @@ var locale = (0, _extends2.default)((0, _extends2.default)({
|
|
|
11
11
|
locale: 'zh-CN'
|
|
12
12
|
}, _zh_CN.default), {
|
|
13
13
|
'global.selectholder': '请选择',
|
|
14
|
-
'global.placeholder': '
|
|
14
|
+
'global.placeholder': '请输入需要搜索的内容',
|
|
15
15
|
'global.cancel': '取消',
|
|
16
16
|
'global.confirm': '确定',
|
|
17
|
+
'global.emptyText': '暂无数据',
|
|
17
18
|
'Button.text': '按钮',
|
|
18
19
|
'Progress.circleLoadingDesc': '正在加载中',
|
|
19
20
|
'Progress.loading': '正在加载中...',
|
|
@@ -51,11 +52,14 @@ var locale = (0, _extends2.default)((0, _extends2.default)({
|
|
|
51
52
|
'CityPicker.commonEmptyText': '无常用城市',
|
|
52
53
|
'CityPicker.tabsDomestic': '国内',
|
|
53
54
|
'CityPicker.tabsInternation': '国际/中国港澳台',
|
|
55
|
+
'CityPicker.title': '城市',
|
|
54
56
|
'ColorPicker.followFunctionalColor': '跟随功能色',
|
|
55
57
|
'Search.placeholder': '请输入需要搜索的内容',
|
|
56
58
|
'Search.desc': ['空格代表"或",回车代表"且"'],
|
|
57
59
|
'Search.nplDesc': '智能搜索',
|
|
58
60
|
'Search.emptyTip': '暂无数据',
|
|
61
|
+
'Search.viewMoreResult': '查看更多"{inputValue}"的结果',
|
|
62
|
+
'Search.range': '范围',
|
|
59
63
|
'Search.or': '或',
|
|
60
64
|
'Filter.filterCondition': '筛选条件',
|
|
61
65
|
'Filter.commonCondition': '常用条件',
|
|
@@ -85,11 +89,26 @@ var locale = (0, _extends2.default)((0, _extends2.default)({
|
|
|
85
89
|
'Table.confirmFilter': '确定',
|
|
86
90
|
'Select.selectAll': '全选',
|
|
87
91
|
'Select.seleted': '已选{size}项',
|
|
92
|
+
'Select.total': '共{total}项',
|
|
88
93
|
'Signature.clickToSign': '点击签名',
|
|
89
94
|
'Signature.pleaseWriteHere': '请在此处横向书写签名',
|
|
90
95
|
'Signature.okText': '确定',
|
|
91
96
|
'Signature.cancelText': '取消',
|
|
92
|
-
'Signature.handwrittenSignature': '手写签名'
|
|
97
|
+
'Signature.handwrittenSignature': '手写签名',
|
|
98
|
+
'QRCode.qrCodeExpired': '二维码过期',
|
|
99
|
+
'QRCode.clickRefresh': '点击刷新',
|
|
100
|
+
'Cascader.total': '共{total}项',
|
|
101
|
+
'BaseData.total': '共{total}项',
|
|
102
|
+
'BaseData.history': '历史记录',
|
|
103
|
+
'BaseData.favorites': '我的收藏',
|
|
104
|
+
'Image.close': '关闭',
|
|
105
|
+
'Upload.reUpload': '重新上传',
|
|
106
|
+
'Upload.uploading': '文件上传中ing',
|
|
107
|
+
'Upload.fail': '上传失败',
|
|
108
|
+
'Upload.delete': '删除',
|
|
109
|
+
'Notification.title': '系统提示',
|
|
110
|
+
'TreeSelect.total': '共{total}项',
|
|
111
|
+
'ImageCropper.okText': '确认裁剪'
|
|
93
112
|
});
|
|
94
113
|
var _default = locale;
|
|
95
114
|
exports.default = _default;
|
|
@@ -30,7 +30,11 @@ var Content = function Content(args) {
|
|
|
30
30
|
icon = args.icon,
|
|
31
31
|
closeNode = args.closeNode;
|
|
32
32
|
var _useContext = (0, _react.useContext)(_configProvider.ConfigContext),
|
|
33
|
-
prefixCls = _useContext.prefixCls
|
|
33
|
+
prefixCls = _useContext.prefixCls,
|
|
34
|
+
locale = _useContext.locale;
|
|
35
|
+
var notificationLangMsg = locale.getCompLangMsg({
|
|
36
|
+
componentName: 'Notification'
|
|
37
|
+
});
|
|
34
38
|
var classPrefix = (0, _concat.default)(_context = "".concat(prefixCls, "-")).call(_context, suffixCls, "-content");
|
|
35
39
|
var iconMap = {
|
|
36
40
|
info: /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
@@ -77,7 +81,7 @@ var Content = function Content(args) {
|
|
|
77
81
|
className: (0, _classnames.default)("".concat(classPrefix, "-title-left"))
|
|
78
82
|
}, renderIcon(), /*#__PURE__*/_react.default.createElement("div", {
|
|
79
83
|
className: (0, _classnames.default)("".concat(classPrefix, "-title-left-text"))
|
|
80
|
-
}, title)), renderCloseIcon());
|
|
84
|
+
}, typeof title === 'undefined' ? notificationLangMsg.title : title)), renderCloseIcon());
|
|
81
85
|
};
|
|
82
86
|
var getFooterElement = function getFooterElement() {
|
|
83
87
|
if ( /*#__PURE__*/_react.default.isValidElement(footer)) {
|
|
@@ -17,7 +17,6 @@ var defaultClosable = true;
|
|
|
17
17
|
var defaultShowIcon = false;
|
|
18
18
|
var defaultSuffixCls = 'notice';
|
|
19
19
|
var defaultType = 'primary';
|
|
20
|
-
var defaultTitle = '系统提示'; // 'notice'
|
|
21
20
|
var notificationElements = {};
|
|
22
21
|
var notificationKey = 1;
|
|
23
22
|
var getNotificationProps = function getNotificationProps(args) {
|
|
@@ -34,8 +33,7 @@ var getNotificationProps = function getNotificationProps(args) {
|
|
|
34
33
|
onClose = args.onClose,
|
|
35
34
|
_args$closable = args.closable,
|
|
36
35
|
closable = _args$closable === void 0 ? defaultClosable : _args$closable,
|
|
37
|
-
|
|
38
|
-
title = _args$title === void 0 ? defaultTitle : _args$title,
|
|
36
|
+
title = args.title,
|
|
39
37
|
footer = args.footer,
|
|
40
38
|
content = args.content,
|
|
41
39
|
icon = args.icon,
|
package/lib/qr-code/qr-code.js
CHANGED
|
@@ -32,7 +32,8 @@ var QRCode = function QRCode(props) {
|
|
|
32
32
|
var _useContext = (0, _react.useContext)(_ConfigContext.default),
|
|
33
33
|
getPrefixCls = _useContext.getPrefixCls,
|
|
34
34
|
prefixCls = _useContext.prefixCls,
|
|
35
|
-
userDefaultProps = _useContext.compDefaultProps
|
|
35
|
+
userDefaultProps = _useContext.compDefaultProps,
|
|
36
|
+
getCompLangMsg = _useContext.locale.getCompLangMsg;
|
|
36
37
|
var qrCodeProps = (0, _utils.getCompProps)('QRCode', userDefaultProps, props);
|
|
37
38
|
var value = qrCodeProps.value,
|
|
38
39
|
size = qrCodeProps.size,
|
|
@@ -52,6 +53,9 @@ var QRCode = function QRCode(props) {
|
|
|
52
53
|
customPrefixcls = qrCodeProps.prefixCls;
|
|
53
54
|
var qrCodePrefixCls = getPrefixCls(prefixCls, 'qrcode', customPrefixcls);
|
|
54
55
|
var qrCodeClass = (0, _classnames.default)(qrCodePrefixCls, className, (0, _defineProperty2.default)({}, "".concat(qrCodePrefixCls, "-borderless"), !bordered));
|
|
56
|
+
var qrCodeLangMsg = getCompLangMsg({
|
|
57
|
+
componentName: 'QRCode'
|
|
58
|
+
});
|
|
55
59
|
var gap = 8;
|
|
56
60
|
var containerSize = size + gap * 2 + 2;
|
|
57
61
|
(0, _devwarning.default)(!value === false, 'QRCode', 'need to receive `value` props');
|
|
@@ -82,14 +86,14 @@ var QRCode = function QRCode(props) {
|
|
|
82
86
|
className: "".concat(qrCodePrefixCls, "-mask")
|
|
83
87
|
}, status === 'loading' && /*#__PURE__*/_react.default.createElement(_spin.default, null), status === 'expired' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", {
|
|
84
88
|
className: "".concat(qrCodePrefixCls, "-expired")
|
|
85
|
-
},
|
|
89
|
+
}, qrCodeLangMsg.qrCodeExpired), onRefresh && /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
86
90
|
icon: /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
87
91
|
type: "refresh"
|
|
88
92
|
}),
|
|
89
93
|
type: "text",
|
|
90
94
|
onClick: onRefresh,
|
|
91
95
|
size: "middle"
|
|
92
|
-
},
|
|
96
|
+
}, qrCodeLangMsg.clickRefresh))), type === 'canvas' ? /*#__PURE__*/_react.default.createElement(_qrcode.QRCodeCanvas, (0, _extends2.default)({}, codeProps)) : /*#__PURE__*/_react.default.createElement(_qrcode.QRCodeSVG, (0, _extends2.default)({}, codeProps)));
|
|
93
97
|
};
|
|
94
98
|
QRCode.displayName = 'QRCode';
|
|
95
99
|
var _default = QRCode;
|
|
@@ -21,12 +21,12 @@ var _ConfigContext = _interopRequireDefault(require("../config-provider/ConfigCo
|
|
|
21
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
23
|
var InternalSearchPanel = function InternalSearchPanel(props, ref) {
|
|
24
|
-
var _context4, _context5;
|
|
24
|
+
var _context4, _context5, _context6;
|
|
25
25
|
var thisSearchPanelRef = (0, _react.useRef)();
|
|
26
26
|
var searchPanelRef = ref || thisSearchPanelRef;
|
|
27
27
|
var tooltipRef = (0, _react.useRef)(null);
|
|
28
28
|
var _useContext = (0, _react.useContext)(_ConfigContext.default),
|
|
29
|
-
|
|
29
|
+
locale = _useContext.locale;
|
|
30
30
|
var prefixCls = props.prefixCls,
|
|
31
31
|
className = props.className,
|
|
32
32
|
style = props.style,
|
|
@@ -34,6 +34,9 @@ var InternalSearchPanel = function InternalSearchPanel(props, ref) {
|
|
|
34
34
|
suffix = props.suffix,
|
|
35
35
|
_props$panelSearch = props.panelSearch,
|
|
36
36
|
panelSearch = _props$panelSearch === void 0 ? {} : _props$panelSearch;
|
|
37
|
+
var searchLanMsg = locale.getCompLangMsg({
|
|
38
|
+
componentName: 'Search'
|
|
39
|
+
});
|
|
37
40
|
var panelTypes = panelSearch.panelTypes,
|
|
38
41
|
_panelSearch$panelRes = panelSearch.panelResult,
|
|
39
42
|
panelResult = _panelSearch$panelRes === void 0 ? [] : _panelSearch$panelRes,
|
|
@@ -111,6 +114,9 @@ var InternalSearchPanel = function InternalSearchPanel(props, ref) {
|
|
|
111
114
|
var rightContent = right || '';
|
|
112
115
|
return (0, _concat.default)(_context2 = "".concat(leftContent)).call(_context2, rightContent);
|
|
113
116
|
}, []);
|
|
117
|
+
var getMoreInputValue = locale.getLangMsg('Search', 'viewMoreResult', {
|
|
118
|
+
inputValue: inputValue
|
|
119
|
+
});
|
|
114
120
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
115
121
|
ref: searchPanelRef,
|
|
116
122
|
className: searchPanelCls,
|
|
@@ -144,7 +150,7 @@ var InternalSearchPanel = function InternalSearchPanel(props, ref) {
|
|
|
144
150
|
}, /*#__PURE__*/_react.default.createElement(_index.Icon, {
|
|
145
151
|
type: "arrow-down"
|
|
146
152
|
}))))), /*#__PURE__*/_react.default.createElement(_index.Input, {
|
|
147
|
-
placeholder: placeholder || getLangMsg('Search', 'placeholder'),
|
|
153
|
+
placeholder: placeholder || locale.getLangMsg('Search', 'placeholder'),
|
|
148
154
|
borderType: "none",
|
|
149
155
|
allowClear: true,
|
|
150
156
|
suffix: suffix,
|
|
@@ -227,9 +233,9 @@ var InternalSearchPanel = function InternalSearchPanel(props, ref) {
|
|
|
227
233
|
preview: false
|
|
228
234
|
}) : displayImg), /*#__PURE__*/_react.default.createElement("div", {
|
|
229
235
|
className: "".concat(prefixCls, "-panel-dropDown-summary-title")
|
|
230
|
-
}, result.id === 'search' ?
|
|
236
|
+
}, result.id === 'search' ? getMoreInputValue : result.title), result.id === 'search' ? /*#__PURE__*/_react.default.createElement("div", {
|
|
231
237
|
className: "".concat(prefixCls, "-panel-dropDown-summary-list")
|
|
232
|
-
}, "
|
|
238
|
+
}, (0, _concat.default)(_context5 = "".concat(searchLanMsg.range, ": ")).call(_context5, type.label)) : (0, _map.default)(_context6 = (0, _keys.default)(displayList)).call(_context6, function (item, index) {
|
|
233
239
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
234
240
|
key: index,
|
|
235
241
|
className: "".concat(prefixCls, "-panel-dropDown-summary-list")
|