@douyinfe/semi-ui 2.43.0-beta.0 → 2.43.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,10 +23,7 @@ class Portal extends _react.PureComponent {
23
23
  var _a, _b;
24
24
  try {
25
25
  let container = undefined;
26
- if (!_this.el) {
27
- _this.el = document.createElement('div');
28
- }
29
- if (!((_a = _this.state) === null || _a === void 0 ? void 0 : _a.container)) {
26
+ if (!_this.el || !((_a = _this.state) === null || _a === void 0 ? void 0 : _a.container) || !Array.from(_this.state.container.childNodes).includes(_this.el)) {
30
27
  _this.el = document.createElement('div');
31
28
  const getContainer = _this.props.getPopupContainer || context.getPopupContainer || defaultGetContainer;
32
29
  const portalContainer = getContainer();
@@ -46,8 +46,8 @@ class Preview extends _baseComponent.default {
46
46
  if (item.isIntersecting && src) {
47
47
  item.target.src = src;
48
48
  item.target.removeAttribute("data-src");
49
+ this.previewObserver.unobserve(item.target);
49
50
  }
50
- this.previewObserver.unobserve(item.target);
51
51
  });
52
52
  }, {
53
53
  root: document.querySelector(`#${this.previewGroupId}`),
@@ -59,7 +59,7 @@ declare class Popover extends React.PureComponent<PopoverProps, PopoverState> {
59
59
  margin: PropTypes.Requireable<NonNullable<number | object>>;
60
60
  mouseEnterDelay: PropTypes.Requireable<number>;
61
61
  mouseLeaveDelay: PropTypes.Requireable<number>;
62
- trigger: PropTypes.Validator<NonNullable<"hover" | "focus" | "click" | "custom">>;
62
+ trigger: PropTypes.Validator<NonNullable<"hover" | "focus" | "click" | "custom" | "contextMenu">>;
63
63
  contentClassName: PropTypes.Requireable<NonNullable<string | any[]>>;
64
64
  onVisibleChange: PropTypes.Requireable<(...args: any[]) => any>;
65
65
  onClickOutSide: PropTypes.Requireable<(...args: any[]) => any>;
@@ -61,7 +61,7 @@ export interface TreeProps extends BasicTreeProps {
61
61
  onExpand?: (expandedKeys: string[], expandedOtherProps: ExpandedOtherProps) => void;
62
62
  onLoad?: (loadedKeys?: Set<string>, treeNode?: TreeNodeData) => void;
63
63
  onContextMenu?: (e: MouseEvent, node: TreeNodeData) => void;
64
- onSelect?: (selectedKeys: string, selected: boolean, selectedNode: TreeNodeData) => void;
64
+ onSelect?: (selectedKey: string, selected: boolean, selectedNode: TreeNodeData) => void;
65
65
  renderDraggingNode?: (nodeInstance: HTMLElement, node: TreeNodeData) => HTMLElement;
66
66
  renderFullLabel?: (renderFullLabelProps: RenderFullLabelProps) => ReactNode;
67
67
  renderLabel?: (label?: ReactNode, treeNode?: TreeNodeData) => ReactNode;
@@ -74,7 +74,7 @@ export interface TreeSelectProps extends Omit<BasicTreeSelectProps, OverrideComm
74
74
  stopPropagation?: boolean | string;
75
75
  restTagsPopoverProps?: PopoverProps;
76
76
  searchRender?: boolean | ((inputProps: InputProps) => React.ReactNode);
77
- onSelect?: (selectedKeys: string, selected: boolean, selectedNode: TreeNodeData) => void;
77
+ onSelect?: (selectedKey: string, selected: boolean, selectedNode: TreeNodeData) => void;
78
78
  renderSelectedItem?: RenderSelectedItem;
79
79
  getPopupContainer?: () => HTMLElement;
80
80
  triggerRender?: (props?: TriggerRenderProps) => React.ReactNode;
@@ -16,10 +16,7 @@ class Portal extends PureComponent {
16
16
  var _a, _b;
17
17
  try {
18
18
  let container = undefined;
19
- if (!_this.el) {
20
- _this.el = document.createElement('div');
21
- }
22
- if (!((_a = _this.state) === null || _a === void 0 ? void 0 : _a.container)) {
19
+ if (!_this.el || !((_a = _this.state) === null || _a === void 0 ? void 0 : _a.container) || !Array.from(_this.state.container.childNodes).includes(_this.el)) {
23
20
  _this.el = document.createElement('div');
24
21
  const getContainer = _this.props.getPopupContainer || context.getPopupContainer || defaultGetContainer;
25
22
  const portalContainer = getContainer();
@@ -37,8 +37,8 @@ export default class Preview extends BaseComponent {
37
37
  if (item.isIntersecting && src) {
38
38
  item.target.src = src;
39
39
  item.target.removeAttribute("data-src");
40
+ this.previewObserver.unobserve(item.target);
40
41
  }
41
- this.previewObserver.unobserve(item.target);
42
42
  });
43
43
  }, {
44
44
  root: document.querySelector(`#${this.previewGroupId}`),
@@ -59,7 +59,7 @@ declare class Popover extends React.PureComponent<PopoverProps, PopoverState> {
59
59
  margin: PropTypes.Requireable<NonNullable<number | object>>;
60
60
  mouseEnterDelay: PropTypes.Requireable<number>;
61
61
  mouseLeaveDelay: PropTypes.Requireable<number>;
62
- trigger: PropTypes.Validator<NonNullable<"hover" | "focus" | "click" | "custom">>;
62
+ trigger: PropTypes.Validator<NonNullable<"hover" | "focus" | "click" | "custom" | "contextMenu">>;
63
63
  contentClassName: PropTypes.Requireable<NonNullable<string | any[]>>;
64
64
  onVisibleChange: PropTypes.Requireable<(...args: any[]) => any>;
65
65
  onClickOutSide: PropTypes.Requireable<(...args: any[]) => any>;
@@ -61,7 +61,7 @@ export interface TreeProps extends BasicTreeProps {
61
61
  onExpand?: (expandedKeys: string[], expandedOtherProps: ExpandedOtherProps) => void;
62
62
  onLoad?: (loadedKeys?: Set<string>, treeNode?: TreeNodeData) => void;
63
63
  onContextMenu?: (e: MouseEvent, node: TreeNodeData) => void;
64
- onSelect?: (selectedKeys: string, selected: boolean, selectedNode: TreeNodeData) => void;
64
+ onSelect?: (selectedKey: string, selected: boolean, selectedNode: TreeNodeData) => void;
65
65
  renderDraggingNode?: (nodeInstance: HTMLElement, node: TreeNodeData) => HTMLElement;
66
66
  renderFullLabel?: (renderFullLabelProps: RenderFullLabelProps) => ReactNode;
67
67
  renderLabel?: (label?: ReactNode, treeNode?: TreeNodeData) => ReactNode;
@@ -74,7 +74,7 @@ export interface TreeSelectProps extends Omit<BasicTreeSelectProps, OverrideComm
74
74
  stopPropagation?: boolean | string;
75
75
  restTagsPopoverProps?: PopoverProps;
76
76
  searchRender?: boolean | ((inputProps: InputProps) => React.ReactNode);
77
- onSelect?: (selectedKeys: string, selected: boolean, selectedNode: TreeNodeData) => void;
77
+ onSelect?: (selectedKey: string, selected: boolean, selectedNode: TreeNodeData) => void;
78
78
  renderSelectedItem?: RenderSelectedItem;
79
79
  getPopupContainer?: () => HTMLElement;
80
80
  triggerRender?: (props?: TriggerRenderProps) => React.ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.43.0-beta.0",
3
+ "version": "2.43.1",
4
4
  "description": "A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -20,12 +20,12 @@
20
20
  "@dnd-kit/core": "^6.0.8",
21
21
  "@dnd-kit/sortable": "^7.0.2",
22
22
  "@dnd-kit/utilities": "^3.2.1",
23
- "@douyinfe/semi-animation": "2.43.0-beta.0",
24
- "@douyinfe/semi-animation-react": "2.43.0-beta.0",
25
- "@douyinfe/semi-foundation": "2.43.0-beta.0",
26
- "@douyinfe/semi-icons": "2.43.0-beta.0",
27
- "@douyinfe/semi-illustrations": "2.43.0-beta.0",
28
- "@douyinfe/semi-theme-default": "2.43.0-beta.0",
23
+ "@douyinfe/semi-animation": "2.43.1",
24
+ "@douyinfe/semi-animation-react": "2.43.1",
25
+ "@douyinfe/semi-foundation": "2.43.1",
26
+ "@douyinfe/semi-icons": "2.43.1",
27
+ "@douyinfe/semi-illustrations": "2.43.1",
28
+ "@douyinfe/semi-theme-default": "2.43.1",
29
29
  "async-validator": "^3.5.0",
30
30
  "classnames": "^2.2.6",
31
31
  "copy-text-to-clipboard": "^2.1.1",
@@ -75,7 +75,7 @@
75
75
  ],
76
76
  "author": "",
77
77
  "license": "MIT",
78
- "gitHead": "48acb39a658ce8078194ef761a655f7c2215e2b2",
78
+ "gitHead": "84abaef26e42768a44ba5db31b9891bf508a314e",
79
79
  "devDependencies": {
80
80
  "@babel/plugin-proposal-decorators": "^7.15.8",
81
81
  "@babel/plugin-transform-runtime": "^7.15.8",