@king-one/form-design 0.0.17 → 0.0.19

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 (116) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/es/index.mjs +16 -13
  3. package/dist/es/src/components/base/Carousel.vue.mjs +92 -0
  4. package/dist/es/src/components/base/Carousel.vue2.mjs +4 -0
  5. package/dist/es/src/components/base/json-preview.vue.mjs +215 -151
  6. package/dist/es/src/components/form-material.vue.mjs +168 -94
  7. package/dist/es/src/components/form-panel.vue.mjs +65 -60
  8. package/dist/es/src/components/panel/index.mjs +26 -13
  9. package/dist/es/src/components/panel/panel-item.vue.mjs +39 -39
  10. package/dist/es/src/components/panel/panel-wrapper.mjs +25 -15
  11. package/dist/es/src/components/panel/widget/array-card.vue2.mjs +39 -26
  12. package/dist/es/src/components/panel/widget/array-table.vue.mjs +4 -0
  13. package/dist/es/src/components/panel/widget/array-table.vue2.mjs +105 -0
  14. package/dist/es/src/components/panel/widget/date-range.vue.mjs +4 -0
  15. package/dist/es/src/components/panel/widget/date-range.vue2.mjs +28 -0
  16. package/dist/es/src/components/panel/widget/date-single.vue.mjs +4 -0
  17. package/dist/es/src/components/panel/widget/date-single.vue2.mjs +28 -0
  18. package/dist/es/src/components/panel/widget/kit.vue.mjs +4 -0
  19. package/dist/es/src/components/panel/widget/kit.vue2.mjs +48 -0
  20. package/dist/es/src/components/panel/widget/object.vue2.mjs +41 -30
  21. package/dist/es/src/components/panel/widget/select.vue2.mjs +3 -3
  22. package/dist/es/src/components/props/form-config.vue.mjs +1 -1
  23. package/dist/es/src/components/props/widget/BaseProps.vue2.mjs +31 -46
  24. package/dist/es/src/components/props/widget/InputNumberProps.vue2.mjs +94 -109
  25. package/dist/es/src/components/props/widget/InputProps.vue2.mjs +49 -64
  26. package/dist/es/src/components/props/widget/OvertimeProps.vue.mjs +4 -0
  27. package/dist/es/src/components/props/widget/OvertimeProps.vue2.mjs +17 -0
  28. package/dist/es/src/components/props/widget/PropsDecorator.mjs +34 -0
  29. package/dist/es/src/components/props/widget/SelectProps.vue.mjs +4 -0
  30. package/dist/es/src/components/props/widget/SelectProps.vue2.mjs +88 -0
  31. package/dist/es/src/components/props/widget/TextareaProps.vue2.mjs +48 -63
  32. package/dist/es/src/components/props/widget/index.mjs +44 -36
  33. package/dist/es/src/config/index.mjs +235 -16
  34. package/dist/es/src/core/Design.mjs +24 -16
  35. package/dist/es/src/core/Field.mjs +1 -1
  36. package/dist/es/src/core/FormSchema.mjs +29 -27
  37. package/dist/es/src/index.mjs +15 -13
  38. package/dist/es/src/internal.mjs +5 -4
  39. package/dist/es/src/plugins/index.mjs +23 -8
  40. package/dist/es/src/plugins/modules/drag-add.mjs +23 -0
  41. package/dist/es/src/utils/debounce.mjs +16 -0
  42. package/dist/es/src/utils/index.mjs +15 -13
  43. package/dist/lib/index.js +1 -1
  44. package/dist/lib/src/components/base/Carousel.vue.js +1 -0
  45. package/dist/lib/src/components/base/Carousel.vue2.js +1 -0
  46. package/dist/lib/src/components/base/json-preview.vue.js +6 -6
  47. package/dist/lib/src/components/form-material.vue.js +10 -1
  48. package/dist/lib/src/components/form-panel.vue.js +2 -2
  49. package/dist/lib/src/components/panel/index.js +1 -1
  50. package/dist/lib/src/components/panel/panel-item.vue.js +1 -1
  51. package/dist/lib/src/components/panel/panel-wrapper.js +1 -1
  52. package/dist/lib/src/components/panel/widget/array-card.vue2.js +1 -1
  53. package/dist/lib/src/components/panel/widget/array-table.vue.js +1 -0
  54. package/dist/lib/src/components/panel/widget/array-table.vue2.js +1 -0
  55. package/dist/lib/src/components/panel/widget/date-range.vue.js +1 -0
  56. package/dist/lib/src/components/panel/widget/date-range.vue2.js +1 -0
  57. package/dist/lib/src/components/panel/widget/date-single.vue.js +1 -0
  58. package/dist/lib/src/components/panel/widget/date-single.vue2.js +1 -0
  59. package/dist/lib/src/components/panel/widget/kit.vue.js +1 -0
  60. package/dist/lib/src/components/panel/widget/kit.vue2.js +1 -0
  61. package/dist/lib/src/components/panel/widget/object.vue2.js +1 -1
  62. package/dist/lib/src/components/panel/widget/select.vue2.js +1 -1
  63. package/dist/lib/src/components/props/form-config.vue.js +1 -1
  64. package/dist/lib/src/components/props/widget/BaseProps.vue2.js +1 -1
  65. package/dist/lib/src/components/props/widget/InputNumberProps.vue2.js +1 -1
  66. package/dist/lib/src/components/props/widget/InputProps.vue2.js +1 -1
  67. package/dist/lib/src/components/props/widget/OvertimeProps.vue.js +1 -0
  68. package/dist/lib/src/components/props/widget/OvertimeProps.vue2.js +1 -0
  69. package/dist/lib/src/components/props/widget/PropsDecorator.js +1 -0
  70. package/dist/lib/src/components/props/widget/SelectProps.vue.js +1 -0
  71. package/dist/lib/src/components/props/widget/SelectProps.vue2.js +1 -0
  72. package/dist/lib/src/components/props/widget/TextareaProps.vue2.js +1 -1
  73. package/dist/lib/src/components/props/widget/index.js +1 -1
  74. package/dist/lib/src/config/index.js +1 -1
  75. package/dist/lib/src/core/Design.js +1 -1
  76. package/dist/lib/src/core/Field.js +1 -1
  77. package/dist/lib/src/core/FormSchema.js +1 -1
  78. package/dist/lib/src/index.js +1 -1
  79. package/dist/lib/src/internal.js +1 -1
  80. package/dist/lib/src/plugins/index.js +1 -1
  81. package/dist/lib/src/plugins/modules/drag-add.js +1 -0
  82. package/dist/lib/src/utils/debounce.js +1 -0
  83. package/dist/lib/src/utils/index.js +1 -1
  84. package/dist/theme-chalk/array-table.css +1 -0
  85. package/dist/theme-chalk/carousel.css +1 -0
  86. package/dist/theme-chalk/icon.css +1 -1
  87. package/dist/theme-chalk/index.css +1 -1
  88. package/dist/theme-chalk/json-preview.css +1 -1
  89. package/dist/theme-chalk/kit-panel.css +1 -0
  90. package/dist/theme-chalk/material.css +1 -1
  91. package/dist/theme-chalk/panel-item.css +1 -1
  92. package/dist/theme-chalk/panel.css +1 -1
  93. package/dist/types/src/components/base/Carousel.vue.d.ts +65 -0
  94. package/dist/types/src/components/panel/panel-item.vue.d.ts +2 -0
  95. package/dist/types/src/components/panel/panel-wrapper.d.ts +11 -1
  96. package/dist/types/src/components/panel/widget/array-table.vue.d.ts +20 -0
  97. package/dist/types/src/components/panel/widget/date-range.vue.d.ts +8 -0
  98. package/dist/types/src/components/panel/widget/date-single.vue.d.ts +8 -0
  99. package/dist/types/src/components/panel/widget/kit.vue.d.ts +8 -0
  100. package/dist/types/src/components/props/widget/OvertimeProps.vue.d.ts +3 -0
  101. package/dist/types/src/components/props/widget/PropsDecorator.d.ts +3 -0
  102. package/dist/types/src/components/props/widget/SelectProps.vue.d.ts +3 -0
  103. package/dist/types/src/components/props/widget/index.d.ts +1 -9
  104. package/dist/types/src/components/types.d.ts +4 -3
  105. package/dist/types/src/config/index.d.ts +2 -1
  106. package/dist/types/src/core/Design.d.ts +95 -42
  107. package/dist/types/src/core/FormSchema.d.ts +22 -10
  108. package/dist/types/src/hooks/usePolling.d.ts +5 -0
  109. package/dist/types/src/index.d.ts +1 -0
  110. package/dist/types/src/internal.d.ts +1 -0
  111. package/dist/types/src/plugins/index.d.ts +5 -2
  112. package/dist/types/src/plugins/modules/drag-add.d.ts +6 -0
  113. package/dist/types/src/types.d.ts +29 -6
  114. package/dist/types/src/utils/debounce.d.ts +10 -0
  115. package/dist/types/src/utils/index.d.ts +1 -0
  116. package/package.json +2 -2
@@ -1,68 +1,68 @@
1
- import { defineComponent as j, computed as g, openBlock as n, createElementBlock as b, normalizeClass as f, withModifiers as F, unref as t, createBlock as d, resolveDynamicComponent as $, withCtx as z, createElementVNode as A, createCommentVNode as r, createVNode as M, defineAsyncComponent as O } from "vue";
2
- import { FormItem as S, Tooltip as T } from "ant-design-vue";
1
+ import { defineComponent as V, computed as g, openBlock as n, createElementBlock as b, normalizeClass as p, withModifiers as j, unref as t, createBlock as a, resolveDynamicComponent as w, withCtx as z, createElementVNode as $, createCommentVNode as r, createVNode as x, defineAsyncComponent as A } from "vue";
2
+ import { FormItem as M, Tooltip as O } from "ant-design-vue";
3
3
  import "../../internal.mjs";
4
- import { useInjectDesignContext as W } from "../../context/design.mjs";
4
+ import { useInjectDesignContext as S } from "../../context/design.mjs";
5
5
  import "../index.mjs";
6
- import { useNamespace as _ } from "../../hooks/use-namespace/index.mjs";
7
- import p from "../form-icon.vue2.mjs";
6
+ import { useNamespace as W } from "../../hooks/use-namespace/index.mjs";
7
+ import m from "../form-icon.vue2.mjs";
8
8
  const q = {
9
9
  key: 2,
10
10
  class: "icons"
11
- }, R = /* @__PURE__ */ j({
11
+ }, U = /* @__PURE__ */ V({
12
12
  __name: "panel-item",
13
13
  props: {
14
14
  field: {},
15
- space: {}
15
+ space: {},
16
+ hideTitle: { type: Boolean }
16
17
  },
17
- setup(D) {
18
- const o = D, { b: I, e: m, m: u } = _("panel-item"), v = W(), { checkedField: a, shared: N } = v;
19
- function w(e, i = {}) {
18
+ setup(B) {
19
+ const o = B, { b: D, e: u, m: v } = W("panel-item"), c = S(), { checkedField: d, shared: I } = c;
20
+ function N(e, i = {}) {
20
21
  return Object.entries(e).forEach(([l, s]) => {
21
- typeof s == "function" ? i[l] = O(s) : i[l] = s;
22
+ typeof s == "function" ? i[l] = A(s) : i[l] = s;
22
23
  }), i;
23
24
  }
24
- const k = w(N.panelWidgets);
25
- function B(e) {
26
- a.value = e;
25
+ const k = N(I.panelWidgets);
26
+ function E(e) {
27
+ c.setCheckedField(e);
27
28
  }
28
- const c = g(() => {
29
+ const f = g(() => {
29
30
  var i, l;
30
- return ((l = (i = o.field["k-design-props"]) == null ? void 0 : i.validate) == null ? void 0 : l.status) === "error";
31
- }), E = g(() => {
31
+ return ((l = (i = o.field["x-design-props"]) == null ? void 0 : i.validate) == null ? void 0 : l.status) === "error";
32
+ }), F = g(() => {
32
33
  var i;
33
- const e = [I()];
34
- return ((i = a.value) == null ? void 0 : i.id) === o.field.id && e.push(u("active")), c.value && e.push(u("error")), e;
34
+ const e = [D()];
35
+ return ((i = d.value) == null ? void 0 : i.id) === o.field.id && e.push(v("active")), f.value && e.push(v("error")), e;
35
36
  });
36
- function V() {
37
- if (!v.hooks.beforeDelete.call(o.field))
37
+ function T() {
38
+ if (!c.hooks.beforeDelete.call(o.field))
38
39
  return;
39
40
  const i = o.space.findIndex((l) => l.id === o.field.id);
40
41
  i !== -1 && o.space.splice(i, 1);
41
42
  }
42
43
  return (e, i) => {
43
- var l, s, y, C, h;
44
+ var l, s, C, h, y;
44
45
  return n(), b(
45
46
  "div",
46
47
  {
47
- class: f(E.value),
48
- onClick: i[0] || (i[0] = F((x) => B(e.field), ["stop"]))
48
+ class: p(F.value),
49
+ onClick: i[0] || (i[0] = j((G) => E(e.field), ["stop"]))
49
50
  },
50
51
  [
51
- t(k)[e.field.key] ? (n(), d($(t(k)[e.field.key]), {
52
+ t(k)[e.field.key] ? (n(), a(w(t(k)[e.field.key]), {
52
53
  key: 0,
53
- style: { width: "100%" },
54
- readonly: "",
54
+ "hide-title": e.hideTitle,
55
55
  field: e.field
56
- }, null, 8, ["field"])) : (n(), d(t(S), {
56
+ }, null, 8, ["hide-title", "field"])) : (n(), a(t(M), {
57
57
  key: 1,
58
- class: f(t(m)("form")),
58
+ class: p(t(u)("form")),
59
59
  label: e.field.title
60
60
  }, {
61
61
  default: z(() => [
62
- A(
62
+ $(
63
63
  "div",
64
64
  {
65
- class: f(t(m)("error"))
65
+ class: p(t(u)("error"))
66
66
  },
67
67
  " 未定义组件 ",
68
68
  2
@@ -72,26 +72,26 @@ const q = {
72
72
  _: 1
73
73
  /* STABLE */
74
74
  }, 8, ["class", "label"])),
75
- ((l = t(a)) == null ? void 0 : l.id) === e.field.id || c.value ? (n(), b("div", q, [
76
- ((s = t(a)) == null ? void 0 : s.id) === e.field.id ? (n(), d(t(p), {
75
+ ((l = t(d)) == null ? void 0 : l.id) === e.field.id || f.value ? (n(), b("div", q, [
76
+ ((s = t(d)) == null ? void 0 : s.id) === e.field.id ? (n(), a(t(m), {
77
77
  key: 0,
78
78
  name: "copy",
79
79
  class: "panel-icon",
80
80
  size: 15
81
81
  })) : r("v-if", !0),
82
- ((y = t(a)) == null ? void 0 : y.id) === e.field.id ? (n(), d(t(p), {
82
+ ((C = t(d)) == null ? void 0 : C.id) === e.field.id ? (n(), a(t(m), {
83
83
  key: 1,
84
84
  name: "delete1",
85
85
  class: "panel-icon",
86
86
  size: 15,
87
- onClick: V
87
+ onClick: T
88
88
  })) : r("v-if", !0),
89
- M(t(T), {
90
- title: (h = (C = e.field["k-design-props"]) == null ? void 0 : C.validate) == null ? void 0 : h.message,
89
+ x(t(O), {
90
+ title: (y = (h = e.field["x-design-props"]) == null ? void 0 : h.validate) == null ? void 0 : y.message,
91
91
  color: "pink"
92
92
  }, {
93
93
  default: z(() => [
94
- c.value ? (n(), d(t(p), {
94
+ f.value ? (n(), a(t(m), {
95
95
  key: 0,
96
96
  name: "exclamation-circle-filled",
97
97
  size: 13,
@@ -110,5 +110,5 @@ const q = {
110
110
  }
111
111
  });
112
112
  export {
113
- R as default
113
+ U as default
114
114
  };
@@ -1,30 +1,40 @@
1
- import { defineComponent as n, createVNode as m, h as a } from "vue";
2
- import { FormItem as l } from "ant-design-vue";
1
+ import { defineComponent as a, createVNode as n, h as p } from "vue";
2
+ import { FormItem as i } from "ant-design-vue";
3
3
  import "../../internal.mjs";
4
- import { defaultNamespace as f } from "../../hooks/use-namespace/index.mjs";
5
- function s(o) {
6
- return /* @__PURE__ */ n({
4
+ import { defaultNamespace as m } from "../../hooks/use-namespace/index.mjs";
5
+ function s(t) {
6
+ return /* @__PURE__ */ a({
7
7
  name: "panelWarpper",
8
8
  props: {
9
9
  field: {
10
10
  type: Object
11
+ },
12
+ hideTitle: {
13
+ type: Boolean,
14
+ default: !1
11
15
  }
12
16
  },
13
17
  setup(e) {
14
- var r;
15
- const p = (r = e.field) == null ? void 0 : r["k-component-props"];
18
+ var l;
19
+ const r = (l = e.field) == null ? void 0 : l["x-component-props"];
16
20
  return () => {
17
- var t;
18
- return m(l, {
19
- class: [`${f}-panel-item__form`],
20
- label: (t = e.field) == null ? void 0 : t.title
21
+ var o;
22
+ return n("div", null, [e.hideTitle ? p(t, {
23
+ ...r,
24
+ readonly: !0
25
+ }) : n(i, {
26
+ class: [`${m}-panel-item__form`],
27
+ label: (o = e.field) == null ? void 0 : o.title
21
28
  }, {
22
- default: () => a(o, {
23
- ...p,
24
- readonly: !0
29
+ default: () => p(t, {
30
+ ...r,
31
+ readonly: !0,
32
+ style: {
33
+ width: "100%"
34
+ }
25
35
  }),
26
36
  _: 1
27
- }, 8, ["label"]);
37
+ }, 8, ["label"])]);
28
38
  };
29
39
  }
30
40
  });
@@ -1,52 +1,65 @@
1
- import { defineComponent as u, toRaw as g, openBlock as h, createElementBlock as y, createElementVNode as n, toDisplayString as k, createVNode as l, unref as r, normalizeClass as C, withCtx as v, renderSlot as b } from "vue";
2
- import w from "vuedraggable";
1
+ import { defineComponent as p, toRaw as h, openBlock as y, createElementBlock as k, createElementVNode as o, toDisplayString as x, createVNode as c, unref as a, normalizeClass as C, withCtx as v, renderSlot as w } from "vue";
2
+ import A from "vuedraggable";
3
3
  import "../../../internal.mjs";
4
+ import { message as D } from "ant-design-vue";
4
5
  import "../../../index.mjs";
5
- import { useInjectDesignContext as x } from "../../../context/design.mjs";
6
- import { useNamespace as S } from "../../../hooks/use-namespace/index.mjs";
7
- import D from "../panel-item.vue.mjs";
8
- const N = { class: "form-item" }, j = /* @__PURE__ */ u({
6
+ import { useInjectDesignContext as b } from "../../../context/design.mjs";
7
+ import { useNamespace as I } from "../../../hooks/use-namespace/index.mjs";
8
+ import S from "../panel-item.vue.mjs";
9
+ const N = { class: "form-item" }, F = /* @__PURE__ */ p({
9
10
  inheritAttrs: !1,
10
11
  __name: "array-card",
11
12
  props: {
12
13
  field: {}
13
14
  },
14
15
  setup(s) {
15
- const a = x(), { b: d } = S("panel-drag");
16
+ const i = b(), { b: f } = I("panel-drag");
16
17
  function m() {
17
18
  return !0;
18
19
  }
19
- function c(e, t) {
20
- const o = g(e), { oldIndex: f } = t, i = o[f];
21
- if (i) {
22
- const { shared: p } = a;
23
- p.draggedContext.key = i.key;
20
+ function g(e, t) {
21
+ const n = h(e), { oldIndex: l } = t, r = n[l];
22
+ if (r) {
23
+ const { shared: d } = i;
24
+ d.draggedContext.key = r.key, d.draggedContext.field = r;
24
25
  }
25
26
  }
26
- return console.log(s.field), (e, t) => (h(), y("div", null, [
27
- n(
27
+ function u() {
28
+ const { shared: e } = i, { field: t } = e.draggedContext, n = {
29
+ source: t,
30
+ traget: s.field.children,
31
+ region: "k-array-card"
32
+ };
33
+ if (i.hooks.syncDragAdd.call(n), !i.dragAddResult.every((r) => r)) {
34
+ const r = s.field.children.findIndex((d) => d.id === t.id);
35
+ r !== -1 && (s.field.children.splice(r, 1), D.warning("不能将该控件拖拽到列表容器中"));
36
+ }
37
+ }
38
+ return (e, t) => (y(), k("div", null, [
39
+ o(
28
40
  "div",
29
41
  null,
30
- k(e.field.title),
42
+ x(e.field.title),
31
43
  1
32
44
  /* TEXT */
33
45
  ),
34
- n("div", null, [
35
- l(r(w), {
46
+ o("div", null, [
47
+ c(a(A), {
36
48
  list: e.field.children,
37
- class: C(r(d)()),
49
+ class: C(a(f)()),
38
50
  group: { name: "form", put: m },
39
51
  animation: 300,
40
52
  sort: !0,
41
53
  "item-key": "id",
42
54
  "chosen-class": "choose",
43
- onStart: t[0] || (t[0] = (o) => c(e.field.children, o))
55
+ onStart: t[0] || (t[0] = (n) => g(e.field.children, n)),
56
+ onAdd: u
44
57
  }, {
45
- item: v(({ element: o }) => [
46
- n("div", N, [
47
- b(e.$slots, `panel-${o.key}`, {}, () => [
48
- l(r(D), {
49
- field: o,
58
+ item: v(({ element: n }) => [
59
+ o("div", N, [
60
+ w(e.$slots, `panel-${n.key}`, {}, () => [
61
+ c(a(S), {
62
+ field: n,
50
63
  space: e.field.children
51
64
  }, null, 8, ["field", "space"])
52
65
  ])
@@ -55,7 +68,7 @@ const N = { class: "form-item" }, j = /* @__PURE__ */ u({
55
68
  _: 3
56
69
  /* FORWARDED */
57
70
  }, 8, ["list", "class", "group"]),
58
- t[1] || (t[1] = n(
71
+ t[1] || (t[1] = o(
59
72
  "div",
60
73
  { style: { color: "#c0bebe", "text-align": "center", width: "90%", padding: "5px" } },
61
74
  " ☝ 拖拽控件到容器内部 ",
@@ -67,5 +80,5 @@ const N = { class: "form-item" }, j = /* @__PURE__ */ u({
67
80
  }
68
81
  });
69
82
  export {
70
- j as default
83
+ F as default
71
84
  };
@@ -0,0 +1,4 @@
1
+ import f from "./array-table.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,105 @@
1
+ import { defineComponent as f, openBlock as g, createElementBlock as p, normalizeClass as b, unref as l, createElementVNode as e, createVNode as o, withCtx as y, renderSlot as u, toDisplayString as v } from "vue";
2
+ import h from "vuedraggable";
3
+ import "../../../index.mjs";
4
+ import "../../../internal.mjs";
5
+ import { message as x } from "ant-design-vue";
6
+ import { useInjectDesignContext as _ } from "../../../context/design.mjs";
7
+ import { useNamespace as C } from "../../../hooks/use-namespace/index.mjs";
8
+ import k from "../panel-item.vue.mjs";
9
+ const A = { class: "array-table-box" }, D = { class: "array-table-drag" }, w = { class: "form-item" }, I = { class: "table-item" }, N = { class: "array-table-drag-header" }, $ = { class: "array-table-drag-content" }, T = /* @__PURE__ */ f({
10
+ name: "ArrayTable",
11
+ __name: "array-table",
12
+ props: {
13
+ field: {}
14
+ },
15
+ setup(s) {
16
+ const d = _(), { b: n } = C("array-table");
17
+ function c() {
18
+ const { shared: a } = d, { field: t } = a.draggedContext, r = {
19
+ source: t,
20
+ traget: s.field.children,
21
+ region: "k-array-card"
22
+ };
23
+ if (d.hooks.syncDragAdd.call(r), !d.dragAddResult.every((i) => i)) {
24
+ const i = s.field.children.findIndex((m) => m.id === t.id);
25
+ i !== -1 && (s.field.children.splice(i, 1), x.warning("不能将该控件拖拽到列表容器中"));
26
+ }
27
+ }
28
+ return (a, t) => (g(), p(
29
+ "div",
30
+ {
31
+ class: b(l(n)())
32
+ },
33
+ [
34
+ t[1] || (t[1] = e(
35
+ "div",
36
+ null,
37
+ "明细列表",
38
+ -1
39
+ /* CACHED */
40
+ )),
41
+ e("div", A, [
42
+ t[0] || (t[0] = e(
43
+ "div",
44
+ { class: "array-table-left" },
45
+ [
46
+ e("div", { class: "array-table-drag-header" }, " 表头 "),
47
+ e("div", { class: "array-table-drag-content" })
48
+ ],
49
+ -1
50
+ /* CACHED */
51
+ )),
52
+ e("div", D, [
53
+ o(l(h), {
54
+ class: "widget-drag",
55
+ list: a.field.children,
56
+ group: { name: "form", direction: "vertical", removeCloneOnHide: !1 },
57
+ animation: 300,
58
+ sort: !0,
59
+ "item-key": "id",
60
+ "drag-class": "table-item-drag-class",
61
+ onAdd: c
62
+ }, {
63
+ item: y(({ element: r }) => [
64
+ e("div", w, [
65
+ u(a.$slots, `panel-${r.key}`, {}, () => [
66
+ e("div", I, [
67
+ e(
68
+ "div",
69
+ N,
70
+ v(r.title),
71
+ 1
72
+ /* TEXT */
73
+ ),
74
+ e("div", $, [
75
+ o(l(k), {
76
+ field: r,
77
+ space: a.field.children,
78
+ "hide-title": ""
79
+ }, null, 8, ["field", "space"])
80
+ ])
81
+ ])
82
+ ])
83
+ ])
84
+ ]),
85
+ _: 3
86
+ /* FORWARDED */
87
+ }, 8, ["list"])
88
+ ])
89
+ ]),
90
+ t[2] || (t[2] = e(
91
+ "div",
92
+ { style: { color: "#c0bebe", "text-align": "center", width: "90%", padding: "5px" } },
93
+ " ☝ 拖拽控件到明细列表 ",
94
+ -1
95
+ /* CACHED */
96
+ ))
97
+ ],
98
+ 2
99
+ /* CLASS */
100
+ ));
101
+ }
102
+ });
103
+ export {
104
+ T as default
105
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./date-range.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,28 @@
1
+ import { defineComponent as r, openBlock as t, createBlock as n, unref as o, withCtx as l, createVNode as p, mergeProps as a } from "vue";
2
+ import { FormItem as f, RangePicker as m } from "ant-design-vue";
3
+ const u = /* @__PURE__ */ r({
4
+ __name: "date-range",
5
+ props: {
6
+ field: {}
7
+ },
8
+ setup(i) {
9
+ return (e, c) => (t(), n(o(f), {
10
+ label: e.field.title
11
+ }, {
12
+ default: l(() => [
13
+ p(
14
+ o(m),
15
+ a(e.field["x-component-props"], { open: !1 }),
16
+ null,
17
+ 16
18
+ /* FULL_PROPS */
19
+ )
20
+ ]),
21
+ _: 1
22
+ /* STABLE */
23
+ }, 8, ["label"]));
24
+ }
25
+ });
26
+ export {
27
+ u as default
28
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./date-single.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,28 @@
1
+ import { defineComponent as r, openBlock as t, createBlock as l, unref as o, withCtx as a, createVNode as n, normalizeProps as p, guardReactiveProps as i } from "vue";
2
+ import { FormItem as m, DatePicker as c } from "ant-design-vue";
3
+ const _ = /* @__PURE__ */ r({
4
+ __name: "date-single",
5
+ props: {
6
+ field: {}
7
+ },
8
+ setup(f) {
9
+ return (e, s) => (t(), l(o(m), {
10
+ label: e.field.title
11
+ }, {
12
+ default: a(() => [
13
+ n(
14
+ o(c),
15
+ p(i(e.field["x-component-props"])),
16
+ null,
17
+ 16
18
+ /* FULL_PROPS */
19
+ )
20
+ ]),
21
+ _: 1
22
+ /* STABLE */
23
+ }, 8, ["label"]));
24
+ }
25
+ });
26
+ export {
27
+ _ as default
28
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./kit.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,48 @@
1
+ import { defineComponent as f, defineAsyncComponent as m, openBlock as t, createElementBlock as s, normalizeClass as u, unref as i, Fragment as C, renderList as k, createBlock as y, resolveDynamicComponent as _ } from "vue";
2
+ import "../../../internal.mjs";
3
+ import { useInjectDesignContext as g } from "../../../context/design.mjs";
4
+ import { useNamespace as h } from "../../../hooks/use-namespace/index.mjs";
5
+ const D = /* @__PURE__ */ f({
6
+ __name: "kit",
7
+ props: {
8
+ field: {}
9
+ },
10
+ setup(v) {
11
+ const { b: l } = h("kit-panel"), c = g(), { shared: a } = c;
12
+ function d(o, n = {}) {
13
+ return Object.entries(o).forEach(([e, r]) => {
14
+ typeof r == "function" ? n[e] = m(r) : n[e] = r;
15
+ }), n;
16
+ }
17
+ const p = d(a.panelWidgets);
18
+ return (o, n) => (t(), s(
19
+ "div",
20
+ {
21
+ class: u(i(l)())
22
+ },
23
+ [
24
+ (t(!0), s(
25
+ C,
26
+ null,
27
+ k(o.field.children, (e) => (t(), s("div", {
28
+ key: e.id,
29
+ class: "kit-item"
30
+ }, [
31
+ (t(), y(_(i(p)[e.key]), {
32
+ style: { width: "100%" },
33
+ readonly: "",
34
+ field: e
35
+ }, null, 8, ["field"]))
36
+ ]))),
37
+ 128
38
+ /* KEYED_FRAGMENT */
39
+ ))
40
+ ],
41
+ 2
42
+ /* CLASS */
43
+ ));
44
+ }
45
+ });
46
+ export {
47
+ D as default
48
+ };
@@ -1,52 +1,63 @@
1
- import { defineComponent as u, toRaw as g, openBlock as h, createElementBlock as k, createElementVNode as n, toDisplayString as y, createVNode as l, unref as i, normalizeClass as C, withCtx as b, renderSlot as v } from "vue";
2
- import w from "vuedraggable";
1
+ import { defineComponent as p, toRaw as u, openBlock as h, createElementBlock as k, createElementVNode as r, toDisplayString as x, createVNode as c, unref as l, normalizeClass as y, withCtx as C, renderSlot as b } from "vue";
2
+ import v from "vuedraggable";
3
3
  import "../../../internal.mjs";
4
4
  import "../../../index.mjs";
5
- import { useInjectDesignContext as x } from "../../../context/design.mjs";
6
- import { useNamespace as S } from "../../../hooks/use-namespace/index.mjs";
7
- import D from "../panel-item.vue.mjs";
8
- const N = { class: "form-item" }, _ = /* @__PURE__ */ u({
5
+ import { message as A } from "ant-design-vue";
6
+ import { useInjectDesignContext as w } from "../../../context/design.mjs";
7
+ import { useNamespace as D } from "../../../hooks/use-namespace/index.mjs";
8
+ import I from "../panel-item.vue.mjs";
9
+ const S = { class: "form-item" }, q = /* @__PURE__ */ p({
9
10
  inheritAttrs: !1,
10
11
  __name: "object",
11
12
  props: {
12
13
  field: {}
13
14
  },
14
15
  setup(s) {
15
- const a = x(), { b: d } = S("panel-drag");
16
- function m() {
17
- return !0;
16
+ const i = w(), { b: f } = D("panel-drag");
17
+ function m(e, t) {
18
+ const n = u(e), { oldIndex: a } = t, o = n[a];
19
+ if (o) {
20
+ const { shared: d } = i;
21
+ d.draggedContext.key = o.key, d.draggedContext.field = o;
22
+ }
18
23
  }
19
- function c(e, t) {
20
- const o = g(e), { oldIndex: f } = t, r = o[f];
21
- if (r) {
22
- const { shared: p } = a;
23
- p.draggedContext.key = r.key;
24
+ function g() {
25
+ console.log("dragAdd");
26
+ const { shared: e } = i, { field: t } = e.draggedContext, n = {
27
+ source: t,
28
+ traget: s.field.children,
29
+ region: "k-object"
30
+ };
31
+ if (i.hooks.syncDragAdd.call(n), !i.dragAddResult.every((o) => o)) {
32
+ const o = s.field.children.findIndex((d) => d.id === t.id);
33
+ o !== -1 && (s.field.children.splice(o, 1), A.warning("不能将该控件拖拽到对象容器中"));
24
34
  }
25
35
  }
26
- return console.log(s.field), (e, t) => (h(), k("div", null, [
27
- n(
36
+ return (e, t) => (h(), k("div", null, [
37
+ r(
28
38
  "div",
29
39
  null,
30
- y(e.field.title),
40
+ x(e.field.title),
31
41
  1
32
42
  /* TEXT */
33
43
  ),
34
- n("div", null, [
35
- l(i(w), {
44
+ r("div", null, [
45
+ c(l(v), {
36
46
  list: e.field.children,
37
- class: C(i(d)()),
38
- group: { name: "form", put: m },
47
+ class: y(l(f)()),
48
+ group: { name: "form" },
39
49
  animation: 300,
40
50
  sort: !0,
41
51
  "item-key": "id",
42
52
  "chosen-class": "choose",
43
- onStart: t[0] || (t[0] = (o) => c(e.field.children, o))
53
+ onStart: t[0] || (t[0] = (n) => m(e.field.children, n)),
54
+ onAdd: g
44
55
  }, {
45
- item: b(({ element: o }) => [
46
- n("div", N, [
47
- v(e.$slots, `panel-${o.key}`, {}, () => [
48
- l(i(D), {
49
- field: o,
56
+ item: C(({ element: n }) => [
57
+ r("div", S, [
58
+ b(e.$slots, `panel-${n.key}`, {}, () => [
59
+ c(l(I), {
60
+ field: n,
50
61
  space: e.field.children
51
62
  }, null, 8, ["field", "space"])
52
63
  ])
@@ -54,8 +65,8 @@ const N = { class: "form-item" }, _ = /* @__PURE__ */ u({
54
65
  ]),
55
66
  _: 3
56
67
  /* FORWARDED */
57
- }, 8, ["list", "class", "group"]),
58
- t[1] || (t[1] = n(
68
+ }, 8, ["list", "class"]),
69
+ t[1] || (t[1] = r(
59
70
  "div",
60
71
  { style: { color: "#c0bebe", "text-align": "center", width: "90%", padding: "5px" } },
61
72
  " ☝ 拖拽控件到布局容器内部 ",
@@ -67,5 +78,5 @@ const N = { class: "form-item" }, _ = /* @__PURE__ */ u({
67
78
  }
68
79
  });
69
80
  export {
70
- _ as default
81
+ q as default
71
82
  };