@agorapulse/ui-components 20.4.10 → 20.4.12
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.12.tgz +0 -0
- package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs +219 -6
- 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 +198 -147
- package/fesm2022/agorapulse-ui-components-select.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components.mjs.map +1 -1
- package/filter-dropdown/index.d.ts +96 -29
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/select/index.d.ts +9 -1
- package/agorapulse-ui-components-20.4.10.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, EnvironmentInjector, computed, runInInjectionContext, 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, SymbolComponent, SymbolComponent], 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"] }]
|
|
299
|
+
args: [{ selector: 'ap-dropdown-item-multiple-one-line', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [SymbolComponent, CheckboxComponent, AvatarComponent, BadgeComponent, TooltipDirective, SymbolComponent, SymbolComponent], 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 }]
|
|
@@ -531,145 +721,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
531
721
|
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 [rounded]=\"roundedAvatar()\"\n [size]=\"24\"\n [username]=\"label()\"\n [showInitials]=\"showAvatarInitials()\"\n [profilePicture]=\"avatarUrl()\"\n [network]=\"network()\" />\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
722
|
}], 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
723
|
|
|
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
724
|
class SelectSingleDirective {
|
|
674
725
|
selectComponent = inject(NgSelectComponent);
|
|
675
726
|
constructor() {
|