ngx-lift 1.10.1 → 1.10.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,7 @@
1
- import { startWith, Subject, combineLatest, pipe, tap, map, catchError, of, Observable, expand, EMPTY, reduce, timer, isObservable, merge, exhaustMap, from, share, switchMap, fromEvent, throttleTime, identity, distinctUntilChanged, switchAll, mergeAll, concatAll, exhaustAll } from 'rxjs';
1
+ import { startWith, Subject, combineLatest, pipe, tap, map, catchError, of, Observable, expand, EMPTY, reduce, timer, isObservable, merge, exhaustMap, from, share, switchMap, fromEvent, throttleTime, identity, distinctUntilChanged, exhaustAll, concatAll, mergeAll, switchAll } from 'rxjs';
2
2
  import { toObservable, toSignal } from '@angular/core/rxjs-interop';
3
3
  import * as i0 from '@angular/core';
4
- import { Pipe, inject, LOCALE_ID, makeEnvironmentProviders, NgModule, Injectable, Optional, assertInInjectionContext, isSignal, untracked, computed, DestroyRef, signal, effect } from '@angular/core';
4
+ import { Pipe, inject, LOCALE_ID, makeEnvironmentProviders, NgModule, Optional, Injectable, assertInInjectionContext, isSignal, untracked, computed, DestroyRef, signal, effect } from '@angular/core';
5
5
  import { Validators, FormArray } from '@angular/forms';
6
6
  import { ActivatedRoute } from '@angular/router';
7
7
 
@@ -376,10 +376,10 @@ class ArrayJoinPipe {
376
376
  // For non-array cases or unexpected types, return the value as is
377
377
  return value;
378
378
  }
379
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ArrayJoinPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
380
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: ArrayJoinPipe, isStandalone: true, name: "arrayJoin" }); }
379
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArrayJoinPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
380
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ArrayJoinPipe, isStandalone: true, name: "arrayJoin" }); }
381
381
  }
382
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ArrayJoinPipe, decorators: [{
382
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArrayJoinPipe, decorators: [{
383
383
  type: Pipe,
384
384
  args: [{
385
385
  name: 'arrayJoin',
@@ -437,10 +437,10 @@ class ByteConverterPipe {
437
437
  formatNumber(value) {
438
438
  return new Intl.NumberFormat(this.locale, { maximumFractionDigits: 2 }).format(value);
439
439
  }
440
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ByteConverterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
441
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: ByteConverterPipe, isStandalone: true, name: "byteConverter" }); }
440
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ByteConverterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
441
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ByteConverterPipe, isStandalone: true, name: "byteConverter" }); }
442
442
  }
443
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ByteConverterPipe, decorators: [{
443
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ByteConverterPipe, decorators: [{
444
444
  type: Pipe,
445
445
  args: [{
446
446
  name: 'byteConverter',
@@ -631,11 +631,11 @@ class IdleDetectionModule {
631
631
  providers: [provideIdleDetectionConfig(config)],
632
632
  };
633
633
  }
634
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: IdleDetectionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
635
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: IdleDetectionModule }); }
636
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: IdleDetectionModule }); }
634
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IdleDetectionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
635
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: IdleDetectionModule }); }
636
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IdleDetectionModule }); }
637
637
  }
638
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: IdleDetectionModule, decorators: [{
638
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IdleDetectionModule, decorators: [{
639
639
  type: NgModule,
640
640
  args: [{
641
641
  imports: [],
@@ -816,10 +816,10 @@ class IdleDetectionService {
816
816
  this.countdown = this.timeoutDuration = config.timeoutDurationInSeconds;
817
817
  }
818
818
  }
819
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: IdleDetectionService, deps: [{ token: IdleDetectionConfig, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
820
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: IdleDetectionService, providedIn: 'root' }); }
819
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IdleDetectionService, deps: [{ token: IdleDetectionConfig, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
820
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IdleDetectionService, providedIn: 'root' }); }
821
821
  }
822
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: IdleDetectionService, decorators: [{
822
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IdleDetectionService, decorators: [{
823
823
  type: Injectable,
824
824
  args: [{
825
825
  providedIn: 'root',
@@ -828,21 +828,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
828
828
  type: Optional
829
829
  }] }] });
830
830
 
831
+ /* eslint-disable @typescript-eslint/no-explicit-any */
832
+ function isArrayLike(value) {
833
+ return (value != null &&
834
+ typeof value !== 'function' &&
835
+ typeof value.length === 'number' &&
836
+ value.length >= 0 &&
837
+ value.length <= Number.MAX_SAFE_INTEGER);
838
+ }
839
+ function isPrototype(value) {
840
+ const Ctor = value?.constructor;
841
+ return Ctor && Ctor.prototype === value;
842
+ }
843
+
844
+ /* eslint-disable @typescript-eslint/no-explicit-any */
831
845
  /**
832
- * Check if a value is empty.
833
- * @param {T | undefined | null} value - The value to check for emptiness.
834
- * @returns {boolean} - Returns true if the value is empty, otherwise false.
846
+ * Checks if a value is empty.
847
+ *
848
+ * @param {any} value - The value to check for emptiness. It can be of any type.
849
+ * @return {boolean} `true` if the value is empty, `false` otherwise.
835
850
  */
836
851
  function isEmpty(value) {
837
- if (value == null)
852
+ if (value === null || value === undefined) {
853
+ // Handles null and undefined
838
854
  return true;
839
- if (typeof value === 'string' || Array.isArray(value)) {
855
+ }
856
+ // Handle array-like objects (arrays, strings, jQuery-like collections)
857
+ if ((Array.isArray(value) || typeof value === 'string' || typeof value.splice === 'function') &&
858
+ isArrayLike(value)) {
840
859
  return value.length === 0;
841
860
  }
861
+ // Handle Maps and Sets
862
+ if (value instanceof Map || value instanceof Set) {
863
+ return value.size === 0;
864
+ }
865
+ // Handle objects
842
866
  if (typeof value === 'object') {
843
- return Object.keys(value).length === 0;
867
+ // Check for prototype objects and non-enumerable properties
868
+ if (isPrototype(value)) {
869
+ return Object.getOwnPropertyNames(value).length === 0;
870
+ }
871
+ // Check for enumerable properties
872
+ for (const key in value) {
873
+ if (Object.prototype.hasOwnProperty.call(value, key)) {
874
+ return false;
875
+ }
876
+ }
877
+ return true;
844
878
  }
845
- return false;
879
+ // All other types (numbers, booleans, functions, etc.)
880
+ return true;
881
+ }
882
+ /**
883
+ * Checks if a value is not null, undefined, empty ArrayLike, Map, Set, or empty object.
884
+ *
885
+ * @param {any} value - The value to check.
886
+ * @return {boolean} Whether the value is not null, undefined, empty ArrayLike, Map, Set, or empty object.
887
+ */
888
+ function isNotEmpty(value) {
889
+ return !isEmpty(value);
846
890
  }
847
891
 
848
892
  /**
@@ -971,10 +1015,10 @@ class IsHttpsPipe {
971
1015
  transform(value) {
972
1016
  return isHttps(value);
973
1017
  }
974
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: IsHttpsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
975
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: IsHttpsPipe, isStandalone: true, name: "isHttps" }); }
1018
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IsHttpsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1019
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: IsHttpsPipe, isStandalone: true, name: "isHttps" }); }
976
1020
  }
977
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: IsHttpsPipe, decorators: [{
1021
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IsHttpsPipe, decorators: [{
978
1022
  type: Pipe,
979
1023
  args: [{
980
1024
  name: 'isHttps',
@@ -1005,10 +1049,10 @@ class MaskPipe {
1005
1049
  .map((char, i) => (i < unmaskedPrefixLength || i > value.length - unmaskedSuffixLength - 1 ? char : maskChar))
1006
1050
  .join('');
1007
1051
  }
1008
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MaskPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1009
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: MaskPipe, isStandalone: true, name: "mask" }); }
1052
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MaskPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1053
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: MaskPipe, isStandalone: true, name: "mask" }); }
1010
1054
  }
1011
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MaskPipe, decorators: [{
1055
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MaskPipe, decorators: [{
1012
1056
  type: Pipe,
1013
1057
  args: [{
1014
1058
  name: 'mask',
@@ -1021,10 +1065,10 @@ class RangePipe {
1021
1065
  const input = value;
1022
1066
  return range(...input);
1023
1067
  }
1024
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RangePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1025
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: RangePipe, isStandalone: true, name: "range" }); }
1068
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RangePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1069
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: RangePipe, isStandalone: true, name: "range" }); }
1026
1070
  }
1027
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RangePipe, decorators: [{
1071
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RangePipe, decorators: [{
1028
1072
  type: Pipe,
1029
1073
  args: [{
1030
1074
  name: 'range',
@@ -1089,9 +1133,18 @@ function normalizeArgs(args) {
1089
1133
  const hasInitValue = options?.initialValue !== undefined;
1090
1134
  const normalizedSources = Object.entries(sources).reduce((acc, [keyOrIndex, source]) => {
1091
1135
  if (isSignal(source)) {
1092
- acc[keyOrIndex] = toObservable(source, { injector: options?.injector }).pipe(
1136
+ // fix angular NG0950: Input is required but no value is available yet.
1137
+ // when input.required is used as combineFrom's input, its value is undefined, untracked(source) will throw error
1138
+ let initialValue;
1139
+ try {
1140
+ initialValue = untracked(source);
1141
+ }
1142
+ catch (e) {
1143
+ // If the input is not set, skip startWith or provide a fallback
1144
+ initialValue = undefined;
1145
+ }
1093
1146
  // toObservable doesn't immediately emit initialValue of the signal
1094
- startWith(untracked(source)));
1147
+ acc[keyOrIndex] = toObservable(source, { injector: options?.injector }).pipe(startWith(initialValue));
1095
1148
  }
1096
1149
  else if (isObservable(source)) {
1097
1150
  acc[keyOrIndex] = source.pipe(distinctUntilChanged());
@@ -1504,5 +1557,5 @@ function httpsValidator(control) {
1504
1557
  * Generated bundle index. Do not edit.
1505
1558
  */
1506
1559
 
1507
- export { ArrayJoinPipe, ByteConverterPipe, IdleDetectionConfig, IdleDetectionModule, IdleDetectionService, IsHttpsPipe, MaskPipe, RangePipe, UniqueValidator, aggregatePaginatedKubernetesResources, combineFrom, combineLatestEager, computedAsync, createAsyncState, createTrigger, dateRangeValidator, differenceInDays, distinctOnChange, fetchPaginatedKubernetesResources, httpsValidator, ifAsyncValidator, ifValidator, injectParams, injectQueryParams, intersectionValidator, isEmpty, isEqual, isFQDN, isHttps, isIP, isURL, logger, mergeFrom, omitBy, pickBy, poll, provideIdleDetectionConfig, range, startWithTap, switchMapWithAsyncState, urlValidator };
1560
+ export { ArrayJoinPipe, ByteConverterPipe, IdleDetectionConfig, IdleDetectionModule, IdleDetectionService, IsHttpsPipe, MaskPipe, RangePipe, UniqueValidator, aggregatePaginatedKubernetesResources, combineFrom, combineLatestEager, computedAsync, createAsyncState, createTrigger, dateRangeValidator, differenceInDays, distinctOnChange, fetchPaginatedKubernetesResources, httpsValidator, ifAsyncValidator, ifValidator, injectParams, injectQueryParams, intersectionValidator, isEmpty, isEqual, isFQDN, isHttps, isIP, isNotEmpty, isURL, logger, mergeFrom, omitBy, pickBy, poll, provideIdleDetectionConfig, range, startWithTap, switchMapWithAsyncState, urlValidator };
1508
1561
  //# sourceMappingURL=ngx-lift.mjs.map