@harbor-design/proform 1.1.34 → 1.1.36
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
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var a = (r, e, t) => (
|
|
4
|
-
import { isRef as q, watch as
|
|
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 q, watch as v, isReactive as N, nextTick as I, toRaw as F, ref as M, 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);
|
|
@@ -134,7 +134,7 @@ class fe {
|
|
|
134
134
|
}
|
|
135
135
|
submit() {
|
|
136
136
|
var s;
|
|
137
|
-
const e = (s = f.presets.uiPresets[this.runtimeCore.ui]) == null ? void 0 : s.adapter, t =
|
|
137
|
+
const e = (s = f.presets.uiPresets[this.runtimeCore.ui]) == null ? void 0 : s.adapter, t = P.adapters[this.runtimeCore.ui];
|
|
138
138
|
return (e == null ? void 0 : e.validateForm(this)) ?? (t == null ? void 0 : t.validateForm(this));
|
|
139
139
|
}
|
|
140
140
|
hydrate(e) {
|
|
@@ -145,7 +145,7 @@ class fe {
|
|
|
145
145
|
});
|
|
146
146
|
this.runtimeCore.hydrateEffect.trackEffect(
|
|
147
147
|
() => {
|
|
148
|
-
q(e) ?
|
|
148
|
+
q(e) ? v(
|
|
149
149
|
() => e.value,
|
|
150
150
|
() => {
|
|
151
151
|
h(this.runtimeCore.model.value, e.value);
|
|
@@ -154,7 +154,7 @@ class fe {
|
|
|
154
154
|
deep: !0,
|
|
155
155
|
immediate: !0
|
|
156
156
|
}
|
|
157
|
-
) : N(e) ?
|
|
157
|
+
) : N(e) ? v(
|
|
158
158
|
() => e,
|
|
159
159
|
() => {
|
|
160
160
|
h(this.runtimeCore.model.value, e);
|
|
@@ -172,10 +172,10 @@ class fe {
|
|
|
172
172
|
}
|
|
173
173
|
share(e) {
|
|
174
174
|
if (q(e)) {
|
|
175
|
-
const t =
|
|
175
|
+
const t = v(
|
|
176
176
|
() => e.value,
|
|
177
177
|
() => {
|
|
178
|
-
h(this.runtimeCore.shared, e.value), this.runtimeCore.processor.schemaEffect.triggerEffects(),
|
|
178
|
+
h(this.runtimeCore.shared, e.value), this.runtimeCore.processor.schemaEffect.triggerEffects(), I(() => {
|
|
179
179
|
t();
|
|
180
180
|
});
|
|
181
181
|
},
|
|
@@ -185,10 +185,10 @@ class fe {
|
|
|
185
185
|
}
|
|
186
186
|
);
|
|
187
187
|
} else if (N(e)) {
|
|
188
|
-
const t =
|
|
188
|
+
const t = v(
|
|
189
189
|
() => e,
|
|
190
190
|
() => {
|
|
191
|
-
h(this.runtimeCore.shared, e), this.runtimeCore.processor.schemaEffect.triggerEffects(),
|
|
191
|
+
h(this.runtimeCore.shared, e), this.runtimeCore.processor.schemaEffect.triggerEffects(), I(() => {
|
|
192
192
|
t();
|
|
193
193
|
});
|
|
194
194
|
},
|
|
@@ -225,8 +225,8 @@ class de {
|
|
|
225
225
|
a(this, "getRuntimeMeta");
|
|
226
226
|
a(this, "stableSchemas", []);
|
|
227
227
|
a(this, "stableModel", {});
|
|
228
|
-
a(this, "schemaPreset",
|
|
229
|
-
a(this, "componentPropsPreset",
|
|
228
|
+
a(this, "schemaPreset", P.schemaPreset);
|
|
229
|
+
a(this, "componentPropsPreset", P.componentPropsPreset);
|
|
230
230
|
a(this, "stableUpdaterProcessProgress");
|
|
231
231
|
a(this, "stableUpdaterTimes", 0);
|
|
232
232
|
a(this, "schemaEffect", new _());
|
|
@@ -234,7 +234,7 @@ class de {
|
|
|
234
234
|
a(this, "defaultValueInprogressMap", /* @__PURE__ */ new Map());
|
|
235
235
|
a(this, "baseDefaultValueFunctionsLength");
|
|
236
236
|
a(this, "isModelInitialized", !0);
|
|
237
|
-
this.runtimeCore = e, this.processedSchemas = e.schemas, this.processedModel = e.model, this.getRuntimeMeta = e.getRuntimeMeta.bind(e),
|
|
237
|
+
this.runtimeCore = e, this.processedSchemas = e.schemas, this.processedModel = e.model, this.getRuntimeMeta = e.getRuntimeMeta.bind(e), v(
|
|
238
238
|
() => this.processedModel.value,
|
|
239
239
|
() => {
|
|
240
240
|
this.schemaEffect.triggerEffects();
|
|
@@ -286,7 +286,7 @@ class de {
|
|
|
286
286
|
// 对于稳定初始化更新的抽象
|
|
287
287
|
stableUpdater(e = []) {
|
|
288
288
|
if (e.every(Boolean)) {
|
|
289
|
-
const t =
|
|
289
|
+
const t = F(this.processedSchemas.value);
|
|
290
290
|
!l.isProcessInprogress(t) && l.isObjectEmpty(this.stableModel) && (this.stableUpdaterProcessProgress || (this.stableUpdaterProcessProgress = Array.from({
|
|
291
291
|
length: t.length
|
|
292
292
|
}).fill(!1)), this.stableUpdaterProcessProgress[this.stableUpdaterTimes] = !0, this.stableUpdaterTimes++, this.modelProcessor(t));
|
|
@@ -302,11 +302,11 @@ class de {
|
|
|
302
302
|
const u = c.index, d = c.key, b = c.keyIndex;
|
|
303
303
|
if (l.isUndefined(c.stable))
|
|
304
304
|
return;
|
|
305
|
-
const V = i.parseStable(c.stable),
|
|
305
|
+
const V = i.parseStable(c.stable), E = s == null ? void 0 : s.index, g = s == null ? void 0 : s.key;
|
|
306
306
|
let y = V;
|
|
307
307
|
if (l.isProcessInprogress(y) || (o[b] = !0), s) {
|
|
308
|
-
const m = i.processedSchemas.value[
|
|
309
|
-
m && l.isObject(m) && d !== "component" && (y = h(m, y)), i.processedSchemas.value[
|
|
308
|
+
const m = i.processedSchemas.value[E][g][u][d];
|
|
309
|
+
m && l.isObject(m) && d !== "component" && (y = h(m, y)), i.processedSchemas.value[E][g][u][d] = y, i.stableUpdater(o);
|
|
310
310
|
} else {
|
|
311
311
|
const m = i.processedSchemas.value[u][d];
|
|
312
312
|
m && l.isObject(m) && d !== "component" && (y = h(m, y)), i.processedSchemas.value[u][d] = y, i.stableUpdater(o);
|
|
@@ -351,13 +351,13 @@ class de {
|
|
|
351
351
|
return n(u);
|
|
352
352
|
this.defaultValueInprogressMap.set(t[i], u), !l.isProcessInprogress(u) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
353
353
|
this.defaultValueInprogressMap.values()
|
|
354
|
-
).every((d) => !d.includes("undefined")) ? (n(u), this.defaultValueEffect.clearEffects(),
|
|
354
|
+
).every((d) => !d.includes("undefined")) ? (n(u), this.defaultValueEffect.clearEffects(), I(() => {
|
|
355
355
|
c();
|
|
356
356
|
})) : n(u);
|
|
357
357
|
}) : this.fieldParser(t[i], (u) => {
|
|
358
358
|
this.defaultValueInprogressMap.set(t[i], u), !l.isProcessInprogress(u) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
359
359
|
this.defaultValueInprogressMap.values()
|
|
360
|
-
).every((d) => !d.includes("undefined")) ? (n(u), this.defaultValueEffect.clearEffects(),
|
|
360
|
+
).every((d) => !d.includes("undefined")) ? (n(u), this.defaultValueEffect.clearEffects(), I(() => {
|
|
361
361
|
c();
|
|
362
362
|
})) : n(u);
|
|
363
363
|
});
|
|
@@ -396,7 +396,7 @@ class de {
|
|
|
396
396
|
this.promiseFieldParser(i, t, s);
|
|
397
397
|
}
|
|
398
398
|
else
|
|
399
|
-
q(e) ?
|
|
399
|
+
q(e) ? v(
|
|
400
400
|
() => e.value,
|
|
401
401
|
() => {
|
|
402
402
|
l.isUndefined(e.value) || (s && l.isObject(e.value) && !l.isNativeObject(e.value) ? this.objectParser({
|
|
@@ -408,7 +408,7 @@ class de {
|
|
|
408
408
|
immediate: !0,
|
|
409
409
|
deep: !0
|
|
410
410
|
}
|
|
411
|
-
) : N(e) ?
|
|
411
|
+
) : N(e) ? v(
|
|
412
412
|
() => e,
|
|
413
413
|
() => {
|
|
414
414
|
l.isUndefined(e) || (s && l.isObject(e) && !l.isNativeObject(e) ? this.objectParser({
|
|
@@ -438,7 +438,7 @@ class de {
|
|
|
438
438
|
}), l.isItemSchema(e) && ("defaultValue" in e ? t[e.field] = e.defaultValue : t[e.field] || (t[e.field] = void 0));
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
class
|
|
441
|
+
class w {
|
|
442
442
|
static getFormContainer({ ui: e } = {}) {
|
|
443
443
|
return f.presets.uiPresets[e ?? f.presets.ui].container.Form;
|
|
444
444
|
}
|
|
@@ -458,37 +458,37 @@ class E {
|
|
|
458
458
|
return f.presets.uiPresets[e ?? f.presets.ui].container.ListItem;
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
class
|
|
461
|
+
class he {
|
|
462
462
|
constructor(e) {
|
|
463
463
|
this.ui = e;
|
|
464
464
|
}
|
|
465
465
|
getRuntimeField(e) {
|
|
466
466
|
var i;
|
|
467
|
-
const t = (i = f.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s =
|
|
467
|
+
const t = (i = f.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s = P.adapters[this.ui];
|
|
468
468
|
return (t == null ? void 0 : t.getRuntimeField(e)) ?? (s == null ? void 0 : s.getRuntimeField(e));
|
|
469
469
|
}
|
|
470
470
|
getRuntimeRequired(e) {
|
|
471
471
|
var i;
|
|
472
|
-
const t = (i = f.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s =
|
|
472
|
+
const t = (i = f.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s = P.adapters[this.ui];
|
|
473
473
|
return (t == null ? void 0 : t.getRuntimeRequired(e)) ?? (s == null ? void 0 : s.getRuntimeRequired(e));
|
|
474
474
|
}
|
|
475
475
|
getFormModelPropName() {
|
|
476
476
|
var s;
|
|
477
|
-
const e = (s = f.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, t =
|
|
477
|
+
const e = (s = f.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, t = P.adapters[this.ui];
|
|
478
478
|
return (e == null ? void 0 : e.getFormModelPropName()) ?? (t == null ? void 0 : t.getFormModelPropName());
|
|
479
479
|
}
|
|
480
480
|
formComponentRenderer(e) {
|
|
481
481
|
var i;
|
|
482
|
-
const t = (i = f.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s =
|
|
482
|
+
const t = (i = f.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s = P.adapters[this.ui];
|
|
483
483
|
return (t == null ? void 0 : t.formComponentRenderer(e)) ?? (s == null ? void 0 : s.formComponentRenderer(e));
|
|
484
484
|
}
|
|
485
485
|
clearValidate(e) {
|
|
486
486
|
var i;
|
|
487
|
-
const t = (i = f.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s =
|
|
487
|
+
const t = (i = f.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s = P.adapters[this.ui];
|
|
488
488
|
return (t == null ? void 0 : t.clearValidate(e)) ?? (s == null ? void 0 : s.clearValidate(e));
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function pe(r) {
|
|
492
492
|
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !ue(r);
|
|
493
493
|
}
|
|
494
494
|
class me {
|
|
@@ -502,27 +502,32 @@ class me {
|
|
|
502
502
|
});
|
|
503
503
|
a(this, "formRef", M(null));
|
|
504
504
|
a(this, "hydrateEffect", new _());
|
|
505
|
-
a(this, "native",
|
|
505
|
+
a(this, "native", oe({}));
|
|
506
506
|
a(this, "grid", {});
|
|
507
507
|
a(this, "runtime", {});
|
|
508
508
|
a(this, "globalNativeFormOverride", {
|
|
509
509
|
props: {},
|
|
510
510
|
slots: {}
|
|
511
511
|
});
|
|
512
|
-
a(this, "shared",
|
|
512
|
+
a(this, "shared", {});
|
|
513
513
|
this.setup = e, this.processor = new de(this);
|
|
514
514
|
const t = this.setup(this);
|
|
515
|
-
if (this.ui = t.ui ?? f.presets.ui, this.runtimeAdapter = new
|
|
516
|
-
const s =
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
515
|
+
if (this.ui = t.ui ?? f.presets.ui, this.runtimeAdapter = new he(this.ui), q(t.schemas)) {
|
|
516
|
+
const s = v(
|
|
517
|
+
// @ts-expect-error
|
|
518
|
+
() => t.schemas.value,
|
|
519
|
+
() => {
|
|
520
|
+
this.processor.parseSchemas(t.schemas.value), I(() => {
|
|
521
|
+
s();
|
|
522
|
+
});
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
deep: !0
|
|
526
|
+
}
|
|
527
|
+
);
|
|
523
528
|
} else if (N(t.schemas)) {
|
|
524
|
-
const s =
|
|
525
|
-
this.processor.parseSchemas(t.schemas),
|
|
529
|
+
const s = v(() => t.schemas, () => {
|
|
530
|
+
this.processor.parseSchemas(t.schemas), I(() => {
|
|
526
531
|
s();
|
|
527
532
|
});
|
|
528
533
|
}, {
|
|
@@ -533,14 +538,36 @@ class me {
|
|
|
533
538
|
}
|
|
534
539
|
getRuntimeMeta() {
|
|
535
540
|
return {
|
|
536
|
-
model:
|
|
541
|
+
model: F(C(this.model.value)),
|
|
537
542
|
reactiveModel: this.model.value,
|
|
538
|
-
shared: this.shared
|
|
543
|
+
shared: this.shared,
|
|
544
|
+
share: (t) => {
|
|
545
|
+
if (q(t)) {
|
|
546
|
+
const s = v(() => t.value, () => {
|
|
547
|
+
h(this.shared, t.value), this.processor.schemaEffect.triggerEffects(), I(() => {
|
|
548
|
+
s();
|
|
549
|
+
});
|
|
550
|
+
}, {
|
|
551
|
+
deep: !0,
|
|
552
|
+
immediate: !0
|
|
553
|
+
});
|
|
554
|
+
} else if (N(t)) {
|
|
555
|
+
const s = v(() => t, () => {
|
|
556
|
+
h(this.shared, t), this.processor.schemaEffect.triggerEffects(), I(() => {
|
|
557
|
+
s();
|
|
558
|
+
});
|
|
559
|
+
}, {
|
|
560
|
+
deep: !0,
|
|
561
|
+
immediate: !0
|
|
562
|
+
});
|
|
563
|
+
} else
|
|
564
|
+
h(this.shared, t), this.processor.schemaEffect.triggerEffects();
|
|
565
|
+
}
|
|
539
566
|
};
|
|
540
567
|
}
|
|
541
568
|
runtimeItemProcessor(e, t, s = this.model.value, i) {
|
|
542
569
|
var x, z, $, B, D, G, T, W, K, H, J, Q, X;
|
|
543
|
-
const o =
|
|
570
|
+
const o = F(e.component);
|
|
544
571
|
if (!o)
|
|
545
572
|
return;
|
|
546
573
|
h(this.globalNativeFormOverride.props, (z = (x = e.native) == null ? void 0 : x.props) == null ? void 0 : z.Form), h(this.globalNativeFormOverride.slots, (B = ($ = e.native) == null ? void 0 : $.slots) == null ? void 0 : B.Form);
|
|
@@ -552,38 +579,38 @@ class me {
|
|
|
552
579
|
schema: e,
|
|
553
580
|
parentSchema: i,
|
|
554
581
|
index: t
|
|
555
|
-
}), b = o.name, V = e.componentProps ?? {},
|
|
582
|
+
}), b = o.name, V = e.componentProps ?? {}, E = P.placeholderPresetByComponentName;
|
|
556
583
|
let g = e.placeholder, y = e.show;
|
|
557
584
|
y === void 0 && (y = !0), y || delete s[e.field];
|
|
558
585
|
let m = e.label ?? "";
|
|
559
586
|
const j = (i == null ? void 0 : i.runtime) ?? this.runtime;
|
|
560
587
|
if (!l.isUndefined(t) && !l.isObjectEmpty(j) && (m = L((X = j == null ? void 0 : j.customizeItemLabel) == null ? void 0 : X.call(j, e.label ?? "", t + 1), "")), !g) {
|
|
561
588
|
let R = "请输入";
|
|
562
|
-
l.isUndefined(b) ? g = `${R}${m}` : /* @ts-expect-error */
|
|
563
|
-
|
|
564
|
-
b.toLowerCase().includes(Y.toLowerCase()) && (R =
|
|
589
|
+
l.isUndefined(b) ? g = `${R}${m}` : /* @ts-expect-error */ E[b.toLowerCase()] ? (R = // @ts-expect-error
|
|
590
|
+
E[b.toLowerCase()], g = `${R}${m}`) : (Object.keys(E).forEach((Y) => {
|
|
591
|
+
b.toLowerCase().includes(Y.toLowerCase()) && (R = E[Y]);
|
|
565
592
|
}), g = `${R}${m}`);
|
|
566
593
|
}
|
|
567
|
-
const
|
|
594
|
+
const Z = this.runtimeAdapter.getRuntimeRequired({
|
|
568
595
|
...e,
|
|
569
596
|
label: m
|
|
570
|
-
}),
|
|
597
|
+
}), A = w.getItemContainer(this), ee = w.getFormItemContainer(this), te = this, se = e.componentSlots;
|
|
571
598
|
return p("div", {
|
|
572
599
|
style: c
|
|
573
|
-
}, [p(
|
|
600
|
+
}, [p(A, {
|
|
574
601
|
show: y
|
|
575
602
|
}, {
|
|
576
603
|
default() {
|
|
577
|
-
return y && p(
|
|
604
|
+
return y && p(ee, O(u, {
|
|
578
605
|
label: `${m ? `${m}:` : ""}`
|
|
579
|
-
}, d,
|
|
606
|
+
}, d, Z), {
|
|
580
607
|
default() {
|
|
581
|
-
return
|
|
608
|
+
return te.runtimeAdapter.formComponentRenderer({
|
|
582
609
|
Component: o,
|
|
583
610
|
schema: e,
|
|
584
611
|
baseModel: s,
|
|
585
612
|
placeholder: g,
|
|
586
|
-
componentSlots:
|
|
613
|
+
componentSlots: se,
|
|
587
614
|
props: V
|
|
588
615
|
});
|
|
589
616
|
},
|
|
@@ -598,13 +625,13 @@ class me {
|
|
|
598
625
|
display: "grid",
|
|
599
626
|
gridColumn: "1 / -1",
|
|
600
627
|
...e.grid
|
|
601
|
-
}, i =
|
|
628
|
+
}, i = w.getGroupContainer(this);
|
|
602
629
|
let o = e.show;
|
|
603
630
|
return o === void 0 && (o = !0), p("div", {
|
|
604
631
|
style: s
|
|
605
632
|
}, [o && p(i, {
|
|
606
633
|
schema: e
|
|
607
|
-
},
|
|
634
|
+
}, pe(t = e.children.map((n) => this.runtimeItemProcessor(n))) ? t : {
|
|
608
635
|
default: () => [t]
|
|
609
636
|
})]);
|
|
610
637
|
}
|
|
@@ -629,7 +656,7 @@ class me {
|
|
|
629
656
|
s.model.value[e.field] || (s.model.value[e.field] = [{}]);
|
|
630
657
|
let i = e.show;
|
|
631
658
|
i === void 0 && (i = !0);
|
|
632
|
-
const o =
|
|
659
|
+
const o = w.getListContainer(this), n = w.getListItemContainer(this);
|
|
633
660
|
return p("div", {
|
|
634
661
|
style: t
|
|
635
662
|
}, [i && p(o, {
|
|
@@ -671,7 +698,7 @@ class me {
|
|
|
671
698
|
gridColumn: "1 / -1",
|
|
672
699
|
gridAutoColumns: "1fr",
|
|
673
700
|
...this.grid
|
|
674
|
-
}, t = this, s = h(C((u = (c = this.native) == null ? void 0 : c.props) == null ? void 0 : u.Form) ?? {}, this.globalNativeFormOverride.props), i = h(C((b = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : b.Form) ?? {}, this.globalNativeFormOverride.slots), o =
|
|
701
|
+
}, t = this, s = h(C((u = (c = this.native) == null ? void 0 : c.props) == null ? void 0 : u.Form) ?? {}, this.globalNativeFormOverride.props), i = h(C((b = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : b.Form) ?? {}, this.globalNativeFormOverride.slots), o = w.getFormContainer(this), n = this.runtimeAdapter.getFormModelPropName();
|
|
675
702
|
return p(o, O(s, {
|
|
676
703
|
ref: this.formRef
|
|
677
704
|
}, {
|
|
@@ -744,7 +771,7 @@ const ye = {
|
|
|
744
771
|
},
|
|
745
772
|
validateForm(r) {
|
|
746
773
|
return new Promise((e, t) => {
|
|
747
|
-
r.runtimeCore.formRef.value.validate((s) => s ? t(s) : e(r.cleanFallbackFields(
|
|
774
|
+
r.runtimeCore.formRef.value.validate((s) => s ? t(s) : e(r.cleanFallbackFields(F(r.runtimeCore.processor.processedModel.value))));
|
|
748
775
|
});
|
|
749
776
|
},
|
|
750
777
|
clearValidate(r) {
|
|
@@ -803,7 +830,7 @@ const ye = {
|
|
|
803
830
|
valid: s,
|
|
804
831
|
errors: i
|
|
805
832
|
}) => {
|
|
806
|
-
s ? e(r.cleanFallbackFields(
|
|
833
|
+
s ? e(r.cleanFallbackFields(F(r.runtimeCore.processor.processedModel.value))) : t(i);
|
|
807
834
|
});
|
|
808
835
|
});
|
|
809
836
|
},
|
|
@@ -859,14 +886,14 @@ const ye = {
|
|
|
859
886
|
},
|
|
860
887
|
validateForm(r) {
|
|
861
888
|
return new Promise((e, t) => {
|
|
862
|
-
r.runtimeCore.formRef.value.validate((s) => s ? t(s) : e(r.cleanFallbackFields(
|
|
889
|
+
r.runtimeCore.formRef.value.validate((s) => s ? t(s) : e(r.cleanFallbackFields(F(r.runtimeCore.processor.processedModel.value))));
|
|
863
890
|
});
|
|
864
891
|
},
|
|
865
892
|
clearValidate(r) {
|
|
866
893
|
r.formRef.value.restoreValidation();
|
|
867
894
|
}
|
|
868
895
|
}
|
|
869
|
-
},
|
|
896
|
+
}, S = class S {
|
|
870
897
|
static getPlaceholderPrefixPresetByComponentName() {
|
|
871
898
|
const e = {
|
|
872
899
|
请选择: ["select", "tree"],
|
|
@@ -879,7 +906,7 @@ const ye = {
|
|
|
879
906
|
return t;
|
|
880
907
|
}
|
|
881
908
|
};
|
|
882
|
-
a(
|
|
909
|
+
a(S, "schemaPreset", {
|
|
883
910
|
type: {
|
|
884
911
|
defaultValue: "item"
|
|
885
912
|
},
|
|
@@ -922,14 +949,14 @@ a(w, "schemaPreset", {
|
|
|
922
949
|
grid: {
|
|
923
950
|
default: void 0
|
|
924
951
|
}
|
|
925
|
-
}), a(
|
|
952
|
+
}), a(S, "componentPropsPreset", {
|
|
926
953
|
options: {
|
|
927
954
|
defaultValue: []
|
|
928
955
|
}
|
|
929
956
|
}), // 基于基本功能提出基本预设
|
|
930
|
-
a(
|
|
931
|
-
let k =
|
|
932
|
-
const
|
|
957
|
+
a(S, "placeholderPresetByComponentName", S.getPlaceholderPrefixPresetByComponentName());
|
|
958
|
+
let k = S;
|
|
959
|
+
const P = {
|
|
933
960
|
...k,
|
|
934
961
|
adapters: {
|
|
935
962
|
...ye
|
|
@@ -966,16 +993,16 @@ function be(r, e) {
|
|
|
966
993
|
writable: !0
|
|
967
994
|
}), r;
|
|
968
995
|
}
|
|
969
|
-
function
|
|
996
|
+
function Ee(r) {
|
|
970
997
|
return be(r, "native");
|
|
971
998
|
}
|
|
972
|
-
function
|
|
999
|
+
function Ve(r) {
|
|
973
1000
|
return r.__proform_raw_object = !0, r;
|
|
974
1001
|
}
|
|
975
1002
|
export {
|
|
976
1003
|
ge as ProForm,
|
|
977
|
-
|
|
978
|
-
|
|
1004
|
+
Ee as markNativeFunction,
|
|
1005
|
+
Ve as markNativeObject,
|
|
979
1006
|
Ce as useForm,
|
|
980
1007
|
Ie as useFormPresetConfigurer,
|
|
981
1008
|
be as useModifiers
|
|
@@ -26,6 +26,7 @@ export default class RuntimeCore {
|
|
|
26
26
|
model: AnyObject;
|
|
27
27
|
reactiveModel: AnyObject;
|
|
28
28
|
shared: AnyObject;
|
|
29
|
+
share: (data: AnyObject) => void;
|
|
29
30
|
};
|
|
30
31
|
runtimeItemProcessor(schema: ItemSchema, index?: number, baseModel?: AnyObject, parentSchema?: ListSchema): JSX.Element | undefined;
|
|
31
32
|
runtimeGroupProcessor(schema: GroupSchema): JSX.Element;
|
|
@@ -89,6 +89,7 @@ export interface runtimeMeta {
|
|
|
89
89
|
model: AnyObject;
|
|
90
90
|
reactiveModel: AnyObject;
|
|
91
91
|
shared: AnyObject;
|
|
92
|
+
share: (data: AnyObject) => any;
|
|
92
93
|
}
|
|
93
94
|
export type ProFormProxyRule<T> = T | ((runtimeMeta: runtimeMeta) => T) | ((runtimeMeta: runtimeMeta) => Promise<T>);
|
|
94
95
|
export type ProFormProxy<T> = {
|