@arsedizioni/ars-utils 22.0.46 → 22.0.48
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/fesm2022/arsedizioni-ars-utils-core.mjs +28 -18
- package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.mjs +90 -25
- package/fesm2022/arsedizioni-ars-utils-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/arsedizioni-ars-utils-clipper.ui.d.ts +1 -1
- package/types/arsedizioni-ars-utils-core.d.ts +15 -14
- package/types/arsedizioni-ars-utils-ui.d.ts +78 -43
|
@@ -1203,32 +1203,43 @@ function resolveFlexInput(raw, hasStarSibling) {
|
|
|
1203
1203
|
return 'none';
|
|
1204
1204
|
return raw;
|
|
1205
1205
|
}
|
|
1206
|
+
/**
|
|
1207
|
+
* Coerces an fxFlex binding value to the string form the builder expects.
|
|
1208
|
+
* Accepts numbers (e.g. `[fxFlex]="32"` or `[fxFlex]="cond ? 24 : 32"`) and
|
|
1209
|
+
* normalises them to a string; keeps `''` (bare attribute) as-is; maps
|
|
1210
|
+
* null/undefined to "not set".
|
|
1211
|
+
* @param v - The bound value: a string, a number, null, or undefined.
|
|
1212
|
+
* @returns The trimmed string value, or undefined when not set.
|
|
1213
|
+
*/
|
|
1214
|
+
function coerceFlex(v) {
|
|
1215
|
+
return v === null || v === undefined ? undefined : String(v).trim();
|
|
1216
|
+
}
|
|
1206
1217
|
class FxFlexDirective extends ResponsiveBaseDirective {
|
|
1207
1218
|
constructor() {
|
|
1208
1219
|
super();
|
|
1209
1220
|
/** Direct ancestor FxLayout (any level); matched to the direct parent in the effect. */
|
|
1210
1221
|
this.parentLayout = inject(FxLayoutDirective, { skipSelf: true, optional: true });
|
|
1211
|
-
this.fxFlex = input(undefined, { ...(ngDevMode ? { debugName: "fxFlex" } : /* istanbul ignore next */ {}), alias: 'fxFlex' });
|
|
1212
|
-
this.xs = input(undefined, { ...(ngDevMode ? { debugName: "xs" } : /* istanbul ignore next */ {}), alias: 'fxFlex.xs' });
|
|
1213
|
-
this.sm = input(undefined, { ...(ngDevMode ? { debugName: "sm" } : /* istanbul ignore next */ {}), alias: 'fxFlex.sm' });
|
|
1214
|
-
this.md = input(undefined, { ...(ngDevMode ? { debugName: "md" } : /* istanbul ignore next */ {}), alias: 'fxFlex.md' });
|
|
1215
|
-
this.lg = input(undefined, { ...(ngDevMode ? { debugName: "lg" } : /* istanbul ignore next */ {}), alias: 'fxFlex.lg' });
|
|
1216
|
-
this.xl = input(undefined, { ...(ngDevMode ? { debugName: "xl" } : /* istanbul ignore next */ {}), alias: 'fxFlex.xl' });
|
|
1217
|
-
this.ltSm = input(undefined, { ...(ngDevMode ? { debugName: "ltSm" } : /* istanbul ignore next */ {}), alias: 'fxFlex.lt-sm' });
|
|
1218
|
-
this.ltMd = input(undefined, { ...(ngDevMode ? { debugName: "ltMd" } : /* istanbul ignore next */ {}), alias: 'fxFlex.lt-md' });
|
|
1219
|
-
this.ltLg = input(undefined, { ...(ngDevMode ? { debugName: "ltLg" } : /* istanbul ignore next */ {}), alias: 'fxFlex.lt-lg' });
|
|
1220
|
-
this.ltXl = input(undefined, { ...(ngDevMode ? { debugName: "ltXl" } : /* istanbul ignore next */ {}), alias: 'fxFlex.lt-xl' });
|
|
1221
|
-
this.gtXs = input(undefined, { ...(ngDevMode ? { debugName: "gtXs" } : /* istanbul ignore next */ {}), alias: 'fxFlex.gt-xs' });
|
|
1222
|
-
this.gtSm = input(undefined, { ...(ngDevMode ? { debugName: "gtSm" } : /* istanbul ignore next */ {}), alias: 'fxFlex.gt-sm' });
|
|
1223
|
-
this.gtMd = input(undefined, { ...(ngDevMode ? { debugName: "gtMd" } : /* istanbul ignore next */ {}), alias: 'fxFlex.gt-md' });
|
|
1224
|
-
this.gtLg = input(undefined, { ...(ngDevMode ? { debugName: "gtLg" } : /* istanbul ignore next */ {}), alias: 'fxFlex.gt-lg' });
|
|
1225
|
-
this.smUp = input(undefined, { ...(ngDevMode ? { debugName: "smUp" } : /* istanbul ignore next */ {}), alias: 'fxFlex.sm-up' });
|
|
1226
|
-
this.mdUp = input(undefined, { ...(ngDevMode ? { debugName: "mdUp" } : /* istanbul ignore next */ {}), alias: 'fxFlex.md-up' });
|
|
1227
|
-
this.lgUp = input(undefined, { ...(ngDevMode ? { debugName: "lgUp" } : /* istanbul ignore next */ {}), alias: 'fxFlex.lg-up' });
|
|
1228
|
-
this.xlUp = input(undefined, { ...(ngDevMode ? { debugName: "xlUp" } : /* istanbul ignore next */ {}), alias: 'fxFlex.xl-up' });
|
|
1229
|
-
this.smDown = input(undefined, { ...(ngDevMode ? { debugName: "smDown" } : /* istanbul ignore next */ {}), alias: 'fxFlex.sm-down' });
|
|
1230
|
-
this.mdDown = input(undefined, { ...(ngDevMode ? { debugName: "mdDown" } : /* istanbul ignore next */ {}), alias: 'fxFlex.md-down' });
|
|
1231
|
-
this.lgDown = input(undefined, { ...(ngDevMode ? { debugName: "lgDown" } : /* istanbul ignore next */ {}), alias: 'fxFlex.lg-down' });
|
|
1222
|
+
this.fxFlex = input(undefined, { ...(ngDevMode ? { debugName: "fxFlex" } : /* istanbul ignore next */ {}), alias: 'fxFlex', transform: coerceFlex });
|
|
1223
|
+
this.xs = input(undefined, { ...(ngDevMode ? { debugName: "xs" } : /* istanbul ignore next */ {}), alias: 'fxFlex.xs', transform: coerceFlex });
|
|
1224
|
+
this.sm = input(undefined, { ...(ngDevMode ? { debugName: "sm" } : /* istanbul ignore next */ {}), alias: 'fxFlex.sm', transform: coerceFlex });
|
|
1225
|
+
this.md = input(undefined, { ...(ngDevMode ? { debugName: "md" } : /* istanbul ignore next */ {}), alias: 'fxFlex.md', transform: coerceFlex });
|
|
1226
|
+
this.lg = input(undefined, { ...(ngDevMode ? { debugName: "lg" } : /* istanbul ignore next */ {}), alias: 'fxFlex.lg', transform: coerceFlex });
|
|
1227
|
+
this.xl = input(undefined, { ...(ngDevMode ? { debugName: "xl" } : /* istanbul ignore next */ {}), alias: 'fxFlex.xl', transform: coerceFlex });
|
|
1228
|
+
this.ltSm = input(undefined, { ...(ngDevMode ? { debugName: "ltSm" } : /* istanbul ignore next */ {}), alias: 'fxFlex.lt-sm', transform: coerceFlex });
|
|
1229
|
+
this.ltMd = input(undefined, { ...(ngDevMode ? { debugName: "ltMd" } : /* istanbul ignore next */ {}), alias: 'fxFlex.lt-md', transform: coerceFlex });
|
|
1230
|
+
this.ltLg = input(undefined, { ...(ngDevMode ? { debugName: "ltLg" } : /* istanbul ignore next */ {}), alias: 'fxFlex.lt-lg', transform: coerceFlex });
|
|
1231
|
+
this.ltXl = input(undefined, { ...(ngDevMode ? { debugName: "ltXl" } : /* istanbul ignore next */ {}), alias: 'fxFlex.lt-xl', transform: coerceFlex });
|
|
1232
|
+
this.gtXs = input(undefined, { ...(ngDevMode ? { debugName: "gtXs" } : /* istanbul ignore next */ {}), alias: 'fxFlex.gt-xs', transform: coerceFlex });
|
|
1233
|
+
this.gtSm = input(undefined, { ...(ngDevMode ? { debugName: "gtSm" } : /* istanbul ignore next */ {}), alias: 'fxFlex.gt-sm', transform: coerceFlex });
|
|
1234
|
+
this.gtMd = input(undefined, { ...(ngDevMode ? { debugName: "gtMd" } : /* istanbul ignore next */ {}), alias: 'fxFlex.gt-md', transform: coerceFlex });
|
|
1235
|
+
this.gtLg = input(undefined, { ...(ngDevMode ? { debugName: "gtLg" } : /* istanbul ignore next */ {}), alias: 'fxFlex.gt-lg', transform: coerceFlex });
|
|
1236
|
+
this.smUp = input(undefined, { ...(ngDevMode ? { debugName: "smUp" } : /* istanbul ignore next */ {}), alias: 'fxFlex.sm-up', transform: coerceFlex });
|
|
1237
|
+
this.mdUp = input(undefined, { ...(ngDevMode ? { debugName: "mdUp" } : /* istanbul ignore next */ {}), alias: 'fxFlex.md-up', transform: coerceFlex });
|
|
1238
|
+
this.lgUp = input(undefined, { ...(ngDevMode ? { debugName: "lgUp" } : /* istanbul ignore next */ {}), alias: 'fxFlex.lg-up', transform: coerceFlex });
|
|
1239
|
+
this.xlUp = input(undefined, { ...(ngDevMode ? { debugName: "xlUp" } : /* istanbul ignore next */ {}), alias: 'fxFlex.xl-up', transform: coerceFlex });
|
|
1240
|
+
this.smDown = input(undefined, { ...(ngDevMode ? { debugName: "smDown" } : /* istanbul ignore next */ {}), alias: 'fxFlex.sm-down', transform: coerceFlex });
|
|
1241
|
+
this.mdDown = input(undefined, { ...(ngDevMode ? { debugName: "mdDown" } : /* istanbul ignore next */ {}), alias: 'fxFlex.md-down', transform: coerceFlex });
|
|
1242
|
+
this.lgDown = input(undefined, { ...(ngDevMode ? { debugName: "lgDown" } : /* istanbul ignore next */ {}), alias: 'fxFlex.lg-down', transform: coerceFlex });
|
|
1232
1243
|
this._rawFlex = computed(() => resolveAll({ default: this.fxFlex(), xs: this.xs(), sm: this.sm(), md: this.md(),
|
|
1233
1244
|
lg: this.lg(), xl: this.xl() }, { 'lt-sm': this.ltSm(), 'lt-md': this.ltMd(), 'lt-lg': this.ltLg(),
|
|
1234
1245
|
'lt-xl': this.ltXl(), 'gt-xs': this.gtXs(), 'gt-sm': this.gtSm(), 'gt-md': this.gtMd(),
|
|
@@ -2086,7 +2097,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
2086
2097
|
/**
|
|
2087
2098
|
* @file fx-style-class.directives.ts (Angular 21 — signals)
|
|
2088
2099
|
*
|
|
2089
|
-
* [fxStyle] — responsive inline style binding (
|
|
2100
|
+
* [fxStyle] — responsive inline style binding (NgStyle-compatible)
|
|
2090
2101
|
* [fxClass] — responsive CSS class binding (string | string[] | Record<string,boolean>)
|
|
2091
2102
|
*
|
|
2092
2103
|
* Angular 21 changes:
|
|
@@ -2101,6 +2112,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
2101
2112
|
*
|
|
2102
2113
|
* Breakpoint suffixes: canonical + lt-* + gt-* + *-up + *-down
|
|
2103
2114
|
*/
|
|
2115
|
+
/**
|
|
2116
|
+
* Flattens any {@link StyleInput} into a plain `{ property: cssValue }` map,
|
|
2117
|
+
* resolving `'prop.unit': value` keys (e.g. `'max-width.px': 30` → `max-width: '30px'`)
|
|
2118
|
+
* and stringifying numeric values. `null` / `undefined` / `''` values are skipped.
|
|
2119
|
+
* @param v - The raw style input (or undefined).
|
|
2120
|
+
* @returns A normalised `{ property: value }` map ready for `Renderer2.setStyle`.
|
|
2121
|
+
*/
|
|
2122
|
+
function normalizeStyle(v) {
|
|
2123
|
+
const out = {};
|
|
2124
|
+
const addRecord = (rec) => {
|
|
2125
|
+
for (const [rawKey, rawVal] of Object.entries(rec)) {
|
|
2126
|
+
if (rawVal === null || rawVal === undefined || rawVal === '')
|
|
2127
|
+
continue;
|
|
2128
|
+
const dot = rawKey.indexOf('.');
|
|
2129
|
+
if (dot > -1) {
|
|
2130
|
+
const prop = rawKey.slice(0, dot).trim();
|
|
2131
|
+
const unit = rawKey.slice(dot + 1).trim();
|
|
2132
|
+
if (prop)
|
|
2133
|
+
out[prop] = `${rawVal}${unit}`;
|
|
2134
|
+
}
|
|
2135
|
+
else {
|
|
2136
|
+
out[rawKey.trim()] = String(rawVal);
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
};
|
|
2140
|
+
const addString = (s) => {
|
|
2141
|
+
for (const decl of s.split(';')) {
|
|
2142
|
+
const i = decl.indexOf(':');
|
|
2143
|
+
if (i === -1)
|
|
2144
|
+
continue;
|
|
2145
|
+
const prop = decl.slice(0, i).trim();
|
|
2146
|
+
const val = decl.slice(i + 1).trim();
|
|
2147
|
+
if (prop)
|
|
2148
|
+
out[prop] = val;
|
|
2149
|
+
}
|
|
2150
|
+
};
|
|
2151
|
+
if (!v)
|
|
2152
|
+
return out;
|
|
2153
|
+
if (typeof v === 'string')
|
|
2154
|
+
addString(v);
|
|
2155
|
+
else if (Array.isArray(v)) {
|
|
2156
|
+
for (const item of v)
|
|
2157
|
+
typeof item === 'string' ? addString(item) : addRecord(item);
|
|
2158
|
+
}
|
|
2159
|
+
else {
|
|
2160
|
+
addRecord(v);
|
|
2161
|
+
}
|
|
2162
|
+
return out;
|
|
2163
|
+
}
|
|
2104
2164
|
class FxStyleDirective extends ResponsiveBaseDirective {
|
|
2105
2165
|
constructor() {
|
|
2106
2166
|
super();
|
|
@@ -2125,12 +2185,12 @@ class FxStyleDirective extends ResponsiveBaseDirective {
|
|
|
2125
2185
|
this.smDown = input(undefined, { ...(ngDevMode ? { debugName: "smDown" } : /* istanbul ignore next */ {}), alias: 'fxStyle.sm-down' });
|
|
2126
2186
|
this.mdDown = input(undefined, { ...(ngDevMode ? { debugName: "mdDown" } : /* istanbul ignore next */ {}), alias: 'fxStyle.md-down' });
|
|
2127
2187
|
this.lgDown = input(undefined, { ...(ngDevMode ? { debugName: "lgDown" } : /* istanbul ignore next */ {}), alias: 'fxStyle.lg-down' });
|
|
2128
|
-
this._resolved = computed(() => (resolveAll({ default: this.fxStyle(), xs: this.xs(), sm: this.sm(),
|
|
2188
|
+
this._resolved = computed(() => normalizeStyle(resolveAll({ default: this.fxStyle(), xs: this.xs(), sm: this.sm(),
|
|
2129
2189
|
md: this.md(), lg: this.lg(), xl: this.xl() }, { 'lt-sm': this.ltSm(), 'lt-md': this.ltMd(), 'lt-lg': this.ltLg(),
|
|
2130
2190
|
'lt-xl': this.ltXl(), 'gt-xs': this.gtXs(), 'gt-sm': this.gtSm(), 'gt-md': this.gtMd(),
|
|
2131
2191
|
'gt-lg': this.gtLg(), 'sm-up': this.smUp(), 'md-up': this.mdUp(), 'lg-up': this.lgUp(),
|
|
2132
2192
|
'xl-up': this.xlUp(), 'sm-down': this.smDown(), 'md-down': this.mdDown(),
|
|
2133
|
-
'lg-down': this.lgDown() }, this.media.currentBp(), a => this.media.isActive(a))
|
|
2193
|
+
'lg-down': this.lgDown() }, this.media.currentBp(), a => this.media.isActive(a))), /* @ts-ignore */
|
|
2134
2194
|
...(ngDevMode ? [{ debugName: "_resolved" }] : /* istanbul ignore next */ []));
|
|
2135
2195
|
/** Tracks which CSS properties were last applied — plain field, not a signal. */
|
|
2136
2196
|
this._appliedProps = new Set();
|
|
@@ -2181,6 +2241,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
2181
2241
|
standalone: true
|
|
2182
2242
|
}]
|
|
2183
2243
|
}], ctorParameters: () => [], propDecorators: { fxStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle", required: false }] }], xs: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.xs", required: false }] }], sm: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.sm", required: false }] }], md: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.md", required: false }] }], lg: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.lg", required: false }] }], xl: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.xl", required: false }] }], ltSm: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.lt-sm", required: false }] }], ltMd: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.lt-md", required: false }] }], ltLg: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.lt-lg", required: false }] }], ltXl: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.lt-xl", required: false }] }], gtXs: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.gt-xs", required: false }] }], gtSm: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.gt-sm", required: false }] }], gtMd: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.gt-md", required: false }] }], gtLg: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.gt-lg", required: false }] }], smUp: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.sm-up", required: false }] }], mdUp: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.md-up", required: false }] }], lgUp: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.lg-up", required: false }] }], xlUp: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.xl-up", required: false }] }], smDown: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.sm-down", required: false }] }], mdDown: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.md-down", required: false }] }], lgDown: [{ type: i0.Input, args: [{ isSignal: true, alias: "fxStyle.lg-down", required: false }] }] } });
|
|
2244
|
+
/**
|
|
2245
|
+
* Converts any {@link ClassInput} into a flat set of active class names.
|
|
2246
|
+
* @param v - The class input (string, array, or `{ class: enabled }` map), or undefined.
|
|
2247
|
+
* @returns A `Set` of the class names that should be applied.
|
|
2248
|
+
*/
|
|
2184
2249
|
function toClassSet(v) {
|
|
2185
2250
|
if (!v)
|
|
2186
2251
|
return new Set();
|
|
@@ -3503,5 +3568,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
3503
3568
|
* Generated bundle index. Do not edit.
|
|
3504
3569
|
*/
|
|
3505
3570
|
|
|
3506
|
-
export { ALIAS_FAMILIES, ALIAS_INDEX, BS5_BREAKPOINTS, BusyDialogComponent, BusyTimer, CANONICAL_ALIASES, ConfirmDialogComponent, CredentialsDialogComponent, DeleteDialogComponent, DeleteDialogConfirmMode, DialogService, FlexLayoutModule, FxClassDirective, FxFlexAlignDirective, FxFlexDirective, FxFlexFillDirective, FxFlexOffsetDirective, FxFlexOrderDirective, FxGridAreaDirective, FxGridColumnDirective, FxGridDirective, FxLayoutAlignDirective, FxLayoutDirective, FxLayoutGapDirective, FxLayoutWrapDirective, FxShowHideDirective, FxStyleDirective, IfBpDirective, InfoDialogComponent, LAYOUT_BREAKPOINTS, LAYOUT_VALUES, MediaObserver, NON_CANONICAL_PRIORITY, OtpInputComponent, PaginatorIntl, PasswordStrengthComponent, RecoverPasswordDialogComponent, ResetPasswordDialogComponent, ResponsiveBaseDirective, ToastComponent, UIService, applyVisibility, buildAlignStyles, buildFlexStyles, buildLayoutCSS, resolve, resolveAll, resolveFlexInput, resolveNonCanonical, resolveParentFlow, validateBasis, validateLayoutValue, validateWrapValue };
|
|
3571
|
+
export { ALIAS_FAMILIES, ALIAS_INDEX, BS5_BREAKPOINTS, BusyDialogComponent, BusyTimer, CANONICAL_ALIASES, ConfirmDialogComponent, CredentialsDialogComponent, DeleteDialogComponent, DeleteDialogConfirmMode, DialogService, FlexLayoutModule, FxClassDirective, FxFlexAlignDirective, FxFlexDirective, FxFlexFillDirective, FxFlexOffsetDirective, FxFlexOrderDirective, FxGridAreaDirective, FxGridColumnDirective, FxGridDirective, FxLayoutAlignDirective, FxLayoutDirective, FxLayoutGapDirective, FxLayoutWrapDirective, FxShowHideDirective, FxStyleDirective, IfBpDirective, InfoDialogComponent, LAYOUT_BREAKPOINTS, LAYOUT_VALUES, MediaObserver, NON_CANONICAL_PRIORITY, OtpInputComponent, PaginatorIntl, PasswordStrengthComponent, RecoverPasswordDialogComponent, ResetPasswordDialogComponent, ResponsiveBaseDirective, ToastComponent, UIService, applyVisibility, buildAlignStyles, buildFlexStyles, buildLayoutCSS, coerceFlex, normalizeStyle, resolve, resolveAll, resolveFlexInput, resolveNonCanonical, resolveParentFlow, toBool, toClassSet, validateBasis, validateLayoutValue, validateWrapValue };
|
|
3507
3572
|
//# sourceMappingURL=arsedizioni-ars-utils-ui.mjs.map
|