'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-a0b63bee.js');

const DgaTableBody = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.data = [
            {
                selected: true,
            },
            {
                selected: true,
            },
        ];
        this.rowDivider = true;
        this.showSelectCheckBox = true;
        this.alternate = true;
        this.cells = [
            {
                propertyName: 'test',
                isFilter: false,
                isSort: false,
                title: 'Test',
                type: 'propertyName',
                colSpan: 1,
            },
            {
                propertyName: 'test',
                isFilter: false,
                isSort: false,
                title: 'Test',
                type: 'propertyName',
                colSpan: 1,
            },
        ];
        this.contained = true;
        this.sortedData = [];
        this.direction = false;
    }
    // private sortData = (sortType: 'up' | 'down' = 'up', sortingProperty: string, index: number) => {
    //   if (sortType === 'up') {
    //     const clonedData = [...this.data.sort((a, b) => (b[sortingProperty] > a[sortingProperty] ? 1 : a[sortingProperty] > b[sortingProperty] ? -1 : 0))];
    //     this.sortedData = clonedData;
    //   } else if (sortType === 'down') {
    //     const clonedData = [...this.data.sort((a, b) => (a[sortingProperty] > b[sortingProperty] ? 1 : b[sortingProperty] > a[sortingProperty] ? -1 : 0))];
    //     this.sortedData = clonedData;
    //   }
    //   this.cells[index].sort = sortType == 'down' ? 'up' : 'down';
    // };
    // private handleSelectedRowChanges = (checked: boolean, index: number) => {
    //   const cloneData = [...this.data];
    //   cloneData[index].selected = checked;
    //   this.sortedData = cloneData;
    //   if (this.getSelectedRows) {
    //     this.getSelectedRows({
    //       selectedRows: cloneData.filter(item => item.selected),
    //       currentSelectedRow: cloneData[index],
    //       currentSelectedRowIndex: index,
    //     });
    //   }
    // };
    // private selectAll = (checked: boolean) => {
    //   const cloneData = [...this.data];
    //   cloneData.forEach(item => (item.selected = checked));
    //   this.sortedData = cloneData;
    //   if (this.getSelectedRows) {
    //     this.getSelectedRows({
    //       selectedRows: cloneData,
    //     });
    //   }
    // };
    componentDidLoad() {
        if (document.dir) {
            if (document.dir === 'rtl')
                this.direction = true;
            else
                this.direction = false;
        }
        else if (document.documentElement.lang) {
            if (document.documentElement.lang === 'ar')
                this.direction = true;
            else
                this.direction = false;
        }
        else
            this.direction = false;
    }
    componentDidUpdate() {
        const cloneData = [
            ...this.data.map(item => {
                item.selected = false;
                return item;
            }),
        ];
        this.sortedData = cloneData;
    }
    //     @Prop() onColor: boolean;
    //     @Prop() size: "sm" | "md" | "lg";
    //     @Prop() items: {
    //         label: React.ReactNode;
    //         content: React.ReactNode;
    //     }[] = [
    //         {
    //             label:"test label",
    //             content:"test content"
    //         },
    //         {
    //             label:"test label",
    //             content:"test content"
    //         },
    //         {
    //             label:"test label",
    //             content:"test content"
    //         }
    //     ];
    //     @State() selected: number = 0;
    //     private handleSelect = (index: number) => {
    //         this.selected = index;
    //     };
    render() {
        return (index.h("tbody", { key: '48142e2774bb03fffc484c16ffe09b0e03b2b0f2' }, index.h("slot", { key: '198b71060f1c78f0b788ea6aa5f09f09834769a1' })));
    }
};

exports.dga_table_body = DgaTableBody;

//# sourceMappingURL=dga-table-body.cjs.entry.js.map