@m4l/components 9.57.1-beta-hotfix-semantic-width-dynamicform.0 → 9.57.1-beta-hotfix-semantic-width-dynamicform.1

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.
@@ -18,9 +18,12 @@ export interface AdaptiveFieldLayout {
18
18
  requestedSemanticWidth?: SemanticWidthOptions | null;
19
19
  wrapperWidth?: number;
20
20
  }
21
+ export declare const ADAPTIVE_FIELD_LAYOUT_VISUAL_TRACK_WIDTHS: readonly [90, 160, 240, 320, 400, 520, 796];
21
22
  /** Estimate the visual width needed by a single-line DynamicForm label. */
22
23
  export declare function estimateLabelWidthPx(params: EstimateLabelWidthPxParams): number;
23
24
  /** Resolve wrapper, label, and control widths without replacing the backend semantic width. */
24
25
  export declare function resolveAdaptiveFieldLayout(params: ResolveAdaptiveFieldLayoutParams): AdaptiveFieldLayout;
26
+ /** Resolve the smallest stable visual track that can contain an adaptive field width. */
27
+ export declare function resolveAdaptiveFieldLayoutVisualTrackWidth(requiredWidth: number): number | undefined;
25
28
  export {};
26
29
  //# 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;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;AA+BD,eAAO,MAAM,yCAAyC,6CAQ5C,CAAC;AAKX,2EAA2E;AAC3E,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,0BAA0B,GACjC,MAAM,CAmBR;AAED,+FAA+F;AAC/F,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,gCAAgC,GACvC,mBAAmB,CA8CrB;AAED,yFAAyF;AACzF,wBAAgB,0CAA0C,CACxD,aAAa,EAAE,MAAM,GACpB,MAAM,GAAG,SAAS,CAIpB"}
@@ -1,5 +1,5 @@
1
- import { isFullRowSemanticWidth as c, resolveSemanticWidthPx as f } from "../../../PropertyValue/semanticWidth.js";
2
- const p = {
1
+ import { isFullRowSemanticWidth as f, resolveSemanticWidthPx as p } from "../../../PropertyValue/semanticWidth.js";
2
+ const W = {
3
3
  small: {
4
4
  buffer: 12,
5
5
  helperIcon: 24,
@@ -22,43 +22,61 @@ const p = {
22
22
  uppercase: 9,
23
23
  wide: 11
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
+ }, a = 796, A = [
26
+ 90,
27
+ 160,
28
+ 240,
29
+ 320,
30
+ 400,
31
+ 520,
32
+ a
33
+ ], m = "ijlI1|!", h = ".,;:", I = "mwMW@%#&";
34
+ function T(t) {
35
+ const { hasHelperMessage: e = !1, label: r, mandatory: n = !1, size: u, symbol: i } = t, o = W[u], l = typeof i == "string" && i.trim() !== "" ? `${r} (${i.trim()})` : r, s = Array.from(l).reduce((d, c) => d + R(c, o), 0);
28
36
  return Math.ceil(
29
- l + o.buffer + (n ? o.mandatoryMarker : 0) + (e ? o.helperIcon : 0)
37
+ s + o.buffer + (n ? o.mandatoryMarker : 0) + (e ? o.helperIcon : 0)
30
38
  );
31
39
  }
32
- function _(t) {
33
- const { requestedSemanticWidth: e } = t, r = R(t), n = f(e);
34
- if (c(e))
40
+ function C(t) {
41
+ const { requestedSemanticWidth: e } = t, r = T(t), n = p(e);
42
+ if (f(e))
35
43
  return {
36
44
  controlWidth: n,
37
45
  estimatedLabelWidth: r,
38
46
  isFullWidth: !0,
39
47
  requestedSemanticWidth: e
40
48
  };
41
- if (!n || r > m)
49
+ if (!n || r > a)
42
50
  return {
43
51
  controlWidth: n,
44
52
  estimatedLabelWidth: r,
45
53
  isFullWidth: !0,
46
54
  requestedSemanticWidth: e
47
55
  };
48
- const i = Math.max(n, r);
49
- return {
56
+ const u = Math.max(n, r), i = r <= n ? n : _(u);
57
+ return i ? {
50
58
  controlWidth: n,
51
59
  estimatedLabelWidth: r,
52
60
  isFullWidth: !1,
53
61
  labelWidth: i,
54
62
  requestedSemanticWidth: e,
55
63
  wrapperWidth: i
64
+ } : {
65
+ controlWidth: n,
66
+ estimatedLabelWidth: r,
67
+ isFullWidth: !0,
68
+ requestedSemanticWidth: e
56
69
  };
57
70
  }
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;
71
+ function _(t) {
72
+ return A.find((e) => t <= e);
73
+ }
74
+ function R(t, e) {
75
+ return t.trim() === "" ? e.space : m.includes(t) ? e.narrow : h.includes(t) ? e.punctuation : I.includes(t) ? e.wide : t >= "A" && t <= "Z" ? e.uppercase : e.normal;
60
76
  }
61
77
  export {
62
- R as estimateLabelWidthPx,
63
- _ as resolveAdaptiveFieldLayout
78
+ A as ADAPTIVE_FIELD_LAYOUT_VISUAL_TRACK_WIDTHS,
79
+ T as estimateLabelWidthPx,
80
+ C as resolveAdaptiveFieldLayout,
81
+ _ as resolveAdaptiveFieldLayoutVisualTrackWidth
64
82
  };
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.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -53,24 +53,24 @@
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",
56
+ "@tanstack/react-virtual": "3.13.23",
57
+ "react-color": "2.19.3",
57
58
  "react-rnd": "10.5.2",
58
59
  "@mui/x-date-pickers": "6.20.2",
60
+ "react-spinners": "0.13.8",
59
61
  "react-draggable": "4.5.0",
60
- "react-color": "2.19.3",
61
62
  "react-dropzone": "14.4.1",
62
- "@tanstack/react-virtual": "3.13.23",
63
+ "simplebar-react": "3.2.6",
63
64
  "chart.js": "4.5.1",
64
65
  "chartjs-chart-error-bars": "4.4.5",
65
66
  "qrcode.react": "3.2.0",
66
- "simplebar-react": "3.2.6",
67
67
  "react-resizable-panels": "2.1.9",
68
68
  "react-simple-code-editor": "0.14.1",
69
69
  "react-data-grid": "7.0.0-beta.47",
70
70
  "react-dnd": "16.0.1",
71
71
  "react-dnd-html5-backend": "16.0.1",
72
72
  "date-fns": "2.30.0",
73
- "react-resizable": "3.1.3",
74
- "react-window": "1.8.11"
73
+ "react-window": "1.8.11",
74
+ "react-resizable": "3.1.3"
75
75
  }
76
76
  }