@paperless/angular 1.51.4 → 1.52.1
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/animations/fade.mjs +1 -1
- package/esm2020/lib/animations/slide.mjs +1 -1
- package/esm2020/lib/base/form.component.mjs +5 -5
- package/esm2020/lib/base/upload.component.mjs +1 -1
- package/esm2020/lib/base/value-accessor.mjs +2 -3
- package/esm2020/lib/directives/index.mjs +1 -1
- package/esm2020/lib/directives/p-datepicker.directive.mjs +3 -2
- package/esm2020/lib/directives/p-page-size-select.directive.mjs +3 -4
- package/esm2020/lib/directives/p-pagination.directive.mjs +3 -4
- package/esm2020/lib/modules/overlay/overlay.module.mjs +1 -1
- package/esm2020/lib/modules/overlay/overlay.ref.mjs +1 -1
- package/esm2020/lib/modules/overlay/services/overlay.service.mjs +1 -1
- package/esm2020/lib/modules/table/base/index.mjs +1 -1
- package/esm2020/lib/modules/table/base/table.component.mjs +7 -10
- package/esm2020/lib/modules/table/components/table/table.component.mjs +105 -32
- package/esm2020/lib/modules/table/components/table-cell/table-cell.component.mjs +45 -19
- package/esm2020/lib/modules/table/components/table-column/table-column.component.mjs +6 -25
- package/esm2020/lib/modules/table/components/table-row-action/table-row-action.component.mjs +1 -1
- package/esm2020/lib/modules/table/directives/p-table-custom-filter.directive.mjs +1 -1
- package/esm2020/lib/modules/table/directives/p-table-filter-modal.directive.mjs +1 -1
- package/esm2020/lib/modules/table/directives/p-table-header.directive.mjs +2 -3
- package/esm2020/lib/modules/table/directives/p-table-ngx.directive.mjs +13 -6
- package/esm2020/lib/modules/table/directives/p-table.directive.mjs +2 -3
- package/esm2020/lib/modules/table/utils.mjs +2 -2
- package/esm2020/lib/modules/toast/components/toast-container/toast-container.component.mjs +4 -4
- package/esm2020/lib/modules/toast/directives/toast.directive.mjs +1 -1
- package/esm2020/lib/modules/toast/services/toast.service.mjs +1 -1
- package/esm2020/lib/modules/toast/toast.module.mjs +1 -1
- package/esm2020/lib/modules/toast/types.mjs +1 -1
- package/esm2020/lib/paperless.module.mjs +1 -1
- package/esm2020/lib/pipes/currency.pipe.mjs +1 -1
- package/esm2020/lib/pipes/safe.pipe.mjs +1 -1
- package/esm2020/lib/stencil.module.mjs +1 -1
- package/fesm2015/paperless-angular.mjs +188 -106
- package/fesm2015/paperless-angular.mjs.map +1 -1
- package/fesm2020/paperless-angular.mjs +187 -107
- package/fesm2020/paperless-angular.mjs.map +1 -1
- package/lib/modules/table/components/table/table.component.d.ts +5 -0
- package/lib/modules/table/components/table-cell/table-cell.component.d.ts +1 -0
- package/lib/modules/table/components/table-column/table-column.component.d.ts +2 -3
- package/package.json +1 -1
- package/paperless.css +48 -0
|
@@ -2,7 +2,7 @@ import { trigger, transition, style, animate } from '@angular/animations';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { Component, EventEmitter, ChangeDetectionStrategy, Input, Output, ViewChild, Directive, HostListener, NgModule, Injector, Injectable, HostBinding, TemplateRef, ContentChild, Host, ContentChildren, Pipe } from '@angular/core';
|
|
4
4
|
import { FormControl, FormGroup, FormArray, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
-
import { BehaviorSubject, fromEvent, Subject, timer, distinctUntilChanged, take, map as map$1 } from 'rxjs';
|
|
5
|
+
import { BehaviorSubject, fromEvent, Subject, timer, distinctUntilChanged, take, filter as filter$1, map as map$1 } from 'rxjs';
|
|
6
6
|
import * as i1$1 from '@angular/common';
|
|
7
7
|
import { CommonModule, DatePipe, CurrencyPipe } from '@angular/common';
|
|
8
8
|
import { __decorate } from 'tslib';
|
|
@@ -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, isMobile } from '@paperless/core';
|
|
16
|
+
import { objectGetByPath, isTableColumnSizesKey, isMobile, tableColumSizesOptions } from '@paperless/core';
|
|
17
17
|
import * as i2 from '@angular/router';
|
|
18
18
|
import { RouterModule } from '@angular/router';
|
|
19
19
|
import { v4 } from 'uuid';
|
|
@@ -65,7 +65,7 @@ class BaseFormComponent {
|
|
|
65
65
|
}
|
|
66
66
|
scrollToFirstError() {
|
|
67
67
|
const invalidInputs = Array.from(document.getElementsByClassName('ng-invalid'))
|
|
68
|
-
.filter(
|
|
68
|
+
.filter(e => { var _a; return ((_a = e === null || e === void 0 ? void 0 : e.nodeName) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== 'form'; })
|
|
69
69
|
.sort((a, b) => a.scrollTop - b.scrollTop);
|
|
70
70
|
const first = invalidInputs[0];
|
|
71
71
|
if (first) {
|
|
@@ -109,13 +109,13 @@ class BaseFormComponent {
|
|
|
109
109
|
return this.firstControlError(control);
|
|
110
110
|
}
|
|
111
111
|
hasControlError(control, showChildErrors = true) {
|
|
112
|
-
return (
|
|
112
|
+
return (control === null || control === void 0 ? void 0 : control.dirty) && this.firstControlError(control, showChildErrors);
|
|
113
113
|
}
|
|
114
114
|
firstControlError(control, showChildErrors = true) {
|
|
115
115
|
if (control instanceof FormGroup && showChildErrors) {
|
|
116
116
|
const errors = Object.keys(control.controls)
|
|
117
|
-
.map(
|
|
118
|
-
.filter(
|
|
117
|
+
.map(key => this.firstControlError(control.controls[key]))
|
|
118
|
+
.filter(val => !!val);
|
|
119
119
|
return errors[0];
|
|
120
120
|
}
|
|
121
121
|
if (!(control === null || control === void 0 ? void 0 : control.errors)) {
|
|
@@ -227,8 +227,7 @@ class BaseValueAccessor {
|
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
229
|
writeValue(value) {
|
|
230
|
-
this.el.nativeElement.value = this.lastValue =
|
|
231
|
-
value == null ? '' : value;
|
|
230
|
+
this.el.nativeElement.value = this.lastValue = value == null ? '' : value;
|
|
232
231
|
}
|
|
233
232
|
handleChangeEvent(value) {
|
|
234
233
|
if (value !== this.lastValue) {
|
|
@@ -294,7 +293,8 @@ class DatepickerDirective extends BaseValueAccessor {
|
|
|
294
293
|
super(el);
|
|
295
294
|
}
|
|
296
295
|
writeValue(value) {
|
|
297
|
-
this.el.nativeElement.value = this.lastValue =
|
|
296
|
+
this.el.nativeElement.value = this.lastValue =
|
|
297
|
+
value === null ? JSON.parse(value) : value;
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
DatepickerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DatepickerDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -327,11 +327,10 @@ class PageSizeSelectDirective extends BaseValueAccessor {
|
|
|
327
327
|
super(el);
|
|
328
328
|
}
|
|
329
329
|
writeValue(value) {
|
|
330
|
-
this.el.nativeElement.page = this.lastValue =
|
|
331
|
-
value == null ? 12 : value;
|
|
330
|
+
this.el.nativeElement.page = this.lastValue = value == null ? 12 : value;
|
|
332
331
|
}
|
|
333
332
|
registerOnChange(fn) {
|
|
334
|
-
super.registerOnChange(
|
|
333
|
+
super.registerOnChange(value => fn(parseInt(value, 10)));
|
|
335
334
|
}
|
|
336
335
|
}
|
|
337
336
|
PageSizeSelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PageSizeSelectDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -365,11 +364,10 @@ class PaginationDirective extends BaseValueAccessor {
|
|
|
365
364
|
super(el);
|
|
366
365
|
}
|
|
367
366
|
writeValue(value) {
|
|
368
|
-
this.el.nativeElement.page = this.lastValue =
|
|
369
|
-
value == null ? 1 : value;
|
|
367
|
+
this.el.nativeElement.page = this.lastValue = value == null ? 1 : value;
|
|
370
368
|
}
|
|
371
369
|
registerOnChange(fn) {
|
|
372
|
-
super.registerOnChange(
|
|
370
|
+
super.registerOnChange(value => fn(parseInt(value, 10)));
|
|
373
371
|
}
|
|
374
372
|
}
|
|
375
373
|
PaginationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PaginationDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -2144,7 +2142,7 @@ const createFormFilters = (values, quickFilters, quickFilterKey) => {
|
|
|
2144
2142
|
continue;
|
|
2145
2143
|
}
|
|
2146
2144
|
if (quickFilterKey && key === quickFilterKey) {
|
|
2147
|
-
quickFilter = quickFilters.find(
|
|
2145
|
+
quickFilter = quickFilters.find(f => f.value === value);
|
|
2148
2146
|
continue;
|
|
2149
2147
|
}
|
|
2150
2148
|
filters.push({
|
|
@@ -2264,14 +2262,14 @@ let BaseTableComponent = class BaseTableComponent extends BaseFormComponent {
|
|
|
2264
2262
|
selectedRows: this.parsedDefaultTableValues.selectedRows,
|
|
2265
2263
|
});
|
|
2266
2264
|
this.tableOptions.valueChanges
|
|
2267
|
-
.pipe(untilDestroyed(this), startWith(this.tableOptions.value), tap((value) => this.tableOptionsChange.next(value)), pairwise(), map(([previous, next]) => this._getChanges(previous, next)), filter(
|
|
2265
|
+
.pipe(untilDestroyed(this), startWith(this.tableOptions.value), tap((value) => this.tableOptionsChange.next(value)), pairwise(), map(([previous, next]) => this._getChanges(previous, next)), filter(changes => !!changes), debounce(changes => {
|
|
2268
2266
|
var _a;
|
|
2269
2267
|
if ((changes === null || changes === void 0 ? void 0 : changes.query) && ((_a = Object.keys(changes)) === null || _a === void 0 ? void 0 : _a.length) === 1) {
|
|
2270
2268
|
return timer(300);
|
|
2271
2269
|
}
|
|
2272
2270
|
return timer(0);
|
|
2273
2271
|
}))
|
|
2274
|
-
.subscribe(
|
|
2272
|
+
.subscribe(changes => {
|
|
2275
2273
|
if (changes === null || changes === void 0 ? void 0 : changes.page) {
|
|
2276
2274
|
this._refresh();
|
|
2277
2275
|
return;
|
|
@@ -2297,17 +2295,15 @@ let BaseTableComponent = class BaseTableComponent extends BaseFormComponent {
|
|
|
2297
2295
|
checkFilterForm() {
|
|
2298
2296
|
var _a, _b;
|
|
2299
2297
|
for (const key of Object.keys(this.filterForm.controls)) {
|
|
2300
|
-
const filter = this.filters.find(
|
|
2301
|
-
(key === this.filterFormQuickFilterKey
|
|
2302
|
-
? this.quickFilter
|
|
2303
|
-
: null);
|
|
2298
|
+
const filter = this.filters.find(f => f.key === key) ||
|
|
2299
|
+
(key === this.filterFormQuickFilterKey ? this.quickFilter : null);
|
|
2304
2300
|
(_a = this.filterForm.get(key)) === null || _a === void 0 ? void 0 : _a.setValue((_b = filter === null || filter === void 0 ? void 0 : filter.value) !== null && _b !== void 0 ? _b : null);
|
|
2305
2301
|
}
|
|
2306
2302
|
}
|
|
2307
2303
|
resetFormFilters(resetQuickFilter = false) {
|
|
2308
2304
|
var _a;
|
|
2309
2305
|
const values = this.filterForm.value;
|
|
2310
|
-
const defaultQuickFilter = this.quickFilters.find(
|
|
2306
|
+
const defaultQuickFilter = this.quickFilters.find(f => f.default);
|
|
2311
2307
|
for (const key of Object.keys(values)) {
|
|
2312
2308
|
if (key === this.filterFormQuickFilterKey) {
|
|
2313
2309
|
if (resetQuickFilter) {
|
|
@@ -2352,8 +2348,7 @@ let BaseTableComponent = class BaseTableComponent extends BaseFormComponent {
|
|
|
2352
2348
|
}
|
|
2353
2349
|
_watchProperty(observable, identifier = 'id') {
|
|
2354
2350
|
return observable.pipe(untilDestroyed(this), startWith(null), pairwise(), filter(([prev, cur]) => prev !== cur && !!cur), tap(([previous, current]) => {
|
|
2355
|
-
if (previous &&
|
|
2356
|
-
previous[identifier] !== (current === null || current === void 0 ? void 0 : current[identifier])) {
|
|
2351
|
+
if (previous && previous[identifier] !== (current === null || current === void 0 ? void 0 : current[identifier])) {
|
|
2357
2352
|
this.resetTable(false, true);
|
|
2358
2353
|
}
|
|
2359
2354
|
}), map(([_, current]) => current));
|
|
@@ -2403,6 +2398,14 @@ class TableCell {
|
|
|
2403
2398
|
value: this.value,
|
|
2404
2399
|
};
|
|
2405
2400
|
}
|
|
2401
|
+
if (this.variant === 'actions') {
|
|
2402
|
+
return {
|
|
2403
|
+
value: this.value,
|
|
2404
|
+
item: this.item,
|
|
2405
|
+
index: this.index,
|
|
2406
|
+
rowIndex: this.rowIndex,
|
|
2407
|
+
};
|
|
2408
|
+
}
|
|
2406
2409
|
return {
|
|
2407
2410
|
value: (_a = this.value) !== null && _a !== void 0 ? _a : objectGetByPath(this.item, this.definition.path),
|
|
2408
2411
|
item: this.item,
|
|
@@ -2440,11 +2443,12 @@ class TableCell {
|
|
|
2440
2443
|
// );
|
|
2441
2444
|
// }
|
|
2442
2445
|
getColumnClasses() {
|
|
2443
|
-
var _a, _b, _c, _d, _e, _f
|
|
2446
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2444
2447
|
const sizes = this.definition ? this._getSizes(this.definition) : {};
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
+
const isLastValues = this.definition
|
|
2449
|
+
? this._getIsLastValues(this.definition)
|
|
2450
|
+
: {};
|
|
2451
|
+
return Object.assign(Object.assign({ 'justify-start': !((_a = this.definition) === null || _a === void 0 ? void 0 : _a.align) || ((_b = this.definition) === null || _b === void 0 ? void 0 : _b.align) === 'start', 'justify-center': ((_c = this.definition) === null || _c === void 0 ? void 0 : _c.align) === 'center', 'justify-end': ((_d = this.definition) === null || _d === void 0 ? void 0 : _d.align) === 'end', 'font-semibold': this.variant !== 'header' && ((_e = this.definition) === null || _e === void 0 ? void 0 : _e.type) === 'th', 'text-storm-dark': this.variant !== 'header' && ((_f = this.definition) === null || _f === void 0 ? void 0 : _f.type) === 'th', 'group-hover:flex': this.variant === 'actions' && this.tableHasActions, hidden: this.variant === 'actions' && this.tableHasActions }, sizes), isLastValues);
|
|
2448
2452
|
}
|
|
2449
2453
|
/*
|
|
2450
2454
|
With this, we shall hack the system in ways no one would ever have thought.
|
|
@@ -2457,13 +2461,13 @@ class TableCell {
|
|
|
2457
2461
|
desktop:w-1/12 desktop:w-2/12 desktop:w-3/12 desktop:w-4/12 desktop:w-5/12 desktop:w-6/12 desktop:w-7/12 desktop:w-8/12 desktop:w-9/12 desktop:w-10/12 desktop:w-11/12 desktop:w-12/12
|
|
2458
2462
|
desktop-lg:w-1/12 desktop-lg:w-2/12 desktop-lg:w-3/12 desktop-lg:w-4/12 desktop-lg:w-5/12 desktop-lg:w-6/12 desktop-lg:w-7/12 desktop-lg:w-8/12 desktop-lg:w-9/12 desktop-lg:w-10/12 desktop-lg:w-11/12 desktop-lg:w-12/12
|
|
2459
2463
|
desktop-xl:w-1/12 desktop-xl:w-2/12 desktop-xl:w-3/12 desktop-xl:w-4/12 desktop-xl:w-5/12 desktop-xl:w-6/12 desktop-xl:w-7/12 desktop-xl:w-8/12 desktop-xl:w-9/12 desktop-xl:w-10/12 desktop-xl:w-11/12 desktop-xl:w-12/12
|
|
2460
|
-
hidden flex
|
|
2461
|
-
tablet:hidden tablet:flex
|
|
2462
|
-
desktop-xs:hidden desktop-xs:flex
|
|
2463
|
-
desktop-sm:hidden desktop-sm:flex
|
|
2464
|
-
desktop:hidden desktop:flex
|
|
2465
|
-
desktop-lg:hidden desktop-lg:flex
|
|
2466
|
-
desktop-xl:hidden desktop-xl:flex
|
|
2464
|
+
hidden flex group-hover:hidden group-hover:flex
|
|
2465
|
+
tablet:hidden tablet:flex tablet:group-hover:hidden tablet:group-hover:flex
|
|
2466
|
+
desktop-xs:hidden desktop-xs:flex desktop-xs:group-hover:hidden desktop-xs:group-hover:flex
|
|
2467
|
+
desktop-sm:hidden desktop-sm:flex desktop-sm:group-hover:hidden desktop-sm:group-hover:flex
|
|
2468
|
+
desktop:hidden desktop:flex desktop:group-hover:hidden desktop:group-hover:flex
|
|
2469
|
+
desktop-lg:hidden desktop-lg:flex desktop-lg:group-hover:hidden desktop-lg:group-hover:flex
|
|
2470
|
+
desktop-xl:hidden desktop-xl:flex desktop-xl:group-hover:hidden desktop-xl:group-hover:flex
|
|
2467
2471
|
|
|
2468
2472
|
|
|
2469
2473
|
⠀⠀⠀⠀⠀⣠⣴⣶⣿⣿⠿⣷⣶⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣶⣷⠿⣿⣿⣶⣦⣀⠀⠀⠀⠀⠀
|
|
@@ -2476,8 +2480,7 @@ class TableCell {
|
|
|
2476
2480
|
⠀⠀⣨⣷⣶⣿⣧⣛⣛⠿⠿⣿⢿⣿⣿⣛⣿⡿⠀⠀⡇⠀⠀⠀⠀⢸⠀⠈⢿⣟⣛⠿⢿⡿⢿⢿⢿⣛⣫⣼⡿⣶⣾⣅⡀⠀
|
|
2477
2481
|
⢀⡼⠋⠁⠀⠀⠈⠉⠛⠛⠻⠟⠸⠛⠋⠉⠁⠀⠀⢸⡇⠀⠀⠄⠀⢸⡄⠀⠀⠈⠉⠙⠛⠃⠻⠛⠛⠛⠉⠁⠀⠀⠈⠙⢧⡀
|
|
2478
2482
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⡇⢠⠀⠀⠀⢸⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
|
2479
|
-
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⡇⠀⠀⠀⠀⢸⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
|
2480
|
-
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⠟⠁⣿⠇⠀⠀⠀⠀⢸⡇⠙⢿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
|
2483
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⡇⠀⠀⠀⠀⢸⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⠟⠁⣿⠇⠀⠀⠀⠀⢸⡇⠙⢿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
|
2481
2484
|
⠀⠰⣄⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⠖⡾⠁⠀⠀⣿⠀⠀⠀⠀⠀⠘⣿⠀⠀⠙⡇⢸⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⣰⠄⠀
|
|
2482
2485
|
⠀⠀⢻⣷⡦⣤⣤⣤⡴⠶⠿⠛⠉⠁⠀⢳⠀⢠⡀⢿⣀⠀⠀⠀⠀⣠⡟⢀⣀⢠⠇⠀⠈⠙⠛⠷⠶⢦⣤⣤⣤⢴⣾⡏⠀⠀
|
|
2483
2486
|
⠀⠀⠈⣿⣧⠙⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠘⠛⢊⣙⠛⠒⠒⢛⣋⡚⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⡿⠁⣾⡿⠀⠀⠀
|
|
@@ -2527,10 +2530,11 @@ class TableCell {
|
|
|
2527
2530
|
const previousValue = previousSize ? sizes[previousSize] : null;
|
|
2528
2531
|
if (currentValue !== 'hidden' &&
|
|
2529
2532
|
previousValue &&
|
|
2530
|
-
previousValue === 'hidden'
|
|
2533
|
+
previousValue === 'hidden' &&
|
|
2534
|
+
this.variant !== 'actions') {
|
|
2531
2535
|
classes[`${size}:flex`] = true;
|
|
2532
2536
|
}
|
|
2533
|
-
if (currentValue === 'hidden') {
|
|
2537
|
+
if (currentValue === 'hidden' && this.variant !== 'actions') {
|
|
2534
2538
|
classes[`${size}:hidden`] = true;
|
|
2535
2539
|
previousSize = size;
|
|
2536
2540
|
continue;
|
|
@@ -2553,12 +2557,31 @@ class TableCell {
|
|
|
2553
2557
|
[`w-${sizes}/12`]: true,
|
|
2554
2558
|
};
|
|
2555
2559
|
}
|
|
2560
|
+
_getIsLastValues({ isLast, parsedSizes, } /* Table Definition */) {
|
|
2561
|
+
const values = {};
|
|
2562
|
+
for (let size of Object.keys(isLast)) {
|
|
2563
|
+
let prefix = '';
|
|
2564
|
+
if (size !== 'default') {
|
|
2565
|
+
prefix = `${size}:`;
|
|
2566
|
+
}
|
|
2567
|
+
values[`${prefix}pr-4`] = !isLast[size];
|
|
2568
|
+
values[`${prefix}group-hover:hidden`] =
|
|
2569
|
+
isLast[size] && this.tableHasActions && this.variant !== 'actions';
|
|
2570
|
+
values[`${prefix}group-hover:flex`] =
|
|
2571
|
+
parsedSizes[size] !== 'hidden' ||
|
|
2572
|
+
this.variant === 'actions';
|
|
2573
|
+
values[`${prefix}flex`] =
|
|
2574
|
+
parsedSizes[size] !== 'hidden' &&
|
|
2575
|
+
this.variant !== 'actions';
|
|
2576
|
+
}
|
|
2577
|
+
return values;
|
|
2578
|
+
}
|
|
2556
2579
|
}
|
|
2557
2580
|
TableCell.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableCell, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2558
|
-
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
|
|
2581
|
+
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 *ngTemplateOutlet=\"template; context: data\"></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 *ngTemplateOutlet=\"template; context: data\"></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"] }] });
|
|
2559
2582
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableCell, decorators: [{
|
|
2560
2583
|
type: Component,
|
|
2561
|
-
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
|
|
2584
|
+
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 *ngTemplateOutlet=\"template; context: data\"></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 *ngTemplateOutlet=\"template; context: data\"></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"] }]
|
|
2562
2585
|
}], propDecorators: { variant: [{
|
|
2563
2586
|
type: Input
|
|
2564
2587
|
}], index: [{
|
|
@@ -2585,26 +2608,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
2585
2608
|
let TableColumn = class TableColumn {
|
|
2586
2609
|
constructor(c, r, z) {
|
|
2587
2610
|
this.z = z;
|
|
2588
|
-
this.isLast = false;
|
|
2589
2611
|
c.detach();
|
|
2590
2612
|
this.el = r.nativeElement;
|
|
2591
2613
|
proxyOutputs(this, this.el, ['tableDefinitionChanged']);
|
|
2592
2614
|
}
|
|
2593
2615
|
};
|
|
2594
2616
|
TableColumn.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableColumn, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
2595
|
-
TableColumn.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TableColumn, selector: "p-table-column", inputs: { align: "align", name: "name", path: "path", sizes: "sizes", type: "type", useSlot: "useSlot", hasCheckbox: "hasCheckbox"
|
|
2617
|
+
TableColumn.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TableColumn, selector: "p-table-column", inputs: { align: "align", name: "name", path: "path", sizes: "sizes", type: "type", useSlot: "useSlot", hasCheckbox: "hasCheckbox" }, queries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2596
2618
|
TableColumn = __decorate([
|
|
2597
2619
|
ProxyCmp({
|
|
2598
2620
|
defineCustomElementFn: undefined,
|
|
2599
|
-
inputs: [
|
|
2600
|
-
'align',
|
|
2601
|
-
'name',
|
|
2602
|
-
'path',
|
|
2603
|
-
'sizes',
|
|
2604
|
-
'type',
|
|
2605
|
-
'useSlot',
|
|
2606
|
-
'hasCheckbox',
|
|
2607
|
-
],
|
|
2621
|
+
inputs: ['align', 'name', 'path', 'sizes', 'type', 'useSlot', 'hasCheckbox'],
|
|
2608
2622
|
})
|
|
2609
2623
|
], TableColumn);
|
|
2610
2624
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableColumn, decorators: [{
|
|
@@ -2613,19 +2627,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
2613
2627
|
selector: 'p-table-column',
|
|
2614
2628
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2615
2629
|
template: '<ng-content></ng-content>',
|
|
2616
|
-
inputs: [
|
|
2617
|
-
'align',
|
|
2618
|
-
'name',
|
|
2619
|
-
'path',
|
|
2620
|
-
'sizes',
|
|
2621
|
-
'type',
|
|
2622
|
-
'useSlot',
|
|
2623
|
-
'hasCheckbox',
|
|
2624
|
-
],
|
|
2630
|
+
inputs: ['align', 'name', 'path', 'sizes', 'type', 'useSlot', 'hasCheckbox'],
|
|
2625
2631
|
}]
|
|
2626
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: {
|
|
2627
|
-
type: Input
|
|
2628
|
-
}], template: [{
|
|
2632
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { template: [{
|
|
2629
2633
|
type: ContentChild,
|
|
2630
2634
|
args: [TemplateRef, {
|
|
2631
2635
|
read: TemplateRef,
|
|
@@ -2722,8 +2726,7 @@ class TableHeaderDirective extends BaseValueAccessor {
|
|
|
2722
2726
|
}
|
|
2723
2727
|
}
|
|
2724
2728
|
_setActiveQuickFilter(quickFilter) {
|
|
2725
|
-
this.el.nativeElement.activeQuickFilterIdentifier =
|
|
2726
|
-
quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.identifier;
|
|
2729
|
+
this.el.nativeElement.activeQuickFilterIdentifier = quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.identifier;
|
|
2727
2730
|
}
|
|
2728
2731
|
}
|
|
2729
2732
|
TableHeaderDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableHeaderDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -2785,7 +2788,10 @@ class TableNgxDirective extends BaseValueAccessor {
|
|
|
2785
2788
|
if (value === null || value === void 0 ? void 0 : value.quickFilter) {
|
|
2786
2789
|
this._setActiveQuickFilter(value.quickFilter);
|
|
2787
2790
|
}
|
|
2788
|
-
this._base.selectedFiltersAmount =
|
|
2791
|
+
this._base.selectedFiltersAmount =
|
|
2792
|
+
!value.filters || value.filters.length === 0
|
|
2793
|
+
? undefined
|
|
2794
|
+
: value.filters.length;
|
|
2789
2795
|
this._checkEmptyStateType();
|
|
2790
2796
|
this._checkResetButtons();
|
|
2791
2797
|
}
|
|
@@ -2810,7 +2816,11 @@ class TableNgxDirective extends BaseValueAccessor {
|
|
|
2810
2816
|
}
|
|
2811
2817
|
_checkEmptyStateType() {
|
|
2812
2818
|
var _a, _b, _c;
|
|
2813
|
-
if (((_a = this.lastValue.query) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
2819
|
+
if (((_a = this.lastValue.query) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
2820
|
+
(this.lastValue.quickFilter && !((_b = this.lastValue.quickFilter) === null || _b === void 0 ? void 0 : _b.default)) ||
|
|
2821
|
+
(this._base.selectedFiltersAmount &&
|
|
2822
|
+
this._base.selectedFiltersAmount > 0) ||
|
|
2823
|
+
((_c = this.lastValue.filters) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
2814
2824
|
this._base.emptyStateType = 'filtered';
|
|
2815
2825
|
return;
|
|
2816
2826
|
}
|
|
@@ -2819,15 +2829,15 @@ class TableNgxDirective extends BaseValueAccessor {
|
|
|
2819
2829
|
_checkResetButtons() {
|
|
2820
2830
|
const activeQuickFilter = this.lastValue.quickFilter;
|
|
2821
2831
|
const selectedFiltersAmount = this._base.selectedFiltersAmount;
|
|
2822
|
-
if (activeQuickFilter ||
|
|
2823
|
-
selectedFiltersAmount) {
|
|
2832
|
+
if (activeQuickFilter || selectedFiltersAmount) {
|
|
2824
2833
|
if (selectedFiltersAmount && selectedFiltersAmount > 0) {
|
|
2825
2834
|
this._base.filterModalShowReset = true;
|
|
2826
2835
|
}
|
|
2827
2836
|
else {
|
|
2828
2837
|
this._base.filterModalShowReset = false;
|
|
2829
2838
|
}
|
|
2830
|
-
if (selectedFiltersAmount && selectedFiltersAmount > 0 ||
|
|
2839
|
+
if ((selectedFiltersAmount && selectedFiltersAmount > 0) ||
|
|
2840
|
+
!(activeQuickFilter === null || activeQuickFilter === void 0 ? void 0 : activeQuickFilter.default)) {
|
|
2831
2841
|
this._base.filterModalShowResetMobile = true;
|
|
2832
2842
|
}
|
|
2833
2843
|
else {
|
|
@@ -2906,8 +2916,7 @@ class TableDirective extends BaseValueAccessor {
|
|
|
2906
2916
|
}
|
|
2907
2917
|
}
|
|
2908
2918
|
_setActiveQuickFilter(quickFilter) {
|
|
2909
|
-
this.el.nativeElement.activeQuickFilterIdentifier =
|
|
2910
|
-
quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.identifier;
|
|
2919
|
+
this.el.nativeElement.activeQuickFilterIdentifier = quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.identifier;
|
|
2911
2920
|
}
|
|
2912
2921
|
}
|
|
2913
2922
|
TableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -3209,6 +3218,7 @@ let Table = class Table {
|
|
|
3209
3218
|
this.filterModalSave = new EventEmitter();
|
|
3210
3219
|
this.filterModalReset = new EventEmitter();
|
|
3211
3220
|
this.rowActionsRow$ = new BehaviorSubject([]);
|
|
3221
|
+
this.rowActionsRowDefinition$ = new BehaviorSubject(undefined);
|
|
3212
3222
|
this.rowActionsFloatingAll$ = new BehaviorSubject([]);
|
|
3213
3223
|
this.rowActionsFloating$ = new BehaviorSubject([]);
|
|
3214
3224
|
this.isMobile$ = new BehaviorSubject(isMobile());
|
|
@@ -3236,7 +3246,7 @@ let Table = class Table {
|
|
|
3236
3246
|
});
|
|
3237
3247
|
this.filterModalShow$
|
|
3238
3248
|
.pipe(untilDestroyed(this), distinctUntilChanged())
|
|
3239
|
-
.subscribe(
|
|
3249
|
+
.subscribe(value => this.filterModalShow.next(value));
|
|
3240
3250
|
}
|
|
3241
3251
|
ngOnChanges(changes) {
|
|
3242
3252
|
if (changes['items']) {
|
|
@@ -3254,8 +3264,7 @@ let Table = class Table {
|
|
|
3254
3264
|
calculateRowSelectionData = true;
|
|
3255
3265
|
}
|
|
3256
3266
|
if (changes['rowSelectionLimit']) {
|
|
3257
|
-
this._inputRowSelectionLimit =
|
|
3258
|
-
changes['rowSelectionLimit'].currentValue;
|
|
3267
|
+
this._inputRowSelectionLimit = changes['rowSelectionLimit'].currentValue;
|
|
3259
3268
|
calculateRowSelectionData = true;
|
|
3260
3269
|
}
|
|
3261
3270
|
if (calculateRowSelectionData || changes['selectedRows']) {
|
|
@@ -3323,8 +3332,8 @@ let Table = class Table {
|
|
|
3323
3332
|
this.parsedItems = JSON.parse(items);
|
|
3324
3333
|
}
|
|
3325
3334
|
_generateColumns() {
|
|
3326
|
-
|
|
3327
|
-
definitionsArray
|
|
3335
|
+
let definitionsArray = Array.from(this._columnDefinitions);
|
|
3336
|
+
definitionsArray = this._parseDefinitions(definitionsArray);
|
|
3328
3337
|
this.columns = definitionsArray;
|
|
3329
3338
|
}
|
|
3330
3339
|
_checkboxDisabled(item, rowIndex) {
|
|
@@ -3354,8 +3363,7 @@ let Table = class Table {
|
|
|
3354
3363
|
toAdd.push(row);
|
|
3355
3364
|
this.rowSelected.emit(row);
|
|
3356
3365
|
if (this.rowSelectionLimit !== undefined &&
|
|
3357
|
-
this.selectedRows.length + toAdd.length ===
|
|
3358
|
-
this.rowSelectionLimit) {
|
|
3366
|
+
this.selectedRows.length + toAdd.length === this.rowSelectionLimit) {
|
|
3359
3367
|
break;
|
|
3360
3368
|
}
|
|
3361
3369
|
}
|
|
@@ -3368,8 +3376,7 @@ let Table = class Table {
|
|
|
3368
3376
|
}
|
|
3369
3377
|
for (let i = 0; i < this.selectedRows.length; i++) {
|
|
3370
3378
|
const value = this.selectedRows[i];
|
|
3371
|
-
const row = this.parsedItems.find(
|
|
3372
|
-
this._getSelectionValue(value, i));
|
|
3379
|
+
const row = this.parsedItems.find(d => this._getSelectionValue(d, i) === this._getSelectionValue(value, i));
|
|
3373
3380
|
if (!row) {
|
|
3374
3381
|
continue;
|
|
3375
3382
|
}
|
|
@@ -3418,7 +3425,7 @@ let Table = class Table {
|
|
|
3418
3425
|
return this.selectionKey ? (row === null || row === void 0 ? void 0 : row[this.selectionKey]) || index : index;
|
|
3419
3426
|
}
|
|
3420
3427
|
_selectionContains(row, index, returnIndex = false) {
|
|
3421
|
-
const returnValue = this.selectedRows.findIndex(
|
|
3428
|
+
const returnValue = this.selectedRows.findIndex(item => this._getSelectionValue(row, index) ===
|
|
3422
3429
|
this._getSelectionValue(item, index));
|
|
3423
3430
|
return !returnIndex ? returnValue >= 0 : returnValue;
|
|
3424
3431
|
}
|
|
@@ -3505,8 +3512,7 @@ let Table = class Table {
|
|
|
3505
3512
|
const item = this.parsedItems[rowIndex];
|
|
3506
3513
|
return this._getActionQueryParams(queryParams(item), rowIndex);
|
|
3507
3514
|
}
|
|
3508
|
-
if (queryParams instanceof Object &&
|
|
3509
|
-
queryParams.constructor === Object) {
|
|
3515
|
+
if (queryParams instanceof Object && queryParams.constructor === Object) {
|
|
3510
3516
|
return new BehaviorSubject(queryParams);
|
|
3511
3517
|
}
|
|
3512
3518
|
return queryParams;
|
|
@@ -3530,14 +3536,13 @@ let Table = class Table {
|
|
|
3530
3536
|
});
|
|
3531
3537
|
return;
|
|
3532
3538
|
}
|
|
3533
|
-
if (rowIndex === undefined) {
|
|
3534
|
-
return;
|
|
3535
|
-
}
|
|
3536
3539
|
if (action.routerLink ||
|
|
3537
3540
|
(Array.isArray(action.routerLink) && action.routerLink.length)) {
|
|
3538
3541
|
return;
|
|
3539
3542
|
}
|
|
3540
|
-
const item =
|
|
3543
|
+
const item = rowIndex !== undefined
|
|
3544
|
+
? this.parsedItems[rowIndex]
|
|
3545
|
+
: this.selectedRows[0];
|
|
3541
3546
|
action.action.emit({
|
|
3542
3547
|
item,
|
|
3543
3548
|
multi: false,
|
|
@@ -3583,15 +3588,14 @@ let Table = class Table {
|
|
|
3583
3588
|
subscription.unsubscribe();
|
|
3584
3589
|
}
|
|
3585
3590
|
}
|
|
3586
|
-
this._rowActionsSubscriptions = actions.map(
|
|
3591
|
+
this._rowActionsSubscriptions = actions.map(action => action._loadingChanged
|
|
3587
3592
|
.pipe(untilDestroyed(this))
|
|
3588
|
-
.subscribe(() =>
|
|
3589
|
-
console.log('Loading changed');
|
|
3590
|
-
this._changeDetection.detectChanges();
|
|
3591
|
-
}));
|
|
3593
|
+
.subscribe(() => this._changeDetection.detectChanges()));
|
|
3592
3594
|
// we hack this to any[] to make it work..
|
|
3593
|
-
const rowActionsRow = actions.filter(
|
|
3594
|
-
const rowActionsFloating = actions.filter(
|
|
3595
|
+
const rowActionsRow = actions.filter(a => a.type === 'both' || a.type === 'single');
|
|
3596
|
+
const rowActionsFloating = actions.filter(a => (this._inputEnableRowSelection &&
|
|
3597
|
+
(a.type === 'both' || a.type === 'multi')) ||
|
|
3598
|
+
(mobile && a.type === 'single' && !a.routerLink));
|
|
3595
3599
|
let rowSelectionLimit = this._inputRowSelectionLimit;
|
|
3596
3600
|
if (mobile && // we're mobile
|
|
3597
3601
|
(rowActionsFloating === null || rowActionsFloating === void 0 ? void 0 : rowActionsFloating.length) && // we have atleast 1 item in _rowActionsFloating
|
|
@@ -3607,16 +3611,19 @@ let Table = class Table {
|
|
|
3607
3611
|
enableRowSelection = true;
|
|
3608
3612
|
}
|
|
3609
3613
|
this.enableRowSelection = enableRowSelection;
|
|
3614
|
+
this.rowActionsRowDefinition$.next(this._parseRowActionsRowDefinition());
|
|
3610
3615
|
this.rowActionsRow$.next(rowActionsRow);
|
|
3611
3616
|
this.rowActionsFloatingAll$.next(rowActionsFloating);
|
|
3617
|
+
this.floatingMenuShown$
|
|
3618
|
+
.pipe(take(1), filter$1(v => !!v))
|
|
3619
|
+
.subscribe(() => this._showFloatingMenu());
|
|
3612
3620
|
}, 200);
|
|
3613
3621
|
}
|
|
3614
3622
|
_showFloatingMenu() {
|
|
3615
|
-
this.rowActionsFloatingAll$.pipe(take(1)).subscribe(
|
|
3623
|
+
this.rowActionsFloatingAll$.pipe(take(1)).subscribe(actions => {
|
|
3616
3624
|
if (this.rowSelectionLimit === 1 &&
|
|
3617
|
-
actions.findIndex(
|
|
3618
|
-
|
|
3619
|
-
actions = actions.filter((a) => a.type === 'multi' ||
|
|
3625
|
+
actions.findIndex(a => (a.type === 'single' || a.type === 'both') && a.showFunction) >= 0) {
|
|
3626
|
+
actions = actions.filter(a => a.type === 'multi' ||
|
|
3620
3627
|
!a.showFunction ||
|
|
3621
3628
|
a.showFunction(this.selectedRows[0]));
|
|
3622
3629
|
}
|
|
@@ -3624,15 +3631,90 @@ let Table = class Table {
|
|
|
3624
3631
|
this.floatingMenuShown$.next(true);
|
|
3625
3632
|
});
|
|
3626
3633
|
}
|
|
3634
|
+
_parseDefinitions(definitionsArray) {
|
|
3635
|
+
const definitions = definitionsArray.map(definition => {
|
|
3636
|
+
definition = this._parseDefinitionSizes(definition);
|
|
3637
|
+
definition.isLast = {};
|
|
3638
|
+
return definition;
|
|
3639
|
+
});
|
|
3640
|
+
const matchedIsLast = tableColumSizesOptions.reduce((data, size) => {
|
|
3641
|
+
data[size] = false;
|
|
3642
|
+
return data;
|
|
3643
|
+
}, {});
|
|
3644
|
+
for (let i = definitions.length - 1; i >= 0; i--) {
|
|
3645
|
+
const definition = definitions[i];
|
|
3646
|
+
for (const size of tableColumSizesOptions) {
|
|
3647
|
+
if (matchedIsLast[size]) {
|
|
3648
|
+
definition.isLast[size] = false;
|
|
3649
|
+
continue;
|
|
3650
|
+
}
|
|
3651
|
+
if (definition.parsedSizes[size] === 'hidden') {
|
|
3652
|
+
definition.isLast[size] = false;
|
|
3653
|
+
continue;
|
|
3654
|
+
}
|
|
3655
|
+
const isLastAtSizeFound = this._findLastDefinitionBySize(definitions, size);
|
|
3656
|
+
if (isLastAtSizeFound) {
|
|
3657
|
+
definition.isLast[size] = false;
|
|
3658
|
+
continue;
|
|
3659
|
+
}
|
|
3660
|
+
definition.isLast[size] = true;
|
|
3661
|
+
}
|
|
3662
|
+
}
|
|
3663
|
+
return definitions;
|
|
3664
|
+
}
|
|
3665
|
+
_findLastDefinitionBySize(definitions, size) {
|
|
3666
|
+
return definitions
|
|
3667
|
+
.slice()
|
|
3668
|
+
.reverse()
|
|
3669
|
+
.find(d => d.isLast[size] === true);
|
|
3670
|
+
}
|
|
3671
|
+
_parseDefinitionSizes(definition) {
|
|
3672
|
+
var _a;
|
|
3673
|
+
const definitionAny = definition;
|
|
3674
|
+
let parsedSizes = { default: 'full' };
|
|
3675
|
+
for (const [index, size] of tableColumSizesOptions.entries()) {
|
|
3676
|
+
if (definitionAny.sizes === 'auto' ||
|
|
3677
|
+
definitionAny.sizes === 'hidden' ||
|
|
3678
|
+
definitionAny.sizes === 'full' ||
|
|
3679
|
+
typeof definitionAny.sizes === 'number') {
|
|
3680
|
+
parsedSizes[size] =
|
|
3681
|
+
definitionAny.sizes === 'auto' ? 'full' : definitionAny.sizes;
|
|
3682
|
+
continue;
|
|
3683
|
+
}
|
|
3684
|
+
parsedSizes[size] =
|
|
3685
|
+
(_a = definitionAny.sizes[size]) !== null && _a !== void 0 ? _a : parsedSizes[tableColumSizesOptions[index - 1]];
|
|
3686
|
+
}
|
|
3687
|
+
definition.parsedSizes = parsedSizes;
|
|
3688
|
+
return definition;
|
|
3689
|
+
}
|
|
3690
|
+
_parseRowActionsRowDefinition() {
|
|
3691
|
+
const isLast = tableColumSizesOptions.reduce((data, size) => {
|
|
3692
|
+
data[size] = true;
|
|
3693
|
+
return data;
|
|
3694
|
+
}, {});
|
|
3695
|
+
const sizes = { default: 0 };
|
|
3696
|
+
for (const size of tableColumSizesOptions) {
|
|
3697
|
+
const lastColumn = this._findLastDefinitionBySize(this.columns, size);
|
|
3698
|
+
sizes[size] = lastColumn.parsedSizes[size];
|
|
3699
|
+
}
|
|
3700
|
+
return {
|
|
3701
|
+
isLast,
|
|
3702
|
+
sizes,
|
|
3703
|
+
parsedSizes: sizes,
|
|
3704
|
+
align: 'end',
|
|
3705
|
+
type: 'td',
|
|
3706
|
+
path: null,
|
|
3707
|
+
};
|
|
3708
|
+
}
|
|
3627
3709
|
};
|
|
3628
3710
|
Table.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: Table, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3629
|
-
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=\"parsedItems?.length; else emptyStateTemplate\">\n\t\t\t\t<p-table-row\n\t\t\t\t\t*ngFor=\"let item of parsedItems; 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<ng-container\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-tooltip\n\t\t\t\t\t\t\t\t\t\t*ngIf=\"\n\t\t\t\t\t\t\t\t\t\t\taction.showFunction\n\t\t\t\t\t\t\t\t\t\t\t\t? action.showFunction(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tparsedItems[rowIndex]\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t: true\n\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t[content]=\"action.label\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\t\t\t\tdata-is-action\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\t\tslot=\"trigger\"\n\t\t\t\t\t\t\t\t\t\t\t[icon]=\"action.icon\"\n\t\t\t\t\t\t\t\t\t\t\t[iconRotate]=\"action.iconRotate\"\n\t\t\t\t\t\t\t\t\t\t\ticonFlip=\"action.iconFlip\"\n\t\t\t\t\t\t\t\t\t\t\ticonOnly=\"true\"\n\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t[disabled]=\"action.disabled\"\n\t\t\t\t\t\t\t\t\t\t\t[routerLink]=\"\n\t\t\t\t\t\t\t\t\t\t\t\taction.routerLink\n\t\t\t\t\t\t\t\t\t\t\t\t\t? (_getActionRouterLink(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taction.routerLink,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trowIndex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) | async)\n\t\t\t\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t\t[queryParams]=\"\n\t\t\t\t\t\t\t\t\t\t\t\taction.queryParams\n\t\t\t\t\t\t\t\t\t\t\t\t\t? (_getActionQueryParams(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taction.queryParams,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trowIndex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) | async)\n\t\t\t\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t\t(onClick)=\"\n\t\t\t\t\t\t\t\t\t\t\t\t_rowActionClick(\n\t\t\t\t\t\t\t\t\t\t\t\t\taction,\n\t\t\t\t\t\t\t\t\t\t\t\t\trowIndex\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t></p-button>\n\t\t\t\t\t\t\t\t\t</p-tooltip>\n\t\t\t\t\t\t\t\t</ng-container>\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\tslot=\"floating-menu-item\"\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\tslot=\"floating-menu-item\"\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\n\t\t\t\t<p-loader\n\t\t\t\t\t*ngIf=\"action.loading; else floatingMenuItemIconTemplate\"\n\t\t\t\t></p-loader>\n\n\t\t\t\t<ng-template #floatingMenuItemIconTemplate>\n\t\t\t\t\t<p-icon\n\t\t\t\t\t\t[variant]=\"action.icon\"\n\t\t\t\t\t\t[rotate]=\"action.iconRotate\"\n\t\t\t\t\t\t[flip]=\"action.iconFlip\"\n\t\t\t\t\t></p-icon>\n\t\t\t\t</ng-template>\n\t\t\t</p-floating-menu-item>\n\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\tslot=\"floating-menu-item\"\n\t\t\t></p-divider>\n\n\t\t\t<p-floating-menu-item\n\t\t\t\t(click)=\"_selectAllChange(null, false)\"\n\t\t\t\tslot=\"floating-menu-item\"\n\t\t\t>\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: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { 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 });
|
|
3711
|
+
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-1 flex-col\">\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) && enableRowSelection\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=\"parsedItems?.length; else emptyStateTemplate\">\n\t\t\t\t<p-table-row\n\t\t\t\t\t*ngFor=\"let item of parsedItems; 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 *ngFor=\"let col of columns; let index = index\">\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) && enableRowSelection\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 && !(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)=\"_checkboxChange($event.target, rowIndex)\"\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!!(rowActionsRowDefinition$ | async) &&\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]=\"rowActionsRowDefinition$ | async\"\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]=\"!!(rowActionsRow$ | async)?.length\"\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=\"ml-auto flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<ng-container *ngFor=\"let action of rowActionsRow$ | async\">\n\t\t\t\t\t\t\t\t\t<p-tooltip\n\t\t\t\t\t\t\t\t\t\t*ngIf=\"\n\t\t\t\t\t\t\t\t\t\t\taction.showFunction\n\t\t\t\t\t\t\t\t\t\t\t\t? action.showFunction(parsedItems[rowIndex])\n\t\t\t\t\t\t\t\t\t\t\t\t: true\n\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t[content]=\"action.label\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\t\t\t\tdata-is-action\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\t\tslot=\"trigger\"\n\t\t\t\t\t\t\t\t\t\t\t[icon]=\"action.icon\"\n\t\t\t\t\t\t\t\t\t\t\t[iconRotate]=\"action.iconRotate\"\n\t\t\t\t\t\t\t\t\t\t\ticonFlip=\"action.iconFlip\"\n\t\t\t\t\t\t\t\t\t\t\ticonOnly=\"true\"\n\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t[disabled]=\"action.disabled\"\n\t\t\t\t\t\t\t\t\t\t\t[routerLink]=\"\n\t\t\t\t\t\t\t\t\t\t\t\taction.routerLink\n\t\t\t\t\t\t\t\t\t\t\t\t\t? (_getActionRouterLink(action.routerLink, rowIndex)\n\t\t\t\t\t\t\t\t\t\t\t\t\t | async)\n\t\t\t\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t\t[queryParams]=\"\n\t\t\t\t\t\t\t\t\t\t\t\taction.queryParams\n\t\t\t\t\t\t\t\t\t\t\t\t\t? (_getActionQueryParams(action.queryParams, rowIndex)\n\t\t\t\t\t\t\t\t\t\t\t\t\t | async)\n\t\t\t\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t\t(onClick)=\"_rowActionClick(action, rowIndex)\"\n\t\t\t\t\t\t\t\t\t\t></p-button>\n\t\t\t\t\t\t\t\t\t</p-tooltip>\n\t\t\t\t\t\t\t\t</ng-container>\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\tslot=\"floating-menu-item\"\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\tslot=\"floating-menu-item\"\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\n\t\t\t\t<p-loader\n\t\t\t\t\t*ngIf=\"action.loading; else floatingMenuItemIconTemplate\"\n\t\t\t\t></p-loader>\n\n\t\t\t\t<ng-template #floatingMenuItemIconTemplate>\n\t\t\t\t\t<p-icon\n\t\t\t\t\t\t[variant]=\"action.icon\"\n\t\t\t\t\t\t[rotate]=\"action.iconRotate\"\n\t\t\t\t\t\t[flip]=\"action.iconFlip\"\n\t\t\t\t\t></p-icon>\n\t\t\t\t</ng-template>\n\t\t\t</p-floating-menu-item>\n\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\tslot=\"floating-menu-item\"\n\t\t\t></p-divider>\n\n\t\t\t<p-floating-menu-item\n\t\t\t\t(click)=\"_selectAllChange(null, false)\"\n\t\t\t\tslot=\"floating-menu-item\"\n\t\t\t>\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\n\t\t\tslot=\"content\"\n\t\t\tclass=\"flex flex-col gap-6\"\n\t\t>\n\t\t\t<ng-container *ngTemplateOutlet=\"filterModalTemplate\"></ng-container>\n\t\t</div>\n\t\t<div\n\t\t\tslot=\"footer\"\n\t\t\tclass=\"flex w-full justify-between gap-4\"\n\t\t>\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: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { 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 });
|
|
3630
3712
|
Table = __decorate([
|
|
3631
3713
|
UntilDestroy({ checkProperties: true })
|
|
3632
3714
|
], Table);
|
|
3633
3715
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: Table, decorators: [{
|
|
3634
3716
|
type: Component,
|
|
3635
|
-
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=\"parsedItems?.length; else emptyStateTemplate\">\n\t\t\t\t<p-table-row\n\t\t\t\t\t*ngFor=\"let item of parsedItems; 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<ng-container\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-tooltip\n\t\t\t\t\t\t\t\t\t\t*ngIf=\"\n\t\t\t\t\t\t\t\t\t\t\taction.showFunction\n\t\t\t\t\t\t\t\t\t\t\t\t? action.showFunction(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tparsedItems[rowIndex]\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t: true\n\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t[content]=\"action.label\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\t\t\t\tdata-is-action\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\t\tslot=\"trigger\"\n\t\t\t\t\t\t\t\t\t\t\t[icon]=\"action.icon\"\n\t\t\t\t\t\t\t\t\t\t\t[iconRotate]=\"action.iconRotate\"\n\t\t\t\t\t\t\t\t\t\t\ticonFlip=\"action.iconFlip\"\n\t\t\t\t\t\t\t\t\t\t\ticonOnly=\"true\"\n\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t[disabled]=\"action.disabled\"\n\t\t\t\t\t\t\t\t\t\t\t[routerLink]=\"\n\t\t\t\t\t\t\t\t\t\t\t\taction.routerLink\n\t\t\t\t\t\t\t\t\t\t\t\t\t? (_getActionRouterLink(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taction.routerLink,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trowIndex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) | async)\n\t\t\t\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t\t[queryParams]=\"\n\t\t\t\t\t\t\t\t\t\t\t\taction.queryParams\n\t\t\t\t\t\t\t\t\t\t\t\t\t? (_getActionQueryParams(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taction.queryParams,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trowIndex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) | async)\n\t\t\t\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t\t(onClick)=\"\n\t\t\t\t\t\t\t\t\t\t\t\t_rowActionClick(\n\t\t\t\t\t\t\t\t\t\t\t\t\taction,\n\t\t\t\t\t\t\t\t\t\t\t\t\trowIndex\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t></p-button>\n\t\t\t\t\t\t\t\t\t</p-tooltip>\n\t\t\t\t\t\t\t\t</ng-container>\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\tslot=\"floating-menu-item\"\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\tslot=\"floating-menu-item\"\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\n\t\t\t\t<p-loader\n\t\t\t\t\t*ngIf=\"action.loading; else floatingMenuItemIconTemplate\"\n\t\t\t\t></p-loader>\n\n\t\t\t\t<ng-template #floatingMenuItemIconTemplate>\n\t\t\t\t\t<p-icon\n\t\t\t\t\t\t[variant]=\"action.icon\"\n\t\t\t\t\t\t[rotate]=\"action.iconRotate\"\n\t\t\t\t\t\t[flip]=\"action.iconFlip\"\n\t\t\t\t\t></p-icon>\n\t\t\t\t</ng-template>\n\t\t\t</p-floating-menu-item>\n\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\tslot=\"floating-menu-item\"\n\t\t\t></p-divider>\n\n\t\t\t<p-floating-menu-item\n\t\t\t\t(click)=\"_selectAllChange(null, false)\"\n\t\t\t\tslot=\"floating-menu-item\"\n\t\t\t>\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"] }]
|
|
3717
|
+
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-1 flex-col\">\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) && enableRowSelection\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=\"parsedItems?.length; else emptyStateTemplate\">\n\t\t\t\t<p-table-row\n\t\t\t\t\t*ngFor=\"let item of parsedItems; 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 *ngFor=\"let col of columns; let index = index\">\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) && enableRowSelection\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 && !(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)=\"_checkboxChange($event.target, rowIndex)\"\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!!(rowActionsRowDefinition$ | async) &&\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]=\"rowActionsRowDefinition$ | async\"\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]=\"!!(rowActionsRow$ | async)?.length\"\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=\"ml-auto flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<ng-container *ngFor=\"let action of rowActionsRow$ | async\">\n\t\t\t\t\t\t\t\t\t<p-tooltip\n\t\t\t\t\t\t\t\t\t\t*ngIf=\"\n\t\t\t\t\t\t\t\t\t\t\taction.showFunction\n\t\t\t\t\t\t\t\t\t\t\t\t? action.showFunction(parsedItems[rowIndex])\n\t\t\t\t\t\t\t\t\t\t\t\t: true\n\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t[content]=\"action.label\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\t\t\t\tdata-is-action\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\t\tslot=\"trigger\"\n\t\t\t\t\t\t\t\t\t\t\t[icon]=\"action.icon\"\n\t\t\t\t\t\t\t\t\t\t\t[iconRotate]=\"action.iconRotate\"\n\t\t\t\t\t\t\t\t\t\t\ticonFlip=\"action.iconFlip\"\n\t\t\t\t\t\t\t\t\t\t\ticonOnly=\"true\"\n\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t[disabled]=\"action.disabled\"\n\t\t\t\t\t\t\t\t\t\t\t[routerLink]=\"\n\t\t\t\t\t\t\t\t\t\t\t\taction.routerLink\n\t\t\t\t\t\t\t\t\t\t\t\t\t? (_getActionRouterLink(action.routerLink, rowIndex)\n\t\t\t\t\t\t\t\t\t\t\t\t\t | async)\n\t\t\t\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t\t[queryParams]=\"\n\t\t\t\t\t\t\t\t\t\t\t\taction.queryParams\n\t\t\t\t\t\t\t\t\t\t\t\t\t? (_getActionQueryParams(action.queryParams, rowIndex)\n\t\t\t\t\t\t\t\t\t\t\t\t\t | async)\n\t\t\t\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t\t(onClick)=\"_rowActionClick(action, rowIndex)\"\n\t\t\t\t\t\t\t\t\t\t></p-button>\n\t\t\t\t\t\t\t\t\t</p-tooltip>\n\t\t\t\t\t\t\t\t</ng-container>\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\tslot=\"floating-menu-item\"\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\tslot=\"floating-menu-item\"\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\n\t\t\t\t<p-loader\n\t\t\t\t\t*ngIf=\"action.loading; else floatingMenuItemIconTemplate\"\n\t\t\t\t></p-loader>\n\n\t\t\t\t<ng-template #floatingMenuItemIconTemplate>\n\t\t\t\t\t<p-icon\n\t\t\t\t\t\t[variant]=\"action.icon\"\n\t\t\t\t\t\t[rotate]=\"action.iconRotate\"\n\t\t\t\t\t\t[flip]=\"action.iconFlip\"\n\t\t\t\t\t></p-icon>\n\t\t\t\t</ng-template>\n\t\t\t</p-floating-menu-item>\n\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\tslot=\"floating-menu-item\"\n\t\t\t></p-divider>\n\n\t\t\t<p-floating-menu-item\n\t\t\t\t(click)=\"_selectAllChange(null, false)\"\n\t\t\t\tslot=\"floating-menu-item\"\n\t\t\t>\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\n\t\t\tslot=\"content\"\n\t\t\tclass=\"flex flex-col gap-6\"\n\t\t>\n\t\t\t<ng-container *ngTemplateOutlet=\"filterModalTemplate\"></ng-container>\n\t\t</div>\n\t\t<div\n\t\t\tslot=\"footer\"\n\t\t\tclass=\"flex w-full justify-between gap-4\"\n\t\t>\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"] }]
|
|
3636
3718
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { items: [{
|
|
3637
3719
|
type: Input
|
|
3638
3720
|
}], loading: [{
|
|
@@ -3924,7 +4006,7 @@ let ToastContainer = class ToastContainer {
|
|
|
3924
4006
|
constructor(r, z, _toastService) {
|
|
3925
4007
|
this.z = z;
|
|
3926
4008
|
this._toastService = _toastService;
|
|
3927
|
-
this.toasts$ = this._toastService.toasts$.pipe(map$1(
|
|
4009
|
+
this.toasts$ = this._toastService.toasts$.pipe(map$1(arr => arr.reverse()));
|
|
3928
4010
|
this.el = r.nativeElement;
|
|
3929
4011
|
}
|
|
3930
4012
|
dismiss(identifier) {
|
|
@@ -3932,7 +4014,7 @@ let ToastContainer = class ToastContainer {
|
|
|
3932
4014
|
}
|
|
3933
4015
|
};
|
|
3934
4016
|
ToastContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToastContainer, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: ToastService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3935
|
-
ToastContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ToastContainer, selector: "p-toast-container", inputs: { placement: "placement" }, ngImport: i0, template: "<p-toast\n
|
|
4017
|
+
ToastContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ToastContainer, selector: "p-toast-container", inputs: { placement: "placement" }, ngImport: i0, template: "<p-toast\n\t*ngFor=\"let toast of toasts$ | async; let index = index\"\n\t[variant]=\"toast.variant\"\n\t[header]=\"toast.header\"\n\t[content]=\"toast.content\"\n\t[identifier]=\"toast.identifier\"\n\t[delay]=\"toast.options.delay ?? 5000\"\n\t[dismissOnAction]=\"toast.options.dismissOnAction ?? true\"\n\t[enableAction]=\"toast.options.enableAction\"\n\t[actionFunc]=\"toast.options.action\"\n\t[actionData]=\"toast.options.actionData\"\n\t[actionIcon]=\"toast.options.icon?.variant\"\n\t[actionIconFlip]=\"toast.options.icon?.flip\"\n\t[actionIconRotate]=\"toast.options.icon?.rotate\"\n\t(dismiss)=\"dismiss($event)\"\n\t[@pSlideInBottomOutTop]\n></p-toast>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: PToast, selector: "p-toast", inputs: ["actionIcon", "actionIconFlip", "actionIconRotate", "content", "enableAction", "header", "variant"] }, { kind: "directive", type: ToastDirective, selector: "p-toast", inputs: ["delay", "identifier", "dismissOnAction", "actionFunc", "actionData"], outputs: ["dismiss"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], animations: [SLIDE_IN_TOP_OUT_BOTTOM], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3936
4018
|
ToastContainer = __decorate([
|
|
3937
4019
|
ProxyCmp({
|
|
3938
4020
|
defineCustomElementFn: undefined,
|
|
@@ -3941,7 +4023,7 @@ ToastContainer = __decorate([
|
|
|
3941
4023
|
], ToastContainer);
|
|
3942
4024
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToastContainer, decorators: [{
|
|
3943
4025
|
type: Component,
|
|
3944
|
-
args: [{ selector: 'p-toast-container', changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['placement'], animations: [SLIDE_IN_TOP_OUT_BOTTOM], template: "<p-toast\n
|
|
4026
|
+
args: [{ selector: 'p-toast-container', changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['placement'], animations: [SLIDE_IN_TOP_OUT_BOTTOM], template: "<p-toast\n\t*ngFor=\"let toast of toasts$ | async; let index = index\"\n\t[variant]=\"toast.variant\"\n\t[header]=\"toast.header\"\n\t[content]=\"toast.content\"\n\t[identifier]=\"toast.identifier\"\n\t[delay]=\"toast.options.delay ?? 5000\"\n\t[dismissOnAction]=\"toast.options.dismissOnAction ?? true\"\n\t[enableAction]=\"toast.options.enableAction\"\n\t[actionFunc]=\"toast.options.action\"\n\t[actionData]=\"toast.options.actionData\"\n\t[actionIcon]=\"toast.options.icon?.variant\"\n\t[actionIconFlip]=\"toast.options.icon?.flip\"\n\t[actionIconRotate]=\"toast.options.icon?.rotate\"\n\t(dismiss)=\"dismiss($event)\"\n\t[@pSlideInBottomOutTop]\n></p-toast>\n" }]
|
|
3945
4027
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: ToastService }]; } });
|
|
3946
4028
|
|
|
3947
4029
|
const TOAST_COMPONENTS = [ToastContainer];
|