@coolon/angular-ui-powerups 16.1.0-aplpha.152 → 16.1.0-aplpha.154
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/esm2022/lib/components/tables/renderer/table-action-column/menu-builder.mjs +1 -1
- package/esm2022/lib/components/tables/renderer/table-action-column/table-action-column.component.mjs +73 -35
- package/fesm2022/coolon-angular-ui-powerups.mjs +70 -33
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/tables/renderer/table-action-column/menu-builder.d.ts +2 -0
- package/lib/components/tables/renderer/table-action-column/table-action-column.component.d.ts +17 -5
- package/package.json +1 -1
|
@@ -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
|
}
|
package/lib/components/tables/renderer/table-action-column/table-action-column.component.d.ts
CHANGED
|
@@ -2,28 +2,40 @@ 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
|
|
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
|
+
private cache;
|
|
17
|
+
constructor(createInfo: (value: T) => FileDownloadComponent.DownloadInfo);
|
|
18
|
+
createDownloadInfo(value: T): FileDownloadComponent.DownloadInfo;
|
|
19
|
+
}
|
|
20
|
+
type MenuItem<T extends object> = CommandData<T> | DownloadData<T> | null;
|
|
13
21
|
/**
|
|
14
22
|
*
|
|
15
23
|
*/
|
|
16
24
|
export declare class TableActionColumnComponent<T extends object> extends DisposableComponent implements CellRenderer<T>, MenuBuilder<T> {
|
|
17
25
|
value: T;
|
|
18
26
|
menu: MatMenuTrigger;
|
|
19
|
-
readonly actions:
|
|
20
|
-
readonly moreActions:
|
|
27
|
+
readonly actions: MenuItem<T>[];
|
|
28
|
+
readonly moreActions: MenuItem<T>[];
|
|
29
|
+
readonly trackByIndex: import("@angular/core").TrackByFunction<any>;
|
|
30
|
+
constructor();
|
|
21
31
|
addCommand(commandFactory: Command.Factory<T, void>, properties: CommandFace): void;
|
|
22
32
|
addSeparator(): void;
|
|
33
|
+
addDownload(factory: (row: T) => FileDownloadComponent.DownloadInfo): void;
|
|
23
34
|
addMoreMenu(builder: (menu: MenuBuilder<T>) => void): void;
|
|
24
|
-
constructor();
|
|
25
|
-
createMoreMenuCommand(item: MenuItemData<T>, value: T): Command<void>;
|
|
26
35
|
private closeMoreMenu;
|
|
36
|
+
isCommand(item: MenuItem<T>): item is CommandData<T>;
|
|
37
|
+
isDownload(item: MenuItem<T>): item is DownloadData<T>;
|
|
38
|
+
isSeparator(item: MenuItem<T>): boolean;
|
|
27
39
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableActionColumnComponent<any>, never>;
|
|
28
40
|
static ɵcmp: i0.ɵɵComponentDeclaration<TableActionColumnComponent<any>, "aup-table-action-column", never, { "value": { "alias": "value"; "required": false; }; }, {}, never, never, false, never>;
|
|
29
41
|
}
|