seat-editor 3.4.4 → 3.4.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/constant.d.ts +19 -19
- package/dist/app/constant.js +35 -20
- package/dist/app/only-view/page.js +6 -4
- package/dist/app/only-view/page.jsx +6 -4
- package/dist/components/form-tools/label.js +13 -13
- package/dist/components/form-tools/label.jsx +18 -11
- package/dist/components/form-tools/shape.js +1 -1
- package/dist/components/form-tools/shape.jsx +1 -1
- package/dist/components/layer-v4/index.js +3 -2
- package/dist/components/layer-v4/index.jsx +3 -2
- package/dist/features/board-v3/board-slice.js +4 -4
- package/dist/features/board-v3/index.js +24 -4
- package/dist/features/board-v3/index.jsx +24 -4
- package/dist/features/board-v3/utils.d.ts +2 -1
- package/dist/features/board-v3/utils.js +44 -18
- package/dist/features/panel/index.js +28 -4
- package/dist/features/panel/index.jsx +28 -4
- package/dist/features/panel/selected-group.js +16 -4
- package/dist/features/panel/selected-group.jsx +26 -7
- package/dist/features/panel/table-seat-circle.js +4 -1
- package/dist/features/panel/table-seat-circle.jsx +4 -1
- package/dist/features/panel/table-seat-square.js +8 -2
- package/dist/features/panel/table-seat-square.jsx +9 -3
- package/dist/features/panel/utils.js +3 -10
- package/dist/features/view-only-3/index.d.ts +7 -5
- package/dist/features/view-only-3/index.js +71 -16
- package/dist/features/view-only-3/index.jsx +71 -16
- package/package.json +1 -1
package/dist/app/constant.d.ts
CHANGED
|
@@ -277,6 +277,7 @@ export declare const test4: ({
|
|
|
277
277
|
seatCount: number;
|
|
278
278
|
uuid_table: string;
|
|
279
279
|
gapTags: number;
|
|
280
|
+
fontSize: number;
|
|
280
281
|
stroke?: undefined;
|
|
281
282
|
strokeWidth?: undefined;
|
|
282
283
|
text?: undefined;
|
|
@@ -296,6 +297,7 @@ export declare const test4: ({
|
|
|
296
297
|
width: number;
|
|
297
298
|
height: number;
|
|
298
299
|
gapTags: number;
|
|
300
|
+
fontSize: number;
|
|
299
301
|
labels: {
|
|
300
302
|
x: number;
|
|
301
303
|
y: number;
|
|
@@ -347,11 +349,12 @@ export declare const data4: ({
|
|
|
347
349
|
x: number;
|
|
348
350
|
y: number;
|
|
349
351
|
labels: {
|
|
352
|
+
label: string;
|
|
353
|
+
fontColor: string;
|
|
350
354
|
x: number;
|
|
351
355
|
y: number;
|
|
352
|
-
label: string;
|
|
353
356
|
fontSize: number;
|
|
354
|
-
|
|
357
|
+
rotation: number;
|
|
355
358
|
}[];
|
|
356
359
|
id: string;
|
|
357
360
|
stroke: string;
|
|
@@ -418,19 +421,15 @@ export declare const data4: ({
|
|
|
418
421
|
})[];
|
|
419
422
|
opacity: number;
|
|
420
423
|
rotation: number;
|
|
421
|
-
seatCount: number;
|
|
422
424
|
openSpace: number;
|
|
423
425
|
seatFill: string;
|
|
424
|
-
|
|
425
|
-
top: number;
|
|
426
|
-
bottom: number;
|
|
427
|
-
left: number;
|
|
428
|
-
right: number;
|
|
429
|
-
};
|
|
426
|
+
fontSize: number;
|
|
430
427
|
radius?: undefined;
|
|
428
|
+
seatCount?: undefined;
|
|
431
429
|
};
|
|
432
430
|
} | {
|
|
433
431
|
status: number;
|
|
432
|
+
capacity: number;
|
|
434
433
|
properties: {
|
|
435
434
|
x: number;
|
|
436
435
|
y: number;
|
|
@@ -512,19 +511,20 @@ export declare const data4: ({
|
|
|
512
511
|
offsetX?: undefined;
|
|
513
512
|
offsetY?: undefined;
|
|
514
513
|
})[];
|
|
515
|
-
seatPositions: {
|
|
516
|
-
top: number;
|
|
517
|
-
bottom: number;
|
|
518
|
-
left: number;
|
|
519
|
-
right: number;
|
|
520
|
-
};
|
|
521
514
|
opacity: number;
|
|
522
515
|
rotation: number;
|
|
523
|
-
|
|
524
|
-
|
|
516
|
+
labels: {
|
|
517
|
+
label: string;
|
|
518
|
+
fontColor: string;
|
|
519
|
+
x: number;
|
|
520
|
+
y: number;
|
|
521
|
+
fontSize: number;
|
|
522
|
+
rotation: number;
|
|
523
|
+
}[];
|
|
524
|
+
fontSize?: undefined;
|
|
525
|
+
seatCount?: undefined;
|
|
525
526
|
};
|
|
526
527
|
uuid_table?: undefined;
|
|
527
|
-
capacity?: undefined;
|
|
528
528
|
} | {
|
|
529
529
|
properties: {
|
|
530
530
|
x: number;
|
|
@@ -580,7 +580,7 @@ export declare const data4: ({
|
|
|
580
580
|
seatCount: number;
|
|
581
581
|
openSpace?: undefined;
|
|
582
582
|
seatFill?: undefined;
|
|
583
|
-
|
|
583
|
+
fontSize?: undefined;
|
|
584
584
|
radius?: undefined;
|
|
585
585
|
};
|
|
586
586
|
uuid_table?: undefined;
|
package/dist/app/constant.js
CHANGED
|
@@ -3437,7 +3437,8 @@ export const test4 = [
|
|
|
3437
3437
|
seatCount: 0,
|
|
3438
3438
|
uuid_table: "d088bba0-e990-410e-aea9-08548175a0b9",
|
|
3439
3439
|
gapTags: 20,
|
|
3440
|
-
|
|
3440
|
+
fontSize: 30,
|
|
3441
|
+
},
|
|
3441
3442
|
},
|
|
3442
3443
|
{
|
|
3443
3444
|
status: 1,
|
|
@@ -3455,6 +3456,7 @@ export const test4 = [
|
|
|
3455
3456
|
height: 100,
|
|
3456
3457
|
gapTags: 20, //gap antara tags secara vertical,
|
|
3457
3458
|
// status: "hold",
|
|
3459
|
+
fontSize: 20,
|
|
3458
3460
|
labels: [
|
|
3459
3461
|
{
|
|
3460
3462
|
x: 0,
|
|
@@ -3527,17 +3529,18 @@ export const data4 = [
|
|
|
3527
3529
|
{
|
|
3528
3530
|
uuid_table: "axxxxx",
|
|
3529
3531
|
status: 0,
|
|
3530
|
-
capacity:
|
|
3532
|
+
capacity: 4,
|
|
3531
3533
|
properties: {
|
|
3532
3534
|
x: 500,
|
|
3533
3535
|
y: 520,
|
|
3534
3536
|
labels: [
|
|
3535
3537
|
{
|
|
3538
|
+
label: "3",
|
|
3539
|
+
fontColor: "#000000",
|
|
3536
3540
|
x: 0,
|
|
3537
|
-
y:
|
|
3538
|
-
label: "New Table 5",
|
|
3541
|
+
y: 0,
|
|
3539
3542
|
fontSize: 12,
|
|
3540
|
-
|
|
3543
|
+
rotation: 0,
|
|
3541
3544
|
},
|
|
3542
3545
|
],
|
|
3543
3546
|
id: "1761194669729132000",
|
|
@@ -3613,15 +3616,16 @@ export const data4 = [
|
|
|
3613
3616
|
],
|
|
3614
3617
|
opacity: 1,
|
|
3615
3618
|
rotation: 0,
|
|
3616
|
-
seatCount: 10,
|
|
3619
|
+
// seatCount: 10,
|
|
3617
3620
|
openSpace: 0.3,
|
|
3618
3621
|
seatFill: "#ed8989",
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3622
|
+
fontSize: 50,
|
|
3623
|
+
// seatPositions: {
|
|
3624
|
+
// top: 3,
|
|
3625
|
+
// bottom: 3,
|
|
3626
|
+
// left: 3,
|
|
3627
|
+
// right: 3,
|
|
3628
|
+
// },
|
|
3625
3629
|
},
|
|
3626
3630
|
},
|
|
3627
3631
|
// {
|
|
@@ -3881,6 +3885,7 @@ export const data4 = [
|
|
|
3881
3885
|
// },
|
|
3882
3886
|
{
|
|
3883
3887
|
status: 2,
|
|
3888
|
+
capacity: 4,
|
|
3884
3889
|
properties: {
|
|
3885
3890
|
x: 100,
|
|
3886
3891
|
y: 100,
|
|
@@ -3959,15 +3964,25 @@ export const data4 = [
|
|
|
3959
3964
|
gap: 2,
|
|
3960
3965
|
},
|
|
3961
3966
|
],
|
|
3962
|
-
seatPositions: {
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
},
|
|
3967
|
+
// seatPositions: {
|
|
3968
|
+
// top: 1,
|
|
3969
|
+
// bottom: 1,
|
|
3970
|
+
// left: 1,
|
|
3971
|
+
// right: 1,
|
|
3972
|
+
// },
|
|
3968
3973
|
opacity: 1,
|
|
3969
3974
|
rotation: 0,
|
|
3970
|
-
|
|
3975
|
+
labels: [
|
|
3976
|
+
{
|
|
3977
|
+
label: "3",
|
|
3978
|
+
fontColor: "#000000",
|
|
3979
|
+
x: 0,
|
|
3980
|
+
y: 0,
|
|
3981
|
+
fontSize: 12,
|
|
3982
|
+
rotation: 0,
|
|
3983
|
+
},
|
|
3984
|
+
],
|
|
3985
|
+
// seatCount: 6,
|
|
3971
3986
|
},
|
|
3972
3987
|
},
|
|
3973
3988
|
{
|
|
@@ -5569,7 +5584,7 @@ export const dummyExtra6 = [
|
|
|
5569
5584
|
{
|
|
5570
5585
|
x: 100,
|
|
5571
5586
|
y: 100,
|
|
5572
|
-
id:
|
|
5587
|
+
id: "1754137739279",
|
|
5573
5588
|
src: "https://cdn.table.link/prod/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/68d45207-d66b-4bb5-92a2-4e5a87715e98/rsvp/1754137739126863915_BOI Reg.png",
|
|
5574
5589
|
fill: "red",
|
|
5575
5590
|
// image:
|
|
@@ -174,7 +174,7 @@ const TouchScrollDetect = () => {
|
|
|
174
174
|
key: "rsvp_time",
|
|
175
175
|
items: ["text", "icon"],
|
|
176
176
|
},
|
|
177
|
-
], defaultBackground: "#000000", mappingKey: "properties", componentProps: [], onDrop: (e, data) => handleDrop(e, data), onSwitch: (e, data) => handleSwitch(e, data), extraComponentProps: [], onSelectComponent: (component) => {
|
|
177
|
+
], defaultBackground: "#000000", mappingKey: "properties", componentProps: [], onDoubleClick: (data) => console.log(data), onDrop: (e, data) => handleDrop(e, data), onSwitch: (e, data) => handleSwitch(e, data), extraComponentProps: [], onSelectComponent: (component) => {
|
|
178
178
|
handleSelectTable(component);
|
|
179
179
|
}, dragTableBlockKey: [
|
|
180
180
|
{
|
|
@@ -216,8 +216,10 @@ const TouchScrollDetect = () => {
|
|
|
216
216
|
icon: _jsx(UserIcon, {}),
|
|
217
217
|
key: "user",
|
|
218
218
|
},
|
|
219
|
-
],
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
],
|
|
220
|
+
// viewStyles={{
|
|
221
|
+
// paddingTop: 10,
|
|
222
|
+
// }}
|
|
223
|
+
transformProps: {} })] })] })] }));
|
|
222
224
|
};
|
|
223
225
|
export default TouchScrollDetect;
|
|
@@ -198,7 +198,7 @@ const TouchScrollDetect = () => {
|
|
|
198
198
|
key: "rsvp_time",
|
|
199
199
|
items: ["text", "icon"],
|
|
200
200
|
},
|
|
201
|
-
]} defaultBackground="#000000" mappingKey="properties" componentProps={[]} onDrop={(e, data) => handleDrop(e, data)} onSwitch={(e, data) => handleSwitch(e, data)} extraComponentProps={[]} onSelectComponent={(component) => {
|
|
201
|
+
]} defaultBackground="#000000" mappingKey="properties" componentProps={[]} onDoubleClick={(data) => console.log(data)} onDrop={(e, data) => handleDrop(e, data)} onSwitch={(e, data) => handleSwitch(e, data)} extraComponentProps={[]} onSelectComponent={(component) => {
|
|
202
202
|
handleSelectTable(component);
|
|
203
203
|
}} dragTableBlockKey={[
|
|
204
204
|
{
|
|
@@ -240,9 +240,11 @@ const TouchScrollDetect = () => {
|
|
|
240
240
|
icon: <UserIcon />,
|
|
241
241
|
key: "user",
|
|
242
242
|
},
|
|
243
|
-
]}
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
]}
|
|
244
|
+
// viewStyles={{
|
|
245
|
+
// paddingTop: 10,
|
|
246
|
+
// }}
|
|
247
|
+
transformProps={{}}/>
|
|
246
248
|
</div>
|
|
247
249
|
</div>
|
|
248
250
|
</div>);
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { Button, ColorPicker, Flex, Form, Input, InputNumber, Divider } from "antd";
|
|
3
|
+
import { Button, ColorPicker, Flex, Form, Input, InputNumber, Divider, } from "antd";
|
|
4
4
|
const SectionLabel = () => {
|
|
5
|
-
return (_jsxs("div", { className: "py-2", children: [_jsx("h1", { className: "heading-s", children: "Section Labeling" }), _jsx(Divider, { style: { margin: 4 } }), _jsx(Form.Item, { label: "Labels in table", name: "labels", className: "w-full", children: _jsx(Form.List, { name: "labels", children: (fields, { add, remove }) => (_jsxs(_Fragment, { children: [fields.map((field) => (_jsxs("div", { className: "w-full", children: [_jsx(Flex, { gap: 5, className: "w-full flex justify-between", children: _jsx(Form.Item, { name: [field.name, "label"], label: "Text", className: "w-full", children: _jsx(Input, {}) }) }), _jsxs(Flex, { gap: 5, className: "w-full flex justify-between", children: [_jsx(Form.Item, { name: [field.name, "x"], label: "Position X", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { name: [field.name, "y"], label: "Position Y", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { name: [field.name, "rotation"], label: "Rotation", children: _jsx(InputNumber, { suffix: "\u00B0", min: 0, max: 360, parser: (value) => {
|
|
5
|
+
return (_jsxs("div", { className: "py-2", children: [_jsx("h1", { className: "heading-s", children: "Section Labeling" }), _jsx(Divider, { style: { margin: 4 } }), _jsx(Form.Item, { label: "Labels in table", name: "labels", className: "w-full", children: _jsx(Form.List, { name: "labels", children: (fields, { add, remove }) => (_jsxs(_Fragment, { children: [fields.map((field) => (_jsxs("div", { className: "w-full flex-col mb-2", children: [_jsx(Flex, { gap: 5, className: "w-full flex justify-between", children: _jsx(Form.Item, { name: [field.name, "label"], label: "Text", className: "w-full", children: _jsx(Input, {}) }) }), _jsxs(Flex, { gap: 5, className: "w-full flex justify-between", children: [_jsx(Form.Item, { name: [field.name, "x"], label: "Position X", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { name: [field.name, "y"], label: "Position Y", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { name: [field.name, "rotation"], label: "Rotation", children: _jsx(InputNumber, { suffix: "\u00B0", min: 0, max: 360, parser: (value) => {
|
|
6
6
|
if (!value)
|
|
7
7
|
return 0;
|
|
8
8
|
const num = Number(value.replace(/\D/g, ""));
|
|
9
9
|
if (Number.isNaN(num))
|
|
10
10
|
return 0;
|
|
11
11
|
return Math.min(360, Math.max(0, num));
|
|
12
|
-
} }) })] }), _jsxs(Flex, { gap: 5, children: [_jsx(Form.Item, { name: [field.name, "fontSize"], label: "Size", children: _jsx(InputNumber, { suffix: "px" }) }), _jsx(Form.Item, { name: [field.name, "fontColor"], label: "Color", getValueFromEvent: (color) => color.toHexString(), children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) })] })
|
|
13
|
-
// type="dashed"
|
|
14
|
-
, {
|
|
12
|
+
} }) })] }), _jsxs(Flex, { gap: 5, children: [_jsx(Form.Item, { name: [field.name, "fontSize"], label: "Size", children: _jsx(InputNumber, { suffix: "px" }) }), _jsx(Form.Item, { name: [field.name, "fontColor"], label: "Color", getValueFromEvent: (color) => color.toHexString(), children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) })] }), fields.length < 2 && (_jsx(Flex, { gap: 2, className: "w-full", children: _jsx(Button
|
|
15
13
|
// type="dashed"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
, {
|
|
15
|
+
// type="dashed"
|
|
16
|
+
onClick: () => remove(fields.indexOf(field)), className: "w-full", children: "Remove" }) }))] }, field.key))), _jsx(Flex, { gap: 2, className: "w-full mt-2", children: _jsx(Button, { type: "primary", onClick: () => add({
|
|
17
|
+
label: "",
|
|
18
|
+
fontColor: "#000000",
|
|
19
|
+
x: 0,
|
|
20
|
+
y: 0,
|
|
21
|
+
fontSize: 12,
|
|
22
|
+
rotation: 0,
|
|
23
|
+
}), className: "w-full", children: "Add" }) })] })) }) }), _jsx("div", { className: "divider-dashed" })] }));
|
|
24
24
|
};
|
|
25
25
|
export default SectionLabel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Button, ColorPicker, Flex, Form, Input, InputNumber, Divider } from "antd";
|
|
2
|
+
import { Button, ColorPicker, Flex, Form, Input, InputNumber, Divider, } from "antd";
|
|
3
3
|
const SectionLabel = () => {
|
|
4
4
|
return (<div className="py-2">
|
|
5
5
|
<h1 className="heading-s">Section Labeling</h1>
|
|
@@ -8,12 +8,11 @@ const SectionLabel = () => {
|
|
|
8
8
|
<Form.Item label="Labels in table" name={"labels"} className="w-full">
|
|
9
9
|
<Form.List name="labels">
|
|
10
10
|
{(fields, { add, remove }) => (<>
|
|
11
|
-
{fields.map((field) => (<div key={field.key} className="w-full">
|
|
11
|
+
{fields.map((field) => (<div key={field.key} className="w-full flex-col mb-2">
|
|
12
12
|
<Flex gap={5} className="w-full flex justify-between">
|
|
13
13
|
<Form.Item name={[field.name, "label"]} label="Text" className="w-full">
|
|
14
14
|
<Input />
|
|
15
15
|
</Form.Item>
|
|
16
|
-
|
|
17
16
|
</Flex>
|
|
18
17
|
<Flex gap={5} className="w-full flex justify-between">
|
|
19
18
|
<Form.Item name={[field.name, "x"]} label="Position X">
|
|
@@ -41,21 +40,29 @@ const SectionLabel = () => {
|
|
|
41
40
|
<ColorPicker allowClear format="hex" defaultFormat="hex"/>
|
|
42
41
|
</Form.Item>
|
|
43
42
|
</Flex>
|
|
43
|
+
{fields.length < 2 && (<Flex gap={2} className="w-full">
|
|
44
|
+
<Button
|
|
45
|
+
// type="dashed"
|
|
46
|
+
onClick={() => remove(fields.indexOf(field))} className="w-full">
|
|
47
|
+
Remove
|
|
48
|
+
</Button>
|
|
49
|
+
</Flex>)}
|
|
44
50
|
</div>))}
|
|
45
|
-
<Flex gap={2} className="w-full">
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
<Flex gap={2} className="w-full mt-2">
|
|
52
|
+
{/* <Button
|
|
53
|
+
// type="dashed"
|
|
54
|
+
onClick={() => remove(fields.length - 1)}
|
|
55
|
+
className="w-full"
|
|
56
|
+
>
|
|
57
|
+
Remove
|
|
58
|
+
</Button> */}
|
|
52
59
|
<Button type="primary" onClick={() => add({
|
|
53
60
|
label: "",
|
|
54
61
|
fontColor: "#000000",
|
|
55
62
|
x: 0,
|
|
56
63
|
y: 0,
|
|
57
64
|
fontSize: 12,
|
|
58
|
-
rotation: 0
|
|
65
|
+
rotation: 0,
|
|
59
66
|
})} className="w-full">
|
|
60
67
|
Add
|
|
61
68
|
</Button>
|
|
@@ -72,7 +72,7 @@ const SectionShape = ({ allowChangeShape = true, }) => {
|
|
|
72
72
|
const num = Number(cleaned);
|
|
73
73
|
if (Number.isNaN(num))
|
|
74
74
|
return null;
|
|
75
|
-
return Math.min(
|
|
75
|
+
return Math.min(100, Math.max(0, num));
|
|
76
76
|
}, suffix: "%" }) }) })] }));
|
|
77
77
|
};
|
|
78
78
|
export default SectionShape;
|
|
@@ -117,7 +117,7 @@ const SectionShape = ({ allowChangeShape = true, }) => {
|
|
|
117
117
|
const num = Number(cleaned);
|
|
118
118
|
if (Number.isNaN(num))
|
|
119
119
|
return null;
|
|
120
|
-
return Math.min(
|
|
120
|
+
return Math.min(100, Math.max(0, num));
|
|
121
121
|
}} suffix="%"/>
|
|
122
122
|
</Form.Item>
|
|
123
123
|
</Flex>
|
|
@@ -139,10 +139,11 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
|
|
|
139
139
|
const iconTag = icons === null || icons === void 0 ? void 0 : icons.find((icon) => icon.key === item.value);
|
|
140
140
|
if (!iconTag)
|
|
141
141
|
return null;
|
|
142
|
-
|
|
142
|
+
const scale = defaultFontSize / 12;
|
|
143
|
+
return (_createElement("g", Object.assign({}, item, { key: `icon-${tagIndex}-${i}`, transform: `translate(${posX - defaultFontSize}, ${posY - defaultFontSize / 2}) scale(${scale})` }), iconTag.icon));
|
|
143
144
|
}
|
|
144
145
|
if (item.type === "text") {
|
|
145
|
-
return (_createElement("text", Object.assign({}, item, { key: `text-${tagIndex}-${i}`, x: posX, y: posY, textAnchor: "middle", dominantBaseline: "middle", fontSize:
|
|
146
|
+
return (_createElement("text", Object.assign({}, item, { key: `text-${tagIndex}-${i}`, x: posX, y: posY, textAnchor: "middle", dominantBaseline: "middle", fontSize: defaultFontSize }),
|
|
146
147
|
item.value,
|
|
147
148
|
" ",
|
|
148
149
|
renderSymbol(item === null || item === void 0 ? void 0 : item.symbol)));
|
|
@@ -139,12 +139,13 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
|
|
|
139
139
|
const iconTag = icons === null || icons === void 0 ? void 0 : icons.find((icon) => icon.key === item.value);
|
|
140
140
|
if (!iconTag)
|
|
141
141
|
return null;
|
|
142
|
-
|
|
142
|
+
const scale = defaultFontSize / 12;
|
|
143
|
+
return (<g {...item} key={`icon-${tagIndex}-${i}`} transform={`translate(${posX - defaultFontSize}, ${posY - defaultFontSize / 2}) scale(${scale})`}>
|
|
143
144
|
{iconTag.icon}
|
|
144
145
|
</g>);
|
|
145
146
|
}
|
|
146
147
|
if (item.type === "text") {
|
|
147
|
-
return (<text {...item} key={`text-${tagIndex}-${i}`} x={posX} y={posY} textAnchor="middle" dominantBaseline="middle" fontSize={
|
|
148
|
+
return (<text {...item} key={`text-${tagIndex}-${i}`} x={posX} y={posY} textAnchor="middle" dominantBaseline="middle" fontSize={defaultFontSize}>
|
|
148
149
|
{item.value} {renderSymbol(item === null || item === void 0 ? void 0 : item.symbol)}
|
|
149
150
|
</text>);
|
|
150
151
|
}
|
|
@@ -210,14 +210,14 @@ const boardSlice = createSlice({
|
|
|
210
210
|
state.pointer -= 1;
|
|
211
211
|
}
|
|
212
212
|
const prev = state.historyChanges[state.pointer];
|
|
213
|
-
state.components =
|
|
214
|
-
state.extraComponents =
|
|
213
|
+
state.components = prev === null || prev === void 0 ? void 0 : prev.components;
|
|
214
|
+
state.extraComponents = prev === null || prev === void 0 ? void 0 : prev.extraComponents;
|
|
215
215
|
state.boundingBox = prev === null || prev === void 0 ? void 0 : prev.boundingBox;
|
|
216
216
|
state.backgroundColor = prev === null || prev === void 0 ? void 0 : prev.backgroundColor;
|
|
217
217
|
}
|
|
218
218
|
else if (state.pointer === 1) {
|
|
219
|
-
state.components =
|
|
220
|
-
state.extraComponents =
|
|
219
|
+
state.components = (_b = (_a = state.historyChanges) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.components;
|
|
220
|
+
state.extraComponents = (_d = (_c = state.historyChanges) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.extraComponents;
|
|
221
221
|
state.boundingBox = (_f = (_e = state.historyChanges) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.boundingBox;
|
|
222
222
|
state.backgroundColor = (_h = (_g = state.historyChanges) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.backgroundColor;
|
|
223
223
|
state.pointer = 0;
|
|
@@ -340,7 +340,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
|
340
340
|
const isInitialCreateElemente = toolElement.includes(activeTool) && !isCreateElementRef.current;
|
|
341
341
|
const isInitialCreateBoundingBox = activeTool === "bounding-box";
|
|
342
342
|
const isInitialCreateText = activeTool === "text" && !isCreateElementRef.current;
|
|
343
|
-
console.log({
|
|
343
|
+
// console.log({isInitialCreateText,},isCreateElementRef.current)
|
|
344
344
|
if (isInitialCreateElemente) {
|
|
345
345
|
const tables = createTableGhost({
|
|
346
346
|
x,
|
|
@@ -432,7 +432,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
|
432
432
|
hadSelectionRef.current = true;
|
|
433
433
|
}
|
|
434
434
|
if (downOutSelectionBox) {
|
|
435
|
-
console.log("downOutSelectionBox");
|
|
435
|
+
// console.log("downOutSelectionBox");
|
|
436
436
|
hadSelectionRef.current = false;
|
|
437
437
|
onMoveSelectionBoxRef.current = false;
|
|
438
438
|
handleUnSelectComponent();
|
|
@@ -854,6 +854,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
|
854
854
|
const activeId = selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id;
|
|
855
855
|
const svg = svgRef.current;
|
|
856
856
|
const { g, element, seats, seatGroup } = getAttributeElement(svg, activeId);
|
|
857
|
+
const isZeroRotate = (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.rotation) === 0 && !(selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.shape.includes("circle"));
|
|
857
858
|
const elementSelect = {
|
|
858
859
|
x: selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.x,
|
|
859
860
|
y: selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.y,
|
|
@@ -878,6 +879,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
|
878
879
|
dy,
|
|
879
880
|
rotate: 0,
|
|
880
881
|
handle: resizeSide,
|
|
882
|
+
isZeroRotate,
|
|
881
883
|
});
|
|
882
884
|
updateSelectionGuides(svg, resultSelection, {
|
|
883
885
|
vLeft: "v-left",
|
|
@@ -890,8 +892,26 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
|
890
892
|
updateSelectionBox(svg, resultSelection, activeId);
|
|
891
893
|
const scaleX = resultSelection.width / oldSel.width;
|
|
892
894
|
const scaleY = resultSelection.height / oldSel.height;
|
|
893
|
-
|
|
894
|
-
|
|
895
|
+
let newWidth = elementSelect.width * scaleX;
|
|
896
|
+
let newHeight = elementSelect.height * scaleY;
|
|
897
|
+
if (isZeroRotate) {
|
|
898
|
+
if (resizeSide === "right") {
|
|
899
|
+
newWidth = elementSelect.width + dx;
|
|
900
|
+
newHeight = elementSelect.height;
|
|
901
|
+
}
|
|
902
|
+
else if (resizeSide === "bottom") {
|
|
903
|
+
newWidth = elementSelect.width;
|
|
904
|
+
newHeight = elementSelect.height + dy;
|
|
905
|
+
}
|
|
906
|
+
else if (resizeSide === "left") {
|
|
907
|
+
newWidth = elementSelect.width - dx;
|
|
908
|
+
newHeight = elementSelect.height;
|
|
909
|
+
}
|
|
910
|
+
else if (resizeSide === "top") {
|
|
911
|
+
newWidth = elementSelect.width;
|
|
912
|
+
newHeight = elementSelect.height - dy;
|
|
913
|
+
}
|
|
914
|
+
}
|
|
895
915
|
// Jarak relatif element dari pojok kiri atas selection (sebelum resize)
|
|
896
916
|
const relativeX = elementSelect.x - oldSel.x;
|
|
897
917
|
const relativeY = elementSelect.y - oldSel.y;
|
|
@@ -339,7 +339,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
|
339
339
|
const isInitialCreateElemente = toolElement.includes(activeTool) && !isCreateElementRef.current;
|
|
340
340
|
const isInitialCreateBoundingBox = activeTool === "bounding-box";
|
|
341
341
|
const isInitialCreateText = activeTool === "text" && !isCreateElementRef.current;
|
|
342
|
-
console.log({
|
|
342
|
+
// console.log({isInitialCreateText,},isCreateElementRef.current)
|
|
343
343
|
if (isInitialCreateElemente) {
|
|
344
344
|
const tables = createTableGhost({
|
|
345
345
|
x,
|
|
@@ -431,7 +431,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
|
431
431
|
hadSelectionRef.current = true;
|
|
432
432
|
}
|
|
433
433
|
if (downOutSelectionBox) {
|
|
434
|
-
console.log("downOutSelectionBox");
|
|
434
|
+
// console.log("downOutSelectionBox");
|
|
435
435
|
hadSelectionRef.current = false;
|
|
436
436
|
onMoveSelectionBoxRef.current = false;
|
|
437
437
|
handleUnSelectComponent();
|
|
@@ -853,6 +853,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
|
853
853
|
const activeId = selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id;
|
|
854
854
|
const svg = svgRef.current;
|
|
855
855
|
const { g, element, seats, seatGroup } = getAttributeElement(svg, activeId);
|
|
856
|
+
const isZeroRotate = (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.rotation) === 0 && !(selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.shape.includes("circle"));
|
|
856
857
|
const elementSelect = {
|
|
857
858
|
x: selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.x,
|
|
858
859
|
y: selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.y,
|
|
@@ -877,6 +878,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
|
877
878
|
dy,
|
|
878
879
|
rotate: 0,
|
|
879
880
|
handle: resizeSide,
|
|
881
|
+
isZeroRotate,
|
|
880
882
|
});
|
|
881
883
|
updateSelectionGuides(svg, resultSelection, {
|
|
882
884
|
vLeft: "v-left",
|
|
@@ -889,8 +891,26 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
|
889
891
|
updateSelectionBox(svg, resultSelection, activeId);
|
|
890
892
|
const scaleX = resultSelection.width / oldSel.width;
|
|
891
893
|
const scaleY = resultSelection.height / oldSel.height;
|
|
892
|
-
|
|
893
|
-
|
|
894
|
+
let newWidth = elementSelect.width * scaleX;
|
|
895
|
+
let newHeight = elementSelect.height * scaleY;
|
|
896
|
+
if (isZeroRotate) {
|
|
897
|
+
if (resizeSide === "right") {
|
|
898
|
+
newWidth = elementSelect.width + dx;
|
|
899
|
+
newHeight = elementSelect.height;
|
|
900
|
+
}
|
|
901
|
+
else if (resizeSide === "bottom") {
|
|
902
|
+
newWidth = elementSelect.width;
|
|
903
|
+
newHeight = elementSelect.height + dy;
|
|
904
|
+
}
|
|
905
|
+
else if (resizeSide === "left") {
|
|
906
|
+
newWidth = elementSelect.width - dx;
|
|
907
|
+
newHeight = elementSelect.height;
|
|
908
|
+
}
|
|
909
|
+
else if (resizeSide === "top") {
|
|
910
|
+
newWidth = elementSelect.width;
|
|
911
|
+
newHeight = elementSelect.height - dy;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
894
914
|
// Jarak relatif element dari pojok kiri atas selection (sebelum resize)
|
|
895
915
|
const relativeX = elementSelect.x - oldSel.x;
|
|
896
916
|
const relativeY = elementSelect.y - oldSel.y;
|
|
@@ -9,7 +9,7 @@ export declare const resizeElementSelection: ({ selectionStart, currentSelection
|
|
|
9
9
|
width: number;
|
|
10
10
|
height: number;
|
|
11
11
|
};
|
|
12
|
-
export declare function resizeBox({ box, dx, dy, rotate, handle }: {
|
|
12
|
+
export declare function resizeBox({ box, dx, dy, rotate, handle, isZeroRotate, }: {
|
|
13
13
|
box: {
|
|
14
14
|
x: number;
|
|
15
15
|
y: number;
|
|
@@ -20,6 +20,7 @@ export declare function resizeBox({ box, dx, dy, rotate, handle }: {
|
|
|
20
20
|
dy: number;
|
|
21
21
|
rotate: number;
|
|
22
22
|
handle: ResizeHandle;
|
|
23
|
+
isZeroRotate?: boolean;
|
|
23
24
|
}): {
|
|
24
25
|
x: number;
|
|
25
26
|
y: number;
|