ets-fe-ng-sdk 20.0.11 → 20.0.12
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/fesm2022/ets-fe-ng-sdk.mjs +25 -14
- package/fesm2022/ets-fe-ng-sdk.mjs.map +1 -1
- package/index.d.ts +21 -14
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i2$2 from '@angular/forms';
|
|
2
2
|
import { FormControl, Validators, FormGroup, FormArray, FormBuilder, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule, UntypedFormArray } from '@angular/forms';
|
|
3
|
-
import { ReplaySubject, filter, debounceTime, lastValueFrom, Observable, BehaviorSubject, isObservable,
|
|
3
|
+
import { ReplaySubject, filter, debounceTime, lastValueFrom, Observable, BehaviorSubject, isObservable, of, merge, firstValueFrom, throwError, interval, map as map$1, startWith, switchMap, forkJoin, catchError as catchError$1, first, distinctUntilChanged, tap as tap$1, fromEvent, mergeMap, debounce, timer, Subject, distinct, concat } from 'rxjs';
|
|
4
4
|
import 'zone.js/plugins/zone-error';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
6
|
import { signal, computed, Injectable, inject, APP_INITIALIZER, isDevMode, Pipe, NgModule, input, Directive, booleanAttribute, ChangeDetectorRef, model, output, effect, ViewChild, Input, Component, EventEmitter, Output, forwardRef, ChangeDetectionStrategy, HostListener, HostBinding, viewChild, linkedSignal, viewChildren, Inject, DestroyRef, contentChild, ElementRef, InjectionToken, ErrorHandler } from '@angular/core';
|
|
@@ -3464,6 +3464,18 @@ class UtilityService {
|
|
|
3464
3464
|
return Promise.resolve(val);
|
|
3465
3465
|
}
|
|
3466
3466
|
};
|
|
3467
|
+
this.getCodeTitles = (obs, valueField) => obs.pipe(catchError((e) => {
|
|
3468
|
+
console.warn(e);
|
|
3469
|
+
return of(null);
|
|
3470
|
+
}), map((r) => ({ list: r, map: r?.toMap(valueField) })));
|
|
3471
|
+
this.rxResourceErrorWrapper = (obs) => obs.pipe(catchError((e) => {
|
|
3472
|
+
console.warn(e);
|
|
3473
|
+
return of(null);
|
|
3474
|
+
}));
|
|
3475
|
+
this.resourceErrorWrapper = (ps) => ps.catch((e) => {
|
|
3476
|
+
console.warn(e);
|
|
3477
|
+
return null;
|
|
3478
|
+
});
|
|
3467
3479
|
/**
|
|
3468
3480
|
* Merges multiple observables into a single observable
|
|
3469
3481
|
* @param arr - Array of observables to fetch
|
|
@@ -8434,9 +8446,8 @@ class InputFormatDirective {
|
|
|
8434
8446
|
get shouldFormat() {
|
|
8435
8447
|
return this.acceptedType.includes(this.oType);
|
|
8436
8448
|
}
|
|
8437
|
-
constructor(elementRef,
|
|
8449
|
+
constructor(elementRef, decimalPipe) {
|
|
8438
8450
|
this.elementRef = elementRef;
|
|
8439
|
-
this.formatterService = formatterService;
|
|
8440
8451
|
this.decimalPipe = decimalPipe;
|
|
8441
8452
|
/** List of input types that can be formatted */
|
|
8442
8453
|
this.acceptedType = ['text', 'number', 'percentage'];
|
|
@@ -8521,7 +8532,7 @@ class InputFormatDirective {
|
|
|
8521
8532
|
else if (this.oType == 'percentage')
|
|
8522
8533
|
this.setPercentageInput(value);
|
|
8523
8534
|
else if (this.oType == 'text' && !this.noTextFormat) {
|
|
8524
|
-
this._value = this.
|
|
8535
|
+
this._value = this.inputFormatService.toTitleCase(value);
|
|
8525
8536
|
this.setTextInput(value);
|
|
8526
8537
|
}
|
|
8527
8538
|
else if (this.oType == 'checkbox') {
|
|
@@ -8545,7 +8556,7 @@ class InputFormatDirective {
|
|
|
8545
8556
|
nValue = value;
|
|
8546
8557
|
}
|
|
8547
8558
|
else if (this.oType == 'text' && !this.noTextFormat) {
|
|
8548
|
-
nValue = this.
|
|
8559
|
+
nValue = this.inputFormatService.toTitleCase(value);
|
|
8549
8560
|
}
|
|
8550
8561
|
else if (this.oType == 'checkbox') {
|
|
8551
8562
|
nValue = this.el?.checked;
|
|
@@ -8555,11 +8566,11 @@ class InputFormatDirective {
|
|
|
8555
8566
|
nValue = value;
|
|
8556
8567
|
}
|
|
8557
8568
|
else {
|
|
8558
|
-
nValue = this.
|
|
8569
|
+
nValue = this.inputFormatService.normalise(value);
|
|
8559
8570
|
}
|
|
8560
8571
|
}
|
|
8561
8572
|
else if (this.oType == 'percentage') {
|
|
8562
|
-
nValue = this.
|
|
8573
|
+
nValue = this.inputFormatService.normalise(String(value)?.replace('%', ''));
|
|
8563
8574
|
}
|
|
8564
8575
|
else {
|
|
8565
8576
|
nValue = value;
|
|
@@ -8582,7 +8593,7 @@ class InputFormatDirective {
|
|
|
8582
8593
|
this.setPercentageInput(this.value);
|
|
8583
8594
|
}
|
|
8584
8595
|
else if (this.oType == 'text' && !this.noTextFormat)
|
|
8585
|
-
this.el.value = this.
|
|
8596
|
+
this.el.value = this.inputFormatService.toTitleCase(this.value);
|
|
8586
8597
|
}, 0);
|
|
8587
8598
|
}
|
|
8588
8599
|
/**
|
|
@@ -8617,7 +8628,7 @@ class InputFormatDirective {
|
|
|
8617
8628
|
if (this.el.disabled)
|
|
8618
8629
|
this.setInput(value);
|
|
8619
8630
|
else {
|
|
8620
|
-
this._value = this.
|
|
8631
|
+
this._value = this.inputFormatService.toTitleCase(value);
|
|
8621
8632
|
this.setTextInput(value);
|
|
8622
8633
|
}
|
|
8623
8634
|
}
|
|
@@ -8701,7 +8712,7 @@ class InputFormatDirective {
|
|
|
8701
8712
|
this.elementRef.nativeElement.value = '';
|
|
8702
8713
|
return;
|
|
8703
8714
|
}
|
|
8704
|
-
this.elementRef.nativeElement.value = this.
|
|
8715
|
+
this.elementRef.nativeElement.value = this.inputFormatService.toTitleCase(value);
|
|
8705
8716
|
}
|
|
8706
8717
|
/**
|
|
8707
8718
|
* Set a value on the input element without special formatting
|
|
@@ -8736,7 +8747,7 @@ class InputFormatDirective {
|
|
|
8736
8747
|
if (this.isLastCharacterDecimalSeparator(value)) {
|
|
8737
8748
|
return;
|
|
8738
8749
|
}
|
|
8739
|
-
this._value = this.
|
|
8750
|
+
this._value = this.inputFormatService.normalise(value);
|
|
8740
8751
|
if (value) {
|
|
8741
8752
|
this.elementRef.nativeElement.value = this.inputFormatService.normaliseForInput(this.value);
|
|
8742
8753
|
}
|
|
@@ -8753,7 +8764,7 @@ class InputFormatDirective {
|
|
|
8753
8764
|
if (this.isLastCharacterDecimalSeparator(value)) {
|
|
8754
8765
|
return;
|
|
8755
8766
|
}
|
|
8756
|
-
this._value = this.
|
|
8767
|
+
this._value = this.inputFormatService.normalise(value.replace('%', ''));
|
|
8757
8768
|
if (value) {
|
|
8758
8769
|
this.elementRef.nativeElement.value = this.inputFormatService.normaliseForInput(this.value);
|
|
8759
8770
|
}
|
|
@@ -8771,7 +8782,7 @@ class InputFormatDirective {
|
|
|
8771
8782
|
// debugger
|
|
8772
8783
|
// this._onBlur()
|
|
8773
8784
|
}
|
|
8774
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: InputFormatDirective, deps: [{ token: i0.ElementRef }, { token:
|
|
8785
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: InputFormatDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.DecimalPipe }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
8775
8786
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.4", type: InputFormatDirective, isStandalone: true, selector: "input:not([matInput]):not([noformat])", inputs: { value: "value" }, host: { listeners: { "input": "input($event.target.value)", "blur": "_onBlur()", "focus": "onFocus()" } }, providers: [
|
|
8776
8787
|
{
|
|
8777
8788
|
provide: MAT_INPUT_VALUE_ACCESSOR,
|
|
@@ -8801,7 +8812,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
8801
8812
|
],
|
|
8802
8813
|
standalone: true,
|
|
8803
8814
|
}]
|
|
8804
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type:
|
|
8815
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.DecimalPipe }], propDecorators: { value: [{
|
|
8805
8816
|
type: Input,
|
|
8806
8817
|
args: ['value']
|
|
8807
8818
|
}], input: [{
|