seat-editor 3.5.66 → 3.6.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 (46) hide show
  1. package/dist/app/new-board/page.js +18 -1
  2. package/dist/app/new-board/page.jsx +18 -1
  3. package/dist/components/button-radio/index.d.ts +11 -0
  4. package/dist/components/button-radio/index.js +19 -0
  5. package/dist/components/button-radio/index.jsx +22 -0
  6. package/dist/components/form-tools/label.js +20 -2
  7. package/dist/components/form-tools/label.jsx +30 -2
  8. package/dist/components/layer-v3/index.d.ts +9 -1
  9. package/dist/components/layer-v3/index.js +65 -95
  10. package/dist/components/layer-v3/index.jsx +79 -115
  11. package/dist/components/layer-v4/constant.d.ts +16 -2
  12. package/dist/components/layer-v4/constant.js +57 -12
  13. package/dist/components/layer-v4/index.js +111 -188
  14. package/dist/components/layer-v4/index.jsx +124 -215
  15. package/dist/components/modal-preview/index.d.ts +3 -1
  16. package/dist/components/modal-preview/index.js +12 -2
  17. package/dist/components/modal-preview/index.jsx +13 -3
  18. package/dist/dto/table.d.ts +5 -0
  19. package/dist/features/board-v3/board-slice.d.ts +2 -1
  20. package/dist/features/board-v3/board-slice.js +4 -1
  21. package/dist/features/board-v3/constant.d.ts +5 -1
  22. package/dist/features/board-v3/constant.js +23 -1
  23. package/dist/features/board-v3/index.d.ts +6 -1
  24. package/dist/features/board-v3/index.js +59 -49
  25. package/dist/features/board-v3/index.jsx +105 -68
  26. package/dist/features/board-v3/utils.js +48 -28
  27. package/dist/features/package/index.d.ts +5 -0
  28. package/dist/features/package/index.js +1 -1
  29. package/dist/features/package/index.jsx +2 -2
  30. package/dist/features/panel/index.js +2 -2
  31. package/dist/features/panel/index.jsx +2 -2
  32. package/dist/features/panel/selected-group.js +2 -2
  33. package/dist/features/panel/selected-group.jsx +4 -2
  34. package/dist/features/side-tool/icons.d.ts +1 -0
  35. package/dist/features/side-tool/icons.js +2 -0
  36. package/dist/features/side-tool/icons.jsx +6 -0
  37. package/dist/features/side-tool/index.d.ts +6 -1
  38. package/dist/features/side-tool/index.js +31 -3
  39. package/dist/features/side-tool/index.jsx +32 -16
  40. package/dist/features/side-tool/side-tool-slice.d.ts +2 -0
  41. package/dist/features/side-tool/side-tool-slice.js +8 -1
  42. package/dist/features/view-only-3/index.js +0 -21
  43. package/dist/features/view-only-3/index.jsx +0 -21
  44. package/dist/provider/antd-provider.js +5 -2
  45. package/dist/provider/antd-provider.jsx +5 -2
  46. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { ReactZoomPanPinchRef } from "react-zoom-pan-pinch";
3
+ import { ShowTagType } from "./board-slice";
3
4
  export type RefsType = {
4
5
  svgRef: SVGSVGElement | null;
5
6
  transformRef: ReactZoomPanPinchRef | null;
@@ -12,6 +13,10 @@ interface BoardTemplateProps {
12
13
  element: React.JSX.Element;
13
14
  };
14
15
  disabled?: boolean;
16
+ priviewActive?: {
17
+ type: ShowTagType;
18
+ label: string;
19
+ }[];
15
20
  }
16
- declare const BoardTemplate: ({ refs, loadingRender, disabled, }: BoardTemplateProps) => import("react/jsx-runtime").JSX.Element;
21
+ declare const BoardTemplate: ({ refs, loadingRender, disabled, priviewActive, }: BoardTemplateProps) => import("react/jsx-runtime").JSX.Element;
17
22
  export default BoardTemplate;
@@ -13,11 +13,13 @@ import { Button, Flex, Radio, Slider, Tag, } from "antd";
13
13
  import { getAttributeElement, getAttributeElements } from "./resize-element";
14
14
  import { applyResizeToSvgElement, arrayToSvgPointsAttr, createTableGhost, getGlobalBBox, getRotation, getSvgElementSize, getTranslate, isClosingPolygon, normalizeAngle, pointsStringToArray, resizeBox, resizeSeatCircle, resizeSeatRectCircle, resizeSeatRectSquare, resizeSeatSide, resizeSeatSquare, stabilizeRotation, stabilizeTranslateOnRotate, updateManyComponents, updateSelectionBox, updateSelectionGuides, updateSingleComponent, } from "./utils";
15
15
  import { getOS } from "../../utils/agent";
16
- import { MIN_HEIGHT, MIN_WIDTH, ZOOM_STEP, ZOOM_MAX, ZOOM_MIN, } from "./constant";
16
+ import { MIN_HEIGHT, MIN_WIDTH, ZOOM_STEP, ZOOM_MAX, ZOOM_MIN, FONT_SCALES, } from "./constant";
17
+ import ButtonRadio from "../../components/button-radio";
17
18
  const toolElement = ["square", "circle", "table-seat-circle"];
18
19
  const idSelectionBoxGhost = "selection-box-ghost";
19
20
  const nameShapeSelectionBoxGhost = "selection-box";
20
- const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
21
+ const BoardTemplate = ({ refs, loadingRender, disabled = false, priviewActive = [], }) => {
22
+ var _a;
21
23
  const os = getOS();
22
24
  const dispatch = useAppDispatch();
23
25
  const backgroundColor = useAppSelector((state) => state.board.backgroundColor);
@@ -74,6 +76,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
74
76
  //boundingbox
75
77
  const isInialBoundingBox = useRef(false);
76
78
  const { components: componentsProps, extraComponents: extraComponentsProps, boundingBox, flagChange, updateBy, isShowTagType, } = useAppSelector((state) => state.board);
79
+ console.log("isShowTagType", isShowTagType);
77
80
  const selectedGroup = useAppSelector((state) => state.panel.selectedGroup);
78
81
  const { selectionLines } = useAppSelector((state) => state.panel);
79
82
  const [selectedLines, setSelectedLines] = useState(null);
@@ -1398,7 +1401,14 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
1398
1401
  polygonElementRef.current = [];
1399
1402
  addComponents(Object.assign(Object.assign({}, newPoints), { x: 0, y: 0, width,
1400
1403
  height, labels: [
1401
- { label: "", x: 0, y: 0, fontSize: 12, fontColor: "#000000", rotation: 0 },
1404
+ {
1405
+ label: "",
1406
+ x: 0,
1407
+ y: 0,
1408
+ fontSize: 12,
1409
+ fontColor: "#000000",
1410
+ rotation: 0,
1411
+ },
1402
1412
  ], opacity: 0.5, rotation: 0, strokeWidth: 0 }));
1403
1413
  (_e = svg.querySelector("#selection-box-ghost")) === null || _e === void 0 ? void 0 : _e.remove();
1404
1414
  (_f = svg.querySelector("#polyline-helper")) === null || _f === void 0 ? void 0 : _f.setAttribute("opacity", "0");
@@ -1840,26 +1850,11 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
1840
1850
  //lin helper from start to move
1841
1851
  }
1842
1852
  };
1843
- const handleCheckPreview = (e) => {
1844
- const type = e.target.value;
1845
- if (type === "type-1") {
1846
- dispatch({
1847
- type: "board/setTagType",
1848
- payload: type,
1849
- });
1850
- }
1851
- if (type === "type-2") {
1852
- dispatch({
1853
- type: "board/setTagType",
1854
- payload: type,
1855
- });
1856
- }
1857
- if (type === "default") {
1858
- dispatch({
1859
- type: "board/setTagType",
1860
- payload: type,
1861
- });
1862
- }
1853
+ const handleCheckPreview = (v) => {
1854
+ dispatch({
1855
+ type: "board/setTagType",
1856
+ payload: v,
1857
+ });
1863
1858
  };
1864
1859
  const footerInfoList = useMemo(() => {
1865
1860
  return [
@@ -1953,32 +1948,47 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
1953
1948
  value: 1.5,
1954
1949
  },
1955
1950
  ];
1956
- // const handleClickButtonFontScaling = (value: number, type: string) => {
1957
- // dispatch({
1958
- // type: "board/setScalingFontSize",
1959
- // payload: {
1960
- // value,
1961
- // type,
1962
- // },
1963
- // });
1964
- // };
1965
- // const valuesScalingFontSize = () => {
1966
- // const pickOneSample = componentsState?.[0];
1967
- // if (isShowTagType === "type-1") {
1968
- // console.log({ pickOneSample });
1969
- // return pickOneSample?.fontSizeType1;
1970
- // }
1971
- // if (isShowTagType === "type-2") {
1972
- // return pickOneSample?.fontSizeType2;
1973
- // }
1974
- // };
1975
- return (_jsxs(_Fragment, { children: [_jsxs(ModalPreview, { children: [_jsx(LayerView, { statusKey: "status", loadingRender: loadingRender, actionPrivileged: {
1976
- select: false,
1977
- move: false,
1978
- switch: false,
1979
- drop: false,
1980
- rightClick: false,
1981
- }, defaultBoundingBox: boundingBox }), _jsx("div", { className: "flex gap-2 mt-2", children: _jsxs(Radio.Group, { value: isShowTagType, onChange: handleCheckPreview, children: [_jsx(Radio, { value: "default", children: "Customer View" }), _jsx(Radio, { value: "type-1", children: "Layout View" }), _jsx(Radio, { value: "type-2", children: "Next 3 Reservation" })] }) })] }), _jsxs("div", { className: "relative w-full h-screen flex-1 overflow-hidden mt-[78px]", ref: containerRef, children: [_jsx("div", { style: {
1951
+ const handleClickButtonFontScaling = (value, type) => {
1952
+ dispatch({
1953
+ type: "board/setScalingFontSize",
1954
+ payload: {
1955
+ value,
1956
+ type,
1957
+ },
1958
+ });
1959
+ dispatch({ type: "board/setFlagChange", payload: true });
1960
+ dispatch({ type: "board/setUpdateBy", payload: "global" });
1961
+ };
1962
+ const valuesScalingFontSize = () => {
1963
+ const pickOneSample = componentsState === null || componentsState === void 0 ? void 0 : componentsState[0];
1964
+ if (isShowTagType === "type-1") {
1965
+ return (pickOneSample === null || pickOneSample === void 0 ? void 0 : pickOneSample.fontSizeType1) || 1;
1966
+ }
1967
+ if (isShowTagType === "type-2") {
1968
+ return (pickOneSample === null || pickOneSample === void 0 ? void 0 : pickOneSample.fontSizeType2) || 1;
1969
+ }
1970
+ if (isShowTagType === "type-3") {
1971
+ return (pickOneSample === null || pickOneSample === void 0 ? void 0 : pickOneSample.fontSizeType3) || 1;
1972
+ }
1973
+ return 1;
1974
+ };
1975
+ const { typePreview } = useAppSelector((state) => state.tool);
1976
+ const previewTabValue = typePreview === "setting" ? priviewActive === null || priviewActive === void 0 ? void 0 : priviewActive.filter((item) => item.type !== "default") : priviewActive;
1977
+ return (_jsxs(_Fragment, { children: [_jsx(ModalPreview, { modalProps: {
1978
+ footer: (typePreview === "setting" && isShowTagType !== "default") && (_jsx(_Fragment, { children: _jsxs("div", { className: "flex gap-2 p-[20px]", children: [_jsx("span", { className: "font-bold text-[14px]", children: "Select Font Size:" }), _jsx(Radio.Group, { value: valuesScalingFontSize(), onChange: (e) => {
1979
+ handleClickButtonFontScaling(e.target.value, isShowTagType);
1980
+ }, children: FONT_SCALES === null || FONT_SCALES === void 0 ? void 0 : FONT_SCALES.map((item) => (_jsx(Radio, { value: item.value, children: item.label }, item.value))) })] }) })),
1981
+ title: (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex flex-col gap-[20px] p-[20px]", children: _jsx("h1", { className: "text-[22px] font-semibold leading-[22px]", children: typePreview === "setting" ? "Font Size Setting" : "Preview Board" }) }), _jsx("div", { className: "w-full h-[1px] bg-[#E6E6E6]" }), _jsx("div", { className: "p-[10px]", children: _jsx(ButtonRadio, { onChange: (val) => handleCheckPreview(val), options: previewTabValue === null || previewTabValue === void 0 ? void 0 : previewTabValue.map((item) => ({
1982
+ label: item.label,
1983
+ value: item.type,
1984
+ })), value: (_a = previewTabValue === null || previewTabValue === void 0 ? void 0 : previewTabValue[0]) === null || _a === void 0 ? void 0 : _a.type }) })] }))
1985
+ }, children: _jsx(LayerView, { statusKey: "status", loadingRender: loadingRender, actionPrivileged: {
1986
+ select: false,
1987
+ move: false,
1988
+ switch: false,
1989
+ drop: false,
1990
+ rightClick: false,
1991
+ }, defaultBoundingBox: boundingBox }) }), _jsxs("div", { className: "relative w-full h-screen flex-1 overflow-hidden mt-[78px]", ref: containerRef, children: [_jsx("div", { style: {
1982
1992
  position: "absolute",
1983
1993
  bottom: "118px",
1984
1994
  left: "50%",
@@ -12,11 +12,13 @@ import { Button, Flex, Radio, Slider, Tag, } from "antd";
12
12
  import { getAttributeElement, getAttributeElements } from "./resize-element";
13
13
  import { applyResizeToSvgElement, arrayToSvgPointsAttr, createTableGhost, getGlobalBBox, getRotation, getSvgElementSize, getTranslate, isClosingPolygon, normalizeAngle, pointsStringToArray, resizeBox, resizeSeatCircle, resizeSeatRectCircle, resizeSeatRectSquare, resizeSeatSide, resizeSeatSquare, stabilizeRotation, stabilizeTranslateOnRotate, updateManyComponents, updateSelectionBox, updateSelectionGuides, updateSingleComponent, } from "./utils";
14
14
  import { getOS } from "../../utils/agent";
15
- import { MIN_HEIGHT, MIN_WIDTH, ZOOM_STEP, ZOOM_MAX, ZOOM_MIN, } from "./constant";
15
+ import { MIN_HEIGHT, MIN_WIDTH, ZOOM_STEP, ZOOM_MAX, ZOOM_MIN, FONT_SCALES, } from "./constant";
16
+ import ButtonRadio from "../../components/button-radio";
16
17
  const toolElement = ["square", "circle", "table-seat-circle"];
17
18
  const idSelectionBoxGhost = "selection-box-ghost";
18
19
  const nameShapeSelectionBoxGhost = "selection-box";
19
- const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
20
+ const BoardTemplate = ({ refs, loadingRender, disabled = false, priviewActive = [], }) => {
21
+ var _a;
20
22
  const os = getOS();
21
23
  const dispatch = useAppDispatch();
22
24
  const backgroundColor = useAppSelector((state) => state.board.backgroundColor);
@@ -73,6 +75,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
73
75
  //boundingbox
74
76
  const isInialBoundingBox = useRef(false);
75
77
  const { components: componentsProps, extraComponents: extraComponentsProps, boundingBox, flagChange, updateBy, isShowTagType, } = useAppSelector((state) => state.board);
78
+ console.log("isShowTagType", isShowTagType);
76
79
  const selectedGroup = useAppSelector((state) => state.panel.selectedGroup);
77
80
  const { selectionLines } = useAppSelector((state) => state.panel);
78
81
  const [selectedLines, setSelectedLines] = useState(null);
@@ -1397,7 +1400,14 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
1397
1400
  polygonElementRef.current = [];
1398
1401
  addComponents(Object.assign(Object.assign({}, newPoints), { x: 0, y: 0, width,
1399
1402
  height, labels: [
1400
- { label: "", x: 0, y: 0, fontSize: 12, fontColor: "#000000", rotation: 0 },
1403
+ {
1404
+ label: "",
1405
+ x: 0,
1406
+ y: 0,
1407
+ fontSize: 12,
1408
+ fontColor: "#000000",
1409
+ rotation: 0,
1410
+ },
1401
1411
  ], opacity: 0.5, rotation: 0, strokeWidth: 0 }));
1402
1412
  (_e = svg.querySelector("#selection-box-ghost")) === null || _e === void 0 ? void 0 : _e.remove();
1403
1413
  (_f = svg.querySelector("#polyline-helper")) === null || _f === void 0 ? void 0 : _f.setAttribute("opacity", "0");
@@ -1839,26 +1849,11 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
1839
1849
  //lin helper from start to move
1840
1850
  }
1841
1851
  };
1842
- const handleCheckPreview = (e) => {
1843
- const type = e.target.value;
1844
- if (type === "type-1") {
1845
- dispatch({
1846
- type: "board/setTagType",
1847
- payload: type,
1848
- });
1849
- }
1850
- if (type === "type-2") {
1851
- dispatch({
1852
- type: "board/setTagType",
1853
- payload: type,
1854
- });
1855
- }
1856
- if (type === "default") {
1857
- dispatch({
1858
- type: "board/setTagType",
1859
- payload: type,
1860
- });
1861
- }
1852
+ const handleCheckPreview = (v) => {
1853
+ dispatch({
1854
+ type: "board/setTagType",
1855
+ payload: v,
1856
+ });
1862
1857
  };
1863
1858
  const footerInfoList = useMemo(() => {
1864
1859
  return [
@@ -1952,28 +1947,94 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
1952
1947
  value: 1.5,
1953
1948
  },
1954
1949
  ];
1955
- // const handleClickButtonFontScaling = (value: number, type: string) => {
1956
- // dispatch({
1957
- // type: "board/setScalingFontSize",
1958
- // payload: {
1959
- // value,
1960
- // type,
1961
- // },
1962
- // });
1963
- // };
1964
- // const valuesScalingFontSize = () => {
1965
- // const pickOneSample = componentsState?.[0];
1966
- // if (isShowTagType === "type-1") {
1967
- // console.log({ pickOneSample });
1968
- // return pickOneSample?.fontSizeType1;
1969
- // }
1970
- // if (isShowTagType === "type-2") {
1971
- // return pickOneSample?.fontSizeType2;
1972
- // }
1973
- // };
1950
+ const handleClickButtonFontScaling = (value, type) => {
1951
+ dispatch({
1952
+ type: "board/setScalingFontSize",
1953
+ payload: {
1954
+ value,
1955
+ type,
1956
+ },
1957
+ });
1958
+ dispatch({ type: "board/setFlagChange", payload: true });
1959
+ dispatch({ type: "board/setUpdateBy", payload: "global" });
1960
+ };
1961
+ const valuesScalingFontSize = () => {
1962
+ const pickOneSample = componentsState === null || componentsState === void 0 ? void 0 : componentsState[0];
1963
+ if (isShowTagType === "type-1") {
1964
+ return (pickOneSample === null || pickOneSample === void 0 ? void 0 : pickOneSample.fontSizeType1) || 1;
1965
+ }
1966
+ if (isShowTagType === "type-2") {
1967
+ return (pickOneSample === null || pickOneSample === void 0 ? void 0 : pickOneSample.fontSizeType2) || 1;
1968
+ }
1969
+ if (isShowTagType === "type-3") {
1970
+ return (pickOneSample === null || pickOneSample === void 0 ? void 0 : pickOneSample.fontSizeType3) || 1;
1971
+ }
1972
+ return 1;
1973
+ };
1974
+ const { typePreview } = useAppSelector((state) => state.tool);
1975
+ const previewTabValue = typePreview === "setting" ? priviewActive === null || priviewActive === void 0 ? void 0 : priviewActive.filter((item) => item.type !== "default") : priviewActive;
1974
1976
  return (<>
1975
- <ModalPreview>
1976
-
1977
+ <ModalPreview modalProps={{
1978
+ footer: (typePreview === "setting" && isShowTagType !== "default") && (<>
1979
+ <div className="flex gap-2 p-[20px]">
1980
+ <span className="font-bold text-[14px]">Select Font Size:</span>
1981
+
1982
+ <Radio.Group value={valuesScalingFontSize()} onChange={(e) => {
1983
+ handleClickButtonFontScaling(e.target.value, isShowTagType);
1984
+ }}>
1985
+ {FONT_SCALES === null || FONT_SCALES === void 0 ? void 0 : FONT_SCALES.map((item) => (<Radio key={item.value} value={item.value}>
1986
+ {item.label}
1987
+ </Radio>))}
1988
+ </Radio.Group>
1989
+ </div>
1990
+
1991
+ {/* <div className="w-full h-[1px] bg-[#E6E6E6]" /> */}
1992
+ {/* <div className="flex justify-between p-[20px]">
1993
+ <Button
1994
+ htmlType="button"
1995
+ style={{
1996
+ padding: "12px 23px",
1997
+ color: "black",
1998
+ border: "1px solid #E1E3EA",
1999
+ background: "white",
2000
+ fontSize: "13px",
2001
+ lineHeight: "14px",
2002
+ fontWeight: 600,
2003
+ height: 38,
2004
+ }}
2005
+ >
2006
+ Cancel
2007
+ </Button>
2008
+ <Button
2009
+ htmlType="button"
2010
+ style={{
2011
+ background: "#181E49",
2012
+ color: "white",
2013
+ padding: "12px 23px",
2014
+ fontSize: "13px",
2015
+ lineHeight: "14px",
2016
+ fontWeight: 600,
2017
+ height: 38,
2018
+ }}
2019
+ >
2020
+ Save
2021
+ </Button>
2022
+ </div> */}
2023
+ </>),
2024
+ title: (<>
2025
+ <div className="flex flex-col gap-[20px] p-[20px]">
2026
+ <h1 className="text-[22px] font-semibold leading-[22px]">{typePreview === "setting" ? "Font Size Setting" : "Preview Board"}</h1>
2027
+ </div>
2028
+ <div className="w-full h-[1px] bg-[#E6E6E6]"/>
2029
+ <div className="p-[10px]">
2030
+ <ButtonRadio onChange={(val) => handleCheckPreview(val)} options={previewTabValue === null || previewTabValue === void 0 ? void 0 : previewTabValue.map((item) => ({
2031
+ label: item.label,
2032
+ value: item.type,
2033
+ }))} value={(_a = previewTabValue === null || previewTabValue === void 0 ? void 0 : previewTabValue[0]) === null || _a === void 0 ? void 0 : _a.type}/>
2034
+
2035
+ </div>
2036
+ </>)
2037
+ }}>
1977
2038
  <LayerView statusKey="status" loadingRender={loadingRender} actionPrivileged={{
1978
2039
  select: false,
1979
2040
  move: false,
@@ -1981,30 +2042,6 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
1981
2042
  drop: false,
1982
2043
  rightClick: false,
1983
2044
  }} defaultBoundingBox={boundingBox}/>
1984
- {/* {isShowTagType !== "default" && (
1985
- <div className="flex gap-2 mt-2">
1986
- {scalingFontSize?.map((item) => (
1987
- <Button
1988
- type="default"
1989
- htmlType="button"
1990
- onClick={() =>
1991
- handleClickButtonFontScaling(item.value, isShowTagType)
1992
- }
1993
- >
1994
- {item.label}
1995
- </Button>
1996
- ))}
1997
- <span>{valuesScalingFontSize()}</span>
1998
- <InputNumber prefix="x" value={valuesScalingFontSize()} />
1999
- </div>
2000
- )} */}
2001
- <div className="flex gap-2 mt-2">
2002
- <Radio.Group value={isShowTagType} onChange={handleCheckPreview}>
2003
- <Radio value="default">Customer View</Radio>
2004
- <Radio value="type-1">Layout View</Radio>
2005
- <Radio value="type-2">Next 3 Reservation</Radio>
2006
- </Radio.Group>
2007
- </div>
2008
2045
  </ModalPreview>
2009
2046
  <div className="relative w-full h-screen flex-1 overflow-hidden mt-[78px]" ref={containerRef}>
2010
2047
  <div style={{
@@ -226,7 +226,7 @@ export const resizeSeatSquare = ({ seatsPositions, r = 10, openSpace, newElement
226
226
  id: "left",
227
227
  }));
228
228
  const bottomXs = distributeWithSpacing({
229
- start: 0,
229
+ start: newElement.x,
230
230
  length: newElement.width,
231
231
  count: bottomCount,
232
232
  radius: r,
@@ -305,7 +305,7 @@ export const resizeSeatSide = ({ seatsPositions, r = 10, openSpace, newElement,
305
305
  let left = [];
306
306
  let bottom = [];
307
307
  let right = [];
308
- const seatRaidus = Math.max(newElement.width, newElement.height) * 0.15;
308
+ const seatRadius = Math.max(newElement.width, newElement.height) * 0.15;
309
309
  const topCount = seatsPositions.top;
310
310
  const rightCount = seatsPositions.right;
311
311
  const bottomCount = seatsPositions.bottom;
@@ -332,77 +332,77 @@ export const resizeSeatSide = ({ seatsPositions, r = 10, openSpace, newElement,
332
332
  }
333
333
  }
334
334
  const topXs = distributeWithSpacing({
335
- start: newElement.x,
335
+ start: 0,
336
336
  length: newElement.width,
337
337
  count: topCount,
338
- radius: seatRaidus,
338
+ radius: seatRadius,
339
339
  spacing: spacingWidth,
340
340
  });
341
341
  const topSeats = topXs.map((cx) => ({
342
342
  cx,
343
- cy: newElement.y - seatRaidus,
343
+ cy: seatRadius,
344
344
  id: "top",
345
345
  d: arcByDirection({
346
346
  cx,
347
- cy: newElement.y - seatRaidus * 0.1,
348
- r: seatRaidus,
347
+ cy: seatRadius * 0.1,
348
+ r: seatRadius,
349
349
  direction: "top",
350
350
  fraction: 0.4,
351
351
  }),
352
352
  }));
353
353
  const leftYs = distributeWithSpacing({
354
- start: newElement.y,
354
+ start: 0,
355
355
  length: newElement.height,
356
356
  count: leftCount,
357
- radius: seatRaidus,
357
+ radius: seatRadius,
358
358
  spacing: spacingHeight,
359
359
  });
360
360
  const leftSeats = leftYs.map((cy) => ({
361
- cx: newElement.x - seatRaidus * 0.1,
361
+ cx: seatRadius * 0.1,
362
362
  cy,
363
363
  id: "left",
364
364
  d: arcByDirection({
365
- cx: newElement.x - seatRaidus * 0.1,
365
+ cx: seatRadius * 0.1,
366
366
  cy,
367
- r: seatRaidus,
367
+ r: seatRadius,
368
368
  direction: "left",
369
369
  fraction: 0.4,
370
370
  }),
371
371
  }));
372
372
  const bottomXs = distributeWithSpacing({
373
- start: newElement.x,
373
+ start: 0,
374
374
  length: newElement.width,
375
375
  count: bottomCount,
376
- radius: seatRaidus,
376
+ radius: seatRadius,
377
377
  spacing: spacingWidth,
378
378
  });
379
379
  const bottomSeats = bottomXs.map((cx) => ({
380
380
  cx,
381
- cy: newElement.y + newElement.height + seatRaidus * 0.1,
381
+ cy: newElement.height + seatRadius * 0.1,
382
382
  id: "bottom",
383
383
  d: arcByDirection({
384
384
  cx,
385
- cy: newElement.y + newElement.height + seatRaidus * 0.1,
386
- r: seatRaidus,
385
+ cy: newElement.height + seatRadius * 0.1,
386
+ r: seatRadius,
387
387
  direction: "bottom",
388
388
  fraction: 0.4,
389
389
  }),
390
390
  }));
391
391
  const rightYs = distributeWithSpacing({
392
- start: newElement.y,
392
+ start: 0,
393
393
  length: newElement.height,
394
394
  count: rightCount,
395
- radius: seatRaidus,
395
+ radius: seatRadius,
396
396
  spacing: spacingHeight,
397
397
  });
398
398
  const rightSeats = rightYs.map((cy) => ({
399
- cx: newElement.x + newElement.width + seatRaidus * 0.1,
399
+ cx: newElement.width + seatRadius * 0.1,
400
400
  cy,
401
401
  id: "right",
402
402
  d: arcByDirection({
403
- cx: newElement.x + newElement.width + seatRaidus * 0.1,
403
+ cx: newElement.width + seatRadius * 0.1,
404
404
  cy,
405
- r: seatRaidus,
405
+ r: seatRadius,
406
406
  direction: "right",
407
407
  fraction: 0.4,
408
408
  }),
@@ -423,7 +423,10 @@ export const resizeSeatSide = ({ seatsPositions, r = 10, openSpace, newElement,
423
423
  var _a;
424
424
  seat.setAttribute("d", (_a = rightSeats[i]) === null || _a === void 0 ? void 0 : _a.d);
425
425
  });
426
- seatGroup === null || seatGroup === void 0 ? void 0 : seatGroup.setAttribute("transform", `translate(${-newElement.x}, ${-newElement.y})`);
426
+ // seatGroup?.setAttribute(
427
+ // "transform",
428
+ // `translate(${-newElement.x}, ${-newElement.y})`
429
+ // );
427
430
  };
428
431
  export const resizeSeatRectCircle = ({ seatsPositions, r = 10, openSpace, newElement, seats, seatGroup, }) => {
429
432
  let top = [];
@@ -1029,15 +1032,32 @@ const updateSvgAttrs = (el, attrs) => {
1029
1032
  }
1030
1033
  };
1031
1034
  export function applyResizeToSvgElement(element, group, resize, text, textRaw) {
1032
- var _a, _b, _c, _d;
1035
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1036
+ const horizontalAlign = (_c = (_b = (_a = resize === null || resize === void 0 ? void 0 : resize.labels) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.horizontalAlign) !== null && _c !== void 0 ? _c : "middle";
1037
+ const verticalAlign = (_f = (_e = (_d = resize === null || resize === void 0 ? void 0 : resize.labels) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.verticalAlign) !== null && _f !== void 0 ? _f : "middle";
1038
+ const PADDING = 0;
1039
+ const getX = (labelX = 0, horizontalAlign = "middle") => {
1040
+ if (horizontalAlign === "start")
1041
+ return PADDING + labelX;
1042
+ if (horizontalAlign === "end")
1043
+ return resize.width - PADDING + labelX;
1044
+ return resize.width / 2 + labelX;
1045
+ };
1046
+ const getY = (labelY = 0, verticalAlign = "middle") => {
1047
+ if (verticalAlign === "hanging")
1048
+ return PADDING + labelY;
1049
+ if (verticalAlign === "auto")
1050
+ return resize.height - PADDING + labelY;
1051
+ return resize.height / 2 + labelY;
1052
+ };
1033
1053
  const tagName = element.tagName.toLowerCase();
1034
1054
  switch (tagName) {
1035
1055
  case "rect":
1036
1056
  case "image": {
1037
1057
  const width = resize.width < MIN_WIDTH ? MIN_WIDTH : Math.round(resize.width);
1038
1058
  const height = resize.height < MIN_HEIGHT ? MIN_HEIGHT : Math.round(resize.height);
1039
- const rotation = (_a = resize.rotation) !== null && _a !== void 0 ? _a : 0;
1040
- const labelsDefault = (_b = resize === null || resize === void 0 ? void 0 : resize.labels) !== null && _b !== void 0 ? _b : [];
1059
+ const rotation = (_g = resize.rotation) !== null && _g !== void 0 ? _g : 0;
1060
+ const labelsDefault = (_h = resize === null || resize === void 0 ? void 0 : resize.labels) !== null && _h !== void 0 ? _h : [];
1041
1061
  updateSvgAttrs(element, {
1042
1062
  width,
1043
1063
  height,
@@ -1051,8 +1071,8 @@ export function applyResizeToSvgElement(element, group, resize, text, textRaw) {
1051
1071
  textRaw === null || textRaw === void 0 ? void 0 : textRaw.setAttribute("y", String(height / 2));
1052
1072
  const origintext = text === null || text === void 0 ? void 0 : text.querySelector("text");
1053
1073
  if (origintext) {
1054
- origintext.setAttribute("x", String((width / 2) + ((_c = labelsDefault === null || labelsDefault === void 0 ? void 0 : labelsDefault[0]) === null || _c === void 0 ? void 0 : _c.x)));
1055
- origintext.setAttribute("y", String((height / 2) + ((_d = labelsDefault === null || labelsDefault === void 0 ? void 0 : labelsDefault[0]) === null || _d === void 0 ? void 0 : _d.y)));
1074
+ origintext.setAttribute("x", String(getX((_j = labelsDefault === null || labelsDefault === void 0 ? void 0 : labelsDefault[0]) === null || _j === void 0 ? void 0 : _j.x, horizontalAlign)));
1075
+ origintext.setAttribute("y", String(getY((_k = labelsDefault === null || labelsDefault === void 0 ? void 0 : labelsDefault[0]) === null || _k === void 0 ? void 0 : _k.y, verticalAlign)));
1056
1076
  }
1057
1077
  break;
1058
1078
  }
@@ -3,6 +3,7 @@ import { RefsType } from "../board-v3";
3
3
  import { OnCurrentStateChange } from "../view-only-3";
4
4
  import { PropertiesProps } from "../../dto/table";
5
5
  import { ComponentProps } from "../view-only-3/index";
6
+ import { ShowTagType } from "../board-v3/board-slice";
6
7
  export interface TableEditorProps<TMeta = undefined> {
7
8
  componentProps: ComponentProps<TMeta>[];
8
9
  extraComponentProps: PropertiesProps[];
@@ -48,6 +49,10 @@ export interface TableEditorProps<TMeta = undefined> {
48
49
  key: string;
49
50
  value: number;
50
51
  };
52
+ priviewActive: {
53
+ type: ShowTagType;
54
+ label: string;
55
+ }[];
51
56
  }
52
57
  declare const TableEditor: <TMeta>(props: TableEditorProps<TMeta>) => import("react/jsx-runtime").JSX.Element;
53
58
  export default TableEditor;
@@ -237,6 +237,6 @@ const TableEditor = (props) => {
237
237
  switch: false,
238
238
  drop: false,
239
239
  rightClick: false,
240
- } }, `${viewOnly}`) })) : (_jsxs("div", { className: "w-full h-full flex relative", children: [loading && !isPreview && (_jsx("div", { className: "absolute z-10 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-opacity-50 bg-white w-full h-full flex items-center justify-center", children: (loadingRender === null || loadingRender === void 0 ? void 0 : loadingRender.element) || _jsx(Spin, {}) })), _jsx("div", { className: "absolute top-0 left-0 w-full bg-white py-[20px] z-[51] border-b border-gray-200", children: props.header ? (props.header) : (_jsx("div", { className: "text-xl font-bold h-[38px] leading-[38px] flex ", children: "Logo Navbar" })) }), _jsx(SideTool, { dragOnly: dragOnly, deleteAutorized: deleteAutorized }), _jsx(Board, { refs: refsBoard, loadingRender: props === null || props === void 0 ? void 0 : props.loadingRender, disabled: props === null || props === void 0 ? void 0 : props.disabledView }, `${viewOnly}`), _jsx(ControlPanels, { action: props.action, transform: (_a = refsBoard === null || refsBoard === void 0 ? void 0 : refsBoard.current) === null || _a === void 0 ? void 0 : _a.transformRef })] }, `${viewOnly}`)) }) }));
240
+ } }, `${viewOnly}`) })) : (_jsxs("div", { className: "w-full h-full flex relative", children: [loading && !isPreview && (_jsx("div", { className: "absolute z-10 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-opacity-50 bg-white w-full h-full flex items-center justify-center", children: (loadingRender === null || loadingRender === void 0 ? void 0 : loadingRender.element) || _jsx(Spin, {}) })), _jsx("div", { className: "absolute top-0 left-0 w-full bg-white py-[20px] z-[51] border-b border-gray-200", children: props.header ? (props.header) : (_jsx("div", { className: "text-xl font-bold h-[38px] leading-[38px] flex ", children: "Logo Navbar" })) }), _jsx(SideTool, { dragOnly: dragOnly, deleteAutorized: deleteAutorized, priviewActive: props === null || props === void 0 ? void 0 : props.priviewActive }), _jsx(Board, { refs: refsBoard, loadingRender: props === null || props === void 0 ? void 0 : props.loadingRender, disabled: props === null || props === void 0 ? void 0 : props.disabledView, priviewActive: props === null || props === void 0 ? void 0 : props.priviewActive }, `${viewOnly}`), _jsx(ControlPanels, { action: props.action, transform: (_a = refsBoard === null || refsBoard === void 0 ? void 0 : refsBoard.current) === null || _a === void 0 ? void 0 : _a.transformRef })] }, `${viewOnly}`)) }) }));
241
241
  };
242
242
  export default TableEditor;
@@ -249,8 +249,8 @@ const TableEditor = (props) => {
249
249
  Logo Navbar
250
250
  </div>)}
251
251
  </div>
252
- <SideTool dragOnly={dragOnly} deleteAutorized={deleteAutorized}/>
253
- <Board key={`${viewOnly}`} refs={refsBoard} loadingRender={props === null || props === void 0 ? void 0 : props.loadingRender} disabled={props === null || props === void 0 ? void 0 : props.disabledView}/>
252
+ <SideTool dragOnly={dragOnly} deleteAutorized={deleteAutorized} priviewActive={props === null || props === void 0 ? void 0 : props.priviewActive}/>
253
+ <Board key={`${viewOnly}`} refs={refsBoard} loadingRender={props === null || props === void 0 ? void 0 : props.loadingRender} disabled={props === null || props === void 0 ? void 0 : props.disabledView} priviewActive={props === null || props === void 0 ? void 0 : props.priviewActive}/>
254
254
  <ControlPanels action={props.action} transform={(_a = refsBoard === null || refsBoard === void 0 ? void 0 : refsBoard.current) === null || _a === void 0 ? void 0 : _a.transformRef}/>
255
255
  </div>)}
256
256
  </div>
@@ -343,12 +343,12 @@ const ControlPanels = (props) => {
343
343
  unsetPlaceholder,
344
344
  setPlaceholderBulk,
345
345
  resetPlaceholders,
346
- }, children: _jsx("div", { className: clsx("w-[300px] h-full absolute top-0 z-50 transition-all duration-300 overflow-y-scroll mt-[78px]", open ? "right-0" : "right-[-1000px]"), onTransitionEnd: () => {
346
+ }, children: _jsx("div", { className: clsx("w-[300px] h-full absolute top-0 z-50 transition-all duration-300 mt-[78px]", open ? "right-0" : "right-[-1000px]"), onTransitionEnd: () => {
347
347
  if (open && !hasFocusedRef.current) {
348
348
  form.focusField("text");
349
349
  hasFocusedRef.current = true;
350
350
  }
351
- }, children: _jsx("div", { className: "bg-white h-full max-h-screen w-full p-2 overflow-y-auto border-l border-gray-300", children: _jsxs(Form, { layout: "vertical", form: form, name: "table", colon: false, onValuesChange: handleChangeComponent, onFocus: (e) => {
351
+ }, children: _jsx("div", { className: "bg-white w-full p-2 border-l border-gray-300 overflow-y-auto", style: { height: "calc(100vh - 78px)" }, children: _jsxs(Form, { layout: "vertical", form: form, name: "table", colon: false, onValuesChange: handleChangeComponent, onFocus: (e) => {
352
352
  var _a, _b, _c;
353
353
  e.stopPropagation();
354
354
  const name = e.target.name;
@@ -343,13 +343,13 @@ const ControlPanels = (props) => {
343
343
  setPlaceholderBulk,
344
344
  resetPlaceholders,
345
345
  }}>
346
- <div className={clsx("w-[300px] h-full absolute top-0 z-50 transition-all duration-300 overflow-y-scroll mt-[78px]", open ? "right-0" : "right-[-1000px]")} onTransitionEnd={() => {
346
+ <div className={clsx("w-[300px] h-full absolute top-0 z-50 transition-all duration-300 mt-[78px]", open ? "right-0" : "right-[-1000px]")} onTransitionEnd={() => {
347
347
  if (open && !hasFocusedRef.current) {
348
348
  form.focusField("text");
349
349
  hasFocusedRef.current = true;
350
350
  }
351
351
  }}>
352
- <div className="bg-white h-full max-h-screen w-full p-2 overflow-y-auto border-l border-gray-300">
352
+ <div className="bg-white w-full p-2 border-l border-gray-300 overflow-y-auto" style={{ height: "calc(100vh - 78px)" }}>
353
353
  <Form layout="vertical" form={form} name="table" colon={false} onValuesChange={handleChangeComponent} onFocus={(e) => {
354
354
  var _a, _b, _c;
355
355
  e.stopPropagation();