@harbor-design/proform 1.1.8 → 1.1.11
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.cjs +1 -1
- package/dist/index.js +387 -258
- package/dist/types/index.d.ts +1 -1
- package/dist/types/src/interactions/useFormPresetConfigurer.d.ts +2 -0
- package/dist/types/src/services/Context/index.d.ts +4 -0
- package/dist/types/src/services/{Effect.d.ts → Effect/index.d.ts} +2 -2
- package/dist/types/src/services/{FormCustomizer.d.ts → FormCustomizer/index.d.ts} +2 -2
- package/dist/types/src/services/Preset/AdapterPreset.d.ts +3 -0
- package/dist/types/src/services/{Preset.d.ts → Preset/RuntimePreset.d.ts} +2 -2
- package/dist/types/src/services/Preset/index.d.ts +11 -0
- package/dist/types/src/services/{Processor.d.ts → Processor/index.d.ts} +3 -3
- package/dist/types/src/services/RuntimeCore/RuntimeAdapter.d.ts +8 -0
- package/dist/types/src/services/RuntimeCore/RuntimeContainer.d.ts +9 -0
- package/dist/types/src/services/{RuntimeCore.d.ts → RuntimeCore/index.d.ts} +8 -5
- package/dist/types/src/types/adapter.d.ts +7 -0
- package/dist/types/src/types/contextTypes.d.ts +17 -7
- package/dist/types/src/types/formCustomizerTypes.d.ts +11 -10
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/runtimeTypes.d.ts +3 -0
- package/package.json +1 -1
- package/dist/types/src/interactions/useFormRenderer.d.ts +0 -4
- package/dist/types/src/services/Context.d.ts +0 -4
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
class
|
|
1
|
+
var re = Object.defineProperty;
|
|
2
|
+
var ie = (r, e, t) => e in r ? re(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var a = (r, e, t) => (ie(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { isRef as U, watch as I, isReactive as x, toRaw as V, nextTick as w, ref as R, reactive as oe, createVNode as p, withDirectives as Y, mergeProps as M, vShow as Z, createTextVNode as ne, isVNode as le, defineComponent as ae } from "vue";
|
|
5
|
+
class l {
|
|
6
6
|
static typeChecker(e) {
|
|
7
7
|
return {}.toString.call(e);
|
|
8
8
|
}
|
|
@@ -63,18 +63,18 @@ class f {
|
|
|
63
63
|
return !1;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function m(r, ...e) {
|
|
67
67
|
return e.forEach((t) => {
|
|
68
68
|
if (Array.isArray(t))
|
|
69
|
-
Array.isArray(
|
|
70
|
-
typeof s == "object" && s !== null ?
|
|
69
|
+
Array.isArray(r) || (r = []), t.forEach((s, i) => {
|
|
70
|
+
typeof s == "object" && s !== null ? r[i] = m(Array.isArray(s) ? [] : {}, s) : r[i] = s;
|
|
71
71
|
});
|
|
72
72
|
else
|
|
73
73
|
for (let s in t)
|
|
74
|
-
t.hasOwnProperty(s) && (typeof t[s] == "object" && t[s] !== null ?
|
|
75
|
-
}),
|
|
74
|
+
t.hasOwnProperty(s) && (typeof t[s] == "object" && t[s] !== null ? r[s] = m(r[s] || {}, t[s]) : r[s] = t[s]);
|
|
75
|
+
}), r;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function g(r) {
|
|
78
78
|
const e = /* @__PURE__ */ new WeakMap();
|
|
79
79
|
function t(s) {
|
|
80
80
|
if (s === null || typeof s != "object")
|
|
@@ -84,40 +84,40 @@ function b(o) {
|
|
|
84
84
|
if (s instanceof RegExp)
|
|
85
85
|
return new RegExp(s);
|
|
86
86
|
if (s instanceof Map) {
|
|
87
|
-
const
|
|
88
|
-
for (let [n,
|
|
89
|
-
|
|
90
|
-
return
|
|
87
|
+
const o = /* @__PURE__ */ new Map();
|
|
88
|
+
for (let [n, u] of s)
|
|
89
|
+
o.set(t(n), t(u));
|
|
90
|
+
return o;
|
|
91
91
|
}
|
|
92
92
|
if (s instanceof Set) {
|
|
93
|
-
const
|
|
93
|
+
const o = /* @__PURE__ */ new Set();
|
|
94
94
|
for (let n of s)
|
|
95
|
-
|
|
96
|
-
return
|
|
95
|
+
o.add(t(n));
|
|
96
|
+
return o;
|
|
97
97
|
}
|
|
98
98
|
if (e.has(s))
|
|
99
99
|
return e.get(s);
|
|
100
100
|
if (Array.isArray(s)) {
|
|
101
|
-
const
|
|
102
|
-
e.set(s,
|
|
101
|
+
const o = [];
|
|
102
|
+
e.set(s, o);
|
|
103
103
|
for (let n = 0; n < s.length; n++)
|
|
104
|
-
|
|
105
|
-
return
|
|
104
|
+
o[n] = t(s[n]);
|
|
105
|
+
return o;
|
|
106
106
|
}
|
|
107
|
-
const
|
|
108
|
-
e.set(s,
|
|
109
|
-
for (let
|
|
110
|
-
s.hasOwnProperty(
|
|
111
|
-
return
|
|
107
|
+
const i = Object.create(Object.getPrototypeOf(s));
|
|
108
|
+
e.set(s, i);
|
|
109
|
+
for (let o in s)
|
|
110
|
+
s.hasOwnProperty(o) && (i[o] = t(s[o]));
|
|
111
|
+
return i;
|
|
112
112
|
}
|
|
113
|
-
return t(
|
|
113
|
+
return t(r);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
115
|
+
function q(r, e) {
|
|
116
|
+
return r.replace(/undefined/g, e);
|
|
117
117
|
}
|
|
118
|
-
class
|
|
118
|
+
class ue {
|
|
119
119
|
constructor(e) {
|
|
120
|
-
|
|
120
|
+
a(this, "runtimeCore");
|
|
121
121
|
this.formCustomization = e;
|
|
122
122
|
}
|
|
123
123
|
// happy path, 后续可以完善更多的 fallback 处理,fallback 处理是为了不卡住异步时的首次渲染做的优化
|
|
@@ -127,19 +127,12 @@ class ne {
|
|
|
127
127
|
})), e;
|
|
128
128
|
}
|
|
129
129
|
setup(e) {
|
|
130
|
-
return this.runtimeCore = e, Object.assign(this.runtimeCore.native, this.formCustomization.native), Object.assign(this.runtimeCore.
|
|
131
|
-
this.runtimeCore.runtimeSetters,
|
|
132
|
-
this.formCustomization.runtimeSetters
|
|
133
|
-
), this.formCustomization;
|
|
130
|
+
return this.runtimeCore = e, Object.assign(this.runtimeCore.native, this.formCustomization.native), Object.assign(this.runtimeCore.grid, this.formCustomization.grid), Object.assign(this.runtimeCore.runtime, this.formCustomization.runtime), this.formCustomization.ui && (this.runtimeCore.ui = this.formCustomization.ui), this.formCustomization;
|
|
134
131
|
}
|
|
135
132
|
submit() {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
O(this.runtimeCore.processor.processedModel.value)
|
|
140
|
-
)
|
|
141
|
-
));
|
|
142
|
-
});
|
|
133
|
+
var s;
|
|
134
|
+
const e = (s = f.presets.uiPresets[this.runtimeCore.ui]) == null ? void 0 : s.adapter, t = j.adapters[this.runtimeCore.ui];
|
|
135
|
+
return (e == null ? void 0 : e.validateForm(this)) ?? (t == null ? void 0 : t.validateForm(this));
|
|
143
136
|
}
|
|
144
137
|
hydrate(e) {
|
|
145
138
|
if (!this.runtimeCore)
|
|
@@ -149,25 +142,25 @@ class ne {
|
|
|
149
142
|
});
|
|
150
143
|
this.runtimeCore.hydrateEffect.trackEffect(
|
|
151
144
|
() => {
|
|
152
|
-
|
|
145
|
+
U(e) ? I(
|
|
153
146
|
() => e.value,
|
|
154
147
|
() => {
|
|
155
|
-
|
|
148
|
+
m(this.runtimeCore.model.value, e.value);
|
|
156
149
|
},
|
|
157
150
|
{
|
|
158
151
|
deep: !0,
|
|
159
152
|
immediate: !0
|
|
160
153
|
}
|
|
161
|
-
) :
|
|
154
|
+
) : x(e) ? I(
|
|
162
155
|
() => e,
|
|
163
156
|
() => {
|
|
164
|
-
|
|
157
|
+
m(this.runtimeCore.model.value, e);
|
|
165
158
|
},
|
|
166
159
|
{
|
|
167
160
|
deep: !0,
|
|
168
161
|
immediate: !0
|
|
169
162
|
}
|
|
170
|
-
) :
|
|
163
|
+
) : m(this.runtimeCore.model.value, e);
|
|
171
164
|
},
|
|
172
165
|
{
|
|
173
166
|
lazy: !0
|
|
@@ -175,9 +168,9 @@ class ne {
|
|
|
175
168
|
);
|
|
176
169
|
}
|
|
177
170
|
}
|
|
178
|
-
class
|
|
171
|
+
class N {
|
|
179
172
|
constructor() {
|
|
180
|
-
|
|
173
|
+
a(this, "effects", /* @__PURE__ */ new Set());
|
|
181
174
|
}
|
|
182
175
|
clearEffects() {
|
|
183
176
|
this.effects.clear();
|
|
@@ -191,23 +184,23 @@ class D {
|
|
|
191
184
|
return !t.lazy && e(), this.effects.add(e), () => this.effects.delete(e);
|
|
192
185
|
}
|
|
193
186
|
}
|
|
194
|
-
class
|
|
187
|
+
class ce {
|
|
195
188
|
constructor(e) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
this.runtimeCore = e, this.processedSchemas = e.schemas, this.processedModel = e.model, this.getRuntimeMeta = e.getRuntimeMeta.bind(e),
|
|
189
|
+
a(this, "runtimeCore");
|
|
190
|
+
a(this, "processedSchemas");
|
|
191
|
+
a(this, "processedModel");
|
|
192
|
+
a(this, "getRuntimeMeta");
|
|
193
|
+
a(this, "stableSchemas", []);
|
|
194
|
+
a(this, "stableModel", {});
|
|
195
|
+
a(this, "schemaPreset", j.schemaPreset);
|
|
196
|
+
a(this, "componentPropsPreset", j.componentPropsPreset);
|
|
197
|
+
a(this, "stableUpdaterProcessProgress");
|
|
198
|
+
a(this, "stableUpdaterTimes", 0);
|
|
199
|
+
a(this, "schemaEffect", new N());
|
|
200
|
+
a(this, "defaultValueEffect", new N());
|
|
201
|
+
a(this, "defaultValueInprogressMap", /* @__PURE__ */ new Map());
|
|
202
|
+
a(this, "baseDefaultValueFunctionsLength");
|
|
203
|
+
this.runtimeCore = e, this.processedSchemas = e.schemas, this.processedModel = e.model, this.getRuntimeMeta = e.getRuntimeMeta.bind(e), I(
|
|
211
204
|
() => this.processedModel.value,
|
|
212
205
|
() => {
|
|
213
206
|
this.schemaEffect.triggerEffects();
|
|
@@ -219,8 +212,8 @@ class le {
|
|
|
219
212
|
}
|
|
220
213
|
// 核心处理过程,接收一个初始的代理数据结构,由其衍生的有 parseSchema
|
|
221
214
|
parse(e, t) {
|
|
222
|
-
e.forEach((s,
|
|
223
|
-
this.parseItem(s,
|
|
215
|
+
e.forEach((s, i) => {
|
|
216
|
+
this.parseItem(s, i, t);
|
|
224
217
|
});
|
|
225
218
|
}
|
|
226
219
|
// 初始化空数据结构,避免后续复杂的 if else
|
|
@@ -232,24 +225,24 @@ class le {
|
|
|
232
225
|
}
|
|
233
226
|
countFunctionDefaultValues(e) {
|
|
234
227
|
let t = 0, s = /* @__PURE__ */ new Set();
|
|
235
|
-
function
|
|
236
|
-
if (!s.has(
|
|
237
|
-
s.add(
|
|
238
|
-
for (let n in
|
|
239
|
-
|
|
228
|
+
function i(o) {
|
|
229
|
+
if (!s.has(o) && (Array.isArray(o) || o !== null && typeof o == "object")) {
|
|
230
|
+
s.add(o);
|
|
231
|
+
for (let n in o)
|
|
232
|
+
o.hasOwnProperty(n) && (n === "defaultValue" && typeof o[n] == "function" && !o[n].toString().includes("[native code]") && t++, i(o[n]));
|
|
240
233
|
}
|
|
241
234
|
}
|
|
242
|
-
return
|
|
235
|
+
return i(e), t;
|
|
243
236
|
}
|
|
244
237
|
// 派生过程,用于外部应用
|
|
245
238
|
parseSchemas(e, t) {
|
|
246
|
-
|
|
247
|
-
|
|
239
|
+
l.isArrayEmpty(this.processedSchemas.value) && (this.baseDefaultValueFunctionsLength = this.countFunctionDefaultValues(
|
|
240
|
+
g(e)
|
|
248
241
|
), this.processedSchemas.value = this.initSchemas(e)), this.parse(e, t);
|
|
249
242
|
}
|
|
250
243
|
parseStable(e) {
|
|
251
244
|
const t = {};
|
|
252
|
-
if (!
|
|
245
|
+
if (!l.isUndefined(e.stable))
|
|
253
246
|
t[e.key] = this.parseStable(e.stable);
|
|
254
247
|
else
|
|
255
248
|
return e;
|
|
@@ -258,110 +251,110 @@ class le {
|
|
|
258
251
|
// 对于稳定初始化更新的抽象
|
|
259
252
|
stableUpdater(e = []) {
|
|
260
253
|
if (e.every(Boolean)) {
|
|
261
|
-
const t =
|
|
262
|
-
!
|
|
254
|
+
const t = V(this.processedSchemas.value);
|
|
255
|
+
!l.isProcessInprogress(t) && l.isObjectEmpty(this.stableModel) && (this.stableUpdaterProcessProgress || (this.stableUpdaterProcessProgress = Array.from({
|
|
263
256
|
length: t.length
|
|
264
257
|
}).fill(!1)), this.stableUpdaterProcessProgress[this.stableUpdaterTimes] = !0, this.stableUpdaterTimes++, this.modelProcessor(t));
|
|
265
258
|
}
|
|
266
259
|
}
|
|
267
260
|
// 核心单 schema 处理过程,接收一个对象键值对的数据结构
|
|
268
261
|
parseItem(e, t, s) {
|
|
269
|
-
const
|
|
270
|
-
length: Object.keys(e).filter((
|
|
262
|
+
const i = this, o = Array.from({
|
|
263
|
+
length: Object.keys(e).filter((u) => u !== "children").length
|
|
271
264
|
}).fill(!1);
|
|
272
265
|
this.objectParser({ data: e, index: t, updater: n });
|
|
273
|
-
function n(
|
|
274
|
-
const
|
|
275
|
-
if (
|
|
266
|
+
function n(u) {
|
|
267
|
+
const c = u.index, d = u.key, y = u.keyIndex;
|
|
268
|
+
if (l.isUndefined(u.stable))
|
|
276
269
|
return;
|
|
277
|
-
const
|
|
278
|
-
let
|
|
279
|
-
if (
|
|
280
|
-
let
|
|
281
|
-
|
|
270
|
+
const O = i.parseStable(u.stable), v = s == null ? void 0 : s.index, P = s == null ? void 0 : s.key;
|
|
271
|
+
let b = O;
|
|
272
|
+
if (l.isProcessInprogress(b) || (o[y] = !0), s) {
|
|
273
|
+
let h = i.processedSchemas.value[v][P][c][d];
|
|
274
|
+
h && l.isObject(h) && d !== "component" && (b = m(h, b)), i.processedSchemas.value[v][P][c][d] = b, i.stableUpdater(o);
|
|
282
275
|
} else {
|
|
283
|
-
let
|
|
284
|
-
|
|
276
|
+
let h = i.processedSchemas.value[c][d];
|
|
277
|
+
h && l.isObject(h) && d !== "component" && (b = m(h, b)), i.processedSchemas.value[c][d] = b, i.stableUpdater(o);
|
|
285
278
|
}
|
|
286
279
|
}
|
|
287
280
|
}
|
|
288
281
|
// 只做基本的对象 parser
|
|
289
282
|
objectParser(e) {
|
|
290
283
|
const t = e.data;
|
|
291
|
-
Object.keys(t).forEach((
|
|
292
|
-
if (
|
|
293
|
-
this.parseSchemas(t[
|
|
284
|
+
Object.keys(t).forEach((i, o) => {
|
|
285
|
+
if (i === "children")
|
|
286
|
+
this.parseSchemas(t[i], {
|
|
294
287
|
...e,
|
|
295
|
-
key:
|
|
296
|
-
keyIndex:
|
|
288
|
+
key: i,
|
|
289
|
+
keyIndex: o
|
|
297
290
|
});
|
|
298
291
|
else {
|
|
299
|
-
const n = (
|
|
292
|
+
const n = (u) => {
|
|
300
293
|
e.updater({
|
|
301
294
|
...e,
|
|
302
|
-
key:
|
|
303
|
-
keyIndex:
|
|
304
|
-
stable:
|
|
295
|
+
key: i,
|
|
296
|
+
keyIndex: o,
|
|
297
|
+
stable: u
|
|
305
298
|
});
|
|
306
299
|
};
|
|
307
|
-
|
|
308
|
-
if (
|
|
309
|
-
const
|
|
310
|
-
this.promiseFieldParser(
|
|
300
|
+
l.isFunction(t[i]) ? i !== "defaultValue" ? this.schemaEffect.trackEffect(() => {
|
|
301
|
+
if (i === "component") {
|
|
302
|
+
const u = t[i](this.getRuntimeMeta());
|
|
303
|
+
this.promiseFieldParser(u, n, !1);
|
|
311
304
|
} else
|
|
312
|
-
this.fieldParser(t[
|
|
305
|
+
this.fieldParser(t[i], n);
|
|
313
306
|
}) : this.defaultValueEffect.trackEffect(() => {
|
|
314
|
-
const
|
|
315
|
-
/\{\s*model\s*\}/.test(t[
|
|
316
|
-
if (!
|
|
317
|
-
return n(
|
|
318
|
-
this.defaultValueInprogressMap.set(t[
|
|
307
|
+
const u = this.schemaEffect.trackEffect(() => {
|
|
308
|
+
/\{\s*model\s*\}/.test(t[i].toString()) ? this.fieldParser(t[i], (c) => {
|
|
309
|
+
if (!c)
|
|
310
|
+
return n(c);
|
|
311
|
+
this.defaultValueInprogressMap.set(t[i], c), !l.isProcessInprogress(c) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(this.defaultValueInprogressMap.values()).every(
|
|
319
312
|
(d) => !d.includes("undefined")
|
|
320
|
-
) ? (n(
|
|
321
|
-
|
|
322
|
-
})) : n(
|
|
323
|
-
}) : this.fieldParser(t[
|
|
324
|
-
this.defaultValueInprogressMap.set(t[
|
|
313
|
+
) ? (n(c), this.defaultValueEffect.clearEffects(), w(() => {
|
|
314
|
+
u();
|
|
315
|
+
})) : n(c);
|
|
316
|
+
}) : this.fieldParser(t[i], (c) => {
|
|
317
|
+
this.defaultValueInprogressMap.set(t[i], c), !l.isProcessInprogress(c) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(this.defaultValueInprogressMap.values()).every(
|
|
325
318
|
(d) => !d.includes("undefined")
|
|
326
|
-
) ? (n(
|
|
327
|
-
|
|
328
|
-
})) : n(
|
|
319
|
+
) ? (n(c), this.defaultValueEffect.clearEffects(), w(() => {
|
|
320
|
+
u();
|
|
321
|
+
})) : n(c);
|
|
329
322
|
});
|
|
330
323
|
});
|
|
331
|
-
}) :
|
|
324
|
+
}) : i === "component" || i === "slots" || i === "runtime" ? this.promiseFieldParser(t[i], n, !1) : this.fieldParser(t[i], n);
|
|
332
325
|
}
|
|
333
326
|
});
|
|
334
327
|
}
|
|
335
328
|
promiseFieldParser(e, t, s) {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
data:
|
|
329
|
+
l.isPromise(e) ? e.then((i) => {
|
|
330
|
+
l.isString(i) && (i = q(i, "")), s && l.isObject(i) ? this.objectParser({
|
|
331
|
+
data: i,
|
|
339
332
|
updater: t
|
|
340
|
-
}) : t(
|
|
341
|
-
}) : (
|
|
333
|
+
}) : t(i);
|
|
334
|
+
}) : (l.isString(e) && (e = q(e, "")), s && l.isObject(e) ? this.objectParser({
|
|
342
335
|
data: e,
|
|
343
336
|
updater: t
|
|
344
337
|
}) : t(e));
|
|
345
338
|
}
|
|
346
339
|
// 对任意对象中单个字段的 parse: 做基本处理
|
|
347
340
|
fieldParser(e, t, s = !0) {
|
|
348
|
-
if (
|
|
341
|
+
if (l.isFunction(e))
|
|
349
342
|
if (e.name.startsWith("__proform_raw_"))
|
|
350
|
-
t((...
|
|
343
|
+
t((...i) => {
|
|
351
344
|
e({
|
|
352
|
-
rawArgs:
|
|
345
|
+
rawArgs: i,
|
|
353
346
|
...this.getRuntimeMeta()
|
|
354
347
|
});
|
|
355
348
|
});
|
|
356
349
|
else {
|
|
357
|
-
const
|
|
358
|
-
this.promiseFieldParser(
|
|
350
|
+
const i = e(this.getRuntimeMeta());
|
|
351
|
+
this.promiseFieldParser(i, t, s);
|
|
359
352
|
}
|
|
360
353
|
else
|
|
361
|
-
|
|
354
|
+
U(e) ? I(
|
|
362
355
|
() => e.value,
|
|
363
356
|
() => {
|
|
364
|
-
|
|
357
|
+
l.isUndefined(e.value) || (s && l.isObject(e.value) ? this.objectParser({
|
|
365
358
|
data: e.value,
|
|
366
359
|
updater: t
|
|
367
360
|
}) : t(e.value));
|
|
@@ -370,10 +363,10 @@ class le {
|
|
|
370
363
|
immediate: !0,
|
|
371
364
|
deep: !0
|
|
372
365
|
}
|
|
373
|
-
) :
|
|
366
|
+
) : x(e) ? I(
|
|
374
367
|
() => e,
|
|
375
368
|
() => {
|
|
376
|
-
|
|
369
|
+
l.isUndefined(e) || (s && l.isObject(e) ? this.objectParser({
|
|
377
370
|
data: e,
|
|
378
371
|
updater: t
|
|
379
372
|
}) : t(e));
|
|
@@ -382,7 +375,7 @@ class le {
|
|
|
382
375
|
immediate: !0,
|
|
383
376
|
deep: !0
|
|
384
377
|
}
|
|
385
|
-
) : s &&
|
|
378
|
+
) : s && l.isObject(e) ? this.objectParser({
|
|
386
379
|
data: e,
|
|
387
380
|
updater: t
|
|
388
381
|
}) : t(e);
|
|
@@ -390,49 +383,89 @@ class le {
|
|
|
390
383
|
modelProcessor(e) {
|
|
391
384
|
e.map(
|
|
392
385
|
(t) => this.createModel(t, this.processedModel.value)
|
|
393
|
-
),
|
|
386
|
+
), l.isObjectEmpty(this.stableModel) && this.stableUpdaterProcessProgress.every(Boolean) && this.defaultValueEffect.effects.size === 0 && (this.stableModel = g(this.processedModel.value), this.runtimeCore.hydrateEffect.triggerEffects(), this.runtimeCore.hydrateEffect.clearEffects());
|
|
394
387
|
}
|
|
395
388
|
createModel(e, t) {
|
|
396
|
-
|
|
389
|
+
l.isListSchema(e) && (t[e.field] || (t[e.field] = [{}]), e.children.forEach((s) => {
|
|
397
390
|
this.createModel(s, t[e.field][0]);
|
|
398
|
-
})),
|
|
391
|
+
})), l.isGroupSchema(e) && e.children.forEach((s) => {
|
|
399
392
|
this.createModel(s, t);
|
|
400
|
-
}),
|
|
393
|
+
}), l.isItemSchema(e) && (t[e.field] = e.defaultValue);
|
|
401
394
|
}
|
|
402
395
|
}
|
|
403
|
-
|
|
404
|
-
|
|
396
|
+
class F {
|
|
397
|
+
static getFormContainer({ ui: e } = {}) {
|
|
398
|
+
return f.presets.uiPresets[e ?? f.presets.ui].container.Form;
|
|
399
|
+
}
|
|
400
|
+
static getFormItemContainer({ ui: e } = {}) {
|
|
401
|
+
return f.presets.uiPresets[e ?? f.presets.ui].container.FormItem;
|
|
402
|
+
}
|
|
403
|
+
static getItemContainer({ ui: e } = {}) {
|
|
404
|
+
return f.presets.uiPresets[e ?? f.presets.ui].container.Item;
|
|
405
|
+
}
|
|
406
|
+
static getGroupContainer({ ui: e } = {}) {
|
|
407
|
+
return f.presets.uiPresets[e ?? f.presets.ui].container.Group;
|
|
408
|
+
}
|
|
409
|
+
static getListContainer({ ui: e } = {}) {
|
|
410
|
+
return f.presets.uiPresets[e ?? f.presets.ui].container.List;
|
|
411
|
+
}
|
|
412
|
+
static getListItemContainer({ ui: e } = {}) {
|
|
413
|
+
return f.presets.uiPresets[e ?? f.presets.ui].container.ListItem;
|
|
414
|
+
}
|
|
405
415
|
}
|
|
406
|
-
class
|
|
416
|
+
class fe {
|
|
417
|
+
constructor(e) {
|
|
418
|
+
this.ui = e;
|
|
419
|
+
}
|
|
420
|
+
getRuntimeField(e) {
|
|
421
|
+
var i;
|
|
422
|
+
const t = (i = f.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s = j.adapters[this.ui];
|
|
423
|
+
return (t == null ? void 0 : t.getRuntimeField(e)) ?? (s == null ? void 0 : s.getRuntimeField(e));
|
|
424
|
+
}
|
|
425
|
+
getRuntimeRequired(e) {
|
|
426
|
+
var i;
|
|
427
|
+
const t = (i = f.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s = j.adapters[this.ui];
|
|
428
|
+
return (t == null ? void 0 : t.getRuntimeRequired(e)) ?? (s == null ? void 0 : s.getRuntimeRequired(e));
|
|
429
|
+
}
|
|
430
|
+
getFormModelPropName() {
|
|
431
|
+
var s;
|
|
432
|
+
const e = (s = f.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, t = j.adapters[this.ui];
|
|
433
|
+
return (e == null ? void 0 : e.getFormModelPropName()) ?? (t == null ? void 0 : t.getFormModelPropName());
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
function de(r) {
|
|
437
|
+
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !le(r);
|
|
438
|
+
}
|
|
439
|
+
class pe {
|
|
407
440
|
constructor(e) {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
441
|
+
a(this, "schemas", R([]));
|
|
442
|
+
a(this, "model", R({}));
|
|
443
|
+
a(this, "processorBySchemaType", {
|
|
411
444
|
item: this.runtimeItemProcessor.bind(this),
|
|
412
445
|
group: this.runtimeGroupProcessor.bind(this),
|
|
413
446
|
list: this.runtimeListProcessor.bind(this)
|
|
414
447
|
});
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
448
|
+
a(this, "formRef", R(null));
|
|
449
|
+
a(this, "hydrateEffect", new N());
|
|
450
|
+
a(this, "native", oe({}));
|
|
451
|
+
a(this, "grid", {});
|
|
452
|
+
a(this, "runtime", {});
|
|
453
|
+
a(this, "globalNativeFormOverride", {
|
|
421
454
|
props: {},
|
|
422
455
|
slots: {}
|
|
423
456
|
});
|
|
424
|
-
this.setup = e, this.processor = new
|
|
457
|
+
this.setup = e, this.processor = new ce(this);
|
|
425
458
|
const t = this.setup(this);
|
|
426
|
-
if (
|
|
427
|
-
const s =
|
|
459
|
+
if (this.ui = t.ui ?? f.presets.ui, this.runtimeAdapter = new fe(this.ui), U(t.schemas)) {
|
|
460
|
+
const s = I(() => t.schemas, () => {
|
|
428
461
|
this.processor.parseSchemas(t.schemas.value), w(() => {
|
|
429
462
|
s();
|
|
430
463
|
});
|
|
431
464
|
}, {
|
|
432
465
|
deep: !0
|
|
433
466
|
});
|
|
434
|
-
} else if (
|
|
435
|
-
const s =
|
|
467
|
+
} else if (x(t.schemas)) {
|
|
468
|
+
const s = I(() => t.schemas, () => {
|
|
436
469
|
this.processor.parseSchemas(t.schemas), w(() => {
|
|
437
470
|
s();
|
|
438
471
|
});
|
|
@@ -444,60 +477,55 @@ class ue {
|
|
|
444
477
|
}
|
|
445
478
|
getRuntimeMeta() {
|
|
446
479
|
return {
|
|
447
|
-
model:
|
|
480
|
+
model: V(g(this.model.value))
|
|
448
481
|
};
|
|
449
482
|
}
|
|
450
|
-
runtimeItemProcessor(e, t, s = this.model.value,
|
|
451
|
-
var
|
|
452
|
-
|
|
453
|
-
|
|
483
|
+
runtimeItemProcessor(e, t, s = this.model.value, i) {
|
|
484
|
+
var k, z, _, $, B, D, G, T, K, W, H, J, Q;
|
|
485
|
+
const o = V(e.component);
|
|
486
|
+
if (!o)
|
|
487
|
+
return;
|
|
488
|
+
m(this.globalNativeFormOverride.props, (z = (k = e.native) == null ? void 0 : k.props) == null ? void 0 : z.Form), m(this.globalNativeFormOverride.slots, ($ = (_ = e.native) == null ? void 0 : _.slots) == null ? void 0 : $.Form);
|
|
489
|
+
const n = m(g((D = (B = this.native) == null ? void 0 : B.slots) == null ? void 0 : D.FormItem) ?? {}, (T = (G = e.native) == null ? void 0 : G.slots) == null ? void 0 : T.FormItem), u = {
|
|
454
490
|
display: "grid",
|
|
455
491
|
gridColumn: "1 / -1",
|
|
456
|
-
...e.
|
|
457
|
-
},
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
required: !0,
|
|
473
|
-
message: `${S}是必填项`
|
|
474
|
-
});
|
|
475
|
-
else {
|
|
476
|
-
const h = e.rules.findIndex((x) => !f.isUndefined(x.required));
|
|
477
|
-
h !== -1 && (e.rules[h].required = !0, e.rules[h].message = `${S}是必填项`);
|
|
478
|
-
}
|
|
479
|
-
else if (e.rules) {
|
|
480
|
-
const h = (X = e.rules) == null ? void 0 : X.findIndex((x) => !!x.required);
|
|
481
|
-
h !== -1 && (e.rules[h].required = !1);
|
|
492
|
+
...e.grid
|
|
493
|
+
}, c = m(g((W = (K = this.native) == null ? void 0 : K.props) == null ? void 0 : W.FormItem) ?? {}, (J = (H = e.native) == null ? void 0 : H.props) == null ? void 0 : J.FormItem), d = this.runtimeAdapter.getRuntimeField({
|
|
494
|
+
schema: e,
|
|
495
|
+
parentSchema: i,
|
|
496
|
+
index: t
|
|
497
|
+
}), y = o.name, O = e.componentProps ?? {}, v = j.placeholderPresetByComponentName;
|
|
498
|
+
let P = e.placeholder, b = e.show;
|
|
499
|
+
b === void 0 && (b = !0), b || delete s[e.field];
|
|
500
|
+
let h = e.label;
|
|
501
|
+
const E = (i == null ? void 0 : i.runtime) ?? this.runtime;
|
|
502
|
+
if (!l.isUndefined(t) && !l.isObjectEmpty(E) && (h = q((Q = E == null ? void 0 : E.customizeItemLabel) == null ? void 0 : Q.call(E, e.label ?? "", t + 1), "")), !P) {
|
|
503
|
+
let C = "请输入";
|
|
504
|
+
l.isUndefined(y) ? P = `${C}${h}` : /* @ts-expect-error */ v[y.toLowerCase()] ? (C = // @ts-expect-error
|
|
505
|
+
v[y.toLowerCase()], P = `${C}${h}`) : (Object.keys(v).forEach((X) => {
|
|
506
|
+
y.toLowerCase().includes(X.toLowerCase()) && (C = v[X]);
|
|
507
|
+
}), P = `${C}${h}`);
|
|
482
508
|
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
509
|
+
const ee = this.runtimeAdapter.getRuntimeRequired({
|
|
510
|
+
...e,
|
|
511
|
+
label: h
|
|
512
|
+
}), te = F.getItemContainer(this), se = F.getFormItemContainer(this);
|
|
513
|
+
return p("div", {
|
|
514
|
+
style: u
|
|
515
|
+
}, [p(te, null, {
|
|
486
516
|
default() {
|
|
487
|
-
return Y(
|
|
488
|
-
label: `${
|
|
489
|
-
|
|
490
|
-
field: u
|
|
491
|
-
}), {
|
|
517
|
+
return Y(p(se, M(c, {
|
|
518
|
+
label: `${h}:`
|
|
519
|
+
}, d, ee), {
|
|
492
520
|
default() {
|
|
493
|
-
return
|
|
521
|
+
return p(o, M({
|
|
494
522
|
modelValue: s[e.field],
|
|
495
|
-
"onUpdate:modelValue": (
|
|
523
|
+
"onUpdate:modelValue": (C) => s[e.field] = C,
|
|
496
524
|
placeholder: P
|
|
497
|
-
},
|
|
525
|
+
}, O), null);
|
|
498
526
|
},
|
|
499
527
|
...n
|
|
500
|
-
}), [[Z,
|
|
528
|
+
}), [[Z, b]]);
|
|
501
529
|
}
|
|
502
530
|
})]);
|
|
503
531
|
}
|
|
@@ -506,13 +534,13 @@ class ue {
|
|
|
506
534
|
const s = {
|
|
507
535
|
display: "grid",
|
|
508
536
|
gridColumn: "1 / -1",
|
|
509
|
-
...e.
|
|
510
|
-
};
|
|
511
|
-
return
|
|
537
|
+
...e.grid
|
|
538
|
+
}, i = F.getGroupContainer(this);
|
|
539
|
+
return p("div", {
|
|
512
540
|
style: s
|
|
513
|
-
}, [
|
|
541
|
+
}, [p(i, {
|
|
514
542
|
schema: e
|
|
515
|
-
},
|
|
543
|
+
}, de(t = e.children.map((o) => this.runtimeItemProcessor(o))) ? t : {
|
|
516
544
|
default: () => [t]
|
|
517
545
|
})]);
|
|
518
546
|
}
|
|
@@ -523,7 +551,7 @@ class ue {
|
|
|
523
551
|
code: "0001",
|
|
524
552
|
message: "异步默认值数据正在处理中,请您耐心等待... "
|
|
525
553
|
});
|
|
526
|
-
(s = this.processor.stableModel[e.field]) != null && s[0] && this.model.value[e.field].push(
|
|
554
|
+
(s = this.processor.stableModel[e.field]) != null && s[0] && this.model.value[e.field].push(g(this.processor.stableModel[e.field][0])), this.formRef.value.clearValidate();
|
|
527
555
|
}
|
|
528
556
|
deleteListItem(e, t) {
|
|
529
557
|
this.model.value[e.field].splice(t, 1), this.formRef.value.clearValidate();
|
|
@@ -532,34 +560,36 @@ class ue {
|
|
|
532
560
|
const t = {
|
|
533
561
|
display: "grid",
|
|
534
562
|
gridColumn: "1 / -1",
|
|
535
|
-
...e.
|
|
563
|
+
...e.grid
|
|
536
564
|
}, s = this;
|
|
537
|
-
|
|
565
|
+
s.model.value[e.field] || (s.model.value[e.field] = [{}]);
|
|
566
|
+
const i = F.getListContainer(this), o = F.getListItemContainer(this);
|
|
567
|
+
return p("div", {
|
|
538
568
|
style: t
|
|
539
|
-
}, [
|
|
569
|
+
}, [p(i, {
|
|
540
570
|
schema: e
|
|
541
571
|
}, {
|
|
542
572
|
default() {
|
|
543
|
-
return s.model.value[e.field].map((
|
|
573
|
+
return s.model.value[e.field].map((n, u) => p(o, null, {
|
|
544
574
|
default() {
|
|
545
|
-
return e.children.map((
|
|
575
|
+
return e.children.map((c) => s.runtimeItemProcessor(c, u, n, e));
|
|
546
576
|
},
|
|
547
577
|
delete({
|
|
548
|
-
container:
|
|
578
|
+
container: c
|
|
549
579
|
} = {}) {
|
|
550
|
-
var
|
|
551
|
-
let
|
|
552
|
-
return Y(
|
|
553
|
-
onClick: () => s.deleteListItem(e,
|
|
554
|
-
}, null), [[Z, ((
|
|
580
|
+
var y;
|
|
581
|
+
let d = c ?? p("button", null, null);
|
|
582
|
+
return Y(p(d, {
|
|
583
|
+
onClick: () => s.deleteListItem(e, u)
|
|
584
|
+
}, null), [[Z, ((y = s.model.value[e.field]) == null ? void 0 : y.length) > 1]]);
|
|
555
585
|
}
|
|
556
586
|
}));
|
|
557
587
|
},
|
|
558
588
|
add({
|
|
559
|
-
container:
|
|
589
|
+
container: n
|
|
560
590
|
} = {}) {
|
|
561
|
-
let
|
|
562
|
-
return
|
|
591
|
+
let u = n ?? p("button", null, [ne("添加")]);
|
|
592
|
+
return p(u, {
|
|
563
593
|
onClick: () => s.addListItem(e)
|
|
564
594
|
}, null);
|
|
565
595
|
}
|
|
@@ -569,43 +599,137 @@ class ue {
|
|
|
569
599
|
return e.map((t) => (t.type || (t.type = "item"), this.processorBySchemaType[t.type](t)));
|
|
570
600
|
}
|
|
571
601
|
exec() {
|
|
572
|
-
var
|
|
602
|
+
var u, c, d, y;
|
|
573
603
|
const e = {
|
|
574
604
|
display: "grid",
|
|
575
605
|
gridColumn: "1 / -1",
|
|
576
606
|
gridAutoColumns: "1fr",
|
|
577
|
-
...this.
|
|
578
|
-
}, t = this, s =
|
|
579
|
-
return
|
|
580
|
-
ref: this.formRef
|
|
581
|
-
|
|
607
|
+
...this.grid
|
|
608
|
+
}, t = this, s = m(g((c = (u = this.native) == null ? void 0 : u.props) == null ? void 0 : c.Form) ?? {}, this.globalNativeFormOverride.props), i = m(g((y = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : y.Form) ?? {}, this.globalNativeFormOverride.slots), o = F.getFormContainer(this), n = this.runtimeAdapter.getFormModelPropName();
|
|
609
|
+
return p(o, M(s, {
|
|
610
|
+
ref: this.formRef
|
|
611
|
+
}, {
|
|
612
|
+
[n]: this.model.value
|
|
582
613
|
}), {
|
|
583
614
|
default() {
|
|
584
|
-
return
|
|
615
|
+
return p("div", {
|
|
585
616
|
style: e
|
|
586
617
|
}, [t.runtimeProcessor(t.schemas.value)]);
|
|
587
618
|
},
|
|
588
|
-
...
|
|
619
|
+
...i
|
|
589
620
|
});
|
|
590
621
|
}
|
|
591
622
|
}
|
|
592
|
-
class
|
|
623
|
+
class f {
|
|
624
|
+
}
|
|
625
|
+
a(f, "presets");
|
|
626
|
+
function A({ parentSchema: r, schema: e, index: t }) {
|
|
627
|
+
return r ? `${r.field}.${t}.${e.field}` : e.field;
|
|
593
628
|
}
|
|
594
|
-
|
|
595
|
-
|
|
629
|
+
const he = {
|
|
630
|
+
ArcoVue: {
|
|
631
|
+
getRuntimeField(r) {
|
|
632
|
+
return {
|
|
633
|
+
field: A(r)
|
|
634
|
+
};
|
|
635
|
+
},
|
|
636
|
+
getRuntimeRequired(r) {
|
|
637
|
+
var e, t;
|
|
638
|
+
if (r.required)
|
|
639
|
+
if (!r.rules)
|
|
640
|
+
r.rules = [], (e = r.rules) == null || e.push({
|
|
641
|
+
required: !0,
|
|
642
|
+
message: `${r.label}是必填项`
|
|
643
|
+
});
|
|
644
|
+
else {
|
|
645
|
+
const s = r.rules.findIndex(
|
|
646
|
+
(i) => !l.isUndefined(i.required)
|
|
647
|
+
);
|
|
648
|
+
s !== -1 && (r.rules[s].required = !0, r.rules[s].message = `${r.label}是必填项`);
|
|
649
|
+
}
|
|
650
|
+
else if (r.rules) {
|
|
651
|
+
const s = (t = r.rules) == null ? void 0 : t.findIndex(
|
|
652
|
+
(i) => !!i.required
|
|
653
|
+
);
|
|
654
|
+
s !== -1 && (r.rules[s].required = !1);
|
|
655
|
+
}
|
|
656
|
+
return {
|
|
657
|
+
rules: r.rules
|
|
658
|
+
};
|
|
659
|
+
},
|
|
660
|
+
getFormModelPropName() {
|
|
661
|
+
return "model";
|
|
662
|
+
},
|
|
663
|
+
validateForm(r) {
|
|
664
|
+
return new Promise((e, t) => {
|
|
665
|
+
r.runtimeCore.formRef.value.validate((s) => s ? t(s) : e(
|
|
666
|
+
r.cleanFallbackFields(
|
|
667
|
+
V(r.runtimeCore.processor.processedModel.value)
|
|
668
|
+
)
|
|
669
|
+
));
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
},
|
|
673
|
+
NutUI: {
|
|
674
|
+
getRuntimeField(r) {
|
|
675
|
+
return {
|
|
676
|
+
prop: A(r)
|
|
677
|
+
};
|
|
678
|
+
},
|
|
679
|
+
getRuntimeRequired(r) {
|
|
680
|
+
var e, t;
|
|
681
|
+
if (r.required)
|
|
682
|
+
if (!r.rules)
|
|
683
|
+
r.rules = [], (e = r.rules) == null || e.push({
|
|
684
|
+
required: !0,
|
|
685
|
+
message: `${r.label}是必填项`
|
|
686
|
+
});
|
|
687
|
+
else {
|
|
688
|
+
const s = r.rules.findIndex(
|
|
689
|
+
(i) => !l.isUndefined(i.required)
|
|
690
|
+
);
|
|
691
|
+
s !== -1 && (r.rules[s].required = !0, r.rules[s].message = `${r.label}是必填项`);
|
|
692
|
+
}
|
|
693
|
+
else if (r.rules) {
|
|
694
|
+
const s = (t = r.rules) == null ? void 0 : t.findIndex(
|
|
695
|
+
(i) => !!i.required
|
|
696
|
+
);
|
|
697
|
+
s !== -1 && (r.rules[s].required = !1);
|
|
698
|
+
}
|
|
699
|
+
return {
|
|
700
|
+
rules: r.rules,
|
|
701
|
+
required: r.required
|
|
702
|
+
};
|
|
703
|
+
},
|
|
704
|
+
getFormModelPropName() {
|
|
705
|
+
return "modelValue";
|
|
706
|
+
},
|
|
707
|
+
validateForm(r) {
|
|
708
|
+
return new Promise((e, t) => {
|
|
709
|
+
r.runtimeCore.formRef.value.validate().then(({ valid: s, errors: i }) => {
|
|
710
|
+
s ? e(
|
|
711
|
+
r.cleanFallbackFields(
|
|
712
|
+
V(r.runtimeCore.processor.processedModel.value)
|
|
713
|
+
)
|
|
714
|
+
) : t(i);
|
|
715
|
+
});
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
}, S = class S {
|
|
596
720
|
static getPlaceholderPrefixPresetByComponentName() {
|
|
597
721
|
const e = {
|
|
598
|
-
请选择: ["
|
|
599
|
-
请输入: ["
|
|
722
|
+
请选择: ["select", "tree"],
|
|
723
|
+
请输入: ["input"]
|
|
600
724
|
}, t = {};
|
|
601
725
|
for (let s in e)
|
|
602
|
-
e[s].forEach((
|
|
603
|
-
t[
|
|
726
|
+
e[s].forEach((i) => {
|
|
727
|
+
t[i] = s;
|
|
604
728
|
});
|
|
605
729
|
return t;
|
|
606
730
|
}
|
|
607
731
|
};
|
|
608
|
-
|
|
732
|
+
a(S, "schemaPreset", {
|
|
609
733
|
type: {
|
|
610
734
|
defaultValue: "item"
|
|
611
735
|
},
|
|
@@ -639,29 +763,38 @@ l(E, "schemaPreset", {
|
|
|
639
763
|
children: {
|
|
640
764
|
defaultValue: []
|
|
641
765
|
},
|
|
642
|
-
native:
|
|
643
|
-
|
|
644
|
-
}
|
|
766
|
+
native: {
|
|
767
|
+
defaultValue: void 0
|
|
768
|
+
},
|
|
769
|
+
grid: {
|
|
770
|
+
default: void 0
|
|
771
|
+
}
|
|
772
|
+
}), a(S, "componentPropsPreset", {
|
|
645
773
|
options: {
|
|
646
774
|
defaultValue: []
|
|
647
775
|
}
|
|
648
776
|
}), // 基于基本功能提出基本预设
|
|
649
|
-
|
|
650
|
-
let
|
|
651
|
-
const
|
|
777
|
+
a(S, "placeholderPresetByComponentName", S.getPlaceholderPrefixPresetByComponentName());
|
|
778
|
+
let L = S;
|
|
779
|
+
const j = {
|
|
780
|
+
...L,
|
|
781
|
+
adapters: {
|
|
782
|
+
...he
|
|
783
|
+
}
|
|
784
|
+
}, be = /* @__PURE__ */ ae({
|
|
652
785
|
props: {
|
|
653
786
|
setup: {
|
|
654
787
|
type: Function,
|
|
655
788
|
required: !0
|
|
656
789
|
}
|
|
657
790
|
},
|
|
658
|
-
setup(
|
|
659
|
-
const e = new
|
|
791
|
+
setup(r) {
|
|
792
|
+
const e = new pe(r.setup);
|
|
660
793
|
return () => e.exec();
|
|
661
794
|
}
|
|
662
795
|
});
|
|
663
|
-
function
|
|
664
|
-
const e = new
|
|
796
|
+
function Pe(r) {
|
|
797
|
+
const e = new ue(r);
|
|
665
798
|
return [
|
|
666
799
|
e.setup.bind(e),
|
|
667
800
|
{
|
|
@@ -670,22 +803,18 @@ function pe(o) {
|
|
|
670
803
|
}
|
|
671
804
|
];
|
|
672
805
|
}
|
|
673
|
-
function
|
|
674
|
-
|
|
675
|
-
install() {
|
|
676
|
-
g.runtimeDoms = o;
|
|
677
|
-
}
|
|
678
|
-
};
|
|
806
|
+
function ge(r) {
|
|
807
|
+
f.presets = r;
|
|
679
808
|
}
|
|
680
|
-
function
|
|
681
|
-
return e === "raw" && Object.defineProperty(
|
|
682
|
-
value: `__proform_raw_${
|
|
809
|
+
function ve(r, e) {
|
|
810
|
+
return e === "raw" && Object.defineProperty(r, "name", {
|
|
811
|
+
value: `__proform_raw_${r.name}`,
|
|
683
812
|
writable: !0
|
|
684
|
-
}),
|
|
813
|
+
}), r;
|
|
685
814
|
}
|
|
686
815
|
export {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
816
|
+
be as ProForm,
|
|
817
|
+
Pe as useForm,
|
|
818
|
+
ge as useFormPresetConfigurer,
|
|
819
|
+
ve as useModifiers
|
|
691
820
|
};
|