@ukhomeoffice/cop-react-form-renderer 8.0.4 → 8.0.6-alpha
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 +3 -3
- package/dist/index.js +131 -131
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1148,10 +1148,10 @@ function $t(e, t, n) {
|
|
|
1148
1148
|
if (h.endsWith(A, "{}"))
|
|
1149
1149
|
A = r ? A : A.slice(0, -2), p = JSON.stringify(p);
|
|
1150
1150
|
else if (h.isArray(p) && oa(p) || (h.isFileList(p) || h.endsWith(A, "[]")) && (R = h.toArray(p)))
|
|
1151
|
-
return A = cs(A), R.forEach(function(g,
|
|
1151
|
+
return A = cs(A), R.forEach(function(g, _) {
|
|
1152
1152
|
!(h.isUndefined(g) || g === null) && t.append(
|
|
1153
1153
|
// eslint-disable-next-line no-nested-ternary
|
|
1154
|
-
i === !0 ? Wt([A],
|
|
1154
|
+
i === !0 ? Wt([A], _, o) : i === null ? A : A + "[]",
|
|
1155
1155
|
u(g)
|
|
1156
1156
|
);
|
|
1157
1157
|
}), !1;
|
|
@@ -1695,7 +1695,7 @@ const Na = typeof XMLHttpRequest < "u", Da = Na && function(e) {
|
|
|
1695
1695
|
return;
|
|
1696
1696
|
const C = fe.from(
|
|
1697
1697
|
"getAllResponseHeaders" in A && A.getAllResponseHeaders()
|
|
1698
|
-
),
|
|
1698
|
+
), _ = {
|
|
1699
1699
|
data: !l || l === "text" || l === "json" ? A.responseText : A.response,
|
|
1700
1700
|
status: A.status,
|
|
1701
1701
|
statusText: A.statusText,
|
|
@@ -1710,7 +1710,7 @@ const Na = typeof XMLHttpRequest < "u", Da = Na && function(e) {
|
|
|
1710
1710
|
function(S) {
|
|
1711
1711
|
r(S), p();
|
|
1712
1712
|
},
|
|
1713
|
-
|
|
1713
|
+
_
|
|
1714
1714
|
), A = null;
|
|
1715
1715
|
}
|
|
1716
1716
|
"onloadend" in A ? A.onloadend = T : A.onreadystatechange = function() {
|
|
@@ -1718,21 +1718,21 @@ const Na = typeof XMLHttpRequest < "u", Da = Na && function(e) {
|
|
|
1718
1718
|
}, A.onabort = function() {
|
|
1719
1719
|
A && (r(new D("Request aborted", D.ECONNABORTED, e, A)), p(), A = null);
|
|
1720
1720
|
}, A.onerror = function(g) {
|
|
1721
|
-
const
|
|
1721
|
+
const _ = g && g.message ? g.message : "Network Error", U = new D(_, D.ERR_NETWORK, e, A);
|
|
1722
1722
|
U.event = g || null, r(U), p(), A = null;
|
|
1723
1723
|
}, A.ontimeout = function() {
|
|
1724
1724
|
let g = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1725
|
-
const
|
|
1725
|
+
const _ = s.transitional || On;
|
|
1726
1726
|
s.timeoutErrorMessage && (g = s.timeoutErrorMessage), r(
|
|
1727
1727
|
new D(
|
|
1728
1728
|
g,
|
|
1729
|
-
|
|
1729
|
+
_.clarifyTimeoutError ? D.ETIMEDOUT : D.ECONNABORTED,
|
|
1730
1730
|
e,
|
|
1731
1731
|
A
|
|
1732
1732
|
)
|
|
1733
1733
|
), p(), A = null;
|
|
1734
|
-
}, o === void 0 && i.setContentType(null), "setRequestHeader" in A && h.forEach(ls(i), function(g,
|
|
1735
|
-
A.setRequestHeader(
|
|
1734
|
+
}, o === void 0 && i.setContentType(null), "setRequestHeader" in A && h.forEach(ls(i), function(g, _) {
|
|
1735
|
+
A.setRequestHeader(_, g);
|
|
1736
1736
|
}), h.isUndefined(s.withCredentials) || (A.withCredentials = !!s.withCredentials), l && l !== "json" && (A.responseType = s.responseType), c && ([d, y] = Ot(c, !0), A.addEventListener("progress", d)), a && A.upload && ([f, E] = Ot(a), A.upload.addEventListener("progress", f), A.upload.addEventListener("loadend", E)), (s.cancelToken || s.signal) && (u = (C) => {
|
|
1737
1737
|
A && (r(!C || C.type ? new ut(null, e, A) : C), A.abort(), p(), A = null);
|
|
1738
1738
|
}, s.cancelToken && s.cancelToken.subscribe(u), s.signal && (s.signal.aborted ? u() : s.signal.addEventListener("abort", u)));
|
|
@@ -1957,13 +1957,13 @@ const Nn = "1.17.0", rr = 64 * 1024, { isFunction: yt } = h, ka = (e) => encodeU
|
|
|
1957
1957
|
url: R,
|
|
1958
1958
|
method: C,
|
|
1959
1959
|
data: g,
|
|
1960
|
-
signal:
|
|
1960
|
+
signal: _,
|
|
1961
1961
|
cancelToken: U,
|
|
1962
1962
|
timeout: S,
|
|
1963
1963
|
onDownloadProgress: N,
|
|
1964
1964
|
onUploadProgress: L,
|
|
1965
1965
|
responseType: F,
|
|
1966
|
-
headers:
|
|
1966
|
+
headers: I,
|
|
1967
1967
|
withCredentials: B = "same-origin",
|
|
1968
1968
|
fetchOptions: O,
|
|
1969
1969
|
maxContentLength: P,
|
|
@@ -1973,7 +1973,7 @@ const Nn = "1.17.0", rr = 64 * 1024, { isFunction: yt } = h, ka = (e) => encodeU
|
|
|
1973
1973
|
let K = s || fetch;
|
|
1974
1974
|
F = F ? (F + "").toLowerCase() : "text";
|
|
1975
1975
|
let q = La(
|
|
1976
|
-
[
|
|
1976
|
+
[_, U && U.toAbortSignal()],
|
|
1977
1977
|
S
|
|
1978
1978
|
), X = null;
|
|
1979
1979
|
const me = q && q.unsubscribe && (() => {
|
|
@@ -2001,7 +2001,7 @@ const Nn = "1.17.0", rr = 64 * 1024, { isFunction: yt } = h, ka = (e) => encodeU
|
|
|
2001
2001
|
}
|
|
2002
2002
|
(M.username || M.password) && (M.username = "", M.password = "", R = M.href);
|
|
2003
2003
|
}
|
|
2004
|
-
if (V && (
|
|
2004
|
+
if (V && (I.delete("authorization"), I.set(
|
|
2005
2005
|
"Authorization",
|
|
2006
2006
|
"Basic " + btoa(ka((V.username || "") + ":" + (V.password || "")))
|
|
2007
2007
|
)), H && typeof R == "string" && R.startsWith("data:") && Ua(R) > P)
|
|
@@ -2012,7 +2012,7 @@ const Nn = "1.17.0", rr = 64 * 1024, { isFunction: yt } = h, ka = (e) => encodeU
|
|
|
2012
2012
|
X
|
|
2013
2013
|
);
|
|
2014
2014
|
if (G && C !== "get" && C !== "head") {
|
|
2015
|
-
const M = await A(
|
|
2015
|
+
const M = await A(I, g);
|
|
2016
2016
|
if (typeof M == "number" && isFinite(M) && M > x)
|
|
2017
2017
|
throw new D(
|
|
2018
2018
|
"Request body larger than maxBodyLength limit",
|
|
@@ -2021,13 +2021,13 @@ const Nn = "1.17.0", rr = 64 * 1024, { isFunction: yt } = h, ka = (e) => encodeU
|
|
|
2021
2021
|
X
|
|
2022
2022
|
);
|
|
2023
2023
|
}
|
|
2024
|
-
if (L && d && C !== "get" && C !== "head" && (Ae = await A(
|
|
2024
|
+
if (L && d && C !== "get" && C !== "head" && (Ae = await A(I, g)) !== 0) {
|
|
2025
2025
|
let M = new o(R, {
|
|
2026
2026
|
method: "POST",
|
|
2027
2027
|
body: g,
|
|
2028
2028
|
duplex: "half"
|
|
2029
2029
|
}), le;
|
|
2030
|
-
if (h.isFormData(g) && (le = M.headers.get("content-type")) &&
|
|
2030
|
+
if (h.isFormData(g) && (le = M.headers.get("content-type")) && I.setContentType(le), M.body) {
|
|
2031
2031
|
const [Ie, $e] = Zn(
|
|
2032
2032
|
Ae,
|
|
2033
2033
|
Ot(er(L))
|
|
@@ -2038,15 +2038,15 @@ const Nn = "1.17.0", rr = 64 * 1024, { isFunction: yt } = h, ka = (e) => encodeU
|
|
|
2038
2038
|
h.isString(B) || (B = B ? "include" : "omit");
|
|
2039
2039
|
const Qe = a && "credentials" in o.prototype;
|
|
2040
2040
|
if (h.isFormData(g)) {
|
|
2041
|
-
const M =
|
|
2042
|
-
M && /^multipart\/form-data/i.test(M) && !/boundary=/i.test(M) &&
|
|
2041
|
+
const M = I.getContentType();
|
|
2042
|
+
M && /^multipart\/form-data/i.test(M) && !/boundary=/i.test(M) && I.delete("content-type");
|
|
2043
2043
|
}
|
|
2044
|
-
|
|
2044
|
+
I.set("User-Agent", "axios/" + Nn, !1);
|
|
2045
2045
|
const Ze = {
|
|
2046
2046
|
...O,
|
|
2047
2047
|
signal: q,
|
|
2048
2048
|
method: C.toUpperCase(),
|
|
2049
|
-
headers: ls(
|
|
2049
|
+
headers: ls(I.normalize()),
|
|
2050
2050
|
body: g,
|
|
2051
2051
|
duplex: "half",
|
|
2052
2052
|
credentials: Qe ? B : void 0
|
|
@@ -3003,45 +3003,45 @@ const {
|
|
|
3003
3003
|
}, []), z(() => {
|
|
3004
3004
|
R && g && p.page(e);
|
|
3005
3005
|
}, [f, R]);
|
|
3006
|
-
const
|
|
3007
|
-
const B = e, { value: O } =
|
|
3008
|
-
O ? (B.formData[
|
|
3006
|
+
const _ = ({ target: I }) => {
|
|
3007
|
+
const B = e, { value: O } = I;
|
|
3008
|
+
O ? (B.formData[I.name] = O, E((P) => ({
|
|
3009
3009
|
...P,
|
|
3010
3010
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- FIXME
|
|
3011
|
-
[
|
|
3011
|
+
[I.name]: O
|
|
3012
3012
|
})), T((P) => ({
|
|
3013
3013
|
...P,
|
|
3014
3014
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- FIXME
|
|
3015
|
-
[
|
|
3016
|
-
}))) : (delete B.formData[
|
|
3017
|
-
const { [
|
|
3015
|
+
[I.component]: I.label
|
|
3016
|
+
}))) : (delete B.formData[I.name], E((P) => {
|
|
3017
|
+
const { [I.name]: x, ...H } = P;
|
|
3018
3018
|
return H;
|
|
3019
3019
|
}), T((P) => {
|
|
3020
|
-
const { [
|
|
3020
|
+
const { [I.component]: x, ...H } = P;
|
|
3021
3021
|
return H;
|
|
3022
3022
|
})), typeof o == "function" && o(e.formData);
|
|
3023
3023
|
};
|
|
3024
3024
|
z(() => {
|
|
3025
|
-
const
|
|
3026
|
-
document.title = y.length > 0 ? "Error: " +
|
|
3025
|
+
const I = document.title.replace("Error: ", "");
|
|
3026
|
+
document.title = y.length > 0 ? "Error: " + I : I;
|
|
3027
3027
|
}, [y]);
|
|
3028
3028
|
const U = b.classBuilder(l, a, c), S = e;
|
|
3029
3029
|
S.actions = S.actions?.map(
|
|
3030
|
-
(
|
|
3030
|
+
(I) => (
|
|
3031
3031
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access -- FIXME
|
|
3032
|
-
|
|
3032
|
+
I.label ? { ...I, label: b.interpolateString(I.label, S.formData) } : I
|
|
3033
3033
|
)
|
|
3034
|
-
), S.formData = b.Operate.runPageOperations(S, { ...S.formData, ...d }, r ||
|
|
3034
|
+
), S.formData = b.Operate.runPageOperations(S, { ...S.formData, ...d }, r || _);
|
|
3035
3035
|
const N = e.title ? /* @__PURE__ */ m(vt, { size: e.titleSize, children: b.FormPage.getTitle(e.title, e.formData) }) : /* @__PURE__ */ m(nn, { id: e.id, required: e.required, hideOptionalSuffix: e.hideOptionalSuffix, children: e.label }), L = (
|
|
3036
3036
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access -- FIXME
|
|
3037
|
-
e.components.filter((
|
|
3037
|
+
e.components.filter((I) => b.Component.show(I, e.formData)).map((I, B) => /* @__PURE__ */ m(
|
|
3038
3038
|
dt,
|
|
3039
3039
|
{
|
|
3040
|
-
component:
|
|
3040
|
+
component: I,
|
|
3041
3041
|
onAction: (O) => n(O, d, A),
|
|
3042
|
-
onChange: r ||
|
|
3043
|
-
onTopLevelChange: s ||
|
|
3044
|
-
value: e.formData[
|
|
3042
|
+
onChange: r || _,
|
|
3043
|
+
onTopLevelChange: s || _,
|
|
3044
|
+
value: e.formData[I.fieldId] || d[I.fieldId],
|
|
3045
3045
|
formData: e.formData,
|
|
3046
3046
|
pages: t,
|
|
3047
3047
|
submitting: u
|
|
@@ -3063,8 +3063,8 @@ const {
|
|
|
3063
3063
|
/* @__PURE__ */ m(
|
|
3064
3064
|
ws,
|
|
3065
3065
|
{
|
|
3066
|
-
actions: e.actions?.filter((
|
|
3067
|
-
onAction: (
|
|
3066
|
+
actions: e.actions?.filter((I) => b.Component.show(I, e.formData)),
|
|
3067
|
+
onAction: (I) => n(I, d, A)
|
|
3068
3068
|
}
|
|
3069
3069
|
)
|
|
3070
3070
|
] }, e.id);
|
|
@@ -3365,7 +3365,7 @@ const {
|
|
|
3365
3365
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- FIXME
|
|
3366
3366
|
gc(t, o, e.id, l, a),
|
|
3367
3367
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FIXME
|
|
3368
|
-
...Je(e, c, o, r, s)
|
|
3368
|
+
...Je(e, c, o, r, s) ?? []
|
|
3369
3369
|
];
|
|
3370
3370
|
}).filter((o) => !!o) : Cc(e, r), bc = "hods-form-summary-card-details", Ds = ({
|
|
3371
3371
|
masterPage: e,
|
|
@@ -3388,25 +3388,25 @@ const {
|
|
|
3388
3388
|
let E = 0;
|
|
3389
3389
|
return u.flatMap((y, p) => {
|
|
3390
3390
|
let A = 0;
|
|
3391
|
-
const T = y.fields?.flatMap((C) => f.filter((
|
|
3392
|
-
if (!
|
|
3391
|
+
const T = y.fields?.flatMap((C) => f.filter((_) => _.fieldId === C).map((_) => {
|
|
3392
|
+
if (!_ || !Ne(_, { ...d.formData, ...r }))
|
|
3393
3393
|
return null;
|
|
3394
|
-
if (
|
|
3395
|
-
const U = Je(d,
|
|
3394
|
+
if (_.type === w.CONTAINER) {
|
|
3395
|
+
const U = Je(d, _, r);
|
|
3396
3396
|
return A += 1, // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FIXME
|
|
3397
3397
|
/* @__PURE__ */ m("div", { className: l("field"), style: { "--column": E + 1, "--row": A }, role: "list", children: U.map((S) => {
|
|
3398
|
-
const N = { ...r, [S.fieldId]: r[
|
|
3398
|
+
const N = { ...r, [S.fieldId]: r[_.fieldId]?.[S.fieldId] };
|
|
3399
3399
|
return Pt(d, { ...S, label: S.key }, l, N, i);
|
|
3400
3400
|
}) }, C);
|
|
3401
3401
|
}
|
|
3402
|
-
if (
|
|
3403
|
-
const U = Mn({ ...d, formData: { ...d.formData, ...r } },
|
|
3402
|
+
if (_.type === w.COLLECTION) {
|
|
3403
|
+
const U = Mn({ ...d, formData: { ...d.formData, ...r } }, _, r[_.id]);
|
|
3404
3404
|
A += 1;
|
|
3405
3405
|
let S = 0;
|
|
3406
3406
|
return (
|
|
3407
3407
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FIXME
|
|
3408
3408
|
/* @__PURE__ */ m("div", { className: l("field"), style: { "--column": E + 1, "--row": A }, role: "list", children: U.map((N) => {
|
|
3409
|
-
const L = { ...r, [N.fieldId]: r[
|
|
3409
|
+
const L = { ...r, [N.fieldId]: r[_.fieldId]?.[N.fieldId] }, F = Pt(d, { ...N, label: N.key }, l, L, i);
|
|
3410
3410
|
return N.type === "title" && (S += 1, S > 1) ? (
|
|
3411
3411
|
// eslint-disable-next-line react-x/no-missing-key -- FIXME
|
|
3412
3412
|
/* @__PURE__ */ m("div", { style: { marginTop: "40px" }, children: F })
|
|
@@ -3415,7 +3415,7 @@ const {
|
|
|
3415
3415
|
);
|
|
3416
3416
|
}
|
|
3417
3417
|
return A += 1, // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FIXME
|
|
3418
|
-
/* @__PURE__ */ m("div", { className: l("field"), style: { "--column": E + 1, "--row": A }, role: "list", children: Pt(d,
|
|
3418
|
+
/* @__PURE__ */ m("div", { className: l("field"), style: { "--column": E + 1, "--row": A }, role: "list", children: Pt(d, _, l, r, i) }, C);
|
|
3419
3419
|
})).filter((C) => !!C);
|
|
3420
3420
|
return !(p === u.length - 1) && T.length !== 0 ? (E += 2, [
|
|
3421
3421
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FIXME
|
|
@@ -3492,7 +3492,7 @@ const {
|
|
|
3492
3492
|
n.quickEdit ? dc(f, u, t) : null
|
|
3493
3493
|
),
|
|
3494
3494
|
[f, n, u, t, E]
|
|
3495
|
-
), { addErrors: T, resetQuickEditErrors: R, clearTopLevelErrorsForCard: C, validate: g } = ze(), { hooks:
|
|
3495
|
+
), { addErrors: T, resetQuickEditErrors: R, clearTopLevelErrorsForCard: C, validate: g } = ze(), { hooks: _ } = De(), U = async (S, N) => {
|
|
3496
3496
|
if (S.type === "cancel" && (y((L) => !L), R?.()), S.type === "save" && typeof l == "function") {
|
|
3497
3497
|
const L = {
|
|
3498
3498
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- FIXME
|
|
@@ -3506,18 +3506,18 @@ const {
|
|
|
3506
3506
|
});
|
|
3507
3507
|
if (F.length)
|
|
3508
3508
|
return;
|
|
3509
|
-
let
|
|
3510
|
-
await
|
|
3509
|
+
let I;
|
|
3510
|
+
await _.onSubmit(
|
|
3511
3511
|
"quickEdit",
|
|
3512
3512
|
L,
|
|
3513
3513
|
() => {
|
|
3514
3514
|
},
|
|
3515
3515
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FIXME
|
|
3516
3516
|
(O) => {
|
|
3517
|
-
|
|
3517
|
+
I = O;
|
|
3518
3518
|
}
|
|
3519
|
-
),
|
|
3520
|
-
const B = F.concat(
|
|
3519
|
+
), I && T(I);
|
|
3520
|
+
const B = F.concat(I);
|
|
3521
3521
|
if (B.length === 0 || B.length === 1 && B[0] === void 0) {
|
|
3522
3522
|
C();
|
|
3523
3523
|
const O = b.CollectionPage.getData(a, u), { isDuplicate: P, ...x } = O[t.index];
|
|
@@ -3658,16 +3658,16 @@ const {
|
|
|
3658
3658
|
() => {
|
|
3659
3659
|
const N = e.collectionName.split(".");
|
|
3660
3660
|
let L = b.CollectionPage.mergePages(o || []) || [];
|
|
3661
|
-
return N.reduce((F,
|
|
3662
|
-
const O = B === 0 ? `${F}${
|
|
3661
|
+
return N.reduce((F, I, B) => {
|
|
3662
|
+
const O = B === 0 ? `${F}${I}` : `${F}.${I}`;
|
|
3663
3663
|
return B === N.length - 1 ? L?.find((P) => P.collection?.name === O) || null : (L = L.find((P) => P.collection?.name === O)?.childPages || null, O);
|
|
3664
3664
|
}, "");
|
|
3665
3665
|
},
|
|
3666
3666
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- FIXME
|
|
3667
3667
|
[o]
|
|
3668
3668
|
), R = He(() => e.card.listView ? T.childPages?.reduce((L, F) => {
|
|
3669
|
-
const
|
|
3670
|
-
return L.concat(
|
|
3669
|
+
const I = it(F.components, { ...t, ...E });
|
|
3670
|
+
return L.concat(I);
|
|
3671
3671
|
}, []) || [] : [], [T, t, E, e.card.listView]), C = () => {
|
|
3672
3672
|
u.length > 0 && d((L) => L.raisedBy === e.id);
|
|
3673
3673
|
const N = vn(e, T, t, i);
|
|
@@ -3678,8 +3678,8 @@ const {
|
|
|
3678
3678
|
}, [p]);
|
|
3679
3679
|
const g = (N, L) => {
|
|
3680
3680
|
if (typeof n == "function") {
|
|
3681
|
-
const F = [...p],
|
|
3682
|
-
F[
|
|
3681
|
+
const F = [...p], I = p.findIndex((P) => P.id === L), { isDuplicate: B, ...O } = p[I];
|
|
3682
|
+
F[I] = { ...O }, n({
|
|
3683
3683
|
type: gt.SAVE_AND_NAVIGATE,
|
|
3684
3684
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FIXME
|
|
3685
3685
|
page: N,
|
|
@@ -3697,7 +3697,7 @@ const {
|
|
|
3697
3697
|
]
|
|
3698
3698
|
});
|
|
3699
3699
|
}
|
|
3700
|
-
},
|
|
3700
|
+
}, _ = (N) => {
|
|
3701
3701
|
b.CollectionPage.duplicateEntry(
|
|
3702
3702
|
e.collectionName,
|
|
3703
3703
|
t,
|
|
@@ -3727,7 +3727,7 @@ const {
|
|
|
3727
3727
|
}
|
|
3728
3728
|
}), y(null), C();
|
|
3729
3729
|
}, S = (N) => {
|
|
3730
|
-
const L = R.find((
|
|
3730
|
+
const L = R.find((I) => I.fieldId === N);
|
|
3731
3731
|
if (!L) return null;
|
|
3732
3732
|
const F = qt({ ...T, formData: { ...t, ...E } }, L);
|
|
3733
3733
|
return (
|
|
@@ -3780,7 +3780,7 @@ const {
|
|
|
3780
3780
|
}
|
|
3781
3781
|
),
|
|
3782
3782
|
/* @__PURE__ */ m("ul", { className: "collection-summary-card-list", children: p.map((N, L) => {
|
|
3783
|
-
const F = l.filter((O) => O.entryId === N.id).length > 0,
|
|
3783
|
+
const F = l.filter((O) => O.entryId === N.id).length > 0, I = {
|
|
3784
3784
|
...e.card,
|
|
3785
3785
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- FIXME
|
|
3786
3786
|
...N.isDuplicate && e.duplicatedCard ? e.duplicatedCard : {},
|
|
@@ -3805,9 +3805,9 @@ const {
|
|
|
3805
3805
|
id: B,
|
|
3806
3806
|
entryData: { ...N, index: L },
|
|
3807
3807
|
masterPage: T,
|
|
3808
|
-
config:
|
|
3808
|
+
config: I || {},
|
|
3809
3809
|
onFullEdit: g,
|
|
3810
|
-
onDuplicate:
|
|
3810
|
+
onDuplicate: _,
|
|
3811
3811
|
onDelete: () => y({ ...N, index: L }),
|
|
3812
3812
|
onQuickEdit: (O) => (C(), r(O)),
|
|
3813
3813
|
parentCollectionName: e.collectionName.split(".").shift(),
|
|
@@ -3889,13 +3889,13 @@ const {
|
|
|
3889
3889
|
return /* @__PURE__ */ k("div", { className: y(), id: e.id, children: [
|
|
3890
3890
|
e.label && /* @__PURE__ */ m(nn, { id: e.id, required: e.required, className: y("title"), children: e.label }),
|
|
3891
3891
|
Array.isArray(i) && i.map((p, A) => {
|
|
3892
|
-
const T = `${e.full_path || e.fieldId}[${A}]`, R = (e.countOffset || 0) + A + 1, C = b.interpolateString(E.item, { ...p, index: R }), g = b.interpolateString(E.remove, { ...p, index: R }),
|
|
3892
|
+
const T = `${e.full_path || e.fieldId}[${A}]`, R = (e.countOffset || 0) + A + 1, C = b.interpolateString(E.item, { ...p, index: R }), g = b.interpolateString(E.remove, { ...p, index: R }), _ = e.disableAddAndRemove || A === 0 && e.minimumEntries ? "" : e.removeLocation ?? "start", U = A !== 0 && e.subsequentItemStyle ? e.subsequentItemStyle : {};
|
|
3893
3893
|
return (
|
|
3894
3894
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FIXME
|
|
3895
3895
|
/* @__PURE__ */ k("div", { className: `${y("item")}`, style: U, children: [
|
|
3896
3896
|
/* @__PURE__ */ k(nn, { id: p.id, required: !0, className: y("item-title"), children: [
|
|
3897
3897
|
C,
|
|
3898
|
-
|
|
3898
|
+
_ === "start" && /* @__PURE__ */ m(Ce, { onClick: () => f(p), classModifiers: "secondary", children: g })
|
|
3899
3899
|
] }),
|
|
3900
3900
|
/* @__PURE__ */ m(
|
|
3901
3901
|
so,
|
|
@@ -3912,13 +3912,13 @@ const {
|
|
|
3912
3912
|
const { firstOnlyLabel: N, ...L } = S;
|
|
3913
3913
|
let { hint: F } = S;
|
|
3914
3914
|
e.restrictHint && A > 0 && (F = void 0);
|
|
3915
|
-
let { label:
|
|
3916
|
-
return A === 0 && (
|
|
3915
|
+
let { label: I } = S;
|
|
3916
|
+
return A === 0 && (I = S.firstOnlyLabel ?? S.label), {
|
|
3917
3917
|
...L,
|
|
3918
3918
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FIXME
|
|
3919
3919
|
hint: F,
|
|
3920
3920
|
readonly: !!(e?.readonly || S.readonly),
|
|
3921
|
-
label: b.interpolateString(
|
|
3921
|
+
label: b.interpolateString(I, { ...p, index: R }),
|
|
3922
3922
|
full_path: `${T}.${S.fieldId}`
|
|
3923
3923
|
};
|
|
3924
3924
|
})
|
|
@@ -3930,7 +3930,7 @@ const {
|
|
|
3930
3930
|
wrap: o
|
|
3931
3931
|
}
|
|
3932
3932
|
),
|
|
3933
|
-
|
|
3933
|
+
_ === "end" && /* @__PURE__ */ m(tn, { className: "govuk-!-margin-top-2", children: /* @__PURE__ */ m(Ce, { onClick: () => f(p), classModifiers: "secondary", children: g }) })
|
|
3934
3934
|
] }, p.id)
|
|
3935
3935
|
);
|
|
3936
3936
|
}),
|
|
@@ -4032,8 +4032,8 @@ const {
|
|
|
4032
4032
|
const T = (C) => {
|
|
4033
4033
|
let g = e.full_path || e.fieldId;
|
|
4034
4034
|
if (e.pageCollection) {
|
|
4035
|
-
const
|
|
4036
|
-
g = `${`${e.pageCollection.name}[${
|
|
4035
|
+
const _ = b.CollectionPage.getActiveIndex(e.pageCollection.name, n);
|
|
4036
|
+
g = `${`${e.pageCollection.name}[${_}]`}.${g}`;
|
|
4037
4037
|
}
|
|
4038
4038
|
i({
|
|
4039
4039
|
target: {
|
|
@@ -4052,8 +4052,8 @@ const {
|
|
|
4052
4052
|
if (e.type === w.FILE)
|
|
4053
4053
|
T([C.value]);
|
|
4054
4054
|
else if (e.type === w.MULTI_FILE) {
|
|
4055
|
-
const g = C.value.map((
|
|
4056
|
-
...
|
|
4055
|
+
const g = C.value.map((_, U) => ({
|
|
4056
|
+
..._,
|
|
4057
4057
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FIXME
|
|
4058
4058
|
indexInField: U
|
|
4059
4059
|
}));
|
|
@@ -5470,7 +5470,7 @@ const vd = (e, t) => e === "02" ? W().year(t).isLeapYear() ? 29 : 28 : ["04", "0
|
|
|
5470
5470
|
hideBlankRows: p = !1,
|
|
5471
5471
|
optionalFieldPlaceholder: A
|
|
5472
5472
|
}) => {
|
|
5473
|
-
const [T, R] = $([]), [C, g] = $([]), { errors:
|
|
5473
|
+
const [T, R] = $([]), [C, g] = $([]), { errors: _ } = ze(), { hooks: U } = De();
|
|
5474
5474
|
z(() => {
|
|
5475
5475
|
const P = (G, Z) => b.CheckYourAnswers.getRows(G, o, U.onGetCYARows).map((q, X) => ({
|
|
5476
5476
|
...q,
|
|
@@ -5514,7 +5514,7 @@ const vd = (e, t) => e === "02" ? W().year(t).isLeapYear() ? 29 : 28 : ["04", "0
|
|
|
5514
5514
|
noGroupAction: f,
|
|
5515
5515
|
groups: d,
|
|
5516
5516
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FIXME
|
|
5517
|
-
errors:
|
|
5517
|
+
errors: _,
|
|
5518
5518
|
sections: E,
|
|
5519
5519
|
type: y
|
|
5520
5520
|
});
|
|
@@ -5523,7 +5523,7 @@ const vd = (e, t) => e === "02" ? W().year(t).isLeapYear() ? 29 : 28 : ["04", "0
|
|
|
5523
5523
|
const F = (P) => (
|
|
5524
5524
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- FIXME
|
|
5525
5525
|
C.includes(P)
|
|
5526
|
-
),
|
|
5526
|
+
), I = (P) => d?.find((x) => x.pageId === P), B = (P, x) => {
|
|
5527
5527
|
if (!P.cya_link?.singleChangeLink || u)
|
|
5528
5528
|
return /* @__PURE__ */ k(Re, { children: [
|
|
5529
5529
|
x === "s" && /* @__PURE__ */ m(rt, { children: b.FormPage.getTitle(P.title, P.formData) }),
|
|
@@ -5537,10 +5537,10 @@ const vd = (e, t) => e === "02" ? W().year(t).isLeapYear() ? 29 : 28 : ["04", "0
|
|
|
5537
5537
|
] }),
|
|
5538
5538
|
/* @__PURE__ */ m("div", { className: "heading-action", children: /* @__PURE__ */ m(kn, { row: { action: H } }) })
|
|
5539
5539
|
] });
|
|
5540
|
-
}, O = () => Array.from(new Set(
|
|
5540
|
+
}, O = () => Array.from(new Set(_.map((x) => x.id))).map((x) => _.find((H) => H.id === x));
|
|
5541
5541
|
return /* @__PURE__ */ k("div", { className: qd, children: [
|
|
5542
5542
|
e && !a && /* @__PURE__ */ m(vt, { size: t, children: e }, "heading"),
|
|
5543
|
-
|
|
5543
|
+
_ && _.length > 0 && /* @__PURE__ */ m(Ir, { errors: O() }),
|
|
5544
5544
|
y === oe.TASK_CYA && T.length > 0 && E && E.map(
|
|
5545
5545
|
(P) => P.tasks.filter((x) => x.state !== j.TYPES.SKIPPED).map((x, H) => {
|
|
5546
5546
|
const G = T.filter(
|
|
@@ -5579,7 +5579,7 @@ const vd = (e, t) => e === "02" ? W().year(t).isLeapYear() ? 29 : 28 : ["04", "0
|
|
|
5579
5579
|
const G = !p || P.collection ? P.rows : P.rows.filter((Ae) => Ae?.value?.props?.value);
|
|
5580
5580
|
if (G.length === 0)
|
|
5581
5581
|
return null;
|
|
5582
|
-
const Z = !i && P.title && !F(P.id), K = N(x) || F(H[x].id) || H.length > x + 1 && F(H[x + 1].id) ? Tr : S, q = F(P.id) ?
|
|
5582
|
+
const Z = !i && P.title && !F(P.id), K = N(x) || F(H[x].id) || H.length > x + 1 && F(H[x + 1].id) ? Tr : S, q = F(P.id) ? I(P.id) : void 0, X = `govuk-!-margin-bottom-${K}`, me = F(P.id) || u;
|
|
5583
5583
|
return (
|
|
5584
5584
|
// eslint-disable-next-line react-x/no-array-index-key -- FIXME
|
|
5585
5585
|
/* @__PURE__ */ k(St, { children: [
|
|
@@ -5622,33 +5622,33 @@ const vd = (e, t) => e === "02" ? W().year(t).isLeapYear() ? 29 : 28 : ["04", "0
|
|
|
5622
5622
|
let f = b.CollectionPage.getData(e.collection.name, e.formData) || [];
|
|
5623
5623
|
const d = e.collection.name.split(".").pop();
|
|
5624
5624
|
let E = b.CollectionPage.getActiveIndex(e.collection.name, e.formData);
|
|
5625
|
-
const y = e, p = ({ target:
|
|
5626
|
-
b.CollectionPage.setData(y.collection.name,
|
|
5625
|
+
const y = e, p = ({ target: _ }) => {
|
|
5626
|
+
b.CollectionPage.setData(y.collection.name, _.value, e.formData), f = _.value;
|
|
5627
5627
|
const U = e.collection.name.split(".").shift();
|
|
5628
5628
|
u((S) => ({
|
|
5629
5629
|
...S,
|
|
5630
5630
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FIXME
|
|
5631
5631
|
[U]: b.CollectionPage.getData(U, e.formData)
|
|
5632
5632
|
}));
|
|
5633
|
-
}, A = ({ target:
|
|
5634
|
-
y.formData[
|
|
5633
|
+
}, A = ({ target: _ }) => {
|
|
5634
|
+
y.formData[_.name] = _.value, u((U) => ({
|
|
5635
5635
|
...U,
|
|
5636
5636
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- FIXME
|
|
5637
|
-
[
|
|
5637
|
+
[_.name]: _.value
|
|
5638
5638
|
}));
|
|
5639
|
-
}, T = (
|
|
5639
|
+
}, T = (_) => {
|
|
5640
5640
|
p({
|
|
5641
5641
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FIXME
|
|
5642
|
-
target: { value:
|
|
5642
|
+
target: { value: _ }
|
|
5643
5643
|
}), typeof n == "function" && n(e.formData);
|
|
5644
|
-
}, R = (
|
|
5644
|
+
}, R = (_) => {
|
|
5645
5645
|
E = f.length, A({
|
|
5646
5646
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FIXME
|
|
5647
|
-
target: { name: `${d}ActiveId`, value:
|
|
5647
|
+
target: { name: `${d}ActiveId`, value: _ }
|
|
5648
5648
|
});
|
|
5649
|
-
}, C = (
|
|
5650
|
-
r(
|
|
5651
|
-
}, g = ({ target:
|
|
5649
|
+
}, C = (_) => {
|
|
5650
|
+
r(_, c, {});
|
|
5651
|
+
}, g = ({ target: _ }) => {
|
|
5652
5652
|
if (E === null) {
|
|
5653
5653
|
const U = Ft();
|
|
5654
5654
|
R(U), T([
|
|
@@ -5657,18 +5657,18 @@ const vd = (e, t) => e === "02" ? W().year(t).isLeapYear() ? 29 : 28 : ["04", "0
|
|
|
5657
5657
|
{
|
|
5658
5658
|
id: U,
|
|
5659
5659
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- FIXME
|
|
5660
|
-
[
|
|
5660
|
+
[_.name]: _.value
|
|
5661
5661
|
}
|
|
5662
5662
|
]);
|
|
5663
5663
|
} else
|
|
5664
|
-
T([
|
|
5664
|
+
_.value && (!Array.isArray(_.value) || (Array.isArray(_.value) && _.value.length) > 0) && T([
|
|
5665
5665
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access -- FIXME
|
|
5666
5666
|
...f.slice(0, E),
|
|
5667
5667
|
{
|
|
5668
5668
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- FIXME
|
|
5669
5669
|
...f[E],
|
|
5670
5670
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- FIXME
|
|
5671
|
-
[
|
|
5671
|
+
[_.name]: _.value
|
|
5672
5672
|
},
|
|
5673
5673
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access -- FIXME
|
|
5674
5674
|
...f.slice(E + 1)
|
|
@@ -5682,8 +5682,8 @@ const vd = (e, t) => e === "02" ? W().year(t).isLeapYear() ? 29 : 28 : ["04", "0
|
|
|
5682
5682
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- FIXME
|
|
5683
5683
|
formData: { ...e.formData, ...f[E], [`${d}ActiveIndex`]: E, [`${d}NumberedIndex`]: typeof E == "number" ? E + 1 : null },
|
|
5684
5684
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return -- FIXME
|
|
5685
|
-
components: e.components.map((
|
|
5686
|
-
...
|
|
5685
|
+
components: e.components.map((_) => ({
|
|
5686
|
+
..._,
|
|
5687
5687
|
pageCollection: { ...e.collection }
|
|
5688
5688
|
}))
|
|
5689
5689
|
},
|
|
@@ -5748,7 +5748,7 @@ const vd = (e, t) => e === "02" ? W().year(t).isLeapYear() ? 29 : 28 : ["04", "0
|
|
|
5748
5748
|
const p = v.classBuilder(c, u, f), A = v.cleanHtmlAttributes(y), [T, R] = i.filter((S) => !S.skipped).reduce((S, N) => [
|
|
5749
5749
|
S[0] + (N.tasks?.filter((L) => L.state === j.TYPES.COMPLETE).length ?? 0),
|
|
5750
5750
|
S[1] + (N.tasks?.filter((L) => L.state !== j.TYPES.SKIPPED).length ?? 0)
|
|
5751
|
-
], [0, 0]), C = `${e}Notes`, { title: g, text:
|
|
5751
|
+
], [0, 0]), C = `${e}Notes`, { title: g, text: _ } = r && r || {}, U = (S) => {
|
|
5752
5752
|
typeof a == "function" && a(S);
|
|
5753
5753
|
};
|
|
5754
5754
|
return /* @__PURE__ */ k("div", { ...A, id: e, className: p(), children: [
|
|
@@ -5764,9 +5764,9 @@ const vd = (e, t) => e === "02" ? W().year(t).isLeapYear() ? 29 : 28 : ["04", "0
|
|
|
5764
5764
|
),
|
|
5765
5765
|
o && R !== T && /* @__PURE__ */ m("p", { className: "govuk-body govuk-!-margin-bottom-0", children: /* @__PURE__ */ m("strong", { className: "tasklist-summary", children: s }) }),
|
|
5766
5766
|
o && /* @__PURE__ */ m("p", { className: "govuk-body govuk-!-margin-bottom-7", children: `You have completed ${T} of ${R} sections` }),
|
|
5767
|
-
g &&
|
|
5767
|
+
g && _ && Ne(r, d) && /* @__PURE__ */ k(Re, { children: [
|
|
5768
5768
|
/* @__PURE__ */ m("p", { className: "govuk-body govuk-!-margin-bottom-0", children: /* @__PURE__ */ m("strong", { className: "tasklist-summary", children: v.interpolateString(g, d) }) }),
|
|
5769
|
-
/* @__PURE__ */ m(Dr, { id: C, fieldId: C, readOnly: !0, value: v.interpolateString(
|
|
5769
|
+
/* @__PURE__ */ m(Dr, { id: C, fieldId: C, readOnly: !0, value: v.interpolateString(_, d) })
|
|
5770
5770
|
] }),
|
|
5771
5771
|
i.filter((S) => !S.skipped).map(
|
|
5772
5772
|
(S, N) => /* @__PURE__ */ k(St, { children: [
|
|
@@ -6211,14 +6211,14 @@ const io = (e, t) => {
|
|
|
6211
6211
|
() => {
|
|
6212
6212
|
T(!1), y(ie.HUB);
|
|
6213
6213
|
},
|
|
6214
|
-
(
|
|
6215
|
-
T(!1), Se.submissionError(
|
|
6214
|
+
(_) => {
|
|
6215
|
+
T(!1), Se.submissionError(_, d);
|
|
6216
6216
|
}
|
|
6217
6217
|
);
|
|
6218
6218
|
}
|
|
6219
6219
|
if (t.type === J.TYPES.SUBMIT && E === ge.TASK && (e("submit"), C)) {
|
|
6220
|
-
const g = b.Format.form({ pages: n, components: o }, { ...i }, Pe.SUBMIT),
|
|
6221
|
-
ee.clearOutUncompletedRoutes(s,
|
|
6220
|
+
const g = b.Format.form({ pages: n, components: o }, { ...i }, Pe.SUBMIT), _ = { pages: n, components: o };
|
|
6221
|
+
ee.clearOutUncompletedRoutes(s, _, g), g.formStatus = ee.getSubmissionStatus(a, n, c, t, g, u, !0), l(g), f.onSubmit(
|
|
6222
6222
|
t.type,
|
|
6223
6223
|
g,
|
|
6224
6224
|
() => {
|
|
@@ -6237,8 +6237,8 @@ const io = (e, t) => {
|
|
|
6237
6237
|
() => {
|
|
6238
6238
|
T(!1), y(t.page);
|
|
6239
6239
|
},
|
|
6240
|
-
(
|
|
6241
|
-
T(!1), Se.submissionError(
|
|
6240
|
+
(_) => {
|
|
6241
|
+
T(!1), Se.submissionError(_, d);
|
|
6242
6242
|
}
|
|
6243
6243
|
);
|
|
6244
6244
|
}
|
|
@@ -6250,8 +6250,8 @@ const io = (e, t) => {
|
|
|
6250
6250
|
() => {
|
|
6251
6251
|
a === oe.TASK ? y(void 0) : y(ie.HUB), T(!1);
|
|
6252
6252
|
},
|
|
6253
|
-
(
|
|
6254
|
-
T(!1), Se.submissionError(
|
|
6253
|
+
(_) => {
|
|
6254
|
+
T(!1), Se.submissionError(_, d);
|
|
6255
6255
|
}
|
|
6256
6256
|
);
|
|
6257
6257
|
}
|
|
@@ -6260,7 +6260,7 @@ const io = (e, t) => {
|
|
|
6260
6260
|
f.onCancel(g), T(!1);
|
|
6261
6261
|
}
|
|
6262
6262
|
}
|
|
6263
|
-
}, br = (e, t, n, r, s, o, i, l, a, c, u, f, d, E, y, p, A, T, R, C, g,
|
|
6263
|
+
}, br = (e, t, n, r, s, o, i, l, a, c, u, f, d, E, y, p, A, T, R, C, g, _) => {
|
|
6264
6264
|
const U = { ...s }, S = o, N = r.onAction(S.page.formData, t, s, e.customAction);
|
|
6265
6265
|
S.page.formData = N.formData;
|
|
6266
6266
|
let L = N.patch;
|
|
@@ -6268,25 +6268,25 @@ const io = (e, t) => {
|
|
|
6268
6268
|
r.onCancel(S.page.formData), g(!1);
|
|
6269
6269
|
return;
|
|
6270
6270
|
}
|
|
6271
|
-
if (ee.canActionProceed(e, S.page, i.page,
|
|
6272
|
-
if (L = ee.cleanHiddenNestedData(L, S.page), g(!0), e.addToFormData && ((Array.isArray(e.addToFormData) ? e.addToFormData : [e.addToFormData]).forEach((
|
|
6273
|
-
|
|
6271
|
+
if (ee.canActionProceed(e, S.page, i.page, _) && (!C || e.ignoreSubmittingFlag))
|
|
6272
|
+
if (L = ee.cleanHiddenNestedData(L, S.page), g(!0), e.addToFormData && ((Array.isArray(e.addToFormData) ? e.addToFormData : [e.addToFormData]).forEach((I) => {
|
|
6273
|
+
I.isCollection ? $n(I.field, I.value, o.page.formData) : b.Data.setDataItem(o.page.formData, I.field, I.value);
|
|
6274
6274
|
}), S.page.formData[e.addToFormData.field] = e.addToFormData.value), e.type === J.TYPES.NAVIGATE)
|
|
6275
6275
|
Se.navigate(e, d, l), g(!1);
|
|
6276
6276
|
else {
|
|
6277
|
-
let F = (K) => l(ee.getNextPageId(a, u, d, e, K)),
|
|
6278
|
-
e.collection && (
|
|
6277
|
+
let F = (K) => l(ee.getNextPageId(a, u, d, e, K)), I, B;
|
|
6278
|
+
e.collection && (I = e.collection, B = `addAnother${I.charAt(0).toUpperCase() + I.slice(1)}`.slice(0, -1));
|
|
6279
6279
|
let O, P;
|
|
6280
|
-
switch (
|
|
6280
|
+
switch (I && (O = S.page.formData[I], O && O.length > 0 && S.page.formData[`${I}ActiveId`] && (P = O.findIndex((K) => K.id === S.page.formData[`${I}ActiveId`]))), e.type) {
|
|
6281
6281
|
case J.TYPES.SUBMIT:
|
|
6282
6282
|
E("submit");
|
|
6283
6283
|
break;
|
|
6284
6284
|
case J.TYPES.SAVE_AND_NAVIGATE:
|
|
6285
6285
|
const K = { ...y };
|
|
6286
|
-
O && O.length > 0 && e.resetActiveId && (S.page.formData[`${
|
|
6286
|
+
O && O.length > 0 && e.resetActiveId && (S.page.formData[`${I}ActiveId`] = O[0].id), O && O.length > 0 && !e.resetActiveId && (P !== void 0 && P + 1 < S.page.formData[I].length && (S.page.formData[B] = "Yes"), P !== void 0 && P + 1 === S.page.formData[I].length && S.page.formData[B] && (S.page.formData[B] = "No")), F = () => Se.navigate(e, d, l, K);
|
|
6287
6287
|
break;
|
|
6288
6288
|
case J.TYPES.COLLECTION_ADD:
|
|
6289
|
-
if (P === void 0 || O.length === 0 || P + 1 === S.page.formData[
|
|
6289
|
+
if (P === void 0 || O.length === 0 || P + 1 === S.page.formData[I].length ? b.CollectionPage.addEntry(e.collection, S.page.formData) : S.page.formData[`${e.collection}ActiveId`] = O[P + 1].id, S.page.formData[`${e.collection}`] && S.page.formData[`${e.collection}`].length > 0) {
|
|
6290
6290
|
const Ae = S.page.formData[`${e.collection}`].length - 1;
|
|
6291
6291
|
Object.keys(S.page.formData[`${e.collection}`][Ae]).filter((Q) => Q in S.page.formData && Q !== "id").forEach((Q) => delete S.page.formData[Q]);
|
|
6292
6292
|
}
|
|
@@ -6403,7 +6403,7 @@ const io = (e, t) => {
|
|
|
6403
6403
|
viewOnly: T,
|
|
6404
6404
|
hideBlankRows: R
|
|
6405
6405
|
}) => {
|
|
6406
|
-
const [C, g] = $({}), [
|
|
6406
|
+
const [C, g] = $({}), [_, U] = $(), [S, N] = $([]), [L, F] = $(void 0), [I, B] = $(ee.getNextPageId(n, o, null, null, a)), [O, P] = $(ee.getFormState(I, S, L)), [x, H] = $({}), [G, Z] = $({}), [K, q] = $("load"), [X, me] = $(!1), [Ae, V] = $(!1), { hooks: Q } = De(), { addErrors: Qe, clearErrors: Ze, errors: ye, validate: Le } = ze();
|
|
6407
6407
|
window.onpopstate = (Y) => {
|
|
6408
6408
|
if (!document.location.hash && (Y.state && Y.state.fullPages !== void 0 && H((ne) => ({
|
|
6409
6409
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- FIXME
|
|
@@ -6434,16 +6434,16 @@ const io = (e, t) => {
|
|
|
6434
6434
|
}, [n, S, B]), z(() => {
|
|
6435
6435
|
F(b.Hub.get(n, i, s, { ...C }));
|
|
6436
6436
|
}, [n, i, C, s, F]), z(() => {
|
|
6437
|
-
n === oe.HUB && X && C && O.page?.formData && (O.page.formData = { ...C }), me(!1), P(ee.getFormState(
|
|
6438
|
-
}, [S, L,
|
|
6437
|
+
n === oe.HUB && X && C && O.page?.formData && (O.page.formData = { ...C }), me(!1), P(ee.getFormState(I, S, L));
|
|
6438
|
+
}, [S, L, I, P, n, X, C, O.page]), z(() => {
|
|
6439
6439
|
q(void 0), Q.onFormLoad((Y) => {
|
|
6440
6440
|
H(Y);
|
|
6441
6441
|
});
|
|
6442
6442
|
}, [Q]), z(() => {
|
|
6443
6443
|
Z(i);
|
|
6444
6444
|
}, [i]), z(() => {
|
|
6445
|
-
|
|
6446
|
-
}, [
|
|
6445
|
+
_?.data && (g(_.data), U(void 0));
|
|
6446
|
+
}, [_, g, U]);
|
|
6447
6447
|
const Te = i?.sections, M = i?.nonSequential;
|
|
6448
6448
|
z(() => {
|
|
6449
6449
|
const Y = x.fullPages;
|
|
@@ -6480,7 +6480,7 @@ const io = (e, t) => {
|
|
|
6480
6480
|
le
|
|
6481
6481
|
), !1) : !0)
|
|
6482
6482
|
)
|
|
6483
|
-
), Y && Se.cyaAction(Y,
|
|
6483
|
+
), Y && Se.cyaAction(Y, I, le);
|
|
6484
6484
|
}, mt = b.classBuilder(c, u, f);
|
|
6485
6485
|
if (L === ge.TASK) {
|
|
6486
6486
|
const Y = l;
|
|
@@ -6491,7 +6491,7 @@ const io = (e, t) => {
|
|
|
6491
6491
|
}
|
|
6492
6492
|
const { noTaskCYAs: Vn, nonSequential: Be, ...po } = G;
|
|
6493
6493
|
return /* @__PURE__ */ k("div", { className: mt(), children: [
|
|
6494
|
-
e && !E &&
|
|
6494
|
+
e && !E && I === ie.HUB && /* @__PURE__ */ m(vt, { size: t, children: e }),
|
|
6495
6495
|
O.cya && /* @__PURE__ */ m(
|
|
6496
6496
|
Kd,
|
|
6497
6497
|
{
|
|
@@ -6510,7 +6510,7 @@ const io = (e, t) => {
|
|
|
6510
6510
|
C,
|
|
6511
6511
|
g,
|
|
6512
6512
|
n,
|
|
6513
|
-
|
|
6513
|
+
I,
|
|
6514
6514
|
x,
|
|
6515
6515
|
Q,
|
|
6516
6516
|
Qe,
|
|
@@ -6569,7 +6569,7 @@ const io = (e, t) => {
|
|
|
6569
6569
|
r,
|
|
6570
6570
|
S,
|
|
6571
6571
|
s,
|
|
6572
|
-
|
|
6572
|
+
I,
|
|
6573
6573
|
q,
|
|
6574
6574
|
x,
|
|
6575
6575
|
g,
|
|
@@ -6586,7 +6586,7 @@ const io = (e, t) => {
|
|
|
6586
6586
|
classModifiers: O.page.classModifiers,
|
|
6587
6587
|
className: O.page.className,
|
|
6588
6588
|
submitting: Ae,
|
|
6589
|
-
pageId:
|
|
6589
|
+
pageId: I
|
|
6590
6590
|
}
|
|
6591
6591
|
),
|
|
6592
6592
|
O.page && !O.cya && O.page.collection && /* @__PURE__ */ m(
|
|
@@ -6609,7 +6609,7 @@ const io = (e, t) => {
|
|
|
6609
6609
|
r,
|
|
6610
6610
|
S,
|
|
6611
6611
|
s,
|
|
6612
|
-
|
|
6612
|
+
I,
|
|
6613
6613
|
q,
|
|
6614
6614
|
x,
|
|
6615
6615
|
g,
|