@agorapulse/ui-components 22.2.12 → 22.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agorapulse-ui-components-22.4.0.tgz +0 -0
- package/fesm2022/agorapulse-ui-components-action-dropdown.mjs +5 -10
- package/fesm2022/agorapulse-ui-components-action-dropdown.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-avatar-group.mjs +20 -33
- package/fesm2022/agorapulse-ui-components-avatar-group.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-datepicker.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-datepicker.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-directives.mjs +79 -15
- package/fesm2022/agorapulse-ui-components-directives.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-floating.mjs +6 -1
- package/fesm2022/agorapulse-ui-components-floating.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-labels.mjs +3 -108
- package/fesm2022/agorapulse-ui-components-labels.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-nav-selector.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-nav-selector.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-overflow-base.mjs +193 -0
- package/fesm2022/agorapulse-ui-components-overflow-base.mjs.map +1 -0
- package/fesm2022/agorapulse-ui-components-overflow-list.mjs +89 -0
- package/fesm2022/agorapulse-ui-components-overflow-list.mjs.map +1 -0
- package/fesm2022/agorapulse-ui-components-select.mjs +14 -12
- package/fesm2022/agorapulse-ui-components-select.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-tooltip.mjs +9 -5
- package/fesm2022/agorapulse-ui-components-tooltip.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components.mjs +9 -7
- package/fesm2022/agorapulse-ui-components.mjs.map +1 -1
- package/package.json +9 -1
- package/types/agorapulse-ui-components-action-dropdown.d.ts +3 -6
- package/types/agorapulse-ui-components-avatar-group.d.ts +12 -5
- package/types/agorapulse-ui-components-directives.d.ts +19 -4
- package/types/agorapulse-ui-components-labels.d.ts +2 -35
- package/types/agorapulse-ui-components-overflow-base.d.ts +124 -0
- package/types/agorapulse-ui-components-overflow-list.d.ts +80 -0
- package/types/agorapulse-ui-components-select.d.ts +8 -11
- package/types/agorapulse-ui-components-tooltip.d.ts +3 -3
- package/types/agorapulse-ui-components.d.ts +12 -10
- package/agorapulse-ui-components-22.2.12.tgz +0 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { OverflowCountDirective, OverflowCounterDirective, OverflowItemDirective, StopPropagationDirective } from '@agorapulse/ui-components/directives';
|
|
2
|
+
import { CustomTooltipType, TooltipDirective } from '@agorapulse/ui-components/tooltip';
|
|
3
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { inject, TemplateRef, input, Directive, contentChild, signal, computed, viewChild, afterRenderEffect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
6
|
+
|
|
7
|
+
let nextId = 0;
|
|
8
|
+
/**
|
|
9
|
+
* Template of one item, rendered in the row and again in the tooltip that lists the hidden ones.
|
|
10
|
+
*
|
|
11
|
+
* Bind it to the same list as `ap-overflow-base` to type `let-item`; without the binding the item is `unknown`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```html
|
|
15
|
+
* <ng-template let-label [apOverflowBaseItem]="labels">
|
|
16
|
+
* <ap-label [content]="label" />
|
|
17
|
+
* </ng-template>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
class OverflowBaseItemDirective {
|
|
21
|
+
templateRef = inject(TemplateRef);
|
|
22
|
+
/** The list the template renders, read only to type the template context. */
|
|
23
|
+
apOverflowBaseItem = input(/* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [undefined, { debugName: "apOverflowBaseItem" }] : /* istanbul ignore next */ []));
|
|
25
|
+
static ngTemplateContextGuard(_directive, _context) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: OverflowBaseItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
29
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: OverflowBaseItemDirective, isStandalone: true, selector: "ng-template[apOverflowBaseItem]", inputs: { apOverflowBaseItem: { classPropertyName: "apOverflowBaseItem", publicName: "apOverflowBaseItem", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
30
|
+
}
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: OverflowBaseItemDirective, decorators: [{
|
|
32
|
+
type: Directive,
|
|
33
|
+
args: [{
|
|
34
|
+
selector: 'ng-template[apOverflowBaseItem]',
|
|
35
|
+
}]
|
|
36
|
+
}], propDecorators: { apOverflowBaseItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "apOverflowBaseItem", required: false }] }] } });
|
|
37
|
+
/**
|
|
38
|
+
* Replaces the default "+N" text, with a chip for instance. `let-count` is the number of hidden
|
|
39
|
+
* items; the button around it, its tooltip and its accessible name stay the list's.
|
|
40
|
+
*/
|
|
41
|
+
class OverflowBaseMoreDirective {
|
|
42
|
+
templateRef = inject(TemplateRef);
|
|
43
|
+
static ngTemplateContextGuard(_directive, _context) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: OverflowBaseMoreDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
47
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: OverflowBaseMoreDirective, isStandalone: true, selector: "ng-template[apOverflowBaseMore]", ngImport: i0 });
|
|
48
|
+
}
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: OverflowBaseMoreDirective, decorators: [{
|
|
50
|
+
type: Directive,
|
|
51
|
+
args: [{
|
|
52
|
+
selector: 'ng-template[apOverflowBaseMore]',
|
|
53
|
+
}]
|
|
54
|
+
}] });
|
|
55
|
+
/** Content of the button that folds an unfolded `expand` list back, "See less" for instance. Without it the list stays unfolded. */
|
|
56
|
+
class OverflowBaseLessDirective {
|
|
57
|
+
templateRef = inject(TemplateRef);
|
|
58
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: OverflowBaseLessDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
59
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: OverflowBaseLessDirective, isStandalone: true, selector: "ng-template[apOverflowBaseLess]", ngImport: i0 });
|
|
60
|
+
}
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: OverflowBaseLessDirective, decorators: [{
|
|
62
|
+
type: Directive,
|
|
63
|
+
args: [{
|
|
64
|
+
selector: 'ng-template[apOverflowBaseLess]',
|
|
65
|
+
}]
|
|
66
|
+
}] });
|
|
67
|
+
/**
|
|
68
|
+
* Shows as many items as fit on one line, then a "+N" button: its tooltip lists the hidden items,
|
|
69
|
+
* rendered with the item template itself, or it unfolds the list (see `mode`). Built on
|
|
70
|
+
* `apOverflowCount`: the widths are measured, never estimated.
|
|
71
|
+
*
|
|
72
|
+
* The building block of `ap-overflow-list` and `ap-avatar-group`: use them for labels, tags and avatars,
|
|
73
|
+
* and this only for a kind of item they do not render.
|
|
74
|
+
*
|
|
75
|
+
* The host takes the width its container gives it: `display: block`, or `flex: 1; min-width: 0` in a
|
|
76
|
+
* flex parent. The "+N" click never reaches the ancestors, so the list works inside a clickable row.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```html
|
|
80
|
+
* <ap-overflow-base [items]="labels">
|
|
81
|
+
* <ng-template let-label [apOverflowBaseItem]="labels">
|
|
82
|
+
* <ap-label [content]="label" />
|
|
83
|
+
* </ng-template>
|
|
84
|
+
* </ap-overflow-base>
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
class OverflowBaseComponent {
|
|
88
|
+
/** The items, in display order: the hidden ones are always the last. */
|
|
89
|
+
items = input.required(/* @ts-ignore */
|
|
90
|
+
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
91
|
+
/** What becomes of the items that do not fit on the line. */
|
|
92
|
+
mode = input('tooltip', /* @ts-ignore */
|
|
93
|
+
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
94
|
+
/** What opens the tooltip of the hidden items, in `tooltip` mode. */
|
|
95
|
+
trigger = input('hover', /* @ts-ignore */
|
|
96
|
+
...(ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []));
|
|
97
|
+
/** Most items shown whatever the width; `wrap` shows them all. */
|
|
98
|
+
max = input(undefined, /* @ts-ignore */
|
|
99
|
+
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
100
|
+
/** Space between two items, in pixels. Negative, the items overlap, like a stack of avatars. */
|
|
101
|
+
gap = input(4, /* @ts-ignore */
|
|
102
|
+
...(ngDevMode ? [{ debugName: "gap" }] : /* istanbul ignore next */ []));
|
|
103
|
+
/** Text of an item, for the accessible description of the "+N" button. */
|
|
104
|
+
itemText = input(item => String(item), /* @ts-ignore */
|
|
105
|
+
...(ngDevMode ? [{ debugName: "itemText" }] : /* istanbul ignore next */ []));
|
|
106
|
+
/** Maps an item to an entry of a `LIST` tooltip (avatar and name); without it the tooltip renders the item template. */
|
|
107
|
+
tooltipListItem = input(/* @ts-ignore */
|
|
108
|
+
...(ngDevMode ? [undefined, { debugName: "tooltipListItem" }] : /* istanbul ignore next */ []));
|
|
109
|
+
/** Identifies an item across changes of `items`, so that its element is kept; the item itself by default. */
|
|
110
|
+
trackBy = input(item => item, /* @ts-ignore */
|
|
111
|
+
...(ngDevMode ? [{ debugName: "trackBy" }] : /* istanbul ignore next */ []));
|
|
112
|
+
itemTemplate = contentChild.required(OverflowBaseItemDirective);
|
|
113
|
+
moreTemplate = contentChild(OverflowBaseMoreDirective, /* @ts-ignore */
|
|
114
|
+
...(ngDevMode ? [{ debugName: "moreTemplate" }] : /* istanbul ignore next */ []));
|
|
115
|
+
lessTemplate = contentChild(OverflowBaseLessDirective, /* @ts-ignore */
|
|
116
|
+
...(ngDevMode ? [{ debugName: "lessTemplate" }] : /* istanbul ignore next */ []));
|
|
117
|
+
expanded = signal(false, /* @ts-ignore */
|
|
118
|
+
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
119
|
+
collapsing = computed(() => this.mode() !== 'wrap' && !(this.mode() === 'expand' && this.expanded()), /* @ts-ignore */
|
|
120
|
+
...(ngDevMode ? [{ debugName: "collapsing" }] : /* istanbul ignore next */ []));
|
|
121
|
+
CustomTooltipType = CustomTooltipType;
|
|
122
|
+
namesId = `ap-overflow-base-names-${nextId++}`;
|
|
123
|
+
overflowCount = viewChild.required(OverflowCountDirective);
|
|
124
|
+
moreButton = viewChild('moreButton', /* @ts-ignore */
|
|
125
|
+
...(ngDevMode ? [{ debugName: "moreButton" }] : /* istanbul ignore next */ []));
|
|
126
|
+
lessButton = viewChild('lessButton', /* @ts-ignore */
|
|
127
|
+
...(ngDevMode ? [{ debugName: "lessButton" }] : /* istanbul ignore next */ []));
|
|
128
|
+
/** The button that replaces the one just clicked, focused once rendered so the focus does not fall back to the page. */
|
|
129
|
+
pendingFocus = signal(undefined, /* @ts-ignore */
|
|
130
|
+
...(ngDevMode ? [{ debugName: "pendingFocus" }] : /* istanbul ignore next */ []));
|
|
131
|
+
constructor() {
|
|
132
|
+
afterRenderEffect(() => {
|
|
133
|
+
if (this.expanded() && this.overflowCount().hiddenCount() === 0) {
|
|
134
|
+
this.expanded.set(false);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
afterRenderEffect(() => {
|
|
138
|
+
const pending = this.pendingFocus();
|
|
139
|
+
if (!pending) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const button = pending === 'more' ? this.moreButton() : this.lessButton();
|
|
143
|
+
const coming = pending === 'more' ? this.collapsing() && this.overflowCount().hiddenCount() > 0 : this.expanded();
|
|
144
|
+
if (button || !coming) {
|
|
145
|
+
button?.nativeElement.focus();
|
|
146
|
+
this.pendingFocus.set(undefined);
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
hiddenItems(hiddenCount) {
|
|
151
|
+
const items = this.items();
|
|
152
|
+
return items.slice(Math.max(0, items.length - hiddenCount));
|
|
153
|
+
}
|
|
154
|
+
hiddenNames(hidden) {
|
|
155
|
+
return hidden.map(item => this.itemText()(item)).join(', ');
|
|
156
|
+
}
|
|
157
|
+
listItems(hidden) {
|
|
158
|
+
const toListItem = this.tooltipListItem();
|
|
159
|
+
return toListItem ? hidden.map(item => toListItem(item)) : [];
|
|
160
|
+
}
|
|
161
|
+
onMore() {
|
|
162
|
+
if (this.mode() === 'expand') {
|
|
163
|
+
this.expanded.set(true);
|
|
164
|
+
this.pendingFocus.set(this.lessTemplate() ? 'less' : undefined);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
onLess() {
|
|
168
|
+
this.expanded.set(false);
|
|
169
|
+
this.pendingFocus.set('more');
|
|
170
|
+
}
|
|
171
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: OverflowBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
172
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: OverflowBaseComponent, isStandalone: true, selector: "ap-overflow-base", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, trigger: { classPropertyName: "trigger", publicName: "trigger", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, itemText: { classPropertyName: "itemText", publicName: "itemText", isSignal: true, isRequired: false, transformFunction: null }, tooltipListItem: { classPropertyName: "tooltipListItem", publicName: "tooltipListItem", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.--ap-overflow-base-gap": "gap() + 'px'" } }, queries: [{ propertyName: "itemTemplate", first: true, predicate: OverflowBaseItemDirective, descendants: true, isSignal: true }, { propertyName: "moreTemplate", first: true, predicate: OverflowBaseMoreDirective, descendants: true, isSignal: true }, { propertyName: "lessTemplate", first: true, predicate: OverflowBaseLessDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "overflowCount", first: true, predicate: OverflowCountDirective, descendants: true, isSignal: true }, { propertyName: "moreButton", first: true, predicate: ["moreButton"], descendants: true, isSignal: true }, { propertyName: "lessButton", first: true, predicate: ["lessButton"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n #overflow=\"apOverflowCount\"\n class=\"overflow-row\"\n apOverflowCount\n [class.overflow-row-wrap]=\"!collapsing()\"\n [collapse]=\"collapsing()\"\n [gap]=\"gap()\"\n [max]=\"max()\">\n @for (item of items(); track trackBy()(item); let index = $index, count = $count) {\n <div\n class=\"overflow-item\"\n apOverflowItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate().templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index, count }\" />\n </div>\n }\n @if (collapsing() && overflow.hiddenCount() > 0) {\n @let hidden = hiddenItems(overflow.hiddenCount());\n @if (mode() === 'count') {\n <span\n class=\"overflow-more\"\n apOverflowCounter>\n <ng-container\n [ngTemplateOutlet]=\"moreContent\"\n [ngTemplateOutletContext]=\"{ $implicit: hidden.length }\" />\n </span>\n } @else {\n <button\n #moreButton\n type=\"button\"\n class=\"overflow-more\"\n apOverflowCounter\n apStopPropagation\n [apTooltip]=\"tooltipListItem() ? '' : hiddenList\"\n [apTooltipDisabled]=\"mode() !== 'tooltip'\"\n [apTooltipType]=\"tooltipListItem() ? CustomTooltipType.LIST : CustomTooltipType.DEFAULT\"\n [apTooltipListItems]=\"listItems(hidden)\"\n [apTooltipTemplateContext]=\"{ $implicit: hidden }\"\n [apTooltipTrigger]=\"trigger()\"\n [attr.aria-expanded]=\"mode() === 'expand' ? false : null\"\n [attr.aria-describedby]=\"namesId\"\n (click)=\"onMore()\">\n <ng-container\n [ngTemplateOutlet]=\"moreContent\"\n [ngTemplateOutletContext]=\"{ $implicit: hidden.length }\" />\n </button>\n <span\n hidden\n [id]=\"namesId\">\n {{ hiddenNames(hidden) }}\n </span>\n }\n }\n @if (mode() === 'expand' && expanded() && lessTemplate(); as less) {\n <button\n #lessButton\n type=\"button\"\n class=\"overflow-less\"\n apStopPropagation\n aria-expanded=\"true\"\n (click)=\"onLess()\">\n <ng-container [ngTemplateOutlet]=\"less.templateRef\" />\n </button>\n }\n</div>\n\n<ng-template\n #moreContent\n let-count>\n @if (moreTemplate(); as more) {\n <ng-container\n [ngTemplateOutlet]=\"more.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: count }\" />\n } @else {\n +{{ count }}\n }\n</ng-template>\n\n<ng-template\n #hiddenList\n let-hidden>\n <div class=\"overflow-hidden-items\">\n @for (item of hidden; track trackBy()(item); let index = $index, count = $count) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate().templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index, count }\" />\n }\n </div>\n</ng-template>\n", styles: [":host{display:block;min-width:0}.overflow-row{display:flex;align-items:center;gap:max(var(--ap-overflow-base-gap),0px);min-width:0}.overflow-row.overflow-row-wrap{flex-wrap:wrap}.overflow-item{display:flex;flex-shrink:0;min-width:0}.overflow-row-wrap>.overflow-item{flex-shrink:1;max-width:100%}.overflow-item+.overflow-item,.overflow-more{margin-inline-start:min(var(--ap-overflow-base-gap),0px)}.overflow-more,.overflow-less{display:flex;flex-shrink:0}button.overflow-more,.overflow-less{padding:0;border:none;border-radius:var(--comp-label-border-radius);background:none;color:var(--sys-text-color-default);font:inherit;cursor:pointer}button.overflow-more:focus-visible,.overflow-less:focus-visible{outline:2px solid var(--ref-color-electric-blue-100);outline-offset:-2px}.overflow-hidden-items{display:flex;flex-wrap:wrap;gap:var(--ref-spacing-xxxs)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: OverflowCountDirective, selector: "[apOverflowCount]", inputs: ["gap", "counterFallbackWidth", "minVisible", "max", "collapse"], exportAs: ["apOverflowCount"] }, { kind: "directive", type: OverflowCounterDirective, selector: "[apOverflowCounter]" }, { kind: "directive", type: OverflowItemDirective, selector: "[apOverflowItem]" }, { kind: "directive", type: StopPropagationDirective, selector: "[apStopPropagation]" }, { kind: "directive", type: TooltipDirective, selector: "[apTooltip]", inputs: ["apTooltip", "apTooltipPosition", "apTooltipShowDelay", "apTooltipHideDelay", "apTooltipDuration", "apTooltipDisabled", "apTooltipTruncatedTextOnly", "apTooltipTemplateContext", "apTooltipVirtualScrollElement", "apTooltipTrigger", "apTooltipArrow", "apTooltipType", "apTooltipPresentationContext", "apTooltipListItems", "apTooltipShowAvatarCaption"], exportAs: ["apTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
173
|
+
}
|
|
174
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: OverflowBaseComponent, decorators: [{
|
|
175
|
+
type: Component,
|
|
176
|
+
args: [{ selector: 'ap-overflow-base', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
177
|
+
NgTemplateOutlet,
|
|
178
|
+
OverflowCountDirective,
|
|
179
|
+
OverflowCounterDirective,
|
|
180
|
+
OverflowItemDirective,
|
|
181
|
+
StopPropagationDirective,
|
|
182
|
+
TooltipDirective,
|
|
183
|
+
], host: {
|
|
184
|
+
'[style.--ap-overflow-base-gap]': "gap() + 'px'",
|
|
185
|
+
}, template: "<div\n #overflow=\"apOverflowCount\"\n class=\"overflow-row\"\n apOverflowCount\n [class.overflow-row-wrap]=\"!collapsing()\"\n [collapse]=\"collapsing()\"\n [gap]=\"gap()\"\n [max]=\"max()\">\n @for (item of items(); track trackBy()(item); let index = $index, count = $count) {\n <div\n class=\"overflow-item\"\n apOverflowItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate().templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index, count }\" />\n </div>\n }\n @if (collapsing() && overflow.hiddenCount() > 0) {\n @let hidden = hiddenItems(overflow.hiddenCount());\n @if (mode() === 'count') {\n <span\n class=\"overflow-more\"\n apOverflowCounter>\n <ng-container\n [ngTemplateOutlet]=\"moreContent\"\n [ngTemplateOutletContext]=\"{ $implicit: hidden.length }\" />\n </span>\n } @else {\n <button\n #moreButton\n type=\"button\"\n class=\"overflow-more\"\n apOverflowCounter\n apStopPropagation\n [apTooltip]=\"tooltipListItem() ? '' : hiddenList\"\n [apTooltipDisabled]=\"mode() !== 'tooltip'\"\n [apTooltipType]=\"tooltipListItem() ? CustomTooltipType.LIST : CustomTooltipType.DEFAULT\"\n [apTooltipListItems]=\"listItems(hidden)\"\n [apTooltipTemplateContext]=\"{ $implicit: hidden }\"\n [apTooltipTrigger]=\"trigger()\"\n [attr.aria-expanded]=\"mode() === 'expand' ? false : null\"\n [attr.aria-describedby]=\"namesId\"\n (click)=\"onMore()\">\n <ng-container\n [ngTemplateOutlet]=\"moreContent\"\n [ngTemplateOutletContext]=\"{ $implicit: hidden.length }\" />\n </button>\n <span\n hidden\n [id]=\"namesId\">\n {{ hiddenNames(hidden) }}\n </span>\n }\n }\n @if (mode() === 'expand' && expanded() && lessTemplate(); as less) {\n <button\n #lessButton\n type=\"button\"\n class=\"overflow-less\"\n apStopPropagation\n aria-expanded=\"true\"\n (click)=\"onLess()\">\n <ng-container [ngTemplateOutlet]=\"less.templateRef\" />\n </button>\n }\n</div>\n\n<ng-template\n #moreContent\n let-count>\n @if (moreTemplate(); as more) {\n <ng-container\n [ngTemplateOutlet]=\"more.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: count }\" />\n } @else {\n +{{ count }}\n }\n</ng-template>\n\n<ng-template\n #hiddenList\n let-hidden>\n <div class=\"overflow-hidden-items\">\n @for (item of hidden; track trackBy()(item); let index = $index, count = $count) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate().templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index, count }\" />\n }\n </div>\n</ng-template>\n", styles: [":host{display:block;min-width:0}.overflow-row{display:flex;align-items:center;gap:max(var(--ap-overflow-base-gap),0px);min-width:0}.overflow-row.overflow-row-wrap{flex-wrap:wrap}.overflow-item{display:flex;flex-shrink:0;min-width:0}.overflow-row-wrap>.overflow-item{flex-shrink:1;max-width:100%}.overflow-item+.overflow-item,.overflow-more{margin-inline-start:min(var(--ap-overflow-base-gap),0px)}.overflow-more,.overflow-less{display:flex;flex-shrink:0}button.overflow-more,.overflow-less{padding:0;border:none;border-radius:var(--comp-label-border-radius);background:none;color:var(--sys-text-color-default);font:inherit;cursor:pointer}button.overflow-more:focus-visible,.overflow-less:focus-visible{outline:2px solid var(--ref-color-electric-blue-100);outline-offset:-2px}.overflow-hidden-items{display:flex;flex-wrap:wrap;gap:var(--ref-spacing-xxxs)}\n"] }]
|
|
186
|
+
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], trigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "trigger", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], itemText: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemText", required: false }] }], tooltipListItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipListItem", required: false }] }], trackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackBy", required: false }] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => OverflowBaseItemDirective), { isSignal: true }] }], moreTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => OverflowBaseMoreDirective), { isSignal: true }] }], lessTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => OverflowBaseLessDirective), { isSignal: true }] }], overflowCount: [{ type: i0.ViewChild, args: [i0.forwardRef(() => OverflowCountDirective), { isSignal: true }] }], moreButton: [{ type: i0.ViewChild, args: ['moreButton', { isSignal: true }] }], lessButton: [{ type: i0.ViewChild, args: ['lessButton', { isSignal: true }] }] } });
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Generated bundle index. Do not edit.
|
|
190
|
+
*/
|
|
191
|
+
|
|
192
|
+
export { OverflowBaseComponent, OverflowBaseItemDirective, OverflowBaseLessDirective, OverflowBaseMoreDirective };
|
|
193
|
+
//# sourceMappingURL=agorapulse-ui-components-overflow-base.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-overflow-base.mjs","sources":["../../../libs/ui-components/overflow-base/src/overflow-base.component.ts","../../../libs/ui-components/overflow-base/src/overflow-base.component.html","../../../libs/ui-components/overflow-base/src/agorapulse-ui-components-overflow-base.ts"],"sourcesContent":["import {\n OverflowCountDirective,\n OverflowCounterDirective,\n OverflowItemDirective,\n StopPropagationDirective,\n} from '@agorapulse/ui-components/directives';\nimport { CustomTooltipAvatarItem, CustomTooltipType, TooltipDirective } from '@agorapulse/ui-components/tooltip';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n afterRenderEffect,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n Directive,\n ElementRef,\n inject,\n input,\n signal,\n TemplateRef,\n viewChild,\n} from '@angular/core';\n\nlet nextId = 0;\n\n/**\n * What becomes of the items that do not fit on the line.\n * - `tooltip`: one line, then a \"+N\" whose tooltip lists the hidden items.\n * - `expand`: one line, then a \"+N\" that unfolds the list onto several lines; the `apOverflowBaseLess` button folds it back.\n * - `wrap`: nothing is hidden, the list wraps onto as many lines as it needs.\n * - `count`: one line, then a \"+N\" that does nothing, for a control that already shows the hidden items, like a select field.\n */\nexport type OverflowBaseMode = 'tooltip' | 'expand' | 'wrap' | 'count';\n\nexport interface OverflowBaseItemContext<T> {\n $implicit: T;\n /** Position of the item in `items`. */\n index: number;\n /** How many items the list holds. */\n count: number;\n}\n\nexport interface OverflowBaseMoreContext {\n /** How many items the \"+N\" stands for. */\n $implicit: number;\n}\n\n/**\n * Template of one item, rendered in the row and again in the tooltip that lists the hidden ones.\n *\n * Bind it to the same list as `ap-overflow-base` to type `let-item`; without the binding the item is `unknown`.\n *\n * @example\n * ```html\n * <ng-template let-label [apOverflowBaseItem]=\"labels\">\n * <ap-label [content]=\"label\" />\n * </ng-template>\n * ```\n */\n@Directive({\n selector: 'ng-template[apOverflowBaseItem]',\n})\nexport class OverflowBaseItemDirective<T> {\n readonly templateRef = inject<TemplateRef<OverflowBaseItemContext<T>>>(TemplateRef);\n\n /** The list the template renders, read only to type the template context. */\n readonly apOverflowBaseItem = input<readonly T[]>();\n\n static ngTemplateContextGuard<T>(_directive: OverflowBaseItemDirective<T>, _context: unknown): _context is OverflowBaseItemContext<T> {\n return true;\n }\n}\n\n/**\n * Replaces the default \"+N\" text, with a chip for instance. `let-count` is the number of hidden\n * items; the button around it, its tooltip and its accessible name stay the list's.\n */\n@Directive({\n selector: 'ng-template[apOverflowBaseMore]',\n})\nexport class OverflowBaseMoreDirective {\n readonly templateRef = inject<TemplateRef<OverflowBaseMoreContext>>(TemplateRef);\n\n static ngTemplateContextGuard(_directive: OverflowBaseMoreDirective, _context: unknown): _context is OverflowBaseMoreContext {\n return true;\n }\n}\n\n/** Content of the button that folds an unfolded `expand` list back, \"See less\" for instance. Without it the list stays unfolded. */\n@Directive({\n selector: 'ng-template[apOverflowBaseLess]',\n})\nexport class OverflowBaseLessDirective {\n readonly templateRef = inject<TemplateRef<unknown>>(TemplateRef);\n}\n\n/**\n * Shows as many items as fit on one line, then a \"+N\" button: its tooltip lists the hidden items,\n * rendered with the item template itself, or it unfolds the list (see `mode`). Built on\n * `apOverflowCount`: the widths are measured, never estimated.\n *\n * The building block of `ap-overflow-list` and `ap-avatar-group`: use them for labels, tags and avatars,\n * and this only for a kind of item they do not render.\n *\n * The host takes the width its container gives it: `display: block`, or `flex: 1; min-width: 0` in a\n * flex parent. The \"+N\" click never reaches the ancestors, so the list works inside a clickable row.\n *\n * @example\n * ```html\n * <ap-overflow-base [items]=\"labels\">\n * <ng-template let-label [apOverflowBaseItem]=\"labels\">\n * <ap-label [content]=\"label\" />\n * </ng-template>\n * </ap-overflow-base>\n * ```\n */\n@Component({\n selector: 'ap-overflow-base',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './overflow-base.component.html',\n styleUrls: ['./overflow-base.component.scss'],\n imports: [\n NgTemplateOutlet,\n OverflowCountDirective,\n OverflowCounterDirective,\n OverflowItemDirective,\n StopPropagationDirective,\n TooltipDirective,\n ],\n host: {\n '[style.--ap-overflow-base-gap]': \"gap() + 'px'\",\n },\n})\nexport class OverflowBaseComponent<T> {\n /** The items, in display order: the hidden ones are always the last. */\n readonly items = input.required<readonly T[]>();\n /** What becomes of the items that do not fit on the line. */\n readonly mode = input<OverflowBaseMode>('tooltip');\n /** What opens the tooltip of the hidden items, in `tooltip` mode. */\n readonly trigger = input<'hover' | 'click'>('hover');\n /** Most items shown whatever the width; `wrap` shows them all. */\n readonly max = input<number | undefined>(undefined);\n /** Space between two items, in pixels. Negative, the items overlap, like a stack of avatars. */\n readonly gap = input(4);\n /** Text of an item, for the accessible description of the \"+N\" button. */\n readonly itemText = input<(item: T) => string>(item => String(item));\n /** Maps an item to an entry of a `LIST` tooltip (avatar and name); without it the tooltip renders the item template. */\n readonly tooltipListItem = input<(item: T) => CustomTooltipAvatarItem>();\n /** Identifies an item across changes of `items`, so that its element is kept; the item itself by default. */\n readonly trackBy = input<(item: T) => unknown>(item => item);\n\n protected readonly itemTemplate = contentChild.required<OverflowBaseItemDirective<T>>(OverflowBaseItemDirective);\n protected readonly moreTemplate = contentChild(OverflowBaseMoreDirective);\n protected readonly lessTemplate = contentChild(OverflowBaseLessDirective);\n\n protected readonly expanded = signal(false);\n protected readonly collapsing = computed(() => this.mode() !== 'wrap' && !(this.mode() === 'expand' && this.expanded()));\n protected readonly CustomTooltipType = CustomTooltipType;\n\n protected readonly namesId = `ap-overflow-base-names-${nextId++}`;\n\n private readonly overflowCount = viewChild.required(OverflowCountDirective);\n private readonly moreButton = viewChild<ElementRef<HTMLElement>>('moreButton');\n private readonly lessButton = viewChild<ElementRef<HTMLElement>>('lessButton');\n /** The button that replaces the one just clicked, focused once rendered so the focus does not fall back to the page. */\n private readonly pendingFocus = signal<'more' | 'less' | undefined>(undefined);\n\n constructor() {\n afterRenderEffect(() => {\n if (this.expanded() && this.overflowCount().hiddenCount() === 0) {\n this.expanded.set(false);\n }\n });\n afterRenderEffect(() => {\n const pending = this.pendingFocus();\n if (!pending) {\n return;\n }\n const button = pending === 'more' ? this.moreButton() : this.lessButton();\n const coming = pending === 'more' ? this.collapsing() && this.overflowCount().hiddenCount() > 0 : this.expanded();\n if (button || !coming) {\n button?.nativeElement.focus();\n this.pendingFocus.set(undefined);\n }\n });\n }\n\n protected hiddenItems(hiddenCount: number): readonly T[] {\n const items = this.items();\n return items.slice(Math.max(0, items.length - hiddenCount));\n }\n\n protected hiddenNames(hidden: readonly T[]): string {\n return hidden.map(item => this.itemText()(item)).join(', ');\n }\n\n protected listItems(hidden: readonly T[]): CustomTooltipAvatarItem[] {\n const toListItem = this.tooltipListItem();\n return toListItem ? hidden.map(item => toListItem(item)) : [];\n }\n\n protected onMore(): void {\n if (this.mode() === 'expand') {\n this.expanded.set(true);\n this.pendingFocus.set(this.lessTemplate() ? 'less' : undefined);\n }\n }\n\n protected onLess(): void {\n this.expanded.set(false);\n this.pendingFocus.set('more');\n }\n}\n","<div\n #overflow=\"apOverflowCount\"\n class=\"overflow-row\"\n apOverflowCount\n [class.overflow-row-wrap]=\"!collapsing()\"\n [collapse]=\"collapsing()\"\n [gap]=\"gap()\"\n [max]=\"max()\">\n @for (item of items(); track trackBy()(item); let index = $index, count = $count) {\n <div\n class=\"overflow-item\"\n apOverflowItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate().templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index, count }\" />\n </div>\n }\n @if (collapsing() && overflow.hiddenCount() > 0) {\n @let hidden = hiddenItems(overflow.hiddenCount());\n @if (mode() === 'count') {\n <span\n class=\"overflow-more\"\n apOverflowCounter>\n <ng-container\n [ngTemplateOutlet]=\"moreContent\"\n [ngTemplateOutletContext]=\"{ $implicit: hidden.length }\" />\n </span>\n } @else {\n <button\n #moreButton\n type=\"button\"\n class=\"overflow-more\"\n apOverflowCounter\n apStopPropagation\n [apTooltip]=\"tooltipListItem() ? '' : hiddenList\"\n [apTooltipDisabled]=\"mode() !== 'tooltip'\"\n [apTooltipType]=\"tooltipListItem() ? CustomTooltipType.LIST : CustomTooltipType.DEFAULT\"\n [apTooltipListItems]=\"listItems(hidden)\"\n [apTooltipTemplateContext]=\"{ $implicit: hidden }\"\n [apTooltipTrigger]=\"trigger()\"\n [attr.aria-expanded]=\"mode() === 'expand' ? false : null\"\n [attr.aria-describedby]=\"namesId\"\n (click)=\"onMore()\">\n <ng-container\n [ngTemplateOutlet]=\"moreContent\"\n [ngTemplateOutletContext]=\"{ $implicit: hidden.length }\" />\n </button>\n <span\n hidden\n [id]=\"namesId\">\n {{ hiddenNames(hidden) }}\n </span>\n }\n }\n @if (mode() === 'expand' && expanded() && lessTemplate(); as less) {\n <button\n #lessButton\n type=\"button\"\n class=\"overflow-less\"\n apStopPropagation\n aria-expanded=\"true\"\n (click)=\"onLess()\">\n <ng-container [ngTemplateOutlet]=\"less.templateRef\" />\n </button>\n }\n</div>\n\n<ng-template\n #moreContent\n let-count>\n @if (moreTemplate(); as more) {\n <ng-container\n [ngTemplateOutlet]=\"more.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: count }\" />\n } @else {\n +{{ count }}\n }\n</ng-template>\n\n<ng-template\n #hiddenList\n let-hidden>\n <div class=\"overflow-hidden-items\">\n @for (item of hidden; track trackBy()(item); let index = $index, count = $count) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate().templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index, count }\" />\n }\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAuBA,IAAI,MAAM,GAAG,CAAC;AAwBd;;;;;;;;;;;AAWG;MAIU,yBAAyB,CAAA;AACzB,IAAA,WAAW,GAAG,MAAM,CAA0C,WAAW,CAAC;;AAG1E,IAAA,kBAAkB,GAAG,KAAK;sGAAgB;AAEnD,IAAA,OAAO,sBAAsB,CAAI,UAAwC,EAAE,QAAiB,EAAA;AACxF,QAAA,OAAO,IAAI;IACf;uGARS,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAzB,yBAAyB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iCAAA,EAAA,MAAA,EAAA,EAAA,kBAAA,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1
|
+
import { AvatarComponent } from '@agorapulse/ui-components/avatar';
|
|
2
|
+
import { LabelComponent } from '@agorapulse/ui-components/labels';
|
|
3
|
+
import { OverflowBaseComponent, OverflowBaseItemDirective, OverflowBaseLessDirective, OverflowBaseMoreDirective } from '@agorapulse/ui-components/overflow-base';
|
|
4
|
+
import { TagComponent } from '@agorapulse/ui-components/tag';
|
|
5
|
+
import { SymbolComponent } from '@agorapulse/ui-symbol';
|
|
6
|
+
import * as i0 from '@angular/core';
|
|
7
|
+
import { input, booleanAttribute, output, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
8
|
+
|
|
9
|
+
function toEntry(item) {
|
|
10
|
+
return typeof item === 'string' ? { item, text: item } : { ...item, item };
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A list of labels or tags that shows as many as fit on one line, then a "+N" (see `mode`).
|
|
14
|
+
* The widths are measured, never estimated, and the "+N" click never reaches the ancestors,
|
|
15
|
+
* so the list works inside a clickable row.
|
|
16
|
+
*
|
|
17
|
+
* The host takes the width its container gives it: `display: block`, or `flex: 1; min-width: 0` in a flex parent.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```html
|
|
21
|
+
* <ap-overflow-list [items]="labels" />
|
|
22
|
+
* <ap-overflow-list displayType="tag" mode="wrap" removable [items]="profiles" (remove)="onRemove($event)" />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
class OverflowListComponent {
|
|
26
|
+
/** The items, in display order: the hidden ones are always the last. */
|
|
27
|
+
items = input.required(/* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
29
|
+
/** How each item renders. */
|
|
30
|
+
displayType = input('label', /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "displayType" }] : /* istanbul ignore next */ []));
|
|
32
|
+
/** Color of the tags, when `displayType` is `tag`. */
|
|
33
|
+
tagColor = input('grey', /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "tagColor" }] : /* istanbul ignore next */ []));
|
|
35
|
+
/** Whether the avatars of the tags are round. */
|
|
36
|
+
roundedAvatar = input(true, /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "roundedAvatar" }] : /* istanbul ignore next */ []));
|
|
38
|
+
/** What becomes of the items that do not fit on the line. */
|
|
39
|
+
mode = input('tooltip', /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
41
|
+
/** Most items shown whatever the width; `wrap` shows them all. */
|
|
42
|
+
max = input(undefined, /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
44
|
+
/** What opens the tooltip of the hidden items, in `tooltip` mode. */
|
|
45
|
+
trigger = input('hover', /* @ts-ignore */
|
|
46
|
+
...(ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []));
|
|
47
|
+
/** Shows a remove button on each item, which emits `remove`. */
|
|
48
|
+
removable = input(false, { ...(ngDevMode ? { debugName: "removable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
49
|
+
/** Text after the count of the "+N" link, in `expand` mode. */
|
|
50
|
+
moreText = input('labels', /* @ts-ignore */
|
|
51
|
+
...(ngDevMode ? [{ debugName: "moreText" }] : /* istanbul ignore next */ []));
|
|
52
|
+
/** Text of the link that folds an unfolded `expand` list back. */
|
|
53
|
+
lessText = input('See less', /* @ts-ignore */
|
|
54
|
+
...(ngDevMode ? [{ debugName: "lessText" }] : /* istanbul ignore next */ []));
|
|
55
|
+
/** Identifies an item across changes of `items`, so that its element is kept; the item itself by default. */
|
|
56
|
+
trackBy = input(item => item, /* @ts-ignore */
|
|
57
|
+
...(ngDevMode ? [{ debugName: "trackBy" }] : /* istanbul ignore next */ []));
|
|
58
|
+
/** The item whose remove button was clicked, as it was given. */
|
|
59
|
+
remove = output();
|
|
60
|
+
entries = computed(() => this.items().map(item => toEntry(item)), /* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [{ debugName: "entries" }] : /* istanbul ignore next */ []));
|
|
62
|
+
entryText = (entry) => entry.text;
|
|
63
|
+
entryTrack = (entry) => this.trackBy()(entry.item);
|
|
64
|
+
isRemovable(entry) {
|
|
65
|
+
return this.removable() && entry.removable !== false;
|
|
66
|
+
}
|
|
67
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: OverflowListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
68
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: OverflowListComponent, isStandalone: true, selector: "ap-overflow-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, displayType: { classPropertyName: "displayType", publicName: "displayType", isSignal: true, isRequired: false, transformFunction: null }, tagColor: { classPropertyName: "tagColor", publicName: "tagColor", isSignal: true, isRequired: false, transformFunction: null }, roundedAvatar: { classPropertyName: "roundedAvatar", publicName: "roundedAvatar", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, trigger: { classPropertyName: "trigger", publicName: "trigger", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, moreText: { classPropertyName: "moreText", publicName: "moreText", isSignal: true, isRequired: false, transformFunction: null }, lessText: { classPropertyName: "lessText", publicName: "lessText", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { remove: "remove" }, ngImport: i0, template: "<ap-overflow-base\n [items]=\"entries()\"\n [itemText]=\"entryText\"\n [trackBy]=\"entryTrack\"\n [mode]=\"mode()\"\n [max]=\"max()\"\n [trigger]=\"trigger()\">\n <ng-template\n let-entry\n [apOverflowBaseItem]=\"entries()\">\n @if (displayType() === 'tag') {\n <ap-tag\n [color]=\"entry.tagColor ?? tagColor()\"\n [clearable]=\"isRemovable(entry)\"\n (clear)=\"remove.emit(entry.item)\">\n @if (entry.avatarUrl || entry.network) {\n <ap-avatar\n [size]=\"16\"\n [rounded]=\"roundedAvatar()\"\n [profilePicture]=\"entry.avatarUrl\"\n [username]=\"entry.text\"\n [showInitials]=\"true\"\n [network]=\"entry.network\" />\n } @else if (entry.symbolId) {\n <ap-symbol\n size=\"sm\"\n [symbolId]=\"entry.symbolId\" />\n }\n {{ entry.text }}\n </ap-tag>\n } @else {\n <ap-label\n [content]=\"entry.text\"\n [removable]=\"isRemovable(entry)\"\n (remove)=\"remove.emit(entry.item)\" />\n }\n </ng-template>\n <ng-template\n let-count\n apOverflowBaseMore>\n @if (mode() === 'expand') {\n <span class=\"ap-link standalone\">+{{ count }} {{ moreText() }}</span>\n } @else if (displayType() === 'tag') {\n <ap-tag [color]=\"tagColor()\">+{{ count }}</ap-tag>\n } @else {\n <ap-label [content]=\"'+' + count\" />\n }\n </ng-template>\n <ng-template apOverflowBaseLess>\n <span class=\"ap-link standalone\">{{ lessText() }}</span>\n </ng-template>\n</ap-overflow-base>\n", styles: [":host{display:block;min-width:0}\n"], dependencies: [{ kind: "component", type: AvatarComponent, selector: "ap-avatar", inputs: ["profilePicture", "alt", "network", "size", "username", "showInitials", "bigNetwork", "anonymous", "online", "youtubeAvatarMode", "rounded"] }, { kind: "component", type: LabelComponent, selector: "ap-label", inputs: ["content", "selectorWidth", "removable"], outputs: ["remove"] }, { kind: "component", type: OverflowBaseComponent, selector: "ap-overflow-base", inputs: ["items", "mode", "trigger", "max", "gap", "itemText", "tooltipListItem", "trackBy"] }, { kind: "directive", type: OverflowBaseItemDirective, selector: "ng-template[apOverflowBaseItem]", inputs: ["apOverflowBaseItem"] }, { kind: "directive", type: OverflowBaseLessDirective, selector: "ng-template[apOverflowBaseLess]" }, { kind: "directive", type: OverflowBaseMoreDirective, selector: "ng-template[apOverflowBaseMore]" }, { kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "component", type: TagComponent, selector: "ap-tag", inputs: ["clearable", "add", "color", "mini"], outputs: ["clear", "added"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
69
|
+
}
|
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: OverflowListComponent, decorators: [{
|
|
71
|
+
type: Component,
|
|
72
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-overflow-list', imports: [
|
|
73
|
+
AvatarComponent,
|
|
74
|
+
LabelComponent,
|
|
75
|
+
OverflowBaseComponent,
|
|
76
|
+
OverflowBaseItemDirective,
|
|
77
|
+
OverflowBaseLessDirective,
|
|
78
|
+
OverflowBaseMoreDirective,
|
|
79
|
+
SymbolComponent,
|
|
80
|
+
TagComponent,
|
|
81
|
+
], template: "<ap-overflow-base\n [items]=\"entries()\"\n [itemText]=\"entryText\"\n [trackBy]=\"entryTrack\"\n [mode]=\"mode()\"\n [max]=\"max()\"\n [trigger]=\"trigger()\">\n <ng-template\n let-entry\n [apOverflowBaseItem]=\"entries()\">\n @if (displayType() === 'tag') {\n <ap-tag\n [color]=\"entry.tagColor ?? tagColor()\"\n [clearable]=\"isRemovable(entry)\"\n (clear)=\"remove.emit(entry.item)\">\n @if (entry.avatarUrl || entry.network) {\n <ap-avatar\n [size]=\"16\"\n [rounded]=\"roundedAvatar()\"\n [profilePicture]=\"entry.avatarUrl\"\n [username]=\"entry.text\"\n [showInitials]=\"true\"\n [network]=\"entry.network\" />\n } @else if (entry.symbolId) {\n <ap-symbol\n size=\"sm\"\n [symbolId]=\"entry.symbolId\" />\n }\n {{ entry.text }}\n </ap-tag>\n } @else {\n <ap-label\n [content]=\"entry.text\"\n [removable]=\"isRemovable(entry)\"\n (remove)=\"remove.emit(entry.item)\" />\n }\n </ng-template>\n <ng-template\n let-count\n apOverflowBaseMore>\n @if (mode() === 'expand') {\n <span class=\"ap-link standalone\">+{{ count }} {{ moreText() }}</span>\n } @else if (displayType() === 'tag') {\n <ap-tag [color]=\"tagColor()\">+{{ count }}</ap-tag>\n } @else {\n <ap-label [content]=\"'+' + count\" />\n }\n </ng-template>\n <ng-template apOverflowBaseLess>\n <span class=\"ap-link standalone\">{{ lessText() }}</span>\n </ng-template>\n</ap-overflow-base>\n", styles: [":host{display:block;min-width:0}\n"] }]
|
|
82
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], displayType: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayType", required: false }] }], tagColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tagColor", required: false }] }], roundedAvatar: [{ type: i0.Input, args: [{ isSignal: true, alias: "roundedAvatar", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], trigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "trigger", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], moreText: [{ type: i0.Input, args: [{ isSignal: true, alias: "moreText", required: false }] }], lessText: [{ type: i0.Input, args: [{ isSignal: true, alias: "lessText", required: false }] }], trackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackBy", required: false }] }], remove: [{ type: i0.Output, args: ["remove"] }] } });
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Generated bundle index. Do not edit.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
export { OverflowListComponent };
|
|
89
|
+
//# sourceMappingURL=agorapulse-ui-components-overflow-list.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-overflow-list.mjs","sources":["../../../libs/ui-components/overflow-list/src/overflow-list.component.ts","../../../libs/ui-components/overflow-list/src/overflow-list.component.html","../../../libs/ui-components/overflow-list/src/agorapulse-ui-components-overflow-list.ts"],"sourcesContent":["import { AvatarComponent, AvatarNetwork } from '@agorapulse/ui-components/avatar';\nimport { LabelComponent } from '@agorapulse/ui-components/labels';\nimport {\n OverflowBaseComponent,\n OverflowBaseItemDirective,\n OverflowBaseLessDirective,\n OverflowBaseMode,\n OverflowBaseMoreDirective,\n} from '@agorapulse/ui-components/overflow-base';\nimport { TagColor, TagComponent } from '@agorapulse/ui-components/tag';\nimport { SymbolComponent } from '@agorapulse/ui-symbol';\nimport { booleanAttribute, ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';\n\n/** How each item renders: an `ap-label`, or an `ap-tag` in `tagColor`. */\nexport type OverflowListDisplayType = 'label' | 'tag';\n\n/**\n * What becomes of the items that do not fit on the line.\n * - `tooltip`: one line, then a \"+N\" whose tooltip lists the hidden items, for a row whose height is fixed.\n * - `expand`: one line, then a \"+N labels\" link that unfolds the list, folded back by \"See less\".\n * - `wrap`: every item shows and the list wraps.\n * - `count`: one line, then a \"+N\" that does nothing, for a control that already shows the hidden items, like a select field.\n */\nexport type OverflowListMode = OverflowBaseMode;\n\n/** An item that carries more than its text. The avatar and the symbol show in the `tag` display only. */\nexport interface OverflowListItem {\n text: string;\n /** Picture of the avatar shown before the text. */\n avatarUrl?: string;\n /** Network of the avatar; on its own, the avatar shows the initials and the network. */\n network?: AvatarNetwork;\n /** Symbol shown before the text, when the item has no avatar. */\n symbolId?: string;\n /** Color of this item's tag, instead of `tagColor`. */\n tagColor?: TagColor;\n /** `false` keeps this item from being removed, even when the list is `removable`. */\n removable?: boolean;\n}\n\ntype OverflowListEntry<T> = OverflowListItem & { item: T };\n\nfunction toEntry<T extends string | OverflowListItem>(item: T): OverflowListEntry<T> {\n return typeof item === 'string' ? { item, text: item } : { ...(item as OverflowListItem), item };\n}\n\n/**\n * A list of labels or tags that shows as many as fit on one line, then a \"+N\" (see `mode`).\n * The widths are measured, never estimated, and the \"+N\" click never reaches the ancestors,\n * so the list works inside a clickable row.\n *\n * The host takes the width its container gives it: `display: block`, or `flex: 1; min-width: 0` in a flex parent.\n *\n * @example\n * ```html\n * <ap-overflow-list [items]=\"labels\" />\n * <ap-overflow-list displayType=\"tag\" mode=\"wrap\" removable [items]=\"profiles\" (remove)=\"onRemove($event)\" />\n * ```\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-overflow-list',\n templateUrl: './overflow-list.component.html',\n styleUrls: ['./overflow-list.component.scss'],\n imports: [\n AvatarComponent,\n LabelComponent,\n OverflowBaseComponent,\n OverflowBaseItemDirective,\n OverflowBaseLessDirective,\n OverflowBaseMoreDirective,\n SymbolComponent,\n TagComponent,\n ],\n})\nexport class OverflowListComponent<T extends string | OverflowListItem = string | OverflowListItem> {\n /** The items, in display order: the hidden ones are always the last. */\n readonly items = input.required<readonly T[]>();\n /** How each item renders. */\n readonly displayType = input<OverflowListDisplayType>('label');\n /** Color of the tags, when `displayType` is `tag`. */\n readonly tagColor = input<TagColor>('grey');\n /** Whether the avatars of the tags are round. */\n readonly roundedAvatar = input(true);\n /** What becomes of the items that do not fit on the line. */\n readonly mode = input<OverflowListMode>('tooltip');\n /** Most items shown whatever the width; `wrap` shows them all. */\n readonly max = input<number | undefined>(undefined);\n /** What opens the tooltip of the hidden items, in `tooltip` mode. */\n readonly trigger = input<'hover' | 'click'>('hover');\n /** Shows a remove button on each item, which emits `remove`. */\n readonly removable = input(false, { transform: booleanAttribute });\n /** Text after the count of the \"+N\" link, in `expand` mode. */\n readonly moreText = input<string>('labels');\n /** Text of the link that folds an unfolded `expand` list back. */\n readonly lessText = input<string>('See less');\n /** Identifies an item across changes of `items`, so that its element is kept; the item itself by default. */\n readonly trackBy = input<(item: T) => unknown>(item => item);\n\n /** The item whose remove button was clicked, as it was given. */\n readonly remove = output<T>();\n\n protected readonly entries = computed(() => this.items().map(item => toEntry(item)));\n protected readonly entryText = (entry: OverflowListEntry<T>): string => entry.text;\n protected readonly entryTrack = (entry: OverflowListEntry<T>): unknown => this.trackBy()(entry.item);\n\n protected isRemovable(entry: OverflowListEntry<T>): boolean {\n return this.removable() && entry.removable !== false;\n }\n}\n","<ap-overflow-base\n [items]=\"entries()\"\n [itemText]=\"entryText\"\n [trackBy]=\"entryTrack\"\n [mode]=\"mode()\"\n [max]=\"max()\"\n [trigger]=\"trigger()\">\n <ng-template\n let-entry\n [apOverflowBaseItem]=\"entries()\">\n @if (displayType() === 'tag') {\n <ap-tag\n [color]=\"entry.tagColor ?? tagColor()\"\n [clearable]=\"isRemovable(entry)\"\n (clear)=\"remove.emit(entry.item)\">\n @if (entry.avatarUrl || entry.network) {\n <ap-avatar\n [size]=\"16\"\n [rounded]=\"roundedAvatar()\"\n [profilePicture]=\"entry.avatarUrl\"\n [username]=\"entry.text\"\n [showInitials]=\"true\"\n [network]=\"entry.network\" />\n } @else if (entry.symbolId) {\n <ap-symbol\n size=\"sm\"\n [symbolId]=\"entry.symbolId\" />\n }\n {{ entry.text }}\n </ap-tag>\n } @else {\n <ap-label\n [content]=\"entry.text\"\n [removable]=\"isRemovable(entry)\"\n (remove)=\"remove.emit(entry.item)\" />\n }\n </ng-template>\n <ng-template\n let-count\n apOverflowBaseMore>\n @if (mode() === 'expand') {\n <span class=\"ap-link standalone\">+{{ count }} {{ moreText() }}</span>\n } @else if (displayType() === 'tag') {\n <ap-tag [color]=\"tagColor()\">+{{ count }}</ap-tag>\n } @else {\n <ap-label [content]=\"'+' + count\" />\n }\n </ng-template>\n <ng-template apOverflowBaseLess>\n <span class=\"ap-link standalone\">{{ lessText() }}</span>\n </ng-template>\n</ap-overflow-base>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AA0CA,SAAS,OAAO,CAAsC,IAAO,EAAA;IACzD,OAAO,OAAO,IAAI,KAAK,QAAQ,GAA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AAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAGP,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAhBjC,SAAS;AACW,YAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,kBAAkB,EAAA,OAAA,EAGnB;wBACL,eAAe;wBACf,cAAc;wBACd,qBAAqB;wBACrB,yBAAyB;wBACzB,yBAAyB;wBACzB,yBAAyB;wBACzB,eAAe;wBACf,YAAY;AACf,qBAAA,EAAA,QAAA,EAAA,63DAAA,EAAA,MAAA,EAAA,CAAA,oCAAA,CAAA,EAAA;;;AEzEL;;AAEG;;;;"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, input, output, ViewEncapsulation, ChangeDetectionStrategy, Component, Input, ElementRef, Renderer2, ViewContainerRef, effect, Directive, booleanAttribute, HostListener, ViewChild, EventEmitter, Output, signal, computed,
|
|
2
|
+
import { inject, input, output, ViewEncapsulation, ChangeDetectionStrategy, Component, Input, ElementRef, Renderer2, ViewContainerRef, effect, Directive, booleanAttribute, HostListener, ViewChild, EventEmitter, Output, signal, computed, afterNextRender, NgModule } from '@angular/core';
|
|
3
3
|
import { NgSelectComponent, NgSelectModule } from '@ng-select/ng-select';
|
|
4
4
|
import { SymbolRegistry, apPlus, SymbolComponent, apCheck } from '@agorapulse/ui-symbol';
|
|
5
5
|
import { BadgeComponent } from '@agorapulse/ui-components/badge';
|
|
6
6
|
import { CheckboxComponent } from '@agorapulse/ui-components/checkbox';
|
|
7
7
|
import { TooltipDirective } from '@agorapulse/ui-components/tooltip';
|
|
8
8
|
import { AvatarComponent } from '@agorapulse/ui-components/avatar';
|
|
9
|
-
import { StopPropagationDirective
|
|
9
|
+
import { StopPropagationDirective } from '@agorapulse/ui-components/directives';
|
|
10
10
|
import { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';
|
|
11
11
|
import { Subscription, BehaviorSubject, filter } from 'rxjs';
|
|
12
12
|
import { InputSearchComponent } from '@agorapulse/ui-components/input-search';
|
|
13
13
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
14
14
|
import * as i1 from '@angular/forms';
|
|
15
15
|
import { FormsModule } from '@angular/forms';
|
|
16
|
+
import { OverflowListComponent } from '@agorapulse/ui-components/overflow-list';
|
|
16
17
|
import { LabelComponent } from '@agorapulse/ui-components/labels';
|
|
17
18
|
import { TagComponent } from '@agorapulse/ui-components/tag';
|
|
18
19
|
|
|
@@ -763,36 +764,37 @@ class SelectLabelMultipleComponent {
|
|
|
763
764
|
* `optional` so the component still works when rendered outside a ng-select.
|
|
764
765
|
*/
|
|
765
766
|
ngSelect = inject(NgSelectComponent, { optional: true });
|
|
767
|
+
host = inject(ElementRef);
|
|
766
768
|
/** True when the whole select is disabled/readonly — hides every tag/label remove button. */
|
|
767
769
|
selectDisabled = computed(() => this.disabled() || (this.ngSelect?.disabled() ?? false), /* @ts-ignore */
|
|
768
770
|
...(ngDevMode ? [{ debugName: "selectDisabled" }] : /* istanbul ignore next */ []));
|
|
769
771
|
selectedLabels = computed(() => this.selectedItems().map(item => ({
|
|
770
|
-
|
|
771
|
-
avatarUrl: this.bindAvatarUrl() ? item[this.bindAvatarUrl()] :
|
|
772
|
-
symbolId: this.bindSymbolId() ? item[this.bindSymbolId()] :
|
|
773
|
-
value: item,
|
|
772
|
+
text: this.bindLabel() ? item[this.bindLabel()] : item,
|
|
773
|
+
avatarUrl: this.bindAvatarUrl() ? item[this.bindAvatarUrl()] || undefined : undefined,
|
|
774
|
+
symbolId: this.bindSymbolId() ? (item[this.bindSymbolId()] ?? undefined) : undefined,
|
|
774
775
|
network: this.bindNetwork() ? item[this.bindNetwork()] : undefined,
|
|
775
776
|
tagColor: this.bindTagColor() ? item[this.bindTagColor()] : undefined,
|
|
777
|
+
removable: !item.disabled,
|
|
778
|
+
value: item,
|
|
776
779
|
})), /* @ts-ignore */
|
|
777
780
|
...(ngDevMode ? [{ debugName: "selectedLabels" }] : /* istanbul ignore next */ []));
|
|
778
|
-
|
|
779
|
-
mainContainer = viewChild.required('mainContainer', { read: ElementRef });
|
|
781
|
+
trackByValue = (label) => (this.bindValue() ? label.value[this.bindValue()] : label.value);
|
|
780
782
|
// Overflow is shown via the "+N" chip, so this field must never scroll horizontally.
|
|
781
783
|
// ng-select re-focuses its off-screen search input after every change; without this the
|
|
782
784
|
// browser would scroll that input into view and shove the chip row out of the field.
|
|
783
785
|
pinHorizontalScroll = afterNextRender(() => {
|
|
784
|
-
const container = this.
|
|
786
|
+
const container = this.host.nativeElement.closest('.ng-value-container');
|
|
785
787
|
if (!container)
|
|
786
788
|
return;
|
|
787
789
|
container.addEventListener('scroll', () => (container.scrollLeft = 0), { passive: true });
|
|
788
790
|
});
|
|
789
791
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SelectLabelMultipleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
790
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
792
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", 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 }, bindTagColor: { classPropertyName: "bindTagColor", publicName: "bindTagColor", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { removeItem: "removeItem" }, ngImport: i0, template: "<ap-overflow-list\n mode=\"count\"\n [items]=\"selectedLabels()\"\n [displayType]=\"displayType()\"\n [tagColor]=\"tagColor()\"\n [roundedAvatar]=\"roundedAvatar()\"\n [removable]=\"!selectDisabled()\"\n [trackBy]=\"trackByValue\"\n (remove)=\"removeItem.emit($event.value)\" />\n", styles: ["ap-select-label-multiple{display:flex;width:100%}ap-select-label-multiple ap-overflow-list{flex:1;overflow:hidden}\n"], dependencies: [{ kind: "component", type: OverflowListComponent, selector: "ap-overflow-list", inputs: ["items", "displayType", "tagColor", "roundedAvatar", "mode", "max", "trigger", "removable", "moreText", "lessText", "trackBy"], outputs: ["remove"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
791
793
|
}
|
|
792
794
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SelectLabelMultipleComponent, decorators: [{
|
|
793
795
|
type: Component,
|
|
794
|
-
args: [{ selector: 'ap-select-label-multiple', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
795
|
-
}], 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 }] }], bindTagColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindTagColor", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], removeItem: [{ type: i0.Output, args: ["removeItem"] }]
|
|
796
|
+
args: [{ selector: 'ap-select-label-multiple', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [OverflowListComponent], template: "<ap-overflow-list\n mode=\"count\"\n [items]=\"selectedLabels()\"\n [displayType]=\"displayType()\"\n [tagColor]=\"tagColor()\"\n [roundedAvatar]=\"roundedAvatar()\"\n [removable]=\"!selectDisabled()\"\n [trackBy]=\"trackByValue\"\n (remove)=\"removeItem.emit($event.value)\" />\n", styles: ["ap-select-label-multiple{display:flex;width:100%}ap-select-label-multiple ap-overflow-list{flex:1;overflow:hidden}\n"] }]
|
|
797
|
+
}], 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 }] }], bindTagColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindTagColor", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], removeItem: [{ type: i0.Output, args: ["removeItem"] }] } });
|
|
796
798
|
|
|
797
799
|
class SelectLabelSingleComponent {
|
|
798
800
|
displayType = input('text', /* @ts-ignore */
|