quang 19.0.19-2
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 +25 -0
- package/auth/README.md +160 -0
- package/auth/auth-providers.d.ts +39 -0
- package/auth/auth.service.d.ts +52 -0
- package/auth/directives/has-at-least-one-role.directive.d.ts +26 -0
- package/auth/directives/has-every-role.directive.d.ts +26 -0
- package/auth/directives/is-authenticated.directive.d.ts +14 -0
- package/auth/directives/is-not-authenticated.directive.d.ts +14 -0
- package/auth/guards/index.d.ts +2 -0
- package/auth/guards/is-allowed.guard.d.ts +2 -0
- package/auth/guards/is-authenticated.guard.d.ts +2 -0
- package/auth/index.d.ts +9 -0
- package/auth/logout-on-error.interceptor.d.ts +9 -0
- package/auth/mobile/index.d.ts +1 -0
- package/auth/mobile/mobile-auth-feature.d.ts +2 -0
- package/auth/token-storage/index.d.ts +3 -0
- package/auth/token-storage/local-storage-feature.d.ts +2 -0
- package/auth/token-storage/memory-storage-feature.d.ts +12 -0
- package/auth/token-storage/session-storage-feature.d.ts +2 -0
- package/components/autocomplete/autocomplete.component.d.ts +43 -0
- package/components/autocomplete/index.d.ts +1 -0
- package/components/checkbox/checkbox.component.d.ts +11 -0
- package/components/checkbox/index.d.ts +1 -0
- package/components/date/date.component.d.ts +85 -0
- package/components/date/global-date.component.scss +1 -0
- package/components/date/index.d.ts +1 -0
- package/components/input/index.d.ts +1 -0
- package/components/input/input.component.d.ts +15 -0
- package/components/paginator/index.d.ts +5 -0
- package/components/paginator/paginator-language.service.d.ts +10 -0
- package/components/paginator/paginator.component.d.ts +30 -0
- package/components/paginator/paginator.module.d.ts +7 -0
- package/components/paginator/paginator.service.d.ts +6 -0
- package/components/paginator/paginatorIntl.d.ts +12 -0
- package/components/select/index.d.ts +1 -0
- package/components/select/select.component.d.ts +29 -0
- package/components/shared/ErrorData.d.ts +4 -0
- package/components/shared/index.d.ts +4 -0
- package/components/shared/makeId.d.ts +1 -0
- package/components/shared/option-list/option-list.component.d.ts +50 -0
- package/components/shared/quang-base-component.directive.d.ts +50 -0
- package/components/table/index.d.ts +1 -0
- package/components/table/table.component.d.ts +66 -0
- package/components/wysiwyg/global-wysiswyg.component.scss +1 -0
- package/components/wysiwyg/index.d.ts +1 -0
- package/components/wysiwyg/wysiwyg.component.d.ts +46 -0
- package/device/index.d.ts +1 -0
- package/device/resize-observable.service.d.ts +11 -0
- package/fesm2022/quang-auth-mobile.mjs +48 -0
- package/fesm2022/quang-auth-mobile.mjs.map +1 -0
- package/fesm2022/quang-auth.mjs +473 -0
- package/fesm2022/quang-auth.mjs.map +1 -0
- package/fesm2022/quang-components-autocomplete.mjs +196 -0
- package/fesm2022/quang-components-autocomplete.mjs.map +1 -0
- package/fesm2022/quang-components-checkbox.mjs +53 -0
- package/fesm2022/quang-components-checkbox.mjs.map +1 -0
- package/fesm2022/quang-components-date.mjs +392 -0
- package/fesm2022/quang-components-date.mjs.map +1 -0
- package/fesm2022/quang-components-input.mjs +54 -0
- package/fesm2022/quang-components-input.mjs.map +1 -0
- package/fesm2022/quang-components-paginator.mjs +157 -0
- package/fesm2022/quang-components-paginator.mjs.map +1 -0
- package/fesm2022/quang-components-select.mjs +123 -0
- package/fesm2022/quang-components-select.mjs.map +1 -0
- package/fesm2022/quang-components-shared.mjs +386 -0
- package/fesm2022/quang-components-shared.mjs.map +1 -0
- package/fesm2022/quang-components-table.mjs +162 -0
- package/fesm2022/quang-components-table.mjs.map +1 -0
- package/fesm2022/quang-components-wysiwyg.mjs +230 -0
- package/fesm2022/quang-components-wysiwyg.mjs.map +1 -0
- package/fesm2022/quang-device.mjs +42 -0
- package/fesm2022/quang-device.mjs.map +1 -0
- package/fesm2022/quang-forms.mjs +188 -0
- package/fesm2022/quang-forms.mjs.map +1 -0
- package/fesm2022/quang-loader.mjs +116 -0
- package/fesm2022/quang-loader.mjs.map +1 -0
- package/fesm2022/quang-overlay-modal.mjs +118 -0
- package/fesm2022/quang-overlay-modal.mjs.map +1 -0
- package/fesm2022/quang-overlay-popover.mjs +70 -0
- package/fesm2022/quang-overlay-popover.mjs.map +1 -0
- package/fesm2022/quang-overlay-shared.mjs +359 -0
- package/fesm2022/quang-overlay-shared.mjs.map +1 -0
- package/fesm2022/quang-overlay-toast.mjs +105 -0
- package/fesm2022/quang-overlay-toast.mjs.map +1 -0
- package/fesm2022/quang-overlay-tooltip.mjs +56 -0
- package/fesm2022/quang-overlay-tooltip.mjs.map +1 -0
- package/fesm2022/quang-shared.mjs +29 -0
- package/fesm2022/quang-shared.mjs.map +1 -0
- package/fesm2022/quang-translation.mjs +119 -0
- package/fesm2022/quang-translation.mjs.map +1 -0
- package/fesm2022/quang.mjs +23 -0
- package/fesm2022/quang.mjs.map +1 -0
- package/forms/README.md +6 -0
- package/forms/form-group-model.d.ts +18 -0
- package/forms/index.d.ts +2 -0
- package/forms/validators.d.ts +43 -0
- package/index.d.ts +30 -0
- package/loader/README.md +14 -0
- package/loader/index.d.ts +4 -0
- package/loader/loader-providers.d.ts +23 -0
- package/loader/loader.component.d.ts +23 -0
- package/loader/loader.interceptor.d.ts +10 -0
- package/loader/loader.service.d.ts +9 -0
- package/overlay/modal/index.d.ts +1 -0
- package/overlay/modal/modal.component.d.ts +29 -0
- package/overlay/popover/index.d.ts +1 -0
- package/overlay/popover/popover.component.d.ts +13 -0
- package/overlay/popover/popover.directive.d.ts +11 -0
- package/overlay/shared/CustomViewportRuler.d.ts +63 -0
- package/overlay/shared/index.d.ts +3 -0
- package/overlay/shared/quang-base-overlay.component.d.ts +9 -0
- package/overlay/shared/quang-base-overlay.directive.d.ts +44 -0
- package/overlay/toast/index.d.ts +2 -0
- package/overlay/toast/toast.component.d.ts +13 -0
- package/overlay/toast/toast.service.d.ts +27 -0
- package/overlay/tooltip/index.d.ts +2 -0
- package/overlay/tooltip/tooltip.component.d.ts +11 -0
- package/overlay/tooltip/tooltip.directive.d.ts +11 -0
- package/package.json +146 -0
- package/shared/index.d.ts +1 -0
- package/shared/intercept-utils.d.ts +13 -0
- package/translation/README.md +21 -0
- package/translation/index.d.ts +4 -0
- package/translation/translation-loader.service.d.ts +10 -0
- package/translation/translation-providers.d.ts +28 -0
- package/translation/translation.service.d.ts +15 -0
- package/translation/translations.tokens.d.ts +5 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function isHttpMethod(value) {
|
|
2
|
+
return ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'].includes(value);
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* providers: [
|
|
7
|
+
* provideHttpClient(withInterceptors([quangLoaderInterceptor]))
|
|
8
|
+
* ]
|
|
9
|
+
*/
|
|
10
|
+
function getExcludedUrlsByMethod(urlData) {
|
|
11
|
+
const excludedUrlByMethod = new Map([
|
|
12
|
+
['GET', new Set()],
|
|
13
|
+
['PUT', new Set()],
|
|
14
|
+
['DELETE', new Set()],
|
|
15
|
+
['POST', new Set()],
|
|
16
|
+
['PATCH', new Set()],
|
|
17
|
+
]);
|
|
18
|
+
for (const { method, url } of urlData) {
|
|
19
|
+
excludedUrlByMethod.get(method ?? 'GET')?.add(url);
|
|
20
|
+
}
|
|
21
|
+
return excludedUrlByMethod;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Generated bundle index. Do not edit.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
export { getExcludedUrlsByMethod, isHttpMethod };
|
|
29
|
+
//# sourceMappingURL=quang-shared.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quang-shared.mjs","sources":["../../../projects/quang/shared/intercept-utils.ts","../../../projects/quang/shared/quang-shared.ts"],"sourcesContent":["export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'\n\nexport function isHttpMethod(value: string): value is HttpMethod {\n return ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'].includes(value)\n}\n\nexport interface UrlData {\n url: string\n method: HttpMethod\n}\n\n/**\n * @example\n * providers: [\n * provideHttpClient(withInterceptors([quangLoaderInterceptor]))\n * ]\n */\n\nexport function getExcludedUrlsByMethod(urlData: UrlData[]) {\n const excludedUrlByMethod = new Map<HttpMethod, Set<string>>([\n ['GET', new Set()],\n ['PUT', new Set()],\n ['DELETE', new Set()],\n ['POST', new Set()],\n ['PATCH', new Set()],\n ])\n for (const { method, url } of urlData) {\n excludedUrlByMethod.get(method ?? 'GET')?.add(url)\n }\n return excludedUrlByMethod\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAEM,SAAU,YAAY,CAAC,KAAa,EAAA;AACxC,IAAA,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;AAClE;AAOA;;;;;AAKG;AAEG,SAAU,uBAAuB,CAAC,OAAkB,EAAA;AACxD,IAAA,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAA0B;AAC3D,QAAA,CAAC,KAAK,EAAE,IAAI,GAAG,EAAE,CAAC;AAClB,QAAA,CAAC,KAAK,EAAE,IAAI,GAAG,EAAE,CAAC;AAClB,QAAA,CAAC,QAAQ,EAAE,IAAI,GAAG,EAAE,CAAC;AACrB,QAAA,CAAC,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;AACnB,QAAA,CAAC,OAAO,EAAE,IAAI,GAAG,EAAE,CAAC;AACrB,KAAA,CAAC;IACF,KAAK,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,OAAO,EAAE;AACrC,QAAA,mBAAmB,CAAC,GAAG,CAAC,MAAM,IAAI,KAAK,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC;;AAEpD,IAAA,OAAO,mBAAmB;AAC5B;;AC9BA;;AAEG;;;;"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, Optional, Injectable, makeEnvironmentProviders } from '@angular/core';
|
|
3
|
+
import { TranslocoService, provideTransloco } from '@jsverse/transloco';
|
|
4
|
+
import { quangFeature } from 'quang';
|
|
5
|
+
import { HttpClient } from '@angular/common/http';
|
|
6
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
7
|
+
|
|
8
|
+
const AVAILABLE_LANGS = new InjectionToken('AVAILABLE_LANGS');
|
|
9
|
+
const DEFAULT_LANG = new InjectionToken('DEFAULT_LANG');
|
|
10
|
+
const FALLBACK_LANG = new InjectionToken('FALLBACK_LANG');
|
|
11
|
+
const TRANSLATIONS_BASE_PATH = new InjectionToken('TRANSLATIONS_BASE_PATH');
|
|
12
|
+
|
|
13
|
+
class QuangTranslationLoaderService {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.httpClient = inject(HttpClient);
|
|
16
|
+
this.translationBasePath = inject(TRANSLATIONS_BASE_PATH);
|
|
17
|
+
}
|
|
18
|
+
getTranslation(lang) {
|
|
19
|
+
return this.httpClient.get(`${this.translationBasePath ?? './'}assets/i18n/${lang}.json`);
|
|
20
|
+
}
|
|
21
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: QuangTranslationLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
22
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: QuangTranslationLoaderService }); }
|
|
23
|
+
}
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: QuangTranslationLoaderService, decorators: [{
|
|
25
|
+
type: Injectable
|
|
26
|
+
}], propDecorators: { translationBasePath: [{
|
|
27
|
+
type: Optional
|
|
28
|
+
}] } });
|
|
29
|
+
|
|
30
|
+
class QuangTranslationService {
|
|
31
|
+
constructor() {
|
|
32
|
+
this._translocoService = inject(TranslocoService);
|
|
33
|
+
this.activeLang = toSignal(this._translocoService.langChanges$, { initialValue: null });
|
|
34
|
+
this._availableLangs = inject(AVAILABLE_LANGS);
|
|
35
|
+
this._defaultLang = inject(DEFAULT_LANG);
|
|
36
|
+
}
|
|
37
|
+
setActiveLang(lang) {
|
|
38
|
+
const targetLang = this._availableLangs.includes(lang) ? lang : this._defaultLang;
|
|
39
|
+
this._translocoService.setActiveLang(targetLang);
|
|
40
|
+
}
|
|
41
|
+
getActiveLang() {
|
|
42
|
+
return this.activeLang();
|
|
43
|
+
}
|
|
44
|
+
translate(key, params) {
|
|
45
|
+
return this._translocoService.translate(key, params);
|
|
46
|
+
}
|
|
47
|
+
setTranslation(translation, lang, options) {
|
|
48
|
+
return this._translocoService.setTranslation(translation, lang, options);
|
|
49
|
+
}
|
|
50
|
+
setTranslationKey(key, value, options) {
|
|
51
|
+
return this._translocoService.setTranslationKey(key, value, options);
|
|
52
|
+
}
|
|
53
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: QuangTranslationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
54
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: QuangTranslationService }); }
|
|
55
|
+
}
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: QuangTranslationService, decorators: [{
|
|
57
|
+
type: Injectable
|
|
58
|
+
}] });
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @example
|
|
62
|
+
* export const appConfig: ApplicationConfig = {
|
|
63
|
+
* providers: [
|
|
64
|
+
* provideTranslation({
|
|
65
|
+
* availableLangs: ['it', 'en'],
|
|
66
|
+
* defaultLang: 'it',
|
|
67
|
+
* fallbackLang: 'it',
|
|
68
|
+
* })
|
|
69
|
+
* ]
|
|
70
|
+
* }
|
|
71
|
+
*/
|
|
72
|
+
function provideTranslation(config) {
|
|
73
|
+
return makeEnvironmentProviders([
|
|
74
|
+
QuangTranslationLoaderService,
|
|
75
|
+
QuangTranslationService,
|
|
76
|
+
provideTransloco({
|
|
77
|
+
config: {
|
|
78
|
+
availableLangs: config.availableLangs,
|
|
79
|
+
defaultLang: config.defaultLang,
|
|
80
|
+
fallbackLang: config.fallbackLang,
|
|
81
|
+
reRenderOnLangChange: config.reRenderOnLangChange ?? true,
|
|
82
|
+
prodMode: config.prodMode ?? true,
|
|
83
|
+
failedRetries: config.failedRetries ?? 1,
|
|
84
|
+
missingHandler: {
|
|
85
|
+
logMissingKey: config.logMissingKey ?? true,
|
|
86
|
+
useFallbackTranslation: config.useFallbackTranslation ?? true,
|
|
87
|
+
allowEmpty: config.allowEmpty ?? false,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
loader: QuangTranslationLoaderService,
|
|
91
|
+
}),
|
|
92
|
+
{
|
|
93
|
+
provide: AVAILABLE_LANGS,
|
|
94
|
+
useValue: config.availableLangs,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
provide: DEFAULT_LANG,
|
|
98
|
+
useValue: config.defaultLang,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
provide: FALLBACK_LANG,
|
|
102
|
+
useValue: config.fallbackLang,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
provide: TRANSLATIONS_BASE_PATH,
|
|
106
|
+
useValue: config.translationsBasePath,
|
|
107
|
+
},
|
|
108
|
+
]);
|
|
109
|
+
}
|
|
110
|
+
function withTranslation(config) {
|
|
111
|
+
return quangFeature(1 /* QuangFeatureKind.TranslationFeature */, [provideTranslation(config)]);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Generated bundle index. Do not edit.
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
export { AVAILABLE_LANGS, DEFAULT_LANG, FALLBACK_LANG, QuangTranslationLoaderService, QuangTranslationService, TRANSLATIONS_BASE_PATH, provideTranslation, withTranslation };
|
|
119
|
+
//# sourceMappingURL=quang-translation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quang-translation.mjs","sources":["../../../projects/quang/translation/translations.tokens.ts","../../../projects/quang/translation/translation-loader.service.ts","../../../projects/quang/translation/translation.service.ts","../../../projects/quang/translation/translation-providers.ts","../../../projects/quang/translation/quang-translation.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core'\n\nexport const AVAILABLE_LANGS = new InjectionToken<string[]>('AVAILABLE_LANGS')\nexport const DEFAULT_LANG = new InjectionToken<string>('DEFAULT_LANG')\nexport const FALLBACK_LANG = new InjectionToken<string>('FALLBACK_LANG')\nexport const TRANSLATIONS_BASE_PATH = new InjectionToken<string>('TRANSLATIONS_BASE_PATH')\n","import { HttpClient } from '@angular/common/http'\nimport { Injectable, Optional, inject } from '@angular/core'\n\nimport { Translation, TranslocoLoader } from '@jsverse/transloco'\nimport { Observable } from 'rxjs'\n\nimport { TRANSLATIONS_BASE_PATH } from './translations.tokens'\n\n@Injectable()\nexport class QuangTranslationLoaderService implements TranslocoLoader {\n private readonly httpClient: HttpClient = inject(HttpClient)\n\n @Optional() private readonly translationBasePath: string = inject(TRANSLATIONS_BASE_PATH)\n\n getTranslation(lang: string): Observable<Translation> | Promise<Translation> {\n return this.httpClient.get<Translation>(`${this.translationBasePath ?? './'}assets/i18n/${lang}.json`)\n }\n}\n","import { Injectable, inject } from '@angular/core'\nimport { toSignal } from '@angular/core/rxjs-interop'\n\nimport { HashMap, SetTranslationOptions, Translation, TranslocoService } from '@jsverse/transloco'\n\nimport { AVAILABLE_LANGS, DEFAULT_LANG } from './translations.tokens'\n\n@Injectable()\nexport class QuangTranslationService {\n private readonly _translocoService: TranslocoService = inject(TranslocoService)\n\n activeLang = toSignal(this._translocoService.langChanges$, { initialValue: null })\n\n private readonly _availableLangs = inject(AVAILABLE_LANGS)\n\n private readonly _defaultLang = inject(DEFAULT_LANG)\n\n setActiveLang(lang: string): void {\n const targetLang = this._availableLangs.includes(lang) ? lang : this._defaultLang\n this._translocoService.setActiveLang(targetLang)\n }\n\n getActiveLang(): string | null {\n return this.activeLang()\n }\n\n translate(key: string, params?: HashMap): string {\n return this._translocoService.translate(key, params)\n }\n\n setTranslation(translation: Translation, lang?: string, options?: SetTranslationOptions) {\n return this._translocoService.setTranslation(translation, lang, options)\n }\n\n setTranslationKey(key: string, value: string, options?: Omit<SetTranslationOptions, 'merge'>) {\n return this._translocoService.setTranslationKey(key, value, options)\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core'\n\nimport { provideTransloco } from '@jsverse/transloco'\nimport { QuangFeature, QuangFeatureKind, quangFeature } from 'quang'\n\nimport { QuangTranslationLoaderService } from './translation-loader.service'\nimport { QuangTranslationService } from './translation.service'\n\nimport { AVAILABLE_LANGS, DEFAULT_LANG, FALLBACK_LANG, TRANSLATIONS_BASE_PATH } from './translations.tokens'\n\nexport interface TranslationConfig {\n availableLangs: string[]\n defaultLang: string\n fallbackLang: string\n translationsBasePath?: string\n reRenderOnLangChange?: boolean\n prodMode?: boolean\n failedRetries?: number\n logMissingKey?: boolean\n useFallbackTranslation?: boolean\n allowEmpty?: boolean\n}\n\n/**\n * @example\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideTranslation({\n * availableLangs: ['it', 'en'],\n * defaultLang: 'it',\n * fallbackLang: 'it',\n * })\n * ]\n * }\n */\nexport function provideTranslation(config: TranslationConfig): EnvironmentProviders {\n return makeEnvironmentProviders([\n QuangTranslationLoaderService,\n QuangTranslationService,\n provideTransloco({\n config: {\n availableLangs: config.availableLangs,\n defaultLang: config.defaultLang,\n fallbackLang: config.fallbackLang,\n reRenderOnLangChange: config.reRenderOnLangChange ?? true,\n prodMode: config.prodMode ?? true,\n failedRetries: config.failedRetries ?? 1,\n missingHandler: {\n logMissingKey: config.logMissingKey ?? true,\n useFallbackTranslation: config.useFallbackTranslation ?? true,\n allowEmpty: config.allowEmpty ?? false,\n },\n },\n loader: QuangTranslationLoaderService,\n }),\n {\n provide: AVAILABLE_LANGS,\n useValue: config.availableLangs,\n },\n {\n provide: DEFAULT_LANG,\n useValue: config.defaultLang,\n },\n {\n provide: FALLBACK_LANG,\n useValue: config.fallbackLang,\n },\n {\n provide: TRANSLATIONS_BASE_PATH,\n useValue: config.translationsBasePath,\n },\n ])\n}\n\nexport function withTranslation(config: TranslationConfig): QuangFeature<QuangFeatureKind.TranslationFeature> {\n return quangFeature(QuangFeatureKind.TranslationFeature, [provideTranslation(config)])\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { APP_BASE_HREF } from '@angular/common';
|
|
2
|
+
import { InjectionToken, makeEnvironmentProviders } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
const QUANG_CONFIG = new InjectionToken('QUANG_CONFIG');
|
|
5
|
+
const QUANG_LOGGING_BEHAVIOR = new InjectionToken('QUANG_LOGGING_BEHAVIOR');
|
|
6
|
+
/** Helper function to create an object that represents a Quang feature. */
|
|
7
|
+
function quangFeature(kind, providers) {
|
|
8
|
+
return { ɵkind: kind, ɵproviders: providers };
|
|
9
|
+
}
|
|
10
|
+
function provideQuangConfig(config, ...features) {
|
|
11
|
+
return makeEnvironmentProviders([
|
|
12
|
+
{ provide: APP_BASE_HREF, useValue: config?.baseHref ?? '/' },
|
|
13
|
+
{ provide: QUANG_LOGGING_BEHAVIOR, useValue: config?.verbose ? 'verbose' : 'normal' },
|
|
14
|
+
features.map((feature) => feature.ɵproviders),
|
|
15
|
+
]);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Generated bundle index. Do not edit.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
export { QUANG_CONFIG, QUANG_LOGGING_BEHAVIOR, provideQuangConfig, quangFeature };
|
|
23
|
+
//# sourceMappingURL=quang.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quang.mjs","sources":["../../../projects/quang/index.ts","../../../projects/quang/quang.ts"],"sourcesContent":["import { APP_BASE_HREF } from '@angular/common'\nimport { EnvironmentProviders, InjectionToken, Provider, makeEnvironmentProviders } from '@angular/core'\n\nexport const QUANG_CONFIG = new InjectionToken<QuangConfig>('QUANG_CONFIG')\n\nexport const QUANG_LOGGING_BEHAVIOR = new InjectionToken<'normal' | 'verbose'>('QUANG_LOGGING_BEHAVIOR')\n\nexport interface QuangConfig {\n verbose?: boolean\n baseHref?: string\n}\n\n/** The list of features as an enum to uniquely type each feature. */\nexport const enum QuangFeatureKind {\n AuthFeature,\n TranslationFeature,\n LoaderFeature,\n}\n\n/** Helper type to represent a Quang feature. */\nexport interface QuangFeature<FeatureKind extends QuangFeatureKind> {\n ɵkind: FeatureKind\n ɵproviders: (Provider | EnvironmentProviders)[]\n}\n\n/** Helper function to create an object that represents a Quang feature. */\nexport function quangFeature<FeatureKind extends QuangFeatureKind>(\n kind: FeatureKind,\n providers: (Provider | EnvironmentProviders)[]\n): QuangFeature<FeatureKind> {\n return { ɵkind: kind, ɵproviders: providers }\n}\n\n/**\n * A type alias that represents all Quang features available for use with `provideQuangConfig`.\n * Features can be enabled by adding special functions to the `provideQuangConfig` call.\n * See documentation for each symbol to find corresponding function name. See also `provideQuangConfig`\n * documentation on how to use those functions.\n *\n * @see {@link provideQuangConfig}\n */\nexport type QuangFeatures = QuangFeature<QuangFeatureKind>\n\nexport function provideQuangConfig(config?: QuangConfig, ...features: QuangFeatures[]): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: APP_BASE_HREF, useValue: config?.baseHref ?? '/' },\n { provide: QUANG_LOGGING_BEHAVIOR, useValue: config?.verbose ? 'verbose' : 'normal' },\n features.map((feature) => feature.ɵproviders),\n ])\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAGa,YAAY,GAAG,IAAI,cAAc,CAAc,cAAc;MAE7D,sBAAsB,GAAG,IAAI,cAAc,CAAuB,wBAAwB;AAoBvG;AACgB,SAAA,YAAY,CAC1B,IAAiB,EACjB,SAA8C,EAAA;IAE9C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE;AAC/C;SAYgB,kBAAkB,CAAC,MAAoB,EAAE,GAAG,QAAyB,EAAA;AACnF,IAAA,OAAO,wBAAwB,CAAC;QAC9B,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,IAAI,GAAG,EAAE;AAC7D,QAAA,EAAE,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,EAAE;QACrF,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,UAAU,CAAC;AAC9C,KAAA,CAAC;AACJ;;ACjDA;;AAEG;;;;"}
|
package/forms/README.md
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Forms
|
|
2
|
+
|
|
3
|
+
In this section you can find common utils for your forms.
|
|
4
|
+
|
|
5
|
+
- A set of [`Validators`](./validators.ts).
|
|
6
|
+
- `FormGroupModel` is type that allow you to create typed form based on an interface using FormControl. Read [`@example`](./form-group-model.ts) for usage.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FormControl, FormGroup } from '@angular/forms';
|
|
2
|
+
export type FormGroupModel<T> = FormGroup<{
|
|
3
|
+
[K in keyof T]: FormControl<T[K]>;
|
|
4
|
+
}>;
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* interface Person {
|
|
8
|
+
* name: string
|
|
9
|
+
* lastName: string
|
|
10
|
+
* age: number
|
|
11
|
+
* }
|
|
12
|
+
*
|
|
13
|
+
* myForm: FormGroupModel<Person> = this.formBuilder.group({
|
|
14
|
+
* name: this.formBuilder.control<string>('', Validators.required),
|
|
15
|
+
* lastName: this.formBuilder.control<string>(''),
|
|
16
|
+
* age: this.formBuilder.control<number>({value: 20, disabled: true})
|
|
17
|
+
* })
|
|
18
|
+
*/
|
package/forms/index.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AbstractControl, ValidatorFn } from '@angular/forms';
|
|
2
|
+
export declare enum EuroLocale {
|
|
3
|
+
AT = "AT",
|
|
4
|
+
BE = "BE",
|
|
5
|
+
BG = "BG",
|
|
6
|
+
CY = "CY",
|
|
7
|
+
CZ = "CZ",
|
|
8
|
+
DE = "DE",
|
|
9
|
+
DK = "DK",
|
|
10
|
+
EE = "EE",
|
|
11
|
+
GR = "GR",
|
|
12
|
+
ES = "ES",
|
|
13
|
+
FI = "FI",
|
|
14
|
+
FR = "FR",
|
|
15
|
+
GB = "GB",
|
|
16
|
+
HU = "HU",
|
|
17
|
+
IE = "IE",
|
|
18
|
+
IT = "IT",
|
|
19
|
+
LT = "LT",
|
|
20
|
+
LU = "LU",
|
|
21
|
+
LV = "LV",
|
|
22
|
+
MT = "MT",
|
|
23
|
+
NL = "NL",
|
|
24
|
+
PL = "PL",
|
|
25
|
+
PT = "PT",
|
|
26
|
+
RO = "RO",
|
|
27
|
+
SE = "SE",
|
|
28
|
+
SI = "SI",
|
|
29
|
+
SK = "SK"
|
|
30
|
+
}
|
|
31
|
+
export declare const europeanVatNumber: Record<EuroLocale, RegExp>;
|
|
32
|
+
export declare function fileMaxSize(maxSize: number): ValidatorFn;
|
|
33
|
+
export declare function fileMinSize(minSize: number): ValidatorFn;
|
|
34
|
+
export declare function isFile(): ValidatorFn;
|
|
35
|
+
export declare function fileType(fileTypes: string[]): (control: AbstractControl) => Record<string, any> | null;
|
|
36
|
+
export declare function fileExtensions(list: string[]): (control: AbstractControl) => Record<string, any> | null;
|
|
37
|
+
export declare function requiredCheckbox(): (control: AbstractControl) => Record<string, any> | null;
|
|
38
|
+
export declare function minDate(dateToCompare: Date): (control: AbstractControl) => Record<string, any> | null;
|
|
39
|
+
export declare function maxDate(dateToCompare: Date): (control: AbstractControl) => Record<string, any> | null;
|
|
40
|
+
export declare function dateBetween(start: Date, end: Date): (control: AbstractControl) => Record<string, any> | null;
|
|
41
|
+
export declare function isFiscalCode(): (control: AbstractControl) => Record<string, any> | null;
|
|
42
|
+
export declare function isVatNumber(localeList: EuroLocale[]): (control: AbstractControl) => Record<string, any> | null;
|
|
43
|
+
export declare function wysiwygRequired(): (control: AbstractControl) => Record<string, any> | null;
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { EnvironmentProviders, InjectionToken, Provider } from '@angular/core';
|
|
2
|
+
export declare const QUANG_CONFIG: InjectionToken<QuangConfig>;
|
|
3
|
+
export declare const QUANG_LOGGING_BEHAVIOR: InjectionToken<"normal" | "verbose">;
|
|
4
|
+
export interface QuangConfig {
|
|
5
|
+
verbose?: boolean;
|
|
6
|
+
baseHref?: string;
|
|
7
|
+
}
|
|
8
|
+
/** The list of features as an enum to uniquely type each feature. */
|
|
9
|
+
export declare const enum QuangFeatureKind {
|
|
10
|
+
AuthFeature = 0,
|
|
11
|
+
TranslationFeature = 1,
|
|
12
|
+
LoaderFeature = 2
|
|
13
|
+
}
|
|
14
|
+
/** Helper type to represent a Quang feature. */
|
|
15
|
+
export interface QuangFeature<FeatureKind extends QuangFeatureKind> {
|
|
16
|
+
ɵkind: FeatureKind;
|
|
17
|
+
ɵproviders: (Provider | EnvironmentProviders)[];
|
|
18
|
+
}
|
|
19
|
+
/** Helper function to create an object that represents a Quang feature. */
|
|
20
|
+
export declare function quangFeature<FeatureKind extends QuangFeatureKind>(kind: FeatureKind, providers: (Provider | EnvironmentProviders)[]): QuangFeature<FeatureKind>;
|
|
21
|
+
/**
|
|
22
|
+
* A type alias that represents all Quang features available for use with `provideQuangConfig`.
|
|
23
|
+
* Features can be enabled by adding special functions to the `provideQuangConfig` call.
|
|
24
|
+
* See documentation for each symbol to find corresponding function name. See also `provideQuangConfig`
|
|
25
|
+
* documentation on how to use those functions.
|
|
26
|
+
*
|
|
27
|
+
* @see {@link provideQuangConfig}
|
|
28
|
+
*/
|
|
29
|
+
export type QuangFeatures = QuangFeature<QuangFeatureKind>;
|
|
30
|
+
export declare function provideQuangConfig(config?: QuangConfig, ...features: QuangFeatures[]): EnvironmentProviders;
|
package/loader/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Quang Loader
|
|
2
|
+
|
|
3
|
+
Quang Loader is a fast way to implements an overlay loader to a project.
|
|
4
|
+
|
|
5
|
+
### QuangLoaderComponent
|
|
6
|
+
|
|
7
|
+
The `QuangLoaderComponent` is a component that shows a loader in page. It Has a default spinner but it could be replaced with custom content.
|
|
8
|
+
|
|
9
|
+
To use it:
|
|
10
|
+
|
|
11
|
+
- Import [QuangLoaderComponent](./loader.component.ts) to your component (suggested app.component.ts).
|
|
12
|
+
- Import [quangLoaderInterceptor](./loader-interceptor.ts) and [provideLoader](./loader-providers.ts) to Providers (app.config.ts)
|
|
13
|
+
|
|
14
|
+
Read [`Component @example`](./loader.component.ts) [`Interceptor @example`](./loader-interceptor.ts) [`Providers @example`](./loader-providers.ts) for usage.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EnvironmentProviders } from '@angular/core';
|
|
2
|
+
import { QuangFeature, QuangFeatureKind } from 'quang';
|
|
3
|
+
import { UrlData } from 'quang/shared';
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* export const appConfig: ApplicationConfig = {
|
|
7
|
+
* providers: [
|
|
8
|
+
* provideLoader([
|
|
9
|
+
* {
|
|
10
|
+
* url: 'assets',
|
|
11
|
+
* method: 'GET',
|
|
12
|
+
* },
|
|
13
|
+
* ])
|
|
14
|
+
* ]
|
|
15
|
+
* }
|
|
16
|
+
*/
|
|
17
|
+
export declare function provideQuangLoaderExcludedUrls(excludedUrls: UrlData[]): EnvironmentProviders;
|
|
18
|
+
export declare function withLoaderExcludedUrls(excludedUrls: UrlData[]): QuangFeature<QuangFeatureKind.LoaderFeature>;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated
|
|
21
|
+
* @see {@link provideQuangLoaderExcludedUrls}
|
|
22
|
+
*/
|
|
23
|
+
export declare const provideLoader: typeof provideQuangLoaderExcludedUrls;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* <quang-loader></quang-loader>
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <quang-loader>
|
|
8
|
+
* custom loader here
|
|
9
|
+
* </quang-loader>
|
|
10
|
+
*/
|
|
11
|
+
export declare class QuangLoaderComponent {
|
|
12
|
+
/**
|
|
13
|
+
* Minimum time (in milliseconds) to show the loader for
|
|
14
|
+
* @default 500
|
|
15
|
+
*/
|
|
16
|
+
showAtLeastFor: import("@angular/core").InputSignal<number>;
|
|
17
|
+
private readonly loaderService;
|
|
18
|
+
isLoading: import("@angular/core").Signal<boolean>;
|
|
19
|
+
showLoaderBuffer$: import("rxjs").Observable<boolean>;
|
|
20
|
+
showLoader: import("@angular/core").Signal<boolean | undefined>;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QuangLoaderComponent, never>;
|
|
22
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<QuangLoaderComponent, "quang-loader", never, { "showAtLeastFor": { "alias": "showAtLeastFor"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpInterceptorFn } from '@angular/common/http';
|
|
2
|
+
import { InjectionToken } from '@angular/core';
|
|
3
|
+
import { UrlData } from 'quang/shared';
|
|
4
|
+
export declare const LOADER_EXCLUDED_URLS: InjectionToken<UrlData[]>;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated
|
|
7
|
+
* @see {@link LOADER_EXCLUDED_URLS}
|
|
8
|
+
*/
|
|
9
|
+
export declare const EXCLUDED_URL: InjectionToken<UrlData[]>;
|
|
10
|
+
export declare const quangLoaderInterceptor: HttpInterceptorFn;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class QuangLoaderService {
|
|
3
|
+
private loaderState;
|
|
4
|
+
isLoading: import("@angular/core").Signal<boolean>;
|
|
5
|
+
show(): void;
|
|
6
|
+
hide(): void;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QuangLoaderService, never>;
|
|
8
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<QuangLoaderService>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './modal.component';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
2
|
+
import { CdkPortal } from '@angular/cdk/portal';
|
|
3
|
+
import { AfterViewInit, OnDestroy } from '@angular/core';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export type ModalAnimationMode = 'SLIDE_FROM_LEFT_TO_RIGHT' | 'SLIDE_FROM_RIGHT_TO_LEFT' | 'SLIDE_TOP_TO_BOTTOM' | 'SLIDE_BOTTOM_TO_TOP' | 'FADE';
|
|
6
|
+
export declare class QuangModalComponent implements AfterViewInit, OnDestroy {
|
|
7
|
+
private readonly overlay;
|
|
8
|
+
readonly portal?: CdkPortal;
|
|
9
|
+
backdropClick: import("@angular/core").OutputEmitterRef<void>;
|
|
10
|
+
position: import("@angular/core").InputSignal<"right" | "left" | "center">;
|
|
11
|
+
height: import("@angular/core").InputSignal<string>;
|
|
12
|
+
width: import("@angular/core").InputSignal<string>;
|
|
13
|
+
padding: import("@angular/core").InputSignal<string>;
|
|
14
|
+
containerClass: import("@angular/core").InputSignal<string>;
|
|
15
|
+
animationMode: import("@angular/core").InputSignal<ModalAnimationMode | undefined>;
|
|
16
|
+
backgroundColor: import("@angular/core").InputSignal<string | undefined>;
|
|
17
|
+
showBackdrop: import("@angular/core").InputSignal<boolean>;
|
|
18
|
+
positionStrategy: import("@angular/core").Signal<import("@angular/cdk/overlay.d-a80c40ed").G>;
|
|
19
|
+
animationClassEnter: import("@angular/core").Signal<"" | "left-to-right-enter-active" | "right-to-left-enter-active" | "top-to-bottom-enter-active" | "fade-enter-active">;
|
|
20
|
+
private readonly destroyRef;
|
|
21
|
+
private overlayConfig?;
|
|
22
|
+
private overlayRef?;
|
|
23
|
+
constructor(overlay: Overlay);
|
|
24
|
+
ngAfterViewInit(): void;
|
|
25
|
+
ngOnDestroy(): void;
|
|
26
|
+
closeModal(): void;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QuangModalComponent, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<QuangModalComponent, "quang-modal", never, { "position": { "alias": "position"; "required": true; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "padding": { "alias": "padding"; "required": false; "isSignal": true; }; "containerClass": { "alias": "containerClass"; "required": false; "isSignal": true; }; "animationMode": { "alias": "animationMode"; "required": false; "isSignal": true; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; "isSignal": true; }; "showBackdrop": { "alias": "showBackdrop"; "required": false; "isSignal": true; }; }, { "backdropClick": "backdropClick"; }, never, ["[header]", "[body]", "[footer]"], true, never>;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './popover.directive';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ConnectionPositionPair } from '@angular/cdk/overlay';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { QuangBaseOverlayComponent } from 'quang/overlay/shared';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class QuangPopoverComponent implements QuangBaseOverlayComponent {
|
|
6
|
+
content: import("@angular/core").InputSignal<TemplateRef<any> | null>;
|
|
7
|
+
positionPair: import("@angular/core").WritableSignal<ConnectionPositionPair | null>;
|
|
8
|
+
payload: import("@angular/core").InputSignal<any>;
|
|
9
|
+
getPopoverPosition: import("@angular/core").WritableSignal<string>;
|
|
10
|
+
onChangePositionPair$: import("rxjs").Subscription;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QuangPopoverComponent, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<QuangPopoverComponent, "quang-popover", never, { "content": { "alias": "content"; "required": false; "isSignal": true; }; "payload": { "alias": "payload"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentType } from '@angular/cdk/portal';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { QuangBaseOverlayDirective } from 'quang/overlay/shared';
|
|
4
|
+
import { QuangPopoverComponent } from './popover.component';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class QuangPopoverDirective extends QuangBaseOverlayDirective<QuangPopoverComponent> {
|
|
7
|
+
targetComponentType: import("@angular/core").WritableSignal<ComponentType<QuangPopoverComponent> | undefined>;
|
|
8
|
+
content: import("@angular/core").InputSignal<TemplateRef<any> | null>;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QuangPopoverDirective, never>;
|
|
10
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<QuangPopoverDirective, "[quangPopover]", never, { "content": { "alias": "quangPopover"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Platform } from '@angular/cdk/platform';
|
|
2
|
+
import { ViewportScrollPosition } from '@angular/cdk/scrolling';
|
|
3
|
+
import { NgZone, OnDestroy } from '@angular/core';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Class cloe of [ViewportRuler](https://github.com/angular/components/blob/master/src/cdk/scrolling/viewport-ruler.ts)
|
|
8
|
+
* To fix the wrong reported size of the viewport on mobile devices with hidden url bars
|
|
9
|
+
* Issues references:
|
|
10
|
+
* https://github.com/angular/components/issues/18890
|
|
11
|
+
* https://github.com/angular/components/issues/27739
|
|
12
|
+
*
|
|
13
|
+
* To use this component provide it instead of `ViewportRuler`
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* providers: [
|
|
17
|
+
* {
|
|
18
|
+
* provide: ViewportRuler,
|
|
19
|
+
* useClass: CustomViewportRuler
|
|
20
|
+
* }
|
|
21
|
+
* ]
|
|
22
|
+
*/
|
|
23
|
+
export declare class CustomViewportRuler implements OnDestroy {
|
|
24
|
+
private _platform;
|
|
25
|
+
/** Used to reference correct document/window */
|
|
26
|
+
protected _document: Document;
|
|
27
|
+
/** Cached viewport dimensions. */
|
|
28
|
+
private _viewportSize;
|
|
29
|
+
/** Stream of viewport change events. */
|
|
30
|
+
private readonly _change;
|
|
31
|
+
constructor(_platform: Platform, ngZone: NgZone, document: any);
|
|
32
|
+
ngOnDestroy(): void;
|
|
33
|
+
/** Returns the viewport's width and height. */
|
|
34
|
+
getViewportSize(): Readonly<{
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
}>;
|
|
38
|
+
/** Gets a DOMRect for the viewport's bounds. */
|
|
39
|
+
getViewportRect(): {
|
|
40
|
+
top: number;
|
|
41
|
+
left: number;
|
|
42
|
+
bottom: number;
|
|
43
|
+
right: number;
|
|
44
|
+
height: number;
|
|
45
|
+
width: number;
|
|
46
|
+
};
|
|
47
|
+
/** Gets the (top, left) scroll position of the viewport. */
|
|
48
|
+
getViewportScrollPosition(): ViewportScrollPosition;
|
|
49
|
+
/**
|
|
50
|
+
* Returns a stream that emits whenever the size of the viewport changes.
|
|
51
|
+
* This stream emits outside of the Angular zone.
|
|
52
|
+
* @param throttleTime Time in milliseconds to throttle the stream.
|
|
53
|
+
*/
|
|
54
|
+
change(throttleTime?: number): Observable<Event>;
|
|
55
|
+
/** Event listener that will be used to handle the viewport change events. */
|
|
56
|
+
private _changeListener;
|
|
57
|
+
/** Use defaultView of injected document if available or fallback to global window reference */
|
|
58
|
+
private _getWindow;
|
|
59
|
+
/** Updates the cached viewport size. */
|
|
60
|
+
private _updateViewportSize;
|
|
61
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomViewportRuler, [null, null, { optional: true; }]>;
|
|
62
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CustomViewportRuler>;
|
|
63
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConnectionPositionPair } from '@angular/cdk/overlay';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare abstract class QuangBaseOverlayComponent {
|
|
4
|
+
content: import("@angular/core").InputSignal<any>;
|
|
5
|
+
payload: import("@angular/core").InputSignal<any>;
|
|
6
|
+
positionPair: import("@angular/core").WritableSignal<ConnectionPositionPair | null>;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QuangBaseOverlayComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<QuangBaseOverlayComponent, "quang-base-overlay-component", never, { "content": { "alias": "content"; "required": true; "isSignal": true; }; "payload": { "alias": "payload"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ConnectedPosition } from '@angular/cdk/overlay';
|
|
2
|
+
import { ComponentType } from '@angular/cdk/portal';
|
|
3
|
+
import { DestroyRef, OnDestroy } from '@angular/core';
|
|
4
|
+
import { QuangBaseOverlayComponent } from './quang-base-overlay.component';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare abstract class QuangBaseOverlayDirective<T extends QuangBaseOverlayComponent> implements OnDestroy {
|
|
7
|
+
targetComponentType: import("@angular/core").WritableSignal<ComponentType<T> | undefined>;
|
|
8
|
+
/**
|
|
9
|
+
* The amount of pixels needed for the popover to automatically disappear. If undefined the popover will not disappear on scroll
|
|
10
|
+
* Default: 100
|
|
11
|
+
* @default 100
|
|
12
|
+
*/
|
|
13
|
+
scrollCloseThreshold: import("@angular/core").InputSignal<number | undefined>;
|
|
14
|
+
showMethod: import("@angular/core").InputSignal<"click" | "hover">;
|
|
15
|
+
content: import("@angular/core").InputSignal<any>;
|
|
16
|
+
quangOverlayPayload: import("@angular/core").InputSignal<any>;
|
|
17
|
+
closeOnClickOutside: boolean;
|
|
18
|
+
overlayPosition: import("@angular/core").InputSignal<"top" | "top-left" | "top-right" | "bottom" | "bottom-left" | "bottom-right" | "left" | "right">;
|
|
19
|
+
destroyRef: DestroyRef;
|
|
20
|
+
private top;
|
|
21
|
+
private topLeft;
|
|
22
|
+
private topRight;
|
|
23
|
+
private bottom;
|
|
24
|
+
private bottomLeft;
|
|
25
|
+
private bottomRight;
|
|
26
|
+
private left;
|
|
27
|
+
private right;
|
|
28
|
+
tooltipPosition: import("@angular/core").Signal<ConnectedPosition[]>;
|
|
29
|
+
private overlayRef;
|
|
30
|
+
private readonly overlay;
|
|
31
|
+
private readonly overlayPositionBuilder;
|
|
32
|
+
private readonly elementRef;
|
|
33
|
+
private positionStrategy;
|
|
34
|
+
private componentOverlayRef;
|
|
35
|
+
onClick(): void;
|
|
36
|
+
onHover(): void;
|
|
37
|
+
onLeave(): void;
|
|
38
|
+
attachOverlay(): void;
|
|
39
|
+
detachOverlay(): void;
|
|
40
|
+
showHideOverlay(): void;
|
|
41
|
+
ngOnDestroy(): void;
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QuangBaseOverlayDirective<any>, never>;
|
|
43
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<QuangBaseOverlayDirective<any>, never, never, { "scrollCloseThreshold": { "alias": "scrollCloseThreshold"; "required": false; "isSignal": true; }; "showMethod": { "alias": "showMethod"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": true; "isSignal": true; }; "quangOverlayPayload": { "alias": "quangOverlayPayload"; "required": false; "isSignal": true; }; "overlayPosition": { "alias": "overlayPosition"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { QuangToastService } from './toast.service';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class QuangToastComponent {
|
|
4
|
+
toastService: import("@angular/core").WritableSignal<QuangToastService>;
|
|
5
|
+
readonly isShowing: import("@angular/core").Signal<boolean>;
|
|
6
|
+
showAtLeastFor: import("@angular/core").InputSignal<number>;
|
|
7
|
+
private showToastBuffer$;
|
|
8
|
+
showToast: import("@angular/core").Signal<boolean | undefined>;
|
|
9
|
+
readonly _currentToast: import("@angular/core").WritableSignal<import("./toast.service").ToastData | null>;
|
|
10
|
+
close(): void;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QuangToastComponent, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<QuangToastComponent, "quang-toast", never, { "showAtLeastFor": { "alias": "showAtLeastFor"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
13
|
+
}
|