shineout 1.8.0 → 1.8.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 (47) hide show
  1. package/css/Cascader/Result.js +3 -2
  2. package/css/Cascader/styles/cascader.css +9 -1
  3. package/css/Checkbox/Group.js +6 -3
  4. package/css/Checkbox/index.d.ts +1 -1
  5. package/css/DatePicker/Month.js +7 -1
  6. package/css/Datum/Tree.js +2 -1
  7. package/css/Menu/Root.js +10 -4
  8. package/css/Rule/index.d.ts +26 -3
  9. package/css/Select/Result.js +5 -4
  10. package/css/Select/styles/select.css +8 -4
  11. package/css/Textarea/index.d.ts +34 -23
  12. package/css/index.d.ts +1 -1
  13. package/css/index.js +1 -1
  14. package/dist/shineout.js +108 -88
  15. package/dist/shineout.js.map +1 -1
  16. package/dist/shineout.min.js +1 -1
  17. package/dist/theme.antd.css +1 -1
  18. package/dist/theme.antd2.css +1 -1
  19. package/dist/theme.default.css +1 -1
  20. package/dist/theme.shineout.css +1 -1
  21. package/es/Cascader/Result.js +3 -2
  22. package/es/Cascader/styles/cascader.less +11 -1
  23. package/es/Checkbox/Group.js +6 -3
  24. package/es/Checkbox/index.d.ts +1 -1
  25. package/es/DatePicker/Month.js +7 -1
  26. package/es/Datum/Tree.js +2 -1
  27. package/es/Menu/Root.js +9 -4
  28. package/es/Rule/index.d.ts +26 -3
  29. package/es/Select/Result.js +5 -4
  30. package/es/Select/styles/select.less +8 -3
  31. package/es/Textarea/index.d.ts +34 -23
  32. package/es/index.d.ts +1 -1
  33. package/es/index.js +1 -1
  34. package/lib/Cascader/Result.js +3 -2
  35. package/lib/Cascader/styles/cascader.less +11 -1
  36. package/lib/Checkbox/Group.js +6 -3
  37. package/lib/Checkbox/index.d.ts +1 -1
  38. package/lib/DatePicker/Month.js +7 -1
  39. package/lib/Datum/Tree.js +2 -1
  40. package/lib/Menu/Root.js +10 -4
  41. package/lib/Rule/index.d.ts +26 -3
  42. package/lib/Select/Result.js +5 -4
  43. package/lib/Select/styles/select.less +8 -3
  44. package/lib/Textarea/index.d.ts +34 -23
  45. package/lib/index.d.ts +1 -1
  46. package/lib/index.js +1 -1
  47. package/package.json +1 -1
@@ -324,11 +324,12 @@ function (_PureComponent) {
324
324
  compressed = _this$props8.compressed,
325
325
  multiple = _this$props8.multiple;
326
326
  var result = value.length === 0 ? this.renderPlaceholder() : this.renderResult();
327
+ var clearEl = this.renderClear();
327
328
  return React.createElement("div", {
328
329
  ref: this.bindResult,
329
- className: cascaderClass('result', multiple && compressed && 'compressed'),
330
+ className: cascaderClass('result', multiple && compressed && 'compressed', clearEl && 'result-clearable'),
330
331
  style: style
331
- }, result, this.renderIndicator(), this.renderClear());
332
+ }, result, this.renderIndicator(), clearEl);
332
333
  };
333
334
 
334
335
  return Result;
@@ -5,6 +5,7 @@
5
5
  @list-prefix: ~'@{so-prefix}-list';
6
6
  @checkinput-prefix: ~'@{so-prefix}-checkinput';
7
7
  @input-prefix: ~'@{so-prefix}-input';
8
+ @select-prefix: ~'@{so-prefix}-select';
8
9
 
9
10
  .@{cascader-prefix} {
10
11
  position: relative;
@@ -127,13 +128,22 @@
127
128
  background-color: inherit;
128
129
  color: inherit;
129
130
  }
131
+ .@{select-prefix}-multi {
132
+ visibility: visible;
133
+ cursor: not-allowed;
134
+ }
130
135
  }
131
136
 
132
137
  &:not(&-disabled) {
133
- .@{cascader-prefix}-focus .@{cascader-prefix}-close,
138
+ &.@{cascader-prefix}-focus .@{cascader-prefix}-close,
134
139
  .@{cascader-prefix}-result:hover .@{cascader-prefix}-close {
135
140
  display: block;
136
141
  }
142
+
143
+ &.@{cascader-prefix}-focus .@{cascader-prefix}-result-clearable .@{select-prefix}-multi,
144
+ .@{cascader-prefix}-result-clearable:hover .@{select-prefix}-multi {
145
+ visibility: hidden;
146
+ }
137
147
  }
138
148
 
139
149
  &-multiple {
@@ -89,12 +89,14 @@ function (_PureComponent) {
89
89
  data = _this$props2.data,
90
90
  datum = _this$props2.datum,
91
91
  keygen = _this$props2.keygen,
92
- children = _this$props2.children;
92
+ children = _this$props2.children,
93
+ style = _this$props2.style;
93
94
  var className = classnames(checkinputClass('group', ['no-block', 'block'][Number(block)]), this.props.className);
94
95
 
95
96
  if (data === undefined) {
96
97
  return React.createElement("div", {
97
- className: className
98
+ className: className,
99
+ style: style
98
100
  }, React.createElement(Provider, {
99
101
  value: {
100
102
  onRawChange: this.handleRawChange,
@@ -104,7 +106,8 @@ function (_PureComponent) {
104
106
  }
105
107
 
106
108
  return React.createElement("div", {
107
- className: className
109
+ className: className,
110
+ style: style
108
111
  }, data.map(function (d, i) {
109
112
  return React.createElement(Checkbox, {
110
113
  checked: datum.check(d),
@@ -47,7 +47,7 @@ export interface CheckboxProps<T> extends StandardProps, FormItemStandardProps<T
47
47
 
48
48
  // attention: checkbox group value is array
49
49
 
50
- export interface CheckboxGroupProps<Data, T> extends ListItemStandardProps<Data, T>, Omit<FormItemStandardProps<T[]>, 'placeholder'> {
50
+ export interface CheckboxGroupProps<Data, T> extends ListItemStandardProps<Data, T>, Omit<FormItemStandardProps<T[]>, 'placeholder'>, StandardProps {
51
51
 
52
52
  /**
53
53
  * The data item
@@ -58,12 +58,17 @@ function (_PureComponent) {
58
58
  type = _this$props3.type,
59
59
  current = _this$props3.current,
60
60
  index = _this$props3.index,
61
- rangeDate = _this$props3.rangeDate;
61
+ rangeDate = _this$props3.rangeDate,
62
+ max = _this$props3.max;
62
63
  var date = utils.toDate(MONTHBASE);
63
64
  date.setMonth(i);
64
65
  date.setFullYear(current.getFullYear());
65
66
  var isDisabled = min && utils.compareMonth(min, date, 1) >= 0;
66
67
 
68
+ if (!isDisabled) {
69
+ isDisabled = max && utils.compareMonth(date, max, 1) >= 0;
70
+ }
71
+
67
72
  if (!isDisabled && type === 'month' && typeof disabled === 'function') {
68
73
  isDisabled = disabled(date);
69
74
  }
@@ -117,6 +122,7 @@ Month.propTypes = {
117
122
  current: PropTypes.object.isRequired,
118
123
  disabled: PropTypes.func,
119
124
  // max: PropTypes.object,
125
+ max: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
120
126
  min: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
121
127
  onChange: PropTypes.func.isRequired,
122
128
  onModeChange: PropTypes.func.isRequired,
package/es/Datum/Tree.js CHANGED
@@ -296,7 +296,8 @@ function () {
296
296
  var id = _this5.getKey(d, path[path.length - 1], i);
297
297
 
298
298
  if (_this5.dataMap.get(id)) {
299
- console.warn("There is already a key \"" + id + "\" exists. The key must be unique.");
299
+ console.error("There is already a key \"" + id + "\" exists. The key must be unique.");
300
+ return;
300
301
  }
301
302
 
302
303
  _this5.dataMap.set(id, d);
package/es/Menu/Root.js CHANGED
@@ -14,6 +14,7 @@ import List from './List';
14
14
  import { Provider } from './context';
15
15
  import { isArray } from '../utils/is';
16
16
  import { isRTL } from '../config';
17
+ import { Component } from '../component';
17
18
  var modeDirection = {
18
19
  'vertical-auto': 'y',
19
20
  vertical: 'y',
@@ -55,13 +56,13 @@ function keyToMap(keys, value) {
55
56
 
56
57
  var Root =
57
58
  /*#__PURE__*/
58
- function (_React$Component) {
59
- _inheritsLoose(Root, _React$Component);
59
+ function (_Component) {
60
+ _inheritsLoose(Root, _Component);
60
61
 
61
62
  function Root(props) {
62
63
  var _this;
63
64
 
64
- _this = _React$Component.call(this, props) || this;
65
+ _this = _Component.call(this, props) || this;
65
66
  _this.state = {
66
67
  activeKey: null,
67
68
  scrollTop: 0,
@@ -92,6 +93,8 @@ function (_React$Component) {
92
93
  var _proto = Root.prototype;
93
94
 
94
95
  _proto.componentDidMount = function componentDidMount() {
96
+ _Component.prototype.componentDidMount.call(this);
97
+
95
98
  this.updateState();
96
99
  };
97
100
 
@@ -101,6 +104,8 @@ function (_React$Component) {
101
104
 
102
105
  _proto.componentWillUnmount = function componentWillUnmount() {
103
106
  this.container.removeEventListener('wheel', this.handleWheel);
107
+
108
+ _Component.prototype.componentWillUnmount.call(this);
104
109
  };
105
110
 
106
111
  _proto.getOpenKeys = function getOpenKeys() {
@@ -396,7 +401,7 @@ function (_React$Component) {
396
401
  };
397
402
 
398
403
  return Root;
399
- }(React.Component);
404
+ }(Component);
400
405
 
401
406
  Root.propTypes = _objectSpread({}, getProps(PropTypes, 'style', 'keygen'), {
402
407
  active: PropTypes.func,
@@ -51,7 +51,7 @@ export interface RuleParams {
51
51
  } | validFunc | any) ;
52
52
  }
53
53
 
54
- export type RuleParamsType<Value, P = any, FormData = any> = Array<RuleParams | ((value?: Value, formData?: FormData, callback?: ((cbArgs: true | Error) => void), props?: P) => void)>
54
+ export type RuleParamsType<Value, P = any, FormData = any> = Array<RuleParams | ((value?: Value, formData?: FormData, callback?: ((cbArgs: true | Error) => void), props?: P) => void) | object>
55
55
 
56
56
  export interface RuleResult {
57
57
  required (message?: string): Required;
@@ -82,8 +82,31 @@ export interface RuleResult {
82
82
 
83
83
  }
84
84
 
85
- declare function Rule<T extends RuleParams, U>(...options: T[]) : {
86
- [P in keyof T]: (args?: U ) => {args: U, func: validFunc, message?: string}
85
+ export interface paramFunc<U> {
86
+ (args?: U ): {args: U, func: validFunc, message?: string}
87
+ }
88
+
89
+ declare function Rule<U>() : RuleResult
90
+
91
+ declare function Rule<A extends RuleParams, U>(a: A) : {
92
+ [P in keyof A]: paramFunc<U>
93
+ } & RuleResult
94
+
95
+ declare function Rule<A extends RuleParams, B extends RuleParams, U>(a: A, b: B) : {
96
+ [P in keyof (A & B)]: paramFunc<U>
97
+ } & RuleResult
98
+
99
+ declare function Rule<A extends RuleParams, B extends RuleParams, C extends RuleParams, U>(a: A, b: B, c: C) : {
100
+ [P in keyof (A & B & C)]: paramFunc<U>
101
+ } & RuleResult
102
+
103
+ declare function Rule<A extends RuleParams, B extends RuleParams, C extends RuleParams, D extends RuleParams, U>(a: A, b: B, c: C, d: D) : {
104
+ [P in keyof (A & B & C & D)]: paramFunc<U>
105
+ } & RuleResult
106
+
107
+ declare function Rule<
108
+ U>(...args: RuleParams[]) : {
109
+ [key: string]: paramFunc<U>
87
110
  } & RuleResult
88
111
 
89
112
 
@@ -338,18 +338,19 @@ function (_PureComponent) {
338
338
  var showPlaceholder = this.isEmptyResult();
339
339
  var result = showPlaceholder ? this.renderPlaceholder() : this.renderResult();
340
340
  var rtl = isRTL();
341
+ var clearEl = this.renderClear();
341
342
 
342
343
  if (rtl) {
343
344
  return React.createElement("div", {
344
345
  ref: this.bindResult,
345
- className: selectClass('result', compressed && 'compressed', showPlaceholder && 'empty')
346
- }, this.renderClear(), this.renderIndicator(), result);
346
+ className: selectClass('result', compressed && 'compressed', showPlaceholder && 'empty', clearEl && 'result-clearable')
347
+ }, clearEl, this.renderIndicator(), result);
347
348
  }
348
349
 
349
350
  return React.createElement("div", {
350
351
  ref: this.bindResult,
351
- className: selectClass('result', compressed && 'compressed', showPlaceholder && 'empty')
352
- }, result, this.renderIndicator(), this.renderClear());
352
+ className: selectClass('result', compressed && 'compressed', showPlaceholder && 'empty', clearEl && 'result-clearable')
353
+ }, result, this.renderIndicator(), clearEl);
353
354
  };
354
355
 
355
356
  return Result;
@@ -176,9 +176,6 @@
176
176
  margin-top: -5px;
177
177
 
178
178
  &.@{select-prefix}-close {
179
- box-sizing: content-box;
180
- border-left: 1px solid #fff;
181
- border-right: 1px solid #fff;
182
179
  display: none;
183
180
  .close(12px, @select-clear-bg-color);
184
181
  }
@@ -221,6 +218,10 @@
221
218
  &-result:hover &-close {
222
219
  display: block;
223
220
  }
221
+ &-focus &-result-clearable &-multi,
222
+ &-result-clearable:hover &-multi{
223
+ visibility: hidden;
224
+ }
224
225
  &-focus .@{select-prefix}-caret {
225
226
  transform: rotate(180deg);
226
227
  }
@@ -509,6 +510,10 @@
509
510
  display: none;
510
511
  }
511
512
  }
513
+ .@{select-prefix}-multi {
514
+ visibility: visible;
515
+ cursor: not-allowed;
516
+ }
512
517
  }
513
518
  }
514
519
 
@@ -2,24 +2,24 @@ import * as React from 'react'
2
2
  import { StandardProps, RegularAttributes, FormItemStandardProps } from '../@types/common'
3
3
 
4
4
  export interface TextareaProps<Value> extends
5
- StandardProps,
5
+ StandardProps,
6
6
  FormItemStandardProps<Value>
7
7
  {
8
8
 
9
9
  /**
10
10
  * show border bottom
11
- *
11
+ *
12
12
  * 仅仅展示下边框
13
- *
13
+ *
14
14
  * default: false
15
15
  */
16
16
  underline?: boolean;
17
17
 
18
18
  /**
19
19
  * Whether the height changes automatically with the content
20
- *
20
+ *
21
21
  * 高度是否随内容自动变化
22
- *
22
+ *
23
23
  * default: false
24
24
  */
25
25
  autosize?: boolean;
@@ -27,76 +27,87 @@ FormItemStandardProps<Value>
27
27
 
28
28
  /**
29
29
  * User input triggers onChange and to check interval, unit: ms.
30
- *
30
+ *
31
31
  * 用户输入触发 onChange 和校验间隔时间,单位 毫秒。
32
- *
32
+ *
33
33
  * default: 400
34
34
  */
35
35
  delay?: number;
36
36
 
37
37
  /**
38
38
  * Infomation
39
- *
39
+ *
40
40
  * 提示信息
41
- *
41
+ *
42
42
  * default: -
43
43
  */
44
44
  info?: ((value: string) => string) | number;
45
45
 
46
46
  /**
47
47
  * The callback function for enter key
48
- *
48
+ *
49
49
  * 回车键回调函数
50
- *
51
- * default:
50
+ *
51
+ * default:
52
52
  */
53
53
  onEnterPress?: (value: Value) => void;
54
54
 
55
55
  /**
56
56
  * The position where the message pops up
57
- *
57
+ *
58
58
  * 信息弹出位置
59
- *
60
- * default:
59
+ *
60
+ * default:
61
61
  */
62
62
  popover?: RegularAttributes.Position;
63
63
 
64
64
  /**
65
65
  * The minimum row height. Same as native textarea rows property.
66
- *
66
+ *
67
67
  * 最小行高,同原生 textarea rows 属性
68
- *
68
+ *
69
69
  * default: 4
70
70
  */
71
71
  rows?: number;
72
72
 
73
73
  /**
74
74
  * the maxHeight of the textarea, scroll bars appear after more than
75
- *
75
+ *
76
76
  * 输入框的最大高度, 超过之后会出现滚动条
77
- *
77
+ *
78
78
  * default: -
79
79
  */
80
80
  maxHeight?: number | string;
81
81
 
82
82
  /**
83
83
  * When trim is true, blank characters are automatically deleted when lose focus。
84
- *
84
+ *
85
85
  * trim 为 true 时,失去焦点时会自动删除空白字符。
86
- *
86
+ *
87
87
  * default: false
88
88
  */
89
89
  trim?: boolean;
90
90
 
91
91
  /**
92
92
  * support resize
93
- *
93
+ *
94
94
  * 是否可以伸缩高度
95
- *
95
+ *
96
96
  * default: false
97
97
  */
98
98
  resize?: boolean;
99
99
 
100
+ /**
101
+ * disabled
102
+ *
103
+ * 禁用
104
+ *
105
+ * default: false
106
+ */
107
+ disabled?: boolean;
108
+
109
+
110
+
100
111
  }
101
112
 
102
113
  declare class Textarea<Value = any> extends React.Component<TextareaProps<Value>, {}> {}
package/es/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  import './styles/normalize.less'
3
3
  import * as utils from './utils'
4
4
 
5
- export default { utils, version: '1.8.0' }
5
+ export default { utils, version: '1.8.1' }
6
6
  export { utils }
7
7
  export { setLocale } from './locale'
8
8
  export { color, style } from './utils/expose'
package/es/index.js CHANGED
@@ -3,7 +3,7 @@ import './styles/normalize.less';
3
3
  import * as utils from './utils';
4
4
  export default {
5
5
  utils: utils,
6
- version: '1.8.0'
6
+ version: '1.8.1'
7
7
  };
8
8
  export { utils };
9
9
  export { setLocale } from './locale';
@@ -349,11 +349,12 @@ function (_PureComponent) {
349
349
  compressed = _this$props8.compressed,
350
350
  multiple = _this$props8.multiple;
351
351
  var result = value.length === 0 ? this.renderPlaceholder() : this.renderResult();
352
+ var clearEl = this.renderClear();
352
353
  return _react.default.createElement("div", {
353
354
  ref: this.bindResult,
354
- className: (0, _styles3.cascaderClass)('result', multiple && compressed && 'compressed'),
355
+ className: (0, _styles3.cascaderClass)('result', multiple && compressed && 'compressed', clearEl && 'result-clearable'),
355
356
  style: style
356
- }, result, this.renderIndicator(), this.renderClear());
357
+ }, result, this.renderIndicator(), clearEl);
357
358
  };
358
359
 
359
360
  return Result;
@@ -5,6 +5,7 @@
5
5
  @list-prefix: ~'@{so-prefix}-list';
6
6
  @checkinput-prefix: ~'@{so-prefix}-checkinput';
7
7
  @input-prefix: ~'@{so-prefix}-input';
8
+ @select-prefix: ~'@{so-prefix}-select';
8
9
 
9
10
  .@{cascader-prefix} {
10
11
  position: relative;
@@ -127,13 +128,22 @@
127
128
  background-color: inherit;
128
129
  color: inherit;
129
130
  }
131
+ .@{select-prefix}-multi {
132
+ visibility: visible;
133
+ cursor: not-allowed;
134
+ }
130
135
  }
131
136
 
132
137
  &:not(&-disabled) {
133
- .@{cascader-prefix}-focus .@{cascader-prefix}-close,
138
+ &.@{cascader-prefix}-focus .@{cascader-prefix}-close,
134
139
  .@{cascader-prefix}-result:hover .@{cascader-prefix}-close {
135
140
  display: block;
136
141
  }
142
+
143
+ &.@{cascader-prefix}-focus .@{cascader-prefix}-result-clearable .@{select-prefix}-multi,
144
+ .@{cascader-prefix}-result-clearable:hover .@{select-prefix}-multi {
145
+ visibility: hidden;
146
+ }
137
147
  }
138
148
 
139
149
  &-multiple {
@@ -108,12 +108,14 @@ function (_PureComponent) {
108
108
  data = _this$props2.data,
109
109
  datum = _this$props2.datum,
110
110
  keygen = _this$props2.keygen,
111
- children = _this$props2.children;
111
+ children = _this$props2.children,
112
+ style = _this$props2.style;
112
113
  var className = (0, _classnames.default)((0, _styles.checkinputClass)('group', ['no-block', 'block'][Number(block)]), this.props.className);
113
114
 
114
115
  if (data === undefined) {
115
116
  return _react.default.createElement("div", {
116
- className: className
117
+ className: className,
118
+ style: style
117
119
  }, _react.default.createElement(_context.Provider, {
118
120
  value: {
119
121
  onRawChange: this.handleRawChange,
@@ -123,7 +125,8 @@ function (_PureComponent) {
123
125
  }
124
126
 
125
127
  return _react.default.createElement("div", {
126
- className: className
128
+ className: className,
129
+ style: style
127
130
  }, data.map(function (d, i) {
128
131
  return _react.default.createElement(_Checkbox.default, {
129
132
  checked: datum.check(d),
@@ -47,7 +47,7 @@ export interface CheckboxProps<T> extends StandardProps, FormItemStandardProps<T
47
47
 
48
48
  // attention: checkbox group value is array
49
49
 
50
- export interface CheckboxGroupProps<Data, T> extends ListItemStandardProps<Data, T>, Omit<FormItemStandardProps<T[]>, 'placeholder'> {
50
+ export interface CheckboxGroupProps<Data, T> extends ListItemStandardProps<Data, T>, Omit<FormItemStandardProps<T[]>, 'placeholder'>, StandardProps {
51
51
 
52
52
  /**
53
53
  * The data item
@@ -76,7 +76,8 @@ function (_PureComponent) {
76
76
  type = _this$props3.type,
77
77
  current = _this$props3.current,
78
78
  index = _this$props3.index,
79
- rangeDate = _this$props3.rangeDate;
79
+ rangeDate = _this$props3.rangeDate,
80
+ max = _this$props3.max;
80
81
 
81
82
  var date = _utils.default.toDate(MONTHBASE);
82
83
 
@@ -84,6 +85,10 @@ function (_PureComponent) {
84
85
  date.setFullYear(current.getFullYear());
85
86
  var isDisabled = min && _utils.default.compareMonth(min, date, 1) >= 0;
86
87
 
88
+ if (!isDisabled) {
89
+ isDisabled = max && _utils.default.compareMonth(date, max, 1) >= 0;
90
+ }
91
+
87
92
  if (!isDisabled && type === 'month' && typeof disabled === 'function') {
88
93
  isDisabled = disabled(date);
89
94
  }
@@ -137,6 +142,7 @@ Month.propTypes = {
137
142
  current: _propTypes.default.object.isRequired,
138
143
  disabled: _propTypes.default.func,
139
144
  // max: PropTypes.object,
145
+ max: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
140
146
  min: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
141
147
  onChange: _propTypes.default.func.isRequired,
142
148
  onModeChange: _propTypes.default.func.isRequired,
package/lib/Datum/Tree.js CHANGED
@@ -303,7 +303,8 @@ function () {
303
303
  var id = _this5.getKey(d, path[path.length - 1], i);
304
304
 
305
305
  if (_this5.dataMap.get(id)) {
306
- console.warn("There is already a key \"" + id + "\" exists. The key must be unique.");
306
+ console.error("There is already a key \"" + id + "\" exists. The key must be unique.");
307
+ return;
307
308
  }
308
309
 
309
310
  _this5.dataMap.set(id, d);
package/lib/Menu/Root.js CHANGED
@@ -37,6 +37,8 @@ var _is = require("../utils/is");
37
37
 
38
38
  var _config = require("../config");
39
39
 
40
+ var _component = require("../component");
41
+
40
42
  var modeDirection = {
41
43
  'vertical-auto': 'y',
42
44
  vertical: 'y',
@@ -78,13 +80,13 @@ function keyToMap(keys, value) {
78
80
 
79
81
  var Root =
80
82
  /*#__PURE__*/
81
- function (_React$Component) {
82
- (0, _inheritsLoose2.default)(Root, _React$Component);
83
+ function (_Component) {
84
+ (0, _inheritsLoose2.default)(Root, _Component);
83
85
 
84
86
  function Root(props) {
85
87
  var _this;
86
88
 
87
- _this = _React$Component.call(this, props) || this;
89
+ _this = _Component.call(this, props) || this;
88
90
  _this.state = {
89
91
  activeKey: null,
90
92
  scrollTop: 0,
@@ -115,6 +117,8 @@ function (_React$Component) {
115
117
  var _proto = Root.prototype;
116
118
 
117
119
  _proto.componentDidMount = function componentDidMount() {
120
+ _Component.prototype.componentDidMount.call(this);
121
+
118
122
  this.updateState();
119
123
  };
120
124
 
@@ -124,6 +128,8 @@ function (_React$Component) {
124
128
 
125
129
  _proto.componentWillUnmount = function componentWillUnmount() {
126
130
  this.container.removeEventListener('wheel', this.handleWheel);
131
+
132
+ _Component.prototype.componentWillUnmount.call(this);
127
133
  };
128
134
 
129
135
  _proto.getOpenKeys = function getOpenKeys() {
@@ -419,7 +425,7 @@ function (_React$Component) {
419
425
  };
420
426
 
421
427
  return Root;
422
- }(_react.default.Component);
428
+ }(_component.Component);
423
429
 
424
430
  Root.propTypes = (0, _objectSpread2.default)({}, (0, _proptypes.getProps)(_propTypes.default, 'style', 'keygen'), {
425
431
  active: _propTypes.default.func,
@@ -51,7 +51,7 @@ export interface RuleParams {
51
51
  } | validFunc | any) ;
52
52
  }
53
53
 
54
- export type RuleParamsType<Value, P = any, FormData = any> = Array<RuleParams | ((value?: Value, formData?: FormData, callback?: ((cbArgs: true | Error) => void), props?: P) => void)>
54
+ export type RuleParamsType<Value, P = any, FormData = any> = Array<RuleParams | ((value?: Value, formData?: FormData, callback?: ((cbArgs: true | Error) => void), props?: P) => void) | object>
55
55
 
56
56
  export interface RuleResult {
57
57
  required (message?: string): Required;
@@ -82,8 +82,31 @@ export interface RuleResult {
82
82
 
83
83
  }
84
84
 
85
- declare function Rule<T extends RuleParams, U>(...options: T[]) : {
86
- [P in keyof T]: (args?: U ) => {args: U, func: validFunc, message?: string}
85
+ export interface paramFunc<U> {
86
+ (args?: U ): {args: U, func: validFunc, message?: string}
87
+ }
88
+
89
+ declare function Rule<U>() : RuleResult
90
+
91
+ declare function Rule<A extends RuleParams, U>(a: A) : {
92
+ [P in keyof A]: paramFunc<U>
93
+ } & RuleResult
94
+
95
+ declare function Rule<A extends RuleParams, B extends RuleParams, U>(a: A, b: B) : {
96
+ [P in keyof (A & B)]: paramFunc<U>
97
+ } & RuleResult
98
+
99
+ declare function Rule<A extends RuleParams, B extends RuleParams, C extends RuleParams, U>(a: A, b: B, c: C) : {
100
+ [P in keyof (A & B & C)]: paramFunc<U>
101
+ } & RuleResult
102
+
103
+ declare function Rule<A extends RuleParams, B extends RuleParams, C extends RuleParams, D extends RuleParams, U>(a: A, b: B, c: C, d: D) : {
104
+ [P in keyof (A & B & C & D)]: paramFunc<U>
105
+ } & RuleResult
106
+
107
+ declare function Rule<
108
+ U>(...args: RuleParams[]) : {
109
+ [key: string]: paramFunc<U>
87
110
  } & RuleResult
88
111
 
89
112