quang 19.2.5 → 20.1.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/auth/index.d.ts +195 -9
- package/auth/mobile/index.d.ts +5 -1
- package/components/autocomplete/index.d.ts +67 -1
- package/components/checkbox/index.d.ts +15 -1
- package/components/date/index.d.ts +89 -1
- package/components/input/index.d.ts +19 -1
- package/components/paginator/index.d.ts +68 -5
- package/components/select/index.d.ts +32 -1
- package/components/shared/index.d.ts +112 -4
- package/components/table/index.d.ts +70 -1
- package/components/wysiwyg/index.d.ts +51 -1
- package/data-handling/index.d.ts +10 -2
- package/device/index.d.ts +14 -1
- package/fesm2022/quang-auth.mjs +18 -18
- package/fesm2022/quang-auth.mjs.map +1 -1
- package/fesm2022/quang-components-autocomplete.mjs +3 -3
- package/fesm2022/quang-components-autocomplete.mjs.map +1 -1
- package/fesm2022/quang-components-checkbox.mjs +6 -6
- package/fesm2022/quang-components-checkbox.mjs.map +1 -1
- package/fesm2022/quang-components-date.mjs +5 -5
- package/fesm2022/quang-components-date.mjs.map +1 -1
- package/fesm2022/quang-components-input.mjs +6 -6
- package/fesm2022/quang-components-input.mjs.map +1 -1
- package/fesm2022/quang-components-paginator.mjs +15 -15
- package/fesm2022/quang-components-paginator.mjs.map +1 -1
- package/fesm2022/quang-components-select.mjs +8 -18
- package/fesm2022/quang-components-select.mjs.map +1 -1
- package/fesm2022/quang-components-shared.mjs +6 -6
- package/fesm2022/quang-components-shared.mjs.map +1 -1
- package/fesm2022/quang-components-table.mjs +4 -4
- package/fesm2022/quang-components-table.mjs.map +1 -1
- package/fesm2022/quang-components-wysiwyg.mjs +6 -6
- package/fesm2022/quang-components-wysiwyg.mjs.map +1 -1
- package/fesm2022/quang-device.mjs +3 -3
- package/fesm2022/quang-device.mjs.map +1 -1
- package/fesm2022/quang-loader.mjs +7 -8
- package/fesm2022/quang-loader.mjs.map +1 -1
- package/fesm2022/quang-overlay-modal.mjs +3 -3
- package/fesm2022/quang-overlay-modal.mjs.map +1 -1
- package/fesm2022/quang-overlay-popover.mjs +7 -7
- package/fesm2022/quang-overlay-popover.mjs.map +1 -1
- package/fesm2022/quang-overlay-shared.mjs +10 -11
- package/fesm2022/quang-overlay-shared.mjs.map +1 -1
- package/fesm2022/quang-overlay-toast.mjs +8 -8
- package/fesm2022/quang-overlay-toast.mjs.map +1 -1
- package/fesm2022/quang-overlay-tooltip.mjs +6 -6
- package/fesm2022/quang-overlay-tooltip.mjs.map +1 -1
- package/fesm2022/quang-translation.mjs +6 -6
- package/fesm2022/quang-translation.mjs.map +1 -1
- package/forms/index.d.ts +51 -2
- package/index.d.ts +13 -9
- package/loader/index.d.ts +69 -4
- package/overlay/modal/index.d.ts +34 -1
- package/overlay/popover/index.d.ts +25 -1
- package/overlay/shared/index.d.ts +116 -3
- package/overlay/toast/index.d.ts +45 -2
- package/overlay/tooltip/index.d.ts +23 -2
- package/package.json +22 -22
- package/shared/index.d.ts +16 -1
- package/translation/index.d.ts +62 -4
- package/auth/auth-providers.d.ts +0 -39
- package/auth/auth.service.d.ts +0 -52
- package/auth/directives/has-at-least-one-role.directive.d.ts +0 -26
- package/auth/directives/has-every-role.directive.d.ts +0 -26
- package/auth/directives/is-authenticated.directive.d.ts +0 -14
- package/auth/directives/is-not-authenticated.directive.d.ts +0 -14
- package/auth/guards/index.d.ts +0 -2
- package/auth/guards/is-allowed.guard.d.ts +0 -2
- package/auth/guards/is-authenticated.guard.d.ts +0 -2
- package/auth/logout-on-error.interceptor.d.ts +0 -9
- package/auth/mobile/mobile-auth-feature.d.ts +0 -2
- package/auth/token-storage/index.d.ts +0 -3
- package/auth/token-storage/local-storage-feature.d.ts +0 -2
- package/auth/token-storage/memory-storage-feature.d.ts +0 -12
- package/auth/token-storage/session-storage-feature.d.ts +0 -2
- package/components/autocomplete/autocomplete.component.d.ts +0 -64
- package/components/checkbox/checkbox.component.d.ts +0 -11
- package/components/date/date.component.d.ts +0 -85
- package/components/input/input.component.d.ts +0 -15
- package/components/paginator/paginator-language.service.d.ts +0 -10
- package/components/paginator/paginator.component.d.ts +0 -30
- package/components/paginator/paginator.module.d.ts +0 -7
- package/components/paginator/paginator.service.d.ts +0 -6
- package/components/paginator/paginatorIntl.d.ts +0 -12
- package/components/select/select.component.d.ts +0 -31
- package/components/shared/ErrorData.d.ts +0 -4
- package/components/shared/makeId.d.ts +0 -1
- package/components/shared/option-list/option-list.component.d.ts +0 -53
- package/components/shared/quang-base-component.directive.d.ts +0 -50
- package/components/table/table.component.d.ts +0 -66
- package/components/wysiwyg/wysiwyg.component.d.ts +0 -46
- package/data-handling/conversion.d.ts +0 -3
- package/data-handling/download.d.ts +0 -3
- package/device/resize-observable.service.d.ts +0 -11
- package/forms/form-group-model.d.ts +0 -18
- package/forms/validators.d.ts +0 -43
- package/loader/loader-providers.d.ts +0 -23
- package/loader/loader.component.d.ts +0 -23
- package/loader/loader.interceptor.d.ts +0 -10
- package/loader/loader.service.d.ts +0 -9
- package/overlay/modal/modal.component.d.ts +0 -29
- package/overlay/popover/popover.component.d.ts +0 -13
- package/overlay/popover/popover.directive.d.ts +0 -11
- package/overlay/shared/CustomViewportRuler.d.ts +0 -63
- package/overlay/shared/quang-base-overlay.component.d.ts +0 -9
- package/overlay/shared/quang-base-overlay.directive.d.ts +0 -44
- package/overlay/toast/toast.component.d.ts +0 -13
- package/overlay/toast/toast.service.d.ts +0 -27
- package/overlay/tooltip/tooltip.component.d.ts +0 -11
- package/overlay/tooltip/tooltip.directive.d.ts +0 -11
- package/shared/intercept-utils.d.ts +0 -13
- package/translation/translation-loader.service.d.ts +0 -10
- package/translation/translation-providers.d.ts +0 -28
- package/translation/translation.service.d.ts +0 -15
- package/translation/translations.tokens.d.ts +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quang-device.mjs","sources":["../../../projects/quang/device/resize-observable.service.ts","../../../projects/quang/device/quang-device.ts"],"sourcesContent":["import { Injectable } from '@angular/core'\n\nimport { NextObserver, Observable, Subscriber, filter, map, throttleTime } from 'rxjs'\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ResizeObservableService {\n private resizeObserver: ResizeObserver\n\n private notifiers: NextObserver<ResizeObserverEntry[]>[] = []\n\n constructor() {\n this.resizeObserver = new ResizeObserver((entries: ResizeObserverEntry[]) => {\n this.notifiers.forEach((obs) => obs.next(entries))\n })\n }\n\n resizeObservable(elem: Element): Observable<ResizeObserverEntry> {\n this.resizeObserver.observe(elem)\n const newObserverCandidate = new Observable<ResizeObserverEntry[]>(\n (subscriber: Subscriber<ResizeObserverEntry[]>) => {\n this.notifiers.push(subscriber)\n\n return () => {\n const idx = this.notifiers.findIndex((val) => val === subscriber)\n this.notifiers.splice(idx, 1)\n this.resizeObserver.unobserve(elem)\n }\n }\n )\n\n return newObserverCandidate.pipe(\n map((entries) => entries.find((entry) => entry.target === elem)),\n filter(Boolean),\n throttleTime(30)\n )\n }\n\n widthResizeObservable(elem: Element): Observable<number> {\n return this.resizeObservable(elem).pipe(\n map((entry) => entry.borderBoxSize[0].inlineSize),\n filter(Boolean)\n )\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAOa,uBAAuB,CAAA;AAKlC,IAAA,WAAA,GAAA;QAFQ,IAAS,CAAA,SAAA,GAA0C,EAAE;QAG3D,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC,CAAC,OAA8B,KAAI;AAC1E,YAAA,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACpD,SAAC,CAAC;;AAGJ,IAAA,gBAAgB,CAAC,IAAa,EAAA;AAC5B,QAAA,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC;QACjC,MAAM,oBAAoB,GAAG,IAAI,UAAU,CACzC,CAAC,UAA6C,KAAI;AAChD,YAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;AAE/B,YAAA,OAAO,MAAK;AACV,gBAAA,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,GAAG,KAAK,UAAU,CAAC;gBACjE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;AAC7B,gBAAA,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC;AACrC,aAAC;AACH,SAAC,CACF;AAED,QAAA,OAAO,oBAAoB,CAAC,IAAI,CAC9B,GAAG,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,EAChE,MAAM,CAAC,OAAO,CAAC,EACf,YAAY,CAAC,EAAE,CAAC,CACjB;;AAGH,IAAA,qBAAqB,CAAC,IAAa,EAAA;AACjC,QAAA,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,CACrC,GAAG,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,EACjD,MAAM,CAAC,OAAO,CAAC,CAChB
|
|
1
|
+
{"version":3,"file":"quang-device.mjs","sources":["../../../projects/quang/device/resize-observable.service.ts","../../../projects/quang/device/quang-device.ts"],"sourcesContent":["import { Injectable } from '@angular/core'\n\nimport { NextObserver, Observable, Subscriber, filter, map, throttleTime } from 'rxjs'\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ResizeObservableService {\n private resizeObserver: ResizeObserver\n\n private notifiers: NextObserver<ResizeObserverEntry[]>[] = []\n\n constructor() {\n this.resizeObserver = new ResizeObserver((entries: ResizeObserverEntry[]) => {\n this.notifiers.forEach((obs) => obs.next(entries))\n })\n }\n\n resizeObservable(elem: Element): Observable<ResizeObserverEntry> {\n this.resizeObserver.observe(elem)\n const newObserverCandidate = new Observable<ResizeObserverEntry[]>(\n (subscriber: Subscriber<ResizeObserverEntry[]>) => {\n this.notifiers.push(subscriber)\n\n return () => {\n const idx = this.notifiers.findIndex((val) => val === subscriber)\n this.notifiers.splice(idx, 1)\n this.resizeObserver.unobserve(elem)\n }\n }\n )\n\n return newObserverCandidate.pipe(\n map((entries) => entries.find((entry) => entry.target === elem)),\n filter(Boolean),\n throttleTime(30)\n )\n }\n\n widthResizeObservable(elem: Element): Observable<number> {\n return this.resizeObservable(elem).pipe(\n map((entry) => entry.borderBoxSize[0].inlineSize),\n filter(Boolean)\n )\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAOa,uBAAuB,CAAA;AAKlC,IAAA,WAAA,GAAA;QAFQ,IAAS,CAAA,SAAA,GAA0C,EAAE;QAG3D,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC,CAAC,OAA8B,KAAI;AAC1E,YAAA,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACpD,SAAC,CAAC;;AAGJ,IAAA,gBAAgB,CAAC,IAAa,EAAA;AAC5B,QAAA,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC;QACjC,MAAM,oBAAoB,GAAG,IAAI,UAAU,CACzC,CAAC,UAA6C,KAAI;AAChD,YAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;AAE/B,YAAA,OAAO,MAAK;AACV,gBAAA,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,GAAG,KAAK,UAAU,CAAC;gBACjE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;AAC7B,gBAAA,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC;AACrC,aAAC;AACH,SAAC,CACF;AAED,QAAA,OAAO,oBAAoB,CAAC,IAAI,CAC9B,GAAG,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,EAChE,MAAM,CAAC,OAAO,CAAC,EACf,YAAY,CAAC,EAAE,CAAC,CACjB;;AAGH,IAAA,qBAAqB,CAAC,IAAa,EAAA;AACjC,QAAA,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,CACrC,GAAG,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,EACjD,MAAM,CAAC,OAAO,CAAC,CAChB;;8GApCQ,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cAFtB,MAAM,EAAA,CAAA,CAAA;;2FAEP,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAHnC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -3,7 +3,6 @@ import { computed, Injectable, InjectionToken, inject, input, ChangeDetectionStr
|
|
|
3
3
|
import { getExcludedUrlsByMethod, isHttpMethod } from 'quang/shared';
|
|
4
4
|
import { finalize, map, of, timer, switchAll } from 'rxjs';
|
|
5
5
|
import { signalState, patchState } from '@ngrx/signals';
|
|
6
|
-
import { NgIf } from '@angular/common';
|
|
7
6
|
import { toObservable, toSignal } from '@angular/core/rxjs-interop';
|
|
8
7
|
import { quangFeature } from 'quang';
|
|
9
8
|
|
|
@@ -18,10 +17,10 @@ class QuangLoaderService {
|
|
|
18
17
|
hide() {
|
|
19
18
|
patchState(this.loaderState, { count: this.loaderState().count - 1 });
|
|
20
19
|
}
|
|
21
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
22
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
20
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
21
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangLoaderService, providedIn: 'root' }); }
|
|
23
22
|
}
|
|
24
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangLoaderService, decorators: [{
|
|
25
24
|
type: Injectable,
|
|
26
25
|
args: [{
|
|
27
26
|
providedIn: 'root',
|
|
@@ -70,12 +69,12 @@ class QuangLoaderComponent {
|
|
|
70
69
|
this.showLoaderBuffer$ = toObservable(this.isLoading).pipe(map((isLoading) => (isLoading ? of(isLoading) : timer(this.showAtLeastFor()).pipe(map(() => isLoading)))), switchAll());
|
|
71
70
|
this.showLoader = toSignal(this.showLoaderBuffer$);
|
|
72
71
|
}
|
|
73
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
74
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
72
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
73
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: QuangLoaderComponent, isStandalone: true, selector: "quang-loader", inputs: { showAtLeastFor: { classPropertyName: "showAtLeastFor", publicName: "showAtLeastFor", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (showLoader()) {\n <div class=\"loader-container\">\n @if (!ref?.children?.length) {\n <span class=\"loader\"></span>\n }\n <div #ref>\n <ng-content></ng-content>\n </div>\n </div>\n}\n", styles: [":host{display:block}.loader-container{position:fixed;width:100%;height:100%;display:flex;top:0;left:0;background-color:#00000080;align-items:center;justify-content:center;z-index:99999}.loader-container .loader{width:48px;height:48px;border-radius:50%;display:inline-block;position:relative;border:3px solid;border-color:rgba(255,255,255,.7607843137) rgba(255,255,255,.7607843137) rgba(255,255,255,.7607843137) transparent;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotationBack{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
75
74
|
}
|
|
76
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangLoaderComponent, decorators: [{
|
|
77
76
|
type: Component,
|
|
78
|
-
args: [{ selector: 'quang-loader', imports: [
|
|
77
|
+
args: [{ selector: 'quang-loader', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (showLoader()) {\n <div class=\"loader-container\">\n @if (!ref?.children?.length) {\n <span class=\"loader\"></span>\n }\n <div #ref>\n <ng-content></ng-content>\n </div>\n </div>\n}\n", styles: [":host{display:block}.loader-container{position:fixed;width:100%;height:100%;display:flex;top:0;left:0;background-color:#00000080;align-items:center;justify-content:center;z-index:99999}.loader-container .loader{width:48px;height:48px;border-radius:50%;display:inline-block;position:relative;border:3px solid;border-color:rgba(255,255,255,.7607843137) rgba(255,255,255,.7607843137) rgba(255,255,255,.7607843137) transparent;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotationBack{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}\n"] }]
|
|
79
78
|
}] });
|
|
80
79
|
|
|
81
80
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quang-loader.mjs","sources":["../../../projects/quang/loader/loader.service.ts","../../../projects/quang/loader/loader.interceptor.ts","../../../projects/quang/loader/loader.component.ts","../../../projects/quang/loader/loader.component.html","../../../projects/quang/loader/loader-providers.ts","../../../projects/quang/loader/quang-loader.ts"],"sourcesContent":["import { Injectable, computed } from '@angular/core'\n\nimport { patchState, signalState } from '@ngrx/signals'\n\n@Injectable({\n providedIn: 'root',\n})\nexport class QuangLoaderService {\n private loaderState = signalState({ count: 0 })\n\n public isLoading = computed(() => this.loaderState.count() > 0)\n\n public show(): void {\n patchState(this.loaderState, { count: this.loaderState().count + 1 })\n }\n\n public hide(): void {\n patchState(this.loaderState, { count: this.loaderState().count - 1 })\n }\n}\n","import { HttpInterceptorFn } from '@angular/common/http'\nimport { InjectionToken, inject } from '@angular/core'\n\nimport { UrlData, getExcludedUrlsByMethod, isHttpMethod } from 'quang/shared'\nimport { finalize } from 'rxjs'\n\nimport { QuangLoaderService } from './loader.service'\n\nexport const LOADER_EXCLUDED_URLS = new InjectionToken<UrlData[]>('LOADER_EXCLUDED_URLS')\n\n/**\n * @deprecated\n * @see {@link LOADER_EXCLUDED_URLS}\n */\nexport const EXCLUDED_URL = LOADER_EXCLUDED_URLS\n\nexport const quangLoaderInterceptor: HttpInterceptorFn = (request, next) => {\n const excludedUrlsByMethod = getExcludedUrlsByMethod(inject(LOADER_EXCLUDED_URLS, { optional: true }) ?? [])\n const loaderService = inject(QuangLoaderService)\n if (!isHttpMethod(request.method)) {\n return next(request)\n }\n\n if (\n Array.from(excludedUrlsByMethod.get(request.method) ?? []).some((excludedUrl) =>\n request.url.match(excludedUrl.replace(/\\//g, '\\\\/'))\n )\n ) {\n return next(request)\n }\n\n loaderService.show()\n\n return next(request).pipe(\n finalize(() => {\n loaderService.hide()\n })\n )\n}\n","import {
|
|
1
|
+
{"version":3,"file":"quang-loader.mjs","sources":["../../../projects/quang/loader/loader.service.ts","../../../projects/quang/loader/loader.interceptor.ts","../../../projects/quang/loader/loader.component.ts","../../../projects/quang/loader/loader.component.html","../../../projects/quang/loader/loader-providers.ts","../../../projects/quang/loader/quang-loader.ts"],"sourcesContent":["import { Injectable, computed } from '@angular/core'\n\nimport { patchState, signalState } from '@ngrx/signals'\n\n@Injectable({\n providedIn: 'root',\n})\nexport class QuangLoaderService {\n private loaderState = signalState({ count: 0 })\n\n public isLoading = computed(() => this.loaderState.count() > 0)\n\n public show(): void {\n patchState(this.loaderState, { count: this.loaderState().count + 1 })\n }\n\n public hide(): void {\n patchState(this.loaderState, { count: this.loaderState().count - 1 })\n }\n}\n","import { HttpInterceptorFn } from '@angular/common/http'\nimport { InjectionToken, inject } from '@angular/core'\n\nimport { UrlData, getExcludedUrlsByMethod, isHttpMethod } from 'quang/shared'\nimport { finalize } from 'rxjs'\n\nimport { QuangLoaderService } from './loader.service'\n\nexport const LOADER_EXCLUDED_URLS = new InjectionToken<UrlData[]>('LOADER_EXCLUDED_URLS')\n\n/**\n * @deprecated\n * @see {@link LOADER_EXCLUDED_URLS}\n */\nexport const EXCLUDED_URL = LOADER_EXCLUDED_URLS\n\nexport const quangLoaderInterceptor: HttpInterceptorFn = (request, next) => {\n const excludedUrlsByMethod = getExcludedUrlsByMethod(inject(LOADER_EXCLUDED_URLS, { optional: true }) ?? [])\n const loaderService = inject(QuangLoaderService)\n if (!isHttpMethod(request.method)) {\n return next(request)\n }\n\n if (\n Array.from(excludedUrlsByMethod.get(request.method) ?? []).some((excludedUrl) =>\n request.url.match(excludedUrl.replace(/\\//g, '\\\\/'))\n )\n ) {\n return next(request)\n }\n\n loaderService.show()\n\n return next(request).pipe(\n finalize(() => {\n loaderService.hide()\n })\n )\n}\n","import { ChangeDetectionStrategy, Component, inject, input } from '@angular/core'\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop'\n\nimport { map, of, switchAll, timer } from 'rxjs'\n\nimport { QuangLoaderService } from './loader.service'\n\n/**\n * @example\n * <quang-loader></quang-loader>\n *\n * @example\n * <quang-loader>\n * custom loader here\n * </quang-loader>\n */\n@Component({\n selector: 'quang-loader',\n imports: [],\n templateUrl: './loader.component.html',\n styleUrl: './loader.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class QuangLoaderComponent {\n /**\n * Minimum time (in milliseconds) to show the loader for\n * @default 500\n */\n showAtLeastFor = input<number>(500)\n\n private readonly loaderService = inject(QuangLoaderService)\n\n isLoading = this.loaderService.isLoading\n\n showLoaderBuffer$ = toObservable(this.isLoading).pipe(\n map((isLoading) => (isLoading ? of(isLoading) : timer(this.showAtLeastFor()).pipe(map(() => isLoading)))),\n switchAll()\n )\n\n showLoader = toSignal(this.showLoaderBuffer$)\n}\n","@if (showLoader()) {\n <div class=\"loader-container\">\n @if (!ref?.children?.length) {\n <span class=\"loader\"></span>\n }\n <div #ref>\n <ng-content></ng-content>\n </div>\n </div>\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core'\n\nimport { QuangFeature, QuangFeatureKind, quangFeature } from 'quang'\nimport { UrlData } from 'quang/shared'\n\nimport { LOADER_EXCLUDED_URLS } from './loader.interceptor'\n\n/**\n * @example\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideLoader([\n * {\n * url: 'assets',\n * method: 'GET',\n * },\n * ])\n * ]\n * }\n */\nexport function provideQuangLoaderExcludedUrls(excludedUrls: UrlData[]): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: LOADER_EXCLUDED_URLS,\n useValue: excludedUrls,\n },\n ])\n}\n\nexport function withLoaderExcludedUrls(excludedUrls: UrlData[]): QuangFeature<QuangFeatureKind.LoaderFeature> {\n return quangFeature(QuangFeatureKind.LoaderFeature, [provideQuangLoaderExcludedUrls(excludedUrls)])\n}\n\n/**\n * @deprecated\n * @see {@link provideQuangLoaderExcludedUrls}\n */\nexport const provideLoader = provideQuangLoaderExcludedUrls\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAOa,kBAAkB,CAAA;AAH/B,IAAA,WAAA,GAAA;QAIU,IAAW,CAAA,WAAA,GAAG,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAExC,QAAA,IAAA,CAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAShE;IAPQ,IAAI,GAAA;AACT,QAAA,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;;IAGhE,IAAI,GAAA;AACT,QAAA,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;;8GAV5D,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cAFjB,MAAM,EAAA,CAAA,CAAA;;2FAEP,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;MCEY,oBAAoB,GAAG,IAAI,cAAc,C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;ACrC7B;;AAEG;;;;"}
|
|
@@ -99,10 +99,10 @@ class QuangModalComponent {
|
|
|
99
99
|
this.overlayRef?.detach();
|
|
100
100
|
this.overlayRef?.dispose();
|
|
101
101
|
}
|
|
102
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
103
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
102
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangModalComponent, deps: [{ token: i1.Overlay }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
103
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.0", type: QuangModalComponent, isStandalone: true, selector: "quang-modal", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, containerClass: { classPropertyName: "containerClass", publicName: "containerClass", isSignal: true, isRequired: false, transformFunction: null }, animationMode: { classPropertyName: "animationMode", publicName: "animationMode", isSignal: true, isRequired: false, transformFunction: null }, backgroundColor: { classPropertyName: "backgroundColor", publicName: "backgroundColor", isSignal: true, isRequired: false, transformFunction: null }, showBackdrop: { classPropertyName: "showBackdrop", publicName: "showBackdrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { backdropClick: "backdropClick" }, viewQueries: [{ propertyName: "portal", first: true, predicate: CdkPortal, descendants: true }], ngImport: i0, template: "<ng-template cdkPortal>\n <div\n [ngStyle]=\"{\n '--quang-modal-panel-width': width(),\n '--quang-modal-panel-height': height(),\n '--quang-modal-panel-background': backgroundColor(),\n '--quang-modal-panel-padding': padding(),\n }\"\n class=\"dialog {{ containerClass() }} {{ animationClassEnter() }}\"\n >\n <div class=\"dialog__header\">\n <ng-content select=\"[header]\"></ng-content>\n </div>\n <div class=\"dialog__body\">\n <ng-content select=\"[body]\"></ng-content>\n </div>\n <div class=\"dialog__footer\">\n <ng-content select=\"[footer]\"></ng-content>\n </div>\n </div>\n</ng-template>\n", styles: [".dialog{background-color:var(--quang-modal-panel-background, var(--bs-body-bg, initial));position:relative;display:flex;flex-direction:column;width:var(--quang-modal-panel-width);height:var(--quang-modal-panel-height);padding:var(--quang-modal-panel-padding)}.dialog__header{display:flex;flex-direction:column;width:100%}.dialog__body{flex:1;overflow:auto}.dialog__footer{display:flex;justify-content:flex-end}::ng-deep .cdk-global-scrollblock{overflow-y:auto}@keyframes left-to-right_enter{0%{transform:translate(-100%)}to{transform:translate(0)}}.left-to-right-enter-active{animation:left-to-right_enter .5s ease-in-out forwards}@keyframes right-to-left_enter{0%{transform:translate(100%)}to{transform:translate(0)}}.right-to-left-enter-active{animation:right-to-left_enter .5s ease-in-out forwards}@keyframes top-to-bottom_enter{0%{transform:translateY(-100%)}to{transform:translateY(0)}}.top-to-bottom-enter-active{animation:top-to-bottom_enter .5s ease-in-out forwards}@keyframes bottom-to-top_enter{0%{transform:translateY(100%)}to{transform:translateY(0)}}.top-to-bottom-enter-active{animation:bottom-to-top_enter .5s ease-in-out forwards}@keyframes fade_enter{0%{opacity:0}to{opacity:1}}.fade-enter-active{animation:fade_enter .5s ease-in-out forwards}\n"], dependencies: [{ kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i2.CdkPortal, selector: "[cdkPortal]", exportAs: ["cdkPortal"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
104
104
|
}
|
|
105
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangModalComponent, decorators: [{
|
|
106
106
|
type: Component,
|
|
107
107
|
args: [{ selector: 'quang-modal', imports: [PortalModule, NgStyle], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template cdkPortal>\n <div\n [ngStyle]=\"{\n '--quang-modal-panel-width': width(),\n '--quang-modal-panel-height': height(),\n '--quang-modal-panel-background': backgroundColor(),\n '--quang-modal-panel-padding': padding(),\n }\"\n class=\"dialog {{ containerClass() }} {{ animationClassEnter() }}\"\n >\n <div class=\"dialog__header\">\n <ng-content select=\"[header]\"></ng-content>\n </div>\n <div class=\"dialog__body\">\n <ng-content select=\"[body]\"></ng-content>\n </div>\n <div class=\"dialog__footer\">\n <ng-content select=\"[footer]\"></ng-content>\n </div>\n </div>\n</ng-template>\n", styles: [".dialog{background-color:var(--quang-modal-panel-background, var(--bs-body-bg, initial));position:relative;display:flex;flex-direction:column;width:var(--quang-modal-panel-width);height:var(--quang-modal-panel-height);padding:var(--quang-modal-panel-padding)}.dialog__header{display:flex;flex-direction:column;width:100%}.dialog__body{flex:1;overflow:auto}.dialog__footer{display:flex;justify-content:flex-end}::ng-deep .cdk-global-scrollblock{overflow-y:auto}@keyframes left-to-right_enter{0%{transform:translate(-100%)}to{transform:translate(0)}}.left-to-right-enter-active{animation:left-to-right_enter .5s ease-in-out forwards}@keyframes right-to-left_enter{0%{transform:translate(100%)}to{transform:translate(0)}}.right-to-left-enter-active{animation:right-to-left_enter .5s ease-in-out forwards}@keyframes top-to-bottom_enter{0%{transform:translateY(-100%)}to{transform:translateY(0)}}.top-to-bottom-enter-active{animation:top-to-bottom_enter .5s ease-in-out forwards}@keyframes bottom-to-top_enter{0%{transform:translateY(100%)}to{transform:translateY(0)}}.top-to-bottom-enter-active{animation:bottom-to-top_enter .5s ease-in-out forwards}@keyframes fade_enter{0%{opacity:0}to{opacity:1}}.fade-enter-active{animation:fade_enter .5s ease-in-out forwards}\n"] }]
|
|
108
108
|
}], ctorParameters: () => [{ type: i1.Overlay }], propDecorators: { portal: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quang-overlay-modal.mjs","sources":["../../../projects/quang/overlay/modal/modal.component.ts","../../../projects/quang/overlay/modal/modal.component.html","../../../projects/quang/overlay/modal/quang-overlay-modal.ts"],"sourcesContent":["import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay'\nimport { CdkPortal, PortalModule } from '@angular/cdk/portal'\nimport { NgStyle } from '@angular/common'\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n OnDestroy,\n ViewChild,\n computed,\n inject,\n input,\n output,\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\n\nexport type ModalAnimationMode =\n | 'SLIDE_FROM_LEFT_TO_RIGHT'\n | 'SLIDE_FROM_RIGHT_TO_LEFT'\n | 'SLIDE_TOP_TO_BOTTOM'\n | 'SLIDE_BOTTOM_TO_TOP'\n | 'FADE'\n\n@Component({\n selector: 'quang-modal',\n imports: [PortalModule, NgStyle],\n templateUrl: './modal.component.html',\n styleUrl: './modal.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/**\n * Modal component that leverages Angular CDK's Overlay and Portal modules to create modals with flexible positioning and configurations.\n *\n * @usageNotes\n * The component can be shown by using its selector `quang-modal` with a boolean binded to the Angular directive `*ngIf`.\n *\n * Its structure is divided in 3 `ng-content` to set the header, body and footer.\n * Every section has its own selector and can be used to render custom content in a simple way.\n *\n * `header` section is placed on top, `footer` section is placed on bottom.\n *\n * @example\n * <quang-modal\n * (backdropClick)=\"closeModal()\"\n * *ngIf=\"showModal\"\n * position=\"right\"\n * >\n * <ng-container header>\n * <h2>Modal header</h2>\n * </ng-container>\n * <ng-container body>\n * <h3>Modal body</h3>\n * </ng-container>\n * <ng-container footer>\n * <h3>Modal footer</h3>\n * </ng-container>\n * </quang-modal>\n */\nexport class QuangModalComponent implements AfterViewInit, OnDestroy {\n @ViewChild(CdkPortal) public readonly portal?: CdkPortal\n\n backdropClick = output<void>()\n\n position = input.required<'right' | 'left' | 'center'>()\n\n height = input<string>('80vh')\n\n width = input<string>('80vw')\n\n padding = input<string>('0 1rem')\n\n containerClass = input<string>('')\n\n animationMode = input<ModalAnimationMode>()\n\n backgroundColor = input<string>()\n\n showBackdrop = input<boolean>(true)\n\n positionStrategy = computed(() => {\n switch (this.position()) {\n case 'right':\n return this.overlay.position().global().right().top()\n case 'left':\n return this.overlay.position().global().left().top()\n case 'center':\n default:\n return this.overlay.position().global().centerHorizontally().centerVertically()\n }\n })\n\n animationClassEnter = computed(() => {\n switch (this.animationMode()) {\n case 'SLIDE_FROM_LEFT_TO_RIGHT':\n return 'left-to-right-enter-active'\n case 'SLIDE_FROM_RIGHT_TO_LEFT':\n return 'right-to-left-enter-active'\n case 'SLIDE_TOP_TO_BOTTOM':\n return 'top-to-bottom-enter-active'\n case 'SLIDE_BOTTOM_TO_TOP':\n return 'top-to-bottom-enter-active'\n case 'FADE':\n return 'fade-enter-active'\n default:\n return ''\n }\n })\n\n private readonly destroyRef = inject(DestroyRef)\n\n private overlayConfig?: OverlayConfig\n\n private overlayRef?: OverlayRef\n\n constructor(private readonly overlay: Overlay) {}\n\n ngAfterViewInit(): void {\n this.overlayConfig = new OverlayConfig({\n hasBackdrop: true,\n positionStrategy: this.positionStrategy(),\n scrollStrategy: this.overlay.scrollStrategies.block(),\n backdropClass: this.showBackdrop() ? undefined : '',\n })\n this.overlayRef = this.overlay.create(this.overlayConfig)\n this.overlayRef\n .backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.backdropClick.emit()\n })\n this.overlayRef?.attach(this.portal)\n }\n\n ngOnDestroy(): void {\n this.closeModal()\n }\n\n closeModal(): void {\n this.overlayRef?.detach()\n this.overlayRef?.dispose()\n }\n}\n","<ng-template cdkPortal>\n <div\n [ngStyle]=\"{\n '--quang-modal-panel-width': width(),\n '--quang-modal-panel-height': height(),\n '--quang-modal-panel-background': backgroundColor(),\n '--quang-modal-panel-padding': padding(),\n }\"\n class=\"dialog {{ containerClass() }} {{ animationClassEnter() }}\"\n >\n <div class=\"dialog__header\">\n <ng-content select=\"[header]\"></ng-content>\n </div>\n <div class=\"dialog__body\">\n <ng-content select=\"[body]\"></ng-content>\n </div>\n <div class=\"dialog__footer\">\n <ng-content select=\"[footer]\"></ng-content>\n </div>\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA+BA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;MACU,mBAAmB,CAAA;AAwD9B,IAAA,WAAA,CAA6B,OAAgB,EAAA;QAAhB,IAAO,CAAA,OAAA,GAAP,OAAO;QArDpC,IAAa,CAAA,aAAA,GAAG,MAAM,EAAQ;AAE9B,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAA+B;AAExD,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAS,MAAM,CAAC;AAE9B,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,MAAM,CAAC;AAE7B,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAS,QAAQ,CAAC;AAEjC,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAS,EAAE,CAAC;QAElC,IAAa,CAAA,aAAA,GAAG,KAAK,EAAsB;QAE3C,IAAe,CAAA,eAAA,GAAG,KAAK,EAAU;AAEjC,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAU,IAAI,CAAC;AAEnC,QAAA,IAAA,CAAA,gBAAgB,GAAG,QAAQ,CAAC,MAAK;AAC/B,YAAA,QAAQ,IAAI,CAAC,QAAQ,EAAE;AACrB,gBAAA,KAAK,OAAO;AACV,oBAAA,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE;AACvD,gBAAA,KAAK,MAAM;A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aAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC;aACxC,SAAS,CAAC,MAAK;AACd,YAAA,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE;AAC3B,SAAC,CAAC;QACJ,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;;IAGtC,WAAW,GAAA;QACT,IAAI,CAAC,UAAU,EAAE;;IAGnB,UAAU,GAAA;AACR,QAAA,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE;AACzB,QAAA,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"quang-overlay-modal.mjs","sources":["../../../projects/quang/overlay/modal/modal.component.ts","../../../projects/quang/overlay/modal/modal.component.html","../../../projects/quang/overlay/modal/quang-overlay-modal.ts"],"sourcesContent":["import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay'\nimport { CdkPortal, PortalModule } from '@angular/cdk/portal'\nimport { NgStyle } from '@angular/common'\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n OnDestroy,\n ViewChild,\n computed,\n inject,\n input,\n output,\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\n\nexport type ModalAnimationMode =\n | 'SLIDE_FROM_LEFT_TO_RIGHT'\n | 'SLIDE_FROM_RIGHT_TO_LEFT'\n | 'SLIDE_TOP_TO_BOTTOM'\n | 'SLIDE_BOTTOM_TO_TOP'\n | 'FADE'\n\n@Component({\n selector: 'quang-modal',\n imports: [PortalModule, NgStyle],\n templateUrl: './modal.component.html',\n styleUrl: './modal.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/**\n * Modal component that leverages Angular CDK's Overlay and Portal modules to create modals with flexible positioning and configurations.\n *\n * @usageNotes\n * The component can be shown by using its selector `quang-modal` with a boolean binded to the Angular directive `*ngIf`.\n *\n * Its structure is divided in 3 `ng-content` to set the header, body and footer.\n * Every section has its own selector and can be used to render custom content in a simple way.\n *\n * `header` section is placed on top, `footer` section is placed on bottom.\n *\n * @example\n * <quang-modal\n * (backdropClick)=\"closeModal()\"\n * *ngIf=\"showModal\"\n * position=\"right\"\n * >\n * <ng-container header>\n * <h2>Modal header</h2>\n * </ng-container>\n * <ng-container body>\n * <h3>Modal body</h3>\n * </ng-container>\n * <ng-container footer>\n * <h3>Modal footer</h3>\n * </ng-container>\n * </quang-modal>\n */\nexport class QuangModalComponent implements AfterViewInit, OnDestroy {\n @ViewChild(CdkPortal) public readonly portal?: CdkPortal\n\n backdropClick = output<void>()\n\n position = input.required<'right' | 'left' | 'center'>()\n\n height = input<string>('80vh')\n\n width = input<string>('80vw')\n\n padding = input<string>('0 1rem')\n\n containerClass = input<string>('')\n\n animationMode = input<ModalAnimationMode>()\n\n backgroundColor = input<string>()\n\n showBackdrop = input<boolean>(true)\n\n positionStrategy = computed(() => {\n switch (this.position()) {\n case 'right':\n return this.overlay.position().global().right().top()\n case 'left':\n return this.overlay.position().global().left().top()\n case 'center':\n default:\n return this.overlay.position().global().centerHorizontally().centerVertically()\n }\n })\n\n animationClassEnter = computed(() => {\n switch (this.animationMode()) {\n case 'SLIDE_FROM_LEFT_TO_RIGHT':\n return 'left-to-right-enter-active'\n case 'SLIDE_FROM_RIGHT_TO_LEFT':\n return 'right-to-left-enter-active'\n case 'SLIDE_TOP_TO_BOTTOM':\n return 'top-to-bottom-enter-active'\n case 'SLIDE_BOTTOM_TO_TOP':\n return 'top-to-bottom-enter-active'\n case 'FADE':\n return 'fade-enter-active'\n default:\n return ''\n }\n })\n\n private readonly destroyRef = inject(DestroyRef)\n\n private overlayConfig?: OverlayConfig\n\n private overlayRef?: OverlayRef\n\n constructor(private readonly overlay: Overlay) {}\n\n ngAfterViewInit(): void {\n this.overlayConfig = new OverlayConfig({\n hasBackdrop: true,\n positionStrategy: this.positionStrategy(),\n scrollStrategy: this.overlay.scrollStrategies.block(),\n backdropClass: this.showBackdrop() ? undefined : '',\n })\n this.overlayRef = this.overlay.create(this.overlayConfig)\n this.overlayRef\n .backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.backdropClick.emit()\n })\n this.overlayRef?.attach(this.portal)\n }\n\n ngOnDestroy(): void {\n this.closeModal()\n }\n\n closeModal(): void {\n this.overlayRef?.detach()\n this.overlayRef?.dispose()\n }\n}\n","<ng-template cdkPortal>\n <div\n [ngStyle]=\"{\n '--quang-modal-panel-width': width(),\n '--quang-modal-panel-height': height(),\n '--quang-modal-panel-background': backgroundColor(),\n '--quang-modal-panel-padding': padding(),\n }\"\n class=\"dialog {{ containerClass() }} {{ animationClassEnter() }}\"\n >\n <div class=\"dialog__header\">\n <ng-content select=\"[header]\"></ng-content>\n </div>\n <div class=\"dialog__body\">\n <ng-content select=\"[body]\"></ng-content>\n </div>\n <div class=\"dialog__footer\">\n <ng-content select=\"[footer]\"></ng-content>\n </div>\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA+BA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;MACU,mBAAmB,CAAA;AAwD9B,IAAA,WAAA,CAA6B,OAAgB,EAAA;QAAhB,IAAO,CAAA,OAAA,GAAP,OAAO;QArDpC,IAAa,CAAA,aAAA,GAAG,MAAM,EAAQ;AAE9B,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAA+B;AAExD,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAS,MAAM,CAAC;AAE9B,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,MAAM,CAAC;AAE7B,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAS,QAAQ,CAAC;AAEjC,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAS,EAAE,CAAC;QAElC,IAAa,CAAA,aAAA,GAAG,KAAK,EAAsB;QAE3C,IAAe,CAAA,eAAA,GAA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AY,4HAAE,OAAO,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAiCpB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAnC/B,SAAS;+BACE,aAAa,EAAA,OAAA,EACd,CAAC,YAAY,EAAE,OAAO,CAAC,EAAA,eAAA,EAGf,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,2pBAAA,EAAA,MAAA,EAAA,CAAA,gvCAAA,CAAA,EAAA;4EA+BT,MAAM,EAAA,CAAA;sBAA3C,SAAS;uBAAC,SAAS;;;AE5DtB;;AAEG;;;;"}
|
|
@@ -38,12 +38,12 @@ class QuangPopoverComponent {
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
42
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
41
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangPopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
42
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: QuangPopoverComponent, isStandalone: true, selector: "quang-popover", inputs: { overlayContent: { classPropertyName: "overlayContent", publicName: "overlayContent", isSignal: true, isRequired: false, transformFunction: null }, payload: { classPropertyName: "payload", publicName: "payload", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (overlayContent()) {\n <div\n [ngClass]=\"getPopoverPosition()\"\n class=\"popover-container\"\n >\n <ng-container\n [ngTemplateOutlet]=\"overlayContent()\"\n [ngTemplateOutletContext]=\"{\n $implicit: payload(),\n }\"\n ></ng-container>\n </div>\n}\n", styles: [":host{--bs-popover-border-width: 1px;--bs-popover-arrow-width: .5rem;--bs-popover-arrow-border: var(--bs-border-color, #000);--box-shadow-bg: rgba(0, 0, 0, .16)}.popover-container{box-shadow:var(--box-shadow-bg);background:var(--bs-body-bg, #fff);border:var(--bs-popover-border-width) solid var(--bs-border-color, #000);pointer-events:none;position:relative;pointer-events:all}.popover-container.center-bottom:after,.popover-container.center-bottom:before{bottom:100%;left:50%;transform:translate(-50%)}.popover-container.start-bottom:after,.popover-container.start-bottom:before{bottom:100%;left:85%;transform:translate(-50%)}.popover-container.end-bottom:after,.popover-container.end-bottom:before{bottom:100%;left:15%;transform:translate(-50%)}.popover-container.center-top:after,.popover-container.center-top:before{top:100%;left:50%;transform:translate(-50%) rotate(180deg)}.popover-container.start-top:after,.popover-container.start-top:before{top:100%;left:85%;transform:translate(-50%) rotate(180deg)}.popover-container.end-top:after,.popover-container.end-top:before{top:100%;left:15%;transform:translate(-50%) rotate(180deg)}.popover-container.end-center:after,.popover-container.end-center:before{right:100%;top:50%;transform:translateY(-50%) rotate(270deg)}.popover-container.start-center:after,.popover-container.start-center:before{left:100%;top:50%;transform:translateY(-50%) rotate(90deg)}.popover-container:after,.popover-container:before{content:\"\";display:block;position:absolute;width:0;height:0;border-style:solid}.popover-container:after{border-color:transparent transparent var(--bs-body-bg, #fff) transparent;border-width:var(--bs-popover-arrow-width)}.popover-container:before{border-color:transparent transparent var(--bs-border-color, #000) transparent;border-width:calc(var(--bs-popover-arrow-width) + 1px)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
43
43
|
}
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangPopoverComponent, decorators: [{
|
|
45
45
|
type: Component,
|
|
46
|
-
args: [{ selector: 'quang-popover', imports: [NgTemplateOutlet, NgClass], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (overlayContent()) {\n <div\n [ngClass]=\"getPopoverPosition()\"\n class=\"popover-container\"\n >\n <ng-container\n [ngTemplateOutlet]=\"overlayContent()\"\n [ngTemplateOutletContext]=\"{\n $implicit: payload(),\n }\"\n ></ng-container>\n </div>\n}\n", styles: [":host{--bs-popover-border-width: 1px;--bs-popover-arrow-width: .5rem;--bs-popover-arrow-border: var(--bs-border-color, #000);--box-shadow-bg: rgba(0, 0, 0, .16)}.popover-container{box-shadow:var(--box-shadow-bg);background:var(--bs-body-bg, #fff);border:var(--bs-popover-border-width) solid var(--bs-border-color, #000);position:relative;
|
|
46
|
+
args: [{ selector: 'quang-popover', imports: [NgTemplateOutlet, NgClass], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (overlayContent()) {\n <div\n [ngClass]=\"getPopoverPosition()\"\n class=\"popover-container\"\n >\n <ng-container\n [ngTemplateOutlet]=\"overlayContent()\"\n [ngTemplateOutletContext]=\"{\n $implicit: payload(),\n }\"\n ></ng-container>\n </div>\n}\n", styles: [":host{--bs-popover-border-width: 1px;--bs-popover-arrow-width: .5rem;--bs-popover-arrow-border: var(--bs-border-color, #000);--box-shadow-bg: rgba(0, 0, 0, .16)}.popover-container{box-shadow:var(--box-shadow-bg);background:var(--bs-body-bg, #fff);border:var(--bs-popover-border-width) solid var(--bs-border-color, #000);pointer-events:none;position:relative;pointer-events:all}.popover-container.center-bottom:after,.popover-container.center-bottom:before{bottom:100%;left:50%;transform:translate(-50%)}.popover-container.start-bottom:after,.popover-container.start-bottom:before{bottom:100%;left:85%;transform:translate(-50%)}.popover-container.end-bottom:after,.popover-container.end-bottom:before{bottom:100%;left:15%;transform:translate(-50%)}.popover-container.center-top:after,.popover-container.center-top:before{top:100%;left:50%;transform:translate(-50%) rotate(180deg)}.popover-container.start-top:after,.popover-container.start-top:before{top:100%;left:85%;transform:translate(-50%) rotate(180deg)}.popover-container.end-top:after,.popover-container.end-top:before{top:100%;left:15%;transform:translate(-50%) rotate(180deg)}.popover-container.end-center:after,.popover-container.end-center:before{right:100%;top:50%;transform:translateY(-50%) rotate(270deg)}.popover-container.start-center:after,.popover-container.start-center:before{left:100%;top:50%;transform:translateY(-50%) rotate(90deg)}.popover-container:after,.popover-container:before{content:\"\";display:block;position:absolute;width:0;height:0;border-style:solid}.popover-container:after{border-color:transparent transparent var(--bs-body-bg, #fff) transparent;border-width:var(--bs-popover-arrow-width)}.popover-container:before{border-color:transparent transparent var(--bs-border-color, #000) transparent;border-width:calc(var(--bs-popover-arrow-width) + 1px)}\n"] }]
|
|
47
47
|
}] });
|
|
48
48
|
|
|
49
49
|
class QuangPopoverDirective extends QuangBaseOverlayDirective {
|
|
@@ -52,10 +52,10 @@ class QuangPopoverDirective extends QuangBaseOverlayDirective {
|
|
|
52
52
|
this.targetComponentType = signal(QuangPopoverComponent);
|
|
53
53
|
this.content = input.required({ alias: 'quangPopover' });
|
|
54
54
|
}
|
|
55
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
56
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
55
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangPopoverDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
56
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.0", type: QuangPopoverDirective, isStandalone: true, selector: "[quangPopover]", inputs: { content: { classPropertyName: "content", publicName: "quangPopover", isSignal: true, isRequired: true, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
|
|
57
57
|
}
|
|
58
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
58
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangPopoverDirective, decorators: [{
|
|
59
59
|
type: Directive,
|
|
60
60
|
args: [{
|
|
61
61
|
selector: '[quangPopover]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quang-overlay-popover.mjs","sources":["../../../projects/quang/overlay/popover/popover.component.ts","../../../projects/quang/overlay/popover/popover.component.html","../../../projects/quang/overlay/popover/popover.directive.ts","../../../projects/quang/overlay/popover/quang-overlay-popover.ts"],"sourcesContent":["import { ConnectionPositionPair } from '@angular/cdk/overlay'\nimport { NgClass, NgTemplateOutlet } from '@angular/common'\nimport { ChangeDetectionStrategy, Component, TemplateRef, input, signal } from '@angular/core'\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop'\n\nimport { QuangBaseOverlayComponent } from 'quang/overlay/shared'\n\n@Component({\n selector: 'quang-popover',\n imports: [NgTemplateOutlet, NgClass],\n templateUrl: './popover.component.html',\n styleUrl: './popover.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/**\n * Popover component that can render custom content, passed from the outside as a `TemplateRef`\n * @example\n * <button\n [quangPopover]=\"popoverTest\"\n [scrollCloseThreshold]=\"undefined\"\n class=\"btn popover-test-button\"\n overlayPosition=\"top\"\n showMethod=\"click\"\n >\n {{ 'buttons.popover' | transloco }}\n <span>CLICK</span>\n </button>\n <ng-template #popoverTest> <span>test works!</span> <button type=\"button\">click!</button> </ng-template>\n */\nexport class QuangPopoverComponent implements QuangBaseOverlayComponent {\n overlayContent = input<TemplateRef<any> | null>(null)\n\n positionPair = signal<ConnectionPositionPair | null>(null)\n\n payload = input<any>()\n\n getPopoverPosition = signal<string>('')\n\n onChangePositionPair$ = toObservable(this.positionPair)\n .pipe(takeUntilDestroyed())\n .subscribe((positionPair) => {\n const originX = positionPair?.originX\n const originY = positionPair?.originY\n if (originX && originY) {\n this.getPopoverPosition.set(`${originX}-${originY}`)\n } else {\n this.getPopoverPosition.set('')\n }\n })\n}\n","@if (overlayContent()) {\n <div\n [ngClass]=\"getPopoverPosition()\"\n class=\"popover-container\"\n >\n <ng-container\n [ngTemplateOutlet]=\"overlayContent()\"\n [ngTemplateOutletContext]=\"{\n $implicit: payload(),\n }\"\n ></ng-container>\n </div>\n}\n","import { ComponentType } from '@angular/cdk/portal'\nimport { Directive, TemplateRef, input, signal } from '@angular/core'\n\nimport { QuangBaseOverlayDirective } from 'quang/overlay/shared'\n\nimport { QuangPopoverComponent } from './popover.component'\n\n@Directive({\n selector: '[quangPopover]',\n})\nexport class QuangPopoverDirective extends QuangBaseOverlayDirective<QuangPopoverComponent> {\n override targetComponentType = signal<ComponentType<QuangPopoverComponent> | undefined>(QuangPopoverComponent)\n\n override content = input.required<TemplateRef<any> | null>({ alias: 'quangPopover' })\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAcA;;;;;;;;;;;;;;AAcG;MACU,qBAAqB,CAAA;AAtBlC,IAAA,WAAA,GAAA;AAuBE,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAA0B,IAAI,CAAC;AAErD,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAgC,IAAI,CAAC;QAE1D,IAAO,CAAA,OAAA,GAAG,KAAK,EAAO;AAEtB,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAS,EAAE,CAAC;AAEvC,QAAA,IAAA,CAAA,qBAAqB,GAAG,YAAY,CAAC,IAAI,CAAC,YAAY;aACnD,IAAI,CAAC,kBAAkB,EAAE;AACzB,aAAA,SAAS,CAAC,CAAC,YAAY,KAAI;AAC1B,YAAA,MAAM,OAAO,GAAG,YAAY,EAAE,OAAO;AACrC,YAAA,MAAM,OAAO,GAAG,YAAY,EAAE,OAAO;AACrC,YAAA,IAAI,OAAO,IAAI,OAAO,EAAE;gBACtB,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAG,EAAA,OAAO,CAAI,CAAA,EAAA,OAAO,CAAE,CAAA,CAAC;;iBAC/C;AACL,gBAAA,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;;AAEnC,SAAC,CAAC;AACL
|
|
1
|
+
{"version":3,"file":"quang-overlay-popover.mjs","sources":["../../../projects/quang/overlay/popover/popover.component.ts","../../../projects/quang/overlay/popover/popover.component.html","../../../projects/quang/overlay/popover/popover.directive.ts","../../../projects/quang/overlay/popover/quang-overlay-popover.ts"],"sourcesContent":["import { ConnectionPositionPair } from '@angular/cdk/overlay'\nimport { NgClass, NgTemplateOutlet } from '@angular/common'\nimport { ChangeDetectionStrategy, Component, TemplateRef, input, signal } from '@angular/core'\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop'\n\nimport { QuangBaseOverlayComponent } from 'quang/overlay/shared'\n\n@Component({\n selector: 'quang-popover',\n imports: [NgTemplateOutlet, NgClass],\n templateUrl: './popover.component.html',\n styleUrl: './popover.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/**\n * Popover component that can render custom content, passed from the outside as a `TemplateRef`\n * @example\n * <button\n [quangPopover]=\"popoverTest\"\n [scrollCloseThreshold]=\"undefined\"\n class=\"btn popover-test-button\"\n overlayPosition=\"top\"\n showMethod=\"click\"\n >\n {{ 'buttons.popover' | transloco }}\n <span>CLICK</span>\n </button>\n <ng-template #popoverTest> <span>test works!</span> <button type=\"button\">click!</button> </ng-template>\n */\nexport class QuangPopoverComponent implements QuangBaseOverlayComponent {\n overlayContent = input<TemplateRef<any> | null>(null)\n\n positionPair = signal<ConnectionPositionPair | null>(null)\n\n payload = input<any>()\n\n getPopoverPosition = signal<string>('')\n\n onChangePositionPair$ = toObservable(this.positionPair)\n .pipe(takeUntilDestroyed())\n .subscribe((positionPair) => {\n const originX = positionPair?.originX\n const originY = positionPair?.originY\n if (originX && originY) {\n this.getPopoverPosition.set(`${originX}-${originY}`)\n } else {\n this.getPopoverPosition.set('')\n }\n })\n}\n","@if (overlayContent()) {\n <div\n [ngClass]=\"getPopoverPosition()\"\n class=\"popover-container\"\n >\n <ng-container\n [ngTemplateOutlet]=\"overlayContent()\"\n [ngTemplateOutletContext]=\"{\n $implicit: payload(),\n }\"\n ></ng-container>\n </div>\n}\n","import { ComponentType } from '@angular/cdk/portal'\nimport { Directive, TemplateRef, input, signal } from '@angular/core'\n\nimport { QuangBaseOverlayDirective } from 'quang/overlay/shared'\n\nimport { QuangPopoverComponent } from './popover.component'\n\n@Directive({\n selector: '[quangPopover]',\n})\nexport class QuangPopoverDirective extends QuangBaseOverlayDirective<QuangPopoverComponent> {\n override targetComponentType = signal<ComponentType<QuangPopoverComponent> | undefined>(QuangPopoverComponent)\n\n override content = input.required<TemplateRef<any> | null>({ alias: 'quangPopover' })\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAcA;;;;;;;;;;;;;;AAcG;MACU,qBAAqB,CAAA;AAtBlC,IAAA,WAAA,GAAA;AAuBE,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAA0B,IAAI,CAAC;AAErD,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAgC,IAAI,CAAC;QAE1D,IAAO,CAAA,OAAA,GAAG,KAAK,EAAO;AAEtB,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAS,EAAE,CAAC;AAEvC,QAAA,IAAA,CAAA,qBAAqB,GAAG,YAAY,CAAC,IAAI,CAAC,YAAY;aACnD,IAAI,CAAC,kBAAkB,EAAE;AACzB,aAAA,SAAS,CAAC,CAAC,YAAY,KAAI;AAC1B,YAAA,MAAM,OAAO,GAAG,YAAY,EAAE,OAAO;AACrC,YAAA,MAAM,OAAO,GAAG,YAAY,EAAE,OAAO;AACrC,YAAA,IAAI,OAAO,IAAI,OAAO,EAAE;gBACtB,IAAI,CAAC,kBAAkB,CAAC,GAA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EAAA,eAAA,EAGnB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,sSAAA,EAAA,MAAA,EAAA,CAAA,izDAAA,CAAA,EAAA;;;AEF3C,MAAO,qBAAsB,SAAQ,yBAAgD,CAAA;AAH3F,IAAA,WAAA,GAAA;;AAIW,QAAA,IAAA,CAAA,mBAAmB,GAAG,MAAM,CAAmD,qBAAqB,CAAC;QAErG,IAAO,CAAA,OAAA,GAAG,KAAK,CAAC,QAAQ,CAA0B,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;AACtF;8GAJY,qBAAqB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,cAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC3B,iBAAA;;;ACTD;;AAEG;;;;"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, signal, Component, inject, DestroyRef, computed, ElementRef, HostListener, Directive, Optional, Inject, Injectable } from '@angular/core';
|
|
2
|
+
import { input, signal, Component, inject, DestroyRef, computed, ElementRef, HostListener, Directive, DOCUMENT, Optional, Inject, Injectable } from '@angular/core';
|
|
3
3
|
import { Overlay, OverlayPositionBuilder } from '@angular/cdk/overlay';
|
|
4
4
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { DEFAULT_RESIZE_TIME } from '@angular/cdk/scrolling';
|
|
7
|
-
import { DOCUMENT } from '@angular/common';
|
|
8
7
|
import { Subject, auditTime } from 'rxjs';
|
|
9
8
|
import * as i1 from '@angular/cdk/platform';
|
|
10
9
|
|
|
@@ -14,10 +13,10 @@ class QuangBaseOverlayComponent {
|
|
|
14
13
|
this.payload = input();
|
|
15
14
|
this.positionPair = signal(null);
|
|
16
15
|
}
|
|
17
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
18
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
16
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangBaseOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
17
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.0", type: QuangBaseOverlayComponent, isStandalone: true, selector: "quang-base-overlay-component", inputs: { overlayContent: { classPropertyName: "overlayContent", publicName: "overlayContent", isSignal: true, isRequired: true, transformFunction: null }, payload: { classPropertyName: "payload", publicName: "payload", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: ``, isInline: true }); }
|
|
19
18
|
}
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangBaseOverlayComponent, decorators: [{
|
|
21
20
|
type: Component,
|
|
22
21
|
args: [{
|
|
23
22
|
selector: 'quang-base-overlay-component',
|
|
@@ -198,10 +197,10 @@ class QuangBaseOverlayDirective {
|
|
|
198
197
|
ngOnDestroy() {
|
|
199
198
|
this.detachOverlay();
|
|
200
199
|
}
|
|
201
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
202
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
200
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangBaseOverlayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
201
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.0", type: QuangBaseOverlayDirective, isStandalone: true, inputs: { scrollCloseThreshold: { classPropertyName: "scrollCloseThreshold", publicName: "scrollCloseThreshold", isSignal: true, isRequired: false, transformFunction: null }, showMethod: { classPropertyName: "showMethod", publicName: "showMethod", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, quangOverlayPayload: { classPropertyName: "quangOverlayPayload", publicName: "quangOverlayPayload", isSignal: true, isRequired: false, transformFunction: null }, overlayPosition: { classPropertyName: "overlayPosition", publicName: "overlayPosition", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick()", "mouseenter": "onHover()", "mouseleave": "onLeave()" } }, ngImport: i0 }); }
|
|
203
202
|
}
|
|
204
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
203
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangBaseOverlayDirective, decorators: [{
|
|
205
204
|
type: Directive
|
|
206
205
|
}], propDecorators: { onClick: [{
|
|
207
206
|
type: HostListener,
|
|
@@ -338,10 +337,10 @@ class CustomViewportRuler {
|
|
|
338
337
|
? { width: document.documentElement.clientWidth, height: document.documentElement.clientHeight }
|
|
339
338
|
: { width: 0, height: 0 };
|
|
340
339
|
}
|
|
341
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
342
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
340
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CustomViewportRuler, deps: [{ token: i1.Platform }, { token: i0.NgZone }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
341
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CustomViewportRuler, providedIn: 'root' }); }
|
|
343
342
|
}
|
|
344
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
343
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CustomViewportRuler, decorators: [{
|
|
345
344
|
type: Injectable,
|
|
346
345
|
args: [{ providedIn: 'root' }]
|
|
347
346
|
}], ctorParameters: () => [{ type: i1.Platform }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quang-overlay-shared.mjs","sources":["../../../projects/quang/overlay/shared/quang-base-overlay.component.ts","../../../projects/quang/overlay/shared/quang-base-overlay.directive.ts","../../../projects/quang/overlay/shared/CustomViewportRuler.ts","../../../projects/quang/overlay/shared/quang-overlay-shared.ts"],"sourcesContent":["import { ConnectionPositionPair } from '@angular/cdk/overlay'\nimport { Component, input, signal } from '@angular/core'\n\n@Component({\n selector: 'quang-base-overlay-component',\n\n template: ``,\n})\nexport abstract class QuangBaseOverlayComponent {\n overlayContent = input.required<any>()\n\n payload = input<any>()\n\n positionPair = signal<ConnectionPositionPair | null>(null)\n}\n","import {\n ConnectedOverlayPositionChange,\n ConnectedPosition,\n FlexibleConnectedPositionStrategy,\n Overlay,\n OverlayPositionBuilder,\n OverlayRef,\n} from '@angular/cdk/overlay'\nimport { ComponentPortal, ComponentType } from '@angular/cdk/portal'\nimport {\n ComponentRef,\n DestroyRef,\n Directive,\n ElementRef,\n HostListener,\n OnDestroy,\n computed,\n inject,\n input,\n signal,\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\n\nimport { QuangBaseOverlayComponent } from './quang-base-overlay.component'\n\n@Directive()\nexport abstract class QuangBaseOverlayDirective<T extends QuangBaseOverlayComponent> implements OnDestroy {\n targetComponentType = signal<ComponentType<T> | undefined>(undefined)\n\n /**\n * The amount of pixels needed for the popover to automatically disappear. If undefined the popover will not disappear on scroll\n * Default: 100\n * @default 100\n */\n scrollCloseThreshold = input<number | undefined>(100)\n\n showMethod = input<'click' | 'hover'>('click')\n\n content = input.required<any>()\n\n quangOverlayPayload = input<any>()\n\n closeOnClickOutside = true\n\n overlayPosition = input<\n 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'right'\n >('top')\n\n destroyRef = inject(DestroyRef)\n\n private top = signal<ConnectedPosition>({\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -8,\n })\n\n private topLeft = signal<ConnectedPosition>({\n originX: 'start',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom',\n offsetY: -8,\n offsetX: 40,\n })\n\n private topRight = signal<ConnectedPosition>({\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom',\n offsetY: -8,\n offsetX: 40,\n })\n\n private bottom = signal<ConnectedPosition>({\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: 8,\n })\n\n private bottomLeft = signal<ConnectedPosition>({\n originX: 'start',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n offsetY: 8,\n offsetX: 40,\n })\n\n private bottomRight = signal<ConnectedPosition>({\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n offsetY: 8,\n offsetX: 40,\n })\n\n private left = signal<ConnectedPosition>({\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -8,\n })\n\n private right = signal<ConnectedPosition>({\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: 8,\n })\n\n tooltipPosition = computed((): ConnectedPosition[] => {\n switch (this.overlayPosition()) {\n case 'top':\n return [this.top(), this.bottom()]\n case 'top-left':\n return [this.topLeft(), this.bottomLeft()]\n case 'top-right':\n return [this.topRight(), this.bottomRight()]\n case 'bottom':\n return [this.bottom(), this.top()]\n case 'bottom-left':\n return [this.bottomLeft(), this.topLeft()]\n case 'bottom-right':\n return [this.bottomRight(), this.topRight()]\n case 'left':\n return [this.left(), this.right()]\n case 'right':\n return [this.right(), this.left()]\n default:\n return [this.top(), this.bottom()]\n }\n })\n\n private overlayRef = signal<OverlayRef | null>(null)\n\n private readonly overlay = signal(inject(Overlay))\n\n private readonly overlayPositionBuilder = signal(inject(OverlayPositionBuilder))\n\n private readonly elementRef = signal(inject(ElementRef))\n\n private positionStrategy = signal<FlexibleConnectedPositionStrategy | undefined>(undefined)\n\n private componentOverlayRef = signal<ComponentRef<T> | null>(null)\n\n @HostListener('click') onClick(): void {\n if (this.showMethod() === 'click') this.showHideOverlay()\n }\n\n @HostListener('mouseenter') onHover(): void {\n if (this.showMethod() === 'hover') this.showHideOverlay()\n }\n\n @HostListener('mouseleave') onLeave(): void {\n if (this.showMethod() === 'hover') this.detachOverlay()\n }\n\n attachOverlay(): void {\n const targetComponentType = this.targetComponentType()\n if (!targetComponentType) {\n return\n }\n this.positionStrategy.set(\n this.overlayPositionBuilder().flexibleConnectedTo(this.elementRef()).withPositions(this.tooltipPosition())\n )\n\n this.overlayRef.set(\n this.overlay().create({\n positionStrategy: this.positionStrategy(),\n scrollStrategy: this.scrollCloseThreshold()\n ? this.overlay().scrollStrategies.close({ threshold: this.scrollCloseThreshold() })\n : this.overlay().scrollStrategies.noop(),\n hasBackdrop: this.showMethod() === 'click',\n backdropClass: '',\n })\n )\n\n const componentPortal = new ComponentPortal(targetComponentType)\n const createdOverlay = this.overlayRef()\n if (createdOverlay) {\n this.componentOverlayRef.set(createdOverlay.attach(componentPortal))\n const componentOverlayRefInstance = this.componentOverlayRef()?.instance\n if (componentOverlayRefInstance) {\n componentOverlayRefInstance.overlayContent = this.content\n componentOverlayRefInstance.payload = this.quangOverlayPayload\n }\n }\n this.positionStrategy()\n ?.positionChanges.pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((position) => {\n const positionRef: ConnectedOverlayPositionChange = position as ConnectedOverlayPositionChange\n const componentOverlayRefInstance = this.componentOverlayRef()?.instance\n if (componentOverlayRefInstance) {\n componentOverlayRefInstance.positionPair.set(positionRef.connectionPair)\n }\n })\n this.overlayRef()\n ?.backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n if (this.closeOnClickOutside) {\n this.detachOverlay()\n }\n })\n }\n\n detachOverlay(): void {\n this.overlayRef()?.detach()\n this.overlayRef()?.dispose()\n }\n\n showHideOverlay(): void {\n if (this.overlayRef()?.hasAttached()) {\n this.detachOverlay()\n } else {\n this.attachOverlay()\n }\n }\n\n ngOnDestroy(): void {\n this.detachOverlay()\n }\n}\n","import { Platform } from '@angular/cdk/platform'\nimport { DEFAULT_RESIZE_TIME, ViewportScrollPosition } from '@angular/cdk/scrolling'\nimport { DOCUMENT } from '@angular/common'\nimport { Inject, Injectable, NgZone, OnDestroy, Optional } from '@angular/core'\n\nimport { Observable, Subject, auditTime } from 'rxjs'\n\n/* eslint-disable */\n/**\n * Class cloe of [ViewportRuler](https://github.com/angular/components/blob/master/src/cdk/scrolling/viewport-ruler.ts)\n * To fix the wrong reported size of the viewport on mobile devices with hidden url bars\n * Issues references:\n * https://github.com/angular/components/issues/18890\n * https://github.com/angular/components/issues/27739\n *\n * To use this component provide it instead of `ViewportRuler`\n *\n * @example\n * providers: [\n * {\n * provide: ViewportRuler,\n * useClass: CustomViewportRuler\n * }\n * ]\n */\n@Injectable({ providedIn: 'root' })\nexport class CustomViewportRuler implements OnDestroy {\n /** Used to reference correct document/window */\n protected _document: Document\n /** Cached viewport dimensions. */\n private _viewportSize: { width: number; height: number } | null = null\n /** Stream of viewport change events. */\n private readonly _change = new Subject<Event>()\n\n constructor(\n private _platform: Platform,\n ngZone: NgZone,\n @Optional() @Inject(DOCUMENT) document: any\n ) {\n this._document = document\n\n ngZone.runOutsideAngular(() => {\n if (_platform.isBrowser) {\n const window = this._getWindow()\n\n // Note that bind the events ourselves, rather than going through something like RxJS's\n // `fromEvent` so that we can ensure that they're bound outside of the NgZone.\n window.addEventListener('resize', this._changeListener)\n window.addEventListener('orientationchange', this._changeListener)\n }\n\n // Clear the cached position so that the viewport is re-measured next time it is required.\n // We don't need to keep track of the subscription, because it is completed on destroy.\n this.change().subscribe(() => (this._viewportSize = null))\n })\n }\n\n ngOnDestroy() {\n if (this._platform.isBrowser) {\n const window = this._getWindow()\n window.removeEventListener('resize', this._changeListener)\n window.removeEventListener('orientationchange', this._changeListener)\n }\n\n this._change.complete()\n }\n\n /** Returns the viewport's width and height. */\n getViewportSize(): Readonly<{ width: number; height: number }> {\n if (!this._viewportSize) {\n this._updateViewportSize()\n }\n\n const output = { width: this._viewportSize!.width, height: this._viewportSize!.height }\n\n // If we're not on a browser, don't cache the size since it'll be mocked out anyway.\n if (!this._platform.isBrowser) {\n this._viewportSize = null!\n }\n\n return output\n }\n\n /** Gets a DOMRect for the viewport's bounds. */\n getViewportRect() {\n // Use the document element's bounding rect rather than the window scroll properties\n // (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll\n // properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different\n // conceptual viewports. Under most circumstances these viewports are equivalent, but they\n // can disagree when the page is pinch-zoomed (on devices that support touch).\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4\n // We use the documentElement instead of the body because, by default (without a css reset)\n // browsers typically give the document body an 8px margin, which is not included in\n // getBoundingClientRect().\n const scrollPosition = this.getViewportScrollPosition()\n const { width, height } = this.getViewportSize()\n\n return {\n top: scrollPosition.top,\n left: scrollPosition.left,\n bottom: scrollPosition.top + height,\n right: scrollPosition.left + width,\n height,\n width,\n }\n }\n\n /** Gets the (top, left) scroll position of the viewport. */\n getViewportScrollPosition(): ViewportScrollPosition {\n // While we can get a reference to the fake document\n // during SSR, it doesn't have getBoundingClientRect.\n if (!this._platform.isBrowser) {\n return { top: 0, left: 0 }\n }\n\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n const document = this._document\n const window = this._getWindow()\n const documentElement = document.documentElement!\n const documentRect = documentElement.getBoundingClientRect()\n\n const top = -documentRect.top || document.body.scrollTop || window.scrollY || documentElement.scrollTop || 0\n\n const left = -documentRect.left || document.body.scrollLeft || window.scrollX || documentElement.scrollLeft || 0\n\n return { top, left }\n }\n\n /**\n * Returns a stream that emits whenever the size of the viewport changes.\n * This stream emits outside of the Angular zone.\n * @param throttleTime Time in milliseconds to throttle the stream.\n */\n change(throttleTime: number = DEFAULT_RESIZE_TIME): Observable<Event> {\n return throttleTime > 0 ? this._change.pipe(auditTime(throttleTime)) : this._change\n }\n\n /** Event listener that will be used to handle the viewport change events. */\n private _changeListener = (event: Event) => {\n this._change.next(event)\n }\n\n /** Use defaultView of injected document if available or fallback to global window reference */\n private _getWindow(): Window {\n return this._document.defaultView || window\n }\n\n /** Updates the cached viewport size. */\n private _updateViewportSize() {\n this._viewportSize = this._platform.isBrowser\n ? { width: document.documentElement.clientWidth, height: document.documentElement.clientHeight }\n : { width: 0, height: 0 }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAQsB,yBAAyB,CAAA;AAL/C,IAAA,WAA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,CAAC,SAAS,CAAC,WAAW,IAAI,MAAM;;;IAIrC,mBAAmB,GAAA;AACzB,QAAA,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC;AAClC,cAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,YAAY;cAC5F,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;;AAlIlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,gEAWR,QAAQ,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAXnB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cADN,MAAM,EAAA,CAAA,CAAA;;4FACnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;0BAY7B;;0BAAY,MAAM;2BAAC,QAAQ;;;ACrChC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"quang-overlay-shared.mjs","sources":["../../../projects/quang/overlay/shared/quang-base-overlay.component.ts","../../../projects/quang/overlay/shared/quang-base-overlay.directive.ts","../../../projects/quang/overlay/shared/CustomViewportRuler.ts","../../../projects/quang/overlay/shared/quang-overlay-shared.ts"],"sourcesContent":["import { ConnectionPositionPair } from '@angular/cdk/overlay'\nimport { Component, input, signal } from '@angular/core'\n\n@Component({\n selector: 'quang-base-overlay-component',\n\n template: ``,\n})\nexport abstract class QuangBaseOverlayComponent {\n overlayContent = input.required<any>()\n\n payload = input<any>()\n\n positionPair = signal<ConnectionPositionPair | null>(null)\n}\n","import {\n ConnectedOverlayPositionChange,\n ConnectedPosition,\n FlexibleConnectedPositionStrategy,\n Overlay,\n OverlayPositionBuilder,\n OverlayRef,\n} from '@angular/cdk/overlay'\nimport { ComponentPortal, ComponentType } from '@angular/cdk/portal'\nimport {\n ComponentRef,\n DestroyRef,\n Directive,\n ElementRef,\n HostListener,\n OnDestroy,\n computed,\n inject,\n input,\n signal,\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\n\nimport { QuangBaseOverlayComponent } from './quang-base-overlay.component'\n\n@Directive()\nexport abstract class QuangBaseOverlayDirective<T extends QuangBaseOverlayComponent> implements OnDestroy {\n targetComponentType = signal<ComponentType<T> | undefined>(undefined)\n\n /**\n * The amount of pixels needed for the popover to automatically disappear. If undefined the popover will not disappear on scroll\n * Default: 100\n * @default 100\n */\n scrollCloseThreshold = input<number | undefined>(100)\n\n showMethod = input<'click' | 'hover'>('click')\n\n content = input.required<any>()\n\n quangOverlayPayload = input<any>()\n\n closeOnClickOutside = true\n\n overlayPosition = input<\n 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'right'\n >('top')\n\n destroyRef = inject(DestroyRef)\n\n private top = signal<ConnectedPosition>({\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -8,\n })\n\n private topLeft = signal<ConnectedPosition>({\n originX: 'start',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom',\n offsetY: -8,\n offsetX: 40,\n })\n\n private topRight = signal<ConnectedPosition>({\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom',\n offsetY: -8,\n offsetX: 40,\n })\n\n private bottom = signal<ConnectedPosition>({\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: 8,\n })\n\n private bottomLeft = signal<ConnectedPosition>({\n originX: 'start',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n offsetY: 8,\n offsetX: 40,\n })\n\n private bottomRight = signal<ConnectedPosition>({\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n offsetY: 8,\n offsetX: 40,\n })\n\n private left = signal<ConnectedPosition>({\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -8,\n })\n\n private right = signal<ConnectedPosition>({\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: 8,\n })\n\n tooltipPosition = computed((): ConnectedPosition[] => {\n switch (this.overlayPosition()) {\n case 'top':\n return [this.top(), this.bottom()]\n case 'top-left':\n return [this.topLeft(), this.bottomLeft()]\n case 'top-right':\n return [this.topRight(), this.bottomRight()]\n case 'bottom':\n return [this.bottom(), this.top()]\n case 'bottom-left':\n return [this.bottomLeft(), this.topLeft()]\n case 'bottom-right':\n return [this.bottomRight(), this.topRight()]\n case 'left':\n return [this.left(), this.right()]\n case 'right':\n return [this.right(), this.left()]\n default:\n return [this.top(), this.bottom()]\n }\n })\n\n private overlayRef = signal<OverlayRef | null>(null)\n\n private readonly overlay = signal(inject(Overlay))\n\n private readonly overlayPositionBuilder = signal(inject(OverlayPositionBuilder))\n\n private readonly elementRef = signal(inject(ElementRef))\n\n private positionStrategy = signal<FlexibleConnectedPositionStrategy | undefined>(undefined)\n\n private componentOverlayRef = signal<ComponentRef<T> | null>(null)\n\n @HostListener('click') onClick(): void {\n if (this.showMethod() === 'click') this.showHideOverlay()\n }\n\n @HostListener('mouseenter') onHover(): void {\n if (this.showMethod() === 'hover') this.showHideOverlay()\n }\n\n @HostListener('mouseleave') onLeave(): void {\n if (this.showMethod() === 'hover') this.detachOverlay()\n }\n\n attachOverlay(): void {\n const targetComponentType = this.targetComponentType()\n if (!targetComponentType) {\n return\n }\n this.positionStrategy.set(\n this.overlayPositionBuilder().flexibleConnectedTo(this.elementRef()).withPositions(this.tooltipPosition())\n )\n\n this.overlayRef.set(\n this.overlay().create({\n positionStrategy: this.positionStrategy(),\n scrollStrategy: this.scrollCloseThreshold()\n ? this.overlay().scrollStrategies.close({ threshold: this.scrollCloseThreshold() })\n : this.overlay().scrollStrategies.noop(),\n hasBackdrop: this.showMethod() === 'click',\n backdropClass: '',\n })\n )\n\n const componentPortal = new ComponentPortal(targetComponentType)\n const createdOverlay = this.overlayRef()\n if (createdOverlay) {\n this.componentOverlayRef.set(createdOverlay.attach(componentPortal))\n const componentOverlayRefInstance = this.componentOverlayRef()?.instance\n if (componentOverlayRefInstance) {\n componentOverlayRefInstance.overlayContent = this.content\n componentOverlayRefInstance.payload = this.quangOverlayPayload\n }\n }\n this.positionStrategy()\n ?.positionChanges.pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((position) => {\n const positionRef: ConnectedOverlayPositionChange = position as ConnectedOverlayPositionChange\n const componentOverlayRefInstance = this.componentOverlayRef()?.instance\n if (componentOverlayRefInstance) {\n componentOverlayRefInstance.positionPair.set(positionRef.connectionPair)\n }\n })\n this.overlayRef()\n ?.backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n if (this.closeOnClickOutside) {\n this.detachOverlay()\n }\n })\n }\n\n detachOverlay(): void {\n this.overlayRef()?.detach()\n this.overlayRef()?.dispose()\n }\n\n showHideOverlay(): void {\n if (this.overlayRef()?.hasAttached()) {\n this.detachOverlay()\n } else {\n this.attachOverlay()\n }\n }\n\n ngOnDestroy(): void {\n this.detachOverlay()\n }\n}\n","import { Platform } from '@angular/cdk/platform'\nimport { DEFAULT_RESIZE_TIME, ViewportScrollPosition } from '@angular/cdk/scrolling'\nimport { DOCUMENT, Inject, Injectable, NgZone, OnDestroy, Optional } from '@angular/core'\n\nimport { Observable, Subject, auditTime } from 'rxjs'\n\n/* eslint-disable */\n/**\n * Class cloe of [ViewportRuler](https://github.com/angular/components/blob/master/src/cdk/scrolling/viewport-ruler.ts)\n * To fix the wrong reported size of the viewport on mobile devices with hidden url bars\n * Issues references:\n * https://github.com/angular/components/issues/18890\n * https://github.com/angular/components/issues/27739\n *\n * To use this component provide it instead of `ViewportRuler`\n *\n * @example\n * providers: [\n * {\n * provide: ViewportRuler,\n * useClass: CustomViewportRuler\n * }\n * ]\n */\n@Injectable({ providedIn: 'root' })\nexport class CustomViewportRuler implements OnDestroy {\n /** Used to reference correct document/window */\n protected _document: Document\n /** Cached viewport dimensions. */\n private _viewportSize: { width: number; height: number } | null = null\n /** Stream of viewport change events. */\n private readonly _change = new Subject<Event>()\n\n constructor(\n private _platform: Platform,\n ngZone: NgZone,\n @Optional() @Inject(DOCUMENT) document: any\n ) {\n this._document = document\n\n ngZone.runOutsideAngular(() => {\n if (_platform.isBrowser) {\n const window = this._getWindow()\n\n // Note that bind the events ourselves, rather than going through something like RxJS's\n // `fromEvent` so that we can ensure that they're bound outside of the NgZone.\n window.addEventListener('resize', this._changeListener)\n window.addEventListener('orientationchange', this._changeListener)\n }\n\n // Clear the cached position so that the viewport is re-measured next time it is required.\n // We don't need to keep track of the subscription, because it is completed on destroy.\n this.change().subscribe(() => (this._viewportSize = null))\n })\n }\n\n ngOnDestroy() {\n if (this._platform.isBrowser) {\n const window = this._getWindow()\n window.removeEventListener('resize', this._changeListener)\n window.removeEventListener('orientationchange', this._changeListener)\n }\n\n this._change.complete()\n }\n\n /** Returns the viewport's width and height. */\n getViewportSize(): Readonly<{ width: number; height: number }> {\n if (!this._viewportSize) {\n this._updateViewportSize()\n }\n\n const output = { width: this._viewportSize!.width, height: this._viewportSize!.height }\n\n // If we're not on a browser, don't cache the size since it'll be mocked out anyway.\n if (!this._platform.isBrowser) {\n this._viewportSize = null!\n }\n\n return output\n }\n\n /** Gets a DOMRect for the viewport's bounds. */\n getViewportRect() {\n // Use the document element's bounding rect rather than the window scroll properties\n // (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll\n // properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different\n // conceptual viewports. Under most circumstances these viewports are equivalent, but they\n // can disagree when the page is pinch-zoomed (on devices that support touch).\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4\n // We use the documentElement instead of the body because, by default (without a css reset)\n // browsers typically give the document body an 8px margin, which is not included in\n // getBoundingClientRect().\n const scrollPosition = this.getViewportScrollPosition()\n const { width, height } = this.getViewportSize()\n\n return {\n top: scrollPosition.top,\n left: scrollPosition.left,\n bottom: scrollPosition.top + height,\n right: scrollPosition.left + width,\n height,\n width,\n }\n }\n\n /** Gets the (top, left) scroll position of the viewport. */\n getViewportScrollPosition(): ViewportScrollPosition {\n // While we can get a reference to the fake document\n // during SSR, it doesn't have getBoundingClientRect.\n if (!this._platform.isBrowser) {\n return { top: 0, left: 0 }\n }\n\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n const document = this._document\n const window = this._getWindow()\n const documentElement = document.documentElement!\n const documentRect = documentElement.getBoundingClientRect()\n\n const top = -documentRect.top || document.body.scrollTop || window.scrollY || documentElement.scrollTop || 0\n\n const left = -documentRect.left || document.body.scrollLeft || window.scrollX || documentElement.scrollLeft || 0\n\n return { top, left }\n }\n\n /**\n * Returns a stream that emits whenever the size of the viewport changes.\n * This stream emits outside of the Angular zone.\n * @param throttleTime Time in milliseconds to throttle the stream.\n */\n change(throttleTime: number = DEFAULT_RESIZE_TIME): Observable<Event> {\n return throttleTime > 0 ? this._change.pipe(auditTime(throttleTime)) : this._change\n }\n\n /** Event listener that will be used to handle the viewport change events. */\n private _changeListener = (event: Event) => {\n this._change.next(event)\n }\n\n /** Use defaultView of injected document if available or fallback to global window reference */\n private _getWindow(): Window {\n return this._document.defaultView || window\n }\n\n /** Updates the cached viewport size. */\n private _updateViewportSize() {\n this._viewportSize = this._platform.isBrowser\n ? { width: document.documentElement.clientWidth, height: document.documentElement.clientHeight }\n : { width: 0, height: 0 }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAQsB,yBAAyB,CAAA;AAL/C,IAAA,WAAA,GAAA;AAME,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAC,QAAQ,EAAO;QAEtC,IAAO,CAAA,OAAA,GAAG,KAAK,EAAO;AAEtB,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAgC,IAAI,CAAC;AAC3D;8GANqB,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAzB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAyB,oXAFnC,CAAE,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;2FAEQ,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAL9C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,8BAA8B;AAExC,oBAAA,QAAQ,EAAE,CAAE,CAAA;AACb,iBAAA;;;MCmBqB,yBAAyB,CAAA;AAD/C,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,mBAAmB,GAAG,MAAM,CAA+B,SAAS,CAAC;AAErE;;;;AAIG;AACH,QAAA,IAAA,CAAA,oBAAoB,GAAG,KAAK,CAAqB,GAAG,CAAC;AAErD,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAoB,OAAO,CAAC;AAE9C,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAO;QAE/B,IA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k/overlay';
|
|
2
|
-
import { NgClass, DatePipe,
|
|
2
|
+
import { NgClass, DatePipe, NgTemplateOutlet } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { computed, signal, Injectable, inject, input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
5
|
import { toObservable, toSignal } from '@angular/core/rxjs-interop';
|
|
@@ -40,10 +40,10 @@ class QuangToastService {
|
|
|
40
40
|
this.currentToast.set(null);
|
|
41
41
|
patchState(this.toastState, { count: this.count() - 1 });
|
|
42
42
|
}
|
|
43
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
44
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
43
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
44
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangToastService, providedIn: 'root' }); }
|
|
45
45
|
}
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangToastService, decorators: [{
|
|
47
47
|
type: Injectable,
|
|
48
48
|
args: [{
|
|
49
49
|
providedIn: 'root',
|
|
@@ -89,12 +89,12 @@ class QuangToastComponent {
|
|
|
89
89
|
close() {
|
|
90
90
|
this.toastService().closeToast();
|
|
91
91
|
}
|
|
92
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
93
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
92
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
93
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: QuangToastComponent, isStandalone: true, selector: "quang-toast", inputs: { showAtLeastFor: { classPropertyName: "showAtLeastFor", publicName: "showAtLeastFor", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n [class.hide]=\"!isShowing()\"\n [class.show]=\"isShowing()\"\n [ngClass]=\"[_currentToast()?.position ?? '', _currentToast()?.type ?? '']\"\n aria-atomic=\"true\"\n aria-live=\"assertive\"\n class=\"toast fade\"\n role=\"alert\"\n>\n @if (!_currentToast()?.hideHeader) {\n <div class=\"toast-header\">\n @if (!_currentToast()?.customIcon) {\n <span\n [ngClass]=\"_currentToast()?.type\"\n class=\"rounded me-2\"\n ></span>\n }\n @if (_currentToast()?.customIcon) {\n <img\n [src]=\"_currentToast()?.customIcon\"\n alt=\"\"\n />\n }\n @if (_currentToast()?.title) {\n <strong class=\"me-auto\">{{ _currentToast()?.title | transloco }}</strong>\n }\n @if (_currentToast()?.date) {\n <small>{{ _currentToast()?.date ?? '' | date: _currentToast()?.dateFormat }}</small>\n }\n @if (_currentToast()?.showCloseButton) {\n <button\n (click)=\"close()\"\n aria-label=\"Close\"\n class=\"ms-2 mb-1 btn-close\"\n data-dismiss=\"toast\"\n type=\"button\"\n >\n <span aria-hidden=\"true\"></span>\n </button>\n }\n </div>\n }\n @if (_currentToast()?.text) {\n <div class=\"toast-body\">\n {{ _currentToast()?.text?.trim() | transloco: { textValue: _currentToast()?.textValue?.trim() } }}\n </div>\n }\n <ng-container *ngTemplateOutlet=\"_currentToast()?.customTemplate ?? null\"></ng-container>\n</div>\n", styles: [".toast{position:fixed;min-width:200px;z-index:999999}.toast.top-left{top:2rem;left:1rem}.toast.top-right{top:2rem;right:1rem}.toast.bottom-left{bottom:1rem;left:1rem}.toast.bottom-right{bottom:1rem;right:1rem}.toast.center{top:50%;left:50%;transform:translate(-50%,-50%)}.toast.top-center{top:2rem;left:50%;transform:translate(-50%)}.toast.bottom-center{bottom:1rem;left:50%;transform:translate(-50%)}.toast .toast-header{background-color:unset}.toast .toast-header .rounded{height:1.125rem;width:1.125rem;display:inline-block}.toast .toast-header .rounded.success{background:#28a745}.toast .toast-header .rounded.warning{background:#ffc107}.toast .toast-header .rounded.error{background:#dc3545}.toast .toast-header button:focus{box-shadow:unset}.toast small{margin-left:1rem}\n"], dependencies: [{ kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
94
94
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangToastComponent, decorators: [{
|
|
96
96
|
type: Component,
|
|
97
|
-
args: [{ selector: 'quang-toast', imports: [OverlayModule, NgClass, TranslocoPipe, DatePipe,
|
|
97
|
+
args: [{ selector: 'quang-toast', imports: [OverlayModule, NgClass, TranslocoPipe, DatePipe, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [class.hide]=\"!isShowing()\"\n [class.show]=\"isShowing()\"\n [ngClass]=\"[_currentToast()?.position ?? '', _currentToast()?.type ?? '']\"\n aria-atomic=\"true\"\n aria-live=\"assertive\"\n class=\"toast fade\"\n role=\"alert\"\n>\n @if (!_currentToast()?.hideHeader) {\n <div class=\"toast-header\">\n @if (!_currentToast()?.customIcon) {\n <span\n [ngClass]=\"_currentToast()?.type\"\n class=\"rounded me-2\"\n ></span>\n }\n @if (_currentToast()?.customIcon) {\n <img\n [src]=\"_currentToast()?.customIcon\"\n alt=\"\"\n />\n }\n @if (_currentToast()?.title) {\n <strong class=\"me-auto\">{{ _currentToast()?.title | transloco }}</strong>\n }\n @if (_currentToast()?.date) {\n <small>{{ _currentToast()?.date ?? '' | date: _currentToast()?.dateFormat }}</small>\n }\n @if (_currentToast()?.showCloseButton) {\n <button\n (click)=\"close()\"\n aria-label=\"Close\"\n class=\"ms-2 mb-1 btn-close\"\n data-dismiss=\"toast\"\n type=\"button\"\n >\n <span aria-hidden=\"true\"></span>\n </button>\n }\n </div>\n }\n @if (_currentToast()?.text) {\n <div class=\"toast-body\">\n {{ _currentToast()?.text?.trim() | transloco: { textValue: _currentToast()?.textValue?.trim() } }}\n </div>\n }\n <ng-container *ngTemplateOutlet=\"_currentToast()?.customTemplate ?? null\"></ng-container>\n</div>\n", styles: [".toast{position:fixed;min-width:200px;z-index:999999}.toast.top-left{top:2rem;left:1rem}.toast.top-right{top:2rem;right:1rem}.toast.bottom-left{bottom:1rem;left:1rem}.toast.bottom-right{bottom:1rem;right:1rem}.toast.center{top:50%;left:50%;transform:translate(-50%,-50%)}.toast.top-center{top:2rem;left:50%;transform:translate(-50%)}.toast.bottom-center{bottom:1rem;left:50%;transform:translate(-50%)}.toast .toast-header{background-color:unset}.toast .toast-header .rounded{height:1.125rem;width:1.125rem;display:inline-block}.toast .toast-header .rounded.success{background:#28a745}.toast .toast-header .rounded.warning{background:#ffc107}.toast .toast-header .rounded.error{background:#dc3545}.toast .toast-header button:focus{box-shadow:unset}.toast small{margin-left:1rem}\n"] }]
|
|
98
98
|
}] });
|
|
99
99
|
|
|
100
100
|
/**
|