@acorex/core 19.15.0-next.9 → 20.0.1
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/components/index.d.ts +23 -2
- package/config/index.d.ts +18 -2
- package/constants/index.d.ts +19 -2
- package/date-time/index.d.ts +341 -11
- package/events/index.d.ts +21 -1
- package/fesm2022/acorex-core-components.mjs +3 -3
- package/fesm2022/acorex-core-components.mjs.map +1 -1
- package/fesm2022/acorex-core-config.mjs +7 -10
- package/fesm2022/acorex-core-config.mjs.map +1 -1
- package/fesm2022/acorex-core-constants.mjs.map +1 -1
- package/fesm2022/acorex-core-date-time.mjs +27 -27
- package/fesm2022/acorex-core-date-time.mjs.map +1 -1
- package/fesm2022/acorex-core-events.mjs +3 -3
- package/fesm2022/acorex-core-events.mjs.map +1 -1
- package/fesm2022/acorex-core-file.mjs +11 -12
- package/fesm2022/acorex-core-file.mjs.map +1 -1
- package/fesm2022/acorex-core-format.mjs +34 -36
- package/fesm2022/acorex-core-format.mjs.map +1 -1
- package/fesm2022/acorex-core-icon.mjs +51 -0
- package/fesm2022/acorex-core-icon.mjs.map +1 -0
- package/fesm2022/acorex-core-image.mjs +4 -5
- package/fesm2022/acorex-core-image.mjs.map +1 -1
- package/fesm2022/acorex-core-locale-en-AU.profile-DNjKIaZS.mjs.map +1 -1
- package/fesm2022/acorex-core-locale.mjs +10 -10
- package/fesm2022/acorex-core-locale.mjs.map +1 -1
- package/fesm2022/acorex-core-memoize.mjs.map +1 -1
- package/fesm2022/acorex-core-network.mjs +3 -3
- package/fesm2022/acorex-core-network.mjs.map +1 -1
- package/fesm2022/acorex-core-pipes.mjs +8 -8
- package/fesm2022/acorex-core-pipes.mjs.map +1 -1
- package/fesm2022/acorex-core-platform.mjs +24 -8
- package/fesm2022/acorex-core-platform.mjs.map +1 -1
- package/fesm2022/acorex-core-storage.mjs +14 -17
- package/fesm2022/acorex-core-storage.mjs.map +1 -1
- package/fesm2022/acorex-core-translation.mjs +22 -22
- package/fesm2022/acorex-core-translation.mjs.map +1 -1
- package/fesm2022/acorex-core-utils.mjs +3 -3
- package/fesm2022/acorex-core-utils.mjs.map +1 -1
- package/fesm2022/acorex-core-validation.mjs +55 -57
- package/fesm2022/acorex-core-validation.mjs.map +1 -1
- package/fesm2022/acorex-core.mjs.map +1 -1
- package/file/index.d.ts +42 -3
- package/format/index.d.ts +122 -8
- package/icon/README.md +3 -0
- package/icon/index.d.ts +20 -0
- package/image/index.d.ts +16 -1
- package/index.d.ts +3 -1
- package/locale/index.d.ts +135 -8
- package/memoize/index.d.ts +3 -1
- package/network/index.d.ts +69 -4
- package/package.json +22 -18
- package/pipes/index.d.ts +12 -1
- package/platform/index.d.ts +82 -1
- package/storage/index.d.ts +145 -4
- package/translation/index.d.ts +109 -8
- package/utils/index.d.ts +118 -6
- package/validation/index.d.ts +249 -14
- package/components/lib/component.service.d.ts +0 -11
- package/components/lib/component.types.d.ts +0 -9
- package/config/lib/configs.d.ts +0 -6
- package/config/lib/configs.service.d.ts +0 -12
- package/constants/countries/countries.data.d.ts +0 -3
- package/constants/countries/country.d.ts +0 -13
- package/date-time/lib/calendar.service.d.ts +0 -34
- package/date-time/lib/dateTime.config.d.ts +0 -12
- package/date-time/lib/datetime.module.d.ts +0 -8
- package/date-time/lib/datetime.pipe.d.ts +0 -13
- package/date-time/lib/datetime.types.d.ts +0 -138
- package/date-time/lib/formatters/date.formatter.d.ts +0 -12
- package/date-time/lib/formatters/datetime.formatter.d.ts +0 -21
- package/date-time/lib/formatters/time-duration.formatter.d.ts +0 -21
- package/date-time/lib/formatters/time.formatter.d.ts +0 -12
- package/date-time/lib/formatters/timeleft.formatter.d.ts +0 -16
- package/date-time/lib/gregorian.calendar.d.ts +0 -21
- package/date-time/lib/holidays.loader.d.ts +0 -21
- package/date-time/lib/solar-hijri.calendar.d.ts +0 -40
- package/events/lib/event.service.d.ts +0 -17
- package/file/lib/file-size-formatter.d.ts +0 -16
- package/file/lib/file.module.d.ts +0 -7
- package/file/lib/file.service.d.ts +0 -15
- package/format/lib/format.config.d.ts +0 -5
- package/format/lib/format.directive.d.ts +0 -12
- package/format/lib/format.module.d.ts +0 -19
- package/format/lib/format.pipe.d.ts +0 -12
- package/format/lib/format.service.d.ts +0 -44
- package/format/lib/format.types.d.ts +0 -4
- package/format/lib/formatters/number.formatter.d.ts +0 -23
- package/format/lib/formatters/string.formatter.d.ts +0 -14
- package/image/lib/image.service.d.ts +0 -13
- package/locale/lib/formatters/currency.formatter.d.ts +0 -10
- package/locale/lib/locale-profile-provider.service.d.ts +0 -24
- package/locale/lib/locale.config.d.ts +0 -5
- package/locale/lib/locale.module.d.ts +0 -7
- package/locale/lib/locale.service.d.ts +0 -20
- package/locale/lib/locale.types.d.ts +0 -61
- package/locale/lib/profiles/en-AU.profile.d.ts +0 -2
- package/locale/lib/profiles/en-US.profile.d.ts +0 -2
- package/locale/lib/profiles/fa-IR.profile.d.ts +0 -2
- package/memoize/lib/memoize.decorator.d.ts +0 -1
- package/network/lib/download-task.d.ts +0 -11
- package/network/lib/network.service.d.ts +0 -16
- package/network/lib/network.types.d.ts +0 -28
- package/network/lib/upload-task.d.ts +0 -14
- package/pipes/lib/safe/safe.pipe.d.ts +0 -10
- package/platform/lib/platform.service.d.ts +0 -77
- package/storage/cookie-storage.service.d.ts +0 -104
- package/storage/local-storage.service.d.ts +0 -16
- package/storage/session-storage.service.d.ts +0 -10
- package/storage/storage.interface.d.ts +0 -14
- package/translation/lib/translation-loader.service.d.ts +0 -20
- package/translation/lib/translation-scope.resolver.d.ts +0 -2
- package/translation/lib/translation.config.d.ts +0 -27
- package/translation/lib/translation.loader.d.ts +0 -14
- package/translation/lib/translation.module.d.ts +0 -8
- package/translation/lib/translation.parser.d.ts +0 -7
- package/translation/lib/translation.resolver.d.ts +0 -9
- package/translation/lib/translation.service.d.ts +0 -25
- package/translation/lib/translation.types.d.ts +0 -16
- package/translation/lib/translator.directive.d.ts +0 -12
- package/translation/lib/translator.pipe.d.ts +0 -10
- package/utils/lib/color.utils.d.ts +0 -26
- package/utils/lib/drawing.utils.d.ts +0 -18
- package/utils/lib/execution.utils.d.ts +0 -33
- package/utils/lib/html-utils.d.ts +0 -15
- package/utils/lib/lifecycle-helpers.utils.d.ts +0 -12
- package/utils/lib/string.utils.d.ts +0 -4
- package/validation/lib/rules/between-rule.d.ts +0 -18
- package/validation/lib/rules/callback-rule.d.ts +0 -24
- package/validation/lib/rules/equal-rule.d.ts +0 -17
- package/validation/lib/rules/greater-than.d.ts +0 -17
- package/validation/lib/rules/length-rule.d.ts +0 -17
- package/validation/lib/rules/less-than-rule.d.ts +0 -17
- package/validation/lib/rules/maxlength-rule.d.ts +0 -16
- package/validation/lib/rules/minlength-rule.d.ts +0 -16
- package/validation/lib/rules/regex-rule.d.ts +0 -17
- package/validation/lib/rules/required-rule.d.ts +0 -16
- package/validation/lib/validation.config.d.ts +0 -15
- package/validation/lib/validation.module.d.ts +0 -17
- package/validation/lib/validation.service.d.ts +0 -35
- package/validation/lib/validation.types.d.ts +0 -21
package/storage/index.d.ts
CHANGED
@@ -1,4 +1,145 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { InjectionToken } from '@angular/core';
|
3
|
+
|
4
|
+
interface AXStorage {
|
5
|
+
get<T = unknown>(key: string): T;
|
6
|
+
set<T = unknown>(key: string, value: T): void;
|
7
|
+
removeItem(key: string): any;
|
8
|
+
clear(): void;
|
9
|
+
}
|
10
|
+
type AXSameSite = 'Lax' | 'None' | 'Strict';
|
11
|
+
interface AXCookieOptions {
|
12
|
+
expires?: number | Date;
|
13
|
+
path?: string;
|
14
|
+
domain?: string;
|
15
|
+
secure?: boolean;
|
16
|
+
sameSite?: AXSameSite;
|
17
|
+
}
|
18
|
+
|
19
|
+
declare class AXCookieStorageService {
|
20
|
+
private readonly documentIsAccessible;
|
21
|
+
private document;
|
22
|
+
private platformId;
|
23
|
+
constructor();
|
24
|
+
/**
|
25
|
+
* Get cookie Regular Expression
|
26
|
+
*
|
27
|
+
* @param name Cookie name
|
28
|
+
* @returns property RegExp
|
29
|
+
*
|
30
|
+
*/
|
31
|
+
private static getCookieRegExp;
|
32
|
+
/**
|
33
|
+
* Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).
|
34
|
+
*
|
35
|
+
* @param encodedURIComponent A value representing an encoded URI component.
|
36
|
+
*
|
37
|
+
* @returns The unencoded version of an encoded component of a Uniform Resource Identifier (URI).
|
38
|
+
*
|
39
|
+
*/
|
40
|
+
private static safeDecodeURIComponent;
|
41
|
+
/**
|
42
|
+
* Return `true` if {@link Document} is accessible, otherwise return `false`
|
43
|
+
*
|
44
|
+
* @param name Cookie name
|
45
|
+
* @returns boolean - whether cookie with specified name exists
|
46
|
+
*
|
47
|
+
*/
|
48
|
+
check(name: string): boolean;
|
49
|
+
/**
|
50
|
+
* Get cookies by name
|
51
|
+
*
|
52
|
+
* @param name Cookie name
|
53
|
+
* @returns property value
|
54
|
+
*
|
55
|
+
*/
|
56
|
+
get(name: string): string;
|
57
|
+
/**
|
58
|
+
* Get all cookies in JSON format
|
59
|
+
*
|
60
|
+
* @returns all the cookies in json
|
61
|
+
*
|
62
|
+
*/
|
63
|
+
getAll(): {
|
64
|
+
[key: string]: string;
|
65
|
+
};
|
66
|
+
/**
|
67
|
+
* Set cookie based on provided information
|
68
|
+
*
|
69
|
+
* @param name Cookie name
|
70
|
+
* @param value Cookie value
|
71
|
+
* @param expires Number of days until the cookies expires or an actual `Date`
|
72
|
+
* @param path Cookie path
|
73
|
+
* @param domain Cookie domain
|
74
|
+
* @param secure Secure flag
|
75
|
+
* @param sameSite OWASP samesite token `Lax`, `None`, or `Strict`. Defaults to `Lax`
|
76
|
+
*
|
77
|
+
*/
|
78
|
+
set(name: string, value: string, expires?: AXCookieOptions['expires'], path?: AXCookieOptions['path'], domain?: AXCookieOptions['domain'], secure?: AXCookieOptions['secure'], sameSite?: AXSameSite): void;
|
79
|
+
/**
|
80
|
+
* Set cookie based on provided information
|
81
|
+
*
|
82
|
+
* Cookie's parameters:
|
83
|
+
* <pre>
|
84
|
+
* expires Number of days until the cookies expires or an actual `Date`
|
85
|
+
* path Cookie path
|
86
|
+
* domain Cookie domain
|
87
|
+
* secure Secure flag
|
88
|
+
* sameSite OWASP samesite token `Lax`, `None`, or `Strict`. Defaults to `Lax`
|
89
|
+
* </pre>
|
90
|
+
*
|
91
|
+
* @param name Cookie name
|
92
|
+
* @param value Cookie value
|
93
|
+
* @param options Body with cookie's params
|
94
|
+
*
|
95
|
+
*/
|
96
|
+
set(name: string, value: string, options?: AXCookieOptions): void;
|
97
|
+
/**
|
98
|
+
* Delete cookie by name
|
99
|
+
*
|
100
|
+
* @param name Cookie name
|
101
|
+
* @param path Cookie path
|
102
|
+
* @param domain Cookie domain
|
103
|
+
* @param secure Cookie secure flag
|
104
|
+
* @param sameSite Cookie sameSite flag - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite
|
105
|
+
*
|
106
|
+
*/
|
107
|
+
delete(name: string, path?: AXCookieOptions['path'], domain?: AXCookieOptions['domain'], secure?: AXCookieOptions['secure'], sameSite?: AXSameSite): void;
|
108
|
+
/**
|
109
|
+
* Delete all cookies
|
110
|
+
*
|
111
|
+
* @param path Cookie path
|
112
|
+
* @param domain Cookie domain
|
113
|
+
* @param secure Is the Cookie secure
|
114
|
+
* @param sameSite Is the cookie same site
|
115
|
+
*
|
116
|
+
*/
|
117
|
+
deleteAll(path?: AXCookieOptions['path'], domain?: AXCookieOptions['domain'], secure?: AXCookieOptions['secure'], sameSite?: AXSameSite): void;
|
118
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXCookieStorageService, never>;
|
119
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXCookieStorageService>;
|
120
|
+
}
|
121
|
+
|
122
|
+
declare const AX_LOCALSTORAGE_SECRET_KEY: InjectionToken<string>;
|
123
|
+
declare class AXLocalStorageService implements AXStorage {
|
124
|
+
private secret_key;
|
125
|
+
get<T = unknown>(key: string): T;
|
126
|
+
set<T = unknown>(key: string, value: T): void;
|
127
|
+
clear(): void;
|
128
|
+
removeItem(key: string): void;
|
129
|
+
setWithEncryption<T = unknown>(key: string, value: T): void;
|
130
|
+
getWithEncription<T = unknown>(key: string): T;
|
131
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXLocalStorageService, never>;
|
132
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXLocalStorageService>;
|
133
|
+
}
|
134
|
+
|
135
|
+
declare class AXSessionStorageService implements AXStorage {
|
136
|
+
get<T = unknown>(key: string): T;
|
137
|
+
set<T = unknown>(key: string, value: T): void;
|
138
|
+
clear(): void;
|
139
|
+
removeItem(key: string): void;
|
140
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXSessionStorageService, never>;
|
141
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXSessionStorageService>;
|
142
|
+
}
|
143
|
+
|
144
|
+
export { AXCookieStorageService, AXLocalStorageService, AXSessionStorageService, AX_LOCALSTORAGE_SECRET_KEY };
|
145
|
+
export type { AXCookieOptions, AXSameSite, AXStorage };
|
package/translation/index.d.ts
CHANGED
@@ -1,8 +1,109 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
import { ResolveFn } from '@angular/router';
|
2
|
+
import * as i0 from '@angular/core';
|
3
|
+
import { InjectionToken, PipeTransform, OnInit } from '@angular/core';
|
4
|
+
import { Observable } from 'rxjs';
|
5
|
+
|
6
|
+
declare const loadTranslationScope: ResolveFn<unknown>;
|
7
|
+
|
8
|
+
type AXTranslateHashMap<T = unknown> = Record<string, T>;
|
9
|
+
type AXTranslateLang = string;
|
10
|
+
type AXTranslateScope = string;
|
11
|
+
type AXTranslateParams<T = unknown> = Record<string, T>;
|
12
|
+
type AXTranslation = Record<string, string>;
|
13
|
+
interface AXTranslateOptions {
|
14
|
+
lang?: AXTranslateLang;
|
15
|
+
scope?: AXTranslateScope;
|
16
|
+
params?: AXTranslateParams;
|
17
|
+
}
|
18
|
+
interface AXParsedToken {
|
19
|
+
key: string;
|
20
|
+
scope?: AXTranslateScope;
|
21
|
+
lang?: AXTranslateLang;
|
22
|
+
fullMatch: string;
|
23
|
+
}
|
24
|
+
|
25
|
+
interface AXTranslationConfig {
|
26
|
+
defaults: {
|
27
|
+
lang: AXTranslateLang;
|
28
|
+
scope: AXTranslateScope;
|
29
|
+
};
|
30
|
+
preload?: {
|
31
|
+
langs: AXTranslateLang[];
|
32
|
+
scopes: AXTranslateScope[];
|
33
|
+
};
|
34
|
+
fallbacks?: {
|
35
|
+
langs?: Record<AXTranslateLang, AXTranslateLang[]>;
|
36
|
+
scopes?: Record<AXTranslateScope, AXTranslateScope[]>;
|
37
|
+
};
|
38
|
+
available?: {
|
39
|
+
langs?: AXTranslateLang[];
|
40
|
+
scopes?: AXTranslateScope[];
|
41
|
+
};
|
42
|
+
resolver?: {
|
43
|
+
scopeKey: string;
|
44
|
+
};
|
45
|
+
}
|
46
|
+
declare const AX_TRANSLATION_CONFIG: InjectionToken<AXTranslationConfig>;
|
47
|
+
declare const AXTranslationDefaultConfig: AXTranslationConfig;
|
48
|
+
type AXPartialTranslationConfig = Partial<AXTranslationConfig>;
|
49
|
+
declare function translationConfig(config?: AXPartialTranslationConfig): AXTranslationConfig;
|
50
|
+
|
51
|
+
interface AXTranslationLoaderOptions {
|
52
|
+
lang: AXTranslateLang;
|
53
|
+
scope?: AXTranslateScope;
|
54
|
+
}
|
55
|
+
interface AXTranslationLoader {
|
56
|
+
load(options: AXTranslationLoaderOptions): Observable<AXTranslation>;
|
57
|
+
}
|
58
|
+
declare class AXTranslationLoaderDefault implements AXTranslationLoader {
|
59
|
+
load(options: AXTranslationLoaderOptions): Observable<AXTranslation>;
|
60
|
+
}
|
61
|
+
declare const AX_TRANSLATION_LOADER: InjectionToken<AXTranslationLoader>;
|
62
|
+
|
63
|
+
declare class AXTranslatorPipe implements PipeTransform {
|
64
|
+
private service;
|
65
|
+
transform(key: string, options?: AXTranslateOptions): Observable<string>;
|
66
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXTranslatorPipe, never>;
|
67
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<AXTranslatorPipe, "translate", true>;
|
68
|
+
}
|
69
|
+
|
70
|
+
declare class AXTranslatorDirective implements OnInit {
|
71
|
+
private templateRef;
|
72
|
+
private vc;
|
73
|
+
private translationService;
|
74
|
+
ngOnInit(): void;
|
75
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXTranslatorDirective, never>;
|
76
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AXTranslatorDirective, "[translate]", never, {}, {}, never, never, true, never>;
|
77
|
+
}
|
78
|
+
|
79
|
+
declare class AXTranslationModule {
|
80
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXTranslationModule, never>;
|
81
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AXTranslationModule, never, [typeof AXTranslatorPipe, typeof AXTranslatorDirective], [typeof AXTranslatorPipe, typeof AXTranslatorDirective]>;
|
82
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AXTranslationModule>;
|
83
|
+
}
|
84
|
+
|
85
|
+
declare function translateSync(key: string, options?: AXTranslateOptions): string;
|
86
|
+
declare class AXTranslationService {
|
87
|
+
private localeService;
|
88
|
+
private config;
|
89
|
+
private loader;
|
90
|
+
private parser;
|
91
|
+
private resolver;
|
92
|
+
private activeLang;
|
93
|
+
readonly langChanges$: Observable<string>;
|
94
|
+
constructor();
|
95
|
+
setActiveLang(lang: AXTranslateLang): void;
|
96
|
+
getActiveLang(): AXTranslateLang;
|
97
|
+
getDefaultLang(): AXTranslateLang;
|
98
|
+
translate$(text: string, options?: AXTranslateOptions): Observable<string>;
|
99
|
+
translateAsync(text: string, options?: AXTranslateOptions): Promise<string>;
|
100
|
+
translateSync(text: string, options?: AXTranslateOptions & {
|
101
|
+
waitForLoad?: boolean;
|
102
|
+
timeoutMs?: number;
|
103
|
+
}): string;
|
104
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXTranslationService, never>;
|
105
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXTranslationService>;
|
106
|
+
}
|
107
|
+
|
108
|
+
export { AXTranslationDefaultConfig, AXTranslationLoaderDefault, AXTranslationModule, AXTranslationService, AXTranslatorDirective, AXTranslatorPipe, AX_TRANSLATION_CONFIG, AX_TRANSLATION_LOADER, loadTranslationScope, translateSync, translationConfig };
|
109
|
+
export type { AXParsedToken, AXPartialTranslationConfig, AXTranslateHashMap, AXTranslateLang, AXTranslateOptions, AXTranslateParams, AXTranslateScope, AXTranslation, AXTranslationConfig, AXTranslationLoader, AXTranslationLoaderOptions };
|
package/utils/index.d.ts
CHANGED
@@ -1,6 +1,118 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
import tinycolor, { ColorInput } from 'tinycolor2';
|
2
|
+
import { Instance } from 'tinygradient-es';
|
3
|
+
import * as i0 from '@angular/core';
|
4
|
+
import { OnDestroy } from '@angular/core';
|
5
|
+
import { Observable, Subject } from 'rxjs';
|
6
|
+
|
7
|
+
type AXColorMode = 'rgba' | 'hex' | 'hsla' | 'hsva' | null;
|
8
|
+
|
9
|
+
type AXColorFormat = ColorInput;
|
10
|
+
declare class AXColorUtil {
|
11
|
+
static to(color: AXColorFormat, mode: AXColorMode): AXColorFormat;
|
12
|
+
static toString(color: AXColorFormat, mode?: AXColorMode): string;
|
13
|
+
static isValid(color: AXColorFormat): boolean;
|
14
|
+
static mix(baseColor: AXColorFormat, hex: AXColorFormat, percentage: number): string;
|
15
|
+
static multiply(color1: AXColorFormat, color2: AXColorFormat): string;
|
16
|
+
static contrastToWhite(color: AXColorFormat): number;
|
17
|
+
static lighten(hex: AXColorFormat, percentage?: number): tinycolor.Instance;
|
18
|
+
static darken(hex: AXColorFormat, percentage?: number): tinycolor.Instance;
|
19
|
+
static brighten(hex: AXColorFormat, percentage?: number): tinycolor.Instance;
|
20
|
+
static saturate(hex: AXColorFormat, percentage?: number): tinycolor.Instance;
|
21
|
+
static desaturate(hex: AXColorFormat): number;
|
22
|
+
static equal(color1: AXColorFormat, color2: AXColorFormat): boolean;
|
23
|
+
static gradient(values: unknown[] | {
|
24
|
+
color: unknown;
|
25
|
+
pos: number;
|
26
|
+
}[]): Instance;
|
27
|
+
static getLuminance(hex: AXColorFormat): number;
|
28
|
+
static xyToRgb(vX: any, vY: any): string;
|
29
|
+
static colorStringToHex(color: any): any;
|
30
|
+
static getRandomColor(): string;
|
31
|
+
}
|
32
|
+
|
33
|
+
interface AXPoint {
|
34
|
+
x: number;
|
35
|
+
y: number;
|
36
|
+
}
|
37
|
+
interface AXBoundingClientRect {
|
38
|
+
left?: number;
|
39
|
+
top?: number;
|
40
|
+
width?: number;
|
41
|
+
height?: number;
|
42
|
+
bottom?: number;
|
43
|
+
right?: number;
|
44
|
+
}
|
45
|
+
declare class AXDrawingUtil {
|
46
|
+
static collision(a: HTMLElement, b: HTMLElement): boolean;
|
47
|
+
static isInElementBound(pos: AXPoint, element: HTMLElement): boolean;
|
48
|
+
static isInRecPoint(pos: AXPoint, rec: AXBoundingClientRect | any): boolean;
|
49
|
+
static convertRemToPixels(rem: number): number;
|
50
|
+
}
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Blocks until a condition returns a value or the timeout is reached.
|
54
|
+
* Useful for simulating sync behavior with cached async results.
|
55
|
+
*/
|
56
|
+
declare function waitFor<T>(peekFn: () => T | null | undefined, loadFn: () => void, timeoutMs?: number): T | null;
|
57
|
+
/**
|
58
|
+
* Delays for a specific amount of time.
|
59
|
+
*/
|
60
|
+
declare function delay(ms: number): Promise<void>;
|
61
|
+
/**
|
62
|
+
* Retries an async function until it succeeds or a max attempt count is reached.
|
63
|
+
*/
|
64
|
+
declare function retryUntil<T>(fn: () => Promise<T>, attempts?: number, delayMs?: number): Promise<T>;
|
65
|
+
/**
|
66
|
+
* Continuously polls a condition until it returns true or a timeout is reached.
|
67
|
+
*/
|
68
|
+
declare function pollUntil(condition: () => boolean, intervalMs?: number, timeoutMs?: number): Promise<boolean>;
|
69
|
+
/**
|
70
|
+
* Throttles an async function to ensure only one instance runs at a time.
|
71
|
+
*/
|
72
|
+
declare function throttleAsync<T extends (...args: any[]) => Promise<any>>(fn: T): T;
|
73
|
+
/**
|
74
|
+
* Polls a condition with cancel support via AbortSignal.
|
75
|
+
*/
|
76
|
+
declare function pollUntilAbortable(condition: () => boolean, intervalMs?: number, timeoutMs?: number, signal?: AbortSignal): Promise<boolean>;
|
77
|
+
/**
|
78
|
+
* Debounces an async function to run only after no calls are made within the wait window.
|
79
|
+
*/
|
80
|
+
declare function debounceAsync<T extends (...args: any[]) => Promise<any>>(fn: T, waitMs: number): T;
|
81
|
+
/**
|
82
|
+
* Runs a list of fallback functions until one resolves without throwing.
|
83
|
+
*/
|
84
|
+
declare function fallbackChain<T>(tasks: Array<() => Promise<T>>): Promise<T>;
|
85
|
+
|
86
|
+
declare class AXHtmlUtil {
|
87
|
+
static focusElement(element: HTMLElement): HTMLElement;
|
88
|
+
static blurElement(element: HTMLElement): HTMLElement;
|
89
|
+
static hasFocus(element: HTMLElement): boolean;
|
90
|
+
static isRtl(element?: HTMLElement): boolean;
|
91
|
+
static hasDark(element: HTMLElement): boolean;
|
92
|
+
/**
|
93
|
+
* Helper function to check if an element is scrollable
|
94
|
+
*/
|
95
|
+
static isScrollable(element: HTMLElement): boolean;
|
96
|
+
/**
|
97
|
+
* Utility function to find scrollable parent elements
|
98
|
+
*/
|
99
|
+
static getScrollableParents(element: HTMLElement): HTMLElement[];
|
100
|
+
}
|
101
|
+
|
102
|
+
declare function AXAutoUnsubscriber(): (constructor: any) => void;
|
103
|
+
declare class AXUnsubscriber implements OnDestroy {
|
104
|
+
private readonly _destroy$;
|
105
|
+
readonly takeUntilDestroy: <T>(origin: Observable<T> | Subject<T>) => Observable<T> | Subject<T>;
|
106
|
+
unsubscribe(): void;
|
107
|
+
ngOnDestroy(): void;
|
108
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXUnsubscriber, never>;
|
109
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXUnsubscriber>;
|
110
|
+
}
|
111
|
+
|
112
|
+
declare function getWordBoundsAtPosition(str: string, position: number): {
|
113
|
+
start: number;
|
114
|
+
end: number;
|
115
|
+
};
|
116
|
+
|
117
|
+
export { AXAutoUnsubscriber, AXColorUtil, AXDrawingUtil, AXHtmlUtil, AXUnsubscriber, debounceAsync, delay, fallbackChain, getWordBoundsAtPosition, pollUntil, pollUntilAbortable, retryUntil, throttleAsync, waitFor };
|
118
|
+
export type { AXBoundingClientRect, AXColorFormat, AXColorMode, AXPoint };
|
package/validation/index.d.ts
CHANGED
@@ -1,14 +1,249 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { InjectionToken, ModuleWithProviders } from '@angular/core';
|
3
|
+
|
4
|
+
interface AXValidationRuleOptions {
|
5
|
+
message?: string;
|
6
|
+
[key: string]: unknown;
|
7
|
+
}
|
8
|
+
interface AXValidationRuleOptionsMap {
|
9
|
+
}
|
10
|
+
declare abstract class AXValidationRule {
|
11
|
+
abstract get name(): string;
|
12
|
+
abstract validate(value: unknown, options?: AXValidationRuleOptions): Promise<AXValidationRuleResult>;
|
13
|
+
}
|
14
|
+
interface AXValidationRuleResult {
|
15
|
+
rule: string;
|
16
|
+
value?: unknown;
|
17
|
+
message?: string | null;
|
18
|
+
result: boolean;
|
19
|
+
[key: string]: unknown;
|
20
|
+
}
|
21
|
+
interface AXValidationSummary {
|
22
|
+
result: boolean;
|
23
|
+
rules: AXValidationRuleResult[];
|
24
|
+
}
|
25
|
+
|
26
|
+
type AXCallbackValidationRuleResult = Promise<{
|
27
|
+
result: boolean;
|
28
|
+
message?: string;
|
29
|
+
}> | {
|
30
|
+
result: boolean;
|
31
|
+
message?: string;
|
32
|
+
} | boolean;
|
33
|
+
type AXCallbackValidation<T> = (value: T, options?: AXCallbackValidationRuleOptions<T>) => AXCallbackValidationRuleResult;
|
34
|
+
interface AXCallbackValidationRuleOptions<T> extends AXValidationRuleOptions {
|
35
|
+
validate: AXCallbackValidation<T>;
|
36
|
+
}
|
37
|
+
declare module '../validation.types' {
|
38
|
+
interface AXValidationRuleOptionsMap {
|
39
|
+
callback: AXCallbackValidationRuleOptions<unknown>;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
declare class AXCallbackValidationRule<T> implements AXValidationRule {
|
43
|
+
get name(): string;
|
44
|
+
validate(value: T, options: AXCallbackValidationRuleOptions<T>): Promise<AXValidationRuleResult>;
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXCallbackValidationRule<any>, never>;
|
46
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXCallbackValidationRule<any>>;
|
47
|
+
}
|
48
|
+
|
49
|
+
interface AXRegexValidationRuleOptions extends AXValidationRuleOptions {
|
50
|
+
pattern: string | RegExp;
|
51
|
+
}
|
52
|
+
declare module '../validation.types' {
|
53
|
+
interface AXValidationRuleOptionsMap {
|
54
|
+
regex: AXRegexValidationRuleOptions;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
declare class AXRegexValidationRule implements AXValidationRule {
|
58
|
+
private traslationService;
|
59
|
+
get name(): string;
|
60
|
+
validate(value: string, options: AXRegexValidationRuleOptions): Promise<AXValidationRuleResult>;
|
61
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXRegexValidationRule, never>;
|
62
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXRegexValidationRule>;
|
63
|
+
}
|
64
|
+
|
65
|
+
interface AXRequiredValidationRuleOptions extends AXValidationRuleOptions {
|
66
|
+
}
|
67
|
+
declare module '../validation.types' {
|
68
|
+
interface AXValidationRuleOptionsMap {
|
69
|
+
required: AXRequiredValidationRuleOptions;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
declare class AXRequiredValidationRule implements AXValidationRule {
|
73
|
+
private traslationService;
|
74
|
+
get name(): string;
|
75
|
+
validate(value?: unknown, options?: AXRequiredValidationRuleOptions): Promise<AXValidationRuleResult>;
|
76
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXRequiredValidationRule, never>;
|
77
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXRequiredValidationRule>;
|
78
|
+
}
|
79
|
+
|
80
|
+
interface AXLengthValidationRuleOptions extends AXValidationRuleOptions {
|
81
|
+
min: number;
|
82
|
+
max: number;
|
83
|
+
}
|
84
|
+
declare module '../validation.types' {
|
85
|
+
interface AXValidationRuleOptionsMap {
|
86
|
+
length: AXLengthValidationRuleOptions;
|
87
|
+
}
|
88
|
+
}
|
89
|
+
declare class AXLengthValidationRule implements AXValidationRule {
|
90
|
+
get name(): string;
|
91
|
+
validate(value: string, options: AXLengthValidationRuleOptions): Promise<AXValidationRuleResult>;
|
92
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXLengthValidationRule, never>;
|
93
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXLengthValidationRule>;
|
94
|
+
}
|
95
|
+
|
96
|
+
interface AXMaxLengthValidationRuleOptions extends AXValidationRuleOptions {
|
97
|
+
value: number;
|
98
|
+
}
|
99
|
+
declare module '../validation.types' {
|
100
|
+
interface AXValidationRuleOptionsMap {
|
101
|
+
maxLength: AXMaxLengthValidationRuleOptions;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
declare class AXMaxLengthValidationRule implements AXValidationRule {
|
105
|
+
get name(): string;
|
106
|
+
validate(value: string, options: AXMaxLengthValidationRuleOptions): Promise<AXValidationRuleResult>;
|
107
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXMaxLengthValidationRule, never>;
|
108
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXMaxLengthValidationRule>;
|
109
|
+
}
|
110
|
+
|
111
|
+
interface AXMinLengthValidationRuleOptions extends AXValidationRuleOptions {
|
112
|
+
value: number;
|
113
|
+
}
|
114
|
+
declare module '../validation.types' {
|
115
|
+
interface AXValidationRuleOptionsMap {
|
116
|
+
minLength: AXMinLengthValidationRuleOptions;
|
117
|
+
}
|
118
|
+
}
|
119
|
+
declare class AXMinLengthValidationRule implements AXValidationRule {
|
120
|
+
get name(): string;
|
121
|
+
validate(value: string, options: AXMinLengthValidationRuleOptions): Promise<AXValidationRuleResult>;
|
122
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXMinLengthValidationRule, never>;
|
123
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXMinLengthValidationRule>;
|
124
|
+
}
|
125
|
+
|
126
|
+
interface AXBetweenValidationRuleOptions<T = number | Date> extends AXValidationRuleOptions {
|
127
|
+
lowerValue: T;
|
128
|
+
upperValue: T;
|
129
|
+
inclusive?: boolean;
|
130
|
+
}
|
131
|
+
declare module '../validation.types' {
|
132
|
+
interface AXValidationRuleOptionsMap {
|
133
|
+
between: AXBetweenValidationRuleOptions;
|
134
|
+
}
|
135
|
+
}
|
136
|
+
declare class AXBetweenValidationRule<T = number | Date> implements AXValidationRule {
|
137
|
+
get name(): string;
|
138
|
+
validate(value: T, options: AXBetweenValidationRuleOptions<T>): Promise<AXValidationRuleResult>;
|
139
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXBetweenValidationRule<any>, never>;
|
140
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXBetweenValidationRule<any>>;
|
141
|
+
}
|
142
|
+
|
143
|
+
interface AXEqualValidationRuleOptions extends AXValidationRuleOptions {
|
144
|
+
value: any;
|
145
|
+
not?: boolean;
|
146
|
+
}
|
147
|
+
declare module '../validation.types' {
|
148
|
+
interface AXValidationRuleOptionsMap {
|
149
|
+
equal: AXEqualValidationRuleOptions;
|
150
|
+
}
|
151
|
+
}
|
152
|
+
declare class AXEqualValidationRule implements AXValidationRule {
|
153
|
+
get name(): string;
|
154
|
+
validate(value: any, options: AXEqualValidationRuleOptions): Promise<AXValidationRuleResult>;
|
155
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXEqualValidationRule, never>;
|
156
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXEqualValidationRule>;
|
157
|
+
}
|
158
|
+
|
159
|
+
interface AXGreaterThanValidationRuleOptions extends AXValidationRuleOptions {
|
160
|
+
value: number;
|
161
|
+
inclusive?: boolean;
|
162
|
+
}
|
163
|
+
declare module '../validation.types' {
|
164
|
+
interface AXValidationRuleOptionsMap {
|
165
|
+
greaterThan: AXGreaterThanValidationRuleOptions;
|
166
|
+
}
|
167
|
+
}
|
168
|
+
declare class AXGreaterThanValidationRule implements AXValidationRule {
|
169
|
+
get name(): string;
|
170
|
+
validate(value: number, options: AXGreaterThanValidationRuleOptions): Promise<AXValidationRuleResult>;
|
171
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXGreaterThanValidationRule, never>;
|
172
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXGreaterThanValidationRule>;
|
173
|
+
}
|
174
|
+
|
175
|
+
interface AXLessThanValidationRuleOptions extends AXValidationRuleOptions {
|
176
|
+
value: number;
|
177
|
+
inclusive?: boolean;
|
178
|
+
}
|
179
|
+
declare module '../validation.types' {
|
180
|
+
interface AXValidationRuleOptionsMap {
|
181
|
+
lessThan: AXLessThanValidationRuleOptions;
|
182
|
+
}
|
183
|
+
}
|
184
|
+
declare class AXLessThanValidationRule implements AXValidationRule {
|
185
|
+
get name(): string;
|
186
|
+
validate(value: number, options: AXLessThanValidationRuleOptions): Promise<AXValidationRuleResult>;
|
187
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXLessThanValidationRule, never>;
|
188
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXLessThanValidationRule>;
|
189
|
+
}
|
190
|
+
|
191
|
+
type AXValidationConfigRules = {
|
192
|
+
[key: string]: {
|
193
|
+
rule: keyof AXValidationRuleOptionsMap;
|
194
|
+
options: AXValidationRuleOptions;
|
195
|
+
};
|
196
|
+
};
|
197
|
+
interface AXValidationConfig {
|
198
|
+
rules: AXValidationConfigRules;
|
199
|
+
}
|
200
|
+
declare const AX_VALIDATION_CONFIG: InjectionToken<AXValidationConfig>;
|
201
|
+
declare const AXValidationDefaultConfig: AXValidationConfig;
|
202
|
+
type AXPartialValidationConfig = Partial<AXValidationConfig>;
|
203
|
+
declare function validationConfig(config?: AXPartialValidationConfig): AXValidationConfig;
|
204
|
+
|
205
|
+
interface AXValidationModuleConfigs {
|
206
|
+
rules: (new () => AXValidationRule)[];
|
207
|
+
}
|
208
|
+
declare class AXValidationModule {
|
209
|
+
static forRoot(configs?: AXValidationModuleConfigs): ModuleWithProviders<AXValidationModule>;
|
210
|
+
static forChild(configs?: AXValidationModuleConfigs): ModuleWithProviders<AXValidationModule>;
|
211
|
+
/**
|
212
|
+
* @ignore
|
213
|
+
*/
|
214
|
+
constructor();
|
215
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXValidationModule, never>;
|
216
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AXValidationModule, never, never, never>;
|
217
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AXValidationModule>;
|
218
|
+
}
|
219
|
+
|
220
|
+
declare class AXValidationRegistryService {
|
221
|
+
private plugins;
|
222
|
+
private configs;
|
223
|
+
get customRules(): AXValidationConfigRules;
|
224
|
+
private injector;
|
225
|
+
register(...plugins: (new () => AXValidationRule)[]): void;
|
226
|
+
get(ruleName: string): AXValidationRule | undefined;
|
227
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXValidationRegistryService, never>;
|
228
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXValidationRegistryService>;
|
229
|
+
}
|
230
|
+
declare class AXValidationService {
|
231
|
+
private translationService;
|
232
|
+
private pluginRegistry;
|
233
|
+
validate(ruleName: string, value: unknown, options?: AXValidationRuleOptions): Promise<AXValidationRuleResult>;
|
234
|
+
ruleFor(value: unknown): AXValidationRuleChain;
|
235
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXValidationService, never>;
|
236
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXValidationService>;
|
237
|
+
}
|
238
|
+
declare class AXValidationRuleChain {
|
239
|
+
private validationService;
|
240
|
+
private initialValue;
|
241
|
+
private rules;
|
242
|
+
private validationSummary;
|
243
|
+
constructor(validationService: AXValidationService, initialValue: unknown);
|
244
|
+
addRule(name: string, options?: any): AXValidationRuleChain;
|
245
|
+
validate(): Promise<AXValidationSummary>;
|
246
|
+
}
|
247
|
+
|
248
|
+
export { AXBetweenValidationRule, AXCallbackValidationRule, AXEqualValidationRule, AXGreaterThanValidationRule, AXLengthValidationRule, AXLessThanValidationRule, AXMaxLengthValidationRule, AXMinLengthValidationRule, AXRegexValidationRule, AXRequiredValidationRule, AXValidationDefaultConfig, AXValidationModule, AXValidationRegistryService, AXValidationRule, AXValidationService, AX_VALIDATION_CONFIG, validationConfig };
|
249
|
+
export type { AXBetweenValidationRuleOptions, AXCallbackValidation, AXCallbackValidationRuleOptions, AXCallbackValidationRuleResult, AXEqualValidationRuleOptions, AXGreaterThanValidationRuleOptions, AXLengthValidationRuleOptions, AXLessThanValidationRuleOptions, AXMaxLengthValidationRuleOptions, AXMinLengthValidationRuleOptions, AXPartialValidationConfig, AXRegexValidationRuleOptions, AXRequiredValidationRuleOptions, AXValidationConfig, AXValidationConfigRules, AXValidationModuleConfigs, AXValidationRuleOptions, AXValidationRuleOptionsMap, AXValidationRuleResult, AXValidationSummary };
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { ComponentRef, EmbeddedViewRef, TemplateRef } from '@angular/core';
|
2
|
-
import { AXComponentType } from './component.types';
|
3
|
-
import * as i0 from "@angular/core";
|
4
|
-
export declare class AXComponentService {
|
5
|
-
private appRef;
|
6
|
-
private getRootViewContainerRef;
|
7
|
-
createFromComponent<T>(content: AXComponentType<T>): Promise<ComponentRef<T>>;
|
8
|
-
createFromTemplate<T>(content: TemplateRef<T>): Promise<EmbeddedViewRef<T>>;
|
9
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AXComponentService, never>;
|
10
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AXComponentService>;
|
11
|
-
}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { TemplateRef } from '@angular/core';
|
2
|
-
export interface AXComponentType<T> {
|
3
|
-
new (...args: any[]): T;
|
4
|
-
}
|
5
|
-
export type AXComponentContent<T = any> = AXComponentType<T> | TemplateRef<T>;
|
6
|
-
export type AXComponentInputs = Record<string, unknown>;
|
7
|
-
export interface AXComponentOptions {
|
8
|
-
inputs?: AXComponentInputs;
|
9
|
-
}
|