@m4l/components 9.57.1-beta-hotfix-semantic-width-dynamicform.0 → 9.57.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.
- package/components/CheckableList/slots/styled.d.ts +3 -3
- package/components/DynamicForm/DynamicForm.styles.d.ts.map +1 -1
- package/components/DynamicForm/DynamicForm.styles.js +61 -54
- package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.d.ts.map +1 -1
- package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.js +124 -137
- package/components/Label/Label.d.ts.map +1 -1
- package/components/Label/Label.js +26 -40
- package/components/Label/Label.styles.d.ts.map +1 -1
- package/components/Label/Label.styles.js +52 -52
- package/components/Label/types.d.ts +0 -2
- package/components/Label/types.d.ts.map +1 -1
- package/components/PropertyValue/PropertyValue.d.ts.map +1 -1
- package/components/PropertyValue/PropertyValue.js +57 -82
- package/components/PropertyValue/PropertyValue.styles.d.ts.map +1 -1
- package/components/PropertyValue/PropertyValue.styles.js +91 -87
- package/components/PropertyValue/types.d.ts +1 -5
- package/components/PropertyValue/types.d.ts.map +1 -1
- package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.d.ts +1 -1
- package/package.json +7 -7
- package/components/DynamicForm/helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.d.ts +0 -26
- package/components/DynamicForm/helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.d.ts.map +0 -1
- package/components/DynamicForm/helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.js +0 -64
- package/components/PropertyValue/semanticWidth.d.ts +0 -7
- package/components/PropertyValue/semanticWidth.d.ts.map +0 -1
- package/components/PropertyValue/semanticWidth.js +0 -31
package/components/DynamicForm/helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { SemanticWidthOptions } from '../../../PropertyValue/types';
|
|
2
|
-
type AdaptiveFieldLayoutSize = 'small' | 'medium';
|
|
3
|
-
export interface EstimateLabelWidthPxParams {
|
|
4
|
-
hasHelperMessage?: boolean;
|
|
5
|
-
label: string;
|
|
6
|
-
mandatory?: boolean;
|
|
7
|
-
size: AdaptiveFieldLayoutSize;
|
|
8
|
-
symbol?: string | null;
|
|
9
|
-
}
|
|
10
|
-
export interface ResolveAdaptiveFieldLayoutParams extends EstimateLabelWidthPxParams {
|
|
11
|
-
requestedSemanticWidth?: SemanticWidthOptions | null;
|
|
12
|
-
}
|
|
13
|
-
export interface AdaptiveFieldLayout {
|
|
14
|
-
controlWidth?: number;
|
|
15
|
-
estimatedLabelWidth: number;
|
|
16
|
-
isFullWidth: boolean;
|
|
17
|
-
labelWidth?: number;
|
|
18
|
-
requestedSemanticWidth?: SemanticWidthOptions | null;
|
|
19
|
-
wrapperWidth?: number;
|
|
20
|
-
}
|
|
21
|
-
/** Estimate the visual width needed by a single-line DynamicForm label. */
|
|
22
|
-
export declare function estimateLabelWidthPx(params: EstimateLabelWidthPxParams): number;
|
|
23
|
-
/** Resolve wrapper, label, and control widths without replacing the backend semantic width. */
|
|
24
|
-
export declare function resolveAdaptiveFieldLayout(params: ResolveAdaptiveFieldLayoutParams): AdaptiveFieldLayout;
|
|
25
|
-
export {};
|
|
26
|
-
//# sourceMappingURL=resolveAdaptiveFieldLayout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/components/DynamicForm/helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { isFullRowSemanticWidth as c, resolveSemanticWidthPx as f } from "../../../PropertyValue/semanticWidth.js";
|
|
2
|
-
const p = {
|
|
3
|
-
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
|
|
13
|
-
},
|
|
14
|
-
medium: {
|
|
15
|
-
buffer: 16,
|
|
16
|
-
helperIcon: 28,
|
|
17
|
-
mandatoryMarker: 10,
|
|
18
|
-
narrow: 5,
|
|
19
|
-
normal: 8,
|
|
20
|
-
punctuation: 4,
|
|
21
|
-
space: 5,
|
|
22
|
-
uppercase: 9,
|
|
23
|
-
wide: 11
|
|
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);
|
|
28
|
-
return Math.ceil(
|
|
29
|
-
l + o.buffer + (n ? o.mandatoryMarker : 0) + (e ? o.helperIcon : 0)
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
function _(t) {
|
|
33
|
-
const { requestedSemanticWidth: e } = t, r = R(t), n = f(e);
|
|
34
|
-
if (c(e))
|
|
35
|
-
return {
|
|
36
|
-
controlWidth: n,
|
|
37
|
-
estimatedLabelWidth: r,
|
|
38
|
-
isFullWidth: !0,
|
|
39
|
-
requestedSemanticWidth: e
|
|
40
|
-
};
|
|
41
|
-
if (!n || r > m)
|
|
42
|
-
return {
|
|
43
|
-
controlWidth: n,
|
|
44
|
-
estimatedLabelWidth: r,
|
|
45
|
-
isFullWidth: !0,
|
|
46
|
-
requestedSemanticWidth: e
|
|
47
|
-
};
|
|
48
|
-
const i = Math.max(n, r);
|
|
49
|
-
return {
|
|
50
|
-
controlWidth: n,
|
|
51
|
-
estimatedLabelWidth: r,
|
|
52
|
-
isFullWidth: !1,
|
|
53
|
-
labelWidth: i,
|
|
54
|
-
requestedSemanticWidth: e,
|
|
55
|
-
wrapperWidth: i
|
|
56
|
-
};
|
|
57
|
-
}
|
|
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;
|
|
60
|
-
}
|
|
61
|
-
export {
|
|
62
|
-
R as estimateLabelWidthPx,
|
|
63
|
-
_ as resolveAdaptiveFieldLayout
|
|
64
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SemanticWidthOptions } from './types';
|
|
2
|
-
export declare const SEMANTIC_WIDTH_PIXEL_VALUES: Record<SemanticWidthOptions, number | null>;
|
|
3
|
-
/** Resolve the finite pixel width assigned to a semantic width option. */
|
|
4
|
-
export declare function resolveSemanticWidthPx(semanticWidth: SemanticWidthOptions | null | undefined): number | undefined;
|
|
5
|
-
/** Determine whether a semantic width should occupy a full layout row. */
|
|
6
|
-
export declare function isFullRowSemanticWidth(semanticWidth: SemanticWidthOptions | null | undefined): boolean;
|
|
7
|
-
//# sourceMappingURL=semanticWidth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"semanticWidth.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/PropertyValue/semanticWidth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAC9C,oBAAoB,EACpB,MAAM,GAAG,IAAI,CAiBd,CAAC;AAEF,0EAA0E;AAC1E,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,GACrD,MAAM,GAAG,SAAS,CAQpB;AAED,0EAA0E;AAC1E,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,GACrD,OAAO,CAET"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const r = {
|
|
2
|
-
email: 400,
|
|
3
|
-
shortName: 90,
|
|
4
|
-
mediumName: 260,
|
|
5
|
-
bigName: 520,
|
|
6
|
-
shortId: 44,
|
|
7
|
-
mediumId: 60,
|
|
8
|
-
bigId: 200,
|
|
9
|
-
shortDescription: 796,
|
|
10
|
-
mediumDescription: 1500,
|
|
11
|
-
bigDescription: null,
|
|
12
|
-
shortNumber: 50,
|
|
13
|
-
mediumNumber: 60,
|
|
14
|
-
bigNumber: 162,
|
|
15
|
-
percentNumber: 50,
|
|
16
|
-
fullWidth: null
|
|
17
|
-
};
|
|
18
|
-
function u(e) {
|
|
19
|
-
if (!e)
|
|
20
|
-
return;
|
|
21
|
-
const i = r[e];
|
|
22
|
-
return typeof i == "number" ? i : void 0;
|
|
23
|
-
}
|
|
24
|
-
function t(e) {
|
|
25
|
-
return !e || r[e] === null;
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
28
|
-
r as SEMANTIC_WIDTH_PIXEL_VALUES,
|
|
29
|
-
t as isFullRowSemanticWidth,
|
|
30
|
-
u as resolveSemanticWidthPx
|
|
31
|
-
};
|