@king-one/form-design 0.0.28 → 0.0.30

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @king-one/form-design
2
2
 
3
+ ## 0.0.30
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: 加班配置增加时长
8
+
9
+ ## 0.0.29
10
+
11
+ ### Patch Changes
12
+
13
+ - feat:重构表单数据定义,部分规则改为children
14
+
3
15
  ## 0.0.28
4
16
 
5
17
  ### Patch Changes
package/dist/es/index.mjs CHANGED
@@ -5,19 +5,21 @@ import { useInjectDesignContext as f } from "./src/context/design.mjs";
5
5
  import { default as p } from "./src/components/form-desgin.mjs";
6
6
  import { CreateFormDesign as i } from "./src/core/index.mjs";
7
7
  import { default as l } from "./src/components/props/form-config.vue.mjs";
8
- import { BaseSchema as d, ExtendSchema as c, LayoutSchema as h, tempSchema as C } from "./src/config/index.mjs";
9
- import { onDesignFieldChange as F, onDesignInit as S } from "./src/effects/onEffects.mjs";
8
+ import { jsonToSchema as c } from "./src/utils/schema.mjs";
9
+ import { BaseSchema as h, ExtendSchema as C, LayoutSchema as D, tempSchema as F } from "./src/config/index.mjs";
10
+ import { onDesignFieldChange as I, onDesignInit as j } from "./src/effects/onEffects.mjs";
10
11
  export {
11
- d as BaseSchema,
12
+ h as BaseSchema,
12
13
  t as Carousel,
13
14
  i as CreateFormDesign,
14
- c as ExtendSchema,
15
+ C as ExtendSchema,
15
16
  l as FormConfig,
16
17
  p as FormDesign,
17
18
  a as FormPanelItem,
18
- h as LayoutSchema,
19
- F as onDesignFieldChange,
20
- S as onDesignInit,
21
- C as tempSchema,
19
+ D as LayoutSchema,
20
+ c as jsonToSchema,
21
+ I as onDesignFieldChange,
22
+ j as onDesignInit,
23
+ F as tempSchema,
22
24
  f as useInjectDesignContext
23
25
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as J, ref as w, openBlock as r, createElementBlock as m, normalizeClass as p, unref as o, createElementVNode as n, createVNode as a, withCtx as l, createTextVNode as N, Fragment as T, renderList as W, toDisplayString as y, createBlock as K, createCommentVNode as u } from "vue";
1
+ import { defineComponent as J, ref as h, openBlock as l, createElementBlock as d, 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 k, createBlock as K, createCommentVNode as p } from "vue";
2
2
  import "../internal.mjs";
3
3
  import { RadioGroup as L, RadioButton as S } from "ant-design-vue";
4
4
  import $ from "vuedraggable";
@@ -14,16 +14,16 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
14
14
  }, X = { class: "widget-item-title" }, Y = { class: "template-item" }, Z = {
15
15
  key: 0,
16
16
  class: "template-item-icon"
17
- }, ee = { class: "template-item-name" }, pe = /* @__PURE__ */ J({
17
+ }, ee = { class: "template-item-name" }, ue = /* @__PURE__ */ J({
18
18
  name: "FormMaterial",
19
19
  __name: "form-material",
20
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");
21
+ const y = h(), { updateDrag: m } = M(), { b: B } = g("material"), { b: E } = g("toolbar"), { b: I } = g("widget"), { b: R } = g("temp"), f = U(), { schema: j, tempSchema: O } = f, _ = h("1");
22
22
  function z(s) {
23
- const { icon: e, ...t } = s, i = JSON.parse(JSON.stringify(t)), x = D(), d = {
23
+ const { icon: e, ...t } = s, i = JSON.parse(JSON.stringify(t)), C = D(), c = {
24
24
  ...i,
25
- name: x,
26
- id: x,
25
+ name: C,
26
+ id: C,
27
27
  "x-design-props": Object.assign({
28
28
  validate: {
29
29
  status: "",
@@ -31,53 +31,48 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
31
31
  }
32
32
  }, s["x-design-props"] || {})
33
33
  };
34
- if ((i.type === "array" || i.type === "object") && (d.children = []), i.key === "k-grid") {
34
+ if (i.key === "k-grid") {
35
35
  const b = [];
36
36
  let v = 0;
37
37
  for (; v < 2; ) {
38
- const h = D();
38
+ const w = D();
39
39
  b.push({
40
40
  title: `栅格容器${v + 1}`,
41
- name: h,
42
- id: h,
41
+ name: w,
42
+ id: w,
43
43
  key: "k-grid-column",
44
44
  type: "void",
45
- icon: "form-list",
46
45
  children: [],
47
46
  "x-component": "GridColumn",
48
47
  "x-decorator": "Void",
49
48
  "x-component-props": {
50
49
  span: 12
51
- },
52
- "x-design-props": {
53
- "convert-key": "properties",
54
- "convert-type": "base"
55
50
  }
56
51
  }), v++;
57
52
  }
58
- d.children = b;
53
+ c.children = b;
59
54
  }
60
- const { shared: C } = f;
61
- return C.draggedContext.field = d, C.draggedContext.key = d.key, d;
55
+ const { shared: x } = f;
56
+ return x.draggedContext.field = c, x.draggedContext.key = c.key, c;
62
57
  }
63
58
  function F(s) {
64
59
  const { schema: e } = s, { shared: t } = f;
65
- return t.draggedContext.field = e, t.draggedContext.key = e.key, e;
60
+ return t.draggedContext.field = e, t.draggedContext.key = e.key || "", e;
66
61
  }
67
62
  function G(s) {
68
63
  var e;
69
- (e = k.value) == null || e.goTo(Number(s.target.value) - 1);
64
+ (e = y.value) == null || e.goTo(Number(s.target.value) - 1);
70
65
  }
71
- return (s, e) => (r(), m(
66
+ return (s, e) => (l(), d(
72
67
  "div",
73
68
  {
74
- class: p(o(j)())
69
+ class: u(o(B)())
75
70
  },
76
71
  [
77
72
  n(
78
73
  "div",
79
74
  {
80
- class: p(o(B)())
75
+ class: u(o(E)())
81
76
  },
82
77
  [
83
78
  a(o(L), {
@@ -87,12 +82,12 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
87
82
  size: "default",
88
83
  onChange: G
89
84
  }, {
90
- default: l(() => [
85
+ default: r(() => [
91
86
  a(o(S), {
92
87
  class: "toolbar-button",
93
88
  value: "1"
94
89
  }, {
95
- default: l(() => e[5] || (e[5] = [
90
+ default: r(() => e[5] || (e[5] = [
96
91
  N(" 组件库 ")
97
92
  ])),
98
93
  _: 1,
@@ -102,7 +97,7 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
102
97
  class: "toolbar-button",
103
98
  value: "2"
104
99
  }, {
105
- default: l(() => e[6] || (e[6] = [
100
+ default: r(() => e[6] || (e[6] = [
106
101
  N(" 业务套件 ")
107
102
  ])),
108
103
  _: 1,
@@ -120,32 +115,32 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
120
115
  q,
121
116
  {
122
117
  ref_key: "carouselRef",
123
- ref: k,
118
+ ref: y,
124
119
  "model-value": 0
125
120
  },
126
121
  {
127
- default: l(() => [
122
+ default: r(() => [
128
123
  n(
129
124
  "div",
130
125
  {
131
- class: p(o(E)())
126
+ class: u(o(I)())
132
127
  },
133
128
  [
134
- (r(!0), m(
129
+ (l(!0), d(
135
130
  T,
136
131
  null,
137
- W(o(R), (t) => (r(), m("div", {
132
+ W(o(j), (t) => (l(), d("div", {
138
133
  key: t.key,
139
134
  class: "widget-group"
140
135
  }, [
141
136
  n(
142
137
  "div",
143
138
  A,
144
- y(t.name),
139
+ k(t.name),
145
140
  1
146
141
  /* TEXT */
147
142
  ),
148
- t.widget ? (r(), K(o($), {
143
+ t.widget ? (l(), K(o($), {
149
144
  key: 0,
150
145
  list: t.widget,
151
146
  class: "widget-list-drag",
@@ -154,21 +149,21 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
154
149
  sort: !1,
155
150
  options: { animation: 150 },
156
151
  clone: z,
157
- onStart: e[1] || (e[1] = (i) => o(c)(!0)),
158
- onEnd: e[2] || (e[2] = (i) => o(c)(!1))
152
+ onStart: e[1] || (e[1] = (i) => o(m)(!0)),
153
+ onEnd: e[2] || (e[2] = (i) => o(m)(!1))
159
154
  }, {
160
- item: l(({ element: i }) => [
155
+ item: r(({ element: i }) => [
161
156
  n("div", H, [
162
157
  n("div", P, [
163
- i.icon ? (r(), m("div", Q, [
158
+ i.icon ? (l(), d("div", Q, [
164
159
  a(o(V), {
165
160
  icon: i.icon
166
161
  }, null, 8, ["icon"])
167
- ])) : u("v-if", !0),
162
+ ])) : p("v-if", !0),
168
163
  n(
169
164
  "div",
170
165
  X,
171
- y(i.title),
166
+ k(i.title),
172
167
  1
173
168
  /* TEXT */
174
169
  )
@@ -177,7 +172,7 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
177
172
  ]),
178
173
  _: 2
179
174
  /* DYNAMIC */
180
- }, 1032, ["list"])) : u("v-if", !0)
175
+ }, 1032, ["list"])) : p("v-if", !0)
181
176
  ]))),
182
177
  128
183
178
  /* KEYED_FRAGMENT */
@@ -189,7 +184,7 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
189
184
  n(
190
185
  "div",
191
186
  {
192
- class: p(o(I)())
187
+ class: u(o(R)())
193
188
  },
194
189
  [
195
190
  a(o($), {
@@ -200,20 +195,20 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
200
195
  sort: !1,
201
196
  options: { animation: 150 },
202
197
  clone: F,
203
- onStart: e[3] || (e[3] = (t) => o(c)(!0)),
204
- onEnd: e[4] || (e[4] = (t) => o(c)(!1))
198
+ onStart: e[3] || (e[3] = (t) => o(m)(!0)),
199
+ onEnd: e[4] || (e[4] = (t) => o(m)(!1))
205
200
  }, {
206
- item: l(({ element: t }) => [
201
+ item: r(({ element: t }) => [
207
202
  n("div", Y, [
208
- t.icon ? (r(), m("div", Z, [
203
+ t.icon ? (l(), d("div", Z, [
209
204
  a(o(V), {
210
205
  icon: t.icon
211
206
  }, null, 8, ["icon"])
212
- ])) : u("v-if", !0),
207
+ ])) : p("v-if", !0),
213
208
  n(
214
209
  "div",
215
210
  ee,
216
- y(t.name),
211
+ k(t.name),
217
212
  1
218
213
  /* TEXT */
219
214
  )
@@ -222,7 +217,7 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
222
217
  _: 1
223
218
  /* STABLE */
224
219
  }, 8, ["list"]),
225
- u(` <div class="template-list">
220
+ p(` <div class="template-list">
226
221
  <div v-for="g in tempSchema" :key="g.key" class="template-item">
227
222
  <div v-if="g.icon" class="template-item-icon">
228
223
  <WidgetIcon :icon="g.icon" />
@@ -250,5 +245,5 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
250
245
  }
251
246
  });
252
247
  export {
253
- pe as default
248
+ ue as default
254
249
  };
@@ -28,7 +28,7 @@ const V = { class: "form-item" }, J = /* @__PURE__ */ w({
28
28
  };
29
29
  if (d.hooks.syncDragAdd.call(n), !d.dragAddResult.every((e) => e)) {
30
30
  const e = a.field.children.findIndex((t) => t.id === r.id);
31
- e !== -1 && (a.field.children.splice(e, 1), B.warning("不能将该控件拖拽到列表容器中"));
31
+ e !== -1 && (a.field.children.splice(e, 1), B.warning("不能将该控件拖拽到明细表中"));
32
32
  }
33
33
  }
34
34
  return (o, r) => (l(), g(
@@ -1,5 +1,5 @@
1
- import { defineComponent as _, computed as k, openBlock as s, createBlock as y, unref as t, normalizeClass as g, withCtx as p, createVNode as n, createElementBlock as c, Fragment as h, renderList as C, createTextVNode as b } from "vue";
2
- import { Form as B, FormItem as u, InputNumber as d, Button as F } from "ant-design-vue";
1
+ import { defineComponent as _, computed as k, openBlock as m, createBlock as y, unref as t, normalizeClass as g, withCtx as p, createVNode as n, createElementBlock as u, Fragment as h, renderList as C, createTextVNode as b } from "vue";
2
+ import { Form as B, FormItem as c, InputNumber as d, Button as F } from "ant-design-vue";
3
3
  import "../../../internal.mjs";
4
4
  import { uid as N } from "@king-one/utils";
5
5
  import "../../form-icon.vue.mjs";
@@ -9,43 +9,38 @@ import U from "../../form-icon.vue2.mjs";
9
9
  const T = /* @__PURE__ */ _({
10
10
  __name: "GridProps",
11
11
  setup(V) {
12
- const { b: f } = w("grid-props"), { checkedField: r } = I(), m = k(() => r.value["x-component-props"] || {});
12
+ const { b: f } = w("grid-props"), { checkedField: r } = I(), s = k(() => r.value["x-component-props"] || {});
13
13
  function v(l) {
14
14
  var e;
15
15
  (e = r.value.children) == null || e.splice(l, 1);
16
16
  }
17
17
  function x() {
18
- var a, i;
18
+ var i, a;
19
19
  const l = N(), o = {
20
- title: `栅格容器${(((a = r.value.children) == null ? void 0 : a.length) || 0) + 1}`,
20
+ title: `栅格容器${(((i = r.value.children) == null ? void 0 : i.length) || 0) + 1}`,
21
21
  name: l,
22
22
  id: l,
23
23
  key: "k-grid-column",
24
24
  type: "void",
25
- icon: "form-list",
26
25
  children: [],
27
26
  "x-component": "GridColumn",
28
27
  "x-decorator": "Void",
29
28
  "x-component-props": {
30
29
  span: 12
31
- },
32
- "x-design-props": {
33
- "convert-key": "properties",
34
- "convert-type": "base"
35
30
  }
36
31
  };
37
- (i = r.value.children) == null || i.push(o);
32
+ (a = r.value.children) == null || a.push(o);
38
33
  }
39
- return (l, e) => (s(), y(t(B), {
34
+ return (l, e) => (m(), y(t(B), {
40
35
  layout: "vertical",
41
36
  class: g(t(f)())
42
37
  }, {
43
38
  default: p(() => [
44
- n(t(u), { label: "间隔大小" }, {
39
+ n(t(c), { label: "间隔大小" }, {
45
40
  default: p(() => [
46
41
  n(t(d), {
47
- value: m.value.gutter,
48
- "onUpdate:value": e[0] || (e[0] = (o) => m.value.gutter = o),
42
+ value: s.value.gutter,
43
+ "onUpdate:value": e[0] || (e[0] = (o) => s.value.gutter = o),
49
44
  style: { width: "100%" },
50
45
  min: 1,
51
46
  precision: 0,
@@ -56,18 +51,18 @@ const T = /* @__PURE__ */ _({
56
51
  _: 1
57
52
  /* STABLE */
58
53
  }),
59
- n(t(u), { label: "配置项" }, {
54
+ n(t(c), { label: "配置项" }, {
60
55
  default: p(() => [
61
- (s(!0), c(
56
+ (m(!0), u(
62
57
  h,
63
58
  null,
64
- C(t(r).children, (o, a) => (s(), c("div", {
59
+ C(t(r).children, (o, i) => (m(), u("div", {
65
60
  key: o.id,
66
61
  class: "col-item"
67
62
  }, [
68
63
  n(t(d), {
69
64
  value: o["x-component-props"].span,
70
- "onUpdate:value": (i) => o["x-component-props"].span = i,
65
+ "onUpdate:value": (a) => o["x-component-props"].span = a,
71
66
  min: 1,
72
67
  style: { width: "200px" },
73
68
  precision: 0,
@@ -76,7 +71,7 @@ const T = /* @__PURE__ */ _({
76
71
  n(U, {
77
72
  name: "delete1",
78
73
  class: "close-icon",
79
- onClick: (i) => v(a)
74
+ onClick: (a) => v(i)
80
75
  }, null, 8, ["onClick"])
81
76
  ]))),
82
77
  128