@paperless/angular 3.6.1 → 3.6.2

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,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
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';
2
+ import { Component, input, output, signal, effect, ViewChild, ChangeDetectionStrategy, HostListener, Directive, Self, inject, Injector, TemplateRef, Injectable, NgModule, EventEmitter, Output, HostBinding, Input, 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
- import { BehaviorSubject, filter, Subject, timer, fromEvent, distinctUntilChanged, debounceTime, take, map as map$1 } from 'rxjs';
5
+ import { filter, Subject, timer, fromEvent, BehaviorSubject, distinctUntilChanged, debounceTime, take, map as map$1 } from 'rxjs';
6
6
  import { ObserversModule } from '@angular/cdk/observers';
7
7
  import { Overlay, OverlayConfig, createOverlayRef, OverlayModule as OverlayModule$1 } from '@angular/cdk/overlay';
8
8
  import { PlatformModule } from '@angular/cdk/platform';
@@ -203,29 +203,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
203
203
  }] });
204
204
 
205
205
  class BaseUploadComponent {
206
- fileId;
207
- uploaded = false;
208
- set loading(value) {
209
- this.loading$.next(value);
210
- }
206
+ fileId = input(...(ngDevMode ? [undefined, { debugName: "fileId" }] : []));
207
+ uploaded = input(false, ...(ngDevMode ? [{ debugName: "uploaded" }] : []));
208
+ loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
211
209
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
212
- fileChange = new EventEmitter();
210
+ fileChange = output();
213
211
  uploaderInput;
214
212
  file;
215
- loading$ = new BehaviorSubject(false);
213
+ loadingParsed = signal(false, ...(ngDevMode ? [{ debugName: "loadingParsed" }] : []));
214
+ constructor() {
215
+ effect(() => {
216
+ const loading = this.loading();
217
+ this.loadingParsed.set(loading);
218
+ });
219
+ }
216
220
  onChange($event) {
217
221
  const target = $event.target;
218
222
  const file = target.files?.[0];
219
223
  if (file) {
220
- this.loading$.next(true);
224
+ this.loadingParsed.set(true);
221
225
  const reader = new FileReader();
222
226
  reader.addEventListener('load', _ => this.onLoad(file, reader.result));
223
227
  reader.readAsDataURL(file);
224
228
  }
225
229
  }
226
230
  onLoad(file, result) {
227
- this.fileChange.next({
228
- fileId: this.fileId,
231
+ this.fileChange.emit({
232
+ fileId: this.fileId(),
229
233
  result,
230
234
  file,
231
235
  });
@@ -233,27 +237,18 @@ class BaseUploadComponent {
233
237
  this.uploaderInput.nativeElement.value = '';
234
238
  }
235
239
  this.file = file;
236
- this.loading$.next(false);
240
+ this.loadingParsed.set(false);
237
241
  }
238
242
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BaseUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
239
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: BaseUploadComponent, isStandalone: false, selector: "ng-component", inputs: { fileId: "fileId", uploaded: "uploaded", loading: "loading" }, outputs: { fileChange: "fileChange" }, viewQueries: [{ propertyName: "uploaderInput", first: true, predicate: ["uploaderInput"], descendants: true }], ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
243
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.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 }], ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
240
244
  }
241
245
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BaseUploadComponent, decorators: [{
242
246
  type: Component,
243
247
  args: [{
244
248
  template: ``,
245
249
  changeDetection: ChangeDetectionStrategy.OnPush,
246
- standalone: false,
247
250
  }]
248
- }], propDecorators: { fileId: [{
249
- type: Input
250
- }], uploaded: [{
251
- type: Input
252
- }], loading: [{
253
- type: Input
254
- }], fileChange: [{
255
- type: Output
256
- }], uploaderInput: [{
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: [{
257
252
  type: ViewChild,
258
253
  args: ['uploaderInput']
259
254
  }] } });