UNPKG

@rxap/material-table-system

Version:

This package provides a set of Angular directives, components, and services to enhance and customize Angular Material tables. It includes features such as row selection, column filtering, expandable rows, table actions, and more. The goal is to simplify c

2,321 lines 127 kB
import * as i0 from '@angular/core';
import { InjectionToken, Injectable, Optional, Inject, Component, ChangeDetectionStrategy, isDevMode, Directive, Input, Renderer2, ElementRef, ChangeDetectorRef, ViewContainerRef, INJECTOR, ContentChild, HostListener, Pipe, NgModule, forwardRef, ContentChildren, HostBinding, TemplateRef } from '@angular/core';
import { RXAP_WINDOW_REF } from '@rxap/window-system';
import { map, tap, startWith, debounceTime, distinctUntilChanged, filter } from 'rxjs/operators';
import { hasIdentifierProperty, getIdentifierPropertyValue, clone, DeleteEmptyProperties, equals, coerceArray, coerceBoolean, dasherize } from '@rxap/utilities';
import { Subject, ReplaySubject, Subscription, isObservable, BehaviorSubject, EMPTY } from 'rxjs';
import { AsyncPipe, CommonModule, NgFor, NgClass, NgIf, NgSwitch, NgSwitchCase, NgSwitchDefault, DatePipe } from '@angular/common';
import * as i4 from '@angular/material/button';
import { MatButtonModule, MatIconButton, MatButton, MatMiniFabButton } from '@angular/material/button';
import * as i1$1 from '@angular/cdk/overlay';
import { Overlay } from '@angular/cdk/overlay';
import * as i3$1 from '@angular/material/snack-bar';
import { MatSnackBar } from '@angular/material/snack-bar';
import * as i5 from '@angular/material/tooltip';
import { MatTooltip, MatTooltipModule } from '@angular/material/tooltip';
import { ConfirmDirective, ConfirmModule, CopyToClipboardComponent } from '@rxap/components';
import * as i1 from '@angular/cdk/table';
import { CdkTable } from '@angular/cdk/table';
import * as i3 from '@angular/material/sort';
import { MatSort } from '@angular/material/sort';
import { pipeDataSource } from '@rxap/data-source';
import * as i2 from '@rxap/data-source/table';
import { RXAP_TABLE_METHOD, DynamicTableDataSource } from '@rxap/data-source/table';
export { RXAP_TABLE_METHOD } from '@rxap/data-source/table';
import { ToggleSubject } from '@rxap/rxjs';
import { setMetadata, getMetadata, hasMetadata } from '@rxap/reflect-metadata';
import * as i2$2 from '@angular/material/icon';
import { MatIconModule } from '@angular/material/icon';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import * as i1$4 from '@angular/forms';
import { ControlContainer, NgModel } from '@angular/forms';
import { FormDirective } from '@rxap/forms';
import * as i1$6 from '@angular/material/paginator';
import * as i1$3 from '@angular/material/slide-toggle';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { StopPropagationDirective, BackgroundSizeOptions, BackgroundRepeatOptions, BackgroundPositionOptions, BackgroundImageDirective } from '@rxap/directives';
import * as i4$1 from '@angular/material/checkbox';
import { MatCheckboxModule } from '@angular/material/checkbox';
import * as i2$1 from '@angular/material/menu';
import { MatMenuModule } from '@angular/material/menu';
import * as i1$2 from '@angular/router';
import * as i1$5 from '@angular/cdk/portal';
import { TemplatePortal, PortalModule } from '@angular/cdk/portal';
import { trigger, state, style, transition, animate, sequence } from '@angular/animations';
import { IconDirective } from '@rxap/material-directives/icon';
import { MatOption } from '@angular/material/core';

/**
 * @license
 * Copyright Google LLC All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * Class to be used to power selecting one or more options from a list.
 */
class SelectionModel {
    /** Selected values. */
    get selected() {
        if (!this._selected) {
            this._selected = Array.from(this._selection.values());
        }
        return this._selected;
    }
    constructor(_multiple = false, initiallySelectedValues, _emitChanges = true, compareWith) {
        this._multiple = _multiple;
        this._emitChanges = _emitChanges;
        this.compareWith = compareWith;
        /** Currently-selected values. */
        this._selection = new Set();
        /** Keeps track of the deselected options that haven't been emitted by the change event. */
        this._deselectedToEmit = [];
        /** Keeps track of the selected options that haven't been emitted by the change event. */
        this._selectedToEmit = [];
        /** Cache for the array value of the selected items. */
        this._selected = null;
        /** Event emitted when the value has changed. */
        this.changed = new Subject();
        if (initiallySelectedValues && initiallySelectedValues.length) {
            if (_multiple) {
                initiallySelectedValues.forEach(value => this._markSelected(value));
            }
            else {
                this._markSelected(initiallySelectedValues[0]);
            }
            // Clear the array in order to avoid firing the change event for preselected values.
            this._selectedToEmit.length = 0;
        }
    }
    /**
     * Selects a value or an array of values.
     * @param values The values to select
     * @return Whether the selection changed as a result of this call
     * @breaking-change 16.0.0 make return type boolean
     */
    select(...values) {
        this._verifyValueAssignment(values);
        values.forEach(value => this._markSelected(value));
        const changed = this._hasQueuedChanges();
        this._emitChangeEvent();
        return changed;
    }
    /**
     * Deselects a value or an array of values.
     * @param values The values to deselect
     * @return Whether the selection changed as a result of this call
     * @breaking-change 16.0.0 make return type boolean
     */
    deselect(...values) {
        this._verifyValueAssignment(values);
        values.forEach(value => this._unmarkSelected(value));
        const changed = this._hasQueuedChanges();
        this._emitChangeEvent();
        return changed;
    }
    /**
     * Sets the selected values
     * @param values The new selected values
     * @return Whether the selection changed as a result of this call
     * @breaking-change 16.0.0 make return type boolean
     */
    setSelection(...values) {
        this._verifyValueAssignment(values);
        const oldValues = this.selected;
        const newSelectedSet = new Set(values);
        values.forEach(value => this._markSelected(value));
        oldValues
            .filter(value => !newSelectedSet.has(value))
            .forEach(value => this._unmarkSelected(value));
        const changed = this._hasQueuedChanges();
        this._emitChangeEvent();
        return changed;
    }
    /**
     * Toggles a value between selected and deselected.
     * @param value The value to toggle
     * @return Whether the selection changed as a result of this call
     * @breaking-change 16.0.0 make return type boolean
     */
    toggle(value) {
        return this.isSelected(value) ? this.deselect(value) : this.select(value);
    }
    /**
     * Clears all of the selected values.
     * @param flushEvent Whether to flush the changes in an event.
     *   If false, the changes to the selection will be flushed along with the next event.
     * @return Whether the selection changed as a result of this call
     * @breaking-change 16.0.0 make return type boolean
     */
    clear(flushEvent = true) {
        this._unmarkAll();
        const changed = this._hasQueuedChanges();
        if (flushEvent) {
            this._emitChangeEvent();
        }
        return changed;
    }
    /**
     * Determines whether a value is selected.
     */
    isSelected(value) {
        if (this.compareWith) {
            for (const otherValue of this._selection) {
                if (this.compareWith(otherValue, value)) {
                    return true;
                }
            }
            return false;
        }
        return this._selection.has(value);
    }
    /**
     * Determines whether the model does not have a value.
     */
    isEmpty() {
        return this._selection.size === 0;
    }
    /**
     * Determines whether the model has a value.
     */
    hasValue() {
        return !this.isEmpty();
    }
    /**
     * Sorts the selected values based on a predicate function.
     */
    sort(predicate) {
        if (this._multiple && this.selected) {
            this._selected.sort(predicate);
        }
    }
    /**
     * Gets whether multiple values can be selected.
     */
    isMultipleSelection() {
        return this._multiple;
    }
    /** Emits a change event and clears the records of selected and deselected values. */
    _emitChangeEvent() {
        // Clear the selected values so they can be re-cached.
        this._selected = null;
        if (this._selectedToEmit.length || this._deselectedToEmit.length) {
            this.changed.next({
                source: this,
                added: this._selectedToEmit,
                removed: this._deselectedToEmit,
            });
            this._deselectedToEmit = [];
            this._selectedToEmit = [];
        }
    }
    /** Selects a value. */
    _markSelected(value) {
        if (!this.isSelected(value)) {
            if (!this._multiple) {
                this._unmarkAll();
            }
            if (!this.isSelected(value)) {
                this._selection.add(value);
            }
            if (this._emitChanges) {
                this._selectedToEmit.push(value);
            }
        }
    }
    /** Deselects a value. */
    _unmarkSelected(value) {
        if (this.isSelected(value)) {
            this._selection.delete(value);
            if (this._emitChanges) {
                this._deselectedToEmit.push(value);
            }
        }
    }
    /** Clears out the selected values. */
    _unmarkAll() {
        if (!this.isEmpty()) {
            this._selection.forEach(value => this._unmarkSelected(value));
        }
    }
    /**
     * Verifies the value assignment and throws an error if the specified value array is
     * including multiple values while the selection model is not supporting multiple values.
     */
    _verifyValueAssignment(values) {
        if (values.length > 1 && !this._multiple && (typeof ngDevMode === 'undefined' || ngDevMode)) {
            throw getMultipleValuesInSingleSelectionError();
        }
    }
    /** Whether there are queued up change to be emitted. */
    _hasQueuedChanges() {
        return !!(this._deselectedToEmit.length || this._selectedToEmit.length);
    }
}
/**
 * Returns an error that reports that multiple values are passed into a selection model
 * with a single value.
 * @docs-private
 */
function getMultipleValuesInSingleSelectionError() {
    return Error('Cannot pass multiple values into SelectionModel with single-value mode.');
}

const RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS = new InjectionToken('rxap-material/table-system/select-row/options');

class SelectRowService {
    get selectedRows() {
        return this.selectionModel.selected;
    }
    constructor(options = null) {
        this.selectionModel = new SelectionModel(true);
        this.selectionModel = new SelectionModel(options?.multiple, options?.selected, options?.emitChanges, options?.compareWith ?? this.compareWith);
        this.selectedRows$ = this.selectionModel.changed.pipe(map(() => this.selectionModel.selected));
    }
    clear() {
        this.selectionModel.clear();
    }
    compareWith(a, b) {
        if (a === b) {
            return true;
        }
        if (hasIdentifierProperty(a) && hasIdentifierProperty(b)) {
            return getIdentifierPropertyValue(a) === getIdentifierPropertyValue(b);
        }
        return false;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: SelectRowService, deps: [{ token: RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: SelectRowService }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: SelectRowService, decorators: [{
            type: Injectable
        }], ctorParameters: () => [{ type: undefined, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS]
                }] }] });

class TableSelectControlsComponent {
    constructor(selectRows, windowRef) {
        this.selectRows = selectRows;
        this.windowRef = windowRef;
        this.hasNotSelected$ = this.selectRows.selectedRows$.pipe(map((selected) => selected.length === 0));
    }
    cancel() {
        this.windowRef.close();
    }
    select() {
        this.windowRef.close(this.selectRows.selectedRows);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableSelectControlsComponent, deps: [{ token: SelectRowService }, { token: RXAP_WINDOW_REF }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: TableSelectControlsComponent, isStandalone: true, selector: "rxap-table-select-controls", ngImport: i0, template: "<div class=\"flex flex-row gap-4\">\n  <button (click)=\"cancel()\" class=\"grow-0\" mat-stroked-button type=\"button\">\n    <ng-container i18n>Cancel</ng-container>\n  </button>\n  <button (click)=\"select()\" [disabled]=\"hasNotSelected$ | async\" class=\"grow-0\" mat-raised-button type=\"button\">\n    <ng-container i18n>Select</ng-container>\n  </button>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: "    button[mat-button], button[mat-raised-button], button[mat-flat-button],    button[mat-stroked-button]  ", exportAs: ["matButton"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableSelectControlsComponent, decorators: [{
            type: Component,
            args: [{ selector: 'rxap-table-select-controls', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
                        MatButtonModule,
                        AsyncPipe,
                    ], template: "<div class=\"flex flex-row gap-4\">\n  <button (click)=\"cancel()\" class=\"grow-0\" mat-stroked-button type=\"button\">\n    <ng-container i18n>Cancel</ng-container>\n  </button>\n  <button (click)=\"select()\" [disabled]=\"hasNotSelected$ | async\" class=\"grow-0\" mat-raised-button type=\"button\">\n    <ng-container i18n>Select</ng-container>\n  </button>\n</div>\n" }]
        }], ctorParameters: () => [{ type: SelectRowService }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [RXAP_WINDOW_REF]
                }] }] });

class TableFilterService {
    constructor() {
        this.change = new ReplaySubject(1);
        this.current = {};
        this.reset$ = new Subject();
        /**
         * a flag to indicate whether any value was already send to the change subject
         * true - a value was send
         * false - no value was send
         * @private
         */
        this._init = false;
        this._subscription = this.change.subscribe(current => this.current = current);
    }
    reset() {
        this.reset$.next();
    }
    setMap(map) {
        const current = this.current;
        const copy = clone(this.current);
        const next = DeleteEmptyProperties(Object.assign(current, map));
        if (!this._init || !equals(copy, next)) {
            this._init = true;
            this.change.next(next);
        }
    }
    set(key, value) {
        const current = this.current;
        current[key] = value;
        this.change.next(current);
    }
    remove(key) {
        const current = this.current;
        // eslint-disable-next-line no-prototype-builtins
        if (current.hasOwnProperty(key)) {
            delete current[key];
        }
        this.change.next(current);
    }
    ngOnDestroy() {
        this._subscription.unsubscribe();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableFilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableFilterService }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableFilterService, decorators: [{
            type: Injectable
        }], ctorParameters: () => [] });

/**
 * @deprecated use TABLE_METHOD instead
 */
const TABLE_REMOTE_METHOD = RXAP_TABLE_METHOD;
const TABLE_REMOTE_METHOD_ADAPTER_FACTORY = new InjectionToken('table-remote-method-adapter-factory');
const RXAP_TABLE_FILTER = new InjectionToken('rxap/material-table-system/table-filter');
const TABLE_DATA_SOURCE = new InjectionToken('table-data-source');
class TableDataSourceDirective {
    /**
     * @deprecated use dataSource instead
     */
    // eslint-disable-next-line @angular-eslint/no-input-rename
    set setDataSource(dataSource) {
        if (typeof dataSource !== 'string') {
            this.dataSource = dataSource;
        }
    }
    get lastRefreshed() {
        return this.dataSource?.lastRefreshed ?? null;
    }
    /**
     * @deprecated use method instead
     */
    get remoteMethod() {
        return this.method;
    }
    /**
     * @deprecated use sourceMethod instead
     */
    get sourceRemoteMethod() {
        return this.sourceMethod;
    }
    constructor(matTable, cdr, sourceMethod, sourceDataSource, adapterFactory, matSort, tableFilter, _tableFilter) {
        this.matTable = matTable;
        this.cdr = cdr;
        this.sourceMethod = sourceMethod;
        this.sourceDataSource = sourceDataSource;
        this.matSort = matSort;
        this.tableFilter = tableFilter;
        this._tableFilter = _tableFilter;
        this.loading$ = new ToggleSubject(true);
        this.hasError$ = new ToggleSubject();
        this.error$ = new Subject();
        this._subscription = new Subscription();
        this.adapterFactory = null;
        this.matTable.trackBy = this.trackBy;
        this.adapterFactory = adapterFactory;
        this.retry = this.retry.bind(this);
        this.refresh = this.refresh.bind(this);
        this.reset = this.reset.bind(this);
    }
    trackBy(index, item) {
        return item['uuid'] ?? index;
    }
    ngOnInit() {
        const tableFilter = this._tableFilter ?? this.tableFilter ?? undefined;
        if (!this.dataSource) {
            if (this.sourceDataSource) {
                this.dataSource = this.sourceDataSource;
            }
            else if (this.sourceMethod) {
                if (this.adapterFactory) {
                    this.method = this.adapterFactory(this.sourceMethod, this.paginator, this.matSort, tableFilter, this.parameters);
                }
                else {
                    this.method = this.sourceMethod;
                }
                this.dataSource = new DynamicTableDataSource(this.method, this.paginator, this.matSort, tableFilter, this.parameters, this.method.metadata ?? { id: this.id });
            }
            if (!this.dataSource) {
                throw new Error('The TABLE_DATA_SOURCE and RXAP_TABLE_METHOD token are not defined!');
            }
        }
        this.dataSource.paginator = this.paginator;
        this.dataSource.sort = this.matSort ?? undefined;
        this.dataSource.filter = tableFilter;
        this.dataSource.parameters = this.parameters;
        if (this.dataSource instanceof DynamicTableDataSource) {
            this.dataSource.setPaginator(this.paginator, this.id);
            this.dataSource.setSort(this.matSort, this.id);
            this.dataSource.setFilter(tableFilter, this.id);
            this.dataSource.setParameters(this.parameters, this.id);
        }
        this._subscription.add(this.dataSource.loading$.pipe(tap(loading => this.loading$.next(!!loading))).subscribe());
        this._subscription.add(this.dataSource.hasError$.pipe(tap(hasError => this.hasError$.next(!!hasError))).subscribe());
        this._subscription.add(this.dataSource.error$.pipe(tap(error => this.error$.next(error))).subscribe());
        // create the id property for the mat table component.
        // the instance of the mat table component is used as viewer object
        // with the set of the id property it is possible to use the same data source
        // instance for multiple table component simultaneously
        // on connect the data source can then use the correct paginator/matSort/tableFilter/parameters instance
        // to create the TableEvent objects
        Reflect.set(this.matTable, 'id', this.id);
        this.matTable.dataSource = pipeDataSource(this.dataSource, tap(rowList => {
            if (rowList.some((element) => !element.__metadata__)) {
                if (isDevMode()) {
                    console.debug('Ensure to use the NormalizeTableRow function to normalize the table row!');
                }
                rowList.forEach((element) => {
                    element.__metadata__ ??= {};
                    element.__metadata__.loading$ ??= new ToggleSubject();
                });
            }
        }));
    }
    ngOnDestroy() {
        this._subscription?.unsubscribe();
    }
    refresh() {
        this.dataSource?.refresh();
    }
    retry() {
        this.dataSource?.retry();
    }
    reset() {
        if (this.tableFilter) {
            this.tableFilter.reset();
        }
        else {
            this.dataSource?.reset();
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableDataSourceDirective, deps: [{ token: CdkTable }, { token: i0.ChangeDetectorRef }, { token: RXAP_TABLE_METHOD, optional: true }, { token: TABLE_DATA_SOURCE, optional: true }, { token: TABLE_REMOTE_METHOD_ADAPTER_FACTORY, optional: true }, { token: MatSort, optional: true }, { token: TableFilterService, optional: true }, { token: RXAP_TABLE_FILTER, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.3", type: TableDataSourceDirective, isStandalone: true, selector: "table[mat-table][rxapTableDataSource],mat-table[rxapTableDataSource]", inputs: { setDataSource: ["rxapTableDataSource", "setDataSource"], paginator: "paginator", id: "id", parameters: "parameters", dataSource: "dataSource" }, exportAs: ["rxapTableDataSource"], ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableDataSourceDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: 'table[mat-table][rxapTableDataSource],mat-table[rxapTableDataSource]',
                    exportAs: 'rxapTableDataSource',
                    standalone: true,
                }]
        }], ctorParameters: () => [{ type: i1.CdkTable, decorators: [{
                    type: Inject,
                    args: [CdkTable]
                }] }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [RXAP_TABLE_METHOD]
                }] }, { type: i2.AbstractTableDataSource, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [TABLE_DATA_SOURCE]
                }] }, { type: undefined, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [TABLE_REMOTE_METHOD_ADAPTER_FACTORY]
                }] }, { type: i3.MatSort, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [MatSort]
                }] }, { type: TableFilterService, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [TableFilterService]
                }] }, { type: undefined, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [RXAP_TABLE_FILTER]
                }] }], propDecorators: { setDataSource: [{
                type: Input,
                args: ['rxapTableDataSource']
            }], paginator: [{
                type: Input
            }], id: [{
                type: Input,
                args: [{ required: true }]
            }], parameters: [{
                type: Input
            }], dataSource: [{
                type: Input
            }] } });

class TableRowActionExecutingDirective {
    constructor(templateRef, vcr) {
        this.templateRef = templateRef;
        this.vcr = vcr;
    }
    show() {
        this.vcr.createEmbeddedView(this.templateRef);
    }
    hide() {
        this.vcr.clear();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableRowActionExecutingDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.3", type: TableRowActionExecutingDirective, isStandalone: true, selector: "[rxapTableRowActionExecuting]", ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableRowActionExecutingDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[rxapTableRowActionExecuting]',
                    standalone: true,
                }]
        }], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }] });

var TableRowActionStatus;
(function (TableRowActionStatus) {
    TableRowActionStatus["EXECUTING"] = "executing";
    TableRowActionStatus["DONE"] = "done";
    TableRowActionStatus["ERROR"] = "error";
    TableRowActionStatus["SUCCESS"] = "success";
})(TableRowActionStatus || (TableRowActionStatus = {}));

/**
 * @deprecated use RXAP_TABLE_ACTION_METHOD_METADATA instead
 */
const RXAP_TABLE_ACTION_METHOD_TYPE_METADATA = 'rxap-table-action-method-type-metadata';
const RXAP_TABLE_ACTION_METHOD_METADATA = 'rxap-table-action-method-metadata';
/**
 * @deprecated use RXAP_TABLE_ACTION_METHOD_METADATA instead
 */
const RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA = 'rxap-table-action-method-check-function-metadata';
function TableActionMethod(typeOrOptions, checkFunction) {
    let type;
    let options;
    if (typeof typeOrOptions === 'string') {
        type = typeOrOptions;
        options = {
            type,
            checkFunction,
        };
    }
    else {
        options = typeOrOptions;
        type = options.type;
        checkFunction = options.checkFunction;
    }
    return function (target) {
        setMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, options, target);
        if (type) {
            setMetadata(RXAP_TABLE_ACTION_METHOD_TYPE_METADATA, type, target);
        }
        if (checkFunction) {
            setMetadata(RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA, checkFunction, target);
        }
    };
}

function IsTableRowActionTypeSwitchMethod(method) {
    return getMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor)?.type === undefined;
}
function IsTableRowActionTypeMethod(type) {
    return (method) => {
        return (getMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor)?.type === type);
    };
}
function HasTableRowActionCheckFunction(method) {
    return getMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor)?.checkFunction !== undefined;
}
function GetTableRowActionCheckFunction(method) {
    const checkFunction = getMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor)?.checkFunction;
    if (!checkFunction) {
        throw new Error(`Extracted check function from '${method.constructor.name}' is empty`);
    }
    return checkFunction;
}
function HasTableRowActionMetadata(method) {
    return hasMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor);
}
function GetTableRowActionMetadata(method) {
    const metadata = getMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor);
    if (!metadata) {
        throw new Error(`Extracted metadata from '${method.constructor.name}' is empty`);
    }
    return metadata;
}

const RXAP_TABLE_ROW_ACTION_METHOD = new InjectionToken('rxap-table-row-action-method');

class AbstractTableRowAction extends ConfirmDirective {
    constructor(renderer, overlay, elementRef, actionMethodList, cdr, vcr, tableDataSourceDirective, snackBar, matButton, matTooltip, injector) {
        super(overlay, elementRef);
        this.renderer = renderer;
        this.cdr = cdr;
        this.vcr = vcr;
        this.tableDataSourceDirective = tableDataSourceDirective;
        this.snackBar = snackBar;
        this.matButton = matButton;
        this.matTooltip = matTooltip;
        this.injector = injector;
        this.isHeader = false;
        this.options = null;
        this._currentStatus = TableRowActionStatus.DONE;
        this._actionDisabled = false;
        this._hasConfirmDirective = false;
        this.actionMethodList = coerceArray(actionMethodList);
    }
    // eslint-disable-next-line @angular-eslint/no-input-rename
    set hasConfirmDirective(value) {
        this._hasConfirmDirective = coerceBoolean(value);
    }
    // eslint-disable-next-line @angular-eslint/contextual-lifecycle
    ngOnInit() {
        this.options = this.getTableActionOptions();
        if (this.options) {
            this.refresh ??= this.options.refresh ?? false;
            this.errorMessage ??= this.options.errorMessage ?? undefined;
            this.successMessage ??= this.options.successMessage ?? undefined;
            if (this.matTooltip && this.options.tooltip) {
                this.matTooltip.message = this.options.tooltip;
            }
            this.color ??= this.options.color ?? undefined;
        }
        if (this.matButton) {
            if (this.color) {
                this.matButton.color = this.color;
            }
        }
        if (this.isHeader) {
            this.renderer.addClass(this.elementRef.nativeElement, 'rxap-table-row-header-action');
        }
        else {
            this.renderer.addClass(this.elementRef.nativeElement, 'rxap-table-row-action');
        }
        this.renderer.addClass(this.elementRef.nativeElement, `rxap-action-${dasherize(this.type)}`);
    }
    onConfirmed() {
        return this.execute();
    }
    onClick($event) {
        $event.stopPropagation();
        if (!this._hasConfirmDirective && !this.options?.confirm) {
            return this.execute();
        }
        else if (this.options?.confirm) {
            this.openConfirmOverly();
        }
        else {
            if (isDevMode()) {
                console.debug('skip remote method call. Wait for confirmation.');
            }
        }
        return Promise.resolve();
    }
    async execute() {
        if (this._actionDisabled) {
            return Promise.resolve();
        }
        this.setStatus(TableRowActionStatus.EXECUTING);
        try {
            await Promise.all(this.getElementList().map((element) => {
                return Promise.all([
                    Promise.all(this.findUntypedActionMethod().map((am) => {
                        return am.call({
                            element,
                            type: this.type,
                        });
                    })),
                    Promise.all(this.findTypedActionMethod().map((am) => {
                        return am.call(element);
                    })),
                ]);
            }));
            this.setStatus(TableRowActionStatus.SUCCESS);
        }
        catch (e) {
            console.error(`Failed to execute row action: ${e.message}`);
            this.setStatus(TableRowActionStatus.ERROR);
        }
    }
    /**
     * Disables the action. If the button is pressed the action is NOT executed
     *
     * Hint: the button is set to disabled = true to prevent any conflict with
     * extern button enable features linke : rxapHasEnablePermission
     * @protected
     */
    setButtonDisabled() {
        this._actionDisabled = true;
    }
    /**
     * Enables the action. If the button is pressed the action is executed
     *
     * TODO : find a way to communicate the disabled state between the features
     * Hint: the button is set to disabled = false to prevent any conflict with
     * extern button enable features linke : rxapHasEnablePermission
     * @protected
     */
    setButtonEnabled() {
        this._actionDisabled = false;
    }
    /**
     * find all method instance in the actionMethodList member that
     * do not have a @TableActionMethod decorators
     * @private
     */
    findUntypedActionMethod() {
        return this.actionMethodList.filter(IsTableRowActionTypeSwitchMethod);
    }
    /**
     * find all method instance in the actionMethodList member that
     * do have a @TableActionMethod decorators with the current type
     * @private
     */
    findTypedActionMethod() {
        return this.actionMethodList.filter(IsTableRowActionTypeMethod(this.type));
    }
    setStatus(status) {
        if (this._currentStatus === status) {
            return;
        }
        this._currentStatus = status;
        switch (status) {
            case TableRowActionStatus.EXECUTING:
                this.setButtonDisabled();
                this.executingDirective?.show();
                break;
            case TableRowActionStatus.SUCCESS:
                if (this.refresh) {
                    this.tableDataSourceDirective.refresh();
                }
                if (this.successMessage) {
                    this.snackBar.open(this.successMessage, 'ok', { duration: 2560 });
                }
                this.setStatus(TableRowActionStatus.DONE);
                break;
            case TableRowActionStatus.ERROR:
                this.setStatus(TableRowActionStatus.DONE);
                if (this.errorMessage) {
                    this.snackBar.open(this.errorMessage, 'ok', { duration: 5120 });
                }
                break;
            case TableRowActionStatus.DONE:
                this.setButtonEnabled();
                this.executingDirective?.hide();
                break;
        }
        this.cdr.detectChanges();
    }
    getTableActionOptions() {
        const metadataList = this.actionMethodList.map(actionMethod => GetTableRowActionMetadata(actionMethod));
        if (metadataList.length === 0) {
            return null;
        }
        // TODO : handle multiple metadata or not exist metadata
        return metadataList.filter(metadata => metadata.type === this.type)
            .sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0))[0];
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: AbstractTableRowAction, deps: [{ token: Renderer2 }, { token: Overlay }, { token: ElementRef }, { token: RXAP_TABLE_ROW_ACTION_METHOD }, { token: ChangeDetectorRef }, { token: ViewContainerRef }, { token: TableDataSourceDirective }, { token: MatSnackBar }, { token: MatIconButton, optional: true }, { token: MatTooltip, optional: true }, { token: INJECTOR }], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: AbstractTableRowAction }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: AbstractTableRowAction, decorators: [{
            type: Injectable
        }], ctorParameters: () => [{ type: i0.Renderer2, decorators: [{
                    type: Inject,
                    args: [Renderer2]
                }] }, { type: i1$1.Overlay, decorators: [{
                    type: Inject,
                    args: [Overlay]
                }] }, { type: i0.ElementRef, decorators: [{
                    type: Inject,
                    args: [ElementRef]
                }] }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [RXAP_TABLE_ROW_ACTION_METHOD]
                }] }, { type: i0.ChangeDetectorRef, decorators: [{
                    type: Inject,
                    args: [ChangeDetectorRef]
                }] }, { type: i0.ViewContainerRef, decorators: [{
                    type: Inject,
                    args: [ViewContainerRef]
                }] }, { type: TableDataSourceDirective, decorators: [{
                    type: Inject,
                    args: [TableDataSourceDirective]
                }] }, { type: i3$1.MatSnackBar, decorators: [{
                    type: Inject,
                    args: [MatSnackBar]
                }] }, { type: i4.MatIconButton, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [MatIconButton]
                }] }, { type: i5.MatTooltip, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [MatTooltip]
                }] }, { type: i0.Injector, decorators: [{
                    type: Inject,
                    args: [INJECTOR]
                }] }], propDecorators: { errorMessage: [{
                type: Input
            }], successMessage: [{
                type: Input
            }], refresh: [{
                type: Input
            }], color: [{
                type: Input
            }], executingDirective: [{
                type: ContentChild,
                args: [TableRowActionExecutingDirective]
            }], hasConfirmDirective: [{
                type: Input,
                args: ['rxapConfirm']
            }], onConfirmed: [{
                type: HostListener,
                args: ['confirmed']
            }], onClick: [{
                type: HostListener,
                args: ['click', ['$event']]
            }] } });

class RowActionCheckPipe {
    constructor(tableRowActionMethodList) {
        this.actionMethodList = coerceArray(tableRowActionMethodList);
    }
    transform(value, type) {
        if (!type) {
            throw new Error(`The provided type is empty '${type}'`);
        }
        const actionMethodList = this.actionMethodList.filter(IsTableRowActionTypeMethod(type));
        if (actionMethodList.length > 1) {
            throw new Error(`Multiple (${actionMethodList.length}) action method with the same type '${type}' found`);
        }
        if (actionMethodList.length === 0) {
            throw new Error(`Could not find a action method with the type '${type}'`);
        }
        const actionMethod = actionMethodList[0];
        if (HasTableRowActionCheckFunction(actionMethod)) {
            const checkFunction = GetTableRowActionCheckFunction(actionMethod);
            const input = coerceArray(value);
            return input.length !== 0 && input.every(checkFunction);
        }
        return true;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: RowActionCheckPipe, deps: [{ token: RXAP_TABLE_ROW_ACTION_METHOD, optional: true }], target: i0.ɵɵFactoryTarget.Pipe }); }
    static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: RowActionCheckPipe, isStandalone: true, name: "rxapRowActionCheck" }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: RowActionCheckPipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'rxapRowActionCheck',
                    standalone: true,
                }]
        }], ctorParameters: () => [{ type: undefined, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [RXAP_TABLE_ROW_ACTION_METHOD]
                }] }] });

class TableRowActionDirective extends AbstractTableRowAction {
    getElementList() {
        return [this.element];
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableRowActionDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.3", type: TableRowActionDirective, isStandalone: true, selector: "button[rxapTableRowAction]", inputs: { errorMessage: "errorMessage", successMessage: "successMessage", refresh: "refresh", color: "color", type: ["rxapTableRowAction", "type"], element: "element" }, usesInheritance: true, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableRowActionDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: 'button[rxapTableRowAction]',
                    standalone: true,
                    // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
                    inputs: ['errorMessage', 'successMessage', 'refresh', 'color'],
                }]
        }], propDecorators: { type: [{
                type: Input,
                args: [{
                        required: true,
                        alias: 'rxapTableRowAction',
                    }]
            }], element: [{
                type: Input,
                args: [{ required: true }]
            }] } });

class TableRowHeaderActionDirective extends AbstractTableRowAction {
    constructor(renderer, overlay, elementRef, actionMethod, cdr, vcr, tableDataSourceDirective, snackBar, matButton, matTooltip, injector, selectRowService) {
        super(renderer, overlay, elementRef, actionMethod, cdr, vcr, tableDataSourceDirective, snackBar, matButton, matTooltip, injector);
        this.selectRowService = selectRowService;
        this.isHeader = true;
    }
    ngOnDestroy() {
        this._subscription?.unsubscribe();
    }
    ngOnInit() {
        if (this.selectRowService) {
            this._subscription = this.selectRowService.selectedRows$
                .pipe(startWith(this.selectRowService.selectedRows), map((rows) => rows.length !== 0), tap((hasSelected) => {
                if (hasSelected) {
                    this.setButtonEnabled();
                }
                else {
                    this.setButtonDisabled();
                }
                this.cdr.detectChanges();
            }))
                .subscribe();
        }
        else {
            this.setButtonDisabled();
        }
    }
    getElementList() {
        return this.selectRowService?.selectedRows ?? [];
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableRowHeaderActionDirective, deps: [{ token: Renderer2 }, { token: Overlay }, { token: ElementRef }, { token: RXAP_TABLE_ROW_ACTION_METHOD }, { token: ChangeDetectorRef }, { token: ViewContainerRef }, { token: TableDataSourceDirective }, { token: MatSnackBar }, { token: MatButton, optional: true }, { token: MatTooltip, optional: true }, { token: INJECTOR }, { token: SelectRowService, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.3", type: TableRowHeaderActionDirective, isStandalone: true, selector: "button[rxapTableRowHeaderAction]", inputs: { errorMessage: "errorMessage", successMessage: "successMessage", refresh: "refresh", color: "color", type: ["rxapTableRowHeaderAction", "type"] }, usesInheritance: true, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableRowHeaderActionDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: 'button[rxapTableRowHeaderAction]',
                    standalone: true,
                    // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
                    inputs: ['errorMessage', 'successMessage', 'refresh', 'color'],
                }]
        }], ctorParameters: () => [{ type: i0.Renderer2, decorators: [{
                    type: Inject,
                    args: [Renderer2]
                }] }, { type: i1$1.Overlay, decorators: [{
                    type: Inject,
                    args: [Overlay]
                }] }, { type: i0.ElementRef, decorators: [{
                    type: Inject,
                    args: [ElementRef]
                }] }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [RXAP_TABLE_ROW_ACTION_METHOD]
                }] }, { type: i0.ChangeDetectorRef, decorators: [{
                    type: Inject,
                    args: [ChangeDetectorRef]
                }] }, { type: i0.ViewContainerRef, decorators: [{
                    type: Inject,
                    args: [ViewContainerRef]
                }] }, { type: TableDataSourceDirective, decorators: [{
                    type: Inject,
                    args: [TableDataSourceDirective]
                }] }, { type: i3$1.MatSnackBar, decorators: [{
                    type: Inject,
                    args: [MatSnackBar]
                }] }, { type: i4.MatButton, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [MatButton]
                }] }, { type: i5.MatTooltip, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [MatTooltip]
                }] }, { type: i0.Injector, decorators: [{
                    type: Inject,
                    args: [INJECTOR]
                }] }, { type: SelectRowService, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [SelectRowService]
                }] }], propDecorators: { type: [{
                type: Input,
                args: [{
                        required: true,
                        alias: 'rxapTableRowHeaderAction',
                    }]
            }] } });

class TableRowActionsModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableRowActionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: TableRowActionsModule, imports: [TableRowActionDirective,
            TableRowActionExecutingDirective,
            TableRowHeaderActionDirective,
            RowActionCheckPipe,
            ConfirmModule], exports: [TableRowActionDirective,
            TableRowHeaderActionDirective,
            TableRowActionExecutingDirective,
            RowActionCheckPipe,
            MatTooltipModule,
            MatButtonModule,
            ConfirmModule,
            MatIconModule,
            MatProgressBarModule,
            CommonModule] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableRowActionsModule, imports: [ConfirmModule, MatTooltipModule,
            MatButtonModule,
            ConfirmModule,
            MatIconModule,
            MatProgressBarModule,
            CommonModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableRowActionsModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [
                        TableRowActionDirective,
                        TableRowActionExecutingDirective,
                        TableRowHeaderActionDirective,
                        RowActionCheckPipe,
                        ConfirmModule,
                    ],
                    exports: [
                        TableRowActionDirective,
                        TableRowHeaderActionDirective,
                        TableRowActionExecutingDirective,
                        RowActionCheckPipe,
                        MatTooltipModule,
                        MatButtonModule,
                        ConfirmModule,
                        MatIconModule,
                        MatProgressBarModule,
                        CommonModule,
                    ],
                }]
        }] });

const RXAP_TABLE_HEADER_BUTTON_METHOD_METADATA = 'rxap-table-header-button-method-metadata';
function TableHeaderButtonMethod(options = {}) {
    return function (target) {
        setMetadata(RXAP_TABLE_HEADER_BUTTON_METHOD_METADATA, options, target);
    };
}
function GetTableHeaderButtonMetadata(method) {
    const metadata = getMetadata(RXAP_TABLE_HEADER_BUTTON_METHOD_METADATA, method.constructor);
    if (!metadata) {
        throw new Error(`Extracted metadata from '${method.constructor.name}' is empty`);
    }
    return metadata;
}

var TableHeaderButtonActionStatus;
(function (TableHeaderButtonActionStatus) {
    TableHeaderButtonActionStatus["EXECUTING"] = "executing";
    TableHeaderButtonActionStatus["DONE"] = "done";
    TableHeaderButtonActionStatus["ERROR"] = "error";
    TableHeaderButtonActionStatus["SUCCESS"] = "success";
})(TableHeaderButtonActionStatus || (TableHeaderButtonActionStatus = {}));

const TABLE_HEADER_BUTTON_METHOD = new InjectionToken('table-header-button-method');

class TableHeaderButtonDirective extends ConfirmDirective {
    constructor(overlay, elementRef, method, snackBar, matTooltip, matButton, cdr) {
        super(overlay, elementRef);
        this.method = method;
        this.snackBar = snackBar;
        this.matTooltip = matTooltip;
        this.matButton = matButton;
        this.cdr = cdr;
        this.options = null;
        this._actionDisabled = false;
        this._currentStatus = TableHeaderButtonActionStatus.DONE;
        this._hasConfirmDirective = false;
    }
    // eslint-disable-next-line @angular-eslint/no-input-rename
    set hasConfirmDirective(value) {
        this._hasConfirmDirective = coerceBoolean(value);
    }
    onConfirmed() {
        return this.execute();
    }
    onClick($event) {
        $event.stopPropagation();
        if (!this._hasConfirmDirective && !this.options?.confirm) {
            return this.execute();
        }
        else if (this.options?.confirm) {
            this.openConfirmOverly();
        }
        else {
            if (isDevMode()) {
                console.debug('skip remote method call. Wait for confirmation.');
            }
        }
        return Promise.resolve();
    }
    async execute() {
        if (this._actionDisabled) {
            return Promise.resolve();
        }
        this.setStatus(TableHeaderButtonActionStatus.EXECUTING);
        try {
            await this.method.call();
            this.setStatus(TableHeaderButtonActionStatus.SUCCESS);
        }
        catch (e) {
            console.error(`Failed to execute table header action: ${e.message}`);
            this.setStatus(TableHeaderButtonActionStatus.ERROR);
        }
    }
    ngOnInit() {
        this.options = this.getTableHeaderButtonOptions();
        if (this.options) {
            this.refresh ??= this.options.refresh ?? false;
            this.errorMessage ??= this.options.errorMessage ?? undefined;
            this.successMessage ??= this.options.successMessage ?? undefined;
            if (this.matTooltip && this.options.tooltip) {
                this.matTooltip.message = this.options.tooltip;
            }
        }
    }
    /**
     * Disables the action. If the button is pressed the action is NOT executed
     *
     * Hint: the button is set to disabled = true to prevent any conflict with
     * extern button enable features linke : rxapHasEnablePermission
     * @protected
     */
    setButtonDisabled() {
        this._actionDisabled = true;
    }
    /**
     * Enables the action. If the button is pressed the action is executed
     *
     * TODO : find a way to communicate the disabled state between the features
     * Hint: the button is set to disabled = false to prevent any conflict with
     * extern button enable features linke : rxapHasEnablePermission
     * @protected
     */
    setButtonEnabled() {
        this._actionDisabled = false;
    }
    setStatus(status) {
        if (this._currentStatus === status) {
            return;
        }
        this._currentStatus = status;
        switch (status) {
            case TableHeaderButtonActionStatus.EXECUTING:
                this.setButtonDisabled();
                break;
            case TableHeaderButtonActionStatus.SUCCESS:
                if (this.refresh) {
                    this.tableDataSourceDirective.refresh();
                }
                if (this.successMessage) {
                    this.snackBar.open(this.successMessage, 'ok', { duration: 2560 });
                }
                this.setStatus(TableHeaderButtonActionStatus.DONE);
                break;
            case TableHeaderButtonActionStatus.ERROR:
                this.setStatus(TableHeaderButtonActionStatus.DONE);
                if (this.errorMessage) {
                    this.snackBar.open(this.errorMessage, 'ok', { duration: 5120 });
                }
                break;
            case TableHeaderButtonActionStatus.DONE:
                this.setButtonEnabled();
                break;
        }
        this.cdr.detectChanges();
    }
    getTableHeaderButtonOptions() {
        return GetTableHeaderButtonMetadata(this.method);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableHeaderButtonDirective, deps: [{ token: Overlay }, { token: ElementRef }, { token: TABLE_HEADER_BUTTON_METHOD }, { token: MatSnackBar }, { token: MatTooltip, optional: true }, { token: MatMiniFabButton, optional: true }, { token: ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.3", type: TableHeaderButtonDirective, isStandalone: true, selector: "button[mat-mini-fab][rxapTableHeaderButton]", inputs: { tableDataSourceDirective: ["rxapTableHeaderButton", "tableDataSourceDirective"], errorMessage: "errorMessage", successMessage: "successMessage", refresh: "refresh", hasConfirmDirective: ["rxapConfirm", "hasConfirmDirective"] }, host: { listeners: { "confirmed": "onConfirmed()", "click": "onClick($event)" } }, usesInheritance: true, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableHeaderButtonDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: 'button[mat-mini-fab][rxapTableHeaderButton]',
                    standalone: true,
                }]
        }], ctorParameters: () => [{ type: i1$1.Overlay, decorators: [{
                    type: Inject,
                    args: [Overlay]
                }] }, { type: i0.ElementRef, decorators: [{
                    type: Inject,
                    args: [ElementRef]
                }] }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [TABLE_HEADER_BUTTON_METHOD]
                }] }, { type: i3$1.MatSnackBar, decorators: [{
                    type: Inject,
                    args: [MatSnackBar]
                }] }, { type: i5.MatTooltip, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [MatTooltip]
                }] }, { type: i4.MatMiniFabButton, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [MatMiniFabButton]
                }] }, { type: i0.ChangeDetectorRef, decorators: [{
                    type: Inject,
                    args: [ChangeDetectorRef]
                }] }], propDecorators: { tableDataSourceDirective: [{
                type: Input,
                args: [{
                        required: true,
                        alias: 'rxapTableHeaderButton',
                    }]
            }], errorMessage: [{
                type: Input
            }], successMessage: [{
                type: Input
            }], refresh: [{
                type: Input
            }], hasConfirmDirective: [{
                type: Input,
                args: ['rxapConfirm']
            }], onConfirmed: [{
                type: HostListener,
                args: ['confirmed']
            }], onClick: [{
                type: HostListener,
                args: ['click', ['$event']]
            }] } });

const RXAP_TABLE_FILTER_FORM_DEFINITION = new InjectionToken('rxap/form-table-system/filter-form-definition');

class FilterHeaderRowDirective extends FormDirective {
    set useFormDefinition(value) {
        if (value) {
            this._formDefinition = value;
            this.form = value.rxapFormGroup;
        }
    }
    constructor(tableFilter, cdr, formDefinition) {
        super(cdr, formDefinition);
        this.tableFilter = tableFilter;
    }
    ngOnInit() {
        super.ngOnInit();
        this._subscription = new Subscription();
        this._subscription.add(this.tableFilter.reset$.subscribe(() => this.form.reset()));
        this._subscription.add(this.form.value$
            .pipe(debounceTime(1000), distinctUntilChanged((a, b) => equals(a, b)), tap(values => this.tableFilter.setMap(values)))
            .subscribe());
    }
    ngOnDestroy() {
        super.ngOnDestroy();
        this._subscription?.unsubscribe();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: FilterHeaderRowDirective, deps: [{ token: TableFilterService }, { token: i0.ChangeDetectorRef }, { token: RXAP_TABLE_FILTER_FORM_DEFINITION, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.3", type: FilterHeaderRowDirective, isStandalone: true, selector: "table[rxap-filter-header-row]", inputs: { useFormDefinition: ["rxap-filter-header-row", "useFormDefinition"] }, providers: [
            {
                provide: ControlContainer,
                // ignore coverage
                useExisting: forwardRef(() => FilterHeaderRowDirective),
            },
        ], usesInheritance: true, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: FilterHeaderRowDirective, decorators: [{
            type: Directive,
            args: [{
                    // eslint-disable-next-line @angular-eslint/directive-selector
                    selector: 'table[rxap-filter-header-row]',
                    providers: [
                        {
                            provide: ControlContainer,
                            // ignore coverage
                            useExisting: forwardRef(() => FilterHeaderRowDirective),
                        },
                    ],
                    standalone: true,
                }]
        }], ctorParameters: () => [{ type: TableFilterService }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [RXAP_TABLE_FILTER_FORM_DEFINITION]
                }] }], propDecorators: { useFormDefinition: [{
                type: Input,
                args: ['rxap-filter-header-row']
            }] } });

class ToFilterColumnNamesPipe {
    transform(columns) {
        return columns.map(column => 'filter_' + column);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ToFilterColumnNamesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
    static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: ToFilterColumnNamesPipe, isStandalone: true, name: "toFilterColumnNames" }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ToFilterColumnNamesPipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'toFilterColumnNames',
                    standalone: true,
                }]
        }] });

class TableFilterModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: TableFilterModule, imports: [ToFilterColumnNamesPipe,
            FilterHeaderRowDirective], exports: [ToFilterColumnNamesPipe,
            FilterHeaderRowDirective] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableFilterModule }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableFilterModule, decorators: [{
            type: NgModule,
            args: [{
                    exports: [
                        ToFilterColumnNamesPipe,
                        FilterHeaderRowDirective,
                    ],
                    imports: [
                        ToFilterColumnNamesPipe,
                        FilterHeaderRowDirective,
                    ],
                }]
        }] });

const TABLE_CREATE_REMOTE_METHOD = new InjectionToken('table-create-remote-method');

class TableCreateButtonDirective {
    constructor(method, elementRef, renderer) {
        this.method = method;
        this.elementRef = elementRef;
        this.renderer = renderer;
    }
    ngOnInit() {
        this.renderer.setStyle(this.elementRef.nativeElement, 'margin-bottom', '6px');
    }
    ngOnDestroy() {
        if (this._createObservable instanceof Subject) {
            this._createObservable.complete();
        }
    }
    async onClick() {
        const result = this._createObservable = await this.method.call();
        if (isObservable(result)) {
            await result.toPromise();
        }
        this.dataSource.refresh();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableCreateButtonDirective, deps: [{ token: TABLE_CREATE_REMOTE_METHOD }, { token: ElementRef }, { token: Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.3", type: TableCreateButtonDirective, isStandalone: true, selector: "button[rxapTableCreate]", inputs: { dataSource: ["rxapTableCreate", "dataSource"] }, host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableCreateButtonDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: 'button[rxapTableCreate]',
                    standalone: true,
                }]
        }], ctorParameters: () => [{ type: undefined, decorators: [{
                    type: Inject,
                    args: [TABLE_CREATE_REMOTE_METHOD]
                }] }, { type: i0.ElementRef, decorators: [{
                    type: Inject,
                    args: [ElementRef]
                }] }, { type: i0.Renderer2, decorators: [{
                    type: Inject,
                    args: [Renderer2]
                }] }], propDecorators: { dataSource: [{
                type: Input,
                args: [{
                        required: true,
                        alias: 'rxapTableCreate',
                    }]
            }], onClick: [{
                type: HostListener,
                args: ['click']
            }] } });

class TableColumnOptionComponent {
    /**
     * The displayed value of the option. It is necessary to show the selected option in the
     * select's trigger.
     */
    get display() {
        return (this._element.nativeElement.textContent || '').trim();
    }
    set inactive(value) {
        this.active = !coerceBoolean(value);
    }
    set hidden(value) {
        this._hidden = coerceBoolean(value);
    }
    get hidden() {
        return this._hidden;
    }
    set show(value) {
        this._hidden = !value;
    }
    get cacheId() {
        return this.router.url + '--' + this.name;
    }
    constructor(_element, router) {
        this._element = _element;
        this.router = router;
        this.active = true;
        this._hidden = false;
    }
    ngOnInit() {
        const cachedValue = localStorage.getItem(this.cacheId);
        if (cachedValue === 'true') {
            this.active = true;
        }
        if (cachedValue === 'false') {
            this.active = false;
        }
    }
    toggle() {
        this.active = !this.active;
        localStorage.setItem(this.cacheId, this.active ? 'true' : 'false');
    }
    activate() {
        this.active = true;
        localStorage.setItem(this.cacheId, 'true');
    }
    deactivate() {
        this.active = false;
        localStorage.setItem(this.cacheId, 'false');
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableColumnOptionComponent, deps: [{ token: ElementRef }, { token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: TableColumnOptionComponent, isStandalone: true, selector: "rxap-table-column-option", inputs: { name: "name", active: "active", inactive: "inactive", hidden: "hidden", show: "show" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [""] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableColumnOptionComponent, decorators: [{
            type: Component,
            args: [{ selector: 'rxap-table-column-option', standalone: true, template: "<ng-content></ng-content>\n" }]
        }], ctorParameters: () => [{ type: i0.ElementRef, decorators: [{
                    type: Inject,
                    args: [ElementRef]
                }] }, { type: i1$2.Router }], propDecorators: { name: [{
                type: Input,
                args: [{ required: true }]
            }], active: [{
                type: Input
            }], inactive: [{
                type: Input
            }], hidden: [{
                type: Input
            }], show: [{
                type: Input
            }] } });

class TableColumnMenuComponent {
    constructor() {
        this.displayColumns = [];
        this._inline = false;
        this._matCardMode = false;
    }
    get visibleColumns() {
        return this.columns?.filter((option) => !option.hidden);
    }
    get inline() {
        return this._inline;
    }
    /**
     * true - the menu is displayed inline and not absolute
     * @param value
     */
    set inline(value) {
        this._inline = coerceBoolean(value);
    }
    set matCard(value) {
        this._matCardMode = coerceBoolean(value);
    }
    ngAfterContentInit() {
        this.updateDisplayColumns();
    }
    updateDisplayColumns() {
        if (!this.columns) {
            throw new Error('Could not query content children of TableColumnOptionComponent');
        }
        this.displayColumns = this.columns
            .filter((option) => option.active)
            .map((option) => option.name);
    }
    activate(columnName) {
        this.columns
            ?.filter((option) => option.name === columnName)
            .forEach((column) => column.activate());
        this.updateDisplayColumns();
    }
    deactivate(columnName) {
        this.columns
            ?.filter((option) => option.name === columnName)
            .forEach((column) => column.deactivate());
        this.updateDisplayColumns();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableColumnMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: TableColumnMenuComponent, isStandalone: true, selector: "rxap-table-column-menu", inputs: { inline: "inline", matCard: "matCard" }, host: { properties: { "class.inline": "this._inline", "class.mat-card-mode": "this._matCardMode" } }, queries: [{ propertyName: "columns", predicate: TableColumnOptionComponent }], exportAs: ["rxapTableColumns"], ngImport: i0, template: "<button [matMenuTriggerFor]=\"columnMenu\" mat-icon-button type=\"button\">\n  <mat-icon>tune</mat-icon>\n</button>\n\n<mat-menu #columnMenu=\"matMenu\">\n  <span\n    *ngFor=\"let column of $any(visibleColumns ?? [])\"\n    [disableRipple]=\"true\"\n    mat-menu-item\n    rxapStopPropagation\n  >\n    <mat-checkbox\n      (change)=\"column.toggle(); updateDisplayColumns()\"\n      [checked]=\"column.active\">\n      {{ column.display }}\n    </mat-checkbox>\n  </span>\n  <ng-content select=\"[mat-menu-item],mat-divider\"></ng-content>\n</mat-menu>\n", styles: [":host.mat-card-mode:not(.inline){position:absolute;inset:8px 8px auto auto}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i2$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i2$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i2$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: StopPropagationDirective, selector: "[rxapStopPropagation]" }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableColumnMenuComponent, decorators: [{
            type: Component,
            args: [{ selector: 'rxap-table-column-menu', changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'rxapTableColumns', imports: [
                        MatButtonModule,
                        MatMenuModule,
                        MatIconModule,
                        NgFor,
                        StopPropagationDirective,
                        MatCheckboxModule,
                        NgClass,
                    ], template: "<button [matMenuTriggerFor]=\"columnMenu\" mat-icon-button type=\"button\">\n  <mat-icon>tune</mat-icon>\n</button>\n\n<mat-menu #columnMenu=\"matMenu\">\n  <span\n    *ngFor=\"let column of $any(visibleColumns ?? [])\"\n    [disableRipple]=\"true\"\n    mat-menu-item\n    rxapStopPropagation\n  >\n    <mat-checkbox\n      (change)=\"column.toggle(); updateDisplayColumns()\"\n      [checked]=\"column.active\">\n      {{ column.display }}\n    </mat-checkbox>\n  </span>\n  <ng-content select=\"[mat-menu-item],mat-divider\"></ng-content>\n</mat-menu>\n", styles: [":host.mat-card-mode:not(.inline){position:absolute;inset:8px 8px auto auto}\n"] }]
        }], propDecorators: { columns: [{
                type: ContentChildren,
                args: [TableColumnOptionComponent]
            }], _inline: [{
                type: HostBinding,
                args: ['class.inline']
            }], inline: [{
                type: Input
            }], matCard: [{
                type: Input
            }], _matCardMode: [{
                type: HostBinding,
                args: ['class.mat-card-mode']
            }] } });

class TableShowArchivedSlideComponent {
    constructor(tableFilter, tableColumnMenu, selectRows) {
        this.tableFilter = tableFilter;
        this.tableColumnMenu = tableColumnMenu;
        this.selectRows = selectRows;
    }
    onChange($event) {
        this.paginator?.firstPage();
        this.tableFilter?.set('__archived', $event.checked);
        this.selectRows?.clear();
        if ($event.checked) {
            this.tableColumnMenu.activate('removedAt');
            this.tableColumnMenu.activate('__removedAt');
            this.tableColumnMenu.activate('__--removed-at');
            this.tableColumnMenu.activate('removed-at');
            this.tableColumnMenu.activate('__removed-at');
        }
        else {
            this.tableColumnMenu.deactivate('removedAt');
            this.tableColumnMenu.deactivate('__removedAt');
            this.tableColumnMenu.deactivate('__--removed-at');
            this.tableColumnMenu.deactivate('removed-at');
            this.tableColumnMenu.deactivate('__removed-at');
        }
    }
    ngAfterViewInit() {
        this.tableColumnMenu.deactivate('removedAt');
        this.tableColumnMenu.deactivate('__removedAt');
        this.tableColumnMenu.deactivate('__--removed-at');
        this.tableColumnMenu.deactivate('removed-at');
        this.tableColumnMenu.deactivate('__removed-at');
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableShowArchivedSlideComponent, deps: [{ token: TableFilterService, optional: true }, { token: TableColumnMenuComponent }, { token: SelectRowService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: TableShowArchivedSlideComponent, isStandalone: true, selector: "rxap-table-show-archived-slide", inputs: { paginator: "paginator" }, ngImport: i0, template: "<div class=\"m-6\" rxapStopPropagation>\n  <mat-slide-toggle (change)=\"onChange($event)\">\n    <span class=\"mx-2 whitespace-nowrap\" i18n>Show archived documents</span>\n  </mat-slide-toggle>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: StopPropagationDirective, selector: "[rxapStopPropagation]" }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i1$3.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableShowArchivedSlideComponent, decorators: [{
            type: Component,
            args: [{ selector: 'rxap-table-show-archived-slide', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StopPropagationDirective, MatSlideToggleModule], template: "<div class=\"m-6\" rxapStopPropagation>\n  <mat-slide-toggle (change)=\"onChange($event)\">\n    <span class=\"mx-2 whitespace-nowrap\" i18n>Show archived documents</span>\n  </mat-slide-toggle>\n</div>\n" }]
        }], ctorParameters: () => [{ type: TableFilterService, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [TableFilterService]
                }] }, { type: TableColumnMenuComponent, decorators: [{
                    type: Inject,
                    args: [TableColumnMenuComponent]
                }] }, { type: SelectRowService, decorators: [{
                    type: Inject,
                    args: [SelectRowService]
                }] }], propDecorators: { paginator: [{
                type: Input
            }] } });

class TableColumnMenuModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableColumnMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: TableColumnMenuModule, imports: [TableColumnMenuComponent,
            TableShowArchivedSlideComponent,
            TableColumnOptionComponent], exports: [TableColumnMenuComponent,
            TableShowArchivedSlideComponent,
            TableColumnOptionComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableColumnMenuModule, imports: [TableColumnMenuComponent,
            TableShowArchivedSlideComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableColumnMenuModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [
                        TableColumnMenuComponent,
                        TableShowArchivedSlideComponent,
                        TableColumnOptionComponent,
                    ],
                    exports: [
                        TableColumnMenuComponent,
                        TableShowArchivedSlideComponent,
                        TableColumnOptionComponent,
                    ],
                }]
        }] });

// TODO : move to rxap packages
class TableColumnFilterService {
    constructor() {
        this.change = new BehaviorSubject({});
    }
    get current() {
        return clone(this.change.value);
    }
    setFilter(column, value) {
        const next = this.current;
        if (value) {
            next[column] = value;
        }
        else if (next[column]) {
            delete next[column];
        }
        this.change.next(next);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableColumnFilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableColumnFilterService }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableColumnFilterService, decorators: [{
            type: Injectable
        }] });

// TODO : move to rxap packages
class TableColumnFilterInputDirective {
    constructor(ngModel, tableColumnFilterService) {
        this.ngModel = ngModel;
        this.tableColumnFilterService = tableColumnFilterService;
    }
    ngOnDestroy() {
        this._subscription?.unsubscribe();
    }
    ngAfterViewInit() {
        if (!this.ngModel.valueChanges) {
            throw new Error('Could not access the ngModel value change');
        }
        this._subscription = this.ngModel.valueChanges.pipe(debounceTime(500), tap((value) => {
            this.tableColumnFilterService.setFilter(this.column, value);
        }))
            .subscribe();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableColumnFilterInputDirective, deps: [{ token: NgModel }, { token: RXAP_TABLE_FILTER }], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.3", type: TableColumnFilterInputDirective, isStandalone: true, selector: "input[ngModel][rxapTableColumnFilterInput]", inputs: { column: "column" }, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TableColumnFilterInputDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: 'input[ngModel][rxapTableColumnFilterInput]',
                    standalone: true,
                }]
        }], ctorParameters: () => [{ type: i1$4.NgModel, decorators: [{
                    type: Inject,
                    args: [NgModel]
                }] }, { type: TableColumnFilterService, decorators: [{
                    type: Inject,
                    args: [RXAP_TABLE_FILTER]
                }] }], propDecorators: { column: [{
                type: Input,
                args: [{ required: true }]
            }] } });

class CheckboxHeaderCellComponent {
    constructor(cdkTable, selectRow) {
        this.cdkTable = cdkTable;
        this.selectRow = selectRow;
        this.indeterminate$ = EMPTY;
        this.checked$ = EMPTY;
        this.isMultipleSelection = false;
        this.isMultipleSelection =
            this.selectRow.selectionModel.isMultipleSelection();
    }
    ngOnInit() {
        this.indeterminate$ = this.selectRow.selectedRows$.pipe(map((selectedRows) => !!selectedRows.length &&
            this.cdkTable['_data'].length !== selectedRows.length));
        this.checked$ = this.selectRow.selectedRows$.pipe(map((selectedRows) => !!selectedRows.length &&
            this.cdkTable['_data'].length === selectedRows.length));
    }
    onChange($event) {
        if ($event.checked) {
            this.selectRow.selectionModel.select(...this.cdkTable['_data']);
        }
        else {
            this.selectRow.selectionModel.clear();
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: CheckboxHeaderCellComponent, deps: [{ token: CdkTable }, { token: SelectRowService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: CheckboxHeaderCellComponent, isStandalone: true, selector: "th[rxap-checkbox-header-cell]", ngImport: i0, template: "<mat-checkbox\n  (change)=\"onChange($event)\"\n  *ngIf=\"isMultipleSelection\"\n  [checked]=\"(checked$ | async) ?? false\"\n  [indeterminate]=\"indeterminate$ | async\">\n</mat-checkbox>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: CheckboxHeaderCellComponent, decorators: [{
            type: Component,
            args: [{ selector: 'th[rxap-checkbox-header-cell]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
                        NgIf,
                        MatCheckboxModule,
                        AsyncPipe,
                    ], template: "<mat-checkbox\n  (change)=\"onChange($event)\"\n  *ngIf=\"isMultipleSelection\"\n  [checked]=\"(checked$ | async) ?? false\"\n  [indeterminate]=\"indeterminate$ | async\">\n</mat-checkbox>\n" }]
        }], ctorParameters: () => [{ type: i1.CdkTable, decorators: [{
                    type: Inject,
                    args: [CdkTable]
                }] }, { type: SelectRowService }] });

class CheckboxCellComponent {
    constructor(selectRow) {
        this.selectRow = selectRow;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: CheckboxCellComponent, deps: [{ token: SelectRowService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: CheckboxCellComponent, isStandalone: true, selector: "td[rxap-checkbox-cell]", inputs: { element: "element" }, ngImport: i0, template: "<mat-checkbox\n  (change)=\"selectRow.selectionModel.toggle(element)\"\n  [checked]=\"selectRow.selectionModel.isSelected(element)\">\n</mat-checkbox>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: CheckboxCellComponent, decorators: [{
            type: Component,
            args: [{ selector: 'td[rxap-checkbox-cell]', changeDetection: ChangeDetectionStrategy.Default, imports: [MatCheckboxModule], template: "<mat-checkbox\n  (change)=\"selectRow.selectionModel.toggle(element)\"\n  [checked]=\"selectRow.selectionModel.isSelected(element)\">\n</mat-checkbox>\n" }]
        }], ctorParameters: () => [{ type: SelectRowService, decorators: [{
                    type: Inject,
                    args: [SelectRowService]
                }] }], propDecorators: { element: [{
                type: Input,
                args: [{ required: true }]
            }] } });

class SelectedRowsDirective {
    constructor(template, viewContainerRef, cdr, selectRowService) {
        this.template = template;
        this.viewContainerRef = viewContainerRef;
        this.cdr = cdr;
        this.selectRowService = selectRowService;
    }
    ngOnDestroy() {
        this._subscription?.unsubscribe();
    }
    ngOnInit() {
        this._subscription = this.selectRowService.selectedRows$.pipe(distinctUntilChanged(), tap(selectedAllRows => {
            this.viewContainerRef.clear();
            if (selectedAllRows) {
                this.viewContainerRef.createEmbeddedView(this.template, { $implicit: this.selectRowService.selectedRows });
            }
            this.cdr.detectChanges();
        })).subscribe();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: SelectedRowsDirective, deps: [{ token: TemplateRef }, { token: ViewContainerRef }, { token: ChangeDetectorRef }, { token: SelectRowService }], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.3", type: SelectedRowsDirective, isStandalone: true, selector: "[rxapSelectedRows]", ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: SelectedRowsDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[rxapSelectedRows]',
                    standalone: true,
                }]
        }], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{
                    type: Inject,
                    args: [TemplateRef]
                }] }, { type: i0.ViewContainerRef, decorators: [{
                    type: Inject,
                    args: [ViewContainerRef]
                }] }, { type: i0.ChangeDetectorRef, decorators: [{
                    type: Inject,
                    args: [ChangeDetectorRef]
                }] }, { type: SelectRowService, decorators: [{
                    type: Inject,
                    args: [SelectRowService]
                }] }] });

class SelectRowModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: SelectRowModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: SelectRowModule, imports: [SelectedRowsDirective,
            CheckboxCellComponent,
            CheckboxHeaderCellComponent], exports: [CheckboxCellComponent,
            CheckboxHeaderCellComponent,
            SelectedRowsDirective] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: SelectRowModule, imports: [CheckboxCellComponent,
            CheckboxHeaderCellComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: SelectRowModule, decorators: [{
            type: NgModule,
            args: [{
                    exports: [
                        CheckboxCellComponent,
                        CheckboxHeaderCellComponent,
                        SelectedRowsDirective,
                    ],
                    imports: [
                        SelectedRowsDirective,
                        CheckboxCellComponent,
                        CheckboxHeaderCellComponent,
                    ],
                }]
        }] });

class ExpandRowContentDirective {
    static ngTemplateContextGuard(dir, ctx) {
        return true;
    }
    constructor(template) {
        this.template = template;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ExpandRowContentDirective, deps: [{ token: TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.3", type: ExpandRowContentDirective, isStandalone: true, selector: "[rxapExpandRowContent]", ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ExpandRowContentDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[rxapExpandRowContent]',
                    standalone: true,
                }]
        }], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{
                    type: Inject,
                    args: [TemplateRef]
                }] }] });

class ExpandRowService {
    constructor() {
        this.expandedRow = new BehaviorSubject(null);
    }
    toggleRow(row) {
        if (this.expandedRow.value === row) {
            this.expandedRow.next(null);
        }
        else {
            this.expandedRow.next(row);
        }
    }
    isExpanded(row) {
        return this.expandedRow.value === row;
    }
    isExpanded$(row) {
        return this.expandedRow.pipe(map((expandedRow) => expandedRow === row));
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ExpandRowService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ExpandRowService }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ExpandRowService, decorators: [{
            type: Injectable
        }] });

class ExpandRowContainerComponent {
    constructor(viewContainerRef, expandCell) {
        this.viewContainerRef = viewContainerRef;
        this.expandCell = expandCell;
        this.portal = null;
    }
    ngOnDestroy() {
        this._subscription?.unsubscribe();
    }
    ngAfterContentInit() {
        if (this.expandCellContent) {
            this._subscription = this.expandCell.isExpanded$(this.element).pipe(filter(Boolean), tap(() => {
                if (!this.portal) {
                    this.portal =
                        new TemplatePortal(this.expandCellContent.template, this.viewContainerRef, { $implicit: this.element });
                }
            })).subscribe();
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ExpandRowContainerComponent, deps: [{ token: ViewContainerRef }, { token: ExpandRowService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: ExpandRowContainerComponent, isStandalone: true, selector: "td[rxap-expand-row]", inputs: { element: "element" }, queries: [{ propertyName: "expandCellContent", first: true, predicate: ExpandRowContentDirective, descendants: true }], ngImport: i0, template: "<div [@detailExpand]=\"(expandCell.isExpanded$(element) | async) ? 'expanded' : 'collapsed'\" class=\"element-detail\">\n  <ng-content></ng-content>\n  <ng-template [cdkPortalOutlet]=\"portal\"></ng-template>\n</div>\n", styles: [".element-detail{overflow:hidden;display:flex}\n"], dependencies: [{ kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i1$5.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], animations: [
            trigger('detailExpand', [
                state('collapsed', style({
                    height: '0px',
                    minHeight: '0',
                })),
                state('expanded', style({ height: '*' })),
                transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
            ]),
        ], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ExpandRowContainerComponent, decorators: [{
            type: Component,
            args: [{ selector: 'td[rxap-expand-row]', changeDetection: ChangeDetectionStrategy.OnPush, animations: [
                        trigger('detailExpand', [
                            state('collapsed', style({
                                height: '0px',
                                minHeight: '0',
                            })),
                            state('expanded', style({ height: '*' })),
                            transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
                        ]),
                    ], imports: [PortalModule, AsyncPipe], template: "<div [@detailExpand]=\"(expandCell.isExpanded$(element) | async) ? 'expanded' : 'collapsed'\" class=\"element-detail\">\n  <ng-content></ng-content>\n  <ng-template [cdkPortalOutlet]=\"portal\"></ng-template>\n</div>\n", styles: [".element-detail{overflow:hidden;display:flex}\n"] }]
        }], ctorParameters: () => [{ type: i0.ViewContainerRef, decorators: [{
                    type: Inject,
                    args: [ViewContainerRef]
                }] }, { type: ExpandRowService, decorators: [{
                    type: Inject,
                    args: [ExpandRowService]
                }] }], propDecorators: { element: [{
                type: Input,
                args: [{ required: true }]
            }], expandCellContent: [{
                type: ContentChild,
                args: [ExpandRowContentDirective]
            }] } });

class ExpandControlsCellComponent {
    constructor(expandCell) {
        this.expandCell = expandCell;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ExpandControlsCellComponent, deps: [{ token: ExpandRowService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: ExpandControlsCellComponent, isStandalone: true, selector: "td[rxap-expand-controls-cell]", inputs: { element: "element" }, ngImport: i0, template: "<button type=\"button\" mat-icon-button>\n  <mat-icon *ngIf=\"expandCell.isExpanded$(element) | async; else notExpanded\">expand_more</mat-icon>\n  <ng-template #notExpanded>\n    <mat-icon>keyboard_arrow_right</mat-icon>\n  </ng-template>\n</button>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ExpandControlsCellComponent, decorators: [{
            type: Component,
            args: [{ selector: 'td[rxap-expand-controls-cell]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, NgIf, MatIconModule, AsyncPipe], template: "<button type=\"button\" mat-icon-button>\n  <mat-icon *ngIf=\"expandCell.isExpanded$(element) | async; else notExpanded\">expand_more</mat-icon>\n  <ng-template #notExpanded>\n    <mat-icon>keyboard_arrow_right</mat-icon>\n  </ng-template>\n</button>\n" }]
        }], ctorParameters: () => [{ type: ExpandRowService, decorators: [{
                    type: Inject,
                    args: [ExpandRowService]
                }] }], propDecorators: { element: [{
                type: Input,
                args: [{ required: true }]
            }] } });

class ExpandRowDirective {
    get isExpanded() {
        return this.expandCell.isExpanded(this.element);
    }
    constructor(expandCell) {
        this.expandCell = expandCell;
    }
    onClick() {
        this.expandCell.toggleRow(this.element);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ExpandRowDirective, deps: [{ token: ExpandRowService }], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.3", type: ExpandRowDirective, isStandalone: true, selector: "tr[rxapExpandRow]", inputs: { element: "element" }, host: { listeners: { "expanded-row": "isExpanded()", "click": "onClick()" } }, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ExpandRowDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: 'tr[rxapExpandRow]',
                    standalone: true,
                }]
        }], ctorParameters: () => [{ type: ExpandRowService, decorators: [{
                    type: Inject,
                    args: [ExpandRowService]
                }] }], propDecorators: { isExpanded: [{
                type: HostListener,
                args: ['expanded-row']
            }], element: [{
                type: Input,
                args: [{ required: true }]
            }], onClick: [{
                type: HostListener,
                args: ['click']
            }] } });

class ExpandRowModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ExpandRowModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: ExpandRowModule, imports: [ExpandRowDirective], exports: [ExpandRowDirective] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ExpandRowModule, providers: [
            ExpandRowService,
        ] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ExpandRowModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [ExpandRowDirective],
                    exports: [
                        ExpandRowDirective,
                    ],
                    providers: [
                        ExpandRowService,
                    ],
                }]
        }] });

class TreeControlCellComponent {
    ngOnInit() {
        this.offset = (this.element.__node.depth * 24) + 'px';
        this.updateIcon();
    }
    ngDoCheck() {
        this.updateIcon();
    }
    toggleExpand() {
        return this.element.__node.toggleExpand();
    }
    updateIcon() {
        this.icon = this.element.icon;
        if (this.element.__node.hasChildren) {
            if (this.element.__node.expanded) {
                this.expandIcon = 'expand_more';
            }
            else {
                this.expandIcon = 'expand_less';
            }
        }
        else {
            this.icon ??= { icon: 'subdirectory_arrow_right' };
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TreeControlCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: TreeControlCellComponent, isStandalone: true, selector: "rxap-tree-control-cell, td[rxap-tree-control-cell]", inputs: { element: ["rxap-tree-control-cell", "element"] }, ngImport: i0, template: "<div class=\"flex flex-row justify-start items-center\">\n  <div class=\"pl-[{{ offset }}]\">\n    <button type=\"button\" (click)=\"toggleExpand()\" mat-icon-button>\n      <mat-icon>{{expandIcon}}</mat-icon>\n    </button>\n  </div>\n  <div *ngIf=\"icon\">\n    <mat-icon [rxapIcon]=\"icon\"></mat-icon>\n  </div>\n  <div class=\"content\">\n    <ng-content></ng-content>\n  </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: IconDirective, selector: "mat-icon[rxapIcon]", inputs: ["rxapIcon"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: TreeControlCellComponent, decorators: [{
            type: Component,
            args: [{ selector: 'rxap-tree-control-cell, td[rxap-tree-control-cell]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
                        MatButtonModule,
                        MatIconModule,
                        IconDirective,
                        NgIf,
                    ], template: "<div class=\"flex flex-row justify-start items-center\">\n  <div class=\"pl-[{{ offset }}]\">\n    <button type=\"button\" (click)=\"toggleExpand()\" mat-icon-button>\n      <mat-icon>{{expandIcon}}</mat-icon>\n    </button>\n  </div>\n  <div *ngIf=\"icon\">\n    <mat-icon [rxapIcon]=\"icon\"></mat-icon>\n  </div>\n  <div class=\"content\">\n    <ng-content></ng-content>\n  </div>\n</div>\n" }]
        }], propDecorators: { element: [{
                type: Input,
                args: ['rxap-tree-control-cell']
            }] } });

class OptionsCellComponent {
    constructor(renderer) {
        this.renderer = renderer;
        this._subscription = new Subscription();
        this._initialised = false;
        this.defaultViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.unknown:unknown`;
        this.emptyViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.empty:empty`;
    }
    ngAfterContentInit() {
        // Hide the mat-option elements
        this._subscription.add(this.options.changes.pipe(startWith(null), tap(() => this.options.forEach(option => this.renderer.setStyle(option._getHostElement(), 'display', 'none')))).subscribe());
        this.setViewValue();
        this._initialised = true;
    }
    setViewValue() {
        if (this.value === undefined || this.value === null) {
            this.viewValue = this.emptyViewValue;
        }
        else {
            if (this.options) {
                this._subscription.add(this.options.changes
                    .pipe(startWith(null), tap(() => (this.viewValue = this.getViewValue())))
                    .subscribe());
            }
            else if (isDevMode()) {
                console.log('Could not load any option');
            }
        }
    }
    ngOnChanges(changes) {
        if (this._initialised) {
            if (changes['value']) {
                this.setViewValue();
            }
        }
    }
    getViewValue() {
        return (this.options.find((option) => option.value === this.value)?.viewValue ??
            this.defaultViewValue);
    }
    ngOnDestroy() {
        this._subscription?.unsubscribe();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: OptionsCellComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: OptionsCellComponent, isStandalone: true, selector: "td[rxap-options-cell]", inputs: { value: ["rxap-options-cell", "value"], defaultViewValue: ["default", "defaultViewValue"], emptyViewValue: ["empty", "emptyViewValue"] }, queries: [{ propertyName: "options", predicate: MatOption, descendants: true }], usesOnChanges: true, ngImport: i0, template: "{{viewValue}}\n<ng-content></ng-content>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: OptionsCellComponent, decorators: [{
            type: Component,
            args: [{ selector: 'td[rxap-options-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "{{viewValue}}\n<ng-content></ng-content>\n" }]
        }], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { value: [{
                type: Input,
                args: ['rxap-options-cell']
            }], defaultViewValue: [{
                type: Input,
                args: ['default']
            }], emptyViewValue: [{
                type: Input,
                args: ['empty']
            }], options: [{
                type: ContentChildren,
                args: [MatOption, { descendants: true }]
            }] } });

class LinkCellComponent {
    constructor() {
        this.short = true;
    }
    get href() {
        if (this.protocol) {
            return [this.protocol, this.value].join(':');
        }
        return this.value;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: LinkCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: LinkCellComponent, isStandalone: true, selector: "td[rxap-link-cell]", inputs: { value: ["rxap-link-cell", "value"], protocol: "protocol", short: "short" }, ngImport: i0, template: "<a *ngIf=\"value\" [href]=\"href\" [matTooltip]=\"value\" class=\"link\" target=\"_blank\">\n  <span class=\"flex flex-row items-center gap-2\">\n    <span *ngIf=\"short\" class=\"content grow-0\" i18n>Open</span>\n    <ng-container [ngSwitch]=\"protocol\">\n      <mat-icon *ngSwitchCase=\"'tel'\" class=\"grow-0\">call</mat-icon>\n      <mat-icon *ngSwitchCase=\"'mailto'\" class=\"grow-0\">email</mat-icon>\n      <mat-icon *ngSwitchDefault class=\"grow-0\">launch</mat-icon>\n    </ng-container>\n    <span *ngIf=\"!short\" class=\"content grow-0\">{{value}}</span>\n  </span>\n</a>\n<ng-content></ng-content>\n", styles: [".link{text-decoration:none;color:inherit}.link .content{max-width:160px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgSwitchDefault, selector: "[ngSwitchDefault]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: LinkCellComponent, decorators: [{
            type: Component,
            args: [{ selector: 'td[rxap-link-cell]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgIf, MatTooltipModule, NgSwitch, NgSwitchCase, MatIconModule, NgSwitchDefault], template: "<a *ngIf=\"value\" [href]=\"href\" [matTooltip]=\"value\" class=\"link\" target=\"_blank\">\n  <span class=\"flex flex-row items-center gap-2\">\n    <span *ngIf=\"short\" class=\"content grow-0\" i18n>Open</span>\n    <ng-container [ngSwitch]=\"protocol\">\n      <mat-icon *ngSwitchCase=\"'tel'\" class=\"grow-0\">call</mat-icon>\n      <mat-icon *ngSwitchCase=\"'mailto'\" class=\"grow-0\">email</mat-icon>\n      <mat-icon *ngSwitchDefault class=\"grow-0\">launch</mat-icon>\n    </ng-container>\n    <span *ngIf=\"!short\" class=\"content grow-0\">{{value}}</span>\n  </span>\n</a>\n<ng-content></ng-content>\n", styles: [".link{text-decoration:none;color:inherit}.link .content{max-width:160px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"] }]
        }], propDecorators: { value: [{
                type: Input,
                args: ['rxap-link-cell']
            }], protocol: [{
                type: Input
            }], short: [{
                type: Input
            }] } });

class ImageCellComponent {
    constructor() {
        this.size = BackgroundSizeOptions.COVER;
        this.repeat = BackgroundRepeatOptions.NO_REPEAT;
        this.position = BackgroundPositionOptions.CENTER_CENTER;
        this.value = null;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ImageCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: ImageCellComponent, isStandalone: true, selector: "td[rxap-image-cell]", inputs: { preset: "preset", size: "size", repeat: "repeat", position: "position", value: ["rxap-image-cell", "value"] }, ngImport: i0, template: "<div\n  *ngIf=\"value\"\n  [ngClass]=\"[preset]\"\n  [position]=\"position\"\n  [repeat]=\"repeat\"\n  [rxapBackgroundImage]=\"value\"\n  [size]=\"size\"\n  class=\"image\">\n</div>\n<ng-content></ng-content>\n", styles: [".image{width:40px;height:40px}.image.circle{border-radius:24px}.image.rounded{border-radius:8px}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: BackgroundImageDirective, selector: "[rxapBackgroundImage]", inputs: ["rxapBackgroundImage", "placeholderImageUrl", "size", "repeat", "position"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ImageCellComponent, decorators: [{
            type: Component,
            args: [{ selector: 'td[rxap-image-cell]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgIf, NgClass, BackgroundImageDirective], template: "<div\n  *ngIf=\"value\"\n  [ngClass]=\"[preset]\"\n  [position]=\"position\"\n  [repeat]=\"repeat\"\n  [rxapBackgroundImage]=\"value\"\n  [size]=\"size\"\n  class=\"image\">\n</div>\n<ng-content></ng-content>\n", styles: [".image{width:40px;height:40px}.image.circle{border-radius:24px}.image.rounded{border-radius:8px}\n"] }]
        }], propDecorators: { preset: [{
                type: Input
            }], size: [{
                type: Input
            }], repeat: [{
                type: Input
            }], position: [{
                type: Input
            }], value: [{
                type: Input,
                args: ['rxap-image-cell']
            }] } });

class IconCellComponent {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: IconCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: IconCellComponent, isStandalone: true, selector: "td[rxap-icon-cell]", inputs: { icon: ["rxap-icon-cell", "icon"] }, ngImport: i0, template: "<mat-icon *ngIf=\"icon\" [rxapIcon]=\"icon\"></mat-icon>\n<ng-content></ng-content>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: IconDirective, selector: "mat-icon[rxapIcon]", inputs: ["rxapIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: IconCellComponent, decorators: [{
            type: Component,
            args: [{ selector: 'td[rxap-icon-cell]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgIf, MatIconModule, IconDirective], template: "<mat-icon *ngIf=\"icon\" [rxapIcon]=\"icon\"></mat-icon>\n<ng-content></ng-content>\n" }]
        }], propDecorators: { icon: [{
                type: Input,
                args: ['rxap-icon-cell']
            }] } });

class DateCellComponent {
    constructor() {
        this.date = null;
        this.format = 'dd.MM.yyyy HH:mm';
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: DateCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: DateCellComponent, isStandalone: true, selector: "td[rxap-date-cell]", inputs: { date: ["rxap-date-cell", "date"], format: "format" }, ngImport: i0, template: "<ng-template [ngIf]=\"date\">\n  {{date | date:format}}\n</ng-template>\n<ng-content></ng-content>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: DateCellComponent, decorators: [{
            type: Component,
            args: [{ selector: 'td[rxap-date-cell]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgIf, DatePipe], template: "<ng-template [ngIf]=\"date\">\n  {{date | date:format}}\n</ng-template>\n<ng-content></ng-content>\n" }]
        }], propDecorators: { date: [{
                type: Input,
                args: ['rxap-date-cell']
            }], format: [{
                type: Input
            }] } });

class CopyToClipboardCellComponent {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: CopyToClipboardCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: CopyToClipboardCellComponent, isStandalone: true, selector: "td[rxap-copy-to-clipboard-cell]", inputs: { value: ["rxap-copy-to-clipboard-cell", "value"] }, ngImport: i0, template: "<rxap-copy-to-clipboard *ngIf=\"value !== null && value !== undefined && value !== ''\" [value]=\"value\"\n                        class=\"copy-to-clipboard\"></rxap-copy-to-clipboard>\n<ng-content></ng-content>\n", styles: ["::ng-deep .copy-to-clipboard .content{max-width:160px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CopyToClipboardComponent, selector: "rxap-copy-to-clipboard", inputs: ["active", "disabled", "value"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: CopyToClipboardCellComponent, decorators: [{
            type: Component,
            args: [{ selector: 'td[rxap-copy-to-clipboard-cell]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgIf, CopyToClipboardComponent], template: "<rxap-copy-to-clipboard *ngIf=\"value !== null && value !== undefined && value !== ''\" [value]=\"value\"\n                        class=\"copy-to-clipboard\"></rxap-copy-to-clipboard>\n<ng-content></ng-content>\n", styles: ["::ng-deep .copy-to-clipboard .content{max-width:160px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"] }]
        }], propDecorators: { value: [{
                type: Input,
                args: ['rxap-copy-to-clipboard-cell']
            }] } });

class BooleanCellComponent {
    constructor() {
        this.value = null;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: BooleanCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: BooleanCellComponent, isStandalone: true, selector: "td[rxap-boolean-cell]", inputs: { value: ["rxap-boolean-cell", "value"] }, host: { classAttribute: "rxap-boolean-cell" }, ngImport: i0, template: "<ng-template [ngIfElse]=\"isFalse\" [ngIf]=\"value\">\n  <mat-icon class=\"truthy\">check_circle</mat-icon>\n</ng-template>\n<ng-template #isFalse>\n  <mat-icon class=\"falsy\">cancel</mat-icon>\n</ng-template>\n<ng-content></ng-content>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: BooleanCellComponent, decorators: [{
            type: Component,
            args: [{ selector: 'td[rxap-boolean-cell]', changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'rxap-boolean-cell' }, imports: [NgIf, MatIconModule], template: "<ng-template [ngIfElse]=\"isFalse\" [ngIf]=\"value\">\n  <mat-icon class=\"truthy\">check_circle</mat-icon>\n</ng-template>\n<ng-template #isFalse>\n  <mat-icon class=\"falsy\">cancel</mat-icon>\n</ng-template>\n<ng-content></ng-content>\n" }]
        }], propDecorators: { value: [{
                type: Input,
                args: ['rxap-boolean-cell']
            }] } });

class PersistentPaginatorDirective {
    constructor(matPaginator) {
        this.matPaginator = matPaginator;
    }
    ngOnInit() {
        const config = this.restoreConfig();
        if (config) {
            this.matPaginator.pageSize = config.pageSize;
        }
        this._subscription = this.matPaginator.page.pipe(tap(() => this.storeConfig())).subscribe();
    }
    ngOnDestroy() {
        this._subscription?.unsubscribe();
    }
    getKey() {
        return 'rxap_mat-paginator-persistent' + this.id;
    }
    storeConfig() {
        const pageSize = this.matPaginator.pageSize;
        localStorage.setItem(this.getKey(), JSON.stringify({ pageSize }));
    }
    restoreConfig() {
        const configStorage = localStorage.getItem(this.getKey());
        if (configStorage) {
            try {
                return JSON.parse(configStorage);
            }
            catch (e) {
                console.warn(`Could not parse mat paginator persistent config: ${e.message}`);
            }
        }
        return null;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: PersistentPaginatorDirective, deps: [{ token: i1$6.MatPaginator }], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.3", type: PersistentPaginatorDirective, isStandalone: true, selector: "mat-paginator[rxapPersistent]", inputs: { id: "id" }, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: PersistentPaginatorDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: 'mat-paginator[rxapPersistent]',
                    standalone: true,
                }]
        }], ctorParameters: () => [{ type: i1$6.MatPaginator }], propDecorators: { id: [{
                type: Input
            }] } });

const offset = '50';
const RowAnimation = trigger('rowsAnimation', [
    transition('void => *', [
        style({
            height: '*',
            opacity: '0',
            transform: 'translateY(' + (-offset).toString() + 'px)',
            'box-shadow': 'none',
        }),
        sequence([
            animate('.2s ease', style({
                height: '*',
                opacity: '.2',
                transform: 'translateX(0)',
                'box-shadow': 'none',
            })),
            animate('.35s ease', style({
                height: '*',
                opacity: 1,
                transform: 'translateX(0)',
            })),
        ]),
    ]),
    transition('* => void', [
        style({
            height: '0',
            opacity: '0',
            'box-shadow': 'none',
        }),
    ]),
]);

function NormalizeTableRow(row, rowIdOrMapper) {
    row.__rowId = typeof rowIdOrMapper === 'string' ? rowIdOrMapper : rowIdOrMapper(row);
    row.__metadata__ ??= { loading$: new ToggleSubject() };
    row.__metadata__.loading$ ??= new ToggleSubject();
    return row;
}

// region table-select-controls
// endregion

/**
 * Generated bundle index. Do not edit.
 */

export { AbstractTableRowAction, BooleanCellComponent, CheckboxCellComponent, CheckboxHeaderCellComponent, CopyToClipboardCellComponent, DateCellComponent, ExpandControlsCellComponent, ExpandRowContainerComponent, ExpandRowContentDirective, ExpandRowDirective, ExpandRowModule, ExpandRowService, FilterHeaderRowDirective, GetTableHeaderButtonMetadata, GetTableRowActionCheckFunction, GetTableRowActionMetadata, HasTableRowActionCheckFunction, HasTableRowActionMetadata, IconCellComponent, ImageCellComponent, IsTableRowActionTypeMethod, IsTableRowActionTypeSwitchMethod, LinkCellComponent, NormalizeTableRow, OptionsCellComponent, PersistentPaginatorDirective, RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS, RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA, RXAP_TABLE_ACTION_METHOD_METADATA, RXAP_TABLE_ACTION_METHOD_TYPE_METADATA, RXAP_TABLE_FILTER, RXAP_TABLE_FILTER_FORM_DEFINITION, RXAP_TABLE_HEADER_BUTTON_METHOD_METADATA, RXAP_TABLE_ROW_ACTION_METHOD, RowActionCheckPipe, RowAnimation, SelectRowModule, SelectRowService, SelectedRowsDirective, SelectionModel, TABLE_CREATE_REMOTE_METHOD, TABLE_DATA_SOURCE, TABLE_HEADER_BUTTON_METHOD, TABLE_REMOTE_METHOD, TABLE_REMOTE_METHOD_ADAPTER_FACTORY, TableActionMethod, TableColumnFilterInputDirective, TableColumnFilterService, TableColumnMenuComponent, TableColumnMenuModule, TableColumnOptionComponent, TableCreateButtonDirective, TableDataSourceDirective, TableFilterModule, TableFilterService, TableHeaderButtonActionStatus, TableHeaderButtonDirective, TableHeaderButtonMethod, TableRowActionDirective, TableRowActionExecutingDirective, TableRowActionStatus, TableRowActionsModule, TableRowHeaderActionDirective, TableSelectControlsComponent, TableShowArchivedSlideComponent, ToFilterColumnNamesPipe, TreeControlCellComponent, getMultipleValuesInSingleSelectionError };
//# sourceMappingURL=rxap-material-table-system.mjs.map