@agorapulse/ui-components 22.3.0 → 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.
Files changed (29) hide show
  1. package/agorapulse-ui-components-22.4.0.tgz +0 -0
  2. package/fesm2022/agorapulse-ui-components-avatar-group.mjs +20 -33
  3. package/fesm2022/agorapulse-ui-components-avatar-group.mjs.map +1 -1
  4. package/fesm2022/agorapulse-ui-components-datepicker.mjs +1 -1
  5. package/fesm2022/agorapulse-ui-components-datepicker.mjs.map +1 -1
  6. package/fesm2022/agorapulse-ui-components-directives.mjs +79 -15
  7. package/fesm2022/agorapulse-ui-components-directives.mjs.map +1 -1
  8. package/fesm2022/agorapulse-ui-components-labels.mjs +3 -108
  9. package/fesm2022/agorapulse-ui-components-labels.mjs.map +1 -1
  10. package/fesm2022/agorapulse-ui-components-overflow-base.mjs +193 -0
  11. package/fesm2022/agorapulse-ui-components-overflow-base.mjs.map +1 -0
  12. package/fesm2022/agorapulse-ui-components-overflow-list.mjs +89 -0
  13. package/fesm2022/agorapulse-ui-components-overflow-list.mjs.map +1 -0
  14. package/fesm2022/agorapulse-ui-components-select.mjs +14 -12
  15. package/fesm2022/agorapulse-ui-components-select.mjs.map +1 -1
  16. package/fesm2022/agorapulse-ui-components-tooltip.mjs +9 -5
  17. package/fesm2022/agorapulse-ui-components-tooltip.mjs.map +1 -1
  18. package/fesm2022/agorapulse-ui-components.mjs +9 -7
  19. package/fesm2022/agorapulse-ui-components.mjs.map +1 -1
  20. package/package.json +9 -1
  21. package/types/agorapulse-ui-components-avatar-group.d.ts +12 -5
  22. package/types/agorapulse-ui-components-directives.d.ts +19 -4
  23. package/types/agorapulse-ui-components-labels.d.ts +2 -35
  24. package/types/agorapulse-ui-components-overflow-base.d.ts +124 -0
  25. package/types/agorapulse-ui-components-overflow-list.d.ts +80 -0
  26. package/types/agorapulse-ui-components-select.d.ts +8 -11
  27. package/types/agorapulse-ui-components-tooltip.d.ts +3 -3
  28. package/types/agorapulse-ui-components.d.ts +12 -10
  29. package/agorapulse-ui-components-22.3.0.tgz +0 -0
@@ -1,10 +1,8 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, ElementRef, NgZone, EventEmitter, booleanAttribute, Output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { BehaviorSubject } from 'rxjs';
4
1
  import { CloseButtonComponent } from '@agorapulse/ui-components/close-button';
5
2
  import { TooltipDirective } from '@agorapulse/ui-components/tooltip';
6
3
  import { SymbolRegistry, apClose } from '@agorapulse/ui-symbol';
7
- import * as i1 from '@agorapulse/ui-components/text-measurement';
4
+ import * as i0 from '@angular/core';
5
+ import { inject, ElementRef, NgZone, EventEmitter, booleanAttribute, Output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
8
6
 
9
7
  class LabelComponent {
10
8
  elementRef = inject(ElementRef);
@@ -57,112 +55,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
57
55
  type: Output
58
56
  }] } });
59
57
 
60
- class LabelListComponent {
61
- changeDetectorRef;
62
- elementRef;
63
- textMeasurementService;
64
- zone;
65
- labels = [];
66
- removeLabelsEnabled = false;
67
- responsive = false;
68
- seeLessTranslation = 'See less';
69
- hiddenLabelsTranslation = 'labels';
70
- removeLabel = new EventEmitter();
71
- badgeWidth = 0;
72
- expanded = false;
73
- howManyItemsLeft = 0;
74
- responsiveLabels = [];
75
- observer;
76
- width$ = new BehaviorSubject(0);
77
- constructor(changeDetectorRef, elementRef, textMeasurementService, zone) {
78
- this.changeDetectorRef = changeDetectorRef;
79
- this.elementRef = elementRef;
80
- this.textMeasurementService = textMeasurementService;
81
- this.zone = zone;
82
- this.observer = new ResizeObserver(entries => {
83
- this.zone.run(() => {
84
- this.width$.next(entries[0].contentRect.width);
85
- });
86
- });
87
- }
88
- ngAfterContentInit() {
89
- if (this.responsive) {
90
- this.generateResponsiveLabels(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0].offsetWidth);
91
- this.observer.observe(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0]);
92
- this.width$.subscribe(width => {
93
- this.generateResponsiveLabels(width);
94
- });
95
- }
96
- }
97
- ngOnChanges(changes) {
98
- if (changes.labels.currentValue && this.responsive) {
99
- this.generateResponsiveLabels(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0].offsetWidth);
100
- }
101
- }
102
- ngOnDestroy() {
103
- this.observer.unobserve(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0]);
104
- }
105
- onExpand() {
106
- this.expanded = !this.expanded;
107
- }
108
- onRemoveLabel({ content }) {
109
- this.removeLabel.emit(content);
110
- }
111
- onResize() {
112
- this.generateResponsiveLabels(this.elementRef.nativeElement.children[0].offsetWidth);
113
- }
114
- trackByLabelContent(_, entry) {
115
- return entry;
116
- }
117
- generateResponsiveLabels(width) {
118
- let seeMoreElementWidth = this.textMeasurementService.calculateTextWidth('+'.concat(this.labels.length.toString()), 14, 'Averta');
119
- seeMoreElementWidth += 1 + 8 + 8 + 1; // border-left + padding-left + padding-right + border-right
120
- let elementWidth = width - 16 - 16; // width - padding-left - padding-right
121
- elementWidth -= seeMoreElementWidth;
122
- let currentIndex = 0;
123
- for (let index = 0; index < this.labels.length; index++) {
124
- let textWidth = this.textMeasurementService.calculateTextWidth(this.labels[index], 14, 'Averta');
125
- textWidth += 1 + 8 + (this.removeLabelsEnabled ? 25 : 8) + 1 + 4; // border-left + padding-left + padding-right + border-right + label spacing
126
- elementWidth -= textWidth;
127
- if (elementWidth <= 0) {
128
- break;
129
- }
130
- currentIndex = index;
131
- }
132
- if (currentIndex + 1 === this.labels.length) {
133
- this.expanded = false;
134
- }
135
- this.howManyItemsLeft = this.labels.length - (currentIndex + 1);
136
- this.badgeWidth =
137
- this.howManyItemsLeft > 0 && currentIndex === 0
138
- ? this.textMeasurementService.calculateTextWidth('+' + this.howManyItemsLeft, 14, 'Averta') + 22
139
- : 0;
140
- this.responsiveLabels = this.labels.slice(0, currentIndex + 1);
141
- this.changeDetectorRef.markForCheck();
142
- }
143
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: LabelListComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i1.TextMeasurementService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
144
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: LabelListComponent, isStandalone: true, selector: "ap-label-list", inputs: { labels: "labels", removeLabelsEnabled: "removeLabelsEnabled", responsive: "responsive", seeLessTranslation: "seeLessTranslation", hiddenLabelsTranslation: "hiddenLabelsTranslation" }, outputs: { removeLabel: "removeLabel" }, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"labels-list\"\n (window:resize)=\"onResize()\">\n @if (responsive) {\n @for (label of expanded ? labels : responsiveLabels; track label) {\n <ap-label\n [content]=\"label\"\n [style.max-width]=\"!expanded ? 'calc(100% - ' + badgeWidth + 'px)' : '100%'\"\n [removable]=\"removeLabelsEnabled\"\n (remove)=\"onRemoveLabel($event)\" />\n }\n @if (!expanded && responsiveLabels.length !== labels.length && howManyItemsLeft > 0) {\n <a\n class=\"standalone\"\n role=\"button\"\n (click)=\"onExpand()\">\n +{{ howManyItemsLeft }} {{ hiddenLabelsTranslation }}\n </a>\n }\n @if (expanded) {\n <a\n class=\"standalone\"\n role=\"button\"\n (click)=\"onExpand()\">\n {{ seeLessTranslation }}\n </a>\n }\n } @else {\n @for (label of labels; track trackByLabelContent($index, label)) {\n <ap-label\n [content]=\"label\"\n [removable]=\"removeLabelsEnabled\"\n (remove)=\"onRemoveLabel($event)\" />\n }\n }\n</div>\n", styles: ["[color=facebook]{color:#0866ff}[bgcolor=facebook],[hcolor=facebook]:hover{background-color:#0866ff}[border=facebook]{border:1px solid #0866ff}[color=google]{color:#4e85e8}[bgcolor=google],[hcolor=google]:hover{background-color:#4e85e8}[border=google]{border:1px solid #4e85e8}[color=instagram]{color:#e1306c}[bgcolor=instagram],[hcolor=instagram]:hover{background-color:#e1306c}[border=instagram]{border:1px solid #e1306c}[color=instagrammagenta]{color:#c13584}[bgcolor=instagrammagenta],[hcolor=instagrammagenta]:hover{background-color:#c13584}[border=instagrammagenta]{border:1px solid #c13584}[color=instagramblue]{color:#5851db}[bgcolor=instagramblue],[hcolor=instagramblue]:hover{background-color:#5851db}[border=instagramblue]{border:1px solid #5851db}[color=instagrampurple]{color:#833ab4}[bgcolor=instagrampurple],[hcolor=instagrampurple]:hover{background-color:#833ab4}[border=instagrampurple]{border:1px solid #833ab4}[color=instagramorange]{color:#f56040}[bgcolor=instagramorange],[hcolor=instagramorange]:hover{background-color:#f56040}[border=instagramorange]{border:1px solid #f56040}[color=instagramyellow]{color:#ffdc80}[bgcolor=instagramyellow],[hcolor=instagramyellow]:hover{background-color:#ffdc80}[border=instagramyellow]{border:1px solid #ffdc80}[color=linkedin]{color:#2c67bc}[bgcolor=linkedin],[hcolor=linkedin]:hover{background-color:#2c67bc}[border=linkedin]{border:1px solid #2c67bc}[color=twitter]{color:#55acee}[bgcolor=twitter],[hcolor=twitter]:hover{background-color:#55acee}[border=twitter]{border:1px solid #55acee}[color=youtube]{color:red}[bgcolor=youtube],[hcolor=youtube]:hover{background-color:red}[border=youtube]{border:1px solid #ff0000}[color=reddit]{color:#ff4500}[bgcolor=reddit],[hcolor=reddit]:hover{background-color:#ff4500}[border=reddit]{border:1px solid #ff4500}[color=blood-orange]{color:#ff4d00}[bgcolor=blood-orange],[hcolor=blood-orange]:hover{background-color:#ff4d00}[border=blood-orange]{border:1px solid #ff4d00}[color=pinkish-orange]{color:#ff7b49}[bgcolor=pinkish-orange],[hcolor=pinkish-orange]:hover{background-color:#ff7b49}[border=pinkish-orange]{border:1px solid #ff7b49}[color=charcoal-grey]{color:#2a2f34}[bgcolor=charcoal-grey],[hcolor=charcoal-grey]:hover{background-color:#2a2f34}[border=charcoal-grey]{border:1px solid #2a2f34}[color=azure]{color:#00aeef}[bgcolor=azure],[hcolor=azure]:hover{background-color:#00aeef}[border=azure]{border:1px solid #00aeef}[color=light-azure]{color:#eaf5fd}[bgcolor=light-azure],[hcolor=light-azure]:hover{background-color:#eaf5fd}[border=light-azure]{border:1px solid #eaf5fd}[color=blue-grey]{color:#8d98a9}[bgcolor=blue-grey],[hcolor=blue-grey]:hover{background-color:#8d98a9}[border=blue-grey]{border:1px solid #8d98a9}[color=silver]{color:#ced0da}[bgcolor=silver],[hcolor=silver]:hover{background-color:#ced0da}[border=silver]{border:1px solid #ced0da}[color=pale-grey]{color:#dfe3e9}[bgcolor=pale-grey],[hcolor=pale-grey]:hover{background-color:#dfe3e9}[border=pale-grey]{border:1px solid #dfe3e9}[color=grey-white]{color:#f5f7f8}[bgcolor=grey-white],[hcolor=grey-white]:hover{background-color:#f5f7f8}[border=grey-white]{border:1px solid #f5f7f8}[color=cool-grey]{color:#b4bbc6}[bgcolor=cool-grey],[hcolor=cool-grey]:hover{background-color:#b4bbc6}[border=cool-grey]{border:1px solid #b4bbc6}[color=black]{color:#344563}[bgcolor=black],[hcolor=black]:hover{background-color:#344563}[border=black]{border:1px solid #344563}[color=grey-blue]{color:#68768c}[bgcolor=grey-blue],[hcolor=grey-blue]:hover{background-color:#68768c}[border=grey-blue]{border:1px solid #68768c}[color=strawberry]{color:#f4282d}[bgcolor=strawberry],[hcolor=strawberry]:hover{background-color:#f4282d}[border=strawberry]{border:1px solid #f4282d}[color=light-strawberry]{color:#f8eded}[bgcolor=light-strawberry],[hcolor=light-strawberry]:hover{background-color:#f8eded}[border=light-strawberry]{border:1px solid #f8eded}[color=white]{color:#fff}[bgcolor=white],[hcolor=white]:hover{background-color:#fff}[border=white]{border:1px solid #ffffff}[color=cool-green]{color:#33c15d}[bgcolor=cool-green],[hcolor=cool-green]:hover{background-color:#33c15d}[border=cool-green]{border:1px solid #33c15d}[color=light-green]{color:#ebfaef}[bgcolor=light-green],[hcolor=light-green]:hover{background-color:#ebfaef}[border=light-green]{border:1px solid #ebfaef}[color=transparent]{color:transparent}[bgcolor=transparent],[hcolor=transparent]:hover{background-color:transparent}[border=transparent]{border:1px solid transparent}[color=c0]{color:#a566a5}[bgcolor=c0],[hcolor=c0]:hover{background-color:#a566a5}[border=c0]{border:1px solid #a566a5}[color=c1]{color:#c7ab82}[bgcolor=c1],[hcolor=c1]:hover{background-color:#c7ab82}[border=c1]{border:1px solid #c7ab82}[color=c2]{color:#f2713c}[bgcolor=c2],[hcolor=c2]:hover{background-color:#f2713c}[border=c2]{border:1px solid #f2713c}[color=c3]{color:#ffd006}[bgcolor=c3],[hcolor=c3]:hover{background-color:#ffd006}[border=c3]{border:1px solid #ffd006}[color=c4]{color:#94c5aa}[bgcolor=c4],[hcolor=c4]:hover{background-color:#94c5aa}[border=c4]{border:1px solid #94c5aa}[color=c5]{color:#2a9d8f}[bgcolor=c5],[hcolor=c5]:hover{background-color:#2a9d8f}[border=c5]{border:1px solid #2a9d8f}[color=c6]{color:#78acd8}[bgcolor=c6],[hcolor=c6]:hover{background-color:#78acd8}[border=c6]{border:1px solid #78acd8}[color=c7]{color:#525a9e}[bgcolor=c7],[hcolor=c7]:hover{background-color:#525a9e}[border=c7]{border:1px solid #525a9e}[color=c8]{color:#6a2459}[bgcolor=c8],[hcolor=c8]:hover{background-color:#6a2459}[border=c8]{border:1px solid #6a2459}[color=c9]{color:#74729e}[bgcolor=c9],[hcolor=c9]:hover{background-color:#74729e}[border=c9]{border:1px solid #74729e}.labels-list{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;gap:4px;max-width:100%;margin:0}.labels-list>*{max-width:100%}.label-expand{box-sizing:border-box;padding:0 8px;background:#e8f4ff;border-radius:25px;border:1px solid #74bbfe;color:#178dfe;height:24px;min-width:30px;text-align:center;text-overflow:ellipsis;font-size:14px;font-family:Averta}.label-expand:hover{cursor:pointer;text-decoration:underline}\n"], dependencies: [{ kind: "component", type: LabelComponent, selector: "ap-label", inputs: ["content", "selectorWidth", "removable"], outputs: ["remove"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
145
- }
146
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: LabelListComponent, decorators: [{
147
- type: Component,
148
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-label-list', imports: [LabelComponent], template: "<div\n class=\"labels-list\"\n (window:resize)=\"onResize()\">\n @if (responsive) {\n @for (label of expanded ? labels : responsiveLabels; track label) {\n <ap-label\n [content]=\"label\"\n [style.max-width]=\"!expanded ? 'calc(100% - ' + badgeWidth + 'px)' : '100%'\"\n [removable]=\"removeLabelsEnabled\"\n (remove)=\"onRemoveLabel($event)\" />\n }\n @if (!expanded && responsiveLabels.length !== labels.length && howManyItemsLeft > 0) {\n <a\n class=\"standalone\"\n role=\"button\"\n (click)=\"onExpand()\">\n +{{ howManyItemsLeft }} {{ hiddenLabelsTranslation }}\n </a>\n }\n @if (expanded) {\n <a\n class=\"standalone\"\n role=\"button\"\n (click)=\"onExpand()\">\n {{ seeLessTranslation }}\n </a>\n }\n } @else {\n @for (label of labels; track trackByLabelContent($index, label)) {\n <ap-label\n [content]=\"label\"\n [removable]=\"removeLabelsEnabled\"\n (remove)=\"onRemoveLabel($event)\" />\n }\n }\n</div>\n", styles: ["[color=facebook]{color:#0866ff}[bgcolor=facebook],[hcolor=facebook]:hover{background-color:#0866ff}[border=facebook]{border:1px solid #0866ff}[color=google]{color:#4e85e8}[bgcolor=google],[hcolor=google]:hover{background-color:#4e85e8}[border=google]{border:1px solid #4e85e8}[color=instagram]{color:#e1306c}[bgcolor=instagram],[hcolor=instagram]:hover{background-color:#e1306c}[border=instagram]{border:1px solid #e1306c}[color=instagrammagenta]{color:#c13584}[bgcolor=instagrammagenta],[hcolor=instagrammagenta]:hover{background-color:#c13584}[border=instagrammagenta]{border:1px solid #c13584}[color=instagramblue]{color:#5851db}[bgcolor=instagramblue],[hcolor=instagramblue]:hover{background-color:#5851db}[border=instagramblue]{border:1px solid #5851db}[color=instagrampurple]{color:#833ab4}[bgcolor=instagrampurple],[hcolor=instagrampurple]:hover{background-color:#833ab4}[border=instagrampurple]{border:1px solid #833ab4}[color=instagramorange]{color:#f56040}[bgcolor=instagramorange],[hcolor=instagramorange]:hover{background-color:#f56040}[border=instagramorange]{border:1px solid #f56040}[color=instagramyellow]{color:#ffdc80}[bgcolor=instagramyellow],[hcolor=instagramyellow]:hover{background-color:#ffdc80}[border=instagramyellow]{border:1px solid #ffdc80}[color=linkedin]{color:#2c67bc}[bgcolor=linkedin],[hcolor=linkedin]:hover{background-color:#2c67bc}[border=linkedin]{border:1px solid #2c67bc}[color=twitter]{color:#55acee}[bgcolor=twitter],[hcolor=twitter]:hover{background-color:#55acee}[border=twitter]{border:1px solid #55acee}[color=youtube]{color:red}[bgcolor=youtube],[hcolor=youtube]:hover{background-color:red}[border=youtube]{border:1px solid #ff0000}[color=reddit]{color:#ff4500}[bgcolor=reddit],[hcolor=reddit]:hover{background-color:#ff4500}[border=reddit]{border:1px solid #ff4500}[color=blood-orange]{color:#ff4d00}[bgcolor=blood-orange],[hcolor=blood-orange]:hover{background-color:#ff4d00}[border=blood-orange]{border:1px solid #ff4d00}[color=pinkish-orange]{color:#ff7b49}[bgcolor=pinkish-orange],[hcolor=pinkish-orange]:hover{background-color:#ff7b49}[border=pinkish-orange]{border:1px solid #ff7b49}[color=charcoal-grey]{color:#2a2f34}[bgcolor=charcoal-grey],[hcolor=charcoal-grey]:hover{background-color:#2a2f34}[border=charcoal-grey]{border:1px solid #2a2f34}[color=azure]{color:#00aeef}[bgcolor=azure],[hcolor=azure]:hover{background-color:#00aeef}[border=azure]{border:1px solid #00aeef}[color=light-azure]{color:#eaf5fd}[bgcolor=light-azure],[hcolor=light-azure]:hover{background-color:#eaf5fd}[border=light-azure]{border:1px solid #eaf5fd}[color=blue-grey]{color:#8d98a9}[bgcolor=blue-grey],[hcolor=blue-grey]:hover{background-color:#8d98a9}[border=blue-grey]{border:1px solid #8d98a9}[color=silver]{color:#ced0da}[bgcolor=silver],[hcolor=silver]:hover{background-color:#ced0da}[border=silver]{border:1px solid #ced0da}[color=pale-grey]{color:#dfe3e9}[bgcolor=pale-grey],[hcolor=pale-grey]:hover{background-color:#dfe3e9}[border=pale-grey]{border:1px solid #dfe3e9}[color=grey-white]{color:#f5f7f8}[bgcolor=grey-white],[hcolor=grey-white]:hover{background-color:#f5f7f8}[border=grey-white]{border:1px solid #f5f7f8}[color=cool-grey]{color:#b4bbc6}[bgcolor=cool-grey],[hcolor=cool-grey]:hover{background-color:#b4bbc6}[border=cool-grey]{border:1px solid #b4bbc6}[color=black]{color:#344563}[bgcolor=black],[hcolor=black]:hover{background-color:#344563}[border=black]{border:1px solid #344563}[color=grey-blue]{color:#68768c}[bgcolor=grey-blue],[hcolor=grey-blue]:hover{background-color:#68768c}[border=grey-blue]{border:1px solid #68768c}[color=strawberry]{color:#f4282d}[bgcolor=strawberry],[hcolor=strawberry]:hover{background-color:#f4282d}[border=strawberry]{border:1px solid #f4282d}[color=light-strawberry]{color:#f8eded}[bgcolor=light-strawberry],[hcolor=light-strawberry]:hover{background-color:#f8eded}[border=light-strawberry]{border:1px solid #f8eded}[color=white]{color:#fff}[bgcolor=white],[hcolor=white]:hover{background-color:#fff}[border=white]{border:1px solid #ffffff}[color=cool-green]{color:#33c15d}[bgcolor=cool-green],[hcolor=cool-green]:hover{background-color:#33c15d}[border=cool-green]{border:1px solid #33c15d}[color=light-green]{color:#ebfaef}[bgcolor=light-green],[hcolor=light-green]:hover{background-color:#ebfaef}[border=light-green]{border:1px solid #ebfaef}[color=transparent]{color:transparent}[bgcolor=transparent],[hcolor=transparent]:hover{background-color:transparent}[border=transparent]{border:1px solid transparent}[color=c0]{color:#a566a5}[bgcolor=c0],[hcolor=c0]:hover{background-color:#a566a5}[border=c0]{border:1px solid #a566a5}[color=c1]{color:#c7ab82}[bgcolor=c1],[hcolor=c1]:hover{background-color:#c7ab82}[border=c1]{border:1px solid #c7ab82}[color=c2]{color:#f2713c}[bgcolor=c2],[hcolor=c2]:hover{background-color:#f2713c}[border=c2]{border:1px solid #f2713c}[color=c3]{color:#ffd006}[bgcolor=c3],[hcolor=c3]:hover{background-color:#ffd006}[border=c3]{border:1px solid #ffd006}[color=c4]{color:#94c5aa}[bgcolor=c4],[hcolor=c4]:hover{background-color:#94c5aa}[border=c4]{border:1px solid #94c5aa}[color=c5]{color:#2a9d8f}[bgcolor=c5],[hcolor=c5]:hover{background-color:#2a9d8f}[border=c5]{border:1px solid #2a9d8f}[color=c6]{color:#78acd8}[bgcolor=c6],[hcolor=c6]:hover{background-color:#78acd8}[border=c6]{border:1px solid #78acd8}[color=c7]{color:#525a9e}[bgcolor=c7],[hcolor=c7]:hover{background-color:#525a9e}[border=c7]{border:1px solid #525a9e}[color=c8]{color:#6a2459}[bgcolor=c8],[hcolor=c8]:hover{background-color:#6a2459}[border=c8]{border:1px solid #6a2459}[color=c9]{color:#74729e}[bgcolor=c9],[hcolor=c9]:hover{background-color:#74729e}[border=c9]{border:1px solid #74729e}.labels-list{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;gap:4px;max-width:100%;margin:0}.labels-list>*{max-width:100%}.label-expand{box-sizing:border-box;padding:0 8px;background:#e8f4ff;border-radius:25px;border:1px solid #74bbfe;color:#178dfe;height:24px;min-width:30px;text-align:center;text-overflow:ellipsis;font-size:14px;font-family:Averta}.label-expand:hover{cursor:pointer;text-decoration:underline}\n"] }]
149
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i1.TextMeasurementService }, { type: i0.NgZone }], propDecorators: { labels: [{
150
- type: Input
151
- }], removeLabelsEnabled: [{
152
- type: Input
153
- }], responsive: [{
154
- type: Input
155
- }], seeLessTranslation: [{
156
- type: Input
157
- }], hiddenLabelsTranslation: [{
158
- type: Input
159
- }], removeLabel: [{
160
- type: Output
161
- }] } });
162
-
163
58
  /**
164
59
  * Generated bundle index. Do not edit.
165
60
  */
166
61
 
167
- export { LabelComponent, LabelListComponent };
62
+ export { LabelComponent };
168
63
  //# sourceMappingURL=agorapulse-ui-components-labels.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components-labels.mjs","sources":["../../../libs/ui-components/labels/src/label.component.ts","../../../libs/ui-components/labels/src/label.component.html","../../../libs/ui-components/labels/src/label-list.component.ts","../../../libs/ui-components/labels/src/label-list.component.html","../../../libs/ui-components/labels/src/agorapulse-ui-components-labels.ts"],"sourcesContent":["import { CloseButtonComponent } from '@agorapulse/ui-components/close-button';\nimport { TooltipDirective } from '@agorapulse/ui-components/tooltip';\nimport { apClose, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n inject,\n Input,\n NgZone,\n OnDestroy,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-label',\n templateUrl: './label.component.html',\n imports: [TooltipDirective, CloseButtonComponent],\n styleUrls: ['./label.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class LabelComponent implements AfterViewInit, OnDestroy {\n private elementRef: ElementRef = inject(ElementRef);\n private symbolRegistry: SymbolRegistry = inject(SymbolRegistry);\n private zone: NgZone = inject(NgZone);\n\n @Input({\n required: true,\n })\n content!: string;\n @Input() selectorWidth: number = 0; //Width of the selector input, if applicable\n @Input({ transform: booleanAttribute }) removable: boolean = false;\n\n @Output() remove = new EventEmitter<{ content: string; $event: MouseEvent }>();\n\n private observer: ResizeObserver | undefined = undefined;\n tooltipEnabled: boolean = false;\n\n constructor() {\n this.symbolRegistry.registerSymbols([apClose]);\n }\n\n ngAfterViewInit(): void {\n this.observer = new ResizeObserver(entries => {\n this.zone.run(() => {\n const containerWidth =\n this.elementRef.nativeElement.clientWidth > 0 ? this.elementRef.nativeElement.clientWidth : this.selectorWidth;\n if (containerWidth > 0) {\n this.tooltipEnabled = entries[0].target.scrollWidth > containerWidth;\n }\n });\n });\n this.observer.observe(this.elementRef.nativeElement.getElementsByClassName('label-content')[0]);\n }\n\n ngOnDestroy() {\n this.observer?.unobserve(this.elementRef.nativeElement.children[0]);\n }\n\n onClearLabel($event: MouseEvent) {\n this.elementRef.nativeElement.remove();\n this.remove.emit({ content: this.content, $event });\n }\n}\n","<div\n class=\"label\"\n [class.removable]=\"removable\"\n [apTooltip]=\"tooltipEnabled ? content : ''\">\n <span class=\"label-content\">{{ content }}</span>\n @if (removable) {\n <ap-close-button (closed)=\"onClearLabel($event)\" />\n }\n</div>\n","import { TextMeasurementService } from '@agorapulse/ui-components/text-measurement';\n\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges,\n} from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { LabelComponent } from './label.component';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-label-list',\n templateUrl: './label-list.component.html',\n styleUrls: ['./label-list.component.scss'],\n imports: [LabelComponent],\n})\nexport class LabelListComponent implements AfterContentInit, OnChanges, OnDestroy {\n @Input() labels: string[] = [];\n @Input() removeLabelsEnabled: boolean = false;\n @Input() responsive: boolean = false;\n @Input() seeLessTranslation: string = 'See less';\n @Input() hiddenLabelsTranslation: string = 'labels';\n @Output() removeLabel = new EventEmitter<string>();\n\n badgeWidth: number = 0;\n expanded: boolean = false;\n howManyItemsLeft = 0;\n responsiveLabels: string[] = [];\n\n private observer: ResizeObserver;\n private width$ = new BehaviorSubject<number>(0);\n\n constructor(\n private changeDetectorRef: ChangeDetectorRef,\n private elementRef: ElementRef,\n private textMeasurementService: TextMeasurementService,\n private zone: NgZone\n ) {\n this.observer = new ResizeObserver(entries => {\n this.zone.run(() => {\n this.width$.next(entries[0].contentRect.width);\n });\n });\n }\n\n ngAfterContentInit(): void {\n if (this.responsive) {\n this.generateResponsiveLabels(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0].offsetWidth);\n\n this.observer.observe(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0]);\n this.width$.subscribe(width => {\n this.generateResponsiveLabels(width);\n });\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.labels.currentValue && this.responsive) {\n this.generateResponsiveLabels(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0].offsetWidth);\n }\n }\n\n ngOnDestroy() {\n this.observer.unobserve(this.elementRef.nativeElement.getElementsByClassName('labels-list')[0]);\n }\n\n onExpand() {\n this.expanded = !this.expanded;\n }\n\n onRemoveLabel({ content }: { content: string }): void {\n this.removeLabel.emit(content);\n }\n\n onResize() {\n this.generateResponsiveLabels(this.elementRef.nativeElement.children[0].offsetWidth);\n }\n\n public trackByLabelContent(_: number, entry: string) {\n return entry;\n }\n\n private generateResponsiveLabels(width: number) {\n let seeMoreElementWidth = this.textMeasurementService.calculateTextWidth('+'.concat(this.labels.length.toString()), 14, 'Averta');\n seeMoreElementWidth += 1 + 8 + 8 + 1; // border-left + padding-left + padding-right + border-right\n let elementWidth = width - 16 - 16; // width - padding-left - padding-right\n elementWidth -= seeMoreElementWidth;\n let currentIndex = 0;\n for (let index = 0; index < this.labels.length; index++) {\n let textWidth = this.textMeasurementService.calculateTextWidth(this.labels[index], 14, 'Averta');\n textWidth += 1 + 8 + (this.removeLabelsEnabled ? 25 : 8) + 1 + 4; // border-left + padding-left + padding-right + border-right + label spacing\n elementWidth -= textWidth;\n if (elementWidth <= 0) {\n break;\n }\n currentIndex = index;\n }\n if (currentIndex + 1 === this.labels.length) {\n this.expanded = false;\n }\n this.howManyItemsLeft = this.labels.length - (currentIndex + 1);\n this.badgeWidth =\n this.howManyItemsLeft > 0 && currentIndex === 0\n ? this.textMeasurementService.calculateTextWidth('+' + this.howManyItemsLeft, 14, 'Averta') + 22\n : 0;\n this.responsiveLabels = this.labels.slice(0, currentIndex + 1);\n this.changeDetectorRef.markForCheck();\n }\n}\n","<div\n class=\"labels-list\"\n (window:resize)=\"onResize()\">\n @if (responsive) {\n @for (label of expanded ? labels : responsiveLabels; track label) {\n <ap-label\n [content]=\"label\"\n [style.max-width]=\"!expanded ? 'calc(100% - ' + badgeWidth + 'px)' : '100%'\"\n [removable]=\"removeLabelsEnabled\"\n (remove)=\"onRemoveLabel($event)\" />\n }\n @if (!expanded && responsiveLabels.length !== labels.length && howManyItemsLeft > 0) {\n <a\n class=\"standalone\"\n role=\"button\"\n (click)=\"onExpand()\">\n +{{ howManyItemsLeft }} {{ hiddenLabelsTranslation }}\n </a>\n }\n @if (expanded) {\n <a\n class=\"standalone\"\n role=\"button\"\n (click)=\"onExpand()\">\n {{ seeLessTranslation }}\n </a>\n }\n } @else {\n @for (label of labels; track trackByLabelContent($index, label)) {\n <ap-label\n [content]=\"label\"\n [removable]=\"removeLabelsEnabled\"\n (remove)=\"onRemoveLabel($event)\" />\n }\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MAyBa,cAAc,CAAA;AACf,IAAA,UAAU,GAAe,MAAM,CAAC,UAAU,CAAC;AAC3C,IAAA,cAAc,GAAmB,MAAM,CAAC,cAAc,CAAC;AACvD,IAAA,IAAI,GAAW,MAAM,CAAC,MAAM,CAAC;AAKrC,IAAA,OAAO;AACE,IAAA,aAAa,GAAW,CAAC,CAAC;IACK,SAAS,GAAY,KAAK;AAExD,IAAA,MAAM,GAAG,IAAI,YAAY,EAA2C;IAEtE,QAAQ,GAA+B,SAAS;IACxD,cAAc,GAAY,KAAK;AAE/B,IAAA,WAAA,GAAA;QACI,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC;IAClD;IAEA,eAAe,GAAA;QACX,IAAI,CAAC,QAAQ,GAAG,IAAI,cAAc,CAAC,OAAO,IAA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AA;2FAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,qBAAA,EAAA,UAAA,EAAA,YAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,uBAAA,EAAA,yBAAA,EAAA,EAAA,OAAA,EAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,aAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC1B/B,kwCAoCA,EAAA,MAAA,EAAA,CAAA,y+LAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDZc,cAAc,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,eAAA,EAAA,WAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAEf,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAP9B,SAAS;AACW,YAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,eAAe,EAAA,OAAA,EAGhB,CAAC,cAAc,CAAC,EAAA,QAAA,EAAA,kwCAAA,EAAA,MAAA,EAAA,CAAA,y+LAAA,CAAA,EAAA;;sBAGxB;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;;AEhCL;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components-labels.mjs","sources":["../../../libs/ui-components/labels/src/label.component.ts","../../../libs/ui-components/labels/src/label.component.html","../../../libs/ui-components/labels/src/agorapulse-ui-components-labels.ts"],"sourcesContent":["import { CloseButtonComponent } from '@agorapulse/ui-components/close-button';\nimport { TooltipDirective } from '@agorapulse/ui-components/tooltip';\nimport { apClose, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n inject,\n Input,\n NgZone,\n OnDestroy,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-label',\n templateUrl: './label.component.html',\n imports: [TooltipDirective, CloseButtonComponent],\n styleUrls: ['./label.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class LabelComponent implements AfterViewInit, OnDestroy {\n private elementRef: ElementRef = inject(ElementRef);\n private symbolRegistry: SymbolRegistry = inject(SymbolRegistry);\n private zone: NgZone = inject(NgZone);\n\n @Input({\n required: true,\n })\n content!: string;\n @Input() selectorWidth: number = 0; //Width of the selector input, if applicable\n @Input({ transform: booleanAttribute }) removable: boolean = false;\n\n @Output() remove = new EventEmitter<{ content: string; $event: MouseEvent }>();\n\n private observer: ResizeObserver | undefined = undefined;\n tooltipEnabled: boolean = false;\n\n constructor() {\n this.symbolRegistry.registerSymbols([apClose]);\n }\n\n ngAfterViewInit(): void {\n this.observer = new ResizeObserver(entries => {\n this.zone.run(() => {\n const containerWidth =\n this.elementRef.nativeElement.clientWidth > 0 ? this.elementRef.nativeElement.clientWidth : this.selectorWidth;\n if (containerWidth > 0) {\n this.tooltipEnabled = entries[0].target.scrollWidth > containerWidth;\n }\n });\n });\n this.observer.observe(this.elementRef.nativeElement.getElementsByClassName('label-content')[0]);\n }\n\n ngOnDestroy() {\n this.observer?.unobserve(this.elementRef.nativeElement.children[0]);\n }\n\n onClearLabel($event: MouseEvent) {\n this.elementRef.nativeElement.remove();\n this.remove.emit({ content: this.content, $event });\n }\n}\n","<div\n class=\"label\"\n [class.removable]=\"removable\"\n [apTooltip]=\"tooltipEnabled ? content : ''\">\n <span class=\"label-content\">{{ content }}</span>\n @if (removable) {\n <ap-close-button (closed)=\"onClearLabel($event)\" />\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\n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,EAAA;;sBAOpC,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA;AACH,wBAAA,QAAQ,EAAE,IAAI;AACjB,qBAAA;;sBAEA;;sBACA,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;sBAErC;;;AErCL;;AAEG;;;;"}
@@ -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,EAAA,EAAA,iBAAA,EAAA,oBAAA,EAAA,UAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAHrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,iCAAiC;AAC9C,iBAAA;;AAYD;;;AAGG;MAIU,yBAAyB,CAAA;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,EAAA,4rGAAA,EAAA,MAAA,EAAA,CAAA,01BAAA,CAAA,EAAA;k2BAoBqF,yBAAyB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAChE,yBAAyB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MACzB,yBAAyB,4FAQpB,sBAAsB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CACT,YAAY,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CACZ,YAAY,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEnKjF;;AAEG;;;;"}
@@ -0,0 +1,89 @@
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