seat-editor 3.5.66 → 3.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) 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 +22 -0
  5. package/dist/components/button-radio/index.jsx +25 -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/icons.d.ts +1 -0
  24. package/dist/features/board-v3/icons.js +3 -0
  25. package/dist/features/board-v3/icons.jsx +7 -0
  26. package/dist/features/board-v3/index.d.ts +6 -1
  27. package/dist/features/board-v3/index.js +63 -49
  28. package/dist/features/board-v3/index.jsx +116 -68
  29. package/dist/features/board-v3/utils.js +48 -28
  30. package/dist/features/package/index.d.ts +5 -0
  31. package/dist/features/package/index.js +1 -1
  32. package/dist/features/package/index.jsx +2 -2
  33. package/dist/features/panel/index.js +2 -2
  34. package/dist/features/panel/index.jsx +2 -2
  35. package/dist/features/panel/selected-group.js +2 -2
  36. package/dist/features/panel/selected-group.jsx +4 -2
  37. package/dist/features/side-tool/icons.d.ts +1 -0
  38. package/dist/features/side-tool/icons.js +2 -0
  39. package/dist/features/side-tool/icons.jsx +6 -0
  40. package/dist/features/side-tool/index.d.ts +6 -1
  41. package/dist/features/side-tool/index.js +31 -3
  42. package/dist/features/side-tool/index.jsx +32 -16
  43. package/dist/features/side-tool/side-tool-slice.d.ts +2 -0
  44. package/dist/features/side-tool/side-tool-slice.js +8 -1
  45. package/dist/features/view-only-3/index.js +0 -21
  46. package/dist/features/view-only-3/index.jsx +0 -21
  47. package/dist/provider/antd-provider.js +5 -2
  48. package/dist/provider/antd-provider.jsx +5 -2
  49. package/package.json +1 -1
@@ -6,6 +6,7 @@ import { arcByDirection, distributeWithSpacing, getBoundingBoxFromPoints, } from
6
6
  import { PRIVILEGED_TAGS, tagsDummy } from "./constant";
7
7
  import { useAppSelector } from "../../hooks/use-redux";
8
8
  import { RsvpIcons } from "../../features/board-v3/icons";
9
+ import { LabelItem } from "../layer-v3";
9
10
  const toKebabCase = (str) => str.replace(/[A-Z]/g, (m) => "-" + m.toLowerCase());
10
11
  const iconNames = [
11
12
  "upcoming",
@@ -35,126 +36,110 @@ const getIconFromId = (data) => {
35
36
  };
36
37
  const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighlightGroup, onForceRestoreGroup, selectedTableColor, privilegedTags = [], }) => {
37
38
  const { isShowTagType } = useAppSelector((state) => state.board);
38
- const showLabels = !["type-1", "type-2"].includes(isShowTagType) && !iconTags;
39
+ const showLabels = !["type-1", "type-2", "type-3"].includes(isShowTagType) && !iconTags;
39
40
  const renderShape = (item) => {
40
41
  var _a, _b, _c, _d, _e, _f, _g;
41
- const { id, x, y, width, height, fill, opacity, rotate = 0, rotation, shape, text, stroke, strokeWidth, labels, fontSize, fontColor, seatFill, src, tags, gapTags, label, points, seatPositions, radius, } = item;
42
+ const { id, x, y, width, height, fill, opacity, rotate = 0, rotation, shape, text, stroke, strokeWidth, labels, fontSize, fontColor, seatFill, src, tags, gapTags, label, points, seatPositions, radius, horizontalAlign, verticalAlign, fontSizeType1, fontSizeType2, fontSizeType3, } = item;
42
43
  const fontSizeFromLabel = (_a = labels === null || labels === void 0 ? void 0 : labels[0]) === null || _a === void 0 ? void 0 : _a.fontSize;
44
+ const fontTypeSize = {
45
+ "type-1": fontSizeType1,
46
+ "type-2": fontSizeType2,
47
+ "type-3": fontSizeType3,
48
+ };
43
49
  const renderTags = (data) => {
44
50
  var _a;
45
51
  const tags = data !== null && data !== void 0 ? data : tagsDummy(((_a = labels === null || labels === void 0 ? void 0 : labels[0]) === null || _a === void 0 ? void 0 : _a.label) || "Table", getIconFromId(id));
52
+ const scaleFontSize = Number(fontTypeSize[isShowTagType] || 1);
46
53
  const privileged = !isEmpty(privilegedTags)
47
54
  ? privilegedTags
48
55
  : isShowTagType === "type-1"
49
56
  ? PRIVILEGED_TAGS["CURRENT_TIME"]
50
57
  : isShowTagType === "type-2"
51
58
  ? PRIVILEGED_TAGS["NEXT_3_RESERVATION"]
52
- : undefined;
53
- if (tags && (tags === null || tags === void 0 ? void 0 : tags.length) > 0) {
54
- const scaleDefault = Number(fontSize || fontSizeFromLabel || 12) / 12;
55
- const gapBetweenTags = Number(gapTags || 20) * scaleDefault;
56
- const defaultFontSize = Number(fontSize || fontSizeFromLabel || 12);
57
- // Hitung total tinggi semua grup tag (buat center vertikal)
58
- const totalTagHeight = (tags === null || tags === void 0 ? void 0 : tags.filter((tag) => privileged === null || privileged === void 0 ? void 0 : privileged.find((p) => p.key === tag.key)).reduce((sum, tag) => {
59
- var _a;
60
- const items = tag.items || [];
61
- const isColumn = (_a = tag.direction) === null || _a === void 0 ? void 0 : _a.includes("column");
62
- const tagHeight = isColumn
63
- ? items.length * defaultFontSize + 2 * (Number(tag.gap) || 2)
64
- : defaultFontSize; // horizontal = 1 line
65
- return sum + tagHeight + gapBetweenTags;
66
- }, 0)) - gapBetweenTags;
67
- const startY = Number(height) / 4 - totalTagHeight / 3; // titik awal supaya semua di tengah
68
- let currentY = startY;
69
- return tags
70
- .filter((tag) => privileged === null || privileged === void 0 ? void 0 : privileged.find((p) => p.key === tag.key))
71
- .map((tag, tagIndex) => {
72
- var _a;
73
- const itemsPriv = privileged[tagIndex].items;
74
- const direction = ((_a = tag.direction) === null || _a === void 0 ? void 0 : _a.includes("column"))
75
- ? "column"
76
- : "flex";
77
- const gap = Number(tag.gap || 2) * scaleDefault;
78
- const items = tag.items || [];
79
- const fontSize = Number(defaultFontSize);
80
- const isColumn = direction === "column";
81
- const groupHeight = isColumn
82
- ? items.length * fontSize + 2 * gap
83
- : fontSize;
84
- const centerX = width / 2;
85
- const centerY = currentY + groupHeight;
86
- // naikkan posisi Y untuk grup berikutnya
87
- currentY += groupHeight + gapBetweenTags;
88
- const elements = items
89
- .filter((item) => itemsPriv.includes(item.type))
90
- .map((item, i) => {
91
- var _a, _b;
92
- const offsetY = isColumn
93
- ? i * (fontSize + gap) - groupHeight / 2 + fontSize / 2
94
- : 0;
95
- const offsetX = !isColumn
96
- ? i * (fontSize + gap) - (1 * (fontSize + gap)) / 2
97
- : 0;
98
- const posX = centerX + offsetX + Number((_a = tag.offsetX) !== null && _a !== void 0 ? _a : 0);
99
- const posY = centerY + offsetY + Number((_b = tag.offsetY) !== null && _b !== void 0 ? _b : 0);
100
- const renderSymbol = (symbol) => {
101
- if (!symbol)
102
- return null;
103
- const { position = "right", size = (item === null || item === void 0 ? void 0 : item.fontSize) || Number(fontSize), gap: symbolGap = 0, } = symbol;
104
- const sizeFont = (item === null || item === void 0 ? void 0 : item.fontSize) || Number(fontSize) / 3;
105
- let offsetSymbolX = 0;
106
- let offsetSymbolY = 0;
107
- switch (position) {
108
- case "right":
109
- offsetSymbolX = size + symbolGap;
110
- break;
111
- case "left":
112
- offsetSymbolX = -(size + symbolGap);
113
- break;
114
- case "top":
115
- offsetSymbolY = -(size + symbolGap);
116
- break;
117
- case "bottom":
118
- offsetSymbolY = size + symbolGap;
119
- break;
120
- case "right-top":
121
- offsetSymbolX = size + symbolGap;
122
- offsetSymbolY = -(size / 4);
123
- break;
124
- case "right-bottom":
125
- offsetSymbolX = size + symbolGap;
126
- offsetSymbolY = size / 4;
127
- break;
128
- case "left-top":
129
- offsetSymbolX = -size - symbolGap;
130
- offsetSymbolY = -(size / 4);
131
- break;
132
- case "left-bottom":
133
- offsetSymbolX = -size - symbolGap;
134
- offsetSymbolY = size / 4;
135
- break;
136
- }
137
- return (_createElement("tspan", Object.assign({}, symbol, { key: `symbol-${tagIndex}-${i}`, x: posX + offsetSymbolX, y: posY + offsetSymbolY, textAnchor: "middle", dominantBaseline: "middle", fontSize: `${sizeFont}px` }), symbol.value));
59
+ : isShowTagType === "type-3"
60
+ ? PRIVILEGED_TAGS["POS_VIEW"]
61
+ : undefined;
62
+ if (!(tags === null || tags === void 0 ? void 0 : tags.length))
63
+ return null;
64
+ const scaleDefault = Number(scaleFontSize || fontSize || fontSizeFromLabel || 12);
65
+ const postViewTagDummy = isShowTagType === "type-3";
66
+ const gapBetweenTags = Number((postViewTagDummy ? 1 : gapTags) || 20) * scaleDefault;
67
+ const defaultFontSize = Number(fontSize || fontSizeFromLabel || 12) * scaleDefault;
68
+ const filteredTags = tags.filter((tag) => privileged === null || privileged === void 0 ? void 0 : privileged.find((p) => p.key === tag.key));
69
+ // hitung tinggi tiap group
70
+ const groupHeights = filteredTags.map((tag) => {
71
+ var _a;
72
+ const isColumn = (_a = tag.direction) === null || _a === void 0 ? void 0 : _a.includes("column");
73
+ const gap = Number(tag.gap || 2) * scaleDefault;
74
+ const items = tag.items || [];
75
+ return isColumn
76
+ ? (items.length - 1) * (defaultFontSize + gap) + defaultFontSize
77
+ : defaultFontSize;
78
+ });
79
+ // total tinggi semua group + gap antar group
80
+ const totalTagHeight = groupHeights.reduce((sum, h) => sum + h, 0) +
81
+ (filteredTags.length - 1) * gapBetweenTags;
82
+ // startY supaya center vertikal
83
+ let currentY = height / 2 - totalTagHeight / 2;
84
+ return filteredTags.map((tag, tagIndex) => {
85
+ var _a;
86
+ const itemsPriv = privileged[tagIndex].items;
87
+ const isColumn = (_a = tag.direction) === null || _a === void 0 ? void 0 : _a.includes("column");
88
+ const gap = Number(tag.gap || 2) * scaleDefault;
89
+ const items = tag.items || [];
90
+ const groupHeight = groupHeights[tagIndex];
91
+ const centerX = width / 2;
92
+ const centerY = currentY + groupHeight / 2;
93
+ currentY += groupHeight + gapBetweenTags;
94
+ const elements = items
95
+ .filter((item) => itemsPriv.includes(item.type))
96
+ .map((item, i) => {
97
+ var _a, _b, _c;
98
+ const offsetY = isColumn
99
+ ? i * (defaultFontSize + gap) - groupHeight / 2 + defaultFontSize / 2
100
+ : 0;
101
+ const offsetX = !isColumn
102
+ ? i * (defaultFontSize + gap) - ((items.length - 1) * (defaultFontSize + gap)) / 2
103
+ : 0;
104
+ const posX = centerX + offsetX + Number((_a = tag.offsetX) !== null && _a !== void 0 ? _a : 0);
105
+ const posY = centerY + offsetY + Number((_b = tag.offsetY) !== null && _b !== void 0 ? _b : 0);
106
+ const renderSymbol = (symbol, width) => {
107
+ var _a;
108
+ if (!symbol)
109
+ return null;
110
+ const { position = "right", size = Number(item === null || item === void 0 ? void 0 : item.fontSize) || defaultFontSize / 3, gap: symbolGap = 0, } = symbol;
111
+ const sizeFont = defaultFontSize / 3;
112
+ const offsets = {
113
+ right: { x: size + (symbolGap * scaleFontSize) + width / 2.3, y: 0 },
114
+ left: { x: -(size + (symbolGap * scaleFontSize) + width / 2.3), y: 0 },
115
+ top: { x: 0, y: -(size + (symbolGap * scaleFontSize) + width / 2.3) },
116
+ bottom: { x: 0, y: size + (symbolGap * scaleFontSize) + width / 2.3 },
117
+ "right-top": { x: size + (symbolGap * scaleFontSize) + width / 2.3, y: -(defaultFontSize / 4) },
118
+ "right-bottom": { x: size + (symbolGap * scaleFontSize) + width / 2.3, y: defaultFontSize / 4 },
119
+ "left-top": { x: -(size + (symbolGap * scaleFontSize) + width / 2.3), y: -(defaultFontSize / 4) },
120
+ "left-bottom": { x: -(size + (symbolGap * scaleFontSize) + width / 2.3), y: defaultFontSize / 4 },
138
121
  };
139
- if (item.type === "icon") {
140
- const icons = iconTags !== null && iconTags !== void 0 ? iconTags : dummyIconTags;
141
- const iconTag = icons === null || icons === void 0 ? void 0 : icons.find((icon) => icon.key === item.value);
142
- if (!iconTag)
143
- return null;
144
- const scale = defaultFontSize / 12;
145
- return (_createElement("g", Object.assign({}, item, { key: `icon-${tagIndex}-${i}`, transform: `translate(${posX - defaultFontSize}, ${posY - defaultFontSize / 2}) scale(${scale})` }), iconTag.icon));
146
- }
147
- if (item.type === "text") {
148
- return (_createElement("text", Object.assign({}, item, { key: `text-${tagIndex}-${i}`, x: posX, y: posY, textAnchor: "middle", dominantBaseline: "middle", fontSize: defaultFontSize }),
149
- item.value,
150
- " ",
151
- renderSymbol(item === null || item === void 0 ? void 0 : item.symbol)));
152
- }
153
- return null;
154
- });
155
- return (_jsx("g", { pointerEvents: "none", children: elements }, `group-${tagIndex}`));
122
+ const { x: sx, y: sy } = (_a = offsets[position]) !== null && _a !== void 0 ? _a : offsets.right;
123
+ return (_jsx("tspan", { x: posX + sx, y: posY + sy, textAnchor: "middle", dominantBaseline: "middle", fontSize: `${sizeFont}px`, children: symbol.value }, `symbol-${tagIndex}-${i}`));
124
+ };
125
+ if (item.type === "icon") {
126
+ const icons = iconTags !== null && iconTags !== void 0 ? iconTags : dummyIconTags;
127
+ const iconTag = icons === null || icons === void 0 ? void 0 : icons.find((icon) => icon.key === item.value);
128
+ if (!iconTag)
129
+ return null;
130
+ const scale = defaultFontSize / 12;
131
+ return (_createElement("g", Object.assign({}, item, { key: `icon-${tagIndex}-${i}`, transform: `translate(${posX - defaultFontSize / 1.3}, ${posY - defaultFontSize / 1.3}) scale(${scale})` }), iconTag.icon));
132
+ }
133
+ if (item.type === "text") {
134
+ const widthText = ((_c = item === null || item === void 0 ? void 0 : item.value) === null || _c === void 0 ? void 0 : _c.length) * defaultFontSize * 0.6;
135
+ return (_createElement("text", Object.assign({}, item, { key: `text-${tagIndex}-${i}`, x: posX, y: posY, textAnchor: "middle", dominantBaseline: "middle", fontSize: defaultFontSize }),
136
+ item.value,
137
+ renderSymbol(item === null || item === void 0 ? void 0 : item.symbol, widthText)));
138
+ }
139
+ return null;
156
140
  });
157
- }
141
+ return (_jsx("g", { pointerEvents: "none", transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: elements }, `group-${tagIndex}`));
142
+ });
158
143
  };
159
144
  let commonProps = {
160
145
  fill,
@@ -162,6 +147,16 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
162
147
  stroke,
163
148
  strokeWidth,
164
149
  };
150
+ const labelProps = {
151
+ labels,
152
+ id,
153
+ width,
154
+ height,
155
+ commonProps,
156
+ horizontalAlign,
157
+ verticalAlign,
158
+ rotation,
159
+ };
165
160
  const hasSelected = (selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.id) === id;
166
161
  if (hasSelected) {
167
162
  const eventSelectedStyles = eventMatchTable === null || eventMatchTable === void 0 ? void 0 : eventMatchTable.find((style) => style.event === "selected");
@@ -290,16 +285,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
290
285
  "points",
291
286
  "tags",
292
287
  "seatCount",
293
- ]), commonProps), `${id}-rect`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, pointerEvents: "none", children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
294
- var _a, _b, _c, _d, _e, _f, _g;
295
- const cx = width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0);
296
- const cy = height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0);
297
- return (_createElement("text", Object.assign({ pointerEvents: "none" }, omit(commonProps, [
298
- "opacity",
299
- "stroke",
300
- "strokeWidth",
301
- ]), { transform: `rotate(${(_c = _ === null || _ === void 0 ? void 0 : _.rotation) !== null && _c !== void 0 ? _c : 0}, ${cx},${cy})`, key: `${id}-label-${index}`, x: width / 2 + ((_d = _ === null || _ === void 0 ? void 0 : _.x) !== null && _d !== void 0 ? _d : 0), y: height / 2 + ((_e = _ === null || _ === void 0 ? void 0 : _.y) !== null && _e !== void 0 ? _e : 0), fill: (_f = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _f !== void 0 ? _f : "black", fontSize: `${(_g = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _g !== void 0 ? _g : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle" }), _ === null || _ === void 0 ? void 0 : _.label));
302
- }) }))] }) }, id));
288
+ ]), commonProps), `${id}-rect`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, pointerEvents: "none", children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] }) }, id));
303
289
  case "polygon":
304
290
  if (!points)
305
291
  return null;
@@ -307,16 +293,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
307
293
  const box = getBoundingBoxFromPoints(points, rotation !== null && rotation !== void 0 ? rotation : 0);
308
294
  const centerX = box.x + box.width / 2;
309
295
  const centerY = box.y + box.height / 2;
310
- return (_jsx("g", { "data-id": id, transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_createElement("polygon", Object.assign({}, commonProps, { key: id, points: finalPoint, x: "0", y: "0" })), _jsx("g", { "data-text": `${id}-text`, transform: `rotate(${-rotation}, ${centerX}, ${centerY}) translate(${box === null || box === void 0 ? void 0 : box.x}, ${box === null || box === void 0 ? void 0 : box.y})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
311
- var _a, _b, _c, _d, _e, _f, _g;
312
- const cx = (box === null || box === void 0 ? void 0 : box.width) / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0);
313
- const cy = (box === null || box === void 0 ? void 0 : box.height) / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0);
314
- return (_createElement("text", Object.assign({}, omit(commonProps, [
315
- "opacity",
316
- "stroke",
317
- "strokeWidth",
318
- ]), { transform: `rotate(${(_c = _ === null || _ === void 0 ? void 0 : _.rotation) !== null && _c !== void 0 ? _c : 0}, ${cx},${cy})`, key: `${id}-label-${index}`, x: (box === null || box === void 0 ? void 0 : box.width) / 2 + ((_d = _ === null || _ === void 0 ? void 0 : _.x) !== null && _d !== void 0 ? _d : 0), y: (box === null || box === void 0 ? void 0 : box.height) / 2 + ((_e = _ === null || _ === void 0 ? void 0 : _.y) !== null && _e !== void 0 ? _e : 0), fill: (_f = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _f !== void 0 ? _f : "black", fontSize: `${(_g = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _g !== void 0 ? _g : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle" }), _ === null || _ === void 0 ? void 0 : _.label));
319
- }) })] }) }, id));
296
+ return (_jsx("g", { "data-id": id, transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_createElement("polygon", Object.assign({}, commonProps, { key: id, points: finalPoint, x: "0", y: "0" })), _jsx("g", { "data-text": `${id}-text`, transform: `rotate(${-rotation}, ${centerX}, ${centerY}) translate(${box === null || box === void 0 ? void 0 : box.x}, ${box === null || box === void 0 ? void 0 : box.y})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) })] }) }, id));
320
297
  case "circle":
321
298
  return (_jsxs("g", { style: { pointerEvents: "all" }, "data-id": id, transform: `translate(${x}, ${y})`, onContextMenu: (e) => e.preventDefault(), onDragEnter: (e) => {
322
299
  e.preventDefault(); // penting
@@ -362,16 +339,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
362
339
  "points",
363
340
  "tags",
364
341
  "seatCount",
365
- ])), id), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
366
- var _a, _b, _c, _d, _e, _f, _g;
367
- const cx = width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0);
368
- const cy = height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0);
369
- return (_createElement("text", Object.assign({}, omit(commonProps, [
370
- "opacity",
371
- "stroke",
372
- "strokeWidth",
373
- ]), { transform: `rotate(${(_c = _ === null || _ === void 0 ? void 0 : _.rotation) !== null && _c !== void 0 ? _c : 0}, ${cx},${cy})`, key: `${id}-label-${index}`, x: width / 2 + ((_d = _ === null || _ === void 0 ? void 0 : _.x) !== null && _d !== void 0 ? _d : 0), y: height / 2 + ((_e = _ === null || _ === void 0 ? void 0 : _.y) !== null && _e !== void 0 ? _e : 0), fill: (_f = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _f !== void 0 ? _f : "black", fontSize: `${(_g = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _g !== void 0 ? _g : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle" }), _ === null || _ === void 0 ? void 0 : _.label));
374
- }) }))] })] }, id));
342
+ ])), id), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] })] }, id));
375
343
  case "table-seat-circle": {
376
344
  const seatCount = item.seatCount;
377
345
  const openSpace = (_b = item.openSpace) !== null && _b !== void 0 ? _b : 0;
@@ -436,10 +404,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
436
404
  "points",
437
405
  "tags",
438
406
  "seatCount",
439
- ]), commonProps)), _jsx("g", { "data-seat": `${id}-seats`, children: seatCircles.map(({ cx, cy }, i) => (_jsx("circle", { cx: cx, cy: cy, r: seatRadius, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
440
- var _a, _b, _c, _d;
441
- return (_jsx("text", { x: width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0), y: height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0), fill: (_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black", fontSize: `${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle", transform: transformRotate, children: _ === null || _ === void 0 ? void 0 : _.label }, `${id}-label-${index}`));
442
- }) }))] }) }, id));
407
+ ]), commonProps)), _jsx("g", { "data-seat": `${id}-seats`, children: seatCircles.map(({ cx, cy }, i) => (_jsx("circle", { cx: cx, cy: cy, r: seatRadius, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] }) }, id));
443
408
  }
444
409
  case "table-seat-rect-circle": {
445
410
  const clamp = (v, min, max) => Math.max(min, Math.min(max, v));
@@ -568,16 +533,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
568
533
  "points",
569
534
  "tags",
570
535
  "seatCount",
571
- ]), commonProps)), _jsx("g", { "data-seat": `${id}-seats`, children: seats === null || seats === void 0 ? void 0 : seats.map(({ height, width, x, y, id }, i) => (_jsx("rect", { x: x, y: y, id: `seat-${id}`, height: height, width: width, rx: radius / 4, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }, `${id}-seats`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
572
- var _a, _b, _c, _d, _e, _f, _g;
573
- const cx = width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0);
574
- const cy = height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0);
575
- return (_createElement("text", Object.assign({}, omit(commonProps, [
576
- "opacity",
577
- "stroke",
578
- "strokeWidth",
579
- ]), { transform: `rotate(${(_c = _ === null || _ === void 0 ? void 0 : _.rotation) !== null && _c !== void 0 ? _c : 0}, ${cx},${cy})`, key: `${id}-label-${index}`, x: width / 2 + ((_d = _ === null || _ === void 0 ? void 0 : _.x) !== null && _d !== void 0 ? _d : 0), y: height / 2 + ((_e = _ === null || _ === void 0 ? void 0 : _.y) !== null && _e !== void 0 ? _e : 0), fill: (_f = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _f !== void 0 ? _f : "black", fontSize: `${(_g = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _g !== void 0 ? _g : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle" }), _ === null || _ === void 0 ? void 0 : _.label));
580
- }) }))] }) }, id));
536
+ ]), commonProps)), _jsx("g", { "data-seat": `${id}-seats`, children: seats === null || seats === void 0 ? void 0 : seats.map(({ height, width, x, y, id }, i) => (_jsx("rect", { x: x, y: y, id: `seat-${id}`, height: height, width: width, rx: radius / 4, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }, `${id}-seats`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] }) }, id));
581
537
  }
582
538
  case "table-seat-square": {
583
539
  const openSpace = item.openSpace || 0; // from 0 to 0.9
@@ -677,16 +633,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
677
633
  "points",
678
634
  "tags",
679
635
  "seatCount",
680
- ]))), renderTags(tags), _jsx("g", { "data-seat": `${id}-seats`, transform: `translate(${-x}, ${-y})`, children: [...topSeats, ...bottomSeats, ...leftSeats, ...rightSeats].map(({ cx, cy, id }, i) => (_jsx("circle", { id: `seat-${id}`, cx: cx, cy: cy, r: r, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }, `${id}-seats`), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
681
- var _a, _b, _c, _d, _e, _f, _g;
682
- const cx = width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0);
683
- const cy = height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0);
684
- return (_createElement("text", Object.assign({}, omit(commonProps, [
685
- "opacity",
686
- "stroke",
687
- "strokeWidth",
688
- ]), { transform: `rotate(${(_c = _ === null || _ === void 0 ? void 0 : _.rotation) !== null && _c !== void 0 ? _c : 0}, ${cx},${cy})`, key: `${id}-label-${index}`, x: width / 2 + ((_d = _ === null || _ === void 0 ? void 0 : _.x) !== null && _d !== void 0 ? _d : 0), y: height / 2 + ((_e = _ === null || _ === void 0 ? void 0 : _.y) !== null && _e !== void 0 ? _e : 0), fill: (_f = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _f !== void 0 ? _f : "black", fontSize: `${(_g = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _g !== void 0 ? _g : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle" }), _ === null || _ === void 0 ? void 0 : _.label));
689
- }) }))] }) }, id));
636
+ ]))), renderTags(tags), _jsx("g", { "data-seat": `${id}-seats`, transform: `translate(${-x}, ${-y})`, children: [...topSeats, ...bottomSeats, ...leftSeats, ...rightSeats].map(({ cx, cy, id }, i) => (_jsx("circle", { id: `seat-${id}`, cx: cx, cy: cy, r: r, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }, `${id}-seats`), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] }) }, id));
690
637
  }
691
638
  case "table-seat-half-square": {
692
639
  const openSpace = item.openSpace || 0;
@@ -790,16 +737,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
790
737
  "points",
791
738
  "tags",
792
739
  "seatCount",
793
- ]))), _jsx("g", { "data-seat": `${id}-seats`, children: seats === null || seats === void 0 ? void 0 : seats.map(({ d, id }, i) => (_jsx("path", { id: `seat-${id}`, d: d, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }, `${id}-seats`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
794
- var _a, _b, _c, _d, _e, _f, _g;
795
- const cx = width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0);
796
- const cy = height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0);
797
- return (_createElement("text", Object.assign({}, omit(commonProps, [
798
- "opacity",
799
- "stroke",
800
- "strokeWidth",
801
- ]), { transform: `rotate(${(_c = _ === null || _ === void 0 ? void 0 : _.rotation) !== null && _c !== void 0 ? _c : 0}, ${cx},${cy})`, key: `${id}-label-${index}`, x: width / 2 + ((_d = _ === null || _ === void 0 ? void 0 : _.x) !== null && _d !== void 0 ? _d : 0), y: height / 2 + ((_e = _ === null || _ === void 0 ? void 0 : _.y) !== null && _e !== void 0 ? _e : 0), fill: (_f = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _f !== void 0 ? _f : "black", fontSize: `${(_g = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _g !== void 0 ? _g : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle" }), _ === null || _ === void 0 ? void 0 : _.label));
802
- }) }))] }) }, id));
740
+ ]))), _jsx("g", { "data-seat": `${id}-seats`, children: seats === null || seats === void 0 ? void 0 : seats.map(({ d, id }, i) => (_jsx("path", { id: `seat-${id}`, d: d, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }, `${id}-seats`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] }) }, id));
803
741
  }
804
742
  case "table-seat-rect-square": {
805
743
  const clamp = (v, min, max) => Math.max(min, Math.min(max, v));
@@ -927,16 +865,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
927
865
  "points",
928
866
  "tags",
929
867
  "seatCount",
930
- ]))), _jsx("g", { "data-seat": `${id}-seats`, transform: `translate(${-x}, ${-y})`, children: seats === null || seats === void 0 ? void 0 : seats.map(({ height, width, x, y, id }, i) => (_jsx("rect", { x: x, y: y, id: `seat-${id}`, height: height, width: width, rx: radius / 4, fill: seatFill }, `${id}-seat-${i}`))) }, `${id}-seats`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
931
- var _a, _b, _c, _d, _e, _f, _g;
932
- const cx = width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0);
933
- const cy = height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0);
934
- return (_createElement("text", Object.assign({}, omit(commonProps, [
935
- "opacity",
936
- "stroke",
937
- "strokeWidth",
938
- ]), { transform: `rotate(${(_c = _ === null || _ === void 0 ? void 0 : _.rotation) !== null && _c !== void 0 ? _c : 0}, ${cx},${cy})`, key: `${id}-label-${index}`, x: width / 2 + ((_d = _ === null || _ === void 0 ? void 0 : _.x) !== null && _d !== void 0 ? _d : 0), y: height / 2 + ((_e = _ === null || _ === void 0 ? void 0 : _.y) !== null && _e !== void 0 ? _e : 0), fill: (_f = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _f !== void 0 ? _f : "black", fontSize: `${(_g = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _g !== void 0 ? _g : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle" }), _ === null || _ === void 0 ? void 0 : _.label));
939
- }) }))] }) }, id));
868
+ ]))), _jsx("g", { "data-seat": `${id}-seats`, transform: `translate(${-x}, ${-y})`, children: seats === null || seats === void 0 ? void 0 : seats.map(({ height, width, x, y, id }, i) => (_jsx("rect", { x: x, y: y, id: `seat-${id}`, height: height, width: width, rx: radius / 4, fill: seatFill }, `${id}-seat-${i}`))) }, `${id}-seats`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] }) }, id));
940
869
  }
941
870
  case "text":
942
871
  return (_jsx("g", { onContextMenu: (e) => e.preventDefault(), "data-id": id, transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_jsx("rect", { width: width, height: height, fill: "transparent", opacity: opacity }), _jsx("text", Object.assign({ x: width / 2, y: height / 2, textAnchor: "middle", dominantBaseline: "middle", fill: fill !== null && fill !== void 0 ? fill : fontColor, fontSize: fontSize !== null && fontSize !== void 0 ? fontSize : height * 0.6, opacity: opacity }, omit(commonProps, ["fill", "opacity"]), { children: text }))] }) }, id));
@@ -971,15 +900,9 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
971
900
  e.preventDefault();
972
901
  const group = e.currentTarget;
973
902
  highlightGroup(group, "mousedown");
974
- }, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_jsx("image", Object.assign({ href: src, width: width, height: height, transform: transformRotate }, commonProps)), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
975
- var _a, _b, _c, _d;
976
- return (_jsx("text", { x: x + width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0), y: y + height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0), fill: (_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black", fontSize: `${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle", transform: transformRotate, children: _ === null || _ === void 0 ? void 0 : _.label }, index));
977
- }) }))] }) }, id));
903
+ }, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_jsx("image", Object.assign({ href: src, width: width, height: height, transform: transformRotate }, commonProps)), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] }) }, id));
978
904
  case "background":
979
- return (_jsxs("g", { onContextMenu: (e) => e.preventDefault(), children: [_jsx("image", Object.assign({ href: src, x: x, y: y, width: width, height: height, transform: transformRotate }, commonProps)), labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
980
- var _a, _b, _c, _d;
981
- return (_jsx("text", { x: x + width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0), y: y + height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0), fill: (_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black", fontSize: `${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle", transform: transformRotate, children: _ === null || _ === void 0 ? void 0 : _.label }, index));
982
- })] }, id));
905
+ return (_jsx("g", { onContextMenu: (e) => e.preventDefault(), transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_jsx("image", { href: src, width: width, height: height }), _jsx("g", { "data-text": `${id}-text`, transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) })] }) }, id));
983
906
  default:
984
907
  return _jsx("g", {}, id);
985
908
  }