@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
package/es/_utils/hooks.js
CHANGED
|
@@ -177,7 +177,7 @@ export function useResizeObserver(element, handler) {
|
|
|
177
177
|
element = element();
|
|
178
178
|
}
|
|
179
179
|
if (!element) {
|
|
180
|
-
devWarning(!element && element !== null, 'useResizeMeasure', 'useResizeMeasure
|
|
180
|
+
devWarning(!element && element !== null, 'useResizeMeasure', 'Specified element for useResizeMeasure does not exist');
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
183
|
var measure = function measure(entries) {
|
|
@@ -22,8 +22,11 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
22
22
|
getPrefixCls = _useContext.getPrefixCls,
|
|
23
23
|
prefixCls = _useContext.prefixCls,
|
|
24
24
|
userDefaultProps = _useContext.compDefaultProps,
|
|
25
|
-
|
|
25
|
+
locale = _useContext.locale;
|
|
26
26
|
var advancedSelectortProps = getCompProps('BaseData', userDefaultProps, props);
|
|
27
|
+
var baseDataLangMsg = locale.getCompLangMsg({
|
|
28
|
+
componentName: 'BaseData'
|
|
29
|
+
});
|
|
27
30
|
var customPrefixcls = advancedSelectortProps.prefixCls,
|
|
28
31
|
className = advancedSelectortProps.className,
|
|
29
32
|
mode = advancedSelectortProps.mode,
|
|
@@ -31,7 +34,7 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
31
34
|
_advancedSelectortPro = advancedSelectortProps.delimiter,
|
|
32
35
|
delimiter = _advancedSelectortPro === void 0 ? ',' : _advancedSelectortPro,
|
|
33
36
|
_advancedSelectortPro2 = advancedSelectortProps.placeholder,
|
|
34
|
-
placeholder = _advancedSelectortPro2 === void 0 ? getLangMsg('global', 'selectholder') : _advancedSelectortPro2,
|
|
37
|
+
placeholder = _advancedSelectortPro2 === void 0 ? locale.getLangMsg('global', 'selectholder') : _advancedSelectortPro2,
|
|
35
38
|
showDetailIcon = advancedSelectortProps.showDetailIcon,
|
|
36
39
|
showFrequent = advancedSelectortProps.showFrequent,
|
|
37
40
|
showCollectIcon = advancedSelectortProps.showCollectIcon,
|
|
@@ -451,6 +454,9 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
451
454
|
}, [onCollect]);
|
|
452
455
|
var isShowDetailBtn = showDetailIcon && !isMultiple && !isFocused;
|
|
453
456
|
var renderAdvancedSelector = function renderAdvancedSelector() {
|
|
457
|
+
var totalText = locale.getLangMsg('BaseData', 'total', {
|
|
458
|
+
total: seletedOptions.length
|
|
459
|
+
});
|
|
454
460
|
return /*#__PURE__*/React.createElement("div", {
|
|
455
461
|
className: advancedSelectorCls,
|
|
456
462
|
ref: advancedSelectorRef,
|
|
@@ -468,7 +474,7 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
468
474
|
}), showTotal && !isFocused && isMultiple && /*#__PURE__*/React.createElement("span", {
|
|
469
475
|
className: "".concat(advancedSelectorfixCls, "-total"),
|
|
470
476
|
onClick: showInputTotal
|
|
471
|
-
},
|
|
477
|
+
}, totalText), isShowDetailBtn && !disabled && /*#__PURE__*/React.createElement("span", {
|
|
472
478
|
className: "".concat(advancedSelectorfixCls, "-detail"),
|
|
473
479
|
onClick: handleShowDetail
|
|
474
480
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -639,10 +645,10 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
639
645
|
defaultActiveKey: "history"
|
|
640
646
|
}, /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
641
647
|
key: "history",
|
|
642
|
-
tab:
|
|
648
|
+
tab: baseDataLangMsg.history
|
|
643
649
|
}, renderDropdownContent(historyList, columns)), /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
644
650
|
key: "collect",
|
|
645
|
-
tab:
|
|
651
|
+
tab: baseDataLangMsg.favorites
|
|
646
652
|
}, renderDropdownContent(collectList, columns)));
|
|
647
653
|
};
|
|
648
654
|
var renderNotContent = useCallback(function () {
|
package/es/carousel/carousel.js
CHANGED
|
@@ -104,7 +104,7 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
104
104
|
var element = carouselRef.current;
|
|
105
105
|
var handler = reSize;
|
|
106
106
|
if (!element) {
|
|
107
|
-
devWarning(!element && element !== null, 'useResizeMeasure', 'useResizeMeasure
|
|
107
|
+
devWarning(!element && element !== null, 'useResizeMeasure', 'Specified element for useResizeMeasure does not exist');
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
110
|
var measure = function measure(entries) {
|
package/es/cascader/cascader.js
CHANGED
|
@@ -56,7 +56,8 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
56
56
|
var _React$useContext = React.useContext(ConfigContext),
|
|
57
57
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
58
58
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
59
|
-
userDefaultProps = _React$useContext.compDefaultProps
|
|
59
|
+
userDefaultProps = _React$useContext.compDefaultProps,
|
|
60
|
+
locale = _React$useContext.locale;
|
|
60
61
|
// 属性需要合并一遍用户定义的默认属性
|
|
61
62
|
var allProps = getCompProps('Cascader', userDefaultProps, props);
|
|
62
63
|
var mode = allProps.mode,
|
|
@@ -69,7 +70,8 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
69
70
|
clearIcon = allProps.clearIcon,
|
|
70
71
|
className = allProps.className,
|
|
71
72
|
fieldNames = allProps.fieldNames,
|
|
72
|
-
placeholder = allProps.placeholder,
|
|
73
|
+
_allProps$placeholder = allProps.placeholder,
|
|
74
|
+
placeholder = _allProps$placeholder === void 0 ? locale.getLangMsg('global', 'selectholder') : _allProps$placeholder,
|
|
73
75
|
defaultValue = allProps.defaultValue,
|
|
74
76
|
maxTagPlaceholder = allProps.maxTagPlaceholder,
|
|
75
77
|
displayRender = allProps.displayRender,
|
|
@@ -307,6 +309,9 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
307
309
|
margin: '2px 8px 2px 0',
|
|
308
310
|
maxWidth: '100%'
|
|
309
311
|
};
|
|
312
|
+
var totalText = locale.getLangMsg('Cascader', 'total', {
|
|
313
|
+
total: currentOptions.length
|
|
314
|
+
});
|
|
310
315
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
311
316
|
className: multipleCls,
|
|
312
317
|
ref: mergeRef,
|
|
@@ -333,7 +338,7 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
333
338
|
className: itemCls
|
|
334
339
|
}, /*#__PURE__*/React.createElement("span", {
|
|
335
340
|
className: "".concat(prefixCls, "-tag-describe-content")
|
|
336
|
-
},
|
|
341
|
+
}, totalText)) : null) : null, /*#__PURE__*/React.createElement("span", {
|
|
337
342
|
className: "".concat(prefixCls, "-placeholder")
|
|
338
343
|
}, !currentOptions.length ? placeholder : null)), /*#__PURE__*/React.createElement("span", {
|
|
339
344
|
ref: suffixRef,
|
|
@@ -59,7 +59,8 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
59
59
|
clearIcon = selectProps.clearIcon,
|
|
60
60
|
loading = selectProps.loading,
|
|
61
61
|
showDescription = selectProps.showDescription,
|
|
62
|
-
|
|
62
|
+
_selectProps$descript = selectProps.description,
|
|
63
|
+
description = _selectProps$descript === void 0 ? cityPickerLangMsg.title : _selectProps$descript,
|
|
63
64
|
optionHighlightProps = selectProps.optionHighlightProps,
|
|
64
65
|
_selectProps$popperSt = selectProps.popperStyle,
|
|
65
66
|
popperStyle = _selectProps$popperSt === void 0 ? {} : _selectProps$popperSt,
|
package/es/collapse/collapse.js
CHANGED
|
@@ -85,7 +85,7 @@ var InternalCollapse = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
85
85
|
return _mapInstanceProperty(_context2 = React.Children).call(_context2, children, function (item) {
|
|
86
86
|
var _a;
|
|
87
87
|
if (((_a = item === null || item === void 0 ? void 0 : item.type) === null || _a === void 0 ? void 0 : _a.displayName) !== 'Panel') {
|
|
88
|
-
devwarning(true, 'Collapse', 'children
|
|
88
|
+
devwarning(true, 'Collapse', 'children must be Collapse.Panel');
|
|
89
89
|
return item;
|
|
90
90
|
}
|
|
91
91
|
return /*#__PURE__*/React.cloneElement(item, _extends({
|
|
@@ -162,7 +162,6 @@ declare const compDefaultProps: {
|
|
|
162
162
|
mode: string;
|
|
163
163
|
defaultOpen: boolean;
|
|
164
164
|
showArrow: boolean;
|
|
165
|
-
placeholder: string;
|
|
166
165
|
filterOption: boolean;
|
|
167
166
|
optionLabelProp: string;
|
|
168
167
|
optionFilterProp: string;
|
|
@@ -400,7 +399,6 @@ declare const compDefaultProps: {
|
|
|
400
399
|
dragMode: string;
|
|
401
400
|
viewMode: number;
|
|
402
401
|
aspectRatio: number;
|
|
403
|
-
okText: string;
|
|
404
402
|
autoCropArea: number;
|
|
405
403
|
};
|
|
406
404
|
Anchor: {
|
|
@@ -451,7 +449,6 @@ declare const compDefaultProps: {
|
|
|
451
449
|
mode: string;
|
|
452
450
|
defaultOpen: boolean;
|
|
453
451
|
showArrow: boolean;
|
|
454
|
-
placeholder: string;
|
|
455
452
|
optionLabelProp: string;
|
|
456
453
|
treeNodeFilterProp: string;
|
|
457
454
|
treeExpandOnClickNode: boolean;
|
|
@@ -470,7 +467,6 @@ declare const compDefaultProps: {
|
|
|
470
467
|
defaultOpen: boolean;
|
|
471
468
|
showArrow: boolean;
|
|
472
469
|
placeholder: string;
|
|
473
|
-
description: string;
|
|
474
470
|
showDescription: boolean;
|
|
475
471
|
optionHighlightProps: string;
|
|
476
472
|
allowClear: boolean;
|
|
@@ -74,7 +74,7 @@ var compDefaultProps = {
|
|
|
74
74
|
defaultOpen: false,
|
|
75
75
|
functionalColorName: '#themeColor',
|
|
76
76
|
switchName: {
|
|
77
|
-
name: '
|
|
77
|
+
name: '',
|
|
78
78
|
internationalName: 'followFunctionalColor'
|
|
79
79
|
},
|
|
80
80
|
placeholder: '#',
|
|
@@ -167,7 +167,6 @@ var compDefaultProps = {
|
|
|
167
167
|
mode: 'single',
|
|
168
168
|
defaultOpen: false,
|
|
169
169
|
showArrow: true,
|
|
170
|
-
placeholder: '请输入需要搜索的内容',
|
|
171
170
|
filterOption: true,
|
|
172
171
|
optionLabelProp: 'children',
|
|
173
172
|
optionFilterProp: 'label'
|
|
@@ -414,7 +413,6 @@ var compDefaultProps = {
|
|
|
414
413
|
dragMode: 'crop',
|
|
415
414
|
viewMode: 0,
|
|
416
415
|
aspectRatio: NaN,
|
|
417
|
-
okText: '确认裁剪',
|
|
418
416
|
autoCropArea: 0.5
|
|
419
417
|
},
|
|
420
418
|
Anchor: {
|
|
@@ -465,7 +463,6 @@ var compDefaultProps = {
|
|
|
465
463
|
mode: 'single',
|
|
466
464
|
defaultOpen: false,
|
|
467
465
|
showArrow: true,
|
|
468
|
-
placeholder: '请输入需要搜索的内容',
|
|
469
466
|
optionLabelProp: 'title',
|
|
470
467
|
treeNodeFilterProp: 'title',
|
|
471
468
|
treeExpandOnClickNode: true,
|
|
@@ -488,7 +485,6 @@ var compDefaultProps = {
|
|
|
488
485
|
defaultOpen: false,
|
|
489
486
|
showArrow: true,
|
|
490
487
|
placeholder: '',
|
|
491
|
-
description: '城市',
|
|
492
488
|
showDescription: true,
|
|
493
489
|
optionHighlightProps: 'highlightText',
|
|
494
490
|
allowClear: true
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { PickerMode, SharedTimeProps } from './interface';
|
|
3
3
|
import { RangeShowTimeObject } from './range-picker';
|
|
4
|
+
import { DisabledDataProps } from './date-picker';
|
|
4
5
|
export interface CalendarProps {
|
|
5
6
|
picker: PickerMode;
|
|
6
7
|
useWeekdaysShort?: boolean;
|
|
7
8
|
showWeekNumber?: boolean;
|
|
8
9
|
showWeeksTitle?: boolean;
|
|
9
10
|
showTime?: boolean | SharedTimeProps | RangeShowTimeObject;
|
|
10
|
-
disabledDate?:
|
|
11
|
+
disabledDate?: DisabledDataProps;
|
|
11
12
|
}
|
|
12
13
|
declare function Calendar(props: CalendarProps): JSX.Element;
|
|
13
14
|
export default Calendar;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DateRender, PanelMode, CellRender, OnPanelChange, PickerMode, SharedTimeProps, DateType, DisabledTime, InnerLocale, Components } from './interface';
|
|
3
|
+
import { DisabledDataProps } from './date-picker';
|
|
3
4
|
export interface PickerPanelSharedProps {
|
|
4
5
|
prefixCls?: string;
|
|
5
6
|
className?: string;
|
|
@@ -20,7 +21,7 @@ export interface PickerPanelSharedProps {
|
|
|
20
21
|
useWeekdaysShort?: boolean;
|
|
21
22
|
showWeekNumber?: boolean;
|
|
22
23
|
showWeeksTitle?: boolean;
|
|
23
|
-
disabledDate?:
|
|
24
|
+
disabledDate?: DisabledDataProps;
|
|
24
25
|
dateRender?: DateRender;
|
|
25
26
|
monthCellRender?: CellRender;
|
|
26
27
|
renderExtraFooter?: (mode: PanelMode) => React.ReactNode;
|
|
@@ -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)[];
|
|
@@ -24,7 +24,8 @@ export default function useRangeDisabled(_ref, disabledStart, disabledEnd) {
|
|
|
24
24
|
return year * 10 + quarter;
|
|
25
25
|
}
|
|
26
26
|
var disabledStartDate = React.useCallback(function (date) {
|
|
27
|
-
|
|
27
|
+
var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
28
|
+
if (disabledDate && disabledDate(date, info)) {
|
|
28
29
|
return true;
|
|
29
30
|
}
|
|
30
31
|
if (disabled[1] && endDate) {
|
|
@@ -47,7 +48,8 @@ export default function useRangeDisabled(_ref, disabledStart, disabledEnd) {
|
|
|
47
48
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
49
|
[disabledDate, disabled[1], endDate, disabledStart]);
|
|
49
50
|
var disabledEndDate = React.useCallback(function (date) {
|
|
50
|
-
|
|
51
|
+
var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
52
|
+
if (disabledDate && disabledDate(date, info)) {
|
|
51
53
|
return true;
|
|
52
54
|
}
|
|
53
55
|
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;
|
|
@@ -23,6 +23,10 @@ function Month(props) {
|
|
|
23
23
|
setInnerPicker = context.setInnerPicker,
|
|
24
24
|
cellRender = context.cellRender,
|
|
25
25
|
range = context.range;
|
|
26
|
+
var disabledInfo = {
|
|
27
|
+
panelType: 'month',
|
|
28
|
+
range: range
|
|
29
|
+
};
|
|
26
30
|
var disabledDate = props.disabledDate;
|
|
27
31
|
var _dateValue;
|
|
28
32
|
if (panelPosition) {
|
|
@@ -79,7 +83,7 @@ function Month(props) {
|
|
|
79
83
|
});
|
|
80
84
|
var handleClick = function handleClick(date) {
|
|
81
85
|
if (innerPicker === undefined) {
|
|
82
|
-
if (!(disabledDate && disabledDate(date))) {
|
|
86
|
+
if (!(disabledDate && disabledDate(date, disabledInfo))) {
|
|
83
87
|
onSelect(date, 'mouse');
|
|
84
88
|
}
|
|
85
89
|
} else {
|
|
@@ -103,7 +107,7 @@ function Month(props) {
|
|
|
103
107
|
return handleClick(month);
|
|
104
108
|
},
|
|
105
109
|
onMouseEnter: function onMouseEnter() {
|
|
106
|
-
if (onDateMouseEnter && !(disabledDate && disabledDate(month))) {
|
|
110
|
+
if (onDateMouseEnter && !(disabledDate && disabledDate(month, disabledInfo))) {
|
|
107
111
|
onDateMouseEnter(month);
|
|
108
112
|
}
|
|
109
113
|
},
|
|
@@ -113,7 +117,7 @@ function Month(props) {
|
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
119
|
};
|
|
116
|
-
var monthItemCls = classnames("".concat(prefixCls, "-month-item"), _defineProperty({}, "".concat(prefixCls, "-month-item-disabled"), disabledDate && disabledDate(month)), getRangeCls(month));
|
|
120
|
+
var monthItemCls = classnames("".concat(prefixCls, "-month-item"), _defineProperty({}, "".concat(prefixCls, "-month-item-disabled"), disabledDate && disabledDate(month, disabledInfo)), getRangeCls(month));
|
|
117
121
|
var originNode = /*#__PURE__*/React.createElement("span", {
|
|
118
122
|
className: getMonthClassNames(m)
|
|
119
123
|
}, "".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;
|
|
@@ -20,6 +20,10 @@ function Quarter(props) {
|
|
|
20
20
|
hoverRangedValue = context.hoverRangedValue,
|
|
21
21
|
cellRender = context.cellRender,
|
|
22
22
|
range = context.range;
|
|
23
|
+
var disabledInfo = {
|
|
24
|
+
panelType: 'quarter',
|
|
25
|
+
range: range
|
|
26
|
+
};
|
|
23
27
|
var disabledDate = props.disabledDate;
|
|
24
28
|
var _dateValue;
|
|
25
29
|
if (panelPosition) {
|
|
@@ -75,7 +79,7 @@ function Quarter(props) {
|
|
|
75
79
|
}
|
|
76
80
|
});
|
|
77
81
|
var handleClick = function handleClick(date) {
|
|
78
|
-
if (!(disabledDate && disabledDate(date))) {
|
|
82
|
+
if (!(disabledDate && disabledDate(date, disabledInfo))) {
|
|
79
83
|
onSelect(date, 'mouse');
|
|
80
84
|
}
|
|
81
85
|
};
|
|
@@ -87,7 +91,7 @@ function Quarter(props) {
|
|
|
87
91
|
return handleClick(quarter);
|
|
88
92
|
},
|
|
89
93
|
onMouseEnter: function onMouseEnter() {
|
|
90
|
-
if (onDateMouseEnter && !(disabledDate && disabledDate(quarter))) {
|
|
94
|
+
if (onDateMouseEnter && !(disabledDate && disabledDate(quarter, disabledInfo))) {
|
|
91
95
|
onDateMouseEnter(quarter);
|
|
92
96
|
}
|
|
93
97
|
},
|
|
@@ -97,7 +101,7 @@ function Quarter(props) {
|
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
103
|
};
|
|
100
|
-
var quarterCls = classnames("".concat(prefixCls, "-quarter-item"), _defineProperty({}, "".concat(prefixCls, "-quarter-item-disabled"), disabledDate && disabledDate(quarter)), getRangeCls(quarter));
|
|
104
|
+
var quarterCls = classnames("".concat(prefixCls, "-quarter-item"), _defineProperty({}, "".concat(prefixCls, "-quarter-item-disabled"), disabledDate && disabledDate(quarter, disabledInfo)), getRangeCls(quarter));
|
|
101
105
|
var originNode = /*#__PURE__*/React.createElement("div", _extends({
|
|
102
106
|
className: getQuarterClassNames(i + 1)
|
|
103
107
|
}, _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;
|
|
@@ -21,6 +21,10 @@ function Year(props) {
|
|
|
21
21
|
setInnerPicker = context.setInnerPicker,
|
|
22
22
|
cellRender = context.cellRender,
|
|
23
23
|
range = context.range;
|
|
24
|
+
var disabledInfo = {
|
|
25
|
+
panelType: 'year',
|
|
26
|
+
range: range
|
|
27
|
+
};
|
|
24
28
|
var yearItemNumber = props.yearItemNumber,
|
|
25
29
|
disabledDate = props.disabledDate,
|
|
26
30
|
_props$picker = props.picker,
|
|
@@ -80,7 +84,7 @@ function Year(props) {
|
|
|
80
84
|
});
|
|
81
85
|
var handleClick = function handleClick(date) {
|
|
82
86
|
if (innerPicker === undefined) {
|
|
83
|
-
if (!(disabledDate && disabledDate(date))) {
|
|
87
|
+
if (!(disabledDate && disabledDate(date, disabledInfo))) {
|
|
84
88
|
onSelect(date, 'mouse');
|
|
85
89
|
}
|
|
86
90
|
} else {
|
|
@@ -106,7 +110,7 @@ function Year(props) {
|
|
|
106
110
|
return handleClick(year);
|
|
107
111
|
},
|
|
108
112
|
onMouseEnter: function onMouseEnter() {
|
|
109
|
-
if (onDateMouseEnter && !(disabledDate && disabledDate(year))) {
|
|
113
|
+
if (onDateMouseEnter && !(disabledDate && disabledDate(year, disabledInfo))) {
|
|
110
114
|
onDateMouseEnter(year);
|
|
111
115
|
}
|
|
112
116
|
},
|
|
@@ -120,7 +124,7 @@ function Year(props) {
|
|
|
120
124
|
className: getYearClassNames(y)
|
|
121
125
|
}, y);
|
|
122
126
|
yearsList.push( /*#__PURE__*/React.createElement("div", _extends({
|
|
123
|
-
className: classnames("".concat(prefixCls, "-year-item"), _defineProperty({}, "".concat(prefixCls, "-year-item-disabled"), disabledDate && disabledDate(year)), getRangeCls(year)),
|
|
127
|
+
className: classnames("".concat(prefixCls, "-year-item"), _defineProperty({}, "".concat(prefixCls, "-year-item-disabled"), disabledDate && disabledDate(year, disabledInfo)), getRangeCls(year)),
|
|
124
128
|
key: y
|
|
125
129
|
}, _props), typeof cellRender === 'function' ? cellRender(y, {
|
|
126
130
|
originNode: originNode,
|
|
@@ -465,7 +465,9 @@ var InternalRangePicker = function InternalRangePicker(props, ref) {
|
|
|
465
465
|
prefixCls: datePickerPrefixCls,
|
|
466
466
|
components: components,
|
|
467
467
|
needConfirmButton: needConfirmButton,
|
|
468
|
-
okDisabled: !getValue(selectedValue, mergedActivePickerIndex) || !!(selectedValue && selectedValue[mergedActivePickerIndex] && disabledDate && disabledDate(selectedValue[mergedActivePickerIndex]
|
|
468
|
+
okDisabled: !getValue(selectedValue, mergedActivePickerIndex) || !!(selectedValue && selectedValue[mergedActivePickerIndex] && disabledDate && disabledDate(selectedValue[mergedActivePickerIndex], {
|
|
469
|
+
range: mergedActivePickerIndex === 0 ? 'start' : 'end'
|
|
470
|
+
})),
|
|
469
471
|
locale: datePickerLang,
|
|
470
472
|
// rangeList,
|
|
471
473
|
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/es/image/preview.js
CHANGED
|
@@ -16,9 +16,13 @@ var Preview = function Preview(props) {
|
|
|
16
16
|
var _React$useContext = React.useContext(ConfigContext),
|
|
17
17
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
18
18
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
19
|
-
userDefaultProps = _React$useContext.compDefaultProps
|
|
19
|
+
userDefaultProps = _React$useContext.compDefaultProps,
|
|
20
|
+
locale = _React$useContext.locale;
|
|
20
21
|
// 属性需要合并一遍用户定义的默认属性
|
|
21
22
|
var allProps = getCompProps('Image', userDefaultProps, props);
|
|
23
|
+
var imageLangMsg = locale.getCompLangMsg({
|
|
24
|
+
componentName: 'Image'
|
|
25
|
+
});
|
|
22
26
|
var src = allProps.src,
|
|
23
27
|
alt = allProps.alt,
|
|
24
28
|
name = allProps.name,
|
|
@@ -185,7 +189,7 @@ var Preview = function Preview(props) {
|
|
|
185
189
|
onClick: onClose
|
|
186
190
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
187
191
|
type: "close-solid"
|
|
188
|
-
}),
|
|
192
|
+
}), imageLangMsg.close))));
|
|
189
193
|
return /*#__PURE__*/ReactDOM.createPortal(peviewContainer, document.body);
|
|
190
194
|
};
|
|
191
195
|
export default Preview;
|
|
@@ -55,7 +55,8 @@ var InternalImageCropper = function InternalImageCropper(props, forwardedRef) {
|
|
|
55
55
|
var _React$useContext = React.useContext(ConfigContext),
|
|
56
56
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
57
57
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
58
|
-
userDefaultProps = _React$useContext.compDefaultProps
|
|
58
|
+
userDefaultProps = _React$useContext.compDefaultProps,
|
|
59
|
+
locale = _React$useContext.locale;
|
|
59
60
|
var _a = getCompProps('ImageCropper', userDefaultProps, props),
|
|
60
61
|
customPrefixcls = _a.prefixCls,
|
|
61
62
|
containerWidth = _a.containerWidth,
|
|
@@ -69,7 +70,8 @@ var InternalImageCropper = function InternalImageCropper(props, forwardedRef) {
|
|
|
69
70
|
viewMode = _a.viewMode,
|
|
70
71
|
aspectRatio = _a.aspectRatio,
|
|
71
72
|
modal = _a.modal,
|
|
72
|
-
okText = _a.okText,
|
|
73
|
+
_a$okText = _a.okText,
|
|
74
|
+
okText = _a$okText === void 0 ? locale.getLangMsg('ImageCropper', 'okText') : _a$okText,
|
|
73
75
|
okBtn = _a.okBtn,
|
|
74
76
|
_a$image = _a.image,
|
|
75
77
|
image = _a$image === void 0 ? '' : _a$image,
|
|
@@ -196,7 +196,7 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
196
196
|
var _a, _b;
|
|
197
197
|
var step = stepOption.step === undefined ? 1 : parseFloat(stepOption.step);
|
|
198
198
|
if (typeof step !== 'number') {
|
|
199
|
-
devWarning(true, 'inputNumber', "stepOption.step
|
|
199
|
+
devWarning(true, 'inputNumber', "stepOption.step must be a number.");
|
|
200
200
|
return false;
|
|
201
201
|
}
|
|
202
202
|
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/es/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/es/locale/locale.js
CHANGED
|
@@ -28,7 +28,7 @@ var LocaleCache = /*#__PURE__*/function () {
|
|
|
28
28
|
key: "setLocalesData",
|
|
29
29
|
value: function setLocalesData(locale, localeData) {
|
|
30
30
|
if (!(localeData || this.localesData[locale])) {
|
|
31
|
-
console.error("
|
|
31
|
+
console.error("Missing language pack for ".concat(locale, ". Please check and reconfigure."));
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
var newLocaleData = _extends(_extends({}, zhCNData), localeData);
|