@king-one/form-design 0.0.24 → 0.0.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/es/src/components/form-desgin.mjs +5 -5
  3. package/dist/es/src/components/form-material.vue.mjs +91 -70
  4. package/dist/es/src/components/form-panel.vue.mjs +44 -32
  5. package/dist/es/src/components/panel/index.mjs +17 -14
  6. package/dist/es/src/components/panel/widget/grid.vue.mjs +4 -0
  7. package/dist/es/src/components/panel/widget/grid.vue2.mjs +117 -0
  8. package/dist/es/src/components/props/widget/GridProps.vue.mjs +4 -0
  9. package/dist/es/src/components/props/widget/GridProps.vue2.mjs +108 -0
  10. package/dist/es/src/components/props/widget/index.mjs +17 -10
  11. package/dist/es/src/config/index.mjs +42 -38
  12. package/dist/es/src/core/Design.mjs +20 -13
  13. package/dist/es/src/core/FormSchema.mjs +57 -34
  14. package/dist/es/src/effects/index.mjs +2 -0
  15. package/dist/es/src/plugins/modules/drag-add.mjs +11 -11
  16. package/dist/es/src/types.mjs +11 -0
  17. package/dist/lib/src/components/form-desgin.js +1 -1
  18. package/dist/lib/src/components/form-material.vue.js +2 -2
  19. package/dist/lib/src/components/form-panel.vue.js +2 -2
  20. package/dist/lib/src/components/panel/index.js +1 -1
  21. package/dist/lib/src/components/panel/widget/grid.vue.js +1 -0
  22. package/dist/lib/src/components/panel/widget/grid.vue2.js +1 -0
  23. package/dist/lib/src/components/props/widget/GridProps.vue.js +1 -0
  24. package/dist/lib/src/components/props/widget/GridProps.vue2.js +1 -0
  25. package/dist/lib/src/components/props/widget/index.js +1 -1
  26. package/dist/lib/src/config/index.js +1 -1
  27. package/dist/lib/src/core/Design.js +1 -1
  28. package/dist/lib/src/core/FormSchema.js +1 -1
  29. package/dist/lib/src/effects/index.js +1 -1
  30. package/dist/lib/src/plugins/modules/drag-add.js +1 -1
  31. package/dist/lib/src/types.js +1 -0
  32. package/dist/theme-chalk/grid-props.css +1 -0
  33. package/dist/theme-chalk/grid.css +1 -0
  34. package/dist/theme-chalk/icon.css +1 -1
  35. package/dist/theme-chalk/index.css +1 -1
  36. package/dist/types/src/components/panel/widget/grid.vue.d.ts +20 -0
  37. package/dist/types/src/components/props/widget/GridProps.vue.d.ts +3 -0
  38. package/dist/types/src/core/Design.d.ts +4 -2
  39. package/dist/types/src/core/FormSchema.d.ts +8 -0
  40. package/dist/types/src/effects/index.d.ts +1 -0
  41. package/dist/types/src/types.d.ts +2 -9
  42. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @king-one/form-design
2
2
 
3
+ ## 0.0.26
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: 新增部分功能
8
+
9
+ ## 0.0.25
10
+
11
+ ### Patch Changes
12
+
13
+ - feat:增加一大波功能,主要为void类型的解析
14
+
3
15
  ## 0.0.24
4
16
 
5
17
  ### Patch Changes
@@ -10,8 +10,8 @@ import l from "./form-material.vue.mjs";
10
10
  import d from "./form-panel.vue.mjs";
11
11
  import D from "./form-setting.vue.mjs";
12
12
  const {
13
- b: _
14
- } = u("main"), v = {
13
+ b: v
14
+ } = u("main"), _ = {
15
15
  config: {
16
16
  theme: "dark",
17
17
  tags: ["frontend", "vue"]
@@ -21,7 +21,7 @@ const {
21
21
  language: "zh-CN",
22
22
  tags: ["typescript", "javascript"]
23
23
  }
24
- }, h = g(v, C, {
24
+ }, h = g(_, C, {
25
25
  // customMerge: () => {
26
26
  // return (target, source) => {
27
27
  // if (Array.isArray(target) && Array.isArray(source)) {
@@ -51,8 +51,8 @@ const w = /* @__PURE__ */ i({
51
51
  updateDrag: (n) => {
52
52
  e.value = n;
53
53
  }
54
- }), f(t.design), () => o("form", {
55
- class: _()
54
+ }), f(t.design), () => o("div", {
55
+ class: v()
56
56
  }, [o(l), o(d, {}, {
57
57
  toolbar: m
58
58
  }), o(D, null, {
@@ -1,29 +1,29 @@
1
- import { defineComponent as O, ref as b, openBlock as l, createElementBlock as d, normalizeClass as u, unref as o, createElementVNode as i, createVNode as a, withCtx as r, createTextVNode as x, Fragment as z, renderList as F, toDisplayString as v, createBlock as J, createCommentVNode as p } from "vue";
1
+ import { defineComponent as J, ref as w, openBlock as l, createElementBlock as m, normalizeClass as u, unref as o, createElementVNode as n, createVNode as a, withCtx as r, createTextVNode as N, Fragment as T, renderList as W, toDisplayString as y, createBlock as K, createCommentVNode as p } from "vue";
2
2
  import "../internal.mjs";
3
- import { RadioGroup as T, RadioButton as w } from "ant-design-vue";
4
- import h from "vuedraggable";
5
- import { uid as W } from "@king-one/utils";
6
- import { useInjectDragContext as G, useInjectDesignContext as K } from "../context/design.mjs";
3
+ import { RadioGroup as L, RadioButton as S } from "ant-design-vue";
4
+ import $ from "vuedraggable";
5
+ import { uid as D } from "@king-one/utils";
6
+ import { useInjectDragContext as M, useInjectDesignContext as U } from "../context/design.mjs";
7
7
  import "./base/Carousel.vue2.mjs";
8
- import N from "./base/widget-icon.mjs";
8
+ import V from "./base/widget-icon.mjs";
9
9
  import { useNamespace as g } from "../hooks/use-namespace/index.mjs";
10
- import L from "./base/Carousel.vue.mjs";
11
- const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { class: "widget-item" }, A = {
10
+ import q from "./base/Carousel.vue.mjs";
11
+ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { class: "widget-item" }, Q = {
12
12
  key: 0,
13
13
  class: "widget-item-icon"
14
- }, H = { class: "widget-item-title" }, P = { class: "template-item" }, Q = {
14
+ }, X = { class: "widget-item-title" }, Y = { class: "template-item" }, Z = {
15
15
  key: 0,
16
16
  class: "template-item-icon"
17
- }, X = { class: "template-item-name" }, de = /* @__PURE__ */ O({
17
+ }, ee = { class: "template-item-name" }, ue = /* @__PURE__ */ J({
18
18
  name: "FormMaterial",
19
19
  __name: "form-material",
20
- setup(Y) {
21
- const y = b(), { updateDrag: m } = G(), { b: S } = g("material"), { b: D } = g("toolbar"), { b: $ } = g("widget"), { b: j } = g("temp"), f = K(), { schema: B, tempSchema: E } = f, _ = b("1");
22
- function I(s) {
23
- const { icon: e, ...t } = s, n = JSON.parse(JSON.stringify(t)), k = W(), c = {
24
- ...n,
25
- name: k,
26
- id: k,
20
+ setup(te) {
21
+ const k = w(), { updateDrag: c } = M(), { b: j } = g("material"), { b: B } = g("toolbar"), { b: E } = g("widget"), { b: I } = g("temp"), f = U(), { schema: R, tempSchema: O } = f, _ = w("1");
22
+ function z(s) {
23
+ const { icon: e, ...t } = s, i = JSON.parse(JSON.stringify(t)), C = D(), d = {
24
+ ...i,
25
+ name: C,
26
+ id: C,
27
27
  "x-design-props": Object.assign({
28
28
  validate: {
29
29
  status: "",
@@ -31,54 +31,75 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
31
31
  }
32
32
  }, s["x-design-props"] || {})
33
33
  };
34
- (n.type === "array" || n.type === "object") && (c.children = []);
35
- const { shared: C } = f;
36
- return C.draggedContext.field = c, C.draggedContext.key = c.key, c;
34
+ if ((i.type === "array" || i.type === "object") && (d.children = []), i.key === "k-grid") {
35
+ const b = [];
36
+ let v = 0;
37
+ for (; v < 2; ) {
38
+ const h = D();
39
+ b.push({
40
+ title: `列表容器${v + 1}`,
41
+ name: h,
42
+ id: h,
43
+ key: "k-grid-column",
44
+ type: "void",
45
+ icon: "form-list",
46
+ children: [],
47
+ "x-component": "GridColumn",
48
+ "x-decorator": "Void",
49
+ "x-component-props": {
50
+ span: 12
51
+ }
52
+ }), v++;
53
+ }
54
+ d.children = b;
55
+ }
56
+ const { shared: x } = f;
57
+ return x.draggedContext.field = d, x.draggedContext.key = d.key, d;
37
58
  }
38
- function R(s) {
59
+ function F(s) {
39
60
  const { schema: e } = s, { shared: t } = f;
40
61
  return t.draggedContext.field = e, t.draggedContext.key = e.key, e;
41
62
  }
42
- function V(s) {
63
+ function G(s) {
43
64
  var e;
44
- (e = y.value) == null || e.goTo(Number(s.target.value) - 1);
65
+ (e = k.value) == null || e.goTo(Number(s.target.value) - 1);
45
66
  }
46
- return (s, e) => (l(), d(
67
+ return (s, e) => (l(), m(
47
68
  "div",
48
69
  {
49
- class: u(o(S)())
70
+ class: u(o(j)())
50
71
  },
51
72
  [
52
- i(
73
+ n(
53
74
  "div",
54
75
  {
55
- class: u(o(D)())
76
+ class: u(o(B)())
56
77
  },
57
78
  [
58
- a(o(T), {
79
+ a(o(L), {
59
80
  value: _.value,
60
81
  "onUpdate:value": e[0] || (e[0] = (t) => _.value = t),
61
82
  "button-style": "solid",
62
83
  size: "default",
63
- onChange: V
84
+ onChange: G
64
85
  }, {
65
86
  default: r(() => [
66
- a(o(w), {
87
+ a(o(S), {
67
88
  class: "toolbar-button",
68
89
  value: "1"
69
90
  }, {
70
91
  default: r(() => e[5] || (e[5] = [
71
- x(" 组件库 ")
92
+ N(" 组件库 ")
72
93
  ])),
73
94
  _: 1,
74
95
  __: [5]
75
96
  }),
76
- a(o(w), {
97
+ a(o(S), {
77
98
  class: "toolbar-button",
78
99
  value: "2"
79
100
  }, {
80
101
  default: r(() => e[6] || (e[6] = [
81
- x(" 业务套件 ")
102
+ N(" 业务套件 ")
82
103
  ])),
83
104
  _: 1,
84
105
  __: [6]
@@ -92,35 +113,35 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
92
113
  /* CLASS */
93
114
  ),
94
115
  a(
95
- L,
116
+ q,
96
117
  {
97
118
  ref_key: "carouselRef",
98
- ref: y,
119
+ ref: k,
99
120
  "model-value": 0
100
121
  },
101
122
  {
102
123
  default: r(() => [
103
- i(
124
+ n(
104
125
  "div",
105
126
  {
106
- class: u(o($)())
127
+ class: u(o(E)())
107
128
  },
108
129
  [
109
- (l(!0), d(
110
- z,
130
+ (l(!0), m(
131
+ T,
111
132
  null,
112
- F(o(B), (t) => (l(), d("div", {
133
+ W(o(R), (t) => (l(), m("div", {
113
134
  key: t.key,
114
135
  class: "widget-group"
115
136
  }, [
116
- i(
137
+ n(
117
138
  "div",
118
- M,
119
- v(t.name),
139
+ A,
140
+ y(t.name),
120
141
  1
121
142
  /* TEXT */
122
143
  ),
123
- t.widget ? (l(), J(o(h), {
144
+ t.widget ? (l(), K(o($), {
124
145
  key: 0,
125
146
  list: t.widget,
126
147
  class: "widget-list-drag",
@@ -128,22 +149,22 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
128
149
  group: { name: "form", pull: "clone", put: !1 },
129
150
  sort: !1,
130
151
  options: { animation: 150 },
131
- clone: I,
132
- onStart: e[1] || (e[1] = (n) => o(m)(!0)),
133
- onEnd: e[2] || (e[2] = (n) => o(m)(!1))
152
+ clone: z,
153
+ onStart: e[1] || (e[1] = (i) => o(c)(!0)),
154
+ onEnd: e[2] || (e[2] = (i) => o(c)(!1))
134
155
  }, {
135
- item: r(({ element: n }) => [
136
- i("div", U, [
137
- i("div", q, [
138
- n.icon ? (l(), d("div", A, [
139
- a(o(N), {
140
- icon: n.icon
156
+ item: r(({ element: i }) => [
157
+ n("div", H, [
158
+ n("div", P, [
159
+ i.icon ? (l(), m("div", Q, [
160
+ a(o(V), {
161
+ icon: i.icon
141
162
  }, null, 8, ["icon"])
142
163
  ])) : p("v-if", !0),
143
- i(
164
+ n(
144
165
  "div",
145
- H,
146
- v(n.title),
166
+ X,
167
+ y(i.title),
147
168
  1
148
169
  /* TEXT */
149
170
  )
@@ -161,34 +182,34 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
161
182
  2
162
183
  /* CLASS */
163
184
  ),
164
- i(
185
+ n(
165
186
  "div",
166
187
  {
167
- class: u(o(j)())
188
+ class: u(o(I)())
168
189
  },
169
190
  [
170
- a(o(h), {
171
- list: o(E),
191
+ a(o($), {
192
+ list: o(O),
172
193
  class: "template-list-drag",
173
194
  "item-key": "key",
174
195
  group: { name: "form", pull: "clone", put: !1 },
175
196
  sort: !1,
176
197
  options: { animation: 150 },
177
- clone: R,
178
- onStart: e[3] || (e[3] = (t) => o(m)(!0)),
179
- onEnd: e[4] || (e[4] = (t) => o(m)(!1))
198
+ clone: F,
199
+ onStart: e[3] || (e[3] = (t) => o(c)(!0)),
200
+ onEnd: e[4] || (e[4] = (t) => o(c)(!1))
180
201
  }, {
181
202
  item: r(({ element: t }) => [
182
- i("div", P, [
183
- t.icon ? (l(), d("div", Q, [
184
- a(o(N), {
203
+ n("div", Y, [
204
+ t.icon ? (l(), m("div", Z, [
205
+ a(o(V), {
185
206
  icon: t.icon
186
207
  }, null, 8, ["icon"])
187
208
  ])) : p("v-if", !0),
188
- i(
209
+ n(
189
210
  "div",
190
- X,
191
- v(t.name),
211
+ ee,
212
+ y(t.name),
192
213
  1
193
214
  /* TEXT */
194
215
  )
@@ -225,5 +246,5 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
225
246
  }
226
247
  });
227
248
  export {
228
- de as default
249
+ ue as default
229
250
  };
@@ -1,38 +1,36 @@
1
- import { defineComponent as z, ref as v, nextTick as A, toRaw as E, openBlock as h, createElementBlock as k, normalizeClass as c, unref as e, createElementVNode as o, createVNode as s, withCtx as i, createCommentVNode as f, renderSlot as C, withDirectives as b, vShow as x } from "vue";
1
+ import { defineComponent as V, ref as v, nextTick as z, toRaw as A, openBlock as h, createElementBlock as C, normalizeClass as c, unref as e, createElementVNode as o, createVNode as s, withCtx as i, createCommentVNode as f, renderSlot as k, withDirectives as x, vShow as b } from "vue";
2
2
  import "../internal.mjs";
3
- import { Tooltip as D, Form as R } from "ant-design-vue";
4
- import T from "vuedraggable";
5
- import { useInjectDragContext as j, useInjectDesignContext as B } from "../context/design.mjs";
3
+ import { Modal as E, Tooltip as D, Form as R } from "ant-design-vue";
4
+ import j from "vuedraggable";
5
+ import { useInjectDragContext as B, useInjectDesignContext as J } from "../context/design.mjs";
6
6
  import "./panel/panel-item.vue2.mjs";
7
- import J from "./base/json-preview.vue.mjs";
7
+ import O from "./base/json-preview.vue.mjs";
8
8
  import "./index.mjs";
9
- import { useNamespace as O } from "../hooks/use-namespace/index.mjs";
9
+ import { useNamespace as M } from "../hooks/use-namespace/index.mjs";
10
10
  import S from "./form-icon.vue2.mjs";
11
11
  import P from "./panel/panel-item.vue.mjs";
12
12
  const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel" }, K = {
13
13
  key: 0,
14
14
  class: "prompt"
15
- }, L = { class: "form-item" }, M = { class: "content-editor" }, le = /* @__PURE__ */ z({
15
+ }, L = { class: "form-item" }, Q = { class: "content-editor" }, ie = /* @__PURE__ */ V({
16
16
  name: "FormPanel",
17
17
  __name: "form-panel",
18
- setup(Q) {
19
- const p = v({}), { isDrag: w } = j(), d = v(!1), a = B(), { fields: r } = a;
18
+ setup(U) {
19
+ const p = v({}), { isDrag: w } = B(), d = v(!1), a = J(), { fields: r } = a;
20
20
  function y() {
21
- d.value = !d.value, A(() => {
21
+ d.value = !d.value, z(() => {
22
22
  p.value = a.getFormSchema();
23
23
  });
24
24
  }
25
- function F() {
26
- }
27
- const { b: $, e: u, em: g } = O("panel");
28
- function I(l, t) {
29
- const n = E(l), { oldIndex: V } = t, m = n[V];
25
+ const { b: F, e: u, em: g } = M("panel");
26
+ function $(l, t) {
27
+ const n = A(l), { oldIndex: T } = t, m = n[T];
30
28
  if (m) {
31
29
  const { shared: _ } = a;
32
30
  _.draggedContext.key = m.key, _.draggedContext.field = m;
33
31
  }
34
32
  }
35
- async function N() {
33
+ async function I() {
36
34
  const { shared: l } = a, { field: t } = l.draggedContext, n = {
37
35
  source: t,
38
36
  traget: r.value,
@@ -40,10 +38,24 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
40
38
  };
41
39
  a.hooks.syncDragAdd.call(n), a.setCheckedField(t);
42
40
  }
43
- return (l, t) => (h(), k(
41
+ function N() {
42
+ E.confirm({
43
+ title: "提示?",
44
+ content: "确定要清空所有字段吗?",
45
+ okText: "确定",
46
+ cancelText: "取消",
47
+ onOk() {
48
+ a.clearFields();
49
+ },
50
+ onCancel() {
51
+ console.log("Cancel");
52
+ }
53
+ });
54
+ }
55
+ return (l, t) => (h(), C(
44
56
  "div",
45
57
  {
46
- class: c(e($)())
58
+ class: c(e(F)())
47
59
  },
48
60
  [
49
61
  o(
@@ -68,7 +80,7 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
68
80
  name: "delete1",
69
81
  class: c(e(g)("toolbar", "icon")),
70
82
  size: 18,
71
- onClick: F
83
+ onClick: N
72
84
  }, null, 8, ["class"])
73
85
  ]),
74
86
  _: 1
@@ -99,7 +111,7 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
99
111
  <FormIcon name="mobile" /> `)
100
112
  ]),
101
113
  o("div", G, [
102
- C(l.$slots, "toolbar")
114
+ k(l.$slots, "toolbar")
103
115
  ])
104
116
  ],
105
117
  2
@@ -112,18 +124,18 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
112
124
  class: c(e(u)("content"))
113
125
  },
114
126
  [
115
- b(o(
127
+ x(o(
116
128
  "div",
117
129
  H,
118
130
  [
119
- !e(w) && e(r).length === 0 ? (h(), k("div", K, " 👈 请在左侧选择控件并拖至此处 ")) : f("v-if", !0),
131
+ !e(w) && e(r).length === 0 ? (h(), C("div", K, " 👈 请在左侧选择控件并拖至此处 ")) : f("v-if", !0),
120
132
  s(e(R), {
121
133
  autocomplete: "off",
122
134
  class: "design-from",
123
135
  "label-align": "left"
124
136
  }, {
125
137
  default: i(() => [
126
- s(e(T), {
138
+ s(e(j), {
127
139
  class: "drag-from",
128
140
  list: e(r),
129
141
  group: { name: "form" },
@@ -131,12 +143,12 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
131
143
  sort: !0,
132
144
  "item-key": "id",
133
145
  "chosen-class": "choose",
134
- onStart: t[0] || (t[0] = (n) => I(e(r), n)),
135
- onAdd: N
146
+ onStart: t[0] || (t[0] = (n) => $(e(r), n)),
147
+ onAdd: I
136
148
  }, {
137
149
  item: i(({ element: n }) => [
138
150
  o("div", L, [
139
- C(l.$slots, `panel-${n.key}`, {}, () => [
151
+ k(l.$slots, `panel-${n.key}`, {}, () => [
140
152
  s(P, {
141
153
  field: n,
142
154
  space: e(r)
@@ -155,18 +167,18 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
155
167
  512
156
168
  /* NEED_PATCH */
157
169
  ), [
158
- [x, !d.value]
170
+ [b, !d.value]
159
171
  ]),
160
- b(o(
172
+ x(o(
161
173
  "div",
162
- M,
174
+ Q,
163
175
  [
164
- s(J, { data: p.value }, null, 8, ["data"])
176
+ s(O, { data: p.value }, null, 8, ["data"])
165
177
  ],
166
178
  512
167
179
  /* NEED_PATCH */
168
180
  ), [
169
- [x, d.value]
181
+ [b, d.value]
170
182
  ])
171
183
  ],
172
184
  2
@@ -179,5 +191,5 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
179
191
  }
180
192
  });
181
193
  export {
182
- le as default
194
+ ie as default
183
195
  };
@@ -1,4 +1,4 @@
1
- import { Input as m, Textarea as o, InputNumber as i } from "ant-design-vue";
1
+ import { Input as t, Textarea as o, InputNumber as i } from "ant-design-vue";
2
2
  import "./widget/object.vue.mjs";
3
3
  import { panelWarpper as r } from "./panel-wrapper.mjs";
4
4
  import "./widget/select.vue.mjs";
@@ -7,26 +7,29 @@ import "./widget/date-range.vue.mjs";
7
7
  import "./widget/date-single.vue.mjs";
8
8
  import "./widget/kit.vue.mjs";
9
9
  import "./widget/array-table.vue.mjs";
10
- import e from "./widget/select.vue2.mjs";
11
- import p from "./widget/object.vue2.mjs";
10
+ import "./widget/grid.vue.mjs";
11
+ import p from "./widget/select.vue2.mjs";
12
+ import e from "./widget/object.vue2.mjs";
12
13
  import a from "./widget/date-range.vue2.mjs";
13
14
  import n from "./widget/date-single.vue2.mjs";
14
15
  import f from "./widget/array-card.vue2.mjs";
15
- import t from "./widget/kit.vue2.mjs";
16
- import c from "./widget/array-table.vue2.mjs";
17
- const s = r(m), _ = r(o), k = r(i), W = {
16
+ import m from "./widget/kit.vue2.mjs";
17
+ import _ from "./widget/array-table.vue2.mjs";
18
+ import c from "./widget/grid.vue2.mjs";
19
+ const s = r(t), k = r(o), u = r(i), z = {
18
20
  "k-input": s,
19
- "k-textarea": _,
20
- "k-input-number": k,
21
- "k-select": e,
22
- "k-object": p,
21
+ "k-textarea": k,
22
+ "k-input-number": u,
23
+ "k-select": p,
24
+ "k-object": e,
23
25
  "k-date-range": a,
24
26
  "k-date-single": n,
25
27
  "k-array-card": f,
26
- "k-overtime": t,
27
- "k-leave": t,
28
- "k-table": c
28
+ "k-overtime": m,
29
+ "k-leave": m,
30
+ "k-table": _,
31
+ "k-grid": c
29
32
  };
30
33
  export {
31
- W as widgetPanels
34
+ z as widgetPanels
32
35
  };
@@ -0,0 +1,4 @@
1
+ import f from "./grid.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,117 @@
1
+ import { defineComponent as w, toRaw as b, openBlock as l, createElementBlock as g, normalizeClass as p, unref as i, createElementVNode as c, toDisplayString as v, createVNode as f, mergeProps as D, withCtx as m, Fragment as S, renderList as A, createBlock as I, renderSlot as R } from "vue";
2
+ import _ from "vuedraggable";
3
+ import { message as B, Row as N, Col as u } from "ant-design-vue";
4
+ import "../../../index.mjs";
5
+ import "../../../internal.mjs";
6
+ import { useNamespace as h } from "../../../hooks/use-namespace/index.mjs";
7
+ import { useInjectDesignContext as $ } from "../../../context/design.mjs";
8
+ import E from "../panel-item.vue.mjs";
9
+ const V = { class: "form-item" }, J = /* @__PURE__ */ w({
10
+ __name: "grid",
11
+ props: {
12
+ field: {}
13
+ },
14
+ setup(a) {
15
+ const { b: x } = h("grid-widget"), { b: k } = h("panel-drag"), d = $();
16
+ function y(o, r) {
17
+ const n = b(o), { oldIndex: s } = r, e = n[s];
18
+ if (e) {
19
+ const { shared: t } = d;
20
+ t.draggedContext.key = e.key, t.draggedContext.field = e;
21
+ }
22
+ }
23
+ function C() {
24
+ const { shared: o } = d, { field: r } = o.draggedContext, n = {
25
+ source: r,
26
+ traget: a.field.children,
27
+ region: "k-grid"
28
+ };
29
+ if (d.hooks.syncDragAdd.call(n), !d.dragAddResult.every((e) => e)) {
30
+ const e = a.field.children.findIndex((t) => t.id === r.id);
31
+ e !== -1 && (a.field.children.splice(e, 1), B.warning("不能将该控件拖拽到列表容器中"));
32
+ }
33
+ }
34
+ return (o, r) => (l(), g(
35
+ "div",
36
+ {
37
+ class: p(i(x)())
38
+ },
39
+ [
40
+ c(
41
+ "div",
42
+ null,
43
+ v(o.field.title),
44
+ 1
45
+ /* TEXT */
46
+ ),
47
+ f(
48
+ i(N),
49
+ D(i(u)["x-component-props"], { class: "grid-row" }),
50
+ {
51
+ default: m(() => [
52
+ (l(!0), g(
53
+ S,
54
+ null,
55
+ A(o.field.children, (n, s) => {
56
+ var e;
57
+ return l(), I(i(u), {
58
+ key: s,
59
+ span: ((e = n["x-component-props"]) == null ? void 0 : e.span) || 12,
60
+ class: "grid-col"
61
+ }, {
62
+ default: m(() => [
63
+ f(i(_), {
64
+ list: n.children,
65
+ group: { name: "form" },
66
+ animation: 300,
67
+ sort: !0,
68
+ class: p(i(k)()),
69
+ "item-key": "id",
70
+ "chosen-class": "choose",
71
+ onStart: (t) => y(n.children, t),
72
+ onAdd: C
73
+ }, {
74
+ item: m(({ element: t }) => [
75
+ c("div", V, [
76
+ R(o.$slots, `panel-${t.key}`, {}, () => [
77
+ f(i(E), {
78
+ field: t,
79
+ space: n.children
80
+ }, null, 8, ["field", "space"])
81
+ ])
82
+ ])
83
+ ]),
84
+ _: 2
85
+ /* DYNAMIC */
86
+ }, 1032, ["list", "class", "onStart"])
87
+ ]),
88
+ _: 2
89
+ /* DYNAMIC */
90
+ }, 1032, ["span"]);
91
+ }),
92
+ 128
93
+ /* KEYED_FRAGMENT */
94
+ ))
95
+ ]),
96
+ _: 3
97
+ /* FORWARDED */
98
+ },
99
+ 16
100
+ /* FULL_PROPS */
101
+ ),
102
+ r[0] || (r[0] = c(
103
+ "div",
104
+ { style: { color: "#c0bebe", "text-align": "center", width: "90%", padding: "5px" } },
105
+ " ☝ 拖拽控件到容器内部 ",
106
+ -1
107
+ /* CACHED */
108
+ ))
109
+ ],
110
+ 2
111
+ /* CLASS */
112
+ ));
113
+ }
114
+ });
115
+ export {
116
+ J as default
117
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./GridProps.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };