ets-fe-ng-sdk 20.0.11 → 20.0.13
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 +33 -15
- 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
|
|
@@ -3672,7 +3684,14 @@ class UtilityService {
|
|
|
3672
3684
|
if (!minutes)
|
|
3673
3685
|
return null;
|
|
3674
3686
|
const ret = this.minutesToDayHourMin(minutes);
|
|
3675
|
-
return
|
|
3687
|
+
return [
|
|
3688
|
+
[ret.days, `day`],
|
|
3689
|
+
[ret.hours, 'hour'],
|
|
3690
|
+
[ret.mins, 'mins'],
|
|
3691
|
+
]
|
|
3692
|
+
.filter(([val], i) => !!val || i == 2)
|
|
3693
|
+
.map(([val, unit]) => `${val}${unit}${val == 1 ? '' : 's'}`)
|
|
3694
|
+
.join(' ');
|
|
3676
3695
|
};
|
|
3677
3696
|
/**
|
|
3678
3697
|
* Converts days, hours, and minutes to a string in the format "HH:MM".
|
|
@@ -8434,9 +8453,8 @@ class InputFormatDirective {
|
|
|
8434
8453
|
get shouldFormat() {
|
|
8435
8454
|
return this.acceptedType.includes(this.oType);
|
|
8436
8455
|
}
|
|
8437
|
-
constructor(elementRef,
|
|
8456
|
+
constructor(elementRef, decimalPipe) {
|
|
8438
8457
|
this.elementRef = elementRef;
|
|
8439
|
-
this.formatterService = formatterService;
|
|
8440
8458
|
this.decimalPipe = decimalPipe;
|
|
8441
8459
|
/** List of input types that can be formatted */
|
|
8442
8460
|
this.acceptedType = ['text', 'number', 'percentage'];
|
|
@@ -8521,7 +8539,7 @@ class InputFormatDirective {
|
|
|
8521
8539
|
else if (this.oType == 'percentage')
|
|
8522
8540
|
this.setPercentageInput(value);
|
|
8523
8541
|
else if (this.oType == 'text' && !this.noTextFormat) {
|
|
8524
|
-
this._value = this.
|
|
8542
|
+
this._value = this.inputFormatService.toTitleCase(value);
|
|
8525
8543
|
this.setTextInput(value);
|
|
8526
8544
|
}
|
|
8527
8545
|
else if (this.oType == 'checkbox') {
|
|
@@ -8545,7 +8563,7 @@ class InputFormatDirective {
|
|
|
8545
8563
|
nValue = value;
|
|
8546
8564
|
}
|
|
8547
8565
|
else if (this.oType == 'text' && !this.noTextFormat) {
|
|
8548
|
-
nValue = this.
|
|
8566
|
+
nValue = this.inputFormatService.toTitleCase(value);
|
|
8549
8567
|
}
|
|
8550
8568
|
else if (this.oType == 'checkbox') {
|
|
8551
8569
|
nValue = this.el?.checked;
|
|
@@ -8555,11 +8573,11 @@ class InputFormatDirective {
|
|
|
8555
8573
|
nValue = value;
|
|
8556
8574
|
}
|
|
8557
8575
|
else {
|
|
8558
|
-
nValue = this.
|
|
8576
|
+
nValue = this.inputFormatService.normalise(value);
|
|
8559
8577
|
}
|
|
8560
8578
|
}
|
|
8561
8579
|
else if (this.oType == 'percentage') {
|
|
8562
|
-
nValue = this.
|
|
8580
|
+
nValue = this.inputFormatService.normalise(String(value)?.replace('%', ''));
|
|
8563
8581
|
}
|
|
8564
8582
|
else {
|
|
8565
8583
|
nValue = value;
|
|
@@ -8582,7 +8600,7 @@ class InputFormatDirective {
|
|
|
8582
8600
|
this.setPercentageInput(this.value);
|
|
8583
8601
|
}
|
|
8584
8602
|
else if (this.oType == 'text' && !this.noTextFormat)
|
|
8585
|
-
this.el.value = this.
|
|
8603
|
+
this.el.value = this.inputFormatService.toTitleCase(this.value);
|
|
8586
8604
|
}, 0);
|
|
8587
8605
|
}
|
|
8588
8606
|
/**
|
|
@@ -8617,7 +8635,7 @@ class InputFormatDirective {
|
|
|
8617
8635
|
if (this.el.disabled)
|
|
8618
8636
|
this.setInput(value);
|
|
8619
8637
|
else {
|
|
8620
|
-
this._value = this.
|
|
8638
|
+
this._value = this.inputFormatService.toTitleCase(value);
|
|
8621
8639
|
this.setTextInput(value);
|
|
8622
8640
|
}
|
|
8623
8641
|
}
|
|
@@ -8701,7 +8719,7 @@ class InputFormatDirective {
|
|
|
8701
8719
|
this.elementRef.nativeElement.value = '';
|
|
8702
8720
|
return;
|
|
8703
8721
|
}
|
|
8704
|
-
this.elementRef.nativeElement.value = this.
|
|
8722
|
+
this.elementRef.nativeElement.value = this.inputFormatService.toTitleCase(value);
|
|
8705
8723
|
}
|
|
8706
8724
|
/**
|
|
8707
8725
|
* Set a value on the input element without special formatting
|
|
@@ -8736,7 +8754,7 @@ class InputFormatDirective {
|
|
|
8736
8754
|
if (this.isLastCharacterDecimalSeparator(value)) {
|
|
8737
8755
|
return;
|
|
8738
8756
|
}
|
|
8739
|
-
this._value = this.
|
|
8757
|
+
this._value = this.inputFormatService.normalise(value);
|
|
8740
8758
|
if (value) {
|
|
8741
8759
|
this.elementRef.nativeElement.value = this.inputFormatService.normaliseForInput(this.value);
|
|
8742
8760
|
}
|
|
@@ -8753,7 +8771,7 @@ class InputFormatDirective {
|
|
|
8753
8771
|
if (this.isLastCharacterDecimalSeparator(value)) {
|
|
8754
8772
|
return;
|
|
8755
8773
|
}
|
|
8756
|
-
this._value = this.
|
|
8774
|
+
this._value = this.inputFormatService.normalise(value.replace('%', ''));
|
|
8757
8775
|
if (value) {
|
|
8758
8776
|
this.elementRef.nativeElement.value = this.inputFormatService.normaliseForInput(this.value);
|
|
8759
8777
|
}
|
|
@@ -8771,7 +8789,7 @@ class InputFormatDirective {
|
|
|
8771
8789
|
// debugger
|
|
8772
8790
|
// this._onBlur()
|
|
8773
8791
|
}
|
|
8774
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: InputFormatDirective, deps: [{ token: i0.ElementRef }, { token:
|
|
8792
|
+
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
8793
|
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
8794
|
{
|
|
8777
8795
|
provide: MAT_INPUT_VALUE_ACCESSOR,
|
|
@@ -8801,7 +8819,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
8801
8819
|
],
|
|
8802
8820
|
standalone: true,
|
|
8803
8821
|
}]
|
|
8804
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type:
|
|
8822
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.DecimalPipe }], propDecorators: { value: [{
|
|
8805
8823
|
type: Input,
|
|
8806
8824
|
args: ['value']
|
|
8807
8825
|
}], input: [{
|