seat-editor 3.3.13 → 3.3.14
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/constant.d.ts +1 -0
- package/dist/app/constant.js +1 -0
- package/dist/app/layout.d.ts +6 -0
- package/dist/app/layout.jsx +27 -0
- package/dist/app/new-board/page.jsx +55 -0
- package/dist/app/old-board/page.d.ts +3 -0
- package/dist/app/old-board/page.jsx +510 -0
- package/dist/app/only-view/chair.d.ts +1 -0
- package/dist/app/only-view/chair.js +12 -0
- package/dist/app/only-view/constant.d.ts +60 -0
- package/dist/app/only-view/constant.js +1336 -0
- package/dist/app/only-view/page.jsx +248 -0
- package/dist/app/only-view/user.d.ts +1 -0
- package/dist/app/only-view/user.js +12 -0
- package/dist/app/page.d.ts +2 -0
- package/dist/app/page.jsx +13 -0
- package/dist/app/test/page.d.ts +2 -0
- package/dist/app/test/page.jsx +45 -0
- package/dist/app/v2/page.d.ts +2 -0
- package/dist/app/v2/page.jsx +13 -0
- package/dist/components/button-tools/index.d.ts +11 -0
- package/dist/components/button-tools/index.jsx +17 -0
- package/dist/components/form-tools/label.d.ts +2 -0
- package/dist/components/form-tools/label.jsx +63 -0
- package/dist/components/form-tools/shape.d.ts +8 -0
- package/dist/components/form-tools/shape.jsx +113 -0
- package/dist/components/input/number-indicator.d.ts +7 -0
- package/dist/components/input/number-indicator.jsx +36 -0
- package/dist/components/joystick/index.d.ts +12 -0
- package/dist/components/joystick/index.jsx +49 -0
- package/dist/components/layer/index.d.ts +19 -0
- package/dist/components/layer/index.jsx +383 -0
- package/dist/components/layer-v2/index.d.ts +19 -0
- package/dist/components/layer-v2/index.jsx +370 -0
- package/dist/components/layer-v3/index.d.ts +13 -0
- package/dist/components/layer-v3/index.jsx +631 -0
- package/dist/components/layer-v3/utils.d.ts +19 -0
- package/dist/components/layer-v3/utils.js +72 -0
- package/dist/components/layer-v4/constant.d.ts +60 -0
- package/dist/components/layer-v4/constant.js +93 -0
- package/dist/components/layer-v4/index.d.ts +24 -0
- package/dist/components/layer-v4/index.jsx +1046 -0
- package/dist/components/lib/index.d.ts +8 -0
- package/dist/components/lib/index.jsx +33 -0
- package/dist/components/modal-preview/index.d.ts +4 -0
- package/dist/components/modal-preview/index.jsx +11 -0
- package/dist/dto/event-handler.d.ts +1 -0
- package/dist/dto/event-handler.js +1 -0
- package/dist/dto/table.d.ts +79 -0
- package/dist/dto/table.js +1 -0
- package/dist/features/board/board-slice.d.ts +14 -0
- package/dist/features/board/board-slice.js +52 -0
- package/dist/features/board/index.d.ts +6 -0
- package/dist/features/board/index.jsx +725 -0
- package/dist/features/board-v2/board-slice.d.ts +14 -0
- package/dist/features/board-v2/board-slice.js +52 -0
- package/dist/features/board-v2/index.d.ts +8 -0
- package/dist/features/board-v2/index.jsx +869 -0
- package/dist/features/board-v3/board-slice.d.ts +19 -0
- package/dist/features/board-v3/board-slice.js +274 -0
- package/dist/features/board-v3/constant.d.ts +5 -0
- package/dist/features/board-v3/constant.js +5 -0
- package/dist/features/board-v3/history-slice.d.ts +27 -0
- package/dist/features/board-v3/history-slice.js +27 -0
- package/dist/features/board-v3/icons.d.ts +4 -0
- package/dist/features/board-v3/icons.jsx +100 -0
- package/dist/features/board-v3/index.d.ts +16 -0
- package/dist/features/board-v3/index.jsx +1678 -0
- package/dist/features/board-v3/polygon.d.ts +28 -0
- package/dist/features/board-v3/polygon.js +109 -0
- package/dist/features/board-v3/rect.d.ts +9 -0
- package/dist/features/board-v3/rect.js +152 -0
- package/dist/features/board-v3/resize-element.d.ts +12 -0
- package/dist/features/board-v3/resize-element.js +43 -0
- package/dist/features/board-v3/utils.d.ts +180 -0
- package/dist/features/board-v3/utils.js +1235 -0
- package/dist/features/navbar/index.d.ts +2 -0
- package/dist/features/navbar/index.jsx +5 -0
- package/dist/features/panel/index.d.ts +6 -0
- package/dist/features/panel/index.jsx +251 -0
- package/dist/features/panel/panel-slice.d.ts +23 -0
- package/dist/features/panel/panel-slice.js +46 -0
- package/dist/features/panel/select-tool.d.ts +6 -0
- package/dist/features/panel/select-tool.jsx +70 -0
- package/dist/features/panel/selected-group.d.ts +2 -0
- package/dist/features/panel/selected-group.jsx +93 -0
- package/dist/features/panel/square-circle-tool.d.ts +2 -0
- package/dist/features/panel/square-circle-tool.jsx +10 -0
- package/dist/features/panel/table-seat-circle.d.ts +2 -0
- package/dist/features/panel/table-seat-circle.jsx +36 -0
- package/dist/features/panel/table-seat-square.d.ts +2 -0
- package/dist/features/panel/table-seat-square.jsx +51 -0
- package/dist/features/panel/text-tool.d.ts +2 -0
- package/dist/features/panel/text-tool.jsx +57 -0
- package/dist/features/panel/upload-tool.d.ts +10 -0
- package/dist/features/panel/upload-tool.jsx +176 -0
- package/dist/features/panel/utils.d.ts +5 -0
- package/dist/features/panel/utils.js +47 -0
- package/dist/features/side-tool/index.d.ts +8 -0
- package/dist/features/side-tool/index.jsx +390 -0
- package/dist/features/side-tool/side-tool-slice.d.ts +16 -0
- package/dist/features/side-tool/side-tool-slice.js +28 -0
- package/dist/features/theme/theme-slice.d.ts +12 -0
- package/dist/features/theme/theme-slice.js +15 -0
- package/dist/features/view-only/index.d.ts +19 -0
- package/dist/features/view-only/index.jsx +205 -0
- package/dist/features/view-only-2/index.d.ts +19 -0
- package/dist/features/view-only-2/index.jsx +190 -0
- package/dist/features/view-only-3/index.d.ts +89 -0
- package/dist/features/view-only-3/index.jsx +590 -0
- package/dist/features/view-only-3/utils.d.ts +1 -0
- package/dist/features/view-only-3/utils.js +3 -0
- package/dist/hooks/use-redux.d.ts +4 -0
- package/dist/hooks/use-redux.js +3 -0
- package/dist/index.js +10 -0
- package/dist/libs/middleware.d.ts +2 -0
- package/dist/libs/middleware.js +5 -0
- package/dist/libs/rootReducer.d.ts +12 -0
- package/dist/libs/rootReducer.js +14 -0
- package/dist/libs/store.d.ts +18 -0
- package/dist/libs/store.js +19 -0
- package/dist/provider/antd-provider.d.ts +4 -0
- package/dist/provider/antd-provider.jsx +46 -0
- package/dist/provider/redux-provider.d.ts +3 -0
- package/dist/provider/redux-provider.jsx +6 -0
- package/dist/provider/store-provider.d.ts +4 -0
- package/dist/provider/store-provider.jsx +10 -0
- package/dist/utils/constant.d.ts +3 -0
- package/dist/utils/constant.js +13 -0
- package/dist/utils/format.d.ts +2 -0
- package/dist/utils/format.js +29 -0
- package/dist/utils/injectCss.d.ts +1 -0
- package/dist/utils/injectCss.js +13 -0
- package/dist/utils/regex.d.ts +3 -0
- package/dist/utils/regex.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export function rectToPolygonPoints(x, y, width, height) {
|
|
2
|
+
const topLeft = [x, y];
|
|
3
|
+
const topRight = [x + width, y];
|
|
4
|
+
const bottomRight = [x + width, y + height];
|
|
5
|
+
const bottomLeft = [x, y + height];
|
|
6
|
+
const points = [topLeft, topRight, bottomRight, bottomLeft]
|
|
7
|
+
.map((point) => point.join(","))
|
|
8
|
+
.join(" ");
|
|
9
|
+
return points;
|
|
10
|
+
}
|
|
11
|
+
export function rectToPolygonNodes(width, height) {
|
|
12
|
+
const points = [
|
|
13
|
+
{ x: 0, y: 0 },
|
|
14
|
+
{ x: 0 + width / 2, y: 0 },
|
|
15
|
+
{ x: 0 + width, y: 0 },
|
|
16
|
+
{ x: 0 + width, y: 0 + height / 2 },
|
|
17
|
+
{ x: 0 + width, y: 0 + height },
|
|
18
|
+
{ x: 0 + width / 2, y: 0 + height },
|
|
19
|
+
{ x: 0, y: 0 + height },
|
|
20
|
+
{ x: 0, y: 0 + height / 2 },
|
|
21
|
+
];
|
|
22
|
+
return points;
|
|
23
|
+
}
|
|
24
|
+
export function distributeWithSpacing({ start, length, count, radius, spacing, }) {
|
|
25
|
+
if (count === 0)
|
|
26
|
+
return [];
|
|
27
|
+
// ✅ satu seat → selalu center
|
|
28
|
+
if (count === 1) {
|
|
29
|
+
return [start + length / 2];
|
|
30
|
+
}
|
|
31
|
+
const usable = length - 2 * radius;
|
|
32
|
+
// spacing default = bagi penuh
|
|
33
|
+
const defaultSpacing = usable / (count - 1);
|
|
34
|
+
const s = spacing != null ? Math.min(spacing, defaultSpacing) : defaultSpacing;
|
|
35
|
+
// total panjang seat berdasarkan spacing
|
|
36
|
+
const total = (count - 1) * s;
|
|
37
|
+
// start supaya CENTERED
|
|
38
|
+
const offset = (usable - total) / 2;
|
|
39
|
+
return Array.from({ length: count }, (_, i) => start + radius + offset + i * s);
|
|
40
|
+
}
|
|
41
|
+
// utils/svgPath.ts
|
|
42
|
+
// utils/svgArc.ts
|
|
43
|
+
export const arcByDirection = ({ cx, cy, r, direction = "top", fraction = 0.5, }) => {
|
|
44
|
+
const clamp = (v, min, max) => Math.max(min, Math.min(max, v));
|
|
45
|
+
const frac = clamp(fraction, 0.01, 1);
|
|
46
|
+
const sweep = 360 * frac;
|
|
47
|
+
// angle tengah untuk tiap direction
|
|
48
|
+
const centerAngleMap = {
|
|
49
|
+
top: -90,
|
|
50
|
+
right: 0,
|
|
51
|
+
bottom: 90,
|
|
52
|
+
left: 180,
|
|
53
|
+
};
|
|
54
|
+
const centerAngle = centerAngleMap[direction];
|
|
55
|
+
const startAngle = centerAngle - sweep / 2;
|
|
56
|
+
const endAngle = centerAngle + sweep / 2;
|
|
57
|
+
const rad = (deg) => (deg * Math.PI) / 180;
|
|
58
|
+
const start = {
|
|
59
|
+
x: cx + r * Math.cos(rad(startAngle)),
|
|
60
|
+
y: cy + r * Math.sin(rad(startAngle)),
|
|
61
|
+
};
|
|
62
|
+
const end = {
|
|
63
|
+
x: cx + r * Math.cos(rad(endAngle)),
|
|
64
|
+
y: cy + r * Math.sin(rad(endAngle)),
|
|
65
|
+
};
|
|
66
|
+
const largeArcFlag = sweep > 180 ? 1 : 0;
|
|
67
|
+
const sweepFlag = 1;
|
|
68
|
+
return `
|
|
69
|
+
M ${start.x} ${start.y}
|
|
70
|
+
A ${r} ${r} 0 ${largeArcFlag} ${sweepFlag} ${end.x} ${end.y}
|
|
71
|
+
`;
|
|
72
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export declare const tagsDummy: (name: string, icon: string) => ({
|
|
2
|
+
gap: string;
|
|
3
|
+
key: string;
|
|
4
|
+
items: {
|
|
5
|
+
type: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}[];
|
|
8
|
+
direction: string;
|
|
9
|
+
offsetX?: undefined;
|
|
10
|
+
offsetY?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
gap: string;
|
|
13
|
+
key: string;
|
|
14
|
+
items: {
|
|
15
|
+
type: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}[];
|
|
18
|
+
offsetX: string;
|
|
19
|
+
offsetY: string;
|
|
20
|
+
direction: string;
|
|
21
|
+
} | {
|
|
22
|
+
gap: string;
|
|
23
|
+
key: string;
|
|
24
|
+
items: ({
|
|
25
|
+
type: string;
|
|
26
|
+
value: string;
|
|
27
|
+
fontWeight: string;
|
|
28
|
+
textDecoration: string;
|
|
29
|
+
symbol?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
type: string;
|
|
32
|
+
value: string;
|
|
33
|
+
fontWeight?: undefined;
|
|
34
|
+
textDecoration?: undefined;
|
|
35
|
+
symbol?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
type: string;
|
|
38
|
+
value: string;
|
|
39
|
+
symbol: {
|
|
40
|
+
value: string;
|
|
41
|
+
gap: number;
|
|
42
|
+
position: string;
|
|
43
|
+
};
|
|
44
|
+
fontWeight?: undefined;
|
|
45
|
+
textDecoration?: undefined;
|
|
46
|
+
})[];
|
|
47
|
+
direction: string;
|
|
48
|
+
offsetY: number;
|
|
49
|
+
offsetX?: undefined;
|
|
50
|
+
})[];
|
|
51
|
+
export declare const PRIVILEGED_TAGS: {
|
|
52
|
+
CURRENT_TIME: {
|
|
53
|
+
key: string;
|
|
54
|
+
items: string[];
|
|
55
|
+
}[];
|
|
56
|
+
NEXT_3_RESERVATION: {
|
|
57
|
+
key: string;
|
|
58
|
+
items: string[];
|
|
59
|
+
}[];
|
|
60
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export const tagsDummy = (name, icon) => [
|
|
2
|
+
{
|
|
3
|
+
gap: "8",
|
|
4
|
+
key: "table",
|
|
5
|
+
items: [
|
|
6
|
+
{
|
|
7
|
+
type: "text",
|
|
8
|
+
value: name,
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
type: "icon",
|
|
12
|
+
value: icon,
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
direction: "column",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
gap: "8",
|
|
19
|
+
key: "pax",
|
|
20
|
+
items: [
|
|
21
|
+
{
|
|
22
|
+
type: "icon",
|
|
23
|
+
value: "people",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: "text",
|
|
27
|
+
value: "0/8",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
offsetX: "3",
|
|
31
|
+
offsetY: "1",
|
|
32
|
+
direction: "flex",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
gap: "2",
|
|
36
|
+
key: "rsvp_time",
|
|
37
|
+
items: [
|
|
38
|
+
{
|
|
39
|
+
type: "text",
|
|
40
|
+
value: "18:00",
|
|
41
|
+
fontWeight: "bold",
|
|
42
|
+
textDecoration: "underline",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: "text",
|
|
46
|
+
value: "19:00",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: "text",
|
|
50
|
+
value: "22:00",
|
|
51
|
+
symbol: {
|
|
52
|
+
value: "+1",
|
|
53
|
+
gap: 1,
|
|
54
|
+
position: "right-top"
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
// as Position, // right | right-top | right-bottom | left | left-top | left-bottom | top | bottom
|
|
58
|
+
// {
|
|
59
|
+
// type: "text",
|
|
60
|
+
// value: "23:00",
|
|
61
|
+
// symbol: {
|
|
62
|
+
// value: "+1",
|
|
63
|
+
// gap: 1,
|
|
64
|
+
// position: "right-top" as Position, // right | right-top | right-bottom | left | left-top | left-bottom | top | bottom
|
|
65
|
+
// },
|
|
66
|
+
// },
|
|
67
|
+
],
|
|
68
|
+
direction: "column",
|
|
69
|
+
offsetY: -35,
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
export const PRIVILEGED_TAGS = {
|
|
73
|
+
CURRENT_TIME: [
|
|
74
|
+
{
|
|
75
|
+
key: "table",
|
|
76
|
+
items: ["text", "icon"],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: "pax",
|
|
80
|
+
items: ["text", "icon"],
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
NEXT_3_RESERVATION: [
|
|
84
|
+
{
|
|
85
|
+
key: "table",
|
|
86
|
+
items: ["text"],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
key: "rsvp_time",
|
|
90
|
+
items: ["text"],
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EventHandleType } from "../../dto/event-handler";
|
|
2
|
+
import { PropertiesProps } from "../../dto/table";
|
|
3
|
+
import { TableMatchEvent } from "../../features/view-only-3";
|
|
4
|
+
interface LayersProps {
|
|
5
|
+
components?: PropertiesProps[];
|
|
6
|
+
selectedComponent?: PropertiesProps;
|
|
7
|
+
activeTool?: string;
|
|
8
|
+
onBlur?: () => void;
|
|
9
|
+
selectedTable?: PropertiesProps;
|
|
10
|
+
iconTags?: {
|
|
11
|
+
icon: React.JSX.Element;
|
|
12
|
+
key: string;
|
|
13
|
+
}[];
|
|
14
|
+
eventMatchTable?: TableMatchEvent[];
|
|
15
|
+
onHighlightGroup?: (group: SVGGElement, eventType: EventHandleType) => void;
|
|
16
|
+
onForceRestoreGroup?: (group: SVGGElement, eventType: EventHandleType) => void;
|
|
17
|
+
selectedTableColor?: string;
|
|
18
|
+
privilegedTags?: {
|
|
19
|
+
key: string;
|
|
20
|
+
items: string[];
|
|
21
|
+
}[];
|
|
22
|
+
}
|
|
23
|
+
declare const Layers: ({ components, selectedTable, iconTags, eventMatchTable, onHighlightGroup, onForceRestoreGroup, selectedTableColor, privilegedTags, }: LayersProps) => import("react").JSX.Element;
|
|
24
|
+
export default Layers;
|