ngx-lift 1.10.2 → 19.0.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.
- package/README.md +5 -1
- package/fesm2022/ngx-lift.mjs +738 -194
- package/fesm2022/ngx-lift.mjs.map +1 -1
- package/index.d.ts +1638 -3
- package/package.json +6 -6
- package/esm2022/lib/const.mjs +0 -10
- package/esm2022/lib/models/async-state.model.mjs +0 -2
- package/esm2022/lib/models/index.mjs +0 -6
- package/esm2022/lib/models/kubernetes-list.model.mjs +0 -2
- package/esm2022/lib/models/kubernetes-object-condition.model.mjs +0 -2
- package/esm2022/lib/models/kubernetes-object-meta.model.mjs +0 -2
- package/esm2022/lib/models/kubernetes-object.model.mjs +0 -2
- package/esm2022/lib/operators/combine-latest-eager.operator.mjs +0 -48
- package/esm2022/lib/operators/create-async-state.operator.mjs +0 -61
- package/esm2022/lib/operators/distinct-on-change.operator.mjs +0 -80
- package/esm2022/lib/operators/index.mjs +0 -9
- package/esm2022/lib/operators/kubernetes-pagination.operator.mjs +0 -71
- package/esm2022/lib/operators/logger.operator.mjs +0 -21
- package/esm2022/lib/operators/poll.operator.mjs +0 -39
- package/esm2022/lib/operators/start-with-tap.operator.mjs +0 -15
- package/esm2022/lib/operators/switch-map-with-async-state.operator.mjs +0 -33
- package/esm2022/lib/pipes/array-join.pipe.mjs +0 -21
- package/esm2022/lib/pipes/byte-converter.pipe.mjs +0 -150
- package/esm2022/lib/pipes/index.mjs +0 -6
- package/esm2022/lib/pipes/is-https.pipe.mjs +0 -18
- package/esm2022/lib/pipes/mask.pipe.mjs +0 -36
- package/esm2022/lib/pipes/range.pipe.mjs +0 -19
- package/esm2022/lib/signals/combine-from.mjs +0 -81
- package/esm2022/lib/signals/computed-async.mjs +0 -63
- package/esm2022/lib/signals/create-trigger.mjs +0 -11
- package/esm2022/lib/signals/index.mjs +0 -7
- package/esm2022/lib/signals/inject-params.mjs +0 -35
- package/esm2022/lib/signals/inject-query-params.mjs +0 -53
- package/esm2022/lib/signals/merge-from.mjs +0 -71
- package/esm2022/lib/utils/difference-in-days.util.mjs +0 -25
- package/esm2022/lib/utils/form.util.mjs +0 -56
- package/esm2022/lib/utils/idle-detection/idle-detection.config.mjs +0 -7
- package/esm2022/lib/utils/idle-detection/idle-detection.module.mjs +0 -25
- package/esm2022/lib/utils/idle-detection/idle-detection.service.mjs +0 -190
- package/esm2022/lib/utils/idle-detection/index.mjs +0 -4
- package/esm2022/lib/utils/index.mjs +0 -10
- package/esm2022/lib/utils/internal.util.mjs +0 -13
- package/esm2022/lib/utils/is-empty.util.mjs +0 -49
- package/esm2022/lib/utils/is-equal.util.mjs +0 -24
- package/esm2022/lib/utils/is-promise.util.mjs +0 -5
- package/esm2022/lib/utils/omit-by.util.mjs +0 -12
- package/esm2022/lib/utils/pick-by.util.mjs +0 -16
- package/esm2022/lib/utils/range.util.mjs +0 -28
- package/esm2022/lib/utils/url.util.mjs +0 -34
- package/esm2022/lib/validators/date-range.validator.mjs +0 -58
- package/esm2022/lib/validators/index.mjs +0 -5
- package/esm2022/lib/validators/intersection.validator.mjs +0 -34
- package/esm2022/lib/validators/unique.validator.mjs +0 -64
- package/esm2022/lib/validators/url.validator.mjs +0 -14
- package/esm2022/ngx-lift.mjs +0 -5
- package/esm2022/public-api.mjs +0 -10
- package/lib/const.d.ts +0 -5
- package/lib/models/async-state.model.d.ts +0 -22
- package/lib/models/index.d.ts +0 -5
- package/lib/models/kubernetes-list.model.d.ts +0 -10
- package/lib/models/kubernetes-object-condition.model.d.ts +0 -28
- package/lib/models/kubernetes-object-meta.model.d.ts +0 -38
- package/lib/models/kubernetes-object.model.d.ts +0 -8
- package/lib/operators/combine-latest-eager.operator.d.ts +0 -7
- package/lib/operators/create-async-state.operator.d.ts +0 -64
- package/lib/operators/distinct-on-change.operator.d.ts +0 -55
- package/lib/operators/index.d.ts +0 -8
- package/lib/operators/kubernetes-pagination.operator.d.ts +0 -30
- package/lib/operators/logger.operator.d.ts +0 -11
- package/lib/operators/poll.operator.d.ts +0 -39
- package/lib/operators/start-with-tap.operator.d.ts +0 -10
- package/lib/operators/switch-map-with-async-state.operator.d.ts +0 -31
- package/lib/pipes/array-join.pipe.d.ts +0 -7
- package/lib/pipes/byte-converter.pipe.d.ts +0 -40
- package/lib/pipes/index.d.ts +0 -5
- package/lib/pipes/is-https.pipe.d.ts +0 -7
- package/lib/pipes/mask.pipe.d.ts +0 -19
- package/lib/pipes/range.pipe.d.ts +0 -10
- package/lib/signals/combine-from.d.ts +0 -25
- package/lib/signals/computed-async.d.ts +0 -29
- package/lib/signals/create-trigger.d.ts +0 -4
- package/lib/signals/index.d.ts +0 -6
- package/lib/signals/inject-params.d.ts +0 -63
- package/lib/signals/inject-query-params.d.ts +0 -71
- package/lib/signals/merge-from.d.ts +0 -13
- package/lib/utils/difference-in-days.util.d.ts +0 -19
- package/lib/utils/form.util.d.ts +0 -18
- package/lib/utils/idle-detection/idle-detection.config.d.ts +0 -5
- package/lib/utils/idle-detection/idle-detection.module.d.ts +0 -13
- package/lib/utils/idle-detection/idle-detection.service.d.ts +0 -119
- package/lib/utils/idle-detection/index.d.ts +0 -3
- package/lib/utils/index.d.ts +0 -9
- package/lib/utils/internal.util.d.ts +0 -4
- package/lib/utils/is-empty.util.d.ts +0 -10
- package/lib/utils/is-equal.util.d.ts +0 -7
- package/lib/utils/is-promise.util.d.ts +0 -1
- package/lib/utils/omit-by.util.d.ts +0 -7
- package/lib/utils/pick-by.util.d.ts +0 -7
- package/lib/utils/range.util.d.ts +0 -12
- package/lib/utils/url.util.d.ts +0 -24
- package/lib/validators/date-range.validator.d.ts +0 -19
- package/lib/validators/index.d.ts +0 -4
- package/lib/validators/intersection.validator.d.ts +0 -9
- package/lib/validators/unique.validator.d.ts +0 -18
- package/lib/validators/url.validator.d.ts +0 -3
- package/public-api.d.ts +0 -6
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { HttpErrorResponse } from '@angular/common/http';
|
|
2
|
-
import { Observable, OperatorFunction } from 'rxjs';
|
|
3
|
-
import { AsyncState } from '../models';
|
|
4
|
-
/**
|
|
5
|
-
* Custom RxJS operator that uses switchMap to handle asynchronous operations and
|
|
6
|
-
* transforms the emitted values into an AsyncState object.
|
|
7
|
-
*
|
|
8
|
-
* @template T - The type of data emitted by the observable returned by the project.
|
|
9
|
-
* @template K - The type of value emitted by the source observable.
|
|
10
|
-
* @template E - The type of error that can be encountered during the asynchronous operation.
|
|
11
|
-
*
|
|
12
|
-
* @param {function(K): Observable<T>} project - A function that takes a value emitted by the source
|
|
13
|
-
* observable and returns an observable representing an asynchronous operation.
|
|
14
|
-
*
|
|
15
|
-
* @returns {OperatorFunction<K, AsyncState<T, E>>} - An RxJS operator that transforms the source observable into
|
|
16
|
-
* an observable of AsyncState objects.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // Usage of the switchMapWithAsyncState operator
|
|
20
|
-
* const source$ = new BehaviorSubject<number>(1);
|
|
21
|
-
*
|
|
22
|
-
* const asyncOperation = (value: number) => {
|
|
23
|
-
* return of(value * 2).pipe(delay(1000));
|
|
24
|
-
* };
|
|
25
|
-
*
|
|
26
|
-
* const result$ = source$.pipe(switchMapWithAsyncState(asyncOperation));
|
|
27
|
-
* result$.subscribe((state) => {
|
|
28
|
-
* console.log(state); // Outputs AsyncState objects with loading, data, and error properties.
|
|
29
|
-
* });
|
|
30
|
-
*/
|
|
31
|
-
export declare function switchMapWithAsyncState<T, K, E = HttpErrorResponse>(project: (value: K, index: number) => Observable<T>): OperatorFunction<K, AsyncState<T, E>>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class ArrayJoinPipe implements PipeTransform {
|
|
4
|
-
transform(value: unknown, separator?: string): unknown;
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ArrayJoinPipe, never>;
|
|
6
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<ArrayJoinPipe, "arrayJoin", true>;
|
|
7
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
/**
|
|
4
|
-
* import { LOCALE_ID, NgModule } from '@angular/core';
|
|
5
|
-
* import { BrowserModule } from '@angular/platform-browser';
|
|
6
|
-
* import { AppComponent } from './app.component';
|
|
7
|
-
* import { registerLocaleData } from '@angular/common';
|
|
8
|
-
*
|
|
9
|
-
* import localeEn from '@angular/common/locales/en';
|
|
10
|
-
* import localeFr from '@angular/common/locales/fr';
|
|
11
|
-
*
|
|
12
|
-
* // Register locales
|
|
13
|
-
* registerLocaleData(localeEn);
|
|
14
|
-
* registerLocaleData(localeFr);
|
|
15
|
-
*
|
|
16
|
-
* @NgModule({
|
|
17
|
-
* declarations: [AppComponent],
|
|
18
|
-
* imports: [BrowserModule],
|
|
19
|
-
* providers: [
|
|
20
|
-
* {
|
|
21
|
-
* provide: LOCALE_ID,
|
|
22
|
-
* useFactory: () => {
|
|
23
|
-
* // Use the browser's language or a default language
|
|
24
|
-
* return navigator.language || 'en';
|
|
25
|
-
* },
|
|
26
|
-
* },
|
|
27
|
-
* ],
|
|
28
|
-
* bootstrap: [AppComponent],
|
|
29
|
-
* })
|
|
30
|
-
* export class AppModule {}
|
|
31
|
-
*/
|
|
32
|
-
export declare class ByteConverterPipe implements PipeTransform {
|
|
33
|
-
private locale;
|
|
34
|
-
transform(value: number): string;
|
|
35
|
-
transform(value?: number): string | null;
|
|
36
|
-
transform(value?: number | null): string | null;
|
|
37
|
-
private formatNumber;
|
|
38
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ByteConverterPipe, never>;
|
|
39
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<ByteConverterPipe, "byteConverter", true>;
|
|
40
|
-
}
|
package/lib/pipes/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class IsHttpsPipe implements PipeTransform {
|
|
4
|
-
transform(value: string): boolean;
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<IsHttpsPipe, never>;
|
|
6
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<IsHttpsPipe, "isHttps", true>;
|
|
7
|
-
}
|
package/lib/pipes/mask.pipe.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export interface MaskOptions {
|
|
4
|
-
unmaskedPrefixLength?: number;
|
|
5
|
-
unmaskedSuffixLength?: number;
|
|
6
|
-
masked?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare class MaskPipe implements PipeTransform {
|
|
9
|
-
/**
|
|
10
|
-
* Transforms the input string by masking characters based on the provided options.
|
|
11
|
-
*
|
|
12
|
-
* @param {string} value - The input string to be masked.
|
|
13
|
-
* @param {MaskOptions} [options={}] - Options for customizing the masking behavior.
|
|
14
|
-
* @returns {string} - The masked string.
|
|
15
|
-
*/
|
|
16
|
-
transform(value: string, options?: MaskOptions): string;
|
|
17
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MaskPipe, never>;
|
|
18
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<MaskPipe, "mask", true>;
|
|
19
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class RangePipe implements PipeTransform {
|
|
4
|
-
transform(value: [number]): number[];
|
|
5
|
-
transform(value: [number, number]): number[];
|
|
6
|
-
transform(value: [number, number, number]): number[];
|
|
7
|
-
transform(value: [number, number, number, boolean]): number[];
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RangePipe, never>;
|
|
9
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<RangePipe, "range", true>;
|
|
10
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Injector, Signal } from '@angular/core';
|
|
2
|
-
import { ObservableInput, OperatorFunction } from 'rxjs';
|
|
3
|
-
type ObservableSignalInput<T> = ObservableInput<T> | Signal<T>;
|
|
4
|
-
type ObservableSignalInputTuple<T> = {
|
|
5
|
-
[K in keyof T]: ObservableSignalInput<T[K]> | (() => T[K]);
|
|
6
|
-
};
|
|
7
|
-
export type CombineFromOptions<IValue> = {
|
|
8
|
-
readonly injector?: Injector;
|
|
9
|
-
readonly initialValue?: IValue;
|
|
10
|
-
};
|
|
11
|
-
export declare function combineFrom<Input extends readonly unknown[], Output = Input>(sources: readonly [...ObservableSignalInputTuple<Input>]): Signal<Output>;
|
|
12
|
-
export declare function combineFrom<Input extends readonly unknown[], Output = Input>(sources: readonly [...ObservableSignalInputTuple<Input>], operator?: OperatorFunction<Input, Output>, options?: CombineFromOptions<undefined>): Signal<Output | undefined>;
|
|
13
|
-
export declare function combineFrom<Input extends readonly unknown[], Output = Input>(sources: readonly [...ObservableSignalInputTuple<Input>], operator?: OperatorFunction<Input, Output>, options?: CombineFromOptions<null>): Signal<Output | null>;
|
|
14
|
-
export declare function combineFrom<Input extends readonly unknown[], Output = Input>(sources: readonly [...ObservableSignalInputTuple<Input>], operator?: OperatorFunction<Input, Output>, options?: CombineFromOptions<Output>): Signal<Output>;
|
|
15
|
-
export declare function combineFrom<Input extends readonly unknown[], Output = Input>(sources: readonly [...ObservableSignalInputTuple<Input>], options?: CombineFromOptions<undefined>): Signal<Output | undefined>;
|
|
16
|
-
export declare function combineFrom<Input extends readonly unknown[], Output = Input>(sources: readonly [...ObservableSignalInputTuple<Input>], options?: CombineFromOptions<null>): Signal<Output | null>;
|
|
17
|
-
export declare function combineFrom<Input extends readonly unknown[], Output = Input>(sources: readonly [...ObservableSignalInputTuple<Input>], options?: CombineFromOptions<Output>): Signal<Output>;
|
|
18
|
-
export declare function combineFrom<Input extends object, Output = Input>(sources: ObservableSignalInputTuple<Input>): Signal<Output>;
|
|
19
|
-
export declare function combineFrom<Input extends object, Output = Input>(sources: ObservableSignalInputTuple<Input>, operator?: OperatorFunction<Input, Output>, options?: CombineFromOptions<undefined>): Signal<Output | undefined>;
|
|
20
|
-
export declare function combineFrom<Input extends object, Output = Input>(sources: ObservableSignalInputTuple<Input>, operator?: OperatorFunction<Input, Output>, options?: CombineFromOptions<null>): Signal<Output | null>;
|
|
21
|
-
export declare function combineFrom<Input extends object, Output = Input>(sources: ObservableSignalInputTuple<Input>, operator?: OperatorFunction<Input, Output>, options?: CombineFromOptions<Output>): Signal<Output>;
|
|
22
|
-
export declare function combineFrom<Input extends object, Output = Input>(sources: ObservableSignalInputTuple<Input>, options?: CombineFromOptions<undefined>): Signal<Output | undefined>;
|
|
23
|
-
export declare function combineFrom<Input extends object, Output = Input>(sources: ObservableSignalInputTuple<Input>, options?: CombineFromOptions<null>): Signal<Output | null>;
|
|
24
|
-
export declare function combineFrom<Input extends object, Output = Input>(sources: ObservableSignalInputTuple<Input>, options?: CombineFromOptions<Output>): Signal<Output>;
|
|
25
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { CreateComputedOptions, Signal } from '@angular/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
type ComputedAsyncBehavior = 'switch' | 'merge' | 'concat' | 'exhaust';
|
|
4
|
-
type BaseOptions<T> = CreateComputedOptions<T> & {
|
|
5
|
-
behavior?: ComputedAsyncBehavior;
|
|
6
|
-
};
|
|
7
|
-
type OptionsWithInitialValue<T> = {
|
|
8
|
-
initialValue: T;
|
|
9
|
-
} & BaseOptions<T>;
|
|
10
|
-
type OptionsWithOptionalInitialValue<T> = {
|
|
11
|
-
initialValue?: undefined;
|
|
12
|
-
} & BaseOptions<T>;
|
|
13
|
-
type OptionsWithRequireSync<T> = {
|
|
14
|
-
requireSync: true;
|
|
15
|
-
} & BaseOptions<T>;
|
|
16
|
-
export declare function computedAsync<T>(computeFn: (previousValue?: T) => Observable<T> | Promise<T> | T | undefined): Signal<T | undefined>;
|
|
17
|
-
export declare function computedAsync<T>(computeFn: (previousValue?: T) => Observable<T> | Promise<T> | T | undefined, options: OptionsWithOptionalInitialValue<T>): Signal<T | undefined>;
|
|
18
|
-
export declare function computedAsync<T>(computeFn: (previousValue?: T) => Observable<T> | Promise<T> | T | undefined, options: OptionsWithInitialValue<T>): Signal<T>;
|
|
19
|
-
export declare function computedAsync<T>(computeFn: (previousValue?: T) => Promise<T>, options: OptionsWithOptionalInitialValue<T> & {
|
|
20
|
-
requireSync: true;
|
|
21
|
-
}): never;
|
|
22
|
-
export declare function computedAsync<T>(computeFn: (previousValue?: T) => Observable<T> | T | undefined, options: {
|
|
23
|
-
initialValue?: undefined;
|
|
24
|
-
requireSync?: false;
|
|
25
|
-
} & BaseOptions<T>): Signal<T | undefined>;
|
|
26
|
-
export declare function computedAsync<T>(computeFn: (previousValue?: T) => Observable<T> | T, options: OptionsWithRequireSync<T> & {
|
|
27
|
-
initialValue?: undefined | T;
|
|
28
|
-
}): Signal<T>;
|
|
29
|
-
export {};
|
package/lib/signals/index.d.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { type Signal } from '@angular/core';
|
|
2
|
-
import { type Params } from '@angular/router';
|
|
3
|
-
type ParamsTransformFn<Output> = (params: Params) => Output;
|
|
4
|
-
/**
|
|
5
|
-
* The `InputOptions` interface defines options for configuring the behavior of the `injectParams` function.
|
|
6
|
-
*
|
|
7
|
-
* @template Output - The expected type of the read value.
|
|
8
|
-
*/
|
|
9
|
-
export interface ParamsOptions<Output> {
|
|
10
|
-
/**
|
|
11
|
-
* A transformation function to convert the written value to the expected read value.
|
|
12
|
-
*
|
|
13
|
-
* @param v - The value to transform.
|
|
14
|
-
* @returns The transformed value.
|
|
15
|
-
*/
|
|
16
|
-
transform?: (v: string) => Output;
|
|
17
|
-
/**
|
|
18
|
-
* The initial value to use if the parameter is not present or undefined.
|
|
19
|
-
*/
|
|
20
|
-
initialValue?: Output;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Injects the params from the current route.
|
|
24
|
-
* If a key is provided, returns the value of that key.
|
|
25
|
-
* If a transform function is provided, returns the result of the function.
|
|
26
|
-
* Otherwise, returns the entire params object.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* const params = injectParams(); // Returns the entire params object
|
|
30
|
-
* const userId = injectParams('id'); // Returns the value of the 'id' param
|
|
31
|
-
* const userId = injectParams(p => p['id'] as string); // Returns the 'id' param using a custom transform function
|
|
32
|
-
* const userId = injectParams('id', { transform: numberAttribute, initialValue: 1 });
|
|
33
|
-
*
|
|
34
|
-
* @param keyOrParamsTransform OPTIONAL The key of the param to return, or a transform function to apply to the params object
|
|
35
|
-
*/
|
|
36
|
-
export declare function injectParams(): Signal<Params>;
|
|
37
|
-
export declare function injectParams<Output>(fn: ParamsTransformFn<Output>): Signal<Output>;
|
|
38
|
-
export declare function injectParams(key: string): Signal<string | null>;
|
|
39
|
-
export declare function injectParams(key: string, options: {
|
|
40
|
-
transform: (v: string) => boolean;
|
|
41
|
-
initialValue: boolean;
|
|
42
|
-
}): Signal<boolean>;
|
|
43
|
-
export declare function injectParams(key: string, options: {
|
|
44
|
-
transform: (v: string) => number;
|
|
45
|
-
initialValue: number;
|
|
46
|
-
}): Signal<number>;
|
|
47
|
-
export declare function injectParams(key: string, options: {
|
|
48
|
-
transform?: (v: string) => string;
|
|
49
|
-
initialValue: string;
|
|
50
|
-
}): Signal<string>;
|
|
51
|
-
export declare function injectParams(key: string, options: {
|
|
52
|
-
transform: (v: string) => boolean;
|
|
53
|
-
initialValue?: undefined;
|
|
54
|
-
}): Signal<boolean | null>;
|
|
55
|
-
export declare function injectParams(key: string, options: {
|
|
56
|
-
transform: (v: string) => number;
|
|
57
|
-
initialValue?: undefined;
|
|
58
|
-
}): Signal<number | null>;
|
|
59
|
-
export declare function injectParams(key: string, options: {
|
|
60
|
-
transform: (v: string) => string;
|
|
61
|
-
initialValue?: undefined;
|
|
62
|
-
}): Signal<string | null>;
|
|
63
|
-
export {};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { type Signal } from '@angular/core';
|
|
2
|
-
import { type Params } from '@angular/router';
|
|
3
|
-
type QueryParamsTransformFn<Output> = (params: Params) => Output;
|
|
4
|
-
/**
|
|
5
|
-
* The `InputOptions` interface defines options for configuring the behavior of the `injectQueryParams` function.
|
|
6
|
-
*
|
|
7
|
-
* @template Output - The expected type of the read value.
|
|
8
|
-
*/
|
|
9
|
-
export interface QueryParamsOptions<Output> {
|
|
10
|
-
/**
|
|
11
|
-
* A transformation function to convert the written value to the expected read value.
|
|
12
|
-
*
|
|
13
|
-
* @param v - The value to transform.
|
|
14
|
-
* @returns The transformed value.
|
|
15
|
-
*/
|
|
16
|
-
transform?: (v: string) => Output;
|
|
17
|
-
/**
|
|
18
|
-
* The initial value to use if the query parameter is not present or undefined.
|
|
19
|
-
*/
|
|
20
|
-
initialValue?: Output;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* The `injectQueryParams` function allows you to access and manipulate query parameters from the current route.
|
|
24
|
-
*
|
|
25
|
-
* @returns A `Signal` that emits the entire query parameters object.
|
|
26
|
-
*/
|
|
27
|
-
export declare function injectQueryParams(): Signal<Params>;
|
|
28
|
-
/**
|
|
29
|
-
* The `injectQueryParams` function allows you to access and manipulate query parameters from the current route.
|
|
30
|
-
* It retrieves the value of a query parameter based on a custom transform function applied to the query parameters object.
|
|
31
|
-
*
|
|
32
|
-
* @template Output - The expected type of the read value.
|
|
33
|
-
* @param {QueryParamsTransformFn<Output>} fn - A transform function that takes the query parameters object (`params: Params`) and returns the desired value.
|
|
34
|
-
* @returns {Signal} A `Signal` that emits the transformed value based on the provided custom transform function.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* const searchValue = injectQueryParams((params) => params['search'] as string);
|
|
38
|
-
*/
|
|
39
|
-
export declare function injectQueryParams<Output>(fn: QueryParamsTransformFn<Output>): Signal<Output>;
|
|
40
|
-
/**
|
|
41
|
-
* The `injectQueryParams` function allows you to access and manipulate query parameters from the current route.
|
|
42
|
-
*
|
|
43
|
-
* @param {string} key - The name of the query parameter to retrieve.
|
|
44
|
-
* @returns {Signal} A `Signal` that emits the value of the specified query parameter, or `null` if it's not present.
|
|
45
|
-
*/
|
|
46
|
-
export declare function injectQueryParams(key: string): Signal<string | null>;
|
|
47
|
-
export declare function injectQueryParams(key: string, options: {
|
|
48
|
-
transform: (v: string) => boolean;
|
|
49
|
-
initialValue: boolean;
|
|
50
|
-
}): Signal<boolean>;
|
|
51
|
-
export declare function injectQueryParams(key: string, options: {
|
|
52
|
-
transform: (v: string) => number;
|
|
53
|
-
initialValue: number;
|
|
54
|
-
}): Signal<number>;
|
|
55
|
-
export declare function injectQueryParams(key: string, options: {
|
|
56
|
-
transform?: (v: string) => string;
|
|
57
|
-
initialValue: string;
|
|
58
|
-
}): Signal<string>;
|
|
59
|
-
export declare function injectQueryParams(key: string, options: {
|
|
60
|
-
transform: (v: string) => boolean;
|
|
61
|
-
initialValue?: undefined;
|
|
62
|
-
}): Signal<boolean | null>;
|
|
63
|
-
export declare function injectQueryParams(key: string, options: {
|
|
64
|
-
transform: (v: string) => number;
|
|
65
|
-
initialValue?: undefined;
|
|
66
|
-
}): Signal<number | null>;
|
|
67
|
-
export declare function injectQueryParams(key: string, options: {
|
|
68
|
-
transform: (v: string) => string;
|
|
69
|
-
initialValue?: undefined;
|
|
70
|
-
}): Signal<string | null>;
|
|
71
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Injector, Signal } from '@angular/core';
|
|
2
|
-
import { ObservableInput, OperatorFunction } from 'rxjs';
|
|
3
|
-
type ObservableSignalInput<T> = ObservableInput<T> | Signal<T>;
|
|
4
|
-
type ObservableSignalInputTuple<T> = {
|
|
5
|
-
[K in keyof T]: ObservableSignalInput<T[K]>;
|
|
6
|
-
};
|
|
7
|
-
export type MergeFromOptions<T> = {
|
|
8
|
-
readonly injector?: Injector;
|
|
9
|
-
readonly initialValue?: T | null;
|
|
10
|
-
};
|
|
11
|
-
export declare function mergeFrom<Input extends readonly unknown[], Output = Input[number]>(sources: readonly [...ObservableSignalInputTuple<Input>], operator?: OperatorFunction<Input[number], Output>, options?: MergeFromOptions<Output>): Signal<Output>;
|
|
12
|
-
export declare function mergeFrom<Input extends readonly unknown[], Output = Input[number]>(sources: readonly [...ObservableSignalInputTuple<Input>], options?: MergeFromOptions<Output>): Signal<Output>;
|
|
13
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calculates the difference in whole days between two dates.
|
|
3
|
-
*
|
|
4
|
-
* @param {Date | number | string} dateLeft - The date from which the difference is measured (the reference date).
|
|
5
|
-
* Can be a Date object, a number representing milliseconds since the Unix epoch,
|
|
6
|
-
* or a string in a format parseable by the Date constructor.
|
|
7
|
-
* @param {Date | number | string} dateRight - The date to be compared against the reference date.
|
|
8
|
-
* Can be a Date object, a number representing milliseconds since the Unix epoch,
|
|
9
|
-
* or a string in a format parseable by the Date constructor.
|
|
10
|
-
* @returns {number} The number of whole days between the reference date (dateLeft) and the compared date (dateRight).
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* // How many whole days are between '2022-09-08' and '2023-09-18'?
|
|
14
|
-
* const result = differenceInDays('2022-09-08', new Date('2023-09-18'));
|
|
15
|
-
*
|
|
16
|
-
* The result is 0 if the diff is within a full day
|
|
17
|
-
* const result = differenceInDays('2022-09-08T00:00:00', new Date('2023-09-08T14:00:00'));
|
|
18
|
-
*/
|
|
19
|
-
export declare function differenceInDays(dateLeft: Date | number | string, dateRight: Date | number | string): number;
|
package/lib/utils/form.util.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AbstractControl, AsyncValidatorFn, ValidatorFn } from '@angular/forms';
|
|
2
|
-
/**
|
|
3
|
-
* Provides a conditional validator that applies the specified validator functions only if the condition is met.
|
|
4
|
-
*
|
|
5
|
-
* @param condition A function that determines whether the validators should be applied.
|
|
6
|
-
* @param trueValidatorFn The validator function or an array of validator functions to be applied when the condition is true.
|
|
7
|
-
* @param falseValidatorFn Optional. The validator function or an array of validator functions to be applied when the condition is false.
|
|
8
|
-
* @returns A validator function that can be used with Angular Reactive Forms.
|
|
9
|
-
*/
|
|
10
|
-
export declare function ifValidator(condition: (control: AbstractControl) => boolean, trueValidatorFn: ValidatorFn | ValidatorFn[], falseValidatorFn?: ValidatorFn | ValidatorFn[]): ValidatorFn;
|
|
11
|
-
/**
|
|
12
|
-
* Provides a conditional async validator that applies the specified async validator function only if the condition is met.
|
|
13
|
-
*
|
|
14
|
-
* @param condition A function that determines whether the async validator should be applied.
|
|
15
|
-
* @param validatorFn The async validator function to be applied conditionally.
|
|
16
|
-
* @returns An async validator function that can be used with Angular Reactive Forms.
|
|
17
|
-
*/
|
|
18
|
-
export declare function ifAsyncValidator(condition: (control: AbstractControl) => boolean, validatorFn: AsyncValidatorFn): AsyncValidatorFn;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
import { IdleDetectionConfig } from './idle-detection.config';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
/**
|
|
5
|
-
* Idle detection module.
|
|
6
|
-
* @deprecated use provideIdleDetectionConfig(config: IdleDetectionConfig) instead
|
|
7
|
-
*/
|
|
8
|
-
export declare class IdleDetectionModule {
|
|
9
|
-
static forRoot(config: IdleDetectionConfig): ModuleWithProviders<IdleDetectionModule>;
|
|
10
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<IdleDetectionModule, never>;
|
|
11
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<IdleDetectionModule, never, never, never>;
|
|
12
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<IdleDetectionModule>;
|
|
13
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { IdleDetectionConfig } from './idle-detection.config';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
/**
|
|
4
|
-
* Service for detecting user idle time and implementing a countdown.
|
|
5
|
-
*/
|
|
6
|
-
export declare class IdleDetectionService {
|
|
7
|
-
/**
|
|
8
|
-
* The list of interruption events that will end the idle detection.
|
|
9
|
-
*/
|
|
10
|
-
private interruptionEvents;
|
|
11
|
-
private interruptionSubscription?;
|
|
12
|
-
/**
|
|
13
|
-
* The default idle duration in seconds (19 minutes).
|
|
14
|
-
*/
|
|
15
|
-
private idleDuration;
|
|
16
|
-
/**
|
|
17
|
-
* The default timeout duration in seconds (1 minute).
|
|
18
|
-
*/
|
|
19
|
-
private timeoutDuration;
|
|
20
|
-
/**
|
|
21
|
-
* Timer for idle detection.
|
|
22
|
-
*/
|
|
23
|
-
private idleTimer?;
|
|
24
|
-
/**
|
|
25
|
-
* Timer for countdown.
|
|
26
|
-
*/
|
|
27
|
-
private countdownTimer?;
|
|
28
|
-
/**
|
|
29
|
-
* Flag to indicate if countdown is in progress.
|
|
30
|
-
*/
|
|
31
|
-
private isCountingDown;
|
|
32
|
-
/**
|
|
33
|
-
* The current countdown value.
|
|
34
|
-
*/
|
|
35
|
-
private countdown;
|
|
36
|
-
/**
|
|
37
|
-
* Subject to emit when idle period ends.
|
|
38
|
-
*/
|
|
39
|
-
private idleEndSubject;
|
|
40
|
-
/**
|
|
41
|
-
* Subject to emit the countdown value.
|
|
42
|
-
*/
|
|
43
|
-
private countdownSubject;
|
|
44
|
-
/**
|
|
45
|
-
* Subject to emit when countdown ends.
|
|
46
|
-
*/
|
|
47
|
-
private countdownEndSubject;
|
|
48
|
-
/**
|
|
49
|
-
* Constructs the IdleDetectionService.
|
|
50
|
-
* @param config - Optional configuration for idle and timeout durations.
|
|
51
|
-
*/
|
|
52
|
-
constructor(config: IdleDetectionConfig);
|
|
53
|
-
/**
|
|
54
|
-
* Starts to watch for user inactivity.
|
|
55
|
-
*/
|
|
56
|
-
startWatching(): void;
|
|
57
|
-
/**
|
|
58
|
-
* Resets the idle timer when user activity is detected.
|
|
59
|
-
* @param withCountdownReset - Flag to indicate if countdown should be reset.
|
|
60
|
-
* By default, it only reset the idle-detection timer. If you enter the countdown phase, it won't stop the countdown.
|
|
61
|
-
* Pass true when you want to reset the countdown as well. This is useful when you click "Keep Me Signed In" button in cll-idle-detection component
|
|
62
|
-
*/
|
|
63
|
-
resetTimer(withCountdownReset?: boolean): void;
|
|
64
|
-
/**
|
|
65
|
-
* Sets up the interruption events that will end the idle detection.
|
|
66
|
-
* Listens to a set of events on the document (e.g. click, keydown, mousemove, etc.).
|
|
67
|
-
* When any of these events is triggered, the idle timer is reset.
|
|
68
|
-
* Uses `throttleTime` operator to only trigger the reset when the events are spaced
|
|
69
|
-
* out by at least 1000ms (1 second).
|
|
70
|
-
* @private
|
|
71
|
-
*/
|
|
72
|
-
private setupInterruptionEvents;
|
|
73
|
-
/**
|
|
74
|
-
* Starts the idle timer.
|
|
75
|
-
* When the timer expires, it emits an event through onIdleEnd() and starts the countdown.
|
|
76
|
-
*/
|
|
77
|
-
private startIdleTimer;
|
|
78
|
-
/**
|
|
79
|
-
* Starts the countdown.
|
|
80
|
-
*/
|
|
81
|
-
private startCountdown;
|
|
82
|
-
/**
|
|
83
|
-
* Stops the countdown.
|
|
84
|
-
*/
|
|
85
|
-
private stopCountdown;
|
|
86
|
-
/**
|
|
87
|
-
* Returns an observable that emits when the user has been idle for a long period.
|
|
88
|
-
* Developers can use this to perform actions like opening a dialog.
|
|
89
|
-
*
|
|
90
|
-
* user has been inactive for a long period (idleDuration), at this moment, idle detection phase ends, onIdleEnd event is emitted, and then enter countdown/timeout phase.
|
|
91
|
-
* During the countdown phase:
|
|
92
|
-
* - if user has any activity, countdown phase immediately ends and restart the idle detection phase.
|
|
93
|
-
* - else, countdownEnd event will be emitted when timeoutDuration is over.
|
|
94
|
-
* @returns {Observable<void>} - Observable for idle end event.
|
|
95
|
-
*/
|
|
96
|
-
onIdleEnd(): import("rxjs").Observable<void>;
|
|
97
|
-
/**
|
|
98
|
-
* Returns an observable that emits when the countdown ends.
|
|
99
|
-
* Usually means the user has been inactive for a very long time and should be logged out.
|
|
100
|
-
* @returns {Observable<void>} - Observable for countdown end event.
|
|
101
|
-
*/
|
|
102
|
-
onTimeoutEnd(): import("rxjs").Observable<void>;
|
|
103
|
-
/**
|
|
104
|
-
* Returns an observable that emits the countdown value every second.
|
|
105
|
-
* @returns {Observable<number>} - Observable for countdown value.
|
|
106
|
-
*/
|
|
107
|
-
onCountDown(): import("rxjs").Observable<number>;
|
|
108
|
-
/**
|
|
109
|
-
* Clears all timers when the component is destroyed.
|
|
110
|
-
*/
|
|
111
|
-
clearTimers(): void;
|
|
112
|
-
/**
|
|
113
|
-
* Sets the idle and timeout durations based on the provided configuration.
|
|
114
|
-
* @param config - Configuration object with idle and timeout durations.
|
|
115
|
-
*/
|
|
116
|
-
setConfig(config: IdleDetectionConfig): void;
|
|
117
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<IdleDetectionService, [{ optional: true; }]>;
|
|
118
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<IdleDetectionService>;
|
|
119
|
-
}
|
package/lib/utils/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './difference-in-days.util';
|
|
2
|
-
export * from './form.util';
|
|
3
|
-
export * from './idle-detection';
|
|
4
|
-
export * from './is-empty.util';
|
|
5
|
-
export * from './is-equal.util';
|
|
6
|
-
export * from './omit-by.util';
|
|
7
|
-
export * from './pick-by.util';
|
|
8
|
-
export * from './range.util';
|
|
9
|
-
export * from './url.util';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare function isEmpty(value: string): value is '';
|
|
2
|
-
/**
|
|
3
|
-
* Check if a value is null, undefined, empty ArrayLike, Map, Set or empty object.
|
|
4
|
-
* @param value The value to check.
|
|
5
|
-
* @returns Whether the value is null, undefined, empty ArrayLike, Map, Set or empty object.
|
|
6
|
-
*/
|
|
7
|
-
export declare function isEmpty<T extends object | ArrayLike<any> | Map<any, any> | Set<any>>(value: T | null | undefined): value is null | undefined;
|
|
8
|
-
export declare function isNotEmpty(value: ''): false;
|
|
9
|
-
export declare function isNotEmpty(value: string): value is Exclude<string, ''>;
|
|
10
|
-
export declare function isNotEmpty<T extends object | ArrayLike<any> | Map<any, any> | Set<any>>(value: T | null | undefined): value is T;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if two values are deeply equal.
|
|
3
|
-
* @param {T} value1 - The first value to compare.
|
|
4
|
-
* @param {T} value2 - The second value to compare.
|
|
5
|
-
* @returns {boolean} - Returns true if the values are deeply equal, otherwise false.
|
|
6
|
-
*/
|
|
7
|
-
export declare function isEqual<T>(value1: T, value2: T): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isPromise(obj: any): obj is Promise<any>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create an object composed of object properties that do not satisfy a given condition.
|
|
3
|
-
* @param {T} source - The object to omit properties from.
|
|
4
|
-
* @param {(value: T[keyof T], key: string) => boolean} predicate - The function invoked per property.
|
|
5
|
-
* @returns {Partial<T>} - Returns the new object.
|
|
6
|
-
*/
|
|
7
|
-
export declare function omitBy<T>(source: T, predicate: (value: T[keyof T], key: string) => boolean): Partial<T>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create an object composed of object properties that satisfy a given condition.
|
|
3
|
-
* @param {T} source - The object to pick properties from.
|
|
4
|
-
* @param {(value: T[keyof T], key: string) => boolean} predicate - The function invoked per property.
|
|
5
|
-
* @returns {Partial<T>} - Returns the new object.
|
|
6
|
-
*/
|
|
7
|
-
export declare function pickBy<T>(source: T, predicate: (value: T[keyof T], key: string) => boolean): Partial<T>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end.
|
|
3
|
-
* A step of -1 is used if a negative start is specified without an end or step.
|
|
4
|
-
* If end is not specified, it's set to start with start then set to 0.
|
|
5
|
-
*
|
|
6
|
-
* @param {number} start The start of the range.
|
|
7
|
-
* @param {number} end The end of the range.
|
|
8
|
-
* @param {number} step The value to increment or decrement by.
|
|
9
|
-
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
10
|
-
* @returns {Array} Returns the range of numbers.
|
|
11
|
-
*/
|
|
12
|
-
export declare function range(start: number, end?: number | undefined, step?: number | undefined, fromRight?: boolean): any[];
|
package/lib/utils/url.util.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if hostname is IP
|
|
3
|
-
* @param hostname new URL(your-url).hostname
|
|
4
|
-
* @returns true if hostname is a IP
|
|
5
|
-
*/
|
|
6
|
-
export declare function isIP(hostname: string): boolean;
|
|
7
|
-
/**
|
|
8
|
-
* Check if hostname is FQDN
|
|
9
|
-
* @param hostname new URL(your-url).hostname
|
|
10
|
-
* @returns true if hostname is a FQDN
|
|
11
|
-
*/
|
|
12
|
-
export declare function isFQDN(hostname: string): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Check if url is valid
|
|
15
|
-
* @param url
|
|
16
|
-
* @returns true if valid
|
|
17
|
-
*/
|
|
18
|
-
export declare function isURL(url: string): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Check if a url starts with https, the url must be a valid url.
|
|
21
|
-
* @param url
|
|
22
|
-
* @returns true if it's a https valid url
|
|
23
|
-
*/
|
|
24
|
-
export declare function isHttps(url: string): boolean;
|