seat-editor 3.3.44 → 3.3.46
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 -3
- package/dist/app/constant.js +3 -3
- package/dist/app/layout.d.ts +1 -1
- package/dist/app/new-board/page.d.ts +1 -1
- package/dist/app/old-board/page.d.ts +2 -1
- package/dist/app/only-view/chair.d.ts +1 -1
- package/dist/app/only-view/chair.js +10 -2
- package/dist/app/only-view/constant.d.ts +288 -30
- package/dist/app/only-view/constant.js +7227 -912
- package/dist/app/only-view/page.d.ts +1 -1
- package/dist/app/only-view/page.jsx +8 -8
- 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/test/page.d.ts +2 -1
- package/dist/app/v2/page.d.ts +1 -1
- package/dist/components/button-tools/index.d.ts +1 -1
- package/dist/components/form-tools/label.d.ts +1 -1
- package/dist/components/form-tools/shape.d.ts +1 -1
- package/dist/components/input/number-indicator.d.ts +1 -1
- package/dist/components/joystick/index.d.ts +2 -1
- package/dist/components/layer/index.d.ts +1 -1
- package/dist/components/layer-v2/index.d.ts +1 -1
- package/dist/components/layer-v3/index.d.ts +1 -1
- package/dist/components/layer-v4/index.d.ts +1 -1
- package/dist/components/lib/index.d.ts +1 -1
- package/dist/components/modal-preview/index.d.ts +1 -1
- package/dist/features/board/index.d.ts +1 -1
- package/dist/features/board-v2/index.d.ts +2 -1
- package/dist/features/board-v3/index.d.ts +1 -1
- package/dist/features/board-v3/index.jsx +10 -4
- package/dist/features/navbar/index.d.ts +1 -1
- package/dist/features/package/index.d.ts +1 -1
- package/dist/features/package/index.jsx +8 -2
- package/dist/features/panel/index.d.ts +1 -1
- package/dist/features/panel/select-tool.d.ts +1 -1
- package/dist/features/panel/selected-group.d.ts +1 -1
- package/dist/features/panel/square-circle-tool.d.ts +1 -1
- package/dist/features/panel/table-seat-circle.d.ts +1 -1
- package/dist/features/panel/table-seat-square.d.ts +1 -1
- package/dist/features/panel/text-tool.d.ts +1 -1
- package/dist/features/panel/upload-tool.d.ts +1 -1
- package/dist/features/side-tool/index.d.ts +1 -1
- package/dist/features/view-only/index.d.ts +1 -1
- package/dist/features/view-only-2/index.d.ts +1 -1
- package/dist/features/view-only-2/index.jsx +14 -8
- package/dist/features/view-only-3/index.d.ts +1 -1
- package/dist/features/view-only-3/index.jsx +21 -14
- package/dist/provider/redux-provider.d.ts +1 -1
- package/dist/provider/store-provider.d.ts +1 -1
- package/package.json +1 -1
|
@@ -189,7 +189,7 @@ const TouchScrollDetect = () => {
|
|
|
189
189
|
-
|
|
190
190
|
</button>
|
|
191
191
|
</div>
|
|
192
|
-
<LayerView refs={refLayer} statusKey="
|
|
192
|
+
<LayerView refs={refLayer} statusKey="is_late" privilegedTags={[
|
|
193
193
|
{
|
|
194
194
|
key: "table",
|
|
195
195
|
items: ["text", "icon"],
|
|
@@ -202,13 +202,13 @@ const TouchScrollDetect = () => {
|
|
|
202
202
|
handleSelectTable(component);
|
|
203
203
|
}} dragTableBlockKey={[
|
|
204
204
|
{
|
|
205
|
-
key: "
|
|
206
|
-
value:
|
|
205
|
+
key: "code",
|
|
206
|
+
value: "V1",
|
|
207
207
|
},
|
|
208
|
-
{
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
208
|
+
// {
|
|
209
|
+
// key: "rsvp",
|
|
210
|
+
// value: 1
|
|
211
|
+
// }
|
|
212
212
|
]} tableMatchKey={[
|
|
213
213
|
{
|
|
214
214
|
key: 0,
|
|
@@ -242,7 +242,7 @@ const TouchScrollDetect = () => {
|
|
|
242
242
|
},
|
|
243
243
|
]} viewStyles={{
|
|
244
244
|
paddingTop: 200,
|
|
245
|
-
}}
|
|
245
|
+
}} transformProps={{}}/>
|
|
246
246
|
</div>
|
|
247
247
|
</div>
|
|
248
248
|
</div>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function UserIcon(): import("react
|
|
1
|
+
export function UserIcon(): import("react").JSX.Element;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
export const UserIcon = () => {
|
|
3
|
-
return (
|
|
2
|
+
return (<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path d="M7.61992 10.1625C9.00754 10.1625 10.1324 9.03757 10.1324 7.64995C10.1324 6.26234 9.00754 5.13745 7.61992 5.13745C6.23231 5.13745 5.10742 6.26234 5.10742 7.64995C5.10742 9.03757 6.23231 10.1625 7.61992 10.1625Z" fill="#5E6278"/>
|
|
4
|
+
<path d="M7.62 14.9999C9.34313 14.9999 10.74 14.1168 10.74 13.0274C10.74 11.9381 9.34313 11.0549 7.62 11.0549C5.89687 11.0549 4.5 11.9381 4.5 13.0274C4.5 14.1168 5.89687 14.9999 7.62 14.9999Z" fill="#5E6278"/>
|
|
5
|
+
<path opacity="0.3" d="M11.595 4.23C12.7631 4.23 13.71 3.28308 13.71 2.115C13.71 0.946918 12.7631 0 11.595 0C10.4269 0 9.47998 0.946918 9.47998 2.115C9.47998 3.28308 10.4269 4.23 11.595 4.23Z" fill="#5E6278"/>
|
|
6
|
+
<path opacity="0.3" d="M3.62257 4.23C4.79065 4.23 5.73757 3.28308 5.73757 2.115C5.73757 0.946918 4.79065 0 3.62257 0C2.45449 0 1.50757 0.946918 1.50757 2.115C1.50757 3.28308 2.45449 4.23 3.62257 4.23Z" fill="#5E6278"/>
|
|
7
|
+
<g opacity="0.3">
|
|
8
|
+
<path d="M11.4749 5.87256C11.2349 5.87256 11.0024 5.87256 10.7699 5.91006C11.1229 6.52313 11.2825 7.22856 11.2276 7.93388C11.1727 8.63919 10.906 9.31147 10.4624 9.86256C10.7984 9.92909 11.1399 9.96424 11.4824 9.96756C13.3874 9.96756 14.9249 9.04506 14.9249 7.92006C14.9249 6.79506 13.3799 5.87256 11.4749 5.87256Z" fill="#5E6278"/>
|
|
9
|
+
<path d="M3.4499 6C3.6899 6 3.9224 6 4.1549 6.0375C3.80187 6.65057 3.64233 7.356 3.6972 8.06132C3.75208 8.76664 4.0188 9.43891 4.4624 9.99C4.12639 10.0565 3.78492 10.0917 3.4424 10.095C1.5374 10.095 -9.77516e-05 9.1725 -9.77516e-05 8.0475C-9.77516e-05 6.9225 1.5449 6 3.4499 6Z" fill="#5E6278"/>
|
|
10
|
+
</g>
|
|
11
|
+
</svg>);
|
|
4
12
|
};
|
package/dist/app/page.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const TableEditor: () => import("react
|
|
1
|
+
declare const TableEditor: () => import("react").JSX.Element;
|
|
2
2
|
export default TableEditor;
|
package/dist/app/test/page.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
export default function DraggableRect(): React.JSX.Element;
|
package/dist/app/v2/page.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const TableEditor: () => import("react
|
|
1
|
+
declare const TableEditor: () => import("react").JSX.Element;
|
|
2
2
|
export default TableEditor;
|
|
@@ -7,5 +7,5 @@ interface ButtonToolsProps {
|
|
|
7
7
|
}>;
|
|
8
8
|
popoverProps?: PopoverProps;
|
|
9
9
|
}
|
|
10
|
-
declare const ButtonTools: (props: ButtonToolsProps) => import("react
|
|
10
|
+
declare const ButtonTools: (props: ButtonToolsProps) => import("react").JSX.Element;
|
|
11
11
|
export default ButtonTools;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SectionLabel: () => import("react
|
|
1
|
+
declare const SectionLabel: () => import("react").JSX.Element;
|
|
2
2
|
export default SectionLabel;
|
|
@@ -3,5 +3,5 @@ interface NumberIndicatorProps {
|
|
|
3
3
|
defaultValue?: number;
|
|
4
4
|
onChange: (value: number) => void;
|
|
5
5
|
}
|
|
6
|
-
declare const NumberIndicator: ({ name, defaultValue, onChange }: NumberIndicatorProps) => import("react
|
|
6
|
+
declare const NumberIndicator: ({ name, defaultValue, onChange }: NumberIndicatorProps) => import("react").JSX.Element;
|
|
7
7
|
export default NumberIndicator;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
type JoystickPosition = {
|
|
2
3
|
x: number;
|
|
3
4
|
y: number;
|
|
@@ -7,5 +8,5 @@ type JoystickProps = {
|
|
|
7
8
|
onMove?: (pos: JoystickPosition) => void;
|
|
8
9
|
onEnd?: () => void;
|
|
9
10
|
};
|
|
10
|
-
export declare const Joystick: ({ size, onMove, onEnd, }: JoystickProps) =>
|
|
11
|
+
export declare const Joystick: ({ size, onMove, onEnd, }: JoystickProps) => React.JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -15,5 +15,5 @@ interface LayersProps {
|
|
|
15
15
|
onTouchMove?: (e: React.TouchEvent<SVGRectElement | SVGCircleElement | SVGTextElement | SVGImageElement>) => void;
|
|
16
16
|
onTouchEnd?: (e: React.TouchEvent<SVGRectElement | SVGCircleElement | SVGTextElement | SVGImageElement>) => void;
|
|
17
17
|
}
|
|
18
|
-
declare const Layers: ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode, style, onTouchEnd, onTouchMove, onTouchStart }: LayersProps) => import("react
|
|
18
|
+
declare const Layers: ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode, style, onTouchEnd, onTouchMove, onTouchStart }: LayersProps) => import("react").JSX.Element;
|
|
19
19
|
export default Layers;
|
|
@@ -15,5 +15,5 @@ interface LayersProps {
|
|
|
15
15
|
onTouchMove?: (e: React.TouchEvent<SVGRectElement | SVGCircleElement | SVGTextElement | SVGImageElement>) => void;
|
|
16
16
|
onTouchEnd?: (e: React.TouchEvent<SVGRectElement | SVGCircleElement | SVGTextElement | SVGImageElement>) => void;
|
|
17
17
|
}
|
|
18
|
-
declare const Layers: ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode, style, onTouchStart }: LayersProps) => import("react
|
|
18
|
+
declare const Layers: ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode, style, onTouchStart }: LayersProps) => import("react").JSX.Element;
|
|
19
19
|
export default Layers;
|
|
@@ -9,5 +9,5 @@ interface LayersProps {
|
|
|
9
9
|
activeTool?: string;
|
|
10
10
|
selectionLines?: SelectionLines;
|
|
11
11
|
}
|
|
12
|
-
declare const Layers: ({ components, selectedComponent, activeTool, selectionLines, }: LayersProps) => import("react
|
|
12
|
+
declare const Layers: ({ components, selectedComponent, activeTool, selectionLines, }: LayersProps) => import("react").JSX.Element;
|
|
13
13
|
export default Layers;
|
|
@@ -20,5 +20,5 @@ interface LayersProps {
|
|
|
20
20
|
items: string[];
|
|
21
21
|
}[];
|
|
22
22
|
}
|
|
23
|
-
declare const Layers: ({ components, selectedTable, iconTags, eventMatchTable, onHighlightGroup, onForceRestoreGroup, selectedTableColor, privilegedTags, }: LayersProps) => import("react
|
|
23
|
+
declare const Layers: ({ components, selectedTable, iconTags, eventMatchTable, onHighlightGroup, onForceRestoreGroup, selectedTableColor, privilegedTags, }: LayersProps) => import("react").JSX.Element;
|
|
24
24
|
export default Layers;
|
|
@@ -3,6 +3,6 @@ export interface LayerViewProps {
|
|
|
3
3
|
componentProps: any[];
|
|
4
4
|
extraComponentProps: any[];
|
|
5
5
|
}
|
|
6
|
-
declare const TableEditor: ({ componentProps, extraComponentProps, }: LayerViewProps) => import("react
|
|
6
|
+
declare const TableEditor: ({ componentProps, extraComponentProps, }: LayerViewProps) => import("react").JSX.Element;
|
|
7
7
|
export default TableEditor;
|
|
8
8
|
export { LayerView };
|
|
@@ -2,5 +2,5 @@ interface BoardTemplateProps {
|
|
|
2
2
|
onSelectComponent?: (items: any) => void;
|
|
3
3
|
mappingKey?: string;
|
|
4
4
|
}
|
|
5
|
-
declare const BoardTemplate: ({ onSelectComponent }: BoardTemplateProps) => import("react
|
|
5
|
+
declare const BoardTemplate: ({ onSelectComponent }: BoardTemplateProps) => import("react").JSX.Element;
|
|
6
6
|
export default BoardTemplate;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
interface BoardTemplateProps {
|
|
2
3
|
onSelectComponent?: (items: any) => void;
|
|
3
4
|
mappingKey?: string;
|
|
4
5
|
viewOnly?: boolean;
|
|
5
6
|
}
|
|
6
|
-
declare const BoardTemplate: ({ onSelectComponent, viewOnly }: BoardTemplateProps) =>
|
|
7
|
+
declare const BoardTemplate: ({ onSelectComponent, viewOnly }: BoardTemplateProps) => React.JSX.Element;
|
|
7
8
|
export default BoardTemplate;
|
|
@@ -13,5 +13,5 @@ interface BoardTemplateProps {
|
|
|
13
13
|
};
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
}
|
|
16
|
-
declare const BoardTemplate: ({ refs, loadingRender, disabled, }: BoardTemplateProps) =>
|
|
16
|
+
declare const BoardTemplate: ({ refs, loadingRender, disabled, }: BoardTemplateProps) => React.JSX.Element;
|
|
17
17
|
export default BoardTemplate;
|
|
@@ -14,7 +14,7 @@ import { applyResizeToSvgElement, arrayToSvgPointsAttr, createTableGhost, getGlo
|
|
|
14
14
|
const toolElement = ["square", "circle", "table-seat-circle"];
|
|
15
15
|
const idSelectionBoxGhost = "selection-box-ghost";
|
|
16
16
|
const nameShapeSelectionBoxGhost = "selection-box";
|
|
17
|
-
const BoardTemplate = ({ refs, loadingRender, disabled = false }) => {
|
|
17
|
+
const BoardTemplate = ({ refs, loadingRender, disabled = false, }) => {
|
|
18
18
|
const dispatch = useAppDispatch();
|
|
19
19
|
const backgroundColor = useAppSelector((state) => state.board.backgroundColor);
|
|
20
20
|
const selectedComponentProps = useAppSelector((state) => state.panel.selectedComponent);
|
|
@@ -1311,7 +1311,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false }) => {
|
|
|
1311
1311
|
let y2 = [];
|
|
1312
1312
|
allElementSelectionGroup.forEach((element) => {
|
|
1313
1313
|
const activeId = element.id;
|
|
1314
|
-
const { g, inner, element: el } = getAttributeElement(svg, String(activeId));
|
|
1314
|
+
const { g, inner, element: el, } = getAttributeElement(svg, String(activeId));
|
|
1315
1315
|
const { x, y, width, height } = getGlobalBBox(svg, g);
|
|
1316
1316
|
xs.push(x);
|
|
1317
1317
|
ys.push(y);
|
|
@@ -1548,7 +1548,13 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false }) => {
|
|
|
1548
1548
|
};
|
|
1549
1549
|
return (<>
|
|
1550
1550
|
<ModalPreview>
|
|
1551
|
-
<LayerView statusKey="status" loadingRender={loadingRender}
|
|
1551
|
+
<LayerView statusKey="status" loadingRender={loadingRender} actionPrivileged={{
|
|
1552
|
+
select: false,
|
|
1553
|
+
move: false,
|
|
1554
|
+
switch: false,
|
|
1555
|
+
drop: false,
|
|
1556
|
+
rightClick: false,
|
|
1557
|
+
}}/>
|
|
1552
1558
|
<div className="flex gap-2 mt-2">
|
|
1553
1559
|
<Radio.Group value={isShowTagType} onChange={handleCheckPreview}>
|
|
1554
1560
|
<Radio value="default">Default</Radio>
|
|
@@ -1575,7 +1581,7 @@ const BoardTemplate = ({ refs, loadingRender, disabled = false }) => {
|
|
|
1575
1581
|
"table-seat-circle",
|
|
1576
1582
|
"table-seat-square",
|
|
1577
1583
|
"bounding-box",
|
|
1578
|
-
""
|
|
1584
|
+
"",
|
|
1579
1585
|
].includes(activeTool),
|
|
1580
1586
|
}}
|
|
1581
1587
|
// centerZoomedOut={true}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Navbar: () => import("react
|
|
1
|
+
declare const Navbar: () => import("react").JSX.Element;
|
|
2
2
|
export default Navbar;
|
|
@@ -44,5 +44,5 @@ export interface TableEditorProps<TMeta = undefined> {
|
|
|
44
44
|
};
|
|
45
45
|
disabledView?: boolean;
|
|
46
46
|
}
|
|
47
|
-
declare const TableEditor: <TMeta>(props: TableEditorProps<TMeta>) => import("react
|
|
47
|
+
declare const TableEditor: <TMeta>(props: TableEditorProps<TMeta>) => import("react").JSX.Element;
|
|
48
48
|
export default TableEditor;
|
|
@@ -163,9 +163,15 @@ const TableEditor = (props) => {
|
|
|
163
163
|
return (<>
|
|
164
164
|
<div className="w-full h-screen flex relative">
|
|
165
165
|
{viewOnly ? (<div className="w-full h-full flex relative">
|
|
166
|
-
<LayerView key={`${viewOnly}`} statusKey="status" loadingRender={props === null || props === void 0 ? void 0 : props.loadingRender}
|
|
166
|
+
<LayerView key={`${viewOnly}`} statusKey="status" loadingRender={props === null || props === void 0 ? void 0 : props.loadingRender} actionPrivileged={{
|
|
167
|
+
select: false,
|
|
168
|
+
move: false,
|
|
169
|
+
switch: false,
|
|
170
|
+
drop: false,
|
|
171
|
+
rightClick: false,
|
|
172
|
+
}}/>
|
|
167
173
|
</div>) : (<div key={`${viewOnly}`} className="w-full h-full flex relative">
|
|
168
|
-
{
|
|
174
|
+
{loading && !isPreview && (<div className="absolute z-10 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-opacity-50 bg-white w-full h-full flex items-center justify-center">
|
|
169
175
|
{(loadingRender === null || loadingRender === void 0 ? void 0 : loadingRender.element) || <Spin />}
|
|
170
176
|
</div>)}
|
|
171
177
|
<SideTool dragOnly={dragOnly} deleteAutorized={deleteAutorized}/>
|
|
@@ -2,5 +2,5 @@ interface ControlPanelsProps {
|
|
|
2
2
|
action?: (file: File) => Promise<string>;
|
|
3
3
|
transform?: any;
|
|
4
4
|
}
|
|
5
|
-
declare const ControlPanels: (props: ControlPanelsProps) => import("react
|
|
5
|
+
declare const ControlPanels: (props: ControlPanelsProps) => import("react").JSX.Element;
|
|
6
6
|
export default ControlPanels;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SelectedGroup: () => import("react
|
|
1
|
+
declare const SelectedGroup: () => import("react").JSX.Element;
|
|
2
2
|
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,2 +1,2 @@
|
|
|
1
|
-
declare const SeatCircle: () => import("react
|
|
1
|
+
declare const SeatCircle: () => import("react").JSX.Element;
|
|
2
2
|
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;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const TextTool: () => import("react
|
|
1
|
+
declare const TextTool: () => import("react").JSX.Element;
|
|
2
2
|
export default TextTool;
|
|
@@ -6,5 +6,5 @@ interface UploadToolProps {
|
|
|
6
6
|
defaultValue?: PropertiesProps;
|
|
7
7
|
transform?: any;
|
|
8
8
|
}
|
|
9
|
-
declare const UploadTool: ({ name, type, action, defaultValue, transform, }: UploadToolProps) => import("react
|
|
9
|
+
declare const UploadTool: ({ name, type, action, defaultValue, transform, }: UploadToolProps) => import("react").JSX.Element;
|
|
10
10
|
export default UploadTool;
|
|
@@ -15,5 +15,5 @@ export interface LayerViewProps {
|
|
|
15
15
|
containerProps?: any;
|
|
16
16
|
svgProps?: any;
|
|
17
17
|
}
|
|
18
|
-
declare const LayerView: (props: LayerViewProps) => import("react
|
|
18
|
+
declare const LayerView: (props: LayerViewProps) => import("react").JSX.Element;
|
|
19
19
|
export default LayerView;
|
|
@@ -91,5 +91,5 @@ export interface LayerViewProps<TMeta = undefined> {
|
|
|
91
91
|
rightClick: boolean;
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) =>
|
|
94
|
+
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) => React.JSX.Element;
|
|
95
95
|
export default LayerView;
|
|
@@ -5,7 +5,13 @@ import Layers from "../../components/layer-v4";
|
|
|
5
5
|
import { getTranslate } from "../board-v3/utils";
|
|
6
6
|
import { Spin } from "antd";
|
|
7
7
|
const LayerView = (props) => {
|
|
8
|
-
const { componentProps, extraComponentProps, onSelectComponent, onCurrentStateChange, mappingKey, statusKey, defaultBackground, defaultBoundingBox, iconTags, tooltipProps, onRightClick, allowTooltip = true, tableMatchKey, eventMatchTable, ghostAttributes, onDrop, onSwitch, refs, privilegedTags,
|
|
8
|
+
const { componentProps, extraComponentProps, onSelectComponent, onCurrentStateChange, mappingKey, statusKey, defaultBackground, defaultBoundingBox, iconTags, tooltipProps, onRightClick, allowTooltip = true, tableMatchKey, eventMatchTable, ghostAttributes, onDrop, onSwitch, refs, privilegedTags, loadingRender, actionPrivileged = {
|
|
9
|
+
select: true,
|
|
10
|
+
move: true,
|
|
11
|
+
switch: true,
|
|
12
|
+
drop: true,
|
|
13
|
+
rightClick: true
|
|
14
|
+
} } = props;
|
|
9
15
|
const widthTooltip = (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.minWidth) || 168;
|
|
10
16
|
const tableGhost = useRef(null);
|
|
11
17
|
const hoverUnderghostId = useRef(null);
|
|
@@ -131,8 +137,8 @@ const LayerView = (props) => {
|
|
|
131
137
|
});
|
|
132
138
|
const rightClick = e.button === 2;
|
|
133
139
|
const click = e.button === 0;
|
|
134
|
-
onRightClick && rightClick && onRightClick(e, find);
|
|
135
|
-
onSelectComponent && !rightClick && onSelectComponent(find);
|
|
140
|
+
(onRightClick && rightClick && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.rightClick)) && onRightClick(e, find);
|
|
141
|
+
(onSelectComponent && !rightClick && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.select)) && onSelectComponent(find);
|
|
136
142
|
const seletedTable = mappingKey ? find[mappingKey] : find;
|
|
137
143
|
setSelectedTable(seletedTable);
|
|
138
144
|
};
|
|
@@ -270,7 +276,7 @@ const LayerView = (props) => {
|
|
|
270
276
|
};
|
|
271
277
|
// drop from out layout editor
|
|
272
278
|
if (type === "drop") {
|
|
273
|
-
onDrop && onDrop(event, data);
|
|
279
|
+
(onDrop && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.drop)) && onDrop(event, data);
|
|
274
280
|
}
|
|
275
281
|
// cari elemen bentuk (rect / circle / path)
|
|
276
282
|
const shape = group.querySelector("rect") ||
|
|
@@ -315,10 +321,10 @@ const LayerView = (props) => {
|
|
|
315
321
|
const ghostId = JSON.parse(targetGroup.getAttribute("data-id") || "{}");
|
|
316
322
|
const allowedDrag = (!(props === null || props === void 0 ? void 0 : props.dragTableBlockKey)
|
|
317
323
|
? true
|
|
318
|
-
: (_a = props === null || props === void 0 ? void 0 : props.dragTableBlockKey) === null || _a === void 0 ? void 0 : _a.some((_) => {
|
|
324
|
+
: !((_a = props === null || props === void 0 ? void 0 : props.dragTableBlockKey) === null || _a === void 0 ? void 0 : _a.some((_) => {
|
|
319
325
|
const dataRaw = originalData({ id: ghostId, type: "find" });
|
|
320
|
-
return _.value
|
|
321
|
-
})) &&
|
|
326
|
+
return _.value === (dataRaw === null || dataRaw === void 0 ? void 0 : dataRaw[_.key]);
|
|
327
|
+
}))) && ((actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.move) && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.switch));
|
|
322
328
|
if (ghostAttributes) {
|
|
323
329
|
Object.keys(ghostAttributes).forEach((key) => {
|
|
324
330
|
ghost.setAttribute(key, ghostAttributes[key]);
|
|
@@ -560,7 +566,7 @@ const LayerView = (props) => {
|
|
|
560
566
|
overflow="hidden" viewBox={viewBox} className={"h-full"} xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" style={{
|
|
561
567
|
background: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : defaultBackground,
|
|
562
568
|
display: "block",
|
|
563
|
-
pointerEvents: disabled ? "none" : "all",
|
|
569
|
+
// pointerEvents: disabled ? "none" : "all",
|
|
564
570
|
touchAction: "none",
|
|
565
571
|
userSelect: "none",
|
|
566
572
|
}} {...props.svgProps}>
|
|
@@ -91,5 +91,5 @@ export interface LayerViewProps<TMeta = undefined> {
|
|
|
91
91
|
rightClick: boolean;
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) =>
|
|
94
|
+
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) => React.JSX.Element;
|
|
95
95
|
export default LayerView;
|
|
@@ -6,7 +6,13 @@ import Layers from "../../components/layer-v4";
|
|
|
6
6
|
import { getTranslate } from "../board-v3/utils";
|
|
7
7
|
import { Spin } from "antd";
|
|
8
8
|
const LayerView = (props) => {
|
|
9
|
-
const { componentProps, extraComponentProps, onSelectComponent, onCurrentStateChange, mappingKey, statusKey, defaultBackground, defaultBoundingBox, iconTags, tooltipProps, onRightClick, allowTooltip = true, tableMatchKey, eventMatchTable, ghostAttributes, onDrop, onSwitch, refs, privilegedTags,
|
|
9
|
+
const { componentProps, extraComponentProps, onSelectComponent, onCurrentStateChange, mappingKey, statusKey, defaultBackground, defaultBoundingBox, iconTags, tooltipProps, onRightClick, allowTooltip = true, tableMatchKey, eventMatchTable, ghostAttributes, onDrop, onSwitch, refs, privilegedTags, loadingRender, actionPrivileged = {
|
|
10
|
+
select: true,
|
|
11
|
+
move: true,
|
|
12
|
+
switch: true,
|
|
13
|
+
drop: true,
|
|
14
|
+
rightClick: true
|
|
15
|
+
} } = props;
|
|
10
16
|
const widthTooltip = (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.minWidth) || 168;
|
|
11
17
|
const tableGhost = useRef(null);
|
|
12
18
|
const hoverUnderghostId = useRef(null);
|
|
@@ -132,8 +138,8 @@ const LayerView = (props) => {
|
|
|
132
138
|
});
|
|
133
139
|
const rightClick = e.button === 2;
|
|
134
140
|
const click = e.button === 0;
|
|
135
|
-
onRightClick && rightClick && onRightClick(e, find);
|
|
136
|
-
onSelectComponent && !rightClick && onSelectComponent(find);
|
|
141
|
+
(onRightClick && rightClick && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.rightClick)) && onRightClick(e, find);
|
|
142
|
+
(onSelectComponent && !rightClick && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.select)) && onSelectComponent(find);
|
|
137
143
|
const seletedTable = mappingKey ? find[mappingKey] : find;
|
|
138
144
|
setSelectedTable(seletedTable);
|
|
139
145
|
};
|
|
@@ -271,7 +277,7 @@ const LayerView = (props) => {
|
|
|
271
277
|
};
|
|
272
278
|
// drop from out layout editor
|
|
273
279
|
if (type === "drop") {
|
|
274
|
-
onDrop && onDrop(event, data);
|
|
280
|
+
(onDrop && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.drop)) && onDrop(event, data);
|
|
275
281
|
}
|
|
276
282
|
// cari elemen bentuk (rect / circle / path)
|
|
277
283
|
const shape = group.querySelector("rect") ||
|
|
@@ -316,14 +322,14 @@ const LayerView = (props) => {
|
|
|
316
322
|
const ghostId = JSON.parse(targetGroup.getAttribute("data-id") || "{}");
|
|
317
323
|
const allowedDrag = (!(props === null || props === void 0 ? void 0 : props.dragTableBlockKey)
|
|
318
324
|
? true
|
|
319
|
-
: (_a = props === null || props === void 0 ? void 0 : props.dragTableBlockKey) === null || _a === void 0 ? void 0 : _a.some((_) => {
|
|
325
|
+
: !((_a = props === null || props === void 0 ? void 0 : props.dragTableBlockKey) === null || _a === void 0 ? void 0 : _a.some((_) => {
|
|
320
326
|
const dataRaw = originalData({ id: ghostId, type: "find" });
|
|
321
|
-
return _.value
|
|
322
|
-
})) &&
|
|
323
|
-
console.log({ allowedDrag }, (_b = props === null || props === void 0 ? void 0 : props.dragTableBlockKey) === null || _b === void 0 ? void 0 : _b.some((_) => {
|
|
327
|
+
return _.value === (dataRaw === null || dataRaw === void 0 ? void 0 : dataRaw[_.key]);
|
|
328
|
+
}))) && ((actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.move) && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.switch));
|
|
329
|
+
console.log({ allowedDrag }, !((_b = props === null || props === void 0 ? void 0 : props.dragTableBlockKey) === null || _b === void 0 ? void 0 : _b.some((_) => {
|
|
324
330
|
const dataRaw = originalData({ id: ghostId, type: "find" });
|
|
325
|
-
return _.value
|
|
326
|
-
}),
|
|
331
|
+
return _.value === (dataRaw === null || dataRaw === void 0 ? void 0 : dataRaw[_.key]);
|
|
332
|
+
})), ((actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.move) && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.switch)));
|
|
327
333
|
if (ghostAttributes) {
|
|
328
334
|
Object.keys(ghostAttributes).forEach((key) => {
|
|
329
335
|
ghost.setAttribute(key, ghostAttributes[key]);
|
|
@@ -430,8 +436,8 @@ const LayerView = (props) => {
|
|
|
430
436
|
}
|
|
431
437
|
if (isDragging.current && hasMoved && allowedDrag) {
|
|
432
438
|
// drag between group
|
|
439
|
+
console.log("drag between group");
|
|
433
440
|
const dataHoveredGhost = hoverUnderghostId.current;
|
|
434
|
-
hoverUnderghostId.current = null;
|
|
435
441
|
const sourceTable = JSON.parse(targetGroup.getAttribute("data-id") || "{}");
|
|
436
442
|
const data = {
|
|
437
443
|
targetTable: originalData({ id: dataHoveredGhost, type: "find" }),
|
|
@@ -443,6 +449,7 @@ const LayerView = (props) => {
|
|
|
443
449
|
isDragging.current = false;
|
|
444
450
|
(_a = tableGhost.current) === null || _a === void 0 ? void 0 : _a.remove();
|
|
445
451
|
tableGhost.current = null;
|
|
452
|
+
hoverUnderghostId.current = null;
|
|
446
453
|
}
|
|
447
454
|
setPanningGroup(false);
|
|
448
455
|
tableGhost.current = null;
|
|
@@ -578,18 +585,18 @@ const LayerView = (props) => {
|
|
|
578
585
|
width: "100%",
|
|
579
586
|
height: "100%",
|
|
580
587
|
// overflow: "visible",
|
|
581
|
-
pointerEvents: disabled ? "none" : "auto",
|
|
588
|
+
// pointerEvents: disabled ? "none" : "auto",
|
|
582
589
|
}} contentStyle={{
|
|
583
590
|
width: "100%",
|
|
584
591
|
height: "100%",
|
|
585
|
-
pointerEvents: disabled ? "none" : "auto",
|
|
592
|
+
// pointerEvents: disabled ? "none" : "auto",
|
|
586
593
|
}}>
|
|
587
594
|
<svg id="workspace" onContextMenu={(e) => e.preventDefault()} onDrop={(e) => handleTableEvent(e, "drop")} onPointerDown={handlePointerDown} onPointerUp={handleMouseUp} ref={svgRef} width="100%" height="100%"
|
|
588
595
|
// scale={5}
|
|
589
596
|
overflow="hidden" viewBox={viewBox} className={"h-full"} xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" style={{
|
|
590
597
|
background: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : defaultBackground,
|
|
591
598
|
display: "block",
|
|
592
|
-
pointerEvents: disabled ? "none" : "all",
|
|
599
|
+
// pointerEvents: disabled ? "none" : "all",
|
|
593
600
|
touchAction: "none",
|
|
594
601
|
userSelect: "none",
|
|
595
602
|
}} {...props.svgProps}>
|