@douyinfe/semi-ui 2.21.3-alpha.0 → 2.22.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 (69) hide show
  1. package/dist/css/semi.css +4 -0
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +326 -274
  4. package/dist/umd/semi-ui.js.map +1 -1
  5. package/dist/umd/semi-ui.min.js +1 -1
  6. package/dist/umd/semi-ui.min.js.map +1 -1
  7. package/lib/cjs/_base/baseComponent.js +3 -0
  8. package/lib/cjs/anchor/index.d.ts +1 -1
  9. package/lib/cjs/autoComplete/index.d.ts +1 -1
  10. package/lib/cjs/checkbox/checkbox.d.ts +5 -1
  11. package/lib/cjs/checkbox/checkbox.js +24 -0
  12. package/lib/cjs/checkbox/checkboxGroup.js +2 -2
  13. package/lib/cjs/checkbox/context.d.ts +1 -2
  14. package/lib/cjs/datePicker/datePicker.d.ts +2 -2
  15. package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
  16. package/lib/cjs/datePicker/quickControl.d.ts +1 -1
  17. package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
  18. package/lib/cjs/dropdown/dropdownMenu.d.ts +1 -0
  19. package/lib/cjs/dropdown/index.d.ts +2 -1
  20. package/lib/cjs/form/baseForm.d.ts +2 -2
  21. package/lib/cjs/form/field.d.ts +2 -2
  22. package/lib/cjs/image/preview.d.ts +1 -0
  23. package/lib/cjs/image/previewImage.d.ts +1 -1
  24. package/lib/cjs/image/previewImage.js +8 -5
  25. package/lib/cjs/image/previewInner.js +3 -3
  26. package/lib/cjs/input/index.d.ts +1 -0
  27. package/lib/cjs/input/textarea.js +1 -1
  28. package/lib/cjs/popover/index.d.ts +1 -1
  29. package/lib/cjs/select/index.d.ts +1 -1
  30. package/lib/cjs/slider/index.js +2 -2
  31. package/lib/cjs/spin/index.d.ts +1 -0
  32. package/lib/cjs/table/Table.d.ts +1 -1
  33. package/lib/cjs/table/Table.js +16 -0
  34. package/lib/cjs/table/TableHeaderRow.d.ts +1 -0
  35. package/lib/cjs/table/interface.d.ts +2 -0
  36. package/lib/cjs/tooltip/index.d.ts +1 -1
  37. package/lib/cjs/typography/title.d.ts +1 -1
  38. package/lib/es/_base/baseComponent.js +3 -0
  39. package/lib/es/anchor/index.d.ts +1 -1
  40. package/lib/es/autoComplete/index.d.ts +1 -1
  41. package/lib/es/checkbox/checkbox.d.ts +5 -1
  42. package/lib/es/checkbox/checkbox.js +24 -0
  43. package/lib/es/checkbox/checkboxGroup.js +2 -2
  44. package/lib/es/checkbox/context.d.ts +1 -2
  45. package/lib/es/datePicker/datePicker.d.ts +2 -2
  46. package/lib/es/datePicker/monthsGrid.d.ts +1 -1
  47. package/lib/es/datePicker/quickControl.d.ts +1 -1
  48. package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
  49. package/lib/es/dropdown/dropdownMenu.d.ts +1 -0
  50. package/lib/es/dropdown/index.d.ts +2 -1
  51. package/lib/es/form/baseForm.d.ts +2 -2
  52. package/lib/es/form/field.d.ts +2 -2
  53. package/lib/es/image/preview.d.ts +1 -0
  54. package/lib/es/image/previewImage.d.ts +1 -1
  55. package/lib/es/image/previewImage.js +8 -5
  56. package/lib/es/image/previewInner.js +3 -3
  57. package/lib/es/input/index.d.ts +1 -0
  58. package/lib/es/input/textarea.js +1 -1
  59. package/lib/es/popover/index.d.ts +1 -1
  60. package/lib/es/select/index.d.ts +1 -1
  61. package/lib/es/slider/index.js +2 -2
  62. package/lib/es/spin/index.d.ts +1 -0
  63. package/lib/es/table/Table.d.ts +1 -1
  64. package/lib/es/table/Table.js +16 -0
  65. package/lib/es/table/TableHeaderRow.d.ts +1 -0
  66. package/lib/es/table/interface.d.ts +2 -0
  67. package/lib/es/tooltip/index.d.ts +1 -1
  68. package/lib/es/typography/title.d.ts +1 -1
  69. package/package.json +7 -8
@@ -60,6 +60,9 @@ class BaseComponent extends _react.Component {
60
60
  e.stopPropagation();
61
61
  e.nativeEvent && e.nativeEvent.stopImmediatePropagation();
62
62
  } catch (error) {}
63
+ },
64
+ persistEvent: e => {
65
+ e && e.persist && typeof e.persist === 'function' ? e.persist() : null;
63
66
  }
64
67
  };
65
68
  }
@@ -48,7 +48,7 @@ declare class Anchor extends BaseComponent<AnchorProps, AnchorState> {
48
48
  offsetTop: PropTypes.Requireable<number>;
49
49
  targetOffset: PropTypes.Requireable<number>;
50
50
  showTooltip: PropTypes.Requireable<boolean>;
51
- position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
51
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
52
52
  maxWidth: PropTypes.Requireable<string | number>;
53
53
  maxHeight: PropTypes.Requireable<string | number>;
54
54
  getContainer: PropTypes.Requireable<(...args: any[]) => any>;
@@ -115,7 +115,7 @@ declare class AutoComplete<T extends AutoCompleteItems> extends BaseComponent<Au
115
115
  onFocus: PropTypes.Requireable<(...args: any[]) => any>;
116
116
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
117
117
  onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
118
- position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
118
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
119
119
  placeholder: PropTypes.Requireable<string>;
120
120
  prefix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
121
121
  onChangeWithObject: PropTypes.Requireable<boolean>;
@@ -6,7 +6,11 @@ import BaseComponent from '../_base/baseComponent';
6
6
  import '@douyinfe/semi-foundation/lib/cjs/checkbox/checkbox.css';
7
7
  import { CheckboxContextType } from './context';
8
8
  import { CheckboxType } from './checkboxGroup';
9
- export declare type CheckboxEvent = BasicCheckboxEvent;
9
+ export interface CheckboxEvent extends BasicCheckboxEvent {
10
+ nativeEvent: {
11
+ stopImmediatePropagation: () => void;
12
+ };
13
+ }
10
14
  export declare type TargetObject = BasicTargetObject;
11
15
  export interface CheckboxProps extends BaseCheckboxProps {
12
16
  'aria-describedby'?: React.AriaAttributes['aria-describedby'];
@@ -74,6 +74,30 @@ class Checkbox extends _baseComponent.default {
74
74
  } = this.props;
75
75
  onChange && onChange(cbContent);
76
76
  },
77
+ generateEvent: (checked, e) => {
78
+ const {
79
+ props
80
+ } = this;
81
+ const cbValue = {
82
+ target: Object.assign(Object.assign({}, props), {
83
+ checked
84
+ }),
85
+ stopPropagation: () => {
86
+ e.stopPropagation();
87
+ },
88
+ preventDefault: () => {
89
+ e.preventDefault();
90
+ },
91
+ nativeEvent: {
92
+ stopImmediatePropagation: () => {
93
+ if (e.nativeEvent && typeof e.nativeEvent.stopImmediatePropagation === 'function') {
94
+ e.nativeEvent.stopImmediatePropagation();
95
+ }
96
+ }
97
+ }
98
+ };
99
+ return cbValue;
100
+ },
77
101
  getIsInGroup: () => this.isInGroup(),
78
102
  getGroupValue: () => this.context && this.context.checkboxGroup.value || [],
79
103
  notifyGroupChange: cbContent => {
@@ -43,8 +43,8 @@ class CheckboxGroup extends _baseComponent.default {
43
43
  value
44
44
  });
45
45
  },
46
- notifyChange: evt => {
47
- this.props.onChange && this.props.onChange(evt);
46
+ notifyChange: value => {
47
+ this.props.onChange && this.props.onChange(value);
48
48
  }
49
49
  });
50
50
  }
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import { BasicCheckboxEvent } from '@douyinfe/semi-foundation/lib/cjs/checkbox/checkboxFoundation';
3
2
  declare type CheckboxContextType = {
4
3
  checkboxGroup?: {
5
- onChange: (evt: BasicCheckboxEvent) => void;
4
+ onChange: (evt: any) => void;
6
5
  value: any[];
7
6
  disabled: boolean;
8
7
  name: any;
@@ -56,7 +56,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
56
56
  max: PropTypes.Requireable<number>;
57
57
  placeholder: PropTypes.Requireable<string | any[]>;
58
58
  presets: PropTypes.Requireable<any[]>;
59
- presetPosition: PropTypes.Requireable<"left" | "top" | "right" | "bottom">;
59
+ presetPosition: PropTypes.Requireable<"top" | "left" | "right" | "bottom">;
60
60
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
61
61
  onChangeWithDateFirst: PropTypes.Requireable<boolean>;
62
62
  weekStartsOn: PropTypes.Requireable<number>;
@@ -73,7 +73,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
73
73
  insetLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>;
74
74
  insetLabelId: PropTypes.Requireable<string>;
75
75
  zIndex: PropTypes.Requireable<number>;
76
- position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
76
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
77
77
  getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
78
78
  onCancel: PropTypes.Requireable<(...args: any[]) => any>;
79
79
  onConfirm: PropTypes.Requireable<(...args: any[]) => any>;
@@ -50,7 +50,7 @@ export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGri
50
50
  onPanelChange: PropTypes.Requireable<(...args: any[]) => any>;
51
51
  focusRecordsRef: PropTypes.Requireable<object>;
52
52
  triggerRender: PropTypes.Requireable<(...args: any[]) => any>;
53
- presetPosition: PropTypes.Requireable<"left" | "top" | "right" | "bottom">;
53
+ presetPosition: PropTypes.Requireable<"top" | "left" | "right" | "bottom">;
54
54
  renderQuickControls: PropTypes.Requireable<PropTypes.ReactNodeLike>;
55
55
  renderDateInput: PropTypes.Requireable<PropTypes.ReactNodeLike>;
56
56
  };
@@ -13,7 +13,7 @@ export interface QuickControlProps {
13
13
  declare class QuickControl extends PureComponent<QuickControlProps> {
14
14
  static propTypes: {
15
15
  presets: PropTypes.Requireable<any[]>;
16
- presetPosition: PropTypes.Requireable<"left" | "top" | "right" | "bottom">;
16
+ presetPosition: PropTypes.Requireable<"top" | "left" | "right" | "bottom">;
17
17
  onPresetClick: PropTypes.Requireable<(...args: any[]) => any>;
18
18
  type: PropTypes.Requireable<string>;
19
19
  insetInput: PropTypes.Requireable<boolean>;
@@ -20,7 +20,7 @@ declare class YearAndMonth extends BaseComponent<YearAndMonthProps, YearAndMonth
20
20
  noBackBtn: PropTypes.Requireable<boolean>;
21
21
  disabledDate: PropTypes.Requireable<(...args: any[]) => any>;
22
22
  density: PropTypes.Requireable<string>;
23
- presetPosition: PropTypes.Requireable<"left" | "top" | "right" | "bottom">;
23
+ presetPosition: PropTypes.Requireable<"top" | "left" | "right" | "bottom">;
24
24
  renderQuickControls: PropTypes.Requireable<PropTypes.ReactNodeLike>;
25
25
  renderDateInput: PropTypes.Requireable<PropTypes.ReactNodeLike>;
26
26
  };
@@ -23,6 +23,7 @@ declare class DropdownMenu extends BaseComponent<DropdownMenuProps> {
23
23
  getCaches(): any;
24
24
  setCache(key: any, value: any): void;
25
25
  stopPropagation(e: any): void;
26
+ persistEvent: (event: any) => void;
26
27
  };
27
28
  componentDidMount(): void;
28
29
  render(): JSX.Element;
@@ -59,7 +59,7 @@ declare class Dropdown extends BaseComponent<DropdownProps, DropdownState> {
59
59
  render: PropTypes.Requireable<PropTypes.ReactNodeLike>;
60
60
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
61
61
  visible: PropTypes.Requireable<boolean>;
62
- position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
62
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
63
63
  getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
64
64
  mouseEnterDelay: PropTypes.Requireable<number>;
65
65
  mouseLeaveDelay: PropTypes.Requireable<number>;
@@ -104,6 +104,7 @@ declare class Dropdown extends BaseComponent<DropdownProps, DropdownState> {
104
104
  getCaches(): any;
105
105
  setCache(key: any, value: any): void;
106
106
  stopPropagation(e: any): void;
107
+ persistEvent: (event: any) => void;
107
108
  };
108
109
  handleVisibleChange: (visible: boolean) => any;
109
110
  renderContent(): JSX.Element;
@@ -80,7 +80,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
80
80
  emptyContent?: React.ReactNode;
81
81
  onDropdownVisibleChange?: (visible: boolean) => void;
82
82
  zIndex?: number;
83
- position?: "left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
83
+ position?: "top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
84
84
  onSearch?: (value: string) => void;
85
85
  dropdownClassName?: string;
86
86
  dropdownStyle?: React.CSSProperties;
@@ -126,7 +126,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
126
126
  onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
127
127
  children?: React.ReactNode;
128
128
  preventScroll?: boolean;
129
- } & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
129
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
130
130
  static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
131
131
  static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
132
132
  static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
@@ -28,7 +28,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
28
28
  emptyContent?: import("react").ReactNode;
29
29
  onDropdownVisibleChange?: (visible: boolean) => void;
30
30
  zIndex?: number;
31
- position?: "left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
31
+ position?: "top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
32
32
  onSearch?: (value: string) => void;
33
33
  dropdownClassName?: string;
34
34
  dropdownStyle?: import("react").CSSProperties;
@@ -74,7 +74,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
74
74
  onListScroll?: (e: import("react").UIEvent<HTMLDivElement, UIEvent>) => void;
75
75
  children?: import("react").ReactNode;
76
76
  preventScroll?: boolean;
77
- } & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
77
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
78
78
  declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
79
79
  declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
80
80
  declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
@@ -64,6 +64,7 @@ export default class Preview extends BaseComponent<PreviewProps, PreviewState> {
64
64
  getCaches(): any;
65
65
  setCache(key: any, value: any): void;
66
66
  stopPropagation(e: any): void;
67
+ persistEvent: (event: any) => void;
67
68
  };
68
69
  foundation: PreviewFoundation;
69
70
  previewGroupId: string;
@@ -28,7 +28,7 @@ export default class PreviewImage extends BaseComponent<PreviewImageProps, Previ
28
28
  };
29
29
  get adapter(): PreviewImageAdapter<PreviewImageProps, PreviewImageStates>;
30
30
  containerRef: React.RefObject<HTMLDivElement>;
31
- imageRef: React.RefObject<HTMLImageElement>;
31
+ imageRef: HTMLImageElement | null;
32
32
  foundation: PreviewImageFoundation;
33
33
  constructor(props: any);
34
34
  componentDidMount(): void;
@@ -75,7 +75,7 @@ class PreviewImage extends _baseComponent.default {
75
75
 
76
76
 
77
77
  this.registryImageRef = ref => {
78
- if (this.imageRef && this.imageRef.current) {
78
+ if (this.imageRef) {
79
79
  this.imageRef.removeEventListener("wheel", this.handleWheel);
80
80
  }
81
81
 
@@ -109,7 +109,7 @@ class PreviewImage extends _baseComponent.default {
109
109
  left: 0
110
110
  };
111
111
  this.containerRef = /*#__PURE__*/_react.default.createRef();
112
- this.imageRef = /*#__PURE__*/_react.default.createRef();
112
+ this.imageRef = null;
113
113
  this.foundation = new _previewImageFoundation.default(this.adapter);
114
114
  }
115
115
 
@@ -123,10 +123,10 @@ class PreviewImage extends _baseComponent.default {
123
123
  originImageWidth = size.originImageWidth;
124
124
  originImageHeight = size.originImageHeight;
125
125
  },
126
- getContainerRef: () => {
127
- return this.containerRef;
126
+ getContainer: () => {
127
+ return this.containerRef.current;
128
128
  },
129
- getImageRef: () => {
129
+ getImage: () => {
130
130
  return this.imageRef;
131
131
  },
132
132
  getMouseMove: () => startMouseMove,
@@ -141,6 +141,9 @@ class PreviewImage extends _baseComponent.default {
141
141
  this.setState({
142
142
  loading
143
143
  });
144
+ },
145
+ setImageCursor: canDrag => {
146
+ this.imageRef.style.cursor = canDrag ? "grab" : "default";
144
147
  }
145
148
  });
146
149
  }
@@ -78,7 +78,7 @@ class PreviewInner extends _baseComponent.default {
78
78
  };
79
79
 
80
80
  this.handleMouseUp = e => {
81
- this.foundation.handleMouseUp(e);
81
+ this.foundation.handleMouseUp(e.nativeEvent);
82
82
  };
83
83
 
84
84
  this.handleMouseMove = e => {
@@ -321,8 +321,8 @@ class PreviewInner extends _baseComponent.default {
321
321
  onMouseDown: this.handleMouseDown,
322
322
  onMouseUp: this.handleMouseUp,
323
323
  onMouseMove: this.handleMouseMove,
324
- onMouseOver: e => this.handleMouseEvent(e, "over"),
325
- onMouseOut: e => this.handleMouseEvent(e, "out")
324
+ onMouseOver: e => this.handleMouseEvent(e.nativeEvent, "over"),
325
+ onMouseOut: e => this.handleMouseEvent(e.nativeEvent, "out")
326
326
  }, /*#__PURE__*/_react.default.createElement(_previewHeader.default, {
327
327
  className: (0, _classnames.default)(hideViewerCls),
328
328
  onClose: this.handlePreviewClose,
@@ -158,6 +158,7 @@ declare class Input extends BaseComponent<InputProps, InputState> {
158
158
  getCaches(): any;
159
159
  setCache(key: any, value: any): void;
160
160
  stopPropagation(e: any): void;
161
+ persistEvent: (event: any) => void;
161
162
  };
162
163
  static getDerivedStateFromProps(props: InputProps, state: InputState): Partial<InputState>;
163
164
  componentDidUpdate(prevProps: InputProps): void;
@@ -87,7 +87,7 @@ class TextArea extends _baseComponent.default {
87
87
  this.foundation.resizeTextarea();
88
88
  }
89
89
  }),
90
- getRef: () => this.libRef,
90
+ getRef: () => this.libRef.current,
91
91
  toggleFocusing: focusing => this.setState({
92
92
  isFocus: focusing
93
93
  }),
@@ -53,7 +53,7 @@ declare class Popover extends React.PureComponent<PopoverProps, PopoverState> {
53
53
  visible: PropTypes.Requireable<boolean>;
54
54
  autoAdjustOverflow: PropTypes.Requireable<boolean>;
55
55
  motion: PropTypes.Requireable<boolean | object>;
56
- position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
56
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
57
57
  mouseEnterDelay: PropTypes.Requireable<number>;
58
58
  mouseLeaveDelay: PropTypes.Requireable<number>;
59
59
  trigger: PropTypes.Validator<"hover" | "focus" | "click" | "custom">;
@@ -168,7 +168,7 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
168
168
  emptyContent: PropTypes.Requireable<PropTypes.ReactNodeLike>;
169
169
  onDropdownVisibleChange: PropTypes.Requireable<(...args: any[]) => any>;
170
170
  zIndex: PropTypes.Requireable<number>;
171
- position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
171
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
172
172
  onSearch: PropTypes.Requireable<(...args: any[]) => any>;
173
173
  getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
174
174
  dropdownClassName: PropTypes.Requireable<string>;
@@ -476,8 +476,8 @@ class Slider extends _baseComponent.default {
476
476
  setOverallVars: (key, value) => {
477
477
  this[key] = value;
478
478
  },
479
- getMinHandleEl: () => this.minHanleEl,
480
- getMaxHandleEl: () => this.maxHanleEl,
479
+ getMinHandleEl: () => this.minHanleEl.current,
480
+ getMaxHandleEl: () => this.maxHanleEl.current,
481
481
  onHandleDown: e => {
482
482
  this._addEventListener(document.body, 'mousemove', this.foundation.onHandleMove, false);
483
483
 
@@ -55,6 +55,7 @@ declare class Spin extends BaseComponent<SpinProps, SpinState> {
55
55
  getCaches(): any;
56
56
  setCache(key: any, value: any): void;
57
57
  stopPropagation(e: any): void;
58
+ persistEvent: (event: any) => void;
58
59
  };
59
60
  componentWillUnmount(): void;
60
61
  renderSpin(): JSX.Element;
@@ -300,7 +300,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
300
300
  showSizeChanger?: boolean;
301
301
  showQuickJumper?: boolean;
302
302
  popoverZIndex?: number;
303
- popoverPosition?: "left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
303
+ popoverPosition?: "top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
304
304
  hideOnSinglePage?: boolean;
305
305
  hoverShowPageSelect?: boolean;
306
306
  };
@@ -1127,7 +1127,23 @@ class Table extends _baseComponent.default {
1127
1127
  bodyHasScrollBar
1128
1128
  });
1129
1129
  }
1130
+ },
1131
+
1132
+ stopPropagation(e) {
1133
+ // The event definition here is not very accurate for now, it belongs to a broad structure definition
1134
+ if (e && typeof e === 'object') {
1135
+ if (typeof e.stopPropagation === 'function') {
1136
+ e.stopPropagation();
1137
+ }
1138
+
1139
+ if (e.nativeEvent && typeof e.nativeEvent.stopPropagation === 'function') {
1140
+ e.nativeEvent.stopPropagation();
1141
+ } else if (typeof e.stopImmediatePropagation === 'function') {
1142
+ e.stopImmediatePropagation();
1143
+ }
1144
+ }
1130
1145
  }
1146
+
1131
1147
  });
1132
1148
  }
1133
1149
 
@@ -51,6 +51,7 @@ export default class TableHeaderRow extends BaseComponent<TableHeaderRowProps, R
51
51
  getCaches(): any;
52
52
  setCache(key: any, value: any): void;
53
53
  stopPropagation(e: any): void;
54
+ persistEvent: (event: any) => void;
54
55
  };
55
56
  headerNode: HTMLElement;
56
57
  context: TableContextProps;
@@ -133,6 +133,8 @@ export interface FilterDropdownItem {
133
133
  }
134
134
  export interface RenderOptions {
135
135
  expandIcon?: React.ReactNode;
136
+ selection?: React.ReactNode;
137
+ indentText?: React.ReactNode;
136
138
  }
137
139
  export interface OnCellReturnObject extends React.TdHTMLAttributes<HTMLElement> {
138
140
  [x: string]: any;
@@ -81,7 +81,7 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
81
81
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
82
82
  motion: PropTypes.Requireable<boolean | object>;
83
83
  autoAdjustOverflow: PropTypes.Requireable<boolean>;
84
- position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
84
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
85
85
  getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
86
86
  mouseEnterDelay: PropTypes.Requireable<number>;
87
87
  mouseLeaveDelay: PropTypes.Requireable<number>;
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
37
37
  underline: PropTypes.Requireable<boolean>;
38
38
  strong: PropTypes.Requireable<boolean>;
39
39
  type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
40
- heading: PropTypes.Requireable<4 | 2 | 1 | 6 | 3 | 5>;
40
+ heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
41
41
  style: PropTypes.Requireable<object>;
42
42
  className: PropTypes.Requireable<string>;
43
43
  component: PropTypes.Requireable<string>;
@@ -49,6 +49,9 @@ export default class BaseComponent extends Component {
49
49
  e.stopPropagation();
50
50
  e.nativeEvent && e.nativeEvent.stopImmediatePropagation();
51
51
  } catch (error) {}
52
+ },
53
+ persistEvent: e => {
54
+ e && e.persist && typeof e.persist === 'function' ? e.persist() : null;
52
55
  }
53
56
  };
54
57
  }
@@ -48,7 +48,7 @@ declare class Anchor extends BaseComponent<AnchorProps, AnchorState> {
48
48
  offsetTop: PropTypes.Requireable<number>;
49
49
  targetOffset: PropTypes.Requireable<number>;
50
50
  showTooltip: PropTypes.Requireable<boolean>;
51
- position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
51
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
52
52
  maxWidth: PropTypes.Requireable<string | number>;
53
53
  maxHeight: PropTypes.Requireable<string | number>;
54
54
  getContainer: PropTypes.Requireable<(...args: any[]) => any>;
@@ -115,7 +115,7 @@ declare class AutoComplete<T extends AutoCompleteItems> extends BaseComponent<Au
115
115
  onFocus: PropTypes.Requireable<(...args: any[]) => any>;
116
116
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
117
117
  onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
118
- position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
118
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
119
119
  placeholder: PropTypes.Requireable<string>;
120
120
  prefix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
121
121
  onChangeWithObject: PropTypes.Requireable<boolean>;
@@ -6,7 +6,11 @@ import BaseComponent from '../_base/baseComponent';
6
6
  import '@douyinfe/semi-foundation/lib/es/checkbox/checkbox.css';
7
7
  import { CheckboxContextType } from './context';
8
8
  import { CheckboxType } from './checkboxGroup';
9
- export declare type CheckboxEvent = BasicCheckboxEvent;
9
+ export interface CheckboxEvent extends BasicCheckboxEvent {
10
+ nativeEvent: {
11
+ stopImmediatePropagation: () => void;
12
+ };
13
+ }
10
14
  export declare type TargetObject = BasicTargetObject;
11
15
  export interface CheckboxProps extends BaseCheckboxProps {
12
16
  'aria-describedby'?: React.AriaAttributes['aria-describedby'];
@@ -54,6 +54,30 @@ class Checkbox extends BaseComponent {
54
54
  } = this.props;
55
55
  onChange && onChange(cbContent);
56
56
  },
57
+ generateEvent: (checked, e) => {
58
+ const {
59
+ props
60
+ } = this;
61
+ const cbValue = {
62
+ target: Object.assign(Object.assign({}, props), {
63
+ checked
64
+ }),
65
+ stopPropagation: () => {
66
+ e.stopPropagation();
67
+ },
68
+ preventDefault: () => {
69
+ e.preventDefault();
70
+ },
71
+ nativeEvent: {
72
+ stopImmediatePropagation: () => {
73
+ if (e.nativeEvent && typeof e.nativeEvent.stopImmediatePropagation === 'function') {
74
+ e.nativeEvent.stopImmediatePropagation();
75
+ }
76
+ }
77
+ }
78
+ };
79
+ return cbValue;
80
+ },
57
81
  getIsInGroup: () => this.isInGroup(),
58
82
  getGroupValue: () => this.context && this.context.checkboxGroup.value || [],
59
83
  notifyGroupChange: cbContent => {
@@ -27,8 +27,8 @@ class CheckboxGroup extends BaseComponent {
27
27
  value
28
28
  });
29
29
  },
30
- notifyChange: evt => {
31
- this.props.onChange && this.props.onChange(evt);
30
+ notifyChange: value => {
31
+ this.props.onChange && this.props.onChange(value);
32
32
  }
33
33
  });
34
34
  }
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import { BasicCheckboxEvent } from '@douyinfe/semi-foundation/lib/es/checkbox/checkboxFoundation';
3
2
  declare type CheckboxContextType = {
4
3
  checkboxGroup?: {
5
- onChange: (evt: BasicCheckboxEvent) => void;
4
+ onChange: (evt: any) => void;
6
5
  value: any[];
7
6
  disabled: boolean;
8
7
  name: any;
@@ -56,7 +56,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
56
56
  max: PropTypes.Requireable<number>;
57
57
  placeholder: PropTypes.Requireable<string | any[]>;
58
58
  presets: PropTypes.Requireable<any[]>;
59
- presetPosition: PropTypes.Requireable<"left" | "top" | "right" | "bottom">;
59
+ presetPosition: PropTypes.Requireable<"top" | "left" | "right" | "bottom">;
60
60
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
61
61
  onChangeWithDateFirst: PropTypes.Requireable<boolean>;
62
62
  weekStartsOn: PropTypes.Requireable<number>;
@@ -73,7 +73,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
73
73
  insetLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>;
74
74
  insetLabelId: PropTypes.Requireable<string>;
75
75
  zIndex: PropTypes.Requireable<number>;
76
- position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
76
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
77
77
  getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
78
78
  onCancel: PropTypes.Requireable<(...args: any[]) => any>;
79
79
  onConfirm: PropTypes.Requireable<(...args: any[]) => any>;
@@ -50,7 +50,7 @@ export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGri
50
50
  onPanelChange: PropTypes.Requireable<(...args: any[]) => any>;
51
51
  focusRecordsRef: PropTypes.Requireable<object>;
52
52
  triggerRender: PropTypes.Requireable<(...args: any[]) => any>;
53
- presetPosition: PropTypes.Requireable<"left" | "top" | "right" | "bottom">;
53
+ presetPosition: PropTypes.Requireable<"top" | "left" | "right" | "bottom">;
54
54
  renderQuickControls: PropTypes.Requireable<PropTypes.ReactNodeLike>;
55
55
  renderDateInput: PropTypes.Requireable<PropTypes.ReactNodeLike>;
56
56
  };
@@ -13,7 +13,7 @@ export interface QuickControlProps {
13
13
  declare class QuickControl extends PureComponent<QuickControlProps> {
14
14
  static propTypes: {
15
15
  presets: PropTypes.Requireable<any[]>;
16
- presetPosition: PropTypes.Requireable<"left" | "top" | "right" | "bottom">;
16
+ presetPosition: PropTypes.Requireable<"top" | "left" | "right" | "bottom">;
17
17
  onPresetClick: PropTypes.Requireable<(...args: any[]) => any>;
18
18
  type: PropTypes.Requireable<string>;
19
19
  insetInput: PropTypes.Requireable<boolean>;
@@ -20,7 +20,7 @@ declare class YearAndMonth extends BaseComponent<YearAndMonthProps, YearAndMonth
20
20
  noBackBtn: PropTypes.Requireable<boolean>;
21
21
  disabledDate: PropTypes.Requireable<(...args: any[]) => any>;
22
22
  density: PropTypes.Requireable<string>;
23
- presetPosition: PropTypes.Requireable<"left" | "top" | "right" | "bottom">;
23
+ presetPosition: PropTypes.Requireable<"top" | "left" | "right" | "bottom">;
24
24
  renderQuickControls: PropTypes.Requireable<PropTypes.ReactNodeLike>;
25
25
  renderDateInput: PropTypes.Requireable<PropTypes.ReactNodeLike>;
26
26
  };
@@ -23,6 +23,7 @@ declare class DropdownMenu extends BaseComponent<DropdownMenuProps> {
23
23
  getCaches(): any;
24
24
  setCache(key: any, value: any): void;
25
25
  stopPropagation(e: any): void;
26
+ persistEvent: (event: any) => void;
26
27
  };
27
28
  componentDidMount(): void;
28
29
  render(): JSX.Element;