seat-editor 3.5.4 → 3.5.6
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.
- package/dist/app/graph-view/page.d.ts +1 -1
- package/dist/app/graph-view-new/page.d.ts +1 -1
- package/dist/app/layout.d.ts +1 -1
- package/dist/app/new-board/page.d.ts +1 -1
- package/dist/app/old-board/page.d.ts +1 -2
- package/dist/app/only-view/chair.d.ts +1 -1
- package/dist/app/only-view/chair.js +2 -10
- package/dist/app/only-view/page.d.ts +1 -1
- package/dist/app/only-view/user.d.ts +1 -1
- package/dist/app/only-view/user.js +2 -10
- package/dist/app/page.d.ts +1 -1
- package/dist/app/test/page.d.ts +1 -2
- package/dist/app/v2/page.d.ts +1 -1
- package/dist/components/button-tools/index.d.ts +1 -1
- package/dist/components/form-tools/label.d.ts +1 -1
- package/dist/components/form-tools/shape.d.ts +1 -1
- package/dist/components/input/number-indicator.d.ts +1 -1
- package/dist/components/joystick/index.d.ts +1 -2
- package/dist/components/layer/index.d.ts +1 -1
- package/dist/components/layer-v2/index.d.ts +1 -1
- package/dist/components/layer-v3/index.d.ts +1 -1
- package/dist/components/layer-v4/index.d.ts +1 -1
- package/dist/components/layer-v5/index.d.ts +1 -1
- package/dist/components/lib/index.d.ts +1 -1
- package/dist/components/modal-preview/index.d.ts +1 -1
- package/dist/features/board/index.d.ts +1 -1
- package/dist/features/board-v2/index.d.ts +1 -2
- package/dist/features/board-v3/index.d.ts +1 -1
- package/dist/features/board-v3/index.js +19 -2
- package/dist/features/board-v3/index.jsx +19 -2
- package/dist/features/navbar/index.d.ts +1 -1
- package/dist/features/package/index.d.ts +1 -1
- package/dist/features/panel/index.d.ts +1 -1
- package/dist/features/panel/index.js +10 -49
- package/dist/features/panel/index.jsx +10 -49
- package/dist/features/panel/polygon.d.ts +1 -1
- package/dist/features/panel/select-tool.d.ts +1 -1
- package/dist/features/panel/selected-group.d.ts +1 -1
- package/dist/features/panel/selected-group.js +1 -1
- package/dist/features/panel/selected-group.jsx +1 -1
- package/dist/features/panel/square-circle-tool.d.ts +1 -1
- package/dist/features/panel/table-seat-circle.d.ts +1 -1
- package/dist/features/panel/table-seat-square.d.ts +1 -1
- package/dist/features/panel/text-tool.d.ts +1 -1
- package/dist/features/panel/upload-tool.d.ts +1 -1
- package/dist/features/panel/upload-tool.js +1 -2
- package/dist/features/panel/upload-tool.jsx +1 -2
- package/dist/features/panel/utils.d.ts +16 -1
- package/dist/features/panel/utils.js +51 -4
- package/dist/features/side-tool/index.d.ts +1 -1
- package/dist/features/side-tool/index.js +1 -10
- package/dist/features/side-tool/index.jsx +8 -4
- package/dist/features/view-only/index.d.ts +1 -1
- package/dist/features/view-only-2/index.d.ts +1 -1
- package/dist/features/view-only-3/index.d.ts +1 -1
- package/dist/features/view-only-4/index.d.ts +1 -1
- package/dist/features/view-only-5/index.d.ts +1 -1
- package/dist/features/view-only-6/index.d.ts +1 -1
- package/dist/features/view-only-7/index.d.ts +1 -1
- package/dist/provider/redux-provider.d.ts +1 -1
- package/dist/provider/store-provider.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function DrawIO(): import("react").JSX.Element;
|
|
1
|
+
export default function DrawIO(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function GraphView(): import("react").JSX.Element;
|
|
1
|
+
export default function GraphView(): import("react/jsx-runtime").JSX.Element;
|
package/dist/app/layout.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function NewBoard(): import("react").JSX.Element;
|
|
1
|
+
export default function NewBoard(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function ChairIcon(): import("react").JSX.Element;
|
|
1
|
+
export function ChairIcon(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
export const ChairIcon = () => {
|
|
2
|
-
return (
|
|
3
|
-
<g clip-path="url(#clip0_3019_14165)">
|
|
4
|
-
<path d="M15.9717 7.5339V4.70339C15.9717 3.07627 14.7076 2.5 13.5189 2.5H6.46226C5.27359 2.5 4.00943 3.07627 4.00943 4.70339V7.5339C3.14151 7.73729 2.5 8.4322 2.5 9.27966V13.822C2.5 15.161 3.5 15.6864 4.48113 15.7373V16.8898C4.48113 17.2288 4.78302 17.5 5.16038 17.5H5.85849C6.23585 17.5 6.53774 17.2288 6.53774 16.8898V15.7373H13.4623V16.8898C13.4623 17.2288 13.7642 17.5 14.1415 17.5H14.8396C15.217 17.5 15.5189 17.2288 15.5189 16.8898V15.7373C16.9717 15.6695 17.5 14.7203 17.5 13.822V9.26271C17.4623 8.4322 16.8208 7.72034 15.9717 7.5339ZM4.68868 4.70339C4.68868 3.31356 5.80189 3.09322 6.46226 3.09322H13.5189C14.1792 3.09322 15.2925 3.29661 15.2925 4.68644V7.4661C14.2736 7.55085 13.4623 8.31356 13.4623 9.26271V9.68644H6.51887V9.26271C6.51887 8.31356 5.70755 7.55085 4.68868 7.4661V4.70339ZM13.4434 10.2966V12.3983H6.51887V10.2966H13.4434ZM5.85849 16.8898H5.16038V15.7373H5.85849V16.8898ZM14.8208 16.8898H14.1226V15.7373H14.8208V16.8898ZM16.8208 13.822H16.8019C16.8019 14.4153 16.5566 15.1441 15.3302 15.1441H14.8208H14.1226H5.85849H5.16038H4.65094C3.99057 15.1441 3.17925 14.9237 3.17925 13.822V9.26271C3.17925 8.6017 3.78302 8.05932 4.51887 8.05932C5.25472 8.05932 5.85849 8.6017 5.85849 9.26271V12.7034C5.85849 12.8729 6.00943 13.0085 6.19811 13.0085H13.8019C13.9906 13.0085 14.1415 12.8729 14.1415 12.7034V9.26271C14.1415 8.6017 14.7453 8.05932 15.4811 8.05932C16.217 8.05932 16.8208 8.6017 16.8208 9.26271V13.822Z" fill="#347ADB" stroke="#347ADB" stroke-width="0.8"/>
|
|
5
|
-
</g>
|
|
6
|
-
<defs>
|
|
7
|
-
<clipPath id="clip0_3019_14165">
|
|
8
|
-
<rect width="16.6667" height="16.6667" fill="white" transform="translate(1.66675 1.6665)"/>
|
|
9
|
-
</clipPath>
|
|
10
|
-
</defs>
|
|
11
|
-
</svg>);
|
|
3
|
+
return (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("g", { "clip-path": "url(#clip0_3019_14165)", children: _jsx("path", { d: "M15.9717 7.5339V4.70339C15.9717 3.07627 14.7076 2.5 13.5189 2.5H6.46226C5.27359 2.5 4.00943 3.07627 4.00943 4.70339V7.5339C3.14151 7.73729 2.5 8.4322 2.5 9.27966V13.822C2.5 15.161 3.5 15.6864 4.48113 15.7373V16.8898C4.48113 17.2288 4.78302 17.5 5.16038 17.5H5.85849C6.23585 17.5 6.53774 17.2288 6.53774 16.8898V15.7373H13.4623V16.8898C13.4623 17.2288 13.7642 17.5 14.1415 17.5H14.8396C15.217 17.5 15.5189 17.2288 15.5189 16.8898V15.7373C16.9717 15.6695 17.5 14.7203 17.5 13.822V9.26271C17.4623 8.4322 16.8208 7.72034 15.9717 7.5339ZM4.68868 4.70339C4.68868 3.31356 5.80189 3.09322 6.46226 3.09322H13.5189C14.1792 3.09322 15.2925 3.29661 15.2925 4.68644V7.4661C14.2736 7.55085 13.4623 8.31356 13.4623 9.26271V9.68644H6.51887V9.26271C6.51887 8.31356 5.70755 7.55085 4.68868 7.4661V4.70339ZM13.4434 10.2966V12.3983H6.51887V10.2966H13.4434ZM5.85849 16.8898H5.16038V15.7373H5.85849V16.8898ZM14.8208 16.8898H14.1226V15.7373H14.8208V16.8898ZM16.8208 13.822H16.8019C16.8019 14.4153 16.5566 15.1441 15.3302 15.1441H14.8208H14.1226H5.85849H5.16038H4.65094C3.99057 15.1441 3.17925 14.9237 3.17925 13.822V9.26271C3.17925 8.6017 3.78302 8.05932 4.51887 8.05932C5.25472 8.05932 5.85849 8.6017 5.85849 9.26271V12.7034C5.85849 12.8729 6.00943 13.0085 6.19811 13.0085H13.8019C13.9906 13.0085 14.1415 12.8729 14.1415 12.7034V9.26271C14.1415 8.6017 14.7453 8.05932 15.4811 8.05932C16.217 8.05932 16.8208 8.6017 16.8208 9.26271V13.822Z", fill: "#347ADB", stroke: "#347ADB", "stroke-width": "0.8" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_3019_14165", children: _jsx("rect", { width: "16.6667", height: "16.6667", fill: "white", transform: "translate(1.66675 1.6665)" }) }) })] }));
|
|
12
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function UserIcon(): import("react").JSX.Element;
|
|
1
|
+
export function UserIcon(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
export const UserIcon = () => {
|
|
2
|
-
return (
|
|
3
|
-
<path d="M7.61992 10.1625C9.00754 10.1625 10.1324 9.03757 10.1324 7.64995C10.1324 6.26234 9.00754 5.13745 7.61992 5.13745C6.23231 5.13745 5.10742 6.26234 5.10742 7.64995C5.10742 9.03757 6.23231 10.1625 7.61992 10.1625Z" fill="#5E6278"/>
|
|
4
|
-
<path d="M7.62 14.9999C9.34313 14.9999 10.74 14.1168 10.74 13.0274C10.74 11.9381 9.34313 11.0549 7.62 11.0549C5.89687 11.0549 4.5 11.9381 4.5 13.0274C4.5 14.1168 5.89687 14.9999 7.62 14.9999Z" fill="#5E6278"/>
|
|
5
|
-
<path opacity="0.3" d="M11.595 4.23C12.7631 4.23 13.71 3.28308 13.71 2.115C13.71 0.946918 12.7631 0 11.595 0C10.4269 0 9.47998 0.946918 9.47998 2.115C9.47998 3.28308 10.4269 4.23 11.595 4.23Z" fill="#5E6278"/>
|
|
6
|
-
<path opacity="0.3" d="M3.62257 4.23C4.79065 4.23 5.73757 3.28308 5.73757 2.115C5.73757 0.946918 4.79065 0 3.62257 0C2.45449 0 1.50757 0.946918 1.50757 2.115C1.50757 3.28308 2.45449 4.23 3.62257 4.23Z" fill="#5E6278"/>
|
|
7
|
-
<g opacity="0.3">
|
|
8
|
-
<path d="M11.4749 5.87256C11.2349 5.87256 11.0024 5.87256 10.7699 5.91006C11.1229 6.52313 11.2825 7.22856 11.2276 7.93388C11.1727 8.63919 10.906 9.31147 10.4624 9.86256C10.7984 9.92909 11.1399 9.96424 11.4824 9.96756C13.3874 9.96756 14.9249 9.04506 14.9249 7.92006C14.9249 6.79506 13.3799 5.87256 11.4749 5.87256Z" fill="#5E6278"/>
|
|
9
|
-
<path d="M3.4499 6C3.6899 6 3.9224 6 4.1549 6.0375C3.80187 6.65057 3.64233 7.356 3.6972 8.06132C3.75208 8.76664 4.0188 9.43891 4.4624 9.99C4.12639 10.0565 3.78492 10.0917 3.4424 10.095C1.5374 10.095 -9.77516e-05 9.1725 -9.77516e-05 8.0475C-9.77516e-05 6.9225 1.5449 6 3.4499 6Z" fill="#5E6278"/>
|
|
10
|
-
</g>
|
|
11
|
-
</svg>);
|
|
3
|
+
return (_jsxs("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M7.61992 10.1625C9.00754 10.1625 10.1324 9.03757 10.1324 7.64995C10.1324 6.26234 9.00754 5.13745 7.61992 5.13745C6.23231 5.13745 5.10742 6.26234 5.10742 7.64995C5.10742 9.03757 6.23231 10.1625 7.61992 10.1625Z", fill: "#5E6278" }), _jsx("path", { d: "M7.62 14.9999C9.34313 14.9999 10.74 14.1168 10.74 13.0274C10.74 11.9381 9.34313 11.0549 7.62 11.0549C5.89687 11.0549 4.5 11.9381 4.5 13.0274C4.5 14.1168 5.89687 14.9999 7.62 14.9999Z", fill: "#5E6278" }), _jsx("path", { opacity: "0.3", d: "M11.595 4.23C12.7631 4.23 13.71 3.28308 13.71 2.115C13.71 0.946918 12.7631 0 11.595 0C10.4269 0 9.47998 0.946918 9.47998 2.115C9.47998 3.28308 10.4269 4.23 11.595 4.23Z", fill: "#5E6278" }), _jsx("path", { opacity: "0.3", d: "M3.62257 4.23C4.79065 4.23 5.73757 3.28308 5.73757 2.115C5.73757 0.946918 4.79065 0 3.62257 0C2.45449 0 1.50757 0.946918 1.50757 2.115C1.50757 3.28308 2.45449 4.23 3.62257 4.23Z", fill: "#5E6278" }), _jsxs("g", { opacity: "0.3", children: [_jsx("path", { d: "M11.4749 5.87256C11.2349 5.87256 11.0024 5.87256 10.7699 5.91006C11.1229 6.52313 11.2825 7.22856 11.2276 7.93388C11.1727 8.63919 10.906 9.31147 10.4624 9.86256C10.7984 9.92909 11.1399 9.96424 11.4824 9.96756C13.3874 9.96756 14.9249 9.04506 14.9249 7.92006C14.9249 6.79506 13.3799 5.87256 11.4749 5.87256Z", fill: "#5E6278" }), _jsx("path", { d: "M3.4499 6C3.6899 6 3.9224 6 4.1549 6.0375C3.80187 6.65057 3.64233 7.356 3.6972 8.06132C3.75208 8.76664 4.0188 9.43891 4.4624 9.99C4.12639 10.0565 3.78492 10.0917 3.4424 10.095C1.5374 10.095 -9.77516e-05 9.1725 -9.77516e-05 8.0475C-9.77516e-05 6.9225 1.5449 6 3.4499 6Z", fill: "#5E6278" })] })] }));
|
|
12
4
|
};
|
package/dist/app/page.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const TableEditor: () => import("react").JSX.Element;
|
|
1
|
+
declare const TableEditor: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default TableEditor;
|
package/dist/app/test/page.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function DraggableRect(): React.JSX.Element;
|
|
1
|
+
export default function DraggableRect(): import("react/jsx-runtime").JSX.Element;
|
package/dist/app/v2/page.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const TableEditor: () => import("react").JSX.Element;
|
|
1
|
+
declare const TableEditor: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default TableEditor;
|
|
@@ -7,5 +7,5 @@ interface ButtonToolsProps {
|
|
|
7
7
|
}>;
|
|
8
8
|
popoverProps?: PopoverProps;
|
|
9
9
|
}
|
|
10
|
-
declare const ButtonTools: (props: ButtonToolsProps) => import("react").JSX.Element;
|
|
10
|
+
declare const ButtonTools: (props: ButtonToolsProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export default ButtonTools;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SectionLabel: () => import("react").JSX.Element;
|
|
1
|
+
declare const SectionLabel: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default SectionLabel;
|
|
@@ -3,5 +3,5 @@ interface NumberIndicatorProps {
|
|
|
3
3
|
defaultValue?: number;
|
|
4
4
|
onChange: (value: number) => void;
|
|
5
5
|
}
|
|
6
|
-
declare const NumberIndicator: ({ name, defaultValue, onChange }: NumberIndicatorProps) => import("react").JSX.Element;
|
|
6
|
+
declare const NumberIndicator: ({ name, defaultValue, onChange }: NumberIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default NumberIndicator;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
type JoystickPosition = {
|
|
3
2
|
x: number;
|
|
4
3
|
y: number;
|
|
@@ -8,5 +7,5 @@ type JoystickProps = {
|
|
|
8
7
|
onMove?: (pos: JoystickPosition) => void;
|
|
9
8
|
onEnd?: () => void;
|
|
10
9
|
};
|
|
11
|
-
export declare const Joystick: ({ size, onMove, onEnd, }: JoystickProps) =>
|
|
10
|
+
export declare const Joystick: ({ size, onMove, onEnd, }: JoystickProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export {};
|
|
@@ -15,5 +15,5 @@ interface LayersProps {
|
|
|
15
15
|
onTouchMove?: (e: React.TouchEvent<SVGRectElement | SVGCircleElement | SVGTextElement | SVGImageElement>) => void;
|
|
16
16
|
onTouchEnd?: (e: React.TouchEvent<SVGRectElement | SVGCircleElement | SVGTextElement | SVGImageElement>) => void;
|
|
17
17
|
}
|
|
18
|
-
declare const Layers: ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode, style, onTouchEnd, onTouchMove, onTouchStart }: LayersProps) => import("react").JSX.Element;
|
|
18
|
+
declare const Layers: ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode, style, onTouchEnd, onTouchMove, onTouchStart }: LayersProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export default Layers;
|
|
@@ -15,5 +15,5 @@ interface LayersProps {
|
|
|
15
15
|
onTouchMove?: (e: React.TouchEvent<SVGRectElement | SVGCircleElement | SVGTextElement | SVGImageElement>) => void;
|
|
16
16
|
onTouchEnd?: (e: React.TouchEvent<SVGRectElement | SVGCircleElement | SVGTextElement | SVGImageElement>) => void;
|
|
17
17
|
}
|
|
18
|
-
declare const Layers: ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode, style, onTouchStart }: LayersProps) => import("react").JSX.Element;
|
|
18
|
+
declare const Layers: ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode, style, onTouchStart }: LayersProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export default Layers;
|
|
@@ -9,5 +9,5 @@ interface LayersProps {
|
|
|
9
9
|
activeTool?: string;
|
|
10
10
|
selectionLines?: SelectionLines;
|
|
11
11
|
}
|
|
12
|
-
declare const Layers: ({ components, selectedComponent, activeTool, selectionLines, }: LayersProps) => import("react").JSX.Element;
|
|
12
|
+
declare const Layers: ({ components, selectedComponent, activeTool, selectionLines, }: LayersProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export default Layers;
|
|
@@ -20,5 +20,5 @@ interface LayersProps {
|
|
|
20
20
|
items: string[];
|
|
21
21
|
}[];
|
|
22
22
|
}
|
|
23
|
-
declare const Layers: ({ components, selectedTable, iconTags, eventMatchTable, onHighlightGroup, onForceRestoreGroup, selectedTableColor, privilegedTags, }: LayersProps) => import("react").JSX.Element;
|
|
23
|
+
declare const Layers: ({ components, selectedTable, iconTags, eventMatchTable, onHighlightGroup, onForceRestoreGroup, selectedTableColor, privilegedTags, }: LayersProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
export default Layers;
|
|
@@ -20,5 +20,5 @@ interface LayersProps {
|
|
|
20
20
|
items: string[];
|
|
21
21
|
}[];
|
|
22
22
|
}
|
|
23
|
-
declare const Layers: ({ components, selectedTable, iconTags, eventMatchTable, onHighlightGroup, onForceRestoreGroup, selectedTableColor, privilegedTags, }: LayersProps) => import("react").JSX.Element;
|
|
23
|
+
declare const Layers: ({ components, selectedTable, iconTags, eventMatchTable, onHighlightGroup, onForceRestoreGroup, selectedTableColor, privilegedTags, }: LayersProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
export default Layers;
|
|
@@ -3,6 +3,6 @@ export interface LayerViewProps {
|
|
|
3
3
|
componentProps: any[];
|
|
4
4
|
extraComponentProps: any[];
|
|
5
5
|
}
|
|
6
|
-
declare const TableEditor: ({ componentProps, extraComponentProps, }: LayerViewProps) => import("react").JSX.Element;
|
|
6
|
+
declare const TableEditor: ({ componentProps, extraComponentProps, }: LayerViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default TableEditor;
|
|
8
8
|
export { LayerView };
|
|
@@ -2,5 +2,5 @@ interface BoardTemplateProps {
|
|
|
2
2
|
onSelectComponent?: (items: any) => void;
|
|
3
3
|
mappingKey?: string;
|
|
4
4
|
}
|
|
5
|
-
declare const BoardTemplate: ({ onSelectComponent }: BoardTemplateProps) => import("react").JSX.Element;
|
|
5
|
+
declare const BoardTemplate: ({ onSelectComponent }: BoardTemplateProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default BoardTemplate;
|
|
@@ -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) =>
|
|
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) =>
|
|
16
|
+
declare const BoardTemplate: ({ refs, loadingRender, disabled, }: BoardTemplateProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export default BoardTemplate;
|
|
@@ -1878,6 +1878,15 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
|
1878
1878
|
};
|
|
1879
1879
|
}, []);
|
|
1880
1880
|
const hasSelectionBox = !isEmpty(selectedLines);
|
|
1881
|
+
const [cursor, setCursor] = useState("auto");
|
|
1882
|
+
useEffect(() => {
|
|
1883
|
+
if (activeTool === "grab") {
|
|
1884
|
+
setCursor("grab");
|
|
1885
|
+
}
|
|
1886
|
+
else {
|
|
1887
|
+
setCursor("auto");
|
|
1888
|
+
}
|
|
1889
|
+
}, [activeTool]);
|
|
1881
1890
|
return (_jsxs(_Fragment, { children: [_jsxs(ModalPreview, { children: [_jsx(LayerView, { statusKey: "status", loadingRender: loadingRender, actionPrivileged: {
|
|
1882
1891
|
select: false,
|
|
1883
1892
|
move: false,
|
|
@@ -1922,13 +1931,21 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
|
1922
1931
|
},
|
|
1923
1932
|
// centerZoomedOut={true}
|
|
1924
1933
|
// onTransformed={handleTransformed}
|
|
1925
|
-
minScale: 0.2, maxScale: 2, initialScale: scale, pinch: { step: 1 }, wheel: { disabled: true }, smooth: true,
|
|
1934
|
+
minScale: 0.2, maxScale: 2, initialScale: scale, pinch: { step: 1 }, wheel: { disabled: true }, smooth: true, onPanning: (e) => { }, onPanningStop: (e) => {
|
|
1935
|
+
if (activeTool === "grab") {
|
|
1936
|
+
setCursor("grab");
|
|
1937
|
+
}
|
|
1938
|
+
}, onPanningStart: (e) => {
|
|
1939
|
+
if (activeTool === "grab") {
|
|
1940
|
+
setCursor("grabbing");
|
|
1941
|
+
}
|
|
1942
|
+
}, doubleClick: { step: 1, disabled: activeTool === "select" }, disablePadding: true, centerOnInit: true, children: _jsx(TransformComponent, { wrapperStyle: {
|
|
1926
1943
|
width: "100%",
|
|
1927
1944
|
height: "100%",
|
|
1928
1945
|
}, contentStyle: { width: boardSize.width, height: boardSize.height }, children: _jsxs("svg", { id: "workspace", ref: svgRef, width: boardSize.width, height: boardSize.height, viewBox: `${minCoords.x} ${minCoords.y} ${boardSize.width} ${boardSize.height}`, onPointerDown: handlePointerDown, onPointerMove: handlePointerMove, xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid meet", style: {
|
|
1929
1946
|
background: backgroundColor,
|
|
1930
1947
|
display: "block",
|
|
1931
|
-
cursor
|
|
1948
|
+
cursor,
|
|
1932
1949
|
touchAction: "none",
|
|
1933
1950
|
pointerEvents: "all",
|
|
1934
1951
|
userSelect: "none",
|
|
@@ -1877,6 +1877,15 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
|
1877
1877
|
};
|
|
1878
1878
|
}, []);
|
|
1879
1879
|
const hasSelectionBox = !isEmpty(selectedLines);
|
|
1880
|
+
const [cursor, setCursor] = useState("auto");
|
|
1881
|
+
useEffect(() => {
|
|
1882
|
+
if (activeTool === "grab") {
|
|
1883
|
+
setCursor("grab");
|
|
1884
|
+
}
|
|
1885
|
+
else {
|
|
1886
|
+
setCursor("auto");
|
|
1887
|
+
}
|
|
1888
|
+
}, [activeTool]);
|
|
1880
1889
|
return (<>
|
|
1881
1890
|
<ModalPreview>
|
|
1882
1891
|
<LayerView statusKey="status" loadingRender={loadingRender} actionPrivileged={{
|
|
@@ -1958,7 +1967,15 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
|
1958
1967
|
// centerZoomedOut={true}
|
|
1959
1968
|
// onTransformed={handleTransformed}
|
|
1960
1969
|
minScale={0.2} // sangat kecil = bisa zoom out jauh
|
|
1961
|
-
maxScale={2} initialScale={scale} pinch={{ step: 1 }} wheel={{ disabled: true }} smooth={true}
|
|
1970
|
+
maxScale={2} initialScale={scale} pinch={{ step: 1 }} wheel={{ disabled: true }} smooth={true} onPanning={(e) => { }} onPanningStop={(e) => {
|
|
1971
|
+
if (activeTool === "grab") {
|
|
1972
|
+
setCursor("grab");
|
|
1973
|
+
}
|
|
1974
|
+
}} onPanningStart={(e) => {
|
|
1975
|
+
if (activeTool === "grab") {
|
|
1976
|
+
setCursor("grabbing");
|
|
1977
|
+
}
|
|
1978
|
+
}} doubleClick={{ step: 1, disabled: activeTool === "select" }} disablePadding centerOnInit>
|
|
1962
1979
|
{/* {scale !== 1 && ( */}
|
|
1963
1980
|
{/* <div className="absolute bottom-[60px] left-1/2 transform -translate-x-1/2 z-10"> */}
|
|
1964
1981
|
{/* {renderMiniMap()} */}
|
|
@@ -1971,7 +1988,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
|
1971
1988
|
<svg id="workspace" ref={svgRef} width={boardSize.width} height={boardSize.height} viewBox={`${minCoords.x} ${minCoords.y} ${boardSize.width} ${boardSize.height}`} onPointerDown={handlePointerDown} onPointerMove={handlePointerMove} xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" style={{
|
|
1972
1989
|
background: backgroundColor,
|
|
1973
1990
|
display: "block",
|
|
1974
|
-
cursor
|
|
1991
|
+
cursor,
|
|
1975
1992
|
touchAction: "none",
|
|
1976
1993
|
pointerEvents: "all",
|
|
1977
1994
|
userSelect: "none",
|
|
@@ -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;
|
|
@@ -47,5 +47,5 @@ export interface TableEditorProps<TMeta = undefined> {
|
|
|
47
47
|
defaultSeatCountKey?: string;
|
|
48
48
|
header?: React.ReactNode;
|
|
49
49
|
}
|
|
50
|
-
declare const TableEditor: <TMeta>(props: TableEditorProps<TMeta>) =>
|
|
50
|
+
declare const TableEditor: <TMeta>(props: TableEditorProps<TMeta>) => import("react/jsx-runtime").JSX.Element;
|
|
51
51
|
export default TableEditor;
|
|
@@ -9,6 +9,6 @@ interface FormPlaceholderContextType {
|
|
|
9
9
|
setPlaceholderBulk: (bulk: Record<string, string>) => void;
|
|
10
10
|
resetPlaceholders: () => void;
|
|
11
11
|
}
|
|
12
|
-
declare const ControlPanels: (props: ControlPanelsProps) => import("react").JSX.Element;
|
|
12
|
+
declare const ControlPanels: (props: ControlPanelsProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export default ControlPanels;
|
|
14
14
|
export declare const useFormPlaceholder: () => FormPlaceholderContextType;
|
|
@@ -23,7 +23,7 @@ import clsx from "clsx";
|
|
|
23
23
|
import { getAttributeElement } from "../board-v3/resize-element";
|
|
24
24
|
import { applyResizeToSvgElement, getGlobalBBox, updateSelectionBox, } from "../board-v3/utils";
|
|
25
25
|
import { SEAT_SHAPES } from "../../utils/constant";
|
|
26
|
-
import { adjustHeightWidthForSeatShape, getSeatCount, getSeatPosition, isSeatShape, } from "./utils";
|
|
26
|
+
import { adjustHeightWidthForSeatShape, getSeatCount, getSeatPosition, getValueIfSame, isSeatShape, showAllValueNotSame, } from "./utils";
|
|
27
27
|
import SeatSquare from "./table-seat-square";
|
|
28
28
|
import _ from "lodash";
|
|
29
29
|
const FormPlaceholderContext = createContext(null);
|
|
@@ -39,6 +39,8 @@ const ControlPanels = (props) => {
|
|
|
39
39
|
const extraComponents = useAppSelector((state) => state.board.extraComponents);
|
|
40
40
|
const svgRef = useRef(null);
|
|
41
41
|
const [bufferValueForm, setBufferValueForm] = useState(null);
|
|
42
|
+
const [isUsingAverage, setIsUsingAverage] = useState(false);
|
|
43
|
+
const isProgrammaticChange = useRef(false);
|
|
42
44
|
useEffect(() => {
|
|
43
45
|
svgRef.current = document.querySelectorAll("#workspace");
|
|
44
46
|
}, []);
|
|
@@ -103,50 +105,6 @@ const ControlPanels = (props) => {
|
|
|
103
105
|
setOpen(true);
|
|
104
106
|
if (!show)
|
|
105
107
|
setOpen(false);
|
|
106
|
-
function isSameAllByKey(arr, key) {
|
|
107
|
-
if (!arr || arr.length === 0)
|
|
108
|
-
return false;
|
|
109
|
-
const firstValue = arr[0][key];
|
|
110
|
-
return arr.every((item) => (item === null || item === void 0 ? void 0 : item[key]) === firstValue);
|
|
111
|
-
}
|
|
112
|
-
function getValueIfSame(arr, key) {
|
|
113
|
-
var _a;
|
|
114
|
-
if (key === "opacity") {
|
|
115
|
-
return isSameAllByKey(arr, key)
|
|
116
|
-
? Number(arr[0][key]) * 100
|
|
117
|
-
: undefined;
|
|
118
|
-
}
|
|
119
|
-
if (key === "labels") {
|
|
120
|
-
const test = arr === null || arr === void 0 ? void 0 : arr.every((item) => { var _a; return _.isEqual(item === null || item === void 0 ? void 0 : item[key], (_a = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _a === void 0 ? void 0 : _a[key]); });
|
|
121
|
-
return (arr === null || arr === void 0 ? void 0 : arr.every((item) => { var _a; return _.isEqual(item === null || item === void 0 ? void 0 : item[key], (_a = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _a === void 0 ? void 0 : _a[key]); }))
|
|
122
|
-
? (_a = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _a === void 0 ? void 0 : _a[key]
|
|
123
|
-
: [];
|
|
124
|
-
}
|
|
125
|
-
return isSameAllByKey(arr, key) ? arr[0][key] : undefined;
|
|
126
|
-
}
|
|
127
|
-
function getAllValuesKey(arr, key) {
|
|
128
|
-
return arr
|
|
129
|
-
.map((item) => item === null || item === void 0 ? void 0 : item[key])
|
|
130
|
-
.filter((value) => value !== undefined)
|
|
131
|
-
.sort((a, b) => {
|
|
132
|
-
if (typeof a === "number" && typeof b === "number")
|
|
133
|
-
return a - b;
|
|
134
|
-
return String(a).localeCompare(String(b));
|
|
135
|
-
})
|
|
136
|
-
.filter((value, index, self) => self.indexOf(value) === index);
|
|
137
|
-
}
|
|
138
|
-
function showAllValueNotSame(arr, key) {
|
|
139
|
-
if (key === "opacity") {
|
|
140
|
-
return !isSameAllByKey(arr, key)
|
|
141
|
-
? `${getAllValuesKey(arr, key)
|
|
142
|
-
.map((value) => Number(value) * 100)
|
|
143
|
-
.join(", ")}`
|
|
144
|
-
: `${Number(arr[0][key]) * 100}`;
|
|
145
|
-
}
|
|
146
|
-
return !isSameAllByKey(arr, key)
|
|
147
|
-
? `${getAllValuesKey(arr, key)}`
|
|
148
|
-
: `${arr[0][key]}`;
|
|
149
|
-
}
|
|
150
108
|
const fields = [
|
|
151
109
|
"width",
|
|
152
110
|
"height",
|
|
@@ -184,7 +142,7 @@ const ControlPanels = (props) => {
|
|
|
184
142
|
// build values
|
|
185
143
|
const values = Object.fromEntries(fields.map((key) => [
|
|
186
144
|
key,
|
|
187
|
-
(bufferValueForm === null || bufferValueForm === void 0 ? void 0 : bufferValueForm.key) === key
|
|
145
|
+
((bufferValueForm === null || bufferValueForm === void 0 ? void 0 : bufferValueForm.key) === key) && isProgrammaticChange.current
|
|
188
146
|
? bufferValueForm.value
|
|
189
147
|
: getValueIfSame(selectedGroup, key),
|
|
190
148
|
]));
|
|
@@ -201,11 +159,11 @@ const ControlPanels = (props) => {
|
|
|
201
159
|
setOpen(false);
|
|
202
160
|
}
|
|
203
161
|
}, [selectedComponent, selectedGroup, show, groupBufferSelected, tool]);
|
|
204
|
-
const createShape = (shape, props = {}, selectedComponent) => {
|
|
162
|
+
const createShape = (shape, props = {}, selectedComponent, valuesChanges) => {
|
|
205
163
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
206
164
|
const defaults = (_a = SEAT_SHAPES[shape]) !== null && _a !== void 0 ? _a : {};
|
|
207
165
|
const seatDefault = selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent[seatKey];
|
|
208
|
-
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)
|
|
166
|
+
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, valuesChanges)) === 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, valuesChanges)) === 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)
|
|
209
167
|
? (_e = props.openSpace) !== null && _e !== void 0 ? _e : 0
|
|
210
168
|
: undefined, seatFill: isSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape)
|
|
211
169
|
? (_f = props.seatFill) !== null && _f !== void 0 ? _f : theme === null || theme === void 0 ? void 0 : theme.primaryColor
|
|
@@ -280,12 +238,13 @@ const ControlPanels = (props) => {
|
|
|
280
238
|
const handleChangeComponent = (values, allValues) => {
|
|
281
239
|
var _a, _b, _c;
|
|
282
240
|
const { shape } = allValues, restProps = __rest(allValues, ["shape"]);
|
|
283
|
-
const newValues = createShape(shape, restProps, selectedComponent);
|
|
241
|
+
const newValues = createShape(shape, restProps, selectedComponent, values);
|
|
284
242
|
if (selectedComponent) {
|
|
285
243
|
updateElement(allValues.id, values);
|
|
286
244
|
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 }));
|
|
287
245
|
}
|
|
288
246
|
if ((selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.length) > 0) {
|
|
247
|
+
isProgrammaticChange.current = false;
|
|
289
248
|
const { width, height, x, y, fill, stroke, opacity, rotation, strokeWidth, radius, shape, seatCount, seatFill, seatPositions, labels, openSpace, } = newValues;
|
|
290
249
|
const seatPositionsNew = (_c = Object.values(seatPositions)) === null || _c === void 0 ? void 0 : _c.some((item) => _.isNaN(item));
|
|
291
250
|
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(Object.assign({}, comp), (width !== undefined ? { width } : {})), (height !== undefined ? { height } : {})), (x !== undefined ? { x } : {})), (y !== undefined ? { y } : {})), (fill !== undefined ? { fill } : {})), (stroke !== undefined ? { stroke } : {})), (opacity !== undefined ? { opacity: Number(opacity) / 100 } : {})), (rotation !== undefined ? { rotation } : {})), (strokeWidth !== undefined ? { strokeWidth } : {})), (radius !== undefined ? { radius } : {})), (shape !== undefined ? { shape } : {})), (seatFill !== undefined ? { seatFill } : {})), (labels !== undefined ? { labels } : {})), (seatPositions !== undefined
|
|
@@ -371,10 +330,12 @@ const ControlPanels = (props) => {
|
|
|
371
330
|
var _a, _b, _c;
|
|
372
331
|
e.stopPropagation();
|
|
373
332
|
const name = e.target.name;
|
|
333
|
+
const values = e.target.value;
|
|
374
334
|
const placeholder = (_c = (_b = (_a = placeholders === null || placeholders === void 0 ? void 0 : placeholders[name]) === null || _a === void 0 ? void 0 : _a.split(",")) === null || _b === void 0 ? void 0 : _b.map(Number)) === null || _c === void 0 ? void 0 : _c.filter((item) => !_.isNaN(item));
|
|
375
335
|
const averageValuePlaceHolder = (placeholder === null || placeholder === void 0 ? void 0 : placeholder.reduce((a, b) => a + b, 0)) / (placeholder === null || placeholder === void 0 ? void 0 : placeholder.length);
|
|
376
336
|
const value = Math.round(averageValuePlaceHolder);
|
|
377
337
|
if (placeholder && placeholder.length > 0) {
|
|
338
|
+
isProgrammaticChange.current = true;
|
|
378
339
|
setBufferValueForm({
|
|
379
340
|
key: name,
|
|
380
341
|
value: value,
|
|
@@ -22,7 +22,7 @@ import clsx from "clsx";
|
|
|
22
22
|
import { getAttributeElement } from "../board-v3/resize-element";
|
|
23
23
|
import { applyResizeToSvgElement, getGlobalBBox, updateSelectionBox, } from "../board-v3/utils";
|
|
24
24
|
import { SEAT_SHAPES } from "../../utils/constant";
|
|
25
|
-
import { adjustHeightWidthForSeatShape, getSeatCount, getSeatPosition, isSeatShape, } from "./utils";
|
|
25
|
+
import { adjustHeightWidthForSeatShape, getSeatCount, getSeatPosition, getValueIfSame, isSeatShape, showAllValueNotSame, } from "./utils";
|
|
26
26
|
import SeatSquare from "./table-seat-square";
|
|
27
27
|
import _ from "lodash";
|
|
28
28
|
const FormPlaceholderContext = createContext(null);
|
|
@@ -38,6 +38,8 @@ const ControlPanels = (props) => {
|
|
|
38
38
|
const extraComponents = useAppSelector((state) => state.board.extraComponents);
|
|
39
39
|
const svgRef = useRef(null);
|
|
40
40
|
const [bufferValueForm, setBufferValueForm] = useState(null);
|
|
41
|
+
const [isUsingAverage, setIsUsingAverage] = useState(false);
|
|
42
|
+
const isProgrammaticChange = useRef(false);
|
|
41
43
|
useEffect(() => {
|
|
42
44
|
svgRef.current = document.querySelectorAll("#workspace");
|
|
43
45
|
}, []);
|
|
@@ -102,50 +104,6 @@ const ControlPanels = (props) => {
|
|
|
102
104
|
setOpen(true);
|
|
103
105
|
if (!show)
|
|
104
106
|
setOpen(false);
|
|
105
|
-
function isSameAllByKey(arr, key) {
|
|
106
|
-
if (!arr || arr.length === 0)
|
|
107
|
-
return false;
|
|
108
|
-
const firstValue = arr[0][key];
|
|
109
|
-
return arr.every((item) => (item === null || item === void 0 ? void 0 : item[key]) === firstValue);
|
|
110
|
-
}
|
|
111
|
-
function getValueIfSame(arr, key) {
|
|
112
|
-
var _a;
|
|
113
|
-
if (key === "opacity") {
|
|
114
|
-
return isSameAllByKey(arr, key)
|
|
115
|
-
? Number(arr[0][key]) * 100
|
|
116
|
-
: undefined;
|
|
117
|
-
}
|
|
118
|
-
if (key === "labels") {
|
|
119
|
-
const test = arr === null || arr === void 0 ? void 0 : arr.every((item) => { var _a; return _.isEqual(item === null || item === void 0 ? void 0 : item[key], (_a = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _a === void 0 ? void 0 : _a[key]); });
|
|
120
|
-
return (arr === null || arr === void 0 ? void 0 : arr.every((item) => { var _a; return _.isEqual(item === null || item === void 0 ? void 0 : item[key], (_a = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _a === void 0 ? void 0 : _a[key]); }))
|
|
121
|
-
? (_a = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _a === void 0 ? void 0 : _a[key]
|
|
122
|
-
: [];
|
|
123
|
-
}
|
|
124
|
-
return isSameAllByKey(arr, key) ? arr[0][key] : undefined;
|
|
125
|
-
}
|
|
126
|
-
function getAllValuesKey(arr, key) {
|
|
127
|
-
return arr
|
|
128
|
-
.map((item) => item === null || item === void 0 ? void 0 : item[key])
|
|
129
|
-
.filter((value) => value !== undefined)
|
|
130
|
-
.sort((a, b) => {
|
|
131
|
-
if (typeof a === "number" && typeof b === "number")
|
|
132
|
-
return a - b;
|
|
133
|
-
return String(a).localeCompare(String(b));
|
|
134
|
-
})
|
|
135
|
-
.filter((value, index, self) => self.indexOf(value) === index);
|
|
136
|
-
}
|
|
137
|
-
function showAllValueNotSame(arr, key) {
|
|
138
|
-
if (key === "opacity") {
|
|
139
|
-
return !isSameAllByKey(arr, key)
|
|
140
|
-
? `${getAllValuesKey(arr, key)
|
|
141
|
-
.map((value) => Number(value) * 100)
|
|
142
|
-
.join(", ")}`
|
|
143
|
-
: `${Number(arr[0][key]) * 100}`;
|
|
144
|
-
}
|
|
145
|
-
return !isSameAllByKey(arr, key)
|
|
146
|
-
? `${getAllValuesKey(arr, key)}`
|
|
147
|
-
: `${arr[0][key]}`;
|
|
148
|
-
}
|
|
149
107
|
const fields = [
|
|
150
108
|
"width",
|
|
151
109
|
"height",
|
|
@@ -183,7 +141,7 @@ const ControlPanels = (props) => {
|
|
|
183
141
|
// build values
|
|
184
142
|
const values = Object.fromEntries(fields.map((key) => [
|
|
185
143
|
key,
|
|
186
|
-
(bufferValueForm === null || bufferValueForm === void 0 ? void 0 : bufferValueForm.key) === key
|
|
144
|
+
((bufferValueForm === null || bufferValueForm === void 0 ? void 0 : bufferValueForm.key) === key) && isProgrammaticChange.current
|
|
187
145
|
? bufferValueForm.value
|
|
188
146
|
: getValueIfSame(selectedGroup, key),
|
|
189
147
|
]));
|
|
@@ -200,11 +158,11 @@ const ControlPanels = (props) => {
|
|
|
200
158
|
setOpen(false);
|
|
201
159
|
}
|
|
202
160
|
}, [selectedComponent, selectedGroup, show, groupBufferSelected, tool]);
|
|
203
|
-
const createShape = (shape, props = {}, selectedComponent) => {
|
|
161
|
+
const createShape = (shape, props = {}, selectedComponent, valuesChanges) => {
|
|
204
162
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
205
163
|
const defaults = (_a = SEAT_SHAPES[shape]) !== null && _a !== void 0 ? _a : {};
|
|
206
164
|
const seatDefault = selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent[seatKey];
|
|
207
|
-
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)
|
|
165
|
+
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, valuesChanges)) === 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, valuesChanges)) === 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)
|
|
208
166
|
? (_e = props.openSpace) !== null && _e !== void 0 ? _e : 0
|
|
209
167
|
: undefined, seatFill: isSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape)
|
|
210
168
|
? (_f = props.seatFill) !== null && _f !== void 0 ? _f : theme === null || theme === void 0 ? void 0 : theme.primaryColor
|
|
@@ -279,12 +237,13 @@ const ControlPanels = (props) => {
|
|
|
279
237
|
const handleChangeComponent = (values, allValues) => {
|
|
280
238
|
var _a, _b, _c;
|
|
281
239
|
const { shape } = allValues, restProps = __rest(allValues, ["shape"]);
|
|
282
|
-
const newValues = createShape(shape, restProps, selectedComponent);
|
|
240
|
+
const newValues = createShape(shape, restProps, selectedComponent, values);
|
|
283
241
|
if (selectedComponent) {
|
|
284
242
|
updateElement(allValues.id, values);
|
|
285
243
|
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 }));
|
|
286
244
|
}
|
|
287
245
|
if ((selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.length) > 0) {
|
|
246
|
+
isProgrammaticChange.current = false;
|
|
288
247
|
const { width, height, x, y, fill, stroke, opacity, rotation, strokeWidth, radius, shape, seatCount, seatFill, seatPositions, labels, openSpace, } = newValues;
|
|
289
248
|
const seatPositionsNew = (_c = Object.values(seatPositions)) === null || _c === void 0 ? void 0 : _c.some((item) => _.isNaN(item));
|
|
290
249
|
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(Object.assign({}, comp), (width !== undefined ? { width } : {})), (height !== undefined ? { height } : {})), (x !== undefined ? { x } : {})), (y !== undefined ? { y } : {})), (fill !== undefined ? { fill } : {})), (stroke !== undefined ? { stroke } : {})), (opacity !== undefined ? { opacity: Number(opacity) / 100 } : {})), (rotation !== undefined ? { rotation } : {})), (strokeWidth !== undefined ? { strokeWidth } : {})), (radius !== undefined ? { radius } : {})), (shape !== undefined ? { shape } : {})), (seatFill !== undefined ? { seatFill } : {})), (labels !== undefined ? { labels } : {})), (seatPositions !== undefined
|
|
@@ -373,10 +332,12 @@ const ControlPanels = (props) => {
|
|
|
373
332
|
var _a, _b, _c;
|
|
374
333
|
e.stopPropagation();
|
|
375
334
|
const name = e.target.name;
|
|
335
|
+
const values = e.target.value;
|
|
376
336
|
const placeholder = (_c = (_b = (_a = placeholders === null || placeholders === void 0 ? void 0 : placeholders[name]) === null || _a === void 0 ? void 0 : _a.split(",")) === null || _b === void 0 ? void 0 : _b.map(Number)) === null || _c === void 0 ? void 0 : _c.filter((item) => !_.isNaN(item));
|
|
377
337
|
const averageValuePlaceHolder = (placeholder === null || placeholder === void 0 ? void 0 : placeholder.reduce((a, b) => a + b, 0)) / (placeholder === null || placeholder === void 0 ? void 0 : placeholder.length);
|
|
378
338
|
const value = Math.round(averageValuePlaceHolder);
|
|
379
339
|
if (placeholder && placeholder.length > 0) {
|
|
340
|
+
isProgrammaticChange.current = true;
|
|
380
341
|
setBufferValueForm({
|
|
381
342
|
key: name,
|
|
382
343
|
value: value,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const PolygonTool: () => import("react").JSX.Element;
|
|
1
|
+
declare const PolygonTool: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default PolygonTool;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SelectedGroup: () => import("react").JSX.Element;
|
|
1
|
+
declare const SelectedGroup: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default SelectedGroup;
|
|
@@ -39,7 +39,7 @@ const SelectedGroup = () => {
|
|
|
39
39
|
return (_jsx(Option, { value: item.value, disabled: disabled, children: item.value === "table-seat-rect-circle"
|
|
40
40
|
? `Type 5 (only for 4 ${seatKey})`
|
|
41
41
|
: item.label }, item.value));
|
|
42
|
-
}) }) }) })), _jsxs(Flex, { gap: 2, className: "w-full", vertical: true, children: [!shapeAllIncludePolygon && (_jsxs(_Fragment, { children: [_jsx(Form.Item, { label: "Width", name: "width", className: "w-full", layout: "horizontal", labelCol: { style: { width: 100, textAlign: "left" } }, wrapperCol: { style: { flex: 1 } }, children: _jsx(InputNumber, { suffix: "px", name: "width", placeholder: placeholders["width"], style: { width: "100%" } }) }), _jsx(Form.Item, { label: "Height", name: "height", className: "w-full", layout: "horizontal", labelCol: { style: { width: 100, textAlign: "left" } }, wrapperCol: { style: { flex: 1 } }, children: _jsx(InputNumber, { suffix: "px", name: "height", placeholder: placeholders["height"], style: { width: "100%" } }) })] })), !(shape === null || shape === void 0 ? void 0 : shape.includes("circle")) && !shapeAllIncludePolygon && (_jsx(Form.Item, { label: "Radius", name: "radius", className: "w-full", layout: "horizontal", labelCol: { style: { width: 100, textAlign: "left" } }, wrapperCol: { style: { flex: 1 } }, children: _jsx(InputNumber, { name: "radius", suffix: "px", style: { width: "100%" }, placeholder: placeholders["radius"], parser: (value) => {
|
|
42
|
+
}) }) }) })), _jsxs(Flex, { gap: 2, className: "w-full", vertical: true, children: [!shapeAllIncludePolygon && (_jsxs(_Fragment, { children: [_jsx(Form.Item, { label: "Width", name: "width", className: "w-full", layout: "horizontal", labelCol: { style: { width: 100, textAlign: "left" } }, wrapperCol: { style: { flex: 1 } }, children: _jsx(InputNumber, { suffix: "px", name: "width", changeOnWheel: true, placeholder: placeholders["width"], style: { width: "100%" } }) }), _jsx(Form.Item, { label: "Height", name: "height", className: "w-full", layout: "horizontal", labelCol: { style: { width: 100, textAlign: "left" } }, wrapperCol: { style: { flex: 1 } }, children: _jsx(InputNumber, { suffix: "px", name: "height", placeholder: placeholders["height"], style: { width: "100%" } }) })] })), !(shape === null || shape === void 0 ? void 0 : shape.includes("circle")) && !shapeAllIncludePolygon && (_jsx(Form.Item, { label: "Radius", name: "radius", className: "w-full", layout: "horizontal", labelCol: { style: { width: 100, textAlign: "left" } }, wrapperCol: { style: { flex: 1 } }, children: _jsx(InputNumber, { name: "radius", suffix: "px", style: { width: "100%" }, placeholder: placeholders["radius"], parser: (value) => {
|
|
43
43
|
var _a;
|
|
44
44
|
const onlyNumber = (_a = value === null || value === void 0 ? void 0 : value.replace(/\D/g, "")) !== null && _a !== void 0 ? _a : "";
|
|
45
45
|
return onlyNumber === ""
|
|
@@ -73,7 +73,7 @@ const SelectedGroup = () => {
|
|
|
73
73
|
<Flex gap={2} className="w-full" vertical>
|
|
74
74
|
{!shapeAllIncludePolygon && (<>
|
|
75
75
|
<Form.Item label="Width" name="width" className="w-full" layout="horizontal" labelCol={{ style: { width: 100, textAlign: "left" } }} wrapperCol={{ style: { flex: 1 } }}>
|
|
76
|
-
<InputNumber suffix="px" name="width" placeholder={placeholders["width"]} style={{ width: "100%" }}/>
|
|
76
|
+
<InputNumber suffix="px" name="width" changeOnWheel placeholder={placeholders["width"]} style={{ width: "100%" }}/>
|
|
77
77
|
</Form.Item>
|
|
78
78
|
<Form.Item label="Height" name="height" className="w-full" layout="horizontal" labelCol={{ style: { width: 100, textAlign: "left" } }} wrapperCol={{ style: { flex: 1 } }}>
|
|
79
79
|
<InputNumber suffix="px" name="height" placeholder={placeholders["height"]} style={{ width: "100%" }}/>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SquareToolForm: () => import("react").JSX.Element;
|
|
1
|
+
declare const SquareToolForm: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default SquareToolForm;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SeatCircle: () => import("react").JSX.Element;
|
|
1
|
+
declare const SeatCircle: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default SeatCircle;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SeatSquare: () => import("react").JSX.Element;
|
|
1
|
+
declare const SeatSquare: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default SeatSquare;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const TextTool: () => import("react").JSX.Element;
|
|
1
|
+
declare const TextTool: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default TextTool;
|
|
@@ -6,5 +6,5 @@ interface UploadToolProps {
|
|
|
6
6
|
defaultValue?: PropertiesProps;
|
|
7
7
|
transform?: any;
|
|
8
8
|
}
|
|
9
|
-
declare const UploadTool: ({ name, type, action, defaultValue, transform, }: UploadToolProps) => import("react").JSX.Element;
|
|
9
|
+
declare const UploadTool: ({ name, type, action, defaultValue, transform, }: UploadToolProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default UploadTool;
|
|
@@ -13,7 +13,6 @@ import { useState, useEffect } from "react";
|
|
|
13
13
|
import { Upload, Image, Button, Form, Flex } from "antd";
|
|
14
14
|
import { InboxOutlined, LoadingOutlined } from "@ant-design/icons";
|
|
15
15
|
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
16
|
-
import SectionLabel from "../../components/form-tools/label";
|
|
17
16
|
import SectionShape from "../../components/form-tools/shape";
|
|
18
17
|
const { Dragger } = Upload;
|
|
19
18
|
const UploadTool = ({ name, type, action, defaultValue, transform, }) => {
|
|
@@ -161,6 +160,6 @@ const UploadTool = ({ name, type, action, defaultValue, transform, }) => {
|
|
|
161
160
|
dispatch({ type: "panel/setShow", payload: false });
|
|
162
161
|
dispatch({ type: "tool/setActiveTool", payload: "select" });
|
|
163
162
|
};
|
|
164
|
-
return (_jsxs(Form.Item, { label: "", name: "src", className: "w-full", children: [defaultSrc ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "w-full flex flex-col items-center gap-2 max-h-[200px] overflow-y-auto", children: _jsx(Image, { src: defaultSrc }) }), _jsxs(Flex, { vertical: true, gap: 5, children: [_jsx(Button, { type: "primary", onClick: handleDelete, className: "w-full mt-4", loading: loading, children: "Edit" }), _jsx(Button, { type: "default", onClick: deleteImages, className: "w-full", loading: loading, children: "Delete" })] })] })) : (_jsx(Dragger, Object.assign({ beforeUpload: () => false }, propsUpload, { children: loading ? (_jsx("div", { className: "w-full flex flex-col items-center gap-2 max-h-[200px]", children: _jsx(LoadingOutlined, {}) })) : (_jsxs(_Fragment, { children: [_jsx("p", { className: "ant-upload-drag-icon", children: _jsx(InboxOutlined, {}) }), _jsx("p", { className: "ant-upload-text", children: "Click or drag file to this area to upload" }), _jsx("p", { className: "ant-upload-hint", children: "Support for a single or bulk upload. Strictly prohibited from uploading company data or other banned files." })] })) }))), (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) && (
|
|
163
|
+
return (_jsxs(Form.Item, { label: "", name: "src", className: "w-full", children: [defaultSrc ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "w-full flex flex-col items-center gap-2 max-h-[200px] overflow-y-auto", children: _jsx(Image, { src: defaultSrc }) }), _jsxs(Flex, { vertical: true, gap: 5, children: [_jsx(Button, { type: "primary", onClick: handleDelete, className: "w-full mt-4", loading: loading, children: "Edit" }), _jsx(Button, { type: "default", onClick: deleteImages, className: "w-full", loading: loading, children: "Delete" })] })] })) : (_jsx(Dragger, Object.assign({ beforeUpload: () => false }, propsUpload, { children: loading ? (_jsx("div", { className: "w-full flex flex-col items-center gap-2 max-h-[200px]", children: _jsx(LoadingOutlined, {}) })) : (_jsxs(_Fragment, { children: [_jsx("p", { className: "ant-upload-drag-icon", children: _jsx(InboxOutlined, {}) }), _jsx("p", { className: "ant-upload-text", children: "Click or drag file to this area to upload" }), _jsx("p", { className: "ant-upload-hint", children: "Support for a single or bulk upload. Strictly prohibited from uploading company data or other banned files." })] })) }))), (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) && (_jsx(_Fragment, { children: _jsx(SectionShape, { allowChangeShape: type === "component" }) }))] }));
|
|
165
164
|
};
|
|
166
165
|
export default UploadTool;
|
|
@@ -12,7 +12,6 @@ import { useState, useEffect } from "react";
|
|
|
12
12
|
import { Upload, Image, Button, Form, Flex } from "antd";
|
|
13
13
|
import { InboxOutlined, LoadingOutlined } from "@ant-design/icons";
|
|
14
14
|
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
15
|
-
import SectionLabel from "../../components/form-tools/label";
|
|
16
15
|
import SectionShape from "../../components/form-tools/shape";
|
|
17
16
|
const { Dragger } = Upload;
|
|
18
17
|
const UploadTool = ({ name, type, action, defaultValue, transform, }) => {
|
|
@@ -191,7 +190,7 @@ const UploadTool = ({ name, type, action, defaultValue, transform, }) => {
|
|
|
191
190
|
</Dragger>)}
|
|
192
191
|
{(selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) && (<>
|
|
193
192
|
<SectionShape allowChangeShape={type === "component"}/>
|
|
194
|
-
<SectionLabel />
|
|
193
|
+
{/* <SectionLabel /> */}
|
|
195
194
|
</>)}
|
|
196
195
|
</Form.Item>);
|
|
197
196
|
};
|
|
@@ -8,4 +8,19 @@ export declare const getSeatPosition: (shape: string, props: PropertiesProps, de
|
|
|
8
8
|
bottom: number;
|
|
9
9
|
left: number;
|
|
10
10
|
};
|
|
11
|
-
export declare const adjustHeightWidthForSeatShape: (shape: string, props: any
|
|
11
|
+
export declare const adjustHeightWidthForSeatShape: (shape: string, props: any, valuesChanges: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}) => any;
|
|
14
|
+
type SeatPosition = {
|
|
15
|
+
top: number;
|
|
16
|
+
right: number;
|
|
17
|
+
bottom: number;
|
|
18
|
+
left: number;
|
|
19
|
+
};
|
|
20
|
+
export declare function normalizeSeatPosition(input: SeatPosition): SeatPosition;
|
|
21
|
+
export declare function getTotalSeats(position: SeatPosition): number;
|
|
22
|
+
export declare function isSameAllByKey<T>(arr: T[] | undefined, key: keyof T): boolean;
|
|
23
|
+
export declare function getValueIfSame<T>(arr: T[], key: keyof T): number | any[] | T[keyof T];
|
|
24
|
+
export declare function getAllValuesKey<T>(arr: T[], key: keyof T): T[keyof T][];
|
|
25
|
+
export declare function showAllValueNotSame(arr: any[], key: string): string;
|
|
26
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
1
2
|
import { SEAT_SHAPES } from "../../utils/constant";
|
|
2
3
|
import { MIN_HEIGHT, MIN_WIDTH } from "../board-v3/constant";
|
|
3
4
|
export const isSeatShape = (shape) => SEAT_SHAPES.includes(shape);
|
|
@@ -56,10 +57,13 @@ export const getSeatPosition = (shape, props, defaultValue) => {
|
|
|
56
57
|
}
|
|
57
58
|
return distributeSeats(seatCountDefault);
|
|
58
59
|
};
|
|
59
|
-
export const adjustHeightWidthForSeatShape = (shape, props) => {
|
|
60
|
+
export const adjustHeightWidthForSeatShape = (shape, props, valuesChanges) => {
|
|
60
61
|
if (shape === null || shape === void 0 ? void 0 : shape.includes("circle")) {
|
|
61
62
|
const sizeDefault = Math.min(props.width, props.height);
|
|
62
|
-
|
|
63
|
+
let sizeFinal = sizeDefault < MIN_WIDTH ? MIN_WIDTH : sizeDefault;
|
|
64
|
+
if ((valuesChanges === null || valuesChanges === void 0 ? void 0 : valuesChanges.width) || (valuesChanges === null || valuesChanges === void 0 ? void 0 : valuesChanges.height)) {
|
|
65
|
+
sizeFinal = (valuesChanges === null || valuesChanges === void 0 ? void 0 : valuesChanges.width) || (valuesChanges === null || valuesChanges === void 0 ? void 0 : valuesChanges.height) || sizeDefault;
|
|
66
|
+
}
|
|
63
67
|
return Object.assign(Object.assign({}, props), { height: isNaN(sizeFinal) ? MIN_WIDTH : sizeFinal, width: isNaN(sizeFinal) ? MIN_HEIGHT : sizeFinal });
|
|
64
68
|
}
|
|
65
69
|
return props;
|
|
@@ -82,7 +86,7 @@ function distributeSeats(seatCount) {
|
|
|
82
86
|
}
|
|
83
87
|
return result;
|
|
84
88
|
}
|
|
85
|
-
function normalizeSeatPosition(input) {
|
|
89
|
+
export function normalizeSeatPosition(input) {
|
|
86
90
|
const clamp = (value) => Math.max(0, Math.min(1, value));
|
|
87
91
|
return {
|
|
88
92
|
top: clamp(input.top),
|
|
@@ -91,7 +95,7 @@ function normalizeSeatPosition(input) {
|
|
|
91
95
|
left: clamp(input.left),
|
|
92
96
|
};
|
|
93
97
|
}
|
|
94
|
-
function getTotalSeats(position) {
|
|
98
|
+
export function getTotalSeats(position) {
|
|
95
99
|
const { top, right, bottom, left } = position || {
|
|
96
100
|
top: 0,
|
|
97
101
|
right: 0,
|
|
@@ -100,3 +104,46 @@ function getTotalSeats(position) {
|
|
|
100
104
|
};
|
|
101
105
|
return top + right + bottom + left;
|
|
102
106
|
}
|
|
107
|
+
export function isSameAllByKey(arr, key) {
|
|
108
|
+
if (!arr || arr.length === 0)
|
|
109
|
+
return false;
|
|
110
|
+
const firstValue = arr[0][key];
|
|
111
|
+
return arr.every((item) => (item === null || item === void 0 ? void 0 : item[key]) === firstValue);
|
|
112
|
+
}
|
|
113
|
+
export function getValueIfSame(arr, key) {
|
|
114
|
+
var _a;
|
|
115
|
+
if (key === "opacity") {
|
|
116
|
+
return isSameAllByKey(arr, key)
|
|
117
|
+
? Number(arr[0][key]) * 100
|
|
118
|
+
: undefined;
|
|
119
|
+
}
|
|
120
|
+
if (key === "labels") {
|
|
121
|
+
return (arr === null || arr === void 0 ? void 0 : arr.every((item) => { var _a; return _.isEqual(item === null || item === void 0 ? void 0 : item[key], (_a = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _a === void 0 ? void 0 : _a[key]); }))
|
|
122
|
+
? (_a = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _a === void 0 ? void 0 : _a[key]
|
|
123
|
+
: [];
|
|
124
|
+
}
|
|
125
|
+
return isSameAllByKey(arr, key) ? arr[0][key] : undefined;
|
|
126
|
+
}
|
|
127
|
+
export function getAllValuesKey(arr, key) {
|
|
128
|
+
return arr
|
|
129
|
+
.map((item) => item === null || item === void 0 ? void 0 : item[key])
|
|
130
|
+
.filter((value) => value !== undefined)
|
|
131
|
+
.sort((a, b) => {
|
|
132
|
+
if (typeof a === "number" && typeof b === "number")
|
|
133
|
+
return a - b;
|
|
134
|
+
return String(a).localeCompare(String(b));
|
|
135
|
+
})
|
|
136
|
+
.filter((value, index, self) => self.indexOf(value) === index);
|
|
137
|
+
}
|
|
138
|
+
export function showAllValueNotSame(arr, key) {
|
|
139
|
+
if (key === "opacity") {
|
|
140
|
+
return !isSameAllByKey(arr, key)
|
|
141
|
+
? `${getAllValuesKey(arr, key)
|
|
142
|
+
.map((value) => Number(value) * 100)
|
|
143
|
+
.join(", ")}`
|
|
144
|
+
: `${Number(arr[0][key]) * 100}`;
|
|
145
|
+
}
|
|
146
|
+
return !isSameAllByKey(arr, key)
|
|
147
|
+
? `${getAllValuesKey(arr, key)}`
|
|
148
|
+
: `${arr[0][key]}`;
|
|
149
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Circle, CopyPlus, Eye, EyeOff, Image, Layers2, MousePointer, PaintBucket, Ratio, SquareMousePointer,
|
|
3
|
+
import { Circle, CopyPlus, Eye, EyeOff, Image, Layers2, MousePointer, PaintBucket, Ratio, SquareMousePointer, Type, Upload, Hand, Layers, Grid, Lock, LockOpen, Undo2, Redo2, PenTool, Scan, ScanEye, } from "lucide-react";
|
|
4
4
|
import ButtonTools from "../../components/button-tools";
|
|
5
5
|
import { Divider, ColorPicker, Button, message, Popover, Flex, } from "antd";
|
|
6
6
|
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
@@ -367,15 +367,6 @@ const SideTool = ({ dragOnly, deleteAutorized, }) => {
|
|
|
367
367
|
content: _jsx("div", { children: "Grid Tool" }),
|
|
368
368
|
trigger: "hover",
|
|
369
369
|
placement: "right",
|
|
370
|
-
} }), _jsx(ButtonTools, { buttonProps: {
|
|
371
|
-
onClick: () => handleRemoveComponent(),
|
|
372
|
-
icon: _jsx(Trash, {}),
|
|
373
|
-
type: "text",
|
|
374
|
-
name: "trash",
|
|
375
|
-
}, items: [], popoverProps: {
|
|
376
|
-
content: _jsx("div", { children: "Trash Tool" }),
|
|
377
|
-
trigger: "hover",
|
|
378
|
-
placement: "right",
|
|
379
370
|
} }), _jsx(ButtonTools, { buttonProps: {
|
|
380
371
|
onClick: () => toogleSetLockBackground(),
|
|
381
372
|
icon: lockBackground ? _jsx(Lock, {}) : _jsx(LockOpen, {}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Circle, CopyPlus, Eye, EyeOff, Image, Layers2, MousePointer, PaintBucket, Ratio, SquareMousePointer,
|
|
2
|
+
import { Circle, CopyPlus, Eye, EyeOff, Image, Layers2, MousePointer, PaintBucket, Ratio, SquareMousePointer, Type, Upload, Hand, Layers, Grid, Lock, LockOpen, Undo2, Redo2, PenTool, Scan, ScanEye, } from "lucide-react";
|
|
3
3
|
import ButtonTools from "../../components/button-tools";
|
|
4
4
|
import { Divider, ColorPicker, Button, message, Popover, Flex, } from "antd";
|
|
5
5
|
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
@@ -392,16 +392,20 @@ const SideTool = ({ dragOnly, deleteAutorized, }) => {
|
|
|
392
392
|
trigger: "hover",
|
|
393
393
|
placement: "right",
|
|
394
394
|
}}/>
|
|
395
|
-
<ButtonTools
|
|
395
|
+
{/* <ButtonTools
|
|
396
|
+
buttonProps={{
|
|
396
397
|
onClick: () => handleRemoveComponent(),
|
|
397
398
|
icon: <Trash />,
|
|
398
399
|
type: "text",
|
|
399
400
|
name: "trash",
|
|
400
|
-
|
|
401
|
+
}}
|
|
402
|
+
items={[]}
|
|
403
|
+
popoverProps={{
|
|
401
404
|
content: <div>Trash Tool</div>,
|
|
402
405
|
trigger: "hover",
|
|
403
406
|
placement: "right",
|
|
404
|
-
|
|
407
|
+
}}
|
|
408
|
+
/> */}
|
|
405
409
|
<ButtonTools buttonProps={{
|
|
406
410
|
onClick: () => toogleSetLockBackground(),
|
|
407
411
|
icon: lockBackground ? <Lock /> : <LockOpen />,
|
|
@@ -15,5 +15,5 @@ export interface LayerViewProps {
|
|
|
15
15
|
containerProps?: any;
|
|
16
16
|
svgProps?: any;
|
|
17
17
|
}
|
|
18
|
-
declare const LayerView: (props: LayerViewProps) => import("react").JSX.Element;
|
|
18
|
+
declare const LayerView: (props: LayerViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export default LayerView;
|
|
@@ -91,5 +91,5 @@ export interface LayerViewProps<TMeta = undefined> {
|
|
|
91
91
|
rightClick: boolean;
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) =>
|
|
94
|
+
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) => import("react/jsx-runtime").JSX.Element;
|
|
95
95
|
export default LayerView;
|
|
@@ -93,5 +93,5 @@ export interface LayerViewProps<TMeta = undefined> {
|
|
|
93
93
|
double?: boolean;
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) =>
|
|
96
|
+
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) => import("react/jsx-runtime").JSX.Element;
|
|
97
97
|
export default LayerView;
|
|
@@ -95,5 +95,5 @@ export interface LayerViewProps<TMeta = undefined> {
|
|
|
95
95
|
onEdgesChange?: (edges: EdgeType[], table: PropertiesProps[]) => void;
|
|
96
96
|
keyNode: string;
|
|
97
97
|
}
|
|
98
|
-
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) =>
|
|
98
|
+
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) => import("react/jsx-runtime").JSX.Element;
|
|
99
99
|
export default LayerView;
|
|
@@ -98,5 +98,5 @@ export interface LayerViewProps<TMeta = undefined> {
|
|
|
98
98
|
isSelectNode?: boolean;
|
|
99
99
|
onMakeSelection?: (component: ComponentProps<TMeta>[]) => void;
|
|
100
100
|
}
|
|
101
|
-
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) =>
|
|
101
|
+
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) => import("react/jsx-runtime").JSX.Element;
|
|
102
102
|
export default LayerView;
|
|
@@ -95,5 +95,5 @@ export interface LayerViewProps<TMeta = undefined> {
|
|
|
95
95
|
onEdgesChange?: (edges: EdgeType[], table: PropertiesProps[]) => void;
|
|
96
96
|
keyNode: string;
|
|
97
97
|
}
|
|
98
|
-
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) =>
|
|
98
|
+
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) => import("react/jsx-runtime").JSX.Element;
|
|
99
99
|
export default LayerView;
|
|
@@ -95,5 +95,5 @@ export interface LayerViewProps<TMeta = undefined> {
|
|
|
95
95
|
onEdgesChange?: (edges: EdgeType[], table: PropertiesProps[]) => void;
|
|
96
96
|
keyNode: string;
|
|
97
97
|
}
|
|
98
|
-
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) =>
|
|
98
|
+
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) => import("react/jsx-runtime").JSX.Element;
|
|
99
99
|
export default LayerView;
|