@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
@@ -0,0 +1,8 @@
1
+ import { isSupportedInformationalField as o } from "../fieldContractAllowlist/fieldContractAllowlist.js";
2
+ import { isSectionField as i } from "../resolveFormSections/resolveFormSections.js";
3
+ function e(r) {
4
+ return !i(r) && (o(r) || typeof r.name == "string" && r.name.trim() !== "");
5
+ }
6
+ export {
7
+ e as isRenderableDynamicFormField
8
+ };
@@ -0,0 +1,2 @@
1
+ export { resolveEmptyStateLabel } from './resolveEmptyStateLabel';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/helpers/resolveEmptyStateLabel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { GetLabelType } from '@m4l/core';
2
+ /** Resolve empty-state copy while a deployment's dictionary receives the new entries. */
3
+ export declare function resolveEmptyStateLabel(getLabel: GetLabelType, key: string, fallback: string): string;
4
+ //# sourceMappingURL=resolveEmptyStateLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveEmptyStateLabel.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/helpers/resolveEmptyStateLabel/resolveEmptyStateLabel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,yFAAyF;AACzF,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACf,MAAM,CAMR"}
@@ -0,0 +1,7 @@
1
+ function o(l, e, n) {
2
+ const t = l(e);
3
+ return !t || t === e || t === `ND:${e}` || t === `N_D:[${e}]` ? n : t;
4
+ }
5
+ export {
6
+ o as resolveEmptyStateLabel
7
+ };
@@ -8,6 +8,7 @@ export declare enum DynamicFormSlots {
8
8
  formTitle = "formTitle",
9
9
  formDescription = "formDescription",
10
10
  fieldsFlow = "fieldsFlow",
11
+ emptyState = "emptyState",
11
12
  sectionsGrid = "sectionsGrid",
12
13
  ungroupedCard = "ungroupedCard",
13
14
  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,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,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,4 +1,4 @@
1
- var r = /* @__PURE__ */ ((e) => (e.contentRoot = "contentRoot", e.formProvider = "formProvider", e.formHeader = "formHeader", e.formTitle = "formTitle", e.formDescription = "formDescription", e.fieldsFlow = "fieldsFlow", e.sectionsGrid = "sectionsGrid", e.ungroupedCard = "ungroupedCard", e.fieldWrapper = "fieldWrapper", e.submitFeedback = "submitFeedback", e.actionsRow = "actionsRow", e.label = "label", e.helperText = "helperText", e.sectionDivider = "sectionDivider", e.checkableListWrapper = "checkableListWrapper", e.fallbackEndIconChip = "fallbackEndIconChip", e))(r || {});
1
+ var r = /* @__PURE__ */ ((e) => (e.contentRoot = "contentRoot", e.formProvider = "formProvider", e.formHeader = "formHeader", e.formTitle = "formTitle", e.formDescription = "formDescription", e.fieldsFlow = "fieldsFlow", e.emptyState = "emptyState", e.sectionsGrid = "sectionsGrid", e.ungroupedCard = "ungroupedCard", e.fieldWrapper = "fieldWrapper", e.submitFeedback = "submitFeedback", e.actionsRow = "actionsRow", e.label = "label", e.helperText = "helperText", e.sectionDivider = "sectionDivider", e.checkableListWrapper = "checkableListWrapper", e.fallbackEndIconChip = "fallbackEndIconChip", e))(r || {});
2
2
  export {
3
3
  r as DynamicFormSlots
4
4
  };
@@ -19,6 +19,9 @@ export declare const DynamicFormFormDescriptionStyled: import('@emotion/styled')
19
19
  export declare const DynamicFormFieldsFlowStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
20
20
  ownerState?: (Partial<import('../types').DynamicFormOwnerState> & Record<string, unknown>) | undefined;
21
21
  }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
22
+ export declare const DynamicFormEmptyStateStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
23
+ ownerState?: (Partial<import('../types').DynamicFormOwnerState> & Record<string, unknown>) | undefined;
24
+ }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
22
25
  export declare const DynamicFormSectionsGridStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
23
26
  ownerState?: (Partial<import('../types').DynamicFormOwnerState> & Record<string, unknown>) | undefined;
24
27
  }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicFormSlots.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicForm/slots/DynamicFormSlots.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC5G,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGpD,eAAO,MAAM,iCAAiC;;UAGb,CAAC;AAGlC,eAAO,MAAM,6BAA6B,EAAmD,CAC3F,CAAC,SAAS,YAAY,EAEtB,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,KAChE,YAAY,CAAC;AAElB,eAAO,MAAM,4BAA4B;;6NAGT,CAAC;AAEjC,eAAO,MAAM,2BAA2B;;iNAGT,CAAC;AAEhC,eAAO,MAAM,0BAA0B;;UAGT,CAAC;AAE/B,eAAO,MAAM,gCAAgC;;UAGT,CAAC;AAErC,eAAO,MAAM,2BAA2B;;6NAGT,CAAC;AAEhC,eAAO,MAAM,6BAA6B;;6NAGT,CAAC;AAElC,eAAO,MAAM,8BAA8B;;6NAGT,CAAC;AAEnC,eAAO,MAAM,6BAA6B;;UAGT,CAAC;AAElC,eAAO,MAAM,+BAA+B;;UAGT,CAAC;AAEpC,eAAO,MAAM,2BAA2B;;UAGT,CAAC;AAEhC,eAAO,MAAM,sBAAsB;;6NAGT,CAAC;AAE3B,eAAO,MAAM,2BAA2B;;6NAGT,CAAC;AAEhC,eAAO,MAAM,+BAA+B;;6NAGT,CAAC;AAEpC,eAAO,MAAM,qCAAqC;;6NAGT,CAAC;AAE1C,eAAO,MAAM,oCAAoC;;UAGT,CAAC"}
1
+ {"version":3,"file":"DynamicFormSlots.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicForm/slots/DynamicFormSlots.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC5G,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGpD,eAAO,MAAM,iCAAiC;;UAGb,CAAC;AAGlC,eAAO,MAAM,6BAA6B,EAAmD,CAC3F,CAAC,SAAS,YAAY,EAEtB,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,KAChE,YAAY,CAAC;AAElB,eAAO,MAAM,4BAA4B;;6NAGT,CAAC;AAEjC,eAAO,MAAM,2BAA2B;;iNAGT,CAAC;AAEhC,eAAO,MAAM,0BAA0B;;UAGT,CAAC;AAE/B,eAAO,MAAM,gCAAgC;;UAGT,CAAC;AAErC,eAAO,MAAM,2BAA2B;;6NAGT,CAAC;AAEhC,eAAO,MAAM,2BAA2B;;6NAGT,CAAC;AAEhC,eAAO,MAAM,6BAA6B;;6NAGT,CAAC;AAElC,eAAO,MAAM,8BAA8B;;6NAGT,CAAC;AAEnC,eAAO,MAAM,6BAA6B;;UAGT,CAAC;AAElC,eAAO,MAAM,+BAA+B;;UAGT,CAAC;AAEpC,eAAO,MAAM,2BAA2B;;UAGT,CAAC;AAEhC,eAAO,MAAM,sBAAsB;;6NAGT,CAAC;AAE3B,eAAO,MAAM,2BAA2B;;6NAGT,CAAC;AAEhC,eAAO,MAAM,+BAA+B;;6NAGT,CAAC;AAEpC,eAAO,MAAM,qCAAqC;;6NAGT,CAAC;AAE1C,eAAO,MAAM,oCAAoC;;UAGT,CAAC"}
@@ -2,76 +2,80 @@ import { styled as o } from "@mui/material/styles";
2
2
  import { Box as m } from "@mui/material";
3
3
  import { Typography as i } from "@m4l/base";
4
4
  import { DynamicFormSlots as e } from "./DynamicFormEnum.js";
5
- import { componentStyles as r } from "../DynamicForm.styles.js";
6
- import { DYNAMIC_FORM_KEY_COMPONENT as t } from "../constants.js";
5
+ import { componentStyles as t } from "../DynamicForm.styles.js";
6
+ import { DYNAMIC_FORM_KEY_COMPONENT as r } from "../constants.js";
7
7
  import { RHFormProvider as n } from "../../hook-form/RHFormProvider/RHFormProvider.js";
8
8
  import { Chip as a } from "../../Chip/Chip.js";
9
9
  const l = o(n, {
10
- name: t,
10
+ name: r,
11
11
  slot: e.formProvider
12
- })(r?.formProvider), S = l, v = o("div", {
13
- name: t,
12
+ })(t?.formProvider), S = l, v = o("div", {
13
+ name: r,
14
14
  slot: e.contentRoot
15
- })(r?.contentRoot), b = o("header", {
16
- name: t,
15
+ })(t?.contentRoot), b = o("header", {
16
+ name: r,
17
17
  slot: e.formHeader
18
- })(r?.formHeader), h = o(i, {
19
- name: t,
18
+ })(t?.formHeader), h = o(i, {
19
+ name: r,
20
20
  slot: e.formTitle
21
- })(r?.formTitle), C = o(i, {
22
- name: t,
21
+ })(t?.formTitle), C = o(i, {
22
+ name: r,
23
23
  slot: e.formDescription
24
- })(r?.formDescription), k = o("div", {
25
- name: t,
24
+ })(t?.formDescription), k = o("div", {
25
+ name: r,
26
26
  slot: e.fieldsFlow
27
- })(r?.fieldsFlow), u = o("div", {
28
- name: t,
27
+ })(t?.fieldsFlow), u = o("div", {
28
+ name: r,
29
+ slot: e.emptyState
30
+ })(t?.emptyState), R = o("div", {
31
+ name: r,
29
32
  slot: e.sectionsGrid
30
- })(r?.sectionsGrid), R = o("div", {
31
- name: t,
33
+ })(t?.sectionsGrid), T = o("div", {
34
+ name: r,
32
35
  slot: e.ungroupedCard
33
- })(r?.ungroupedCard), T = o(m, {
34
- name: t,
36
+ })(t?.ungroupedCard), w = o(m, {
37
+ name: r,
35
38
  slot: e.fieldWrapper
36
- })(r?.fieldWrapper), w = o(m, {
37
- name: t,
39
+ })(t?.fieldWrapper), E = o(m, {
40
+ name: r,
38
41
  slot: e.submitFeedback
39
- })(r?.submitFeedback), P = o(m, {
40
- name: t,
42
+ })(t?.submitFeedback), P = o(m, {
43
+ name: r,
41
44
  slot: e.actionsRow
42
- })(r?.actionsRow);
45
+ })(t?.actionsRow);
43
46
  o("div", {
44
- name: t,
47
+ name: r,
45
48
  slot: e.label
46
- })(r?.label);
49
+ })(t?.label);
47
50
  o("div", {
48
- name: t,
51
+ name: r,
49
52
  slot: e.helperText
50
- })(r?.helperText);
53
+ })(t?.helperText);
51
54
  o("div", {
52
- name: t,
55
+ name: r,
53
56
  slot: e.sectionDivider
54
- })(r?.sectionDivider);
57
+ })(t?.sectionDivider);
55
58
  const W = o("div", {
56
- name: t,
59
+ name: r,
57
60
  slot: e.checkableListWrapper
58
- })(r?.checkableListWrapper), E = o(a, {
59
- name: t,
61
+ })(t?.checkableListWrapper), g = o(a, {
62
+ name: r,
60
63
  slot: e.fallbackEndIconChip
61
- })(r?.fallbackEndIconChip);
64
+ })(t?.fallbackEndIconChip);
62
65
  export {
63
66
  P as DynamicFormActionsRowStyled,
64
67
  W as DynamicFormCheckableListWrapperStyled,
65
68
  v as DynamicFormContentRootStyled,
66
- E as DynamicFormFallbackEndIconChipStyled,
67
- T as DynamicFormFieldWrapperStyled,
69
+ u as DynamicFormEmptyStateStyled,
70
+ g as DynamicFormFallbackEndIconChipStyled,
71
+ w as DynamicFormFieldWrapperStyled,
68
72
  k as DynamicFormFieldsFlowStyled,
69
73
  C as DynamicFormFormDescriptionStyled,
70
74
  b as DynamicFormFormHeaderStyled,
71
75
  S as DynamicFormFormProviderStyled,
72
76
  l as DynamicFormFormProviderStyledBase,
73
77
  h as DynamicFormFormTitleStyled,
74
- u as DynamicFormSectionsGridStyled,
75
- w as DynamicFormSubmitFeedbackStyled,
76
- R as DynamicFormUngroupedCardStyled
78
+ R as DynamicFormSectionsGridStyled,
79
+ E as DynamicFormSubmitFeedbackStyled,
80
+ T as DynamicFormUngroupedCardStyled
77
81
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicFormContent.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,uBAAuB,EAExB,MAAM,aAAa,CAAC;AAerB,eAAO,MAAM,kBAAkB,oHAqL7B,CAAC"}
1
+ {"version":3,"file":"DynamicFormContent.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,uBAAuB,EAExB,MAAM,aAAa,CAAC;AAgBrB,eAAO,MAAM,kBAAkB,oHAgN7B,CAAC"}
@@ -1,82 +1,86 @@
1
- import { jsx as o, jsxs as N } from "@emotion/react/jsx-runtime";
2
- import { forwardRef as H, useMemo as b } from "react";
3
- import k from "clsx";
4
- import { useModuleDictionary as U } from "@m4l/core";
5
- import { NotificationCheckCircleFill as B, NotificationWarningFill as G } from "@m4l/icons";
6
- import { Icon as P } from "@m4l/base";
7
- import { TEST_PROP_ID as W } from "../../../../test/constants_no_mock.js";
8
- import { ActionsContainer as Y } from "../../../CommonActions/components/ActionsContainer/ActionsContainer.js";
9
- import { ActionFormIntro as j } from "../../../CommonActions/components/ActionFormIntro/ActionFormIntro.js";
10
- import { useDynamicFormConditionals as L } from "../../hooks/useDynamicFormConditionals/useDynamicFormConditionals.js";
11
- import { DYNAMIC_FORM_DICTIONARY as f } from "../../dictionary.js";
12
- import { DYNAMIC_FORM_CLASSES as l } from "../../constants.js";
13
- import { DynamicFormFieldsFlow as V } from "../DynamicFormFieldsFlow/DynamicFormFieldsFlow.js";
14
- import { DynamicFormSection as q } from "../DynamicFormSection/DynamicFormSection.js";
15
- import { DynamicFormSectionsGridStyled as J, DynamicFormSubmitFeedbackStyled as K, DynamicFormContentRootStyled as Q, DynamicFormFormHeaderStyled as X, DynamicFormFormTitleStyled as Z, DynamicFormFormDescriptionStyled as $, DynamicFormUngroupedCardStyled as oo, DynamicFormActionsRowStyled as eo } from "../../slots/DynamicFormSlots.js";
16
- import { resolveFormHeader as ro } from "../../helpers/resolveFormHeader/resolveFormHeader.js";
17
- import { resolveFormSections as to } from "../../helpers/resolveFormSections/resolveFormSections.js";
18
- import { Chip as g } from "../../../Chip/Chip.js";
19
- const io = H((_, E) => {
1
+ import { jsx as e, jsxs as g } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as G, useMemo as b } from "react";
3
+ import P from "clsx";
4
+ import { useModuleDictionary as V } from "@m4l/core";
5
+ import { NotificationCheckCircleFill as W, NotificationWarningFill as j, LegacyS3NoItemSelectedNoSelectedOutlined as q } from "@m4l/icons";
6
+ import { Icon as J } from "@m4l/base";
7
+ import { TEST_PROP_ID as K } from "../../../../test/constants_no_mock.js";
8
+ import { ActionsContainer as Q } from "../../../CommonActions/components/ActionsContainer/ActionsContainer.js";
9
+ import { ActionFormIntro as X } from "../../../CommonActions/components/ActionFormIntro/ActionFormIntro.js";
10
+ import { useDynamicFormConditionals as Z } from "../../hooks/useDynamicFormConditionals/useDynamicFormConditionals.js";
11
+ import { DYNAMIC_FORM_DICTIONARY as s, DYNAMIC_FORM_EMPTY_STATE_LABELS as T } from "../../dictionary.js";
12
+ import { DYNAMIC_FORM_CLASSES as n } from "../../constants.js";
13
+ import { DynamicFormFieldsFlow as $ } from "../DynamicFormFieldsFlow/DynamicFormFieldsFlow.js";
14
+ import { DynamicFormSection as ee } from "../DynamicFormSection/DynamicFormSection.js";
15
+ import { DynamicFormSectionsGridStyled as oe, DynamicFormSubmitFeedbackStyled as te, DynamicFormContentRootStyled as re, DynamicFormFormHeaderStyled as ie, DynamicFormFormTitleStyled as se, DynamicFormFormDescriptionStyled as ne, DynamicFormEmptyStateStyled as ce, DynamicFormUngroupedCardStyled as ae, DynamicFormActionsRowStyled as le } from "../../slots/DynamicFormSlots.js";
16
+ import { isRenderableDynamicFormField as me } from "../../helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.js";
17
+ import { resolveFormHeader as de } from "../../helpers/resolveFormHeader/resolveFormHeader.js";
18
+ import { ImageText as pe } from "../../../ImageText/ImageText.js";
19
+ import { resolveEmptyStateLabel as A } from "../../helpers/resolveEmptyStateLabel/resolveEmptyStateLabel.js";
20
+ import { resolveFormSections as Se } from "../../helpers/resolveFormSections/resolveFormSections.js";
21
+ import { Chip as M } from "../../../Chip/Chip.js";
22
+ const fe = G((R, O) => {
20
23
  const {
21
- data: s,
22
- contractIssues: R = [],
23
- currentSize: r,
24
- fieldWrapperClassName: F,
25
- dataTestId: T,
24
+ data: c,
25
+ contractIssues: v = [],
26
+ currentSize: o,
27
+ fieldWrapperClassName: y,
28
+ dataTestId: L,
26
29
  dataMeta: u,
27
- coupled: S = !1,
28
- actionFormIntroProps: A,
29
- renderActions: y,
30
- readOnly: t = !1,
31
- suppressFormHeader: M = !0,
30
+ coupled: h = !1,
31
+ actionFormIntroProps: w,
32
+ renderActions: I,
33
+ readOnly: r = !1,
34
+ suppressFormHeader: z = !0,
32
35
  submitFeedbackStatus: i,
33
- fieldFlow: n = "responsiveWrap"
34
- } = _, { getLabel: h } = U(), { visibleFields: C } = L(s), c = M ? null : ro(s.form), a = b(
35
- () => to(s.fields ?? []),
36
- [s.fields]
37
- ), v = new Set(C.map((e) => e.id)), D = C.filter((e) => !a.ownerByFieldId.has(e.id)), m = b(
36
+ statusLoad: D = "ready",
37
+ fieldFlow: a = "responsiveWrap"
38
+ } = R, { getLabel: l } = V(), { visibleFields: x } = Z(c), p = x.filter(me), E = p.length > 0, C = !E && (D === "ready" || D === "new"), m = z || C ? null : de(c.form), S = b(
39
+ () => Se(c.fields ?? []),
40
+ [c.fields]
41
+ ), B = new Set(p.map((t) => t.id)), _ = p.filter((t) => !S.ownerByFieldId.has(t.id)), d = b(
38
42
  () => ({
39
- size: r,
40
- readOnly: t,
41
- fieldFlow: n
43
+ size: o,
44
+ readOnly: r,
45
+ fieldFlow: a
42
46
  }),
43
- [r, n, t]
44
- ), d = a.sections.map(({ field: e, fields: p }) => ({
45
- section: e,
46
- fields: p.filter((x) => v.has(x.id))
47
- })).filter(({ fields: e }) => e.length > 0), O = d.length > 0 ? /* @__PURE__ */ o(J, { ownerState: m, children: d.map(({ section: e, fields: p }) => /* @__PURE__ */ o(
48
- q,
47
+ [o, a, r]
48
+ ), f = S.sections.map(({ field: t, fields: F }) => ({
49
+ section: t,
50
+ fields: F.filter((k) => B.has(k.id))
51
+ })).filter(({ fields: t }) => t.length > 0), H = f.length > 0 ? /* @__PURE__ */ e(oe, { ownerState: d, children: f.map(({ section: t, fields: F }) => /* @__PURE__ */ e(
52
+ ee,
49
53
  {
50
- section: e,
51
- fields: p,
52
- currentSize: r,
53
- fieldWrapperClassName: F,
54
- fieldFlow: n,
55
- readOnly: t,
56
- ownerState: m
54
+ section: t,
55
+ fields: F,
56
+ currentSize: o,
57
+ fieldWrapperClassName: y,
58
+ fieldFlow: a,
59
+ readOnly: r,
60
+ ownerState: d
57
61
  },
58
- e.id
59
- )) }) : null, I = /* @__PURE__ */ o(
60
- V,
62
+ t.id
63
+ )) }) : null, N = /* @__PURE__ */ e(
64
+ $,
61
65
  {
62
- fields: D,
63
- currentSize: r,
64
- fieldWrapperClassName: F,
65
- fieldFlow: n,
66
- readOnly: t,
67
- ownerState: m
66
+ fields: _,
67
+ currentSize: o,
68
+ fieldWrapperClassName: y,
69
+ fieldFlow: a,
70
+ readOnly: r,
71
+ ownerState: d
68
72
  }
69
- ), w = R.length > 0 || a.issues.length > 0, z = !S && i ? /* @__PURE__ */ o(K, { children: /* @__PURE__ */ o(
70
- g,
73
+ ), U = v.length > 0 || S.issues.length > 0, Y = !h && i ? /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(
74
+ M,
71
75
  {
72
- size: r,
73
- label: h(
74
- i === "success" ? f.SUBMIT_SUCCESS_MESSAGE : f.SUBMIT_ERROR_MESSAGE
76
+ size: o,
77
+ label: l(
78
+ i === "success" ? s.SUBMIT_SUCCESS_MESSAGE : s.SUBMIT_ERROR_MESSAGE
75
79
  ),
76
- startIcon: /* @__PURE__ */ o(
77
- P,
80
+ startIcon: /* @__PURE__ */ e(
81
+ J,
78
82
  {
79
- src: i === "success" ? /* @__PURE__ */ o(B, {}) : /* @__PURE__ */ o(G, {}),
83
+ src: i === "success" ? /* @__PURE__ */ e(W, {}) : /* @__PURE__ */ e(j, {}),
80
84
  color: i === "success" ? "chips.success.contained.color" : "chips.error.contained.color"
81
85
  }
82
86
  ),
@@ -84,69 +88,94 @@ const io = H((_, E) => {
84
88
  opacity: !0
85
89
  }
86
90
  ) }) : null;
87
- return /* @__PURE__ */ N(
88
- Q,
91
+ return /* @__PURE__ */ g(
92
+ re,
89
93
  {
90
- ref: E,
91
- ownerState: m,
92
- className: k(l.contentRoot),
94
+ ref: O,
95
+ ownerState: d,
96
+ className: P(n.contentRoot),
93
97
  ...typeof u == "string" ? { "data-meta": u } : {},
94
- ...process.env.NODE_ENV !== "production" ? { [W]: T } : {},
98
+ ...process.env.NODE_ENV !== "production" ? { [K]: L } : {},
95
99
  children: [
96
- c?.title && /* @__PURE__ */ N(
97
- X,
100
+ m?.title && /* @__PURE__ */ g(
101
+ ie,
98
102
  {
99
- className: l.formHeader,
103
+ className: n.formHeader,
100
104
  children: [
101
- /* @__PURE__ */ o(
102
- Z,
105
+ /* @__PURE__ */ e(
106
+ se,
103
107
  {
104
- className: l.formTitle,
108
+ className: n.formTitle,
105
109
  component: "h2",
106
- size: r,
110
+ size: o,
107
111
  variant: "paragraphDens",
108
- children: c.title
112
+ children: m.title
109
113
  }
110
114
  ),
111
- c.description && /* @__PURE__ */ o(
112
- $,
115
+ m.description && /* @__PURE__ */ e(
116
+ ne,
113
117
  {
114
- className: l.formDescription,
118
+ className: n.formDescription,
115
119
  color: "text.secondary",
116
120
  component: "p",
117
- size: r,
121
+ size: o,
118
122
  variant: "bodyStandard",
119
- children: c.description
123
+ children: m.description
120
124
  }
121
125
  )
122
126
  ]
123
127
  }
124
128
  ),
125
- w && /* @__PURE__ */ o(
126
- g,
129
+ U && /* @__PURE__ */ e(
130
+ M,
127
131
  {
128
- size: r,
129
- label: h(f.SECTION_CONTRACT_NOTICE),
132
+ size: o,
133
+ label: l(s.SECTION_CONTRACT_NOTICE),
130
134
  color: "warning",
131
135
  opacity: !0
132
136
  }
133
137
  ),
134
- O,
135
- d.length > 0 ? D.length > 0 && /* @__PURE__ */ o(oo, { children: I }) : I,
136
- !S && !t && /* @__PURE__ */ o(eo, { children: /* @__PURE__ */ o(Y, { children: y ? y() : /* @__PURE__ */ o(
137
- j,
138
+ C && /* @__PURE__ */ e(
139
+ ce,
140
+ {
141
+ className: n.emptyState,
142
+ role: "status",
143
+ "aria-live": "polite",
144
+ children: /* @__PURE__ */ e(
145
+ pe,
146
+ {
147
+ size: o,
148
+ title: A(
149
+ l,
150
+ s.NO_VISIBLE_FIELDS_TITLE,
151
+ T.title
152
+ ),
153
+ message: A(
154
+ l,
155
+ s.NO_VISIBLE_FIELDS_MESSAGE,
156
+ T.message
157
+ ),
158
+ imageUrl: /* @__PURE__ */ e(q, {})
159
+ }
160
+ )
161
+ }
162
+ ),
163
+ H,
164
+ f.length > 0 ? _.length > 0 && /* @__PURE__ */ e(ae, { children: N }) : N,
165
+ !h && !r && E && /* @__PURE__ */ e(le, { children: /* @__PURE__ */ e(Q, { children: I ? I() : /* @__PURE__ */ e(
166
+ X,
138
167
  {
139
- size: r,
168
+ size: o,
140
169
  color: "default",
141
- ...A
170
+ ...w
142
171
  }
143
172
  ) }) }),
144
- z
173
+ Y
145
174
  ]
146
175
  }
147
176
  );
148
177
  });
149
- io.displayName = "DynamicFormContent";
178
+ fe.displayName = "DynamicFormContent";
150
179
  export {
151
- io as DynamicFormContent
180
+ fe as DynamicFormContent
152
181
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicFormFieldsFlow.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/DynamicFormFieldsFlow.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAGV,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAmIjB,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,+DAmDtE"}
1
+ {"version":3,"file":"DynamicFormFieldsFlow.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/DynamicFormFieldsFlow.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAGV,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAmIjB,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,+DAmDtE"}
@@ -1,28 +1,29 @@
1
1
  import { jsx as m } from "@emotion/react/jsx-runtime";
2
2
  import { memo as W } from "react";
3
3
  import L from "clsx";
4
- import { useModuleDictionary as b, useEnvironment as g } from "@m4l/core";
5
- import { PropertyValue as C } from "../../../PropertyValue/PropertyValue.js";
6
- import { resolveFieldRenderHelperMessage as D } from "../../helpers/resolveFieldRenderHelperMessage/resolveFieldRenderHelperMessage.js";
7
- import { resolveFieldInputLabel as O } from "../../helpers/resolveFieldInputLabel/resolveFieldInputLabel.js";
8
- import { resolveAdaptiveFieldLayout as R } from "../../helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.js";
4
+ import { useModuleDictionary as b, useEnvironment as D } from "@m4l/core";
5
+ import { PropertyValue as R } from "../../../PropertyValue/PropertyValue.js";
6
+ import { resolveFieldRenderHelperMessage as g } from "../../helpers/resolveFieldRenderHelperMessage/resolveFieldRenderHelperMessage.js";
7
+ import { resolveFieldInputLabel as C } from "../../helpers/resolveFieldInputLabel/resolveFieldInputLabel.js";
8
+ import { resolveAdaptiveFieldLayout as O } from "../../helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.js";
9
9
  import { DYNAMIC_FORM_CLASSES as S } from "../../constants.js";
10
10
  import { DynamicFormFieldsFlowStyled as M, DynamicFormFieldWrapperStyled as I } from "../../slots/DynamicFormSlots.js";
11
11
  import { isSupportedInformationalField as N } from "../../helpers/fieldContractAllowlist/fieldContractAllowlist.js";
12
- import { resolveFieldReadOnly as _, resolveFieldMandatory as E } from "../../helpers/resolveFieldContractAliases/resolveFieldContractAliases.js";
13
- import { resolveFieldComponent as G } from "../../helpers/resolveFieldComponent/resolveFieldComponent.js";
14
- const A = /* @__PURE__ */ new Set([
12
+ import { isRenderableDynamicFormField as _ } from "../../helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.js";
13
+ import { resolveFieldReadOnly as E, resolveFieldMandatory as G } from "../../helpers/resolveFieldContractAliases/resolveFieldContractAliases.js";
14
+ import { resolveFieldComponent as A } from "../../helpers/resolveFieldComponent/resolveFieldComponent.js";
15
+ const H = /* @__PURE__ */ new Set([
15
16
  "RHFCheckableList"
16
17
  ]);
17
- function H(a) {
18
+ function z(a) {
18
19
  const o = a.fieldType?.componentId;
19
- return o && A.has(o) ? "verticalGrow" : "default";
20
+ return o && H.has(o) ? "verticalGrow" : "default";
20
21
  }
21
- function z(a) {
22
+ function x(a) {
22
23
  const o = [];
23
24
  let e = [];
24
25
  return a.forEach((l) => {
25
- const i = H(l);
26
+ const i = z(l);
26
27
  if (i === "verticalGrow") {
27
28
  e.length > 0 && (o.push({ layout: "default", fields: e }), e = []), o.push({ layout: i, fields: [l] });
28
29
  return;
@@ -38,16 +39,16 @@ const y = W(function(o) {
38
39
  fieldFlow: u,
39
40
  layout: p,
40
41
  readOnly: F = !1
41
- } = o, { getLabel: t } = b(), { host_api_remote: c } = g(), r = p === "verticalGrow", n = N(e);
42
- if (!n && (typeof e.name != "string" || e.name.trim() === ""))
42
+ } = o, { getLabel: t } = b(), { host_api_remote: c } = D(), r = p === "verticalGrow", n = N(e);
43
+ if (!_(e))
43
44
  return null;
44
- const s = _(e, F), h = n ? void 0 : D(e, t), v = n ? typeof e.label == "string" ? e.label : "" : O(e, t), w = E(e), d = R({
45
+ const s = E(e, F), h = n ? void 0 : g(e, t), v = n ? typeof e.label == "string" ? e.label : "" : C(e, t), w = G(e), d = O({
45
46
  hasHelperMessage: !s && !!h,
46
47
  label: n ? "" : v,
47
48
  mandatory: !n && !s && w,
48
49
  requestedSemanticWidth: e.metadata?.semanticWidth,
49
50
  size: l
50
- }), f = G(e, {
51
+ }), f = A(e, {
51
52
  size: l,
52
53
  getLabel: t,
53
54
  hostApiRemote: c,
@@ -68,7 +69,7 @@ const y = W(function(o) {
68
69
  },
69
70
  className: L(i, S.fieldWrapper),
70
71
  children: n ? f : /* @__PURE__ */ m(
71
- C,
72
+ R,
72
73
  {
73
74
  controlWidth: d.controlWidth,
74
75
  labelOverflow: "visible",
@@ -87,7 +88,7 @@ const y = W(function(o) {
87
88
  ) : null;
88
89
  });
89
90
  y.displayName = "DynamicFormFieldRow";
90
- function U(a) {
91
+ function Z(a) {
91
92
  const {
92
93
  fields: o,
93
94
  currentSize: e,
@@ -96,7 +97,7 @@ function U(a) {
96
97
  readOnly: u,
97
98
  ownerState: p
98
99
  } = a;
99
- return z(o).map((t) => {
100
+ return x(o).map((t) => {
100
101
  if (t.layout === "verticalGrow") {
101
102
  const r = t.fields[0];
102
103
  return r ? /* @__PURE__ */ m(
@@ -136,5 +137,5 @@ function U(a) {
136
137
  });
137
138
  }
138
139
  export {
139
- U as DynamicFormFieldsFlow
140
+ Z as DynamicFormFieldsFlow
140
141
  };
@@ -653,6 +653,7 @@ interface DynamicFormPropsBase {
653
653
  /**
654
654
  * When true, omits the form metadata header from the rendered layout while
655
655
  * preserving the provided form data unchanged. Defaults to true.
656
+ * The empty state always omits this header, including when this flag is false.
656
657
  */
657
658
  suppressFormHeader?: boolean;
658
659
  /**
@@ -681,14 +682,15 @@ interface DynamicFormPropsBase {
681
682
  fieldFlow?: DynamicFormFieldFlow;
682
683
  /**
683
684
  * Props to customize ActionFormIntro.
684
- * Only used when coupled is false (decoupled mode).
685
+ * Only used for decoupled, editable forms with visible renderable fields.
685
686
  * If not provided, default values are used.
686
687
  */
687
688
  actionFormIntroProps?: Partial<ActionsFormIntroProps>;
688
689
  /**
689
690
  * Custom render for form actions.
690
- * Only used when coupled is false (decoupled mode).
691
- * If provided, replaces the default ActionsContainer and ActionFormIntro.
691
+ * Only called for decoupled, editable forms with visible renderable fields.
692
+ * If provided, replaces ActionFormIntro inside the existing ActionsContainer.
693
+ * The whole slot, including custom navigation, is omitted when no fields are visible.
692
694
  */
693
695
  renderActions?: () => ReactNode;
694
696
  }
@@ -769,6 +771,8 @@ export type DynamicFormRef = RHFormProviderRef<DynamicFormValues>;
769
771
  */
770
772
  export interface DynamicFormContentProps {
771
773
  data: DynamicFormApiResponse;
774
+ /** Delay the empty state until the form's field values have finished loading. */
775
+ statusLoad?: FormStatusLoad;
772
776
  /** Structural backend issues found before option hydration. */
773
777
  contractIssues?: import('./helpers/resolveFormSections/types').FormSectionIssue[];
774
778
  currentSize: 'small' | 'medium';