@m4l/components 9.63.0 → 9.64.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 +102 -96
- package/components/DynamicForm/DynamicForm.styles.d.ts.map +1 -1
- package/components/DynamicForm/DynamicForm.styles.js +77 -60
- package/components/DynamicForm/constants.d.ts +4 -4
- package/components/DynamicForm/constants.d.ts.map +1 -1
- package/components/DynamicForm/dictionary.d.ts +4 -0
- package/components/DynamicForm/dictionary.d.ts.map +1 -1
- package/components/DynamicForm/dictionary.js +5 -1
- package/components/DynamicForm/helpers/fieldContractAllowlist/fieldContractAllowlist.d.ts +4 -0
- package/components/DynamicForm/helpers/fieldContractAllowlist/fieldContractAllowlist.d.ts.map +1 -1
- package/components/DynamicForm/helpers/fieldContractAllowlist/fieldContractAllowlist.js +41 -35
- package/components/DynamicForm/helpers/fieldContractAllowlist/index.d.ts +1 -1
- package/components/DynamicForm/helpers/fieldContractAllowlist/index.d.ts.map +1 -1
- package/components/DynamicForm/helpers/filterUnknownFieldsFromSubmit/filterUnknownFieldsFromSubmit.d.ts.map +1 -1
- package/components/DynamicForm/helpers/filterUnknownFieldsFromSubmit/filterUnknownFieldsFromSubmit.js +16 -15
- package/components/DynamicForm/helpers/getFieldTypeApiKey/getFieldTypeApiKey.d.ts.map +1 -1
- package/components/DynamicForm/helpers/getFieldTypeApiKey/getFieldTypeApiKey.js +4 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeAutocompletePropsFromBackend/normalizeAutocompletePropsFromBackend.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeAutocompletePropsFromBackend/normalizeAutocompletePropsFromBackend.js +8 -8
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeCheckboxPropsFromBackend/normalizeCheckboxPropsFromBackend.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeCheckboxPropsFromBackend/normalizeCheckboxPropsFromBackend.js +5 -5
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeDateRangePickerPropsFromBackend/normalizeDateRangePickerPropsFromBackend.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeDateRangePickerPropsFromBackend/normalizeDateRangePickerPropsFromBackend.js +8 -8
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeDaysOfWeekPickerPropsFromBackend/normalizeDaysOfWeekPickerPropsFromBackend.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeDaysOfWeekPickerPropsFromBackend/normalizeDaysOfWeekPickerPropsFromBackend.js +10 -10
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeImageSelectorPropsFromBackend/normalizeImageSelectorPropsFromBackend.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeImageSelectorPropsFromBackend/normalizeImageSelectorPropsFromBackend.js +5 -5
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeNumberInputPropsFromBackend/normalizeNumberInputPropsFromBackend.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeNumberInputPropsFromBackend/normalizeNumberInputPropsFromBackend.js +3 -3
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeRadioGroupPropsFromBackend/normalizeRadioGroupPropsFromBackend.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeRadioGroupPropsFromBackend/normalizeRadioGroupPropsFromBackend.js +8 -8
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeSelectPropsFromBackend/normalizeSelectPropsFromBackend.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeSelectPropsFromBackend/normalizeSelectPropsFromBackend.js +16 -16
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeTextFieldPropsFromBackend/normalizeTextFieldPropsFromBackend.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/normalizations/normalizeTextFieldPropsFromBackend/normalizeTextFieldPropsFromBackend.js +6 -6
- package/components/DynamicForm/helpers/resolveFieldComponent/resolveFieldComponent.d.ts +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/alertStrategy/alertStrategy.d.ts +4 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/alertStrategy/alertStrategy.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/alertStrategy/alertStrategy.js +35 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/autocompleteStrategy/autocompleteStrategy.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/autocompleteStrategy/autocompleteStrategy.js +29 -30
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/checkableListStrategy.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/checkableListStrategy.js +14 -15
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/helpers/whitelist/propertyNormalizers.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkableListStrategy/helpers/whitelist/propertyNormalizers.js +4 -5
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/checkboxStrategy/checkboxStrategy.js +14 -14
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/dateRangePickerStrategy/dateRangePickerStrategy.js +9 -9
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/daysOfWeekPickerStrategy/daysOfWeekPickerStrategy.js +6 -6
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/imageSelectorStrategy/imageSelectorStrategy.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/imageSelectorStrategy/imageSelectorStrategy.js +20 -21
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/index.d.ts +1 -0
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/index.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/numberInputStrategy/numberInputStrategy.js +10 -10
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/radioGroupStrategy/radioGroupStrategy.js +10 -10
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/registry.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/registry.js +14 -12
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/selectStrategy.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/selectStrategy.js +18 -19
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/types.d.ts +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/selectStrategy/types.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/textFieldStrategy/textFieldStrategy.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/strategies/textFieldStrategy/textFieldStrategy.js +31 -32
- package/components/DynamicForm/helpers/resolveFieldContractAliases/index.d.ts +1 -1
- package/components/DynamicForm/helpers/resolveFieldContractAliases/index.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldContractAliases/resolveFieldContractAliases.d.ts +2 -0
- package/components/DynamicForm/helpers/resolveFieldContractAliases/resolveFieldContractAliases.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveFieldContractAliases/resolveFieldContractAliases.js +14 -10
- package/components/DynamicForm/helpers/resolveFormSections/index.d.ts +3 -0
- package/components/DynamicForm/helpers/resolveFormSections/index.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFormSections/resolveFormSections.d.ts +12 -0
- package/components/DynamicForm/helpers/resolveFormSections/resolveFormSections.d.ts.map +1 -0
- package/components/DynamicForm/helpers/resolveFormSections/resolveFormSections.js +89 -0
- package/components/DynamicForm/helpers/resolveFormSections/types.d.ts +14 -0
- package/components/DynamicForm/helpers/resolveFormSections/types.d.ts.map +1 -0
- package/components/DynamicForm/hooks/useDynamicForm/useDynamicForm.d.ts.map +1 -1
- package/components/DynamicForm/hooks/useDynamicForm/useDynamicForm.js +50 -42
- package/components/DynamicForm/hooks/useDynamicFormConditionals/useDynamicFormConditionals.d.ts.map +1 -1
- package/components/DynamicForm/hooks/useDynamicFormConditionals/useDynamicFormConditionals.js +28 -19
- package/components/DynamicForm/hooks/useDynamicFormData/useDynamicFormData.d.ts.map +1 -1
- package/components/DynamicForm/hooks/useDynamicFormData/useDynamicFormData.js +64 -62
- package/components/DynamicForm/hooks/useFieldsWithFetchedOptions/useFieldsWithFetchedOptions.d.ts.map +1 -1
- package/components/DynamicForm/hooks/useFieldsWithFetchedOptions/useFieldsWithFetchedOptions.js +37 -44
- package/components/DynamicForm/slots/DynamicFormEnum.d.ts +2 -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 +6 -0
- package/components/DynamicForm/slots/DynamicFormSlots.d.ts.map +1 -1
- package/components/DynamicForm/slots/DynamicFormSlots.js +51 -43
- package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.d.ts.map +1 -1
- package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.js +108 -200
- package/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/DynamicFormFieldsFlow.d.ts +4 -0
- package/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/DynamicFormFieldsFlow.d.ts.map +1 -0
- package/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/DynamicFormFieldsFlow.js +140 -0
- package/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/types.d.ts +22 -0
- package/components/DynamicForm/subcomponents/DynamicFormFieldsFlow/types.d.ts.map +1 -0
- package/components/DynamicForm/subcomponents/DynamicFormSection/DynamicFormSection.d.ts +4 -0
- package/components/DynamicForm/subcomponents/DynamicFormSection/DynamicFormSection.d.ts.map +1 -0
- package/components/DynamicForm/subcomponents/DynamicFormSection/DynamicFormSection.js +73 -0
- package/components/DynamicForm/subcomponents/DynamicFormSection/cardStyles.d.ts +13 -0
- package/components/DynamicForm/subcomponents/DynamicFormSection/cardStyles.d.ts.map +1 -0
- package/components/DynamicForm/subcomponents/DynamicFormSection/cardStyles.js +15 -0
- package/components/DynamicForm/subcomponents/DynamicFormSection/slots.d.ts +10 -0
- package/components/DynamicForm/subcomponents/DynamicFormSection/slots.d.ts.map +1 -0
- package/components/DynamicForm/subcomponents/DynamicFormSection/slots.js +65 -0
- package/components/DynamicForm/subcomponents/DynamicFormSection/types.d.ts +11 -0
- package/components/DynamicForm/subcomponents/DynamicFormSection/types.d.ts.map +1 -0
- package/components/DynamicForm/types.d.ts +19 -12
- package/components/DynamicForm/types.d.ts.map +1 -1
- package/components/DynamicForm/types.js +6 -2
- package/package.json +10 -10
|
@@ -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;
|
|
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,72 +1,76 @@
|
|
|
1
1
|
import { jsx as r } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useModuleSkeleton as
|
|
5
|
-
import { useComponentSize as
|
|
6
|
-
import { TEST_PROP_ID as
|
|
7
|
-
import { LinearProgress as
|
|
8
|
-
import { DynamicFormContentRootStyled as
|
|
9
|
-
import { DYNAMIC_FORM_CLASSES as
|
|
10
|
-
import { useDynamicForm as
|
|
11
|
-
import { useDynamicFormData as
|
|
12
|
-
import { DynamicFormContent as
|
|
13
|
-
import { useFieldsWithFetchedOptions as
|
|
14
|
-
import { filterUnknownFieldsFromSubmit as
|
|
15
|
-
import { mapOptionFieldValuesForSubmit as
|
|
16
|
-
|
|
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) => {
|
|
17
18
|
const {
|
|
18
|
-
formId:
|
|
19
|
-
formInstanceId:
|
|
19
|
+
formId: k,
|
|
20
|
+
formInstanceId: z,
|
|
20
21
|
inputEndpoint: _,
|
|
21
|
-
outputEndpoint:
|
|
22
|
-
submitMode:
|
|
23
|
-
initialData:
|
|
22
|
+
outputEndpoint: i,
|
|
23
|
+
submitMode: n,
|
|
24
|
+
initialData: D,
|
|
24
25
|
formatInputData: A,
|
|
25
26
|
formatOutputData: H,
|
|
26
|
-
onSubmit:
|
|
27
|
-
onSubmitError:
|
|
27
|
+
onSubmit: s,
|
|
28
|
+
onSubmitError: y,
|
|
28
29
|
size: g,
|
|
29
|
-
readOnly:
|
|
30
|
-
suppressFormHeader:
|
|
31
|
-
className:
|
|
32
|
-
dataTestId:
|
|
30
|
+
readOnly: a = !1,
|
|
31
|
+
suppressFormHeader: h = !0,
|
|
32
|
+
className: v,
|
|
33
|
+
dataTestId: f,
|
|
33
34
|
dataMeta: m,
|
|
34
|
-
fieldWrapperClassName:
|
|
35
|
+
fieldWrapperClassName: E,
|
|
35
36
|
fieldFlow: u = "responsiveWrap",
|
|
36
|
-
coupled:
|
|
37
|
+
coupled: p = !1,
|
|
37
38
|
actionFormIntroProps: x,
|
|
38
|
-
renderActions:
|
|
39
|
-
} =
|
|
40
|
-
formData:
|
|
41
|
-
statusLoad:
|
|
42
|
-
handleSubmit:
|
|
43
|
-
} =
|
|
44
|
-
formId:
|
|
45
|
-
formInstanceId:
|
|
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,
|
|
46
47
|
inputEndpoint: _,
|
|
47
|
-
outputEndpoint:
|
|
48
|
-
submitMode:
|
|
49
|
-
initialData:
|
|
48
|
+
outputEndpoint: i,
|
|
49
|
+
submitMode: n,
|
|
50
|
+
initialData: D,
|
|
50
51
|
formatInputData: A,
|
|
51
52
|
formatOutputData: H,
|
|
52
|
-
onSubmit:
|
|
53
|
-
}),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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,
|
|
57
61
|
fields: w
|
|
58
|
-
}, [w,
|
|
59
|
-
|
|
60
|
-
if (!
|
|
62
|
+
}, [w, t]), { initialValues: Y, validationSchema: j } = ue(e || me), [S, d] = $(null);
|
|
63
|
+
ee(() => {
|
|
64
|
+
if (!S)
|
|
61
65
|
return;
|
|
62
66
|
const o = setTimeout(() => d(null), 5e3);
|
|
63
67
|
return () => clearTimeout(o);
|
|
64
|
-
}, [
|
|
65
|
-
const
|
|
68
|
+
}, [S]);
|
|
69
|
+
const B = c(() => ({
|
|
66
70
|
size: l,
|
|
67
|
-
readOnly:
|
|
71
|
+
readOnly: a,
|
|
68
72
|
fieldFlow: u
|
|
69
|
-
}), [l, u,
|
|
73
|
+
}), [l, u, a]), O = X.useRef(null), R = c(() => ({
|
|
70
74
|
formMethods: new Proxy({}, {
|
|
71
75
|
get() {
|
|
72
76
|
throw new Error("DynamicForm ref is not available until the form provider mounts.");
|
|
@@ -75,83 +79,85 @@ const ft = X((P, T) => {
|
|
|
75
79
|
onSubmit: () => {
|
|
76
80
|
}
|
|
77
81
|
}), []);
|
|
78
|
-
|
|
79
|
-
const
|
|
82
|
+
te(C, () => O.current ?? R, [R]);
|
|
83
|
+
const q = M(
|
|
80
84
|
async (o) => {
|
|
81
|
-
if (!!!(
|
|
85
|
+
if (!!!(i || n === "perField" || s))
|
|
82
86
|
return;
|
|
83
|
-
const
|
|
84
|
-
}),
|
|
87
|
+
const J = i || n === "perField" ? I : s ?? (() => {
|
|
88
|
+
}), K = ce(
|
|
85
89
|
o,
|
|
86
|
-
|
|
87
|
-
),
|
|
90
|
+
e?.fields ?? []
|
|
91
|
+
), Q = fe(K, e?.fields ?? []);
|
|
88
92
|
try {
|
|
89
|
-
await
|
|
93
|
+
await J(Q), d("success");
|
|
90
94
|
} catch {
|
|
91
95
|
d("error");
|
|
92
96
|
}
|
|
93
97
|
},
|
|
94
|
-
[
|
|
95
|
-
),
|
|
98
|
+
[I, s, i, e?.fields, n]
|
|
99
|
+
), G = M(
|
|
96
100
|
(o) => {
|
|
97
|
-
d("error"),
|
|
101
|
+
d("error"), y?.(o);
|
|
98
102
|
},
|
|
99
|
-
[
|
|
103
|
+
[y]
|
|
100
104
|
);
|
|
101
|
-
return
|
|
102
|
-
|
|
105
|
+
return L ? /* @__PURE__ */ r(
|
|
106
|
+
se,
|
|
103
107
|
{
|
|
104
|
-
ownerState:
|
|
105
|
-
className:
|
|
108
|
+
ownerState: B,
|
|
109
|
+
className: N(v, b.contentRoot),
|
|
106
110
|
...typeof m == "string" ? { "data-meta": m } : {},
|
|
107
|
-
...process.env.NODE_ENV !== "production" ? { [
|
|
108
|
-
children: /* @__PURE__ */ r(
|
|
111
|
+
...process.env.NODE_ENV !== "production" ? { [ie]: f } : {},
|
|
112
|
+
children: /* @__PURE__ */ r(ne, {})
|
|
109
113
|
}
|
|
110
|
-
) :
|
|
111
|
-
|
|
114
|
+
) : e ? p ? /* @__PURE__ */ r(
|
|
115
|
+
P,
|
|
112
116
|
{
|
|
113
|
-
data:
|
|
117
|
+
data: e,
|
|
114
118
|
currentSize: l,
|
|
115
|
-
fieldWrapperClassName:
|
|
116
|
-
dataTestId:
|
|
119
|
+
fieldWrapperClassName: E,
|
|
120
|
+
dataTestId: f,
|
|
117
121
|
dataMeta: m,
|
|
118
|
-
coupled:
|
|
119
|
-
readOnly:
|
|
120
|
-
suppressFormHeader:
|
|
121
|
-
fieldFlow: u
|
|
122
|
+
coupled: p,
|
|
123
|
+
readOnly: a,
|
|
124
|
+
suppressFormHeader: h,
|
|
125
|
+
fieldFlow: u,
|
|
126
|
+
contractIssues: F.issues
|
|
122
127
|
}
|
|
123
128
|
) : /* @__PURE__ */ r(
|
|
124
|
-
|
|
129
|
+
ae,
|
|
125
130
|
{
|
|
126
131
|
ref: O,
|
|
127
|
-
values:
|
|
128
|
-
validationSchema:
|
|
129
|
-
onSubmit:
|
|
130
|
-
onSubmitError:
|
|
131
|
-
statusLoad:
|
|
132
|
+
values: Y,
|
|
133
|
+
validationSchema: j,
|
|
134
|
+
onSubmit: q,
|
|
135
|
+
onSubmitError: G,
|
|
136
|
+
statusLoad: U,
|
|
132
137
|
mode: "onSubmit",
|
|
133
|
-
className:
|
|
138
|
+
className: N(v, b.contentRoot, b.formProvider),
|
|
134
139
|
children: /* @__PURE__ */ r(
|
|
135
|
-
|
|
140
|
+
P,
|
|
136
141
|
{
|
|
137
|
-
data:
|
|
142
|
+
data: e,
|
|
138
143
|
currentSize: l,
|
|
139
|
-
fieldWrapperClassName:
|
|
140
|
-
dataTestId:
|
|
144
|
+
fieldWrapperClassName: E,
|
|
145
|
+
dataTestId: f,
|
|
141
146
|
dataMeta: m,
|
|
142
|
-
coupled:
|
|
143
|
-
readOnly:
|
|
144
|
-
suppressFormHeader:
|
|
147
|
+
coupled: p,
|
|
148
|
+
readOnly: a,
|
|
149
|
+
suppressFormHeader: h,
|
|
145
150
|
fieldFlow: u,
|
|
151
|
+
contractIssues: F.issues,
|
|
146
152
|
actionFormIntroProps: x,
|
|
147
|
-
renderActions:
|
|
148
|
-
submitFeedbackStatus:
|
|
153
|
+
renderActions: W,
|
|
154
|
+
submitFeedbackStatus: S
|
|
149
155
|
}
|
|
150
156
|
)
|
|
151
157
|
}
|
|
152
158
|
) : null;
|
|
153
159
|
});
|
|
154
|
-
|
|
160
|
+
Fe.displayName = "DynamicForm";
|
|
155
161
|
export {
|
|
156
|
-
|
|
162
|
+
Fe as DynamicForm
|
|
157
163
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicForm.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/DynamicForm.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DynamicForm.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/DynamicForm.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAgNjB,eAAO,MAAM,eAAe,EAAE,iBAiV7B,CAAC"}
|
|
@@ -1,76 +1,77 @@
|
|
|
1
1
|
import { CHECKABLE_LIST_DEFAULT_MIN_HEIGHT as m } from "../CheckableList/constants.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
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 = {
|
|
4
5
|
gridColumn: "1 / -1",
|
|
5
6
|
maxWidth: "100%",
|
|
6
7
|
width: "100%",
|
|
7
8
|
minWidth: "0",
|
|
8
9
|
flex: "1 1 100%"
|
|
9
|
-
},
|
|
10
|
-
(
|
|
11
|
-
gridTemplateColumns: `repeat(${
|
|
12
|
-
},
|
|
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),
|
|
13
14
|
{}
|
|
14
|
-
),
|
|
15
|
+
), y = [
|
|
15
16
|
{
|
|
16
17
|
columns: c,
|
|
17
18
|
minContainerWidth: (l[0]?.maxContainerWidth ?? 0) + 1
|
|
18
19
|
},
|
|
19
20
|
...l.map(
|
|
20
|
-
(
|
|
21
|
-
columns:
|
|
22
|
-
maxContainerWidth:
|
|
23
|
-
minContainerWidth: (l[
|
|
21
|
+
(i, t) => ({
|
|
22
|
+
columns: i.columns,
|
|
23
|
+
maxContainerWidth: i.maxContainerWidth,
|
|
24
|
+
minContainerWidth: (l[t + 1]?.maxContainerWidth ?? -1) + 1
|
|
24
25
|
})
|
|
25
26
|
)
|
|
26
27
|
];
|
|
27
|
-
function C(
|
|
28
|
-
return typeof
|
|
28
|
+
function C(i) {
|
|
29
|
+
return typeof i == "number" && Number.isFinite(i) && i > 0;
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
+
function p(i) {
|
|
31
32
|
return {
|
|
32
|
-
gridColumn: `span ${
|
|
33
|
+
gridColumn: `span ${i}`
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function u(i, t) {
|
|
36
37
|
const e = [];
|
|
37
|
-
return
|
|
38
|
+
return i > 0 && e.push(`(min-width: ${i}px)`), typeof t == "number" && e.push(`(max-width: ${t}px)`), `@container ${s} ${e.join(
|
|
38
39
|
" and "
|
|
39
40
|
)}`;
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
return
|
|
42
|
+
function W(i) {
|
|
43
|
+
return i.minContainerWidth > 0 ? i.minContainerWidth : i.maxContainerWidth ?? 1;
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
+
function b(i, t, e, n) {
|
|
45
46
|
for (let r = n - 1; r >= 1; r -= 1) {
|
|
46
|
-
const o =
|
|
47
|
+
const o = S(
|
|
47
48
|
e,
|
|
48
49
|
r,
|
|
49
|
-
|
|
50
|
+
t.columns
|
|
50
51
|
);
|
|
51
|
-
o <=
|
|
52
|
+
o <= t.minContainerWidth || typeof t.maxContainerWidth == "number" && o > t.maxContainerWidth || (i[u(
|
|
52
53
|
o,
|
|
53
|
-
|
|
54
|
-
)] =
|
|
54
|
+
t.maxContainerWidth
|
|
55
|
+
)] = p(r));
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
-
if (C(
|
|
58
|
+
function v(i, t) {
|
|
59
|
+
if (C(t)) {
|
|
59
60
|
const e = {
|
|
60
61
|
justifySelf: "start",
|
|
61
62
|
maxWidth: "100%",
|
|
62
|
-
width: `min(100%, ${Math.ceil(
|
|
63
|
+
width: `min(100%, ${Math.ceil(t)}px)`
|
|
63
64
|
};
|
|
64
|
-
return
|
|
65
|
-
const o =
|
|
66
|
-
|
|
65
|
+
return y.forEach((n, r) => {
|
|
66
|
+
const o = x(
|
|
67
|
+
t,
|
|
67
68
|
n.columns,
|
|
68
|
-
|
|
69
|
-
), a =
|
|
70
|
-
r === 0 ? Object.assign(e, a) : e[
|
|
69
|
+
W(n)
|
|
70
|
+
), a = p(o);
|
|
71
|
+
r === 0 ? Object.assign(e, a) : e[u(0, n.maxContainerWidth)] = a, b(
|
|
71
72
|
e,
|
|
72
73
|
n,
|
|
73
|
-
|
|
74
|
+
t,
|
|
74
75
|
o
|
|
75
76
|
);
|
|
76
77
|
}), e;
|
|
@@ -78,19 +79,19 @@ function b(t, i) {
|
|
|
78
79
|
return l.reduce(
|
|
79
80
|
(e, n) => (e[`@container ${s} (max-width: ${n.maxContainerWidth}px)`] = {
|
|
80
81
|
gridColumn: `span ${h(
|
|
81
|
-
|
|
82
|
+
i,
|
|
82
83
|
n.columns
|
|
83
84
|
)}`
|
|
84
85
|
}, e),
|
|
85
86
|
{
|
|
86
87
|
gridColumn: `span ${h(
|
|
87
|
-
|
|
88
|
+
i,
|
|
88
89
|
c
|
|
89
90
|
)}`
|
|
90
91
|
}
|
|
91
92
|
);
|
|
92
93
|
}
|
|
93
|
-
const
|
|
94
|
+
const _ = {
|
|
94
95
|
/**
|
|
95
96
|
* Styles for the RHFormProvider wrapper.
|
|
96
97
|
*/
|
|
@@ -105,38 +106,38 @@ const T = {
|
|
|
105
106
|
* Styles for the form content container (inner div).
|
|
106
107
|
* Uses a vertical flex axis so growable fields can consume available height.
|
|
107
108
|
*/
|
|
108
|
-
contentRoot: ({ theme:
|
|
109
|
-
const e =
|
|
109
|
+
contentRoot: ({ theme: i, ownerState: t }) => {
|
|
110
|
+
const e = t;
|
|
110
111
|
return {
|
|
111
112
|
display: "flex",
|
|
112
113
|
flexDirection: "column",
|
|
113
114
|
alignItems: "stretch",
|
|
114
|
-
gap:
|
|
115
|
+
gap: i.vars.size.baseSpacings.sp4,
|
|
115
116
|
width: "100%",
|
|
116
117
|
height: "100%",
|
|
117
118
|
minHeight: 0,
|
|
118
119
|
boxSizing: "border-box",
|
|
119
120
|
containerName: s,
|
|
120
121
|
containerType: "inline-size",
|
|
121
|
-
padding:
|
|
122
|
+
padding: i.vars.size.baseSpacings.sp2,
|
|
122
123
|
...e?.fieldFlow === "verticalStack" && {
|
|
123
124
|
flex: "1 1 auto"
|
|
124
125
|
},
|
|
125
126
|
"& .MuiLinearProgress-root": {
|
|
126
|
-
backgroundColor:
|
|
127
|
+
backgroundColor: i.vars.palette.primary.opacity
|
|
127
128
|
}
|
|
128
129
|
};
|
|
129
130
|
},
|
|
130
131
|
/**
|
|
131
132
|
* Styles for normal-field flow segments.
|
|
132
133
|
*/
|
|
133
|
-
fieldsFlow: ({ theme:
|
|
134
|
+
fieldsFlow: ({ theme: i, ownerState: t }) => t?.fieldFlow === "verticalStack" ? {
|
|
134
135
|
display: "flex",
|
|
135
136
|
flexDirection: "column",
|
|
136
137
|
alignItems: "stretch",
|
|
137
138
|
alignContent: "stretch",
|
|
138
139
|
flexWrap: "nowrap",
|
|
139
|
-
gap:
|
|
140
|
+
gap: i.vars.size.baseSpacings.sp4,
|
|
140
141
|
width: "100%",
|
|
141
142
|
minWidth: 0,
|
|
142
143
|
boxSizing: "border-box",
|
|
@@ -147,22 +148,38 @@ const T = {
|
|
|
147
148
|
gridAutoFlow: "row",
|
|
148
149
|
alignItems: "start",
|
|
149
150
|
alignContent: "start",
|
|
150
|
-
gap:
|
|
151
|
+
gap: i.vars.size.baseSpacings.sp4,
|
|
151
152
|
width: "100%",
|
|
152
153
|
minWidth: 0,
|
|
153
154
|
boxSizing: "border-box",
|
|
154
155
|
flex: "0 0 auto",
|
|
155
|
-
...
|
|
156
|
+
...w
|
|
156
157
|
},
|
|
158
|
+
/** Arrange section containers without forcing narrow input columns. */
|
|
159
|
+
sectionsGrid: ({ theme: i, ownerState: t }) => ({
|
|
160
|
+
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,
|
|
163
|
+
alignItems: "stretch",
|
|
164
|
+
width: "100%",
|
|
165
|
+
minWidth: 0,
|
|
166
|
+
boxSizing: "border-box"
|
|
167
|
+
}),
|
|
168
|
+
/** Surface for fields outside groups when at least one section is visible. */
|
|
169
|
+
ungroupedCard: ({ theme: i }) => ({
|
|
170
|
+
...f(i),
|
|
171
|
+
containerName: s,
|
|
172
|
+
containerType: "inline-size"
|
|
173
|
+
}),
|
|
157
174
|
/**
|
|
158
175
|
* Styles for the optional form header rendered before the dynamic fields.
|
|
159
176
|
*/
|
|
160
|
-
formHeader: ({ theme:
|
|
177
|
+
formHeader: ({ theme: i }) => ({
|
|
161
178
|
width: "100%",
|
|
162
179
|
flex: "0 0 auto",
|
|
163
180
|
display: "flex",
|
|
164
181
|
flexDirection: "column",
|
|
165
|
-
gap:
|
|
182
|
+
gap: i.vars.size.baseSpacings.sp1,
|
|
166
183
|
minWidth: 0
|
|
167
184
|
}),
|
|
168
185
|
/**
|
|
@@ -188,17 +205,17 @@ const T = {
|
|
|
188
205
|
* `ownerState.gridColumnSpan` places adaptive fields on the semantic grid while
|
|
189
206
|
* PropertyValue keeps the rendered control fixed to the backend semantic width.
|
|
190
207
|
*/
|
|
191
|
-
fieldWrapper: ({ theme:
|
|
192
|
-
const e =
|
|
193
|
-
let r =
|
|
194
|
-
e?.isFullWidth !== !0 && typeof e?.gridColumnSpan == "number" && (r =
|
|
208
|
+
fieldWrapper: ({ theme: i, ownerState: t }) => {
|
|
209
|
+
const e = t, n = e?.fieldFlow === "verticalStack";
|
|
210
|
+
let r = g;
|
|
211
|
+
e?.isFullWidth !== !0 && typeof e?.gridColumnSpan == "number" && (r = v(
|
|
195
212
|
e.gridColumnSpan,
|
|
196
213
|
e.wrapperWidth
|
|
197
214
|
));
|
|
198
215
|
const o = {
|
|
199
216
|
display: "flex",
|
|
200
217
|
flexDirection: "column",
|
|
201
|
-
gap:
|
|
218
|
+
gap: i.vars.size.baseSpacings.sp1,
|
|
202
219
|
minWidth: 0
|
|
203
220
|
}, a = {
|
|
204
221
|
"& > *": {
|
|
@@ -310,12 +327,12 @@ const T = {
|
|
|
310
327
|
/**
|
|
311
328
|
* Styles for the section divider (for future use).
|
|
312
329
|
*/
|
|
313
|
-
sectionDivider: ({ theme:
|
|
330
|
+
sectionDivider: ({ theme: i }) => ({
|
|
314
331
|
width: "100%",
|
|
315
|
-
height:
|
|
316
|
-
backgroundColor:
|
|
317
|
-
marginTop:
|
|
318
|
-
marginBottom:
|
|
332
|
+
height: i.vars.size.borderStroke.container,
|
|
333
|
+
backgroundColor: i.vars.palette.border.main,
|
|
334
|
+
marginTop: i.vars.size.baseSpacings.sp2,
|
|
335
|
+
marginBottom: i.vars.size.baseSpacings.sp2
|
|
319
336
|
}),
|
|
320
337
|
/**
|
|
321
338
|
* Styles for the CheckableList wrapper inside the vertical grow field.
|
|
@@ -347,5 +364,5 @@ const T = {
|
|
|
347
364
|
})
|
|
348
365
|
};
|
|
349
366
|
export {
|
|
350
|
-
|
|
367
|
+
_ as componentStyles
|
|
351
368
|
};
|
|
@@ -10,7 +10,7 @@ export declare const DYNAMIC_FORM_KEY_COMPONENT = "M4LDynamicForm";
|
|
|
10
10
|
/**
|
|
11
11
|
* CSS class inventory for the component.
|
|
12
12
|
*/
|
|
13
|
-
export declare const DYNAMIC_FORM_CLASSES: Record<"label" | "helperText" | "sectionDivider" | "contentRoot" | "formProvider" | "formHeader" | "formTitle" | "formDescription" | "fieldsFlow" | "fieldWrapper" | "submitFeedback" | "actionsRow" | "checkableListWrapper" | "fallbackEndIconChip", string>;
|
|
13
|
+
export declare const DYNAMIC_FORM_CLASSES: Record<"label" | "helperText" | "sectionDivider" | "contentRoot" | "formProvider" | "formHeader" | "formTitle" | "formDescription" | "fieldsFlow" | "sectionsGrid" | "ungroupedCard" | "fieldWrapper" | "submitFeedback" | "actionsRow" | "checkableListWrapper" | "fallbackEndIconChip", string>;
|
|
14
14
|
/**
|
|
15
15
|
* Default shortcut used by DynamicForm date-range fields when the backend omits or sends an invalid shortcut.
|
|
16
16
|
*/
|
|
@@ -26,14 +26,14 @@ export declare const ALWAYS_MULTIPLE_OPTION_COMPONENT_IDS: readonly ["RHFCheckab
|
|
|
26
26
|
/**
|
|
27
27
|
* Field type IDs whose RHF state is an array (multiselect variants).
|
|
28
28
|
*/
|
|
29
|
-
export declare const ARRAY_FIELD_TYPE_IDS: Set<"fft_text" | "fft_number" | "fft_decimal_number" | "fft_email" | "fft_select_number" | "fft_select_text" | "fft_multiselect_number" | "fft_multiselect_text" | "fft_icon" | "fft_resource_dictionary" | "fft_boolean" | "fft_date_range">;
|
|
29
|
+
export declare const ARRAY_FIELD_TYPE_IDS: Set<"fft_text" | "fft_number" | "fft_decimal_number" | "fft_email" | "fft_select_number" | "fft_select_text" | "fft_multiselect_number" | "fft_multiselect_text" | "fft_icon" | "fft_resource_dictionary" | "fft_boolean" | "fft_date_range" | "fft_alert" | "fft_section">;
|
|
30
30
|
/**
|
|
31
31
|
* Field type IDs that map to a numeric Yup schema.
|
|
32
32
|
*/
|
|
33
|
-
export declare const NUMBER_FIELD_TYPE_IDS: Set<"fft_text" | "fft_number" | "fft_decimal_number" | "fft_email" | "fft_select_number" | "fft_select_text" | "fft_multiselect_number" | "fft_multiselect_text" | "fft_icon" | "fft_resource_dictionary" | "fft_boolean" | "fft_date_range">;
|
|
33
|
+
export declare const NUMBER_FIELD_TYPE_IDS: Set<"fft_text" | "fft_number" | "fft_decimal_number" | "fft_email" | "fft_select_number" | "fft_select_text" | "fft_multiselect_number" | "fft_multiselect_text" | "fft_icon" | "fft_resource_dictionary" | "fft_boolean" | "fft_date_range" | "fft_alert" | "fft_section">;
|
|
34
34
|
/**
|
|
35
35
|
* Field type IDs that map to a string Yup schema via an explicit text field component.
|
|
36
36
|
*/
|
|
37
|
-
export declare const TEXT_FIELD_TYPE_IDS: Set<"fft_text" | "fft_number" | "fft_decimal_number" | "fft_email" | "fft_select_number" | "fft_select_text" | "fft_multiselect_number" | "fft_multiselect_text" | "fft_icon" | "fft_resource_dictionary" | "fft_boolean" | "fft_date_range">;
|
|
37
|
+
export declare const TEXT_FIELD_TYPE_IDS: Set<"fft_text" | "fft_number" | "fft_decimal_number" | "fft_email" | "fft_select_number" | "fft_select_text" | "fft_multiselect_number" | "fft_multiselect_text" | "fft_icon" | "fft_resource_dictionary" | "fft_boolean" | "fft_date_range" | "fft_alert" | "fft_section">;
|
|
38
38
|
export declare const EMPTY_DATA: DynamicFormApiResponse;
|
|
39
39
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EAGvB,MAAM,SAAS,CAAC;AAEjB;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,mBAAmB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EAGvB,MAAM,SAAS,CAAC;AAEjB;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,mBAAmB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,oBAAoB,mSAGhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wCAAwC,UAAU,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,0BAA0B,mJAQoB,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,oCAAoC,sDAGU,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,oBAAoB,6QAG/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB,6QAGhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB,6QAI9B,CAAC;AAEH,eAAO,MAAM,UAAU,EAAE,sBAKxB,CAAC"}
|
|
@@ -21,5 +21,9 @@ export declare const DYNAMIC_FORM_DICTIONARY: {
|
|
|
21
21
|
SUBMIT_SUCCESS_MESSAGE: string;
|
|
22
22
|
/** Shown when the last decoupled DynamicForm submit fails. */
|
|
23
23
|
SUBMIT_ERROR_MESSAGE: string;
|
|
24
|
+
/** Shown when a section lacks its title in the backend contract. */
|
|
25
|
+
SECTION_TITLE_FALLBACK: string;
|
|
26
|
+
/** Shown once when malformed grouping metadata hides an otherwise expected element. */
|
|
27
|
+
SECTION_CONTRACT_NOTICE: string;
|
|
24
28
|
};
|
|
25
29
|
//# sourceMappingURL=dictionary.d.ts.map
|
|
@@ -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;;
|
|
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"}
|
|
@@ -18,7 +18,11 @@ const _ = "dynamic_form", e = () => [_], E = {
|
|
|
18
18
|
/** Shown when the last decoupled DynamicForm submit completes successfully. */
|
|
19
19
|
SUBMIT_SUCCESS_MESSAGE: `${_}.submit_success_message`,
|
|
20
20
|
/** Shown when the last decoupled DynamicForm submit fails. */
|
|
21
|
-
SUBMIT_ERROR_MESSAGE: `${_}.submit_error_message
|
|
21
|
+
SUBMIT_ERROR_MESSAGE: `${_}.submit_error_message`,
|
|
22
|
+
/** Shown when a section lacks its title in the backend contract. */
|
|
23
|
+
SECTION_TITLE_FALLBACK: `${_}.section_title_fallback`,
|
|
24
|
+
/** Shown once when malformed grouping metadata hides an otherwise expected element. */
|
|
25
|
+
SECTION_CONTRACT_NOTICE: `${_}.section_contract_notice`
|
|
22
26
|
};
|
|
23
27
|
export {
|
|
24
28
|
E as DYNAMIC_FORM_DICTIONARY,
|
|
@@ -17,6 +17,8 @@ export declare const DYNAMIC_FORM_FIELD_COMPONENT_ALLOWLIST: {
|
|
|
17
17
|
readonly fft_resource_dictionary: readonly ["RHFResourceDictionary"];
|
|
18
18
|
readonly fft_boolean: readonly ["RHFCheckbox"];
|
|
19
19
|
readonly fft_date_range: readonly ["RHFDateTimeRangePicker"];
|
|
20
|
+
readonly fft_alert: readonly ["Alert"];
|
|
21
|
+
readonly fft_section: readonly ["Section"];
|
|
20
22
|
};
|
|
21
23
|
/** Return true when the field-type id is declared in the DynamicForm backend contract. */
|
|
22
24
|
export declare function isAllowedFieldTypeId(fieldTypeId: string | null | undefined): fieldTypeId is DynamicFormFieldTypeId;
|
|
@@ -58,4 +60,6 @@ export declare function isAllowedFieldCurrentValue(field: Pick<Field, 'currentVa
|
|
|
58
60
|
export declare function isAllowedFieldOptionPaths(field: Pick<Field, 'fieldType' | 'options'>): boolean;
|
|
59
61
|
/** Return true when a field can be rendered with its declared RHF component. */
|
|
60
62
|
export declare function isSupportedDynamicFormField(field: Pick<Field, 'currentValue' | 'endpoint' | 'fieldType' | 'options'>): boolean;
|
|
63
|
+
/** Identify a supported display-only field that should not enter form state. */
|
|
64
|
+
export declare function isSupportedInformationalField(field: Pick<Field, 'currentValue' | 'endpoint' | 'fieldType' | 'options'>): boolean;
|
|
61
65
|
//# sourceMappingURL=fieldContractAllowlist.d.ts.map
|
package/components/DynamicForm/helpers/fieldContractAllowlist/fieldContractAllowlist.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldContractAllowlist.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/helpers/fieldContractAllowlist/fieldContractAllowlist.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,KAAK,EACV,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AAgBrB;;;;GAIG;AACH,eAAO,MAAM,sCAAsC
|
|
1
|
+
{"version":3,"file":"fieldContractAllowlist.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/helpers/fieldContractAllowlist/fieldContractAllowlist.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,KAAK,EACV,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AAgBrB;;;;GAIG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;CA4BlD,CAAC;AAsBF,0FAA0F;AAC1F,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACrC,WAAW,IAAI,sBAAsB,CAEvC;AAED,yFAAyF;AACzF,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACrC,WAAW,IAAI,2BAA2B,CAI5C;AAED,0FAA0F;AAC1F,wBAAgB,oCAAoC,CAClD,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACrC,SAAS,2BAA2B,EAAE,CAIxC;AA0JD,mGAAmG;AACnG,wBAAgB,sBAAsB,CACpC,SAAS,EACL,IAAI,CAAC,SAAS,EAAE,IAAI,GAAG,aAAa,GAAG,gBAAgB,CAAC,GACxD,IAAI,GACJ,SAAS,GACZ,SAAS,IAAI,IAAI,CAAC,SAAS,EAAE,IAAI,GAAG,aAAa,GAAG,gBAAgB,CAAC,GAAG;IACzE,EAAE,EAAE,sBAAsB,CAAC;IAC3B,WAAW,EAAE,2BAA2B,CAAC;CAC1C,CAYA;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,GAAG,WAAW,CAAC,GAC5D,OAAO,CAwCT;AASD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC,GAC1C,OAAO,CA0GT;AAED,gFAAgF;AAChF,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC,GACxE,OAAO,CAOT;AAED,gFAAgF;AAChF,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC,GACxE,OAAO,CAGT"}
|