@paperless/angular 3.5.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, EventEmitter, ViewChild, Output, Input, ChangeDetectionStrategy, HostListener, Directive, Self, Injector, Injectable, NgModule, HostBinding,
|
|
2
|
+
import { Component, EventEmitter, ViewChild, Output, Input, ChangeDetectionStrategy, HostListener, Directive, Self, signal, effect, inject, Injector, TemplateRef, Injectable, NgModule, HostBinding, ContentChild, Host, ElementRef, ContentChildren, ViewChildren, Pipe, provideAppInitializer } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormControl, FormGroup, FormArray, NG_VALUE_ACCESSOR, NumberValueAccessor } from '@angular/forms';
|
|
5
5
|
import { BehaviorSubject, filter, Subject, timer, fromEvent, distinctUntilChanged, debounceTime, take, map as map$1 } from 'rxjs';
|
|
6
6
|
import { ObserversModule } from '@angular/cdk/observers';
|
|
7
|
-
import
|
|
8
|
-
import { OverlayConfig, OverlayModule as OverlayModule$1 } from '@angular/cdk/overlay';
|
|
7
|
+
import { Overlay, OverlayConfig, createOverlayRef, OverlayModule as OverlayModule$1 } from '@angular/cdk/overlay';
|
|
9
8
|
import { PlatformModule } from '@angular/cdk/platform';
|
|
10
|
-
import { CdkPortal, ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
9
|
+
import { CdkPortal, TemplatePortal, ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
11
10
|
import { __decorate } from 'tslib';
|
|
12
11
|
import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
|
|
13
12
|
import { startWith, tap, pairwise, map, filter as filter$1, debounce } from 'rxjs/operators';
|
|
14
13
|
import { PAGINATION_DEFAULT_PAGE_SIZE, cn, getTableCellColumnClasses, objectGetByPath, state, isMobile, floatingMenuContainerClass, onStateChange, TABLE_COLUMN_SIZES, SELECT_DEFAULT_MAX_DISPLAYED_ITEMS } from '@paperless/core';
|
|
15
|
-
import * as i1$
|
|
14
|
+
import * as i1$1 from '@angular/common';
|
|
16
15
|
import { NgTemplateOutlet, AsyncPipe, CommonModule, DatePipe, CurrencyPipe } from '@angular/common';
|
|
17
16
|
import { defineCustomElement as defineCustomElement$1 } from '@paperless/core/components/p-accordion.js';
|
|
18
17
|
import { defineCustomElement as defineCustomElement$2 } from '@paperless/core/components/p-attachment.js';
|
|
@@ -90,7 +89,7 @@ import { defineCustomElement as defineCustomElement$19 } from '@paperless/core/c
|
|
|
90
89
|
import { RouterLink, RouterModule } from '@angular/router';
|
|
91
90
|
import { v4 } from 'uuid';
|
|
92
91
|
import { defineCustomElements } from '@paperless/core/loader';
|
|
93
|
-
import * as i1$
|
|
92
|
+
import * as i1$2 from '@angular/platform-browser';
|
|
94
93
|
|
|
95
94
|
class BaseFormComponent {
|
|
96
95
|
markedDirty = false;
|
|
@@ -690,41 +689,60 @@ const DIRECTIVES$1 = [
|
|
|
690
689
|
class OverlayRef {
|
|
691
690
|
_overlay;
|
|
692
691
|
instance;
|
|
692
|
+
componentRef;
|
|
693
|
+
injector;
|
|
694
|
+
effectRef;
|
|
695
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
696
|
+
data = signal({}, ...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
693
697
|
closed$ = new Subject();
|
|
694
698
|
constructor(_overlay) {
|
|
695
699
|
this._overlay = _overlay;
|
|
696
700
|
}
|
|
701
|
+
createEffect() {
|
|
702
|
+
if (!this.injector || !this.componentRef) {
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
this.effectRef = effect(() => {
|
|
706
|
+
const data = this.data();
|
|
707
|
+
for (const key of Object.keys(data)) {
|
|
708
|
+
const value = typeof data[key] === 'function' ? data[key]() : data[key];
|
|
709
|
+
this.componentRef.setInput(key, value);
|
|
710
|
+
}
|
|
711
|
+
}, { ...(ngDevMode ? { debugName: "effectRef" } : {}), injector: this.injector });
|
|
712
|
+
}
|
|
697
713
|
close() {
|
|
698
714
|
this._overlay.dispose();
|
|
699
715
|
this.closed$.next(null);
|
|
716
|
+
if (this.effectRef) {
|
|
717
|
+
this.effectRef.destroy();
|
|
718
|
+
}
|
|
700
719
|
}
|
|
701
720
|
}
|
|
702
721
|
|
|
703
722
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
704
723
|
class OverlayService {
|
|
705
|
-
|
|
706
|
-
|
|
724
|
+
overlay = inject(Overlay);
|
|
725
|
+
injector = inject(Injector);
|
|
707
726
|
overlayRef;
|
|
708
|
-
constructor(injector, overlay) {
|
|
709
|
-
this.injector = injector;
|
|
710
|
-
this.overlay = overlay;
|
|
711
|
-
}
|
|
712
727
|
open(component, options = {}) {
|
|
713
728
|
const overlay = this._createOverlay();
|
|
714
729
|
const overlayRef = new OverlayRef(overlay);
|
|
715
|
-
this._attachModalContainer(overlay, overlayRef, component, options.providers ?? []);
|
|
730
|
+
this._attachModalContainer(overlay, overlayRef, component, options.providers ?? [], options.data ?? {});
|
|
716
731
|
this._attachData(overlayRef, options);
|
|
717
732
|
this.overlayRef = overlayRef;
|
|
718
733
|
return overlayRef;
|
|
719
734
|
}
|
|
720
|
-
_attachModalContainer(overlay, overlayRef, component, providers) {
|
|
735
|
+
_attachModalContainer(overlay, overlayRef, component, providers, data) {
|
|
721
736
|
const injector = this._createInjector(overlayRef, providers);
|
|
722
737
|
const containerPortal = component instanceof CdkPortal
|
|
723
738
|
? component
|
|
724
|
-
:
|
|
739
|
+
: component instanceof TemplateRef
|
|
740
|
+
? new TemplatePortal(component, null, { $implicit: data }, injector)
|
|
741
|
+
: new ComponentPortal(component, null, injector);
|
|
725
742
|
const containerRef = overlay.attach(containerPortal);
|
|
743
|
+
overlayRef.componentRef = containerRef;
|
|
726
744
|
overlayRef.instance = containerRef.instance;
|
|
727
|
-
|
|
745
|
+
overlayRef.injector = injector;
|
|
728
746
|
}
|
|
729
747
|
_createInjector(overlayRef, providers) {
|
|
730
748
|
return Injector.create({
|
|
@@ -754,23 +772,26 @@ class OverlayService {
|
|
|
754
772
|
}
|
|
755
773
|
_createOverlay() {
|
|
756
774
|
// Returns an OverlayConfig
|
|
757
|
-
const
|
|
775
|
+
const config = this._getOverlayConfig();
|
|
758
776
|
// Returns an OverlayRef
|
|
759
|
-
return this.
|
|
777
|
+
return createOverlayRef(this.injector, config);
|
|
760
778
|
}
|
|
761
779
|
_attachData(overlayRef, options) {
|
|
762
|
-
if (options.data
|
|
763
|
-
|
|
764
|
-
overlayRef.instance[key] = options.data[key];
|
|
765
|
-
}
|
|
780
|
+
if (!options.data || typeof options.data !== 'object') {
|
|
781
|
+
return;
|
|
766
782
|
}
|
|
783
|
+
if (overlayRef.instance instanceof TemplateRef) {
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
786
|
+
overlayRef.createEffect();
|
|
787
|
+
overlayRef.data.set(options.data);
|
|
767
788
|
}
|
|
768
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OverlayService, deps: [
|
|
789
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OverlayService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
769
790
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OverlayService });
|
|
770
791
|
}
|
|
771
792
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OverlayService, decorators: [{
|
|
772
793
|
type: Injectable
|
|
773
|
-
}]
|
|
794
|
+
}] });
|
|
774
795
|
|
|
775
796
|
class OverlayModule {
|
|
776
797
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OverlayModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -5043,7 +5064,7 @@ class CustomCurrencyPipe {
|
|
|
5043
5064
|
transform(value, currencyCode = 'EUR', display = 'symbol', digitsInfo = '1.2-2', locale = 'nl') {
|
|
5044
5065
|
return this._currencyPipe.transform(value, currencyCode, display, digitsInfo, locale);
|
|
5045
5066
|
}
|
|
5046
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CustomCurrencyPipe, deps: [{ token: i1$
|
|
5067
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CustomCurrencyPipe, deps: [{ token: i1$1.CurrencyPipe }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5047
5068
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: CustomCurrencyPipe, isStandalone: true, name: "pcurrency" });
|
|
5048
5069
|
}
|
|
5049
5070
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CustomCurrencyPipe, decorators: [{
|
|
@@ -5051,7 +5072,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
5051
5072
|
args: [{
|
|
5052
5073
|
name: 'pcurrency',
|
|
5053
5074
|
}]
|
|
5054
|
-
}], ctorParameters: () => [{ type: i1$
|
|
5075
|
+
}], ctorParameters: () => [{ type: i1$1.CurrencyPipe }] });
|
|
5055
5076
|
|
|
5056
5077
|
class CustomDatePipe {
|
|
5057
5078
|
_datePipe;
|
|
@@ -5061,7 +5082,7 @@ class CustomDatePipe {
|
|
|
5061
5082
|
transform(value, format = 'd MMM yyyy') {
|
|
5062
5083
|
return this._datePipe.transform(value, format);
|
|
5063
5084
|
}
|
|
5064
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CustomDatePipe, deps: [{ token: i1$
|
|
5085
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CustomDatePipe, deps: [{ token: i1$1.DatePipe }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5065
5086
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: CustomDatePipe, isStandalone: true, name: "pdate" });
|
|
5066
5087
|
}
|
|
5067
5088
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CustomDatePipe, decorators: [{
|
|
@@ -5069,7 +5090,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
5069
5090
|
args: [{
|
|
5070
5091
|
name: 'pdate',
|
|
5071
5092
|
}]
|
|
5072
|
-
}], ctorParameters: () => [{ type: i1$
|
|
5093
|
+
}], ctorParameters: () => [{ type: i1$1.DatePipe }] });
|
|
5073
5094
|
|
|
5074
5095
|
class SafePipe {
|
|
5075
5096
|
sanitizer;
|
|
@@ -5098,7 +5119,7 @@ class SafePipe {
|
|
|
5098
5119
|
}
|
|
5099
5120
|
}
|
|
5100
5121
|
}
|
|
5101
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SafePipe, deps: [{ token: i1$
|
|
5122
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SafePipe, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5102
5123
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: SafePipe, isStandalone: true, name: "psafe" });
|
|
5103
5124
|
}
|
|
5104
5125
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SafePipe, decorators: [{
|
|
@@ -5106,7 +5127,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
5106
5127
|
args: [{
|
|
5107
5128
|
name: 'psafe',
|
|
5108
5129
|
}]
|
|
5109
|
-
}], ctorParameters: () => [{ type: i1$
|
|
5130
|
+
}], ctorParameters: () => [{ type: i1$2.DomSanitizer }] });
|
|
5110
5131
|
|
|
5111
5132
|
class SelectAutocompletePipe {
|
|
5112
5133
|
transform(value) {
|