@kdcloudjs/kdesign 1.6.27 → 1.6.28
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-complete.less +47 -0
- package/dist/kdesign.css +4 -1
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +1630 -126
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +2 -2
- package/dist/kdesign.min.js +8 -8
- package/dist/kdesign.min.js.map +1 -1
- package/es/_utils/numberUtil.js +1 -3
- package/es/config-provider/compDefaultProps.d.ts +1 -0
- package/es/config-provider/compDefaultProps.js +2 -1
- package/es/date-picker/date-picker.js +23 -22
- package/es/date-picker/range/input-range.js +2 -4
- package/es/date-picker/range-picker.d.ts +1 -0
- package/es/date-picker/range-picker.js +2 -0
- package/es/date-picker/single/input-date.js +2 -4
- package/es/dropdown/dropdown.js +8 -3
- package/es/form/Field.js +21 -25
- package/es/image/preview-group.js +6 -4
- package/es/image/preview.js +2 -1
- package/es/input/ClearableLabeledInput.d.ts +1 -0
- package/es/input/ClearableLabeledInput.js +9 -4
- package/es/input/TextArea.js +18 -4
- package/es/input/input.d.ts +1 -0
- package/es/input/input.js +47 -10
- package/es/input/style/index.css +3 -0
- package/es/input/style/index.less +47 -0
- package/es/input-number/inputNumber.d.ts +1 -0
- package/es/input-number/inputNumber.js +4 -3
- package/es/radio/index.js +1 -0
- package/es/select/select.js +23 -20
- package/es/upload/interface.d.ts +1 -0
- package/es/upload/upload.js +11 -6
- package/lib/_utils/numberUtil.js +1 -3
- package/lib/config-provider/compDefaultProps.d.ts +1 -0
- package/lib/config-provider/compDefaultProps.js +2 -1
- package/lib/date-picker/date-picker.js +23 -22
- package/lib/date-picker/range/input-range.js +2 -4
- package/lib/date-picker/range-picker.d.ts +1 -0
- package/lib/date-picker/range-picker.js +2 -0
- package/lib/date-picker/single/input-date.js +2 -4
- package/lib/dropdown/dropdown.js +8 -3
- package/lib/form/Field.js +22 -27
- package/lib/image/preview-group.js +6 -4
- package/lib/image/preview.js +3 -1
- package/lib/input/ClearableLabeledInput.d.ts +1 -0
- package/lib/input/ClearableLabeledInput.js +9 -4
- package/lib/input/TextArea.js +18 -4
- package/lib/input/input.d.ts +1 -0
- package/lib/input/input.js +46 -9
- package/lib/input/style/index.css +3 -0
- package/lib/input/style/index.less +47 -0
- package/lib/input-number/inputNumber.d.ts +1 -0
- package/lib/input-number/inputNumber.js +4 -3
- package/lib/radio/index.js +1 -0
- package/lib/select/select.js +23 -20
- package/lib/upload/interface.d.ts +1 -0
- package/lib/upload/upload.js +11 -6
- package/package.json +1 -1
package/lib/form/Field.js
CHANGED
|
@@ -13,7 +13,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
13
13
|
});
|
|
14
14
|
exports.default = void 0;
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _extends3 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
17
17
|
|
|
18
18
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
19
19
|
|
|
@@ -273,11 +273,15 @@ var Field = function Field(props) {
|
|
|
273
273
|
var validateMessage = getFieldError(name);
|
|
274
274
|
|
|
275
275
|
var getInputValueFormProp = function getInputValueFormProp(evt) {
|
|
276
|
+
var payload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
277
|
+
|
|
276
278
|
var _a;
|
|
277
279
|
|
|
278
280
|
var inputValue;
|
|
279
281
|
|
|
280
|
-
if (
|
|
282
|
+
if (innerDisplayName === 'RadioGroup' && payload) {
|
|
283
|
+
inputValue = payload[1];
|
|
284
|
+
} else if (Object.prototype.hasOwnProperty.call(evt, 'target') && (0, _includes.default)(FormEventValuePropNames).call(FormEventValuePropNames, innerValuePropName)) {
|
|
281
285
|
inputValue = (_a = evt.target) === null || _a === void 0 ? void 0 : _a[innerValuePropName];
|
|
282
286
|
} else {
|
|
283
287
|
inputValue = evt;
|
|
@@ -286,15 +290,6 @@ var Field = function Field(props) {
|
|
|
286
290
|
return inputValue;
|
|
287
291
|
};
|
|
288
292
|
|
|
289
|
-
var handleValueChange = _react.default.useCallback(function (evt) {
|
|
290
|
-
var inputValue = getInputValueFormProp(evt);
|
|
291
|
-
dispatch({
|
|
292
|
-
type: 'updateValue',
|
|
293
|
-
namePath: name,
|
|
294
|
-
value: inputValue
|
|
295
|
-
});
|
|
296
|
-
}, [name]);
|
|
297
|
-
|
|
298
293
|
var handleValueValidate = _react.default.useCallback(function () {
|
|
299
294
|
dispatch({
|
|
300
295
|
type: 'validateField',
|
|
@@ -302,18 +297,14 @@ var Field = function Field(props) {
|
|
|
302
297
|
});
|
|
303
298
|
}, [name]);
|
|
304
299
|
|
|
305
|
-
var trigger = (0, _extends5.default)((0, _defineProperty2.default)({}, DEFAULT_TRIGGER, handleValueChange), generateEventHandler(handleValueValidate, validateTrigger));
|
|
306
|
-
|
|
307
300
|
var mergeProps = function mergeProps(fa, ch) {
|
|
308
|
-
var
|
|
301
|
+
var _extends2;
|
|
309
302
|
|
|
310
303
|
if (!ch) {
|
|
311
304
|
return {};
|
|
312
305
|
}
|
|
313
306
|
|
|
314
|
-
var
|
|
315
|
-
faDisabled = fa.disabled,
|
|
316
|
-
faRest = __rest(fa, ["onChange", "disabled"]);
|
|
307
|
+
var faRest = __rest(fa, []);
|
|
317
308
|
|
|
318
309
|
var _ch$props = ch.props,
|
|
319
310
|
chChange = _ch$props.onChange,
|
|
@@ -322,16 +313,22 @@ var Field = function Field(props) {
|
|
|
322
313
|
chDefaultValue = _ch$props.defaultValue;
|
|
323
314
|
|
|
324
315
|
var onChange = function onChange() {
|
|
325
|
-
|
|
326
|
-
|
|
316
|
+
for (var _len = arguments.length, evt = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
317
|
+
evt[_key] = arguments[_key];
|
|
327
318
|
}
|
|
328
319
|
|
|
329
|
-
if (
|
|
330
|
-
|
|
320
|
+
if (chValue === undefined) {
|
|
321
|
+
var iv = getInputValueFormProp(evt[0], evt);
|
|
322
|
+
setFieldValue(iv);
|
|
323
|
+
dispatch({
|
|
324
|
+
type: 'updateValue',
|
|
325
|
+
namePath: name,
|
|
326
|
+
value: iv
|
|
327
|
+
});
|
|
331
328
|
}
|
|
332
329
|
|
|
333
330
|
if (typeof chChange === 'function') {
|
|
334
|
-
chChange.apply(void 0,
|
|
331
|
+
chChange.apply(void 0, evt);
|
|
335
332
|
}
|
|
336
333
|
};
|
|
337
334
|
|
|
@@ -346,10 +343,10 @@ var Field = function Field(props) {
|
|
|
346
343
|
forceUpdate();
|
|
347
344
|
}
|
|
348
345
|
|
|
349
|
-
var mergeResult = (0,
|
|
346
|
+
var mergeResult = (0, _extends3.default)((0, _extends3.default)({}, faRest), (_extends2 = {
|
|
350
347
|
onChange: onChange,
|
|
351
348
|
defaultValue: defaultValue
|
|
352
|
-
}, (0, _defineProperty2.default)(
|
|
349
|
+
}, (0, _defineProperty2.default)(_extends2, innerValuePropName, fieldValue), (0, _defineProperty2.default)(_extends2, "disabled", chDisabled !== undefined ? chDisabled : disabled !== undefined ? disabled : formDisabled), _extends2));
|
|
353
350
|
var mergeEventArray = [];
|
|
354
351
|
|
|
355
352
|
if (validateTrigger) {
|
|
@@ -390,9 +387,7 @@ var Field = function Field(props) {
|
|
|
390
387
|
width: wrapperWidth,
|
|
391
388
|
validateMessage: validateMessage
|
|
392
389
|
}, (0, _map.default)(childrenArray).call(childrenArray, function (child, index) {
|
|
393
|
-
var keys = mergeProps((0,
|
|
394
|
-
disabled: disabled
|
|
395
|
-
}, innerValuePropName, value), trigger), {
|
|
390
|
+
var keys = mergeProps((0, _extends3.default)((0, _extends3.default)({}, generateEventHandler(handleValueValidate, validateTrigger)), {
|
|
396
391
|
key: index,
|
|
397
392
|
id: customizeHtmlFor ? undefined : htmlFor
|
|
398
393
|
}), child);
|
|
@@ -40,18 +40,18 @@ var PreviewGroup = function PreviewGroup(_ref) {
|
|
|
40
40
|
var images = React.useMemo(function () {
|
|
41
41
|
var _context;
|
|
42
42
|
|
|
43
|
-
return
|
|
43
|
+
return Array.isArray(children) ? (0, _map.default)(_context = (0, _filter.default)(children).call(children, function (image) {
|
|
44
44
|
return image.props.src;
|
|
45
45
|
})).call(_context, function (image) {
|
|
46
46
|
return image.props;
|
|
47
|
-
}) : [children ? children.props : {}];
|
|
47
|
+
}) : [children !== undefined ? children.props : {}];
|
|
48
48
|
}, [children]); // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
49
49
|
|
|
50
50
|
var refs = (0, _map.default)(images).call(images, function () {
|
|
51
51
|
return React.useRef();
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
var _React$useState = React.useState(images[0]),
|
|
54
|
+
var _React$useState = React.useState(images[0] || {}),
|
|
55
55
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
56
56
|
image = _React$useState2[0],
|
|
57
57
|
setImage = _React$useState2[1];
|
|
@@ -70,7 +70,9 @@ var PreviewGroup = function PreviewGroup(_ref) {
|
|
|
70
70
|
exit && setVisible(true);
|
|
71
71
|
}, [exit]);
|
|
72
72
|
React.useEffect(function () {
|
|
73
|
-
|
|
73
|
+
if (images[current]) {
|
|
74
|
+
setImage(images[current]);
|
|
75
|
+
}
|
|
74
76
|
}, [current, images]);
|
|
75
77
|
|
|
76
78
|
var _React$useState7 = React.useState(false),
|
package/lib/image/preview.js
CHANGED
|
@@ -35,6 +35,8 @@ var _icon = _interopRequireDefault(require("../icon"));
|
|
|
35
35
|
|
|
36
36
|
var _throttle = _interopRequireDefault(require("lodash/throttle"));
|
|
37
37
|
|
|
38
|
+
var _findLast = _interopRequireDefault(require("lodash/findLast"));
|
|
39
|
+
|
|
38
40
|
var _reactDraggable = _interopRequireDefault(require("react-draggable"));
|
|
39
41
|
|
|
40
42
|
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); }
|
|
@@ -120,7 +122,7 @@ var Preview = function Preview(props) {
|
|
|
120
122
|
}, [show, scale]);
|
|
121
123
|
|
|
122
124
|
var handleZoomOut = function handleZoomOut() {
|
|
123
|
-
var nextScale =
|
|
125
|
+
var nextScale = (0, _findLast.default)(scales, function (s) {
|
|
124
126
|
return s / 100 < scale;
|
|
125
127
|
});
|
|
126
128
|
if (nextScale !== undefined) setScale(nextScale / 100);
|
|
@@ -20,6 +20,7 @@ interface ClearableInputProps {
|
|
|
20
20
|
addonBefore?: React.ReactNode;
|
|
21
21
|
addonAfter?: React.ReactNode;
|
|
22
22
|
numberMark?: React.ReactNode;
|
|
23
|
+
inputCount?: React.ReactNode;
|
|
23
24
|
}
|
|
24
25
|
declare const ClearableInput: React.FC<ClearableInputProps>;
|
|
25
26
|
export default ClearableInput;
|
|
@@ -35,7 +35,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
35
35
|
var ClearableInputType = (0, _type.tuple)('input', 'text');
|
|
36
36
|
|
|
37
37
|
function hasPrefixSuffix(props) {
|
|
38
|
-
return !!(props.prefix || props.suffix || props.allowClear);
|
|
38
|
+
return !!(props.prefix || props.suffix || props.allowClear || !!props.inputCount);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
var ClearableInput = function ClearableInput(props) {
|
|
@@ -55,7 +55,8 @@ var ClearableInput = function ClearableInput(props) {
|
|
|
55
55
|
addonBefore = props.addonBefore,
|
|
56
56
|
addonAfter = props.addonAfter,
|
|
57
57
|
focused = props.focused,
|
|
58
|
-
numberMark = props.numberMark
|
|
58
|
+
numberMark = props.numberMark,
|
|
59
|
+
inputCount = props.inputCount;
|
|
59
60
|
|
|
60
61
|
var _useState = (0, _react.useState)(false),
|
|
61
62
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -88,10 +89,14 @@ var ClearableInput = function ClearableInput(props) {
|
|
|
88
89
|
};
|
|
89
90
|
|
|
90
91
|
var renderSuffix = function renderSuffix() {
|
|
91
|
-
if (suffix || !disabled && !!allowClear) {
|
|
92
|
+
if (suffix || !disabled && !!allowClear || inputCount) {
|
|
92
93
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
93
94
|
className: "".concat(prefixCls, "-suffix")
|
|
94
|
-
}, renderClearIcon(),
|
|
95
|
+
}, renderClearIcon(), inputCount && /*#__PURE__*/_react.default.createElement("span", {
|
|
96
|
+
style: {
|
|
97
|
+
marginRight: suffix ? 9 : 0
|
|
98
|
+
}
|
|
99
|
+
}, inputCount), /*#__PURE__*/_react.default.createElement("span", null, suffix));
|
|
95
100
|
}
|
|
96
101
|
|
|
97
102
|
return null;
|
package/lib/input/TextArea.js
CHANGED
|
@@ -110,8 +110,13 @@ var InternalTextarea = function InternalTextarea(props, ref) {
|
|
|
110
110
|
|
|
111
111
|
var _useState3 = (0, _react.useState)(false),
|
|
112
112
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
focused = _useState4[0],
|
|
114
|
+
setFocused = _useState4[1];
|
|
115
|
+
|
|
116
|
+
var _useState5 = (0, _react.useState)(false),
|
|
117
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
118
|
+
showNumberMark = _useState6[0],
|
|
119
|
+
setShowNumberMark = _useState6[1];
|
|
115
120
|
|
|
116
121
|
var resizeTextarea = (0, _react.useCallback)(function () {
|
|
117
122
|
if (!autoSize || !textareaRef.current) {
|
|
@@ -144,12 +149,12 @@ var InternalTextarea = function InternalTextarea(props, ref) {
|
|
|
144
149
|
};
|
|
145
150
|
|
|
146
151
|
var handleFocus = function handleFocus(e) {
|
|
147
|
-
|
|
152
|
+
setFocused(true);
|
|
148
153
|
onFocus && onFocus(e);
|
|
149
154
|
};
|
|
150
155
|
|
|
151
156
|
var handleBlur = function handleBlur(e) {
|
|
152
|
-
|
|
157
|
+
setFocused(false);
|
|
153
158
|
onBlur && onBlur(e);
|
|
154
159
|
};
|
|
155
160
|
|
|
@@ -195,6 +200,15 @@ var InternalTextarea = function InternalTextarea(props, ref) {
|
|
|
195
200
|
setValue(propsValue);
|
|
196
201
|
}
|
|
197
202
|
}, [propsValue, setValue]);
|
|
203
|
+
(0, _react.useEffect)(function () {
|
|
204
|
+
if (focused && !showNumberMark) {
|
|
205
|
+
setShowNumberMark(true);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (!focused && showNumberMark) {
|
|
209
|
+
setShowNumberMark(false);
|
|
210
|
+
}
|
|
211
|
+
}, [focused]);
|
|
198
212
|
|
|
199
213
|
var renderTextArea = function renderTextArea(prefixCls) {
|
|
200
214
|
var _context, _classNames2, _context2;
|
package/lib/input/input.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
21
21
|
onPressEnter?: (_: string, event: React.KeyboardEvent) => void;
|
|
22
22
|
value?: any;
|
|
23
23
|
readonly?: 'readonly';
|
|
24
|
+
count?: boolean;
|
|
24
25
|
}
|
|
25
26
|
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<unknown>>;
|
|
26
27
|
export default Input;
|
package/lib/input/input.js
CHANGED
|
@@ -93,7 +93,9 @@ var InternalInput = function InternalInput(props, ref) {
|
|
|
93
93
|
defaultValue = inputProps.defaultValue,
|
|
94
94
|
propsValue = inputProps.value,
|
|
95
95
|
className = inputProps.className,
|
|
96
|
-
|
|
96
|
+
maxLength = inputProps.maxLength,
|
|
97
|
+
count = inputProps.count,
|
|
98
|
+
others = __rest(inputProps, ["type", "size", "disabled", "onPressEnter", "borderType", "prefixCls", "onFocus", "onBlur", "onChange", "placeholderTobeValue", "defaultValue", "value", "className", "maxLength", "count"]);
|
|
97
99
|
|
|
98
100
|
(0, _devwarning.default)(InputSiteTypes.indexOf(size) === -1, 'input', "cannot found input size '".concat(size, "'"));
|
|
99
101
|
(0, _devwarning.default)(BorderTypes.indexOf(borderType) === -1, 'input', "cannot found input borderType '".concat(borderType, "'"));
|
|
@@ -111,6 +113,11 @@ var InternalInput = function InternalInput(props, ref) {
|
|
|
111
113
|
focused = _useState2[0],
|
|
112
114
|
setFocused = _useState2[1];
|
|
113
115
|
|
|
116
|
+
var _useState3 = (0, _react.useState)(true),
|
|
117
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
118
|
+
showNumberMark = _useState4[0],
|
|
119
|
+
setShowNumberMark = _useState4[1];
|
|
120
|
+
|
|
114
121
|
var thisInputRef = (0, _react.useRef)();
|
|
115
122
|
var inputRef = ref || thisInputRef;
|
|
116
123
|
var inputPrefixCls = getPrefixCls(prefixCls, 'input', customPrefixcls); // 按钮样式前缀
|
|
@@ -118,18 +125,21 @@ var InternalInput = function InternalInput(props, ref) {
|
|
|
118
125
|
var addonBefore = others.addonBefore,
|
|
119
126
|
addonAfter = others.addonAfter;
|
|
120
127
|
var inputClasses = (0, _classnames.default)(inputPrefixCls, (_classNames = {}, (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context = "".concat(inputPrefixCls, "-size-")).call(_context, size), size), (0, _defineProperty2.default)(_classNames, "".concat(inputPrefixCls, "-borderless"), borderType === 'none'), (0, _defineProperty2.default)(_classNames, "".concat(inputPrefixCls, "-underline"), borderType === 'underline'), (0, _defineProperty2.default)(_classNames, "".concat(inputPrefixCls, "-disabled"), disabled), _classNames), (0, _defineProperty2.default)({}, className, className && !(0, _ClearableLabeledInput.hasPrefixSuffix)(inputProps) && !addonBefore && !addonAfter));
|
|
121
|
-
|
|
128
|
+
|
|
129
|
+
var handleFocus = function handleFocus(event) {
|
|
122
130
|
setFocused(true);
|
|
123
131
|
onFocus && onFocus(event);
|
|
124
|
-
}
|
|
125
|
-
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
var handleBlur = function handleBlur(event) {
|
|
126
135
|
setFocused(false);
|
|
127
136
|
onBlur && onBlur(event);
|
|
128
|
-
}
|
|
129
|
-
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
var handleChange = function handleChange(event) {
|
|
130
140
|
propsValue === undefined && setValue(event.target.value);
|
|
131
141
|
onChange && onChange(event);
|
|
132
|
-
}
|
|
142
|
+
};
|
|
133
143
|
|
|
134
144
|
var handleReset = function handleReset() {
|
|
135
145
|
setValue('');
|
|
@@ -164,13 +174,30 @@ var InternalInput = function InternalInput(props, ref) {
|
|
|
164
174
|
delete inputDomProps.addonBefore;
|
|
165
175
|
delete inputDomProps.className;
|
|
166
176
|
|
|
177
|
+
var renderCount = function renderCount() {
|
|
178
|
+
var enteredLength = value ? value.length : 0;
|
|
179
|
+
|
|
180
|
+
if (maxLength !== undefined && enteredLength >= maxLength) {
|
|
181
|
+
enteredLength = maxLength;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (count && showNumberMark && !disabled) {
|
|
185
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
186
|
+
className: (0, _classnames.default)("".concat(inputPrefixCls, "-input-mark-inner"))
|
|
187
|
+
}, enteredLength, maxLength !== undefined ? "/".concat(maxLength) : null);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return null;
|
|
191
|
+
};
|
|
192
|
+
|
|
167
193
|
var renderInput = function renderInput() {
|
|
168
194
|
return /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
|
|
169
195
|
ref: inputRef,
|
|
170
196
|
type: type,
|
|
171
197
|
disabled: disabled,
|
|
172
198
|
className: inputClasses,
|
|
173
|
-
value: fixControlledValue(value)
|
|
199
|
+
value: fixControlledValue(value),
|
|
200
|
+
maxLength: maxLength
|
|
174
201
|
}, inputDomProps, {
|
|
175
202
|
onFocus: handleFocus,
|
|
176
203
|
onBlur: handleBlur,
|
|
@@ -179,13 +206,23 @@ var InternalInput = function InternalInput(props, ref) {
|
|
|
179
206
|
}));
|
|
180
207
|
};
|
|
181
208
|
|
|
209
|
+
(0, _react.useEffect)(function () {
|
|
210
|
+
if (focused && !showNumberMark) {
|
|
211
|
+
setShowNumberMark(true);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (!focused && showNumberMark) {
|
|
215
|
+
setShowNumberMark(false);
|
|
216
|
+
}
|
|
217
|
+
}, [focused]);
|
|
182
218
|
return /*#__PURE__*/_react.default.createElement(_ClearableLabeledInput.default, (0, _extends2.default)({}, inputProps, {
|
|
183
219
|
handleReset: handleReset,
|
|
184
220
|
value: value,
|
|
185
221
|
inputType: "input",
|
|
186
222
|
prefixCls: inputPrefixCls,
|
|
187
223
|
element: renderInput(),
|
|
188
|
-
focused: focused
|
|
224
|
+
focused: focused,
|
|
225
|
+
inputCount: renderCount()
|
|
189
226
|
}));
|
|
190
227
|
};
|
|
191
228
|
|
|
@@ -15,20 +15,25 @@ textarea {
|
|
|
15
15
|
overflow: auto;
|
|
16
16
|
resize: vertical;
|
|
17
17
|
}
|
|
18
|
+
|
|
18
19
|
.@{input-prefix-cls} {
|
|
19
20
|
.input(@input-prefix-cls);
|
|
21
|
+
|
|
20
22
|
transition: border-color @transition-duration-inner;
|
|
23
|
+
|
|
21
24
|
&-countWrapper {
|
|
22
25
|
position: relative;
|
|
23
26
|
display: inline-block;
|
|
24
27
|
width: 100%;
|
|
25
28
|
}
|
|
29
|
+
|
|
26
30
|
&-textarea {
|
|
27
31
|
.input(@input-prefix-cls);
|
|
28
32
|
transition: border-color @transition-duration-inner;
|
|
29
33
|
max-width: 100%;
|
|
30
34
|
height: auto;
|
|
31
35
|
vertical-align: bottom;
|
|
36
|
+
|
|
32
37
|
&-mark {
|
|
33
38
|
position: absolute;
|
|
34
39
|
right: 0;
|
|
@@ -39,48 +44,59 @@ textarea {
|
|
|
39
44
|
line-height: 18px;
|
|
40
45
|
background-color: #fff;
|
|
41
46
|
}
|
|
47
|
+
|
|
42
48
|
&-mark-inner {
|
|
43
49
|
top: auto;
|
|
44
50
|
bottom: 5px;
|
|
45
51
|
right: 8px;
|
|
46
52
|
}
|
|
47
53
|
}
|
|
54
|
+
|
|
48
55
|
&-no-resize {
|
|
49
56
|
resize: none;
|
|
50
57
|
}
|
|
58
|
+
|
|
51
59
|
&-borderless {
|
|
52
60
|
border: 0;
|
|
53
61
|
padding-left: 0 !important;
|
|
62
|
+
|
|
54
63
|
&:focus {
|
|
55
64
|
border: 0;
|
|
56
65
|
}
|
|
57
66
|
}
|
|
67
|
+
|
|
58
68
|
&-underline {
|
|
59
69
|
border: none;
|
|
60
70
|
border-bottom: 1px solid @input-color-border;
|
|
61
71
|
border-radius: 0;
|
|
62
72
|
padding-left: 0 !important;
|
|
63
73
|
}
|
|
74
|
+
|
|
64
75
|
&-disabled {
|
|
65
76
|
background-color: @input-background-color-disabled-inner;
|
|
66
77
|
border-color: @input-border-color-disabled-inner;
|
|
67
78
|
color: @input-affix-color;
|
|
68
79
|
cursor: not-allowed;
|
|
69
80
|
}
|
|
81
|
+
|
|
70
82
|
&-underline&-disabled {
|
|
71
83
|
color: @input-color-disabled-inner;
|
|
72
84
|
background-color: @input-background-color-inner;
|
|
73
85
|
border-color: @input-underline-border-color-disabled-inner;
|
|
74
86
|
}
|
|
87
|
+
|
|
75
88
|
&-size-small {
|
|
76
89
|
.input-size(@input-small-height-inner, @input-small-font-size-inner, @input-small-padding-vertical-inner, @input-small-padding-horizontal-inner);
|
|
77
90
|
}
|
|
91
|
+
|
|
78
92
|
&-size-middle {
|
|
79
93
|
.input-size(@input-middle-height-inner, @input-middle-font-size-inner, @input-small-padding-vertical-inner, @input-small-padding-horizontal-inner);
|
|
80
94
|
}
|
|
95
|
+
|
|
81
96
|
&-size-large {
|
|
82
97
|
.input-size(@input-large-height-inner, @input-large-font-size-inner, @input-small-padding-vertical-inner, @input-small-padding-horizontal-inner);
|
|
83
98
|
}
|
|
99
|
+
|
|
84
100
|
&-wrapper {
|
|
85
101
|
padding-left: @input-wrapper-padding-left !important;
|
|
86
102
|
.input(@wrapper-prefix-cls);
|
|
@@ -90,11 +106,13 @@ textarea {
|
|
|
90
106
|
padding-top: 0 !important;
|
|
91
107
|
padding-bottom: 0 !important;
|
|
92
108
|
overflow: hidden;
|
|
109
|
+
|
|
93
110
|
.@{input-prefix-cls} {
|
|
94
111
|
border: none;
|
|
95
112
|
padding-left: @input-padding-left;
|
|
96
113
|
padding-right: 0;
|
|
97
114
|
height: 100%;
|
|
115
|
+
|
|
98
116
|
&-suffix,
|
|
99
117
|
&-prefix {
|
|
100
118
|
display: flex;
|
|
@@ -104,25 +122,32 @@ textarea {
|
|
|
104
122
|
word-break: keep-all;
|
|
105
123
|
color: @input-affix-color;
|
|
106
124
|
}
|
|
125
|
+
|
|
107
126
|
&-suffix {
|
|
108
127
|
margin-left: 4px;
|
|
109
128
|
}
|
|
129
|
+
|
|
110
130
|
&-prefix {
|
|
111
131
|
margin-right: 4px;
|
|
112
132
|
}
|
|
113
133
|
}
|
|
134
|
+
|
|
114
135
|
&-size-small {
|
|
115
136
|
.input-size(@input-small-height-inner, @input-small-font-size-inner, @input-small-padding-vertical-inner, @input-small-padding-horizontal-inner);
|
|
116
137
|
}
|
|
138
|
+
|
|
117
139
|
&-size-middle {
|
|
118
140
|
.input-size(@input-middle-height-inner, @input-middle-font-size-inner, @input-small-padding-vertical-inner, @input-middle-padding-horizontal-inner);
|
|
119
141
|
}
|
|
142
|
+
|
|
120
143
|
&-size-large {
|
|
121
144
|
.input-size(@input-large-height-inner, @input-large-font-size-inner, @input-small-padding-vertical-inner, @input-large-padding-horizontal-inner);
|
|
122
145
|
}
|
|
146
|
+
|
|
123
147
|
&-borderless {
|
|
124
148
|
.border-less;
|
|
125
149
|
}
|
|
150
|
+
|
|
126
151
|
&-underline {
|
|
127
152
|
.underline;
|
|
128
153
|
}
|
|
@@ -142,12 +167,14 @@ textarea {
|
|
|
142
167
|
}
|
|
143
168
|
}
|
|
144
169
|
}
|
|
170
|
+
|
|
145
171
|
&-wrapper-textarea {
|
|
146
172
|
.input(@input-prefix-cls);
|
|
147
173
|
border: none !important;
|
|
148
174
|
padding: 0 !important;
|
|
149
175
|
position: relative;
|
|
150
176
|
display: inline-block;
|
|
177
|
+
|
|
151
178
|
.@{input-prefix-cls} {
|
|
152
179
|
&-textarea-clear-icon {
|
|
153
180
|
position: absolute;
|
|
@@ -157,13 +184,16 @@ textarea {
|
|
|
157
184
|
}
|
|
158
185
|
}
|
|
159
186
|
}
|
|
187
|
+
|
|
160
188
|
&-clear-icon,
|
|
161
189
|
&-textarea-clear-icon {
|
|
162
190
|
.input-clear-icon;
|
|
163
191
|
}
|
|
192
|
+
|
|
164
193
|
&-clear-icon-hidden {
|
|
165
194
|
visibility: hidden;
|
|
166
195
|
}
|
|
196
|
+
|
|
167
197
|
&-clear-icon-rightSpace {
|
|
168
198
|
margin-right: 4px;
|
|
169
199
|
}
|
|
@@ -173,6 +203,7 @@ textarea {
|
|
|
173
203
|
width: 100%;
|
|
174
204
|
text-align: start;
|
|
175
205
|
vertical-align: top;
|
|
206
|
+
|
|
176
207
|
.@{input-prefix-cls} {
|
|
177
208
|
&-group {
|
|
178
209
|
box-sizing: border-box;
|
|
@@ -189,19 +220,23 @@ textarea {
|
|
|
189
220
|
width: 100%;
|
|
190
221
|
border-collapse: separate;
|
|
191
222
|
border-spacing: 0;
|
|
223
|
+
|
|
192
224
|
& > .@{input-prefix-cls}-wrapper {
|
|
193
225
|
&:not(:first-child):not(:last-child) {
|
|
194
226
|
border-radius: 0;
|
|
195
227
|
}
|
|
228
|
+
|
|
196
229
|
&:first-child:not(:last-child) {
|
|
197
230
|
border-top-right-radius: 0;
|
|
198
231
|
border-bottom-right-radius: 0;
|
|
199
232
|
}
|
|
233
|
+
|
|
200
234
|
&:not(:first-child):last-child {
|
|
201
235
|
border-top-left-radius: 0;
|
|
202
236
|
border-bottom-left-radius: 0;
|
|
203
237
|
}
|
|
204
238
|
}
|
|
239
|
+
|
|
205
240
|
.@{input-prefix-cls}-group-addon {
|
|
206
241
|
position: relative;
|
|
207
242
|
color: @input-affix-color;
|
|
@@ -216,11 +251,13 @@ textarea {
|
|
|
216
251
|
display: flex;
|
|
217
252
|
align-items: center;
|
|
218
253
|
height: @input-middle-height-inner;
|
|
254
|
+
|
|
219
255
|
&:first-child {
|
|
220
256
|
border-top-right-radius: 0;
|
|
221
257
|
border-bottom-right-radius: 0;
|
|
222
258
|
border-right: none;
|
|
223
259
|
}
|
|
260
|
+
|
|
224
261
|
&:last-child {
|
|
225
262
|
border-top-left-radius: 0;
|
|
226
263
|
border-bottom-left-radius: 0;
|
|
@@ -230,9 +267,11 @@ textarea {
|
|
|
230
267
|
&-borderless {
|
|
231
268
|
.border-less;
|
|
232
269
|
}
|
|
270
|
+
|
|
233
271
|
&-underline {
|
|
234
272
|
.underline;
|
|
235
273
|
}
|
|
274
|
+
|
|
236
275
|
&-disabled {
|
|
237
276
|
background-color: @input-background-color-disabled-inner;
|
|
238
277
|
border-color: @input-border-color-disabled-inner;
|
|
@@ -241,16 +280,19 @@ textarea {
|
|
|
241
280
|
}
|
|
242
281
|
}
|
|
243
282
|
}
|
|
283
|
+
|
|
244
284
|
&-group-size-small {
|
|
245
285
|
.@{input-prefix-cls}-group-addon {
|
|
246
286
|
height: @input-small-height-inner;
|
|
247
287
|
}
|
|
248
288
|
}
|
|
289
|
+
|
|
249
290
|
&-group-middle-small {
|
|
250
291
|
.@{input-prefix-cls}-group-addon {
|
|
251
292
|
height: @input-middle-height-inner;
|
|
252
293
|
}
|
|
253
294
|
}
|
|
295
|
+
|
|
254
296
|
&-group-large-small {
|
|
255
297
|
.@{input-prefix-cls}-group-addon {
|
|
256
298
|
height: @input-large-height-inner;
|
|
@@ -258,7 +300,12 @@ textarea {
|
|
|
258
300
|
}
|
|
259
301
|
}
|
|
260
302
|
}
|
|
303
|
+
|
|
261
304
|
&-allowClear-spacing {
|
|
262
305
|
padding-right: 20px;
|
|
263
306
|
}
|
|
307
|
+
|
|
308
|
+
&-input-mark-inner {
|
|
309
|
+
color: @input-placeholder-color-inner;
|
|
310
|
+
}
|
|
264
311
|
}
|
|
@@ -22,6 +22,7 @@ export interface InputNumberProps extends InputProps {
|
|
|
22
22
|
stepOption?: StepOption;
|
|
23
23
|
stepperrref?: any;
|
|
24
24
|
formatter?: (value: string | undefined) => string;
|
|
25
|
+
numberMode?: boolean;
|
|
25
26
|
}
|
|
26
27
|
declare const InputNumber: React.ForwardRefExoticComponent<InputNumberProps & React.RefAttributes<unknown>>;
|
|
27
28
|
export default InputNumber;
|
|
@@ -84,15 +84,16 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
84
84
|
minMark = inputNumberProps.minMark,
|
|
85
85
|
max = inputNumberProps.max,
|
|
86
86
|
maxMark = inputNumberProps.maxMark,
|
|
87
|
+
numberMode = inputNumberProps.numberMode,
|
|
87
88
|
prefix = inputNumberProps.prefix,
|
|
88
89
|
suffix = inputNumberProps.suffix,
|
|
89
90
|
formatter = inputNumberProps.formatter,
|
|
90
91
|
className = inputNumberProps.className,
|
|
91
|
-
others = __rest(inputNumberProps, ["value", "defaultValue", "mustInScope", "decimalLength", "mustInPrecisionScope", "digitLength", "onChange", "symbol", "zeroShow", "showDecimalTailZero", "code", "roundMethod", "mask", "stepOption", "min", "minMark", "max", "maxMark", "prefix", "suffix", "formatter", "className"]);
|
|
92
|
+
others = __rest(inputNumberProps, ["value", "defaultValue", "mustInScope", "decimalLength", "mustInPrecisionScope", "digitLength", "onChange", "symbol", "zeroShow", "showDecimalTailZero", "code", "roundMethod", "mask", "stepOption", "min", "minMark", "max", "maxMark", "numberMode", "prefix", "suffix", "formatter", "className"]);
|
|
92
93
|
|
|
93
94
|
var initVal = value === undefined ? defaultValue : value;
|
|
94
95
|
|
|
95
|
-
var _useState = (0, _react.useState)((0, _numberUtil.serialization)(initVal
|
|
96
|
+
var _useState = (0, _react.useState)((0, _numberUtil.serialization)(initVal !== undefined ? initVal + '' : '')),
|
|
96
97
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
97
98
|
inputValue = _useState2[0],
|
|
98
99
|
setInputValue = _useState2[1];
|
|
@@ -160,7 +161,7 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
160
161
|
}
|
|
161
162
|
|
|
162
163
|
value === undefined && setInputValue(legalNumber);
|
|
163
|
-
onChange && onChange(handleEventAttachValue(event, legalNumber));
|
|
164
|
+
onChange && onChange(handleEventAttachValue(event, numberMode ? Number(legalNumber) : legalNumber));
|
|
164
165
|
};
|
|
165
166
|
|
|
166
167
|
var handleFocus = function handleFocus(event) {
|
package/lib/radio/index.js
CHANGED
|
@@ -27,6 +27,7 @@ var _radioButton = _interopRequireDefault(require("./radio-button"));
|
|
|
27
27
|
|
|
28
28
|
var Radio = _radio.default;
|
|
29
29
|
Radio.Group = _group.default;
|
|
30
|
+
Radio.Group.displayName = 'RadioGroup';
|
|
30
31
|
Radio.Button = _radioButton.default;
|
|
31
32
|
var _default = Radio;
|
|
32
33
|
exports.default = _default;
|