seat-editor 3.0.0 → 3.0.2
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/layout.d.ts +1 -1
- package/dist/app/{layout.js → layout.jsx} +7 -2
- package/dist/app/new-board/page.d.ts +1 -1
- package/dist/app/new-board/page.jsx +55 -0
- package/dist/app/old-board/page.d.ts +2 -1
- package/dist/app/old-board/{page.js → page.jsx} +215 -82
- package/dist/app/only-view/chair.d.ts +1 -1
- package/dist/app/only-view/chair.js +10 -2
- package/dist/app/only-view/page.d.ts +1 -1
- package/dist/app/only-view/page.jsx +101 -0
- package/dist/app/only-view/user.d.ts +1 -1
- package/dist/app/only-view/user.js +10 -2
- package/dist/app/page.d.ts +1 -1
- package/dist/app/page.jsx +13 -0
- package/dist/app/test/page.d.ts +2 -1
- package/dist/app/test/{page.js → page.jsx} +5 -3
- package/dist/app/v2/page.d.ts +1 -1
- package/dist/app/v2/page.jsx +13 -0
- package/dist/components/button-tools/index.d.ts +1 -1
- package/dist/components/button-tools/index.jsx +17 -0
- package/dist/components/form-tools/label.d.ts +1 -1
- package/dist/components/form-tools/label.jsx +44 -0
- package/dist/components/form-tools/shape.d.ts +1 -1
- package/dist/components/form-tools/shape.jsx +66 -0
- package/dist/components/input/number-indicator.d.ts +1 -1
- package/dist/components/input/{number-indicator.js → number-indicator.jsx} +11 -2
- package/dist/components/joystick/index.d.ts +2 -1
- package/dist/components/joystick/{index.js → index.jsx} +14 -13
- package/dist/components/layer/index.d.ts +1 -1
- package/dist/components/layer/index.jsx +383 -0
- package/dist/components/layer-v2/index.d.ts +1 -1
- package/dist/components/layer-v2/index.jsx +370 -0
- package/dist/components/layer-v3/index.d.ts +1 -1
- package/dist/components/layer-v3/{index.js → index.jsx} +242 -102
- package/dist/components/layer-v4/index.d.ts +1 -1
- package/dist/components/layer-v4/{index.js → index.jsx} +157 -80
- package/dist/components/lib/index.d.ts +1 -1
- package/dist/components/lib/{index.js → index.jsx} +7 -2
- package/dist/components/modal-preview/index.d.ts +1 -1
- package/dist/components/modal-preview/index.jsx +11 -0
- package/dist/features/board/index.d.ts +1 -1
- package/dist/features/board/{index.js → index.jsx} +90 -31
- package/dist/features/board-v2/index.d.ts +2 -1
- package/dist/features/board-v2/{index.js → index.jsx} +101 -39
- package/dist/features/board-v3/index copy.d.ts +2 -1
- package/dist/features/board-v3/{index copy.js → index copy.jsx } +128 -50
- package/dist/features/board-v3/index.d.ts +2 -1
- package/dist/features/board-v3/{index.js → index.jsx} +110 -32
- package/dist/features/navbar/index.d.ts +1 -1
- package/dist/features/navbar/index.jsx +5 -0
- package/dist/features/package/index.d.ts +1 -1
- package/dist/features/package/{index.js → index.jsx} +16 -6
- package/dist/features/panel/index.d.ts +1 -1
- package/dist/features/panel/{index.js → index.jsx} +25 -7
- package/dist/features/panel/select-tool.d.ts +1 -1
- package/dist/features/panel/{select-tool.js → select-tool.jsx} +23 -10
- package/dist/features/panel/selected-group.d.ts +1 -1
- package/dist/features/panel/selected-group.jsx +47 -0
- package/dist/features/panel/square-circle-tool.d.ts +1 -1
- package/dist/features/panel/{square-circle-tool.js → square-circle-tool.jsx} +4 -2
- package/dist/features/panel/table-seat-circle.d.ts +1 -1
- package/dist/features/panel/table-seat-circle.jsx +31 -0
- package/dist/features/panel/table-seat-square.d.ts +1 -1
- package/dist/features/panel/table-seat-square.jsx +46 -0
- package/dist/features/panel/text-tool.d.ts +1 -1
- package/dist/features/panel/text-tool.jsx +26 -0
- package/dist/features/panel/upload-tool.d.ts +1 -1
- package/dist/features/panel/{upload-tool.js → upload-tool.jsx} +24 -2
- package/dist/features/side-tool/index.d.ts +1 -1
- package/dist/features/side-tool/{index.js → index.jsx} +120 -98
- package/dist/features/view-only/index.d.ts +1 -1
- package/dist/features/view-only/{index.js → index.jsx} +38 -31
- package/dist/features/view-only-2/index.d.ts +1 -1
- package/dist/features/view-only-2/{index.js → index.jsx} +16 -13
- package/dist/features/view-only-3/index.d.ts +1 -1
- package/dist/features/view-only-3/{index.js → index.jsx} +46 -27
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/provider/antd-provider.jsx +46 -0
- package/dist/provider/redux-provider.d.ts +1 -1
- package/dist/provider/{redux-provider.js → redux-provider.jsx} +1 -2
- package/dist/provider/store-provider.d.ts +1 -1
- package/dist/provider/{store-provider.js → store-provider.jsx} +3 -2
- package/package.json +1 -1
- package/dist/app/new-board/page.js +0 -33
- package/dist/app/only-view/page.js +0 -78
- package/dist/app/page.js +0 -8
- package/dist/app/v2/page.js +0 -8
- package/dist/components/button-tools/index.js +0 -11
- package/dist/components/form-tools/label.js +0 -7
- package/dist/components/form-tools/shape.js +0 -25
- package/dist/components/layer/index.js +0 -295
- package/dist/components/layer-v2/index.js +0 -282
- package/dist/components/modal-preview/index.js +0 -10
- package/dist/features/navbar/index.js +0 -6
- package/dist/features/panel/selected-group.js +0 -7
- package/dist/features/panel/table-seat-circle.js +0 -9
- package/dist/features/panel/table-seat-square.js +0 -9
- package/dist/features/panel/text-tool.js +0 -7
- package/dist/provider/antd-provider.js +0 -43
|
@@ -10,7 +10,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
13
|
import { useEffect, useRef, useState } from "react";
|
|
15
14
|
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
16
15
|
import { Form, Input } from "antd";
|
|
@@ -212,16 +211,16 @@ const ControlPanels = (props) => {
|
|
|
212
211
|
const renderFormPanel = () => {
|
|
213
212
|
switch (tool.active) {
|
|
214
213
|
case "select":
|
|
215
|
-
return (
|
|
214
|
+
return (<SelectToolForm action={action} responseMapping={responseMapping}/>);
|
|
216
215
|
case "square":
|
|
217
216
|
case "circle":
|
|
218
|
-
return
|
|
217
|
+
return <SquareToolForm />;
|
|
219
218
|
case "table-seat-circle":
|
|
220
|
-
return
|
|
219
|
+
return <SeatCircle />;
|
|
221
220
|
case "image-table":
|
|
222
|
-
return (
|
|
221
|
+
return (<UploadTool name={tool.active} type="component" action={action} responseMapping={responseMapping}/>);
|
|
223
222
|
case "background":
|
|
224
|
-
return (
|
|
223
|
+
return (<UploadTool name={tool.active} type="background" action={action} responseMapping={responseMapping}/>);
|
|
225
224
|
default:
|
|
226
225
|
return null;
|
|
227
226
|
}
|
|
@@ -235,6 +234,25 @@ const ControlPanels = (props) => {
|
|
|
235
234
|
});
|
|
236
235
|
};
|
|
237
236
|
// if(!show) return null
|
|
238
|
-
return (
|
|
237
|
+
return (<div className={clsx("w-[300px] h-full absolute top-0 z-50 transition-all duration-300 overflow-y-scroll ", open ? "right-0" : "right-[-300px]")}>
|
|
238
|
+
{/* <Drawer
|
|
239
|
+
open={show}
|
|
240
|
+
onClose={handleClose}
|
|
241
|
+
title="Panel"
|
|
242
|
+
styles={{
|
|
243
|
+
body: {
|
|
244
|
+
paddingBottom: 0,
|
|
245
|
+
},
|
|
246
|
+
}}
|
|
247
|
+
> */}
|
|
248
|
+
<div className="bg-white h-full max-h-screen w-full p-2 overflow-y-auto border-l border-gray-300">
|
|
249
|
+
<Form layout="vertical" form={form} name="table" onValuesChange={handleChangeComponent} initialValues={{ labels: [{}] }}>
|
|
250
|
+
<Form.Item name="id" hidden>
|
|
251
|
+
<Input />
|
|
252
|
+
</Form.Item>
|
|
253
|
+
{renderFormPanel()}
|
|
254
|
+
</Form>
|
|
255
|
+
</div>
|
|
256
|
+
</div>);
|
|
239
257
|
};
|
|
240
258
|
export default ControlPanels;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { useAppSelector } from "../../hooks/use-redux";
|
|
4
3
|
import SquareToolForm from "./square-circle-tool";
|
|
5
4
|
import SeatCircle from "./table-seat-circle";
|
|
@@ -26,33 +25,47 @@ const SelectToolForm = ({ title = "Title", action, responseMapping }) => {
|
|
|
26
25
|
.replace(/-/g, " ")
|
|
27
26
|
.replace(/\b\w/g, (char) => char.toUpperCase());
|
|
28
27
|
};
|
|
29
|
-
return (
|
|
28
|
+
return (<div className="flex flex-col">
|
|
29
|
+
<h1 className="heading-s">{title}</h1>
|
|
30
|
+
<div className="flex flex-col gap-2 mt-5">
|
|
31
|
+
{Object.entries(countByShape).map(([shape, count]) => (<div key={shape}>
|
|
32
|
+
<span className="font-bold">
|
|
33
|
+
{variableFormatToString(shape)}:
|
|
34
|
+
</span>{" "}
|
|
35
|
+
{count}
|
|
36
|
+
</div>))}
|
|
37
|
+
</div>
|
|
38
|
+
</div>);
|
|
30
39
|
};
|
|
31
40
|
const renderComponent = () => {
|
|
32
41
|
switch (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.shape) {
|
|
33
42
|
case "square":
|
|
34
43
|
case "circle":
|
|
35
|
-
return
|
|
44
|
+
return <SquareToolForm />;
|
|
36
45
|
case "table-seat-circle":
|
|
37
|
-
return
|
|
46
|
+
return <SeatCircle />;
|
|
38
47
|
case "table-seat-square":
|
|
39
|
-
return
|
|
48
|
+
return <SeatSquare />;
|
|
40
49
|
case "image-table":
|
|
41
50
|
case "background":
|
|
42
|
-
return (
|
|
51
|
+
return (<UploadTool action={action} responseMapping={responseMapping} name={selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.shape} defaultValue={selectedComponent} type={(selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.shape) === "background"
|
|
43
52
|
? "background"
|
|
44
|
-
: "component"
|
|
53
|
+
: "component"}/>);
|
|
45
54
|
case "text":
|
|
46
|
-
return
|
|
55
|
+
return <TextTool />;
|
|
47
56
|
default:
|
|
48
57
|
return null;
|
|
49
58
|
}
|
|
50
59
|
};
|
|
51
60
|
const renderSelectionComponent = () => {
|
|
52
61
|
if (selectedGroup) {
|
|
53
|
-
return (
|
|
62
|
+
return (<SelectedGroup />);
|
|
54
63
|
}
|
|
55
64
|
};
|
|
56
|
-
return (
|
|
65
|
+
return (<div className="flex flex-col gap-2">
|
|
66
|
+
<SummaryComponents />
|
|
67
|
+
{renderComponent()}
|
|
68
|
+
{renderSelectionComponent()}
|
|
69
|
+
</div>);
|
|
57
70
|
};
|
|
58
71
|
export default SelectToolForm;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SelectedGroup: () => import("react
|
|
1
|
+
declare const SelectedGroup: () => import("react").JSX.Element;
|
|
2
2
|
export default SelectedGroup;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ColorPicker, Flex, Form, InputNumber } from "antd";
|
|
3
|
+
const SelectedGroup = () => {
|
|
4
|
+
return (<>
|
|
5
|
+
<div className="py-2">
|
|
6
|
+
<h1 className="heading-s"> Group Selection</h1>
|
|
7
|
+
<div className="py-2">
|
|
8
|
+
<Flex gap={2} className="w-full">
|
|
9
|
+
<Form.Item label="Width" name="width" className="w-full">
|
|
10
|
+
<InputNumber suffix="px"/>
|
|
11
|
+
</Form.Item>
|
|
12
|
+
<Form.Item label="Height" name="height" className="w-full">
|
|
13
|
+
<InputNumber suffix="px"/>
|
|
14
|
+
</Form.Item>
|
|
15
|
+
</Flex>
|
|
16
|
+
<Flex gap={2}>
|
|
17
|
+
<Form.Item label="Position X" name="x" className="w-full">
|
|
18
|
+
<InputNumber />
|
|
19
|
+
</Form.Item>
|
|
20
|
+
<Form.Item label="Position Y" name="y" className="w-full">
|
|
21
|
+
<InputNumber />
|
|
22
|
+
</Form.Item>
|
|
23
|
+
<Form.Item label="Rotation" name="rotation" className="w-full">
|
|
24
|
+
<InputNumber max={360} min={0}/>
|
|
25
|
+
</Form.Item>
|
|
26
|
+
</Flex>
|
|
27
|
+
<Flex gap={2}>
|
|
28
|
+
<Form.Item label="Fill" name={"fill"} getValueFromEvent={(color) => color.toHexString()} className="w-full ">
|
|
29
|
+
<ColorPicker allowClear format="hex" defaultFormat="hex"/>
|
|
30
|
+
</Form.Item>
|
|
31
|
+
<Form.Item label="Stroke" name={"stroke"} getValueFromEvent={(color) => color.toHexString()} className="w-full ">
|
|
32
|
+
<ColorPicker allowClear format="hex" defaultFormat="hex"/>
|
|
33
|
+
</Form.Item>
|
|
34
|
+
</Flex>
|
|
35
|
+
<Flex>
|
|
36
|
+
<Form.Item label="Stroke Width" name={"strokeWidth"} className="w-full">
|
|
37
|
+
<InputNumber />
|
|
38
|
+
</Form.Item>
|
|
39
|
+
<Form.Item label="opacity" name={"opacity"} className="w-full">
|
|
40
|
+
<InputNumber step={0.1} max={1} min={0}/>
|
|
41
|
+
</Form.Item>
|
|
42
|
+
</Flex>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</>);
|
|
46
|
+
};
|
|
47
|
+
export default SelectedGroup;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SquareToolForm: () => import("react
|
|
1
|
+
declare const SquareToolForm: () => import("react").JSX.Element;
|
|
2
2
|
export default SquareToolForm;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
import SectionLabel from "../../components/form-tools/label";
|
|
4
3
|
import SectionShape from "../../components/form-tools/shape";
|
|
5
4
|
const SquareToolForm = () => {
|
|
6
|
-
return (
|
|
5
|
+
return (<>
|
|
6
|
+
<SectionShape />
|
|
7
|
+
<SectionLabel />
|
|
8
|
+
</>);
|
|
7
9
|
};
|
|
8
10
|
export default SquareToolForm;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SeatCircle: () => import("react
|
|
1
|
+
declare const SeatCircle: () => import("react").JSX.Element;
|
|
2
2
|
export default SeatCircle;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ColorPicker, Flex, Form, InputNumber } from "antd";
|
|
3
|
+
import SectionLabel from "../../components/form-tools/label";
|
|
4
|
+
import SectionShape from "../../components/form-tools/shape";
|
|
5
|
+
const SeatCircle = () => {
|
|
6
|
+
return (<>
|
|
7
|
+
<div className="py-2">
|
|
8
|
+
<h1 className="heading-s"> Round table</h1>
|
|
9
|
+
<Flex>
|
|
10
|
+
<Form.Item name="seatCount" label="Seat Count" className="w-full">
|
|
11
|
+
<InputNumber />
|
|
12
|
+
</Form.Item>
|
|
13
|
+
<Form.Item name="openSpace" label="Open Space" className="w-full">
|
|
14
|
+
<InputNumber max={1} min={0} step={0.1}/>
|
|
15
|
+
</Form.Item>
|
|
16
|
+
|
|
17
|
+
</Flex>
|
|
18
|
+
<Flex gap={2}>
|
|
19
|
+
<Form.Item label="Seat Fill" name={"seatFill"} getValueFromEvent={(color) => color.toHexString()} className="w-full ">
|
|
20
|
+
<ColorPicker allowClear format="hex" defaultFormat="hex"/>
|
|
21
|
+
</Form.Item>
|
|
22
|
+
<Form.Item label="Table Fill" name={"fill"} getValueFromEvent={(color) => color.toHexString()} className="w-full ">
|
|
23
|
+
<ColorPicker allowClear format="hex" defaultFormat="hex"/>
|
|
24
|
+
</Form.Item>
|
|
25
|
+
</Flex>
|
|
26
|
+
<SectionShape />
|
|
27
|
+
<SectionLabel />
|
|
28
|
+
</div>
|
|
29
|
+
</>);
|
|
30
|
+
};
|
|
31
|
+
export default SeatCircle;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SeatSquare: () => import("react
|
|
1
|
+
declare const SeatSquare: () => import("react").JSX.Element;
|
|
2
2
|
export default SeatSquare;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Col, ColorPicker, Flex, Form, InputNumber, Row, } from "antd";
|
|
3
|
+
import SectionLabel from "../../components/form-tools/label";
|
|
4
|
+
import SectionShape from "../../components/form-tools/shape";
|
|
5
|
+
const SeatSquare = () => {
|
|
6
|
+
return (<>
|
|
7
|
+
<div className="py-2">
|
|
8
|
+
<h1 className="heading-s"> Square table</h1>
|
|
9
|
+
<Flex className="w-full">
|
|
10
|
+
<Form.Item name="openSpace" label="Open Space" className="w-full">
|
|
11
|
+
<InputNumber max={1} min={0} step={0.1}/>
|
|
12
|
+
</Form.Item>
|
|
13
|
+
</Flex>
|
|
14
|
+
<Row gutter={[16, 16]}>
|
|
15
|
+
<Col span={12}>
|
|
16
|
+
<Form.Item name={["seatPositions", "top"]} label="Top" className="w-full">
|
|
17
|
+
<InputNumber max={100} min={0} step={1}/>
|
|
18
|
+
</Form.Item>
|
|
19
|
+
<Form.Item name={["seatPositions", "left"]} label="Left" className="w-full">
|
|
20
|
+
<InputNumber max={100} min={0} step={1}/>
|
|
21
|
+
</Form.Item>
|
|
22
|
+
</Col>
|
|
23
|
+
<Col span={12}>
|
|
24
|
+
<Form.Item name={["seatPositions", "right"]} label="Right" className="w-full">
|
|
25
|
+
<InputNumber max={100} min={0} step={1}/>
|
|
26
|
+
</Form.Item>
|
|
27
|
+
<Form.Item name={["seatPositions", "bottom"]} label="Bottom" className="w-full">
|
|
28
|
+
<InputNumber max={100} min={0} step={1}/>
|
|
29
|
+
</Form.Item>
|
|
30
|
+
</Col>
|
|
31
|
+
</Row>
|
|
32
|
+
|
|
33
|
+
<Flex gap={2}>
|
|
34
|
+
<Form.Item label="Seat Fill" name={"seatFill"} getValueFromEvent={(color) => color.toHexString()} className="w-full ">
|
|
35
|
+
<ColorPicker allowClear format="hex" defaultFormat="hex"/>
|
|
36
|
+
</Form.Item>
|
|
37
|
+
<Form.Item label="Table Fill" name={"fill"} getValueFromEvent={(color) => color.toHexString()} className="w-full ">
|
|
38
|
+
<ColorPicker allowClear format="hex" defaultFormat="hex"/>
|
|
39
|
+
</Form.Item>
|
|
40
|
+
</Flex>
|
|
41
|
+
<SectionShape />
|
|
42
|
+
<SectionLabel />
|
|
43
|
+
</div>
|
|
44
|
+
</>);
|
|
45
|
+
};
|
|
46
|
+
export default SeatSquare;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const TextTool: () => import("react
|
|
1
|
+
declare const TextTool: () => import("react").JSX.Element;
|
|
2
2
|
export default TextTool;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ColorPicker, Form, Input, InputNumber } from "antd";
|
|
3
|
+
const TextTool = () => {
|
|
4
|
+
return (<div className="py-2">
|
|
5
|
+
<Form.Item label="Name" name="shape" className="w-full hidden">
|
|
6
|
+
<Input defaultValue={"text"}/>
|
|
7
|
+
</Form.Item>
|
|
8
|
+
|
|
9
|
+
<Form.Item name="text" label="Text">
|
|
10
|
+
<Input />
|
|
11
|
+
</Form.Item>
|
|
12
|
+
<Form.Item name={"fontColor"} label="Color" getValueFromEvent={(color) => color.toHexString()}>
|
|
13
|
+
<ColorPicker allowClear format="hex" defaultFormat="hex"/>
|
|
14
|
+
</Form.Item>
|
|
15
|
+
<Form.Item name={"x"} label="X">
|
|
16
|
+
<InputNumber />
|
|
17
|
+
</Form.Item>
|
|
18
|
+
<Form.Item name={"y"} label="Y">
|
|
19
|
+
<InputNumber />
|
|
20
|
+
</Form.Item>
|
|
21
|
+
<Form.Item name={"fontSize"} label="Size">
|
|
22
|
+
<InputNumber suffix="px"/>
|
|
23
|
+
</Form.Item>
|
|
24
|
+
</div>);
|
|
25
|
+
};
|
|
26
|
+
export default TextTool;
|
|
@@ -10,5 +10,5 @@ interface UploadToolProps {
|
|
|
10
10
|
};
|
|
11
11
|
defaultValue?: any;
|
|
12
12
|
}
|
|
13
|
-
declare const UploadTool: ({ name, type, action, responseMapping, defaultValue, }: UploadToolProps) => import("react
|
|
13
|
+
declare const UploadTool: ({ name, type, action, responseMapping, defaultValue, }: UploadToolProps) => import("react").JSX.Element;
|
|
14
14
|
export default UploadTool;
|
|
@@ -8,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
11
|
import { useState, useEffect } from "react";
|
|
13
12
|
import { Upload, Image, Button } from "antd";
|
|
14
13
|
import { InboxOutlined } from "@ant-design/icons";
|
|
@@ -125,6 +124,29 @@ const UploadTool = ({ name, type, action, responseMapping, defaultValue, }) => {
|
|
|
125
124
|
const handleDelete = () => {
|
|
126
125
|
setDefaultSrc(null);
|
|
127
126
|
};
|
|
128
|
-
return (
|
|
127
|
+
return (<>
|
|
128
|
+
{defaultSrc ? (<>
|
|
129
|
+
<div className="w-full flex flex-col items-center gap-2 max-h-[200px] overflow-y-auto">
|
|
130
|
+
<Image src={defaultSrc}/>
|
|
131
|
+
</div>
|
|
132
|
+
<Button type="primary" onClick={handleDelete}>
|
|
133
|
+
Edit
|
|
134
|
+
</Button>
|
|
135
|
+
</>) : (<Dragger {...propsUpload} action={""}>
|
|
136
|
+
<p className="ant-upload-drag-icon">
|
|
137
|
+
<InboxOutlined />
|
|
138
|
+
</p>
|
|
139
|
+
<p className="ant-upload-text">
|
|
140
|
+
Click or drag file to this area to upload
|
|
141
|
+
</p>
|
|
142
|
+
<p className="ant-upload-hint">
|
|
143
|
+
Support for a single or bulk upload. Strictly prohibited from
|
|
144
|
+
uploading company data or other banned files.
|
|
145
|
+
</p>
|
|
146
|
+
</Dragger>)}
|
|
147
|
+
|
|
148
|
+
<SectionShape allowChangeShape={type === "component"}/>
|
|
149
|
+
<SectionLabel />
|
|
150
|
+
</>);
|
|
129
151
|
};
|
|
130
152
|
export default UploadTool;
|