react-schema-form 1.0.11 → 1.0.13
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.
|
@@ -6884,13 +6884,12 @@ function UT() {
|
|
|
6884
6884
|
}(Ca, Ca.exports)), Ca.exports;
|
|
6885
6885
|
}
|
|
6886
6886
|
var WT = UT();
|
|
6887
|
-
const HT = /* @__PURE__ */ Ut(WT), ki = new qT({ allErrors: !0 });
|
|
6887
|
+
const HT = /* @__PURE__ */ Ut(WT), ki = new qT({ allErrors: !0, strict: !1, keywords: ["readonly"] });
|
|
6888
6888
|
HT(ki);
|
|
6889
6889
|
const Gu = /* @__PURE__ */ new Map(), YT = (e, t) => {
|
|
6890
6890
|
try {
|
|
6891
6891
|
return t.split(/[.[\]'"]/).filter(Boolean).reduce((r, o) => r && r[o], e);
|
|
6892
|
-
} catch
|
|
6893
|
-
console.log(r);
|
|
6892
|
+
} catch {
|
|
6894
6893
|
return;
|
|
6895
6894
|
}
|
|
6896
6895
|
}, KT = (e, t) => {
|
|
@@ -7168,13 +7167,13 @@ function t1(e, t, r, o) {
|
|
|
7168
7167
|
return l;
|
|
7169
7168
|
}
|
|
7170
7169
|
const Jv = (e, t) => {
|
|
7171
|
-
if (
|
|
7172
|
-
return
|
|
7170
|
+
if (Gu.has(e))
|
|
7171
|
+
return Gu.get(e);
|
|
7173
7172
|
try {
|
|
7174
7173
|
const r = ki.compile(t);
|
|
7175
7174
|
return Gu.set(e, r), r;
|
|
7176
|
-
} catch
|
|
7177
|
-
return
|
|
7175
|
+
} catch {
|
|
7176
|
+
return null;
|
|
7178
7177
|
}
|
|
7179
7178
|
};
|
|
7180
7179
|
function r1(e) {
|
|
@@ -7185,20 +7184,18 @@ function r1(e) {
|
|
|
7185
7184
|
return r.toString(16);
|
|
7186
7185
|
}
|
|
7187
7186
|
const n1 = (e, t) => {
|
|
7188
|
-
e.$schema || (e.$schema = "http://json-schema.org/draft-07/schema#")
|
|
7187
|
+
e.$schema || (e.$schema = "http://json-schema.org/draft-07/schema#");
|
|
7189
7188
|
let r = r1(e);
|
|
7190
7189
|
const o = Jv(r, e);
|
|
7191
|
-
return o ?
|
|
7190
|
+
return o ? o(t === void 0 ? {} : t) ? { valid: !0 } : { valid: !1, error: ki.errorsText(o.errors, {}) } : { valid: !1, error: "Invalid Schema" };
|
|
7192
7191
|
}, o1 = (e, t) => {
|
|
7193
7192
|
if (!e || !e.schema)
|
|
7194
7193
|
return { valid: !0 };
|
|
7195
7194
|
(t === "" || e.type === "number" && (t === null || isNaN(parseFloat(t)))) && (t = void 0);
|
|
7196
|
-
const r = e.key[e.key.length - 1];
|
|
7197
|
-
|
|
7198
|
-
const { schema: o } = e, s = { type: "object", properties: {}, $schema: "http://json-schema.org/draft-07/schema#" }, a = e.key[e.key.length - 1];
|
|
7199
|
-
s.properties[a] = o, e.required && (s.required = [a]), console.log("wrap", s);
|
|
7195
|
+
const r = e.key[e.key.length - 1], { schema: o } = e, s = { type: "object", properties: {}, $schema: "http://json-schema.org/draft-07/schema#" }, a = e.key[e.key.length - 1];
|
|
7196
|
+
s.properties[a] = o, e.required && (s.required = [a]);
|
|
7200
7197
|
const l = Jv(r, s);
|
|
7201
|
-
return l ?
|
|
7198
|
+
return l ? l(t === void 0 ? {} : { [e.key[e.key.length - 1]]: t }) ? { valid: !0 } : { valid: !1, error: ki.errorsText(l.errors, {}) } : { valid: !1, error: "Invalid Schema" };
|
|
7202
7199
|
}, s1 = (e, t) => {
|
|
7203
7200
|
let r;
|
|
7204
7201
|
return Array.isArray(t) ? (t.reduce((o, s) => o && o[s], e), r = t.reduce((o, s) => o && o[s], e)) : r = e[t], r;
|
|
@@ -40367,7 +40364,7 @@ class BV {
|
|
|
40367
40364
|
class zV extends Bt.Component {
|
|
40368
40365
|
constructor(t) {
|
|
40369
40366
|
super(t);
|
|
40370
|
-
const { model: r, form: o, value: s, setDefault: a } = this.props, { key: l } = o, c = (/* @__PURE__ */ new Date()).toISOString()
|
|
40367
|
+
const { model: r, form: o, value: s, setDefault: a } = this.props, { key: l } = o, c = (/* @__PURE__ */ new Date()).toISOString();
|
|
40371
40368
|
a(l, r, o, s || c);
|
|
40372
40369
|
}
|
|
40373
40370
|
render() {
|