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

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.42",
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;
@@ -3004,6 +3023,8 @@ export declare class UiTableComponent<Row = unknown> implements OnInit, OnDestro
3004
3023
  protected readonly dragOverColumnId: import("@angular/core").WritableSignal<string | null>;
3005
3024
  protected readonly dragPreview: import("@angular/core").WritableSignal<ColumnDragPreview | null>;
3006
3025
  protected readonly draggedRowIndex: import("@angular/core").WritableSignal<number | null>;
3026
+ private readonly cellDirectives;
3027
+ protected readonly cellTemplates: import("@angular/core").Signal<Map<string, TemplateRef<TableCellContext<unknown>>>>;
3007
3028
  readonly isEmpty: import("@angular/core").Signal<boolean>;
3008
3029
  readonly generatedClasses: import("@angular/core").Signal<string>;
3009
3030
  protected readonly orderedColumns: import("@angular/core").Signal<TableColumn<Row>[]>;
@@ -3029,6 +3050,7 @@ export declare class UiTableComponent<Row = unknown> implements OnInit, OnDestro
3029
3050
  private readonly registry;
3030
3051
  protected readonly uiFormat: import("@area8975/ui").UiFormat;
3031
3052
  private readonly privateText;
3053
+ protected readonly privacy: import("@angular/core").Signal<"visible" | "discreet" | "hidden">;
3032
3054
  private loadedQuery;
3033
3055
  private loadedFilters;
3034
3056
  private resizeState;
@@ -3180,7 +3202,23 @@ export declare class UiTableComponent<Row = unknown> implements OnInit, OnDestro
3180
3202
  "selectedRowIds": "selectedRowIdsChange";
3181
3203
  "selectionChange": "selectionChange";
3182
3204
  "rowsReordered": "rowsReordered";
3183
- }, never, never, true, never>;
3205
+ }, ["cellDirectives"], never, true, never>;
3206
+ }
3207
+ /**
3208
+ * Draws a column's cells in place of its formatted value, matched by column id:
3209
+ * `<ng-template uiTableCell="description" let-row>`. The accessor stays the cell's value.
3210
+ */
3211
+ export declare class UiTableCellDirective {
3212
+ readonly columnId: import("@angular/core").InputSignal<string>;
3213
+ readonly template: TemplateRef<TableCellContext<unknown>>;
3214
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiTableCellDirective, never>;
3215
+ static ɵdir: i0.ɵɵDirectiveDeclaration<UiTableCellDirective, "ng-template[uiTableCell]", never, {
3216
+ "columnId": {
3217
+ "alias": "uiTableCell";
3218
+ "required": true;
3219
+ "isSignal": true;
3220
+ };
3221
+ }, {}, never, never, true, never>;
3184
3222
  }
3185
3223
  export interface UiLinkedTable {
3186
3224
  readonly query: WritableSignal<string>;