@coolon/angular-ui-powerups 16.1.0-alpha.322 → 16.1.0-alpha.324

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.
@@ -1,6 +1,6 @@
1
1
  import { ComponentType } from '@angular/cdk/overlay';
2
2
  import { Injector } from '@angular/core';
3
- import { BooleanValueModelChain, Constructable, DelegatingListModel, DependsOnOptions, Disposable, GarbageCollector, HasValue, ListModel, SelectionModel, Types, ValueModel } from '@coolon/pectin';
3
+ import { BooleanValueModelChain, Constructable, DelegatingListModel, DependsOnOptions, Disposable, GarbageCollector, HasValue, ListModel, OneTimeBinding, SelectionModel, Types, ValueModel } from '@coolon/pectin';
4
4
  import { ColumnManager } from './column/column-manager';
5
5
  import type { CellRendererOptions, ColumnModel, OnComponentInit } from './column/column-model';
6
6
  import type { ColumnOrderManager } from './column/column-order-manager';
@@ -16,7 +16,9 @@ import type { CellRenderer } from './renderer/cell-renderer';
16
16
  import type { MenuBuilder } from './renderer/table-action-column/menu-builder';
17
17
  import { TableActionColumnComponent } from './renderer/table-action-column/table-action-column.component';
18
18
  import type { TableCustomMoreMenuPopupComponent } from './renderer/table-custom-more-menu/table-custom-more-menu-popup.component';
19
- export declare abstract class AbstractTableModel<Row extends object> extends GarbageCollector {
19
+ export declare abstract class AbstractTableModel<Row extends object> extends GarbageCollector implements OneTimeBinding {
20
+ /** A proxied table model is a one-time binding: it cannot be read before its input is set. */
21
+ readonly [OneTimeBinding.brand]: true;
20
22
  protected readonly _dataSource$: DelegatingListModel<Row>;
21
23
  protected readonly _filteredRows$: DelegatingListModel<Row>;
22
24
  protected readonly _visibleRows$: DelegatingListModel<Row>;
@@ -1,6 +1,8 @@
1
- import { Disposable, DisposedWith, GarbageCollector, ListModel, Predicate, ValueModel } from "@coolon/pectin";
1
+ import { Disposable, DisposedWith, GarbageCollector, ListModel, OneTimeBinding, Predicate, ValueModel } from "@coolon/pectin";
2
2
  import type { TextSearchPredicate } from "./text-search-predicate";
3
- export declare class TableFilterModel<Row> extends GarbageCollector {
3
+ export declare class TableFilterModel<Row> extends GarbageCollector implements OneTimeBinding {
4
+ /** A proxied table filter model is a one-time binding: it cannot be read before its input is set. */
5
+ readonly [OneTimeBinding.brand]: true;
4
6
  private readonly _source$;
5
7
  private readonly _rowPredicate$;
6
8
  private readonly _searchText$;
@@ -1,6 +1,6 @@
1
1
  import { ComponentType } from "@angular/cdk/overlay";
2
2
  import { ComponentPortal } from "@angular/cdk/portal";
3
- import { ValueModel } from "@coolon/pectin";
3
+ import { OneTimeBinding, ValueModel } from "@coolon/pectin";
4
4
  declare class RowClass {
5
5
  readonly className: string;
6
6
  readonly matches: () => boolean;
@@ -50,7 +50,9 @@ export interface ResolvedFooterRow {
50
50
  /** Live visibility gate set via {@link FooterRowModel.visibleWhile}; undefined ⇒ always visible. */
51
51
  readonly visible$?: ValueModel<boolean | undefined>;
52
52
  }
53
- export declare abstract class FooterRowModel {
53
+ export declare abstract class FooterRowModel implements OneTimeBinding {
54
+ /** A proxied footer row model is a one-time binding: it cannot be read before its input is set. */
55
+ readonly [OneTimeBinding.brand]: true;
54
56
  protected readonly _rowClasses: RowClass[];
55
57
  protected _visible$?: ValueModel<boolean | undefined>;
56
58
  /** The row's live visibility gate, if one was set via {@link visibleWhile}. */
@@ -1,5 +1,7 @@
1
- import { Disposable, DisposedWith, GarbageCollector, ListModel } from '@coolon/pectin';
2
- export declare class TreeExpansionModel<T> extends GarbageCollector {
1
+ import { Disposable, DisposedWith, GarbageCollector, ListModel, OneTimeBinding } from '@coolon/pectin';
2
+ export declare class TreeExpansionModel<T> extends GarbageCollector implements OneTimeBinding {
3
+ /** A proxied tree expansion model is a one-time binding: it cannot be read before its input is set. */
4
+ readonly [OneTimeBinding.brand]: true;
3
5
  private readonly _source$;
4
6
  private readonly collapsedIds;
5
7
  private readonly _isExpandedPredicate$;
@@ -1,15 +1,28 @@
1
1
  import { AfterViewInit, ChangeDetectorRef, ElementRef, OnDestroy, OnInit } from '@angular/core';
2
2
  import { MatButton } from '@angular/material/button';
3
- import { MatMenu, MatMenuItem } from '@angular/material/menu';
3
+ import { MatMenuItem } from '@angular/material/menu';
4
4
  import { Command, GarbageCollector, UnaryCommand } from '@coolon/pectin';
5
5
  import * as i0 from "@angular/core";
6
+ /**
7
+ * Binds an element to a command:
8
+ *
9
+ * 1. A click runs the command, with [commandParameter] for a UnaryCommand.
10
+ * 2. The element is disabled while the command is, Material buttons and menu items included.
11
+ * 3. The element is hidden while the command is invisible, as `aup-command` hides itself, so a
12
+ * `visibleWhile` gate hides the element without an `*ngIf` of its own. It is disabled while hidden
13
+ * too, so the keyboard cannot reach it either: Material's menu moves the arrow keys and type-ahead
14
+ * past disabled items, but not past hidden ones.
15
+ * 4. A click is kept from the element's ancestors, except inside a menu, which closes on it.
16
+ */
6
17
  export declare class CommandDirective<P = any> extends GarbageCollector implements OnInit, OnDestroy, AfterViewInit {
7
18
  private elementRef;
8
19
  private readonly changeDetector;
9
20
  private _command;
10
21
  private _commandEnabled;
22
+ private _commandVisible;
23
+ /** The element's own inline display, put back when the command shows again. */
24
+ private displayWhenVisible?;
11
25
  private matControl;
12
- private isInPopupMenu;
13
26
  set pectinCommand(command: Command<any> | UnaryCommand<P>);
14
27
  get pectinCommand(): Command<any> | UnaryCommand<P>;
15
28
  private _commandParameter;
@@ -17,12 +30,17 @@ export declare class CommandDirective<P = any> extends GarbageCollector implemen
17
30
  set commandParameter(value: P);
18
31
  get commandParameter(): P;
19
32
  preventDefault: boolean;
20
- constructor(elementRef: ElementRef, changeDetector: ChangeDetectorRef, matButton: MatButton, matMenuItem: MatMenuItem, matMenu?: MatMenu);
33
+ constructor(elementRef: ElementRef, changeDetector: ChangeDetectorRef, matButton: MatButton, matMenuItem: MatMenuItem);
21
34
  ngOnInit(): void;
35
+ /**
36
+ * Hides the element with an inline `display: none`, which a component's own `display` rule cannot
37
+ * override as it can the `hidden` attribute.
38
+ */
39
+ updateVisibleState(visible: boolean): void;
22
40
  ngAfterViewInit(): void;
23
41
  updateEnabledState(enabled: boolean): void;
24
42
  ngOnDestroy(): void;
25
43
  notifyClick($event: Event): void;
26
- static ɵfac: i0.ɵɵFactoryDeclaration<CommandDirective<any>, [null, null, { optional: true; host: true; }, { optional: true; host: true; }, { optional: true; }]>;
44
+ static ɵfac: i0.ɵɵFactoryDeclaration<CommandDirective<any>, [null, null, { optional: true; host: true; }, { optional: true; host: true; }]>;
27
45
  static ɵdir: i0.ɵɵDirectiveDeclaration<CommandDirective<any>, "[pectinCommand]", never, { "pectinCommand": { "alias": "pectinCommand"; "required": false; }; "commandParameter": { "alias": "commandParameter"; "required": false; }; "preventDefault": { "alias": "preventDefault"; "required": false; }; }, {}, never, never, false, never>;
28
46
  }
@@ -1,9 +1,11 @@
1
- import { GarbageCollector, ListModel, MutableValueModel, Validator, ValueModel } from '@coolon/pectin';
1
+ import { GarbageCollector, ListModel, MutableValueModel, OneTimeBinding, Validator, ValueModel } from '@coolon/pectin';
2
2
  import type { HasValidators } from '@coolon/pectin';
3
3
  import type { EditContext } from '../edit-context';
4
- export declare class InlineEditorModel<T> extends GarbageCollector {
4
+ export declare class InlineEditorModel<T> extends GarbageCollector implements OneTimeBinding {
5
5
  readonly valueModel: ValueModel<T>;
6
6
  readonly saveCallback: InlineEditorModel.SaveCallback<T>;
7
+ /** A proxied inline editor model is a one-time binding: it cannot be read before its input is set. */
8
+ readonly [OneTimeBinding.brand]: true;
7
9
  readonly editing: MutableValueModel<boolean>;
8
10
  private readonly _validators;
9
11
  private _editingEnabled;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "16.1.0-alpha.322",
3
+ "version": "16.1.0-alpha.324",
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.146",
15
+ "@coolon/pectin": "^5.0.0-alpha.147",
16
16
  "fast-typescript-memoize": "^1.1.1",
17
17
  "lodash-es": "^4.17.21",
18
18
  "marked": "4.0.10",