@arsedizioni/ars-utils 22.6.85 → 22.6.88

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 (79) hide show
  1. package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +3158 -3344
  2. package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs.map +1 -1
  3. package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +7616 -4772
  4. package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
  5. package/fesm2022/arsedizioni-ars-utils-core.date.mjs +321 -702
  6. package/fesm2022/arsedizioni-ars-utils-core.date.mjs.map +1 -1
  7. package/fesm2022/arsedizioni-ars-utils-core.markdown.mjs +445 -590
  8. package/fesm2022/arsedizioni-ars-utils-core.markdown.mjs.map +1 -1
  9. package/fesm2022/arsedizioni-ars-utils-core.mjs +1735 -2370
  10. package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
  11. package/fesm2022/arsedizioni-ars-utils-core.validators.mjs +1280 -1470
  12. package/fesm2022/arsedizioni-ars-utils-core.validators.mjs.map +1 -1
  13. package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs +1097 -1528
  14. package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs.map +1 -1
  15. package/fesm2022/arsedizioni-ars-utils-support.common.mjs +198 -294
  16. package/fesm2022/arsedizioni-ars-utils-support.common.mjs.map +1 -1
  17. package/fesm2022/arsedizioni-ars-utils-ui.controls.date.mjs +115 -117
  18. package/fesm2022/arsedizioni-ars-utils-ui.controls.date.mjs.map +1 -1
  19. package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs +1607 -613
  20. package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs.map +1 -1
  21. package/fesm2022/arsedizioni-ars-utils-ui.controls.tree.mjs +840 -367
  22. package/fesm2022/arsedizioni-ars-utils-ui.controls.tree.mjs.map +1 -1
  23. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs +1634 -651
  24. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs.map +1 -1
  25. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs +1255 -792
  26. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs.map +1 -1
  27. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs +1410 -357
  28. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs.map +1 -1
  29. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs +2401 -944
  30. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs.map +1 -1
  31. package/fesm2022/arsedizioni-ars-utils-ui.files.mjs +1553 -741
  32. package/fesm2022/arsedizioni-ars-utils-ui.files.mjs.map +1 -1
  33. package/fesm2022/arsedizioni-ars-utils-ui.filters.mjs +901 -430
  34. package/fesm2022/arsedizioni-ars-utils-ui.filters.mjs.map +1 -1
  35. package/fesm2022/arsedizioni-ars-utils-ui.help.mjs +737 -530
  36. package/fesm2022/arsedizioni-ars-utils-ui.help.mjs.map +1 -1
  37. package/fesm2022/arsedizioni-ars-utils-ui.mjs +6638 -1755
  38. package/fesm2022/arsedizioni-ars-utils-ui.mjs.map +1 -1
  39. package/fesm2022/arsedizioni-ars-utils-ui.navigation.mjs +1479 -1207
  40. package/fesm2022/arsedizioni-ars-utils-ui.navigation.mjs.map +1 -1
  41. package/fesm2022/arsedizioni-ars-utils-ui.notifications.mjs +1003 -270
  42. package/fesm2022/arsedizioni-ars-utils-ui.notifications.mjs.map +1 -1
  43. package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs +497 -278
  44. package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs.map +1 -1
  45. package/fesm2022/arsedizioni-ars-utils-ui.paginator.mjs +48 -52
  46. package/fesm2022/arsedizioni-ars-utils-ui.paginator.mjs.map +1 -1
  47. package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs +464 -704
  48. package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs.map +1 -1
  49. package/fesm2022/arsedizioni-ars-utils-ui.tinymce.mjs +724 -657
  50. package/fesm2022/arsedizioni-ars-utils-ui.tinymce.mjs.map +1 -1
  51. package/fesm2022/arsedizioni-ars-utils.mjs +3 -19
  52. package/fesm2022/arsedizioni-ars-utils.mjs.map +1 -1
  53. package/package.json +1 -1
  54. package/types/arsedizioni-ars-utils-clipper.common.d.ts +1151 -1163
  55. package/types/arsedizioni-ars-utils-clipper.ui.d.ts +1588 -1426
  56. package/types/arsedizioni-ars-utils-core.d.ts +1169 -1172
  57. package/types/arsedizioni-ars-utils-core.date.d.ts +204 -208
  58. package/types/arsedizioni-ars-utils-core.markdown.d.ts +128 -126
  59. package/types/arsedizioni-ars-utils-core.validators.d.ts +270 -236
  60. package/types/arsedizioni-ars-utils-evolution.common.d.ts +1054 -1067
  61. package/types/arsedizioni-ars-utils-support.common.d.ts +225 -234
  62. package/types/arsedizioni-ars-utils-ui.controls.d.ts +440 -278
  63. package/types/arsedizioni-ars-utils-ui.controls.date.d.ts +24 -28
  64. package/types/arsedizioni-ars-utils-ui.controls.tree.d.ts +172 -136
  65. package/types/arsedizioni-ars-utils-ui.d.ts +2035 -821
  66. package/types/arsedizioni-ars-utils-ui.dialogs.auth.d.ts +327 -322
  67. package/types/arsedizioni-ars-utils-ui.dialogs.d.ts +343 -347
  68. package/types/arsedizioni-ars-utils-ui.dialogs.prompt.d.ts +167 -167
  69. package/types/arsedizioni-ars-utils-ui.dialogs.select.d.ts +373 -367
  70. package/types/arsedizioni-ars-utils-ui.files.d.ts +335 -283
  71. package/types/arsedizioni-ars-utils-ui.filters.d.ts +232 -160
  72. package/types/arsedizioni-ars-utils-ui.help.d.ts +204 -211
  73. package/types/arsedizioni-ars-utils-ui.navigation.d.ts +811 -646
  74. package/types/arsedizioni-ars-utils-ui.notifications.d.ts +74 -78
  75. package/types/arsedizioni-ars-utils-ui.oauth.d.ts +102 -62
  76. package/types/arsedizioni-ars-utils-ui.paginator.d.ts +19 -22
  77. package/types/arsedizioni-ars-utils-ui.shell.d.ts +376 -382
  78. package/types/arsedizioni-ars-utils-ui.tinymce.d.ts +244 -231
  79. package/types/arsedizioni-ars-utils.d.ts +1 -3
@@ -1,614 +1,1608 @@
1
- import * as i0 from '@angular/core';
2
- import { output, inject, Renderer2, signal, input, effect, Input, Optional, Self, ChangeDetectionStrategy, Component, computed, DestroyRef, booleanAttribute, ChangeDetectorRef, afterNextRender } from '@angular/core';
3
- import { coerceBooleanProperty } from '@angular/cdk/coercion';
4
- import * as i4 from '@angular/material/button';
5
- import { MatButtonModule } from '@angular/material/button';
6
- import * as i3 from '@angular/material/icon';
7
- import { MatIconModule } from '@angular/material/icon';
8
- import * as i5 from '@angular/material/menu';
9
- import { MatMenuModule } from '@angular/material/menu';
10
- import { SystemUtils, SafeHtmlPipe } from '@arsedizioni/ars-utils/core';
11
- import * as i2 from '@arsedizioni/ars-utils/ui';
12
- import { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';
13
- import { Subject, auditTime, animationFrameScheduler } from 'rxjs';
14
- import * as i1 from '@angular/forms';
15
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
16
- import { form, FormField } from '@angular/forms/signals';
17
- import * as i7 from '@angular/material/badge';
18
- import { MatBadgeModule } from '@angular/material/badge';
19
- import * as i4$1 from '@angular/material/chips';
20
- import { MatChipsModule } from '@angular/material/chips';
21
- import * as i2$1 from '@angular/material/form-field';
22
- import { MatFormFieldModule } from '@angular/material/form-field';
23
- import * as i3$1 from '@angular/material/select';
24
- import { MatSelectModule } from '@angular/material/select';
25
- import * as i8 from '@angular/material/tooltip';
26
- import { MatTooltipModule } from '@angular/material/tooltip';
27
-
28
- class ButtonSelectorComponent {
29
- set value(value) {
30
- this.setValue(value, true);
31
- }
32
- /**
33
- * Updates the internal state. Form propagation is skipped for model->view
34
- * writes (writeValue) to avoid the CVA echo loop, and performed for
35
- * user/programmatic changes via the `value` setter.
36
- * @param value - The new value to store and display.
37
- * @param propagate - When `true`, notifies the registered onChange callback.
38
- */
39
- setValue(value, propagate) {
40
- this._value = value;
41
- if (propagate) {
42
- this.propagateChange(this._value);
43
- }
44
- this.stateChanges.next();
45
- this.changed.emit(this._value);
46
- this.current.set(this._value);
47
- }
48
- /** The current value as the selected item. */
49
- get value() {
50
- return this._value;
51
- }
52
- get disabled() {
53
- if (this.ngControl && this.ngControl.disabled != null) {
54
- return this.ngControl.disabled;
55
- }
56
- return this._disabled;
57
- }
58
- set disabled(value) {
59
- this._disabled = coerceBooleanProperty(value);
60
- if (this.focused) {
61
- this.focused = false;
62
- this.stateChanges.next();
63
- }
64
- }
65
- constructor(ngControl) {
66
- this.ngControl = ngControl;
67
- /** Emitted whenever the selected value changes (including programmatic resets). */
68
- this.changed = output();
69
- /** Emitted when the user explicitly picks an item from the menu. */
70
- this.selected = output();
71
- this.stateChanges = new Subject();
72
- this.focused = false;
73
- this._value = undefined;
74
- this._disabled = false;
75
- this.propagateChange = () => { };
76
- this.propagateTouched = () => { };
77
- this.id = `button-selector--${SystemUtils.generateUUID()}`;
78
- this.describedBy = '';
79
- this.renderer = inject(Renderer2);
80
- /** Currently selected item, kept in sync with the form control value. */
81
- this.current = signal(undefined, /* @ts-ignore */
82
- ...(ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []));
83
- /** Width of the trigger button in pixels. Use `-1` for 100 %, `0` for `auto`. */
84
- this.width = input(-1, /* @ts-ignore */
85
- ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
86
- /** Border thickness override. Use `-1` to inherit. */
87
- this.border = input(-1, /* @ts-ignore */
88
- ...(ngDevMode ? [{ debugName: "border" }] : /* istanbul ignore next */ []));
89
- /** CSS border-radius of the trigger button. Defaults to a pill shape. */
90
- this.borderRadius = input('9999px', /* @ts-ignore */
91
- ...(ngDevMode ? [{ debugName: "borderRadius" }] : /* istanbul ignore next */ []));
92
- /** Placeholder label shown when nothing is selected. */
93
- this.label = input(undefined, /* @ts-ignore */
94
- ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
95
- /** Label shown above the selected value (replaces `label` when an item is selected). */
96
- this.labelSelected = input(undefined, /* @ts-ignore */
97
- ...(ngDevMode ? [{ debugName: "labelSelected" }] : /* istanbul ignore next */ []));
98
- /** List of selectable options. */
99
- this.options = input([], /* @ts-ignore */
100
- ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
101
- /** When `true`, the first available option is pre-selected on init. */
102
- this.autoSelect = input(false, /* @ts-ignore */
103
- ...(ngDevMode ? [{ debugName: "autoSelect" }] : /* istanbul ignore next */ []));
104
- if (this.ngControl != null) {
105
- this.ngControl.valueAccessor = this;
106
- }
107
- // Pre-select the first option whenever options change and autoSelect is enabled
108
- effect(() => {
109
- if (this.autoSelect()) {
110
- const options = this.options();
111
- // !== undefined: values like 0 or false are legitimate selections
112
- if (options.length > 0 && options[0].value !== undefined) {
113
- this.current.set(options[0]);
114
- }
115
- }
116
- });
117
- }
118
- ngOnDestroy() {
119
- this.stateChanges.complete();
120
- }
121
- /**
122
- * Writes a new value to the component (called by the form layer).
123
- * @param value - The new value to display.
124
- */
125
- writeValue(value) {
126
- // Model -> view write: must NOT propagate back to the form (echo loop)
127
- this.setValue(value, false);
128
- }
129
- /**
130
- * Registers the on-change callback (called by the form layer).
131
- * @param fn - Callback to invoke whenever the value changes.
132
- */
133
- registerOnChange(fn) {
134
- this.propagateChange = fn;
135
- }
136
- /**
137
- * Registers the on-touched callback (called by the form layer).
138
- * @param fn - Callback to invoke when the control is touched.
139
- */
140
- registerOnTouched(fn) {
141
- this.propagateTouched = fn;
142
- }
143
- /**
144
- * Sets the ARIA described-by IDs for accessibility.
145
- * @param ids - The list of element IDs to associate with this control.
146
- */
147
- setDescribedByIds(ids) {
148
- this.describedBy = ids.join(' ');
149
- }
150
- /**
151
- * Updates the disabled state when the Angular form layer changes it.
152
- * @param isDisabled - Whether the control should be disabled.
153
- */
154
- setDisabledState(isDisabled) {
155
- this._disabled = isDisabled;
156
- if (isDisabled && this.focused) {
157
- this.focused = false;
158
- this.stateChanges.next();
159
- }
160
- if (!SystemUtils.isBrowser())
161
- return;
162
- const elem = document.getElementById(this.id);
163
- if (elem) {
164
- this.renderer.setProperty(elem, 'disabled', isDisabled);
165
- }
166
- }
167
- /**
168
- * Handles a click on the container element, focusing it and marking it as touched.
169
- */
170
- onContainerClick() {
171
- if (!this.focused) {
172
- if (!SystemUtils.isBrowser())
173
- return;
174
- const elem = document.getElementById(this.id);
175
- if (elem) {
176
- elem.focus();
177
- this.propagateTouched();
178
- }
179
- }
180
- }
181
- /**
182
- * Selects an option and optionally emits the `selected` output event.
183
- * @param item - The item to select.
184
- * @param notify - When `true` (default), emits the `selected` event.
185
- */
186
- select(item, notify = true) {
187
- this.setValue(item, true);
188
- if (notify) {
189
- this.selected.emit(item);
190
- }
191
- }
192
- /** Clears the current selection and resets the control to an empty state. */
193
- reset() {
194
- this.setValue(undefined, true);
195
- }
196
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ButtonSelectorComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
197
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: ButtonSelectorComponent, isStandalone: true, selector: "button-selector", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, border: { classPropertyName: "border", publicName: "border", isSignal: true, isRequired: false, transformFunction: null }, borderRadius: { classPropertyName: "borderRadius", publicName: "borderRadius", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelSelected: { classPropertyName: "labelSelected", publicName: "labelSelected", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, autoSelect: { classPropertyName: "autoSelect", publicName: "autoSelect", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed", selected: "selected" }, host: { properties: { "id": "id", "attr.aria-describedBy": "describedBy" } }, ngImport: i0, template: "<button mat-stroked-button class=\"menu-selector-button\" [style.border]=\"border() >= 0 ? border() : 'auto'\"\r\n [style.border-radius]=\"borderRadius()\" [style.height]=\"border() <= 0 ? '40px' : 'auto'\"\r\n [style.min-width]=\"width() > 0 ? width()+'px' : (width() === -1 ? '100%' : 'auto')\" [attr.aria-label]=\"label()\"\r\n [matMenuTriggerFor]=\"optionsMenu\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\r\n <div fxFlex=\"100\" fxFlexAlign=\"center\">\r\n @if(current()) {\r\n <div style=\"text-align: left;\"\r\n [style.min-width]=\"width() > 0 ? width()+'px' : (width() === -1 ? '100%' : 'auto')\">\r\n @if(labelSelected() || label()) {\r\n <div class=\"x-small \">{{labelSelected() ?? label()}}</div>\r\n <div fxHide.xs class=\"small truncated-1\">{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n <div fxHide.gt-xs class=\"x-small truncated-1\" style=\"max-width: 120px;\">\r\n <div>{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n </div>\r\n } @else {\r\n <div fxHide.xs class=\"small truncated\">{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n <div fxHide.gt-xs class=\"x-small truncated\" style=\"max-width: 120px;\">\r\n <div>{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n </div>\r\n }\r\n </div>\r\n } @else if(labelSelected() || label()) {\r\n <div class=\"truncated\" style=\"text-align: left;\"\r\n [style.min-width]=\"width() > 0 ? width()+'px' : (width() === -1 ? '100%' : 'auto')\">\r\n {{labelSelected() ?? label()}}</div>\r\n }\r\n </div>\r\n <div fxLayoutAlign=\"end\" fxFlexAlign=\"center\">\r\n <mat-icon>arrow_drop_down</mat-icon>\r\n </div>\r\n </div>\r\n</button>\r\n<mat-menu #optionsMenu=\"matMenu\">\r\n @for (o of options(); track $index) {\r\n <button mat-menu-item (click)=\"select(o)\" [disabled]=\"o.disabled\">\r\n {{o.name}}\r\n @if(o.bag) {\r\n ({{o.bag}})\r\n }\r\n </button>\r\n }\r\n</mat-menu>", styles: [".menu-selector-button{padding:0 10px 0 20px!important;border-radius:9999px!important}.menu-selector-button .in-search-bar{height:56px!important;padding:0 20px!important;border-top-left-radius:0!important;border-bottom-left-radius:0!important}::ng-deep .menu-selector-button>.mdc-button__label{width:100%!important}.truncated-1{min-width:0;max-width:100%}@supports (-webkit-line-clamp: 1){.truncated-1{overflow:hidden;text-overflow:ellipsis;white-space:initial;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}}\n"], dependencies: [{ kind: "ngmodule", type: FlexLayoutModule }, { kind: "directive", type: i2.FxLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg] ", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.FxFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg] ", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i2.FxShowHideDirective, selector: " [fxShow], [fxHide], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg] ", inputs: ["fxShow", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { kind: "directive", type: i2.FxLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg] ", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.FxLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg] ", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2.FxFlexAlignDirective, selector: " [fxFlexAlign], [fxFlexAlign.xs], [fxFlexAlign.sm], [fxFlexAlign.md], [fxFlexAlign.lg], [fxFlexAlign.xl], [fxFlexAlign.lt-sm], [fxFlexAlign.lt-md], [fxFlexAlign.lt-lg], [fxFlexAlign.lt-xl], [fxFlexAlign.gt-xs], [fxFlexAlign.gt-sm], [fxFlexAlign.gt-md], [fxFlexAlign.gt-lg] ", inputs: ["fxFlexAlign", "fxFlexAlign.xs", "fxFlexAlign.sm", "fxFlexAlign.md", "fxFlexAlign.lg", "fxFlexAlign.xl", "fxFlexAlign.lt-sm", "fxFlexAlign.lt-md", "fxFlexAlign.lt-lg", "fxFlexAlign.lt-xl", "fxFlexAlign.gt-xs", "fxFlexAlign.gt-sm", "fxFlexAlign.gt-md", "fxFlexAlign.gt-lg"] }, { kind: "directive", type: i2.FxFlexFillDirective, selector: " [fxFlexFill], [fxFill], [fxFlexFill.xs], [fxFlexFill.sm], [fxFlexFill.md], [fxFlexFill.lg], [fxFlexFill.xl], [fxFlexFill.lt-sm], [fxFlexFill.lt-md], [fxFlexFill.lt-lg], [fxFlexFill.lt-xl], [fxFlexFill.gt-xs], [fxFlexFill.gt-sm], [fxFlexFill.gt-md], [fxFlexFill.gt-lg] ", inputs: ["fxFlexFill", "fxFill", "fxFlexFill.xs", "fxFlexFill.sm", "fxFlexFill.md", "fxFlexFill.lg", "fxFlexFill.xl", "fxFlexFill.lt-sm", "fxFlexFill.lt-md", "fxFlexFill.lt-lg", "fxFlexFill.lt-xl", "fxFlexFill.gt-xs", "fxFlexFill.gt-sm", "fxFlexFill.gt-md", "fxFlexFill.gt-lg"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i5.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
198
- }
199
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ButtonSelectorComponent, decorators: [{
200
- type: Component,
201
- args: [{ selector: 'button-selector', standalone: true, imports: [FlexLayoutModule, MatIconModule, MatButtonModule,
202
- MatMenuModule], changeDetection: ChangeDetectionStrategy.OnPush, host: {
203
- '[id]': 'id',
204
- '[attr.aria-describedBy]': 'describedBy',
205
- }, template: "<button mat-stroked-button class=\"menu-selector-button\" [style.border]=\"border() >= 0 ? border() : 'auto'\"\r\n [style.border-radius]=\"borderRadius()\" [style.height]=\"border() <= 0 ? '40px' : 'auto'\"\r\n [style.min-width]=\"width() > 0 ? width()+'px' : (width() === -1 ? '100%' : 'auto')\" [attr.aria-label]=\"label()\"\r\n [matMenuTriggerFor]=\"optionsMenu\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\r\n <div fxFlex=\"100\" fxFlexAlign=\"center\">\r\n @if(current()) {\r\n <div style=\"text-align: left;\"\r\n [style.min-width]=\"width() > 0 ? width()+'px' : (width() === -1 ? '100%' : 'auto')\">\r\n @if(labelSelected() || label()) {\r\n <div class=\"x-small \">{{labelSelected() ?? label()}}</div>\r\n <div fxHide.xs class=\"small truncated-1\">{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n <div fxHide.gt-xs class=\"x-small truncated-1\" style=\"max-width: 120px;\">\r\n <div>{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n </div>\r\n } @else {\r\n <div fxHide.xs class=\"small truncated\">{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n <div fxHide.gt-xs class=\"x-small truncated\" style=\"max-width: 120px;\">\r\n <div>{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n </div>\r\n }\r\n </div>\r\n } @else if(labelSelected() || label()) {\r\n <div class=\"truncated\" style=\"text-align: left;\"\r\n [style.min-width]=\"width() > 0 ? width()+'px' : (width() === -1 ? '100%' : 'auto')\">\r\n {{labelSelected() ?? label()}}</div>\r\n }\r\n </div>\r\n <div fxLayoutAlign=\"end\" fxFlexAlign=\"center\">\r\n <mat-icon>arrow_drop_down</mat-icon>\r\n </div>\r\n </div>\r\n</button>\r\n<mat-menu #optionsMenu=\"matMenu\">\r\n @for (o of options(); track $index) {\r\n <button mat-menu-item (click)=\"select(o)\" [disabled]=\"o.disabled\">\r\n {{o.name}}\r\n @if(o.bag) {\r\n ({{o.bag}})\r\n }\r\n </button>\r\n }\r\n</mat-menu>", styles: [".menu-selector-button{padding:0 10px 0 20px!important;border-radius:9999px!important}.menu-selector-button .in-search-bar{height:56px!important;padding:0 20px!important;border-top-left-radius:0!important;border-bottom-left-radius:0!important}::ng-deep .menu-selector-button>.mdc-button__label{width:100%!important}.truncated-1{min-width:0;max-width:100%}@supports (-webkit-line-clamp: 1){.truncated-1{overflow:hidden;text-overflow:ellipsis;white-space:initial;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}}\n"] }]
206
- }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
207
- type: Optional
208
- }, {
209
- type: Self
210
- }] }], propDecorators: { changed: [{ type: i0.Output, args: ["changed"] }], selected: [{ type: i0.Output, args: ["selected"] }], disabled: [{
211
- type: Input
212
- }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], border: [{ type: i0.Input, args: [{ isSignal: true, alias: "border", required: false }] }], borderRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderRadius", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelSelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelSelected", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], autoSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoSelect", required: false }] }] } });
213
-
214
- class ButtonToggleComponent {
215
- constructor() {
216
- /** Emitted each time the button is clicked. Carries the current `value` and the new `toggled` state. */
217
- this.changed = output();
218
- /** Current value bound from the parent. Drives label and icon selection. */
219
- this.value = input(false, /* @ts-ignore */
220
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
221
- /** Width of the button in pixels. Use `-1` for automatic sizing. */
222
- this.width = input(-1, /* @ts-ignore */
223
- ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
224
- /** Border thickness override in pixels. Use `-1` to inherit. */
225
- this.border = input(-1, /* @ts-ignore */
226
- ...(ngDevMode ? [{ debugName: "border" }] : /* istanbul ignore next */ []));
227
- /** Label shown when `value` is `true`. */
228
- this.labelOn = input(undefined, /* @ts-ignore */
229
- ...(ngDevMode ? [{ debugName: "labelOn" }] : /* istanbul ignore next */ []));
230
- /** Label shown when `value` is `false`. */
231
- this.labelOff = input(undefined, /* @ts-ignore */
232
- ...(ngDevMode ? [{ debugName: "labelOff" }] : /* istanbul ignore next */ []));
233
- /** Material icon name shown when `value` is `true`. */
234
- this.iconOn = input(undefined, /* @ts-ignore */
235
- ...(ngDevMode ? [{ debugName: "iconOn" }] : /* istanbul ignore next */ []));
236
- /** Material icon name shown when `value` is `false`. */
237
- this.iconOff = input(undefined, /* @ts-ignore */
238
- ...(ngDevMode ? [{ debugName: "iconOff" }] : /* istanbul ignore next */ []));
239
- /** CSS class applied to the button at all breakpoints. */
240
- this.cssClass = input(undefined, /* @ts-ignore */
241
- ...(ngDevMode ? [{ debugName: "cssClass" }] : /* istanbul ignore next */ []));
242
- /** CSS class applied to the button on `xs` screens. */
243
- this.cssClassSmall = input(undefined, /* @ts-ignore */
244
- ...(ngDevMode ? [{ debugName: "cssClassSmall" }] : /* istanbul ignore next */ []));
245
- /** Resolves the appropriate label for the current value state. */
246
- this.label = computed(() => this.value() ? this.labelOn() ?? '' : this.labelOff() ?? '', /* @ts-ignore */
247
- ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
248
- /** Resolves the appropriate icon name for the current value state. */
249
- this.icon = computed(() => this.value() ? this.iconOn() ?? '' : this.iconOff() ?? '', /* @ts-ignore */
250
- ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
251
- }
252
- /**
253
- * Toggles the button state and emits the `changed` event.
254
- * The emitted `toggled` value is the logical inverse of the current `value`.
255
- */
256
- toggle() {
257
- const toggled = !this.value();
258
- this.changed.emit({ value: this.value(), toggled });
259
- }
260
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ButtonToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
261
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: ButtonToggleComponent, isStandalone: true, selector: "button-toggle", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, border: { classPropertyName: "border", publicName: "border", isSignal: true, isRequired: false, transformFunction: null }, labelOn: { classPropertyName: "labelOn", publicName: "labelOn", isSignal: true, isRequired: false, transformFunction: null }, labelOff: { classPropertyName: "labelOff", publicName: "labelOff", isSignal: true, isRequired: false, transformFunction: null }, iconOn: { classPropertyName: "iconOn", publicName: "iconOn", isSignal: true, isRequired: false, transformFunction: null }, iconOff: { classPropertyName: "iconOff", publicName: "iconOff", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, cssClassSmall: { classPropertyName: "cssClassSmall", publicName: "cssClassSmall", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed" }, ngImport: i0, template: "<button mat-stroked-button [style.border]=\"border() >= 0 ? border() : 'auto'\"\n [style.height]=\"border() <= 0 ? '40px' : 'auto'\" [style.minWidth.px]=\"width() > 0 ? width() : 'auto'\"\n [style.mxn-width.px]=\"width() > 0 ? width() : 'auto'\" [class]=\"cssClass()\" [attr.aria-label]=\"label()\"\n (click)=\"toggle()\" [class.button-on]=\"value() === true\" [fxClass.xs]=\"cssClassSmall()\">\n <div fxLayout=\"row\" fxLayoutGap=\"8px\" fxLayoutAlign=\"center center\" fxFill>\n @if(icon()) {\n <div fxFlex=\"24px\"><mat-icon style=\"display: block;\">{{icon()}}</mat-icon></div>\n }\n <div [innerHtml]=\"label() | safeHtml\"></div>\n </div>\n</button>", styles: [".button-on{background-color:var(--mat-switch-selected-focus-handle-color)!important;border-color:var(--mat-switch-selected-focus-handle-color)!important;font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: FlexLayoutModule }, { kind: "directive", type: i2.FxLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg] ", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.FxFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg] ", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i2.FxLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg] ", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.FxLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg] ", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2.FxFlexFillDirective, selector: " [fxFlexFill], [fxFill], [fxFlexFill.xs], [fxFlexFill.sm], [fxFlexFill.md], [fxFlexFill.lg], [fxFlexFill.xl], [fxFlexFill.lt-sm], [fxFlexFill.lt-md], [fxFlexFill.lt-lg], [fxFlexFill.lt-xl], [fxFlexFill.gt-xs], [fxFlexFill.gt-sm], [fxFlexFill.gt-md], [fxFlexFill.gt-lg] ", inputs: ["fxFlexFill", "fxFill", "fxFlexFill.xs", "fxFlexFill.sm", "fxFlexFill.md", "fxFlexFill.lg", "fxFlexFill.xl", "fxFlexFill.lt-sm", "fxFlexFill.lt-md", "fxFlexFill.lt-lg", "fxFlexFill.lt-xl", "fxFlexFill.gt-xs", "fxFlexFill.gt-sm", "fxFlexFill.gt-md", "fxFlexFill.gt-lg"] }, { kind: "directive", type: i2.FxClassDirective, selector: " [fxClass], [fxClass.xs], [fxClass.sm], [fxClass.md], [fxClass.lg], [fxClass.xl], [fxClass.lt-sm], [fxClass.lt-md], [fxClass.lt-lg], [fxClass.lt-xl], [fxClass.gt-xs], [fxClass.gt-sm], [fxClass.gt-md], [fxClass.gt-lg] ", inputs: ["fxClass", "fxClass.xs", "fxClass.sm", "fxClass.md", "fxClass.lg", "fxClass.xl", "fxClass.lt-sm", "fxClass.lt-md", "fxClass.lt-lg", "fxClass.lt-xl", "fxClass.gt-xs", "fxClass.gt-sm", "fxClass.gt-md", "fxClass.gt-lg"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: SafeHtmlPipe, name: "safeHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
262
- }
263
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ButtonToggleComponent, decorators: [{
264
- type: Component,
265
- args: [{ selector: 'button-toggle', standalone: true, imports: [FlexLayoutModule, MatIconModule, MatButtonModule, SafeHtmlPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button mat-stroked-button [style.border]=\"border() >= 0 ? border() : 'auto'\"\n [style.height]=\"border() <= 0 ? '40px' : 'auto'\" [style.minWidth.px]=\"width() > 0 ? width() : 'auto'\"\n [style.mxn-width.px]=\"width() > 0 ? width() : 'auto'\" [class]=\"cssClass()\" [attr.aria-label]=\"label()\"\n (click)=\"toggle()\" [class.button-on]=\"value() === true\" [fxClass.xs]=\"cssClassSmall()\">\n <div fxLayout=\"row\" fxLayoutGap=\"8px\" fxLayoutAlign=\"center center\" fxFill>\n @if(icon()) {\n <div fxFlex=\"24px\"><mat-icon style=\"display: block;\">{{icon()}}</mat-icon></div>\n }\n <div [innerHtml]=\"label() | safeHtml\"></div>\n </div>\n</button>", styles: [".button-on{background-color:var(--mat-switch-selected-focus-handle-color)!important;border-color:var(--mat-switch-selected-focus-handle-color)!important;font-weight:700}\n"] }]
266
- }], propDecorators: { changed: [{ type: i0.Output, args: ["changed"] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], border: [{ type: i0.Input, args: [{ isSignal: true, alias: "border", required: false }] }], labelOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelOn", required: false }] }], labelOff: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelOff", required: false }] }], iconOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconOn", required: false }] }], iconOff: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconOff", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClass", required: false }] }], cssClassSmall: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClassSmall", required: false }] }] } });
267
-
268
- class ChipsSelectorComponent {
269
- get disabled() {
270
- if (this.ngControl && this.ngControl.disabled != null) {
271
- return this.ngControl.disabled;
272
- }
273
- return this._disabled;
274
- }
275
- set disabled(value) {
276
- this._disabled = coerceBooleanProperty(value);
277
- if (this.focused) {
278
- this.focused = false;
279
- this.stateChanges.next();
280
- }
281
- }
282
- /** True when the label should float above the field (focused or has a value). */
283
- get shouldLabelFloat() {
284
- return this.focused || !this.empty;
285
- }
286
- set value(value) {
287
- this.setValue(value, true);
288
- }
289
- /**
290
- * Updates the internal state and selection mirrors.
291
- * @param value - The new selection array.
292
- * @param propagate - When `true`, notifies the registered onChange callback.
293
- */
294
- setValue(value, propagate) {
295
- this._value = value;
296
- const selection = [];
297
- if (this._value) {
298
- this.options().forEach(n => {
299
- if (this._value?.findIndex((x) => x.value === n.value) !== -1) {
300
- selection.push(n);
301
- }
302
- });
303
- }
304
- this.selection.set(selection);
305
- this.singleSelection.set(selection.length > 0 ? selection[0] : undefined);
306
- this.cdr.markForCheck();
307
- if (propagate) {
308
- this.propagateChange(this._value);
309
- }
310
- this.stateChanges.next();
311
- if (this.changesEnabled) {
312
- this.changed.emit(this._value);
313
- }
314
- }
315
- /** The current value as an array of selected items. */
316
- get value() {
317
- return this._value;
318
- }
319
- /** True when no item is selected. */
320
- get empty() {
321
- return !this._value || this._value.length === 0;
322
- }
323
- /** True when the control has validation errors and has been touched. */
324
- get errorState() {
325
- return this.ngControl?.errors != null && (this.ngControl?.touched ?? false);
326
- }
327
- constructor(ngControl) {
328
- this.ngControl = ngControl;
329
- /** Emitted when the selection changes. Carries the new array of selected items, or `undefined` when cleared. */
330
- this.changed = output();
331
- this.containerId = `chips-selector-container--${SystemUtils.generateUUID()}`;
332
- this.containerWidth = signal(-6, /* @ts-ignore */
333
- ...(ngDevMode ? [{ debugName: "containerWidth" }] : /* istanbul ignore next */ []));
334
- this.focused = false;
335
- this.stateChanges = new Subject();
336
- this.destroyRef = inject(DestroyRef);
337
- this.changesEnabled = false;
338
- this.destroyed = false;
339
- this.widthRetries = 0;
340
- /** Debounce bridge for `ResizeObserver` notifications. */
341
- this.resize$ = new Subject();
342
- /** List of available options to display as chips. */
343
- this.options = input([], /* @ts-ignore */
344
- ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
345
- /** Minimum width in pixels when collapsed. Use `-1` for automatic. */
346
- this.collapsedWidth = input(-1, /* @ts-ignore */
347
- ...(ngDevMode ? [{ debugName: "collapsedWidth" }] : /* istanbul ignore next */ []));
348
- /** Display mode used when the selector is in collapsed state. */
349
- this.collapsedDisplayMode = input('dropdown', /* @ts-ignore */
350
- ...(ngDevMode ? [{ debugName: "collapsedDisplayMode" }] : /* istanbul ignore next */ []));
351
- /** Pixel threshold below which the selector collapses. Use `-1` to disable. */
352
- this.collapseAt = input(-1, /* @ts-ignore */
353
- ...(ngDevMode ? [{ debugName: "collapseAt" }] : /* istanbul ignore next */ []));
354
- /** When `true`, `collapseAt` is compared against the container width rather than the window width. */
355
- this.collapseAtContainer = input(false, /* @ts-ignore */
356
- ...(ngDevMode ? [{ debugName: "collapseAtContainer" }] : /* istanbul ignore next */ []));
357
- this.collapsed = computed(() => {
358
- const cw = this.containerWidth();
359
- const mw = this.collapseAt();
360
- return this.mode() === 'collapsed' || (mw !== -1 && cw > 0 && mw > 0 && cw < mw);
361
- }, /* @ts-ignore */
362
- ...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
363
- /** Label shown in the dropdown / above the chip list. */
364
- this.label = input('', /* @ts-ignore */
365
- ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
366
- /** When `true`, multiple chips can be selected simultaneously. */
367
- this.multiple = input(false, /* @ts-ignore */
368
- ...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
369
- /** When `true`, at least one item must remain selected. */
370
- this.mustSelect = input(false, /* @ts-ignore */
371
- ...(ngDevMode ? [{ debugName: "mustSelect" }] : /* istanbul ignore next */ []));
372
- /** Layout mode: `'collapsed'` forces dropdown mode, `'dynamic'` collapses based on `collapseAt`. */
373
- this.mode = input('dynamic', /* @ts-ignore */
374
- ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
375
- /** When `true`, chips are stacked vertically instead of wrapping horizontally. */
376
- this.stacked = input(false, /* @ts-ignore */
377
- ...(ngDevMode ? [{ debugName: "stacked" }] : /* istanbul ignore next */ []));
378
- /** Chips below this index receive extra padding to align with other UI elements. */
379
- this.padAt = input(0, /* @ts-ignore */
380
- ...(ngDevMode ? [{ debugName: "padAt" }] : /* istanbul ignore next */ []));
381
- /** When `true`, the control is required. */
382
- this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
383
- /** Placeholder text shown when no value is selected. */
384
- this.placeholder = input('', /* @ts-ignore */
385
- ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
386
- this._disabled = false;
387
- this.id = `chips-selector--${SystemUtils.generateUUID()}`;
388
- this.describedBy = '';
389
- this._value = [];
390
- this.propagateChange = () => { };
391
- this.propagateTouched = () => { };
392
- this.renderer = inject(Renderer2);
393
- this.cdr = inject(ChangeDetectorRef);
394
- /**
395
- * Currently selected items. Kept loosely typed on purpose: in multi-select mode the
396
- * bound controls write an array, while in single-select mode mat-select / the chip
397
- * listbox write a single item; `getSelection()` normalizes both shapes.
398
- */
399
- this.selection = signal([], /* @ts-ignore */
400
- ...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
401
- /** The single selected item — used in `button` collapsed-display mode. */
402
- this.singleSelection = signal(undefined, /* @ts-ignore */
403
- ...(ngDevMode ? [{ debugName: "singleSelection" }] : /* istanbul ignore next */ []));
404
- /** Root signal form bound to the internal mat-select / chip listbox. */
405
- this.selectionForm = form(this.selection);
406
- /** Root signal form bound to the internal button-selector in `button` collapsed mode. */
407
- this.singleForm = form(this.singleSelection);
408
- if (this.ngControl != null) {
409
- this.ngControl.valueAccessor = this;
410
- }
411
- // Notify state changes whenever required or placeholder inputs change
412
- effect(() => {
413
- this.required();
414
- this.placeholder();
415
- this.stateChanges.next();
416
- });
417
- // React to container size changes to keep the collapsed state up to date.
418
- // `auditTime` on the animation-frame scheduler coalesces ResizeObserver bursts
419
- // without adding perceptible latency, and defers the layout read out of the
420
- // observer callback to avoid "ResizeObserver loop" warnings.
421
- this.resize$
422
- .pipe(takeUntilDestroyed(this.destroyRef), auditTime(0, animationFrameScheduler))
423
- .subscribe(() => {
424
- if (this.collapseAt() > 0) {
425
- this.updateContainerWidth();
426
- }
427
- });
428
- afterNextRender(() => {
429
- if (SystemUtils.isBrowser() && typeof ResizeObserver !== 'undefined') {
430
- const elem = document.getElementById(this.containerId);
431
- if (elem) {
432
- this.resizeObserver = new ResizeObserver(() => this.resize$.next());
433
- this.resizeObserver.observe(elem);
434
- }
435
- }
436
- setTimeout(() => {
437
- this.updateContainerWidth();
438
- this.changesEnabled = true;
439
- }, 250);
440
- });
441
- }
442
- ngOnDestroy() {
443
- this.destroyed = true;
444
- this.resizeObserver?.disconnect();
445
- this.stateChanges.complete();
446
- }
447
- /**
448
- * Measures the container (or window) width and updates the `containerWidth` signal,
449
- * retrying after 100 ms if the element is not yet laid out.
450
- */
451
- updateContainerWidth() {
452
- if (this.destroyed)
453
- return;
454
- const elem = document.getElementById(this.containerId);
455
- if (elem && elem.clientWidth > 0) {
456
- this.widthRetries = 0;
457
- this.containerWidth.set(this.collapseAtContainer()
458
- ? elem.clientWidth
459
- : window.innerWidth);
460
- }
461
- else if (this.widthRetries < 50) {
462
- // Bounded retry (max ~5 s): the old unbounded recursion kept running
463
- // forever, even after the component was destroyed.
464
- this.widthRetries++;
465
- setTimeout(() => this.updateContainerWidth(), 100);
466
- }
467
- }
468
- /**
469
- * Resolves the effective selection array for the current display mode.
470
- * In single-select collapsed button mode the `singleSelection` item is wrapped in an array.
471
- * @returns The array of currently selected items.
472
- */
473
- getSelection() {
474
- const value = !this.multiple() && this.collapsed() && this.collapsedDisplayMode() === 'button'
475
- ? this.singleSelection()
476
- : this.selection();
477
- if (Array.isArray(value)) {
478
- return value;
479
- }
480
- return value ? [value] : [];
481
- }
482
- /**
483
- * Schedules a value update after a short delay, coalescing rapid selection changes
484
- * before the value is propagated to the outer form.
485
- */
486
- updateValue() {
487
- setTimeout(() => {
488
- this.setValue(this.getSelection(), true);
489
- }, 250);
490
- }
491
- /**
492
- * Returns `true` when the given item can be selected in the current mode.
493
- * In single-select mode an already-selected item is not re-selectable.
494
- * @param item - The item to check.
495
- * @returns True when the item is selectable.
496
- */
497
- isSelectable(item) {
498
- return this.multiple() || this.getSelection().findIndex(x => x.value === item.value) === -1;
499
- }
500
- /**
501
- * Writes a new value to the component (called by the form layer).
502
- * @param value - The new selection to display.
503
- */
504
- writeValue(value) {
505
- const next = value;
506
- if (this.value !== next) {
507
- // Model -> view write: must NOT propagate back to the form (echo loop)
508
- this.setValue(next, false);
509
- }
510
- }
511
- /**
512
- * Registers the on-change callback (called by the form layer).
513
- * @param fn - Callback to invoke whenever the value changes.
514
- */
515
- registerOnChange(fn) {
516
- this.propagateChange = fn;
517
- }
518
- /**
519
- * Registers the on-touched callback (called by the form layer).
520
- * @param fn - Callback to invoke when the control is touched.
521
- */
522
- registerOnTouched(fn) {
523
- this.propagateTouched = fn;
524
- }
525
- /**
526
- * Sets the ARIA described-by IDs for accessibility.
527
- * @param ids - The list of element IDs to associate with this control.
528
- */
529
- setDescribedByIds(ids) {
530
- this.describedBy = ids.join(' ');
531
- }
532
- /**
533
- * Updates the disabled state when the Angular form layer changes it.
534
- * @param isDisabled - Whether the control should be disabled.
535
- */
536
- setDisabledState(isDisabled) {
537
- this._disabled = isDisabled;
538
- if (isDisabled && this.focused) {
539
- this.focused = false;
540
- this.stateChanges.next();
541
- }
542
- if (!SystemUtils.isBrowser())
543
- return;
544
- const elem = document.getElementById(this.id);
545
- if (elem) {
546
- this.renderer.setProperty(elem, 'disabled', isDisabled);
547
- }
548
- }
549
- /**
550
- * Handles a click on the container element, focusing it and marking it as touched.
551
- */
552
- onContainerClick() {
553
- if (!this.focused) {
554
- if (!SystemUtils.isBrowser())
555
- return;
556
- const elem = document.getElementById(this.id);
557
- if (elem) {
558
- elem.focus();
559
- this.propagateTouched();
560
- }
561
- }
562
- }
563
- /**
564
- * Clears the current selection and stops the event from bubbling.
565
- * @param e - The originating click event.
566
- */
567
- clear(e) {
568
- this.setValue([], true);
569
- e.stopPropagation();
570
- }
571
- /**
572
- * Selects a single item, replacing any existing selection.
573
- * @param item - The item to select. Does nothing when `undefined`.
574
- */
575
- select(item) {
576
- if (item) {
577
- this.setValue([item], true);
578
- }
579
- }
580
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ChipsSelectorComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
581
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: ChipsSelectorComponent, isStandalone: true, selector: "chips-selector", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, collapsedWidth: { classPropertyName: "collapsedWidth", publicName: "collapsedWidth", isSignal: true, isRequired: false, transformFunction: null }, collapsedDisplayMode: { classPropertyName: "collapsedDisplayMode", publicName: "collapsedDisplayMode", isSignal: true, isRequired: false, transformFunction: null }, collapseAt: { classPropertyName: "collapseAt", publicName: "collapseAt", isSignal: true, isRequired: false, transformFunction: null }, collapseAtContainer: { classPropertyName: "collapseAtContainer", publicName: "collapseAtContainer", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, mustSelect: { classPropertyName: "mustSelect", publicName: "mustSelect", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, stacked: { classPropertyName: "stacked", publicName: "stacked", isSignal: true, isRequired: false, transformFunction: null }, padAt: { classPropertyName: "padAt", publicName: "padAt", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { changed: "changed" }, host: { properties: { "id": "id", "class.floating": "shouldLabelFloat", "attr.aria-describedBy": "describedBy" } }, ngImport: i0, template: "<div [id]=\"containerId\" class=\"chips-selector\">\n @if(containerWidth() > 0) {\n @if(collapsed()) {\n @if(collapsedDisplayMode() === 'dropdown') {\n <mat-form-field [style.min-width]=\"collapsedWidth() > 0 ? collapsedWidth()+'px' : '100%'\" subscriptSizing=\"dynamic\">\n @if(label()) {\n <mat-label>{{label()}}</mat-label>\n }\n <mat-select [formField]=\"selectionForm\" [multiple]=\"multiple()\" (selectionChange)=\"updateValue()\">\n <mat-select-trigger>\n @if (value && (value.length || 0) > 0) {\n {{value[0].shortName ?? value[0].name}}\n }\n @if (value && (value.length || 0) > 1) {\n <span class=\"collapsed-additional-selection\">\n (+{{(value.length || 0) - 1}} {{value.length === 2 ? 'altro' : 'altri'}})\n </span>\n }\n </mat-select-trigger>\n @for (o of options(); track $index) {\n <mat-option [value]=\"o\" [disabled]=\"o.disabled\">\n {{o.name}}\n @if(o.bag) {\n &nbsp; ({{o.bag}})\n }\n </mat-option>\n }\n </mat-select>\n @if (value && (value.length || 0) > 0) {\n <button matSuffix tabindex=\"-1\" mat-icon-button aria-label=\"Pulisci\" (click)=\"clear($event)\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n } @else {\n <button-selector [label]=\"label()\" [options]=\"options()\" [width]=\"collapsedWidth()\" [formField]=\"singleForm\"\n (selected)=\"updateValue()\"></button-selector>\n\n }\n } @else {\n <mat-chip-listbox [class]=\"stacked() ? 'mat-mdc-chip-set-stacked' : ''\" [multiple]=\"multiple()\"\n [formField]=\"selectionForm\" (change)=\"updateValue()\">\n @for (o of options(); track $index; let i = $index) {\n <mat-chip-option [matBadge]=\"o.bag\" [matTooltip]=\"o.disabled === true ? 'Non disponibile' : (o.bagInfo ?? '')\" [selectable]=\"isSelectable(o)\" [value]=\"o\"\n [disabled]=\"o.disabled\" [class.chip-padded]=\"i < padAt()\">{{o.shortName ??\n o.name}}</mat-chip-option>\n }\n </mat-chip-listbox>\n }\n }\n</div>", styles: [".chips-selector{width:100%}.chips-selector .collapsed-additional-selection{opacity:.75;font-size:.75em}.chip-padded{margin-right:10px!important}.mdc-evolution-chip--disabled{pointer-events:auto!important}\n"], dependencies: [{ kind: "ngmodule", type: FlexLayoutModule }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i3$1.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i3$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i4$1.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i4$1.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "directive", type: i7.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: ButtonSelectorComponent, selector: "button-selector", inputs: ["disabled", "width", "border", "borderRadius", "label", "labelSelected", "options", "autoSelect"], outputs: ["changed", "selected"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
582
- }
583
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ChipsSelectorComponent, decorators: [{
584
- type: Component,
585
- args: [{ selector: 'chips-selector', standalone: true, imports: [FlexLayoutModule, FormField, MatFormFieldModule, MatSelectModule,
586
- MatChipsModule, MatIconModule, MatButtonModule, MatBadgeModule, MatTooltipModule,
587
- ButtonSelectorComponent
588
- ], changeDetection: ChangeDetectionStrategy.OnPush, host: {
589
- '[id]': 'id',
590
- '[class.floating]': 'shouldLabelFloat',
591
- '[attr.aria-describedBy]': 'describedBy',
592
- }, template: "<div [id]=\"containerId\" class=\"chips-selector\">\n @if(containerWidth() > 0) {\n @if(collapsed()) {\n @if(collapsedDisplayMode() === 'dropdown') {\n <mat-form-field [style.min-width]=\"collapsedWidth() > 0 ? collapsedWidth()+'px' : '100%'\" subscriptSizing=\"dynamic\">\n @if(label()) {\n <mat-label>{{label()}}</mat-label>\n }\n <mat-select [formField]=\"selectionForm\" [multiple]=\"multiple()\" (selectionChange)=\"updateValue()\">\n <mat-select-trigger>\n @if (value && (value.length || 0) > 0) {\n {{value[0].shortName ?? value[0].name}}\n }\n @if (value && (value.length || 0) > 1) {\n <span class=\"collapsed-additional-selection\">\n (+{{(value.length || 0) - 1}} {{value.length === 2 ? 'altro' : 'altri'}})\n </span>\n }\n </mat-select-trigger>\n @for (o of options(); track $index) {\n <mat-option [value]=\"o\" [disabled]=\"o.disabled\">\n {{o.name}}\n @if(o.bag) {\n &nbsp; ({{o.bag}})\n }\n </mat-option>\n }\n </mat-select>\n @if (value && (value.length || 0) > 0) {\n <button matSuffix tabindex=\"-1\" mat-icon-button aria-label=\"Pulisci\" (click)=\"clear($event)\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n } @else {\n <button-selector [label]=\"label()\" [options]=\"options()\" [width]=\"collapsedWidth()\" [formField]=\"singleForm\"\n (selected)=\"updateValue()\"></button-selector>\n\n }\n } @else {\n <mat-chip-listbox [class]=\"stacked() ? 'mat-mdc-chip-set-stacked' : ''\" [multiple]=\"multiple()\"\n [formField]=\"selectionForm\" (change)=\"updateValue()\">\n @for (o of options(); track $index; let i = $index) {\n <mat-chip-option [matBadge]=\"o.bag\" [matTooltip]=\"o.disabled === true ? 'Non disponibile' : (o.bagInfo ?? '')\" [selectable]=\"isSelectable(o)\" [value]=\"o\"\n [disabled]=\"o.disabled\" [class.chip-padded]=\"i < padAt()\">{{o.shortName ??\n o.name}}</mat-chip-option>\n }\n </mat-chip-listbox>\n }\n }\n</div>", styles: [".chips-selector{width:100%}.chips-selector .collapsed-additional-selection{opacity:.75;font-size:.75em}.chip-padded{margin-right:10px!important}.mdc-evolution-chip--disabled{pointer-events:auto!important}\n"] }]
593
- }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
594
- type: Optional
595
- }, {
596
- type: Self
597
- }] }], propDecorators: { changed: [{ type: i0.Output, args: ["changed"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], collapsedWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedWidth", required: false }] }], collapsedDisplayMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedDisplayMode", required: false }] }], collapseAt: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseAt", required: false }] }], collapseAtContainer: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseAtContainer", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], mustSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "mustSelect", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], stacked: [{ type: i0.Input, args: [{ isSignal: true, alias: "stacked", required: false }] }], padAt: [{ type: i0.Input, args: [{ isSignal: true, alias: "padAt", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{
598
- type: Input
599
- }] } });
600
-
601
- /*
602
- * Public API Surface of @arsedizioni/ars-utils/ui.controls
603
- *
604
- * Small form controls sharing the same Material base (button, icon, form-field). The datepicker
605
- * pieces live in `ui.controls.date` and the tree picker in `ui.controls.tree`, so that a chunk
606
- * needing one of those does not link this file, and vice versa.
607
- */
608
-
609
- /**
610
- * Generated bundle index. Do not edit.
611
- */
612
-
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, DestroyRef, Input, Optional, Renderer2, Self, afterNextRender, booleanAttribute, computed, effect, inject, input, output, signal } from "@angular/core";
3
+ import { coerceBooleanProperty } from "@angular/cdk/coercion";
4
+ import * as i4$1 from "@angular/material/button";
5
+ import { MatButtonModule } from "@angular/material/button";
6
+ import * as i3$1 from "@angular/material/icon";
7
+ import { MatIconModule } from "@angular/material/icon";
8
+ import * as i5 from "@angular/material/menu";
9
+ import { MatMenuModule } from "@angular/material/menu";
10
+ import { SafeHtmlPipe, SystemUtils } from "@arsedizioni/ars-utils/core";
11
+ import * as i2$1 from "@arsedizioni/ars-utils/ui";
12
+ import { FlexLayoutModule } from "@arsedizioni/ars-utils/ui";
13
+ import { Subject, animationFrameScheduler, auditTime } from "rxjs";
14
+ import * as i1 from "@angular/forms";
15
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
16
+ import { FormField, form } from "@angular/forms/signals";
17
+ import * as i7 from "@angular/material/badge";
18
+ import { MatBadgeModule } from "@angular/material/badge";
19
+ import * as i4 from "@angular/material/chips";
20
+ import { MatChipsModule } from "@angular/material/chips";
21
+ import * as i2 from "@angular/material/form-field";
22
+ import { MatFormFieldModule } from "@angular/material/form-field";
23
+ import * as i3 from "@angular/material/select";
24
+ import { MatSelectModule } from "@angular/material/select";
25
+ import * as i8 from "@angular/material/tooltip";
26
+ import { MatTooltipModule } from "@angular/material/tooltip";
27
+ var ButtonSelectorComponent = class ButtonSelectorComponent {
28
+ set value(value) {
29
+ this.setValue(value, true);
30
+ }
31
+ setValue(value, propagate) {
32
+ this._value = value;
33
+ if (propagate) this.propagateChange(this._value);
34
+ this.stateChanges.next();
35
+ this.changed.emit(this._value);
36
+ this.current.set(this._value);
37
+ }
38
+ get value() {
39
+ return this._value;
40
+ }
41
+ get disabled() {
42
+ if (this.ngControl && this.ngControl.disabled != null) return this.ngControl.disabled;
43
+ return this._disabled;
44
+ }
45
+ set disabled(value) {
46
+ this._disabled = coerceBooleanProperty(value);
47
+ if (this.focused) {
48
+ this.focused = false;
49
+ this.stateChanges.next();
50
+ }
51
+ }
52
+ constructor(ngControl) {
53
+ this.ngControl = ngControl;
54
+ this.changed = output();
55
+ this.selected = output();
56
+ this.stateChanges = new Subject();
57
+ this.focused = false;
58
+ this._value = void 0;
59
+ this._disabled = false;
60
+ this.propagateChange = () => {};
61
+ this.propagateTouched = () => {};
62
+ this.id = `button-selector--${SystemUtils.generateUUID()}`;
63
+ this.describedBy = "";
64
+ this.renderer = inject(Renderer2);
65
+ this.current = signal(void 0, ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
66
+ this.width = input(-1, ...ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []);
67
+ this.border = input(-1, ...ngDevMode ? [{ debugName: "border" }] : /* istanbul ignore next */ []);
68
+ this.borderRadius = input("9999px", ...ngDevMode ? [{ debugName: "borderRadius" }] : /* istanbul ignore next */ []);
69
+ this.label = input(void 0, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
70
+ this.labelSelected = input(void 0, ...ngDevMode ? [{ debugName: "labelSelected" }] : /* istanbul ignore next */ []);
71
+ this.options = input([], ...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
72
+ this.autoSelect = input(false, ...ngDevMode ? [{ debugName: "autoSelect" }] : /* istanbul ignore next */ []);
73
+ if (this.ngControl != null) this.ngControl.valueAccessor = this;
74
+ effect(() => {
75
+ if (this.autoSelect()) {
76
+ const options = this.options();
77
+ if (options.length > 0 && options[0].value !== void 0) this.current.set(options[0]);
78
+ }
79
+ });
80
+ }
81
+ ngOnDestroy() {
82
+ this.stateChanges.complete();
83
+ }
84
+ writeValue(value) {
85
+ this.setValue(value, false);
86
+ }
87
+ registerOnChange(fn) {
88
+ this.propagateChange = fn;
89
+ }
90
+ registerOnTouched(fn) {
91
+ this.propagateTouched = fn;
92
+ }
93
+ setDescribedByIds(ids) {
94
+ this.describedBy = ids.join(" ");
95
+ }
96
+ setDisabledState(isDisabled) {
97
+ this._disabled = isDisabled;
98
+ if (isDisabled && this.focused) {
99
+ this.focused = false;
100
+ this.stateChanges.next();
101
+ }
102
+ if (!SystemUtils.isBrowser()) return;
103
+ const elem = document.getElementById(this.id);
104
+ if (elem) this.renderer.setProperty(elem, "disabled", isDisabled);
105
+ }
106
+ onContainerClick() {
107
+ if (!this.focused) {
108
+ if (!SystemUtils.isBrowser()) return;
109
+ const elem = document.getElementById(this.id);
110
+ if (elem) {
111
+ elem.focus();
112
+ this.propagateTouched();
113
+ }
114
+ }
115
+ }
116
+ select(item, notify = true) {
117
+ this.setValue(item, true);
118
+ if (notify) this.selected.emit(item);
119
+ }
120
+ reset() {
121
+ this.setValue(void 0, true);
122
+ }
123
+ static {
124
+ this.ɵfac = i0.ɵɵngDeclareFactory({
125
+ minVersion: "12.0.0",
126
+ version: "22.2.1",
127
+ ngImport: i0,
128
+ type: ButtonSelectorComponent,
129
+ deps: [{
130
+ token: i1.NgControl,
131
+ optional: true,
132
+ self: true
133
+ }],
134
+ target: i0.ɵɵFactoryTarget.Component
135
+ });
136
+ }
137
+ static {
138
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
139
+ minVersion: "17.0.0",
140
+ version: "22.2.1",
141
+ type: ButtonSelectorComponent,
142
+ isStandalone: true,
143
+ selector: "button-selector",
144
+ inputs: {
145
+ disabled: {
146
+ classPropertyName: "disabled",
147
+ publicName: "disabled",
148
+ isSignal: false,
149
+ isRequired: false,
150
+ transformFunction: null
151
+ },
152
+ width: {
153
+ classPropertyName: "width",
154
+ publicName: "width",
155
+ isSignal: true,
156
+ isRequired: false,
157
+ transformFunction: null
158
+ },
159
+ border: {
160
+ classPropertyName: "border",
161
+ publicName: "border",
162
+ isSignal: true,
163
+ isRequired: false,
164
+ transformFunction: null
165
+ },
166
+ borderRadius: {
167
+ classPropertyName: "borderRadius",
168
+ publicName: "borderRadius",
169
+ isSignal: true,
170
+ isRequired: false,
171
+ transformFunction: null
172
+ },
173
+ label: {
174
+ classPropertyName: "label",
175
+ publicName: "label",
176
+ isSignal: true,
177
+ isRequired: false,
178
+ transformFunction: null
179
+ },
180
+ labelSelected: {
181
+ classPropertyName: "labelSelected",
182
+ publicName: "labelSelected",
183
+ isSignal: true,
184
+ isRequired: false,
185
+ transformFunction: null
186
+ },
187
+ options: {
188
+ classPropertyName: "options",
189
+ publicName: "options",
190
+ isSignal: true,
191
+ isRequired: false,
192
+ transformFunction: null
193
+ },
194
+ autoSelect: {
195
+ classPropertyName: "autoSelect",
196
+ publicName: "autoSelect",
197
+ isSignal: true,
198
+ isRequired: false,
199
+ transformFunction: null
200
+ }
201
+ },
202
+ outputs: {
203
+ changed: "changed",
204
+ selected: "selected"
205
+ },
206
+ host: { properties: {
207
+ "id": "id",
208
+ "attr.aria-describedBy": "describedBy"
209
+ } },
210
+ ngImport: i0,
211
+ template: "<button mat-stroked-button class=\"menu-selector-button\" [style.border]=\"border() >= 0 ? border() : 'auto'\"\r\n [style.border-radius]=\"borderRadius()\" [style.height]=\"border() <= 0 ? '40px' : 'auto'\"\r\n [style.min-width]=\"width() > 0 ? width()+'px' : (width() === -1 ? '100%' : 'auto')\" [attr.aria-label]=\"label()\"\r\n [matMenuTriggerFor]=\"optionsMenu\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\r\n <div fxFlex=\"100\" fxFlexAlign=\"center\">\r\n @if(current()) {\r\n <div style=\"text-align: left;\"\r\n [style.min-width]=\"width() > 0 ? width()+'px' : (width() === -1 ? '100%' : 'auto')\">\r\n @if(labelSelected() || label()) {\r\n <div class=\"x-small \">{{labelSelected() ?? label()}}</div>\r\n <div fxHide.xs class=\"small truncated-1\">{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n <div fxHide.gt-xs class=\"x-small truncated-1\" style=\"max-width: 120px;\">\r\n <div>{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n </div>\r\n } @else {\r\n <div fxHide.xs class=\"small truncated\">{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n <div fxHide.gt-xs class=\"x-small truncated\" style=\"max-width: 120px;\">\r\n <div>{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n </div>\r\n }\r\n </div>\r\n } @else if(labelSelected() || label()) {\r\n <div class=\"truncated\" style=\"text-align: left;\"\r\n [style.min-width]=\"width() > 0 ? width()+'px' : (width() === -1 ? '100%' : 'auto')\">\r\n {{labelSelected() ?? label()}}</div>\r\n }\r\n </div>\r\n <div fxLayoutAlign=\"end\" fxFlexAlign=\"center\">\r\n <mat-icon>arrow_drop_down</mat-icon>\r\n </div>\r\n </div>\r\n</button>\r\n<mat-menu #optionsMenu=\"matMenu\">\r\n @for (o of options(); track $index) {\r\n <button mat-menu-item (click)=\"select(o)\" [disabled]=\"o.disabled\">\r\n {{o.name}}\r\n @if(o.bag) {\r\n ({{o.bag}})\r\n }\r\n </button>\r\n }\r\n</mat-menu>",
212
+ styles: [".menu-selector-button{padding:0 10px 0 20px!important;border-radius:9999px!important}.menu-selector-button .in-search-bar{height:56px!important;padding:0 20px!important;border-top-left-radius:0!important;border-bottom-left-radius:0!important}::ng-deep .menu-selector-button>.mdc-button__label{width:100%!important}.truncated-1{min-width:0;max-width:100%}@supports (-webkit-line-clamp: 1){.truncated-1{overflow:hidden;text-overflow:ellipsis;white-space:initial;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}}\n"],
213
+ dependencies: [
214
+ {
215
+ kind: "ngmodule",
216
+ type: FlexLayoutModule
217
+ },
218
+ {
219
+ kind: "directive",
220
+ type: i2$1.FxLayoutDirective,
221
+ selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg] ",
222
+ inputs: [
223
+ "fxLayout",
224
+ "fxLayout.xs",
225
+ "fxLayout.sm",
226
+ "fxLayout.md",
227
+ "fxLayout.lg",
228
+ "fxLayout.xl",
229
+ "fxLayout.lt-sm",
230
+ "fxLayout.lt-md",
231
+ "fxLayout.lt-lg",
232
+ "fxLayout.lt-xl",
233
+ "fxLayout.gt-xs",
234
+ "fxLayout.gt-sm",
235
+ "fxLayout.gt-md",
236
+ "fxLayout.gt-lg"
237
+ ]
238
+ },
239
+ {
240
+ kind: "directive",
241
+ type: i2$1.FxFlexDirective,
242
+ selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg] ",
243
+ inputs: [
244
+ "fxFlex",
245
+ "fxFlex.xs",
246
+ "fxFlex.sm",
247
+ "fxFlex.md",
248
+ "fxFlex.lg",
249
+ "fxFlex.xl",
250
+ "fxFlex.lt-sm",
251
+ "fxFlex.lt-md",
252
+ "fxFlex.lt-lg",
253
+ "fxFlex.lt-xl",
254
+ "fxFlex.gt-xs",
255
+ "fxFlex.gt-sm",
256
+ "fxFlex.gt-md",
257
+ "fxFlex.gt-lg"
258
+ ]
259
+ },
260
+ {
261
+ kind: "directive",
262
+ type: i2$1.FxShowHideDirective,
263
+ selector: " [fxShow], [fxHide], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg] ",
264
+ inputs: [
265
+ "fxShow",
266
+ "fxShow.xs",
267
+ "fxShow.sm",
268
+ "fxShow.md",
269
+ "fxShow.lg",
270
+ "fxShow.xl",
271
+ "fxShow.lt-sm",
272
+ "fxShow.lt-md",
273
+ "fxShow.lt-lg",
274
+ "fxShow.lt-xl",
275
+ "fxShow.gt-xs",
276
+ "fxShow.gt-sm",
277
+ "fxShow.gt-md",
278
+ "fxShow.gt-lg",
279
+ "fxHide",
280
+ "fxHide.xs",
281
+ "fxHide.sm",
282
+ "fxHide.md",
283
+ "fxHide.lg",
284
+ "fxHide.xl",
285
+ "fxHide.lt-sm",
286
+ "fxHide.lt-md",
287
+ "fxHide.lt-lg",
288
+ "fxHide.lt-xl",
289
+ "fxHide.gt-xs",
290
+ "fxHide.gt-sm",
291
+ "fxHide.gt-md",
292
+ "fxHide.gt-lg"
293
+ ]
294
+ },
295
+ {
296
+ kind: "directive",
297
+ type: i2$1.FxLayoutAlignDirective,
298
+ selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg] ",
299
+ inputs: [
300
+ "fxLayoutAlign",
301
+ "fxLayoutAlign.xs",
302
+ "fxLayoutAlign.sm",
303
+ "fxLayoutAlign.md",
304
+ "fxLayoutAlign.lg",
305
+ "fxLayoutAlign.xl",
306
+ "fxLayoutAlign.lt-sm",
307
+ "fxLayoutAlign.lt-md",
308
+ "fxLayoutAlign.lt-lg",
309
+ "fxLayoutAlign.lt-xl",
310
+ "fxLayoutAlign.gt-xs",
311
+ "fxLayoutAlign.gt-sm",
312
+ "fxLayoutAlign.gt-md",
313
+ "fxLayoutAlign.gt-lg"
314
+ ]
315
+ },
316
+ {
317
+ kind: "directive",
318
+ type: i2$1.FxLayoutGapDirective,
319
+ selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg] ",
320
+ inputs: [
321
+ "fxLayoutGap",
322
+ "fxLayoutGap.xs",
323
+ "fxLayoutGap.sm",
324
+ "fxLayoutGap.md",
325
+ "fxLayoutGap.lg",
326
+ "fxLayoutGap.xl",
327
+ "fxLayoutGap.lt-sm",
328
+ "fxLayoutGap.lt-md",
329
+ "fxLayoutGap.lt-lg",
330
+ "fxLayoutGap.lt-xl",
331
+ "fxLayoutGap.gt-xs",
332
+ "fxLayoutGap.gt-sm",
333
+ "fxLayoutGap.gt-md",
334
+ "fxLayoutGap.gt-lg"
335
+ ]
336
+ },
337
+ {
338
+ kind: "directive",
339
+ type: i2$1.FxFlexAlignDirective,
340
+ selector: " [fxFlexAlign], [fxFlexAlign.xs], [fxFlexAlign.sm], [fxFlexAlign.md], [fxFlexAlign.lg], [fxFlexAlign.xl], [fxFlexAlign.lt-sm], [fxFlexAlign.lt-md], [fxFlexAlign.lt-lg], [fxFlexAlign.lt-xl], [fxFlexAlign.gt-xs], [fxFlexAlign.gt-sm], [fxFlexAlign.gt-md], [fxFlexAlign.gt-lg] ",
341
+ inputs: [
342
+ "fxFlexAlign",
343
+ "fxFlexAlign.xs",
344
+ "fxFlexAlign.sm",
345
+ "fxFlexAlign.md",
346
+ "fxFlexAlign.lg",
347
+ "fxFlexAlign.xl",
348
+ "fxFlexAlign.lt-sm",
349
+ "fxFlexAlign.lt-md",
350
+ "fxFlexAlign.lt-lg",
351
+ "fxFlexAlign.lt-xl",
352
+ "fxFlexAlign.gt-xs",
353
+ "fxFlexAlign.gt-sm",
354
+ "fxFlexAlign.gt-md",
355
+ "fxFlexAlign.gt-lg"
356
+ ]
357
+ },
358
+ {
359
+ kind: "directive",
360
+ type: i2$1.FxFlexFillDirective,
361
+ selector: " [fxFlexFill], [fxFill], [fxFlexFill.xs], [fxFlexFill.sm], [fxFlexFill.md], [fxFlexFill.lg], [fxFlexFill.xl], [fxFlexFill.lt-sm], [fxFlexFill.lt-md], [fxFlexFill.lt-lg], [fxFlexFill.lt-xl], [fxFlexFill.gt-xs], [fxFlexFill.gt-sm], [fxFlexFill.gt-md], [fxFlexFill.gt-lg] ",
362
+ inputs: [
363
+ "fxFlexFill",
364
+ "fxFill",
365
+ "fxFlexFill.xs",
366
+ "fxFlexFill.sm",
367
+ "fxFlexFill.md",
368
+ "fxFlexFill.lg",
369
+ "fxFlexFill.xl",
370
+ "fxFlexFill.lt-sm",
371
+ "fxFlexFill.lt-md",
372
+ "fxFlexFill.lt-lg",
373
+ "fxFlexFill.lt-xl",
374
+ "fxFlexFill.gt-xs",
375
+ "fxFlexFill.gt-sm",
376
+ "fxFlexFill.gt-md",
377
+ "fxFlexFill.gt-lg"
378
+ ]
379
+ },
380
+ {
381
+ kind: "ngmodule",
382
+ type: MatIconModule
383
+ },
384
+ {
385
+ kind: "component",
386
+ type: i3$1.MatIcon,
387
+ selector: "mat-icon",
388
+ inputs: [
389
+ "color",
390
+ "inline",
391
+ "svgIcon",
392
+ "fontSet",
393
+ "fontIcon"
394
+ ],
395
+ exportAs: ["matIcon"]
396
+ },
397
+ {
398
+ kind: "ngmodule",
399
+ type: MatButtonModule
400
+ },
401
+ {
402
+ kind: "component",
403
+ type: i4$1.MatButton,
404
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
405
+ inputs: ["matButton"],
406
+ exportAs: ["matButton", "matAnchor"]
407
+ },
408
+ {
409
+ kind: "ngmodule",
410
+ type: MatMenuModule
411
+ },
412
+ {
413
+ kind: "component",
414
+ type: i5.MatMenu,
415
+ selector: "mat-menu",
416
+ inputs: [
417
+ "backdropClass",
418
+ "aria-label",
419
+ "aria-labelledby",
420
+ "aria-describedby",
421
+ "xPosition",
422
+ "yPosition",
423
+ "overlapTrigger",
424
+ "hasBackdrop",
425
+ "class",
426
+ "classList"
427
+ ],
428
+ outputs: ["closed", "close"],
429
+ exportAs: ["matMenu"]
430
+ },
431
+ {
432
+ kind: "component",
433
+ type: i5.MatMenuItem,
434
+ selector: "[mat-menu-item]",
435
+ inputs: [
436
+ "role",
437
+ "disabled",
438
+ "disabledInteractive",
439
+ "disableRipple"
440
+ ],
441
+ exportAs: ["matMenuItem"]
442
+ },
443
+ {
444
+ kind: "directive",
445
+ type: i5.MatMenuTrigger,
446
+ selector: "[mat-menu-trigger-for], [matMenuTriggerFor]",
447
+ inputs: [
448
+ "mat-menu-trigger-for",
449
+ "matMenuTriggerFor",
450
+ "matMenuTriggerData",
451
+ "matMenuTriggerRestoreFocus"
452
+ ],
453
+ outputs: [
454
+ "menuOpened",
455
+ "onMenuOpen",
456
+ "menuClosed",
457
+ "onMenuClose"
458
+ ],
459
+ exportAs: ["matMenuTrigger"]
460
+ }
461
+ ],
462
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
463
+ });
464
+ }
465
+ };
466
+ i0.ɵɵngDeclareClassMetadata({
467
+ minVersion: "12.0.0",
468
+ version: "22.2.1",
469
+ ngImport: i0,
470
+ type: ButtonSelectorComponent,
471
+ decorators: [{
472
+ type: Component,
473
+ args: [{
474
+ selector: "button-selector",
475
+ standalone: true,
476
+ imports: [
477
+ FlexLayoutModule,
478
+ MatIconModule,
479
+ MatButtonModule,
480
+ MatMenuModule
481
+ ],
482
+ changeDetection: ChangeDetectionStrategy.OnPush,
483
+ host: {
484
+ "[id]": "id",
485
+ "[attr.aria-describedBy]": "describedBy"
486
+ },
487
+ template: "<button mat-stroked-button class=\"menu-selector-button\" [style.border]=\"border() >= 0 ? border() : 'auto'\"\r\n [style.border-radius]=\"borderRadius()\" [style.height]=\"border() <= 0 ? '40px' : 'auto'\"\r\n [style.min-width]=\"width() > 0 ? width()+'px' : (width() === -1 ? '100%' : 'auto')\" [attr.aria-label]=\"label()\"\r\n [matMenuTriggerFor]=\"optionsMenu\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\r\n <div fxFlex=\"100\" fxFlexAlign=\"center\">\r\n @if(current()) {\r\n <div style=\"text-align: left;\"\r\n [style.min-width]=\"width() > 0 ? width()+'px' : (width() === -1 ? '100%' : 'auto')\">\r\n @if(labelSelected() || label()) {\r\n <div class=\"x-small \">{{labelSelected() ?? label()}}</div>\r\n <div fxHide.xs class=\"small truncated-1\">{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n <div fxHide.gt-xs class=\"x-small truncated-1\" style=\"max-width: 120px;\">\r\n <div>{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n </div>\r\n } @else {\r\n <div fxHide.xs class=\"small truncated\">{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n <div fxHide.gt-xs class=\"x-small truncated\" style=\"max-width: 120px;\">\r\n <div>{{current()?.shortName ?? current()?.name ?? ''}}</div>\r\n </div>\r\n }\r\n </div>\r\n } @else if(labelSelected() || label()) {\r\n <div class=\"truncated\" style=\"text-align: left;\"\r\n [style.min-width]=\"width() > 0 ? width()+'px' : (width() === -1 ? '100%' : 'auto')\">\r\n {{labelSelected() ?? label()}}</div>\r\n }\r\n </div>\r\n <div fxLayoutAlign=\"end\" fxFlexAlign=\"center\">\r\n <mat-icon>arrow_drop_down</mat-icon>\r\n </div>\r\n </div>\r\n</button>\r\n<mat-menu #optionsMenu=\"matMenu\">\r\n @for (o of options(); track $index) {\r\n <button mat-menu-item (click)=\"select(o)\" [disabled]=\"o.disabled\">\r\n {{o.name}}\r\n @if(o.bag) {\r\n ({{o.bag}})\r\n }\r\n </button>\r\n }\r\n</mat-menu>",
488
+ styles: [".menu-selector-button{padding:0 10px 0 20px!important;border-radius:9999px!important}.menu-selector-button .in-search-bar{height:56px!important;padding:0 20px!important;border-top-left-radius:0!important;border-bottom-left-radius:0!important}::ng-deep .menu-selector-button>.mdc-button__label{width:100%!important}.truncated-1{min-width:0;max-width:100%}@supports (-webkit-line-clamp: 1){.truncated-1{overflow:hidden;text-overflow:ellipsis;white-space:initial;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}}\n"]
489
+ }]
490
+ }],
491
+ ctorParameters: () => [{
492
+ type: i1.NgControl,
493
+ decorators: [{ type: Optional }, { type: Self }]
494
+ }],
495
+ propDecorators: {
496
+ changed: [{
497
+ type: i0.Output,
498
+ args: ["changed"]
499
+ }],
500
+ selected: [{
501
+ type: i0.Output,
502
+ args: ["selected"]
503
+ }],
504
+ disabled: [{ type: Input }],
505
+ width: [{
506
+ type: i0.Input,
507
+ args: [{
508
+ isSignal: true,
509
+ alias: "width",
510
+ required: false
511
+ }]
512
+ }],
513
+ border: [{
514
+ type: i0.Input,
515
+ args: [{
516
+ isSignal: true,
517
+ alias: "border",
518
+ required: false
519
+ }]
520
+ }],
521
+ borderRadius: [{
522
+ type: i0.Input,
523
+ args: [{
524
+ isSignal: true,
525
+ alias: "borderRadius",
526
+ required: false
527
+ }]
528
+ }],
529
+ label: [{
530
+ type: i0.Input,
531
+ args: [{
532
+ isSignal: true,
533
+ alias: "label",
534
+ required: false
535
+ }]
536
+ }],
537
+ labelSelected: [{
538
+ type: i0.Input,
539
+ args: [{
540
+ isSignal: true,
541
+ alias: "labelSelected",
542
+ required: false
543
+ }]
544
+ }],
545
+ options: [{
546
+ type: i0.Input,
547
+ args: [{
548
+ isSignal: true,
549
+ alias: "options",
550
+ required: false
551
+ }]
552
+ }],
553
+ autoSelect: [{
554
+ type: i0.Input,
555
+ args: [{
556
+ isSignal: true,
557
+ alias: "autoSelect",
558
+ required: false
559
+ }]
560
+ }]
561
+ }
562
+ });
563
+ var ButtonToggleComponent = class ButtonToggleComponent {
564
+ constructor() {
565
+ this.changed = output();
566
+ this.value = input(false, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
567
+ this.width = input(-1, ...ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []);
568
+ this.border = input(-1, ...ngDevMode ? [{ debugName: "border" }] : /* istanbul ignore next */ []);
569
+ this.labelOn = input(void 0, ...ngDevMode ? [{ debugName: "labelOn" }] : /* istanbul ignore next */ []);
570
+ this.labelOff = input(void 0, ...ngDevMode ? [{ debugName: "labelOff" }] : /* istanbul ignore next */ []);
571
+ this.iconOn = input(void 0, ...ngDevMode ? [{ debugName: "iconOn" }] : /* istanbul ignore next */ []);
572
+ this.iconOff = input(void 0, ...ngDevMode ? [{ debugName: "iconOff" }] : /* istanbul ignore next */ []);
573
+ this.cssClass = input(void 0, ...ngDevMode ? [{ debugName: "cssClass" }] : /* istanbul ignore next */ []);
574
+ this.cssClassSmall = input(void 0, ...ngDevMode ? [{ debugName: "cssClassSmall" }] : /* istanbul ignore next */ []);
575
+ this.label = computed(() => this.value() ? this.labelOn() ?? "" : this.labelOff() ?? "", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
576
+ this.icon = computed(() => this.value() ? this.iconOn() ?? "" : this.iconOff() ?? "", ...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
577
+ }
578
+ toggle() {
579
+ const toggled = !this.value();
580
+ this.changed.emit({
581
+ value: this.value(),
582
+ toggled
583
+ });
584
+ }
585
+ static {
586
+ this.ɵfac = i0.ɵɵngDeclareFactory({
587
+ minVersion: "12.0.0",
588
+ version: "22.2.1",
589
+ ngImport: i0,
590
+ type: ButtonToggleComponent,
591
+ deps: [],
592
+ target: i0.ɵɵFactoryTarget.Component
593
+ });
594
+ }
595
+ static {
596
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
597
+ minVersion: "17.0.0",
598
+ version: "22.2.1",
599
+ type: ButtonToggleComponent,
600
+ isStandalone: true,
601
+ selector: "button-toggle",
602
+ inputs: {
603
+ value: {
604
+ classPropertyName: "value",
605
+ publicName: "value",
606
+ isSignal: true,
607
+ isRequired: false,
608
+ transformFunction: null
609
+ },
610
+ width: {
611
+ classPropertyName: "width",
612
+ publicName: "width",
613
+ isSignal: true,
614
+ isRequired: false,
615
+ transformFunction: null
616
+ },
617
+ border: {
618
+ classPropertyName: "border",
619
+ publicName: "border",
620
+ isSignal: true,
621
+ isRequired: false,
622
+ transformFunction: null
623
+ },
624
+ labelOn: {
625
+ classPropertyName: "labelOn",
626
+ publicName: "labelOn",
627
+ isSignal: true,
628
+ isRequired: false,
629
+ transformFunction: null
630
+ },
631
+ labelOff: {
632
+ classPropertyName: "labelOff",
633
+ publicName: "labelOff",
634
+ isSignal: true,
635
+ isRequired: false,
636
+ transformFunction: null
637
+ },
638
+ iconOn: {
639
+ classPropertyName: "iconOn",
640
+ publicName: "iconOn",
641
+ isSignal: true,
642
+ isRequired: false,
643
+ transformFunction: null
644
+ },
645
+ iconOff: {
646
+ classPropertyName: "iconOff",
647
+ publicName: "iconOff",
648
+ isSignal: true,
649
+ isRequired: false,
650
+ transformFunction: null
651
+ },
652
+ cssClass: {
653
+ classPropertyName: "cssClass",
654
+ publicName: "cssClass",
655
+ isSignal: true,
656
+ isRequired: false,
657
+ transformFunction: null
658
+ },
659
+ cssClassSmall: {
660
+ classPropertyName: "cssClassSmall",
661
+ publicName: "cssClassSmall",
662
+ isSignal: true,
663
+ isRequired: false,
664
+ transformFunction: null
665
+ }
666
+ },
667
+ outputs: { changed: "changed" },
668
+ ngImport: i0,
669
+ template: "<button mat-stroked-button [style.border]=\"border() >= 0 ? border() : 'auto'\"\n [style.height]=\"border() <= 0 ? '40px' : 'auto'\" [style.minWidth.px]=\"width() > 0 ? width() : 'auto'\"\n [style.mxn-width.px]=\"width() > 0 ? width() : 'auto'\" [class]=\"cssClass()\" [attr.aria-label]=\"label()\"\n (click)=\"toggle()\" [class.button-on]=\"value() === true\" [fxClass.xs]=\"cssClassSmall()\">\n <div fxLayout=\"row\" fxLayoutGap=\"8px\" fxLayoutAlign=\"center center\" fxFill>\n @if(icon()) {\n <div fxFlex=\"24px\"><mat-icon style=\"display: block;\">{{icon()}}</mat-icon></div>\n }\n <div [innerHtml]=\"label() | safeHtml\"></div>\n </div>\n</button>",
670
+ styles: [".button-on{background-color:var(--mat-switch-selected-focus-handle-color)!important;border-color:var(--mat-switch-selected-focus-handle-color)!important;font-weight:700}\n"],
671
+ dependencies: [
672
+ {
673
+ kind: "ngmodule",
674
+ type: FlexLayoutModule
675
+ },
676
+ {
677
+ kind: "directive",
678
+ type: i2$1.FxLayoutDirective,
679
+ selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg] ",
680
+ inputs: [
681
+ "fxLayout",
682
+ "fxLayout.xs",
683
+ "fxLayout.sm",
684
+ "fxLayout.md",
685
+ "fxLayout.lg",
686
+ "fxLayout.xl",
687
+ "fxLayout.lt-sm",
688
+ "fxLayout.lt-md",
689
+ "fxLayout.lt-lg",
690
+ "fxLayout.lt-xl",
691
+ "fxLayout.gt-xs",
692
+ "fxLayout.gt-sm",
693
+ "fxLayout.gt-md",
694
+ "fxLayout.gt-lg"
695
+ ]
696
+ },
697
+ {
698
+ kind: "directive",
699
+ type: i2$1.FxFlexDirective,
700
+ selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg] ",
701
+ inputs: [
702
+ "fxFlex",
703
+ "fxFlex.xs",
704
+ "fxFlex.sm",
705
+ "fxFlex.md",
706
+ "fxFlex.lg",
707
+ "fxFlex.xl",
708
+ "fxFlex.lt-sm",
709
+ "fxFlex.lt-md",
710
+ "fxFlex.lt-lg",
711
+ "fxFlex.lt-xl",
712
+ "fxFlex.gt-xs",
713
+ "fxFlex.gt-sm",
714
+ "fxFlex.gt-md",
715
+ "fxFlex.gt-lg"
716
+ ]
717
+ },
718
+ {
719
+ kind: "directive",
720
+ type: i2$1.FxLayoutAlignDirective,
721
+ selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg] ",
722
+ inputs: [
723
+ "fxLayoutAlign",
724
+ "fxLayoutAlign.xs",
725
+ "fxLayoutAlign.sm",
726
+ "fxLayoutAlign.md",
727
+ "fxLayoutAlign.lg",
728
+ "fxLayoutAlign.xl",
729
+ "fxLayoutAlign.lt-sm",
730
+ "fxLayoutAlign.lt-md",
731
+ "fxLayoutAlign.lt-lg",
732
+ "fxLayoutAlign.lt-xl",
733
+ "fxLayoutAlign.gt-xs",
734
+ "fxLayoutAlign.gt-sm",
735
+ "fxLayoutAlign.gt-md",
736
+ "fxLayoutAlign.gt-lg"
737
+ ]
738
+ },
739
+ {
740
+ kind: "directive",
741
+ type: i2$1.FxLayoutGapDirective,
742
+ selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg] ",
743
+ inputs: [
744
+ "fxLayoutGap",
745
+ "fxLayoutGap.xs",
746
+ "fxLayoutGap.sm",
747
+ "fxLayoutGap.md",
748
+ "fxLayoutGap.lg",
749
+ "fxLayoutGap.xl",
750
+ "fxLayoutGap.lt-sm",
751
+ "fxLayoutGap.lt-md",
752
+ "fxLayoutGap.lt-lg",
753
+ "fxLayoutGap.lt-xl",
754
+ "fxLayoutGap.gt-xs",
755
+ "fxLayoutGap.gt-sm",
756
+ "fxLayoutGap.gt-md",
757
+ "fxLayoutGap.gt-lg"
758
+ ]
759
+ },
760
+ {
761
+ kind: "directive",
762
+ type: i2$1.FxFlexFillDirective,
763
+ selector: " [fxFlexFill], [fxFill], [fxFlexFill.xs], [fxFlexFill.sm], [fxFlexFill.md], [fxFlexFill.lg], [fxFlexFill.xl], [fxFlexFill.lt-sm], [fxFlexFill.lt-md], [fxFlexFill.lt-lg], [fxFlexFill.lt-xl], [fxFlexFill.gt-xs], [fxFlexFill.gt-sm], [fxFlexFill.gt-md], [fxFlexFill.gt-lg] ",
764
+ inputs: [
765
+ "fxFlexFill",
766
+ "fxFill",
767
+ "fxFlexFill.xs",
768
+ "fxFlexFill.sm",
769
+ "fxFlexFill.md",
770
+ "fxFlexFill.lg",
771
+ "fxFlexFill.xl",
772
+ "fxFlexFill.lt-sm",
773
+ "fxFlexFill.lt-md",
774
+ "fxFlexFill.lt-lg",
775
+ "fxFlexFill.lt-xl",
776
+ "fxFlexFill.gt-xs",
777
+ "fxFlexFill.gt-sm",
778
+ "fxFlexFill.gt-md",
779
+ "fxFlexFill.gt-lg"
780
+ ]
781
+ },
782
+ {
783
+ kind: "directive",
784
+ type: i2$1.FxClassDirective,
785
+ selector: " [fxClass], [fxClass.xs], [fxClass.sm], [fxClass.md], [fxClass.lg], [fxClass.xl], [fxClass.lt-sm], [fxClass.lt-md], [fxClass.lt-lg], [fxClass.lt-xl], [fxClass.gt-xs], [fxClass.gt-sm], [fxClass.gt-md], [fxClass.gt-lg] ",
786
+ inputs: [
787
+ "fxClass",
788
+ "fxClass.xs",
789
+ "fxClass.sm",
790
+ "fxClass.md",
791
+ "fxClass.lg",
792
+ "fxClass.xl",
793
+ "fxClass.lt-sm",
794
+ "fxClass.lt-md",
795
+ "fxClass.lt-lg",
796
+ "fxClass.lt-xl",
797
+ "fxClass.gt-xs",
798
+ "fxClass.gt-sm",
799
+ "fxClass.gt-md",
800
+ "fxClass.gt-lg"
801
+ ]
802
+ },
803
+ {
804
+ kind: "ngmodule",
805
+ type: MatIconModule
806
+ },
807
+ {
808
+ kind: "component",
809
+ type: i3$1.MatIcon,
810
+ selector: "mat-icon",
811
+ inputs: [
812
+ "color",
813
+ "inline",
814
+ "svgIcon",
815
+ "fontSet",
816
+ "fontIcon"
817
+ ],
818
+ exportAs: ["matIcon"]
819
+ },
820
+ {
821
+ kind: "ngmodule",
822
+ type: MatButtonModule
823
+ },
824
+ {
825
+ kind: "component",
826
+ type: i4$1.MatButton,
827
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
828
+ inputs: ["matButton"],
829
+ exportAs: ["matButton", "matAnchor"]
830
+ },
831
+ {
832
+ kind: "pipe",
833
+ type: SafeHtmlPipe,
834
+ name: "safeHtml"
835
+ }
836
+ ],
837
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
838
+ });
839
+ }
840
+ };
841
+ i0.ɵɵngDeclareClassMetadata({
842
+ minVersion: "12.0.0",
843
+ version: "22.2.1",
844
+ ngImport: i0,
845
+ type: ButtonToggleComponent,
846
+ decorators: [{
847
+ type: Component,
848
+ args: [{
849
+ selector: "button-toggle",
850
+ standalone: true,
851
+ imports: [
852
+ FlexLayoutModule,
853
+ MatIconModule,
854
+ MatButtonModule,
855
+ SafeHtmlPipe
856
+ ],
857
+ changeDetection: ChangeDetectionStrategy.OnPush,
858
+ template: "<button mat-stroked-button [style.border]=\"border() >= 0 ? border() : 'auto'\"\n [style.height]=\"border() <= 0 ? '40px' : 'auto'\" [style.minWidth.px]=\"width() > 0 ? width() : 'auto'\"\n [style.mxn-width.px]=\"width() > 0 ? width() : 'auto'\" [class]=\"cssClass()\" [attr.aria-label]=\"label()\"\n (click)=\"toggle()\" [class.button-on]=\"value() === true\" [fxClass.xs]=\"cssClassSmall()\">\n <div fxLayout=\"row\" fxLayoutGap=\"8px\" fxLayoutAlign=\"center center\" fxFill>\n @if(icon()) {\n <div fxFlex=\"24px\"><mat-icon style=\"display: block;\">{{icon()}}</mat-icon></div>\n }\n <div [innerHtml]=\"label() | safeHtml\"></div>\n </div>\n</button>",
859
+ styles: [".button-on{background-color:var(--mat-switch-selected-focus-handle-color)!important;border-color:var(--mat-switch-selected-focus-handle-color)!important;font-weight:700}\n"]
860
+ }]
861
+ }],
862
+ propDecorators: {
863
+ changed: [{
864
+ type: i0.Output,
865
+ args: ["changed"]
866
+ }],
867
+ value: [{
868
+ type: i0.Input,
869
+ args: [{
870
+ isSignal: true,
871
+ alias: "value",
872
+ required: false
873
+ }]
874
+ }],
875
+ width: [{
876
+ type: i0.Input,
877
+ args: [{
878
+ isSignal: true,
879
+ alias: "width",
880
+ required: false
881
+ }]
882
+ }],
883
+ border: [{
884
+ type: i0.Input,
885
+ args: [{
886
+ isSignal: true,
887
+ alias: "border",
888
+ required: false
889
+ }]
890
+ }],
891
+ labelOn: [{
892
+ type: i0.Input,
893
+ args: [{
894
+ isSignal: true,
895
+ alias: "labelOn",
896
+ required: false
897
+ }]
898
+ }],
899
+ labelOff: [{
900
+ type: i0.Input,
901
+ args: [{
902
+ isSignal: true,
903
+ alias: "labelOff",
904
+ required: false
905
+ }]
906
+ }],
907
+ iconOn: [{
908
+ type: i0.Input,
909
+ args: [{
910
+ isSignal: true,
911
+ alias: "iconOn",
912
+ required: false
913
+ }]
914
+ }],
915
+ iconOff: [{
916
+ type: i0.Input,
917
+ args: [{
918
+ isSignal: true,
919
+ alias: "iconOff",
920
+ required: false
921
+ }]
922
+ }],
923
+ cssClass: [{
924
+ type: i0.Input,
925
+ args: [{
926
+ isSignal: true,
927
+ alias: "cssClass",
928
+ required: false
929
+ }]
930
+ }],
931
+ cssClassSmall: [{
932
+ type: i0.Input,
933
+ args: [{
934
+ isSignal: true,
935
+ alias: "cssClassSmall",
936
+ required: false
937
+ }]
938
+ }]
939
+ }
940
+ });
941
+ var ChipsSelectorComponent = class ChipsSelectorComponent {
942
+ get disabled() {
943
+ if (this.ngControl && this.ngControl.disabled != null) return this.ngControl.disabled;
944
+ return this._disabled;
945
+ }
946
+ set disabled(value) {
947
+ this._disabled = coerceBooleanProperty(value);
948
+ if (this.focused) {
949
+ this.focused = false;
950
+ this.stateChanges.next();
951
+ }
952
+ }
953
+ get shouldLabelFloat() {
954
+ return this.focused || !this.empty;
955
+ }
956
+ set value(value) {
957
+ this.setValue(value, true);
958
+ }
959
+ setValue(value, propagate) {
960
+ this._value = value;
961
+ const selection = [];
962
+ if (this._value) this.options().forEach((n) => {
963
+ if (this._value?.findIndex((x) => x.value === n.value) !== -1) selection.push(n);
964
+ });
965
+ this.selection.set(selection);
966
+ this.singleSelection.set(selection.length > 0 ? selection[0] : void 0);
967
+ this.cdr.markForCheck();
968
+ if (propagate) this.propagateChange(this._value);
969
+ this.stateChanges.next();
970
+ if (this.changesEnabled) this.changed.emit(this._value);
971
+ }
972
+ get value() {
973
+ return this._value;
974
+ }
975
+ get empty() {
976
+ return !this._value || this._value.length === 0;
977
+ }
978
+ get errorState() {
979
+ return this.ngControl?.errors != null && (this.ngControl?.touched ?? false);
980
+ }
981
+ constructor(ngControl) {
982
+ this.ngControl = ngControl;
983
+ this.changed = output();
984
+ this.containerId = `chips-selector-container--${SystemUtils.generateUUID()}`;
985
+ this.containerWidth = signal(-6, ...ngDevMode ? [{ debugName: "containerWidth" }] : /* istanbul ignore next */ []);
986
+ this.focused = false;
987
+ this.stateChanges = new Subject();
988
+ this.destroyRef = inject(DestroyRef);
989
+ this.changesEnabled = false;
990
+ this.destroyed = false;
991
+ this.widthRetries = 0;
992
+ this.resize$ = new Subject();
993
+ this.options = input([], ...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
994
+ this.collapsedWidth = input(-1, ...ngDevMode ? [{ debugName: "collapsedWidth" }] : /* istanbul ignore next */ []);
995
+ this.collapsedDisplayMode = input("dropdown", ...ngDevMode ? [{ debugName: "collapsedDisplayMode" }] : /* istanbul ignore next */ []);
996
+ this.collapseAt = input(-1, ...ngDevMode ? [{ debugName: "collapseAt" }] : /* istanbul ignore next */ []);
997
+ this.collapseAtContainer = input(false, ...ngDevMode ? [{ debugName: "collapseAtContainer" }] : /* istanbul ignore next */ []);
998
+ this.collapsed = computed(() => {
999
+ const cw = this.containerWidth();
1000
+ const mw = this.collapseAt();
1001
+ return this.mode() === "collapsed" || mw !== -1 && cw > 0 && mw > 0 && cw < mw;
1002
+ }, ...ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []);
1003
+ this.label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
1004
+ this.multiple = input(false, ...ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []);
1005
+ this.mustSelect = input(false, ...ngDevMode ? [{ debugName: "mustSelect" }] : /* istanbul ignore next */ []);
1006
+ this.mode = input("dynamic", ...ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []);
1007
+ this.stacked = input(false, ...ngDevMode ? [{ debugName: "stacked" }] : /* istanbul ignore next */ []);
1008
+ this.padAt = input(0, ...ngDevMode ? [{ debugName: "padAt" }] : /* istanbul ignore next */ []);
1009
+ this.required = input(false, {
1010
+ ...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
1011
+ transform: booleanAttribute
1012
+ });
1013
+ this.placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
1014
+ this._disabled = false;
1015
+ this.id = `chips-selector--${SystemUtils.generateUUID()}`;
1016
+ this.describedBy = "";
1017
+ this._value = [];
1018
+ this.propagateChange = () => {};
1019
+ this.propagateTouched = () => {};
1020
+ this.renderer = inject(Renderer2);
1021
+ this.cdr = inject(ChangeDetectorRef);
1022
+ this.selection = signal([], ...ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []);
1023
+ this.singleSelection = signal(void 0, ...ngDevMode ? [{ debugName: "singleSelection" }] : /* istanbul ignore next */ []);
1024
+ this.selectionForm = form(this.selection);
1025
+ this.singleForm = form(this.singleSelection);
1026
+ if (this.ngControl != null) this.ngControl.valueAccessor = this;
1027
+ effect(() => {
1028
+ this.required();
1029
+ this.placeholder();
1030
+ this.stateChanges.next();
1031
+ });
1032
+ this.resize$.pipe(takeUntilDestroyed(this.destroyRef), auditTime(0, animationFrameScheduler)).subscribe(() => {
1033
+ if (this.collapseAt() > 0) this.updateContainerWidth();
1034
+ });
1035
+ afterNextRender(() => {
1036
+ if (SystemUtils.isBrowser() && typeof ResizeObserver !== "undefined") {
1037
+ const elem = document.getElementById(this.containerId);
1038
+ if (elem) {
1039
+ this.resizeObserver = new ResizeObserver(() => this.resize$.next());
1040
+ this.resizeObserver.observe(elem);
1041
+ }
1042
+ }
1043
+ setTimeout(() => {
1044
+ this.updateContainerWidth();
1045
+ this.changesEnabled = true;
1046
+ }, 250);
1047
+ });
1048
+ }
1049
+ ngOnDestroy() {
1050
+ this.destroyed = true;
1051
+ this.resizeObserver?.disconnect();
1052
+ this.stateChanges.complete();
1053
+ }
1054
+ updateContainerWidth() {
1055
+ if (this.destroyed) return;
1056
+ const elem = document.getElementById(this.containerId);
1057
+ if (elem && elem.clientWidth > 0) {
1058
+ this.widthRetries = 0;
1059
+ this.containerWidth.set(this.collapseAtContainer() ? elem.clientWidth : window.innerWidth);
1060
+ } else if (this.widthRetries < 50) {
1061
+ this.widthRetries++;
1062
+ setTimeout(() => this.updateContainerWidth(), 100);
1063
+ }
1064
+ }
1065
+ getSelection() {
1066
+ const value = !this.multiple() && this.collapsed() && this.collapsedDisplayMode() === "button" ? this.singleSelection() : this.selection();
1067
+ if (Array.isArray(value)) return value;
1068
+ return value ? [value] : [];
1069
+ }
1070
+ updateValue() {
1071
+ setTimeout(() => {
1072
+ this.setValue(this.getSelection(), true);
1073
+ }, 250);
1074
+ }
1075
+ isSelectable(item) {
1076
+ return this.multiple() || this.getSelection().findIndex((x) => x.value === item.value) === -1;
1077
+ }
1078
+ writeValue(value) {
1079
+ const next = value;
1080
+ if (this.value !== next) this.setValue(next, false);
1081
+ }
1082
+ registerOnChange(fn) {
1083
+ this.propagateChange = fn;
1084
+ }
1085
+ registerOnTouched(fn) {
1086
+ this.propagateTouched = fn;
1087
+ }
1088
+ setDescribedByIds(ids) {
1089
+ this.describedBy = ids.join(" ");
1090
+ }
1091
+ setDisabledState(isDisabled) {
1092
+ this._disabled = isDisabled;
1093
+ if (isDisabled && this.focused) {
1094
+ this.focused = false;
1095
+ this.stateChanges.next();
1096
+ }
1097
+ if (!SystemUtils.isBrowser()) return;
1098
+ const elem = document.getElementById(this.id);
1099
+ if (elem) this.renderer.setProperty(elem, "disabled", isDisabled);
1100
+ }
1101
+ onContainerClick() {
1102
+ if (!this.focused) {
1103
+ if (!SystemUtils.isBrowser()) return;
1104
+ const elem = document.getElementById(this.id);
1105
+ if (elem) {
1106
+ elem.focus();
1107
+ this.propagateTouched();
1108
+ }
1109
+ }
1110
+ }
1111
+ clear(e) {
1112
+ this.setValue([], true);
1113
+ e.stopPropagation();
1114
+ }
1115
+ select(item) {
1116
+ if (item) this.setValue([item], true);
1117
+ }
1118
+ static {
1119
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1120
+ minVersion: "12.0.0",
1121
+ version: "22.2.1",
1122
+ ngImport: i0,
1123
+ type: ChipsSelectorComponent,
1124
+ deps: [{
1125
+ token: i1.NgControl,
1126
+ optional: true,
1127
+ self: true
1128
+ }],
1129
+ target: i0.ɵɵFactoryTarget.Component
1130
+ });
1131
+ }
1132
+ static {
1133
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1134
+ minVersion: "17.0.0",
1135
+ version: "22.2.1",
1136
+ type: ChipsSelectorComponent,
1137
+ isStandalone: true,
1138
+ selector: "chips-selector",
1139
+ inputs: {
1140
+ options: {
1141
+ classPropertyName: "options",
1142
+ publicName: "options",
1143
+ isSignal: true,
1144
+ isRequired: false,
1145
+ transformFunction: null
1146
+ },
1147
+ collapsedWidth: {
1148
+ classPropertyName: "collapsedWidth",
1149
+ publicName: "collapsedWidth",
1150
+ isSignal: true,
1151
+ isRequired: false,
1152
+ transformFunction: null
1153
+ },
1154
+ collapsedDisplayMode: {
1155
+ classPropertyName: "collapsedDisplayMode",
1156
+ publicName: "collapsedDisplayMode",
1157
+ isSignal: true,
1158
+ isRequired: false,
1159
+ transformFunction: null
1160
+ },
1161
+ collapseAt: {
1162
+ classPropertyName: "collapseAt",
1163
+ publicName: "collapseAt",
1164
+ isSignal: true,
1165
+ isRequired: false,
1166
+ transformFunction: null
1167
+ },
1168
+ collapseAtContainer: {
1169
+ classPropertyName: "collapseAtContainer",
1170
+ publicName: "collapseAtContainer",
1171
+ isSignal: true,
1172
+ isRequired: false,
1173
+ transformFunction: null
1174
+ },
1175
+ label: {
1176
+ classPropertyName: "label",
1177
+ publicName: "label",
1178
+ isSignal: true,
1179
+ isRequired: false,
1180
+ transformFunction: null
1181
+ },
1182
+ multiple: {
1183
+ classPropertyName: "multiple",
1184
+ publicName: "multiple",
1185
+ isSignal: true,
1186
+ isRequired: false,
1187
+ transformFunction: null
1188
+ },
1189
+ mustSelect: {
1190
+ classPropertyName: "mustSelect",
1191
+ publicName: "mustSelect",
1192
+ isSignal: true,
1193
+ isRequired: false,
1194
+ transformFunction: null
1195
+ },
1196
+ mode: {
1197
+ classPropertyName: "mode",
1198
+ publicName: "mode",
1199
+ isSignal: true,
1200
+ isRequired: false,
1201
+ transformFunction: null
1202
+ },
1203
+ stacked: {
1204
+ classPropertyName: "stacked",
1205
+ publicName: "stacked",
1206
+ isSignal: true,
1207
+ isRequired: false,
1208
+ transformFunction: null
1209
+ },
1210
+ padAt: {
1211
+ classPropertyName: "padAt",
1212
+ publicName: "padAt",
1213
+ isSignal: true,
1214
+ isRequired: false,
1215
+ transformFunction: null
1216
+ },
1217
+ required: {
1218
+ classPropertyName: "required",
1219
+ publicName: "required",
1220
+ isSignal: true,
1221
+ isRequired: false,
1222
+ transformFunction: null
1223
+ },
1224
+ placeholder: {
1225
+ classPropertyName: "placeholder",
1226
+ publicName: "placeholder",
1227
+ isSignal: true,
1228
+ isRequired: false,
1229
+ transformFunction: null
1230
+ },
1231
+ disabled: {
1232
+ classPropertyName: "disabled",
1233
+ publicName: "disabled",
1234
+ isSignal: false,
1235
+ isRequired: false,
1236
+ transformFunction: null
1237
+ }
1238
+ },
1239
+ outputs: { changed: "changed" },
1240
+ host: { properties: {
1241
+ "id": "id",
1242
+ "class.floating": "shouldLabelFloat",
1243
+ "attr.aria-describedBy": "describedBy"
1244
+ } },
1245
+ ngImport: i0,
1246
+ template: "<div [id]=\"containerId\" class=\"chips-selector\">\n @if(containerWidth() > 0) {\n @if(collapsed()) {\n @if(collapsedDisplayMode() === 'dropdown') {\n <mat-form-field [style.min-width]=\"collapsedWidth() > 0 ? collapsedWidth()+'px' : '100%'\" subscriptSizing=\"dynamic\">\n @if(label()) {\n <mat-label>{{label()}}</mat-label>\n }\n <mat-select [formField]=\"selectionForm\" [multiple]=\"multiple()\" (selectionChange)=\"updateValue()\">\n <mat-select-trigger>\n @if (value && (value.length || 0) > 0) {\n {{value[0].shortName ?? value[0].name}}\n }\n @if (value && (value.length || 0) > 1) {\n <span class=\"collapsed-additional-selection\">\n (+{{(value.length || 0) - 1}} {{value.length === 2 ? 'altro' : 'altri'}})\n </span>\n }\n </mat-select-trigger>\n @for (o of options(); track $index) {\n <mat-option [value]=\"o\" [disabled]=\"o.disabled\">\n {{o.name}}\n @if(o.bag) {\n &nbsp; ({{o.bag}})\n }\n </mat-option>\n }\n </mat-select>\n @if (value && (value.length || 0) > 0) {\n <button matSuffix tabindex=\"-1\" mat-icon-button aria-label=\"Pulisci\" (click)=\"clear($event)\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n } @else {\n <button-selector [label]=\"label()\" [options]=\"options()\" [width]=\"collapsedWidth()\" [formField]=\"singleForm\"\n (selected)=\"updateValue()\"></button-selector>\n\n }\n } @else {\n <mat-chip-listbox [class]=\"stacked() ? 'mat-mdc-chip-set-stacked' : ''\" [multiple]=\"multiple()\"\n [formField]=\"selectionForm\" (change)=\"updateValue()\">\n @for (o of options(); track $index; let i = $index) {\n <mat-chip-option [matBadge]=\"o.bag\" [matTooltip]=\"o.disabled === true ? 'Non disponibile' : (o.bagInfo ?? '')\" [selectable]=\"isSelectable(o)\" [value]=\"o\"\n [disabled]=\"o.disabled\" [class.chip-padded]=\"i < padAt()\">{{o.shortName ??\n o.name}}</mat-chip-option>\n }\n </mat-chip-listbox>\n }\n }\n</div>",
1247
+ styles: [".chips-selector{width:100%}.chips-selector .collapsed-additional-selection{opacity:.75;font-size:.75em}.chip-padded{margin-right:10px!important}.mdc-evolution-chip--disabled{pointer-events:auto!important}\n"],
1248
+ dependencies: [
1249
+ {
1250
+ kind: "ngmodule",
1251
+ type: FlexLayoutModule
1252
+ },
1253
+ {
1254
+ kind: "directive",
1255
+ type: FormField,
1256
+ selector: "[formField]",
1257
+ inputs: ["formField"],
1258
+ exportAs: ["formField"]
1259
+ },
1260
+ {
1261
+ kind: "ngmodule",
1262
+ type: MatFormFieldModule
1263
+ },
1264
+ {
1265
+ kind: "component",
1266
+ type: i2.MatFormField,
1267
+ selector: "mat-form-field",
1268
+ inputs: [
1269
+ "hideRequiredMarker",
1270
+ "color",
1271
+ "floatLabel",
1272
+ "appearance",
1273
+ "subscriptSizing",
1274
+ "hintLabel"
1275
+ ],
1276
+ exportAs: ["matFormField"]
1277
+ },
1278
+ {
1279
+ kind: "directive",
1280
+ type: i2.MatLabel,
1281
+ selector: "mat-label"
1282
+ },
1283
+ {
1284
+ kind: "directive",
1285
+ type: i2.MatSuffix,
1286
+ selector: "[matSuffix], [matIconSuffix], [matTextSuffix]",
1287
+ inputs: ["matTextSuffix"]
1288
+ },
1289
+ {
1290
+ kind: "ngmodule",
1291
+ type: MatSelectModule
1292
+ },
1293
+ {
1294
+ kind: "component",
1295
+ type: i3.MatSelect,
1296
+ selector: "mat-select",
1297
+ inputs: [
1298
+ "aria-describedby",
1299
+ "panelClass",
1300
+ "disabled",
1301
+ "disableRipple",
1302
+ "tabIndex",
1303
+ "hideSingleSelectionIndicator",
1304
+ "placeholder",
1305
+ "required",
1306
+ "multiple",
1307
+ "disableOptionCentering",
1308
+ "compareWith",
1309
+ "value",
1310
+ "aria-label",
1311
+ "aria-labelledby",
1312
+ "errorStateMatcher",
1313
+ "typeaheadDebounceInterval",
1314
+ "sortComparator",
1315
+ "id",
1316
+ "panelWidth",
1317
+ "canSelectNullableOptions"
1318
+ ],
1319
+ outputs: [
1320
+ "openedChange",
1321
+ "opened",
1322
+ "closed",
1323
+ "selectionChange",
1324
+ "valueChange"
1325
+ ],
1326
+ exportAs: ["matSelect"]
1327
+ },
1328
+ {
1329
+ kind: "directive",
1330
+ type: i3.MatSelectTrigger,
1331
+ selector: "mat-select-trigger"
1332
+ },
1333
+ {
1334
+ kind: "component",
1335
+ type: i3.MatOption,
1336
+ selector: "mat-option",
1337
+ inputs: [
1338
+ "value",
1339
+ "id",
1340
+ "disabled"
1341
+ ],
1342
+ outputs: ["onSelectionChange"],
1343
+ exportAs: ["matOption"]
1344
+ },
1345
+ {
1346
+ kind: "ngmodule",
1347
+ type: MatChipsModule
1348
+ },
1349
+ {
1350
+ kind: "component",
1351
+ type: i4.MatChipListbox,
1352
+ selector: "mat-chip-listbox",
1353
+ inputs: [
1354
+ "multiple",
1355
+ "aria-orientation",
1356
+ "selectable",
1357
+ "compareWith",
1358
+ "required",
1359
+ "hideSingleSelectionIndicator",
1360
+ "value"
1361
+ ],
1362
+ outputs: ["change"]
1363
+ },
1364
+ {
1365
+ kind: "component",
1366
+ type: i4.MatChipOption,
1367
+ selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]",
1368
+ inputs: ["selectable", "selected"],
1369
+ outputs: ["selectionChange"]
1370
+ },
1371
+ {
1372
+ kind: "ngmodule",
1373
+ type: MatIconModule
1374
+ },
1375
+ {
1376
+ kind: "component",
1377
+ type: i3$1.MatIcon,
1378
+ selector: "mat-icon",
1379
+ inputs: [
1380
+ "color",
1381
+ "inline",
1382
+ "svgIcon",
1383
+ "fontSet",
1384
+ "fontIcon"
1385
+ ],
1386
+ exportAs: ["matIcon"]
1387
+ },
1388
+ {
1389
+ kind: "ngmodule",
1390
+ type: MatButtonModule
1391
+ },
1392
+ {
1393
+ kind: "component",
1394
+ type: i4$1.MatIconButton,
1395
+ selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
1396
+ exportAs: ["matButton", "matAnchor"]
1397
+ },
1398
+ {
1399
+ kind: "ngmodule",
1400
+ type: MatBadgeModule
1401
+ },
1402
+ {
1403
+ kind: "directive",
1404
+ type: i7.MatBadge,
1405
+ selector: "[matBadge]",
1406
+ inputs: [
1407
+ "matBadgeColor",
1408
+ "matBadgeOverlap",
1409
+ "matBadgeDisabled",
1410
+ "matBadgePosition",
1411
+ "matBadge",
1412
+ "matBadgeDescription",
1413
+ "matBadgeSize",
1414
+ "matBadgeHidden"
1415
+ ]
1416
+ },
1417
+ {
1418
+ kind: "ngmodule",
1419
+ type: MatTooltipModule
1420
+ },
1421
+ {
1422
+ kind: "directive",
1423
+ type: i8.MatTooltip,
1424
+ selector: "[matTooltip]",
1425
+ inputs: [
1426
+ "matTooltipPosition",
1427
+ "matTooltipPositionAtOrigin",
1428
+ "matTooltipDisabled",
1429
+ "matTooltipShowDelay",
1430
+ "matTooltipHideDelay",
1431
+ "matTooltipTouchGestures",
1432
+ "matTooltip",
1433
+ "matTooltipClass"
1434
+ ],
1435
+ exportAs: ["matTooltip"]
1436
+ },
1437
+ {
1438
+ kind: "component",
1439
+ type: ButtonSelectorComponent,
1440
+ selector: "button-selector",
1441
+ inputs: [
1442
+ "disabled",
1443
+ "width",
1444
+ "border",
1445
+ "borderRadius",
1446
+ "label",
1447
+ "labelSelected",
1448
+ "options",
1449
+ "autoSelect"
1450
+ ],
1451
+ outputs: ["changed", "selected"]
1452
+ }
1453
+ ],
1454
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1455
+ });
1456
+ }
1457
+ };
1458
+ i0.ɵɵngDeclareClassMetadata({
1459
+ minVersion: "12.0.0",
1460
+ version: "22.2.1",
1461
+ ngImport: i0,
1462
+ type: ChipsSelectorComponent,
1463
+ decorators: [{
1464
+ type: Component,
1465
+ args: [{
1466
+ selector: "chips-selector",
1467
+ standalone: true,
1468
+ imports: [
1469
+ FlexLayoutModule,
1470
+ FormField,
1471
+ MatFormFieldModule,
1472
+ MatSelectModule,
1473
+ MatChipsModule,
1474
+ MatIconModule,
1475
+ MatButtonModule,
1476
+ MatBadgeModule,
1477
+ MatTooltipModule,
1478
+ ButtonSelectorComponent
1479
+ ],
1480
+ changeDetection: ChangeDetectionStrategy.OnPush,
1481
+ host: {
1482
+ "[id]": "id",
1483
+ "[class.floating]": "shouldLabelFloat",
1484
+ "[attr.aria-describedBy]": "describedBy"
1485
+ },
1486
+ template: "<div [id]=\"containerId\" class=\"chips-selector\">\n @if(containerWidth() > 0) {\n @if(collapsed()) {\n @if(collapsedDisplayMode() === 'dropdown') {\n <mat-form-field [style.min-width]=\"collapsedWidth() > 0 ? collapsedWidth()+'px' : '100%'\" subscriptSizing=\"dynamic\">\n @if(label()) {\n <mat-label>{{label()}}</mat-label>\n }\n <mat-select [formField]=\"selectionForm\" [multiple]=\"multiple()\" (selectionChange)=\"updateValue()\">\n <mat-select-trigger>\n @if (value && (value.length || 0) > 0) {\n {{value[0].shortName ?? value[0].name}}\n }\n @if (value && (value.length || 0) > 1) {\n <span class=\"collapsed-additional-selection\">\n (+{{(value.length || 0) - 1}} {{value.length === 2 ? 'altro' : 'altri'}})\n </span>\n }\n </mat-select-trigger>\n @for (o of options(); track $index) {\n <mat-option [value]=\"o\" [disabled]=\"o.disabled\">\n {{o.name}}\n @if(o.bag) {\n &nbsp; ({{o.bag}})\n }\n </mat-option>\n }\n </mat-select>\n @if (value && (value.length || 0) > 0) {\n <button matSuffix tabindex=\"-1\" mat-icon-button aria-label=\"Pulisci\" (click)=\"clear($event)\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n } @else {\n <button-selector [label]=\"label()\" [options]=\"options()\" [width]=\"collapsedWidth()\" [formField]=\"singleForm\"\n (selected)=\"updateValue()\"></button-selector>\n\n }\n } @else {\n <mat-chip-listbox [class]=\"stacked() ? 'mat-mdc-chip-set-stacked' : ''\" [multiple]=\"multiple()\"\n [formField]=\"selectionForm\" (change)=\"updateValue()\">\n @for (o of options(); track $index; let i = $index) {\n <mat-chip-option [matBadge]=\"o.bag\" [matTooltip]=\"o.disabled === true ? 'Non disponibile' : (o.bagInfo ?? '')\" [selectable]=\"isSelectable(o)\" [value]=\"o\"\n [disabled]=\"o.disabled\" [class.chip-padded]=\"i < padAt()\">{{o.shortName ??\n o.name}}</mat-chip-option>\n }\n </mat-chip-listbox>\n }\n }\n</div>",
1487
+ styles: [".chips-selector{width:100%}.chips-selector .collapsed-additional-selection{opacity:.75;font-size:.75em}.chip-padded{margin-right:10px!important}.mdc-evolution-chip--disabled{pointer-events:auto!important}\n"]
1488
+ }]
1489
+ }],
1490
+ ctorParameters: () => [{
1491
+ type: i1.NgControl,
1492
+ decorators: [{ type: Optional }, { type: Self }]
1493
+ }],
1494
+ propDecorators: {
1495
+ changed: [{
1496
+ type: i0.Output,
1497
+ args: ["changed"]
1498
+ }],
1499
+ options: [{
1500
+ type: i0.Input,
1501
+ args: [{
1502
+ isSignal: true,
1503
+ alias: "options",
1504
+ required: false
1505
+ }]
1506
+ }],
1507
+ collapsedWidth: [{
1508
+ type: i0.Input,
1509
+ args: [{
1510
+ isSignal: true,
1511
+ alias: "collapsedWidth",
1512
+ required: false
1513
+ }]
1514
+ }],
1515
+ collapsedDisplayMode: [{
1516
+ type: i0.Input,
1517
+ args: [{
1518
+ isSignal: true,
1519
+ alias: "collapsedDisplayMode",
1520
+ required: false
1521
+ }]
1522
+ }],
1523
+ collapseAt: [{
1524
+ type: i0.Input,
1525
+ args: [{
1526
+ isSignal: true,
1527
+ alias: "collapseAt",
1528
+ required: false
1529
+ }]
1530
+ }],
1531
+ collapseAtContainer: [{
1532
+ type: i0.Input,
1533
+ args: [{
1534
+ isSignal: true,
1535
+ alias: "collapseAtContainer",
1536
+ required: false
1537
+ }]
1538
+ }],
1539
+ label: [{
1540
+ type: i0.Input,
1541
+ args: [{
1542
+ isSignal: true,
1543
+ alias: "label",
1544
+ required: false
1545
+ }]
1546
+ }],
1547
+ multiple: [{
1548
+ type: i0.Input,
1549
+ args: [{
1550
+ isSignal: true,
1551
+ alias: "multiple",
1552
+ required: false
1553
+ }]
1554
+ }],
1555
+ mustSelect: [{
1556
+ type: i0.Input,
1557
+ args: [{
1558
+ isSignal: true,
1559
+ alias: "mustSelect",
1560
+ required: false
1561
+ }]
1562
+ }],
1563
+ mode: [{
1564
+ type: i0.Input,
1565
+ args: [{
1566
+ isSignal: true,
1567
+ alias: "mode",
1568
+ required: false
1569
+ }]
1570
+ }],
1571
+ stacked: [{
1572
+ type: i0.Input,
1573
+ args: [{
1574
+ isSignal: true,
1575
+ alias: "stacked",
1576
+ required: false
1577
+ }]
1578
+ }],
1579
+ padAt: [{
1580
+ type: i0.Input,
1581
+ args: [{
1582
+ isSignal: true,
1583
+ alias: "padAt",
1584
+ required: false
1585
+ }]
1586
+ }],
1587
+ required: [{
1588
+ type: i0.Input,
1589
+ args: [{
1590
+ isSignal: true,
1591
+ alias: "required",
1592
+ required: false
1593
+ }]
1594
+ }],
1595
+ placeholder: [{
1596
+ type: i0.Input,
1597
+ args: [{
1598
+ isSignal: true,
1599
+ alias: "placeholder",
1600
+ required: false
1601
+ }]
1602
+ }],
1603
+ disabled: [{ type: Input }]
1604
+ }
1605
+ });
613
1606
  export { ButtonSelectorComponent, ButtonToggleComponent, ChipsSelectorComponent };
614
- //# sourceMappingURL=arsedizioni-ars-utils-ui.controls.mjs.map
1607
+
1608
+ //# sourceMappingURL=arsedizioni-ars-utils-ui.controls.mjs.map