seat-editor 3.1.24 → 3.2.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.
@@ -6,7 +6,6 @@ import { ChairIcon } from "./chair";
6
6
  import { UserIcon } from "./user";
7
7
  import { Modal } from "antd";
8
8
  import JsonView from "@uiw/react-json-view";
9
- // import { dummyImage } from "./constant";
10
9
  export const dummyImage = [
11
10
  {
12
11
  id: "1747388267450",
@@ -155,7 +154,9 @@ const TouchScrollDetect = () => {
155
154
  setTable(data);
156
155
  };
157
156
  const handleDrop = (e, data) => {
157
+ var _a;
158
158
  console.log("data drop", data);
159
+ const targetData = (_a = data === null || data === void 0 ? void 0 : data.targetTable) === null || _a === void 0 ? void 0 : _a.test;
159
160
  e.preventDefault();
160
161
  setOpen(!open);
161
162
  setTable(data);
@@ -14,11 +14,9 @@ export type TableMatchEvent = {
14
14
  event: EventHandleType;
15
15
  properties: PropertiesProps;
16
16
  };
17
- export type ComponentProps<T = undefined> = PropertiesProps | ({
18
- [key: string]: PropertiesProps | string | number | boolean | null | undefined;
19
- } & (T extends undefined ? {} : {
20
- meta: T;
21
- }));
17
+ export type ComponentProps<T = undefined> = PropertiesProps & T & {
18
+ [key: string]: PropertiesProps;
19
+ };
22
20
  export type OnCurrentStateChange<TMeta = undefined> = ({ components, extraComponents, }: {
23
21
  components: ComponentProps<TMeta>[];
24
22
  extraComponents: ComponentProps<TMeta>[];
@@ -31,11 +29,15 @@ export type RefLayerView = {
31
29
  tableGhost: SVGGElement;
32
30
  hoverUnderghost: ComponentProps;
33
31
  };
32
+ export type TypeActionProps<TMeta = undefined> = {
33
+ targetTable: ComponentProps<TMeta>;
34
+ sourceTable: ComponentProps<TMeta>;
35
+ };
34
36
  export interface LayerViewProps<TMeta = undefined> {
35
37
  componentProps?: ComponentProps<TMeta>[];
36
38
  extraComponentProps?: ComponentProps<TMeta>[];
37
39
  onCurrentStateChange?: OnCurrentStateChange;
38
- onSelectComponent?: (component: ComponentProps) => void;
40
+ onSelectComponent?: (component: ComponentProps<TMeta>) => void;
39
41
  mappingKey?: string;
40
42
  tableMatchKey?: TableMatchKey[];
41
43
  eventMatchTable?: TableMatchEvent[];
@@ -65,13 +67,13 @@ export interface LayerViewProps<TMeta = undefined> {
65
67
  }[];
66
68
  onRightClick?: (e: MouseEvent, component: ComponentProps<TMeta>) => void;
67
69
  allowTooltip?: boolean;
68
- onDrop?: (e: React.MouseEvent<SVGSVGElement>, component: ComponentProps<TMeta>) => void;
69
- onSwitch?: (e: MouseEvent, component: ComponentProps<TMeta>) => void;
70
+ onDrop?: (e: React.MouseEvent<SVGSVGElement>, component: TypeActionProps<TMeta>) => void;
71
+ onSwitch?: (e: MouseEvent, component: TypeActionProps<TMeta>) => void;
70
72
  refs?: React.ForwardedRef<RefLayerView>;
71
73
  viewStyles?: {
72
74
  paddingX?: number;
73
75
  paddingY?: number;
74
76
  };
75
77
  }
76
- declare const LayerView: (props: LayerViewProps) => React.JSX.Element;
78
+ declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) => React.JSX.Element;
77
79
  export default LayerView;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seat-editor",
3
- "version": "3.1.24",
3
+ "version": "3.2.2",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",