@area8975/ui 0.1.1-dev.11 → 0.1.1-dev.7

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": "@area8975/ui",
3
- "version": "0.1.1-dev.11",
3
+ "version": "0.1.1-dev.7",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.0.0",
6
6
  "@angular/core": "^22.0.0",
@@ -1,26 +1,8 @@
1
- import * as i0 from "@angular/core";
2
- import { ElementRef, OnDestroy, OnInit, Signal, TemplateRef, WritableSignal } from "@angular/core";
3
1
  import ApexCharts$1 from "apexcharts";
2
+ import * as i0 from "@angular/core";
3
+ import { ElementRef, OnDestroy, OnInit, TemplateRef, WritableSignal } from "@angular/core";
4
4
  import { Placement } from "@floating-ui/dom";
5
5
  import { Observable } from "rxjs";
6
- /** One entry in a legend, the colour ties it to its marks. */
7
- export interface ChartLegendItem {
8
- name: string;
9
- colour: string;
10
- /** Shows the key as a dashed line, for series told apart by line style. */
11
- dashed?: boolean;
12
- }
13
- /** Anything a legend can be linked to with `for`, every chart is one. */
14
- export interface ChartLegendSource {
15
- readonly legendItems: Signal<ChartLegendItem[]>;
16
- readonly legendNote: Signal<string>;
17
- /** Series switched off from the legend. */
18
- readonly hiddenSeries: WritableSignal<string[]>;
19
- /** The series the legend is pointing at, the others fade while it's set. */
20
- readonly emphasis: WritableSignal<string | null>;
21
- }
22
- /** Where a chart draws its own legend, `none` when one is linked elsewhere. */
23
- export type ChartLegendPosition = 'auto' | 'none';
24
6
  /**
25
7
  * Categorical colours for chart series, in a fixed order that was checked for
26
8
  * colour blindness (adjacent pairs stay apart for protan, deutan and tritan).
@@ -61,7 +43,7 @@ export interface ChartSeries {
61
43
  /** Turns a raw value into what the axis, tooltip and table show, e.g. money. */
62
44
  export type ChartValueFormatter = (value: number) => string;
63
45
  /** Inputs every chart with categories along one axis and values up the other shares. */
64
- declare abstract class UiAxisChartBase implements ChartLegendSource {
46
+ declare abstract class UiAxisChartBase {
65
47
  readonly series: import("@angular/core").InputSignal<ChartSeries[]>;
66
48
  readonly categories: import("@angular/core").InputSignal<string[]>;
67
49
  /** Says what the chart shows, e.g. "Spending by month". */
@@ -82,12 +64,8 @@ declare abstract class UiAxisChartBase implements ChartLegendSource {
82
64
  * matter stand out. The way to show more series than there are colours.
83
65
  */
84
66
  readonly highlight: import("@angular/core").InputSignal<string[] | null>;
85
- /** `none` leaves the legend out, for when a `ui-chart-legend` is linked with `for`. */
86
- readonly legend: import("@angular/core").InputSignal<ChartLegendPosition>;
87
67
  /** Series switched off in the legend. */
88
- readonly hiddenSeries: import("@angular/core").WritableSignal<string[]>;
89
- /** The series the legend is pointing at, the others fade while it's set. */
90
- readonly emphasis: import("@angular/core").WritableSignal<string | null>;
68
+ protected readonly hiddenSeries: import("@angular/core").WritableSignal<string[]>;
91
69
  /** Charts that draw lines can tell series apart by dashes too, bars can't. */
92
70
  protected readonly supportsDashes: boolean;
93
71
  protected readonly isEmpty: import("@angular/core").Signal<boolean>;
@@ -96,8 +74,12 @@ declare abstract class UiAxisChartBase implements ChartLegendSource {
96
74
  protected readonly colours: import("@angular/core").Signal<string[]>;
97
75
  protected readonly dashed: import("@angular/core").Signal<boolean[]>;
98
76
  /** Grey context series stay out of the legend, the note says how many there are. */
99
- readonly legendItems: import("@angular/core").Signal<ChartLegendItem[]>;
100
- readonly legendNote: import("@angular/core").Signal<string>;
77
+ protected readonly legendItems: import("@angular/core").Signal<{
78
+ colour: string;
79
+ dashed: boolean;
80
+ name: string;
81
+ }[]>;
82
+ protected readonly legendNote: import("@angular/core").Signal<string>;
101
83
  protected formatValue(value: number | null | undefined): string;
102
84
  static ɵfac: i0.ɵɵFactoryDeclaration<UiAxisChartBase, never>;
103
85
  static ɵdir: i0.ɵɵDirectiveDeclaration<UiAxisChartBase, never, never, {
@@ -156,11 +138,6 @@ declare abstract class UiAxisChartBase implements ChartLegendSource {
156
138
  "required": false;
157
139
  "isSignal": true;
158
140
  };
159
- "legend": {
160
- "alias": "legend";
161
- "required": false;
162
- "isSignal": true;
163
- };
164
141
  }, {}, never, never, true, never>;
165
142
  }
166
143
  /**
@@ -232,6 +209,13 @@ export declare class UiChartComponent {
232
209
  };
233
210
  }, {}, never, never, true, never>;
234
211
  }
212
+ /** One entry in a legend, the colour ties it to its marks. */
213
+ export interface ChartLegendItem {
214
+ name: string;
215
+ colour: string;
216
+ /** Shows the key as a dashed line, for series told apart by line style. */
217
+ dashed?: boolean;
218
+ }
235
219
  /** The loading, empty and data table states around a chart, shared by every chart type. */
236
220
  export declare class UiChartFrameComponent {
237
221
  readonly options: import("@angular/core").InputSignal<ApexCharts.ApexOptions>;
@@ -248,9 +232,8 @@ export declare class UiChartFrameComponent {
248
232
  readonly loading: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
249
233
  readonly empty: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
250
234
  readonly showTable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
251
- readonly showLegend: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
252
235
  /** The series the legend is pointing at, the others fade while it's set. */
253
- readonly emphasis: import("@angular/core").ModelSignal<string | null>;
236
+ protected readonly emphasis: import("@angular/core").WritableSignal<string | null>;
254
237
  static ɵfac: i0.ɵɵFactoryDeclaration<UiChartFrameComponent, never>;
255
238
  static ɵcmp: i0.ɵɵComponentDeclaration<UiChartFrameComponent, "ui-chart-frame", never, {
256
239
  "options": {
@@ -323,19 +306,8 @@ export declare class UiChartFrameComponent {
323
306
  "required": false;
324
307
  "isSignal": true;
325
308
  };
326
- "showLegend": {
327
- "alias": "showLegend";
328
- "required": false;
329
- "isSignal": true;
330
- };
331
- "emphasis": {
332
- "alias": "emphasis";
333
- "required": false;
334
- "isSignal": true;
335
- };
336
309
  }, {
337
310
  "hiddenSeries": "hiddenSeriesChange";
338
- "emphasis": "emphasisChange";
339
311
  }, never, never, true, never>;
340
312
  }
341
313
  /**
@@ -385,15 +357,11 @@ export declare class UiChartTableComponent {
385
357
  }, {}, never, never, true, never>;
386
358
  }
387
359
  /**
388
- * A row of colour keys naming what each colour means. Link it to a chart
389
- * with `for`, or pass `items` to use it next to anything coloured by series.
360
+ * A row of colour keys naming what each colour means. Charts use it above
361
+ * the plot, but it works next to anything coloured by series.
390
362
  */
391
363
  export declare class UiChartLegendComponent {
392
364
  readonly items: import("@angular/core").InputSignal<ChartLegendItem[]>;
393
- /** Small text after the items, e.g. how many series aren't listed. */
394
- readonly note: import("@angular/core").InputSignal<string>;
395
- /** A chart to take items from and hide or fade series on, set its `legend` to `none`. */
396
- readonly for: import("@angular/core").InputSignal<ChartLegendSource | null>;
397
365
  /** Names of items switched off, bound two-way when `toggleable`. */
398
366
  readonly hidden: import("@angular/core").ModelSignal<string[]>;
399
367
  /** Lets each item be clicked to hide or show its series. */
@@ -403,9 +371,6 @@ export declare class UiChartLegendComponent {
403
371
  private readonly hovered;
404
372
  private readonly focused;
405
373
  private readonly pointedAt;
406
- protected readonly shownItems: import("@angular/core").Signal<ChartLegendItem[]>;
407
- protected readonly shownNote: import("@angular/core").Signal<string>;
408
- private readonly hiddenNames;
409
374
  protected readonly visibleCount: import("@angular/core").Signal<number>;
410
375
  constructor();
411
376
  protected hover(name: string | null): void;
@@ -417,17 +382,7 @@ export declare class UiChartLegendComponent {
417
382
  static ɵcmp: i0.ɵɵComponentDeclaration<UiChartLegendComponent, "ui-chart-legend", never, {
418
383
  "items": {
419
384
  "alias": "items";
420
- "required": false;
421
- "isSignal": true;
422
- };
423
- "note": {
424
- "alias": "note";
425
- "required": false;
426
- "isSignal": true;
427
- };
428
- "for": {
429
- "alias": "for";
430
- "required": false;
385
+ "required": true;
431
386
  "isSignal": true;
432
387
  };
433
388
  "hidden": {
@@ -474,44 +429,6 @@ export declare class UiLineChartComponent extends UiAxisChartBase {
474
429
  export declare const LineChartCurves: readonly ["straight", "smooth", "stepline"];
475
430
  /** @see {@link LineChartCurves} */
476
431
  export type LineChartCurve = typeof LineChartCurves[number];
477
- /**
478
- * Slices for showing how a whole splits into parts. Each category is a
479
- * slice, only the first series is drawn. Best kept to a handful of slices,
480
- * fold the small ones into "Other".
481
- */
482
- export declare class UiPieChartComponent extends UiAxisChartBase {
483
- readonly variant: import("@angular/core").InputSignal<"pie" | "donut">;
484
- /** Shown above the total in the middle of a donut. */
485
- readonly totalLabel: import("@angular/core").InputSignal<string>;
486
- protected readonly values: import("@angular/core").Signal<(number | null)[]>;
487
- protected readonly isEmpty: import("@angular/core").Signal<boolean>;
488
- protected readonly isMuted: import("@angular/core").Signal<boolean[]>;
489
- protected readonly styles: import("@angular/core").Signal<ChartSeriesStyle[]>;
490
- readonly legendItems: import("@angular/core").Signal<{
491
- colour: string;
492
- dashed: boolean;
493
- name: string;
494
- }[]>;
495
- private readonly slices;
496
- protected readonly chartOptions: import("@angular/core").Signal<ApexCharts.ApexOptions>;
497
- static ɵfac: i0.ɵɵFactoryDeclaration<UiPieChartComponent, never>;
498
- static ɵcmp: i0.ɵɵComponentDeclaration<UiPieChartComponent, "ui-pie-chart", never, {
499
- "variant": {
500
- "alias": "variant";
501
- "required": false;
502
- "isSignal": true;
503
- };
504
- "totalLabel": {
505
- "alias": "totalLabel";
506
- "required": false;
507
- "isSignal": true;
508
- };
509
- }, {}, never, never, true, never>;
510
- }
511
- /** pie fills the whole circle, donut leaves a hole with the total in it. */
512
- export declare const PieChartVariants: readonly ["pie", "donut"];
513
- /** @see {@link PieChartVariants} */
514
- export type PieChartVariant = typeof PieChartVariants[number];
515
432
  /** Native type values ui-input supports. File/checkbox/radio/range need their own components. */
516
433
  export declare const InputTypes: readonly ["text", "email", "tel", "url", "search", "password", "number", "date", "time", "datetime-local", "month", "week", "color"];
517
434
  /** @see {@link InputTypes} */
@@ -759,7 +676,7 @@ export declare class UiInputComponent<ValueType = string> {
759
676
  readonly name: import("@angular/core").InputSignal<string>;
760
677
  readonly placeholder: import("@angular/core").InputSignal<string>;
761
678
  readonly autocomplete: import("@angular/core").InputSignal<string>;
762
- readonly inputmode: import("@angular/core").InputSignal<"" | "none" | "text" | "search" | "numeric" | "decimal" | "email" | "tel" | "url">;
679
+ readonly inputmode: import("@angular/core").InputSignal<"" | "none" | "text" | "search" | "numeric" | "email" | "tel" | "url" | "decimal">;
763
680
  readonly required: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
764
681
  readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
765
682
  readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
@@ -1511,7 +1428,7 @@ export type BadgeSize = typeof BadgeSizes[number];
1511
1428
  * A general-purpose button.
1512
1429
  */
1513
1430
  export declare class UiButtonComponent {
1514
- readonly appearance: import("@angular/core").InputSignal<"none" | "solid" | "link" | "outline" | "ghost" | "white">;
1431
+ readonly appearance: import("@angular/core").InputSignal<"solid" | "none" | "link" | "outline" | "ghost" | "white">;
1515
1432
  readonly intent: import("@angular/core").InputSignal<"none" | "primary" | "secondary" | "success" | "warning" | "danger">;
1516
1433
  readonly size: import("@angular/core").InputSignal<"sm" | "md" | "lg">;
1517
1434
  readonly classes: import("@angular/core").InputSignal<string>;
@@ -1809,7 +1726,6 @@ export declare class UiKpiComponent {
1809
1726
  readonly value: import("@angular/core").InputSignal<string>;
1810
1727
  readonly hint: import("@angular/core").InputSignal<string>;
1811
1728
  readonly icon: import("@angular/core").InputSignal<string | undefined>;
1812
- readonly iconPosition: import("@angular/core").InputSignal<"right" | "left">;
1813
1729
  static ɵfac: i0.ɵɵFactoryDeclaration<UiKpiComponent, never>;
1814
1730
  static ɵcmp: i0.ɵɵComponentDeclaration<UiKpiComponent, "ui-kpi", never, {
1815
1731
  "title": {
@@ -1832,11 +1748,6 @@ export declare class UiKpiComponent {
1832
1748
  "required": false;
1833
1749
  "isSignal": true;
1834
1750
  };
1835
- "iconPosition": {
1836
- "alias": "iconPosition";
1837
- "required": false;
1838
- "isSignal": true;
1839
- };
1840
1751
  }, {}, never, ["[kpi-value]", "[kpi-badge]"], true, never>;
1841
1752
  }
1842
1753
  export declare class UiLoadingComponent {
@@ -2040,7 +1951,7 @@ export declare class UiProgressComponent {
2040
1951
  readonly shape: import("@angular/core").InputSignal<"square" | "straight" | "rounded">;
2041
1952
  readonly orientation: import("@angular/core").InputSignal<"vertical" | "horizontal">;
2042
1953
  readonly title: import("@angular/core").InputSignal<string>;
2043
- readonly labelPosition: import("@angular/core").InputSignal<"none" | "top" | "end" | "floating" | "inside">;
1954
+ readonly labelPosition: import("@angular/core").InputSignal<"top" | "none" | "end" | "floating" | "inside">;
2044
1955
  readonly labelWith: import("@angular/core").InputSignal<(value: number, max: number) => string>;
2045
1956
  /** Splits the bar into this many blocks. */
2046
1957
  readonly steps: import("@angular/core").InputSignal<number | null>;
@@ -3047,7 +2958,7 @@ export declare class UiDatepickerComponent {
3047
2958
  }
3048
2959
  export declare class UiDropdownButtonComponent {
3049
2960
  readonly intent: import("@angular/core").InputSignal<"none" | "primary" | "secondary" | "success" | "warning" | "danger">;
3050
- readonly appearance: import("@angular/core").InputSignal<"none" | "solid" | "link" | "outline" | "ghost" | "white">;
2961
+ readonly appearance: import("@angular/core").InputSignal<"solid" | "none" | "link" | "outline" | "ghost" | "white">;
3051
2962
  readonly icon: import("@angular/core").InputSignal<string>;
3052
2963
  readonly isOpen: import("@angular/core").ModelSignal<boolean>;
3053
2964
  static ɵfac: i0.ɵɵFactoryDeclaration<UiDropdownButtonComponent, never>;