@fangzhongya/page 0.0.27 → 0.0.29

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.
Files changed (124) hide show
  1. package/dist/components/control/design.cjs +3 -3
  2. package/dist/components/control/design.js +3 -3
  3. package/dist/components/design/design-drag2.cjs +15 -7
  4. package/dist/components/design/design-drag2.js +16 -8
  5. package/dist/components/design/design-el-input.cjs +4 -0
  6. package/dist/components/design/design-el-input.js +4 -0
  7. package/dist/components/design/design-el-input2.cjs +32 -0
  8. package/dist/components/design/design-el-input2.js +32 -0
  9. package/dist/components/design/design-grids2.cjs +2 -23
  10. package/dist/components/design/design-grids2.js +2 -23
  11. package/dist/components/design/design-icon.cjs +4 -0
  12. package/dist/components/design/design-icon.js +4 -0
  13. package/dist/components/design/design-icon2.cjs +18 -0
  14. package/dist/components/design/design-icon2.js +18 -0
  15. package/dist/components/design/design-operate2.cjs +19 -28
  16. package/dist/components/design/design-operate2.js +19 -28
  17. package/dist/components/design/design-resizable2.cjs +3 -3
  18. package/dist/components/design/design-resizable2.js +3 -3
  19. package/dist/components/design/resizable.cjs +1 -1
  20. package/dist/components/design/resizable.css +15 -15
  21. package/dist/components/design/resizable.js +1 -1
  22. package/dist/components/design/resizable2.cjs +1 -1
  23. package/dist/components/design/resizable2.js +1 -1
  24. package/dist/components/index.css +246 -36
  25. package/dist/components/index2.cjs +99 -88
  26. package/dist/components/index2.js +107 -96
  27. package/dist/components/left/custom2.cjs +7 -16
  28. package/dist/components/left/custom2.js +8 -17
  29. package/dist/components/left/icons2.cjs +20 -38
  30. package/dist/components/left/icons2.js +20 -38
  31. package/dist/components/left/mould2.cjs +20 -27
  32. package/dist/components/left/mould2.js +23 -30
  33. package/dist/components/left/search2.cjs +7 -18
  34. package/dist/components/left/search2.js +7 -18
  35. package/dist/components/operate/index2.cjs +6 -10
  36. package/dist/components/operate/index2.js +6 -10
  37. package/dist/components/operate/right-key.cjs +4 -0
  38. package/dist/components/operate/right-key.js +4 -0
  39. package/dist/components/operate/right-key2.cjs +111 -0
  40. package/dist/components/operate/right-key2.js +111 -0
  41. package/dist/components/operate/right2.cjs +16 -194
  42. package/dist/components/operate/right2.js +17 -195
  43. package/dist/components/operate/util.cjs +202 -0
  44. package/dist/components/operate/util.d.ts +6 -0
  45. package/dist/components/operate/util.js +202 -0
  46. package/dist/components/output/vue/index.cjs +10 -7
  47. package/dist/components/output/vue/index.d.ts +5 -1
  48. package/dist/components/output/vue/index.js +10 -7
  49. package/dist/components/props.d.ts +20 -0
  50. package/dist/components/right/currency/index.cjs +1 -1
  51. package/dist/components/right/currency/index.js +1 -1
  52. package/dist/components/right/currency/style2.cjs +23 -45
  53. package/dist/components/right/currency/style2.js +23 -45
  54. package/dist/components/tree/tree-drag2.cjs +2 -2
  55. package/dist/components/tree/tree-drag2.js +2 -2
  56. package/dist/config/util.cjs +2 -0
  57. package/dist/config/util.js +3 -1
  58. package/dist/design/design.cjs +0 -10
  59. package/dist/design/design.js +0 -10
  60. package/dist/design/render2.cjs +1 -2
  61. package/dist/design/render2.js +1 -2
  62. package/dist/design/util.cjs +45 -0
  63. package/dist/design/util.d.ts +4 -0
  64. package/dist/design/util.js +46 -1
  65. package/dist/effect/design.cjs +336 -0
  66. package/dist/effect/design.d.ts +11 -0
  67. package/dist/effect/design.js +336 -0
  68. package/dist/effect/draggable.cjs +191 -0
  69. package/dist/effect/draggable.d.ts +6 -0
  70. package/dist/effect/draggable.js +191 -0
  71. package/dist/effect/effect.cjs +54 -0
  72. package/dist/effect/effect.d.ts +7 -0
  73. package/dist/effect/effect.js +54 -0
  74. package/dist/effect/index.cjs +4 -0
  75. package/dist/effect/index.js +4 -0
  76. package/dist/effect/index2.cjs +40 -0
  77. package/dist/effect/index2.js +40 -0
  78. package/dist/expand/{chunk-KQKVKAJF.js → chunk-I2RMOBDW.js} +1 -1
  79. package/dist/expand/{chunk-MYRRDRIS.cjs → chunk-ZJCFZ63F.cjs} +1 -1
  80. package/dist/expand/components.cjs +4 -4
  81. package/dist/expand/components.js +2 -2
  82. package/dist/expand/config.cjs +2 -2
  83. package/dist/expand/config.js +1 -1
  84. package/dist/index.cjs +2 -0
  85. package/dist/index.d.ts +2 -1
  86. package/dist/index.js +2 -0
  87. package/dist/render/common.cjs +4 -2
  88. package/dist/render/common.d.ts +9 -0
  89. package/dist/render/common.js +4 -2
  90. package/dist/render/render.cjs +5 -1
  91. package/dist/render/render.js +6 -2
  92. package/dist/utils/index.cjs +0 -5
  93. package/dist/utils/index.d.ts +0 -1
  94. package/dist/utils/index.js +0 -5
  95. package/dist/viewer/design.cjs +76 -0
  96. package/dist/viewer/design.d.ts +5 -0
  97. package/dist/viewer/design.js +76 -0
  98. package/dist/viewer/draggable.cjs +87 -0
  99. package/dist/viewer/draggable.d.ts +3 -0
  100. package/dist/viewer/draggable.js +87 -0
  101. package/dist/viewer/index.cjs +4 -0
  102. package/dist/viewer/index.js +4 -0
  103. package/dist/viewer/index2.cjs +40 -0
  104. package/dist/viewer/index2.js +40 -0
  105. package/dist/viewer/viewer.cjs +54 -0
  106. package/dist/viewer/viewer.d.ts +7 -0
  107. package/dist/viewer/viewer.js +54 -0
  108. package/package.json +8 -7
  109. package/dist/components/editor/button-editor.cjs +0 -4
  110. package/dist/components/editor/button-editor.js +0 -4
  111. package/dist/components/editor/button-editor2.cjs +0 -131
  112. package/dist/components/editor/button-editor2.js +0 -131
  113. package/dist/components/editor/editor.cjs +0 -4
  114. package/dist/components/editor/editor.js +0 -4
  115. package/dist/components/editor/editor2.cjs +0 -233
  116. package/dist/components/editor/editor2.js +0 -233
  117. package/dist/components/right/currency/editor.cjs +0 -4
  118. package/dist/components/right/currency/editor.js +0 -4
  119. package/dist/components/right/currency/editor2.cjs +0 -64
  120. package/dist/components/right/currency/editor2.js +0 -64
  121. package/dist/components/right/currency/emits.cjs +0 -4
  122. package/dist/components/right/currency/emits.js +0 -4
  123. package/dist/components/right/currency/emits2.cjs +0 -83
  124. package/dist/components/right/currency/emits2.js +0 -83
package/dist/index.cjs CHANGED
@@ -5,6 +5,7 @@ require("./components/index.cjs");
5
5
  const index$1 = require("./components/output/vue/index.cjs");
6
6
  const util = require("./render/util.cjs");
7
7
  const index = require("./assemblys/index.cjs");
8
+ const util$1 = require("./design/util.cjs");
8
9
  require("./page.cjs");
9
10
  const index_vue_vue_type_script_setup_true_lang = require("./components/index2.cjs");
10
11
  const render = require("./render/render.cjs");
@@ -22,6 +23,7 @@ exports.generVue = index$1.generVue;
22
23
  exports.getDesignMinStr = util.getDesignMinStr;
23
24
  exports.getStrValue = util.getStrValue;
24
25
  exports.assemblys = index.default;
26
+ exports.getUuidControl = util$1.getUuidControl;
25
27
  exports.createRender = render.createRender;
26
28
  exports.getComponentNames = render$1.getComponentNames;
27
29
  exports.FangPageSet = FangPageSet;
package/dist/index.d.ts CHANGED
@@ -2,8 +2,9 @@ import { Plugin } from 'vue';
2
2
  import { generVue } from './components/output/vue/index';
3
3
  import { getDesignMinStr } from './render/util';
4
4
  import { default as assemblys } from './assemblys/index';
5
+ import { getUuidControl } from './design/util';
5
6
  export * from './page';
6
7
  declare const FangPageSet: any;
7
8
  export declare const install: Plugin;
8
- export { FangPageSet, assemblys, generVue, getDesignMinStr };
9
+ export { FangPageSet, assemblys, getUuidControl, generVue, getDesignMinStr };
9
10
  export default FangPageSet;
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ import "./components/index.js";
3
3
  import { generVue } from "./components/output/vue/index.js";
4
4
  import { getDesignMinStr, getStrValue } from "./render/util.js";
5
5
  import assemblys from "./assemblys/index.js";
6
+ import { getUuidControl } from "./design/util.js";
6
7
  import "./page.js";
7
8
  import _sfc_main from "./components/index2.js";
8
9
  import { createRender } from "./render/render.js";
@@ -25,5 +26,6 @@ export {
25
26
  getComponentNames,
26
27
  getDesignMinStr,
27
28
  getStrValue,
29
+ getUuidControl,
28
30
  install
29
31
  };
@@ -39,7 +39,8 @@ function getComponString(name, attarObj, obj = {}, compons = {}) {
39
39
  if (shared.isHTMLTag(tcom) || shared.isSVGTag(tcom)) {
40
40
  return vue.h(tcom, attarObj, getSlots(obj.slots)?.default?.());
41
41
  }
42
- return vue.h(vue.resolveComponent(name), attarObj, getSlots(obj.slots));
42
+ const vh = vue.resolveComponent(name);
43
+ return vue.h(vh, attarObj, getSlots(obj.slots));
43
44
  }
44
45
  function useGetCompon(name, attarObj, obj = {}, compons) {
45
46
  if (typeof name == "string") {
@@ -262,12 +263,12 @@ function getData(obj, params = {}, temps, config$1 = {}) {
262
263
  config.getAttrs(obj, config$1);
263
264
  config.getProps(obj, config$1, params, temps);
264
265
  config.getEmits(obj, config$1, params, temps);
265
- config$1[render.getClassId(params.name)] = "";
266
266
  }
267
267
  function assemblyGetRender(obj, params = {}, temps, getSlots2, setCompon) {
268
268
  if (obj) {
269
269
  const config2 = {};
270
270
  getData(obj, params, temps, config2);
271
+ config2[render.getClassId(params.name)] = "";
271
272
  const rc = getCompon(obj, config2, params, temps);
272
273
  if (rc !== void 0) {
273
274
  return rc;
@@ -314,6 +315,7 @@ exports.getData = getData;
314
315
  exports.getRender = getRender;
315
316
  exports.getSlots = getSlots;
316
317
  exports.getSlotsArray = getSlotsArray;
318
+ exports.getSlotsDom = getSlotsDom;
317
319
  exports.getTempsArr = getTempsArr;
318
320
  exports.isEmpty = isEmpty;
319
321
  exports.useGetCompon = useGetCompon;
@@ -8,6 +8,15 @@ export declare function getSlots(slots: any): Slots | undefined;
8
8
  export declare function useGetCompon(name: any, attarObj: ObjAny, obj?: ObjAny, compons?: ObjAny): VNode | string;
9
9
  export declare function getSlotsArray(obj: ControlRender, key?: string): ControlRender[];
10
10
  export declare function isEmpty(v: any): true | undefined;
11
+ /**
12
+ * 生成插槽代码
13
+ * @param obj
14
+ * @param is
15
+ * @returns
16
+ */
17
+ export declare function getSlotsDom(obj: ControlRender, callback: (slots: ControlRender[], key: string, obj: TempsObjectKey) => void): {
18
+ [key: string]: any;
19
+ };
11
20
  export declare function getTempsArr(temps: Array<TempsObject>, value: TempsObjectKey[], type?: string): TempsObject[];
12
21
  export declare function getData(obj: ControlRender, params: ObjAny | undefined, temps: Array<TempsObject>, config?: ObjAny): void;
13
22
  /**
@@ -37,7 +37,8 @@ function getComponString(name, attarObj, obj = {}, compons = {}) {
37
37
  if (isHTMLTag(tcom) || isSVGTag(tcom)) {
38
38
  return h(tcom, attarObj, getSlots(obj.slots)?.default?.());
39
39
  }
40
- return h(resolveComponent(name), attarObj, getSlots(obj.slots));
40
+ const vh = resolveComponent(name);
41
+ return h(vh, attarObj, getSlots(obj.slots));
41
42
  }
42
43
  function useGetCompon(name, attarObj, obj = {}, compons) {
43
44
  if (typeof name == "string") {
@@ -260,12 +261,12 @@ function getData(obj, params = {}, temps, config = {}) {
260
261
  getAttrs(obj, config);
261
262
  getProps(obj, config, params, temps);
262
263
  getEmits(obj, config, params, temps);
263
- config[getClassId(params.name)] = "";
264
264
  }
265
265
  function assemblyGetRender(obj, params = {}, temps, getSlots2, setCompon) {
266
266
  if (obj) {
267
267
  const config = {};
268
268
  getData(obj, params, temps, config);
269
+ config[getClassId(params.name)] = "";
269
270
  const rc = getCompon(obj, config, params, temps);
270
271
  if (rc !== void 0) {
271
272
  return rc;
@@ -313,6 +314,7 @@ export {
313
314
  getRender,
314
315
  getSlots,
315
316
  getSlotsArray,
317
+ getSlotsDom,
316
318
  getTempsArr,
317
319
  isEmpty,
318
320
  useGetCompon
@@ -57,7 +57,6 @@ function createRender(obj, imports = {}, callback = (id) => id, components = {})
57
57
  }
58
58
  });
59
59
  vue.onUnmounted(() => {
60
- render.unStyle(name);
61
60
  if (obj.config?.unmounted) {
62
61
  config.runCodeBlock(obj.config.unmounted, params);
63
62
  }
@@ -95,6 +94,11 @@ function getComponents(obj, callback, components = {}) {
95
94
  const names = render.getComponentNames(obj);
96
95
  for (const key of names) {
97
96
  if (!rcs[key]) {
97
+ const globalComponent = vue.resolveComponent(key);
98
+ if (typeof globalComponent !== "string" && globalComponent) {
99
+ rcs[key] = globalComponent;
100
+ continue;
101
+ }
98
102
  rcs[key] = getAsyncComponent(async () => {
99
103
  const value = await Promise.resolve(callback(key));
100
104
  if (typeof value === "string") {
@@ -1,7 +1,7 @@
1
1
  import { h, Fragment, defineComponent, provide, reactive, onMounted, onActivated, onDeactivated, onUnmounted, defineAsyncComponent, resolveComponent } from "vue";
2
2
  import { getRender } from "./common.js";
3
3
  import { getObjProps, setCodes, runCodeBlock } from "./config.js";
4
- import { setStyle, unStyle, getComponentNames, isRenderCompon } from "../utils/render.js";
4
+ import { setStyle, getComponentNames, isRenderCompon } from "../utils/render.js";
5
5
  import { lineToLargeHump } from "@fangzhongya/utils/name/lineToLargeHump";
6
6
  function getRenders(params = {}, arrs, temps) {
7
7
  if (arrs) {
@@ -55,7 +55,6 @@ function createRender(obj, imports = {}, callback = (id) => id, components = {})
55
55
  }
56
56
  });
57
57
  onUnmounted(() => {
58
- unStyle(name);
59
58
  if (obj.config?.unmounted) {
60
59
  runCodeBlock(obj.config.unmounted, params);
61
60
  }
@@ -93,6 +92,11 @@ function getComponents(obj, callback, components = {}) {
93
92
  const names = getComponentNames(obj);
94
93
  for (const key of names) {
95
94
  if (!rcs[key]) {
95
+ const globalComponent = resolveComponent(key);
96
+ if (typeof globalComponent !== "string" && globalComponent) {
97
+ rcs[key] = globalComponent;
98
+ continue;
99
+ }
96
100
  rcs[key] = getAsyncComponent(async () => {
97
101
  const value = await Promise.resolve(callback(key));
98
102
  if (typeof value === "string") {
@@ -79,12 +79,7 @@ function extractCssClass(formCssCode) {
79
79
  }
80
80
  return [...new Set(cssNameArray)];
81
81
  }
82
- let r = 1;
83
- function getRandom() {
84
- return r++;
85
- }
86
82
  exports.extractCssClass = extractCssClass;
87
83
  exports.getClass = getClass;
88
84
  exports.getClassName = getClassName;
89
- exports.getRandom = getRandom;
90
85
  exports.setCssSize = setCssSize;
@@ -17,4 +17,3 @@ export declare function getClassName(name: string, obj: RenderCompon): string;
17
17
  * @returns
18
18
  */
19
19
  export declare function extractCssClass(formCssCode: string): string[];
20
- export declare function getRandom(): number;
@@ -77,14 +77,9 @@ function extractCssClass(formCssCode) {
77
77
  }
78
78
  return [...new Set(cssNameArray)];
79
79
  }
80
- let r = 1;
81
- function getRandom() {
82
- return r++;
83
- }
84
80
  export {
85
81
  extractCssClass,
86
82
  getClass,
87
83
  getClassName,
88
- getRandom,
89
84
  setCssSize
90
85
  };
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const vue = require("vue");
4
+ const common = require("../render/common.cjs");
5
+ const draggable = require("./draggable.cjs");
6
+ function setCons(config, drag, obj) {
7
+ let c = config.class || "";
8
+ if (Array.isArray(c)) {
9
+ c = c.join(" ");
10
+ }
11
+ config.class = c + " " + drag.class?.join(" ");
12
+ config.onClick = drag.onClick;
13
+ config.onContextmenu = drag.onContextmenu;
14
+ }
15
+ function getSlotsViewerDom(obj, params = {}, temps, cons = {}) {
16
+ return (config) => {
17
+ setCons(config, cons, obj);
18
+ return common.getSlotsDom(obj, (slots, key, scope) => {
19
+ const ts = common.getTempsArr(temps, [scope]);
20
+ return draggable.getDraggableDiv(
21
+ slots,
22
+ obj,
23
+ params,
24
+ (v, p, c) => {
25
+ return setDesign(v, p, ts, c);
26
+ },
27
+ key
28
+ );
29
+ });
30
+ };
31
+ }
32
+ function setCompon(cons) {
33
+ return (obj, config, slots) => {
34
+ setCons(config, cons, obj);
35
+ let name = obj.name;
36
+ if (name === "PageHtml") {
37
+ name = obj.config?.type || "div";
38
+ }
39
+ return common.useGetCompon(name, config, {
40
+ slots
41
+ });
42
+ };
43
+ }
44
+ function setDesign(obj, params = {}, temps, cons = {}) {
45
+ if (!obj.design?.hide) {
46
+ obj.temps = [...temps];
47
+ return common.assemblyGetRender(
48
+ obj,
49
+ params,
50
+ temps,
51
+ getSlotsViewerDom(obj, params, temps, cons),
52
+ setCompon(cons)
53
+ );
54
+ } else {
55
+ return "";
56
+ }
57
+ }
58
+ function setDesignDag(arr, props, params = {}, temps) {
59
+ return draggable.getDraggableDiv(
60
+ arr,
61
+ props,
62
+ params,
63
+ (v, p, c) => {
64
+ return setDesign(v, params, temps, c);
65
+ }
66
+ );
67
+ }
68
+ function getRender(params = {}, lists, temps) {
69
+ if (lists) {
70
+ return setDesignDag(lists, {}, params, temps);
71
+ } else {
72
+ return vue.h("div", params.attrs, params.slots);
73
+ }
74
+ }
75
+ exports.getRender = getRender;
76
+ exports.setDesign = setDesign;
@@ -0,0 +1,5 @@
1
+ import { VNode } from 'vue';
2
+ export declare function setDesign(obj: ControlDesign, params: ObjAny | undefined, temps: Array<TempsObject>, cons?: ObjAny): VNode | string;
3
+ export declare function getRender(params: ObjAny | undefined, lists: Array<ControlDesign> | undefined, temps: Array<TempsObject>): string | VNode<import('vue').RendererNode, import('vue').RendererElement, {
4
+ [key: string]: any;
5
+ }>;
@@ -0,0 +1,76 @@
1
+ import { h } from "vue";
2
+ import { getSlotsDom, getTempsArr, useGetCompon, assemblyGetRender } from "../render/common.js";
3
+ import { getDraggableDiv } from "./draggable.js";
4
+ function setCons(config, drag, obj) {
5
+ let c = config.class || "";
6
+ if (Array.isArray(c)) {
7
+ c = c.join(" ");
8
+ }
9
+ config.class = c + " " + drag.class?.join(" ");
10
+ config.onClick = drag.onClick;
11
+ config.onContextmenu = drag.onContextmenu;
12
+ }
13
+ function getSlotsViewerDom(obj, params = {}, temps, cons = {}) {
14
+ return (config) => {
15
+ setCons(config, cons, obj);
16
+ return getSlotsDom(obj, (slots, key, scope) => {
17
+ const ts = getTempsArr(temps, [scope]);
18
+ return getDraggableDiv(
19
+ slots,
20
+ obj,
21
+ params,
22
+ (v, p, c) => {
23
+ return setDesign(v, p, ts, c);
24
+ },
25
+ key
26
+ );
27
+ });
28
+ };
29
+ }
30
+ function setCompon(cons) {
31
+ return (obj, config, slots) => {
32
+ setCons(config, cons, obj);
33
+ let name = obj.name;
34
+ if (name === "PageHtml") {
35
+ name = obj.config?.type || "div";
36
+ }
37
+ return useGetCompon(name, config, {
38
+ slots
39
+ });
40
+ };
41
+ }
42
+ function setDesign(obj, params = {}, temps, cons = {}) {
43
+ if (!obj.design?.hide) {
44
+ obj.temps = [...temps];
45
+ return assemblyGetRender(
46
+ obj,
47
+ params,
48
+ temps,
49
+ getSlotsViewerDom(obj, params, temps, cons),
50
+ setCompon(cons)
51
+ );
52
+ } else {
53
+ return "";
54
+ }
55
+ }
56
+ function setDesignDag(arr, props, params = {}, temps) {
57
+ return getDraggableDiv(
58
+ arr,
59
+ props,
60
+ params,
61
+ (v, p, c) => {
62
+ return setDesign(v, params, temps, c);
63
+ }
64
+ );
65
+ }
66
+ function getRender(params = {}, lists, temps) {
67
+ if (lists) {
68
+ return setDesignDag(lists, {}, params, temps);
69
+ } else {
70
+ return h("div", params.attrs, params.slots);
71
+ }
72
+ }
73
+ export {
74
+ getRender,
75
+ setDesign
76
+ };
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const vue = require("vue");
4
+ const util = require("../components/operate/util.cjs");
5
+ require("../config/util.cjs");
6
+ const index = require("../utils/index.cjs");
7
+ require("@fangzhongya/utils/name/humpToLine");
8
+ const cs = index.getClass("viewer-drag");
9
+ function getDraggableDiv(slots, assembly, params, callback, key) {
10
+ const right = vue.inject("right");
11
+ const rkey = vue.inject("rkey");
12
+ const replication = vue.inject("replication");
13
+ const operateRightKey = vue.inject("operateRightKey");
14
+ const onClick = (element) => {
15
+ right.value = element;
16
+ };
17
+ const showRightKey = (event, obj, list, index2) => {
18
+ operateRightKey.value = obj;
19
+ operateRightKey.options = util.getOptions(
20
+ obj,
21
+ replication.value,
22
+ list,
23
+ index2
24
+ );
25
+ operateRightKey.position = {
26
+ x: event.x,
27
+ y: event.y
28
+ };
29
+ operateRightKey.onClickRight = (key2) => {
30
+ util.operateClickKey(key2 + "", obj, list, index2, {
31
+ right,
32
+ rkey,
33
+ replication
34
+ });
35
+ };
36
+ operateRightKey.box = true;
37
+ };
38
+ return vue.h(
39
+ "div",
40
+ {
41
+ class: [cs()]
42
+ },
43
+ slots.map((v, index2) => {
44
+ return callback(v, params, {
45
+ class: [cs("item"), v === right.value ? "__page_on" : ""],
46
+ index: index2,
47
+ list: slots,
48
+ right,
49
+ rkey,
50
+ replication,
51
+ onClick: (e) => {
52
+ e.stopPropagation();
53
+ onClick(v);
54
+ },
55
+ onContextmenu: (event) => {
56
+ const target = event.target;
57
+ if (!target) {
58
+ return;
59
+ }
60
+ event.preventDefault();
61
+ event.stopPropagation();
62
+ showRightKey(
63
+ {
64
+ x: event.clientX,
65
+ y: event.clientY
66
+ },
67
+ v,
68
+ slots,
69
+ index2
70
+ );
71
+ },
72
+ onSet: (event) => {
73
+ showRightKey(
74
+ {
75
+ x: event.clientX,
76
+ y: event.clientY
77
+ },
78
+ v,
79
+ slots,
80
+ index2
81
+ );
82
+ }
83
+ });
84
+ })
85
+ );
86
+ }
87
+ exports.getDraggableDiv = getDraggableDiv;
@@ -0,0 +1,3 @@
1
+ export declare function getDraggableDiv(slots: Array<ControlDesign>, assembly: ControlDesign, params: ObjAny, callback: Function, key?: string): globalThis.VNode<import('vue').RendererNode, import('vue').RendererElement, {
2
+ [key: string]: any;
3
+ }>;
@@ -0,0 +1,87 @@
1
+ import { inject, h } from "vue";
2
+ import { getOptions, operateClickKey } from "../components/operate/util.js";
3
+ import "../config/util.js";
4
+ import { getClass } from "../utils/index.js";
5
+ import "@fangzhongya/utils/name/humpToLine";
6
+ const cs = getClass("viewer-drag");
7
+ function getDraggableDiv(slots, assembly, params, callback, key) {
8
+ const right = inject("right");
9
+ const rkey = inject("rkey");
10
+ const replication = inject("replication");
11
+ const operateRightKey = inject("operateRightKey");
12
+ const onClick = (element) => {
13
+ right.value = element;
14
+ };
15
+ const showRightKey = (event, obj, list, index) => {
16
+ operateRightKey.value = obj;
17
+ operateRightKey.options = getOptions(
18
+ obj,
19
+ replication.value,
20
+ list,
21
+ index
22
+ );
23
+ operateRightKey.position = {
24
+ x: event.x,
25
+ y: event.y
26
+ };
27
+ operateRightKey.onClickRight = (key2) => {
28
+ operateClickKey(key2 + "", obj, list, index, {
29
+ right,
30
+ rkey,
31
+ replication
32
+ });
33
+ };
34
+ operateRightKey.box = true;
35
+ };
36
+ return h(
37
+ "div",
38
+ {
39
+ class: [cs()]
40
+ },
41
+ slots.map((v, index) => {
42
+ return callback(v, params, {
43
+ class: [cs("item"), v === right.value ? "__page_on" : ""],
44
+ index,
45
+ list: slots,
46
+ right,
47
+ rkey,
48
+ replication,
49
+ onClick: (e) => {
50
+ e.stopPropagation();
51
+ onClick(v);
52
+ },
53
+ onContextmenu: (event) => {
54
+ const target = event.target;
55
+ if (!target) {
56
+ return;
57
+ }
58
+ event.preventDefault();
59
+ event.stopPropagation();
60
+ showRightKey(
61
+ {
62
+ x: event.clientX,
63
+ y: event.clientY
64
+ },
65
+ v,
66
+ slots,
67
+ index
68
+ );
69
+ },
70
+ onSet: (event) => {
71
+ showRightKey(
72
+ {
73
+ x: event.clientX,
74
+ y: event.clientY
75
+ },
76
+ v,
77
+ slots,
78
+ index
79
+ );
80
+ }
81
+ });
82
+ })
83
+ );
84
+ }
85
+ export {
86
+ getDraggableDiv
87
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const index_vue_vue_type_script_setup_true_lang = require("./index2.cjs");
4
+ exports.default = index_vue_vue_type_script_setup_true_lang.default;
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./index2.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const viewer = require("./viewer.cjs");
5
+ const util = require("../design/util.cjs");
6
+ const index = require("../utils/index.cjs");
7
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
8
+ __name: "index",
9
+ props: {
10
+ // 对应判断数据
11
+ value: {
12
+ type: Object,
13
+ default() {
14
+ return {};
15
+ }
16
+ }
17
+ },
18
+ setup(__props) {
19
+ const cs = index.getClass("viewer");
20
+ const props = __props;
21
+ const right = vue.inject("right");
22
+ const config = vue.inject("config");
23
+ const onClick = () => {
24
+ right.value = void 0;
25
+ };
26
+ const ViewerAssembly = viewer.createViewer(
27
+ util.getDesignCompon(props.value),
28
+ config?.value.imports
29
+ );
30
+ return (_ctx, _cache) => {
31
+ return vue.openBlock(), vue.createElementBlock("div", {
32
+ class: vue.normalizeClass(vue.unref(cs)()),
33
+ onClick: vue.withModifiers(onClick, ["stop"])
34
+ }, [
35
+ vue.createVNode(vue.unref(ViewerAssembly))
36
+ ], 2);
37
+ };
38
+ }
39
+ });
40
+ exports.default = _sfc_main;
@@ -0,0 +1,40 @@
1
+ import { defineComponent, inject, openBlock, createElementBlock, withModifiers, normalizeClass, unref, createVNode } from "vue";
2
+ import { createViewer } from "./viewer.js";
3
+ import { getDesignCompon } from "../design/util.js";
4
+ import { getClass } from "../utils/index.js";
5
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ __name: "index",
7
+ props: {
8
+ // 对应判断数据
9
+ value: {
10
+ type: Object,
11
+ default() {
12
+ return {};
13
+ }
14
+ }
15
+ },
16
+ setup(__props) {
17
+ const cs = getClass("viewer");
18
+ const props = __props;
19
+ const right = inject("right");
20
+ const config = inject("config");
21
+ const onClick = () => {
22
+ right.value = void 0;
23
+ };
24
+ const ViewerAssembly = createViewer(
25
+ getDesignCompon(props.value),
26
+ config?.value.imports
27
+ );
28
+ return (_ctx, _cache) => {
29
+ return openBlock(), createElementBlock("div", {
30
+ class: normalizeClass(unref(cs)()),
31
+ onClick: withModifiers(onClick, ["stop"])
32
+ }, [
33
+ createVNode(unref(ViewerAssembly))
34
+ ], 2);
35
+ };
36
+ }
37
+ });
38
+ export {
39
+ _sfc_main as default
40
+ };