@paperless/angular 3.6.2 → 3.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, input, output, signal, effect,
|
|
3
|
-
import
|
|
4
|
-
import { FormControl, FormGroup, FormArray, NG_VALUE_ACCESSOR, NumberValueAccessor } from '@angular/forms';
|
|
2
|
+
import { Component, input, output, viewChild, signal, effect, ChangeDetectionStrategy, inject, ElementRef, HostListener, Directive, Injector, TemplateRef, Injectable, NgModule, HostBinding, Input, ContentChild, EventEmitter, Output, ContentChildren, ViewChild, ViewChildren, NgZone, Pipe, provideAppInitializer } from '@angular/core';
|
|
3
|
+
import { FormControl, FormGroup, FormArray, NG_VALUE_ACCESSOR, NumberValueAccessor, NgControl } from '@angular/forms';
|
|
5
4
|
import { filter, Subject, timer, fromEvent, BehaviorSubject, distinctUntilChanged, debounceTime, take, map as map$1 } from 'rxjs';
|
|
6
5
|
import { ObserversModule } from '@angular/cdk/observers';
|
|
7
6
|
import { Overlay, OverlayConfig, createOverlayRef, OverlayModule as OverlayModule$1 } from '@angular/cdk/overlay';
|
|
@@ -11,8 +10,7 @@ import { __decorate } from 'tslib';
|
|
|
11
10
|
import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
|
|
12
11
|
import { startWith, tap, pairwise, map, filter as filter$1, debounce } from 'rxjs/operators';
|
|
13
12
|
import { PAGINATION_DEFAULT_PAGE_SIZE, cn, getTableCellColumnClasses, objectGetByPath, state, isMobile, floatingMenuContainerClass, onStateChange, TABLE_COLUMN_SIZES, SELECT_DEFAULT_MAX_DISPLAYED_ITEMS } from '@paperless/core';
|
|
14
|
-
import
|
|
15
|
-
import { NgTemplateOutlet, AsyncPipe, CommonModule, DatePipe, CurrencyPipe } from '@angular/common';
|
|
13
|
+
import { NgTemplateOutlet, AsyncPipe, CommonModule, CurrencyPipe, DatePipe } from '@angular/common';
|
|
16
14
|
import { defineCustomElement as defineCustomElement$1 } from '@paperless/core/components/p-accordion.js';
|
|
17
15
|
import { defineCustomElement as defineCustomElement$2 } from '@paperless/core/components/p-attachment.js';
|
|
18
16
|
import { defineCustomElement as defineCustomElement$3 } from '@paperless/core/components/p-avatar.js';
|
|
@@ -89,7 +87,7 @@ import { defineCustomElement as defineCustomElement$19 } from '@paperless/core/c
|
|
|
89
87
|
import { RouterLink, RouterModule } from '@angular/router';
|
|
90
88
|
import { v4 } from 'uuid';
|
|
91
89
|
import { defineCustomElements } from '@paperless/core/loader';
|
|
92
|
-
import
|
|
90
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
93
91
|
|
|
94
92
|
class BaseFormComponent {
|
|
95
93
|
markedDirty = false;
|
|
@@ -192,13 +190,12 @@ class BaseFormComponent {
|
|
|
192
190
|
this.markedDirty = false;
|
|
193
191
|
}
|
|
194
192
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BaseFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
195
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: BaseFormComponent, isStandalone:
|
|
193
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: BaseFormComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: ``, isInline: true });
|
|
196
194
|
}
|
|
197
195
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BaseFormComponent, decorators: [{
|
|
198
196
|
type: Component,
|
|
199
197
|
args: [{
|
|
200
198
|
template: ``,
|
|
201
|
-
standalone: false,
|
|
202
199
|
}]
|
|
203
200
|
}] });
|
|
204
201
|
|
|
@@ -208,9 +205,9 @@ class BaseUploadComponent {
|
|
|
208
205
|
loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
209
206
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
210
207
|
fileChange = output();
|
|
211
|
-
uploaderInput;
|
|
212
|
-
file;
|
|
208
|
+
uploaderInput = viewChild('uploaderInput', ...(ngDevMode ? [{ debugName: "uploaderInput" }] : []));
|
|
213
209
|
loadingParsed = signal(false, ...(ngDevMode ? [{ debugName: "loadingParsed" }] : []));
|
|
210
|
+
file;
|
|
214
211
|
constructor() {
|
|
215
212
|
effect(() => {
|
|
216
213
|
const loading = this.loading();
|
|
@@ -233,14 +230,15 @@ class BaseUploadComponent {
|
|
|
233
230
|
result,
|
|
234
231
|
file,
|
|
235
232
|
});
|
|
236
|
-
|
|
237
|
-
|
|
233
|
+
const uploaderInput = this.uploaderInput();
|
|
234
|
+
if (uploaderInput?.nativeElement) {
|
|
235
|
+
uploaderInput.nativeElement.value = '';
|
|
238
236
|
}
|
|
239
237
|
this.file = file;
|
|
240
238
|
this.loadingParsed.set(false);
|
|
241
239
|
}
|
|
242
240
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BaseUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
243
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
241
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.0", type: BaseUploadComponent, isStandalone: true, selector: "ng-component", inputs: { fileId: { classPropertyName: "fileId", publicName: "fileId", isSignal: true, isRequired: false, transformFunction: null }, uploaded: { classPropertyName: "uploaded", publicName: "uploaded", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileChange: "fileChange" }, viewQueries: [{ propertyName: "uploaderInput", first: true, predicate: ["uploaderInput"], descendants: true, isSignal: true }], ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
244
242
|
}
|
|
245
243
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BaseUploadComponent, decorators: [{
|
|
246
244
|
type: Component,
|
|
@@ -248,14 +246,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
248
246
|
template: ``,
|
|
249
247
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
250
248
|
}]
|
|
251
|
-
}], ctorParameters: () => [], propDecorators: { fileId: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileId", required: false }] }], uploaded: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploaded", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], fileChange: [{ type: i0.Output, args: ["fileChange"] }], uploaderInput: [{
|
|
252
|
-
type: ViewChild,
|
|
253
|
-
args: ['uploaderInput']
|
|
254
|
-
}] } });
|
|
249
|
+
}], ctorParameters: () => [], propDecorators: { fileId: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileId", required: false }] }], uploaded: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploaded", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], fileChange: [{ type: i0.Output, args: ["fileChange"] }], uploaderInput: [{ type: i0.ViewChild, args: ['uploaderInput', { isSignal: true }] }] } });
|
|
255
250
|
|
|
256
251
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
257
252
|
class BaseValueAccessor {
|
|
258
|
-
el;
|
|
253
|
+
el = inject(ElementRef);
|
|
259
254
|
onChange = () => {
|
|
260
255
|
/**/
|
|
261
256
|
};
|
|
@@ -263,9 +258,6 @@ class BaseValueAccessor {
|
|
|
263
258
|
/**/
|
|
264
259
|
};
|
|
265
260
|
lastValue;
|
|
266
|
-
constructor(el) {
|
|
267
|
-
this.el = el;
|
|
268
|
-
}
|
|
269
261
|
writeValue(value) {
|
|
270
262
|
this.el.nativeElement.value = this.lastValue = value == null ? '' : value;
|
|
271
263
|
}
|
|
@@ -285,15 +277,12 @@ class BaseValueAccessor {
|
|
|
285
277
|
_handleBlurEvent() {
|
|
286
278
|
this.onTouched();
|
|
287
279
|
}
|
|
288
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BaseValueAccessor, deps: [
|
|
289
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.0", type: BaseValueAccessor, isStandalone:
|
|
280
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BaseValueAccessor, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
281
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.0", type: BaseValueAccessor, isStandalone: true, host: { listeners: { "focusout": "_handleBlurEvent()" } }, ngImport: i0 });
|
|
290
282
|
}
|
|
291
283
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BaseValueAccessor, decorators: [{
|
|
292
|
-
type: Directive
|
|
293
|
-
|
|
294
|
-
standalone: false,
|
|
295
|
-
}]
|
|
296
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { _handleBlurEvent: [{
|
|
284
|
+
type: Directive
|
|
285
|
+
}], propDecorators: { _handleBlurEvent: [{
|
|
297
286
|
type: HostListener,
|
|
298
287
|
args: ['focusout']
|
|
299
288
|
}] } });
|
|
@@ -425,16 +414,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
425
414
|
|
|
426
415
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
427
416
|
class BaseNumberValueAccessor extends NumberValueAccessor {
|
|
428
|
-
|
|
429
|
-
renderer;
|
|
417
|
+
_el = inject(ElementRef);
|
|
430
418
|
lastValue;
|
|
431
|
-
constructor(el, renderer) {
|
|
432
|
-
super(renderer, el);
|
|
433
|
-
this.el = el;
|
|
434
|
-
this.renderer = renderer;
|
|
435
|
-
}
|
|
436
419
|
writeValue(value) {
|
|
437
|
-
this.
|
|
420
|
+
this._el.nativeElement.value = this.lastValue = value == null ? '' : value;
|
|
438
421
|
super.writeValue(value);
|
|
439
422
|
}
|
|
440
423
|
handleChangeEvent(value) {
|
|
@@ -447,15 +430,12 @@ class BaseNumberValueAccessor extends NumberValueAccessor {
|
|
|
447
430
|
_handleBlurEvent() {
|
|
448
431
|
this.onTouched();
|
|
449
432
|
}
|
|
450
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BaseNumberValueAccessor, deps:
|
|
451
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.0", type: BaseNumberValueAccessor, isStandalone:
|
|
433
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BaseNumberValueAccessor, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
434
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.0", type: BaseNumberValueAccessor, isStandalone: true, host: { listeners: { "focusout": "_handleBlurEvent()" } }, usesInheritance: true, ngImport: i0 });
|
|
452
435
|
}
|
|
453
436
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BaseNumberValueAccessor, decorators: [{
|
|
454
|
-
type: Directive
|
|
455
|
-
|
|
456
|
-
standalone: false,
|
|
457
|
-
}]
|
|
458
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { _handleBlurEvent: [{
|
|
437
|
+
type: Directive
|
|
438
|
+
}], propDecorators: { _handleBlurEvent: [{
|
|
459
439
|
type: HostListener,
|
|
460
440
|
args: ['focusout']
|
|
461
441
|
}] } });
|
|
@@ -554,13 +534,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
554
534
|
}] });
|
|
555
535
|
|
|
556
536
|
class PRadioDirective extends BaseValueAccessor {
|
|
557
|
-
_control
|
|
537
|
+
_control = inject(NgControl, {
|
|
538
|
+
self: true,
|
|
539
|
+
});
|
|
558
540
|
_modelValue;
|
|
559
541
|
_valueChanges;
|
|
560
|
-
constructor(
|
|
561
|
-
super(
|
|
562
|
-
this._control =
|
|
563
|
-
_control.valueAccessor = this;
|
|
542
|
+
constructor() {
|
|
543
|
+
super();
|
|
544
|
+
this._control.valueAccessor = this;
|
|
564
545
|
}
|
|
565
546
|
ngOnInit() {
|
|
566
547
|
this._valueChanges = this._control
|
|
@@ -592,7 +573,7 @@ class PRadioDirective extends BaseValueAccessor {
|
|
|
592
573
|
}
|
|
593
574
|
return value;
|
|
594
575
|
}
|
|
595
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: PRadioDirective, deps: [
|
|
576
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: PRadioDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
596
577
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.0", type: PRadioDirective, isStandalone: true, selector: "p-radio", host: { listeners: { "checkedChange": "handleChangeEvent()" } }, usesInheritance: true, ngImport: i0 });
|
|
597
578
|
}
|
|
598
579
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: PRadioDirective, decorators: [{
|
|
@@ -603,9 +584,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
603
584
|
'(checkedChange)': 'handleChangeEvent()',
|
|
604
585
|
},
|
|
605
586
|
}]
|
|
606
|
-
}], ctorParameters: () => [
|
|
607
|
-
type: Self
|
|
608
|
-
}] }, { type: i0.ElementRef }] });
|
|
587
|
+
}], ctorParameters: () => [] });
|
|
609
588
|
|
|
610
589
|
class PSelectDirective extends BaseValueAccessor {
|
|
611
590
|
writeValue(value) {
|
|
@@ -832,7 +811,7 @@ const createFormFilters = (values, quickFilters, quickFilterKey) => {
|
|
|
832
811
|
};
|
|
833
812
|
|
|
834
813
|
let BaseTableComponent = class BaseTableComponent extends BaseFormComponent {
|
|
835
|
-
tableOptionsChange =
|
|
814
|
+
tableOptionsChange = output();
|
|
836
815
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
837
816
|
quickFilters = [];
|
|
838
817
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -946,7 +925,7 @@ let BaseTableComponent = class BaseTableComponent extends BaseFormComponent {
|
|
|
946
925
|
selectedRows: this.parsedDefaultTableValues.selectedRows,
|
|
947
926
|
});
|
|
948
927
|
this.tableOptions.valueChanges
|
|
949
|
-
.pipe(untilDestroyed(this), startWith(this.tableOptions.value), tap((value) => this.tableOptionsChange.
|
|
928
|
+
.pipe(untilDestroyed(this), startWith(this.tableOptions.value), tap((value) => this.tableOptionsChange.emit(value)), pairwise(), map(([previous, next]) => this._getChanges(previous, next)), filter$1(changes => !!changes), debounce(changes => {
|
|
950
929
|
if (changes?.query && Object.keys(changes)?.length === 1) {
|
|
951
930
|
return timer(300);
|
|
952
931
|
}
|
|
@@ -1040,7 +1019,7 @@ let BaseTableComponent = class BaseTableComponent extends BaseFormComponent {
|
|
|
1040
1019
|
}), map(([_, current]) => current));
|
|
1041
1020
|
}
|
|
1042
1021
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BaseTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1043
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: BaseTableComponent, isStandalone:
|
|
1022
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: BaseTableComponent, isStandalone: true, selector: "ng-component", outputs: { tableOptionsChange: "tableOptionsChange" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
1044
1023
|
};
|
|
1045
1024
|
BaseTableComponent = __decorate([
|
|
1046
1025
|
UntilDestroy({ checkProperties: true })
|
|
@@ -1049,11 +1028,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
1049
1028
|
type: Component,
|
|
1050
1029
|
args: [{
|
|
1051
1030
|
template: ``,
|
|
1052
|
-
standalone: false,
|
|
1053
1031
|
}]
|
|
1054
|
-
}], propDecorators: { tableOptionsChange: [{
|
|
1055
|
-
type: Output
|
|
1056
|
-
}] } });
|
|
1032
|
+
}], propDecorators: { tableOptionsChange: [{ type: i0.Output, args: ["tableOptionsChange"] }] } });
|
|
1057
1033
|
|
|
1058
1034
|
/* eslint-disable */
|
|
1059
1035
|
/* tslint:disable */
|
|
@@ -3482,7 +3458,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
3482
3458
|
|
|
3483
3459
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3484
3460
|
class PTableNgxDirective extends BaseValueAccessor {
|
|
3485
|
-
_base
|
|
3461
|
+
_base = inject(TableComponent, {
|
|
3462
|
+
host: true,
|
|
3463
|
+
});
|
|
3486
3464
|
lastValue = {
|
|
3487
3465
|
query: '',
|
|
3488
3466
|
quickFilter: undefined,
|
|
@@ -3491,10 +3469,6 @@ class PTableNgxDirective extends BaseValueAccessor {
|
|
|
3491
3469
|
pageSize: 12,
|
|
3492
3470
|
selectedRows: [],
|
|
3493
3471
|
};
|
|
3494
|
-
constructor(el, _base) {
|
|
3495
|
-
super(el);
|
|
3496
|
-
this._base = _base;
|
|
3497
|
-
}
|
|
3498
3472
|
writeValue(value) {
|
|
3499
3473
|
this._base.query = this.lastValue.query = value?.query;
|
|
3500
3474
|
// this.el.nativeElement.query = this.lastValue.query = value?.query;
|
|
@@ -3567,7 +3541,7 @@ class PTableNgxDirective extends BaseValueAccessor {
|
|
|
3567
3541
|
: false;
|
|
3568
3542
|
}
|
|
3569
3543
|
}
|
|
3570
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: PTableNgxDirective, deps:
|
|
3544
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: PTableNgxDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3571
3545
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.0", type: PTableNgxDirective, isStandalone: true, selector: "p-table-ngx", host: { listeners: { "queryChange": "handleChange($event, \"query\")", "quickFilter": "handleChange($event, \"quickFilter\")", "pageChange": "handleChange($event, \"page\")", "pageSizeChange": "handleChange($event, \"pageSize\")", "selectedRowsChange": "handleChange($event, \"selectedRows\")" } }, providers: [
|
|
3572
3546
|
{
|
|
3573
3547
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -3595,9 +3569,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
3595
3569
|
},
|
|
3596
3570
|
],
|
|
3597
3571
|
}]
|
|
3598
|
-
}]
|
|
3599
|
-
type: Host
|
|
3600
|
-
}] }] });
|
|
3572
|
+
}] });
|
|
3601
3573
|
|
|
3602
3574
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3603
3575
|
class PTableDirective extends BaseValueAccessor {
|
|
@@ -4897,32 +4869,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
4897
4869
|
}] });
|
|
4898
4870
|
|
|
4899
4871
|
class PToastDirective {
|
|
4900
|
-
delay = 5000;
|
|
4901
|
-
identifier;
|
|
4902
|
-
dismissOnAction = true;
|
|
4903
|
-
actionFunc;
|
|
4872
|
+
delay = input(5000, ...(ngDevMode ? [{ debugName: "delay" }] : []));
|
|
4873
|
+
identifier = input.required(...(ngDevMode ? [{ debugName: "identifier" }] : []));
|
|
4874
|
+
dismissOnAction = input(true, ...(ngDevMode ? [{ debugName: "dismissOnAction" }] : []));
|
|
4875
|
+
actionFunc = input(...(ngDevMode ? [undefined, { debugName: "actionFunc" }] : []));
|
|
4904
4876
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4905
|
-
actionData = {};
|
|
4906
|
-
dismiss =
|
|
4877
|
+
actionData = input({}, ...(ngDevMode ? [{ debugName: "actionData" }] : []));
|
|
4878
|
+
dismiss = output();
|
|
4907
4879
|
ngOnInit() {
|
|
4908
|
-
|
|
4880
|
+
const delay = this.delay();
|
|
4881
|
+
if (delay === 'infinite' || delay === 0) {
|
|
4909
4882
|
return;
|
|
4910
4883
|
}
|
|
4911
|
-
setTimeout(() => this.doDismiss(),
|
|
4884
|
+
setTimeout(() => this.doDismiss(), delay);
|
|
4912
4885
|
}
|
|
4913
4886
|
onAction() {
|
|
4914
|
-
|
|
4887
|
+
const actionFunc = this.actionFunc();
|
|
4888
|
+
if (this.dismissOnAction() && !actionFunc) {
|
|
4915
4889
|
return this.doDismiss();
|
|
4916
4890
|
}
|
|
4917
|
-
if (
|
|
4918
|
-
|
|
4891
|
+
if (actionFunc) {
|
|
4892
|
+
actionFunc(this, this.actionData());
|
|
4919
4893
|
}
|
|
4920
4894
|
}
|
|
4921
4895
|
doDismiss() {
|
|
4922
|
-
this.dismiss.
|
|
4896
|
+
this.dismiss.emit(this.identifier());
|
|
4923
4897
|
}
|
|
4924
4898
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: PToastDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4925
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
4899
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.0", type: PToastDirective, isStandalone: true, selector: "p-toast", inputs: { delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null }, identifier: { classPropertyName: "identifier", publicName: "identifier", isSignal: true, isRequired: true, transformFunction: null }, dismissOnAction: { classPropertyName: "dismissOnAction", publicName: "dismissOnAction", isSignal: true, isRequired: false, transformFunction: null }, actionFunc: { classPropertyName: "actionFunc", publicName: "actionFunc", isSignal: true, isRequired: false, transformFunction: null }, actionData: { classPropertyName: "actionData", publicName: "actionData", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dismiss: "dismiss" }, host: { listeners: { "action": "onAction()" } }, ngImport: i0 });
|
|
4926
4900
|
}
|
|
4927
4901
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: PToastDirective, decorators: [{
|
|
4928
4902
|
type: Directive,
|
|
@@ -4933,19 +4907,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
4933
4907
|
},
|
|
4934
4908
|
standalone: true,
|
|
4935
4909
|
}]
|
|
4936
|
-
}], propDecorators: { delay: [{
|
|
4937
|
-
type: Input
|
|
4938
|
-
}], identifier: [{
|
|
4939
|
-
type: Input
|
|
4940
|
-
}], dismissOnAction: [{
|
|
4941
|
-
type: Input
|
|
4942
|
-
}], actionFunc: [{
|
|
4943
|
-
type: Input
|
|
4944
|
-
}], actionData: [{
|
|
4945
|
-
type: Input
|
|
4946
|
-
}], dismiss: [{
|
|
4947
|
-
type: Output
|
|
4948
|
-
}] } });
|
|
4910
|
+
}], propDecorators: { delay: [{ type: i0.Input, args: [{ isSignal: true, alias: "delay", required: false }] }], identifier: [{ type: i0.Input, args: [{ isSignal: true, alias: "identifier", required: true }] }], dismissOnAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissOnAction", required: false }] }], actionFunc: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionFunc", required: false }] }], actionData: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionData", required: false }] }], dismiss: [{ type: i0.Output, args: ["dismiss"] }] } });
|
|
4949
4911
|
|
|
4950
4912
|
var PToastVariants;
|
|
4951
4913
|
(function (PToastVariants) {
|
|
@@ -5006,18 +4968,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
5006
4968
|
|
|
5007
4969
|
/* top-0 bottom-0 left-0 right-0 */
|
|
5008
4970
|
let ToastContainerComponent = class ToastContainerComponent {
|
|
5009
|
-
|
|
4971
|
+
_elRef = inject(ElementRef);
|
|
4972
|
+
z = inject(NgZone);
|
|
5010
4973
|
_toastService = inject(ToastService);
|
|
5011
4974
|
toasts$ = this._toastService.toasts$.pipe(map$1(arr => arr.toReversed()));
|
|
5012
4975
|
el;
|
|
5013
|
-
constructor(
|
|
5014
|
-
this.
|
|
5015
|
-
this.el = r.nativeElement;
|
|
4976
|
+
constructor() {
|
|
4977
|
+
this.el = this._elRef.nativeElement;
|
|
5016
4978
|
}
|
|
5017
4979
|
dismiss(identifier) {
|
|
5018
4980
|
this._toastService.hide(identifier);
|
|
5019
4981
|
}
|
|
5020
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ToastContainerComponent, deps: [
|
|
4982
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ToastContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5021
4983
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: ToastContainerComponent, isStandalone: true, selector: "p-toast-container", inputs: { placement: "placement" }, ngImport: i0, template: "@for (toast of toasts$ | async; track toast; let index = $index) {\n\t<p-toast\n\t\tanimate.enter=\"animate-in fade-in slide-in-from-top\"\n\t\tanimate.leave=\"animate-out fade-out\"\n\t\t[actionData]=\"toast.options.actionData\"\n\t\t[actionFunc]=\"toast.options.action\"\n\t\t[actionIcon]=\"toast.options.icon?.variant\"\n\t\t[actionIconFlip]=\"toast.options.icon?.flip\"\n\t\t[actionIconRotate]=\"toast.options.icon?.rotate\"\n\t\t[content]=\"toast.content\"\n\t\t[delay]=\"toast.options.delay ?? 5000\"\n\t\t[dismissOnAction]=\"toast.options.dismissOnAction ?? true\"\n\t\t[enableAction]=\"toast.options.enableAction\"\n\t\t[header]=\"toast.header\"\n\t\t[identifier]=\"toast.identifier\"\n\t\t[variant]=\"toast.variant\"\n\t\t(dismiss)=\"dismiss($event)\"\n\t/>\n}\n", dependencies: [{ kind: "component", type: PToast, selector: "p-toast", inputs: ["actionIcon", "actionIconFlip", "actionIconRotate", "content", "enableAction", "header", "variant"] }, { kind: "directive", type: PToastDirective, selector: "p-toast", inputs: ["delay", "identifier", "dismissOnAction", "actionFunc", "actionData"], outputs: ["dismiss"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5022
4984
|
};
|
|
5023
4985
|
ToastContainerComponent = __decorate([
|
|
@@ -5029,7 +4991,7 @@ ToastContainerComponent = __decorate([
|
|
|
5029
4991
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ToastContainerComponent, decorators: [{
|
|
5030
4992
|
type: Component,
|
|
5031
4993
|
args: [{ selector: 'p-toast-container', changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['placement'], standalone: true, imports: [PToast, PToastDirective, AsyncPipe], template: "@for (toast of toasts$ | async; track toast; let index = $index) {\n\t<p-toast\n\t\tanimate.enter=\"animate-in fade-in slide-in-from-top\"\n\t\tanimate.leave=\"animate-out fade-out\"\n\t\t[actionData]=\"toast.options.actionData\"\n\t\t[actionFunc]=\"toast.options.action\"\n\t\t[actionIcon]=\"toast.options.icon?.variant\"\n\t\t[actionIconFlip]=\"toast.options.icon?.flip\"\n\t\t[actionIconRotate]=\"toast.options.icon?.rotate\"\n\t\t[content]=\"toast.content\"\n\t\t[delay]=\"toast.options.delay ?? 5000\"\n\t\t[dismissOnAction]=\"toast.options.dismissOnAction ?? true\"\n\t\t[enableAction]=\"toast.options.enableAction\"\n\t\t[header]=\"toast.header\"\n\t\t[identifier]=\"toast.identifier\"\n\t\t[variant]=\"toast.variant\"\n\t\t(dismiss)=\"dismiss($event)\"\n\t/>\n}\n" }]
|
|
5032
|
-
}], ctorParameters: () => [
|
|
4994
|
+
}], ctorParameters: () => [] });
|
|
5033
4995
|
|
|
5034
4996
|
const TOAST_COMPONENTS = [ToastContainerComponent];
|
|
5035
4997
|
|
|
@@ -5051,15 +5013,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
5051
5013
|
|
|
5052
5014
|
const MODULES = [TableModule, ToastModule, OverlayModule];
|
|
5053
5015
|
|
|
5016
|
+
/*
|
|
5017
|
+
This pipe overrides the default currency pipe from angular,
|
|
5018
|
+
this can be removed when angular supports currency defaults
|
|
5019
|
+
https://github.com/angular/angular/issues/25461
|
|
5020
|
+
*/
|
|
5054
5021
|
class CustomCurrencyPipe {
|
|
5055
|
-
_currencyPipe;
|
|
5056
|
-
constructor(_currencyPipe) {
|
|
5057
|
-
this._currencyPipe = _currencyPipe;
|
|
5058
|
-
}
|
|
5022
|
+
_currencyPipe = inject(CurrencyPipe);
|
|
5059
5023
|
transform(value, currencyCode = 'EUR', display = 'symbol', digitsInfo = '1.2-2', locale = 'nl') {
|
|
5060
5024
|
return this._currencyPipe.transform(value, currencyCode, display, digitsInfo, locale);
|
|
5061
5025
|
}
|
|
5062
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CustomCurrencyPipe, deps: [
|
|
5026
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CustomCurrencyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5063
5027
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: CustomCurrencyPipe, isStandalone: true, name: "pcurrency" });
|
|
5064
5028
|
}
|
|
5065
5029
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CustomCurrencyPipe, decorators: [{
|
|
@@ -5067,17 +5031,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
5067
5031
|
args: [{
|
|
5068
5032
|
name: 'pcurrency',
|
|
5069
5033
|
}]
|
|
5070
|
-
}]
|
|
5034
|
+
}] });
|
|
5071
5035
|
|
|
5072
5036
|
class CustomDatePipe {
|
|
5073
|
-
_datePipe;
|
|
5074
|
-
constructor(_datePipe) {
|
|
5075
|
-
this._datePipe = _datePipe;
|
|
5076
|
-
}
|
|
5037
|
+
_datePipe = inject(DatePipe);
|
|
5077
5038
|
transform(value, format = 'd MMM yyyy') {
|
|
5078
5039
|
return this._datePipe.transform(value, format);
|
|
5079
5040
|
}
|
|
5080
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CustomDatePipe, deps: [
|
|
5041
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CustomDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5081
5042
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: CustomDatePipe, isStandalone: true, name: "pdate" });
|
|
5082
5043
|
}
|
|
5083
5044
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CustomDatePipe, decorators: [{
|
|
@@ -5085,36 +5046,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
5085
5046
|
args: [{
|
|
5086
5047
|
name: 'pdate',
|
|
5087
5048
|
}]
|
|
5088
|
-
}]
|
|
5049
|
+
}] });
|
|
5089
5050
|
|
|
5090
5051
|
class SafePipe {
|
|
5091
|
-
|
|
5092
|
-
constructor(sanitizer) {
|
|
5093
|
-
this.sanitizer = sanitizer;
|
|
5094
|
-
}
|
|
5052
|
+
_sanitizer = inject(DomSanitizer);
|
|
5095
5053
|
transform(value, type) {
|
|
5096
5054
|
switch (type) {
|
|
5097
5055
|
case 'html': {
|
|
5098
|
-
return this.
|
|
5056
|
+
return this._sanitizer.bypassSecurityTrustHtml(value);
|
|
5099
5057
|
}
|
|
5100
5058
|
case 'style': {
|
|
5101
|
-
return this.
|
|
5059
|
+
return this._sanitizer.bypassSecurityTrustStyle(value);
|
|
5102
5060
|
}
|
|
5103
5061
|
case 'script': {
|
|
5104
|
-
return this.
|
|
5062
|
+
return this._sanitizer.bypassSecurityTrustScript(value);
|
|
5105
5063
|
}
|
|
5106
5064
|
case 'url': {
|
|
5107
|
-
return this.
|
|
5065
|
+
return this._sanitizer.bypassSecurityTrustUrl(value);
|
|
5108
5066
|
}
|
|
5109
5067
|
case 'resourceUrl': {
|
|
5110
|
-
return this.
|
|
5068
|
+
return this._sanitizer.bypassSecurityTrustResourceUrl(value);
|
|
5111
5069
|
}
|
|
5112
5070
|
default: {
|
|
5113
5071
|
throw new Error(`Invalid safe type specified: ${type}`);
|
|
5114
5072
|
}
|
|
5115
5073
|
}
|
|
5116
5074
|
}
|
|
5117
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SafePipe, deps: [
|
|
5075
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SafePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5118
5076
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: SafePipe, isStandalone: true, name: "psafe" });
|
|
5119
5077
|
}
|
|
5120
5078
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SafePipe, decorators: [{
|
|
@@ -5122,7 +5080,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
5122
5080
|
args: [{
|
|
5123
5081
|
name: 'psafe',
|
|
5124
5082
|
}]
|
|
5125
|
-
}]
|
|
5083
|
+
}] });
|
|
5126
5084
|
|
|
5127
5085
|
class SelectAutocompletePipe {
|
|
5128
5086
|
transform(value) {
|