@harbor-design/proform 1.2.2 → 1.2.3
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.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var re = Object.defineProperty;
|
|
2
2
|
var ie = (r, e, t) => e in r ? re(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var a = (r, e, t) => (ie(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
-
import { isRef as N, watch as
|
|
4
|
+
import { isRef as N, watch as P, isReactive as q, nextTick as E, toRaw as R, ref as U, reactive as oe, createVNode as p, mergeProps as O, withDirectives as ne, vShow as le, createTextVNode as ae, isVNode as ue, defineComponent as ce } from "vue";
|
|
5
5
|
class l {
|
|
6
6
|
static typeChecker(e) {
|
|
7
7
|
return {}.toString.call(e);
|
|
@@ -91,8 +91,8 @@ function C(r) {
|
|
|
91
91
|
return new RegExp(s);
|
|
92
92
|
if (s instanceof Map) {
|
|
93
93
|
const o = /* @__PURE__ */ new Map();
|
|
94
|
-
for (const [n,
|
|
95
|
-
o.set(t(n), t(
|
|
94
|
+
for (const [n, f] of s)
|
|
95
|
+
o.set(t(n), t(f));
|
|
96
96
|
return o;
|
|
97
97
|
}
|
|
98
98
|
if (s instanceof Set) {
|
|
@@ -118,7 +118,7 @@ function C(r) {
|
|
|
118
118
|
}
|
|
119
119
|
return t(r);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function x(r, e) {
|
|
122
122
|
return r.replace(/undefined/g, e);
|
|
123
123
|
}
|
|
124
124
|
class fe {
|
|
@@ -137,7 +137,7 @@ class fe {
|
|
|
137
137
|
}
|
|
138
138
|
submit() {
|
|
139
139
|
var s;
|
|
140
|
-
const e = (s =
|
|
140
|
+
const e = (s = u.getPreset(this.runtimeCore.ui)) == null ? void 0 : s.adapter, t = b.adapters[u.getUI(this.runtimeCore.ui)];
|
|
141
141
|
return (e == null ? void 0 : e.validateForm(this)) ?? (t == null ? void 0 : t.validateForm(this));
|
|
142
142
|
}
|
|
143
143
|
hydrate(e) {
|
|
@@ -148,7 +148,7 @@ class fe {
|
|
|
148
148
|
});
|
|
149
149
|
this.runtimeCore.hydrateEffect.trackEffect(
|
|
150
150
|
() => {
|
|
151
|
-
N(e) ?
|
|
151
|
+
N(e) ? P(
|
|
152
152
|
() => e.value,
|
|
153
153
|
() => {
|
|
154
154
|
h(this.runtimeCore.model.value, e.value);
|
|
@@ -157,7 +157,7 @@ class fe {
|
|
|
157
157
|
deep: !0,
|
|
158
158
|
immediate: !0
|
|
159
159
|
}
|
|
160
|
-
) : q(e) ?
|
|
160
|
+
) : q(e) ? P(
|
|
161
161
|
() => e,
|
|
162
162
|
() => {
|
|
163
163
|
h(this.runtimeCore.model.value, e);
|
|
@@ -175,7 +175,7 @@ class fe {
|
|
|
175
175
|
}
|
|
176
176
|
share(e) {
|
|
177
177
|
if (N(e)) {
|
|
178
|
-
const t =
|
|
178
|
+
const t = P(
|
|
179
179
|
() => e.value,
|
|
180
180
|
() => {
|
|
181
181
|
h(this.runtimeCore.shared, e.value), this.runtimeCore.processor.schemaEffect.triggerEffects(), E(() => {
|
|
@@ -188,7 +188,7 @@ class fe {
|
|
|
188
188
|
}
|
|
189
189
|
);
|
|
190
190
|
} else if (q(e)) {
|
|
191
|
-
const t =
|
|
191
|
+
const t = P(
|
|
192
192
|
() => e,
|
|
193
193
|
() => {
|
|
194
194
|
h(this.runtimeCore.shared, e), this.runtimeCore.processor.schemaEffect.triggerEffects(), E(() => {
|
|
@@ -204,7 +204,7 @@ class fe {
|
|
|
204
204
|
h(this.runtimeCore.shared, e), this.runtimeCore.processor.schemaEffect.triggerEffects();
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
class
|
|
207
|
+
class L {
|
|
208
208
|
constructor() {
|
|
209
209
|
a(this, "effects", /* @__PURE__ */ new Set());
|
|
210
210
|
}
|
|
@@ -228,16 +228,16 @@ class de {
|
|
|
228
228
|
a(this, "getRuntimeMeta");
|
|
229
229
|
a(this, "stableSchemas", []);
|
|
230
230
|
a(this, "stableModel", {});
|
|
231
|
-
a(this, "schemaPreset",
|
|
232
|
-
a(this, "componentPropsPreset",
|
|
231
|
+
a(this, "schemaPreset", b.schemaPreset);
|
|
232
|
+
a(this, "componentPropsPreset", b.componentPropsPreset);
|
|
233
233
|
a(this, "stableUpdaterProcessProgress");
|
|
234
234
|
a(this, "stableUpdaterTimes", 0);
|
|
235
|
-
a(this, "schemaEffect", new
|
|
236
|
-
a(this, "defaultValueEffect", new
|
|
235
|
+
a(this, "schemaEffect", new L());
|
|
236
|
+
a(this, "defaultValueEffect", new L());
|
|
237
237
|
a(this, "defaultValueInprogressMap", /* @__PURE__ */ new Map());
|
|
238
238
|
a(this, "baseDefaultValueFunctionsLength");
|
|
239
239
|
a(this, "isModelInitialized", !0);
|
|
240
|
-
this.runtimeCore = e, this.processedSchemas = e.schemas, this.processedModel = e.model, this.getRuntimeMeta = e.getRuntimeMeta.bind(e),
|
|
240
|
+
this.runtimeCore = e, this.processedSchemas = e.schemas, this.processedModel = e.model, this.getRuntimeMeta = e.getRuntimeMeta.bind(e), P(
|
|
241
241
|
() => this.processedModel.value,
|
|
242
242
|
() => {
|
|
243
243
|
this.schemaEffect.triggerEffects();
|
|
@@ -298,21 +298,21 @@ class de {
|
|
|
298
298
|
// 核心单 schema 处理过程,接收一个对象键值对的数据结构
|
|
299
299
|
parseItem(e, t, s) {
|
|
300
300
|
const i = this, o = Array.from({
|
|
301
|
-
length: Object.keys(e).filter((
|
|
301
|
+
length: Object.keys(e).filter((f) => f !== "children").length
|
|
302
302
|
}).fill(!1);
|
|
303
303
|
this.objectParser({ data: e, index: t, updater: n });
|
|
304
|
-
function n(
|
|
305
|
-
const
|
|
306
|
-
if (l.isUndefined(
|
|
304
|
+
function n(f) {
|
|
305
|
+
const c = f.index, d = f.key, v = f.keyIndex;
|
|
306
|
+
if (l.isUndefined(f.stable))
|
|
307
307
|
return;
|
|
308
|
-
const j = i.parseStable(
|
|
308
|
+
const j = i.parseStable(f.stable), I = s == null ? void 0 : s.index, g = s == null ? void 0 : s.key;
|
|
309
309
|
let y = j;
|
|
310
310
|
if (l.isProcessInprogress(y) || (o[v] = !0), s) {
|
|
311
|
-
const m = i.processedSchemas.value[I][g][
|
|
312
|
-
m && l.isObject(m) && d !== "component" && (y = h(m, y)), i.processedSchemas.value[I][g][
|
|
311
|
+
const m = i.processedSchemas.value[I][g][c][d];
|
|
312
|
+
m && l.isObject(m) && d !== "component" && (y = h(m, y)), i.processedSchemas.value[I][g][c][d] = y, i.stableUpdater(o);
|
|
313
313
|
} else {
|
|
314
|
-
const m = i.processedSchemas.value[
|
|
315
|
-
m && l.isObject(m) && d !== "component" && (y = h(m, y)), i.processedSchemas.value[
|
|
314
|
+
const m = i.processedSchemas.value[c][d];
|
|
315
|
+
m && l.isObject(m) && d !== "component" && (y = h(m, y)), i.processedSchemas.value[c][d] = y, i.stableUpdater(o);
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}
|
|
@@ -327,19 +327,19 @@ class de {
|
|
|
327
327
|
keyIndex: o
|
|
328
328
|
});
|
|
329
329
|
else {
|
|
330
|
-
const n = (
|
|
330
|
+
const n = (f) => {
|
|
331
331
|
e.updater({
|
|
332
332
|
...e,
|
|
333
333
|
key: i,
|
|
334
334
|
keyIndex: o,
|
|
335
|
-
stable:
|
|
335
|
+
stable: f
|
|
336
336
|
});
|
|
337
337
|
};
|
|
338
338
|
l.isFunction(t[i]) ? i !== "defaultValue" ? this.schemaEffect.trackEffect(
|
|
339
339
|
() => {
|
|
340
340
|
if (i === "component") {
|
|
341
|
-
const
|
|
342
|
-
this.promiseFieldParser(
|
|
341
|
+
const f = t[i](this.getRuntimeMeta());
|
|
342
|
+
this.promiseFieldParser(f, n, !1);
|
|
343
343
|
} else
|
|
344
344
|
this.fieldParser(t[i], n);
|
|
345
345
|
},
|
|
@@ -348,22 +348,22 @@ class de {
|
|
|
348
348
|
}
|
|
349
349
|
) : this.defaultValueEffect.trackEffect(
|
|
350
350
|
() => {
|
|
351
|
-
const
|
|
351
|
+
const f = this.schemaEffect.trackEffect(
|
|
352
352
|
() => {
|
|
353
|
-
/\{\s*model\s*\}/.test(t[i].toString()) ? this.fieldParser(t[i], (
|
|
354
|
-
if (!
|
|
355
|
-
return n(
|
|
356
|
-
this.defaultValueInprogressMap.set(t[i],
|
|
353
|
+
/\{\s*model\s*\}/.test(t[i].toString()) ? this.fieldParser(t[i], (c) => {
|
|
354
|
+
if (!c)
|
|
355
|
+
return n(c);
|
|
356
|
+
this.defaultValueInprogressMap.set(t[i], c), !l.isProcessInprogress(c) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
357
357
|
this.defaultValueInprogressMap.values()
|
|
358
|
-
).every((d) => !d.includes("undefined")) ? (n(
|
|
359
|
-
|
|
360
|
-
})) : n(
|
|
361
|
-
}) : this.fieldParser(t[i], (
|
|
362
|
-
this.defaultValueInprogressMap.set(t[i],
|
|
358
|
+
).every((d) => !d.includes("undefined")) ? (n(c), this.defaultValueEffect.clearEffects(), E(() => {
|
|
359
|
+
f();
|
|
360
|
+
})) : n(c);
|
|
361
|
+
}) : this.fieldParser(t[i], (c) => {
|
|
362
|
+
this.defaultValueInprogressMap.set(t[i], c), !l.isProcessInprogress(c) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
363
363
|
this.defaultValueInprogressMap.values()
|
|
364
|
-
).every((d) => !d.includes("undefined")) ? (n(
|
|
365
|
-
|
|
366
|
-
})) : n(
|
|
364
|
+
).every((d) => !d.includes("undefined")) ? (n(c), this.defaultValueEffect.clearEffects(), E(() => {
|
|
365
|
+
f();
|
|
366
|
+
})) : n(c);
|
|
367
367
|
});
|
|
368
368
|
},
|
|
369
369
|
{
|
|
@@ -380,11 +380,11 @@ class de {
|
|
|
380
380
|
}
|
|
381
381
|
promiseFieldParser(e, t, s) {
|
|
382
382
|
l.isPromise(e) ? e.then((i) => {
|
|
383
|
-
l.isString(i) && (i =
|
|
383
|
+
l.isString(i) && (i = x(i, "")), s && l.isObject(i) && !l.isNativeObject(i) ? this.objectParser({
|
|
384
384
|
data: i,
|
|
385
385
|
updater: t
|
|
386
386
|
}) : t(i);
|
|
387
|
-
}) : (l.isString(e) && (e =
|
|
387
|
+
}) : (l.isString(e) && (e = x(e, "")), s && l.isObject(e) && !l.isNativeObject(e) ? this.objectParser({
|
|
388
388
|
data: e,
|
|
389
389
|
updater: t
|
|
390
390
|
}) : t(e));
|
|
@@ -404,7 +404,7 @@ class de {
|
|
|
404
404
|
this.promiseFieldParser(i, t, s);
|
|
405
405
|
}
|
|
406
406
|
else
|
|
407
|
-
N(e) ?
|
|
407
|
+
N(e) ? P(
|
|
408
408
|
() => e.value,
|
|
409
409
|
() => {
|
|
410
410
|
l.isUndefined(e.value) || (s && l.isObject(e.value) && !l.isNativeObject(e.value) ? this.objectParser({
|
|
@@ -416,7 +416,7 @@ class de {
|
|
|
416
416
|
immediate: !0,
|
|
417
417
|
deep: !0
|
|
418
418
|
}
|
|
419
|
-
) : q(e) ?
|
|
419
|
+
) : q(e) ? P(
|
|
420
420
|
() => e,
|
|
421
421
|
() => {
|
|
422
422
|
l.isUndefined(e) || (s && l.isObject(e) && !l.isNativeObject(e) ? this.objectParser({
|
|
@@ -448,22 +448,22 @@ class de {
|
|
|
448
448
|
}
|
|
449
449
|
class F {
|
|
450
450
|
static getFormContainer({ ui: e } = {}) {
|
|
451
|
-
return
|
|
451
|
+
return u.presets.uiPresets[e ?? u.presets.ui].container.Form;
|
|
452
452
|
}
|
|
453
453
|
static getFormItemContainer({ ui: e } = {}) {
|
|
454
|
-
return
|
|
454
|
+
return u.presets.uiPresets[e ?? u.presets.ui].container.FormItem;
|
|
455
455
|
}
|
|
456
456
|
static getItemContainer({ ui: e } = {}) {
|
|
457
|
-
return
|
|
457
|
+
return u.presets.uiPresets[e ?? u.presets.ui].container.Item;
|
|
458
458
|
}
|
|
459
459
|
static getGroupContainer({ ui: e } = {}) {
|
|
460
|
-
return
|
|
460
|
+
return u.presets.uiPresets[e ?? u.presets.ui].container.Group;
|
|
461
461
|
}
|
|
462
462
|
static getListContainer({ ui: e } = {}) {
|
|
463
|
-
return
|
|
463
|
+
return u.presets.uiPresets[e ?? u.presets.ui].container.List;
|
|
464
464
|
}
|
|
465
465
|
static getListItemContainer({ ui: e } = {}) {
|
|
466
|
-
return
|
|
466
|
+
return u.presets.uiPresets[e ?? u.presets.ui].container.ListItem;
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
class he {
|
|
@@ -472,31 +472,31 @@ class he {
|
|
|
472
472
|
}
|
|
473
473
|
getRuntimeNative() {
|
|
474
474
|
var t;
|
|
475
|
-
return (t =
|
|
475
|
+
return (t = u.presets.uiPresets[this.ui]) == null ? void 0 : t.native;
|
|
476
476
|
}
|
|
477
477
|
getRuntimeField(e) {
|
|
478
478
|
var i;
|
|
479
|
-
const t = (i =
|
|
479
|
+
const t = (i = u.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s = b.adapters[u.getUI(this.ui)];
|
|
480
480
|
return (t == null ? void 0 : t.getRuntimeField(e)) ?? (s == null ? void 0 : s.getRuntimeField(e));
|
|
481
481
|
}
|
|
482
482
|
getRuntimeRequired(e) {
|
|
483
483
|
var i;
|
|
484
|
-
const t = (i =
|
|
484
|
+
const t = (i = u.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s = b.adapters[u.getUI(this.ui)];
|
|
485
485
|
return (t == null ? void 0 : t.getRuntimeRequired(e)) ?? (s == null ? void 0 : s.getRuntimeRequired(e));
|
|
486
486
|
}
|
|
487
487
|
getFormModelPropName() {
|
|
488
488
|
var s;
|
|
489
|
-
const e = (s =
|
|
489
|
+
const e = (s = u.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, t = b.adapters[u.getUI(this.ui)];
|
|
490
490
|
return (e == null ? void 0 : e.getFormModelPropName()) ?? (t == null ? void 0 : t.getFormModelPropName());
|
|
491
491
|
}
|
|
492
492
|
formComponentRenderer(e) {
|
|
493
493
|
var i;
|
|
494
|
-
const t = (i =
|
|
494
|
+
const t = (i = u.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s = b.adapters[u.getUI(this.ui)];
|
|
495
495
|
return (t == null ? void 0 : t.formComponentRenderer(e)) ?? (s == null ? void 0 : s.formComponentRenderer(e));
|
|
496
496
|
}
|
|
497
497
|
clearValidate(e) {
|
|
498
498
|
var i;
|
|
499
|
-
const t = (i =
|
|
499
|
+
const t = (i = u.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s = b.adapters[u.getUI(this.ui)];
|
|
500
500
|
return (t == null ? void 0 : t.clearValidate(e)) ?? (s == null ? void 0 : s.clearValidate(e));
|
|
501
501
|
}
|
|
502
502
|
}
|
|
@@ -505,15 +505,15 @@ function pe(r) {
|
|
|
505
505
|
}
|
|
506
506
|
class me {
|
|
507
507
|
constructor(e) {
|
|
508
|
-
a(this, "schemas",
|
|
509
|
-
a(this, "model",
|
|
508
|
+
a(this, "schemas", U([]));
|
|
509
|
+
a(this, "model", U({}));
|
|
510
510
|
a(this, "processorBySchemaType", {
|
|
511
511
|
item: this.runtimeItemProcessor.bind(this),
|
|
512
512
|
group: this.runtimeGroupProcessor.bind(this),
|
|
513
513
|
list: this.runtimeListProcessor.bind(this)
|
|
514
514
|
});
|
|
515
|
-
a(this, "formRef",
|
|
516
|
-
a(this, "hydrateEffect", new
|
|
515
|
+
a(this, "formRef", U(null));
|
|
516
|
+
a(this, "hydrateEffect", new L());
|
|
517
517
|
a(this, "native", oe({}));
|
|
518
518
|
a(this, "grid", {});
|
|
519
519
|
a(this, "runtime", {});
|
|
@@ -524,8 +524,8 @@ class me {
|
|
|
524
524
|
a(this, "shared", {});
|
|
525
525
|
this.setup = e, this.processor = new de(this);
|
|
526
526
|
const t = this.setup(this);
|
|
527
|
-
if (this.ui = t.ui ??
|
|
528
|
-
|
|
527
|
+
if (this.ui = t.ui ?? u.presets.ui, this.runtimeAdapter = new he(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), N(t.schemas))
|
|
528
|
+
P(
|
|
529
529
|
// @ts-expect-error
|
|
530
530
|
() => t.schemas.value,
|
|
531
531
|
() => {
|
|
@@ -536,7 +536,7 @@ class me {
|
|
|
536
536
|
}
|
|
537
537
|
);
|
|
538
538
|
else if (q(t.schemas)) {
|
|
539
|
-
const s =
|
|
539
|
+
const s = P(() => t.schemas, () => {
|
|
540
540
|
this.processor.parseSchemas(t.schemas), E(() => {
|
|
541
541
|
s();
|
|
542
542
|
});
|
|
@@ -553,7 +553,7 @@ class me {
|
|
|
553
553
|
shared: this.shared,
|
|
554
554
|
share: (t) => {
|
|
555
555
|
if (N(t)) {
|
|
556
|
-
const s =
|
|
556
|
+
const s = P(() => t.value, () => {
|
|
557
557
|
h(this.shared, t.value), this.processor.schemaEffect.triggerEffects(), E(() => {
|
|
558
558
|
s();
|
|
559
559
|
});
|
|
@@ -562,7 +562,7 @@ class me {
|
|
|
562
562
|
immediate: !0
|
|
563
563
|
});
|
|
564
564
|
} else if (q(t)) {
|
|
565
|
-
const s =
|
|
565
|
+
const s = P(() => t, () => {
|
|
566
566
|
h(this.shared, t), this.processor.schemaEffect.triggerEffects(), E(() => {
|
|
567
567
|
s();
|
|
568
568
|
});
|
|
@@ -581,20 +581,20 @@ class me {
|
|
|
581
581
|
if (!o)
|
|
582
582
|
return;
|
|
583
583
|
h(this.globalNativeFormOverride.props, (k = (z = e.native) == null ? void 0 : z.props) == null ? void 0 : k.Form), h(this.globalNativeFormOverride.slots, (B = ($ = e.native) == null ? void 0 : $.slots) == null ? void 0 : B.Form);
|
|
584
|
-
const n = h(C((G = (D = this.native) == null ? void 0 : D.slots) == null ? void 0 : G.FormItem) ?? {}, (W = (T = e.native) == null ? void 0 : T.slots) == null ? void 0 : W.FormItem),
|
|
584
|
+
const n = h(C((G = (D = this.native) == null ? void 0 : D.slots) == null ? void 0 : G.FormItem) ?? {}, (W = (T = e.native) == null ? void 0 : T.slots) == null ? void 0 : W.FormItem), f = {
|
|
585
585
|
display: "grid",
|
|
586
586
|
gridColumn: "1 / -1",
|
|
587
587
|
...e.grid
|
|
588
|
-
},
|
|
588
|
+
}, c = h(C((H = (K = this.native) == null ? void 0 : K.props) == null ? void 0 : H.FormItem) ?? {}, (Q = (J = e.native) == null ? void 0 : J.props) == null ? void 0 : Q.FormItem), d = this.runtimeAdapter.getRuntimeField({
|
|
589
589
|
schema: e,
|
|
590
590
|
parentSchema: i,
|
|
591
591
|
index: t
|
|
592
|
-
}), v = o.name, j = e.componentProps ?? {}, I =
|
|
592
|
+
}), v = o.name, j = e.componentProps ?? {}, I = b.placeholderPresetByComponentName;
|
|
593
593
|
let g = e.placeholder, y = e.show;
|
|
594
594
|
y === void 0 && (y = !0), y || delete s[e.field];
|
|
595
595
|
let m = e.label ?? "";
|
|
596
596
|
const V = (i == null ? void 0 : i.runtime) ?? this.runtime;
|
|
597
|
-
if (!l.isUndefined(t) && !l.isObjectEmpty(V) && (m =
|
|
597
|
+
if (!l.isUndefined(t) && !l.isObjectEmpty(V) && (m = x((X = V == null ? void 0 : V.customizeListItemLabel) == null ? void 0 : X.call(V, e.label ?? "", t + 1), "")), !g) {
|
|
598
598
|
let S = "请输入";
|
|
599
599
|
l.isUndefined(v) ? g = `${S}${m}` : /* @ts-expect-error */ I[v.toLowerCase()] ? (S = // @ts-expect-error
|
|
600
600
|
I[v.toLowerCase()], g = `${S}${m}`) : (Object.keys(I).forEach((Y) => {
|
|
@@ -606,12 +606,12 @@ class me {
|
|
|
606
606
|
label: m
|
|
607
607
|
}), A = F.getItemContainer(this), ee = F.getFormItemContainer(this), te = this, se = e.componentSlots;
|
|
608
608
|
return p("div", {
|
|
609
|
-
style:
|
|
609
|
+
style: f
|
|
610
610
|
}, [p(A, {
|
|
611
611
|
show: y
|
|
612
612
|
}, {
|
|
613
613
|
default() {
|
|
614
|
-
return y && p(ee, O(
|
|
614
|
+
return y && p(ee, O(c, {
|
|
615
615
|
label: `${m ? `${m}:` : ""}`
|
|
616
616
|
}, d, Z), {
|
|
617
617
|
default() {
|
|
@@ -673,9 +673,9 @@ class me {
|
|
|
673
673
|
schema: e
|
|
674
674
|
}, {
|
|
675
675
|
default() {
|
|
676
|
-
return s.model.value[e.field].map((
|
|
676
|
+
return s.model.value[e.field].map((f, c) => p(n, null, {
|
|
677
677
|
default() {
|
|
678
|
-
return e.children.map((d) => s.runtimeItemProcessor(d,
|
|
678
|
+
return e.children.map((d) => s.runtimeItemProcessor(d, c, f, e));
|
|
679
679
|
},
|
|
680
680
|
delete({
|
|
681
681
|
container: d
|
|
@@ -683,16 +683,16 @@ class me {
|
|
|
683
683
|
var j;
|
|
684
684
|
const v = d ?? p("button", null, null);
|
|
685
685
|
return ne(p(v, {
|
|
686
|
-
onClick: () => s.deleteListItem(e,
|
|
686
|
+
onClick: () => s.deleteListItem(e, c)
|
|
687
687
|
}, null), [[le, ((j = s.model.value[e.field]) == null ? void 0 : j.length) > 1]]);
|
|
688
688
|
}
|
|
689
689
|
}));
|
|
690
690
|
},
|
|
691
691
|
add({
|
|
692
|
-
container:
|
|
692
|
+
container: f
|
|
693
693
|
} = {}) {
|
|
694
|
-
const
|
|
695
|
-
return p(
|
|
694
|
+
const c = f ?? p("button", null, [ae("添加")]);
|
|
695
|
+
return p(c, {
|
|
696
696
|
onClick: () => s.addListItem(e)
|
|
697
697
|
}, null);
|
|
698
698
|
}
|
|
@@ -702,14 +702,14 @@ class me {
|
|
|
702
702
|
return e.map((t) => (t.type || (t.type = "item"), this.processorBySchemaType[t.type](t)));
|
|
703
703
|
}
|
|
704
704
|
exec() {
|
|
705
|
-
var
|
|
705
|
+
var f, c, d, v;
|
|
706
706
|
const e = {
|
|
707
707
|
display: "grid",
|
|
708
708
|
gridColumn: "1 / -1",
|
|
709
709
|
gridAutoColumns: "1fr",
|
|
710
710
|
...this.grid
|
|
711
711
|
}, t = this, s = h(
|
|
712
|
-
C((
|
|
712
|
+
C((c = (f = this.native) == null ? void 0 : f.props) == null ? void 0 : c.Form) ?? {},
|
|
713
713
|
// @ts-expect-error
|
|
714
714
|
this.globalNativeFormOverride.props.Form
|
|
715
715
|
), i = h(
|
|
@@ -731,10 +731,18 @@ class me {
|
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
|
-
class
|
|
734
|
+
class u {
|
|
735
|
+
static getPreset(e) {
|
|
736
|
+
var t, s, i;
|
|
737
|
+
return (s = (t = this.presets.uiPresets) == null ? void 0 : t[e]) != null && s.extend ? this.presets.uiPresets[(i = this.presets.uiPresets[e]) == null ? void 0 : i.extend] : this.presets.uiPresets[e];
|
|
738
|
+
}
|
|
739
|
+
static getUI(e) {
|
|
740
|
+
var t, s, i;
|
|
741
|
+
return (s = (t = this.presets.uiPresets) == null ? void 0 : t[e]) != null && s.extend ? (i = this.presets.uiPresets[e]) == null ? void 0 : i.extend : e;
|
|
742
|
+
}
|
|
735
743
|
}
|
|
736
|
-
a(
|
|
737
|
-
function
|
|
744
|
+
a(u, "presets");
|
|
745
|
+
function M({
|
|
738
746
|
parentSchema: r,
|
|
739
747
|
schema: e,
|
|
740
748
|
index: t
|
|
@@ -745,7 +753,7 @@ const ye = {
|
|
|
745
753
|
ArcoVue: {
|
|
746
754
|
getRuntimeField(r) {
|
|
747
755
|
return {
|
|
748
|
-
field:
|
|
756
|
+
field: M(r)
|
|
749
757
|
};
|
|
750
758
|
},
|
|
751
759
|
getRuntimeRequired(r) {
|
|
@@ -799,7 +807,7 @@ const ye = {
|
|
|
799
807
|
NutUI: {
|
|
800
808
|
getRuntimeField(r) {
|
|
801
809
|
return {
|
|
802
|
-
prop:
|
|
810
|
+
prop: M(r)
|
|
803
811
|
};
|
|
804
812
|
},
|
|
805
813
|
getRuntimeRequired(r) {
|
|
@@ -859,7 +867,7 @@ const ye = {
|
|
|
859
867
|
NaiveUI: {
|
|
860
868
|
getRuntimeField(r) {
|
|
861
869
|
return {
|
|
862
|
-
path:
|
|
870
|
+
path: M(r)
|
|
863
871
|
};
|
|
864
872
|
},
|
|
865
873
|
getRuntimeRequired(r) {
|
|
@@ -973,9 +981,9 @@ a(w, "schemaPreset", {
|
|
|
973
981
|
}
|
|
974
982
|
}), // 基于基本功能提出基本预设
|
|
975
983
|
a(w, "placeholderPresetByComponentName", w.getPlaceholderPrefixPresetByComponentName());
|
|
976
|
-
let
|
|
977
|
-
const
|
|
978
|
-
...
|
|
984
|
+
let _ = w;
|
|
985
|
+
const b = {
|
|
986
|
+
..._,
|
|
979
987
|
adapters: {
|
|
980
988
|
...ye
|
|
981
989
|
}
|
|
@@ -1003,7 +1011,7 @@ function Ce(r) {
|
|
|
1003
1011
|
];
|
|
1004
1012
|
}
|
|
1005
1013
|
function Ie(r) {
|
|
1006
|
-
|
|
1014
|
+
u.presets = r;
|
|
1007
1015
|
}
|
|
1008
1016
|
function ve(r, e) {
|
|
1009
1017
|
return e === "native" && Object.defineProperty(r, "name", {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { FormPresets } from "../../types";
|
|
1
|
+
import { FormPresets, UIName } from "../../types";
|
|
2
2
|
export default class Context {
|
|
3
3
|
static presets: FormPresets;
|
|
4
|
+
static getPreset(ui: UIName): import("../../types").FormPreset | undefined;
|
|
5
|
+
static getUI(ui: UIName): UIName;
|
|
4
6
|
}
|