@paperless/angular 1.42.5 → 1.43.0
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/esm2020/lib/modules/table/components/index.mjs +4 -2
- package/esm2020/lib/modules/table/components/table/table.component.mjs +103 -12
- package/esm2020/lib/modules/table/components/table-cell/table-cell.component.mjs +15 -3
- package/esm2020/lib/modules/table/components/table-row-action/table-row-action.component.mjs +52 -0
- package/esm2020/lib/modules/table/directives/index.mjs +1 -4
- package/esm2020/lib/modules/table/table.module.mjs +9 -9
- package/esm2020/lib/stencil/components.mjs +4 -4
- package/fesm2015/paperless-angular.mjs +165 -35
- package/fesm2015/paperless-angular.mjs.map +1 -1
- package/fesm2020/paperless-angular.mjs +167 -34
- package/fesm2020/paperless-angular.mjs.map +1 -1
- package/lib/modules/table/components/index.d.ts +3 -1
- package/lib/modules/table/components/table/table.component.d.ts +14 -2
- package/lib/modules/table/components/table-cell/table-cell.component.d.ts +6 -2
- package/lib/modules/table/components/table-row-action/table-row-action.component.d.ts +23 -0
- package/lib/modules/table/directives/index.d.ts +1 -3
- package/lib/modules/table/table.module.d.ts +8 -8
- package/lib/stencil/components.d.ts +1 -1
- package/package.json +1 -1
- package/paperless.css +12 -0
- package/esm2020/lib/modules/table/directives/p-table-floating-menu-content.directive.mjs +0 -16
- package/lib/modules/table/directives/p-table-floating-menu-content.directive.d.ts +0 -8
|
@@ -13,7 +13,7 @@ import { PlatformModule } from '@angular/cdk/platform';
|
|
|
13
13
|
import { PortalModule, CdkPortal, ComponentPortal } from '@angular/cdk/portal';
|
|
14
14
|
import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
|
|
15
15
|
import { startWith, tap, pairwise, map, filter, debounce } from 'rxjs/operators';
|
|
16
|
-
import { objectGetByPath, isTableColumnSizesKey } from '@paperless/core';
|
|
16
|
+
import { objectGetByPath, isTableColumnSizesKey, isMobile } from '@paperless/core';
|
|
17
17
|
import { v4 } from 'uuid';
|
|
18
18
|
import * as i1$2 from '@angular/platform-browser';
|
|
19
19
|
|
|
@@ -1054,10 +1054,10 @@ let PFloatingMenuItem = class PFloatingMenuItem {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
};
|
|
1056
1056
|
PFloatingMenuItem.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PFloatingMenuItem, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
1057
|
-
PFloatingMenuItem.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: PFloatingMenuItem, selector: "p-floating-menu-item", inputs: { hover: "hover" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1057
|
+
PFloatingMenuItem.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: PFloatingMenuItem, selector: "p-floating-menu-item", inputs: { disabled: "disabled", hover: "hover" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1058
1058
|
PFloatingMenuItem = __decorate([
|
|
1059
1059
|
ProxyCmp({
|
|
1060
|
-
inputs: ['hover']
|
|
1060
|
+
inputs: ['disabled', 'hover']
|
|
1061
1061
|
})
|
|
1062
1062
|
], PFloatingMenuItem);
|
|
1063
1063
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PFloatingMenuItem, decorators: [{
|
|
@@ -1067,7 +1067,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
1067
1067
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1068
1068
|
template: '<ng-content></ng-content>',
|
|
1069
1069
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
1070
|
-
inputs: ['hover'],
|
|
1070
|
+
inputs: ['disabled', 'hover'],
|
|
1071
1071
|
}]
|
|
1072
1072
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
|
|
1073
1073
|
let PHelper = class PHelper {
|
|
@@ -2387,6 +2387,10 @@ class TableCell {
|
|
|
2387
2387
|
* The index of the row
|
|
2388
2388
|
*/
|
|
2389
2389
|
this.rowIndex = 0;
|
|
2390
|
+
/**
|
|
2391
|
+
* Wether the table has actions
|
|
2392
|
+
*/
|
|
2393
|
+
this.tableHasActions = false;
|
|
2390
2394
|
}
|
|
2391
2395
|
get class() {
|
|
2392
2396
|
return this.getColumnClasses();
|
|
@@ -2442,6 +2446,12 @@ class TableCell {
|
|
|
2442
2446
|
'font-semibold': this.variant !== 'header' && this.definition?.type === 'th',
|
|
2443
2447
|
'text-storm-dark': this.variant !== 'header' && this.definition?.type === 'th',
|
|
2444
2448
|
'pr-4': this.definition?.isLast === false,
|
|
2449
|
+
'group-hover:hidden': this.definition.isLast &&
|
|
2450
|
+
this.tableHasActions &&
|
|
2451
|
+
this.variant !== 'actions',
|
|
2452
|
+
'group-hover:flex': this.variant === 'actions' && this.tableHasActions,
|
|
2453
|
+
hidden: this.variant === 'actions' && this.tableHasActions,
|
|
2454
|
+
flex: this.variant !== 'actions',
|
|
2445
2455
|
...sizes,
|
|
2446
2456
|
};
|
|
2447
2457
|
}
|
|
@@ -2554,10 +2564,10 @@ class TableCell {
|
|
|
2554
2564
|
}
|
|
2555
2565
|
}
|
|
2556
2566
|
TableCell.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableCell, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2557
|
-
TableCell.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TableCell, selector: "p-table-cell-ngx", inputs: { variant: "variant", index: "index", rowIndex: "rowIndex", definition: "definition", item: "item", value: "value", checkbox: "checkbox", template: "template" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<ng-container *ngIf=\"checkbox\">\n\t<ng-container *ngTemplateOutlet=\"checkbox\"></ng-container>\n</ng-container>\n\n<ng-container [ngSwitch]=\"variant\">\n\t<p-loader\n\t\t*ngSwitchCase=\"'loading'\"\n\t\tvariant=\"ghost\"\n\t\tclass=\"h-6 w-full flex-1 rounded\"\n\t></p-loader>\n\n\t<div\n\t\t*ngSwitchCase=\"'header'\"\n\t\tclass=\"flex w-full overflow-hidden\"\n\t\t[class.justify-start]=\"definition.align === 'start'\"\n\t\t[class.justify-center]=\"definition.align === 'center'\"\n\t\t[class.justify-end]=\"definition.align === 'end'\"\n\t>\n\t\t<ng-container *ngTemplateOutlet=\"valueTemplate\"></ng-container>\n\t</div>\n\n\t<div\n\t\t*ngSwitchCase=\"'default'\"\n\t\tclass=\"flex min-w-0 flex-1\"\n\t\t[class.justify-start]=\"definition.align === 'start'\"\n\t\t[class.justify-center]=\"definition.align === 'center'\"\n\t\t[class.justify-end]=\"definition.align === 'end'\"\n\t>\n\t\t<ng-container *ngIf=\"template; else valueTemplate\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"template; context: data\"\n\t\t\t></ng-container>\n\t\t</ng-container>\n\t</div>\n</ng-container>\n\n<ng-template #valueTemplate>\n\t{{ data.value }}\n</ng-template>\n", styles: [":host{
|
|
2567
|
+
TableCell.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TableCell, selector: "p-table-cell-ngx", inputs: { variant: "variant", index: "index", rowIndex: "rowIndex", definition: "definition", item: "item", value: "value", tableHasActions: "tableHasActions", checkbox: "checkbox", template: "template" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<ng-container *ngIf=\"checkbox\">\n\t<ng-container *ngTemplateOutlet=\"checkbox\"></ng-container>\n</ng-container>\n\n<ng-container [ngSwitch]=\"variant\">\n\t<p-loader\n\t\t*ngSwitchCase=\"'loading'\"\n\t\tvariant=\"ghost\"\n\t\tclass=\"h-6 w-full flex-1 rounded\"\n\t></p-loader>\n\n\t<ng-container *ngSwitchCase=\"'actions'\">\n\t\t<ng-container *ngIf=\"template\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"template; context: data\"\n\t\t\t></ng-container>\n\t\t</ng-container>\n\t</ng-container>\n\n\t<div\n\t\t*ngSwitchCase=\"'header'\"\n\t\tclass=\"flex w-full overflow-hidden\"\n\t\t[class.justify-start]=\"definition.align === 'start'\"\n\t\t[class.justify-center]=\"definition.align === 'center'\"\n\t\t[class.justify-end]=\"definition.align === 'end'\"\n\t>\n\t\t<ng-container *ngTemplateOutlet=\"valueTemplate\"></ng-container>\n\t</div>\n\n\t<div\n\t\t*ngSwitchCase=\"'default'\"\n\t\tclass=\"flex min-w-0 flex-1\"\n\t\t[class.justify-start]=\"definition.align === 'start'\"\n\t\t[class.justify-center]=\"definition.align === 'center'\"\n\t\t[class.justify-end]=\"definition.align === 'end'\"\n\t>\n\t\t<ng-container *ngIf=\"template; else valueTemplate\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"template; context: data\"\n\t\t\t></ng-container>\n\t\t</ng-container>\n\t</div>\n</ng-container>\n\n<ng-template #valueTemplate>\n\t{{ data.value }}\n</ng-template>\n", styles: [":host{align-items:center;gap:1rem}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: PLoader, selector: "p-loader", inputs: ["color", "modalDescription", "modalTitle", "show", "variant"] }] });
|
|
2558
2568
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableCell, decorators: [{
|
|
2559
2569
|
type: Component,
|
|
2560
|
-
args: [{ selector: 'p-table-cell-ngx', template: "<ng-container *ngIf=\"checkbox\">\n\t<ng-container *ngTemplateOutlet=\"checkbox\"></ng-container>\n</ng-container>\n\n<ng-container [ngSwitch]=\"variant\">\n\t<p-loader\n\t\t*ngSwitchCase=\"'loading'\"\n\t\tvariant=\"ghost\"\n\t\tclass=\"h-6 w-full flex-1 rounded\"\n\t></p-loader>\n\n\t<div\n\t\t*ngSwitchCase=\"'header'\"\n\t\tclass=\"flex w-full overflow-hidden\"\n\t\t[class.justify-start]=\"definition.align === 'start'\"\n\t\t[class.justify-center]=\"definition.align === 'center'\"\n\t\t[class.justify-end]=\"definition.align === 'end'\"\n\t>\n\t\t<ng-container *ngTemplateOutlet=\"valueTemplate\"></ng-container>\n\t</div>\n\n\t<div\n\t\t*ngSwitchCase=\"'default'\"\n\t\tclass=\"flex min-w-0 flex-1\"\n\t\t[class.justify-start]=\"definition.align === 'start'\"\n\t\t[class.justify-center]=\"definition.align === 'center'\"\n\t\t[class.justify-end]=\"definition.align === 'end'\"\n\t>\n\t\t<ng-container *ngIf=\"template; else valueTemplate\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"template; context: data\"\n\t\t\t></ng-container>\n\t\t</ng-container>\n\t</div>\n</ng-container>\n\n<ng-template #valueTemplate>\n\t{{ data.value }}\n</ng-template>\n", styles: [":host{
|
|
2570
|
+
args: [{ selector: 'p-table-cell-ngx', template: "<ng-container *ngIf=\"checkbox\">\n\t<ng-container *ngTemplateOutlet=\"checkbox\"></ng-container>\n</ng-container>\n\n<ng-container [ngSwitch]=\"variant\">\n\t<p-loader\n\t\t*ngSwitchCase=\"'loading'\"\n\t\tvariant=\"ghost\"\n\t\tclass=\"h-6 w-full flex-1 rounded\"\n\t></p-loader>\n\n\t<ng-container *ngSwitchCase=\"'actions'\">\n\t\t<ng-container *ngIf=\"template\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"template; context: data\"\n\t\t\t></ng-container>\n\t\t</ng-container>\n\t</ng-container>\n\n\t<div\n\t\t*ngSwitchCase=\"'header'\"\n\t\tclass=\"flex w-full overflow-hidden\"\n\t\t[class.justify-start]=\"definition.align === 'start'\"\n\t\t[class.justify-center]=\"definition.align === 'center'\"\n\t\t[class.justify-end]=\"definition.align === 'end'\"\n\t>\n\t\t<ng-container *ngTemplateOutlet=\"valueTemplate\"></ng-container>\n\t</div>\n\n\t<div\n\t\t*ngSwitchCase=\"'default'\"\n\t\tclass=\"flex min-w-0 flex-1\"\n\t\t[class.justify-start]=\"definition.align === 'start'\"\n\t\t[class.justify-center]=\"definition.align === 'center'\"\n\t\t[class.justify-end]=\"definition.align === 'end'\"\n\t>\n\t\t<ng-container *ngIf=\"template; else valueTemplate\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"template; context: data\"\n\t\t\t></ng-container>\n\t\t</ng-container>\n\t</div>\n</ng-container>\n\n<ng-template #valueTemplate>\n\t{{ data.value }}\n</ng-template>\n", styles: [":host{align-items:center;gap:1rem}\n"] }]
|
|
2561
2571
|
}], propDecorators: { variant: [{
|
|
2562
2572
|
type: Input
|
|
2563
2573
|
}], index: [{
|
|
@@ -2570,6 +2580,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
2570
2580
|
type: Input
|
|
2571
2581
|
}], value: [{
|
|
2572
2582
|
type: Input
|
|
2583
|
+
}], tableHasActions: [{
|
|
2584
|
+
type: Input
|
|
2573
2585
|
}], checkbox: [{
|
|
2574
2586
|
type: Input
|
|
2575
2587
|
}], template: [{
|
|
@@ -2652,20 +2664,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
2652
2664
|
}]
|
|
2653
2665
|
}] });
|
|
2654
2666
|
|
|
2655
|
-
class TableFloatingMenuContentDirective {
|
|
2656
|
-
constructor(template) {
|
|
2657
|
-
this.template = template;
|
|
2658
|
-
}
|
|
2659
|
-
}
|
|
2660
|
-
TableFloatingMenuContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableFloatingMenuContentDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2661
|
-
TableFloatingMenuContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: TableFloatingMenuContentDirective, selector: "[p-table-floating-menu-content]", ngImport: i0 });
|
|
2662
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableFloatingMenuContentDirective, decorators: [{
|
|
2663
|
-
type: Directive,
|
|
2664
|
-
args: [{
|
|
2665
|
-
selector: '[p-table-floating-menu-content]',
|
|
2666
|
-
}]
|
|
2667
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
2668
|
-
|
|
2669
2667
|
class TableFooterDirective extends BaseValueAccessor {
|
|
2670
2668
|
constructor(el) {
|
|
2671
2669
|
super(el);
|
|
@@ -2967,9 +2965,55 @@ const TABLE_DIRECTIVES = [
|
|
|
2967
2965
|
TableNgxDirective,
|
|
2968
2966
|
TableFilterModalDirective,
|
|
2969
2967
|
TableCustomFilterDirective,
|
|
2970
|
-
TableFloatingMenuContentDirective,
|
|
2971
2968
|
];
|
|
2972
2969
|
|
|
2970
|
+
let TableRowAction = class TableRowAction {
|
|
2971
|
+
constructor(c, r, z) {
|
|
2972
|
+
this.z = z;
|
|
2973
|
+
/**
|
|
2974
|
+
* Event whenever a row is clicked
|
|
2975
|
+
*/
|
|
2976
|
+
this.action = new EventEmitter();
|
|
2977
|
+
c.detach();
|
|
2978
|
+
this.el = r.nativeElement;
|
|
2979
|
+
}
|
|
2980
|
+
};
|
|
2981
|
+
TableRowAction.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableRowAction, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
2982
|
+
TableRowAction.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TableRowAction, selector: "p-table-row-action", inputs: { disabled: "disabled", icon: "icon", iconFlip: "iconFlip", iconOnly: "iconOnly", iconRotate: "iconRotate", label: "label", type: "type" }, outputs: { action: "action" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2983
|
+
TableRowAction = __decorate([
|
|
2984
|
+
ProxyCmp({
|
|
2985
|
+
inputs: [
|
|
2986
|
+
'disabled',
|
|
2987
|
+
'icon',
|
|
2988
|
+
'iconFlip',
|
|
2989
|
+
'iconOnly',
|
|
2990
|
+
'iconRotate',
|
|
2991
|
+
'label',
|
|
2992
|
+
'type',
|
|
2993
|
+
],
|
|
2994
|
+
})
|
|
2995
|
+
], TableRowAction);
|
|
2996
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableRowAction, decorators: [{
|
|
2997
|
+
type: Component,
|
|
2998
|
+
args: [{
|
|
2999
|
+
selector: 'p-table-row-action',
|
|
3000
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3001
|
+
template: '<ng-content></ng-content>',
|
|
3002
|
+
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
3003
|
+
inputs: [
|
|
3004
|
+
'disabled',
|
|
3005
|
+
'icon',
|
|
3006
|
+
'iconFlip',
|
|
3007
|
+
'iconOnly',
|
|
3008
|
+
'iconRotate',
|
|
3009
|
+
'label',
|
|
3010
|
+
'type',
|
|
3011
|
+
],
|
|
3012
|
+
}]
|
|
3013
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { action: [{
|
|
3014
|
+
type: Output
|
|
3015
|
+
}] } });
|
|
3016
|
+
|
|
2973
3017
|
const defaultSize = 12;
|
|
2974
3018
|
const defaultSizeOptions = [12, 24, 68, 136];
|
|
2975
3019
|
|
|
@@ -2995,6 +3039,10 @@ let Table = class Table {
|
|
|
2995
3039
|
* Wether to enable selection
|
|
2996
3040
|
*/
|
|
2997
3041
|
this.enableRowSelection = true;
|
|
3042
|
+
/**
|
|
3043
|
+
* A limit to the amount of rows that can be selected
|
|
3044
|
+
*/
|
|
3045
|
+
this.rowSelectionLimit = undefined;
|
|
2998
3046
|
/**
|
|
2999
3047
|
* Wether to enable row clicking
|
|
3000
3048
|
*/
|
|
@@ -3155,6 +3203,11 @@ let Table = class Table {
|
|
|
3155
3203
|
this.filterModalShow = new EventEmitter();
|
|
3156
3204
|
this.filterModalSave = new EventEmitter();
|
|
3157
3205
|
this.filterModalReset = new EventEmitter();
|
|
3206
|
+
this.rowActionsFloating$ = new BehaviorSubject([]);
|
|
3207
|
+
this.rowActionsRow$ = new BehaviorSubject([]);
|
|
3208
|
+
this.isMobile$ = new BehaviorSubject(isMobile());
|
|
3209
|
+
this._inputEnableRowSelection = this.enableRowSelection;
|
|
3210
|
+
this._inputRowSelectionLimit = this.rowSelectionLimit;
|
|
3158
3211
|
}
|
|
3159
3212
|
set columnDefinitions(v) {
|
|
3160
3213
|
this._columnDefinitions = v;
|
|
@@ -3163,6 +3216,13 @@ let Table = class Table {
|
|
|
3163
3216
|
get columnDefinitions() {
|
|
3164
3217
|
return this._columnDefinitions;
|
|
3165
3218
|
}
|
|
3219
|
+
set rowActions(v) {
|
|
3220
|
+
this._rowActions = v;
|
|
3221
|
+
this._setRowSelectionData();
|
|
3222
|
+
}
|
|
3223
|
+
get rowActions() {
|
|
3224
|
+
return this._rowActions;
|
|
3225
|
+
}
|
|
3166
3226
|
ngOnInit() {
|
|
3167
3227
|
this._parseItems(this.items);
|
|
3168
3228
|
this.loadingRows = Array.from({
|
|
@@ -3181,6 +3241,23 @@ let Table = class Table {
|
|
|
3181
3241
|
length: changes['amountOfLoadingRows'].currentValue,
|
|
3182
3242
|
});
|
|
3183
3243
|
}
|
|
3244
|
+
let calculateRowSelectionData = false;
|
|
3245
|
+
if (changes['enableRowSelection']) {
|
|
3246
|
+
this._inputEnableRowSelection =
|
|
3247
|
+
changes['enableRowSelection'].currentValue;
|
|
3248
|
+
calculateRowSelectionData = true;
|
|
3249
|
+
}
|
|
3250
|
+
if (changes['rowSelectionLimit']) {
|
|
3251
|
+
this._inputRowSelectionLimit =
|
|
3252
|
+
changes['rowSelectionLimit'].currentValue;
|
|
3253
|
+
calculateRowSelectionData = true;
|
|
3254
|
+
}
|
|
3255
|
+
if (calculateRowSelectionData || changes['selectedRows']) {
|
|
3256
|
+
this._setRowSelectionData(changes['selectedRows']?.currentValue ?? this.selectedRows);
|
|
3257
|
+
}
|
|
3258
|
+
}
|
|
3259
|
+
onResize() {
|
|
3260
|
+
this._setRowSelectionData();
|
|
3184
3261
|
}
|
|
3185
3262
|
keyDown({ key }) {
|
|
3186
3263
|
if (key !== 'Control' || this._ctrlDown === true) {
|
|
@@ -3240,8 +3317,6 @@ let Table = class Table {
|
|
|
3240
3317
|
this.parsedItems = JSON.parse(items);
|
|
3241
3318
|
}
|
|
3242
3319
|
_generateColumns() {
|
|
3243
|
-
// const definitions =
|
|
3244
|
-
// this._el.nativeElement.querySelectorAll('p-table-definition');
|
|
3245
3320
|
const definitionsArray = Array.from(this._columnDefinitions);
|
|
3246
3321
|
definitionsArray[definitionsArray.length - 1].isLast = true;
|
|
3247
3322
|
this.columns = definitionsArray;
|
|
@@ -3407,6 +3482,32 @@ let Table = class Table {
|
|
|
3407
3482
|
checkbox.checked = !checkbox.checked;
|
|
3408
3483
|
this._checkboxChange(checkbox, index);
|
|
3409
3484
|
}
|
|
3485
|
+
_rowActionClick(action, rowIndex) {
|
|
3486
|
+
if (action.disabled) {
|
|
3487
|
+
return;
|
|
3488
|
+
}
|
|
3489
|
+
if (!action.action) {
|
|
3490
|
+
return;
|
|
3491
|
+
}
|
|
3492
|
+
if (action.type === 'multi' ||
|
|
3493
|
+
(action.type === 'both' && rowIndex === undefined)) {
|
|
3494
|
+
action.action.emit({
|
|
3495
|
+
items: this.selectedRows,
|
|
3496
|
+
multi: true,
|
|
3497
|
+
ctrlDown: this._ctrlDown,
|
|
3498
|
+
});
|
|
3499
|
+
return;
|
|
3500
|
+
}
|
|
3501
|
+
if (rowIndex === undefined) {
|
|
3502
|
+
return;
|
|
3503
|
+
}
|
|
3504
|
+
const item = this.parsedItems[rowIndex];
|
|
3505
|
+
action.action.emit({
|
|
3506
|
+
item,
|
|
3507
|
+
multi: false,
|
|
3508
|
+
ctrlDown: this._ctrlDown,
|
|
3509
|
+
});
|
|
3510
|
+
}
|
|
3410
3511
|
_findRow(el) {
|
|
3411
3512
|
if (!el) {
|
|
3412
3513
|
return el;
|
|
@@ -3429,15 +3530,47 @@ let Table = class Table {
|
|
|
3429
3530
|
}
|
|
3430
3531
|
return this._findRowAction(el?.parentElement);
|
|
3431
3532
|
}
|
|
3533
|
+
_setRowSelectionData(selectedRows = this.selectedRows) {
|
|
3534
|
+
if (this._resizeTimeout) {
|
|
3535
|
+
clearTimeout(this._resizeTimeout);
|
|
3536
|
+
}
|
|
3537
|
+
// We add a timeout here because it's a lot easier on the machine to do these when someone is done
|
|
3538
|
+
// resizing and playing around with their browser
|
|
3539
|
+
this._resizeTimeout = setTimeout(() => {
|
|
3540
|
+
const mobile = isMobile();
|
|
3541
|
+
this.isMobile$.next(mobile);
|
|
3542
|
+
const actions = Array.from(this._rowActions);
|
|
3543
|
+
// we hack this to any[] to make it work..
|
|
3544
|
+
const rowActionsRow = actions.filter((a) => a.type === 'both' || a.type === 'single');
|
|
3545
|
+
const rowActionsFloating = actions.filter((a) => a.type === 'both' || a.type === 'multi' || mobile);
|
|
3546
|
+
let rowSelectionLimit = this._inputRowSelectionLimit;
|
|
3547
|
+
if (mobile && // we're mobile
|
|
3548
|
+
rowActionsFloating?.length && // we have atleast 1 item in _rowActionsFloating
|
|
3549
|
+
((rowSelectionLimit !== undefined && this.enableRowSelection) ||
|
|
3550
|
+
!this.enableRowSelection)) {
|
|
3551
|
+
rowSelectionLimit = 1;
|
|
3552
|
+
}
|
|
3553
|
+
this.rowSelectionLimit = rowSelectionLimit;
|
|
3554
|
+
let enableRowSelection = this._inputEnableRowSelection;
|
|
3555
|
+
if (mobile && // we're mobile
|
|
3556
|
+
rowActionsFloating?.length && // we have atleast 1 item in _rowActionsFloating
|
|
3557
|
+
!enableRowSelection) {
|
|
3558
|
+
enableRowSelection = true;
|
|
3559
|
+
}
|
|
3560
|
+
this.enableRowSelection = enableRowSelection;
|
|
3561
|
+
this.rowActionsRow$.next(rowActionsRow);
|
|
3562
|
+
this.rowActionsFloating$.next(rowActionsFloating);
|
|
3563
|
+
}, 200);
|
|
3564
|
+
}
|
|
3432
3565
|
};
|
|
3433
3566
|
Table.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: Table, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3434
|
-
Table.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: Table, selector: "p-table-ngx", inputs: { items: "items", loading: "loading", headerLoading: "headerLoading", footerLoading: "footerLoading", amountOfLoadingRows: "amountOfLoadingRows", enableRowSelection: "enableRowSelection", rowSelectionLimit: "rowSelectionLimit", enableRowClick: "enableRowClick", selectedRows: "selectedRows", selectionKey: "selectionKey", canSelectKey: "canSelectKey", enableFloatingMenu: "enableFloatingMenu", floatingMenuAmountSelectedText: "floatingMenuAmountSelectedText", floatingMenuAmountSelectedTemplate: "floatingMenuAmountSelectedTemplate", enableHeader: "enableHeader", quickFilters: "quickFilters", activeQuickFilterIdentifier: "activeQuickFilterIdentifier", enableSearch: "enableSearch", query: "query", enableFilter: "enableFilter", selectedFiltersAmount: "selectedFiltersAmount", filterButtonTemplate: "filterButtonTemplate", enableAction: "enableAction", actionButtonLoading: "actionButtonLoading", actionButtonIcon: "actionButtonIcon", actionButtonEnabled: "actionButtonEnabled", actionButtonText: "actionButtonText", actionButtonTemplate: "actionButtonTemplate", enableFooter: "enableFooter", enablePageSize: "enablePageSize", enablePagination: "enablePagination", enableExport: "enableExport", page: "page", total: "total", pageSize: "pageSize", pageSizeOptions: "pageSizeOptions", hideOnSinglePage: "hideOnSinglePage", emptyStateType: "emptyStateType", emptyStateIllustration: "emptyStateIllustration", emptyStateHeader: "emptyStateHeader", emptyStateContent: "emptyStateContent", emptyStateAction: "emptyStateAction", enableEmptyStateAction: "enableEmptyStateAction", emptyStateFilteredIllustration: "emptyStateFilteredIllustration", emptyStateFilteredHeader: "emptyStateFilteredHeader", emptyStateFilteredContent: "emptyStateFilteredContent", shadow: "shadow", filterModalHeaderText: "filterModalHeaderText", filterModalSaveText: "filterModalSaveText", filterModalCancelText: "filterModalCancelText", filterModalResetText: "filterModalResetText", filterModalShowReset: "filterModalShowReset", filterModalShowResetMobile: "filterModalShowResetMobile" }, outputs: { selectedRowsChange: "selectedRowsChange", rowClick: "rowClick", rowSelected: "rowSelected", rowDeselected: "rowDeselected", quickFilter: "quickFilter", queryChange: "queryChange", filter: "filter", action: "action", pageChange: "pageChange", pageSizeChange: "pageSizeChange", export: "export", emptyStateActionClick: "emptyStateActionClick", filterModalShow: "filterModalShow", filterModalSave: "filterModalSave", filterModalReset: "filterModalReset" }, host: { listeners: { "document:keydown": "keyDown($event)", "document:keyup": "keyUp($event)", "document:visibilitychange": "visibilityChange($event)" } }, queries: [{ propertyName: "floatingMenuContentTemplate", first: true, predicate: TableFloatingMenuContentDirective, descendants: true, read: TemplateRef, static: true }, { propertyName: "headerCustomFilterTemplate", first: true, predicate: TableCustomFilterDirective, descendants: true, read: TemplateRef, static: true }, { propertyName: "filterModalTemplate", first: true, predicate: TableFilterModalDirective, descendants: true, read: TemplateRef, static: true }, { propertyName: "columnDefinitions", predicate: TableColumn }], usesOnChanges: true, ngImport: i0, template: "<p-table-container [shadow]=\"shadow\">\n\t<p-table-header\n\t\t*ngIf=\"enableHeader\"\n\t\t[quickFilters]=\"quickFilters\"\n\t\t[activeQuickFilterIdentifier]=\"activeQuickFilterIdentifier\"\n\t\t(quickFilter)=\"onQuickFilter($event)\"\n\t\t[enableSearch]=\"enableSearch\"\n\t\t[query]=\"query\"\n\t\t(queryChange)=\"onQueryChange($event)\"\n\t\t[enableFilter]=\"enableFilter\"\n\t\t[selectedFiltersAmount]=\"selectedFiltersAmount\"\n\t\t[filterButtonTemplate]=\"filterButtonTemplate\"\n\t\t(filter)=\"filterModalShow$.next(true)\"\n\t\t[enableAction]=\"enableAction\"\n\t\t[canUseAction]=\"actionButtonEnabled\"\n\t\t[actionButtonTemplate]=\"actionButtonTemplate\"\n\t\t[actionLoading]=\"actionButtonLoading\"\n\t\t[actionText]=\"actionButtonText\"\n\t\t[actionIcon]=\"actionButtonIcon\"\n\t\t(action)=\"action.emit()\"\n\t\t[itemsSelectedAmount]=\"selectedRows.length\"\n\t\t[loading]=\"headerLoading\"\n\t>\n\t\t<ng-container *ngIf=\"headerCustomFilterTemplate\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"headerCustomFilterTemplate\"\n\t\t\t></ng-container>\n\t\t</ng-container>\n\t</p-table-header>\n\n\t<p-table-row variant=\"header\">\n\t\t<ng-container *ngFor=\"let col of columns; let index = index\">\n\t\t\t<p-table-cell-ngx\n\t\t\t\t[definition]=\"col\"\n\t\t\t\t[value]=\"col.name\"\n\t\t\t\tvariant=\"header\"\n\t\t\t\t[index]=\"index\"\n\t\t\t\t[checkbox]=\"\n\t\t\t\t\t(index === 0 || col.hasCheckbox) && enableRowSelection\n\t\t\t\t\t\t? checkboxTemplate\n\t\t\t\t\t\t: undefined\n\t\t\t\t\"\n\t\t\t></p-table-cell-ngx>\n\t\t\t<ng-template #checkboxTemplate>\n\t\t\t\t<input\n\t\t\t\t\tclass=\"p-input\"\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t(change)=\"_selectAllChange($event)\"\n\t\t\t\t\t[checked]=\"_selectionContainsAll()\"\n\t\t\t\t\t[indeterminate]=\"_selectionIndeterminate()\"\n\t\t\t\t\t[class.opacity-0]=\"rowSelectionLimit !== undefined\"\n\t\t\t\t\t[disabled]=\"rowSelectionLimit !== undefined\"\n\t\t\t\t/>\n\t\t\t</ng-template>\n\t\t</ng-container>\n\t</p-table-row>\n\n\t<div class=\"flex flex-col flex-1\">\n\t\t<ng-container *ngIf=\"loading; else contentTemplate\">\n\t\t\t<p-table-row\n\t\t\t\t*ngFor=\"let r of loadingRows; let rowIndex = index\"\n\t\t\t\t[enableHover]=\"enableRowSelection || enableRowClick\"\n\t\t\t>\n\t\t\t\t<ng-container *ngFor=\"let col of columns; let index = index\">\n\t\t\t\t\t<p-table-cell-ngx\n\t\t\t\t\t\t[definition]=\"col\"\n\t\t\t\t\t\tvariant=\"loading\"\n\t\t\t\t\t\t[checkbox]=\"\n\t\t\t\t\t\t\t(index === 0 || col.hasCheckbox) &&\n\t\t\t\t\t\t\tenableRowSelection\n\t\t\t\t\t\t\t\t? checkboxTemplate\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t[index]=\"index\"\n\t\t\t\t\t\t[rowIndex]=\"rowIndex\"\n\t\t\t\t\t></p-table-cell-ngx>\n\t\t\t\t\t<ng-template #checkboxTemplate>\n\t\t\t\t\t\t<p-loader\n\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\tclass=\"h-6 w-6 rounded\"\n\t\t\t\t\t\t></p-loader>\n\t\t\t\t\t</ng-template>\n\t\t\t\t</ng-container>\n\t\t\t</p-table-row>\n\t\t</ng-container>\n\n\t\t<ng-template #contentTemplate>\n\t\t\t<ng-container *ngIf=\"items?.length; else emptyStateTemplate\">\n\t\t\t\t<p-table-row\n\t\t\t\t\t*ngFor=\"let item of items; let rowIndex = index\"\n\t\t\t\t\t[enableHover]=\"enableRowSelection || enableRowClick\"\n\t\t\t\t\t(click)=\"_rowClick($event, rowIndex)\"\n\t\t\t\t>\n\t\t\t\t\t<ng-container\n\t\t\t\t\t\t*ngFor=\"let col of columns; let index = index\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<p-table-cell-ngx\n\t\t\t\t\t\t\t[definition]=\"col\"\n\t\t\t\t\t\t\t[item]=\"item\"\n\t\t\t\t\t\t\t[checkbox]=\"\n\t\t\t\t\t\t\t\t(index === 0 || col.hasCheckbox) &&\n\t\t\t\t\t\t\t\tenableRowSelection\n\t\t\t\t\t\t\t\t\t? checkboxTemplate\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t[index]=\"index\"\n\t\t\t\t\t\t\t[rowIndex]=\"rowIndex\"\n\t\t\t\t\t\t\t[template]=\"col.template\"\n\t\t\t\t\t\t></p-table-cell-ngx>\n\n\t\t\t\t\t\t<ng-template #checkboxTemplate>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclass=\"p-input\"\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\t(change)=\"\n\t\t\t\t\t\t\t\t\t_checkboxChange($event.target, rowIndex)\n\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t[disabled]=\"_checkboxDisabled(item, rowIndex)\"\n\t\t\t\t\t\t\t\t[checked]=\"_selectionContains(item, rowIndex)\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t</ng-container>\n\t\t\t\t</p-table-row>\n\t\t\t</ng-container>\n\t\t</ng-template>\n\t</div>\n\n\t<p-table-footer\n\t\t*ngIf=\"enableFooter\"\n\t\t[hideOnSinglePage]=\"hideOnSinglePage\"\n\t\t[enablePageSize]=\"enablePageSize\"\n\t\t[pageSize]=\"pageSize\"\n\t\t[pageSizeOptions]=\"pageSizeOptions\"\n\t\t(pageSizeChange)=\"onPageSizeChange($event)\"\n\t\t[enablePagination]=\"enablePagination\"\n\t\t[page]=\"page\"\n\t\t[total]=\"total\"\n\t\t(pageChange)=\"onPageChange($event)\"\n\t\t[enableExport]=\"enableExport\"\n\t\t(export)=\"export.emit()\"\n\t\t[loading]=\"footerLoading\"\n\t></p-table-footer>\n\n\t<ng-container *ngIf=\"enableFloatingMenu && enableRowSelection\">\n\t\t<p-floating-menu-container\n\t\t\t[class.inactive]=\"!selectedRows.length\"\n\t\t\t[class.shown]=\"floatingMenuShown$ | async\"\n\t\t>\n\t\t\t<p-floating-menu-item\n\t\t\t\t[hover]=\"false\"\n\t\t\t\t[class]=\"{\n\t\t\t\t\thidden: !!floatingMenuContentTemplate,\n\t\t\t\t\t'tablet:flex': !!floatingMenuContentTemplate\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t{{ floatingMenuAmountSelectedText }}\n\t\t\t</p-floating-menu-item>\n\t\t\t<p-divider\n\t\t\t\tclass=\"mx-0 text-storm\"\n\t\t\t\tvariant=\"vertical\"\n\t\t\t\t[class]=\"{\n\t\t\t\t\thidden: !!floatingMenuContentTemplate,\n\t\t\t\t\t'tablet:flex': !!floatingMenuContentTemplate\n\t\t\t\t}\"\n\t\t\t></p-divider>\n\t\t\t<ng-container *ngIf=\"floatingMenuContentTemplate\">\n\t\t\t\t<ng-container\n\t\t\t\t\t*ngTemplateOutlet=\"floatingMenuContentTemplate\"\n\t\t\t\t></ng-container>\n\t\t\t\t<p-divider\n\t\t\t\t\tclass=\"mx-0 text-storm\"\n\t\t\t\t\tvariant=\"vertical\"\n\t\t\t\t></p-divider>\n\t\t\t</ng-container>\n\t\t\t<p-floating-menu-item (click)=\"_selectAllChange(null, false)\">\n\t\t\t\t<p-icon variant=\"negative\"></p-icon>\n\t\t\t</p-floating-menu-item>\n\t\t</p-floating-menu-container>\n\t</ng-container>\n</p-table-container>\n\n<ng-container *ngIf=\"filterModalTemplate\">\n\t<p-modal\n\t\t[header]=\"filterModalHeaderText\"\n\t\t[show]=\"filterModalShow$ | async\"\n\t\t(closed)=\"filterModalShow$.next(false)\"\n\t>\n\t\t<div slot=\"content\" class=\"flex flex-col gap-6\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"filterModalTemplate\"\n\t\t\t></ng-container>\n\t\t</div>\n\t\t<div slot=\"footer\" class=\"flex w-full justify-between gap-4\">\n\t\t\t<p-button\n\t\t\t\t*ngIf=\"filterModalShowResetMobile\"\n\t\t\t\tclass=\"flex w-full tablet:w-auto desktop-xs:hidden\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\t(onClick)=\"onFilterModalReset(true)\"\n\t\t\t>\n\t\t\t\t{{ filterModalResetText }}\n\t\t\t</p-button>\n\t\t\t<p-button\n\t\t\t\t*ngIf=\"filterModalShowReset\"\n\t\t\t\tclass=\"hidden w-full tablet:w-auto desktop-xs:flex\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\t(onClick)=\"onFilterModalReset()\"\n\t\t\t>\n\t\t\t\t{{ filterModalResetText }}\n\t\t\t</p-button>\n\t\t\t<p-button\n\t\t\t\tclass=\"ml-auto w-full tablet:w-auto\"\n\t\t\t\ticon=\"checkmark\"\n\t\t\t\t(onClick)=\"onFilterModalSave()\"\n\t\t\t>\n\t\t\t\t{{ filterModalSaveText }}\n\t\t\t</p-button>\n\t\t</div>\n\t</p-modal>\n</ng-container>\n\n<ng-template #emptyStateTemplate>\n\t<div\n\t\t*ngIf=\"emptyStateType === 'filtered'; else emptyStateNonFilterTemplate\"\n\t\tclass=\"flex max-w-[20rem] flex-col items-center self-center py-24 text-center\"\n\t>\n\t\t<p-illustration\n\t\t\t[variant]=\"emptyStateFilteredIllustration\"\n\t\t\tclass=\"mb-6\"\n\t\t></p-illustration>\n\t\t<p class=\"text-storm-default font-semibold\">\n\t\t\t{{ emptyStateFilteredHeader }}\n\t\t</p>\n\t\t<p class=\"mb-14 text-sm text-storm-medium\">\n\t\t\t{{ emptyStateFilteredContent }}\n\t\t</p>\n\t</div>\n</ng-template>\n\n<ng-template #emptyStateNonFilterTemplate>\n\t<div\n\t\tclass=\"flex max-w-[20rem] flex-col items-center self-center py-24 text-center\"\n\t\t[class.cursor-pointer]=\"enableEmptyStateAction\"\n\t\t(click)=\"emptyStateClicked()\"\n\t>\n\t\t<p-illustration\n\t\t\t[variant]=\"emptyStateIllustration\"\n\t\t\tclass=\"mb-6\"\n\t\t></p-illustration>\n\t\t<p class=\"text-storm-default font-semibold\">\n\t\t\t{{ emptyStateHeader }}\n\t\t</p>\n\t\t<p class=\"mb-6 text-sm text-storm-medium\">\n\t\t\t{{ emptyStateContent }}\n\t\t</p>\n\t\t<p-button\n\t\t\t*ngIf=\"enableEmptyStateAction\"\n\t\t\tvariant=\"secondary\"\n\t\t\ticon=\"plus\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t{{ emptyStateAction }}\n\t\t</p-button>\n\t</div>\n</ng-template>\n", styles: [":host{position:relative;display:flex;flex-direction:column}:host .p-input[type=checkbox]{flex-shrink:0}:host p-table-container{position:relative}:host p-table-container p-floating-menu-container{position:fixed;bottom:1rem;left:50%;--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));animation:forwards floatingMenuContainerIn .3s ease!important}@media (min-width: 40rem){:host p-table-container p-floating-menu-container{position:absolute;bottom:4rem}}:host p-table-container p-floating-menu-container:not(.shown){display:none}:host p-table-container p-floating-menu-container.inactive{animation:forwards floatingMenuContainerOut .3s ease!important}@keyframes floatingMenuContainerOut{0%{display:flex;transform:translateY(0) translate(-50%);opacity:100}99%{transform:translateY(100%) translate(-50%);opacity:0;display:flex}to{transform:translateY(100%) translate(-50%);opacity:0;display:none}}@keyframes floatingMenuContainerIn{0%{transform:translateY(100%) translate(-50%);opacity:0;display:none}1%{transform:translateY(100%) translate(-50%);opacity:0;display:flex}to{transform:translateY(0) translate(-50%);opacity:100;display:flex}}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PButton, selector: "p-button", inputs: ["chevron", "chevronPosition", "disabled", "href", "icon", "iconFlip", "iconOnly", "iconPosition", "iconRotate", "inheritText", "loading", "size", "target", "type", "underline", "variant"] }, { kind: "component", type: PDivider, selector: "p-divider", inputs: ["variant"] }, { kind: "component", type: PFloatingMenuContainer, selector: "p-floating-menu-container", inputs: ["usedInTable"] }, { kind: "component", type: PFloatingMenuItem, selector: "p-floating-menu-item", inputs: ["hover"] }, { kind: "component", type: PIcon, selector: "p-icon", inputs: ["flip", "rotate", "size", "variant"] }, { kind: "component", type: PIllustration, selector: "p-illustration", inputs: ["variant"] }, { kind: "component", type: PLoader, selector: "p-loader", inputs: ["color", "modalDescription", "modalTitle", "show", "variant"] }, { kind: "component", type: PModal, selector: "p-modal", inputs: ["applyBlur", "backdropClickClose", "header", "padding", "scrollLock", "show", "showClose", "showMobileFooter", "size", "variant"] }, { kind: "component", type: PTableContainer, selector: "p-table-container", inputs: ["shadow"] }, { kind: "component", type: PTableFooter, selector: "p-table-footer", inputs: ["enableExport", "enablePageSize", "enablePagination", "hideOnSinglePage", "loading", "page", "pageSize", "pageSizeOptions", "total"] }, { kind: "component", type: PTableHeader, selector: "p-table-header", inputs: ["actionButtonTemplate", "actionIcon", "actionLoading", "actionText", "activeQuickFilterIdentifier", "canUseAction", "enableAction", "enableFilter", "enableSearch", "filterButtonTemplate", "itemsSelectedAmount", "loading", "query", "quickFilters", "selectedFiltersAmount"] }, { kind: "component", type: PTableRow, selector: "p-table-row", inputs: ["enableHover", "variant"] }, { kind: "component", type: TableCell, selector: "p-table-cell-ngx", inputs: ["variant", "index", "rowIndex", "definition", "item", "value", "checkbox", "template"] }, { kind: "directive", type: TableFooterDirective, selector: "p-table-footer" }, { kind: "directive", type: TableHeaderDirective, selector: "p-table-header" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3567
|
+
Table.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: Table, selector: "p-table-ngx", inputs: { items: "items", loading: "loading", headerLoading: "headerLoading", footerLoading: "footerLoading", amountOfLoadingRows: "amountOfLoadingRows", enableRowSelection: "enableRowSelection", rowSelectionLimit: "rowSelectionLimit", enableRowClick: "enableRowClick", selectedRows: "selectedRows", selectionKey: "selectionKey", canSelectKey: "canSelectKey", enableFloatingMenu: "enableFloatingMenu", floatingMenuAmountSelectedText: "floatingMenuAmountSelectedText", floatingMenuAmountSelectedTemplate: "floatingMenuAmountSelectedTemplate", enableHeader: "enableHeader", quickFilters: "quickFilters", activeQuickFilterIdentifier: "activeQuickFilterIdentifier", enableSearch: "enableSearch", query: "query", enableFilter: "enableFilter", selectedFiltersAmount: "selectedFiltersAmount", filterButtonTemplate: "filterButtonTemplate", enableAction: "enableAction", actionButtonLoading: "actionButtonLoading", actionButtonIcon: "actionButtonIcon", actionButtonEnabled: "actionButtonEnabled", actionButtonText: "actionButtonText", actionButtonTemplate: "actionButtonTemplate", enableFooter: "enableFooter", enablePageSize: "enablePageSize", enablePagination: "enablePagination", enableExport: "enableExport", page: "page", total: "total", pageSize: "pageSize", pageSizeOptions: "pageSizeOptions", hideOnSinglePage: "hideOnSinglePage", emptyStateType: "emptyStateType", emptyStateIllustration: "emptyStateIllustration", emptyStateHeader: "emptyStateHeader", emptyStateContent: "emptyStateContent", emptyStateAction: "emptyStateAction", enableEmptyStateAction: "enableEmptyStateAction", emptyStateFilteredIllustration: "emptyStateFilteredIllustration", emptyStateFilteredHeader: "emptyStateFilteredHeader", emptyStateFilteredContent: "emptyStateFilteredContent", shadow: "shadow", filterModalHeaderText: "filterModalHeaderText", filterModalSaveText: "filterModalSaveText", filterModalCancelText: "filterModalCancelText", filterModalResetText: "filterModalResetText", filterModalShowReset: "filterModalShowReset", filterModalShowResetMobile: "filterModalShowResetMobile" }, outputs: { selectedRowsChange: "selectedRowsChange", rowClick: "rowClick", rowSelected: "rowSelected", rowDeselected: "rowDeselected", quickFilter: "quickFilter", queryChange: "queryChange", filter: "filter", action: "action", pageChange: "pageChange", pageSizeChange: "pageSizeChange", export: "export", emptyStateActionClick: "emptyStateActionClick", filterModalShow: "filterModalShow", filterModalSave: "filterModalSave", filterModalReset: "filterModalReset" }, host: { listeners: { "window:resize": "onResize($event)", "document:keydown": "keyDown($event)", "document:keyup": "keyUp($event)", "document:visibilitychange": "visibilityChange($event)" } }, queries: [{ propertyName: "headerCustomFilterTemplate", first: true, predicate: TableCustomFilterDirective, descendants: true, read: TemplateRef, static: true }, { propertyName: "filterModalTemplate", first: true, predicate: TableFilterModalDirective, descendants: true, read: TemplateRef, static: true }, { propertyName: "columnDefinitions", predicate: TableColumn }, { propertyName: "rowActions", predicate: TableRowAction }], usesOnChanges: true, ngImport: i0, template: "<p-table-container [shadow]=\"shadow\">\n\t<p-table-header\n\t\t*ngIf=\"enableHeader\"\n\t\t[quickFilters]=\"quickFilters\"\n\t\t[activeQuickFilterIdentifier]=\"activeQuickFilterIdentifier\"\n\t\t(quickFilter)=\"onQuickFilter($event)\"\n\t\t[enableSearch]=\"enableSearch\"\n\t\t[query]=\"query\"\n\t\t(queryChange)=\"onQueryChange($event)\"\n\t\t[enableFilter]=\"enableFilter\"\n\t\t[selectedFiltersAmount]=\"selectedFiltersAmount\"\n\t\t[filterButtonTemplate]=\"filterButtonTemplate\"\n\t\t(filter)=\"filterModalShow$.next(true)\"\n\t\t[enableAction]=\"enableAction\"\n\t\t[canUseAction]=\"actionButtonEnabled\"\n\t\t[actionButtonTemplate]=\"actionButtonTemplate\"\n\t\t[actionLoading]=\"actionButtonLoading\"\n\t\t[actionText]=\"actionButtonText\"\n\t\t[actionIcon]=\"actionButtonIcon\"\n\t\t(action)=\"action.emit()\"\n\t\t[itemsSelectedAmount]=\"selectedRows.length\"\n\t\t[loading]=\"headerLoading\"\n\t>\n\t\t<ng-container *ngIf=\"headerCustomFilterTemplate\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"headerCustomFilterTemplate\"\n\t\t\t></ng-container>\n\t\t</ng-container>\n\t</p-table-header>\n\n\t<p-table-row variant=\"header\">\n\t\t<ng-container *ngFor=\"let col of columns; let index = index\">\n\t\t\t<p-table-cell-ngx\n\t\t\t\t[definition]=\"col\"\n\t\t\t\t[value]=\"col.name\"\n\t\t\t\tvariant=\"header\"\n\t\t\t\t[index]=\"index\"\n\t\t\t\t[checkbox]=\"\n\t\t\t\t\t(index === 0 || col.hasCheckbox) && enableRowSelection\n\t\t\t\t\t\t? checkboxTemplate\n\t\t\t\t\t\t: undefined\n\t\t\t\t\"\n\t\t\t></p-table-cell-ngx>\n\t\t\t<ng-template #checkboxTemplate>\n\t\t\t\t<input\n\t\t\t\t\tclass=\"p-input\"\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t(change)=\"_selectAllChange($event)\"\n\t\t\t\t\t[checked]=\"_selectionContainsAll()\"\n\t\t\t\t\t[indeterminate]=\"_selectionIndeterminate()\"\n\t\t\t\t\t[class.opacity-0]=\"rowSelectionLimit !== undefined\"\n\t\t\t\t\t[disabled]=\"rowSelectionLimit !== undefined\"\n\t\t\t\t/>\n\t\t\t</ng-template>\n\t\t</ng-container>\n\t</p-table-row>\n\n\t<div class=\"flex flex-col flex-1\">\n\t\t<ng-container *ngIf=\"loading; else contentTemplate\">\n\t\t\t<p-table-row\n\t\t\t\t*ngFor=\"let r of loadingRows; let rowIndex = index\"\n\t\t\t\t[enableHover]=\"enableRowSelection || enableRowClick\"\n\t\t\t>\n\t\t\t\t<ng-container *ngFor=\"let col of columns; let index = index\">\n\t\t\t\t\t<p-table-cell-ngx\n\t\t\t\t\t\t[definition]=\"col\"\n\t\t\t\t\t\tvariant=\"loading\"\n\t\t\t\t\t\t[checkbox]=\"\n\t\t\t\t\t\t\t(index === 0 || col.hasCheckbox) &&\n\t\t\t\t\t\t\tenableRowSelection\n\t\t\t\t\t\t\t\t? checkboxTemplate\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t[index]=\"index\"\n\t\t\t\t\t\t[rowIndex]=\"rowIndex\"\n\t\t\t\t\t></p-table-cell-ngx>\n\t\t\t\t\t<ng-template #checkboxTemplate>\n\t\t\t\t\t\t<p-loader\n\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\tclass=\"h-6 w-6 rounded\"\n\t\t\t\t\t\t></p-loader>\n\t\t\t\t\t</ng-template>\n\t\t\t\t</ng-container>\n\t\t\t</p-table-row>\n\t\t</ng-container>\n\n\t\t<ng-template #contentTemplate>\n\t\t\t<ng-container *ngIf=\"items?.length; else emptyStateTemplate\">\n\t\t\t\t<p-table-row\n\t\t\t\t\t*ngFor=\"let item of items; let rowIndex = index\"\n\t\t\t\t\t[enableHover]=\"enableRowSelection || enableRowClick\"\n\t\t\t\t\t(click)=\"_rowClick($event, rowIndex)\"\n\t\t\t\t>\n\t\t\t\t\t<ng-container\n\t\t\t\t\t\t*ngFor=\"let col of columns; let index = index\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<p-table-cell-ngx\n\t\t\t\t\t\t\t[definition]=\"col\"\n\t\t\t\t\t\t\t[item]=\"item\"\n\t\t\t\t\t\t\t[checkbox]=\"\n\t\t\t\t\t\t\t\t(index === 0 || col.hasCheckbox) &&\n\t\t\t\t\t\t\t\tenableRowSelection\n\t\t\t\t\t\t\t\t\t? checkboxTemplate\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t[index]=\"index\"\n\t\t\t\t\t\t\t[rowIndex]=\"rowIndex\"\n\t\t\t\t\t\t\t[template]=\"col.template\"\n\t\t\t\t\t\t\t[tableHasActions]=\"\n\t\t\t\t\t\t\t\t!!(rowActionsRow$ | async)?.length &&\n\t\t\t\t\t\t\t\t!(isMobile$ | async)\n\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t></p-table-cell-ngx>\n\n\t\t\t\t\t\t<ng-template #checkboxTemplate>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclass=\"p-input\"\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\t(change)=\"\n\t\t\t\t\t\t\t\t\t_checkboxChange($event.target, rowIndex)\n\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t[disabled]=\"_checkboxDisabled(item, rowIndex)\"\n\t\t\t\t\t\t\t\t[checked]=\"_selectionContains(item, rowIndex)\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t</ng-container>\n\n\t\t\t\t\t<ng-container\n\t\t\t\t\t\t*ngIf=\"\n\t\t\t\t\t\t\t!!(rowActionsRow$ | async)?.length &&\n\t\t\t\t\t\t\t!(isMobile$ | async)\n\t\t\t\t\t\t\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<p-table-cell-ngx\n\t\t\t\t\t\t\tvariant=\"actions\"\n\t\t\t\t\t\t\t[definition]=\"columns[columns.length - 1]\"\n\t\t\t\t\t\t\t[item]=\"parsedItems[rowIndex]\"\n\t\t\t\t\t\t\t[index]=\"columns.length - 1\"\n\t\t\t\t\t\t\t[rowIndex]=\"rowIndex\"\n\t\t\t\t\t\t\t[tableHasActions]=\"\n\t\t\t\t\t\t\t\t!!(rowActionsRow$ | async)?.length\n\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t[template]=\"actionsTemplate\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t</p-table-cell-ngx>\n\n\t\t\t\t\t\t<ng-template #actionsTemplate>\n\t\t\t\t\t\t\t<div class=\"flex ml-auto gap-2 items-center\">\n\t\t\t\t\t\t\t\t<p-tooltip\n\t\t\t\t\t\t\t\t\t[content]=\"action.label\"\n\t\t\t\t\t\t\t\t\t*ngFor=\"\n\t\t\t\t\t\t\t\t\t\tlet action of rowActionsRow$ | async\n\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\t\t\tdata-is-action\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tslot=\"trigger\"\n\t\t\t\t\t\t\t\t\t\t[icon]=\"action.icon\"\n\t\t\t\t\t\t\t\t\t\t[iconRotate]=\"action.iconRotate\"\n\t\t\t\t\t\t\t\t\t\ticonFlip=\"action.iconFlip\"\n\t\t\t\t\t\t\t\t\t\ticonOnly=\"true\"\n\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t[disabled]=\"action.disabled\"\n\t\t\t\t\t\t\t\t\t\t(onClick)=\"\n\t\t\t\t\t\t\t\t\t\t\t_rowActionClick(action, rowIndex)\n\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t></p-button>\n\t\t\t\t\t\t\t\t</p-tooltip>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t</ng-container>\n\t\t\t\t</p-table-row>\n\t\t\t</ng-container>\n\t\t</ng-template>\n\t</div>\n\n\t<p-table-footer\n\t\t*ngIf=\"enableFooter\"\n\t\t[hideOnSinglePage]=\"hideOnSinglePage\"\n\t\t[enablePageSize]=\"enablePageSize\"\n\t\t[pageSize]=\"pageSize\"\n\t\t[pageSizeOptions]=\"pageSizeOptions\"\n\t\t(pageSizeChange)=\"onPageSizeChange($event)\"\n\t\t[enablePagination]=\"enablePagination\"\n\t\t[page]=\"page\"\n\t\t[total]=\"total\"\n\t\t(pageChange)=\"onPageChange($event)\"\n\t\t[enableExport]=\"enableExport\"\n\t\t(export)=\"export.emit()\"\n\t\t[loading]=\"footerLoading\"\n\t></p-table-footer>\n\n\t<ng-container *ngIf=\"enableFloatingMenu && enableRowSelection\">\n\t\t<p-floating-menu-container\n\t\t\t[usedInTable]=\"true\"\n\t\t\t[class.inactive]=\"!selectedRows.length\"\n\t\t\t[class.shown]=\"floatingMenuShown$ | async\"\n\t\t>\n\t\t\t<p-floating-menu-item\n\t\t\t\t[hover]=\"false\"\n\t\t\t\t[class]=\"{\n\t\t\t\t\thidden: !!(rowActionsFloating$ | async)?.length,\n\t\t\t\t\t'tablet:flex': !!(rowActionsFloating$ | async)?.length\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t{{ floatingMenuAmountSelectedText }}\n\t\t\t</p-floating-menu-item>\n\t\t\t<p-divider\n\t\t\t\tclass=\"mx-0 text-storm\"\n\t\t\t\tvariant=\"vertical\"\n\t\t\t\t[class]=\"{\n\t\t\t\t\thidden: !!(rowActionsFloating$ | async)?.length,\n\t\t\t\t\t'tablet:flex': !!(rowActionsFloating$ | async)?.length\n\t\t\t\t}\"\n\t\t\t></p-divider>\n\n\t\t\t<p-floating-menu-item\n\t\t\t\t*ngFor=\"let action of rowActionsFloating$ | async\"\n\t\t\t\tslot=\"floating-menu-item\"\n\t\t\t\t[disabled]=\"\n\t\t\t\t\t(action.type === 'single' && selectedRows.length > 1) ||\n\t\t\t\t\taction.disabled\n\t\t\t\t\"\n\t\t\t\t(click)=\"_rowActionClick(action)\"\n\t\t\t>\n\t\t\t\t{{ action.label }}\n\t\t\t\t<p-icon\n\t\t\t\t\t[variant]=\"action.icon\"\n\t\t\t\t\t[rotate]=\"action.iconRotate\"\n\t\t\t\t\t[flip]=\"action.iconFlip\"\n\t\t\t\t/>\n\t\t\t</p-floating-menu-item>\n\n\t\t\t<p-floating-menu-item (click)=\"_selectAllChange(null, false)\">\n\t\t\t\t<p-icon variant=\"negative\"></p-icon>\n\t\t\t</p-floating-menu-item>\n\t\t</p-floating-menu-container>\n\t</ng-container>\n</p-table-container>\n\n<ng-container *ngIf=\"filterModalTemplate\">\n\t<p-modal\n\t\t[header]=\"filterModalHeaderText\"\n\t\t[show]=\"filterModalShow$ | async\"\n\t\t(closed)=\"filterModalShow$.next(false)\"\n\t>\n\t\t<div slot=\"content\" class=\"flex flex-col gap-6\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"filterModalTemplate\"\n\t\t\t></ng-container>\n\t\t</div>\n\t\t<div slot=\"footer\" class=\"flex w-full justify-between gap-4\">\n\t\t\t<p-button\n\t\t\t\t*ngIf=\"filterModalShowResetMobile\"\n\t\t\t\tclass=\"flex w-full tablet:w-auto desktop-xs:hidden\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\t(onClick)=\"onFilterModalReset(true)\"\n\t\t\t>\n\t\t\t\t{{ filterModalResetText }}\n\t\t\t</p-button>\n\t\t\t<p-button\n\t\t\t\t*ngIf=\"filterModalShowReset\"\n\t\t\t\tclass=\"hidden w-full tablet:w-auto desktop-xs:flex\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\t(onClick)=\"onFilterModalReset()\"\n\t\t\t>\n\t\t\t\t{{ filterModalResetText }}\n\t\t\t</p-button>\n\t\t\t<p-button\n\t\t\t\tclass=\"ml-auto w-full tablet:w-auto\"\n\t\t\t\ticon=\"checkmark\"\n\t\t\t\t(onClick)=\"onFilterModalSave()\"\n\t\t\t>\n\t\t\t\t{{ filterModalSaveText }}\n\t\t\t</p-button>\n\t\t</div>\n\t</p-modal>\n</ng-container>\n\n<ng-template #emptyStateTemplate>\n\t<div\n\t\t*ngIf=\"emptyStateType === 'filtered'; else emptyStateNonFilterTemplate\"\n\t\tclass=\"flex max-w-[20rem] flex-col items-center self-center py-24 text-center\"\n\t>\n\t\t<p-illustration\n\t\t\t[variant]=\"emptyStateFilteredIllustration\"\n\t\t\tclass=\"mb-6\"\n\t\t></p-illustration>\n\t\t<p class=\"text-storm-default font-semibold\">\n\t\t\t{{ emptyStateFilteredHeader }}\n\t\t</p>\n\t\t<p class=\"mb-14 text-sm text-storm-medium\">\n\t\t\t{{ emptyStateFilteredContent }}\n\t\t</p>\n\t</div>\n</ng-template>\n\n<ng-template #emptyStateNonFilterTemplate>\n\t<div\n\t\tclass=\"flex max-w-[20rem] flex-col items-center self-center py-24 text-center\"\n\t\t[class.cursor-pointer]=\"enableEmptyStateAction\"\n\t\t(click)=\"emptyStateClicked()\"\n\t>\n\t\t<p-illustration\n\t\t\t[variant]=\"emptyStateIllustration\"\n\t\t\tclass=\"mb-6\"\n\t\t></p-illustration>\n\t\t<p class=\"text-storm-default font-semibold\">\n\t\t\t{{ emptyStateHeader }}\n\t\t</p>\n\t\t<p class=\"mb-6 text-sm text-storm-medium\">\n\t\t\t{{ emptyStateContent }}\n\t\t</p>\n\t\t<p-button\n\t\t\t*ngIf=\"enableEmptyStateAction\"\n\t\t\tvariant=\"secondary\"\n\t\t\ticon=\"plus\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t{{ emptyStateAction }}\n\t\t</p-button>\n\t</div>\n</ng-template>\n", styles: [":host{position:relative;display:flex;flex-direction:column}:host .p-input[type=checkbox]{flex-shrink:0}:host p-table-container{position:relative}:host p-table-container p-floating-menu-container{position:fixed;bottom:1rem;left:50%;--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));animation:forwards floatingMenuContainerIn .3s ease!important}@media (min-width: 40rem){:host p-table-container p-floating-menu-container{position:absolute;bottom:4rem}}:host p-table-container p-floating-menu-container:not(.shown){display:none}:host p-table-container p-floating-menu-container.inactive{animation:forwards floatingMenuContainerOut .3s ease!important}@keyframes floatingMenuContainerOut{0%{display:flex;transform:translateY(0) translate(-50%);opacity:100}99%{transform:translateY(100%) translate(-50%);opacity:0;display:flex}to{transform:translateY(100%) translate(-50%);opacity:0;display:none}}@keyframes floatingMenuContainerIn{0%{transform:translateY(100%) translate(-50%);opacity:0;display:none}1%{transform:translateY(100%) translate(-50%);opacity:0;display:flex}to{transform:translateY(0) translate(-50%);opacity:100;display:flex}}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PButton, selector: "p-button", inputs: ["chevron", "chevronPosition", "disabled", "href", "icon", "iconFlip", "iconOnly", "iconPosition", "iconRotate", "inheritText", "loading", "size", "target", "type", "underline", "variant"] }, { kind: "component", type: PDivider, selector: "p-divider", inputs: ["variant"] }, { kind: "component", type: PFloatingMenuContainer, selector: "p-floating-menu-container", inputs: ["usedInTable"] }, { kind: "component", type: PFloatingMenuItem, selector: "p-floating-menu-item", inputs: ["disabled", "hover"] }, { kind: "component", type: PIcon, selector: "p-icon", inputs: ["flip", "rotate", "size", "variant"] }, { kind: "component", type: PIllustration, selector: "p-illustration", inputs: ["variant"] }, { kind: "component", type: PLoader, selector: "p-loader", inputs: ["color", "modalDescription", "modalTitle", "show", "variant"] }, { kind: "component", type: PModal, selector: "p-modal", inputs: ["applyBlur", "backdropClickClose", "header", "padding", "scrollLock", "show", "showClose", "showMobileFooter", "size", "variant"] }, { kind: "component", type: PTableContainer, selector: "p-table-container", inputs: ["shadow"] }, { kind: "component", type: PTableFooter, selector: "p-table-footer", inputs: ["enableExport", "enablePageSize", "enablePagination", "hideOnSinglePage", "loading", "page", "pageSize", "pageSizeOptions", "total"] }, { kind: "component", type: PTableHeader, selector: "p-table-header", inputs: ["actionButtonTemplate", "actionIcon", "actionLoading", "actionText", "activeQuickFilterIdentifier", "canUseAction", "enableAction", "enableFilter", "enableSearch", "filterButtonTemplate", "itemsSelectedAmount", "loading", "query", "quickFilters", "selectedFiltersAmount"] }, { kind: "component", type: PTableRow, selector: "p-table-row", inputs: ["enableHover", "variant"] }, { kind: "component", type: PTooltip, selector: "p-tooltip", inputs: ["canManuallyClose", "content", "enableUserInput", "offset", "placement", "show", "strategy", "variant"] }, { kind: "component", type: TableCell, selector: "p-table-cell-ngx", inputs: ["variant", "index", "rowIndex", "definition", "item", "value", "tableHasActions", "checkbox", "template"] }, { kind: "directive", type: TableFooterDirective, selector: "p-table-footer" }, { kind: "directive", type: TableHeaderDirective, selector: "p-table-header" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3435
3568
|
Table = __decorate([
|
|
3436
3569
|
UntilDestroy({ checkProperties: true })
|
|
3437
3570
|
], Table);
|
|
3438
3571
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: Table, decorators: [{
|
|
3439
3572
|
type: Component,
|
|
3440
|
-
args: [{ selector: 'p-table-ngx', changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-table-container [shadow]=\"shadow\">\n\t<p-table-header\n\t\t*ngIf=\"enableHeader\"\n\t\t[quickFilters]=\"quickFilters\"\n\t\t[activeQuickFilterIdentifier]=\"activeQuickFilterIdentifier\"\n\t\t(quickFilter)=\"onQuickFilter($event)\"\n\t\t[enableSearch]=\"enableSearch\"\n\t\t[query]=\"query\"\n\t\t(queryChange)=\"onQueryChange($event)\"\n\t\t[enableFilter]=\"enableFilter\"\n\t\t[selectedFiltersAmount]=\"selectedFiltersAmount\"\n\t\t[filterButtonTemplate]=\"filterButtonTemplate\"\n\t\t(filter)=\"filterModalShow$.next(true)\"\n\t\t[enableAction]=\"enableAction\"\n\t\t[canUseAction]=\"actionButtonEnabled\"\n\t\t[actionButtonTemplate]=\"actionButtonTemplate\"\n\t\t[actionLoading]=\"actionButtonLoading\"\n\t\t[actionText]=\"actionButtonText\"\n\t\t[actionIcon]=\"actionButtonIcon\"\n\t\t(action)=\"action.emit()\"\n\t\t[itemsSelectedAmount]=\"selectedRows.length\"\n\t\t[loading]=\"headerLoading\"\n\t>\n\t\t<ng-container *ngIf=\"headerCustomFilterTemplate\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"headerCustomFilterTemplate\"\n\t\t\t></ng-container>\n\t\t</ng-container>\n\t</p-table-header>\n\n\t<p-table-row variant=\"header\">\n\t\t<ng-container *ngFor=\"let col of columns; let index = index\">\n\t\t\t<p-table-cell-ngx\n\t\t\t\t[definition]=\"col\"\n\t\t\t\t[value]=\"col.name\"\n\t\t\t\tvariant=\"header\"\n\t\t\t\t[index]=\"index\"\n\t\t\t\t[checkbox]=\"\n\t\t\t\t\t(index === 0 || col.hasCheckbox) && enableRowSelection\n\t\t\t\t\t\t? checkboxTemplate\n\t\t\t\t\t\t: undefined\n\t\t\t\t\"\n\t\t\t></p-table-cell-ngx>\n\t\t\t<ng-template #checkboxTemplate>\n\t\t\t\t<input\n\t\t\t\t\tclass=\"p-input\"\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t(change)=\"_selectAllChange($event)\"\n\t\t\t\t\t[checked]=\"_selectionContainsAll()\"\n\t\t\t\t\t[indeterminate]=\"_selectionIndeterminate()\"\n\t\t\t\t\t[class.opacity-0]=\"rowSelectionLimit !== undefined\"\n\t\t\t\t\t[disabled]=\"rowSelectionLimit !== undefined\"\n\t\t\t\t/>\n\t\t\t</ng-template>\n\t\t</ng-container>\n\t</p-table-row>\n\n\t<div class=\"flex flex-col flex-1\">\n\t\t<ng-container *ngIf=\"loading; else contentTemplate\">\n\t\t\t<p-table-row\n\t\t\t\t*ngFor=\"let r of loadingRows; let rowIndex = index\"\n\t\t\t\t[enableHover]=\"enableRowSelection || enableRowClick\"\n\t\t\t>\n\t\t\t\t<ng-container *ngFor=\"let col of columns; let index = index\">\n\t\t\t\t\t<p-table-cell-ngx\n\t\t\t\t\t\t[definition]=\"col\"\n\t\t\t\t\t\tvariant=\"loading\"\n\t\t\t\t\t\t[checkbox]=\"\n\t\t\t\t\t\t\t(index === 0 || col.hasCheckbox) &&\n\t\t\t\t\t\t\tenableRowSelection\n\t\t\t\t\t\t\t\t? checkboxTemplate\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t[index]=\"index\"\n\t\t\t\t\t\t[rowIndex]=\"rowIndex\"\n\t\t\t\t\t></p-table-cell-ngx>\n\t\t\t\t\t<ng-template #checkboxTemplate>\n\t\t\t\t\t\t<p-loader\n\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\tclass=\"h-6 w-6 rounded\"\n\t\t\t\t\t\t></p-loader>\n\t\t\t\t\t</ng-template>\n\t\t\t\t</ng-container>\n\t\t\t</p-table-row>\n\t\t</ng-container>\n\n\t\t<ng-template #contentTemplate>\n\t\t\t<ng-container *ngIf=\"items?.length; else emptyStateTemplate\">\n\t\t\t\t<p-table-row\n\t\t\t\t\t*ngFor=\"let item of items; let rowIndex = index\"\n\t\t\t\t\t[enableHover]=\"enableRowSelection || enableRowClick\"\n\t\t\t\t\t(click)=\"_rowClick($event, rowIndex)\"\n\t\t\t\t>\n\t\t\t\t\t<ng-container\n\t\t\t\t\t\t*ngFor=\"let col of columns; let index = index\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<p-table-cell-ngx\n\t\t\t\t\t\t\t[definition]=\"col\"\n\t\t\t\t\t\t\t[item]=\"item\"\n\t\t\t\t\t\t\t[checkbox]=\"\n\t\t\t\t\t\t\t\t(index === 0 || col.hasCheckbox) &&\n\t\t\t\t\t\t\t\tenableRowSelection\n\t\t\t\t\t\t\t\t\t? checkboxTemplate\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t[index]=\"index\"\n\t\t\t\t\t\t\t[rowIndex]=\"rowIndex\"\n\t\t\t\t\t\t\t[template]=\"col.template\"\n\t\t\t\t\t\t></p-table-cell-ngx>\n\n\t\t\t\t\t\t<ng-template #checkboxTemplate>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclass=\"p-input\"\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\t(change)=\"\n\t\t\t\t\t\t\t\t\t_checkboxChange($event.target, rowIndex)\n\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t[disabled]=\"_checkboxDisabled(item, rowIndex)\"\n\t\t\t\t\t\t\t\t[checked]=\"_selectionContains(item, rowIndex)\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t</ng-container>\n\t\t\t\t</p-table-row>\n\t\t\t</ng-container>\n\t\t</ng-template>\n\t</div>\n\n\t<p-table-footer\n\t\t*ngIf=\"enableFooter\"\n\t\t[hideOnSinglePage]=\"hideOnSinglePage\"\n\t\t[enablePageSize]=\"enablePageSize\"\n\t\t[pageSize]=\"pageSize\"\n\t\t[pageSizeOptions]=\"pageSizeOptions\"\n\t\t(pageSizeChange)=\"onPageSizeChange($event)\"\n\t\t[enablePagination]=\"enablePagination\"\n\t\t[page]=\"page\"\n\t\t[total]=\"total\"\n\t\t(pageChange)=\"onPageChange($event)\"\n\t\t[enableExport]=\"enableExport\"\n\t\t(export)=\"export.emit()\"\n\t\t[loading]=\"footerLoading\"\n\t></p-table-footer>\n\n\t<ng-container *ngIf=\"enableFloatingMenu && enableRowSelection\">\n\t\t<p-floating-menu-container\n\t\t\t[class.inactive]=\"!selectedRows.length\"\n\t\t\t[class.shown]=\"floatingMenuShown$ | async\"\n\t\t>\n\t\t\t<p-floating-menu-item\n\t\t\t\t[hover]=\"false\"\n\t\t\t\t[class]=\"{\n\t\t\t\t\thidden: !!floatingMenuContentTemplate,\n\t\t\t\t\t'tablet:flex': !!floatingMenuContentTemplate\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t{{ floatingMenuAmountSelectedText }}\n\t\t\t</p-floating-menu-item>\n\t\t\t<p-divider\n\t\t\t\tclass=\"mx-0 text-storm\"\n\t\t\t\tvariant=\"vertical\"\n\t\t\t\t[class]=\"{\n\t\t\t\t\thidden: !!floatingMenuContentTemplate,\n\t\t\t\t\t'tablet:flex': !!floatingMenuContentTemplate\n\t\t\t\t}\"\n\t\t\t></p-divider>\n\t\t\t<ng-container *ngIf=\"floatingMenuContentTemplate\">\n\t\t\t\t<ng-container\n\t\t\t\t\t*ngTemplateOutlet=\"floatingMenuContentTemplate\"\n\t\t\t\t></ng-container>\n\t\t\t\t<p-divider\n\t\t\t\t\tclass=\"mx-0 text-storm\"\n\t\t\t\t\tvariant=\"vertical\"\n\t\t\t\t></p-divider>\n\t\t\t</ng-container>\n\t\t\t<p-floating-menu-item (click)=\"_selectAllChange(null, false)\">\n\t\t\t\t<p-icon variant=\"negative\"></p-icon>\n\t\t\t</p-floating-menu-item>\n\t\t</p-floating-menu-container>\n\t</ng-container>\n</p-table-container>\n\n<ng-container *ngIf=\"filterModalTemplate\">\n\t<p-modal\n\t\t[header]=\"filterModalHeaderText\"\n\t\t[show]=\"filterModalShow$ | async\"\n\t\t(closed)=\"filterModalShow$.next(false)\"\n\t>\n\t\t<div slot=\"content\" class=\"flex flex-col gap-6\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"filterModalTemplate\"\n\t\t\t></ng-container>\n\t\t</div>\n\t\t<div slot=\"footer\" class=\"flex w-full justify-between gap-4\">\n\t\t\t<p-button\n\t\t\t\t*ngIf=\"filterModalShowResetMobile\"\n\t\t\t\tclass=\"flex w-full tablet:w-auto desktop-xs:hidden\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\t(onClick)=\"onFilterModalReset(true)\"\n\t\t\t>\n\t\t\t\t{{ filterModalResetText }}\n\t\t\t</p-button>\n\t\t\t<p-button\n\t\t\t\t*ngIf=\"filterModalShowReset\"\n\t\t\t\tclass=\"hidden w-full tablet:w-auto desktop-xs:flex\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\t(onClick)=\"onFilterModalReset()\"\n\t\t\t>\n\t\t\t\t{{ filterModalResetText }}\n\t\t\t</p-button>\n\t\t\t<p-button\n\t\t\t\tclass=\"ml-auto w-full tablet:w-auto\"\n\t\t\t\ticon=\"checkmark\"\n\t\t\t\t(onClick)=\"onFilterModalSave()\"\n\t\t\t>\n\t\t\t\t{{ filterModalSaveText }}\n\t\t\t</p-button>\n\t\t</div>\n\t</p-modal>\n</ng-container>\n\n<ng-template #emptyStateTemplate>\n\t<div\n\t\t*ngIf=\"emptyStateType === 'filtered'; else emptyStateNonFilterTemplate\"\n\t\tclass=\"flex max-w-[20rem] flex-col items-center self-center py-24 text-center\"\n\t>\n\t\t<p-illustration\n\t\t\t[variant]=\"emptyStateFilteredIllustration\"\n\t\t\tclass=\"mb-6\"\n\t\t></p-illustration>\n\t\t<p class=\"text-storm-default font-semibold\">\n\t\t\t{{ emptyStateFilteredHeader }}\n\t\t</p>\n\t\t<p class=\"mb-14 text-sm text-storm-medium\">\n\t\t\t{{ emptyStateFilteredContent }}\n\t\t</p>\n\t</div>\n</ng-template>\n\n<ng-template #emptyStateNonFilterTemplate>\n\t<div\n\t\tclass=\"flex max-w-[20rem] flex-col items-center self-center py-24 text-center\"\n\t\t[class.cursor-pointer]=\"enableEmptyStateAction\"\n\t\t(click)=\"emptyStateClicked()\"\n\t>\n\t\t<p-illustration\n\t\t\t[variant]=\"emptyStateIllustration\"\n\t\t\tclass=\"mb-6\"\n\t\t></p-illustration>\n\t\t<p class=\"text-storm-default font-semibold\">\n\t\t\t{{ emptyStateHeader }}\n\t\t</p>\n\t\t<p class=\"mb-6 text-sm text-storm-medium\">\n\t\t\t{{ emptyStateContent }}\n\t\t</p>\n\t\t<p-button\n\t\t\t*ngIf=\"enableEmptyStateAction\"\n\t\t\tvariant=\"secondary\"\n\t\t\ticon=\"plus\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t{{ emptyStateAction }}\n\t\t</p-button>\n\t</div>\n</ng-template>\n", styles: [":host{position:relative;display:flex;flex-direction:column}:host .p-input[type=checkbox]{flex-shrink:0}:host p-table-container{position:relative}:host p-table-container p-floating-menu-container{position:fixed;bottom:1rem;left:50%;--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));animation:forwards floatingMenuContainerIn .3s ease!important}@media (min-width: 40rem){:host p-table-container p-floating-menu-container{position:absolute;bottom:4rem}}:host p-table-container p-floating-menu-container:not(.shown){display:none}:host p-table-container p-floating-menu-container.inactive{animation:forwards floatingMenuContainerOut .3s ease!important}@keyframes floatingMenuContainerOut{0%{display:flex;transform:translateY(0) translate(-50%);opacity:100}99%{transform:translateY(100%) translate(-50%);opacity:0;display:flex}to{transform:translateY(100%) translate(-50%);opacity:0;display:none}}@keyframes floatingMenuContainerIn{0%{transform:translateY(100%) translate(-50%);opacity:0;display:none}1%{transform:translateY(100%) translate(-50%);opacity:0;display:flex}to{transform:translateY(0) translate(-50%);opacity:100;display:flex}}\n"] }]
|
|
3573
|
+
args: [{ selector: 'p-table-ngx', changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-table-container [shadow]=\"shadow\">\n\t<p-table-header\n\t\t*ngIf=\"enableHeader\"\n\t\t[quickFilters]=\"quickFilters\"\n\t\t[activeQuickFilterIdentifier]=\"activeQuickFilterIdentifier\"\n\t\t(quickFilter)=\"onQuickFilter($event)\"\n\t\t[enableSearch]=\"enableSearch\"\n\t\t[query]=\"query\"\n\t\t(queryChange)=\"onQueryChange($event)\"\n\t\t[enableFilter]=\"enableFilter\"\n\t\t[selectedFiltersAmount]=\"selectedFiltersAmount\"\n\t\t[filterButtonTemplate]=\"filterButtonTemplate\"\n\t\t(filter)=\"filterModalShow$.next(true)\"\n\t\t[enableAction]=\"enableAction\"\n\t\t[canUseAction]=\"actionButtonEnabled\"\n\t\t[actionButtonTemplate]=\"actionButtonTemplate\"\n\t\t[actionLoading]=\"actionButtonLoading\"\n\t\t[actionText]=\"actionButtonText\"\n\t\t[actionIcon]=\"actionButtonIcon\"\n\t\t(action)=\"action.emit()\"\n\t\t[itemsSelectedAmount]=\"selectedRows.length\"\n\t\t[loading]=\"headerLoading\"\n\t>\n\t\t<ng-container *ngIf=\"headerCustomFilterTemplate\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"headerCustomFilterTemplate\"\n\t\t\t></ng-container>\n\t\t</ng-container>\n\t</p-table-header>\n\n\t<p-table-row variant=\"header\">\n\t\t<ng-container *ngFor=\"let col of columns; let index = index\">\n\t\t\t<p-table-cell-ngx\n\t\t\t\t[definition]=\"col\"\n\t\t\t\t[value]=\"col.name\"\n\t\t\t\tvariant=\"header\"\n\t\t\t\t[index]=\"index\"\n\t\t\t\t[checkbox]=\"\n\t\t\t\t\t(index === 0 || col.hasCheckbox) && enableRowSelection\n\t\t\t\t\t\t? checkboxTemplate\n\t\t\t\t\t\t: undefined\n\t\t\t\t\"\n\t\t\t></p-table-cell-ngx>\n\t\t\t<ng-template #checkboxTemplate>\n\t\t\t\t<input\n\t\t\t\t\tclass=\"p-input\"\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t(change)=\"_selectAllChange($event)\"\n\t\t\t\t\t[checked]=\"_selectionContainsAll()\"\n\t\t\t\t\t[indeterminate]=\"_selectionIndeterminate()\"\n\t\t\t\t\t[class.opacity-0]=\"rowSelectionLimit !== undefined\"\n\t\t\t\t\t[disabled]=\"rowSelectionLimit !== undefined\"\n\t\t\t\t/>\n\t\t\t</ng-template>\n\t\t</ng-container>\n\t</p-table-row>\n\n\t<div class=\"flex flex-col flex-1\">\n\t\t<ng-container *ngIf=\"loading; else contentTemplate\">\n\t\t\t<p-table-row\n\t\t\t\t*ngFor=\"let r of loadingRows; let rowIndex = index\"\n\t\t\t\t[enableHover]=\"enableRowSelection || enableRowClick\"\n\t\t\t>\n\t\t\t\t<ng-container *ngFor=\"let col of columns; let index = index\">\n\t\t\t\t\t<p-table-cell-ngx\n\t\t\t\t\t\t[definition]=\"col\"\n\t\t\t\t\t\tvariant=\"loading\"\n\t\t\t\t\t\t[checkbox]=\"\n\t\t\t\t\t\t\t(index === 0 || col.hasCheckbox) &&\n\t\t\t\t\t\t\tenableRowSelection\n\t\t\t\t\t\t\t\t? checkboxTemplate\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t[index]=\"index\"\n\t\t\t\t\t\t[rowIndex]=\"rowIndex\"\n\t\t\t\t\t></p-table-cell-ngx>\n\t\t\t\t\t<ng-template #checkboxTemplate>\n\t\t\t\t\t\t<p-loader\n\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\tclass=\"h-6 w-6 rounded\"\n\t\t\t\t\t\t></p-loader>\n\t\t\t\t\t</ng-template>\n\t\t\t\t</ng-container>\n\t\t\t</p-table-row>\n\t\t</ng-container>\n\n\t\t<ng-template #contentTemplate>\n\t\t\t<ng-container *ngIf=\"items?.length; else emptyStateTemplate\">\n\t\t\t\t<p-table-row\n\t\t\t\t\t*ngFor=\"let item of items; let rowIndex = index\"\n\t\t\t\t\t[enableHover]=\"enableRowSelection || enableRowClick\"\n\t\t\t\t\t(click)=\"_rowClick($event, rowIndex)\"\n\t\t\t\t>\n\t\t\t\t\t<ng-container\n\t\t\t\t\t\t*ngFor=\"let col of columns; let index = index\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<p-table-cell-ngx\n\t\t\t\t\t\t\t[definition]=\"col\"\n\t\t\t\t\t\t\t[item]=\"item\"\n\t\t\t\t\t\t\t[checkbox]=\"\n\t\t\t\t\t\t\t\t(index === 0 || col.hasCheckbox) &&\n\t\t\t\t\t\t\t\tenableRowSelection\n\t\t\t\t\t\t\t\t\t? checkboxTemplate\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t[index]=\"index\"\n\t\t\t\t\t\t\t[rowIndex]=\"rowIndex\"\n\t\t\t\t\t\t\t[template]=\"col.template\"\n\t\t\t\t\t\t\t[tableHasActions]=\"\n\t\t\t\t\t\t\t\t!!(rowActionsRow$ | async)?.length &&\n\t\t\t\t\t\t\t\t!(isMobile$ | async)\n\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t></p-table-cell-ngx>\n\n\t\t\t\t\t\t<ng-template #checkboxTemplate>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclass=\"p-input\"\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\t(change)=\"\n\t\t\t\t\t\t\t\t\t_checkboxChange($event.target, rowIndex)\n\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t[disabled]=\"_checkboxDisabled(item, rowIndex)\"\n\t\t\t\t\t\t\t\t[checked]=\"_selectionContains(item, rowIndex)\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t</ng-container>\n\n\t\t\t\t\t<ng-container\n\t\t\t\t\t\t*ngIf=\"\n\t\t\t\t\t\t\t!!(rowActionsRow$ | async)?.length &&\n\t\t\t\t\t\t\t!(isMobile$ | async)\n\t\t\t\t\t\t\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<p-table-cell-ngx\n\t\t\t\t\t\t\tvariant=\"actions\"\n\t\t\t\t\t\t\t[definition]=\"columns[columns.length - 1]\"\n\t\t\t\t\t\t\t[item]=\"parsedItems[rowIndex]\"\n\t\t\t\t\t\t\t[index]=\"columns.length - 1\"\n\t\t\t\t\t\t\t[rowIndex]=\"rowIndex\"\n\t\t\t\t\t\t\t[tableHasActions]=\"\n\t\t\t\t\t\t\t\t!!(rowActionsRow$ | async)?.length\n\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t[template]=\"actionsTemplate\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t</p-table-cell-ngx>\n\n\t\t\t\t\t\t<ng-template #actionsTemplate>\n\t\t\t\t\t\t\t<div class=\"flex ml-auto gap-2 items-center\">\n\t\t\t\t\t\t\t\t<p-tooltip\n\t\t\t\t\t\t\t\t\t[content]=\"action.label\"\n\t\t\t\t\t\t\t\t\t*ngFor=\"\n\t\t\t\t\t\t\t\t\t\tlet action of rowActionsRow$ | async\n\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\t\t\tdata-is-action\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tslot=\"trigger\"\n\t\t\t\t\t\t\t\t\t\t[icon]=\"action.icon\"\n\t\t\t\t\t\t\t\t\t\t[iconRotate]=\"action.iconRotate\"\n\t\t\t\t\t\t\t\t\t\ticonFlip=\"action.iconFlip\"\n\t\t\t\t\t\t\t\t\t\ticonOnly=\"true\"\n\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t[disabled]=\"action.disabled\"\n\t\t\t\t\t\t\t\t\t\t(onClick)=\"\n\t\t\t\t\t\t\t\t\t\t\t_rowActionClick(action, rowIndex)\n\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t></p-button>\n\t\t\t\t\t\t\t\t</p-tooltip>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t</ng-container>\n\t\t\t\t</p-table-row>\n\t\t\t</ng-container>\n\t\t</ng-template>\n\t</div>\n\n\t<p-table-footer\n\t\t*ngIf=\"enableFooter\"\n\t\t[hideOnSinglePage]=\"hideOnSinglePage\"\n\t\t[enablePageSize]=\"enablePageSize\"\n\t\t[pageSize]=\"pageSize\"\n\t\t[pageSizeOptions]=\"pageSizeOptions\"\n\t\t(pageSizeChange)=\"onPageSizeChange($event)\"\n\t\t[enablePagination]=\"enablePagination\"\n\t\t[page]=\"page\"\n\t\t[total]=\"total\"\n\t\t(pageChange)=\"onPageChange($event)\"\n\t\t[enableExport]=\"enableExport\"\n\t\t(export)=\"export.emit()\"\n\t\t[loading]=\"footerLoading\"\n\t></p-table-footer>\n\n\t<ng-container *ngIf=\"enableFloatingMenu && enableRowSelection\">\n\t\t<p-floating-menu-container\n\t\t\t[usedInTable]=\"true\"\n\t\t\t[class.inactive]=\"!selectedRows.length\"\n\t\t\t[class.shown]=\"floatingMenuShown$ | async\"\n\t\t>\n\t\t\t<p-floating-menu-item\n\t\t\t\t[hover]=\"false\"\n\t\t\t\t[class]=\"{\n\t\t\t\t\thidden: !!(rowActionsFloating$ | async)?.length,\n\t\t\t\t\t'tablet:flex': !!(rowActionsFloating$ | async)?.length\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t{{ floatingMenuAmountSelectedText }}\n\t\t\t</p-floating-menu-item>\n\t\t\t<p-divider\n\t\t\t\tclass=\"mx-0 text-storm\"\n\t\t\t\tvariant=\"vertical\"\n\t\t\t\t[class]=\"{\n\t\t\t\t\thidden: !!(rowActionsFloating$ | async)?.length,\n\t\t\t\t\t'tablet:flex': !!(rowActionsFloating$ | async)?.length\n\t\t\t\t}\"\n\t\t\t></p-divider>\n\n\t\t\t<p-floating-menu-item\n\t\t\t\t*ngFor=\"let action of rowActionsFloating$ | async\"\n\t\t\t\tslot=\"floating-menu-item\"\n\t\t\t\t[disabled]=\"\n\t\t\t\t\t(action.type === 'single' && selectedRows.length > 1) ||\n\t\t\t\t\taction.disabled\n\t\t\t\t\"\n\t\t\t\t(click)=\"_rowActionClick(action)\"\n\t\t\t>\n\t\t\t\t{{ action.label }}\n\t\t\t\t<p-icon\n\t\t\t\t\t[variant]=\"action.icon\"\n\t\t\t\t\t[rotate]=\"action.iconRotate\"\n\t\t\t\t\t[flip]=\"action.iconFlip\"\n\t\t\t\t/>\n\t\t\t</p-floating-menu-item>\n\n\t\t\t<p-floating-menu-item (click)=\"_selectAllChange(null, false)\">\n\t\t\t\t<p-icon variant=\"negative\"></p-icon>\n\t\t\t</p-floating-menu-item>\n\t\t</p-floating-menu-container>\n\t</ng-container>\n</p-table-container>\n\n<ng-container *ngIf=\"filterModalTemplate\">\n\t<p-modal\n\t\t[header]=\"filterModalHeaderText\"\n\t\t[show]=\"filterModalShow$ | async\"\n\t\t(closed)=\"filterModalShow$.next(false)\"\n\t>\n\t\t<div slot=\"content\" class=\"flex flex-col gap-6\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"filterModalTemplate\"\n\t\t\t></ng-container>\n\t\t</div>\n\t\t<div slot=\"footer\" class=\"flex w-full justify-between gap-4\">\n\t\t\t<p-button\n\t\t\t\t*ngIf=\"filterModalShowResetMobile\"\n\t\t\t\tclass=\"flex w-full tablet:w-auto desktop-xs:hidden\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\t(onClick)=\"onFilterModalReset(true)\"\n\t\t\t>\n\t\t\t\t{{ filterModalResetText }}\n\t\t\t</p-button>\n\t\t\t<p-button\n\t\t\t\t*ngIf=\"filterModalShowReset\"\n\t\t\t\tclass=\"hidden w-full tablet:w-auto desktop-xs:flex\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\t(onClick)=\"onFilterModalReset()\"\n\t\t\t>\n\t\t\t\t{{ filterModalResetText }}\n\t\t\t</p-button>\n\t\t\t<p-button\n\t\t\t\tclass=\"ml-auto w-full tablet:w-auto\"\n\t\t\t\ticon=\"checkmark\"\n\t\t\t\t(onClick)=\"onFilterModalSave()\"\n\t\t\t>\n\t\t\t\t{{ filterModalSaveText }}\n\t\t\t</p-button>\n\t\t</div>\n\t</p-modal>\n</ng-container>\n\n<ng-template #emptyStateTemplate>\n\t<div\n\t\t*ngIf=\"emptyStateType === 'filtered'; else emptyStateNonFilterTemplate\"\n\t\tclass=\"flex max-w-[20rem] flex-col items-center self-center py-24 text-center\"\n\t>\n\t\t<p-illustration\n\t\t\t[variant]=\"emptyStateFilteredIllustration\"\n\t\t\tclass=\"mb-6\"\n\t\t></p-illustration>\n\t\t<p class=\"text-storm-default font-semibold\">\n\t\t\t{{ emptyStateFilteredHeader }}\n\t\t</p>\n\t\t<p class=\"mb-14 text-sm text-storm-medium\">\n\t\t\t{{ emptyStateFilteredContent }}\n\t\t</p>\n\t</div>\n</ng-template>\n\n<ng-template #emptyStateNonFilterTemplate>\n\t<div\n\t\tclass=\"flex max-w-[20rem] flex-col items-center self-center py-24 text-center\"\n\t\t[class.cursor-pointer]=\"enableEmptyStateAction\"\n\t\t(click)=\"emptyStateClicked()\"\n\t>\n\t\t<p-illustration\n\t\t\t[variant]=\"emptyStateIllustration\"\n\t\t\tclass=\"mb-6\"\n\t\t></p-illustration>\n\t\t<p class=\"text-storm-default font-semibold\">\n\t\t\t{{ emptyStateHeader }}\n\t\t</p>\n\t\t<p class=\"mb-6 text-sm text-storm-medium\">\n\t\t\t{{ emptyStateContent }}\n\t\t</p>\n\t\t<p-button\n\t\t\t*ngIf=\"enableEmptyStateAction\"\n\t\t\tvariant=\"secondary\"\n\t\t\ticon=\"plus\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t{{ emptyStateAction }}\n\t\t</p-button>\n\t</div>\n</ng-template>\n", styles: [":host{position:relative;display:flex;flex-direction:column}:host .p-input[type=checkbox]{flex-shrink:0}:host p-table-container{position:relative}:host p-table-container p-floating-menu-container{position:fixed;bottom:1rem;left:50%;--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));animation:forwards floatingMenuContainerIn .3s ease!important}@media (min-width: 40rem){:host p-table-container p-floating-menu-container{position:absolute;bottom:4rem}}:host p-table-container p-floating-menu-container:not(.shown){display:none}:host p-table-container p-floating-menu-container.inactive{animation:forwards floatingMenuContainerOut .3s ease!important}@keyframes floatingMenuContainerOut{0%{display:flex;transform:translateY(0) translate(-50%);opacity:100}99%{transform:translateY(100%) translate(-50%);opacity:0;display:flex}to{transform:translateY(100%) translate(-50%);opacity:0;display:none}}@keyframes floatingMenuContainerIn{0%{transform:translateY(100%) translate(-50%);opacity:0;display:none}1%{transform:translateY(100%) translate(-50%);opacity:0;display:flex}to{transform:translateY(0) translate(-50%);opacity:100;display:flex}}\n"] }]
|
|
3441
3574
|
}], propDecorators: { items: [{
|
|
3442
3575
|
type: Input
|
|
3443
3576
|
}], loading: [{
|
|
@@ -3468,12 +3601,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
3468
3601
|
type: Input
|
|
3469
3602
|
}], floatingMenuAmountSelectedTemplate: [{
|
|
3470
3603
|
type: Input
|
|
3471
|
-
}], floatingMenuContentTemplate: [{
|
|
3472
|
-
type: ContentChild,
|
|
3473
|
-
args: [TableFloatingMenuContentDirective, {
|
|
3474
|
-
read: TemplateRef,
|
|
3475
|
-
static: true,
|
|
3476
|
-
}]
|
|
3477
3604
|
}], rowClick: [{
|
|
3478
3605
|
type: Output
|
|
3479
3606
|
}], rowSelected: [{
|
|
@@ -3577,6 +3704,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
3577
3704
|
read: TemplateRef,
|
|
3578
3705
|
static: true,
|
|
3579
3706
|
}]
|
|
3707
|
+
}], rowActions: [{
|
|
3708
|
+
type: ContentChildren,
|
|
3709
|
+
args: [TableRowAction]
|
|
3580
3710
|
}], filterModalHeaderText: [{
|
|
3581
3711
|
type: Input
|
|
3582
3712
|
}], filterModalSaveText: [{
|
|
@@ -3595,6 +3725,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
3595
3725
|
type: Output
|
|
3596
3726
|
}], filterModalReset: [{
|
|
3597
3727
|
type: Output
|
|
3728
|
+
}], onResize: [{
|
|
3729
|
+
type: HostListener,
|
|
3730
|
+
args: ['window:resize', ['$event']]
|
|
3598
3731
|
}], keyDown: [{
|
|
3599
3732
|
type: HostListener,
|
|
3600
3733
|
args: ['document:keydown', ['$event']]
|
|
@@ -3606,12 +3739,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
3606
3739
|
args: ['document:visibilitychange', ['$event']]
|
|
3607
3740
|
}] } });
|
|
3608
3741
|
|
|
3609
|
-
const TABLE_COMPONENTS = [Table, TableCell, TableColumn];
|
|
3742
|
+
const TABLE_COMPONENTS = [Table, TableCell, TableColumn, TableRowAction];
|
|
3610
3743
|
|
|
3611
3744
|
class TableModule {
|
|
3612
3745
|
}
|
|
3613
3746
|
TableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3614
|
-
TableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: TableModule, declarations: [Table, TableCell, TableColumn, TableFooterDirective, TableHeaderDirective, TableDirective, TableNgxDirective, TableFilterModalDirective, TableCustomFilterDirective
|
|
3747
|
+
TableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: TableModule, declarations: [Table, TableCell, TableColumn, TableRowAction, TableFooterDirective, TableHeaderDirective, TableDirective, TableNgxDirective, TableFilterModalDirective, TableCustomFilterDirective], imports: [CommonModule, StencilModule], exports: [Table, TableCell, TableColumn, TableRowAction, TableFooterDirective, TableHeaderDirective, TableDirective, TableNgxDirective, TableFilterModalDirective, TableCustomFilterDirective] });
|
|
3615
3748
|
TableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableModule, imports: [CommonModule, StencilModule] });
|
|
3616
3749
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableModule, decorators: [{
|
|
3617
3750
|
type: NgModule,
|
|
@@ -3872,5 +4005,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
3872
4005
|
* Generated bundle index. Do not edit.
|
|
3873
4006
|
*/
|
|
3874
4007
|
|
|
3875
|
-
export { BaseFormComponent, BaseTableComponent, BaseUploadComponent, BaseValueAccessor, CropperDirective, CustomCurrencyPipe, CustomDatePipe, DIRECTIVES$1 as DIRECTIVES, DatepickerDirective, FADE_IN, FADE_OUT, MODULES, OVERLAY_SERVICES, OverlayModule, OverlayRef, OverlayService, PAccordion, PAttachment, PAvatar, PAvatarGroup, PBackdrop, PButton, PCalendar, PCardBody, PCardContainer, PCardHeader, PContentSlider, PCounter, PCropper, PDatepicker, PDivider, PDrawer, PDrawerBody, PDrawerContainer, PDrawerHeader, PDropdown, PDropdownMenuContainer, PDropdownMenuItem, PFloatingMenuContainer, PFloatingMenuItem, PHelper, PIPES, PIcon, PIllustration, PInfoPanel, PInputError, PInputGroup, PLabel, PLayout, PLoader, PModal, PModalBody, PModalContainer, PModalFooter, PModalHeader, PNavbar, PNavigationItem, PPageSizeSelect, PPagination, PPaginationItem, PProfile, PSegmentContainer, PSegmentItem, PSelect, PSliderIndicator, PStatus, PStepper, PStepperItem, PStepperLine, PTabGroup, PTabItem, PTableContainer, PTableFooter, PTableHeader, PTableRow, PToast, PTooltip, PageSizeSelectDirective, PaginationDirective, PaperlessModule, SLIDE_IN_BOTTOM_OUT_TOP, SLIDE_IN_TOP_OUT_BOTTOM, SafePipe, SelectDirective, StencilModule, TABLE_COMPONENTS, TABLE_DIRECTIVES, TOAST_COMPONENTS, TOAST_DIRECTIVES, TOAST_SERVICES, Table, TableCell, TableColumn, TableCustomFilterDirective, TableDirective, TableFilterModalDirective,
|
|
4008
|
+
export { BaseFormComponent, BaseTableComponent, BaseUploadComponent, BaseValueAccessor, CropperDirective, CustomCurrencyPipe, CustomDatePipe, DIRECTIVES$1 as DIRECTIVES, DatepickerDirective, FADE_IN, FADE_OUT, MODULES, OVERLAY_SERVICES, OverlayModule, OverlayRef, OverlayService, PAccordion, PAttachment, PAvatar, PAvatarGroup, PBackdrop, PButton, PCalendar, PCardBody, PCardContainer, PCardHeader, PContentSlider, PCounter, PCropper, PDatepicker, PDivider, PDrawer, PDrawerBody, PDrawerContainer, PDrawerHeader, PDropdown, PDropdownMenuContainer, PDropdownMenuItem, PFloatingMenuContainer, PFloatingMenuItem, PHelper, PIPES, PIcon, PIllustration, PInfoPanel, PInputError, PInputGroup, PLabel, PLayout, PLoader, PModal, PModalBody, PModalContainer, PModalFooter, PModalHeader, PNavbar, PNavigationItem, PPageSizeSelect, PPagination, PPaginationItem, PProfile, PSegmentContainer, PSegmentItem, PSelect, PSliderIndicator, PStatus, PStepper, PStepperItem, PStepperLine, PTabGroup, PTabItem, PTableContainer, PTableFooter, PTableHeader, PTableRow, PToast, PTooltip, PageSizeSelectDirective, PaginationDirective, PaperlessModule, SLIDE_IN_BOTTOM_OUT_TOP, SLIDE_IN_TOP_OUT_BOTTOM, SafePipe, SelectDirective, StencilModule, TABLE_COMPONENTS, TABLE_DIRECTIVES, TOAST_COMPONENTS, TOAST_DIRECTIVES, TOAST_SERVICES, Table, TableCell, TableColumn, TableCustomFilterDirective, TableDirective, TableFilterModalDirective, TableFooterDirective, TableHeaderDirective, TableModule, TableNgxDirective, TableRowAction, ToastContainer, ToastDirective, ToastModule, ToastService, ToastVariants, createFormFilters };
|
|
3876
4009
|
//# sourceMappingURL=paperless-angular.mjs.map
|