@kdcloudjs/kdesign 1.6.10 → 1.6.12
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/CHANGELOG.md +27 -0
- package/dist/kdesign.css +1 -1
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +35 -19
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +1 -1
- package/dist/kdesign.min.js +3 -3
- package/dist/kdesign.min.js.map +1 -1
- package/es/date-picker/date-picker.d.ts +1 -1
- package/es/date-picker/date-picker.js +5 -3
- package/es/date-picker/range-picker.d.ts +2 -2
- package/es/date-picker/range-picker.js +6 -4
- package/es/select/interface.d.ts +1 -0
- package/es/select/select.js +14 -5
- package/es/slider/slider.d.ts +1 -0
- package/es/slider/slider.js +4 -2
- package/es/slider/sliderTooltip.js +1 -0
- package/lib/date-picker/date-picker.d.ts +1 -1
- package/lib/date-picker/date-picker.js +6 -3
- package/lib/date-picker/range-picker.d.ts +2 -2
- package/lib/date-picker/range-picker.js +7 -4
- package/lib/select/interface.d.ts +1 -0
- package/lib/select/select.js +14 -5
- package/lib/slider/slider.d.ts +1 -0
- package/lib/slider/slider.js +4 -2
- package/lib/slider/sliderTooltip.js +1 -0
- package/package.json +1 -1
|
@@ -47,5 +47,5 @@ export interface PickerTimeProps extends PickerSharedProps, Omit<OmitPanelProps<
|
|
|
47
47
|
defaultOpenValue?: DateType;
|
|
48
48
|
}
|
|
49
49
|
export declare type PickerProps = PickerBaseProps | PickerDateProps | PickerTimeProps;
|
|
50
|
-
declare
|
|
50
|
+
declare const DatePicker: React.ForwardRefExoticComponent<(Partial<PickerBaseProps> & React.RefAttributes<unknown>) | (Partial<PickerDateProps> & React.RefAttributes<unknown>) | (Partial<PickerTimeProps> & React.RefAttributes<unknown>)>;
|
|
51
51
|
export default DatePicker;
|
|
@@ -18,7 +18,7 @@ import getExtraFooter from './utils/get-extra-footer';
|
|
|
18
18
|
import getRanges from './utils/get-ranges';
|
|
19
19
|
import usePopper from '../_utils/usePopper';
|
|
20
20
|
|
|
21
|
-
function
|
|
21
|
+
var InternalDatePicker = function InternalDatePicker(props, ref) {
|
|
22
22
|
var customPrefixcls = props.prefixCls;
|
|
23
23
|
|
|
24
24
|
var _useContext = useContext(ConfigContext),
|
|
@@ -85,7 +85,7 @@ function DatePicker(props) {
|
|
|
85
85
|
_onOk = datePickerProps.onOk; // ref
|
|
86
86
|
|
|
87
87
|
var panelDivRef = React.useRef(null);
|
|
88
|
-
var inputDivRef = React.
|
|
88
|
+
var inputDivRef = ref || /*#__PURE__*/React.createRef();
|
|
89
89
|
var popperRef = React.useRef(null);
|
|
90
90
|
var inputRef = React.useRef(null);
|
|
91
91
|
var isHourStepValid = 24 % hourStep === 0;
|
|
@@ -439,6 +439,8 @@ function DatePicker(props) {
|
|
|
439
439
|
placement: 'bottomLeft',
|
|
440
440
|
getPopupContainer: getPopupContainer
|
|
441
441
|
});
|
|
442
|
-
}
|
|
442
|
+
};
|
|
443
443
|
|
|
444
|
+
var DatePicker = /*#__PURE__*/React.forwardRef(InternalDatePicker);
|
|
445
|
+
DatePicker.displayName = 'DatePicker';
|
|
444
446
|
export default DatePicker;
|
|
@@ -47,5 +47,5 @@ export declare type RangeArray = {
|
|
|
47
47
|
key: string;
|
|
48
48
|
newValue: RangeValue;
|
|
49
49
|
}[];
|
|
50
|
-
declare
|
|
51
|
-
export default
|
|
50
|
+
declare const RangePicker: React.ForwardRefExoticComponent<(Partial<RangePickerBaseProps> & React.RefAttributes<unknown>) | (Partial<RangePickerDateProps> & React.RefAttributes<unknown>) | (Partial<RangePickerTimeProps> & React.RefAttributes<unknown>)>;
|
|
51
|
+
export default RangePicker;
|
|
@@ -59,7 +59,7 @@ function canValueTrigger(value, index, disabled, allowEmpty) {
|
|
|
59
59
|
return false;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
function
|
|
62
|
+
var InternalRangePicker = function InternalRangePicker(props, ref) {
|
|
63
63
|
var customPrefixcls = props.prefixCls;
|
|
64
64
|
|
|
65
65
|
var _useContext = useContext(ConfigContext),
|
|
@@ -123,7 +123,7 @@ function DatePicker(props) {
|
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
var panelDivRef = React.useRef(null);
|
|
126
|
-
var inputDivRef = React.
|
|
126
|
+
var inputDivRef = ref || /*#__PURE__*/React.createRef();
|
|
127
127
|
var startInputDivRef = React.useRef(null);
|
|
128
128
|
var endInputDivRef = React.useRef(null);
|
|
129
129
|
var separatorRef = React.useRef(null);
|
|
@@ -772,6 +772,8 @@ function DatePicker(props) {
|
|
|
772
772
|
placement: 'bottomLeft',
|
|
773
773
|
getPopupContainer: getPopupContainer
|
|
774
774
|
});
|
|
775
|
-
}
|
|
775
|
+
};
|
|
776
776
|
|
|
777
|
-
|
|
777
|
+
var RangePicker = /*#__PURE__*/React.forwardRef(InternalRangePicker);
|
|
778
|
+
RangePicker.displayName = 'RangePicker';
|
|
779
|
+
export default RangePicker;
|
package/es/select/interface.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export interface AbstractSelectProps extends PopperProps {
|
|
|
36
36
|
maxTagPlaceholder?: React.ReactNode | ((omittedValues: LabeledValue[]) => React.ReactNode);
|
|
37
37
|
filterOption?: boolean | ((inputValue: string, option?: OptionsType) => boolean);
|
|
38
38
|
optionFilterProp?: string;
|
|
39
|
+
optionLabelProp?: string;
|
|
39
40
|
}
|
|
40
41
|
export interface LabeledValue {
|
|
41
42
|
key?: string;
|
package/es/select/select.js
CHANGED
|
@@ -275,22 +275,26 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
275
275
|
var getOptionLabel = useCallback(function (obj) {
|
|
276
276
|
var _a;
|
|
277
277
|
|
|
278
|
+
var text = 'options' in selectProps ? 'label' : optionLabelProp;
|
|
279
|
+
|
|
278
280
|
if (obj.props) {
|
|
279
|
-
if (
|
|
280
|
-
return obj === null || obj === void 0 ? void 0 : obj.props[
|
|
281
|
+
if (text) {
|
|
282
|
+
return obj === null || obj === void 0 ? void 0 : obj.props[text];
|
|
281
283
|
}
|
|
282
284
|
|
|
283
285
|
return (_a = obj.props) === null || _a === void 0 ? void 0 : _a.children;
|
|
284
286
|
} else {
|
|
285
|
-
if (
|
|
286
|
-
return obj[
|
|
287
|
+
if (text) {
|
|
288
|
+
return obj[text];
|
|
287
289
|
}
|
|
288
290
|
}
|
|
289
291
|
|
|
290
292
|
return obj === null || obj === void 0 ? void 0 : obj.label;
|
|
291
|
-
}, [optionLabelProp]); // 点击下拉列表中某项回调
|
|
293
|
+
}, [optionLabelProp, selectProps]); // 点击下拉列表中某项回调
|
|
292
294
|
|
|
293
295
|
var handleOption = function handleOption(key, label, isSelected) {
|
|
296
|
+
var _a;
|
|
297
|
+
|
|
294
298
|
var onSelect = selectProps.onSelect,
|
|
295
299
|
onDeselect = selectProps.onDeselect,
|
|
296
300
|
labelInValue = selectProps.labelInValue,
|
|
@@ -304,6 +308,11 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
304
308
|
return (child === null || child === void 0 ? void 0 : child.value) === key;
|
|
305
309
|
}
|
|
306
310
|
})) || {};
|
|
311
|
+
|
|
312
|
+
if (isMultiple) {
|
|
313
|
+
(_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
314
|
+
}
|
|
315
|
+
|
|
307
316
|
var optionsObj = obj.props ? obj.props : obj || {};
|
|
308
317
|
|
|
309
318
|
if (value !== undefined) {
|
package/es/slider/slider.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export interface ISliderProps {
|
|
|
22
22
|
tooltipVisible?: boolean;
|
|
23
23
|
tooltipPlacemant?: PlacementType;
|
|
24
24
|
value?: number | number[];
|
|
25
|
+
getPopupContainer?: () => React.ReactNode;
|
|
25
26
|
vertical?: boolean;
|
|
26
27
|
onAfterChange?: (value?: number | number[]) => void;
|
|
27
28
|
onChange?: (value?: number | number[]) => void;
|
package/es/slider/slider.js
CHANGED
|
@@ -54,10 +54,11 @@ var InteranalSlider = function InteranalSlider(props, ref) {
|
|
|
54
54
|
tooltipVisible = sliderProps.tooltipVisible,
|
|
55
55
|
tooltipPlacement = sliderProps.tooltipPlacement,
|
|
56
56
|
propsValue = sliderProps.value,
|
|
57
|
+
getPopupContainer = sliderProps.getPopupContainer,
|
|
57
58
|
onAfterChange = sliderProps.onAfterChange,
|
|
58
59
|
onChange = sliderProps.onChange,
|
|
59
60
|
onBlur = sliderProps.onBlur,
|
|
60
|
-
others = __rest(sliderProps, ["className", "style", "prefixCls", "defaultValue", "disabled", "dots", "marks", "min", "max", "vertical", "reverse", "step", "tipFormatter", "tooltipVisible", "tooltipPlacement", "value", "onAfterChange", "onChange", "onBlur"]);
|
|
61
|
+
others = __rest(sliderProps, ["className", "style", "prefixCls", "defaultValue", "disabled", "dots", "marks", "min", "max", "vertical", "reverse", "step", "tipFormatter", "tooltipVisible", "tooltipPlacement", "value", "getPopupContainer", "onAfterChange", "onChange", "onBlur"]);
|
|
61
62
|
|
|
62
63
|
devWarning(className && className.indexOf('shit') > -1, 'slider', "slider className can't include '".concat(className, "'"));
|
|
63
64
|
var sliderPrefixCls = getPrefixCls(prefixCls, 'slider', customPrefixcls); // ref
|
|
@@ -274,7 +275,8 @@ var InteranalSlider = function InteranalSlider(props, ref) {
|
|
|
274
275
|
reverse: reverse,
|
|
275
276
|
min: min,
|
|
276
277
|
max: max,
|
|
277
|
-
bound: value
|
|
278
|
+
bound: value,
|
|
279
|
+
getPopupContainer: getPopupContainer
|
|
278
280
|
}), /*#__PURE__*/React.createElement(Marks, {
|
|
279
281
|
marks: marks,
|
|
280
282
|
prefixCls: sliderPrefixCls,
|
|
@@ -47,5 +47,5 @@ export interface PickerTimeProps extends PickerSharedProps, Omit<OmitPanelProps<
|
|
|
47
47
|
defaultOpenValue?: DateType;
|
|
48
48
|
}
|
|
49
49
|
export declare type PickerProps = PickerBaseProps | PickerDateProps | PickerTimeProps;
|
|
50
|
-
declare
|
|
50
|
+
declare const DatePicker: React.ForwardRefExoticComponent<(Partial<PickerBaseProps> & React.RefAttributes<unknown>) | (Partial<PickerDateProps> & React.RefAttributes<unknown>) | (Partial<PickerTimeProps> & React.RefAttributes<unknown>)>;
|
|
51
51
|
export default DatePicker;
|
|
@@ -55,7 +55,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "functi
|
|
|
55
55
|
|
|
56
56
|
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; }
|
|
57
57
|
|
|
58
|
-
function
|
|
58
|
+
var InternalDatePicker = function InternalDatePicker(props, ref) {
|
|
59
59
|
var customPrefixcls = props.prefixCls;
|
|
60
60
|
|
|
61
61
|
var _useContext = (0, _react.useContext)(_ConfigContext.default),
|
|
@@ -123,7 +123,7 @@ function DatePicker(props) {
|
|
|
123
123
|
|
|
124
124
|
var panelDivRef = _react.default.useRef(null);
|
|
125
125
|
|
|
126
|
-
var inputDivRef = _react.default.
|
|
126
|
+
var inputDivRef = ref || /*#__PURE__*/_react.default.createRef();
|
|
127
127
|
|
|
128
128
|
var popperRef = _react.default.useRef(null);
|
|
129
129
|
|
|
@@ -477,7 +477,10 @@ function DatePicker(props) {
|
|
|
477
477
|
placement: 'bottomLeft',
|
|
478
478
|
getPopupContainer: getPopupContainer
|
|
479
479
|
});
|
|
480
|
-
}
|
|
480
|
+
};
|
|
481
481
|
|
|
482
|
+
var DatePicker = /*#__PURE__*/_react.default.forwardRef(InternalDatePicker);
|
|
483
|
+
|
|
484
|
+
DatePicker.displayName = 'DatePicker';
|
|
482
485
|
var _default = DatePicker;
|
|
483
486
|
exports.default = _default;
|
|
@@ -47,5 +47,5 @@ export declare type RangeArray = {
|
|
|
47
47
|
key: string;
|
|
48
48
|
newValue: RangeValue;
|
|
49
49
|
}[];
|
|
50
|
-
declare
|
|
51
|
-
export default
|
|
50
|
+
declare const RangePicker: React.ForwardRefExoticComponent<(Partial<RangePickerBaseProps> & React.RefAttributes<unknown>) | (Partial<RangePickerDateProps> & React.RefAttributes<unknown>) | (Partial<RangePickerTimeProps> & React.RefAttributes<unknown>)>;
|
|
51
|
+
export default RangePicker;
|
|
@@ -103,7 +103,7 @@ function canValueTrigger(value, index, disabled, allowEmpty) {
|
|
|
103
103
|
return false;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
function
|
|
106
|
+
var InternalRangePicker = function InternalRangePicker(props, ref) {
|
|
107
107
|
var customPrefixcls = props.prefixCls;
|
|
108
108
|
|
|
109
109
|
var _useContext = (0, _react.useContext)(_ConfigContext.default),
|
|
@@ -166,7 +166,7 @@ function DatePicker(props) {
|
|
|
166
166
|
|
|
167
167
|
var panelDivRef = _react.default.useRef(null);
|
|
168
168
|
|
|
169
|
-
var inputDivRef = _react.default.
|
|
169
|
+
var inputDivRef = ref || /*#__PURE__*/_react.default.createRef();
|
|
170
170
|
|
|
171
171
|
var startInputDivRef = _react.default.useRef(null);
|
|
172
172
|
|
|
@@ -824,7 +824,10 @@ function DatePicker(props) {
|
|
|
824
824
|
placement: 'bottomLeft',
|
|
825
825
|
getPopupContainer: getPopupContainer
|
|
826
826
|
});
|
|
827
|
-
}
|
|
827
|
+
};
|
|
828
|
+
|
|
829
|
+
var RangePicker = /*#__PURE__*/_react.default.forwardRef(InternalRangePicker);
|
|
828
830
|
|
|
829
|
-
|
|
831
|
+
RangePicker.displayName = 'RangePicker';
|
|
832
|
+
var _default = RangePicker;
|
|
830
833
|
exports.default = _default;
|
|
@@ -36,6 +36,7 @@ export interface AbstractSelectProps extends PopperProps {
|
|
|
36
36
|
maxTagPlaceholder?: React.ReactNode | ((omittedValues: LabeledValue[]) => React.ReactNode);
|
|
37
37
|
filterOption?: boolean | ((inputValue: string, option?: OptionsType) => boolean);
|
|
38
38
|
optionFilterProp?: string;
|
|
39
|
+
optionLabelProp?: string;
|
|
39
40
|
}
|
|
40
41
|
export interface LabeledValue {
|
|
41
42
|
key?: string;
|
package/lib/select/select.js
CHANGED
|
@@ -313,22 +313,26 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
313
313
|
var getOptionLabel = (0, _react.useCallback)(function (obj) {
|
|
314
314
|
var _a;
|
|
315
315
|
|
|
316
|
+
var text = 'options' in selectProps ? 'label' : optionLabelProp;
|
|
317
|
+
|
|
316
318
|
if (obj.props) {
|
|
317
|
-
if (
|
|
318
|
-
return obj === null || obj === void 0 ? void 0 : obj.props[
|
|
319
|
+
if (text) {
|
|
320
|
+
return obj === null || obj === void 0 ? void 0 : obj.props[text];
|
|
319
321
|
}
|
|
320
322
|
|
|
321
323
|
return (_a = obj.props) === null || _a === void 0 ? void 0 : _a.children;
|
|
322
324
|
} else {
|
|
323
|
-
if (
|
|
324
|
-
return obj[
|
|
325
|
+
if (text) {
|
|
326
|
+
return obj[text];
|
|
325
327
|
}
|
|
326
328
|
}
|
|
327
329
|
|
|
328
330
|
return obj === null || obj === void 0 ? void 0 : obj.label;
|
|
329
|
-
}, [optionLabelProp]); // 点击下拉列表中某项回调
|
|
331
|
+
}, [optionLabelProp, selectProps]); // 点击下拉列表中某项回调
|
|
330
332
|
|
|
331
333
|
var handleOption = function handleOption(key, label, isSelected) {
|
|
334
|
+
var _a;
|
|
335
|
+
|
|
332
336
|
var onSelect = selectProps.onSelect,
|
|
333
337
|
onDeselect = selectProps.onDeselect,
|
|
334
338
|
labelInValue = selectProps.labelInValue,
|
|
@@ -342,6 +346,11 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
342
346
|
return (child === null || child === void 0 ? void 0 : child.value) === key;
|
|
343
347
|
}
|
|
344
348
|
})) || {};
|
|
349
|
+
|
|
350
|
+
if (isMultiple) {
|
|
351
|
+
(_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
352
|
+
}
|
|
353
|
+
|
|
345
354
|
var optionsObj = obj.props ? obj.props : obj || {};
|
|
346
355
|
|
|
347
356
|
if (value !== undefined) {
|
package/lib/slider/slider.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export interface ISliderProps {
|
|
|
22
22
|
tooltipVisible?: boolean;
|
|
23
23
|
tooltipPlacemant?: PlacementType;
|
|
24
24
|
value?: number | number[];
|
|
25
|
+
getPopupContainer?: () => React.ReactNode;
|
|
25
26
|
vertical?: boolean;
|
|
26
27
|
onAfterChange?: (value?: number | number[]) => void;
|
|
27
28
|
onChange?: (value?: number | number[]) => void;
|
package/lib/slider/slider.js
CHANGED
|
@@ -87,10 +87,11 @@ var InteranalSlider = function InteranalSlider(props, ref) {
|
|
|
87
87
|
tooltipVisible = sliderProps.tooltipVisible,
|
|
88
88
|
tooltipPlacement = sliderProps.tooltipPlacement,
|
|
89
89
|
propsValue = sliderProps.value,
|
|
90
|
+
getPopupContainer = sliderProps.getPopupContainer,
|
|
90
91
|
onAfterChange = sliderProps.onAfterChange,
|
|
91
92
|
onChange = sliderProps.onChange,
|
|
92
93
|
onBlur = sliderProps.onBlur,
|
|
93
|
-
others = __rest(sliderProps, ["className", "style", "prefixCls", "defaultValue", "disabled", "dots", "marks", "min", "max", "vertical", "reverse", "step", "tipFormatter", "tooltipVisible", "tooltipPlacement", "value", "onAfterChange", "onChange", "onBlur"]);
|
|
94
|
+
others = __rest(sliderProps, ["className", "style", "prefixCls", "defaultValue", "disabled", "dots", "marks", "min", "max", "vertical", "reverse", "step", "tipFormatter", "tooltipVisible", "tooltipPlacement", "value", "getPopupContainer", "onAfterChange", "onChange", "onBlur"]);
|
|
94
95
|
|
|
95
96
|
(0, _devwarning.default)(className && className.indexOf('shit') > -1, 'slider', "slider className can't include '".concat(className, "'"));
|
|
96
97
|
var sliderPrefixCls = getPrefixCls(prefixCls, 'slider', customPrefixcls); // ref
|
|
@@ -306,7 +307,8 @@ var InteranalSlider = function InteranalSlider(props, ref) {
|
|
|
306
307
|
reverse: reverse,
|
|
307
308
|
min: min,
|
|
308
309
|
max: max,
|
|
309
|
-
bound: value
|
|
310
|
+
bound: value,
|
|
311
|
+
getPopupContainer: getPopupContainer
|
|
310
312
|
}), /*#__PURE__*/_react.default.createElement(_marks.default, {
|
|
311
313
|
marks: marks,
|
|
312
314
|
prefixCls: sliderPrefixCls,
|