quang 20.3.2 → 20.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/fesm2022/quang-auth-mobile.mjs.map +1 -1
  2. package/fesm2022/quang-auth.mjs +18 -18
  3. package/fesm2022/quang-auth.mjs.map +1 -1
  4. package/fesm2022/quang-components-autocomplete.mjs +3 -3
  5. package/fesm2022/quang-components-autocomplete.mjs.map +1 -1
  6. package/fesm2022/quang-components-checkbox.mjs +3 -3
  7. package/fesm2022/quang-components-checkbox.mjs.map +1 -1
  8. package/fesm2022/quang-components-date.mjs +4 -4
  9. package/fesm2022/quang-components-date.mjs.map +1 -1
  10. package/fesm2022/quang-components-input.mjs +3 -3
  11. package/fesm2022/quang-components-input.mjs.map +1 -1
  12. package/fesm2022/quang-components-paginator.mjs +13 -13
  13. package/fesm2022/quang-components-paginator.mjs.map +1 -1
  14. package/fesm2022/quang-components-select.mjs +3 -3
  15. package/fesm2022/quang-components-select.mjs.map +1 -1
  16. package/fesm2022/quang-components-shared.mjs +6 -6
  17. package/fesm2022/quang-components-shared.mjs.map +1 -1
  18. package/fesm2022/quang-components-table.mjs +3 -3
  19. package/fesm2022/quang-components-table.mjs.map +1 -1
  20. package/fesm2022/quang-components-wysiwyg.mjs +3 -3
  21. package/fesm2022/quang-components-wysiwyg.mjs.map +1 -1
  22. package/fesm2022/quang-data-handling.mjs.map +1 -1
  23. package/fesm2022/quang-device.mjs +3 -3
  24. package/fesm2022/quang-device.mjs.map +1 -1
  25. package/fesm2022/quang-forms.mjs.map +1 -1
  26. package/fesm2022/quang-loader.mjs +6 -6
  27. package/fesm2022/quang-loader.mjs.map +1 -1
  28. package/fesm2022/quang-overlay-modal.mjs +6 -6
  29. package/fesm2022/quang-overlay-modal.mjs.map +1 -1
  30. package/fesm2022/quang-overlay-popover.mjs +6 -6
  31. package/fesm2022/quang-overlay-popover.mjs.map +1 -1
  32. package/fesm2022/quang-overlay-shared.mjs +9 -9
  33. package/fesm2022/quang-overlay-shared.mjs.map +1 -1
  34. package/fesm2022/quang-overlay-toast.mjs +6 -6
  35. package/fesm2022/quang-overlay-toast.mjs.map +1 -1
  36. package/fesm2022/quang-overlay-tooltip.mjs +6 -6
  37. package/fesm2022/quang-overlay-tooltip.mjs.map +1 -1
  38. package/fesm2022/quang-shared.mjs.map +1 -1
  39. package/fesm2022/quang-translation.mjs +6 -6
  40. package/fesm2022/quang-translation.mjs.map +1 -1
  41. package/package.json +15 -15
@@ -202,8 +202,8 @@ class QuangWysiwygComponent extends QuangBaseComponent {
202
202
  }
203
203
  return buttonList;
204
204
  }
205
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: QuangWysiwygComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
206
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: QuangWysiwygComponent, isStandalone: true, selector: "quang-wysiwyg", inputs: { minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, font: { classPropertyName: "font", publicName: "font", isSignal: true, isRequired: false, transformFunction: null }, fontSize: { classPropertyName: "fontSize", publicName: "fontSize", isSignal: true, isRequired: false, transformFunction: null }, formatBlock: { classPropertyName: "formatBlock", publicName: "formatBlock", isSignal: true, isRequired: false, transformFunction: null }, paragraphStyle: { classPropertyName: "paragraphStyle", publicName: "paragraphStyle", isSignal: true, isRequired: false, transformFunction: null }, blockquote: { classPropertyName: "blockquote", publicName: "blockquote", isSignal: true, isRequired: false, transformFunction: null }, bold: { classPropertyName: "bold", publicName: "bold", isSignal: true, isRequired: false, transformFunction: null }, underline: { classPropertyName: "underline", publicName: "underline", isSignal: true, isRequired: false, transformFunction: null }, italic: { classPropertyName: "italic", publicName: "italic", isSignal: true, isRequired: false, transformFunction: null }, strike: { classPropertyName: "strike", publicName: "strike", isSignal: true, isRequired: false, transformFunction: null }, fontColor: { classPropertyName: "fontColor", publicName: "fontColor", isSignal: true, isRequired: false, transformFunction: null }, highlightColor: { classPropertyName: "highlightColor", publicName: "highlightColor", isSignal: true, isRequired: false, transformFunction: null }, textStyle: { classPropertyName: "textStyle", publicName: "textStyle", isSignal: true, isRequired: false, transformFunction: null }, removeFormat: { classPropertyName: "removeFormat", publicName: "removeFormat", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, list: { classPropertyName: "list", publicName: "list", isSignal: true, isRequired: false, transformFunction: null }, table: { classPropertyName: "table", publicName: "table", isSignal: true, isRequired: false, transformFunction: null }, link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: false, transformFunction: null }, image: { classPropertyName: "image", publicName: "image", isSignal: true, isRequired: false, transformFunction: null }, fullScreen: { classPropertyName: "fullScreen", publicName: "fullScreen", isSignal: true, isRequired: false, transformFunction: null }, showBlocks: { classPropertyName: "showBlocks", publicName: "showBlocks", isSignal: true, isRequired: false, transformFunction: null }, onImageUploadError: { classPropertyName: "onImageUploadError", publicName: "onImageUploadError", isSignal: true, isRequired: false, transformFunction: null }, onFileDrop: { classPropertyName: "onFileDrop", publicName: "onFileDrop", isSignal: true, isRequired: false, transformFunction: null }, wysiwygOptions: { classPropertyName: "wysiwygOptions", publicName: "wysiwygOptions", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
205
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: QuangWysiwygComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
206
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.1", type: QuangWysiwygComponent, isStandalone: true, selector: "quang-wysiwyg", inputs: { minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, font: { classPropertyName: "font", publicName: "font", isSignal: true, isRequired: false, transformFunction: null }, fontSize: { classPropertyName: "fontSize", publicName: "fontSize", isSignal: true, isRequired: false, transformFunction: null }, formatBlock: { classPropertyName: "formatBlock", publicName: "formatBlock", isSignal: true, isRequired: false, transformFunction: null }, paragraphStyle: { classPropertyName: "paragraphStyle", publicName: "paragraphStyle", isSignal: true, isRequired: false, transformFunction: null }, blockquote: { classPropertyName: "blockquote", publicName: "blockquote", isSignal: true, isRequired: false, transformFunction: null }, bold: { classPropertyName: "bold", publicName: "bold", isSignal: true, isRequired: false, transformFunction: null }, underline: { classPropertyName: "underline", publicName: "underline", isSignal: true, isRequired: false, transformFunction: null }, italic: { classPropertyName: "italic", publicName: "italic", isSignal: true, isRequired: false, transformFunction: null }, strike: { classPropertyName: "strike", publicName: "strike", isSignal: true, isRequired: false, transformFunction: null }, fontColor: { classPropertyName: "fontColor", publicName: "fontColor", isSignal: true, isRequired: false, transformFunction: null }, highlightColor: { classPropertyName: "highlightColor", publicName: "highlightColor", isSignal: true, isRequired: false, transformFunction: null }, textStyle: { classPropertyName: "textStyle", publicName: "textStyle", isSignal: true, isRequired: false, transformFunction: null }, removeFormat: { classPropertyName: "removeFormat", publicName: "removeFormat", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, list: { classPropertyName: "list", publicName: "list", isSignal: true, isRequired: false, transformFunction: null }, table: { classPropertyName: "table", publicName: "table", isSignal: true, isRequired: false, transformFunction: null }, link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: false, transformFunction: null }, image: { classPropertyName: "image", publicName: "image", isSignal: true, isRequired: false, transformFunction: null }, fullScreen: { classPropertyName: "fullScreen", publicName: "fullScreen", isSignal: true, isRequired: false, transformFunction: null }, showBlocks: { classPropertyName: "showBlocks", publicName: "showBlocks", isSignal: true, isRequired: false, transformFunction: null }, onImageUploadError: { classPropertyName: "onImageUploadError", publicName: "onImageUploadError", isSignal: true, isRequired: false, transformFunction: null }, onFileDrop: { classPropertyName: "onFileDrop", publicName: "onFileDrop", isSignal: true, isRequired: false, transformFunction: null }, wysiwygOptions: { classPropertyName: "wysiwygOptions", publicName: "wysiwygOptions", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
207
207
  {
208
208
  provide: NG_VALUE_ACCESSOR,
209
209
  useExisting: forwardRef(() => QuangWysiwygComponent),
@@ -211,7 +211,7 @@ class QuangWysiwygComponent extends QuangBaseComponent {
211
211
  },
212
212
  ], viewQueries: [{ propertyName: "_inputForWysiwyg", first: true, predicate: ["inputForWysiwyg"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"mb-3\">\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n class=\"form-label d-flex gap-2\"\n >\n <div>\n <span>{{ componentLabel() | transloco }}</span>\n <span [hidden]=\"!_isRequired()\">*</span>\n </div>\n @if (helpMessage() && helpMessageTooltip()) {\n <div [quangTooltip]=\"helpMessage() | transloco\">\n <ng-content select=\"[help-icon]\" />\n </div>\n }\n </label>\n }\n <div\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n class=\"input-wysiwyg-container is-invalid\"\n >\n <textarea\n [disabled]=\"_isDisabled()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [readOnly]=\"isReadonly()\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_value()\"\n #inputForWysiwyg\n class=\"form-control\"\n ></textarea>\n </div>\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n @if (helpMessage() && !helpMessageTooltip()) {\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n }\n</div>\n", styles: [":host{display:block}::ng-deep .se-toolbar{color:var(--bs-body-color)!important;background-color:var(--bs-body-bg)!important;z-index:unset!important}::ng-deep .se-wrapper-inner{color:var(--bs-body-color)!important;background-color:var(--bs-body-bg)!important}::ng-deep .se-btn{color:var(--bs-body-color)!important}::ng-deep .se-btn:enabled.active{color:var(--bs-primary)!important}::ng-deep .se-btn:hover{background-color:var(--bs-secondary-bg)!important}::ng-deep .se-resizing-bar{color:var(--bs-body-color)!important;background-color:var(--bs-body-bg)!important}::ng-deep .se-navigation{color:var(--bs-body-color)!important;background-color:var(--bs-body-bg)!important}::ng-deep .sun-editor input{display:none}::ng-deep .sun-editor .se-container{border-radius:var(--bs-border-radius)}::ng-deep .se-wrapper{z-index:unset!important}::ng-deep .se-wrapper textarea:disabled+.se-wrapper-wysiwyg{background-color:var(--bs-secondary-bg)}::ng-deep .se-wrapper .se-wrapper-inner{border-top:1px solid var(--bs-border-color)}::ng-deep .is-invalid .sun-editor .se-container .se-toolbar{border-bottom:1px solid var(--bs-danger)}::ng-deep .is-invalid .sun-editor .se-container .se-wrapper .se-wrapper-inner{--bs-form-bg-icon: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e\");border:1px solid var(--bs-danger);padding-right:3rem;background-position:right .75rem center,center right 2.25rem;background-size:1.5rem,calc(.75em + .375rem) calc(.75em + .375rem);background-image:var(--bs-form-bg-icon);background-repeat:no-repeat}::ng-deep .is-valid .sun-editor .se-container .se-toolbar{border-bottom:1px solid var(--bs-success)}::ng-deep .is-valid .sun-editor .se-container .se-wrapper .se-wrapper-inner{--bs-form-bg-icon: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e\");border:1px solid var(--bs-success);padding-right:3rem;background-position:right .75rem center,center right 2.25rem;background-size:1.5rem,calc(.75em + .375rem) calc(.75em + .375rem);background-image:var(--bs-form-bg-icon);background-repeat:no-repeat}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: QuangTooltipDirective, selector: "[quangTooltip]", inputs: ["quangTooltip", "showMethod"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
213
213
  }
214
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: QuangWysiwygComponent, decorators: [{
214
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: QuangWysiwygComponent, decorators: [{
215
215
  type: Component,
216
216
  args: [{ selector: 'quang-wysiwyg', providers: [
217
217
  {
@@ -1 +1 @@
1
- {"version":3,"file":"quang-components-wysiwyg.mjs","sources":["../../../projects/quang/components/wysiwyg/wysiwyg.component.ts","../../../projects/quang/components/wysiwyg/wysiwyg.component.html","../../../projects/quang/components/wysiwyg/quang-components-wysiwyg.ts"],"sourcesContent":["import { NgClass } from '@angular/common'\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n effect,\n forwardRef,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core'\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop'\nimport { AbstractControl, NG_VALUE_ACCESSOR, ValidationErrors, Validators } from '@angular/forms'\n\nimport { TranslocoPipe } from '@jsverse/transloco'\nimport { QuangTooltipDirective } from 'quang/overlay/tooltip'\nimport { filter, take } from 'rxjs'\nimport sunEditor from 'suneditor'\nimport SunEditorCore from 'suneditor/src/lib/core'\nimport { SunEditorOptions } from 'suneditor/src/options'\nimport plugins from 'suneditor/src/plugins'\n\nimport { QuangBaseComponent } from 'quang/components/shared'\n\nexport type QuangWysiwygOptions = SunEditorOptions\n\n@Component({\n selector: 'quang-wysiwyg',\n templateUrl: './wysiwyg.component.html',\n styleUrl: './wysiwyg.component.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => QuangWysiwygComponent),\n multi: true,\n },\n ],\n imports: [TranslocoPipe, NgClass, QuangTooltipDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/**\n * WYSIWYG (What You See Is What You Get) component based on {@link https://github.com/JiHong88/SunEditor}.\n *\n * This component provides a rich text editor for users to create and edit HTML content.\n * It supports a wide range of formatting options.\n *\n * @usageNotes\n * The component allows you to show or hide buttons from the WYSIWYG editor.\n * By default, all the available buttons are shown in the editor bar.\n *\n * The height of the editor can be customized by setting the `minHeight` property. By default, it is `200px`.\n */\nexport class QuangWysiwygComponent extends QuangBaseComponent<string> implements AfterViewInit {\n _inputForWysiwyg = viewChild<ElementRef>('inputForWysiwyg')\n\n minHeight = input<string | undefined>('200px')\n\n font = input<boolean>(true)\n\n fontSize = input<boolean>(true)\n\n formatBlock = input<boolean>(true)\n\n paragraphStyle = input<boolean>(true)\n\n blockquote = input<boolean>(true)\n\n bold = input<boolean>(true)\n\n underline = input<boolean>(true)\n\n italic = input<boolean>(true)\n\n strike = input<boolean>(true)\n\n fontColor = input<boolean>(true)\n\n highlightColor = input<boolean>(true)\n\n textStyle = input<boolean>(true)\n\n removeFormat = input<boolean>(true)\n\n align = input<boolean>(true)\n\n list = input<boolean>(true)\n\n table = input<boolean>(true)\n\n link = input<boolean>(true)\n\n image = input<boolean>(true)\n\n fullScreen = input<boolean>(true)\n\n showBlocks = input<boolean>(true)\n\n onImageUploadError = input<(errorMessage: any, result: any, core: any) => boolean>()\n onFileDrop = input<(e: any, cleanData: any, maxCharCount: any, core: any) => boolean>()\n\n wysiwygOptions = input<QuangWysiwygOptions | undefined>(undefined)\n\n _sunEditorWysiwygInstance = signal<SunEditorCore | undefined>(undefined)\n _sunEditorWysiwygInstance$ = toObservable(this._sunEditorWysiwygInstance)\n\n changeDetectorRef = signal(inject(ChangeDetectorRef))\n\n _generateSunEditorWysiwygEffect = effect(() => {\n try {\n const inputForWysiwyg = this._inputForWysiwyg()?.nativeElement\n if (inputForWysiwyg) {\n const sunEditorOptions: SunEditorOptions = {\n plugins,\n defaultTag: 'div',\n buttonList: this._ngControl()?.control?.enabled && !this.isReadonly() ? [this.getButtonList()] : [],\n minHeight: this.minHeight(),\n width: '100%',\n ...(this.wysiwygOptions() ?? {}),\n }\n\n let sunEditorWysiwygInstance = this._sunEditorWysiwygInstance()\n const ngControl = this._ngControl()\n\n if (sunEditorWysiwygInstance) {\n if (ngControl?.control?.enabled) {\n sunEditorWysiwygInstance.enable()\n }\n sunEditorWysiwygInstance.setOptions(sunEditorOptions)\n } else {\n sunEditorWysiwygInstance = sunEditor.create(inputForWysiwyg, sunEditorOptions)\n this._sunEditorWysiwygInstance.set(sunEditorWysiwygInstance)\n }\n\n const imageUploadError = this.onImageUploadError()\n const onFileDrop = this.onFileDrop()\n\n if (imageUploadError && sunEditorWysiwygInstance) {\n sunEditorWysiwygInstance.onImageUploadError = imageUploadError\n }\n if (onFileDrop && sunEditorWysiwygInstance) {\n sunEditorWysiwygInstance.onDrop = onFileDrop\n }\n\n this.registerEvents()\n }\n } catch (_) {\n // we usually end up here when we are in a modal and then it starts in the right way\n }\n })\n\n STRIP_HTML_REGEX = /<[^>]*>/g\n\n registerEvents(): void {\n const sunEditorInstance = this._sunEditorWysiwygInstance()\n if (sunEditorInstance) {\n sunEditorInstance.onChange = (contents) => {\n this.onChangedHandler(contents)\n this.changeDetectorRef().markForCheck()\n }\n sunEditorInstance.onBlur = () => {\n this.onBlurHandler()\n }\n if (this._isDisabled()) {\n sunEditorInstance.disable()\n }\n }\n }\n\n override writeValue(val: string): void {\n super.writeValue(val)\n this._sunEditorWysiwygInstance$\n .pipe(\n takeUntilDestroyed(this.destroyRef),\n filter((x) => !!x),\n take(1)\n )\n .subscribe((sunEditorWysiwygInstance) => {\n if (sunEditorWysiwygInstance) {\n try {\n sunEditorWysiwygInstance.setContents(val)\n } catch (_) {\n // we usually end up here when we are in a modal and then it starts in the right way\n }\n }\n })\n }\n\n validate(control: AbstractControl): ValidationErrors | null {\n if (control.hasValidator(Validators.required) && control.value?.replace(this.STRIP_HTML_REGEX, '') === '') {\n return { required: true }\n }\n return null\n }\n\n override onChangedHandler(value: string): void {\n super.onChangedHandler(value)\n const control = this._ngControl()\n if (control?.control) {\n if (this.validate(control.control)) control.control.setErrors(this.validate(control.control))\n }\n }\n\n getButtonList(): string[] {\n const buttonList: string[] = []\n if (this.font()) {\n buttonList.push('font')\n }\n if (this.fontSize()) {\n buttonList.push('fontSize')\n }\n if (this.formatBlock()) {\n buttonList.push('formatBlock')\n }\n if (this.paragraphStyle()) {\n buttonList.push('paragraphStyle')\n }\n if (this.blockquote()) {\n buttonList.push('blockquote')\n }\n if (this.bold()) {\n buttonList.push('bold')\n }\n if (this.underline()) {\n buttonList.push('underline')\n }\n if (this.italic()) {\n buttonList.push('italic')\n }\n if (this.strike()) {\n buttonList.push('strike')\n }\n if (this.fontColor()) {\n buttonList.push('fontColor')\n }\n if (this.highlightColor()) {\n buttonList.push('hiliteColor')\n }\n if (this.textStyle()) {\n buttonList.push('textStyle')\n }\n if (this.removeFormat()) {\n buttonList.push('removeFormat')\n }\n if (this.align()) {\n buttonList.push('align')\n }\n if (this.list()) {\n buttonList.push('list')\n }\n if (this.table()) {\n buttonList.push('table')\n }\n if (this.link()) {\n buttonList.push('link')\n }\n if (this.image()) {\n buttonList.push('image')\n }\n if (this.fullScreen()) {\n buttonList.push('fullScreen')\n }\n if (this.showBlocks()) {\n buttonList.push('showBlocks')\n }\n return buttonList\n }\n}\n","<div class=\"mb-3\">\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n class=\"form-label d-flex gap-2\"\n >\n <div>\n <span>{{ componentLabel() | transloco }}</span>\n <span [hidden]=\"!_isRequired()\">*</span>\n </div>\n @if (helpMessage() && helpMessageTooltip()) {\n <div [quangTooltip]=\"helpMessage() | transloco\">\n <ng-content select=\"[help-icon]\" />\n </div>\n }\n </label>\n }\n <div\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n class=\"input-wysiwyg-container is-invalid\"\n >\n <textarea\n [disabled]=\"_isDisabled()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [readOnly]=\"isReadonly()\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_value()\"\n #inputForWysiwyg\n class=\"form-control\"\n ></textarea>\n </div>\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n @if (helpMessage() && !helpMessageTooltip()) {\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AA2CA;;;;;;;;;;;AAWG;AACG,MAAO,qBAAsB,SAAQ,kBAA0B,CAAA;AA1BrE,IAAA,WAAA,GAAA;;AA2BE,QAAA,IAAA,CAAA,gBAAgB,GAAG,SAAS,CAAa,iBAAiB,4DAAC;AAE3D,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAqB,OAAO,qDAAC;AAE9C,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAU,IAAI,gDAAC;AAE3B,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,IAAI,oDAAC;AAE/B,QAAA,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OAAO,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,qBAAqB,8FAA7C,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAeZ,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBA1BjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,SAAA,EAGd;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,2BAA2B,CAAC;AACpD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;qBACF,EAAA,OAAA,EACQ,CAAC,aAAa,EAAE,OAAO,EAAE,qBAAqB,CAAC,EAAA,eAAA,EACvC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,07CAAA,EAAA,MAAA,EAAA,CAAA,g6EAAA,CAAA,EAAA;;;AEzCjD;;AAEG;;;;"}
1
+ {"version":3,"file":"quang-components-wysiwyg.mjs","sources":["../../../projects/quang/components/wysiwyg/wysiwyg.component.ts","../../../projects/quang/components/wysiwyg/wysiwyg.component.html","../../../projects/quang/components/wysiwyg/quang-components-wysiwyg.ts"],"sourcesContent":["import { NgClass } from '@angular/common'\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n effect,\n forwardRef,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core'\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop'\nimport { AbstractControl, NG_VALUE_ACCESSOR, ValidationErrors, Validators } from '@angular/forms'\n\nimport { TranslocoPipe } from '@jsverse/transloco'\nimport { QuangTooltipDirective } from 'quang/overlay/tooltip'\nimport { filter, take } from 'rxjs'\nimport sunEditor from 'suneditor'\nimport SunEditorCore from 'suneditor/src/lib/core'\nimport { SunEditorOptions } from 'suneditor/src/options'\nimport plugins from 'suneditor/src/plugins'\n\nimport { QuangBaseComponent } from 'quang/components/shared'\n\nexport type QuangWysiwygOptions = SunEditorOptions\n\n@Component({\n selector: 'quang-wysiwyg',\n templateUrl: './wysiwyg.component.html',\n styleUrl: './wysiwyg.component.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => QuangWysiwygComponent),\n multi: true,\n },\n ],\n imports: [TranslocoPipe, NgClass, QuangTooltipDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/**\n * WYSIWYG (What You See Is What You Get) component based on {@link https://github.com/JiHong88/SunEditor}.\n *\n * This component provides a rich text editor for users to create and edit HTML content.\n * It supports a wide range of formatting options.\n *\n * @usageNotes\n * The component allows you to show or hide buttons from the WYSIWYG editor.\n * By default, all the available buttons are shown in the editor bar.\n *\n * The height of the editor can be customized by setting the `minHeight` property. By default, it is `200px`.\n */\nexport class QuangWysiwygComponent extends QuangBaseComponent<string> implements AfterViewInit {\n _inputForWysiwyg = viewChild<ElementRef>('inputForWysiwyg')\n\n minHeight = input<string | undefined>('200px')\n\n font = input<boolean>(true)\n\n fontSize = input<boolean>(true)\n\n formatBlock = input<boolean>(true)\n\n paragraphStyle = input<boolean>(true)\n\n blockquote = input<boolean>(true)\n\n bold = input<boolean>(true)\n\n underline = input<boolean>(true)\n\n italic = input<boolean>(true)\n\n strike = input<boolean>(true)\n\n fontColor = input<boolean>(true)\n\n highlightColor = input<boolean>(true)\n\n textStyle = input<boolean>(true)\n\n removeFormat = input<boolean>(true)\n\n align = input<boolean>(true)\n\n list = input<boolean>(true)\n\n table = input<boolean>(true)\n\n link = input<boolean>(true)\n\n image = input<boolean>(true)\n\n fullScreen = input<boolean>(true)\n\n showBlocks = input<boolean>(true)\n\n onImageUploadError = input<(errorMessage: any, result: any, core: any) => boolean>()\n onFileDrop = input<(e: any, cleanData: any, maxCharCount: any, core: any) => boolean>()\n\n wysiwygOptions = input<QuangWysiwygOptions | undefined>(undefined)\n\n _sunEditorWysiwygInstance = signal<SunEditorCore | undefined>(undefined)\n _sunEditorWysiwygInstance$ = toObservable(this._sunEditorWysiwygInstance)\n\n changeDetectorRef = signal(inject(ChangeDetectorRef))\n\n _generateSunEditorWysiwygEffect = effect(() => {\n try {\n const inputForWysiwyg = this._inputForWysiwyg()?.nativeElement\n if (inputForWysiwyg) {\n const sunEditorOptions: SunEditorOptions = {\n plugins,\n defaultTag: 'div',\n buttonList: this._ngControl()?.control?.enabled && !this.isReadonly() ? [this.getButtonList()] : [],\n minHeight: this.minHeight(),\n width: '100%',\n ...(this.wysiwygOptions() ?? {}),\n }\n\n let sunEditorWysiwygInstance = this._sunEditorWysiwygInstance()\n const ngControl = this._ngControl()\n\n if (sunEditorWysiwygInstance) {\n if (ngControl?.control?.enabled) {\n sunEditorWysiwygInstance.enable()\n }\n sunEditorWysiwygInstance.setOptions(sunEditorOptions)\n } else {\n sunEditorWysiwygInstance = sunEditor.create(inputForWysiwyg, sunEditorOptions)\n this._sunEditorWysiwygInstance.set(sunEditorWysiwygInstance)\n }\n\n const imageUploadError = this.onImageUploadError()\n const onFileDrop = this.onFileDrop()\n\n if (imageUploadError && sunEditorWysiwygInstance) {\n sunEditorWysiwygInstance.onImageUploadError = imageUploadError\n }\n if (onFileDrop && sunEditorWysiwygInstance) {\n sunEditorWysiwygInstance.onDrop = onFileDrop\n }\n\n this.registerEvents()\n }\n } catch (_) {\n // we usually end up here when we are in a modal and then it starts in the right way\n }\n })\n\n STRIP_HTML_REGEX = /<[^>]*>/g\n\n registerEvents(): void {\n const sunEditorInstance = this._sunEditorWysiwygInstance()\n if (sunEditorInstance) {\n sunEditorInstance.onChange = (contents) => {\n this.onChangedHandler(contents)\n this.changeDetectorRef().markForCheck()\n }\n sunEditorInstance.onBlur = () => {\n this.onBlurHandler()\n }\n if (this._isDisabled()) {\n sunEditorInstance.disable()\n }\n }\n }\n\n override writeValue(val: string): void {\n super.writeValue(val)\n this._sunEditorWysiwygInstance$\n .pipe(\n takeUntilDestroyed(this.destroyRef),\n filter((x) => !!x),\n take(1)\n )\n .subscribe((sunEditorWysiwygInstance) => {\n if (sunEditorWysiwygInstance) {\n try {\n sunEditorWysiwygInstance.setContents(val)\n } catch (_) {\n // we usually end up here when we are in a modal and then it starts in the right way\n }\n }\n })\n }\n\n validate(control: AbstractControl): ValidationErrors | null {\n if (control.hasValidator(Validators.required) && control.value?.replace(this.STRIP_HTML_REGEX, '') === '') {\n return { required: true }\n }\n return null\n }\n\n override onChangedHandler(value: string): void {\n super.onChangedHandler(value)\n const control = this._ngControl()\n if (control?.control) {\n if (this.validate(control.control)) control.control.setErrors(this.validate(control.control))\n }\n }\n\n getButtonList(): string[] {\n const buttonList: string[] = []\n if (this.font()) {\n buttonList.push('font')\n }\n if (this.fontSize()) {\n buttonList.push('fontSize')\n }\n if (this.formatBlock()) {\n buttonList.push('formatBlock')\n }\n if (this.paragraphStyle()) {\n buttonList.push('paragraphStyle')\n }\n if (this.blockquote()) {\n buttonList.push('blockquote')\n }\n if (this.bold()) {\n buttonList.push('bold')\n }\n if (this.underline()) {\n buttonList.push('underline')\n }\n if (this.italic()) {\n buttonList.push('italic')\n }\n if (this.strike()) {\n buttonList.push('strike')\n }\n if (this.fontColor()) {\n buttonList.push('fontColor')\n }\n if (this.highlightColor()) {\n buttonList.push('hiliteColor')\n }\n if (this.textStyle()) {\n buttonList.push('textStyle')\n }\n if (this.removeFormat()) {\n buttonList.push('removeFormat')\n }\n if (this.align()) {\n buttonList.push('align')\n }\n if (this.list()) {\n buttonList.push('list')\n }\n if (this.table()) {\n buttonList.push('table')\n }\n if (this.link()) {\n buttonList.push('link')\n }\n if (this.image()) {\n buttonList.push('image')\n }\n if (this.fullScreen()) {\n buttonList.push('fullScreen')\n }\n if (this.showBlocks()) {\n buttonList.push('showBlocks')\n }\n return buttonList\n }\n}\n","<div class=\"mb-3\">\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n class=\"form-label d-flex gap-2\"\n >\n <div>\n <span>{{ componentLabel() | transloco }}</span>\n <span [hidden]=\"!_isRequired()\">*</span>\n </div>\n @if (helpMessage() && helpMessageTooltip()) {\n <div [quangTooltip]=\"helpMessage() | transloco\">\n <ng-content select=\"[help-icon]\" />\n </div>\n }\n </label>\n }\n <div\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n class=\"input-wysiwyg-container is-invalid\"\n >\n <textarea\n [disabled]=\"_isDisabled()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [readOnly]=\"isReadonly()\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_value()\"\n #inputForWysiwyg\n class=\"form-control\"\n ></textarea>\n </div>\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n @if (helpMessage() && !helpMessageTooltip()) {\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AA2CA;;;;;;;;;;;AAWG;AACG,MAAO,qBAAsB,SAAQ,kBAA0B,CAAA;AA1BrE,IAAA,WAAA,GAAA;;AA2BE,QAAA,IAAA,CAAA,gBAAgB,GAAG,SAAS,CAAa,iBAAiB,4DAAC;AAE3D,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAqB,OAAO,qDAAC;AAE9C,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAU,IAAI,gDAAC;AAE3B,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,IAAI,oDAAC;A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AA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECvCH,07CAkDA,EAAA,MAAA,EAAA,CAAA,g6EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDV2B,OAAO,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,qBAAqB,8FAA7C,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAeZ,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBA1BjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,SAAA,EAGd;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,2BAA2B,CAAC;AACpD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;qBACF,EAAA,OAAA,EACQ,CAAC,aAAa,EAAE,OAAO,EAAE,qBAAqB,CAAC,EAAA,eAAA,EACvC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,07CAAA,EAAA,MAAA,EAAA,CAAA,g6EAAA,CAAA,EAAA;;;AEzCjD;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"quang-data-handling.mjs","sources":["../../../projects/quang/data-handling/conversion.ts","../../../projects/quang/data-handling/download.ts","../../../projects/quang/data-handling/quang-data-handling.ts"],"sourcesContent":["export async function blobToBase64(blob: Blob): Promise<string | ArrayBuffer | null> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onloadend = () => {\n resolve(reader.result)\n }\n reader.onerror = (error) => {\n reject(error)\n }\n reader.readAsDataURL(blob)\n })\n}\n\nexport async function base64ToDataUri(base64: string, type = 'application/octet-stream') {\n return `data:${type};base64,${base64}`\n}\n\nexport async function dataUriToBlob(dataUri: string): Promise<Blob> {\n return (await fetch(dataUri)).blob()\n}\n","import { HttpResponse } from '@angular/common/http'\n\nexport function downloadFile(file: File, filename: string): void {\n const a = document.createElement('a')\n const url = window.URL.createObjectURL(file)\n a.href = url\n a.download = filename\n a.click()\n window.URL.revokeObjectURL(url)\n a.remove()\n}\n\nexport function handleDownload(response: HttpResponse<Blob>, defaultExtension = 'xls'): void {\n const { body, headers } = response\n if (!body) throw new Error('No body')\n let filename: string\n try {\n const contentDisposition = headers.get('content-disposition') ?? ''\n const r = /filename[^;=\\n]*=((['\"]).*?\\2|[^;\\n]*)/\n\n filename = r.exec(contentDisposition)![1]\n filename = filename.replace(/['\"]/g, '')\n } catch (_error) {\n filename = `download-${new Date().getTime()}.${defaultExtension}`\n }\n const file = new File([body], filename, {\n type: headers.get('content-type') ?? 'blob',\n })\n downloadFile(file, filename)\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAO,eAAe,YAAY,CAAC,IAAU,EAAA;IAC3C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;AACrC,QAAA,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE;AAC/B,QAAA,MAAM,CAAC,SAAS,GAAG,MAAK;AACtB,YAAA,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;AACxB,SAAC;AACD,QAAA,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,KAAI;YACzB,MAAM,CAAC,KAAK,CAAC;AACf,SAAC;AACD,QAAA,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC;AAC5B,KAAC,CAAC;AACJ;AAEO,eAAe,eAAe,CAAC,MAAc,EAAE,IAAI,GAAG,0BAA0B,EAAA;AACrF,IAAA,OAAO,CAAA,KAAA,EAAQ,IAAI,CAAA,QAAA,EAAW,MAAM,EAAE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,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,MAAM;AAC5C,KAAA,CAAC;AACF,IAAA,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC;AAC9B;;AC7BA;;AAEG;;;;"}
1
+ {"version":3,"file":"quang-data-handling.mjs","sources":["../../../projects/quang/data-handling/conversion.ts","../../../projects/quang/data-handling/download.ts","../../../projects/quang/data-handling/quang-data-handling.ts"],"sourcesContent":["export async function blobToBase64(blob: Blob): Promise<string | ArrayBuffer | null> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onloadend = () => {\n resolve(reader.result)\n }\n reader.onerror = (error) => {\n reject(error)\n }\n reader.readAsDataURL(blob)\n })\n}\n\nexport async function base64ToDataUri(base64: string, type = 'application/octet-stream') {\n return `data:${type};base64,${base64}`\n}\n\nexport async function dataUriToBlob(dataUri: string): Promise<Blob> {\n return (await fetch(dataUri)).blob()\n}\n","import { HttpResponse } from '@angular/common/http'\n\nexport function downloadFile(file: File, filename: string): void {\n const a = document.createElement('a')\n const url = window.URL.createObjectURL(file)\n a.href = url\n a.download = filename\n a.click()\n window.URL.revokeObjectURL(url)\n a.remove()\n}\n\nexport function handleDownload(response: HttpResponse<Blob>, defaultExtension = 'xls'): void {\n const { body, headers } = response\n if (!body) throw new Error('No body')\n let filename: string\n try {\n const contentDisposition = headers.get('content-disposition') ?? ''\n const r = /filename[^;=\\n]*=((['\"]).*?\\2|[^;\\n]*)/\n\n filename = r.exec(contentDisposition)![1]\n filename = filename.replace(/['\"]/g, '')\n } catch (_error) {\n filename = `download-${new Date().getTime()}.${defaultExtension}`\n }\n const file = new File([body], filename, {\n type: headers.get('content-type') ?? 'blob',\n })\n downloadFile(file, filename)\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAO,eAAe,YAAY,CAAC,IAAU,EAAA;IAC3C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAA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F,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,IAAI,EAAE;QACnE,MAAM,CAAC,GAAG,wCAAwC;QAElD,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAE,CAAC,CAAC,CAAC;QACzC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;IAC1C;IAAE,OAAO,MAAM,EAAE;QACf,QAAQ,GAAG,CAAA,SAAA,EAAY,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA,CAAA,EAAI,gBAAgB,CAAA,CAAE;IACnE;IACA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE;QACtC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,MAAM;AAC5C,KAAA,CAAC;AACF,IAAA,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC;AAC9B;;AC7BA;;AAEG;;;;"}
@@ -24,10 +24,10 @@ class ResizeObservableService {
24
24
  widthResizeObservable(elem) {
25
25
  return this.resizeObservable(elem).pipe(map((entry) => entry.borderBoxSize[0].inlineSize), filter(Boolean));
26
26
  }
27
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: ResizeObservableService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
28
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: ResizeObservableService, providedIn: 'root' }); }
27
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ResizeObservableService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
28
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ResizeObservableService, providedIn: 'root' }); }
29
29
  }
30
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: ResizeObservableService, decorators: [{
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ResizeObservableService, decorators: [{
31
31
  type: Injectable,
32
32
  args: [{
33
33
  providedIn: 'root',
@@ -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,IAAA,CAAA,SAAS,GAA0C,EAAE;QAG3D,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,C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AA;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;;;;"}
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,u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CAAC,EACjD,MAAM,CAAC,OAAO,CAAC,CAChB;IACH;8GArCW,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;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"quang-forms.mjs","sources":["../../../projects/quang/forms/validators.ts","../../../projects/quang/forms/form-group-model.ts","../../../projects/quang/forms/quang-forms.ts"],"sourcesContent":["import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport { isAfter, isBefore, isWithinInterval } from 'date-fns'\n\nexport enum EuroLocale {\n AT = 'AT',\n BE = 'BE',\n BG = 'BG',\n CY = 'CY',\n CZ = 'CZ',\n DE = 'DE',\n DK = 'DK',\n EE = 'EE',\n GR = 'GR',\n ES = 'ES',\n FI = 'FI',\n FR = 'FR',\n GB = 'GB',\n HU = 'HU',\n IE = 'IE',\n IT = 'IT',\n LT = 'LT',\n LU = 'LU',\n LV = 'LV',\n MT = 'MT',\n NL = 'NL',\n PL = 'PL',\n PT = 'PT',\n RO = 'RO',\n SE = 'SE',\n SI = 'SI',\n SK = 'SK',\n}\n\nexport const europeanVatNumber: Record<EuroLocale, RegExp> = {\n [EuroLocale.AT]: /U[0-9]{8}/gm,\n [EuroLocale.BE]: /0[0-9]{9}/gm,\n [EuroLocale.BG]: /[0-9]{9,10}/gm,\n [EuroLocale.CY]: /[0-9]{8}L/gm,\n [EuroLocale.CZ]: /[0-9]{8,10}/gm,\n [EuroLocale.DE]: /[0-9]{9}/gm,\n [EuroLocale.DK]: /[0-9]{8}/gm,\n [EuroLocale.EE]: /[0-9]{9}/gm,\n [EuroLocale.GR]: /[0-9]{9}/gm,\n [EuroLocale.ES]: /[0-9A-Z][0-9]{7}[0-9A-Z]/gm,\n [EuroLocale.FI]: /[0-9]{8}/gm,\n [EuroLocale.FR]: /[0-9A-Z]{2}[0-9]{9}/gm,\n [EuroLocale.GB]: /([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})/gm,\n [EuroLocale.HU]: /[0-9]{8}/gm,\n [EuroLocale.IE]: /[0-9]S[0-9]{5}L/gm,\n [EuroLocale.IT]: /[0-9]{11}/gm,\n [EuroLocale.LT]: /([0-9]{9}|[0-9]{12})/gm,\n [EuroLocale.LU]: /[0-9]{8}/gm,\n [EuroLocale.LV]: /[0-9]{11}/gm,\n [EuroLocale.MT]: /[0-9]{8}/gm,\n [EuroLocale.NL]: /[0-9]{9}B[0-9]{2}/gm,\n [EuroLocale.PL]: /[0-9]{10}/gm,\n [EuroLocale.PT]: /[0-9]{9}/gm,\n [EuroLocale.RO]: /[0-9]{2,10}/gm,\n [EuroLocale.SE]: /[0-9]{12}/gm,\n [EuroLocale.SI]: /[0-9]{8}/gm,\n [EuroLocale.SK]: /[0-9]{10}/gm,\n}\nexport function fileMaxSize(maxSize: number): ValidatorFn {\n return (control: AbstractControl): Record<string, any> | null => {\n if (control.value && control.value instanceof File && control.value?.size > maxSize) {\n return { maxSize: { requiredValue: maxSize } }\n }\n return null\n }\n}\n\nexport function fileMinSize(minSize: number): ValidatorFn {\n return (control: AbstractControl): Record<string, any> | null => {\n if (control.value && control.value instanceof File && control.value?.size < minSize) {\n return { minSize: { requiredValue: minSize } }\n }\n return null\n }\n}\n\nexport function isFile(): ValidatorFn {\n return (control: AbstractControl): Record<string, any> | null => {\n if (control.value && control.value instanceof File) {\n return null\n }\n return { isFile: {} }\n }\n}\n\nexport function fileType(fileTypes: string[]) {\n return (control: AbstractControl): Record<string, any> | null => {\n if (control.value && !fileTypes.includes(control.value?.type)) {\n return { fileType: { requiredValue: fileTypes.toString() } }\n }\n return null\n }\n}\n\nexport function fileExtensions(list: string[]) {\n return (control: AbstractControl): Record<string, any> | null => {\n if (control.value && !list.includes(control.value?.name?.match(/(?:\\.([^.]+))?$/g)[0])) {\n return { fileExtension: { requiredValue: list.toString() } }\n }\n return null\n }\n}\n\nexport function requiredCheckbox() {\n return (control: AbstractControl): Record<string, any> | null => {\n if (!control.value) {\n return { required: { requiredValue: control.value } }\n }\n return null\n }\n}\n\nexport function minDate(dateToCompare: Date) {\n return (control: AbstractControl): Record<string, any> | null => {\n if (isBefore(new Date(control.value), dateToCompare)) {\n return { minDate: { requiredValue: dateToCompare } }\n }\n return null\n }\n}\n\nexport function maxDate(dateToCompare: Date) {\n return (control: AbstractControl): Record<string, any> | null => {\n if (isAfter(new Date(control.value), dateToCompare)) {\n return { maxDate: { requiredValue: dateToCompare } }\n }\n return null\n }\n}\n\nexport function dateBetween(start: Date, end: Date) {\n return (control: AbstractControl): Record<string, any> | null => {\n if (\n !isWithinInterval(new Date(control.value), {\n start,\n end,\n })\n ) {\n return { dateBetween: { requiredValue: [start, end] } }\n }\n return null\n }\n}\n\nexport function isFiscalCode() {\n return (control: AbstractControl): Record<string, any> | null => {\n if (\n control?.value &&\n !/^([A-Z]{6}[0-9LMNPQRSTUV]{2}[ABCDEHLMPRST]{1}[0-9LMNPQRSTUV]{2}[A-Z]{1}[0-9LMNPQRSTUV]{3}[A-Z]{1})$|([0-9]{11})$/gm.test(\n control.value.toUpperCase()\n )\n ) {\n return { fiscalCode: true }\n }\n return null\n }\n}\n\nexport function isVatNumber(localeList: EuroLocale[]) {\n return (control: AbstractControl): Record<string, any> | null => {\n let isInvalidVat = true\n for (const locale of localeList) {\n if (europeanVatNumber[locale]?.test(control?.value)) {\n isInvalidVat = false\n break\n }\n }\n return isInvalidVat ? { vatNumber: false } : null\n }\n}\n\nexport function wysiwygRequired() {\n return (control: AbstractControl): Record<string, any> | null => {\n const cleanHTML = control.value.replace(/<\\/?[^>]+(>|$)/g, '')\n if (!cleanHTML?.length) {\n return { required: { required: true } }\n }\n return null\n }\n}\n","import { FormControl, FormGroup } from '@angular/forms'\n\nexport type FormGroupModel<T> = FormGroup<{\n [K in keyof T]: FormControl<T[K]>\n}>\n\n/**\n * @example\n * interface Person {\n * name: string\n * lastName: string\n * age: number\n * }\n *\n * myForm: FormGroupModel<Person> = this.formBuilder.group({\n * name: this.formBuilder.control<string>('', Validators.required),\n * lastName: this.formBuilder.control<string>(''),\n * age: this.formBuilder.control<number>({value: 20, disabled: true})\n * })\n */\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;IAIY;AAAZ,CAAA,UAAY,UAAU,EAAA;AACpB,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA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C,UAAwB,EAAA;IAClD,OAAO,CAAC,OAAwB,KAAgC;QAC9D,IAAI,YAAY,GAAG,IAAI;AACvB,QAAA,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE;AAC/B,YAAA,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;gBACnD,YAAY,GAAG,KAAK;gBACpB;;;AAGJ,QAAA,OAAO,YAAY,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI;AACnD,KAAC;AACH;SAEgB,eAAe,GAAA;IAC7B,OAAO,CAAC,OAAwB,KAAgC;AAC9D,QAAA,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC;AAC9D,QAAA,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE;YACtB,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;;AAEzC,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;AClLA;;;;;;;;;;;;;AAaG;;ACnBH;;AAEG;;;;"}
1
+ {"version":3,"file":"quang-forms.mjs","sources":["../../../projects/quang/forms/validators.ts","../../../projects/quang/forms/form-group-model.ts","../../../projects/quang/forms/quang-forms.ts"],"sourcesContent":["import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport { isAfter, isBefore, isWithinInterval } from 'date-fns'\n\nexport enum EuroLocale {\n AT = 'AT',\n BE = 'BE',\n BG = 'BG',\n CY = 'CY',\n CZ = 'CZ',\n DE = 'DE',\n DK = 'DK',\n EE = 'EE',\n GR = 'GR',\n ES = 'ES',\n FI = 'FI',\n FR = 'FR',\n GB = 'GB',\n HU = 'HU',\n IE = 'IE',\n IT = 'IT',\n LT = 'LT',\n LU = 'LU',\n LV = 'LV',\n MT = 'MT',\n NL = 'NL',\n PL = 'PL',\n PT = 'PT',\n RO = 'RO',\n SE = 'SE',\n SI = 'SI',\n SK = 'SK',\n}\n\nexport const europeanVatNumber: Record<EuroLocale, RegExp> = {\n [EuroLocale.AT]: /U[0-9]{8}/gm,\n [EuroLocale.BE]: /0[0-9]{9}/gm,\n [EuroLocale.BG]: /[0-9]{9,10}/gm,\n [EuroLocale.CY]: /[0-9]{8}L/gm,\n [EuroLocale.CZ]: /[0-9]{8,10}/gm,\n [EuroLocale.DE]: /[0-9]{9}/gm,\n [EuroLocale.DK]: /[0-9]{8}/gm,\n [EuroLocale.EE]: /[0-9]{9}/gm,\n [EuroLocale.GR]: /[0-9]{9}/gm,\n [EuroLocale.ES]: /[0-9A-Z][0-9]{7}[0-9A-Z]/gm,\n [EuroLocale.FI]: /[0-9]{8}/gm,\n [EuroLocale.FR]: /[0-9A-Z]{2}[0-9]{9}/gm,\n [EuroLocale.GB]: /([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})/gm,\n [EuroLocale.HU]: /[0-9]{8}/gm,\n [EuroLocale.IE]: /[0-9]S[0-9]{5}L/gm,\n [EuroLocale.IT]: /[0-9]{11}/gm,\n [EuroLocale.LT]: /([0-9]{9}|[0-9]{12})/gm,\n [EuroLocale.LU]: /[0-9]{8}/gm,\n [EuroLocale.LV]: /[0-9]{11}/gm,\n [EuroLocale.MT]: /[0-9]{8}/gm,\n [EuroLocale.NL]: /[0-9]{9}B[0-9]{2}/gm,\n [EuroLocale.PL]: /[0-9]{10}/gm,\n [EuroLocale.PT]: /[0-9]{9}/gm,\n [EuroLocale.RO]: /[0-9]{2,10}/gm,\n [EuroLocale.SE]: /[0-9]{12}/gm,\n [EuroLocale.SI]: /[0-9]{8}/gm,\n [EuroLocale.SK]: /[0-9]{10}/gm,\n}\nexport function fileMaxSize(maxSize: number): ValidatorFn {\n return (control: AbstractControl): Record<string, any> | null => {\n if (control.value && control.value instanceof File && control.value?.size > maxSize) {\n return { maxSize: { requiredValue: maxSize } }\n }\n return null\n }\n}\n\nexport function fileMinSize(minSize: number): ValidatorFn {\n return (control: AbstractControl): Record<string, any> | null => {\n if (control.value && control.value instanceof File && control.value?.size < minSize) {\n return { minSize: { requiredValue: minSize } }\n }\n return null\n }\n}\n\nexport function isFile(): ValidatorFn {\n return (control: AbstractControl): Record<string, any> | null => {\n if (control.value && control.value instanceof File) {\n return null\n }\n return { isFile: {} }\n }\n}\n\nexport function fileType(fileTypes: string[]) {\n return (control: AbstractControl): Record<string, any> | null => {\n if (control.value && !fileTypes.includes(control.value?.type)) {\n return { fileType: { requiredValue: fileTypes.toString() } }\n }\n return null\n }\n}\n\nexport function fileExtensions(list: string[]) {\n return (control: AbstractControl): Record<string, any> | null => {\n if (control.value && !list.includes(control.value?.name?.match(/(?:\\.([^.]+))?$/g)[0])) {\n return { fileExtension: { requiredValue: list.toString() } }\n }\n return null\n }\n}\n\nexport function requiredCheckbox() {\n return (control: AbstractControl): Record<string, any> | null => {\n if (!control.value) {\n return { required: { requiredValue: control.value } }\n }\n return null\n }\n}\n\nexport function minDate(dateToCompare: Date) {\n return (control: AbstractControl): Record<string, any> | null => {\n if (isBefore(new Date(control.value), dateToCompare)) {\n return { minDate: { requiredValue: dateToCompare } }\n }\n return null\n }\n}\n\nexport function maxDate(dateToCompare: Date) {\n return (control: AbstractControl): Record<string, any> | null => {\n if (isAfter(new Date(control.value), dateToCompare)) {\n return { maxDate: { requiredValue: dateToCompare } }\n }\n return null\n }\n}\n\nexport function dateBetween(start: Date, end: Date) {\n return (control: AbstractControl): Record<string, any> | null => {\n if (\n !isWithinInterval(new Date(control.value), {\n start,\n end,\n })\n ) {\n return { dateBetween: { requiredValue: [start, end] } }\n }\n return null\n }\n}\n\nexport function isFiscalCode() {\n return (control: AbstractControl): Record<string, any> | null => {\n if (\n control?.value &&\n !/^([A-Z]{6}[0-9LMNPQRSTUV]{2}[ABCDEHLMPRST]{1}[0-9LMNPQRSTUV]{2}[A-Z]{1}[0-9LMNPQRSTUV]{3}[A-Z]{1})$|([0-9]{11})$/gm.test(\n control.value.toUpperCase()\n )\n ) {\n return { fiscalCode: true }\n }\n return null\n }\n}\n\nexport function isVatNumber(localeList: EuroLocale[]) {\n return (control: AbstractControl): Record<string, any> | null => {\n let isInvalidVat = true\n for (const locale of localeList) {\n if (europeanVatNumber[locale]?.test(control?.value)) {\n isInvalidVat = false\n break\n }\n }\n return isInvalidVat ? { vatNumber: false } : null\n }\n}\n\nexport function wysiwygRequired() {\n return (control: AbstractControl): Record<string, any> | null => {\n const cleanHTML = control.value.replace(/<\\/?[^>]+(>|$)/g, '')\n if (!cleanHTML?.length) {\n return { required: { required: true } }\n }\n return null\n }\n}\n","import { FormControl, FormGroup } from '@angular/forms'\n\nexport type FormGroupModel<T> = FormGroup<{\n [K in keyof T]: FormControl<T[K]>\n}>\n\n/**\n * @example\n * interface Person {\n * name: string\n * lastName: string\n * age: number\n * }\n *\n * myForm: FormGroupModel<Person> = this.formBuilder.group({\n * name: this.formBuilder.control<string>('', Validators.required),\n * lastName: this.formBuilder.control<string>(''),\n * age: this.formBuilder.control<number>({value: 20, disabled: true})\n * })\n */\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;IAIY;AAAZ,CAAA,UAAY,UAAU,EAAA;AACpB,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,UAAA,CAAA,IAAA,CAA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;IAC1B,OAAO,CAAC,OAAwB,KAAgC;QAC9D,IACE,OAAO,EAAE,KAAK;AACd,YAAA,CAAC,oHAAoH,CAAC,IAAI,CACxH,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,CAC5B,EACD;AACA,YAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE;QAC7B;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;AAEM,SAAU,WAAW,CAAC,UAAwB,EAAA;IAClD,OAAO,CAAC,OAAwB,KAAgC;QAC9D,IAAI,YAAY,GAAG,IAAI;AACvB,QAAA,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE;AAC/B,YAAA,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;gBACnD,YAAY,GAAG,KAAK;gBACpB;YACF;QACF;AACA,QAAA,OAAO,YAAY,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI;AACnD,IAAA,CAAC;AACH;SAEgB,eAAe,GAAA;IAC7B,OAAO,CAAC,OAAwB,KAAgC;AAC9D,QAAA,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC;AAC9D,QAAA,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE;YACtB,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;QACzC;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;AClLA;;;;;;;;;;;;;AAaG;;ACnBH;;AAEG;;;;"}
@@ -17,10 +17,10 @@ class QuangLoaderService {
17
17
  hide() {
18
18
  patchState(this.loaderState, { count: this.loaderState().count - 1 });
19
19
  }
20
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: QuangLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
21
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: QuangLoaderService, providedIn: 'root' }); }
20
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: QuangLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
21
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: QuangLoaderService, providedIn: 'root' }); }
22
22
  }
23
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: QuangLoaderService, decorators: [{
23
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: QuangLoaderService, decorators: [{
24
24
  type: Injectable,
25
25
  args: [{
26
26
  providedIn: 'root',
@@ -69,10 +69,10 @@ class QuangLoaderComponent {
69
69
  this.showLoaderBuffer$ = toObservable(this.isLoading).pipe(map((isLoading) => (isLoading ? of(isLoading) : timer(this.showAtLeastFor()).pipe(map(() => isLoading)))), switchAll());
70
70
  this.showLoader = toSignal(this.showLoaderBuffer$);
71
71
  }
72
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: QuangLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
73
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", 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 }); }
72
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: QuangLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
73
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.1", 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 }); }
74
74
  }
75
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: QuangLoaderComponent, decorators: [{
75
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: QuangLoaderComponent, decorators: [{
76
76
  type: Component,
77
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"] }]
78
78
  }] });
@@ -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 { 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,IAAA,CAAA,WAAW,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,qDAAC;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,CA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A,EACf,EAAE,EAAA,eAAA,EAGM,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,uNAAA,EAAA,MAAA,EAAA,CAAA,4nBAAA,CAAA,EAAA;;;AEdjD;;;;;;;;;;;;AAYG;AACG,SAAU,8BAA8B,CAAC,YAAuB,EAAA;AACpE,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA;AACE,YAAA,OAAO,EAAE,oBAAoB;AAC7B,YAAA,QAAQ,EAAE,YAAY;AACvB,SAAA;AACF,KAAA,CAAC;AACJ;AAEM,SAAU,sBAAsB,CAAC,YAAuB,EAAA;IAC5D,OAAO,YAAY,yCAAiC,CAAC,8BAA8B,CAAC,YAAY,CAAC,CAAC,CAAC;AACrG;AAEA;;;AAGG;AACI,MAAM,aAAa,GAAG;;ACrC7B;;AAEG;;;;"}
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,IAAA,CAAA,WAAW,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,qDAAC;AAShE,IAAA;IAPQ,IAAI,GAAA;AACT,QAAA,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;IACvE;IAEO,IAAI,GAAA;AACT,QAAA,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;IACvE;8GAXW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CA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CAAA,4nBAAA,CAAA,EAAA;;;AEdjD;;;;;;;;;;;;AAYG;AACG,SAAU,8BAA8B,CAAC,YAAuB,EAAA;AACpE,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA;AACE,YAAA,OAAO,EAAE,oBAAoB;AAC7B,YAAA,QAAQ,EAAE,YAAY;AACvB,SAAA;AACF,KAAA,CAAC;AACJ;AAEM,SAAU,sBAAsB,CAAC,YAAuB,EAAA;IAC5D,OAAO,YAAY,yCAAiC,CAAC,8BAA8B,CAAC,YAAY,CAAC,CAAC,CAAC;AACrG;AAEA;;;AAGG;AACI,MAAM,aAAa,GAAG;;ACrC7B;;AAEG;;;;"}
@@ -100,10 +100,10 @@ class QuangModalComponent {
100
100
  this.overlayRef?.detach();
101
101
  this.overlayRef?.dispose();
102
102
  }
103
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: QuangModalComponent, deps: [{ token: i1.Overlay }], target: i0.ɵɵFactoryTarget.Component }); }
104
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.7", 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 }); }
103
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: QuangModalComponent, deps: [{ token: i1.Overlay }], target: i0.ɵɵFactoryTarget.Component }); }
104
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.1", 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 }); }
105
105
  }
106
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: QuangModalComponent, decorators: [{
106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: QuangModalComponent, decorators: [{
107
107
  type: Component,
108
108
  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"] }]
109
109
  }], ctorParameters: () => [{ type: i1.Overlay }], propDecorators: { portal: [{
@@ -223,10 +223,10 @@ class QuangModalService {
223
223
  this.idCounter.update((count) => count + 1);
224
224
  return `modal-${this.idCounter()}-${Date.now()}`;
225
225
  }
226
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: QuangModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
227
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: QuangModalService, providedIn: 'root' }); }
226
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: QuangModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
227
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: QuangModalService, providedIn: 'root' }); }
228
228
  }
229
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: QuangModalService, decorators: [{
229
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: QuangModalService, decorators: [{
230
230
  type: Injectable,
231
231
  args: [{
232
232
  providedIn: 'root',
@@ -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/modal.service.ts","../../../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\nimport { ModalAnimationMode } from './models/ModalAnimationMode'\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","import {\n ApplicationRef,\n EnvironmentInjector,\n Injectable,\n Type,\n computed,\n createComponent,\n inject,\n signal,\n} from '@angular/core'\n\nimport { Subject } from 'rxjs'\n\nimport { QuangModalComponent } from './modal.component'\n\nimport { ModalInstance } from './models/ModalInstance'\nimport { ModalOptions } from './models/ModalOptions'\n\n@Injectable({\n providedIn: 'root',\n})\nexport class QuangModalService {\n private readonly environmentInjector = inject(EnvironmentInjector)\n private readonly appRef = inject(ApplicationRef)\n\n private modalInstances = signal<ModalInstance[]>([])\n private idCounter = signal(0)\n\n // Computed properties for easier access\n public modalCount = computed(() => this.modalInstances().length)\n public hasOpenModals = computed(() => this.modalInstances().length > 0)\n public modalIds = computed(() => this.modalInstances().map((instance) => instance.id))\n\n // Subject to emit when modals are closed\n private modalClosedSubject = new Subject<string>()\n public modalClosed$ = this.modalClosedSubject.asObservable()\n\n showModal<T = unknown>(component: Type<T>, options: ModalOptions, componentInputs?: Record<string, unknown>): string {\n const id = this.generateId()\n\n // Create the content component instance first\n const contentRef = createComponent(component, {\n environmentInjector: this.environmentInjector,\n })\n\n // Set component inputs if provided\n if (componentInputs) {\n Object.entries(componentInputs).forEach(([key, value]) => {\n contentRef.setInput(key, value)\n })\n }\n\n // Create the modal component instance with content projected in body slot\n const modalRef = createComponent(QuangModalComponent, {\n environmentInjector: this.environmentInjector,\n projectableNodes: [\n [], // header slot (empty)\n [contentRef.location.nativeElement], // body slot (content component)\n [], // footer slot (empty)\n ],\n })\n\n // Set modal inputs from options\n modalRef.setInput('position', options.position)\n if (options.height !== undefined) modalRef.setInput('height', options.height)\n if (options.width !== undefined) modalRef.setInput('width', options.width)\n if (options.padding !== undefined) modalRef.setInput('padding', options.padding)\n if (options.containerClass !== undefined) modalRef.setInput('containerClass', options.containerClass)\n if (options.animationMode !== undefined) modalRef.setInput('animationMode', options.animationMode)\n if (options.backgroundColor !== undefined) modalRef.setInput('backgroundColor', options.backgroundColor)\n if (options.showBackdrop !== undefined) modalRef.setInput('showBackdrop', options.showBackdrop)\n\n // Subscribe to backdrop click to close modal\n modalRef.instance.backdropClick.subscribe(() => {\n this.hideModal(id)\n })\n\n // Attach components to the application\n this.appRef.attachView(contentRef.hostView)\n this.appRef.attachView(modalRef.hostView)\n\n // Add modal to DOM\n document.body.appendChild(modalRef.location.nativeElement)\n\n // Store modal instance\n const modalInstance: ModalInstance = {\n id,\n modalRef,\n contentRef,\n }\n this.modalInstances.update((instances) => [...instances, modalInstance])\n\n return id\n }\n\n hideModal(id?: string): void {\n if (id) {\n // Find and remove modal by id\n const instances = this.modalInstances()\n const index = instances.findIndex((instance: ModalInstance) => instance.id === id)\n if (index !== -1) {\n const modalToClose = instances[index]\n this.destroyModalInstance(modalToClose)\n this.modalInstances.update((instances) => instances.filter((_, i) => i !== index))\n // Emit modal closed event\n this.modalClosedSubject.next(id)\n }\n } else {\n // Remove last modal (LIFO - Last In First Out)\n const instances = this.modalInstances()\n const lastModal = instances[instances.length - 1]\n if (lastModal) {\n this.destroyModalInstance(lastModal)\n this.modalInstances.update((instances) => instances.slice(0, -1))\n // Emit modal closed event\n this.modalClosedSubject.next(lastModal.id)\n }\n }\n }\n\n private destroyModalInstance(instance: ModalInstance): void {\n // Close the modal component (triggers overlay cleanup)\n instance.modalRef.instance.closeModal()\n\n // Detach from application\n this.appRef.detachView(instance.contentRef.hostView)\n this.appRef.detachView(instance.modalRef.hostView)\n\n // Remove from DOM if still attached\n if (instance.modalRef.location.nativeElement.parentNode) {\n instance.modalRef.location.nativeElement.parentNode.removeChild(instance.modalRef.location.nativeElement)\n }\n\n // Destroy component references\n instance.contentRef.destroy()\n instance.modalRef.destroy()\n }\n\n private generateId(): string {\n this.idCounter.update((count) => count + 1)\n return `modal-${this.idCounter()}-${Date.now()}`\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;MACU,mBAAmB,CAAA;AAwD9B,IAAA,WAAA,CAA6B,OAAgB,EAAA;QAAhB,IAAA,CAAA,OAAO,GAAP,OAAO;QArDpC,IAAA,CAAA,aAAa,GAAG,MAAM,EAAQ;AAE9B,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,mDAA+B;AAExD,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAS,MAAM,kDAAC;AAE9B,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,MAAM,iDAAC;AAE7B,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAS,QAAQ,mDAAC;AAEjC,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAS,EAAE,0DAAC;QAElC,IAAA,CAAA,aAAa,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,e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lD,IAAI,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,UAAU,EAAE;AACvD,YAAA,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC;;;AAI3G,QAAA,QAAQ,CAAC,UAAU,CAAC,OAAO,EAAE;AAC7B,QAAA,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE;;IAGrB,UAAU,GAAA;AAChB,QAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,GAAG,CAAC,CAAC;QAC3C,OAAO,CAAA,MAAA,EAAS,IAAI,CAAC,SAAS,EAAE,CAAA,CAAA,EAAI,IAAI,CAAC,GAAG,EAAE,CAAA,CAAE;;8GAvHvC,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjB,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,iBAAiB,cAFhB,MAAM,EAAA,CAAA,CAAA;;2FAEP,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAH7B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACpBD;;AAEG;;;;"}
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/modal.service.ts","../../../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\nimport { ModalAnimationMode } from './models/ModalAnimationMode'\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","import {\n ApplicationRef,\n EnvironmentInjector,\n Injectable,\n Type,\n computed,\n createComponent,\n inject,\n signal,\n} from '@angular/core'\n\nimport { Subject } from 'rxjs'\n\nimport { QuangModalComponent } from './modal.component'\n\nimport { ModalInstance } from './models/ModalInstance'\nimport { ModalOptions } from './models/ModalOptions'\n\n@Injectable({\n providedIn: 'root',\n})\nexport class QuangModalService {\n private readonly environmentInjector = inject(EnvironmentInjector)\n private readonly appRef = inject(ApplicationRef)\n\n private modalInstances = signal<ModalInstance[]>([])\n private idCounter = signal(0)\n\n // Computed properties for easier access\n public modalCount = computed(() => this.modalInstances().length)\n public hasOpenModals = computed(() => this.modalInstances().length > 0)\n public modalIds = computed(() => this.modalInstances().map((instance) => instance.id))\n\n // Subject to emit when modals are closed\n private modalClosedSubject = new Subject<string>()\n public modalClosed$ = this.modalClosedSubject.asObservable()\n\n showModal<T = unknown>(component: Type<T>, options: ModalOptions, componentInputs?: Record<string, unknown>): string {\n const id = this.generateId()\n\n // Create the content component instance first\n const contentRef = createComponent(component, {\n environmentInjector: this.environmentInjector,\n })\n\n // Set component inputs if provided\n if (componentInputs) {\n Object.entries(componentInputs).forEach(([key, value]) => {\n contentRef.setInput(key, value)\n })\n }\n\n // Create the modal component instance with content projected in body slot\n const modalRef = createComponent(QuangModalComponent, {\n environmentInjector: this.environmentInjector,\n projectableNodes: [\n [], // header slot (empty)\n [contentRef.location.nativeElement], // body slot (content component)\n [], // footer slot (empty)\n ],\n })\n\n // Set modal inputs from options\n modalRef.setInput('position', options.position)\n if (options.height !== undefined) modalRef.setInput('height', options.height)\n if (options.width !== undefined) modalRef.setInput('width', options.width)\n if (options.padding !== undefined) modalRef.setInput('padding', options.padding)\n if (options.containerClass !== undefined) modalRef.setInput('containerClass', options.containerClass)\n if (options.animationMode !== undefined) modalRef.setInput('animationMode', options.animationMode)\n if (options.backgroundColor !== undefined) modalRef.setInput('backgroundColor', options.backgroundColor)\n if (options.showBackdrop !== undefined) modalRef.setInput('showBackdrop', options.showBackdrop)\n\n // Subscribe to backdrop click to close modal\n modalRef.instance.backdropClick.subscribe(() => {\n this.hideModal(id)\n })\n\n // Attach components to the application\n this.appRef.attachView(contentRef.hostView)\n this.appRef.attachView(modalRef.hostView)\n\n // Add modal to DOM\n document.body.appendChild(modalRef.location.nativeElement)\n\n // Store modal instance\n const modalInstance: ModalInstance = {\n id,\n modalRef,\n contentRef,\n }\n this.modalInstances.update((instances) => [...instances, modalInstance])\n\n return id\n }\n\n hideModal(id?: string): void {\n if (id) {\n // Find and remove modal by id\n const instances = this.modalInstances()\n const index = instances.findIndex((instance: ModalInstance) => instance.id === id)\n if (index !== -1) {\n const modalToClose = instances[index]\n this.destroyModalInstance(modalToClose)\n this.modalInstances.update((instances) => instances.filter((_, i) => i !== index))\n // Emit modal closed event\n this.modalClosedSubject.next(id)\n }\n } else {\n // Remove last modal (LIFO - Last In First Out)\n const instances = this.modalInstances()\n const lastModal = instances[instances.length - 1]\n if (lastModal) {\n this.destroyModalInstance(lastModal)\n this.modalInstances.update((instances) => instances.slice(0, -1))\n // Emit modal closed event\n this.modalClosedSubject.next(lastModal.id)\n }\n }\n }\n\n private destroyModalInstance(instance: ModalInstance): void {\n // Close the modal component (triggers overlay cleanup)\n instance.modalRef.instance.closeModal()\n\n // Detach from application\n this.appRef.detachView(instance.contentRef.hostView)\n this.appRef.detachView(instance.modalRef.hostView)\n\n // Remove from DOM if still attached\n if (instance.modalRef.location.nativeElement.parentNode) {\n instance.modalRef.location.nativeElement.parentNode.removeChild(instance.modalRef.location.nativeElement)\n }\n\n // Destroy component references\n instance.contentRef.destroy()\n instance.modalRef.destroy()\n }\n\n private generateId(): string {\n this.idCounter.update((count) => count + 1)\n return `modal-${this.idCounter()}-${Date.now()}`\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;MACU,mBAAmB,CAAA;AAwD9B,IAAA,WAAA,CAA6B,OAAgB,EAAA;QAAhB,IAAA,CAAA,OAAO,GAAP,OAAO;QArDpC,IAAA,CAAA,aAAa,GAAG,MAAM,EAAQ;AAE9B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AAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,cAFhB,MAAM,EAAA,CAAA,CAAA;;2FAEP,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAH7B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACpBD;;AAEG;;;;"}
@@ -38,10 +38,10 @@ class QuangPopoverComponent {
38
38
  }
39
39
  });
40
40
  }
41
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: QuangPopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
42
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", 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);position:relative;padding:1rem;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 }); }
41
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: QuangPopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
42
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.1", 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);position:relative;padding:1rem;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: "20.1.7", ngImport: i0, type: QuangPopoverComponent, decorators: [{
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: QuangPopoverComponent, decorators: [{
45
45
  type: Component,
46
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;padding:1rem;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
  }] });
@@ -52,10 +52,10 @@ class QuangPopoverDirective extends QuangBaseOverlayDirective {
52
52
  this.targetComponentType = signal(QuangPopoverComponent, ...(ngDevMode ? [{ debugName: "targetComponentType" }] : []));
53
53
  this.content = input.required(...(ngDevMode ? [{ debugName: "content", alias: 'quangPopover' }] : [{ alias: 'quangPopover' }]));
54
54
  }
55
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: QuangPopoverDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
56
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.7", type: QuangPopoverDirective, isStandalone: true, selector: "[quangPopover]", inputs: { content: { classPropertyName: "content", publicName: "quangPopover", isSignal: true, isRequired: true, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
55
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: QuangPopoverDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
56
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.1", 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: "20.1.7", ngImport: i0, type: QuangPopoverDirective, decorators: [{
58
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", 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,0DAAC;AAErD,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAgC,IAAI,wDAAC;QAE1D,IAAA,CAAA,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAO;AAEtB,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAS,EAAE,8DAAC;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,CAAA,EAAG,OAAO,CAAA,CAAA,EAAI,OAAO,CAAA,CAAE,CAAC;;iBAC/C;AACL,gBAAA,IAAI,CAAC,kBAAkB,CAAC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F3C,MAAO,qBAAsB,SAAQ,yBAAgD,CAAA;AAH3F,IAAA,WAAA,GAAA;;AAIW,QAAA,IAAA,CAAA,mBAAmB,GAAG,MAAM,CAAmD,qBAAqB,+DAAC;AAErG,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,0CAA4B,KAAK,EAAE,cAAc,EAAA,CAAA,GAAA,CAAvB,EAAE,KAAK,EAAE,cAAc,EAAE,GAAC;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
+ {"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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