@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.
Files changed (44) hide show
  1. package/components/DynamicForm/DynamicForm.d.ts.map +1 -1
  2. package/components/DynamicForm/DynamicForm.js +93 -96
  3. package/components/DynamicForm/DynamicForm.styles.d.ts.map +1 -1
  4. package/components/DynamicForm/DynamicForm.styles.js +68 -91
  5. package/components/DynamicForm/constants.d.ts +1 -1
  6. package/components/DynamicForm/constants.d.ts.map +1 -1
  7. package/components/DynamicForm/dictionary.d.ts +0 -9
  8. package/components/DynamicForm/dictionary.d.ts.map +1 -1
  9. package/components/DynamicForm/dictionary.js +3 -11
  10. package/components/DynamicForm/slots/DynamicFormEnum.d.ts +0 -1
  11. package/components/DynamicForm/slots/DynamicFormEnum.d.ts.map +1 -1
  12. package/components/DynamicForm/slots/DynamicFormEnum.js +1 -1
  13. package/components/DynamicForm/slots/DynamicFormSlots.d.ts +0 -3
  14. package/components/DynamicForm/slots/DynamicFormSlots.d.ts.map +1 -1
  15. package/components/DynamicForm/slots/DynamicFormSlots.js +39 -43
  16. package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.d.ts.map +1 -1
  17. package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.js +99 -128
  18. package/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/DynamicFormFieldsFlow.d.ts.map +1 -1
  19. package/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/DynamicFormFieldsFlow.js +20 -21
  20. package/components/DynamicForm/types.d.ts +3 -7
  21. package/components/DynamicForm/types.d.ts.map +1 -1
  22. package/components/extended/mui/Accordion/Accordion.d.ts.map +1 -1
  23. package/components/extended/mui/Accordion/Accordion.js +66 -64
  24. package/components/extended/mui/Accordion/slots/AccordionEnum.d.ts +1 -0
  25. package/components/extended/mui/Accordion/slots/AccordionEnum.d.ts.map +1 -1
  26. package/components/extended/mui/Accordion/slots/AccordionEnum.js +2 -2
  27. package/components/extended/mui/Accordion/slots/AccordionSlots.d.ts +3 -0
  28. package/components/extended/mui/Accordion/slots/AccordionSlots.d.ts.map +1 -1
  29. package/components/extended/mui/Accordion/slots/AccordionSlots.js +19 -15
  30. package/components/extended/mui/Accordion/styles.d.ts.map +1 -1
  31. package/components/extended/mui/Accordion/styles.js +12 -2
  32. package/components/extended/mui/Accordion/types.d.ts +4 -0
  33. package/components/extended/mui/Accordion/types.d.ts.map +1 -1
  34. package/package.json +7 -7
  35. package/components/DynamicForm/helpers/isRenderableDynamicFormField/index.d.ts +0 -2
  36. package/components/DynamicForm/helpers/isRenderableDynamicFormField/index.d.ts.map +0 -1
  37. package/components/DynamicForm/helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.d.ts +0 -4
  38. package/components/DynamicForm/helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.d.ts.map +0 -1
  39. package/components/DynamicForm/helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.js +0 -8
  40. package/components/DynamicForm/helpers/resolveEmptyStateLabel/index.d.ts +0 -2
  41. package/components/DynamicForm/helpers/resolveEmptyStateLabel/index.d.ts.map +0 -1
  42. package/components/DynamicForm/helpers/resolveEmptyStateLabel/resolveEmptyStateLabel.d.ts +0 -4
  43. package/components/DynamicForm/helpers/resolveEmptyStateLabel/resolveEmptyStateLabel.d.ts.map +0 -1
  44. 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,yFA2RtB,CAAC"}
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 Z, { forwardRef as $, useMemo as c, useState as tt, useEffect as et, useImperativeHandle as ot, useCallback as N } from "react";
3
- import P from "clsx";
4
- import { useModuleSkeleton as rt } from "@m4l/core";
5
- import { useComponentSize as it } from "../../hooks/useComponentSize/index.js";
6
- import { TEST_PROP_ID as st } from "../../test/constants_no_mock.js";
7
- import { LinearProgress as nt } from "../extended/mui/LinearProgress/index.js";
8
- import { DynamicFormContentRootStyled as at, DynamicFormFormProviderStyled as mt } from "./slots/DynamicFormSlots.js";
9
- import { DYNAMIC_FORM_CLASSES as b, EMPTY_DATA as ut } from "./constants.js";
10
- import { useDynamicForm as dt } from "./hooks/useDynamicForm/useDynamicForm.js";
11
- import { useDynamicFormData as lt } from "./hooks/useDynamicFormData/useDynamicFormData.js";
12
- import { DynamicFormContent as T } from "./subcomponents/DynamicFormContent/DynamicFormContent.js";
13
- import { useFieldsWithFetchedOptions as ct } from "./hooks/useFieldsWithFetchedOptions/useFieldsWithFetchedOptions.js";
14
- import { filterUnknownFieldsFromSubmit as ft } from "./helpers/filterUnknownFieldsFromSubmit/filterUnknownFieldsFromSubmit.js";
15
- import { mapOptionFieldValuesForSubmit as pt } from "./helpers/mapOptionFieldValuesForSubmit/mapOptionFieldValuesForSubmit.js";
16
- import { normalizeDynamicFormFields as St } from "./helpers/resolveFormSections/resolveFormSections.js";
17
- const Ft = $((C, k) => {
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: z,
20
- formInstanceId: _,
21
- inputEndpoint: A,
19
+ formId: k,
20
+ formInstanceId: z,
21
+ inputEndpoint: _,
22
22
  outputEndpoint: i,
23
- submitMode: s,
23
+ submitMode: n,
24
24
  initialData: D,
25
- formatInputData: H,
26
- formatOutputData: L,
27
- onSubmit: n,
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
- coupledStatusLoad: x,
39
- actionFormIntroProps: W,
40
- renderActions: V
41
- } = C, { currentSize: d } = it(g), U = rt(), {
42
- formData: Y,
43
- statusLoad: I,
44
- handleSubmit: w
45
- } = lt({
46
- formId: z,
47
- formInstanceId: _,
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: s,
49
+ submitMode: n,
51
50
  initialData: D,
52
- formatInputData: H,
53
- formatOutputData: L,
54
- onSubmit: n
55
- }), e = Y || D, S = c(
56
- () => St(e?.fields),
57
- [e?.fields]
58
- ), { fields: O } = ct({
59
- fields: S.fields
60
- }), t = c(() => e && {
61
- ...e,
62
- fields: O
63
- }, [O, e]), { initialValues: j, validationSchema: B } = dt(t || ut), [F, l] = tt(null);
64
- et(() => {
65
- if (!F)
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(() => l(null), 5e3);
66
+ const o = setTimeout(() => d(null), 5e3);
68
67
  return () => clearTimeout(o);
69
- }, [F]);
70
- const q = c(() => ({
71
- size: d,
68
+ }, [S]);
69
+ const B = c(() => ({
70
+ size: l,
72
71
  readOnly: a,
73
72
  fieldFlow: u
74
- }), [d, u, a]), R = Z.useRef(null), M = c(() => ({
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
- ot(k, () => R.current ?? M, [M]);
84
- const G = N(
82
+ te(C, () => O.current ?? R, [R]);
83
+ const q = M(
85
84
  async (o) => {
86
- if (!!!(i || s === "perField" || n))
85
+ if (!!!(i || n === "perField" || s))
87
86
  return;
88
- const K = i || s === "perField" ? w : n ?? (() => {
89
- }), Q = ft(
87
+ const J = i || n === "perField" ? I : s ?? (() => {
88
+ }), K = ce(
90
89
  o,
91
- t?.fields ?? []
92
- ), X = pt(Q, t?.fields ?? []);
90
+ e?.fields ?? []
91
+ ), Q = fe(K, e?.fields ?? []);
93
92
  try {
94
- await K(X), l("success");
93
+ await J(Q), d("success");
95
94
  } catch {
96
- l("error");
95
+ d("error");
97
96
  }
98
97
  },
99
- [w, n, i, t?.fields, s]
100
- ), J = N(
98
+ [I, s, i, e?.fields, n]
99
+ ), G = M(
101
100
  (o) => {
102
- l("error"), y?.(o);
101
+ d("error"), y?.(o);
103
102
  },
104
103
  [y]
105
104
  );
106
- return U ? /* @__PURE__ */ r(
107
- at,
105
+ return L ? /* @__PURE__ */ r(
106
+ se,
108
107
  {
109
- ownerState: q,
110
- className: P(v, b.contentRoot),
108
+ ownerState: B,
109
+ className: N(v, b.contentRoot),
111
110
  ...typeof m == "string" ? { "data-meta": m } : {},
112
- ...process.env.NODE_ENV !== "production" ? { [st]: f } : {},
113
- children: /* @__PURE__ */ r(nt, {})
111
+ ...process.env.NODE_ENV !== "production" ? { [ie]: f } : {},
112
+ children: /* @__PURE__ */ r(ne, {})
114
113
  }
115
- ) : t ? p ? /* @__PURE__ */ r(
116
- T,
114
+ ) : e ? p ? /* @__PURE__ */ r(
115
+ P,
117
116
  {
118
- data: t,
119
- statusLoad: x,
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: S.issues
126
+ contractIssues: F.issues
129
127
  }
130
128
  ) : /* @__PURE__ */ r(
131
- mt,
129
+ ae,
132
130
  {
133
- ref: R,
134
- values: j,
135
- validationSchema: B,
136
- onSubmit: G,
137
- onSubmitError: J,
138
- statusLoad: I,
131
+ ref: O,
132
+ values: Y,
133
+ validationSchema: j,
134
+ onSubmit: q,
135
+ onSubmitError: G,
136
+ statusLoad: U,
139
137
  mode: "onSubmit",
140
- className: P(v, b.contentRoot, b.formProvider),
138
+ className: N(v, b.contentRoot, b.formProvider),
141
139
  children: /* @__PURE__ */ r(
142
- T,
140
+ P,
143
141
  {
144
- data: t,
145
- statusLoad: I,
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: S.issues,
155
- actionFormIntroProps: W,
156
- renderActions: V,
157
- submitFeedbackStatus: F
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
- Ft.displayName = "DynamicForm";
160
+ Fe.displayName = "DynamicForm";
164
161
  export {
165
- Ft as DynamicForm
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":"AAGA,OAAO,KAAK,EAGV,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAgNjB,eAAO,MAAM,eAAe,EAAE,iBA0W7B,CAAC"}
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 { IMAGE_TEXT_CLASSES as h } from "../ImageText/constants.js";
3
- import { createDynamicFormSectionCardStyles as x } from "./subcomponents/DynamicFormSection/cardStyles.js";
4
- import { DYNAMIC_FORM_SEMANTIC_GRID_COLUMN_BREAKPOINTS as l, DYNAMIC_FORM_SEMANTIC_GRID_MAX_COLUMNS as c, resolveSemanticGridSpanForContainerWidth as S, resolveSemanticGridSpanForColumnCount as p, resolveSemanticGridContainerWidthForSpan as g } from "./helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.js";
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
- }, y = l.reduce(
12
- (t, i) => (t[`@container ${s} (max-width: ${i.maxContainerWidth}px)`] = {
13
- gridTemplateColumns: `repeat(${i.columns}, minmax(0, 1fr))`
14
- }, t),
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
- ), C = [
15
+ ), y = [
17
16
  {
18
17
  columns: c,
19
18
  minContainerWidth: (l[0]?.maxContainerWidth ?? 0) + 1
20
19
  },
21
20
  ...l.map(
22
- (t, i) => ({
23
- columns: t.columns,
24
- maxContainerWidth: t.maxContainerWidth,
25
- minContainerWidth: (l[i + 1]?.maxContainerWidth ?? -1) + 1
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 W(t) {
30
- return typeof t == "number" && Number.isFinite(t) && t > 0;
28
+ function C(i) {
29
+ return typeof i == "number" && Number.isFinite(i) && i > 0;
31
30
  }
32
- function u(t) {
31
+ function p(i) {
33
32
  return {
34
- gridColumn: `span ${t}`
33
+ gridColumn: `span ${i}`
35
34
  };
36
35
  }
37
- function f(t, i) {
36
+ function u(i, t) {
38
37
  const e = [];
39
- return t > 0 && e.push(`(min-width: ${t}px)`), typeof i == "number" && e.push(`(max-width: ${i}px)`), `@container ${s} ${e.join(
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 b(t) {
44
- return t.minContainerWidth > 0 ? t.minContainerWidth : t.maxContainerWidth ?? 1;
42
+ function W(i) {
43
+ return i.minContainerWidth > 0 ? i.minContainerWidth : i.maxContainerWidth ?? 1;
45
44
  }
46
- function v(t, i, e, n) {
45
+ function b(i, t, e, n) {
47
46
  for (let r = n - 1; r >= 1; r -= 1) {
48
- const o = g(
47
+ const o = S(
49
48
  e,
50
49
  r,
51
- i.columns
50
+ t.columns
52
51
  );
53
- o <= i.minContainerWidth || typeof i.maxContainerWidth == "number" && o > i.maxContainerWidth || (t[f(
52
+ o <= t.minContainerWidth || typeof t.maxContainerWidth == "number" && o > t.maxContainerWidth || (i[u(
54
53
  o,
55
- i.maxContainerWidth
56
- )] = u(r));
54
+ t.maxContainerWidth
55
+ )] = p(r));
57
56
  }
58
57
  }
59
- function T(t, i) {
60
- if (W(i)) {
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(i)}px)`
63
+ width: `min(100%, ${Math.ceil(t)}px)`
65
64
  };
66
- return C.forEach((n, r) => {
67
- const o = S(
68
- i,
65
+ return y.forEach((n, r) => {
66
+ const o = x(
67
+ t,
69
68
  n.columns,
70
- b(n)
71
- ), a = u(o);
72
- r === 0 ? Object.assign(e, a) : e[f(0, n.maxContainerWidth)] = a, v(
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
- i,
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 ${p(
83
- t,
81
+ gridColumn: `span ${h(
82
+ i,
84
83
  n.columns
85
84
  )}`
86
85
  }, e),
87
86
  {
88
- gridColumn: `span ${p(
89
- t,
87
+ gridColumn: `span ${h(
88
+ i,
90
89
  c
91
90
  )}`
92
91
  }
93
92
  );
94
93
  }
95
- const E = {
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: t, ownerState: i }) => {
111
- const e = i;
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: t.vars.size.baseSpacings.sp4,
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: t.vars.size.baseSpacings.sp2,
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: t.vars.palette.primary.opacity
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: t, ownerState: i }) => i?.fieldFlow === "verticalStack" ? {
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: t.vars.size.baseSpacings.sp4,
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: t.vars.size.baseSpacings.sp4,
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
- ...y
156
+ ...w
180
157
  },
181
158
  /** Arrange section containers without forcing narrow input columns. */
182
- sectionsGrid: ({ theme: t, ownerState: i }) => ({
159
+ sectionsGrid: ({ theme: i, ownerState: t }) => ({
183
160
  display: "grid",
184
- gridTemplateColumns: i?.fieldFlow === "verticalStack" ? "minmax(0, 1fr)" : "repeat(auto-fit, minmax(min(100%, 22rem), 1fr))",
185
- gap: t.vars.size.baseSpacings.sp5,
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: t }) => ({
193
- ...x(t),
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: t }) => ({
177
+ formHeader: ({ theme: i }) => ({
201
178
  width: "100%",
202
179
  flex: "0 0 auto",
203
180
  display: "flex",
204
181
  flexDirection: "column",
205
- gap: t.vars.size.baseSpacings.sp1,
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: t, ownerState: i }) => {
232
- const e = i, n = e?.fieldFlow === "verticalStack";
233
- let r = w;
234
- e?.isFullWidth !== !0 && typeof e?.gridColumnSpan == "number" && (r = T(
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: t.vars.size.baseSpacings.sp1,
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: t }) => ({
330
+ sectionDivider: ({ theme: i }) => ({
354
331
  width: "100%",
355
- height: t.vars.size.borderStroke.container,
356
- backgroundColor: t.vars.palette.border.main,
357
- marginTop: t.vars.size.baseSpacings.sp2,
358
- marginBottom: t.vars.size.baseSpacings.sp2
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
- E as componentStyles
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" | "emptyState" | "sectionDivider" | "contentRoot" | "formProvider" | "formHeader" | "formTitle" | "formDescription" | "fieldsFlow" | "sectionsGrid" | "ungroupedCard" | "fieldWrapper" | "submitFeedback" | "actionsRow" | "checkableListWrapper" | "fallbackEndIconChip", string>;
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,kTAGhC,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
+ {"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,uFAAuF;AACvF,eAAO,MAAM,+BAA+B;;;CAG3C,CAAC;AAEF,eAAO,MAAM,kCAAkC,gBAE9C,CAAC;AAEF,eAAO,MAAM,uBAAuB;IAClC,yDAAyD;;IAEzD,4DAA4D;;IAE5D,2GAA2G;;;;;;;;;;;;IAY3G,oFAAoF;;IAEpF,kFAAkF;;IAElF,+EAA+E;;IAE/E,8DAA8D;;IAE9D,oEAAoE;;IAEpE,uFAAuF;;CAExF,CAAC"}
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
- s as DYNAMIC_FORM_DICTIONARY,
28
+ E as DYNAMIC_FORM_DICTIONARY,
36
29
  _ as DYNAMIC_FORM_DICTIONARY_KEY,
37
- e as DYNAMIC_FORM_EMPTY_STATE_LABELS,
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,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"}
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"}