seat-editor 3.3.46 → 3.4.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 (75) hide show
  1. package/dist/app/constant.d.ts +3 -0
  2. package/dist/app/constant.js +2 -1
  3. package/dist/app/layout.d.ts +1 -1
  4. package/dist/app/new-board/page.d.ts +1 -1
  5. package/dist/app/new-board/page.js +6 -1
  6. package/dist/app/new-board/page.jsx +6 -1
  7. package/dist/app/old-board/page.d.ts +1 -2
  8. package/dist/app/only-view/chair.d.ts +1 -1
  9. package/dist/app/only-view/chair.js +2 -10
  10. package/dist/app/only-view/page.d.ts +1 -1
  11. package/dist/app/only-view/page.js +7 -7
  12. package/dist/app/only-view/user.d.ts +1 -1
  13. package/dist/app/only-view/user.js +2 -10
  14. package/dist/app/page.d.ts +1 -1
  15. package/dist/app/test/page.d.ts +1 -2
  16. package/dist/app/v2/page.d.ts +1 -1
  17. package/dist/components/button-tools/index.d.ts +1 -1
  18. package/dist/components/form-tools/label.d.ts +1 -1
  19. package/dist/components/form-tools/label.js +8 -4
  20. package/dist/components/form-tools/label.jsx +27 -21
  21. package/dist/components/form-tools/shape.d.ts +1 -1
  22. package/dist/components/form-tools/shape.js +41 -16
  23. package/dist/components/form-tools/shape.jsx +35 -14
  24. package/dist/components/input/number-indicator.d.ts +1 -1
  25. package/dist/components/joystick/index.d.ts +1 -2
  26. package/dist/components/layer/index.d.ts +1 -1
  27. package/dist/components/layer-v2/index.d.ts +1 -1
  28. package/dist/components/layer-v3/index.d.ts +1 -1
  29. package/dist/components/layer-v4/index.d.ts +1 -1
  30. package/dist/components/lib/index.d.ts +1 -1
  31. package/dist/components/modal-preview/index.d.ts +1 -1
  32. package/dist/features/board/index.d.ts +1 -1
  33. package/dist/features/board-v2/index.d.ts +1 -2
  34. package/dist/features/board-v3/index.d.ts +1 -1
  35. package/dist/features/board-v3/index.js +12 -5
  36. package/dist/features/board-v3/index.jsx +12 -5
  37. package/dist/features/navbar/index.d.ts +1 -1
  38. package/dist/features/package/index.d.ts +2 -1
  39. package/dist/features/package/index.js +22 -17
  40. package/dist/features/package/index.jsx +22 -17
  41. package/dist/features/panel/index.d.ts +1 -1
  42. package/dist/features/panel/index.js +26 -13
  43. package/dist/features/panel/index.jsx +26 -13
  44. package/dist/features/panel/panel-slice.d.ts +2 -0
  45. package/dist/features/panel/panel-slice.js +3 -0
  46. package/dist/features/panel/select-tool.d.ts +1 -1
  47. package/dist/features/panel/select-tool.js +31 -14
  48. package/dist/features/panel/select-tool.jsx +31 -24
  49. package/dist/features/panel/selected-group.d.ts +1 -1
  50. package/dist/features/panel/square-circle-tool.d.ts +1 -1
  51. package/dist/features/panel/table-seat-circle.d.ts +1 -1
  52. package/dist/features/panel/table-seat-circle.js +2 -2
  53. package/dist/features/panel/table-seat-circle.jsx +6 -14
  54. package/dist/features/panel/table-seat-square.d.ts +1 -1
  55. package/dist/features/panel/table-seat-square.js +8 -2
  56. package/dist/features/panel/table-seat-square.jsx +15 -8
  57. package/dist/features/panel/text-tool.d.ts +1 -1
  58. package/dist/features/panel/upload-tool.d.ts +1 -1
  59. package/dist/features/panel/upload-tool.js +3 -1
  60. package/dist/features/panel/upload-tool.jsx +4 -2
  61. package/dist/features/panel/utils.d.ts +8 -2
  62. package/dist/features/panel/utils.js +60 -23
  63. package/dist/features/side-tool/index.d.ts +1 -1
  64. package/dist/features/side-tool/index.js +9 -3
  65. package/dist/features/side-tool/index.jsx +16 -4
  66. package/dist/features/view-only/index.d.ts +1 -1
  67. package/dist/features/view-only-2/index.d.ts +1 -1
  68. package/dist/features/view-only-2/index.js +6 -4
  69. package/dist/features/view-only-2/index.jsx +5 -3
  70. package/dist/features/view-only-3/index.d.ts +1 -1
  71. package/dist/features/view-only-3/index.js +7 -5
  72. package/dist/features/view-only-3/index.jsx +7 -9
  73. package/dist/provider/redux-provider.d.ts +1 -1
  74. package/dist/provider/store-provider.d.ts +1 -1
  75. package/package.json +1 -1
@@ -1,8 +1,7 @@
1
- import React from "react";
2
1
  interface BoardTemplateProps {
3
2
  onSelectComponent?: (items: any) => void;
4
3
  mappingKey?: string;
5
4
  viewOnly?: boolean;
6
5
  }
7
- declare const BoardTemplate: ({ onSelectComponent, viewOnly }: BoardTemplateProps) => React.JSX.Element;
6
+ declare const BoardTemplate: ({ onSelectComponent, viewOnly }: BoardTemplateProps) => import("react/jsx-runtime").JSX.Element;
8
7
  export default BoardTemplate;
@@ -13,5 +13,5 @@ interface BoardTemplateProps {
13
13
  };
14
14
  disabled?: boolean;
15
15
  }
16
- declare const BoardTemplate: ({ refs, loadingRender, disabled, }: BoardTemplateProps) => React.JSX.Element;
16
+ declare const BoardTemplate: ({ refs, loadingRender, disabled, }: BoardTemplateProps) => import("react/jsx-runtime").JSX.Element;
17
17
  export default BoardTemplate;
@@ -67,6 +67,8 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
67
67
  //polygon
68
68
  const polygonElementRef = useRef([]);
69
69
  const isOnMakePolygonRef = useRef(false);
70
+ //boundingbox
71
+ const isInialBoundingBox = useRef(false);
70
72
  const { components: componentsProps, extraComponents: extraComponentsProps, boundingBox, flagChange, updateBy, isShowTagType, } = useAppSelector((state) => state.board);
71
73
  const { selectionLines } = useAppSelector((state) => state.panel);
72
74
  const [selectedLines, setSelectedLines] = useState(null);
@@ -338,6 +340,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
338
340
  const isInitialCreateElemente = toolElement.includes(activeTool) && !isCreateElementRef.current;
339
341
  const isInitialCreateBoundingBox = activeTool === "bounding-box";
340
342
  const isInitialCreateText = activeTool === "text" && !isCreateElementRef.current;
343
+ console.log({ isInitialCreateText, }, isCreateElementRef.current);
341
344
  if (isInitialCreateElemente) {
342
345
  const tables = createTableGhost({
343
346
  x,
@@ -429,6 +432,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
429
432
  hadSelectionRef.current = true;
430
433
  }
431
434
  if (downOutSelectionBox) {
435
+ console.log("downOutSelectionBox");
432
436
  hadSelectionRef.current = false;
433
437
  onMoveSelectionBoxRef.current = false;
434
438
  handleUnSelectComponent();
@@ -1352,11 +1356,14 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
1352
1356
  if (isInitialCreateBoundingBox) {
1353
1357
  const ghost = svg.querySelector("#ghost-element-create");
1354
1358
  const getBBox = getGlobalBBox(svg, ghost);
1355
- dispatch({
1356
- type: "board/setBoundingBox",
1357
- payload: Object.assign(Object.assign({}, getBBox), { id: `${Date.now()}`, shape: "bounding-box", fill: "transparent" }),
1358
- });
1359
+ if (getBBox.width > 90 || getBBox.height > 90) {
1360
+ dispatch({
1361
+ type: "board/setBoundingBox",
1362
+ payload: Object.assign(Object.assign({}, getBBox), { id: `${Date.now()}`, shape: "bounding-box", fill: "transparent" }),
1363
+ });
1364
+ }
1359
1365
  (_m = (_l = svgRef.current) === null || _l === void 0 ? void 0 : _l.querySelectorAll("#ghost-element-create")) === null || _m === void 0 ? void 0 : _m.forEach((el) => el.remove());
1366
+ isCreateElementRef.current = false;
1360
1367
  }
1361
1368
  if (isInitialCreateText) {
1362
1369
  const ghost = svg.querySelector("#ghost-element-create");
@@ -1553,7 +1560,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
1553
1560
  switch: false,
1554
1561
  drop: false,
1555
1562
  rightClick: false,
1556
- } }), _jsx("div", { className: "flex gap-2 mt-2", children: _jsxs(Radio.Group, { value: isShowTagType, onChange: handleCheckPreview, children: [_jsx(Radio, { value: "default", children: "Default" }), _jsx(Radio, { value: "type-1", children: "Type 1" }), _jsx(Radio, { value: "type-2", children: "Type 2" })] }) })] }), _jsxs("div", { className: "relative w-full h-screen flex-1 overflow-hidden", ref: containerRef, children: [_jsx("div", { className: "absolute bottom-5 left-1/2 transform -translate-x-1/2 z-10", children: _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { icon: _jsx(ZoomIn, {}), onClick: handelZoomIn }), _jsx(Button, { icon: _jsx(ZoomOut, {}), onClick: handleZoomOut })] }) }), _jsx(TransformWrapper, { ref: transformRef,
1563
+ }, defaultBoundingBox: boundingBox }), _jsx("div", { className: "flex gap-2 mt-2", children: _jsxs(Radio.Group, { value: isShowTagType, onChange: handleCheckPreview, children: [_jsx(Radio, { value: "default", children: "Default" }), _jsx(Radio, { value: "type-1", children: "Type 1" }), _jsx(Radio, { value: "type-2", children: "Type 2" })] }) })] }), _jsxs("div", { className: "relative w-full h-screen flex-1 overflow-hidden", ref: containerRef, children: [_jsx("div", { className: "absolute bottom-5 left-1/2 transform -translate-x-1/2 z-10", children: _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { icon: _jsx(ZoomIn, {}), onClick: handelZoomIn }), _jsx(Button, { icon: _jsx(ZoomOut, {}), onClick: handleZoomOut })] }) }), _jsx(TransformWrapper, { ref: transformRef,
1557
1564
  // limitToBounds={true}
1558
1565
  panning: {
1559
1566
  disabled: [
@@ -66,6 +66,8 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
66
66
  //polygon
67
67
  const polygonElementRef = useRef([]);
68
68
  const isOnMakePolygonRef = useRef(false);
69
+ //boundingbox
70
+ const isInialBoundingBox = useRef(false);
69
71
  const { components: componentsProps, extraComponents: extraComponentsProps, boundingBox, flagChange, updateBy, isShowTagType, } = useAppSelector((state) => state.board);
70
72
  const { selectionLines } = useAppSelector((state) => state.panel);
71
73
  const [selectedLines, setSelectedLines] = useState(null);
@@ -337,6 +339,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
337
339
  const isInitialCreateElemente = toolElement.includes(activeTool) && !isCreateElementRef.current;
338
340
  const isInitialCreateBoundingBox = activeTool === "bounding-box";
339
341
  const isInitialCreateText = activeTool === "text" && !isCreateElementRef.current;
342
+ console.log({ isInitialCreateText, }, isCreateElementRef.current);
340
343
  if (isInitialCreateElemente) {
341
344
  const tables = createTableGhost({
342
345
  x,
@@ -428,6 +431,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
428
431
  hadSelectionRef.current = true;
429
432
  }
430
433
  if (downOutSelectionBox) {
434
+ console.log("downOutSelectionBox");
431
435
  hadSelectionRef.current = false;
432
436
  onMoveSelectionBoxRef.current = false;
433
437
  handleUnSelectComponent();
@@ -1351,11 +1355,14 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
1351
1355
  if (isInitialCreateBoundingBox) {
1352
1356
  const ghost = svg.querySelector("#ghost-element-create");
1353
1357
  const getBBox = getGlobalBBox(svg, ghost);
1354
- dispatch({
1355
- type: "board/setBoundingBox",
1356
- payload: Object.assign(Object.assign({}, getBBox), { id: `${Date.now()}`, shape: "bounding-box", fill: "transparent" }),
1357
- });
1358
+ if (getBBox.width > 90 || getBBox.height > 90) {
1359
+ dispatch({
1360
+ type: "board/setBoundingBox",
1361
+ payload: Object.assign(Object.assign({}, getBBox), { id: `${Date.now()}`, shape: "bounding-box", fill: "transparent" }),
1362
+ });
1363
+ }
1358
1364
  (_m = (_l = svgRef.current) === null || _l === void 0 ? void 0 : _l.querySelectorAll("#ghost-element-create")) === null || _m === void 0 ? void 0 : _m.forEach((el) => el.remove());
1365
+ isCreateElementRef.current = false;
1359
1366
  }
1360
1367
  if (isInitialCreateText) {
1361
1368
  const ghost = svg.querySelector("#ghost-element-create");
@@ -1554,7 +1561,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
1554
1561
  switch: false,
1555
1562
  drop: false,
1556
1563
  rightClick: false,
1557
- }}/>
1564
+ }} defaultBoundingBox={boundingBox}/>
1558
1565
  <div className="flex gap-2 mt-2">
1559
1566
  <Radio.Group value={isShowTagType} onChange={handleCheckPreview}>
1560
1567
  <Radio value="default">Default</Radio>
@@ -1,2 +1,2 @@
1
- declare const Navbar: () => import("react").JSX.Element;
1
+ declare const Navbar: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default Navbar;
@@ -43,6 +43,7 @@ export interface TableEditorProps<TMeta = undefined> {
43
43
  element: React.JSX.Element;
44
44
  };
45
45
  disabledView?: boolean;
46
+ defaultSeatCountKey?: string;
46
47
  }
47
- declare const TableEditor: <TMeta>(props: TableEditorProps<TMeta>) => import("react").JSX.Element;
48
+ declare const TableEditor: <TMeta>(props: TableEditorProps<TMeta>) => import("react/jsx-runtime").JSX.Element;
48
49
  export default TableEditor;
@@ -5,7 +5,7 @@ import Board from "../board-v3";
5
5
  import SideTool from "../side-tool";
6
6
  import ControlPanels from "../panel";
7
7
  import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
8
- import { isEqual } from "lodash";
8
+ import { isEqual, omit } from "lodash";
9
9
  import LayerView from "../view-only-3";
10
10
  import { Spin } from "antd";
11
11
  const TableEditor = (props) => {
@@ -48,7 +48,7 @@ const TableEditor = (props) => {
48
48
  if (!findComponent)
49
49
  return undefined;
50
50
  if (findComponent) {
51
- return Object.assign(Object.assign({}, item), { [mappingKey]: Object.assign({}, findComponent) });
51
+ return Object.assign(Object.assign({}, item), { [mappingKey]: Object.assign({}, omit(findComponent, `${props === null || props === void 0 ? void 0 : props.defaultSeatCountKey}`)) });
52
52
  }
53
53
  }
54
54
  else {
@@ -83,10 +83,13 @@ const TableEditor = (props) => {
83
83
  const convertComponentProps = () => {
84
84
  let mappingData = componentProps === null || componentProps === void 0 ? void 0 : componentProps.map((item) => {
85
85
  if (item && mappingKey && (item === null || item === void 0 ? void 0 : item[mappingKey])) {
86
- return Object.assign({}, (typeof (item === null || item === void 0 ? void 0 : item[mappingKey]) === "object" &&
87
- (item === null || item === void 0 ? void 0 : item[mappingKey]) !== null
86
+ const data = typeof (item === null || item === void 0 ? void 0 : item[mappingKey]) === "object" && (item === null || item === void 0 ? void 0 : item[mappingKey]) !== null
88
87
  ? item === null || item === void 0 ? void 0 : item[mappingKey]
89
- : {}));
88
+ : {};
89
+ if (props === null || props === void 0 ? void 0 : props.defaultSeatCountKey) {
90
+ return Object.assign(Object.assign({}, data), { [props === null || props === void 0 ? void 0 : props.defaultSeatCountKey]: item === null || item === void 0 ? void 0 : item[props === null || props === void 0 ? void 0 : props.defaultSeatCountKey] });
91
+ }
92
+ return Object.assign({}, data);
90
93
  }
91
94
  return item;
92
95
  });
@@ -99,15 +102,7 @@ const TableEditor = (props) => {
99
102
  const initialComponent = !isEqual(components, convertComponentProps()) && componentProps;
100
103
  const initialExtraComponent = !isEqual(extraComponents, extraComponentProps) && extraComponentProps;
101
104
  if (initialComponent || initialExtraComponent) {
102
- let mappingData = componentProps === null || componentProps === void 0 ? void 0 : componentProps.map((item) => {
103
- if (item && mappingKey && (item === null || item === void 0 ? void 0 : item[props.mappingKey])) {
104
- return Object.assign({}, (typeof item[props.mappingKey] === "object" &&
105
- item[props.mappingKey] !== null
106
- ? item[props.mappingKey]
107
- : {}));
108
- }
109
- return item;
110
- });
105
+ let mappingData = convertComponentProps();
111
106
  if (mappingKey) {
112
107
  setInitialValue(componentProps);
113
108
  }
@@ -151,9 +146,11 @@ const TableEditor = (props) => {
151
146
  // },
152
147
  // })
153
148
  // }
154
- setTimeout(() => {
155
- dispatch({ type: "panel/setLoading", payload: false });
156
- }, 1000);
149
+ if (loading) {
150
+ setTimeout(() => {
151
+ dispatch({ type: "panel/setLoading", payload: false });
152
+ }, 1000);
153
+ }
157
154
  }, [
158
155
  componentProps,
159
156
  extraComponentProps,
@@ -161,6 +158,14 @@ const TableEditor = (props) => {
161
158
  props === null || props === void 0 ? void 0 : props.defaultBoundingBox,
162
159
  loadingRender === null || loadingRender === void 0 ? void 0 : loadingRender.state,
163
160
  ]);
161
+ useEffect(() => {
162
+ if (props === null || props === void 0 ? void 0 : props.defaultSeatCountKey) {
163
+ dispatch({
164
+ type: "panel/setSeatDefaultKey",
165
+ payload: props === null || props === void 0 ? void 0 : props.defaultSeatCountKey,
166
+ });
167
+ }
168
+ }, [props === null || props === void 0 ? void 0 : props.defaultSeatCountKey, initialValue]);
164
169
  return (_jsx(_Fragment, { children: _jsx("div", { className: "w-full h-screen flex relative", children: viewOnly ? (_jsx("div", { className: "w-full h-full flex relative", children: _jsx(LayerView, { statusKey: "status", loadingRender: props === null || props === void 0 ? void 0 : props.loadingRender, actionPrivileged: {
165
170
  select: false,
166
171
  move: false,
@@ -4,7 +4,7 @@ import Board from "../board-v3";
4
4
  import SideTool from "../side-tool";
5
5
  import ControlPanels from "../panel";
6
6
  import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
7
- import { isEqual } from "lodash";
7
+ import { isEqual, omit } from "lodash";
8
8
  import LayerView from "../view-only-3";
9
9
  import { Spin } from "antd";
10
10
  const TableEditor = (props) => {
@@ -47,7 +47,7 @@ const TableEditor = (props) => {
47
47
  if (!findComponent)
48
48
  return undefined;
49
49
  if (findComponent) {
50
- return Object.assign(Object.assign({}, item), { [mappingKey]: Object.assign({}, findComponent) });
50
+ return Object.assign(Object.assign({}, item), { [mappingKey]: Object.assign({}, omit(findComponent, `${props === null || props === void 0 ? void 0 : props.defaultSeatCountKey}`)) });
51
51
  }
52
52
  }
53
53
  else {
@@ -82,10 +82,13 @@ const TableEditor = (props) => {
82
82
  const convertComponentProps = () => {
83
83
  let mappingData = componentProps === null || componentProps === void 0 ? void 0 : componentProps.map((item) => {
84
84
  if (item && mappingKey && (item === null || item === void 0 ? void 0 : item[mappingKey])) {
85
- return Object.assign({}, (typeof (item === null || item === void 0 ? void 0 : item[mappingKey]) === "object" &&
86
- (item === null || item === void 0 ? void 0 : item[mappingKey]) !== null
85
+ const data = typeof (item === null || item === void 0 ? void 0 : item[mappingKey]) === "object" && (item === null || item === void 0 ? void 0 : item[mappingKey]) !== null
87
86
  ? item === null || item === void 0 ? void 0 : item[mappingKey]
88
- : {}));
87
+ : {};
88
+ if (props === null || props === void 0 ? void 0 : props.defaultSeatCountKey) {
89
+ return Object.assign(Object.assign({}, data), { [props === null || props === void 0 ? void 0 : props.defaultSeatCountKey]: item === null || item === void 0 ? void 0 : item[props === null || props === void 0 ? void 0 : props.defaultSeatCountKey] });
90
+ }
91
+ return Object.assign({}, data);
89
92
  }
90
93
  return item;
91
94
  });
@@ -98,15 +101,7 @@ const TableEditor = (props) => {
98
101
  const initialComponent = !isEqual(components, convertComponentProps()) && componentProps;
99
102
  const initialExtraComponent = !isEqual(extraComponents, extraComponentProps) && extraComponentProps;
100
103
  if (initialComponent || initialExtraComponent) {
101
- let mappingData = componentProps === null || componentProps === void 0 ? void 0 : componentProps.map((item) => {
102
- if (item && mappingKey && (item === null || item === void 0 ? void 0 : item[props.mappingKey])) {
103
- return Object.assign({}, (typeof item[props.mappingKey] === "object" &&
104
- item[props.mappingKey] !== null
105
- ? item[props.mappingKey]
106
- : {}));
107
- }
108
- return item;
109
- });
104
+ let mappingData = convertComponentProps();
110
105
  if (mappingKey) {
111
106
  setInitialValue(componentProps);
112
107
  }
@@ -150,9 +145,11 @@ const TableEditor = (props) => {
150
145
  // },
151
146
  // })
152
147
  // }
153
- setTimeout(() => {
154
- dispatch({ type: "panel/setLoading", payload: false });
155
- }, 1000);
148
+ if (loading) {
149
+ setTimeout(() => {
150
+ dispatch({ type: "panel/setLoading", payload: false });
151
+ }, 1000);
152
+ }
156
153
  }, [
157
154
  componentProps,
158
155
  extraComponentProps,
@@ -160,6 +157,14 @@ const TableEditor = (props) => {
160
157
  props === null || props === void 0 ? void 0 : props.defaultBoundingBox,
161
158
  loadingRender === null || loadingRender === void 0 ? void 0 : loadingRender.state,
162
159
  ]);
160
+ useEffect(() => {
161
+ if (props === null || props === void 0 ? void 0 : props.defaultSeatCountKey) {
162
+ dispatch({
163
+ type: "panel/setSeatDefaultKey",
164
+ payload: props === null || props === void 0 ? void 0 : props.defaultSeatCountKey,
165
+ });
166
+ }
167
+ }, [props === null || props === void 0 ? void 0 : props.defaultSeatCountKey, initialValue]);
163
168
  return (<>
164
169
  <div className="w-full h-screen flex relative">
165
170
  {viewOnly ? (<div className="w-full h-full flex relative">
@@ -2,5 +2,5 @@ interface ControlPanelsProps {
2
2
  action?: (file: File) => Promise<string>;
3
3
  transform?: any;
4
4
  }
5
- declare const ControlPanels: (props: ControlPanelsProps) => import("react").JSX.Element;
5
+ declare const ControlPanels: (props: ControlPanelsProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export default ControlPanels;
@@ -31,6 +31,7 @@ const ControlPanels = (props) => {
31
31
  const theme = useAppSelector((state) => state.theme);
32
32
  const tool = useAppSelector((state) => state.tool);
33
33
  const selectedComponent = useAppSelector((state) => state.panel.selectedComponent);
34
+ const seatKey = useAppSelector((state) => state.panel.seatDefaultKey);
34
35
  const selectedGroup = useAppSelector((state) => state.panel.selectedGroup);
35
36
  const components = useAppSelector((state) => state.board.components);
36
37
  const extraComponents = useAppSelector((state) => state.board.extraComponents);
@@ -44,6 +45,7 @@ const ControlPanels = (props) => {
44
45
  let values = Form.useWatch([], form);
45
46
  useEffect(() => {
46
47
  if (selectedComponent) {
48
+ form.resetFields();
47
49
  const isDifferentId = (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) !== (values === null || values === void 0 ? void 0 : values.id) || !(values === null || values === void 0 ? void 0 : values.id);
48
50
  const isSameIdAndSameDimensions = (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) === (values === null || values === void 0 ? void 0 : values.id) &&
49
51
  (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.height) === (values === null || values === void 0 ? void 0 : values.height) &&
@@ -53,9 +55,10 @@ const ControlPanels = (props) => {
53
55
  if (show && (isDifferentId || isSameIdAndSameDimensions)) {
54
56
  setOpen(true);
55
57
  }
56
- form.setFieldsValue(selectedComponent);
58
+ form.setFieldsValue(Object.assign(Object.assign({}, selectedComponent), { opacity: (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.opacity) * 100, openSpace: (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.openSpace) * 100 }));
57
59
  }
58
60
  else if (selectedGroup) {
61
+ form.resetFields();
59
62
  if (show)
60
63
  setOpen(true);
61
64
  if (!show)
@@ -67,6 +70,11 @@ const ControlPanels = (props) => {
67
70
  return arr.every((item) => item[key] === firstValue);
68
71
  }
69
72
  function getValueIfSame(arr, key) {
73
+ if (key === "opacity") {
74
+ return isSameAllByKey(arr, key)
75
+ ? Number(arr[0][key]) * 100
76
+ : undefined;
77
+ }
70
78
  return isSameAllByKey(arr, key) ? arr[0][key] : undefined;
71
79
  }
72
80
  form.setFieldsValue({
@@ -92,13 +100,17 @@ const ControlPanels = (props) => {
92
100
  if (tool.active === "background" || tool.active === "image-table") {
93
101
  setOpen(true);
94
102
  }
103
+ else {
104
+ setOpen(false);
105
+ }
95
106
  }, [tool, show]);
96
- const createShape = (shape, props = {}) => {
97
- var _a, _b, _c, _d, _e, _f, _g;
107
+ const createShape = (shape, props = {}, selectedComponent) => {
108
+ var _a, _b, _c, _d, _e, _f, _g, _h;
98
109
  const defaults = (_a = SEAT_SHAPES[shape]) !== null && _a !== void 0 ? _a : {};
99
- return Object.assign(Object.assign(Object.assign({}, defaults), props), { shape: (_b = props.shape) !== null && _b !== void 0 ? _b : shape, height: (_c = adjustHeightWidthForSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props)) === null || _c === void 0 ? void 0 : _c.height, width: (_d = adjustHeightWidthForSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props)) === null || _d === void 0 ? void 0 : _d.width, fill: props.fill, seatCount: getSeatCount(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props), seatPositions: getSeatPosition(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props), openSpace: isSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape) ? (_e = props.openSpace) !== null && _e !== void 0 ? _e : 0 : undefined, seatFill: isSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape)
100
- ? props.seatFill
101
- : undefined, text: shape === "text" ? (_f = props.text) !== null && _f !== void 0 ? _f : defaults.text : undefined, fontColor: shape === "text" ? (_g = props.fontColor) !== null && _g !== void 0 ? _g : defaults.fontColor : undefined, radius: props.radius });
110
+ const seatDefault = selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent[seatKey];
111
+ return Object.assign(Object.assign(Object.assign({}, defaults), props), { shape: (_b = props.shape) !== null && _b !== void 0 ? _b : shape, height: (_c = adjustHeightWidthForSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props)) === null || _c === void 0 ? void 0 : _c.height, width: (_d = adjustHeightWidthForSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props)) === null || _d === void 0 ? void 0 : _d.width, fill: props.fill, seatCount: getSeatCount(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props, seatDefault), seatPositions: getSeatPosition(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props, seatDefault), openSpace: isSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape)
112
+ ? (_e = props.openSpace) !== null && _e !== void 0 ? _e : 0
113
+ : undefined, seatFill: isSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape) ? (_f = props.seatFill) !== null && _f !== void 0 ? _f : theme === null || theme === void 0 ? void 0 : theme.primaryColor : undefined, text: shape === "text" ? (_g = props.text) !== null && _g !== void 0 ? _g : defaults.text : undefined, fontColor: shape === "text" ? (_h = props.fontColor) !== null && _h !== void 0 ? _h : defaults.fontColor : undefined, radius: props.radius });
102
114
  };
103
115
  const debouncedSyncComponents = useRef(debounce((data) => {
104
116
  dispatch({ type: "board/setFlagChange", payload: true });
@@ -147,7 +159,7 @@ const ControlPanels = (props) => {
147
159
  dispatch({ type: "board/setUpdateBy", payload: "global" });
148
160
  }, 300));
149
161
  const updateElement = (id, values) => {
150
- var _a, _b, _c, _d, _e, _f, _g;
162
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
151
163
  let findElement = [...components, ...extraComponents].find((item) => item.id === id);
152
164
  const isAdjustSize = ["circle"].includes((findElement === null || findElement === void 0 ? void 0 : findElement.shape) || "");
153
165
  let forceSize = {
@@ -158,8 +170,8 @@ const ControlPanels = (props) => {
158
170
  return;
159
171
  const newElement = Object.assign(Object.assign(Object.assign({}, findElement), values), { x: (_a = values.x) !== null && _a !== void 0 ? _a : findElement.x, y: (_b = values.y) !== null && _b !== void 0 ? _b : findElement.y, width: isAdjustSize ? forceSize.width : (_c = values.width) !== null && _c !== void 0 ? _c : findElement.width, height: isAdjustSize
160
172
  ? forceSize.height
161
- : (_d = values.height) !== null && _d !== void 0 ? _d : findElement.height });
162
- const svg = (_f = (_e = svgRef === null || svgRef === void 0 ? void 0 : svgRef.current) === null || _e === void 0 ? void 0 : _e[1]) !== null && _f !== void 0 ? _f : (_g = svgRef === null || svgRef === void 0 ? void 0 : svgRef.current) === null || _g === void 0 ? void 0 : _g[0];
173
+ : (_d = values.height) !== null && _d !== void 0 ? _d : findElement.height, opacity: ((_e = values === null || values === void 0 ? void 0 : values.opacity) !== null && _e !== void 0 ? _e : 100) / 100, openSpace: ((_f = values === null || values === void 0 ? void 0 : values.openSpace) !== null && _f !== void 0 ? _f : 0) / 100 });
174
+ const svg = (_h = (_g = svgRef === null || svgRef === void 0 ? void 0 : svgRef.current) === null || _g === void 0 ? void 0 : _g[1]) !== null && _h !== void 0 ? _h : (_j = svgRef === null || svgRef === void 0 ? void 0 : svgRef.current) === null || _j === void 0 ? void 0 : _j[0];
163
175
  const { g, element } = getAttributeElement(svg, id);
164
176
  applyResizeToSvgElement(element, g, newElement);
165
177
  const getBBox = getGlobalBBox(svg, g);
@@ -167,15 +179,16 @@ const ControlPanels = (props) => {
167
179
  updateSelectionBox(svg, getBBox);
168
180
  };
169
181
  const handleChangeComponent = (values, allValues) => {
182
+ var _a, _b;
170
183
  const { shape } = allValues, restProps = __rest(allValues, ["shape"]);
171
- const newValues = createShape(shape, restProps);
184
+ const newValues = createShape(shape, restProps, selectedComponent);
172
185
  if (selectedComponent) {
173
186
  updateElement(allValues.id, values);
174
- debouncedSyncComponents.current(Object.assign(Object.assign({}, (selectedComponent || {})), newValues));
187
+ debouncedSyncComponents.current(Object.assign(Object.assign(Object.assign({}, (selectedComponent || {})), newValues), { opacity: ((_a = newValues === null || newValues === void 0 ? void 0 : newValues.opacity) !== null && _a !== void 0 ? _a : 100) / 100, openSpace: ((_b = newValues === null || newValues === void 0 ? void 0 : newValues.openSpace) !== null && _b !== void 0 ? _b : 0) / 100 }));
175
188
  }
176
189
  if ((selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.length) > 0) {
177
- const { width, height, x, y, fill, stroke, opacity, rotation, strokeWidth, radius, shape, seatCount, seatFill, seatPositions, labels } = newValues;
178
- const updatedGroup = selectedGroup.map((comp) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, comp), (width !== undefined ? { width } : {})), (height !== undefined ? { height } : {})), (x !== undefined ? { x } : {})), (y !== undefined ? { y } : {})), (fill !== undefined ? { fill } : {})), (stroke !== undefined ? { stroke } : {})), (opacity !== undefined ? { opacity } : {})), (rotation !== undefined ? { rotation } : {})), (strokeWidth !== undefined ? { strokeWidth } : {})), (radius !== undefined ? { radius } : {})), (shape !== undefined ? { shape } : {})), (seatCount !== undefined ? { seatCount } : {})), (seatFill !== undefined ? { seatFill } : {})), (seatPositions !== undefined ? { seatPositions } : {})), (labels !== undefined ? { labels } : {}))));
190
+ const { width, height, x, y, fill, stroke, opacity, rotation, strokeWidth, radius, shape, seatCount, seatFill, seatPositions, labels, } = newValues;
191
+ const updatedGroup = selectedGroup.map((comp) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, comp), (width !== undefined ? { width } : {})), (height !== undefined ? { height } : {})), (x !== undefined ? { x } : {})), (y !== undefined ? { y } : {})), (fill !== undefined ? { fill } : {})), (stroke !== undefined ? { stroke } : {})), (opacity !== undefined ? { opacity: opacity / 100 } : {})), (rotation !== undefined ? { rotation } : {})), (strokeWidth !== undefined ? { strokeWidth } : {})), (radius !== undefined ? { radius } : {})), (shape !== undefined ? { shape } : {})), (seatCount !== undefined ? { seatCount } : {})), (seatFill !== undefined ? { seatFill } : {})), (seatPositions !== undefined ? { seatPositions } : {})), (labels !== undefined ? { labels } : {}))));
179
192
  let minX = Infinity;
180
193
  let minY = Infinity;
181
194
  let maxX = -Infinity;
@@ -30,6 +30,7 @@ const ControlPanels = (props) => {
30
30
  const theme = useAppSelector((state) => state.theme);
31
31
  const tool = useAppSelector((state) => state.tool);
32
32
  const selectedComponent = useAppSelector((state) => state.panel.selectedComponent);
33
+ const seatKey = useAppSelector((state) => state.panel.seatDefaultKey);
33
34
  const selectedGroup = useAppSelector((state) => state.panel.selectedGroup);
34
35
  const components = useAppSelector((state) => state.board.components);
35
36
  const extraComponents = useAppSelector((state) => state.board.extraComponents);
@@ -43,6 +44,7 @@ const ControlPanels = (props) => {
43
44
  let values = Form.useWatch([], form);
44
45
  useEffect(() => {
45
46
  if (selectedComponent) {
47
+ form.resetFields();
46
48
  const isDifferentId = (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) !== (values === null || values === void 0 ? void 0 : values.id) || !(values === null || values === void 0 ? void 0 : values.id);
47
49
  const isSameIdAndSameDimensions = (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) === (values === null || values === void 0 ? void 0 : values.id) &&
48
50
  (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.height) === (values === null || values === void 0 ? void 0 : values.height) &&
@@ -52,9 +54,10 @@ const ControlPanels = (props) => {
52
54
  if (show && (isDifferentId || isSameIdAndSameDimensions)) {
53
55
  setOpen(true);
54
56
  }
55
- form.setFieldsValue(selectedComponent);
57
+ form.setFieldsValue(Object.assign(Object.assign({}, selectedComponent), { opacity: (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.opacity) * 100, openSpace: (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.openSpace) * 100 }));
56
58
  }
57
59
  else if (selectedGroup) {
60
+ form.resetFields();
58
61
  if (show)
59
62
  setOpen(true);
60
63
  if (!show)
@@ -66,6 +69,11 @@ const ControlPanels = (props) => {
66
69
  return arr.every((item) => item[key] === firstValue);
67
70
  }
68
71
  function getValueIfSame(arr, key) {
72
+ if (key === "opacity") {
73
+ return isSameAllByKey(arr, key)
74
+ ? Number(arr[0][key]) * 100
75
+ : undefined;
76
+ }
69
77
  return isSameAllByKey(arr, key) ? arr[0][key] : undefined;
70
78
  }
71
79
  form.setFieldsValue({
@@ -91,13 +99,17 @@ const ControlPanels = (props) => {
91
99
  if (tool.active === "background" || tool.active === "image-table") {
92
100
  setOpen(true);
93
101
  }
102
+ else {
103
+ setOpen(false);
104
+ }
94
105
  }, [tool, show]);
95
- const createShape = (shape, props = {}) => {
96
- var _a, _b, _c, _d, _e, _f, _g;
106
+ const createShape = (shape, props = {}, selectedComponent) => {
107
+ var _a, _b, _c, _d, _e, _f, _g, _h;
97
108
  const defaults = (_a = SEAT_SHAPES[shape]) !== null && _a !== void 0 ? _a : {};
98
- return Object.assign(Object.assign(Object.assign({}, defaults), props), { shape: (_b = props.shape) !== null && _b !== void 0 ? _b : shape, height: (_c = adjustHeightWidthForSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props)) === null || _c === void 0 ? void 0 : _c.height, width: (_d = adjustHeightWidthForSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props)) === null || _d === void 0 ? void 0 : _d.width, fill: props.fill, seatCount: getSeatCount(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props), seatPositions: getSeatPosition(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props), openSpace: isSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape) ? (_e = props.openSpace) !== null && _e !== void 0 ? _e : 0 : undefined, seatFill: isSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape)
99
- ? props.seatFill
100
- : undefined, text: shape === "text" ? (_f = props.text) !== null && _f !== void 0 ? _f : defaults.text : undefined, fontColor: shape === "text" ? (_g = props.fontColor) !== null && _g !== void 0 ? _g : defaults.fontColor : undefined, radius: props.radius });
109
+ const seatDefault = selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent[seatKey];
110
+ return Object.assign(Object.assign(Object.assign({}, defaults), props), { shape: (_b = props.shape) !== null && _b !== void 0 ? _b : shape, height: (_c = adjustHeightWidthForSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props)) === null || _c === void 0 ? void 0 : _c.height, width: (_d = adjustHeightWidthForSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props)) === null || _d === void 0 ? void 0 : _d.width, fill: props.fill, seatCount: getSeatCount(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props, seatDefault), seatPositions: getSeatPosition(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props, seatDefault), openSpace: isSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape)
111
+ ? (_e = props.openSpace) !== null && _e !== void 0 ? _e : 0
112
+ : undefined, seatFill: isSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape) ? (_f = props.seatFill) !== null && _f !== void 0 ? _f : theme === null || theme === void 0 ? void 0 : theme.primaryColor : undefined, text: shape === "text" ? (_g = props.text) !== null && _g !== void 0 ? _g : defaults.text : undefined, fontColor: shape === "text" ? (_h = props.fontColor) !== null && _h !== void 0 ? _h : defaults.fontColor : undefined, radius: props.radius });
101
113
  };
102
114
  const debouncedSyncComponents = useRef(debounce((data) => {
103
115
  dispatch({ type: "board/setFlagChange", payload: true });
@@ -146,7 +158,7 @@ const ControlPanels = (props) => {
146
158
  dispatch({ type: "board/setUpdateBy", payload: "global" });
147
159
  }, 300));
148
160
  const updateElement = (id, values) => {
149
- var _a, _b, _c, _d, _e, _f, _g;
161
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
150
162
  let findElement = [...components, ...extraComponents].find((item) => item.id === id);
151
163
  const isAdjustSize = ["circle"].includes((findElement === null || findElement === void 0 ? void 0 : findElement.shape) || "");
152
164
  let forceSize = {
@@ -157,8 +169,8 @@ const ControlPanels = (props) => {
157
169
  return;
158
170
  const newElement = Object.assign(Object.assign(Object.assign({}, findElement), values), { x: (_a = values.x) !== null && _a !== void 0 ? _a : findElement.x, y: (_b = values.y) !== null && _b !== void 0 ? _b : findElement.y, width: isAdjustSize ? forceSize.width : (_c = values.width) !== null && _c !== void 0 ? _c : findElement.width, height: isAdjustSize
159
171
  ? forceSize.height
160
- : (_d = values.height) !== null && _d !== void 0 ? _d : findElement.height });
161
- const svg = (_f = (_e = svgRef === null || svgRef === void 0 ? void 0 : svgRef.current) === null || _e === void 0 ? void 0 : _e[1]) !== null && _f !== void 0 ? _f : (_g = svgRef === null || svgRef === void 0 ? void 0 : svgRef.current) === null || _g === void 0 ? void 0 : _g[0];
172
+ : (_d = values.height) !== null && _d !== void 0 ? _d : findElement.height, opacity: ((_e = values === null || values === void 0 ? void 0 : values.opacity) !== null && _e !== void 0 ? _e : 100) / 100, openSpace: ((_f = values === null || values === void 0 ? void 0 : values.openSpace) !== null && _f !== void 0 ? _f : 0) / 100 });
173
+ const svg = (_h = (_g = svgRef === null || svgRef === void 0 ? void 0 : svgRef.current) === null || _g === void 0 ? void 0 : _g[1]) !== null && _h !== void 0 ? _h : (_j = svgRef === null || svgRef === void 0 ? void 0 : svgRef.current) === null || _j === void 0 ? void 0 : _j[0];
162
174
  const { g, element } = getAttributeElement(svg, id);
163
175
  applyResizeToSvgElement(element, g, newElement);
164
176
  const getBBox = getGlobalBBox(svg, g);
@@ -166,15 +178,16 @@ const ControlPanels = (props) => {
166
178
  updateSelectionBox(svg, getBBox);
167
179
  };
168
180
  const handleChangeComponent = (values, allValues) => {
181
+ var _a, _b;
169
182
  const { shape } = allValues, restProps = __rest(allValues, ["shape"]);
170
- const newValues = createShape(shape, restProps);
183
+ const newValues = createShape(shape, restProps, selectedComponent);
171
184
  if (selectedComponent) {
172
185
  updateElement(allValues.id, values);
173
- debouncedSyncComponents.current(Object.assign(Object.assign({}, (selectedComponent || {})), newValues));
186
+ debouncedSyncComponents.current(Object.assign(Object.assign(Object.assign({}, (selectedComponent || {})), newValues), { opacity: ((_a = newValues === null || newValues === void 0 ? void 0 : newValues.opacity) !== null && _a !== void 0 ? _a : 100) / 100, openSpace: ((_b = newValues === null || newValues === void 0 ? void 0 : newValues.openSpace) !== null && _b !== void 0 ? _b : 0) / 100 }));
174
187
  }
175
188
  if ((selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.length) > 0) {
176
- const { width, height, x, y, fill, stroke, opacity, rotation, strokeWidth, radius, shape, seatCount, seatFill, seatPositions, labels } = newValues;
177
- const updatedGroup = selectedGroup.map((comp) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, comp), (width !== undefined ? { width } : {})), (height !== undefined ? { height } : {})), (x !== undefined ? { x } : {})), (y !== undefined ? { y } : {})), (fill !== undefined ? { fill } : {})), (stroke !== undefined ? { stroke } : {})), (opacity !== undefined ? { opacity } : {})), (rotation !== undefined ? { rotation } : {})), (strokeWidth !== undefined ? { strokeWidth } : {})), (radius !== undefined ? { radius } : {})), (shape !== undefined ? { shape } : {})), (seatCount !== undefined ? { seatCount } : {})), (seatFill !== undefined ? { seatFill } : {})), (seatPositions !== undefined ? { seatPositions } : {})), (labels !== undefined ? { labels } : {}))));
189
+ const { width, height, x, y, fill, stroke, opacity, rotation, strokeWidth, radius, shape, seatCount, seatFill, seatPositions, labels, } = newValues;
190
+ const updatedGroup = selectedGroup.map((comp) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, comp), (width !== undefined ? { width } : {})), (height !== undefined ? { height } : {})), (x !== undefined ? { x } : {})), (y !== undefined ? { y } : {})), (fill !== undefined ? { fill } : {})), (stroke !== undefined ? { stroke } : {})), (opacity !== undefined ? { opacity: opacity / 100 } : {})), (rotation !== undefined ? { rotation } : {})), (strokeWidth !== undefined ? { strokeWidth } : {})), (radius !== undefined ? { radius } : {})), (shape !== undefined ? { shape } : {})), (seatCount !== undefined ? { seatCount } : {})), (seatFill !== undefined ? { seatFill } : {})), (seatPositions !== undefined ? { seatPositions } : {})), (labels !== undefined ? { labels } : {}))));
178
191
  let minX = Infinity;
179
192
  let minY = Infinity;
180
193
  let maxX = -Infinity;
@@ -7,8 +7,10 @@ export interface PanelState {
7
7
  selectedGroup: any;
8
8
  selectionLines?: any;
9
9
  loading?: boolean;
10
+ seatDefaultKey?: string;
10
11
  }
11
12
  export declare const panelSlice: import("@reduxjs/toolkit").Slice<PanelState, {
13
+ setSeatDefaultKey: (state: import("immer").WritableDraft<PanelState>, action: PayloadAction<string>) => void;
12
14
  setLoading: (state: import("immer").WritableDraft<PanelState>, action: PayloadAction<boolean>) => void;
13
15
  setSelectedComponent: (state: import("immer").WritableDraft<PanelState>, action: PayloadAction<any>) => void;
14
16
  setUnSelectedComponent: (state: import("immer").WritableDraft<PanelState>) => void;
@@ -12,6 +12,9 @@ export const panelSlice = createSlice({
12
12
  name: "panel",
13
13
  initialState,
14
14
  reducers: {
15
+ setSeatDefaultKey: (state, action) => {
16
+ state.seatDefaultKey = action.payload;
17
+ },
15
18
  setLoading: (state, action) => {
16
19
  state.loading = action.payload;
17
20
  },
@@ -2,5 +2,5 @@ declare const SelectToolForm: ({ title, action, tranform }: {
2
2
  title?: string;
3
3
  action: any;
4
4
  tranform: any;
5
- }) => import("react").JSX.Element;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
6
  export default SelectToolForm;