@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
@@ -0,0 +1,108 @@
1
+ import { defineComponent as _, computed as k, resolveComponent as y, openBlock as p, createBlock as C, unref as o, normalizeClass as g, withCtx as a, createVNode as n, createElementBlock as c, Fragment as h, renderList as b, createTextVNode as N } from "vue";
2
+ import { Form as I, FormItem as d, InputNumber as B, Button as F } from "ant-design-vue";
3
+ import "../../../internal.mjs";
4
+ import { uid as w } from "@king-one/utils";
5
+ import "../../form-icon.vue.mjs";
6
+ import { useNamespace as U } from "../../../hooks/use-namespace/index.mjs";
7
+ import { useInjectDesignContext as V } from "../../../context/design.mjs";
8
+ import $ from "../../form-icon.vue2.mjs";
9
+ const q = /* @__PURE__ */ _({
10
+ __name: "GridProps",
11
+ setup(z) {
12
+ const { b: f } = U("grid-props"), { checkedField: r } = V(), s = k(() => r.value["x-component-props"] || {});
13
+ function v(l) {
14
+ var e;
15
+ (e = r.value.children) == null || e.splice(l, 1);
16
+ }
17
+ function x() {
18
+ var t, i;
19
+ const l = w(), m = {
20
+ title: `列表容器${(((t = r.value.children) == null ? void 0 : t.length) || 0) + 1}`,
21
+ name: l,
22
+ id: l,
23
+ key: "k-grid-column",
24
+ type: "void",
25
+ icon: "form-list",
26
+ children: [],
27
+ "x-component": "GridColumn",
28
+ "x-decorator": "Void",
29
+ "x-component-props": {
30
+ span: 12
31
+ }
32
+ };
33
+ (i = r.value.children) == null || i.push(m);
34
+ }
35
+ return (l, e) => {
36
+ const m = y("AInputNumber");
37
+ return p(), C(o(I), {
38
+ layout: "vertical",
39
+ class: g(o(f)())
40
+ }, {
41
+ default: a(() => [
42
+ n(o(d), { label: "间隔大小" }, {
43
+ default: a(() => [
44
+ n(o(B), {
45
+ value: s.value.gutter,
46
+ "onUpdate:value": e[0] || (e[0] = (t) => s.value.gutter = t),
47
+ style: { width: "100%" },
48
+ min: 1,
49
+ precision: 0,
50
+ max: 999,
51
+ "addon-after": "px"
52
+ }, null, 8, ["value"])
53
+ ]),
54
+ _: 1
55
+ /* STABLE */
56
+ }),
57
+ n(o(d), { label: "配置项" }, {
58
+ default: a(() => [
59
+ (p(!0), c(
60
+ h,
61
+ null,
62
+ b(o(r).children, (t, i) => (p(), c("div", {
63
+ key: t.id,
64
+ class: "col-item"
65
+ }, [
66
+ n(m, {
67
+ value: t["x-component-props"].span,
68
+ "onUpdate:value": (u) => t["x-component-props"].span = u,
69
+ min: 1,
70
+ style: { width: "200px" },
71
+ precision: 0,
72
+ max: 24
73
+ }, null, 8, ["value", "onUpdate:value"]),
74
+ n($, {
75
+ name: "delete1",
76
+ class: "close-icon",
77
+ onClick: (u) => v(i)
78
+ }, null, 8, ["onClick"])
79
+ ]))),
80
+ 128
81
+ /* KEYED_FRAGMENT */
82
+ )),
83
+ n(o(F), {
84
+ size: "small",
85
+ type: "primary",
86
+ style: { "margin-bottom": "10px" },
87
+ onClick: x
88
+ }, {
89
+ default: a(() => e[1] || (e[1] = [
90
+ N(" 添加 + ")
91
+ ])),
92
+ _: 1,
93
+ __: [1]
94
+ })
95
+ ]),
96
+ _: 1
97
+ /* STABLE */
98
+ })
99
+ ]),
100
+ _: 1
101
+ /* STABLE */
102
+ }, 8, ["class"]);
103
+ };
104
+ }
105
+ });
106
+ export {
107
+ q as default
108
+ };
@@ -5,13 +5,15 @@ import "./BaseProps.vue.mjs";
5
5
  import "./SelectProps.vue.mjs";
6
6
  import "./OvertimeProps.vue.mjs";
7
7
  import { propsWidgetDecorator as a } from "./PropsDecorator.mjs";
8
+ import "./GridProps.vue.mjs";
8
9
  import o from "./BaseProps.vue2.mjs";
9
10
  import s from "./InputProps.vue2.mjs";
10
11
  import d from "./TextareaProps.vue2.mjs";
11
12
  import f from "./InputNumberProps.vue2.mjs";
12
13
  import h from "./SelectProps.vue2.mjs";
13
14
  import g from "./OvertimeProps.vue2.mjs";
14
- const _ = {
15
+ import _ from "./GridProps.vue2.mjs";
16
+ const w = {
15
17
  "k-input": {
16
18
  component: [
17
19
  { header: "基础设置", widget: o },
@@ -40,23 +42,28 @@ const _ = {
40
42
  component: [
41
43
  { header: "组件属性", widget: g }
42
44
  ]
45
+ },
46
+ "k-grid": {
47
+ component: [
48
+ { header: "组件属性", widget: _ }
49
+ ]
43
50
  }
44
51
  };
45
- function T(c = []) {
52
+ function z(c = []) {
46
53
  const i = {};
47
- for (const [e, p] of Object.entries(_)) {
48
- const n = [...p.component];
49
- for (const m of c) {
50
- const { keys: r, exclude: t } = m;
54
+ for (const [e, p] of Object.entries(w)) {
55
+ const m = [...p.component];
56
+ for (const n of c) {
57
+ const { keys: r, exclude: t } = n;
51
58
  if (t && (Array.isArray(t) ? t.includes(e) : t.test(e)))
52
59
  continue;
53
- (Array.isArray(r) ? r.includes(e) : r.test(e)) && n.push(m.component);
60
+ (Array.isArray(r) ? r.includes(e) : r.test(e)) && m.push(n.component);
54
61
  }
55
- i[e] = a(e, n);
62
+ i[e] = a(e, m);
56
63
  }
57
64
  return i;
58
65
  }
59
66
  export {
60
- T as expandProps,
61
- _ as widgetProps
67
+ z as expandProps,
68
+ w as widgetProps
62
69
  };
@@ -1,23 +1,28 @@
1
- const e = {
1
+ import { valueTypeMap as e } from "../types.mjs";
2
+ const o = {
2
3
  name: "布局组件",
3
4
  key: "layout",
4
5
  widget: [
5
6
  {
6
- title: "表单布局",
7
+ title: "栅格布局",
7
8
  icon: "k-form-grid",
8
- key: "form-layout",
9
- type: "void",
10
- "x-component": "FormLayout"
9
+ key: "k-grid",
10
+ type: e.void,
11
+ "x-component": "FormGrid",
12
+ "x-component-props": {
13
+ gutter: 20
14
+ },
15
+ "x-decorator": "Void"
11
16
  }
12
17
  ]
13
- }, t = {
18
+ }, a = {
14
19
  name: "基础组件",
15
20
  key: "basic",
16
21
  widget: [
17
22
  {
18
23
  title: "输入框",
19
24
  key: "k-input",
20
- type: "string",
25
+ type: e.string,
21
26
  icon: "form-input",
22
27
  "x-component": "Input",
23
28
  "x-component-props": {
@@ -27,7 +32,7 @@ const e = {
27
32
  {
28
33
  title: "多文本输入框",
29
34
  key: "k-textarea",
30
- type: "string",
35
+ type: e.string,
31
36
  icon: "form-textarea",
32
37
  "x-component": "Textarea",
33
38
  "x-component-props": {
@@ -37,7 +42,7 @@ const e = {
37
42
  {
38
43
  title: "数字输入框",
39
44
  key: "k-input-number",
40
- type: "number",
45
+ type: e.number,
41
46
  icon: "form-number",
42
47
  "x-component": "InputNumber",
43
48
  "x-component-props": {
@@ -47,9 +52,9 @@ const e = {
47
52
  {
48
53
  title: "下拉选择框",
49
54
  key: "k-select",
50
- type: "array",
55
+ type: e.array,
51
56
  items: {
52
- type: "string"
57
+ type: e.string
53
58
  },
54
59
  icon: "form-select",
55
60
  "x-component": "Select",
@@ -73,10 +78,10 @@ const e = {
73
78
  {
74
79
  title: "日期范围",
75
80
  key: "k-date-range",
76
- type: "array",
81
+ type: e.array,
77
82
  format: "date",
78
83
  items: {
79
- type: "string",
84
+ type: e.string,
80
85
  format: "date"
81
86
  },
82
87
  icon: "form-date",
@@ -92,7 +97,7 @@ const e = {
92
97
  {
93
98
  title: "单个日期",
94
99
  key: "k-date-single",
95
- type: "string",
100
+ type: e.string,
96
101
  format: "date",
97
102
  icon: "form-date",
98
103
  "x-component": "InputNumber",
@@ -104,46 +109,46 @@ const e = {
104
109
  {
105
110
  title: "地区选择",
106
111
  key: "k-form-area",
107
- type: "object",
112
+ type: e.object,
108
113
  icon: "form-area",
109
114
  "x-component": "FormArea",
110
115
  children: [
111
116
  {
112
117
  title: "省份",
113
118
  key: "k-form-area-province",
114
- type: "string",
119
+ type: e.string,
115
120
  name: "province"
116
121
  },
117
122
  {
118
123
  title: "城市",
119
124
  key: "k-form-area-city",
120
- type: "string",
125
+ type: e.string,
121
126
  name: "city"
122
127
  },
123
128
  {
124
129
  title: "区县",
125
130
  key: "k-form-area-county",
126
- type: "string",
131
+ type: e.string,
127
132
  name: "county"
128
133
  }
129
134
  ]
130
135
  }
131
136
  ]
132
- }, o = {
137
+ }, r = {
133
138
  name: "扩展组件",
134
139
  key: "extend",
135
140
  widget: [
136
141
  {
137
142
  title: "对象容器",
138
143
  key: "k-object",
139
- type: "object",
144
+ type: e.object,
140
145
  icon: "form-object",
141
146
  children: []
142
147
  },
143
148
  {
144
149
  title: "列表容器",
145
150
  key: "k-array-card",
146
- type: "array",
151
+ type: e.array,
147
152
  icon: "form-list",
148
153
  children: [],
149
154
  "x-component": "ArrayCard",
@@ -152,7 +157,7 @@ const e = {
152
157
  {
153
158
  title: "明细表",
154
159
  key: "k-table",
155
- type: "array",
160
+ type: e.array,
156
161
  icon: "form-table",
157
162
  "x-component": "ArrayTable",
158
163
  "x-decorator-props": {
@@ -160,7 +165,7 @@ const e = {
160
165
  }
161
166
  }
162
167
  ]
163
- }, a = [
168
+ }, n = [
164
169
  {
165
170
  name: "加班模版",
166
171
  key: "overtime",
@@ -168,7 +173,7 @@ const e = {
168
173
  schema: {
169
174
  title: "加班模版",
170
175
  key: "k-overtime",
171
- type: "object",
176
+ type: e.object,
172
177
  name: "overtime",
173
178
  id: "overtime",
174
179
  "x-design-props": {
@@ -181,15 +186,15 @@ const e = {
181
186
  {
182
187
  title: "加班明细",
183
188
  key: "k-array-card",
184
- type: "array",
189
+ type: e.array,
185
190
  children: [
186
191
  {
187
192
  title: "日期范围",
188
193
  key: "k-date-range",
189
- type: "array",
194
+ type: e.array,
190
195
  format: "date",
191
196
  items: {
192
- type: "string",
197
+ type: e.string,
193
198
  format: "date"
194
199
  },
195
200
  "x-component": "DateRange",
@@ -208,13 +213,12 @@ const e = {
208
213
  status: "",
209
214
  message: ""
210
215
  }
211
- },
212
- children: []
216
+ }
213
217
  },
214
218
  {
215
219
  title: "加班时长",
216
220
  key: "k-input-number",
217
- type: "number",
221
+ type: e.number,
218
222
  "x-component": "InputNumber",
219
223
  "x-component-props": {
220
224
  placeholder: "请输入"
@@ -243,7 +247,7 @@ const e = {
243
247
  {
244
248
  title: "总时长",
245
249
  key: "k-input",
246
- type: "string",
250
+ type: e.string,
247
251
  "x-component": "Input",
248
252
  "x-component-props": {
249
253
  placeholder: "请输入"
@@ -267,7 +271,7 @@ const e = {
267
271
  schema: {
268
272
  title: "请假模版",
269
273
  key: "k-leave",
270
- type: "object",
274
+ type: e.object,
271
275
  name: "leave",
272
276
  id: "leave",
273
277
  "x-design-props": {
@@ -280,9 +284,9 @@ const e = {
280
284
  {
281
285
  title: "下拉选择框",
282
286
  key: "k-select",
283
- type: "array",
287
+ type: e.array,
284
288
  items: {
285
- type: "string"
289
+ type: e.string
286
290
  },
287
291
  "x-component": "Select",
288
292
  enum: [
@@ -315,8 +319,8 @@ const e = {
315
319
  }
316
320
  ];
317
321
  export {
318
- t as BaseSchema,
319
- o as ExtendSchema,
320
- e as LayoutSchema,
321
- a as tempSchema
322
+ a as BaseSchema,
323
+ r as ExtendSchema,
324
+ o as LayoutSchema,
325
+ n as tempSchema
322
326
  };
@@ -1,24 +1,25 @@
1
1
  var m = Object.defineProperty;
2
2
  var p = (r, e, s) => e in r ? m(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s;
3
3
  var t = (r, e, s) => p(r, typeof e != "symbol" ? e + "" : e, s);
4
- import { ref as d } from "vue";
4
+ import { ref as c } from "vue";
5
5
  import "../effects/index.mjs";
6
- import { widgetPanels as c } from "../components/panel/index.mjs";
6
+ import { widgetPanels as d } from "../components/panel/index.mjs";
7
7
  import "../components/props/index.mjs";
8
8
  import { Plugin as l } from "../plugins/index.mjs";
9
9
  import { Heart as n } from "./Heart.mjs";
10
- import { FormSchema as g } from "./FormSchema.mjs";
11
- import { widgetProps as a } from "../components/props/widget/index.mjs";
12
- import { runEffects as f } from "../effects/effective.mjs";
13
- class C {
10
+ import { FormSchema as a } from "./FormSchema.mjs";
11
+ import { widgetProps as g } from "../components/props/widget/index.mjs";
12
+ import { DesignEffectDict as f } from "../effects/effect-dict.mjs";
13
+ import { runEffects as u } from "../effects/effective.mjs";
14
+ class N {
14
15
  constructor(e) {
15
16
  t(this, "schema");
16
17
  t(this, "tempSchema");
17
18
  t(this, "heart");
18
19
  t(this, "plugin");
19
- t(this, "FormSchema", new g());
20
+ t(this, "FormSchema", new a());
20
21
  t(this, "props");
21
- t(this, "checkedField", d({}));
22
+ t(this, "checkedField", c({}));
22
23
  t(this, "shared", {
23
24
  draggedContext: {
24
25
  key: "",
@@ -33,15 +34,15 @@ class C {
33
34
  });
34
35
  const { extendFormProps: s = [], propsWidgets: i = {}, panelWidgets: o = {}, ...h } = e;
35
36
  this.shared.panelWidgets = {
36
- ...c,
37
+ ...d,
37
38
  ...o
38
39
  }, this.shared.propsWidgets = {
39
- ...a,
40
+ ...g,
40
41
  ...i
41
42
  }, this.props = { ...h }, this.schema = e.schema, this.tempSchema = e.tempSchema || [], this.plugin = new l(), this.heart = new n({
42
43
  lifecycles: this.lifecycles,
43
44
  context: this
44
- }), this.extendFormProps = s;
45
+ }), this.extendFormProps = s, this.notify(f.ON_DESIGN_INIT);
45
46
  }
46
47
  use(e) {
47
48
  this.plugin.use(e);
@@ -52,11 +53,17 @@ class C {
52
53
  getFieldList() {
53
54
  return this.FormSchema.getFieldList();
54
55
  }
56
+ setFields(e) {
57
+ return this.FormSchema.setFields(e);
58
+ }
59
+ clearFields() {
60
+ return this.FormSchema.clearFields();
61
+ }
55
62
  setCheckedField(e) {
56
63
  this.checkedField.value = e;
57
64
  }
58
65
  get lifecycles() {
59
- return this.props.effects ? f(this, this.props.effects) : [];
66
+ return this.props.effects ? u(this, this.props.effects) : [];
60
67
  }
61
68
  get hooks() {
62
69
  return this.plugin.hooks;
@@ -69,5 +76,5 @@ class C {
69
76
  }
70
77
  }
71
78
  export {
72
- C as FormDesign
79
+ N as FormDesign
73
80
  };
@@ -1,51 +1,74 @@
1
- var n = Object.defineProperty;
2
- var a = (s, e, o) => e in s ? n(s, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : s[e] = o;
3
- var i = (s, e, o) => a(s, typeof e != "symbol" ? e + "" : e, o);
4
- import { ref as c, toRaw as h } from "vue";
5
- import { uid as l } from "@king-one/utils";
6
- import { Field as m } from "./Field.mjs";
7
- class j {
1
+ var h = Object.defineProperty;
2
+ var p = (r, s, t) => s in r ? h(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
3
+ var n = (r, s, t) => p(r, typeof s != "symbol" ? s + "" : s, t);
4
+ import { ref as a, toRaw as m } from "vue";
5
+ import { uid as d } from "@king-one/utils";
6
+ import { Field as f } from "./Field.mjs";
7
+ class g {
8
8
  constructor() {
9
- i(this, "version", "1.0.0");
10
- i(this, "fields", c([]));
9
+ n(this, "version", "1.0.0");
10
+ n(this, "fields", a([]));
11
11
  }
12
12
  getSchema() {
13
- const e = h(this.fields.value);
14
- console.log(e, "s");
15
- const o = this.jsonToschema(e);
13
+ const s = m(this.fields.value);
14
+ console.log(s, "s");
15
+ const t = this.jsonToschema(s);
16
16
  return {
17
17
  version: this.version,
18
18
  form: {
19
- schema: o
19
+ schema: t
20
20
  }
21
21
  };
22
22
  }
23
23
  getFieldList() {
24
- return this.fields.value.map((e) => new m(e));
25
- }
26
- jsonToschema(e, o = {}) {
27
- return e.forEach((r) => {
28
- const t = this.omit(r, ["children"]);
29
- t.type === "object" || t.type === "void" ? o[t.name] = {
30
- ...t,
31
- properties: this.jsonToschema(r.children)
32
- } : t.type === "array" && r.children ? o[t.name] = {
33
- ...t,
34
- items: t.items || {
24
+ return this.fields.value.map((s) => new f(s));
25
+ }
26
+ clearFields() {
27
+ return this.fields.value = [];
28
+ }
29
+ jsonToschema(s, t = {}) {
30
+ return s.forEach((i) => {
31
+ const e = this.omit(i, ["children"]);
32
+ e.type === "object" && i.children ? t[e.name] = {
33
+ ...e,
34
+ properties: this.jsonToschema(i.children)
35
+ } : e.type === "void" && i.children ? t[e.name] = {
36
+ ...e,
37
+ properties: this.jsonToschema(i.children)
38
+ } : e.type === "array" && i.children ? t[e.name] = {
39
+ ...e,
40
+ items: e.items || {
35
41
  type: "object",
36
- id: l(),
37
- properties: this.jsonToschema(r.children)
42
+ id: d(),
43
+ properties: this.jsonToschema(i.children)
38
44
  }
39
- } : o[t.name] = t;
40
- }), o;
45
+ } : t[e.name] = e;
46
+ }), t;
47
+ }
48
+ /**
49
+ * 将 schema 对象格式还原为数组格式
50
+ * @param schema schema 对象
51
+ * @returns FieldSchema[] 数组格式
52
+ */
53
+ schemaToJson(s) {
54
+ const t = [];
55
+ return Object.keys(s).forEach((i) => {
56
+ var l;
57
+ const e = s[i], o = this.omit(e, ["properties", "items"]);
58
+ (e.type === "object" || e.type === "void") && e.properties ? o.children = this.schemaToJson(e.properties) : e.type === "array" && ((l = e.items) != null && l.properties) ? (o.children = this.schemaToJson(e.items.properties), Object.keys(e.items).every((c) => ["type", "id", "properties"].includes(c)) || (o.items = this.omit(e.items, ["properties"]))) : e.type === "array" && e.items && (o.items = e.items), t.push(o);
59
+ }), t;
60
+ }
61
+ setFields(s) {
62
+ const t = this.schemaToJson(s);
63
+ this.fields.value = t;
41
64
  }
42
- omit(e, o) {
43
- const r = { ...e };
44
- return o.forEach((t) => {
45
- delete r[t];
46
- }), r;
65
+ omit(s, t) {
66
+ const i = { ...s };
67
+ return t.forEach((e) => {
68
+ delete i[e];
69
+ }), i;
47
70
  }
48
71
  }
49
72
  export {
50
- j as FormSchema
73
+ g as FormSchema
51
74
  };
@@ -1,6 +1,8 @@
1
1
  import { LifeCycle as r } from "./LifeCycle.mjs";
2
2
  import { runEffects as t } from "./effective.mjs";
3
+ import { DesignEffectDict as i } from "./effect-dict.mjs";
3
4
  export {
5
+ i as DesignEffectDict,
4
6
  r as LifeCycle,
5
7
  t as runEffects
6
8
  };
@@ -1,17 +1,17 @@
1
- var n = Object.defineProperty;
2
- var k = (e, r, a) => r in e ? n(e, r, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[r] = a;
3
- var s = (e, r, a) => k(e, typeof r != "symbol" ? r + "" : r, a);
4
- const u = ["k-array-card", "k-object", "k-table"];
1
+ var o = Object.defineProperty;
2
+ var l = (a, r, e) => r in a ? o(a, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[r] = e;
3
+ var d = (a, r, e) => l(a, typeof r != "symbol" ? r + "" : r, e);
4
+ const k = ["k-array-card", "k-object", "k-table"];
5
5
  class g {
6
6
  constructor() {
7
- s(this, "name", "BaseDragAdd");
7
+ d(this, "name", "BaseDragAdd");
8
8
  }
9
9
  install(r) {
10
- r.hooks.syncDragAdd.tap("formPanelDragAdd", (a) => !0), r.hooks.syncDragAdd.tap("NestedDragAdd", (a) => {
11
- const { region: t, source: c } = a;
12
- if (t === "k-array-card" || t === "k-object" || t === "k-table") {
13
- const d = ["k-array-card", "k-object", "k-table"], { key: o } = c;
14
- return !d.includes(o);
10
+ r.hooks.syncDragAdd.tap("formPanelDragAdd", (e) => !0), r.hooks.syncDragAdd.tap("NestedDragAdd", (e) => {
11
+ const { region: t, source: n } = e, s = ["k-array-card", "k-object", "k-table", "k-grid"];
12
+ if (s.includes(t)) {
13
+ const { key: c } = n;
14
+ return !s.includes(c);
15
15
  }
16
16
  return !0;
17
17
  });
@@ -19,5 +19,5 @@ class g {
19
19
  }
20
20
  export {
21
21
  g as BaseDragAdd,
22
- u as exclusion
22
+ k as exclusion
23
23
  };
@@ -0,0 +1,11 @@
1
+ const o = {
2
+ string: "string",
3
+ number: "number",
4
+ boolean: "boolean",
5
+ object: "object",
6
+ array: "array",
7
+ void: "void"
8
+ };
9
+ export {
10
+ o as valueTypeMap
11
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../internal.js");const s=require("../context/design.js");require("./index.js");const a=require("./types.js"),c=require("../utils/merge.js");require("@king-one/form-design/dist/theme-chalk/index.css");const l=require("../hooks/use-namespace/index.js"),g=require("./form-material.vue.js"),_=require("./form-panel.vue.js"),p=require("./form-setting.vue.js"),{b:d}=l.useNamespace("main"),f={config:{theme:"dark",tags:["frontend","vue"]}},m={config:{language:"zh-CN",tags:["typescript","javascript"]}},v=c.merge(f,m,{});console.log(v);const q=e.defineComponent({name:"FormDesign",props:a.FormDesignProps,setup(u,{slots:n}){const{toolbar:o,setting:r}=n,t=e.ref(!1);return s.useProvideDragContext({isDrag:t,updateDrag:i=>{t.value=i}}),s.useProvideDesignContext(u.design),()=>e.h("form",{class:d()},[e.h(g.default),e.h(_.default,{},{toolbar:o}),e.h(p.default,null,{default:()=>r==null?void 0:r()})])}});exports.default=q;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../internal.js");const s=require("../context/design.js");require("./index.js");const a=require("./types.js"),c=require("../utils/merge.js");require("@king-one/form-design/dist/theme-chalk/index.css");const l=require("../hooks/use-namespace/index.js"),g=require("./form-material.vue.js"),_=require("./form-panel.vue.js"),p=require("./form-setting.vue.js"),{b:d}=l.useNamespace("main"),f={config:{theme:"dark",tags:["frontend","vue"]}},v={config:{language:"zh-CN",tags:["typescript","javascript"]}},m=c.merge(f,v,{});console.log(m);const q=e.defineComponent({name:"FormDesign",props:a.FormDesignProps,setup(u,{slots:n}){const{toolbar:o,setting:r}=n,t=e.ref(!1);return s.useProvideDragContext({isDrag:t,updateDrag:i=>{t.value=i}}),s.useProvideDesignContext(u.design),()=>e.h("div",{class:d()},[e.h(g.default),e.h(_.default,{},{toolbar:o}),e.h(p.default,null,{default:()=>r==null?void 0:r()})])}});exports.default=q;