shineout 2.0.0-rc.5 → 2.0.0-rc.7

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 (68) hide show
  1. package/css/Cascader/Node.d.ts +2 -2
  2. package/css/Checkbox/CheckItem.js +13 -5
  3. package/css/Checkbox/Group.d.ts +2 -2
  4. package/css/Checkbox/Props.d.ts +14 -3
  5. package/css/Checkbox/styles/checkinput.css +14 -0
  6. package/css/DataList/List.d.ts +2 -2
  7. package/css/Form/Props.d.ts +2 -0
  8. package/css/Modal/Props.d.ts +2 -1
  9. package/css/Radio/Group.d.ts +2 -2
  10. package/css/Radio/Props.d.ts +2 -0
  11. package/css/Scroll/Props.d.ts +2 -0
  12. package/css/Select/Select.js +0 -1
  13. package/css/Table/Props.d.ts +3 -2
  14. package/css/Table/Tbody.d.ts +1 -1
  15. package/css/Table/Td.d.ts +5 -5
  16. package/css/Transfer/Props.d.ts +8 -1
  17. package/css/Tree/Props.d.ts +4 -3
  18. package/css/Upload/Props.d.ts +2 -0
  19. package/css/index.js +1 -1
  20. package/css/utils/clone.js +14 -0
  21. package/dist/shineout.js +4000 -3787
  22. package/dist/shineout.js.map +1 -1
  23. package/dist/shineout.min.js +1 -1
  24. package/dist/theme.antd.css +1 -1
  25. package/dist/theme.antd2.css +1 -1
  26. package/dist/theme.default.css +1 -1
  27. package/dist/theme.shineout.css +1 -1
  28. package/esm/Cascader/Node.d.ts +2 -2
  29. package/esm/Checkbox/CheckItem.js +12 -5
  30. package/esm/Checkbox/Group.d.ts +2 -2
  31. package/esm/Checkbox/Props.d.ts +14 -3
  32. package/esm/Checkbox/styles/checkinput.less +17 -0
  33. package/esm/DataList/List.d.ts +2 -2
  34. package/esm/Form/Props.d.ts +2 -0
  35. package/esm/Modal/Props.d.ts +2 -1
  36. package/esm/Radio/Group.d.ts +2 -2
  37. package/esm/Radio/Props.d.ts +2 -0
  38. package/esm/Scroll/Props.d.ts +2 -0
  39. package/esm/Select/Select.js +0 -1
  40. package/esm/Table/Props.d.ts +3 -2
  41. package/esm/Table/Tbody.d.ts +1 -1
  42. package/esm/Table/Td.d.ts +5 -5
  43. package/esm/Transfer/Props.d.ts +8 -1
  44. package/esm/Tree/Props.d.ts +4 -3
  45. package/esm/Upload/Props.d.ts +2 -0
  46. package/esm/index.js +1 -1
  47. package/esm/utils/clone.js +14 -0
  48. package/lib/Cascader/Node.d.ts +2 -2
  49. package/lib/Checkbox/CheckItem.js +13 -5
  50. package/lib/Checkbox/Group.d.ts +2 -2
  51. package/lib/Checkbox/Props.d.ts +14 -3
  52. package/lib/Checkbox/styles/checkinput.less +17 -0
  53. package/lib/DataList/List.d.ts +2 -2
  54. package/lib/Form/Props.d.ts +2 -0
  55. package/lib/Modal/Props.d.ts +2 -1
  56. package/lib/Radio/Group.d.ts +2 -2
  57. package/lib/Radio/Props.d.ts +2 -0
  58. package/lib/Scroll/Props.d.ts +2 -0
  59. package/lib/Select/Select.js +0 -1
  60. package/lib/Table/Props.d.ts +3 -2
  61. package/lib/Table/Tbody.d.ts +1 -1
  62. package/lib/Table/Td.d.ts +5 -5
  63. package/lib/Transfer/Props.d.ts +8 -1
  64. package/lib/Tree/Props.d.ts +4 -3
  65. package/lib/Upload/Props.d.ts +2 -0
  66. package/lib/index.js +1 -1
  67. package/lib/utils/clone.js +14 -0
  68. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { CascaderBaseValue, NodeProps } from './Props';
3
3
  import { PureComponent } from '../component';
4
4
  interface NodeState {
@@ -13,7 +13,7 @@ declare class Node<U, T extends CascaderBaseValue> extends PureComponent<NodePro
13
13
  handlePathChange(): void;
14
14
  handleChange(_: any, checked: boolean): void;
15
15
  handleSelect(e: MouseEvent): void;
16
- renderContent(): React.ReactNode;
16
+ renderContent(): ReactNode;
17
17
  render(): JSX.Element;
18
18
  }
19
19
  export default Node;
@@ -31,6 +31,8 @@ var _is = require("../utils/is");
31
31
 
32
32
  var _Input = _interopRequireDefault(require("../Input"));
33
33
 
34
+ var _Spin = _interopRequireDefault(require("../Spin"));
35
+
34
36
  var _styles = require("./styles");
35
37
 
36
38
  var _config = require("../config");
@@ -154,11 +156,13 @@ function checkItem(type) {
154
156
  size = _this$props5.size,
155
157
  children = _this$props5.children,
156
158
  inputable = _this$props5.inputable,
157
- onClick = _this$props5.onClick;
159
+ onClick = _this$props5.onClick,
160
+ loading = _this$props5.loading;
158
161
  var rtl = (0, _config.isRTL)();
159
162
  var checked = this.getChecked();
160
163
  var isSwitch = type === 'switch';
161
- var className = (0, _classnames.default)((0, _styles.checkinputClass)('_', disabled && 'disabled', checked === true && 'checked', checked === 'indeterminate' && 'indeterminate', isSwitch && 'switch', type + "-container", rtl && 'rtl', {
164
+ var ban = disabled || isSwitch && loading;
165
+ var className = (0, _classnames.default)((0, _styles.checkinputClass)('_', ban && 'disabled', checked === true && 'checked', checked === 'indeterminate' && 'indeterminate', isSwitch && 'switch', loading && 'loading', type + "-container", rtl && 'rtl', {
162
166
  large: size === 'large',
163
167
  small: size === 'small'
164
168
  }), this.props.className);
@@ -180,10 +184,10 @@ function checkItem(type) {
180
184
  ref: this.bindRef
181
185
  /* @ts-ignore */
182
186
  ,
183
- disabled: disabled
187
+ disabled: ban
184
188
  }, (0, _getDataset.default)(this.props)), switchChildren, _react.default.createElement("input", {
185
189
  id: this.id,
186
- disabled: disabled,
190
+ disabled: ban,
187
191
  tabIndex: -1,
188
192
  type: isSwitch ? 'checkbox' : type,
189
193
  onClick: onClick,
@@ -199,7 +203,11 @@ function checkItem(type) {
199
203
  value: value
200
204
  }), isSwitch && _react.default.createElement("span", {
201
205
  className: (0, _styles.checkinputClass)((0, _classname.getDirectionClass)('switch-indicator'))
202
- }));
206
+ }, loading ? _react.default.createElement(_Spin.default, {
207
+ size: "auto",
208
+ color: "none",
209
+ name: "ring"
210
+ }) : null));
203
211
  };
204
212
 
205
213
  return CheckItem;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { PureComponent } from '../component';
3
3
  import { BaseCheckboxGroupProps, CheckValueType } from './Props';
4
4
  declare class CheckboxGroup<DataItem, Value> extends PureComponent<BaseCheckboxGroupProps<DataItem, Value>, {}> {
@@ -8,7 +8,7 @@ declare class CheckboxGroup<DataItem, Value> extends PureComponent<BaseCheckboxG
8
8
  constructor(props: BaseCheckboxGroupProps<DataItem, Value>);
9
9
  componentDidMount(): void;
10
10
  componentWillUnmount(): void;
11
- getContent(d: DataItem): React.ReactNode;
11
+ getContent(d: DataItem): ReactNode;
12
12
  handleUpdate(): void;
13
13
  handleClick(_val: unknown, checked: CheckValueType, index: number): void;
14
14
  handleRawChange(value: DataItem, checked: CheckValueType): void;
@@ -6,6 +6,7 @@ import { GetDatumListProps } from '../Datum/Props';
6
6
  export declare type CheckValueType = boolean | 'indeterminate';
7
7
  export declare type CheckType = 'radio' | 'switch' | 'checkbox';
8
8
  export interface CheckItemProps extends StandardProps {
9
+ children?: ReactNode;
9
10
  /**
10
11
  * disable checkbox
11
12
  *
@@ -14,6 +15,15 @@ export interface CheckItemProps extends StandardProps {
14
15
  * default: false
15
16
  */
16
17
  disabled?: boolean;
18
+ /**
19
+ *
20
+ * loading
21
+ *
22
+ * 加载中
23
+ *
24
+ * default: false
25
+ */
26
+ loading?: boolean;
17
27
  /**
18
28
  * if not set, use (value === htmlValue).
19
29
  *
@@ -60,14 +70,14 @@ export interface CheckItemProps extends StandardProps {
60
70
  size?: 'small' | 'default' | 'large';
61
71
  content?: [ReactNode, ReactNode] | [];
62
72
  }
63
- export declare type SimpleCheckProps = Omit<CheckItemProps, 'content' | 'onChange'> & {
73
+ export declare type SimpleCheckProps = Omit<CheckItemProps, 'content' | 'onChange' | 'loading'> & {
64
74
  onChange?: ((value: any, checked: CheckValueType, index?: number) => void);
65
75
  };
66
- export declare type SimpleRadioProps = Omit<CheckItemProps, 'content' | 'onChange' | 'onRawChange' | 'inputable' | 'value'> & {
76
+ export declare type SimpleRadioProps = Omit<CheckItemProps, 'content' | 'onChange' | 'onRawChange' | 'inputable' | 'value' | 'loading'> & {
67
77
  checked?: boolean | ((htmlValue: any) => boolean);
68
78
  onChange?: ((value: any, checked: CheckValueType, index?: number) => void);
69
79
  };
70
- export declare type SimpleSwitchProps = Omit<CheckItemProps, 'onChange' | 'onRawChange' | 'inputable' | 'value'> & {
80
+ export declare type SimpleSwitchProps = Omit<CheckItemProps, 'onChange' | 'onRawChange' | 'inputable' | 'value' | 'children'> & {
71
81
  checked?: boolean | ((htmlValue: any) => boolean);
72
82
  onChange?: ((value: boolean) => void);
73
83
  };
@@ -77,6 +87,7 @@ export interface CheckboxContextProvider {
77
87
  }
78
88
  export declare type CheckboxProviderProps<U> = Omit<U, 'onRawChange'>;
79
89
  export interface BaseCheckboxGroupProps<DataItem, Value> extends StandardProps {
90
+ children?: ReactNode;
80
91
  /**
81
92
  * When it is a string, return d[string]. When it is a function, return the result of the function.
82
93
  *
@@ -393,11 +393,22 @@ fieldset[disabled] .so-checkinput-button .so-checkinput.so-checkinput-checked:ac
393
393
  border-radius: 50%;
394
394
  -webkit-box-shadow: 0 1px 4px var(--gray-500, #adb5bd);
395
395
  box-shadow: 0 1px 4px var(--gray-500, #adb5bd);
396
+ font-size: var(--switch-indicator-size, 24px);
397
+ color: var(--switch-unchecked-bg, #ced4da);
396
398
  }
397
399
  .so-checkinput-rtl .so-checkinput-switch-indicator {
398
400
  left: auto;
399
401
  right: var(--switch-indicator-padding-horizontal, 0px);
400
402
  }
403
+ .so-checkinput-loading .so-checkinput-switch-indicator .so-spin-ring {
404
+ position: absolute;
405
+ top: 12%;
406
+ left: 12%;
407
+ right: 12%;
408
+ bottom: 12%;
409
+ border-width: 0.12em;
410
+ border-top-color: currentColor;
411
+ }
401
412
  .so-checkinput-switch-children {
402
413
  font-size: 12px;
403
414
  color: #fff;
@@ -416,6 +427,7 @@ fieldset[disabled] .so-checkinput-button .so-checkinput.so-checkinput-checked:ac
416
427
  -webkit-box-shadow: var(--switch-checked-box-shadow, 0 1px 4px var(--primary-color-fade-50, rgba(51, 153, 255, 0.5)));
417
428
  box-shadow: var(--switch-checked-box-shadow, 0 1px 4px var(--primary-color-fade-50, rgba(51, 153, 255, 0.5)));
418
429
  background: var(--switch-indicator-checked-bg, var(--primary-color, #3399ff));
430
+ color: var(--switch-checked-bg, var(--primary-color-fade-50, rgba(51, 153, 255, 0.5)));
419
431
  }
420
432
  .so-checkinput-checked.so-checkinput-switch .so-checkinput-switch-indicator-ltr {
421
433
  left: 100%;
@@ -465,6 +477,7 @@ fieldset[disabled] .so-checkinput-button .so-checkinput.so-checkinput-checked:ac
465
477
  top: var(--switch-small-indicator-top, -3px);
466
478
  padding-left: 8px;
467
479
  padding-right: 8px;
480
+ font-size: var(--switch-small-indicator-size, 16px);
468
481
  }
469
482
  .so-checkinput-large.so-checkinput-switch {
470
483
  min-width: 60px;
@@ -482,6 +495,7 @@ fieldset[disabled] .so-checkinput-button .so-checkinput.so-checkinput-checked:ac
482
495
  width: var(--switch-large-indicator-size, 32px);
483
496
  height: var(--switch-large-indicator-size, 32px);
484
497
  top: var(--switch-large-indicator-top, -5px);
498
+ font-size: var(--switch-large-indicator-size, 32px);
485
499
  }
486
500
  .so-checkinput-disabled.so-checkinput-switch {
487
501
  opacity: 0.4;
@@ -1,4 +1,4 @@
1
- import React, { Component } from 'react';
1
+ import { Component, ReactNode } from 'react';
2
2
  import { BaseListProps } from './Props';
3
3
  declare class Index<U, T> extends Component<BaseListProps<U, T>> {
4
4
  static defaultProps: {
@@ -13,7 +13,7 @@ declare class Index<U, T> extends Component<BaseListProps<U, T>> {
13
13
  constructor(props: BaseListProps<U, T>);
14
14
  componentWillUnmount(): void;
15
15
  getItemClassName(value: U, index: number, flag?: boolean): string;
16
- getContent(value: U, index: number): React.ReactNode;
16
+ getContent(value: U, index: number): ReactNode;
17
17
  scrollLoading(): void;
18
18
  bindNode(node: HTMLDivElement): void;
19
19
  bindObserver(node: HTMLDivElement): void;
@@ -210,6 +210,7 @@ export interface FormModeProps {
210
210
  /** ----------------form-----------------------* */
211
211
  export declare type formStatus = 'disabled' | 'pending' | '';
212
212
  export interface SimpleFormProps<Value = ObjectType> extends StandardProps {
213
+ children?: ReactNode;
213
214
  /**
214
215
  * Form value
215
216
  *
@@ -355,6 +356,7 @@ export interface ItemProps extends StandardProps {
355
356
  tip?: React.ReactNode;
356
357
  formDatum?: FormDatum<any>;
357
358
  labelVerticalAlign?: 'top' | 'middle' | 'bottom';
359
+ children?: React.ReactNode;
358
360
  }
359
361
  /** ----------------formButton-----------------------* */
360
362
  export interface FormButtonProps extends Omit<ButtonProps, 'htmlType' | 'onRef'> {
@@ -223,7 +223,7 @@ export interface ModalProps extends StandardProps {
223
223
  drawer?: boolean;
224
224
  children?: ReactNode;
225
225
  }
226
- export interface ModalPanelProps extends StandardProps, Pick<ModalProps, 'footer' | 'maskCloseAble' | 'noPadding' | 'onClose' | 'padding' | 'position' | 'title' | 'type' | 'width' | 'moveable' | 'resizable' | 'hideClose' | 'zoom' | 'events' | 'fullScreen' | 'top' | 'bodyStyle'> {
226
+ export interface ModalPanelProps extends StandardProps, Pick<ModalProps, 'children' | 'footer' | 'maskCloseAble' | 'noPadding' | 'onClose' | 'padding' | 'position' | 'title' | 'type' | 'width' | 'moveable' | 'resizable' | 'hideClose' | 'zoom' | 'events' | 'fullScreen' | 'top' | 'bodyStyle'> {
227
227
  id?: string;
228
228
  from?: string;
229
229
  container?: Element;
@@ -291,6 +291,7 @@ export interface ModalFunctionOptions extends Omit<ModalProps, 'usePortal' | 'de
291
291
  * default: -
292
292
  */
293
293
  noPadding?: boolean;
294
+ children?: ReactNode;
294
295
  }
295
296
  export declare type Options = ModalFunctionOptions & {
296
297
  id: string;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { PureComponent } from '../component';
3
3
  import { BaseRadioGroupProps } from './Props';
4
4
  import { CheckValueType } from '../Checkbox/Props';
@@ -10,7 +10,7 @@ declare class RadioGroup<DataItem, Value> extends PureComponent<BaseRadioGroupPr
10
10
  constructor(props: BaseRadioGroupProps<DataItem, Value>);
11
11
  componentDidMount(): void;
12
12
  componentWillUnmount(): void;
13
- getContent(d: DataItem, index: number): React.ReactNode;
13
+ getContent(d: DataItem, index: number): ReactNode;
14
14
  handleClick(_val: any, _checked: CheckValueType, index: number): void;
15
15
  handleRawChange(value: DataItem): void;
16
16
  render(): JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { ReactNode } from 'react';
2
3
  import { GetInputableProps } from '../Form/Props';
3
4
  import { GetDatumListProps } from '../Datum/Props';
4
5
  import { LiteralUnion, RegularAttributes } from '../@types/common';
@@ -6,6 +7,7 @@ import { SimpleRadioProps } from '../Checkbox/Props';
6
7
  import { KeygenType, StandardProps } from '../@types/common';
7
8
  import ListDatum from '../Datum/List';
8
9
  export interface BaseRadioGroupProps<DataItem, Value> extends StandardProps {
10
+ children?: ReactNode;
9
11
  /**
10
12
  * When it is a string, return d[string]. When it is a function, return the result of the function.
11
13
  *
@@ -21,6 +21,7 @@ export interface ScrollProps {
21
21
  innerScrollAttr?: string[];
22
22
  className?: string;
23
23
  style?: CSSProperties;
24
+ children?: ReactNode;
24
25
  }
25
26
  /** ------ bar ------ */
26
27
  export interface BarProps {
@@ -41,4 +42,5 @@ export interface ScrollIndexProps extends Omit<ScrollProps, 'left' | 'top' | 'sc
41
42
  scrollLeft?: number;
42
43
  scrollTop?: number;
43
44
  scroll?: ScrollFixedType;
45
+ children?: ReactNode;
44
46
  }
@@ -298,7 +298,6 @@ function (_PureComponent) {
298
298
  _proto.handleChange = function handleChange(_isActive, data, fromInput) {
299
299
  var _this2 = this;
300
300
 
301
- console.log('fromInput', fromInput);
302
301
  var _this$props4 = this.props,
303
302
  datum = _this$props4.datum,
304
303
  multiple = _this$props4.multiple,
@@ -277,9 +277,10 @@ export declare class Table<DataItem, Value> extends React.Component<TableProps<D
277
277
  export declare type TableType = typeof Table;
278
278
  /** ------ simpleTable ---------- */
279
279
  export interface SimpleTableProps<DataItem, Value> {
280
+ children?: ReactNode;
280
281
  width?: number;
281
282
  dataChangeResize?: boolean;
282
- externalExpandRender?: (rowData: DataItem, index: number) => ReactNode;
283
+ externalExpandRender?: (rowData: DataItem, index: number) => () => ReactNode;
283
284
  expandKeys?: KeygenResult[];
284
285
  keygen: StructKeygenType<DataItem>;
285
286
  resetFixAuto: (is?: boolean) => boolean;
@@ -403,7 +404,7 @@ export interface Row<DataItem> {
403
404
  }
404
405
  /** ------ tr ---------- */
405
406
  export interface TrProps<DataItem, Value> extends Omit<TbodyProps<DataItem, Value>, 'data' | 'keygen' | 'sorter' | 'expandKeys' | 'colgroup'> {
406
- onExpand: (key: KeygenResult, expanded?: ReactNode) => void;
407
+ onExpand: (key: KeygenResult, expanded?: () => ReactNode) => void;
407
408
  expandRender?: ((rowData: DataItem, index?: number) => ReactNode) | ReactNode;
408
409
  rowKey?: string | number;
409
410
  rowData: DataItem;
@@ -19,7 +19,7 @@ declare class Tbody<DataItem, Value> extends PureComponent<TbodyProps<DataItem,
19
19
  componentDidUpdate(prevProps: TbodyProps<DataItem, Value>): void;
20
20
  bodyRender(): void;
21
21
  bindBody(el: HTMLTableSectionElement): void;
22
- handleExpand(key: KeygenResult, render: ReactNode): void;
22
+ handleExpand(key: KeygenResult, render: () => ReactNode): void;
23
23
  findExpandFunc(key: KeygenResult, i: number): React.ReactNode;
24
24
  renderTr(row: Row<DataItem>[], i: number): JSX.Element;
25
25
  renderPlaceholderTr(): JSX.Element;
package/css/Table/Td.d.ts CHANGED
@@ -1,18 +1,18 @@
1
- import React, { PureComponent, ReactNode } from 'react';
1
+ import { PureComponent, ReactNode } from 'react';
2
2
  import { TdProps } from './Props';
3
3
  export declare const CLASS_FIXED_LEFT = "fixed-left";
4
4
  export declare const CLASS_FIXED_RIGHT = "fixed-right";
5
5
  declare class Td<DataItem, Value> extends PureComponent<TdProps<DataItem, Value>> {
6
6
  static defaultProps: any;
7
- cachedRender: ReactNode;
7
+ cachedRender: () => ReactNode;
8
8
  constructor(props: TdProps<DataItem, Value>);
9
9
  handleExpandClick(): void;
10
10
  handleTreeExpand(): void;
11
- renderCheckbox(): React.ReactNode;
11
+ renderCheckbox(): ReactNode;
12
12
  renderExpand(index: number): JSX.Element | null;
13
13
  renderTreeExpand(content: ReactNode): JSX.Element;
14
- renderResult(): React.ReactNode;
15
- renderContent(): React.ReactNode;
14
+ renderResult(): ReactNode;
15
+ renderContent(): ReactNode;
16
16
  render(): JSX.Element;
17
17
  }
18
18
  export default Td;
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { ReactNode } from 'react';
2
3
  import ListDatum from '../Datum/List';
3
4
  import { GetDatumListProps } from '../Datum/Props';
4
5
  import { KeygenResult, LiteralUnion, StructKeygenType } from '../@types/common';
@@ -123,7 +124,13 @@ export interface BaseTransferProps<DataItem, Value extends any[]> {
123
124
  * default: -
124
125
  */
125
126
  renderFilter?: (value: filterProps) => React.ReactNode;
126
- children?: React.ReactNode;
127
+ children?: (props: {
128
+ onSelected: (keys: KeygenResult) => void;
129
+ direction: 'left' | 'right';
130
+ selectedKeys: KeygenResult[];
131
+ value: Value;
132
+ filterText: string;
133
+ }) => ReactNode;
127
134
  }
128
135
  /** ----------- btns ------------*/
129
136
  export interface BtnProps<DataItem, Value extends any[]> extends Pick<BaseTransferProps<DataItem, Value>, 'datum' | 'keygen' | 'operationIcon' | 'data' | 'disabled'>, Required<Pick<BaseTransferProps<DataItem, Value>, 'operations' | 'data'>> {
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
- import { ComponentType } from 'react';
3
2
  import * as CSS from 'csstype';
4
3
  import { KeygenResult, LiteralUnion, StandardProps, ValueItem } from '../@types/common';
5
4
  import DatumTree, { TreePathType, TreeModeType } from '../Datum/Tree';
6
5
  import { GetInputableProps } from '../Form/Props';
6
+ declare type ExpandIconType<Item> = React.ReactNode | ((d: Item) => React.ReactNode);
7
7
  /** ------------ Tree -------------- */
8
8
  export interface TreeProps<DataItem, Value extends any[]> extends StandardProps {
9
9
  /**
@@ -137,7 +137,7 @@ export interface TreeProps<DataItem, Value extends any[]> extends StandardProps
137
137
  *
138
138
  * default: none
139
139
  */
140
- expandIcons?: React.ReactNode[];
140
+ expandIcons?: [ExpandIconType<DataItem>, ExpandIconType<DataItem>];
141
141
  /**
142
142
  * desc: style when drap images
143
143
  *
@@ -269,7 +269,7 @@ export interface NodeProps<DataItem, Value extends any[]> extends Omit<ListProps
269
269
  id: KeygenResult;
270
270
  data: DataItem;
271
271
  index: number;
272
- listComponent: ComponentType<ListProps<DataItem, Value>>;
272
+ listComponent: React.ComponentType<ListProps<DataItem, Value>>;
273
273
  }
274
274
  /** ------------ Content -------------- */
275
275
  export interface ContentProps<DataItem, Value extends any[]> extends Omit<NodeProps<DataItem, Value>, 'listComponent' | 'onDrop' | 'childrenClass' | 'leafClass' | 'nodeClass'> {
@@ -289,3 +289,4 @@ export declare class TreeField<DataItem, Value extends any[]> extends React.Comp
289
289
  render: () => JSX.Element;
290
290
  }
291
291
  export declare type TreeFieldType = typeof TreeField;
292
+ export {};
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { ReactNode } from 'react';
2
3
  import { ObjectType, StandardProps } from '../@types/common';
3
4
  import { PopoverConfirmProps } from '../Popover/Props';
4
5
  import { GapProps } from '../Gap/Props';
@@ -445,6 +446,7 @@ export interface DropProps<ValueItem> extends Pick<AcceptUpload<ValueItem>, 'dro
445
446
  dropData?: any;
446
447
  onDrop?: (files: File[], index: number) => void;
447
448
  className?: string;
449
+ children?: ReactNode;
448
450
  }
449
451
  export interface FileProps {
450
452
  id: string;
package/css/index.js CHANGED
@@ -220,6 +220,6 @@ exports.Upload = _Upload.default;
220
220
  // Created by scripts/src-index.js.
221
221
  var _default = {
222
222
  utils: utils,
223
- version: '2.0.0-rc.5'
223
+ version: '2.0.0-rc.7'
224
224
  };
225
225
  exports.default = _default;
@@ -18,6 +18,20 @@ var cloneObject = function cloneObject(source, specialKeys) {
18
18
  }
19
19
 
20
20
  var target = Object.create(Object.getPrototypeOf(source));
21
+ /* File or Response (non-serializable data) will throw error */
22
+
23
+ try {
24
+ // eslint-disable-next-line guard-for-in
25
+ for (var key in target) {
26
+ target[key] = target[key];
27
+ }
28
+ } catch (e) {
29
+ console.error('should not pass non-serializable data', source);
30
+ console.error(e);
31
+ target = {};
32
+ }
33
+
34
+ ;
21
35
  [].concat(specialKeys, Object.keys(source)).forEach(function (k) {
22
36
  // eslint-disable-next-line
23
37
  target[k] = deepClone(source[k]);