seat-editor 3.6.25 → 3.6.26

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.
@@ -18,6 +18,7 @@ export default function GraphView() {
18
18
  selection: false,
19
19
  selectNode: false,
20
20
  connectingNode: false,
21
+ dragTransferTable: false
21
22
  });
22
23
  const [isSelectNode, setIsSelectNode] = useState(false);
23
24
  const [sections, setSections] = useState([
@@ -105,6 +106,10 @@ export default function GraphView() {
105
106
  key: "connectingNode",
106
107
  name: "Connecting Node",
107
108
  },
109
+ {
110
+ key: "dragTransferTable",
111
+ name: "Drag Transfer Table",
112
+ }
108
113
  ];
109
114
  const [dataDrag, setDataDrag] = useState(null);
110
115
  console.log({ dataDrag });
@@ -164,5 +169,7 @@ export default function GraphView() {
164
169
  selection: selection
165
170
  }, onRightClick: (e, data) => {
166
171
  console.log({ e, data });
167
- }, allowTooltip: true }), _jsxs("div", { className: "w-1/5 p-4", onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave, children: [_jsx("div", { id: "table" }), _jsxs("div", { className: "rounded-lg bg-white p-4", children: [_jsx("h1", { className: "text-2xl font-bold", children: "Section" }), sections.map((section) => (_jsxs("div", { className: clsx("font-bold text-white rounded-md p-2 cursor-pointer", sectionActive === section.id && "!bg-blue-500"), style: { backgroundColor: section.color }, onClick: () => setSectionActive(section.id), children: [_jsx("h2", { className: "text-lg", children: section.name }), section.items.length > 0 && (_jsx("ul", { className: "list-disc pl-5 bg-opacity-50 bg-white p-2 rounded ", children: section.items.map((item) => (_jsx("li", { children: item.name }, item.id))) }))] }, section.id)))] })] }), _jsx("div", { className: "w-1/5 p-4", children: _jsx("div", { className: "rounded-lg bg-white p-4", children: _jsx("h1", { className: "text-2xl font-bold", children: "Nodes" }) }) })] }) }));
172
+ }, allowTooltip: true, onHoldTable: (e, data) => {
173
+ console.log({ e, data });
174
+ } }), _jsxs("div", { className: "w-1/5 p-4", onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave, children: [_jsx("div", { id: "table" }), _jsxs("div", { className: "rounded-lg bg-white p-4", children: [_jsx("h1", { className: "text-2xl font-bold", children: "Section" }), sections.map((section) => (_jsxs("div", { className: clsx("font-bold text-white rounded-md p-2 cursor-pointer", sectionActive === section.id && "!bg-blue-500"), style: { backgroundColor: section.color }, onClick: () => setSectionActive(section.id), children: [_jsx("h2", { className: "text-lg", children: section.name }), section.items.length > 0 && (_jsx("ul", { className: "list-disc pl-5 bg-opacity-50 bg-white p-2 rounded ", children: section.items.map((item) => (_jsx("li", { children: item.name }, item.id))) }))] }, section.id)))] })] }), _jsx("div", { className: "w-1/5 p-4", children: _jsx("div", { className: "rounded-lg bg-white p-4", children: _jsx("h1", { className: "text-2xl font-bold", children: "Nodes" }) }) })] }) }));
168
175
  }
@@ -17,6 +17,7 @@ export default function GraphView() {
17
17
  selection: false,
18
18
  selectNode: false,
19
19
  connectingNode: false,
20
+ dragTransferTable: false
20
21
  });
21
22
  const [isSelectNode, setIsSelectNode] = useState(false);
22
23
  const [sections, setSections] = useState([
@@ -104,6 +105,10 @@ export default function GraphView() {
104
105
  key: "connectingNode",
105
106
  name: "Connecting Node",
106
107
  },
108
+ {
109
+ key: "dragTransferTable",
110
+ name: "Drag Transfer Table",
111
+ }
107
112
  ];
108
113
  const [dataDrag, setDataDrag] = useState(null);
109
114
  console.log({ dataDrag });
@@ -170,7 +175,9 @@ export default function GraphView() {
170
175
  selection: selection
171
176
  }} onRightClick={(e, data) => {
172
177
  console.log({ e, data });
173
- }} allowTooltip={true}/>
178
+ }} allowTooltip={true} onHoldTable={(e, data) => {
179
+ console.log({ e, data });
180
+ }}/>
174
181
  <div className="w-1/5 p-4" onMouseMove={handleMouseMove} onMouseLeave={handleMouseLeave}>
175
182
  <div id="table"/>
176
183
  <div className="rounded-lg bg-white p-4">
@@ -100,6 +100,7 @@ export interface LayerViewProps<TMeta = undefined> {
100
100
  dragTable?: boolean;
101
101
  selectNode?: boolean;
102
102
  connectingNode?: boolean;
103
+ dragTransferTable?: boolean;
103
104
  };
104
105
  onEdgesChange?: (edges: EdgeType[], table: PropertiesProps[]) => void;
105
106
  keyNode?: string;
@@ -112,6 +113,7 @@ export interface LayerViewProps<TMeta = undefined> {
112
113
  dataKey: string;
113
114
  selection: Record<number, string[]>;
114
115
  };
116
+ onHoldTable?: (e: React.PointerEvent<SVGSVGElement>, component: ComponentProps<TMeta>[]) => void;
115
117
  }
116
118
  declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) => import("react/jsx-runtime").JSX.Element;
117
119
  export default LayerView;
@@ -28,7 +28,8 @@ const LayerView = (props) => {
28
28
  dragTable: false,
29
29
  selectNode: false,
30
30
  connectingNode: false,
31
- }, onMakeSelection, groupSelection, } = props;
31
+ dragTransferTable: false,
32
+ }, onMakeSelection, groupSelection, onHoldTable } = props;
32
33
  const widthTooltip = (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.minWidth) || 168;
33
34
  const tableGhost = useRef(null);
34
35
  const hoverUnderghostId = useRef(null);
@@ -266,6 +267,7 @@ const LayerView = (props) => {
266
267
  setSelectedLines(null);
267
268
  }
268
269
  }, [actionPrivileged]);
270
+ const timerRef = useRef(null);
269
271
  const handlePointerDown = (e) => {
270
272
  var _a, _b, _c;
271
273
  const svg = svgRef.current;
@@ -318,6 +320,23 @@ const LayerView = (props) => {
318
320
  setTooltip((prev) => (Object.assign(Object.assign({}, prev), { visible: false })));
319
321
  return;
320
322
  }
323
+ if ((actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.dragTransferTable) && e.button === 0) {
324
+ const targetGroup = e.target.closest("g[data-id]");
325
+ const targetSelectionGroup = e.target.closest("g[data-selection]");
326
+ if (targetGroup) {
327
+ const dataId = JSON.parse(targetGroup.getAttribute("data-id") || "{}");
328
+ const findDayaById = originalData({ id: dataId, type: "find" });
329
+ timerRef.current = setTimeout(() => {
330
+ onHoldTable && onHoldTable(e, [findDayaById]);
331
+ }, 1000);
332
+ }
333
+ if (targetSelectionGroup) {
334
+ const tableData = dataElementSelectionGroupRef.current;
335
+ timerRef.current = setTimeout(() => {
336
+ onHoldTable && onHoldTable(e, tableData);
337
+ }, 1000);
338
+ }
339
+ }
321
340
  let ghost = targetGroup === null || targetGroup === void 0 ? void 0 : targetGroup.cloneNode(true);
322
341
  const ghostId = JSON.parse((targetGroup === null || targetGroup === void 0 ? void 0 : targetGroup.getAttribute("data-id")) || "{}");
323
342
  const allowedDrag = (!(props === null || props === void 0 ? void 0 : props.dragTableBlockKey)
@@ -27,7 +27,8 @@ const LayerView = (props) => {
27
27
  dragTable: false,
28
28
  selectNode: false,
29
29
  connectingNode: false,
30
- }, onMakeSelection, groupSelection, } = props;
30
+ dragTransferTable: false,
31
+ }, onMakeSelection, groupSelection, onHoldTable } = props;
31
32
  const widthTooltip = (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.minWidth) || 168;
32
33
  const tableGhost = useRef(null);
33
34
  const hoverUnderghostId = useRef(null);
@@ -265,6 +266,7 @@ const LayerView = (props) => {
265
266
  setSelectedLines(null);
266
267
  }
267
268
  }, [actionPrivileged]);
269
+ const timerRef = useRef(null);
268
270
  const handlePointerDown = (e) => {
269
271
  var _a, _b, _c;
270
272
  const svg = svgRef.current;
@@ -317,6 +319,23 @@ const LayerView = (props) => {
317
319
  setTooltip((prev) => (Object.assign(Object.assign({}, prev), { visible: false })));
318
320
  return;
319
321
  }
322
+ if ((actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.dragTransferTable) && e.button === 0) {
323
+ const targetGroup = e.target.closest("g[data-id]");
324
+ const targetSelectionGroup = e.target.closest("g[data-selection]");
325
+ if (targetGroup) {
326
+ const dataId = JSON.parse(targetGroup.getAttribute("data-id") || "{}");
327
+ const findDayaById = originalData({ id: dataId, type: "find" });
328
+ timerRef.current = setTimeout(() => {
329
+ onHoldTable && onHoldTable(e, [findDayaById]);
330
+ }, 1000);
331
+ }
332
+ if (targetSelectionGroup) {
333
+ const tableData = dataElementSelectionGroupRef.current;
334
+ timerRef.current = setTimeout(() => {
335
+ onHoldTable && onHoldTable(e, tableData);
336
+ }, 1000);
337
+ }
338
+ }
320
339
  let ghost = targetGroup === null || targetGroup === void 0 ? void 0 : targetGroup.cloneNode(true);
321
340
  const ghostId = JSON.parse((targetGroup === null || targetGroup === void 0 ? void 0 : targetGroup.getAttribute("data-id")) || "{}");
322
341
  const allowedDrag = (!(props === null || props === void 0 ? void 0 : props.dragTableBlockKey)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seat-editor",
3
- "version": "3.6.25",
3
+ "version": "3.6.26",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",