dynamicformdjx 0.2.0 → 0.3.0

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/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { defineComponent as V, ref as w, watch as N, toRaw as k, createVNode as a, createTextVNode as d, nextTick as j, Fragment as x } from "vue";
2
- import { t as p, r as F, f as T, p as R, s as O } from "./index-BqKRE4oH.js";
3
- const L = /* @__PURE__ */ V({
1
+ import { defineComponent as N, ref as V, watch as T, toRaw as I, createVNode as a, createTextVNode as m, nextTick as j, Fragment as x, shallowReactive as O, unref as D, isRef as w } from "vue";
2
+ import { t as p, r as F, f as R, p as L, s as M } from "./index-BqKRE4oH.js";
3
+ const $ = /* @__PURE__ */ N({
4
4
  name: "DynamicInput",
5
5
  props: {
6
6
  size: {
@@ -14,7 +14,7 @@ const L = /* @__PURE__ */ V({
14
14
  },
15
15
  randomFun: {
16
16
  type: Function,
17
- default: (e) => `${Date.now()}_${e ?? 0}`
17
+ default: (t) => `${Date.now()}_${t ?? 0}`
18
18
  },
19
19
  btnConfigs: {
20
20
  type: Object
@@ -31,131 +31,131 @@ const L = /* @__PURE__ */ V({
31
31
  }
32
32
  },
33
33
  emits: {
34
- "update:modelValue": (e) => !0,
34
+ "update:modelValue": (t) => !0,
35
35
  onReset: () => !0,
36
- onMerge: (e, o) => !0
36
+ onMerge: (t, i) => !0
37
37
  },
38
- setup(e, {
39
- emit: o,
40
- expose: h
38
+ setup(t, {
39
+ emit: i,
40
+ expose: f
41
41
  }) {
42
42
  const b = {
43
43
  resetTxt: "重置",
44
44
  newTxt: "添加项",
45
45
  mergeTxt: "合并",
46
- ...e.btnConfigs
47
- }, i = {
46
+ ...t.btnConfigs
47
+ }, d = {
48
48
  hideReset: !1,
49
49
  maxHeight: "300px",
50
50
  autoScroll: !0,
51
51
  allowFilter: !0,
52
- ...e.configs
53
- }, c = {
52
+ ...t.configs
53
+ }, y = {
54
54
  arraySplitSymbol: ",",
55
- ...e.dyListConfigs
56
- }, y = e.size, u = w(p(e.modelValue, e.randomFun, c.arraySplitSymbol)), v = w(null);
57
- return N(u, (t) => {
58
- if (!e.isController) return;
59
- const m = F(t, c.arraySplitSymbol);
60
- o("update:modelValue", m), o("onMerge", m, k(u.value));
55
+ ...t.dyListConfigs
56
+ }, v = t.size, o = V(p(t.modelValue, t.randomFun, y.arraySplitSymbol)), r = V(null);
57
+ return T(o, (e) => {
58
+ if (!t.isController) return;
59
+ const u = F(e, y.arraySplitSymbol);
60
+ i("update:modelValue", u), i("onMerge", u, I(o.value));
61
61
  }, {
62
62
  deep: !0
63
- }), h({
64
- onSet: (t) => {
65
- u.value = p(t ?? e.modelValue, e.randomFun, c.arraySplitSymbol);
63
+ }), f({
64
+ onSet: (e) => {
65
+ o.value = p(e ?? t.modelValue, t.randomFun, y.arraySplitSymbol);
66
66
  },
67
- getResult: (t = "res") => t === "ori" ? k(u.value) : F(u.value, c.arraySplitSymbol)
67
+ getResult: (e = "res") => e === "ori" ? I(o.value) : F(o.value, y.arraySplitSymbol)
68
68
  }), () => a("div", {
69
- class: e.dyCls ?? `dynamicForm ${y}`
69
+ class: t.dyCls ?? `dynamicForm ${v}`
70
70
  }, [a("div", {
71
71
  class: "dyFormList",
72
- ref: v,
72
+ ref: r,
73
73
  style: {
74
- maxHeight: i.maxHeight
74
+ maxHeight: d.maxHeight
75
75
  }
76
- }, [u.value.map((t, m, s) => a("div", {
76
+ }, [o.value.map((e, u, n) => a("div", {
77
77
  class: "dItem",
78
- key: t.rId
78
+ key: e.rId
79
79
  }, [a("div", {
80
80
  class: "input"
81
81
  }, [a("input", {
82
- size: y,
83
- value: t.key,
82
+ size: v,
83
+ value: e.key,
84
84
  class: "key nativeInput",
85
- onInput: (n) => {
86
- t.key = n.target.value;
85
+ onInput: (s) => {
86
+ e.key = s.target.value;
87
87
  }
88
- }, null), d(":"), a("div", {
88
+ }, null), m(":"), a("div", {
89
89
  class: "vInput"
90
90
  }, [a("div", {
91
91
  class: "slot"
92
92
  }, [a("button", {
93
- class: [t.isArray ? "success" : "default", "small", "bt"],
93
+ class: [e.isArray ? "success" : "default", "small", "bt"],
94
94
  onClick: () => {
95
- t.isArray = !t.isArray;
95
+ e.isArray = !e.isArray;
96
96
  }
97
- }, [d("Array")]), d(" "), a("button", {
98
- class: [t.isNumber ? "success" : "default", "small", "bt"],
97
+ }, [m("Array")]), m(" "), a("button", {
98
+ class: [e.isNumber ? "success" : "default", "small", "bt"],
99
99
  onClick: () => {
100
- t.isNumber = !t.isNumber;
100
+ e.isNumber = !e.isNumber;
101
101
  }
102
- }, [d("Number")])]), a("input", {
103
- size: y,
104
- value: t.value,
102
+ }, [m("Number")])]), a("input", {
103
+ size: v,
104
+ value: e.value,
105
105
  class: "value nativeV",
106
- onInput: (n) => {
107
- const r = n.target.value;
108
- i.allowFilter && t.isNumber ? t.value = T(r, t.isArray, c.arraySplitSymbol) : t.value = r;
106
+ onInput: (s) => {
107
+ const c = s.target.value;
108
+ d.allowFilter && e.isNumber ? e.value = R(c, e.isArray, y.arraySplitSymbol) : e.value = c;
109
109
  }
110
110
  }, null)])]), a("div", {
111
111
  class: "btn"
112
112
  }, [a("button", {
113
- class: [y, "success", "bt"],
114
- disabled: m !== s.length - 1,
113
+ class: [v, "success", "bt"],
114
+ disabled: u !== n.length - 1,
115
115
  onClick: () => {
116
- u.value.push({
117
- rId: e.randomFun(),
116
+ o.value.push({
117
+ rId: t.randomFun(),
118
118
  key: "",
119
119
  value: ""
120
- }), i.autoScroll && j(() => {
121
- const n = v.value;
122
- n?.scrollTo({
123
- top: n.scrollHeight,
120
+ }), d.autoScroll && j(() => {
121
+ const s = r.value;
122
+ s?.scrollTo({
123
+ top: s.scrollHeight,
124
124
  behavior: "smooth"
125
125
  });
126
126
  });
127
127
  }
128
- }, [d("+")]), a("button", {
129
- class: ["danger", y, "bt"],
128
+ }, [m("+")]), a("button", {
129
+ class: ["danger", v, "bt"],
130
130
  onClick: () => {
131
- u.value = u.value.filter((n) => n.rId !== t.rId);
131
+ o.value = o.value.filter((s) => s.rId !== e.rId);
132
132
  }
133
- }, [d("-")])])]))]), a("div", {
133
+ }, [m("-")])])]))]), a("div", {
134
134
  class: "control"
135
- }, [!u.value.length && a("button", {
136
- class: ["success", y, "bt"],
135
+ }, [!o.value.length && a("button", {
136
+ class: ["success", v, "bt"],
137
137
  onClick: () => {
138
- u.value.push({
139
- rId: e.randomFun(),
138
+ o.value.push({
139
+ rId: t.randomFun(),
140
140
  key: "",
141
141
  value: ""
142
142
  });
143
143
  }
144
- }, [b.newTxt]), !e.isController && a(x, null, [!i.hideReset && a("button", {
145
- class: ["default", y, "bt"],
144
+ }, [b.newTxt]), !t.isController && a(x, null, [!d.hideReset && a("button", {
145
+ class: ["default", v, "bt"],
146
146
  onClick: () => {
147
- u.value = p(e.modelValue, e.randomFun, c.arraySplitSymbol), o("onReset");
147
+ o.value = p(t.modelValue, t.randomFun, y.arraySplitSymbol), i("onReset");
148
148
  }
149
149
  }, [b.resetTxt]), a("button", {
150
- class: ["info", y, "bt"],
150
+ class: ["info", v, "bt"],
151
151
  onClick: () => {
152
- u.value.sort((m, s) => +m.rId - +s.rId);
153
- const t = F(u.value, c.arraySplitSymbol);
154
- o("update:modelValue", t), o("onMerge", t, k(u.value)), u.value = p(t, e.randomFun, c.arraySplitSymbol);
152
+ o.value.sort((u, n) => +u.rId - +n.rId);
153
+ const e = F(o.value, y.arraySplitSymbol);
154
+ i("update:modelValue", e), i("onMerge", e, I(o.value)), o.value = p(e, t.randomFun, y.arraySplitSymbol);
155
155
  }
156
156
  }, [b.mergeTxt])])])]);
157
157
  }
158
- }), M = /* @__PURE__ */ V({
158
+ }), H = /* @__PURE__ */ N({
159
159
  name: "DynamicCascadeInput",
160
160
  props: {
161
161
  modelValue: {
@@ -170,7 +170,7 @@ const L = /* @__PURE__ */ V({
170
170
  },
171
171
  randomFun: {
172
172
  type: Function,
173
- default: (e) => `${Date.now()}_${e ?? 0}`
173
+ default: (t) => `${Date.now()}_${t ?? 0}`
174
174
  },
175
175
  // 子层深度 (超过则不再出现添加选项)
176
176
  depth: {
@@ -188,24 +188,24 @@ const L = /* @__PURE__ */ V({
188
188
  },
189
189
  newChildTxt: {
190
190
  type: Function,
191
- default: (e) => `添加 '${e.key}' 子项`
191
+ default: (t) => `添加 '${t.key}' 子项`
192
192
  }
193
193
  },
194
194
  emits: {
195
- "update:modelValue": (e) => !0,
195
+ "update:modelValue": (t) => !0,
196
196
  onReset: () => !0,
197
- onMerge: (e, o) => !0
197
+ onMerge: (t, i) => !0
198
198
  },
199
- setup(e, {
200
- emit: o,
201
- expose: h
199
+ setup(t, {
200
+ emit: i,
201
+ expose: f
202
202
  }) {
203
203
  const b = {
204
204
  resetTxt: "重置",
205
205
  newTxt: "添加项",
206
206
  mergeTxt: "合并",
207
- ...e.btnConfigs
208
- }, i = {
207
+ ...t.btnConfigs
208
+ }, d = {
209
209
  hideReset: !1,
210
210
  maxHeight: "600px",
211
211
  allowFilter: !0,
@@ -213,44 +213,44 @@ const L = /* @__PURE__ */ V({
213
213
  showPad: !0,
214
214
  retractLen: 0,
215
215
  borderColors: [],
216
- ...e.configs
217
- }, c = {
216
+ ...t.configs
217
+ }, y = {
218
218
  arraySplitSymbol: ",",
219
- ...e.dyListConfigs
220
- }, y = (s) => ["string", "number"].includes(s), u = (s) => Object.keys(s).map((n, r) => {
221
- let l = s[n];
222
- const f = Array.isArray(l), A = f ? l.every((S) => typeof S == "number") : typeof l == "number", g = l === null;
223
- return y(typeof l) && (l = s[n]), g && (l = ""), {
224
- rId: e.randomFun(r),
225
- key: n,
226
- value: Object.prototype.toString.call(l) === "[object Object]" ? u(s[n]) : f ? l.join(c.arraySplitSymbol) : l,
227
- isArray: f || void 0,
219
+ ...t.dyListConfigs
220
+ }, v = (n) => ["string", "number"].includes(n), o = (n) => Object.keys(n).map((s, c) => {
221
+ let l = n[s];
222
+ const g = Array.isArray(l), A = g ? l.every((h) => typeof h == "number") : typeof l == "number", C = l === null;
223
+ return v(typeof l) && (l = n[s]), C && (l = ""), {
224
+ rId: t.randomFun(c),
225
+ key: s,
226
+ value: Object.prototype.toString.call(l) === "[object Object]" ? o(n[s]) : g ? l.join(y.arraySplitSymbol) : l,
227
+ isArray: g || void 0,
228
228
  isNumber: A || void 0
229
229
  };
230
- }), v = (s) => s.reduce((n, r) => {
231
- const l = r.value;
232
- return r.key.trim().length && (n[r.key] = Array.isArray(l) ? v(l) : R(r.value, r.isArray, r.isNumber, c.arraySplitSymbol)), n;
233
- }, {}), t = w(u(e.modelValue)), m = (s, n = 1, r) => a("div", {
234
- class: [`depth-${n}`, i.showBorder ? "" : "no-border", i.showPad ? "" : "no-pad"],
230
+ }), r = (n) => n.reduce((s, c) => {
231
+ const l = c.value;
232
+ return c.key.trim().length && (s[c.key] = Array.isArray(l) ? r(l) : L(c.value, c.isArray, c.isNumber, y.arraySplitSymbol)), s;
233
+ }, {}), e = V(o(t.modelValue)), u = (n, s = 1, c) => a("div", {
234
+ class: [`depth-${s}`, d.showBorder ? "" : "no-border", d.showPad ? "" : "no-pad"],
235
235
  style: {
236
- "--depth": n,
237
- ["--c" + [n]]: O(i.borderColors, n)
236
+ "--depth": s,
237
+ ["--c" + [s]]: M(d.borderColors, s)
238
238
  }
239
- }, [s.map((l, f, A) => {
240
- const g = Array.isArray(l.value), S = y(typeof l.value);
239
+ }, [n.map((l, g, A) => {
240
+ const C = Array.isArray(l.value), h = v(typeof l.value);
241
241
  return a("div", {
242
242
  class: "dItem",
243
243
  key: l.rId,
244
244
  style: {
245
- marginLeft: n > 1 ? `${n * i.retractLen}px` : "0"
245
+ marginLeft: s > 1 ? `${s * d.retractLen}px` : "0"
246
246
  }
247
247
  }, [a("div", {
248
248
  class: "input"
249
- }, [!g && a(x, null, [a("input", {
249
+ }, [!C && a(x, null, [a("input", {
250
250
  value: l.key,
251
251
  class: "key nativeInput",
252
- onInput: (I) => l.key = I.target.value
253
- }, null), d(":")]), a("div", {
252
+ onInput: (S) => l.key = S.target.value
253
+ }, null), m(":")]), a("div", {
254
254
  class: "vInput"
255
255
  }, [a("div", {
256
256
  class: "slot"
@@ -259,108 +259,145 @@ const L = /* @__PURE__ */ V({
259
259
  onClick: () => {
260
260
  l.isArray = !l.isArray;
261
261
  }
262
- }, [d("Array")]), d(" "), a("button", {
262
+ }, [m("Array")]), m(" "), a("button", {
263
263
  class: [l.isNumber ? "success" : "default", "small", "bt"],
264
264
  onClick: () => {
265
265
  l.isNumber = !l.isNumber;
266
266
  }
267
- }, [d("Number")])])]), a("input", {
268
- class: `value nativeV ${g ? "isKey" : ""}`,
269
- value: S ? l.value : l.key,
270
- onInput: (I) => {
271
- const C = I.target.value;
272
- if (g) {
273
- l.key = C;
267
+ }, [m("Number")])])]), a("input", {
268
+ class: `value nativeV ${C ? "isKey" : ""}`,
269
+ value: h ? l.value : l.key,
270
+ onInput: (S) => {
271
+ const k = S.target.value;
272
+ if (C) {
273
+ l.key = k;
274
274
  return;
275
275
  }
276
- i.allowFilter && l.isNumber ? l.value = T(C, l.isArray, c.arraySplitSymbol) : l.value = C;
276
+ d.allowFilter && l.isNumber ? l.value = R(k, l.isArray, y.arraySplitSymbol) : l.value = k;
277
277
  }
278
278
  }, null), a("div", {
279
279
  class: "surSlot"
280
- }, [n < e.depth ? !g && a("button", {
280
+ }, [s < t.depth ? !C && a("button", {
281
281
  class: ["success", "bt"],
282
282
  onClick: () => {
283
- S && (l.value = [], l.isArray = void 0), l.value.push({
284
- rId: e.randomFun(),
283
+ h && (l.value = [], l.isArray = void 0), l.value.push({
284
+ rId: t.randomFun(),
285
285
  key: "",
286
286
  value: ""
287
287
  });
288
288
  }
289
- }, [e.newChildTxt(l)]) : null])])]), a("div", {
289
+ }, [t.newChildTxt(l)]) : null])])]), a("div", {
290
290
  class: "btn"
291
291
  }, [a("button", {
292
292
  class: ["success", "bt"],
293
- disabled: f !== A.length - 1,
293
+ disabled: g !== A.length - 1,
294
294
  onClick: () => {
295
- s.push({
296
- rId: e.randomFun(),
295
+ n.push({
296
+ rId: t.randomFun(),
297
297
  key: "",
298
298
  value: ""
299
299
  });
300
300
  }
301
- }, [d("+")]), a("button", {
301
+ }, [m("+")]), a("button", {
302
302
  class: ["danger", "bt"],
303
303
  onClick: () => {
304
- if (s.splice(f, 1), s.length < 1) {
305
- if (r === void 0) return v([]);
306
- const I = t.value.findIndex((C) => C.rId === r?.rId);
307
- n < 1 ? t.value.splice(I, 1, {
308
- ...r,
304
+ if (n.splice(g, 1), n.length < 1) {
305
+ if (c === void 0) return r([]);
306
+ const S = e.value.findIndex((k) => k.rId === c?.rId);
307
+ s < 1 ? e.value.splice(S, 1, {
308
+ ...c,
309
309
  value: ""
310
- }) : r.value = "";
310
+ }) : c.value = "";
311
311
  }
312
312
  }
313
- }, [d("-")])]), Array.isArray(l.value) && m(l.value, n + 1, l)]);
313
+ }, [m("-")])]), Array.isArray(l.value) && u(l.value, s + 1, l)]);
314
314
  })]);
315
- return N(t, (s) => {
316
- if (!e.isController) return;
317
- const n = v(s);
318
- o("update:modelValue", n), o("onMerge", n, k(t.value));
315
+ return T(e, (n) => {
316
+ if (!t.isController) return;
317
+ const s = r(n);
318
+ i("update:modelValue", s), i("onMerge", s, I(e.value));
319
319
  }, {
320
320
  deep: !0
321
- }), h({
322
- onSet: (s) => {
323
- t.value = u(s ?? e.modelValue);
321
+ }), f({
322
+ onSet: (n) => {
323
+ e.value = o(n ?? t.modelValue);
324
324
  },
325
- getResult: (s = "res") => s === "ori" ? k(t.value) : v(t.value)
325
+ getResult: (n = "res") => n === "ori" ? I(e.value) : r(e.value)
326
326
  }), () => a("div", {
327
- class: e.dyCls ?? "dynamicCascadeForm"
327
+ class: t.dyCls ?? "dynamicCascadeForm"
328
328
  }, [a("div", {
329
329
  class: "dyFormList",
330
330
  style: {
331
- maxHeight: i.maxHeight
331
+ maxHeight: d.maxHeight
332
332
  }
333
- }, [m(t.value)]), a("div", {
333
+ }, [u(e.value)]), a("div", {
334
334
  class: "control"
335
- }, [!t.value.length && a("button", {
335
+ }, [!e.value.length && a("button", {
336
336
  class: ["success", "bt"],
337
337
  onClick: () => {
338
- t.value.push({
339
- rId: e.randomFun(),
338
+ e.value.push({
339
+ rId: t.randomFun(),
340
340
  key: "",
341
341
  value: ""
342
342
  });
343
343
  }
344
- }, [b.newTxt]), !e.isController && a(x, null, [!i.hideReset && a("button", {
344
+ }, [b.newTxt]), !t.isController && a(x, null, [!d.hideReset && a("button", {
345
345
  class: ["default", "bt"],
346
346
  onClick: () => {
347
- t.value = u(e.modelValue), o("onReset");
347
+ e.value = o(t.modelValue), i("onReset");
348
348
  }
349
349
  }, [b.resetTxt]), a("button", {
350
350
  class: ["info", "bt"],
351
351
  onClick: () => {
352
- const s = v(t.value);
353
- o("update:modelValue", s), o("onMerge", s, k(t.value)), t.value = u(s);
352
+ const n = r(e.value);
353
+ i("update:modelValue", n), i("onMerge", n, I(e.value)), e.value = o(n);
354
354
  }
355
355
  }, [b.mergeTxt])])])]);
356
356
  }
357
- }), H = {
358
- install(e) {
359
- e.component("DynamicInput", L), e.component("DynamicCascadeInput", M);
357
+ });
358
+ function E(t, i = !0) {
359
+ return i ? t.map((f) => O(f)) : t;
360
+ }
361
+ function P(t) {
362
+ const i = () => D(t), f = (r, e) => {
363
+ i().forEach((u) => {
364
+ const n = u.key;
365
+ (!e || e.includes(n)) && (u.disabled = r);
366
+ });
367
+ }, b = (r, e) => {
368
+ i().forEach((u) => {
369
+ const n = u.key;
370
+ (!e || e.includes(n)) && (u.hidden = r);
371
+ });
372
+ }, d = (r, e) => {
373
+ const u = i().find((n) => n.key === r);
374
+ u && (w(u.value) ? u.value.value = e : u.value = e);
375
+ };
376
+ return { setDisabled: f, setHidden: b, setValue: d, setValues: (r) => {
377
+ Object.entries(r).forEach(([e, u]) => {
378
+ d(e, u);
379
+ });
380
+ }, getValue: (r) => i().find((e) => e.key === r), getValues: (r) => {
381
+ const e = r && r.length ? new Set(r) : null;
382
+ return i().reduce((u, n) => {
383
+ const s = n.key;
384
+ if (!e || e.has(s)) {
385
+ const c = w(n.value) ? n.value.value : n.value;
386
+ u[s] = c;
387
+ }
388
+ return u;
389
+ }, {});
390
+ } };
391
+ }
392
+ const q = {
393
+ install(t) {
394
+ t.component("DynamicInput", $), t.component("DynamicCascadeInput", H);
360
395
  }
361
396
  };
362
397
  export {
363
- M as DynamicCascadeInput,
364
- L as DynamicInput,
365
- H as DynamicInputPlugin
398
+ H as DynamicCascadeInput,
399
+ $ as DynamicInput,
400
+ q as DynamicInputPlugin,
401
+ P as useDyForm,
402
+ E as useReactiveForm
366
403
  };
@@ -0,0 +1,66 @@
1
+ import { PropType } from 'vue';
2
+ import { FormProps, GridProps } from 'naive-ui';
3
+ import { DyFormItem } from '../types/form';
4
+ import { FormRules } from 'naive-ui/es/form/src/interface';
5
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
6
+ formConfig: {
7
+ type: PropType<FormProps>;
8
+ default: () => {
9
+ labelPlacement: string;
10
+ size: string;
11
+ };
12
+ };
13
+ gridConfig: {
14
+ type: PropType<GridProps>;
15
+ default: () => {
16
+ responsive: string;
17
+ cols: string;
18
+ xGap: number;
19
+ };
20
+ };
21
+ rules: {
22
+ type: PropType<FormRules>;
23
+ };
24
+ preset: {
25
+ type: PropType<"fullRow" | "grid">;
26
+ default: string;
27
+ validator: (value: string) => boolean;
28
+ };
29
+ items: {
30
+ type: PropType<Array<DyFormItem>>;
31
+ require: boolean;
32
+ };
33
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
34
+ formConfig: {
35
+ type: PropType<FormProps>;
36
+ default: () => {
37
+ labelPlacement: string;
38
+ size: string;
39
+ };
40
+ };
41
+ gridConfig: {
42
+ type: PropType<GridProps>;
43
+ default: () => {
44
+ responsive: string;
45
+ cols: string;
46
+ xGap: number;
47
+ };
48
+ };
49
+ rules: {
50
+ type: PropType<FormRules>;
51
+ };
52
+ preset: {
53
+ type: PropType<"fullRow" | "grid">;
54
+ default: string;
55
+ validator: (value: string) => boolean;
56
+ };
57
+ items: {
58
+ type: PropType<Array<DyFormItem>>;
59
+ require: boolean;
60
+ };
61
+ }>> & Readonly<{}>, {
62
+ formConfig: FormProps;
63
+ gridConfig: GridProps;
64
+ preset: "fullRow" | "grid";
65
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
66
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
1
+ import { RadioProps, CheckboxGroupProps, CheckboxProps, DatePickerProps, InputProps, PopselectProps, RadioButtonProps, RadioGroupProps, SelectOption, SelectProps, SwitchProps, TimePickerProps, TreeSelectProps } from 'naive-ui';
2
+ import { Value as DatePickerValue } from 'naive-ui/lib/date-picker/src/interface';
3
+ import { SelectGroupOption, Value as SelectValue } from 'naive-ui/lib/select/src/interface';
4
+ import { TreeSelectOption, Value } from 'naive-ui/lib/tree-select/src/interface';
5
+ import { AllowedComponentProps, Ref, VNode } from 'vue';
6
+ import { DyFormItem } from '../../types/form.ts';
7
+ export declare function renderInput(model: Ref<string>, optionProps?: InputProps | AllowedComponentProps, rf?: DyFormItem): VNode<import('vue').RendererNode, import('vue').RendererElement, {
8
+ [key: string]: any;
9
+ }>;
10
+ export declare function renderSelect(model: Ref<SelectValue>, options: SelectOption[], optionProps?: SelectProps | AllowedComponentProps, rf?: DyFormItem): VNode<import('vue').RendererNode, import('vue').RendererElement, {
11
+ [key: string]: any;
12
+ }>;
13
+ export declare function renderPopSelect(model: Ref<string | number | Array<string | number> | null>, options: Array<SelectOption | SelectGroupOption>, optionProps?: PopselectProps | AllowedComponentProps, rf?: DyFormItem, defaultRender?: VNode): VNode<import('vue').RendererNode, import('vue').RendererElement, {
14
+ [key: string]: any;
15
+ }>;
16
+ export declare function renderTreeSelect(model: Ref<Value>, options: TreeSelectOption[], optionProps?: TreeSelectProps | AllowedComponentProps, rf?: DyFormItem): VNode<import('vue').RendererNode, import('vue').RendererElement, {
17
+ [key: string]: any;
18
+ }>;
19
+ export declare function renderRadioGroup(value: Ref<string | number | null | undefined>, options: RadioProps[], optionProps?: RadioGroupProps | AllowedComponentProps, rf?: DyFormItem): VNode<import('vue').RendererNode, import('vue').RendererElement, {
20
+ [key: string]: any;
21
+ }>;
22
+ export declare function renderRadioButtonGroup(value: Ref<string | number | null | undefined>, options: RadioButtonProps[], optionProps?: RadioGroupProps | AllowedComponentProps, rf?: DyFormItem): VNode<import('vue').RendererNode, import('vue').RendererElement, {
23
+ [key: string]: any;
24
+ }>;
25
+ export declare function renderCheckboxGroup(model: Ref<(string | number)[]>, options: CheckboxProps[], optionProps?: CheckboxGroupProps | AllowedComponentProps, rf?: DyFormItem): VNode<import('vue').RendererNode, import('vue').RendererElement, {
26
+ [key: string]: any;
27
+ }>;
28
+ export declare function renderSwitch(value: Ref<boolean>, optionProps?: SwitchProps | AllowedComponentProps, rf?: DyFormItem): VNode<import('vue').RendererNode, import('vue').RendererElement, {
29
+ [key: string]: any;
30
+ }>;
31
+ export declare function renderDatePicker(value: Ref<DatePickerValue>, optionProps?: DatePickerProps | AllowedComponentProps, rf?: DyFormItem): VNode<import('vue').RendererNode, import('vue').RendererElement, {
32
+ [key: string]: any;
33
+ }>;
34
+ export declare function renderTimePicker(value: Ref<number | null>, optionProps?: TimePickerProps, rf?: DyFormItem): VNode<import('vue').RendererNode, import('vue').RendererElement, {
35
+ [key: string]: any;
36
+ }>;