import { CDK_TABLE_TEMPLATE, CdkTable, CDK_TABLE, _CoalescedStyleScheduler, _COALESCED_STYLE_SCHEDULER, STICKY_POSITIONING_LISTENER, } from '@angular/cdk/table';
import { ChangeDetectionStrategy, Component, Directive, ViewEncapsulation, } from '@angular/core';
import { _DisposeViewRepeaterStrategy, _RecycleViewRepeaterStrategy, _VIEW_REPEATER_STRATEGY, } from '@angular/cdk/collections';
/**
 * Enables the recycle view repeater strategy, which reduces rendering latency. Not compatible with
 * tables that anire rows.
 */
export class RRecycleRows {
}
RRecycleRows.decorators = [
    { type: Directive, args: [{
                selector: 'r-table[recycleRows], table[r-table][recycleRows]',
                providers: [
                    {
                        provide: _VIEW_REPEATER_STRATEGY,
                        useClass: _RecycleViewRepeaterStrategy,
                    },
                ],
            },] }
];
/**
 * Wrapper for the CdkTable with Rerial design styles.
 */
export class RTable extends CdkTable {
    constructor() {
        super(...arguments);
        /** Overrides the sticky CSS class set by the `CdkTable`. */
        this.stickyCssClass = 'r-table-sticky';
        /** Overrides the need to add position: sticky on every sticky cell element in `CdkTable`. */
        this.needsPositionStickyOnElement = false;
    }
}
RTable.decorators = [
    { type: Component, args: [{
                selector: 'r-table, table[r-table]',
                exportAs: 'rTable',
                template: CDK_TABLE_TEMPLATE,
                host: {
                    class: 'r-table',
                    '[class.r-table-fixed-layout]': 'fixedLayout',
                },
                providers: [
                    // TODO(michaeljamesparsons) Abstract the view repeater strategy to a directive API so this code
                    //  is only included in the build if used.
                    {
                        provide: _VIEW_REPEATER_STRATEGY,
                        useClass: _DisposeViewRepeaterStrategy,
                    },
                    { provide: CdkTable, useExisting: RTable },
                    { provide: CDK_TABLE, useExisting: RTable },
                    { provide: _COALESCED_STYLE_SCHEDULER, useClass: _CoalescedStyleScheduler },
                    // Prevent nested tables from seeing this table's StickyPositioningListener.
                    { provide: STICKY_POSITIONING_LISTENER, useValue: null },
                ],
                encapsulation: ViewEncapsulation.None,
                // See note on CdkTable for explanation on why this uses the default change detection strategy.
                // tslint:disable-next-line:validate-decorators
                changeDetection: ChangeDetectionStrategy.Default,
                styles: ["r-table{display:block}r-header-row{min-height:56px}r-footer-row,r-row{min-height:48px}r-footer-row,r-header-row,r-row{display:flex;border-width:0 0 1px;border-style:solid;align-items:center;box-sizing:border-box}r-footer-row:after,r-header-row:after,r-row:after{display:inline-block;min-height:inherit;content:\"\"}r-cell:first-of-type,r-footer-cell:first-of-type,r-header-cell:first-of-type{padding-left:24px}[dir=rtl] r-cell:first-of-type:not(:only-of-type),[dir=rtl] r-footer-cell:first-of-type:not(:only-of-type),[dir=rtl] r-header-cell:first-of-type:not(:only-of-type){padding-left:0;padding-right:24px}r-cell:last-of-type,r-footer-cell:last-of-type,r-header-cell:last-of-type{padding-right:24px}[dir=rtl] r-cell:last-of-type:not(:only-of-type),[dir=rtl] r-footer-cell:last-of-type:not(:only-of-type),[dir=rtl] r-header-cell:last-of-type:not(:only-of-type){padding-right:0;padding-left:24px}r-cell,r-footer-cell,r-header-cell{flex:1;display:flex;align-items:center;overflow:hidden;word-wrap:break-word;min-height:inherit}table.r-table{border-spacing:0}tr.r-header-row{height:56px}tr.r-footer-row,tr.r-row{height:48px}th.r-header-cell{text-align:left}[dir=rtl] th.r-header-cell{text-align:right}td.r-cell,td.r-footer-cell,th.r-header-cell{padding:0;border-bottom-width:1px;border-bottom-style:solid}td.r-cell:first-of-type,td.r-footer-cell:first-of-type,th.r-header-cell:first-of-type{padding-left:24px}[dir=rtl] td.r-cell:first-of-type:not(:only-of-type),[dir=rtl] td.r-footer-cell:first-of-type:not(:only-of-type),[dir=rtl] th.r-header-cell:first-of-type:not(:only-of-type){padding-left:0;padding-right:24px}td.r-cell:last-of-type,td.r-footer-cell:last-of-type,th.r-header-cell:last-of-type{padding-right:24px}[dir=rtl] td.r-cell:last-of-type:not(:only-of-type),[dir=rtl] td.r-footer-cell:last-of-type:not(:only-of-type),[dir=rtl] th.r-header-cell:last-of-type:not(:only-of-type){padding-right:0;padding-left:24px}.r-table-sticky{position:sticky!important}.r-table-fixed-layout{table-layout:fixed}"]
            },] }
];
//# sourceMappingURL=table.js.map