@agorapulse/ui-components 16.2.22 → 16.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agorapulse-ui-components-16.3.0.tgz +0 -0
- package/autocomplete/autocomplete.component.d.ts +3 -3
- package/esm2022/autocomplete/autocomplete.component.mjs +21 -8
- package/esm2022/datepicker/datepicker.component.mjs +3 -3
- package/esm2022/form-field/agorapulse-ui-components-form-field.mjs +5 -0
- package/esm2022/form-field/form-field.component.mjs +11 -0
- package/esm2022/form-field/public_api.mjs +2 -0
- package/esm2022/form-message/agorapulse-ui-components-form-message.mjs +5 -0
- package/esm2022/form-message/form-message.component.mjs +34 -0
- package/esm2022/form-message/public_api.mjs +2 -0
- package/esm2022/index.mjs +4 -4
- package/esm2022/input/input.directive.mjs +19 -0
- package/esm2022/input/public_api.mjs +2 -2
- package/esm2022/input-group/agorapulse-ui-components-input-group.mjs +5 -0
- package/esm2022/input-group/input-group.component.mjs +14 -0
- package/esm2022/input-group/public_api.mjs +2 -0
- package/esm2022/labels/label.component.mjs +3 -3
- package/esm2022/legacy/input/agorapulse-ui-components-legacy-input.mjs +5 -0
- package/esm2022/{input → legacy/input}/input.component.mjs +4 -1
- package/esm2022/legacy/input/public_api.mjs +2 -0
- package/esm2022/legacy/select/agorapulse-ui-components-legacy-select.mjs +5 -0
- package/esm2022/legacy/select/public_api.mjs +2 -0
- package/esm2022/{select → legacy/select}/select.component.mjs +5 -2
- package/esm2022/legacy/textarea/agorapulse-ui-components-legacy-textarea.mjs +5 -0
- package/esm2022/legacy/textarea/public_api.mjs +2 -0
- package/esm2022/{textarea → legacy/textarea}/textarea.component.mjs +4 -1
- package/esm2022/select/ap-select.module.mjs +72 -0
- package/esm2022/select/dropdown-group-item/dropdown-group-item.component.mjs +52 -0
- package/esm2022/select/dropdown-item-multiple-one-line/dropdown-item-multiple-one-line.component.mjs +61 -0
- package/esm2022/select/dropdown-item-multiple-two-lines/dropdown-item-multiple-two-lines.component.mjs +65 -0
- package/esm2022/select/dropdown-item-single-one-line/dropdown-item-single-one-line.component.mjs +39 -0
- package/esm2022/select/dropdown-item-single-two-lines/dropdown-item-single-two-lines.component.mjs +43 -0
- package/esm2022/select/dropdown-search-form/dropdown-search-form.component.mjs +77 -0
- package/esm2022/select/public_api.mjs +13 -2
- package/esm2022/select/select-base.directive.mjs +69 -0
- package/esm2022/select/select-label-multiple/select-label-multiple.component.mjs +111 -0
- package/esm2022/select/select-label-single/select-label-single.component.mjs +27 -0
- package/esm2022/select/select-multiple.directive.mjs +34 -0
- package/esm2022/select/select-single.directive.mjs +34 -0
- package/esm2022/textarea/public_api.mjs +2 -2
- package/esm2022/textarea/textarea.directive.mjs +40 -0
- package/fesm2022/agorapulse-ui-components-autocomplete.mjs +20 -7
- package/fesm2022/agorapulse-ui-components-autocomplete.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-datepicker.mjs +2 -2
- package/fesm2022/agorapulse-ui-components-datepicker.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-form-field.mjs +18 -0
- package/fesm2022/agorapulse-ui-components-form-field.mjs.map +1 -0
- package/fesm2022/agorapulse-ui-components-form-message.mjs +41 -0
- package/fesm2022/agorapulse-ui-components-form-message.mjs.map +1 -0
- package/fesm2022/agorapulse-ui-components-input-group.mjs +21 -0
- package/fesm2022/agorapulse-ui-components-input-group.mjs.map +1 -0
- package/fesm2022/agorapulse-ui-components-input.mjs +16 -184
- package/fesm2022/agorapulse-ui-components-input.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-labels.mjs +2 -2
- package/fesm2022/agorapulse-ui-components-labels.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-legacy-input.mjs +197 -0
- package/fesm2022/agorapulse-ui-components-legacy-input.mjs.map +1 -0
- package/fesm2022/agorapulse-ui-components-legacy-select.mjs +460 -0
- package/fesm2022/agorapulse-ui-components-legacy-select.mjs.map +1 -0
- package/fesm2022/agorapulse-ui-components-legacy-textarea.mjs +162 -0
- package/fesm2022/agorapulse-ui-components-legacy-textarea.mjs.map +1 -0
- package/fesm2022/agorapulse-ui-components-select.mjs +562 -395
- package/fesm2022/agorapulse-ui-components-select.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-textarea.mjs +29 -141
- package/fesm2022/agorapulse-ui-components-textarea.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components.mjs +3 -3
- package/fesm2022/agorapulse-ui-components.mjs.map +1 -1
- package/form-field/form-field.component.d.ts +5 -0
- package/form-field/index.d.ts +5 -0
- package/form-field/public_api.d.ts +1 -0
- package/form-message/form-message.component.d.ts +12 -0
- package/form-message/index.d.ts +5 -0
- package/form-message/public_api.d.ts +1 -0
- package/index.d.ts +3 -3
- package/input/input.directive.d.ts +7 -0
- package/input/public_api.d.ts +1 -1
- package/input-group/index.d.ts +5 -0
- package/input-group/input-group.component.d.ts +6 -0
- package/input-group/public_api.d.ts +1 -0
- package/legacy/input/index.d.ts +5 -0
- package/{input → legacy/input}/input.component.d.ts +3 -0
- package/legacy/input/public_api.d.ts +1 -0
- package/legacy/select/index.d.ts +5 -0
- package/legacy/select/public_api.d.ts +1 -0
- package/{select → legacy/select}/select.component.d.ts +4 -1
- package/legacy/textarea/index.d.ts +5 -0
- package/legacy/textarea/public_api.d.ts +1 -0
- package/{textarea → legacy/textarea}/textarea.component.d.ts +3 -0
- package/package.json +37 -1
- package/select/ap-select.module.d.ts +16 -0
- package/select/dropdown-group-item/dropdown-group-item.component.d.ts +16 -0
- package/select/dropdown-item-multiple-one-line/dropdown-item-multiple-one-line.component.d.ts +20 -0
- package/select/dropdown-item-multiple-two-lines/dropdown-item-multiple-two-lines.component.d.ts +21 -0
- package/select/dropdown-item-single-one-line/dropdown-item-single-one-line.component.d.ts +12 -0
- package/select/dropdown-item-single-two-lines/dropdown-item-single-two-lines.component.d.ts +13 -0
- package/select/dropdown-search-form/dropdown-search-form.component.d.ts +22 -0
- package/select/public_api.d.ts +12 -1
- package/select/select-base.directive.d.ts +18 -0
- package/select/select-label-multiple/select-label-multiple.component.d.ts +29 -0
- package/select/select-label-single/select-label-single.component.d.ts +8 -0
- package/select/select-multiple.directive.d.ts +10 -0
- package/select/select-single.directive.d.ts +10 -0
- package/snackbars-thread/component/snackbars-thread.component.d.ts +1 -1
- package/textarea/public_api.d.ts +1 -1
- package/textarea/textarea.directive.d.ts +11 -0
- package/agorapulse-ui-components-16.2.22.tgz +0 -0
|
@@ -1,194 +1,26 @@
|
|
|
1
|
-
import { SymbolRegistry, apAlertCircle, apCheckCircle, apClose, apSearchAlternate, SymbolComponent } from '@agorapulse/ui-symbol';
|
|
2
|
-
import { NgIf } from '@angular/common';
|
|
3
1
|
import * as i0 from '@angular/core';
|
|
4
|
-
import {
|
|
5
|
-
import * as i1 from '@angular/forms';
|
|
6
|
-
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormsModule } from '@angular/forms';
|
|
2
|
+
import { inject, ElementRef, Directive } from '@angular/core';
|
|
7
3
|
|
|
8
|
-
|
|
9
|
-
provide: NG_VALUE_ACCESSOR,
|
|
10
|
-
useExisting: forwardRef(() => InputComponent),
|
|
11
|
-
multi: true,
|
|
12
|
-
};
|
|
13
|
-
const SEARCH_SYMBOL_ID = 'search-alternate';
|
|
14
|
-
class InputComponent {
|
|
4
|
+
class InputDirective {
|
|
15
5
|
elementRef = inject(ElementRef);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
inputElement;
|
|
20
|
-
ariaLabel;
|
|
21
|
-
ariaLabelledBy;
|
|
22
|
-
ariaDescribedBy;
|
|
23
|
-
disabled = false;
|
|
24
|
-
clearable = false;
|
|
25
|
-
inputType = 'text';
|
|
26
|
-
inputId;
|
|
27
|
-
name;
|
|
28
|
-
label;
|
|
29
|
-
description;
|
|
30
|
-
prefix;
|
|
31
|
-
suffix;
|
|
32
|
-
required = false;
|
|
33
|
-
placeholder;
|
|
34
|
-
errorMessage;
|
|
35
|
-
successMessage;
|
|
36
|
-
symbolId;
|
|
37
|
-
symbolPosition = 'right';
|
|
38
|
-
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
39
|
-
focus = new EventEmitter();
|
|
40
|
-
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
41
|
-
blur = new EventEmitter();
|
|
42
|
-
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
43
|
-
keyup = new EventEmitter();
|
|
44
|
-
_controlValueAccessorChangeFn;
|
|
45
|
-
hostDataTest = signal(undefined);
|
|
46
|
-
value;
|
|
47
|
-
onTouched;
|
|
48
|
-
ngOnInit() {
|
|
49
|
-
if (this.label && !this.inputId) {
|
|
50
|
-
throw Error('You have to provide an input id if you want to use a label.');
|
|
51
|
-
}
|
|
52
|
-
if (this.inputType === 'search') {
|
|
53
|
-
this.symbolId = SEARCH_SYMBOL_ID;
|
|
54
|
-
this.symbolPosition = 'left';
|
|
55
|
-
}
|
|
56
|
-
this.hostDataTest.set(this.elementRef.nativeElement.getAttribute('data-test'));
|
|
57
|
-
this.elementRef.nativeElement.removeAttribute('data-test');
|
|
58
|
-
this.symbolRegistry.registerSymbols([apAlertCircle, apCheckCircle, apClose, apSearchAlternate]);
|
|
59
|
-
}
|
|
60
|
-
// Sometimes attributes like the id, or the data-test are dynamic and can change between the constructor and the initialization.
|
|
61
|
-
// 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.
|
|
62
|
-
ngAfterViewInit() {
|
|
63
|
-
const hostDataTest = this.elementRef.nativeElement.getAttribute('data-test');
|
|
64
|
-
if (hostDataTest && this.hostDataTest() !== hostDataTest) {
|
|
65
|
-
this.hostDataTest.set(hostDataTest);
|
|
66
|
-
this.elementRef.nativeElement.removeAttribute('data-test');
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
validate({ value }) {
|
|
70
|
-
const isNotValid = !this.value && this.required;
|
|
71
|
-
return (isNotValid && {
|
|
72
|
-
invalid: true,
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
onValueChange() {
|
|
76
|
-
if (this.onTouched) {
|
|
77
|
-
this.onTouched();
|
|
78
|
-
}
|
|
79
|
-
if (!this.disabled) {
|
|
80
|
-
if (this._controlValueAccessorChangeFn) {
|
|
81
|
-
this._controlValueAccessorChangeFn(this.value);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
writeValue(value) {
|
|
86
|
-
this.value = value;
|
|
87
|
-
}
|
|
88
|
-
registerOnChange(fn) {
|
|
89
|
-
this._controlValueAccessorChangeFn = fn;
|
|
90
|
-
}
|
|
91
|
-
registerOnTouched(fn) {
|
|
92
|
-
this.onTouched = fn;
|
|
93
|
-
}
|
|
94
|
-
setDisabledState(isDisabled) {
|
|
95
|
-
this.disabled = isDisabled;
|
|
96
|
-
}
|
|
97
|
-
focusInput() {
|
|
98
|
-
this.inputElement.nativeElement.focus();
|
|
99
|
-
}
|
|
100
|
-
onBlurHandle($event) {
|
|
101
|
-
this.blur.emit($event);
|
|
102
|
-
}
|
|
103
|
-
onFocusHandle($event) {
|
|
104
|
-
this.focus.emit($event);
|
|
105
|
-
}
|
|
106
|
-
onKeyup($event) {
|
|
107
|
-
this.keyup.emit($event);
|
|
108
|
-
}
|
|
109
|
-
onClear() {
|
|
110
|
-
this.writeValue(null);
|
|
111
|
-
}
|
|
112
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.10", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
113
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "16.2.10", type: InputComponent, isStandalone: true, selector: "ap-input", inputs: { ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", ariaDescribedBy: "ariaDescribedBy", disabled: "disabled", clearable: "clearable", inputType: "inputType", inputId: "inputId", name: "name", label: "label", description: "description", prefix: "prefix", suffix: "suffix", required: ["required", "required", booleanAttribute], placeholder: "placeholder", errorMessage: "errorMessage", successMessage: "successMessage", symbolId: "symbolId", symbolPosition: "symbolPosition" }, outputs: { focus: "focus", blur: "blur", keyup: "keyup" }, providers: [
|
|
114
|
-
AP_INPUT_CONTROL_VALUE_ACCESSOR,
|
|
115
|
-
{
|
|
116
|
-
provide: NG_VALIDATORS,
|
|
117
|
-
useExisting: InputComponent,
|
|
118
|
-
multi: true,
|
|
119
|
-
},
|
|
120
|
-
], queries: [{ propertyName: "symbols", predicate: SymbolComponent }], viewQueries: [{ propertyName: "symbolWrapper", first: true, predicate: ["symbol"], descendants: true }, { propertyName: "inputElement", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<label\n *ngIf=\"label\"\n [for]=\"inputId\">\n <span>\n {{ label }}\n </span>\n <span\n *ngIf=\"description\"\n class=\"description\">\n {{ description }}\n </span>\n</label>\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 <div\n *ngIf=\"prefix\"\n class=\"prefix\">\n <span>\n {{ prefix }}\n </span>\n <span class=\"divider\"></span>\n </div>\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 <ng-container *ngIf=\"clearable\">\n <button\n type=\"button\"\n class=\"clear-button\"\n (click)=\"onClear()\">\n <ap-symbol symbolId=\"close\" />\n </button>\n </ng-container>\n </div>\n <div\n *ngIf=\"suffix\"\n class=\"suffix\">\n <span class=\"divider\"></span>\n <span>\n {{ suffix }}\n </span>\n </div>\n <ng-container *ngIf=\"symbolId\">\n <ap-symbol\n size=\"micro\"\n [symbolId]=\"symbolId\" />\n </ng-container>\n</div>\n\n<div\n *ngIf=\"errorMessage\"\n class=\"form-message error\">\n <ap-symbol\n symbolId=\"alert-circle\"\n size=\"micro\" />\n <span>\n {{ errorMessage }}\n </span>\n</div>\n\n<div\n *ngIf=\"successMessage\"\n class=\"form-message success\">\n <ap-symbol\n symbolId=\"check-circle\"\n size=\"micro\" />\n <span>\n {{ successMessage }}\n </span>\n</div>\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"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["color", "symbolId", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
6
|
+
input = this.elementRef.nativeElement;
|
|
7
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.10", ngImport: i0, type: InputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
8
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.10", type: InputDirective, isStandalone: true, selector: "[apInput]", host: { classAttribute: "ap-input" }, ngImport: i0 });
|
|
121
9
|
}
|
|
122
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.10", ngImport: i0, type:
|
|
123
|
-
type:
|
|
124
|
-
args: [{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}], propDecorators: { symbols: [{
|
|
133
|
-
type: ContentChildren,
|
|
134
|
-
args: [SymbolComponent]
|
|
135
|
-
}], symbolWrapper: [{
|
|
136
|
-
type: ViewChild,
|
|
137
|
-
args: ['symbol']
|
|
138
|
-
}], inputElement: [{
|
|
139
|
-
type: ViewChild,
|
|
140
|
-
args: ['input']
|
|
141
|
-
}], ariaLabel: [{
|
|
142
|
-
type: Input
|
|
143
|
-
}], ariaLabelledBy: [{
|
|
144
|
-
type: Input
|
|
145
|
-
}], ariaDescribedBy: [{
|
|
146
|
-
type: Input
|
|
147
|
-
}], disabled: [{
|
|
148
|
-
type: Input
|
|
149
|
-
}], clearable: [{
|
|
150
|
-
type: Input
|
|
151
|
-
}], inputType: [{
|
|
152
|
-
type: Input
|
|
153
|
-
}], inputId: [{
|
|
154
|
-
type: Input
|
|
155
|
-
}], name: [{
|
|
156
|
-
type: Input,
|
|
157
|
-
args: [{
|
|
158
|
-
required: true,
|
|
159
|
-
}]
|
|
160
|
-
}], label: [{
|
|
161
|
-
type: Input
|
|
162
|
-
}], description: [{
|
|
163
|
-
type: Input
|
|
164
|
-
}], prefix: [{
|
|
165
|
-
type: Input
|
|
166
|
-
}], suffix: [{
|
|
167
|
-
type: Input
|
|
168
|
-
}], required: [{
|
|
169
|
-
type: Input,
|
|
170
|
-
args: [{ transform: booleanAttribute }]
|
|
171
|
-
}], placeholder: [{
|
|
172
|
-
type: Input
|
|
173
|
-
}], errorMessage: [{
|
|
174
|
-
type: Input
|
|
175
|
-
}], successMessage: [{
|
|
176
|
-
type: Input
|
|
177
|
-
}], symbolId: [{
|
|
178
|
-
type: Input
|
|
179
|
-
}], symbolPosition: [{
|
|
180
|
-
type: Input
|
|
181
|
-
}], focus: [{
|
|
182
|
-
type: Output
|
|
183
|
-
}], blur: [{
|
|
184
|
-
type: Output
|
|
185
|
-
}], keyup: [{
|
|
186
|
-
type: Output
|
|
187
|
-
}] } });
|
|
10
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.10", ngImport: i0, type: InputDirective, decorators: [{
|
|
11
|
+
type: Directive,
|
|
12
|
+
args: [{
|
|
13
|
+
selector: '[apInput]',
|
|
14
|
+
standalone: true,
|
|
15
|
+
host: {
|
|
16
|
+
class: 'ap-input',
|
|
17
|
+
},
|
|
18
|
+
}]
|
|
19
|
+
}] });
|
|
188
20
|
|
|
189
21
|
/**
|
|
190
22
|
* Generated bundle index. Do not edit.
|
|
191
23
|
*/
|
|
192
24
|
|
|
193
|
-
export {
|
|
25
|
+
export { InputDirective };
|
|
194
26
|
//# sourceMappingURL=agorapulse-ui-components-input.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-input.mjs","sources":["../../../libs/ui-components/input/src/input.component.ts","../../../libs/ui-components/input/src/input.component.html","../../../libs/ui-components/input/src/agorapulse-ui-components-input.ts"],"sourcesContent":["import { SymbolComponent, SymbolRegistry, apAlertCircle, apCheckCircle, apClose, apSearchAlternate } from '@agorapulse/ui-symbol';\nimport { NgIf } from '@angular/common';\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, FormControl, 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-alternate';\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-input',\n styleUrls: ['./input.component.scss'],\n standalone: true,\n imports: [NgIf, FormsModule, SymbolComponent],\n providers: [\n AP_INPUT_CONTROL_VALUE_ACCESSOR,\n\n {\n provide: NG_VALIDATORS,\n\n useExisting: InputComponent,\n\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([apAlertCircle, apCheckCircle, apClose, apSearchAlternate]);\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({ value }: FormControl) {\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","<label\n *ngIf=\"label\"\n [for]=\"inputId\">\n <span>\n {{ label }}\n </span>\n <span\n *ngIf=\"description\"\n class=\"description\">\n {{ description }}\n </span>\n</label>\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 <div\n *ngIf=\"prefix\"\n class=\"prefix\">\n <span>\n {{ prefix }}\n </span>\n <span class=\"divider\"></span>\n </div>\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 <ng-container *ngIf=\"clearable\">\n <button\n type=\"button\"\n class=\"clear-button\"\n (click)=\"onClear()\">\n <ap-symbol symbolId=\"close\" />\n </button>\n </ng-container>\n </div>\n <div\n *ngIf=\"suffix\"\n class=\"suffix\">\n <span class=\"divider\"></span>\n <span>\n {{ suffix }}\n </span>\n </div>\n <ng-container *ngIf=\"symbolId\">\n <ap-symbol\n size=\"micro\"\n [symbolId]=\"symbolId\" />\n </ng-container>\n</div>\n\n<div\n *ngIf=\"errorMessage\"\n class=\"form-message error\">\n <ap-symbol\n symbolId=\"alert-circle\"\n size=\"micro\" />\n <span>\n {{ errorMessage }}\n </span>\n</div>\n\n<div\n *ngIf=\"successMessage\"\n class=\"form-message success\">\n <ap-symbol\n symbolId=\"check-circle\"\n size=\"micro\" />\n <span>\n {{ successMessage }}\n </span>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAwCa,MAAA,+BAA+B,GAAG;AAC3C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,cAAc,CAAC;AAC7C,IAAA,KA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AgB,EAAE,CAAA;gBAE7B,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBAEG,YAAY,EAAA,CAAA;sBAApB,KAAK;gBAEG,cAAc,EAAA,CAAA;sBAAtB,KAAK;gBAEG,QAAQ,EAAA,CAAA;sBAAhB,KAAK;gBACG,cAAc,EAAA,CAAA;sBAAtB,KAAK;gBAGI,KAAK,EAAA,CAAA;sBAAd,MAAM;gBAEG,IAAI,EAAA,CAAA;sBAAb,MAAM;gBAEG,KAAK,EAAA,CAAA;sBAAd,MAAM;;;AEtHX;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-input.mjs","sources":["../../../libs/ui-components/input/src/input.directive.ts","../../../libs/ui-components/input/src/agorapulse-ui-components-input.ts"],"sourcesContent":["import { Directive, ElementRef, inject } from '@angular/core';\n\n@Directive({\n selector: '[apInput]',\n standalone: true,\n host: {\n class: 'ap-input',\n },\n})\nexport class InputDirective {\n private elementRef = inject(ElementRef);\n\n input: HTMLInputElement = this.elementRef.nativeElement;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;MASa,cAAc,CAAA;AACf,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAExC,IAAA,KAAK,GAAqB,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;wGAH/C,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;4FAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,UAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAP1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,KAAK,EAAE,UAAU;AACpB,qBAAA;AACJ,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
|
|
@@ -38,11 +38,11 @@ class LabelComponent {
|
|
|
38
38
|
this.remove.emit({ content: this.content, $event });
|
|
39
39
|
}
|
|
40
40
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.10", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
41
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "16.2.10", type: LabelComponent, isStandalone: true, selector: "ap-label", inputs: { content: "content", selectorWidth: "selectorWidth", removable: ["removable", "removable", booleanAttribute] }, outputs: { remove: "remove" }, ngImport: i0, template: "<div\n class=\"label\"\n [class.removable]=\"removable\"\n [apTooltip]=\"tooltipEnabled ? content : ''\">\n <span class=\"label-content\">{{ content }}</span>\n <button\n *ngIf=\"removable\"\n type=\"button\"\n class=\"delete-button\"\n (click)=\"onClearLabel($event)\">\n <ap-symbol\n symbolId=\"remove-bold\"\n size=\"pico\" />\n </button>\n</div>\n", styles: ["ap-label{display:flex;--button-size: calc(var(--comp-label-height) - 4px);--max-width: 180px}ap-label .label{padding:0 var(--ref-spacing-xxs);color:var(--comp-label-text-color);align-self:center;background:var(--comp-label-background-color);border-radius:var(--comp-label-border-radius);text-wrap:none;display:flex;align-items:center;border:none;padding:0 var(--comp-label-padding-right) 0 var(--comp-label-padding-left);height:var(--comp-label-height);box-sizing:border-box;text-overflow:ellipsis}ap-label .label.removable{gap:var(--comp-label-closable-spacing);padding:0 var(--comp-label-closable-padding-right) 0 var(--ref-spacing-xxs)}ap-label .label .label-content{max-width:var(--max-width);color:var(--comp-label-text-color);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-
|
|
41
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "16.2.10", type: LabelComponent, isStandalone: true, selector: "ap-label", inputs: { content: "content", selectorWidth: "selectorWidth", removable: ["removable", "removable", booleanAttribute] }, outputs: { remove: "remove" }, ngImport: i0, template: "<div\n class=\"label\"\n [class.removable]=\"removable\"\n [apTooltip]=\"tooltipEnabled ? content : ''\">\n <span class=\"label-content\">{{ content }}</span>\n <button\n *ngIf=\"removable\"\n type=\"button\"\n class=\"delete-button\"\n (click)=\"onClearLabel($event)\">\n <ap-symbol\n symbolId=\"remove-bold\"\n size=\"pico\" />\n </button>\n</div>\n", styles: ["ap-label{display:flex;--button-size: calc(var(--comp-label-height) - 4px);--max-width: 180px}ap-label .label{padding:0 var(--ref-spacing-xxs);color:var(--comp-label-text-color);align-self:center;background:var(--comp-label-background-color);border-radius:var(--comp-label-border-radius);text-wrap:none;display:flex;align-items:center;border:none;padding:0 var(--comp-label-padding-right) 0 var(--comp-label-padding-left);height:var(--comp-label-height);box-sizing:border-box;text-overflow:ellipsis}ap-label .label.removable{gap:var(--comp-label-closable-spacing);padding:0 var(--comp-label-closable-padding-right) 0 var(--ref-spacing-xxs)}ap-label .label .label-content{max-width:var(--max-width);color:var(--comp-label-text-color);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--comp-label-text-style-font-family);font-size:var(--comp-label-text-style-size);line-height:var(--comp-label-text-style-line-height);font-weight:var(--comp-label-text-style-font-weight)}ap-label .label .delete-button{display:flex;align-items:center;justify-content:center;border:none;background:transparent;align-self:center;cursor:pointer;max-width:var(--button-size);width:var(--button-size);height:var(--button-size);max-height:var(--button-size);border-radius:100%}ap-label .label .delete-button ap-symbol{color:var(--ref-color-grey-80)}ap-label .label .delete-button:hover{background-color:#3445631a}ap-label .label .delete-button:hover ap-symbol{color:var(--ref-color-grey-100)}ap-label .label .delete-button:focus{box-shadow:0 0 0 1px var(--ref-color-white),0 0 0 3px var(--ref-color-electric-blue-100)}ap-label .label .delete-button:active{background-color:#34456333}ap-label .label .delete-button:active ap-symbol{color:var(--ref-color-grey-100)}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: TooltipDirective, selector: "[apTooltip]", inputs: ["apTooltipPosition", "apTooltip", "apTooltipShowDelay", "apTooltipHideDelay", "apTooltipDuration", "apTooltipDisabled", "apTooltipTemplateContext", "apTooltipVirtualScrollElement"] }, { kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["color", "symbolId", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
42
42
|
}
|
|
43
43
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.10", ngImport: i0, type: LabelComponent, decorators: [{
|
|
44
44
|
type: Component,
|
|
45
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-label', standalone: true, imports: [NgClass, NgIf, TooltipDirective, SymbolComponent], encapsulation: ViewEncapsulation.None, template: "<div\n class=\"label\"\n [class.removable]=\"removable\"\n [apTooltip]=\"tooltipEnabled ? content : ''\">\n <span class=\"label-content\">{{ content }}</span>\n <button\n *ngIf=\"removable\"\n type=\"button\"\n class=\"delete-button\"\n (click)=\"onClearLabel($event)\">\n <ap-symbol\n symbolId=\"remove-bold\"\n size=\"pico\" />\n </button>\n</div>\n", styles: ["ap-label{display:flex;--button-size: calc(var(--comp-label-height) - 4px);--max-width: 180px}ap-label .label{padding:0 var(--ref-spacing-xxs);color:var(--comp-label-text-color);align-self:center;background:var(--comp-label-background-color);border-radius:var(--comp-label-border-radius);text-wrap:none;display:flex;align-items:center;border:none;padding:0 var(--comp-label-padding-right) 0 var(--comp-label-padding-left);height:var(--comp-label-height);box-sizing:border-box;text-overflow:ellipsis}ap-label .label.removable{gap:var(--comp-label-closable-spacing);padding:0 var(--comp-label-closable-padding-right) 0 var(--ref-spacing-xxs)}ap-label .label .label-content{max-width:var(--max-width);color:var(--comp-label-text-color);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-
|
|
45
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-label', standalone: true, imports: [NgClass, NgIf, TooltipDirective, SymbolComponent], encapsulation: ViewEncapsulation.None, template: "<div\n class=\"label\"\n [class.removable]=\"removable\"\n [apTooltip]=\"tooltipEnabled ? content : ''\">\n <span class=\"label-content\">{{ content }}</span>\n <button\n *ngIf=\"removable\"\n type=\"button\"\n class=\"delete-button\"\n (click)=\"onClearLabel($event)\">\n <ap-symbol\n symbolId=\"remove-bold\"\n size=\"pico\" />\n </button>\n</div>\n", styles: ["ap-label{display:flex;--button-size: calc(var(--comp-label-height) - 4px);--max-width: 180px}ap-label .label{padding:0 var(--ref-spacing-xxs);color:var(--comp-label-text-color);align-self:center;background:var(--comp-label-background-color);border-radius:var(--comp-label-border-radius);text-wrap:none;display:flex;align-items:center;border:none;padding:0 var(--comp-label-padding-right) 0 var(--comp-label-padding-left);height:var(--comp-label-height);box-sizing:border-box;text-overflow:ellipsis}ap-label .label.removable{gap:var(--comp-label-closable-spacing);padding:0 var(--comp-label-closable-padding-right) 0 var(--ref-spacing-xxs)}ap-label .label .label-content{max-width:var(--max-width);color:var(--comp-label-text-color);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--comp-label-text-style-font-family);font-size:var(--comp-label-text-style-size);line-height:var(--comp-label-text-style-line-height);font-weight:var(--comp-label-text-style-font-weight)}ap-label .label .delete-button{display:flex;align-items:center;justify-content:center;border:none;background:transparent;align-self:center;cursor:pointer;max-width:var(--button-size);width:var(--button-size);height:var(--button-size);max-height:var(--button-size);border-radius:100%}ap-label .label .delete-button ap-symbol{color:var(--ref-color-grey-80)}ap-label .label .delete-button:hover{background-color:#3445631a}ap-label .label .delete-button:hover ap-symbol{color:var(--ref-color-grey-100)}ap-label .label .delete-button:focus{box-shadow:0 0 0 1px var(--ref-color-white),0 0 0 3px var(--ref-color-electric-blue-100)}ap-label .label .delete-button:active{background-color:#34456333}ap-label .label .delete-button:active ap-symbol{color:var(--ref-color-grey-100)}\n"] }]
|
|
46
46
|
}], ctorParameters: function () { return []; }, propDecorators: { content: [{
|
|
47
47
|
type: Input,
|
|
48
48
|
args: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-labels.mjs","sources":["../../../libs/ui-components/labels/src/label.component.ts","../../../libs/ui-components/labels/src/label.component.html","../../../libs/ui-components/labels/src/label-list.component.ts","../../../libs/ui-components/labels/src/label-list.component.html","../../../libs/ui-components/labels/src/agorapulse-ui-components-labels.ts"],"sourcesContent":["import { apRemoveBold, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport { NgClass, NgIf } from '@angular/common';\nimport { AfterViewInit, booleanAttribute, inject, ViewEncapsulation } from '@angular/core';\nimport { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, NgZone, OnDestroy, Output } from '@angular/core';\nimport { TooltipDirective } from '@agorapulse/ui-components/tooltip';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-label',\n standalone: true,\n templateUrl: './label.component.html',\n imports: [NgClass, NgIf, TooltipDirective, SymbolComponent],\n styleUrls: ['./label.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class LabelComponent implements AfterViewInit, OnDestroy {\n private elementRef: ElementRef = inject(ElementRef);\n private symbolRegistry: SymbolRegistry = inject(SymbolRegistry);\n private zone: NgZone = inject(NgZone);\n\n @Input({\n required: true,\n })\n content!: string;\n @Input() selectorWidth: number = 0; //Width of the selector input, if applicable\n @Input({ transform: booleanAttribute }) removable: boolean = false;\n\n @Output() remove = new EventEmitter<{ content: string; $event: MouseEvent }>();\n\n private observer: ResizeObserver | undefined = undefined;\n tooltipEnabled: boolean = false;\n\n constructor() {\n this.symbolRegistry.registerSymbols([apRemoveBold]);\n }\n\n ngAfterViewInit(): void {\n this.observer = new ResizeObserver(entries => {\n this.zone.run(() => {\n const containerWidth =\n this.elementRef.nativeElement.clientWidth > 0 ? this.elementRef.nativeElement.clientWidth : this.selectorWidth;\n if (containerWidth > 0) {\n this.tooltipEnabled = entries[0].target.scrollWidth > containerWidth;\n }\n });\n });\n this.observer.observe(this.elementRef.nativeElement.getElementsByClassName('label-content')[0]);\n }\n\n ngOnDestroy() {\n this.observer?.unobserve(this.elementRef.nativeElement.children[0]);\n }\n\n onClearLabel($event: MouseEvent) {\n this.elementRef.nativeElement.remove();\n this.remove.emit({ content: this.content, $event });\n }\n}\n","<div\n class=\"label\"\n [class.removable]=\"removable\"\n [apTooltip]=\"tooltipEnabled ? content : ''\">\n <span class=\"label-content\">{{ content }}</span>\n <button\n *ngIf=\"removable\"\n type=\"button\"\n class=\"delete-button\"\n (click)=\"onClearLabel($event)\">\n <ap-symbol\n symbolId=\"remove-bold\"\n size=\"pico\" />\n </button>\n</div>\n","import { TextMeasurementService } from '@agorapulse/ui-components/text-measurement';\nimport { NgForOf, NgIf } from '@angular/common';\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges,\n} from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { LabelComponent } from './label.component';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-label-list',\n templateUrl: './label-list.component.html',\n styleUrls: ['./label-list.component.scss'],\n standalone: true,\n imports: [LabelComponent, NgForOf, NgIf],\n})\nexport class LabelListComponent implements AfterContentInit, OnChanges, OnDestroy {\n @Input() labels: string[] = [];\n @Input() removeLabelsEnabled: boolean = false;\n @Input() responsive: boolean = false;\n @Input() seeLessTranslation: string = 'See less';\n\n @Output() removeLabel = new EventEmitter<string>();\n\n badgeWidth: number = 0;\n expanded: boolean = false;\n howManyItemsLeft = 0;\n responsiveLabels: string[] = [];\n\n private observer: ResizeObserver;\n private width$ = new BehaviorSubject<number>(0);\n\n constructor(\n private changeDetectorRef: ChangeDetectorRef,\n private elementRef: ElementRef,\n private textMeasurementService: TextMeasurementService,\n private zone: NgZone\n ) {\n this.observer = new ResizeObserver(entries => {\n this.zone.run(() => {\n this.width$.next(entries[0].contentRect.width);\n });\n });\n }\n\n ngAfterContentInit(): void {\n if (this.responsive) {\n this.generateResponsiveLabels(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0].offsetWidth);\n\n this.observer.observe(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0]);\n this.width$.subscribe(width => {\n this.generateResponsiveLabels(width);\n });\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.labels.currentValue && this.responsive) {\n this.generateResponsiveLabels(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0].offsetWidth);\n }\n }\n\n ngOnDestroy() {\n this.observer.unobserve(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0]);\n }\n\n onExpand() {\n this.expanded = !this.expanded;\n }\n\n onRemoveLabel({ content }: { content: string }): void {\n this.removeLabel.emit(content);\n }\n\n onResize() {\n this.generateResponsiveLabels(this.elementRef.nativeElement.children[0].offsetWidth);\n }\n\n public trackByLabelContent(_: number, entry: string) {\n return entry;\n }\n\n private generateResponsiveLabels(width: number) {\n let seeMoreElementWidth = this.textMeasurementService.calculateTextWidth('+'.concat(this.labels.length.toString()), 14, 'Averta');\n seeMoreElementWidth += 1 + 8 + 8 + 1; // border-left + padding-left + padding-right + border-right\n let elementWidth = width - 16 - 16; // width - padding-left - padding-right\n elementWidth -= seeMoreElementWidth;\n let currentIndex = 0;\n for (let index = 0; index < this.labels.length; index++) {\n let textWidth = this.textMeasurementService.calculateTextWidth(this.labels[index], 14, 'Averta');\n textWidth += 1 + 8 + (this.removeLabelsEnabled ? 25 : 8) + 1 + 4; // border-left + padding-left + padding-right + border-right + label spacing\n elementWidth -= textWidth;\n if (elementWidth <= 0) {\n break;\n }\n currentIndex = index;\n }\n if (currentIndex + 1 === this.labels.length) {\n this.expanded = false;\n }\n this.howManyItemsLeft = this.labels.length - (currentIndex + 1);\n this.badgeWidth =\n this.howManyItemsLeft > 0 && currentIndex === 0\n ? this.textMeasurementService.calculateTextWidth('+' + this.howManyItemsLeft, 14, 'Averta') + 22\n : 0;\n this.responsiveLabels = this.labels.slice(0, currentIndex + 1);\n this.changeDetectorRef.markForCheck();\n }\n}\n","<div\n class=\"labels-list\"\n (window:resize)=\"onResize()\">\n <ng-container *ngIf=\"responsive; else defaultLabels\">\n <ng-container *ngFor=\"let label of expanded ? labels : responsiveLabels\">\n <ap-label\n [content]=\"label\"\n [style.max-width]=\"!expanded ? 'calc(100% - ' + badgeWidth + 'px)' : '100%'\"\n [removable]=\"removeLabelsEnabled\"\n (remove)=\"onRemoveLabel($event)\" />\n </ng-container>\n\n <button\n *ngIf=\"!expanded && responsiveLabels.length !== labels.length && howManyItemsLeft > 0\"\n class=\"label-expand\"\n (click)=\"onExpand()\">\n +{{ howManyItemsLeft }}\n </button>\n <button\n *ngIf=\"expanded\"\n class=\"label-retract\"\n (click)=\"onExpand()\">\n {{ seeLessTranslation }}\n </button>\n </ng-container>\n\n <ng-template #defaultLabels>\n <ng-container *ngFor=\"let label of labels; trackBy: trackByLabelContent\">\n <ap-label\n [content]=\"label\"\n [removable]=\"removeLabelsEnabled\"\n (remove)=\"onRemoveLabel($event)\" />\n </ng-container>\n </ng-template>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MAea,cAAc,CAAA;AACf,IAAA,UAAU,GAAe,MAAM,CAAC,UAAU,CAAC,CAAC;AAC5C,IAAA,cAAc,GAAmB,MAAM,CAAC,cAAc,CAAC,CAAC;AACxD,IAAA,IAAI,GAAW,MAAM,CAAC,MAAM,CAAC,CAAC;AAKtC,IAAA,OAAO,CAAU;AACR,IAAA,aAAa,GAAW,CAAC,CAAC;IACK,SAAS,GAAY,KAAK,CAAC;AAEzD,IAAA,MAAM,GAAG,IAAI,YAAY,E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Ac,EAAE,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,eAAA,EAAA,WAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,OAAO,mHAAE,IAAI,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAE9B,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAR9B,SAAS;AACW,YAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACrC,QAAA,EAAA,eAAe,EAGb,UAAA,EAAA,IAAI,EACP,OAAA,EAAA,CAAC,cAAc,EAAE,OAAO,EAAE,IAAI,CAAC,EAAA,QAAA,EAAA,oxCAAA,EAAA,MAAA,EAAA,CAAA,4hMAAA,CAAA,EAAA,CAAA;2LAG/B,MAAM,EAAA,CAAA;sBAAd,KAAK;gBACG,mBAAmB,EAAA,CAAA;sBAA3B,KAAK;gBACG,UAAU,EAAA,CAAA;sBAAlB,KAAK;gBACG,kBAAkB,EAAA,CAAA;sBAA1B,KAAK;gBAEI,WAAW,EAAA,CAAA;sBAApB,MAAM;;;AEjCX;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-labels.mjs","sources":["../../../libs/ui-components/labels/src/label.component.ts","../../../libs/ui-components/labels/src/label.component.html","../../../libs/ui-components/labels/src/label-list.component.ts","../../../libs/ui-components/labels/src/label-list.component.html","../../../libs/ui-components/labels/src/agorapulse-ui-components-labels.ts"],"sourcesContent":["import { apRemoveBold, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport { NgClass, NgIf } from '@angular/common';\nimport { AfterViewInit, booleanAttribute, inject, ViewEncapsulation } from '@angular/core';\nimport { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, NgZone, OnDestroy, Output } from '@angular/core';\nimport { TooltipDirective } from '@agorapulse/ui-components/tooltip';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-label',\n standalone: true,\n templateUrl: './label.component.html',\n imports: [NgClass, NgIf, TooltipDirective, SymbolComponent],\n styleUrls: ['./label.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class LabelComponent implements AfterViewInit, OnDestroy {\n private elementRef: ElementRef = inject(ElementRef);\n private symbolRegistry: SymbolRegistry = inject(SymbolRegistry);\n private zone: NgZone = inject(NgZone);\n\n @Input({\n required: true,\n })\n content!: string;\n @Input() selectorWidth: number = 0; //Width of the selector input, if applicable\n @Input({ transform: booleanAttribute }) removable: boolean = false;\n\n @Output() remove = new EventEmitter<{ content: string; $event: MouseEvent }>();\n\n private observer: ResizeObserver | undefined = undefined;\n tooltipEnabled: boolean = false;\n\n constructor() {\n this.symbolRegistry.registerSymbols([apRemoveBold]);\n }\n\n ngAfterViewInit(): void {\n this.observer = new ResizeObserver(entries => {\n this.zone.run(() => {\n const containerWidth =\n this.elementRef.nativeElement.clientWidth > 0 ? this.elementRef.nativeElement.clientWidth : this.selectorWidth;\n if (containerWidth > 0) {\n this.tooltipEnabled = entries[0].target.scrollWidth > containerWidth;\n }\n });\n });\n this.observer.observe(this.elementRef.nativeElement.getElementsByClassName('label-content')[0]);\n }\n\n ngOnDestroy() {\n this.observer?.unobserve(this.elementRef.nativeElement.children[0]);\n }\n\n onClearLabel($event: MouseEvent) {\n this.elementRef.nativeElement.remove();\n this.remove.emit({ content: this.content, $event });\n }\n}\n","<div\n class=\"label\"\n [class.removable]=\"removable\"\n [apTooltip]=\"tooltipEnabled ? content : ''\">\n <span class=\"label-content\">{{ content }}</span>\n <button\n *ngIf=\"removable\"\n type=\"button\"\n class=\"delete-button\"\n (click)=\"onClearLabel($event)\">\n <ap-symbol\n symbolId=\"remove-bold\"\n size=\"pico\" />\n </button>\n</div>\n","import { TextMeasurementService } from '@agorapulse/ui-components/text-measurement';\nimport { NgForOf, NgIf } from '@angular/common';\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges,\n} from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { LabelComponent } from './label.component';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-label-list',\n templateUrl: './label-list.component.html',\n styleUrls: ['./label-list.component.scss'],\n standalone: true,\n imports: [LabelComponent, NgForOf, NgIf],\n})\nexport class LabelListComponent implements AfterContentInit, OnChanges, OnDestroy {\n @Input() labels: string[] = [];\n @Input() removeLabelsEnabled: boolean = false;\n @Input() responsive: boolean = false;\n @Input() seeLessTranslation: string = 'See less';\n\n @Output() removeLabel = new EventEmitter<string>();\n\n badgeWidth: number = 0;\n expanded: boolean = false;\n howManyItemsLeft = 0;\n responsiveLabels: string[] = [];\n\n private observer: ResizeObserver;\n private width$ = new BehaviorSubject<number>(0);\n\n constructor(\n private changeDetectorRef: ChangeDetectorRef,\n private elementRef: ElementRef,\n private textMeasurementService: TextMeasurementService,\n private zone: NgZone\n ) {\n this.observer = new ResizeObserver(entries => {\n this.zone.run(() => {\n this.width$.next(entries[0].contentRect.width);\n });\n });\n }\n\n ngAfterContentInit(): void {\n if (this.responsive) {\n this.generateResponsiveLabels(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0].offsetWidth);\n\n this.observer.observe(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0]);\n this.width$.subscribe(width => {\n this.generateResponsiveLabels(width);\n });\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.labels.currentValue && this.responsive) {\n this.generateResponsiveLabels(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0].offsetWidth);\n }\n }\n\n ngOnDestroy() {\n this.observer.unobserve(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0]);\n }\n\n onExpand() {\n this.expanded = !this.expanded;\n }\n\n onRemoveLabel({ content }: { content: string }): void {\n this.removeLabel.emit(content);\n }\n\n onResize() {\n this.generateResponsiveLabels(this.elementRef.nativeElement.children[0].offsetWidth);\n }\n\n public trackByLabelContent(_: number, entry: string) {\n return entry;\n }\n\n private generateResponsiveLabels(width: number) {\n let seeMoreElementWidth = this.textMeasurementService.calculateTextWidth('+'.concat(this.labels.length.toString()), 14, 'Averta');\n seeMoreElementWidth += 1 + 8 + 8 + 1; // border-left + padding-left + padding-right + border-right\n let elementWidth = width - 16 - 16; // width - padding-left - padding-right\n elementWidth -= seeMoreElementWidth;\n let currentIndex = 0;\n for (let index = 0; index < this.labels.length; index++) {\n let textWidth = this.textMeasurementService.calculateTextWidth(this.labels[index], 14, 'Averta');\n textWidth += 1 + 8 + (this.removeLabelsEnabled ? 25 : 8) + 1 + 4; // border-left + padding-left + padding-right + border-right + label spacing\n elementWidth -= textWidth;\n if (elementWidth <= 0) {\n break;\n }\n currentIndex = index;\n }\n if (currentIndex + 1 === this.labels.length) {\n this.expanded = false;\n }\n this.howManyItemsLeft = this.labels.length - (currentIndex + 1);\n this.badgeWidth =\n this.howManyItemsLeft > 0 && currentIndex === 0\n ? this.textMeasurementService.calculateTextWidth('+' + this.howManyItemsLeft, 14, 'Averta') + 22\n : 0;\n this.responsiveLabels = this.labels.slice(0, currentIndex + 1);\n this.changeDetectorRef.markForCheck();\n }\n}\n","<div\n class=\"labels-list\"\n (window:resize)=\"onResize()\">\n <ng-container *ngIf=\"responsive; else defaultLabels\">\n <ng-container *ngFor=\"let label of expanded ? labels : responsiveLabels\">\n <ap-label\n [content]=\"label\"\n [style.max-width]=\"!expanded ? 'calc(100% - ' + badgeWidth + 'px)' : '100%'\"\n [removable]=\"removeLabelsEnabled\"\n (remove)=\"onRemoveLabel($event)\" />\n </ng-container>\n\n <button\n *ngIf=\"!expanded && responsiveLabels.length !== labels.length && howManyItemsLeft > 0\"\n class=\"label-expand\"\n (click)=\"onExpand()\">\n +{{ howManyItemsLeft }}\n </button>\n <button\n *ngIf=\"expanded\"\n class=\"label-retract\"\n (click)=\"onExpand()\">\n {{ seeLessTranslation }}\n </button>\n </ng-container>\n\n <ng-template #defaultLabels>\n <ng-container *ngFor=\"let label of labels; trackBy: trackByLabelContent\">\n <ap-label\n [content]=\"label\"\n [removable]=\"removeLabelsEnabled\"\n (remove)=\"onRemoveLabel($event)\" />\n </ng-container>\n </ng-template>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MAea,cAAc,CAAA;AACf,IAAA,UAAU,GAAe,MAAM,CAAC,UAAU,CAAC,CAAC;AAC5C,IAAA,cAAc,GAAmB,MAAM,CAAC,cAAc,CAAC,CAAC;AACxD,IAAA,IAAI,GAAW,MAAM,CAAC,MAAM,CAAC,CAAC;AAKtC,IAAA,OAAO,CAAU;AACR,IAAA,aAAa,GAAW,CAAC,CAAC;IACK,SAAS,GAAY,KAAK,CAAC;AAEzD,IAAA,MAAM,GAAG,IAAI,YAAY,EAA2C,CAAC;IAEvE,QAAQ,GAA+B,SAAS,CAAC;IACzD,cAAc,GAAY,KAAK,CAAC;AAEhC,IAAA,WAAA,GAAA;QACI,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;KACvD;IAED,eAAe,GAAA;QACX,IAAI,CAAC,QAAQ,GAAG,IAAI,cAAc,CAAC,OAAO,IAAG;AACzC,YAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAK;gBACf,MAAM,cAAc,GAChB,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC;gBACnH,IAAI,cAAc,GAAG,CAAC,EAAE;AACpB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