shineout 1.9.0 → 1.10.0-rc.1

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 +131 -45
  4. package/css/Input/Number.js +37 -17
  5. package/css/Input/index.d.ts +51 -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 +980 -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 +131 -45
  26. package/es/Input/Number.js +37 -17
  27. package/es/Input/index.d.ts +51 -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 +131 -45
  41. package/lib/Input/Number.js +37 -17
  42. package/lib/Input/index.d.ts +51 -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,19 @@ var _styles2 = require("./styles");
33
33
 
34
34
  var _InputTitle = _interopRequireDefault(require("../InputTitle"));
35
35
 
36
+ function isNumberType(n) {
37
+ return !Number.isNaN(parseFloat(n)) && !Number.isNaN(n - 0);
38
+ }
39
+
40
+ function regLength(size) {
41
+ return /\d+/.test(size) && size > 0 ? "{0," + size + "}" : '*';
42
+ }
43
+
44
+ function fillNumber(val) {
45
+ return val.replace(/^(-)?(\.\d+)(?!=\.).*/g, '$10$2') // eslint-disable-next-line no-useless-escape
46
+ .replace(/^0+(?=0\.?|[^0\.])/g, '').replace(/\.$/, '');
47
+ }
48
+
36
49
  var Input =
37
50
  /*#__PURE__*/
38
51
  function (_PureComponent) {
@@ -54,6 +67,7 @@ function (_PureComponent) {
54
67
  _this.handleKeyDown = _this.handleKeyDown.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
55
68
  _this.handleKeyUp = _this.handleKeyUp.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
56
69
  _this.handleBlur = _this.handleBlur.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
70
+ _this.handleAutoSelect = _this.handleAutoSelect.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
57
71
  _this.bindRef = _this.bindRef.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
58
72
  return _this;
59
73
  }
@@ -66,16 +80,71 @@ function (_PureComponent) {
66
80
  if (forwardedRef) forwardedRef(el);
67
81
  };
68
82
 
69
- _proto.invalidNumber = function invalidNumber(value) {
83
+ _proto.isValidNumber = function isValidNumber(val) {
84
+ var positive = this.props.positive;
85
+ var regExp = new RegExp("^(" + (positive ? '' : '-') + ")?\\d*\\.?\\d*$", 'g');
86
+ return regExp.test(val);
87
+ };
88
+
89
+ _proto.formatValue = function formatValue(val) {
90
+ var value = val;
70
91
  var _this$props = this.props,
92
+ type = _this$props.type,
71
93
  digits = _this$props.digits,
72
- type = _this$props.type;
94
+ integerLimit = _this$props.integerLimit,
95
+ positive = _this$props.positive;
96
+ if (type !== 'number') return value; // if (positive) {
97
+ // value = value.replace(/^0/g, '')
98
+ // }
99
+
100
+ var regExp = new RegExp("^(" + (positive ? '' : '-') + ")?(\\d" + regLength(integerLimit) + ")(" + (digits !== 0 ? "\\.\\d" + regLength(digits) : '') + ")?.*$", 'g');
101
+ console.log(value, typeof value);
102
+ value = value.replace(regExp, '$1$2$3');
103
+ return value;
104
+ };
105
+
106
+ _proto.fixValue = function fixValue(val) {
107
+ var _this$props2 = this.props,
108
+ type = _this$props2.type,
109
+ digits = _this$props2.digits,
110
+ autoFix = _this$props2.autoFix,
111
+ cancelChange = _this$props2.cancelChange,
112
+ positive = _this$props2.positive;
113
+ if (type !== 'number' || val === '') return val;
114
+ if (!isNumberType(val)) return '';
115
+ var fixVal = fillNumber(val);
116
+ if (positive && fixVal <= 0) return '';
117
+
118
+ if (digits !== undefined && autoFix) {
119
+ if (digits > 0) {
120
+ fixVal = parseFloat(fixVal).toFixed(digits);
121
+ } else {
122
+ fixVal = parseInt(fixVal, 10).toString();
123
+ }
124
+
125
+ if (cancelChange) cancelChange();
126
+ }
127
+
128
+ return fixVal;
129
+ };
130
+
131
+ _proto.invalidNumber = function invalidNumber(value) {
132
+ var _this$props3 = this.props,
133
+ digits = _this$props3.digits,
134
+ type = _this$props3.type,
135
+ integerLimit = _this$props3.integerLimit;
73
136
  if (type !== 'number') return false;
74
- var reg = '^-?\\d*';
137
+ var reg = '^-?';
138
+
139
+ if (!integerLimit) {
140
+ reg += "\\d*";
141
+ } else if (integerLimit > 0) {
142
+ reg += "\\d{0," + integerLimit + "}";
143
+ }
75
144
 
76
145
  if (digits === undefined) {
77
146
  reg += '\\.?\\d*';
78
- } else if (digits > 0) {
147
+ } else if (digits >= 0) {
79
148
  reg += "\\.?\\d{0," + digits + "}";
80
149
  }
81
150
 
@@ -85,10 +154,9 @@ function (_PureComponent) {
85
154
  };
86
155
 
87
156
  _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;
157
+ var _this$props4 = this.props,
158
+ type = _this$props4.type,
159
+ clearable = _this$props4.clearable;
92
160
 
93
161
  if (clearClick) {
94
162
  this.ref.focus();
@@ -102,20 +170,16 @@ function (_PureComponent) {
102
170
  return;
103
171
  }
104
172
 
105
- if (type === 'number' && typeof value !== 'number') value = String(value).replace(/。/g, '.');
173
+ if (type === 'number') {
174
+ if (typeof value !== 'number') {
175
+ value = String(value).replace(/。/g, '.');
176
+ }
106
177
 
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
178
+ if (!this.isValidNumber(value)) {
117
179
  return;
118
180
  }
181
+
182
+ value = this.formatValue(value);
119
183
  }
120
184
 
121
185
  this.props.onChange(value);
@@ -128,9 +192,9 @@ function (_PureComponent) {
128
192
  };
129
193
 
130
194
  _proto.handleKeyUp = function handleKeyUp(e) {
131
- var _this$props3 = this.props,
132
- onKeyUp = _this$props3.onKeyUp,
133
- onEnterPress = _this$props3.onEnterPress;
195
+ var _this$props5 = this.props,
196
+ onKeyUp = _this$props5.onKeyUp,
197
+ onEnterPress = _this$props5.onEnterPress;
134
198
 
135
199
  if (this.enterPress && e.keyCode === 13 && onEnterPress) {
136
200
  onEnterPress(e.target.value, e);
@@ -142,18 +206,34 @@ function (_PureComponent) {
142
206
 
143
207
  _proto.handleBlur = function handleBlur(e) {
144
208
  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;
209
+ var _this$props6 = this.props,
210
+ forceChange = _this$props6.forceChange,
211
+ onBlur = _this$props6.onBlur,
212
+ clearToUndefined = _this$props6.clearToUndefined,
213
+ cancelChange = _this$props6.cancelChange;
214
+ if (cancelChange) cancelChange();
215
+ var newVal = this.fixValue(value);
149
216
  if (onBlur) onBlur(e);
150
- if (this.invalidNumber(value)) return;
217
+ if (this.invalidNumber(newVal)) return;
151
218
 
152
- if (clearToUndefined && value === '' && this.props.value === undefined) {
219
+ if (clearToUndefined && newVal === '' && this.props.value === undefined) {
153
220
  return;
154
221
  }
155
222
 
156
- if (forceChange) forceChange(value);
223
+ if (forceChange) forceChange(newVal);
224
+ };
225
+
226
+ _proto.handleAutoSelect = function handleAutoSelect(event) {
227
+ var onFocus = this.props.onFocus;
228
+ var autoSelect = this.props.autoSelect;
229
+
230
+ if (autoSelect) {
231
+ event.currentTarget.select();
232
+ }
233
+
234
+ if (typeof onFocus === 'function') {
235
+ onFocus(event);
236
+ }
157
237
  };
158
238
 
159
239
  _proto.renderInfo = function renderInfo() {
@@ -176,21 +256,21 @@ function (_PureComponent) {
176
256
  };
177
257
 
178
258
  _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"]);
259
+ var _this$props7 = this.props,
260
+ type = _this$props7.type,
261
+ defaultValue = _this$props7.defaultValue,
262
+ digits = _this$props7.digits,
263
+ className = _this$props7.className,
264
+ clearable = _this$props7.clearable,
265
+ htmlName = _this$props7.htmlName,
266
+ forceChange = _this$props7.forceChange,
267
+ onEnterPress = _this$props7.onEnterPress,
268
+ forwardedRef = _this$props7.forwardedRef,
269
+ innerTitle = _this$props7.innerTitle,
270
+ inputFocus = _this$props7.inputFocus,
271
+ clearToUndefined = _this$props7.clearToUndefined,
272
+ placeholder = _this$props7.placeholder,
273
+ other = (0, _objectWithoutPropertiesLoose2.default)(_this$props7, ["type", "defaultValue", "digits", "className", "clearable", "htmlName", "forceChange", "onEnterPress", "forwardedRef", "innerTitle", "inputFocus", "clearToUndefined", "placeholder"]);
194
274
  var value = this.props.value == null || this.props.value === undefined ? '' : this.props.value;
195
275
  var needClearUndefined = clearToUndefined && this.props.value !== undefined;
196
276
  var showClear = !other.disabled && clearable && (value !== '' || needClearUndefined);
@@ -212,7 +292,8 @@ function (_PureComponent) {
212
292
  onChange: this.handleChange,
213
293
  onKeyDown: this.handleKeyDown,
214
294
  onKeyUp: this.handleKeyUp,
215
- onBlur: this.handleBlur
295
+ onBlur: this.handleBlur,
296
+ onFocus: this.handleAutoSelect
216
297
  }))), showClear && _react.default.createElement(_clear.default, {
217
298
  onClick: this.handleChange,
218
299
  key: "close",
@@ -227,10 +308,15 @@ Input.propTypes = {
227
308
  className: _propTypes.default.string,
228
309
  defaultValue: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
229
310
  digits: _propTypes.default.number,
311
+ integerLimit: _propTypes.default.number,
312
+ positive: _propTypes.default.bool,
313
+ autoSelect: _propTypes.default.bool,
314
+ autoFix: _propTypes.default.bool,
230
315
  forceChange: _propTypes.default.func,
231
316
  htmlName: _propTypes.default.string,
232
317
  onBlur: _propTypes.default.func,
233
318
  onChange: _propTypes.default.func.isRequired,
319
+ cancelChange: _propTypes.default.func,
234
320
  onEnterPress: _propTypes.default.func,
235
321
  type: _propTypes.default.string,
236
322
  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,20 @@ 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
+ positive = _this$props3.positive,
124
+ integerLimit = _this$props3.integerLimit;
125
+ var calculateVal = (0, _numbers.sub)(value, mod);
126
+
127
+ if (positive && calculateVal <= 0) {
128
+ calculateVal = value;
129
+ }
130
+
131
+ if (integerLimit && String(parseInt(calculateVal, 10)).length > integerLimit) {
132
+ calculateVal = value;
133
+ }
134
+
135
+ this.handleChange(calculateVal, true);
119
136
  };
120
137
 
121
138
  _proto.longPress = function longPress(mod) {
@@ -191,11 +208,11 @@ function (_PureComponent) {
191
208
  };
192
209
 
193
210
  _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"]);
211
+ var _this$props4 = this.props,
212
+ onChange = _this$props4.onChange,
213
+ allowNull = _this$props4.allowNull,
214
+ hideArrow = _this$props4.hideArrow,
215
+ other = (0, _objectWithoutPropertiesLoose2.default)(_this$props4, ["onChange", "allowNull", "hideArrow"]);
199
216
  return [].concat(this.renderArrowGroup(), [_react.default.createElement(_Input.default, (0, _extends2.default)({
200
217
  key: "input"
201
218
  }, other, {
@@ -211,11 +228,11 @@ function (_PureComponent) {
211
228
  };
212
229
 
213
230
  _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"]);
231
+ var _this$props5 = this.props,
232
+ onChange = _this$props5.onChange,
233
+ allowNull = _this$props5.allowNull,
234
+ hideArrow = _this$props5.hideArrow,
235
+ other = (0, _objectWithoutPropertiesLoose2.default)(_this$props5, ["onChange", "allowNull", "hideArrow"]);
219
236
  var rtl = (0, _config.isRTL)();
220
237
 
221
238
  if (rtl) {
@@ -249,6 +266,9 @@ Number.propTypes = {
249
266
  onChange: _propTypes.default.func.isRequired,
250
267
  step: _propTypes.default.number,
251
268
  digits: _propTypes.default.number,
269
+ integerLimit: _propTypes.default.number,
270
+ positive: _propTypes.default.bool,
271
+ autoSelect: _propTypes.default.bool,
252
272
  allowNull: _propTypes.default.bool,
253
273
  hideArrow: _propTypes.default.bool,
254
274
  clearToUndefined: _propTypes.default.bool,
@@ -1,6 +1,5 @@
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;
@@ -144,15 +143,6 @@ FormItemStandardProps<Value> {
144
143
  */
145
144
  maxLength?: number;
146
145
 
147
- /**
148
- * Validation rules
149
- *
150
- * 校验规则
151
- *
152
- * default: -
153
- */
154
- rules?: RuleParamsType<Value, InputProps<Value>>;
155
-
156
146
  /**
157
147
  * get input element
158
148
  *
@@ -198,7 +188,57 @@ FormItemStandardProps<Value> {
198
188
  * default: -
199
189
  *
200
190
  */
201
- clearToUndefined?: boolean
191
+ clearToUndefined?: boolean,
192
+
193
+ /**
194
+ * the digits of number 仅在type = number 下生效
195
+ *
196
+ * Decimal place limit (valid when type is number)
197
+ *
198
+ * default: -
199
+ */
200
+ digits?: number;
201
+
202
+ /**
203
+ * 整数位数限制, 仅在type = number 下生效
204
+ *
205
+ * Integer bit limit (valid when type is number)
206
+ *
207
+ * default: -
208
+ *
209
+ */
210
+ integerLimit?: number,
211
+
212
+ /**
213
+ * 非负数,仅在type = number 下生效
214
+ *
215
+ * positive number
216
+ *
217
+ * default: -
218
+ *
219
+ */
220
+ positive?: boolean,
221
+
222
+ /**
223
+ * 鼠标点击后自动全选数据
224
+ *
225
+ * Automatically select all data after mouse click
226
+ *
227
+ * default: false
228
+ *
229
+ */
230
+ autoSelect?: boolean,
231
+
232
+ /**
233
+ * 失焦后自动按照 digits 精度限制补足 (type 为 number 时生效)
234
+ *
235
+ * Automatically fill up according to the precision limit of digits after out of focus
236
+ *
237
+ * default: false
238
+ *
239
+ */
240
+ autoFix?: boolean,
241
+
202
242
  }
203
243
 
204
244
  export interface InputNumberProps <Value> extends InputProps<Value> {
@@ -230,15 +270,6 @@ export interface InputNumberProps <Value> extends InputProps<Value> {
230
270
  */
231
271
  step?: number;
232
272
 
233
- /**
234
- * the digits of number
235
- *
236
- * 数值的精度
237
- *
238
- * default: -
239
- */
240
- digits?: number;
241
-
242
273
  /**
243
274
  * allow value is null
244
275
  *
@@ -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.0' }
4
+ export default { utils, version: '1.10.0-rc.1' }
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.0'
227
+ version: '1.10.0-rc.1'
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', 'positive'];
11
11
  /**
12
12
  * delete some props if needed, will not modify the pass argument
13
13
  * @param props