@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.
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicForm.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicForm/DynamicForm.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAsBjB,eAAO,MAAM,eAAe,EAAE,iBAqS7B,CAAC"}
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 d } from "../CheckableList/constants.js";
2
- import { isFullRowSemanticWidth as p, resolveSemanticWidthPx as f } from "../PropertyValue/semanticWidth.js";
3
- const h = (t) => ({
4
- flex: `1 1 ${t}px`,
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: o }) => {
28
- const e = o;
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: o }) => {
51
- const i = o?.fieldFlow === "verticalStack";
52
- return {
53
- display: "flex",
54
- flexDirection: i ? "column" : "row",
55
- alignItems: i ? "stretch" : "flex-start",
56
- alignContent: i ? "stretch" : "flex-start",
57
- flexWrap: i ? "nowrap" : "wrap",
58
- gap: t.vars.size.baseSpacings.sp4,
59
- width: "100%",
60
- minWidth: 0,
61
- boxSizing: "border-box",
62
- flex: "0 0 auto"
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.semanticWidth` drives the control width, while adaptive wrapper width
97
- * gives single-line labels enough flow space without widening the control.
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: o }) => {
100
- const e = o, i = e?.semanticWidth, c = e?.fieldFlow === "verticalStack", s = f(i);
101
- let a = m;
102
- e?.isFullWidth !== !0 && !p(i) && (typeof e?.wrapperWidth == "number" ? a = h(e.wrapperWidth) : typeof s == "number" && (a = h(s)));
103
- const r = {
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
- }, l = {
203
+ }, a = {
109
204
  "& > *": {
110
205
  width: "100%",
111
206
  maxWidth: "100%",
112
207
  minWidth: 0
113
208
  }
114
- }, n = {
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
- ...r,
216
+ ...o,
122
217
  width: "100%",
123
218
  maxWidth: "100%",
124
- flex: `1 1 ${d}px`,
219
+ flex: `1 1 ${m}px`,
125
220
  alignSelf: "stretch",
126
- minHeight: d,
127
- ...l,
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
- ...n
146
- } : c ? {
147
- ...r,
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
- ...l,
153
- ...n
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
- ...l,
159
- ...n
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
- g as componentStyles
350
+ T as componentStyles
251
351
  };
@@ -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;AAclD,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,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;AAmCD,2EAA2E;AAC3E,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,0BAA0B,GACjC,MAAM,CAmBR;AAED,+FAA+F;AAC/F,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,gCAAgC,GACvC,mBAAmB,CAiCrB"}
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"}
@@ -1,64 +1,174 @@
1
- import { isFullRowSemanticWidth as c, resolveSemanticWidthPx as f } from "../../../PropertyValue/semanticWidth.js";
2
- const p = {
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
- buffer: 12,
5
- helperIcon: 24,
6
- mandatoryMarker: 8,
7
- narrow: 4,
8
- normal: 7,
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
- buffer: 16,
16
- helperIcon: 28,
19
+ fontSize: 11,
20
+ helperIcon: 20,
21
+ letterSpacing: 0.8,
17
22
  mandatoryMarker: 10,
18
- narrow: 5,
19
- normal: 8,
20
- punctuation: 4,
21
- space: 5,
22
- uppercase: 9,
23
- wide: 11
23
+ safetyBuffer: 2
24
24
  }
25
- }, m = 796, W = "ijlI1|!", A = ".,;:", h = "mwMW@%#&";
26
- function R(t) {
27
- const { hasHelperMessage: e = !1, label: r, mandatory: n = !1, size: i, symbol: u } = t, o = p[i], a = typeof u == "string" && u.trim() !== "" ? `${r} (${u.trim()})` : r, l = Array.from(a).reduce((s, d) => s + I(d, o), 0);
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
- l + o.buffer + (n ? o.mandatoryMarker : 0) + (e ? o.helperIcon : 0)
43
+ h + u.safetyBuffer + (e ? u.mandatoryMarker : 0) + (t ? u.helperIcon : 0)
30
44
  );
31
45
  }
32
- function _(t) {
33
- const { requestedSemanticWidth: e } = t, r = R(t), n = f(e);
34
- if (c(e))
46
+ function P(n) {
47
+ const { requestedSemanticWidth: t } = n, i = F(n), e = p(t);
48
+ if (A(t))
35
49
  return {
36
- controlWidth: n,
37
- estimatedLabelWidth: r,
50
+ controlWidth: e,
51
+ estimatedLabelWidth: i,
52
+ gridColumnSpan: l,
38
53
  isFullWidth: !0,
39
- requestedSemanticWidth: e
54
+ requestedSemanticWidth: t
40
55
  };
41
- if (!n || r > m)
56
+ if (!e || i > d)
42
57
  return {
43
- controlWidth: n,
44
- estimatedLabelWidth: r,
58
+ controlWidth: e,
59
+ estimatedLabelWidth: i,
60
+ gridColumnSpan: l,
45
61
  isFullWidth: !0,
46
- requestedSemanticWidth: e
62
+ requestedSemanticWidth: t
47
63
  };
48
- const i = Math.max(n, r);
49
- return {
50
- controlWidth: n,
51
- estimatedLabelWidth: r,
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: i,
54
- requestedSemanticWidth: e,
55
- wrapperWidth: i
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 I(t, e) {
59
- return t.trim() === "" ? e.space : W.includes(t) ? e.narrow : A.includes(t) ? e.punctuation : h.includes(t) ? e.wide : t >= "A" && t <= "Z" ? e.uppercase : e.normal;
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
- R as estimateLabelWidthPx,
63
- _ as resolveAdaptiveFieldLayout
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;AAmKrB,eAAO,MAAM,kBAAkB,oHAwK7B,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 C } from "@emotion/react/jsx-runtime";
2
- import { forwardRef as E, useMemo as L, memo as A } from "react";
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 g } from "@m4l/core";
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(c) {
26
- const t = c.fieldType?.componentId;
25
+ function le(d) {
26
+ const t = d.fieldType?.componentId;
27
27
  return t && ie.has(t) ? "verticalGrow" : "default";
28
28
  }
29
- function ae(c) {
29
+ function ae(d) {
30
30
  const t = [];
31
31
  let e = [];
32
- return c.forEach((o) => {
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 = A(function(t) {
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 } = g(), s = f === "verticalGrow";
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), n = ee(e), v = oe(e), d = B({
64
+ ), i = j(e, F), s = ee(e), v = oe(e), m = B({
65
65
  hasHelperMessage: !!S,
66
66
  label: i,
67
- mandatory: n,
67
+ mandatory: s,
68
68
  requestedSemanticWidth: e.metadata?.semanticWidth,
69
69
  size: o,
70
70
  symbol: v
71
- }), m = re(e, {
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 m ? /* @__PURE__ */ r(
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: d.isFullWidth,
86
+ isFullWidth: m.isFullWidth,
86
87
  semanticWidth: e.metadata?.semanticWidth,
87
- wrapperWidth: d.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: d.controlWidth,
97
+ controlWidth: m.controlWidth,
97
98
  labelOverflow: "visible",
98
- labelWidth: d.labelWidth,
99
+ labelWidth: m.labelWidth,
99
100
  property: i,
100
- value: m,
101
+ value: c,
101
102
  isForm: !0,
102
- mandatory: n,
103
+ mandatory: s,
103
104
  helperMessage: S,
104
105
  symbol: v,
105
- valueHeight: s ? "100%" : void 0
106
+ valueHeight: n ? "100%" : void 0
106
107
  }
107
108
  )
108
109
  }
109
110
  ) : null;
110
111
  });
111
112
  b.displayName = "DynamicFormFieldRow";
112
- const se = E((c, t) => {
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: s = !1,
123
+ readOnly: n = !1,
123
124
  suppressFormHeader: S = !0,
124
125
  submitFeedbackStatus: i,
125
- fieldFlow: n = "responsiveWrap"
126
- } = c, { getLabel: v } = W(), { visibleFields: d } = P(e), m = S ? null : Z(e.form), I = ae(d), w = L(
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: s,
130
- fieldFlow: n
130
+ readOnly: n,
131
+ fieldFlow: s
131
132
  }),
132
- [o, n, s]
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__ */ C(
152
+ return /* @__PURE__ */ w(
152
153
  Y,
153
154
  {
154
155
  ref: t,
155
- ownerState: w,
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
- m?.title && /* @__PURE__ */ C(
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: m.title
173
+ children: c.title
173
174
  }
174
175
  ),
175
- m.description && /* @__PURE__ */ r(
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: m.description
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: n,
200
+ fieldFlow: s,
200
201
  layout: p.layout,
201
- readOnly: s
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: w,
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: n,
219
+ fieldFlow: s,
219
220
  layout: p.layout,
220
- readOnly: s
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 && !s && /* @__PURE__ */ r(Q, { children: /* @__PURE__ */ r(G, { children: h ? h() : /* @__PURE__ */ r(
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
- se.displayName = "DynamicFormContent";
241
+ ne.displayName = "DynamicFormContent";
241
242
  export {
242
- se as DynamicFormContent
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. flex-wrap item sizing).
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 flex-wrap container.
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 still
446
- * allowing rows to redistribute leftover space more naturally.
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 flex width in `DynamicFormContent`,
519
- * using the same semantic catalog as `PropertyValue` while allowing rows to redistribute
520
- * remaining space more naturally.
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` keeps semantic widths and row wrapping;
669
- * `verticalStack` stacks fields full-width and lets growable fields consume the
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,WA8IzB,CAAC"}
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: "100%",
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;AAwB3E;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,oDA2JtD"}
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 M, PROPERTY_VALUE_KEY_COMPONENT as s } from "./constants.js";
6
- import { getNameDataTestId as w, getPropDataTestId as $ } from "../../test/getNameDataTestId.js";
7
- import { Icon as j } from "@m4l/base";
8
- import { PropertyValueRootStyled as q, ContainerStartAdornmentStyled as L, ContainerPropertyAndValueStyled as Y, NameStyled as G, ValueStyled as H, TypographyValueStyled as J } from "./slots/PropertyValueSlots.js";
9
- import { getComponentSlotRoot as h } from "../../utils/getComponentSlotRoot.js";
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 U } from "../Label/Label.js";
12
- import { useComponentSize as X } from "@m4l/graphics";
13
- function se(S) {
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: v,
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: E,
25
- mandatory: N,
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: b = 200,
31
- size: O = "medium",
30
+ propertyWidth: O = 200,
31
+ size: V = "medium",
32
32
  direction: c,
33
- valueHeight: V,
34
- iconVariant: _ = "outlined",
33
+ valueHeight: _,
34
+ iconVariant: b = "outlined",
35
35
  iconColor: R = "primary",
36
- borderStyle: z = "none"
37
- } = S, d = `property-value-${D()}`, { currentSize: i } = X(O), r = {
38
- propertyWidth: b,
39
- controlWidth: E,
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: V,
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: z
50
+ borderStyle: A
51
51
  }, C = () => o ? typeof o == "string" ? /* @__PURE__ */ t(
52
- j,
52
+ $,
53
53
  {
54
54
  src: o,
55
55
  color: "text.secondary"
56
56
  }
57
- ) : o : null, A = () => typeof e == "string" || typeof e == "number" || e === null || e === void 0 ? /* @__PURE__ */ t(
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
- q,
71
+ j,
72
72
  {
73
73
  role: n ? "property-value-form-role" : "property-value-role",
74
74
  className: W(
75
- h(s),
76
- a && `${h(s)}-semanticWidth-${a}`,
77
- v
75
+ S(s),
76
+ a && `${S(s)}-semanticWidth-${a}`,
77
+ E
78
78
  ),
79
- ...$(s, "root", p),
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
- M,
86
+ L,
87
87
  "root",
88
88
  p
89
89
  )
90
90
  } : {},
91
91
  children: [
92
- o && /* @__PURE__ */ t(L, { ownerState: r, children: C() }),
93
- /* @__PURE__ */ y(Y, { ownerState: r, children: [
94
- /* @__PURE__ */ t(G, { ownerState: r, children: l && /* @__PURE__ */ t(
95
- U,
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: N,
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: A() })
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
- se as PropertyValue
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,mBAsQjC,CAAC"}
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: r, ownerState: i }) => {
10
- const o = (t) => ({
11
- maxWidth: `${t}px`,
12
- minWidth: `${t}px`,
13
- [`@container ${l} (max-width: ${t - 1}px)`]: {
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), a = i?.semanticWidth && typeof e == "number" ? o(e) : {}, c = i?.semanticWidth && b(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: r.vars.size.baseSpacings.sp2,
30
+ gap: o.vars.size.baseSpacings.sp2,
31
31
  width: i?.semanticWidth ? "auto" : "200px",
32
32
  height: i?.valueHeight ? i?.valueHeight : "auto",
33
- color: r.vars.palette.text.primary,
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
- ...r.generalSettings.isMobile && {
37
+ ...o.generalSettings.isMobile && {
38
38
  flexDirection: "column"
39
39
  },
40
40
  ...i?.borderStyle !== "none" && {
41
- paddingBottom: r.vars.size.baseSpacings.sp2
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
- ${r.vars.palette.border.secondary} 10px,
60
- ${r.vars.palette.border.secondary} 20px,
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: r.vars.size.borderStroke.container,
74
- borderColor: r.vars.palette.border.secondary,
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: r.vars.size.baseSpacings.sp5,
81
- ...a,
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: r, ownerState: i }) => {
89
- const o = typeof i?.labelWidth == "number" ? `${i.labelWidth}px` : i?.labelWidth;
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: r.typography.body2.fontSize,
94
- color: r.vars.palette.text.primary,
95
- gap: r.vars.size.baseSpacings.sp1,
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: o ?? "100%"
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: r, ownerState: i }) => {
104
- const o = typeof i?.controlWidth == "number" ? `${i.controlWidth}px` : void 0;
107
+ value: ({ theme: o, ownerState: i }) => {
108
+ const r = typeof i?.controlWidth == "number" ? `${i.controlWidth}px` : void 0;
105
109
  return {
106
- width: o ?? (i?.direction === "column" ? "100%" : "fit-content"),
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: r.vars.size.baseSpacings["sp0-5"],
117
+ gap: o.vars.size.baseSpacings["sp0-5"],
114
118
  flexDirection: "column"
115
119
  },
116
- ...o && {
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: r, ownerState: i }) => {
130
- const o = i?.iconColor === "text.primary" || i?.iconColor === "text.secondary" || i?.iconColor === "text.disabled", e = o ? n(r.vars.palette, String(i?.iconColor), r.vars.palette.text.primary) : n(r.vars.palette.chips, String(i?.iconColor), r.vars.palette.chips.primary)?.contained;
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: r.vars.size.borderRadius["r1-5"],
141
+ borderRadius: o.vars.size.borderRadius["r1-5"],
138
142
  ...d(
139
- r,
143
+ o,
140
144
  i?.size || "medium",
141
145
  "base",
142
- (a) => ({
143
- height: `calc(${a} + ${r.vars.size.baseSpacings.sp2})`,
144
- width: `calc(${a} + ${r.vars.size.baseSpacings.sp2})`,
145
- minHeight: `calc(${a} + ${r.vars.size.baseSpacings.sp2})`,
146
- minWidth: `calc(${a} + ${r.vars.size.baseSpacings.sp2})`
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: r.vars.size.borderStroke.container,
153
- borderColor: o ? r.vars.palette.border.disabled : e?.backgroundColor,
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: o ? r.vars.palette.border.disabled : e?.backgroundColor
161
+ backgroundColor: r ? o.vars.palette.border.disabled : e?.backgroundColor
158
162
  },
159
163
  // icon mask strategy
160
164
  "& .M4LIcon-icon": {
161
- backgroundColor: o ? e : e?.color
165
+ backgroundColor: r ? e : e?.color
162
166
  },
163
167
  // 🧪 Experimental m4l/icons strategy
164
168
  [s]: {
165
- fill: o ? e : e?.color,
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: o ? e : e?.color
177
+ backgroundColor: r ? e : e?.color
174
178
  },
175
179
  // 🧪 Experimental m4l/icons strategy
176
180
  [s]: {
177
- fill: o ? e : e?.color,
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: r, ownerState: i }) => ({
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: r.vars.palette.border.secondary,
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: r.vars.size.baseSpacings["sp0-5"],
203
+ gap: o.vars.size.baseSpacings["sp0-5"],
200
204
  alignItems: "flex-start"
201
205
  } : {
202
- gap: r.vars.size.baseSpacings.sp4,
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: r }) => ({
213
+ typographyValue: ({ ownerState: o }) => ({
210
214
  wordBreak: "break-word",
211
- whiteSpace: r?.direction === "column" ? "normal" : "nowrap"
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":"AAAA,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AACrD,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AACnD,eAAO,MAAM,eAAe,4BAA6B,CAAC;AAC1D,eAAO,MAAM,4BAA4B,qBAAqB,CAAC"}
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
- const P = "m4l-property-value", t = `${P}-data`, E = "M4LPropertyValue";
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
- P as COMPONENT_PREFIX,
4
- E as PROPERTY_VALUE_KEY_COMPONENT,
5
- t as TEST_PROPS_DATA
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.0",
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-spinners": "0.13.8",
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-dropzone": "14.4.1",
62
- "@tanstack/react-virtual": "3.13.23",
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",