ud-components 0.8.0 → 0.8.2

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.
@@ -107,4 +107,18 @@ export interface TableDisplayColumn {
107
107
  * For PILL type columns. Receives the row and returns the KpiPillType to apply.
108
108
  */
109
109
  pillTypeFn?: (row: any) => KpiPillType;
110
+ /**
111
+ * For MONEY columns. ISO 4217 code every row is shown in. Defaults to USD,
112
+ * so a table that sets nothing still reads "$12.50".
113
+ */
114
+ currency?: string;
115
+ /**
116
+ * For MONEY columns. Row property holding each row's ISO 4217 code; wins
117
+ * over {@link currency} when the row has a value there.
118
+ */
119
+ currencyProperty?: string;
120
+ /**
121
+ * For MONEY columns. Shows credits as "($12.50)" instead of "-$12.50".
122
+ */
123
+ accountingNegatives?: boolean;
110
124
  }
@@ -196,6 +196,7 @@ export declare class CustomTableComponent implements OnInit, OnChanges {
196
196
  set sort(val: MatSort);
197
197
  allFilterInput: ElementRef<HTMLInputElement>;
198
198
  private readonly dialog;
199
+ private readonly locale;
199
200
  constructor(translateService: TranslateWrapperService);
200
201
  ngOnInit(): void;
201
202
  applyFilterToAllColumns(event: Event): void;
@@ -235,6 +236,7 @@ export declare class CustomTableComponent implements OnInit, OnChanges {
235
236
  private restoreFiltersFromCriteria;
236
237
  private setTableQuery;
237
238
  buildColumnFilterControls(): void;
239
+ formatMoneyCell(row: any, column: TableDisplayColumn): string;
238
240
  formatPhoneNumber(value: string): string;
239
241
  getRowBackgroundColor(index: number): "bg-accent" | "bg-white";
240
242
  getHyperlinkRoute(row: any, column: TableDisplayColumn): string;
@@ -23,3 +23,11 @@ export declare function moneyToCents(value: string): number;
23
23
  export declare function centsToMoney(cents: number): string;
24
24
  /** For display only: "1234.50" → "1,234.50". Never parse this back as a number. */
25
25
  export declare function groupThousands(value: string): string;
26
+ /**
27
+ * For display only: an API amount in its currency, always 2 decimals.
28
+ * `formatMoney('1234.5', 'CAD', 'en-US')` gives "$1,234.50", a credit "-$12.50",
29
+ * or "($12.50)" with {@link accounting}. The value goes to Intl as a string, so
30
+ * it is never rounded through a float. Empty input gives "", anything that is
31
+ * not a number is shown as it came.
32
+ */
33
+ export declare function formatMoney(value: string | number | null | undefined, currency?: string, locale?: string, accounting?: boolean): string;
@@ -0,0 +1,36 @@
1
+ import { AfterViewInit } from '@angular/core';
2
+ import { SidenavGroup } from './sidenav.interface';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * The navy app drawer: brand, scrolling sections, pinned footer. It renders
6
+ * the groups it is given; filtering by role or feature flag is the app's job.
7
+ */
8
+ export declare class SidenavComponent implements AfterViewInit {
9
+ readonly groups: import("@angular/core").InputSignal<SidenavGroup[]>;
10
+ /** Icon-only rail: headers become dividers, labels move to tooltips. */
11
+ readonly collapsed: import("@angular/core").InputSignal<boolean>;
12
+ readonly brandRoute: import("@angular/core").InputSignal<string>;
13
+ readonly logo: import("@angular/core").InputSignal<string>;
14
+ readonly logoCollapsed: import("@angular/core").InputSignal<string>;
15
+ private readonly router;
16
+ private readonly zone;
17
+ private readonly destroyRef;
18
+ private readonly sections;
19
+ private readonly sectionsList;
20
+ protected readonly $moreBelow: import("@angular/core").WritableSignal<boolean>;
21
+ protected readonly $navGroups: import("@angular/core").Signal<SidenavGroup[]>;
22
+ protected readonly $footerGroups: import("@angular/core").Signal<SidenavGroup[]>;
23
+ private readonly $currentUrl;
24
+ protected readonly $activeRoute: import("@angular/core").Signal<string | undefined>;
25
+ ngAfterViewInit(): void;
26
+ protected updateMoreBelow(): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<SidenavComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<SidenavComponent, "ud-sidenav", never, { "groups": { "alias": "groups"; "required": true; "isSignal": true; }; "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "brandRoute": { "alias": "brandRoute"; "required": false; "isSignal": true; }; "logo": { "alias": "logo"; "required": false; "isSignal": true; }; "logoCollapsed": { "alias": "logoCollapsed"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
29
+ }
30
+ /**
31
+ * The nav route to highlight for `url`. An exact match wins; otherwise the
32
+ * item in the same top-level section, so detail and add pages (`/users/123`,
33
+ * `/users/add-user`) keep their section lit. When a section has several items
34
+ * (`/document-compliance/send` and `/list`), its list page wins.
35
+ */
36
+ export declare function activeNavRoute(url: string, routes: string[]): string | undefined;
@@ -0,0 +1,16 @@
1
+ import { Observable } from 'rxjs';
2
+ export interface SidenavItem {
3
+ label: Observable<string> | string;
4
+ route: string;
5
+ /** Material Icons Outlined ligature. */
6
+ icon: string;
7
+ badge?: number;
8
+ }
9
+ export interface SidenavGroup {
10
+ key: string;
11
+ /** Section header; a group without one renders as a plain list. */
12
+ category?: Observable<string> | string;
13
+ children: SidenavItem[];
14
+ /** Pinned below the scrolling sections instead of in them. */
15
+ footer?: boolean;
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ud-components",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": ">=19",
6
6
  "@angular/common": ">=19",
@@ -21,6 +21,30 @@
21
21
  ".": {
22
22
  "types": "./index.d.ts",
23
23
  "default": "./fesm2022/ud-components.mjs"
24
+ },
25
+ "./enums/role.enum": {
26
+ "types": "./enums/role.enum.d.ts",
27
+ "default": "./enums/role.enum.js"
28
+ },
29
+ "./lib/kpi/kpi.enum": {
30
+ "types": "./lib/kpi/kpi.enum.d.ts",
31
+ "default": "./lib/kpi/kpi.enum.js"
32
+ },
33
+ "./lib/edit-view/edit-view-section.directive": {
34
+ "types": "./lib/edit-view/edit-view-section.directive.d.ts",
35
+ "default": "./lib/edit-view/edit-view-section.directive.js"
36
+ },
37
+ "./interfaces/page-request.interface": {
38
+ "types": "./interfaces/page-request.interface.d.ts",
39
+ "default": "./interfaces/page-request.interface.js"
40
+ },
41
+ "./interfaces/table.interface": {
42
+ "types": "./interfaces/table.interface.d.ts",
43
+ "default": "./interfaces/table.interface.js"
44
+ },
45
+ "./interfaces/table-display-column.interface": {
46
+ "types": "./interfaces/table-display-column.interface.d.ts",
47
+ "default": "./interfaces/table-display-column.interface.js"
24
48
  }
25
49
  }
26
- }
50
+ }
package/public-api.d.ts CHANGED
@@ -17,6 +17,8 @@ export * from './lib/occupancy-grid/occupancy-grid.layout';
17
17
  export * from './lib/occupancy-grid/local-date';
18
18
  export * from './lib/pill/pill.component';
19
19
  export * from './lib/progress-bar/progress-bar.component';
20
+ export * from './lib/sidenav/sidenav.component';
21
+ export * from './lib/sidenav/sidenav.interface';
20
22
  export * from './lib/summary-view/summary-view.component';
21
23
  export * from './lib/stepper/stepper.component';
22
24
  export * from './lib/stepper/step-content.directive';