@eagami/ui 5.51.0 → 5.53.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagami/ui",
3
- "version": "5.51.0",
3
+ "version": "5.53.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",
@@ -621,10 +621,13 @@ export declare class AccordionItemComponent implements OnInit, OnDestroy {
621
621
  private readonly accordion;
622
622
  readonly value: import("@angular/core").InputSignal<string>;
623
623
  readonly label: import("@angular/core").InputSignal<string>;
624
+ /** Optional icon component rendered before the label in the header button. */
625
+ readonly icon: import("@angular/core").InputSignal<Type<unknown> | undefined>;
624
626
  readonly disabled: import("@angular/core").InputSignal<boolean>;
625
627
  readonly id: import("@angular/core").InputSignal<string>;
626
628
  readonly isExpanded: import("@angular/core").Signal<boolean>;
627
629
  readonly headingLevel: import("@angular/core").Signal<import("@eagami/ui").AccordionHeadingLevel>;
630
+ readonly isHighlighted: import("@angular/core").Signal<boolean>;
628
631
  readonly size: import("@angular/core").Signal<import("@eagami/ui").EaSize>;
629
632
  ngOnInit(): void;
630
633
  ngOnDestroy(): void;
@@ -641,6 +644,11 @@ export declare class AccordionItemComponent implements OnInit, OnDestroy {
641
644
  "required": true;
642
645
  "isSignal": true;
643
646
  };
647
+ "icon": {
648
+ "alias": "icon";
649
+ "required": false;
650
+ "isSignal": true;
651
+ };
644
652
  "disabled": {
645
653
  "alias": "disabled";
646
654
  "required": false;
@@ -668,6 +676,8 @@ export declare class AccordionComponent {
668
676
  readonly size: import("@angular/core").InputSignal<EaSize>;
669
677
  /** Heading level (1-6) applied to every item's header wrapper. */
670
678
  readonly headingLevel: import("@angular/core").InputSignal<AccordionHeadingLevel>;
679
+ /** Tints an open item's header and sets its label, icon, and chevron in the brand color. */
680
+ readonly highlightExpanded: import("@angular/core").InputSignal<boolean>;
671
681
  readonly expandedItems: import("@angular/core").WritableSignal<Set<string>>;
672
682
  readonly registeredItems: import("@angular/core").WritableSignal<AccordionItemComponent[]>;
673
683
  constructor();
@@ -692,6 +702,11 @@ export declare class AccordionComponent {
692
702
  "required": false;
693
703
  "isSignal": true;
694
704
  };
705
+ "highlightExpanded": {
706
+ "alias": "highlightExpanded";
707
+ "required": false;
708
+ "isSignal": true;
709
+ };
695
710
  }, {}, never, ["*"], true, never>;
696
711
  }
697
712
  /** Semantic colour scheme of an alert. Drives icon and palette. */
@@ -1338,6 +1353,37 @@ declare function injectChartViewport(size: Signal<ChartSize>): ChartViewport;
1338
1353
  declare function injectChartFormatter(formatValue: Signal<((value: number) => string) | null>): Signal<(value: number) => string>;
1339
1354
  /** Keeps a value inside `[min, max]`. */
1340
1355
  declare function clamp(value: number, min: number, max: number): number;
1356
+ /**
1357
+ * How category or x-axis labels are set: level, at 45 degrees, at 90 degrees, or
1358
+ * `auto`, which stays level while the labels fit and turns them 45 then 90 degrees
1359
+ * as they crowd.
1360
+ */
1361
+ type ChartLabelOrientation = 'horizontal' | 'diagonal' | 'vertical' | 'auto';
1362
+ declare const CHART_LABEL_ANGLES: Record<Exclude<ChartLabelOrientation, 'auto'>, number>;
1363
+ declare const TICK_EXTRA_PX = 2;
1364
+ declare const TICK_LABEL_GAP_PX = 2;
1365
+ declare const BREAK_CLEARANCE = 6;
1366
+ declare const BREAK_HEIGHT = 2.5;
1367
+ /** Length of a tick mark below the axis. */
1368
+ declare function tickLength(axisPx: number): number;
1369
+ /** Room along the axis a label needs: its width when level, a line's height when turned. */
1370
+ declare function labelRoom(text: string, angle: number, axisPx: number): number;
1371
+ /** Space below the plot for the axis labels, turned to `angle` degrees, and their ticks. */
1372
+ declare function labelBand(widest: number, angle: number, axisPx: number, height: number): number;
1373
+ /** Baseline of the axis labels below an axis at `axisY`. */
1374
+ declare function labelLine(axisY: number, angle: number, axisPx: number): number;
1375
+ interface AxisBreak {
1376
+ axis: string;
1377
+ slashes: string;
1378
+ gap: {
1379
+ x: number;
1380
+ y: number;
1381
+ width: number;
1382
+ height: number;
1383
+ };
1384
+ }
1385
+ /** A y-axis line up the plot's left edge, cut where two parallel slashes cross it. */
1386
+ declare function axisBreak(x: number, top: number, bottom: number, y: number, axisPx: number): AxisBreak;
1341
1387
  /** Direction the bars extend from the baseline. */
1342
1388
  export type BarChartOrientation = 'vertical' | 'horizontal';
1343
1389
  /**
@@ -1387,6 +1433,13 @@ export declare class BarChartComponent {
1387
1433
  readonly showLegend: import("@angular/core").InputSignal<boolean>;
1388
1434
  /** Prints each bar's value at its end, or each stack's total when stacked. */
1389
1435
  readonly showValues: import("@angular/core").InputSignal<boolean>;
1436
+ /** How the category labels under a vertical chart are set; `auto` turns them as they run out of room. */
1437
+ readonly xLabelOrientation: import("@angular/core").InputSignal<ChartLabelOrientation>;
1438
+ /**
1439
+ * Starts the value axis of a vertical chart near its shortest bar instead of at
1440
+ * zero, when every value is positive, and marks the cut with a break symbol.
1441
+ */
1442
+ readonly showAxisBreak: import("@angular/core").InputSignal<boolean>;
1390
1443
  /** Height of the plot in pixels; the width fills the container. */
1391
1444
  readonly height: import("@angular/core").InputSignal<number>;
1392
1445
  /** Visual size; scales the axis, legend, and tooltip text and the bar thickness cap. */
@@ -1440,6 +1493,11 @@ export declare class BarChartComponent {
1440
1493
  bars: PlotBar[];
1441
1494
  valueLabels: PlotValueLabel[];
1442
1495
  valuePos: (v: number) => number;
1496
+ axisY: number;
1497
+ tickEndY: number;
1498
+ labelAngle: number;
1499
+ labelY: number;
1500
+ axisBreak: AxisBreak | null;
1443
1501
  }>;
1444
1502
  protected readonly tooltip: import("@angular/core").Signal<{
1445
1503
  x: number;
@@ -1518,6 +1576,16 @@ export declare class BarChartComponent {
1518
1576
  "required": false;
1519
1577
  "isSignal": true;
1520
1578
  };
1579
+ "xLabelOrientation": {
1580
+ "alias": "xLabelOrientation";
1581
+ "required": false;
1582
+ "isSignal": true;
1583
+ };
1584
+ "showAxisBreak": {
1585
+ "alias": "showAxisBreak";
1586
+ "required": false;
1587
+ "isSignal": true;
1588
+ };
1521
1589
  "height": {
1522
1590
  "alias": "height";
1523
1591
  "required": false;
@@ -4281,6 +4349,16 @@ export type LineChartCurve = 'linear' | 'smooth' | 'step';
4281
4349
  * right, `fade` fades the plot in, and `rise` grows it up from the baseline.
4282
4350
  */
4283
4351
  export type LineChartAnimation = 'draw' | 'reveal' | 'fade' | 'rise' | 'none';
4352
+ /** A labelled mark along the x-axis, placed on the same scale as `xValues`. */
4353
+ export interface LineChartTick {
4354
+ value: number;
4355
+ label: string;
4356
+ }
4357
+ /** The stretch of the x scale a windowed line chart currently shows. */
4358
+ export interface LineChartVisibleRange {
4359
+ start: number;
4360
+ end: number;
4361
+ }
4284
4362
  interface PlotPoint {
4285
4363
  x: number;
4286
4364
  y: number;
@@ -4298,18 +4376,61 @@ interface ActivePoint {
4298
4376
  series: number;
4299
4377
  index: number;
4300
4378
  }
4379
+ interface XLabel {
4380
+ key: number;
4381
+ text: string;
4382
+ x: number;
4383
+ }
4384
+ interface PlacedXLabel extends XLabel {
4385
+ textX: number;
4386
+ }
4387
+ interface XDomain {
4388
+ /** First and last positions on the x scale. */
4389
+ first: number;
4390
+ last: number;
4391
+ /** Positions at the plot's left and right edges. */
4392
+ start: number;
4393
+ end: number;
4394
+ /** Width of the visible window, set only when the data outgrows it. */
4395
+ span: number | null;
4396
+ }
4301
4397
  /**
4302
- * Plots one or more series of values across shared labels as lines, with
4303
- * optional points and area fills. Hovering or arrowing through the chart
4304
- * reveals each label's values in a tooltip, and a visually hidden table
4305
- * carries the full data for screen readers.
4398
+ * Plots one or more series of values as lines, with optional points and area
4399
+ * fills. Points are spaced evenly by default, or placed along a numeric scale
4400
+ * by `xValues`, with the x-axis labelled per point or by `xTicks`. A
4401
+ * `visibleXSpan` window makes a long run of data pannable. Hovering or
4402
+ * arrowing through the chart reveals each point's values in a tooltip, and a
4403
+ * visually hidden table carries the full data for screen readers.
4306
4404
  */
4307
4405
  export declare class LineChartComponent {
4308
4406
  protected readonly i18n: EagamiI18nService;
4309
- /** Category labels along the x-axis, one per value. */
4407
+ /**
4408
+ * Each point's name, one per value, titling its tooltip and its row in the
4409
+ * data table. Also labels the x-axis, unless `xTicks` is set.
4410
+ */
4310
4411
  readonly labels: import("@angular/core").InputSignal<string[]>;
4311
4412
  /** The series to plot. */
4312
4413
  readonly series: import("@angular/core").InputSignal<ChartSeries[]>;
4414
+ /**
4415
+ * Position of each point along the x-axis, one per value in ascending
4416
+ * order, so points sit proportionally apart. Spaced evenly by index when
4417
+ * unset.
4418
+ */
4419
+ readonly xValues: import("@angular/core").InputSignal<readonly number[] | null>;
4420
+ /**
4421
+ * Marks drawn along the x-axis in place of the per-point labels, each at its
4422
+ * value on the x scale (`xValues`, or the index when unset). They need not
4423
+ * line up with any point, and the axis widens to take in any beyond the points.
4424
+ */
4425
+ readonly xTicks: import("@angular/core").InputSignal<readonly LineChartTick[] | null>;
4426
+ /**
4427
+ * Width of the x range shown at once, in the units of `xValues` (or of
4428
+ * indices when unset). When the data spans more, the chart opens on its
4429
+ * latest stretch and pans by trackpad, Shift + wheel, drag, or the arrow
4430
+ * keys, and a trackpad pinch or Ctrl + wheel widens or narrows the window,
4431
+ * fitting the y-axis to the points in view. `null` shows everything.
4432
+ */
4433
+ readonly visibleXSpan: import("@angular/core").InputSignal<number | null>;
4313
4434
  /** How the line bends between points. */
4314
4435
  readonly curve: import("@angular/core").InputSignal<LineChartCurve>;
4315
4436
  /** Fills the area beneath each line with a light wash of its color. */
@@ -4324,6 +4445,10 @@ export declare class LineChartComponent {
4324
4445
  readonly yMin: import("@angular/core").InputSignal<number | undefined>;
4325
4446
  /** Upper bound of the y-axis; derived from the data when unset. */
4326
4447
  readonly yMax: import("@angular/core").InputSignal<number | undefined>;
4448
+ /** How the x-axis labels are set; `auto` turns them as they run out of room. */
4449
+ readonly xLabelOrientation: import("@angular/core").InputSignal<ChartLabelOrientation>;
4450
+ /** Marks the foot of a y-axis that stops short of zero with a break symbol. */
4451
+ readonly showAxisBreak: import("@angular/core").InputSignal<boolean>;
4327
4452
  /** Height of the plot in pixels; the width fills the container. */
4328
4453
  readonly height: import("@angular/core").InputSignal<number>;
4329
4454
  /** Visual size; scales the axis, legend, and tooltip text. */
@@ -4340,16 +4465,33 @@ export declare class LineChartComponent {
4340
4465
  readonly pointClick: import("@angular/core").OutputEmitterRef<ChartPointEvent>;
4341
4466
  /** Fires when the highlighted point changes by pointer or keyboard, with `null` once cleared. */
4342
4467
  readonly activePointChange: import("@angular/core").OutputEmitterRef<ChartPointEvent | null>;
4468
+ /** Fires with the newly visible x range whenever a windowed chart pans or zooms. */
4469
+ readonly visibleRangeChange: import("@angular/core").OutputEmitterRef<LineChartVisibleRange>;
4343
4470
  private readonly viewport;
4344
4471
  private readonly format;
4345
4472
  protected readonly active: import("@angular/core").WritableSignal<ActivePoint | null>;
4473
+ protected readonly clipId: string;
4474
+ protected readonly breakMaskId: string;
4475
+ private readonly panEnd;
4476
+ private readonly zoomSpan;
4477
+ private gestureSpan;
4478
+ protected readonly panning: import("@angular/core").WritableSignal<boolean>;
4479
+ private drag;
4480
+ private suppressClick;
4346
4481
  protected readonly label: import("@angular/core").Signal<string>;
4347
4482
  protected readonly count: import("@angular/core").Signal<number>;
4348
4483
  protected readonly hasData: import("@angular/core").Signal<boolean>;
4484
+ private readonly positions;
4485
+ protected readonly domain: import("@angular/core").Signal<XDomain>;
4486
+ protected readonly windowed: import("@angular/core").Signal<boolean>;
4349
4487
  protected readonly renderPass: import("@angular/core").Signal<{}[]>;
4350
4488
  protected readonly hostClasses: import("@angular/core").Signal<{
4351
4489
  [x: string]: boolean;
4490
+ 'ea-line-chart--pannable': boolean;
4491
+ 'ea-line-chart--panning': boolean;
4352
4492
  }>;
4493
+ private readonly runs;
4494
+ private readonly visibleValues;
4353
4495
  protected readonly layout: import("@angular/core").Signal<{
4354
4496
  width: number;
4355
4497
  height: number;
@@ -4358,6 +4500,11 @@ export declare class LineChartComponent {
4358
4500
  plotWidth: number;
4359
4501
  plotHeight: number;
4360
4502
  baselineY: number;
4503
+ windowed: boolean;
4504
+ axisBreak: AxisBreak | null;
4505
+ axisY: number;
4506
+ tickEndY: number;
4507
+ labelAngle: number;
4361
4508
  labelY: number;
4362
4509
  tickX: number;
4363
4510
  ticks: {
@@ -4365,15 +4512,12 @@ export declare class LineChartComponent {
4365
4512
  value: number;
4366
4513
  text: string;
4367
4514
  }[];
4368
- xLabels: {
4369
- text: string;
4370
- index: number;
4371
- x: number;
4372
- }[];
4515
+ xLabels: PlacedXLabel[];
4373
4516
  series: PlotSeries[];
4374
4517
  x: (i: number) => number;
4375
4518
  y: (v: number) => number;
4376
4519
  }>;
4520
+ private plotArea;
4377
4521
  protected readonly tooltip: import("@angular/core").Signal<{
4378
4522
  x: number;
4379
4523
  y: number;
@@ -4404,12 +4548,32 @@ export declare class LineChartComponent {
4404
4548
  protected isDimmed(index: number): boolean;
4405
4549
  protected isActivePoint(seriesIndex: number, index: number): boolean;
4406
4550
  protected tableValue(value: number | null | undefined): string;
4551
+ protected onPointerDown(event: PointerEvent): void;
4407
4552
  protected onPointerMove(event: PointerEvent): void;
4553
+ protected onPointerUp(event: PointerEvent): void;
4408
4554
  protected onPointerLeave(): void;
4555
+ protected onWheel(event: WheelEvent): void;
4409
4556
  protected onClick(): void;
4410
4557
  protected onFocus(): void;
4411
4558
  protected onBlur(): void;
4412
4559
  protected onKeydown(event: KeyboardEvent): void;
4560
+ private isValue;
4561
+ private yScale;
4562
+ private atPosition;
4563
+ private xLabelCandidates;
4564
+ private labelsFit;
4565
+ private xLabels;
4566
+ private widestXLabel;
4567
+ protected onGestureStart(event: Event): void;
4568
+ protected onGestureChange(event: Event): void;
4569
+ protected onGestureEnd(): void;
4570
+ private zoomTo;
4571
+ private minSpan;
4572
+ private unitsPerPx;
4573
+ private panTo;
4574
+ private endDrag;
4575
+ private reveal;
4576
+ private indexAt;
4413
4577
  private valueAt;
4414
4578
  private firstPoint;
4415
4579
  private nearestValid;
@@ -4427,6 +4591,21 @@ export declare class LineChartComponent {
4427
4591
  "required": false;
4428
4592
  "isSignal": true;
4429
4593
  };
4594
+ "xValues": {
4595
+ "alias": "xValues";
4596
+ "required": false;
4597
+ "isSignal": true;
4598
+ };
4599
+ "xTicks": {
4600
+ "alias": "xTicks";
4601
+ "required": false;
4602
+ "isSignal": true;
4603
+ };
4604
+ "visibleXSpan": {
4605
+ "alias": "visibleXSpan";
4606
+ "required": false;
4607
+ "isSignal": true;
4608
+ };
4430
4609
  "curve": {
4431
4610
  "alias": "curve";
4432
4611
  "required": false;
@@ -4462,6 +4641,16 @@ export declare class LineChartComponent {
4462
4641
  "required": false;
4463
4642
  "isSignal": true;
4464
4643
  };
4644
+ "xLabelOrientation": {
4645
+ "alias": "xLabelOrientation";
4646
+ "required": false;
4647
+ "isSignal": true;
4648
+ };
4649
+ "showAxisBreak": {
4650
+ "alias": "showAxisBreak";
4651
+ "required": false;
4652
+ "isSignal": true;
4653
+ };
4465
4654
  "height": {
4466
4655
  "alias": "height";
4467
4656
  "required": false;
@@ -4495,6 +4684,7 @@ export declare class LineChartComponent {
4495
4684
  }, {
4496
4685
  "pointClick": "pointClick";
4497
4686
  "activePointChange": "activePointChange";
4687
+ "visibleRangeChange": "visibleRangeChange";
4498
4688
  }, never, never, true, never>;
4499
4689
  }
4500
4690
  /** Placement of the menu list relative to its trigger. */
@@ -12058,4 +12248,4 @@ export declare class ZoomOutIconComponent extends IconComponentBase {
12058
12248
  static ɵfac: i0.ɵɵFactoryDeclaration<ZoomOutIconComponent, never>;
12059
12249
  static ɵcmp: i0.ɵɵComponentDeclaration<ZoomOutIconComponent, "ea-icon-zoom-out", never, {}, {}, never, never, true, never>;
12060
12250
  }
12061
- export type { ChartPointEvent, ChartSeries, ChartSize, EaErrorMessages, EaValidationErrorKey };
12251
+ export type { ChartLabelOrientation, ChartPointEvent, ChartSeries, ChartSize, EaErrorMessages, EaValidationErrorKey };