@eagami/ui 5.100.0 → 5.101.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.mjs +789 -16
- package/fesm2022/eagami-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/eagami-ui.d.ts +307 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eagami/ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.101.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",
|
package/types/eagami-ui.d.ts
CHANGED
|
@@ -125,6 +125,12 @@ export interface EagamiMessages {
|
|
|
125
125
|
trendSummary: (first: string, last: string, low: string, high: string) => string;
|
|
126
126
|
/** Reads out a reference line; `label` is empty when the line has none. */
|
|
127
127
|
referenceLine: (label: string, value: string) => string;
|
|
128
|
+
/** Default accessible name of a gauge. */
|
|
129
|
+
gauge: string;
|
|
130
|
+
/** Reads out a gauge's value; `band` is the label of the band it falls in, or empty. */
|
|
131
|
+
gaugeValue: (value: string, band: string) => string;
|
|
132
|
+
/** Describes one band of a gauge; `label` is empty when the band has none. */
|
|
133
|
+
gaugeBand: (label: string, from: string, to: string) => string;
|
|
128
134
|
};
|
|
129
135
|
codeInput: {
|
|
130
136
|
groupLabel: (length: number) => string;
|
|
@@ -279,6 +285,13 @@ export interface EagamiMessages {
|
|
|
279
285
|
spinner: {
|
|
280
286
|
label: string;
|
|
281
287
|
};
|
|
288
|
+
stat: {
|
|
289
|
+
/** Reads out a stat tile's rise, given its size. */
|
|
290
|
+
up: (change: string) => string;
|
|
291
|
+
/** Reads out a stat tile's fall, given its size. */
|
|
292
|
+
down: (change: string) => string;
|
|
293
|
+
unchanged: string;
|
|
294
|
+
};
|
|
282
295
|
stepper: {
|
|
283
296
|
stepsLabel: string;
|
|
284
297
|
optional: string;
|
|
@@ -5375,6 +5388,182 @@ export declare class FileUploaderComponent extends LabelledFieldControlBase impl
|
|
|
5375
5388
|
"dragOverChanged": "dragOverChanged";
|
|
5376
5389
|
}, never, ["[icon]"], true, never>;
|
|
5377
5390
|
}
|
|
5391
|
+
/** One stretch of an `<ea-gauge>`'s scale, such as a low, medium, or high risk band. */
|
|
5392
|
+
export interface GaugeBand {
|
|
5393
|
+
/** Where the band starts, on the gauge's scale. */
|
|
5394
|
+
from: number;
|
|
5395
|
+
/** Where the band ends, on the gauge's scale. */
|
|
5396
|
+
to: number;
|
|
5397
|
+
/** Name of the band, read out with the value and shown as the default caption. */
|
|
5398
|
+
label?: string;
|
|
5399
|
+
/** Any CSS color; defaults to the next slot of the `--color-chart-*` palette. */
|
|
5400
|
+
color?: string;
|
|
5401
|
+
}
|
|
5402
|
+
/**
|
|
5403
|
+
* Entrance animation, replayed whenever the animation settings change. `sweep`
|
|
5404
|
+
* fills the arc from the minimum up to the value, and `fade` fades the gauge in.
|
|
5405
|
+
* Either one also eases the arc to each new value.
|
|
5406
|
+
*/
|
|
5407
|
+
export type GaugeAnimation = 'sweep' | 'fade' | 'none';
|
|
5408
|
+
interface PlotBand {
|
|
5409
|
+
index: number;
|
|
5410
|
+
path: string;
|
|
5411
|
+
color: string;
|
|
5412
|
+
}
|
|
5413
|
+
/**
|
|
5414
|
+
* Shows one value between a minimum and a maximum as a filled semicircular arc,
|
|
5415
|
+
* with the formatted value and a caption in the middle. Optional bands mark
|
|
5416
|
+
* stretches of the scale, such as low, medium, and high risk, in a ring around
|
|
5417
|
+
* the arc, and the arc takes the color of the band the value falls in. It is a
|
|
5418
|
+
* meter to assistive technology, read out with its value and band.
|
|
5419
|
+
*/
|
|
5420
|
+
export declare class GaugeComponent {
|
|
5421
|
+
protected readonly i18n: EagamiI18nService;
|
|
5422
|
+
/** The value to show; one outside the scale fills the arc to the nearer end. */
|
|
5423
|
+
readonly value: import("@angular/core").InputSignal<number>;
|
|
5424
|
+
/** Start of the scale, at the left end of the arc. */
|
|
5425
|
+
readonly min: import("@angular/core").InputSignal<number>;
|
|
5426
|
+
/** End of the scale, at the right end of the arc. */
|
|
5427
|
+
readonly max: import("@angular/core").InputSignal<number>;
|
|
5428
|
+
/**
|
|
5429
|
+
* Stretches of the scale drawn in a ring around the arc. A value on the
|
|
5430
|
+
* boundary of two bands falls in the later one.
|
|
5431
|
+
*/
|
|
5432
|
+
readonly bands: import("@angular/core").InputSignal<readonly GaugeBand[]>;
|
|
5433
|
+
/** Text beneath the value; defaults to the label of the band the value falls in. */
|
|
5434
|
+
readonly caption: import("@angular/core").InputSignal<string | undefined>;
|
|
5435
|
+
/**
|
|
5436
|
+
* Any CSS color for the arc; defaults to the color of the band the value
|
|
5437
|
+
* falls in, or the first chart palette color.
|
|
5438
|
+
*/
|
|
5439
|
+
readonly color: import("@angular/core").InputSignal<string | undefined>;
|
|
5440
|
+
/** Prints the minimum and maximum beneath the ends of the arc. */
|
|
5441
|
+
readonly showLimits: import("@angular/core").InputSignal<boolean>;
|
|
5442
|
+
/** Largest width of the gauge in pixels; it shrinks to fit a narrower container. */
|
|
5443
|
+
readonly width: import("@angular/core").InputSignal<number>;
|
|
5444
|
+
/** Visual size; scales the caption and limit text. */
|
|
5445
|
+
readonly size: import("@angular/core").InputSignal<import("@eagami/ui").EaSize>;
|
|
5446
|
+
/** Entrance animation, replayed whenever the animation settings change. */
|
|
5447
|
+
readonly animation: import("@angular/core").InputSignal<GaugeAnimation>;
|
|
5448
|
+
/** Length of the entrance animation, and of the move to a new value, in milliseconds. */
|
|
5449
|
+
readonly animationDuration: import("@angular/core").InputSignal<number>;
|
|
5450
|
+
/** Formats the value and limits, and the values read out; locale-grouped by default. */
|
|
5451
|
+
readonly formatValue: import("@angular/core").InputSignal<((value: number) => string) | null>;
|
|
5452
|
+
/** Accessible name for the gauge; defaults to the caption, then a localized "Gauge". */
|
|
5453
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string | undefined>;
|
|
5454
|
+
private readonly viewport;
|
|
5455
|
+
private readonly format;
|
|
5456
|
+
protected readonly bandsId: string;
|
|
5457
|
+
protected readonly label: import("@angular/core").Signal<string>;
|
|
5458
|
+
protected readonly renderPass: import("@angular/core").Signal<{}[]>;
|
|
5459
|
+
protected readonly hostClasses: import("@angular/core").Signal<{
|
|
5460
|
+
[x: string]: boolean;
|
|
5461
|
+
}>;
|
|
5462
|
+
protected readonly current: import("@angular/core").Signal<number>;
|
|
5463
|
+
protected readonly fraction: import("@angular/core").Signal<number>;
|
|
5464
|
+
private readonly scaledBands;
|
|
5465
|
+
protected readonly activeBand: import("@angular/core").Signal<{
|
|
5466
|
+
band: GaugeBand;
|
|
5467
|
+
index: number;
|
|
5468
|
+
from: number;
|
|
5469
|
+
to: number;
|
|
5470
|
+
} | null>;
|
|
5471
|
+
protected readonly fill: import("@angular/core").Signal<string>;
|
|
5472
|
+
protected readonly captionText: import("@angular/core").Signal<string>;
|
|
5473
|
+
protected readonly layout: import("@angular/core").Signal<{
|
|
5474
|
+
width: number;
|
|
5475
|
+
height: number;
|
|
5476
|
+
thickness: number;
|
|
5477
|
+
bandThickness: number;
|
|
5478
|
+
track: string;
|
|
5479
|
+
bands: PlotBand[];
|
|
5480
|
+
limits: {
|
|
5481
|
+
y: number;
|
|
5482
|
+
minX: number;
|
|
5483
|
+
maxX: number;
|
|
5484
|
+
};
|
|
5485
|
+
center: {
|
|
5486
|
+
left: number;
|
|
5487
|
+
width: number;
|
|
5488
|
+
height: number;
|
|
5489
|
+
room: number;
|
|
5490
|
+
value: string;
|
|
5491
|
+
valuePx: number;
|
|
5492
|
+
};
|
|
5493
|
+
}>;
|
|
5494
|
+
protected readonly minText: import("@angular/core").Signal<string>;
|
|
5495
|
+
protected readonly maxText: import("@angular/core").Signal<string>;
|
|
5496
|
+
protected readonly valueText: import("@angular/core").Signal<string>;
|
|
5497
|
+
protected readonly bandsSummary: import("@angular/core").Signal<string>;
|
|
5498
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GaugeComponent, never>;
|
|
5499
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GaugeComponent, "ea-gauge", never, {
|
|
5500
|
+
"value": {
|
|
5501
|
+
"alias": "value";
|
|
5502
|
+
"required": false;
|
|
5503
|
+
"isSignal": true;
|
|
5504
|
+
};
|
|
5505
|
+
"min": {
|
|
5506
|
+
"alias": "min";
|
|
5507
|
+
"required": false;
|
|
5508
|
+
"isSignal": true;
|
|
5509
|
+
};
|
|
5510
|
+
"max": {
|
|
5511
|
+
"alias": "max";
|
|
5512
|
+
"required": false;
|
|
5513
|
+
"isSignal": true;
|
|
5514
|
+
};
|
|
5515
|
+
"bands": {
|
|
5516
|
+
"alias": "bands";
|
|
5517
|
+
"required": false;
|
|
5518
|
+
"isSignal": true;
|
|
5519
|
+
};
|
|
5520
|
+
"caption": {
|
|
5521
|
+
"alias": "caption";
|
|
5522
|
+
"required": false;
|
|
5523
|
+
"isSignal": true;
|
|
5524
|
+
};
|
|
5525
|
+
"color": {
|
|
5526
|
+
"alias": "color";
|
|
5527
|
+
"required": false;
|
|
5528
|
+
"isSignal": true;
|
|
5529
|
+
};
|
|
5530
|
+
"showLimits": {
|
|
5531
|
+
"alias": "showLimits";
|
|
5532
|
+
"required": false;
|
|
5533
|
+
"isSignal": true;
|
|
5534
|
+
};
|
|
5535
|
+
"width": {
|
|
5536
|
+
"alias": "width";
|
|
5537
|
+
"required": false;
|
|
5538
|
+
"isSignal": true;
|
|
5539
|
+
};
|
|
5540
|
+
"size": {
|
|
5541
|
+
"alias": "size";
|
|
5542
|
+
"required": false;
|
|
5543
|
+
"isSignal": true;
|
|
5544
|
+
};
|
|
5545
|
+
"animation": {
|
|
5546
|
+
"alias": "animation";
|
|
5547
|
+
"required": false;
|
|
5548
|
+
"isSignal": true;
|
|
5549
|
+
};
|
|
5550
|
+
"animationDuration": {
|
|
5551
|
+
"alias": "animationDuration";
|
|
5552
|
+
"required": false;
|
|
5553
|
+
"isSignal": true;
|
|
5554
|
+
};
|
|
5555
|
+
"formatValue": {
|
|
5556
|
+
"alias": "formatValue";
|
|
5557
|
+
"required": false;
|
|
5558
|
+
"isSignal": true;
|
|
5559
|
+
};
|
|
5560
|
+
"ariaLabel": {
|
|
5561
|
+
"alias": "aria-label";
|
|
5562
|
+
"required": false;
|
|
5563
|
+
"isSignal": true;
|
|
5564
|
+
};
|
|
5565
|
+
}, {}, never, never, true, never>;
|
|
5566
|
+
}
|
|
5378
5567
|
/** Live state of a field's typewriter placeholder. */
|
|
5379
5568
|
interface TypedPlaceholder {
|
|
5380
5569
|
/** Whether the typed layer stands in for the native placeholder. */
|
|
@@ -7896,6 +8085,124 @@ export declare class SpinnerComponent {
|
|
|
7896
8085
|
};
|
|
7897
8086
|
}, {}, never, never, true, never>;
|
|
7898
8087
|
}
|
|
8088
|
+
/** Visual size of a stat tile; scales its text, spacing, and sparkline. */
|
|
8089
|
+
export type StatSize = EaSize;
|
|
8090
|
+
/** Surface of a stat tile: a bordered tile, a subtle fill, or none, to sit inside a card. */
|
|
8091
|
+
export type StatVariant = 'outlined' | 'filled' | 'plain';
|
|
8092
|
+
/**
|
|
8093
|
+
* How a stat tile prints its change: as a share of the previous value, or as
|
|
8094
|
+
* the difference between the two values.
|
|
8095
|
+
*/
|
|
8096
|
+
export type StatChangeFormat = 'percent' | 'absolute';
|
|
8097
|
+
type ChangeDirection = 'up' | 'down' | 'flat';
|
|
8098
|
+
type ChangeTone = 'positive' | 'negative' | 'neutral';
|
|
8099
|
+
/**
|
|
8100
|
+
* A dashboard figure: a label over a formatted value, the change against a
|
|
8101
|
+
* previous period with an up or down arrow in the positive or negative tone,
|
|
8102
|
+
* an optional caption, and an optional sparkline of recent values. The arrow
|
|
8103
|
+
* and sign carry the direction, so it never rests on colour alone.
|
|
8104
|
+
*/
|
|
8105
|
+
export declare class StatComponent {
|
|
8106
|
+
protected readonly i18n: EagamiI18nService;
|
|
8107
|
+
/** Name of the figure, shown above it. */
|
|
8108
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
8109
|
+
/** The figure for the current period. */
|
|
8110
|
+
readonly value: import("@angular/core").InputSignal<number>;
|
|
8111
|
+
/** The figure for the previous period; the change against it shows beneath the value. */
|
|
8112
|
+
readonly previousValue: import("@angular/core").InputSignal<number | null>;
|
|
8113
|
+
/**
|
|
8114
|
+
* Prints the change as a share of the previous value, or as the difference.
|
|
8115
|
+
* A share of zero has no size, so a change from zero prints the difference.
|
|
8116
|
+
*/
|
|
8117
|
+
readonly changeFormat: import("@angular/core").InputSignal<StatChangeFormat>;
|
|
8118
|
+
/** Treats a rise as bad and a fall as good, as for costs, swapping the positive and negative tones. */
|
|
8119
|
+
readonly invertTone: import("@angular/core").InputSignal<boolean>;
|
|
8120
|
+
/** Text after the change, such as "vs last month". */
|
|
8121
|
+
readonly caption: import("@angular/core").InputSignal<string | undefined>;
|
|
8122
|
+
/** Values for a sparkline under the figure, oldest first; `null` leaves a gap. */
|
|
8123
|
+
readonly sparkline: import("@angular/core").InputSignal<(number | null)[]>;
|
|
8124
|
+
/** Draws the sparkline as a line, a line over a filled area, or bars. */
|
|
8125
|
+
readonly sparklineVariant: import("@angular/core").InputSignal<SparklineVariant>;
|
|
8126
|
+
/** A bordered tile, a subtle fill, or no surface at all, to sit inside a card. */
|
|
8127
|
+
readonly variant: import("@angular/core").InputSignal<StatVariant>;
|
|
8128
|
+
/** Visual size; scales the text, spacing, and sparkline. */
|
|
8129
|
+
readonly size: import("@angular/core").InputSignal<EaSize>;
|
|
8130
|
+
/** Formats the value, an absolute change, and the sparkline's values; locale-grouped by default. */
|
|
8131
|
+
readonly formatValue: import("@angular/core").InputSignal<((value: number) => string) | null>;
|
|
8132
|
+
private readonly format;
|
|
8133
|
+
protected readonly hostClasses: import("@angular/core").Signal<{
|
|
8134
|
+
[x: string]: boolean;
|
|
8135
|
+
}>;
|
|
8136
|
+
protected readonly formattedValue: import("@angular/core").Signal<string>;
|
|
8137
|
+
protected readonly sparklineHeight: import("@angular/core").Signal<number>;
|
|
8138
|
+
protected readonly hasSparkline: import("@angular/core").Signal<boolean>;
|
|
8139
|
+
protected readonly change: import("@angular/core").Signal<{
|
|
8140
|
+
direction: ChangeDirection;
|
|
8141
|
+
tone: ChangeTone;
|
|
8142
|
+
text: string;
|
|
8143
|
+
spoken: string;
|
|
8144
|
+
} | null>;
|
|
8145
|
+
private percent;
|
|
8146
|
+
private signed;
|
|
8147
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StatComponent, never>;
|
|
8148
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StatComponent, "ea-stat", never, {
|
|
8149
|
+
"label": {
|
|
8150
|
+
"alias": "label";
|
|
8151
|
+
"required": false;
|
|
8152
|
+
"isSignal": true;
|
|
8153
|
+
};
|
|
8154
|
+
"value": {
|
|
8155
|
+
"alias": "value";
|
|
8156
|
+
"required": false;
|
|
8157
|
+
"isSignal": true;
|
|
8158
|
+
};
|
|
8159
|
+
"previousValue": {
|
|
8160
|
+
"alias": "previousValue";
|
|
8161
|
+
"required": false;
|
|
8162
|
+
"isSignal": true;
|
|
8163
|
+
};
|
|
8164
|
+
"changeFormat": {
|
|
8165
|
+
"alias": "changeFormat";
|
|
8166
|
+
"required": false;
|
|
8167
|
+
"isSignal": true;
|
|
8168
|
+
};
|
|
8169
|
+
"invertTone": {
|
|
8170
|
+
"alias": "invertTone";
|
|
8171
|
+
"required": false;
|
|
8172
|
+
"isSignal": true;
|
|
8173
|
+
};
|
|
8174
|
+
"caption": {
|
|
8175
|
+
"alias": "caption";
|
|
8176
|
+
"required": false;
|
|
8177
|
+
"isSignal": true;
|
|
8178
|
+
};
|
|
8179
|
+
"sparkline": {
|
|
8180
|
+
"alias": "sparkline";
|
|
8181
|
+
"required": false;
|
|
8182
|
+
"isSignal": true;
|
|
8183
|
+
};
|
|
8184
|
+
"sparklineVariant": {
|
|
8185
|
+
"alias": "sparklineVariant";
|
|
8186
|
+
"required": false;
|
|
8187
|
+
"isSignal": true;
|
|
8188
|
+
};
|
|
8189
|
+
"variant": {
|
|
8190
|
+
"alias": "variant";
|
|
8191
|
+
"required": false;
|
|
8192
|
+
"isSignal": true;
|
|
8193
|
+
};
|
|
8194
|
+
"size": {
|
|
8195
|
+
"alias": "size";
|
|
8196
|
+
"required": false;
|
|
8197
|
+
"isSignal": true;
|
|
8198
|
+
};
|
|
8199
|
+
"formatValue": {
|
|
8200
|
+
"alias": "formatValue";
|
|
8201
|
+
"required": false;
|
|
8202
|
+
"isSignal": true;
|
|
8203
|
+
};
|
|
8204
|
+
}, {}, never, never, true, never>;
|
|
8205
|
+
}
|
|
7899
8206
|
/**
|
|
7900
8207
|
* Single step within an `<ea-stepper>`. Registers itself with the parent on
|
|
7901
8208
|
* init, exposes its `label` / `completed` / `optional` flags, and shows its
|