@m4l/components 9.71.0 → 9.71.1-beta-improvement-786-m4l-components-dynamic-form.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 (32) hide show
  1. package/components/DynamicForm/DynamicForm.d.ts.map +1 -1
  2. package/components/DynamicForm/DynamicForm.js +96 -93
  3. package/components/DynamicForm/DynamicForm.styles.d.ts.map +1 -1
  4. package/components/DynamicForm/DynamicForm.styles.js +91 -68
  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 +9 -0
  8. package/components/DynamicForm/dictionary.d.ts.map +1 -1
  9. package/components/DynamicForm/dictionary.js +11 -3
  10. package/components/DynamicForm/helpers/isRenderableDynamicFormField/index.d.ts +2 -0
  11. package/components/DynamicForm/helpers/isRenderableDynamicFormField/index.d.ts.map +1 -0
  12. package/components/DynamicForm/helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.d.ts +4 -0
  13. package/components/DynamicForm/helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.d.ts.map +1 -0
  14. package/components/DynamicForm/helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.js +8 -0
  15. package/components/DynamicForm/helpers/resolveEmptyStateLabel/index.d.ts +2 -0
  16. package/components/DynamicForm/helpers/resolveEmptyStateLabel/index.d.ts.map +1 -0
  17. package/components/DynamicForm/helpers/resolveEmptyStateLabel/resolveEmptyStateLabel.d.ts +4 -0
  18. package/components/DynamicForm/helpers/resolveEmptyStateLabel/resolveEmptyStateLabel.d.ts.map +1 -0
  19. package/components/DynamicForm/helpers/resolveEmptyStateLabel/resolveEmptyStateLabel.js +7 -0
  20. package/components/DynamicForm/slots/DynamicFormEnum.d.ts +1 -0
  21. package/components/DynamicForm/slots/DynamicFormEnum.d.ts.map +1 -1
  22. package/components/DynamicForm/slots/DynamicFormEnum.js +1 -1
  23. package/components/DynamicForm/slots/DynamicFormSlots.d.ts +3 -0
  24. package/components/DynamicForm/slots/DynamicFormSlots.d.ts.map +1 -1
  25. package/components/DynamicForm/slots/DynamicFormSlots.js +43 -39
  26. package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.d.ts.map +1 -1
  27. package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.js +128 -99
  28. package/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/DynamicFormFieldsFlow.d.ts.map +1 -1
  29. package/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/DynamicFormFieldsFlow.js +21 -20
  30. package/components/DynamicForm/types.d.ts +7 -3
  31. package/components/DynamicForm/types.d.ts.map +1 -1
  32. package/package.json +9 -9
@@ -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,yFAwRtB,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,yFA2RtB,CAAC"}
@@ -1,30 +1,30 @@
1
1
  import { jsx as r } from "@emotion/react/jsx-runtime";
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) => {
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) => {
18
18
  const {
19
- formId: k,
20
- formInstanceId: z,
21
- inputEndpoint: _,
19
+ formId: z,
20
+ formInstanceId: _,
21
+ inputEndpoint: A,
22
22
  outputEndpoint: i,
23
- submitMode: n,
23
+ submitMode: s,
24
24
  initialData: D,
25
- formatInputData: A,
26
- formatOutputData: H,
27
- onSubmit: s,
25
+ formatInputData: H,
26
+ formatOutputData: L,
27
+ onSubmit: n,
28
28
  onSubmitError: y,
29
29
  size: g,
30
30
  readOnly: a = !1,
@@ -35,42 +35,43 @@ const Fe = Z((T, C) => {
35
35
  fieldWrapperClassName: E,
36
36
  fieldFlow: u = "responsiveWrap",
37
37
  coupled: p = !1,
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: _,
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,
48
49
  outputEndpoint: i,
49
- submitMode: n,
50
+ submitMode: s,
50
51
  initialData: D,
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)
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)
65
66
  return;
66
- const o = setTimeout(() => d(null), 5e3);
67
+ const o = setTimeout(() => l(null), 5e3);
67
68
  return () => clearTimeout(o);
68
- }, [S]);
69
- const B = c(() => ({
70
- size: l,
69
+ }, [F]);
70
+ const q = c(() => ({
71
+ size: d,
71
72
  readOnly: a,
72
73
  fieldFlow: u
73
- }), [l, u, a]), O = X.useRef(null), R = c(() => ({
74
+ }), [d, u, a]), R = Z.useRef(null), M = c(() => ({
74
75
  formMethods: new Proxy({}, {
75
76
  get() {
76
77
  throw new Error("DynamicForm ref is not available until the form provider mounts.");
@@ -79,43 +80,44 @@ const Fe = Z((T, C) => {
79
80
  onSubmit: () => {
80
81
  }
81
82
  }), []);
82
- te(C, () => O.current ?? R, [R]);
83
- const q = M(
83
+ ot(k, () => R.current ?? M, [M]);
84
+ const G = N(
84
85
  async (o) => {
85
- if (!!!(i || n === "perField" || s))
86
+ if (!!!(i || s === "perField" || n))
86
87
  return;
87
- const J = i || n === "perField" ? I : s ?? (() => {
88
- }), K = ce(
88
+ const K = i || s === "perField" ? w : n ?? (() => {
89
+ }), Q = ft(
89
90
  o,
90
- e?.fields ?? []
91
- ), Q = fe(K, e?.fields ?? []);
91
+ t?.fields ?? []
92
+ ), X = pt(Q, t?.fields ?? []);
92
93
  try {
93
- await J(Q), d("success");
94
+ await K(X), l("success");
94
95
  } catch {
95
- d("error");
96
+ l("error");
96
97
  }
97
98
  },
98
- [I, s, i, e?.fields, n]
99
- ), G = M(
99
+ [w, n, i, t?.fields, s]
100
+ ), J = N(
100
101
  (o) => {
101
- d("error"), y?.(o);
102
+ l("error"), y?.(o);
102
103
  },
103
104
  [y]
104
105
  );
105
- return L ? /* @__PURE__ */ r(
106
- se,
106
+ return U ? /* @__PURE__ */ r(
107
+ at,
107
108
  {
108
- ownerState: B,
109
- className: N(v, b.contentRoot),
109
+ ownerState: q,
110
+ className: P(v, b.contentRoot),
110
111
  ...typeof m == "string" ? { "data-meta": m } : {},
111
- ...process.env.NODE_ENV !== "production" ? { [ie]: f } : {},
112
- children: /* @__PURE__ */ r(ne, {})
112
+ ...process.env.NODE_ENV !== "production" ? { [st]: f } : {},
113
+ children: /* @__PURE__ */ r(nt, {})
113
114
  }
114
- ) : e ? p ? /* @__PURE__ */ r(
115
- P,
115
+ ) : t ? p ? /* @__PURE__ */ r(
116
+ T,
116
117
  {
117
- data: e,
118
- currentSize: l,
118
+ data: t,
119
+ statusLoad: x,
120
+ currentSize: d,
119
121
  fieldWrapperClassName: E,
120
122
  dataTestId: f,
121
123
  dataMeta: m,
@@ -123,24 +125,25 @@ const Fe = Z((T, C) => {
123
125
  readOnly: a,
124
126
  suppressFormHeader: h,
125
127
  fieldFlow: u,
126
- contractIssues: F.issues
128
+ contractIssues: S.issues
127
129
  }
128
130
  ) : /* @__PURE__ */ r(
129
- ae,
131
+ mt,
130
132
  {
131
- ref: O,
132
- values: Y,
133
- validationSchema: j,
134
- onSubmit: q,
135
- onSubmitError: G,
136
- statusLoad: U,
133
+ ref: R,
134
+ values: j,
135
+ validationSchema: B,
136
+ onSubmit: G,
137
+ onSubmitError: J,
138
+ statusLoad: I,
137
139
  mode: "onSubmit",
138
- className: N(v, b.contentRoot, b.formProvider),
140
+ className: P(v, b.contentRoot, b.formProvider),
139
141
  children: /* @__PURE__ */ r(
140
- P,
142
+ T,
141
143
  {
142
- data: e,
143
- currentSize: l,
144
+ data: t,
145
+ statusLoad: I,
146
+ currentSize: d,
144
147
  fieldWrapperClassName: E,
145
148
  dataTestId: f,
146
149
  dataMeta: m,
@@ -148,16 +151,16 @@ const Fe = Z((T, C) => {
148
151
  readOnly: a,
149
152
  suppressFormHeader: h,
150
153
  fieldFlow: u,
151
- contractIssues: F.issues,
152
- actionFormIntroProps: x,
153
- renderActions: W,
154
- submitFeedbackStatus: S
154
+ contractIssues: S.issues,
155
+ actionFormIntroProps: W,
156
+ renderActions: V,
157
+ submitFeedbackStatus: F
155
158
  }
156
159
  )
157
160
  }
158
161
  ) : null;
159
162
  });
160
- Fe.displayName = "DynamicForm";
163
+ Ft.displayName = "DynamicForm";
161
164
  export {
162
- Fe as DynamicForm
165
+ Ft as DynamicForm
163
166
  };
@@ -1 +1 @@
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
+ {"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,97 +1,98 @@
1
1
  import { CHECKABLE_LIST_DEFAULT_MIN_HEIGHT as m } from "../CheckableList/constants.js";
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 = {
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 = {
5
6
  gridColumn: "1 / -1",
6
7
  maxWidth: "100%",
7
8
  width: "100%",
8
9
  minWidth: "0",
9
10
  flex: "1 1 100%"
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),
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),
14
15
  {}
15
- ), y = [
16
+ ), C = [
16
17
  {
17
18
  columns: c,
18
19
  minContainerWidth: (l[0]?.maxContainerWidth ?? 0) + 1
19
20
  },
20
21
  ...l.map(
21
- (i, t) => ({
22
- columns: i.columns,
23
- maxContainerWidth: i.maxContainerWidth,
24
- minContainerWidth: (l[t + 1]?.maxContainerWidth ?? -1) + 1
22
+ (t, i) => ({
23
+ columns: t.columns,
24
+ maxContainerWidth: t.maxContainerWidth,
25
+ minContainerWidth: (l[i + 1]?.maxContainerWidth ?? -1) + 1
25
26
  })
26
27
  )
27
28
  ];
28
- function C(i) {
29
- return typeof i == "number" && Number.isFinite(i) && i > 0;
29
+ function W(t) {
30
+ return typeof t == "number" && Number.isFinite(t) && t > 0;
30
31
  }
31
- function p(i) {
32
+ function u(t) {
32
33
  return {
33
- gridColumn: `span ${i}`
34
+ gridColumn: `span ${t}`
34
35
  };
35
36
  }
36
- function u(i, t) {
37
+ function f(t, i) {
37
38
  const e = [];
38
- return i > 0 && e.push(`(min-width: ${i}px)`), typeof t == "number" && e.push(`(max-width: ${t}px)`), `@container ${s} ${e.join(
39
+ return t > 0 && e.push(`(min-width: ${t}px)`), typeof i == "number" && e.push(`(max-width: ${i}px)`), `@container ${s} ${e.join(
39
40
  " and "
40
41
  )}`;
41
42
  }
42
- function W(i) {
43
- return i.minContainerWidth > 0 ? i.minContainerWidth : i.maxContainerWidth ?? 1;
43
+ function b(t) {
44
+ return t.minContainerWidth > 0 ? t.minContainerWidth : t.maxContainerWidth ?? 1;
44
45
  }
45
- function b(i, t, e, n) {
46
+ function v(t, i, e, n) {
46
47
  for (let r = n - 1; r >= 1; r -= 1) {
47
- const o = S(
48
+ const o = g(
48
49
  e,
49
50
  r,
50
- t.columns
51
+ i.columns
51
52
  );
52
- o <= t.minContainerWidth || typeof t.maxContainerWidth == "number" && o > t.maxContainerWidth || (i[u(
53
+ o <= i.minContainerWidth || typeof i.maxContainerWidth == "number" && o > i.maxContainerWidth || (t[f(
53
54
  o,
54
- t.maxContainerWidth
55
- )] = p(r));
55
+ i.maxContainerWidth
56
+ )] = u(r));
56
57
  }
57
58
  }
58
- function v(i, t) {
59
- if (C(t)) {
59
+ function T(t, i) {
60
+ if (W(i)) {
60
61
  const e = {
61
62
  justifySelf: "start",
62
63
  maxWidth: "100%",
63
- width: `min(100%, ${Math.ceil(t)}px)`
64
+ width: `min(100%, ${Math.ceil(i)}px)`
64
65
  };
65
- return y.forEach((n, r) => {
66
- const o = x(
67
- t,
66
+ return C.forEach((n, r) => {
67
+ const o = S(
68
+ i,
68
69
  n.columns,
69
- W(n)
70
- ), a = p(o);
71
- r === 0 ? Object.assign(e, a) : e[u(0, n.maxContainerWidth)] = a, b(
70
+ b(n)
71
+ ), a = u(o);
72
+ r === 0 ? Object.assign(e, a) : e[f(0, n.maxContainerWidth)] = a, v(
72
73
  e,
73
74
  n,
74
- t,
75
+ i,
75
76
  o
76
77
  );
77
78
  }), e;
78
79
  }
79
80
  return l.reduce(
80
81
  (e, n) => (e[`@container ${s} (max-width: ${n.maxContainerWidth}px)`] = {
81
- gridColumn: `span ${h(
82
- i,
82
+ gridColumn: `span ${p(
83
+ t,
83
84
  n.columns
84
85
  )}`
85
86
  }, e),
86
87
  {
87
- gridColumn: `span ${h(
88
- i,
88
+ gridColumn: `span ${p(
89
+ t,
89
90
  c
90
91
  )}`
91
92
  }
92
93
  );
93
94
  }
94
- const _ = {
95
+ const E = {
95
96
  /**
96
97
  * Styles for the RHFormProvider wrapper.
97
98
  */
@@ -106,38 +107,60 @@ const _ = {
106
107
  * Styles for the form content container (inner div).
107
108
  * Uses a vertical flex axis so growable fields can consume available height.
108
109
  */
109
- contentRoot: ({ theme: i, ownerState: t }) => {
110
- const e = t;
110
+ contentRoot: ({ theme: t, ownerState: i }) => {
111
+ const e = i;
111
112
  return {
112
113
  display: "flex",
113
114
  flexDirection: "column",
114
115
  alignItems: "stretch",
115
- gap: i.vars.size.baseSpacings.sp4,
116
+ gap: t.vars.size.baseSpacings.sp4,
116
117
  width: "100%",
117
118
  height: "100%",
118
119
  minHeight: 0,
119
120
  boxSizing: "border-box",
120
121
  containerName: s,
121
122
  containerType: "inline-size",
122
- padding: i.vars.size.baseSpacings.sp2,
123
+ padding: t.vars.size.baseSpacings.sp2,
123
124
  ...e?.fieldFlow === "verticalStack" && {
124
125
  flex: "1 1 auto"
125
126
  },
126
127
  "& .MuiLinearProgress-root": {
127
- backgroundColor: i.vars.palette.primary.opacity
128
+ backgroundColor: t.vars.palette.primary.opacity
128
129
  }
129
130
  };
130
131
  },
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
+ }),
131
154
  /**
132
155
  * Styles for normal-field flow segments.
133
156
  */
134
- fieldsFlow: ({ theme: i, ownerState: t }) => t?.fieldFlow === "verticalStack" ? {
157
+ fieldsFlow: ({ theme: t, ownerState: i }) => i?.fieldFlow === "verticalStack" ? {
135
158
  display: "flex",
136
159
  flexDirection: "column",
137
160
  alignItems: "stretch",
138
161
  alignContent: "stretch",
139
162
  flexWrap: "nowrap",
140
- gap: i.vars.size.baseSpacings.sp4,
163
+ gap: t.vars.size.baseSpacings.sp4,
141
164
  width: "100%",
142
165
  minWidth: 0,
143
166
  boxSizing: "border-box",
@@ -148,38 +171,38 @@ const _ = {
148
171
  gridAutoFlow: "row",
149
172
  alignItems: "start",
150
173
  alignContent: "start",
151
- gap: i.vars.size.baseSpacings.sp4,
174
+ gap: t.vars.size.baseSpacings.sp4,
152
175
  width: "100%",
153
176
  minWidth: 0,
154
177
  boxSizing: "border-box",
155
178
  flex: "0 0 auto",
156
- ...w
179
+ ...y
157
180
  },
158
181
  /** Arrange section containers without forcing narrow input columns. */
159
- sectionsGrid: ({ theme: i, ownerState: t }) => ({
182
+ sectionsGrid: ({ theme: t, ownerState: i }) => ({
160
183
  display: "grid",
161
- gridTemplateColumns: t?.fieldFlow === "verticalStack" ? "minmax(0, 1fr)" : "repeat(auto-fit, minmax(min(100%, 22rem), 1fr))",
162
- gap: i.vars.size.baseSpacings.sp5,
184
+ gridTemplateColumns: i?.fieldFlow === "verticalStack" ? "minmax(0, 1fr)" : "repeat(auto-fit, minmax(min(100%, 22rem), 1fr))",
185
+ gap: t.vars.size.baseSpacings.sp5,
163
186
  alignItems: "stretch",
164
187
  width: "100%",
165
188
  minWidth: 0,
166
189
  boxSizing: "border-box"
167
190
  }),
168
191
  /** Surface for fields outside groups when at least one section is visible. */
169
- ungroupedCard: ({ theme: i }) => ({
170
- ...f(i),
192
+ ungroupedCard: ({ theme: t }) => ({
193
+ ...x(t),
171
194
  containerName: s,
172
195
  containerType: "inline-size"
173
196
  }),
174
197
  /**
175
198
  * Styles for the optional form header rendered before the dynamic fields.
176
199
  */
177
- formHeader: ({ theme: i }) => ({
200
+ formHeader: ({ theme: t }) => ({
178
201
  width: "100%",
179
202
  flex: "0 0 auto",
180
203
  display: "flex",
181
204
  flexDirection: "column",
182
- gap: i.vars.size.baseSpacings.sp1,
205
+ gap: t.vars.size.baseSpacings.sp1,
183
206
  minWidth: 0
184
207
  }),
185
208
  /**
@@ -205,17 +228,17 @@ const _ = {
205
228
  * `ownerState.gridColumnSpan` places adaptive fields on the semantic grid while
206
229
  * PropertyValue keeps the rendered control fixed to the backend semantic width.
207
230
  */
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(
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(
212
235
  e.gridColumnSpan,
213
236
  e.wrapperWidth
214
237
  ));
215
238
  const o = {
216
239
  display: "flex",
217
240
  flexDirection: "column",
218
- gap: i.vars.size.baseSpacings.sp1,
241
+ gap: t.vars.size.baseSpacings.sp1,
219
242
  minWidth: 0
220
243
  }, a = {
221
244
  "& > *": {
@@ -327,12 +350,12 @@ const _ = {
327
350
  /**
328
351
  * Styles for the section divider (for future use).
329
352
  */
330
- sectionDivider: ({ theme: i }) => ({
353
+ sectionDivider: ({ theme: t }) => ({
331
354
  width: "100%",
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
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
336
359
  }),
337
360
  /**
338
361
  * Styles for the CheckableList wrapper inside the vertical grow field.
@@ -364,5 +387,5 @@ const _ = {
364
387
  })
365
388
  };
366
389
  export {
367
- _ as componentStyles
390
+ E as componentStyles
368
391
  };
@@ -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" | "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" | "emptyState" | "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,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
+ {"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,6 +1,15 @@
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
+ };
2
7
  export declare const getDynamicFormComponentsDictionary: () => string[];
3
8
  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;
4
13
  /** Shown when `field.label` is missing or blank; use `$1` for the field id (e.g. "Label not found $1"). */
5
14
  LABEL_NOT_FOUND_MESSAGE: string;
6
15
  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,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
+ {"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,4 +1,11 @@
1
- const _ = "dynamic_form", e = () => [_], E = {
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`,
2
9
  /** Shown when `field.label` is missing or blank; use `$1` for the field id (e.g. "Label not found $1"). */
3
10
  LABEL_NOT_FOUND_MESSAGE: `${_}.label_not_found_message`,
4
11
  IS_REQUIRED_MESSAGE: `${_}.is_required_message`,
@@ -25,7 +32,8 @@ const _ = "dynamic_form", e = () => [_], E = {
25
32
  SECTION_CONTRACT_NOTICE: `${_}.section_contract_notice`
26
33
  };
27
34
  export {
28
- E as DYNAMIC_FORM_DICTIONARY,
35
+ s as DYNAMIC_FORM_DICTIONARY,
29
36
  _ as DYNAMIC_FORM_DICTIONARY_KEY,
30
- e as getDynamicFormComponentsDictionary
37
+ e as DYNAMIC_FORM_EMPTY_STATE_LABELS,
38
+ E as getDynamicFormComponentsDictionary
31
39
  };
@@ -0,0 +1,2 @@
1
+ export { isRenderableDynamicFormField } from './isRenderableDynamicFormField';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/helpers/isRenderableDynamicFormField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Field } from '../../types';
2
+ /** Identify visible content records that can mount a DynamicForm field row. */
3
+ export declare function isRenderableDynamicFormField(field: Field): boolean;
4
+ //# sourceMappingURL=isRenderableDynamicFormField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isRenderableDynamicFormField.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIzC,+EAA+E;AAC/E,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAKlE"}