@porscheinformatik/material-addons 22.3.2 → 22.5.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.
@@ -1,23 +1,23 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, Component, NgModule, booleanAttribute, inject, ElementRef, Renderer2, DestroyRef, Directive, ChangeDetectionStrategy, effect, Optional, HostBinding, signal, LOCALE_ID, Inject, Injectable, output, InjectionToken, viewChild, computed, EventEmitter, Output, Input, ViewChild, forwardRef, HostListener, model, TemplateRef, ViewChildren, ContentChild, SkipSelf, ViewContainerRef, inputBinding, outputBinding, contentChildren, contentChild, ChangeDetectorRef, untracked, ViewEncapsulation, QueryList, ContentChildren } from '@angular/core';
3
- import * as i2$1 from '@angular/material/icon';
2
+ import { input, Component, NgModule, booleanAttribute, inject, ElementRef, Renderer2, DestroyRef, Directive, ChangeDetectionStrategy, effect, Optional, HostBinding, signal, LOCALE_ID, Inject, Injectable, output, InjectionToken, viewChild, computed, EventEmitter, Output, Input, ViewChild, ChangeDetectorRef, Injector, untracked, afterEveryRender, forwardRef, HostListener, model, SkipSelf, ViewContainerRef, inputBinding, outputBinding, contentChildren, contentChild, TemplateRef, ViewChildren, ContentChild, ViewEncapsulation, QueryList, ContentChildren, PLATFORM_ID } from '@angular/core';
3
+ import * as i2 from '@angular/material/icon';
4
4
  import { MatIconModule, MatIcon } from '@angular/material/icon';
5
- import * as i2 from '@angular/material/tooltip';
5
+ import * as i6 from '@angular/material/tooltip';
6
6
  import { MatTooltipModule, MatTooltip } from '@angular/material/tooltip';
7
7
  import * as i1 from '@angular/material/button';
8
8
  import { MatButtonModule } from '@angular/material/button';
9
9
  import * as i1$8 from '@angular/router';
10
10
  import { RouterLink, RouterModule, NavigationEnd } from '@angular/router';
11
- import * as i2$5 from '@angular/common';
12
- import { CommonModule, NgStyle, NgClass, NgTemplateOutlet, AsyncPipe } from '@angular/common';
11
+ import * as i2$4 from '@angular/common';
12
+ import { CommonModule, NgStyle, NgClass, NgTemplateOutlet, AsyncPipe, DOCUMENT, isPlatformBrowser } from '@angular/common';
13
13
  import * as i1$2 from '@angular/forms';
14
- import { FormsModule, FormGroupDirective, ControlContainer, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormControl } from '@angular/forms';
14
+ import { FormsModule, FormGroupDirective, ControlContainer, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
15
15
  import * as i3 from '@angular/cdk/text-field';
16
16
  import { TextFieldModule } from '@angular/cdk/text-field';
17
- import * as i2$2 from '@angular/material/input';
18
- import { MatInputModule } from '@angular/material/input';
17
+ import * as i2$1 from '@angular/material/input';
18
+ import { MatInputModule, MatInput } from '@angular/material/input';
19
19
  import * as i1$1 from '@angular/material/form-field';
20
- import { MatFormFieldModule } from '@angular/material/form-field';
20
+ import { MatFormFieldModule, MatFormField } from '@angular/material/form-field';
21
21
  import { ObserversModule } from '@angular/cdk/observers';
22
22
  import { Subject, Subscription, of } from 'rxjs';
23
23
  import { throttleTime, switchMap, map, tap, startWith, takeUntil, distinctUntilChanged } from 'rxjs/operators';
@@ -32,10 +32,10 @@ import { MatSortModule, MatSort } from '@angular/material/sort';
32
32
  import * as i1$4 from '@angular/material/menu';
33
33
  import { MatMenuModule } from '@angular/material/menu';
34
34
  import * as i1$5 from '@angular/material/dialog';
35
- import { MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialog } from '@angular/material/dialog';
36
- import * as i2$3 from '@angular/cdk/drag-drop';
35
+ import { MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialog, MatDialogModule } from '@angular/material/dialog';
36
+ import * as i2$2 from '@angular/cdk/drag-drop';
37
37
  import { moveItemInArray, transferArrayItem, DragDropModule } from '@angular/cdk/drag-drop';
38
- import * as i2$4 from '@ngx-translate/core';
38
+ import * as i2$3 from '@ngx-translate/core';
39
39
  import { TranslateModule } from '@ngx-translate/core';
40
40
  import { SelectionModel } from '@angular/cdk/collections';
41
41
  import { DateTime } from 'luxon';
@@ -64,7 +64,7 @@ import * as i1$9 from '@angular/cdk/layout';
64
64
  import { Breakpoints } from '@angular/cdk/layout';
65
65
  import * as i4 from '@angular/material/toolbar';
66
66
  import { MatToolbarModule } from '@angular/material/toolbar';
67
- import * as i2$6 from '@angular/platform-browser';
67
+ import * as i2$5 from '@angular/platform-browser';
68
68
  import * as i3$2 from '@angular/material/chips';
69
69
  import { MatChipsModule } from '@angular/material/chips';
70
70
 
@@ -84,7 +84,7 @@ class MaterialActionButtonComponent {
84
84
  ...(ngDevMode ? [{ debugName: "liftHigher2" }] : /* istanbul ignore next */ []));
85
85
  }
86
86
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MaterialActionButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
87
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: MaterialActionButtonComponent, isStandalone: true, selector: "mad-material-action-button", inputs: { actionName: { classPropertyName: "actionName", publicName: "actionName", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: false, transformFunction: null }, liftHigher: { classPropertyName: "liftHigher", publicName: "liftHigher", isSignal: true, isRequired: false, transformFunction: null }, liftHigher2: { classPropertyName: "liftHigher2", publicName: "liftHigher2", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"material-action-button\" [class.lift-higher]=\"liftHigher()\" [class.lift-higher-2]=\"liftHigher2()\">\n @if (liftHigher2()) {\n <a\n mat-mini-fab\n class=\"mat-accent\"\n [attr.id]=\"id() || null\"\n [routerLink]=\"routerLink()\"\n [matTooltip]=\"actionName()\"\n matTooltipPosition=\"left\"\n [attr.aria-label]=\"actionName() || null\"\n >\n <mat-icon>{{ icon() }}</mat-icon>\n </a>\n } @else {\n <a\n mat-fab\n class=\"mat-primary\"\n [attr.id]=\"id() || null\"\n [routerLink]=\"routerLink()\"\n [matTooltip]=\"actionName()\"\n matTooltipPosition=\"left\"\n [attr.aria-label]=\"actionName() || null\"\n >\n <mat-icon>{{ icon() }}</mat-icon>\n </a>\n }\n</div>\n", styles: [".material-action-button{position:fixed;bottom:20px;right:20px;z-index:100;display:flex;flex-direction:column-reverse;align-items:center}.lift-higher{bottom:61px}.lift-higher-2{right:28px;bottom:121px}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
87
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: MaterialActionButtonComponent, isStandalone: true, selector: "mad-material-action-button", inputs: { actionName: { classPropertyName: "actionName", publicName: "actionName", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: false, transformFunction: null }, liftHigher: { classPropertyName: "liftHigher", publicName: "liftHigher", isSignal: true, isRequired: false, transformFunction: null }, liftHigher2: { classPropertyName: "liftHigher2", publicName: "liftHigher2", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"material-action-button\" [class.lift-higher]=\"liftHigher()\" [class.lift-higher-2]=\"liftHigher2()\">\n @if (liftHigher2()) {\n <a\n mat-mini-fab\n class=\"mat-accent\"\n [attr.id]=\"id() || null\"\n [routerLink]=\"routerLink()\"\n [matTooltip]=\"actionName()\"\n matTooltipPosition=\"left\"\n [attr.aria-label]=\"actionName() || null\"\n >\n <mat-icon>{{ icon() }}</mat-icon>\n </a>\n } @else {\n <a\n mat-fab\n class=\"mat-primary\"\n [attr.id]=\"id() || null\"\n [routerLink]=\"routerLink()\"\n [matTooltip]=\"actionName()\"\n matTooltipPosition=\"left\"\n [attr.aria-label]=\"actionName() || null\"\n >\n <mat-icon>{{ icon() }}</mat-icon>\n </a>\n }\n</div>\n", styles: [".material-action-button{position:fixed;bottom:20px;right:20px;z-index:100;display:flex;flex-direction:column-reverse;align-items:center}.lift-higher{bottom:61px}.lift-higher-2{right:28px;bottom:121px}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
88
88
  }
89
89
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MaterialActionButtonComponent, decorators: [{
90
90
  type: Component,
@@ -329,6 +329,59 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
329
329
  }]
330
330
  }] });
331
331
 
332
+ /** Internal numeric-field precision policy, including static string attributes. */
333
+ function normalizeDecimalPlaces(value) {
334
+ if (typeof value !== 'number' && (typeof value !== 'string' || value.trim() === '')) {
335
+ return 2;
336
+ }
337
+ const precision = Number(value);
338
+ return Number.isInteger(precision) && precision >= 0 && precision <= 100 ? precision : 2;
339
+ }
340
+ /** Expand the finite number's shortest decimal representation; IEEE-754 bounds the allocation. */
341
+ function toDecimalString(value) {
342
+ if (!Number.isFinite(value)) {
343
+ return '';
344
+ }
345
+ const text = value.toString();
346
+ const [mantissa, exponent] = text.split('e');
347
+ if (exponent === undefined) {
348
+ return text;
349
+ }
350
+ const sign = value < 0 ? '-' : '';
351
+ const [integer, fraction = ''] = mantissa.replace('-', '').split('.');
352
+ const digits = integer + fraction;
353
+ const decimalIndex = integer.length + Number(exponent);
354
+ if (decimalIndex <= 0) {
355
+ return `${sign}0.${'0'.repeat(-decimalIndex)}${digits}`;
356
+ }
357
+ if (decimalIndex >= digits.length) {
358
+ return sign + digits + '0'.repeat(decimalIndex - digits.length);
359
+ }
360
+ return `${sign}${digits.slice(0, decimalIndex)}.${digits.slice(decimalIndex)}`;
361
+ }
362
+ /** Operate on decimal digits so scaling cannot overflow or move a decimal boundary. */
363
+ function roundOrTruncateNumber(value, decimalPlaces, roundDisplayValue) {
364
+ if (!Number.isFinite(value) || value === 0) {
365
+ return value;
366
+ }
367
+ const precision = normalizeDecimalPlaces(decimalPlaces);
368
+ const [integer, fraction = ''] = toDecimalString(Math.abs(value)).split('.');
369
+ if (fraction.length <= precision) {
370
+ return value;
371
+ }
372
+ const discarded = fraction.slice(precision);
373
+ let digits = integer + fraction.slice(0, precision);
374
+ // At an exact negative tie Math.round chooses the value closer to zero.
375
+ const increment = discarded[0] > '5' || (discarded[0] === '5' && (value > 0 || /[1-9]/.test(discarded.slice(1))));
376
+ if (roundDisplayValue && increment) {
377
+ digits = (BigInt(digits) + 1n).toString();
378
+ }
379
+ digits = digits.padStart(precision + 1, '0');
380
+ const decimalIndex = digits.length - precision;
381
+ const result = precision > 0 ? `${digits.slice(0, decimalIndex)}.${digits.slice(decimalIndex)}` : digits;
382
+ return Number((value < 0 ? '-' : '') + result);
383
+ }
384
+
332
385
  class NumberFormatService {
333
386
  static { this.NEGATIVE = '-'; }
334
387
  static { this.NUMBERS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; }
@@ -371,7 +424,6 @@ class NumberFormatService {
371
424
  * @param locale the new locale
372
425
  */
373
426
  prepareSeparators(locale) {
374
- // try to get the current formatting
375
427
  const localeDecimalSeparator = (1.1).toLocaleString(locale).charAt(1);
376
428
  const decimalSeparator = localeDecimalSeparator === ',' ? ',' : '.';
377
429
  const groupingSeparator = localeDecimalSeparator === ',' ? '.' : ',';
@@ -380,49 +432,38 @@ class NumberFormatService {
380
432
  this.allowedKeysSignal.set([...NumberFormatService.NUMBERS, NumberFormatService.NEGATIVE, decimalSeparator]);
381
433
  }
382
434
  format(value, options) {
383
- return NumberFormatService.valueIsSet(value)
384
- ? this.formatNumber(value.toString().replace(new RegExp('[.]', 'g'), this.decimalSeparator), options)
385
- : '';
435
+ return Number.isFinite(value) ? this.formatNumber(toDecimalString(value).replace('.', this.decimalSeparator), options) : '';
386
436
  }
387
437
  formatNumber(value, options) {
388
438
  const autofillDecimals = this.valueOrDefault(options?.autofillDecimals, NumberFormatService.DEFAULT_AUTOFILL_DECIMALS);
389
- const decimalPlaces = this.valueOrDefault(options?.decimalPlaces, NumberFormatService.DEFAULT_DECIMAL_PLACES);
439
+ const decimalPlaces = normalizeDecimalPlaces(options?.decimalPlaces);
390
440
  const finalFormatting = this.valueOrDefault(options?.finalFormatting, NumberFormatService.DEFAULT_FINAL_FORMATTING);
391
- let result = this.strip(value, { decimalPlaces, removeLeadingZeros: finalFormatting });
392
- /* add grouping separator */
393
- const decimalIndex = result.indexOf(this.decimalSeparator);
394
- const isNegative = result.startsWith(NumberFormatService.NEGATIVE);
395
- let i = decimalIndex > -1 ? decimalIndex : result.length;
396
- while (i > (isNegative ? 4 : 3)) {
397
- i -= 3;
398
- result = result.substring(0, i) + this.groupingSeparator + result.substring(i, result.length);
399
- }
400
- if (finalFormatting) {
401
- if (decimalPlaces > 0 && !!result) {
402
- /* autofill decimal places */
403
- let actualDecimalIndex = result.indexOf(this.decimalSeparator);
404
- if (autofillDecimals) {
405
- if (actualDecimalIndex === -1) {
406
- actualDecimalIndex = result.length;
407
- result += this.decimalSeparator;
408
- }
409
- result = this.addMissingLeadingZero(result, actualDecimalIndex);
410
- actualDecimalIndex = result.indexOf(this.decimalSeparator);
411
- const actualDecimalPlaces = result.length - actualDecimalIndex - 1;
412
- for (let j = 0; j < decimalPlaces - actualDecimalPlaces; j++) {
413
- result += '0';
414
- }
415
- }
416
- else {
417
- result = this.addMissingLeadingZero(result, actualDecimalIndex);
418
- }
419
- }
420
- }
421
- return result;
441
+ const stripped = this.strip(value, { decimalPlaces, removeLeadingZeros: finalFormatting });
442
+ const grouped = this.addGroupingSeparators(stripped);
443
+ return finalFormatting && decimalPlaces > 0 && grouped ? this.finalizeDecimals(grouped, decimalPlaces, autofillDecimals) : grouped;
422
444
  }
423
445
  strip(value, options) {
424
- const decimalPlaces = this.valueOrDefault(options?.decimalPlaces, NumberFormatService.DEFAULT_DECIMAL_PLACES);
446
+ const decimalPlaces = normalizeDecimalPlaces(options?.decimalPlaces);
425
447
  const removeLeadingZeros = this.valueOrDefault(options?.removeLeadingZeros, NumberFormatService.DEFAULT_REMOVE_LEADING_ZEROS);
448
+ if (/^[+-]?(?:Infinity|NaN)$/.test(value)) {
449
+ return '';
450
+ }
451
+ // Exponent input is atomic: never silently accept the mantissa of an invalid literal.
452
+ if (/^[+\-0-9.,]*[eE]/.test(value)) {
453
+ const exponentIndex = value.search(/[eE]/);
454
+ const sourceMantissa = value.slice(0, exponentIndex);
455
+ const ungrouped = this.groupingSeparator === this.decimalSeparator ? sourceMantissa : sourceMantissa.split(this.groupingSeparator).join('');
456
+ const mantissa = ungrouped.replace(this.decimalSeparator, '.');
457
+ const normalized = mantissa + value.slice(exponentIndex);
458
+ if (!/^[+-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)[eE][+-]?[0-9]+$/.test(normalized)) {
459
+ return '';
460
+ }
461
+ const exponentValue = Number(normalized);
462
+ if (!Number.isFinite(exponentValue)) {
463
+ return '';
464
+ }
465
+ value = this.expandScientificText(normalized, decimalPlaces).replace('.', this.decimalSeparator);
466
+ }
426
467
  let result = '';
427
468
  let indexDecimalSep = -1;
428
469
  let j = -1;
@@ -468,6 +509,64 @@ class NumberFormatService {
468
509
  break;
469
510
  }
470
511
  }
512
+ // Keep a numeric zero when leading-zero removal and zero-place truncation consume its digits.
513
+ if (ignoredChars > 0 && /^-?0/.test(value) && (result === '' || result === NumberFormatService.NEGATIVE)) {
514
+ result += '0';
515
+ }
516
+ const numericValue = Number.parseFloat(result.replace(this.decimalSeparator, '.'));
517
+ return numericValue === Infinity || numericValue === -Infinity ? '' : result;
518
+ }
519
+ expandScientificText(value, decimalPlaces) {
520
+ const [mantissa, exponent] = value.toLowerCase().split('e');
521
+ const sign = mantissa.startsWith('-') ? '-' : '';
522
+ const [integer, fraction = ''] = mantissa.replace(/^[+-]/, '').split('.');
523
+ const sourceDigits = integer + fraction;
524
+ const digits = sourceDigits.replace(/^0+/, '');
525
+ if (!digits) {
526
+ return sign + '0';
527
+ }
528
+ // Keep source digits: Number(value) is only an overflow guard, never the source of rounded digits.
529
+ const decimalIndex = integer.length + Number(exponent) - (sourceDigits.length - digits.length);
530
+ if (decimalIndex <= 0) {
531
+ const zeros = Math.min(-decimalIndex, decimalPlaces);
532
+ const subunitDecimals = '0'.repeat(zeros) + digits.slice(0, decimalPlaces - zeros);
533
+ return sign + '0' + (subunitDecimals ? '.' + subunitDecimals : '');
534
+ }
535
+ // A finite nonzero IEEE-754 value has at most 309 integer digits. Bound all padding explicitly.
536
+ if (decimalIndex > 309) {
537
+ return '';
538
+ }
539
+ const whole = digits.slice(0, decimalIndex).padEnd(decimalIndex, '0');
540
+ const decimals = digits.slice(decimalIndex, decimalIndex + decimalPlaces);
541
+ return sign + whole + (decimals ? '.' + decimals : '');
542
+ }
543
+ addGroupingSeparators(value) {
544
+ let result = value;
545
+ const decimalIndex = result.indexOf(this.decimalSeparator);
546
+ const isNegative = result.startsWith(NumberFormatService.NEGATIVE);
547
+ let index = decimalIndex > -1 ? decimalIndex : result.length;
548
+ while (index > (isNegative ? 4 : 3)) {
549
+ index -= 3;
550
+ result = result.substring(0, index) + this.groupingSeparator + result.substring(index, result.length);
551
+ }
552
+ return result;
553
+ }
554
+ finalizeDecimals(value, decimalPlaces, autofillDecimals) {
555
+ let result = value;
556
+ let decimalIndex = result.indexOf(this.decimalSeparator);
557
+ if (!autofillDecimals) {
558
+ return this.addMissingLeadingZero(result, decimalIndex);
559
+ }
560
+ if (decimalIndex === -1) {
561
+ decimalIndex = result.length;
562
+ result += this.decimalSeparator;
563
+ }
564
+ result = this.addMissingLeadingZero(result, decimalIndex);
565
+ decimalIndex = result.indexOf(this.decimalSeparator);
566
+ const actualDecimalPlaces = result.length - decimalIndex - 1;
567
+ for (let index = 0; index < decimalPlaces - actualDecimalPlaces; index++) {
568
+ result += '0';
569
+ }
471
570
  return result;
472
571
  }
473
572
  addMissingLeadingZero(result, actualDecimalIndex) {
@@ -659,7 +758,7 @@ class ReadOnlyFormFieldComponent {
659
758
  this.prefixClickedEmitter.emit();
660
759
  }
661
760
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ReadOnlyFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
662
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: ReadOnlyFormFieldComponent, isStandalone: true, selector: "mad-readonly-form-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, useProjectedContent: { classPropertyName: "useProjectedContent", publicName: "useProjectedContent", isSignal: true, isRequired: false, transformFunction: null }, textAlign: { classPropertyName: "textAlign", publicName: "textAlign", isSignal: true, isRequired: false, transformFunction: null }, textOverflow: { classPropertyName: "textOverflow", publicName: "textOverflow", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, unitPosition: { classPropertyName: "unitPosition", publicName: "unitPosition", isSignal: true, isRequired: false, transformFunction: null }, formatNumber: { classPropertyName: "formatNumber", publicName: "formatNumber", isSignal: true, isRequired: false, transformFunction: null }, decimalPlaces: { classPropertyName: "decimalPlaces", publicName: "decimalPlaces", isSignal: true, isRequired: false, transformFunction: null }, roundDisplayValue: { classPropertyName: "roundDisplayValue", publicName: "roundDisplayValue", isSignal: true, isRequired: false, transformFunction: null }, autofillDecimals: { classPropertyName: "autofillDecimals", publicName: "autofillDecimals", isSignal: true, isRequired: false, transformFunction: null }, multiline: { classPropertyName: "multiline", publicName: "multiline", isSignal: true, isRequired: false, transformFunction: null }, multilineAutoSize: { classPropertyName: "multilineAutoSize", publicName: "multilineAutoSize", isSignal: true, isRequired: false, transformFunction: null }, shrinkIfEmpty: { classPropertyName: "shrinkIfEmpty", publicName: "shrinkIfEmpty", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null }, prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { suffixClickedEmitter: "suffixClickedEmitter", prefixClickedEmitter: "prefixClickedEmitter" }, viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<mat-form-field class=\"form-group mad-read-only\">\n <mat-label>{{ label() }}</mat-label>\n @if (!multiline()) {\n <input\n #inputEl\n (madSizeChange)=\"sizeChanges.set($event)\"\n [style.text-overflow]=\"textOverflow()\"\n [disabled]=\"!useProjectedContent()\"\n [errorStateMatcher]=\"errorMatcher()\"\n [id]=\"id()\"\n [matTooltipDisabled]=\"!toolTipForInputEnabled()\"\n [matTooltip]=\"toolTipText()\"\n [ngClass]=\"'text-' + textAlign() + ' content'\"\n [ngModel]=\"displayValueWithUnit()\"\n [ngStyle]=\"{ display: useProjectedContent() ? 'none' : 'block' }\"\n matInput\n matTooltipClass=\"custom-tooltip\"\n matTooltipPosition=\"right\"\n readonly\n />\n } @else {\n <textarea\n [ngStyle]=\"{ display: useProjectedContent() ? 'none' : 'block' }\"\n [rows]=\"actualAmountOfRows()\"\n [ngModel]=\"displayValueWithUnit()\"\n class=\"multiline content\"\n [errorStateMatcher]=\"errorMatcher()\"\n [id]=\"id()\"\n readonly\n [disabled]=\"!useProjectedContent()\"\n matInput\n [cdkTextareaAutosize]=\"multilineAutoSize()\"\n >\n </textarea>\n }\n\n @if (useProjectedContent()) {\n <ng-content />\n }\n <mat-error>{{ errorMessage() }}</mat-error>\n @if (suffix()) {\n <mat-icon data-cy=\"suffix-icon\" (click)=\"suffixClicked()\" class=\"pointer mat-primary\" matSuffix>{{ suffix() }} </mat-icon>\n }\n @if (prefix()) {\n <mat-icon data-cy=\"prefix-icon\" (click)=\"prefixClicked()\" class=\"pointer mat-primary\" matPrefix>{{ prefix() }} </mat-icon>\n }\n @if (unit() && unitPosition() === 'left') {\n <span [style.padding-right]=\"'5px'\" matTextPrefix>{{ unit() }}</span>\n } @else if (unit() && textAlign() === 'right') {\n <span [style.padding-left]=\"'25px'\" matTextSuffix>{{ unit() }}</span>\n }\n</mat-form-field>\n", styles: ["mat-form-field{width:100%;width:-moz-available;width:-webkit-fill-available;width:stretch}mat-label{line-height:1.4}span[matPrefix]{padding-right:5px}span[matSuffix]{padding-left:5px}.text-left{text-align:left}.text-right{text-align:right}.multiline{resize:none}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$2.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: "directive", type: i3.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: TextFieldModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: SizeChangeDirective, selector: "[madSizeChange]", outputs: ["madSizeChange"] }] }); }
761
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: ReadOnlyFormFieldComponent, isStandalone: true, selector: "mad-readonly-form-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, useProjectedContent: { classPropertyName: "useProjectedContent", publicName: "useProjectedContent", isSignal: true, isRequired: false, transformFunction: null }, textAlign: { classPropertyName: "textAlign", publicName: "textAlign", isSignal: true, isRequired: false, transformFunction: null }, textOverflow: { classPropertyName: "textOverflow", publicName: "textOverflow", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, unitPosition: { classPropertyName: "unitPosition", publicName: "unitPosition", isSignal: true, isRequired: false, transformFunction: null }, formatNumber: { classPropertyName: "formatNumber", publicName: "formatNumber", isSignal: true, isRequired: false, transformFunction: null }, decimalPlaces: { classPropertyName: "decimalPlaces", publicName: "decimalPlaces", isSignal: true, isRequired: false, transformFunction: null }, roundDisplayValue: { classPropertyName: "roundDisplayValue", publicName: "roundDisplayValue", isSignal: true, isRequired: false, transformFunction: null }, autofillDecimals: { classPropertyName: "autofillDecimals", publicName: "autofillDecimals", isSignal: true, isRequired: false, transformFunction: null }, multiline: { classPropertyName: "multiline", publicName: "multiline", isSignal: true, isRequired: false, transformFunction: null }, multilineAutoSize: { classPropertyName: "multilineAutoSize", publicName: "multilineAutoSize", isSignal: true, isRequired: false, transformFunction: null }, shrinkIfEmpty: { classPropertyName: "shrinkIfEmpty", publicName: "shrinkIfEmpty", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null }, prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { suffixClickedEmitter: "suffixClickedEmitter", prefixClickedEmitter: "prefixClickedEmitter" }, viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<mat-form-field class=\"form-group mad-read-only\">\n <mat-label>{{ label() }}</mat-label>\n @if (!multiline()) {\n <input\n #inputEl\n (madSizeChange)=\"sizeChanges.set($event)\"\n [style.text-overflow]=\"textOverflow()\"\n [disabled]=\"!useProjectedContent()\"\n [errorStateMatcher]=\"errorMatcher()\"\n [id]=\"id()\"\n [matTooltipDisabled]=\"!toolTipForInputEnabled()\"\n [matTooltip]=\"toolTipText()\"\n [ngClass]=\"'text-' + textAlign() + ' content'\"\n [ngModel]=\"displayValueWithUnit()\"\n [ngStyle]=\"{ display: useProjectedContent() ? 'none' : 'block' }\"\n matInput\n matTooltipClass=\"custom-tooltip\"\n matTooltipPosition=\"right\"\n readonly\n />\n } @else {\n <textarea\n [ngStyle]=\"{ display: useProjectedContent() ? 'none' : 'block' }\"\n [rows]=\"actualAmountOfRows()\"\n [ngModel]=\"displayValueWithUnit()\"\n class=\"multiline content\"\n [errorStateMatcher]=\"errorMatcher()\"\n [id]=\"id()\"\n readonly\n [disabled]=\"!useProjectedContent()\"\n matInput\n [cdkTextareaAutosize]=\"multilineAutoSize()\"\n >\n </textarea>\n }\n\n @if (useProjectedContent()) {\n <ng-content />\n }\n <mat-error>{{ errorMessage() }}</mat-error>\n @if (suffix()) {\n <mat-icon data-cy=\"suffix-icon\" (click)=\"suffixClicked()\" class=\"pointer mat-primary\" matSuffix>{{ suffix() }} </mat-icon>\n }\n @if (prefix()) {\n <mat-icon data-cy=\"prefix-icon\" (click)=\"prefixClicked()\" class=\"pointer mat-primary\" matPrefix>{{ prefix() }} </mat-icon>\n }\n @if (unit() && unitPosition() === 'left') {\n <span [style.padding-right]=\"'5px'\" matTextPrefix>{{ unit() }}</span>\n } @else if (unit() && textAlign() === 'right') {\n <span [style.padding-left]=\"'25px'\" matTextSuffix>{{ unit() }}</span>\n }\n</mat-form-field>\n", styles: ["mat-form-field{width:100%;width:-moz-available;width:-webkit-fill-available;width:stretch}mat-label{line-height:1.4}span[matPrefix]{padding-right:5px}span[matSuffix]{padding-left:5px}.text-left{text-align:left}.text-right{text-align:right}.multiline{resize:none}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { 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: "directive", type: i3.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: TextFieldModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: SizeChangeDirective, selector: "[madSizeChange]", outputs: ["madSizeChange"] }] }); }
663
762
  }
664
763
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ReadOnlyFormFieldComponent, decorators: [{
665
764
  type: Component,
@@ -894,251 +993,709 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
894
993
  }]
895
994
  }] });
896
995
 
996
+ function mapNormalizedSelection(selection, context) {
997
+ const { rawValue, normalizedValue, formattedValue, groupingSeparator, decimalSeparator } = context;
998
+ const isExponent = /^[+\-0-9.,]+[eE][+-]?[0-9]+$/.test(rawValue) && normalizedValue !== '';
999
+ const mapPosition = (position) => {
1000
+ if (position <= 0) {
1001
+ return 0;
1002
+ }
1003
+ if (position >= rawValue.length) {
1004
+ return formattedValue.length;
1005
+ }
1006
+ if (isExponent) {
1007
+ // An exponent is one literal, not independently parseable prefixes. Spread its
1008
+ // interior boundaries monotonically across the complete expanded display.
1009
+ return Math.ceil((position / rawValue.length) * formattedValue.length);
1010
+ }
1011
+ let retained = 0;
1012
+ for (let index = 0; index < position && retained < normalizedValue.length; index++) {
1013
+ if (rawValue.charAt(index) === normalizedValue.charAt(retained)) {
1014
+ retained++;
1015
+ }
1016
+ }
1017
+ let formattedPosition = 0;
1018
+ let normalizedPosition = 0;
1019
+ while (formattedPosition < formattedValue.length && normalizedPosition < retained) {
1020
+ if (formattedValue.charAt(formattedPosition) === normalizedValue.charAt(normalizedPosition)) {
1021
+ normalizedPosition++;
1022
+ }
1023
+ formattedPosition++;
1024
+ }
1025
+ if (groupingSeparator !== decimalSeparator &&
1026
+ rawValue.charAt(position - 1) === groupingSeparator &&
1027
+ formattedValue.charAt(formattedPosition) === groupingSeparator) {
1028
+ formattedPosition++;
1029
+ }
1030
+ return formattedPosition;
1031
+ };
1032
+ const start = mapPosition(selection.start);
1033
+ const end = mapPosition(selection.end);
1034
+ return { start: Math.min(start, end), end: Math.max(start, end) };
1035
+ }
1036
+
1037
+ class NumericFieldUnitPresentation {
1038
+ constructor(inputElement, renderer, onResize) {
1039
+ this.inputElement = inputElement;
1040
+ this.renderer = renderer;
1041
+ this.onResize = onResize;
1042
+ this.options = { unit: null, unitPosition: 'right', textAlign: 'right', text: '' };
1043
+ this.layoutDirty = true;
1044
+ }
1045
+ invalidateLayout() {
1046
+ this.layoutDirty = true;
1047
+ }
1048
+ destroy() {
1049
+ this.removeUnitSpan();
1050
+ this.removeTextSpan();
1051
+ }
1052
+ render(options, label) {
1053
+ if (this.options.unit !== options.unit ||
1054
+ this.options.unitPosition !== options.unitPosition ||
1055
+ this.options.textAlign !== options.textAlign ||
1056
+ this.options.text !== options.text ||
1057
+ (!!options.unit && !this.unitSpan)) {
1058
+ this.updateUnit(options);
1059
+ }
1060
+ // Restoring natural sizing and applying measured text depend on intervening
1061
+ // DOM reads. The directive deliberately schedules the whole transaction as mixedReadWrite.
1062
+ const presentation = this.measurePresentation(label);
1063
+ const layout = this.applyPresentation(presentation);
1064
+ this.positionTrailingUnit(layout);
1065
+ }
1066
+ updateUnit(options) {
1067
+ this.options = options;
1068
+ this.layoutDirty = true;
1069
+ if (!this.options.unit) {
1070
+ this.removeUnitSpan();
1071
+ return;
1072
+ }
1073
+ if (!this.unitSpan || this.unitSpanPosition !== this.options.unitPosition) {
1074
+ this.createUnitSpan();
1075
+ }
1076
+ if (!this.unitSpan) {
1077
+ return;
1078
+ }
1079
+ if (this.options.textAlign !== 'left' || this.options.unitPosition !== 'right' || this.options.text === '') {
1080
+ this.restoreInputReservation();
1081
+ }
1082
+ this.observeUnitSize();
1083
+ this.unitSpan.textContent = this.options.unit;
1084
+ if (this.options.textAlign === 'left' && this.options.unitPosition === 'right') {
1085
+ this.unitSpan.style.display = this.options.text !== '' ? 'unset' : 'none';
1086
+ this.unitSpan.style.position = 'absolute';
1087
+ }
1088
+ else {
1089
+ this.unitSpan.style.display = '';
1090
+ this.unitSpan.style.left = '';
1091
+ this.unitSpan.style.position = '';
1092
+ }
1093
+ }
1094
+ createUnitSpan() {
1095
+ const unitContainer = this.getUnitContainer();
1096
+ if (!unitContainer) {
1097
+ return;
1098
+ }
1099
+ this.removeUnitSpan();
1100
+ this.unitSpan = this.renderer.createElement('span');
1101
+ this.unitSpanPosition = this.options.unitPosition;
1102
+ this.renderer.addClass(this.unitSpan, 'mad-numeric-field-unit');
1103
+ // Native compatibility spans; these attributes do not instantiate Material directives.
1104
+ if (this.options.unitPosition === 'left') {
1105
+ this.renderer.setAttribute(this.unitSpan, 'matPrefix', '');
1106
+ this.renderer.setAttribute(this.unitSpan, 'matTextPrefix', '');
1107
+ this.renderer.setStyle(this.unitSpan, 'padding-right', '5px');
1108
+ this.renderer.insertBefore(unitContainer, this.unitSpan, this.getUnitInsertReference(unitContainer));
1109
+ }
1110
+ else {
1111
+ this.renderer.setAttribute(this.unitSpan, 'matSuffix', '');
1112
+ this.renderer.setAttribute(this.unitSpan, 'matTextSuffix', '');
1113
+ this.renderer.setStyle(this.unitSpan, 'padding-left', '5px');
1114
+ this.renderer.appendChild(unitContainer, this.unitSpan);
1115
+ }
1116
+ }
1117
+ getUnitContainer() {
1118
+ const materialFormFieldFlex = this.inputElement.closest('.mat-mdc-form-field-flex');
1119
+ if (materialFormFieldFlex instanceof HTMLElement) {
1120
+ return materialFormFieldFlex;
1121
+ }
1122
+ return this.inputElement.parentElement;
1123
+ }
1124
+ getUnitInsertReference(unitContainer) {
1125
+ if (this.inputElement.parentElement?.parentElement === unitContainer) {
1126
+ return this.inputElement.parentElement;
1127
+ }
1128
+ if (this.inputElement.parentElement === unitContainer) {
1129
+ return this.inputElement;
1130
+ }
1131
+ return null;
1132
+ }
1133
+ measurePresentation(label) {
1134
+ if (!this.unitSpan) {
1135
+ return undefined;
1136
+ }
1137
+ // Measure the consumer's authored width, including responsive CSS, before
1138
+ // reserving space. Restoration and reapplication finish in this render, so
1139
+ // the observed border box stays unchanged and no intermediate style paints.
1140
+ if (this.layoutDirty) {
1141
+ this.restoreInputReservation();
1142
+ }
1143
+ const view = this.inputElement.ownerDocument.defaultView;
1144
+ if (!view) {
1145
+ return undefined;
1146
+ }
1147
+ const inputStyles = view.getComputedStyle(this.inputElement);
1148
+ const restingLabel = this.readRestingLabel(label);
1149
+ const refreshLayout = this.layoutDirty;
1150
+ this.layoutDirty = false;
1151
+ if (!refreshLayout || this.options.textAlign !== 'left' || this.options.unitPosition !== 'right' || !this.inputElement.parentElement) {
1152
+ return { color: inputStyles.color, label: restingLabel };
1153
+ }
1154
+ const parentStyles = view.getComputedStyle(this.inputElement.parentElement);
1155
+ const offsetParent = this.unitSpan.offsetParent;
1156
+ const inputBounds = this.inputElement.getBoundingClientRect();
1157
+ const inputOffset = offsetParent instanceof HTMLElement ? inputBounds.left - offsetParent.getBoundingClientRect().left - offsetParent.clientLeft : 0;
1158
+ return {
1159
+ color: inputStyles.color,
1160
+ label: restingLabel,
1161
+ layout: {
1162
+ text: this.options.text,
1163
+ font: inputStyles.font,
1164
+ fontSize: inputStyles.fontSize,
1165
+ letterSpacing: inputStyles.letterSpacing,
1166
+ marginTop: parentStyles.getPropertyValue('border-top-width'),
1167
+ paddingTop: parentStyles.getPropertyValue('padding-top'),
1168
+ paddingBottom: parentStyles.getPropertyValue('padding-bottom'),
1169
+ inputWidth: this.inputElement.clientWidth,
1170
+ inputOffset,
1171
+ paddingLeft: Number.parseFloat(inputStyles.paddingLeft) || 0,
1172
+ paddingRight: Number.parseFloat(inputStyles.paddingRight) || 0,
1173
+ outerWidth: inputBounds.width ||
1174
+ this.inputElement.clientWidth +
1175
+ (Number.parseFloat(inputStyles.borderLeftWidth) || 0) +
1176
+ (Number.parseFloat(inputStyles.borderRightWidth) || 0),
1177
+ borderLeft: Number.parseFloat(inputStyles.borderLeftWidth) || 0,
1178
+ unitWidth: this.unitSpan.clientWidth,
1179
+ },
1180
+ };
1181
+ }
1182
+ applyPresentation(presentation) {
1183
+ if (!presentation || !this.unitSpan) {
1184
+ return undefined;
1185
+ }
1186
+ this.writeRestingLabel(presentation.label);
1187
+ // Read the actual input color so filled/outlined themes and native disabled bindings agree.
1188
+ if (this.unitSpan.style.color !== presentation.color) {
1189
+ this.unitSpan.style.color = presentation.color;
1190
+ }
1191
+ const layout = presentation.layout;
1192
+ if (!layout) {
1193
+ return undefined;
1194
+ }
1195
+ if (layout.text !== '') {
1196
+ this.reserveInputSpace(layout);
1197
+ }
1198
+ this.unitSpan.style.marginTop = layout.marginTop;
1199
+ this.unitSpan.style.paddingTop = layout.paddingTop;
1200
+ this.unitSpan.style.paddingBottom = layout.paddingBottom;
1201
+ this.ensureTextSpan();
1202
+ if (this.textSpan) {
1203
+ this.textSpan.style.font = layout.font;
1204
+ this.textSpan.style.fontSize = layout.fontSize;
1205
+ this.textSpan.style.letterSpacing = layout.letterSpacing;
1206
+ this.textSpan.textContent = layout.text;
1207
+ }
1208
+ return layout;
1209
+ }
1210
+ positionTrailingUnit(layout) {
1211
+ if (!layout || !this.textSpan || !this.unitSpan) {
1212
+ return;
1213
+ }
1214
+ const textWidth = layout.inputWidth - layout.paddingLeft - layout.paddingRight - layout.unitWidth;
1215
+ const width = Math.min(textWidth, Math.ceil(this.textSpan.clientWidth));
1216
+ this.unitSpan.style.left = `${layout.inputOffset + layout.borderLeft + layout.paddingLeft + Math.max(width, 0)}px`;
1217
+ }
1218
+ observeUnitSize() {
1219
+ const Observer = this.inputElement.ownerDocument.defaultView?.ResizeObserver;
1220
+ if (this.resizeObserver || !Observer || !this.unitSpan) {
1221
+ return;
1222
+ }
1223
+ this.resizeObserver = new Observer(() => {
1224
+ this.layoutDirty = true;
1225
+ this.onResize();
1226
+ });
1227
+ // Padding changes the content box, not the border box. The parent also
1228
+ // detects responsive sizing while the input holds its measured outer width.
1229
+ this.resizeObserver.observe(this.inputElement, { box: 'border-box' });
1230
+ if (this.inputElement.parentElement) {
1231
+ this.resizeObserver.observe(this.inputElement.parentElement);
1232
+ }
1233
+ this.resizeObserver.observe(this.unitSpan);
1234
+ }
1235
+ reserveInputSpace(layout) {
1236
+ const style = this.inputElement.style;
1237
+ this.inputReservation ??= ['width', 'box-sizing', 'padding-right'].map((property) => this.captureStyle(style, property));
1238
+ style.setProperty('box-sizing', 'border-box');
1239
+ style.setProperty('width', `${layout.outerWidth}px`);
1240
+ // unitWidth includes the unit span's existing five-pixel leading gap.
1241
+ style.setProperty('padding-right', `${layout.paddingRight + layout.unitWidth}px`);
1242
+ // Read back CSSOM declarations so ownership compares browser-canonical values.
1243
+ for (const reservation of this.inputReservation) {
1244
+ reservation.appliedValue = style.getPropertyValue(reservation.property);
1245
+ reservation.appliedPriority = style.getPropertyPriority(reservation.property);
1246
+ }
1247
+ }
1248
+ restoreInputReservation() {
1249
+ this.restoreStyles(this.inputElement.style, this.inputReservation ?? []);
1250
+ this.inputReservation = undefined;
1251
+ }
1252
+ readRestingLabel(label) {
1253
+ const labelId = label.id;
1254
+ if (!labelId || label.floating) {
1255
+ return undefined;
1256
+ }
1257
+ const element = this.inputElement.ownerDocument.getElementById(labelId);
1258
+ if (!element) {
1259
+ return undefined;
1260
+ }
1261
+ const margin = this.labelStyles?.properties.find((property) => property.property === 'margin-left');
1262
+ const previousShift = margin && this.ownsStyle(element.style, margin) ? (this.labelStyles?.shift ?? 0) : 0;
1263
+ return {
1264
+ element,
1265
+ width: this.inputElement.clientWidth,
1266
+ shift: this.options.unitPosition === 'left'
1267
+ ? previousShift + this.inputElement.getBoundingClientRect().left - element.getBoundingClientRect().left
1268
+ : 0,
1269
+ };
1270
+ }
1271
+ writeRestingLabel(label) {
1272
+ if (this.labelStyles?.element !== label?.element) {
1273
+ this.restoreLabelStyles();
1274
+ }
1275
+ if (!label) {
1276
+ return;
1277
+ }
1278
+ if (!this.labelStyles) {
1279
+ this.labelStyles = {
1280
+ element: label.element,
1281
+ properties: [this.captureStyle(label.element.style, 'max-width')],
1282
+ shift: 0,
1283
+ };
1284
+ }
1285
+ const style = label.element.style;
1286
+ if (this.options.unitPosition === 'left' && !this.labelStyles.properties.some(({ property }) => property === 'margin-left')) {
1287
+ this.labelStyles.properties.push(this.captureStyle(style, 'margin-left'));
1288
+ }
1289
+ // Keep newer consumer declarations as the restoration baseline, including
1290
+ // priority-only changes. Right units never take ownership of margin-left.
1291
+ for (const property of this.labelStyles.properties) {
1292
+ if (!this.ownsStyle(style, property)) {
1293
+ property.value = style.getPropertyValue(property.property);
1294
+ property.priority = style.getPropertyPriority(property.property);
1295
+ }
1296
+ }
1297
+ // Material owns truncation and floating transforms. Limit only the resting
1298
+ // label to the input's available space, using its public label relationship.
1299
+ style.setProperty('max-width', `${label.width}px`);
1300
+ if (this.options.unitPosition === 'left') {
1301
+ this.labelStyles.shift = label.shift;
1302
+ const margin = this.labelStyles.properties.find(({ property }) => property === 'margin-left');
1303
+ style.setProperty('margin-left', `calc(${margin?.value || '0px'} + ${label.shift}px)`);
1304
+ }
1305
+ for (const property of this.labelStyles.properties) {
1306
+ property.appliedValue = style.getPropertyValue(property.property);
1307
+ property.appliedPriority = style.getPropertyPriority(property.property);
1308
+ }
1309
+ }
1310
+ restoreLabelStyles() {
1311
+ if (this.labelStyles) {
1312
+ this.restoreStyles(this.labelStyles.element.style, this.labelStyles.properties);
1313
+ this.labelStyles = undefined;
1314
+ }
1315
+ }
1316
+ captureStyle(style, property) {
1317
+ return {
1318
+ property,
1319
+ value: style.getPropertyValue(property),
1320
+ priority: style.getPropertyPriority(property),
1321
+ appliedValue: '',
1322
+ appliedPriority: '',
1323
+ };
1324
+ }
1325
+ ownsStyle(style, snapshot) {
1326
+ return (style.getPropertyValue(snapshot.property) === snapshot.appliedValue &&
1327
+ style.getPropertyPriority(snapshot.property) === snapshot.appliedPriority);
1328
+ }
1329
+ restoreStyles(style, snapshots) {
1330
+ for (const snapshot of snapshots) {
1331
+ if (!this.ownsStyle(style, snapshot)) {
1332
+ continue;
1333
+ }
1334
+ if (snapshot.value) {
1335
+ style.setProperty(snapshot.property, snapshot.value, snapshot.priority);
1336
+ }
1337
+ else {
1338
+ style.removeProperty(snapshot.property);
1339
+ }
1340
+ }
1341
+ }
1342
+ ensureTextSpan() {
1343
+ if (this.textSpan) {
1344
+ return;
1345
+ }
1346
+ const document = this.inputElement.ownerDocument;
1347
+ this.textSpan = document.createElement('span');
1348
+ document.body.appendChild(this.textSpan);
1349
+ this.textSpan.style.height = 'auto';
1350
+ this.textSpan.style.width = 'auto';
1351
+ this.textSpan.style.position = 'absolute';
1352
+ this.textSpan.style.top = '0';
1353
+ this.textSpan.style.whiteSpace = 'nowrap';
1354
+ this.textSpan.style.visibility = 'hidden';
1355
+ }
1356
+ removeUnitSpan() {
1357
+ this.resizeObserver?.disconnect();
1358
+ this.resizeObserver = undefined;
1359
+ this.restoreLabelStyles();
1360
+ this.restoreInputReservation();
1361
+ if (!this.unitSpan) {
1362
+ return;
1363
+ }
1364
+ this.unitSpan.remove();
1365
+ this.unitSpan = undefined;
1366
+ this.unitSpanPosition = undefined;
1367
+ }
1368
+ removeTextSpan() {
1369
+ if (!this.textSpan) {
1370
+ return;
1371
+ }
1372
+ this.textSpan.remove();
1373
+ this.textSpan = undefined;
1374
+ }
1375
+ }
1376
+
897
1377
  /*
898
1378
  * Copyright (c) 2018-2020 Porsche Informatik. All Rights Reserved.
899
1379
  * This software is released under MIT license.
900
1380
  * The full license information can be found in LICENSE in the root directory of this project.
901
1381
  */
902
- const BACK_KEYCODE = 8;
903
- const SPACE_KEYCODE = 32;
904
- const DEL_KEYCODE = 46;
905
- const CONTROL_KEYCODES_UPPER_BORDER = 46;
906
- const OTHER_CONTROL_KEYS = new Set([224, 91, 93]);
1382
+ const CONTROL_KEYS = new Set([
1383
+ 'Backspace',
1384
+ 'Delete',
1385
+ 'Tab',
1386
+ 'Escape',
1387
+ 'Enter',
1388
+ 'Home',
1389
+ 'End',
1390
+ 'ArrowLeft',
1391
+ 'ArrowRight',
1392
+ 'ArrowUp',
1393
+ 'ArrowDown',
1394
+ ]);
1395
+ const UNSET_NUMERIC_VALUE = Symbol('unset numeric value input');
907
1396
  class NumericFieldDirective {
908
- set numericValue(value) {
909
- if (this._numericValue !== value && !(isNaN(this._numericValue) && (isNaN(value) || value === null))) {
910
- this.originalValue = value;
911
- // Don't roundOrTruncate if value was set to empty otherwise input value will be set to 0 instead of empty
912
- // which happens when an input is being reset
913
- this._numericValue = value === null || value === undefined ? value : this.roundOrTruncate(value); // eslint-disable-line
914
- this.handleInputChanged();
915
- }
916
- }
917
- constructor(renderer, inputEl, numberFormatService) {
918
- this.renderer = renderer;
919
- this.inputEl = inputEl;
920
- this.numberFormatService = numberFormatService;
921
- this.textAlign = 'right';
922
- this.decimalPlaces = 2;
923
- this.roundValue = false;
924
- this.autofillDecimals = false;
925
- this.unit = null;
926
- this.unitPosition = 'right';
927
- this.numericValueChanged = new EventEmitter();
1397
+ constructor() {
1398
+ this.textAlign = input('right', /* @ts-ignore */
1399
+ ...(ngDevMode ? [{ debugName: "textAlign" }] : /* istanbul ignore next */ []));
1400
+ this.decimalPlaces = input(NumberFormatService.DEFAULT_DECIMAL_PLACES, { ...(ngDevMode ? { debugName: "decimalPlaces" } : /* istanbul ignore next */ {}), transform: normalizeDecimalPlaces });
1401
+ this.roundValue = input(false, { ...(ngDevMode ? { debugName: "roundValue" } : /* istanbul ignore next */ {}), alias: 'roundDisplayValue', transform: booleanAttribute });
1402
+ this.autofillDecimals = input(false, { ...(ngDevMode ? { debugName: "autofillDecimals" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1403
+ this.unit = input(null, /* @ts-ignore */
1404
+ ...(ngDevMode ? [{ debugName: "unit" }] : /* istanbul ignore next */ []));
1405
+ this.unitPosition = input('right', /* @ts-ignore */
1406
+ ...(ngDevMode ? [{ debugName: "unitPosition" }] : /* istanbul ignore next */ []));
1407
+ this.numericValue = input(UNSET_NUMERIC_VALUE, { ...(ngDevMode ? { debugName: "numericValue" } : /* istanbul ignore next */ {}), transform: (value) => value });
1408
+ this.numericValueChanged = output({ alias: 'numericValueChange' });
1409
+ this.changeDetectorRef = inject(ChangeDetectorRef);
1410
+ this.formField = inject(MatFormField, { optional: true });
1411
+ this.renderer = inject(Renderer2);
1412
+ this.inputEl = inject(ElementRef);
1413
+ this.numberFormatService = inject(NumberFormatService);
1414
+ this.injector = inject(Injector);
1415
+ this.unitPresentation = new NumericFieldUnitPresentation(this.inputElement, this.renderer, () => this.changeDetectorRef.markForCheck());
1416
+ this.changeFn = () => { };
1417
+ this.touchedFn = () => { };
928
1418
  this.displayValue = '';
929
- this.originalValue = NaN;
930
- /* Control Values Accessor Stuff below */
931
- // eslint-disable-next-line
932
- this.onChange = () => { };
933
- // eslint-disable-next-line
934
- this.onTouched = () => { };
1419
+ this.matInput = null;
1420
+ this.formatOptionsInitialized = false;
1421
+ this.numericValueEffect = effect(() => {
1422
+ const value = this.numericValue();
1423
+ // A two-way binding echo must preserve unfinished text and the user's caret.
1424
+ if (value !== UNSET_NUMERIC_VALUE && !Object.is(value, this.acceptedValue)) {
1425
+ untracked(() => this.applyExternalValue(value));
1426
+ }
1427
+ }, /* @ts-ignore */
1428
+ ...(ngDevMode ? [{ debugName: "numericValueEffect" }] : /* istanbul ignore next */ []));
1429
+ this.formatOptionsEffect = effect(() => {
1430
+ this.decimalPlaces();
1431
+ this.autofillDecimals();
1432
+ this.roundValue();
1433
+ this.numberFormatService.decimalSeparator;
1434
+ this.numberFormatService.groupingSeparator;
1435
+ this.numberFormatService.allowedKeys;
1436
+ if (this.formatOptionsInitialized) {
1437
+ untracked(() => this.renderCurrentValue());
1438
+ }
1439
+ else {
1440
+ this.formatOptionsInitialized = true;
1441
+ }
1442
+ }, /* @ts-ignore */
1443
+ ...(ngDevMode ? [{ debugName: "formatOptionsEffect" }] : /* istanbul ignore next */ []));
1444
+ // Unit layout restores consumer styles before measuring and then measures its
1445
+ // updated text. Keep that dependent transaction in one render, without delaying CVA.
1446
+ this.unitRendering = afterEveryRender({
1447
+ mixedReadWrite: () => this.unitPresentation.render({
1448
+ unit: this.unit(),
1449
+ unitPosition: this.unitPosition(),
1450
+ textAlign: this.textAlign(),
1451
+ text: this.displayValue,
1452
+ }, {
1453
+ id: this.formField?.getLabelId(),
1454
+ floating: this.formField?.floatLabel === 'always' || !!this.matInput?.shouldLabelFloat,
1455
+ }),
1456
+ });
1457
+ }
1458
+ get inputElement() {
1459
+ return this.inputEl.nativeElement;
935
1460
  }
936
1461
  registerOnChange(fn) {
937
- this.onChange = fn;
1462
+ this.changeFn = fn;
938
1463
  }
939
1464
  registerOnTouched(fn) {
940
- this.onTouched = fn;
1465
+ this.touchedFn = fn;
941
1466
  }
942
- setDisabledState() {
943
- // Dont need to implement since its just a directive
1467
+ setDisabledState(isDisabled) {
1468
+ this.renderer.setProperty(this.inputElement, 'disabled', isDisabled);
944
1469
  }
945
1470
  writeValue(value) {
946
- this.numericValue = value;
1471
+ untracked(() => this.applyExternalValue(value));
947
1472
  }
948
- ngOnInit() {
949
- /* needs to be parsed as number explicitly as it comes as string from user input */
950
- this.decimalPlaces = parseInt(this.decimalPlaces.toString(), 10);
951
- this.inputChangeListener = this.renderer.listen(this.inputEl.nativeElement, 'blur', (event) => {
952
- this.formatInput(event.target, true);
953
- });
954
- this.keyupListener = this.renderer.listen(this.inputEl.nativeElement, 'keyup', (event) => {
955
- if (event.keyCode === BACK_KEYCODE || (event.keyCode >= CONTROL_KEYCODES_UPPER_BORDER && !OTHER_CONTROL_KEYS.has(event.keyCode))) {
956
- this.formatInput(event.target, false);
957
- }
958
- });
959
- this.keydownListener = this.renderer.listen(this.inputEl.nativeElement, 'keydown', (event) => {
960
- const value = event.target.value;
961
- if (this.numberFormatService.allowedKeys.includes(event.key) ||
962
- (event.keyCode <= CONTROL_KEYCODES_UPPER_BORDER && event.keyCode > 0 && event.keyCode !== SPACE_KEYCODE) ||
963
- event.metaKey ||
964
- event.ctrlKey ||
965
- event.altKey) {
966
- /* allow negative sign only as first character and none exists outside of text selection */
967
- const indexNegativeSign = value.indexOf(NumberFormatService.NEGATIVE);
968
- if (event.key === NumberFormatService.NEGATIVE &&
969
- (event.target.selectionStart > 0 || indexNegativeSign > -1) &&
970
- (event.target.selectionStart === event.target.selectionEnd ||
971
- !(indexNegativeSign >= event.target.selectionStart && indexNegativeSign <= event.target.selectionEnd))) {
972
- return false;
973
- }
974
- /* no duplicate decimal separators */
975
- const indexDecimalSep = value.indexOf(this.numberFormatService.decimalSeparator);
976
- if (event.key === this.numberFormatService.decimalSeparator &&
977
- (indexDecimalSep > -1 || this.decimalPlaces === 0) &&
978
- (event.target.selectionStart === event.target.selectionEnd ||
979
- !(indexDecimalSep >= event.target.selectionStart && indexDecimalSep <= event.target.selectionEnd))) {
980
- return false;
981
- }
982
- /* prevent too many decimal places */
983
- if (NumberFormatService.NUMBERS.includes(event.key) &&
984
- indexDecimalSep > -1 &&
985
- indexDecimalSep < event.target.selectionStart &&
986
- event.target.selectionStart === event.target.selectionEnd &&
987
- value.length > indexDecimalSep + this.decimalPlaces) {
988
- return false;
989
- }
990
- /* when deleting thousand separator, remove the digit before or after it */
991
- const cursorStart = event.target.selectionStart;
992
- if (cursorStart === event.target.selectionEnd) {
993
- if (event.keyCode === BACK_KEYCODE && value.substr(cursorStart - 1, 1) === this.numberFormatService.groupingSeparator) {
994
- event.target.value = value.substring(0, cursorStart - 2) + value.substring(cursorStart - 1, value.length);
995
- event.target.selectionStart = event.target.selectionEnd = cursorStart - 1;
996
- return false;
997
- }
998
- else if (event.keyCode === DEL_KEYCODE && value.substr(cursorStart, 1) === this.numberFormatService.groupingSeparator) {
999
- event.target.value = value.substring(0, cursorStart + 1) + value.substring(cursorStart + 2, value.length);
1000
- event.target.selectionStart = event.target.selectionEnd = cursorStart + 1;
1001
- return false;
1002
- }
1003
- }
1004
- this.originalValue = NaN;
1005
- }
1006
- else {
1007
- return false;
1008
- }
1009
- return true;
1010
- });
1473
+ ngAfterViewInit() {
1474
+ // Resolve after construction: MatInput also participates in forms injection.
1475
+ this.matInput = this.injector.get(MatInput, null, { self: true, optional: true });
1476
+ this.notifyMatInputStateChanged();
1011
1477
  }
1012
1478
  ngOnDestroy() {
1013
- this.detachListener();
1479
+ this.unitPresentation.destroy();
1014
1480
  }
1015
- ngAfterViewChecked() {
1016
- // Only needed to create the unitSpan or refresh the unit
1017
- if (!this.unitSpan || this.unitSpan.textContent !== this.unit) {
1018
- this.injectUnitSymbol();
1481
+ handleChangeEvent() {
1482
+ if (!this.inputElement.readOnly && !this.inputElement.disabled) {
1483
+ this.changeFn(this.getValueForFormControl());
1019
1484
  }
1020
1485
  }
1021
- handleInputChanged() {
1022
- // Call in set timeout to avoid Expression has changed after it has been checked error.
1023
- // Sometimes the value changes because we cut off decimal places
1024
- setTimeout(() => {
1025
- this.updateInput(this.numberFormatService.format(this._numericValue, {
1026
- decimalPlaces: this.decimalPlaces,
1027
- finalFormatting: true,
1028
- autofillDecimals: this.autofillDecimals,
1029
- }));
1030
- }, 1);
1486
+ handleInputEvent() {
1487
+ this.handleChangeEvent();
1488
+ }
1489
+ handleBlurEvent() {
1490
+ if (this.inputElement.disabled) {
1491
+ return;
1492
+ }
1493
+ this.formatInput(this.inputElement, true);
1494
+ this.touchedFn();
1495
+ }
1496
+ handleKeyDown(event) {
1497
+ const element = this.getEventInput(event);
1498
+ const value = element.value;
1499
+ if (element.readOnly || element.disabled) {
1500
+ return true;
1501
+ }
1502
+ if (event.metaKey || event.ctrlKey || event.altKey || CONTROL_KEYS.has(event.key)) {
1503
+ return this.handleControlKeyDown(event, element, value);
1504
+ }
1505
+ if (!this.numberFormatService.allowedKeys.includes(event.key)) {
1506
+ return this.preventDefault(event);
1507
+ }
1508
+ if (!this.isValidNegativeSign(event, element, value)) {
1509
+ return this.preventDefault(event);
1510
+ }
1511
+ if (!this.isValidDecimalSeparator(event, element, value)) {
1512
+ return this.preventDefault(event);
1513
+ }
1514
+ if (!this.isValidDecimalPlace(event, element, value)) {
1515
+ return this.preventDefault(event);
1516
+ }
1517
+ return true;
1518
+ }
1519
+ handleKeyUp(event) {
1520
+ if (event.metaKey || event.ctrlKey || event.altKey) {
1521
+ return;
1522
+ }
1523
+ if (event.key === 'Backspace' || event.key === 'Delete' || this.numberFormatService.allowedKeys.includes(event.key)) {
1524
+ this.formatInput(this.getEventInput(event), false);
1525
+ }
1031
1526
  }
1032
1527
  formatInput(element, finalFormatting) {
1033
- const cursorPos = element.selectionStart;
1034
- const length = element.value.length;
1035
- const setCursor = this.displayValue !== element.value;
1036
- const textFormatted = this.numberFormatService.formatNumber(element.value, {
1037
- decimalPlaces: this.decimalPlaces,
1528
+ if (element.readOnly || element.disabled) {
1529
+ return;
1530
+ }
1531
+ const acceptValue = this.formatInputValue(element, finalFormatting, this.displayValue !== element.value);
1532
+ if (acceptValue) {
1533
+ this.changeFn(this.acceptedFormValue());
1534
+ }
1535
+ }
1536
+ updateInput(value) {
1537
+ this.writeDisplayValue(value);
1538
+ this.updateNumericValue(value);
1539
+ }
1540
+ getValueForFormControl() {
1541
+ this.formatInputValue(this.inputElement, false, true);
1542
+ return this.acceptedFormValue();
1543
+ }
1544
+ acceptedFormValue() {
1545
+ return typeof this.acceptedValue === 'number' && Number.isFinite(this.acceptedValue) ? this.acceptedValue : undefined;
1546
+ }
1547
+ formatInputValue(element, finalFormatting, acceptValue) {
1548
+ const rawValue = element.value;
1549
+ const { start, end } = this.getSelection(element);
1550
+ const direction = element.selectionDirection;
1551
+ const textFormatted = this.numberFormatService.formatNumber(rawValue, {
1552
+ decimalPlaces: this.decimalPlaces(),
1038
1553
  finalFormatting,
1039
- autofillDecimals: this.autofillDecimals,
1554
+ autofillDecimals: this.autofillDecimals(),
1040
1555
  });
1041
- // special handling to move unit symbol along with display value
1042
- if (this.textAlign === 'left' && this.unitPosition === 'right') {
1043
- const inputStyles = window.getComputedStyle(this.inputEl.nativeElement.parentElement, null);
1044
- this.unitSpan.style.position = 'absolute';
1045
- this.unitSpan.style.marginTop = inputStyles.getPropertyValue('border-top-width');
1046
- this.unitSpan.style.paddingTop = inputStyles.getPropertyValue('padding-top');
1047
- this.unitSpan.style.paddingBottom = inputStyles.getPropertyValue('padding-bottom');
1048
- if (!this.textSpan) {
1049
- this.textSpan = document.createElement('span');
1050
- document.body.appendChild(this.textSpan);
1051
- this.textSpan.style.font = inputStyles.getPropertyValue('font');
1052
- this.textSpan.style.fontSize = inputStyles.getPropertyValue('font-size');
1053
- this.textSpan.style.height = 'auto';
1054
- this.textSpan.style.width = 'auto';
1055
- this.textSpan.style.position = 'absolute';
1056
- this.textSpan.style.top = '0';
1057
- this.textSpan.style.whiteSpace = 'no-wrap';
1058
- this.textSpan.style.visibility = 'hidden';
1059
- }
1060
- this.textSpan.innerHTML = textFormatted;
1061
- const width = Math.min(this.inputEl.nativeElement.clientWidth - this.unitSpan.clientWidth, Math.ceil(this.textSpan.clientWidth));
1062
- this.unitSpan.style.left = width + 'px';
1556
+ // Final formatting can resolve an accepted invalid partial edit (e.g. ".")
1557
+ // to zero. Presentation-only changes to finite external values stay silent.
1558
+ const resolvesPartialEdit = finalFormatting &&
1559
+ Number.isNaN(this.acceptedValue) &&
1560
+ rawValue !== '' &&
1561
+ !Number.isFinite(this.parseNumericValue(rawValue)) &&
1562
+ Number.isFinite(this.parseNumericValue(textFormatted));
1563
+ const acceptsEdit = acceptValue || resolvesPartialEdit;
1564
+ if (acceptsEdit) {
1565
+ this.updateInput(textFormatted);
1063
1566
  }
1064
- this.updateInput(textFormatted);
1065
- if (setCursor) {
1066
- element.selectionStart = element.selectionEnd = Math.max(cursorPos + element.value.length - length, 0);
1567
+ else {
1568
+ this.writeDisplayValue(textFormatted);
1569
+ }
1570
+ if (rawValue !== textFormatted) {
1571
+ const mapped = mapNormalizedSelection({ start, end }, {
1572
+ rawValue,
1573
+ normalizedValue: this.numberFormatService.strip(rawValue, {
1574
+ decimalPlaces: this.decimalPlaces(),
1575
+ removeLeadingZeros: finalFormatting,
1576
+ }),
1577
+ formattedValue: textFormatted,
1578
+ groupingSeparator: this.numberFormatService.groupingSeparator,
1579
+ decimalSeparator: this.numberFormatService.decimalSeparator,
1580
+ });
1581
+ element.setSelectionRange(mapped.start, mapped.end, direction);
1067
1582
  }
1583
+ return acceptsEdit;
1068
1584
  }
1069
- updateInput(value) {
1585
+ writeDisplayValue(value) {
1070
1586
  this.displayValue = value;
1071
- this.inputEl.nativeElement.value = value;
1072
- this._numericValue = parseFloat(this.numberFormatService.strip(value, { decimalPlaces: this.decimalPlaces }).replace(this.numberFormatService.decimalSeparator, '.'));
1073
- if (this._numericValue !== this.roundOrTruncate(this.originalValue)) {
1074
- this.originalValue = this._numericValue;
1075
- this.numericValueChanged.emit(this._numericValue);
1587
+ this.unitPresentation.invalidateLayout();
1588
+ if (this.inputElement.value !== value) {
1589
+ this.inputElement.value = value;
1590
+ }
1591
+ this.notifyMatInputStateChanged();
1592
+ this.changeDetectorRef.markForCheck();
1593
+ }
1594
+ updateNumericValue(value) {
1595
+ const previousValue = this.acceptedValue;
1596
+ const parsedValue = this.parseNumericValue(value);
1597
+ this.acceptedValue = parsedValue;
1598
+ if (parsedValue !== previousValue) {
1599
+ this.numericValueChanged.emit(parsedValue);
1600
+ }
1601
+ }
1602
+ renderCurrentValue() {
1603
+ const value = this.acceptedValue;
1604
+ const displayNumber = typeof value === 'number' && Number.isFinite(value)
1605
+ ? roundOrTruncateNumber(value, this.decimalPlaces(), this.roundValue())
1606
+ : undefined;
1607
+ this.writeDisplayValue(this.numberFormatService.format(displayNumber, {
1608
+ decimalPlaces: this.decimalPlaces(),
1609
+ finalFormatting: true,
1610
+ autofillDecimals: this.autofillDecimals(),
1611
+ }));
1612
+ }
1613
+ applyExternalValue(value) {
1614
+ this.acceptedValue = value;
1615
+ this.renderCurrentValue();
1616
+ }
1617
+ handleControlKeyDown(event, element, value) {
1618
+ if (event.key !== 'Backspace' && event.key !== 'Delete') {
1619
+ return true;
1076
1620
  }
1077
- }
1078
- getValueForFormControl() {
1079
- this.formatInput(this.inputEl.nativeElement, false);
1080
- if (isNaN(this._numericValue)) {
1081
- // Return undefined instead of NaN to support the default required validator.
1082
- return undefined; // eslint-disable-line
1083
- }
1084
- return this._numericValue;
1085
- }
1086
- injectUnitSymbol() {
1087
- // Need to inject the unit symbol when the input element width is set to its actual value,
1088
- // otherwise the icon wont show in the correct position
1089
- if (!!this.unit && !this.unitSpan && this.inputEl.nativeElement.offsetWidth !== 0) {
1090
- // Get the input wrapper and apply necessary styles
1091
- const inputWrapper = this.inputEl.nativeElement.parentNode.parentNode;
1092
- // Create the span with unit symbol and apply necessary styles
1093
- this.unitSpan = this.renderer.createElement('span');
1094
- if (this.unitPosition === 'left') {
1095
- this.renderer.setAttribute(this.unitSpan, 'matPrefix', '');
1096
- this.renderer.setStyle(this.unitSpan, 'padding-right', '5px');
1097
- this.renderer.insertBefore(inputWrapper, this.unitSpan, inputWrapper.children[0]);
1098
- }
1099
- else {
1100
- this.renderer.setAttribute(this.unitSpan, 'matSuffix', '');
1101
- this.renderer.setStyle(this.unitSpan, 'padding-left', '5px');
1102
- this.renderer.appendChild(inputWrapper, this.unitSpan);
1103
- }
1621
+ const { start: cursorStart, end: cursorEnd } = this.getSelection(element);
1622
+ if (cursorStart !== cursorEnd) {
1623
+ return true;
1104
1624
  }
1105
- // do not display unit symbol if the unit should move along display value
1106
- if (!!this.unitSpan && this.textAlign === 'left' && this.unitPosition === 'right') {
1107
- if (NumberFormatService.valueIsSet(this.displayValue)) {
1108
- this.unitSpan.style.display = 'unset';
1109
- }
1110
- else {
1111
- this.unitSpan.style.display = 'none';
1112
- }
1625
+ if (event.key === 'Backspace' && value.charAt(cursorStart - 1) === this.numberFormatService.groupingSeparator) {
1626
+ element.value = value.substring(0, Math.max(cursorStart - 2, 0)) + value.substring(cursorStart - 1, value.length);
1627
+ this.updateInput(element.value);
1628
+ this.changeFn(this.acceptedFormValue());
1629
+ this.setCursorPosition(element, Math.max(cursorStart - 1, 0));
1630
+ return this.preventDefault(event);
1113
1631
  }
1114
- // always reset unit symbol
1115
- if (!!this.unitSpan) {
1116
- this.unitSpan.textContent = this.unit;
1632
+ if (event.key === 'Delete' && value.charAt(cursorStart) === this.numberFormatService.groupingSeparator) {
1633
+ element.value = value.substring(0, cursorStart + 1) + value.substring(cursorStart + 2, value.length);
1634
+ this.updateInput(element.value);
1635
+ this.changeFn(this.acceptedFormValue());
1636
+ this.setCursorPosition(element, cursorStart + 1);
1637
+ return this.preventDefault(event);
1117
1638
  }
1639
+ return true;
1118
1640
  }
1119
- detachListener() {
1120
- if (this.inputChangeListener) {
1121
- this.inputChangeListener();
1122
- delete this.inputChangeListener;
1641
+ isValidNegativeSign(event, element, value) {
1642
+ if (event.key !== NumberFormatService.NEGATIVE) {
1643
+ return true;
1123
1644
  }
1124
- if (this.keydownListener) {
1125
- this.keydownListener();
1126
- delete this.keydownListener;
1645
+ const { start: selectionStart, end: selectionEnd } = this.getSelection(element);
1646
+ const indexNegativeSign = value.indexOf(NumberFormatService.NEGATIVE);
1647
+ return (selectionStart === 0 &&
1648
+ (indexNegativeSign === -1 ||
1649
+ (selectionStart !== selectionEnd && indexNegativeSign >= selectionStart && indexNegativeSign < selectionEnd)));
1650
+ }
1651
+ isValidDecimalSeparator(event, element, value) {
1652
+ if (event.key !== this.numberFormatService.decimalSeparator) {
1653
+ return true;
1127
1654
  }
1128
- if (this.keyupListener) {
1129
- this.keyupListener();
1130
- delete this.keyupListener;
1655
+ const { start: selectionStart, end: selectionEnd } = this.getSelection(element);
1656
+ const indexDecimalSep = value.indexOf(this.numberFormatService.decimalSeparator);
1657
+ if (this.decimalPlaces() === 0) {
1658
+ return false;
1131
1659
  }
1660
+ return (indexDecimalSep === -1 ||
1661
+ (this.decimalPlaces() > 0 && selectionStart !== selectionEnd && indexDecimalSep >= selectionStart && indexDecimalSep < selectionEnd));
1132
1662
  }
1133
- roundOrTruncate(value) {
1134
- if (this.roundValue) {
1135
- return Math.round(value * Math.pow(10, this.decimalPlaces)) / Math.pow(10, this.decimalPlaces);
1663
+ isValidDecimalPlace(event, element, value) {
1664
+ if (!NumberFormatService.NUMBERS.includes(event.key)) {
1665
+ return true;
1136
1666
  }
1137
- const method = value < 0 ? 'ceil' : 'floor';
1138
- return Math[method](+(value * Math.pow(10, this.decimalPlaces)).toFixed(this.decimalPlaces)) / Math.pow(10, this.decimalPlaces);
1667
+ const { start: selectionStart, end: selectionEnd } = this.getSelection(element);
1668
+ const indexDecimalSep = value.indexOf(this.numberFormatService.decimalSeparator);
1669
+ return (indexDecimalSep === -1 ||
1670
+ indexDecimalSep >= selectionStart ||
1671
+ selectionStart !== selectionEnd ||
1672
+ value.length <= indexDecimalSep + this.decimalPlaces());
1673
+ }
1674
+ getSelection(element) {
1675
+ const start = element.selectionStart ?? 0;
1676
+ return { start, end: element.selectionEnd ?? start };
1677
+ }
1678
+ getEventInput(event) {
1679
+ return event.target instanceof HTMLInputElement ? event.target : this.inputElement;
1680
+ }
1681
+ preventDefault(event) {
1682
+ event.preventDefault();
1683
+ return false;
1684
+ }
1685
+ notifyMatInputStateChanged() {
1686
+ this.matInput?.stateChanges.next();
1687
+ }
1688
+ parseNumericValue(value) {
1689
+ const parsedValue = Number.parseFloat(this.numberFormatService
1690
+ .strip(value, { decimalPlaces: this.decimalPlaces() })
1691
+ .replace(this.numberFormatService.decimalSeparator, '.'));
1692
+ return Number.isFinite(parsedValue) ? parsedValue : NaN;
1139
1693
  }
1140
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NumericFieldDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: NumberFormatService }], target: i0.ɵɵFactoryTarget.Directive }); }
1141
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.4", type: NumericFieldDirective, isStandalone: true, selector: "[madNumericField]", inputs: { textAlign: "textAlign", decimalPlaces: "decimalPlaces", roundValue: ["roundDisplayValue", "roundValue"], autofillDecimals: "autofillDecimals", unit: "unit", unitPosition: "unitPosition", numericValue: "numericValue" }, outputs: { numericValueChanged: "numericValueChange" }, host: { listeners: { "change": "onChange(getValueForFormControl())", "input": "onChange(getValueForFormControl())", "blur": "onTouched()" }, properties: { "class.text-right": "textAlign === \"right\"" } }, providers: [
1694
+ setCursorPosition(element, position) {
1695
+ element.setSelectionRange(position, position);
1696
+ }
1697
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NumericFieldDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1698
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: NumericFieldDirective, isStandalone: true, selector: "[madNumericField]", inputs: { textAlign: { classPropertyName: "textAlign", publicName: "textAlign", isSignal: true, isRequired: false, transformFunction: null }, decimalPlaces: { classPropertyName: "decimalPlaces", publicName: "decimalPlaces", isSignal: true, isRequired: false, transformFunction: null }, roundValue: { classPropertyName: "roundValue", publicName: "roundDisplayValue", isSignal: true, isRequired: false, transformFunction: null }, autofillDecimals: { classPropertyName: "autofillDecimals", publicName: "autofillDecimals", isSignal: true, isRequired: false, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, unitPosition: { classPropertyName: "unitPosition", publicName: "unitPosition", isSignal: true, isRequired: false, transformFunction: null }, numericValue: { classPropertyName: "numericValue", publicName: "numericValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { numericValueChanged: "numericValueChange" }, host: { listeners: { "change": "handleChangeEvent()", "input": "handleInputEvent()", "blur": "handleBlurEvent()", "keydown": "handleKeyDown($event)", "keyup": "handleKeyUp($event)" }, properties: { "class.text-right": "textAlign() === \"right\"" } }, providers: [
1142
1699
  {
1143
1700
  provide: NG_VALUE_ACCESSOR,
1144
1701
  useExisting: forwardRef(() => NumericFieldDirective),
@@ -1151,10 +1708,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
1151
1708
  args: [{
1152
1709
  selector: '[madNumericField]',
1153
1710
  host: {
1154
- '[class.text-right]': 'textAlign === "right"',
1155
- '(change)': 'onChange(getValueForFormControl())',
1156
- '(input)': 'onChange(getValueForFormControl())',
1157
- '(blur)': 'onTouched()',
1711
+ '[class.text-right]': 'textAlign() === "right"',
1712
+ '(change)': 'handleChangeEvent()',
1713
+ '(input)': 'handleInputEvent()',
1714
+ '(blur)': 'handleBlurEvent()',
1715
+ '(keydown)': 'handleKeyDown($event)',
1716
+ '(keyup)': 'handleKeyUp($event)',
1158
1717
  },
1159
1718
  providers: [
1160
1719
  {
@@ -1163,33 +1722,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
1163
1722
  multi: true,
1164
1723
  },
1165
1724
  ],
1166
- standalone: true,
1167
1725
  }]
1168
- }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: NumberFormatService }], propDecorators: { textAlign: [{
1169
- type: Input,
1170
- args: ['textAlign']
1171
- }], decimalPlaces: [{
1172
- type: Input,
1173
- args: ['decimalPlaces']
1174
- }], roundValue: [{
1175
- type: Input,
1176
- args: ['roundDisplayValue']
1177
- }], autofillDecimals: [{
1178
- type: Input,
1179
- args: ['autofillDecimals']
1180
- }], unit: [{
1181
- type: Input,
1182
- args: ['unit']
1183
- }], unitPosition: [{
1184
- type: Input,
1185
- args: ['unitPosition']
1186
- }], numericValueChanged: [{
1187
- type: Output,
1188
- args: ['numericValueChange']
1189
- }], numericValue: [{
1190
- type: Input,
1191
- args: ['numericValue']
1192
- }] } });
1726
+ }], propDecorators: { textAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "textAlign", required: false }] }], decimalPlaces: [{ type: i0.Input, args: [{ isSignal: true, alias: "decimalPlaces", required: false }] }], roundValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "roundDisplayValue", required: false }] }], autofillDecimals: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofillDecimals", required: false }] }], unit: [{ type: i0.Input, args: [{ isSignal: true, alias: "unit", required: false }] }], unitPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "unitPosition", required: false }] }], numericValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "numericValue", required: false }] }], numericValueChanged: [{ type: i0.Output, args: ["numericValueChange"] }] } });
1193
1727
 
1194
1728
  class NumericFieldModule {
1195
1729
  static forRoot() {
@@ -1298,7 +1832,7 @@ class CardComponent {
1298
1832
  this.expanded.update((expanded) => !expanded);
1299
1833
  }
1300
1834
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1301
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: CardComponent, isStandalone: true, selector: "mad-card", inputs: { cancelDisabled: { classPropertyName: "cancelDisabled", publicName: "cancelDisabled", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, editText: { classPropertyName: "editText", publicName: "editText", isSignal: true, isRequired: false, transformFunction: null }, expandable: { classPropertyName: "expandable", publicName: "expandable", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, saveDisabled: { classPropertyName: "saveDisabled", publicName: "saveDisabled", isSignal: true, isRequired: false, transformFunction: null }, saveText: { classPropertyName: "saveText", publicName: "saveText", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, editMode: { classPropertyName: "editMode", publicName: "editMode", isSignal: true, isRequired: false, transformFunction: null }, additionalActionIcon: { classPropertyName: "additionalActionIcon", publicName: "additionalActionIcon", isSignal: true, isRequired: false, transformFunction: null }, additionalActionText: { classPropertyName: "additionalActionText", publicName: "additionalActionText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expanded: "expandedChange", edit: "edit", cancel: "cancel", save: "save", additionalAction: "additionalAction" }, ngImport: i0, template: "<mat-card>\n @if (showHeader()) {\n <mat-card-header class=\"card-header\">\n <mat-card-title-group class=\"card-title-group\">\n @if (title(); as cardTitle) {\n <mat-card-title data-cy=\"card-title\" class=\"card-title\">\n {{ cardTitle }}\n </mat-card-title>\n }\n <div data-cy=\"title-buttons-block\" class=\"header-actions\">\n @if (showCollapseButton()) {\n <mad-icon-button data-testid=\"collapse-btn\" (click)=\"toggleCollapse()\">\n <mat-icon [class]=\"collapseIconClasses()\"> keyboard_arrow_up </mat-icon>\n </mad-icon-button>\n }\n @if (showAdditionalActionButton()) {\n <mad-icon-button data-testid=\"additional-btn\" (click)=\"additionalAction.emit()\" [title]=\"additionalActionText()\" type=\"button\">\n <mat-icon>{{ additionalActionIcon() }}</mat-icon>\n </mad-icon-button>\n }\n @if (showEditButton()) {\n <mad-icon-button data-testid=\"edit-btn\" [title]=\"editText()\" (click)=\"onEdit()\" type=\"button\">\n <mat-icon>create</mat-icon>\n </mad-icon-button>\n }\n </div>\n </mat-card-title-group>\n </mat-card-header>\n }\n\n @if (expanded()) {\n <mat-card-content animate.enter=\"card-content-enter\" animate.leave=\"card-content-leave\">\n <ng-content />\n </mat-card-content>\n }\n\n @if (showActions()) {\n <mat-card-actions class=\"card-actions\">\n <mad-primary-button\n data-testid=\"save-btn\"\n [title]=\"saveText()\"\n [disabled]=\"saveDisabled()\"\n (throttleClick)=\"save.emit()\"\n madThrottleClick\n >\n {{ saveText() }}\n </mad-primary-button>\n <mad-outline-button data-testid=\"cancel-btn\" [title]=\"cancelText()\" [disabled]=\"cancelDisabled()\" (click)=\"cancel.emit()\">\n {{ cancelText() }}\n </mad-outline-button>\n </mat-card-actions>\n }\n</mat-card>\n", styles: [":host{display:block}.card-header{height:48px}.card-title-group{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%}.card-title{display:flex;align-items:center}.header-actions{display:flex;align-items:center;justify-content:flex-end;gap:.25rem;flex-shrink:0}.collapse-icon{transition:transform .1s ease}.collapse-icon--collapsed{transform:rotate(180deg)}.card-actions{display:flex;gap:.75rem;padding:1.5rem 1rem}.card-content-enter{animation:card-content-enter .18s cubic-bezier(.2,0,0,1)}.card-content-leave{animation:card-content-leave .22s cubic-bezier(.4,0,.2,1)}@keyframes card-content-enter{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}@keyframes card-content-leave{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-2px)}}\n"], dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1$3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1$3.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i1$3.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i1$3.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i1$3.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i1$3.MatCardTitleGroup, selector: "mat-card-title-group" }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button" }, { kind: "directive", type: ThrottleClickDirective, selector: "[madThrottleClick]", inputs: ["throttleTime"], outputs: ["throttleClick"] }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["color"] }] }); }
1835
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: CardComponent, isStandalone: true, selector: "mad-card", inputs: { cancelDisabled: { classPropertyName: "cancelDisabled", publicName: "cancelDisabled", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, editText: { classPropertyName: "editText", publicName: "editText", isSignal: true, isRequired: false, transformFunction: null }, expandable: { classPropertyName: "expandable", publicName: "expandable", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, saveDisabled: { classPropertyName: "saveDisabled", publicName: "saveDisabled", isSignal: true, isRequired: false, transformFunction: null }, saveText: { classPropertyName: "saveText", publicName: "saveText", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, editMode: { classPropertyName: "editMode", publicName: "editMode", isSignal: true, isRequired: false, transformFunction: null }, additionalActionIcon: { classPropertyName: "additionalActionIcon", publicName: "additionalActionIcon", isSignal: true, isRequired: false, transformFunction: null }, additionalActionText: { classPropertyName: "additionalActionText", publicName: "additionalActionText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expanded: "expandedChange", edit: "edit", cancel: "cancel", save: "save", additionalAction: "additionalAction" }, ngImport: i0, template: "<mat-card>\n @if (showHeader()) {\n <mat-card-header class=\"card-header\">\n <mat-card-title-group class=\"card-title-group\">\n @if (title(); as cardTitle) {\n <mat-card-title data-cy=\"card-title\" class=\"card-title\">\n {{ cardTitle }}\n </mat-card-title>\n }\n <div data-cy=\"title-buttons-block\" class=\"header-actions\">\n @if (showCollapseButton()) {\n <mad-icon-button data-testid=\"collapse-btn\" (click)=\"toggleCollapse()\">\n <mat-icon [class]=\"collapseIconClasses()\"> keyboard_arrow_up </mat-icon>\n </mad-icon-button>\n }\n @if (showAdditionalActionButton()) {\n <mad-icon-button data-testid=\"additional-btn\" (click)=\"additionalAction.emit()\" [title]=\"additionalActionText()\" type=\"button\">\n <mat-icon>{{ additionalActionIcon() }}</mat-icon>\n </mad-icon-button>\n }\n @if (showEditButton()) {\n <mad-icon-button data-testid=\"edit-btn\" [title]=\"editText()\" (click)=\"onEdit()\" type=\"button\">\n <mat-icon>create</mat-icon>\n </mad-icon-button>\n }\n </div>\n </mat-card-title-group>\n </mat-card-header>\n }\n\n @if (expanded()) {\n <mat-card-content animate.enter=\"card-content-enter\" animate.leave=\"card-content-leave\">\n <ng-content />\n </mat-card-content>\n }\n\n @if (showActions()) {\n <mat-card-actions class=\"card-actions\">\n <mad-primary-button\n data-testid=\"save-btn\"\n [title]=\"saveText()\"\n [disabled]=\"saveDisabled()\"\n (throttleClick)=\"save.emit()\"\n madThrottleClick\n >\n {{ saveText() }}\n </mad-primary-button>\n <mad-outline-button data-testid=\"cancel-btn\" [title]=\"cancelText()\" [disabled]=\"cancelDisabled()\" (click)=\"cancel.emit()\">\n {{ cancelText() }}\n </mad-outline-button>\n </mat-card-actions>\n }\n</mat-card>\n", styles: [":host{display:block}.card-header{height:48px}.card-title-group{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%}.card-title{display:flex;align-items:center}.header-actions{display:flex;align-items:center;justify-content:flex-end;gap:.25rem;flex-shrink:0}.collapse-icon{transition:transform .1s ease}.collapse-icon--collapsed{transform:rotate(180deg)}.card-actions{display:flex;gap:.75rem;padding:1.5rem 1rem}.card-content-enter{animation:card-content-enter .18s cubic-bezier(.2,0,0,1)}.card-content-leave{animation:card-content-leave .22s cubic-bezier(.4,0,.2,1)}@keyframes card-content-enter{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}@keyframes card-content-leave{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-2px)}}\n"], dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1$3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1$3.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i1$3.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i1$3.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i1$3.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i1$3.MatCardTitleGroup, selector: "mat-card-title-group" }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button" }, { kind: "directive", type: ThrottleClickDirective, selector: "[madThrottleClick]", inputs: ["throttleTime"], outputs: ["throttleClick"] }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["color"] }] }); }
1302
1836
  }
1303
1837
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CardComponent, decorators: [{
1304
1838
  type: Component,
@@ -1331,231 +1865,95 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
1331
1865
  }]
1332
1866
  }] });
1333
1867
 
1334
- class BaseQuickListComponent {
1335
- constructor(changeDetectorRef, formBuilder) {
1336
- this.changeDetectorRef = changeDetectorRef;
1337
- this.formBuilder = formBuilder;
1338
- this.allItems = [];
1339
- this.addLabel = 'NOT SET';
1340
- this.addPossible = true;
1341
- this.removePossible = true;
1342
- this.blankItem = {};
1343
- this.added = new EventEmitter();
1344
- this.removed = new EventEmitter();
1345
- }
1346
- ngOnInit() {
1347
- this.addEventFunction = this.addItem.bind(this);
1348
- if (this.minItems) {
1349
- for (let n = this.allItems.length; n < this.minItems; n++) {
1350
- this.interalAddItem();
1351
- }
1352
- }
1353
- }
1354
- ngAfterViewInit() {
1355
- setTimeout(() => this.setFocusOnAdd(), 1);
1356
- }
1357
- addItem() {
1358
- const newItem = this.interalAddItem();
1359
- if (!!newItem) {
1360
- this.added.emit(newItem);
1361
- }
1362
- }
1363
- addReactiveItem() {
1364
- if (this.isAddReactiveAllowed()) {
1365
- this.added.emit(null);
1366
- }
1367
- }
1368
- removeItem(item) {
1369
- if (this.isDeleteAllowed()) {
1370
- this.allItems.splice(this.allItems.indexOf(item), 1);
1371
- this.removed.emit(item);
1372
- }
1373
- }
1374
- removeReactiveItem(item) {
1375
- if (this.isDeleteReactiveAllowed()) {
1376
- const index = this.formArray.controls.indexOf(item);
1377
- if (index >= 0) {
1378
- this.formArray.controls.splice(index, 1);
1379
- this.formArray.updateValueAndValidity();
1380
- this.removed.emit(null);
1381
- }
1382
- }
1383
- }
1384
- setFocusOnAdd() {
1385
- this.rowCountFocus = this.itemRows.length;
1386
- this.itemRows.changes.subscribe((els) => {
1387
- if (els.length > this.rowCountFocus && !!els.last) {
1388
- const firstFocusable = els.last.nativeElement.querySelector("button, a, input, select, textarea, [tabindex]:not([tabindex='-1'])");
1389
- if (firstFocusable) {
1390
- firstFocusable.focus();
1391
- }
1392
- }
1393
- this.rowCountFocus = els.length;
1394
- });
1395
- }
1396
- isAddAllowed() {
1397
- return this.addPossible && (!this.maxItems || this.allItems?.length < this.maxItems);
1398
- }
1399
- isAddReactiveAllowed() {
1400
- return this.addPossible && (!this.maxItems || this.formArray?.controls.length < this.maxItems);
1401
- }
1402
- isDeleteAllowed() {
1403
- return this.removePossible && (!this.minItems || this.allItems?.length > this.minItems);
1404
- }
1405
- isDeleteReactiveAllowed() {
1406
- return this.removePossible && (!this.minItems || this.formArray?.controls.length > this.minItems);
1407
- }
1408
- interalAddItem() {
1409
- if (this.isAddAllowed()) {
1410
- const newItem = { ...this.blankItem };
1411
- // creates ids in the form of "n5kdz1pljl8"
1412
- newItem.id = Math.random().toString(36).substring(2);
1413
- this.allItems.push(newItem);
1414
- this.changeDetectorRef.detectChanges();
1415
- return newItem;
1416
- }
1417
- return null;
1418
- }
1419
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: BaseQuickListComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
1420
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: BaseQuickListComponent, isStandalone: true, selector: "mad-base-quick-list", inputs: { allItems: "allItems", addLabel: "addLabel", addPossible: "addPossible", removePossible: "removePossible", blankItem: "blankItem", readonly: "readonly", maxItems: "maxItems", minItems: "minItems", formArray: "formArray" }, outputs: { added: "added", removed: "removed" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "itemRows", predicate: ["row"], descendants: true }], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.Eager }); }
1868
+ class ContentHeaderComponent {
1869
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1870
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: ContentHeaderComponent, isStandalone: true, selector: "mad-content-header", ngImport: i0, template: "<div class=\"content-header\">\n <ng-content></ng-content>\n</div>\n", styles: [".content-header{padding-right:.5rem;background-color:var(--background-color)}\n"] }); }
1421
1871
  }
1422
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: BaseQuickListComponent, decorators: [{
1872
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentHeaderComponent, decorators: [{
1423
1873
  type: Component,
1424
- args: [{ selector: 'mad-base-quick-list', changeDetection: ChangeDetectionStrategy.Eager, template: '', standalone: true }]
1425
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.FormBuilder }], propDecorators: { allItems: [{
1426
- type: Input
1427
- }], addLabel: [{
1428
- type: Input
1429
- }], addPossible: [{
1430
- type: Input
1431
- }], removePossible: [{
1432
- type: Input
1433
- }], blankItem: [{
1434
- type: Input
1435
- }], readonly: [{
1436
- type: Input
1437
- }], maxItems: [{
1438
- type: Input
1439
- }], minItems: [{
1440
- type: Input
1441
- }], formArray: [{
1442
- type: Input
1443
- }], added: [{
1444
- type: Output
1445
- }], removed: [{
1446
- type: Output
1447
- }], itemTemplate: [{
1448
- type: ContentChild,
1449
- args: [TemplateRef]
1450
- }], itemRows: [{
1451
- type: ViewChildren,
1452
- args: ['row']
1453
- }] } });
1874
+ args: [{ selector: 'mad-content-header', standalone: true, template: "<div class=\"content-header\">\n <ng-content></ng-content>\n</div>\n", styles: [".content-header{padding-right:.5rem;background-color:var(--background-color)}\n"] }]
1875
+ }] });
1454
1876
 
1455
- class QuickListCompactComponent extends BaseQuickListComponent {
1456
- constructor(changeDetectorRef, formBuilder) {
1457
- super(changeDetectorRef, formBuilder);
1458
- this.changeDetectorRef = changeDetectorRef;
1459
- this.formBuilder = formBuilder;
1460
- }
1461
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: QuickListCompactComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
1462
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: QuickListCompactComponent, isStandalone: true, selector: "mad-quick-list-compact", usesInheritance: true, ngImport: i0, template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of allItems; track item; let isLast = $last) {\n @if (itemTemplate) {\n <div class=\"flex-container\" #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n @if (!readonly && isLast) {\n <mad-icon-button data-cy=\"add-item-button\" [disabled]=\"!isAddAllowed()\" (click)=\"addItem()\">\n <mat-icon>add_circle_outline</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n@if (!readonly && !this.allItems.length) {\n <mad-link-button data-cy=\"add-first-item-button\" (click)=\"addItem()\" [disabled]=\"!isAddAllowed()\">\n {{ addLabel }}\n </mad-link-button>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: LinkButtonComponent, selector: "mad-link-button" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
1877
+ class ContentPanelContainerComponent {
1878
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1879
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: ContentPanelContainerComponent, isStandalone: true, selector: "mad-content-panel-container", ngImport: i0, template: "<div class=\"content-panel-sidebar-wrapper\">\n <ng-content select=\"mad-content-panel-container-sidebar\"></ng-content>\n <div class=\"content-panel-outer-wrapper\">\n <ng-content select=\"mad-content-panel-container-content\"></ng-content>\n <ng-content select=\"mad-content-panel-container-footer\"></ng-content>\n </div>\n</div>\n", styles: [":host{position:relative;overflow:hidden;display:flex;flex:1 1 auto;min-width:0;min-height:.05rem;background-color:var(--background-color)}.content-panel-outer-wrapper{display:flex;flex:1 1 auto;min-width:0;flex-direction:column;text-overflow:ellipsis}.content-panel-sidebar-wrapper{width:100%;display:flex;flex:1 1 auto;min-width:0;flex-direction:row}\n"] }); }
1463
1880
  }
1464
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: QuickListCompactComponent, decorators: [{
1881
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerComponent, decorators: [{
1465
1882
  type: Component,
1466
- args: [{ selector: 'mad-quick-list-compact', changeDetection: ChangeDetectionStrategy.Eager, imports: [NgTemplateOutlet, IconButtonComponent, MatIconModule, LinkButtonComponent], template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of allItems; track item; let isLast = $last) {\n @if (itemTemplate) {\n <div class=\"flex-container\" #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n @if (!readonly && isLast) {\n <mad-icon-button data-cy=\"add-item-button\" [disabled]=\"!isAddAllowed()\" (click)=\"addItem()\">\n <mat-icon>add_circle_outline</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n@if (!readonly && !this.allItems.length) {\n <mad-link-button data-cy=\"add-first-item-button\" (click)=\"addItem()\" [disabled]=\"!isAddAllowed()\">\n {{ addLabel }}\n </mad-link-button>\n}\n" }]
1467
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.FormBuilder }] });
1883
+ args: [{ selector: 'mad-content-panel-container', standalone: true, template: "<div class=\"content-panel-sidebar-wrapper\">\n <ng-content select=\"mad-content-panel-container-sidebar\"></ng-content>\n <div class=\"content-panel-outer-wrapper\">\n <ng-content select=\"mad-content-panel-container-content\"></ng-content>\n <ng-content select=\"mad-content-panel-container-footer\"></ng-content>\n </div>\n</div>\n", styles: [":host{position:relative;overflow:hidden;display:flex;flex:1 1 auto;min-width:0;min-height:.05rem;background-color:var(--background-color)}.content-panel-outer-wrapper{display:flex;flex:1 1 auto;min-width:0;flex-direction:column;text-overflow:ellipsis}.content-panel-sidebar-wrapper{width:100%;display:flex;flex:1 1 auto;min-width:0;flex-direction:row}\n"] }]
1884
+ }] });
1468
1885
 
1469
- // Based on https://github.com/porscheinformatik/clarity-addons/blob/master/src/clr-addons/generic-quick-list/generic-quick-list.ts
1470
- class QuickListComponent extends BaseQuickListComponent {
1471
- constructor(changeDetectorRef, formBuilder) {
1472
- super(changeDetectorRef, formBuilder);
1473
- this.changeDetectorRef = changeDetectorRef;
1474
- this.formBuilder = formBuilder;
1475
- }
1476
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: QuickListComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
1477
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: QuickListComponent, isStandalone: true, selector: "mad-quick-list", usesInheritance: true, ngImport: i0, template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of allItems; track item) {\n @if (itemTemplate) {\n <div #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n@if (!readonly) {\n <mad-outline-button data-cy=\"add-item-button\" (click)=\"addItem()\" [disabled]=\"!addPossible || !isAddAllowed()\">\n {{ addLabel }}\n </mad-outline-button>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["color"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
1886
+ class ContentPanelContainerContentComponent {
1887
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1888
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: ContentPanelContainerContentComponent, isStandalone: true, selector: "mad-content-panel-container-content", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{flex:1 1 auto;min-width:0;overflow-y:auto;border-top:.05rem solid #cccccc;padding:1rem}\n"] }); }
1478
1889
  }
1479
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: QuickListComponent, decorators: [{
1890
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerContentComponent, decorators: [{
1480
1891
  type: Component,
1481
- args: [{ selector: 'mad-quick-list', changeDetection: ChangeDetectionStrategy.Eager, imports: [NgTemplateOutlet, IconButtonComponent, MatIconModule, OutlineButtonComponent], template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of allItems; track item) {\n @if (itemTemplate) {\n <div #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n@if (!readonly) {\n <mad-outline-button data-cy=\"add-item-button\" (click)=\"addItem()\" [disabled]=\"!addPossible || !isAddAllowed()\">\n {{ addLabel }}\n </mad-outline-button>\n}\n" }]
1482
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.FormBuilder }] });
1892
+ args: [{ selector: 'mad-content-panel-container-content', standalone: true, template: "<ng-content></ng-content>\n", styles: [":host{flex:1 1 auto;min-width:0;overflow-y:auto;border-top:.05rem solid #cccccc;padding:1rem}\n"] }]
1893
+ }] });
1483
1894
 
1484
- class ReactiveFormQuickListComponent extends BaseQuickListComponent {
1485
- constructor(changeDetectorRef, formBuilder) {
1486
- super(changeDetectorRef, formBuilder);
1487
- this.changeDetectorRef = changeDetectorRef;
1488
- this.formBuilder = formBuilder;
1489
- }
1490
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ReactiveFormQuickListComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
1491
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: ReactiveFormQuickListComponent, isStandalone: true, selector: "mad-reactive-form-quick-list", usesInheritance: true, ngImport: i0, template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of formArray.controls; track item) {\n @if (itemTemplate) {\n <div #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteReactiveAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeReactiveItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n\n@if (!readonly) {\n <mad-outline-button data-cy=\"add-item-button\" (click)=\"addReactiveItem()\" [disabled]=\"!isAddReactiveAllowed()\">\n {{ addLabel }}\n </mad-outline-button>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["color"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
1895
+ class ContentPanelContainerFooterComponent {
1896
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1897
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: ContentPanelContainerFooterComponent, isStandalone: true, selector: "mad-content-panel-container-footer", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{border-top:.05rem solid #cccccc;padding:.25rem 1rem;display:flex;flex:0 0 auto;align-items:center;min-height:2rem;width:auto}\n"] }); }
1492
1898
  }
1493
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ReactiveFormQuickListComponent, decorators: [{
1899
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerFooterComponent, decorators: [{
1494
1900
  type: Component,
1495
- args: [{ selector: 'mad-reactive-form-quick-list', changeDetection: ChangeDetectionStrategy.Eager, imports: [NgTemplateOutlet, IconButtonComponent, MatIconModule, OutlineButtonComponent], template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of formArray.controls; track item) {\n @if (itemTemplate) {\n <div #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteReactiveAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeReactiveItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n\n@if (!readonly) {\n <mad-outline-button data-cy=\"add-item-button\" (click)=\"addReactiveItem()\" [disabled]=\"!isAddReactiveAllowed()\">\n {{ addLabel }}\n </mad-outline-button>\n}\n" }]
1496
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.FormBuilder }] });
1901
+ args: [{ selector: 'mad-content-panel-container-footer', standalone: true, template: "<ng-content></ng-content>\n", styles: [":host{border-top:.05rem solid #cccccc;padding:.25rem 1rem;display:flex;flex:0 0 auto;align-items:center;min-height:2rem;width:auto}\n"] }]
1902
+ }] });
1497
1903
 
1498
- class ReactiveFormQuickListCompactComponent extends BaseQuickListComponent {
1499
- constructor(changeDetectorRef, formBuilder) {
1500
- super(changeDetectorRef, formBuilder);
1501
- this.changeDetectorRef = changeDetectorRef;
1502
- this.formBuilder = formBuilder;
1503
- }
1504
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ReactiveFormQuickListCompactComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
1505
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: ReactiveFormQuickListCompactComponent, isStandalone: true, selector: "mad-reactive-form-quick-list-compact", usesInheritance: true, ngImport: i0, template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of formArray.controls; track item; let isLast = $last) {\n @if (itemTemplate) {\n <div #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteReactiveAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeReactiveItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n @if (!readonly && isLast) {\n <mad-icon-button data-cy=\"add-item-button\" [disabled]=\"!isAddReactiveAllowed()\" (click)=\"addReactiveItem()\">\n <mat-icon>add_circle_outline</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n@if (!readonly && !this.formArray?.controls.length) {\n <mad-link-button data-cy=\"add-first-item-button\" (click)=\"addReactiveItem()\" [disabled]=\"!isAddReactiveAllowed()\">\n {{ addLabel }}\n </mad-link-button>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: LinkButtonComponent, selector: "mad-link-button" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
1904
+ class ContentPanelContainerSidebarComponent {
1905
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerSidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1906
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: ContentPanelContainerSidebarComponent, isStandalone: true, selector: "mad-content-panel-container-sidebar", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{border-top:.05rem solid var(--mat-sys-outline-variant);min-height:2rem;display:flex;flex:0 0 auto}\n"] }); }
1506
1907
  }
1507
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ReactiveFormQuickListCompactComponent, decorators: [{
1908
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerSidebarComponent, decorators: [{
1508
1909
  type: Component,
1509
- args: [{ selector: 'mad-reactive-form-quick-list-compact', changeDetection: ChangeDetectionStrategy.Eager, imports: [NgTemplateOutlet, IconButtonComponent, MatIconModule, LinkButtonComponent], template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of formArray.controls; track item; let isLast = $last) {\n @if (itemTemplate) {\n <div #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteReactiveAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeReactiveItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n @if (!readonly && isLast) {\n <mad-icon-button data-cy=\"add-item-button\" [disabled]=\"!isAddReactiveAllowed()\" (click)=\"addReactiveItem()\">\n <mat-icon>add_circle_outline</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n@if (!readonly && !this.formArray?.controls.length) {\n <mad-link-button data-cy=\"add-first-item-button\" (click)=\"addReactiveItem()\" [disabled]=\"!isAddReactiveAllowed()\">\n {{ addLabel }}\n </mad-link-button>\n}\n" }]
1510
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.FormBuilder }] });
1910
+ args: [{ selector: 'mad-content-panel-container-sidebar', standalone: true, template: "<ng-content></ng-content>\n", styles: [":host{border-top:.05rem solid var(--mat-sys-outline-variant);min-height:2rem;display:flex;flex:0 0 auto}\n"] }]
1911
+ }] });
1511
1912
 
1512
- class QuickListModule {
1513
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: QuickListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1514
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: QuickListModule, imports: [CommonModule,
1515
- MatButtonModule,
1516
- MatIconModule,
1517
- ButtonModule,
1518
- ReactiveFormsModule,
1519
- QuickListComponent,
1520
- BaseQuickListComponent,
1521
- QuickListCompactComponent,
1522
- ReactiveFormQuickListComponent,
1523
- ReactiveFormQuickListCompactComponent], exports: [QuickListComponent,
1524
- QuickListCompactComponent,
1525
- BaseQuickListComponent,
1526
- ReactiveFormQuickListComponent,
1527
- ReactiveFormQuickListCompactComponent] }); }
1528
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: QuickListModule, imports: [CommonModule,
1529
- MatButtonModule,
1530
- MatIconModule,
1531
- ButtonModule,
1532
- ReactiveFormsModule,
1533
- QuickListComponent,
1534
- QuickListCompactComponent,
1535
- ReactiveFormQuickListComponent,
1536
- ReactiveFormQuickListCompactComponent] }); }
1913
+ class MainContainerComponent {
1914
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MainContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1915
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: MainContainerComponent, isStandalone: true, selector: "mad-main-container", ngImport: i0, template: "<div class=\"main-container\">\n <ng-content select=\"mad-content-header\"></ng-content>\n <ng-content select=\"mad-flowbar\"></ng-content>\n <ng-content select=\"mad-content-panel-container\"></ng-content>\n</div>\n", styles: [".main-container{height:100%;display:flex;flex-direction:column}\n"] }); }
1537
1916
  }
1538
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: QuickListModule, decorators: [{
1917
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MainContainerComponent, decorators: [{
1918
+ type: Component,
1919
+ args: [{ selector: 'mad-main-container', standalone: true, template: "<div class=\"main-container\">\n <ng-content select=\"mad-content-header\"></ng-content>\n <ng-content select=\"mad-flowbar\"></ng-content>\n <ng-content select=\"mad-content-panel-container\"></ng-content>\n</div>\n", styles: [".main-container{height:100%;display:flex;flex-direction:column}\n"] }]
1920
+ }] });
1921
+
1922
+ class ContentPanelModule {
1923
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1924
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelModule, imports: [CommonModule,
1925
+ ContentHeaderComponent,
1926
+ ContentPanelContainerComponent,
1927
+ ContentPanelContainerContentComponent,
1928
+ ContentPanelContainerFooterComponent,
1929
+ ContentPanelContainerSidebarComponent,
1930
+ MainContainerComponent], exports: [ContentHeaderComponent,
1931
+ ContentPanelContainerComponent,
1932
+ ContentPanelContainerContentComponent,
1933
+ ContentPanelContainerFooterComponent,
1934
+ ContentPanelContainerSidebarComponent,
1935
+ MainContainerComponent] }); }
1936
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelModule, imports: [CommonModule] }); }
1937
+ }
1938
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelModule, decorators: [{
1539
1939
  type: NgModule,
1540
1940
  args: [{
1541
1941
  imports: [
1542
1942
  CommonModule,
1543
- MatButtonModule,
1544
- MatIconModule,
1545
- ButtonModule,
1546
- ReactiveFormsModule,
1547
- QuickListComponent,
1548
- BaseQuickListComponent,
1549
- QuickListCompactComponent,
1550
- ReactiveFormQuickListComponent,
1551
- ReactiveFormQuickListCompactComponent,
1943
+ ContentHeaderComponent,
1944
+ ContentPanelContainerComponent,
1945
+ ContentPanelContainerContentComponent,
1946
+ ContentPanelContainerFooterComponent,
1947
+ ContentPanelContainerSidebarComponent,
1948
+ MainContainerComponent,
1552
1949
  ],
1553
1950
  exports: [
1554
- QuickListComponent,
1555
- QuickListCompactComponent,
1556
- BaseQuickListComponent,
1557
- ReactiveFormQuickListComponent,
1558
- ReactiveFormQuickListCompactComponent,
1951
+ ContentHeaderComponent,
1952
+ ContentPanelContainerComponent,
1953
+ ContentPanelContainerContentComponent,
1954
+ ContentPanelContainerFooterComponent,
1955
+ ContentPanelContainerSidebarComponent,
1956
+ MainContainerComponent,
1559
1957
  ],
1560
1958
  }]
1561
1959
  }] });
@@ -1637,7 +2035,7 @@ class TableComponent {
1637
2035
  return event?.target?.classList.contains('mat-icon');
1638
2036
  }
1639
2037
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1640
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: TableComponent, isStandalone: true, selector: "mad-table", inputs: { columns: "columns", filterLabel: "filterLabel", filterPlaceholder: "filterPlaceholder", noDataText: "noDataText", pageSizeOptions: "pageSizeOptions", defaultPageSize: "defaultPageSize", rowActions: "rowActions", tableActions: "tableActions", displayedData: "displayedData", paginationEnabled: "paginationEnabled", filterEnabled: "filterEnabled" }, outputs: { tableAction: "tableAction", rowAction: "rowAction", sortEvent: "sortEvent" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<!-- Table actions -->\n@if (tableActions?.length) {\n <div>\n @for (tableAction of tableActions; track tableAction) {\n <mad-primary-button class=\"table-action\" (click)=\"onTableAction(tableAction)\">\n {{ tableAction.label }}\n </mad-primary-button>\n }\n </div>\n}\n\n<!-- Row action buttons -->\n<mat-menu #menu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n @for (rowAction of rowActions; track rowAction) {\n <button mat-menu-item class=\"row-action\" (click)=\"onRowEvent($event, element, rowAction)\">\n {{ rowAction.label }}\n </button>\n }\n </ng-template>\n</mat-menu>\n\n<!-- Table filter -->\n@if (isFilterEnabled) {\n <mat-form-field>\n <mat-label>{{ filterLabel }}</mat-label>\n <input matInput (keyup)=\"onFilter($event?.target?.value)\" placeholder=\"{{ filterPlaceholder }}\" />\n </mat-form-field>\n}\n\n<!-- Table -->\n@if (dataSource?.data?.length > 0) {\n <div class=\"mad-table\">\n <table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSortingEvent($event)\">\n <!-- Row actions column -->\n @if (rowActions?.length) {\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\" sticky>\n <th mat-header-cell *matHeaderCellDef class=\"row-action-button\"></th>\n <td mat-cell *matCellDef=\"let element\" class=\"row-action-button\">\n <mad-icon-button [matMenuTriggerData]=\"{ element: element }\" [matMenuTriggerFor]=\"menu\">\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n </td>\n </ng-container>\n }\n <!-- Columns with data -->\n @for (column of columns; track column) {\n <ng-container [matColumnDef]=\"column.label\" [sticky]=\"column.isSticky\">\n @if (column.isSortable) {\n <th\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header=\"{{ column.label }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n [class.text-right]=\"column.isRightAligned\"\n >\n {{ column.label }}\n </th>\n } @else {\n <th mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ column.label }}\n </th>\n }\n <td mat-cell *matCellDef=\"let element\" [class.text-right]=\"column.isRightAligned\">\n {{ element[column.dataPropertyName] }}\n </td>\n </ng-container>\n }\n <tr mat-header-row *matHeaderRowDef=\"columnNames\"></tr>\n <tr\n mat-row\n [class.clickable-table-row]=\"isRowClickable\"\n (click)=\"onRowEvent($event, row)\"\n *matRowDef=\"let row; columns: columnNames\"\n ></tr>\n </table>\n </div>\n} @else {\n <div class=\"noDataText\">\n {{ noDataText }}\n </div>\n}\n<!-- Pagination -->\n<mat-paginator\n [style.display]=\"isPaginationEnabled ? 'block' : 'none'\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n showFirstLastButtons\n>\n</mat-paginator>\n\n<!-- No data alert -->\n", styles: [".text-right{text-align:right!important}.table-action{margin-right:.5em;margin-bottom:.5em}.row-action-button{width:10px}.noDataText{width:100%;text-align:center}.mad-table{width:100%;overflow-x:auto}\n"], dependencies: [{ kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button" }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$4.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "directive", type: i1$4.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: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$2.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: "ngmodule", type: MatTableModule }, { kind: "component", type: i9.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i9.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i9.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i9.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i9.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i9.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i9.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i9.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i9.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i9.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i5.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i5.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i7.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }] }); }
2038
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: TableComponent, isStandalone: true, selector: "mad-table", inputs: { columns: "columns", filterLabel: "filterLabel", filterPlaceholder: "filterPlaceholder", noDataText: "noDataText", pageSizeOptions: "pageSizeOptions", defaultPageSize: "defaultPageSize", rowActions: "rowActions", tableActions: "tableActions", displayedData: "displayedData", paginationEnabled: "paginationEnabled", filterEnabled: "filterEnabled" }, outputs: { tableAction: "tableAction", rowAction: "rowAction", sortEvent: "sortEvent" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<!-- Table actions -->\n@if (tableActions?.length) {\n <div>\n @for (tableAction of tableActions; track tableAction) {\n <mad-primary-button class=\"table-action\" (click)=\"onTableAction(tableAction)\">\n {{ tableAction.label }}\n </mad-primary-button>\n }\n </div>\n}\n\n<!-- Row action buttons -->\n<mat-menu #menu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n @for (rowAction of rowActions; track rowAction) {\n <button mat-menu-item class=\"row-action\" (click)=\"onRowEvent($event, element, rowAction)\">\n {{ rowAction.label }}\n </button>\n }\n </ng-template>\n</mat-menu>\n\n<!-- Table filter -->\n@if (isFilterEnabled) {\n <mat-form-field>\n <mat-label>{{ filterLabel }}</mat-label>\n <input matInput (keyup)=\"onFilter($event?.target?.value)\" placeholder=\"{{ filterPlaceholder }}\" />\n </mat-form-field>\n}\n\n<!-- Table -->\n@if (dataSource?.data?.length > 0) {\n <div class=\"mad-table\">\n <table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSortingEvent($event)\">\n <!-- Row actions column -->\n @if (rowActions?.length) {\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\" sticky>\n <th mat-header-cell *matHeaderCellDef class=\"row-action-button\"></th>\n <td mat-cell *matCellDef=\"let element\" class=\"row-action-button\">\n <mad-icon-button [matMenuTriggerData]=\"{ element: element }\" [matMenuTriggerFor]=\"menu\">\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n </td>\n </ng-container>\n }\n <!-- Columns with data -->\n @for (column of columns; track column) {\n <ng-container [matColumnDef]=\"column.label\" [sticky]=\"column.isSticky\">\n @if (column.isSortable) {\n <th\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header=\"{{ column.label }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n [class.text-right]=\"column.isRightAligned\"\n >\n {{ column.label }}\n </th>\n } @else {\n <th mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ column.label }}\n </th>\n }\n <td mat-cell *matCellDef=\"let element\" [class.text-right]=\"column.isRightAligned\">\n {{ element[column.dataPropertyName] }}\n </td>\n </ng-container>\n }\n <tr mat-header-row *matHeaderRowDef=\"columnNames\"></tr>\n <tr\n mat-row\n [class.clickable-table-row]=\"isRowClickable\"\n (click)=\"onRowEvent($event, row)\"\n *matRowDef=\"let row; columns: columnNames\"\n ></tr>\n </table>\n </div>\n} @else {\n <div class=\"noDataText\">\n {{ noDataText }}\n </div>\n}\n<!-- Pagination -->\n<mat-paginator\n [style.display]=\"isPaginationEnabled ? 'block' : 'none'\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n showFirstLastButtons\n>\n</mat-paginator>\n\n<!-- No data alert -->\n", styles: [".text-right{text-align:right!important}.table-action{margin-right:.5em;margin-bottom:.5em}.row-action-button{width:10px}.noDataText{width:100%;text-align:center}.mad-table{width:100%;overflow-x:auto}\n"], dependencies: [{ kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button" }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$4.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "directive", type: i1$4.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: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { 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: "ngmodule", type: MatTableModule }, { kind: "component", type: i9.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i9.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i9.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i9.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i9.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i9.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i9.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i9.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i9.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i9.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i5.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i5.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i7.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }] }); }
1641
2039
  }
1642
2040
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableComponent, decorators: [{
1643
2041
  type: Component,
@@ -1688,51 +2086,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
1688
2086
  type: Input
1689
2087
  }] } });
1690
2088
 
1691
- class TableModule {
1692
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1693
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: TableModule, imports: [CommonModule,
1694
- MatButtonModule,
1695
- MatIconModule,
1696
- MatFormFieldModule,
1697
- MatInputModule,
1698
- MatMenuModule,
1699
- MatPaginatorModule,
1700
- MatSortModule,
1701
- MatTableModule,
1702
- ButtonModule,
1703
- TableComponent], exports: [TableComponent] }); }
1704
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableModule, imports: [CommonModule,
1705
- MatButtonModule,
1706
- MatIconModule,
1707
- MatFormFieldModule,
1708
- MatInputModule,
1709
- MatMenuModule,
1710
- MatPaginatorModule,
1711
- MatSortModule,
1712
- MatTableModule,
1713
- ButtonModule,
1714
- TableComponent] }); }
1715
- }
1716
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableModule, decorators: [{
1717
- type: NgModule,
1718
- args: [{
1719
- imports: [
1720
- CommonModule,
1721
- MatButtonModule,
1722
- MatIconModule,
1723
- MatFormFieldModule,
1724
- MatInputModule,
1725
- MatMenuModule,
1726
- MatPaginatorModule,
1727
- MatSortModule,
1728
- MatTableModule,
1729
- ButtonModule,
1730
- TableComponent,
1731
- ],
1732
- exports: [TableComponent],
1733
- }]
1734
- }] });
1735
-
1736
2089
  class DataTableColumnsModalComponent {
1737
2090
  constructor(dialogRef, data) {
1738
2091
  this.dialogRef = dialogRef;
@@ -1810,7 +2163,7 @@ class DataTableColumnsModalComponent {
1810
2163
  this.filteredAvailableColumns = [...this.availableColumns];
1811
2164
  }
1812
2165
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DataTableColumnsModalComponent, deps: [{ token: i1$5.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
1813
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: DataTableColumnsModalComponent, isStandalone: true, selector: "mad-data-table-columns-modal", ngImport: i0, template: "<h2 mat-dialog-title>{{ data.titleLabel | translate }}</h2>\n<mat-dialog-content>\n <div\n class=\"grid grid-cols-1 gap-4 sm:grid-cols-2 sm:gap-6 w-full max-w-full box-border pt-2 pb-4 mb-4 border-b border-(--mat-sys-outline-variant)\"\n >\n <div class=\"w-full max-w-full min-w-0 block text-sm\">\n <div class=\"w-full min-h-14 mb-4 text-sm text-(--mat-sys-on-surface-variant) flex justify-end items-stretch flex-col\">\n {{ data.infoTextLabel | translate }}\n </div>\n <div class=\"font-bold mb-1\">{{ data.selectedLabel | translate }}</div>\n <div\n cdkDropList\n #selectedList=\"cdkDropList\"\n [cdkDropListData]=\"selectedColumns\"\n [cdkDropListConnectedTo]=\"[availableList]\"\n class=\"column-drag-list selected-drag-list border border-(--mat-sys-outline-variant) h-[200px] box-border bg-(--mat-sys-surface) rounded overflow-auto block\"\n (cdkDropListDropped)=\"onDrop($event)\"\n >\n @for (selectedColumn of selectedColumns; track selectedColumn; let i = $index) {\n <div\n class=\"column-drag-box py-3 px-2.5 border-b border-(--mat-sys-outline-variant) text-(--mat-sys-on-surface) flex flex-row items-center justify-between box-border h-10 cursor-move bg-(--mat-sys-surface) text-sm\"\n cdkDrag\n [id]=\"selectedColumn.id\"\n >\n {{ i + 1 }}. {{ selectedColumn.label | translate }}\n </div>\n }\n </div>\n </div>\n\n <div class=\"w-full max-w-full min-w-0 block text-sm\">\n <div class=\"w-full min-h-14 mb-4 text-sm text-(--mat-sys-on-surface-variant) flex justify-end items-stretch flex-col\">\n <!-- Table filter -->\n <mat-form-field class=\"w-full\">\n <mat-label>{{ data.filterColumnsLabel | translate }}</mat-label>\n <input\n matInput\n autocomplete=\"off\"\n (keyup)=\"updateFilterValue()\"\n placeholder=\"{{ data.filterColumnsPlaceHolder | translate }}\"\n [(ngModel)]=\"searchFilter\"\n />\n @if (searchFilter) {\n <button matSuffix matIconButton aria-label=\"Clear\" (click)=\"clearFilterValue()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n <div class=\"font-bold mb-1\">{{ data.availableLabel | translate }}</div>\n <div\n cdkDropList\n cdkDropListSortingDisabled\n #availableList=\"cdkDropList\"\n [cdkDropListData]=\"availableColumns\"\n [cdkDropListConnectedTo]=\"[selectedList]\"\n class=\"column-drag-list border border-(--mat-sys-outline-variant) h-[200px] box-border bg-(--mat-sys-surface) rounded overflow-auto block\"\n (cdkDropListDropped)=\"onDrop($event)\"\n >\n @for (availableColumn of filteredAvailableColumns; track availableColumn) {\n <div\n class=\"column-drag-box py-3 px-2.5 border-b border-(--mat-sys-outline-variant) text-(--mat-sys-on-surface) flex flex-row items-center justify-between box-border h-10 cursor-move bg-(--mat-sys-surface) text-sm\"\n cdkDrag\n [id]=\"availableColumn.id\"\n >\n {{ availableColumn.label }}\n </div>\n }\n </div>\n </div>\n </div>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <mad-outline-button (click)=\"onCancel()\">\n {{ data.cancelLabel | translate }}\n </mad-outline-button>\n @if (data.deleteDefinitionAllowed) {\n <mad-danger-button (click)=\"onDelete()\">\n {{ data.deleteLabel | translate }}\n </mad-danger-button>\n }\n <mad-primary-button (click)=\"onSave()\" [disabled]=\"!((this.selectedColumns.length || 0) > 0)\">\n {{ data.saveLabel | translate }}\n </mad-primary-button>\n</mat-dialog-actions>\n", styles: [".cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.column-drag-box:last-child{border-bottom:none}.column-drag-list.cdk-drop-list-dragging .column-drag-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$3.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$2.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: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button" }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["color"] }, { kind: "component", type: DangerButtonComponent, selector: "mad-danger-button" }, { kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "pipe", type: i2$4.TranslatePipe, name: "translate" }] }); }
2166
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: DataTableColumnsModalComponent, isStandalone: true, selector: "mad-data-table-columns-modal", ngImport: i0, template: "<h2 mat-dialog-title>{{ data.titleLabel | translate }}</h2>\n<mat-dialog-content>\n <div\n class=\"grid grid-cols-1 gap-4 sm:grid-cols-2 sm:gap-6 w-full max-w-full box-border pt-2 pb-4 mb-4 border-b border-(--mat-sys-outline-variant)\"\n >\n <div class=\"w-full max-w-full min-w-0 block text-sm\">\n <div class=\"w-full min-h-14 mb-4 text-sm text-(--mat-sys-on-surface-variant) flex justify-end items-stretch flex-col\">\n {{ data.infoTextLabel | translate }}\n </div>\n <div class=\"font-bold mb-1\">{{ data.selectedLabel | translate }}</div>\n <div\n cdkDropList\n #selectedList=\"cdkDropList\"\n [cdkDropListData]=\"selectedColumns\"\n [cdkDropListConnectedTo]=\"[availableList]\"\n class=\"column-drag-list selected-drag-list border border-(--mat-sys-outline-variant) h-[200px] box-border bg-(--mat-sys-surface) rounded overflow-auto block\"\n (cdkDropListDropped)=\"onDrop($event)\"\n >\n @for (selectedColumn of selectedColumns; track selectedColumn; let i = $index) {\n <div\n class=\"column-drag-box py-3 px-2.5 border-b border-(--mat-sys-outline-variant) text-(--mat-sys-on-surface) flex flex-row items-center justify-between box-border h-10 cursor-move bg-(--mat-sys-surface) text-sm\"\n cdkDrag\n [id]=\"selectedColumn.id\"\n >\n {{ i + 1 }}. {{ selectedColumn.label | translate }}\n </div>\n }\n </div>\n </div>\n\n <div class=\"w-full max-w-full min-w-0 block text-sm\">\n <div class=\"w-full min-h-14 mb-4 text-sm text-(--mat-sys-on-surface-variant) flex justify-end items-stretch flex-col\">\n <!-- Table filter -->\n <mat-form-field class=\"w-full\">\n <mat-label>{{ data.filterColumnsLabel | translate }}</mat-label>\n <input\n matInput\n autocomplete=\"off\"\n (keyup)=\"updateFilterValue()\"\n placeholder=\"{{ data.filterColumnsPlaceHolder | translate }}\"\n [(ngModel)]=\"searchFilter\"\n />\n @if (searchFilter) {\n <button matSuffix matIconButton aria-label=\"Clear\" (click)=\"clearFilterValue()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n <div class=\"font-bold mb-1\">{{ data.availableLabel | translate }}</div>\n <div\n cdkDropList\n cdkDropListSortingDisabled\n #availableList=\"cdkDropList\"\n [cdkDropListData]=\"availableColumns\"\n [cdkDropListConnectedTo]=\"[selectedList]\"\n class=\"column-drag-list border border-(--mat-sys-outline-variant) h-[200px] box-border bg-(--mat-sys-surface) rounded overflow-auto block\"\n (cdkDropListDropped)=\"onDrop($event)\"\n >\n @for (availableColumn of filteredAvailableColumns; track availableColumn) {\n <div\n class=\"column-drag-box py-3 px-2.5 border-b border-(--mat-sys-outline-variant) text-(--mat-sys-on-surface) flex flex-row items-center justify-between box-border h-10 cursor-move bg-(--mat-sys-surface) text-sm\"\n cdkDrag\n [id]=\"availableColumn.id\"\n >\n {{ availableColumn.label }}\n </div>\n }\n </div>\n </div>\n </div>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <mad-outline-button (click)=\"onCancel()\">\n {{ data.cancelLabel | translate }}\n </mad-outline-button>\n @if (data.deleteDefinitionAllowed) {\n <mad-danger-button (click)=\"onDelete()\">\n {{ data.deleteLabel | translate }}\n </mad-danger-button>\n }\n <mad-primary-button (click)=\"onSave()\" [disabled]=\"!((this.selectedColumns.length || 0) > 0)\">\n {{ data.saveLabel | translate }}\n </mad-primary-button>\n</mat-dialog-actions>\n", styles: [".cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.column-drag-box:last-child{border-bottom:none}.column-drag-list.cdk-drop-list-dragging .column-drag-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { 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: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button" }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["color"] }, { kind: "component", type: DangerButtonComponent, selector: "mad-danger-button" }, { kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "pipe", type: i2$3.TranslatePipe, name: "translate" }] }); }
1814
2167
  }
1815
2168
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DataTableColumnsModalComponent, decorators: [{
1816
2169
  type: Component,
@@ -2161,7 +2514,7 @@ class DataTableFilterDialogComponent {
2161
2514
  this.control.valueChanges.pipe(takeUntilDestroyed()).subscribe((value) => this.filterChanged.emit(value));
2162
2515
  }
2163
2516
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DataTableFilterDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2164
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: DataTableFilterDialogComponent, isStandalone: true, selector: "mad-data-table-filter-dialog", inputs: { filterOptions: { classPropertyName: "filterOptions", publicName: "filterOptions", isSignal: true, isRequired: false, transformFunction: null }, filterValue: { classPropertyName: "filterValue", publicName: "filterValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChanged: "filterChanged" }, ngImport: i0, template: "<div class=\"filter-dialog-box flex items-center w-auto h-20 px-3 py-3 bg-(--mat-sys-surface) [box-shadow:0_1px_3px_0_rgb(0_0_0_/_0.05)]\">\n @if (!filterOptions().length) {\n <mat-form-field class=\"filter-dialog-input w-auto max-w-[180px] m-auto\">\n <mat-label>{{ 'common.filter.term' | translate }}</mat-label>\n <input matInput type=\"text\" required=\"false\" [formControl]=\"control\" />\n </mat-form-field>\n } @else {\n <mat-form-field class=\"filter-dialog-input w-auto max-w-[180px] m-auto\">\n <mat-label>{{ 'common.filter.term' | translate }}</mat-label>\n <mat-select [formControl]=\"control\">\n <mat-option></mat-option>\n @for (entry of filterOptions(); track entry.key) {\n <mat-option [value]=\"entry.key\">{{ entry.label }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n }\n</div>\n", styles: [".filter-dialog-input.mat-form-field-appearance-outline{margin-top:0}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$2.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: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$4.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2517
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: DataTableFilterDialogComponent, isStandalone: true, selector: "mad-data-table-filter-dialog", inputs: { filterOptions: { classPropertyName: "filterOptions", publicName: "filterOptions", isSignal: true, isRequired: false, transformFunction: null }, filterValue: { classPropertyName: "filterValue", publicName: "filterValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChanged: "filterChanged" }, ngImport: i0, template: "<div class=\"filter-dialog-box flex items-center w-auto h-20 px-3 py-3 bg-(--mat-sys-surface) [box-shadow:0_1px_3px_0_rgb(0_0_0_/_0.05)]\">\n @if (!filterOptions().length) {\n <mat-form-field class=\"filter-dialog-input w-auto max-w-[180px] m-auto\">\n <mat-label>{{ 'common.filter.term' | translate }}</mat-label>\n <input matInput type=\"text\" required=\"false\" [formControl]=\"control\" />\n </mat-form-field>\n } @else {\n <mat-form-field class=\"filter-dialog-input w-auto max-w-[180px] m-auto\">\n <mat-label>{{ 'common.filter.term' | translate }}</mat-label>\n <mat-select [formControl]=\"control\">\n <mat-option></mat-option>\n @for (entry of filterOptions(); track entry.key) {\n <mat-option [value]=\"entry.key\">{{ entry.label }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n }\n</div>\n", styles: [".filter-dialog-input.mat-form-field-appearance-outline{margin-top:0}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { 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: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2165
2518
  }
2166
2519
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DataTableFilterDialogComponent, decorators: [{
2167
2520
  type: Component,
@@ -2198,7 +2551,7 @@ class FilterComponent {
2198
2551
  this.filterValue.set(filterValue);
2199
2552
  }
2200
2553
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: FilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2201
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.4", type: FilterComponent, isStandalone: true, selector: "mad-data-table-filter", inputs: { filterOptions: { classPropertyName: "filterOptions", publicName: "filterOptions", isSignal: true, isRequired: false, transformFunction: null }, filterValue: { classPropertyName: "filterValue", publicName: "filterValue", isSignal: true, isRequired: false, transformFunction: null }, isHovered: { classPropertyName: "isHovered", publicName: "isHovered", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterValue: "filterValueChange" }, host: { listeners: { "click": "stopHeaderSort($event)", "keydown": "stopHeaderSort($event)" } }, ngImport: i0, template: "<div class=\"container relative size-4\">\n <div class=\"overlay absolute size-4 bg-(--mat-sys-surface) flex items-center justify-center\" [style.opacity]=\"opacity()\">\n <mat-icon\n #filterTrigger=\"cdkOverlayOrigin\"\n cdkOverlayOrigin\n class=\"colored-icon relative flex items-center justify-center\"\n fontSet=\"material-icons-outlined\"\n (click)=\"toggleFilter($event)\"\n >\n filter_alt\n </mat-icon>\n </div>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"filterTrigger\"\n [cdkConnectedOverlayOpen]=\"showFilterDialog()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"closeFilterDialog()\"\n (detach)=\"closeFilterDialog()\"\n>\n <mad-data-table-filter-dialog [filterOptions]=\"filterOptions()\" [filterValue]=\"filterValue()\" (filterChanged)=\"onFilterChanged($event)\" />\n</ng-template>\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center}:host .colored-icon.mat-icon{width:18px;height:18px;color:var(--mat-sys-on-surface-variant);font-size:18px;line-height:18px;cursor:pointer}:host(:hover) .colored-icon.mat-icon{color:var(--main-primary)}\n"], dependencies: [{ kind: "directive", type: 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: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: DataTableFilterDialogComponent, selector: "mad-data-table-filter-dialog", inputs: ["filterOptions", "filterValue"], outputs: ["filterChanged"] }] }); }
2554
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.4", type: FilterComponent, isStandalone: true, selector: "mad-data-table-filter", inputs: { filterOptions: { classPropertyName: "filterOptions", publicName: "filterOptions", isSignal: true, isRequired: false, transformFunction: null }, filterValue: { classPropertyName: "filterValue", publicName: "filterValue", isSignal: true, isRequired: false, transformFunction: null }, isHovered: { classPropertyName: "isHovered", publicName: "isHovered", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterValue: "filterValueChange" }, host: { listeners: { "click": "stopHeaderSort($event)", "keydown": "stopHeaderSort($event)" } }, ngImport: i0, template: "<div class=\"container relative size-4\">\n <div class=\"overlay absolute size-4 bg-(--mat-sys-surface) flex items-center justify-center\" [style.opacity]=\"opacity()\">\n <mat-icon\n #filterTrigger=\"cdkOverlayOrigin\"\n cdkOverlayOrigin\n class=\"colored-icon relative flex items-center justify-center\"\n fontSet=\"material-icons-outlined\"\n (click)=\"toggleFilter($event)\"\n >\n filter_alt\n </mat-icon>\n </div>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"filterTrigger\"\n [cdkConnectedOverlayOpen]=\"showFilterDialog()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"closeFilterDialog()\"\n (detach)=\"closeFilterDialog()\"\n>\n <mad-data-table-filter-dialog [filterOptions]=\"filterOptions()\" [filterValue]=\"filterValue()\" (filterChanged)=\"onFilterChanged($event)\" />\n</ng-template>\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center}:host .colored-icon.mat-icon{width:18px;height:18px;color:var(--mat-sys-on-surface-variant);font-size:18px;line-height:18px;cursor:pointer}:host(:hover) .colored-icon.mat-icon{color:var(--main-primary)}\n"], dependencies: [{ kind: "directive", type: 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: 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: "component", type: DataTableFilterDialogComponent, selector: "mad-data-table-filter-dialog", inputs: ["filterOptions", "filterValue"], outputs: ["filterChanged"] }] }); }
2202
2555
  }
2203
2556
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: FilterComponent, decorators: [{
2204
2557
  type: Component,
@@ -3163,7 +3516,7 @@ class DataTableComponent {
3163
3516
  return this.filter()?.getActiveFilterCount() === 0;
3164
3517
  }
3165
3518
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DataTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3166
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: DataTableComponent, isStandalone: true, selector: "mad-data-table", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, filterLabel: { classPropertyName: "filterLabel", publicName: "filterLabel", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, filterColumnsLabel: { classPropertyName: "filterColumnsLabel", publicName: "filterColumnsLabel", isSignal: true, isRequired: false, transformFunction: null }, filterColumnsPlaceHolder: { classPropertyName: "filterColumnsPlaceHolder", publicName: "filterColumnsPlaceHolder", isSignal: true, isRequired: false, transformFunction: null }, showEmptyTable: { classPropertyName: "showEmptyTable", publicName: "showEmptyTable", isSignal: true, isRequired: false, transformFunction: null }, noDataText: { classPropertyName: "noDataText", publicName: "noDataText", isSignal: true, isRequired: false, transformFunction: null }, columnSettingsModalTitleLabel: { classPropertyName: "columnSettingsModalTitleLabel", publicName: "columnSettingsModalTitleLabel", isSignal: true, isRequired: false, transformFunction: null }, selectedLabel: { classPropertyName: "selectedLabel", publicName: "selectedLabel", isSignal: true, isRequired: false, transformFunction: null }, availableLabel: { classPropertyName: "availableLabel", publicName: "availableLabel", isSignal: true, isRequired: false, transformFunction: null }, saveLabel: { classPropertyName: "saveLabel", publicName: "saveLabel", isSignal: true, isRequired: false, transformFunction: null }, deleteLabel: { classPropertyName: "deleteLabel", publicName: "deleteLabel", isSignal: true, isRequired: false, transformFunction: null }, cancelLabel: { classPropertyName: "cancelLabel", publicName: "cancelLabel", isSignal: true, isRequired: false, transformFunction: null }, infoTextLabel: { classPropertyName: "infoTextLabel", publicName: "infoTextLabel", isSignal: true, isRequired: false, transformFunction: null }, tableClass: { classPropertyName: "tableClass", publicName: "tableClass", isSignal: true, isRequired: false, transformFunction: null }, translateLabels: { classPropertyName: "translateLabels", publicName: "translateLabels", isSignal: true, isRequired: false, transformFunction: null }, useAsync: { classPropertyName: "useAsync", publicName: "useAsync", isSignal: true, isRequired: false, transformFunction: null }, stateful: { classPropertyName: "stateful", publicName: "stateful", isSignal: true, isRequired: false, transformFunction: null }, persistenceConfig: { classPropertyName: "persistenceConfig", publicName: "persistenceConfig", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, tableData: { classPropertyName: "tableData", publicName: "tableData", isSignal: true, isRequired: false, transformFunction: null }, idGenerator: { classPropertyName: "idGenerator", publicName: "idGenerator", isSignal: true, isRequired: false, transformFunction: null }, parentIdGenerator: { classPropertyName: "parentIdGenerator", publicName: "parentIdGenerator", isSignal: true, isRequired: false, transformFunction: null }, defaultSort: { classPropertyName: "defaultSort", publicName: "defaultSort", isSignal: true, isRequired: false, transformFunction: null }, externalFilter: { classPropertyName: "externalFilter", publicName: "externalFilter", isSignal: true, isRequired: false, transformFunction: null }, paginationEnabled: { classPropertyName: "paginationEnabled", publicName: "paginationEnabled", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, selectionEmitType: { classPropertyName: "selectionEmitType", publicName: "selectionEmitType", isSignal: true, isRequired: false, transformFunction: null }, showDeleteFilterAction: { classPropertyName: "showDeleteFilterAction", publicName: "showDeleteFilterAction", isSignal: true, isRequired: false, transformFunction: null }, disableRowClick: { classPropertyName: "disableRowClick", publicName: "disableRowClick", isSignal: true, isRequired: false, transformFunction: null }, deleteDefinitionAllowed: { classPropertyName: "deleteDefinitionAllowed", publicName: "deleteDefinitionAllowed", isSignal: true, isRequired: false, transformFunction: null }, rowExpandable: { classPropertyName: "rowExpandable", publicName: "rowExpandable", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, filterEnabled: { classPropertyName: "filterEnabled", publicName: "filterEnabled", isSignal: true, isRequired: false, transformFunction: null }, filterModeInput: { classPropertyName: "filterModeInput", publicName: "filterMode", isSignal: true, isRequired: false, transformFunction: null }, filterValueInput: { classPropertyName: "filterValueInput", publicName: "filterValue", isSignal: true, isRequired: false, transformFunction: null }, externalPaginator: { classPropertyName: "externalPaginator", publicName: "externalPaginator", isSignal: true, isRequired: false, transformFunction: null }, defaultPageSize: { classPropertyName: "defaultPageSize", publicName: "defaultPageSize", isSignal: true, isRequired: false, transformFunction: null }, selectionEmitModeInput: { classPropertyName: "selectionEmitModeInput", publicName: "selectionEmitMode", isSignal: true, isRequired: false, transformFunction: null }, forceMode: { classPropertyName: "forceMode", publicName: "forceMode", isSignal: true, isRequired: false, transformFunction: null }, forceSelectionMode: { classPropertyName: "forceSelectionMode", publicName: "forceSelectionMode", isSignal: true, isRequired: false, transformFunction: null }, displayedColumnsInput: { classPropertyName: "displayedColumnsInput", publicName: "displayedColumns", isSignal: true, isRequired: false, transformFunction: null }, displayedColumnDefinition: { classPropertyName: "displayedColumnDefinition", publicName: "displayedColumnDefinition", isSignal: true, isRequired: false, transformFunction: null }, columnDefinitions: { classPropertyName: "columnDefinitions", publicName: "columnDefinitions", isSignal: true, isRequired: false, transformFunction: null }, allColumns: { classPropertyName: "allColumns", publicName: "allColumns", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionEvent: "actionEvent", selectionEvent: "selectionEvent", sortEvent: "sortEvent", filterEvent: "filterEvent", pageEvent: "pageEvent", allColumnsEvent: "allColumnsEvent", columnDefinitionChangeEvent: "columnDefinitionChangeEvent", viewDefinitionChangeEvent: "viewDefinitionChangeEvent" }, providers: [DATA_TABLE_PERSISTENCE_SERVICE_PROVIDER, MAD_DATA_TABL_GLOBAL_CONFIGURATION_PROVIDER], queries: [{ propertyName: "columnDefs", predicate: DataTableTemplateColumnDefinition, isSignal: true }, { propertyName: "expandableDef", first: true, predicate: DataTableTemplateExpandableCellDefinition, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }, { propertyName: "matSort", first: true, predicate: MatSort, descendants: true, isSignal: true }, { propertyName: "filter", first: true, predicate: DataTableFilter, descendants: true, isSignal: true }], ngImport: i0, template: "<div data-cy=\"table-action-bar\" class=\"mad-datatable-action-bar flex justify-between items-baseline\">\n <!-- Table actions: displayed before the table -->\n @if (tableActionsState().length || (filterModeState() === 'COLUMN_BASED' && showDeleteFilterAction())) {\n <div>\n @for (actionGroup of tableActionsState(); track actionGroup) {\n <mad-button-group class=\"table-action-group inline-flex align-middle mr-[0.5em] mb-[0.5em] mt-[0.5em]\">\n @for (tableAction of actionGroup; track $index) {\n <mad-outline-button [hidden]=\"isHidden(tableAction)\" [disabled]=\"isDisabled(tableAction)\" (click)=\"onActionEvent(tableAction)\">\n {{ translateLabels() ? (tableAction.label | translate) : tableAction.label }}\n {{ getSelectedCount(tableAction.type) }}\n </mad-outline-button>\n }\n </mad-button-group>\n }\n @if (filterModeState() === 'COLUMN_BASED' && showDeleteFilterAction()) {\n <mad-button-group class=\"table-action-group inline-flex align-middle mr-[0.5em] mb-[0.5em] mt-[0.5em]\">\n <button\n matIconButton\n [matTooltip]=\"'common.filter.delete.tooltip' | translate\"\n [attr.aria-label]=\"'common.filter.delete.tooltip' | translate\"\n matBadgeColor=\"warn\"\n [matBadge]=\"getFilterBadgeContent()\"\n [disabled]=\"disableDeleteFilterButton()\"\n class=\"delete-filter-action mat-primary align-middle\"\n (click)=\"onDeleteFilter()\"\n >\n <mat-icon fontSet=\"material-icons-outlined\" aria-hidden=\"true\"> filter_alt_off </mat-icon>\n </button>\n </mad-button-group>\n }\n </div>\n }\n @if (filterModeState() === 'TABLE_BASED') {\n <mat-form-field data-cy=\"filter-input\">\n <mat-label>{{ translateLabels() ? (filterLabel() | translate) : filterLabel() }}</mat-label>\n <input matInput autocomplete=\"off\" (keyup)=\"onTableBasedFilterEvent($event)\" placeholder=\"{{ filterPlaceholder() }}\" />\n </mat-form-field>\n }\n</div>\n\n<!-- Row action menu -->\n<mat-menu #rowActionMenu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n @for (rowAction of rowActionsState(); track rowAction) {\n @if (!isHidden(rowAction)) {\n <button\n data-cy=\"row-action-menu-button\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onRowEvent($event, element, rowAction)\"\n [disabled]=\"isDisabled(rowAction)\"\n >\n {{ translateLabels() ? (rowAction.label | translate) : rowAction.label }}\n </button>\n }\n }\n </ng-template>\n</mat-menu>\n\n<!-- editable definition menu -->\n<mat-menu #editableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n @for (definition of editableColumnDefinitionsState(); track definition) {\n <button\n mat-menu-item\n class=\"row-action\"\n (click)=\"onColumnSettings(definition)\"\n [ngClass]=\"{ 'active-column-definition': isCurrentDefinition(definition) }\"\n >\n {{ translateLabels() ? (definition.label | translate) : definition.label }}\n </button>\n }\n </ng-template>\n</mat-menu>\n\n<!-- viewable definition menu -->\n<mat-menu #viewableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n @for (definition of viewableColumnDefinitionsState(); track definition) {\n <button\n mat-menu-item\n class=\"row-action\"\n (click)=\"onViewDefinition(definition)\"\n [ngClass]=\"{ 'active-column-definition': isCurrentDefinition(definition) }\"\n >\n {{ translateLabels() ? (definition.label | translate) : definition.label }}\n </button>\n }\n </ng-template>\n</mat-menu>\n\n<!-- Table -->\n@if (filterModeState() === 'COLUMN_BASED' || showEmptyTable() || !!dataSource.filteredData?.length) {\n <div class=\"datatable overflow-auto flex-auto h-full relative w-full\" [class]=\"tableClass()\">\n @if (loading()) {\n <div\n class=\"mad-datatable-spinner-wrapper bg-(--datatable-background) opacity-80 absolute inset-0 w-full h-full flex justify-center items-center z-[99999] [pointer-events:unset]\"\n >\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n }\n <table\n [id]=\"id()\"\n mat-table\n [dataSource]=\"dataSource\"\n matSort\n (matSortChange)=\"onSortingEvent($event)\"\n madFilter\n (madFilterChange)=\"onColumnBasedFilterEvent($event)\"\n [multiTemplateDataRows]=\"!!expandableDef()\"\n >\n <!-- Row actions column-->\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\">\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [ngClass]=\"showActionColumn ? 'row-action-cell' : 'no-action-cell'\">\n <!-- BATCH: master checkbox -->\n @if (selectionEmitModeState() !== 'NONE' && selectionModeState() === 'BATCH') {\n <div class=\"mad-datatable-checkbox-container mx-2\">\n <mat-checkbox (change)=\"onToggleSelectAll()\" [checked]=\"allSelected\"></mat-checkbox>\n </div>\n }\n <!-- SINGLE / NONE: nothing in header row -->\n </th>\n <td mat-cell *matCellDef=\"let element\" [ngClass]=\"showActionColumn ? 'row-action-cell' : 'no-action-cell'\">\n <!-- BATCH: row checkbox -->\n @if (showCheckbox(element)) {\n <div class=\"mad-datatable-checkbox-container mx-2\" (click)=\"onRowEvent($event, element)\">\n <mat-checkbox class=\"no-pointer-events\" [checked]=\"isSelected(element.rowId)\"></mat-checkbox>\n </div>\n }\n <!-- SINGLE: row action menu icon -->\n @if (showRowActionIcon(element) && hasVisibleRowActions(element)) {\n <mad-icon-button\n data-cy=\"row-action-button\"\n [matMenuTriggerData]=\"{ element: element }\"\n [matMenuTriggerFor]=\"rowActionMenu\"\n (click)=\"onSelectionEvent(element.rowId)\"\n >\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n }\n <!-- SINGLE: row radio button -->\n @if (showRadioButton(element)) {\n <div class=\"mad-datatable-checkbox-container mx-2\" (click)=\"onRowEvent($event, element)\">\n <mat-radio-button class=\"no-pointer-events\" [checked]=\"isSelected(element.rowId)\"></mat-radio-button>\n </div>\n }\n <!-- EXPANDABLE: row is expandable/collapsable -->\n @if (showExpandableButton(element)) {\n <mad-icon-button (click)=\"onExpand($event, element)\">\n @if (expandedElement !== element) {\n <mat-icon>keyboard_arrow_down</mat-icon>\n } @else {\n <mat-icon>keyboard_arrow_up</mat-icon>\n }\n </mad-icon-button>\n }\n <!-- NONE: nothing -->\n </td>\n </ng-container>\n <!-- Cell definitions and rows with injected cells -->\n @for (column of columnsState(); track column.id) {\n <ng-container [matColumnDef]=\"column.id\">\n <!-- header cell to be injected -->\n @switch (getDataTableHeaderType(column)) {\n @case ('SORT') {\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n [class.text-right]=\"column.isRightAligned\"\n mat-sort-header=\"{{ column.orderByName ? column.orderByName : column.dataPropertyName }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n >\n {{ translateLabels() ? (column.label | translate) : column.label }}\n </th>\n }\n @case ('FILTER') {\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n [class.text-right]=\"column.isRightAligned\"\n mad-filter-header=\"{{ column.dataPropertyName }}\"\n [madFilterColumnRightAligned]=\"column.isRightAligned\"\n [madFilterOptions]=\"column.filterParams?.filterOptions\"\n >\n {{ translateLabels() ? (column.label | translate) : column.label }}\n </th>\n }\n @case ('SORT_AND_FILTER') {\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n [class.text-right]=\"column.isRightAligned\"\n mat-sort-header=\"{{ column.orderByName ? column.orderByName : column.dataPropertyName }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n mad-filter-header=\"{{ column.dataPropertyName }}\"\n [madFilterColumnRightAligned]=\"column.isRightAligned\"\n [madFilterOptions]=\"column.filterParams?.filterOptions\"\n >\n {{ translateLabels() ? (column.label | translate) : column.label }}\n </th>\n }\n @default {\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ translateLabels() ? (column.label | translate) : column.label }}\n </th>\n }\n }\n\n <!-- data cell to be injected -->\n <td\n mat-cell\n *matCellDef=\"let element\"\n [class.text-right]=\"column.isRightAligned\"\n [class.mad-dt-child-cell]=\"element.parentId\"\n (click)=\"!disableRowClick() && onRowEvent($event, element)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n getCustomCellTemplate(column.id) || defaultCellTemplate;\n context: { column: column, element: element, $implicit: element }\n \"\n ></ng-container>\n </td>\n </ng-container>\n }\n\n <!-- Expanded Content Column - The row is made up of this one column that spans across all columns -->\n <ng-container [matColumnDef]=\"expandableColumnDef\">\n <td mat-cell *matCellDef=\"let element\" [attr.colspan]=\"columnsState().length + 1\">\n <div class=\"mad-data-table-expandable-area\" [class.mad-data-table-expandable-area-expanded]=\"element === expandedElement\">\n <div class=\"mad-data-table-expandable-content\">\n @if (getCustomExpandableTemplate(); as expandableTemplate) {\n <ng-container\n *ngTemplateOutlet=\"expandableTemplate; context: { column: element, element: element, $implicit: element }\"\n ></ng-container>\n }\n </div>\n </div>\n </td>\n </ng-container>\n\n <!-- header row where cells will be injected -->\n <tr mat-header-row *matHeaderRowDef=\"columnIdsState()\"></tr>\n <!-- data row where cells will be injected -->\n <tr\n mat-row\n [class.clickable-table-row]=\"!row.parentId && selectionEmitModeState() !== 'NONE'\"\n *matRowDef=\"let row; columns: columnIdsState()\"\n (click)=\"!!expandableDef() && onExpand($event, row)\"\n ></tr>\n <tr\n mat-row\n *matRowDef=\"let element; columns: [expandableColumnDef]; when: isExpandableDetailRow\"\n class=\"mad-data-table-expandable-row\"\n ></tr>\n <tr class=\"mat-row\" *matNoDataRow>\n <td class=\"mat-cell noDataText columnBasedFilter w-full text-center relative pt-2.5\" [attr.colspan]=\"columnIdsState().length\">\n {{ translateLabels() ? (noDataText() | translate) : noDataText() }}\n </td>\n </tr>\n </table>\n </div>\n} @else {\n <!-- No data alert -->\n <div data-cy=\"no-data-block\" class=\"noDataText w-full text-center relative\">\n @if (loading()) {\n <div\n class=\"mad-datatable-spinner-wrapper bg-(--datatable-background) opacity-80 absolute inset-0 w-full h-full flex justify-center items-center z-[99999] [pointer-events:unset]\"\n >\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n }\n {{ translateLabels() ? (noDataText() | translate) : noDataText() }}\n </div>\n}\n<div data-cy=\"table-bottom-area\" class=\"mad-data-table-bottom-area flex flex-row\">\n <div data-cy=\"definition-button-block\" class=\"mad-data-table-bottom-info-area flex flex-1\">\n <!-- column settings: 1 definition -->\n @if (editableColumnDefinitionsState().length === 1) {\n <mad-icon-button (click)=\"onColumnSettings()\">\n <mat-icon class=\"material-icons-outlined\">view_column</mat-icon>\n </mad-icon-button>\n }\n <!-- column settings: multiple definitions -->\n @if (editableColumnDefinitionsState().length > 0) {\n <mad-icon-button [matMenuTriggerFor]=\"editableDefinitionMenu\">\n <mat-icon>view_column</mat-icon>\n </mad-icon-button>\n }\n <!-- column view: multiple definitions -->\n @if (viewableColumnDefinitionsState().length > 0) {\n <mad-icon-button [matMenuTriggerFor]=\"viewableDefinitionMenu\">\n <mat-icon>preview</mat-icon>\n </mad-icon-button>\n }\n </div>\n\n <!-- Pagination -->\n <mat-paginator\n [style.display]=\"paginationEnabled() ? 'block' : 'none'\"\n [length]=\"pageLengthState()\"\n [pageIndex]=\"pageIndexState()\"\n [pageSize]=\"pageSizeState()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n (page)=\"onPageEvent($event)\"\n showFirstLastButtons\n >\n </mat-paginator>\n</div>\n\n<!-- default cell template -->\n<ng-template #defaultCellTemplate let-element=\"element\" let-column=\"column\">\n <span>\n {{ element[column.dataPropertyName] }}\n </span>\n</ng-template>\n\n<!-- custom cell templates injected from parent -->\n<ng-content></ng-content>\n", styles: [":host{display:flex;flex-direction:column;min-height:112px;flex:1 1 auto;background-color:var(--datatable-background)}.datatable-vertical-stretch-to-parent{flex:1;max-height:100%;width:100%;display:flex;flex-direction:column}.datatable-max-height-500{max-height:500px}.datatable-max-height-300{max-height:300px}.datatable-max-height,.datatable-max-height-500,.datatable-max-height-300{flex:1;width:100%;display:flex;flex-direction:column}.datatable table{--mat-table-row-item-outline-color: var(--datatable-row-border-color, #0000001f);width:100%;max-height:100%}.datatable table th,.datatable table td{width:auto;text-overflow:ellipsis;white-space:nowrap}.datatable table th{overflow:visible}.datatable table td{overflow:hidden}.layout-fixed table{table-layout:fixed}.layout-fixed table th{font-weight:700}.layout-fixed table td{white-space:normal;word-wrap:break-word}.row-action-cell{width:48px!important;padding-left:8px!important}.no-action-cell{width:8px!important;padding:0}.text-right{text-align:right!important;padding-right:24px!important}.mad-data-table-expandable-row{height:0;display:contents;padding:0}.mad-data-table-expandable-row td{border-top-color:transparent;border-bottom-color:transparent}.mad-data-table-expandable-area{overflow:hidden;display:grid;grid-template-rows:0fr;transition:grid-template-rows 225ms cubic-bezier(.4,0,.2,1);width:100%}.mad-data-table-expandable-area.mad-data-table-expandable-area-expanded{grid-template-rows:1fr}.mad-data-table-expandable-content{min-height:0;min-width:0;overflow:hidden;visibility:hidden;width:100%;transition:visibility 225ms cubic-bezier(.4,0,.2,1)}.mad-data-table-expandable-area-expanded>.mad-data-table-expandable-content{visibility:visible}@media(prefers-reduced-motion:reduce){.mad-data-table-expandable-area,.mad-data-table-expandable-content{transition:none}}.mat-mdc-header-row th{position:sticky;top:0;background-color:var(--datatable-background);z-index:1}.no-pointer-events{pointer-events:none}.active-column-definition{color:var(--mat-sys-on-surface);background-color:var(--datatable-hover)}.mad-dt-child-cell{color:var(--mat-sys-on-surface-variant)}::ng-deep .mat-sort-header .mat-sort-header-arrow:hover{color:var(--main-primary);cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$2.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: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$4.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "directive", type: i1$4.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: MatPaginatorModule }, { kind: "component", type: i7.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i5.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i5.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i9.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i9.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i9.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i9.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i9.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i9.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i9.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i9.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i9.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i9.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i9.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i10.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["color"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "component", type: MadButtonGroupComponent, selector: "mad-button-group" }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i14.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "component", type: i15.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "directive", type: i16.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: DataTableFilterHeader, selector: "th[mad-filter-header]", inputs: ["mad-filter-header", "madFilterColumnRightAligned", "madFilterOptions"] }, { kind: "directive", type: DataTableFilter, selector: "[madFilter]", outputs: ["madFilterChange"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i2$4.TranslatePipe, name: "translate" }] }); }
3519
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: DataTableComponent, isStandalone: true, selector: "mad-data-table", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, filterLabel: { classPropertyName: "filterLabel", publicName: "filterLabel", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, filterColumnsLabel: { classPropertyName: "filterColumnsLabel", publicName: "filterColumnsLabel", isSignal: true, isRequired: false, transformFunction: null }, filterColumnsPlaceHolder: { classPropertyName: "filterColumnsPlaceHolder", publicName: "filterColumnsPlaceHolder", isSignal: true, isRequired: false, transformFunction: null }, showEmptyTable: { classPropertyName: "showEmptyTable", publicName: "showEmptyTable", isSignal: true, isRequired: false, transformFunction: null }, noDataText: { classPropertyName: "noDataText", publicName: "noDataText", isSignal: true, isRequired: false, transformFunction: null }, columnSettingsModalTitleLabel: { classPropertyName: "columnSettingsModalTitleLabel", publicName: "columnSettingsModalTitleLabel", isSignal: true, isRequired: false, transformFunction: null }, selectedLabel: { classPropertyName: "selectedLabel", publicName: "selectedLabel", isSignal: true, isRequired: false, transformFunction: null }, availableLabel: { classPropertyName: "availableLabel", publicName: "availableLabel", isSignal: true, isRequired: false, transformFunction: null }, saveLabel: { classPropertyName: "saveLabel", publicName: "saveLabel", isSignal: true, isRequired: false, transformFunction: null }, deleteLabel: { classPropertyName: "deleteLabel", publicName: "deleteLabel", isSignal: true, isRequired: false, transformFunction: null }, cancelLabel: { classPropertyName: "cancelLabel", publicName: "cancelLabel", isSignal: true, isRequired: false, transformFunction: null }, infoTextLabel: { classPropertyName: "infoTextLabel", publicName: "infoTextLabel", isSignal: true, isRequired: false, transformFunction: null }, tableClass: { classPropertyName: "tableClass", publicName: "tableClass", isSignal: true, isRequired: false, transformFunction: null }, translateLabels: { classPropertyName: "translateLabels", publicName: "translateLabels", isSignal: true, isRequired: false, transformFunction: null }, useAsync: { classPropertyName: "useAsync", publicName: "useAsync", isSignal: true, isRequired: false, transformFunction: null }, stateful: { classPropertyName: "stateful", publicName: "stateful", isSignal: true, isRequired: false, transformFunction: null }, persistenceConfig: { classPropertyName: "persistenceConfig", publicName: "persistenceConfig", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, tableData: { classPropertyName: "tableData", publicName: "tableData", isSignal: true, isRequired: false, transformFunction: null }, idGenerator: { classPropertyName: "idGenerator", publicName: "idGenerator", isSignal: true, isRequired: false, transformFunction: null }, parentIdGenerator: { classPropertyName: "parentIdGenerator", publicName: "parentIdGenerator", isSignal: true, isRequired: false, transformFunction: null }, defaultSort: { classPropertyName: "defaultSort", publicName: "defaultSort", isSignal: true, isRequired: false, transformFunction: null }, externalFilter: { classPropertyName: "externalFilter", publicName: "externalFilter", isSignal: true, isRequired: false, transformFunction: null }, paginationEnabled: { classPropertyName: "paginationEnabled", publicName: "paginationEnabled", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, selectionEmitType: { classPropertyName: "selectionEmitType", publicName: "selectionEmitType", isSignal: true, isRequired: false, transformFunction: null }, showDeleteFilterAction: { classPropertyName: "showDeleteFilterAction", publicName: "showDeleteFilterAction", isSignal: true, isRequired: false, transformFunction: null }, disableRowClick: { classPropertyName: "disableRowClick", publicName: "disableRowClick", isSignal: true, isRequired: false, transformFunction: null }, deleteDefinitionAllowed: { classPropertyName: "deleteDefinitionAllowed", publicName: "deleteDefinitionAllowed", isSignal: true, isRequired: false, transformFunction: null }, rowExpandable: { classPropertyName: "rowExpandable", publicName: "rowExpandable", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, filterEnabled: { classPropertyName: "filterEnabled", publicName: "filterEnabled", isSignal: true, isRequired: false, transformFunction: null }, filterModeInput: { classPropertyName: "filterModeInput", publicName: "filterMode", isSignal: true, isRequired: false, transformFunction: null }, filterValueInput: { classPropertyName: "filterValueInput", publicName: "filterValue", isSignal: true, isRequired: false, transformFunction: null }, externalPaginator: { classPropertyName: "externalPaginator", publicName: "externalPaginator", isSignal: true, isRequired: false, transformFunction: null }, defaultPageSize: { classPropertyName: "defaultPageSize", publicName: "defaultPageSize", isSignal: true, isRequired: false, transformFunction: null }, selectionEmitModeInput: { classPropertyName: "selectionEmitModeInput", publicName: "selectionEmitMode", isSignal: true, isRequired: false, transformFunction: null }, forceMode: { classPropertyName: "forceMode", publicName: "forceMode", isSignal: true, isRequired: false, transformFunction: null }, forceSelectionMode: { classPropertyName: "forceSelectionMode", publicName: "forceSelectionMode", isSignal: true, isRequired: false, transformFunction: null }, displayedColumnsInput: { classPropertyName: "displayedColumnsInput", publicName: "displayedColumns", isSignal: true, isRequired: false, transformFunction: null }, displayedColumnDefinition: { classPropertyName: "displayedColumnDefinition", publicName: "displayedColumnDefinition", isSignal: true, isRequired: false, transformFunction: null }, columnDefinitions: { classPropertyName: "columnDefinitions", publicName: "columnDefinitions", isSignal: true, isRequired: false, transformFunction: null }, allColumns: { classPropertyName: "allColumns", publicName: "allColumns", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionEvent: "actionEvent", selectionEvent: "selectionEvent", sortEvent: "sortEvent", filterEvent: "filterEvent", pageEvent: "pageEvent", allColumnsEvent: "allColumnsEvent", columnDefinitionChangeEvent: "columnDefinitionChangeEvent", viewDefinitionChangeEvent: "viewDefinitionChangeEvent" }, providers: [DATA_TABLE_PERSISTENCE_SERVICE_PROVIDER, MAD_DATA_TABL_GLOBAL_CONFIGURATION_PROVIDER], queries: [{ propertyName: "columnDefs", predicate: DataTableTemplateColumnDefinition, isSignal: true }, { propertyName: "expandableDef", first: true, predicate: DataTableTemplateExpandableCellDefinition, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }, { propertyName: "matSort", first: true, predicate: MatSort, descendants: true, isSignal: true }, { propertyName: "filter", first: true, predicate: DataTableFilter, descendants: true, isSignal: true }], ngImport: i0, template: "<div data-cy=\"table-action-bar\" class=\"mad-datatable-action-bar flex justify-between items-baseline\">\n <!-- Table actions: displayed before the table -->\n @if (tableActionsState().length || (filterModeState() === 'COLUMN_BASED' && showDeleteFilterAction())) {\n <div>\n @for (actionGroup of tableActionsState(); track actionGroup) {\n <mad-button-group class=\"table-action-group inline-flex align-middle mr-[0.5em] mb-[0.5em] mt-[0.5em]\">\n @for (tableAction of actionGroup; track $index) {\n <mad-outline-button [hidden]=\"isHidden(tableAction)\" [disabled]=\"isDisabled(tableAction)\" (click)=\"onActionEvent(tableAction)\">\n {{ translateLabels() ? (tableAction.label | translate) : tableAction.label }}\n {{ getSelectedCount(tableAction.type) }}\n </mad-outline-button>\n }\n </mad-button-group>\n }\n @if (filterModeState() === 'COLUMN_BASED' && showDeleteFilterAction()) {\n <mad-button-group class=\"table-action-group inline-flex align-middle mr-[0.5em] mb-[0.5em] mt-[0.5em]\">\n <button\n matIconButton\n [matTooltip]=\"'common.filter.delete.tooltip' | translate\"\n [attr.aria-label]=\"'common.filter.delete.tooltip' | translate\"\n matBadgeColor=\"warn\"\n [matBadge]=\"getFilterBadgeContent()\"\n [disabled]=\"disableDeleteFilterButton()\"\n class=\"delete-filter-action mat-primary align-middle\"\n (click)=\"onDeleteFilter()\"\n >\n <mat-icon fontSet=\"material-icons-outlined\" aria-hidden=\"true\"> filter_alt_off </mat-icon>\n </button>\n </mad-button-group>\n }\n </div>\n }\n @if (filterModeState() === 'TABLE_BASED') {\n <mat-form-field data-cy=\"filter-input\">\n <mat-label>{{ translateLabels() ? (filterLabel() | translate) : filterLabel() }}</mat-label>\n <input matInput autocomplete=\"off\" (keyup)=\"onTableBasedFilterEvent($event)\" placeholder=\"{{ filterPlaceholder() }}\" />\n </mat-form-field>\n }\n</div>\n\n<!-- Row action menu -->\n<mat-menu #rowActionMenu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n @for (rowAction of rowActionsState(); track rowAction) {\n @if (!isHidden(rowAction)) {\n <button\n data-cy=\"row-action-menu-button\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onRowEvent($event, element, rowAction)\"\n [disabled]=\"isDisabled(rowAction)\"\n >\n {{ translateLabels() ? (rowAction.label | translate) : rowAction.label }}\n </button>\n }\n }\n </ng-template>\n</mat-menu>\n\n<!-- editable definition menu -->\n<mat-menu #editableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n @for (definition of editableColumnDefinitionsState(); track definition) {\n <button\n mat-menu-item\n class=\"row-action\"\n (click)=\"onColumnSettings(definition)\"\n [ngClass]=\"{ 'active-column-definition': isCurrentDefinition(definition) }\"\n >\n {{ translateLabels() ? (definition.label | translate) : definition.label }}\n </button>\n }\n </ng-template>\n</mat-menu>\n\n<!-- viewable definition menu -->\n<mat-menu #viewableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n @for (definition of viewableColumnDefinitionsState(); track definition) {\n <button\n mat-menu-item\n class=\"row-action\"\n (click)=\"onViewDefinition(definition)\"\n [ngClass]=\"{ 'active-column-definition': isCurrentDefinition(definition) }\"\n >\n {{ translateLabels() ? (definition.label | translate) : definition.label }}\n </button>\n }\n </ng-template>\n</mat-menu>\n\n<!-- Table -->\n@if (filterModeState() === 'COLUMN_BASED' || showEmptyTable() || !!dataSource.filteredData?.length) {\n <div class=\"datatable overflow-auto flex-auto h-full relative w-full\" [class]=\"tableClass()\">\n @if (loading()) {\n <div\n class=\"mad-datatable-spinner-wrapper bg-(--datatable-background) opacity-80 absolute inset-0 w-full h-full flex justify-center items-center z-[99999] [pointer-events:unset]\"\n >\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n }\n <table\n [id]=\"id()\"\n mat-table\n [dataSource]=\"dataSource\"\n matSort\n (matSortChange)=\"onSortingEvent($event)\"\n madFilter\n (madFilterChange)=\"onColumnBasedFilterEvent($event)\"\n [multiTemplateDataRows]=\"!!expandableDef()\"\n >\n <!-- Row actions column-->\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\">\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [ngClass]=\"showActionColumn ? 'row-action-cell' : 'no-action-cell'\">\n <!-- BATCH: master checkbox -->\n @if (selectionEmitModeState() !== 'NONE' && selectionModeState() === 'BATCH') {\n <div class=\"mad-datatable-checkbox-container mx-2\">\n <mat-checkbox (change)=\"onToggleSelectAll()\" [checked]=\"allSelected\"></mat-checkbox>\n </div>\n }\n <!-- SINGLE / NONE: nothing in header row -->\n </th>\n <td mat-cell *matCellDef=\"let element\" [ngClass]=\"showActionColumn ? 'row-action-cell' : 'no-action-cell'\">\n <!-- BATCH: row checkbox -->\n @if (showCheckbox(element)) {\n <div class=\"mad-datatable-checkbox-container mx-2\" (click)=\"onRowEvent($event, element)\">\n <mat-checkbox class=\"no-pointer-events\" [checked]=\"isSelected(element.rowId)\"></mat-checkbox>\n </div>\n }\n <!-- SINGLE: row action menu icon -->\n @if (showRowActionIcon(element) && hasVisibleRowActions(element)) {\n <mad-icon-button\n data-cy=\"row-action-button\"\n [matMenuTriggerData]=\"{ element: element }\"\n [matMenuTriggerFor]=\"rowActionMenu\"\n (click)=\"onSelectionEvent(element.rowId)\"\n >\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n }\n <!-- SINGLE: row radio button -->\n @if (showRadioButton(element)) {\n <div class=\"mad-datatable-checkbox-container mx-2\" (click)=\"onRowEvent($event, element)\">\n <mat-radio-button class=\"no-pointer-events\" [checked]=\"isSelected(element.rowId)\"></mat-radio-button>\n </div>\n }\n <!-- EXPANDABLE: row is expandable/collapsable -->\n @if (showExpandableButton(element)) {\n <mad-icon-button (click)=\"onExpand($event, element)\">\n @if (expandedElement !== element) {\n <mat-icon>keyboard_arrow_down</mat-icon>\n } @else {\n <mat-icon>keyboard_arrow_up</mat-icon>\n }\n </mad-icon-button>\n }\n <!-- NONE: nothing -->\n </td>\n </ng-container>\n <!-- Cell definitions and rows with injected cells -->\n @for (column of columnsState(); track column.id) {\n <ng-container [matColumnDef]=\"column.id\">\n <!-- header cell to be injected -->\n @switch (getDataTableHeaderType(column)) {\n @case ('SORT') {\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n [class.text-right]=\"column.isRightAligned\"\n mat-sort-header=\"{{ column.orderByName ? column.orderByName : column.dataPropertyName }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n >\n {{ translateLabels() ? (column.label | translate) : column.label }}\n </th>\n }\n @case ('FILTER') {\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n [class.text-right]=\"column.isRightAligned\"\n mad-filter-header=\"{{ column.dataPropertyName }}\"\n [madFilterColumnRightAligned]=\"column.isRightAligned\"\n [madFilterOptions]=\"column.filterParams?.filterOptions\"\n >\n {{ translateLabels() ? (column.label | translate) : column.label }}\n </th>\n }\n @case ('SORT_AND_FILTER') {\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n [class.text-right]=\"column.isRightAligned\"\n mat-sort-header=\"{{ column.orderByName ? column.orderByName : column.dataPropertyName }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n mad-filter-header=\"{{ column.dataPropertyName }}\"\n [madFilterColumnRightAligned]=\"column.isRightAligned\"\n [madFilterOptions]=\"column.filterParams?.filterOptions\"\n >\n {{ translateLabels() ? (column.label | translate) : column.label }}\n </th>\n }\n @default {\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ translateLabels() ? (column.label | translate) : column.label }}\n </th>\n }\n }\n\n <!-- data cell to be injected -->\n <td\n mat-cell\n *matCellDef=\"let element\"\n [class.text-right]=\"column.isRightAligned\"\n [class.mad-dt-child-cell]=\"element.parentId\"\n (click)=\"!disableRowClick() && onRowEvent($event, element)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n getCustomCellTemplate(column.id) || defaultCellTemplate;\n context: { column: column, element: element, $implicit: element }\n \"\n ></ng-container>\n </td>\n </ng-container>\n }\n\n <!-- Expanded Content Column - The row is made up of this one column that spans across all columns -->\n <ng-container [matColumnDef]=\"expandableColumnDef\">\n <td mat-cell *matCellDef=\"let element\" [attr.colspan]=\"columnsState().length + 1\">\n <div class=\"mad-data-table-expandable-area\" [class.mad-data-table-expandable-area-expanded]=\"element === expandedElement\">\n <div class=\"mad-data-table-expandable-content\">\n @if (getCustomExpandableTemplate(); as expandableTemplate) {\n <ng-container\n *ngTemplateOutlet=\"expandableTemplate; context: { column: element, element: element, $implicit: element }\"\n ></ng-container>\n }\n </div>\n </div>\n </td>\n </ng-container>\n\n <!-- header row where cells will be injected -->\n <tr mat-header-row *matHeaderRowDef=\"columnIdsState()\"></tr>\n <!-- data row where cells will be injected -->\n <tr\n mat-row\n [class.clickable-table-row]=\"!row.parentId && selectionEmitModeState() !== 'NONE'\"\n *matRowDef=\"let row; columns: columnIdsState()\"\n (click)=\"!!expandableDef() && onExpand($event, row)\"\n ></tr>\n <tr\n mat-row\n *matRowDef=\"let element; columns: [expandableColumnDef]; when: isExpandableDetailRow\"\n class=\"mad-data-table-expandable-row\"\n ></tr>\n <tr class=\"mat-row\" *matNoDataRow>\n <td class=\"mat-cell noDataText columnBasedFilter w-full text-center relative pt-2.5\" [attr.colspan]=\"columnIdsState().length\">\n {{ translateLabels() ? (noDataText() | translate) : noDataText() }}\n </td>\n </tr>\n </table>\n </div>\n} @else {\n <!-- No data alert -->\n <div data-cy=\"no-data-block\" class=\"noDataText w-full text-center relative\">\n @if (loading()) {\n <div\n class=\"mad-datatable-spinner-wrapper bg-(--datatable-background) opacity-80 absolute inset-0 w-full h-full flex justify-center items-center z-[99999] [pointer-events:unset]\"\n >\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n }\n {{ translateLabels() ? (noDataText() | translate) : noDataText() }}\n </div>\n}\n<div data-cy=\"table-bottom-area\" class=\"mad-data-table-bottom-area flex flex-row\">\n <div data-cy=\"definition-button-block\" class=\"mad-data-table-bottom-info-area flex flex-1\">\n <!-- column settings: 1 definition -->\n @if (editableColumnDefinitionsState().length === 1) {\n <mad-icon-button (click)=\"onColumnSettings()\">\n <mat-icon class=\"material-icons-outlined\">view_column</mat-icon>\n </mad-icon-button>\n }\n <!-- column settings: multiple definitions -->\n @if (editableColumnDefinitionsState().length > 0) {\n <mad-icon-button [matMenuTriggerFor]=\"editableDefinitionMenu\">\n <mat-icon>view_column</mat-icon>\n </mad-icon-button>\n }\n <!-- column view: multiple definitions -->\n @if (viewableColumnDefinitionsState().length > 0) {\n <mad-icon-button [matMenuTriggerFor]=\"viewableDefinitionMenu\">\n <mat-icon>preview</mat-icon>\n </mad-icon-button>\n }\n </div>\n\n <!-- Pagination -->\n <mat-paginator\n [style.display]=\"paginationEnabled() ? 'block' : 'none'\"\n [length]=\"pageLengthState()\"\n [pageIndex]=\"pageIndexState()\"\n [pageSize]=\"pageSizeState()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n (page)=\"onPageEvent($event)\"\n showFirstLastButtons\n >\n </mat-paginator>\n</div>\n\n<!-- default cell template -->\n<ng-template #defaultCellTemplate let-element=\"element\" let-column=\"column\">\n <span>\n {{ element[column.dataPropertyName] }}\n </span>\n</ng-template>\n\n<!-- custom cell templates injected from parent -->\n<ng-content></ng-content>\n", styles: [":host{display:flex;flex-direction:column;min-height:112px;flex:1 1 auto;background-color:var(--datatable-background)}.datatable-vertical-stretch-to-parent{flex:1;max-height:100%;width:100%;display:flex;flex-direction:column}.datatable-max-height-500{max-height:500px}.datatable-max-height-300{max-height:300px}.datatable-max-height,.datatable-max-height-500,.datatable-max-height-300{flex:1;width:100%;display:flex;flex-direction:column}.datatable table{--mat-table-row-item-outline-color: var(--datatable-row-border-color, #0000001f);width:100%;max-height:100%}.datatable table th,.datatable table td{width:auto;text-overflow:ellipsis;white-space:nowrap}.datatable table th{overflow:visible}.datatable table td{overflow:hidden}.layout-fixed table{table-layout:fixed}.layout-fixed table th{font-weight:700}.layout-fixed table td{white-space:normal;word-wrap:break-word}.row-action-cell{width:48px!important;padding-left:8px!important}.no-action-cell{width:8px!important;padding:0}.text-right{text-align:right!important;padding-right:24px!important}.mad-data-table-expandable-row{height:0;display:contents;padding:0}.mad-data-table-expandable-row td{border-top-color:transparent;border-bottom-color:transparent}.mad-data-table-expandable-area{overflow:hidden;display:grid;grid-template-rows:0fr;transition:grid-template-rows 225ms cubic-bezier(.4,0,.2,1);width:100%}.mad-data-table-expandable-area.mad-data-table-expandable-area-expanded{grid-template-rows:1fr}.mad-data-table-expandable-content{min-height:0;min-width:0;overflow:hidden;visibility:hidden;width:100%;transition:visibility 225ms cubic-bezier(.4,0,.2,1)}.mad-data-table-expandable-area-expanded>.mad-data-table-expandable-content{visibility:visible}@media(prefers-reduced-motion:reduce){.mad-data-table-expandable-area,.mad-data-table-expandable-content{transition:none}}.mat-mdc-header-row th{position:sticky;top:0;background-color:var(--datatable-background);z-index:1}.no-pointer-events{pointer-events:none}.active-column-definition{color:var(--mat-sys-on-surface);background-color:var(--datatable-hover)}.mad-dt-child-cell{color:var(--mat-sys-on-surface-variant)}::ng-deep .mat-sort-header .mat-sort-header-arrow:hover{color:var(--main-primary);cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { 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: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$4.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "directive", type: i1$4.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: MatPaginatorModule }, { kind: "component", type: i7.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i5.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i5.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i9.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i9.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i9.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i9.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i9.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i9.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i9.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i9.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i9.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i9.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i9.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i10.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["color"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "component", type: MadButtonGroupComponent, selector: "mad-button-group" }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i14.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "component", type: i15.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "directive", type: i16.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: DataTableFilterHeader, selector: "th[mad-filter-header]", inputs: ["mad-filter-header", "madFilterColumnRightAligned", "madFilterOptions"] }, { kind: "directive", type: DataTableFilter, selector: "[madFilter]", outputs: ["madFilterChange"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i2$3.TranslatePipe, name: "translate" }] }); }
3167
3520
  }
3168
3521
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DataTableComponent, decorators: [{
3169
3522
  type: Component,
@@ -3216,122 +3569,396 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
3216
3569
  }]
3217
3570
  }], ctorParameters: () => [{ type: i0.TemplateRef }, { type: DataTableTemplateColumnDefinition }] });
3218
3571
 
3219
- class StepHeaderComponent extends CdkStepHeader {
3220
- constructor(_focusMonitor) {
3221
- super();
3222
- this._focusMonitor = _focusMonitor;
3572
+ class BaseQuickListComponent {
3573
+ constructor(changeDetectorRef, formBuilder) {
3574
+ this.changeDetectorRef = changeDetectorRef;
3575
+ this.formBuilder = formBuilder;
3576
+ this.allItems = [];
3577
+ this.addLabel = 'NOT SET';
3578
+ this.addPossible = true;
3579
+ this.removePossible = true;
3580
+ this.blankItem = {};
3581
+ this.added = new EventEmitter();
3582
+ this.removed = new EventEmitter();
3223
3583
  }
3224
- ngAfterViewInit() {
3225
- this._focusMonitor.monitor(this._elementRef, true);
3584
+ ngOnInit() {
3585
+ this.addEventFunction = this.addItem.bind(this);
3586
+ if (this.minItems) {
3587
+ for (let n = this.allItems.length; n < this.minItems; n++) {
3588
+ this.interalAddItem();
3589
+ }
3590
+ }
3226
3591
  }
3227
- ngOnDestroy() {
3228
- this._focusMonitor.stopMonitoring(this._elementRef);
3592
+ ngAfterViewInit() {
3593
+ setTimeout(() => this.setFocusOnAdd(), 1);
3229
3594
  }
3230
- /** Focuses the step header. */
3231
- focus(origin, options) {
3232
- if (origin) {
3233
- this._focusMonitor.focusVia(this._elementRef, origin, options);
3234
- }
3235
- else {
3236
- this._elementRef.nativeElement.focus(options);
3595
+ addItem() {
3596
+ const newItem = this.interalAddItem();
3597
+ if (!!newItem) {
3598
+ this.added.emit(newItem);
3237
3599
  }
3238
3600
  }
3239
- getCssForState() {
3240
- if (this.completed) {
3241
- return 'step-state-complete';
3601
+ addReactiveItem() {
3602
+ if (this.isAddReactiveAllowed()) {
3603
+ this.added.emit(null);
3242
3604
  }
3243
- if (this.hasError) {
3244
- return 'step-state-error';
3605
+ }
3606
+ removeItem(item) {
3607
+ if (this.isDeleteAllowed()) {
3608
+ this.allItems.splice(this.allItems.indexOf(item), 1);
3609
+ this.removed.emit(item);
3245
3610
  }
3246
- return 'step-state-neutral';
3247
3611
  }
3248
- getIcon() {
3249
- if (this.completed) {
3250
- return 'check_circle_outline';
3612
+ removeReactiveItem(item) {
3613
+ if (this.isDeleteReactiveAllowed()) {
3614
+ const index = this.formArray.controls.indexOf(item);
3615
+ if (index >= 0) {
3616
+ this.formArray.controls.splice(index, 1);
3617
+ this.formArray.updateValueAndValidity();
3618
+ this.removed.emit(null);
3619
+ }
3251
3620
  }
3252
- else if (this.hasError) {
3253
- return 'error_outline';
3621
+ }
3622
+ setFocusOnAdd() {
3623
+ this.rowCountFocus = this.itemRows.length;
3624
+ this.itemRows.changes.subscribe((els) => {
3625
+ if (els.length > this.rowCountFocus && !!els.last) {
3626
+ const firstFocusable = els.last.nativeElement.querySelector("button, a, input, select, textarea, [tabindex]:not([tabindex='-1'])");
3627
+ if (firstFocusable) {
3628
+ firstFocusable.focus();
3629
+ }
3630
+ }
3631
+ this.rowCountFocus = els.length;
3632
+ });
3633
+ }
3634
+ isAddAllowed() {
3635
+ return this.addPossible && (!this.maxItems || this.allItems?.length < this.maxItems);
3636
+ }
3637
+ isAddReactiveAllowed() {
3638
+ return this.addPossible && (!this.maxItems || this.formArray?.controls.length < this.maxItems);
3639
+ }
3640
+ isDeleteAllowed() {
3641
+ return this.removePossible && (!this.minItems || this.allItems?.length > this.minItems);
3642
+ }
3643
+ isDeleteReactiveAllowed() {
3644
+ return this.removePossible && (!this.minItems || this.formArray?.controls.length > this.minItems);
3645
+ }
3646
+ interalAddItem() {
3647
+ if (this.isAddAllowed()) {
3648
+ const newItem = { ...this.blankItem };
3649
+ // creates ids in the form of "n5kdz1pljl8"
3650
+ newItem.id = Math.random().toString(36).substring(2);
3651
+ this.allItems.push(newItem);
3652
+ this.changeDetectorRef.detectChanges();
3653
+ return newItem;
3254
3654
  }
3255
- return '';
3655
+ return null;
3256
3656
  }
3257
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: StepHeaderComponent, deps: [{ token: i1$6.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component }); }
3258
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: StepHeaderComponent, isStandalone: true, selector: "mad-step-header", inputs: { color: "color", index: "index", label: "label", stepControl: "stepControl", errorMessage: "errorMessage", selected: "selected", active: "active", optional: "optional", hasError: "hasError", completed: "completed", closed: "closed" }, host: { attributes: { "role": "tab" }, classAttribute: "mad-step-header" }, usesInheritance: true, ngImport: i0, template: "<div\n class=\"header\"\n [ngClass]=\"{\n 'header-selected': this.selected && !this.closed,\n 'header-default': !this.selected || this.closed,\n 'error-border': this.hasError,\n 'check-border': !this.hasError,\n }\"\n>\n <div [ngClass]=\"this.getCssForState()\"></div>\n <div class=\"header-label\">\n <mat-icon class=\"material-icons-outlined\">\n {{ this.selected && !this.closed ? 'keyboard_arrow_down' : 'keyboard_arrow_right' }}\n </mat-icon>\n </div>\n @if (this.completed || this.hasError) {\n <div class=\"header-label\">\n <mat-icon [ngClass]=\"this.completed ? 'green-check' : 'red-error'\">\n {{ getIcon() }}\n </mat-icon>\n </div>\n }\n @if (!this.hasError && !this.completed) {\n <span data-testid=\"step-number\" class=\"header-label\">{{ this.index + 1 + '.' }}</span>\n }\n <div data-testid=\"step-label\" class=\"header-label\">{{ this.label }}</div>\n</div>\n", styles: [".header{overflow:hidden;outline:var(--error-color);cursor:pointer;box-sizing:content-box;-webkit-tap-highlight-color:transparent;border:1px solid var(--step-border-color);width:100%;height:62px;flex-direction:row;box-sizing:border-box;display:flex;gap:1em}.header-label{align-items:center;display:flex}.step-state-complete{width:5px;background:var(--step-complete-color)}.step-state-error{width:5px;background:var(--error-color)}.step-state-neutral{width:5px;background:var(--step-neutral-color)}.green-check{color:var(--step-complete-color)}.red-error{color:var(--error-color)}.check-border{border-color:var(--step-border-color)}.error-border{border-color:var(--error-color)}.header-selected{background:var(--step-header-selected-background)}.header-default{background:var(--step-header-default-background)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], encapsulation: i0.ViewEncapsulation.None }); }
3657
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: BaseQuickListComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
3658
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: BaseQuickListComponent, isStandalone: true, selector: "mad-base-quick-list", inputs: { allItems: "allItems", addLabel: "addLabel", addPossible: "addPossible", removePossible: "removePossible", blankItem: "blankItem", readonly: "readonly", maxItems: "maxItems", minItems: "minItems", formArray: "formArray" }, outputs: { added: "added", removed: "removed" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "itemRows", predicate: ["row"], descendants: true }], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.Eager }); }
3259
3659
  }
3260
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: StepHeaderComponent, decorators: [{
3660
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: BaseQuickListComponent, decorators: [{
3261
3661
  type: Component,
3262
- args: [{ selector: 'mad-step-header', inputs: ['color'], host: {
3263
- class: 'mad-step-header',
3264
- role: 'tab',
3265
- }, encapsulation: ViewEncapsulation.None, imports: [NgClass, MatIconModule], template: "<div\n class=\"header\"\n [ngClass]=\"{\n 'header-selected': this.selected && !this.closed,\n 'header-default': !this.selected || this.closed,\n 'error-border': this.hasError,\n 'check-border': !this.hasError,\n }\"\n>\n <div [ngClass]=\"this.getCssForState()\"></div>\n <div class=\"header-label\">\n <mat-icon class=\"material-icons-outlined\">\n {{ this.selected && !this.closed ? 'keyboard_arrow_down' : 'keyboard_arrow_right' }}\n </mat-icon>\n </div>\n @if (this.completed || this.hasError) {\n <div class=\"header-label\">\n <mat-icon [ngClass]=\"this.completed ? 'green-check' : 'red-error'\">\n {{ getIcon() }}\n </mat-icon>\n </div>\n }\n @if (!this.hasError && !this.completed) {\n <span data-testid=\"step-number\" class=\"header-label\">{{ this.index + 1 + '.' }}</span>\n }\n <div data-testid=\"step-label\" class=\"header-label\">{{ this.label }}</div>\n</div>\n", styles: [".header{overflow:hidden;outline:var(--error-color);cursor:pointer;box-sizing:content-box;-webkit-tap-highlight-color:transparent;border:1px solid var(--step-border-color);width:100%;height:62px;flex-direction:row;box-sizing:border-box;display:flex;gap:1em}.header-label{align-items:center;display:flex}.step-state-complete{width:5px;background:var(--step-complete-color)}.step-state-error{width:5px;background:var(--error-color)}.step-state-neutral{width:5px;background:var(--step-neutral-color)}.green-check{color:var(--step-complete-color)}.red-error{color:var(--error-color)}.check-border{border-color:var(--step-border-color)}.error-border{border-color:var(--error-color)}.header-selected{background:var(--step-header-selected-background)}.header-default{background:var(--step-header-default-background)}\n"] }]
3266
- }], ctorParameters: () => [{ type: i1$6.FocusMonitor }], propDecorators: { index: [{
3267
- type: Input
3268
- }], label: [{
3662
+ args: [{ selector: 'mad-base-quick-list', changeDetection: ChangeDetectionStrategy.Eager, template: '', standalone: true }]
3663
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.FormBuilder }], propDecorators: { allItems: [{
3269
3664
  type: Input
3270
- }], stepControl: [{
3665
+ }], addLabel: [{
3271
3666
  type: Input
3272
- }], errorMessage: [{
3667
+ }], addPossible: [{
3273
3668
  type: Input
3274
- }], selected: [{
3669
+ }], removePossible: [{
3275
3670
  type: Input
3276
- }], active: [{
3671
+ }], blankItem: [{
3277
3672
  type: Input
3278
- }], optional: [{
3673
+ }], readonly: [{
3279
3674
  type: Input
3280
- }], hasError: [{
3675
+ }], maxItems: [{
3281
3676
  type: Input
3282
- }], completed: [{
3677
+ }], minItems: [{
3283
3678
  type: Input
3284
- }], closed: [{
3679
+ }], formArray: [{
3285
3680
  type: Input
3681
+ }], added: [{
3682
+ type: Output
3683
+ }], removed: [{
3684
+ type: Output
3685
+ }], itemTemplate: [{
3686
+ type: ContentChild,
3687
+ args: [TemplateRef]
3688
+ }], itemRows: [{
3689
+ type: ViewChildren,
3690
+ args: ['row']
3286
3691
  }] } });
3287
3692
 
3288
- /**
3289
- * Animations used by the MAD stepper.
3290
- */
3291
- const madStepperAnimations = {
3292
- verticalStepTransition: trigger('stepTransition', [
3293
- state('previous', style({ height: '0px', visibility: 'hidden' })),
3294
- state('next', style({ height: '0px', visibility: 'hidden' })),
3295
- state('current', style({ height: '*', visibility: 'visible' })),
3296
- transition('* <=> current', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
3297
- ]),
3298
- };
3299
-
3300
- /**
3301
- * This library only supports reactive forms (`AbstractControl`) for `stepControl`, even though
3302
- * `@angular/cdk/stepper` also allows signal-based `Field` controls since Angular 22.
3303
- */
3304
- function isAbstractControl(control) {
3305
- return !!control && typeof control === 'object' && typeof control.markAllAsTouched === 'function';
3306
- }
3307
- class StepComponent extends CdkStep {
3308
- constructor(stepper, _viewContainerRef) {
3309
- super();
3310
- this.stepper = stepper;
3311
- this._viewContainerRef = _viewContainerRef;
3312
- /** Action event for the next button. If not set the StepComponent will handle the step navigation */
3313
- this.onNext = new EventEmitter();
3314
- /** Action event for the done button. If not set the StepComponent will handle the step navigation */
3315
- this.onDone = new EventEmitter();
3316
- /*** Action event when the header is clicked. If not set the StepComponent will handle the step navigation*/
3317
- this.onHeaderClick = new EventEmitter();
3318
- this.stepClosedSignal = signal(false, /* @ts-ignore */
3319
- ...(ngDevMode ? [{ debugName: "stepClosedSignal" }] : /* istanbul ignore next */ []));
3320
- this._isSelected = Subscription.EMPTY;
3321
- }
3322
- get stepClosed() {
3323
- return this.stepClosedSignal();
3693
+ class QuickListCompactComponent extends BaseQuickListComponent {
3694
+ constructor(changeDetectorRef, formBuilder) {
3695
+ super(changeDetectorRef, formBuilder);
3696
+ this.changeDetectorRef = changeDetectorRef;
3697
+ this.formBuilder = formBuilder;
3324
3698
  }
3325
- set stepClosed(stepClosed) {
3326
- this.stepClosedSignal.set(stepClosed);
3699
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: QuickListCompactComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
3700
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: QuickListCompactComponent, isStandalone: true, selector: "mad-quick-list-compact", usesInheritance: true, ngImport: i0, template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of allItems; track item; let isLast = $last) {\n @if (itemTemplate) {\n <div class=\"flex-container\" #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n @if (!readonly && isLast) {\n <mad-icon-button data-cy=\"add-item-button\" [disabled]=\"!isAddAllowed()\" (click)=\"addItem()\">\n <mat-icon>add_circle_outline</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n@if (!readonly && !this.allItems.length) {\n <mad-link-button data-cy=\"add-first-item-button\" (click)=\"addItem()\" [disabled]=\"!isAddAllowed()\">\n {{ addLabel }}\n </mad-link-button>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: LinkButtonComponent, selector: "mad-link-button" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
3701
+ }
3702
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: QuickListCompactComponent, decorators: [{
3703
+ type: Component,
3704
+ args: [{ selector: 'mad-quick-list-compact', changeDetection: ChangeDetectionStrategy.Eager, imports: [NgTemplateOutlet, IconButtonComponent, MatIconModule, LinkButtonComponent], template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of allItems; track item; let isLast = $last) {\n @if (itemTemplate) {\n <div class=\"flex-container\" #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n @if (!readonly && isLast) {\n <mad-icon-button data-cy=\"add-item-button\" [disabled]=\"!isAddAllowed()\" (click)=\"addItem()\">\n <mat-icon>add_circle_outline</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n@if (!readonly && !this.allItems.length) {\n <mad-link-button data-cy=\"add-first-item-button\" (click)=\"addItem()\" [disabled]=\"!isAddAllowed()\">\n {{ addLabel }}\n </mad-link-button>\n}\n" }]
3705
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.FormBuilder }] });
3706
+
3707
+ // Based on https://github.com/porscheinformatik/clarity-addons/blob/master/src/clr-addons/generic-quick-list/generic-quick-list.ts
3708
+ class QuickListComponent extends BaseQuickListComponent {
3709
+ constructor(changeDetectorRef, formBuilder) {
3710
+ super(changeDetectorRef, formBuilder);
3711
+ this.changeDetectorRef = changeDetectorRef;
3712
+ this.formBuilder = formBuilder;
3327
3713
  }
3328
- ngAfterContentInit() {
3329
- this._isSelected = this._stepper.steps.changes
3330
- .pipe(switchMap(() => this._stepper.selectionChange.pipe(map((event) => event.selectedStep === this), tap(() => (this.stepClosed = false)), startWith(this._stepper.selected === this))))
3331
- .subscribe();
3714
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: QuickListComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
3715
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: QuickListComponent, isStandalone: true, selector: "mad-quick-list", usesInheritance: true, ngImport: i0, template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of allItems; track item) {\n @if (itemTemplate) {\n <div #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n@if (!readonly) {\n <mad-outline-button data-cy=\"add-item-button\" (click)=\"addItem()\" [disabled]=\"!addPossible || !isAddAllowed()\">\n {{ addLabel }}\n </mad-outline-button>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["color"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
3716
+ }
3717
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: QuickListComponent, decorators: [{
3718
+ type: Component,
3719
+ args: [{ selector: 'mad-quick-list', changeDetection: ChangeDetectionStrategy.Eager, imports: [NgTemplateOutlet, IconButtonComponent, MatIconModule, OutlineButtonComponent], template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of allItems; track item) {\n @if (itemTemplate) {\n <div #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n@if (!readonly) {\n <mad-outline-button data-cy=\"add-item-button\" (click)=\"addItem()\" [disabled]=\"!addPossible || !isAddAllowed()\">\n {{ addLabel }}\n </mad-outline-button>\n}\n" }]
3720
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.FormBuilder }] });
3721
+
3722
+ class ReactiveFormQuickListComponent extends BaseQuickListComponent {
3723
+ constructor(changeDetectorRef, formBuilder) {
3724
+ super(changeDetectorRef, formBuilder);
3725
+ this.changeDetectorRef = changeDetectorRef;
3726
+ this.formBuilder = formBuilder;
3332
3727
  }
3333
- ngOnDestroy() {
3334
- this._isSelected.unsubscribe();
3728
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ReactiveFormQuickListComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
3729
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: ReactiveFormQuickListComponent, isStandalone: true, selector: "mad-reactive-form-quick-list", usesInheritance: true, ngImport: i0, template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of formArray.controls; track item) {\n @if (itemTemplate) {\n <div #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteReactiveAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeReactiveItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n\n@if (!readonly) {\n <mad-outline-button data-cy=\"add-item-button\" (click)=\"addReactiveItem()\" [disabled]=\"!isAddReactiveAllowed()\">\n {{ addLabel }}\n </mad-outline-button>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["color"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
3730
+ }
3731
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ReactiveFormQuickListComponent, decorators: [{
3732
+ type: Component,
3733
+ args: [{ selector: 'mad-reactive-form-quick-list', changeDetection: ChangeDetectionStrategy.Eager, imports: [NgTemplateOutlet, IconButtonComponent, MatIconModule, OutlineButtonComponent], template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of formArray.controls; track item) {\n @if (itemTemplate) {\n <div #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteReactiveAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeReactiveItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n\n@if (!readonly) {\n <mad-outline-button data-cy=\"add-item-button\" (click)=\"addReactiveItem()\" [disabled]=\"!isAddReactiveAllowed()\">\n {{ addLabel }}\n </mad-outline-button>\n}\n" }]
3734
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.FormBuilder }] });
3735
+
3736
+ class ReactiveFormQuickListCompactComponent extends BaseQuickListComponent {
3737
+ constructor(changeDetectorRef, formBuilder) {
3738
+ super(changeDetectorRef, formBuilder);
3739
+ this.changeDetectorRef = changeDetectorRef;
3740
+ this.formBuilder = formBuilder;
3741
+ }
3742
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ReactiveFormQuickListCompactComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
3743
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: ReactiveFormQuickListCompactComponent, isStandalone: true, selector: "mad-reactive-form-quick-list-compact", usesInheritance: true, ngImport: i0, template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of formArray.controls; track item; let isLast = $last) {\n @if (itemTemplate) {\n <div #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteReactiveAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeReactiveItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n @if (!readonly && isLast) {\n <mad-icon-button data-cy=\"add-item-button\" [disabled]=\"!isAddReactiveAllowed()\" (click)=\"addReactiveItem()\">\n <mat-icon>add_circle_outline</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n@if (!readonly && !this.formArray?.controls.length) {\n <mad-link-button data-cy=\"add-first-item-button\" (click)=\"addReactiveItem()\" [disabled]=\"!isAddReactiveAllowed()\">\n {{ addLabel }}\n </mad-link-button>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: LinkButtonComponent, selector: "mad-link-button" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
3744
+ }
3745
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ReactiveFormQuickListCompactComponent, decorators: [{
3746
+ type: Component,
3747
+ args: [{ selector: 'mad-reactive-form-quick-list-compact', changeDetection: ChangeDetectionStrategy.Eager, imports: [NgTemplateOutlet, IconButtonComponent, MatIconModule, LinkButtonComponent], template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n@for (item of formArray.controls; track item; let isLast = $last) {\n @if (itemTemplate) {\n <div #row class=\"quick-list-row\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n @if (!readonly && isDeleteReactiveAllowed()) {\n <mad-icon-button data-cy=\"delete-item-button\" (click)=\"removeReactiveItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n }\n @if (!readonly && isLast) {\n <mad-icon-button data-cy=\"add-item-button\" [disabled]=\"!isAddReactiveAllowed()\" (click)=\"addReactiveItem()\">\n <mat-icon>add_circle_outline</mat-icon>\n </mad-icon-button>\n }\n </div>\n }\n}\n@if (!readonly && !this.formArray?.controls.length) {\n <mad-link-button data-cy=\"add-first-item-button\" (click)=\"addReactiveItem()\" [disabled]=\"!isAddReactiveAllowed()\">\n {{ addLabel }}\n </mad-link-button>\n}\n" }]
3748
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.FormBuilder }] });
3749
+
3750
+ class QuickListModule {
3751
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: QuickListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3752
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: QuickListModule, imports: [CommonModule,
3753
+ MatButtonModule,
3754
+ MatIconModule,
3755
+ ButtonModule,
3756
+ ReactiveFormsModule,
3757
+ QuickListComponent,
3758
+ BaseQuickListComponent,
3759
+ QuickListCompactComponent,
3760
+ ReactiveFormQuickListComponent,
3761
+ ReactiveFormQuickListCompactComponent], exports: [QuickListComponent,
3762
+ QuickListCompactComponent,
3763
+ BaseQuickListComponent,
3764
+ ReactiveFormQuickListComponent,
3765
+ ReactiveFormQuickListCompactComponent] }); }
3766
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: QuickListModule, imports: [CommonModule,
3767
+ MatButtonModule,
3768
+ MatIconModule,
3769
+ ButtonModule,
3770
+ ReactiveFormsModule,
3771
+ QuickListComponent,
3772
+ QuickListCompactComponent,
3773
+ ReactiveFormQuickListComponent,
3774
+ ReactiveFormQuickListCompactComponent] }); }
3775
+ }
3776
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: QuickListModule, decorators: [{
3777
+ type: NgModule,
3778
+ args: [{
3779
+ imports: [
3780
+ CommonModule,
3781
+ MatButtonModule,
3782
+ MatIconModule,
3783
+ ButtonModule,
3784
+ ReactiveFormsModule,
3785
+ QuickListComponent,
3786
+ BaseQuickListComponent,
3787
+ QuickListCompactComponent,
3788
+ ReactiveFormQuickListComponent,
3789
+ ReactiveFormQuickListCompactComponent,
3790
+ ],
3791
+ exports: [
3792
+ QuickListComponent,
3793
+ QuickListCompactComponent,
3794
+ BaseQuickListComponent,
3795
+ ReactiveFormQuickListComponent,
3796
+ ReactiveFormQuickListCompactComponent,
3797
+ ],
3798
+ }]
3799
+ }] });
3800
+
3801
+ class TableModule {
3802
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3803
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: TableModule, imports: [CommonModule,
3804
+ MatButtonModule,
3805
+ MatIconModule,
3806
+ MatFormFieldModule,
3807
+ MatInputModule,
3808
+ MatMenuModule,
3809
+ MatPaginatorModule,
3810
+ MatSortModule,
3811
+ MatTableModule,
3812
+ ButtonModule,
3813
+ TableComponent], exports: [TableComponent] }); }
3814
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableModule, imports: [CommonModule,
3815
+ MatButtonModule,
3816
+ MatIconModule,
3817
+ MatFormFieldModule,
3818
+ MatInputModule,
3819
+ MatMenuModule,
3820
+ MatPaginatorModule,
3821
+ MatSortModule,
3822
+ MatTableModule,
3823
+ ButtonModule,
3824
+ TableComponent] }); }
3825
+ }
3826
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableModule, decorators: [{
3827
+ type: NgModule,
3828
+ args: [{
3829
+ imports: [
3830
+ CommonModule,
3831
+ MatButtonModule,
3832
+ MatIconModule,
3833
+ MatFormFieldModule,
3834
+ MatInputModule,
3835
+ MatMenuModule,
3836
+ MatPaginatorModule,
3837
+ MatSortModule,
3838
+ MatTableModule,
3839
+ ButtonModule,
3840
+ TableComponent,
3841
+ ],
3842
+ exports: [TableComponent],
3843
+ }]
3844
+ }] });
3845
+
3846
+ class StepHeaderComponent extends CdkStepHeader {
3847
+ constructor(_focusMonitor) {
3848
+ super();
3849
+ this._focusMonitor = _focusMonitor;
3850
+ }
3851
+ ngAfterViewInit() {
3852
+ this._focusMonitor.monitor(this._elementRef, true);
3853
+ }
3854
+ ngOnDestroy() {
3855
+ this._focusMonitor.stopMonitoring(this._elementRef);
3856
+ }
3857
+ /** Focuses the step header. */
3858
+ focus(origin, options) {
3859
+ if (origin) {
3860
+ this._focusMonitor.focusVia(this._elementRef, origin, options);
3861
+ }
3862
+ else {
3863
+ this._elementRef.nativeElement.focus(options);
3864
+ }
3865
+ }
3866
+ getCssForState() {
3867
+ if (this.completed) {
3868
+ return 'step-state-complete';
3869
+ }
3870
+ if (this.hasError) {
3871
+ return 'step-state-error';
3872
+ }
3873
+ return 'step-state-neutral';
3874
+ }
3875
+ getIcon() {
3876
+ if (this.completed) {
3877
+ return 'check_circle_outline';
3878
+ }
3879
+ else if (this.hasError) {
3880
+ return 'error_outline';
3881
+ }
3882
+ return '';
3883
+ }
3884
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: StepHeaderComponent, deps: [{ token: i1$6.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component }); }
3885
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: StepHeaderComponent, isStandalone: true, selector: "mad-step-header", inputs: { color: "color", index: "index", label: "label", stepControl: "stepControl", errorMessage: "errorMessage", selected: "selected", active: "active", optional: "optional", hasError: "hasError", completed: "completed", closed: "closed" }, host: { attributes: { "role": "tab" }, classAttribute: "mad-step-header" }, usesInheritance: true, ngImport: i0, template: "<div\n class=\"header\"\n [ngClass]=\"{\n 'header-selected': this.selected && !this.closed,\n 'header-default': !this.selected || this.closed,\n 'error-border': this.hasError,\n 'check-border': !this.hasError,\n }\"\n>\n <div [ngClass]=\"this.getCssForState()\"></div>\n <div class=\"header-label\">\n <mat-icon class=\"material-icons-outlined\">\n {{ this.selected && !this.closed ? 'keyboard_arrow_down' : 'keyboard_arrow_right' }}\n </mat-icon>\n </div>\n @if (this.completed || this.hasError) {\n <div class=\"header-label\">\n <mat-icon [ngClass]=\"this.completed ? 'green-check' : 'red-error'\">\n {{ getIcon() }}\n </mat-icon>\n </div>\n }\n @if (!this.hasError && !this.completed) {\n <span data-testid=\"step-number\" class=\"header-label\">{{ this.index + 1 + '.' }}</span>\n }\n <div data-testid=\"step-label\" class=\"header-label\">{{ this.label }}</div>\n</div>\n", styles: [".header{overflow:hidden;outline:var(--error-color);cursor:pointer;box-sizing:content-box;-webkit-tap-highlight-color:transparent;border:1px solid var(--step-border-color);width:100%;height:62px;flex-direction:row;box-sizing:border-box;display:flex;gap:1em}.header-label{align-items:center;display:flex}.step-state-complete{width:5px;background:var(--step-complete-color)}.step-state-error{width:5px;background:var(--error-color)}.step-state-neutral{width:5px;background:var(--step-neutral-color)}.green-check{color:var(--step-complete-color)}.red-error{color:var(--error-color)}.check-border{border-color:var(--step-border-color)}.error-border{border-color:var(--error-color)}.header-selected{background:var(--step-header-selected-background)}.header-default{background:var(--step-header-default-background)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], encapsulation: i0.ViewEncapsulation.None }); }
3886
+ }
3887
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: StepHeaderComponent, decorators: [{
3888
+ type: Component,
3889
+ args: [{ selector: 'mad-step-header', inputs: ['color'], host: {
3890
+ class: 'mad-step-header',
3891
+ role: 'tab',
3892
+ }, encapsulation: ViewEncapsulation.None, imports: [NgClass, MatIconModule], template: "<div\n class=\"header\"\n [ngClass]=\"{\n 'header-selected': this.selected && !this.closed,\n 'header-default': !this.selected || this.closed,\n 'error-border': this.hasError,\n 'check-border': !this.hasError,\n }\"\n>\n <div [ngClass]=\"this.getCssForState()\"></div>\n <div class=\"header-label\">\n <mat-icon class=\"material-icons-outlined\">\n {{ this.selected && !this.closed ? 'keyboard_arrow_down' : 'keyboard_arrow_right' }}\n </mat-icon>\n </div>\n @if (this.completed || this.hasError) {\n <div class=\"header-label\">\n <mat-icon [ngClass]=\"this.completed ? 'green-check' : 'red-error'\">\n {{ getIcon() }}\n </mat-icon>\n </div>\n }\n @if (!this.hasError && !this.completed) {\n <span data-testid=\"step-number\" class=\"header-label\">{{ this.index + 1 + '.' }}</span>\n }\n <div data-testid=\"step-label\" class=\"header-label\">{{ this.label }}</div>\n</div>\n", styles: [".header{overflow:hidden;outline:var(--error-color);cursor:pointer;box-sizing:content-box;-webkit-tap-highlight-color:transparent;border:1px solid var(--step-border-color);width:100%;height:62px;flex-direction:row;box-sizing:border-box;display:flex;gap:1em}.header-label{align-items:center;display:flex}.step-state-complete{width:5px;background:var(--step-complete-color)}.step-state-error{width:5px;background:var(--error-color)}.step-state-neutral{width:5px;background:var(--step-neutral-color)}.green-check{color:var(--step-complete-color)}.red-error{color:var(--error-color)}.check-border{border-color:var(--step-border-color)}.error-border{border-color:var(--error-color)}.header-selected{background:var(--step-header-selected-background)}.header-default{background:var(--step-header-default-background)}\n"] }]
3893
+ }], ctorParameters: () => [{ type: i1$6.FocusMonitor }], propDecorators: { index: [{
3894
+ type: Input
3895
+ }], label: [{
3896
+ type: Input
3897
+ }], stepControl: [{
3898
+ type: Input
3899
+ }], errorMessage: [{
3900
+ type: Input
3901
+ }], selected: [{
3902
+ type: Input
3903
+ }], active: [{
3904
+ type: Input
3905
+ }], optional: [{
3906
+ type: Input
3907
+ }], hasError: [{
3908
+ type: Input
3909
+ }], completed: [{
3910
+ type: Input
3911
+ }], closed: [{
3912
+ type: Input
3913
+ }] } });
3914
+
3915
+ /**
3916
+ * Animations used by the MAD stepper.
3917
+ */
3918
+ const madStepperAnimations = {
3919
+ verticalStepTransition: trigger('stepTransition', [
3920
+ state('previous', style({ height: '0px', visibility: 'hidden' })),
3921
+ state('next', style({ height: '0px', visibility: 'hidden' })),
3922
+ state('current', style({ height: '*', visibility: 'visible' })),
3923
+ transition('* <=> current', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
3924
+ ]),
3925
+ };
3926
+
3927
+ /**
3928
+ * This library only supports reactive forms (`AbstractControl`) for `stepControl`, even though
3929
+ * `@angular/cdk/stepper` also allows signal-based `Field` controls since Angular 22.
3930
+ */
3931
+ function isAbstractControl(control) {
3932
+ return !!control && typeof control === 'object' && typeof control.markAllAsTouched === 'function';
3933
+ }
3934
+ class StepComponent extends CdkStep {
3935
+ constructor(stepper, _viewContainerRef) {
3936
+ super();
3937
+ this.stepper = stepper;
3938
+ this._viewContainerRef = _viewContainerRef;
3939
+ /** Action event for the next button. If not set the StepComponent will handle the step navigation */
3940
+ this.onNext = new EventEmitter();
3941
+ /** Action event for the done button. If not set the StepComponent will handle the step navigation */
3942
+ this.onDone = new EventEmitter();
3943
+ /*** Action event when the header is clicked. If not set the StepComponent will handle the step navigation*/
3944
+ this.onHeaderClick = new EventEmitter();
3945
+ this.stepClosedSignal = signal(false, /* @ts-ignore */
3946
+ ...(ngDevMode ? [{ debugName: "stepClosedSignal" }] : /* istanbul ignore next */ []));
3947
+ this._isSelected = Subscription.EMPTY;
3948
+ }
3949
+ get stepClosed() {
3950
+ return this.stepClosedSignal();
3951
+ }
3952
+ set stepClosed(stepClosed) {
3953
+ this.stepClosedSignal.set(stepClosed);
3954
+ }
3955
+ ngAfterContentInit() {
3956
+ this._isSelected = this._stepper.steps.changes
3957
+ .pipe(switchMap(() => this._stepper.selectionChange.pipe(map((event) => event.selectedStep === this), tap(() => (this.stepClosed = false)), startWith(this._stepper.selected === this))))
3958
+ .subscribe();
3959
+ }
3960
+ ngOnDestroy() {
3961
+ this._isSelected.unsubscribe();
3335
3962
  }
3336
3963
  next(markFormAsTouched = true) {
3337
3964
  this.stepValidation(markFormAsTouched);
@@ -3496,99 +4123,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
3496
4123
  }]
3497
4124
  }] });
3498
4125
 
3499
- class ContentHeaderComponent {
3500
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3501
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: ContentHeaderComponent, isStandalone: true, selector: "mad-content-header", ngImport: i0, template: "<div class=\"content-header\">\n <ng-content></ng-content>\n</div>\n", styles: [".content-header{padding-right:.5rem;background-color:var(--background-color)}\n"] }); }
3502
- }
3503
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentHeaderComponent, decorators: [{
3504
- type: Component,
3505
- args: [{ selector: 'mad-content-header', standalone: true, template: "<div class=\"content-header\">\n <ng-content></ng-content>\n</div>\n", styles: [".content-header{padding-right:.5rem;background-color:var(--background-color)}\n"] }]
3506
- }] });
3507
-
3508
- class ContentPanelContainerComponent {
3509
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3510
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: ContentPanelContainerComponent, isStandalone: true, selector: "mad-content-panel-container", ngImport: i0, template: "<div class=\"content-panel-sidebar-wrapper\">\n <ng-content select=\"mad-content-panel-container-sidebar\"></ng-content>\n <div class=\"content-panel-outer-wrapper\">\n <ng-content select=\"mad-content-panel-container-content\"></ng-content>\n <ng-content select=\"mad-content-panel-container-footer\"></ng-content>\n </div>\n</div>\n", styles: [":host{position:relative;overflow:hidden;display:flex;flex:1 1 auto;min-width:0;min-height:.05rem;background-color:var(--background-color)}.content-panel-outer-wrapper{display:flex;flex:1 1 auto;min-width:0;flex-direction:column;text-overflow:ellipsis}.content-panel-sidebar-wrapper{width:100%;display:flex;flex:1 1 auto;min-width:0;flex-direction:row}\n"] }); }
3511
- }
3512
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerComponent, decorators: [{
3513
- type: Component,
3514
- args: [{ selector: 'mad-content-panel-container', standalone: true, template: "<div class=\"content-panel-sidebar-wrapper\">\n <ng-content select=\"mad-content-panel-container-sidebar\"></ng-content>\n <div class=\"content-panel-outer-wrapper\">\n <ng-content select=\"mad-content-panel-container-content\"></ng-content>\n <ng-content select=\"mad-content-panel-container-footer\"></ng-content>\n </div>\n</div>\n", styles: [":host{position:relative;overflow:hidden;display:flex;flex:1 1 auto;min-width:0;min-height:.05rem;background-color:var(--background-color)}.content-panel-outer-wrapper{display:flex;flex:1 1 auto;min-width:0;flex-direction:column;text-overflow:ellipsis}.content-panel-sidebar-wrapper{width:100%;display:flex;flex:1 1 auto;min-width:0;flex-direction:row}\n"] }]
3515
- }] });
3516
-
3517
- class ContentPanelContainerContentComponent {
3518
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3519
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: ContentPanelContainerContentComponent, isStandalone: true, selector: "mad-content-panel-container-content", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{flex:1 1 auto;min-width:0;overflow-y:auto;border-top:.05rem solid #cccccc;padding:1rem}\n"] }); }
3520
- }
3521
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerContentComponent, decorators: [{
3522
- type: Component,
3523
- args: [{ selector: 'mad-content-panel-container-content', standalone: true, template: "<ng-content></ng-content>\n", styles: [":host{flex:1 1 auto;min-width:0;overflow-y:auto;border-top:.05rem solid #cccccc;padding:1rem}\n"] }]
3524
- }] });
3525
-
3526
- class ContentPanelContainerFooterComponent {
3527
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3528
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: ContentPanelContainerFooterComponent, isStandalone: true, selector: "mad-content-panel-container-footer", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{border-top:.05rem solid #cccccc;padding:.25rem 1rem;display:flex;flex:0 0 auto;align-items:center;min-height:2rem;width:auto}\n"] }); }
3529
- }
3530
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerFooterComponent, decorators: [{
3531
- type: Component,
3532
- args: [{ selector: 'mad-content-panel-container-footer', standalone: true, template: "<ng-content></ng-content>\n", styles: [":host{border-top:.05rem solid #cccccc;padding:.25rem 1rem;display:flex;flex:0 0 auto;align-items:center;min-height:2rem;width:auto}\n"] }]
3533
- }] });
3534
-
3535
- class ContentPanelContainerSidebarComponent {
3536
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerSidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3537
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: ContentPanelContainerSidebarComponent, isStandalone: true, selector: "mad-content-panel-container-sidebar", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{border-top:.05rem solid var(--mat-sys-outline-variant);min-height:2rem;display:flex;flex:0 0 auto}\n"] }); }
3538
- }
3539
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelContainerSidebarComponent, decorators: [{
3540
- type: Component,
3541
- args: [{ selector: 'mad-content-panel-container-sidebar', standalone: true, template: "<ng-content></ng-content>\n", styles: [":host{border-top:.05rem solid var(--mat-sys-outline-variant);min-height:2rem;display:flex;flex:0 0 auto}\n"] }]
3542
- }] });
3543
-
3544
- class MainContainerComponent {
3545
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MainContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3546
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: MainContainerComponent, isStandalone: true, selector: "mad-main-container", ngImport: i0, template: "<div class=\"main-container\">\n <ng-content select=\"mad-content-header\"></ng-content>\n <ng-content select=\"mad-flowbar\"></ng-content>\n <ng-content select=\"mad-content-panel-container\"></ng-content>\n</div>\n", styles: [".main-container{height:100%;display:flex;flex-direction:column}\n"] }); }
3547
- }
3548
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MainContainerComponent, decorators: [{
3549
- type: Component,
3550
- args: [{ selector: 'mad-main-container', standalone: true, template: "<div class=\"main-container\">\n <ng-content select=\"mad-content-header\"></ng-content>\n <ng-content select=\"mad-flowbar\"></ng-content>\n <ng-content select=\"mad-content-panel-container\"></ng-content>\n</div>\n", styles: [".main-container{height:100%;display:flex;flex-direction:column}\n"] }]
3551
- }] });
3552
-
3553
- class ContentPanelModule {
3554
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3555
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelModule, imports: [CommonModule,
3556
- ContentHeaderComponent,
3557
- ContentPanelContainerComponent,
3558
- ContentPanelContainerContentComponent,
3559
- ContentPanelContainerFooterComponent,
3560
- ContentPanelContainerSidebarComponent,
3561
- MainContainerComponent], exports: [ContentHeaderComponent,
3562
- ContentPanelContainerComponent,
3563
- ContentPanelContainerContentComponent,
3564
- ContentPanelContainerFooterComponent,
3565
- ContentPanelContainerSidebarComponent,
3566
- MainContainerComponent] }); }
3567
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelModule, imports: [CommonModule] }); }
3568
- }
3569
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ContentPanelModule, decorators: [{
3570
- type: NgModule,
3571
- args: [{
3572
- imports: [
3573
- CommonModule,
3574
- ContentHeaderComponent,
3575
- ContentPanelContainerComponent,
3576
- ContentPanelContainerContentComponent,
3577
- ContentPanelContainerFooterComponent,
3578
- ContentPanelContainerSidebarComponent,
3579
- MainContainerComponent,
3580
- ],
3581
- exports: [
3582
- ContentHeaderComponent,
3583
- ContentPanelContainerComponent,
3584
- ContentPanelContainerContentComponent,
3585
- ContentPanelContainerFooterComponent,
3586
- ContentPanelContainerSidebarComponent,
3587
- MainContainerComponent,
3588
- ],
3589
- }]
3590
- }] });
3591
-
3592
4126
  class FlowbarComponent {
3593
4127
  constructor() {
3594
4128
  this._steps = [];
@@ -3929,7 +4463,7 @@ class SidebarComponent {
3929
4463
  this.collapsed = !this.collapsed;
3930
4464
  }
3931
4465
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: SidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3932
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: SidebarComponent, isStandalone: true, selector: "mad-sidebar", inputs: { collapsed: "collapsed" }, ngImport: i0, template: "<div [class.collapsed]=\"collapsed\" class=\"sidebar-wrapper\">\n <div class=\"sidebar-header\">\n <button (click)=\"toggleCollapse()\" color=\"basic\" mat-button>\n <mat-icon>{{ collapsed ? 'keyboard_double_arrow_right' : 'keyboard_double_arrow_left' }}</mat-icon>\n </button>\n </div>\n <div class=\"item-list\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".sidebar-wrapper{background:var(--panel-background-color);min-height:100%;display:flex;flex-direction:column;border-right:1px solid var(--panel-border-color);transition:width .1s ease-in}.sidebar-wrapper:not(.collapsed){min-width:239px}.sidebar-wrapper.collapsed{width:64px}.sidebar-wrapper .sidebar-header{display:flex;flex-direction:row-reverse;border-bottom:1px solid var(--panel-border-color)}.sidebar-wrapper .sidebar-header button{color:var(--mat-sys-on-surface-variant)}.sidebar-wrapper.collapsed .item-list{display:none}.sidebar-wrapper .item-list{display:flex;flex-direction:column;margin-top:16px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
4466
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: SidebarComponent, isStandalone: true, selector: "mad-sidebar", inputs: { collapsed: "collapsed" }, ngImport: i0, template: "<div [class.collapsed]=\"collapsed\" class=\"sidebar-wrapper\">\n <div class=\"sidebar-header\">\n <button (click)=\"toggleCollapse()\" color=\"basic\" mat-button>\n <mat-icon>{{ collapsed ? 'keyboard_double_arrow_right' : 'keyboard_double_arrow_left' }}</mat-icon>\n </button>\n </div>\n <div class=\"item-list\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".sidebar-wrapper{background:var(--panel-background-color);min-height:100%;display:flex;flex-direction:column;border-right:1px solid var(--panel-border-color);transition:width .1s ease-in}.sidebar-wrapper:not(.collapsed){min-width:239px}.sidebar-wrapper.collapsed{width:64px}.sidebar-wrapper .sidebar-header{display:flex;flex-direction:row-reverse;border-bottom:1px solid var(--panel-border-color)}.sidebar-wrapper .sidebar-header button{color:var(--mat-sys-on-surface-variant)}.sidebar-wrapper.collapsed .item-list{display:none}.sidebar-wrapper .item-list{display:flex;flex-direction:column;margin-top:16px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
3933
4467
  }
3934
4468
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: SidebarComponent, decorators: [{
3935
4469
  type: Component,
@@ -3986,13 +4520,13 @@ class SidebarLayoutComponent {
3986
4520
  goToPreviousPage() {
3987
4521
  this.location.back();
3988
4522
  }
3989
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: SidebarLayoutComponent, deps: [{ token: i0.ViewContainerRef }, { token: i1$8.Router }, { token: i2$5.Location }], target: i0.ɵɵFactoryTarget.Component }); }
3990
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: SidebarLayoutComponent, isStandalone: true, selector: "mad-sidebar-layout", inputs: { title: "title", hasBackButton: "hasBackButton", titleTemplate: "titleTemplate", sideBarItems: "sideBarItems", headerContent: "headerContent", actionGroup: "actionGroup", content: "content", footer: "footer" }, ngImport: i0, template: "<mad-main-container class=\"w-full\">\n <mad-content-header>\n @if (headerContentPortal) {\n <ng-template [cdkPortalOutlet]=\"headerContentPortal\"></ng-template>\n } @else {\n <div class=\"sidebar-wrapper default-header-wrapper\">\n <div class=\"back-and-title\">\n @if (hasBackButton) {\n <button class=\"back-button\">\n <mat-icon (click)=\"goToPreviousPage()\" class=\"mat-primary\"> arrow_back</mat-icon>\n </button>\n }\n @if (titleTemplate) {\n <ng-container *ngTemplateOutlet=\"titleTemplate\"></ng-container>\n } @else {\n <h2 class=\"title\">{{ title }}</h2>\n }\n </div>\n <ng-template [cdkPortalOutlet]=\"actionGroupPortal\"></ng-template>\n </div>\n }\n </mad-content-header>\n <mad-content-panel-container>\n @if (sideBarItemsPortal) {\n <mad-content-panel-container-sidebar>\n <ng-template [cdkPortalOutlet]=\"sideBarItemsPortal\"></ng-template>\n </mad-content-panel-container-sidebar>\n }\n @if (contentPortal) {\n <mad-content-panel-container-content>\n <ng-template [cdkPortalOutlet]=\"contentPortal\"></ng-template>\n </mad-content-panel-container-content>\n }\n @if (footerPortal) {\n <mad-content-panel-container-footer>\n <ng-template [cdkPortalOutlet]=\"footerPortal\"></ng-template>\n </mad-content-panel-container-footer>\n }\n </mad-content-panel-container>\n</mad-main-container>\n", styles: [".w-full{width:100%}.back-button{background-color:transparent;border:0;cursor:pointer}.back-button:hover{background-color:var(--background-color)}.sidebar-wrapper{height:64px;background-color:var(--background-color)}.default-header-wrapper{display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;white-space:nowrap}.back-and-title{display:flex;align-items:center;gap:1em;overflow:hidden}.back-and-title .title{margin:0;text-overflow:ellipsis;white-space:nowrap;overflow:inherit}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ContentPanelModule }, { kind: "component", type: ContentHeaderComponent, selector: "mad-content-header" }, { kind: "component", type: ContentPanelContainerComponent, selector: "mad-content-panel-container" }, { kind: "component", type: ContentPanelContainerContentComponent, selector: "mad-content-panel-container-content" }, { kind: "component", type: ContentPanelContainerFooterComponent, selector: "mad-content-panel-container-footer" }, { kind: "component", type: ContentPanelContainerSidebarComponent, selector: "mad-content-panel-container-sidebar" }, { kind: "component", type: MainContainerComponent, selector: "mad-main-container" }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i9$1.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: RouterModule }] }); }
4523
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: SidebarLayoutComponent, deps: [{ token: i0.ViewContainerRef }, { token: i1$8.Router }, { token: i2$4.Location }], target: i0.ɵɵFactoryTarget.Component }); }
4524
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: SidebarLayoutComponent, isStandalone: true, selector: "mad-sidebar-layout", inputs: { title: "title", hasBackButton: "hasBackButton", titleTemplate: "titleTemplate", sideBarItems: "sideBarItems", headerContent: "headerContent", actionGroup: "actionGroup", content: "content", footer: "footer" }, ngImport: i0, template: "<mad-main-container class=\"w-full\">\n <mad-content-header>\n @if (headerContentPortal) {\n <ng-template [cdkPortalOutlet]=\"headerContentPortal\"></ng-template>\n } @else {\n <div class=\"sidebar-wrapper default-header-wrapper\">\n <div class=\"back-and-title\">\n @if (hasBackButton) {\n <button class=\"back-button\">\n <mat-icon (click)=\"goToPreviousPage()\" class=\"mat-primary\"> arrow_back</mat-icon>\n </button>\n }\n @if (titleTemplate) {\n <ng-container *ngTemplateOutlet=\"titleTemplate\"></ng-container>\n } @else {\n <h2 class=\"title\">{{ title }}</h2>\n }\n </div>\n <ng-template [cdkPortalOutlet]=\"actionGroupPortal\"></ng-template>\n </div>\n }\n </mad-content-header>\n <mad-content-panel-container>\n @if (sideBarItemsPortal) {\n <mad-content-panel-container-sidebar>\n <ng-template [cdkPortalOutlet]=\"sideBarItemsPortal\"></ng-template>\n </mad-content-panel-container-sidebar>\n }\n @if (contentPortal) {\n <mad-content-panel-container-content>\n <ng-template [cdkPortalOutlet]=\"contentPortal\"></ng-template>\n </mad-content-panel-container-content>\n }\n @if (footerPortal) {\n <mad-content-panel-container-footer>\n <ng-template [cdkPortalOutlet]=\"footerPortal\"></ng-template>\n </mad-content-panel-container-footer>\n }\n </mad-content-panel-container>\n</mad-main-container>\n", styles: [".w-full{width:100%}.back-button{background-color:transparent;border:0;cursor:pointer}.back-button:hover{background-color:var(--background-color)}.sidebar-wrapper{height:64px;background-color:var(--background-color)}.default-header-wrapper{display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;white-space:nowrap}.back-and-title{display:flex;align-items:center;gap:1em;overflow:hidden}.back-and-title .title{margin:0;text-overflow:ellipsis;white-space:nowrap;overflow:inherit}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ContentPanelModule }, { kind: "component", type: ContentHeaderComponent, selector: "mad-content-header" }, { kind: "component", type: ContentPanelContainerComponent, selector: "mad-content-panel-container" }, { kind: "component", type: ContentPanelContainerContentComponent, selector: "mad-content-panel-container-content" }, { kind: "component", type: ContentPanelContainerFooterComponent, selector: "mad-content-panel-container-footer" }, { kind: "component", type: ContentPanelContainerSidebarComponent, selector: "mad-content-panel-container-sidebar" }, { kind: "component", type: MainContainerComponent, selector: "mad-main-container" }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i9$1.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: RouterModule }] }); }
3991
4525
  }
3992
4526
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: SidebarLayoutComponent, decorators: [{
3993
4527
  type: Component,
3994
4528
  args: [{ selector: 'mad-sidebar-layout', imports: [CommonModule, ContentPanelModule, PortalModule, MatIconModule, RouterModule], template: "<mad-main-container class=\"w-full\">\n <mad-content-header>\n @if (headerContentPortal) {\n <ng-template [cdkPortalOutlet]=\"headerContentPortal\"></ng-template>\n } @else {\n <div class=\"sidebar-wrapper default-header-wrapper\">\n <div class=\"back-and-title\">\n @if (hasBackButton) {\n <button class=\"back-button\">\n <mat-icon (click)=\"goToPreviousPage()\" class=\"mat-primary\"> arrow_back</mat-icon>\n </button>\n }\n @if (titleTemplate) {\n <ng-container *ngTemplateOutlet=\"titleTemplate\"></ng-container>\n } @else {\n <h2 class=\"title\">{{ title }}</h2>\n }\n </div>\n <ng-template [cdkPortalOutlet]=\"actionGroupPortal\"></ng-template>\n </div>\n }\n </mad-content-header>\n <mad-content-panel-container>\n @if (sideBarItemsPortal) {\n <mad-content-panel-container-sidebar>\n <ng-template [cdkPortalOutlet]=\"sideBarItemsPortal\"></ng-template>\n </mad-content-panel-container-sidebar>\n }\n @if (contentPortal) {\n <mad-content-panel-container-content>\n <ng-template [cdkPortalOutlet]=\"contentPortal\"></ng-template>\n </mad-content-panel-container-content>\n }\n @if (footerPortal) {\n <mad-content-panel-container-footer>\n <ng-template [cdkPortalOutlet]=\"footerPortal\"></ng-template>\n </mad-content-panel-container-footer>\n }\n </mad-content-panel-container>\n</mad-main-container>\n", styles: [".w-full{width:100%}.back-button{background-color:transparent;border:0;cursor:pointer}.back-button:hover{background-color:var(--background-color)}.sidebar-wrapper{height:64px;background-color:var(--background-color)}.default-header-wrapper{display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;white-space:nowrap}.back-and-title{display:flex;align-items:center;gap:1em;overflow:hidden}.back-and-title .title{margin:0;text-overflow:ellipsis;white-space:nowrap;overflow:inherit}\n"] }]
3995
- }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i1$8.Router }, { type: i2$5.Location }], propDecorators: { title: [{
4529
+ }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i1$8.Router }, { type: i2$4.Location }], propDecorators: { title: [{
3996
4530
  type: Input
3997
4531
  }], hasBackButton: [{
3998
4532
  type: Input
@@ -4146,7 +4680,7 @@ class ToolbarService {
4146
4680
  clearMainActions() {
4147
4681
  this.mainActionsSignal.set([]);
4148
4682
  }
4149
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ToolbarService, deps: [{ token: i1$8.Router }, { token: i2$4.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4683
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ToolbarService, deps: [{ token: i1$8.Router }, { token: i2$3.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4150
4684
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ToolbarService, providedIn: 'root' }); }
4151
4685
  }
4152
4686
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ToolbarService, decorators: [{
@@ -4154,7 +4688,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
4154
4688
  args: [{
4155
4689
  providedIn: 'root',
4156
4690
  }]
4157
- }], ctorParameters: () => [{ type: i1$8.Router }, { type: i2$4.TranslateService }] });
4691
+ }], ctorParameters: () => [{ type: i1$8.Router }, { type: i2$3.TranslateService }] });
4158
4692
 
4159
4693
  class ToolbarComponent {
4160
4694
  constructor(breakpointObserver, titleService, toolbarService) {
@@ -4207,8 +4741,8 @@ class ToolbarComponent {
4207
4741
  hasImportantToolbarActions() {
4208
4742
  return this.getToolbarActions().filter((value) => !!value.importantAction).length > 0;
4209
4743
  }
4210
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1$9.BreakpointObserver }, { token: i2$6.Title }, { token: ToolbarService }], target: i0.ɵɵFactoryTarget.Component }); }
4211
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: ToolbarComponent, isStandalone: true, selector: "mad-toolbar", host: { classAttribute: "mad-toolbar" }, ngImport: i0, template: "<mat-toolbar class=\"content-toolbar\">\n @if (isRouterLink(getBackAction())) {\n <a data-cy=\"back-link-button\" [routerLink]=\"getBackAction().routerLink\" [queryParams]=\"getBackAction().queryParams\">\n <button [id]=\"'go-back'\" class=\"mat-primary go-back-button\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n }\n @if (isAbsoluteLink(getBackAction())) {\n <a data-cy=\"back-href-button\" [href]=\"getBackAction().href\">\n <button [id]=\"'go-back'\" class=\"go-back-button mat-primary\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n }\n @if (isAction(getBackAction())) {\n <a data-cy=\"back-action-button\" (click)=\"getBackAction().action()\">\n <button [id]=\"'go-back'\" class=\"mat-primary go-back-button\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n }\n\n <span class=\"toolbar-title\">{{ getTitle() }}</span>\n\n @for (mainAction of getMainActions(); track mainAction; let i = $index) {\n @if (hasPermission(mainAction) | async) {\n @if (!(isHandset$ | async)) {\n <div>\n @if (isRouterLink(mainAction)) {\n <a data-cy=\"main-action-link-button\" [routerLink]=\"mainAction.routerLink\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\" [matTooltip]=\"mainAction.tooltip\">\n <div class=\"action-button-content-container\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </div>\n </mad-primary-button>\n </a>\n }\n @if (isAction(mainAction)) {\n <a data-cy=\"main-action-button\" (click)=\"mainAction.action()\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\" [matTooltip]=\"mainAction.tooltip\">\n <div class=\"action-button-content-container\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </div>\n </mad-primary-button>\n </a>\n }\n </div>\n }\n @if (isHandset$ | async) {\n <div>\n @if (isRouterLink(getBackAction())) {\n <mad-material-action-button\n data-cy=\"material-main-link-button\"\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n [routerLink]=\"mainAction.routerLink\"\n [id]=\"mainAction.matIcon\"\n />\n }\n @if (isAction(getBackAction())) {\n <mad-material-action-button\n data-cy=\"material-main-action-button\"\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n (click)=\"mainAction.action()\"\n [id]=\"mainAction.matIcon\"\n />\n }\n </div>\n }\n }\n }\n\n <div class=\"right-aligned no-print\">\n @for (action of getToolbarActions(); track action; let i = $index) {\n @if (hasPermission(action) | async) {\n @if (\n (!(isHandset$ | async) && !getToolbarActionsAlwaysAsMenu()) ||\n i < (getToolbarActions().length > 2 ? (hasImportantToolbarActions() ? 0 : 1) : 2) ||\n !!action.importantAction\n ) {\n <mad-icon-button\n data-cy=\"action-icon-button\"\n (click)=\"action.action()\"\n [id]=\"action.matIcon\"\n [matTooltip]=\"action.actionName\"\n type=\"button\"\n >\n <mat-icon\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n matBadgePosition=\"below after\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n >{{ action.matIcon }}</mat-icon\n >\n </mad-icon-button>\n }\n }\n }\n\n @if ((isHandset$ | async) || getToolbarActionsAlwaysAsMenu()) {\n @if (getToolbarActions().length > 2) {\n <mad-icon-button data-cy=\"burger-button\" type=\"button\" [matMenuTriggerFor]=\"burgerMenu\" [matTooltip]=\"getToolbarActionsMenuTitle()\">\n <mat-icon\n matBadgeColor=\"warn\"\n [matBadge]=\"showBadgeForMenu() ? '&#8288;' : null\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n >more_vert\n </mat-icon>\n </mad-icon-button>\n <mat-menu #burgerMenu=\"matMenu\" class=\"no-print toolbar-menu\">\n @for (action of getToolbarActions(); track action; let i = $index) {\n @if (!action.importantAction) {\n @if (hasPermission(action) | async) {\n @if (i >= (hasImportantToolbarActions() ? 0 : 1)) {\n <button data-cy=\"burger-menu-button\" mat-menu-item (click)=\"action.action()\" [title]=\"action.actionName\">\n <mat-icon\n class=\"mat-primary\"\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n matBadgePosition=\"below after\"\n >{{ action.matIcon }}</mat-icon\n >\n {{ action.actionName }}\n </button>\n }\n }\n }\n }\n </mat-menu>\n }\n }\n </div>\n</mat-toolbar>\n", styles: ["mat-toolbar{background:var(--toolbar-background)}.content-toolbar{height:57px;border-bottom:1px solid var(--mat-sys-outline-variant)}.right-aligned{overflow:visible;margin-left:auto;margin-right:0}.go-back-button{padding-left:0;padding-right:0}.toolbar-title{margin-right:72px}.action-button-content-container{display:flex;align-items:center;gap:5px}\n"], dependencies: [{ kind: "ngmodule", type: MatToolbarModule }, { kind: "component", type: i4.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button" }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: MaterialActionButtonComponent, selector: "mad-material-action-button", inputs: ["actionName", "id", "icon", "routerLink", "liftHigher", "liftHigher2"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "directive", type: i16.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] }); }
4744
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1$9.BreakpointObserver }, { token: i2$5.Title }, { token: ToolbarService }], target: i0.ɵɵFactoryTarget.Component }); }
4745
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: ToolbarComponent, isStandalone: true, selector: "mad-toolbar", host: { classAttribute: "mad-toolbar" }, ngImport: i0, template: "<mat-toolbar class=\"content-toolbar\">\n @if (isRouterLink(getBackAction())) {\n <a data-cy=\"back-link-button\" [routerLink]=\"getBackAction().routerLink\" [queryParams]=\"getBackAction().queryParams\">\n <button [id]=\"'go-back'\" class=\"mat-primary go-back-button\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n }\n @if (isAbsoluteLink(getBackAction())) {\n <a data-cy=\"back-href-button\" [href]=\"getBackAction().href\">\n <button [id]=\"'go-back'\" class=\"go-back-button mat-primary\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n }\n @if (isAction(getBackAction())) {\n <a data-cy=\"back-action-button\" (click)=\"getBackAction().action()\">\n <button [id]=\"'go-back'\" class=\"mat-primary go-back-button\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n }\n\n <span class=\"toolbar-title\">{{ getTitle() }}</span>\n\n @for (mainAction of getMainActions(); track mainAction; let i = $index) {\n @if (hasPermission(mainAction) | async) {\n @if (!(isHandset$ | async)) {\n <div>\n @if (isRouterLink(mainAction)) {\n <a data-cy=\"main-action-link-button\" [routerLink]=\"mainAction.routerLink\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\" [matTooltip]=\"mainAction.tooltip\">\n <div class=\"action-button-content-container\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </div>\n </mad-primary-button>\n </a>\n }\n @if (isAction(mainAction)) {\n <a data-cy=\"main-action-button\" (click)=\"mainAction.action()\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\" [matTooltip]=\"mainAction.tooltip\">\n <div class=\"action-button-content-container\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </div>\n </mad-primary-button>\n </a>\n }\n </div>\n }\n @if (isHandset$ | async) {\n <div>\n @if (isRouterLink(getBackAction())) {\n <mad-material-action-button\n data-cy=\"material-main-link-button\"\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n [routerLink]=\"mainAction.routerLink\"\n [id]=\"mainAction.matIcon\"\n />\n }\n @if (isAction(getBackAction())) {\n <mad-material-action-button\n data-cy=\"material-main-action-button\"\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n (click)=\"mainAction.action()\"\n [id]=\"mainAction.matIcon\"\n />\n }\n </div>\n }\n }\n }\n\n <div class=\"right-aligned no-print\">\n @for (action of getToolbarActions(); track action; let i = $index) {\n @if (hasPermission(action) | async) {\n @if (\n (!(isHandset$ | async) && !getToolbarActionsAlwaysAsMenu()) ||\n i < (getToolbarActions().length > 2 ? (hasImportantToolbarActions() ? 0 : 1) : 2) ||\n !!action.importantAction\n ) {\n <mad-icon-button\n data-cy=\"action-icon-button\"\n (click)=\"action.action()\"\n [id]=\"action.matIcon\"\n [matTooltip]=\"action.actionName\"\n type=\"button\"\n >\n <mat-icon\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n matBadgePosition=\"below after\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n >{{ action.matIcon }}</mat-icon\n >\n </mad-icon-button>\n }\n }\n }\n\n @if ((isHandset$ | async) || getToolbarActionsAlwaysAsMenu()) {\n @if (getToolbarActions().length > 2) {\n <mad-icon-button data-cy=\"burger-button\" type=\"button\" [matMenuTriggerFor]=\"burgerMenu\" [matTooltip]=\"getToolbarActionsMenuTitle()\">\n <mat-icon\n matBadgeColor=\"warn\"\n [matBadge]=\"showBadgeForMenu() ? '&#8288;' : null\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n >more_vert\n </mat-icon>\n </mad-icon-button>\n <mat-menu #burgerMenu=\"matMenu\" class=\"no-print toolbar-menu\">\n @for (action of getToolbarActions(); track action; let i = $index) {\n @if (!action.importantAction) {\n @if (hasPermission(action) | async) {\n @if (i >= (hasImportantToolbarActions() ? 0 : 1)) {\n <button data-cy=\"burger-menu-button\" mat-menu-item (click)=\"action.action()\" [title]=\"action.actionName\">\n <mat-icon\n class=\"mat-primary\"\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n matBadgePosition=\"below after\"\n >{{ action.matIcon }}</mat-icon\n >\n {{ action.actionName }}\n </button>\n }\n }\n }\n }\n </mat-menu>\n }\n }\n </div>\n</mat-toolbar>\n", styles: ["mat-toolbar{background:var(--toolbar-background)}.content-toolbar{height:57px;border-bottom:1px solid var(--mat-sys-outline-variant)}.right-aligned{overflow:visible;margin-left:auto;margin-right:0}.go-back-button{padding-left:0;padding-right:0}.toolbar-title{margin-right:72px}.action-button-content-container{display:flex;align-items:center;gap:5px}\n"], dependencies: [{ kind: "ngmodule", type: MatToolbarModule }, { kind: "component", type: i4.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button" }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: MaterialActionButtonComponent, selector: "mad-material-action-button", inputs: ["actionName", "id", "icon", "routerLink", "liftHigher", "liftHigher2"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button" }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "directive", type: i16.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] }); }
4212
4746
  }
4213
4747
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ToolbarComponent, decorators: [{
4214
4748
  type: Component,
@@ -4227,7 +4761,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
4227
4761
  MatMenuModule,
4228
4762
  AsyncPipe,
4229
4763
  ], template: "<mat-toolbar class=\"content-toolbar\">\n @if (isRouterLink(getBackAction())) {\n <a data-cy=\"back-link-button\" [routerLink]=\"getBackAction().routerLink\" [queryParams]=\"getBackAction().queryParams\">\n <button [id]=\"'go-back'\" class=\"mat-primary go-back-button\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n }\n @if (isAbsoluteLink(getBackAction())) {\n <a data-cy=\"back-href-button\" [href]=\"getBackAction().href\">\n <button [id]=\"'go-back'\" class=\"go-back-button mat-primary\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n }\n @if (isAction(getBackAction())) {\n <a data-cy=\"back-action-button\" (click)=\"getBackAction().action()\">\n <button [id]=\"'go-back'\" class=\"mat-primary go-back-button\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n }\n\n <span class=\"toolbar-title\">{{ getTitle() }}</span>\n\n @for (mainAction of getMainActions(); track mainAction; let i = $index) {\n @if (hasPermission(mainAction) | async) {\n @if (!(isHandset$ | async)) {\n <div>\n @if (isRouterLink(mainAction)) {\n <a data-cy=\"main-action-link-button\" [routerLink]=\"mainAction.routerLink\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\" [matTooltip]=\"mainAction.tooltip\">\n <div class=\"action-button-content-container\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </div>\n </mad-primary-button>\n </a>\n }\n @if (isAction(mainAction)) {\n <a data-cy=\"main-action-button\" (click)=\"mainAction.action()\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\" [matTooltip]=\"mainAction.tooltip\">\n <div class=\"action-button-content-container\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </div>\n </mad-primary-button>\n </a>\n }\n </div>\n }\n @if (isHandset$ | async) {\n <div>\n @if (isRouterLink(getBackAction())) {\n <mad-material-action-button\n data-cy=\"material-main-link-button\"\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n [routerLink]=\"mainAction.routerLink\"\n [id]=\"mainAction.matIcon\"\n />\n }\n @if (isAction(getBackAction())) {\n <mad-material-action-button\n data-cy=\"material-main-action-button\"\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n (click)=\"mainAction.action()\"\n [id]=\"mainAction.matIcon\"\n />\n }\n </div>\n }\n }\n }\n\n <div class=\"right-aligned no-print\">\n @for (action of getToolbarActions(); track action; let i = $index) {\n @if (hasPermission(action) | async) {\n @if (\n (!(isHandset$ | async) && !getToolbarActionsAlwaysAsMenu()) ||\n i < (getToolbarActions().length > 2 ? (hasImportantToolbarActions() ? 0 : 1) : 2) ||\n !!action.importantAction\n ) {\n <mad-icon-button\n data-cy=\"action-icon-button\"\n (click)=\"action.action()\"\n [id]=\"action.matIcon\"\n [matTooltip]=\"action.actionName\"\n type=\"button\"\n >\n <mat-icon\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n matBadgePosition=\"below after\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n >{{ action.matIcon }}</mat-icon\n >\n </mad-icon-button>\n }\n }\n }\n\n @if ((isHandset$ | async) || getToolbarActionsAlwaysAsMenu()) {\n @if (getToolbarActions().length > 2) {\n <mad-icon-button data-cy=\"burger-button\" type=\"button\" [matMenuTriggerFor]=\"burgerMenu\" [matTooltip]=\"getToolbarActionsMenuTitle()\">\n <mat-icon\n matBadgeColor=\"warn\"\n [matBadge]=\"showBadgeForMenu() ? '&#8288;' : null\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n >more_vert\n </mat-icon>\n </mad-icon-button>\n <mat-menu #burgerMenu=\"matMenu\" class=\"no-print toolbar-menu\">\n @for (action of getToolbarActions(); track action; let i = $index) {\n @if (!action.importantAction) {\n @if (hasPermission(action) | async) {\n @if (i >= (hasImportantToolbarActions() ? 0 : 1)) {\n <button data-cy=\"burger-menu-button\" mat-menu-item (click)=\"action.action()\" [title]=\"action.actionName\">\n <mat-icon\n class=\"mat-primary\"\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n matBadgePosition=\"below after\"\n >{{ action.matIcon }}</mat-icon\n >\n {{ action.actionName }}\n </button>\n }\n }\n }\n }\n </mat-menu>\n }\n }\n </div>\n</mat-toolbar>\n", styles: ["mat-toolbar{background:var(--toolbar-background)}.content-toolbar{height:57px;border-bottom:1px solid var(--mat-sys-outline-variant)}.right-aligned{overflow:visible;margin-left:auto;margin-right:0}.go-back-button{padding-left:0;padding-right:0}.toolbar-title{margin-right:72px}.action-button-content-container{display:flex;align-items:center;gap:5px}\n"] }]
4230
- }], ctorParameters: () => [{ type: i1$9.BreakpointObserver }, { type: i2$6.Title }, { type: ToolbarService }] });
4764
+ }], ctorParameters: () => [{ type: i1$9.BreakpointObserver }, { type: i2$5.Title }, { type: ToolbarService }] });
4231
4765
 
4232
4766
  class ToolbarModule {
4233
4767
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ToolbarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -4459,7 +4993,7 @@ class FileUploadComponent {
4459
4993
  return dataTransfer.files;
4460
4994
  }
4461
4995
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: FileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4462
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: FileUploadComponent, isStandalone: true, selector: "mad-file-upload", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, showFileList: { classPropertyName: "showFileList", publicName: "showFileList", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileEmitter: "fileEmitter", errorEmitter: "errorEmitter" }, ngImport: i0, template: "<mat-card\n id=\"uploadFileContainer\"\n class=\"upload-file-container\"\n (click)=\"fileInput.click()\"\n madDragAndDrop\n (onFileDropped)=\"uploadFile($event)\"\n>\n <input\n #fileInput\n hidden\n type=\"file\"\n [id]=\"id()\"\n [multiple]=\"multiple()\"\n [accept]=\"acceptAttribute()\"\n (change)=\"uploadFile(fileInput.files)\"\n (click)=\"fileInput.value = ''\"\n />\n <mat-card-content class=\"upload-file-content\">\n @if (hasSingleFile()) {\n {{ fileList()[0].name }}\n } @else {\n <mat-icon>vertical_align_top</mat-icon>\n {{ uploadLabel() }}\n }\n </mat-card-content>\n</mat-card>\n\n@if (showFileList()) {\n <mat-chip-listbox>\n @for (file of fileList(); track file) {\n <mat-chip class=\"download\" (click)=\"openFile(file)\" [removable]=\"removable()\" (removed)=\"remove(file)\">\n {{ file.name }}\n @if (removable()) {\n <mat-icon matChipRemove>delete_forever</mat-icon>\n }\n </mat-chip>\n }\n </mat-chip-listbox>\n}\n", styles: [".upload-file-container{height:100px;margin:0;border:2px dashed var(--main-primary);background-repeat:no-repeat;background-position:center}.upload-file-container:hover{cursor:pointer;background-color:var(--selection-background)!important;opacity:.8}.upload-file-container,.upload-file-content{display:flex;justify-content:center;align-items:center}.download{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1$3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1$3.MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: DragAndDropDirective, selector: "[madDragAndDrop]", outputs: ["onFileDropped"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i3$2.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: "component", type: i3$2.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "directive", type: i3$2.MatChipRemove, selector: "[matChipRemove]" }] }); }
4996
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: FileUploadComponent, isStandalone: true, selector: "mad-file-upload", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, showFileList: { classPropertyName: "showFileList", publicName: "showFileList", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileEmitter: "fileEmitter", errorEmitter: "errorEmitter" }, ngImport: i0, template: "<mat-card\n id=\"uploadFileContainer\"\n class=\"upload-file-container\"\n (click)=\"fileInput.click()\"\n madDragAndDrop\n (onFileDropped)=\"uploadFile($event)\"\n>\n <input\n #fileInput\n hidden\n type=\"file\"\n [id]=\"id()\"\n [multiple]=\"multiple()\"\n [accept]=\"acceptAttribute()\"\n (change)=\"uploadFile(fileInput.files)\"\n (click)=\"fileInput.value = ''\"\n />\n <mat-card-content class=\"upload-file-content\">\n @if (hasSingleFile()) {\n {{ fileList()[0].name }}\n } @else {\n <mat-icon>vertical_align_top</mat-icon>\n {{ uploadLabel() }}\n }\n </mat-card-content>\n</mat-card>\n\n@if (showFileList()) {\n <mat-chip-listbox>\n @for (file of fileList(); track file) {\n <mat-chip class=\"download\" (click)=\"openFile(file)\" [removable]=\"removable()\" (removed)=\"remove(file)\">\n {{ file.name }}\n @if (removable()) {\n <mat-icon matChipRemove>delete_forever</mat-icon>\n }\n </mat-chip>\n }\n </mat-chip-listbox>\n}\n", styles: [".upload-file-container{height:100px;margin:0;border:2px dashed var(--main-primary);background-repeat:no-repeat;background-position:center}.upload-file-container:hover{cursor:pointer;background-color:var(--selection-background)!important;opacity:.8}.upload-file-container,.upload-file-content{display:flex;justify-content:center;align-items:center}.download{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1$3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1$3.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: ButtonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: DragAndDropDirective, selector: "[madDragAndDrop]", outputs: ["onFileDropped"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i3$2.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: "component", type: i3$2.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "directive", type: i3$2.MatChipRemove, selector: "[matChipRemove]" }] }); }
4463
4997
  }
4464
4998
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: FileUploadComponent, decorators: [{
4465
4999
  type: Component,
@@ -4507,7 +5041,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
4507
5041
  args: [{ selector: 'mad-breadcrumb', imports: [RouterLink, IconButtonComponent, MatIcon, MatTooltip], template: "@if (breadcrumbs().length) {\n <div class=\"breadcrumb\">\n <nav data-cy=\"breadcrumb-nav\" class=\"breadcrumb__nav\">\n @for (crumb of breadcrumbs(); track crumb.label; let last = $last) {\n @if (crumb.route?.length) {\n <a data-cy=\"breadcrumb-link\" [routerLink]=\"crumb.route\" class=\"breadcrumb__link\">{{ crumb.label }}</a>\n } @else if (crumb.href?.length) {\n <a data-cy=\"breadcrumb-link\" [href]=\"crumb.href\" target=\"_blank\" class=\"breadcrumb__link\">{{ crumb.label }}</a>\n } @else {\n <span data-cy=\"breadcrumb-current\" class=\"breadcrumb__current\">{{ crumb.label }}</span>\n }\n @if (!last) {\n <span data-cy=\"breadcrumb-separator\" class=\"breadcrumb__separator\">/</span>\n }\n }\n </nav>\n @if (showCopy()) {\n <mad-icon-button\n data-cy=\"breadcrumb-copy\"\n class=\"breadcrumb__copy\"\n (click)=\"copy.emit()\"\n [matTooltip]=\"title()\"\n matTooltipPosition=\"above\"\n >\n <mat-icon>content_copy</mat-icon>\n </mad-icon-button>\n }\n </div>\n}\n", styles: [".breadcrumb{display:flex;align-items:center;gap:.5rem}.breadcrumb__nav{display:flex;align-items:center;gap:.625rem;min-height:3.5rem;padding-block:.25rem;font-size:.875rem;line-height:1.25rem}.breadcrumb__link{color:var(--main-primary);text-decoration:none}.breadcrumb__link:hover{text-decoration:underline}.breadcrumb__current,.breadcrumb__separator{color:var(--breadcrumb-separator-color)}.breadcrumb__copy{flex-shrink:0}\n"] }]
4508
5042
  }], propDecorators: { breadcrumbs: [{ type: i0.Input, args: [{ isSignal: true, alias: "breadcrumbs", required: true }] }], showCopy: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCopy", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], copy: [{ type: i0.Output, args: ["copy"] }] } });
4509
5043
 
4510
- const VERSION = '22.3.2';
5044
+ const VERSION = '22.5.0';
4511
5045
 
4512
5046
  const MAD_ALERT_DEFAULT_CONFIGURATION = new InjectionToken('mad-alert-configuration', {
4513
5047
  providedIn: 'root',
@@ -4533,6 +5067,8 @@ class AlertComponent {
4533
5067
  ...(ngDevMode ? [{ debugName: "actionText" }] : /* istanbul ignore next */ []));
4534
5068
  this.closeable = input(true, /* @ts-ignore */
4535
5069
  ...(ngDevMode ? [{ debugName: "closeable" }] : /* istanbul ignore next */ []));
5070
+ this.useProjectedContent = input(false, /* @ts-ignore */
5071
+ ...(ngDevMode ? [{ debugName: "useProjectedContent" }] : /* istanbul ignore next */ []));
4536
5072
  this.close = output();
4537
5073
  this.action = output();
4538
5074
  this.classes = computed(() => `${this.type()} ${this.size()}`, /* @ts-ignore */
@@ -4552,15 +5088,1219 @@ class AlertComponent {
4552
5088
  ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
4553
5089
  }
4554
5090
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: AlertComponent, deps: [{ token: MAD_ALERT_DEFAULT_CONFIGURATION }], target: i0.ɵɵFactoryTarget.Component }); }
4555
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: AlertComponent, isStandalone: true, selector: "mad-alert", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, actionText: { classPropertyName: "actionText", publicName: "actionText", isSignal: true, isRequired: false, transformFunction: null }, closeable: { classPropertyName: "closeable", publicName: "closeable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", action: "action" }, ngImport: i0, template: "<div data-cy=\"alert\" class=\"alert\" [class]=\"classes()\">\n <span data-cy=\"alert-icon\" class=\"icon\">\n <mat-icon>{{ icon() }}</mat-icon>\n </span>\n <span data-cy=\"alert-message\" class=\"message\">{{ message() }}</span>\n @if (actionText()) {\n <span data-cy=\"alert-action-btn\" class=\"action-btn\" (click)=\"action.emit()\">\n {{ actionText() }}\n </span>\n }\n @if (closeable()) {\n <button mat-icon-button data-cy=\"alert-close-btn\" class=\"close-btn\" (click)=\"close.emit()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n</div>\n", styles: [".alert{display:flex;align-items:center;padding:16px;border-radius:4px;margin:8px 0;font-size:14px;position:relative;border:1px solid transparent}.alert.small{padding:0 8px;font-size:14px}.alert.medium{padding:8px;font-size:16px}.alert.large{padding:12px 8px;font-size:18px}.alert .icon{margin-right:8px;display:flex;align-items:center}.alert .message{flex:1}.alert .action-btn,.alert .close-btn{color:inherit;margin-left:auto;padding:0}.alert .action-btn{text-decoration:underline;cursor:pointer}.alert .close-btn{display:flex;align-items:center;justify-content:center}.alert.success{background-color:var(--alert-success-background-color);border-color:var(--alert-success-border-color);color:var(--alert-success-text-color)}.alert.info{background-color:var(--alert-info-background-color);border-color:var(--alert-info-border-color);color:var(--alert-info-text-color)}.alert.warning{background-color:var(--alert-warning-background-color);border-color:var(--alert-warning-border-color);color:var(--alert-warning-text-color)}.alert.error{background-color:var(--alert-error-background-color);border-color:var(--alert-error-border-color);color:var(--alert-error-text-color)}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }] }); }
5091
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: AlertComponent, isStandalone: true, selector: "mad-alert", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, actionText: { classPropertyName: "actionText", publicName: "actionText", isSignal: true, isRequired: false, transformFunction: null }, closeable: { classPropertyName: "closeable", publicName: "closeable", isSignal: true, isRequired: false, transformFunction: null }, useProjectedContent: { classPropertyName: "useProjectedContent", publicName: "useProjectedContent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", action: "action" }, ngImport: i0, template: "<div data-cy=\"alert\" class=\"alert\" [class]=\"classes()\">\n <span data-cy=\"alert-icon\" class=\"icon\">\n <mat-icon>{{ icon() }}</mat-icon>\n </span>\n @if (useProjectedContent()) {\n <ng-content />\n } @else {\n <span data-cy=\"alert-message\" class=\"message\">{{ message() }}</span>\n }\n\n @if (actionText()) {\n <span data-cy=\"alert-action-btn\" class=\"action-btn\" (click)=\"action.emit()\">\n {{ actionText() }}\n </span>\n }\n @if (closeable()) {\n <button mat-icon-button data-cy=\"alert-close-btn\" class=\"close-btn\" (click)=\"close.emit()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n</div>\n", styles: [".alert{display:flex;align-items:center;padding:16px;border-radius:4px;margin:8px 0;font-size:14px;position:relative;border:1px solid transparent}.alert.small{padding:0 8px;font-size:14px}.alert.medium{padding:8px;font-size:16px}.alert.large{padding:12px 8px;font-size:18px}.alert .icon{margin-right:8px;display:flex;align-items:center}.alert .message{flex:1}.alert .action-btn,.alert .close-btn{color:inherit;margin-left:auto;padding:0}.alert .action-btn{text-decoration:underline;cursor:pointer}.alert .close-btn{display:flex;align-items:center;justify-content:center}.alert.success{background-color:var(--alert-success-background-color);border-color:var(--alert-success-border-color);color:var(--alert-success-text-color)}.alert.info{background-color:var(--alert-info-background-color);border-color:var(--alert-info-border-color);color:var(--alert-info-text-color)}.alert.warning{background-color:var(--alert-warning-background-color);border-color:var(--alert-warning-border-color);color:var(--alert-warning-text-color)}.alert.error{background-color:var(--alert-error-background-color);border-color:var(--alert-error-border-color);color:var(--alert-error-text-color)}\n"], dependencies: [{ 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.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }] }); }
4556
5092
  }
4557
5093
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: AlertComponent, decorators: [{
4558
5094
  type: Component,
4559
- args: [{ selector: 'mad-alert', imports: [MatIconModule, MatButtonModule], template: "<div data-cy=\"alert\" class=\"alert\" [class]=\"classes()\">\n <span data-cy=\"alert-icon\" class=\"icon\">\n <mat-icon>{{ icon() }}</mat-icon>\n </span>\n <span data-cy=\"alert-message\" class=\"message\">{{ message() }}</span>\n @if (actionText()) {\n <span data-cy=\"alert-action-btn\" class=\"action-btn\" (click)=\"action.emit()\">\n {{ actionText() }}\n </span>\n }\n @if (closeable()) {\n <button mat-icon-button data-cy=\"alert-close-btn\" class=\"close-btn\" (click)=\"close.emit()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n</div>\n", styles: [".alert{display:flex;align-items:center;padding:16px;border-radius:4px;margin:8px 0;font-size:14px;position:relative;border:1px solid transparent}.alert.small{padding:0 8px;font-size:14px}.alert.medium{padding:8px;font-size:16px}.alert.large{padding:12px 8px;font-size:18px}.alert .icon{margin-right:8px;display:flex;align-items:center}.alert .message{flex:1}.alert .action-btn,.alert .close-btn{color:inherit;margin-left:auto;padding:0}.alert .action-btn{text-decoration:underline;cursor:pointer}.alert .close-btn{display:flex;align-items:center;justify-content:center}.alert.success{background-color:var(--alert-success-background-color);border-color:var(--alert-success-border-color);color:var(--alert-success-text-color)}.alert.info{background-color:var(--alert-info-background-color);border-color:var(--alert-info-border-color);color:var(--alert-info-text-color)}.alert.warning{background-color:var(--alert-warning-background-color);border-color:var(--alert-warning-border-color);color:var(--alert-warning-text-color)}.alert.error{background-color:var(--alert-error-background-color);border-color:var(--alert-error-border-color);color:var(--alert-error-text-color)}\n"] }]
5095
+ args: [{ selector: 'mad-alert', imports: [MatIconModule, MatButtonModule], template: "<div data-cy=\"alert\" class=\"alert\" [class]=\"classes()\">\n <span data-cy=\"alert-icon\" class=\"icon\">\n <mat-icon>{{ icon() }}</mat-icon>\n </span>\n @if (useProjectedContent()) {\n <ng-content />\n } @else {\n <span data-cy=\"alert-message\" class=\"message\">{{ message() }}</span>\n }\n\n @if (actionText()) {\n <span data-cy=\"alert-action-btn\" class=\"action-btn\" (click)=\"action.emit()\">\n {{ actionText() }}\n </span>\n }\n @if (closeable()) {\n <button mat-icon-button data-cy=\"alert-close-btn\" class=\"close-btn\" (click)=\"close.emit()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n</div>\n", styles: [".alert{display:flex;align-items:center;padding:16px;border-radius:4px;margin:8px 0;font-size:14px;position:relative;border:1px solid transparent}.alert.small{padding:0 8px;font-size:14px}.alert.medium{padding:8px;font-size:16px}.alert.large{padding:12px 8px;font-size:18px}.alert .icon{margin-right:8px;display:flex;align-items:center}.alert .message{flex:1}.alert .action-btn,.alert .close-btn{color:inherit;margin-left:auto;padding:0}.alert .action-btn{text-decoration:underline;cursor:pointer}.alert .close-btn{display:flex;align-items:center;justify-content:center}.alert.success{background-color:var(--alert-success-background-color);border-color:var(--alert-success-border-color);color:var(--alert-success-text-color)}.alert.info{background-color:var(--alert-info-background-color);border-color:var(--alert-info-border-color);color:var(--alert-info-text-color)}.alert.warning{background-color:var(--alert-warning-background-color);border-color:var(--alert-warning-border-color);color:var(--alert-warning-text-color)}.alert.error{background-color:var(--alert-error-background-color);border-color:var(--alert-error-border-color);color:var(--alert-error-text-color)}\n"] }]
4560
5096
  }], ctorParameters: () => [{ type: undefined, decorators: [{
4561
5097
  type: Inject,
4562
5098
  args: [MAD_ALERT_DEFAULT_CONFIGURATION]
4563
- }] }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], actionText: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionText", required: false }] }], closeable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeable", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], action: [{ type: i0.Output, args: ["action"] }] } });
5099
+ }] }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], actionText: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionText", required: false }] }], closeable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeable", required: false }] }], useProjectedContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "useProjectedContent", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], action: [{ type: i0.Output, args: ["action"] }] } });
5100
+
5101
+ const DEFAULT_FILE_PREVIEW_CONFIG = {
5102
+ thumbnailSize: 'md',
5103
+ showOverlayPreview: true,
5104
+ showActionIcons: true,
5105
+ showDeleteAction: true,
5106
+ showPreviewAction: true,
5107
+ showDownloadAction: true,
5108
+ actions: [],
5109
+ generatePdfThumbnails: true,
5110
+ generateDocxThumbnails: true,
5111
+ };
5112
+ const DEFAULT_FILE_PREVIEW_LABELS = {
5113
+ galleryAriaLabel: 'File preview gallery',
5114
+ thumbnailPreviewAriaPrefix: 'Preview',
5115
+ emptyStateMessage: 'No files to preview',
5116
+ previewActionLabel: 'Preview',
5117
+ downloadActionLabel: 'Download',
5118
+ deleteActionLabel: 'Delete',
5119
+ closeActionLabel: 'Close preview',
5120
+ maximizeActionLabel: 'Maximize',
5121
+ restoreActionLabel: 'Restore',
5122
+ noPreviewMessage: 'No preview available for this file type.',
5123
+ downloadLabel: 'Download',
5124
+ docxRenderErrorMessage: 'Unable to render DOCX preview',
5125
+ };
5126
+ /** Thumbnail dimension presets in pixels. */
5127
+ const THUMBNAIL_SIZE_MAP = {
5128
+ sm: { width: 96, height: 96 },
5129
+ md: { width: 132, height: 132 },
5130
+ lg: { width: 180, height: 180 },
5131
+ };
5132
+
5133
+ /**
5134
+ * Detects the file preview kind from MIME type and file extension.
5135
+ *
5136
+ * Detection prioritizes MIME type matching over extension matching,
5137
+ * with extension as a reliable fallback for generic or missing MIME types.
5138
+ *
5139
+ * @param mimeType - The MIME type (case-insensitive)
5140
+ * @param extension - The file extension without dot (case-insensitive)
5141
+ * @returns The detected FilePreviewKind: 'image' | 'pdf' | 'docx' | 'xlsx' | 'unknown'
5142
+ */
5143
+ function detectFileKind(mimeType, extension) {
5144
+ const normalizedMimeType = mimeType.toLowerCase();
5145
+ const normalizedExtension = extension.toLowerCase();
5146
+ // PDF detection
5147
+ if (normalizedMimeType === 'application/pdf' || normalizedExtension === 'pdf') {
5148
+ return 'pdf';
5149
+ }
5150
+ // DOCX detection — docx-preview only parses OOXML (zip/XML) Word documents.
5151
+ // Legacy binary .doc, RTF and ODT are intentionally excluded so they fall through
5152
+ // to the 'unknown' branch and get a working "no preview available" + download UI
5153
+ // instead of being misdetected as 'docx' and failing to render.
5154
+ const docxMimePatterns = [
5155
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
5156
+ 'application/vnd.ms-word.document.macroenabled.12',
5157
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
5158
+ 'application/vnd.ms-word.template.macroenabled.12',
5159
+ ];
5160
+ const docxExtensions = ['docx', 'docm', 'dotx', 'dotm'];
5161
+ if (docxMimePatterns.includes(normalizedMimeType) || docxExtensions.includes(normalizedExtension)) {
5162
+ return 'docx';
5163
+ }
5164
+ // Excel detection (spreadsheets)
5165
+ const excelMimePatterns = [
5166
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', // .xlsx
5167
+ 'application/vnd.ms-excel', // .xls
5168
+ 'application/vnd.ms-excel.sheet.macroenabled.12', // .xlsm
5169
+ 'application/vnd.ms-excel.sheet.binary.macroenabled.12', // .xlsb
5170
+ 'text/csv',
5171
+ 'application/vnd.oasis.opendocument.spreadsheet', // .ods
5172
+ ];
5173
+ const excelExtensions = ['xlsx', 'xls', 'xlsm', 'xlsb', 'csv', 'ods'];
5174
+ if (excelMimePatterns.some((pattern) => normalizedMimeType.includes(pattern)) || excelExtensions.includes(normalizedExtension)) {
5175
+ return 'xlsx';
5176
+ }
5177
+ // Image detection (JPEG, PNG, GIF, WebP, BMP, SVG, ICO)
5178
+ const imageMimePatterns = [
5179
+ 'image/jpeg',
5180
+ 'image/png',
5181
+ 'image/gif',
5182
+ 'image/webp',
5183
+ 'image/bmp',
5184
+ 'image/svg+xml',
5185
+ 'image/x-icon',
5186
+ 'image/ico',
5187
+ ];
5188
+ const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp', 'svg', 'ico'];
5189
+ if (imageMimePatterns.includes(normalizedMimeType) ||
5190
+ normalizedMimeType.startsWith('image/') ||
5191
+ imageExtensions.includes(normalizedExtension)) {
5192
+ return 'image';
5193
+ }
5194
+ // No match found
5195
+ return 'unknown';
5196
+ }
5197
+
5198
+ const SAFE_PROTOCOLS = new Set(['http:', 'https:', 'blob:']);
5199
+ const SAFE_DATA_URL_MIME_PREFIXES = [
5200
+ 'image/',
5201
+ 'application/pdf',
5202
+ 'application/msword',
5203
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
5204
+ 'application/vnd.ms-word.document.macroenabled.12',
5205
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
5206
+ 'application/vnd.ms-word.template.macroenabled.12',
5207
+ 'application/vnd.oasis.opendocument.text',
5208
+ 'application/rtf',
5209
+ 'text/plain',
5210
+ 'text/rtf',
5211
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
5212
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
5213
+ 'application/vnd.oasis.opendocument.spreadsheet',
5214
+ 'text/csv',
5215
+ ];
5216
+ function isBase64Input(source) {
5217
+ return (source !== null &&
5218
+ typeof source === 'object' &&
5219
+ !(source instanceof Blob) &&
5220
+ !(source instanceof ArrayBuffer) &&
5221
+ 'data' in source &&
5222
+ 'mimeType' in source &&
5223
+ typeof source.data === 'string');
5224
+ }
5225
+ function base64InputToDataUrl(input) {
5226
+ const { data, mimeType } = input;
5227
+ return data.startsWith('data:') ? data : `data:${mimeType};base64,${data}`;
5228
+ }
5229
+ function sanitizeSourceUrl(source, baseUrl) {
5230
+ const trimmedSource = source.trim();
5231
+ if (!trimmedSource || trimmedSource.startsWith('//')) {
5232
+ return undefined;
5233
+ }
5234
+ if (trimmedSource.startsWith('data:')) {
5235
+ return isSafeDataUrl(trimmedSource) ? trimmedSource : undefined;
5236
+ }
5237
+ if (!hasExplicitScheme(trimmedSource)) {
5238
+ return trimmedSource;
5239
+ }
5240
+ if (/\s/.test(trimmedSource)) {
5241
+ return undefined;
5242
+ }
5243
+ try {
5244
+ const parsedUrl = new URL(trimmedSource, baseUrl ?? 'https://local.invalid/');
5245
+ return SAFE_PROTOCOLS.has(parsedUrl.protocol) ? trimmedSource : undefined;
5246
+ }
5247
+ catch {
5248
+ return undefined;
5249
+ }
5250
+ }
5251
+ function hasExplicitScheme(source) {
5252
+ return /^[a-zA-Z][a-zA-Z\d+.-]*:/.test(source);
5253
+ }
5254
+ function isSafeDataUrl(source) {
5255
+ const match = /^data:([^;,]+)(;[^,]*)?,/i.exec(source);
5256
+ if (!match) {
5257
+ return false;
5258
+ }
5259
+ const mimeType = match[1]?.toLowerCase() ?? '';
5260
+ return SAFE_DATA_URL_MIME_PREFIXES.some((allowedPrefix) => mimeType.startsWith(allowedPrefix));
5261
+ }
5262
+ async function toArrayBuffer(source) {
5263
+ if (!source) {
5264
+ return new ArrayBuffer(0);
5265
+ }
5266
+ if (isBase64Input(source)) {
5267
+ const dataUrl = base64InputToDataUrl(source);
5268
+ const response = await fetch(dataUrl);
5269
+ return response.arrayBuffer();
5270
+ }
5271
+ if (typeof source === 'string') {
5272
+ const safeSource = sanitizeSourceUrl(source);
5273
+ if (!safeSource) {
5274
+ throw new Error('Unsafe file preview source URL.');
5275
+ }
5276
+ const response = await fetch(safeSource);
5277
+ return response.arrayBuffer();
5278
+ }
5279
+ if (source instanceof Blob) {
5280
+ if (typeof source.arrayBuffer === 'function') {
5281
+ return source.arrayBuffer();
5282
+ }
5283
+ // Fallback: try FileReader if available (browsers/JSDOM), then Response if available.
5284
+ if (typeof FileReader !== 'undefined') {
5285
+ return new Promise((resolve, reject) => {
5286
+ try {
5287
+ const reader = new FileReader();
5288
+ reader.onload = () => resolve(reader.result ?? new ArrayBuffer(0));
5289
+ reader.onerror = () => reject(new Error('Failed to read Blob as ArrayBuffer'));
5290
+ reader.readAsArrayBuffer(source);
5291
+ }
5292
+ catch (e) {
5293
+ reject(e instanceof Error ? e : new Error(String(e)));
5294
+ }
5295
+ });
5296
+ }
5297
+ if (typeof Response !== 'undefined') {
5298
+ try {
5299
+ const resp = new Response(source);
5300
+ return resp.arrayBuffer();
5301
+ }
5302
+ catch {
5303
+ return new ArrayBuffer(0);
5304
+ }
5305
+ }
5306
+ // Last-resort fallback for test environments: return empty ArrayBuffer.
5307
+ return new ArrayBuffer(0);
5308
+ }
5309
+ return source;
5310
+ }
5311
+
5312
+ /**
5313
+ * Injection token for the pdfjs-dist worker script URL.
5314
+ *
5315
+ * Override this token in your application providers when you want to serve the
5316
+ * worker from your own origin (e.g. copied into `assets/`) instead of the CDN:
5317
+ *
5318
+ * ```ts
5319
+ * { provide: PDF_WORKER_SRC, useValue: '/assets/pdf.worker.min.mjs' }
5320
+ * ```
5321
+ */
5322
+ const PDF_WORKER_SRC = new InjectionToken('PDF_WORKER_SRC', {
5323
+ // Loads the worker from public assets (copied during build from node_modules/pdfjs-dist/build)
5324
+ factory: () => '/assets/pdf.worker.min.mjs',
5325
+ });
5326
+
5327
+ /**
5328
+ * PDF Thumbnail Service for rendering the first page of a PDF as a JPEG thumbnail.
5329
+ *
5330
+ * Features:
5331
+ * - Dynamically loads pdfjs-dist library (optional dependency)
5332
+ * - Generates thumbnails from the first page of the PDF
5333
+ * - Supports custom worker source configuration via PDF_WORKER_SRC token
5334
+ * - Falls back to main-thread rendering if worker fails (CORS, version mismatch)
5335
+ * - Proper resource cleanup to prevent memory leaks
5336
+ */
5337
+ class PdfRenderer {
5338
+ constructor() {
5339
+ this.kind = 'pdf';
5340
+ // ──────────────────────────────────────────────────────────────
5341
+ // PDF Rendering Constants
5342
+ // ──────────────────────────────────────────────────────────────
5343
+ /**
5344
+ * First page number in PDF documents (1-based indexing).
5345
+ */
5346
+ this.PDF_FIRST_PAGE_NUMBER = 1;
5347
+ /**
5348
+ * Natural viewport scale: 1.0 means 100% (no scaling applied).
5349
+ * Used to get the PDF's natural dimensions before calculating target scale.
5350
+ */
5351
+ this.PDF_NATURAL_SCALE = 1;
5352
+ /**
5353
+ * Target thumbnail viewport width: 200px provides a balanced thumbnail size
5354
+ * that fits well in file listings and preview sidebars.
5355
+ */
5356
+ this.PDF_TARGET_VIEWPORT_WIDTH_PX = 200;
5357
+ /**
5358
+ * Maximum scale multiplier: 2.0 ensures high-quality thumbnails without
5359
+ * excessive memory usage or rendering time for small PDFs.
5360
+ */
5361
+ this.PDF_MAX_SCALE = 2;
5362
+ /**
5363
+ * JPEG quality: 0.82 (82%) balances file size and visual quality for thumbnails.
5364
+ * Provides clear, readable previews while keeping file sizes minimal.
5365
+ */
5366
+ this.PDF_JPEG_QUALITY = 0.82;
5367
+ /**
5368
+ * Canvas dimension reset value used during cleanup to free memory.
5369
+ * Setting width/height to 0 releases the internal pixel buffer.
5370
+ */
5371
+ this.PDF_CANVAS_CLEANUP_VALUE = 0;
5372
+ this.platformId = inject(PLATFORM_ID);
5373
+ this.document = inject(DOCUMENT, { optional: true });
5374
+ this.pdfWorkerSrc = inject(PDF_WORKER_SRC);
5375
+ this.isBrowser = isPlatformBrowser(this.platformId);
5376
+ }
5377
+ /**
5378
+ * Generates a JPEG thumbnail from the first page of the PDF.
5379
+ *
5380
+ * Process:
5381
+ * 1. Loads the pdfjs-dist library dynamically
5382
+ * 2. Reads the PDF file from source/URL
5383
+ * 3. Renders the first page to a canvas (scaled to ~200px width, max 2x)
5384
+ * 4. Exports as JPEG (0.82 quality)
5385
+ * 5. Cleans up resources (page, document, loading task, canvas)
5386
+ *
5387
+ * Resource Management:
5388
+ * - Canvas is created only after we have the page and viewport dimensions
5389
+ * - Canvas is cleaned up immediately after blob extraction (toBlob callback)
5390
+ * - This prevents memory leaks from accumulated canvas objects
5391
+ * - All PDF.js resources (page, document, loading task) are also cleaned up
5392
+ *
5393
+ * Resilience:
5394
+ * - Tries worker-based rendering first
5395
+ * - Falls back to main-thread rendering if worker fails
5396
+ * - Handles cleanup errors gracefully
5397
+ *
5398
+ * @param source - The PDF file source (URL, Blob, ArrayBuffer, etc.)
5399
+ * @param resolvedUrl - Optional pre-resolved URL for the file
5400
+ * @returns A JPEG Blob thumbnail (240x320px recommended), or undefined on failure
5401
+ */
5402
+ async generateThumbnail(source, resolvedUrl) {
5403
+ if (!this.isBrowser || !this.document) {
5404
+ return undefined;
5405
+ }
5406
+ let loadingTask;
5407
+ let pdf;
5408
+ let page;
5409
+ let canvas;
5410
+ try {
5411
+ const pdfjs = await this.loadAndCachePdfJsModule();
5412
+ if (!pdfjs) {
5413
+ return undefined;
5414
+ }
5415
+ if (!pdfjs.GlobalWorkerOptions.workerSrc) {
5416
+ pdfjs.GlobalWorkerOptions.workerSrc = this.getDefaultPdfWorkerSourceUrl(pdfjs.version);
5417
+ }
5418
+ const arrayBuffer = await toArrayBuffer(source ?? resolvedUrl);
5419
+ const data = new Uint8Array(arrayBuffer);
5420
+ // Try with the worker first; if it fails (version mismatch, CORS, network)
5421
+ // retry on the main thread so users still get a thumbnail.
5422
+ loadingTask = pdfjs.getDocument({ data });
5423
+ try {
5424
+ pdf = await loadingTask.promise;
5425
+ }
5426
+ catch {
5427
+ try {
5428
+ await loadingTask?.destroy?.();
5429
+ }
5430
+ catch {
5431
+ // ignore
5432
+ }
5433
+ loadingTask = pdfjs.getDocument({ data, disableWorker: true });
5434
+ pdf = await loadingTask.promise;
5435
+ }
5436
+ page = await pdf.getPage(this.PDF_FIRST_PAGE_NUMBER);
5437
+ const naturalViewport = page.getViewport({ scale: this.PDF_NATURAL_SCALE });
5438
+ const scale = Math.min(this.PDF_TARGET_VIEWPORT_WIDTH_PX / naturalViewport.width, this.PDF_MAX_SCALE);
5439
+ const viewport = page.getViewport({ scale });
5440
+ // Create canvas only after we have the page and calculated viewport dimensions
5441
+ canvas = this.document.createElement('canvas');
5442
+ canvas.width = Math.ceil(viewport.width);
5443
+ canvas.height = Math.ceil(viewport.height);
5444
+ const ctx = canvas.getContext('2d');
5445
+ if (!ctx) {
5446
+ return undefined;
5447
+ }
5448
+ await page.render({ canvasContext: ctx, viewport }).promise;
5449
+ // Return blob with proper cleanup after extraction
5450
+ const canvasToExport = canvas;
5451
+ return await new Promise((resolve) => {
5452
+ canvasToExport.toBlob((blob) => {
5453
+ // Clean up canvas resources immediately after blob is extracted
5454
+ // This prevents accumulated canvas objects from staying in memory
5455
+ if (canvas) {
5456
+ canvas.width = this.PDF_CANVAS_CLEANUP_VALUE;
5457
+ canvas.height = this.PDF_CANVAS_CLEANUP_VALUE;
5458
+ canvas = undefined;
5459
+ }
5460
+ resolve(blob ?? undefined);
5461
+ }, 'image/jpeg', this.PDF_JPEG_QUALITY);
5462
+ });
5463
+ }
5464
+ catch {
5465
+ return undefined;
5466
+ }
5467
+ finally {
5468
+ // Best-effort cleanup of all resources
5469
+ try {
5470
+ page?.cleanup?.();
5471
+ }
5472
+ catch {
5473
+ // Best-effort cleanup.
5474
+ }
5475
+ try {
5476
+ pdf?.cleanup?.();
5477
+ await pdf?.destroy?.();
5478
+ }
5479
+ catch {
5480
+ // Best-effort cleanup.
5481
+ }
5482
+ try {
5483
+ await loadingTask?.destroy?.();
5484
+ }
5485
+ catch {
5486
+ // Best-effort cleanup.
5487
+ }
5488
+ if (canvas) {
5489
+ try {
5490
+ canvas.width = this.PDF_CANVAS_CLEANUP_VALUE;
5491
+ canvas.height = this.PDF_CANVAS_CLEANUP_VALUE;
5492
+ }
5493
+ catch {
5494
+ // Ignore cleanup errors
5495
+ }
5496
+ }
5497
+ }
5498
+ }
5499
+ /**
5500
+ * Gets the PDF.js worker URL to use for rendering.
5501
+ *
5502
+ * Priority:
5503
+ * 1. Custom URL from PDF_WORKER_SRC token (if provided)
5504
+ * 2. Versioned CDN URL matching the installed pdfjs-dist version
5505
+ *
5506
+ * This ensures the worker script matches the library version to prevent incompatibility.
5507
+ *
5508
+ * @param _version - The pdfjs-dist version (e.g., "4.0.0")
5509
+ * @returns The worker script URL
5510
+ */
5511
+ getDefaultPdfWorkerSourceUrl(_version) {
5512
+ // If the user provided a custom URL via the PDF_WORKER_SRC token, use it.
5513
+ // Otherwise build a versioned CDN URL so the worker matches the installed library.
5514
+ return this.pdfWorkerSrc;
5515
+ }
5516
+ /**
5517
+ * Dynamically imports and caches the pdfjs-dist module for PDF processing.
5518
+ * Uses a single cached promise to prevent multiple import attempts.
5519
+ * Handles failures gracefully by returning null if import fails.
5520
+ *
5521
+ * @returns The loaded pdfjs-dist module, or null if import fails
5522
+ */
5523
+ loadAndCachePdfJsModule() {
5524
+ // Widen the specifier to `string` so TS resolves this as a generic dynamic import instead of
5525
+ // statically loading pdfjs-dist's own types — those pull in `@napi-rs/canvas`'s Node-only
5526
+ // type declarations (Buffer/http/stream), which this library's tsconfig can't resolve
5527
+ // (no @types/node). Looks "unnecessary" to the linter, but removing it breaks `ng build`.
5528
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
5529
+ this.pdfJsModulePromise ??= import('pdfjs-dist').then((module) => module).catch(() => null);
5530
+ return this.pdfJsModulePromise;
5531
+ }
5532
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: PdfRenderer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5533
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: PdfRenderer, providedIn: 'root' }); }
5534
+ }
5535
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: PdfRenderer, decorators: [{
5536
+ type: Injectable,
5537
+ args: [{ providedIn: 'root' }]
5538
+ }] });
5539
+
5540
+ /**
5541
+ * Core service for the Material Addons File Preview component.
5542
+ *
5543
+ * Responsibilities:
5544
+ * - Detecting file kind from MIME type / extension
5545
+ * - Resolving any source format (URL, data URI, Base64 input, Blob, ArrayBuffer) to a URL
5546
+ * - Generating rasterised PDF thumbnails via pdfjs-dist (optional — gracefully falls back to icon)
5547
+ * - Triggering browser file downloads
5548
+ * - Cleaning up blob object URLs on destroy
5549
+ *
5550
+ * Note: DOCX rendering is now component-driven via DocxPreviewComponent for both full preview
5551
+ * and thumbnail modes. The service no longer renders DOCX content; it only detects the kind
5552
+ * and resolves the source URL. The dialog and gallery handle rendering.
5553
+ */
5554
+ class FilePreviewService {
5555
+ constructor() {
5556
+ /** Tracks object URLs created by this service so they can be revoked on destroy. */
5557
+ this.objectUrls = new Set();
5558
+ this.platformId = inject(PLATFORM_ID);
5559
+ this.document = inject(DOCUMENT, { optional: true });
5560
+ this.isBrowser = isPlatformBrowser(this.platformId);
5561
+ this.pdfRenderer = inject(PdfRenderer, { optional: true });
5562
+ }
5563
+ // ------------------------------------------------------------------
5564
+ // Public API
5565
+ // ------------------------------------------------------------------
5566
+ /** Resolves an array of FilePreviewItems in parallel. */
5567
+ async resolveItems(items, thumbnailConfig = {}) {
5568
+ if (items.length === 0) {
5569
+ return [];
5570
+ }
5571
+ const maxConcurrent = Math.min(4, items.length);
5572
+ const resolved = new Array(items.length);
5573
+ let cursor = 0;
5574
+ await Promise.all(Array.from({ length: maxConcurrent }, async () => {
5575
+ while (true) {
5576
+ const index = cursor++;
5577
+ if (index >= items.length) {
5578
+ return;
5579
+ }
5580
+ resolved[index] = await this.resolveItem(items[index], thumbnailConfig);
5581
+ }
5582
+ }));
5583
+ return resolved;
5584
+ }
5585
+ /**
5586
+ * Resolves a single FilePreviewItem:
5587
+ * 1. Detects the rendering kind (image / pdf / docx / unknown)
5588
+ * 2. Converts the source to a URL usable by <img>, <object>, or fetch
5589
+ * 3. Generates a thumbnail URL if none is supplied
5590
+ */
5591
+ async resolveItem(item, thumbnailConfig = {}) {
5592
+ const kind = this.detectKind(item);
5593
+ const resolvedPreviewUrl = this.sanitizeResolvedUrl(item.previewUrl) ?? this.resolveSourceUrl(item.source);
5594
+ let resolvedThumbnailUrl = this.sanitizeResolvedUrl(item.thumbnailUrl);
5595
+ if (!resolvedThumbnailUrl) {
5596
+ if (kind === 'image') {
5597
+ // Current image strategy: use resolved preview URL directly as thumbnail.
5598
+ resolvedThumbnailUrl = resolvedPreviewUrl;
5599
+ }
5600
+ else if (kind === 'pdf' && thumbnailConfig.generatePdfThumbnails && resolvedPreviewUrl) {
5601
+ resolvedThumbnailUrl = await this.tryGeneratePdfThumbnail(item.source, resolvedPreviewUrl);
5602
+ }
5603
+ // DOCX thumbnails are now component-driven (DocxPreviewComponent with scaling via CSS transform).
5604
+ // The gallery defers rendering the component until the tile scrolls into view (@defer on viewport),
5605
+ // and falls back to an icon if rendering fails.
5606
+ }
5607
+ return {
5608
+ ...item,
5609
+ kind,
5610
+ extension: this.getExtension(item.name),
5611
+ resolvedPreviewUrl,
5612
+ resolvedThumbnailUrl,
5613
+ };
5614
+ }
5615
+ /**
5616
+ * Detects the rendering kind from MIME type and/or file extension.
5617
+ * Extension-based detection serves as a reliable fallback for
5618
+ * scenarios where the MIME type is generic (e.g. 'application/octet-stream').
5619
+ */
5620
+ detectKind(item) {
5621
+ const mimeType = item.mimeType?.toLowerCase() ?? '';
5622
+ const extension = this.getExtension(item.name);
5623
+ return detectFileKind(mimeType, extension);
5624
+ }
5625
+ /**
5626
+ * Attempts to generate a rasterised first-page thumbnail for a PDF source.
5627
+ * Requires `pdfjs-dist` to be installed in the host application.
5628
+ * Returns undefined (triggering icon fallback) if the library is absent or rendering fails.
5629
+ *
5630
+ * To install: npm install pdfjs-dist
5631
+ */
5632
+ async tryGeneratePdfThumbnail(source, resolvedUrl) {
5633
+ if (!this.pdfRenderer) {
5634
+ return undefined;
5635
+ }
5636
+ try {
5637
+ const blob = await this.pdfRenderer.generateThumbnail(source, resolvedUrl);
5638
+ if (!blob) {
5639
+ return undefined;
5640
+ }
5641
+ return this.createObjectUrl(blob);
5642
+ }
5643
+ catch {
5644
+ // Rendering failed (corrupted PDF, worker unavailable, etc.) — use icon
5645
+ return undefined;
5646
+ }
5647
+ }
5648
+ /** Triggers a browser download for the resolved file. */
5649
+ download(item) {
5650
+ const href = this.sanitizeResolvedUrl(item.resolvedPreviewUrl);
5651
+ if (!href || !this.isBrowser || !this.document) {
5652
+ return;
5653
+ }
5654
+ const anchor = this.document.createElement('a');
5655
+ anchor.href = href;
5656
+ anchor.download = item.name;
5657
+ anchor.rel = 'noopener';
5658
+ this.document.body.appendChild(anchor);
5659
+ anchor.click();
5660
+ anchor.remove();
5661
+ }
5662
+ /**
5663
+ * Formats a byte count as a human-readable string (B / KB / MB).
5664
+ * Exposed for use in templates and tests.
5665
+ */
5666
+ formatFileSize(bytes) {
5667
+ if (bytes == null || bytes < 0) {
5668
+ return '';
5669
+ }
5670
+ if (bytes < 1024) {
5671
+ return `${bytes} B`;
5672
+ }
5673
+ if (bytes < 1024 * 1024) {
5674
+ return `${(bytes / 1024).toFixed(1)} KB`;
5675
+ }
5676
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
5677
+ }
5678
+ /** Revokes all object URLs created during this service's lifetime. Call on component destroy. */
5679
+ releaseResources() {
5680
+ if (this.canUseObjectUrls()) {
5681
+ this.objectUrls.forEach((url) => URL.revokeObjectURL(url));
5682
+ }
5683
+ this.objectUrls.clear();
5684
+ }
5685
+ /**
5686
+ * Keeps only currently used object URLs and revokes all others.
5687
+ * Useful for long-lived components receiving many list updates.
5688
+ */
5689
+ retainOnlyObjectUrls(urlsToKeep) {
5690
+ if (!this.canUseObjectUrls()) {
5691
+ this.objectUrls.clear();
5692
+ return;
5693
+ }
5694
+ const keep = new Set();
5695
+ for (const url of urlsToKeep) {
5696
+ if (url && this.objectUrls.has(url)) {
5697
+ keep.add(url);
5698
+ }
5699
+ }
5700
+ this.objectUrls.forEach((url) => {
5701
+ if (!keep.has(url)) {
5702
+ URL.revokeObjectURL(url);
5703
+ this.objectUrls.delete(url);
5704
+ }
5705
+ });
5706
+ }
5707
+ // ------------------------------------------------------------------
5708
+ // Private helpers
5709
+ // ------------------------------------------------------------------
5710
+ /**
5711
+ * Converts any accepted source format to a URL string.
5712
+ *
5713
+ * Accepted forms:
5714
+ * - `string` → returned as-is (data URI or http/https URL)
5715
+ * - `FilePreviewBase64Input` → assembled into a data URI
5716
+ * - `Blob | File` → converted to an object URL (tracked for cleanup)
5717
+ * - `ArrayBuffer` → wrapped in a Blob, then object URL
5718
+ */
5719
+ resolveSourceUrl(source) {
5720
+ if (!source) {
5721
+ return undefined;
5722
+ }
5723
+ // ① Structured Base64 input (e.g. from carCAT backend API)
5724
+ if (this.isBase64Input(source)) {
5725
+ return this.base64InputToDataUrl(source);
5726
+ }
5727
+ // ② Plain string — data URI (data:image/png;base64,...) or http/https URL
5728
+ if (typeof source === 'string') {
5729
+ return this.sanitizeResolvedUrl(source);
5730
+ }
5731
+ // ③ Blob / File — create a revocable object URL
5732
+ if (source instanceof Blob) {
5733
+ return this.createObjectUrl(source);
5734
+ }
5735
+ // ④ ArrayBuffer — wrap in a generic Blob
5736
+ const blob = new Blob([source]);
5737
+ return this.createObjectUrl(blob);
5738
+ }
5739
+ /**
5740
+ * Type guard for `FilePreviewBase64Input`.
5741
+ * Checks for the shape `{ data: string; mimeType: string }`.
5742
+ */
5743
+ isBase64Input(source) {
5744
+ return isBase64Input(source);
5745
+ }
5746
+ /**
5747
+ * Converts a `FilePreviewBase64Input` to a fully qualified data URI.
5748
+ * Accepts both raw base64 strings and pre-formed data URIs.
5749
+ */
5750
+ base64InputToDataUrl(input) {
5751
+ return base64InputToDataUrl(input);
5752
+ }
5753
+ createObjectUrl(blob) {
5754
+ // On server (SSR) do not create object URLs.
5755
+ if (!this.isBrowser) {
5756
+ return undefined;
5757
+ }
5758
+ try {
5759
+ if (typeof URL !== 'undefined' && typeof URL.createObjectURL === 'function') {
5760
+ const objectUrl = URL.createObjectURL(blob);
5761
+ this.objectUrls.add(objectUrl);
5762
+ return objectUrl;
5763
+ }
5764
+ }
5765
+ catch {
5766
+ // ignore and fall through to synthetic fallback
5767
+ }
5768
+ // Fallback for browser-like test environments without URL.createObjectURL (JSDOM/Node):
5769
+ const synthetic = `blob:local/${this.objectUrls.size + 1}`;
5770
+ this.objectUrls.add(synthetic);
5771
+ return synthetic;
5772
+ }
5773
+ canUseObjectUrls() {
5774
+ return (this.isBrowser && typeof URL !== 'undefined' && typeof URL.createObjectURL === 'function' && typeof URL.revokeObjectURL === 'function');
5775
+ }
5776
+ sanitizeResolvedUrl(url) {
5777
+ return url ? sanitizeSourceUrl(url, this.document?.baseURI) : undefined;
5778
+ }
5779
+ getExtension(fileName) {
5780
+ if (!fileName) {
5781
+ return '';
5782
+ }
5783
+ const parts = fileName.split('.');
5784
+ if (parts.length <= 1) {
5785
+ return '';
5786
+ }
5787
+ return parts[parts.length - 1].toLowerCase();
5788
+ }
5789
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: FilePreviewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5790
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: FilePreviewService }); }
5791
+ }
5792
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: FilePreviewService, decorators: [{
5793
+ type: Injectable
5794
+ }] });
5795
+
5796
+ /**
5797
+ * Standalone Angular component for displaying DOCX previews with Shadow DOM encapsulation.
5798
+ *
5799
+ * Features:
5800
+ * - Full-size preview rendering (default): Renders the full DOCX document at normal scale
5801
+ * - Thumbnail preview mode: Shows readable content cropped to thumbnail dimensions (like PDF)
5802
+ *
5803
+ * Responsibilities:
5804
+ * 1. Receives DOCX file source as input (required)
5805
+ * 2. Renders the DOCX directly into Shadow DOM using docx-preview library
5806
+ * 3. Keeps library CSS scoped to the shadow boundary (no global style pollution)
5807
+ * 4. Supports thumbnail mode: renders at readable size, container crops to show top portion
5808
+ * 5. Handles errors gracefully
5809
+ *
5810
+ * Thumbnail Strategy:
5811
+ * - In thumbnail mode, component renders at full readable size
5812
+ * - Container width is set to tile width (e.g., 240px)
5813
+ * - overflow: hidden crops the display to show top portion only
5814
+ * - Result: readable content preview similar to PDF thumbnails
5815
+ *
5816
+ * Shadow DOM Strategy:
5817
+ * - ViewEncapsulation.ShadowDom ensures docx-preview's styles don't affect the rest of the application
5818
+ * - CSS stays scoped to the component instance
5819
+ * - Multiple instances don't interfere with each other
5820
+ * - Third argument (styleContainer) in renderAsync() ensures styles stay within the shadow root
5821
+ */
5822
+ class DocxPreviewComponent {
5823
+ constructor() {
5824
+ /**
5825
+ * The DOCX file source to render (URL, Blob, ArrayBuffer, etc.).
5826
+ * Required input - component will not render without it.
5827
+ */
5828
+ this.source = input.required(/* @ts-ignore */
5829
+ ...(ngDevMode ? [{ debugName: "source" }] : /* istanbul ignore next */ []));
5830
+ /**
5831
+ * Thumbnail mode.
5832
+ * When true, only the document's first page is kept and it is scaled down to fit this
5833
+ * component's own content box, producing a readable mini-preview like the PDF thumbnails.
5834
+ *
5835
+ * The scale factor is derived from the host element's measured width, so the caller does
5836
+ * not pass a tile width — sizing the host (e.g. via the gallery tile) is enough.
5837
+ */
5838
+ this.thumbnail = input(false, /* @ts-ignore */
5839
+ ...(ngDevMode ? [{ debugName: "thumbnail" }] : /* istanbul ignore next */ []));
5840
+ /** Emits when rendering the DOCX fails, so callers can fall back to an icon. */
5841
+ this.renderFailed = output();
5842
+ this.isThumbnail = computed(() => this.thumbnail(), /* @ts-ignore */
5843
+ ...(ngDevMode ? [{ debugName: "isThumbnail" }] : /* istanbul ignore next */ []));
5844
+ this.docxHost = viewChild.required('docxHost', /* @ts-ignore */
5845
+ ...(ngDevMode ? [{ debugName: "docxHost" }] : /* istanbul ignore next */ []));
5846
+ this.platformId = inject(PLATFORM_ID);
5847
+ this.isBrowser = isPlatformBrowser(this.platformId);
5848
+ }
5849
+ ngAfterViewInit() {
5850
+ void this.renderDocx();
5851
+ }
5852
+ async renderDocx() {
5853
+ const source = this.source();
5854
+ if (!this.isBrowser) {
5855
+ this.showError();
5856
+ return;
5857
+ }
5858
+ try {
5859
+ const host = this.docxHost().nativeElement;
5860
+ const [{ renderAsync }, arrayBuffer] = await Promise.all([import('docx-preview'), toArrayBuffer(source)]);
5861
+ // Render DOCX directly into the shadow host
5862
+ // Pass host as third argument (styleContainer) to keep CSS scoped to shadow boundary
5863
+ await renderAsync(arrayBuffer, host, host, {
5864
+ className: 'docx-preview-document',
5865
+ inWrapper: true,
5866
+ ignoreWidth: false,
5867
+ ignoreHeight: true,
5868
+ // Always paginate: in thumbnail mode only the first page is kept, which keeps the
5869
+ // amount of rendered DOM per gallery tile bounded by one page instead of the whole document.
5870
+ breakPages: true,
5871
+ });
5872
+ // In thumbnail mode, keep only the first page and scale it down to fit the tile
5873
+ if (this.isThumbnail()) {
5874
+ this.applyThumbnailCrop(host);
5875
+ }
5876
+ }
5877
+ catch (error) {
5878
+ console.error('[DocxPreviewComponent] Error rendering DOCX:', error);
5879
+ this.showError();
5880
+ }
5881
+ }
5882
+ /**
5883
+ * Restrict the rendered DOCX to its first page and scale it down to fit the thumbnail tile.
5884
+ *
5885
+ * docx-preview renders each page as a <section class="{className}"> inside a
5886
+ * <div class="{className}-wrapper">. With className: 'docx-preview-document',
5887
+ * pages are `.docx-preview-document-wrapper > .docx-preview-document`.
5888
+ *
5889
+ * Pages are rendered at their real physical size (e.g. ~816px wide for a Letter page
5890
+ * with ~96px margins), which is far larger than a thumbnail tile. Simply cropping with
5891
+ * `overflow: hidden` only ever shows the page's blank top margin. Instead, the whole
5892
+ * page is visually scaled down with a CSS transform so its actual content is visible.
5893
+ */
5894
+ applyThumbnailCrop(host) {
5895
+ const wrapper = host.querySelector('.docx-preview-document-wrapper');
5896
+ const pages = host.querySelectorAll('.docx-preview-document-wrapper > .docx-preview-document');
5897
+ const firstPage = pages[0];
5898
+ if (!wrapper || !firstPage) {
5899
+ return;
5900
+ }
5901
+ // Hide all pages except the first one
5902
+ for (let i = 1; i < pages.length; i++) {
5903
+ pages[i].style.display = 'none';
5904
+ }
5905
+ // Scale the first page down so it fits this component's own content box. The host's
5906
+ // measured width is used rather than a caller-supplied tile width, because the host sits
5907
+ // inside the tile's padding — using the tile width would overflow and clip the page.
5908
+ const availableWidth = host.clientWidth;
5909
+ const naturalWidth = firstPage.getBoundingClientRect().width || firstPage.offsetWidth;
5910
+ if (!availableWidth || !naturalWidth) {
5911
+ return;
5912
+ }
5913
+ const scale = availableWidth / naturalWidth;
5914
+ wrapper.style.position = 'absolute';
5915
+ wrapper.style.top = '0';
5916
+ wrapper.style.left = '0';
5917
+ wrapper.style.transform = `scale(${scale})`;
5918
+ wrapper.style.transformOrigin = 'top left';
5919
+ }
5920
+ showError() {
5921
+ this.docxHost().nativeElement.innerHTML = '';
5922
+ this.renderFailed.emit();
5923
+ }
5924
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DocxPreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5925
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.4", type: DocxPreviewComponent, isStandalone: true, selector: "mad-docx-preview", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, thumbnail: { classPropertyName: "thumbnail", publicName: "thumbnail", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { renderFailed: "renderFailed" }, host: { properties: { "class.docx-preview--thumbnail": "isThumbnail()" } }, viewQueries: [{ propertyName: "docxHost", first: true, predicate: ["docxHost"], descendants: true, isSignal: true }], ngImport: i0, template: "<div #docxHost class=\"docx-preview-host\"></div>\n", styles: ["@charset \"UTF-8\";.docx-preview-host{box-sizing:border-box;width:100%;height:100%;overflow-y:auto;overflow-x:hidden;padding:12px}.docx-preview-host .docx-preview-document-wrapper{box-sizing:border-box;width:100%;max-width:100%;background:transparent;padding:0}.docx-preview-host .docx-preview-document-wrapper>.docx-preview-document{box-sizing:border-box;background:#fff;border:1px solid rgba(0,0,0,.12);border-radius:4px;max-width:100%;margin:0 auto 16px}:host(.docx-preview--thumbnail){display:block;width:100%;height:100%;overflow:hidden;pointer-events:none}:host(.docx-preview--thumbnail) .docx-preview-host{position:relative;width:100%;height:100%;overflow:hidden;padding:0}:host(.docx-preview--thumbnail) .docx-preview-host .docx-preview-document-wrapper{background:transparent;padding:0;display:block}:host(.docx-preview--thumbnail) .docx-preview-host .docx-preview-document-wrapper>.docx-preview-document{box-shadow:none;max-width:none;margin:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom }); }
5926
+ }
5927
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DocxPreviewComponent, decorators: [{
5928
+ type: Component,
5929
+ args: [{ selector: 'mad-docx-preview', encapsulation: ViewEncapsulation.ShadowDom, changeDetection: ChangeDetectionStrategy.OnPush, host: {
5930
+ '[class.docx-preview--thumbnail]': 'isThumbnail()',
5931
+ }, template: "<div #docxHost class=\"docx-preview-host\"></div>\n", styles: ["@charset \"UTF-8\";.docx-preview-host{box-sizing:border-box;width:100%;height:100%;overflow-y:auto;overflow-x:hidden;padding:12px}.docx-preview-host .docx-preview-document-wrapper{box-sizing:border-box;width:100%;max-width:100%;background:transparent;padding:0}.docx-preview-host .docx-preview-document-wrapper>.docx-preview-document{box-sizing:border-box;background:#fff;border:1px solid rgba(0,0,0,.12);border-radius:4px;max-width:100%;margin:0 auto 16px}:host(.docx-preview--thumbnail){display:block;width:100%;height:100%;overflow:hidden;pointer-events:none}:host(.docx-preview--thumbnail) .docx-preview-host{position:relative;width:100%;height:100%;overflow:hidden;padding:0}:host(.docx-preview--thumbnail) .docx-preview-host .docx-preview-document-wrapper{background:transparent;padding:0;display:block}:host(.docx-preview--thumbnail) .docx-preview-host .docx-preview-document-wrapper>.docx-preview-document{box-shadow:none;max-width:none;margin:0}\n"] }]
5932
+ }], propDecorators: { source: [{ type: i0.Input, args: [{ isSignal: true, alias: "source", required: true }] }], thumbnail: [{ type: i0.Input, args: [{ isSignal: true, alias: "thumbnail", required: false }] }], renderFailed: [{ type: i0.Output, args: ["renderFailed"] }], docxHost: [{ type: i0.ViewChild, args: ['docxHost', { isSignal: true }] }] } });
5933
+
5934
+ var docxPreview_component = /*#__PURE__*/Object.freeze({
5935
+ __proto__: null,
5936
+ DocxPreviewComponent: DocxPreviewComponent
5937
+ });
5938
+
5939
+ class FilePreviewDialogComponent {
5940
+ constructor(dialogRef, data, filePreviewService, documentRef, sanitizer) {
5941
+ this.dialogRef = dialogRef;
5942
+ this.filePreviewService = filePreviewService;
5943
+ this.documentRef = documentRef;
5944
+ this.sanitizer = sanitizer;
5945
+ // Signals
5946
+ /** Set to the kind whose renderer reported a failure, so the template can fall back. */
5947
+ this.renderError = signal(null, /* @ts-ignore */
5948
+ ...(ngDevMode ? [{ debugName: "renderError" }] : /* istanbul ignore next */ []));
5949
+ this.downloadUrl = null;
5950
+ this.inlinePdfUrl = null;
5951
+ this.isMaximized = false;
5952
+ this.item = data.item;
5953
+ this.config = data.config;
5954
+ this.labels = data.labels;
5955
+ this.visibleCustomActions = data.visibleCustomActions;
5956
+ this.isDownloadVisible = data.isDownloadVisible;
5957
+ this.isDeleteVisible = data.isDeleteVisible;
5958
+ const safeUrl = this.sanitizeUrl(data.item.resolvedPreviewUrl);
5959
+ this.downloadUrl = safeUrl ?? null;
5960
+ this.inlinePdfUrl = this.computeInlinePdfUrl(data.item, safeUrl);
5961
+ }
5962
+ trackByActionId(_, action) {
5963
+ return action.id;
5964
+ }
5965
+ formatFileSize(bytes) {
5966
+ return this.filePreviewService.formatFileSize(bytes);
5967
+ }
5968
+ getMetaIcon() {
5969
+ switch (this.item.kind) {
5970
+ case 'pdf':
5971
+ return 'picture_as_pdf';
5972
+ case 'docx':
5973
+ return 'description';
5974
+ case 'image':
5975
+ return 'image';
5976
+ case 'xlsx':
5977
+ return 'table_chart';
5978
+ default:
5979
+ return 'insert_drive_file';
5980
+ }
5981
+ }
5982
+ getMaximizeLabel() {
5983
+ return this.isMaximized ? this.labels.restoreActionLabel : this.labels.maximizeActionLabel;
5984
+ }
5985
+ close() {
5986
+ this.dialogRef.close(null);
5987
+ }
5988
+ toggleMaximize() {
5989
+ this.isMaximized = !this.isMaximized;
5990
+ this.applyDialogSize();
5991
+ }
5992
+ download() {
5993
+ this.filePreviewService.download(this.item);
5994
+ }
5995
+ triggerDelete() {
5996
+ this.dialogRef.close({ type: 'delete', item: this.item });
5997
+ }
5998
+ triggerAction(action) {
5999
+ this.dialogRef.close({ type: 'action', action, item: this.item });
6000
+ }
6001
+ ngAfterViewInit() {
6002
+ // Apply responsive dialog sizing
6003
+ this.applyDialogSize();
6004
+ }
6005
+ onDocxRenderFailed() {
6006
+ this.renderError.set('docx');
6007
+ }
6008
+ applyDialogSize() {
6009
+ this.updatePanelClasses();
6010
+ }
6011
+ updatePanelClasses() {
6012
+ const maximizedClass = 'fp-mat-dialog--maximized';
6013
+ const normalClass = 'fp-mat-dialog--normal';
6014
+ if (this.isMaximized) {
6015
+ this.dialogRef.addPanelClass(maximizedClass);
6016
+ this.dialogRef.removePanelClass(normalClass);
6017
+ }
6018
+ else {
6019
+ this.dialogRef.addPanelClass(normalClass);
6020
+ this.dialogRef.removePanelClass(maximizedClass);
6021
+ }
6022
+ }
6023
+ sanitizeUrl(url) {
6024
+ return url ? sanitizeSourceUrl(url, this.documentRef?.baseURI) : undefined;
6025
+ }
6026
+ computeInlinePdfUrl(item, safeUrl) {
6027
+ if (item.kind !== 'pdf' || !safeUrl) {
6028
+ return null;
6029
+ }
6030
+ const isTrusted = safeUrl.startsWith('data:') ? /^data:application\/pdf[;,]/i.test(safeUrl) : this.isTrustedUrl(safeUrl);
6031
+ // Already validated above (protocol/origin/mime allow-list), so bypassing Angular's
6032
+ // RESOURCE_URL sanitizer here is safe and required for binding to <object [attr.data]>.
6033
+ return isTrusted ? this.sanitizer.bypassSecurityTrustResourceUrl(safeUrl) : null;
6034
+ }
6035
+ isTrustedUrl(url) {
6036
+ if (url.startsWith('blob:') || url.startsWith('data:')) {
6037
+ return true;
6038
+ }
6039
+ try {
6040
+ const baseUrl = this.documentRef?.baseURI;
6041
+ if (!baseUrl) {
6042
+ return false;
6043
+ }
6044
+ const parsed = new URL(url, baseUrl);
6045
+ const origin = new URL(baseUrl).origin;
6046
+ return (parsed.protocol === 'http:' || parsed.protocol === 'https:') && parsed.origin === origin;
6047
+ }
6048
+ catch {
6049
+ return false;
6050
+ }
6051
+ }
6052
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: FilePreviewDialogComponent, deps: [{ token: i1$5.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: FilePreviewService }, { token: DOCUMENT }, { token: i2$5.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
6053
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: FilePreviewDialogComponent, isStandalone: true, selector: "mad-file-preview-dialog", providers: [FilePreviewService], ngImport: i0, template: "<div class=\"fp-dialog__panel flex flex-col h-full overflow-hidden\">\n <!-- Header -->\n <div\n class=\"fp-dialog__header grid grid-cols-[minmax(0,1fr)_auto] items-start gap-4 py-4 pl-4 pr-2 border-b border-(--mat-sys-outline-variant) shrink-0 [@media(width<480px)]:grid-cols-[minmax(0,1fr)] [@media(width<480px)]:gap-3 [@media(width<480px)]:py-3 [@media(width<480px)]:pl-3 [@media(width<480px)]:pr-3 md:pr-3\"\n >\n <div class=\"fp-dialog__meta flex items-start gap-3 min-w-0 max-w-full [@media(width<480px)]:w-full [@media(width<480px)]:gap-[10px]\">\n <mat-icon\n class=\"fp-dialog__meta-icon text-[28px] w-7 h-7 shrink-0 text-(--mat-sys-primary) [@media(width<480px)]:text-[24px] [@media(width<480px)]:w-6 [@media(width<480px)]:h-6\"\n >\n {{ getMetaIcon() }}\n </mat-icon>\n <div class=\"fp-dialog__meta-content min-w-0 flex-1 max-w-full overflow-hidden\">\n <h2\n class=\"fp-dialog__title m-0 text-[length:var(--mat-sys-title-small-size)] font-semibold line-clamp-2 [overflow-wrap:anywhere] [word-break:break-word] leading-[1.35] max-h-[calc(1.35em*2)] text-(--mat-sys-on-surface) [@media(width<480px)]:text-base [@media(width<480px)]:leading-[1.3] [@media(width<480px)]:line-clamp-3 [@media(width<480px)]:max-h-[calc(1.35em*3)]\"\n >\n {{ item.name }}\n </h2>\n @if (item.size) {\n <span class=\"fp-dialog__subtitle text-xs text-(--mat-sys-on-surface-variant) leading-[1.4] [@media(width<480px)]:text-[11px]\">{{\n formatFileSize(item.size)\n }}</span>\n }\n </div>\n </div>\n\n <div\n class=\"fp-dialog__header-actions flex items-center shrink-0 flex-nowrap justify-end gap-1 [@media(width<480px)]:gap-0 [@media(width<480px)]:w-full [@media(width<480px)]:justify-start [@media(width<480px)]:ml-10\"\n >\n <!-- Download -->\n @if (isDownloadVisible) {\n <button\n mat-icon-button\n data-cy=\"file-preview-download-action\"\n [matTooltip]=\"labels.downloadActionLabel\"\n [attr.aria-label]=\"labels.downloadActionLabel\"\n (click)=\"download()\"\n >\n <mat-icon>download</mat-icon>\n </button>\n }\n\n <!-- Custom actions -->\n @for (action of visibleCustomActions; track action.id) {\n <button\n mat-icon-button\n [attr.data-cy]=\"'file-preview-custom-action-' + action.id\"\n [matTooltip]=\"action.label\"\n [attr.aria-label]=\"action.label\"\n [color]=\"action.color ?? undefined\"\n (click)=\"triggerAction(action)\"\n >\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n }\n\n <!-- Delete -->\n @if (isDeleteVisible) {\n <button\n mat-icon-button\n data-cy=\"file-preview-delete-action\"\n color=\"warn\"\n [matTooltip]=\"labels.deleteActionLabel\"\n [attr.aria-label]=\"labels.deleteActionLabel\"\n (click)=\"triggerDelete()\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n }\n\n <!-- Maximize / Restore -->\n <button\n mat-icon-button\n data-cy=\"file-preview-maximize-action\"\n [matTooltip]=\"getMaximizeLabel()\"\n [attr.aria-label]=\"getMaximizeLabel()\"\n (click)=\"toggleMaximize()\"\n >\n <mat-icon>{{ isMaximized ? 'fullscreen_exit' : 'fullscreen' }}</mat-icon>\n </button>\n\n <!-- Close -->\n <button\n mat-icon-button\n data-cy=\"file-preview-close-action\"\n [matTooltip]=\"labels.closeActionLabel\"\n [attr.aria-label]=\"labels.closeActionLabel\"\n (click)=\"close()\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </div>\n <!-- /fp-dialog__header -->\n\n <!-- Body -->\n <div\n class=\"fp-dialog__body flex-1 flex items-center justify-center overflow-auto bg-(--mat-sys-surface-container-lowest) p-4 [@media(width<480px)]:p-3 lg:p-5\"\n >\n @switch (item.kind) {\n @case ('image') {\n <img class=\"fp-dialog__img max-w-full max-h-full object-contain rounded\" [src]=\"item.resolvedPreviewUrl\" [alt]=\"item.name\" />\n }\n @case ('pdf') {\n <object\n #pdfPreviewObject\n class=\"fp-dialog__pdf w-full h-full border-0 block\"\n type=\"application/pdf\"\n [attr.aria-label]=\"item.name\"\n [attr.data]=\"inlinePdfUrl\"\n data-cy=\"file-preview-pdf-object\"\n >\n <div\n class=\"fp-dialog__unsupported text-[13px] text-(--mat-sys-on-surface-variant) leading-normal text-center p-4 [@media(width<480px)]:p-3 [@media(width<480px)]:text-xs\"\n role=\"status\"\n >\n <p>{{ labels.noPreviewMessage }}</p>\n <button\n mat-stroked-button\n data-cy=\"file-preview-pdf-fallback-download\"\n [attr.aria-label]=\"labels.downloadActionLabel\"\n (click)=\"download()\"\n >\n <mat-icon aria-hidden=\"true\">download</mat-icon>\n {{ labels.downloadLabel }}\n </button>\n </div>\n </object>\n }\n @case ('docx') {\n <div class=\"fp-dialog__docx w-full h-full overflow-auto\">\n @if (renderError() !== 'docx') {\n <mad-docx-preview [source]=\"item.source ?? item.resolvedPreviewUrl\" (renderFailed)=\"onDocxRenderFailed()\" />\n } @else {\n <div\n class=\"fp-dialog__no-preview flex flex-col items-center gap-4 text-(--mat-sys-on-surface-variant) p-4 text-center [@media(width<480px)]:gap-3 [@media(width<480px)]:p-3\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <mat-icon aria-hidden=\"true\">description</mat-icon>\n <p class=\"m-0 text-sm leading-normal [@media(width<480px)]:text-[13px]\">{{ labels.noPreviewMessage }}</p>\n <button\n mat-stroked-button\n data-cy=\"file-preview-docx-fallback-download\"\n [attr.aria-label]=\"labels.downloadActionLabel\"\n (click)=\"download()\"\n >\n <mat-icon aria-hidden=\"true\">download</mat-icon> {{ labels.downloadLabel }}\n </button>\n </div>\n }\n </div>\n }\n @default {\n <div\n class=\"fp-dialog__no-preview flex flex-col items-center gap-4 text-(--mat-sys-on-surface-variant) p-4 text-center [@media(width<480px)]:gap-3 [@media(width<480px)]:p-3\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <mat-icon aria-hidden=\"true\">hide_image</mat-icon>\n <p class=\"m-0 text-sm leading-normal [@media(width<480px)]:text-[13px]\">{{ labels.noPreviewMessage }}</p>\n <button\n mat-stroked-button\n data-cy=\"file-preview-fallback-download\"\n [attr.aria-label]=\"labels.downloadActionLabel\"\n (click)=\"download()\"\n >\n <mat-icon aria-hidden=\"true\">download</mat-icon> {{ labels.downloadLabel }}\n </button>\n </div>\n }\n }\n </div>\n <!-- /fp-dialog__body -->\n</div>\n", styles: [":host{display:flex;flex-direction:column;height:100%;overflow:hidden}.fp-dialog__header-actions .mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 40px}@media(width<480px){.fp-dialog__header-actions .mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 36px;width:36px;height:36px}}.fp-dialog__no-preview .mat-mdc-stroked-button{--mdc-button-label-text-size: 14px}@media(width<480px){.fp-dialog__no-preview .mat-mdc-stroked-button{--mdc-button-label-text-size: 13px}}.fp-dialog__no-preview .mat-mdc-stroked-button mat-icon{font-size:14px;width:14px;height:14px;margin-right:4px;margin-top:4px}@media(width<480px){.fp-dialog__no-preview .mat-mdc-stroked-button mat-icon{font-size:13px;width:13px;height:13px}}.fp-dialog__unsupported .mat-mdc-stroked-button{--mdc-button-label-text-size: 13px}@media(width<480px){.fp-dialog__unsupported .mat-mdc-stroked-button{--mdc-button-label-text-size: 12px}}.fp-dialog__unsupported .mat-mdc-stroked-button mat-icon{font-size:13px;width:13px;height:13px;margin-right:4px;margin-top:4px}@media(width<480px){.fp-dialog__unsupported .mat-mdc-stroked-button mat-icon{font-size:12px;width:12px;height:12px}}.fp-dialog__docx .docx-preview-document{background:var(--mat-sys-surface, #fff);padding:24px;min-height:100%;font-family:Calibri,Arial,sans-serif}@media(width<480px){.fp-dialog__docx .docx-preview-document{padding:16px}}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "component", type: DocxPreviewComponent, selector: "mad-docx-preview", inputs: ["source", "thumbnail"], outputs: ["renderFailed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6054
+ }
6055
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: FilePreviewDialogComponent, decorators: [{
6056
+ type: Component,
6057
+ args: [{ selector: 'mad-file-preview-dialog', imports: [MatButtonModule, MatIconModule, MatTooltipModule, MatDialogModule, DocxPreviewComponent], providers: [FilePreviewService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"fp-dialog__panel flex flex-col h-full overflow-hidden\">\n <!-- Header -->\n <div\n class=\"fp-dialog__header grid grid-cols-[minmax(0,1fr)_auto] items-start gap-4 py-4 pl-4 pr-2 border-b border-(--mat-sys-outline-variant) shrink-0 [@media(width<480px)]:grid-cols-[minmax(0,1fr)] [@media(width<480px)]:gap-3 [@media(width<480px)]:py-3 [@media(width<480px)]:pl-3 [@media(width<480px)]:pr-3 md:pr-3\"\n >\n <div class=\"fp-dialog__meta flex items-start gap-3 min-w-0 max-w-full [@media(width<480px)]:w-full [@media(width<480px)]:gap-[10px]\">\n <mat-icon\n class=\"fp-dialog__meta-icon text-[28px] w-7 h-7 shrink-0 text-(--mat-sys-primary) [@media(width<480px)]:text-[24px] [@media(width<480px)]:w-6 [@media(width<480px)]:h-6\"\n >\n {{ getMetaIcon() }}\n </mat-icon>\n <div class=\"fp-dialog__meta-content min-w-0 flex-1 max-w-full overflow-hidden\">\n <h2\n class=\"fp-dialog__title m-0 text-[length:var(--mat-sys-title-small-size)] font-semibold line-clamp-2 [overflow-wrap:anywhere] [word-break:break-word] leading-[1.35] max-h-[calc(1.35em*2)] text-(--mat-sys-on-surface) [@media(width<480px)]:text-base [@media(width<480px)]:leading-[1.3] [@media(width<480px)]:line-clamp-3 [@media(width<480px)]:max-h-[calc(1.35em*3)]\"\n >\n {{ item.name }}\n </h2>\n @if (item.size) {\n <span class=\"fp-dialog__subtitle text-xs text-(--mat-sys-on-surface-variant) leading-[1.4] [@media(width<480px)]:text-[11px]\">{{\n formatFileSize(item.size)\n }}</span>\n }\n </div>\n </div>\n\n <div\n class=\"fp-dialog__header-actions flex items-center shrink-0 flex-nowrap justify-end gap-1 [@media(width<480px)]:gap-0 [@media(width<480px)]:w-full [@media(width<480px)]:justify-start [@media(width<480px)]:ml-10\"\n >\n <!-- Download -->\n @if (isDownloadVisible) {\n <button\n mat-icon-button\n data-cy=\"file-preview-download-action\"\n [matTooltip]=\"labels.downloadActionLabel\"\n [attr.aria-label]=\"labels.downloadActionLabel\"\n (click)=\"download()\"\n >\n <mat-icon>download</mat-icon>\n </button>\n }\n\n <!-- Custom actions -->\n @for (action of visibleCustomActions; track action.id) {\n <button\n mat-icon-button\n [attr.data-cy]=\"'file-preview-custom-action-' + action.id\"\n [matTooltip]=\"action.label\"\n [attr.aria-label]=\"action.label\"\n [color]=\"action.color ?? undefined\"\n (click)=\"triggerAction(action)\"\n >\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n }\n\n <!-- Delete -->\n @if (isDeleteVisible) {\n <button\n mat-icon-button\n data-cy=\"file-preview-delete-action\"\n color=\"warn\"\n [matTooltip]=\"labels.deleteActionLabel\"\n [attr.aria-label]=\"labels.deleteActionLabel\"\n (click)=\"triggerDelete()\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n }\n\n <!-- Maximize / Restore -->\n <button\n mat-icon-button\n data-cy=\"file-preview-maximize-action\"\n [matTooltip]=\"getMaximizeLabel()\"\n [attr.aria-label]=\"getMaximizeLabel()\"\n (click)=\"toggleMaximize()\"\n >\n <mat-icon>{{ isMaximized ? 'fullscreen_exit' : 'fullscreen' }}</mat-icon>\n </button>\n\n <!-- Close -->\n <button\n mat-icon-button\n data-cy=\"file-preview-close-action\"\n [matTooltip]=\"labels.closeActionLabel\"\n [attr.aria-label]=\"labels.closeActionLabel\"\n (click)=\"close()\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </div>\n <!-- /fp-dialog__header -->\n\n <!-- Body -->\n <div\n class=\"fp-dialog__body flex-1 flex items-center justify-center overflow-auto bg-(--mat-sys-surface-container-lowest) p-4 [@media(width<480px)]:p-3 lg:p-5\"\n >\n @switch (item.kind) {\n @case ('image') {\n <img class=\"fp-dialog__img max-w-full max-h-full object-contain rounded\" [src]=\"item.resolvedPreviewUrl\" [alt]=\"item.name\" />\n }\n @case ('pdf') {\n <object\n #pdfPreviewObject\n class=\"fp-dialog__pdf w-full h-full border-0 block\"\n type=\"application/pdf\"\n [attr.aria-label]=\"item.name\"\n [attr.data]=\"inlinePdfUrl\"\n data-cy=\"file-preview-pdf-object\"\n >\n <div\n class=\"fp-dialog__unsupported text-[13px] text-(--mat-sys-on-surface-variant) leading-normal text-center p-4 [@media(width<480px)]:p-3 [@media(width<480px)]:text-xs\"\n role=\"status\"\n >\n <p>{{ labels.noPreviewMessage }}</p>\n <button\n mat-stroked-button\n data-cy=\"file-preview-pdf-fallback-download\"\n [attr.aria-label]=\"labels.downloadActionLabel\"\n (click)=\"download()\"\n >\n <mat-icon aria-hidden=\"true\">download</mat-icon>\n {{ labels.downloadLabel }}\n </button>\n </div>\n </object>\n }\n @case ('docx') {\n <div class=\"fp-dialog__docx w-full h-full overflow-auto\">\n @if (renderError() !== 'docx') {\n <mad-docx-preview [source]=\"item.source ?? item.resolvedPreviewUrl\" (renderFailed)=\"onDocxRenderFailed()\" />\n } @else {\n <div\n class=\"fp-dialog__no-preview flex flex-col items-center gap-4 text-(--mat-sys-on-surface-variant) p-4 text-center [@media(width<480px)]:gap-3 [@media(width<480px)]:p-3\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <mat-icon aria-hidden=\"true\">description</mat-icon>\n <p class=\"m-0 text-sm leading-normal [@media(width<480px)]:text-[13px]\">{{ labels.noPreviewMessage }}</p>\n <button\n mat-stroked-button\n data-cy=\"file-preview-docx-fallback-download\"\n [attr.aria-label]=\"labels.downloadActionLabel\"\n (click)=\"download()\"\n >\n <mat-icon aria-hidden=\"true\">download</mat-icon> {{ labels.downloadLabel }}\n </button>\n </div>\n }\n </div>\n }\n @default {\n <div\n class=\"fp-dialog__no-preview flex flex-col items-center gap-4 text-(--mat-sys-on-surface-variant) p-4 text-center [@media(width<480px)]:gap-3 [@media(width<480px)]:p-3\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <mat-icon aria-hidden=\"true\">hide_image</mat-icon>\n <p class=\"m-0 text-sm leading-normal [@media(width<480px)]:text-[13px]\">{{ labels.noPreviewMessage }}</p>\n <button\n mat-stroked-button\n data-cy=\"file-preview-fallback-download\"\n [attr.aria-label]=\"labels.downloadActionLabel\"\n (click)=\"download()\"\n >\n <mat-icon aria-hidden=\"true\">download</mat-icon> {{ labels.downloadLabel }}\n </button>\n </div>\n }\n }\n </div>\n <!-- /fp-dialog__body -->\n</div>\n", styles: [":host{display:flex;flex-direction:column;height:100%;overflow:hidden}.fp-dialog__header-actions .mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 40px}@media(width<480px){.fp-dialog__header-actions .mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 36px;width:36px;height:36px}}.fp-dialog__no-preview .mat-mdc-stroked-button{--mdc-button-label-text-size: 14px}@media(width<480px){.fp-dialog__no-preview .mat-mdc-stroked-button{--mdc-button-label-text-size: 13px}}.fp-dialog__no-preview .mat-mdc-stroked-button mat-icon{font-size:14px;width:14px;height:14px;margin-right:4px;margin-top:4px}@media(width<480px){.fp-dialog__no-preview .mat-mdc-stroked-button mat-icon{font-size:13px;width:13px;height:13px}}.fp-dialog__unsupported .mat-mdc-stroked-button{--mdc-button-label-text-size: 13px}@media(width<480px){.fp-dialog__unsupported .mat-mdc-stroked-button{--mdc-button-label-text-size: 12px}}.fp-dialog__unsupported .mat-mdc-stroked-button mat-icon{font-size:13px;width:13px;height:13px;margin-right:4px;margin-top:4px}@media(width<480px){.fp-dialog__unsupported .mat-mdc-stroked-button mat-icon{font-size:12px;width:12px;height:12px}}.fp-dialog__docx .docx-preview-document{background:var(--mat-sys-surface, #fff);padding:24px;min-height:100%;font-family:Calibri,Arial,sans-serif}@media(width<480px){.fp-dialog__docx .docx-preview-document{padding:16px}}\n"] }]
6058
+ }], ctorParameters: () => [{ type: i1$5.MatDialogRef }, { type: undefined, decorators: [{
6059
+ type: Inject,
6060
+ args: [MAT_DIALOG_DATA]
6061
+ }] }, { type: FilePreviewService }, { type: Document, decorators: [{
6062
+ type: Inject,
6063
+ args: [DOCUMENT]
6064
+ }] }, { type: i2$5.DomSanitizer }] });
6065
+
6066
+ class FilePreviewComponent {
6067
+ constructor(filePreviewService, dialog, translate) {
6068
+ this.filePreviewService = filePreviewService;
6069
+ this.dialog = dialog;
6070
+ this.translate = translate;
6071
+ this.items = input(null, /* @ts-ignore */
6072
+ ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
6073
+ this.config = input(DEFAULT_FILE_PREVIEW_CONFIG, /* @ts-ignore */
6074
+ ...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
6075
+ this.labels = input(undefined, /* @ts-ignore */
6076
+ ...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
6077
+ this.previewOpened = output();
6078
+ this.actionClicked = output();
6079
+ this.deleteClicked = output();
6080
+ this.resolvedItems = signal([], /* @ts-ignore */
6081
+ ...(ngDevMode ? [{ debugName: "resolvedItems" }] : /* istanbul ignore next */ []));
6082
+ this.mergedConfig = computed(() => ({ ...DEFAULT_FILE_PREVIEW_CONFIG, ...(this.config() ?? {}) }), /* @ts-ignore */
6083
+ ...(ngDevMode ? [{ debugName: "mergedConfig" }] : /* istanbul ignore next */ []));
6084
+ this.thumbnailDimensions = computed(() => this.resolveSize(this.mergedConfig().thumbnailSize), /* @ts-ignore */
6085
+ ...(ngDevMode ? [{ debugName: "thumbnailDimensions" }] : /* istanbul ignore next */ []));
6086
+ this.mergedLabels = computed(() =>
6087
+ // Merge in priority order: user-provided labels > i18n translations > defaults
6088
+ ({
6089
+ ...DEFAULT_FILE_PREVIEW_LABELS,
6090
+ ...this.i18nLabels(),
6091
+ ...(this.labels() ?? {}),
6092
+ }), /* @ts-ignore */
6093
+ ...(ngDevMode ? [{ debugName: "mergedLabels" }] : /* istanbul ignore next */ []));
6094
+ this.visibleCustomActions = computed(() => this.mergedConfig().actions ?? [], /* @ts-ignore */
6095
+ ...(ngDevMode ? [{ debugName: "visibleCustomActions" }] : /* istanbul ignore next */ []));
6096
+ this.hasVisibleActions = computed(() => this.mergedConfig().showActionIcons &&
6097
+ Boolean((this.mergedConfig().showOverlayPreview && this.mergedConfig().showPreviewAction) ||
6098
+ this.mergedConfig().showDownloadAction ||
6099
+ this.mergedConfig().showDeleteAction ||
6100
+ this.visibleCustomActions().length > 0), /* @ts-ignore */
6101
+ ...(ngDevMode ? [{ debugName: "hasVisibleActions" }] : /* istanbul ignore next */ []));
6102
+ /** Ids of items whose DOCX thumbnail failed to render, so the template falls back to an icon. */
6103
+ this.docxRenderErrors = signal(new Set(), /* @ts-ignore */
6104
+ ...(ngDevMode ? [{ debugName: "docxRenderErrors" }] : /* istanbul ignore next */ []));
6105
+ this.loadRequestId = 0;
6106
+ this.isDestroyed = false;
6107
+ this.i18nLabels = signal({}, /* @ts-ignore */
6108
+ ...(ngDevMode ? [{ debugName: "i18nLabels" }] : /* istanbul ignore next */ []));
6109
+ this.loadI18nLabels();
6110
+ // React to items input changes using an effect so signals drive template updates
6111
+ effect(() => {
6112
+ void this.scheduleLoadItems(this.items() ?? []);
6113
+ });
6114
+ }
6115
+ ngOnDestroy() {
6116
+ this.isDestroyed = true;
6117
+ // Cancel a pending debounced load: without this, a load scheduled moments before destroy
6118
+ // still runs and resolves items, creating object URLs on a service that has already
6119
+ // released its set — those URLs would never be revoked.
6120
+ if (this.loadDebounceTimer) {
6121
+ clearTimeout(this.loadDebounceTimer);
6122
+ this.loadDebounceTimer = undefined;
6123
+ }
6124
+ this.dialogRef?.close();
6125
+ this.filePreviewService.releaseResources();
6126
+ }
6127
+ trackById(_, item) {
6128
+ return item.id;
6129
+ }
6130
+ onDocxRenderFailed(itemId) {
6131
+ this.docxRenderErrors.update((current) => new Set(current).add(itemId));
6132
+ }
6133
+ trackByActionId(_, action) {
6134
+ return action.id;
6135
+ }
6136
+ formatFileSize(bytes) {
6137
+ return this.filePreviewService.formatFileSize(bytes);
6138
+ }
6139
+ openPreview(item) {
6140
+ if (!this.mergedConfig().showOverlayPreview) {
6141
+ return;
6142
+ }
6143
+ const data = {
6144
+ item,
6145
+ config: this.mergedConfig(),
6146
+ labels: this.mergedLabels(),
6147
+ visibleCustomActions: this.visibleCustomActions(),
6148
+ isDownloadVisible: this.isFileActionVisible('downloadAction'),
6149
+ isDeleteVisible: this.isFileActionVisible('deleteAction'),
6150
+ };
6151
+ this.previewOpened.emit(item);
6152
+ this.dialogRef = this.dialog.open(FilePreviewDialogComponent, {
6153
+ data,
6154
+ // size is applied by the dialog component itself for responsive behavior
6155
+ panelClass: 'fp-mat-dialog',
6156
+ autoFocus: false,
6157
+ });
6158
+ this.dialogRef.afterClosed().subscribe((result) => {
6159
+ this.dialogRef = undefined;
6160
+ if (!result) {
6161
+ return;
6162
+ }
6163
+ if (result.type === 'delete') {
6164
+ this.deleteClicked.emit(result.item);
6165
+ }
6166
+ else if (result.type === 'action') {
6167
+ this.actionClicked.emit({ action: result.action, item: result.item });
6168
+ }
6169
+ });
6170
+ }
6171
+ triggerAction(action, item) {
6172
+ this.actionClicked.emit({ action, item });
6173
+ }
6174
+ triggerDelete(item) {
6175
+ this.deleteClicked.emit(item);
6176
+ }
6177
+ download(item) {
6178
+ this.filePreviewService.download(item);
6179
+ }
6180
+ isFileActionVisible(action) {
6181
+ return this.computeFileActionVisible(action);
6182
+ }
6183
+ scheduleLoadItems(items) {
6184
+ if (this.loadDebounceTimer) {
6185
+ clearTimeout(this.loadDebounceTimer);
6186
+ }
6187
+ this.loadDebounceTimer = setTimeout(() => {
6188
+ void this.loadItems(items);
6189
+ this.loadDebounceTimer = undefined;
6190
+ }, 250);
6191
+ }
6192
+ async loadItems(items) {
6193
+ if (this.isDestroyed) {
6194
+ return;
6195
+ }
6196
+ const requestId = ++this.loadRequestId;
6197
+ const keepUrls = new Set();
6198
+ // Clear immediately so stale thumbnails don't linger and the empty state shows at once.
6199
+ this.resolvedItems.set([]);
6200
+ this.docxRenderErrors.set(new Set());
6201
+ this.retainCurrentObjectUrls();
6202
+ if (items.length === 0) {
6203
+ return;
6204
+ }
6205
+ // Process items in small batches so the first results appear quickly instead of
6206
+ // waiting for every file to resolve — critical when PDF thumbnail generation is
6207
+ // enabled, as each page render can take hundreds of milliseconds.
6208
+ const BATCH_SIZE = 10;
6209
+ for (let i = 0; i < items.length; i += BATCH_SIZE) {
6210
+ if (this.isDestroyed || requestId !== this.loadRequestId) {
6211
+ return;
6212
+ }
6213
+ const batch = items.slice(i, i + BATCH_SIZE);
6214
+ let batchResolved;
6215
+ try {
6216
+ const config = this.mergedConfig();
6217
+ batchResolved = await this.filePreviewService.resolveItems(batch, {
6218
+ generatePdfThumbnails: config.generatePdfThumbnails,
6219
+ generateDocxThumbnails: config.generateDocxThumbnails,
6220
+ });
6221
+ }
6222
+ catch (err) {
6223
+ console.error('[FilePreviewComponent.loadItems] Batch resolution failed:', err);
6224
+ if (requestId !== this.loadRequestId) {
6225
+ return;
6226
+ }
6227
+ // Retain partial results from previous batches and stop further processing.
6228
+ return;
6229
+ }
6230
+ if (this.isDestroyed || requestId !== this.loadRequestId) {
6231
+ return;
6232
+ }
6233
+ this.resolvedItems.update((current) => [...current, ...batchResolved]);
6234
+ this.collectItemUrls(batchResolved, keepUrls);
6235
+ this.filePreviewService.retainOnlyObjectUrls(keepUrls);
6236
+ }
6237
+ }
6238
+ collectItemUrls(items, keepUrls) {
6239
+ for (const item of items) {
6240
+ if (item.resolvedPreviewUrl) {
6241
+ keepUrls.add(item.resolvedPreviewUrl);
6242
+ }
6243
+ if (item.resolvedThumbnailUrl) {
6244
+ keepUrls.add(item.resolvedThumbnailUrl);
6245
+ }
6246
+ }
6247
+ }
6248
+ retainCurrentObjectUrls() {
6249
+ const keepUrls = new Set();
6250
+ this.collectItemUrls(this.resolvedItems(), keepUrls);
6251
+ this.filePreviewService.retainOnlyObjectUrls(keepUrls);
6252
+ }
6253
+ computeFileActionVisible(action) {
6254
+ const cfg = this.mergedConfig();
6255
+ if (!cfg.showActionIcons) {
6256
+ return false;
6257
+ }
6258
+ switch (action) {
6259
+ case 'previewAction':
6260
+ return cfg.showOverlayPreview && cfg.showPreviewAction;
6261
+ case 'downloadAction':
6262
+ return cfg.showDownloadAction;
6263
+ case 'deleteAction':
6264
+ return cfg.showDeleteAction;
6265
+ }
6266
+ }
6267
+ loadI18nLabels() {
6268
+ this.translate.get('components.file-preview').subscribe((translations) => {
6269
+ if (translations && typeof translations === 'object') {
6270
+ // Filter to keep only truthy string values
6271
+ const i18nLabels = Object.fromEntries(Object.entries(translations).filter(([, value]) => typeof value === 'string' && value.length > 0));
6272
+ this.i18nLabels.set(i18nLabels);
6273
+ }
6274
+ });
6275
+ }
6276
+ resolveSize(size) {
6277
+ if (typeof size === 'object') {
6278
+ return size;
6279
+ }
6280
+ return THUMBNAIL_SIZE_MAP[size] ?? THUMBNAIL_SIZE_MAP.md;
6281
+ }
6282
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: FilePreviewComponent, deps: [{ token: FilePreviewService }, { token: i1$5.MatDialog }, { token: i2$3.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
6283
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: FilePreviewComponent, isStandalone: true, selector: "mad-file-preview", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { previewOpened: "previewOpened", actionClicked: "actionClicked", deleteClicked: "deleteClicked" }, providers: [FilePreviewService], ngImport: i0, template: "<!-- =====================================================================\n material-file-preview \u2014 Material File Preview Library\n ===================================================================== -->\n\n<section class=\"fp-shell grid gap-4\" [attr.aria-label]=\"mergedLabels().galleryAriaLabel\">\n <section class=\"fp-container\">\n <!-- Empty state -->\n @if (resolvedItems().length === 0) {\n <div\n class=\"fp-empty flex flex-col items-center justify-center gap-3 py-6 px-4 text-sm leading-normal text-(--mat-sys-on-surface-variant) [@media(width<480px)]:gap-2 [@media(width<480px)]:py-5 [@media(width<480px)]:px-3 lg:py-8\"\n >\n <mat-icon\n class=\"fp-empty__icon text-[48px] w-12 h-12 opacity-40 shrink-0 [@media(width<480px)]:text-[40px] [@media(width<480px)]:w-10 [@media(width<480px)]:h-10 lg:text-[56px] lg:w-14 lg:h-14\"\n >folder_open</mat-icon\n >\n <span>{{ mergedLabels().emptyStateMessage }}</span>\n </div>\n }\n\n <!-- Thumbnail grid -->\n <ul\n class=\"fp-grid flex flex-wrap gap-4 p-4 m-0 list-none items-start [@media(width<480px)]:gap-3 [@media(width<480px)]:p-3 lg:gap-5 lg:p-5\"\n >\n @for (item of resolvedItems(); track item.id) {\n <li class=\"fp-item flex flex-col items-center gap-2\">\n <!-- \u2500\u2500 Thumbnail card \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <button\n class=\"fp-thumb relative border-[1.5px] border-(--mat-sys-outline-variant) rounded-lg flex items-center justify-center cursor-default bg-(--mat-sys-surface-container-lowest) p-0 overflow-hidden outline-none shrink-0 transition-[border-color,box-shadow] duration-[180ms] ease-in-out\"\n type=\"button\"\n data-cy=\"file-preview-thumbnail\"\n [style.width.px]=\"thumbnailDimensions().width\"\n [style.height.px]=\"thumbnailDimensions().height\"\n [attr.aria-label]=\"mergedLabels().thumbnailPreviewAriaPrefix + ' ' + item.name\"\n [attr.aria-disabled]=\"!mergedConfig().showOverlayPreview || null\"\n [class.fp-thumb--clickable]=\"mergedConfig().showOverlayPreview\"\n (click)=\"openPreview(item)\"\n >\n <!-- Generated / provided thumbnail image -->\n @if (item.resolvedThumbnailUrl) {\n <img\n class=\"fp-thumb__img w-full h-full block\"\n [src]=\"item.resolvedThumbnailUrl\"\n [alt]=\"item.name\"\n style=\"object-fit: cover\"\n loading=\"lazy\"\n />\n } @else {\n <!-- Fallback icon (pdf / docx / xlsx / unknown or when thumbnail unavailable) -->\n <div class=\"fp-thumb__icon flex items-center justify-center w-full h-full p-4 [@media(width<480px)]:p-3\">\n @switch (item.kind) {\n @case ('pdf') {\n <mat-icon class=\"fp-thumb__icon-svg text-(--fp-icon-color-pdf)\">picture_as_pdf</mat-icon>\n }\n @case ('docx') {\n <!-- DOCX thumbnail: render real scaled preview via component -->\n @if (item.source && mergedConfig().generateDocxThumbnails && !docxRenderErrors().has(item.id)) {\n @defer (on viewport) {\n <mad-docx-preview\n [source]=\"item.source\"\n [thumbnail]=\"true\"\n (renderFailed)=\"onDocxRenderFailed(item.id)\"\n ></mad-docx-preview>\n } @placeholder {\n <mat-icon class=\"fp-thumb__icon-svg text-(--fp-icon-color-docx)\">description</mat-icon>\n }\n } @else {\n <mat-icon class=\"fp-thumb__icon-svg text-(--fp-icon-color-docx)\">description</mat-icon>\n }\n }\n @case ('xlsx') {\n <mat-icon class=\"fp-thumb__icon-svg text-(--fp-icon-color-success)\">table_chart</mat-icon>\n }\n @case ('image') {\n <mat-icon class=\"fp-thumb__icon-svg text-(--fp-icon-color-success)\">image</mat-icon>\n }\n @default {\n <mat-icon class=\"fp-thumb__icon-svg\">insert_drive_file</mat-icon>\n }\n }\n </div>\n }\n\n <!-- Type badge chip -->\n <span\n class=\"fp-thumb__badge absolute bottom-2 right-2 py-1 px-2 rounded text-xs font-semibold tracking-[0.04em] uppercase leading-[1.4] bg-black/60 text-(--mat-sys-on-primary) pointer-events-none [@media(width<480px)]:bottom-1 [@media(width<480px)]:right-1 [@media(width<480px)]:p-1 [@media(width<480px)]:text-[9px]\"\n [attr.data-kind]=\"item.kind\"\n >\n {{ item.extension || item.kind }}\n </span>\n </button>\n\n <!-- \u2500\u2500 File name label \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <p\n class=\"fp-label m-0 text-[13px] leading-[1.3] whitespace-nowrap overflow-hidden text-ellipsis text-center text-(--mat-sys-on-surface) cursor-default max-w-full [@media(width<480px)]:text-[11px] [@media(width<480px)]:leading-[1.2] lg:text-sm\"\n [style.max-width.px]=\"thumbnailDimensions().width\"\n [matTooltip]=\"item.name\"\n matTooltipShowDelay=\"500\"\n >\n {{ item.name }}\n </p>\n\n <!-- \u2500\u2500 Action bar \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (hasVisibleActions()) {\n <div class=\"fp-actions flex gap-0 justify-center flex-wrap [@media(width<480px)]:gap-1\">\n <!-- Preview -->\n @if (isFileActionVisible('previewAction')) {\n <button\n mat-icon-button\n data-cy=\"file-preview-thumbnail-preview-action\"\n [matTooltip]=\"mergedLabels().previewActionLabel\"\n [attr.aria-label]=\"mergedLabels().previewActionLabel\"\n (click)=\"openPreview(item)\"\n >\n <mat-icon>visibility</mat-icon>\n </button>\n }\n\n <!-- Download -->\n @if (isFileActionVisible('downloadAction')) {\n <button\n mat-icon-button\n data-cy=\"file-preview-thumbnail-download-action\"\n [matTooltip]=\"mergedLabels().downloadActionLabel\"\n [attr.aria-label]=\"mergedLabels().downloadActionLabel\"\n (click)=\"download(item)\"\n >\n <mat-icon>download</mat-icon>\n </button>\n }\n\n <!-- Custom actions from config -->\n @for (action of visibleCustomActions(); track action.id) {\n <button\n mat-icon-button\n [attr.data-cy]=\"'file-preview-thumbnail-custom-action-' + action.id\"\n [matTooltip]=\"action.label\"\n [attr.aria-label]=\"action.label\"\n [color]=\"action.color ?? undefined\"\n (click)=\"triggerAction(action, item)\"\n >\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n }\n\n <!-- Delete -->\n @if (isFileActionVisible('deleteAction')) {\n <button\n mat-icon-button\n data-cy=\"file-preview-thumbnail-delete-action\"\n [matTooltip]=\"mergedLabels().deleteActionLabel\"\n [attr.aria-label]=\"mergedLabels().deleteActionLabel\"\n color=\"warn\"\n (click)=\"triggerDelete(item)\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n }\n </div>\n }\n <!-- /fp-actions -->\n </li>\n }\n <!-- /fp-item -->\n </ul>\n <!-- /fp-grid -->\n </section>\n</section>\n", styles: [":host{display:block;--fp-icon-color-pdf: #d32f2f;--fp-icon-color-docx: #1976d2;--fp-icon-color-success: #388e3c}:host .fp-thumb--clickable{cursor:pointer}:host .fp-thumb--clickable:hover,:host .fp-thumb--clickable:focus-visible{border-color:var(--mat-sys-primary, #1976d2);box-shadow:0 2px 8px var(--mat-sys-primary-container, rgba(25, 118, 210, .18))}:host .fp-thumb--clickable:active{box-shadow:0 1px 3px var(--mat-sys-primary-container, rgba(25, 118, 210, .25))}:host .fp-thumb--clickable:focus-visible{outline:2px solid var(--mat-sys-primary, #1976d2);outline-offset:2px}:host .fp-thumb ::ng-deep mad-docx-preview{width:100%;height:100%;overflow:hidden;display:block}:host .fp-thumb__icon-svg{font-size:52px;width:52px;height:52px;opacity:.65;flex-shrink:0}@media(width<480px){:host .fp-thumb__icon-svg{font-size:40px;width:40px;height:40px}}@media(width>=1024px){:host .fp-thumb__icon-svg{font-size:60px;width:60px;height:60px}}:host .fp-thumb__badge[data-kind=pdf]{background:color-mix(in srgb,var(--fp-icon-color-pdf) 85%,transparent)}:host .fp-thumb__badge[data-kind=docx]{background:color-mix(in srgb,var(--fp-icon-color-docx) 85%,transparent)}:host .fp-thumb__badge[data-kind=image],:host .fp-thumb__badge[data-kind=xlsx]{background:color-mix(in srgb,var(--fp-icon-color-success) 85%,transparent)}:host .fp-thumb__badge[data-kind=unknown]{background:#616161bf}:host .fp-actions .mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 36px;width:36px;height:36px}@media(width<480px){:host .fp-actions .mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 32px;width:32px;height:32px}}:host .fp-actions .mat-mdc-icon-button .mat-icon{font-size:18px;width:18px;height:18px;line-height:18px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [/* @ts-ignore */
6284
+ Promise.resolve().then(function () { return docxPreview_component; }).then(m => m.DocxPreviewComponent)]] }); }
6285
+ }
6286
+ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.1.4", ngImport: i0, type: FilePreviewComponent, resolveDeferredDeps: () => [/* @ts-ignore */
6287
+ Promise.resolve().then(function () { return docxPreview_component; }).then(m => m.DocxPreviewComponent)], resolveMetadata: DocxPreviewComponent => ({ decorators: [{
6288
+ type: Component,
6289
+ args: [{ selector: 'mad-file-preview', standalone: true, imports: [MatButtonModule, MatIconModule, MatTooltipModule, DocxPreviewComponent], providers: [FilePreviewService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- =====================================================================\n material-file-preview \u2014 Material File Preview Library\n ===================================================================== -->\n\n<section class=\"fp-shell grid gap-4\" [attr.aria-label]=\"mergedLabels().galleryAriaLabel\">\n <section class=\"fp-container\">\n <!-- Empty state -->\n @if (resolvedItems().length === 0) {\n <div\n class=\"fp-empty flex flex-col items-center justify-center gap-3 py-6 px-4 text-sm leading-normal text-(--mat-sys-on-surface-variant) [@media(width<480px)]:gap-2 [@media(width<480px)]:py-5 [@media(width<480px)]:px-3 lg:py-8\"\n >\n <mat-icon\n class=\"fp-empty__icon text-[48px] w-12 h-12 opacity-40 shrink-0 [@media(width<480px)]:text-[40px] [@media(width<480px)]:w-10 [@media(width<480px)]:h-10 lg:text-[56px] lg:w-14 lg:h-14\"\n >folder_open</mat-icon\n >\n <span>{{ mergedLabels().emptyStateMessage }}</span>\n </div>\n }\n\n <!-- Thumbnail grid -->\n <ul\n class=\"fp-grid flex flex-wrap gap-4 p-4 m-0 list-none items-start [@media(width<480px)]:gap-3 [@media(width<480px)]:p-3 lg:gap-5 lg:p-5\"\n >\n @for (item of resolvedItems(); track item.id) {\n <li class=\"fp-item flex flex-col items-center gap-2\">\n <!-- \u2500\u2500 Thumbnail card \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <button\n class=\"fp-thumb relative border-[1.5px] border-(--mat-sys-outline-variant) rounded-lg flex items-center justify-center cursor-default bg-(--mat-sys-surface-container-lowest) p-0 overflow-hidden outline-none shrink-0 transition-[border-color,box-shadow] duration-[180ms] ease-in-out\"\n type=\"button\"\n data-cy=\"file-preview-thumbnail\"\n [style.width.px]=\"thumbnailDimensions().width\"\n [style.height.px]=\"thumbnailDimensions().height\"\n [attr.aria-label]=\"mergedLabels().thumbnailPreviewAriaPrefix + ' ' + item.name\"\n [attr.aria-disabled]=\"!mergedConfig().showOverlayPreview || null\"\n [class.fp-thumb--clickable]=\"mergedConfig().showOverlayPreview\"\n (click)=\"openPreview(item)\"\n >\n <!-- Generated / provided thumbnail image -->\n @if (item.resolvedThumbnailUrl) {\n <img\n class=\"fp-thumb__img w-full h-full block\"\n [src]=\"item.resolvedThumbnailUrl\"\n [alt]=\"item.name\"\n style=\"object-fit: cover\"\n loading=\"lazy\"\n />\n } @else {\n <!-- Fallback icon (pdf / docx / xlsx / unknown or when thumbnail unavailable) -->\n <div class=\"fp-thumb__icon flex items-center justify-center w-full h-full p-4 [@media(width<480px)]:p-3\">\n @switch (item.kind) {\n @case ('pdf') {\n <mat-icon class=\"fp-thumb__icon-svg text-(--fp-icon-color-pdf)\">picture_as_pdf</mat-icon>\n }\n @case ('docx') {\n <!-- DOCX thumbnail: render real scaled preview via component -->\n @if (item.source && mergedConfig().generateDocxThumbnails && !docxRenderErrors().has(item.id)) {\n @defer (on viewport) {\n <mad-docx-preview\n [source]=\"item.source\"\n [thumbnail]=\"true\"\n (renderFailed)=\"onDocxRenderFailed(item.id)\"\n ></mad-docx-preview>\n } @placeholder {\n <mat-icon class=\"fp-thumb__icon-svg text-(--fp-icon-color-docx)\">description</mat-icon>\n }\n } @else {\n <mat-icon class=\"fp-thumb__icon-svg text-(--fp-icon-color-docx)\">description</mat-icon>\n }\n }\n @case ('xlsx') {\n <mat-icon class=\"fp-thumb__icon-svg text-(--fp-icon-color-success)\">table_chart</mat-icon>\n }\n @case ('image') {\n <mat-icon class=\"fp-thumb__icon-svg text-(--fp-icon-color-success)\">image</mat-icon>\n }\n @default {\n <mat-icon class=\"fp-thumb__icon-svg\">insert_drive_file</mat-icon>\n }\n }\n </div>\n }\n\n <!-- Type badge chip -->\n <span\n class=\"fp-thumb__badge absolute bottom-2 right-2 py-1 px-2 rounded text-xs font-semibold tracking-[0.04em] uppercase leading-[1.4] bg-black/60 text-(--mat-sys-on-primary) pointer-events-none [@media(width<480px)]:bottom-1 [@media(width<480px)]:right-1 [@media(width<480px)]:p-1 [@media(width<480px)]:text-[9px]\"\n [attr.data-kind]=\"item.kind\"\n >\n {{ item.extension || item.kind }}\n </span>\n </button>\n\n <!-- \u2500\u2500 File name label \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <p\n class=\"fp-label m-0 text-[13px] leading-[1.3] whitespace-nowrap overflow-hidden text-ellipsis text-center text-(--mat-sys-on-surface) cursor-default max-w-full [@media(width<480px)]:text-[11px] [@media(width<480px)]:leading-[1.2] lg:text-sm\"\n [style.max-width.px]=\"thumbnailDimensions().width\"\n [matTooltip]=\"item.name\"\n matTooltipShowDelay=\"500\"\n >\n {{ item.name }}\n </p>\n\n <!-- \u2500\u2500 Action bar \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (hasVisibleActions()) {\n <div class=\"fp-actions flex gap-0 justify-center flex-wrap [@media(width<480px)]:gap-1\">\n <!-- Preview -->\n @if (isFileActionVisible('previewAction')) {\n <button\n mat-icon-button\n data-cy=\"file-preview-thumbnail-preview-action\"\n [matTooltip]=\"mergedLabels().previewActionLabel\"\n [attr.aria-label]=\"mergedLabels().previewActionLabel\"\n (click)=\"openPreview(item)\"\n >\n <mat-icon>visibility</mat-icon>\n </button>\n }\n\n <!-- Download -->\n @if (isFileActionVisible('downloadAction')) {\n <button\n mat-icon-button\n data-cy=\"file-preview-thumbnail-download-action\"\n [matTooltip]=\"mergedLabels().downloadActionLabel\"\n [attr.aria-label]=\"mergedLabels().downloadActionLabel\"\n (click)=\"download(item)\"\n >\n <mat-icon>download</mat-icon>\n </button>\n }\n\n <!-- Custom actions from config -->\n @for (action of visibleCustomActions(); track action.id) {\n <button\n mat-icon-button\n [attr.data-cy]=\"'file-preview-thumbnail-custom-action-' + action.id\"\n [matTooltip]=\"action.label\"\n [attr.aria-label]=\"action.label\"\n [color]=\"action.color ?? undefined\"\n (click)=\"triggerAction(action, item)\"\n >\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n }\n\n <!-- Delete -->\n @if (isFileActionVisible('deleteAction')) {\n <button\n mat-icon-button\n data-cy=\"file-preview-thumbnail-delete-action\"\n [matTooltip]=\"mergedLabels().deleteActionLabel\"\n [attr.aria-label]=\"mergedLabels().deleteActionLabel\"\n color=\"warn\"\n (click)=\"triggerDelete(item)\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n }\n </div>\n }\n <!-- /fp-actions -->\n </li>\n }\n <!-- /fp-item -->\n </ul>\n <!-- /fp-grid -->\n </section>\n</section>\n", styles: [":host{display:block;--fp-icon-color-pdf: #d32f2f;--fp-icon-color-docx: #1976d2;--fp-icon-color-success: #388e3c}:host .fp-thumb--clickable{cursor:pointer}:host .fp-thumb--clickable:hover,:host .fp-thumb--clickable:focus-visible{border-color:var(--mat-sys-primary, #1976d2);box-shadow:0 2px 8px var(--mat-sys-primary-container, rgba(25, 118, 210, .18))}:host .fp-thumb--clickable:active{box-shadow:0 1px 3px var(--mat-sys-primary-container, rgba(25, 118, 210, .25))}:host .fp-thumb--clickable:focus-visible{outline:2px solid var(--mat-sys-primary, #1976d2);outline-offset:2px}:host .fp-thumb ::ng-deep mad-docx-preview{width:100%;height:100%;overflow:hidden;display:block}:host .fp-thumb__icon-svg{font-size:52px;width:52px;height:52px;opacity:.65;flex-shrink:0}@media(width<480px){:host .fp-thumb__icon-svg{font-size:40px;width:40px;height:40px}}@media(width>=1024px){:host .fp-thumb__icon-svg{font-size:60px;width:60px;height:60px}}:host .fp-thumb__badge[data-kind=pdf]{background:color-mix(in srgb,var(--fp-icon-color-pdf) 85%,transparent)}:host .fp-thumb__badge[data-kind=docx]{background:color-mix(in srgb,var(--fp-icon-color-docx) 85%,transparent)}:host .fp-thumb__badge[data-kind=image],:host .fp-thumb__badge[data-kind=xlsx]{background:color-mix(in srgb,var(--fp-icon-color-success) 85%,transparent)}:host .fp-thumb__badge[data-kind=unknown]{background:#616161bf}:host .fp-actions .mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 36px;width:36px;height:36px}@media(width<480px){:host .fp-actions .mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 32px;width:32px;height:32px}}:host .fp-actions .mat-mdc-icon-button .mat-icon{font-size:18px;width:18px;height:18px;line-height:18px}\n"] }]
6290
+ }], ctorParameters: () => [{ type: FilePreviewService }, { type: i1$5.MatDialog }, { type: i2$3.TranslateService }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], previewOpened: [{ type: i0.Output, args: ["previewOpened"] }], actionClicked: [{ type: i0.Output, args: ["actionClicked"] }], deleteClicked: [{ type: i0.Output, args: ["deleteClicked"] }] } }) });
6291
+
6292
+ class MaterialFilePreviewModule {
6293
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MaterialFilePreviewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
6294
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: MaterialFilePreviewModule, imports: [FilePreviewComponent], exports: [FilePreviewComponent] }); }
6295
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MaterialFilePreviewModule, imports: [FilePreviewComponent] }); }
6296
+ }
6297
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MaterialFilePreviewModule, decorators: [{
6298
+ type: NgModule,
6299
+ args: [{
6300
+ imports: [FilePreviewComponent],
6301
+ exports: [FilePreviewComponent],
6302
+ }]
6303
+ }] });
4564
6304
 
4565
6305
  /*
4566
6306
  * Public API Surface of material-addons
@@ -4570,5 +6310,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
4570
6310
  * Generated bundle index. Do not edit.
4571
6311
  */
4572
6312
 
4573
- export { AlertComponent, BaseQuickListComponent, BreadcrumbComponent, ButtonModule, CardComponent, CardModule, CarouselComponent, CarouselShortTextDirective, CarouselSlideDirective, ContentHeaderComponent, ContentPanelContainerComponent, ContentPanelContainerContentComponent, ContentPanelContainerFooterComponent, ContentPanelContainerSidebarComponent, ContentPanelModule, DangerButtonComponent, DataTableActionType, DataTableColumnsModalComponent, DataTableComponent, DataTablePersistenceService, DataTableTemplateCellDefinition, DataTableTemplateColumnDefinition, DataTableTemplateExpandableCellDefinition, DataTableTemplateExpandableColumnDefinition, FileUploadComponent, FlowbarComponent, FlowbarModule, IconButtonComponent, LinkButtonComponent, MAD_ALERT_DEFAULT_CONFIGURATION, MAD_ALERT_DEFAULT_CONFIGURATION_FACTORY, MAD_DATA_TABLE_GLOBAL_CONFIGURATION, MAD_DATA_TABLE_PERSISTENCE_SERVICE, MAD_READONLY_FORM_FIELD_DEFAULT_CONFIGURATION, MadBasicButton, MadButtonDirective, MadButtonGroupComponent, MainContainerComponent, MaterialActionButtonComponent, MaterialActionButtonModule, MaterialAddonsModule, NumberFormatService, NumericFieldDirective, NumericFieldModule, OutlineButtonComponent, PrimaryButtonComponent, QuickListCompactComponent, QuickListComponent, QuickListModule, ReactiveFormQuickListCompactComponent, ReactiveFormQuickListComponent, ReadOnlyFormFieldComponent, ReadOnlyFormFieldModule, ReadOnlyFormFieldWrapperComponent, SidebarComponent, SidebarItemComponent, SidebarLayoutComponent, SidebarModule, StepComponent, StepHeaderComponent, StepperComponent, StepperModule, TableComponent, TableModule, ThrottleClickDirective, ThrottleClickModule, TileComponent, ToolbarComponent, ToolbarModule, ToolbarService, VERSION, madStepperAnimations };
6313
+ export { AlertComponent, BaseQuickListComponent, BreadcrumbComponent, ButtonModule, CardComponent, CardModule, CarouselComponent, CarouselShortTextDirective, CarouselSlideDirective, ContentHeaderComponent, ContentPanelContainerComponent, ContentPanelContainerContentComponent, ContentPanelContainerFooterComponent, ContentPanelContainerSidebarComponent, ContentPanelModule, DEFAULT_FILE_PREVIEW_CONFIG, DEFAULT_FILE_PREVIEW_LABELS, DangerButtonComponent, DataTableActionType, DataTableColumnsModalComponent, DataTableComponent, DataTablePersistenceService, DataTableTemplateCellDefinition, DataTableTemplateColumnDefinition, DataTableTemplateExpandableCellDefinition, DataTableTemplateExpandableColumnDefinition, FilePreviewComponent, FilePreviewDialogComponent, FilePreviewService, FileUploadComponent, FlowbarComponent, FlowbarModule, IconButtonComponent, LinkButtonComponent, MAD_ALERT_DEFAULT_CONFIGURATION, MAD_ALERT_DEFAULT_CONFIGURATION_FACTORY, MAD_DATA_TABLE_GLOBAL_CONFIGURATION, MAD_DATA_TABLE_PERSISTENCE_SERVICE, MAD_READONLY_FORM_FIELD_DEFAULT_CONFIGURATION, MadBasicButton, MadButtonDirective, MadButtonGroupComponent, MainContainerComponent, MaterialActionButtonComponent, MaterialActionButtonModule, MaterialAddonsModule, MaterialFilePreviewModule, NumberFormatService, NumericFieldDirective, NumericFieldModule, OutlineButtonComponent, PDF_WORKER_SRC, PrimaryButtonComponent, QuickListCompactComponent, QuickListComponent, QuickListModule, ReactiveFormQuickListCompactComponent, ReactiveFormQuickListComponent, ReadOnlyFormFieldComponent, ReadOnlyFormFieldModule, ReadOnlyFormFieldWrapperComponent, SidebarComponent, SidebarItemComponent, SidebarLayoutComponent, SidebarModule, StepComponent, StepHeaderComponent, StepperComponent, StepperModule, THUMBNAIL_SIZE_MAP, TableComponent, TableModule, ThrottleClickDirective, ThrottleClickModule, TileComponent, ToolbarComponent, ToolbarModule, ToolbarService, VERSION, madStepperAnimations };
4574
6314
  //# sourceMappingURL=porscheinformatik-material-addons.mjs.map