@agorapulse/ui-components 20.3.38 → 20.3.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agorapulse-ui-components-20.3.40.tgz +0 -0
- package/button/index.d.ts +32 -22
- package/confirm-modal/index.d.ts +3 -4
- package/fesm2022/agorapulse-ui-components-button.mjs +48 -65
- package/fesm2022/agorapulse-ui-components-button.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-confirm-modal.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-confirm-modal.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-infobox.mjs +2 -0
- package/fesm2022/agorapulse-ui-components-infobox.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-legacy-input.mjs +5 -1
- package/fesm2022/agorapulse-ui-components-legacy-input.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-modal.mjs +16 -3
- package/fesm2022/agorapulse-ui-components-modal.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-nav-selector.mjs +3 -2
- package/fesm2022/agorapulse-ui-components-nav-selector.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-select.mjs +24 -6
- package/fesm2022/agorapulse-ui-components-select.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-tabs.mjs +8 -4
- package/fesm2022/agorapulse-ui-components-tabs.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-tooltip.mjs +23 -5
- package/fesm2022/agorapulse-ui-components-tooltip.mjs.map +1 -1
- package/legacy/input/index.d.ts +1 -0
- package/modal/index.d.ts +19 -2
- package/nav-selector/index.d.ts +1 -1
- package/package.json +1 -1
- package/select/index.d.ts +8 -0
- package/tabs/index.d.ts +2 -0
- package/tooltip/index.d.ts +2 -0
- package/agorapulse-ui-components-20.3.38.tgz +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';
|
|
1
2
|
import { SymbolRegistry, apErrorFill, apRoundedCheckFill, apClose, apSearch, SymbolComponent } from '@agorapulse/ui-symbol';
|
|
2
3
|
import * as i0 from '@angular/core';
|
|
3
4
|
import { forwardRef, inject, ElementRef, EventEmitter, signal, booleanAttribute, Output, Input, ViewChild, ContentChildren, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
@@ -16,6 +17,9 @@ const SEARCH_SYMBOL_ID = 'search';
|
|
|
16
17
|
class InputComponent {
|
|
17
18
|
elementRef = inject(ElementRef);
|
|
18
19
|
symbolRegistry = inject(SymbolRegistry);
|
|
20
|
+
constructor() {
|
|
21
|
+
this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));
|
|
22
|
+
}
|
|
19
23
|
symbols;
|
|
20
24
|
symbolWrapper;
|
|
21
25
|
inputElement;
|
|
@@ -131,7 +135,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
|
131
135
|
multi: true,
|
|
132
136
|
},
|
|
133
137
|
], encapsulation: ViewEncapsulation.None, template: "@if (label) {\n <label [for]=\"inputId\">\n <span>\n {{ label }}\n </span>\n @if (description) {\n <span class=\"description\">\n {{ description }}\n </span>\n }\n </label>\n}\n\n<div\n tabindex=\"0\"\n class=\"input-wrapper\"\n [class.inverse]=\"symbolPosition === 'left'\"\n [class.with-icon]=\"symbolId\"\n [class.with-prefix]=\"prefix\"\n [class.with-suffix]=\"suffix\"\n [class.with-error]=\"errorMessage\"\n [class.with-success]=\"successMessage\"\n [class.disabled]=\"disabled\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy || null\"\n [attr.aria-describedby]=\"ariaDescribedBy || null\"\n [attr.aria-disabled]=\"disabled?.toString()\"\n (click)=\"focusInput()\"\n (keydown.enter)=\"focusInput()\">\n @if (prefix) {\n <div class=\"prefix\">\n <span>\n {{ prefix }}\n </span>\n <span class=\"divider\"></span>\n </div>\n }\n <div class=\"content\">\n <input\n #input\n [type]=\"inputType\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [id]=\"inputId ?? ''\"\n [attr.data-test]=\"hostDataTest() ? hostDataTest() : name\"\n [(ngModel)]=\"value\"\n (blur)=\"onBlurHandle($event)\"\n (focus)=\"onFocusHandle($event)\"\n (keyup)=\"onKeyup($event)\"\n (ngModelChange)=\"onValueChange()\" />\n @if (clearable) {\n <button\n type=\"button\"\n class=\"clear-button\"\n (click)=\"onClear()\">\n <ap-symbol symbolId=\"close\" />\n </button>\n }\n </div>\n @if (suffix) {\n <div class=\"suffix\">\n <span class=\"divider\"></span>\n <span>\n {{ suffix }}\n </span>\n </div>\n }\n @if (symbolId) {\n <ap-symbol\n size=\"sm\"\n [symbolId]=\"symbolId\" />\n }\n</div>\n\n@if (errorMessage) {\n <div class=\"form-message error\">\n <ap-symbol\n symbolId=\"error_fill\"\n size=\"sm\" />\n <span>\n {{ errorMessage }}\n </span>\n </div>\n}\n\n@if (successMessage) {\n <div class=\"form-message success\">\n <ap-symbol\n symbolId=\"rounded-check_fill\"\n size=\"sm\" />\n <span>\n {{ successMessage }}\n </span>\n </div>\n}\n", styles: ["ap-input{display:flex;flex-direction:column;gap:var(--comp-input-spacing-horizontal);--border-width: 1px}ap-input.full-width{width:100%}ap-input.full-width .input-wrapper{min-width:100%}ap-input label{display:flex;flex-direction:column;gap:var(--comp-forms-label-spacing-vertical);font-size:var(--comp-forms-label-size);font-weight:var(--comp-forms-label-font-weight);line-height:var(--comp-forms-label-line-height);font-family:var(--comp-forms-label-font-family);color:var(--comp-forms-label-text-color)}ap-input label .description{font-size:var(--comp-forms-label-description-text-size);font-weight:var(--comp-forms-label-description-text-font-weight);line-height:var(--comp-forms-label-description-text-line-height);font-family:var(--comp-forms-label-description-text-font-family);color:var(--comp-forms-label-description-text-color)}ap-input .input-wrapper{display:flex;align-items:center;position:relative;min-width:var(--comp-input-width-default);height:var(--comp-input-height);border:var(--border-width) solid var(--comp-input-border-default-color);box-sizing:border-box;border-radius:var(--comp-input-border-radius);overflow:hidden;background-color:var(--comp-input-fill-color)}ap-input .input-wrapper:hover:not(.disabled){border-color:var(--comp-input-border-hover-color)}ap-input .input-wrapper:focus-within:not(.disabled){border-color:var(--comp-input-border-focused-color)}ap-input .input-wrapper:focus-visible:not(.disabled){outline:none}ap-input .input-wrapper:active:not(.disabled){border-color:var(--comp-input-border-focused-color)}ap-input .input-wrapper.disabled{background-color:var(--comp-input-fill-disabled-color);color:var(--comp-input-text-disabled-color)}ap-input .input-wrapper .content{display:flex;gap:var(--comp-input-spacing-horizontal);flex:1;align-items:center}ap-input .input-wrapper .content input{border:none;outline:none;box-sizing:border-box;min-height:34px;max-height:34px;padding:0 var(--comp-input-padding-horizontal);flex:1;font-size:var(--comp-input-text-size);font-weight:var(--comp-input-text-font-weight);line-height:var(--comp-input-text-line-height);font-family:var(--comp-input-text-font-family);color:var(--comp-input-text-default-color);min-width:0}ap-input .input-wrapper .content input::placeholder{color:var(--comp-input-text-placeholder-color)}ap-input .input-wrapper .content input:disabled{cursor:not-allowed;pointer-events:none;background:var(--comp-input-fill-disabled-color);color:var(--comp-input-text-disabled-color)}ap-input .input-wrapper .content input:disabled:placeholder{color:var(--comp-input-text-placeholder-color)}ap-input .input-wrapper .content input[type=search]::-webkit-search-decoration,ap-input .input-wrapper .content input[type=search]::-webkit-search-cancel-button,ap-input .input-wrapper .content input[type=search]::-webkit-search-results-button,ap-input .input-wrapper .content input[type=search]::-webkit-search-results-decoration{display:none}ap-input .input-wrapper .content .counter{font-size:var(--comp-input-text-counter-size);font-weight:var(--comp-input-text-counter-font-weight);line-height:var(--comp-input-text-counter-line-height);font-family:var(--comp-input-text-counter-font-family);color:var(--comp-input-text-counter-color);padding-right:var(--comp-input-spacing-horizontal)}ap-input .input-wrapper .content .clear-button{display:flex;align-items:center;justify-content:center;border:none;margin:0;padding:0 var(--comp-input-spacing-horizontal) 0 0;background-color:transparent}ap-input .input-wrapper .content .clear-button:hover{cursor:pointer}ap-input .input-wrapper .content .clear-button ap-symbol{padding:0}ap-input .input-wrapper .prefix,ap-input .input-wrapper .suffix{height:100%;display:flex;justify-content:center;align-items:center;font-size:var(--sys-text-style-body-size);font-weight:var(--sys-text-style-body-weight);line-height:var(--sys-text-style-body-line-height);font-family:var(--ref-font-family);color:var(--ref-color-grey-100)}ap-input .input-wrapper .prefix .divider,ap-input .input-wrapper .suffix .divider{height:18px;width:var(--border-width);background:var(--ref-color-grey-10)}ap-input .input-wrapper ap-symbol{height:var(--comp-input-icon-size);width:var(--comp-input-icon-size);min-height:var(--comp-input-icon-size);min-width:var(--comp-input-icon-size);max-height:var(--comp-input-icon-size);max-width:var(--comp-input-icon-size);color:var(--comp-input-icon-color);padding-right:var(--comp-input-padding-horizontal);pointer-events:none;box-sizing:content-box}ap-input .input-wrapper ap-symbol:hover{cursor:text}ap-input .input-wrapper.inverse{flex-direction:row-reverse}ap-input .input-wrapper.inverse.with-icon input{padding-left:0}ap-input .input-wrapper.inverse.with-icon ap-symbol{padding-right:var(--comp-input-spacing-horizontal);padding-left:var(--comp-input-padding-horizontal)}ap-input .input-wrapper.with-icon input{padding-right:var(--ref-spacing-xxxs)}ap-input .input-wrapper.with-prefix input{padding-left:var(--ref-spacing-xxs)}ap-input .input-wrapper.with-prefix .prefix{padding-left:var(--comp-input-padding-horizontal);gap:var(--ref-spacing-xxs)}ap-input .input-wrapper.with-suffix input{padding-right:var(--ref-spacing-xxs)}ap-input .input-wrapper.with-suffix .suffix{padding-right:var(--comp-input-padding-horizontal);gap:var(--ref-spacing-xxs)}ap-input .input-wrapper.with-counter input{padding-right:0}ap-input .input-wrapper.with-error{border-color:var(--comp-input-border-error-color)}ap-input .input-wrapper.with-success{border-color:var(--comp-input-border-success-color)}.form-message{font-size:var(--comp-forms-status-text-size);font-weight:var(--comp-forms-status-text-font-weight);line-height:var(--comp-forms-status-text-line-height);font-family:var(--comp-forms-status-text-font-family);margin:0;display:flex;gap:var(--ref-spacing-xxxs)}.form-message.error{color:var(--comp-forms-status-text-error-color)}.form-message.error ap-symbol{color:var(--comp-forms-status-icon-error-color)}.form-message.success{color:var(--comp-forms-status-text-success-color)}.form-message.success ap-symbol{color:var(--comp-forms-status-icon-success-color)}form.ng-submitted ap-input.ng-valid .input-wrapper{border-color:var(--comp-input-border-success-color)}form.ng-submitted ap-input.ng-invalid .input-wrapper{border-color:var(--comp-input-border-error-color)}\n"] }]
|
|
134
|
-
}], propDecorators: { symbols: [{
|
|
138
|
+
}], ctorParameters: () => [], propDecorators: { symbols: [{
|
|
135
139
|
type: ContentChildren,
|
|
136
140
|
args: [SymbolComponent]
|
|
137
141
|
}], symbolWrapper: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-legacy-input.mjs","sources":["../../../libs/ui-components/legacy/input/src/input.component.ts","../../../libs/ui-components/legacy/input/src/input.component.html","../../../libs/ui-components/legacy/input/src/agorapulse-ui-components-legacy-input.ts"],"sourcesContent":["import { SymbolComponent, SymbolRegistry, apClose, apErrorFill, apRoundedCheckFill, apSearch } from '@agorapulse/ui-symbol';\n\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n QueryList,\n ViewChild,\n ViewEncapsulation,\n WritableSignal,\n booleanAttribute,\n forwardRef,\n inject,\n signal,\n} from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALIDATORS, NG_VALUE_ACCESSOR } from '@angular/forms';\n\ntype InputType =\n | 'color'\n | 'datetime'\n | 'datetime-local'\n | 'email'\n | 'hidden'\n | 'month'\n | 'number'\n | 'password'\n | 'range'\n | 'search'\n | 'text'\n | 'tel'\n | 'time'\n | 'url'\n | 'week';\n\nexport const AP_INPUT_CONTROL_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => InputComponent),\n multi: true,\n};\n\nconst SEARCH_SYMBOL_ID = 'search';\n\n/**\n * @deprecated use native input with directive apInput, ap-input-group and ap-form-field instead\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-input',\n styleUrls: ['./input.component.scss'],\n imports: [FormsModule, SymbolComponent],\n providers: [\n AP_INPUT_CONTROL_VALUE_ACCESSOR,\n {\n provide: NG_VALIDATORS,\n useExisting: InputComponent,\n multi: true,\n },\n ],\n templateUrl: './input.component.html',\n encapsulation: ViewEncapsulation.None,\n})\nexport class InputComponent implements OnInit, AfterViewInit, ControlValueAccessor {\n readonly elementRef: ElementRef = inject(ElementRef);\n readonly symbolRegistry: SymbolRegistry = inject(SymbolRegistry);\n\n @ContentChildren(SymbolComponent) symbols!: QueryList<SymbolComponent>;\n @ViewChild('symbol') symbolWrapper!: ElementRef;\n @ViewChild('input') inputElement!: ElementRef;\n\n @Input() ariaLabel!: string;\n\n @Input() ariaLabelledBy!: string;\n\n @Input() ariaDescribedBy!: string;\n\n @Input() disabled: boolean = false;\n\n @Input() clearable: boolean = false;\n\n @Input() inputType: InputType = 'text';\n\n @Input() inputId?: string;\n\n @Input({\n required: true,\n })\n name!: string;\n\n @Input() label?: string;\n\n @Input() description?: string;\n\n @Input() prefix?: string;\n\n @Input() suffix?: string;\n\n @Input({ transform: booleanAttribute }) required: boolean = false;\n\n @Input() placeholder?: string;\n\n @Input() errorMessage?: string;\n\n @Input() successMessage?: string;\n\n @Input() symbolId?: string;\n @Input() symbolPosition: 'left' | 'right' = 'right';\n\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() focus = new EventEmitter<FocusEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() blur = new EventEmitter<FocusEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() keyup = new EventEmitter<KeyboardEvent>();\n\n private _controlValueAccessorChangeFn!: (value: string | null) => void;\n\n hostDataTest: WritableSignal<string | undefined> = signal<string | undefined>(undefined);\n\n value!: string | null;\n\n onTouched!: () => void;\n\n ngOnInit(): void {\n if (this.label && !this.inputId) {\n throw Error('You have to provide an input id if you want to use a label.');\n }\n if (this.inputType === 'search') {\n this.symbolId = SEARCH_SYMBOL_ID;\n this.symbolPosition = 'left';\n }\n this.hostDataTest.set(this.elementRef.nativeElement.getAttribute('data-test'));\n this.elementRef.nativeElement.removeAttribute('data-test');\n this.symbolRegistry.registerSymbols([apErrorFill, apRoundedCheckFill, apClose, apSearch]);\n }\n\n // Sometimes attributes like the id, or the data-test are dynamic and can change between the constructor and the initialization.\n // In order to have the last attributes value we check if it changes, and if it does, we run a mark for check to update the view.\n ngAfterViewInit(): void {\n const hostDataTest = this.elementRef.nativeElement.getAttribute('data-test');\n\n if (hostDataTest && this.hostDataTest() !== hostDataTest) {\n this.hostDataTest.set(hostDataTest);\n this.elementRef.nativeElement.removeAttribute('data-test');\n }\n }\n\n validate() {\n const isNotValid = !this.value && this.required;\n return (\n isNotValid && {\n invalid: true,\n }\n );\n }\n\n onValueChange() {\n if (this.onTouched) {\n this.onTouched();\n }\n\n if (!this.disabled) {\n if (this._controlValueAccessorChangeFn) {\n this._controlValueAccessorChangeFn(this.value);\n }\n }\n }\n\n writeValue(value: string | null): void {\n this.value = value;\n }\n\n registerOnChange(fn: (value: string | null) => void): void {\n this._controlValueAccessorChangeFn = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n focusInput(): void {\n this.inputElement.nativeElement.focus();\n }\n\n onBlurHandle($event: FocusEvent): void {\n this.blur.emit($event);\n }\n\n onFocusHandle($event: FocusEvent): void {\n this.focus.emit($event);\n }\n\n onKeyup($event: KeyboardEvent): void {\n this.keyup.emit($event);\n }\n\n onClear(): void {\n this.writeValue(null);\n }\n}\n","@if (label) {\n <label [for]=\"inputId\">\n <span>\n {{ label }}\n </span>\n @if (description) {\n <span class=\"description\">\n {{ description }}\n </span>\n }\n </label>\n}\n\n<div\n tabindex=\"0\"\n class=\"input-wrapper\"\n [class.inverse]=\"symbolPosition === 'left'\"\n [class.with-icon]=\"symbolId\"\n [class.with-prefix]=\"prefix\"\n [class.with-suffix]=\"suffix\"\n [class.with-error]=\"errorMessage\"\n [class.with-success]=\"successMessage\"\n [class.disabled]=\"disabled\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy || null\"\n [attr.aria-describedby]=\"ariaDescribedBy || null\"\n [attr.aria-disabled]=\"disabled?.toString()\"\n (click)=\"focusInput()\"\n (keydown.enter)=\"focusInput()\">\n @if (prefix) {\n <div class=\"prefix\">\n <span>\n {{ prefix }}\n </span>\n <span class=\"divider\"></span>\n </div>\n }\n <div class=\"content\">\n <input\n #input\n [type]=\"inputType\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [id]=\"inputId ?? ''\"\n [attr.data-test]=\"hostDataTest() ? hostDataTest() : name\"\n [(ngModel)]=\"value\"\n (blur)=\"onBlurHandle($event)\"\n (focus)=\"onFocusHandle($event)\"\n (keyup)=\"onKeyup($event)\"\n (ngModelChange)=\"onValueChange()\" />\n @if (clearable) {\n <button\n type=\"button\"\n class=\"clear-button\"\n (click)=\"onClear()\">\n <ap-symbol symbolId=\"close\" />\n </button>\n }\n </div>\n @if (suffix) {\n <div class=\"suffix\">\n <span class=\"divider\"></span>\n <span>\n {{ suffix }}\n </span>\n </div>\n }\n @if (symbolId) {\n <ap-symbol\n size=\"sm\"\n [symbolId]=\"symbolId\" />\n }\n</div>\n\n@if (errorMessage) {\n <div class=\"form-message error\">\n <ap-symbol\n symbolId=\"error_fill\"\n size=\"sm\" />\n <span>\n {{ errorMessage }}\n </span>\n </div>\n}\n\n@if (successMessage) {\n <div class=\"form-message success\">\n <ap-symbol\n symbolId=\"rounded-check_fill\"\n size=\"sm\" />\n <span>\n {{ successMessage }}\n </span>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"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EAAA,CAAA;sBAAtB;gBAGS,KAAK,EAAA,CAAA;sBAAd;gBAES,IAAI,EAAA,CAAA;sBAAb;gBAES,KAAK,EAAA,CAAA;sBAAd;;;AEtHL;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-legacy-input.mjs","sources":["../../../libs/ui-components/legacy/input/src/input.component.ts","../../../libs/ui-components/legacy/input/src/input.component.html","../../../libs/ui-components/legacy/input/src/agorapulse-ui-components-legacy-input.ts"],"sourcesContent":["import { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';\nimport { SymbolComponent, SymbolRegistry, apClose, apErrorFill, apRoundedCheckFill, apSearch } from '@agorapulse/ui-symbol';\n\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n QueryList,\n ViewChild,\n ViewEncapsulation,\n WritableSignal,\n booleanAttribute,\n forwardRef,\n inject,\n signal,\n} from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALIDATORS, NG_VALUE_ACCESSOR } from '@angular/forms';\n\ntype InputType =\n | 'color'\n | 'datetime'\n | 'datetime-local'\n | 'email'\n | 'hidden'\n | 'month'\n | 'number'\n | 'password'\n | 'range'\n | 'search'\n | 'text'\n | 'tel'\n | 'time'\n | 'url'\n | 'week';\n\nexport const AP_INPUT_CONTROL_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => InputComponent),\n multi: true,\n};\n\nconst SEARCH_SYMBOL_ID = 'search';\n\n/**\n * @deprecated use native input with directive apInput, ap-input-group and ap-form-field instead\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-input',\n styleUrls: ['./input.component.scss'],\n imports: [FormsModule, SymbolComponent],\n providers: [\n AP_INPUT_CONTROL_VALUE_ACCESSOR,\n {\n provide: NG_VALIDATORS,\n useExisting: InputComponent,\n multi: true,\n },\n ],\n templateUrl: './input.component.html',\n encapsulation: ViewEncapsulation.None,\n})\nexport class InputComponent implements OnInit, AfterViewInit, ControlValueAccessor {\n readonly elementRef: ElementRef = inject(ElementRef);\n readonly symbolRegistry: SymbolRegistry = inject(SymbolRegistry);\n\n constructor() {\n this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));\n }\n\n @ContentChildren(SymbolComponent) symbols!: QueryList<SymbolComponent>;\n @ViewChild('symbol') symbolWrapper!: ElementRef;\n @ViewChild('input') inputElement!: ElementRef;\n\n @Input() ariaLabel!: string;\n\n @Input() ariaLabelledBy!: string;\n\n @Input() ariaDescribedBy!: string;\n\n @Input() disabled: boolean = false;\n\n @Input() clearable: boolean = false;\n\n @Input() inputType: InputType = 'text';\n\n @Input() inputId?: string;\n\n @Input({\n required: true,\n })\n name!: string;\n\n @Input() label?: string;\n\n @Input() description?: string;\n\n @Input() prefix?: string;\n\n @Input() suffix?: string;\n\n @Input({ transform: booleanAttribute }) required: boolean = false;\n\n @Input() placeholder?: string;\n\n @Input() errorMessage?: string;\n\n @Input() successMessage?: string;\n\n @Input() symbolId?: string;\n @Input() symbolPosition: 'left' | 'right' = 'right';\n\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() focus = new EventEmitter<FocusEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() blur = new EventEmitter<FocusEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() keyup = new EventEmitter<KeyboardEvent>();\n\n private _controlValueAccessorChangeFn!: (value: string | null) => void;\n\n hostDataTest: WritableSignal<string | undefined> = signal<string | undefined>(undefined);\n\n value!: string | null;\n\n onTouched!: () => void;\n\n ngOnInit(): void {\n if (this.label && !this.inputId) {\n throw Error('You have to provide an input id if you want to use a label.');\n }\n if (this.inputType === 'search') {\n this.symbolId = SEARCH_SYMBOL_ID;\n this.symbolPosition = 'left';\n }\n this.hostDataTest.set(this.elementRef.nativeElement.getAttribute('data-test'));\n this.elementRef.nativeElement.removeAttribute('data-test');\n this.symbolRegistry.registerSymbols([apErrorFill, apRoundedCheckFill, apClose, apSearch]);\n }\n\n // Sometimes attributes like the id, or the data-test are dynamic and can change between the constructor and the initialization.\n // In order to have the last attributes value we check if it changes, and if it does, we run a mark for check to update the view.\n ngAfterViewInit(): void {\n const hostDataTest = this.elementRef.nativeElement.getAttribute('data-test');\n\n if (hostDataTest && this.hostDataTest() !== hostDataTest) {\n this.hostDataTest.set(hostDataTest);\n this.elementRef.nativeElement.removeAttribute('data-test');\n }\n }\n\n validate() {\n const isNotValid = !this.value && this.required;\n return (\n isNotValid && {\n invalid: true,\n }\n );\n }\n\n onValueChange() {\n if (this.onTouched) {\n this.onTouched();\n }\n\n if (!this.disabled) {\n if (this._controlValueAccessorChangeFn) {\n this._controlValueAccessorChangeFn(this.value);\n }\n }\n }\n\n writeValue(value: string | null): void {\n this.value = value;\n }\n\n registerOnChange(fn: (value: string | null) => void): void {\n this._controlValueAccessorChangeFn = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n focusInput(): void {\n this.inputElement.nativeElement.focus();\n }\n\n onBlurHandle($event: FocusEvent): void {\n this.blur.emit($event);\n }\n\n onFocusHandle($event: FocusEvent): void {\n this.focus.emit($event);\n }\n\n onKeyup($event: KeyboardEvent): void {\n this.keyup.emit($event);\n }\n\n onClear(): void {\n this.writeValue(null);\n }\n}\n","@if (label) {\n <label [for]=\"inputId\">\n <span>\n {{ label }}\n </span>\n @if (description) {\n <span class=\"description\">\n {{ description }}\n </span>\n }\n </label>\n}\n\n<div\n tabindex=\"0\"\n class=\"input-wrapper\"\n [class.inverse]=\"symbolPosition === 'left'\"\n [class.with-icon]=\"symbolId\"\n [class.with-prefix]=\"prefix\"\n [class.with-suffix]=\"suffix\"\n [class.with-error]=\"errorMessage\"\n [class.with-success]=\"successMessage\"\n [class.disabled]=\"disabled\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy || null\"\n [attr.aria-describedby]=\"ariaDescribedBy || null\"\n [attr.aria-disabled]=\"disabled?.toString()\"\n (click)=\"focusInput()\"\n (keydown.enter)=\"focusInput()\">\n @if (prefix) {\n <div class=\"prefix\">\n <span>\n {{ prefix }}\n </span>\n <span class=\"divider\"></span>\n </div>\n }\n <div class=\"content\">\n <input\n #input\n [type]=\"inputType\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [id]=\"inputId ?? ''\"\n [attr.data-test]=\"hostDataTest() ? hostDataTest() : name\"\n [(ngModel)]=\"value\"\n (blur)=\"onBlurHandle($event)\"\n (focus)=\"onFocusHandle($event)\"\n (keyup)=\"onKeyup($event)\"\n (ngModelChange)=\"onValueChange()\" />\n @if (clearable) {\n <button\n type=\"button\"\n class=\"clear-button\"\n (click)=\"onClear()\">\n <ap-symbol symbolId=\"close\" />\n </button>\n }\n </div>\n @if (suffix) {\n <div class=\"suffix\">\n <span class=\"divider\"></span>\n <span>\n {{ suffix }}\n </span>\n </div>\n }\n @if (symbolId) {\n <ap-symbol\n size=\"sm\"\n [symbolId]=\"symbolId\" />\n }\n</div>\n\n@if (errorMessage) {\n <div class=\"form-message error\">\n <ap-symbol\n symbolId=\"error_fill\"\n size=\"sm\" />\n <span>\n {{ errorMessage }}\n </span>\n </div>\n}\n\n@if (successMessage) {\n <div class=\"form-message success\">\n <ap-symbol\n symbolId=\"rounded-check_fill\"\n size=\"sm\" />\n <span>\n {{ successMessage }}\n </span>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAyCO,MAAM,+BAA+B,GAAG;AAC3C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,cAAc,CAAC;AAC7C,IAAA,KAAK,EAAE,IAAI;;AAGf,MAAM,gBAAgB,GAAG,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A,CAAA;sBAAtB;gBAGS,KAAK,EAAA,CAAA;sBAAd;gBAES,IAAI,EAAA,CAAA;sBAAb;gBAES,KAAK,EAAA,CAAA;sBAAd;;;AE3HL;;AAEG;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ButtonComponent } from '@agorapulse/ui-components/button';
|
|
2
1
|
import { IconButtonComponent } from '@agorapulse/ui-components/icon-button';
|
|
3
2
|
import * as i2 from '@agorapulse/ui-symbol';
|
|
4
3
|
import { apClose, SymbolComponent } from '@agorapulse/ui-symbol';
|
|
5
4
|
import { NgStyle, NgClass, NgTemplateOutlet } from '@angular/common';
|
|
6
5
|
import * as i0 from '@angular/core';
|
|
7
6
|
import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
7
|
+
import { firstValueFrom } from 'rxjs';
|
|
8
8
|
import * as i1 from '@angular/material/dialog';
|
|
9
9
|
|
|
10
10
|
class ModalComponent {
|
|
@@ -34,6 +34,19 @@ class ModalComponent {
|
|
|
34
34
|
/**
|
|
35
35
|
* Use it to open a modal containing the {@link componentType} component, with the right configuration.
|
|
36
36
|
*/
|
|
37
|
+
static openDialog(matDialog, config, componentType) {
|
|
38
|
+
return this.openWithComponent(matDialog, config, componentType);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Use it to open a modal containing the {@link componentType} component, with the right configuration, and wait for it to be closed.
|
|
42
|
+
*/
|
|
43
|
+
static async openDialogAndWait(matDialog, config, componentType) {
|
|
44
|
+
return firstValueFrom(ModalComponent.openDialog(matDialog, config, componentType).afterClosed());
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Use it to open a modal containing the {@link componentType} component, with the right configuration.
|
|
48
|
+
* @deprecated use {@link openDialog} instead for better type inference
|
|
49
|
+
*/
|
|
37
50
|
static openWithComponent(matDialog, config, componentType) {
|
|
38
51
|
let matDialogConfig;
|
|
39
52
|
if (config) {
|
|
@@ -63,7 +76,7 @@ class ModalComponent {
|
|
|
63
76
|
* Use it to open a modal containing the provided templates, with the right configuration.
|
|
64
77
|
*/
|
|
65
78
|
static openWithTemplates(matDialog, headerTemplate, mainTemplate, footerTemplate, config, sidePaneTemplate) {
|
|
66
|
-
const dialogRef = ModalComponent.
|
|
79
|
+
const dialogRef = ModalComponent.openDialog(matDialog, config, ModalComponent);
|
|
67
80
|
dialogRef.componentInstance.closable = config && config.closable ? config.closable : false;
|
|
68
81
|
dialogRef.componentInstance.headerBottomBorderEnabled =
|
|
69
82
|
config && config.headerBottomBorderEnabled ? config.headerBottomBorderEnabled : false;
|
|
@@ -81,7 +94,7 @@ class ModalComponent {
|
|
|
81
94
|
}
|
|
82
95
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: ModalComponent, decorators: [{
|
|
83
96
|
type: Component,
|
|
84
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-modal', imports: [SymbolComponent, NgStyle, NgClass,
|
|
97
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-modal', imports: [SymbolComponent, NgStyle, NgClass, NgTemplateOutlet, IconButtonComponent], template: "@if (sidePaneTemplate) {\n <div\n [ngStyle]=\"sidePaneStyle\"\n [ngClass]=\"{ pane: defaultLayout }\">\n <ng-template [ngTemplateOutlet]=\"sidePaneTemplate\" />\n </div>\n}\n\n<div\n class=\"modal-wrapper\"\n [ngStyle]=\"containerStyle\"\n [class.default-layout]=\"defaultLayout\">\n @if (closable) {\n <ap-icon-button\n class=\"close-button\"\n ariaLabel=\"Close button\"\n name=\"close-button\"\n color=\"none\"\n type=\"flat\"\n (onClick)=\"close()\">\n <ap-symbol symbolId=\"close\" />\n </ap-icon-button>\n }\n @if (headerTemplate && headerVisible) {\n <div\n [ngStyle]=\"headerStyle\"\n [ngClass]=\"{ header: defaultLayout }\"\n [class.border-bottom]=\"headerBottomBorderEnabled\">\n <ng-template [ngTemplateOutlet]=\"headerTemplate\" />\n </div>\n }\n @if (mainTemplate) {\n <div\n [ngStyle]=\"contentStyle\"\n [class.content]=\"defaultLayout\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\" />\n </div>\n }\n @if (footerTemplate && footerVisible) {\n <div\n [ngStyle]=\"footerStyle\"\n [ngClass]=\"{ footer: defaultLayout }\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\" />\n </div>\n }\n</div>\n", styles: ["[color=facebook]{color:#0866ff}[bgcolor=facebook],[hcolor=facebook]:hover{background-color:#0866ff}[border=facebook]{border:1px solid #0866ff}[color=google]{color:#4e85e8}[bgcolor=google],[hcolor=google]:hover{background-color:#4e85e8}[border=google]{border:1px solid #4e85e8}[color=instagram]{color:#e1306c}[bgcolor=instagram],[hcolor=instagram]:hover{background-color:#e1306c}[border=instagram]{border:1px solid #e1306c}[color=instagrammagenta]{color:#c13584}[bgcolor=instagrammagenta],[hcolor=instagrammagenta]:hover{background-color:#c13584}[border=instagrammagenta]{border:1px solid #c13584}[color=instagramblue]{color:#5851db}[bgcolor=instagramblue],[hcolor=instagramblue]:hover{background-color:#5851db}[border=instagramblue]{border:1px solid #5851db}[color=instagrampurple]{color:#833ab4}[bgcolor=instagrampurple],[hcolor=instagrampurple]:hover{background-color:#833ab4}[border=instagrampurple]{border:1px solid #833ab4}[color=instagramorange]{color:#f56040}[bgcolor=instagramorange],[hcolor=instagramorange]:hover{background-color:#f56040}[border=instagramorange]{border:1px solid #f56040}[color=instagramyellow]{color:#ffdc80}[bgcolor=instagramyellow],[hcolor=instagramyellow]:hover{background-color:#ffdc80}[border=instagramyellow]{border:1px solid #ffdc80}[color=linkedin]{color:#2c67bc}[bgcolor=linkedin],[hcolor=linkedin]:hover{background-color:#2c67bc}[border=linkedin]{border:1px solid #2c67bc}[color=twitter]{color:#55acee}[bgcolor=twitter],[hcolor=twitter]:hover{background-color:#55acee}[border=twitter]{border:1px solid #55acee}[color=youtube]{color:red}[bgcolor=youtube],[hcolor=youtube]:hover{background-color:red}[border=youtube]{border:1px solid #ff0000}[color=reddit]{color:#ff4500}[bgcolor=reddit],[hcolor=reddit]:hover{background-color:#ff4500}[border=reddit]{border:1px solid #ff4500}[color=blood-orange]{color:#ff4d00}[bgcolor=blood-orange],[hcolor=blood-orange]:hover{background-color:#ff4d00}[border=blood-orange]{border:1px solid #ff4d00}[color=pinkish-orange]{color:#ff7b49}[bgcolor=pinkish-orange],[hcolor=pinkish-orange]:hover{background-color:#ff7b49}[border=pinkish-orange]{border:1px solid #ff7b49}[color=charcoal-grey]{color:#2a2f34}[bgcolor=charcoal-grey],[hcolor=charcoal-grey]:hover{background-color:#2a2f34}[border=charcoal-grey]{border:1px solid #2a2f34}[color=azure]{color:#00aeef}[bgcolor=azure],[hcolor=azure]:hover{background-color:#00aeef}[border=azure]{border:1px solid #00aeef}[color=light-azure]{color:#eaf5fd}[bgcolor=light-azure],[hcolor=light-azure]:hover{background-color:#eaf5fd}[border=light-azure]{border:1px solid #eaf5fd}[color=blue-grey]{color:#8d98a9}[bgcolor=blue-grey],[hcolor=blue-grey]:hover{background-color:#8d98a9}[border=blue-grey]{border:1px solid #8d98a9}[color=silver]{color:#ced0da}[bgcolor=silver],[hcolor=silver]:hover{background-color:#ced0da}[border=silver]{border:1px solid #ced0da}[color=pale-grey]{color:#dfe3e9}[bgcolor=pale-grey],[hcolor=pale-grey]:hover{background-color:#dfe3e9}[border=pale-grey]{border:1px solid #dfe3e9}[color=grey-white]{color:#f5f7f8}[bgcolor=grey-white],[hcolor=grey-white]:hover{background-color:#f5f7f8}[border=grey-white]{border:1px solid #f5f7f8}[color=cool-grey]{color:#b4bbc6}[bgcolor=cool-grey],[hcolor=cool-grey]:hover{background-color:#b4bbc6}[border=cool-grey]{border:1px solid #b4bbc6}[color=black]{color:#344563}[bgcolor=black],[hcolor=black]:hover{background-color:#344563}[border=black]{border:1px solid #344563}[color=grey-blue]{color:#68768c}[bgcolor=grey-blue],[hcolor=grey-blue]:hover{background-color:#68768c}[border=grey-blue]{border:1px solid #68768c}[color=strawberry]{color:#f4282d}[bgcolor=strawberry],[hcolor=strawberry]:hover{background-color:#f4282d}[border=strawberry]{border:1px solid #f4282d}[color=light-strawberry]{color:#f8eded}[bgcolor=light-strawberry],[hcolor=light-strawberry]:hover{background-color:#f8eded}[border=light-strawberry]{border:1px solid #f8eded}[color=white]{color:#fff}[bgcolor=white],[hcolor=white]:hover{background-color:#fff}[border=white]{border:1px solid #ffffff}[color=cool-green]{color:#33c15d}[bgcolor=cool-green],[hcolor=cool-green]:hover{background-color:#33c15d}[border=cool-green]{border:1px solid #33c15d}[color=light-green]{color:#ebfaef}[bgcolor=light-green],[hcolor=light-green]:hover{background-color:#ebfaef}[border=light-green]{border:1px solid #ebfaef}[color=transparent]{color:transparent}[bgcolor=transparent],[hcolor=transparent]:hover{background-color:transparent}[border=transparent]{border:1px solid transparent}[color=c0]{color:#a566a5}[bgcolor=c0],[hcolor=c0]:hover{background-color:#a566a5}[border=c0]{border:1px solid #a566a5}[color=c1]{color:#c7ab82}[bgcolor=c1],[hcolor=c1]:hover{background-color:#c7ab82}[border=c1]{border:1px solid #c7ab82}[color=c2]{color:#f2713c}[bgcolor=c2],[hcolor=c2]:hover{background-color:#f2713c}[border=c2]{border:1px solid #f2713c}[color=c3]{color:#ffd006}[bgcolor=c3],[hcolor=c3]:hover{background-color:#ffd006}[border=c3]{border:1px solid #ffd006}[color=c4]{color:#94c5aa}[bgcolor=c4],[hcolor=c4]:hover{background-color:#94c5aa}[border=c4]{border:1px solid #94c5aa}[color=c5]{color:#2a9d8f}[bgcolor=c5],[hcolor=c5]:hover{background-color:#2a9d8f}[border=c5]{border:1px solid #2a9d8f}[color=c6]{color:#78acd8}[bgcolor=c6],[hcolor=c6]:hover{background-color:#78acd8}[border=c6]{border:1px solid #78acd8}[color=c7]{color:#525a9e}[bgcolor=c7],[hcolor=c7]:hover{background-color:#525a9e}[border=c7]{border:1px solid #525a9e}[color=c8]{color:#6a2459}[bgcolor=c8],[hcolor=c8]:hover{background-color:#6a2459}[border=c8]{border:1px solid #6a2459}[color=c9]{color:#74729e}[bgcolor=c9],[hcolor=c9]:hover{background-color:#74729e}[border=c9]{border:1px solid #74729e}:host{display:flex;flex-direction:row;max-height:90vh}.modal-wrapper{position:relative;width:100%;display:flex;flex-direction:column}.modal-wrapper.default-layout{padding-top:24px;padding-bottom:16px}.modal-wrapper .close-button{margin:-12px;position:absolute;right:24px;top:24px}.modal-wrapper .close-button ap-symbol{height:12px;width:12px}.modal-wrapper .header ::ng-deep h2{margin-top:0}.modal-wrapper .header{padding:0 24px 16px}.modal-wrapper .header.border-bottom{border-bottom:1px solid #eaecef;margin-bottom:16px}.modal-wrapper .content{color:#5d6a82;font-size:16px;padding:0 24px;flex:1;overflow-y:auto;overflow-x:hidden}.modal-wrapper .footer{align-items:center;box-shadow:0 1px #eaecef inset;display:flex;justify-content:flex-end;margin-top:24px;padding:16px 24px 0}.pane{padding:24px}::ng-deep .modal-container{max-width:100vw!important;margin:24px 24px 64px}::ng-deep .modal-container .mat-mdc-dialog-container .mdc-dialog__surface{border-radius:10px;box-shadow:0 25px 50px #0000000a;max-width:100vw;padding:0}::ng-deep .cdk-overlay-dark-backdrop{background:#344563b3}\n"] }]
|
|
85
98
|
}], ctorParameters: () => [{ type: i1.MatDialogRef }, { type: i2.SymbolRegistry }], propDecorators: { closable: [{
|
|
86
99
|
type: Input
|
|
87
100
|
}], headerBottomBorderEnabled: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-modal.mjs","sources":["../../../libs/ui-components/modal/src/modal.component.ts","../../../libs/ui-components/modal/src/modal.component.html","../../../libs/ui-components/modal/src/agorapulse-ui-components-modal.ts"],"sourcesContent":["import { ButtonComponent } from '@agorapulse/ui-components/button';\nimport { IconButtonComponent } from '@agorapulse/ui-components/icon-button';\nimport { apClose, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, Input, TemplateRef } from '@angular/core';\nimport { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog';\n\nexport interface ModalConfig<T = unknown> extends ModalConfigBase<T> {\n closable?: boolean;\n headerBottomBorderEnabled?: boolean;\n}\n\nexport interface ModalConfigBase<T> {\n backdropCloseEnable?: boolean;\n matDialogConfig?: MatDialogConfig<T>;\n}\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-modal',\n templateUrl: 'modal.component.html',\n imports: [SymbolComponent, NgStyle, NgClass, ButtonComponent, NgTemplateOutlet, IconButtonComponent],\n styleUrls: ['modal.component.scss'],\n})\nexport class ModalComponent {\n static readonly PANEL_CLASS = 'modal-container';\n\n constructor(\n public dialogRef: MatDialogRef<ComponentType<any>>,\n public symbolRegistry: SymbolRegistry\n ) {\n dialogRef.disableClose = true;\n this.symbolRegistry.registerSymbols([apClose]);\n }\n\n @Input() closable = false;\n @Input() headerBottomBorderEnabled = false;\n @Input() footerTemplate: TemplateRef<any> | undefined = undefined;\n @Input() footerVisible = true;\n @Input() headerTemplate: TemplateRef<any> | undefined = undefined;\n @Input() headerVisible = true;\n @Input({\n required: true,\n })\n mainTemplate!: TemplateRef<any>;\n @Input() sidePaneTemplate: TemplateRef<any> | undefined = undefined;\n @Input() sidePaneStyle: { [arg: string]: string } | undefined = {};\n @Input() containerStyle: { [arg: string]: string } | undefined = {};\n @Input() headerStyle: { [arg: string]: string } | undefined = {};\n @Input() contentStyle: { [arg: string]: string } | undefined = {};\n @Input() footerStyle: { [arg: string]: string } | undefined = {};\n @Input() defaultLayout = true;\n\n /**\n * Use it to open a modal containing the {@link componentType} component, with the right configuration.\n */\n static openWithComponent<T, Y>(\n matDialog: MatDialog,\n config: ModalConfigBase<Y> | undefined,\n componentType: ComponentType<T>\n ): MatDialogRef<T> {\n let matDialogConfig: MatDialogConfig<Y> | undefined;\n if (config) {\n matDialogConfig = config.matDialogConfig;\n if (matDialogConfig && config.matDialogConfig) {\n matDialogConfig.panelClass = Array.isArray(config.matDialogConfig.panelClass)\n ? [...config.matDialogConfig.panelClass, ModalComponent.PANEL_CLASS] // in case where the panelClass is an array\n : [config.matDialogConfig.panelClass ?? '', ModalComponent.PANEL_CLASS]; // in the other case, it's a String\n } else {\n matDialogConfig = { panelClass: ModalComponent.PANEL_CLASS };\n }\n } else {\n matDialogConfig = {\n panelClass: ModalComponent.PANEL_CLASS,\n };\n }\n matDialogConfig.autoFocus = false; // Prevent first button to be focused\n\n const dialogRef = matDialog.open(componentType, matDialogConfig);\n if (config?.backdropCloseEnable === true) {\n dialogRef.disableClose = false;\n }\n return dialogRef;\n }\n\n /**\n * Use it to open a modal containing the provided templates, with the right configuration.\n */\n static openWithTemplates<T>(\n matDialog: MatDialog,\n headerTemplate: TemplateRef<any> | undefined,\n mainTemplate: TemplateRef<any>,\n footerTemplate?: TemplateRef<any> | undefined,\n config?: ModalConfig<T>,\n sidePaneTemplate?: TemplateRef<any> | undefined\n ): MatDialogRef<ModalComponent> {\n const dialogRef = ModalComponent.openWithComponent(matDialog, config, ModalComponent);\n dialogRef.componentInstance.closable = config && config.closable ? config.closable : false;\n dialogRef.componentInstance.headerBottomBorderEnabled =\n config && config.headerBottomBorderEnabled ? config.headerBottomBorderEnabled : false;\n dialogRef.componentInstance.headerTemplate = headerTemplate;\n dialogRef.componentInstance.mainTemplate = mainTemplate;\n dialogRef.componentInstance.footerTemplate = footerTemplate;\n dialogRef.componentInstance.sidePaneTemplate = sidePaneTemplate;\n return dialogRef;\n }\n\n close(): void {\n this.dialogRef.close();\n }\n}\n","@if (sidePaneTemplate) {\n <div\n [ngStyle]=\"sidePaneStyle\"\n [ngClass]=\"{ pane: defaultLayout }\">\n <ng-template [ngTemplateOutlet]=\"sidePaneTemplate\" />\n </div>\n}\n\n<div\n class=\"modal-wrapper\"\n [ngStyle]=\"containerStyle\"\n [class.default-layout]=\"defaultLayout\">\n @if (closable) {\n <ap-icon-button\n class=\"close-button\"\n ariaLabel=\"Close button\"\n name=\"close-button\"\n color=\"none\"\n type=\"flat\"\n (onClick)=\"close()\">\n <ap-symbol symbolId=\"close\" />\n </ap-icon-button>\n }\n @if (headerTemplate && headerVisible) {\n <div\n [ngStyle]=\"headerStyle\"\n [ngClass]=\"{ header: defaultLayout }\"\n [class.border-bottom]=\"headerBottomBorderEnabled\">\n <ng-template [ngTemplateOutlet]=\"headerTemplate\" />\n </div>\n }\n @if (mainTemplate) {\n <div\n [ngStyle]=\"contentStyle\"\n [class.content]=\"defaultLayout\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\" />\n </div>\n }\n @if (footerTemplate && footerVisible) {\n <div\n [ngStyle]=\"footerStyle\"\n [ngClass]=\"{ footer: defaultLayout }\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\" />\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;MAyBa,cAAc,CAAA;AAIZ,IAAA,SAAA;AACA,IAAA,cAAA;AAJX,IAAA,OAAgB,WAAW,GAAG,iBAAiB;IAE/C,WAAA,CACW,SAA2C,EAC3C,cAA8B,EAAA;QAD9B,IAAA,CAAA,SAAS,GAAT,SAAS;QACT,IAAA,CAAA,cAAc,GAAd,cAAc;AAErB,QAAA,SAAS,CAAC,YAAY,GAAG,IAAI;QAC7B,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC;IAClD;IAES,QAAQ,GAAG,KAAK;IAChB,yBAAyB,GAAG,KAAK;IACjC,cAAc,GAAiC,SAAS;IACxD,aAAa,GAAG,IAAI;IACpB,cAAc,GAAiC,SAAS;IACxD,aAAa,GAAG,IAAI;AAI7B,IAAA,YAAY;IACH,gBAAgB,GAAiC,SAAS;IAC1D,aAAa,GAA0C,EAAE;IACzD,cAAc,GAA0C,EAAE;IAC1D,WAAW,GAA0C,EAAE;IACvD,YAAY,GAA0C,E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AE,mBAAmB,CAAC,EAAA,QAAA,EAAA,+4CAAA,EAAA,MAAA,EAAA,CAAA,4mNAAA,CAAA,EAAA;8GAc3F,QAAQ,EAAA,CAAA;sBAAhB;gBACQ,yBAAyB,EAAA,CAAA;sBAAjC;gBACQ,cAAc,EAAA,CAAA;sBAAtB;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBACQ,cAAc,EAAA,CAAA;sBAAtB;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBAID,YAAY,EAAA,CAAA;sBAHX,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA;AACH,wBAAA,QAAQ,EAAE,IAAI;AACjB,qBAAA;gBAEQ,gBAAgB,EAAA,CAAA;sBAAxB;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBACQ,cAAc,EAAA,CAAA;sBAAtB;gBACQ,WAAW,EAAA,CAAA;sBAAnB;gBACQ,YAAY,EAAA,CAAA;sBAApB;gBACQ,WAAW,EAAA,CAAA;sBAAnB;gBACQ,aAAa,EAAA,CAAA;sBAArB;;;AEpDL;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-modal.mjs","sources":["../../../libs/ui-components/modal/src/modal.component.ts","../../../libs/ui-components/modal/src/modal.component.html","../../../libs/ui-components/modal/src/agorapulse-ui-components-modal.ts"],"sourcesContent":["import { IconButtonComponent } from '@agorapulse/ui-components/icon-button';\nimport { apClose, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, Input, TemplateRef } from '@angular/core';\nimport { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog';\nimport { firstValueFrom } from 'rxjs';\n\nexport interface ModalConfig<T = unknown> extends ModalConfigBase<T> {\n closable?: boolean;\n headerBottomBorderEnabled?: boolean;\n}\n\nexport interface ModalConfigBase<T> {\n backdropCloseEnable?: boolean;\n matDialogConfig?: MatDialogConfig<T>;\n}\n\ninterface HasDialogRef<T, R> {\n dialogRef: MatDialogRef<T, R>;\n}\ntype HasModalData<D> = {\n [x in 'modalData' | 'dialogData' | 'data']: D;\n};\n\ntype ExtractDialogRef<C> = C extends HasDialogRef<infer T, infer R> ? MatDialogRef<T, R> : MatDialogRef<C>;\ntype ExtractModalData<C> = C extends HasModalData<infer D> ? D : unknown;\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-modal',\n templateUrl: 'modal.component.html',\n imports: [SymbolComponent, NgStyle, NgClass, NgTemplateOutlet, IconButtonComponent],\n styleUrls: ['modal.component.scss'],\n})\nexport class ModalComponent {\n static readonly PANEL_CLASS = 'modal-container';\n\n constructor(\n public dialogRef: MatDialogRef<ModalComponent, void>,\n public symbolRegistry: SymbolRegistry\n ) {\n dialogRef.disableClose = true;\n this.symbolRegistry.registerSymbols([apClose]);\n }\n\n @Input() closable = false;\n @Input() headerBottomBorderEnabled = false;\n @Input() footerTemplate: TemplateRef<any> | undefined = undefined;\n @Input() footerVisible = true;\n @Input() headerTemplate: TemplateRef<any> | undefined = undefined;\n @Input() headerVisible = true;\n @Input({\n required: true,\n })\n mainTemplate!: TemplateRef<any>;\n @Input() sidePaneTemplate: TemplateRef<any> | undefined = undefined;\n @Input() sidePaneStyle: { [arg: string]: string } | undefined = {};\n @Input() containerStyle: { [arg: string]: string } | undefined = {};\n @Input() headerStyle: { [arg: string]: string } | undefined = {};\n @Input() contentStyle: { [arg: string]: string } | undefined = {};\n @Input() footerStyle: { [arg: string]: string } | undefined = {};\n @Input() defaultLayout = true;\n\n /**\n * Use it to open a modal containing the {@link componentType} component, with the right configuration.\n */\n static openDialog<C>(matDialog: MatDialog, config: ModalConfigBase<ExtractModalData<C>> | undefined, componentType: ComponentType<C>) {\n return this.openWithComponent(matDialog, config, componentType) as ExtractDialogRef<C>;\n }\n\n /**\n * Use it to open a modal containing the {@link componentType} component, with the right configuration, and wait for it to be closed.\n */\n static async openDialogAndWait<C>(\n matDialog: MatDialog,\n config: ModalConfigBase<ExtractModalData<C>> | undefined,\n componentType: ComponentType<C>\n ): Promise<C extends HasDialogRef<unknown, infer R> ? R : unknown> {\n return firstValueFrom(ModalComponent.openDialog(matDialog, config, componentType).afterClosed());\n }\n\n /**\n * Use it to open a modal containing the {@link componentType} component, with the right configuration.\n * @deprecated use {@link openDialog} instead for better type inference\n */\n static openWithComponent<T, Y>(\n matDialog: MatDialog,\n config: ModalConfigBase<Y> | undefined,\n componentType: ComponentType<T>\n ): MatDialogRef<T> {\n let matDialogConfig: MatDialogConfig<Y> | undefined;\n if (config) {\n matDialogConfig = config.matDialogConfig;\n if (matDialogConfig && config.matDialogConfig) {\n matDialogConfig.panelClass = Array.isArray(config.matDialogConfig.panelClass)\n ? [...config.matDialogConfig.panelClass, ModalComponent.PANEL_CLASS] // in case where the panelClass is an array\n : [config.matDialogConfig.panelClass ?? '', ModalComponent.PANEL_CLASS]; // in the other case, it's a String\n } else {\n matDialogConfig = { panelClass: ModalComponent.PANEL_CLASS };\n }\n } else {\n matDialogConfig = {\n panelClass: ModalComponent.PANEL_CLASS,\n };\n }\n matDialogConfig.autoFocus = false; // Prevent first button to be focused\n\n const dialogRef = matDialog.open(componentType, matDialogConfig);\n if (config?.backdropCloseEnable === true) {\n dialogRef.disableClose = false;\n }\n return dialogRef;\n }\n\n /**\n * Use it to open a modal containing the provided templates, with the right configuration.\n */\n static openWithTemplates<T>(\n matDialog: MatDialog,\n headerTemplate: TemplateRef<any> | undefined,\n mainTemplate: TemplateRef<any>,\n footerTemplate?: TemplateRef<any> | undefined,\n config?: ModalConfig<T>,\n sidePaneTemplate?: TemplateRef<any> | undefined\n ): MatDialogRef<ModalComponent> {\n const dialogRef = ModalComponent.openDialog(matDialog, config, ModalComponent);\n dialogRef.componentInstance.closable = config && config.closable ? config.closable : false;\n dialogRef.componentInstance.headerBottomBorderEnabled =\n config && config.headerBottomBorderEnabled ? config.headerBottomBorderEnabled : false;\n dialogRef.componentInstance.headerTemplate = headerTemplate;\n dialogRef.componentInstance.mainTemplate = mainTemplate;\n dialogRef.componentInstance.footerTemplate = footerTemplate;\n dialogRef.componentInstance.sidePaneTemplate = sidePaneTemplate;\n return dialogRef;\n }\n\n close(): void {\n this.dialogRef.close();\n }\n}\n","@if (sidePaneTemplate) {\n <div\n [ngStyle]=\"sidePaneStyle\"\n [ngClass]=\"{ pane: defaultLayout }\">\n <ng-template [ngTemplateOutlet]=\"sidePaneTemplate\" />\n </div>\n}\n\n<div\n class=\"modal-wrapper\"\n [ngStyle]=\"containerStyle\"\n [class.default-layout]=\"defaultLayout\">\n @if (closable) {\n <ap-icon-button\n class=\"close-button\"\n ariaLabel=\"Close button\"\n name=\"close-button\"\n color=\"none\"\n type=\"flat\"\n (onClick)=\"close()\">\n <ap-symbol symbolId=\"close\" />\n </ap-icon-button>\n }\n @if (headerTemplate && headerVisible) {\n <div\n [ngStyle]=\"headerStyle\"\n [ngClass]=\"{ header: defaultLayout }\"\n [class.border-bottom]=\"headerBottomBorderEnabled\">\n <ng-template [ngTemplateOutlet]=\"headerTemplate\" />\n </div>\n }\n @if (mainTemplate) {\n <div\n [ngStyle]=\"contentStyle\"\n [class.content]=\"defaultLayout\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\" />\n </div>\n }\n @if (footerTemplate && footerVisible) {\n <div\n [ngStyle]=\"footerStyle\"\n [ngClass]=\"{ footer: defaultLayout }\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\" />\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;MAmCa,cAAc,CAAA;AAIZ,IAAA,SAAA;AACA,IAAA,cAAA;AAJX,IAAA,OAAgB,WAAW,GAAG,iBAAiB;IAE/C,WAAA,CACW,SAA6C,EAC7C,cAA8B,EAAA;QAD9B,IAAA,CAAA,SAAS,GAAT,SAAS;QACT,IAAA,CAAA,cAAc,GAAd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;gBACQ,cAAc,EAAA,CAAA;sBAAtB;gBACQ,WAAW,EAAA,CAAA;sBAAnB;gBACQ,YAAY,EAAA,CAAA;sBAApB;gBACQ,WAAW,EAAA,CAAA;sBAAnB;gBACQ,aAAa,EAAA,CAAA;sBAArB;;;AE9DL;;AAEG;;;;"}
|
|
@@ -5,6 +5,7 @@ import * as i0 from '@angular/core';
|
|
|
5
5
|
import { input, inject, Component, afterEveryRender, Directive, effect, untracked, signal, computed, Injectable, ChangeDetectionStrategy, contentChildren, output, viewChild, model, contentChild, ElementRef, afterNextRender } from '@angular/core';
|
|
6
6
|
import { IconButtonComponent } from '@agorapulse/ui-components/icon-button';
|
|
7
7
|
import { InputSearchComponent } from '@agorapulse/ui-components/input-search';
|
|
8
|
+
import { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';
|
|
8
9
|
import { trigger, state, transition, style, animate, keyframes } from '@angular/animations';
|
|
9
10
|
import { NgTemplateOutlet } from '@angular/common';
|
|
10
11
|
import { outputFromObservable, toObservable } from '@angular/core/rxjs-interop';
|
|
@@ -18,7 +19,6 @@ import { apMore, apFeatureLock as apFeatureLock$1, apPlus } from '@agorapulse/ui
|
|
|
18
19
|
import { CheckboxComponent } from '@agorapulse/ui-components/checkbox';
|
|
19
20
|
import { CounterComponent } from '@agorapulse/ui-components/counter';
|
|
20
21
|
import { ActionDropdownComponent, ActionDropdownTriggerDirective } from '@agorapulse/ui-components/action-dropdown';
|
|
21
|
-
import { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';
|
|
22
22
|
|
|
23
23
|
class NavSelectorPopoverItemComponent {
|
|
24
24
|
selected = input(false, ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
@@ -2982,6 +2982,7 @@ const EXPANDED_STATE_WIDTH = '224px';
|
|
|
2982
2982
|
const MINIFIED_STATE_WIDTH = '64px';
|
|
2983
2983
|
let nextUniqueId = 0;
|
|
2984
2984
|
class NavSelectorComponent {
|
|
2985
|
+
symbolRegistry = inject(SymbolRegistry);
|
|
2985
2986
|
navSelectorEntries = input.required(...(ngDevMode ? [{ debugName: "navSelectorEntries" }] : []));
|
|
2986
2987
|
translatedTexts = input.required(...(ngDevMode ? [{ debugName: "translatedTexts" }] : []));
|
|
2987
2988
|
multipleModeEnabled = input(false, ...(ngDevMode ? [{ debugName: "multipleModeEnabled" }] : []));
|
|
@@ -3010,10 +3011,10 @@ class NavSelectorComponent {
|
|
|
3010
3011
|
stableNavSelectorEntries = computed(() => this.navSelectorEntries(), ...(ngDevMode ? [{ debugName: "stableNavSelectorEntries", equal: isEqual }] : [{ equal: isEqual }]));
|
|
3011
3012
|
expanded = this.navSelectorState.expanded.asReadonly();
|
|
3012
3013
|
entries = computed(() => this.navSelectorState.entries(), ...(ngDevMode ? [{ debugName: "entries", equal: isEqual }] : [{ equal: isEqual }]));
|
|
3013
|
-
selectableEntryUids = computed(() => computeSelectableUids(this.entries()), ...(ngDevMode ? [{ debugName: "selectableEntryUids", equal: isEqual }] : [{ equal: isEqual }]));
|
|
3014
3014
|
visibleEntryUids = computed(() => computeVisibleUids(this.entries()), ...(ngDevMode ? [{ debugName: "visibleEntryUids", equal: isEqual }] : [{ equal: isEqual }]));
|
|
3015
3015
|
visibleAccountsChange = outputFromObservable(toObservable(this.visibleEntryUids).pipe(map(visibleAccountUids => ({ visibleAccountUids }))));
|
|
3016
3016
|
constructor() {
|
|
3017
|
+
this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));
|
|
3017
3018
|
this.navSelectorState.style = this.style;
|
|
3018
3019
|
this.navSelectorState.registerOnSelectedUidsChange(selectedUids => {
|
|
3019
3020
|
const isInit = !!this.entries().length;
|