@coolon/angular-ui-powerups 16.1.0-aplpha.152 → 16.1.0-aplpha.153

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,5 +1,7 @@
1
1
  import { Command, CommandFace } from '@coolon/pectin';
2
+ import { FileDownloadComponent } from '../../../file/file-download/file-download.component';
2
3
  export interface MenuBuilder<Row extends object> {
3
4
  addCommand(factory: Command.Factory<Row>, face: CommandFace): void;
5
+ addDownload(callback: (row: Row) => FileDownloadComponent.DownloadInfo): void;
4
6
  addSeparator(): void;
5
7
  }
@@ -2,28 +2,39 @@ import { MatMenuTrigger } from '@angular/material/menu';
2
2
  import { Command } from '@coolon/pectin';
3
3
  import { CommandFace } from '../../../commands/command-face';
4
4
  import { DisposableComponent } from '../../../disposable-component';
5
+ import { FileDownloadComponent } from '../../../file/file-download/file-download.component';
5
6
  import { CellRenderer } from '../cell-renderer';
6
7
  import { MenuBuilder } from './menu-builder';
7
8
  import * as i0 from "@angular/core";
8
- declare class MenuItemData<T extends object> {
9
+ declare class CommandData<T extends object> {
9
10
  readonly factory: Command.Factory<T, void>;
10
11
  readonly face: CommandFace;
11
12
  constructor(factory: Command.Factory<T, void>, face: CommandFace);
12
13
  }
14
+ declare class DownloadData<T extends object> {
15
+ private createInfo;
16
+ constructor(createInfo: (value: T) => FileDownloadComponent.DownloadInfo);
17
+ createDownloadInfo(value: T): FileDownloadComponent.DownloadInfo;
18
+ }
19
+ type MenuItem<T extends object> = CommandData<T> | DownloadData<T> | null;
13
20
  /**
14
21
  *
15
22
  */
16
23
  export declare class TableActionColumnComponent<T extends object> extends DisposableComponent implements CellRenderer<T>, MenuBuilder<T> {
17
24
  value: T;
18
25
  menu: MatMenuTrigger;
19
- readonly actions: MenuItemData<T>[];
20
- readonly moreActions: MenuItemData<T>[];
26
+ readonly actions: MenuItem<T>[];
27
+ readonly moreActions: MenuItem<T>[];
28
+ readonly trackByIndex: import("@angular/core").TrackByFunction<any>;
29
+ constructor();
21
30
  addCommand(commandFactory: Command.Factory<T, void>, properties: CommandFace): void;
22
31
  addSeparator(): void;
32
+ addDownload(factory: (row: T) => FileDownloadComponent.DownloadInfo): void;
23
33
  addMoreMenu(builder: (menu: MenuBuilder<T>) => void): void;
24
- constructor();
25
- createMoreMenuCommand(item: MenuItemData<T>, value: T): Command<void>;
26
34
  private closeMoreMenu;
35
+ isCommand(item: MenuItem<T>): item is CommandData<T>;
36
+ isDownload(item: MenuItem<T>): item is DownloadData<T>;
37
+ isSeparator(item: MenuItem<T>): boolean;
27
38
  static ɵfac: i0.ɵɵFactoryDeclaration<TableActionColumnComponent<any>, never>;
28
39
  static ɵcmp: i0.ɵɵComponentDeclaration<TableActionColumnComponent<any>, "aup-table-action-column", never, { "value": { "alias": "value"; "required": false; }; }, {}, never, never, false, never>;
29
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "16.1.0-aplpha.152",
3
+ "version": "16.1.0-aplpha.153",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.9",
6
6
  "@angular/common": "^16.2.9",