import { View } from './View';
/**
 * Columns, filter and sorts for a UI list component.
 */
export class List extends View {
    getColumnAt(propName) {
        if (this.columns) {
            return this.columns.find((column) => {
                return propName === column.propertyName;
            });
        }
        return null;
    }
    get isDefaultStyle() {
        return this.style && this.style === 'DEFAULT';
    }
    get isDetailsFormStyle() {
        return this.style && this.style === 'DETAILS_FORM';
    }
    get isFormStyle() {
        return this.style && this.style === 'FORM';
    }
    get isTabularStyle() {
        return this.style && this.style === 'TABULAR';
    }
    get columnHeadings() {
        return this.columns.map((c) => {
            return c.heading;
        });
    }
    rowValues(record) {
        return this.columns.map((c) => {
            return record.valueAtName(c.propertyName);
        });
    }
}
