@douyinfe/semi-ui 2.52.0 → 2.53.0-beta.0

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 (125) hide show
  1. package/dist/umd/semi-ui.js +787 -1188
  2. package/dist/umd/semi-ui.js.map +1 -1
  3. package/dist/umd/semi-ui.min.js +1 -1
  4. package/dist/umd/semi-ui.min.js.map +1 -1
  5. package/lib/cjs/_utils/index.d.ts +2 -0
  6. package/lib/cjs/_utils/index.js +77 -0
  7. package/lib/cjs/_utils/semi-global.d.ts +46 -0
  8. package/lib/cjs/_utils/semi-global.js +13 -0
  9. package/lib/cjs/autoComplete/index.d.ts +2 -25
  10. package/lib/cjs/autoComplete/index.js +4 -2
  11. package/lib/cjs/avatar/index.d.ts +2 -10
  12. package/lib/cjs/avatar/index.js +4 -2
  13. package/lib/cjs/backtop/index.d.ts +2 -5
  14. package/lib/cjs/backtop/index.js +4 -2
  15. package/lib/cjs/button/Button.d.ts +1 -1
  16. package/lib/cjs/button/index.d.ts +3 -1
  17. package/lib/cjs/button/index.js +3 -0
  18. package/lib/cjs/carousel/index.d.ts +2 -2
  19. package/lib/cjs/cascader/index.d.ts +2 -31
  20. package/lib/cjs/cascader/index.js +3 -2
  21. package/lib/cjs/collapse/index.d.ts +2 -7
  22. package/lib/cjs/collapse/index.js +4 -2
  23. package/lib/cjs/collapsible/index.d.ts +3 -9
  24. package/lib/cjs/collapsible/index.js +4 -2
  25. package/lib/cjs/configProvider/index.d.ts +2 -1
  26. package/lib/cjs/configProvider/index.js +5 -2
  27. package/lib/cjs/datePicker/datePicker.d.ts +2 -44
  28. package/lib/cjs/datePicker/datePicker.js +4 -2
  29. package/lib/cjs/dropdown/index.d.ts +2 -12
  30. package/lib/cjs/dropdown/index.js +4 -2
  31. package/lib/cjs/form/arrayField.js +3 -3
  32. package/lib/cjs/modal/Modal.d.ts +2 -20
  33. package/lib/cjs/modal/Modal.js +3 -2
  34. package/lib/cjs/modal/confirm.d.ts +14 -14
  35. package/lib/cjs/navigation/index.d.ts +2 -15
  36. package/lib/cjs/navigation/index.js +4 -2
  37. package/lib/cjs/notification/notice.d.ts +2 -12
  38. package/lib/cjs/notification/notice.js +3 -2
  39. package/lib/cjs/overflowList/index.d.ts +2 -9
  40. package/lib/cjs/overflowList/index.js +3 -2
  41. package/lib/cjs/popconfirm/index.d.ts +2 -15
  42. package/lib/cjs/popconfirm/index.js +4 -2
  43. package/lib/cjs/popover/index.d.ts +2 -23
  44. package/lib/cjs/popover/index.js +4 -2
  45. package/lib/cjs/resizeObserver/index.d.ts +14 -2
  46. package/lib/cjs/resizeObserver/index.js +66 -32
  47. package/lib/cjs/select/index.d.ts +1 -0
  48. package/lib/cjs/select/index.js +3 -2
  49. package/lib/cjs/sideSheet/index.d.ts +1 -0
  50. package/lib/cjs/sideSheet/index.js +3 -2
  51. package/lib/cjs/tabs/index.d.ts +1 -0
  52. package/lib/cjs/tabs/index.js +4 -2
  53. package/lib/cjs/timePicker/index.d.ts +2 -34
  54. package/lib/cjs/timePicker/index.js +3 -1
  55. package/lib/cjs/toast/toast.d.ts +2 -11
  56. package/lib/cjs/toast/toast.js +3 -2
  57. package/lib/cjs/tooltip/index.d.ts +2 -32
  58. package/lib/cjs/tooltip/index.js +3 -2
  59. package/lib/cjs/typography/base.d.ts +7 -4
  60. package/lib/cjs/typography/base.js +127 -64
  61. package/lib/cjs/typography/numeral.d.ts +1 -1
  62. package/lib/cjs/typography/paragraph.d.ts +1 -1
  63. package/lib/cjs/typography/text.d.ts +1 -1
  64. package/lib/cjs/typography/title.d.ts +1 -1
  65. package/lib/es/_utils/index.d.ts +2 -0
  66. package/lib/es/_utils/index.js +75 -0
  67. package/lib/es/_utils/semi-global.d.ts +46 -0
  68. package/lib/es/_utils/semi-global.js +6 -0
  69. package/lib/es/autoComplete/index.d.ts +2 -25
  70. package/lib/es/autoComplete/index.js +4 -2
  71. package/lib/es/avatar/index.d.ts +2 -10
  72. package/lib/es/avatar/index.js +4 -2
  73. package/lib/es/backtop/index.d.ts +2 -5
  74. package/lib/es/backtop/index.js +4 -2
  75. package/lib/es/button/Button.d.ts +1 -1
  76. package/lib/es/button/index.d.ts +3 -1
  77. package/lib/es/button/index.js +3 -0
  78. package/lib/es/carousel/index.d.ts +2 -2
  79. package/lib/es/cascader/index.d.ts +2 -31
  80. package/lib/es/cascader/index.js +4 -3
  81. package/lib/es/collapse/index.d.ts +2 -7
  82. package/lib/es/collapse/index.js +4 -2
  83. package/lib/es/collapsible/index.d.ts +3 -9
  84. package/lib/es/collapsible/index.js +4 -2
  85. package/lib/es/configProvider/index.d.ts +2 -1
  86. package/lib/es/configProvider/index.js +5 -2
  87. package/lib/es/datePicker/datePicker.d.ts +2 -44
  88. package/lib/es/datePicker/datePicker.js +4 -2
  89. package/lib/es/dropdown/index.d.ts +2 -12
  90. package/lib/es/dropdown/index.js +4 -2
  91. package/lib/es/form/arrayField.js +3 -3
  92. package/lib/es/modal/Modal.d.ts +2 -20
  93. package/lib/es/modal/Modal.js +4 -3
  94. package/lib/es/modal/confirm.d.ts +14 -14
  95. package/lib/es/navigation/index.d.ts +2 -15
  96. package/lib/es/navigation/index.js +4 -2
  97. package/lib/es/notification/notice.d.ts +2 -12
  98. package/lib/es/notification/notice.js +4 -3
  99. package/lib/es/overflowList/index.d.ts +2 -9
  100. package/lib/es/overflowList/index.js +4 -3
  101. package/lib/es/popconfirm/index.d.ts +2 -15
  102. package/lib/es/popconfirm/index.js +4 -2
  103. package/lib/es/popover/index.d.ts +2 -23
  104. package/lib/es/popover/index.js +4 -2
  105. package/lib/es/resizeObserver/index.d.ts +14 -2
  106. package/lib/es/resizeObserver/index.js +64 -31
  107. package/lib/es/select/index.d.ts +1 -0
  108. package/lib/es/select/index.js +4 -3
  109. package/lib/es/sideSheet/index.d.ts +1 -0
  110. package/lib/es/sideSheet/index.js +4 -3
  111. package/lib/es/tabs/index.d.ts +1 -0
  112. package/lib/es/tabs/index.js +4 -2
  113. package/lib/es/timePicker/index.d.ts +2 -34
  114. package/lib/es/timePicker/index.js +3 -1
  115. package/lib/es/toast/toast.d.ts +2 -11
  116. package/lib/es/toast/toast.js +4 -3
  117. package/lib/es/tooltip/index.d.ts +2 -32
  118. package/lib/es/tooltip/index.js +4 -3
  119. package/lib/es/typography/base.d.ts +7 -4
  120. package/lib/es/typography/base.js +128 -65
  121. package/lib/es/typography/numeral.d.ts +1 -1
  122. package/lib/es/typography/paragraph.d.ts +1 -1
  123. package/lib/es/typography/text.d.ts +1 -1
  124. package/lib/es/typography/title.d.ts +1 -1
  125. package/package.json +9 -9
@@ -14,7 +14,7 @@ export interface CarouselState {
14
14
  declare class Carousel extends BaseComponent<CarouselProps, CarouselState> {
15
15
  static propTypes: {
16
16
  activeIndex: PropTypes.Requireable<number>;
17
- animation: PropTypes.Requireable<"slide" | "fade">;
17
+ animation: PropTypes.Requireable<"fade" | "slide">;
18
18
  arrowProps: PropTypes.Requireable<object>;
19
19
  autoPlay: PropTypes.Requireable<NonNullable<boolean | object>>;
20
20
  className: PropTypes.Requireable<string>;
@@ -24,7 +24,7 @@ declare class Carousel extends BaseComponent<CarouselProps, CarouselState> {
24
24
  indicatorType: PropTypes.Requireable<"line" | "dot" | "columnar">;
25
25
  theme: PropTypes.Requireable<"dark" | "light" | "primary">;
26
26
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
27
- arrowType: PropTypes.Requireable<"always" | "hover">;
27
+ arrowType: PropTypes.Requireable<"hover" | "always">;
28
28
  showArrow: PropTypes.Requireable<boolean>;
29
29
  showIndicator: PropTypes.Requireable<boolean>;
30
30
  slideDirection: PropTypes.Requireable<"left" | "right">;
@@ -66,6 +66,7 @@ export interface CascaderState extends BasicCascaderInnerData {
66
66
  treeData?: Array<CascaderData>;
67
67
  }
68
68
  declare class Cascader extends BaseComponent<CascaderProps, CascaderState> {
69
+ static __SemiComponentName__: string;
69
70
  static contextType: React.Context<ContextValue>;
70
71
  static propTypes: {
71
72
  'aria-labelledby': PropTypes.Requireable<string>;
@@ -143,37 +144,7 @@ declare class Cascader extends BaseComponent<CascaderProps, CascaderState> {
143
144
  preventScroll: PropTypes.Requireable<boolean>;
144
145
  position: PropTypes.Requireable<string>;
145
146
  };
146
- static defaultProps: {
147
- borderless: boolean;
148
- leafOnly: boolean;
149
- arrowIcon: JSX.Element;
150
- stopPropagation: boolean;
151
- motion: boolean;
152
- defaultOpen: boolean;
153
- zIndex: number;
154
- showClear: boolean;
155
- autoClearSearchValue: boolean;
156
- changeOnSelect: boolean;
157
- disableStrictly: boolean;
158
- autoMergeValue: boolean;
159
- multiple: boolean;
160
- filterTreeNode: boolean;
161
- filterLeafOnly: boolean;
162
- showRestTagsPopover: boolean;
163
- restTagsPopoverProps: {};
164
- separator: string;
165
- size: "default";
166
- treeNodeFilterProp: "label";
167
- displayProp: "label";
168
- treeData: CascaderData[];
169
- showNext: "click";
170
- onExceed: (...args: any[]) => void;
171
- onClear: (...args: any[]) => void;
172
- onDropdownVisibleChange: (...args: any[]) => void;
173
- onListScroll: (...args: any[]) => void;
174
- enableLeafClick: boolean;
175
- 'aria-label': string;
176
- };
147
+ static defaultProps: any;
177
148
  options: any;
178
149
  isEmpty: boolean;
179
150
  inputRef: React.RefObject<typeof Input>;
@@ -25,7 +25,7 @@ import Item from './item';
25
25
  import Trigger from '../trigger';
26
26
  import Tag from '../tag';
27
27
  import TagInput from '../tagInput';
28
- import { isSemiIcon } from '../_utils';
28
+ import { getDefaultPropsFromGlobalConfig, isSemiIcon } from '../_utils';
29
29
  const prefixcls = cssClasses.PREFIX;
30
30
  const resetkey = 0;
31
31
  class Cascader extends BaseComponent {
@@ -905,6 +905,7 @@ class Cascader extends BaseComponent {
905
905
  }, selection);
906
906
  }
907
907
  }
908
+ Cascader.__SemiComponentName__ = "Cascader";
908
909
  Cascader.contextType = ConfigContext;
909
910
  Cascader.propTypes = {
910
911
  'aria-labelledby': PropTypes.string,
@@ -983,7 +984,7 @@ Cascader.propTypes = {
983
984
  preventScroll: PropTypes.bool,
984
985
  position: PropTypes.string
985
986
  };
986
- Cascader.defaultProps = {
987
+ Cascader.defaultProps = getDefaultPropsFromGlobalConfig(Cascader.__SemiComponentName__, {
987
988
  borderless: false,
988
989
  leafOnly: false,
989
990
  arrowIcon: /*#__PURE__*/React.createElement(IconChevronDown, null),
@@ -1013,5 +1014,5 @@ Cascader.defaultProps = {
1013
1014
  onListScroll: _noop,
1014
1015
  enableLeafClick: false,
1015
1016
  'aria-label': 'Cascader'
1016
- };
1017
+ });
1017
1018
  export default Cascader;
@@ -4,7 +4,6 @@ import { CollapseAdapter, CollapseProps, CollapseState } from '@douyinfe/semi-fo
4
4
  import BaseComponent from '../_base/baseComponent';
5
5
  import CollapsePanel from './item';
6
6
  import '@douyinfe/semi-foundation/lib/es/collapse/collapse.css';
7
- import { noop } from '@douyinfe/semi-foundation/lib/es/utils/function';
8
7
  export type { CollapsePanelProps } from './item';
9
8
  export interface CollapseReactProps extends CollapseProps {
10
9
  expandIcon?: React.ReactNode;
@@ -30,12 +29,8 @@ declare class Collapse extends BaseComponent<CollapseReactProps, CollapseState>
30
29
  motion: PropTypes.Requireable<NonNullable<boolean | object>>;
31
30
  expandIconPosition: PropTypes.Requireable<string>;
32
31
  };
33
- static defaultProps: {
34
- defaultActiveKey: string;
35
- clickHeaderToExpand: boolean;
36
- onChange: typeof noop;
37
- expandIconPosition: string;
38
- };
32
+ static __SemiComponentName__: string;
33
+ static defaultProps: any;
39
34
  constructor(props: CollapseReactProps);
40
35
  get adapter(): CollapseAdapter;
41
36
  static getDerivedStateFromProps(props: CollapseReactProps, state: CollapseState): CollapseState;
@@ -17,6 +17,7 @@ import CollapsePanel from './item';
17
17
  import '@douyinfe/semi-foundation/lib/es/collapse/collapse.css';
18
18
  import { noop } from '@douyinfe/semi-foundation/lib/es/utils/function';
19
19
  import CollapseContext from './collapse-context';
20
+ import { getDefaultPropsFromGlobalConfig } from "../_utils";
20
21
  class Collapse extends BaseComponent {
21
22
  constructor(props) {
22
23
  super(props);
@@ -106,10 +107,11 @@ Collapse.propTypes = {
106
107
  motion: PropTypes.oneOfType([PropTypes.bool, PropTypes.func, PropTypes.object]),
107
108
  expandIconPosition: PropTypes.oneOf(strings.iconPosition)
108
109
  };
109
- Collapse.defaultProps = {
110
+ Collapse.__SemiComponentName__ = "Collapse";
111
+ Collapse.defaultProps = getDefaultPropsFromGlobalConfig(Collapse.__SemiComponentName__, {
110
112
  defaultActiveKey: '',
111
113
  clickHeaderToExpand: true,
112
114
  onChange: noop,
113
115
  expandIconPosition: 'right'
114
- };
116
+ });
115
117
  export default Collapse;
@@ -3,7 +3,7 @@ import type { CollapsibleAdapter, CollapsibleFoundationProps, CollapsibleFoundat
3
3
  import CollapsibleFoundation from '@douyinfe/semi-foundation/lib/es/collapsible/foundation';
4
4
  import BaseComponent from "../_base/baseComponent";
5
5
  import '@douyinfe/semi-foundation/lib/es/collapsible/collapsible.css';
6
- interface CollapsibleProps extends CollapsibleFoundationProps {
6
+ export interface CollapsibleProps extends CollapsibleFoundationProps {
7
7
  motion?: boolean;
8
8
  children?: React.ReactNode;
9
9
  isOpen?: boolean;
@@ -23,14 +23,8 @@ interface CollapsibleState extends CollapsibleFoundationState {
23
23
  isTransitioning: boolean;
24
24
  }
25
25
  declare class Collapsible extends BaseComponent<CollapsibleProps, CollapsibleState> {
26
- static defaultProps: {
27
- isOpen: boolean;
28
- duration: number;
29
- motion: boolean;
30
- keepDOM: boolean;
31
- collapseHeight: number;
32
- fade: boolean;
33
- };
26
+ static __SemiComponentName__: string;
27
+ static defaultProps: any;
34
28
  foundation: CollapsibleFoundation;
35
29
  private domRef;
36
30
  private resizeObserver;
@@ -6,6 +6,7 @@ import PropTypes from "prop-types";
6
6
  import cls from "classnames";
7
7
  import { cssClasses } from '@douyinfe/semi-foundation/lib/es/collapsible/constants';
8
8
  import '@douyinfe/semi-foundation/lib/es/collapsible/collapsible.css';
9
+ import { getDefaultPropsFromGlobalConfig } from "../_utils";
9
10
  class Collapsible extends BaseComponent {
10
11
  constructor(props) {
11
12
  super(props);
@@ -128,14 +129,15 @@ class Collapsible extends BaseComponent {
128
129
  }, (this.props.keepDOM || this.props.collapseHeight !== 0 || this.state.visible || this.props.isOpen) && this.props.children));
129
130
  }
130
131
  }
131
- Collapsible.defaultProps = {
132
+ Collapsible.__SemiComponentName__ = "Collapsible";
133
+ Collapsible.defaultProps = getDefaultPropsFromGlobalConfig(Collapsible.__SemiComponentName__, {
132
134
  isOpen: false,
133
135
  duration: 250,
134
136
  motion: true,
135
137
  keepDOM: false,
136
138
  collapseHeight: 0,
137
139
  fade: false
138
- };
140
+ });
139
141
  Collapsible.getEntryInfo = entry => {
140
142
  //judge whether parent or self display none
141
143
  let inRenderTree;
@@ -4,6 +4,7 @@ import { ContextValue } from './context';
4
4
  export interface ConfigProviderProps extends ContextValue {
5
5
  }
6
6
  export default class ConfigProvider extends React.Component<ConfigProviderProps> {
7
+ constructor(props: ConfigProviderProps);
7
8
  static propTypes: {
8
9
  locale: PropTypes.Requireable<object>;
9
10
  timeZone: PropTypes.Requireable<NonNullable<string | number>>;
@@ -14,6 +15,6 @@ export default class ConfigProvider extends React.Component<ConfigProviderProps>
14
15
  locale: import("../locale/interface").Locale;
15
16
  direction: string;
16
17
  };
17
- renderChilren(): string | number | boolean | React.ReactFragment | JSX.Element;
18
+ renderChildren(): string | number | boolean | React.ReactFragment | JSX.Element;
18
19
  render(): JSX.Element;
19
20
  }
@@ -12,7 +12,10 @@ import { BASE_CLASS_PREFIX } from '@douyinfe/semi-foundation/lib/es/base/constan
12
12
  import DefaultLocale from '../locale/source/zh_CN';
13
13
  import Context from './context';
14
14
  export default class ConfigProvider extends React.Component {
15
- renderChilren() {
15
+ constructor(props) {
16
+ super(props);
17
+ }
18
+ renderChildren() {
16
19
  const {
17
20
  direction,
18
21
  children
@@ -35,7 +38,7 @@ export default class ConfigProvider extends React.Component {
35
38
  value: Object.assign({
36
39
  direction
37
40
  }, rest)
38
- }, this.renderChilren());
41
+ }, this.renderChildren());
39
42
  }
40
43
  }
41
44
  ConfigProvider.propTypes = {
@@ -127,50 +127,8 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
127
127
  yearAndMonthOpts: PropTypes.Requireable<object>;
128
128
  onClickOutSide: PropTypes.Requireable<(...args: any[]) => any>;
129
129
  };
130
- static defaultProps: {
131
- onChangeWithDateFirst: boolean;
132
- borderless: boolean;
133
- autoAdjustOverflow: boolean;
134
- stopPropagation: boolean;
135
- motion: boolean;
136
- prefixCls: "semi-datepicker";
137
- presetPosition: string;
138
- zIndex: number;
139
- type: string;
140
- size: string;
141
- density: string;
142
- multiple: boolean;
143
- defaultOpen: boolean;
144
- disabledHours: (...args: any[]) => void;
145
- disabledMinutes: (...args: any[]) => void;
146
- disabledSeconds: (...args: any[]) => void;
147
- hideDisabledOptions: boolean;
148
- onBlur: (...args: any[]) => void;
149
- onFocus: (...args: any[]) => void;
150
- onClear: (...args: any[]) => void;
151
- onCancel: (...args: any[]) => void;
152
- onConfirm: (...args: any[]) => void;
153
- onChange: (...args: any[]) => void;
154
- onOpenChange: (...args: any[]) => void;
155
- onPanelChange: (...args: any[]) => void;
156
- onPresetClick: (...args: any[]) => void;
157
- weekStartsOn: 0;
158
- disabledDate: {
159
- (): false;
160
- (): false;
161
- };
162
- disabledTime: {
163
- (): false;
164
- (): false;
165
- };
166
- inputReadOnly: boolean;
167
- spacing: number;
168
- autoSwitchDate: boolean;
169
- syncSwitchMonth: boolean;
170
- rangeSeparator: " ~ ";
171
- insetInput: boolean;
172
- onClickOutSide: (...args: any[]) => void;
173
- };
130
+ static __SemiComponentName__: string;
131
+ static defaultProps: any;
174
132
  triggerElRef: React.MutableRefObject<HTMLElement>;
175
133
  panelRef: React.RefObject<HTMLDivElement>;
176
134
  monthGrid: React.RefObject<MonthsGrid>;
@@ -30,6 +30,7 @@ import Footer from './footer';
30
30
  import Trigger from '../trigger';
31
31
  import YearAndMonth from './yearAndMonth';
32
32
  import '@douyinfe/semi-foundation/lib/es/datePicker/datePicker.css';
33
+ import { getDefaultPropsFromGlobalConfig } from "../_utils";
33
34
  export default class DatePicker extends BaseComponent {
34
35
  constructor(props) {
35
36
  var _this;
@@ -837,7 +838,8 @@ DatePicker.propTypes = {
837
838
  yearAndMonthOpts: PropTypes.object,
838
839
  onClickOutSide: PropTypes.func
839
840
  };
840
- DatePicker.defaultProps = {
841
+ DatePicker.__SemiComponentName__ = "DatePicker";
842
+ DatePicker.defaultProps = getDefaultPropsFromGlobalConfig(DatePicker.__SemiComponentName__, {
841
843
  onChangeWithDateFirst: true,
842
844
  borderless: false,
843
845
  autoAdjustOverflow: true,
@@ -875,4 +877,4 @@ DatePicker.defaultProps = {
875
877
  rangeSeparator: strings.DEFAULT_SEPARATOR_RANGE,
876
878
  insetInput: false,
877
879
  onClickOutSide: _noop
878
- };
880
+ });
@@ -76,18 +76,8 @@ declare class Dropdown extends BaseComponent<DropdownProps, DropdownState> {
76
76
  visible: PropTypes.Requireable<boolean>;
77
77
  zIndex: PropTypes.Requireable<number>;
78
78
  };
79
- static defaultProps: {
80
- onVisibleChange: (...args: any[]) => void;
81
- prefixCls: string;
82
- zIndex: 1060;
83
- motion: boolean;
84
- trigger: string;
85
- position: string;
86
- mouseLeaveDelay: number;
87
- showTick: boolean;
88
- closeOnEsc: boolean;
89
- onEscKeyDown: (...args: any[]) => void;
90
- };
79
+ static __SemiComponentName__: string;
80
+ static defaultProps: any;
91
81
  tooltipRef: React.RefObject<Tooltip>;
92
82
  constructor(props: DropdownProps);
93
83
  context: DropdownContextType;
@@ -22,6 +22,7 @@ import DropdownDivider from './dropdownDivider';
22
22
  import DropdownTitle from './dropdownTitle';
23
23
  import DropdownContext from './context';
24
24
  import '@douyinfe/semi-foundation/lib/es/dropdown/dropdown.css';
25
+ import { getDefaultPropsFromGlobalConfig } from "../_utils";
25
26
  const positionSet = strings.POSITION_SET;
26
27
  const triggerSet = strings.TRIGGER_SET;
27
28
  class Dropdown extends BaseComponent {
@@ -229,7 +230,8 @@ Dropdown.propTypes = {
229
230
  visible: PropTypes.bool,
230
231
  zIndex: PropTypes.number
231
232
  };
232
- Dropdown.defaultProps = {
233
+ Dropdown.__SemiComponentName__ = "Dropdown";
234
+ Dropdown.defaultProps = getDefaultPropsFromGlobalConfig(Dropdown.__SemiComponentName__, {
233
235
  onVisibleChange: _noop,
234
236
  prefixCls: cssClasses.PREFIX,
235
237
  zIndex: tooltipNumbers.DEFAULT_Z_INDEX,
@@ -240,5 +242,5 @@ Dropdown.defaultProps = {
240
242
  showTick: false,
241
243
  closeOnEsc: true,
242
244
  onEscKeyDown: _noop
243
- };
245
+ });
244
246
  export default Dropdown;
@@ -1,9 +1,9 @@
1
1
  import _isUndefined from "lodash/isUndefined";
2
- import _cloneDeep from "lodash/cloneDeep";
3
2
  import React, { Component } from 'react';
4
3
  import { getUuidv4 } from '@douyinfe/semi-foundation/lib/es/utils/uuid';
5
4
  import { FormUpdaterContext, ArrayFieldContext } from './context';
6
5
  import warning from '@douyinfe/semi-foundation/lib/es/utils/warning';
6
+ import copy from 'fast-copy';
7
7
  const filterArrayByIndex = (array, index) => array.filter((item, i) => i !== index);
8
8
  const getUuidByArray = array => array.map(() => getUuidv4());
9
9
  const getUpdateKey = arrayField => {
@@ -61,8 +61,8 @@ class ArrayFieldComponent extends Component {
61
61
  // whether the fields inside arrayField should use props.initValue in current render process
62
62
  this.shouldUseInitValue = !context.getArrayField(field);
63
63
  // Separate the arrays that reset and the usual add and remove modify, otherwise they will affect each other
64
- const initValueCopyForFormState = _cloneDeep(initValue);
65
- const initValueCopyForReset = _cloneDeep(initValue);
64
+ const initValueCopyForFormState = copy(initValue);
65
+ const initValueCopyForReset = copy(initValue);
66
66
  context.registerArrayField(field, initValueCopyForReset);
67
67
  // register ArrayField will update state.updateKey to render, So there is no need to execute forceUpdate here
68
68
  context.updateStateValue(field, initValueCopyForFormState, {
@@ -68,26 +68,8 @@ declare class Modal extends BaseComponent<ModalReactProps, ModalState> {
68
68
  fullScreen: PropTypes.Requireable<boolean>;
69
69
  footerFill: PropTypes.Requireable<boolean>;
70
70
  };
71
- static defaultProps: {
72
- zIndex: number;
73
- motion: boolean;
74
- mask: boolean;
75
- centered: boolean;
76
- closable: boolean;
77
- visible: boolean;
78
- okType: string;
79
- maskClosable: boolean;
80
- hasCancel: boolean;
81
- onCancel: (...args: any[]) => void;
82
- onOk: (...args: any[]) => void;
83
- afterClose: (...args: any[]) => void;
84
- maskFixed: boolean;
85
- closeOnEsc: boolean;
86
- size: string;
87
- keepDOM: boolean;
88
- lazyRender: boolean;
89
- fullScreen: boolean;
90
- };
71
+ static __SemiComponentName__: string;
72
+ static defaultProps: any;
91
73
  static useModal: typeof useModal;
92
74
  foundation: ModalFoundation;
93
75
  private readonly modalRef;
@@ -21,7 +21,7 @@ import BaseComponent from '../_base/baseComponent';
21
21
  import confirm, { withConfirm, withError, withInfo, withSuccess, withWarning } from './confirm';
22
22
  import useModal from './useModal';
23
23
  import CSSAnimation from "../_cssAnimation";
24
- import { getScrollbarWidth } from '../_utils';
24
+ import { getDefaultPropsFromGlobalConfig, getScrollbarWidth } from '../_utils';
25
25
  export const destroyFns = [];
26
26
  class Modal extends BaseComponent {
27
27
  constructor(props) {
@@ -311,7 +311,8 @@ Modal.propTypes = {
311
311
  fullScreen: PropTypes.bool,
312
312
  footerFill: PropTypes.bool
313
313
  };
314
- Modal.defaultProps = {
314
+ Modal.__SemiComponentName__ = "Modal";
315
+ Modal.defaultProps = getDefaultPropsFromGlobalConfig(Modal.__SemiComponentName__, {
315
316
  zIndex: 1000,
316
317
  motion: true,
317
318
  mask: true,
@@ -330,7 +331,7 @@ Modal.defaultProps = {
330
331
  keepDOM: false,
331
332
  lazyRender: true,
332
333
  fullScreen: false
333
- };
334
+ });
334
335
  Modal.useModal = useModal;
335
336
  Modal.info = function (props) {
336
337
  return confirm(withInfo(props));
@@ -159,27 +159,27 @@ export declare function withError(props: ModalReactProps): {
159
159
  width?: string | number;
160
160
  height?: string | number;
161
161
  content?: React.ReactNode;
162
- icon: string | number | boolean | React.ReactFragment | JSX.Element;
163
- onCancel?: (e: React.MouseEvent<Element, MouseEvent>) => void | Promise<any>;
164
162
  closeOnEsc?: boolean;
165
163
  preventScroll?: boolean;
166
164
  afterClose?: () => void;
167
165
  keepDOM?: boolean;
168
- cancelText?: string;
169
- okText?: string;
170
- closeIcon?: React.ReactNode;
171
- bodyStyle?: React.CSSProperties;
166
+ icon: string | number | boolean | React.ReactFragment | JSX.Element;
172
167
  closable?: boolean;
173
- maskClosable?: boolean;
168
+ onCancel?: (e: React.MouseEvent<Element, MouseEvent>) => void | Promise<any>;
169
+ bodyStyle?: React.CSSProperties;
174
170
  cancelButtonProps?: import("../button").BaseButtonProps;
171
+ cancelText?: string;
175
172
  centered?: boolean;
176
173
  confirmLoading?: boolean;
177
174
  cancelLoading?: boolean;
178
175
  hasCancel?: boolean;
176
+ maskClosable?: boolean;
179
177
  maskStyle?: React.CSSProperties;
180
178
  maskFixed?: boolean;
179
+ okText?: string;
181
180
  okType?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").OKType;
182
181
  onOk?: (e: React.MouseEvent<Element, MouseEvent>) => void | Promise<any>;
182
+ closeIcon?: React.ReactNode;
183
183
  lazyRender?: boolean;
184
184
  fullScreen?: boolean;
185
185
  footerFill?: boolean;
@@ -380,12 +380,6 @@ export declare function withError(props: ModalReactProps): {
380
380
  suppressHydrationWarning?: boolean;
381
381
  accessKey?: string;
382
382
  autoFocus?: boolean;
383
- content?: string;
384
- formAction?: string;
385
- formEncType?: string;
386
- formMethod?: string;
387
- formNoValidate?: boolean;
388
- formTarget?: string;
389
383
  contextMenu?: string;
390
384
  dir?: string;
391
385
  draggable?: boolean | "true" | "false";
@@ -396,6 +390,7 @@ export declare function withError(props: ModalReactProps): {
396
390
  inputMode?: "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal";
397
391
  nonce?: string;
398
392
  tabIndex?: number;
393
+ content?: string;
399
394
  'aria-expanded'?: boolean | "true" | "false";
400
395
  'aria-haspopup'?: boolean | "dialog" | "menu" | "grid" | "listbox" | "tree" | "true" | "false";
401
396
  'aria-controls'?: string;
@@ -432,7 +427,7 @@ export declare function withError(props: ModalReactProps): {
432
427
  'aria-colcount'?: number;
433
428
  'aria-colindex'?: number;
434
429
  'aria-colspan'?: number;
435
- 'aria-current'?: boolean | "time" | "true" | "false" | "date" | "page" | "location" | "step";
430
+ 'aria-current'?: boolean | "time" | "true" | "false" | "date" | "location" | "page" | "step";
436
431
  'aria-details'?: string;
437
432
  'aria-disabled'?: boolean | "true" | "false";
438
433
  'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup";
@@ -467,6 +462,11 @@ export declare function withError(props: ModalReactProps): {
467
462
  'aria-valuemin'?: number;
468
463
  'aria-valuenow'?: number;
469
464
  'aria-valuetext'?: string;
465
+ formAction?: string;
466
+ formEncType?: string;
467
+ formMethod?: string;
468
+ formNoValidate?: boolean;
469
+ formTarget?: string;
470
470
  };
471
471
  };
472
472
  export declare function withConfirm(props: ModalReactProps): {
@@ -119,21 +119,8 @@ declare class Nav extends BaseComponent<NavProps, NavState> {
119
119
  limitIndent: PropTypes.Requireable<boolean>;
120
120
  getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
121
121
  };
122
- static defaultProps: {
123
- subNavCloseDelay: number;
124
- subNavOpenDelay: number;
125
- tooltipHideDelay: number;
126
- tooltipShowDelay: number;
127
- onCollapseChange: (...args: any[]) => void;
128
- onSelect: (...args: any[]) => void;
129
- onClick: (...args: any[]) => void;
130
- onOpenChange: (...args: any[]) => void;
131
- toggleIconPosition: string;
132
- limitIndent: boolean;
133
- prefixCls: string;
134
- subNavMotion: boolean;
135
- mode: string;
136
- };
122
+ static __SemiComponentName__: string;
123
+ static defaultProps: any;
137
124
  itemsChanged: boolean;
138
125
  constructor(props: NavProps);
139
126
  static getDerivedStateFromProps(props: NavProps, state: NavState): Partial<NavState>;
@@ -22,6 +22,7 @@ import Header from './Header';
22
22
  import NavContext from './nav-context';
23
23
  import LocaleConsumer from '../locale/localeConsumer';
24
24
  import '@douyinfe/semi-foundation/lib/es/navigation/navigation.css';
25
+ import { getDefaultPropsFromGlobalConfig } from "../_utils";
25
26
  function createAddKeysFn(context, keyName) {
26
27
  return function addKeys() {
27
28
  const handleKeys = new Set(context.state[keyName]);
@@ -359,7 +360,8 @@ Nav.propTypes = {
359
360
  limitIndent: PropTypes.bool,
360
361
  getPopupContainer: PropTypes.func
361
362
  };
362
- Nav.defaultProps = {
363
+ Nav.__SemiComponentName__ = "Navigation";
364
+ Nav.defaultProps = getDefaultPropsFromGlobalConfig(Nav.__SemiComponentName__, {
363
365
  subNavCloseDelay: numbers.DEFAULT_SUBNAV_CLOSE_DELAY,
364
366
  subNavOpenDelay: numbers.DEFAULT_SUBNAV_OPEN_DELAY,
365
367
  tooltipHideDelay: numbers.DEFAULT_TOOLTIP_HIDE_DELAY,
@@ -377,6 +379,6 @@ Nav.defaultProps = {
377
379
  // defaultOpenKeys: [],
378
380
  // defaultSelectedKeys: [],
379
381
  // items: [],
380
- };
382
+ });
381
383
 
382
384
  export default Nav;
@@ -29,18 +29,8 @@ declare class Notice extends BaseComponent<NoticeReactProps, NoticeState> {
29
29
  close: PropTypes.Requireable<(...args: any[]) => any>;
30
30
  direction: PropTypes.Requireable<"ltr" | "rtl">;
31
31
  };
32
- static defaultProps: {
33
- duration: number;
34
- id: string;
35
- close: (...args: any[]) => void;
36
- onClose: (...args: any[]) => void;
37
- onClick: (...args: any[]) => void;
38
- onCloseClick: (...args: any[]) => void;
39
- content: string;
40
- title: string;
41
- showClose: boolean;
42
- theme: string;
43
- };
32
+ static __SemiComponentName__: string;
33
+ static defaultProps: any;
44
34
  get adapter(): NoticeAdapter;
45
35
  constructor(props: NoticeReactProps);
46
36
  context: ContextValue;
@@ -15,7 +15,7 @@ import { cssClasses, numbers, strings } from '@douyinfe/semi-foundation/lib/es/n
15
15
  import NotificationFoundation from '@douyinfe/semi-foundation/lib/es/notification/notificationFoundation';
16
16
  import Button from '../iconButton';
17
17
  import BaseComponent from '../_base/baseComponent';
18
- import { isSemiIcon } from '../_utils';
18
+ import { getDefaultPropsFromGlobalConfig, isSemiIcon } from '../_utils';
19
19
  import { IconAlertCircle, IconAlertTriangle, IconClose, IconInfoCircle, IconTickCircle } from '@douyinfe/semi-icons';
20
20
  import { getUuidShort } from '@douyinfe/semi-foundation/lib/es/utils/uuid';
21
21
  const prefixCls = cssClasses.NOTICE;
@@ -175,7 +175,8 @@ Notice.propTypes = {
175
175
  close: PropTypes.func,
176
176
  direction: PropTypes.oneOf(directions)
177
177
  };
178
- Notice.defaultProps = {
178
+ Notice.__SemiComponentName__ = "Notification";
179
+ Notice.defaultProps = getDefaultPropsFromGlobalConfig(Notice.__SemiComponentName__, {
179
180
  duration,
180
181
  id: '',
181
182
  close: _noop,
@@ -186,5 +187,5 @@ Notice.defaultProps = {
186
187
  title: '',
187
188
  showClose: true,
188
189
  theme: 'normal'
189
- };
190
+ });
190
191
  export default Notice;
@@ -44,15 +44,8 @@ export interface OverflowListState {
44
44
  overflowWidth?: number;
45
45
  }
46
46
  declare class OverflowList extends BaseComponent<OverflowListProps, OverflowListState> {
47
- static defaultProps: {
48
- collapseFrom: string;
49
- minVisibleItems: number;
50
- overflowRenderer: () => ReactElement;
51
- renderMode: string;
52
- threshold: number;
53
- visibleItemRenderer: () => ReactElement;
54
- onOverflow: () => any;
55
- };
47
+ static __SemiComponentName__: string;
48
+ static defaultProps: any;
56
49
  static propTypes: {
57
50
  className: PropTypes.Requireable<string>;
58
51
  collapseFrom: PropTypes.Requireable<"end" | "start">;