seat-editor 3.2.25 → 3.2.26

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.
@@ -7,7 +7,10 @@ export type RefsType = {
7
7
  };
8
8
  interface BoardTemplateProps {
9
9
  refs?: React.ForwardedRef<RefsType>;
10
- loadingComponent?: React.JSX.Element;
10
+ loadingRender?: {
11
+ state: boolean;
12
+ element: React.JSX.Element;
13
+ };
11
14
  }
12
- declare const BoardTemplate: ({ refs, loadingComponent }: BoardTemplateProps) => React.JSX.Element;
15
+ declare const BoardTemplate: ({ refs, loadingRender }: BoardTemplateProps) => React.JSX.Element;
13
16
  export default BoardTemplate;
@@ -14,7 +14,7 @@ import { applyResizeToSvgElement, arrayToSvgPointsAttr, createTableGhost, getGlo
14
14
  const toolElement = ["square", "circle", "table-seat-circle"];
15
15
  const idSelectionBoxGhost = "selection-box-ghost";
16
16
  const nameShapeSelectionBoxGhost = "selection-box";
17
- const BoardTemplate = ({ refs, loadingComponent }) => {
17
+ const BoardTemplate = ({ refs, loadingRender }) => {
18
18
  const dispatch = useAppDispatch();
19
19
  const backgroundColor = useAppSelector((state) => state.board.backgroundColor);
20
20
  const selectedComponentProps = useAppSelector((state) => state.panel.selectedComponent);
@@ -1501,7 +1501,7 @@ const BoardTemplate = ({ refs, loadingComponent }) => {
1501
1501
  };
1502
1502
  return (<>
1503
1503
  <ModalPreview>
1504
- <LayerView statusKey="status" loadingComponent={loadingComponent}/>
1504
+ <LayerView statusKey="status" loadingRender={loadingRender}/>
1505
1505
  <div className="flex gap-2 mt-2">
1506
1506
  <Radio.Group value={isShowTagType} onChange={handleCheckPreview}>
1507
1507
  <Radio value="default">Default</Radio>
@@ -39,7 +39,10 @@ export interface TableEditorProps {
39
39
  paddingRight?: number;
40
40
  paddingBottom?: number;
41
41
  };
42
- loadingComponent?: React.JSX.Element;
42
+ loadingRender?: {
43
+ state: boolean;
44
+ element: React.JSX.Element;
45
+ };
43
46
  }
44
47
  declare const TableEditor: (props: TableEditorProps) => import("react").JSX.Element;
45
48
  export default TableEditor;
@@ -128,7 +128,7 @@ const TableEditor = (props) => {
128
128
  <LayerView statusKey="status"/>
129
129
  </div>) : (<div key={`${viewOnly}`} className="w-full h-full flex relative">
130
130
  <SideTool dragOnly={dragOnly} deleteAutorized={deleteAutorized}/>
131
- <Board key={`${viewOnly}`} refs={refsBoard} loadingComponent={props === null || props === void 0 ? void 0 : props.loadingComponent}/>
131
+ <Board key={`${viewOnly}`} refs={refsBoard} loadingRender={props === null || props === void 0 ? void 0 : props.loadingRender}/>
132
132
  <ControlPanels action={props.action} transform={(_a = refsBoard === null || refsBoard === void 0 ? void 0 : refsBoard.current) === null || _a === void 0 ? void 0 : _a.transformRef}/>
133
133
  </div>)}
134
134
  </div>
@@ -78,7 +78,10 @@ export interface LayerViewProps<TMeta = undefined> {
78
78
  paddingBottom?: number;
79
79
  };
80
80
  disabled?: boolean;
81
- loadingComponent?: React.JSX.Element;
81
+ loadingRender?: {
82
+ state: boolean;
83
+ element: React.JSX.Element;
84
+ };
82
85
  }
83
86
  declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) => React.JSX.Element;
84
87
  export default LayerView;
@@ -6,7 +6,7 @@ import Layers from "../../components/layer-v4";
6
6
  import { getTranslate } from "../board-v3/utils";
7
7
  import { Spin } from "antd";
8
8
  const LayerView = (props) => {
9
- const { componentProps, extraComponentProps, onSelectComponent, onCurrentStateChange, mappingKey, statusKey, defaultBackground, iconTags, tooltipProps, onRightClick, allowTooltip = true, tableMatchKey, eventMatchTable, ghostAttributes, onDrop, onSwitch, refs, privilegedTags, disabled, loadingComponent, } = props;
9
+ const { componentProps, extraComponentProps, onSelectComponent, onCurrentStateChange, mappingKey, statusKey, defaultBackground, iconTags, tooltipProps, onRightClick, allowTooltip = true, tableMatchKey, eventMatchTable, ghostAttributes, onDrop, onSwitch, refs, privilegedTags, disabled, loadingRender, } = props;
10
10
  const widthTooltip = (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.minWidth) || 168;
11
11
  const tableGhost = useRef(null);
12
12
  const hoverUnderghostId = useRef(null);
@@ -38,7 +38,7 @@ const LayerView = (props) => {
38
38
  }));
39
39
  const dispatch = useAppDispatch();
40
40
  useEffect(() => {
41
- if (!loading) {
41
+ if (!(loading && (loadingRender === null || loadingRender === void 0 ? void 0 : loadingRender.state))) {
42
42
  dispatch({ type: "panel/setLoading", payload: true });
43
43
  }
44
44
  if ((componentProps === null || componentProps === void 0 ? void 0 : componentProps.length) > 0) {
@@ -526,7 +526,7 @@ const LayerView = (props) => {
526
526
  pointerEvents: disabled ? "none" : "auto",
527
527
  }} {...props.containerProps}>
528
528
  {loading && (<div className="absolute z-10 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-opacity-50 bg-white w-full h-full flex items-center justify-center">
529
- {loadingComponent || <Spin />}
529
+ {(loadingRender === null || loadingRender === void 0 ? void 0 : loadingRender.element) || <Spin />}
530
530
  </div>)}
531
531
 
532
532
  {/* {isDragging?.current && (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seat-editor",
3
- "version": "3.2.25",
3
+ "version": "3.2.26",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",