@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.
- package/components/DynamicForm/DynamicForm.d.ts.map +1 -1
- package/components/DynamicForm/DynamicForm.js +96 -93
- package/components/DynamicForm/DynamicForm.styles.d.ts.map +1 -1
- package/components/DynamicForm/DynamicForm.styles.js +91 -68
- package/components/DynamicForm/constants.d.ts +1 -1
- package/components/DynamicForm/constants.d.ts.map +1 -1
- package/components/DynamicForm/dictionary.d.ts +9 -0
- package/components/DynamicForm/dictionary.d.ts.map +1 -1
- package/components/DynamicForm/dictionary.js +11 -3
- package/components/DynamicForm/helpers/isRenderableDynamicFormField/index.d.ts +2 -0
- package/components/DynamicForm/helpers/isRenderableDynamicFormField/index.d.ts.map +1 -0
- package/components/DynamicForm/helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.d.ts +4 -0
- package/components/DynamicForm/helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.d.ts.map +1 -0
- package/components/DynamicForm/helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.js +8 -0
- package/components/DynamicForm/helpers/resolveEmptyStateLabel/index.d.ts +2 -0
- package/components/DynamicForm/helpers/resolveEmptyStateLabel/index.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveEmptyStateLabel/resolveEmptyStateLabel.d.ts +4 -0
- package/components/DynamicForm/helpers/resolveEmptyStateLabel/resolveEmptyStateLabel.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveEmptyStateLabel/resolveEmptyStateLabel.js +7 -0
- package/components/DynamicForm/slots/DynamicFormEnum.d.ts +1 -0
- package/components/DynamicForm/slots/DynamicFormEnum.d.ts.map +1 -1
- package/components/DynamicForm/slots/DynamicFormEnum.js +1 -1
- package/components/DynamicForm/slots/DynamicFormSlots.d.ts +3 -0
- package/components/DynamicForm/slots/DynamicFormSlots.d.ts.map +1 -1
- package/components/DynamicForm/slots/DynamicFormSlots.js +43 -39
- package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.d.ts.map +1 -1
- package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.js +128 -99
- package/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/DynamicFormFieldsFlow.d.ts.map +1 -1
- package/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/DynamicFormFieldsFlow.js +21 -20
- package/components/DynamicForm/types.d.ts +7 -3
- package/components/DynamicForm/types.d.ts.map +1 -1
- package/package.json +9 -9
package/components/DynamicForm/helpers/isRenderableDynamicFormField/isRenderableDynamicFormField.js
ADDED
|
@@ -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 @@
|
|
|
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"}
|
|
@@ -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
|
|
6
|
-
import { DYNAMIC_FORM_KEY_COMPONENT as
|
|
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:
|
|
10
|
+
name: r,
|
|
11
11
|
slot: e.formProvider
|
|
12
|
-
})(
|
|
13
|
-
name:
|
|
12
|
+
})(t?.formProvider), S = l, v = o("div", {
|
|
13
|
+
name: r,
|
|
14
14
|
slot: e.contentRoot
|
|
15
|
-
})(
|
|
16
|
-
name:
|
|
15
|
+
})(t?.contentRoot), b = o("header", {
|
|
16
|
+
name: r,
|
|
17
17
|
slot: e.formHeader
|
|
18
|
-
})(
|
|
19
|
-
name:
|
|
18
|
+
})(t?.formHeader), h = o(i, {
|
|
19
|
+
name: r,
|
|
20
20
|
slot: e.formTitle
|
|
21
|
-
})(
|
|
22
|
-
name:
|
|
21
|
+
})(t?.formTitle), C = o(i, {
|
|
22
|
+
name: r,
|
|
23
23
|
slot: e.formDescription
|
|
24
|
-
})(
|
|
25
|
-
name:
|
|
24
|
+
})(t?.formDescription), k = o("div", {
|
|
25
|
+
name: r,
|
|
26
26
|
slot: e.fieldsFlow
|
|
27
|
-
})(
|
|
28
|
-
name:
|
|
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
|
-
})(
|
|
31
|
-
name:
|
|
33
|
+
})(t?.sectionsGrid), T = o("div", {
|
|
34
|
+
name: r,
|
|
32
35
|
slot: e.ungroupedCard
|
|
33
|
-
})(
|
|
34
|
-
name:
|
|
36
|
+
})(t?.ungroupedCard), w = o(m, {
|
|
37
|
+
name: r,
|
|
35
38
|
slot: e.fieldWrapper
|
|
36
|
-
})(
|
|
37
|
-
name:
|
|
39
|
+
})(t?.fieldWrapper), E = o(m, {
|
|
40
|
+
name: r,
|
|
38
41
|
slot: e.submitFeedback
|
|
39
|
-
})(
|
|
40
|
-
name:
|
|
42
|
+
})(t?.submitFeedback), P = o(m, {
|
|
43
|
+
name: r,
|
|
41
44
|
slot: e.actionsRow
|
|
42
|
-
})(
|
|
45
|
+
})(t?.actionsRow);
|
|
43
46
|
o("div", {
|
|
44
|
-
name:
|
|
47
|
+
name: r,
|
|
45
48
|
slot: e.label
|
|
46
|
-
})(
|
|
49
|
+
})(t?.label);
|
|
47
50
|
o("div", {
|
|
48
|
-
name:
|
|
51
|
+
name: r,
|
|
49
52
|
slot: e.helperText
|
|
50
|
-
})(
|
|
53
|
+
})(t?.helperText);
|
|
51
54
|
o("div", {
|
|
52
|
-
name:
|
|
55
|
+
name: r,
|
|
53
56
|
slot: e.sectionDivider
|
|
54
|
-
})(
|
|
57
|
+
})(t?.sectionDivider);
|
|
55
58
|
const W = o("div", {
|
|
56
|
-
name:
|
|
59
|
+
name: r,
|
|
57
60
|
slot: e.checkableListWrapper
|
|
58
|
-
})(
|
|
59
|
-
name:
|
|
61
|
+
})(t?.checkableListWrapper), g = o(a, {
|
|
62
|
+
name: r,
|
|
60
63
|
slot: e.fallbackEndIconChip
|
|
61
|
-
})(
|
|
64
|
+
})(t?.fallbackEndIconChip);
|
|
62
65
|
export {
|
|
63
66
|
P as DynamicFormActionsRowStyled,
|
|
64
67
|
W as DynamicFormCheckableListWrapperStyled,
|
|
65
68
|
v as DynamicFormContentRootStyled,
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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":"
|
|
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
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import { useModuleDictionary as
|
|
5
|
-
import { NotificationCheckCircleFill as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { TEST_PROP_ID as
|
|
8
|
-
import { ActionsContainer as
|
|
9
|
-
import { ActionFormIntro as
|
|
10
|
-
import { useDynamicFormConditionals as
|
|
11
|
-
import { DYNAMIC_FORM_DICTIONARY as
|
|
12
|
-
import { DYNAMIC_FORM_CLASSES as
|
|
13
|
-
import { DynamicFormFieldsFlow as
|
|
14
|
-
import { DynamicFormSection as
|
|
15
|
-
import { DynamicFormSectionsGridStyled as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
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:
|
|
22
|
-
contractIssues:
|
|
23
|
-
currentSize:
|
|
24
|
-
fieldWrapperClassName:
|
|
25
|
-
dataTestId:
|
|
24
|
+
data: c,
|
|
25
|
+
contractIssues: v = [],
|
|
26
|
+
currentSize: o,
|
|
27
|
+
fieldWrapperClassName: y,
|
|
28
|
+
dataTestId: L,
|
|
26
29
|
dataMeta: u,
|
|
27
|
-
coupled:
|
|
28
|
-
actionFormIntroProps:
|
|
29
|
-
renderActions:
|
|
30
|
-
readOnly:
|
|
31
|
-
suppressFormHeader:
|
|
30
|
+
coupled: h = !1,
|
|
31
|
+
actionFormIntroProps: w,
|
|
32
|
+
renderActions: I,
|
|
33
|
+
readOnly: r = !1,
|
|
34
|
+
suppressFormHeader: z = !0,
|
|
32
35
|
submitFeedbackStatus: i,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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:
|
|
40
|
-
readOnly:
|
|
41
|
-
fieldFlow:
|
|
43
|
+
size: o,
|
|
44
|
+
readOnly: r,
|
|
45
|
+
fieldFlow: a
|
|
42
46
|
}),
|
|
43
|
-
[
|
|
44
|
-
),
|
|
45
|
-
section:
|
|
46
|
-
fields:
|
|
47
|
-
})).filter(({ fields:
|
|
48
|
-
|
|
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:
|
|
51
|
-
fields:
|
|
52
|
-
currentSize:
|
|
53
|
-
fieldWrapperClassName:
|
|
54
|
-
fieldFlow:
|
|
55
|
-
readOnly:
|
|
56
|
-
ownerState:
|
|
54
|
+
section: t,
|
|
55
|
+
fields: F,
|
|
56
|
+
currentSize: o,
|
|
57
|
+
fieldWrapperClassName: y,
|
|
58
|
+
fieldFlow: a,
|
|
59
|
+
readOnly: r,
|
|
60
|
+
ownerState: d
|
|
57
61
|
},
|
|
58
|
-
|
|
59
|
-
)) }) : null,
|
|
60
|
-
|
|
62
|
+
t.id
|
|
63
|
+
)) }) : null, N = /* @__PURE__ */ e(
|
|
64
|
+
$,
|
|
61
65
|
{
|
|
62
|
-
fields:
|
|
63
|
-
currentSize:
|
|
64
|
-
fieldWrapperClassName:
|
|
65
|
-
fieldFlow:
|
|
66
|
-
readOnly:
|
|
67
|
-
ownerState:
|
|
66
|
+
fields: _,
|
|
67
|
+
currentSize: o,
|
|
68
|
+
fieldWrapperClassName: y,
|
|
69
|
+
fieldFlow: a,
|
|
70
|
+
readOnly: r,
|
|
71
|
+
ownerState: d
|
|
68
72
|
}
|
|
69
|
-
),
|
|
70
|
-
|
|
73
|
+
), U = v.length > 0 || S.issues.length > 0, Y = !h && i ? /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(
|
|
74
|
+
M,
|
|
71
75
|
{
|
|
72
|
-
size:
|
|
73
|
-
label:
|
|
74
|
-
i === "success" ?
|
|
76
|
+
size: o,
|
|
77
|
+
label: l(
|
|
78
|
+
i === "success" ? s.SUBMIT_SUCCESS_MESSAGE : s.SUBMIT_ERROR_MESSAGE
|
|
75
79
|
),
|
|
76
|
-
startIcon: /* @__PURE__ */
|
|
77
|
-
|
|
80
|
+
startIcon: /* @__PURE__ */ e(
|
|
81
|
+
J,
|
|
78
82
|
{
|
|
79
|
-
src: i === "success" ? /* @__PURE__ */
|
|
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__ */
|
|
88
|
-
|
|
91
|
+
return /* @__PURE__ */ g(
|
|
92
|
+
re,
|
|
89
93
|
{
|
|
90
|
-
ref:
|
|
91
|
-
ownerState:
|
|
92
|
-
className:
|
|
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" ? { [
|
|
98
|
+
...process.env.NODE_ENV !== "production" ? { [K]: L } : {},
|
|
95
99
|
children: [
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
m?.title && /* @__PURE__ */ g(
|
|
101
|
+
ie,
|
|
98
102
|
{
|
|
99
|
-
className:
|
|
103
|
+
className: n.formHeader,
|
|
100
104
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
|
|
105
|
+
/* @__PURE__ */ e(
|
|
106
|
+
se,
|
|
103
107
|
{
|
|
104
|
-
className:
|
|
108
|
+
className: n.formTitle,
|
|
105
109
|
component: "h2",
|
|
106
|
-
size:
|
|
110
|
+
size: o,
|
|
107
111
|
variant: "paragraphDens",
|
|
108
|
-
children:
|
|
112
|
+
children: m.title
|
|
109
113
|
}
|
|
110
114
|
),
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
m.description && /* @__PURE__ */ e(
|
|
116
|
+
ne,
|
|
113
117
|
{
|
|
114
|
-
className:
|
|
118
|
+
className: n.formDescription,
|
|
115
119
|
color: "text.secondary",
|
|
116
120
|
component: "p",
|
|
117
|
-
size:
|
|
121
|
+
size: o,
|
|
118
122
|
variant: "bodyStandard",
|
|
119
|
-
children:
|
|
123
|
+
children: m.description
|
|
120
124
|
}
|
|
121
125
|
)
|
|
122
126
|
]
|
|
123
127
|
}
|
|
124
128
|
),
|
|
125
|
-
|
|
126
|
-
|
|
129
|
+
U && /* @__PURE__ */ e(
|
|
130
|
+
M,
|
|
127
131
|
{
|
|
128
|
-
size:
|
|
129
|
-
label:
|
|
132
|
+
size: o,
|
|
133
|
+
label: l(s.SECTION_CONTRACT_NOTICE),
|
|
130
134
|
color: "warning",
|
|
131
135
|
opacity: !0
|
|
132
136
|
}
|
|
133
137
|
),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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:
|
|
168
|
+
size: o,
|
|
140
169
|
color: "default",
|
|
141
|
-
...
|
|
170
|
+
...w
|
|
142
171
|
}
|
|
143
172
|
) }) }),
|
|
144
|
-
|
|
173
|
+
Y
|
|
145
174
|
]
|
|
146
175
|
}
|
|
147
176
|
);
|
|
148
177
|
});
|
|
149
|
-
|
|
178
|
+
fe.displayName = "DynamicFormContent";
|
|
150
179
|
export {
|
|
151
|
-
|
|
180
|
+
fe as DynamicFormContent
|
|
152
181
|
};
|
package/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/DynamicFormFieldsFlow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicFormFieldsFlow.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/DynamicFormFieldsFlow.tsx"],"names":[],"mappings":"
|
|
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
|
|
5
|
-
import { PropertyValue as
|
|
6
|
-
import { resolveFieldRenderHelperMessage as
|
|
7
|
-
import { resolveFieldInputLabel as
|
|
8
|
-
import { resolveAdaptiveFieldLayout as
|
|
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 {
|
|
13
|
-
import {
|
|
14
|
-
|
|
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
|
|
18
|
+
function z(a) {
|
|
18
19
|
const o = a.fieldType?.componentId;
|
|
19
|
-
return o &&
|
|
20
|
+
return o && H.has(o) ? "verticalGrow" : "default";
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
+
function x(a) {
|
|
22
23
|
const o = [];
|
|
23
24
|
let e = [];
|
|
24
25
|
return a.forEach((l) => {
|
|
25
|
-
const i =
|
|
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 } =
|
|
42
|
-
if (!
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
691
|
-
* If provided, replaces the
|
|
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';
|