@eagami/ui 5.90.1 → 5.91.0
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/eagami-ui-router.mjs +3 -3
- package/fesm2022/eagami-ui-router.mjs.map +1 -1
- package/fesm2022/eagami-ui.mjs +1913 -1895
- package/fesm2022/eagami-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/eagami-ui-router.d.ts +4 -2
- package/types/eagami-ui-testing.d.ts +3 -0
- package/types/eagami-ui.d.ts +11 -161
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eagami/ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.91.0",
|
|
4
4
|
"description": "Lightweight, accessible, themeable Angular UI component library and icon set built on CSS custom properties",
|
|
5
5
|
"author": "Michal Wiraszka <michal@eagami.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
import { EnvironmentProviders } from "@angular/core";
|
|
2
5
|
/**
|
|
3
6
|
* How a reload into the current build turned out:
|
|
4
7
|
*
|
|
@@ -22,7 +25,6 @@ interface StaleBuildReloadConfig {
|
|
|
22
25
|
/** Called once per reload with how it turned out, for example to log it. */
|
|
23
26
|
onReport?: (report: StaleBuildReloadReport) => void;
|
|
24
27
|
}
|
|
25
|
-
declare const LOAD_PAGE: InjectionToken<(url: string, replace: boolean) => void>;
|
|
26
28
|
/**
|
|
27
29
|
* Whether `error` is a failed page load that `provideStaleBuildReload()` has
|
|
28
30
|
* already answered by reloading. Error reporters can drop it, since the
|
package/types/eagami-ui.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
1
4
|
import * as i0 from "@angular/core";
|
|
2
5
|
import { AfterContentChecked, ElementRef, EnvironmentProviders, InjectionToken, Injector, OnDestroy, OnInit, Signal, TemplateRef, Type } from "@angular/core";
|
|
3
|
-
import {
|
|
6
|
+
import { ControlValueAccessor } from "@angular/forms";
|
|
4
7
|
/**
|
|
5
8
|
* When a form component shows its validation error.
|
|
6
9
|
*
|
|
@@ -22,8 +25,6 @@ interface EagamiFormsConfig {
|
|
|
22
25
|
/** When form components show their validation errors; `'change'` by default. */
|
|
23
26
|
showErrorsOn?: EaShowErrorsOn;
|
|
24
27
|
}
|
|
25
|
-
/** DI token carrying the consumer-supplied form defaults. */
|
|
26
|
-
declare const EAGAMI_FORMS_CONFIG: InjectionToken<EagamiFormsConfig>;
|
|
27
28
|
/**
|
|
28
29
|
* BCP 47 locale tags supported out of the box. Consumers select one of these
|
|
29
30
|
* via `provideEagamiUi({ locale })` or `EagamiI18nService.setLocale()`.
|
|
@@ -619,19 +620,6 @@ export declare function formatViolations(violations: readonly ContrastViolation[
|
|
|
619
620
|
export declare function applyPalette(palette: ModePalette, nonce?: string | null): void;
|
|
620
621
|
export declare function relativeLuminance(hex: string): number;
|
|
621
622
|
export declare function contrastRatio(hexA: string, hexB: string): number;
|
|
622
|
-
/** The two inks a component paints on a caller-supplied fill. */
|
|
623
|
-
declare const INK: {
|
|
624
|
-
readonly light: "#ffffff";
|
|
625
|
-
readonly dark: "#030712";
|
|
626
|
-
};
|
|
627
|
-
/** `#abc` and `#aabbcc` alike as `#aabbcc`, or `null` for anything else. */
|
|
628
|
-
declare function normalizeHex(color: string): string | null;
|
|
629
|
-
/**
|
|
630
|
-
* Whichever of the two inks reads better on `background`, for a fill the
|
|
631
|
-
* library cannot know ahead of time (a user-chosen tag colour). Returns `null`
|
|
632
|
-
* when the background is not a hex colour this can measure.
|
|
633
|
-
*/
|
|
634
|
-
declare function readableInk(background: string): 'light' | 'dark' | null;
|
|
635
623
|
/**
|
|
636
624
|
* WCAG 2.1 AA contrast floors: 4.5:1 for body text, 3:1 for ≥ 18pt text
|
|
637
625
|
* (or ≥ 14pt bold), 3:1 for UI components (icons, focus rings, meaningful
|
|
@@ -655,14 +643,6 @@ interface Oklch {
|
|
|
655
643
|
/** Hue, 0–360 degrees. */
|
|
656
644
|
h: number;
|
|
657
645
|
}
|
|
658
|
-
interface Rgb$1 {
|
|
659
|
-
/** 0–255. */
|
|
660
|
-
r: number;
|
|
661
|
-
g: number;
|
|
662
|
-
b: number;
|
|
663
|
-
}
|
|
664
|
-
declare function hexToRgb(hex: string): Rgb$1;
|
|
665
|
-
declare function rgbToHex({ r, g, b }: Rgb$1): string;
|
|
666
646
|
export declare function hexToOklch(hex: string): Oklch;
|
|
667
647
|
export declare function oklchToHex(oklch: Oklch): string;
|
|
668
648
|
/**
|
|
@@ -906,28 +886,8 @@ interface RenderedGroup {
|
|
|
906
886
|
rule: boolean;
|
|
907
887
|
options: IndexedOption[];
|
|
908
888
|
}
|
|
909
|
-
/**
|
|
910
|
-
* Lowercased with diacritics folded away, so a search typed on a plain
|
|
911
|
-
* keyboard still finds the accented spelling: "jablko" finds "Jabłko".
|
|
912
|
-
*/
|
|
913
|
-
declare function foldForSearch(value: string): string;
|
|
914
889
|
/** Whether the consumer supplied groups rather than a flat option list. */
|
|
915
890
|
export declare function isGrouped(options: SelectOptions): options is readonly SelectOptionGroup[];
|
|
916
|
-
/** Normalizes either accepted shape to groups; a flat list becomes one unlabelled group. */
|
|
917
|
-
declare function toGroups(options: SelectOptions): readonly SelectOptionGroup[];
|
|
918
|
-
/** Drops every option failing `keep`, then every group left empty. */
|
|
919
|
-
declare function filterGroups(groups: readonly SelectOptionGroup[], keep: (option: SelectOption) => boolean): SelectOptionGroup[];
|
|
920
|
-
/** Trims the groups down to at most `max` options in total, dropping any that no longer fit. */
|
|
921
|
-
declare function limitGroups(groups: readonly SelectOptionGroup[], max: number): SelectOptionGroup[];
|
|
922
|
-
/** Flattens groups back into a single option list, in the order they were given. */
|
|
923
|
-
declare function flattenGroups(groups: readonly SelectOptionGroup[]): SelectOption[];
|
|
924
|
-
/**
|
|
925
|
-
* Pairs every option with its index into the flattened list, so keyboard
|
|
926
|
-
* navigation and selection count options alone while the template still renders
|
|
927
|
-
* the headings and rules that sit between them. Groups holding no options are
|
|
928
|
-
* left out, so neither a heading nor a rule can render over nothing.
|
|
929
|
-
*/
|
|
930
|
-
declare function toRenderedGroups(groups: readonly SelectOptionGroup[]): RenderedGroup[];
|
|
931
891
|
/**
|
|
932
892
|
* Label, hint and validation inputs shared by every form control that renders
|
|
933
893
|
* `<ea-field-messages>`. Controls with an inline label (checkbox, switch)
|
|
@@ -1242,6 +1202,7 @@ export declare class AvatarEditorComponent implements OnDestroy {
|
|
|
1242
1202
|
readonly frameHeight: import("@angular/core").Signal<number>;
|
|
1243
1203
|
/** Lowest zoom the controls reach, down to the whole image fitting the frame when `letterbox` is on. */
|
|
1244
1204
|
readonly lowestZoom: import("@angular/core").Signal<number>;
|
|
1205
|
+
private readonly hasFillStop;
|
|
1245
1206
|
/** True when the part of the image inside the frame is narrower than `displayWidth`, so the exported crop would be upscaled. */
|
|
1246
1207
|
readonly isLowResolution: import("@angular/core").Signal<boolean>;
|
|
1247
1208
|
/** True when the visible crop is darker than mid-grey; drives the `--on-light` class on the overlay so the "Change photo" affordance stays readable. */
|
|
@@ -1261,6 +1222,8 @@ export declare class AvatarEditorComponent implements OnDestroy {
|
|
|
1261
1222
|
private readonly originalCaptured;
|
|
1262
1223
|
private originalImage;
|
|
1263
1224
|
private originalCropState;
|
|
1225
|
+
private lastFrame;
|
|
1226
|
+
private fillWheelTravel;
|
|
1264
1227
|
readonly hostClasses: import("@angular/core").Signal<{
|
|
1265
1228
|
[x: string]: boolean;
|
|
1266
1229
|
'ea-avatar-editor--has-image': boolean;
|
|
@@ -1290,9 +1253,11 @@ export declare class AvatarEditorComponent implements OnDestroy {
|
|
|
1290
1253
|
private onTouchMove;
|
|
1291
1254
|
private onTouchEnd;
|
|
1292
1255
|
private onWheel;
|
|
1256
|
+
private holdsAtFill;
|
|
1293
1257
|
onCanvasKeydown(event: KeyboardEvent): void;
|
|
1294
1258
|
/** Sets the zoom level, clamped to the configured `minZoom`/`maxZoom` range. */
|
|
1295
1259
|
setZoom(value: number): void;
|
|
1260
|
+
protected stepZoom(value: number): void;
|
|
1296
1261
|
onZoomInput(event: Event): void;
|
|
1297
1262
|
/** Clears the loaded image and resets pan/zoom to defaults. */
|
|
1298
1263
|
removeImage(): void;
|
|
@@ -1317,6 +1282,7 @@ export declare class AvatarEditorComponent implements OnDestroy {
|
|
|
1317
1282
|
private traceEllipse;
|
|
1318
1283
|
private getDrawParams;
|
|
1319
1284
|
private applyZoom;
|
|
1285
|
+
private scaleOffsets;
|
|
1320
1286
|
private clampOffset;
|
|
1321
1287
|
private clampAxis;
|
|
1322
1288
|
private letterboxColor;
|
|
@@ -1548,65 +1514,12 @@ interface ChartReferenceLine {
|
|
|
1548
1514
|
}
|
|
1549
1515
|
/** How a line bends between points. */
|
|
1550
1516
|
type ChartCurve = 'linear' | 'smooth' | 'step';
|
|
1551
|
-
/** Number of categorical colors in the `--color-chart-*` palette. */
|
|
1552
|
-
declare const CHART_COLOR_COUNT = 8;
|
|
1553
|
-
/** Resolves a series' color, falling back to its slot of the chart palette. */
|
|
1554
|
-
declare function chartColor(index: number, override?: string): string;
|
|
1555
|
-
/** A value axis extended to round numbers, with the ticks drawn along it. */
|
|
1556
|
-
interface NiceScale {
|
|
1557
|
-
min: number;
|
|
1558
|
-
max: number;
|
|
1559
|
-
ticks: number[];
|
|
1560
|
-
}
|
|
1561
|
-
/**
|
|
1562
|
-
* Extends `[min, max]` outward to round tick values, about `maxTicks` of them, or more
|
|
1563
|
-
* where a gap would otherwise exceed `maxStep`.
|
|
1564
|
-
*/
|
|
1565
|
-
declare function niceScale(min: number, max: number, maxTicks?: number, maxStep?: number): NiceScale;
|
|
1566
|
-
/** A plotted point in pixels. */
|
|
1567
|
-
interface CurvePoint {
|
|
1568
|
-
x: number;
|
|
1569
|
-
y: number;
|
|
1570
|
-
}
|
|
1571
|
-
/** SVG path data tracing a run of points with each curve. */
|
|
1572
|
-
declare const CHART_CURVES: Record<ChartCurve, (points: CurvePoint[]) => string>;
|
|
1573
|
-
/** Reference lines with a finite value, the only ones a chart can place. */
|
|
1574
|
-
declare function plottableReferenceLines(lines: readonly ChartReferenceLine[]): ChartReferenceLine[];
|
|
1575
|
-
/** Rough rendered width of `text` in px, for reserving axis room without a layout pass. */
|
|
1576
|
-
declare function estimateTextWidth(text: string, fontPx: number): number;
|
|
1577
|
-
/** Live size of a chart's host, re-measured on resize and whenever `remeasureOn` changes. */
|
|
1578
|
-
interface ChartViewport {
|
|
1579
|
-
width: Signal<number>;
|
|
1580
|
-
fontSize: Signal<number>;
|
|
1581
|
-
}
|
|
1582
|
-
/**
|
|
1583
|
-
* Measures the host's width and font-size so the chart can lay out its SVG in
|
|
1584
|
-
* real pixels, keeping text and stroke widths crisp at every width.
|
|
1585
|
-
*/
|
|
1586
|
-
declare function injectChartViewport(remeasureOn: Signal<unknown>): ChartViewport;
|
|
1587
|
-
/** Localized value formatter honouring a consumer's own `formatValue`. */
|
|
1588
|
-
declare function injectChartFormatter(formatValue: Signal<((value: number) => string) | null>): Signal<(value: number) => string>;
|
|
1589
|
-
/** Keeps a value inside `[min, max]`. */
|
|
1590
|
-
declare function clamp(value: number, min: number, max: number): number;
|
|
1591
1517
|
/**
|
|
1592
1518
|
* How category or x-axis labels are set: level, at 45 degrees, at 90 degrees, or
|
|
1593
1519
|
* `auto`, which stays level while the labels fit and turns them 45 then 90 degrees
|
|
1594
1520
|
* as they crowd.
|
|
1595
1521
|
*/
|
|
1596
1522
|
type ChartLabelOrientation = 'horizontal' | 'diagonal' | 'vertical' | 'auto';
|
|
1597
|
-
declare const CHART_LABEL_ANGLES: Record<Exclude<ChartLabelOrientation, 'auto'>, number>;
|
|
1598
|
-
declare const TICK_EXTRA_PX = 2;
|
|
1599
|
-
declare const TICK_LABEL_GAP_PX = 2;
|
|
1600
|
-
declare const BREAK_CLEARANCE = 6;
|
|
1601
|
-
declare const BREAK_HEIGHT = 2.5;
|
|
1602
|
-
/** Length of a tick mark below the axis. */
|
|
1603
|
-
declare function tickLength(axisPx: number): number;
|
|
1604
|
-
/** Room along the axis a label needs: its width when level, a line's height when turned. */
|
|
1605
|
-
declare function labelRoom(text: string, angle: number, axisPx: number): number;
|
|
1606
|
-
/** Space below the plot for the axis labels, turned to `angle` degrees, and their ticks. */
|
|
1607
|
-
declare function labelBand(widest: number, angle: number, axisPx: number, height: number): number;
|
|
1608
|
-
/** Baseline of the axis labels below an axis at `axisY`. */
|
|
1609
|
-
declare function labelLine(axisY: number, angle: number, axisPx: number): number;
|
|
1610
1523
|
interface AxisBreak {
|
|
1611
1524
|
axis: string;
|
|
1612
1525
|
slashes: string;
|
|
@@ -1617,8 +1530,6 @@ interface AxisBreak {
|
|
|
1617
1530
|
height: number;
|
|
1618
1531
|
};
|
|
1619
1532
|
}
|
|
1620
|
-
/** A y-axis line up the plot's left edge, cut where two parallel slashes cross it. */
|
|
1621
|
-
declare function axisBreak(x: number, top: number, bottom: number, y: number, axisPx: number): AxisBreak;
|
|
1622
1533
|
/** Direction the bars extend from the baseline. */
|
|
1623
1534
|
export type BarChartOrientation = 'vertical' | 'horizontal';
|
|
1624
1535
|
/**
|
|
@@ -2423,7 +2334,7 @@ export type IconComponentType = Type<unknown> & IconMeta;
|
|
|
2423
2334
|
* individual icon components don't need to repeat the `host: { style: '...' }`
|
|
2424
2335
|
* config in their `@Component` decorator. Brand icons with their own host
|
|
2425
2336
|
* bindings (e.g. a colour binding tied to a `brand` input) layer those onto
|
|
2426
|
-
* this base
|
|
2337
|
+
* this base through their own `host` metadata.
|
|
2427
2338
|
*
|
|
2428
2339
|
* Feather-derived icons read the `strokeWidth` input via `[attr.stroke-width]`
|
|
2429
2340
|
* in their SVG template, so consumers can thin or thicken any icon at the
|
|
@@ -2433,9 +2344,6 @@ export type IconComponentType = Type<unknown> & IconMeta;
|
|
|
2433
2344
|
* (e.g. camera, upload at 1.5).
|
|
2434
2345
|
*/
|
|
2435
2346
|
export declare abstract class IconComponentBase {
|
|
2436
|
-
readonly display = "inline-flex";
|
|
2437
|
-
readonly width = "1em";
|
|
2438
|
-
readonly height = "1em";
|
|
2439
2347
|
static readonly defaultStrokeWidth: number;
|
|
2440
2348
|
readonly strokeWidth: import("@angular/core").InputSignal<number>;
|
|
2441
2349
|
static ɵfac: i0.ɵɵFactoryDeclaration<IconComponentBase, never>;
|
|
@@ -4849,55 +4757,6 @@ type EaValidationErrorKey = 'required' | 'email' | 'min' | 'max' | 'minlength' |
|
|
|
4849
4757
|
* so a field whose only errors are hidden keeps out of its error state.
|
|
4850
4758
|
*/
|
|
4851
4759
|
type EaErrorMessages = Partial<Record<string, string | null>>;
|
|
4852
|
-
interface ControlErrorStateConfig {
|
|
4853
|
-
/** Explicit error text; shown unconditionally and overrides any auto-derived message. */
|
|
4854
|
-
errorMsg: Signal<string | null | undefined>;
|
|
4855
|
-
/** Per-error-key overrides for auto-derived validation messages. */
|
|
4856
|
-
errorMessages: Signal<EaErrorMessages | undefined>;
|
|
4857
|
-
/** Field-level `showErrorsOn`; `undefined` falls back to the app-wide `forms` config. */
|
|
4858
|
-
showErrorsOn?: Signal<EaShowErrorsOn | undefined>;
|
|
4859
|
-
}
|
|
4860
|
-
interface ControlErrorState {
|
|
4861
|
-
/** Error text to display, or `null` when the field is valid or untouched. */
|
|
4862
|
-
readonly error: Signal<string | null>;
|
|
4863
|
-
/** Whether the field should render its error state. */
|
|
4864
|
-
readonly hasError: Signal<boolean>;
|
|
4865
|
-
}
|
|
4866
|
-
/**
|
|
4867
|
-
* Derives a form control's display error from, in priority order: an explicit
|
|
4868
|
-
* `errorMsg`, a consumer `errorMessages` override, then the library's localized
|
|
4869
|
-
* default for the active `ValidationErrors` key.
|
|
4870
|
-
*
|
|
4871
|
-
* Auto-derived messages surface only once the bound control is `invalid &&
|
|
4872
|
-
* touched`. Under the default `showErrorsOn: 'change'`, a new one waits while
|
|
4873
|
-
* focus is still inside the field, until the user leaves it or submits the
|
|
4874
|
-
* form, so nothing is flagged mid-edit, and a field the user only passed
|
|
4875
|
-
* through, leaving it without changing it, stays quiet until they change it or
|
|
4876
|
-
* the form is submitted, so tabbing past an empty required field never flags
|
|
4877
|
-
* it. `'blur'` drops the second hold and `'touch'` drops both. A message
|
|
4878
|
-
* already showing follows the value as it is typed and clears the moment it is
|
|
4879
|
-
* fixed. A message revealed by a pointer press moving focus away waits until
|
|
4880
|
-
* that press has landed its click, in every mode. The control arrives as a signal
|
|
4881
|
-
* so callers decide how it is resolved: from the host's own `NgControl` (CVA
|
|
4882
|
-
* components) or from projected content (`<ea-form-field>`).
|
|
4883
|
-
*/
|
|
4884
|
-
declare function controlErrorStateFrom(control: Signal<AbstractControl | null>, config: ControlErrorStateConfig): ControlErrorState;
|
|
4885
|
-
/**
|
|
4886
|
-
* `controlErrorStateFrom` for a component hosting its own form directive.
|
|
4887
|
-
*
|
|
4888
|
-
* The bound `NgControl` is resolved lazily from the injector rather than via
|
|
4889
|
-
* constructor injection: a control that provides `NG_VALUE_ACCESSOR` cannot
|
|
4890
|
-
* also inject its own `NgControl` directly without a circular dependency.
|
|
4891
|
-
* `afterNextRender` defers resolution to the browser, after the host directive
|
|
4892
|
-
* (`formControl` / `ngModel`) exists, so the server render simply shows no
|
|
4893
|
-
* error (an untouched control never does).
|
|
4894
|
-
*
|
|
4895
|
-
* The lookup is `self`-scoped to the host element. Without it the search walks
|
|
4896
|
-
* up the element injectors, so a field rendered inside another bound field
|
|
4897
|
-
* (the checkboxes in a multi-select's option list, say) would adopt the outer
|
|
4898
|
-
* control and repeat its error message on every row.
|
|
4899
|
-
*/
|
|
4900
|
-
declare function injectControlErrorState(config: ControlErrorStateConfig): ControlErrorState;
|
|
4901
4760
|
/** Visual size of the file uploader. */
|
|
4902
4761
|
export type FileUploaderSize = EaSize;
|
|
4903
4762
|
/** Presentation of the uploader: a drag-and-drop zone, or a compact picker button. */
|
|
@@ -5148,15 +5007,6 @@ interface TypedPlaceholder {
|
|
|
5148
5007
|
/** Whether characters are still arriving; the cursor blinks only once they stop. */
|
|
5149
5008
|
readonly typing: Signal<boolean>;
|
|
5150
5009
|
}
|
|
5151
|
-
/**
|
|
5152
|
-
* Types `hints` into a field's placeholder one character at a time, holds each
|
|
5153
|
-
* whole hint, then clears it and types the next, looping. Under
|
|
5154
|
-
* `prefers-reduced-motion: reduce` it swaps whole hints instead and never
|
|
5155
|
-
* animates. It starts in the browser after the first render, restarts when the
|
|
5156
|
-
* hints change, and clears its timer on destroy. The timers run outside the
|
|
5157
|
-
* zone so the endless loop never holds the app unstable.
|
|
5158
|
-
*/
|
|
5159
|
-
declare function injectTypedPlaceholder(hints: Signal<readonly string[]>): TypedPlaceholder;
|
|
5160
5010
|
/** Visual size of the input. */
|
|
5161
5011
|
export type InputSize = EaSize;
|
|
5162
5012
|
/** HTML `type` attribute applied to the underlying `<input>`. */
|