@m4l/components 9.72.1-beta-improvement-786-m4l-components-dynamic-form.0 → 9.73.0
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/components/DynamicForm/DynamicForm.d.ts.map +1 -1
- package/components/DynamicForm/DynamicForm.js +93 -96
- package/components/DynamicForm/DynamicForm.styles.d.ts.map +1 -1
- package/components/DynamicForm/DynamicForm.styles.js +68 -91
- package/components/DynamicForm/constants.d.ts +1 -1
- package/components/DynamicForm/constants.d.ts.map +1 -1
- package/components/DynamicForm/dictionary.d.ts +0 -9
- package/components/DynamicForm/dictionary.d.ts.map +1 -1
- package/components/DynamicForm/dictionary.js +3 -11
- package/components/DynamicForm/slots/DynamicFormEnum.d.ts +0 -1
- package/components/DynamicForm/slots/DynamicFormEnum.d.ts.map +1 -1
- package/components/DynamicForm/slots/DynamicFormEnum.js +1 -1
- package/components/DynamicForm/slots/DynamicFormSlots.d.ts +0 -3
- package/components/DynamicForm/slots/DynamicFormSlots.d.ts.map +1 -1
- package/components/DynamicForm/slots/DynamicFormSlots.js +39 -43
- package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.d.ts.map +1 -1
- package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.js +99 -128
- package/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/DynamicFormFieldsFlow.d.ts.map +1 -1
- package/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/DynamicFormFieldsFlow.js +20 -21
- package/components/DynamicForm/types.d.ts +3 -7
- package/components/DynamicForm/types.d.ts.map +1 -1
- package/components/extended/mui/Accordion/Accordion.d.ts.map +1 -1
- package/components/extended/mui/Accordion/Accordion.js +66 -64
- package/components/extended/mui/Accordion/slots/AccordionEnum.d.ts +1 -0
- package/components/extended/mui/Accordion/slots/AccordionEnum.d.ts.map +1 -1
- package/components/extended/mui/Accordion/slots/AccordionEnum.js +2 -2
- package/components/extended/mui/Accordion/slots/AccordionSlots.d.ts +3 -0
- package/components/extended/mui/Accordion/slots/AccordionSlots.d.ts.map +1 -1
- package/components/extended/mui/Accordion/slots/AccordionSlots.js +19 -15
- package/components/extended/mui/Accordion/styles.d.ts.map +1 -1
- package/components/extended/mui/Accordion/styles.js +12 -2
- package/components/extended/mui/Accordion/types.d.ts +4 -0
- package/components/extended/mui/Accordion/types.d.ts.map +1 -1
- package/package.json +7 -7
- package/components/DynamicForm/helpers/isRenderableDynamicFormField/index.d.ts +0 -2
- package/components/DynamicForm/helpers/isRenderableDynamicFormField/index.d.ts.map +0 -1
- package/components/DynamicForm/helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.d.ts +0 -4
- package/components/DynamicForm/helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.d.ts.map +0 -1
- package/components/DynamicForm/helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.js +0 -8
- package/components/DynamicForm/helpers/resolveEmptyStateLabel/index.d.ts +0 -2
- package/components/DynamicForm/helpers/resolveEmptyStateLabel/index.d.ts.map +0 -1
- package/components/DynamicForm/helpers/resolveEmptyStateLabel/resolveEmptyStateLabel.d.ts +0 -4
- package/components/DynamicForm/helpers/resolveEmptyStateLabel/resolveEmptyStateLabel.d.ts.map +0 -1
- package/components/DynamicForm/helpers/resolveEmptyStateLabel/resolveEmptyStateLabel.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicForm.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/DynamicForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqF,MAAM,OAAO,CAAC;AAU1G,OAAO,EAEL,gBAAgB,EAChB,cAAc,EAGf,MAAM,SAAS,CAAC;AAYjB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"DynamicForm.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/DynamicForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqF,MAAM,OAAO,CAAC;AAU1G,OAAO,EAEL,gBAAgB,EAChB,cAAc,EAGf,MAAM,SAAS,CAAC;AAYjB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,WAAW,yFAwRtB,CAAC"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { jsx as r } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useModuleSkeleton as
|
|
5
|
-
import { useComponentSize as
|
|
6
|
-
import { TEST_PROP_ID as
|
|
7
|
-
import { LinearProgress as
|
|
8
|
-
import { DynamicFormContentRootStyled as
|
|
9
|
-
import { DYNAMIC_FORM_CLASSES as b, EMPTY_DATA as
|
|
10
|
-
import { useDynamicForm as
|
|
11
|
-
import { useDynamicFormData as
|
|
12
|
-
import { DynamicFormContent as
|
|
13
|
-
import { useFieldsWithFetchedOptions as
|
|
14
|
-
import { filterUnknownFieldsFromSubmit as
|
|
15
|
-
import { mapOptionFieldValuesForSubmit as
|
|
16
|
-
import { normalizeDynamicFormFields as
|
|
17
|
-
const
|
|
2
|
+
import X, { forwardRef as Z, useMemo as c, useState as $, useEffect as ee, useImperativeHandle as te, useCallback as M } from "react";
|
|
3
|
+
import N from "clsx";
|
|
4
|
+
import { useModuleSkeleton as oe } from "@m4l/core";
|
|
5
|
+
import { useComponentSize as re } from "../../hooks/useComponentSize/index.js";
|
|
6
|
+
import { TEST_PROP_ID as ie } from "../../test/constants_no_mock.js";
|
|
7
|
+
import { LinearProgress as ne } from "../extended/mui/LinearProgress/index.js";
|
|
8
|
+
import { DynamicFormContentRootStyled as se, DynamicFormFormProviderStyled as ae } from "./slots/DynamicFormSlots.js";
|
|
9
|
+
import { DYNAMIC_FORM_CLASSES as b, EMPTY_DATA as me } from "./constants.js";
|
|
10
|
+
import { useDynamicForm as ue } from "./hooks/useDynamicForm/useDynamicForm.js";
|
|
11
|
+
import { useDynamicFormData as le } from "./hooks/useDynamicFormData/useDynamicFormData.js";
|
|
12
|
+
import { DynamicFormContent as P } from "./subcomponents/DynamicFormContent/DynamicFormContent.js";
|
|
13
|
+
import { useFieldsWithFetchedOptions as de } from "./hooks/useFieldsWithFetchedOptions/useFieldsWithFetchedOptions.js";
|
|
14
|
+
import { filterUnknownFieldsFromSubmit as ce } from "./helpers/filterUnknownFieldsFromSubmit/filterUnknownFieldsFromSubmit.js";
|
|
15
|
+
import { mapOptionFieldValuesForSubmit as fe } from "./helpers/mapOptionFieldValuesForSubmit/mapOptionFieldValuesForSubmit.js";
|
|
16
|
+
import { normalizeDynamicFormFields as pe } from "./helpers/resolveFormSections/resolveFormSections.js";
|
|
17
|
+
const Fe = Z((T, C) => {
|
|
18
18
|
const {
|
|
19
|
-
formId:
|
|
20
|
-
formInstanceId:
|
|
21
|
-
inputEndpoint:
|
|
19
|
+
formId: k,
|
|
20
|
+
formInstanceId: z,
|
|
21
|
+
inputEndpoint: _,
|
|
22
22
|
outputEndpoint: i,
|
|
23
|
-
submitMode:
|
|
23
|
+
submitMode: n,
|
|
24
24
|
initialData: D,
|
|
25
|
-
formatInputData:
|
|
26
|
-
formatOutputData:
|
|
27
|
-
onSubmit:
|
|
25
|
+
formatInputData: A,
|
|
26
|
+
formatOutputData: H,
|
|
27
|
+
onSubmit: s,
|
|
28
28
|
onSubmitError: y,
|
|
29
29
|
size: g,
|
|
30
30
|
readOnly: a = !1,
|
|
@@ -35,43 +35,42 @@ const Ft = $((C, k) => {
|
|
|
35
35
|
fieldWrapperClassName: E,
|
|
36
36
|
fieldFlow: u = "responsiveWrap",
|
|
37
37
|
coupled: p = !1,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
inputEndpoint: A,
|
|
38
|
+
actionFormIntroProps: x,
|
|
39
|
+
renderActions: W
|
|
40
|
+
} = T, { currentSize: l } = re(g), L = oe(), {
|
|
41
|
+
formData: V,
|
|
42
|
+
statusLoad: U,
|
|
43
|
+
handleSubmit: I
|
|
44
|
+
} = le({
|
|
45
|
+
formId: k,
|
|
46
|
+
formInstanceId: z,
|
|
47
|
+
inputEndpoint: _,
|
|
49
48
|
outputEndpoint: i,
|
|
50
|
-
submitMode:
|
|
49
|
+
submitMode: n,
|
|
51
50
|
initialData: D,
|
|
52
|
-
formatInputData:
|
|
53
|
-
formatOutputData:
|
|
54
|
-
onSubmit:
|
|
55
|
-
}),
|
|
56
|
-
() =>
|
|
57
|
-
[
|
|
58
|
-
), { fields:
|
|
59
|
-
fields:
|
|
60
|
-
}),
|
|
61
|
-
...
|
|
62
|
-
fields:
|
|
63
|
-
}, [
|
|
64
|
-
|
|
65
|
-
if (!
|
|
51
|
+
formatInputData: A,
|
|
52
|
+
formatOutputData: H,
|
|
53
|
+
onSubmit: s
|
|
54
|
+
}), t = V || D, F = c(
|
|
55
|
+
() => pe(t?.fields),
|
|
56
|
+
[t?.fields]
|
|
57
|
+
), { fields: w } = de({
|
|
58
|
+
fields: F.fields
|
|
59
|
+
}), e = c(() => t && {
|
|
60
|
+
...t,
|
|
61
|
+
fields: w
|
|
62
|
+
}, [w, t]), { initialValues: Y, validationSchema: j } = ue(e || me), [S, d] = $(null);
|
|
63
|
+
ee(() => {
|
|
64
|
+
if (!S)
|
|
66
65
|
return;
|
|
67
|
-
const o = setTimeout(() =>
|
|
66
|
+
const o = setTimeout(() => d(null), 5e3);
|
|
68
67
|
return () => clearTimeout(o);
|
|
69
|
-
}, [
|
|
70
|
-
const
|
|
71
|
-
size:
|
|
68
|
+
}, [S]);
|
|
69
|
+
const B = c(() => ({
|
|
70
|
+
size: l,
|
|
72
71
|
readOnly: a,
|
|
73
72
|
fieldFlow: u
|
|
74
|
-
}), [
|
|
73
|
+
}), [l, u, a]), O = X.useRef(null), R = c(() => ({
|
|
75
74
|
formMethods: new Proxy({}, {
|
|
76
75
|
get() {
|
|
77
76
|
throw new Error("DynamicForm ref is not available until the form provider mounts.");
|
|
@@ -80,44 +79,43 @@ const Ft = $((C, k) => {
|
|
|
80
79
|
onSubmit: () => {
|
|
81
80
|
}
|
|
82
81
|
}), []);
|
|
83
|
-
|
|
84
|
-
const
|
|
82
|
+
te(C, () => O.current ?? R, [R]);
|
|
83
|
+
const q = M(
|
|
85
84
|
async (o) => {
|
|
86
|
-
if (!!!(i ||
|
|
85
|
+
if (!!!(i || n === "perField" || s))
|
|
87
86
|
return;
|
|
88
|
-
const
|
|
89
|
-
}),
|
|
87
|
+
const J = i || n === "perField" ? I : s ?? (() => {
|
|
88
|
+
}), K = ce(
|
|
90
89
|
o,
|
|
91
|
-
|
|
92
|
-
),
|
|
90
|
+
e?.fields ?? []
|
|
91
|
+
), Q = fe(K, e?.fields ?? []);
|
|
93
92
|
try {
|
|
94
|
-
await
|
|
93
|
+
await J(Q), d("success");
|
|
95
94
|
} catch {
|
|
96
|
-
|
|
95
|
+
d("error");
|
|
97
96
|
}
|
|
98
97
|
},
|
|
99
|
-
[
|
|
100
|
-
),
|
|
98
|
+
[I, s, i, e?.fields, n]
|
|
99
|
+
), G = M(
|
|
101
100
|
(o) => {
|
|
102
|
-
|
|
101
|
+
d("error"), y?.(o);
|
|
103
102
|
},
|
|
104
103
|
[y]
|
|
105
104
|
);
|
|
106
|
-
return
|
|
107
|
-
|
|
105
|
+
return L ? /* @__PURE__ */ r(
|
|
106
|
+
se,
|
|
108
107
|
{
|
|
109
|
-
ownerState:
|
|
110
|
-
className:
|
|
108
|
+
ownerState: B,
|
|
109
|
+
className: N(v, b.contentRoot),
|
|
111
110
|
...typeof m == "string" ? { "data-meta": m } : {},
|
|
112
|
-
...process.env.NODE_ENV !== "production" ? { [
|
|
113
|
-
children: /* @__PURE__ */ r(
|
|
111
|
+
...process.env.NODE_ENV !== "production" ? { [ie]: f } : {},
|
|
112
|
+
children: /* @__PURE__ */ r(ne, {})
|
|
114
113
|
}
|
|
115
|
-
) :
|
|
116
|
-
|
|
114
|
+
) : e ? p ? /* @__PURE__ */ r(
|
|
115
|
+
P,
|
|
117
116
|
{
|
|
118
|
-
data:
|
|
119
|
-
|
|
120
|
-
currentSize: d,
|
|
117
|
+
data: e,
|
|
118
|
+
currentSize: l,
|
|
121
119
|
fieldWrapperClassName: E,
|
|
122
120
|
dataTestId: f,
|
|
123
121
|
dataMeta: m,
|
|
@@ -125,25 +123,24 @@ const Ft = $((C, k) => {
|
|
|
125
123
|
readOnly: a,
|
|
126
124
|
suppressFormHeader: h,
|
|
127
125
|
fieldFlow: u,
|
|
128
|
-
contractIssues:
|
|
126
|
+
contractIssues: F.issues
|
|
129
127
|
}
|
|
130
128
|
) : /* @__PURE__ */ r(
|
|
131
|
-
|
|
129
|
+
ae,
|
|
132
130
|
{
|
|
133
|
-
ref:
|
|
134
|
-
values:
|
|
135
|
-
validationSchema:
|
|
136
|
-
onSubmit:
|
|
137
|
-
onSubmitError:
|
|
138
|
-
statusLoad:
|
|
131
|
+
ref: O,
|
|
132
|
+
values: Y,
|
|
133
|
+
validationSchema: j,
|
|
134
|
+
onSubmit: q,
|
|
135
|
+
onSubmitError: G,
|
|
136
|
+
statusLoad: U,
|
|
139
137
|
mode: "onSubmit",
|
|
140
|
-
className:
|
|
138
|
+
className: N(v, b.contentRoot, b.formProvider),
|
|
141
139
|
children: /* @__PURE__ */ r(
|
|
142
|
-
|
|
140
|
+
P,
|
|
143
141
|
{
|
|
144
|
-
data:
|
|
145
|
-
|
|
146
|
-
currentSize: d,
|
|
142
|
+
data: e,
|
|
143
|
+
currentSize: l,
|
|
147
144
|
fieldWrapperClassName: E,
|
|
148
145
|
dataTestId: f,
|
|
149
146
|
dataMeta: m,
|
|
@@ -151,16 +148,16 @@ const Ft = $((C, k) => {
|
|
|
151
148
|
readOnly: a,
|
|
152
149
|
suppressFormHeader: h,
|
|
153
150
|
fieldFlow: u,
|
|
154
|
-
contractIssues:
|
|
155
|
-
actionFormIntroProps:
|
|
156
|
-
renderActions:
|
|
157
|
-
submitFeedbackStatus:
|
|
151
|
+
contractIssues: F.issues,
|
|
152
|
+
actionFormIntroProps: x,
|
|
153
|
+
renderActions: W,
|
|
154
|
+
submitFeedbackStatus: S
|
|
158
155
|
}
|
|
159
156
|
)
|
|
160
157
|
}
|
|
161
158
|
) : null;
|
|
162
159
|
});
|
|
163
|
-
|
|
160
|
+
Fe.displayName = "DynamicForm";
|
|
164
161
|
export {
|
|
165
|
-
|
|
162
|
+
Fe as DynamicForm
|
|
166
163
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicForm.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/DynamicForm.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DynamicForm.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/DynamicForm.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAgNjB,eAAO,MAAM,eAAe,EAAE,iBAiV7B,CAAC"}
|
|
@@ -1,98 +1,97 @@
|
|
|
1
1
|
import { CHECKABLE_LIST_DEFAULT_MIN_HEIGHT as m } from "../CheckableList/constants.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const s = "m4l-dynamic-form-content", w = {
|
|
2
|
+
import { createDynamicFormSectionCardStyles as f } from "./subcomponents/DynamicFormSection/cardStyles.js";
|
|
3
|
+
import { DYNAMIC_FORM_SEMANTIC_GRID_COLUMN_BREAKPOINTS as l, DYNAMIC_FORM_SEMANTIC_GRID_MAX_COLUMNS as c, resolveSemanticGridSpanForContainerWidth as x, resolveSemanticGridSpanForColumnCount as h, resolveSemanticGridContainerWidthForSpan as S } from "./helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.js";
|
|
4
|
+
const s = "m4l-dynamic-form-content", g = {
|
|
6
5
|
gridColumn: "1 / -1",
|
|
7
6
|
maxWidth: "100%",
|
|
8
7
|
width: "100%",
|
|
9
8
|
minWidth: "0",
|
|
10
9
|
flex: "1 1 100%"
|
|
11
|
-
},
|
|
12
|
-
(
|
|
13
|
-
gridTemplateColumns: `repeat(${
|
|
14
|
-
},
|
|
10
|
+
}, w = l.reduce(
|
|
11
|
+
(i, t) => (i[`@container ${s} (max-width: ${t.maxContainerWidth}px)`] = {
|
|
12
|
+
gridTemplateColumns: `repeat(${t.columns}, minmax(0, 1fr))`
|
|
13
|
+
}, i),
|
|
15
14
|
{}
|
|
16
|
-
),
|
|
15
|
+
), y = [
|
|
17
16
|
{
|
|
18
17
|
columns: c,
|
|
19
18
|
minContainerWidth: (l[0]?.maxContainerWidth ?? 0) + 1
|
|
20
19
|
},
|
|
21
20
|
...l.map(
|
|
22
|
-
(
|
|
23
|
-
columns:
|
|
24
|
-
maxContainerWidth:
|
|
25
|
-
minContainerWidth: (l[
|
|
21
|
+
(i, t) => ({
|
|
22
|
+
columns: i.columns,
|
|
23
|
+
maxContainerWidth: i.maxContainerWidth,
|
|
24
|
+
minContainerWidth: (l[t + 1]?.maxContainerWidth ?? -1) + 1
|
|
26
25
|
})
|
|
27
26
|
)
|
|
28
27
|
];
|
|
29
|
-
function
|
|
30
|
-
return typeof
|
|
28
|
+
function C(i) {
|
|
29
|
+
return typeof i == "number" && Number.isFinite(i) && i > 0;
|
|
31
30
|
}
|
|
32
|
-
function
|
|
31
|
+
function p(i) {
|
|
33
32
|
return {
|
|
34
|
-
gridColumn: `span ${
|
|
33
|
+
gridColumn: `span ${i}`
|
|
35
34
|
};
|
|
36
35
|
}
|
|
37
|
-
function
|
|
36
|
+
function u(i, t) {
|
|
38
37
|
const e = [];
|
|
39
|
-
return
|
|
38
|
+
return i > 0 && e.push(`(min-width: ${i}px)`), typeof t == "number" && e.push(`(max-width: ${t}px)`), `@container ${s} ${e.join(
|
|
40
39
|
" and "
|
|
41
40
|
)}`;
|
|
42
41
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
42
|
+
function W(i) {
|
|
43
|
+
return i.minContainerWidth > 0 ? i.minContainerWidth : i.maxContainerWidth ?? 1;
|
|
45
44
|
}
|
|
46
|
-
function
|
|
45
|
+
function b(i, t, e, n) {
|
|
47
46
|
for (let r = n - 1; r >= 1; r -= 1) {
|
|
48
|
-
const o =
|
|
47
|
+
const o = S(
|
|
49
48
|
e,
|
|
50
49
|
r,
|
|
51
|
-
|
|
50
|
+
t.columns
|
|
52
51
|
);
|
|
53
|
-
o <=
|
|
52
|
+
o <= t.minContainerWidth || typeof t.maxContainerWidth == "number" && o > t.maxContainerWidth || (i[u(
|
|
54
53
|
o,
|
|
55
|
-
|
|
56
|
-
)] =
|
|
54
|
+
t.maxContainerWidth
|
|
55
|
+
)] = p(r));
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
|
-
function
|
|
60
|
-
if (
|
|
58
|
+
function v(i, t) {
|
|
59
|
+
if (C(t)) {
|
|
61
60
|
const e = {
|
|
62
61
|
justifySelf: "start",
|
|
63
62
|
maxWidth: "100%",
|
|
64
|
-
width: `min(100%, ${Math.ceil(
|
|
63
|
+
width: `min(100%, ${Math.ceil(t)}px)`
|
|
65
64
|
};
|
|
66
|
-
return
|
|
67
|
-
const o =
|
|
68
|
-
|
|
65
|
+
return y.forEach((n, r) => {
|
|
66
|
+
const o = x(
|
|
67
|
+
t,
|
|
69
68
|
n.columns,
|
|
70
|
-
|
|
71
|
-
), a =
|
|
72
|
-
r === 0 ? Object.assign(e, a) : e[
|
|
69
|
+
W(n)
|
|
70
|
+
), a = p(o);
|
|
71
|
+
r === 0 ? Object.assign(e, a) : e[u(0, n.maxContainerWidth)] = a, b(
|
|
73
72
|
e,
|
|
74
73
|
n,
|
|
75
|
-
|
|
74
|
+
t,
|
|
76
75
|
o
|
|
77
76
|
);
|
|
78
77
|
}), e;
|
|
79
78
|
}
|
|
80
79
|
return l.reduce(
|
|
81
80
|
(e, n) => (e[`@container ${s} (max-width: ${n.maxContainerWidth}px)`] = {
|
|
82
|
-
gridColumn: `span ${
|
|
83
|
-
|
|
81
|
+
gridColumn: `span ${h(
|
|
82
|
+
i,
|
|
84
83
|
n.columns
|
|
85
84
|
)}`
|
|
86
85
|
}, e),
|
|
87
86
|
{
|
|
88
|
-
gridColumn: `span ${
|
|
89
|
-
|
|
87
|
+
gridColumn: `span ${h(
|
|
88
|
+
i,
|
|
90
89
|
c
|
|
91
90
|
)}`
|
|
92
91
|
}
|
|
93
92
|
);
|
|
94
93
|
}
|
|
95
|
-
const
|
|
94
|
+
const _ = {
|
|
96
95
|
/**
|
|
97
96
|
* Styles for the RHFormProvider wrapper.
|
|
98
97
|
*/
|
|
@@ -107,60 +106,38 @@ const E = {
|
|
|
107
106
|
* Styles for the form content container (inner div).
|
|
108
107
|
* Uses a vertical flex axis so growable fields can consume available height.
|
|
109
108
|
*/
|
|
110
|
-
contentRoot: ({ theme:
|
|
111
|
-
const e =
|
|
109
|
+
contentRoot: ({ theme: i, ownerState: t }) => {
|
|
110
|
+
const e = t;
|
|
112
111
|
return {
|
|
113
112
|
display: "flex",
|
|
114
113
|
flexDirection: "column",
|
|
115
114
|
alignItems: "stretch",
|
|
116
|
-
gap:
|
|
115
|
+
gap: i.vars.size.baseSpacings.sp4,
|
|
117
116
|
width: "100%",
|
|
118
117
|
height: "100%",
|
|
119
118
|
minHeight: 0,
|
|
120
119
|
boxSizing: "border-box",
|
|
121
120
|
containerName: s,
|
|
122
121
|
containerType: "inline-size",
|
|
123
|
-
padding:
|
|
122
|
+
padding: i.vars.size.baseSpacings.sp2,
|
|
124
123
|
...e?.fieldFlow === "verticalStack" && {
|
|
125
124
|
flex: "1 1 auto"
|
|
126
125
|
},
|
|
127
126
|
"& .MuiLinearProgress-root": {
|
|
128
|
-
backgroundColor:
|
|
127
|
+
backgroundColor: i.vars.palette.primary.opacity
|
|
129
128
|
}
|
|
130
129
|
};
|
|
131
130
|
},
|
|
132
|
-
/** Center the existing empty-state composition without imposing a host height. */
|
|
133
|
-
emptyState: ({ theme: t }) => ({
|
|
134
|
-
display: "flex",
|
|
135
|
-
alignItems: "center",
|
|
136
|
-
justifyContent: "center",
|
|
137
|
-
flex: "1 0 auto",
|
|
138
|
-
width: "100%",
|
|
139
|
-
minWidth: 0,
|
|
140
|
-
paddingBlock: t.vars.size.baseSpacings.sp4,
|
|
141
|
-
boxSizing: "border-box",
|
|
142
|
-
textAlign: "center",
|
|
143
|
-
[`& .${h.root}`]: {
|
|
144
|
-
height: "auto",
|
|
145
|
-
minWidth: 0,
|
|
146
|
-
boxSizing: "border-box",
|
|
147
|
-
backgroundColor: "transparent"
|
|
148
|
-
},
|
|
149
|
-
[`& .${h.wrapperTitleMessage}`]: {
|
|
150
|
-
maxWidth: "100%",
|
|
151
|
-
overflowWrap: "anywhere"
|
|
152
|
-
}
|
|
153
|
-
}),
|
|
154
131
|
/**
|
|
155
132
|
* Styles for normal-field flow segments.
|
|
156
133
|
*/
|
|
157
|
-
fieldsFlow: ({ theme:
|
|
134
|
+
fieldsFlow: ({ theme: i, ownerState: t }) => t?.fieldFlow === "verticalStack" ? {
|
|
158
135
|
display: "flex",
|
|
159
136
|
flexDirection: "column",
|
|
160
137
|
alignItems: "stretch",
|
|
161
138
|
alignContent: "stretch",
|
|
162
139
|
flexWrap: "nowrap",
|
|
163
|
-
gap:
|
|
140
|
+
gap: i.vars.size.baseSpacings.sp4,
|
|
164
141
|
width: "100%",
|
|
165
142
|
minWidth: 0,
|
|
166
143
|
boxSizing: "border-box",
|
|
@@ -171,38 +148,38 @@ const E = {
|
|
|
171
148
|
gridAutoFlow: "row",
|
|
172
149
|
alignItems: "start",
|
|
173
150
|
alignContent: "start",
|
|
174
|
-
gap:
|
|
151
|
+
gap: i.vars.size.baseSpacings.sp4,
|
|
175
152
|
width: "100%",
|
|
176
153
|
minWidth: 0,
|
|
177
154
|
boxSizing: "border-box",
|
|
178
155
|
flex: "0 0 auto",
|
|
179
|
-
...
|
|
156
|
+
...w
|
|
180
157
|
},
|
|
181
158
|
/** Arrange section containers without forcing narrow input columns. */
|
|
182
|
-
sectionsGrid: ({ theme:
|
|
159
|
+
sectionsGrid: ({ theme: i, ownerState: t }) => ({
|
|
183
160
|
display: "grid",
|
|
184
|
-
gridTemplateColumns:
|
|
185
|
-
gap:
|
|
161
|
+
gridTemplateColumns: t?.fieldFlow === "verticalStack" ? "minmax(0, 1fr)" : "repeat(auto-fit, minmax(min(100%, 22rem), 1fr))",
|
|
162
|
+
gap: i.vars.size.baseSpacings.sp5,
|
|
186
163
|
alignItems: "stretch",
|
|
187
164
|
width: "100%",
|
|
188
165
|
minWidth: 0,
|
|
189
166
|
boxSizing: "border-box"
|
|
190
167
|
}),
|
|
191
168
|
/** Surface for fields outside groups when at least one section is visible. */
|
|
192
|
-
ungroupedCard: ({ theme:
|
|
193
|
-
...
|
|
169
|
+
ungroupedCard: ({ theme: i }) => ({
|
|
170
|
+
...f(i),
|
|
194
171
|
containerName: s,
|
|
195
172
|
containerType: "inline-size"
|
|
196
173
|
}),
|
|
197
174
|
/**
|
|
198
175
|
* Styles for the optional form header rendered before the dynamic fields.
|
|
199
176
|
*/
|
|
200
|
-
formHeader: ({ theme:
|
|
177
|
+
formHeader: ({ theme: i }) => ({
|
|
201
178
|
width: "100%",
|
|
202
179
|
flex: "0 0 auto",
|
|
203
180
|
display: "flex",
|
|
204
181
|
flexDirection: "column",
|
|
205
|
-
gap:
|
|
182
|
+
gap: i.vars.size.baseSpacings.sp1,
|
|
206
183
|
minWidth: 0
|
|
207
184
|
}),
|
|
208
185
|
/**
|
|
@@ -228,17 +205,17 @@ const E = {
|
|
|
228
205
|
* `ownerState.gridColumnSpan` places adaptive fields on the semantic grid while
|
|
229
206
|
* PropertyValue keeps the rendered control fixed to the backend semantic width.
|
|
230
207
|
*/
|
|
231
|
-
fieldWrapper: ({ theme:
|
|
232
|
-
const e =
|
|
233
|
-
let r =
|
|
234
|
-
e?.isFullWidth !== !0 && typeof e?.gridColumnSpan == "number" && (r =
|
|
208
|
+
fieldWrapper: ({ theme: i, ownerState: t }) => {
|
|
209
|
+
const e = t, n = e?.fieldFlow === "verticalStack";
|
|
210
|
+
let r = g;
|
|
211
|
+
e?.isFullWidth !== !0 && typeof e?.gridColumnSpan == "number" && (r = v(
|
|
235
212
|
e.gridColumnSpan,
|
|
236
213
|
e.wrapperWidth
|
|
237
214
|
));
|
|
238
215
|
const o = {
|
|
239
216
|
display: "flex",
|
|
240
217
|
flexDirection: "column",
|
|
241
|
-
gap:
|
|
218
|
+
gap: i.vars.size.baseSpacings.sp1,
|
|
242
219
|
minWidth: 0
|
|
243
220
|
}, a = {
|
|
244
221
|
"& > *": {
|
|
@@ -350,12 +327,12 @@ const E = {
|
|
|
350
327
|
/**
|
|
351
328
|
* Styles for the section divider (for future use).
|
|
352
329
|
*/
|
|
353
|
-
sectionDivider: ({ theme:
|
|
330
|
+
sectionDivider: ({ theme: i }) => ({
|
|
354
331
|
width: "100%",
|
|
355
|
-
height:
|
|
356
|
-
backgroundColor:
|
|
357
|
-
marginTop:
|
|
358
|
-
marginBottom:
|
|
332
|
+
height: i.vars.size.borderStroke.container,
|
|
333
|
+
backgroundColor: i.vars.palette.border.main,
|
|
334
|
+
marginTop: i.vars.size.baseSpacings.sp2,
|
|
335
|
+
marginBottom: i.vars.size.baseSpacings.sp2
|
|
359
336
|
}),
|
|
360
337
|
/**
|
|
361
338
|
* Styles for the CheckableList wrapper inside the vertical grow field.
|
|
@@ -387,5 +364,5 @@ const E = {
|
|
|
387
364
|
})
|
|
388
365
|
};
|
|
389
366
|
export {
|
|
390
|
-
|
|
367
|
+
_ as componentStyles
|
|
391
368
|
};
|
|
@@ -10,7 +10,7 @@ export declare const DYNAMIC_FORM_KEY_COMPONENT = "M4LDynamicForm";
|
|
|
10
10
|
/**
|
|
11
11
|
* CSS class inventory for the component.
|
|
12
12
|
*/
|
|
13
|
-
export declare const DYNAMIC_FORM_CLASSES: Record<"label" | "helperText" | "
|
|
13
|
+
export declare const DYNAMIC_FORM_CLASSES: Record<"label" | "helperText" | "sectionDivider" | "contentRoot" | "formProvider" | "formHeader" | "formTitle" | "formDescription" | "fieldsFlow" | "sectionsGrid" | "ungroupedCard" | "fieldWrapper" | "submitFeedback" | "actionsRow" | "checkableListWrapper" | "fallbackEndIconChip", string>;
|
|
14
14
|
/**
|
|
15
15
|
* Default shortcut used by DynamicForm date-range fields when the backend omits or sends an invalid shortcut.
|
|
16
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EAGvB,MAAM,SAAS,CAAC;AAEjB;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,mBAAmB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EAGvB,MAAM,SAAS,CAAC;AAEjB;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,mBAAmB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,oBAAoB,mSAGhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wCAAwC,UAAU,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,0BAA0B,mJAQoB,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,oCAAoC,sDAGU,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,oBAAoB,6QAG/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB,6QAGhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB,6QAI9B,CAAC;AAEH,eAAO,MAAM,UAAU,EAAE,sBAKxB,CAAC"}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
export declare const DYNAMIC_FORM_DICTIONARY_KEY = "dynamic_form";
|
|
2
|
-
/** Shipped copy for deployments whose dictionary has not received the new keys yet. */
|
|
3
|
-
export declare const DYNAMIC_FORM_EMPTY_STATE_LABELS: {
|
|
4
|
-
title: string;
|
|
5
|
-
message: string;
|
|
6
|
-
};
|
|
7
2
|
export declare const getDynamicFormComponentsDictionary: () => string[];
|
|
8
3
|
export declare const DYNAMIC_FORM_DICTIONARY: {
|
|
9
|
-
/** Empty-state title when no visible field can mount. */
|
|
10
|
-
NO_VISIBLE_FIELDS_TITLE: string;
|
|
11
|
-
/** Explain why the form body contains no field controls. */
|
|
12
|
-
NO_VISIBLE_FIELDS_MESSAGE: string;
|
|
13
4
|
/** Shown when `field.label` is missing or blank; use `$1` for the field id (e.g. "Label not found $1"). */
|
|
14
5
|
LABEL_NOT_FOUND_MESSAGE: string;
|
|
15
6
|
IS_REQUIRED_MESSAGE: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/dictionary.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,iBAAiB,CAAC;AAE1D,
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/dictionary.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,iBAAiB,CAAC;AAE1D,eAAO,MAAM,kCAAkC,gBAE9C,CAAC;AAEF,eAAO,MAAM,uBAAuB;IAClC,2GAA2G;;;;;;;;;;;;IAY3G,oFAAoF;;IAEpF,kFAAkF;;IAElF,+EAA+E;;IAE/E,8DAA8D;;IAE9D,oEAAoE;;IAEpE,uFAAuF;;CAExF,CAAC"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
const _ = "dynamic_form", e = {
|
|
2
|
-
title: "No visible fields",
|
|
3
|
-
message: "This form has no fields to display at this time."
|
|
4
|
-
}, E = () => [_], s = {
|
|
5
|
-
/** Empty-state title when no visible field can mount. */
|
|
6
|
-
NO_VISIBLE_FIELDS_TITLE: `${_}.no_visible_fields_title`,
|
|
7
|
-
/** Explain why the form body contains no field controls. */
|
|
8
|
-
NO_VISIBLE_FIELDS_MESSAGE: `${_}.no_visible_fields_message`,
|
|
1
|
+
const _ = "dynamic_form", e = () => [_], E = {
|
|
9
2
|
/** Shown when `field.label` is missing or blank; use `$1` for the field id (e.g. "Label not found $1"). */
|
|
10
3
|
LABEL_NOT_FOUND_MESSAGE: `${_}.label_not_found_message`,
|
|
11
4
|
IS_REQUIRED_MESSAGE: `${_}.is_required_message`,
|
|
@@ -32,8 +25,7 @@ const _ = "dynamic_form", e = {
|
|
|
32
25
|
SECTION_CONTRACT_NOTICE: `${_}.section_contract_notice`
|
|
33
26
|
};
|
|
34
27
|
export {
|
|
35
|
-
|
|
28
|
+
E as DYNAMIC_FORM_DICTIONARY,
|
|
36
29
|
_ as DYNAMIC_FORM_DICTIONARY_KEY,
|
|
37
|
-
e as
|
|
38
|
-
E as getDynamicFormComponentsDictionary
|
|
30
|
+
e as getDynamicFormComponentsDictionary
|
|
39
31
|
};
|
|
@@ -8,7 +8,6 @@ export declare enum DynamicFormSlots {
|
|
|
8
8
|
formTitle = "formTitle",
|
|
9
9
|
formDescription = "formDescription",
|
|
10
10
|
fieldsFlow = "fieldsFlow",
|
|
11
|
-
emptyState = "emptyState",
|
|
12
11
|
sectionsGrid = "sectionsGrid",
|
|
13
12
|
ungroupedCard = "ungroupedCard",
|
|
14
13
|
fieldWrapper = "fieldWrapper",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicFormEnum.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicForm/slots/DynamicFormEnum.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,gBAAgB;IAC1B,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,eAAe,oBAAoB;IACnC,UAAU,eAAe;IACzB,
|
|
1
|
+
{"version":3,"file":"DynamicFormEnum.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicForm/slots/DynamicFormEnum.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,gBAAgB;IAC1B,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,eAAe,oBAAoB;IACnC,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,cAAc,mBAAmB;IACjC,oBAAoB,yBAAyB;IAC7C,mBAAmB,wBAAwB;CAC5C"}
|