@agorapulse/ui-components 20.4.11 → 20.4.13
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.4.13.tgz +0 -0
- package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs +91 -29
- package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-labels-selector.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-labels-selector.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-nav-selector.mjs +2 -2
- package/fesm2022/agorapulse-ui-components-nav-selector.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-select.mjs +229 -210
- package/fesm2022/agorapulse-ui-components-select.mjs.map +1 -1
- package/filter-dropdown/index.d.ts +20 -9
- package/package.json +1 -1
- package/select/index.d.ts +12 -8
- package/agorapulse-ui-components-20.4.11.tgz +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Input, ViewEncapsulation, Component, inject,
|
|
2
|
+
import { Input, ViewEncapsulation, Component, input, inject, ElementRef, Renderer2, ViewContainerRef, effect, Directive, output, HostListener, ViewChild, ChangeDetectionStrategy, EventEmitter, Output, signal, TemplateRef, computed, viewChild, viewChildren, afterRenderEffect, NgModule } from '@angular/core';
|
|
3
3
|
import { NgSelectComponent, NgSelectModule } from '@ng-select/ng-select';
|
|
4
4
|
import { BadgeComponent } from '@agorapulse/ui-components/badge';
|
|
5
5
|
import { CheckboxComponent } from '@agorapulse/ui-components/checkbox';
|
|
6
6
|
import { TooltipDirective } from '@agorapulse/ui-components/tooltip';
|
|
7
7
|
import { AvatarComponent } from '@agorapulse/ui-components/avatar';
|
|
8
8
|
import { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';
|
|
9
|
-
import { SymbolRegistry,
|
|
9
|
+
import { SymbolRegistry, apCheck, apPlus, SymbolComponent } from '@agorapulse/ui-symbol';
|
|
10
10
|
import { LoaderComponent } from '@agorapulse/ui-animations';
|
|
11
11
|
import { InputSearchComponent } from '@agorapulse/ui-components/input-search';
|
|
12
12
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -35,12 +35,34 @@ class DropdownGroupItemComponent {
|
|
|
35
35
|
isGroupDisabled() {
|
|
36
36
|
return this.children.every((child) => child.disabled);
|
|
37
37
|
}
|
|
38
|
+
onGroupClick(event) {
|
|
39
|
+
if (!this.select?.maxSelectedItems) {
|
|
40
|
+
return; // Let ng-select handle it normally
|
|
41
|
+
}
|
|
42
|
+
event.stopPropagation();
|
|
43
|
+
if (this.isGroupDisabled() || this.disabled) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const selectedChildren = this.children.filter((child) => child.selected);
|
|
47
|
+
if (selectedChildren.length > 0) {
|
|
48
|
+
for (const child of selectedChildren) {
|
|
49
|
+
this.select.unselect(child);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const remaining = this.select.maxSelectedItems - this.select.itemsList.selectedItems.length;
|
|
54
|
+
const selectableChildren = this.children.filter((child) => !child.disabled && !child.selected);
|
|
55
|
+
for (const child of selectableChildren.slice(0, remaining)) {
|
|
56
|
+
this.select.select(child);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
38
60
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DropdownGroupItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
39
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DropdownGroupItemComponent, isStandalone: true, selector: "ap-dropdown-group-item", inputs: { groupLabel: "groupLabel", groupTag: "groupTag", selectableGroup: "selectableGroup", children: "children", select: "select", disabled: "disabled", disabledTooltip: "disabledTooltip" }, ngImport: i0, template: "<div\n class=\"group\"\n [apTooltip]=\"disabledTooltip\"\n [apTooltipDisabled]=\"!disabled\">\n @if (selectableGroup) {\n <ap-checkbox\n [name]=\"'option-group-selection-' + groupLabel\"\n [disabled]=\"isGroupDisabled() || disabled\"\n [indeterminate]=\"isGroupIntermediate()\"\n [checked]=\"isGroupChecked()\">\n <span class=\"group-label\">\n {{ groupLabel }}\n </span>\n @if (groupTag) {\n <ap-badge color=\"blue\">\n {{ groupTag }}\n </ap-badge>\n }\n </ap-checkbox>\n } @else {\n <span\n class=\"group-label\"\n [title]=\"groupLabel\">\n {{ groupLabel }}\n </span>\n @if (groupTag) {\n <ap-badge color=\"blue\">\n {{ groupTag }}\n </ap-badge>\n }\n }\n</div>\n", styles: ["ap-dropdown-group-item{display:block;width:100%}\n"], dependencies: [{ kind: "component", type: BadgeComponent, selector: "ap-badge", inputs: ["color"] }, { kind: "component", type: CheckboxComponent, selector: "ap-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "disabled", "indeterminate", "checked", "required", "name"], outputs: ["change"] }, { kind: "directive", type: TooltipDirective, selector: "[apTooltip]", inputs: ["apTooltip", "apTooltipPosition", "apTooltipShowDelay", "apTooltipHideDelay", "apTooltipDuration", "apTooltipDisabled", "apTooltipTruncatedTextOnly", "apTooltipTemplateContext", "apTooltipVirtualScrollElement", "apTooltipTrigger", "apTooltipType", "apTooltipPresentationContext", "apTooltipListItems", "apTooltipShowAvatarCaption"], exportAs: ["apTooltip"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
61
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DropdownGroupItemComponent, isStandalone: true, selector: "ap-dropdown-group-item", inputs: { groupLabel: "groupLabel", groupTag: "groupTag", selectableGroup: "selectableGroup", children: "children", select: "select", disabled: "disabled", disabledTooltip: "disabledTooltip" }, ngImport: i0, template: "<div\n class=\"group\"\n [apTooltip]=\"disabledTooltip\"\n [apTooltipDisabled]=\"!disabled\"\n (click)=\"onGroupClick($event)\">\n @if (selectableGroup) {\n <ap-checkbox\n [name]=\"'option-group-selection-' + groupLabel\"\n [disabled]=\"isGroupDisabled() || disabled\"\n [indeterminate]=\"isGroupIntermediate()\"\n [checked]=\"isGroupChecked()\">\n <span class=\"group-label\">\n {{ groupLabel }}\n </span>\n @if (groupTag) {\n <ap-badge color=\"blue\">\n {{ groupTag }}\n </ap-badge>\n }\n </ap-checkbox>\n } @else {\n <span\n class=\"group-label\"\n [title]=\"groupLabel\">\n {{ groupLabel }}\n </span>\n @if (groupTag) {\n <ap-badge color=\"blue\">\n {{ groupTag }}\n </ap-badge>\n }\n }\n</div>\n", styles: ["ap-dropdown-group-item{display:block;width:100%}\n"], dependencies: [{ kind: "component", type: BadgeComponent, selector: "ap-badge", inputs: ["color"] }, { kind: "component", type: CheckboxComponent, selector: "ap-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "disabled", "indeterminate", "checked", "required", "name"], outputs: ["change"] }, { kind: "directive", type: TooltipDirective, selector: "[apTooltip]", inputs: ["apTooltip", "apTooltipPosition", "apTooltipShowDelay", "apTooltipHideDelay", "apTooltipDuration", "apTooltipDisabled", "apTooltipTruncatedTextOnly", "apTooltipTemplateContext", "apTooltipVirtualScrollElement", "apTooltipTrigger", "apTooltipType", "apTooltipPresentationContext", "apTooltipListItems", "apTooltipShowAvatarCaption"], exportAs: ["apTooltip"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
40
62
|
}
|
|
41
63
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DropdownGroupItemComponent, decorators: [{
|
|
42
64
|
type: Component,
|
|
43
|
-
args: [{ selector: 'ap-dropdown-group-item', encapsulation: ViewEncapsulation.None, imports: [BadgeComponent, CheckboxComponent, TooltipDirective], template: "<div\n class=\"group\"\n [apTooltip]=\"disabledTooltip\"\n [apTooltipDisabled]=\"!disabled\">\n @if (selectableGroup) {\n <ap-checkbox\n [name]=\"'option-group-selection-' + groupLabel\"\n [disabled]=\"isGroupDisabled() || disabled\"\n [indeterminate]=\"isGroupIntermediate()\"\n [checked]=\"isGroupChecked()\">\n <span class=\"group-label\">\n {{ groupLabel }}\n </span>\n @if (groupTag) {\n <ap-badge color=\"blue\">\n {{ groupTag }}\n </ap-badge>\n }\n </ap-checkbox>\n } @else {\n <span\n class=\"group-label\"\n [title]=\"groupLabel\">\n {{ groupLabel }}\n </span>\n @if (groupTag) {\n <ap-badge color=\"blue\">\n {{ groupTag }}\n </ap-badge>\n }\n }\n</div>\n", styles: ["ap-dropdown-group-item{display:block;width:100%}\n"] }]
|
|
65
|
+
args: [{ selector: 'ap-dropdown-group-item', encapsulation: ViewEncapsulation.None, imports: [BadgeComponent, CheckboxComponent, TooltipDirective], template: "<div\n class=\"group\"\n [apTooltip]=\"disabledTooltip\"\n [apTooltipDisabled]=\"!disabled\"\n (click)=\"onGroupClick($event)\">\n @if (selectableGroup) {\n <ap-checkbox\n [name]=\"'option-group-selection-' + groupLabel\"\n [disabled]=\"isGroupDisabled() || disabled\"\n [indeterminate]=\"isGroupIntermediate()\"\n [checked]=\"isGroupChecked()\">\n <span class=\"group-label\">\n {{ groupLabel }}\n </span>\n @if (groupTag) {\n <ap-badge color=\"blue\">\n {{ groupTag }}\n </ap-badge>\n }\n </ap-checkbox>\n } @else {\n <span\n class=\"group-label\"\n [title]=\"groupLabel\">\n {{ groupLabel }}\n </span>\n @if (groupTag) {\n <ap-badge color=\"blue\">\n {{ groupTag }}\n </ap-badge>\n }\n }\n</div>\n", styles: ["ap-dropdown-group-item{display:block;width:100%}\n"] }]
|
|
44
66
|
}], propDecorators: { groupLabel: [{
|
|
45
67
|
type: Input,
|
|
46
68
|
args: [{ required: true }]
|
|
@@ -62,8 +84,175 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
62
84
|
type: Input
|
|
63
85
|
}] } });
|
|
64
86
|
|
|
87
|
+
class SelectBaseDirective {
|
|
88
|
+
inlineLabel = input(...(ngDevMode ? [undefined, { debugName: "inlineLabel" }] : []));
|
|
89
|
+
symbolId = input(...(ngDevMode ? [undefined, { debugName: "symbolId" }] : []));
|
|
90
|
+
selectComponent = inject(NgSelectComponent);
|
|
91
|
+
el = inject(ElementRef);
|
|
92
|
+
renderer = inject(Renderer2);
|
|
93
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
94
|
+
symbolRegistry = inject(SymbolRegistry);
|
|
95
|
+
symbolComponentRef;
|
|
96
|
+
labelElement;
|
|
97
|
+
constructor() {
|
|
98
|
+
this.selectComponent.appendTo = 'body';
|
|
99
|
+
this.selectComponent.searchable = false;
|
|
100
|
+
this.selectComponent.clearable = false;
|
|
101
|
+
this.selectComponent.markFirst = false;
|
|
102
|
+
this.selectComponent.selectableGroupAsModel = false;
|
|
103
|
+
this.selectComponent.tabIndex = 0;
|
|
104
|
+
this.symbolRegistry.registerSymbols([apCheck, apPlus]);
|
|
105
|
+
this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));
|
|
106
|
+
// Handle symbolId changes
|
|
107
|
+
effect(() => {
|
|
108
|
+
const symbolId = this.symbolId();
|
|
109
|
+
this.removeInlineSymbol();
|
|
110
|
+
if (symbolId) {
|
|
111
|
+
this.addInlineSymbol(symbolId);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
// Handle inlineLabel changes
|
|
115
|
+
effect(() => {
|
|
116
|
+
const inlineLabel = this.inlineLabel();
|
|
117
|
+
this.removeInlineLabel();
|
|
118
|
+
if (inlineLabel) {
|
|
119
|
+
this.addInlineLabel(inlineLabel);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
ngAfterViewInit() {
|
|
124
|
+
if (!this.selectComponent.optionTemplate) {
|
|
125
|
+
throw new Error('optionTemplate is required for apSelect');
|
|
126
|
+
}
|
|
127
|
+
if (this.selectComponent.groupBy && !this.selectComponent.optgroupTemplate) {
|
|
128
|
+
throw new Error('optgroupTemplate is required for apSelect');
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
addInlineSymbol(symbolId) {
|
|
132
|
+
this.symbolComponentRef = this.viewContainerRef.createComponent(SymbolComponent);
|
|
133
|
+
this.symbolComponentRef.setInput('symbolId', symbolId);
|
|
134
|
+
this.symbolComponentRef.location.nativeElement.classList.add('inline-symbol');
|
|
135
|
+
this.renderer.insertBefore(this.el.nativeElement.getElementsByClassName('ng-select-container').item(0), this.symbolComponentRef.location.nativeElement, this.el.nativeElement.getElementsByClassName('ng-value-container').item(0));
|
|
136
|
+
}
|
|
137
|
+
removeInlineSymbol() {
|
|
138
|
+
if (this.symbolComponentRef) {
|
|
139
|
+
this.symbolComponentRef.destroy();
|
|
140
|
+
this.symbolComponentRef = undefined;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
addInlineLabel(label) {
|
|
144
|
+
this.labelElement = this.renderer.createElement('label');
|
|
145
|
+
this.renderer.setProperty(this.labelElement, 'textContent', label);
|
|
146
|
+
this.renderer.addClass(this.labelElement, 'inline-label');
|
|
147
|
+
this.renderer.insertBefore(this.el.nativeElement.getElementsByClassName('ng-select-container').item(0), this.labelElement, this.el.nativeElement.getElementsByClassName('ng-value-container').item(0));
|
|
148
|
+
}
|
|
149
|
+
removeInlineLabel() {
|
|
150
|
+
if (this.labelElement) {
|
|
151
|
+
this.renderer.removeChild(this.el.nativeElement.getElementsByClassName('ng-select-container').item(0), this.labelElement);
|
|
152
|
+
this.labelElement = undefined;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SelectBaseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
156
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.18", type: SelectBaseDirective, isStandalone: true, selector: "ng-select[apSelect]", inputs: { inlineLabel: { classPropertyName: "inlineLabel", publicName: "inlineLabel", isSignal: true, isRequired: false, transformFunction: null }, symbolId: { classPropertyName: "symbolId", publicName: "symbolId", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "ap-select" }, ngImport: i0 });
|
|
157
|
+
}
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SelectBaseDirective, decorators: [{
|
|
159
|
+
type: Directive,
|
|
160
|
+
args: [{
|
|
161
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
162
|
+
selector: 'ng-select[apSelect]',
|
|
163
|
+
standalone: true,
|
|
164
|
+
host: {
|
|
165
|
+
class: 'ap-select',
|
|
166
|
+
},
|
|
167
|
+
}]
|
|
168
|
+
}], ctorParameters: () => [], propDecorators: { inlineLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "inlineLabel", required: false }] }], symbolId: [{ type: i0.Input, args: [{ isSignal: true, alias: "symbolId", required: false }] }] } });
|
|
169
|
+
|
|
170
|
+
class SelectMultipleDirective {
|
|
171
|
+
selectComponent = inject(NgSelectComponent);
|
|
172
|
+
elementRef = inject(ElementRef);
|
|
173
|
+
originalDisabledState = new WeakMap();
|
|
174
|
+
maxItemsTooltip = input(...(ngDevMode ? [undefined, { debugName: "maxItemsTooltip" }] : []));
|
|
175
|
+
valueContainer = null;
|
|
176
|
+
constructor() {
|
|
177
|
+
this.selectComponent.multiple = true;
|
|
178
|
+
this.selectComponent.closeOnSelect = false;
|
|
179
|
+
this.selectComponent.searchable = true; // small hack to not closed the dropdown panel when clear an item in value container
|
|
180
|
+
this.selectComponent.addEvent.subscribe(() => this.updateMaxItemsDisabledState());
|
|
181
|
+
this.selectComponent.removeEvent.subscribe(() => this.updateMaxItemsDisabledState());
|
|
182
|
+
this.selectComponent.clearEvent.subscribe(() => this.updateMaxItemsDisabledState());
|
|
183
|
+
}
|
|
184
|
+
ngAfterViewInit() {
|
|
185
|
+
if (!this.selectComponent.multiLabelTemplate) {
|
|
186
|
+
throw new Error('multiLabelTemplate is required for apSelectMultiple');
|
|
187
|
+
}
|
|
188
|
+
// Add click handler to toggle dropdown when clicking on the select container
|
|
189
|
+
this.valueContainer = this.elementRef.nativeElement.querySelector('.ng-select-container');
|
|
190
|
+
if (this.valueContainer) {
|
|
191
|
+
this.valueContainer.addEventListener('mousedown', this.onMousedown, true);
|
|
192
|
+
}
|
|
193
|
+
this.updateMaxItemsDisabledState();
|
|
194
|
+
}
|
|
195
|
+
ngOnDestroy() {
|
|
196
|
+
if (this.valueContainer) {
|
|
197
|
+
this.valueContainer.removeEventListener('mousedown', this.onMousedown);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
onMousedown = (event) => {
|
|
201
|
+
// Only toggle if clicking on the container itself, not on the items inside
|
|
202
|
+
const target = event.target;
|
|
203
|
+
if (!target.closest('ap-select-label-multiple') && !target.closest('.ng-clear-wrapper')) {
|
|
204
|
+
event.preventDefault();
|
|
205
|
+
event.stopPropagation();
|
|
206
|
+
if (this.selectComponent.isOpen) {
|
|
207
|
+
this.selectComponent.close();
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
this.selectComponent.open();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
updateMaxItemsDisabledState() {
|
|
215
|
+
const max = this.selectComponent.maxSelectedItems;
|
|
216
|
+
if (!max) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
const items = this.selectComponent.itemsList.items;
|
|
220
|
+
for (const item of items) {
|
|
221
|
+
if (item.children || this.originalDisabledState.has(item)) {
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
this.originalDisabledState.set(item, item.disabled ?? false);
|
|
225
|
+
}
|
|
226
|
+
const maxReached = this.selectComponent.itemsList.selectedItems.length >= max;
|
|
227
|
+
for (const item of items) {
|
|
228
|
+
if (item.children) {
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
const originallyDisabled = this.originalDisabledState.get(item) ?? false;
|
|
232
|
+
item.disabled = originallyDisabled || (maxReached && !item.selected);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SelectMultipleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
236
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.18", type: SelectMultipleDirective, isStandalone: true, selector: "ng-select[apSelectMultiple]", inputs: { maxItemsTooltip: { classPropertyName: "maxItemsTooltip", publicName: "maxItemsTooltip", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: SelectBaseDirective, inputs: ["inlineLabel", "inlineLabel", "symbolId", "symbolId"] }], ngImport: i0 });
|
|
237
|
+
}
|
|
238
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SelectMultipleDirective, decorators: [{
|
|
239
|
+
type: Directive,
|
|
240
|
+
args: [{
|
|
241
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
242
|
+
selector: 'ng-select[apSelectMultiple]',
|
|
243
|
+
standalone: true,
|
|
244
|
+
hostDirectives: [
|
|
245
|
+
{
|
|
246
|
+
directive: SelectBaseDirective,
|
|
247
|
+
inputs: ['inlineLabel', 'symbolId'],
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
}]
|
|
251
|
+
}], ctorParameters: () => [], propDecorators: { maxItemsTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxItemsTooltip", required: false }] }] } });
|
|
252
|
+
|
|
65
253
|
class DropdownItemMultipleOneLineComponent {
|
|
66
254
|
symbolRegistry = inject(SymbolRegistry);
|
|
255
|
+
selectMultiple = inject(SelectMultipleDirective, { optional: true });
|
|
67
256
|
constructor() {
|
|
68
257
|
this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));
|
|
69
258
|
}
|
|
@@ -103,11 +292,11 @@ class DropdownItemMultipleOneLineComponent {
|
|
|
103
292
|
}
|
|
104
293
|
}
|
|
105
294
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DropdownItemMultipleOneLineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
106
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DropdownItemMultipleOneLineComponent, isStandalone: true, selector: "ap-dropdown-item-multiple-one-line", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: false, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: false, isRequired: true, transformFunction: null }, htmlId: { classPropertyName: "htmlId", publicName: "htmlId", isSignal: false, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, avatarUrl: { classPropertyName: "avatarUrl", publicName: "avatarUrl", isSignal: false, isRequired: false, transformFunction: null }, symbolId: { classPropertyName: "symbolId", publicName: "symbolId", isSignal: false, isRequired: false, transformFunction: null }, disabledTooltip: { classPropertyName: "disabledTooltip", publicName: "disabledTooltip", isSignal: false, isRequired: false, transformFunction: null }, badgeText: { classPropertyName: "badgeText", publicName: "badgeText", isSignal: false, isRequired: false, transformFunction: null }, dividerEnabled: { classPropertyName: "dividerEnabled", publicName: "dividerEnabled", isSignal: false, isRequired: false, transformFunction: null }, onlyEnabled: { classPropertyName: "onlyEnabled", publicName: "onlyEnabled", isSignal: false, isRequired: false, transformFunction: null }, onlyText: { classPropertyName: "onlyText", publicName: "onlyText", isSignal: false, isRequired: false, transformFunction: null }, isFeatureLocked: { classPropertyName: "isFeatureLocked", publicName: "isFeatureLocked", isSignal: true, isRequired: false, transformFunction: null }, roundedAvatar: { classPropertyName: "roundedAvatar", publicName: "roundedAvatar", isSignal: true, isRequired: false, transformFunction: null }, network: { classPropertyName: "network", publicName: "network", isSignal: true, isRequired: false, transformFunction: null }, symbolColor: { classPropertyName: "symbolColor", publicName: "symbolColor", isSignal: true, isRequired: false, transformFunction: null }, symbolTooltipText: { classPropertyName: "symbolTooltipText", publicName: "symbolTooltipText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectOnly: "selectOnly", selectionChange: "selectionChange", lockedFeatureClicked: "lockedFeatureClicked" }, host: { listeners: { "click": "onClick($event)" } }, viewQueries: [{ propertyName: "checkbox", first: true, predicate: CheckboxComponent, descendants: true }], ngImport: i0, template: "<div\n class=\"disabled-opaque\"\n [apTooltip]=\"disabledTooltip\"\n [apTooltipDisabled]=\"!disabled\"></div>\n<div\n class=\"option multiple\"\n [class.feature-locked-option]=\"isFeatureLocked()\">\n <ap-checkbox\n #checkbox\n [checked]=\"selected\"\n [disabled]=\"disabled || isFeatureLocked()\"\n [name]=\"'option-selection-' + htmlId\"\n (change)=\"onCheckboxChange($event)\">\n @if (avatarUrl !== undefined) {\n <ap-avatar\n [rounded]=\"roundedAvatar()\"\n [size]=\"24\"\n [profilePicture]=\"avatarUrl\"\n [username]=\"text\"\n [showInitials]=\"true\"\n [network]=\"network()\" />\n }\n @if (symbolId) {\n <ap-symbol\n size=\"sm\"\n [symbolId]=\"symbolId\"\n [color]=\"symbolColor() ?? ''\"\n [apTooltip]=\"symbolTooltipText() ? symbolTooltipText() : undefined\" />\n }\n <span\n class=\"option-item\"\n [class.feature-locked-label]=\"isFeatureLocked()\"\n [title]=\"text\">\n {{ text }}\n </span>\n @if (badgeText) {\n <ap-badge color=\"blue\">\n {{ badgeText }}\n </ap-badge>\n }\n </ap-checkbox>\n\n @if (isFeatureLocked()) {\n <ap-symbol\n symbolId=\"feature-lock\"\n color=\"purple\"\n size=\"sm\" />\n }\n\n @if (onlyEnabled && !disabled && !isFeatureLocked()) {\n <button\n class=\"standalone-link\"\n type=\"button\"\n (click)=\"$event.preventDefault(); $event.stopPropagation(); onSelectOnly()\">\n {{ onlyText }}\n </button>\n }\n</div>\n\n@if (dividerEnabled) {\n <div class=\"divider\"></div>\n}\n", styles: ["ap-dropdown-item-multiple-one-line .option{display:flex;gap:var(--ref-spacing-xxs);width:100%}ap-dropdown-item-multiple-one-line .option ap-checkbox{width:100%}ap-dropdown-item-multiple-one-line .option ap-checkbox label{display:flex;flex-direction:row;gap:var(--ref-spacing-xxs);align-items:center}ap-dropdown-item-multiple-one-line .option-item{width:100%;word-break:break-word}\n"], dependencies: [{ kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "component", type: CheckboxComponent, selector: "ap-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "disabled", "indeterminate", "checked", "required", "name"], outputs: ["change"] }, { kind: "component", type: AvatarComponent, selector: "ap-avatar", inputs: ["profilePicture", "alt", "network", "size", "username", "showInitials", "bigNetwork", "anonymous", "online", "youtubeAvatarMode", "rounded"] }, { kind: "component", type: BadgeComponent, selector: "ap-badge", inputs: ["color"] }, { kind: "directive", type: TooltipDirective, selector: "[apTooltip]", inputs: ["apTooltip", "apTooltipPosition", "apTooltipShowDelay", "apTooltipHideDelay", "apTooltipDuration", "apTooltipDisabled", "apTooltipTruncatedTextOnly", "apTooltipTemplateContext", "apTooltipVirtualScrollElement", "apTooltipTrigger", "apTooltipType", "apTooltipPresentationContext", "apTooltipListItems", "apTooltipShowAvatarCaption"], exportAs: ["apTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
295
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DropdownItemMultipleOneLineComponent, isStandalone: true, selector: "ap-dropdown-item-multiple-one-line", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: false, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: false, isRequired: true, transformFunction: null }, htmlId: { classPropertyName: "htmlId", publicName: "htmlId", isSignal: false, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, avatarUrl: { classPropertyName: "avatarUrl", publicName: "avatarUrl", isSignal: false, isRequired: false, transformFunction: null }, symbolId: { classPropertyName: "symbolId", publicName: "symbolId", isSignal: false, isRequired: false, transformFunction: null }, disabledTooltip: { classPropertyName: "disabledTooltip", publicName: "disabledTooltip", isSignal: false, isRequired: false, transformFunction: null }, badgeText: { classPropertyName: "badgeText", publicName: "badgeText", isSignal: false, isRequired: false, transformFunction: null }, dividerEnabled: { classPropertyName: "dividerEnabled", publicName: "dividerEnabled", isSignal: false, isRequired: false, transformFunction: null }, onlyEnabled: { classPropertyName: "onlyEnabled", publicName: "onlyEnabled", isSignal: false, isRequired: false, transformFunction: null }, onlyText: { classPropertyName: "onlyText", publicName: "onlyText", isSignal: false, isRequired: false, transformFunction: null }, isFeatureLocked: { classPropertyName: "isFeatureLocked", publicName: "isFeatureLocked", isSignal: true, isRequired: false, transformFunction: null }, roundedAvatar: { classPropertyName: "roundedAvatar", publicName: "roundedAvatar", isSignal: true, isRequired: false, transformFunction: null }, network: { classPropertyName: "network", publicName: "network", isSignal: true, isRequired: false, transformFunction: null }, symbolColor: { classPropertyName: "symbolColor", publicName: "symbolColor", isSignal: true, isRequired: false, transformFunction: null }, symbolTooltipText: { classPropertyName: "symbolTooltipText", publicName: "symbolTooltipText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectOnly: "selectOnly", selectionChange: "selectionChange", lockedFeatureClicked: "lockedFeatureClicked" }, host: { listeners: { "click": "onClick($event)" } }, viewQueries: [{ propertyName: "checkbox", first: true, predicate: CheckboxComponent, descendants: true }], ngImport: i0, template: "<div\n class=\"disabled-opaque\"\n [apTooltip]=\"disabledTooltip ?? selectMultiple?.maxItemsTooltip()\"\n [apTooltipDisabled]=\"!disabled\"></div>\n<div\n class=\"option multiple\"\n [class.feature-locked-option]=\"isFeatureLocked()\">\n <ap-checkbox\n #checkbox\n [checked]=\"selected\"\n [disabled]=\"disabled || isFeatureLocked()\"\n [name]=\"'option-selection-' + htmlId\"\n (change)=\"onCheckboxChange($event)\">\n @if (avatarUrl !== undefined) {\n <ap-avatar\n [rounded]=\"roundedAvatar()\"\n [size]=\"24\"\n [profilePicture]=\"avatarUrl\"\n [username]=\"text\"\n [showInitials]=\"true\"\n [network]=\"network()\" />\n }\n @if (symbolId) {\n <ap-symbol\n size=\"sm\"\n [symbolId]=\"symbolId\"\n [color]=\"symbolColor() ?? ''\"\n [apTooltip]=\"symbolTooltipText() ? symbolTooltipText() : undefined\" />\n }\n <span\n class=\"option-item\"\n [class.feature-locked-label]=\"isFeatureLocked()\"\n [title]=\"text\">\n {{ text }}\n </span>\n @if (badgeText) {\n <ap-badge color=\"blue\">\n {{ badgeText }}\n </ap-badge>\n }\n </ap-checkbox>\n\n @if (isFeatureLocked()) {\n <ap-symbol\n symbolId=\"feature-lock\"\n color=\"purple\"\n size=\"sm\" />\n }\n\n @if (onlyEnabled && !disabled && !isFeatureLocked()) {\n <button\n class=\"standalone-link\"\n type=\"button\"\n (click)=\"$event.preventDefault(); $event.stopPropagation(); onSelectOnly()\">\n {{ onlyText }}\n </button>\n }\n</div>\n\n@if (dividerEnabled) {\n <div class=\"divider\"></div>\n}\n", styles: ["ap-dropdown-item-multiple-one-line .option{display:flex;gap:var(--ref-spacing-xxs);width:100%}ap-dropdown-item-multiple-one-line .option ap-checkbox{width:100%}ap-dropdown-item-multiple-one-line .option ap-checkbox label{display:flex;flex-direction:row;gap:var(--ref-spacing-xxs);align-items:center}ap-dropdown-item-multiple-one-line .option-item{width:100%;word-break:break-word}\n"], dependencies: [{ kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "component", type: CheckboxComponent, selector: "ap-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "disabled", "indeterminate", "checked", "required", "name"], outputs: ["change"] }, { kind: "component", type: AvatarComponent, selector: "ap-avatar", inputs: ["profilePicture", "alt", "network", "size", "username", "showInitials", "bigNetwork", "anonymous", "online", "youtubeAvatarMode", "rounded"] }, { kind: "component", type: BadgeComponent, selector: "ap-badge", inputs: ["color"] }, { kind: "directive", type: TooltipDirective, selector: "[apTooltip]", inputs: ["apTooltip", "apTooltipPosition", "apTooltipShowDelay", "apTooltipHideDelay", "apTooltipDuration", "apTooltipDisabled", "apTooltipTruncatedTextOnly", "apTooltipTemplateContext", "apTooltipVirtualScrollElement", "apTooltipTrigger", "apTooltipType", "apTooltipPresentationContext", "apTooltipListItems", "apTooltipShowAvatarCaption"], exportAs: ["apTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
107
296
|
}
|
|
108
297
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DropdownItemMultipleOneLineComponent, decorators: [{
|
|
109
298
|
type: Component,
|
|
110
|
-
args: [{ selector: 'ap-dropdown-item-multiple-one-line', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [SymbolComponent, CheckboxComponent, AvatarComponent, BadgeComponent, TooltipDirective
|
|
299
|
+
args: [{ selector: 'ap-dropdown-item-multiple-one-line', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [SymbolComponent, CheckboxComponent, AvatarComponent, BadgeComponent, TooltipDirective], template: "<div\n class=\"disabled-opaque\"\n [apTooltip]=\"disabledTooltip ?? selectMultiple?.maxItemsTooltip()\"\n [apTooltipDisabled]=\"!disabled\"></div>\n<div\n class=\"option multiple\"\n [class.feature-locked-option]=\"isFeatureLocked()\">\n <ap-checkbox\n #checkbox\n [checked]=\"selected\"\n [disabled]=\"disabled || isFeatureLocked()\"\n [name]=\"'option-selection-' + htmlId\"\n (change)=\"onCheckboxChange($event)\">\n @if (avatarUrl !== undefined) {\n <ap-avatar\n [rounded]=\"roundedAvatar()\"\n [size]=\"24\"\n [profilePicture]=\"avatarUrl\"\n [username]=\"text\"\n [showInitials]=\"true\"\n [network]=\"network()\" />\n }\n @if (symbolId) {\n <ap-symbol\n size=\"sm\"\n [symbolId]=\"symbolId\"\n [color]=\"symbolColor() ?? ''\"\n [apTooltip]=\"symbolTooltipText() ? symbolTooltipText() : undefined\" />\n }\n <span\n class=\"option-item\"\n [class.feature-locked-label]=\"isFeatureLocked()\"\n [title]=\"text\">\n {{ text }}\n </span>\n @if (badgeText) {\n <ap-badge color=\"blue\">\n {{ badgeText }}\n </ap-badge>\n }\n </ap-checkbox>\n\n @if (isFeatureLocked()) {\n <ap-symbol\n symbolId=\"feature-lock\"\n color=\"purple\"\n size=\"sm\" />\n }\n\n @if (onlyEnabled && !disabled && !isFeatureLocked()) {\n <button\n class=\"standalone-link\"\n type=\"button\"\n (click)=\"$event.preventDefault(); $event.stopPropagation(); onSelectOnly()\">\n {{ onlyText }}\n </button>\n }\n</div>\n\n@if (dividerEnabled) {\n <div class=\"divider\"></div>\n}\n", styles: ["ap-dropdown-item-multiple-one-line .option{display:flex;gap:var(--ref-spacing-xxs);width:100%}ap-dropdown-item-multiple-one-line .option ap-checkbox{width:100%}ap-dropdown-item-multiple-one-line .option ap-checkbox label{display:flex;flex-direction:row;gap:var(--ref-spacing-xxs);align-items:center}ap-dropdown-item-multiple-one-line .option-item{width:100%;word-break:break-word}\n"] }]
|
|
111
300
|
}], ctorParameters: () => [], propDecorators: { text: [{
|
|
112
301
|
type: Input,
|
|
113
302
|
args: [{ required: true }]
|
|
@@ -143,6 +332,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
143
332
|
|
|
144
333
|
class DropdownItemMultipleTwoLinesComponent {
|
|
145
334
|
symbolRegistry = inject(SymbolRegistry);
|
|
335
|
+
selectMultiple = inject(SelectMultipleDirective, { optional: true });
|
|
146
336
|
constructor() {
|
|
147
337
|
this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));
|
|
148
338
|
}
|
|
@@ -177,11 +367,11 @@ class DropdownItemMultipleTwoLinesComponent {
|
|
|
177
367
|
this.checkbox.focus();
|
|
178
368
|
}
|
|
179
369
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DropdownItemMultipleTwoLinesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
180
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DropdownItemMultipleTwoLinesComponent, isStandalone: true, selector: "ap-dropdown-item-multiple-two-lines", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: false, isRequired: true, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: false, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: false, isRequired: true, transformFunction: null }, htmlId: { classPropertyName: "htmlId", publicName: "htmlId", isSignal: false, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, avatarUrl: { classPropertyName: "avatarUrl", publicName: "avatarUrl", isSignal: false, isRequired: false, transformFunction: null }, symbolId: { classPropertyName: "symbolId", publicName: "symbolId", isSignal: false, isRequired: false, transformFunction: null }, disabledTooltip: { classPropertyName: "disabledTooltip", publicName: "disabledTooltip", isSignal: false, isRequired: false, transformFunction: null }, badgeText: { classPropertyName: "badgeText", publicName: "badgeText", isSignal: false, isRequired: false, transformFunction: null }, dividerEnabled: { classPropertyName: "dividerEnabled", publicName: "dividerEnabled", isSignal: false, isRequired: false, transformFunction: null }, onlyEnabled: { classPropertyName: "onlyEnabled", publicName: "onlyEnabled", isSignal: false, isRequired: false, transformFunction: null }, onlyText: { classPropertyName: "onlyText", publicName: "onlyText", isSignal: false, isRequired: false, transformFunction: null }, isFeatureLocked: { classPropertyName: "isFeatureLocked", publicName: "isFeatureLocked", isSignal: true, isRequired: false, transformFunction: null }, roundedAvatar: { classPropertyName: "roundedAvatar", publicName: "roundedAvatar", isSignal: true, isRequired: false, transformFunction: null }, network: { classPropertyName: "network", publicName: "network", isSignal: true, isRequired: false, transformFunction: null }, symbolColor: { classPropertyName: "symbolColor", publicName: "symbolColor", isSignal: true, isRequired: false, transformFunction: null }, symbolTooltipText: { classPropertyName: "symbolTooltipText", publicName: "symbolTooltipText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectOnly: "selectOnly", lockedFeatureClicked: "lockedFeatureClicked" }, host: { listeners: { "click": "onClick($event)" } }, viewQueries: [{ propertyName: "checkbox", first: true, predicate: CheckboxComponent, descendants: true }], ngImport: i0, template: "<div\n class=\"disabled-opaque\"\n [apTooltip]=\"disabledTooltip\"\n [apTooltipDisabled]=\"!disabled\"></div>\n<div class=\"option multiple with-caption\" [class.feature-locked-option]=\"isFeatureLocked()\">\n <ap-checkbox\n [checked]=\"selected\"\n [disabled]=\"disabled || isFeatureLocked()\"\n [name]=\"'option-selection-' + htmlId\">\n @if (avatarUrl !== undefined) {\n <ap-avatar\n [rounded]=\"roundedAvatar()\"\n [size]=\"24\"\n [profilePicture]=\"avatarUrl\"\n [username]=\"text\"\n [showInitials]=\"true\"\n [network]=\"network()\" />\n }\n @if (symbolId) {\n <ap-symbol\n size=\"sm\"\n [symbolId]=\"symbolId\"\n [color]=\"symbolColor() ?? ''\"\n [apTooltip]=\"symbolTooltipText() ? symbolTooltipText() : undefined\" />\n }\n <div class=\"texts\" [class.feature-locked-label]=\"isFeatureLocked()\">\n <div class=\"first-line\">\n <span\n class=\"label\"\n\n [title]=\"text\">\n {{ text }}\n </span>\n @if (badgeText) {\n <ap-badge color=\"blue\">\n {{ badgeText }}\n </ap-badge>\n }\n </div>\n <span\n class=\"caption\"\n [title]=\"caption\">\n {{ caption }}\n </span>\n </div>\n\n @if (isFeatureLocked()) {\n <ap-symbol\n symbolId=\"feature-lock\"\n color=\"purple\"\n size=\"sm\"/>\n }\n\n @if (onlyEnabled && !disabled) {\n <button\n class=\"standalone-link\"\n type=\"button\"\n (click)=\"$event.preventDefault(); $event.stopPropagation(); onSelectOnly()\">\n {{ onlyText }}\n </button>\n }\n </ap-checkbox>\n</div>\n@if (dividerEnabled) {\n <div class=\"divider\"></div>\n}\n", styles: ["ap-dropdown-item-multiple-two-lines .option{display:flex;gap:var(--ref-spacing-xxs)}ap-dropdown-item-multiple-two-lines .option ap-checkbox label{display:flex;gap:var(--ref-spacing-xxs);align-items:center}ap-dropdown-item-multiple-two-lines .option .texts{flex:1;overflow:auto;display:flex;flex-direction:column}ap-dropdown-item-multiple-two-lines .option .texts .first-line{display:flex;align-items:center;gap:var(--ref-spacing-xxs)}ap-dropdown-item-multiple-two-lines .option .texts .first-line .label{display:inline-block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"], dependencies: [{ kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "component", type: CheckboxComponent, selector: "ap-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "disabled", "indeterminate", "checked", "required", "name"], outputs: ["change"] }, { kind: "component", type: AvatarComponent, selector: "ap-avatar", inputs: ["profilePicture", "alt", "network", "size", "username", "showInitials", "bigNetwork", "anonymous", "online", "youtubeAvatarMode", "rounded"] }, { kind: "component", type: BadgeComponent, selector: "ap-badge", inputs: ["color"] }, { kind: "directive", type: TooltipDirective, selector: "[apTooltip]", inputs: ["apTooltip", "apTooltipPosition", "apTooltipShowDelay", "apTooltipHideDelay", "apTooltipDuration", "apTooltipDisabled", "apTooltipTruncatedTextOnly", "apTooltipTemplateContext", "apTooltipVirtualScrollElement", "apTooltipTrigger", "apTooltipType", "apTooltipPresentationContext", "apTooltipListItems", "apTooltipShowAvatarCaption"], exportAs: ["apTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
370
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DropdownItemMultipleTwoLinesComponent, isStandalone: true, selector: "ap-dropdown-item-multiple-two-lines", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: false, isRequired: true, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: false, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: false, isRequired: true, transformFunction: null }, htmlId: { classPropertyName: "htmlId", publicName: "htmlId", isSignal: false, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, avatarUrl: { classPropertyName: "avatarUrl", publicName: "avatarUrl", isSignal: false, isRequired: false, transformFunction: null }, symbolId: { classPropertyName: "symbolId", publicName: "symbolId", isSignal: false, isRequired: false, transformFunction: null }, disabledTooltip: { classPropertyName: "disabledTooltip", publicName: "disabledTooltip", isSignal: false, isRequired: false, transformFunction: null }, badgeText: { classPropertyName: "badgeText", publicName: "badgeText", isSignal: false, isRequired: false, transformFunction: null }, dividerEnabled: { classPropertyName: "dividerEnabled", publicName: "dividerEnabled", isSignal: false, isRequired: false, transformFunction: null }, onlyEnabled: { classPropertyName: "onlyEnabled", publicName: "onlyEnabled", isSignal: false, isRequired: false, transformFunction: null }, onlyText: { classPropertyName: "onlyText", publicName: "onlyText", isSignal: false, isRequired: false, transformFunction: null }, isFeatureLocked: { classPropertyName: "isFeatureLocked", publicName: "isFeatureLocked", isSignal: true, isRequired: false, transformFunction: null }, roundedAvatar: { classPropertyName: "roundedAvatar", publicName: "roundedAvatar", isSignal: true, isRequired: false, transformFunction: null }, network: { classPropertyName: "network", publicName: "network", isSignal: true, isRequired: false, transformFunction: null }, symbolColor: { classPropertyName: "symbolColor", publicName: "symbolColor", isSignal: true, isRequired: false, transformFunction: null }, symbolTooltipText: { classPropertyName: "symbolTooltipText", publicName: "symbolTooltipText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectOnly: "selectOnly", lockedFeatureClicked: "lockedFeatureClicked" }, host: { listeners: { "click": "onClick($event)" } }, viewQueries: [{ propertyName: "checkbox", first: true, predicate: CheckboxComponent, descendants: true }], ngImport: i0, template: "<div\n class=\"disabled-opaque\"\n [apTooltip]=\"disabledTooltip ?? selectMultiple?.maxItemsTooltip()\"\n [apTooltipDisabled]=\"!disabled\"></div>\n<div class=\"option multiple with-caption\" [class.feature-locked-option]=\"isFeatureLocked()\">\n <ap-checkbox\n [checked]=\"selected\"\n [disabled]=\"disabled || isFeatureLocked()\"\n [name]=\"'option-selection-' + htmlId\">\n @if (avatarUrl !== undefined) {\n <ap-avatar\n [rounded]=\"roundedAvatar()\"\n [size]=\"24\"\n [profilePicture]=\"avatarUrl\"\n [username]=\"text\"\n [showInitials]=\"true\"\n [network]=\"network()\" />\n }\n @if (symbolId) {\n <ap-symbol\n size=\"sm\"\n [symbolId]=\"symbolId\"\n [color]=\"symbolColor() ?? ''\"\n [apTooltip]=\"symbolTooltipText() ? symbolTooltipText() : undefined\" />\n }\n <div class=\"texts\" [class.feature-locked-label]=\"isFeatureLocked()\">\n <div class=\"first-line\">\n <span\n class=\"label\"\n\n [title]=\"text\">\n {{ text }}\n </span>\n @if (badgeText) {\n <ap-badge color=\"blue\">\n {{ badgeText }}\n </ap-badge>\n }\n </div>\n <span\n class=\"caption\"\n [title]=\"caption\">\n {{ caption }}\n </span>\n </div>\n\n @if (isFeatureLocked()) {\n <ap-symbol\n symbolId=\"feature-lock\"\n color=\"purple\"\n size=\"sm\"/>\n }\n\n @if (onlyEnabled && !disabled) {\n <button\n class=\"standalone-link\"\n type=\"button\"\n (click)=\"$event.preventDefault(); $event.stopPropagation(); onSelectOnly()\">\n {{ onlyText }}\n </button>\n }\n </ap-checkbox>\n</div>\n@if (dividerEnabled) {\n <div class=\"divider\"></div>\n}\n", styles: ["ap-dropdown-item-multiple-two-lines .option{display:flex;gap:var(--ref-spacing-xxs)}ap-dropdown-item-multiple-two-lines .option ap-checkbox label{display:flex;gap:var(--ref-spacing-xxs);align-items:center}ap-dropdown-item-multiple-two-lines .option .texts{flex:1;overflow:auto;display:flex;flex-direction:column}ap-dropdown-item-multiple-two-lines .option .texts .first-line{display:flex;align-items:center;gap:var(--ref-spacing-xxs)}ap-dropdown-item-multiple-two-lines .option .texts .first-line .label{display:inline-block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"], dependencies: [{ kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "component", type: CheckboxComponent, selector: "ap-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "disabled", "indeterminate", "checked", "required", "name"], outputs: ["change"] }, { kind: "component", type: AvatarComponent, selector: "ap-avatar", inputs: ["profilePicture", "alt", "network", "size", "username", "showInitials", "bigNetwork", "anonymous", "online", "youtubeAvatarMode", "rounded"] }, { kind: "component", type: BadgeComponent, selector: "ap-badge", inputs: ["color"] }, { kind: "directive", type: TooltipDirective, selector: "[apTooltip]", inputs: ["apTooltip", "apTooltipPosition", "apTooltipShowDelay", "apTooltipHideDelay", "apTooltipDuration", "apTooltipDisabled", "apTooltipTruncatedTextOnly", "apTooltipTemplateContext", "apTooltipVirtualScrollElement", "apTooltipTrigger", "apTooltipType", "apTooltipPresentationContext", "apTooltipListItems", "apTooltipShowAvatarCaption"], exportAs: ["apTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
181
371
|
}
|
|
182
372
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DropdownItemMultipleTwoLinesComponent, decorators: [{
|
|
183
373
|
type: Component,
|
|
184
|
-
args: [{ selector: 'ap-dropdown-item-multiple-two-lines', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [SymbolComponent, CheckboxComponent, AvatarComponent, BadgeComponent, TooltipDirective], template: "<div\n class=\"disabled-opaque\"\n [apTooltip]=\"disabledTooltip\"\n [apTooltipDisabled]=\"!disabled\"></div>\n<div class=\"option multiple with-caption\" [class.feature-locked-option]=\"isFeatureLocked()\">\n <ap-checkbox\n [checked]=\"selected\"\n [disabled]=\"disabled || isFeatureLocked()\"\n [name]=\"'option-selection-' + htmlId\">\n @if (avatarUrl !== undefined) {\n <ap-avatar\n [rounded]=\"roundedAvatar()\"\n [size]=\"24\"\n [profilePicture]=\"avatarUrl\"\n [username]=\"text\"\n [showInitials]=\"true\"\n [network]=\"network()\" />\n }\n @if (symbolId) {\n <ap-symbol\n size=\"sm\"\n [symbolId]=\"symbolId\"\n [color]=\"symbolColor() ?? ''\"\n [apTooltip]=\"symbolTooltipText() ? symbolTooltipText() : undefined\" />\n }\n <div class=\"texts\" [class.feature-locked-label]=\"isFeatureLocked()\">\n <div class=\"first-line\">\n <span\n class=\"label\"\n\n [title]=\"text\">\n {{ text }}\n </span>\n @if (badgeText) {\n <ap-badge color=\"blue\">\n {{ badgeText }}\n </ap-badge>\n }\n </div>\n <span\n class=\"caption\"\n [title]=\"caption\">\n {{ caption }}\n </span>\n </div>\n\n @if (isFeatureLocked()) {\n <ap-symbol\n symbolId=\"feature-lock\"\n color=\"purple\"\n size=\"sm\"/>\n }\n\n @if (onlyEnabled && !disabled) {\n <button\n class=\"standalone-link\"\n type=\"button\"\n (click)=\"$event.preventDefault(); $event.stopPropagation(); onSelectOnly()\">\n {{ onlyText }}\n </button>\n }\n </ap-checkbox>\n</div>\n@if (dividerEnabled) {\n <div class=\"divider\"></div>\n}\n", styles: ["ap-dropdown-item-multiple-two-lines .option{display:flex;gap:var(--ref-spacing-xxs)}ap-dropdown-item-multiple-two-lines .option ap-checkbox label{display:flex;gap:var(--ref-spacing-xxs);align-items:center}ap-dropdown-item-multiple-two-lines .option .texts{flex:1;overflow:auto;display:flex;flex-direction:column}ap-dropdown-item-multiple-two-lines .option .texts .first-line{display:flex;align-items:center;gap:var(--ref-spacing-xxs)}ap-dropdown-item-multiple-two-lines .option .texts .first-line .label{display:inline-block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"] }]
|
|
374
|
+
args: [{ selector: 'ap-dropdown-item-multiple-two-lines', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [SymbolComponent, CheckboxComponent, AvatarComponent, BadgeComponent, TooltipDirective], template: "<div\n class=\"disabled-opaque\"\n [apTooltip]=\"disabledTooltip ?? selectMultiple?.maxItemsTooltip()\"\n [apTooltipDisabled]=\"!disabled\"></div>\n<div class=\"option multiple with-caption\" [class.feature-locked-option]=\"isFeatureLocked()\">\n <ap-checkbox\n [checked]=\"selected\"\n [disabled]=\"disabled || isFeatureLocked()\"\n [name]=\"'option-selection-' + htmlId\">\n @if (avatarUrl !== undefined) {\n <ap-avatar\n [rounded]=\"roundedAvatar()\"\n [size]=\"24\"\n [profilePicture]=\"avatarUrl\"\n [username]=\"text\"\n [showInitials]=\"true\"\n [network]=\"network()\" />\n }\n @if (symbolId) {\n <ap-symbol\n size=\"sm\"\n [symbolId]=\"symbolId\"\n [color]=\"symbolColor() ?? ''\"\n [apTooltip]=\"symbolTooltipText() ? symbolTooltipText() : undefined\" />\n }\n <div class=\"texts\" [class.feature-locked-label]=\"isFeatureLocked()\">\n <div class=\"first-line\">\n <span\n class=\"label\"\n\n [title]=\"text\">\n {{ text }}\n </span>\n @if (badgeText) {\n <ap-badge color=\"blue\">\n {{ badgeText }}\n </ap-badge>\n }\n </div>\n <span\n class=\"caption\"\n [title]=\"caption\">\n {{ caption }}\n </span>\n </div>\n\n @if (isFeatureLocked()) {\n <ap-symbol\n symbolId=\"feature-lock\"\n color=\"purple\"\n size=\"sm\"/>\n }\n\n @if (onlyEnabled && !disabled) {\n <button\n class=\"standalone-link\"\n type=\"button\"\n (click)=\"$event.preventDefault(); $event.stopPropagation(); onSelectOnly()\">\n {{ onlyText }}\n </button>\n }\n </ap-checkbox>\n</div>\n@if (dividerEnabled) {\n <div class=\"divider\"></div>\n}\n", styles: ["ap-dropdown-item-multiple-two-lines .option{display:flex;gap:var(--ref-spacing-xxs)}ap-dropdown-item-multiple-two-lines .option ap-checkbox label{display:flex;gap:var(--ref-spacing-xxs);align-items:center}ap-dropdown-item-multiple-two-lines .option .texts{flex:1;overflow:auto;display:flex;flex-direction:column}ap-dropdown-item-multiple-two-lines .option .texts .first-line{display:flex;align-items:center;gap:var(--ref-spacing-xxs)}ap-dropdown-item-multiple-two-lines .option .texts .first-line .label{display:inline-block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"] }]
|
|
185
375
|
}], ctorParameters: () => [], propDecorators: { text: [{
|
|
186
376
|
type: Input,
|
|
187
377
|
args: [{ required: true }]
|
|
@@ -435,86 +625,54 @@ class SelectLabelMultipleComponent {
|
|
|
435
625
|
roundedAvatar = input(true, ...(ngDevMode ? [{ debugName: "roundedAvatar" }] : []));
|
|
436
626
|
bindNetwork = input('', ...(ngDevMode ? [{ debugName: "bindNetwork" }] : []));
|
|
437
627
|
removeItem = output();
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
const lowercaseCharCount = label.length - uppercaseCharCount;
|
|
446
|
-
// Approximate upper and lower case characters width (14px font size)
|
|
447
|
-
const approximateUppercaseCharWidth = 14;
|
|
448
|
-
const approximateLowercaseCharWidth = 8;
|
|
449
|
-
// Calculate approximate character width
|
|
450
|
-
const approximateCharWidth = (uppercaseCharCount * approximateUppercaseCharWidth + lowercaseCharCount * approximateLowercaseCharWidth) / label.length;
|
|
451
|
-
// Maximum character length that can fit in the container (substract icons and padding)
|
|
452
|
-
const maxCharLength = (this.valueContainerWidth() - 24 - 8 - 20 - 8) / approximateCharWidth;
|
|
453
|
-
// Last index of the character that can fit in the container
|
|
454
|
-
const ellipsisLastIndex = Math.min(label.length, maxCharLength);
|
|
455
|
-
// Substract the ellipsis characters (...) length if the label is truncated
|
|
456
|
-
const lastIndex = ellipsisLastIndex + 1 < label.length ? ellipsisLastIndex - 2 : ellipsisLastIndex;
|
|
457
|
-
// Get the truncated label
|
|
458
|
-
const truncatedLabel = label.slice(0, lastIndex);
|
|
459
|
-
// Return the label with ellipsis if it's truncated
|
|
460
|
-
const ellipsisLabel = truncatedLabel.length < label.length ? truncatedLabel + '...' : truncatedLabel;
|
|
461
|
-
return {
|
|
462
|
-
label: ellipsisLabel,
|
|
463
|
-
avatarUrl: this.bindAvatarUrl() ? item[this.bindAvatarUrl()] : '',
|
|
464
|
-
symbolId: this.bindSymbolId() ? item[this.bindSymbolId()] : null,
|
|
465
|
-
value: item,
|
|
466
|
-
network: this.bindNetwork() ? item[this.bindNetwork()] : undefined,
|
|
467
|
-
};
|
|
468
|
-
}), ...(ngDevMode ? [{ debugName: "selectedLabels" }] : []));
|
|
469
|
-
valueContainerWidth = signal(0, ...(ngDevMode ? [{ debugName: "valueContainerWidth" }] : []));
|
|
628
|
+
selectedLabels = computed(() => this.selectedItems().map(item => ({
|
|
629
|
+
label: this.bindLabel() ? item[this.bindLabel()] : item,
|
|
630
|
+
avatarUrl: this.bindAvatarUrl() ? item[this.bindAvatarUrl()] : '',
|
|
631
|
+
symbolId: this.bindSymbolId() ? item[this.bindSymbolId()] : null,
|
|
632
|
+
value: item,
|
|
633
|
+
network: this.bindNetwork() ? item[this.bindNetwork()] : undefined,
|
|
634
|
+
})), ...(ngDevMode ? [{ debugName: "selectedLabels" }] : []));
|
|
470
635
|
hiddenCount = signal(0, ...(ngDevMode ? [{ debugName: "hiddenCount" }] : []));
|
|
471
636
|
trackByItem = (_, item) => (this.bindValue() ? item.value[this.bindValue()] : item.value);
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
const selectValueContainerWidth = this.valueContainerWidth() - 30;
|
|
479
|
-
const timeout = setTimeout(() => {
|
|
480
|
-
this.calculateResponsiveLabels(selectValueContainerWidth, selectedValues);
|
|
481
|
-
}, 100);
|
|
482
|
-
return () => {
|
|
483
|
-
clearTimeout(timeout);
|
|
484
|
-
};
|
|
485
|
-
});
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
calculateResponsiveLabels(containerWidth, selectedValues) {
|
|
489
|
-
if (containerWidth === 0 || !selectedValues.length) {
|
|
637
|
+
mainContainer = viewChild.required('mainContainer', { read: ElementRef });
|
|
638
|
+
itemsElement = viewChildren('itemElement', ...(ngDevMode ? [{ debugName: "itemsElement", read: ElementRef }] : [{ read: ElementRef }]));
|
|
639
|
+
responsiveLayout = afterRenderEffect(() => {
|
|
640
|
+
const itemRefs = this.itemsElement();
|
|
641
|
+
if (!itemRefs.length) {
|
|
642
|
+
this.hiddenCount.set(0);
|
|
490
643
|
return;
|
|
491
644
|
}
|
|
645
|
+
const containerEl = this.mainContainer().nativeElement;
|
|
646
|
+
const containerWidth = (containerEl.parentElement?.clientWidth ?? 0) - 30;
|
|
647
|
+
if (containerWidth <= 0)
|
|
648
|
+
return;
|
|
649
|
+
// Reset maxWidth so items aren't constrained by a previous pass
|
|
650
|
+
containerEl.style.maxWidth = '';
|
|
492
651
|
let totalWidth = 0;
|
|
493
652
|
let hiddenCount = 0;
|
|
494
653
|
const itemGap = 4;
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
const
|
|
498
|
-
const itemWidth = item.clientWidth + itemGap;
|
|
654
|
+
for (const ref of itemRefs) {
|
|
655
|
+
const el = ref.nativeElement;
|
|
656
|
+
const itemWidth = el.getBoundingClientRect().width + itemGap;
|
|
499
657
|
if (totalWidth + itemWidth < containerWidth && !hiddenCount) {
|
|
500
658
|
totalWidth += itemWidth;
|
|
501
|
-
|
|
659
|
+
el.style.visibility = 'visible';
|
|
502
660
|
}
|
|
503
661
|
else {
|
|
504
|
-
|
|
662
|
+
el.style.visibility = 'hidden';
|
|
505
663
|
hiddenCount++;
|
|
506
664
|
}
|
|
507
665
|
}
|
|
508
|
-
|
|
666
|
+
containerEl.style.maxWidth = `${totalWidth}px`;
|
|
509
667
|
this.hiddenCount.set(hiddenCount);
|
|
510
|
-
}
|
|
668
|
+
});
|
|
511
669
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SelectLabelMultipleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
512
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: SelectLabelMultipleComponent, isStandalone: true, selector: "ap-select-label-multiple", inputs: { displayType: { classPropertyName: "displayType", publicName: "displayType", isSignal: true, isRequired: false, transformFunction: null }, tagColor: { classPropertyName: "tagColor", publicName: "tagColor", isSignal: true, isRequired: false, transformFunction: null }, selectedItems: { classPropertyName: "selectedItems", publicName: "selectedItems", isSignal: true, isRequired: true, transformFunction: null }, bindLabel: { classPropertyName: "bindLabel", publicName: "bindLabel", isSignal: true, isRequired: false, transformFunction: null }, bindValue: { classPropertyName: "bindValue", publicName: "bindValue", isSignal: true, isRequired: false, transformFunction: null }, bindAvatarUrl: { classPropertyName: "bindAvatarUrl", publicName: "bindAvatarUrl", isSignal: true, isRequired: false, transformFunction: null }, bindSymbolId: { classPropertyName: "bindSymbolId", publicName: "bindSymbolId", isSignal: true, isRequired: false, transformFunction: null }, roundedAvatar: { classPropertyName: "roundedAvatar", publicName: "roundedAvatar", isSignal: true, isRequired: false, transformFunction: null }, bindNetwork: { classPropertyName: "bindNetwork", publicName: "bindNetwork", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { removeItem: "removeItem" }, ngImport: i0, template: "<div class=\"multiple-item\">\n @for (item of selectedLabels(); track trackByItem($index, item)) {\n @if (displayType() === 'label') {\n <ap-label\n class=\"item\"\n color=\"blue\"\n [removable]=\"!item.value.disabled\"\n [content]=\"item.label\"\n (remove)=\"removeItem.emit(item.value)\" />\n }\n\n @if (displayType() === 'tag') {\n <ap-tag\n class=\"item text-item\"\n [clearable]=\"!item.value.disabled\"\n [color]=\"tagColor()\"\n (clear)=\"removeItem.emit(item.value)\">\n @if (item.avatarUrl) {\n <ap-avatar\n [size]=\"16\"\n [rounded]=\"roundedAvatar()\"\n [profilePicture]=\"item.avatarUrl\"\n [username]=\"item.label\"\n [showInitials]=\"true\"\n [network]=\"item.network\"/>\n } @else if (item.symbolId) {\n <ap-symbol\n size=\"sm\"\n [attr.symbol-id]=\"item.symbolId\"\n [symbolId]=\"item.symbolId\" />\n }\n {{ item.label }}\n </ap-tag>\n }\n }\n</div>\n\n@if (hiddenCount() > 0) {\n <div class=\"remaining\">\n @if (displayType() === 'tag') {\n <ap-tag\n class=\"text-item\"\n clearable=\"false\"\n [color]=\"tagColor()\">\n +{{ hiddenCount() }}\n </ap-tag>\n }\n @if (displayType() === 'label') {\n <ap-label\n color=\"blue\"\n removable=\"false\"\n [content]=\"'+' + hiddenCount()\" />\n }\n </div>\n}\n", styles: ["ap-select-label-multiple{display:flex}\n"], dependencies: [{ kind: "component", type: LabelComponent, selector: "ap-label", inputs: ["content", "selectorWidth", "removable"], outputs: ["remove"] }, { kind: "component", type: TagComponent, selector: "ap-tag", inputs: ["clearable", "add", "color", "mini"], outputs: ["clear", "added"] }, { kind: "component", type: AvatarComponent, selector: "ap-avatar", inputs: ["profilePicture", "alt", "network", "size", "username", "showInitials", "bigNetwork", "anonymous", "online", "youtubeAvatarMode", "rounded"] }, { kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
670
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: SelectLabelMultipleComponent, isStandalone: true, selector: "ap-select-label-multiple", inputs: { displayType: { classPropertyName: "displayType", publicName: "displayType", isSignal: true, isRequired: false, transformFunction: null }, tagColor: { classPropertyName: "tagColor", publicName: "tagColor", isSignal: true, isRequired: false, transformFunction: null }, selectedItems: { classPropertyName: "selectedItems", publicName: "selectedItems", isSignal: true, isRequired: true, transformFunction: null }, bindLabel: { classPropertyName: "bindLabel", publicName: "bindLabel", isSignal: true, isRequired: false, transformFunction: null }, bindValue: { classPropertyName: "bindValue", publicName: "bindValue", isSignal: true, isRequired: false, transformFunction: null }, bindAvatarUrl: { classPropertyName: "bindAvatarUrl", publicName: "bindAvatarUrl", isSignal: true, isRequired: false, transformFunction: null }, bindSymbolId: { classPropertyName: "bindSymbolId", publicName: "bindSymbolId", isSignal: true, isRequired: false, transformFunction: null }, roundedAvatar: { classPropertyName: "roundedAvatar", publicName: "roundedAvatar", isSignal: true, isRequired: false, transformFunction: null }, bindNetwork: { classPropertyName: "bindNetwork", publicName: "bindNetwork", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { removeItem: "removeItem" }, viewQueries: [{ propertyName: "mainContainer", first: true, predicate: ["mainContainer"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "itemsElement", predicate: ["itemElement"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<div #mainContainer class=\"multiple-item\">\n @for (item of selectedLabels(); track trackByItem($index, item)) {\n @if (displayType() === 'label') {\n <ap-label\n #itemElement\n class=\"item\"\n color=\"blue\"\n [removable]=\"!item.value.disabled\"\n [content]=\"item.label\"\n (remove)=\"removeItem.emit(item.value)\" />\n }\n\n @if (displayType() === 'tag') {\n <ap-tag\n #itemElement\n class=\"item text-item\"\n [clearable]=\"!item.value.disabled\"\n [color]=\"tagColor()\"\n (clear)=\"removeItem.emit(item.value)\">\n @if (item.avatarUrl) {\n <ap-avatar\n [size]=\"16\"\n [rounded]=\"roundedAvatar()\"\n [profilePicture]=\"item.avatarUrl\"\n [username]=\"item.label\"\n [showInitials]=\"true\"\n [network]=\"item.network\"/>\n } @else if (item.symbolId) {\n <ap-symbol\n size=\"sm\"\n [attr.symbol-id]=\"item.symbolId\"\n [symbolId]=\"item.symbolId\" />\n }\n {{ item.label }}\n </ap-tag>\n }\n }\n</div>\n\n@if (hiddenCount() > 0) {\n <div class=\"remaining\">\n @if (displayType() === 'tag') {\n <ap-tag\n class=\"text-item\"\n clearable=\"false\"\n [color]=\"tagColor()\">\n +{{ hiddenCount() }}\n </ap-tag>\n }\n @if (displayType() === 'label') {\n <ap-label\n color=\"blue\"\n removable=\"false\"\n [content]=\"'+' + hiddenCount()\" />\n }\n </div>\n}\n", styles: ["ap-select-label-multiple{display:flex;width:100%}\n"], dependencies: [{ kind: "component", type: LabelComponent, selector: "ap-label", inputs: ["content", "selectorWidth", "removable"], outputs: ["remove"] }, { kind: "component", type: TagComponent, selector: "ap-tag", inputs: ["clearable", "add", "color", "mini"], outputs: ["clear", "added"] }, { kind: "component", type: AvatarComponent, selector: "ap-avatar", inputs: ["profilePicture", "alt", "network", "size", "username", "showInitials", "bigNetwork", "anonymous", "online", "youtubeAvatarMode", "rounded"] }, { kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
513
671
|
}
|
|
514
672
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SelectLabelMultipleComponent, decorators: [{
|
|
515
673
|
type: Component,
|
|
516
|
-
args: [{ selector: 'ap-select-label-multiple', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [LabelComponent, TagComponent, AvatarComponent, SymbolComponent], template: "<div class=\"multiple-item\">\n @for (item of selectedLabels(); track trackByItem($index, item)) {\n @if (displayType() === 'label') {\n <ap-label\n class=\"item\"\n color=\"blue\"\n [removable]=\"!item.value.disabled\"\n [content]=\"item.label\"\n (remove)=\"removeItem.emit(item.value)\" />\n }\n\n @if (displayType() === 'tag') {\n <ap-tag\n class=\"item text-item\"\n [clearable]=\"!item.value.disabled\"\n [color]=\"tagColor()\"\n (clear)=\"removeItem.emit(item.value)\">\n @if (item.avatarUrl) {\n <ap-avatar\n [size]=\"16\"\n [rounded]=\"roundedAvatar()\"\n [profilePicture]=\"item.avatarUrl\"\n [username]=\"item.label\"\n [showInitials]=\"true\"\n [network]=\"item.network\"/>\n } @else if (item.symbolId) {\n <ap-symbol\n size=\"sm\"\n [attr.symbol-id]=\"item.symbolId\"\n [symbolId]=\"item.symbolId\" />\n }\n {{ item.label }}\n </ap-tag>\n }\n }\n</div>\n\n@if (hiddenCount() > 0) {\n <div class=\"remaining\">\n @if (displayType() === 'tag') {\n <ap-tag\n class=\"text-item\"\n clearable=\"false\"\n [color]=\"tagColor()\">\n +{{ hiddenCount() }}\n </ap-tag>\n }\n @if (displayType() === 'label') {\n <ap-label\n color=\"blue\"\n removable=\"false\"\n [content]=\"'+' + hiddenCount()\" />\n }\n </div>\n}\n", styles: ["ap-select-label-multiple{display:flex}\n"] }]
|
|
517
|
-
}], propDecorators: { displayType: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayType", required: false }] }], tagColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tagColor", required: false }] }], selectedItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItems", required: true }] }], bindLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindLabel", required: false }] }], bindValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindValue", required: false }] }], bindAvatarUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindAvatarUrl", required: false }] }], bindSymbolId: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindSymbolId", required: false }] }], roundedAvatar: [{ type: i0.Input, args: [{ isSignal: true, alias: "roundedAvatar", required: false }] }], bindNetwork: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindNetwork", required: false }] }], removeItem: [{ type: i0.Output, args: ["removeItem"] }] } });
|
|
674
|
+
args: [{ selector: 'ap-select-label-multiple', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [LabelComponent, TagComponent, AvatarComponent, SymbolComponent], template: "<div #mainContainer class=\"multiple-item\">\n @for (item of selectedLabels(); track trackByItem($index, item)) {\n @if (displayType() === 'label') {\n <ap-label\n #itemElement\n class=\"item\"\n color=\"blue\"\n [removable]=\"!item.value.disabled\"\n [content]=\"item.label\"\n (remove)=\"removeItem.emit(item.value)\" />\n }\n\n @if (displayType() === 'tag') {\n <ap-tag\n #itemElement\n class=\"item text-item\"\n [clearable]=\"!item.value.disabled\"\n [color]=\"tagColor()\"\n (clear)=\"removeItem.emit(item.value)\">\n @if (item.avatarUrl) {\n <ap-avatar\n [size]=\"16\"\n [rounded]=\"roundedAvatar()\"\n [profilePicture]=\"item.avatarUrl\"\n [username]=\"item.label\"\n [showInitials]=\"true\"\n [network]=\"item.network\"/>\n } @else if (item.symbolId) {\n <ap-symbol\n size=\"sm\"\n [attr.symbol-id]=\"item.symbolId\"\n [symbolId]=\"item.symbolId\" />\n }\n {{ item.label }}\n </ap-tag>\n }\n }\n</div>\n\n@if (hiddenCount() > 0) {\n <div class=\"remaining\">\n @if (displayType() === 'tag') {\n <ap-tag\n class=\"text-item\"\n clearable=\"false\"\n [color]=\"tagColor()\">\n +{{ hiddenCount() }}\n </ap-tag>\n }\n @if (displayType() === 'label') {\n <ap-label\n color=\"blue\"\n removable=\"false\"\n [content]=\"'+' + hiddenCount()\" />\n }\n </div>\n}\n", styles: ["ap-select-label-multiple{display:flex;width:100%}\n"] }]
|
|
675
|
+
}], propDecorators: { displayType: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayType", required: false }] }], tagColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tagColor", required: false }] }], selectedItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItems", required: true }] }], bindLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindLabel", required: false }] }], bindValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindValue", required: false }] }], bindAvatarUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindAvatarUrl", required: false }] }], bindSymbolId: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindSymbolId", required: false }] }], roundedAvatar: [{ type: i0.Input, args: [{ isSignal: true, alias: "roundedAvatar", required: false }] }], bindNetwork: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindNetwork", required: false }] }], removeItem: [{ type: i0.Output, args: ["removeItem"] }], mainContainer: [{ type: i0.ViewChild, args: ['mainContainer', { ...{ read: ElementRef }, isSignal: true }] }], itemsElement: [{ type: i0.ViewChildren, args: ['itemElement', { ...{ read: ElementRef }, isSignal: true }] }] } });
|
|
518
676
|
|
|
519
677
|
class SelectLabelSingleComponent {
|
|
520
678
|
displayType = input('text', ...(ngDevMode ? [{ debugName: "displayType" }] : []));
|
|
@@ -524,152 +682,13 @@ class SelectLabelSingleComponent {
|
|
|
524
682
|
showAvatarInitials = input(true, ...(ngDevMode ? [{ debugName: "showAvatarInitials" }] : []));
|
|
525
683
|
roundedAvatar = input(true, ...(ngDevMode ? [{ debugName: "roundedAvatar" }] : []));
|
|
526
684
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SelectLabelSingleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
527
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: SelectLabelSingleComponent, isStandalone: true, selector: "ap-select-label-single", inputs: { displayType: { classPropertyName: "displayType", publicName: "displayType", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, avatarUrl: { classPropertyName: "avatarUrl", publicName: "avatarUrl", isSignal: true, isRequired: false, transformFunction: null }, network: { classPropertyName: "network", publicName: "network", isSignal: true, isRequired: false, transformFunction: null }, showAvatarInitials: { classPropertyName: "showAvatarInitials", publicName: "showAvatarInitials", isSignal: true, isRequired: false, transformFunction: null }, roundedAvatar: { classPropertyName: "roundedAvatar", publicName: "roundedAvatar", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@switch (displayType()) {\n @case ('text') {\n <span\n class=\"text-item\"\n [title]=\"label()\">\n {{ label() }}\n </span>\n }\n @case ('label') {\n <ap-label\n color=\"blue\"\n [removable]=\"false\"\n [content]=\"label()\" />\n }\n @case ('tag') {\n <ap-tag\n class=\"text-item\"\n color=\"grey\">\n @if (avatarUrl !== undefined) {\n <ap-avatar\n [rounded]=\"roundedAvatar()\"\n [size]=\"16\"\n [username]=\"label()\"\n [showInitials]=\"true\"\n [profilePicture]=\"avatarUrl()\" />\n }\n {{ label() }}\n </ap-tag>\n }\n @case ('withAvatar') {\n <ap-avatar\n
|
|
685
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: SelectLabelSingleComponent, isStandalone: true, selector: "ap-select-label-single", inputs: { displayType: { classPropertyName: "displayType", publicName: "displayType", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, avatarUrl: { classPropertyName: "avatarUrl", publicName: "avatarUrl", isSignal: true, isRequired: false, transformFunction: null }, network: { classPropertyName: "network", publicName: "network", isSignal: true, isRequired: false, transformFunction: null }, showAvatarInitials: { classPropertyName: "showAvatarInitials", publicName: "showAvatarInitials", isSignal: true, isRequired: false, transformFunction: null }, roundedAvatar: { classPropertyName: "roundedAvatar", publicName: "roundedAvatar", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@switch (displayType()) {\n @case ('text') {\n <span\n class=\"text-item\"\n [title]=\"label()\">\n {{ label() }}\n </span>\n }\n @case ('label') {\n <ap-label\n color=\"blue\"\n [removable]=\"false\"\n [content]=\"label()\" />\n }\n @case ('tag') {\n <ap-tag\n class=\"text-item\"\n color=\"grey\">\n @if (avatarUrl !== undefined) {\n <ap-avatar\n [rounded]=\"roundedAvatar()\"\n [size]=\"16\"\n [username]=\"label()\"\n [showInitials]=\"true\"\n [profilePicture]=\"avatarUrl()\" />\n }\n {{ label() }}\n </ap-tag>\n }\n @case ('withAvatar') {\n @if (avatarUrl()) {\n <ap-avatar\n [rounded]=\"roundedAvatar()\"\n [size]=\"24\"\n [username]=\"label()\"\n [showInitials]=\"showAvatarInitials()\"\n [profilePicture]=\"avatarUrl()\"\n [network]=\"network()\" />\n }\n <span class=\"text-item\">\n {{ label() }}\n </span>\n }\n}\n", styles: ["ap-select-label-single{display:flex;gap:var(--ref-spacing-xxs);width:100%;align-items:center}\n"], dependencies: [{ kind: "component", type: LabelComponent, selector: "ap-label", inputs: ["content", "selectorWidth", "removable"], outputs: ["remove"] }, { kind: "component", type: TagComponent, selector: "ap-tag", inputs: ["clearable", "add", "color", "mini"], outputs: ["clear", "added"] }, { kind: "component", type: AvatarComponent, selector: "ap-avatar", inputs: ["profilePicture", "alt", "network", "size", "username", "showInitials", "bigNetwork", "anonymous", "online", "youtubeAvatarMode", "rounded"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
528
686
|
}
|
|
529
687
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SelectLabelSingleComponent, decorators: [{
|
|
530
688
|
type: Component,
|
|
531
|
-
args: [{ selector: 'ap-select-label-single', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [LabelComponent, TagComponent, AvatarComponent], template: "@switch (displayType()) {\n @case ('text') {\n <span\n class=\"text-item\"\n [title]=\"label()\">\n {{ label() }}\n </span>\n }\n @case ('label') {\n <ap-label\n color=\"blue\"\n [removable]=\"false\"\n [content]=\"label()\" />\n }\n @case ('tag') {\n <ap-tag\n class=\"text-item\"\n color=\"grey\">\n @if (avatarUrl !== undefined) {\n <ap-avatar\n [rounded]=\"roundedAvatar()\"\n [size]=\"16\"\n [username]=\"label()\"\n [showInitials]=\"true\"\n [profilePicture]=\"avatarUrl()\" />\n }\n {{ label() }}\n </ap-tag>\n }\n @case ('withAvatar') {\n <ap-avatar\n
|
|
689
|
+
args: [{ selector: 'ap-select-label-single', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [LabelComponent, TagComponent, AvatarComponent], template: "@switch (displayType()) {\n @case ('text') {\n <span\n class=\"text-item\"\n [title]=\"label()\">\n {{ label() }}\n </span>\n }\n @case ('label') {\n <ap-label\n color=\"blue\"\n [removable]=\"false\"\n [content]=\"label()\" />\n }\n @case ('tag') {\n <ap-tag\n class=\"text-item\"\n color=\"grey\">\n @if (avatarUrl !== undefined) {\n <ap-avatar\n [rounded]=\"roundedAvatar()\"\n [size]=\"16\"\n [username]=\"label()\"\n [showInitials]=\"true\"\n [profilePicture]=\"avatarUrl()\" />\n }\n {{ label() }}\n </ap-tag>\n }\n @case ('withAvatar') {\n @if (avatarUrl()) {\n <ap-avatar\n [rounded]=\"roundedAvatar()\"\n [size]=\"24\"\n [username]=\"label()\"\n [showInitials]=\"showAvatarInitials()\"\n [profilePicture]=\"avatarUrl()\"\n [network]=\"network()\" />\n }\n <span class=\"text-item\">\n {{ label() }}\n </span>\n }\n}\n", styles: ["ap-select-label-single{display:flex;gap:var(--ref-spacing-xxs);width:100%;align-items:center}\n"] }]
|
|
532
690
|
}], propDecorators: { displayType: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayType", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], avatarUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatarUrl", required: false }] }], network: [{ type: i0.Input, args: [{ isSignal: true, alias: "network", required: false }] }], showAvatarInitials: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAvatarInitials", required: false }] }], roundedAvatar: [{ type: i0.Input, args: [{ isSignal: true, alias: "roundedAvatar", required: false }] }] } });
|
|
533
691
|
|
|
534
|
-
class SelectBaseDirective {
|
|
535
|
-
inlineLabel = input(...(ngDevMode ? [undefined, { debugName: "inlineLabel" }] : []));
|
|
536
|
-
symbolId = input(...(ngDevMode ? [undefined, { debugName: "symbolId" }] : []));
|
|
537
|
-
selectComponent = inject(NgSelectComponent);
|
|
538
|
-
el = inject(ElementRef);
|
|
539
|
-
renderer = inject(Renderer2);
|
|
540
|
-
viewContainerRef = inject(ViewContainerRef);
|
|
541
|
-
symbolRegistry = inject(SymbolRegistry);
|
|
542
|
-
symbolComponentRef;
|
|
543
|
-
labelElement;
|
|
544
|
-
constructor() {
|
|
545
|
-
this.selectComponent.appendTo = 'body';
|
|
546
|
-
this.selectComponent.searchable = false;
|
|
547
|
-
this.selectComponent.clearable = false;
|
|
548
|
-
this.selectComponent.markFirst = false;
|
|
549
|
-
this.selectComponent.selectableGroupAsModel = false;
|
|
550
|
-
this.selectComponent.tabIndex = 0;
|
|
551
|
-
this.symbolRegistry.registerSymbols([apCheck, apPlus]);
|
|
552
|
-
this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));
|
|
553
|
-
// Handle symbolId changes
|
|
554
|
-
effect(() => {
|
|
555
|
-
const symbolId = this.symbolId();
|
|
556
|
-
this.removeInlineSymbol();
|
|
557
|
-
if (symbolId) {
|
|
558
|
-
this.addInlineSymbol(symbolId);
|
|
559
|
-
}
|
|
560
|
-
});
|
|
561
|
-
// Handle inlineLabel changes
|
|
562
|
-
effect(() => {
|
|
563
|
-
const inlineLabel = this.inlineLabel();
|
|
564
|
-
this.removeInlineLabel();
|
|
565
|
-
if (inlineLabel) {
|
|
566
|
-
this.addInlineLabel(inlineLabel);
|
|
567
|
-
}
|
|
568
|
-
});
|
|
569
|
-
}
|
|
570
|
-
ngAfterViewInit() {
|
|
571
|
-
if (!this.selectComponent.optionTemplate) {
|
|
572
|
-
throw new Error('optionTemplate is required for apSelect');
|
|
573
|
-
}
|
|
574
|
-
if (this.selectComponent.groupBy && !this.selectComponent.optgroupTemplate) {
|
|
575
|
-
throw new Error('optgroupTemplate is required for apSelect');
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
addInlineSymbol(symbolId) {
|
|
579
|
-
this.symbolComponentRef = this.viewContainerRef.createComponent(SymbolComponent);
|
|
580
|
-
this.symbolComponentRef.setInput('symbolId', symbolId);
|
|
581
|
-
this.symbolComponentRef.location.nativeElement.classList.add('inline-symbol');
|
|
582
|
-
this.renderer.insertBefore(this.el.nativeElement.getElementsByClassName('ng-select-container').item(0), this.symbolComponentRef.location.nativeElement, this.el.nativeElement.getElementsByClassName('ng-value-container').item(0));
|
|
583
|
-
}
|
|
584
|
-
removeInlineSymbol() {
|
|
585
|
-
if (this.symbolComponentRef) {
|
|
586
|
-
this.symbolComponentRef.destroy();
|
|
587
|
-
this.symbolComponentRef = undefined;
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
addInlineLabel(label) {
|
|
591
|
-
this.labelElement = this.renderer.createElement('label');
|
|
592
|
-
this.renderer.setProperty(this.labelElement, 'textContent', label);
|
|
593
|
-
this.renderer.addClass(this.labelElement, 'inline-label');
|
|
594
|
-
this.renderer.insertBefore(this.el.nativeElement.getElementsByClassName('ng-select-container').item(0), this.labelElement, this.el.nativeElement.getElementsByClassName('ng-value-container').item(0));
|
|
595
|
-
}
|
|
596
|
-
removeInlineLabel() {
|
|
597
|
-
if (this.labelElement) {
|
|
598
|
-
this.renderer.removeChild(this.el.nativeElement.getElementsByClassName('ng-select-container').item(0), this.labelElement);
|
|
599
|
-
this.labelElement = undefined;
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SelectBaseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
603
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.18", type: SelectBaseDirective, isStandalone: true, selector: "ng-select[apSelect]", inputs: { inlineLabel: { classPropertyName: "inlineLabel", publicName: "inlineLabel", isSignal: true, isRequired: false, transformFunction: null }, symbolId: { classPropertyName: "symbolId", publicName: "symbolId", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "ap-select" }, ngImport: i0 });
|
|
604
|
-
}
|
|
605
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SelectBaseDirective, decorators: [{
|
|
606
|
-
type: Directive,
|
|
607
|
-
args: [{
|
|
608
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
609
|
-
selector: 'ng-select[apSelect]',
|
|
610
|
-
standalone: true,
|
|
611
|
-
host: {
|
|
612
|
-
class: 'ap-select',
|
|
613
|
-
},
|
|
614
|
-
}]
|
|
615
|
-
}], ctorParameters: () => [], propDecorators: { inlineLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "inlineLabel", required: false }] }], symbolId: [{ type: i0.Input, args: [{ isSignal: true, alias: "symbolId", required: false }] }] } });
|
|
616
|
-
|
|
617
|
-
class SelectMultipleDirective {
|
|
618
|
-
selectComponent = inject(NgSelectComponent);
|
|
619
|
-
elementRef = inject(ElementRef);
|
|
620
|
-
valueContainer = null;
|
|
621
|
-
constructor() {
|
|
622
|
-
this.selectComponent.multiple = true;
|
|
623
|
-
this.selectComponent.closeOnSelect = false;
|
|
624
|
-
this.selectComponent.searchable = true; // small hack to not closed the dropdown panel when clear an item in value container
|
|
625
|
-
}
|
|
626
|
-
ngAfterViewInit() {
|
|
627
|
-
if (!this.selectComponent.multiLabelTemplate) {
|
|
628
|
-
throw new Error('multiLabelTemplate is required for apSelectMultiple');
|
|
629
|
-
}
|
|
630
|
-
// Add click handler to toggle dropdown when clicking on the select container
|
|
631
|
-
this.valueContainer = this.elementRef.nativeElement.querySelector('.ng-select-container');
|
|
632
|
-
if (this.valueContainer) {
|
|
633
|
-
this.valueContainer.addEventListener('mousedown', this.onMousedown, true);
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
ngOnDestroy() {
|
|
637
|
-
if (this.valueContainer) {
|
|
638
|
-
this.valueContainer.removeEventListener('mousedown', this.onMousedown);
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
onMousedown = (event) => {
|
|
642
|
-
// Only toggle if clicking on the container itself, not on the items inside
|
|
643
|
-
const target = event.target;
|
|
644
|
-
if (!target.closest('ap-select-label-multiple') && !target.closest('.ng-clear-wrapper')) {
|
|
645
|
-
event.preventDefault();
|
|
646
|
-
event.stopPropagation();
|
|
647
|
-
if (this.selectComponent.isOpen) {
|
|
648
|
-
this.selectComponent.close();
|
|
649
|
-
}
|
|
650
|
-
else {
|
|
651
|
-
this.selectComponent.open();
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
};
|
|
655
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SelectMultipleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
656
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: SelectMultipleDirective, isStandalone: true, selector: "ng-select[apSelectMultiple]", hostDirectives: [{ directive: SelectBaseDirective, inputs: ["inlineLabel", "inlineLabel", "symbolId", "symbolId"] }], ngImport: i0 });
|
|
657
|
-
}
|
|
658
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: SelectMultipleDirective, decorators: [{
|
|
659
|
-
type: Directive,
|
|
660
|
-
args: [{
|
|
661
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
662
|
-
selector: 'ng-select[apSelectMultiple]',
|
|
663
|
-
standalone: true,
|
|
664
|
-
hostDirectives: [
|
|
665
|
-
{
|
|
666
|
-
directive: SelectBaseDirective,
|
|
667
|
-
inputs: ['inlineLabel', 'symbolId'],
|
|
668
|
-
},
|
|
669
|
-
],
|
|
670
|
-
}]
|
|
671
|
-
}], ctorParameters: () => [] });
|
|
672
|
-
|
|
673
692
|
class SelectSingleDirective {
|
|
674
693
|
selectComponent = inject(NgSelectComponent);
|
|
675
694
|
constructor() {
|