@acontplus/ng-components 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/acontplus-ng-components.mjs +512 -989
- package/fesm2022/acontplus-ng-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/_index.scss +5 -0
- package/src/core/theming/_all-theme.scss +6 -0
- package/src/lib/components/badge/_badge-theme.scss +58 -0
- package/src/lib/components/badge/_m3-badge.scss +52 -0
- package/src/lib/components/badge/badge.scss +318 -0
- package/src/lib/components/kpi-card/_kpi-card-theme.scss +41 -0
- package/src/lib/components/kpi-card/_m3-kpi-card.scss +98 -0
- package/src/lib/components/kpi-card/kpi-card.scss +741 -0
- package/types/acontplus-ng-components.d.ts +223 -317
- package/src/lib/components/autocomplete-wrapper/autocomplete-wrapper.scss +0 -677
- package/src/lib/styles/_elevation.scss +0 -168
- package/src/lib/styles/_token-utils.scss +0 -115
- package/src/styles/_custom-dialog.scss +0 -37
- package/src/styles/_mixins.scss +0 -12
- package/src/styles/index.scss +0 -4
|
@@ -1,46 +1,49 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ChangeDetectorRef, EventEmitter, booleanAttribute, Output, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, input, output, computed, Directive, ViewContainerRef, Renderer2, signal, afterRenderEffect, untracked, Injectable, viewChild, effect, PLATFORM_ID, Pipe,
|
|
2
|
+
import { inject, ChangeDetectorRef, EventEmitter, booleanAttribute, Output, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, input, output, contentChild, TemplateRef, computed, Directive, ViewContainerRef, Renderer2, signal, afterRenderEffect, untracked, Injectable, viewChild, effect, PLATFORM_ID, Pipe, ViewChild, KeyValueDiffers, InjectionToken, NgZone, CSP_NONCE, DOCUMENT, ElementRef, Injector, ContentChildren, model, forwardRef, ANIMATION_MODULE_TYPE, ApplicationRef, ContentChild, HostListener, SecurityContext } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/material/button';
|
|
4
4
|
import { MatIconButton, MatButtonModule, MatButton, MatMiniFabButton, MatFabButton } from '@angular/material/button';
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
5
|
+
import { NgClass, NgTemplateOutlet, isPlatformBrowser, AsyncPipe, CurrencyPipe, DatePipe, DecimalPipe, PercentPipe } from '@angular/common';
|
|
6
|
+
import { RouterLink } from '@angular/router';
|
|
7
|
+
import { MatChipSet, MatChip, MatChipAvatar, MatChipTrailingIcon, MatChipRemove, MatChipRow, MatChipGrid, MatChipInput, MatChipListbox } from '@angular/material/chips';
|
|
7
8
|
import * as i2 from '@angular/material/icon';
|
|
8
9
|
import { MatIconModule, MatIcon } from '@angular/material/icon';
|
|
10
|
+
import * as i1 from '@angular/material/card';
|
|
11
|
+
import { MatCardModule, MatCard, MatCardHeader, MatCardContent } from '@angular/material/card';
|
|
9
12
|
import { CdkDrag, CdkDragHandle, moveItemInArray, CdkDropList } from '@angular/cdk/drag-drop';
|
|
10
13
|
import * as i1$2 from '@angular/material/dialog';
|
|
11
14
|
import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule, MatDialog, MatDialogConfig } from '@angular/material/dialog';
|
|
12
|
-
import { NgClass, NgTemplateOutlet, isPlatformBrowser, AsyncPipe, CurrencyPipe, DatePipe, DecimalPipe, PercentPipe } from '@angular/common';
|
|
13
15
|
import { REPORT_FORMAT, DEFAULT_ICONS, FALLBACK_ICON } from '@acontplus/ui-kit';
|
|
14
16
|
import { MatProgressSpinner } from '@angular/material/progress-spinner';
|
|
15
17
|
import * as i1$4 from '@angular/forms';
|
|
16
18
|
import { FormControl, ReactiveFormsModule, FormsModule, NG_VALUE_ACCESSOR, FormGroup, Validators } from '@angular/forms';
|
|
17
19
|
import * as i1$3 from '@ng-select/ng-select';
|
|
18
20
|
import { NgSelectModule } from '@ng-select/ng-select';
|
|
19
|
-
import { Subject, firstValueFrom, catchError, of, map, BehaviorSubject,
|
|
21
|
+
import { Subject, firstValueFrom, catchError, of, map, BehaviorSubject, isObservable, merge, combineLatest, Observable, fromEvent, defer, Subscription } from 'rxjs';
|
|
20
22
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
21
23
|
import { HttpClient } from '@angular/common/http';
|
|
22
|
-
import { MatChipRow, MatChipGrid, MatChipInput, MatChipListbox, MatChip } from '@angular/material/chips';
|
|
23
24
|
import { MatFormField, MatLabel, MatHint, MatFormFieldModule } from '@angular/material/form-field';
|
|
24
25
|
import { LiveAnnouncer, _IdGenerator, CdkTrapFocus, FocusMonitor, isFakeMousedownFromScreenReader } from '@angular/cdk/a11y';
|
|
25
26
|
import { ENTER, COMMA, ESCAPE, hasModifierKey, SPACE } from '@angular/cdk/keycodes';
|
|
26
27
|
import { Tabulator, PageModule, ReactiveDataModule, FormatModule, EditModule, ValidateModule, ColumnCalcsModule, SortModule, TooltipModule, DataTreeModule, MoveRowsModule, SelectRowModule, PopupModule, InteractionModule } from 'tabulator-tables';
|
|
27
28
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
28
|
-
import * as
|
|
29
|
-
import { Overlay,
|
|
29
|
+
import * as i3 from '@angular/cdk/overlay';
|
|
30
|
+
import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
30
31
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
|
31
32
|
import { ComponentPortal, CdkPortalOutlet, TemplatePortal, DomPortalOutlet } from '@angular/cdk/portal';
|
|
32
33
|
import * as i7 from '@angular/material/tooltip';
|
|
33
34
|
import { MatTooltip, MatTooltipModule } from '@angular/material/tooltip';
|
|
34
|
-
import { MatProgressBarModule, MatProgressBar } from '@angular/material/progress-bar';
|
|
35
|
-
import { switchMap, catchError as catchError$1, mapTo, take, takeUntil as takeUntil$1, startWith, pairwise, distinctUntilChanged, share, map as map$1, skip, filter } from 'rxjs/operators';
|
|
36
35
|
import { MatTableDataSource, MatTable, MatColumnDef, MatHeaderRowDef, MatHeaderRow, MatRowDef, MatRow, MatFooterRowDef, MatFooterRow, MatHeaderCellDef, MatHeaderCell, MatCellDef, MatCell, MatFooterCellDef, MatFooterCell } from '@angular/material/table';
|
|
37
36
|
import { MatPaginator } from '@angular/material/paginator';
|
|
38
37
|
import { MatSort, MatSortHeader } from '@angular/material/sort';
|
|
39
38
|
import { MatCheckbox, MatCheckboxModule } from '@angular/material/checkbox';
|
|
39
|
+
import * as i4 from '@angular/material/progress-bar';
|
|
40
|
+
import { MatProgressBar, MatProgressBarModule } from '@angular/material/progress-bar';
|
|
40
41
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
41
42
|
import { MatBadge } from '@angular/material/badge';
|
|
42
|
-
import
|
|
43
|
+
import * as i3$1 from '@angular/material/menu';
|
|
44
|
+
import { MatMenu, MatMenuItem, MatMenuTrigger, MatMenuModule } from '@angular/material/menu';
|
|
43
45
|
import { _animationsDisabled, MatNativeDateModule } from '@angular/material/core';
|
|
46
|
+
import { mapTo, take, takeUntil, startWith, pairwise, distinctUntilChanged, share, map as map$1, skip, filter } from 'rxjs/operators';
|
|
44
47
|
import { CdkTable, CdkColumnDef } from '@angular/cdk/table';
|
|
45
48
|
import { coerceCssPixelValue } from '@angular/cdk/coercion';
|
|
46
49
|
import { Directionality } from '@angular/cdk/bidi';
|
|
@@ -54,6 +57,7 @@ import * as i2$1 from '@angular/material/input';
|
|
|
54
57
|
import { MatInputModule } from '@angular/material/input';
|
|
55
58
|
import * as i6 from '@angular/material/list';
|
|
56
59
|
import { MatListModule } from '@angular/material/list';
|
|
60
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
57
61
|
import { TranslocoService } from '@jsverse/transloco';
|
|
58
62
|
|
|
59
63
|
class AcpAlert {
|
|
@@ -94,6 +98,192 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
94
98
|
type: Output
|
|
95
99
|
}] } });
|
|
96
100
|
|
|
101
|
+
const TREND_CONFIGS = {
|
|
102
|
+
up: { value: '↑', icon: 'trending_up', color: 'success' },
|
|
103
|
+
down: { value: '↓', icon: 'trending_down', color: 'danger' },
|
|
104
|
+
neutral: { value: '→', icon: 'trending_flat', color: 'neutral' },
|
|
105
|
+
none: { value: '', icon: '', color: 'neutral' },
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
class AcpBadge {
|
|
109
|
+
label = input(/* @ts-ignore */
|
|
110
|
+
...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
111
|
+
value = input(/* @ts-ignore */
|
|
112
|
+
...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
|
|
113
|
+
variant = input('filled', /* @ts-ignore */
|
|
114
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
115
|
+
color = input('primary', /* @ts-ignore */
|
|
116
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
117
|
+
size = input('md', /* @ts-ignore */
|
|
118
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
119
|
+
shape = input('rounded', /* @ts-ignore */
|
|
120
|
+
...(ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []));
|
|
121
|
+
icon = input(/* @ts-ignore */
|
|
122
|
+
...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
123
|
+
trailingIcon = input(/* @ts-ignore */
|
|
124
|
+
...(ngDevMode ? [undefined, { debugName: "trailingIcon" }] : /* istanbul ignore next */ []));
|
|
125
|
+
svgIcon = input(/* @ts-ignore */
|
|
126
|
+
...(ngDevMode ? [undefined, { debugName: "svgIcon" }] : /* istanbul ignore next */ []));
|
|
127
|
+
trailingSvgIcon = input(/* @ts-ignore */
|
|
128
|
+
...(ngDevMode ? [undefined, { debugName: "trailingSvgIcon" }] : /* istanbul ignore next */ []));
|
|
129
|
+
trend = input('none', /* @ts-ignore */
|
|
130
|
+
...(ngDevMode ? [{ debugName: "trend" }] : /* istanbul ignore next */ []));
|
|
131
|
+
clickable = input(false, { ...(ngDevMode ? { debugName: "clickable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
132
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
133
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
134
|
+
selected = input(false, { ...(ngDevMode ? { debugName: "selected" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
135
|
+
highlighted = input(false, { ...(ngDevMode ? { debugName: "highlighted" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
136
|
+
removable = input(false, { ...(ngDevMode ? { debugName: "removable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
137
|
+
routerLink = input(null, /* @ts-ignore */
|
|
138
|
+
...(ngDevMode ? [{ debugName: "routerLink" }] : /* istanbul ignore next */ []));
|
|
139
|
+
href = input(null, /* @ts-ignore */
|
|
140
|
+
...(ngDevMode ? [{ debugName: "href" }] : /* istanbul ignore next */ []));
|
|
141
|
+
ariaLabelOverride = input(null, /* @ts-ignore */
|
|
142
|
+
...(ngDevMode ? [{ debugName: "ariaLabelOverride" }] : /* istanbul ignore next */ []));
|
|
143
|
+
clicked = output();
|
|
144
|
+
removed = output();
|
|
145
|
+
iconTemplate = contentChild('icon', { ...(ngDevMode ? { debugName: "iconTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
146
|
+
trailingIconTemplate = contentChild('trailingIcon', { ...(ngDevMode ? { debugName: "trailingIconTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
147
|
+
isTrending = computed(() => this.trend() !== 'none', /* @ts-ignore */
|
|
148
|
+
...(ngDevMode ? [{ debugName: "isTrending" }] : /* istanbul ignore next */ []));
|
|
149
|
+
trendConfig = computed(() => TREND_CONFIGS[this.trend()], /* @ts-ignore */
|
|
150
|
+
...(ngDevMode ? [{ debugName: "trendConfig" }] : /* istanbul ignore next */ []));
|
|
151
|
+
effectiveColor = computed(() => {
|
|
152
|
+
if (this.isTrending())
|
|
153
|
+
return this.trendConfig().color;
|
|
154
|
+
return this.color();
|
|
155
|
+
}, /* @ts-ignore */
|
|
156
|
+
...(ngDevMode ? [{ debugName: "effectiveColor" }] : /* istanbul ignore next */ []));
|
|
157
|
+
effectiveIcon = computed(() => {
|
|
158
|
+
if (this.isTrending())
|
|
159
|
+
return this.trendConfig().icon;
|
|
160
|
+
return this.icon();
|
|
161
|
+
}, /* @ts-ignore */
|
|
162
|
+
...(ngDevMode ? [{ debugName: "effectiveIcon" }] : /* istanbul ignore next */ []));
|
|
163
|
+
effectiveSvgIcon = computed(() => {
|
|
164
|
+
if (this.isTrending())
|
|
165
|
+
return undefined;
|
|
166
|
+
return this.svgIcon();
|
|
167
|
+
}, /* @ts-ignore */
|
|
168
|
+
...(ngDevMode ? [{ debugName: "effectiveSvgIcon" }] : /* istanbul ignore next */ []));
|
|
169
|
+
effectiveTrailingIcon = computed(() => {
|
|
170
|
+
if (this.removable())
|
|
171
|
+
return undefined;
|
|
172
|
+
return this.trailingIcon();
|
|
173
|
+
}, /* @ts-ignore */
|
|
174
|
+
...(ngDevMode ? [{ debugName: "effectiveTrailingIcon" }] : /* istanbul ignore next */ []));
|
|
175
|
+
effectiveTrailingSvgIcon = computed(() => {
|
|
176
|
+
if (this.removable())
|
|
177
|
+
return undefined;
|
|
178
|
+
return this.trailingSvgIcon();
|
|
179
|
+
}, /* @ts-ignore */
|
|
180
|
+
...(ngDevMode ? [{ debugName: "effectiveTrailingSvgIcon" }] : /* istanbul ignore next */ []));
|
|
181
|
+
effectiveValue = computed(() => {
|
|
182
|
+
if (this.isTrending())
|
|
183
|
+
return this.value() ?? this.trendConfig().value;
|
|
184
|
+
return this.value();
|
|
185
|
+
}, /* @ts-ignore */
|
|
186
|
+
...(ngDevMode ? [{ debugName: "effectiveValue" }] : /* istanbul ignore next */ []));
|
|
187
|
+
isLink = computed(() => this.href() !== null || this.routerLink() !== null, /* @ts-ignore */
|
|
188
|
+
...(ngDevMode ? [{ debugName: "isLink" }] : /* istanbul ignore next */ []));
|
|
189
|
+
isInteractive = computed(() => this.clickable() || this.removable() || this.isLink(), /* @ts-ignore */
|
|
190
|
+
...(ngDevMode ? [{ debugName: "isInteractive" }] : /* istanbul ignore next */ []));
|
|
191
|
+
isDisabled = computed(() => this.disabled() || this.loading(), /* @ts-ignore */
|
|
192
|
+
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
193
|
+
isHighlighted = computed(() => this.highlighted() || this.selected(), /* @ts-ignore */
|
|
194
|
+
...(ngDevMode ? [{ debugName: "isHighlighted" }] : /* istanbul ignore next */ []));
|
|
195
|
+
chipClasses = computed(() => [
|
|
196
|
+
`acp-badge--${this.variant()}`,
|
|
197
|
+
`acp-badge--${this.size()}`,
|
|
198
|
+
`acp-badge--${this.shape()}`,
|
|
199
|
+
].join(' '), /* @ts-ignore */
|
|
200
|
+
...(ngDevMode ? [{ debugName: "chipClasses" }] : /* istanbul ignore next */ []));
|
|
201
|
+
hostClasses = computed(() => {
|
|
202
|
+
const classes = [
|
|
203
|
+
'acp-badge',
|
|
204
|
+
`acp-badge--${this.variant()}`,
|
|
205
|
+
`acp-badge--${this.effectiveColor()}`,
|
|
206
|
+
`acp-badge--${this.size()}`,
|
|
207
|
+
`acp-badge--${this.shape()}`,
|
|
208
|
+
];
|
|
209
|
+
if (this.isInteractive())
|
|
210
|
+
classes.push('acp-badge--interactive');
|
|
211
|
+
if (this.isDisabled())
|
|
212
|
+
classes.push('acp-badge--disabled');
|
|
213
|
+
if (this.selected())
|
|
214
|
+
classes.push('acp-badge--selected');
|
|
215
|
+
if (this.loading())
|
|
216
|
+
classes.push('acp-badge--loading');
|
|
217
|
+
if (this.removable())
|
|
218
|
+
classes.push('acp-badge--removable');
|
|
219
|
+
if (this.isTrending())
|
|
220
|
+
classes.push('acp-badge--trend');
|
|
221
|
+
return classes.join(' ');
|
|
222
|
+
}, /* @ts-ignore */
|
|
223
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
224
|
+
ariaLabel = computed(() => {
|
|
225
|
+
const override = this.ariaLabelOverride();
|
|
226
|
+
if (override)
|
|
227
|
+
return override;
|
|
228
|
+
const label = this.label() ?? '';
|
|
229
|
+
const value = this.effectiveValue() ?? '';
|
|
230
|
+
const separator = label && value ? ' ' : '';
|
|
231
|
+
return `${label}${separator}${value}`.trim() || null;
|
|
232
|
+
}, /* @ts-ignore */
|
|
233
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
234
|
+
onChipClick(event) {
|
|
235
|
+
if (this.isDisabled()) {
|
|
236
|
+
event.preventDefault();
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
this.clicked.emit();
|
|
240
|
+
}
|
|
241
|
+
onRemove(_event) {
|
|
242
|
+
if (this.isDisabled())
|
|
243
|
+
return;
|
|
244
|
+
this.removed.emit();
|
|
245
|
+
}
|
|
246
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AcpBadge, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
247
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: AcpBadge, isStandalone: true, selector: "acp-badge", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, trailingIcon: { classPropertyName: "trailingIcon", publicName: "trailingIcon", isSignal: true, isRequired: false, transformFunction: null }, svgIcon: { classPropertyName: "svgIcon", publicName: "svgIcon", isSignal: true, isRequired: false, transformFunction: null }, trailingSvgIcon: { classPropertyName: "trailingSvgIcon", publicName: "trailingSvgIcon", isSignal: true, isRequired: false, transformFunction: null }, trend: { classPropertyName: "trend", publicName: "trend", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, highlighted: { classPropertyName: "highlighted", publicName: "highlighted", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelOverride: { classPropertyName: "ariaLabelOverride", publicName: "ariaLabelOverride", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked", removed: "removed" }, host: { properties: { "class": "hostClasses()" } }, queries: [{ propertyName: "iconTemplate", first: true, predicate: ["icon"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "trailingIconTemplate", first: true, predicate: ["trailingIcon"], descendants: true, read: TemplateRef, isSignal: true }], exportAs: ["acpBadge"], ngImport: i0, template: "<mat-chip-set\n class=\"acp-badge__set\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n>\n <mat-chip\n class=\"acp-badge__chip\"\n [ngClass]=\"chipClasses()\"\n [disabled]=\"isDisabled()\"\n [removable]=\"removable()\"\n [highlighted]=\"isHighlighted()\"\n [value]=\"value()\"\n [routerLink]=\"routerLink()\"\n [attr.href]=\"href()\"\n (removed)=\"onRemove($event)\"\n (click)=\"onChipClick($event)\"\n >\n @if (loading()) {\n <span class=\"acp-badge__loader\" aria-hidden=\"true\"></span>\n } @if (iconTemplate()) {\n <span matChipAvatar class=\"acp-badge__avatar\">\n <ng-container [ngTemplateOutlet]=\"iconTemplate()!\"></ng-container>\n </span>\n } @else if (effectiveSvgIcon()) {\n <mat-icon\n matChipAvatar\n class=\"acp-badge__icon\"\n [svgIcon]=\"effectiveSvgIcon()!\"\n aria-hidden=\"true\"\n ></mat-icon>\n } @else if (effectiveIcon()) {\n <mat-icon matChipAvatar class=\"acp-badge__icon\" aria-hidden=\"true\"\n >{{ effectiveIcon() }}</mat-icon\n >\n } @if (label()) {\n <span class=\"acp-badge__label\">{{ label() }}</span>\n } @if (label() && effectiveValue()) {\n <span class=\"acp-badge__separator\" aria-hidden=\"true\">|</span>\n } @if (effectiveValue()) {\n <span class=\"acp-badge__value\">{{ effectiveValue() }}</span>\n } @if (trailingIconTemplate()) {\n <span matChipTrailingIcon class=\"acp-badge__trailing-icon\">\n <ng-container [ngTemplateOutlet]=\"trailingIconTemplate()!\"></ng-container>\n </span>\n } @else if (effectiveTrailingSvgIcon()) {\n <mat-icon\n matChipTrailingIcon\n class=\"acp-badge__trailing-icon\"\n [svgIcon]=\"effectiveTrailingSvgIcon()!\"\n aria-hidden=\"true\"\n ></mat-icon>\n } @else if (effectiveTrailingIcon()) {\n <mat-icon matChipTrailingIcon class=\"acp-badge__trailing-icon\" aria-hidden=\"true\"\n >{{ effectiveTrailingIcon() }}</mat-icon\n >\n } @if (removable()) {\n <button\n matChipRemove\n type=\"button\"\n class=\"acp-badge__remove\"\n aria-label=\"Remove\"\n (click)=\"onRemove($event)\"\n >\n <mat-icon aria-hidden=\"true\">cancel</mat-icon>\n </button>\n }\n </mat-chip>\n</mat-chip-set>\n", styles: [".acp-badge{--acp-badge-bg: var(--acp-badge-primary-bg, var(--mat-sys-primary));--acp-badge-fg: var(--acp-badge-primary-color, var(--mat-sys-on-primary));display:inline-flex;vertical-align:middle;max-width:100%}.acp-badge__set{display:inline-flex;max-width:100%}.acp-badge__chip.mat-mdc-chip{position:relative;max-width:100%}.acp-badge__label,.acp-badge__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.acp-badge__separator{margin:0 6px;opacity:.6}.acp-badge__loader{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:inherit;border-radius:inherit;z-index:1}.acp-badge__loader:after{content:\"\";width:16px;height:16px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:acp-badge-spin .75s linear infinite}.acp-badge__remove{cursor:pointer}.acp-badge__remove:focus-visible{outline:2px solid currentColor;outline-offset:1px}@keyframes acp-badge-spin{to{transform:rotate(360deg)}}.acp-badge.acp-badge--primary{--acp-badge-bg: var(--acp-badge-primary-bg, var(--mat-sys-primary));--acp-badge-fg: var(--acp-badge-primary-color, var(--mat-sys-on-primary))}.acp-badge.acp-badge--secondary{--acp-badge-bg: var(--acp-badge-secondary-bg, var(--mat-sys-secondary));--acp-badge-fg: var(--acp-badge-secondary-color, var(--mat-sys-on-secondary))}.acp-badge.acp-badge--tertiary{--acp-badge-bg: var(--acp-badge-tertiary-bg, var(--mat-sys-tertiary));--acp-badge-fg: var(--acp-badge-tertiary-color, var(--mat-sys-on-tertiary))}.acp-badge.acp-badge--success{--acp-badge-bg: var(--acp-badge-success-bg, light-dark(#026e00, #02e600));--acp-badge-fg: var(--acp-badge-success-fg, light-dark(#cbffb8, #013a00))}.acp-badge.acp-badge--warning{--acp-badge-bg: var(--acp-badge-warning-bg, light-dark(#964900, #ffb787));--acp-badge-fg: var(--acp-badge-warning-fg, light-dark(#ffede4, #502400))}.acp-badge.acp-badge--danger{--acp-badge-bg: var(--acp-badge-danger-bg, light-dark(#c00100, #ffb4a8));--acp-badge-fg: var(--acp-badge-danger-fg, light-dark(#ffedea, #690100))}.acp-badge.acp-badge--info{--acp-badge-bg: var(--acp-badge-info-bg, light-dark(#005cbb, #abc7ff));--acp-badge-fg: var(--acp-badge-info-fg, light-dark(#ecf0ff, #002f65))}.acp-badge.acp-badge--neutral{--acp-badge-bg: var(--acp-badge-neutral-bg, var(--mat-sys-surface-variant));--acp-badge-fg: var(--acp-badge-neutral-color, var(--mat-sys-on-surface-variant))}.acp-badge.acp-badge--custom{--acp-badge-bg: var(--acp-badge-custom-bg, var(--acp-badge-custom-bg, var(--mat-sys-surface-container)));--acp-badge-fg: var(--acp-badge-custom-fg, var(--acp-badge-custom-color, var(--mat-sys-on-surface)))}.acp-badge.acp-badge--filled .acp-badge__chip.mat-mdc-chip{--mat-chip-elevated-container-color: var(--acp-badge-bg);--mat-chip-elevated-selected-container-color: var(--acp-badge-bg);--mat-chip-label-text-color: var(--acp-badge-fg);--mat-chip-selected-label-text-color: var(--acp-badge-fg);--mat-chip-with-icon-icon-color: var(--acp-badge-fg);--mat-chip-with-icon-selected-icon-color: var(--acp-badge-fg);--mat-chip-with-trailing-icon-trailing-icon-color: var(--acp-badge-fg);--mat-chip-selected-trailing-icon-color: var(--acp-badge-fg);--mat-chip-outline-color: transparent}.acp-badge.acp-badge--outlined .acp-badge__chip.mat-mdc-chip{--mat-chip-elevated-container-color: transparent;--mat-chip-elevated-selected-container-color: transparent;--mat-chip-label-text-color: var(--acp-badge-bg);--mat-chip-selected-label-text-color: var(--acp-badge-bg);--mat-chip-with-icon-icon-color: var(--acp-badge-bg);--mat-chip-with-icon-selected-icon-color: var(--acp-badge-bg);--mat-chip-with-trailing-icon-trailing-icon-color: var(--acp-badge-bg);--mat-chip-selected-trailing-icon-color: var(--acp-badge-bg);--mat-chip-outline-color: var(--acp-badge-bg);--mat-chip-outline-width: 1px}.acp-badge.acp-badge--soft .acp-badge__chip.mat-mdc-chip{--mat-chip-elevated-container-color: color-mix(in srgb, var(--acp-badge-bg) 12%, transparent);--mat-chip-elevated-selected-container-color: color-mix(in srgb, var(--acp-badge-bg) 12%, transparent);--mat-chip-label-text-color: var(--acp-badge-bg);--mat-chip-selected-label-text-color: var(--acp-badge-bg);--mat-chip-with-icon-icon-color: var(--acp-badge-bg);--mat-chip-with-icon-selected-icon-color: var(--acp-badge-bg);--mat-chip-with-trailing-icon-trailing-icon-color: var(--acp-badge-bg);--mat-chip-selected-trailing-icon-color: var(--acp-badge-bg);--mat-chip-outline-color: transparent}.acp-badge.acp-badge--tonal .acp-badge__chip.mat-mdc-chip{--mat-chip-elevated-container-color: color-mix(in srgb, var(--acp-badge-bg) 22%, transparent);--mat-chip-elevated-selected-container-color: color-mix(in srgb, var(--acp-badge-bg) 22%, transparent);--mat-chip-label-text-color: var(--acp-badge-bg);--mat-chip-selected-label-text-color: var(--acp-badge-bg);--mat-chip-with-icon-icon-color: var(--acp-badge-bg);--mat-chip-with-icon-selected-icon-color: var(--acp-badge-bg);--mat-chip-with-trailing-icon-trailing-icon-color: var(--acp-badge-bg);--mat-chip-selected-trailing-icon-color: var(--acp-badge-bg);--mat-chip-outline-color: transparent}.acp-badge.acp-badge--text .acp-badge__chip.mat-mdc-chip{--mat-chip-elevated-container-color: transparent;--mat-chip-elevated-selected-container-color: transparent;--mat-chip-label-text-color: var(--acp-badge-bg);--mat-chip-selected-label-text-color: var(--acp-badge-bg);--mat-chip-with-icon-icon-color: var(--acp-badge-bg);--mat-chip-with-icon-selected-icon-color: var(--acp-badge-bg);--mat-chip-with-trailing-icon-trailing-icon-color: var(--acp-badge-bg);--mat-chip-selected-trailing-icon-color: var(--acp-badge-bg);--mat-chip-outline-color: transparent}.acp-badge.acp-badge--xs .acp-badge__chip.mat-mdc-chip{--mat-chip-container-height: 20px;--mat-chip-label-text-size: 10px}.acp-badge.acp-badge--xs .acp-badge__chip.mat-mdc-chip .mat-icon{--acp-badge-icon-size: 12px}.acp-badge.acp-badge--sm .acp-badge__chip.mat-mdc-chip{--mat-chip-container-height: 24px;--mat-chip-label-text-size: 11px}.acp-badge.acp-badge--sm .acp-badge__chip.mat-mdc-chip .mat-icon{--acp-badge-icon-size: 14px}.acp-badge.acp-badge--md .acp-badge__chip.mat-mdc-chip{--mat-chip-container-height: 28px;--mat-chip-label-text-size: 12px}.acp-badge.acp-badge--md .acp-badge__chip.mat-mdc-chip .mat-icon{--acp-badge-icon-size: 16px}.acp-badge.acp-badge--lg .acp-badge__chip.mat-mdc-chip{--mat-chip-container-height: 32px;--mat-chip-label-text-size: 14px}.acp-badge.acp-badge--lg .acp-badge__chip.mat-mdc-chip .mat-icon{--acp-badge-icon-size: 18px}.acp-badge.acp-badge--rounded .acp-badge__chip.mat-mdc-chip{--mat-chip-container-shape-radius: var(--acp-badge-container-shape, var(--mat-sys-corner-small))}.acp-badge.acp-badge--pill .acp-badge__chip.mat-mdc-chip{--mat-chip-container-shape-radius: var(--acp-badge-pill-shape, var(--mat-sys-corner-full))}.acp-badge.acp-badge--square .acp-badge__chip.mat-mdc-chip{--mat-chip-container-shape-radius: 0}.acp-badge__chip.mat-mdc-chip .mat-icon{width:var(--acp-badge-icon-size, 18px);height:var(--acp-badge-icon-size, 18px);font-size:var(--acp-badge-icon-size, 18px);line-height:var(--acp-badge-icon-size, 18px)}.acp-badge.acp-badge--interactive .acp-badge__chip.mat-mdc-chip{cursor:pointer}.acp-badge.acp-badge--disabled .acp-badge__chip.mat-mdc-chip{cursor:not-allowed;opacity:.5}.acp-badge.acp-badge--loading .acp-badge__chip.mat-mdc-chip{pointer-events:none}.acp-badge.acp-badge--selected .acp-badge__chip.mat-mdc-chip.mdc-evolution-chip--selected,.acp-badge.acp-badge--selected .acp-badge__chip.mat-mdc-chip.mat-mdc-chip-highlighted{box-shadow:inset 0 0 0 2px currentColor}@media(prefers-reduced-motion:reduce){.acp-badge__loader:after{animation:none}}@media(prefers-contrast:more){.acp-badge__chip.mat-mdc-chip{outline:2px solid currentColor;outline-offset:1px}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: MatChipSet, selector: "mat-chip-set", inputs: ["disabled", "role", "tabIndex"] }, { kind: "component", type: MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "directive", type: MatChipAvatar, selector: "mat-chip-avatar, [matChipAvatar]" }, { kind: "directive", type: MatChipTrailingIcon, selector: "mat-chip-trailing-icon, [matChipTrailingIcon]" }, { kind: "directive", type: MatChipRemove, selector: "[matChipRemove]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
248
|
+
}
|
|
249
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AcpBadge, decorators: [{
|
|
250
|
+
type: Component,
|
|
251
|
+
args: [{ selector: 'acp-badge', exportAs: 'acpBadge', standalone: true, imports: [
|
|
252
|
+
NgClass,
|
|
253
|
+
NgTemplateOutlet,
|
|
254
|
+
RouterLink,
|
|
255
|
+
MatChipSet,
|
|
256
|
+
MatChip,
|
|
257
|
+
MatChipAvatar,
|
|
258
|
+
MatChipTrailingIcon,
|
|
259
|
+
MatChipRemove,
|
|
260
|
+
MatIconModule,
|
|
261
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
262
|
+
'[class]': 'hostClasses()',
|
|
263
|
+
}, template: "<mat-chip-set\n class=\"acp-badge__set\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n>\n <mat-chip\n class=\"acp-badge__chip\"\n [ngClass]=\"chipClasses()\"\n [disabled]=\"isDisabled()\"\n [removable]=\"removable()\"\n [highlighted]=\"isHighlighted()\"\n [value]=\"value()\"\n [routerLink]=\"routerLink()\"\n [attr.href]=\"href()\"\n (removed)=\"onRemove($event)\"\n (click)=\"onChipClick($event)\"\n >\n @if (loading()) {\n <span class=\"acp-badge__loader\" aria-hidden=\"true\"></span>\n } @if (iconTemplate()) {\n <span matChipAvatar class=\"acp-badge__avatar\">\n <ng-container [ngTemplateOutlet]=\"iconTemplate()!\"></ng-container>\n </span>\n } @else if (effectiveSvgIcon()) {\n <mat-icon\n matChipAvatar\n class=\"acp-badge__icon\"\n [svgIcon]=\"effectiveSvgIcon()!\"\n aria-hidden=\"true\"\n ></mat-icon>\n } @else if (effectiveIcon()) {\n <mat-icon matChipAvatar class=\"acp-badge__icon\" aria-hidden=\"true\"\n >{{ effectiveIcon() }}</mat-icon\n >\n } @if (label()) {\n <span class=\"acp-badge__label\">{{ label() }}</span>\n } @if (label() && effectiveValue()) {\n <span class=\"acp-badge__separator\" aria-hidden=\"true\">|</span>\n } @if (effectiveValue()) {\n <span class=\"acp-badge__value\">{{ effectiveValue() }}</span>\n } @if (trailingIconTemplate()) {\n <span matChipTrailingIcon class=\"acp-badge__trailing-icon\">\n <ng-container [ngTemplateOutlet]=\"trailingIconTemplate()!\"></ng-container>\n </span>\n } @else if (effectiveTrailingSvgIcon()) {\n <mat-icon\n matChipTrailingIcon\n class=\"acp-badge__trailing-icon\"\n [svgIcon]=\"effectiveTrailingSvgIcon()!\"\n aria-hidden=\"true\"\n ></mat-icon>\n } @else if (effectiveTrailingIcon()) {\n <mat-icon matChipTrailingIcon class=\"acp-badge__trailing-icon\" aria-hidden=\"true\"\n >{{ effectiveTrailingIcon() }}</mat-icon\n >\n } @if (removable()) {\n <button\n matChipRemove\n type=\"button\"\n class=\"acp-badge__remove\"\n aria-label=\"Remove\"\n (click)=\"onRemove($event)\"\n >\n <mat-icon aria-hidden=\"true\">cancel</mat-icon>\n </button>\n }\n </mat-chip>\n</mat-chip-set>\n", styles: [".acp-badge{--acp-badge-bg: var(--acp-badge-primary-bg, var(--mat-sys-primary));--acp-badge-fg: var(--acp-badge-primary-color, var(--mat-sys-on-primary));display:inline-flex;vertical-align:middle;max-width:100%}.acp-badge__set{display:inline-flex;max-width:100%}.acp-badge__chip.mat-mdc-chip{position:relative;max-width:100%}.acp-badge__label,.acp-badge__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.acp-badge__separator{margin:0 6px;opacity:.6}.acp-badge__loader{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:inherit;border-radius:inherit;z-index:1}.acp-badge__loader:after{content:\"\";width:16px;height:16px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:acp-badge-spin .75s linear infinite}.acp-badge__remove{cursor:pointer}.acp-badge__remove:focus-visible{outline:2px solid currentColor;outline-offset:1px}@keyframes acp-badge-spin{to{transform:rotate(360deg)}}.acp-badge.acp-badge--primary{--acp-badge-bg: var(--acp-badge-primary-bg, var(--mat-sys-primary));--acp-badge-fg: var(--acp-badge-primary-color, var(--mat-sys-on-primary))}.acp-badge.acp-badge--secondary{--acp-badge-bg: var(--acp-badge-secondary-bg, var(--mat-sys-secondary));--acp-badge-fg: var(--acp-badge-secondary-color, var(--mat-sys-on-secondary))}.acp-badge.acp-badge--tertiary{--acp-badge-bg: var(--acp-badge-tertiary-bg, var(--mat-sys-tertiary));--acp-badge-fg: var(--acp-badge-tertiary-color, var(--mat-sys-on-tertiary))}.acp-badge.acp-badge--success{--acp-badge-bg: var(--acp-badge-success-bg, light-dark(#026e00, #02e600));--acp-badge-fg: var(--acp-badge-success-fg, light-dark(#cbffb8, #013a00))}.acp-badge.acp-badge--warning{--acp-badge-bg: var(--acp-badge-warning-bg, light-dark(#964900, #ffb787));--acp-badge-fg: var(--acp-badge-warning-fg, light-dark(#ffede4, #502400))}.acp-badge.acp-badge--danger{--acp-badge-bg: var(--acp-badge-danger-bg, light-dark(#c00100, #ffb4a8));--acp-badge-fg: var(--acp-badge-danger-fg, light-dark(#ffedea, #690100))}.acp-badge.acp-badge--info{--acp-badge-bg: var(--acp-badge-info-bg, light-dark(#005cbb, #abc7ff));--acp-badge-fg: var(--acp-badge-info-fg, light-dark(#ecf0ff, #002f65))}.acp-badge.acp-badge--neutral{--acp-badge-bg: var(--acp-badge-neutral-bg, var(--mat-sys-surface-variant));--acp-badge-fg: var(--acp-badge-neutral-color, var(--mat-sys-on-surface-variant))}.acp-badge.acp-badge--custom{--acp-badge-bg: var(--acp-badge-custom-bg, var(--acp-badge-custom-bg, var(--mat-sys-surface-container)));--acp-badge-fg: var(--acp-badge-custom-fg, var(--acp-badge-custom-color, var(--mat-sys-on-surface)))}.acp-badge.acp-badge--filled .acp-badge__chip.mat-mdc-chip{--mat-chip-elevated-container-color: var(--acp-badge-bg);--mat-chip-elevated-selected-container-color: var(--acp-badge-bg);--mat-chip-label-text-color: var(--acp-badge-fg);--mat-chip-selected-label-text-color: var(--acp-badge-fg);--mat-chip-with-icon-icon-color: var(--acp-badge-fg);--mat-chip-with-icon-selected-icon-color: var(--acp-badge-fg);--mat-chip-with-trailing-icon-trailing-icon-color: var(--acp-badge-fg);--mat-chip-selected-trailing-icon-color: var(--acp-badge-fg);--mat-chip-outline-color: transparent}.acp-badge.acp-badge--outlined .acp-badge__chip.mat-mdc-chip{--mat-chip-elevated-container-color: transparent;--mat-chip-elevated-selected-container-color: transparent;--mat-chip-label-text-color: var(--acp-badge-bg);--mat-chip-selected-label-text-color: var(--acp-badge-bg);--mat-chip-with-icon-icon-color: var(--acp-badge-bg);--mat-chip-with-icon-selected-icon-color: var(--acp-badge-bg);--mat-chip-with-trailing-icon-trailing-icon-color: var(--acp-badge-bg);--mat-chip-selected-trailing-icon-color: var(--acp-badge-bg);--mat-chip-outline-color: var(--acp-badge-bg);--mat-chip-outline-width: 1px}.acp-badge.acp-badge--soft .acp-badge__chip.mat-mdc-chip{--mat-chip-elevated-container-color: color-mix(in srgb, var(--acp-badge-bg) 12%, transparent);--mat-chip-elevated-selected-container-color: color-mix(in srgb, var(--acp-badge-bg) 12%, transparent);--mat-chip-label-text-color: var(--acp-badge-bg);--mat-chip-selected-label-text-color: var(--acp-badge-bg);--mat-chip-with-icon-icon-color: var(--acp-badge-bg);--mat-chip-with-icon-selected-icon-color: var(--acp-badge-bg);--mat-chip-with-trailing-icon-trailing-icon-color: var(--acp-badge-bg);--mat-chip-selected-trailing-icon-color: var(--acp-badge-bg);--mat-chip-outline-color: transparent}.acp-badge.acp-badge--tonal .acp-badge__chip.mat-mdc-chip{--mat-chip-elevated-container-color: color-mix(in srgb, var(--acp-badge-bg) 22%, transparent);--mat-chip-elevated-selected-container-color: color-mix(in srgb, var(--acp-badge-bg) 22%, transparent);--mat-chip-label-text-color: var(--acp-badge-bg);--mat-chip-selected-label-text-color: var(--acp-badge-bg);--mat-chip-with-icon-icon-color: var(--acp-badge-bg);--mat-chip-with-icon-selected-icon-color: var(--acp-badge-bg);--mat-chip-with-trailing-icon-trailing-icon-color: var(--acp-badge-bg);--mat-chip-selected-trailing-icon-color: var(--acp-badge-bg);--mat-chip-outline-color: transparent}.acp-badge.acp-badge--text .acp-badge__chip.mat-mdc-chip{--mat-chip-elevated-container-color: transparent;--mat-chip-elevated-selected-container-color: transparent;--mat-chip-label-text-color: var(--acp-badge-bg);--mat-chip-selected-label-text-color: var(--acp-badge-bg);--mat-chip-with-icon-icon-color: var(--acp-badge-bg);--mat-chip-with-icon-selected-icon-color: var(--acp-badge-bg);--mat-chip-with-trailing-icon-trailing-icon-color: var(--acp-badge-bg);--mat-chip-selected-trailing-icon-color: var(--acp-badge-bg);--mat-chip-outline-color: transparent}.acp-badge.acp-badge--xs .acp-badge__chip.mat-mdc-chip{--mat-chip-container-height: 20px;--mat-chip-label-text-size: 10px}.acp-badge.acp-badge--xs .acp-badge__chip.mat-mdc-chip .mat-icon{--acp-badge-icon-size: 12px}.acp-badge.acp-badge--sm .acp-badge__chip.mat-mdc-chip{--mat-chip-container-height: 24px;--mat-chip-label-text-size: 11px}.acp-badge.acp-badge--sm .acp-badge__chip.mat-mdc-chip .mat-icon{--acp-badge-icon-size: 14px}.acp-badge.acp-badge--md .acp-badge__chip.mat-mdc-chip{--mat-chip-container-height: 28px;--mat-chip-label-text-size: 12px}.acp-badge.acp-badge--md .acp-badge__chip.mat-mdc-chip .mat-icon{--acp-badge-icon-size: 16px}.acp-badge.acp-badge--lg .acp-badge__chip.mat-mdc-chip{--mat-chip-container-height: 32px;--mat-chip-label-text-size: 14px}.acp-badge.acp-badge--lg .acp-badge__chip.mat-mdc-chip .mat-icon{--acp-badge-icon-size: 18px}.acp-badge.acp-badge--rounded .acp-badge__chip.mat-mdc-chip{--mat-chip-container-shape-radius: var(--acp-badge-container-shape, var(--mat-sys-corner-small))}.acp-badge.acp-badge--pill .acp-badge__chip.mat-mdc-chip{--mat-chip-container-shape-radius: var(--acp-badge-pill-shape, var(--mat-sys-corner-full))}.acp-badge.acp-badge--square .acp-badge__chip.mat-mdc-chip{--mat-chip-container-shape-radius: 0}.acp-badge__chip.mat-mdc-chip .mat-icon{width:var(--acp-badge-icon-size, 18px);height:var(--acp-badge-icon-size, 18px);font-size:var(--acp-badge-icon-size, 18px);line-height:var(--acp-badge-icon-size, 18px)}.acp-badge.acp-badge--interactive .acp-badge__chip.mat-mdc-chip{cursor:pointer}.acp-badge.acp-badge--disabled .acp-badge__chip.mat-mdc-chip{cursor:not-allowed;opacity:.5}.acp-badge.acp-badge--loading .acp-badge__chip.mat-mdc-chip{pointer-events:none}.acp-badge.acp-badge--selected .acp-badge__chip.mat-mdc-chip.mdc-evolution-chip--selected,.acp-badge.acp-badge--selected .acp-badge__chip.mat-mdc-chip.mat-mdc-chip-highlighted{box-shadow:inset 0 0 0 2px currentColor}@media(prefers-reduced-motion:reduce){.acp-badge__loader:after{animation:none}}@media(prefers-contrast:more){.acp-badge__chip.mat-mdc-chip{outline:2px solid currentColor;outline-offset:1px}}\n"] }]
|
|
264
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], trailingIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingIcon", required: false }] }], svgIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "svgIcon", required: false }] }], trailingSvgIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingSvgIcon", required: false }] }], trend: [{ type: i0.Input, args: [{ isSignal: true, alias: "trend", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], highlighted: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlighted", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], routerLink: [{ type: i0.Input, args: [{ isSignal: true, alias: "routerLink", required: false }] }], href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], ariaLabelOverride: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelOverride", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }], removed: [{ type: i0.Output, args: ["removed"] }], iconTemplate: [{ type: i0.ContentChild, args: ['icon', { ...{ read: TemplateRef }, isSignal: true }] }], trailingIconTemplate: [{ type: i0.ContentChild, args: ['trailingIcon', { ...{ read: TemplateRef }, isSignal: true }] }] } });
|
|
265
|
+
|
|
266
|
+
const ACP_BADGE_COLORS = [
|
|
267
|
+
'primary',
|
|
268
|
+
'secondary',
|
|
269
|
+
'tertiary',
|
|
270
|
+
'success',
|
|
271
|
+
'warning',
|
|
272
|
+
'danger',
|
|
273
|
+
'info',
|
|
274
|
+
'neutral',
|
|
275
|
+
'custom',
|
|
276
|
+
];
|
|
277
|
+
const ACP_BADGE_VARIANTS = [
|
|
278
|
+
'filled',
|
|
279
|
+
'outlined',
|
|
280
|
+
'soft',
|
|
281
|
+
'tonal',
|
|
282
|
+
'text',
|
|
283
|
+
];
|
|
284
|
+
const ACP_BADGE_SIZES = ['xs', 'sm', 'md', 'lg'];
|
|
285
|
+
const ACP_BADGE_SHAPES = ['rounded', 'pill', 'square'];
|
|
286
|
+
|
|
97
287
|
/**
|
|
98
288
|
* A versatile card component that wraps Angular Material's mat-card with additional functionality
|
|
99
289
|
* and customization options. This component provides a consistent card layout with configurable
|
|
@@ -1600,436 +1790,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
1600
1790
|
}]
|
|
1601
1791
|
}], ctorParameters: () => [] });
|
|
1602
1792
|
|
|
1603
|
-
// Configuraciones predefinidas mejoradas
|
|
1604
|
-
const AUTOCOMPLETE_WRAPPER_DEFAULT_CONFIG = {
|
|
1605
|
-
placeholder: 'Buscar...',
|
|
1606
|
-
disabled: false,
|
|
1607
|
-
debounceTime: 300,
|
|
1608
|
-
minSearchLength: 2,
|
|
1609
|
-
maxHistoryItems: 10,
|
|
1610
|
-
itemsPerPage: 10,
|
|
1611
|
-
enableStockFilter: true,
|
|
1612
|
-
stockProperty: 'stock',
|
|
1613
|
-
enablePagination: true,
|
|
1614
|
-
enableFilters: true,
|
|
1615
|
-
enableFooterActions: true,
|
|
1616
|
-
overlayWidth: '100%',
|
|
1617
|
-
overlayMaxHeight: '500px',
|
|
1618
|
-
noResultsText: 'No se encontraron resultados',
|
|
1619
|
-
sectionTitle: 'Resultados',
|
|
1620
|
-
searchMode: 'remote',
|
|
1621
|
-
searchFields: [
|
|
1622
|
-
{ value: 'description', label: 'Descripción', property: 'description' },
|
|
1623
|
-
{ value: 'code', label: 'Código', property: 'code' },
|
|
1624
|
-
{ value: 'barcode', label: 'Código de Barras', property: 'barcode' },
|
|
1625
|
-
{ value: 'auxCode', label: 'Código Auxiliar', property: 'auxCode' },
|
|
1626
|
-
],
|
|
1627
|
-
stockOptions: [
|
|
1628
|
-
{ value: 'all', label: 'Todos' },
|
|
1629
|
-
{ value: 'with-stock', label: 'Con Stock' },
|
|
1630
|
-
{ value: 'without-stock', label: 'Sin Stock' },
|
|
1631
|
-
],
|
|
1632
|
-
};
|
|
1633
|
-
const AUTOCOMPLETE_WRAPPER_PRODUCT_CONFIG = {
|
|
1634
|
-
...AUTOCOMPLETE_WRAPPER_DEFAULT_CONFIG,
|
|
1635
|
-
placeholder: 'Buscar productos...',
|
|
1636
|
-
enableStockFilter: true,
|
|
1637
|
-
enableFooterActions: true,
|
|
1638
|
-
sectionTitle: 'Productos',
|
|
1639
|
-
noResultsText: 'No se encontraron productos',
|
|
1640
|
-
};
|
|
1641
|
-
const AUTOCOMPLETE_WRAPPER_CUSTOMER_CONFIG = {
|
|
1642
|
-
...AUTOCOMPLETE_WRAPPER_DEFAULT_CONFIG,
|
|
1643
|
-
placeholder: 'Buscar clientes...',
|
|
1644
|
-
enableStockFilter: false,
|
|
1645
|
-
enableFooterActions: false,
|
|
1646
|
-
sectionTitle: 'Clientes',
|
|
1647
|
-
noResultsText: 'No se encontraron clientes',
|
|
1648
|
-
searchFields: [
|
|
1649
|
-
{ value: 'name', label: 'Nombre', property: 'name' },
|
|
1650
|
-
{ value: 'email', label: 'Email', property: 'email' },
|
|
1651
|
-
{ value: 'phone', label: 'Teléfono', property: 'phone' },
|
|
1652
|
-
{ value: 'document', label: 'Documento', property: 'document' },
|
|
1653
|
-
],
|
|
1654
|
-
};
|
|
1655
|
-
const AUTOCOMPLETE_WRAPPER_SIMPLE_CONFIG = {
|
|
1656
|
-
...AUTOCOMPLETE_WRAPPER_DEFAULT_CONFIG,
|
|
1657
|
-
placeholder: 'Buscar...',
|
|
1658
|
-
enableStockFilter: false,
|
|
1659
|
-
enableFilters: false,
|
|
1660
|
-
enableFooterActions: false,
|
|
1661
|
-
enablePagination: false,
|
|
1662
|
-
itemsPerPage: 50,
|
|
1663
|
-
sectionTitle: 'Resultados',
|
|
1664
|
-
overlayMaxHeight: '300px',
|
|
1665
|
-
};
|
|
1666
|
-
// Configuración para búsqueda local
|
|
1667
|
-
const AUTOCOMPLETE_WRAPPER_LOCAL_CONFIG = {
|
|
1668
|
-
...AUTOCOMPLETE_WRAPPER_SIMPLE_CONFIG,
|
|
1669
|
-
searchMode: 'local',
|
|
1670
|
-
debounceTime: 150, // Menos tiempo para búsqueda local
|
|
1671
|
-
minSearchLength: 1,
|
|
1672
|
-
};
|
|
1673
|
-
// Configuración para listas grandes con paginación
|
|
1674
|
-
const AUTOCOMPLETE_WRAPPER_PAGINATED_CONFIG = {
|
|
1675
|
-
...AUTOCOMPLETE_WRAPPER_DEFAULT_CONFIG,
|
|
1676
|
-
itemsPerPage: 20,
|
|
1677
|
-
enablePagination: true,
|
|
1678
|
-
overlayMaxHeight: '400px',
|
|
1679
|
-
};
|
|
1680
|
-
// Helper para crear configuración personalizada
|
|
1681
|
-
function createAutocompleteWrapperConfig(overrides) {
|
|
1682
|
-
return {
|
|
1683
|
-
...AUTOCOMPLETE_WRAPPER_DEFAULT_CONFIG,
|
|
1684
|
-
...overrides,
|
|
1685
|
-
};
|
|
1686
|
-
}
|
|
1687
|
-
|
|
1688
|
-
class AutocompleteWrapperService {
|
|
1689
|
-
historySubject = new BehaviorSubject([]);
|
|
1690
|
-
history$ = this.historySubject.asObservable();
|
|
1691
|
-
constructor() {
|
|
1692
|
-
this.loadHistoryFromStorage();
|
|
1693
|
-
}
|
|
1694
|
-
// Búsqueda local (sin API)
|
|
1695
|
-
searchLocal(items, query, filters, config) {
|
|
1696
|
-
const filtered = this.filterItems(items, query, filters, config);
|
|
1697
|
-
const page = 1; // Para búsqueda local, asumimos página 1
|
|
1698
|
-
const pageSize = config.itemsPerPage || 10;
|
|
1699
|
-
const startIndex = (page - 1) * pageSize;
|
|
1700
|
-
const pageItems = filtered.slice(startIndex, startIndex + pageSize);
|
|
1701
|
-
return of({
|
|
1702
|
-
items: pageItems,
|
|
1703
|
-
totalCount: filtered.length,
|
|
1704
|
-
hasMore: filtered.length > startIndex + pageSize,
|
|
1705
|
-
});
|
|
1706
|
-
}
|
|
1707
|
-
// Filtrar elementos basado en query y filtros
|
|
1708
|
-
filterItems(items, query, filters, config = AUTOCOMPLETE_WRAPPER_DEFAULT_CONFIG) {
|
|
1709
|
-
if (!query || query.length < (config.minSearchLength || 2)) {
|
|
1710
|
-
return [];
|
|
1711
|
-
}
|
|
1712
|
-
let filteredItems = items.filter(item => {
|
|
1713
|
-
if (item && typeof item === 'string') {
|
|
1714
|
-
return true;
|
|
1715
|
-
}
|
|
1716
|
-
// Buscar por el campo seleccionado
|
|
1717
|
-
const searchValue = this.getSearchValue(item, filters.searchBy, config);
|
|
1718
|
-
return searchValue.toLowerCase().includes(query.toLowerCase());
|
|
1719
|
-
});
|
|
1720
|
-
// Aplicar filtro de stock si está habilitado
|
|
1721
|
-
if (config.enableStockFilter && filters.stockFilter !== 'all') {
|
|
1722
|
-
filteredItems = filteredItems.filter(item => {
|
|
1723
|
-
if (typeof item === 'string')
|
|
1724
|
-
return true;
|
|
1725
|
-
const stockValue = item[config.stockProperty || 'stock'];
|
|
1726
|
-
const hasStock = stockValue !== undefined && stockValue !== null && stockValue > 0;
|
|
1727
|
-
return filters.stockFilter === 'with-stock' ? hasStock : !hasStock;
|
|
1728
|
-
});
|
|
1729
|
-
}
|
|
1730
|
-
return filteredItems;
|
|
1731
|
-
}
|
|
1732
|
-
// Simular búsqueda asíncrona
|
|
1733
|
-
searchAsync(items, query, filters, config = AUTOCOMPLETE_WRAPPER_DEFAULT_CONFIG) {
|
|
1734
|
-
const results = this.filterItems(items, query, filters, config);
|
|
1735
|
-
return of(results).pipe(delay(100)); // Simular delay de API
|
|
1736
|
-
}
|
|
1737
|
-
// Obtener valor de búsqueda según el campo seleccionado
|
|
1738
|
-
getSearchValue(item, searchBy, config) {
|
|
1739
|
-
const searchField = config.searchFields?.find(field => field.value === searchBy);
|
|
1740
|
-
if (searchField) {
|
|
1741
|
-
return item[searchField.property] || '';
|
|
1742
|
-
}
|
|
1743
|
-
// Fallback a la lógica anterior
|
|
1744
|
-
switch (searchBy) {
|
|
1745
|
-
case 'description':
|
|
1746
|
-
return item['description'] || '';
|
|
1747
|
-
case 'code':
|
|
1748
|
-
return item['code'] || item.id?.toString() || '';
|
|
1749
|
-
case 'barcode':
|
|
1750
|
-
return item['barcode'] || '';
|
|
1751
|
-
case 'auxCode':
|
|
1752
|
-
return item['auxCode'] || '';
|
|
1753
|
-
case 'email':
|
|
1754
|
-
return item['email'] || '';
|
|
1755
|
-
case 'phone':
|
|
1756
|
-
return item['phone'] || '';
|
|
1757
|
-
case 'document':
|
|
1758
|
-
return item['document'] || '';
|
|
1759
|
-
case 'name':
|
|
1760
|
-
default:
|
|
1761
|
-
return item.name || item.value || '';
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1764
|
-
// Gestión de historial específico del wrapper
|
|
1765
|
-
addToHistory(item, maxItems = 10) {
|
|
1766
|
-
const currentHistory = this.historySubject.value;
|
|
1767
|
-
// Remover si ya existe
|
|
1768
|
-
const filteredHistory = currentHistory.filter(historyItem => {
|
|
1769
|
-
if (typeof item === 'string' && typeof historyItem === 'string') {
|
|
1770
|
-
return item !== historyItem;
|
|
1771
|
-
}
|
|
1772
|
-
else if (typeof item === 'object' && typeof historyItem === 'object') {
|
|
1773
|
-
return (item.id || item.name) !== (historyItem.id || historyItem.name);
|
|
1774
|
-
}
|
|
1775
|
-
return true;
|
|
1776
|
-
});
|
|
1777
|
-
// Agregar al inicio
|
|
1778
|
-
const newHistory = [item, ...filteredHistory].slice(0, maxItems);
|
|
1779
|
-
this.historySubject.next(newHistory);
|
|
1780
|
-
this.saveHistoryToStorage(newHistory);
|
|
1781
|
-
}
|
|
1782
|
-
removeFromHistory(index) {
|
|
1783
|
-
const currentHistory = this.historySubject.value;
|
|
1784
|
-
currentHistory.splice(index, 1);
|
|
1785
|
-
this.historySubject.next([...currentHistory]);
|
|
1786
|
-
this.saveHistoryToStorage(currentHistory);
|
|
1787
|
-
}
|
|
1788
|
-
clearHistory() {
|
|
1789
|
-
this.historySubject.next([]);
|
|
1790
|
-
this.saveHistoryToStorage([]);
|
|
1791
|
-
}
|
|
1792
|
-
getHistory() {
|
|
1793
|
-
return this.historySubject.value;
|
|
1794
|
-
}
|
|
1795
|
-
// Gestión de almacenamiento específico del wrapper
|
|
1796
|
-
loadHistoryFromStorage() {
|
|
1797
|
-
try {
|
|
1798
|
-
const stored = localStorage.getItem('autocomplete_wrapper_history');
|
|
1799
|
-
if (stored) {
|
|
1800
|
-
const history = JSON.parse(stored);
|
|
1801
|
-
this.historySubject.next(history);
|
|
1802
|
-
}
|
|
1803
|
-
}
|
|
1804
|
-
catch (error) {
|
|
1805
|
-
console.warn('Error loading autocomplete wrapper history:', error);
|
|
1806
|
-
}
|
|
1807
|
-
}
|
|
1808
|
-
saveHistoryToStorage(history) {
|
|
1809
|
-
try {
|
|
1810
|
-
localStorage.setItem('autocomplete_wrapper_history', JSON.stringify(history));
|
|
1811
|
-
}
|
|
1812
|
-
catch (error) {
|
|
1813
|
-
console.warn('Error saving autocomplete wrapper history:', error);
|
|
1814
|
-
}
|
|
1815
|
-
}
|
|
1816
|
-
// Paginación
|
|
1817
|
-
paginateItems(items, page, itemsPerPage) {
|
|
1818
|
-
const startIndex = (page - 1) * itemsPerPage;
|
|
1819
|
-
const endIndex = startIndex + itemsPerPage;
|
|
1820
|
-
return items.slice(startIndex, endIndex);
|
|
1821
|
-
}
|
|
1822
|
-
getTotalPages(totalItems, itemsPerPage) {
|
|
1823
|
-
return Math.ceil(totalItems / itemsPerPage) || 1;
|
|
1824
|
-
}
|
|
1825
|
-
// Validaciones
|
|
1826
|
-
isValidPage(page, totalPages) {
|
|
1827
|
-
return page >= 1 && page <= totalPages;
|
|
1828
|
-
}
|
|
1829
|
-
// Utilidades para templates
|
|
1830
|
-
highlightText(text, query) {
|
|
1831
|
-
if (!query || !text)
|
|
1832
|
-
return text;
|
|
1833
|
-
const regex = new RegExp(`(${query})`, 'gi');
|
|
1834
|
-
return text.replace(regex, '<mark>$1</mark>');
|
|
1835
|
-
}
|
|
1836
|
-
getItemDisplayText(item, displayField = 'nombre') {
|
|
1837
|
-
if (typeof item === 'string')
|
|
1838
|
-
return item;
|
|
1839
|
-
return item[displayField] || item.name || item.value || item.id?.toString() || '';
|
|
1840
|
-
}
|
|
1841
|
-
// Configuración dinámica
|
|
1842
|
-
mergeConfig(userConfig) {
|
|
1843
|
-
return { ...AUTOCOMPLETE_WRAPPER_DEFAULT_CONFIG, ...userConfig };
|
|
1844
|
-
}
|
|
1845
|
-
// Factory para crear función de búsqueda genérica
|
|
1846
|
-
createGenericSearchFunction(config) {
|
|
1847
|
-
return (query, filters, page = 1, pageSize = 10) => {
|
|
1848
|
-
const { searchBy, ...rest } = filters;
|
|
1849
|
-
const params = {
|
|
1850
|
-
[config.queryParam || 'q']: query,
|
|
1851
|
-
[config.searchByParam || 'searchBy']: searchBy,
|
|
1852
|
-
[config.pageParam || 'page']: page,
|
|
1853
|
-
[config.pageSizeParam || 'pageSize']: pageSize,
|
|
1854
|
-
...rest,
|
|
1855
|
-
};
|
|
1856
|
-
return config.search(params).pipe(map(response => {
|
|
1857
|
-
if (config.responseMapper) {
|
|
1858
|
-
return config.responseMapper(response);
|
|
1859
|
-
}
|
|
1860
|
-
// Mapper por defecto
|
|
1861
|
-
const items = response.data || response.items || response;
|
|
1862
|
-
const totalRecords = response.totalRecords || response.totalCount || response.total || 0;
|
|
1863
|
-
return {
|
|
1864
|
-
items,
|
|
1865
|
-
totalCount: totalRecords,
|
|
1866
|
-
hasMore: response.hasMore || false,
|
|
1867
|
-
};
|
|
1868
|
-
}));
|
|
1869
|
-
};
|
|
1870
|
-
}
|
|
1871
|
-
// Función para crear datos de ejemplo/mock específicos del wrapper
|
|
1872
|
-
createMockData() {
|
|
1873
|
-
return [
|
|
1874
|
-
{
|
|
1875
|
-
id: 1,
|
|
1876
|
-
name: 'iPhone 14 Pro 128GB',
|
|
1877
|
-
description: 'Smartphone Apple con chip A16 Bionic y cámara Pro',
|
|
1878
|
-
code: 'IP14P-128',
|
|
1879
|
-
barcode: '1234567890123',
|
|
1880
|
-
auxCode: 'APL-IP14P-128',
|
|
1881
|
-
stock: 15,
|
|
1882
|
-
category: 'Smartphones',
|
|
1883
|
-
brand: 'Apple',
|
|
1884
|
-
unit: 'unidad',
|
|
1885
|
-
prices: [
|
|
1886
|
-
{
|
|
1887
|
-
id: 1,
|
|
1888
|
-
type: 'retail',
|
|
1889
|
-
label: 'Público',
|
|
1890
|
-
value: 999,
|
|
1891
|
-
currency: 'USD',
|
|
1892
|
-
includesTax: true,
|
|
1893
|
-
isDefault: true,
|
|
1894
|
-
isActive: true,
|
|
1895
|
-
},
|
|
1896
|
-
{
|
|
1897
|
-
id: 2,
|
|
1898
|
-
type: 'wholesale',
|
|
1899
|
-
label: 'Mayorista',
|
|
1900
|
-
value: 850,
|
|
1901
|
-
currency: 'USD',
|
|
1902
|
-
minQuantity: 5,
|
|
1903
|
-
includesTax: false,
|
|
1904
|
-
isActive: true,
|
|
1905
|
-
},
|
|
1906
|
-
{
|
|
1907
|
-
id: 3,
|
|
1908
|
-
type: 'vip',
|
|
1909
|
-
label: 'VIP',
|
|
1910
|
-
value: 899,
|
|
1911
|
-
currency: 'USD',
|
|
1912
|
-
includesTax: true,
|
|
1913
|
-
isActive: true,
|
|
1914
|
-
},
|
|
1915
|
-
{
|
|
1916
|
-
id: 4,
|
|
1917
|
-
type: 'promotional',
|
|
1918
|
-
label: 'Black Friday',
|
|
1919
|
-
value: 749,
|
|
1920
|
-
currency: 'USD',
|
|
1921
|
-
validFrom: new Date('2024-11-24'),
|
|
1922
|
-
validTo: new Date('2024-11-30'),
|
|
1923
|
-
includesTax: true,
|
|
1924
|
-
isActive: true,
|
|
1925
|
-
},
|
|
1926
|
-
],
|
|
1927
|
-
},
|
|
1928
|
-
{
|
|
1929
|
-
id: 2,
|
|
1930
|
-
name: 'Samsung Galaxy S23 256GB',
|
|
1931
|
-
description: 'Flagship Android con cámara de 200MP',
|
|
1932
|
-
code: 'SGS23-256',
|
|
1933
|
-
barcode: '2345678901234',
|
|
1934
|
-
auxCode: 'SAM-GS23-256',
|
|
1935
|
-
stock: 0,
|
|
1936
|
-
category: 'Smartphones',
|
|
1937
|
-
brand: 'Samsung',
|
|
1938
|
-
unit: 'unidad',
|
|
1939
|
-
images: [
|
|
1940
|
-
{
|
|
1941
|
-
id: 1,
|
|
1942
|
-
url: 'https://images.unsplash.com/photo-1592750475338-74b7b21085ab?w=400',
|
|
1943
|
-
thumbnailUrl: 'https://images.unsplash.com/photo-1592750475338-74b7b21085ab?w=200',
|
|
1944
|
-
alt: 'Samsung Galaxy S23 frontal',
|
|
1945
|
-
type: 'main',
|
|
1946
|
-
isPrimary: true,
|
|
1947
|
-
order: 1,
|
|
1948
|
-
},
|
|
1949
|
-
{
|
|
1950
|
-
id: 2,
|
|
1951
|
-
url: 'https://images.unsplash.com/photo-1574755393849-623942496936?w=400',
|
|
1952
|
-
thumbnailUrl: 'https://images.unsplash.com/photo-1574755393849-623942496936?w=200',
|
|
1953
|
-
alt: 'Samsung Galaxy S23 trasero',
|
|
1954
|
-
type: 'gallery',
|
|
1955
|
-
order: 2,
|
|
1956
|
-
},
|
|
1957
|
-
],
|
|
1958
|
-
badges: [{ type: 'new', text: 'NUEVO' }, { type: 'bestseller' }],
|
|
1959
|
-
prices: [
|
|
1960
|
-
{
|
|
1961
|
-
id: 5,
|
|
1962
|
-
type: 'retail',
|
|
1963
|
-
label: 'Público',
|
|
1964
|
-
value: 799,
|
|
1965
|
-
currency: 'USD',
|
|
1966
|
-
includesTax: true,
|
|
1967
|
-
isDefault: true,
|
|
1968
|
-
isActive: true,
|
|
1969
|
-
},
|
|
1970
|
-
{
|
|
1971
|
-
id: 6,
|
|
1972
|
-
type: 'wholesale',
|
|
1973
|
-
label: 'Mayorista',
|
|
1974
|
-
value: 679,
|
|
1975
|
-
currency: 'USD',
|
|
1976
|
-
minQuantity: 3,
|
|
1977
|
-
includesTax: false,
|
|
1978
|
-
isActive: true,
|
|
1979
|
-
},
|
|
1980
|
-
],
|
|
1981
|
-
},
|
|
1982
|
-
];
|
|
1983
|
-
}
|
|
1984
|
-
// Métodos específicos para diferentes tipos de búsqueda
|
|
1985
|
-
searchProducts(query, filters = {}) {
|
|
1986
|
-
const defaultFilters = {
|
|
1987
|
-
searchBy: 'description',
|
|
1988
|
-
stockFilter: 'all',
|
|
1989
|
-
...filters,
|
|
1990
|
-
};
|
|
1991
|
-
const mockData = this.createMockData();
|
|
1992
|
-
return this.searchLocal(mockData, query, defaultFilters, AUTOCOMPLETE_WRAPPER_DEFAULT_CONFIG);
|
|
1993
|
-
}
|
|
1994
|
-
// Crear configuración específica para diferentes casos de uso
|
|
1995
|
-
createProductSearchConfig() {
|
|
1996
|
-
return this.mergeConfig({
|
|
1997
|
-
placeholder: 'Buscar productos...',
|
|
1998
|
-
enableStockFilter: true,
|
|
1999
|
-
enableFooterActions: true,
|
|
2000
|
-
sectionTitle: 'Productos',
|
|
2001
|
-
searchFields: [
|
|
2002
|
-
{ value: 'description', label: 'Descripción', property: 'description' },
|
|
2003
|
-
{ value: 'code', label: 'Código', property: 'code' },
|
|
2004
|
-
{ value: 'barcode', label: 'Código de Barras', property: 'barcode' },
|
|
2005
|
-
{ value: 'auxCode', label: 'Código Auxiliar', property: 'auxCode' },
|
|
2006
|
-
],
|
|
2007
|
-
});
|
|
2008
|
-
}
|
|
2009
|
-
createCustomerSearchConfig() {
|
|
2010
|
-
return this.mergeConfig({
|
|
2011
|
-
placeholder: 'Buscar clientes...',
|
|
2012
|
-
enableStockFilter: false,
|
|
2013
|
-
enableFooterActions: false,
|
|
2014
|
-
sectionTitle: 'Clientes',
|
|
2015
|
-
searchFields: [
|
|
2016
|
-
{ value: 'name', label: 'Nombre', property: 'name' },
|
|
2017
|
-
{ value: 'email', label: 'Email', property: 'email' },
|
|
2018
|
-
{ value: 'phone', label: 'Teléfono', property: 'phone' },
|
|
2019
|
-
{ value: 'document', label: 'Documento', property: 'document' },
|
|
2020
|
-
],
|
|
2021
|
-
});
|
|
2022
|
-
}
|
|
2023
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AutocompleteWrapperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2024
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AutocompleteWrapperService, providedIn: 'root' });
|
|
2025
|
-
}
|
|
2026
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AutocompleteWrapperService, decorators: [{
|
|
2027
|
-
type: Injectable,
|
|
2028
|
-
args: [{
|
|
2029
|
-
providedIn: 'root',
|
|
2030
|
-
}]
|
|
2031
|
-
}], ctorParameters: () => [] });
|
|
2032
|
-
|
|
2033
1793
|
/**
|
|
2034
1794
|
* A theme toggle button component that allows users to switch between
|
|
2035
1795
|
* light and dark modes. Follows WAI-ARIA best practices for toggle buttons.
|
|
@@ -2075,489 +1835,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
2075
1835
|
}, template: "<button\n mat-icon-button\n type=\"button\"\n (click)=\"toggleDarkMode()\"\n [attr.aria-label]=\"currentLabel()\"\n [attr.aria-pressed]=\"isDarkMode()\"\n [matTooltip]=\"currentLabel()\"\n [attr.data-testid]=\"testId() || null\"\n>\n <mat-icon>{{ currentIcon() }}</mat-icon>\n</button>\n", styles: [".acp-theme-toggle{display:inline-block}\n"] }]
|
|
2076
1836
|
}], propDecorators: { lightModeIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "lightModeIcon", required: false }] }], darkModeIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "darkModeIcon", required: false }] }], lightModeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "lightModeLabel", required: false }] }], darkModeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "darkModeLabel", required: false }] }], testId: [{ type: i0.Input, args: [{ isSignal: true, alias: "testId", required: false }] }] } });
|
|
2077
1837
|
|
|
2078
|
-
class Pagination {
|
|
2079
|
-
totalRecords;
|
|
2080
|
-
pageSize;
|
|
2081
|
-
pageIndex;
|
|
2082
|
-
pageSizeOptions;
|
|
2083
|
-
hidePageSize;
|
|
2084
|
-
showPageSizeOptions;
|
|
2085
|
-
showFirstLastButtons;
|
|
2086
|
-
disabled;
|
|
2087
|
-
/**
|
|
2088
|
-
* @param pageIndex Current page index (0-based for MatPaginator compatibility)
|
|
2089
|
-
* @param pageSize Number of records per page
|
|
2090
|
-
* @param totalRecords Total number of records
|
|
2091
|
-
* @param pageSizeOptions Available page size options
|
|
2092
|
-
* @param options Display and behavior options
|
|
2093
|
-
*/
|
|
2094
|
-
constructor(pageIndex = 0, // MatPaginator starts at 0
|
|
2095
|
-
pageSize = 25, totalRecords = 0, pageSizeOptions = [25, 50, 75, 100], options = {}) {
|
|
2096
|
-
this.pageIndex = pageIndex;
|
|
2097
|
-
this.pageSize = pageSize;
|
|
2098
|
-
this.totalRecords = totalRecords;
|
|
2099
|
-
this.pageSizeOptions = pageSizeOptions;
|
|
2100
|
-
this.hidePageSize = options.hidePageSize ?? false;
|
|
2101
|
-
this.showPageSizeOptions = options.showPageSizeOptions ?? true;
|
|
2102
|
-
this.showFirstLastButtons = options.showFirstLastButtons ?? true;
|
|
2103
|
-
this.disabled = options.disabled ?? false;
|
|
2104
|
-
}
|
|
2105
|
-
/**
|
|
2106
|
-
* Calculates the total number of pages.
|
|
2107
|
-
*/
|
|
2108
|
-
getTotalPages() {
|
|
2109
|
-
return Math.ceil(this.totalRecords / this.pageSize);
|
|
2110
|
-
}
|
|
2111
|
-
/**
|
|
2112
|
-
* Handles page event similar to Angular Material example.
|
|
2113
|
-
* @param event MatPaginator PageEvent
|
|
2114
|
-
*/
|
|
2115
|
-
handlePageEvent(event) {
|
|
2116
|
-
this.totalRecords = event.length;
|
|
2117
|
-
this.pageSize = event.pageSize;
|
|
2118
|
-
this.pageIndex = event.pageIndex;
|
|
2119
|
-
}
|
|
2120
|
-
}
|
|
2121
|
-
|
|
2122
|
-
class ReusableAutocompleteComponent {
|
|
2123
|
-
static inputIdCounter = 0;
|
|
2124
|
-
inputId = `acp-autocomplete-search-input-${++ReusableAutocompleteComponent.inputIdCounter}`;
|
|
2125
|
-
dataSource = input([], /* @ts-ignore */
|
|
2126
|
-
...(ngDevMode ? [{ debugName: "dataSource" }] : /* istanbul ignore next */ [])); // Para búsqueda local
|
|
2127
|
-
config = AUTOCOMPLETE_WRAPPER_DEFAULT_CONFIG;
|
|
2128
|
-
itemTemplate = input(/* @ts-ignore */
|
|
2129
|
-
...(ngDevMode ? [undefined, { debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
2130
|
-
searchFunction = input(/* @ts-ignore */
|
|
2131
|
-
...(ngDevMode ? [undefined, { debugName: "searchFunction" }] : /* istanbul ignore next */ []));
|
|
2132
|
-
notFoundTemplate = input(/* @ts-ignore */
|
|
2133
|
-
...(ngDevMode ? [undefined, { debugName: "notFoundTemplate" }] : /* istanbul ignore next */ []));
|
|
2134
|
-
overlayWidth = input('auto', /* @ts-ignore */
|
|
2135
|
-
...(ngDevMode ? [{ debugName: "overlayWidth" }] : /* istanbul ignore next */ []));
|
|
2136
|
-
overlayMaxHeight = input('400px', /* @ts-ignore */
|
|
2137
|
-
...(ngDevMode ? [{ debugName: "overlayMaxHeight" }] : /* istanbul ignore next */ []));
|
|
2138
|
-
itemSelected = output();
|
|
2139
|
-
searchChanged = output();
|
|
2140
|
-
searchRequested = output(); // Nuevo evento
|
|
2141
|
-
pageChanged = output();
|
|
2142
|
-
filterChanged = output();
|
|
2143
|
-
advancedSearchClicked = output();
|
|
2144
|
-
allResultsClicked = output();
|
|
2145
|
-
createClicked = output();
|
|
2146
|
-
searchInput = viewChild.required('searchInput');
|
|
2147
|
-
historyListElement = viewChild('historyListElement', /* @ts-ignore */
|
|
2148
|
-
...(ngDevMode ? [{ debugName: "historyListElement" }] : /* istanbul ignore next */ []));
|
|
2149
|
-
resultsListElement = viewChild('resultsListElement', /* @ts-ignore */
|
|
2150
|
-
...(ngDevMode ? [{ debugName: "resultsListElement" }] : /* istanbul ignore next */ []));
|
|
2151
|
-
// State
|
|
2152
|
-
query = '';
|
|
2153
|
-
isLoading = signal(false, /* @ts-ignore */
|
|
2154
|
-
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
2155
|
-
overlayOpen = signal(false, /* @ts-ignore */
|
|
2156
|
-
...(ngDevMode ? [{ debugName: "overlayOpen" }] : /* istanbul ignore next */ []));
|
|
2157
|
-
selectedIndex = signal(-1, /* @ts-ignore */
|
|
2158
|
-
...(ngDevMode ? [{ debugName: "selectedIndex" }] : /* istanbul ignore next */ []));
|
|
2159
|
-
currentPage = signal(1, /* @ts-ignore */
|
|
2160
|
-
...(ngDevMode ? [{ debugName: "currentPage" }] : /* istanbul ignore next */ []));
|
|
2161
|
-
filteredItems = signal([], /* @ts-ignore */
|
|
2162
|
-
...(ngDevMode ? [{ debugName: "filteredItems" }] : /* istanbul ignore next */ []));
|
|
2163
|
-
historyList = signal([], /* @ts-ignore */
|
|
2164
|
-
...(ngDevMode ? [{ debugName: "historyList" }] : /* istanbul ignore next */ []));
|
|
2165
|
-
totalCount = signal(0, /* @ts-ignore */
|
|
2166
|
-
...(ngDevMode ? [{ debugName: "totalCount" }] : /* istanbul ignore next */ []));
|
|
2167
|
-
// Filters
|
|
2168
|
-
filters = {
|
|
2169
|
-
searchBy: 'name',
|
|
2170
|
-
stockFilter: 'all',
|
|
2171
|
-
};
|
|
2172
|
-
// Computed properties
|
|
2173
|
-
isHistoryVisible = computed(() => {
|
|
2174
|
-
return this.query.length < (this.config.minSearchLength || 2) && this.historyList().length > 0;
|
|
2175
|
-
}, /* @ts-ignore */
|
|
2176
|
-
...(ngDevMode ? [{ debugName: "isHistoryVisible" }] : /* istanbul ignore next */ []));
|
|
2177
|
-
totalItems = computed(() => this.filteredItems().length, /* @ts-ignore */
|
|
2178
|
-
...(ngDevMode ? [{ debugName: "totalItems" }] : /* istanbul ignore next */ []));
|
|
2179
|
-
totalPages = computed(() => {
|
|
2180
|
-
const total = this.totalCount();
|
|
2181
|
-
return total > 0 ? Math.ceil(total / (this.config.itemsPerPage || 10)) : 1;
|
|
2182
|
-
}, /* @ts-ignore */
|
|
2183
|
-
...(ngDevMode ? [{ debugName: "totalPages" }] : /* istanbul ignore next */ []));
|
|
2184
|
-
currentPageItems = computed(() => {
|
|
2185
|
-
return this.filteredItems();
|
|
2186
|
-
}, /* @ts-ignore */
|
|
2187
|
-
...(ngDevMode ? [{ debugName: "currentPageItems" }] : /* istanbul ignore next */ []));
|
|
2188
|
-
startItem = computed(() => {
|
|
2189
|
-
const total = this.totalItems();
|
|
2190
|
-
if (total === 0)
|
|
2191
|
-
return 0;
|
|
2192
|
-
return (this.currentPage() - 1) * (this.config.itemsPerPage || 10) + 1;
|
|
2193
|
-
}, /* @ts-ignore */
|
|
2194
|
-
...(ngDevMode ? [{ debugName: "startItem" }] : /* istanbul ignore next */ []));
|
|
2195
|
-
endItem = computed(() => {
|
|
2196
|
-
const total = this.totalItems();
|
|
2197
|
-
const calculated = this.currentPage() * (this.config.itemsPerPage || 10);
|
|
2198
|
-
return Math.min(calculated, total);
|
|
2199
|
-
}, /* @ts-ignore */
|
|
2200
|
-
...(ngDevMode ? [{ debugName: "endItem" }] : /* istanbul ignore next */ []));
|
|
2201
|
-
sectionTitle = computed(() => {
|
|
2202
|
-
const total = this.totalItems();
|
|
2203
|
-
return `Resultados (${total})`;
|
|
2204
|
-
}, /* @ts-ignore */
|
|
2205
|
-
...(ngDevMode ? [{ debugName: "sectionTitle" }] : /* istanbul ignore next */ []));
|
|
2206
|
-
isNoResults = computed(() => {
|
|
2207
|
-
return (this.totalItems() === 0 &&
|
|
2208
|
-
!this.isLoading() &&
|
|
2209
|
-
this.query.length >= (this.config.minSearchLength || 2));
|
|
2210
|
-
}, /* @ts-ignore */
|
|
2211
|
-
...(ngDevMode ? [{ debugName: "isNoResults" }] : /* istanbul ignore next */ []));
|
|
2212
|
-
// Private
|
|
2213
|
-
destroy$ = new Subject();
|
|
2214
|
-
searchSubject = new Subject();
|
|
2215
|
-
autocompleteService = inject(AutocompleteWrapperService);
|
|
2216
|
-
ngOnInit() {
|
|
2217
|
-
this.mergeDefaultConfig();
|
|
2218
|
-
this.setupSearch();
|
|
2219
|
-
this.loadHistory();
|
|
2220
|
-
}
|
|
2221
|
-
ngOnDestroy() {
|
|
2222
|
-
this.destroy$.next();
|
|
2223
|
-
this.destroy$.complete();
|
|
2224
|
-
}
|
|
2225
|
-
mergeDefaultConfig() {
|
|
2226
|
-
this.config = this.autocompleteService.mergeConfig(this.config);
|
|
2227
|
-
this.filters.searchBy = this.config.searchFields?.[0]?.value || 'name';
|
|
2228
|
-
this.filters.stockFilter = this.config.stockOptions?.[0]?.value || 'all';
|
|
2229
|
-
}
|
|
2230
|
-
setupSearch() {
|
|
2231
|
-
this.filteredItems.set([]);
|
|
2232
|
-
this.searchSubject
|
|
2233
|
-
.pipe(debounceTime(this.config.debounceTime || 300),
|
|
2234
|
-
// distinctUntilChanged(),
|
|
2235
|
-
// distinctUntilChanged((prev, curr) => {
|
|
2236
|
-
// console.log(prev);
|
|
2237
|
-
// console.log(curr);
|
|
2238
|
-
// return prev.query === curr.query &&
|
|
2239
|
-
// JSON.stringify(prev.filters) === JSON.stringify(curr.filters) &&
|
|
2240
|
-
// prev.page === curr.page
|
|
2241
|
-
//
|
|
2242
|
-
// }
|
|
2243
|
-
//
|
|
2244
|
-
// ),
|
|
2245
|
-
takeUntil(this.destroy$), switchMap(({ query }) => this.performSearch(query)))
|
|
2246
|
-
.subscribe(result => {
|
|
2247
|
-
this.filteredItems.set(result.items);
|
|
2248
|
-
this.totalCount.set(result.totalCount);
|
|
2249
|
-
this.isLoading.set(false);
|
|
2250
|
-
});
|
|
2251
|
-
}
|
|
2252
|
-
performSearch(query) {
|
|
2253
|
-
if (query.length < (this.config.minSearchLength || 2)) {
|
|
2254
|
-
return of({ items: [], totalCount: 0 });
|
|
2255
|
-
}
|
|
2256
|
-
// ESTRATEGIA A: Función de búsqueda personalizada
|
|
2257
|
-
const searchFunction = this.searchFunction();
|
|
2258
|
-
if (searchFunction) {
|
|
2259
|
-
return searchFunction(query, this.filters, this.currentPage(), this.config.itemsPerPage || 10).pipe(catchError$1(() => of({ items: [], totalCount: 0 })));
|
|
2260
|
-
}
|
|
2261
|
-
// ESTRATEGIA B: Emit evento para que el padre maneje
|
|
2262
|
-
if (this.config.searchMode === 'remote') {
|
|
2263
|
-
this.searchRequested.emit({
|
|
2264
|
-
query,
|
|
2265
|
-
filters: this.filters,
|
|
2266
|
-
page: this.currentPage(),
|
|
2267
|
-
});
|
|
2268
|
-
return of({ items: [], totalCount: 0 }); // El padre actualizará los datos
|
|
2269
|
-
}
|
|
2270
|
-
// ESTRATEGIA C: Búsqueda local (fallback)
|
|
2271
|
-
return this.autocompleteService.searchLocal(this.dataSource(), query, this.filters, this.config);
|
|
2272
|
-
}
|
|
2273
|
-
loadHistory() {
|
|
2274
|
-
this.autocompleteService.history$.pipe(takeUntil(this.destroy$)).subscribe(history => {
|
|
2275
|
-
this.historyList.set(history);
|
|
2276
|
-
});
|
|
2277
|
-
}
|
|
2278
|
-
searchSubjectNext() {
|
|
2279
|
-
this.searchSubject.next({
|
|
2280
|
-
query: this.query,
|
|
2281
|
-
filters: this.filters,
|
|
2282
|
-
page: this.currentPage(),
|
|
2283
|
-
});
|
|
2284
|
-
}
|
|
2285
|
-
// Event Handlers
|
|
2286
|
-
onInput(event) {
|
|
2287
|
-
const target = event.target;
|
|
2288
|
-
this.query = target.value;
|
|
2289
|
-
this.selectedIndex.set(-1);
|
|
2290
|
-
this.currentPage.set(1);
|
|
2291
|
-
if (this.query.length >= (this.config.minSearchLength || 2)) {
|
|
2292
|
-
this.isLoading.set(true);
|
|
2293
|
-
this.searchSubjectNext();
|
|
2294
|
-
}
|
|
2295
|
-
else {
|
|
2296
|
-
this.filteredItems.set([]);
|
|
2297
|
-
this.isLoading.set(false);
|
|
2298
|
-
}
|
|
2299
|
-
this.showOverlay();
|
|
2300
|
-
this.searchChanged.emit(this.query);
|
|
2301
|
-
}
|
|
2302
|
-
onKeyDown(event) {
|
|
2303
|
-
const currentList = this.isHistoryVisible() ? this.historyList() : this.currentPageItems();
|
|
2304
|
-
const maxIndex = currentList.length - 1;
|
|
2305
|
-
switch (event.key) {
|
|
2306
|
-
case 'ArrowDown':
|
|
2307
|
-
this.handleArrowDown(maxIndex, event);
|
|
2308
|
-
break;
|
|
2309
|
-
case 'ArrowUp':
|
|
2310
|
-
this.handleArrowUp(maxIndex, event);
|
|
2311
|
-
break;
|
|
2312
|
-
case 'Enter':
|
|
2313
|
-
this.handleEnter(currentList, maxIndex, event);
|
|
2314
|
-
break;
|
|
2315
|
-
case 'Escape':
|
|
2316
|
-
this.handleEscape(event);
|
|
2317
|
-
break;
|
|
2318
|
-
case 'PageDown':
|
|
2319
|
-
this.handlePageDown(event);
|
|
2320
|
-
break;
|
|
2321
|
-
case 'PageUp':
|
|
2322
|
-
this.handlePageUp(event);
|
|
2323
|
-
break;
|
|
2324
|
-
}
|
|
2325
|
-
}
|
|
2326
|
-
handleArrowDown(maxIndex, event) {
|
|
2327
|
-
event?.preventDefault();
|
|
2328
|
-
if (maxIndex >= 0) {
|
|
2329
|
-
const nextIndex = this.selectedIndex() < maxIndex ? this.selectedIndex() + 1 : 0;
|
|
2330
|
-
this.selectedIndex.set(nextIndex);
|
|
2331
|
-
this.scrollToSelected();
|
|
2332
|
-
}
|
|
2333
|
-
}
|
|
2334
|
-
handleArrowUp(maxIndex, event) {
|
|
2335
|
-
event?.preventDefault();
|
|
2336
|
-
if (maxIndex >= 0) {
|
|
2337
|
-
const prevIndex = this.selectedIndex() > 0 ? this.selectedIndex() - 1 : maxIndex;
|
|
2338
|
-
this.selectedIndex.set(prevIndex);
|
|
2339
|
-
this.scrollToSelected();
|
|
2340
|
-
}
|
|
2341
|
-
}
|
|
2342
|
-
handleEnter(currentList, maxIndex, event) {
|
|
2343
|
-
event?.preventDefault();
|
|
2344
|
-
if (this.selectedIndex() >= 0 && this.selectedIndex() <= maxIndex) {
|
|
2345
|
-
this.selectItem(currentList[this.selectedIndex()]);
|
|
2346
|
-
}
|
|
2347
|
-
}
|
|
2348
|
-
handleEscape(event) {
|
|
2349
|
-
event?.preventDefault();
|
|
2350
|
-
this.hideOverlay();
|
|
2351
|
-
}
|
|
2352
|
-
handlePageDown(event) {
|
|
2353
|
-
event?.preventDefault();
|
|
2354
|
-
if (!this.isHistoryVisible() && this.config.enablePagination) {
|
|
2355
|
-
this.goToNextPage();
|
|
2356
|
-
}
|
|
2357
|
-
}
|
|
2358
|
-
handlePageUp(event) {
|
|
2359
|
-
event?.preventDefault();
|
|
2360
|
-
if (!this.isHistoryVisible() && this.config.enablePagination) {
|
|
2361
|
-
this.goToPreviousPage();
|
|
2362
|
-
}
|
|
2363
|
-
}
|
|
2364
|
-
onFilterChange() {
|
|
2365
|
-
this.currentPage.set(1);
|
|
2366
|
-
if (this.query.length >= (this.config.minSearchLength || 2)) {
|
|
2367
|
-
this.performSearch(this.query);
|
|
2368
|
-
this.searchSubjectNext();
|
|
2369
|
-
}
|
|
2370
|
-
}
|
|
2371
|
-
// Método público para actualizar resultados desde el padre
|
|
2372
|
-
updateSearchResults(result) {
|
|
2373
|
-
this.filteredItems.set(result.items);
|
|
2374
|
-
this.totalCount.set(result.totalCount);
|
|
2375
|
-
this.isLoading.set(false);
|
|
2376
|
-
}
|
|
2377
|
-
// Overlay Methods
|
|
2378
|
-
showOverlay() {
|
|
2379
|
-
this.overlayOpen.set(true);
|
|
2380
|
-
}
|
|
2381
|
-
hideOverlay() {
|
|
2382
|
-
this.overlayOpen.set(false);
|
|
2383
|
-
this.selectedIndex.set(-1);
|
|
2384
|
-
}
|
|
2385
|
-
isType(item) {
|
|
2386
|
-
return typeof item === 'string';
|
|
2387
|
-
}
|
|
2388
|
-
// Selection Methods
|
|
2389
|
-
selectItem(item) {
|
|
2390
|
-
if (this.config.clearInput) {
|
|
2391
|
-
this.query = '';
|
|
2392
|
-
}
|
|
2393
|
-
else {
|
|
2394
|
-
this.query = this.getItemDisplayText(item);
|
|
2395
|
-
}
|
|
2396
|
-
this.hideOverlay();
|
|
2397
|
-
this.currentPage.set(1);
|
|
2398
|
-
this.autocompleteService.addToHistory(item, this.config.maxHistoryItems);
|
|
2399
|
-
this.itemSelected.emit(item);
|
|
2400
|
-
setTimeout(() => {
|
|
2401
|
-
this.searchInput()?.nativeElement?.focus();
|
|
2402
|
-
}, 100);
|
|
2403
|
-
}
|
|
2404
|
-
clearSearch() {
|
|
2405
|
-
this.query = '';
|
|
2406
|
-
this.filteredItems.set([]);
|
|
2407
|
-
this.selectedIndex.set(-1);
|
|
2408
|
-
this.currentPage.set(1);
|
|
2409
|
-
this.searchInput()?.nativeElement?.focus();
|
|
2410
|
-
this.searchChanged.emit('');
|
|
2411
|
-
}
|
|
2412
|
-
// History Methods
|
|
2413
|
-
removeHistoryItem(index, event) {
|
|
2414
|
-
event.stopPropagation();
|
|
2415
|
-
this.autocompleteService.removeFromHistory(index);
|
|
2416
|
-
}
|
|
2417
|
-
clearHistory() {
|
|
2418
|
-
this.autocompleteService.clearHistory();
|
|
2419
|
-
}
|
|
2420
|
-
// Pagination Methods
|
|
2421
|
-
goToPage(event) {
|
|
2422
|
-
const target = event.target;
|
|
2423
|
-
const page = Number.parseInt(target.value);
|
|
2424
|
-
if (this.autocompleteService.isValidPage(page, this.totalPages())) {
|
|
2425
|
-
this.currentPage.set(page);
|
|
2426
|
-
this.selectedIndex.set(-1);
|
|
2427
|
-
this.pageChanged.emit(page);
|
|
2428
|
-
this.searchSubjectNext();
|
|
2429
|
-
}
|
|
2430
|
-
else {
|
|
2431
|
-
target.value = this.currentPage().toString();
|
|
2432
|
-
}
|
|
2433
|
-
}
|
|
2434
|
-
goToFirstPage() {
|
|
2435
|
-
if (this.currentPage() !== 1) {
|
|
2436
|
-
this.currentPage.set(1);
|
|
2437
|
-
this.selectedIndex.set(-1);
|
|
2438
|
-
this.pageChanged.emit(1);
|
|
2439
|
-
this.searchSubjectNext();
|
|
2440
|
-
}
|
|
2441
|
-
}
|
|
2442
|
-
goToPreviousPage() {
|
|
2443
|
-
const prevPage = this.currentPage() - 1;
|
|
2444
|
-
if (prevPage >= 1) {
|
|
2445
|
-
this.currentPage.set(prevPage);
|
|
2446
|
-
this.selectedIndex.set(-1);
|
|
2447
|
-
this.pageChanged.emit(prevPage);
|
|
2448
|
-
this.searchSubjectNext();
|
|
2449
|
-
}
|
|
2450
|
-
}
|
|
2451
|
-
goToNextPage() {
|
|
2452
|
-
const nextPage = this.currentPage() + 1;
|
|
2453
|
-
if (nextPage <= this.totalPages()) {
|
|
2454
|
-
this.currentPage.set(nextPage);
|
|
2455
|
-
this.selectedIndex.set(-1);
|
|
2456
|
-
this.pageChanged.emit(nextPage);
|
|
2457
|
-
this.searchSubjectNext();
|
|
2458
|
-
}
|
|
2459
|
-
}
|
|
2460
|
-
goToLastPage() {
|
|
2461
|
-
const lastPage = this.totalPages();
|
|
2462
|
-
if (this.currentPage() !== lastPage) {
|
|
2463
|
-
this.currentPage.set(lastPage);
|
|
2464
|
-
this.selectedIndex.set(-1);
|
|
2465
|
-
this.pageChanged.emit(lastPage);
|
|
2466
|
-
this.searchSubjectNext();
|
|
2467
|
-
}
|
|
2468
|
-
}
|
|
2469
|
-
// Footer Actions
|
|
2470
|
-
onCreateNew(_$event) {
|
|
2471
|
-
this.createClicked.emit(this.query);
|
|
2472
|
-
}
|
|
2473
|
-
onAdvancedSearch() {
|
|
2474
|
-
this.hideOverlay();
|
|
2475
|
-
this.advancedSearchClicked.emit();
|
|
2476
|
-
}
|
|
2477
|
-
onShowAllResults() {
|
|
2478
|
-
this.hideOverlay();
|
|
2479
|
-
this.allResultsClicked.emit(this.query);
|
|
2480
|
-
}
|
|
2481
|
-
// Utility Methods
|
|
2482
|
-
getItemDisplayText(item) {
|
|
2483
|
-
return this.autocompleteService.getItemDisplayText(item);
|
|
2484
|
-
}
|
|
2485
|
-
noResultsText() {
|
|
2486
|
-
return `No se encontraron resultados para "${this.query}"`;
|
|
2487
|
-
}
|
|
2488
|
-
scrollToSelected() {
|
|
2489
|
-
const listElement = this.isHistoryVisible()
|
|
2490
|
-
? this.historyListElement()?.nativeElement
|
|
2491
|
-
: this.resultsListElement()?.nativeElement;
|
|
2492
|
-
if (listElement) {
|
|
2493
|
-
const selectedElement = listElement.children[this.selectedIndex()];
|
|
2494
|
-
if (selectedElement) {
|
|
2495
|
-
selectedElement.scrollIntoView({
|
|
2496
|
-
block: 'nearest',
|
|
2497
|
-
behavior: 'smooth',
|
|
2498
|
-
});
|
|
2499
|
-
}
|
|
2500
|
-
}
|
|
2501
|
-
}
|
|
2502
|
-
// Public API
|
|
2503
|
-
getState() {
|
|
2504
|
-
return {
|
|
2505
|
-
query: this.query,
|
|
2506
|
-
isLoading: this.isLoading(),
|
|
2507
|
-
overlayOpen: this.overlayOpen(),
|
|
2508
|
-
selectedIndex: this.selectedIndex(),
|
|
2509
|
-
pagination: {
|
|
2510
|
-
currentPage: this.currentPage(),
|
|
2511
|
-
totalPages: this.totalPages(),
|
|
2512
|
-
totalItems: this.totalItems(),
|
|
2513
|
-
itemsPerPage: this.config.itemsPerPage || 10,
|
|
2514
|
-
startItem: this.startItem(),
|
|
2515
|
-
endItem: this.endItem(),
|
|
2516
|
-
hasNextPage: this.currentPage() < this.totalPages(),
|
|
2517
|
-
hasPreviousPage: this.currentPage() > 1,
|
|
2518
|
-
},
|
|
2519
|
-
hasResults: this.totalItems() > 0,
|
|
2520
|
-
isHistoryVisible: this.isHistoryVisible(),
|
|
2521
|
-
historyCount: this.historyList().length,
|
|
2522
|
-
filters: this.filters,
|
|
2523
|
-
};
|
|
2524
|
-
}
|
|
2525
|
-
setQuery(query) {
|
|
2526
|
-
this.query = query;
|
|
2527
|
-
this.currentPage.set(1);
|
|
2528
|
-
if (query.length >= (this.config.minSearchLength || 2)) {
|
|
2529
|
-
this.performSearch(query);
|
|
2530
|
-
this.showOverlay();
|
|
2531
|
-
}
|
|
2532
|
-
else {
|
|
2533
|
-
this.filteredItems.set([]);
|
|
2534
|
-
if (query.length === 0) {
|
|
2535
|
-
this.hideOverlay();
|
|
2536
|
-
}
|
|
2537
|
-
}
|
|
2538
|
-
this.searchChanged.emit(query);
|
|
2539
|
-
}
|
|
2540
|
-
focus() {
|
|
2541
|
-
this.searchInput()?.nativeElement?.focus();
|
|
2542
|
-
}
|
|
2543
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ReusableAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2544
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: ReusableAutocompleteComponent, isStandalone: true, selector: "acp-autocomplete-wrapper", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: false, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null }, searchFunction: { classPropertyName: "searchFunction", publicName: "searchFunction", isSignal: true, isRequired: false, transformFunction: null }, notFoundTemplate: { classPropertyName: "notFoundTemplate", publicName: "notFoundTemplate", isSignal: true, isRequired: false, transformFunction: null }, overlayWidth: { classPropertyName: "overlayWidth", publicName: "overlayWidth", isSignal: true, isRequired: false, transformFunction: null }, overlayMaxHeight: { classPropertyName: "overlayMaxHeight", publicName: "overlayMaxHeight", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemSelected: "itemSelected", searchChanged: "searchChanged", searchRequested: "searchRequested", pageChanged: "pageChanged", filterChanged: "filterChanged", advancedSearchClicked: "advancedSearchClicked", allResultsClicked: "allResultsClicked", createClicked: "createClicked" }, viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "historyListElement", first: true, predicate: ["historyListElement"], descendants: true, isSignal: true }, { propertyName: "resultsListElement", first: true, predicate: ["resultsListElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"acp-autocomplete-wrapper\" [class.acp-autocomplete-wrapper-active]=\"overlayOpen()\">\n @if (config.label) {\n <label class=\"acp-autocomplete-wrapper-label\" [for]=\"inputId\">{{ config.label }}</label>\n }\n <!-- Input Container -->\n <div\n class=\"acp-autocomplete-wrapper-input-container\"\n cdkOverlayOrigin\n #overlayPosition=\"cdkOverlayOrigin\"\n >\n <div class=\"acp-autocomplete-wrapper-input-wrapper\">\n <mat-icon class=\"acp-autocomplete-wrapper-search-icon\">search</mat-icon>\n <input\n #searchInput\n [id]=\"inputId\"\n type=\"text\"\n class=\"acp-autocomplete-wrapper-input-field\"\n [placeholder]=\"config.placeholder\"\n [(ngModel)]=\"query\"\n (input)=\"onInput($event)\"\n (click)=\"showOverlay()\"\n (keydown)=\"onKeyDown($event)\"\n [disabled]=\"config.disabled || false\"\n autocomplete=\"off\"\n />\n @if (query && query.length > 0 && !isLoading()) {\n <button\n mat-icon-button\n (click)=\"clearSearch()\"\n type=\"button\"\n class=\"acp-autocomplete-wrapper-clear-button\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n }\n <button mat-icon-button type=\"button\">\n <mat-icon>add</mat-icon>\n </button>\n </div>\n\n @if (isLoading()) {\n <div class=\"acp-autocomplete-wrapper-loading-spinner\">\n <mat-spinner diameter=\"20\" />\n </div>\n }\n </div>\n\n <!-- Overlay -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayPosition\"\n [cdkConnectedOverlayOpen]=\"overlayOpen()\"\n [cdkConnectedOverlayWidth]=\"overlayWidth()\"\n [cdkConnectedOverlayHeight]=\"overlayMaxHeight()\"\n (overlayOutsideClick)=\"hideOverlay()\"\n (backdropClick)=\"hideOverlay()\"\n >\n <div class=\"autocomplete-wrapper-dropdown\" [class.autocomplete-wrapper-active]=\"overlayOpen()\">\n <div class=\"autocomplete-wrapper-dropdown-content\">\n <!-- History Section -->\n @if (isHistoryVisible() && historyList().length > 0) {\n <div class=\"autocomplete-wrapper-section\">\n <div class=\"autocomplete-wrapper-section-header\">\n <span class=\"autocomplete-wrapper-section-title\">B\u00FAsquedas recientes</span>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"clearHistory()\"\n class=\"autocomplete-wrapper-clear-history-button\"\n >\n <mat-icon>delete_outline</mat-icon>\n </button>\n </div>\n <ul\n class=\"autocomplete-wrapper-items-list autocomplete-wrapper-scrollable-list\"\n #historyListElement\n >\n @for (item of historyList(); track $index) {\n <li class=\"autocomplete-wrapper-list-item autocomplete-wrapper-history-item\">\n <button\n type=\"button\"\n class=\"autocomplete-wrapper-item-content\"\n [class.autocomplete-wrapper-selected]=\"$index === selectedIndex()\"\n (click)=\"selectItem(item)\"\n (keydown.enter)=\"selectItem(item)\"\n >\n <mat-icon class=\"autocomplete-wrapper-history-icon\">history</mat-icon>\n <div class=\"autocomplete-wrapper-item-details\">\n <ng-container\n *ngTemplateOutlet=\"\n itemTemplate() || defaultItemTemplate;\n context: { $implicit: item }\n \"\n />\n </div>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n class=\"autocomplete-wrapper-remove-button\"\n (click)=\"removeHistoryItem($index, $event)\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </li>\n }\n </ul>\n </div>\n }\n\n <!-- Results Section -->\n @if (!isHistoryVisible()) {\n <div class=\"autocomplete-wrapper-section\">\n <!-- Header with filters and pagination -->\n @if (config.enableFilters || config.enablePagination) {\n <div class=\"autocomplete-wrapper-section-header\">\n <span class=\"autocomplete-wrapper-section-title\">{{ sectionTitle() }}</span>\n\n <!-- Filters -->\n @if (config.enableFilters) {\n <div class=\"autocomplete-wrapper-filter-controls\">\n @if (config.searchFields && config.searchFields.length > 1) {\n <div class=\"autocomplete-wrapper-filter-group\">\n <label class=\"autocomplete-wrapper-filter-label\" for=\"searchBySelect\"\n >Buscar por:</label\n >\n <select\n id=\"searchBySelect\"\n class=\"autocomplete-wrapper-filter-select\"\n [(ngModel)]=\"filters.searchBy\"\n (change)=\"onFilterChange()\"\n >\n @for (field of config.searchFields; track $index) {\n <option [value]=\"field.value\">{{ field.label }}</option>\n }\n </select>\n </div>\n } @if (config.enableStockFilter && config.stockOptions) {\n <div class=\"autocomplete-wrapper-filter-group\">\n <label class=\"autocomplete-wrapper-filter-label\" for=\"stockSelect\">Stock:</label>\n <select\n id=\"stockSelect\"\n class=\"autocomplete-wrapper-filter-select\"\n [(ngModel)]=\"filters.stockFilter\"\n (change)=\"onFilterChange()\"\n >\n @for (option of config.stockOptions; track $index) {\n <option [value]=\"option.value\">{{ option.label }}</option>\n }\n </select>\n </div>\n }\n </div>\n }\n\n <!-- Pagination Controls -->\n @if (config.enablePagination && totalPages() > 1) {\n <div class=\"autocomplete-wrapper-pagination-header\">\n <div class=\"autocomplete-wrapper-pagination-info\">\n <span>P\u00E1gina {{ currentPage() }} de {{ totalPages() }}</span>\n </div>\n <div class=\"autocomplete-wrapper-pagination-controls\">\n <button\n class=\"autocomplete-wrapper-pagination-button\"\n (click)=\"goToFirstPage()\"\n [disabled]=\"currentPage() === 1\"\n >\n <mat-icon>first_page</mat-icon>\n </button>\n <button\n class=\"autocomplete-wrapper-pagination-button\"\n (click)=\"goToPreviousPage()\"\n [disabled]=\"currentPage() === 1\"\n >\n <mat-icon>chevron_left</mat-icon>\n </button>\n <label class=\"acp-autocomplete-wrapper-page-label\" [for]=\"inputId + '-page'\"\n >P\u00E1gina</label\n >\n <input\n [id]=\"inputId + '-page'\"\n type=\"number\"\n class=\"autocomplete-wrapper-page-input\"\n [value]=\"currentPage()\"\n [min]=\"1\"\n [max]=\"totalPages()\"\n (change)=\"goToPage($event)\"\n />\n <button\n class=\"autocomplete-wrapper-pagination-button\"\n (click)=\"goToNextPage()\"\n [disabled]=\"currentPage() === totalPages()\"\n >\n <mat-icon>chevron_right</mat-icon>\n </button>\n <button\n class=\"autocomplete-wrapper-pagination-button\"\n (click)=\"goToLastPage()\"\n [disabled]=\"currentPage() === totalPages()\"\n >\n <mat-icon>last_page</mat-icon>\n </button>\n </div>\n </div>\n }\n </div>\n } @else {\n <div class=\"autocomplete-wrapper-section-header\">\n <span class=\"autocomplete-wrapper-section-title\">{{ sectionTitle() }}</span>\n </div>\n }\n\n <!-- Items List -->\n @if (totalItems()) {\n <ul\n class=\"autocomplete-wrapper-items-list autocomplete-wrapper-scrollable-list\"\n #resultsListElement\n >\n @for (item of currentPageItems(); track $index) {\n <li class=\"autocomplete-wrapper-list-item autocomplete-wrapper-result-item\">\n <button\n type=\"button\"\n class=\"autocomplete-wrapper-item-content\"\n [class.autocomplete-wrapper-selected]=\"$index === selectedIndex()\"\n (click)=\"selectItem(item)\"\n (keydown.enter)=\"selectItem(item)\"\n >\n <div class=\"autocomplete-wrapper-item-info\">\n <ng-container\n *ngTemplateOutlet=\"\n itemTemplate() || defaultItemTemplate;\n context: { $implicit: item }\n \"\n />\n </div>\n </button>\n </li>\n }\n </ul>\n }\n </div>\n }\n\n <!-- No Results -->\n @if (!isLoading() && isNoResults()) {\n <div class=\"autocomplete-wrapper-no-results\">\n <mat-icon class=\"autocomplete-wrapper-no-results-icon\">search_off</mat-icon>\n <div class=\"autocomplete-wrapper-no-results-content\">\n <ng-container\n *ngTemplateOutlet=\"\n notFoundTemplate() || defaultNotFoundTemplate;\n context: { $implicit: noResultsText() }\n \"\n />\n </div>\n </div>\n }\n\n <!-- Footer -->\n @if (overlayOpen() && totalItems() > 0) {\n <div class=\"autocomplete-wrapper-footer\">\n @if (!isHistoryVisible() && totalItems() > 0 && config.enablePagination) {\n <div class=\"autocomplete-wrapper-pagination-footer\">\n <div class=\"autocomplete-wrapper-pagination-summary\">\n Mostrando {{ startItem() }}-{{ endItem() }} de {{ totalCount() }} resultados\n </div>\n <div class=\"autocomplete-wrapper-pagination-controls-footer\">\n <button\n class=\"autocomplete-wrapper-pagination-button\"\n (click)=\"goToPreviousPage()\"\n [disabled]=\"currentPage() === 1\"\n >\n <mat-icon>chevron_left</mat-icon>\n </button>\n <span class=\"autocomplete-wrapper-page-indicator\"\n >{{ currentPage() }} / {{ totalPages() }}</span\n >\n <button\n class=\"autocomplete-wrapper-pagination-button\"\n (click)=\"goToNextPage()\"\n [disabled]=\"currentPage() === totalPages()\"\n >\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n </div>\n } @if (config.enableFooterActions) {\n <div class=\"autocomplete-wrapper-footer-actions\">\n <button\n class=\"autocomplete-wrapper-footer-button autocomplete-wrapper-create-button\"\n (click)=\"onCreateNew($event)\"\n >\n <mat-icon>add</mat-icon>\n <span class=\"autocomplete-wrapper-button-text\">Crear</span>\n </button>\n <button\n class=\"autocomplete-wrapper-footer-button autocomplete-wrapper-search-button\"\n (click)=\"onAdvancedSearch()\"\n >\n <mat-icon>tune</mat-icon>\n <span class=\"autocomplete-wrapper-button-text\">Avanzada</span>\n </button>\n @if (!isHistoryVisible() && totalItems() > 0) {\n <button\n class=\"autocomplete-wrapper-footer-button autocomplete-wrapper-results-button\"\n (click)=\"onShowAllResults()\"\n >\n <mat-icon>list</mat-icon>\n <span class=\"autocomplete-wrapper-button-text\">Todos</span>\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n </ng-template>\n\n <!-- Default Templates -->\n <ng-template #defaultItemTemplate let-item>\n <div class=\"autocomplete-wrapper-default-item\">\n <div class=\"autocomplete-wrapper-item-name\">{{ getItemDisplayText(item) }}</div>\n @if (item.description && typeof item === 'object') {\n <div class=\"autocomplete-wrapper-item-description\">{{ item.description }}</div>\n }\n </div>\n </ng-template>\n\n <ng-template #defaultNotFoundTemplate let-text>\n <div class=\"autocomplete-wrapper-default-no-results\">\n <p>{{ text }}</p>\n <p>Intenta con otros t\u00E9rminos de b\u00FAsqueda</p>\n </div>\n </ng-template>\n</div>\n", styles: [".acp-autocomplete-wrapper{display:block;position:relative;width:100%;max-width:100%}.acp-autocomplete-wrapper.acp-autocomplete-wrapper-active .acp-autocomplete-wrapper-input-wrapper{border-color:#1976d2;box-shadow:0 0 0 2px #1976d21a}.acp-autocomplete-wrapper-input-container{position:relative;width:100%}.acp-autocomplete-wrapper-input-wrapper{position:relative;display:flex;align-items:center;background:var(--mat-sys-surface, white);border:1px solid var(--mat-sys-outline-variant, #e0e0e0);border-radius:8px;padding:0 12px;transition:all .3s ease}.acp-autocomplete-wrapper-input-wrapper:focus-within{border-color:#1976d2;box-shadow:0 0 0 2px #1976d21a}.acp-autocomplete-wrapper-search-icon{color:var(--mat-sys-on-surface-variant, #666);margin-right:8px;font-size:20px}.acp-autocomplete-wrapper-label{display:block;font-size:12px;color:var(--mat-sys-on-surface-variant, #666);margin-bottom:4px}.acp-autocomplete-wrapper-input-field{flex:1;border:none;outline:none;font-size:16px;padding:7px 0;background:transparent;color:var(--mat-sys-on-surface, #333)}.acp-autocomplete-wrapper-input-field::placeholder{color:var(--mat-sys-on-surface-variant, #999)}.acp-autocomplete-wrapper-input-field:disabled{opacity:.6;cursor:not-allowed}.acp-autocomplete-wrapper-clear-button{margin-left:8px;color:var(--mat-sys-on-surface-variant, #666);background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;transition:all .2s ease}.acp-autocomplete-wrapper-clear-button:hover{background-color:#0000000a;color:var(--mat-sys-on-surface, #333)}.acp-autocomplete-wrapper-loading-spinner{position:absolute;right:12px;top:50%;transform:translateY(-50%)}.acp-autocomplete-wrapper-dropdown{background:var(--mat-sys-surface-container, white);border-radius:8px;box-shadow:0 4px 20px #00000026;border:1px solid var(--mat-sys-outline-variant, #e0e0e0);overflow:hidden;max-height:500px;min-width:300px;display:flex;flex-direction:column}.acp-autocomplete-wrapper-dropdown.acp-autocomplete-wrapper-active{animation:reusableAutocompleteSlideIn .2s ease-out}@keyframes reusableAutocompleteSlideIn{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.acp-autocomplete-wrapper-dropdown-content{display:flex;flex-direction:column;height:100%;max-height:500px}.acp-autocomplete-wrapper-section{display:flex;flex-direction:column;height:100%;min-height:0}.acp-autocomplete-wrapper-section-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px 8px;border-bottom:1px solid var(--mat-sys-outline-variant, #f0f0f0);background:var(--mat-sys-surface-variant, #fafafa);flex-shrink:0;min-height:56px;flex-wrap:wrap;gap:12px}.acp-autocomplete-wrapper-section-title{font-size:13px;font-weight:500;color:var(--mat-sys-on-surface-variant, #666);text-transform:uppercase;letter-spacing:.5px;white-space:nowrap}.acp-autocomplete-wrapper-clear-history-button{color:var(--mat-sys-on-surface-variant, #666);background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;transition:all .2s ease}.acp-autocomplete-wrapper-clear-history-button:hover{background-color:#0000000a;color:var(--mat-sys-on-surface, #333)}.acp-autocomplete-wrapper-filter-controls{display:flex;align-items:center;gap:16px;flex:1;justify-content:center}.acp-autocomplete-wrapper-filter-group{display:flex;align-items:center;gap:6px}.acp-autocomplete-wrapper-filter-label{font-size:12px;color:var(--mat-sys-on-surface-variant, #666);font-weight:500;white-space:nowrap}.acp-autocomplete-wrapper-filter-select{padding:4px 8px;border:1px solid var(--mat-sys-outline, #ddd);border-radius:4px;font-size:12px;background:var(--mat-sys-surface, white);color:var(--mat-sys-on-surface, #333);cursor:pointer;min-width:120px}.acp-autocomplete-wrapper-filter-select:focus{outline:none;border-color:#1976d2;box-shadow:0 0 0 1px #1976d233}.acp-autocomplete-wrapper-filter-select:hover{border-color:#bbb}.acp-autocomplete-wrapper-pagination-header{display:flex;align-items:center;gap:12px;margin-left:auto}.acp-autocomplete-wrapper-pagination-info{font-size:12px;color:var(--mat-sys-on-surface-variant, #666);white-space:nowrap}.acp-autocomplete-wrapper-pagination-controls{display:flex;align-items:center;gap:4px}.acp-autocomplete-wrapper-pagination-button{min-width:32px;height:32px;line-height:32px;padding:0;color:var(--mat-sys-on-surface-variant, #666);background:none;border:1px solid var(--mat-sys-outline, #ddd);border-radius:4px;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center}.acp-autocomplete-wrapper-pagination-button:hover:not(:disabled){background-color:#0000000a;color:var(--mat-sys-on-surface, #333)}.acp-autocomplete-wrapper-pagination-button:disabled{opacity:.5;cursor:not-allowed}.acp-autocomplete-wrapper-pagination-button mat-icon{font-size:18px;width:18px;height:18px}.acp-autocomplete-wrapper-page-label{font-size:12px;color:var(--mat-sys-on-surface-variant, #666);margin-right:4px}.acp-autocomplete-wrapper-page-input{width:50px;height:32px;border:1px solid var(--mat-sys-outline, #ddd);border-radius:4px;text-align:center;font-size:12px;padding:4px;margin:0 4px}.acp-autocomplete-wrapper-page-input:focus{outline:none;border-color:#1976d2}.acp-autocomplete-wrapper-items-list{list-style:none;margin:0;padding:0;flex:1;min-height:0}.acp-autocomplete-wrapper-items-list.acp-autocomplete-wrapper-scrollable-list{overflow-y:auto}.acp-autocomplete-wrapper-list-item{display:flex;align-items:center;border-bottom:1px solid var(--mat-sys-outline-variant, #f5f5f5);transition:background-color .2s ease}.acp-autocomplete-wrapper-list-item:last-child{border-bottom:none}.acp-autocomplete-wrapper-list-item:hover{background-color:var(--mat-sys-surface-variant, #f8f9fa)}.acp-autocomplete-wrapper-item-content{flex:1;display:flex;align-items:center;padding:12px 16px;cursor:pointer;min-height:48px;transition:all .2s ease}.acp-autocomplete-wrapper-item-content.acp-autocomplete-wrapper-selected{background-color:var(--mat-sys-primary-container, #e3f2fd);color:var(--mat-sys-on-primary-container, #1976d2)}.acp-autocomplete-wrapper-history-item .acp-autocomplete-wrapper-item-content{padding-left:12px}.acp-autocomplete-wrapper-history-icon{color:var(--mat-sys-on-surface-variant, #999);margin-right:12px;font-size:18px}.acp-autocomplete-wrapper-item-details{flex:1;display:flex;align-items:center}.acp-autocomplete-wrapper-remove-button{margin-right:8px}.acp-autocomplete-wrapper-result-item{position:relative}.acp-autocomplete-wrapper-item-info{flex:1;display:flex;align-items:center}.acp-autocomplete-wrapper-default-item{flex:1}.acp-autocomplete-wrapper-default-item .acp-autocomplete-wrapper-item-name{font-weight:500;font-size:14px;margin-bottom:2px;color:var(--mat-sys-on-surface, #333)}.acp-autocomplete-wrapper-default-item .acp-autocomplete-wrapper-item-description{font-size:12px;color:var(--mat-sys-on-surface-variant, #666);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.acp-autocomplete-wrapper-no-results{display:flex;flex-direction:column;align-items:center;padding:32px 16px;text-align:center;color:var(--mat-sys-on-surface-variant, #666)}.acp-autocomplete-wrapper-no-results-icon{font-size:48px;color:var(--mat-sys-outline, #ccc);margin-bottom:16px;width:45px;height:45px}.acp-autocomplete-wrapper-no-results-content{font-size:14px;line-height:1.5}.acp-autocomplete-wrapper-default-no-results{text-align:center}.acp-autocomplete-wrapper-default-no-results p:first-child{font-weight:500;margin-bottom:8px}.acp-autocomplete-wrapper-footer{border-top:1px solid var(--mat-sys-outline-variant, #f0f0f0);background:var(--mat-sys-surface-variant, #fafafa);flex-shrink:0;padding:12px 16px;display:flex;flex-direction:column;gap:12px}.acp-autocomplete-wrapper-pagination-footer{display:flex;align-items:center;justify-content:space-between;width:100%;gap:16px}.acp-autocomplete-wrapper-pagination-summary{font-size:12px;color:var(--mat-sys-on-surface-variant, #666);white-space:nowrap}.acp-autocomplete-wrapper-pagination-controls-footer{display:flex;align-items:center;gap:8px}.acp-autocomplete-wrapper-page-indicator{font-size:12px;color:var(--mat-sys-on-surface-variant, #666);min-width:40px;text-align:center}.acp-autocomplete-wrapper-footer-actions{display:flex;gap:8px;flex-wrap:wrap}.acp-autocomplete-wrapper-footer-button{flex:1;display:flex;align-items:center;justify-content:center;gap:8px;min-height:40px;font-size:13px;text-transform:none;white-space:nowrap;background:none;border:1px solid var(--mat-sys-outline, #ddd);border-radius:4px;cursor:pointer;padding:8px 12px;transition:all .2s ease}.acp-autocomplete-wrapper-footer-button.acp-autocomplete-wrapper-create-button{background-color:#4caf501f;border-color:#4caf50;color:#2e7d32}.acp-autocomplete-wrapper-footer-button.acp-autocomplete-wrapper-create-button:hover{background-color:#4caf5033}.acp-autocomplete-wrapper-footer-button.acp-autocomplete-wrapper-search-button{background-color:#ff98001f;border-color:#ff9800;color:#e65100}.acp-autocomplete-wrapper-footer-button.acp-autocomplete-wrapper-search-button:hover{background-color:#ff980033}.acp-autocomplete-wrapper-footer-button.acp-autocomplete-wrapper-results-button{background-color:#3f51b51f;border-color:#3f51b5;color:#283593}.acp-autocomplete-wrapper-footer-button.acp-autocomplete-wrapper-results-button:hover{background-color:#3f51b533}.acp-autocomplete-wrapper-button-text{display:inline}.acp-autocomplete-wrapper-items-list::-webkit-scrollbar{width:6px}.acp-autocomplete-wrapper-items-list::-webkit-scrollbar-track{background:var(--mat-sys-surface-variant, #f1f1f1);border-radius:3px}.acp-autocomplete-wrapper-items-list::-webkit-scrollbar-thumb{background:var(--mat-sys-outline, #c1c1c1);border-radius:3px}.acp-autocomplete-wrapper-items-list::-webkit-scrollbar-thumb:hover{background:var(--mat-sys-on-surface-variant, #a8a8a8)}@media(max-width:768px){.acp-autocomplete-wrapper-dropdown{min-width:280px;max-height:60vh}.acp-autocomplete-wrapper-dropdown-content{max-height:60vh}.acp-autocomplete-wrapper-input-field{font-size:16px}.acp-autocomplete-wrapper-footer{padding:8px 12px}.acp-autocomplete-wrapper-footer-actions{flex-direction:column;gap:6px}.acp-autocomplete-wrapper-footer-button{width:100%;min-height:44px}.acp-autocomplete-wrapper-pagination-footer{flex-direction:column;gap:8px}.acp-autocomplete-wrapper-section-header{flex-direction:column;align-items:flex-start;min-height:80px;gap:8px}.acp-autocomplete-wrapper-filter-controls{width:100%;justify-content:flex-start;flex-wrap:wrap;gap:12px}.acp-autocomplete-wrapper-filter-select{min-width:100px;font-size:11px}.acp-autocomplete-wrapper-filter-label{font-size:11px}.acp-autocomplete-wrapper-pagination-header{width:100%;justify-content:space-between}.acp-autocomplete-wrapper-pagination-header .acp-autocomplete-wrapper-pagination-info{display:none}.acp-autocomplete-wrapper-pagination-controls{gap:2px}.acp-autocomplete-wrapper-page-input{width:40px}.acp-autocomplete-wrapper-item-content{padding:16px 12px;min-height:52px}.acp-autocomplete-wrapper-button-text{font-size:12px}.acp-autocomplete-wrapper-items-list.acp-autocomplete-wrapper-scrollable-list{max-height:250px}}@media(max-width:480px){.acp-autocomplete-wrapper-dropdown{min-width:260px;max-height:50vh}.acp-autocomplete-wrapper-section-header{padding:8px 12px 6px;min-height:70px;gap:6px}.acp-autocomplete-wrapper-filter-controls{gap:8px}.acp-autocomplete-wrapper-filter-group{gap:4px}.acp-autocomplete-wrapper-filter-select{min-width:90px;padding:3px 6px}.acp-autocomplete-wrapper-item-content{padding:14px 12px}.acp-autocomplete-wrapper-pagination-header{gap:8px}.acp-autocomplete-wrapper-pagination-button{min-width:28px;height:28px}.acp-autocomplete-wrapper-page-input{width:35px;height:28px}.acp-autocomplete-wrapper-items-list.acp-autocomplete-wrapper-scrollable-list{max-height:200px}.acp-autocomplete-wrapper-footer-actions{gap:4px}.acp-autocomplete-wrapper-footer-button{font-size:12px;padding:8px 12px;min-height:40px}.acp-autocomplete-wrapper-button-text{display:none}}\n"], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$5.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1$5.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple]):not([ngNoCva])[formControlName],select:not([multiple]):not([ngNoCva])[formControl],select:not([multiple]):not([ngNoCva])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.Eager, encapsulation: i0.ViewEncapsulation.None });
|
|
2545
|
-
}
|
|
2546
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ReusableAutocompleteComponent, decorators: [{
|
|
2547
|
-
type: Component,
|
|
2548
|
-
args: [{ selector: 'acp-autocomplete-wrapper', imports: [
|
|
2549
|
-
MatIcon,
|
|
2550
|
-
NgTemplateOutlet,
|
|
2551
|
-
OverlayModule,
|
|
2552
|
-
MatProgressBarModule,
|
|
2553
|
-
MatProgressSpinner,
|
|
2554
|
-
FormsModule,
|
|
2555
|
-
MatIconButton,
|
|
2556
|
-
], changeDetection: ChangeDetectionStrategy.Eager, encapsulation: ViewEncapsulation.None, template: "<div class=\"acp-autocomplete-wrapper\" [class.acp-autocomplete-wrapper-active]=\"overlayOpen()\">\n @if (config.label) {\n <label class=\"acp-autocomplete-wrapper-label\" [for]=\"inputId\">{{ config.label }}</label>\n }\n <!-- Input Container -->\n <div\n class=\"acp-autocomplete-wrapper-input-container\"\n cdkOverlayOrigin\n #overlayPosition=\"cdkOverlayOrigin\"\n >\n <div class=\"acp-autocomplete-wrapper-input-wrapper\">\n <mat-icon class=\"acp-autocomplete-wrapper-search-icon\">search</mat-icon>\n <input\n #searchInput\n [id]=\"inputId\"\n type=\"text\"\n class=\"acp-autocomplete-wrapper-input-field\"\n [placeholder]=\"config.placeholder\"\n [(ngModel)]=\"query\"\n (input)=\"onInput($event)\"\n (click)=\"showOverlay()\"\n (keydown)=\"onKeyDown($event)\"\n [disabled]=\"config.disabled || false\"\n autocomplete=\"off\"\n />\n @if (query && query.length > 0 && !isLoading()) {\n <button\n mat-icon-button\n (click)=\"clearSearch()\"\n type=\"button\"\n class=\"acp-autocomplete-wrapper-clear-button\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n }\n <button mat-icon-button type=\"button\">\n <mat-icon>add</mat-icon>\n </button>\n </div>\n\n @if (isLoading()) {\n <div class=\"acp-autocomplete-wrapper-loading-spinner\">\n <mat-spinner diameter=\"20\" />\n </div>\n }\n </div>\n\n <!-- Overlay -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayPosition\"\n [cdkConnectedOverlayOpen]=\"overlayOpen()\"\n [cdkConnectedOverlayWidth]=\"overlayWidth()\"\n [cdkConnectedOverlayHeight]=\"overlayMaxHeight()\"\n (overlayOutsideClick)=\"hideOverlay()\"\n (backdropClick)=\"hideOverlay()\"\n >\n <div class=\"autocomplete-wrapper-dropdown\" [class.autocomplete-wrapper-active]=\"overlayOpen()\">\n <div class=\"autocomplete-wrapper-dropdown-content\">\n <!-- History Section -->\n @if (isHistoryVisible() && historyList().length > 0) {\n <div class=\"autocomplete-wrapper-section\">\n <div class=\"autocomplete-wrapper-section-header\">\n <span class=\"autocomplete-wrapper-section-title\">B\u00FAsquedas recientes</span>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"clearHistory()\"\n class=\"autocomplete-wrapper-clear-history-button\"\n >\n <mat-icon>delete_outline</mat-icon>\n </button>\n </div>\n <ul\n class=\"autocomplete-wrapper-items-list autocomplete-wrapper-scrollable-list\"\n #historyListElement\n >\n @for (item of historyList(); track $index) {\n <li class=\"autocomplete-wrapper-list-item autocomplete-wrapper-history-item\">\n <button\n type=\"button\"\n class=\"autocomplete-wrapper-item-content\"\n [class.autocomplete-wrapper-selected]=\"$index === selectedIndex()\"\n (click)=\"selectItem(item)\"\n (keydown.enter)=\"selectItem(item)\"\n >\n <mat-icon class=\"autocomplete-wrapper-history-icon\">history</mat-icon>\n <div class=\"autocomplete-wrapper-item-details\">\n <ng-container\n *ngTemplateOutlet=\"\n itemTemplate() || defaultItemTemplate;\n context: { $implicit: item }\n \"\n />\n </div>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n class=\"autocomplete-wrapper-remove-button\"\n (click)=\"removeHistoryItem($index, $event)\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </li>\n }\n </ul>\n </div>\n }\n\n <!-- Results Section -->\n @if (!isHistoryVisible()) {\n <div class=\"autocomplete-wrapper-section\">\n <!-- Header with filters and pagination -->\n @if (config.enableFilters || config.enablePagination) {\n <div class=\"autocomplete-wrapper-section-header\">\n <span class=\"autocomplete-wrapper-section-title\">{{ sectionTitle() }}</span>\n\n <!-- Filters -->\n @if (config.enableFilters) {\n <div class=\"autocomplete-wrapper-filter-controls\">\n @if (config.searchFields && config.searchFields.length > 1) {\n <div class=\"autocomplete-wrapper-filter-group\">\n <label class=\"autocomplete-wrapper-filter-label\" for=\"searchBySelect\"\n >Buscar por:</label\n >\n <select\n id=\"searchBySelect\"\n class=\"autocomplete-wrapper-filter-select\"\n [(ngModel)]=\"filters.searchBy\"\n (change)=\"onFilterChange()\"\n >\n @for (field of config.searchFields; track $index) {\n <option [value]=\"field.value\">{{ field.label }}</option>\n }\n </select>\n </div>\n } @if (config.enableStockFilter && config.stockOptions) {\n <div class=\"autocomplete-wrapper-filter-group\">\n <label class=\"autocomplete-wrapper-filter-label\" for=\"stockSelect\">Stock:</label>\n <select\n id=\"stockSelect\"\n class=\"autocomplete-wrapper-filter-select\"\n [(ngModel)]=\"filters.stockFilter\"\n (change)=\"onFilterChange()\"\n >\n @for (option of config.stockOptions; track $index) {\n <option [value]=\"option.value\">{{ option.label }}</option>\n }\n </select>\n </div>\n }\n </div>\n }\n\n <!-- Pagination Controls -->\n @if (config.enablePagination && totalPages() > 1) {\n <div class=\"autocomplete-wrapper-pagination-header\">\n <div class=\"autocomplete-wrapper-pagination-info\">\n <span>P\u00E1gina {{ currentPage() }} de {{ totalPages() }}</span>\n </div>\n <div class=\"autocomplete-wrapper-pagination-controls\">\n <button\n class=\"autocomplete-wrapper-pagination-button\"\n (click)=\"goToFirstPage()\"\n [disabled]=\"currentPage() === 1\"\n >\n <mat-icon>first_page</mat-icon>\n </button>\n <button\n class=\"autocomplete-wrapper-pagination-button\"\n (click)=\"goToPreviousPage()\"\n [disabled]=\"currentPage() === 1\"\n >\n <mat-icon>chevron_left</mat-icon>\n </button>\n <label class=\"acp-autocomplete-wrapper-page-label\" [for]=\"inputId + '-page'\"\n >P\u00E1gina</label\n >\n <input\n [id]=\"inputId + '-page'\"\n type=\"number\"\n class=\"autocomplete-wrapper-page-input\"\n [value]=\"currentPage()\"\n [min]=\"1\"\n [max]=\"totalPages()\"\n (change)=\"goToPage($event)\"\n />\n <button\n class=\"autocomplete-wrapper-pagination-button\"\n (click)=\"goToNextPage()\"\n [disabled]=\"currentPage() === totalPages()\"\n >\n <mat-icon>chevron_right</mat-icon>\n </button>\n <button\n class=\"autocomplete-wrapper-pagination-button\"\n (click)=\"goToLastPage()\"\n [disabled]=\"currentPage() === totalPages()\"\n >\n <mat-icon>last_page</mat-icon>\n </button>\n </div>\n </div>\n }\n </div>\n } @else {\n <div class=\"autocomplete-wrapper-section-header\">\n <span class=\"autocomplete-wrapper-section-title\">{{ sectionTitle() }}</span>\n </div>\n }\n\n <!-- Items List -->\n @if (totalItems()) {\n <ul\n class=\"autocomplete-wrapper-items-list autocomplete-wrapper-scrollable-list\"\n #resultsListElement\n >\n @for (item of currentPageItems(); track $index) {\n <li class=\"autocomplete-wrapper-list-item autocomplete-wrapper-result-item\">\n <button\n type=\"button\"\n class=\"autocomplete-wrapper-item-content\"\n [class.autocomplete-wrapper-selected]=\"$index === selectedIndex()\"\n (click)=\"selectItem(item)\"\n (keydown.enter)=\"selectItem(item)\"\n >\n <div class=\"autocomplete-wrapper-item-info\">\n <ng-container\n *ngTemplateOutlet=\"\n itemTemplate() || defaultItemTemplate;\n context: { $implicit: item }\n \"\n />\n </div>\n </button>\n </li>\n }\n </ul>\n }\n </div>\n }\n\n <!-- No Results -->\n @if (!isLoading() && isNoResults()) {\n <div class=\"autocomplete-wrapper-no-results\">\n <mat-icon class=\"autocomplete-wrapper-no-results-icon\">search_off</mat-icon>\n <div class=\"autocomplete-wrapper-no-results-content\">\n <ng-container\n *ngTemplateOutlet=\"\n notFoundTemplate() || defaultNotFoundTemplate;\n context: { $implicit: noResultsText() }\n \"\n />\n </div>\n </div>\n }\n\n <!-- Footer -->\n @if (overlayOpen() && totalItems() > 0) {\n <div class=\"autocomplete-wrapper-footer\">\n @if (!isHistoryVisible() && totalItems() > 0 && config.enablePagination) {\n <div class=\"autocomplete-wrapper-pagination-footer\">\n <div class=\"autocomplete-wrapper-pagination-summary\">\n Mostrando {{ startItem() }}-{{ endItem() }} de {{ totalCount() }} resultados\n </div>\n <div class=\"autocomplete-wrapper-pagination-controls-footer\">\n <button\n class=\"autocomplete-wrapper-pagination-button\"\n (click)=\"goToPreviousPage()\"\n [disabled]=\"currentPage() === 1\"\n >\n <mat-icon>chevron_left</mat-icon>\n </button>\n <span class=\"autocomplete-wrapper-page-indicator\"\n >{{ currentPage() }} / {{ totalPages() }}</span\n >\n <button\n class=\"autocomplete-wrapper-pagination-button\"\n (click)=\"goToNextPage()\"\n [disabled]=\"currentPage() === totalPages()\"\n >\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n </div>\n } @if (config.enableFooterActions) {\n <div class=\"autocomplete-wrapper-footer-actions\">\n <button\n class=\"autocomplete-wrapper-footer-button autocomplete-wrapper-create-button\"\n (click)=\"onCreateNew($event)\"\n >\n <mat-icon>add</mat-icon>\n <span class=\"autocomplete-wrapper-button-text\">Crear</span>\n </button>\n <button\n class=\"autocomplete-wrapper-footer-button autocomplete-wrapper-search-button\"\n (click)=\"onAdvancedSearch()\"\n >\n <mat-icon>tune</mat-icon>\n <span class=\"autocomplete-wrapper-button-text\">Avanzada</span>\n </button>\n @if (!isHistoryVisible() && totalItems() > 0) {\n <button\n class=\"autocomplete-wrapper-footer-button autocomplete-wrapper-results-button\"\n (click)=\"onShowAllResults()\"\n >\n <mat-icon>list</mat-icon>\n <span class=\"autocomplete-wrapper-button-text\">Todos</span>\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n </ng-template>\n\n <!-- Default Templates -->\n <ng-template #defaultItemTemplate let-item>\n <div class=\"autocomplete-wrapper-default-item\">\n <div class=\"autocomplete-wrapper-item-name\">{{ getItemDisplayText(item) }}</div>\n @if (item.description && typeof item === 'object') {\n <div class=\"autocomplete-wrapper-item-description\">{{ item.description }}</div>\n }\n </div>\n </ng-template>\n\n <ng-template #defaultNotFoundTemplate let-text>\n <div class=\"autocomplete-wrapper-default-no-results\">\n <p>{{ text }}</p>\n <p>Intenta con otros t\u00E9rminos de b\u00FAsqueda</p>\n </div>\n </ng-template>\n</div>\n", styles: [".acp-autocomplete-wrapper{display:block;position:relative;width:100%;max-width:100%}.acp-autocomplete-wrapper.acp-autocomplete-wrapper-active .acp-autocomplete-wrapper-input-wrapper{border-color:#1976d2;box-shadow:0 0 0 2px #1976d21a}.acp-autocomplete-wrapper-input-container{position:relative;width:100%}.acp-autocomplete-wrapper-input-wrapper{position:relative;display:flex;align-items:center;background:var(--mat-sys-surface, white);border:1px solid var(--mat-sys-outline-variant, #e0e0e0);border-radius:8px;padding:0 12px;transition:all .3s ease}.acp-autocomplete-wrapper-input-wrapper:focus-within{border-color:#1976d2;box-shadow:0 0 0 2px #1976d21a}.acp-autocomplete-wrapper-search-icon{color:var(--mat-sys-on-surface-variant, #666);margin-right:8px;font-size:20px}.acp-autocomplete-wrapper-label{display:block;font-size:12px;color:var(--mat-sys-on-surface-variant, #666);margin-bottom:4px}.acp-autocomplete-wrapper-input-field{flex:1;border:none;outline:none;font-size:16px;padding:7px 0;background:transparent;color:var(--mat-sys-on-surface, #333)}.acp-autocomplete-wrapper-input-field::placeholder{color:var(--mat-sys-on-surface-variant, #999)}.acp-autocomplete-wrapper-input-field:disabled{opacity:.6;cursor:not-allowed}.acp-autocomplete-wrapper-clear-button{margin-left:8px;color:var(--mat-sys-on-surface-variant, #666);background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;transition:all .2s ease}.acp-autocomplete-wrapper-clear-button:hover{background-color:#0000000a;color:var(--mat-sys-on-surface, #333)}.acp-autocomplete-wrapper-loading-spinner{position:absolute;right:12px;top:50%;transform:translateY(-50%)}.acp-autocomplete-wrapper-dropdown{background:var(--mat-sys-surface-container, white);border-radius:8px;box-shadow:0 4px 20px #00000026;border:1px solid var(--mat-sys-outline-variant, #e0e0e0);overflow:hidden;max-height:500px;min-width:300px;display:flex;flex-direction:column}.acp-autocomplete-wrapper-dropdown.acp-autocomplete-wrapper-active{animation:reusableAutocompleteSlideIn .2s ease-out}@keyframes reusableAutocompleteSlideIn{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.acp-autocomplete-wrapper-dropdown-content{display:flex;flex-direction:column;height:100%;max-height:500px}.acp-autocomplete-wrapper-section{display:flex;flex-direction:column;height:100%;min-height:0}.acp-autocomplete-wrapper-section-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px 8px;border-bottom:1px solid var(--mat-sys-outline-variant, #f0f0f0);background:var(--mat-sys-surface-variant, #fafafa);flex-shrink:0;min-height:56px;flex-wrap:wrap;gap:12px}.acp-autocomplete-wrapper-section-title{font-size:13px;font-weight:500;color:var(--mat-sys-on-surface-variant, #666);text-transform:uppercase;letter-spacing:.5px;white-space:nowrap}.acp-autocomplete-wrapper-clear-history-button{color:var(--mat-sys-on-surface-variant, #666);background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;transition:all .2s ease}.acp-autocomplete-wrapper-clear-history-button:hover{background-color:#0000000a;color:var(--mat-sys-on-surface, #333)}.acp-autocomplete-wrapper-filter-controls{display:flex;align-items:center;gap:16px;flex:1;justify-content:center}.acp-autocomplete-wrapper-filter-group{display:flex;align-items:center;gap:6px}.acp-autocomplete-wrapper-filter-label{font-size:12px;color:var(--mat-sys-on-surface-variant, #666);font-weight:500;white-space:nowrap}.acp-autocomplete-wrapper-filter-select{padding:4px 8px;border:1px solid var(--mat-sys-outline, #ddd);border-radius:4px;font-size:12px;background:var(--mat-sys-surface, white);color:var(--mat-sys-on-surface, #333);cursor:pointer;min-width:120px}.acp-autocomplete-wrapper-filter-select:focus{outline:none;border-color:#1976d2;box-shadow:0 0 0 1px #1976d233}.acp-autocomplete-wrapper-filter-select:hover{border-color:#bbb}.acp-autocomplete-wrapper-pagination-header{display:flex;align-items:center;gap:12px;margin-left:auto}.acp-autocomplete-wrapper-pagination-info{font-size:12px;color:var(--mat-sys-on-surface-variant, #666);white-space:nowrap}.acp-autocomplete-wrapper-pagination-controls{display:flex;align-items:center;gap:4px}.acp-autocomplete-wrapper-pagination-button{min-width:32px;height:32px;line-height:32px;padding:0;color:var(--mat-sys-on-surface-variant, #666);background:none;border:1px solid var(--mat-sys-outline, #ddd);border-radius:4px;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center}.acp-autocomplete-wrapper-pagination-button:hover:not(:disabled){background-color:#0000000a;color:var(--mat-sys-on-surface, #333)}.acp-autocomplete-wrapper-pagination-button:disabled{opacity:.5;cursor:not-allowed}.acp-autocomplete-wrapper-pagination-button mat-icon{font-size:18px;width:18px;height:18px}.acp-autocomplete-wrapper-page-label{font-size:12px;color:var(--mat-sys-on-surface-variant, #666);margin-right:4px}.acp-autocomplete-wrapper-page-input{width:50px;height:32px;border:1px solid var(--mat-sys-outline, #ddd);border-radius:4px;text-align:center;font-size:12px;padding:4px;margin:0 4px}.acp-autocomplete-wrapper-page-input:focus{outline:none;border-color:#1976d2}.acp-autocomplete-wrapper-items-list{list-style:none;margin:0;padding:0;flex:1;min-height:0}.acp-autocomplete-wrapper-items-list.acp-autocomplete-wrapper-scrollable-list{overflow-y:auto}.acp-autocomplete-wrapper-list-item{display:flex;align-items:center;border-bottom:1px solid var(--mat-sys-outline-variant, #f5f5f5);transition:background-color .2s ease}.acp-autocomplete-wrapper-list-item:last-child{border-bottom:none}.acp-autocomplete-wrapper-list-item:hover{background-color:var(--mat-sys-surface-variant, #f8f9fa)}.acp-autocomplete-wrapper-item-content{flex:1;display:flex;align-items:center;padding:12px 16px;cursor:pointer;min-height:48px;transition:all .2s ease}.acp-autocomplete-wrapper-item-content.acp-autocomplete-wrapper-selected{background-color:var(--mat-sys-primary-container, #e3f2fd);color:var(--mat-sys-on-primary-container, #1976d2)}.acp-autocomplete-wrapper-history-item .acp-autocomplete-wrapper-item-content{padding-left:12px}.acp-autocomplete-wrapper-history-icon{color:var(--mat-sys-on-surface-variant, #999);margin-right:12px;font-size:18px}.acp-autocomplete-wrapper-item-details{flex:1;display:flex;align-items:center}.acp-autocomplete-wrapper-remove-button{margin-right:8px}.acp-autocomplete-wrapper-result-item{position:relative}.acp-autocomplete-wrapper-item-info{flex:1;display:flex;align-items:center}.acp-autocomplete-wrapper-default-item{flex:1}.acp-autocomplete-wrapper-default-item .acp-autocomplete-wrapper-item-name{font-weight:500;font-size:14px;margin-bottom:2px;color:var(--mat-sys-on-surface, #333)}.acp-autocomplete-wrapper-default-item .acp-autocomplete-wrapper-item-description{font-size:12px;color:var(--mat-sys-on-surface-variant, #666);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.acp-autocomplete-wrapper-no-results{display:flex;flex-direction:column;align-items:center;padding:32px 16px;text-align:center;color:var(--mat-sys-on-surface-variant, #666)}.acp-autocomplete-wrapper-no-results-icon{font-size:48px;color:var(--mat-sys-outline, #ccc);margin-bottom:16px;width:45px;height:45px}.acp-autocomplete-wrapper-no-results-content{font-size:14px;line-height:1.5}.acp-autocomplete-wrapper-default-no-results{text-align:center}.acp-autocomplete-wrapper-default-no-results p:first-child{font-weight:500;margin-bottom:8px}.acp-autocomplete-wrapper-footer{border-top:1px solid var(--mat-sys-outline-variant, #f0f0f0);background:var(--mat-sys-surface-variant, #fafafa);flex-shrink:0;padding:12px 16px;display:flex;flex-direction:column;gap:12px}.acp-autocomplete-wrapper-pagination-footer{display:flex;align-items:center;justify-content:space-between;width:100%;gap:16px}.acp-autocomplete-wrapper-pagination-summary{font-size:12px;color:var(--mat-sys-on-surface-variant, #666);white-space:nowrap}.acp-autocomplete-wrapper-pagination-controls-footer{display:flex;align-items:center;gap:8px}.acp-autocomplete-wrapper-page-indicator{font-size:12px;color:var(--mat-sys-on-surface-variant, #666);min-width:40px;text-align:center}.acp-autocomplete-wrapper-footer-actions{display:flex;gap:8px;flex-wrap:wrap}.acp-autocomplete-wrapper-footer-button{flex:1;display:flex;align-items:center;justify-content:center;gap:8px;min-height:40px;font-size:13px;text-transform:none;white-space:nowrap;background:none;border:1px solid var(--mat-sys-outline, #ddd);border-radius:4px;cursor:pointer;padding:8px 12px;transition:all .2s ease}.acp-autocomplete-wrapper-footer-button.acp-autocomplete-wrapper-create-button{background-color:#4caf501f;border-color:#4caf50;color:#2e7d32}.acp-autocomplete-wrapper-footer-button.acp-autocomplete-wrapper-create-button:hover{background-color:#4caf5033}.acp-autocomplete-wrapper-footer-button.acp-autocomplete-wrapper-search-button{background-color:#ff98001f;border-color:#ff9800;color:#e65100}.acp-autocomplete-wrapper-footer-button.acp-autocomplete-wrapper-search-button:hover{background-color:#ff980033}.acp-autocomplete-wrapper-footer-button.acp-autocomplete-wrapper-results-button{background-color:#3f51b51f;border-color:#3f51b5;color:#283593}.acp-autocomplete-wrapper-footer-button.acp-autocomplete-wrapper-results-button:hover{background-color:#3f51b533}.acp-autocomplete-wrapper-button-text{display:inline}.acp-autocomplete-wrapper-items-list::-webkit-scrollbar{width:6px}.acp-autocomplete-wrapper-items-list::-webkit-scrollbar-track{background:var(--mat-sys-surface-variant, #f1f1f1);border-radius:3px}.acp-autocomplete-wrapper-items-list::-webkit-scrollbar-thumb{background:var(--mat-sys-outline, #c1c1c1);border-radius:3px}.acp-autocomplete-wrapper-items-list::-webkit-scrollbar-thumb:hover{background:var(--mat-sys-on-surface-variant, #a8a8a8)}@media(max-width:768px){.acp-autocomplete-wrapper-dropdown{min-width:280px;max-height:60vh}.acp-autocomplete-wrapper-dropdown-content{max-height:60vh}.acp-autocomplete-wrapper-input-field{font-size:16px}.acp-autocomplete-wrapper-footer{padding:8px 12px}.acp-autocomplete-wrapper-footer-actions{flex-direction:column;gap:6px}.acp-autocomplete-wrapper-footer-button{width:100%;min-height:44px}.acp-autocomplete-wrapper-pagination-footer{flex-direction:column;gap:8px}.acp-autocomplete-wrapper-section-header{flex-direction:column;align-items:flex-start;min-height:80px;gap:8px}.acp-autocomplete-wrapper-filter-controls{width:100%;justify-content:flex-start;flex-wrap:wrap;gap:12px}.acp-autocomplete-wrapper-filter-select{min-width:100px;font-size:11px}.acp-autocomplete-wrapper-filter-label{font-size:11px}.acp-autocomplete-wrapper-pagination-header{width:100%;justify-content:space-between}.acp-autocomplete-wrapper-pagination-header .acp-autocomplete-wrapper-pagination-info{display:none}.acp-autocomplete-wrapper-pagination-controls{gap:2px}.acp-autocomplete-wrapper-page-input{width:40px}.acp-autocomplete-wrapper-item-content{padding:16px 12px;min-height:52px}.acp-autocomplete-wrapper-button-text{font-size:12px}.acp-autocomplete-wrapper-items-list.acp-autocomplete-wrapper-scrollable-list{max-height:250px}}@media(max-width:480px){.acp-autocomplete-wrapper-dropdown{min-width:260px;max-height:50vh}.acp-autocomplete-wrapper-section-header{padding:8px 12px 6px;min-height:70px;gap:6px}.acp-autocomplete-wrapper-filter-controls{gap:8px}.acp-autocomplete-wrapper-filter-group{gap:4px}.acp-autocomplete-wrapper-filter-select{min-width:90px;padding:3px 6px}.acp-autocomplete-wrapper-item-content{padding:14px 12px}.acp-autocomplete-wrapper-pagination-header{gap:8px}.acp-autocomplete-wrapper-pagination-button{min-width:28px;height:28px}.acp-autocomplete-wrapper-page-input{width:35px;height:28px}.acp-autocomplete-wrapper-items-list.acp-autocomplete-wrapper-scrollable-list{max-height:200px}.acp-autocomplete-wrapper-footer-actions{gap:4px}.acp-autocomplete-wrapper-footer-button{font-size:12px;padding:8px 12px;min-height:40px}.acp-autocomplete-wrapper-button-text{display:none}}\n"] }]
|
|
2557
|
-
}], propDecorators: { dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: false }] }], config: [{
|
|
2558
|
-
type: Input
|
|
2559
|
-
}], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], searchFunction: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchFunction", required: false }] }], notFoundTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "notFoundTemplate", required: false }] }], overlayWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayWidth", required: false }] }], overlayMaxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayMaxHeight", required: false }] }], itemSelected: [{ type: i0.Output, args: ["itemSelected"] }], searchChanged: [{ type: i0.Output, args: ["searchChanged"] }], searchRequested: [{ type: i0.Output, args: ["searchRequested"] }], pageChanged: [{ type: i0.Output, args: ["pageChanged"] }], filterChanged: [{ type: i0.Output, args: ["filterChanged"] }], advancedSearchClicked: [{ type: i0.Output, args: ["advancedSearchClicked"] }], allResultsClicked: [{ type: i0.Output, args: ["allResultsClicked"] }], createClicked: [{ type: i0.Output, args: ["createClicked"] }], searchInput: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], historyListElement: [{ type: i0.ViewChild, args: ['historyListElement', { isSignal: true }] }], resultsListElement: [{ type: i0.ViewChild, args: ['resultsListElement', { isSignal: true }] }] } });
|
|
2560
|
-
|
|
2561
1838
|
class AcpToObservablePipe {
|
|
2562
1839
|
transform(value) {
|
|
2563
1840
|
return isObservable(value) ? value : of(value);
|
|
@@ -3120,14 +2397,14 @@ class ColumnResize {
|
|
|
3120
2397
|
}
|
|
3121
2398
|
_listenForResizeActivity() {
|
|
3122
2399
|
merge(this.eventDispatcher.overlayHandleActiveForCell.pipe(mapTo(undefined)), this.notifier.triggerResize.pipe(mapTo(undefined)), this.notifier.resizeCompleted.pipe(mapTo(undefined)))
|
|
3123
|
-
.pipe(take(1), takeUntil
|
|
2400
|
+
.pipe(take(1), takeUntil(this.destroyed))
|
|
3124
2401
|
.subscribe(() => {
|
|
3125
2402
|
this.setResized();
|
|
3126
2403
|
});
|
|
3127
2404
|
}
|
|
3128
2405
|
_listenForHoverActivity() {
|
|
3129
2406
|
this.eventDispatcher.headerRowHoveredOrActiveDistinct
|
|
3130
|
-
.pipe(startWith(null), pairwise(), takeUntil
|
|
2407
|
+
.pipe(startWith(null), pairwise(), takeUntil(this.destroyed))
|
|
3131
2408
|
.subscribe(([previousRow, hoveredRow]) => {
|
|
3132
2409
|
if (hoveredRow) {
|
|
3133
2410
|
hoveredRow.classList.add(HOVER_OR_ACTIVE_CLASS);
|
|
@@ -3674,7 +2951,7 @@ class Resizable {
|
|
|
3674
2951
|
}
|
|
3675
2952
|
_listenForRowHoverEvents() {
|
|
3676
2953
|
const element = this.elementRef.nativeElement;
|
|
3677
|
-
const takeUntilDestroyed = takeUntil
|
|
2954
|
+
const takeUntilDestroyed = takeUntil(this.destroyed);
|
|
3678
2955
|
this.eventDispatcher
|
|
3679
2956
|
.resizeOverlayVisibleForHeaderRow(closest(element, HEADER_ROW_SELECTOR))
|
|
3680
2957
|
.pipe(takeUntilDestroyed)
|
|
@@ -3692,7 +2969,7 @@ class Resizable {
|
|
|
3692
2969
|
});
|
|
3693
2970
|
}
|
|
3694
2971
|
_listenForResizeEvents() {
|
|
3695
|
-
const takeUntilDestroyed = takeUntil
|
|
2972
|
+
const takeUntilDestroyed = takeUntil(this.destroyed);
|
|
3696
2973
|
merge(this.resizeNotifier.resizeCanceled, this.resizeNotifier.triggerResize)
|
|
3697
2974
|
.pipe(takeUntilDestroyed, filter(columnSize => columnSize.columnId === this.columnDef.name))
|
|
3698
2975
|
.subscribe(({ size, previousSize, completeImmediately }) => {
|
|
@@ -3787,13 +3064,13 @@ class ResizeOverlayHandle {
|
|
|
3787
3064
|
_listenForMouseEvents() {
|
|
3788
3065
|
this.ngZone.runOutsideAngular(() => {
|
|
3789
3066
|
this._observableFromEvent(this.elementRef.nativeElement, 'mouseenter')
|
|
3790
|
-
.pipe(mapTo(this.resizeRef.origin.nativeElement), takeUntil
|
|
3067
|
+
.pipe(mapTo(this.resizeRef.origin.nativeElement), takeUntil(this.destroyed))
|
|
3791
3068
|
.subscribe(cell => this.eventDispatcher.headerCellHovered.next(cell));
|
|
3792
3069
|
this._observableFromEvent(this.elementRef.nativeElement, 'mouseleave')
|
|
3793
|
-
.pipe(map$1(event => event.relatedTarget && closest(event.relatedTarget, HEADER_CELL_SELECTOR)), takeUntil
|
|
3070
|
+
.pipe(map$1(event => event.relatedTarget && closest(event.relatedTarget, HEADER_CELL_SELECTOR)), takeUntil(this.destroyed))
|
|
3794
3071
|
.subscribe(cell => this.eventDispatcher.headerCellHovered.next(cell));
|
|
3795
3072
|
this._observableFromEvent(this.elementRef.nativeElement, 'mousedown')
|
|
3796
|
-
.pipe(takeUntil
|
|
3073
|
+
.pipe(takeUntil(this.destroyed))
|
|
3797
3074
|
.subscribe(mousedownEvent => {
|
|
3798
3075
|
this._dragStarted(mousedownEvent);
|
|
3799
3076
|
});
|
|
@@ -3815,16 +3092,16 @@ class ResizeOverlayHandle {
|
|
|
3815
3092
|
let overshot = 0;
|
|
3816
3093
|
this._cumulativeDeltaX = 0;
|
|
3817
3094
|
this.updateResizeActive(true);
|
|
3818
|
-
mouseup.pipe(takeUntil
|
|
3095
|
+
mouseup.pipe(takeUntil(merge(escape, this.destroyed))).subscribe(({ screenX }) => {
|
|
3819
3096
|
this.styleScheduler.scheduleEnd(() => {
|
|
3820
3097
|
this._notifyResizeEnded(size, screenX !== startX);
|
|
3821
3098
|
});
|
|
3822
3099
|
});
|
|
3823
|
-
escape.pipe(takeUntil
|
|
3100
|
+
escape.pipe(takeUntil(merge(mouseup, this.destroyed))).subscribe(() => {
|
|
3824
3101
|
this._notifyResizeEnded(initialSize);
|
|
3825
3102
|
});
|
|
3826
3103
|
mousemove
|
|
3827
|
-
.pipe(map$1(({ screenX }) => screenX), startWith(startX), distinctUntilChanged(), pairwise(), takeUntil
|
|
3104
|
+
.pipe(map$1(({ screenX }) => screenX), startWith(startX), distinctUntilChanged(), pairwise(), takeUntil(merge(mouseup, escape, this.destroyed)))
|
|
3828
3105
|
.subscribe(([prevX, currX]) => {
|
|
3829
3106
|
let deltaX = currX - prevX;
|
|
3830
3107
|
if (!this.resizeRef.liveUpdates) {
|
|
@@ -4383,7 +3660,7 @@ class DataGrid {
|
|
|
4383
3660
|
/** Whether to hide the page size selection UI from the user. */
|
|
4384
3661
|
hidePageSize = this._defaultOptions?.hidePageSize ?? false;
|
|
4385
3662
|
/** Event emitted when the paginator changes the page size or page index. */
|
|
4386
|
-
page =
|
|
3663
|
+
page = output();
|
|
4387
3664
|
/** The template for the pagination. */
|
|
4388
3665
|
paginationTemplate;
|
|
4389
3666
|
// ===== Sort =====
|
|
@@ -4406,16 +3683,16 @@ class DataGrid {
|
|
|
4406
3683
|
*/
|
|
4407
3684
|
sortStart = this._defaultOptions?.sortStart ?? 'asc';
|
|
4408
3685
|
/** Event emitted when the user changes either the active sort or sort direction. */
|
|
4409
|
-
sortChange =
|
|
3686
|
+
sortChange = output();
|
|
4410
3687
|
// ===== Row =====
|
|
4411
3688
|
/** Whether to use the row hover style. */
|
|
4412
3689
|
rowHover = this._defaultOptions?.rowHover ?? false;
|
|
4413
3690
|
/** Whether to use the row striped style. */
|
|
4414
3691
|
rowStriped = this._defaultOptions?.rowStriped ?? false;
|
|
4415
3692
|
/** Event emitted when the user clicks the row. */
|
|
4416
|
-
rowClick =
|
|
3693
|
+
rowClick = output();
|
|
4417
3694
|
/** Event emitted when the user attempts to open a context menu. */
|
|
4418
|
-
rowContextMenu =
|
|
3695
|
+
rowContextMenu = output();
|
|
4419
3696
|
// ===== Expandable Row =====
|
|
4420
3697
|
expansionRowStates = [];
|
|
4421
3698
|
/** Whether the row is expandable. */
|
|
@@ -4423,7 +3700,7 @@ class DataGrid {
|
|
|
4423
3700
|
/** The template for the expandable row. */
|
|
4424
3701
|
expansionTemplate;
|
|
4425
3702
|
/** Event emitted when the user toggles the expandable row. */
|
|
4426
|
-
expansionChange =
|
|
3703
|
+
expansionChange = output();
|
|
4427
3704
|
closeOthersOnExpand = input(false, /* @ts-ignore */
|
|
4428
3705
|
...(ngDevMode ? [{ debugName: "closeOthersOnExpand" }] : /* istanbul ignore next */ []));
|
|
4429
3706
|
// ===== Row Selection =====
|
|
@@ -4445,19 +3722,19 @@ class DataGrid {
|
|
|
4445
3722
|
/** The selected row items. */
|
|
4446
3723
|
rowSelected = [];
|
|
4447
3724
|
/** Event emitted when the row is selected. */
|
|
4448
|
-
rowSelectedChange =
|
|
4449
|
-
checkboxKeyDown =
|
|
4450
|
-
checkboxKeyUp =
|
|
4451
|
-
checkboxKeyPress =
|
|
4452
|
-
rowKeyDown =
|
|
4453
|
-
rowKeyUp =
|
|
4454
|
-
rowKeyPress =
|
|
3725
|
+
rowSelectedChange = output();
|
|
3726
|
+
checkboxKeyDown = output();
|
|
3727
|
+
checkboxKeyUp = output();
|
|
3728
|
+
checkboxKeyPress = output();
|
|
3729
|
+
rowKeyDown = output();
|
|
3730
|
+
rowKeyUp = output();
|
|
3731
|
+
rowKeyPress = output();
|
|
4455
3732
|
// ===== Cell Selection =====
|
|
4456
3733
|
cellSelection = [];
|
|
4457
3734
|
/** Whether the cell is selectable. */
|
|
4458
3735
|
cellSelectable = this._defaultOptions?.cellSelectable ?? true;
|
|
4459
3736
|
/** Event emitted when the cell is selected. */
|
|
4460
|
-
cellSelectedChange =
|
|
3737
|
+
cellSelectedChange = output();
|
|
4461
3738
|
_selectedCell;
|
|
4462
3739
|
// ===== Toolbar =====
|
|
4463
3740
|
/** Whether to show the toolbar. */
|
|
@@ -4476,7 +3753,7 @@ class DataGrid {
|
|
|
4476
3753
|
/** Whether the column is pinnable. */
|
|
4477
3754
|
columnPinnable = this._defaultOptions?.columnPinnable ?? true;
|
|
4478
3755
|
/** Event emitted when the column is hided or is sorted. */
|
|
4479
|
-
columnChange =
|
|
3756
|
+
columnChange = output();
|
|
4480
3757
|
/** The options for the column pin list. */
|
|
4481
3758
|
columnPinOptions = this._defaultOptions?.columnPinOptions ?? [];
|
|
4482
3759
|
/** Whether to show the column menu button. */
|
|
@@ -4598,8 +3875,6 @@ class DataGrid {
|
|
|
4598
3875
|
this.rowSelection = new SelectionModel(this.multiSelectable, this.rowSelected);
|
|
4599
3876
|
}
|
|
4600
3877
|
this.dataSource = new MatTableDataSource(this.data);
|
|
4601
|
-
this.dataSource.paginator = this.pageOnFront ? this.paginator : null;
|
|
4602
|
-
this.dataSource.sort = this.sortOnFront ? this.sort : null;
|
|
4603
3878
|
// Only scroll top with data change
|
|
4604
3879
|
if (changes['data']) {
|
|
4605
3880
|
this.scrollTop(0);
|
|
@@ -4609,9 +3884,15 @@ class DataGrid {
|
|
|
4609
3884
|
if (this.pageOnFront) {
|
|
4610
3885
|
this.dataSource.paginator = this.paginator;
|
|
4611
3886
|
}
|
|
3887
|
+
else {
|
|
3888
|
+
this.dataSource.paginator = null;
|
|
3889
|
+
}
|
|
4612
3890
|
if (this.sortOnFront) {
|
|
4613
3891
|
this.dataSource.sort = this.sort;
|
|
4614
3892
|
}
|
|
3893
|
+
else {
|
|
3894
|
+
this.dataSource.sort = null;
|
|
3895
|
+
}
|
|
4615
3896
|
if (this.rowDefs?.length > 0 && this.useContentRowTemplate) {
|
|
4616
3897
|
this.rowDefs.forEach(rowDef => this.table.addRowDef(rowDef));
|
|
4617
3898
|
}
|
|
@@ -4893,9 +4174,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
4893
4174
|
}], hidePageSize: [{
|
|
4894
4175
|
type: Input,
|
|
4895
4176
|
args: [{ transform: booleanAttribute }]
|
|
4896
|
-
}], page: [{
|
|
4897
|
-
type: Output
|
|
4898
|
-
}], paginationTemplate: [{
|
|
4177
|
+
}], page: [{ type: i0.Output, args: ["page"] }], paginationTemplate: [{
|
|
4899
4178
|
type: Input
|
|
4900
4179
|
}], sortOnFront: [{
|
|
4901
4180
|
type: Input,
|
|
@@ -4912,26 +4191,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
4912
4191
|
args: [{ transform: booleanAttribute }]
|
|
4913
4192
|
}], sortStart: [{
|
|
4914
4193
|
type: Input
|
|
4915
|
-
}], sortChange: [{
|
|
4916
|
-
type: Output
|
|
4917
|
-
}], rowHover: [{
|
|
4194
|
+
}], sortChange: [{ type: i0.Output, args: ["sortChange"] }], rowHover: [{
|
|
4918
4195
|
type: Input,
|
|
4919
4196
|
args: [{ transform: booleanAttribute }]
|
|
4920
4197
|
}], rowStriped: [{
|
|
4921
4198
|
type: Input,
|
|
4922
4199
|
args: [{ transform: booleanAttribute }]
|
|
4923
|
-
}], rowClick: [{
|
|
4924
|
-
type: Output
|
|
4925
|
-
}], rowContextMenu: [{
|
|
4926
|
-
type: Output
|
|
4927
|
-
}], expandable: [{
|
|
4200
|
+
}], rowClick: [{ type: i0.Output, args: ["rowClick"] }], rowContextMenu: [{ type: i0.Output, args: ["rowContextMenu"] }], expandable: [{
|
|
4928
4201
|
type: Input,
|
|
4929
4202
|
args: [{ transform: booleanAttribute }]
|
|
4930
4203
|
}], expansionTemplate: [{
|
|
4931
4204
|
type: Input
|
|
4932
|
-
}], expansionChange: [{
|
|
4933
|
-
type: Output
|
|
4934
|
-
}], closeOthersOnExpand: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOthersOnExpand", required: false }] }], multiSelectable: [{
|
|
4205
|
+
}], expansionChange: [{ type: i0.Output, args: ["expansionChange"] }], closeOthersOnExpand: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOthersOnExpand", required: false }] }], multiSelectable: [{
|
|
4935
4206
|
type: Input,
|
|
4936
4207
|
args: [{ transform: booleanAttribute }]
|
|
4937
4208
|
}], multiSelectionWithClick: [{
|
|
@@ -4952,26 +4223,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
4952
4223
|
type: Input
|
|
4953
4224
|
}], rowSelected: [{
|
|
4954
4225
|
type: Input
|
|
4955
|
-
}], rowSelectedChange: [{
|
|
4956
|
-
type: Output
|
|
4957
|
-
}], checkboxKeyDown: [{
|
|
4958
|
-
type: Output
|
|
4959
|
-
}], checkboxKeyUp: [{
|
|
4960
|
-
type: Output
|
|
4961
|
-
}], checkboxKeyPress: [{
|
|
4962
|
-
type: Output
|
|
4963
|
-
}], rowKeyDown: [{
|
|
4964
|
-
type: Output
|
|
4965
|
-
}], rowKeyUp: [{
|
|
4966
|
-
type: Output
|
|
4967
|
-
}], rowKeyPress: [{
|
|
4968
|
-
type: Output
|
|
4969
|
-
}], cellSelectable: [{
|
|
4226
|
+
}], rowSelectedChange: [{ type: i0.Output, args: ["rowSelectedChange"] }], checkboxKeyDown: [{ type: i0.Output, args: ["checkboxKeyDown"] }], checkboxKeyUp: [{ type: i0.Output, args: ["checkboxKeyUp"] }], checkboxKeyPress: [{ type: i0.Output, args: ["checkboxKeyPress"] }], rowKeyDown: [{ type: i0.Output, args: ["rowKeyDown"] }], rowKeyUp: [{ type: i0.Output, args: ["rowKeyUp"] }], rowKeyPress: [{ type: i0.Output, args: ["rowKeyPress"] }], cellSelectable: [{
|
|
4970
4227
|
type: Input,
|
|
4971
4228
|
args: [{ transform: booleanAttribute }]
|
|
4972
|
-
}], cellSelectedChange: [{
|
|
4973
|
-
type: Output
|
|
4974
|
-
}], showToolbar: [{
|
|
4229
|
+
}], cellSelectedChange: [{ type: i0.Output, args: ["cellSelectedChange"] }], showToolbar: [{
|
|
4975
4230
|
type: Input,
|
|
4976
4231
|
args: [{ transform: booleanAttribute }]
|
|
4977
4232
|
}], toolbarTitle: [{
|
|
@@ -4989,9 +4244,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
4989
4244
|
}], columnPinnable: [{
|
|
4990
4245
|
type: Input,
|
|
4991
4246
|
args: [{ transform: booleanAttribute }]
|
|
4992
|
-
}], columnChange: [{
|
|
4993
|
-
type: Output
|
|
4994
|
-
}], columnPinOptions: [{
|
|
4247
|
+
}], columnChange: [{ type: i0.Output, args: ["columnChange"] }], columnPinOptions: [{
|
|
4995
4248
|
type: Input
|
|
4996
4249
|
}], showColumnMenuButton: [{
|
|
4997
4250
|
type: Input,
|
|
@@ -5104,14 +4357,14 @@ class KeyboardNavigationService {
|
|
|
5104
4357
|
this.focusableElements.push(element);
|
|
5105
4358
|
// Configurar eventos de teclado para este elemento
|
|
5106
4359
|
fromEvent(element.element?.nativeElement, 'keydown')
|
|
5107
|
-
.pipe(takeUntil
|
|
4360
|
+
.pipe(takeUntil(this.destroy$), filter(event => ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(event.key)))
|
|
5108
4361
|
.subscribe(event => {
|
|
5109
4362
|
event.preventDefault(); // Prevenir el comportamiento por defecto del navegador (scroll, etc.)
|
|
5110
4363
|
this.handleKeyNavigation(event.key);
|
|
5111
4364
|
});
|
|
5112
4365
|
// Configurar eventos de foco para este elemento
|
|
5113
4366
|
fromEvent(element.element?.nativeElement, 'focus')
|
|
5114
|
-
.pipe(takeUntil
|
|
4367
|
+
.pipe(takeUntil(this.destroy$))
|
|
5115
4368
|
.subscribe(() => {
|
|
5116
4369
|
const index = this.focusableElements.findIndex(e => e.element === element.element);
|
|
5117
4370
|
this.currentFocusIndex.set(index);
|
|
@@ -8495,7 +7748,7 @@ class AcpDateRangeInput {
|
|
|
8495
7748
|
this._dateOptions.set(options);
|
|
8496
7749
|
}
|
|
8497
7750
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AcpDateRangeInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8498
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: AcpDateRangeInput, isStandalone: true, selector: "acp-date-range-input", inputs: { inputLabel: { classPropertyName: "inputLabel", publicName: "inputLabel", isSignal: false, isRequired: false, transformFunction: null }, showClearButton: { classPropertyName: "showClearButton", publicName: "showClearButton", isSignal: true, isRequired: false, transformFunction: null }, showCalendarIcon: { classPropertyName: "showCalendarIcon", publicName: "showCalendarIcon", isSignal: true, isRequired: false, transformFunction: null }, showRangeRequired: { classPropertyName: "showRangeRequired", publicName: "showRangeRequired", isSignal: true, isRequired: false, transformFunction: null }, isRangeRequired: { classPropertyName: "isRangeRequired", publicName: "isRangeRequired", isSignal: true, isRequired: false, transformFunction: null }, staticOptionId: { classPropertyName: "staticOptionId", publicName: "staticOptionId", isSignal: false, isRequired: false, transformFunction: null }, dynamicOptionId: { classPropertyName: "dynamicOptionId", publicName: "dynamicOptionId", isSignal: false, isRequired: false, transformFunction: null }, calendarId: { classPropertyName: "calendarId", publicName: "calendarId", isSignal: false, isRequired: false, transformFunction: null }, enableDefaultOptions: { classPropertyName: "enableDefaultOptions", publicName: "enableDefaultOptions", isSignal: false, isRequired: false, transformFunction: null }, selectedDates: { classPropertyName: "selectedDates", publicName: "selectedDates", isSignal: false, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: false, isRequired: false, transformFunction: null }, isShowStaticDefaultOptions: { classPropertyName: "isShowStaticDefaultOptions", publicName: "isShowStaticDefaultOptions", isSignal: false, isRequired: false, transformFunction: null }, hideDefaultOptions: { classPropertyName: "hideDefaultOptions", publicName: "hideDefaultOptions", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayOffsetX: { classPropertyName: "cdkConnectedOverlayOffsetX", publicName: "cdkConnectedOverlayOffsetX", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayOffsetY: { classPropertyName: "cdkConnectedOverlayOffsetY", publicName: "cdkConnectedOverlayOffsetY", isSignal: false, isRequired: false, transformFunction: null }, listCdkConnectedOverlayOffsetY: { classPropertyName: "listCdkConnectedOverlayOffsetY", publicName: "listCdkConnectedOverlayOffsetY", isSignal: false, isRequired: false, transformFunction: null }, listCdkConnectedOverlayOffsetX: { classPropertyName: "listCdkConnectedOverlayOffsetX", publicName: "listCdkConnectedOverlayOffsetX", isSignal: false, isRequired: false, transformFunction: null }, selectedOptionIndex: { classPropertyName: "selectedOptionIndex", publicName: "selectedOptionIndex", isSignal: false, isRequired: false, transformFunction: null }, displaySelectedLabel: { classPropertyName: "displaySelectedLabel", publicName: "displaySelectedLabel", isSignal: false, isRequired: false, transformFunction: null }, displaySelectedExpression: { classPropertyName: "displaySelectedExpression", publicName: "displaySelectedExpression", isSignal: false, isRequired: false, transformFunction: null }, enableEditableDates: { classPropertyName: "enableEditableDates", publicName: "enableEditableDates", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayPush: { classPropertyName: "cdkConnectedOverlayPush", publicName: "cdkConnectedOverlayPush", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayPositions: { classPropertyName: "cdkConnectedOverlayPositions", publicName: "cdkConnectedOverlayPositions", isSignal: false, isRequired: false, transformFunction: null }, allowSingleDateSelection: { classPropertyName: "allowSingleDateSelection", publicName: "allowSingleDateSelection", isSignal: false, isRequired: false, transformFunction: null }, autoSelectOption: { classPropertyName: "autoSelectOption", publicName: "autoSelectOption", isSignal: false, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: false, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: false, isRequired: false, transformFunction: null }, dateDropDownOptions: { classPropertyName: "dateDropDownOptions", publicName: "dateDropDownOptions", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { dateSelectionChanged: "dateSelectionChanged", dateListOptions: "dateListOptions", rangeRequiredChange: "rangeRequiredChange" }, viewQueries: [{ propertyName: "calendar", first: true, predicate: ["calendar"], descendants: true }], ngImport: i0, template: "<!--\n AcpDateRangeInput Component Template\n @author AcontPlus S.A.S\n @version 1.0.0\n\n Comprehensive date range picker with predefined options, custom calendar selection,\n and support for human-readable date expressions.\n-->\n<div class=\"date-picker-main ndp-main\" cdkOverlayOrigin #trigger>\n <mat-form-field\n class=\"w-full\"\n [class]=\"{ 'display-hidden': isShowStaticDefaultOptions }\"\n (click)=\"toggleDateOptionSelectionList($event)\"\n >\n <mat-label (click)=\"toggleDateOptionSelectionList($event)\">{{ inputLabel }}</mat-label>\n <input\n matInput\n #dateInput\n class=\"cursor-pointer\"\n id=\"date-input-field\"\n (input)=\"onMainInputChange(dateInput)\"\n />\n <ng-container matSuffix>\n @if (showClearButton() && !!dateInput.value) {\n <button\n mat-icon-button\n class=\"cursor-pointer pe-0 ps-0\"\n matTooltip=\"Clear\"\n (click)=\"clearSelection($event)\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n } @if (showCalendarIcon()) {\n <button mat-icon-button class=\"cursor-pointer\">\n <mat-icon>date_range</mat-icon>\n </button>\n } @if (showRangeRequired()) {\n <button\n mat-icon-button\n class=\"cursor-pointer\"\n [class.checked]=\"isRangeRequired()\"\n (click)=\"toggleRangeSelection($event)\"\n matTooltip=\"Rango de fechas obligatorio\"\n >\n <mat-icon [color]=\"isRangeRequired() ? 'accent' : ''\">\n {{ isRangeRequired() ? 'check_box' : 'check_box_outline_blank' }}\n </mat-icon>\n </button>\n }\n </ng-container>\n </mat-form-field>\n\n @if (dateDropDownOptions.length && isShowStaticDefaultOptions) {\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n optionId: staticOptionId,\n className: 'w-full custom-ckd-container ndp-cdk-container range-input',\n }\n \"\n />\n }\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayBackdropClass]=\"'cdk-overlay-transparent-backdrop'\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isDateOptionList\"\n [cdkConnectedOverlayPush]=\"cdkConnectedOverlayPush\"\n [cdkConnectedOverlayOffsetX]=\"listCdkConnectedOverlayOffsetX\"\n [cdkConnectedOverlayOffsetY]=\"listCdkConnectedOverlayOffsetY\"\n (backdropClick)=\"isDateOptionList = false\"\n >\n @if (dateDropDownOptions.length && !isShowStaticDefaultOptions) {\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n optionId: dynamicOptionId,\n className: 'w-full custom-ckd-container ndp-cdk-container range-input',\n }\n \"\n />\n }\n </ng-template>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayBackdropClass]=\"'cdk-overlay-transparent-backdrop'\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isCustomRange\"\n [cdkConnectedOverlayPush]=\"cdkConnectedOverlayPush\"\n [cdkConnectedOverlayPositions]=\"cdkConnectedOverlayPositions\"\n [cdkConnectedOverlayOffsetX]=\"cdkConnectedOverlayOffsetX\"\n [cdkConnectedOverlayOffsetY]=\"cdkConnectedOverlayOffsetY\"\n (backdropClick)=\"isCustomRange = false\"\n >\n <div\n class=\"custom-ckd-container ndp-cdk-container custom-calendar-container ndp-calendar-container\"\n [class]=\"{ 'without-default-opt': hideDefaultOptions }\"\n >\n <div class=\"row-1\">\n @if (!hideDefaultOptions) {\n <div class=\"pt-custom column-1\">\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n }\n \"\n />\n </div>\n <div class=\"ndp-column-separator\"></div>\n }\n <div class=\"mt-2 column-2\">\n <acp-date-range-calendar\n [selectedDates]=\"selectedDates\"\n #calendar\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (selectedDatesChange)=\"onCalendarSelectionChange($event)\"\n />\n </div>\n </div>\n <div class=\"row-2 br-top\">\n <div class=\"footer-content ndp-footer-content\">\n @if (enableEditableDates) {\n <form class=\"ndp-date-inputs\" [formGroup]=\"editableForm\">\n <mat-form-field class=\"ndp-date-field\" subscriptSizing=\"dynamic\">\n <mat-label>Start</mat-label>\n <input\n matInput\n formControlName=\"start\"\n placeholder=\"e.g. now-7d\"\n (blur)=\"commitEditableDates(calendar)\"\n (keydown.enter)=\"applyEditableDates(dateInput, calendar)\"\n />\n @if (editableForm.controls.start.hasError('required')) {\n <mat-error>Required</mat-error>\n } @else if (editableForm.controls.start.hasError('invalidDate')) {\n <mat-error>Invalid date or expression</mat-error>\n }\n </mat-form-field>\n <mat-form-field class=\"ndp-date-field\" subscriptSizing=\"dynamic\">\n <mat-label>End</mat-label>\n <input\n matInput\n formControlName=\"end\"\n placeholder=\"e.g. now\"\n (blur)=\"commitEditableDates(calendar)\"\n (keydown.enter)=\"applyEditableDates(dateInput, calendar)\"\n />\n @if (editableForm.controls.end.hasError('required')) {\n <mat-error>Required</mat-error>\n } @else if (editableForm.controls.end.hasError('invalidDate')) {\n <mat-error>Invalid date or expression</mat-error>\n } @else if (editableForm.hasError('rangeOrder')) {\n <mat-error>Start must be before end</mat-error>\n }\n </mat-form-field>\n </form>\n } @else {\n <span id=\"range-label-text\" class=\"ndp-range-label-text\">\n {{ calendar?.selectedDates?.start | date: dateFormat }} @if\n (calendar?.selectedDates?.end) {\n <span> - {{ calendar.selectedDates?.end | date: dateFormat }} </span>\n }\n </span>\n }\n <div class=\"buttons\">\n <acp-button\n type=\"button\"\n variant=\"danger\"\n matStyle=\"filled\"\n (handleClick)=\"isCustomRange = false\"\n >Cancelar</acp-button\n >\n <acp-button\n type=\"button\"\n variant=\"primary\"\n matStyle=\"filled\"\n [class.disabled]=\"\n enableEditableDates\n ? editableForm.invalid\n : !(calendar?.selectedDates?.start && calendar?.selectedDates?.end)\n \"\n (handleClick)=\"\n enableEditableDates && commitEditableDates(calendar);\n updateCustomRange(dateInput, calendar.selectedDates)\n \"\n >\n Aplicar \n </acp-button>\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n</div>\n\n<ng-template\n #dateOptionList\n let-options\n let-input=\"dateInput\"\n let-optionId=\"optionId\"\n let-className=\"className\"\n>\n <mat-action-list [ngClass]=\"className\" [id]=\"optionId\">\n @for (option of options; track option.optionLabel) {\n <mat-list-item [activated]=\"option.isSelected\" (click)=\"updateSelection(option, input)\">\n {{ option.optionLabel }}\n </mat-list-item>\n }\n </mat-action-list>\n</ng-template>\n", styles: ["::ng-deep .cdk-overlay-dark-backdrop{background:none}mat-list-item.mat-mdc-list-item{height:40px}mat-list-item.mdc-list-item--activated{background-color:var(--ndp-selected-option-bg, var(--mat-sys-secondary-container, rgba(0, 0, 0, .08)))}::ng-deep .cdk-overlay-pane:has(.custom-ckd-container),::ng-deep .cdk-overlay-pane:has(.ndp-cdk-container){width:100%;background-color:var(--mat-sys-surface-container);max-height:100vh;overflow-y:auto;overflow-x:hidden;max-width:700px;margin-top:-22px;border:1px solid var(--mat-sys-surface-container)}::ng-deep .cdk-overlay-pane:has(.range-input){max-width:250px}.br-top{border-top:1px solid var(--mat-sys-surface-container)}.br-right{border-right:1px solid var(--mat-sys-surface-container)}.disabled{pointer-events:none;opacity:.5}.mat-button,.mdc-button{font-family:var(--mat-list-list-item-label-text-font);line-height:var(--mat-list-list-item-label-text-line-height);font-size:var(--mat-list-list-item-label-text-size);font-weight:var(--mat-list-list-item-label-text-weight);letter-spacing:var(--mat-list-list-item-label-text-tracking)}.w-full{width:100%}.display-hidden{display:none}.custom-calendar-container,.ndp-calendar-container{width:100%}.row-1,.row-2{width:100%;box-sizing:border-box}.row-1{display:flex;align-items:stretch}.row-2{padding:16px}.ndp-column-separator{flex:0 0 1px;background-color:var(--mat-sys-surface-container)}.footer-content,.ndp-footer-content{align-items:center;display:flex;text-align:right;justify-content:end;gap:16px;text-overflow:ellipsis}.footer-content .buttons,.ndp-footer-content .buttons{display:flex;gap:8px}.ndp-date-inputs{display:flex;gap:8px;margin-right:auto;align-items:flex-start}.ndp-date-field{width:150px}.column-1{flex:0 0 25%;overflow:auto}.column-2{flex:1 1 auto;min-width:0}.without-default-opt .column-1{display:none}@media(max-width:400px){.footer-content,.ndp-footer-content{display:block}.footer-content .buttons,.ndp-footer-content .buttons{justify-content:flex-end;margin-top:20px}#range-label-text{margin-right:1.5rem}}@media(max-width:650px){.row-1{flex-direction:column}.column-1{flex-basis:auto}.column-separator{display:none}}.pe-0{padding-right:0}.ps-0{padding-left:0}button.checked{color:var(--mat-sys-primary);border-radius:4px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "ngmodule", type: MatNativeDateModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { 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.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$5.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1$5.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i6.MatActionList, selector: "mat-action-list", exportAs: ["matActionList"] }, { kind: "component", type: i6.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: AcpDateRangeCalendar, selector: "acp-date-range-calendar", inputs: ["minDate", "maxDate", "selectedDates"], outputs: ["selectedDatesChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Button, selector: "acp-button", inputs: ["variant", "text", "icon", "disabled", "type", "matStyle", "customClass", "reportFormat", "extended", "title", "ariaLabel", "name", "id", "form", "tabIndex", "testId"], outputs: ["handleClick"] }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7751
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: AcpDateRangeInput, isStandalone: true, selector: "acp-date-range-input", inputs: { inputLabel: { classPropertyName: "inputLabel", publicName: "inputLabel", isSignal: false, isRequired: false, transformFunction: null }, showClearButton: { classPropertyName: "showClearButton", publicName: "showClearButton", isSignal: true, isRequired: false, transformFunction: null }, showCalendarIcon: { classPropertyName: "showCalendarIcon", publicName: "showCalendarIcon", isSignal: true, isRequired: false, transformFunction: null }, showRangeRequired: { classPropertyName: "showRangeRequired", publicName: "showRangeRequired", isSignal: true, isRequired: false, transformFunction: null }, isRangeRequired: { classPropertyName: "isRangeRequired", publicName: "isRangeRequired", isSignal: true, isRequired: false, transformFunction: null }, staticOptionId: { classPropertyName: "staticOptionId", publicName: "staticOptionId", isSignal: false, isRequired: false, transformFunction: null }, dynamicOptionId: { classPropertyName: "dynamicOptionId", publicName: "dynamicOptionId", isSignal: false, isRequired: false, transformFunction: null }, calendarId: { classPropertyName: "calendarId", publicName: "calendarId", isSignal: false, isRequired: false, transformFunction: null }, enableDefaultOptions: { classPropertyName: "enableDefaultOptions", publicName: "enableDefaultOptions", isSignal: false, isRequired: false, transformFunction: null }, selectedDates: { classPropertyName: "selectedDates", publicName: "selectedDates", isSignal: false, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: false, isRequired: false, transformFunction: null }, isShowStaticDefaultOptions: { classPropertyName: "isShowStaticDefaultOptions", publicName: "isShowStaticDefaultOptions", isSignal: false, isRequired: false, transformFunction: null }, hideDefaultOptions: { classPropertyName: "hideDefaultOptions", publicName: "hideDefaultOptions", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayOffsetX: { classPropertyName: "cdkConnectedOverlayOffsetX", publicName: "cdkConnectedOverlayOffsetX", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayOffsetY: { classPropertyName: "cdkConnectedOverlayOffsetY", publicName: "cdkConnectedOverlayOffsetY", isSignal: false, isRequired: false, transformFunction: null }, listCdkConnectedOverlayOffsetY: { classPropertyName: "listCdkConnectedOverlayOffsetY", publicName: "listCdkConnectedOverlayOffsetY", isSignal: false, isRequired: false, transformFunction: null }, listCdkConnectedOverlayOffsetX: { classPropertyName: "listCdkConnectedOverlayOffsetX", publicName: "listCdkConnectedOverlayOffsetX", isSignal: false, isRequired: false, transformFunction: null }, selectedOptionIndex: { classPropertyName: "selectedOptionIndex", publicName: "selectedOptionIndex", isSignal: false, isRequired: false, transformFunction: null }, displaySelectedLabel: { classPropertyName: "displaySelectedLabel", publicName: "displaySelectedLabel", isSignal: false, isRequired: false, transformFunction: null }, displaySelectedExpression: { classPropertyName: "displaySelectedExpression", publicName: "displaySelectedExpression", isSignal: false, isRequired: false, transformFunction: null }, enableEditableDates: { classPropertyName: "enableEditableDates", publicName: "enableEditableDates", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayPush: { classPropertyName: "cdkConnectedOverlayPush", publicName: "cdkConnectedOverlayPush", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayPositions: { classPropertyName: "cdkConnectedOverlayPositions", publicName: "cdkConnectedOverlayPositions", isSignal: false, isRequired: false, transformFunction: null }, allowSingleDateSelection: { classPropertyName: "allowSingleDateSelection", publicName: "allowSingleDateSelection", isSignal: false, isRequired: false, transformFunction: null }, autoSelectOption: { classPropertyName: "autoSelectOption", publicName: "autoSelectOption", isSignal: false, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: false, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: false, isRequired: false, transformFunction: null }, dateDropDownOptions: { classPropertyName: "dateDropDownOptions", publicName: "dateDropDownOptions", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { dateSelectionChanged: "dateSelectionChanged", dateListOptions: "dateListOptions", rangeRequiredChange: "rangeRequiredChange" }, viewQueries: [{ propertyName: "calendar", first: true, predicate: ["calendar"], descendants: true }], ngImport: i0, template: "<!--\n AcpDateRangeInput Component Template\n @author AcontPlus S.A.S\n @version 1.0.0\n\n Comprehensive date range picker with predefined options, custom calendar selection,\n and support for human-readable date expressions.\n-->\n<div class=\"date-picker-main ndp-main\" cdkOverlayOrigin #trigger>\n <mat-form-field\n class=\"w-full\"\n [class]=\"{ 'display-hidden': isShowStaticDefaultOptions }\"\n (click)=\"toggleDateOptionSelectionList($event)\"\n >\n <mat-label (click)=\"toggleDateOptionSelectionList($event)\">{{ inputLabel }}</mat-label>\n <input\n matInput\n #dateInput\n class=\"cursor-pointer\"\n id=\"date-input-field\"\n (input)=\"onMainInputChange(dateInput)\"\n />\n <ng-container matSuffix>\n @if (showClearButton() && !!dateInput.value) {\n <button\n mat-icon-button\n class=\"cursor-pointer pe-0 ps-0\"\n matTooltip=\"Clear\"\n (click)=\"clearSelection($event)\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n } @if (showCalendarIcon()) {\n <button mat-icon-button class=\"cursor-pointer\">\n <mat-icon>date_range</mat-icon>\n </button>\n } @if (showRangeRequired()) {\n <button\n mat-icon-button\n class=\"cursor-pointer\"\n [class.checked]=\"isRangeRequired()\"\n (click)=\"toggleRangeSelection($event)\"\n matTooltip=\"Rango de fechas obligatorio\"\n >\n <mat-icon [color]=\"isRangeRequired() ? 'accent' : ''\">\n {{ isRangeRequired() ? 'check_box' : 'check_box_outline_blank' }}\n </mat-icon>\n </button>\n }\n </ng-container>\n </mat-form-field>\n\n @if (dateDropDownOptions.length && isShowStaticDefaultOptions) {\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n optionId: staticOptionId,\n className: 'w-full custom-ckd-container ndp-cdk-container range-input',\n }\n \"\n />\n }\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayBackdropClass]=\"'cdk-overlay-transparent-backdrop'\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isDateOptionList\"\n [cdkConnectedOverlayPush]=\"cdkConnectedOverlayPush\"\n [cdkConnectedOverlayOffsetX]=\"listCdkConnectedOverlayOffsetX\"\n [cdkConnectedOverlayOffsetY]=\"listCdkConnectedOverlayOffsetY\"\n (backdropClick)=\"isDateOptionList = false\"\n >\n @if (dateDropDownOptions.length && !isShowStaticDefaultOptions) {\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n optionId: dynamicOptionId,\n className: 'w-full custom-ckd-container ndp-cdk-container range-input',\n }\n \"\n />\n }\n </ng-template>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayBackdropClass]=\"'cdk-overlay-transparent-backdrop'\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isCustomRange\"\n [cdkConnectedOverlayPush]=\"cdkConnectedOverlayPush\"\n [cdkConnectedOverlayPositions]=\"cdkConnectedOverlayPositions\"\n [cdkConnectedOverlayOffsetX]=\"cdkConnectedOverlayOffsetX\"\n [cdkConnectedOverlayOffsetY]=\"cdkConnectedOverlayOffsetY\"\n (backdropClick)=\"isCustomRange = false\"\n >\n <div\n class=\"custom-ckd-container ndp-cdk-container custom-calendar-container ndp-calendar-container\"\n [class]=\"{ 'without-default-opt': hideDefaultOptions }\"\n >\n <div class=\"row-1\">\n @if (!hideDefaultOptions) {\n <div class=\"pt-custom column-1\">\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n }\n \"\n />\n </div>\n <div class=\"ndp-column-separator\"></div>\n }\n <div class=\"mt-2 column-2\">\n <acp-date-range-calendar\n [selectedDates]=\"selectedDates\"\n #calendar\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (selectedDatesChange)=\"onCalendarSelectionChange($event)\"\n />\n </div>\n </div>\n <div class=\"row-2 br-top\">\n <div class=\"footer-content ndp-footer-content\">\n @if (enableEditableDates) {\n <form class=\"ndp-date-inputs\" [formGroup]=\"editableForm\">\n <mat-form-field class=\"ndp-date-field\" subscriptSizing=\"dynamic\">\n <mat-label>Start</mat-label>\n <input\n matInput\n formControlName=\"start\"\n placeholder=\"e.g. now-7d\"\n (blur)=\"commitEditableDates(calendar)\"\n (keydown.enter)=\"applyEditableDates(dateInput, calendar)\"\n />\n @if (editableForm.controls.start.hasError('required')) {\n <mat-error>Required</mat-error>\n } @else if (editableForm.controls.start.hasError('invalidDate')) {\n <mat-error>Invalid date or expression</mat-error>\n }\n </mat-form-field>\n <mat-form-field class=\"ndp-date-field\" subscriptSizing=\"dynamic\">\n <mat-label>End</mat-label>\n <input\n matInput\n formControlName=\"end\"\n placeholder=\"e.g. now\"\n (blur)=\"commitEditableDates(calendar)\"\n (keydown.enter)=\"applyEditableDates(dateInput, calendar)\"\n />\n @if (editableForm.controls.end.hasError('required')) {\n <mat-error>Required</mat-error>\n } @else if (editableForm.controls.end.hasError('invalidDate')) {\n <mat-error>Invalid date or expression</mat-error>\n } @else if (editableForm.hasError('rangeOrder')) {\n <mat-error>Start must be before end</mat-error>\n }\n </mat-form-field>\n </form>\n } @else {\n <span id=\"range-label-text\" class=\"ndp-range-label-text\">\n {{ calendar?.selectedDates?.start | date: dateFormat }} @if\n (calendar?.selectedDates?.end) {\n <span> - {{ calendar.selectedDates?.end | date: dateFormat }} </span>\n }\n </span>\n }\n <div class=\"buttons\">\n <acp-button\n type=\"button\"\n variant=\"danger\"\n matStyle=\"filled\"\n (handleClick)=\"isCustomRange = false\"\n >Cancelar</acp-button\n >\n <acp-button\n type=\"button\"\n variant=\"primary\"\n matStyle=\"filled\"\n [class.disabled]=\"\n enableEditableDates\n ? editableForm.invalid\n : !(calendar?.selectedDates?.start && calendar?.selectedDates?.end)\n \"\n (handleClick)=\"\n enableEditableDates && commitEditableDates(calendar);\n updateCustomRange(dateInput, calendar.selectedDates)\n \"\n >\n Aplicar \n </acp-button>\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n</div>\n\n<ng-template\n #dateOptionList\n let-options\n let-input=\"dateInput\"\n let-optionId=\"optionId\"\n let-className=\"className\"\n>\n <mat-action-list [ngClass]=\"className\" [id]=\"optionId\">\n @for (option of options; track option.optionLabel) {\n <mat-list-item [activated]=\"option.isSelected\" (click)=\"updateSelection(option, input)\">\n {{ option.optionLabel }}\n </mat-list-item>\n }\n </mat-action-list>\n</ng-template>\n", styles: ["::ng-deep .cdk-overlay-dark-backdrop{background:none}mat-list-item.mat-mdc-list-item{height:40px}mat-list-item.mdc-list-item--activated{background-color:var(--ndp-selected-option-bg, var(--mat-sys-secondary-container, rgba(0, 0, 0, .08)))}::ng-deep .cdk-overlay-pane:has(.custom-ckd-container),::ng-deep .cdk-overlay-pane:has(.ndp-cdk-container){width:100%;background-color:var(--mat-sys-surface-container);max-height:100vh;overflow-y:auto;overflow-x:hidden;max-width:700px;margin-top:-22px;border:1px solid var(--mat-sys-surface-container)}::ng-deep .cdk-overlay-pane:has(.range-input){max-width:250px}.br-top{border-top:1px solid var(--mat-sys-surface-container)}.br-right{border-right:1px solid var(--mat-sys-surface-container)}.disabled{pointer-events:none;opacity:.5}.mat-button,.mdc-button{font-family:var(--mat-list-list-item-label-text-font);line-height:var(--mat-list-list-item-label-text-line-height);font-size:var(--mat-list-list-item-label-text-size);font-weight:var(--mat-list-list-item-label-text-weight);letter-spacing:var(--mat-list-list-item-label-text-tracking)}.w-full{width:100%}.display-hidden{display:none}.custom-calendar-container,.ndp-calendar-container{width:100%}.row-1,.row-2{width:100%;box-sizing:border-box}.row-1{display:flex;align-items:stretch}.row-2{padding:16px}.ndp-column-separator{flex:0 0 1px;background-color:var(--mat-sys-surface-container)}.footer-content,.ndp-footer-content{align-items:center;display:flex;text-align:right;justify-content:end;gap:16px;text-overflow:ellipsis}.footer-content .buttons,.ndp-footer-content .buttons{display:flex;gap:8px}.ndp-date-inputs{display:flex;gap:8px;margin-right:auto;align-items:flex-start}.ndp-date-field{width:150px}.column-1{flex:0 0 25%;overflow:auto}.column-2{flex:1 1 auto;min-width:0}.without-default-opt .column-1{display:none}@media(max-width:400px){.footer-content,.ndp-footer-content{display:block}.footer-content .buttons,.ndp-footer-content .buttons{justify-content:flex-end;margin-top:20px}#range-label-text{margin-right:1.5rem}}@media(max-width:650px){.row-1{flex-direction:column}.column-1{flex-basis:auto}.column-separator{display:none}}.pe-0{padding-right:0}.ps-0{padding-left:0}button.checked{color:var(--mat-sys-primary);border-radius:4px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "ngmodule", type: MatNativeDateModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { 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.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i3.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i3.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i6.MatActionList, selector: "mat-action-list", exportAs: ["matActionList"] }, { kind: "component", type: i6.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: AcpDateRangeCalendar, selector: "acp-date-range-calendar", inputs: ["minDate", "maxDate", "selectedDates"], outputs: ["selectedDatesChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Button, selector: "acp-button", inputs: ["variant", "text", "icon", "disabled", "type", "matStyle", "customClass", "reportFormat", "extended", "title", "ariaLabel", "name", "id", "form", "tabIndex", "testId"], outputs: ["handleClick"] }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8499
7752
|
}
|
|
8500
7753
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AcpDateRangeInput, decorators: [{
|
|
8501
7754
|
type: Component,
|
|
@@ -8837,6 +8090,232 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
8837
8090
|
args: [{ transform: booleanAttribute }]
|
|
8838
8091
|
}], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }] } });
|
|
8839
8092
|
|
|
8093
|
+
const KPI_CARD_TREND_CONFIGS = {
|
|
8094
|
+
up: {
|
|
8095
|
+
icon: 'trending_up',
|
|
8096
|
+
color: 'success',
|
|
8097
|
+
ariaLabel: 'Trending up',
|
|
8098
|
+
},
|
|
8099
|
+
down: {
|
|
8100
|
+
icon: 'trending_down',
|
|
8101
|
+
color: 'error',
|
|
8102
|
+
ariaLabel: 'Trending down',
|
|
8103
|
+
},
|
|
8104
|
+
neutral: {
|
|
8105
|
+
icon: 'trending_flat',
|
|
8106
|
+
color: 'info',
|
|
8107
|
+
ariaLabel: 'Neutral trend',
|
|
8108
|
+
},
|
|
8109
|
+
none: {
|
|
8110
|
+
icon: '',
|
|
8111
|
+
color: 'neutral',
|
|
8112
|
+
ariaLabel: '',
|
|
8113
|
+
},
|
|
8114
|
+
};
|
|
8115
|
+
function formatValue(value, format) {
|
|
8116
|
+
if (typeof value === 'string')
|
|
8117
|
+
return value;
|
|
8118
|
+
if (!format)
|
|
8119
|
+
return value.toString();
|
|
8120
|
+
switch (format) {
|
|
8121
|
+
case 'currency':
|
|
8122
|
+
return new Intl.NumberFormat('en-US', {
|
|
8123
|
+
style: 'currency',
|
|
8124
|
+
currency: 'USD',
|
|
8125
|
+
minimumFractionDigits: 0,
|
|
8126
|
+
maximumFractionDigits: 0,
|
|
8127
|
+
}).format(value);
|
|
8128
|
+
case 'percent':
|
|
8129
|
+
return `${value.toFixed(1)}%`;
|
|
8130
|
+
case 'number':
|
|
8131
|
+
return new Intl.NumberFormat('en-US').format(value);
|
|
8132
|
+
case 'decimal':
|
|
8133
|
+
return value.toFixed(2);
|
|
8134
|
+
default:
|
|
8135
|
+
return value.toString();
|
|
8136
|
+
}
|
|
8137
|
+
}
|
|
8138
|
+
|
|
8139
|
+
class AcpKpiCard {
|
|
8140
|
+
// Content
|
|
8141
|
+
title = input(/* @ts-ignore */
|
|
8142
|
+
...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
|
|
8143
|
+
subtitle = input(/* @ts-ignore */
|
|
8144
|
+
...(ngDevMode ? [undefined, { debugName: "subtitle" }] : /* istanbul ignore next */ []));
|
|
8145
|
+
value = input(/* @ts-ignore */
|
|
8146
|
+
...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
|
|
8147
|
+
description = input(/* @ts-ignore */
|
|
8148
|
+
...(ngDevMode ? [undefined, { debugName: "description" }] : /* istanbul ignore next */ []));
|
|
8149
|
+
footer = input(/* @ts-ignore */
|
|
8150
|
+
...(ngDevMode ? [undefined, { debugName: "footer" }] : /* istanbul ignore next */ []));
|
|
8151
|
+
// Styling
|
|
8152
|
+
variant = input('default', /* @ts-ignore */
|
|
8153
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
8154
|
+
color = input('primary', /* @ts-ignore */
|
|
8155
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
8156
|
+
size = input('md', /* @ts-ignore */
|
|
8157
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
8158
|
+
// Icons & Avatar
|
|
8159
|
+
icon = input(/* @ts-ignore */
|
|
8160
|
+
...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
8161
|
+
svgIcon = input(/* @ts-ignore */
|
|
8162
|
+
...(ngDevMode ? [undefined, { debugName: "svgIcon" }] : /* istanbul ignore next */ []));
|
|
8163
|
+
avatar = input(/* @ts-ignore */
|
|
8164
|
+
...(ngDevMode ? [undefined, { debugName: "avatar" }] : /* istanbul ignore next */ []));
|
|
8165
|
+
avatarInitials = input(/* @ts-ignore */
|
|
8166
|
+
...(ngDevMode ? [undefined, { debugName: "avatarInitials" }] : /* istanbul ignore next */ []));
|
|
8167
|
+
// Trend & Metrics
|
|
8168
|
+
trend = input('none', /* @ts-ignore */
|
|
8169
|
+
...(ngDevMode ? [{ debugName: "trend" }] : /* istanbul ignore next */ []));
|
|
8170
|
+
percentage = input(/* @ts-ignore */
|
|
8171
|
+
...(ngDevMode ? [undefined, { debugName: "percentage" }] : /* istanbul ignore next */ []));
|
|
8172
|
+
percentageFormat = input('percent', /* @ts-ignore */
|
|
8173
|
+
...(ngDevMode ? [{ debugName: "percentageFormat" }] : /* istanbul ignore next */ []));
|
|
8174
|
+
// Progress
|
|
8175
|
+
progress = input(/* @ts-ignore */
|
|
8176
|
+
...(ngDevMode ? [undefined, { debugName: "progress" }] : /* istanbul ignore next */ []));
|
|
8177
|
+
progressColor = input('primary', /* @ts-ignore */
|
|
8178
|
+
...(ngDevMode ? [{ debugName: "progressColor" }] : /* istanbul ignore next */ []));
|
|
8179
|
+
// States
|
|
8180
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8181
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8182
|
+
clickable = input(false, { ...(ngDevMode ? { debugName: "clickable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8183
|
+
selected = input(false, { ...(ngDevMode ? { debugName: "selected" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8184
|
+
// Navigation
|
|
8185
|
+
routerLink = input(null, /* @ts-ignore */
|
|
8186
|
+
...(ngDevMode ? [{ debugName: "routerLink" }] : /* istanbul ignore next */ []));
|
|
8187
|
+
href = input(null, /* @ts-ignore */
|
|
8188
|
+
...(ngDevMode ? [{ debugName: "href" }] : /* istanbul ignore next */ []));
|
|
8189
|
+
// Aria
|
|
8190
|
+
ariaLabel = input(/* @ts-ignore */
|
|
8191
|
+
...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
8192
|
+
// Tooltip
|
|
8193
|
+
tooltip = input(/* @ts-ignore */
|
|
8194
|
+
...(ngDevMode ? [undefined, { debugName: "tooltip" }] : /* istanbul ignore next */ []));
|
|
8195
|
+
// Outputs
|
|
8196
|
+
clicked = output();
|
|
8197
|
+
actionClicked = output();
|
|
8198
|
+
// Internal state for hover
|
|
8199
|
+
isHovered = signal(false, /* @ts-ignore */
|
|
8200
|
+
...(ngDevMode ? [{ debugName: "isHovered" }] : /* istanbul ignore next */ []));
|
|
8201
|
+
// Content children
|
|
8202
|
+
iconTemplate = contentChild('icon', { ...(ngDevMode ? { debugName: "iconTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
8203
|
+
avatarTemplate = contentChild('avatar', { ...(ngDevMode ? { debugName: "avatarTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
8204
|
+
footerTemplate = contentChild('footer', { ...(ngDevMode ? { debugName: "footerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
8205
|
+
actionsTemplate = contentChild('actions', { ...(ngDevMode ? { debugName: "actionsTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
8206
|
+
// Computed properties
|
|
8207
|
+
isTrending = computed(() => this.trend() !== 'none', /* @ts-ignore */
|
|
8208
|
+
...(ngDevMode ? [{ debugName: "isTrending" }] : /* istanbul ignore next */ []));
|
|
8209
|
+
trendConfig = computed(() => KPI_CARD_TREND_CONFIGS[this.trend()], /* @ts-ignore */
|
|
8210
|
+
...(ngDevMode ? [{ debugName: "trendConfig" }] : /* istanbul ignore next */ []));
|
|
8211
|
+
// Effective icon shows trend icon if trending, otherwise shows provided icon
|
|
8212
|
+
effectiveIcon = computed(() => {
|
|
8213
|
+
if (this.isTrending())
|
|
8214
|
+
return this.trendConfig().icon;
|
|
8215
|
+
return this.icon();
|
|
8216
|
+
}, /* @ts-ignore */
|
|
8217
|
+
...(ngDevMode ? [{ debugName: "effectiveIcon" }] : /* istanbul ignore next */ []));
|
|
8218
|
+
// Trend color is only for the trend indicator (icon and percentage)
|
|
8219
|
+
trendColor = computed(() => {
|
|
8220
|
+
if (this.isTrending())
|
|
8221
|
+
return this.trendConfig().color;
|
|
8222
|
+
return this.color();
|
|
8223
|
+
}, /* @ts-ignore */
|
|
8224
|
+
...(ngDevMode ? [{ debugName: "trendColor" }] : /* istanbul ignore next */ []));
|
|
8225
|
+
hasHeader = computed(() => !!(this.title() || this.subtitle() || this.icon() || this.avatar()), /* @ts-ignore */
|
|
8226
|
+
...(ngDevMode ? [{ debugName: "hasHeader" }] : /* istanbul ignore next */ []));
|
|
8227
|
+
hasFooter = computed(() => !!(this.footer() || this.footerTemplate() || this.progress() !== undefined), /* @ts-ignore */
|
|
8228
|
+
...(ngDevMode ? [{ debugName: "hasFooter" }] : /* istanbul ignore next */ []));
|
|
8229
|
+
hasActions = computed(() => !!this.actionsTemplate(), /* @ts-ignore */
|
|
8230
|
+
...(ngDevMode ? [{ debugName: "hasActions" }] : /* istanbul ignore next */ []));
|
|
8231
|
+
hostClasses = computed(() => {
|
|
8232
|
+
const classes = [
|
|
8233
|
+
'acp-kpi-card',
|
|
8234
|
+
`acp-kpi-card--${this.variant()}`,
|
|
8235
|
+
`acp-kpi-card--${this.color()}`,
|
|
8236
|
+
`acp-kpi-card--${this.size()}`,
|
|
8237
|
+
];
|
|
8238
|
+
if (this.clickable())
|
|
8239
|
+
classes.push('acp-kpi-card--clickable');
|
|
8240
|
+
if (this.disabled())
|
|
8241
|
+
classes.push('acp-kpi-card--disabled');
|
|
8242
|
+
if (this.loading())
|
|
8243
|
+
classes.push('acp-kpi-card--loading');
|
|
8244
|
+
if (this.selected())
|
|
8245
|
+
classes.push('acp-kpi-card--selected');
|
|
8246
|
+
return classes.join(' ');
|
|
8247
|
+
}, /* @ts-ignore */
|
|
8248
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
8249
|
+
onCardClick() {
|
|
8250
|
+
if (!this.disabled() && this.clickable()) {
|
|
8251
|
+
this.clicked.emit();
|
|
8252
|
+
}
|
|
8253
|
+
}
|
|
8254
|
+
onActionClick(action, event) {
|
|
8255
|
+
event.stopPropagation();
|
|
8256
|
+
this.actionClicked.emit(action);
|
|
8257
|
+
}
|
|
8258
|
+
onMouseEnter() {
|
|
8259
|
+
if (this.clickable()) {
|
|
8260
|
+
this.isHovered.set(true);
|
|
8261
|
+
}
|
|
8262
|
+
}
|
|
8263
|
+
onMouseLeave() {
|
|
8264
|
+
this.isHovered.set(false);
|
|
8265
|
+
}
|
|
8266
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AcpKpiCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8267
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: AcpKpiCard, isStandalone: true, selector: "acp-kpi-card", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, footer: { classPropertyName: "footer", publicName: "footer", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, svgIcon: { classPropertyName: "svgIcon", publicName: "svgIcon", isSignal: true, isRequired: false, transformFunction: null }, avatar: { classPropertyName: "avatar", publicName: "avatar", isSignal: true, isRequired: false, transformFunction: null }, avatarInitials: { classPropertyName: "avatarInitials", publicName: "avatarInitials", isSignal: true, isRequired: false, transformFunction: null }, trend: { classPropertyName: "trend", publicName: "trend", isSignal: true, isRequired: false, transformFunction: null }, percentage: { classPropertyName: "percentage", publicName: "percentage", isSignal: true, isRequired: false, transformFunction: null }, percentageFormat: { classPropertyName: "percentageFormat", publicName: "percentageFormat", isSignal: true, isRequired: false, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null }, progressColor: { classPropertyName: "progressColor", publicName: "progressColor", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked", actionClicked: "actionClicked" }, host: { properties: { "class": "hostClasses()" } }, queries: [{ propertyName: "iconTemplate", first: true, predicate: ["icon"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "avatarTemplate", first: true, predicate: ["avatar"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "actionsTemplate", first: true, predicate: ["actions"], descendants: true, read: TemplateRef, isSignal: true }], exportAs: ["acpKpiCard"], ngImport: i0, template: "<mat-card\n class=\"acp-kpi-card__card\"\n [routerLink]=\"routerLink()\"\n [attr.aria-label]=\"ariaLabel()\"\n [matTooltip]=\"tooltip()\"\n [matTooltipDisabled]=\"!tooltip()\"\n (click)=\"onCardClick()\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n>\n <!-- Loading Skeleton -->\n @if (loading()) {\n <div class=\"acp-kpi-card__skeleton\">\n <div class=\"acp-kpi-card__skeleton-header\"></div>\n <div class=\"acp-kpi-card__skeleton-value\"></div>\n <div class=\"acp-kpi-card__skeleton-text\"></div>\n </div>\n } @else {\n <!-- Header -->\n @if (hasHeader()) {\n <mat-card-header class=\"acp-kpi-card__header\">\n <div class=\"acp-kpi-card__header-content\">\n <!-- Icon or Avatar -->\n <div class=\"acp-kpi-card__icon-container\">\n @if (iconTemplate()) {\n <ng-container [ngTemplateOutlet]=\"iconTemplate()!\"></ng-container>\n } @else if (svgIcon()) {\n <mat-icon class=\"acp-kpi-card__icon\" [svgIcon]=\"svgIcon()!\" aria-hidden=\"true\"></mat-icon>\n } @else if (effectiveIcon()) {\n <mat-icon class=\"acp-kpi-card__icon\" aria-hidden=\"true\">{{ effectiveIcon() }}</mat-icon>\n } @else if (avatarTemplate()) {\n <div class=\"acp-kpi-card__avatar\">\n <ng-container [ngTemplateOutlet]=\"avatarTemplate()!\"></ng-container>\n </div>\n } @else if (avatar()) {\n <img class=\"acp-kpi-card__avatar-image\" [src]=\"avatar()\" [alt]=\"title() || 'Avatar'\" />\n } @else if (avatarInitials()) {\n <div class=\"acp-kpi-card__avatar-initials\">{{ avatarInitials() }}</div>\n }\n </div>\n\n <!-- Title & Subtitle -->\n <div class=\"acp-kpi-card__title-container\">\n @if (title()) {\n <h3 class=\"acp-kpi-card__title\">{{ title() }}</h3>\n } @if (subtitle()) {\n <p class=\"acp-kpi-card__subtitle\">{{ subtitle() }}</p>\n }\n </div>\n </div>\n\n <!-- Menu Button (optional) - Only show if actions template exists -->\n @if (hasActions()) {\n <button\n mat-icon-button\n [matMenuTriggerFor]=\"menu\"\n class=\"acp-kpi-card__menu-button\"\n aria-label=\"More options\"\n >\n <mat-icon>more_vert</mat-icon>\n </button>\n <mat-menu #menu=\"matMenu\" class=\"acp-kpi-card__menu\">\n <ng-container [ngTemplateOutlet]=\"actionsTemplate()!\"></ng-container>\n </mat-menu>\n }\n </mat-card-header>\n }\n\n <!-- Content -->\n <mat-card-content class=\"acp-kpi-card__content\">\n <!-- Main Value -->\n @if (value()) {\n <div class=\"acp-kpi-card__value-section\">\n <div class=\"acp-kpi-card__value\">{{ value() }}</div>\n\n <!-- Percentage & Trend -->\n @if (percentage() !== undefined) {\n <div class=\"acp-kpi-card__metric\">\n @if (isTrending()) {\n <mat-icon class=\"acp-kpi-card__trend-icon\" [attr.aria-label]=\"trendConfig().ariaLabel\">\n {{ trendConfig().icon }}\n </mat-icon>\n }\n <span class=\"acp-kpi-card__percentage\">\n {{ percentageFormat() === 'percent' ? (percentage() + '%') : percentage() }}\n </span>\n </div>\n }\n </div>\n }\n\n <!-- Description -->\n @if (description()) {\n <p class=\"acp-kpi-card__description\">{{ description() }}</p>\n }\n\n <!-- Progress Bar -->\n @if (progress() !== undefined) {\n <mat-progress-bar\n class=\"acp-kpi-card__progress\"\n mode=\"determinate\"\n [value]=\"progress()\"\n [color]=\"progressColor()\"\n ></mat-progress-bar>\n }\n </mat-card-content>\n\n <!-- Footer -->\n @if (hasFooter()) {\n <mat-divider></mat-divider>\n <div class=\"acp-kpi-card__footer\">\n @if (footerTemplate()) {\n <ng-container [ngTemplateOutlet]=\"footerTemplate()!\"></ng-container>\n } @else if (footer()) {\n <p class=\"acp-kpi-card__footer-text\">{{ footer() }}</p>\n }\n </div>\n } }\n</mat-card>\n", styles: [".acp-kpi-card{--acp-kpi-card-bg: var(--acp-kpi-card-primary-bg, var(--mat-sys-primary));--acp-kpi-card-fg: var(--acp-kpi-card-primary-color, var(--mat-sys-on-primary));display:flex;vertical-align:middle;width:100%;max-width:100%}.acp-kpi-card__card{width:100%;display:flex;flex-direction:column;border-radius:12px;transition:all .3s cubic-bezier(.4,0,.2,1);overflow:hidden;background-color:#fff}.acp-kpi-card__header{display:flex;align-items:center;justify-content:space-between;padding:16px;gap:12px}.acp-kpi-card__header-content{display:flex;align-items:center;gap:12px;flex:1;min-width:0}.acp-kpi-card__icon-container{display:flex;align-items:center;justify-content:center;flex-shrink:0}.acp-kpi-card__icon{font-size:24px;width:24px;height:24px;color:var(--acp-kpi-card-fg)}.acp-kpi-card__avatar{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--acp-kpi-card-bg) 30%,transparent);color:var(--acp-kpi-card-fg);font-weight:500;font-size:14px;flex-shrink:0}.acp-kpi-card__avatar-image{width:40px;height:40px;border-radius:50%;object-fit:cover;flex-shrink:0}.acp-kpi-card__avatar-initials{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--acp-kpi-card-bg) 30%,transparent);color:var(--acp-kpi-card-fg);font-weight:500;font-size:14px;flex-shrink:0}.acp-kpi-card__title-container{flex:1;min-width:0}.acp-kpi-card__title{margin:0;font-size:14px;font-weight:500;letter-spacing:.25px;color:var(--acp-kpi-card-fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.acp-kpi-card__subtitle{margin:2px 0 0;font-size:12px;font-weight:400;letter-spacing:.4px;color:rgba(var(--acp-kpi-card-fg),.6);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.acp-kpi-card__menu-button{flex-shrink:0;opacity:.7;transition:opacity .2s ease-in-out}.acp-kpi-card__menu-button:hover{opacity:1}.acp-kpi-card__menu-button:focus-visible{outline:2px solid currentColor;outline-offset:2px}.acp-kpi-card__menu{will-change:transform}.acp-kpi-card__content{flex:1;padding:16px;display:flex;flex-direction:column;gap:12px}.acp-kpi-card__value-section{display:flex;align-items:baseline;gap:8px}.acp-kpi-card__value{font-size:28px;font-weight:600;letter-spacing:-.5px;color:var(--acp-kpi-card-fg);line-height:1.2}.acp-kpi-card__metric{display:flex;align-items:center;gap:4px;font-size:13px;font-weight:500;letter-spacing:.25px;color:rgba(var(--acp-kpi-card-fg),.8)}.acp-kpi-card__trend-icon{font-size:16px;width:16px;height:16px}.acp-kpi-card__percentage{white-space:nowrap}.acp-kpi-card.acp-kpi-card--success .acp-kpi-card__metric{color:var(--acp-kpi-card-success-color, light-dark(#ffffff, #013a00))}.acp-kpi-card.acp-kpi-card--success-light .acp-kpi-card__metric{color:var(--acp-kpi-card-success-light-color, var(--mat-sys-on-surface))}.acp-kpi-card.acp-kpi-card--warning .acp-kpi-card__metric{color:var(--acp-kpi-card-warning-color, light-dark(#ffffff, #502400))}.acp-kpi-card.acp-kpi-card--warning-light .acp-kpi-card__metric{color:var(--acp-kpi-card-warning-light-color, var(--mat-sys-on-surface))}.acp-kpi-card.acp-kpi-card--error .acp-kpi-card__metric{color:var(--acp-kpi-card-error-color, var(--mat-sys-on-error))}.acp-kpi-card.acp-kpi-card--error-light .acp-kpi-card__metric{color:var(--acp-kpi-card-error-light-color, var(--mat-sys-on-surface))}.acp-kpi-card.acp-kpi-card--info .acp-kpi-card__metric{color:var(--acp-kpi-card-info-color, light-dark(#ffffff, #002f65))}.acp-kpi-card.acp-kpi-card--info-light .acp-kpi-card__metric{color:var(--acp-kpi-card-info-light-color, var(--mat-sys-on-surface))}.acp-kpi-card__description{margin:0;font-size:12px;font-weight:400;letter-spacing:.4px;color:rgba(var(--acp-kpi-card-fg),.6);line-height:1.5}.acp-kpi-card__progress{height:4px;border-radius:2px;background-color:rgba(var(--acp-kpi-card-fg),.12)}.acp-kpi-card__footer{padding:12px 16px;font-size:12px;font-weight:400;letter-spacing:.4px;color:rgba(var(--acp-kpi-card-fg),.6)}.acp-kpi-card__footer-text{margin:0}.acp-kpi-card__skeleton{padding:16px;display:flex;flex-direction:column;gap:12px}.acp-kpi-card__skeleton-header{width:60%;height:16px;background:linear-gradient(90deg,#0000001a 25%,#0000000d,#0000001a 75%);background-size:200% 100%;animation:loading 1.5s infinite;border-radius:4px}.acp-kpi-card__skeleton-value{width:40%;height:28px;background:linear-gradient(90deg,#0000001a 25%,#0000000d,#0000001a 75%);background-size:200% 100%;animation:loading 1.5s infinite;border-radius:4px}.acp-kpi-card__skeleton-text{width:80%;height:12px;background:linear-gradient(90deg,#0000001a 25%,#0000000d,#0000001a 75%);background-size:200% 100%;animation:loading 1.5s infinite;border-radius:4px}@keyframes loading{0%{background-position:200% 0}to{background-position:-200% 0}}.acp-kpi-card.acp-kpi-card--primary{--acp-kpi-card-bg: var(--acp-kpi-card-primary-bg, var(--mat-sys-primary));--acp-kpi-card-fg: var(--acp-kpi-card-primary-color, var(--mat-sys-on-primary))}.acp-kpi-card.acp-kpi-card--secondary{--acp-kpi-card-bg: var(--acp-kpi-card-secondary-bg, var(--mat-sys-secondary));--acp-kpi-card-fg: var(--acp-kpi-card-secondary-color, var(--mat-sys-on-secondary))}.acp-kpi-card.acp-kpi-card--success{--acp-kpi-card-bg: var(--acp-kpi-card-success-bg, light-dark(#038b00, #03c700));--acp-kpi-card-fg: var(--acp-kpi-card-success-color, light-dark(#ffffff, #013a00))}.acp-kpi-card.acp-kpi-card--success-light{--acp-kpi-card-bg: var(--acp-kpi-card-success-light-bg, light-dark(#cbffb8, #014600));--acp-kpi-card-fg: var(--acp-kpi-card-success-light-color, var(--mat-sys-on-surface))}.acp-kpi-card.acp-kpi-card--warning{--acp-kpi-card-bg: var(--acp-kpi-card-warning-bg, light-dark(#e37100, #ffb787));--acp-kpi-card-fg: var(--acp-kpi-card-warning-color, light-dark(#ffffff, #502400))}.acp-kpi-card.acp-kpi-card--warning-light{--acp-kpi-card-bg: var(--acp-kpi-card-warning-light-bg, light-dark(#ffede4, #612d00));--acp-kpi-card-fg: var(--acp-kpi-card-warning-light-color, var(--mat-sys-on-surface))}.acp-kpi-card.acp-kpi-card--error{--acp-kpi-card-bg: var(--acp-kpi-card-error-bg, var(--mat-sys-error));--acp-kpi-card-fg: var(--acp-kpi-card-error-color, var(--mat-sys-on-error))}.acp-kpi-card.acp-kpi-card--error-light{--acp-kpi-card-bg: var(--acp-kpi-card-error-light-bg, light-dark(#ffedea, #7e0100));--acp-kpi-card-fg: var(--acp-kpi-card-error-light-color, var(--mat-sys-on-surface))}.acp-kpi-card.acp-kpi-card--info{--acp-kpi-card-bg: var(--acp-kpi-card-info-bg, light-dark(#0074e9, #7cabff));--acp-kpi-card-fg: var(--acp-kpi-card-info-color, light-dark(#ffffff, #002f65))}.acp-kpi-card.acp-kpi-card--info-light{--acp-kpi-card-bg: var(--acp-kpi-card-info-light-bg, light-dark(#ecf0ff, #003a7a));--acp-kpi-card-fg: var(--acp-kpi-card-info-light-color, var(--mat-sys-on-surface))}.acp-kpi-card.acp-kpi-card--neutral{--acp-kpi-card-bg: var(--acp-kpi-card-neutral-bg, var(--mat-sys-surface-variant));--acp-kpi-card-fg: var(--acp-kpi-card-neutral-color, var(--mat-sys-on-surface-variant))}.acp-kpi-card.acp-kpi-card--white{--acp-kpi-card-bg: #ffffff;--acp-kpi-card-fg: #1f2937}.acp-kpi-card.acp-kpi-card--custom{--acp-kpi-card-bg: var( --acp-kpi-card-custom-bg, var(--acp-kpi-card-custom-bg, var(--mat-sys-surface-container)) );--acp-kpi-card-fg: var( --acp-kpi-card-custom-fg, var(--acp-kpi-card-custom-color, var(--mat-sys-on-surface)) )}.acp-kpi-card.acp-kpi-card--default .acp-kpi-card__card{background:var(--acp-kpi-card-bg);color:var(--acp-kpi-card-fg);border:1px solid rgba(var(--acp-kpi-card-fg),.12)}.acp-kpi-card.acp-kpi-card--elevated .acp-kpi-card__card{background:var(--acp-kpi-card-bg);color:var(--acp-kpi-card-fg);box-shadow:0 3px 8px #00000014,0 1px 3px #0000000a}.acp-kpi-card.acp-kpi-card--outlined .acp-kpi-card__card{background:transparent;color:var(--acp-kpi-card-fg);border:2px solid rgba(var(--acp-kpi-card-fg),.2)}.acp-kpi-card.acp-kpi-card--filled .acp-kpi-card__card{background:var(--acp-kpi-card-bg);color:var(--acp-kpi-card-fg)}.acp-kpi-card.acp-kpi-card--tonal .acp-kpi-card__card{background:color-mix(in srgb,var(--acp-kpi-card-bg) 12%,transparent);color:var(--acp-kpi-card-fg);border:1px solid rgba(var(--acp-kpi-card-fg),.08)}.acp-kpi-card.acp-kpi-card--clickable .acp-kpi-card__card{cursor:pointer}.acp-kpi-card.acp-kpi-card--clickable .acp-kpi-card__card:hover{box-shadow:0 6px 12px #0000001a,0 2px 4px #0000000f;transform:translateY(-1px)}.acp-kpi-card.acp-kpi-card--clickable .acp-kpi-card__card:active{transform:translateY(0);box-shadow:0 2px 4px #00000014}.acp-kpi-card.acp-kpi-card--clickable .acp-kpi-card__card:focus-visible{outline:2px solid currentColor;outline-offset:2px}.acp-kpi-card.acp-kpi-card--disabled .acp-kpi-card__card{opacity:.6;cursor:not-allowed;pointer-events:none}.acp-kpi-card.acp-kpi-card--selected .acp-kpi-card__card{border:2px solid var(--acp-kpi-card-fg)}.acp-kpi-card.acp-kpi-card--loading .acp-kpi-card__card{pointer-events:none;opacity:.8}@media(max-width:768px){.acp-kpi-card__header,.acp-kpi-card__content{padding:12px}.acp-kpi-card__value{font-size:24px}.acp-kpi-card__title{font-size:13px}}@media(prefers-reduced-motion:reduce){.acp-kpi-card__card{transition:none}.acp-kpi-card__skeleton-header,.acp-kpi-card__skeleton-value,.acp-kpi-card__skeleton-text{animation:none}}@media(prefers-contrast:more){.acp-kpi-card__card{border-width:2px}}@media(max-width:768px){.acp-kpi-card__header,.acp-kpi-card__content{padding:12px;gap:8px}.acp-kpi-card__footer{padding:12px}.acp-kpi-card__icon{font-size:20px;width:20px;height:20px}.acp-kpi-card__avatar,.acp-kpi-card__avatar-image,.acp-kpi-card__avatar-initials{width:32px;height:32px;font-size:12px}.acp-kpi-card__title{font-size:13px}.acp-kpi-card__subtitle{font-size:11px}.acp-kpi-card__value{font-size:24px}}.acp-kpi-card__card.acp-kpi-card--xs{min-height:96px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__header,.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__content{padding:8px;gap:6px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__footer{padding:8px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__icon{font-size:16px;width:16px;height:16px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__avatar,.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__avatar-image,.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__avatar-initials{width:28px;height:28px;font-size:11px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__title{font-size:12px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__subtitle{font-size:10px;margin-top:1px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__value{font-size:18px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__percentage{font-size:10px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__description{font-size:11px}.acp-kpi-card__card.acp-kpi-card--sm{min-height:128px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__header,.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__content{padding:12px;gap:8px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__footer{padding:12px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__icon{font-size:20px;width:20px;height:20px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__avatar,.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__avatar-image,.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__avatar-initials{width:32px;height:32px;font-size:12px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__title{font-size:13px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__subtitle{font-size:11px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__value{font-size:22px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__percentage{font-size:11px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__description{font-size:12px}.acp-kpi-card__card.acp-kpi-card--md{min-height:160px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__header,.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__content{padding:16px;gap:12px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__footer{padding:16px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__icon{font-size:24px;width:24px;height:24px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__avatar,.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__avatar-image,.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__avatar-initials{width:40px;height:40px;font-size:14px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__title{font-size:14px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__subtitle{font-size:12px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__value{font-size:28px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__percentage{font-size:12px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__description{font-size:13px}.acp-kpi-card__card.acp-kpi-card--lg{min-height:224px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__header,.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__content{padding:20px;gap:16px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__footer{padding:20px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__icon{font-size:32px;width:32px;height:32px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__avatar,.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__avatar-image,.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__avatar-initials{width:48px;height:48px;font-size:16px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__title{font-size:16px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__subtitle{font-size:13px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__value{font-size:36px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__percentage,.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__description{font-size:14px}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i3$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i3$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i4.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i6.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
8268
|
+
}
|
|
8269
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AcpKpiCard, decorators: [{
|
|
8270
|
+
type: Component,
|
|
8271
|
+
args: [{ selector: 'acp-kpi-card', exportAs: 'acpKpiCard', standalone: true, imports: [
|
|
8272
|
+
NgTemplateOutlet,
|
|
8273
|
+
RouterLink,
|
|
8274
|
+
MatCard,
|
|
8275
|
+
MatCardHeader,
|
|
8276
|
+
MatCardContent,
|
|
8277
|
+
MatIconModule,
|
|
8278
|
+
MatButtonModule,
|
|
8279
|
+
MatMenuModule,
|
|
8280
|
+
MatProgressBarModule,
|
|
8281
|
+
MatDividerModule,
|
|
8282
|
+
MatTooltipModule,
|
|
8283
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
8284
|
+
'[class]': 'hostClasses()',
|
|
8285
|
+
}, template: "<mat-card\n class=\"acp-kpi-card__card\"\n [routerLink]=\"routerLink()\"\n [attr.aria-label]=\"ariaLabel()\"\n [matTooltip]=\"tooltip()\"\n [matTooltipDisabled]=\"!tooltip()\"\n (click)=\"onCardClick()\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n>\n <!-- Loading Skeleton -->\n @if (loading()) {\n <div class=\"acp-kpi-card__skeleton\">\n <div class=\"acp-kpi-card__skeleton-header\"></div>\n <div class=\"acp-kpi-card__skeleton-value\"></div>\n <div class=\"acp-kpi-card__skeleton-text\"></div>\n </div>\n } @else {\n <!-- Header -->\n @if (hasHeader()) {\n <mat-card-header class=\"acp-kpi-card__header\">\n <div class=\"acp-kpi-card__header-content\">\n <!-- Icon or Avatar -->\n <div class=\"acp-kpi-card__icon-container\">\n @if (iconTemplate()) {\n <ng-container [ngTemplateOutlet]=\"iconTemplate()!\"></ng-container>\n } @else if (svgIcon()) {\n <mat-icon class=\"acp-kpi-card__icon\" [svgIcon]=\"svgIcon()!\" aria-hidden=\"true\"></mat-icon>\n } @else if (effectiveIcon()) {\n <mat-icon class=\"acp-kpi-card__icon\" aria-hidden=\"true\">{{ effectiveIcon() }}</mat-icon>\n } @else if (avatarTemplate()) {\n <div class=\"acp-kpi-card__avatar\">\n <ng-container [ngTemplateOutlet]=\"avatarTemplate()!\"></ng-container>\n </div>\n } @else if (avatar()) {\n <img class=\"acp-kpi-card__avatar-image\" [src]=\"avatar()\" [alt]=\"title() || 'Avatar'\" />\n } @else if (avatarInitials()) {\n <div class=\"acp-kpi-card__avatar-initials\">{{ avatarInitials() }}</div>\n }\n </div>\n\n <!-- Title & Subtitle -->\n <div class=\"acp-kpi-card__title-container\">\n @if (title()) {\n <h3 class=\"acp-kpi-card__title\">{{ title() }}</h3>\n } @if (subtitle()) {\n <p class=\"acp-kpi-card__subtitle\">{{ subtitle() }}</p>\n }\n </div>\n </div>\n\n <!-- Menu Button (optional) - Only show if actions template exists -->\n @if (hasActions()) {\n <button\n mat-icon-button\n [matMenuTriggerFor]=\"menu\"\n class=\"acp-kpi-card__menu-button\"\n aria-label=\"More options\"\n >\n <mat-icon>more_vert</mat-icon>\n </button>\n <mat-menu #menu=\"matMenu\" class=\"acp-kpi-card__menu\">\n <ng-container [ngTemplateOutlet]=\"actionsTemplate()!\"></ng-container>\n </mat-menu>\n }\n </mat-card-header>\n }\n\n <!-- Content -->\n <mat-card-content class=\"acp-kpi-card__content\">\n <!-- Main Value -->\n @if (value()) {\n <div class=\"acp-kpi-card__value-section\">\n <div class=\"acp-kpi-card__value\">{{ value() }}</div>\n\n <!-- Percentage & Trend -->\n @if (percentage() !== undefined) {\n <div class=\"acp-kpi-card__metric\">\n @if (isTrending()) {\n <mat-icon class=\"acp-kpi-card__trend-icon\" [attr.aria-label]=\"trendConfig().ariaLabel\">\n {{ trendConfig().icon }}\n </mat-icon>\n }\n <span class=\"acp-kpi-card__percentage\">\n {{ percentageFormat() === 'percent' ? (percentage() + '%') : percentage() }}\n </span>\n </div>\n }\n </div>\n }\n\n <!-- Description -->\n @if (description()) {\n <p class=\"acp-kpi-card__description\">{{ description() }}</p>\n }\n\n <!-- Progress Bar -->\n @if (progress() !== undefined) {\n <mat-progress-bar\n class=\"acp-kpi-card__progress\"\n mode=\"determinate\"\n [value]=\"progress()\"\n [color]=\"progressColor()\"\n ></mat-progress-bar>\n }\n </mat-card-content>\n\n <!-- Footer -->\n @if (hasFooter()) {\n <mat-divider></mat-divider>\n <div class=\"acp-kpi-card__footer\">\n @if (footerTemplate()) {\n <ng-container [ngTemplateOutlet]=\"footerTemplate()!\"></ng-container>\n } @else if (footer()) {\n <p class=\"acp-kpi-card__footer-text\">{{ footer() }}</p>\n }\n </div>\n } }\n</mat-card>\n", styles: [".acp-kpi-card{--acp-kpi-card-bg: var(--acp-kpi-card-primary-bg, var(--mat-sys-primary));--acp-kpi-card-fg: var(--acp-kpi-card-primary-color, var(--mat-sys-on-primary));display:flex;vertical-align:middle;width:100%;max-width:100%}.acp-kpi-card__card{width:100%;display:flex;flex-direction:column;border-radius:12px;transition:all .3s cubic-bezier(.4,0,.2,1);overflow:hidden;background-color:#fff}.acp-kpi-card__header{display:flex;align-items:center;justify-content:space-between;padding:16px;gap:12px}.acp-kpi-card__header-content{display:flex;align-items:center;gap:12px;flex:1;min-width:0}.acp-kpi-card__icon-container{display:flex;align-items:center;justify-content:center;flex-shrink:0}.acp-kpi-card__icon{font-size:24px;width:24px;height:24px;color:var(--acp-kpi-card-fg)}.acp-kpi-card__avatar{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--acp-kpi-card-bg) 30%,transparent);color:var(--acp-kpi-card-fg);font-weight:500;font-size:14px;flex-shrink:0}.acp-kpi-card__avatar-image{width:40px;height:40px;border-radius:50%;object-fit:cover;flex-shrink:0}.acp-kpi-card__avatar-initials{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--acp-kpi-card-bg) 30%,transparent);color:var(--acp-kpi-card-fg);font-weight:500;font-size:14px;flex-shrink:0}.acp-kpi-card__title-container{flex:1;min-width:0}.acp-kpi-card__title{margin:0;font-size:14px;font-weight:500;letter-spacing:.25px;color:var(--acp-kpi-card-fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.acp-kpi-card__subtitle{margin:2px 0 0;font-size:12px;font-weight:400;letter-spacing:.4px;color:rgba(var(--acp-kpi-card-fg),.6);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.acp-kpi-card__menu-button{flex-shrink:0;opacity:.7;transition:opacity .2s ease-in-out}.acp-kpi-card__menu-button:hover{opacity:1}.acp-kpi-card__menu-button:focus-visible{outline:2px solid currentColor;outline-offset:2px}.acp-kpi-card__menu{will-change:transform}.acp-kpi-card__content{flex:1;padding:16px;display:flex;flex-direction:column;gap:12px}.acp-kpi-card__value-section{display:flex;align-items:baseline;gap:8px}.acp-kpi-card__value{font-size:28px;font-weight:600;letter-spacing:-.5px;color:var(--acp-kpi-card-fg);line-height:1.2}.acp-kpi-card__metric{display:flex;align-items:center;gap:4px;font-size:13px;font-weight:500;letter-spacing:.25px;color:rgba(var(--acp-kpi-card-fg),.8)}.acp-kpi-card__trend-icon{font-size:16px;width:16px;height:16px}.acp-kpi-card__percentage{white-space:nowrap}.acp-kpi-card.acp-kpi-card--success .acp-kpi-card__metric{color:var(--acp-kpi-card-success-color, light-dark(#ffffff, #013a00))}.acp-kpi-card.acp-kpi-card--success-light .acp-kpi-card__metric{color:var(--acp-kpi-card-success-light-color, var(--mat-sys-on-surface))}.acp-kpi-card.acp-kpi-card--warning .acp-kpi-card__metric{color:var(--acp-kpi-card-warning-color, light-dark(#ffffff, #502400))}.acp-kpi-card.acp-kpi-card--warning-light .acp-kpi-card__metric{color:var(--acp-kpi-card-warning-light-color, var(--mat-sys-on-surface))}.acp-kpi-card.acp-kpi-card--error .acp-kpi-card__metric{color:var(--acp-kpi-card-error-color, var(--mat-sys-on-error))}.acp-kpi-card.acp-kpi-card--error-light .acp-kpi-card__metric{color:var(--acp-kpi-card-error-light-color, var(--mat-sys-on-surface))}.acp-kpi-card.acp-kpi-card--info .acp-kpi-card__metric{color:var(--acp-kpi-card-info-color, light-dark(#ffffff, #002f65))}.acp-kpi-card.acp-kpi-card--info-light .acp-kpi-card__metric{color:var(--acp-kpi-card-info-light-color, var(--mat-sys-on-surface))}.acp-kpi-card__description{margin:0;font-size:12px;font-weight:400;letter-spacing:.4px;color:rgba(var(--acp-kpi-card-fg),.6);line-height:1.5}.acp-kpi-card__progress{height:4px;border-radius:2px;background-color:rgba(var(--acp-kpi-card-fg),.12)}.acp-kpi-card__footer{padding:12px 16px;font-size:12px;font-weight:400;letter-spacing:.4px;color:rgba(var(--acp-kpi-card-fg),.6)}.acp-kpi-card__footer-text{margin:0}.acp-kpi-card__skeleton{padding:16px;display:flex;flex-direction:column;gap:12px}.acp-kpi-card__skeleton-header{width:60%;height:16px;background:linear-gradient(90deg,#0000001a 25%,#0000000d,#0000001a 75%);background-size:200% 100%;animation:loading 1.5s infinite;border-radius:4px}.acp-kpi-card__skeleton-value{width:40%;height:28px;background:linear-gradient(90deg,#0000001a 25%,#0000000d,#0000001a 75%);background-size:200% 100%;animation:loading 1.5s infinite;border-radius:4px}.acp-kpi-card__skeleton-text{width:80%;height:12px;background:linear-gradient(90deg,#0000001a 25%,#0000000d,#0000001a 75%);background-size:200% 100%;animation:loading 1.5s infinite;border-radius:4px}@keyframes loading{0%{background-position:200% 0}to{background-position:-200% 0}}.acp-kpi-card.acp-kpi-card--primary{--acp-kpi-card-bg: var(--acp-kpi-card-primary-bg, var(--mat-sys-primary));--acp-kpi-card-fg: var(--acp-kpi-card-primary-color, var(--mat-sys-on-primary))}.acp-kpi-card.acp-kpi-card--secondary{--acp-kpi-card-bg: var(--acp-kpi-card-secondary-bg, var(--mat-sys-secondary));--acp-kpi-card-fg: var(--acp-kpi-card-secondary-color, var(--mat-sys-on-secondary))}.acp-kpi-card.acp-kpi-card--success{--acp-kpi-card-bg: var(--acp-kpi-card-success-bg, light-dark(#038b00, #03c700));--acp-kpi-card-fg: var(--acp-kpi-card-success-color, light-dark(#ffffff, #013a00))}.acp-kpi-card.acp-kpi-card--success-light{--acp-kpi-card-bg: var(--acp-kpi-card-success-light-bg, light-dark(#cbffb8, #014600));--acp-kpi-card-fg: var(--acp-kpi-card-success-light-color, var(--mat-sys-on-surface))}.acp-kpi-card.acp-kpi-card--warning{--acp-kpi-card-bg: var(--acp-kpi-card-warning-bg, light-dark(#e37100, #ffb787));--acp-kpi-card-fg: var(--acp-kpi-card-warning-color, light-dark(#ffffff, #502400))}.acp-kpi-card.acp-kpi-card--warning-light{--acp-kpi-card-bg: var(--acp-kpi-card-warning-light-bg, light-dark(#ffede4, #612d00));--acp-kpi-card-fg: var(--acp-kpi-card-warning-light-color, var(--mat-sys-on-surface))}.acp-kpi-card.acp-kpi-card--error{--acp-kpi-card-bg: var(--acp-kpi-card-error-bg, var(--mat-sys-error));--acp-kpi-card-fg: var(--acp-kpi-card-error-color, var(--mat-sys-on-error))}.acp-kpi-card.acp-kpi-card--error-light{--acp-kpi-card-bg: var(--acp-kpi-card-error-light-bg, light-dark(#ffedea, #7e0100));--acp-kpi-card-fg: var(--acp-kpi-card-error-light-color, var(--mat-sys-on-surface))}.acp-kpi-card.acp-kpi-card--info{--acp-kpi-card-bg: var(--acp-kpi-card-info-bg, light-dark(#0074e9, #7cabff));--acp-kpi-card-fg: var(--acp-kpi-card-info-color, light-dark(#ffffff, #002f65))}.acp-kpi-card.acp-kpi-card--info-light{--acp-kpi-card-bg: var(--acp-kpi-card-info-light-bg, light-dark(#ecf0ff, #003a7a));--acp-kpi-card-fg: var(--acp-kpi-card-info-light-color, var(--mat-sys-on-surface))}.acp-kpi-card.acp-kpi-card--neutral{--acp-kpi-card-bg: var(--acp-kpi-card-neutral-bg, var(--mat-sys-surface-variant));--acp-kpi-card-fg: var(--acp-kpi-card-neutral-color, var(--mat-sys-on-surface-variant))}.acp-kpi-card.acp-kpi-card--white{--acp-kpi-card-bg: #ffffff;--acp-kpi-card-fg: #1f2937}.acp-kpi-card.acp-kpi-card--custom{--acp-kpi-card-bg: var( --acp-kpi-card-custom-bg, var(--acp-kpi-card-custom-bg, var(--mat-sys-surface-container)) );--acp-kpi-card-fg: var( --acp-kpi-card-custom-fg, var(--acp-kpi-card-custom-color, var(--mat-sys-on-surface)) )}.acp-kpi-card.acp-kpi-card--default .acp-kpi-card__card{background:var(--acp-kpi-card-bg);color:var(--acp-kpi-card-fg);border:1px solid rgba(var(--acp-kpi-card-fg),.12)}.acp-kpi-card.acp-kpi-card--elevated .acp-kpi-card__card{background:var(--acp-kpi-card-bg);color:var(--acp-kpi-card-fg);box-shadow:0 3px 8px #00000014,0 1px 3px #0000000a}.acp-kpi-card.acp-kpi-card--outlined .acp-kpi-card__card{background:transparent;color:var(--acp-kpi-card-fg);border:2px solid rgba(var(--acp-kpi-card-fg),.2)}.acp-kpi-card.acp-kpi-card--filled .acp-kpi-card__card{background:var(--acp-kpi-card-bg);color:var(--acp-kpi-card-fg)}.acp-kpi-card.acp-kpi-card--tonal .acp-kpi-card__card{background:color-mix(in srgb,var(--acp-kpi-card-bg) 12%,transparent);color:var(--acp-kpi-card-fg);border:1px solid rgba(var(--acp-kpi-card-fg),.08)}.acp-kpi-card.acp-kpi-card--clickable .acp-kpi-card__card{cursor:pointer}.acp-kpi-card.acp-kpi-card--clickable .acp-kpi-card__card:hover{box-shadow:0 6px 12px #0000001a,0 2px 4px #0000000f;transform:translateY(-1px)}.acp-kpi-card.acp-kpi-card--clickable .acp-kpi-card__card:active{transform:translateY(0);box-shadow:0 2px 4px #00000014}.acp-kpi-card.acp-kpi-card--clickable .acp-kpi-card__card:focus-visible{outline:2px solid currentColor;outline-offset:2px}.acp-kpi-card.acp-kpi-card--disabled .acp-kpi-card__card{opacity:.6;cursor:not-allowed;pointer-events:none}.acp-kpi-card.acp-kpi-card--selected .acp-kpi-card__card{border:2px solid var(--acp-kpi-card-fg)}.acp-kpi-card.acp-kpi-card--loading .acp-kpi-card__card{pointer-events:none;opacity:.8}@media(max-width:768px){.acp-kpi-card__header,.acp-kpi-card__content{padding:12px}.acp-kpi-card__value{font-size:24px}.acp-kpi-card__title{font-size:13px}}@media(prefers-reduced-motion:reduce){.acp-kpi-card__card{transition:none}.acp-kpi-card__skeleton-header,.acp-kpi-card__skeleton-value,.acp-kpi-card__skeleton-text{animation:none}}@media(prefers-contrast:more){.acp-kpi-card__card{border-width:2px}}@media(max-width:768px){.acp-kpi-card__header,.acp-kpi-card__content{padding:12px;gap:8px}.acp-kpi-card__footer{padding:12px}.acp-kpi-card__icon{font-size:20px;width:20px;height:20px}.acp-kpi-card__avatar,.acp-kpi-card__avatar-image,.acp-kpi-card__avatar-initials{width:32px;height:32px;font-size:12px}.acp-kpi-card__title{font-size:13px}.acp-kpi-card__subtitle{font-size:11px}.acp-kpi-card__value{font-size:24px}}.acp-kpi-card__card.acp-kpi-card--xs{min-height:96px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__header,.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__content{padding:8px;gap:6px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__footer{padding:8px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__icon{font-size:16px;width:16px;height:16px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__avatar,.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__avatar-image,.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__avatar-initials{width:28px;height:28px;font-size:11px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__title{font-size:12px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__subtitle{font-size:10px;margin-top:1px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__value{font-size:18px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__percentage{font-size:10px}.acp-kpi-card__card.acp-kpi-card--xs .acp-kpi-card__description{font-size:11px}.acp-kpi-card__card.acp-kpi-card--sm{min-height:128px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__header,.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__content{padding:12px;gap:8px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__footer{padding:12px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__icon{font-size:20px;width:20px;height:20px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__avatar,.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__avatar-image,.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__avatar-initials{width:32px;height:32px;font-size:12px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__title{font-size:13px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__subtitle{font-size:11px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__value{font-size:22px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__percentage{font-size:11px}.acp-kpi-card__card.acp-kpi-card--sm .acp-kpi-card__description{font-size:12px}.acp-kpi-card__card.acp-kpi-card--md{min-height:160px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__header,.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__content{padding:16px;gap:12px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__footer{padding:16px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__icon{font-size:24px;width:24px;height:24px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__avatar,.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__avatar-image,.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__avatar-initials{width:40px;height:40px;font-size:14px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__title{font-size:14px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__subtitle{font-size:12px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__value{font-size:28px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__percentage{font-size:12px}.acp-kpi-card__card.acp-kpi-card--md .acp-kpi-card__description{font-size:13px}.acp-kpi-card__card.acp-kpi-card--lg{min-height:224px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__header,.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__content{padding:20px;gap:16px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__footer{padding:20px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__icon{font-size:32px;width:32px;height:32px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__avatar,.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__avatar-image,.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__avatar-initials{width:48px;height:48px;font-size:16px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__title{font-size:16px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__subtitle{font-size:13px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__value{font-size:36px}.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__percentage,.acp-kpi-card__card.acp-kpi-card--lg .acp-kpi-card__description{font-size:14px}\n"] }]
|
|
8286
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], footer: [{ type: i0.Input, args: [{ isSignal: true, alias: "footer", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], svgIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "svgIcon", required: false }] }], avatar: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatar", required: false }] }], avatarInitials: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatarInitials", required: false }] }], trend: [{ type: i0.Input, args: [{ isSignal: true, alias: "trend", required: false }] }], percentage: [{ type: i0.Input, args: [{ isSignal: true, alias: "percentage", required: false }] }], percentageFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "percentageFormat", required: false }] }], progress: [{ type: i0.Input, args: [{ isSignal: true, alias: "progress", required: false }] }], progressColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "progressColor", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], routerLink: [{ type: i0.Input, args: [{ isSignal: true, alias: "routerLink", required: false }] }], href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }], actionClicked: [{ type: i0.Output, args: ["actionClicked"] }], iconTemplate: [{ type: i0.ContentChild, args: ['icon', { ...{ read: TemplateRef }, isSignal: true }] }], avatarTemplate: [{ type: i0.ContentChild, args: ['avatar', { ...{ read: TemplateRef }, isSignal: true }] }], footerTemplate: [{ type: i0.ContentChild, args: ['footer', { ...{ read: TemplateRef }, isSignal: true }] }], actionsTemplate: [{ type: i0.ContentChild, args: ['actions', { ...{ read: TemplateRef }, isSignal: true }] }] } });
|
|
8287
|
+
|
|
8288
|
+
const KPI_CARD_TOKENS = {
|
|
8289
|
+
// Sizes
|
|
8290
|
+
SIZE_SM: 'sm',
|
|
8291
|
+
SIZE_MD: 'md',
|
|
8292
|
+
SIZE_LG: 'lg',
|
|
8293
|
+
// Variants
|
|
8294
|
+
VARIANT_DEFAULT: 'default',
|
|
8295
|
+
VARIANT_ELEVATED: 'elevated',
|
|
8296
|
+
VARIANT_OUTLINED: 'outlined',
|
|
8297
|
+
VARIANT_FILLED: 'filled',
|
|
8298
|
+
VARIANT_TONAL: 'tonal',
|
|
8299
|
+
// Colors
|
|
8300
|
+
COLOR_PRIMARY: 'primary',
|
|
8301
|
+
COLOR_SECONDARY: 'secondary',
|
|
8302
|
+
COLOR_SUCCESS: 'success',
|
|
8303
|
+
COLOR_SUCCESS_LIGHT: 'success-light',
|
|
8304
|
+
COLOR_WARNING: 'warning',
|
|
8305
|
+
COLOR_WARNING_LIGHT: 'warning-light',
|
|
8306
|
+
COLOR_ERROR: 'error',
|
|
8307
|
+
COLOR_ERROR_LIGHT: 'error-light',
|
|
8308
|
+
COLOR_INFO: 'info',
|
|
8309
|
+
COLOR_INFO_LIGHT: 'info-light',
|
|
8310
|
+
COLOR_NEUTRAL: 'neutral',
|
|
8311
|
+
COLOR_CUSTOM: 'custom',
|
|
8312
|
+
// Trends
|
|
8313
|
+
TREND_UP: 'up',
|
|
8314
|
+
TREND_DOWN: 'down',
|
|
8315
|
+
TREND_NEUTRAL: 'neutral',
|
|
8316
|
+
TREND_NONE: 'none',
|
|
8317
|
+
};
|
|
8318
|
+
|
|
8840
8319
|
class ToUpperCase {
|
|
8841
8320
|
el = inject(ElementRef);
|
|
8842
8321
|
renderer = inject(Renderer2);
|
|
@@ -8889,6 +8368,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
8889
8368
|
args: ['input']
|
|
8890
8369
|
}] } });
|
|
8891
8370
|
|
|
8371
|
+
class Pagination {
|
|
8372
|
+
totalRecords;
|
|
8373
|
+
pageSize;
|
|
8374
|
+
pageIndex;
|
|
8375
|
+
pageSizeOptions;
|
|
8376
|
+
hidePageSize;
|
|
8377
|
+
showPageSizeOptions;
|
|
8378
|
+
showFirstLastButtons;
|
|
8379
|
+
disabled;
|
|
8380
|
+
/**
|
|
8381
|
+
* @param pageIndex Current page index (0-based for MatPaginator compatibility)
|
|
8382
|
+
* @param pageSize Number of records per page
|
|
8383
|
+
* @param totalRecords Total number of records
|
|
8384
|
+
* @param pageSizeOptions Available page size options
|
|
8385
|
+
* @param options Display and behavior options
|
|
8386
|
+
*/
|
|
8387
|
+
constructor(pageIndex = 0, // MatPaginator starts at 0
|
|
8388
|
+
pageSize = 25, totalRecords = 0, pageSizeOptions = [25, 50, 75, 100], options = {}) {
|
|
8389
|
+
this.pageIndex = pageIndex;
|
|
8390
|
+
this.pageSize = pageSize;
|
|
8391
|
+
this.totalRecords = totalRecords;
|
|
8392
|
+
this.pageSizeOptions = pageSizeOptions;
|
|
8393
|
+
this.hidePageSize = options.hidePageSize ?? false;
|
|
8394
|
+
this.showPageSizeOptions = options.showPageSizeOptions ?? true;
|
|
8395
|
+
this.showFirstLastButtons = options.showFirstLastButtons ?? true;
|
|
8396
|
+
this.disabled = options.disabled ?? false;
|
|
8397
|
+
}
|
|
8398
|
+
/**
|
|
8399
|
+
* Calculates the total number of pages.
|
|
8400
|
+
*/
|
|
8401
|
+
getTotalPages() {
|
|
8402
|
+
return Math.ceil(this.totalRecords / this.pageSize);
|
|
8403
|
+
}
|
|
8404
|
+
/**
|
|
8405
|
+
* Handles page event similar to Angular Material example.
|
|
8406
|
+
* @param event MatPaginator PageEvent
|
|
8407
|
+
*/
|
|
8408
|
+
handlePageEvent(event) {
|
|
8409
|
+
this.totalRecords = event.length;
|
|
8410
|
+
this.pageSize = event.pageSize;
|
|
8411
|
+
this.pageIndex = event.pageIndex;
|
|
8412
|
+
}
|
|
8413
|
+
}
|
|
8414
|
+
|
|
8892
8415
|
class GetTotalPipe {
|
|
8893
8416
|
transform(colName, dataSource) {
|
|
8894
8417
|
return this.getTotal(colName, dataSource) || '';
|
|
@@ -8983,5 +8506,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
8983
8506
|
* Generated bundle index. Do not edit.
|
|
8984
8507
|
*/
|
|
8985
8508
|
|
|
8986
|
-
export { ACP_ACTIVE_DATE_DEBOUNCE,
|
|
8509
|
+
export { ACP_ACTIVE_DATE_DEBOUNCE, ACP_BADGE_COLORS, ACP_BADGE_SHAPES, ACP_BADGE_SIZES, ACP_BADGE_VARIANTS, ACP_DATE_OPTION_TYPE, ACP_DEFAULT_DATE_OPTIONS, ACP_DRAWER_DATA, ACP_DRAWER_DEFAULT_OPTIONS, ACP_POPOVER_CONTENT, ACP_POPOVER_DEFAULT_OPTIONS, ACP_POPOVER_SCROLL_STRATEGY, AcpAlert, AcpBadge, AcpButton, AcpCheckboxBase, AcpCheckboxGroup, AcpDateRangeInput, AcpDrawer, AcpDrawerConfig, AcpDrawerContainer, AcpDrawerRef, AcpKpiCard, AcpPopover, AcpPopoverContent, AcpPopoverTarget, AcpPopoverTrigger, AcpSelectDateOption, AdvancedDialogService, Button, DATA_GRID_DEFAULT_OPTIONS, DataGrid, DateRangePicker, DialogWrapper, DialogZIndexService, DynamicCard, DynamicSelect, GetTotalPipe, IconRegistryService, InputChip, KPI_CARD_TOKENS, KPI_CARD_TREND_CONFIGS, KeyboardNavigationService, OverlayService, Pagination, Spinner, StatusDisplayPipe, SvgIcon, TREND_CONFIGS, TabulatorTable, ThemeSwitcher, ThemeToggle, ToUpperCase, UserIcon, _AcpPopoverContentBase, formatValue };
|
|
8987
8510
|
//# sourceMappingURL=acontplus-ng-components.mjs.map
|