@area8975/ui 0.2.2-dev.48 → 0.2.2-dev.50

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.
Files changed (182) hide show
  1. package/README.md +3 -2
  2. package/fesm2022/area8975-ui-alert.mjs +113 -0
  3. package/fesm2022/area8975-ui-alert.mjs.map +1 -0
  4. package/fesm2022/area8975-ui-avatar.mjs +157 -0
  5. package/fesm2022/area8975-ui-avatar.mjs.map +1 -0
  6. package/fesm2022/area8975-ui-badge.mjs +116 -0
  7. package/fesm2022/area8975-ui-badge.mjs.map +1 -0
  8. package/fesm2022/area8975-ui-button.mjs +314 -0
  9. package/fesm2022/area8975-ui-button.mjs.map +1 -0
  10. package/fesm2022/area8975-ui-calendar.mjs +549 -0
  11. package/fesm2022/area8975-ui-calendar.mjs.map +1 -0
  12. package/fesm2022/area8975-ui-card-header.mjs +96 -0
  13. package/fesm2022/area8975-ui-card-header.mjs.map +1 -0
  14. package/fesm2022/area8975-ui-card.mjs +73 -0
  15. package/fesm2022/area8975-ui-card.mjs.map +1 -0
  16. package/fesm2022/area8975-ui-chart-palette.mjs +225 -0
  17. package/fesm2022/area8975-ui-chart-palette.mjs.map +1 -0
  18. package/fesm2022/area8975-ui-charts.mjs +2813 -0
  19. package/fesm2022/area8975-ui-charts.mjs.map +1 -0
  20. package/fesm2022/area8975-ui-checkbox.mjs +202 -0
  21. package/fesm2022/area8975-ui-checkbox.mjs.map +1 -0
  22. package/fesm2022/area8975-ui-colour.mjs +200 -0
  23. package/fesm2022/area8975-ui-colour.mjs.map +1 -0
  24. package/fesm2022/area8975-ui-container.mjs +40 -0
  25. package/fesm2022/area8975-ui-container.mjs.map +1 -0
  26. package/fesm2022/area8975-ui-counter.mjs +246 -0
  27. package/fesm2022/area8975-ui-counter.mjs.map +1 -0
  28. package/fesm2022/area8975-ui-date-range-picker.mjs +554 -0
  29. package/fesm2022/area8975-ui-date-range-picker.mjs.map +1 -0
  30. package/fesm2022/area8975-ui-datepicker.mjs +547 -0
  31. package/fesm2022/area8975-ui-datepicker.mjs.map +1 -0
  32. package/fesm2022/area8975-ui-disclosure.mjs +279 -0
  33. package/fesm2022/area8975-ui-disclosure.mjs.map +1 -0
  34. package/fesm2022/area8975-ui-drawer.mjs +106 -0
  35. package/fesm2022/area8975-ui-drawer.mjs.map +1 -0
  36. package/fesm2022/area8975-ui-dropdown-button.mjs +141 -0
  37. package/fesm2022/area8975-ui-dropdown-button.mjs.map +1 -0
  38. package/fesm2022/area8975-ui-dropdown-menu.mjs +96 -0
  39. package/fesm2022/area8975-ui-dropdown-menu.mjs.map +1 -0
  40. package/fesm2022/area8975-ui-dropdown.mjs +208 -0
  41. package/fesm2022/area8975-ui-dropdown.mjs.map +1 -0
  42. package/fesm2022/area8975-ui-dropzone.mjs +332 -0
  43. package/fesm2022/area8975-ui-dropzone.mjs.map +1 -0
  44. package/fesm2022/area8975-ui-field.mjs +191 -0
  45. package/fesm2022/area8975-ui-field.mjs.map +1 -0
  46. package/fesm2022/area8975-ui-file-input.mjs +340 -0
  47. package/fesm2022/area8975-ui-file-input.mjs.map +1 -0
  48. package/fesm2022/area8975-ui-file.mjs +47 -0
  49. package/fesm2022/area8975-ui-file.mjs.map +1 -0
  50. package/fesm2022/area8975-ui-format.mjs +70 -0
  51. package/fesm2022/area8975-ui-format.mjs.map +1 -0
  52. package/fesm2022/area8975-ui-input-addon.mjs +42 -0
  53. package/fesm2022/area8975-ui-input-addon.mjs.map +1 -0
  54. package/fesm2022/area8975-ui-input-group.mjs +86 -0
  55. package/fesm2022/area8975-ui-input-group.mjs.map +1 -0
  56. package/fesm2022/area8975-ui-input.mjs +682 -0
  57. package/fesm2022/area8975-ui-input.mjs.map +1 -0
  58. package/fesm2022/area8975-ui-kpi.mjs +167 -0
  59. package/fesm2022/area8975-ui-kpi.mjs.map +1 -0
  60. package/fesm2022/area8975-ui-layout.mjs +63 -0
  61. package/fesm2022/area8975-ui-layout.mjs.map +1 -0
  62. package/fesm2022/area8975-ui-loading.mjs +76 -0
  63. package/fesm2022/area8975-ui-loading.mjs.map +1 -0
  64. package/fesm2022/area8975-ui-modal-close-btn.mjs +89 -0
  65. package/fesm2022/area8975-ui-modal-close-btn.mjs.map +1 -0
  66. package/fesm2022/area8975-ui-modal.mjs +235 -0
  67. package/fesm2022/area8975-ui-modal.mjs.map +1 -0
  68. package/fesm2022/area8975-ui-money.mjs +230 -0
  69. package/fesm2022/area8975-ui-money.mjs.map +1 -0
  70. package/fesm2022/area8975-ui-overlay.mjs +317 -0
  71. package/fesm2022/area8975-ui-overlay.mjs.map +1 -0
  72. package/fesm2022/area8975-ui-pagination.mjs +152 -0
  73. package/fesm2022/area8975-ui-pagination.mjs.map +1 -0
  74. package/fesm2022/area8975-ui-private.mjs +63 -0
  75. package/fesm2022/area8975-ui-private.mjs.map +1 -0
  76. package/fesm2022/area8975-ui-progress.mjs +307 -0
  77. package/fesm2022/area8975-ui-progress.mjs.map +1 -0
  78. package/fesm2022/area8975-ui-radio.mjs +199 -0
  79. package/fesm2022/area8975-ui-radio.mjs.map +1 -0
  80. package/fesm2022/area8975-ui-rich-text-editor.mjs +778 -0
  81. package/fesm2022/area8975-ui-rich-text-editor.mjs.map +1 -0
  82. package/fesm2022/area8975-ui-search.mjs +266 -0
  83. package/fesm2022/area8975-ui-search.mjs.map +1 -0
  84. package/fesm2022/area8975-ui-segmented.mjs +118 -0
  85. package/fesm2022/area8975-ui-segmented.mjs.map +1 -0
  86. package/fesm2022/area8975-ui-select.mjs +926 -0
  87. package/fesm2022/area8975-ui-select.mjs.map +1 -0
  88. package/fesm2022/area8975-ui-sidebar-group.mjs +60 -0
  89. package/fesm2022/area8975-ui-sidebar-group.mjs.map +1 -0
  90. package/fesm2022/area8975-ui-sidebar-item.mjs +107 -0
  91. package/fesm2022/area8975-ui-sidebar-item.mjs.map +1 -0
  92. package/fesm2022/area8975-ui-sidebar.mjs +109 -0
  93. package/fesm2022/area8975-ui-sidebar.mjs.map +1 -0
  94. package/fesm2022/area8975-ui-skeleton.mjs +116 -0
  95. package/fesm2022/area8975-ui-skeleton.mjs.map +1 -0
  96. package/fesm2022/area8975-ui-stat.mjs +55 -0
  97. package/fesm2022/area8975-ui-stat.mjs.map +1 -0
  98. package/fesm2022/area8975-ui-switch.mjs +132 -0
  99. package/fesm2022/area8975-ui-switch.mjs.map +1 -0
  100. package/fesm2022/area8975-ui-tab.mjs +217 -0
  101. package/fesm2022/area8975-ui-tab.mjs.map +1 -0
  102. package/fesm2022/area8975-ui-table-filters.mjs +499 -0
  103. package/fesm2022/area8975-ui-table-filters.mjs.map +1 -0
  104. package/fesm2022/area8975-ui-table.mjs +1237 -0
  105. package/fesm2022/area8975-ui-table.mjs.map +1 -0
  106. package/fesm2022/area8975-ui-textarea.mjs +375 -0
  107. package/fesm2022/area8975-ui-textarea.mjs.map +1 -0
  108. package/fesm2022/area8975-ui-theme.mjs +246 -0
  109. package/fesm2022/area8975-ui-theme.mjs.map +1 -0
  110. package/fesm2022/area8975-ui-time-select.mjs +170 -0
  111. package/fesm2022/area8975-ui-time-select.mjs.map +1 -0
  112. package/fesm2022/area8975-ui-toast.mjs +269 -0
  113. package/fesm2022/area8975-ui-toast.mjs.map +1 -0
  114. package/fesm2022/area8975-ui-toaster.mjs +117 -0
  115. package/fesm2022/area8975-ui-toaster.mjs.map +1 -0
  116. package/fesm2022/area8975-ui-tooltip.mjs +196 -0
  117. package/fesm2022/area8975-ui-tooltip.mjs.map +1 -0
  118. package/fesm2022/area8975-ui-user-menu.mjs +186 -0
  119. package/fesm2022/area8975-ui-user-menu.mjs.map +1 -0
  120. package/fesm2022/area8975-ui.mjs +0 -16269
  121. package/package.json +237 -1
  122. package/types/area8975-ui-alert.d.ts +25 -0
  123. package/types/area8975-ui-avatar.d.ts +40 -0
  124. package/types/area8975-ui-badge.d.ts +31 -0
  125. package/types/area8975-ui-button.d.ts +129 -0
  126. package/types/area8975-ui-calendar.d.ts +177 -0
  127. package/types/area8975-ui-card-header.d.ts +28 -0
  128. package/types/area8975-ui-card.d.ts +18 -0
  129. package/types/area8975-ui-chart-palette.d.ts +176 -0
  130. package/types/area8975-ui-charts.d.ts +747 -0
  131. package/types/area8975-ui-checkbox.d.ts +61 -0
  132. package/types/area8975-ui-colour.d.ts +31 -0
  133. package/types/area8975-ui-container.d.ts +5 -0
  134. package/types/area8975-ui-counter.d.ts +43 -0
  135. package/types/area8975-ui-date-range-picker.d.ts +132 -0
  136. package/types/area8975-ui-datepicker.d.ts +124 -0
  137. package/types/area8975-ui-disclosure.d.ts +79 -0
  138. package/types/area8975-ui-drawer.d.ts +25 -0
  139. package/types/area8975-ui-dropdown-button.d.ts +32 -0
  140. package/types/area8975-ui-dropdown-menu.d.ts +25 -0
  141. package/types/area8975-ui-dropdown.d.ts +56 -0
  142. package/types/area8975-ui-dropzone.d.ts +96 -0
  143. package/types/area8975-ui-field.d.ts +72 -0
  144. package/types/area8975-ui-file-input.d.ts +72 -0
  145. package/types/area8975-ui-file.d.ts +21 -0
  146. package/types/area8975-ui-format.d.ts +37 -0
  147. package/types/area8975-ui-input-addon.d.ts +10 -0
  148. package/types/area8975-ui-input-group.d.ts +18 -0
  149. package/types/area8975-ui-input.d.ts +224 -0
  150. package/types/area8975-ui-kpi.d.ts +36 -0
  151. package/types/area8975-ui-layout.d.ts +7 -0
  152. package/types/area8975-ui-loading.d.ts +16 -0
  153. package/types/area8975-ui-modal-close-btn.d.ts +14 -0
  154. package/types/area8975-ui-modal.d.ts +45 -0
  155. package/types/area8975-ui-money.d.ts +77 -0
  156. package/types/area8975-ui-overlay.d.ts +75 -0
  157. package/types/area8975-ui-pagination.d.ts +27 -0
  158. package/types/area8975-ui-private.d.ts +20 -0
  159. package/types/area8975-ui-progress.d.ts +127 -0
  160. package/types/area8975-ui-radio.d.ts +61 -0
  161. package/types/area8975-ui-rich-text-editor.d.ts +165 -0
  162. package/types/area8975-ui-search.d.ts +56 -0
  163. package/types/area8975-ui-segmented.d.ts +41 -0
  164. package/types/area8975-ui-select.d.ts +293 -0
  165. package/types/area8975-ui-sidebar-group.d.ts +15 -0
  166. package/types/area8975-ui-sidebar-item.d.ts +20 -0
  167. package/types/area8975-ui-sidebar.d.ts +16 -0
  168. package/types/area8975-ui-skeleton.d.ts +35 -0
  169. package/types/area8975-ui-stat.d.ts +13 -0
  170. package/types/area8975-ui-switch.d.ts +32 -0
  171. package/types/area8975-ui-tab.d.ts +45 -0
  172. package/types/area8975-ui-table-filters.d.ts +138 -0
  173. package/types/area8975-ui-table.d.ts +371 -0
  174. package/types/area8975-ui-textarea.d.ts +126 -0
  175. package/types/area8975-ui-theme.d.ts +61 -0
  176. package/types/area8975-ui-time-select.d.ts +35 -0
  177. package/types/area8975-ui-toast.d.ts +78 -0
  178. package/types/area8975-ui-toaster.d.ts +23 -0
  179. package/types/area8975-ui-tooltip.d.ts +47 -0
  180. package/types/area8975-ui-user-menu.d.ts +39 -0
  181. package/types/area8975-ui.d.ts +1 -4464
  182. package/fesm2022/area8975-ui.mjs.map +0 -1
@@ -0,0 +1,371 @@
1
+ import * as i0 from "@angular/core";
2
+ import { OnDestroy, OnInit, TemplateRef, WritableSignal } from "@angular/core";
3
+ import { SelectDataSource } from "@area8975/ui/select";
4
+ import { Observable } from "rxjs";
5
+ export type TableSortDirection = 'asc' | 'desc';
6
+ export interface TableSortState {
7
+ columnId: string;
8
+ direction: TableSortDirection;
9
+ }
10
+ export type TableColumnDisplayType = 'text' | 'number' | 'currency' | 'date' | 'time' | 'icon';
11
+ export type TableColumnPin = 'left' | 'right';
12
+ export interface TableColumnFilterOption {
13
+ label: string;
14
+ value: unknown;
15
+ }
16
+ export interface TableColumn<Row> {
17
+ /** unique key, used for sorting/filtering/visibility/pinning/reordering */
18
+ id: string;
19
+ header: string;
20
+ /** the cell's value, used for sorting and filtering even when a `uiTableCell` template draws the cell */
21
+ accessor: (row: Row) => unknown;
22
+ /** how the cell value is formatted for display, defaults to plain text */
23
+ displayType?: TableColumnDisplayType;
24
+ /** ISO currency code, used when displayType is 'currency'. Defaults to the currency from `provideUiFormat`. */
25
+ currency?: string;
26
+ /**
27
+ * Masks the cell in privacy mode, e.g. a transaction's description. Currency cells are already masked, icon cells have no text.
28
+ * A `uiTableCell` template is replaced by the mask too.
29
+ */
30
+ sensitive?: boolean;
31
+ sortable?: boolean;
32
+ filterable?: boolean;
33
+ /** when set, the filter renders as a select instead of a free-text contains filter */
34
+ filterOptions?: TableColumnFilterOption[];
35
+ /** fix the column to one side of the scroll area, needs width to compute its offset */
36
+ pin?: TableColumnPin;
37
+ resizable?: boolean;
38
+ width?: number;
39
+ minWidth?: number;
40
+ /** false excludes the column from the drag-to-reorder behaviour */
41
+ reorderable?: boolean;
42
+ /** false excludes the column from the visibility toggle menu */
43
+ hideable?: boolean;
44
+ }
45
+ /** Context for a `uiTableCell` template. */
46
+ export interface TableCellContext<Row> {
47
+ $implicit: Row;
48
+ /** what the column's accessor gives for the row */
49
+ value: unknown;
50
+ }
51
+ export interface TableRowAction<Row> {
52
+ id: string;
53
+ label: string;
54
+ icon: string;
55
+ onClick: (row: Row) => void;
56
+ disabled?: (row: Row) => boolean;
57
+ }
58
+ export interface TableDataSourceParameters {
59
+ page: number;
60
+ /** 0 or less means "no limit", used when the table isn't paginated */
61
+ size: number;
62
+ query: string;
63
+ sort: TableSortState | null;
64
+ filters: Record<string, unknown>;
65
+ }
66
+ export interface TableDataSourceContent<Row> {
67
+ items: Row[];
68
+ total: number;
69
+ }
70
+ export interface TableDataSource<Row> {
71
+ load(params: TableDataSourceParameters): Observable<TableDataSourceContent<Row>>;
72
+ }
73
+ export interface TableLocalDataSourceOptions<Row> {
74
+ search?: (item: Row, query: string) => boolean;
75
+ sortValue?: (item: Row, columnId: string) => unknown;
76
+ filter?: (item: Row, filters: Record<string, unknown>) => boolean;
77
+ }
78
+ export declare class TableLocalDataSource<Row> implements TableDataSource<Row> {
79
+ private readonly items;
80
+ private readonly options;
81
+ constructor(items: Row[], options?: TableLocalDataSourceOptions<Row>);
82
+ load(params: TableDataSourceParameters): Observable<TableDataSourceContent<Row>>;
83
+ }
84
+ export declare class TableRemoteDataSource<Row> implements TableDataSource<Row> {
85
+ private readonly fetch;
86
+ constructor(fetch: (params: TableDataSourceParameters) => Observable<TableDataSourceContent<Row>>);
87
+ load(params: TableDataSourceParameters): Observable<TableDataSourceContent<Row>>;
88
+ }
89
+ interface ColumnDragPreview {
90
+ label: string;
91
+ x: number;
92
+ y: number;
93
+ width: number;
94
+ height: number;
95
+ }
96
+ export declare class UiTableComponent<Row = unknown> implements OnInit, OnDestroy {
97
+ readonly classes: import("@angular/core").InputSignal<string>;
98
+ /** Lets controls elsewhere on the page link to this table, e.g. `<ui-search [table]="'transactions'">`. */
99
+ readonly tableId: import("@angular/core").InputSignal<string | null>;
100
+ readonly columns: import("@angular/core").InputSignal<TableColumn<Row>[]>;
101
+ readonly dataSource: import("@angular/core").InputSignal<TableDataSource<Row>>;
102
+ readonly emptyMessage: import("@angular/core").InputSignal<string>;
103
+ readonly errorMessage: import("@angular/core").InputSignal<string>;
104
+ readonly rowId: import("@angular/core").InputSignal<(row: Row, index: number) => unknown>;
105
+ readonly selectable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
106
+ readonly searchable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
107
+ readonly searchPlaceholder: import("@angular/core").InputSignal<string>;
108
+ readonly paginated: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
109
+ readonly pageSize: import("@angular/core").InputSignal<number>;
110
+ readonly toggleableColumns: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
111
+ readonly reorderableColumns: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
112
+ readonly reorderableRows: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
113
+ readonly stickyHeader: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
114
+ /** Leaves out the header row, for rows that read on their own. A `uiTableBar` can still select every row. */
115
+ readonly headerless: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
116
+ private readonly bar;
117
+ protected readonly hasBar: import("@angular/core").Signal<boolean>;
118
+ /** Starts each run of rows with a heading row, e.g. a date. A row gets one whenever its heading differs from the row before it. */
119
+ readonly groupHeading: import("@angular/core").InputSignal<((row: Row) => string) | null>;
120
+ readonly actions: import("@angular/core").InputSignal<TableRowAction<Row>[]>;
121
+ readonly sort: import("@angular/core").ModelSignal<TableSortState | null>;
122
+ readonly selectedRowIds: import("@angular/core").ModelSignal<Set<unknown>>;
123
+ readonly selectionChange: import("@angular/core").OutputEmitterRef<Row[]>;
124
+ readonly rowsReordered: import("@angular/core").OutputEmitterRef<Row[]>;
125
+ readonly rows: import("@angular/core").WritableSignal<Row[]>;
126
+ readonly total: import("@angular/core").WritableSignal<number>;
127
+ readonly loading: import("@angular/core").WritableSignal<boolean>;
128
+ readonly error: import("@angular/core").WritableSignal<boolean>;
129
+ readonly query: import("@angular/core").WritableSignal<string>;
130
+ readonly filters: import("@angular/core").WritableSignal<Record<string, unknown>>;
131
+ protected readonly currentPage: import("@angular/core").WritableSignal<number>;
132
+ protected readonly hiddenColumnIds: import("@angular/core").WritableSignal<Set<string>>;
133
+ protected readonly columnOrderIds: import("@angular/core").WritableSignal<string[] | null>;
134
+ protected readonly columnWidths: import("@angular/core").WritableSignal<Record<string, number>>;
135
+ protected readonly columnMenuOpen: import("@angular/core").WritableSignal<boolean>;
136
+ protected readonly filterMenuOpen: import("@angular/core").WritableSignal<boolean>;
137
+ protected readonly draggedColumnId: import("@angular/core").WritableSignal<string | null>;
138
+ protected readonly dragOverColumnId: import("@angular/core").WritableSignal<string | null>;
139
+ protected readonly dragPreview: import("@angular/core").WritableSignal<ColumnDragPreview | null>;
140
+ protected readonly draggedRowIndex: import("@angular/core").WritableSignal<number | null>;
141
+ private readonly cellDirectives;
142
+ protected readonly cellTemplates: import("@angular/core").Signal<Map<string, TemplateRef<TableCellContext<unknown>>>>;
143
+ readonly isEmpty: import("@angular/core").Signal<boolean>;
144
+ readonly generatedClasses: import("@angular/core").Signal<string>;
145
+ protected readonly orderedColumns: import("@angular/core").Signal<TableColumn<Row>[]>;
146
+ protected readonly hideableColumns: import("@angular/core").Signal<TableColumn<Row>[]>;
147
+ protected readonly visibleColumns: import("@angular/core").Signal<TableColumn<Row>[]>;
148
+ protected readonly renderColumns: import("@angular/core").Signal<TableColumn<Row>[]>;
149
+ protected readonly filterableColumns: import("@angular/core").Signal<TableColumn<Row>[]>;
150
+ protected readonly hasFilterableColumns: import("@angular/core").Signal<boolean>;
151
+ protected readonly activeFilterCount: import("@angular/core").Signal<number>;
152
+ protected readonly hasActions: import("@angular/core").Signal<boolean>;
153
+ protected readonly columnSpan: import("@angular/core").Signal<number>;
154
+ /** Each row's heading, or null when it continues the run above it. */
155
+ protected readonly groupHeadings: import("@angular/core").Signal<(string | null)[]>;
156
+ private readonly hasSensitiveColumns;
157
+ protected readonly fixedWidth: import("@angular/core").Signal<number | null>;
158
+ protected readonly actionsColumnWidth: import("@angular/core").Signal<number>;
159
+ protected readonly totalPages: import("@angular/core").Signal<number>;
160
+ protected readonly resultsLabel: import("@angular/core").Signal<string>;
161
+ readonly allSelected: import("@angular/core").Signal<boolean>;
162
+ readonly someSelected: import("@angular/core").Signal<boolean>;
163
+ private readonly leftOffsets;
164
+ private readonly rightOffsets;
165
+ private readonly load$;
166
+ private readonly destroyRef;
167
+ private readonly cdr;
168
+ private readonly registry;
169
+ protected readonly uiFormat: import("@area8975/ui/format").UiFormat;
170
+ private readonly privateText;
171
+ protected readonly privacy: import("@angular/core").Signal<"visible" | "discreet" | "hidden">;
172
+ private loadedQuery;
173
+ private loadedFilters;
174
+ private loadedSort;
175
+ private resizeState;
176
+ private columnDragState;
177
+ private readonly filterDataSources;
178
+ constructor();
179
+ ngOnInit(): void;
180
+ ngOnDestroy(): void;
181
+ reload(): void;
182
+ protected cellValue(column: TableColumn<Row>, row: Row): unknown;
183
+ protected cellIconValue(column: TableColumn<Row>, row: Row): string;
184
+ protected moneyCellValue(column: TableColumn<Row>, row: Row): number | null;
185
+ protected formattedCellValue(column: TableColumn<Row>, row: Row): string;
186
+ protected onQueryChange(value: string): void;
187
+ protected filterValue(columnId: string): string;
188
+ protected onFilterInput(columnId: string, value: string): void;
189
+ protected filterDataSource(column: TableColumn<Row>): SelectDataSource<TableColumnFilterOption>;
190
+ protected selectedFilterOption(column: TableColumn<Row>): TableColumnFilterOption | null;
191
+ protected filterOptionLabel(option: TableColumnFilterOption): string;
192
+ protected readonly sensitiveFilterOptionLabel: (option: TableColumnFilterOption) => string;
193
+ protected onFilterSelect(columnId: string, option: TableColumnFilterOption | null): void;
194
+ protected clearFilters(): void;
195
+ protected toggleSort(column: TableColumn<Row>): void;
196
+ protected sortDirection(column: TableColumn<Row>): TableSortDirection | null;
197
+ protected goToPage(page: number): void;
198
+ protected isColumnVisible(column: TableColumn<Row>): boolean;
199
+ protected toggleColumnVisibility(column: TableColumn<Row>): void;
200
+ protected isRowSelected(row: Row, index: number): boolean;
201
+ protected toggleRow(row: Row, index: number): void;
202
+ toggleSelectAll(): void;
203
+ protected columnWidth(column: TableColumn<Row>): number;
204
+ protected isPinned(column: TableColumn<Row>): boolean;
205
+ protected leftOffset(column: TableColumn<Row>): number | null;
206
+ protected rightOffset(column: TableColumn<Row>): number | null;
207
+ protected startResize(event: PointerEvent, column: TableColumn<Row>): void;
208
+ protected canReorderRows(): boolean;
209
+ protected onColumnDragStart(event: PointerEvent, column: TableColumn<Row>): void;
210
+ protected onRowDragStart(event: DragEvent, index: number): void;
211
+ protected onRowDragOver(event: DragEvent): void;
212
+ protected onRowDrop(event: DragEvent, index: number): void;
213
+ private readonly onResizeMove;
214
+ private readonly onResizeEnd;
215
+ private readonly onColumnDragMove;
216
+ private readonly onColumnDragEnd;
217
+ private setFilter;
218
+ private resetAndReload;
219
+ private emitSelectionChange;
220
+ private fetch;
221
+ private applyResult;
222
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiTableComponent<any>, never>;
223
+ static ɵcmp: i0.ɵɵComponentDeclaration<UiTableComponent<any>, "ui-table", never, {
224
+ "classes": {
225
+ "alias": "classes";
226
+ "required": false;
227
+ "isSignal": true;
228
+ };
229
+ "tableId": {
230
+ "alias": "tableId";
231
+ "required": false;
232
+ "isSignal": true;
233
+ };
234
+ "columns": {
235
+ "alias": "columns";
236
+ "required": true;
237
+ "isSignal": true;
238
+ };
239
+ "dataSource": {
240
+ "alias": "dataSource";
241
+ "required": true;
242
+ "isSignal": true;
243
+ };
244
+ "emptyMessage": {
245
+ "alias": "emptyMessage";
246
+ "required": false;
247
+ "isSignal": true;
248
+ };
249
+ "errorMessage": {
250
+ "alias": "errorMessage";
251
+ "required": false;
252
+ "isSignal": true;
253
+ };
254
+ "rowId": {
255
+ "alias": "rowId";
256
+ "required": false;
257
+ "isSignal": true;
258
+ };
259
+ "selectable": {
260
+ "alias": "selectable";
261
+ "required": false;
262
+ "isSignal": true;
263
+ };
264
+ "searchable": {
265
+ "alias": "searchable";
266
+ "required": false;
267
+ "isSignal": true;
268
+ };
269
+ "searchPlaceholder": {
270
+ "alias": "searchPlaceholder";
271
+ "required": false;
272
+ "isSignal": true;
273
+ };
274
+ "paginated": {
275
+ "alias": "paginated";
276
+ "required": false;
277
+ "isSignal": true;
278
+ };
279
+ "pageSize": {
280
+ "alias": "pageSize";
281
+ "required": false;
282
+ "isSignal": true;
283
+ };
284
+ "toggleableColumns": {
285
+ "alias": "toggleableColumns";
286
+ "required": false;
287
+ "isSignal": true;
288
+ };
289
+ "reorderableColumns": {
290
+ "alias": "reorderableColumns";
291
+ "required": false;
292
+ "isSignal": true;
293
+ };
294
+ "reorderableRows": {
295
+ "alias": "reorderableRows";
296
+ "required": false;
297
+ "isSignal": true;
298
+ };
299
+ "stickyHeader": {
300
+ "alias": "stickyHeader";
301
+ "required": false;
302
+ "isSignal": true;
303
+ };
304
+ "headerless": {
305
+ "alias": "headerless";
306
+ "required": false;
307
+ "isSignal": true;
308
+ };
309
+ "groupHeading": {
310
+ "alias": "groupHeading";
311
+ "required": false;
312
+ "isSignal": true;
313
+ };
314
+ "actions": {
315
+ "alias": "actions";
316
+ "required": false;
317
+ "isSignal": true;
318
+ };
319
+ "sort": {
320
+ "alias": "sort";
321
+ "required": false;
322
+ "isSignal": true;
323
+ };
324
+ "selectedRowIds": {
325
+ "alias": "selectedRowIds";
326
+ "required": false;
327
+ "isSignal": true;
328
+ };
329
+ }, {
330
+ "sort": "sortChange";
331
+ "selectedRowIds": "selectedRowIdsChange";
332
+ "selectionChange": "selectionChange";
333
+ "rowsReordered": "rowsReordered";
334
+ }, ["bar", "cellDirectives"], ["[uiTableBar]"], true, never>;
335
+ }
336
+ /**
337
+ * Draws a column's cells in place of its formatted value, matched by column id:
338
+ * `<ng-template uiTableCell="description" let-row>`. The accessor stays the cell's value.
339
+ */
340
+ export declare class UiTableCellDirective {
341
+ readonly columnId: import("@angular/core").InputSignal<string>;
342
+ readonly template: TemplateRef<TableCellContext<unknown>>;
343
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiTableCellDirective, never>;
344
+ static ɵdir: i0.ɵɵDirectiveDeclaration<UiTableCellDirective, "ng-template[uiTableCell]", never, {
345
+ "columnId": {
346
+ "alias": "uiTableCell";
347
+ "required": true;
348
+ "isSignal": true;
349
+ };
350
+ }, {}, never, never, true, never>;
351
+ }
352
+ /**
353
+ * Content for a bar along the top of the table, e.g. a count and a sort control above a
354
+ * `headerless` list: `<div uiTableBar>`. With `selectable`, the bar also selects every row.
355
+ */
356
+ export declare class UiTableBarDirective {
357
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiTableBarDirective, never>;
358
+ static ɵdir: i0.ɵɵDirectiveDeclaration<UiTableBarDirective, "[uiTableBar]", never, {}, {}, never, never, true, never>;
359
+ }
360
+ export interface UiLinkedTable {
361
+ readonly query: WritableSignal<string>;
362
+ readonly filters: WritableSignal<Record<string, unknown>>;
363
+ }
364
+ export declare class UiTableRegistry {
365
+ private readonly tables;
366
+ get(id: string): UiLinkedTable | null;
367
+ register(id: string, table: UiLinkedTable): void;
368
+ unregister(id: string, table: UiLinkedTable): void;
369
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiTableRegistry, never>;
370
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
371
+ }
@@ -0,0 +1,126 @@
1
+ import * as i0 from "@angular/core";
2
+ /** Native resize values for the textarea element. */
3
+ export declare const TextareaResizeOptions: readonly ["none", "both", "horizontal", "vertical"];
4
+ /** @see {@link TextareaResizeOptions} */
5
+ export type TextareaResize = typeof TextareaResizeOptions[number];
6
+ /** true is valid, false is invalid, null is not yet validated. */
7
+ export type TextareaValidation = boolean | null;
8
+ export declare class UiTextareaComponent {
9
+ readonly value: import("@angular/core").ModelSignal<string>;
10
+ readonly classes: import("@angular/core").InputSignal<string>;
11
+ readonly id: import("@angular/core").InputSignal<string>;
12
+ readonly name: import("@angular/core").InputSignal<string>;
13
+ readonly placeholder: import("@angular/core").InputSignal<string>;
14
+ readonly rows: import("@angular/core").InputSignal<number>;
15
+ readonly resize: import("@angular/core").InputSignal<"none" | "both" | "horizontal" | "vertical">;
16
+ readonly required: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
17
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
18
+ readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
19
+ /** true/false shows valid/invalid styling. null means not validated yet. */
20
+ readonly validationState: import("@angular/core").ModelSignal<TextareaValidation>;
21
+ readonly minlength: import("@angular/core").InputSignal<number | null>;
22
+ readonly maxlength: import("@angular/core").InputSignal<number | null>;
23
+ readonly autofocus: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
24
+ readonly spellcheck: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
25
+ readonly ariaLabel: import("@angular/core").InputSignal<string>;
26
+ readonly describedBy: import("@angular/core").InputSignal<string>;
27
+ readonly focused: import("@angular/core").OutputEmitterRef<FocusEvent>;
28
+ readonly blurred: import("@angular/core").OutputEmitterRef<FocusEvent>;
29
+ readonly generatedClasses: import("@angular/core").Signal<string>;
30
+ protected handleInput(event: Event): void;
31
+ protected handleFocus(event: FocusEvent): void;
32
+ protected handleBlur(event: FocusEvent): void;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiTextareaComponent, never>;
34
+ static ɵcmp: i0.ɵɵComponentDeclaration<UiTextareaComponent, "ui-textarea", never, {
35
+ "value": {
36
+ "alias": "value";
37
+ "required": true;
38
+ "isSignal": true;
39
+ };
40
+ "classes": {
41
+ "alias": "classes";
42
+ "required": false;
43
+ "isSignal": true;
44
+ };
45
+ "id": {
46
+ "alias": "id";
47
+ "required": false;
48
+ "isSignal": true;
49
+ };
50
+ "name": {
51
+ "alias": "name";
52
+ "required": false;
53
+ "isSignal": true;
54
+ };
55
+ "placeholder": {
56
+ "alias": "placeholder";
57
+ "required": false;
58
+ "isSignal": true;
59
+ };
60
+ "rows": {
61
+ "alias": "rows";
62
+ "required": false;
63
+ "isSignal": true;
64
+ };
65
+ "resize": {
66
+ "alias": "resize";
67
+ "required": false;
68
+ "isSignal": true;
69
+ };
70
+ "required": {
71
+ "alias": "required";
72
+ "required": false;
73
+ "isSignal": true;
74
+ };
75
+ "disabled": {
76
+ "alias": "disabled";
77
+ "required": false;
78
+ "isSignal": true;
79
+ };
80
+ "readonly": {
81
+ "alias": "readonly";
82
+ "required": false;
83
+ "isSignal": true;
84
+ };
85
+ "validationState": {
86
+ "alias": "validationState";
87
+ "required": false;
88
+ "isSignal": true;
89
+ };
90
+ "minlength": {
91
+ "alias": "minlength";
92
+ "required": false;
93
+ "isSignal": true;
94
+ };
95
+ "maxlength": {
96
+ "alias": "maxlength";
97
+ "required": false;
98
+ "isSignal": true;
99
+ };
100
+ "autofocus": {
101
+ "alias": "autofocus";
102
+ "required": false;
103
+ "isSignal": true;
104
+ };
105
+ "spellcheck": {
106
+ "alias": "spellcheck";
107
+ "required": false;
108
+ "isSignal": true;
109
+ };
110
+ "ariaLabel": {
111
+ "alias": "ariaLabel";
112
+ "required": false;
113
+ "isSignal": true;
114
+ };
115
+ "describedBy": {
116
+ "alias": "describedBy";
117
+ "required": false;
118
+ "isSignal": true;
119
+ };
120
+ }, {
121
+ "value": "valueChange";
122
+ "validationState": "validationStateChange";
123
+ "focused": "focused";
124
+ "blurred": "blurred";
125
+ }, never, never, true, never>;
126
+ }
@@ -0,0 +1,61 @@
1
+ import * as i0 from "@angular/core";
2
+ import { EnvironmentProviders, InjectionToken } from "@angular/core";
3
+ import { SegmentedOption } from "@area8975/ui/segmented";
4
+ export declare class UiDarkClass {
5
+ readonly isDark: import("@angular/core").WritableSignal<boolean>;
6
+ constructor();
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiDarkClass, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
9
+ }
10
+ /** What the user picked, `system` follows the OS setting. */
11
+ export type UiThemePreference = 'system' | 'light' | 'dark';
12
+ export interface UiThemeConfig {
13
+ storageKey: string;
14
+ }
15
+ export declare const UI_THEME_CONFIG: InjectionToken<UiThemeConfig>;
16
+ /**
17
+ * Add this to `index.html`'s `<head>` so the stored theme applies before boot:
18
+ *
19
+ * ```html
20
+ * <script>
21
+ * try {
22
+ * const preference = localStorage.getItem('ui-theme') ?? 'system';
23
+ * const dark = preference === 'dark' ||
24
+ * (preference === 'system' && matchMedia('(prefers-color-scheme: dark)').matches);
25
+ * document.documentElement.classList.toggle('dark', dark);
26
+ * } catch {}
27
+ * </script>
28
+ * ```
29
+ */
30
+ export declare class UiThemeService {
31
+ private readonly document;
32
+ private readonly storageKey;
33
+ private readonly media;
34
+ readonly preference: import("@angular/core").WritableSignal<UiThemePreference>;
35
+ private readonly systemDark;
36
+ readonly isDark: import("@angular/core").Signal<boolean>;
37
+ constructor();
38
+ private stored;
39
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiThemeService, never>;
40
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
41
+ }
42
+ export declare function provideUiTheme(config?: Partial<UiThemeConfig>): EnvironmentProviders;
43
+ export declare class UiThemeSwitchComponent {
44
+ protected readonly theme: UiThemeService;
45
+ readonly ariaLabel: import("@angular/core").InputSignal<string>;
46
+ readonly fill: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
47
+ protected readonly options: SegmentedOption<UiThemePreference>[];
48
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiThemeSwitchComponent, never>;
49
+ static ɵcmp: i0.ɵɵComponentDeclaration<UiThemeSwitchComponent, "ui-theme-switch", never, {
50
+ "ariaLabel": {
51
+ "alias": "ariaLabel";
52
+ "required": false;
53
+ "isSignal": true;
54
+ };
55
+ "fill": {
56
+ "alias": "fill";
57
+ "required": false;
58
+ "isSignal": true;
59
+ };
60
+ }, {}, never, never, true, never>;
61
+ }
@@ -0,0 +1,35 @@
1
+ import { SelectLocalDataSource } from "@area8975/ui/select";
2
+ import * as i0 from "@angular/core";
3
+ export declare class UiTimeSelectComponent {
4
+ /** 24 hour "HH:mm" string. */
5
+ readonly value: import("@angular/core").ModelSignal<string>;
6
+ readonly minuteStep: import("@angular/core").InputSignal<number>;
7
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
8
+ protected readonly hours: import("@angular/core").Signal<number>;
9
+ protected readonly minutes: import("@angular/core").Signal<number>;
10
+ protected readonly hourSource: SelectLocalDataSource<number>;
11
+ protected readonly minuteSource: import("@angular/core").Signal<SelectLocalDataSource<number>>;
12
+ protected readonly pad: (value: number) => string;
13
+ protected setHours(hours: number | null): void;
14
+ protected setMinutes(minutes: number | null): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiTimeSelectComponent, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<UiTimeSelectComponent, "ui-time-select", never, {
17
+ "value": {
18
+ "alias": "value";
19
+ "required": false;
20
+ "isSignal": true;
21
+ };
22
+ "minuteStep": {
23
+ "alias": "minuteStep";
24
+ "required": false;
25
+ "isSignal": true;
26
+ };
27
+ "disabled": {
28
+ "alias": "disabled";
29
+ "required": false;
30
+ "isSignal": true;
31
+ };
32
+ }, {
33
+ "value": "valueChange";
34
+ }, never, never, true, never>;
35
+ }
@@ -0,0 +1,78 @@
1
+ import { IconType } from "@ng-icons/core";
2
+ import * as i0 from "@angular/core";
3
+ import { TemplateRef } from "@angular/core";
4
+ export declare class UiToastComponent {
5
+ readonly intent: import("@angular/core").InputSignal<"info" | "success" | "warning" | "danger">;
6
+ readonly classes: import("@angular/core").InputSignal<string>;
7
+ readonly dismissable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
8
+ /** ms before the toast dismisses itself, paused while hovered or focused. null never times out. */
9
+ readonly timeoutMs: import("@angular/core").InputSignal<number | null>;
10
+ readonly dismissed: import("@angular/core").OutputEmitterRef<void>;
11
+ protected readonly icon: import("@angular/core").Signal<IconType>;
12
+ protected readonly iconColour: import("@angular/core").Signal<string>;
13
+ protected readonly role: import("@angular/core").Signal<"alert" | "status">;
14
+ private hovered;
15
+ private focused;
16
+ private timer?;
17
+ private startedAt;
18
+ private remaining;
19
+ constructor();
20
+ protected setHovered(hovered: boolean): void;
21
+ protected setFocused(focused: boolean): void;
22
+ private updateTimer;
23
+ private startTimer;
24
+ private stopTimer;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiToastComponent, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<UiToastComponent, "ui-toast", never, {
27
+ "intent": {
28
+ "alias": "intent";
29
+ "required": false;
30
+ "isSignal": true;
31
+ };
32
+ "classes": {
33
+ "alias": "classes";
34
+ "required": false;
35
+ "isSignal": true;
36
+ };
37
+ "dismissable": {
38
+ "alias": "dismissable";
39
+ "required": false;
40
+ "isSignal": true;
41
+ };
42
+ "timeoutMs": {
43
+ "alias": "timeoutMs";
44
+ "required": false;
45
+ "isSignal": true;
46
+ };
47
+ }, {
48
+ "dismissed": "dismissed";
49
+ }, never, ["*"], true, never>;
50
+ }
51
+ export declare const ToastIntents: readonly ["info", "success", "warning", "danger"];
52
+ export type ToastIntent = typeof ToastIntents[number];
53
+ /** What a toast template receives: `let-data` for the context, `let-dismiss="dismiss"` to close it. */
54
+ export interface ToastTemplateContext<ContextType = unknown> {
55
+ $implicit: ContextType;
56
+ dismiss: () => void;
57
+ }
58
+ export type ToastMessage<ContextType = unknown> = string | TemplateRef<ToastTemplateContext<ContextType>>;
59
+ export interface Toast {
60
+ id: number;
61
+ message: ToastMessage;
62
+ templateContext: ToastTemplateContext;
63
+ intent: ToastIntent;
64
+ dismissable: boolean;
65
+ timeoutMs?: number | null;
66
+ }
67
+ export type ToastOptions<ContextType = unknown> = Partial<Pick<Toast, 'intent' | 'dismissable' | 'timeoutMs'>> & {
68
+ context?: ContextType;
69
+ };
70
+ export declare class UiToastService {
71
+ private readonly _toasts;
72
+ private nextId;
73
+ readonly toasts: import("@angular/core").Signal<Toast[]>;
74
+ show<ContextType>(message: ToastMessage<ContextType>, options?: ToastOptions<ContextType>): number;
75
+ dismiss(id: number): void;
76
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiToastService, never>;
77
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
78
+ }