@coolon/angular-ui-powerups 16.1.0-alpha.266 → 16.1.0-alpha.268

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 (23) hide show
  1. package/esm2022/lib/components/components.module.mjs +27 -5
  2. package/esm2022/lib/components/exports.mjs +3 -1
  3. package/esm2022/lib/components/forms/sub-form-list/sub-form-list.component.mjs +260 -0
  4. package/esm2022/lib/components/forms/sub-form-list/sub-form-row.directive.mjs +63 -0
  5. package/esm2022/lib/components/tables/abstract-table-model.mjs +8 -4
  6. package/esm2022/lib/components/tables/column/column-model.mjs +13 -1
  7. package/esm2022/lib/components/tables/column/custom-value-column-model.mjs +5 -1
  8. package/esm2022/lib/components/tables/column/list-propery-column-model.mjs +5 -1
  9. package/esm2022/lib/components/tables/column/property-column-model.mjs +5 -1
  10. package/esm2022/lib/components/tables/filter/enable-cell-text-search.decorator.mjs +8 -2
  11. package/esm2022/lib/components/tables/filter/table-filter-model.mjs +8 -6
  12. package/esm2022/lib/components/tables/filter/text-search-predicate.mjs +2 -17
  13. package/fesm2022/coolon-angular-ui-powerups.mjs +384 -35
  14. package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
  15. package/lib/components/components.module.d.ts +25 -22
  16. package/lib/components/exports.d.ts +2 -0
  17. package/lib/components/forms/sub-form-list/sub-form-list.component.d.ts +127 -0
  18. package/lib/components/forms/sub-form-list/sub-form-row.directive.d.ts +61 -0
  19. package/lib/components/tables/abstract-table-model.d.ts +1 -1
  20. package/lib/components/tables/column/column-model.d.ts +7 -0
  21. package/lib/components/tables/filter/enable-cell-text-search.decorator.d.ts +16 -1
  22. package/lib/components/tables/filter/text-search-predicate.d.ts +16 -10
  23. package/package.json +3 -3
@@ -55,29 +55,32 @@ import * as i53 from "./forms/search-input/search-input.component";
55
55
  import * as i54 from "./tables/renderer/table-footer-row/table-footer-row.component";
56
56
  import * as i55 from "./file/file-download/file-download.component";
57
57
  import * as i56 from "./commands/button-renderer/button-renderer.component";
58
- import * as i57 from "@angular/common";
59
- import * as i58 from "@angular/platform-browser/animations";
60
- import * as i59 from "@angular/forms";
61
- import * as i60 from "@angular/material/input";
62
- import * as i61 from "@angular/material/form-field";
63
- import * as i62 from "@angular/material/select";
64
- import * as i63 from "@angular/material/tabs";
65
- import * as i64 from "../directives/directives.module";
66
- import * as i65 from "@angular/material/icon";
67
- import * as i66 from "@angular/material/button";
68
- import * as i67 from "@angular/material/checkbox";
69
- import * as i68 from "@angular/material/table";
70
- import * as i69 from "@angular/cdk/portal";
71
- import * as i70 from "@angular/cdk/scrolling";
72
- import * as i71 from "@angular/material/tooltip";
73
- import * as i72 from "@angular/material/autocomplete";
74
- import * as i73 from "@angular/material/menu";
75
- import * as i74 from "@angular/material/divider";
76
- import * as i75 from "@angular/material/progress-spinner";
77
- import * as i76 from "@angular/material/progress-bar";
78
- import * as i77 from "ng-table-virtual-scroll";
58
+ import * as i57 from "./forms/sub-form-list/sub-form-list.component";
59
+ import * as i58 from "./forms/sub-form-list/sub-form-row.directive";
60
+ import * as i59 from "@angular/common";
61
+ import * as i60 from "@angular/platform-browser/animations";
62
+ import * as i61 from "@angular/forms";
63
+ import * as i62 from "@angular/material/input";
64
+ import * as i63 from "@angular/material/form-field";
65
+ import * as i64 from "@angular/material/select";
66
+ import * as i65 from "@angular/material/tabs";
67
+ import * as i66 from "../directives/directives.module";
68
+ import * as i67 from "@angular/material/icon";
69
+ import * as i68 from "@angular/material/button";
70
+ import * as i69 from "@angular/material/checkbox";
71
+ import * as i70 from "@angular/material/table";
72
+ import * as i71 from "@angular/cdk/portal";
73
+ import * as i72 from "@angular/cdk/scrolling";
74
+ import * as i73 from "@angular/material/tooltip";
75
+ import * as i74 from "@angular/material/autocomplete";
76
+ import * as i75 from "@angular/material/menu";
77
+ import * as i76 from "@angular/material/divider";
78
+ import * as i77 from "@angular/material/progress-spinner";
79
+ import * as i78 from "@angular/material/progress-bar";
80
+ import * as i79 from "ng-table-virtual-scroll";
81
+ import * as i80 from "@angular/cdk/drag-drop";
79
82
  export declare class ComponentsModule {
80
83
  static ɵfac: i0.ɵɵFactoryDeclaration<ComponentsModule, never>;
81
- static ɵmod: i0.ɵɵNgModuleDeclaration<ComponentsModule, [typeof i1.AbstractInputComponent, typeof i2.AbstractValueInputComponent, typeof i3.AbstractListInputComponent, typeof i4.NumberInputComponent, typeof i5.StringInputComponent, typeof i6.TextInputComponent, typeof i7.PasswordInputComponent, typeof i8.SelectInputComponent, typeof i9.MultipleSelectInputComponent, typeof i10.AutocompleteInputComponent, typeof i11.CheckboxInputComponent, typeof i12.ScrollContainerComponent, typeof i13.NoopComponent, typeof i14.SwitchCaseComponent, typeof i14.SwitchCaseWhenDirective, typeof i14.SwitchCaseDefaultDirective, typeof i15.FocusContainerComponent, typeof i16.VerticalFocusContainerComponent, typeof i17.FocusableComponent, typeof i18.CardContainerComponent, typeof i19.TableComponent, typeof i20.TableRowAttributesDirective, typeof i21.ColumnTemplateDirective, typeof i22.DefaultCellRendererComponent, typeof i23.TableCellComponent, typeof i24.SelectionCellComponent, typeof i25.SelectionHeaderCellComponent, typeof i26.DefaultHeaderCellRendererComponent, typeof i27.TableHeaderCellComponent, typeof i28.IconComponent, typeof i29.SectionHeaderComponent, typeof i30.TableActionColumnComponent, typeof i31.ToolBarComponent, typeof i32.CommandComponent, typeof i33.PopupMenuComponent, typeof i34.CommandFaceComponent, typeof i35.MoreMenuComponent, typeof i36.SeparatorComponent, typeof i37.FlexComponent, typeof i38.AbstractPopupMenuComponent, typeof i39.PopupMenuRendererComponent, typeof i40.TreeTableComponent, typeof i41.TreeInheritanceIconComponent, typeof i42.TreeLabelCellRendererComponent, typeof i43.BusyOverlayComponent, typeof i44.EmptyStateComponent, typeof i45.PaginatorComponent, typeof i46.AbstractTableComponent, typeof i47.AbstractCardContainerComponent, typeof i48.LabelledValueComponent, typeof i49.LoadingContainerComponent, typeof i50.MarkdownComponent, typeof i20.TableBodyComponent, typeof i51.TableCustomMoreMenuComponent, typeof i52.TableCustomMoreMenuPopupComponent, typeof i53.SearchInputComponent, typeof i54.TableFooterRow, typeof i55.FileDownloadComponent, typeof i56.ButtonRendererComponent], [typeof i57.CommonModule, typeof i58.BrowserAnimationsModule, typeof i59.FormsModule, typeof i60.MatInputModule, typeof i61.MatFormFieldModule, typeof i62.MatSelectModule, typeof i63.MatTabsModule, typeof i64.DirectivesModule, typeof i65.MatIconModule, typeof i66.MatButtonModule, typeof i67.MatCheckboxModule, typeof i68.MatTableModule, typeof i69.PortalModule, typeof i70.CdkScrollableModule, typeof i71.MatTooltipModule, typeof i72.MatAutocompleteModule, typeof i73.MatMenuModule, typeof i74.MatDividerModule, typeof i75.MatProgressSpinnerModule, typeof i76.MatProgressBarModule, typeof i70.ScrollingModule, typeof i77.TableVirtualScrollModule], [typeof i56.ButtonRendererComponent, typeof i55.FileDownloadComponent, typeof i54.TableFooterRow, typeof i4.NumberInputComponent, typeof i5.StringInputComponent, typeof i6.TextInputComponent, typeof i7.PasswordInputComponent, typeof i11.CheckboxInputComponent, typeof i8.SelectInputComponent, typeof i9.MultipleSelectInputComponent, typeof i10.AutocompleteInputComponent, typeof i12.ScrollContainerComponent, typeof i13.NoopComponent, typeof i14.SwitchCaseComponent, typeof i14.SwitchCaseWhenDirective, typeof i14.SwitchCaseDefaultDirective, typeof i15.FocusContainerComponent, typeof i16.VerticalFocusContainerComponent, typeof i17.FocusableComponent, typeof i18.CardContainerComponent, typeof i19.TableComponent, typeof i21.ColumnTemplateDirective, typeof i28.IconComponent, typeof i29.SectionHeaderComponent, typeof i30.TableActionColumnComponent, typeof i31.ToolBarComponent, typeof i32.CommandComponent, typeof i33.PopupMenuComponent, typeof i34.CommandFaceComponent, typeof i35.MoreMenuComponent, typeof i36.SeparatorComponent, typeof i37.FlexComponent, typeof i40.TreeTableComponent, typeof i43.BusyOverlayComponent, typeof i44.EmptyStateComponent, typeof i45.PaginatorComponent, typeof i48.LabelledValueComponent, typeof i49.LoadingContainerComponent, typeof i50.MarkdownComponent, typeof i51.TableCustomMoreMenuComponent, typeof i52.TableCustomMoreMenuPopupComponent, typeof i53.SearchInputComponent, typeof i56.ButtonRendererComponent]>;
84
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ComponentsModule, [typeof i1.AbstractInputComponent, typeof i2.AbstractValueInputComponent, typeof i3.AbstractListInputComponent, typeof i4.NumberInputComponent, typeof i5.StringInputComponent, typeof i6.TextInputComponent, typeof i7.PasswordInputComponent, typeof i8.SelectInputComponent, typeof i9.MultipleSelectInputComponent, typeof i10.AutocompleteInputComponent, typeof i11.CheckboxInputComponent, typeof i12.ScrollContainerComponent, typeof i13.NoopComponent, typeof i14.SwitchCaseComponent, typeof i14.SwitchCaseWhenDirective, typeof i14.SwitchCaseDefaultDirective, typeof i15.FocusContainerComponent, typeof i16.VerticalFocusContainerComponent, typeof i17.FocusableComponent, typeof i18.CardContainerComponent, typeof i19.TableComponent, typeof i20.TableRowAttributesDirective, typeof i21.ColumnTemplateDirective, typeof i22.DefaultCellRendererComponent, typeof i23.TableCellComponent, typeof i24.SelectionCellComponent, typeof i25.SelectionHeaderCellComponent, typeof i26.DefaultHeaderCellRendererComponent, typeof i27.TableHeaderCellComponent, typeof i28.IconComponent, typeof i29.SectionHeaderComponent, typeof i30.TableActionColumnComponent, typeof i31.ToolBarComponent, typeof i32.CommandComponent, typeof i33.PopupMenuComponent, typeof i34.CommandFaceComponent, typeof i35.MoreMenuComponent, typeof i36.SeparatorComponent, typeof i37.FlexComponent, typeof i38.AbstractPopupMenuComponent, typeof i39.PopupMenuRendererComponent, typeof i40.TreeTableComponent, typeof i41.TreeInheritanceIconComponent, typeof i42.TreeLabelCellRendererComponent, typeof i43.BusyOverlayComponent, typeof i44.EmptyStateComponent, typeof i45.PaginatorComponent, typeof i46.AbstractTableComponent, typeof i47.AbstractCardContainerComponent, typeof i48.LabelledValueComponent, typeof i49.LoadingContainerComponent, typeof i50.MarkdownComponent, typeof i20.TableBodyComponent, typeof i51.TableCustomMoreMenuComponent, typeof i52.TableCustomMoreMenuPopupComponent, typeof i53.SearchInputComponent, typeof i54.TableFooterRow, typeof i55.FileDownloadComponent, typeof i56.ButtonRendererComponent, typeof i57.SubFormListComponent, typeof i58.SubFormRowDirective, typeof i58.SubFormRowActionsDirective, typeof i58.SubFormListEmptyDirective], [typeof i59.CommonModule, typeof i60.BrowserAnimationsModule, typeof i61.FormsModule, typeof i62.MatInputModule, typeof i63.MatFormFieldModule, typeof i64.MatSelectModule, typeof i65.MatTabsModule, typeof i66.DirectivesModule, typeof i67.MatIconModule, typeof i68.MatButtonModule, typeof i69.MatCheckboxModule, typeof i70.MatTableModule, typeof i71.PortalModule, typeof i72.CdkScrollableModule, typeof i73.MatTooltipModule, typeof i74.MatAutocompleteModule, typeof i75.MatMenuModule, typeof i76.MatDividerModule, typeof i77.MatProgressSpinnerModule, typeof i78.MatProgressBarModule, typeof i72.ScrollingModule, typeof i79.TableVirtualScrollModule, typeof i80.DragDropModule], [typeof i56.ButtonRendererComponent, typeof i55.FileDownloadComponent, typeof i54.TableFooterRow, typeof i4.NumberInputComponent, typeof i5.StringInputComponent, typeof i6.TextInputComponent, typeof i7.PasswordInputComponent, typeof i11.CheckboxInputComponent, typeof i8.SelectInputComponent, typeof i9.MultipleSelectInputComponent, typeof i10.AutocompleteInputComponent, typeof i12.ScrollContainerComponent, typeof i13.NoopComponent, typeof i14.SwitchCaseComponent, typeof i14.SwitchCaseWhenDirective, typeof i14.SwitchCaseDefaultDirective, typeof i15.FocusContainerComponent, typeof i16.VerticalFocusContainerComponent, typeof i17.FocusableComponent, typeof i18.CardContainerComponent, typeof i19.TableComponent, typeof i21.ColumnTemplateDirective, typeof i28.IconComponent, typeof i29.SectionHeaderComponent, typeof i30.TableActionColumnComponent, typeof i31.ToolBarComponent, typeof i32.CommandComponent, typeof i33.PopupMenuComponent, typeof i34.CommandFaceComponent, typeof i35.MoreMenuComponent, typeof i36.SeparatorComponent, typeof i37.FlexComponent, typeof i40.TreeTableComponent, typeof i43.BusyOverlayComponent, typeof i44.EmptyStateComponent, typeof i45.PaginatorComponent, typeof i48.LabelledValueComponent, typeof i49.LoadingContainerComponent, typeof i50.MarkdownComponent, typeof i51.TableCustomMoreMenuComponent, typeof i52.TableCustomMoreMenuPopupComponent, typeof i53.SearchInputComponent, typeof i56.ButtonRendererComponent, typeof i57.SubFormListComponent, typeof i58.SubFormRowDirective, typeof i58.SubFormRowActionsDirective, typeof i58.SubFormListEmptyDirective]>;
82
85
  static ɵinj: i0.ɵɵInjectorDeclaration<ComponentsModule>;
83
86
  }
@@ -41,6 +41,8 @@ export * from "./forms/password-input/password-input.component";
41
41
  export * from "./forms/search-input/search-input.component";
42
42
  export * from "./forms/select-input/select-input.component";
43
43
  export * from "./forms/string-input/string-input.component";
44
+ export * from "./forms/sub-form-list/sub-form-list.component";
45
+ export * from "./forms/sub-form-list/sub-form-row.directive";
44
46
  export * from "./forms/text-input/text-input.component";
45
47
  export * from "./icon/icon.component";
46
48
  export * from "./labelled-value/labelled-value.component";
@@ -0,0 +1,127 @@
1
+ import { CdkDragDrop } from '@angular/cdk/drag-drop';
2
+ import { Command, CommandFace, SubFormList, ValueModel } from '@coolon/pectin';
3
+ import { Enum } from 'typescript-string-enums';
4
+ import { DisposableComponent } from '../../disposable-component';
5
+ import { SubFormListEmptyDirective, SubFormRowActionsDirective, SubFormRowContext, SubFormRowDirective } from './sub-form-row.directive';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Renders a pectin {@link SubFormList} as a stack of rows, each carrying its own remove and — when
9
+ * the list is user-ordered — reordering affordances.
10
+ *
11
+ * The list already owns the behaviour: one sub-form per array element, per-row `removeItemCommand`
12
+ * / `moveUpCommand` / `moveDownCommand` gated at the ends, and `move(subForm, toIndex)`. What this
13
+ * component removes is the boilerplate that was otherwise copied into every consumer — the
14
+ * `*ngFor` over `subForms$.value`, three hand-wired `aup-command`s per row with hand-held
15
+ * {@link CommandFace} constants, and the empty state.
16
+ *
17
+ * @example
18
+ * ```html
19
+ * <aup-sub-form-list [list]="levels" [addCommand]="addLevelCommand" emptyText="No levels">
20
+ * <ng-template aupSubFormRow let-row>
21
+ * <aup-string-input label="Name" [dense]="true" [value$]="row.name$"></aup-string-input>
22
+ * </ng-template>
23
+ * </aup-sub-form-list>
24
+ * ```
25
+ *
26
+ * Bind `list` once. Re-binding it after init leaves the change-detection wiring pointed at the
27
+ * previous list, which is not a scenario a form has — the list is built in the component's
28
+ * constructor and lives as long as the form does.
29
+ */
30
+ export declare class SubFormListComponent<T extends object = any, B extends SubFormList.Fields = SubFormList.Fields> extends DisposableComponent {
31
+ list: SubFormList<T, B>;
32
+ /**
33
+ * Which reordering affordances to offer. `AUTO` — the default — resolves to {@link Reorder.BOTH}
34
+ * for a user-ordered list and {@link Reorder.NONE} otherwise.
35
+ *
36
+ * Every mode is additionally gated on `list.reorderable`: asking for drag or buttons on a list
37
+ * whose order is *derived* (`orderBy`) is refused with a console warning, because the next load
38
+ * would re-derive the order and silently undo the move.
39
+ */
40
+ reorder: SubFormListComponent.Reorder;
41
+ accessor removable$: ValueModel<boolean>;
42
+ /** Whether rows can be removed — the seam for permission-gating removal via `removable$`. */
43
+ accessor removable: boolean;
44
+ /**
45
+ * Faces for the default action cluster. They ship icon-only with a tooltip, which is what makes
46
+ * `aup-command` render them as `mat-icon-button`s; supply text as well to get labelled buttons.
47
+ * The defaults are English — aup has no i18n, so a localised app overrides them here.
48
+ */
49
+ removeFace: CommandFace;
50
+ moveUpFace: CommandFace;
51
+ moveDownFace: CommandFace;
52
+ dragHandleIcon: string;
53
+ /** Rendered in the footer below the rows. Optional — callers who site their own add button omit it. */
54
+ accessor addCommand: Command;
55
+ /** Shown when the list is empty. Omit both this and an `aupSubFormListEmpty` template for no empty state. */
56
+ emptyText: string;
57
+ dense: boolean;
58
+ /**
59
+ * Gives the row's content the remaining width instead of sizing it to its fields. Off by
60
+ * default, so a row of dense inputs hugs them rather than stranding the action cluster at the
61
+ * far edge of the list; turn it on for a row whose single field should span the width.
62
+ */
63
+ fill: boolean;
64
+ rowTemplate: SubFormRowDirective;
65
+ actionsTemplate: SubFormRowActionsDirective;
66
+ emptyTemplate: SubFormListEmptyDirective;
67
+ /** The array `rows` was last built from — see the comment there. */
68
+ private renderedSource;
69
+ private renderedRows;
70
+ constructor();
71
+ /**
72
+ * The row contexts, rebuilt only when the list's shape changes.
73
+ *
74
+ * `subForms$` publishes a fresh array on every membership/order change and never otherwise, so
75
+ * array identity is an exact shape-change signal. Memoising on it keeps the context objects
76
+ * stable across the change-detection passes a keystroke causes, which stops `ngTemplateOutlet`
77
+ * from churning the row's bindings while the user is typing in it.
78
+ */
79
+ get rows(): SubFormRowContext<SubFormList.ItemSubForm<T, B>>[];
80
+ get listErrors(): ReadonlyArray<string>;
81
+ get empty(): boolean;
82
+ get hasAddCommand(): boolean;
83
+ /** `AUTO` resolved against the list; every other mode passes through for the gates below. */
84
+ private get resolvedReorder();
85
+ /**
86
+ * True for every mode that reorders at all, {@link Reorder.DRAG} included — see
87
+ * {@link dragEnabled} for why drag never stands alone. `DRAG` only changes how prominent the
88
+ * buttons are, via {@link buttonsOnDemand}.
89
+ */
90
+ get moveButtonsVisible(): boolean;
91
+ /**
92
+ * Drag stays off unless the order is the data. It is also *never* the only reordering affordance
93
+ * offered by the default cluster: CDK drag is pointer-only, so removing the move buttons in
94
+ * {@link Reorder.DRAG} mode would leave keyboard and screen-reader users unable to reorder at
95
+ * all. `DRAG` hides the buttons until the row is hovered or holds focus; it does not delete them.
96
+ */
97
+ get dragEnabled(): boolean;
98
+ get buttonsOnDemand(): boolean;
99
+ get hasActions(): boolean;
100
+ trackByRow(index: number, context: SubFormRowContext): unknown;
101
+ /**
102
+ * CDK reports `currentIndex` after the dragged row has been taken out of the list, which is the
103
+ * same convention {@link SubFormList#move} splices with — so the index passes straight through,
104
+ * with no local array to keep in step. The list republishes `subForms$` itself; the explicit
105
+ * `markForCheck` is what gets that repaint scheduled before CDK's drop animation settles, so the
106
+ * row does not visibly snap back to where it started.
107
+ */
108
+ onDropped(event: CdkDragDrop<unknown>): void;
109
+ private warnAboutUnsupportedReordering;
110
+ static ɵfac: i0.ɵɵFactoryDeclaration<SubFormListComponent<any, any>, never>;
111
+ static ɵcmp: i0.ɵɵComponentDeclaration<SubFormListComponent<any, any>, "aup-sub-form-list", never, { "list": { "alias": "list"; "required": false; }; "reorder": { "alias": "reorder"; "required": false; }; "removable$": { "alias": "removable$"; "required": false; }; "removable": { "alias": "removable"; "required": false; }; "removeFace": { "alias": "removeFace"; "required": false; }; "moveUpFace": { "alias": "moveUpFace"; "required": false; }; "moveDownFace": { "alias": "moveDownFace"; "required": false; }; "dragHandleIcon": { "alias": "dragHandleIcon"; "required": false; }; "addCommand": { "alias": "addCommand"; "required": false; }; "emptyText": { "alias": "emptyText"; "required": false; }; "dense": { "alias": "dense"; "required": false; }; "fill": { "alias": "fill"; "required": false; }; }, {}, ["rowTemplate", "actionsTemplate", "emptyTemplate"], never, false, never>;
112
+ }
113
+ export declare namespace SubFormListComponent {
114
+ const Reorder: {
115
+ /** Buttons and drag when the list is user-ordered; nothing when it isn't. */
116
+ AUTO: "auto";
117
+ NONE: "none";
118
+ BUTTONS: "buttons";
119
+ /** Drag handles, with the move buttons revealed on hover/focus as the keyboard path. */
120
+ DRAG: "drag";
121
+ BOTH: "both";
122
+ };
123
+ type Reorder = Enum<typeof Reorder>;
124
+ const DEFAULT_REMOVE_FACE: CommandFace;
125
+ const DEFAULT_MOVE_UP_FACE: CommandFace;
126
+ const DEFAULT_MOVE_DOWN_FACE: CommandFace;
127
+ }
@@ -0,0 +1,61 @@
1
+ import { TemplateRef } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * The context handed to every `aup-sub-form-list` row template.
5
+ *
6
+ * `index`/`first`/`last`/`count` describe the row's place in the list *as rendered*, which under an
7
+ * ordering mode is also its place in the data. These are recomputed only when the list's shape
8
+ * changes, so the context object handed to a given row is stable between shape changes — bindings
9
+ * inside the row template are not torn down by an unrelated keystroke elsewhere in the list.
10
+ */
11
+ export interface SubFormRowContext<R = any> {
12
+ /** The row's sub-form — `let-row` in the template. */
13
+ $implicit: R;
14
+ /** The same sub-form, for templates that prefer `let-row="row"`. */
15
+ row: R;
16
+ index: number;
17
+ first: boolean;
18
+ last: boolean;
19
+ count: number;
20
+ }
21
+ /**
22
+ * Marks the template rendered as the body of each sub-form row.
23
+ *
24
+ * @example
25
+ * ```html
26
+ * <aup-sub-form-list [list]="levels">
27
+ * <ng-template aupSubFormRow let-row>
28
+ * <aup-string-input label="Name" [dense]="true" [value$]="row.name$"></aup-string-input>
29
+ * </ng-template>
30
+ * </aup-sub-form-list>
31
+ * ```
32
+ */
33
+ export declare class SubFormRowDirective {
34
+ readonly templateRef: TemplateRef<SubFormRowContext>;
35
+ constructor(templateRef: TemplateRef<SubFormRowContext>);
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<SubFormRowDirective, never>;
37
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SubFormRowDirective, "[aupSubFormRow]", never, {}, {}, never, never, false, never>;
38
+ }
39
+ /**
40
+ * Replaces the whole per-row action cluster (move up / move down / remove).
41
+ *
42
+ * Reach for this only when the default cluster's *composition* is wrong — an extra per-row command,
43
+ * or a menu instead of buttons. To change how the standard three look, bind `removeFace`,
44
+ * `moveUpFace` and `moveDownFace` instead and keep the layout, gating and drag interop.
45
+ *
46
+ * The commands are on the row sub-form itself (`removeItemCommand`, `moveUpCommand`,
47
+ * `moveDownCommand`), so the context is the same one the row template gets.
48
+ */
49
+ export declare class SubFormRowActionsDirective {
50
+ readonly templateRef: TemplateRef<SubFormRowContext>;
51
+ constructor(templateRef: TemplateRef<SubFormRowContext>);
52
+ static ɵfac: i0.ɵɵFactoryDeclaration<SubFormRowActionsDirective, never>;
53
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SubFormRowActionsDirective, "[aupSubFormRowActions]", never, {}, {}, never, never, false, never>;
54
+ }
55
+ /** Replaces the default empty state, shown while the list has no rows. */
56
+ export declare class SubFormListEmptyDirective {
57
+ readonly templateRef: TemplateRef<void>;
58
+ constructor(templateRef: TemplateRef<void>);
59
+ static ɵfac: i0.ɵɵFactoryDeclaration<SubFormListEmptyDirective, never>;
60
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SubFormListEmptyDirective, "[aupSubFormListEmpty]", never, {}, {}, never, never, false, never>;
61
+ }
@@ -106,7 +106,7 @@ export declare abstract class AbstractTableModel<Row extends object> extends Gar
106
106
  getSelectionModel(): SelectionModel<Row> | undefined;
107
107
  isHoverEnabled(): boolean;
108
108
  isCursorEnabled(column: ColumnModel<Row>): boolean;
109
- /** Whether the selection model will accept this row (see MultipleSelectionModel's selectableWhen). */
109
+ /** Whether the selection model will accept this row (see MultipleSelectionModel.disableSelectionIf). */
110
110
  isRowSelectable(row: Row): boolean;
111
111
  isRowSelectionEnabledForRow(row: Row): boolean;
112
112
  /**
@@ -3,6 +3,7 @@ import { CdkPortalOutletAttachedRef } from "@angular/cdk/portal";
3
3
  import { Injector } from "@angular/core";
4
4
  import { GarbageCollector, ValueModel } from "@coolon/pectin";
5
5
  import { ColumnTextSearchFormatter } from "../filter/column-text-search-formatter";
6
+ import type { ColumnTextMatcher } from "../filter/text-search-predicate";
6
7
  import { CellHeaderPortalRef, type CellRendererPortalRef } from "../renderer/cell-portal-ref";
7
8
  import type { TableCellComponent } from "../renderer/table-cell/table-cell.component";
8
9
  import type { TableHeaderCellComponent } from "../renderer/table-header-cell/table-header-cell.component";
@@ -33,6 +34,8 @@ export declare class ColumnModel<Row extends object> extends GarbageCollector {
33
34
  private _userVisible$;
34
35
  readonly dasherisedColumnId: string;
35
36
  private readonly textSearchDelegate;
37
+ private _textMatcher;
38
+ private _textMatcherMap;
36
39
  readonly visible$: ValueModel<boolean>;
37
40
  constructor(columnId: string, order: ColumnOrderManager, textPropertiesProvider: ColumnModel.TextPropertiesProvider);
38
41
  protected installHeaderRenderer(): void;
@@ -54,6 +57,10 @@ export declare class ColumnModel<Row extends object> extends GarbageCollector {
54
57
  getSearchTextFor(row: Row): string;
55
58
  configureColumnTextSearch(formatter: ColumnTextSearchFormatter<Row>): this;
56
59
  configureColumnTextSearch<T>(formatter: ColumnTextSearchFormatter<T>, mapper: (row: Row) => T): this;
60
+ /** False for a column without a matcher — it contributes only its search text. */
61
+ matchesSearchFor(row: Row, searchText: string): boolean;
62
+ configureColumnTextMatch(matcher: ColumnTextMatcher<Row>): this;
63
+ configureColumnTextMatch<T>(matcher: ColumnTextMatcher<T>, mapper: (row: Row) => T): this;
57
64
  protected configureHeaderRenderer<C>(config: CellHeaderPortalRef<Row, unknown>): void;
58
65
  protected configureCellRenderer<C>(config: CellRendererPortalRef<Row, unknown>): void;
59
66
  cellHeaderRenderer<C>(componentType: ComponentType<C>, initialiser: (component: C, column: ColumnModel<Row>) => void): this;
@@ -3,10 +3,12 @@ import { Constructable } from "@coolon/typescript-utilities";
3
3
  import { Enum } from "typescript-string-enums";
4
4
  import type { CellRenderer } from "../renderer/cell-renderer";
5
5
  import { ColumnTextSearchFormatter } from "./column-text-search-formatter";
6
+ import type { ColumnTextMatcher } from "./text-search-predicate";
6
7
  export declare const Keys: {
7
8
  useFunction: "useFunction";
8
9
  useInstance: "useInstance";
9
10
  useClass: "useClass";
11
+ useMatcher: "useMatcher";
10
12
  };
11
13
  export type Keys = Enum<typeof Keys>;
12
14
  interface UseFunction<Row> {
@@ -18,8 +20,21 @@ interface UseInstance<Row> {
18
20
  interface UseClass<Row> {
19
21
  [Keys.useClass]: Constructable<ColumnTextSearchFormatter<Row>>;
20
22
  }
21
- export declare function EnableCellTextSearch<Row>(options: UseFunction<Row> | UseInstance<Row> | UseClass<Row>): ClassDecorator;
23
+ interface UseMatcher<Row> {
24
+ [Keys.useMatcher]: ColumnTextMatcher<Row>;
25
+ }
26
+ type FormatterOptions<Row> = UseFunction<Row> | UseInstance<Row> | UseClass<Row>;
27
+ /**
28
+ * A renderer contributes searchable TEXT (a formatter — matched against the escaped literal form
29
+ * of the query), its own MATCHING of the raw query (a matcher — for semantics a literal substring
30
+ * can't express), or both. With a matcher alone the column contributes no text and answers only
31
+ * through the matcher.
32
+ */
33
+ export type CellTextSearchOptions<Row> = FormatterOptions<Row> | UseMatcher<Row> | (FormatterOptions<Row> & UseMatcher<Row>);
34
+ export declare function EnableCellTextSearch<Row>(options: CellTextSearchOptions<Row>): ClassDecorator;
22
35
  export declare namespace EnableCellTextSearch {
23
36
  function getFormatter(renderer: ComponentType<CellRenderer<any>>, useDefault: () => ColumnTextSearchFormatter<any>): ColumnTextSearchFormatter<any>;
37
+ /** Undefined unless the renderer declared `useMatcher` — the column then matches on text alone. */
38
+ function getMatcher(renderer: ComponentType<CellRenderer<any>>): ColumnTextMatcher<any> | undefined;
24
39
  }
25
40
  export {};
@@ -1,10 +1,16 @@
1
- import { AbstractConstructable } from "@coolon/restilence-plugin";
2
- export type TextSearchPredicate<Row> = (row: Row, regex: RegExp) => boolean;
3
- export declare class TextSearchContext<Row> {
4
- readonly row: Row;
5
- readonly searchText: string;
6
- readonly searchRegex: RegExp;
7
- constructor(row: Row, searchText: string, searchRegex: RegExp);
8
- getOrCreate<T>(type: AbstractConstructable<T>, create: () => T): void;
9
- matchesText(text: string): boolean;
10
- }
1
+ /**
2
+ * Tests a row against the current search. `regex` is the escaped literal form of the search text,
3
+ * tested against the text columns contribute (ColumnTextSearchFormatter); `searchText` is the raw
4
+ * query, for columns matching via a ColumnTextMatcher instead.
5
+ */
6
+ export type TextSearchPredicate<Row> = (row: Row, regex: RegExp, searchText?: string) => boolean;
7
+ /**
8
+ * A column's own answer to "does this cell match the query?", given the RAW search text — for
9
+ * search semantics one escaped literal substring can't express, e.g. the category-qualified
10
+ * `loc:depar` = category starts with LOC and name contains "depar". Declared by a cell renderer
11
+ * via `@EnableCellTextSearch({useMatcher})`, so `value` is the renderer's value type: the column's
12
+ * existing row -> value accessor does the projection.
13
+ *
14
+ * A row matches when the joined column text matches the regex OR any column's matcher returns true.
15
+ */
16
+ export type ColumnTextMatcher<V> = (value: V, searchText: string) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "16.1.0-alpha.266",
3
+ "version": "16.1.0-alpha.268",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.9",
6
6
  "@angular/common": "^16.2.9",
@@ -12,7 +12,7 @@
12
12
  "@angular/platform-browser-dynamic": "^16.2.9",
13
13
  "@angular/material-moment-adapter": "^16.2.10",
14
14
  "@angular/router": "^16.2.9",
15
- "@coolon/pectin": "^5.0.0-alpha.134",
15
+ "@coolon/pectin": "^5.0.0-alpha.137",
16
16
  "fast-typescript-memoize": "^1.1.1",
17
17
  "lodash-es": "^4.17.21",
18
18
  "marked": "4.0.10",
@@ -46,4 +46,4 @@
46
46
  }
47
47
  },
48
48
  "sideEffects": false
49
- }
49
+ }