@m4l/components 9.57.1-beta-hotfix-semantic-width-dynamicform.0 → 9.57.1-beta-hotfix-semantic-width-dynamicform.2
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.styles.d.ts.map +1 -1
- package/components/DynamicForm/DynamicForm.styles.js +146 -46
- package/components/DynamicForm/helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.d.ts +24 -0
- package/components/DynamicForm/helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.d.ts.map +1 -1
- package/components/DynamicForm/helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.js +154 -44
- package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.d.ts.map +1 -1
- package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.js +42 -41
- package/components/DynamicForm/types.d.ts +10 -10
- package/components/Label/Label.styles.d.ts.map +1 -1
- package/components/Label/Label.styles.js +7 -1
- package/components/PropertyValue/PropertyValue.d.ts.map +1 -1
- package/components/PropertyValue/PropertyValue.js +37 -37
- package/components/PropertyValue/PropertyValue.styles.d.ts.map +1 -1
- package/components/PropertyValue/PropertyValue.styles.js +53 -49
- package/components/PropertyValue/constants.d.ts +1 -0
- package/components/PropertyValue/constants.d.ts.map +1 -1
- package/components/PropertyValue/constants.js +10 -4
- package/package.json +5 -5
|
@@ -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":"AACA,OAAO,KAAK,EAGV,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAgNjB,eAAO,MAAM,eAAe,EAAE,iBA0T7B,CAAC"}
|
|
@@ -1,15 +1,96 @@
|
|
|
1
|
-
import { CHECKABLE_LIST_DEFAULT_MIN_HEIGHT as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
minWidth: `min(100%, ${t}px)`,
|
|
6
|
-
maxWidth: "100%"
|
|
7
|
-
}), m = {
|
|
1
|
+
import { CHECKABLE_LIST_DEFAULT_MIN_HEIGHT as m } from "../CheckableList/constants.js";
|
|
2
|
+
import { DYNAMIC_FORM_SEMANTIC_GRID_COLUMN_BREAKPOINTS as l, DYNAMIC_FORM_SEMANTIC_GRID_MAX_COLUMNS as c, resolveSemanticGridSpanForContainerWidth as f, resolveSemanticGridSpanForColumnCount as h, resolveSemanticGridContainerWidthForSpan as x } from "./helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.js";
|
|
3
|
+
const s = "m4l-dynamic-form-content", S = {
|
|
4
|
+
gridColumn: "1 / -1",
|
|
8
5
|
maxWidth: "100%",
|
|
9
6
|
width: "100%",
|
|
10
7
|
minWidth: "0",
|
|
11
8
|
flex: "1 1 100%"
|
|
12
|
-
}, g =
|
|
9
|
+
}, g = l.reduce(
|
|
10
|
+
(t, i) => (t[`@container ${s} (max-width: ${i.maxContainerWidth}px)`] = {
|
|
11
|
+
gridTemplateColumns: `repeat(${i.columns}, minmax(0, 1fr))`
|
|
12
|
+
}, t),
|
|
13
|
+
{}
|
|
14
|
+
), w = [
|
|
15
|
+
{
|
|
16
|
+
columns: c,
|
|
17
|
+
minContainerWidth: (l[0]?.maxContainerWidth ?? 0) + 1
|
|
18
|
+
},
|
|
19
|
+
...l.map(
|
|
20
|
+
(t, i) => ({
|
|
21
|
+
columns: t.columns,
|
|
22
|
+
maxContainerWidth: t.maxContainerWidth,
|
|
23
|
+
minContainerWidth: (l[i + 1]?.maxContainerWidth ?? -1) + 1
|
|
24
|
+
})
|
|
25
|
+
)
|
|
26
|
+
];
|
|
27
|
+
function C(t) {
|
|
28
|
+
return typeof t == "number" && Number.isFinite(t) && t > 0;
|
|
29
|
+
}
|
|
30
|
+
function u(t) {
|
|
31
|
+
return {
|
|
32
|
+
gridColumn: `span ${t}`
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function p(t, i) {
|
|
36
|
+
const e = [];
|
|
37
|
+
return t > 0 && e.push(`(min-width: ${t}px)`), typeof i == "number" && e.push(`(max-width: ${i}px)`), `@container ${s} ${e.join(
|
|
38
|
+
" and "
|
|
39
|
+
)}`;
|
|
40
|
+
}
|
|
41
|
+
function y(t) {
|
|
42
|
+
return t.minContainerWidth > 0 ? t.minContainerWidth : t.maxContainerWidth ?? 1;
|
|
43
|
+
}
|
|
44
|
+
function W(t, i, e, n) {
|
|
45
|
+
for (let r = n - 1; r >= 1; r -= 1) {
|
|
46
|
+
const o = x(
|
|
47
|
+
e,
|
|
48
|
+
r,
|
|
49
|
+
i.columns
|
|
50
|
+
);
|
|
51
|
+
o <= i.minContainerWidth || typeof i.maxContainerWidth == "number" && o > i.maxContainerWidth || (t[p(
|
|
52
|
+
o,
|
|
53
|
+
i.maxContainerWidth
|
|
54
|
+
)] = u(r));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function b(t, i) {
|
|
58
|
+
if (C(i)) {
|
|
59
|
+
const e = {
|
|
60
|
+
justifySelf: "start",
|
|
61
|
+
maxWidth: "100%",
|
|
62
|
+
width: `min(100%, ${Math.ceil(i)}px)`
|
|
63
|
+
};
|
|
64
|
+
return w.forEach((n, r) => {
|
|
65
|
+
const o = f(
|
|
66
|
+
i,
|
|
67
|
+
n.columns,
|
|
68
|
+
y(n)
|
|
69
|
+
), a = u(o);
|
|
70
|
+
r === 0 ? Object.assign(e, a) : e[p(0, n.maxContainerWidth)] = a, W(
|
|
71
|
+
e,
|
|
72
|
+
n,
|
|
73
|
+
i,
|
|
74
|
+
o
|
|
75
|
+
);
|
|
76
|
+
}), e;
|
|
77
|
+
}
|
|
78
|
+
return l.reduce(
|
|
79
|
+
(e, n) => (e[`@container ${s} (max-width: ${n.maxContainerWidth}px)`] = {
|
|
80
|
+
gridColumn: `span ${h(
|
|
81
|
+
t,
|
|
82
|
+
n.columns
|
|
83
|
+
)}`
|
|
84
|
+
}, e),
|
|
85
|
+
{
|
|
86
|
+
gridColumn: `span ${h(
|
|
87
|
+
t,
|
|
88
|
+
c
|
|
89
|
+
)}`
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
const T = {
|
|
13
94
|
/**
|
|
14
95
|
* Styles for the RHFormProvider wrapper.
|
|
15
96
|
*/
|
|
@@ -24,8 +105,8 @@ const h = (t) => ({
|
|
|
24
105
|
* Styles for the form content container (inner div).
|
|
25
106
|
* Uses a vertical flex axis so growable fields can consume available height.
|
|
26
107
|
*/
|
|
27
|
-
contentRoot: ({ theme: t, ownerState:
|
|
28
|
-
const e =
|
|
108
|
+
contentRoot: ({ theme: t, ownerState: i }) => {
|
|
109
|
+
const e = i;
|
|
29
110
|
return {
|
|
30
111
|
display: "flex",
|
|
31
112
|
flexDirection: "column",
|
|
@@ -35,6 +116,8 @@ const h = (t) => ({
|
|
|
35
116
|
height: "100%",
|
|
36
117
|
minHeight: 0,
|
|
37
118
|
boxSizing: "border-box",
|
|
119
|
+
containerName: s,
|
|
120
|
+
containerType: "inline-size",
|
|
38
121
|
padding: t.vars.size.baseSpacings.sp2,
|
|
39
122
|
...e?.fieldFlow === "verticalStack" && {
|
|
40
123
|
flex: "1 1 auto"
|
|
@@ -47,20 +130,29 @@ const h = (t) => ({
|
|
|
47
130
|
/**
|
|
48
131
|
* Styles for normal-field flow segments.
|
|
49
132
|
*/
|
|
50
|
-
fieldsFlow: ({ theme: t, ownerState:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
133
|
+
fieldsFlow: ({ theme: t, ownerState: i }) => i?.fieldFlow === "verticalStack" ? {
|
|
134
|
+
display: "flex",
|
|
135
|
+
flexDirection: "column",
|
|
136
|
+
alignItems: "stretch",
|
|
137
|
+
alignContent: "stretch",
|
|
138
|
+
flexWrap: "nowrap",
|
|
139
|
+
gap: t.vars.size.baseSpacings.sp4,
|
|
140
|
+
width: "100%",
|
|
141
|
+
minWidth: 0,
|
|
142
|
+
boxSizing: "border-box",
|
|
143
|
+
flex: "0 0 auto"
|
|
144
|
+
} : {
|
|
145
|
+
display: "grid",
|
|
146
|
+
gridTemplateColumns: `repeat(${c}, minmax(0, 1fr))`,
|
|
147
|
+
gridAutoFlow: "row",
|
|
148
|
+
alignItems: "start",
|
|
149
|
+
alignContent: "start",
|
|
150
|
+
gap: t.vars.size.baseSpacings.sp4,
|
|
151
|
+
width: "100%",
|
|
152
|
+
minWidth: 0,
|
|
153
|
+
boxSizing: "border-box",
|
|
154
|
+
flex: "0 0 auto",
|
|
155
|
+
...g
|
|
64
156
|
},
|
|
65
157
|
/**
|
|
66
158
|
* Styles for the optional form header rendered before the dynamic fields.
|
|
@@ -93,38 +185,41 @@ const h = (t) => ({
|
|
|
93
185
|
}),
|
|
94
186
|
/**
|
|
95
187
|
* Styles for each form field wrapper.
|
|
96
|
-
* `ownerState.
|
|
97
|
-
*
|
|
188
|
+
* `ownerState.gridColumnSpan` places adaptive fields on the semantic grid while
|
|
189
|
+
* PropertyValue keeps the rendered control fixed to the backend semantic width.
|
|
98
190
|
*/
|
|
99
|
-
fieldWrapper: ({ theme: t, ownerState:
|
|
100
|
-
const e =
|
|
101
|
-
let
|
|
102
|
-
e?.isFullWidth !== !0 &&
|
|
103
|
-
|
|
191
|
+
fieldWrapper: ({ theme: t, ownerState: i }) => {
|
|
192
|
+
const e = i, n = e?.fieldFlow === "verticalStack";
|
|
193
|
+
let r = S;
|
|
194
|
+
e?.isFullWidth !== !0 && typeof e?.gridColumnSpan == "number" && (r = b(
|
|
195
|
+
e.gridColumnSpan,
|
|
196
|
+
e.wrapperWidth
|
|
197
|
+
));
|
|
198
|
+
const o = {
|
|
104
199
|
display: "flex",
|
|
105
200
|
flexDirection: "column",
|
|
106
201
|
gap: t.vars.size.baseSpacings.sp1,
|
|
107
202
|
minWidth: 0
|
|
108
|
-
},
|
|
203
|
+
}, a = {
|
|
109
204
|
"& > *": {
|
|
110
205
|
width: "100%",
|
|
111
206
|
maxWidth: "100%",
|
|
112
207
|
minWidth: 0
|
|
113
208
|
}
|
|
114
|
-
},
|
|
209
|
+
}, d = {
|
|
115
210
|
...e?.disabled && {
|
|
116
211
|
pointerEvents: "none",
|
|
117
212
|
opacity: 0.5
|
|
118
213
|
}
|
|
119
214
|
};
|
|
120
215
|
return e?.layout === "verticalGrow" ? {
|
|
121
|
-
...
|
|
216
|
+
...o,
|
|
122
217
|
width: "100%",
|
|
123
218
|
maxWidth: "100%",
|
|
124
|
-
flex: `1 1 ${
|
|
219
|
+
flex: `1 1 ${m}px`,
|
|
125
220
|
alignSelf: "stretch",
|
|
126
|
-
minHeight:
|
|
127
|
-
...
|
|
221
|
+
minHeight: m,
|
|
222
|
+
...a,
|
|
128
223
|
"& > .M4LPropertyValue-root": {
|
|
129
224
|
width: "100%",
|
|
130
225
|
maxWidth: "100%",
|
|
@@ -142,21 +237,26 @@ const h = (t) => ({
|
|
|
142
237
|
minHeight: 0,
|
|
143
238
|
whiteSpace: "normal"
|
|
144
239
|
},
|
|
145
|
-
...
|
|
146
|
-
} :
|
|
147
|
-
...
|
|
240
|
+
...d
|
|
241
|
+
} : n ? {
|
|
242
|
+
...o,
|
|
148
243
|
width: "100%",
|
|
149
244
|
maxWidth: "100%",
|
|
150
245
|
flex: "0 0 auto",
|
|
151
246
|
alignSelf: "stretch",
|
|
152
|
-
...
|
|
153
|
-
...
|
|
247
|
+
...a,
|
|
248
|
+
...d
|
|
154
249
|
} : {
|
|
250
|
+
...o,
|
|
251
|
+
width: "100%",
|
|
252
|
+
maxWidth: "100%",
|
|
253
|
+
alignSelf: "start",
|
|
155
254
|
...r,
|
|
156
|
-
alignSelf: "flex-start",
|
|
157
255
|
...a,
|
|
158
|
-
...
|
|
159
|
-
|
|
256
|
+
...d,
|
|
257
|
+
"&&& .M4LPropertyValue-name": {
|
|
258
|
+
width: "fit-content"
|
|
259
|
+
}
|
|
160
260
|
};
|
|
161
261
|
},
|
|
162
262
|
/**
|
|
@@ -247,5 +347,5 @@ const h = (t) => ({
|
|
|
247
347
|
})
|
|
248
348
|
};
|
|
249
349
|
export {
|
|
250
|
-
|
|
350
|
+
T as componentStyles
|
|
251
351
|
};
|
package/components/DynamicForm/helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.d.ts
CHANGED
|
@@ -13,14 +13,38 @@ export interface ResolveAdaptiveFieldLayoutParams extends EstimateLabelWidthPxPa
|
|
|
13
13
|
export interface AdaptiveFieldLayout {
|
|
14
14
|
controlWidth?: number;
|
|
15
15
|
estimatedLabelWidth: number;
|
|
16
|
+
gridColumnSpan: number;
|
|
16
17
|
isFullWidth: boolean;
|
|
17
18
|
labelWidth?: number;
|
|
18
19
|
requestedSemanticWidth?: SemanticWidthOptions | null;
|
|
19
20
|
wrapperWidth?: number;
|
|
20
21
|
}
|
|
22
|
+
export interface SemanticGridColumnBreakpoint {
|
|
23
|
+
columns: number;
|
|
24
|
+
maxContainerWidth: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const DYNAMIC_FORM_SEMANTIC_GRID_BASE_COLUMN_WIDTH = 37;
|
|
27
|
+
export declare const DYNAMIC_FORM_SEMANTIC_GRID_COLUMN_GAP = 16;
|
|
28
|
+
export declare const DYNAMIC_FORM_SEMANTIC_GRID_MAX_COLUMNS = 24;
|
|
29
|
+
export declare const DYNAMIC_FORM_SEMANTIC_GRID_SPAN_PRECISION_THRESHOLD = 0.06;
|
|
30
|
+
export declare const DYNAMIC_FORM_SEMANTIC_GRID_COLUMN_BREAKPOINTS: readonly SemanticGridColumnBreakpoint[];
|
|
21
31
|
/** Estimate the visual width needed by a single-line DynamicForm label. */
|
|
22
32
|
export declare function estimateLabelWidthPx(params: EstimateLabelWidthPxParams): number;
|
|
23
33
|
/** Resolve wrapper, label, and control widths without replacing the backend semantic width. */
|
|
24
34
|
export declare function resolveAdaptiveFieldLayout(params: ResolveAdaptiveFieldLayoutParams): AdaptiveFieldLayout;
|
|
35
|
+
/** Resolve the precise adaptive wrapper width allowed for a DynamicForm field. */
|
|
36
|
+
export declare function resolveAdaptiveFieldLayoutVisualTrackWidth(requiredWidth: number): number | undefined;
|
|
37
|
+
/** Resolve how many semantic grid columns a field needs to contain its visual width. */
|
|
38
|
+
export declare function resolveSemanticGridFieldColumnSpan(wrapperWidth: number, minimumExactWidth?: number): number;
|
|
39
|
+
/** Clamp a field span to the column count available in the current grid breakpoint. */
|
|
40
|
+
export declare function resolveSemanticGridSpanForColumnCount(fieldColumnSpan: number, columnCount: number): number;
|
|
41
|
+
/** Resolve the approximate rendered width of a semantic grid span. */
|
|
42
|
+
export declare function resolveSemanticGridSpanWidth(columnSpan: number): number;
|
|
43
|
+
/** Resolve the rendered width of a semantic grid span for an actual container width. */
|
|
44
|
+
export declare function resolveSemanticGridSpanWidthForContainer(columnSpan: number, columnCount: number, containerWidth: number): number;
|
|
45
|
+
/** Resolve the minimum container width required for a span to contain a field. */
|
|
46
|
+
export declare function resolveSemanticGridContainerWidthForSpan(requiredWidth: number, columnSpan: number, columnCount: number): number;
|
|
47
|
+
/** Resolve the smallest field span that can contain a width in the active container. */
|
|
48
|
+
export declare function resolveSemanticGridSpanForContainerWidth(requiredWidth: number, columnCount: number, containerWidth: number): number;
|
|
25
49
|
export {};
|
|
26
50
|
//# sourceMappingURL=resolveAdaptiveFieldLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveAdaptiveFieldLayout.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,KAAK,uBAAuB,GAAG,OAAO,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"resolveAdaptiveFieldLayout.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,KAAK,uBAAuB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAkClD,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,uBAAuB,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,gCACf,SAAQ,0BAA0B;IAClC,sBAAsB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACtD;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sBAAsB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAwCD,eAAO,MAAM,4CAA4C,KAAK,CAAC;AAC/D,eAAO,MAAM,qCAAqC,KAAK,CAAC;AACxD,eAAO,MAAM,sCAAsC,KAAK,CAAC;AACzD,eAAO,MAAM,mDAAmD,OAAO,CAAC;AACxE,eAAO,MAAM,6CAA6C,EAAE,SAAS,4BAA4B,EAerF,CAAC;AAOb,2EAA2E;AAC3E,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,0BAA0B,GACjC,MAAM,CAsBR;AAED,+FAA+F;AAC/F,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,gCAAgC,GACvC,mBAAmB,CAqDrB;AAED,kFAAkF;AAClF,wBAAgB,0CAA0C,CACxD,aAAa,EAAE,MAAM,GACpB,MAAM,GAAG,SAAS,CAUpB;AAED,wFAAwF;AACxF,wBAAgB,kCAAkC,CAChD,YAAY,EAAE,MAAM,EACpB,iBAAiB,SAAe,GAC/B,MAAM,CAgCR;AAED,uFAAuF;AACvF,wBAAgB,qCAAqC,CACnD,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,GAClB,MAAM,CAKR;AAED,sEAAsE;AACtE,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAOvE;AAED,wFAAwF;AACxF,wBAAgB,wCAAwC,CACtD,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACrB,MAAM,CAoBR;AAED,kFAAkF;AAClF,wBAAgB,wCAAwC,CACtD,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,MAAM,CAiBR;AAED,wFAAwF;AACxF,wBAAgB,wCAAwC,CACtD,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACrB,MAAM,CAoBR"}
|
package/components/DynamicForm/helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.js
CHANGED
|
@@ -1,64 +1,174 @@
|
|
|
1
|
-
import { isFullRowSemanticWidth as
|
|
2
|
-
const
|
|
1
|
+
import { isFullRowSemanticWidth as A, resolveSemanticWidthPx as p } from "../../../PropertyValue/semanticWidth.js";
|
|
2
|
+
const m = {
|
|
3
|
+
narrow: 0.28,
|
|
4
|
+
normal: 0.6,
|
|
5
|
+
punctuation: 0.28,
|
|
6
|
+
space: 0.26,
|
|
7
|
+
thin: 0.38,
|
|
8
|
+
uppercase: 0.68,
|
|
9
|
+
wide: 0.86
|
|
10
|
+
}, W = {
|
|
3
11
|
small: {
|
|
4
|
-
|
|
5
|
-
helperIcon:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
punctuation: 3,
|
|
10
|
-
space: 4,
|
|
11
|
-
uppercase: 8,
|
|
12
|
-
wide: 10
|
|
12
|
+
fontSize: 10,
|
|
13
|
+
helperIcon: 18,
|
|
14
|
+
letterSpacing: 0.8,
|
|
15
|
+
mandatoryMarker: 9,
|
|
16
|
+
safetyBuffer: 2
|
|
13
17
|
},
|
|
14
18
|
medium: {
|
|
15
|
-
|
|
16
|
-
helperIcon:
|
|
19
|
+
fontSize: 11,
|
|
20
|
+
helperIcon: 20,
|
|
21
|
+
letterSpacing: 0.8,
|
|
17
22
|
mandatoryMarker: 10,
|
|
18
|
-
|
|
19
|
-
normal: 8,
|
|
20
|
-
punctuation: 4,
|
|
21
|
-
space: 5,
|
|
22
|
-
uppercase: 9,
|
|
23
|
-
wide: 11
|
|
23
|
+
safetyBuffer: 2
|
|
24
24
|
}
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
}, d = 796, c = 37, s = 16, l = 24, I = 0.06, L = [
|
|
26
|
+
{ columns: 22, maxContainerWidth: 1255 },
|
|
27
|
+
{ columns: 20, maxContainerWidth: 1149 },
|
|
28
|
+
{ columns: 18, maxContainerWidth: 1043 },
|
|
29
|
+
{ columns: 16, maxContainerWidth: 937 },
|
|
30
|
+
{ columns: 14, maxContainerWidth: 831 },
|
|
31
|
+
{ columns: 12, maxContainerWidth: 725 },
|
|
32
|
+
{ columns: 10, maxContainerWidth: 619 },
|
|
33
|
+
{ columns: 8, maxContainerWidth: 513 },
|
|
34
|
+
{ columns: 6, maxContainerWidth: 407 },
|
|
35
|
+
{ columns: 4, maxContainerWidth: 359 },
|
|
36
|
+
{ columns: 3, maxContainerWidth: 343 },
|
|
37
|
+
{ columns: 2, maxContainerWidth: 335 },
|
|
38
|
+
{ columns: 1, maxContainerWidth: 319 }
|
|
39
|
+
], R = "ijlI|!", N = ".,;:'", x = "ftr()[]{}/\\", E = "mwMW@%#&";
|
|
40
|
+
function F(n) {
|
|
41
|
+
const { hasHelperMessage: t = !1, label: i, mandatory: e = !1, size: o, symbol: r } = n, u = W[o], f = typeof r == "string" && r.trim() !== "" ? `${i} (${r.trim()})` : i, C = Array.from(f), h = C.reduce((M, _) => M + O(_), 0) * u.fontSize + C.length * u.letterSpacing;
|
|
28
42
|
return Math.ceil(
|
|
29
|
-
|
|
43
|
+
h + u.safetyBuffer + (e ? u.mandatoryMarker : 0) + (t ? u.helperIcon : 0)
|
|
30
44
|
);
|
|
31
45
|
}
|
|
32
|
-
function
|
|
33
|
-
const { requestedSemanticWidth:
|
|
34
|
-
if (
|
|
46
|
+
function P(n) {
|
|
47
|
+
const { requestedSemanticWidth: t } = n, i = F(n), e = p(t);
|
|
48
|
+
if (A(t))
|
|
35
49
|
return {
|
|
36
|
-
controlWidth:
|
|
37
|
-
estimatedLabelWidth:
|
|
50
|
+
controlWidth: e,
|
|
51
|
+
estimatedLabelWidth: i,
|
|
52
|
+
gridColumnSpan: l,
|
|
38
53
|
isFullWidth: !0,
|
|
39
|
-
requestedSemanticWidth:
|
|
54
|
+
requestedSemanticWidth: t
|
|
40
55
|
};
|
|
41
|
-
if (!
|
|
56
|
+
if (!e || i > d)
|
|
42
57
|
return {
|
|
43
|
-
controlWidth:
|
|
44
|
-
estimatedLabelWidth:
|
|
58
|
+
controlWidth: e,
|
|
59
|
+
estimatedLabelWidth: i,
|
|
60
|
+
gridColumnSpan: l,
|
|
45
61
|
isFullWidth: !0,
|
|
46
|
-
requestedSemanticWidth:
|
|
62
|
+
requestedSemanticWidth: t
|
|
47
63
|
};
|
|
48
|
-
const
|
|
49
|
-
return {
|
|
50
|
-
controlWidth:
|
|
51
|
-
estimatedLabelWidth:
|
|
64
|
+
const o = Math.max(e, i), r = i <= e ? e : T(o);
|
|
65
|
+
return r ? {
|
|
66
|
+
controlWidth: e,
|
|
67
|
+
estimatedLabelWidth: i,
|
|
68
|
+
gridColumnSpan: D(
|
|
69
|
+
r,
|
|
70
|
+
e
|
|
71
|
+
),
|
|
52
72
|
isFullWidth: !1,
|
|
53
|
-
labelWidth:
|
|
54
|
-
requestedSemanticWidth:
|
|
55
|
-
wrapperWidth:
|
|
73
|
+
labelWidth: r,
|
|
74
|
+
requestedSemanticWidth: t,
|
|
75
|
+
wrapperWidth: r
|
|
76
|
+
} : {
|
|
77
|
+
controlWidth: e,
|
|
78
|
+
estimatedLabelWidth: i,
|
|
79
|
+
gridColumnSpan: l,
|
|
80
|
+
isFullWidth: !0,
|
|
81
|
+
requestedSemanticWidth: t
|
|
56
82
|
};
|
|
57
83
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
84
|
+
function T(n) {
|
|
85
|
+
if (!(!Number.isFinite(n) || n <= 0) && !(n > d))
|
|
86
|
+
return Math.ceil(n);
|
|
87
|
+
}
|
|
88
|
+
function D(n, t = n) {
|
|
89
|
+
if (!Number.isFinite(n))
|
|
90
|
+
return l;
|
|
91
|
+
const i = a(
|
|
92
|
+
Math.ceil(
|
|
93
|
+
(n + s) / (c + s)
|
|
94
|
+
)
|
|
95
|
+
), e = Number.isFinite(t) ? t : n, o = a(
|
|
96
|
+
Math.ceil(
|
|
97
|
+
(e + s) / (c + s)
|
|
98
|
+
)
|
|
99
|
+
), r = Math.max(o, i - 1);
|
|
100
|
+
return r < i && v(n, r) ? r : i;
|
|
101
|
+
}
|
|
102
|
+
function y(n, t) {
|
|
103
|
+
return Math.min(
|
|
104
|
+
a(n),
|
|
105
|
+
a(t)
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
function S(n) {
|
|
109
|
+
const t = a(n);
|
|
110
|
+
return t * c + (t - 1) * s;
|
|
111
|
+
}
|
|
112
|
+
function G(n, t, i) {
|
|
113
|
+
const e = a(t), o = Math.min(
|
|
114
|
+
a(n),
|
|
115
|
+
e
|
|
116
|
+
);
|
|
117
|
+
if (!Number.isFinite(i) || i <= 0)
|
|
118
|
+
return S(o);
|
|
119
|
+
const r = (e - 1) * s, u = Math.max(0, i - r) / e;
|
|
120
|
+
return o * u + (o - 1) * s;
|
|
121
|
+
}
|
|
122
|
+
function z(n, t, i) {
|
|
123
|
+
if (!Number.isFinite(n) || n <= 0)
|
|
124
|
+
return 0;
|
|
125
|
+
const e = a(i), o = Math.min(
|
|
126
|
+
a(t),
|
|
127
|
+
e
|
|
128
|
+
);
|
|
129
|
+
return Math.ceil(
|
|
130
|
+
(e * n + (e - o) * s) / o
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
function g(n, t, i) {
|
|
134
|
+
if (!Number.isFinite(n))
|
|
135
|
+
return a(t);
|
|
136
|
+
const e = a(t);
|
|
137
|
+
for (let o = 1; o <= e; o += 1)
|
|
138
|
+
if (G(
|
|
139
|
+
o,
|
|
140
|
+
e,
|
|
141
|
+
i
|
|
142
|
+
) >= n)
|
|
143
|
+
return o;
|
|
144
|
+
return e;
|
|
145
|
+
}
|
|
146
|
+
function a(n) {
|
|
147
|
+
return Number.isFinite(n) ? Math.min(
|
|
148
|
+
l,
|
|
149
|
+
Math.max(1, Math.ceil(n))
|
|
150
|
+
) : l;
|
|
151
|
+
}
|
|
152
|
+
function v(n, t) {
|
|
153
|
+
const i = S(t);
|
|
154
|
+
return i >= n ? !0 : (n - i) / n <= I;
|
|
155
|
+
}
|
|
156
|
+
function O(n) {
|
|
157
|
+
return n.trim() === "" ? m.space : R.includes(n) ? m.narrow : N.includes(n) ? m.punctuation : x.includes(n) ? m.thin : E.includes(n) ? m.wide : n >= "A" && n <= "Z" ? m.uppercase : m.normal;
|
|
60
158
|
}
|
|
61
159
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
160
|
+
c as DYNAMIC_FORM_SEMANTIC_GRID_BASE_COLUMN_WIDTH,
|
|
161
|
+
L as DYNAMIC_FORM_SEMANTIC_GRID_COLUMN_BREAKPOINTS,
|
|
162
|
+
s as DYNAMIC_FORM_SEMANTIC_GRID_COLUMN_GAP,
|
|
163
|
+
l as DYNAMIC_FORM_SEMANTIC_GRID_MAX_COLUMNS,
|
|
164
|
+
I as DYNAMIC_FORM_SEMANTIC_GRID_SPAN_PRECISION_THRESHOLD,
|
|
165
|
+
F as estimateLabelWidthPx,
|
|
166
|
+
P as resolveAdaptiveFieldLayout,
|
|
167
|
+
T as resolveAdaptiveFieldLayoutVisualTrackWidth,
|
|
168
|
+
z as resolveSemanticGridContainerWidthForSpan,
|
|
169
|
+
D as resolveSemanticGridFieldColumnSpan,
|
|
170
|
+
y as resolveSemanticGridSpanForColumnCount,
|
|
171
|
+
g as resolveSemanticGridSpanForContainerWidth,
|
|
172
|
+
S as resolveSemanticGridSpanWidth,
|
|
173
|
+
G as resolveSemanticGridSpanWidthForContainer
|
|
64
174
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicFormContent.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EACV,uBAAuB,EAKxB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"DynamicFormContent.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EACV,uBAAuB,EAKxB,MAAM,aAAa,CAAC;AAoKrB,eAAO,MAAM,kBAAkB,oHAwK7B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { forwardRef as E, useMemo as
|
|
1
|
+
import { jsx as r, jsxs as w } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as E, useMemo as g, memo as L } from "react";
|
|
3
3
|
import R from "clsx";
|
|
4
|
-
import { useModuleDictionary as W, useEnvironment as
|
|
4
|
+
import { useModuleDictionary as W, useEnvironment as A } from "@m4l/core";
|
|
5
5
|
import { NotificationCheckCircleFill as O, NotificationWarningFill as T } from "@m4l/icons";
|
|
6
6
|
import { Icon as H } from "@m4l/base";
|
|
7
7
|
import { TEST_PROP_ID as z } from "../../../../test/constants_no_mock.js";
|
|
@@ -22,14 +22,14 @@ import { Chip as te } from "../../../Chip/Chip.js";
|
|
|
22
22
|
const ie = /* @__PURE__ */ new Set([
|
|
23
23
|
"RHFCheckableList"
|
|
24
24
|
]);
|
|
25
|
-
function le(
|
|
26
|
-
const t =
|
|
25
|
+
function le(d) {
|
|
26
|
+
const t = d.fieldType?.componentId;
|
|
27
27
|
return t && ie.has(t) ? "verticalGrow" : "default";
|
|
28
28
|
}
|
|
29
|
-
function ae(
|
|
29
|
+
function ae(d) {
|
|
30
30
|
const t = [];
|
|
31
31
|
let e = [];
|
|
32
|
-
return
|
|
32
|
+
return d.forEach((o) => {
|
|
33
33
|
const a = le(o);
|
|
34
34
|
if (a === "verticalGrow") {
|
|
35
35
|
e.length > 0 && (t.push({
|
|
@@ -47,7 +47,7 @@ function ae(c) {
|
|
|
47
47
|
fields: e
|
|
48
48
|
}), t;
|
|
49
49
|
}
|
|
50
|
-
const b =
|
|
50
|
+
const b = L(function(t) {
|
|
51
51
|
const {
|
|
52
52
|
field: e,
|
|
53
53
|
currentSize: o,
|
|
@@ -55,36 +55,37 @@ const b = A(function(t) {
|
|
|
55
55
|
fieldFlow: D,
|
|
56
56
|
layout: f,
|
|
57
57
|
readOnly: y = !1
|
|
58
|
-
} = t, { getLabel: F } = W(), { host_api_remote: h } =
|
|
58
|
+
} = t, { getLabel: F } = W(), { host_api_remote: h } = A(), n = f === "verticalGrow";
|
|
59
59
|
if (typeof e.name != "string" || e.name.trim() === "")
|
|
60
60
|
return null;
|
|
61
61
|
const S = V(
|
|
62
62
|
e,
|
|
63
63
|
F
|
|
64
|
-
), i = j(e, F),
|
|
64
|
+
), i = j(e, F), s = ee(e), v = oe(e), m = B({
|
|
65
65
|
hasHelperMessage: !!S,
|
|
66
66
|
label: i,
|
|
67
|
-
mandatory:
|
|
67
|
+
mandatory: s,
|
|
68
68
|
requestedSemanticWidth: e.metadata?.semanticWidth,
|
|
69
69
|
size: o,
|
|
70
70
|
symbol: v
|
|
71
|
-
}),
|
|
71
|
+
}), c = re(e, {
|
|
72
72
|
size: o,
|
|
73
73
|
getLabel: F,
|
|
74
74
|
hostApiRemote: h,
|
|
75
75
|
readOnly: y,
|
|
76
76
|
suppressLabel: !0
|
|
77
77
|
});
|
|
78
|
-
return
|
|
78
|
+
return c ? /* @__PURE__ */ r(
|
|
79
79
|
X,
|
|
80
80
|
{
|
|
81
81
|
ownerState: {
|
|
82
82
|
readOnly: y,
|
|
83
83
|
fieldFlow: D,
|
|
84
|
+
gridColumnSpan: m.gridColumnSpan,
|
|
84
85
|
layout: f,
|
|
85
|
-
isFullWidth:
|
|
86
|
+
isFullWidth: m.isFullWidth,
|
|
86
87
|
semanticWidth: e.metadata?.semanticWidth,
|
|
87
|
-
wrapperWidth:
|
|
88
|
+
wrapperWidth: m.wrapperWidth
|
|
88
89
|
},
|
|
89
90
|
className: R(
|
|
90
91
|
a,
|
|
@@ -93,23 +94,23 @@ const b = A(function(t) {
|
|
|
93
94
|
children: /* @__PURE__ */ r(
|
|
94
95
|
x,
|
|
95
96
|
{
|
|
96
|
-
controlWidth:
|
|
97
|
+
controlWidth: m.controlWidth,
|
|
97
98
|
labelOverflow: "visible",
|
|
98
|
-
labelWidth:
|
|
99
|
+
labelWidth: m.labelWidth,
|
|
99
100
|
property: i,
|
|
100
|
-
value:
|
|
101
|
+
value: c,
|
|
101
102
|
isForm: !0,
|
|
102
|
-
mandatory:
|
|
103
|
+
mandatory: s,
|
|
103
104
|
helperMessage: S,
|
|
104
105
|
symbol: v,
|
|
105
|
-
valueHeight:
|
|
106
|
+
valueHeight: n ? "100%" : void 0
|
|
106
107
|
}
|
|
107
108
|
)
|
|
108
109
|
}
|
|
109
110
|
) : null;
|
|
110
111
|
});
|
|
111
112
|
b.displayName = "DynamicFormFieldRow";
|
|
112
|
-
const
|
|
113
|
+
const ne = E((d, t) => {
|
|
113
114
|
const {
|
|
114
115
|
data: e,
|
|
115
116
|
currentSize: o,
|
|
@@ -119,17 +120,17 @@ const se = E((c, t) => {
|
|
|
119
120
|
coupled: y = !1,
|
|
120
121
|
actionFormIntroProps: F,
|
|
121
122
|
renderActions: h,
|
|
122
|
-
readOnly:
|
|
123
|
+
readOnly: n = !1,
|
|
123
124
|
suppressFormHeader: S = !0,
|
|
124
125
|
submitFeedbackStatus: i,
|
|
125
|
-
fieldFlow:
|
|
126
|
-
} =
|
|
126
|
+
fieldFlow: s = "responsiveWrap"
|
|
127
|
+
} = d, { getLabel: v } = W(), { visibleFields: m } = P(e), c = S ? null : Z(e.form), I = ae(m), C = g(
|
|
127
128
|
() => ({
|
|
128
129
|
size: o,
|
|
129
|
-
readOnly:
|
|
130
|
-
fieldFlow:
|
|
130
|
+
readOnly: n,
|
|
131
|
+
fieldFlow: s
|
|
131
132
|
}),
|
|
132
|
-
[o,
|
|
133
|
+
[o, s, n]
|
|
133
134
|
), M = !y && i ? /* @__PURE__ */ r(U, { children: /* @__PURE__ */ r(
|
|
134
135
|
te,
|
|
135
136
|
{
|
|
@@ -148,16 +149,16 @@ const se = E((c, t) => {
|
|
|
148
149
|
opacity: !0
|
|
149
150
|
}
|
|
150
151
|
) }) : null;
|
|
151
|
-
return /* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ w(
|
|
152
153
|
Y,
|
|
153
154
|
{
|
|
154
155
|
ref: t,
|
|
155
|
-
ownerState:
|
|
156
|
+
ownerState: C,
|
|
156
157
|
className: R(u.contentRoot),
|
|
157
158
|
...typeof f == "string" ? { "data-meta": f } : {},
|
|
158
159
|
...process.env.NODE_ENV !== "production" ? { [z]: D } : {},
|
|
159
160
|
children: [
|
|
160
|
-
|
|
161
|
+
c?.title && /* @__PURE__ */ w(
|
|
161
162
|
q,
|
|
162
163
|
{
|
|
163
164
|
className: u.formHeader,
|
|
@@ -169,10 +170,10 @@ const se = E((c, t) => {
|
|
|
169
170
|
component: "h2",
|
|
170
171
|
size: o,
|
|
171
172
|
variant: "paragraphDens",
|
|
172
|
-
children:
|
|
173
|
+
children: c.title
|
|
173
174
|
}
|
|
174
175
|
),
|
|
175
|
-
|
|
176
|
+
c.description && /* @__PURE__ */ r(
|
|
176
177
|
$,
|
|
177
178
|
{
|
|
178
179
|
className: u.formDescription,
|
|
@@ -180,7 +181,7 @@ const se = E((c, t) => {
|
|
|
180
181
|
component: "p",
|
|
181
182
|
size: o,
|
|
182
183
|
variant: "bodyStandard",
|
|
183
|
-
children:
|
|
184
|
+
children: c.description
|
|
184
185
|
}
|
|
185
186
|
)
|
|
186
187
|
]
|
|
@@ -196,9 +197,9 @@ const se = E((c, t) => {
|
|
|
196
197
|
field: l,
|
|
197
198
|
currentSize: o,
|
|
198
199
|
fieldWrapperClassName: a,
|
|
199
|
-
fieldFlow:
|
|
200
|
+
fieldFlow: s,
|
|
200
201
|
layout: p.layout,
|
|
201
|
-
readOnly:
|
|
202
|
+
readOnly: n
|
|
202
203
|
},
|
|
203
204
|
l.id
|
|
204
205
|
) : null;
|
|
@@ -207,7 +208,7 @@ const se = E((c, t) => {
|
|
|
207
208
|
return /* @__PURE__ */ r(
|
|
208
209
|
J,
|
|
209
210
|
{
|
|
210
|
-
ownerState:
|
|
211
|
+
ownerState: C,
|
|
211
212
|
className: u.fieldsFlow,
|
|
212
213
|
children: p.fields.map((l) => /* @__PURE__ */ r(
|
|
213
214
|
b,
|
|
@@ -215,9 +216,9 @@ const se = E((c, t) => {
|
|
|
215
216
|
field: l,
|
|
216
217
|
currentSize: o,
|
|
217
218
|
fieldWrapperClassName: a,
|
|
218
|
-
fieldFlow:
|
|
219
|
+
fieldFlow: s,
|
|
219
220
|
layout: p.layout,
|
|
220
|
-
readOnly:
|
|
221
|
+
readOnly: n
|
|
221
222
|
},
|
|
222
223
|
l.id
|
|
223
224
|
))
|
|
@@ -225,7 +226,7 @@ const se = E((c, t) => {
|
|
|
225
226
|
`flow-${_}`
|
|
226
227
|
);
|
|
227
228
|
}),
|
|
228
|
-
!y && !
|
|
229
|
+
!y && !n && /* @__PURE__ */ r(Q, { children: /* @__PURE__ */ r(G, { children: h ? h() : /* @__PURE__ */ r(
|
|
229
230
|
k,
|
|
230
231
|
{
|
|
231
232
|
size: o,
|
|
@@ -237,7 +238,7 @@ const se = E((c, t) => {
|
|
|
237
238
|
}
|
|
238
239
|
);
|
|
239
240
|
});
|
|
240
|
-
|
|
241
|
+
ne.displayName = "DynamicFormContent";
|
|
241
242
|
export {
|
|
242
|
-
|
|
243
|
+
ne as DynamicFormContent
|
|
243
244
|
};
|
|
@@ -436,14 +436,14 @@ export type DynamicFormFieldFlow = 'responsiveWrap' | 'verticalStack';
|
|
|
436
436
|
export type FieldDefaultValue = FieldCurrentValue;
|
|
437
437
|
/**
|
|
438
438
|
* Optional field-level metadata carried inside each field entry.
|
|
439
|
-
* Drives layout hints resolved by DynamicFormContent (e.g.
|
|
439
|
+
* Drives layout hints resolved by DynamicFormContent (e.g. semantic grid item sizing).
|
|
440
440
|
*/
|
|
441
441
|
export interface FieldMetadata {
|
|
442
442
|
/**
|
|
443
|
-
* Semantic layout width for the field wrapper in the form
|
|
443
|
+
* Semantic layout width for the field wrapper in the form semantic grid.
|
|
444
444
|
* Maps to the same `SemanticWidthOptions` used by `PropertyValue`, so field wrappers
|
|
445
|
-
* share the same preferred widths as ContainerFlow-style semantic items while
|
|
446
|
-
*
|
|
445
|
+
* share the same preferred widths as ContainerFlow-style semantic items while letting
|
|
446
|
+
* DynamicForm resolve the smallest grid span that can contain the field.
|
|
447
447
|
* When `null` or absent the field wrapper spans the full available width.
|
|
448
448
|
*/
|
|
449
449
|
semanticWidth?: SemanticWidthOptions;
|
|
@@ -515,9 +515,9 @@ export interface Field {
|
|
|
515
515
|
description: string | null;
|
|
516
516
|
/**
|
|
517
517
|
* Optional field-level metadata from the API (e.g. `{ semanticWidth: 'bigName' }`).
|
|
518
|
-
* `metadata.semanticWidth` drives the preferred
|
|
519
|
-
* using the same semantic catalog as `PropertyValue` while
|
|
520
|
-
*
|
|
518
|
+
* `metadata.semanticWidth` drives the preferred semantic grid span in
|
|
519
|
+
* `DynamicFormContent`, using the same semantic catalog as `PropertyValue` while
|
|
520
|
+
* keeping the rendered control width aligned with the backend contract.
|
|
521
521
|
* When `null` or absent the field wrapper defaults to full available width.
|
|
522
522
|
*/
|
|
523
523
|
metadata?: FieldMetadata | null;
|
|
@@ -665,9 +665,9 @@ interface DynamicFormPropsBase {
|
|
|
665
665
|
*/
|
|
666
666
|
fieldWrapperClassName?: string;
|
|
667
667
|
/**
|
|
668
|
-
* Field layout policy. `responsiveWrap`
|
|
669
|
-
* `verticalStack` stacks fields full-width and lets growable fields
|
|
670
|
-
* available height. Defaults to `responsiveWrap`.
|
|
668
|
+
* Field layout policy. `responsiveWrap` composes semantic widths on the responsive
|
|
669
|
+
* form grid; `verticalStack` stacks fields full-width and lets growable fields
|
|
670
|
+
* consume the available height. Defaults to `responsiveWrap`.
|
|
671
671
|
*/
|
|
672
672
|
fieldFlow?: DynamicFormFieldFlow;
|
|
673
673
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/Label/Label.styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAU3D,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"Label.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/Label/Label.styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAU3D,eAAO,MAAM,WAAW,EAAE,WAoJzB,CAAC"}
|
|
@@ -11,7 +11,13 @@ const n = {
|
|
|
11
11
|
* @returns {object} - Los estilos aplicados al root del Label.
|
|
12
12
|
*/
|
|
13
13
|
root: ({ theme: e, ownerState: s }) => ({
|
|
14
|
-
width
|
|
14
|
+
// `fit-content` instead of `100%`: the root must contribute a real intrinsic width so the
|
|
15
|
+
// layers above it can size a field from its content. Stretching to the parent made the label
|
|
16
|
+
// width unmeasurable, which forced consumers to guess it.
|
|
17
|
+
// `fit-content` en vez de `100%`: el root debe aportar un ancho intrínseco real para que las
|
|
18
|
+
// capas superiores puedan dimensionar un campo a partir de su contenido. Estirarse al padre
|
|
19
|
+
// hacía que el ancho del label no fuera medible y obligaba a los consumidores a estimarlo.
|
|
20
|
+
width: "fit-content",
|
|
15
21
|
display: "flex",
|
|
16
22
|
flexDirection: "row",
|
|
17
23
|
alignItems: "center",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyValue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/PropertyValue/PropertyValue.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA2B,kBAAkB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"PropertyValue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/PropertyValue/PropertyValue.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA2B,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAyB3E;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,oDA2JtD"}
|
|
@@ -2,59 +2,59 @@ import { jsxs as y, jsx as t } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import f, { useId as D } from "react";
|
|
3
3
|
import W from "clsx";
|
|
4
4
|
import { TEST_PROP_ID as x } from "../../test/constants_no_mock.js";
|
|
5
|
-
import { TEST_PROPS_DATA as F, COMPONENT_PREFIX as
|
|
6
|
-
import { getNameDataTestId as w, getPropDataTestId as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { PropertyValueRootStyled as
|
|
9
|
-
import { getComponentSlotRoot as
|
|
5
|
+
import { PROPERTY_VALUE_CLASSNAMES as M, TEST_PROPS_DATA as F, COMPONENT_PREFIX as L, PROPERTY_VALUE_KEY_COMPONENT as s } from "./constants.js";
|
|
6
|
+
import { getNameDataTestId as w, getPropDataTestId as Y } from "../../test/getNameDataTestId.js";
|
|
7
|
+
import { Icon as $ } from "@m4l/base";
|
|
8
|
+
import { PropertyValueRootStyled as j, ContainerStartAdornmentStyled as q, ContainerPropertyAndValueStyled as U, NameStyled as G, ValueStyled as H, TypographyValueStyled as J } from "./slots/PropertyValueSlots.js";
|
|
9
|
+
import { getComponentSlotRoot as S } from "../../utils/getComponentSlotRoot.js";
|
|
10
10
|
import { getNullGuard as K } from "../../utils/getNullGuard.js";
|
|
11
|
-
import { Label as
|
|
12
|
-
import { useComponentSize as
|
|
13
|
-
function
|
|
11
|
+
import { Label as X } from "../Label/Label.js";
|
|
12
|
+
import { useComponentSize as k } from "@m4l/graphics";
|
|
13
|
+
function me(h) {
|
|
14
14
|
const {
|
|
15
15
|
property: l,
|
|
16
16
|
startAdornment: o,
|
|
17
17
|
value: e,
|
|
18
|
-
className:
|
|
18
|
+
className: E,
|
|
19
19
|
isForm: n,
|
|
20
20
|
labelOverflow: m,
|
|
21
21
|
labelWidth: P,
|
|
22
22
|
dataTestId: p = "",
|
|
23
23
|
disabled: u = !1,
|
|
24
|
-
controlWidth:
|
|
25
|
-
mandatory:
|
|
24
|
+
controlWidth: N,
|
|
25
|
+
mandatory: v,
|
|
26
26
|
mandatoryMessage: T,
|
|
27
27
|
helperMessage: g,
|
|
28
28
|
symbol: I,
|
|
29
29
|
semanticWidth: a = "fullWidth",
|
|
30
|
-
propertyWidth:
|
|
31
|
-
size:
|
|
30
|
+
propertyWidth: O = 200,
|
|
31
|
+
size: V = "medium",
|
|
32
32
|
direction: c,
|
|
33
|
-
valueHeight:
|
|
34
|
-
iconVariant:
|
|
33
|
+
valueHeight: _,
|
|
34
|
+
iconVariant: b = "outlined",
|
|
35
35
|
iconColor: R = "primary",
|
|
36
|
-
borderStyle:
|
|
37
|
-
} =
|
|
38
|
-
propertyWidth:
|
|
39
|
-
controlWidth:
|
|
36
|
+
borderStyle: A = "none"
|
|
37
|
+
} = h, d = `property-value-${D()}`, { currentSize: i } = k(V), r = {
|
|
38
|
+
propertyWidth: O,
|
|
39
|
+
controlWidth: N,
|
|
40
40
|
disabled: n && u ? u : !1,
|
|
41
41
|
isForm: !!n,
|
|
42
42
|
labelOverflow: m,
|
|
43
43
|
labelWidth: P,
|
|
44
44
|
semanticWidth: a,
|
|
45
|
-
valueHeight:
|
|
45
|
+
valueHeight: _,
|
|
46
46
|
size: i,
|
|
47
47
|
direction: n && c === void 0 ? "column" : c ?? "row",
|
|
48
|
-
iconVariant:
|
|
48
|
+
iconVariant: b,
|
|
49
49
|
iconColor: R,
|
|
50
|
-
borderStyle:
|
|
50
|
+
borderStyle: A
|
|
51
51
|
}, C = () => o ? typeof o == "string" ? /* @__PURE__ */ t(
|
|
52
|
-
|
|
52
|
+
$,
|
|
53
53
|
{
|
|
54
54
|
src: o,
|
|
55
55
|
color: "text.secondary"
|
|
56
56
|
}
|
|
57
|
-
) : o : null,
|
|
57
|
+
) : o : null, z = () => typeof e == "string" || typeof e == "number" || e === null || e === void 0 ? /* @__PURE__ */ t(
|
|
58
58
|
J,
|
|
59
59
|
{
|
|
60
60
|
id: d,
|
|
@@ -68,48 +68,48 @@ function se(S) {
|
|
|
68
68
|
{ size: i, id: d }
|
|
69
69
|
) : e;
|
|
70
70
|
return /* @__PURE__ */ y(
|
|
71
|
-
|
|
71
|
+
j,
|
|
72
72
|
{
|
|
73
73
|
role: n ? "property-value-form-role" : "property-value-role",
|
|
74
74
|
className: W(
|
|
75
|
-
|
|
76
|
-
a && `${
|
|
77
|
-
|
|
75
|
+
S(s),
|
|
76
|
+
a && `${S(s)}-semanticWidth-${a}`,
|
|
77
|
+
E
|
|
78
78
|
),
|
|
79
|
-
|
|
79
|
+
...Y(s, "root", p),
|
|
80
80
|
ownerState: r,
|
|
81
81
|
...process.env.NODE_ENV !== "production" ? {
|
|
82
82
|
[F]: JSON.stringify([
|
|
83
83
|
{ property: !!l, value: !!e }
|
|
84
84
|
]),
|
|
85
85
|
[x]: w(
|
|
86
|
-
|
|
86
|
+
L,
|
|
87
87
|
"root",
|
|
88
88
|
p
|
|
89
89
|
)
|
|
90
90
|
} : {},
|
|
91
91
|
children: [
|
|
92
|
-
o && /* @__PURE__ */ t(
|
|
93
|
-
/* @__PURE__ */ y(
|
|
94
|
-
/* @__PURE__ */ t(G, { ownerState: r, children: l && /* @__PURE__ */ t(
|
|
95
|
-
|
|
92
|
+
o && /* @__PURE__ */ t(q, { ownerState: r, children: C() }),
|
|
93
|
+
/* @__PURE__ */ y(U, { ownerState: r, children: [
|
|
94
|
+
/* @__PURE__ */ t(G, { ownerState: r, className: M.name, children: l && /* @__PURE__ */ t(
|
|
95
|
+
X,
|
|
96
96
|
{
|
|
97
97
|
size: i,
|
|
98
98
|
label: l,
|
|
99
99
|
labelOverflow: m,
|
|
100
|
-
mandatory:
|
|
100
|
+
mandatory: v,
|
|
101
101
|
mandatoryMessage: T,
|
|
102
102
|
helperMessage: g,
|
|
103
103
|
symbol: I,
|
|
104
104
|
htmlFor: d
|
|
105
105
|
}
|
|
106
106
|
) }),
|
|
107
|
-
/* @__PURE__ */ t(H, { role: "property-value-value-role", ownerState: r, children:
|
|
107
|
+
/* @__PURE__ */ t(H, { role: "property-value-value-role", ownerState: r, children: z() })
|
|
108
108
|
] })
|
|
109
109
|
]
|
|
110
110
|
}
|
|
111
111
|
);
|
|
112
112
|
}
|
|
113
113
|
export {
|
|
114
|
-
|
|
114
|
+
me as PropertyValue
|
|
115
115
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyValue.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/PropertyValue/PropertyValue.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAU9C,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"PropertyValue.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/PropertyValue/PropertyValue.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAU9C,eAAO,MAAM,mBAAmB,EAAE,mBA0QjC,CAAC"}
|
|
@@ -6,16 +6,16 @@ const l = "container", h = {
|
|
|
6
6
|
/**
|
|
7
7
|
* Property Value Root Styles
|
|
8
8
|
*/
|
|
9
|
-
Root: ({ theme:
|
|
10
|
-
const
|
|
11
|
-
maxWidth: `${
|
|
12
|
-
minWidth: `${
|
|
13
|
-
[`@container ${l} (max-width: ${
|
|
9
|
+
Root: ({ theme: o, ownerState: i }) => {
|
|
10
|
+
const r = (a) => ({
|
|
11
|
+
maxWidth: `${a}px`,
|
|
12
|
+
minWidth: `${a}px`,
|
|
13
|
+
[`@container ${l} (max-width: ${a - 1}px)`]: {
|
|
14
14
|
minWidth: "100px",
|
|
15
15
|
maxWidth: "100%",
|
|
16
16
|
width: "100%"
|
|
17
17
|
}
|
|
18
|
-
}), e = p(i?.semanticWidth),
|
|
18
|
+
}), e = p(i?.semanticWidth), t = i?.semanticWidth && typeof e == "number" ? r(e) : {}, c = i?.semanticWidth && b(i.semanticWidth) ? {
|
|
19
19
|
maxWidth: "100%",
|
|
20
20
|
width: "100%",
|
|
21
21
|
minWidth: i.semanticWidth === "bigDescription" ? "100px" : "0"
|
|
@@ -27,18 +27,18 @@ const l = "container", h = {
|
|
|
27
27
|
flexDirection: "row",
|
|
28
28
|
justifyContent: "flex-start",
|
|
29
29
|
alignItems: "center",
|
|
30
|
-
gap:
|
|
30
|
+
gap: o.vars.size.baseSpacings.sp2,
|
|
31
31
|
width: i?.semanticWidth ? "auto" : "200px",
|
|
32
32
|
height: i?.valueHeight ? i?.valueHeight : "auto",
|
|
33
|
-
color:
|
|
33
|
+
color: o.vars.palette.text.primary,
|
|
34
34
|
/* [`@container ${CONTAINER_QUERY_NAME} (min-width: 0px) and (max-width: 400px)`]: {
|
|
35
35
|
flexDirection: 'column',
|
|
36
36
|
}, */
|
|
37
|
-
...
|
|
37
|
+
...o.generalSettings.isMobile && {
|
|
38
38
|
flexDirection: "column"
|
|
39
39
|
},
|
|
40
40
|
...i?.borderStyle !== "none" && {
|
|
41
|
-
paddingBottom:
|
|
41
|
+
paddingBottom: o.vars.size.baseSpacings.sp2
|
|
42
42
|
},
|
|
43
43
|
// Estilos para borderStyle
|
|
44
44
|
...i?.borderStyle === "dashed" && {
|
|
@@ -56,8 +56,8 @@ const l = "container", h = {
|
|
|
56
56
|
width: "100%",
|
|
57
57
|
backgroundImage: `repeating-linear-gradient(
|
|
58
58
|
to right,
|
|
59
|
-
${
|
|
60
|
-
${
|
|
59
|
+
${o.vars.palette.border.secondary} 10px,
|
|
60
|
+
${o.vars.palette.border.secondary} 20px,
|
|
61
61
|
transparent 20px,
|
|
62
62
|
transparent 32px
|
|
63
63
|
)`,
|
|
@@ -70,50 +70,54 @@ const l = "container", h = {
|
|
|
70
70
|
borderTop: 0,
|
|
71
71
|
borderLeft: 0,
|
|
72
72
|
borderRight: 0,
|
|
73
|
-
borderBottom:
|
|
74
|
-
borderColor:
|
|
73
|
+
borderBottom: o.vars.size.borderStroke.container,
|
|
74
|
+
borderColor: o.vars.palette.border.secondary,
|
|
75
75
|
borderStyle: "solid"
|
|
76
76
|
},
|
|
77
77
|
...i?.borderStyle === "none" && {
|
|
78
78
|
border: "unset"
|
|
79
79
|
},
|
|
80
|
-
minHeight:
|
|
81
|
-
...
|
|
80
|
+
minHeight: o.vars.size.baseSpacings.sp5,
|
|
81
|
+
...t,
|
|
82
82
|
...c
|
|
83
83
|
};
|
|
84
84
|
},
|
|
85
85
|
/**
|
|
86
86
|
* Property Styles
|
|
87
87
|
*/
|
|
88
|
-
name: ({ theme:
|
|
89
|
-
const
|
|
88
|
+
name: ({ theme: o, ownerState: i }) => {
|
|
89
|
+
const r = typeof i?.labelWidth == "number" ? `${i.labelWidth}px` : i?.labelWidth;
|
|
90
90
|
return {
|
|
91
91
|
display: "flex",
|
|
92
92
|
alignItems: "center",
|
|
93
|
-
fontSize:
|
|
94
|
-
color:
|
|
95
|
-
gap:
|
|
93
|
+
fontSize: o.typography.body2.fontSize,
|
|
94
|
+
color: o.vars.palette.text.primary,
|
|
95
|
+
gap: o.vars.size.baseSpacings.sp1,
|
|
96
96
|
overflow: i?.labelOverflow === "visible" ? "visible" : "hidden",
|
|
97
|
-
width
|
|
97
|
+
// The name slot hugs its content instead of stretching, so the rendered label width is the
|
|
98
|
+
// real one rather than whatever the consumer estimated. `labelWidth` survives as the
|
|
99
|
+
// ceiling: it still clamps the slot, it just no longer dictates its width.
|
|
100
|
+
maxWidth: r ?? "100%",
|
|
101
|
+
width: "fit-content"
|
|
98
102
|
};
|
|
99
103
|
},
|
|
100
104
|
/**
|
|
101
105
|
* Value Styles (Form and No Form Combined)
|
|
102
106
|
*/
|
|
103
|
-
value: ({ theme:
|
|
104
|
-
const
|
|
107
|
+
value: ({ theme: o, ownerState: i }) => {
|
|
108
|
+
const r = typeof i?.controlWidth == "number" ? `${i.controlWidth}px` : void 0;
|
|
105
109
|
return {
|
|
106
|
-
width:
|
|
110
|
+
width: r ?? (i?.direction === "column" ? "100%" : "fit-content"),
|
|
107
111
|
display: "flex",
|
|
108
112
|
justifyContent: "flex-start",
|
|
109
113
|
alignItems: "flex-start",
|
|
110
114
|
height: i?.valueHeight ? i?.valueHeight : "auto",
|
|
111
115
|
whiteSpace: "nowrap",
|
|
112
116
|
...i?.isForm && {
|
|
113
|
-
gap:
|
|
117
|
+
gap: o.vars.size.baseSpacings["sp0-5"],
|
|
114
118
|
flexDirection: "column"
|
|
115
119
|
},
|
|
116
|
-
...
|
|
120
|
+
...r && {
|
|
117
121
|
maxWidth: "100%",
|
|
118
122
|
"& > *": {
|
|
119
123
|
width: "100%",
|
|
@@ -126,43 +130,43 @@ const l = "container", h = {
|
|
|
126
130
|
/**
|
|
127
131
|
* Container Start Adornment Styles
|
|
128
132
|
*/
|
|
129
|
-
containerStartAdornment: ({ theme:
|
|
130
|
-
const
|
|
133
|
+
containerStartAdornment: ({ theme: o, ownerState: i }) => {
|
|
134
|
+
const r = i?.iconColor === "text.primary" || i?.iconColor === "text.secondary" || i?.iconColor === "text.disabled", e = r ? n(o.vars.palette, String(i?.iconColor), o.vars.palette.text.primary) : n(o.vars.palette.chips, String(i?.iconColor), o.vars.palette.chips.primary)?.contained;
|
|
131
135
|
return {
|
|
132
136
|
"&&&": {
|
|
133
137
|
display: "flex",
|
|
134
138
|
alignItems: "center",
|
|
135
139
|
justifyContent: "center",
|
|
136
140
|
overflow: "hidden",
|
|
137
|
-
borderRadius:
|
|
141
|
+
borderRadius: o.vars.size.borderRadius["r1-5"],
|
|
138
142
|
...d(
|
|
139
|
-
|
|
143
|
+
o,
|
|
140
144
|
i?.size || "medium",
|
|
141
145
|
"base",
|
|
142
|
-
(
|
|
143
|
-
height: `calc(${
|
|
144
|
-
width: `calc(${
|
|
145
|
-
minHeight: `calc(${
|
|
146
|
-
minWidth: `calc(${
|
|
146
|
+
(t) => ({
|
|
147
|
+
height: `calc(${t} + ${o.vars.size.baseSpacings.sp2})`,
|
|
148
|
+
width: `calc(${t} + ${o.vars.size.baseSpacings.sp2})`,
|
|
149
|
+
minHeight: `calc(${t} + ${o.vars.size.baseSpacings.sp2})`,
|
|
150
|
+
minWidth: `calc(${t} + ${o.vars.size.baseSpacings.sp2})`
|
|
147
151
|
})
|
|
148
152
|
),
|
|
149
153
|
// variente de icono en modalidad outlined o containedOpacity
|
|
150
154
|
...(i?.iconVariant === "containedOpacity" || i?.iconVariant === "outlined") && {
|
|
151
155
|
...i?.iconVariant === "outlined" && {
|
|
152
|
-
border:
|
|
153
|
-
borderColor:
|
|
156
|
+
border: o.vars.size.borderStroke.container,
|
|
157
|
+
borderColor: r ? o.vars.palette.border.disabled : e?.backgroundColor,
|
|
154
158
|
backgroundColor: "transparent"
|
|
155
159
|
},
|
|
156
160
|
...i?.iconVariant === "containedOpacity" && {
|
|
157
|
-
backgroundColor:
|
|
161
|
+
backgroundColor: r ? o.vars.palette.border.disabled : e?.backgroundColor
|
|
158
162
|
},
|
|
159
163
|
// icon mask strategy
|
|
160
164
|
"& .M4LIcon-icon": {
|
|
161
|
-
backgroundColor:
|
|
165
|
+
backgroundColor: r ? e : e?.color
|
|
162
166
|
},
|
|
163
167
|
// 🧪 Experimental m4l/icons strategy
|
|
164
168
|
[s]: {
|
|
165
|
-
fill:
|
|
169
|
+
fill: r ? e : e?.color,
|
|
166
170
|
stroke: "none"
|
|
167
171
|
}
|
|
168
172
|
},
|
|
@@ -170,11 +174,11 @@ const l = "container", h = {
|
|
|
170
174
|
backgroundColor: "transparent",
|
|
171
175
|
// icon mask strategy
|
|
172
176
|
"& .M4LIcon-icon": {
|
|
173
|
-
backgroundColor:
|
|
177
|
+
backgroundColor: r ? e : e?.color
|
|
174
178
|
},
|
|
175
179
|
// 🧪 Experimental m4l/icons strategy
|
|
176
180
|
[s]: {
|
|
177
|
-
fill:
|
|
181
|
+
fill: r ? e : e?.color,
|
|
178
182
|
stroke: "none"
|
|
179
183
|
}
|
|
180
184
|
}
|
|
@@ -184,31 +188,31 @@ const l = "container", h = {
|
|
|
184
188
|
/**
|
|
185
189
|
* Container Property And Value Styles
|
|
186
190
|
*/
|
|
187
|
-
containerPropertyAndValue: ({ theme:
|
|
191
|
+
containerPropertyAndValue: ({ theme: o, ownerState: i }) => ({
|
|
188
192
|
display: "flex",
|
|
189
193
|
justifyContent: "space-between",
|
|
190
194
|
overflow: i?.labelOverflow === "visible" ? "visible" : "hidden",
|
|
191
195
|
flexDirection: i?.direction || "row",
|
|
192
|
-
borderColor:
|
|
196
|
+
borderColor: o.vars.palette.border.secondary,
|
|
193
197
|
width: "100%",
|
|
194
198
|
height: i?.valueHeight ? i?.valueHeight : "auto",
|
|
195
199
|
"&&& .M4LLabel-root": {
|
|
196
200
|
width: "auto"
|
|
197
201
|
},
|
|
198
202
|
...i?.direction === "column" ? {
|
|
199
|
-
gap:
|
|
203
|
+
gap: o.vars.size.baseSpacings["sp0-5"],
|
|
200
204
|
alignItems: "flex-start"
|
|
201
205
|
} : {
|
|
202
|
-
gap:
|
|
206
|
+
gap: o.vars.size.baseSpacings.sp4,
|
|
203
207
|
alignItems: "center"
|
|
204
208
|
}
|
|
205
209
|
}),
|
|
206
210
|
/**
|
|
207
211
|
* Typography Value Styles
|
|
208
212
|
*/
|
|
209
|
-
typographyValue: ({ ownerState:
|
|
213
|
+
typographyValue: ({ ownerState: o }) => ({
|
|
210
214
|
wordBreak: "break-word",
|
|
211
|
-
whiteSpace:
|
|
215
|
+
whiteSpace: o?.direction === "column" ? "normal" : "nowrap"
|
|
212
216
|
})
|
|
213
217
|
};
|
|
214
218
|
export {
|
|
@@ -2,4 +2,5 @@ export declare const COMPONENT_PREFIX = "m4l-property-value";
|
|
|
2
2
|
export declare const PREFIX_TEST_ATTRIBUTE = "data-testid";
|
|
3
3
|
export declare const TEST_PROPS_DATA = "m4l-property-value-data";
|
|
4
4
|
export declare const PROPERTY_VALUE_KEY_COMPONENT = "M4LPropertyValue";
|
|
5
|
+
export declare const PROPERTY_VALUE_CLASSNAMES: Record<"name" | "value" | "Root" | "containerStartAdornment" | "containerPropertyAndValue" | "typographyValue", string>;
|
|
5
6
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/PropertyValue/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/PropertyValue/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AACrD,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AACnD,eAAO,MAAM,eAAe,4BAA6B,CAAC;AAC1D,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D,eAAO,MAAM,yBAAyB,yHAGrC,CAAC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { getComponentClasses as o } from "../../utils/getComponentSlotRoot.js";
|
|
2
|
+
import { PropertyValueSlots as t } from "./slots/PropertyValueEnum.js";
|
|
3
|
+
const r = "m4l-property-value", p = `${r}-data`, P = "M4LPropertyValue", s = o(
|
|
4
|
+
P,
|
|
5
|
+
t
|
|
6
|
+
);
|
|
2
7
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
8
|
+
r as COMPONENT_PREFIX,
|
|
9
|
+
s as PROPERTY_VALUE_CLASSNAMES,
|
|
10
|
+
P as PROPERTY_VALUE_KEY_COMPONENT,
|
|
11
|
+
p as TEST_PROPS_DATA
|
|
6
12
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
|
-
"version": "9.57.1-beta-hotfix-semantic-width-dynamicform.
|
|
3
|
+
"version": "9.57.1-beta-hotfix-semantic-width-dynamicform.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"@hookform/resolvers": "2.9.11",
|
|
54
54
|
"nprogress": "0.2.0",
|
|
55
55
|
"react-transition-group": "4.4.5",
|
|
56
|
-
"react-
|
|
57
|
-
"react-rnd": "10.5.2",
|
|
56
|
+
"react-dropzone": "14.4.1",
|
|
58
57
|
"@mui/x-date-pickers": "6.20.2",
|
|
58
|
+
"@tanstack/react-virtual": "3.13.23",
|
|
59
59
|
"react-draggable": "4.5.0",
|
|
60
60
|
"react-color": "2.19.3",
|
|
61
|
-
"react-
|
|
62
|
-
"
|
|
61
|
+
"react-spinners": "0.13.8",
|
|
62
|
+
"react-rnd": "10.5.2",
|
|
63
63
|
"chart.js": "4.5.1",
|
|
64
64
|
"chartjs-chart-error-bars": "4.4.5",
|
|
65
65
|
"qrcode.react": "3.2.0",
|