shineout 1.9.1 → 1.10.0-rc.2

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.
Files changed (52) hide show
  1. package/css/Cascader/Input.js +4 -13
  2. package/css/Checkbox/index.d.ts +0 -11
  3. package/css/Input/Input.js +125 -45
  4. package/css/Input/Number.js +41 -17
  5. package/css/Input/index.d.ts +62 -20
  6. package/css/InputTitle/styles/inputTitle.css +4 -0
  7. package/css/Radio/index.d.ts +0 -2
  8. package/css/Rate/Rate.js +1 -3
  9. package/css/Select/styles/select.css +2 -2
  10. package/css/TreeSelect/index.d.ts +0 -10
  11. package/css/hoc/delay.js +7 -1
  12. package/css/index.d.ts +1 -1
  13. package/css/index.js +1 -1
  14. package/css/utils/cleanProps.js +1 -1
  15. package/dist/shineout.js +978 -315
  16. package/dist/shineout.js.map +1 -1
  17. package/dist/shineout.min.js +1 -1
  18. package/dist/theme.antd.css +1 -1
  19. package/dist/theme.antd2.css +1 -1
  20. package/dist/theme.default.css +1 -1
  21. package/dist/theme.shineout.css +1 -1
  22. package/es/@types/common.d.ts +19 -0
  23. package/es/Cascader/Input.js +5 -14
  24. package/es/Checkbox/index.d.ts +0 -11
  25. package/es/Input/Input.js +125 -45
  26. package/es/Input/Number.js +41 -17
  27. package/es/Input/index.d.ts +62 -20
  28. package/es/InputTitle/styles/inputTitle.less +4 -0
  29. package/es/Radio/index.d.ts +0 -2
  30. package/es/Rate/Rate.js +1 -2
  31. package/es/Select/styles/select.less +2 -2
  32. package/es/TreeSelect/index.d.ts +0 -10
  33. package/es/hoc/delay.js +7 -1
  34. package/es/index.d.ts +1 -1
  35. package/es/index.js +1 -1
  36. package/es/utils/cleanProps.js +1 -1
  37. package/lib/@types/common.d.ts +19 -0
  38. package/lib/Cascader/Input.js +4 -13
  39. package/lib/Checkbox/index.d.ts +0 -11
  40. package/lib/Input/Input.js +125 -45
  41. package/lib/Input/Number.js +41 -17
  42. package/lib/Input/index.d.ts +62 -20
  43. package/lib/InputTitle/styles/inputTitle.less +4 -0
  44. package/lib/Radio/index.d.ts +0 -2
  45. package/lib/Rate/Rate.js +1 -3
  46. package/lib/Select/styles/select.less +2 -2
  47. package/lib/TreeSelect/index.d.ts +0 -10
  48. package/lib/hoc/delay.js +7 -1
  49. package/lib/index.d.ts +1 -1
  50. package/lib/index.js +1 -1
  51. package/lib/utils/cleanProps.js +1 -1
  52. package/package.json +1 -1
@@ -97,24 +97,15 @@ function (_Component) {
97
97
  this.lastCursorOffset = (0, _element.getCursorOffset)(text.length);
98
98
  var t = this.getProcessedValue(text);
99
99
  this.props.onFilter(t);
100
- };
100
+ } // eslint-disable-next-line class-methods-use-this
101
+ ;
101
102
 
102
103
  _proto.handlePaste = function handlePaste(e) {
103
- var text = (e.clipboardData || window.clipboardData).getData('text/plain');
104
- if (!text) return;
105
- e.preventDefault();
106
- document.execCommand('insertText', false, text);
107
- this.handleInput({
108
- target: {
109
- innerText: text
110
- }
111
- });
104
+ (0, _element.preventPasteFile)(e);
112
105
  };
113
106
 
114
107
  _proto.render = function render() {
115
- var _this$props = this.props,
116
- focus = _this$props.focus,
117
- filterText = _this$props.filterText;
108
+ var focus = this.props.focus;
118
109
  var props = {
119
110
  className: (0, _styles.cascaderClass)('input', !focus && 'ellipsis'),
120
111
  ref: this.bindElement,
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react'
2
- import { RuleParamsType } from '../Rule'
3
2
  import { StandardProps, FormItemStandardProps, ListItemStandardProps } from '../@types/common'
4
3
 
5
4
  type ReactNode = React.ReactNode;
@@ -33,16 +32,6 @@ export interface CheckboxProps<T> extends StandardProps, FormItemStandardProps<T
33
32
  */
34
33
  htmlValue?: any;
35
34
 
36
-
37
- /**
38
- * Validation rules
39
- *
40
- * 校验规则
41
- *
42
- * default: -
43
- */
44
- rules?: RuleParamsType<T, CheckboxProps<T>>
45
-
46
35
  }
47
36
 
48
37
  // attention: checkbox group value is array
@@ -33,6 +33,15 @@ var _styles2 = require("./styles");
33
33
 
34
34
  var _InputTitle = _interopRequireDefault(require("../InputTitle"));
35
35
 
36
+ function regLength(size) {
37
+ return /\d+/.test(size) && size > 0 ? "{0," + size + "}" : '*';
38
+ }
39
+
40
+ function fillNumber(val) {
41
+ return val.replace(/^(-)?(\.\d+)(?!=\.).*/g, '$10$2') // eslint-disable-next-line no-useless-escape
42
+ .replace(/^0+(?=0\.?|[^0\.])/g, '').replace(/\.$/, '');
43
+ }
44
+
36
45
  var Input =
37
46
  /*#__PURE__*/
38
47
  function (_PureComponent) {
@@ -54,6 +63,7 @@ function (_PureComponent) {
54
63
  _this.handleKeyDown = _this.handleKeyDown.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
55
64
  _this.handleKeyUp = _this.handleKeyUp.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
56
65
  _this.handleBlur = _this.handleBlur.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
66
+ _this.handleAutoSelect = _this.handleAutoSelect.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
57
67
  _this.bindRef = _this.bindRef.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
58
68
  return _this;
59
69
  }
@@ -66,16 +76,69 @@ function (_PureComponent) {
66
76
  if (forwardedRef) forwardedRef(el);
67
77
  };
68
78
 
69
- _proto.invalidNumber = function invalidNumber(value) {
79
+ _proto.isValidNumber = function isValidNumber(val) {
80
+ var numType = this.props.numType;
81
+ var noNeg = numType === 'non-negative' || numType === 'positive';
82
+ var regExp = new RegExp("^(" + (noNeg ? '' : '-') + ")?\\d*\\.?\\d*$", 'g');
83
+ return regExp.test(val);
84
+ };
85
+
86
+ _proto.formatValue = function formatValue(val) {
87
+ var value = val;
70
88
  var _this$props = this.props,
89
+ type = _this$props.type,
71
90
  digits = _this$props.digits,
72
- type = _this$props.type;
91
+ integerLimit = _this$props.integerLimit,
92
+ numType = _this$props.numType;
93
+ var noNeg = numType === 'non-negative' || numType === 'positive';
94
+ if (type !== 'number') return value;
95
+ var regExp = new RegExp("^(" + (noNeg ? '' : '-') + ")?(\\d" + regLength(integerLimit) + ")(" + (digits !== 0 ? "\\.\\d" + regLength(digits) : '') + ")?.*$", 'g');
96
+ value = value.replace(regExp, '$1$2$3');
97
+ return value;
98
+ };
99
+
100
+ _proto.fixValue = function fixValue(val) {
101
+ var _this$props2 = this.props,
102
+ type = _this$props2.type,
103
+ digits = _this$props2.digits,
104
+ autoFix = _this$props2.autoFix,
105
+ cancelChange = _this$props2.cancelChange,
106
+ numType = _this$props2.numType;
107
+ if (type !== 'number' || val === '') return val;
108
+ if (/^[.-]+$/.test(val)) return '';
109
+ var fixVal = fillNumber(val);
110
+ if (numType === 'positive' && fixVal <= 0) return '';
111
+
112
+ if (digits !== undefined && autoFix) {
113
+ if (digits > 0) {
114
+ fixVal = parseFloat(fixVal).toFixed(digits);
115
+ } else {
116
+ fixVal = parseInt(fixVal, 10).toString();
117
+ }
118
+
119
+ if (cancelChange) cancelChange();
120
+ }
121
+
122
+ return fixVal;
123
+ };
124
+
125
+ _proto.invalidNumber = function invalidNumber(value) {
126
+ var _this$props3 = this.props,
127
+ digits = _this$props3.digits,
128
+ type = _this$props3.type,
129
+ integerLimit = _this$props3.integerLimit;
73
130
  if (type !== 'number') return false;
74
- var reg = '^-?\\d*';
131
+ var reg = '^-?';
132
+
133
+ if (!integerLimit) {
134
+ reg += "\\d*";
135
+ } else if (integerLimit > 0) {
136
+ reg += "\\d{0," + integerLimit + "}";
137
+ }
75
138
 
76
139
  if (digits === undefined) {
77
140
  reg += '\\.?\\d*';
78
- } else if (digits > 0) {
141
+ } else if (digits >= 0) {
79
142
  reg += "\\.?\\d{0," + digits + "}";
80
143
  }
81
144
 
@@ -85,10 +148,9 @@ function (_PureComponent) {
85
148
  };
86
149
 
87
150
  _proto.handleChange = function handleChange(e, clearClick) {
88
- var _this$props2 = this.props,
89
- type = _this$props2.type,
90
- clearable = _this$props2.clearable,
91
- digits = _this$props2.digits;
151
+ var _this$props4 = this.props,
152
+ type = _this$props4.type,
153
+ clearable = _this$props4.clearable;
92
154
 
93
155
  if (clearClick) {
94
156
  this.ref.focus();
@@ -102,20 +164,16 @@ function (_PureComponent) {
102
164
  return;
103
165
  }
104
166
 
105
- if (type === 'number' && typeof value !== 'number') value = String(value).replace(/。/g, '.');
167
+ if (type === 'number') {
168
+ if (typeof value !== 'number') {
169
+ value = String(value).replace(/。/g, '.');
170
+ }
106
171
 
107
- if (this.invalidNumber(value)) {
108
- // For numbers with a decimal point, use toFixed to correct the number of decimal points.
109
- if (digits >= 0 && /^-?\d*\.?\d*$/.test(value)) {
110
- if (digits === 0) {
111
- value = value === '.' ? '' : Number(value).toFixed(digits);
112
- } else {
113
- value = Number(value).toFixed(digits + 1).slice(0, -1);
114
- }
115
- } else {
116
- // digits <= 0 || not of number
172
+ if (!this.isValidNumber(value)) {
117
173
  return;
118
174
  }
175
+
176
+ value = this.formatValue(value);
119
177
  }
120
178
 
121
179
  this.props.onChange(value);
@@ -128,9 +186,9 @@ function (_PureComponent) {
128
186
  };
129
187
 
130
188
  _proto.handleKeyUp = function handleKeyUp(e) {
131
- var _this$props3 = this.props,
132
- onKeyUp = _this$props3.onKeyUp,
133
- onEnterPress = _this$props3.onEnterPress;
189
+ var _this$props5 = this.props,
190
+ onKeyUp = _this$props5.onKeyUp,
191
+ onEnterPress = _this$props5.onEnterPress;
134
192
 
135
193
  if (this.enterPress && e.keyCode === 13 && onEnterPress) {
136
194
  onEnterPress(e.target.value, e);
@@ -142,18 +200,34 @@ function (_PureComponent) {
142
200
 
143
201
  _proto.handleBlur = function handleBlur(e) {
144
202
  var value = e.target.value;
145
- var _this$props4 = this.props,
146
- forceChange = _this$props4.forceChange,
147
- onBlur = _this$props4.onBlur,
148
- clearToUndefined = _this$props4.clearToUndefined;
203
+ var _this$props6 = this.props,
204
+ forceChange = _this$props6.forceChange,
205
+ onBlur = _this$props6.onBlur,
206
+ clearToUndefined = _this$props6.clearToUndefined,
207
+ cancelChange = _this$props6.cancelChange;
208
+ if (cancelChange) cancelChange();
209
+ var newVal = this.fixValue(value);
149
210
  if (onBlur) onBlur(e);
150
- if (this.invalidNumber(value)) return;
211
+ if (this.invalidNumber(newVal)) return;
151
212
 
152
- if (clearToUndefined && value === '' && this.props.value === undefined) {
213
+ if (clearToUndefined && newVal === '' && this.props.value === undefined) {
153
214
  return;
154
215
  }
155
216
 
156
- if (forceChange) forceChange(value);
217
+ if (forceChange) forceChange(newVal);
218
+ };
219
+
220
+ _proto.handleAutoSelect = function handleAutoSelect(event) {
221
+ var onFocus = this.props.onFocus;
222
+ var autoSelect = this.props.autoSelect;
223
+
224
+ if (autoSelect) {
225
+ event.currentTarget.select();
226
+ }
227
+
228
+ if (typeof onFocus === 'function') {
229
+ onFocus(event);
230
+ }
157
231
  };
158
232
 
159
233
  _proto.renderInfo = function renderInfo() {
@@ -176,21 +250,21 @@ function (_PureComponent) {
176
250
  };
177
251
 
178
252
  _proto.render = function render() {
179
- var _this$props5 = this.props,
180
- type = _this$props5.type,
181
- defaultValue = _this$props5.defaultValue,
182
- digits = _this$props5.digits,
183
- className = _this$props5.className,
184
- clearable = _this$props5.clearable,
185
- htmlName = _this$props5.htmlName,
186
- forceChange = _this$props5.forceChange,
187
- onEnterPress = _this$props5.onEnterPress,
188
- forwardedRef = _this$props5.forwardedRef,
189
- innerTitle = _this$props5.innerTitle,
190
- inputFocus = _this$props5.inputFocus,
191
- clearToUndefined = _this$props5.clearToUndefined,
192
- placeholder = _this$props5.placeholder,
193
- other = (0, _objectWithoutPropertiesLoose2.default)(_this$props5, ["type", "defaultValue", "digits", "className", "clearable", "htmlName", "forceChange", "onEnterPress", "forwardedRef", "innerTitle", "inputFocus", "clearToUndefined", "placeholder"]);
253
+ var _this$props7 = this.props,
254
+ type = _this$props7.type,
255
+ defaultValue = _this$props7.defaultValue,
256
+ digits = _this$props7.digits,
257
+ className = _this$props7.className,
258
+ clearable = _this$props7.clearable,
259
+ htmlName = _this$props7.htmlName,
260
+ forceChange = _this$props7.forceChange,
261
+ onEnterPress = _this$props7.onEnterPress,
262
+ forwardedRef = _this$props7.forwardedRef,
263
+ innerTitle = _this$props7.innerTitle,
264
+ inputFocus = _this$props7.inputFocus,
265
+ clearToUndefined = _this$props7.clearToUndefined,
266
+ placeholder = _this$props7.placeholder,
267
+ other = (0, _objectWithoutPropertiesLoose2.default)(_this$props7, ["type", "defaultValue", "digits", "className", "clearable", "htmlName", "forceChange", "onEnterPress", "forwardedRef", "innerTitle", "inputFocus", "clearToUndefined", "placeholder"]);
194
268
  var value = this.props.value == null || this.props.value === undefined ? '' : this.props.value;
195
269
  var needClearUndefined = clearToUndefined && this.props.value !== undefined;
196
270
  var showClear = !other.disabled && clearable && (value !== '' || needClearUndefined);
@@ -212,7 +286,8 @@ function (_PureComponent) {
212
286
  onChange: this.handleChange,
213
287
  onKeyDown: this.handleKeyDown,
214
288
  onKeyUp: this.handleKeyUp,
215
- onBlur: this.handleBlur
289
+ onBlur: this.handleBlur,
290
+ onFocus: this.handleAutoSelect
216
291
  }))), showClear && _react.default.createElement(_clear.default, {
217
292
  onClick: this.handleChange,
218
293
  key: "close",
@@ -227,10 +302,15 @@ Input.propTypes = {
227
302
  className: _propTypes.default.string,
228
303
  defaultValue: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
229
304
  digits: _propTypes.default.number,
305
+ integerLimit: _propTypes.default.number,
306
+ numType: _propTypes.default.string,
307
+ autoSelect: _propTypes.default.bool,
308
+ autoFix: _propTypes.default.bool,
230
309
  forceChange: _propTypes.default.func,
231
310
  htmlName: _propTypes.default.string,
232
311
  onBlur: _propTypes.default.func,
233
312
  onChange: _propTypes.default.func.isRequired,
313
+ cancelChange: _propTypes.default.func,
234
314
  onEnterPress: _propTypes.default.func,
235
315
  type: _propTypes.default.string,
236
316
  value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
@@ -69,17 +69,21 @@ function (_PureComponent) {
69
69
  return;
70
70
  }
71
71
 
72
- if (typeof this.props.digits === 'number') {
73
- value = parseFloat(value.toFixed(this.props.digits));
72
+ var _this$props = this.props,
73
+ digits = _this$props.digits,
74
+ step = _this$props.step;
75
+
76
+ if (typeof digits === 'number') {
77
+ value = parseFloat(value.toFixed(digits));
74
78
  } else {
75
- var stepStr = this.props.step.toString();
79
+ var stepStr = step.toString();
76
80
  var dot = stepStr.lastIndexOf('.');
77
81
  if (dot >= 0) value = parseFloat(value.toFixed(stepStr.length - dot));
78
82
  }
79
83
 
80
- var _this$props = this.props,
81
- min = _this$props.min,
82
- max = _this$props.max;
84
+ var _this$props2 = this.props,
85
+ min = _this$props2.min,
86
+ max = _this$props2.max;
83
87
  if (max !== undefined && value > max) value = max;
84
88
  if (min !== undefined && value < min) value = min;
85
89
 
@@ -115,7 +119,24 @@ function (_PureComponent) {
115
119
  var value = parseFloat(("" + (val || '')).replace(/,/g, '')); // eslint-disable-next-line
116
120
 
117
121
  if (isNaN(value)) value = 0;
118
- this.handleChange((0, _numbers.sub)(value, mod), true);
122
+ var _this$props3 = this.props,
123
+ numType = _this$props3.numType,
124
+ integerLimit = _this$props3.integerLimit;
125
+ var calculateVal = (0, _numbers.sub)(value, mod);
126
+
127
+ if (numType === 'positive' && calculateVal <= 0) {
128
+ return;
129
+ }
130
+
131
+ if (numType === 'non-negative' && calculateVal < 0) {
132
+ return;
133
+ }
134
+
135
+ if (integerLimit && String(parseInt(calculateVal, 10)).length > integerLimit) {
136
+ return;
137
+ }
138
+
139
+ this.handleChange(calculateVal, true);
119
140
  };
120
141
 
121
142
  _proto.longPress = function longPress(mod) {
@@ -191,11 +212,11 @@ function (_PureComponent) {
191
212
  };
192
213
 
193
214
  _proto.renderRTL = function renderRTL() {
194
- var _this$props2 = this.props,
195
- onChange = _this$props2.onChange,
196
- allowNull = _this$props2.allowNull,
197
- hideArrow = _this$props2.hideArrow,
198
- other = (0, _objectWithoutPropertiesLoose2.default)(_this$props2, ["onChange", "allowNull", "hideArrow"]);
215
+ var _this$props4 = this.props,
216
+ onChange = _this$props4.onChange,
217
+ allowNull = _this$props4.allowNull,
218
+ hideArrow = _this$props4.hideArrow,
219
+ other = (0, _objectWithoutPropertiesLoose2.default)(_this$props4, ["onChange", "allowNull", "hideArrow"]);
199
220
  return [].concat(this.renderArrowGroup(), [_react.default.createElement(_Input.default, (0, _extends2.default)({
200
221
  key: "input"
201
222
  }, other, {
@@ -211,11 +232,11 @@ function (_PureComponent) {
211
232
  };
212
233
 
213
234
  _proto.render = function render() {
214
- var _this$props3 = this.props,
215
- onChange = _this$props3.onChange,
216
- allowNull = _this$props3.allowNull,
217
- hideArrow = _this$props3.hideArrow,
218
- other = (0, _objectWithoutPropertiesLoose2.default)(_this$props3, ["onChange", "allowNull", "hideArrow"]);
235
+ var _this$props5 = this.props,
236
+ onChange = _this$props5.onChange,
237
+ allowNull = _this$props5.allowNull,
238
+ hideArrow = _this$props5.hideArrow,
239
+ other = (0, _objectWithoutPropertiesLoose2.default)(_this$props5, ["onChange", "allowNull", "hideArrow"]);
219
240
  var rtl = (0, _config.isRTL)();
220
241
 
221
242
  if (rtl) {
@@ -249,6 +270,9 @@ Number.propTypes = {
249
270
  onChange: _propTypes.default.func.isRequired,
250
271
  step: _propTypes.default.number,
251
272
  digits: _propTypes.default.number,
273
+ integerLimit: _propTypes.default.number,
274
+ numType: _propTypes.default.string,
275
+ autoSelect: _propTypes.default.bool,
252
276
  allowNull: _propTypes.default.bool,
253
277
  hideArrow: _propTypes.default.bool,
254
278
  clearToUndefined: _propTypes.default.bool,
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react'
2
2
  import { PopoverProps } from '../Popover'
3
- import { RuleParamsType } from '../Rule'
4
3
  import { StandardProps, RegularAttributes, FormItemStandardProps, CommonProps } from '../@types/common'
5
4
 
6
5
  type ReactNode = React.ReactNode;
6
+ export type numType = "positive" | "non-negative";
7
7
 
8
8
  export interface InputProps<Value> extends
9
9
  StandardProps,
@@ -144,15 +144,6 @@ FormItemStandardProps<Value> {
144
144
  */
145
145
  maxLength?: number;
146
146
 
147
- /**
148
- * Validation rules
149
- *
150
- * 校验规则
151
- *
152
- * default: -
153
- */
154
- rules?: RuleParamsType<Value, InputProps<Value>>;
155
-
156
147
  /**
157
148
  * get input element
158
149
  *
@@ -198,7 +189,67 @@ FormItemStandardProps<Value> {
198
189
  * default: -
199
190
  *
200
191
  */
201
- clearToUndefined?: boolean
192
+ clearToUndefined?: boolean,
193
+
194
+ /**
195
+ * the digits of number 仅在type = number 下生效
196
+ *
197
+ * Decimal place limit (valid when type is number)
198
+ *
199
+ * default: -
200
+ */
201
+ digits?: number;
202
+
203
+ /**
204
+ * 整数位数限制, 仅在type = number 下生效
205
+ *
206
+ * Integer bit limit (valid when type is number)
207
+ *
208
+ * default: -
209
+ *
210
+ */
211
+ integerLimit?: number,
212
+
213
+ /**
214
+ * 设置数字类型 支持 'positive' 和 'non-negative', 仅在type = number 下生效
215
+ *
216
+ * Number type supports 'positive' and 'non-negative', only works when type = number
217
+ *
218
+ * default: -
219
+ *
220
+ */
221
+ numType?: numType,
222
+
223
+ /**
224
+ * 非负数,仅在type = number 下生效
225
+ *
226
+ * nonnegative number (valid when type is number)
227
+ *
228
+ * default: -
229
+ *
230
+ */
231
+ nonnegative?: boolean,
232
+
233
+ /**
234
+ * 鼠标点击后自动全选数据
235
+ *
236
+ * Automatically select all data after mouse click
237
+ *
238
+ * default: false
239
+ *
240
+ */
241
+ autoSelect?: boolean,
242
+
243
+ /**
244
+ * 失焦后自动按照 digits 精度限制补足 (type 为 number 时生效)
245
+ *
246
+ * Automatically fill up according to the precision limit of digits after out of focus
247
+ *
248
+ * default: false
249
+ *
250
+ */
251
+ autoFix?: boolean,
252
+
202
253
  }
203
254
 
204
255
  export interface InputNumberProps <Value> extends InputProps<Value> {
@@ -230,15 +281,6 @@ export interface InputNumberProps <Value> extends InputProps<Value> {
230
281
  */
231
282
  step?: number;
232
283
 
233
- /**
234
- * the digits of number
235
- *
236
- * 数值的精度
237
- *
238
- * default: -
239
- */
240
- digits?: number;
241
-
242
284
  /**
243
285
  * allow value is null
244
286
  *
@@ -66,6 +66,10 @@
66
66
  flex-grow: 1;
67
67
  width: 0;
68
68
  }
69
+ .so-input-title-box-place .so-input-title-box-title {
70
+ padding-top: 0;
71
+ padding-bottom: 0;
72
+ }
69
73
  .so-input-title-box:not(.so-input-title-box-open) .so-input-title-box-hideable {
70
74
  opacity: 0;
71
75
  }
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react'
2
- import { RuleParamsType } from '../Rule'
3
2
  import { StandardProps, StructDataStandardProps, ListItemStandardProps, FormItemStandardProps } from '../@types/common'
4
3
 
5
- type ReactNode = React.ReactNode;
6
4
 
7
5
  export interface RadioProps<Item = any> extends StandardProps {
8
6
 
package/css/Rate/Rate.js CHANGED
@@ -21,8 +21,6 @@ var _component = require("../component");
21
21
 
22
22
  var _numbers = require("../utils/numbers");
23
23
 
24
- var _element = require("../utils/dom/element");
25
-
26
24
  var _proptypes = require("../utils/proptypes");
27
25
 
28
26
  var _styles = require("./styles");
@@ -110,7 +108,7 @@ function (_PureComponent) {
110
108
  clearable = _this$props2.clearable,
111
109
  allowHalf = _this$props2.allowHalf;
112
110
 
113
- if (allowHalf && (0, _element.getParent)(e.target, "." + (0, _styles.rateClass)('allow-half'))) {
111
+ if (allowHalf && e.target.parentElement.querySelector("." + (0, _styles.rateClass)('allow-half'))) {
114
112
  value -= 0.5;
115
113
  }
116
114
 
@@ -377,8 +377,8 @@ so-select-rtl .so-select-box-list {
377
377
  background-color: var(--primary-color-fade-10, rgba(51, 153, 255, 0.1));
378
378
  }
379
379
  .so-select-tree .so-select-tree-wrapper .so-tree-content .so-select-tree-node.so-select-selected {
380
- background-color: var(--primary-color-fade-60, rgba(51, 153, 255, 0.6));
381
- color: white;
380
+ background-color: var(--primary-color-fade-10, rgba(51, 153, 255, 0.1));
381
+ color: var(--primary-color, #3399ff);
382
382
  }
383
383
  .so-select-tree .so-select-tree-wrapper .so-tree-content .so-select-tree-node.so-select-disabled {
384
384
  padding-right: var(--select-result-padding-horizontal, 4px);
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react'
2
- import { RuleParamsType } from '../Rule'
3
2
  import { CommonProps, StandardProps } from '../@types/common'
4
3
 
5
4
  type ReactNode = React.ReactNode;
@@ -280,15 +279,6 @@ export interface TreeSelectProps<Value, Data> extends StandardProps,
280
279
  */
281
280
  onCollapse?: (collapse: boolean) => void;
282
281
 
283
- /**
284
- * Validation rules
285
- *
286
- * 校验规则
287
- *
288
- * default: -
289
- */
290
- rules?: RuleParamsType<Value, TreeSelectProps<Value, Data>>;
291
-
292
282
  /**
293
283
  * render unmatch value
294
284
  *
package/css/hoc/delay.js CHANGED
@@ -42,6 +42,7 @@ var _default = (0, _func.curry)(function (defaultDelay, Origin) {
42
42
  };
43
43
  _this.handleChange = _this.handleChange.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
44
44
  _this.forceChange = _this.forceChange.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
45
+ _this.cancelChange = _this.cancelChange.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
45
46
  return _this;
46
47
  }
47
48
 
@@ -91,6 +92,10 @@ var _default = (0, _func.curry)(function (defaultDelay, Origin) {
91
92
  }, delay);
92
93
  };
93
94
 
95
+ _proto.cancelChange = function cancelChange() {
96
+ if (this.changeTimer) clearTimeout(this.changeTimer);
97
+ };
98
+
94
99
  _proto.forceChange = function forceChange(value) {
95
100
  var _this$props2;
96
101
 
@@ -115,7 +120,8 @@ var _default = (0, _func.curry)(function (defaultDelay, Origin) {
115
120
  return _react.default.createElement(Origin, (0, _extends2.default)({}, props, {
116
121
  value: this.getValue(),
117
122
  onChange: this.handleChange,
118
- forceChange: this.forceChange
123
+ forceChange: this.forceChange,
124
+ cancelChange: this.cancelChange
119
125
  }));
120
126
  };
121
127
 
package/css/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // Created by scripts/src-index.js.
2
2
  import * as utils from './utils'
3
3
 
4
- export default { utils, version: '1.9.1' }
4
+ export default { utils, version: '1.10.0-rc.2' }
5
5
  export { utils }
6
6
  export { setLocale } from './locale'
7
7
  export { color, style } from './utils/expose'
package/css/index.js CHANGED
@@ -224,6 +224,6 @@ exports.Upload = _Upload.default;
224
224
  // Created by scripts/src-index.js.
225
225
  var _default = {
226
226
  utils: utils,
227
- version: '1.9.1'
227
+ version: '1.10.0-rc.2'
228
228
  };
229
229
  exports.default = _default;
@@ -7,7 +7,7 @@ exports.default = cleanProps;
7
7
 
8
8
  var _immer = _interopRequireDefault(require("immer"));
9
9
 
10
- var names = ['delay', 'onDatumBind', 'rules', 'formDatum', 'forceChange', 'trim', 'beforeChange', 'validateHook', 'innerFormNamePath', 'fieldSetValidate', 'combineRules', 'popoverProps', 'inputFocus', 'placeTitle'];
10
+ var names = ['delay', 'onDatumBind', 'rules', 'formDatum', 'forceChange', 'trim', 'beforeChange', 'validateHook', 'innerFormNamePath', 'fieldSetValidate', 'combineRules', 'popoverProps', 'inputFocus', 'placeTitle', 'cancelChange', 'integerLimit', 'autoSelect', 'autoFix', 'numType'];
11
11
  /**
12
12
  * delete some props if needed, will not modify the pass argument
13
13
  * @param props