@douyinfe/semi-ui 2.11.0-beta.1 → 2.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/README.md +1 -1
  2. package/anchor/link.tsx +2 -2
  3. package/autoComplete/index.tsx +3 -3
  4. package/avatar/interface.ts +2 -2
  5. package/badge/index.tsx +1 -1
  6. package/banner/index.tsx +4 -4
  7. package/breadcrumb/bread-context.tsx +1 -1
  8. package/card/cardGroup.tsx +1 -1
  9. package/card/index.tsx +1 -1
  10. package/cascader/index.tsx +4 -4
  11. package/collapse/index.tsx +1 -1
  12. package/collapse/item.tsx +1 -1
  13. package/collapsible/index.tsx +1 -1
  14. package/descriptions/item.tsx +1 -1
  15. package/dist/umd/semi-ui.js +27 -22
  16. package/dist/umd/semi-ui.js.map +1 -1
  17. package/dist/umd/semi-ui.min.js +1 -1
  18. package/dist/umd/semi-ui.min.js.map +1 -1
  19. package/empty/index.tsx +1 -1
  20. package/form/errorMessage.tsx +1 -1
  21. package/form/interface.ts +1 -1
  22. package/form/label.tsx +1 -1
  23. package/form/section.tsx +2 -2
  24. package/form/slot.tsx +1 -1
  25. package/layout/Sider.tsx +1 -1
  26. package/lib/cjs/anchor/link.d.ts +2 -2
  27. package/lib/cjs/autoComplete/index.d.ts +1 -1
  28. package/lib/cjs/autoComplete/index.js +1 -1
  29. package/lib/cjs/avatar/interface.d.ts +2 -2
  30. package/lib/cjs/badge/index.d.ts +1 -1
  31. package/lib/cjs/banner/index.d.ts +4 -4
  32. package/lib/cjs/breadcrumb/bread-context.d.ts +1 -1
  33. package/lib/cjs/card/cardGroup.d.ts +1 -1
  34. package/lib/cjs/card/index.d.ts +1 -1
  35. package/lib/cjs/cascader/index.d.ts +1 -1
  36. package/lib/cjs/collapse/index.d.ts +1 -1
  37. package/lib/cjs/collapse/item.d.ts +1 -1
  38. package/lib/cjs/collapsible/index.d.ts +1 -1
  39. package/lib/cjs/descriptions/item.d.ts +1 -1
  40. package/lib/cjs/empty/index.d.ts +1 -1
  41. package/lib/cjs/form/errorMessage.d.ts +1 -1
  42. package/lib/cjs/form/interface.d.ts +1 -1
  43. package/lib/cjs/form/label.d.ts +1 -1
  44. package/lib/cjs/form/section.d.ts +2 -2
  45. package/lib/cjs/form/slot.d.ts +1 -1
  46. package/lib/cjs/layout/Sider.d.ts +1 -1
  47. package/lib/cjs/list/index.d.ts +1 -1
  48. package/lib/cjs/list/item.d.ts +1 -1
  49. package/lib/cjs/modal/Modal.d.ts +5 -5
  50. package/lib/cjs/modal/ModalContent.d.ts +1 -1
  51. package/lib/cjs/modal/confirm.d.ts +4 -2
  52. package/lib/cjs/modal/useModal/index.d.ts +16 -23
  53. package/lib/cjs/navigation/Footer.d.ts +1 -1
  54. package/lib/cjs/navigation/Item.d.ts +1 -1
  55. package/lib/cjs/radio/radioGroup.d.ts +1 -1
  56. package/lib/cjs/select/index.d.ts +1 -1
  57. package/lib/cjs/select/index.js +27 -24
  58. package/lib/cjs/sideSheet/SideSheetContent.d.ts +1 -1
  59. package/lib/cjs/table/HeadTable.d.ts +2 -1
  60. package/lib/cjs/table/HeadTable.js +2 -1
  61. package/lib/cjs/table/Table.js +2 -0
  62. package/lib/cjs/table/interface.d.ts +1 -1
  63. package/lib/cjs/timeline/index.d.ts +1 -1
  64. package/lib/cjs/timeline/item.d.ts +1 -1
  65. package/lib/es/anchor/link.d.ts +2 -2
  66. package/lib/es/autoComplete/index.d.ts +1 -1
  67. package/lib/es/autoComplete/index.js +1 -1
  68. package/lib/es/avatar/interface.d.ts +2 -2
  69. package/lib/es/badge/index.d.ts +1 -1
  70. package/lib/es/banner/index.d.ts +4 -4
  71. package/lib/es/breadcrumb/bread-context.d.ts +1 -1
  72. package/lib/es/card/cardGroup.d.ts +1 -1
  73. package/lib/es/card/index.d.ts +1 -1
  74. package/lib/es/cascader/index.d.ts +1 -1
  75. package/lib/es/collapse/index.d.ts +1 -1
  76. package/lib/es/collapse/item.d.ts +1 -1
  77. package/lib/es/collapsible/index.d.ts +1 -1
  78. package/lib/es/descriptions/item.d.ts +1 -1
  79. package/lib/es/empty/index.d.ts +1 -1
  80. package/lib/es/form/errorMessage.d.ts +1 -1
  81. package/lib/es/form/interface.d.ts +1 -1
  82. package/lib/es/form/label.d.ts +1 -1
  83. package/lib/es/form/section.d.ts +2 -2
  84. package/lib/es/form/slot.d.ts +1 -1
  85. package/lib/es/layout/Sider.d.ts +1 -1
  86. package/lib/es/list/index.d.ts +1 -1
  87. package/lib/es/list/item.d.ts +1 -1
  88. package/lib/es/modal/Modal.d.ts +5 -5
  89. package/lib/es/modal/ModalContent.d.ts +1 -1
  90. package/lib/es/modal/confirm.d.ts +4 -2
  91. package/lib/es/modal/confirm.js +1 -1
  92. package/lib/es/modal/useModal/index.d.ts +16 -23
  93. package/lib/es/navigation/Footer.d.ts +1 -1
  94. package/lib/es/navigation/Item.d.ts +1 -1
  95. package/lib/es/radio/radioGroup.d.ts +1 -1
  96. package/lib/es/select/index.d.ts +1 -1
  97. package/lib/es/select/index.js +23 -21
  98. package/lib/es/sideSheet/SideSheetContent.d.ts +1 -1
  99. package/lib/es/table/HeadTable.d.ts +2 -1
  100. package/lib/es/table/HeadTable.js +2 -1
  101. package/lib/es/table/Table.js +2 -0
  102. package/lib/es/table/interface.d.ts +1 -1
  103. package/lib/es/timeline/index.d.ts +1 -1
  104. package/lib/es/timeline/item.d.ts +1 -1
  105. package/list/index.tsx +1 -1
  106. package/list/item.tsx +1 -1
  107. package/modal/Modal.tsx +7 -7
  108. package/modal/ModalContent.tsx +1 -1
  109. package/modal/confirm.tsx +10 -11
  110. package/modal/useModal/index.tsx +9 -1
  111. package/navigation/Footer.tsx +2 -2
  112. package/navigation/Item.tsx +1 -1
  113. package/package.json +9 -9
  114. package/radio/radioGroup.tsx +1 -1
  115. package/select/index.tsx +4 -2
  116. package/sideSheet/SideSheetContent.tsx +1 -1
  117. package/table/HeadTable.tsx +3 -1
  118. package/table/Table.tsx +2 -0
  119. package/table/_story/v2/FixedOnHeaderRow/index.jsx +134 -0
  120. package/table/_story/v2/index.js +2 -1
  121. package/table/interface.ts +1 -1
  122. package/timeline/index.tsx +1 -1
  123. package/timeline/item.tsx +1 -1
package/empty/index.tsx CHANGED
@@ -23,7 +23,7 @@ export interface EmptyProps {
23
23
  darkModeImage?: React.ReactNode | SVGNode;
24
24
  style?: React.CSSProperties;
25
25
  className?: string;
26
- children?: React.ReactNode | undefined;
26
+ children?: React.ReactNode;
27
27
  }
28
28
 
29
29
  interface EmptyState {
@@ -7,7 +7,7 @@ import { IconAlertTriangle, IconAlertCircle } from '@douyinfe/semi-icons';
7
7
 
8
8
  const prefix = cssClasses.PREFIX;
9
9
 
10
- export type ReactFieldError = boolean | string | Array<any> | React.ReactNode | undefined;
10
+ export type ReactFieldError = Array<any> | React.ReactNode;
11
11
 
12
12
  export interface ErrorMessageProps {
13
13
  error?: ReactFieldError;
package/form/interface.ts CHANGED
@@ -21,7 +21,7 @@ export type CommonFieldProps = {
21
21
  /** Field is required (except Form. Checkbox within the Group, Form. Radio) */
22
22
  field: string;
23
23
  /** The label text of the form control is the same name as the field by default when it is not passed */
24
- label?: string | LabelProps | React.ReactNode | number;
24
+ label?: LabelProps | React.ReactNode;
25
25
  labelPosition?: 'top' | 'left' | 'inset';
26
26
  labelAlign?: 'left' | 'right';
27
27
  labelWidth?: number | string;
package/form/label.tsx CHANGED
@@ -20,7 +20,7 @@ export interface LabelProps {
20
20
  width?: number | string;
21
21
  style?: React.CSSProperties;
22
22
  className?: string;
23
- children?: React.ReactNode | undefined;
23
+ children?: React.ReactNode;
24
24
  extra?: React.ReactNode;
25
25
  }
26
26
 
package/form/section.tsx CHANGED
@@ -9,8 +9,8 @@ const prefix = cssClasses.PREFIX;
9
9
  export interface SectionProps {
10
10
  className?: string;
11
11
  style?: React.CSSProperties;
12
- text?: React.ReactNode | string;
13
- children?: React.ReactNode | undefined;
12
+ text?: React.ReactNode;
13
+ children?: React.ReactNode;
14
14
  }
15
15
 
16
16
  export default class Section extends PureComponent<SectionProps> {
package/form/slot.tsx CHANGED
@@ -13,7 +13,7 @@ const prefix = cssClasses.PREFIX;
13
13
  export interface SlotProps {
14
14
  className?: string;
15
15
  style?: React.CSSProperties;
16
- label?: LabelProps | React.ReactNode | number | string;
16
+ label?: LabelProps | React.ReactNode;
17
17
  noLabel?: boolean;
18
18
  labelPosition?: 'top' | 'left';
19
19
  error?: ErrorMessageProps;
package/layout/Sider.tsx CHANGED
@@ -38,7 +38,7 @@ export interface SiderProps {
38
38
  prefixCls?: string;
39
39
  style?: CSSProperties;
40
40
  className?: string;
41
- children?: React.ReactNode | undefined;
41
+ children?: React.ReactNode;
42
42
  breakpoint?: Array<keyof ResponsiveMap>;
43
43
  onBreakpoint?: (screen: keyof ResponsiveMap, match: boolean) => void;
44
44
  'aria-label'?: React.AriaAttributes['aria-label'];
@@ -5,9 +5,9 @@ import LinkFoundation, { LinkAdapter } from '@douyinfe/semi-foundation/lib/cjs/a
5
5
  import { AnchorContextType } from './anchor-context';
6
6
  export interface LinkProps {
7
7
  href?: string;
8
- title?: string | React.ReactNode;
8
+ title?: ReactNode;
9
9
  className?: string;
10
- children?: ReactNode | undefined;
10
+ children?: ReactNode;
11
11
  style?: React.CSSProperties;
12
12
  disabled?: boolean;
13
13
  }
@@ -36,7 +36,7 @@ export interface AutoCompleteProps<T extends AutoCompleteItems> {
36
36
  dropdownMatchSelectWidth?: boolean;
37
37
  dropdownClassName?: string;
38
38
  dropdownStyle?: React.CSSProperties;
39
- emptyContent?: React.ReactNode | null;
39
+ emptyContent?: React.ReactNode;
40
40
  getPopupContainer?: () => HTMLElement;
41
41
  insetLabel?: React.ReactNode;
42
42
  insetLabelId?: string;
@@ -98,7 +98,7 @@ class AutoComplete extends _baseComponent.default {
98
98
  this.triggerRef = /*#__PURE__*/_react.default.createRef();
99
99
  this.optionsRef = /*#__PURE__*/_react.default.createRef();
100
100
  this.clickOutsideHandler = null;
101
- (0, _warning.default)('triggerRender' in this.props && typeof this.props.triggerRender === 'function', "[Semi AutoComplete] \n - If you are using the following props: 'suffix', 'prefix', 'showClear', 'validateStatus', and 'size', \n please notice that they will be removed in the next major version.\n Please use 'componentProps' to retrieve these props instead.\n - If you are using 'onBlur', 'onFocus', please try to avoid using them and look for changes in the future.");
101
+ (0, _warning.default)('triggerRender' in this.props && typeof this.props.triggerRender === 'function', "[Semi AutoComplete]\n - If you are using the following props: 'suffix', 'prefix', 'showClear', 'validateStatus', and 'size',\n please notice that they will be removed in the next major version.\n Please use 'componentProps' to retrieve these props instead.\n - If you are using 'onBlur', 'onFocus', please try to avoid using them and look for changes in the future.");
102
102
  }
103
103
 
104
104
  get adapter() {
@@ -4,7 +4,7 @@ export declare type AvatarShape = 'circle' | 'square';
4
4
  export declare type AvatarSize = 'extra-extra-small' | 'extra-small' | 'small' | 'default' | 'medium' | 'large' | 'extra-large';
5
5
  export declare type AvatarColor = 'amber' | 'blue' | 'cyan' | 'green' | 'grey' | 'indigo' | 'light-blue' | 'light-green' | 'lime' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'violet' | 'yellow';
6
6
  export interface AvatarProps extends BaseProps {
7
- children?: React.ReactNode | undefined;
7
+ children?: React.ReactNode;
8
8
  color?: AvatarColor;
9
9
  shape?: AvatarShape;
10
10
  size?: AvatarSize;
@@ -22,7 +22,7 @@ export declare type AvatarGroupShape = 'circle' | 'square';
22
22
  export declare type AvatarGroupSize = 'extra-extra-small' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
23
23
  export declare type AvatarGroupOverlapFrom = 'start' | 'end';
24
24
  export interface AvatarGroupProps {
25
- children?: React.ReactNode | undefined;
25
+ children?: React.ReactNode;
26
26
  shape?: AvatarGroupShape;
27
27
  size?: AvatarGroupSize;
28
28
  overlapFrom?: AvatarGroupOverlapFrom;
@@ -17,7 +17,7 @@ export interface BadgeProps {
17
17
  onMouseEnter?: (e: React.MouseEvent) => any;
18
18
  onMouseLeave?: (e: React.MouseEvent) => any;
19
19
  onClick?: (e: React.MouseEvent) => any;
20
- children?: React.ReactNode | undefined;
20
+ children?: React.ReactNode;
21
21
  }
22
22
  export default class Badge extends PureComponent<BadgeProps> {
23
23
  static contextType: React.Context<ContextValue>;
@@ -7,15 +7,15 @@ export declare type Type = 'info' | 'danger' | 'warning' | 'success';
7
7
  export interface BannerProps {
8
8
  type?: Type;
9
9
  className?: string;
10
- children?: React.ReactNode | undefined;
10
+ children?: React.ReactNode;
11
11
  fullMode?: boolean;
12
12
  title?: React.ReactNode;
13
13
  description?: React.ReactNode;
14
- icon?: string | React.ReactNode;
15
- closeIcon?: string | React.ReactNode;
14
+ icon?: React.ReactNode;
15
+ closeIcon?: React.ReactNode;
16
16
  style?: React.CSSProperties;
17
17
  bordered?: boolean;
18
- onClose?: (e: React.MouseEvent) => void;
18
+ onClose?(e: React.MouseEvent): void;
19
19
  }
20
20
  export interface BannerState {
21
21
  visible: boolean;
@@ -5,7 +5,7 @@ export interface BreadContextType {
5
5
  onClick?: (info: BreadcrumbItemInfo, event: React.MouseEvent) => void;
6
6
  showTooltip?: boolean | showToolTipProps;
7
7
  compact?: boolean;
8
- separator?: string | React.ReactNode;
8
+ separator?: React.ReactNode;
9
9
  }
10
10
  declare const BreadContext: React.Context<BreadContextType>;
11
11
  export default BreadContext;
@@ -4,7 +4,7 @@ export declare type CardGroupType = 'grid';
4
4
  export interface CardGroupProps {
5
5
  /** Card group style class name */
6
6
  className?: string;
7
- children?: React.ReactNode | undefined;
7
+ children?: React.ReactNode;
8
8
  /** Card Spacing */
9
9
  spacing?: number | number[];
10
10
  /** Card group inline style */
@@ -14,7 +14,7 @@ export interface CardProps {
14
14
  bordered?: boolean;
15
15
  /** Style class name */
16
16
  className?: string;
17
- children?: React.ReactNode | undefined;
17
+ children?: React.ReactNode;
18
18
  /** Cover */
19
19
  cover?: ReactNode;
20
20
  /** Additional additions to the right of the title */
@@ -33,7 +33,7 @@ export interface CascaderProps extends BasicCascaderProps {
33
33
  motion?: Motion;
34
34
  treeData?: Array<CascaderData>;
35
35
  restTagsPopoverProps?: PopoverProps;
36
- children?: React.ReactNode | undefined;
36
+ children?: React.ReactNode;
37
37
  value?: Value;
38
38
  prefix?: ReactNode;
39
39
  suffix?: ReactNode;
@@ -9,7 +9,7 @@ export { CollapsePanelProps } from './item';
9
9
  export interface CollapseReactProps extends CollapseProps {
10
10
  expandIcon?: React.ReactNode;
11
11
  collapseIcon?: React.ReactNode;
12
- children?: React.ReactNode | undefined;
12
+ children?: React.ReactNode;
13
13
  style?: CSSProperties;
14
14
  onChange?: (activeKey: CollapseProps['activeKey'], e: React.MouseEvent) => void;
15
15
  }
@@ -6,7 +6,7 @@ export interface CollapsePanelProps {
6
6
  extra?: ReactNode;
7
7
  header?: ReactNode;
8
8
  className?: string;
9
- children?: React.ReactNode | undefined;
9
+ children?: React.ReactNode;
10
10
  reCalcKey?: number | string;
11
11
  style?: CSSProperties;
12
12
  }
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { Motion } from '../_base/base';
4
4
  export interface CollapsibleProps {
5
5
  motion?: Motion;
6
- children?: React.ReactNode | undefined;
6
+ children?: React.ReactNode;
7
7
  isOpen?: boolean;
8
8
  duration?: number;
9
9
  keepDOM?: boolean;
@@ -5,7 +5,7 @@ import { DescriptionsContextValue } from './descriptions-context';
5
5
  export interface DescriptionsItemProps {
6
6
  hidden?: boolean;
7
7
  className?: string;
8
- children?: React.ReactNode | undefined | (() => React.ReactNode);
8
+ children?: React.ReactNode | (() => React.ReactNode);
9
9
  style?: React.CSSProperties;
10
10
  itemKey?: React.ReactNode;
11
11
  }
@@ -17,7 +17,7 @@ export interface EmptyProps {
17
17
  darkModeImage?: React.ReactNode | SVGNode;
18
18
  style?: React.CSSProperties;
19
19
  className?: string;
20
- children?: React.ReactNode | undefined;
20
+ children?: React.ReactNode;
21
21
  }
22
22
  interface EmptyState {
23
23
  mode: any;
@@ -1,6 +1,6 @@
1
1
  import React, { PureComponent } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- export declare type ReactFieldError = boolean | string | Array<any> | React.ReactNode | undefined;
3
+ export declare type ReactFieldError = Array<any> | React.ReactNode;
4
4
  export interface ErrorMessageProps {
5
5
  error?: ReactFieldError;
6
6
  className?: string;
@@ -15,7 +15,7 @@ export declare type CommonFieldProps = {
15
15
  /** Field is required (except Form. Checkbox within the Group, Form. Radio) */
16
16
  field: string;
17
17
  /** The label text of the form control is the same name as the field by default when it is not passed */
18
- label?: string | LabelProps | React.ReactNode | number;
18
+ label?: LabelProps | React.ReactNode;
19
19
  labelPosition?: 'top' | 'left' | 'inset';
20
20
  labelAlign?: 'left' | 'right';
21
21
  labelWidth?: number | string;
@@ -15,7 +15,7 @@ export interface LabelProps {
15
15
  width?: number | string;
16
16
  style?: React.CSSProperties;
17
17
  className?: string;
18
- children?: React.ReactNode | undefined;
18
+ children?: React.ReactNode;
19
19
  extra?: React.ReactNode;
20
20
  }
21
21
  export default class Label extends PureComponent<LabelProps> {
@@ -3,8 +3,8 @@ import PropTypes from 'prop-types';
3
3
  export interface SectionProps {
4
4
  className?: string;
5
5
  style?: React.CSSProperties;
6
- text?: React.ReactNode | string;
7
- children?: React.ReactNode | undefined;
6
+ text?: React.ReactNode;
7
+ children?: React.ReactNode;
8
8
  }
9
9
  export default class Section extends PureComponent<SectionProps> {
10
10
  static propTypes: {
@@ -4,7 +4,7 @@ import { ErrorMessageProps } from './errorMessage';
4
4
  export interface SlotProps {
5
5
  className?: string;
6
6
  style?: React.CSSProperties;
7
- label?: LabelProps | React.ReactNode | number | string;
7
+ label?: LabelProps | React.ReactNode;
8
8
  noLabel?: boolean;
9
9
  labelPosition?: 'top' | 'left';
10
10
  error?: ErrorMessageProps;
@@ -13,7 +13,7 @@ export interface SiderProps {
13
13
  prefixCls?: string;
14
14
  style?: CSSProperties;
15
15
  className?: string;
16
- children?: React.ReactNode | undefined;
16
+ children?: React.ReactNode;
17
17
  breakpoint?: Array<keyof ResponsiveMap>;
18
18
  onBreakpoint?: (screen: keyof ResponsiveMap, match: boolean) => void;
19
19
  'aria-label'?: React.AriaAttributes['aria-label'];
@@ -8,7 +8,7 @@ export { ListItemProps } from './item';
8
8
  export interface ListProps<T> {
9
9
  style?: React.CSSProperties;
10
10
  className?: string;
11
- children?: React.ReactNode | undefined;
11
+ children?: React.ReactNode;
12
12
  bordered?: boolean;
13
13
  footer?: React.ReactNode;
14
14
  header?: React.ReactNode;
@@ -7,7 +7,7 @@ export interface ListItemProps {
7
7
  main?: React.ReactNode;
8
8
  align?: 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
9
9
  className?: string;
10
- children?: React.ReactNode | undefined;
10
+ children?: React.ReactNode;
11
11
  style?: React.CSSProperties;
12
12
  onClick?: React.MouseEventHandler<HTMLLIElement>;
13
13
  onRightClick?: React.MouseEventHandler<HTMLLIElement>;
@@ -10,7 +10,7 @@ export declare type ConfirmType = 'leftTop' | 'leftBottom' | 'rightTop' | 'right
10
10
  export declare type Directions = 'ltr' | 'rtl';
11
11
  export interface ModalReactProps extends ModalProps {
12
12
  cancelButtonProps?: ButtonProps;
13
- children?: React.ReactNode | undefined;
13
+ children?: React.ReactNode;
14
14
  okButtonProps?: ButtonProps;
15
15
  bodyStyle?: CSSProperties;
16
16
  maskStyle?: CSSProperties;
@@ -102,19 +102,19 @@ declare class Modal extends BaseComponent<ModalReactProps, ModalState> {
102
102
  static getScrollbarWidth(): number;
103
103
  static info: (props: ModalReactProps) => {
104
104
  destroy: () => void;
105
- update: (newConfig: import("./confirm").ConfirmProps) => void;
105
+ update: (newConfig: ModalReactProps) => void;
106
106
  };
107
107
  static success: (props: ModalReactProps) => {
108
108
  destroy: () => void;
109
- update: (newConfig: import("./confirm").ConfirmProps) => void;
109
+ update: (newConfig: ModalReactProps) => void;
110
110
  };
111
111
  static error: (props: ModalReactProps) => {
112
112
  destroy: () => void;
113
- update: (newConfig: import("./confirm").ConfirmProps) => void;
113
+ update: (newConfig: ModalReactProps) => void;
114
114
  };
115
115
  static warning: (props: ModalReactProps) => {
116
116
  destroy: () => void;
117
- update: (newConfig: import("./confirm").ConfirmProps) => void;
117
+ update: (newConfig: ModalReactProps) => void;
118
118
  };
119
119
  static confirm: (props: ModalReactProps) => {
120
120
  destroy: () => void;
@@ -4,7 +4,7 @@ import { ContextValue } from '../configProvider/context';
4
4
  import BaseComponent from '../_base/baseComponent';
5
5
  import ModalContentFoundation, { ModalContentAdapter, ModalContentProps, ModalContentState } from '@douyinfe/semi-foundation/lib/cjs/modal/modalContentFoundation';
6
6
  export interface ModalContentReactProps extends ModalContentProps {
7
- children?: React.ReactNode | undefined;
7
+ children?: React.ReactNode;
8
8
  }
9
9
  export default class ModalContent extends BaseComponent<ModalContentReactProps, ModalContentState> {
10
10
  static contextType: React.Context<ContextValue>;
@@ -4,9 +4,11 @@ import '@douyinfe/semi-foundation/lib/cjs/modal/modal.css';
4
4
  export interface ConfirmProps extends ModalReactProps {
5
5
  type: 'success' | 'info' | 'warning' | 'error' | 'confirm';
6
6
  }
7
- export default function confirm(props: ConfirmProps): {
7
+ export default function confirm<T>(props: ConfirmProps): {
8
8
  destroy: () => void;
9
- update: (newConfig: ConfirmProps) => void;
9
+ update: (newConfig: T extends {
10
+ type: Exclude<ConfirmProps['type'], 'confirm'>;
11
+ } ? ModalReactProps : ConfirmProps) => void;
10
12
  };
11
13
  export declare function withInfo(props: ModalReactProps): {
12
14
  cancelButtonProps?: import("../button").BaseButtonProps;
@@ -1,25 +1,18 @@
1
- /// <reference types="react" />
1
+ import { ReactNode } from 'react';
2
2
  import { ConfirmProps } from '../confirm';
3
3
  import { ModalReactProps } from '../Modal';
4
- export default function useModal(): (JSX.Element | {
5
- info: (config: ModalReactProps) => {
6
- destroy: () => void;
7
- update: (newConfig: ConfirmProps) => void;
8
- };
9
- success: (config: ModalReactProps) => {
10
- destroy: () => void;
11
- update: (newConfig: ConfirmProps) => void;
12
- };
13
- error: (config: ModalReactProps) => {
14
- destroy: () => void;
15
- update: (newConfig: ConfirmProps) => void;
16
- };
17
- warning: (config: ModalReactProps) => {
18
- destroy: () => void;
19
- update: (newConfig: ConfirmProps) => void;
20
- };
21
- confirm: (config: ModalReactProps) => {
22
- destroy: () => void;
23
- update: (newConfig: ConfirmProps) => void;
24
- };
25
- })[];
4
+ declare type UseModalReturnHooksType = (config: ModalReactProps) => {
5
+ destroy: () => void;
6
+ update: (newConfig: ConfirmProps) => void;
7
+ };
8
+ export default function useModal(): [
9
+ {
10
+ info: UseModalReturnHooksType;
11
+ success: UseModalReturnHooksType;
12
+ error: UseModalReturnHooksType;
13
+ warning: UseModalReturnHooksType;
14
+ confirm: UseModalReturnHooksType;
15
+ },
16
+ ReactNode
17
+ ];
18
+ export {};
@@ -4,7 +4,7 @@ import '@douyinfe/semi-foundation/lib/cjs/navigation/navigation.css';
4
4
  import { NavContextType } from './nav-context';
5
5
  import { BaseProps } from '../_base/baseComponent';
6
6
  export interface NavFooterProps extends BaseProps {
7
- collapseButton?: React.ReactNode | boolean;
7
+ collapseButton?: React.ReactNode;
8
8
  collapseText?: (collapsed?: boolean) => React.ReactNode;
9
9
  }
10
10
  export default class NavFooter extends PureComponent<NavFooterProps> {
@@ -11,7 +11,7 @@ export interface NavItemProps extends ItemProps, BaseProps {
11
11
  itemKey?: React.ReactText;
12
12
  level?: number;
13
13
  link?: string;
14
- linkOptions?: React.HTMLAttributes<HTMLLinkElement>;
14
+ linkOptions?: React.AnchorHTMLAttributes<HTMLAnchorElement>;
15
15
  text?: React.ReactNode;
16
16
  tooltipHideDelay?: number;
17
17
  tooltipShowDelay?: number;
@@ -24,7 +24,7 @@ export declare type RadioGroupProps = {
24
24
  value?: string | number;
25
25
  onChange?: (event: RadioChangeEvent) => void;
26
26
  className?: string;
27
- children?: React.ReactNode | undefined;
27
+ children?: React.ReactNode;
28
28
  style?: React.CSSProperties;
29
29
  direction?: ArrayElement<typeof strings.DIRECTION_SET>;
30
30
  mode?: RadioMode;
@@ -19,7 +19,7 @@ declare type ExcludeInputType = {
19
19
  };
20
20
  export interface optionRenderProps {
21
21
  key?: any;
22
- label?: string | React.ReactNode | number;
22
+ label?: React.ReactNode;
23
23
  value?: string | number;
24
24
  style?: React.CSSProperties;
25
25
  className?: string;
@@ -16,8 +16,6 @@ exports.default = void 0;
16
16
 
17
17
  var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/map"));
18
18
 
19
- var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
20
-
21
19
  var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
22
20
 
23
21
  var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
@@ -34,6 +32,8 @@ var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-sta
34
32
 
35
33
  var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
36
34
 
35
+ var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
36
+
37
37
  var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
38
38
 
39
39
  var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
@@ -56,7 +56,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
56
56
 
57
57
  var _propTypes = _interopRequireDefault(require("prop-types"));
58
58
 
59
- var _context16 = _interopRequireDefault(require("../configProvider/context"));
59
+ var _context15 = _interopRequireDefault(require("../configProvider/context"));
60
60
 
61
61
  var _foundation = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cjs/select/foundation"));
62
62
 
@@ -96,6 +96,8 @@ var _utils2 = require("../_utils");
96
96
 
97
97
  var _warning = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cjs/utils/warning"));
98
98
 
99
+ var _uuid = require("@douyinfe/semi-foundation/lib/cjs/utils/uuid");
100
+
99
101
  require("@douyinfe/semi-foundation/lib/cjs/select/select.css");
100
102
 
101
103
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -110,7 +112,7 @@ const key = 0; // Notes: Use the label of the option as the identifier, that is,
110
112
 
111
113
  class Select extends _baseComponent.default {
112
114
  constructor(props) {
113
- var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8;
115
+ var _context, _context2, _context3, _context4, _context5, _context6, _context7;
114
116
 
115
117
  super(props);
116
118
 
@@ -132,19 +134,19 @@ class Select extends _baseComponent.default {
132
134
  };
133
135
  /* Generate random string */
134
136
 
135
- this.selectOptionListID = (0, _slice.default)(_context = Math.random().toString(36)).call(_context, 2);
137
+ this.selectOptionListID = '';
136
138
  this.virtualizeListRef = /*#__PURE__*/_react.default.createRef();
137
139
  this.inputRef = /*#__PURE__*/_react.default.createRef();
138
140
  this.triggerRef = /*#__PURE__*/_react.default.createRef();
139
141
  this.optionsRef = /*#__PURE__*/_react.default.createRef();
140
142
  this.clickOutsideHandler = null;
141
- this.onSelect = (0, _bind.default)(_context2 = this.onSelect).call(_context2, this);
142
- this.onClear = (0, _bind.default)(_context3 = this.onClear).call(_context3, this);
143
- this.onMouseEnter = (0, _bind.default)(_context4 = this.onMouseEnter).call(_context4, this);
144
- this.onMouseLeave = (0, _bind.default)(_context5 = this.onMouseLeave).call(_context5, this);
145
- this.renderOption = (0, _bind.default)(_context6 = this.renderOption).call(_context6, this);
146
- this.onKeyPress = (0, _bind.default)(_context7 = this.onKeyPress).call(_context7, this);
147
- this.onClearBtnEnterPress = (0, _bind.default)(_context8 = this.onClearBtnEnterPress).call(_context8, this);
143
+ this.onSelect = (0, _bind.default)(_context = this.onSelect).call(_context, this);
144
+ this.onClear = (0, _bind.default)(_context2 = this.onClear).call(_context2, this);
145
+ this.onMouseEnter = (0, _bind.default)(_context3 = this.onMouseEnter).call(_context3, this);
146
+ this.onMouseLeave = (0, _bind.default)(_context4 = this.onMouseLeave).call(_context4, this);
147
+ this.renderOption = (0, _bind.default)(_context5 = this.renderOption).call(_context5, this);
148
+ this.onKeyPress = (0, _bind.default)(_context6 = this.onKeyPress).call(_context6, this);
149
+ this.onClearBtnEnterPress = (0, _bind.default)(_context7 = this.onClearBtnEnterPress).call(_context7, this);
148
150
  this.foundation = new _foundation.default(this.adapter);
149
151
  (0, _warning.default)('optionLabelProp' in this.props, '[Semi Select] \'optionLabelProp\' has already been deprecated, please use \'renderSelectedItem\' instead.');
150
152
  (0, _warning.default)('labelInValue' in this.props, '[Semi Select] \'labelInValue\' has already been deprecated, please use \'onChangeWithObject\' instead.');
@@ -348,18 +350,18 @@ class Select extends _baseComponent.default {
348
350
  } catch (error) {}
349
351
  },
350
352
  updateScrollTop: index => {
351
- var _context10, _context11;
353
+ var _context9, _context10;
352
354
 
353
355
  // eslint-disable-next-line max-len
354
356
  let optionClassName = ".".concat(prefixcls, "-option-selected");
355
357
 
356
358
  if (index !== undefined) {
357
- var _context9;
359
+ var _context8;
358
360
 
359
- optionClassName = (0, _concat.default)(_context9 = ".".concat(prefixcls, "-option:nth-child(")).call(_context9, index, ")");
361
+ optionClassName = (0, _concat.default)(_context8 = ".".concat(prefixcls, "-option:nth-child(")).call(_context8, index, ")");
360
362
  }
361
363
 
362
- let destNode = document.querySelector((0, _concat.default)(_context10 = (0, _concat.default)(_context11 = "#".concat(prefixcls, "-")).call(_context11, this.selectOptionListID, " ")).call(_context10, optionClassName));
364
+ let destNode = document.querySelector((0, _concat.default)(_context9 = (0, _concat.default)(_context10 = "#".concat(prefixcls, "-")).call(_context10, this.selectOptionListID, " ")).call(_context9, optionClassName));
363
365
 
364
366
  if ((0, _isArray.default)(destNode)) {
365
367
  // eslint-disable-next-line prefer-destructuring
@@ -380,6 +382,7 @@ class Select extends _baseComponent.default {
380
382
 
381
383
  componentDidMount() {
382
384
  this.foundation.init();
385
+ this.selectOptionListID = (0, _uuid.getUuidShort)();
383
386
  }
384
387
 
385
388
  componentWillUnmount() {
@@ -387,10 +390,10 @@ class Select extends _baseComponent.default {
387
390
  }
388
391
 
389
392
  componentDidUpdate(prevProps, prevState) {
390
- var _context12, _context13;
393
+ var _context11, _context12;
391
394
 
392
- const prevChildrenKeys = (0, _map2.default)(_context12 = _react.default.Children.toArray(prevProps.children)).call(_context12, child => child.key);
393
- const nowChildrenKeys = (0, _map2.default)(_context13 = _react.default.Children.toArray(this.props.children)).call(_context13, child => child.key);
395
+ const prevChildrenKeys = (0, _map2.default)(_context11 = _react.default.Children.toArray(prevProps.children)).call(_context11, child => child.key);
396
+ const nowChildrenKeys = (0, _map2.default)(_context12 = _react.default.Children.toArray(this.props.children)).call(_context12, child => child.key);
394
397
  let isOptionsChanged = false;
395
398
 
396
399
  if (!(0, _isEqual2.default)(prevChildrenKeys, nowChildrenKeys) || !(0, _isEqual2.default)(prevProps.optionList, this.props.optionList)) {
@@ -631,7 +634,7 @@ class Select extends _baseComponent.default {
631
634
  }
632
635
 
633
636
  renderOptions(children) {
634
- var _context14;
637
+ var _context13;
635
638
 
636
639
  const {
637
640
  dropdownMinWidth,
@@ -667,7 +670,7 @@ class Select extends _baseComponent.default {
667
670
  });
668
671
  const isEmpty = !options.length || !(0, _some.default)(options).call(options, item => item._show);
669
672
  return /*#__PURE__*/_react.default.createElement("div", {
670
- id: (0, _concat.default)(_context14 = "".concat(prefixcls, "-")).call(_context14, this.selectOptionListID),
673
+ id: (0, _concat.default)(_context13 = "".concat(prefixcls, "-")).call(_context13, this.selectOptionListID),
671
674
  className: dropdownClassName,
672
675
  style: style
673
676
  }, outerTopSlot, /*#__PURE__*/_react.default.createElement("div", {
@@ -898,7 +901,7 @@ class Select extends _baseComponent.default {
898
901
  }
899
902
 
900
903
  renderSelection() {
901
- var _context15;
904
+ var _context14;
902
905
 
903
906
  const {
904
907
  disabled,
@@ -982,7 +985,7 @@ class Select extends _baseComponent.default {
982
985
  role: "combobox",
983
986
  "aria-disabled": disabled,
984
987
  "aria-expanded": isOpen,
985
- "aria-controls": (0, _concat.default)(_context15 = "".concat(prefixcls, "-")).call(_context15, this.selectOptionListID),
988
+ "aria-controls": (0, _concat.default)(_context14 = "".concat(prefixcls, "-")).call(_context14, this.selectOptionListID),
986
989
  "aria-haspopup": "listbox",
987
990
  "aria-label": "select value",
988
991
  "aria-invalid": this.props['aria-invalid'],
@@ -1049,7 +1052,7 @@ class Select extends _baseComponent.default {
1049
1052
 
1050
1053
  }
1051
1054
 
1052
- Select.contextType = _context16.default;
1055
+ Select.contextType = _context15.default;
1053
1056
  Select.Option = _option.default;
1054
1057
  Select.OptGroup = _optionGroup.default;
1055
1058
  Select.propTypes = {