@area8975/ui 0.2.2-dev.41 → 0.2.2-dev.43

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.2.2-dev.41",
3
+ "version": "0.2.2-dev.43",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.0.0",
6
6
  "@angular/core": "^22.0.0",
@@ -1525,6 +1525,10 @@ export interface SelectOptionContext<Model> {
1525
1525
  export interface SelectTriggerContext<Model> {
1526
1526
  $implicit: Model;
1527
1527
  }
1528
+ /** Context for a projected `#leading` template, inline search single select only. */
1529
+ export interface SelectLeadingContext<Model> {
1530
+ $implicit: Model;
1531
+ }
1528
1532
  /** One line in the open list. Groups are headings, the rest can be picked. */
1529
1533
  export type SelectRow<Model> = {
1530
1534
  kind: 'group';
@@ -1591,6 +1595,8 @@ export declare class UiSelectComponent<Model = unknown> {
1591
1595
  readonly hasMore: import("@angular/core").WritableSignal<boolean>;
1592
1596
  readonly optionTemplate: import("@angular/core").Signal<TemplateRef<SelectOptionContext<Model>> | undefined>;
1593
1597
  readonly triggerTemplate: import("@angular/core").Signal<TemplateRef<SelectTriggerContext<Model>> | undefined>;
1598
+ /** With an inline search, shown before the chosen item's text, e.g. its colour. Single select only. */
1599
+ readonly leadingTemplate: import("@angular/core").Signal<TemplateRef<SelectLeadingContext<Model>> | undefined>;
1594
1600
  /** Index into the pickable rows, the one keyboard focus sits on. */
1595
1601
  readonly activeIndex: import("@angular/core").WritableSignal<number>;
1596
1602
  readonly listId: string;
@@ -1599,6 +1605,9 @@ export declare class UiSelectComponent<Model = unknown> {
1599
1605
  readonly isEmpty: import("@angular/core").Signal<boolean>;
1600
1606
  /** Tags only replace the trigger text when there's no inline search box. */
1601
1607
  readonly showTags: import("@angular/core").Signal<boolean>;
1608
+ readonly showLeading: import("@angular/core").Signal<boolean>;
1609
+ /** Typing replaces the chosen item's text, so its leading content sits out the search. */
1610
+ readonly leadingHidden: import("@angular/core").Signal<boolean>;
1602
1611
  /** The text to create from, or null when there's nothing to offer. */
1603
1612
  readonly createQuery: import("@angular/core").Signal<string | null>;
1604
1613
  readonly rows: import("@angular/core").Signal<SelectRow<Model>[]>;
@@ -1763,7 +1772,7 @@ export declare class UiSelectComponent<Model = unknown> {
1763
1772
  "create": "create";
1764
1773
  "selectedItem": "selectedItemChange";
1765
1774
  "selectedItems": "selectedItemsChange";
1766
- }, ["optionTemplate", "triggerTemplate"], never, true, never>;
1775
+ }, ["optionTemplate", "triggerTemplate", "leadingTemplate"], never, true, never>;
1767
1776
  }
1768
1777
  /** Native resize values for the textarea element. */
1769
1778
  export declare const TextareaResizeOptions: readonly ["none", "both", "horizontal", "vertical"];
@@ -2899,12 +2908,16 @@ export interface TableColumn<Row> {
2899
2908
  /** unique key, used for sorting/filtering/visibility/pinning/reordering */
2900
2909
  id: string;
2901
2910
  header: string;
2911
+ /** the cell's value, used for sorting and filtering even when a `uiTableCell` template draws the cell */
2902
2912
  accessor: (row: Row) => unknown;
2903
2913
  /** how the cell value is formatted for display, defaults to plain text */
2904
2914
  displayType?: TableColumnDisplayType;
2905
2915
  /** ISO currency code, used when displayType is 'currency'. Defaults to the currency from `provideUiFormat`. */
2906
2916
  currency?: string;
2907
- /** Masks the cell in privacy mode, e.g. a transaction's description. Currency cells are already masked, icon cells have no text. */
2917
+ /**
2918
+ * Masks the cell in privacy mode, e.g. a transaction's description. Currency cells are already masked, icon cells have no text.
2919
+ * A `uiTableCell` template is replaced by the mask too.
2920
+ */
2908
2921
  sensitive?: boolean;
2909
2922
  sortable?: boolean;
2910
2923
  filterable?: boolean;
@@ -2920,6 +2933,12 @@ export interface TableColumn<Row> {
2920
2933
  /** false excludes the column from the visibility toggle menu */
2921
2934
  hideable?: boolean;
2922
2935
  }
2936
+ /** Context for a `uiTableCell` template. */
2937
+ export interface TableCellContext<Row> {
2938
+ $implicit: Row;
2939
+ /** what the column's accessor gives for the row */
2940
+ value: unknown;
2941
+ }
2923
2942
  export interface TableRowAction<Row> {
2924
2943
  id: string;
2925
2944
  label: string;
@@ -2983,6 +3002,12 @@ export declare class UiTableComponent<Row = unknown> implements OnInit, OnDestro
2983
3002
  readonly reorderableColumns: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
2984
3003
  readonly reorderableRows: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
2985
3004
  readonly stickyHeader: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
3005
+ /** Leaves out the header row, for rows that read on their own. A `uiTableBar` can still select every row. */
3006
+ readonly headerless: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
3007
+ private readonly bar;
3008
+ protected readonly hasBar: import("@angular/core").Signal<boolean>;
3009
+ /** 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. */
3010
+ readonly groupHeading: import("@angular/core").InputSignal<((row: Row) => string) | null>;
2986
3011
  readonly actions: import("@angular/core").InputSignal<TableRowAction<Row>[]>;
2987
3012
  readonly sort: import("@angular/core").ModelSignal<TableSortState | null>;
2988
3013
  readonly selectedRowIds: import("@angular/core").ModelSignal<Set<unknown>>;
@@ -3004,6 +3029,8 @@ export declare class UiTableComponent<Row = unknown> implements OnInit, OnDestro
3004
3029
  protected readonly dragOverColumnId: import("@angular/core").WritableSignal<string | null>;
3005
3030
  protected readonly dragPreview: import("@angular/core").WritableSignal<ColumnDragPreview | null>;
3006
3031
  protected readonly draggedRowIndex: import("@angular/core").WritableSignal<number | null>;
3032
+ private readonly cellDirectives;
3033
+ protected readonly cellTemplates: import("@angular/core").Signal<Map<string, TemplateRef<TableCellContext<unknown>>>>;
3007
3034
  readonly isEmpty: import("@angular/core").Signal<boolean>;
3008
3035
  readonly generatedClasses: import("@angular/core").Signal<string>;
3009
3036
  protected readonly orderedColumns: import("@angular/core").Signal<TableColumn<Row>[]>;
@@ -3014,13 +3041,16 @@ export declare class UiTableComponent<Row = unknown> implements OnInit, OnDestro
3014
3041
  protected readonly hasFilterableColumns: import("@angular/core").Signal<boolean>;
3015
3042
  protected readonly activeFilterCount: import("@angular/core").Signal<number>;
3016
3043
  protected readonly hasActions: import("@angular/core").Signal<boolean>;
3044
+ protected readonly columnSpan: import("@angular/core").Signal<number>;
3045
+ /** Each row's heading, or null when it continues the run above it. */
3046
+ protected readonly groupHeadings: import("@angular/core").Signal<(string | null)[]>;
3017
3047
  private readonly hasSensitiveColumns;
3018
3048
  protected readonly fixedWidth: import("@angular/core").Signal<number | null>;
3019
3049
  protected readonly actionsColumnWidth: import("@angular/core").Signal<number>;
3020
3050
  protected readonly totalPages: import("@angular/core").Signal<number>;
3021
3051
  protected readonly resultsLabel: import("@angular/core").Signal<string>;
3022
- protected readonly allSelected: import("@angular/core").Signal<boolean>;
3023
- protected readonly someSelected: import("@angular/core").Signal<boolean>;
3052
+ readonly allSelected: import("@angular/core").Signal<boolean>;
3053
+ readonly someSelected: import("@angular/core").Signal<boolean>;
3024
3054
  private readonly leftOffsets;
3025
3055
  private readonly rightOffsets;
3026
3056
  private readonly load$;
@@ -3029,8 +3059,10 @@ export declare class UiTableComponent<Row = unknown> implements OnInit, OnDestro
3029
3059
  private readonly registry;
3030
3060
  protected readonly uiFormat: import("@area8975/ui").UiFormat;
3031
3061
  private readonly privateText;
3062
+ protected readonly privacy: import("@angular/core").Signal<"visible" | "discreet" | "hidden">;
3032
3063
  private loadedQuery;
3033
3064
  private loadedFilters;
3065
+ private loadedSort;
3034
3066
  private resizeState;
3035
3067
  private columnDragState;
3036
3068
  private readonly filterDataSources;
@@ -3058,7 +3090,7 @@ export declare class UiTableComponent<Row = unknown> implements OnInit, OnDestro
3058
3090
  protected toggleColumnVisibility(column: TableColumn<Row>): void;
3059
3091
  protected isRowSelected(row: Row, index: number): boolean;
3060
3092
  protected toggleRow(row: Row, index: number): void;
3061
- protected toggleSelectAll(): void;
3093
+ toggleSelectAll(): void;
3062
3094
  protected columnWidth(column: TableColumn<Row>): number;
3063
3095
  protected isPinned(column: TableColumn<Row>): boolean;
3064
3096
  protected leftOffset(column: TableColumn<Row>): number | null;
@@ -3160,6 +3192,16 @@ export declare class UiTableComponent<Row = unknown> implements OnInit, OnDestro
3160
3192
  "required": false;
3161
3193
  "isSignal": true;
3162
3194
  };
3195
+ "headerless": {
3196
+ "alias": "headerless";
3197
+ "required": false;
3198
+ "isSignal": true;
3199
+ };
3200
+ "groupHeading": {
3201
+ "alias": "groupHeading";
3202
+ "required": false;
3203
+ "isSignal": true;
3204
+ };
3163
3205
  "actions": {
3164
3206
  "alias": "actions";
3165
3207
  "required": false;
@@ -3180,7 +3222,31 @@ export declare class UiTableComponent<Row = unknown> implements OnInit, OnDestro
3180
3222
  "selectedRowIds": "selectedRowIdsChange";
3181
3223
  "selectionChange": "selectionChange";
3182
3224
  "rowsReordered": "rowsReordered";
3183
- }, never, never, true, never>;
3225
+ }, ["bar", "cellDirectives"], ["[uiTableBar]"], true, never>;
3226
+ }
3227
+ /**
3228
+ * Draws a column's cells in place of its formatted value, matched by column id:
3229
+ * `<ng-template uiTableCell="description" let-row>`. The accessor stays the cell's value.
3230
+ */
3231
+ export declare class UiTableCellDirective {
3232
+ readonly columnId: import("@angular/core").InputSignal<string>;
3233
+ readonly template: TemplateRef<TableCellContext<unknown>>;
3234
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiTableCellDirective, never>;
3235
+ static ɵdir: i0.ɵɵDirectiveDeclaration<UiTableCellDirective, "ng-template[uiTableCell]", never, {
3236
+ "columnId": {
3237
+ "alias": "uiTableCell";
3238
+ "required": true;
3239
+ "isSignal": true;
3240
+ };
3241
+ }, {}, never, never, true, never>;
3242
+ }
3243
+ /**
3244
+ * Content for a bar along the top of the table, e.g. a count and a sort control above a
3245
+ * `headerless` list: `<div uiTableBar>`. With `selectable`, the bar also selects every row.
3246
+ */
3247
+ export declare class UiTableBarDirective {
3248
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiTableBarDirective, never>;
3249
+ static ɵdir: i0.ɵɵDirectiveDeclaration<UiTableBarDirective, "[uiTableBar]", never, {}, {}, never, never, true, never>;
3184
3250
  }
3185
3251
  export interface UiLinkedTable {
3186
3252
  readonly query: WritableSignal<string>;