@3kles/kles-material-table-v2 22.0.0 → 22.1.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,7 +1,7 @@
1
1
  import * as i18 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { Pipe, InjectionToken, Injectable, computed, Inject, input, HostBinding, Directive, inject, signal, DestroyRef, Component, ChangeDetectorRef, ChangeDetectionStrategy, Optional, EventEmitter, Injector, ViewChildren, ViewChild, effect, ElementRef, contentChild, Output, NgModule } from '@angular/core';
4
+ import { Pipe, InjectionToken, Injectable, computed, Inject, input, HostBinding, Directive, signal, inject, Optional, DestroyRef, Component, output, ChangeDetectorRef, ChangeDetectionStrategy, ElementRef, HostListener, Input, EventEmitter, Injector, ViewChildren, ViewChild, effect, contentChild, Output, NgModule } from '@angular/core';
5
5
  import * as i19 from '@angular/forms';
6
6
  import { FormControl, FormGroup, FormArray, ReactiveFormsModule } from '@angular/forms';
7
7
  import * as i2 from '@angular/material/button';
@@ -94,6 +94,7 @@ const FOOTER = new InjectionToken('FOOTER');
94
94
  const EXTRA_ROWS = new InjectionToken('EXTRA_ROWS');
95
95
  const MULTI_UNFOLD = new InjectionToken('MULTI_UNFOLD');
96
96
  const ROW_APPEARANCE_CONFIG = new InjectionToken('ROW_APPEARANCE_CONFIG');
97
+ const ROW_VALIDATION_CONFIG = new InjectionToken('ROW_VALIDATION_CONFIG');
97
98
  const ROW_DRAG_DROP = new InjectionToken('ROW_DRAG_DROP');
98
99
  const COLUMN_DRAG_DROP = new InjectionToken('COLUMN_DRAG_DROP');
99
100
  const DRAG_DROP_CONFIG = new InjectionToken('DRAG_DROP_CONFIG');
@@ -110,6 +111,7 @@ const SORT_SERVICE = new InjectionToken('SORT_SERVICE');
110
111
  const SCROLLBAR_ORCHESTRATOR_SERVICE = new InjectionToken('SCROLLBAR_ORCHESTRATOR_SERVICE');
111
112
  const TABLE_SERVICE = new InjectionToken('TABLE_SERVICE');
112
113
  const EMPTY_STATE_CONFIG = new InjectionToken('EMPTY_STATE_CONFIG');
114
+ const KEYBOARD_NAVIGATION_CONFIG = new InjectionToken('KEYBOARD_NAVIGATION_CONFIG');
113
115
 
114
116
  class ResolveNgStylePipe {
115
117
  transform(style, value, status, row, rowStatus) {
@@ -649,6 +651,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
649
651
  args: ['attr.appResizableColumn']
650
652
  }] } });
651
653
 
654
+ class CursorService {
655
+ constructor(selectionService) {
656
+ this.selectionService = selectionService;
657
+ this._mode = signal('auto', /* @ts-ignore */
658
+ ...(ngDevMode ? [{ debugName: "_mode" }] : /* istanbul ignore next */ []));
659
+ this.mode = this._mode.asReadonly();
660
+ }
661
+ enable() {
662
+ this._mode.set('pointer');
663
+ }
664
+ disable() {
665
+ this._mode.set('default');
666
+ }
667
+ reset() {
668
+ this._mode.set('auto');
669
+ }
670
+ isPointer(row) {
671
+ const mode = this.mode();
672
+ return mode === 'pointer' || (mode === 'auto' && this.selectionService.canSelectOnRowClick(row));
673
+ }
674
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CursorService, deps: [{ token: SELECTION_SERVICE }], target: i0.ɵɵFactoryTarget.Injectable }); }
675
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CursorService }); }
676
+ }
677
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CursorService, decorators: [{
678
+ type: Injectable
679
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
680
+ type: Inject,
681
+ args: [SELECTION_SERVICE]
682
+ }] }] });
683
+
652
684
  class FooterFieldPipe {
653
685
  transform(col) {
654
686
  if (!col)
@@ -814,6 +846,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
814
846
  }] }] });
815
847
 
816
848
  class RowFormFactory {
849
+ constructor(validationConfig = null) {
850
+ this.validationConfig = validationConfig;
851
+ }
817
852
  createControl(field, value) {
818
853
  let control;
819
854
  let ui;
@@ -844,7 +879,10 @@ class RowFormFactory {
844
879
  uis[field.name] = ui;
845
880
  }
846
881
  return {
847
- formGroup: new FormGroup(controls),
882
+ formGroup: new FormGroup(controls, {
883
+ validators: this.validationConfig?.lineValidations,
884
+ asyncValidators: this.validationConfig?.lineAsyncValidations,
885
+ }),
848
886
  groupUi: new GroupUiState(uis),
849
887
  context: {
850
888
  source: record,
@@ -856,13 +894,18 @@ class RowFormFactory {
856
894
  createRows(fields, records, meta = { depth: 0, parentId: null }) {
857
895
  return records.map((r) => this.createRow(fields, r, meta));
858
896
  }
859
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RowFormFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
897
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RowFormFactory, deps: [{ token: ROW_VALIDATION_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
860
898
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RowFormFactory, providedIn: 'root' }); }
861
899
  }
862
900
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RowFormFactory, decorators: [{
863
901
  type: Injectable,
864
902
  args: [{ providedIn: 'root' }]
865
- }] });
903
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
904
+ type: Optional
905
+ }, {
906
+ type: Inject,
907
+ args: [ROW_VALIDATION_CONFIG]
908
+ }] }] });
866
909
 
867
910
  class RowContextStore {
868
911
  constructor() {
@@ -1600,6 +1643,8 @@ class KlesTableIntl {
1600
1643
  this.changes = new Subject();
1601
1644
  this.emptyStateTitle = 'No data';
1602
1645
  this.emptyStateDescription = 'There are no rows to display.';
1646
+ this.emptyStateRefreshLabel = 'Refresh';
1647
+ this.keyboardNavigationEntryLabel = 'Go to table rows';
1603
1648
  }
1604
1649
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: KlesTableIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1605
1650
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: KlesTableIntl, providedIn: 'root' }); }
@@ -1613,6 +1658,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
1613
1658
 
1614
1659
  class KlesTableEmptyStateComponent {
1615
1660
  constructor() {
1661
+ this.refreshRequested = output();
1616
1662
  this.intl = inject(KlesTableIntl);
1617
1663
  this.changeDetectorRef = inject(ChangeDetectorRef);
1618
1664
  this.destroyRef = inject(DestroyRef);
@@ -1621,12 +1667,12 @@ class KlesTableEmptyStateComponent {
1621
1667
  });
1622
1668
  }
1623
1669
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: KlesTableEmptyStateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1624
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: KlesTableEmptyStateComponent, isStandalone: true, selector: "kles-table-empty-state", ngImport: i0, template: "<section class=\"empty-state\" role=\"status\" aria-live=\"polite\">\n <div class=\"empty-state__panel\">\n <div class=\"empty-state__visual\" aria-hidden=\"true\">\n <div class=\"empty-state__table-icon\">\n <span class=\"empty-state__table-header\"></span>\n <span></span>\n <span></span>\n <span></span>\n </div>\n\n <div class=\"empty-state__badge\">\n <mat-icon>remove</mat-icon>\n </div>\n </div>\n\n <div class=\"empty-state__content\">\n <h2 class=\"empty-state__title\">\n {{ intl.emptyStateTitle }}\n </h2>\n\n <p class=\"empty-state__description\">\n {{ intl.emptyStateDescription }}\n </p>\n </div>\n </div>\n</section>\n", styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;--kles-empty-state-accent: var(--mat-sys-primary);--kles-empty-state-accent-container: var(--mat-sys-primary-container)}.empty-state{display:grid;width:100%;height:100%;box-sizing:border-box;place-items:center}.empty-state__panel{display:flex;width:min(100%,31rem);align-items:center;justify-content:center;gap:1.25rem;color:var(--mat-sys-on-surface-variant)}.empty-state__visual{position:relative;display:grid;width:4.5rem;height:4.5rem;flex:0 0 4.5rem;place-items:center;border-radius:1.25rem;background:color-mix(in srgb,var(--kles-empty-state-accent-container) 72%,var(--mat-sys-surface))}.empty-state__table-icon{display:grid;width:2.35rem;height:2.15rem;overflow:hidden;box-sizing:border-box;grid-template-rows:.65rem repeat(3,1fr);border:.125rem solid var(--kles-empty-state-accent);border-radius:.35rem}.empty-state__table-icon span{border-top:1px solid color-mix(in srgb,var(--kles-empty-state-accent) 45%,transparent)}.empty-state__table-icon .empty-state__table-header{border-top:0;background:color-mix(in srgb,var(--kles-empty-state-accent) 24%,transparent)}.empty-state__badge{position:absolute;right:-.2rem;bottom:-.2rem;display:grid;width:1.65rem;height:1.65rem;place-items:center;border:.2rem solid var(--mat-sys-surface);border-radius:50%;color:var(--mat-sys-on-primary);background:var(--kles-empty-state-accent)}.empty-state__badge mat-icon{width:1rem;height:1rem;font-size:1rem;font-weight:700}.empty-state__content{display:grid;max-width:25rem;gap:.3rem;text-align:left}.empty-state__title{margin:0;color:var(--mat-sys-on-surface);font:var(--mat-sys-title-medium)}.empty-state__description{margin:0;font:var(--mat-sys-body-medium);line-height:1.45;text-wrap:balance}@media(max-width:37.5rem){.empty-state__panel{flex-direction:column;gap:.875rem;padding:1.25rem;text-align:center}.empty-state__content{text-align:center}}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1670
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: KlesTableEmptyStateComponent, isStandalone: true, selector: "kles-table-empty-state", outputs: { refreshRequested: "refreshRequested" }, ngImport: i0, template: "<section class=\"empty-state\" role=\"status\" aria-live=\"polite\">\n <div class=\"empty-state__panel\">\n <div class=\"empty-state__visual\" aria-hidden=\"true\">\n <div class=\"empty-state__table-icon\">\n <span class=\"empty-state__table-header\"></span>\n <span></span>\n <span></span>\n <span></span>\n </div>\n\n <div class=\"empty-state__badge\">\n <mat-icon>remove</mat-icon>\n </div>\n </div>\n\n <div class=\"empty-state__content\">\n <h2 class=\"empty-state__title\">\n {{ intl.emptyStateTitle }}\n </h2>\n\n <p class=\"empty-state__description\">\n {{ intl.emptyStateDescription }}\n </p>\n <button mat-stroked-button type=\"button\" class=\"empty-state__refresh\" (click)=\"refreshRequested.emit()\">\n <mat-icon>refresh</mat-icon>\n {{ intl.emptyStateRefreshLabel }}\n </button>\n </div>\n </div>\n</section>\n", styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;--kles-empty-state-accent: var(--mat-sys-primary);--kles-empty-state-accent-container: var(--mat-sys-primary-container)}.empty-state{display:grid;width:100%;height:100%;box-sizing:border-box;place-items:center}.empty-state__panel{display:flex;width:min(100%,31rem);align-items:center;justify-content:center;gap:1.25rem;color:var(--mat-sys-on-surface-variant)}.empty-state__visual{position:relative;display:grid;width:4.5rem;height:4.5rem;flex:0 0 4.5rem;place-items:center;border-radius:1.25rem;background:color-mix(in srgb,var(--kles-empty-state-accent-container) 72%,var(--mat-sys-surface))}.empty-state__table-icon{display:grid;width:2.35rem;height:2.15rem;overflow:hidden;box-sizing:border-box;grid-template-rows:.65rem repeat(3,1fr);border:.125rem solid var(--kles-empty-state-accent);border-radius:.35rem}.empty-state__table-icon span{border-top:1px solid color-mix(in srgb,var(--kles-empty-state-accent) 45%,transparent)}.empty-state__table-icon .empty-state__table-header{border-top:0;background:color-mix(in srgb,var(--kles-empty-state-accent) 24%,transparent)}.empty-state__badge{position:absolute;right:-.2rem;bottom:-.2rem;display:grid;width:1.65rem;height:1.65rem;place-items:center;border:.2rem solid var(--mat-sys-surface);border-radius:50%;color:var(--mat-sys-on-primary);background:var(--kles-empty-state-accent)}.empty-state__badge mat-icon{width:1rem;height:1rem;font-size:1rem;font-weight:700}.empty-state__content{display:grid;min-width:0;max-width:25rem;gap:.3rem;text-align:left}.empty-state__title{margin:0;color:var(--mat-sys-on-surface);font:var(--mat-sys-title-medium)}.empty-state__description{margin:0;font:var(--mat-sys-body-medium);line-height:1.45;text-wrap:balance;overflow-wrap:anywhere}.empty-state__refresh{justify-self:start}@media(max-width:37.5rem){.empty-state__panel{flex-direction:column;gap:.875rem;padding:1.25rem;text-align:center}.empty-state__content{text-align:center}.empty-state__refresh{justify-self:center}}@container kles-empty-state (max-width: 37.5rem){.empty-state__visual{width:3rem;height:3rem;flex-basis:3rem;border-radius:.875rem}.empty-state__table-icon{width:1.75rem;height:1.6rem;grid-template-rows:.45rem repeat(3,1fr)}.empty-state__badge{width:1.25rem;height:1.25rem;border-width:.15rem}.empty-state__panel{flex-direction:column;gap:.25rem;padding:0}.empty-state__content{text-align:center}.empty-state__refresh{justify-self:center}}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1625
1671
  }
1626
1672
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: KlesTableEmptyStateComponent, decorators: [{
1627
1673
  type: Component,
1628
- args: [{ selector: 'kles-table-empty-state', standalone: true, imports: [MatIconModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<section class=\"empty-state\" role=\"status\" aria-live=\"polite\">\n <div class=\"empty-state__panel\">\n <div class=\"empty-state__visual\" aria-hidden=\"true\">\n <div class=\"empty-state__table-icon\">\n <span class=\"empty-state__table-header\"></span>\n <span></span>\n <span></span>\n <span></span>\n </div>\n\n <div class=\"empty-state__badge\">\n <mat-icon>remove</mat-icon>\n </div>\n </div>\n\n <div class=\"empty-state__content\">\n <h2 class=\"empty-state__title\">\n {{ intl.emptyStateTitle }}\n </h2>\n\n <p class=\"empty-state__description\">\n {{ intl.emptyStateDescription }}\n </p>\n </div>\n </div>\n</section>\n", styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;--kles-empty-state-accent: var(--mat-sys-primary);--kles-empty-state-accent-container: var(--mat-sys-primary-container)}.empty-state{display:grid;width:100%;height:100%;box-sizing:border-box;place-items:center}.empty-state__panel{display:flex;width:min(100%,31rem);align-items:center;justify-content:center;gap:1.25rem;color:var(--mat-sys-on-surface-variant)}.empty-state__visual{position:relative;display:grid;width:4.5rem;height:4.5rem;flex:0 0 4.5rem;place-items:center;border-radius:1.25rem;background:color-mix(in srgb,var(--kles-empty-state-accent-container) 72%,var(--mat-sys-surface))}.empty-state__table-icon{display:grid;width:2.35rem;height:2.15rem;overflow:hidden;box-sizing:border-box;grid-template-rows:.65rem repeat(3,1fr);border:.125rem solid var(--kles-empty-state-accent);border-radius:.35rem}.empty-state__table-icon span{border-top:1px solid color-mix(in srgb,var(--kles-empty-state-accent) 45%,transparent)}.empty-state__table-icon .empty-state__table-header{border-top:0;background:color-mix(in srgb,var(--kles-empty-state-accent) 24%,transparent)}.empty-state__badge{position:absolute;right:-.2rem;bottom:-.2rem;display:grid;width:1.65rem;height:1.65rem;place-items:center;border:.2rem solid var(--mat-sys-surface);border-radius:50%;color:var(--mat-sys-on-primary);background:var(--kles-empty-state-accent)}.empty-state__badge mat-icon{width:1rem;height:1rem;font-size:1rem;font-weight:700}.empty-state__content{display:grid;max-width:25rem;gap:.3rem;text-align:left}.empty-state__title{margin:0;color:var(--mat-sys-on-surface);font:var(--mat-sys-title-medium)}.empty-state__description{margin:0;font:var(--mat-sys-body-medium);line-height:1.45;text-wrap:balance}@media(max-width:37.5rem){.empty-state__panel{flex-direction:column;gap:.875rem;padding:1.25rem;text-align:center}.empty-state__content{text-align:center}}\n"] }]
1629
- }], ctorParameters: () => [] });
1674
+ args: [{ selector: 'kles-table-empty-state', standalone: true, imports: [MatIconModule, MatButtonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<section class=\"empty-state\" role=\"status\" aria-live=\"polite\">\n <div class=\"empty-state__panel\">\n <div class=\"empty-state__visual\" aria-hidden=\"true\">\n <div class=\"empty-state__table-icon\">\n <span class=\"empty-state__table-header\"></span>\n <span></span>\n <span></span>\n <span></span>\n </div>\n\n <div class=\"empty-state__badge\">\n <mat-icon>remove</mat-icon>\n </div>\n </div>\n\n <div class=\"empty-state__content\">\n <h2 class=\"empty-state__title\">\n {{ intl.emptyStateTitle }}\n </h2>\n\n <p class=\"empty-state__description\">\n {{ intl.emptyStateDescription }}\n </p>\n <button mat-stroked-button type=\"button\" class=\"empty-state__refresh\" (click)=\"refreshRequested.emit()\">\n <mat-icon>refresh</mat-icon>\n {{ intl.emptyStateRefreshLabel }}\n </button>\n </div>\n </div>\n</section>\n", styles: [":host{display:block;width:100%;height:100%;box-sizing:border-box;--kles-empty-state-accent: var(--mat-sys-primary);--kles-empty-state-accent-container: var(--mat-sys-primary-container)}.empty-state{display:grid;width:100%;height:100%;box-sizing:border-box;place-items:center}.empty-state__panel{display:flex;width:min(100%,31rem);align-items:center;justify-content:center;gap:1.25rem;color:var(--mat-sys-on-surface-variant)}.empty-state__visual{position:relative;display:grid;width:4.5rem;height:4.5rem;flex:0 0 4.5rem;place-items:center;border-radius:1.25rem;background:color-mix(in srgb,var(--kles-empty-state-accent-container) 72%,var(--mat-sys-surface))}.empty-state__table-icon{display:grid;width:2.35rem;height:2.15rem;overflow:hidden;box-sizing:border-box;grid-template-rows:.65rem repeat(3,1fr);border:.125rem solid var(--kles-empty-state-accent);border-radius:.35rem}.empty-state__table-icon span{border-top:1px solid color-mix(in srgb,var(--kles-empty-state-accent) 45%,transparent)}.empty-state__table-icon .empty-state__table-header{border-top:0;background:color-mix(in srgb,var(--kles-empty-state-accent) 24%,transparent)}.empty-state__badge{position:absolute;right:-.2rem;bottom:-.2rem;display:grid;width:1.65rem;height:1.65rem;place-items:center;border:.2rem solid var(--mat-sys-surface);border-radius:50%;color:var(--mat-sys-on-primary);background:var(--kles-empty-state-accent)}.empty-state__badge mat-icon{width:1rem;height:1rem;font-size:1rem;font-weight:700}.empty-state__content{display:grid;min-width:0;max-width:25rem;gap:.3rem;text-align:left}.empty-state__title{margin:0;color:var(--mat-sys-on-surface);font:var(--mat-sys-title-medium)}.empty-state__description{margin:0;font:var(--mat-sys-body-medium);line-height:1.45;text-wrap:balance;overflow-wrap:anywhere}.empty-state__refresh{justify-self:start}@media(max-width:37.5rem){.empty-state__panel{flex-direction:column;gap:.875rem;padding:1.25rem;text-align:center}.empty-state__content{text-align:center}.empty-state__refresh{justify-self:center}}@container kles-empty-state (max-width: 37.5rem){.empty-state__visual{width:3rem;height:3rem;flex-basis:3rem;border-radius:.875rem}.empty-state__table-icon{width:1.75rem;height:1.6rem;grid-template-rows:.45rem repeat(3,1fr)}.empty-state__badge{width:1.25rem;height:1.25rem;border-width:.15rem}.empty-state__panel{flex-direction:column;gap:.25rem;padding:0}.empty-state__content{text-align:center}.empty-state__refresh{justify-self:center}}\n"] }]
1675
+ }], ctorParameters: () => [], propDecorators: { refreshRequested: [{ type: i0.Output, args: ["refreshRequested"] }] } });
1630
1676
 
1631
1677
  class RowContextPipe {
1632
1678
  constructor() {
@@ -1647,6 +1693,339 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
1647
1693
  }]
1648
1694
  }] });
1649
1695
 
1696
+ const interactiveSelector = 'input, textarea, select, button, a[href], [tabindex], [contenteditable]:not([contenteditable="false"])';
1697
+ /** One instance per rendered grid, including nested tables. */
1698
+ class KeyboardNavigationService {
1699
+ constructor(config, selection) {
1700
+ this.config = config;
1701
+ this.selection = selection;
1702
+ this.registered = new Set();
1703
+ this.cells = [];
1704
+ this.editing = false;
1705
+ this.focusOwned = false;
1706
+ this.originalTabIndexes = new Map();
1707
+ }
1708
+ get enabled() { return this.config?.enabled === true; }
1709
+ get ariaLabel() { return this.config?.ariaLabel; }
1710
+ register(cell) { this.registered.add(cell); }
1711
+ unregister(cell) { this.registered.delete(cell); }
1712
+ focusActive() {
1713
+ if (!this.enabled)
1714
+ return false;
1715
+ this.reconcile();
1716
+ if (!this.active)
1717
+ return false;
1718
+ this.focus(this.active);
1719
+ return true;
1720
+ }
1721
+ click(cell, event) {
1722
+ if (!this.enabled || event.defaultPrevented || !this.ownsEvent(cell, event))
1723
+ return;
1724
+ const target = event.target;
1725
+ // Preserve native field focus, action buttons and links, including custom widgets.
1726
+ if (target !== cell.element && target.closest('input, textarea, select, button, a, [role="button"], [role="checkbox"], [role="combobox"], [role="link"], [contenteditable]:not([contenteditable="false"]), [tabindex]') !== cell.element)
1727
+ return;
1728
+ this.focus(cell);
1729
+ }
1730
+ /** Runs after Angular has rendered rows, reordered columns and updated controls. */
1731
+ reconcile() {
1732
+ if (!this.enabled)
1733
+ return;
1734
+ const previous = this.active;
1735
+ const previousIndex = previous ? this.cells.indexOf(previous) : 0;
1736
+ this.cells = [...this.registered].filter(cell => cell.element.isConnected).sort((a, b) => a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1);
1737
+ const next = this.cells.find(cell => this.identity &&
1738
+ cell.row.get('_id')?.value === this.identity.rowId && cell.columnDef === this.identity.columnDef)
1739
+ ?? this.cells.find(cell => this.identity && cell.row.get('_id')?.value === this.identity.rowId)
1740
+ ?? this.cells[Math.max(0, Math.min(previousIndex, this.cells.length - 1))];
1741
+ const focused = previous?.element.ownerDocument.activeElement;
1742
+ if (focused && focused !== focused.ownerDocument.body &&
1743
+ !this.cells.some(cell => cell.element === focused || cell.element.contains(focused))) {
1744
+ this.focusOwned = false;
1745
+ }
1746
+ if (next !== previous) {
1747
+ this.editing = false;
1748
+ this.activate(next);
1749
+ }
1750
+ this.updateTabStops();
1751
+ if (next && previous && this.focusOwned &&
1752
+ (next !== previous || !next.element.contains(next.element.ownerDocument.activeElement)))
1753
+ this.focus(next);
1754
+ }
1755
+ focusIn(cell, event) {
1756
+ if (!this.enabled || !this.ownsEvent(cell, event))
1757
+ return;
1758
+ this.focusOwned = true;
1759
+ this.activate(cell);
1760
+ this.editing = event.target !== cell.element;
1761
+ this.updateTabStops();
1762
+ }
1763
+ focusOut(event) {
1764
+ if (event.relatedTarget instanceof Node &&
1765
+ !this.cells.some(cell => cell.element.contains(event.relatedTarget))) {
1766
+ this.focusOwned = false;
1767
+ }
1768
+ else if (!event.relatedTarget && event.target?.isConnected) {
1769
+ // Browsers also emit a null destination while Angular removes or moves a focused node.
1770
+ // Wait until rendering is finished to distinguish removal from an intentional blur.
1771
+ const target = event.target;
1772
+ queueMicrotask(() => {
1773
+ if (target.isConnected && !this.cells.some(cell => cell.element.contains(target.ownerDocument.activeElement))) {
1774
+ this.focusOwned = false;
1775
+ }
1776
+ });
1777
+ }
1778
+ }
1779
+ keyDown(cell, event) {
1780
+ if (!this.enabled || event.defaultPrevented || event.isComposing || event.altKey || event.ctrlKey || event.metaKey ||
1781
+ !this.ownsEvent(cell, event))
1782
+ return;
1783
+ this.activate(cell);
1784
+ if (event.target !== cell.element) {
1785
+ // Let the field own arrows, selection shortcuts, multiline input and open popups.
1786
+ const target = event.target;
1787
+ const popupOpen = target.closest('[aria-expanded="true"]') !== null;
1788
+ const simpleInput = target instanceof HTMLInputElement &&
1789
+ ['text', 'search', 'email', 'tel', 'url', 'password', 'number'].includes(target.type) &&
1790
+ target.getAttribute('role') !== 'combobox';
1791
+ if (event.key === 'Tab') {
1792
+ const controls = this.availableControls(cell).filter(element => element.tabIndex >= 0);
1793
+ const index = controls.indexOf(target);
1794
+ if (index >= 0 && (event.shiftKey ? index > 0 : index < controls.length - 1))
1795
+ return;
1796
+ this.editing = false;
1797
+ this.focus(cell); // Native Tab now leaves this single grid tab stop.
1798
+ }
1799
+ else if (!popupOpen && (event.key === 'Escape' ||
1800
+ (event.key === 'Enter' && simpleInput))) {
1801
+ event.preventDefault();
1802
+ event.stopPropagation();
1803
+ this.editing = false;
1804
+ this.focus(cell);
1805
+ }
1806
+ return;
1807
+ }
1808
+ let destination;
1809
+ const rowCells = this.cells.filter(current => current.row === cell.row);
1810
+ const columnCells = this.cells.filter(current => current.columnDef === cell.columnDef);
1811
+ switch (event.key) {
1812
+ case 'ArrowLeft':
1813
+ destination = rowCells[rowCells.indexOf(cell) - 1];
1814
+ break;
1815
+ case 'ArrowRight':
1816
+ destination = rowCells[rowCells.indexOf(cell) + 1];
1817
+ break;
1818
+ case 'ArrowUp':
1819
+ destination = columnCells[columnCells.indexOf(cell) - 1];
1820
+ break;
1821
+ case 'ArrowDown':
1822
+ destination = columnCells[columnCells.indexOf(cell) + 1];
1823
+ break;
1824
+ case 'Home':
1825
+ destination = rowCells[0];
1826
+ break;
1827
+ case 'End':
1828
+ destination = rowCells.at(-1);
1829
+ break;
1830
+ case 'Enter':
1831
+ case 'F2':
1832
+ this.enterEdit(cell);
1833
+ break;
1834
+ case ' ':
1835
+ if (!event.repeat && this.selection?.canSelectRow(cell.row))
1836
+ this.selection.toggleRowSelection(cell.row);
1837
+ break;
1838
+ default: return;
1839
+ }
1840
+ event.preventDefault();
1841
+ event.stopPropagation();
1842
+ if (destination)
1843
+ this.focus(destination);
1844
+ }
1845
+ destroy() {
1846
+ for (const [element, tabIndex] of this.originalTabIndexes)
1847
+ this.restoreTabIndex(element, tabIndex);
1848
+ this.originalTabIndexes.clear();
1849
+ this.registered.clear();
1850
+ this.cells = [];
1851
+ }
1852
+ ownsEvent(cell, event) {
1853
+ return event.target instanceof Element && event.target.closest('[data-kles-keyboard-cell]') === cell.element;
1854
+ }
1855
+ activate(cell) {
1856
+ this.active = cell;
1857
+ if (cell)
1858
+ this.identity = { rowId: cell.row.get('_id')?.value, columnDef: cell.columnDef };
1859
+ }
1860
+ focus(cell) {
1861
+ this.activate(cell);
1862
+ this.editing = false;
1863
+ this.updateTabStops();
1864
+ cell.element.focus({ preventScroll: true });
1865
+ cell.element.scrollIntoView?.({ block: 'nearest', inline: 'nearest' });
1866
+ }
1867
+ enterEdit(cell) {
1868
+ this.editing = true;
1869
+ this.updateTabStops();
1870
+ // Prefer the field over row handles and expansion buttons.
1871
+ const fields = [...cell.element.querySelectorAll('.cell-field')];
1872
+ const candidates = fields.flatMap(field => [...field.querySelectorAll(interactiveSelector)])
1873
+ .concat([...cell.element.querySelectorAll(interactiveSelector)]);
1874
+ const available = this.availableControls(cell);
1875
+ const target = candidates.find(element => available.includes(element));
1876
+ if (target)
1877
+ target.focus();
1878
+ else {
1879
+ this.editing = false;
1880
+ this.updateTabStops();
1881
+ }
1882
+ }
1883
+ isOwnControl(cell, element) {
1884
+ return element.closest('[data-kles-keyboard-cell]') === cell.element &&
1885
+ element.closest('table') === cell.element.closest('table');
1886
+ }
1887
+ availableControls(cell) {
1888
+ return [...cell.element.querySelectorAll(interactiveSelector)].filter(element => this.isOwnControl(cell, element) &&
1889
+ !element.matches(':disabled, [aria-disabled="true"], input[type="hidden"]') &&
1890
+ !element.closest('[hidden], [inert]') && element.getClientRects().length > 0);
1891
+ }
1892
+ updateTabStops() {
1893
+ const managed = new Set();
1894
+ for (const cell of this.cells) {
1895
+ this.setTabIndex(cell.element, cell === this.active ? '0' : '-1', managed);
1896
+ for (const element of cell.element.querySelectorAll(interactiveSelector)) {
1897
+ if (!this.isOwnControl(cell, element))
1898
+ continue;
1899
+ managed.add(element);
1900
+ if (this.editing && cell === this.active) {
1901
+ if (this.originalTabIndexes.has(element))
1902
+ this.restoreTabIndex(element, this.originalTabIndexes.get(element));
1903
+ }
1904
+ else
1905
+ this.setTabIndex(element, '-1', managed);
1906
+ }
1907
+ }
1908
+ for (const [element, tabIndex] of this.originalTabIndexes) {
1909
+ if (!managed.has(element)) {
1910
+ this.restoreTabIndex(element, tabIndex);
1911
+ this.originalTabIndexes.delete(element);
1912
+ }
1913
+ }
1914
+ }
1915
+ setTabIndex(element, value, managed) {
1916
+ managed.add(element);
1917
+ if (!this.originalTabIndexes.has(element))
1918
+ this.originalTabIndexes.set(element, element.getAttribute('tabindex'));
1919
+ if (element.getAttribute('tabindex') !== value)
1920
+ element.setAttribute('tabindex', value);
1921
+ }
1922
+ restoreTabIndex(element, value) {
1923
+ if (value === null)
1924
+ element.removeAttribute('tabindex');
1925
+ else if (element.getAttribute('tabindex') !== value)
1926
+ element.setAttribute('tabindex', value);
1927
+ }
1928
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: KeyboardNavigationService, deps: [{ token: KEYBOARD_NAVIGATION_CONFIG, optional: true }, { token: SELECTION_SERVICE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
1929
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: KeyboardNavigationService }); }
1930
+ }
1931
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: KeyboardNavigationService, decorators: [{
1932
+ type: Injectable
1933
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1934
+ type: Optional
1935
+ }, {
1936
+ type: Inject,
1937
+ args: [KEYBOARD_NAVIGATION_CONFIG]
1938
+ }] }, { type: undefined, decorators: [{
1939
+ type: Optional
1940
+ }, {
1941
+ type: Inject,
1942
+ args: [SELECTION_SERVICE]
1943
+ }] }] });
1944
+
1945
+ class KeyboardGridDirective {
1946
+ constructor() {
1947
+ this.navigation = inject(KeyboardNavigationService);
1948
+ this.element = inject(ElementRef).nativeElement;
1949
+ }
1950
+ get role() { return this.navigation.enabled ? 'grid' : null; }
1951
+ get label() { return this.navigation.enabled ? this.navigation.ariaLabel ?? null : null; }
1952
+ ngAfterViewChecked() { this.navigation.reconcile(); }
1953
+ ngOnDestroy() { this.navigation.destroy(); }
1954
+ onKeyDown(event) {
1955
+ if (event.defaultPrevented || event.isComposing || event.key !== 'Enter' || !event.ctrlKey || event.altKey || event.metaKey ||
1956
+ !(event.target instanceof Element) || event.target.closest('table') !== this.element)
1957
+ return;
1958
+ if (this.navigation.focusActive()) {
1959
+ event.preventDefault();
1960
+ event.stopPropagation();
1961
+ }
1962
+ }
1963
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: KeyboardGridDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1964
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.4", type: KeyboardGridDirective, isStandalone: true, selector: "table[klesKeyboardGrid]", host: { listeners: { "keydown": "onKeyDown($event)" }, properties: { "attr.role": "this.role", "attr.aria-label": "this.label" } }, providers: [KeyboardNavigationService], exportAs: ["klesKeyboardGrid"], ngImport: i0 }); }
1965
+ }
1966
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: KeyboardGridDirective, decorators: [{
1967
+ type: Directive,
1968
+ args: [{
1969
+ selector: 'table[klesKeyboardGrid]',
1970
+ exportAs: 'klesKeyboardGrid',
1971
+ standalone: true,
1972
+ providers: [KeyboardNavigationService],
1973
+ }]
1974
+ }], propDecorators: { role: [{
1975
+ type: HostBinding,
1976
+ args: ['attr.role']
1977
+ }], label: [{
1978
+ type: HostBinding,
1979
+ args: ['attr.aria-label']
1980
+ }], onKeyDown: [{
1981
+ type: HostListener,
1982
+ args: ['keydown', ['$event']]
1983
+ }] } });
1984
+ class KeyboardCellDirective {
1985
+ constructor() {
1986
+ this.navigation = inject(KeyboardNavigationService);
1987
+ this.element = inject(ElementRef).nativeElement;
1988
+ }
1989
+ get role() { return this.navigation.enabled ? 'gridcell' : null; }
1990
+ get enabled() { return this.navigation.enabled; }
1991
+ ngOnInit() { this.navigation.register(this); }
1992
+ ngOnDestroy() { this.navigation.unregister(this); }
1993
+ onFocusIn(event) { this.navigation.focusIn(this, event); }
1994
+ onFocusOut(event) { this.navigation.focusOut(event); }
1995
+ onKeyDown(event) { this.navigation.keyDown(this, event); }
1996
+ onClick(event) { this.navigation.click(this, event); }
1997
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: KeyboardCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1998
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.4", type: KeyboardCellDirective, isStandalone: true, selector: "td[klesKeyboardCell]", inputs: { row: ["klesKeyboardCell", "row"], columnDef: "columnDef" }, host: { attributes: { "data-kles-keyboard-cell": "" }, listeners: { "focusin": "onFocusIn($event)", "focusout": "onFocusOut($event)", "keydown": "onKeyDown($event)", "click": "onClick($event)" }, properties: { "attr.role": "this.role", "class.kles-keyboard-cell": "this.enabled" } }, ngImport: i0 }); }
1999
+ }
2000
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: KeyboardCellDirective, decorators: [{
2001
+ type: Directive,
2002
+ args: [{ selector: 'td[klesKeyboardCell]', standalone: true, host: { 'data-kles-keyboard-cell': '' } }]
2003
+ }], propDecorators: { row: [{
2004
+ type: Input,
2005
+ args: [{ required: true, alias: 'klesKeyboardCell' }]
2006
+ }], columnDef: [{
2007
+ type: Input,
2008
+ args: [{ required: true }]
2009
+ }], role: [{
2010
+ type: HostBinding,
2011
+ args: ['attr.role']
2012
+ }], enabled: [{
2013
+ type: HostBinding,
2014
+ args: ['class.kles-keyboard-cell']
2015
+ }], onFocusIn: [{
2016
+ type: HostListener,
2017
+ args: ['focusin', ['$event']]
2018
+ }], onFocusOut: [{
2019
+ type: HostListener,
2020
+ args: ['focusout', ['$event']]
2021
+ }], onKeyDown: [{
2022
+ type: HostListener,
2023
+ args: ['keydown', ['$event']]
2024
+ }], onClick: [{
2025
+ type: HostListener,
2026
+ args: ['click', ['$event']]
2027
+ }] } });
2028
+
1650
2029
  class KlesTableConnectorService {
1651
2030
  constructor() {
1652
2031
  this._connected$ = new BehaviorSubject(false);
@@ -1686,6 +2065,9 @@ class KlesTableConnectorService {
1686
2065
  get selection() {
1687
2066
  return this.table.selection;
1688
2067
  }
2068
+ get cursor() {
2069
+ return this.table.cursor;
2070
+ }
1689
2071
  get footer() {
1690
2072
  return this.table.footer;
1691
2073
  }
@@ -2122,81 +2504,70 @@ class ValidationService {
2122
2504
  this.rowSubscriptions = new Map();
2123
2505
  }
2124
2506
  listen(visibleRows, visibleColumns) {
2125
- const expectedColumnKeys = new Set();
2126
- const expectedRowKeys = new Set();
2507
+ const expectedControls = new Set();
2508
+ const expectedRows = new Set(visibleRows);
2127
2509
  visibleRows.forEach((row, rowIndex) => {
2128
- const rowSubscription = this.subscribeToRow(row, rowIndex);
2129
- const key = this.getRowKey(row);
2130
- expectedRowKeys.add(key);
2131
- this.rowSubscriptions.set(key, rowSubscription);
2132
- visibleColumns.forEach((column) => {
2133
- const columnKey = column;
2134
- const control = row.get(columnKey);
2135
- if (!control) {
2510
+ let rowEntry = this.rowSubscriptions.get(row);
2511
+ if (rowEntry) {
2512
+ rowEntry.rowIndex = rowIndex;
2513
+ }
2514
+ else {
2515
+ rowEntry = { row, rowIndex };
2516
+ this.rowSubscriptions.set(row, rowEntry);
2517
+ rowEntry.subscription = this.subscribeToRow(rowEntry);
2518
+ }
2519
+ visibleColumns.forEach((columnDef) => {
2520
+ const control = row.get(columnDef);
2521
+ if (!control)
2136
2522
  return;
2137
- }
2138
- const key = this.getCellKey(row, columnKey);
2139
- expectedColumnKeys.add(key);
2140
- if (this.columnSubscriptions.has(key)) {
2523
+ expectedControls.add(control);
2524
+ const existing = this.columnSubscriptions.get(control);
2525
+ if (existing) {
2526
+ existing.rowIndex = rowIndex;
2141
2527
  return;
2142
2528
  }
2143
- const subscription = this.subscribeToCell(row, rowIndex, columnKey, control);
2144
- this.columnSubscriptions.set(key, subscription);
2145
- });
2146
- });
2147
- this.unsubscribe(expectedRowKeys, expectedColumnKeys);
2148
- }
2149
- getCellKey(row, columnDef) {
2150
- return `${this.getRowKey(row)}:${columnDef}`;
2151
- }
2152
- getRowKey(row) {
2153
- return `${row.get('_id')?.value}`;
2154
- }
2155
- subscribeToCell(row, rowIndex, columnDef, control) {
2156
- return control.statusChanges
2157
- .pipe(takeUntilDestroyed(this.destroyRef), filter((status) => status === 'INVALID'))
2158
- .subscribe(() => {
2159
- this.eventsService.emit('cellValidationError', {
2160
- row,
2161
- rowIndex,
2162
- rawValue: row.getRawValue(),
2163
- value: row.value,
2164
- errors: control.errors,
2165
- controlsErrors: { columnDef: control.errors },
2529
+ const entry = { row, rowIndex };
2530
+ this.columnSubscriptions.set(control, entry);
2531
+ entry.subscription = control.statusChanges.pipe(takeUntilDestroyed(this.destroyRef), filter((status) => status === 'INVALID')).subscribe(() => {
2532
+ this.eventsService.emit('cellValidationError', {
2533
+ row,
2534
+ rowIndex: entry.rowIndex,
2535
+ rawValue: row.getRawValue(),
2536
+ value: row.value,
2537
+ errors: control.errors,
2538
+ controlsErrors: { [columnDef]: control.errors },
2539
+ });
2540
+ });
2166
2541
  });
2167
2542
  });
2543
+ for (const [control, entry] of this.columnSubscriptions) {
2544
+ if (!expectedControls.has(control)) {
2545
+ entry.subscription?.unsubscribe();
2546
+ this.columnSubscriptions.delete(control);
2547
+ }
2548
+ }
2549
+ for (const [row, entry] of this.rowSubscriptions) {
2550
+ if (!expectedRows.has(row)) {
2551
+ entry.subscription?.unsubscribe();
2552
+ this.rowSubscriptions.delete(row);
2553
+ }
2554
+ }
2168
2555
  }
2169
- subscribeToRow(row, rowIndex) {
2170
- return row.statusChanges
2171
- .pipe(takeUntilDestroyed(this.destroyRef), filter((status) => status === 'INVALID'))
2172
- .subscribe(() => {
2556
+ subscribeToRow(entry) {
2557
+ const row = entry.row;
2558
+ return row.statusChanges.pipe(startWith(row.status), takeUntilDestroyed(this.destroyRef), filter((status) => status === 'INVALID')).subscribe(() => {
2173
2559
  this.eventsService.emit('rowValidationError', {
2174
2560
  row,
2175
- rowIndex,
2561
+ rowIndex: entry.rowIndex,
2176
2562
  rawValue: row.getRawValue(),
2177
2563
  value: row.value,
2178
2564
  errors: row.errors,
2179
- controlsErrors: Object.keys(row.controls)
2180
- .filter((key) => row.get(key)?.errors)
2181
- .map((key) => ({ [key]: row.get(key)?.errors }))
2182
- .reduce((a, b) => ({ ...a, ...b })),
2565
+ controlsErrors: Object.fromEntries(Object.entries(row.controls)
2566
+ .filter(([, control]) => control.errors)
2567
+ .map(([name, control]) => [name, control.errors])),
2183
2568
  });
2184
2569
  });
2185
2570
  }
2186
- unsubscribe(expectedRowKeys, expectedColumnKeys) {
2187
- for (const [key, subscription] of this.columnSubscriptions.entries()) {
2188
- if (!expectedColumnKeys.has(key)) {
2189
- subscription.unsubscribe();
2190
- this.columnSubscriptions.delete(key);
2191
- }
2192
- }
2193
- for (const [key, subscription] of this.rowSubscriptions.entries()) {
2194
- if (!expectedRowKeys.has(key)) {
2195
- subscription.unsubscribe();
2196
- this.rowSubscriptions.delete(key);
2197
- }
2198
- }
2199
- }
2200
2571
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ValidationService, deps: [{ token: EventsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2201
2572
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ValidationService }); }
2202
2573
  }
@@ -2727,6 +3098,9 @@ class ColumnDragDropService {
2727
3098
  }
2728
3099
 
2729
3100
  class TableComponent {
3101
+ get cursor() {
3102
+ return this.cursorService;
3103
+ }
2730
3104
  constructor(host, connectorService, loader, datasourceService, tableService, dragDropRowService, columnDragDropService, rowAppearance, selectionService, columnsService, loadingService, paginatorService, scrollbarService, footerService, extraRowService, renderService, sortService, filterService, expandedRowStore, rowFactory, eventsService, rowService, cellService, emptyStateService, treeService, rowContextStore) {
2731
3105
  this.host = host;
2732
3106
  this.connectorService = connectorService;
@@ -2768,6 +3142,8 @@ class TableComponent {
2768
3142
  this.destroyRef = inject(DestroyRef);
2769
3143
  this.emptyStateComponent = KlesTableEmptyStateComponent;
2770
3144
  this.identityTrackBy = (_, row) => row;
3145
+ this.cursorService = inject(CursorService);
3146
+ this.intl = inject(KlesTableIntl);
2771
3147
  this.columns = this.columnsService.columns;
2772
3148
  this.displayedColumns = this.columnsService.displayedColumns;
2773
3149
  this.showFooter = this.footerService.footer;
@@ -3107,7 +3483,7 @@ class TableComponent {
3107
3483
  }
3108
3484
  }
3109
3485
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableComponent, deps: [{ token: i0.ElementRef }, { token: KlesTableConnectorService }, { token: LOADER_SERVICE }, { token: DATASOURCE_SERVICE }, { token: TABLE_SERVICE }, { token: ROW_DRAG_DROP }, { token: COLUMN_DRAG_DROP }, { token: ROW_APPEARANCE_CONFIG }, { token: SELECTION_SERVICE }, { token: ColumnsService }, { token: LoadingService }, { token: PaginatorService }, { token: ScrollbarService }, { token: FooterService }, { token: ExtraRowService }, { token: RenderService }, { token: SORT_SERVICE }, { token: FilterService, optional: true }, { token: ExpandedRowStore }, { token: RowFormFactory }, { token: EventsService }, { token: RowService }, { token: CellService }, { token: EmptyStateService }, { token: TreeService }, { token: RowContextStore }], target: i0.ɵɵFactoryTarget.Component }); }
3110
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: TableComponent, isStandalone: true, selector: "kles-table", host: { properties: { "class.loading": "this.isLoadingClass", "class.empty": "this.isEmptyClass" } }, viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true }, { propertyName: "matSort", first: true, predicate: MatSort, descendants: true, static: true }, { propertyName: "formElemRef", first: true, predicate: ["form"], descendants: true, static: true }, { propertyName: "dropLists", predicate: CdkDropList, descendants: true }, { propertyName: "drags", predicate: CdkDrag, descendants: true }], ngImport: i0, template: "<form #form cdkScrollable [formGroup]=\"tableService.form\">\n <table\n mat-table\n [dataSource]=\"dataSource\"\n matSort\n [trackBy]=\"multiTemplateDataRows() ? identityTrackBy : tableService.trackBy\"\n formArrayName=\"rows\"\n cdkDropList\n [id]=\"dragDropRowService.dropListId\"\n [cdkDropListData]=\"tableService.klesForm\"\n (cdkDropListDropped)=\"dragDropRowService.listDropped($event)\"\n [cdkDropListDisabled]=\"!dragDropRowService.enable\"\n [cdkDropListAutoScrollStep]=\"dragDropRowService.autoScrollStep\"\n [cdkDropListSortPredicate]=\"dragDropRowService.sortPredicate\"\n [cdkDropListConnectedTo]=\"dragDropRowService.connectedTo ?? []\"\n [multiTemplateDataRows]=\"multiTemplateDataRows()\"\n >\n <colgroup>\n @for (column of columns(); track column.columnDef) {\n <col\n [attr.data-column-def]=\"column.columnDef\"\n [style.width]=\"column.width ?? null\"\n [style.minWidth]=\"column.minWidth ?? null\"\n [style.maxWidth]=\"column.maxWidth ?? null\"\n />\n }\n </colgroup>\n\n @for (column of columns(); track column.columnDef) {\n <ng-container [cdkColumnDef]=\"column.columnDef\" [sticky]=\"column.sticky ?? false\" [stickyEnd]=\"column.stickyEnd ?? false\">\n <th\n mat-header-cell\n *matHeaderCellDef\n cdkDrag\n cdkDragLockAxis=\"x\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"columnDragDropService.isDragDisabled(column)\"\n [appResizableColumn]=\"column\"\n [style.border-inline-end]=\"getColumnSeparator(column, 'header') ?? getStickyStartSeparator(column, 'header')\"\n [style.border-inline-start]=\"getStickyEndSeparator(column, 'header')\"\n [ngStyle]=\"\n $safeNavigationMigration(column.headerCell?.style?.ngStyle)\n | resolveNgStyle\n : $safeNavigationMigration(tableService.form.get(['header', column.columnDef])?.value)\n : $safeNavigationMigration(tableService.form.get(['header', column.columnDef])?.status)\n : tableService.form.controls.header.value\n : tableService.form.controls.header.status\n \"\n >\n <div class=\"cell\">\n <kles-header\n [header]=\"(column | header)!\"\n [group]=\"tableService.form.controls.header\"\n [columnDragHandle]=\"columnDragDropService.enable && !columnDragDropService.isDragDisabled(column)\"\n [dragHandleSpacer]=\"dragDropRowService.handleOnly && column.columnDef === displayedColumns()?.[0]\"\n >\n <ng-container\n klesDynamicField\n [field]=\"(column | headerField)!\"\n [group]=\"tableService.form.controls.header\"\n [ui]=\"tableService.ui.states.header\"\n ></ng-container>\n </kles-header>\n </div>\n </th>\n\n <td\n mat-cell\n *cdkCellDef=\"let row; let index = index; let dataIndex = dataIndex\"\n [style.border-inline-end]=\"getColumnSeparator(column, 'body') ?? getStickyStartSeparator(column, 'body')\"\n [style.border-inline-start]=\"getStickyEndSeparator(column, 'body')\"\n [ngStyle]=\"\n $safeNavigationMigration(column.cell?.style?.ngStyle)\n | resolveNgStyle: row.controls[column.columnDef].value : row.controls[column.columnDef].status : row.value : row.status\n \"\n (click)=\"cellService.onClick($event, row, dataIndex ?? index, column.columnDef)\"\n (dblclick)=\"cellService.onDoubleClick($event, row, dataIndex ?? index, column.columnDef)\"\n (contextmenu)=\"cellService.onContextMenu($event, row, dataIndex ?? index, column.columnDef)\"\n >\n <div class=\"cell\" [style.--align]=\"column.align\">\n <kles-cell\n [group]=\"row\"\n [ui]=\"(row | uiField)!\"\n [column]=\"column\"\n [rowIndex]=\"dataIndex ?? index\"\n [dragHandle]=\"dragDropRowService.handleOnly && column.columnDef === displayedColumns()?.[0]\"\n >\n @if (column.columnDef === selectionService.key && selectionService.isLoading(row)) {\n <mat-spinner class=\"selection-row-spinner\" [diameter]=\"20\"></mat-spinner>\n } @else {\n <ng-container\n klesDynamicField\n [field]=\"(column | cellField)!\"\n [group]=\"row\"\n [ui]=\"(row | uiField)!\"\n [context]=\"row | rowContext\"\n ></ng-container>\n }\n </kles-cell>\n </div>\n </td>\n\n <td\n mat-footer-cell\n *matFooterCellDef\n [style.border-inline-end]=\"getColumnSeparator(column, 'footer') ?? getStickyStartSeparator(column, 'footer')\"\n [style.border-inline-start]=\"getStickyEndSeparator(column, 'footer')\"\n [ngStyle]=\"\n $safeNavigationMigration(column.footerCell?.style?.ngStyle)\n | resolveNgStyle\n : $safeNavigationMigration(tableService.form.get(['footer', column.columnDef])?.value)\n : $safeNavigationMigration(tableService.form.get(['footer', column.columnDef])?.status)\n : tableService.form.controls.footer.value\n : tableService.form.controls.footer.status\n \"\n >\n @if (column.footerCell) {\n <ng-container\n klesDynamicField\n [field]=\"(column | footerField)!\"\n [group]=\"tableService.form.controls.footer\"\n [ui]=\"tableService.ui.states.footer\"\n >\n </ng-container>\n }\n </td>\n </ng-container>\n }\n\n <tr\n mat-header-row\n class=\"kles-column-drop-list\"\n *matHeaderRowDef=\"displayedColumns(); sticky: true\"\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n [cdkDropListData]=\"columnDragDropService.visibleColumns()\"\n [cdkDropListDisabled]=\"!columnDragDropService.enable\"\n [cdkDropListAutoScrollDisabled]=\"true\"\n [cdkDropListSortPredicate]=\"columnDragDropService.sortPredicate\"\n (cdkDropListDropped)=\"columnDragDropService.listDropped($event)\"\n ></tr>\n\n <tr\n mat-row\n *matRowDef=\"let row; let index = index; let dataIndex = dataIndex; columns: displayedColumns()\"\n [class.kles-row-selected]=\"isRowSelected(row)\"\n cdkDrag\n [cdkDragData]=\"row\"\n [cdkDragDisabled]=\"dragDropRowService.isDragDisabled(row)\"\n [ngStyle]=\"rowAppearance.rowStyle | resolveRowStyle: row.value : row.status : (dataIndex ?? index) : getRowContext(row)\"\n [ngClass]=\"rowAppearance.rowClass | resolveRowClass: row.value : row.status : (dataIndex ?? index) : getRowContext(row)\"\n (cdkDragStarted)=\"dragDropRowService.rowDragStarted(row, dataIndex ?? index)\"\n (cdkDragMoved)=\"dragDropRowService.rowDragMoved(row, dataIndex ?? index)\"\n (cdkDragEnded)=\"dragDropRowService.rowDragEnded(row, dataIndex ?? index)\"\n (click)=\"rowService.onClick($event, row, dataIndex ?? index)\"\n (dblclick)=\"rowService.onDoubleClick($event, row, dataIndex ?? index)\"\n (contextmenu)=\"rowService.onContextMenu($event, row, dataIndex ?? index)\"\n (mouseenter)=\"rowService.onMouseEnter($event, row, dataIndex ?? index)\"\n (mouseleave)=\"rowService.onMouseLeave($event, row, dataIndex ?? index)\"\n >\n @if (dragDropRowService.previewComponent; as previewComponent) {\n <ng-template cdkDragPreview [matchSize]=\"dragDropRowService.previewMatchSize\">\n <div class=\"kles-row-drag-preview\">\n <ng-container\n *ngComponentOutlet=\"previewComponent; injector: dragDropRowService.componentInjector(row, dataIndex ?? index)\"\n ></ng-container>\n </div>\n </ng-template>\n }\n\n @if (dragDropRowService.placeholderComponent; as placeholderComponent) {\n <ng-template cdkDragPlaceholder>\n <tr class=\"kles-row-drag-placeholder\">\n <td [attr.colspan]=\"displayedColumns()?.length ?? 1\">\n <ng-container\n *ngComponentOutlet=\"placeholderComponent; injector: dragDropRowService.componentInjector(row, dataIndex ?? index)\"\n ></ng-container>\n </td>\n </tr>\n </ng-template>\n }\n </tr>\n\n @if (multiTemplateDataRows()) {\n @for (extraRow of extraRows(); track extraRow) {\n @for (extraColumn of extraRow.cells; track extraColumn.columnDef) {\n <ng-container [cdkColumnDef]=\"extraColumn.columnDef\">\n <td\n mat-cell\n class=\"kles-extra-row-cell\"\n *cdkCellDef=\"let row\"\n [attr.colspan]=\"(extraColumn.colspan ?? 1) | spanPipe: displayedColumns().length\"\n [attr.rowspan]=\"extraColumn.rowspan\"\n [ngStyle]=\"\n $safeNavigationMigration(extraColumn?.style?.ngStyle)\n | resolveNgStyle\n : row.controls[extraColumn.columnDef].value\n : row.controls[extraColumn.columnDef].status\n : row.value\n : row.status\n \"\n >\n <div\n class=\"kles-extra-row-content\"\n [class.kles-extra-row-content--viewport]=\"extraRow.width === 'viewport'\"\n [style.width.px]=\"extraRow.width === 'viewport' ? viewportWidthPx() : null\"\n [style.--kles-table-horizontal-scroll-range.px]=\"extraRow.width === 'viewport' ? viewportScrollRangePx() : null\"\n >\n <ng-container\n klesDynamicField\n [field]=\"(extraColumn | extraCellField)!\"\n [group]=\"row\"\n [ui]=\"(row | uiField)!\"\n [context]=\"row | rowContext\"\n ></ng-container>\n </div>\n </td>\n </ng-container>\n }\n <tr\n mat-row\n class=\"kles-extra-row\"\n *matRowDef=\"let row; let index = index; let dataIndex = dataIndex; columns: extraRow.displayedColumns; when: extraRow.when\"\n (click)=\"rowService.onClick($event, row, dataIndex ?? index)\"\n (dblclick)=\"rowService.onDoubleClick($event, row, dataIndex ?? index)\"\n (contextmenu)=\"rowService.onContextMenu($event, row, dataIndex ?? index)\"\n (mouseenter)=\"rowService.onMouseEnter($event, row, dataIndex ?? index)\"\n (mouseleave)=\"rowService.onMouseLeave($event, row, dataIndex ?? index)\"\n ></tr>\n }\n }\n\n <tr mat-footer-row *matFooterRowDef=\"displayedColumns(); sticky: true\" [style.display]=\"showFooter() ? '' : 'none'\"></tr>\n </table>\n</form>\n\n@if (loadingService.loading()) {\n <div class=\"table-overlay\" [style.--header-h.px]=\"headerHeightPx()\" [style.--scroll-h.px]=\"scrollHeightPx()\" [style.--footer-h.px]=\"footerHeightPx()\">\n <mat-spinner></mat-spinner>\n </div>\n}\n\n@if (emptyStateService.enabled() && !loadingService.loading() && isEmpty()) {\n <div\n class=\"table-empty-state-overlay\"\n [style.--header-h.px]=\"headerHeightPx()\"\n [style.--scroll-h.px]=\"scrollHeightPx()\"\n [style.--footer-h.px]=\"footerHeightPx()\"\n >\n <div class=\"table-empty-state-content\">\n <ng-container *ngComponentOutlet=\"emptyStateService.component\"></ng-container>\n </div>\n </div>\n}\n", styles: [":host{--kles-table-divider-color: color-mix(in srgb, var(--mat-sys-outline-variant) 65%, transparent);--kles-table-divider-strong-color: var(--mat-sys-outline-variant);--kles-table-header-background: var(--mat-sys-surface-container);--kles-table-header-color: var(--mat-sys-on-surface);--kles-table-header-divider-color: var(--mat-sys-outline-variant);--kles-table-row-hover-background: color-mix(in srgb, var(--mat-sys-primary) 4%, var(--mat-sys-surface));--kles-table-row-selected-background: color-mix(in srgb, var(--mat-sys-primary) 7%, var(--mat-sys-surface));--kles-table-row-selected-hover-background: color-mix(in srgb, var(--mat-sys-primary) 10%, var(--mat-sys-surface));--kles-table-row-selected-indicator-color: var(--mat-sys-primary);overflow:auto;display:flex;flex-direction:column;position:relative;height:100%;--mat-form-field-filled-container-color: transparent;--mat-form-field-hover-state-layer-opacity: 0;--mat-form-field-focus-state-layer-opacity: 0;--mat-form-field-state-layer-color: transparent}:host(.loading),:host(.empty){min-height:280px}form{display:flex;flex-direction:column;flex-grow:1;position:relative;overflow:auto;scroll-timeline-name:--kles-table-horizontal-scroll;scroll-timeline-axis:inline}table{width:100%;flex-grow:1}th,td{text-wrap:pretty;white-space:normal;padding-top:2px;padding-bottom:2px;box-sizing:border-box}td{word-break:normal}:host td.kles-extra-row-cell{padding:0}.kles-extra-row-content--viewport{box-sizing:border-box;animation:kles-extra-row-horizontal-scroll 1ms linear both paused}@supports (animation-timeline: scroll()){.kles-extra-row-content--viewport{animation-play-state:running;animation-timeline:--kles-table-horizontal-scroll}}@keyframes kles-extra-row-horizontal-scroll{0%{transform:translate(0)}to{transform:translate(var(--kles-table-horizontal-scroll-range, 0px))}}th .cell,td .cell{display:flex;flex-direction:column;justify-content:var(--align, center)}th[appResizableColumn].resizable-column{position:relative}th[appResizableColumn]>.resize-handle{position:absolute;top:0;inset-inline-end:-7px;z-index:20;width:14px;height:100%;cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;outline:none}th[appResizableColumn]>.resize-handle:before{content:\"\";position:absolute;top:15%;bottom:15%;inset-inline-start:6px;width:2px;border-radius:2px;background:var(--mat-sys-outline);opacity:0;transition:opacity .12s ease,background-color .12s ease,transform .12s ease}th[appResizableColumn].resizable-column:hover>.resize-handle:before,th[appResizableColumn]>.resize-handle:focus-visible:before{opacity:.65}th[appResizableColumn].column-resizing>.resize-handle:before{top:0;bottom:0;background:var(--mat-sys-primary);opacity:1;transform:scaleX(1.25)}th[appResizableColumn].column-resizing>.resize-handle:after{content:\"\";position:absolute;top:100%;inset-inline-start:6px;width:2px;height:100vh;background:color-mix(in srgb,var(--mat-sys-primary) 70%,transparent);pointer-events:none}th[appResizableColumn]>.resize-handle>.resize-width-label{position:absolute;top:calc(100% + 8px);inset-inline-start:50%;z-index:30;display:none;padding:3px 7px;color:var(--mat-sys-on-primary);font-size:11px;font-weight:600;line-height:16px;white-space:nowrap;background:var(--mat-sys-primary);border-radius:var(--mat-sys-corner-extra-small);box-shadow:var(--mat-sys-level2);transform:translate(-50%);pointer-events:none}th[appResizableColumn].column-resizing>.resize-handle>.resize-width-label{display:block}:host .column-resizing-cell{width:var(--kles-column-resize-width)!important;min-width:var(--kles-column-resize-width)!important;max-width:var(--kles-column-resize-width)!important;flex:0 0 var(--kles-column-resize-width)!important;background-image:linear-gradient(color-mix(in srgb,var(--mat-sys-primary) 5%,transparent),color-mix(in srgb,var(--mat-sys-primary) 5%,transparent))}.table-overlay{position:absolute;inset-inline:0;top:var(--header-h, 56px);bottom:calc(var(--scroll-h, 0px) + var(--footer-h, 0px));display:grid;place-items:center;background:color-mix(in srgb,var(--mat-sys-surface-container-highest) 75%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--mat-sys-outline-variant) 30%,transparent);z-index:500}:host .mat-mdc-row:not(.kles-extra-row){transition:background-color .12s ease}:host .mat-mdc-row:not(.kles-extra-row):hover{background:var(--kles-table-row-hover-background)}:host .mat-mdc-row:not(.kles-extra-row).kles-row-selected{background:var(--kles-table-row-selected-background);box-shadow:inset 3px 0 0 var(--kles-table-row-selected-indicator-color)}:host .mat-mdc-row:not(.kles-extra-row).kles-row-selected:hover{background:var(--kles-table-row-selected-hover-background)}:host tr.mat-mdc-row.cdk-drag-placeholder{opacity:1;background:color-mix(in srgb,var(--mat-sys-primary) 12%,var(--mat-sys-surface))!important}:host tr.mat-mdc-row.cdk-drag-placeholder td{border-block:2px dashed var(--mat-sys-primary)}:host tr.mat-mdc-row.cdk-drag-placeholder td>*{visibility:hidden}:host tr.mat-mdc-row.cdk-drag-placeholder td:first-child{border-inline-start:2px dashed var(--mat-sys-primary)}:host tr.mat-mdc-row.cdk-drag-placeholder td:last-child{border-inline-end:2px dashed var(--mat-sys-primary)}:host .cdk-drop-list-dragging tr.mat-mdc-row:not(.cdk-drag-placeholder),:host tr.mat-mdc-row.cdk-drag-animating{transition:transform .18s cubic-bezier(0,0,.2,1)}:host .kles-column-drop-list.cdk-drop-list-dragging .mat-mdc-header-cell:not(.cdk-drag-placeholder),:host .mat-mdc-header-cell.cdk-drag-animating{transition:transform .18s cubic-bezier(0,0,.2,1)}:host .mat-mdc-header-cell.cdk-drag-placeholder{opacity:.25}.mat-mdc-header-cell.cdk-drag-preview{box-sizing:border-box;background:var(--kles-table-header-background);color:var(--kles-table-header-color);box-shadow:var(--mat-sys-level3)}.kles-row-drag-preview{overflow:hidden;border-radius:var(--mat-sys-corner-small);background:var(--mat-sys-surface-container);box-shadow:var(--mat-sys-level3)}.selection-row-spinner{margin-inline:auto}:host tr.kles-row-drag-placeholder td{padding:0;border:2px dashed var(--mat-sys-primary);background:color-mix(in srgb,var(--mat-sys-primary) 12%,var(--mat-sys-surface))}:host .mat-mdc-table .mat-mdc-cell,:host .mat-mdc-table .mat-mdc-header-cell{border-bottom-color:var(--mat-sys-outline-variant)}:host .mat-mdc-table .mat-mdc-cell:last-child,:host .mat-mdc-table .mat-mdc-header-cell:last-child{border-right:none}:host tr.mat-mdc-footer-row td.mat-mdc-footer-cell{border-top:1px solid var(--kles-table-divider-strong-color)}:host tr.mat-mdc-row:last-of-type td.mat-mdc-cell{border-bottom:1px solid var(--kles-table-divider-color)}:host tr.mat-mdc-footer-row{font-weight:500}:host .mat-mdc-header-row,:host .mat-mdc-header-cell{background-color:var(--kles-table-header-background);color:var(--kles-table-header-color)}:host .mat-mdc-header-cell{border-bottom-color:var(--kles-table-header-divider-color)}.table-empty-state-overlay{position:absolute;inset-inline:0;top:var(--header-h, 56px);bottom:calc(var(--scroll-h, 0px) + var(--footer-h, 0px));z-index:400;overflow:hidden;background:var(--mat-sys-surface);display:grid;place-items:center}.table-empty-state-content{width:100%;height:100%}.scrollbar-hidden{scrollbar-width:none;-ms-overflow-style:none;overflow-y:hidden}.scrollbar-hidden::-webkit-scrollbar{display:none;overflow-y:hidden}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i18.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i18.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: i18.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i19.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i19.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i19.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i19.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i4.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i21.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i21.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i21.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i21.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i21.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i21.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i21.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i21.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i21.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i21.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i21.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i21.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: CdkTableModule }, { kind: "directive", type: i22.CdkCellDef, selector: "[cdkCellDef]" }, { kind: "directive", type: i22.CdkColumnDef, selector: "[cdkColumnDef]", inputs: ["cdkColumnDef", "sticky", "stickyEnd"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i23.CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "ngmodule", type: KlesMaterialDynamicformsModule }, { kind: "directive", type: i24.KlesDynamicFieldDirective, selector: "[klesDynamicField]", inputs: ["field", "group", "ui", "siblingFields", "context"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i25.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: i25.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: "directive", type: i25.CdkDragPreview, selector: "ng-template[cdkDragPreview]", inputs: ["data", "matchSize"] }, { kind: "directive", type: i25.CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: ["data"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i26.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: ResizableColumnDirective, selector: "th[appResizableColumn]", inputs: ["appResizableColumn"] }, { kind: "component", type: KlesCellComponent, selector: "kles-cell", inputs: ["ui", "group", "column", "rowIndex", "dragHandle"] }, { kind: "component", type: KlesHeaderComponent, selector: "kles-header", inputs: ["header", "group", "dragHandleSpacer", "columnDragHandle"] }, { kind: "pipe", type: HeaderFieldPipe, name: "headerField" }, { kind: "pipe", type: CellFieldPipe, name: "cellField" }, { kind: "pipe", type: UiFieldPipe, name: "uiField" }, { kind: "pipe", type: FooterFieldPipe, name: "footerField" }, { kind: "pipe", type: SpanPipe, name: "spanPipe" }, { kind: "pipe", type: ExtraCellFieldPipe, name: "extraCellField" }, { kind: "pipe", type: ResolveNgStylePipe, name: "resolveNgStyle" }, { kind: "pipe", type: HeaderPipe, name: "header" }, { kind: "pipe", type: RowContextPipe, name: "rowContext" }, { kind: "pipe", type: ResolveRowStylePipe, name: "resolveRowStyle" }, { kind: "pipe", type: ResolveRowClassPipe, name: "resolveRowClass" }] }); }
3486
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: TableComponent, isStandalone: true, selector: "kles-table", host: { properties: { "class.loading": "this.isLoadingClass", "class.empty": "this.isEmptyClass" } }, viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true }, { propertyName: "matSort", first: true, predicate: MatSort, descendants: true, static: true }, { propertyName: "formElemRef", first: true, predicate: ["form"], descendants: true, static: true }, { propertyName: "dropLists", predicate: CdkDropList, descendants: true }, { propertyName: "drags", predicate: CdkDrag, descendants: true }], ngImport: i0, template: "<form\n #form\n cdkScrollable\n [formGroup]=\"tableService.form\"\n [style.scroll-padding-top.px]=\"keyboardGrid.navigation.enabled ? headerHeightPx() : null\"\n [style.scroll-padding-bottom.px]=\"keyboardGrid.navigation.enabled && showFooter() ? footerHeightPx() : null\"\n>\n @if (keyboardGrid.navigation.enabled && !isEmpty()) {\n <button type=\"button\" class=\"kles-grid-entry\" (click)=\"keyboardGrid.navigation.focusActive()\">\n {{ intl.keyboardNavigationEntryLabel }}\n </button>\n }\n <table\n mat-table\n klesKeyboardGrid\n #keyboardGrid=\"klesKeyboardGrid\"\n [dataSource]=\"dataSource\"\n matSort\n [trackBy]=\"multiTemplateDataRows() ? identityTrackBy : tableService.trackBy\"\n formArrayName=\"rows\"\n cdkDropList\n [id]=\"dragDropRowService.dropListId\"\n [cdkDropListData]=\"tableService.klesForm\"\n (cdkDropListDropped)=\"dragDropRowService.listDropped($event)\"\n [cdkDropListDisabled]=\"!dragDropRowService.enable\"\n [cdkDropListAutoScrollStep]=\"dragDropRowService.autoScrollStep\"\n [cdkDropListSortPredicate]=\"dragDropRowService.sortPredicate\"\n [cdkDropListConnectedTo]=\"dragDropRowService.connectedTo ?? []\"\n [multiTemplateDataRows]=\"multiTemplateDataRows()\"\n >\n <colgroup>\n @for (column of columns(); track column.columnDef) {\n <col\n [attr.data-column-def]=\"column.columnDef\"\n [style.width]=\"column.width ?? null\"\n [style.minWidth]=\"column.minWidth ?? null\"\n [style.maxWidth]=\"column.maxWidth ?? null\"\n />\n }\n </colgroup>\n\n @for (column of columns(); track column.columnDef) {\n <ng-container [cdkColumnDef]=\"column.columnDef\" [sticky]=\"column.sticky ?? false\" [stickyEnd]=\"column.stickyEnd ?? false\">\n <th\n mat-header-cell\n *matHeaderCellDef\n cdkDrag\n cdkDragLockAxis=\"x\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"columnDragDropService.isDragDisabled(column)\"\n [appResizableColumn]=\"column\"\n [style.border-inline-end]=\"getColumnSeparator(column, 'header') ?? getStickyStartSeparator(column, 'header')\"\n [style.border-inline-start]=\"getStickyEndSeparator(column, 'header')\"\n [ngStyle]=\"\n $safeNavigationMigration(column.headerCell?.style?.ngStyle)\n | resolveNgStyle\n : $safeNavigationMigration(tableService.form.get(['header', column.columnDef])?.value)\n : $safeNavigationMigration(tableService.form.get(['header', column.columnDef])?.status)\n : tableService.form.controls.header.value\n : tableService.form.controls.header.status\n \"\n >\n <div class=\"cell\">\n <kles-header\n [header]=\"(column | header)!\"\n [group]=\"tableService.form.controls.header\"\n [columnDragHandle]=\"columnDragDropService.enable && !columnDragDropService.isDragDisabled(column)\"\n [dragHandleSpacer]=\"dragDropRowService.handleOnly && column.columnDef === displayedColumns()?.[0]\"\n >\n <ng-container\n klesDynamicField\n [field]=\"(column | headerField)!\"\n [group]=\"tableService.form.controls.header\"\n [ui]=\"tableService.ui.states.header\"\n ></ng-container>\n </kles-header>\n </div>\n </th>\n\n <td\n mat-cell\n *cdkCellDef=\"let row; let index = index; let dataIndex = dataIndex\"\n [klesKeyboardCell]=\"row\"\n [columnDef]=\"column.columnDef\"\n [style.border-inline-end]=\"getColumnSeparator(column, 'body') ?? getStickyStartSeparator(column, 'body')\"\n [style.border-inline-start]=\"getStickyEndSeparator(column, 'body')\"\n [ngStyle]=\"\n $safeNavigationMigration(column.cell?.style?.ngStyle)\n | resolveNgStyle: row.controls[column.columnDef].value : row.controls[column.columnDef].status : row.value : row.status\n \"\n (click)=\"cellService.onClick($event, row, dataIndex ?? index, column.columnDef)\"\n (dblclick)=\"cellService.onDoubleClick($event, row, dataIndex ?? index, column.columnDef)\"\n (contextmenu)=\"cellService.onContextMenu($event, row, dataIndex ?? index, column.columnDef)\"\n >\n <div class=\"cell\" [style.--align]=\"column.align\">\n <kles-cell\n [group]=\"row\"\n [ui]=\"(row | uiField)!\"\n [column]=\"column\"\n [rowIndex]=\"dataIndex ?? index\"\n [dragHandle]=\"dragDropRowService.handleOnly && column.columnDef === displayedColumns()?.[0]\"\n >\n @if (column.columnDef === selectionService.key && selectionService.isLoading(row)) {\n <mat-spinner class=\"selection-row-spinner\" [diameter]=\"20\"></mat-spinner>\n } @else {\n <ng-container\n klesDynamicField\n [field]=\"(column | cellField)!\"\n [group]=\"row\"\n [ui]=\"(row | uiField)!\"\n [context]=\"row | rowContext\"\n ></ng-container>\n }\n </kles-cell>\n </div>\n </td>\n\n <td\n mat-footer-cell\n *matFooterCellDef\n [style.border-inline-end]=\"getColumnSeparator(column, 'footer') ?? getStickyStartSeparator(column, 'footer')\"\n [style.border-inline-start]=\"getStickyEndSeparator(column, 'footer')\"\n [ngStyle]=\"\n $safeNavigationMigration(column.footerCell?.style?.ngStyle)\n | resolveNgStyle\n : $safeNavigationMigration(tableService.form.get(['footer', column.columnDef])?.value)\n : $safeNavigationMigration(tableService.form.get(['footer', column.columnDef])?.status)\n : tableService.form.controls.footer.value\n : tableService.form.controls.footer.status\n \"\n >\n @if (column.footerCell) {\n <ng-container\n klesDynamicField\n [field]=\"(column | footerField)!\"\n [group]=\"tableService.form.controls.footer\"\n [ui]=\"tableService.ui.states.footer\"\n >\n </ng-container>\n }\n </td>\n </ng-container>\n }\n\n <tr\n mat-header-row\n class=\"kles-column-drop-list\"\n *matHeaderRowDef=\"displayedColumns(); sticky: true\"\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n [cdkDropListData]=\"columnDragDropService.visibleColumns()\"\n [cdkDropListDisabled]=\"!columnDragDropService.enable\"\n [cdkDropListAutoScrollDisabled]=\"true\"\n [cdkDropListSortPredicate]=\"columnDragDropService.sortPredicate\"\n (cdkDropListDropped)=\"columnDragDropService.listDropped($event)\"\n ></tr>\n\n <tr\n mat-row\n *matRowDef=\"let row; let index = index; let dataIndex = dataIndex; columns: displayedColumns()\"\n [class.kles-row-selected]=\"isRowSelected(row)\"\n [class.kles-row-pointer]=\"cursorService.isPointer(row)\"\n cdkDrag\n [cdkDragData]=\"row\"\n [cdkDragDisabled]=\"dragDropRowService.isDragDisabled(row)\"\n [ngStyle]=\"rowAppearance.rowStyle | resolveRowStyle: row.value : row.status : (dataIndex ?? index) : getRowContext(row)\"\n [ngClass]=\"rowAppearance.rowClass | resolveRowClass: row.value : row.status : (dataIndex ?? index) : getRowContext(row)\"\n (cdkDragStarted)=\"dragDropRowService.rowDragStarted(row, dataIndex ?? index)\"\n (cdkDragMoved)=\"dragDropRowService.rowDragMoved(row, dataIndex ?? index)\"\n (cdkDragEnded)=\"dragDropRowService.rowDragEnded(row, dataIndex ?? index)\"\n (click)=\"rowService.onClick($event, row, dataIndex ?? index)\"\n (dblclick)=\"rowService.onDoubleClick($event, row, dataIndex ?? index)\"\n (contextmenu)=\"rowService.onContextMenu($event, row, dataIndex ?? index)\"\n (mouseenter)=\"rowService.onMouseEnter($event, row, dataIndex ?? index)\"\n (mouseleave)=\"rowService.onMouseLeave($event, row, dataIndex ?? index)\"\n >\n @if (dragDropRowService.previewComponent; as previewComponent) {\n <ng-template cdkDragPreview [matchSize]=\"dragDropRowService.previewMatchSize\">\n <div class=\"kles-row-drag-preview\">\n <ng-container\n *ngComponentOutlet=\"previewComponent; injector: dragDropRowService.componentInjector(row, dataIndex ?? index)\"\n ></ng-container>\n </div>\n </ng-template>\n }\n\n @if (dragDropRowService.placeholderComponent; as placeholderComponent) {\n <ng-template cdkDragPlaceholder>\n <tr class=\"kles-row-drag-placeholder\">\n <td [attr.colspan]=\"displayedColumns()?.length ?? 1\">\n <ng-container\n *ngComponentOutlet=\"placeholderComponent; injector: dragDropRowService.componentInjector(row, dataIndex ?? index)\"\n ></ng-container>\n </td>\n </tr>\n </ng-template>\n }\n </tr>\n\n @if (multiTemplateDataRows()) {\n @for (extraRow of extraRows(); track extraRow) {\n @for (extraColumn of extraRow.cells; track extraColumn.columnDef) {\n <ng-container [cdkColumnDef]=\"extraColumn.columnDef\">\n <td\n mat-cell\n class=\"kles-extra-row-cell\"\n *cdkCellDef=\"let row\"\n [attr.colspan]=\"(extraColumn.colspan ?? 1) | spanPipe: displayedColumns().length\"\n [attr.rowspan]=\"extraColumn.rowspan\"\n [ngStyle]=\"\n $safeNavigationMigration(extraColumn?.style?.ngStyle)\n | resolveNgStyle\n : row.controls[extraColumn.columnDef].value\n : row.controls[extraColumn.columnDef].status\n : row.value\n : row.status\n \"\n >\n <div\n class=\"kles-extra-row-content\"\n [class.kles-extra-row-content--viewport]=\"extraRow.width === 'viewport'\"\n [style.width.px]=\"extraRow.width === 'viewport' ? viewportWidthPx() : null\"\n [style.--kles-table-horizontal-scroll-range.px]=\"extraRow.width === 'viewport' ? viewportScrollRangePx() : null\"\n >\n <ng-container\n klesDynamicField\n [field]=\"(extraColumn | extraCellField)!\"\n [group]=\"row\"\n [ui]=\"(row | uiField)!\"\n [context]=\"row | rowContext\"\n ></ng-container>\n </div>\n </td>\n </ng-container>\n }\n <tr\n mat-row\n class=\"kles-extra-row\"\n *matRowDef=\"let row; let index = index; let dataIndex = dataIndex; columns: extraRow.displayedColumns; when: extraRow.when\"\n (click)=\"rowService.onClick($event, row, dataIndex ?? index)\"\n (dblclick)=\"rowService.onDoubleClick($event, row, dataIndex ?? index)\"\n (contextmenu)=\"rowService.onContextMenu($event, row, dataIndex ?? index)\"\n (mouseenter)=\"rowService.onMouseEnter($event, row, dataIndex ?? index)\"\n (mouseleave)=\"rowService.onMouseLeave($event, row, dataIndex ?? index)\"\n ></tr>\n }\n }\n\n <tr mat-footer-row *matFooterRowDef=\"displayedColumns(); sticky: true\" [style.display]=\"showFooter() ? '' : 'none'\"></tr>\n </table>\n</form>\n\n@if (loadingService.loading()) {\n <div class=\"table-overlay\" [style.--header-h.px]=\"headerHeightPx()\" [style.--scroll-h.px]=\"scrollHeightPx()\" [style.--footer-h.px]=\"footerHeightPx()\">\n <mat-spinner></mat-spinner>\n </div>\n}\n\n@if (emptyStateService.enabled() && !loadingService.loading() && isEmpty()) {\n <div\n class=\"table-empty-state-overlay\"\n [style.--header-h.px]=\"headerHeightPx()\"\n [style.--scroll-h.px]=\"scrollHeightPx()\"\n [style.--footer-h.px]=\"footerHeightPx()\"\n >\n <div class=\"table-empty-state-content\">\n @if (emptyStateService.component === emptyStateComponent) {\n <kles-table-empty-state (refreshRequested)=\"refresh()\"></kles-table-empty-state>\n } @else {\n <ng-container *ngComponentOutlet=\"emptyStateService.component\"></ng-container>\n }\n </div>\n </div>\n}\n", styles: [":host{--kles-table-divider-color: color-mix(in srgb, var(--mat-sys-outline-variant) 65%, transparent);--kles-table-divider-strong-color: var(--mat-sys-outline-variant);--kles-table-header-background: var(--mat-sys-surface-container);--kles-table-header-color: var(--mat-sys-on-surface);--kles-table-header-divider-color: var(--mat-sys-outline-variant);--kles-table-row-hover-background: color-mix(in srgb, var(--mat-sys-primary) 4%, var(--mat-sys-surface));--kles-table-row-selected-background: color-mix(in srgb, var(--mat-sys-primary) 7%, var(--mat-sys-surface));--kles-table-row-selected-hover-background: color-mix(in srgb, var(--mat-sys-primary) 10%, var(--mat-sys-surface));--kles-table-row-selected-indicator-color: var(--mat-sys-primary);overflow:auto;display:flex;flex-direction:column;position:relative;height:100%;--mat-form-field-filled-container-color: transparent;--mat-form-field-hover-state-layer-opacity: 0;--mat-form-field-focus-state-layer-opacity: 0;--mat-form-field-state-layer-color: transparent}:host(.loading),:host(.empty){min-height:280px}form{display:flex;flex-direction:column;flex-grow:1;position:relative;overflow:auto;scroll-timeline-name:--kles-table-horizontal-scroll;scroll-timeline-axis:inline}.kles-row-pointer{cursor:pointer}.kles-keyboard-cell:focus-visible{outline:2px solid var(--mat-sys-primary, Highlight);outline-offset:-2px}.kles-grid-entry{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.kles-grid-entry:focus-visible{top:4px;left:4px;z-index:10;width:auto;height:auto;padding:8px 12px;clip-path:none;background:var(--mat-sys-surface, white);color:var(--mat-sys-on-surface, black);outline:2px solid var(--mat-sys-primary, Highlight)}table{width:100%;flex-grow:1}th,td{text-wrap:pretty;white-space:normal;padding-top:2px;padding-bottom:2px;box-sizing:border-box}td{word-break:normal}:host td.kles-extra-row-cell{padding:0}.kles-extra-row-content--viewport{box-sizing:border-box;animation:kles-extra-row-horizontal-scroll 1ms linear both paused}@supports (animation-timeline: scroll()){.kles-extra-row-content--viewport{animation-play-state:running;animation-timeline:--kles-table-horizontal-scroll}}@keyframes kles-extra-row-horizontal-scroll{0%{transform:translate(0)}to{transform:translate(var(--kles-table-horizontal-scroll-range, 0px))}}th .cell,td .cell{display:flex;flex-direction:column;justify-content:var(--align, center)}th[appResizableColumn].resizable-column{position:relative}th[appResizableColumn]>.resize-handle{position:absolute;top:0;inset-inline-end:-7px;z-index:20;width:14px;height:100%;cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;outline:none}th[appResizableColumn]>.resize-handle:before{content:\"\";position:absolute;top:15%;bottom:15%;inset-inline-start:6px;width:2px;border-radius:2px;background:var(--mat-sys-outline);opacity:0;transition:opacity .12s ease,background-color .12s ease,transform .12s ease}th[appResizableColumn].resizable-column:hover>.resize-handle:before,th[appResizableColumn]>.resize-handle:focus-visible:before{opacity:.65}th[appResizableColumn].column-resizing>.resize-handle:before{top:0;bottom:0;background:var(--mat-sys-primary);opacity:1;transform:scaleX(1.25)}th[appResizableColumn].column-resizing>.resize-handle:after{content:\"\";position:absolute;top:100%;inset-inline-start:6px;width:2px;height:100vh;background:color-mix(in srgb,var(--mat-sys-primary) 70%,transparent);pointer-events:none}th[appResizableColumn]>.resize-handle>.resize-width-label{position:absolute;top:calc(100% + 8px);inset-inline-start:50%;z-index:30;display:none;padding:3px 7px;color:var(--mat-sys-on-primary);font-size:11px;font-weight:600;line-height:16px;white-space:nowrap;background:var(--mat-sys-primary);border-radius:var(--mat-sys-corner-extra-small);box-shadow:var(--mat-sys-level2);transform:translate(-50%);pointer-events:none}th[appResizableColumn].column-resizing>.resize-handle>.resize-width-label{display:block}:host .column-resizing-cell{width:var(--kles-column-resize-width)!important;min-width:var(--kles-column-resize-width)!important;max-width:var(--kles-column-resize-width)!important;flex:0 0 var(--kles-column-resize-width)!important;background-image:linear-gradient(color-mix(in srgb,var(--mat-sys-primary) 5%,transparent),color-mix(in srgb,var(--mat-sys-primary) 5%,transparent))}.table-overlay{position:absolute;inset-inline:0;top:var(--header-h, 56px);bottom:calc(var(--scroll-h, 0px) + var(--footer-h, 0px));display:grid;place-items:center;background:color-mix(in srgb,var(--mat-sys-surface-container-highest) 75%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--mat-sys-outline-variant) 30%,transparent);z-index:500}:host .mat-mdc-row:not(.kles-extra-row){transition:background-color .12s ease}:host .mat-mdc-row:not(.kles-extra-row):hover{background:var(--kles-table-row-hover-background)}:host .mat-mdc-row:not(.kles-extra-row).kles-row-selected{background:var(--kles-table-row-selected-background);box-shadow:inset 3px 0 0 var(--kles-table-row-selected-indicator-color)}:host .mat-mdc-row:not(.kles-extra-row).kles-row-selected:hover{background:var(--kles-table-row-selected-hover-background)}:host tr.mat-mdc-row.cdk-drag-placeholder{opacity:1;background:color-mix(in srgb,var(--mat-sys-primary) 12%,var(--mat-sys-surface))!important}:host tr.mat-mdc-row.cdk-drag-placeholder td{border-block:2px dashed var(--mat-sys-primary)}:host tr.mat-mdc-row.cdk-drag-placeholder td>*{visibility:hidden}:host tr.mat-mdc-row.cdk-drag-placeholder td:first-child{border-inline-start:2px dashed var(--mat-sys-primary)}:host tr.mat-mdc-row.cdk-drag-placeholder td:last-child{border-inline-end:2px dashed var(--mat-sys-primary)}:host .cdk-drop-list-dragging tr.mat-mdc-row:not(.cdk-drag-placeholder),:host tr.mat-mdc-row.cdk-drag-animating{transition:transform .18s cubic-bezier(0,0,.2,1)}:host .kles-column-drop-list.cdk-drop-list-dragging .mat-mdc-header-cell:not(.cdk-drag-placeholder),:host .mat-mdc-header-cell.cdk-drag-animating{transition:transform .18s cubic-bezier(0,0,.2,1)}:host .mat-mdc-header-cell.cdk-drag-placeholder{opacity:.25}.mat-mdc-header-cell.cdk-drag-preview{box-sizing:border-box;background:var(--kles-table-header-background);color:var(--kles-table-header-color);box-shadow:var(--mat-sys-level3)}.kles-row-drag-preview{overflow:hidden;border-radius:var(--mat-sys-corner-small);background:var(--mat-sys-surface-container);box-shadow:var(--mat-sys-level3)}.selection-row-spinner{margin-inline:auto}:host tr.kles-row-drag-placeholder td{padding:0;border:2px dashed var(--mat-sys-primary);background:color-mix(in srgb,var(--mat-sys-primary) 12%,var(--mat-sys-surface))}:host .mat-mdc-table .mat-mdc-cell,:host .mat-mdc-table .mat-mdc-header-cell{border-bottom-color:var(--mat-sys-outline-variant)}:host .mat-mdc-table .mat-mdc-cell:last-child,:host .mat-mdc-table .mat-mdc-header-cell:last-child{border-right:none}:host tr.mat-mdc-footer-row td.mat-mdc-footer-cell{border-top:1px solid var(--kles-table-divider-strong-color)}:host tr.mat-mdc-row:last-of-type td.mat-mdc-cell{border-bottom:1px solid var(--kles-table-divider-color)}:host tr.mat-mdc-footer-row{font-weight:500}:host .mat-mdc-header-row,:host .mat-mdc-header-cell{background-color:var(--kles-table-header-background);color:var(--kles-table-header-color)}:host .mat-mdc-header-cell{border-bottom-color:var(--kles-table-header-divider-color)}.table-empty-state-overlay{position:absolute;inset-inline:0;top:var(--header-h, 56px);bottom:calc(var(--scroll-h, 0px) + var(--footer-h, 0px));z-index:400;overflow-x:hidden;overflow-y:auto;container-type:size;container-name:kles-empty-state;background:var(--mat-sys-surface);display:grid;place-items:center}.table-empty-state-content{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-height:100%;padding:16px;box-sizing:border-box}@container kles-empty-state (max-height: 220px){.table-empty-state-content{padding:8px}}.scrollbar-hidden{scrollbar-width:none;-ms-overflow-style:none;overflow-y:hidden}.scrollbar-hidden::-webkit-scrollbar{display:none;overflow-y:hidden}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i18.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i18.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: i18.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i19.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i19.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i19.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i19.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i4.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i21.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i21.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i21.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i21.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i21.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i21.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i21.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i21.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i21.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i21.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i21.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i21.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: CdkTableModule }, { kind: "directive", type: i22.CdkCellDef, selector: "[cdkCellDef]" }, { kind: "directive", type: i22.CdkColumnDef, selector: "[cdkColumnDef]", inputs: ["cdkColumnDef", "sticky", "stickyEnd"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i23.CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "ngmodule", type: KlesMaterialDynamicformsModule }, { kind: "directive", type: i24.KlesDynamicFieldDirective, selector: "[klesDynamicField]", inputs: ["field", "group", "ui", "siblingFields", "context"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i25.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: i25.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: "directive", type: i25.CdkDragPreview, selector: "ng-template[cdkDragPreview]", inputs: ["data", "matchSize"] }, { kind: "directive", type: i25.CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: ["data"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i26.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: ResizableColumnDirective, selector: "th[appResizableColumn]", inputs: ["appResizableColumn"] }, { kind: "component", type: KlesCellComponent, selector: "kles-cell", inputs: ["ui", "group", "column", "rowIndex", "dragHandle"] }, { kind: "component", type: KlesHeaderComponent, selector: "kles-header", inputs: ["header", "group", "dragHandleSpacer", "columnDragHandle"] }, { kind: "directive", type: KeyboardGridDirective, selector: "table[klesKeyboardGrid]", exportAs: ["klesKeyboardGrid"] }, { kind: "directive", type: KeyboardCellDirective, selector: "td[klesKeyboardCell]", inputs: ["klesKeyboardCell", "columnDef"] }, { kind: "component", type: KlesTableEmptyStateComponent, selector: "kles-table-empty-state", outputs: ["refreshRequested"] }, { kind: "pipe", type: HeaderFieldPipe, name: "headerField" }, { kind: "pipe", type: CellFieldPipe, name: "cellField" }, { kind: "pipe", type: UiFieldPipe, name: "uiField" }, { kind: "pipe", type: FooterFieldPipe, name: "footerField" }, { kind: "pipe", type: SpanPipe, name: "spanPipe" }, { kind: "pipe", type: ExtraCellFieldPipe, name: "extraCellField" }, { kind: "pipe", type: ResolveNgStylePipe, name: "resolveNgStyle" }, { kind: "pipe", type: HeaderPipe, name: "header" }, { kind: "pipe", type: RowContextPipe, name: "rowContext" }, { kind: "pipe", type: ResolveRowStylePipe, name: "resolveRowStyle" }, { kind: "pipe", type: ResolveRowClassPipe, name: "resolveRowClass" }] }); }
3111
3487
  }
3112
3488
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableComponent, decorators: [{
3113
3489
  type: Component,
@@ -3140,7 +3516,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
3140
3516
  RowContextPipe,
3141
3517
  ResolveRowStylePipe,
3142
3518
  ResolveRowClassPipe,
3143
- ], template: "<form #form cdkScrollable [formGroup]=\"tableService.form\">\n <table\n mat-table\n [dataSource]=\"dataSource\"\n matSort\n [trackBy]=\"multiTemplateDataRows() ? identityTrackBy : tableService.trackBy\"\n formArrayName=\"rows\"\n cdkDropList\n [id]=\"dragDropRowService.dropListId\"\n [cdkDropListData]=\"tableService.klesForm\"\n (cdkDropListDropped)=\"dragDropRowService.listDropped($event)\"\n [cdkDropListDisabled]=\"!dragDropRowService.enable\"\n [cdkDropListAutoScrollStep]=\"dragDropRowService.autoScrollStep\"\n [cdkDropListSortPredicate]=\"dragDropRowService.sortPredicate\"\n [cdkDropListConnectedTo]=\"dragDropRowService.connectedTo ?? []\"\n [multiTemplateDataRows]=\"multiTemplateDataRows()\"\n >\n <colgroup>\n @for (column of columns(); track column.columnDef) {\n <col\n [attr.data-column-def]=\"column.columnDef\"\n [style.width]=\"column.width ?? null\"\n [style.minWidth]=\"column.minWidth ?? null\"\n [style.maxWidth]=\"column.maxWidth ?? null\"\n />\n }\n </colgroup>\n\n @for (column of columns(); track column.columnDef) {\n <ng-container [cdkColumnDef]=\"column.columnDef\" [sticky]=\"column.sticky ?? false\" [stickyEnd]=\"column.stickyEnd ?? false\">\n <th\n mat-header-cell\n *matHeaderCellDef\n cdkDrag\n cdkDragLockAxis=\"x\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"columnDragDropService.isDragDisabled(column)\"\n [appResizableColumn]=\"column\"\n [style.border-inline-end]=\"getColumnSeparator(column, 'header') ?? getStickyStartSeparator(column, 'header')\"\n [style.border-inline-start]=\"getStickyEndSeparator(column, 'header')\"\n [ngStyle]=\"\n $safeNavigationMigration(column.headerCell?.style?.ngStyle)\n | resolveNgStyle\n : $safeNavigationMigration(tableService.form.get(['header', column.columnDef])?.value)\n : $safeNavigationMigration(tableService.form.get(['header', column.columnDef])?.status)\n : tableService.form.controls.header.value\n : tableService.form.controls.header.status\n \"\n >\n <div class=\"cell\">\n <kles-header\n [header]=\"(column | header)!\"\n [group]=\"tableService.form.controls.header\"\n [columnDragHandle]=\"columnDragDropService.enable && !columnDragDropService.isDragDisabled(column)\"\n [dragHandleSpacer]=\"dragDropRowService.handleOnly && column.columnDef === displayedColumns()?.[0]\"\n >\n <ng-container\n klesDynamicField\n [field]=\"(column | headerField)!\"\n [group]=\"tableService.form.controls.header\"\n [ui]=\"tableService.ui.states.header\"\n ></ng-container>\n </kles-header>\n </div>\n </th>\n\n <td\n mat-cell\n *cdkCellDef=\"let row; let index = index; let dataIndex = dataIndex\"\n [style.border-inline-end]=\"getColumnSeparator(column, 'body') ?? getStickyStartSeparator(column, 'body')\"\n [style.border-inline-start]=\"getStickyEndSeparator(column, 'body')\"\n [ngStyle]=\"\n $safeNavigationMigration(column.cell?.style?.ngStyle)\n | resolveNgStyle: row.controls[column.columnDef].value : row.controls[column.columnDef].status : row.value : row.status\n \"\n (click)=\"cellService.onClick($event, row, dataIndex ?? index, column.columnDef)\"\n (dblclick)=\"cellService.onDoubleClick($event, row, dataIndex ?? index, column.columnDef)\"\n (contextmenu)=\"cellService.onContextMenu($event, row, dataIndex ?? index, column.columnDef)\"\n >\n <div class=\"cell\" [style.--align]=\"column.align\">\n <kles-cell\n [group]=\"row\"\n [ui]=\"(row | uiField)!\"\n [column]=\"column\"\n [rowIndex]=\"dataIndex ?? index\"\n [dragHandle]=\"dragDropRowService.handleOnly && column.columnDef === displayedColumns()?.[0]\"\n >\n @if (column.columnDef === selectionService.key && selectionService.isLoading(row)) {\n <mat-spinner class=\"selection-row-spinner\" [diameter]=\"20\"></mat-spinner>\n } @else {\n <ng-container\n klesDynamicField\n [field]=\"(column | cellField)!\"\n [group]=\"row\"\n [ui]=\"(row | uiField)!\"\n [context]=\"row | rowContext\"\n ></ng-container>\n }\n </kles-cell>\n </div>\n </td>\n\n <td\n mat-footer-cell\n *matFooterCellDef\n [style.border-inline-end]=\"getColumnSeparator(column, 'footer') ?? getStickyStartSeparator(column, 'footer')\"\n [style.border-inline-start]=\"getStickyEndSeparator(column, 'footer')\"\n [ngStyle]=\"\n $safeNavigationMigration(column.footerCell?.style?.ngStyle)\n | resolveNgStyle\n : $safeNavigationMigration(tableService.form.get(['footer', column.columnDef])?.value)\n : $safeNavigationMigration(tableService.form.get(['footer', column.columnDef])?.status)\n : tableService.form.controls.footer.value\n : tableService.form.controls.footer.status\n \"\n >\n @if (column.footerCell) {\n <ng-container\n klesDynamicField\n [field]=\"(column | footerField)!\"\n [group]=\"tableService.form.controls.footer\"\n [ui]=\"tableService.ui.states.footer\"\n >\n </ng-container>\n }\n </td>\n </ng-container>\n }\n\n <tr\n mat-header-row\n class=\"kles-column-drop-list\"\n *matHeaderRowDef=\"displayedColumns(); sticky: true\"\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n [cdkDropListData]=\"columnDragDropService.visibleColumns()\"\n [cdkDropListDisabled]=\"!columnDragDropService.enable\"\n [cdkDropListAutoScrollDisabled]=\"true\"\n [cdkDropListSortPredicate]=\"columnDragDropService.sortPredicate\"\n (cdkDropListDropped)=\"columnDragDropService.listDropped($event)\"\n ></tr>\n\n <tr\n mat-row\n *matRowDef=\"let row; let index = index; let dataIndex = dataIndex; columns: displayedColumns()\"\n [class.kles-row-selected]=\"isRowSelected(row)\"\n cdkDrag\n [cdkDragData]=\"row\"\n [cdkDragDisabled]=\"dragDropRowService.isDragDisabled(row)\"\n [ngStyle]=\"rowAppearance.rowStyle | resolveRowStyle: row.value : row.status : (dataIndex ?? index) : getRowContext(row)\"\n [ngClass]=\"rowAppearance.rowClass | resolveRowClass: row.value : row.status : (dataIndex ?? index) : getRowContext(row)\"\n (cdkDragStarted)=\"dragDropRowService.rowDragStarted(row, dataIndex ?? index)\"\n (cdkDragMoved)=\"dragDropRowService.rowDragMoved(row, dataIndex ?? index)\"\n (cdkDragEnded)=\"dragDropRowService.rowDragEnded(row, dataIndex ?? index)\"\n (click)=\"rowService.onClick($event, row, dataIndex ?? index)\"\n (dblclick)=\"rowService.onDoubleClick($event, row, dataIndex ?? index)\"\n (contextmenu)=\"rowService.onContextMenu($event, row, dataIndex ?? index)\"\n (mouseenter)=\"rowService.onMouseEnter($event, row, dataIndex ?? index)\"\n (mouseleave)=\"rowService.onMouseLeave($event, row, dataIndex ?? index)\"\n >\n @if (dragDropRowService.previewComponent; as previewComponent) {\n <ng-template cdkDragPreview [matchSize]=\"dragDropRowService.previewMatchSize\">\n <div class=\"kles-row-drag-preview\">\n <ng-container\n *ngComponentOutlet=\"previewComponent; injector: dragDropRowService.componentInjector(row, dataIndex ?? index)\"\n ></ng-container>\n </div>\n </ng-template>\n }\n\n @if (dragDropRowService.placeholderComponent; as placeholderComponent) {\n <ng-template cdkDragPlaceholder>\n <tr class=\"kles-row-drag-placeholder\">\n <td [attr.colspan]=\"displayedColumns()?.length ?? 1\">\n <ng-container\n *ngComponentOutlet=\"placeholderComponent; injector: dragDropRowService.componentInjector(row, dataIndex ?? index)\"\n ></ng-container>\n </td>\n </tr>\n </ng-template>\n }\n </tr>\n\n @if (multiTemplateDataRows()) {\n @for (extraRow of extraRows(); track extraRow) {\n @for (extraColumn of extraRow.cells; track extraColumn.columnDef) {\n <ng-container [cdkColumnDef]=\"extraColumn.columnDef\">\n <td\n mat-cell\n class=\"kles-extra-row-cell\"\n *cdkCellDef=\"let row\"\n [attr.colspan]=\"(extraColumn.colspan ?? 1) | spanPipe: displayedColumns().length\"\n [attr.rowspan]=\"extraColumn.rowspan\"\n [ngStyle]=\"\n $safeNavigationMigration(extraColumn?.style?.ngStyle)\n | resolveNgStyle\n : row.controls[extraColumn.columnDef].value\n : row.controls[extraColumn.columnDef].status\n : row.value\n : row.status\n \"\n >\n <div\n class=\"kles-extra-row-content\"\n [class.kles-extra-row-content--viewport]=\"extraRow.width === 'viewport'\"\n [style.width.px]=\"extraRow.width === 'viewport' ? viewportWidthPx() : null\"\n [style.--kles-table-horizontal-scroll-range.px]=\"extraRow.width === 'viewport' ? viewportScrollRangePx() : null\"\n >\n <ng-container\n klesDynamicField\n [field]=\"(extraColumn | extraCellField)!\"\n [group]=\"row\"\n [ui]=\"(row | uiField)!\"\n [context]=\"row | rowContext\"\n ></ng-container>\n </div>\n </td>\n </ng-container>\n }\n <tr\n mat-row\n class=\"kles-extra-row\"\n *matRowDef=\"let row; let index = index; let dataIndex = dataIndex; columns: extraRow.displayedColumns; when: extraRow.when\"\n (click)=\"rowService.onClick($event, row, dataIndex ?? index)\"\n (dblclick)=\"rowService.onDoubleClick($event, row, dataIndex ?? index)\"\n (contextmenu)=\"rowService.onContextMenu($event, row, dataIndex ?? index)\"\n (mouseenter)=\"rowService.onMouseEnter($event, row, dataIndex ?? index)\"\n (mouseleave)=\"rowService.onMouseLeave($event, row, dataIndex ?? index)\"\n ></tr>\n }\n }\n\n <tr mat-footer-row *matFooterRowDef=\"displayedColumns(); sticky: true\" [style.display]=\"showFooter() ? '' : 'none'\"></tr>\n </table>\n</form>\n\n@if (loadingService.loading()) {\n <div class=\"table-overlay\" [style.--header-h.px]=\"headerHeightPx()\" [style.--scroll-h.px]=\"scrollHeightPx()\" [style.--footer-h.px]=\"footerHeightPx()\">\n <mat-spinner></mat-spinner>\n </div>\n}\n\n@if (emptyStateService.enabled() && !loadingService.loading() && isEmpty()) {\n <div\n class=\"table-empty-state-overlay\"\n [style.--header-h.px]=\"headerHeightPx()\"\n [style.--scroll-h.px]=\"scrollHeightPx()\"\n [style.--footer-h.px]=\"footerHeightPx()\"\n >\n <div class=\"table-empty-state-content\">\n <ng-container *ngComponentOutlet=\"emptyStateService.component\"></ng-container>\n </div>\n </div>\n}\n", styles: [":host{--kles-table-divider-color: color-mix(in srgb, var(--mat-sys-outline-variant) 65%, transparent);--kles-table-divider-strong-color: var(--mat-sys-outline-variant);--kles-table-header-background: var(--mat-sys-surface-container);--kles-table-header-color: var(--mat-sys-on-surface);--kles-table-header-divider-color: var(--mat-sys-outline-variant);--kles-table-row-hover-background: color-mix(in srgb, var(--mat-sys-primary) 4%, var(--mat-sys-surface));--kles-table-row-selected-background: color-mix(in srgb, var(--mat-sys-primary) 7%, var(--mat-sys-surface));--kles-table-row-selected-hover-background: color-mix(in srgb, var(--mat-sys-primary) 10%, var(--mat-sys-surface));--kles-table-row-selected-indicator-color: var(--mat-sys-primary);overflow:auto;display:flex;flex-direction:column;position:relative;height:100%;--mat-form-field-filled-container-color: transparent;--mat-form-field-hover-state-layer-opacity: 0;--mat-form-field-focus-state-layer-opacity: 0;--mat-form-field-state-layer-color: transparent}:host(.loading),:host(.empty){min-height:280px}form{display:flex;flex-direction:column;flex-grow:1;position:relative;overflow:auto;scroll-timeline-name:--kles-table-horizontal-scroll;scroll-timeline-axis:inline}table{width:100%;flex-grow:1}th,td{text-wrap:pretty;white-space:normal;padding-top:2px;padding-bottom:2px;box-sizing:border-box}td{word-break:normal}:host td.kles-extra-row-cell{padding:0}.kles-extra-row-content--viewport{box-sizing:border-box;animation:kles-extra-row-horizontal-scroll 1ms linear both paused}@supports (animation-timeline: scroll()){.kles-extra-row-content--viewport{animation-play-state:running;animation-timeline:--kles-table-horizontal-scroll}}@keyframes kles-extra-row-horizontal-scroll{0%{transform:translate(0)}to{transform:translate(var(--kles-table-horizontal-scroll-range, 0px))}}th .cell,td .cell{display:flex;flex-direction:column;justify-content:var(--align, center)}th[appResizableColumn].resizable-column{position:relative}th[appResizableColumn]>.resize-handle{position:absolute;top:0;inset-inline-end:-7px;z-index:20;width:14px;height:100%;cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;outline:none}th[appResizableColumn]>.resize-handle:before{content:\"\";position:absolute;top:15%;bottom:15%;inset-inline-start:6px;width:2px;border-radius:2px;background:var(--mat-sys-outline);opacity:0;transition:opacity .12s ease,background-color .12s ease,transform .12s ease}th[appResizableColumn].resizable-column:hover>.resize-handle:before,th[appResizableColumn]>.resize-handle:focus-visible:before{opacity:.65}th[appResizableColumn].column-resizing>.resize-handle:before{top:0;bottom:0;background:var(--mat-sys-primary);opacity:1;transform:scaleX(1.25)}th[appResizableColumn].column-resizing>.resize-handle:after{content:\"\";position:absolute;top:100%;inset-inline-start:6px;width:2px;height:100vh;background:color-mix(in srgb,var(--mat-sys-primary) 70%,transparent);pointer-events:none}th[appResizableColumn]>.resize-handle>.resize-width-label{position:absolute;top:calc(100% + 8px);inset-inline-start:50%;z-index:30;display:none;padding:3px 7px;color:var(--mat-sys-on-primary);font-size:11px;font-weight:600;line-height:16px;white-space:nowrap;background:var(--mat-sys-primary);border-radius:var(--mat-sys-corner-extra-small);box-shadow:var(--mat-sys-level2);transform:translate(-50%);pointer-events:none}th[appResizableColumn].column-resizing>.resize-handle>.resize-width-label{display:block}:host .column-resizing-cell{width:var(--kles-column-resize-width)!important;min-width:var(--kles-column-resize-width)!important;max-width:var(--kles-column-resize-width)!important;flex:0 0 var(--kles-column-resize-width)!important;background-image:linear-gradient(color-mix(in srgb,var(--mat-sys-primary) 5%,transparent),color-mix(in srgb,var(--mat-sys-primary) 5%,transparent))}.table-overlay{position:absolute;inset-inline:0;top:var(--header-h, 56px);bottom:calc(var(--scroll-h, 0px) + var(--footer-h, 0px));display:grid;place-items:center;background:color-mix(in srgb,var(--mat-sys-surface-container-highest) 75%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--mat-sys-outline-variant) 30%,transparent);z-index:500}:host .mat-mdc-row:not(.kles-extra-row){transition:background-color .12s ease}:host .mat-mdc-row:not(.kles-extra-row):hover{background:var(--kles-table-row-hover-background)}:host .mat-mdc-row:not(.kles-extra-row).kles-row-selected{background:var(--kles-table-row-selected-background);box-shadow:inset 3px 0 0 var(--kles-table-row-selected-indicator-color)}:host .mat-mdc-row:not(.kles-extra-row).kles-row-selected:hover{background:var(--kles-table-row-selected-hover-background)}:host tr.mat-mdc-row.cdk-drag-placeholder{opacity:1;background:color-mix(in srgb,var(--mat-sys-primary) 12%,var(--mat-sys-surface))!important}:host tr.mat-mdc-row.cdk-drag-placeholder td{border-block:2px dashed var(--mat-sys-primary)}:host tr.mat-mdc-row.cdk-drag-placeholder td>*{visibility:hidden}:host tr.mat-mdc-row.cdk-drag-placeholder td:first-child{border-inline-start:2px dashed var(--mat-sys-primary)}:host tr.mat-mdc-row.cdk-drag-placeholder td:last-child{border-inline-end:2px dashed var(--mat-sys-primary)}:host .cdk-drop-list-dragging tr.mat-mdc-row:not(.cdk-drag-placeholder),:host tr.mat-mdc-row.cdk-drag-animating{transition:transform .18s cubic-bezier(0,0,.2,1)}:host .kles-column-drop-list.cdk-drop-list-dragging .mat-mdc-header-cell:not(.cdk-drag-placeholder),:host .mat-mdc-header-cell.cdk-drag-animating{transition:transform .18s cubic-bezier(0,0,.2,1)}:host .mat-mdc-header-cell.cdk-drag-placeholder{opacity:.25}.mat-mdc-header-cell.cdk-drag-preview{box-sizing:border-box;background:var(--kles-table-header-background);color:var(--kles-table-header-color);box-shadow:var(--mat-sys-level3)}.kles-row-drag-preview{overflow:hidden;border-radius:var(--mat-sys-corner-small);background:var(--mat-sys-surface-container);box-shadow:var(--mat-sys-level3)}.selection-row-spinner{margin-inline:auto}:host tr.kles-row-drag-placeholder td{padding:0;border:2px dashed var(--mat-sys-primary);background:color-mix(in srgb,var(--mat-sys-primary) 12%,var(--mat-sys-surface))}:host .mat-mdc-table .mat-mdc-cell,:host .mat-mdc-table .mat-mdc-header-cell{border-bottom-color:var(--mat-sys-outline-variant)}:host .mat-mdc-table .mat-mdc-cell:last-child,:host .mat-mdc-table .mat-mdc-header-cell:last-child{border-right:none}:host tr.mat-mdc-footer-row td.mat-mdc-footer-cell{border-top:1px solid var(--kles-table-divider-strong-color)}:host tr.mat-mdc-row:last-of-type td.mat-mdc-cell{border-bottom:1px solid var(--kles-table-divider-color)}:host tr.mat-mdc-footer-row{font-weight:500}:host .mat-mdc-header-row,:host .mat-mdc-header-cell{background-color:var(--kles-table-header-background);color:var(--kles-table-header-color)}:host .mat-mdc-header-cell{border-bottom-color:var(--kles-table-header-divider-color)}.table-empty-state-overlay{position:absolute;inset-inline:0;top:var(--header-h, 56px);bottom:calc(var(--scroll-h, 0px) + var(--footer-h, 0px));z-index:400;overflow:hidden;background:var(--mat-sys-surface);display:grid;place-items:center}.table-empty-state-content{width:100%;height:100%}.scrollbar-hidden{scrollbar-width:none;-ms-overflow-style:none;overflow-y:hidden}.scrollbar-hidden::-webkit-scrollbar{display:none;overflow-y:hidden}\n"] }]
3519
+ KeyboardGridDirective,
3520
+ KeyboardCellDirective,
3521
+ KlesTableEmptyStateComponent,
3522
+ ], template: "<form\n #form\n cdkScrollable\n [formGroup]=\"tableService.form\"\n [style.scroll-padding-top.px]=\"keyboardGrid.navigation.enabled ? headerHeightPx() : null\"\n [style.scroll-padding-bottom.px]=\"keyboardGrid.navigation.enabled && showFooter() ? footerHeightPx() : null\"\n>\n @if (keyboardGrid.navigation.enabled && !isEmpty()) {\n <button type=\"button\" class=\"kles-grid-entry\" (click)=\"keyboardGrid.navigation.focusActive()\">\n {{ intl.keyboardNavigationEntryLabel }}\n </button>\n }\n <table\n mat-table\n klesKeyboardGrid\n #keyboardGrid=\"klesKeyboardGrid\"\n [dataSource]=\"dataSource\"\n matSort\n [trackBy]=\"multiTemplateDataRows() ? identityTrackBy : tableService.trackBy\"\n formArrayName=\"rows\"\n cdkDropList\n [id]=\"dragDropRowService.dropListId\"\n [cdkDropListData]=\"tableService.klesForm\"\n (cdkDropListDropped)=\"dragDropRowService.listDropped($event)\"\n [cdkDropListDisabled]=\"!dragDropRowService.enable\"\n [cdkDropListAutoScrollStep]=\"dragDropRowService.autoScrollStep\"\n [cdkDropListSortPredicate]=\"dragDropRowService.sortPredicate\"\n [cdkDropListConnectedTo]=\"dragDropRowService.connectedTo ?? []\"\n [multiTemplateDataRows]=\"multiTemplateDataRows()\"\n >\n <colgroup>\n @for (column of columns(); track column.columnDef) {\n <col\n [attr.data-column-def]=\"column.columnDef\"\n [style.width]=\"column.width ?? null\"\n [style.minWidth]=\"column.minWidth ?? null\"\n [style.maxWidth]=\"column.maxWidth ?? null\"\n />\n }\n </colgroup>\n\n @for (column of columns(); track column.columnDef) {\n <ng-container [cdkColumnDef]=\"column.columnDef\" [sticky]=\"column.sticky ?? false\" [stickyEnd]=\"column.stickyEnd ?? false\">\n <th\n mat-header-cell\n *matHeaderCellDef\n cdkDrag\n cdkDragLockAxis=\"x\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"columnDragDropService.isDragDisabled(column)\"\n [appResizableColumn]=\"column\"\n [style.border-inline-end]=\"getColumnSeparator(column, 'header') ?? getStickyStartSeparator(column, 'header')\"\n [style.border-inline-start]=\"getStickyEndSeparator(column, 'header')\"\n [ngStyle]=\"\n $safeNavigationMigration(column.headerCell?.style?.ngStyle)\n | resolveNgStyle\n : $safeNavigationMigration(tableService.form.get(['header', column.columnDef])?.value)\n : $safeNavigationMigration(tableService.form.get(['header', column.columnDef])?.status)\n : tableService.form.controls.header.value\n : tableService.form.controls.header.status\n \"\n >\n <div class=\"cell\">\n <kles-header\n [header]=\"(column | header)!\"\n [group]=\"tableService.form.controls.header\"\n [columnDragHandle]=\"columnDragDropService.enable && !columnDragDropService.isDragDisabled(column)\"\n [dragHandleSpacer]=\"dragDropRowService.handleOnly && column.columnDef === displayedColumns()?.[0]\"\n >\n <ng-container\n klesDynamicField\n [field]=\"(column | headerField)!\"\n [group]=\"tableService.form.controls.header\"\n [ui]=\"tableService.ui.states.header\"\n ></ng-container>\n </kles-header>\n </div>\n </th>\n\n <td\n mat-cell\n *cdkCellDef=\"let row; let index = index; let dataIndex = dataIndex\"\n [klesKeyboardCell]=\"row\"\n [columnDef]=\"column.columnDef\"\n [style.border-inline-end]=\"getColumnSeparator(column, 'body') ?? getStickyStartSeparator(column, 'body')\"\n [style.border-inline-start]=\"getStickyEndSeparator(column, 'body')\"\n [ngStyle]=\"\n $safeNavigationMigration(column.cell?.style?.ngStyle)\n | resolveNgStyle: row.controls[column.columnDef].value : row.controls[column.columnDef].status : row.value : row.status\n \"\n (click)=\"cellService.onClick($event, row, dataIndex ?? index, column.columnDef)\"\n (dblclick)=\"cellService.onDoubleClick($event, row, dataIndex ?? index, column.columnDef)\"\n (contextmenu)=\"cellService.onContextMenu($event, row, dataIndex ?? index, column.columnDef)\"\n >\n <div class=\"cell\" [style.--align]=\"column.align\">\n <kles-cell\n [group]=\"row\"\n [ui]=\"(row | uiField)!\"\n [column]=\"column\"\n [rowIndex]=\"dataIndex ?? index\"\n [dragHandle]=\"dragDropRowService.handleOnly && column.columnDef === displayedColumns()?.[0]\"\n >\n @if (column.columnDef === selectionService.key && selectionService.isLoading(row)) {\n <mat-spinner class=\"selection-row-spinner\" [diameter]=\"20\"></mat-spinner>\n } @else {\n <ng-container\n klesDynamicField\n [field]=\"(column | cellField)!\"\n [group]=\"row\"\n [ui]=\"(row | uiField)!\"\n [context]=\"row | rowContext\"\n ></ng-container>\n }\n </kles-cell>\n </div>\n </td>\n\n <td\n mat-footer-cell\n *matFooterCellDef\n [style.border-inline-end]=\"getColumnSeparator(column, 'footer') ?? getStickyStartSeparator(column, 'footer')\"\n [style.border-inline-start]=\"getStickyEndSeparator(column, 'footer')\"\n [ngStyle]=\"\n $safeNavigationMigration(column.footerCell?.style?.ngStyle)\n | resolveNgStyle\n : $safeNavigationMigration(tableService.form.get(['footer', column.columnDef])?.value)\n : $safeNavigationMigration(tableService.form.get(['footer', column.columnDef])?.status)\n : tableService.form.controls.footer.value\n : tableService.form.controls.footer.status\n \"\n >\n @if (column.footerCell) {\n <ng-container\n klesDynamicField\n [field]=\"(column | footerField)!\"\n [group]=\"tableService.form.controls.footer\"\n [ui]=\"tableService.ui.states.footer\"\n >\n </ng-container>\n }\n </td>\n </ng-container>\n }\n\n <tr\n mat-header-row\n class=\"kles-column-drop-list\"\n *matHeaderRowDef=\"displayedColumns(); sticky: true\"\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n [cdkDropListData]=\"columnDragDropService.visibleColumns()\"\n [cdkDropListDisabled]=\"!columnDragDropService.enable\"\n [cdkDropListAutoScrollDisabled]=\"true\"\n [cdkDropListSortPredicate]=\"columnDragDropService.sortPredicate\"\n (cdkDropListDropped)=\"columnDragDropService.listDropped($event)\"\n ></tr>\n\n <tr\n mat-row\n *matRowDef=\"let row; let index = index; let dataIndex = dataIndex; columns: displayedColumns()\"\n [class.kles-row-selected]=\"isRowSelected(row)\"\n [class.kles-row-pointer]=\"cursorService.isPointer(row)\"\n cdkDrag\n [cdkDragData]=\"row\"\n [cdkDragDisabled]=\"dragDropRowService.isDragDisabled(row)\"\n [ngStyle]=\"rowAppearance.rowStyle | resolveRowStyle: row.value : row.status : (dataIndex ?? index) : getRowContext(row)\"\n [ngClass]=\"rowAppearance.rowClass | resolveRowClass: row.value : row.status : (dataIndex ?? index) : getRowContext(row)\"\n (cdkDragStarted)=\"dragDropRowService.rowDragStarted(row, dataIndex ?? index)\"\n (cdkDragMoved)=\"dragDropRowService.rowDragMoved(row, dataIndex ?? index)\"\n (cdkDragEnded)=\"dragDropRowService.rowDragEnded(row, dataIndex ?? index)\"\n (click)=\"rowService.onClick($event, row, dataIndex ?? index)\"\n (dblclick)=\"rowService.onDoubleClick($event, row, dataIndex ?? index)\"\n (contextmenu)=\"rowService.onContextMenu($event, row, dataIndex ?? index)\"\n (mouseenter)=\"rowService.onMouseEnter($event, row, dataIndex ?? index)\"\n (mouseleave)=\"rowService.onMouseLeave($event, row, dataIndex ?? index)\"\n >\n @if (dragDropRowService.previewComponent; as previewComponent) {\n <ng-template cdkDragPreview [matchSize]=\"dragDropRowService.previewMatchSize\">\n <div class=\"kles-row-drag-preview\">\n <ng-container\n *ngComponentOutlet=\"previewComponent; injector: dragDropRowService.componentInjector(row, dataIndex ?? index)\"\n ></ng-container>\n </div>\n </ng-template>\n }\n\n @if (dragDropRowService.placeholderComponent; as placeholderComponent) {\n <ng-template cdkDragPlaceholder>\n <tr class=\"kles-row-drag-placeholder\">\n <td [attr.colspan]=\"displayedColumns()?.length ?? 1\">\n <ng-container\n *ngComponentOutlet=\"placeholderComponent; injector: dragDropRowService.componentInjector(row, dataIndex ?? index)\"\n ></ng-container>\n </td>\n </tr>\n </ng-template>\n }\n </tr>\n\n @if (multiTemplateDataRows()) {\n @for (extraRow of extraRows(); track extraRow) {\n @for (extraColumn of extraRow.cells; track extraColumn.columnDef) {\n <ng-container [cdkColumnDef]=\"extraColumn.columnDef\">\n <td\n mat-cell\n class=\"kles-extra-row-cell\"\n *cdkCellDef=\"let row\"\n [attr.colspan]=\"(extraColumn.colspan ?? 1) | spanPipe: displayedColumns().length\"\n [attr.rowspan]=\"extraColumn.rowspan\"\n [ngStyle]=\"\n $safeNavigationMigration(extraColumn?.style?.ngStyle)\n | resolveNgStyle\n : row.controls[extraColumn.columnDef].value\n : row.controls[extraColumn.columnDef].status\n : row.value\n : row.status\n \"\n >\n <div\n class=\"kles-extra-row-content\"\n [class.kles-extra-row-content--viewport]=\"extraRow.width === 'viewport'\"\n [style.width.px]=\"extraRow.width === 'viewport' ? viewportWidthPx() : null\"\n [style.--kles-table-horizontal-scroll-range.px]=\"extraRow.width === 'viewport' ? viewportScrollRangePx() : null\"\n >\n <ng-container\n klesDynamicField\n [field]=\"(extraColumn | extraCellField)!\"\n [group]=\"row\"\n [ui]=\"(row | uiField)!\"\n [context]=\"row | rowContext\"\n ></ng-container>\n </div>\n </td>\n </ng-container>\n }\n <tr\n mat-row\n class=\"kles-extra-row\"\n *matRowDef=\"let row; let index = index; let dataIndex = dataIndex; columns: extraRow.displayedColumns; when: extraRow.when\"\n (click)=\"rowService.onClick($event, row, dataIndex ?? index)\"\n (dblclick)=\"rowService.onDoubleClick($event, row, dataIndex ?? index)\"\n (contextmenu)=\"rowService.onContextMenu($event, row, dataIndex ?? index)\"\n (mouseenter)=\"rowService.onMouseEnter($event, row, dataIndex ?? index)\"\n (mouseleave)=\"rowService.onMouseLeave($event, row, dataIndex ?? index)\"\n ></tr>\n }\n }\n\n <tr mat-footer-row *matFooterRowDef=\"displayedColumns(); sticky: true\" [style.display]=\"showFooter() ? '' : 'none'\"></tr>\n </table>\n</form>\n\n@if (loadingService.loading()) {\n <div class=\"table-overlay\" [style.--header-h.px]=\"headerHeightPx()\" [style.--scroll-h.px]=\"scrollHeightPx()\" [style.--footer-h.px]=\"footerHeightPx()\">\n <mat-spinner></mat-spinner>\n </div>\n}\n\n@if (emptyStateService.enabled() && !loadingService.loading() && isEmpty()) {\n <div\n class=\"table-empty-state-overlay\"\n [style.--header-h.px]=\"headerHeightPx()\"\n [style.--scroll-h.px]=\"scrollHeightPx()\"\n [style.--footer-h.px]=\"footerHeightPx()\"\n >\n <div class=\"table-empty-state-content\">\n @if (emptyStateService.component === emptyStateComponent) {\n <kles-table-empty-state (refreshRequested)=\"refresh()\"></kles-table-empty-state>\n } @else {\n <ng-container *ngComponentOutlet=\"emptyStateService.component\"></ng-container>\n }\n </div>\n </div>\n}\n", styles: [":host{--kles-table-divider-color: color-mix(in srgb, var(--mat-sys-outline-variant) 65%, transparent);--kles-table-divider-strong-color: var(--mat-sys-outline-variant);--kles-table-header-background: var(--mat-sys-surface-container);--kles-table-header-color: var(--mat-sys-on-surface);--kles-table-header-divider-color: var(--mat-sys-outline-variant);--kles-table-row-hover-background: color-mix(in srgb, var(--mat-sys-primary) 4%, var(--mat-sys-surface));--kles-table-row-selected-background: color-mix(in srgb, var(--mat-sys-primary) 7%, var(--mat-sys-surface));--kles-table-row-selected-hover-background: color-mix(in srgb, var(--mat-sys-primary) 10%, var(--mat-sys-surface));--kles-table-row-selected-indicator-color: var(--mat-sys-primary);overflow:auto;display:flex;flex-direction:column;position:relative;height:100%;--mat-form-field-filled-container-color: transparent;--mat-form-field-hover-state-layer-opacity: 0;--mat-form-field-focus-state-layer-opacity: 0;--mat-form-field-state-layer-color: transparent}:host(.loading),:host(.empty){min-height:280px}form{display:flex;flex-direction:column;flex-grow:1;position:relative;overflow:auto;scroll-timeline-name:--kles-table-horizontal-scroll;scroll-timeline-axis:inline}.kles-row-pointer{cursor:pointer}.kles-keyboard-cell:focus-visible{outline:2px solid var(--mat-sys-primary, Highlight);outline-offset:-2px}.kles-grid-entry{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.kles-grid-entry:focus-visible{top:4px;left:4px;z-index:10;width:auto;height:auto;padding:8px 12px;clip-path:none;background:var(--mat-sys-surface, white);color:var(--mat-sys-on-surface, black);outline:2px solid var(--mat-sys-primary, Highlight)}table{width:100%;flex-grow:1}th,td{text-wrap:pretty;white-space:normal;padding-top:2px;padding-bottom:2px;box-sizing:border-box}td{word-break:normal}:host td.kles-extra-row-cell{padding:0}.kles-extra-row-content--viewport{box-sizing:border-box;animation:kles-extra-row-horizontal-scroll 1ms linear both paused}@supports (animation-timeline: scroll()){.kles-extra-row-content--viewport{animation-play-state:running;animation-timeline:--kles-table-horizontal-scroll}}@keyframes kles-extra-row-horizontal-scroll{0%{transform:translate(0)}to{transform:translate(var(--kles-table-horizontal-scroll-range, 0px))}}th .cell,td .cell{display:flex;flex-direction:column;justify-content:var(--align, center)}th[appResizableColumn].resizable-column{position:relative}th[appResizableColumn]>.resize-handle{position:absolute;top:0;inset-inline-end:-7px;z-index:20;width:14px;height:100%;cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;outline:none}th[appResizableColumn]>.resize-handle:before{content:\"\";position:absolute;top:15%;bottom:15%;inset-inline-start:6px;width:2px;border-radius:2px;background:var(--mat-sys-outline);opacity:0;transition:opacity .12s ease,background-color .12s ease,transform .12s ease}th[appResizableColumn].resizable-column:hover>.resize-handle:before,th[appResizableColumn]>.resize-handle:focus-visible:before{opacity:.65}th[appResizableColumn].column-resizing>.resize-handle:before{top:0;bottom:0;background:var(--mat-sys-primary);opacity:1;transform:scaleX(1.25)}th[appResizableColumn].column-resizing>.resize-handle:after{content:\"\";position:absolute;top:100%;inset-inline-start:6px;width:2px;height:100vh;background:color-mix(in srgb,var(--mat-sys-primary) 70%,transparent);pointer-events:none}th[appResizableColumn]>.resize-handle>.resize-width-label{position:absolute;top:calc(100% + 8px);inset-inline-start:50%;z-index:30;display:none;padding:3px 7px;color:var(--mat-sys-on-primary);font-size:11px;font-weight:600;line-height:16px;white-space:nowrap;background:var(--mat-sys-primary);border-radius:var(--mat-sys-corner-extra-small);box-shadow:var(--mat-sys-level2);transform:translate(-50%);pointer-events:none}th[appResizableColumn].column-resizing>.resize-handle>.resize-width-label{display:block}:host .column-resizing-cell{width:var(--kles-column-resize-width)!important;min-width:var(--kles-column-resize-width)!important;max-width:var(--kles-column-resize-width)!important;flex:0 0 var(--kles-column-resize-width)!important;background-image:linear-gradient(color-mix(in srgb,var(--mat-sys-primary) 5%,transparent),color-mix(in srgb,var(--mat-sys-primary) 5%,transparent))}.table-overlay{position:absolute;inset-inline:0;top:var(--header-h, 56px);bottom:calc(var(--scroll-h, 0px) + var(--footer-h, 0px));display:grid;place-items:center;background:color-mix(in srgb,var(--mat-sys-surface-container-highest) 75%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--mat-sys-outline-variant) 30%,transparent);z-index:500}:host .mat-mdc-row:not(.kles-extra-row){transition:background-color .12s ease}:host .mat-mdc-row:not(.kles-extra-row):hover{background:var(--kles-table-row-hover-background)}:host .mat-mdc-row:not(.kles-extra-row).kles-row-selected{background:var(--kles-table-row-selected-background);box-shadow:inset 3px 0 0 var(--kles-table-row-selected-indicator-color)}:host .mat-mdc-row:not(.kles-extra-row).kles-row-selected:hover{background:var(--kles-table-row-selected-hover-background)}:host tr.mat-mdc-row.cdk-drag-placeholder{opacity:1;background:color-mix(in srgb,var(--mat-sys-primary) 12%,var(--mat-sys-surface))!important}:host tr.mat-mdc-row.cdk-drag-placeholder td{border-block:2px dashed var(--mat-sys-primary)}:host tr.mat-mdc-row.cdk-drag-placeholder td>*{visibility:hidden}:host tr.mat-mdc-row.cdk-drag-placeholder td:first-child{border-inline-start:2px dashed var(--mat-sys-primary)}:host tr.mat-mdc-row.cdk-drag-placeholder td:last-child{border-inline-end:2px dashed var(--mat-sys-primary)}:host .cdk-drop-list-dragging tr.mat-mdc-row:not(.cdk-drag-placeholder),:host tr.mat-mdc-row.cdk-drag-animating{transition:transform .18s cubic-bezier(0,0,.2,1)}:host .kles-column-drop-list.cdk-drop-list-dragging .mat-mdc-header-cell:not(.cdk-drag-placeholder),:host .mat-mdc-header-cell.cdk-drag-animating{transition:transform .18s cubic-bezier(0,0,.2,1)}:host .mat-mdc-header-cell.cdk-drag-placeholder{opacity:.25}.mat-mdc-header-cell.cdk-drag-preview{box-sizing:border-box;background:var(--kles-table-header-background);color:var(--kles-table-header-color);box-shadow:var(--mat-sys-level3)}.kles-row-drag-preview{overflow:hidden;border-radius:var(--mat-sys-corner-small);background:var(--mat-sys-surface-container);box-shadow:var(--mat-sys-level3)}.selection-row-spinner{margin-inline:auto}:host tr.kles-row-drag-placeholder td{padding:0;border:2px dashed var(--mat-sys-primary);background:color-mix(in srgb,var(--mat-sys-primary) 12%,var(--mat-sys-surface))}:host .mat-mdc-table .mat-mdc-cell,:host .mat-mdc-table .mat-mdc-header-cell{border-bottom-color:var(--mat-sys-outline-variant)}:host .mat-mdc-table .mat-mdc-cell:last-child,:host .mat-mdc-table .mat-mdc-header-cell:last-child{border-right:none}:host tr.mat-mdc-footer-row td.mat-mdc-footer-cell{border-top:1px solid var(--kles-table-divider-strong-color)}:host tr.mat-mdc-row:last-of-type td.mat-mdc-cell{border-bottom:1px solid var(--kles-table-divider-color)}:host tr.mat-mdc-footer-row{font-weight:500}:host .mat-mdc-header-row,:host .mat-mdc-header-cell{background-color:var(--kles-table-header-background);color:var(--kles-table-header-color)}:host .mat-mdc-header-cell{border-bottom-color:var(--kles-table-header-divider-color)}.table-empty-state-overlay{position:absolute;inset-inline:0;top:var(--header-h, 56px);bottom:calc(var(--scroll-h, 0px) + var(--footer-h, 0px));z-index:400;overflow-x:hidden;overflow-y:auto;container-type:size;container-name:kles-empty-state;background:var(--mat-sys-surface);display:grid;place-items:center}.table-empty-state-content{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-height:100%;padding:16px;box-sizing:border-box}@container kles-empty-state (max-height: 220px){.table-empty-state-content{padding:8px}}.scrollbar-hidden{scrollbar-width:none;-ms-overflow-style:none;overflow-y:hidden}.scrollbar-hidden::-webkit-scrollbar{display:none;overflow-y:hidden}\n"] }]
3144
3523
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: KlesTableConnectorService }, { type: undefined, decorators: [{
3145
3524
  type: Inject,
3146
3525
  args: [LOADER_SERVICE]
@@ -3974,17 +4353,26 @@ class AbstractSelectionService {
3974
4353
  isLoading(row) {
3975
4354
  return this._loadingRows().has(row);
3976
4355
  }
4356
+ canSelectOnRowClick(row) {
4357
+ return !!this.selectionConfig?.selectOnRowClick && this.canSelectRow(row);
4358
+ }
4359
+ canSelectRow(row) {
4360
+ return (!!this.selectionConfig &&
4361
+ !row.controls[this.key]?.disabled &&
4362
+ !this.isLoading(row) &&
4363
+ this.selectionModel.state !== KlesSelectionModelState.DISABLED &&
4364
+ !this.selectionConfig.isDisabled?.(row));
4365
+ }
3977
4366
  onRowClick(event, row) {
3978
- if (!this.selectionConfig?.selectOnRowClick || event.defaultPrevented || this.isInteractiveClick(event)) {
4367
+ if (!this.canSelectOnRowClick(row) || event.defaultPrevented || this.isInteractiveClick(event)) {
3979
4368
  return;
3980
4369
  }
3981
- const control = row.controls[this.key];
3982
- if (control?.disabled ||
3983
- this.isLoading(row) ||
3984
- this.selectionModel.state === KlesSelectionModelState.DISABLED ||
3985
- this.selectionConfig.isDisabled?.(row)) {
4370
+ this.toggleRowSelection(row);
4371
+ }
4372
+ toggleRowSelection(row) {
4373
+ if (!this.canSelectRow(row))
3986
4374
  return;
3987
- }
4375
+ const control = row.controls[this.key];
3988
4376
  const selected = !this.selectionModel.isSelected(row);
3989
4377
  if (control) {
3990
4378
  control.setValue(selected);
@@ -5079,6 +5467,10 @@ class DynamicTableLoaderDirective {
5079
5467
  const emptyState = this.tableConfig().emptyState;
5080
5468
  const emptyStateIntl = typeof emptyState === 'object' && emptyState !== null ? emptyState.intl : undefined;
5081
5469
  const configProviders = [
5470
+ {
5471
+ provide: KEYBOARD_NAVIGATION_CONFIG,
5472
+ useValue: this.tableConfig().keyboardNavigation ?? { enabled: false },
5473
+ },
5082
5474
  {
5083
5475
  provide: COLUMNS,
5084
5476
  useValue: signal(this.tableConfig().columns || []),
@@ -5098,6 +5490,13 @@ class DynamicTableLoaderDirective {
5098
5490
  rowClass: this.tableConfig().rowClass,
5099
5491
  },
5100
5492
  },
5493
+ {
5494
+ provide: ROW_VALIDATION_CONFIG,
5495
+ useValue: {
5496
+ lineValidations: this.tableConfig().lineValidations,
5497
+ lineAsyncValidations: this.tableConfig().lineAsyncValidations,
5498
+ },
5499
+ },
5101
5500
  {
5102
5501
  provide: FOOTER,
5103
5502
  useValue: signal(this.tableConfig().footer ?? false),
@@ -5198,6 +5597,7 @@ class DynamicTableLoaderDirective {
5198
5597
  },
5199
5598
  ];
5200
5599
  const featureProviders = [
5600
+ RowFormFactory,
5201
5601
  TreeService,
5202
5602
  RenderService,
5203
5603
  ExtraRowService,
@@ -5214,6 +5614,7 @@ class DynamicTableLoaderDirective {
5214
5614
  ...(this.tableConfig().infinite ? [InfiniteScrollService] : []),
5215
5615
  EventsService,
5216
5616
  RowService,
5617
+ CursorService,
5217
5618
  CellService,
5218
5619
  CellValueChangeService,
5219
5620
  ValidationService,
@@ -5392,6 +5793,9 @@ class KlesTableComponent {
5392
5793
  get selection() {
5393
5794
  return this.connectorService.selection;
5394
5795
  }
5796
+ get cursor() {
5797
+ return this.connectorService.cursor;
5798
+ }
5395
5799
  get form() {
5396
5800
  return this.connectorService.form;
5397
5801
  }
@@ -5579,5 +5983,5 @@ var AlignCell;
5579
5983
  * Generated bundle index. Do not edit.
5580
5984
  */
5581
5985
 
5582
- export { AlignCell, COLUMNS, COLUMN_DRAG_DROP, DATASOURCE_SERVICE, DRAG_DROP_CONFIG, EMPTY_STATE_CONFIG, EXTRA_ROWS, FOOTER, HEADER_SERVICE, INFINITE_SCROLL_CONFIG, KLES_DRAG_DROP_ROW_CONTEXT, KlesMaterialTableModule, KlesTableComponent, KlesTableEmptyStateComponent, KlesTableFooterStartDirective, KlesTableIntl, LINES_SERVICE, LOADER_CONFIG, LOADER_SERVICE, MULTI_UNFOLD, PAGINATOR_CONFIG, ROW_APPEARANCE_CONFIG, ROW_DRAG_DROP, SCROLLBAR_ORCHESTRATOR_SERVICE, SELECTION_CONFIG, SELECTION_SERVICE, SORT_CONFIG, SORT_SERVICE, Span, TABLE_SERVICE, TableComponent, linesLazyLoader, linesLoader, selectionConfig };
5986
+ export { AlignCell, COLUMNS, COLUMN_DRAG_DROP, CursorService, DATASOURCE_SERVICE, DRAG_DROP_CONFIG, EMPTY_STATE_CONFIG, EXTRA_ROWS, FOOTER, HEADER_SERVICE, INFINITE_SCROLL_CONFIG, KEYBOARD_NAVIGATION_CONFIG, KLES_DRAG_DROP_ROW_CONTEXT, KeyboardCellDirective, KeyboardGridDirective, KlesMaterialTableModule, KlesTableComponent, KlesTableEmptyStateComponent, KlesTableFooterStartDirective, KlesTableIntl, LINES_SERVICE, LOADER_CONFIG, LOADER_SERVICE, MULTI_UNFOLD, PAGINATOR_CONFIG, ROW_APPEARANCE_CONFIG, ROW_DRAG_DROP, ROW_VALIDATION_CONFIG, SCROLLBAR_ORCHESTRATOR_SERVICE, SELECTION_CONFIG, SELECTION_SERVICE, SORT_CONFIG, SORT_SERVICE, Span, TABLE_SERVICE, TableComponent, linesLazyLoader, linesLoader, selectionConfig };
5583
5987
  //# sourceMappingURL=3kles-kles-material-table-v2.mjs.map