import Component from '@ember/component'; import { DefaultTableComponents } from '../constants/default-table-properties'; import { INachoTableConfigs } from '@nacho-ui/table/types/nacho-table'; export default class NachoTable extends Component { layout: any; /** * Default component paths for the different parts of the table * @type {DefaultTableComponents} */ tableHeaderComponent: DefaultTableComponents; tableBodyComponent: DefaultTableComponents; tableRowComponent: DefaultTableComponents; tableFooterComponent: DefaultTableComponents; tableGlobalComponent: DefaultTableComponents; /** * Passed in table data. This should be an array of objects that represent each row. The * objects themselves can have any interface deemed appropriate by the consumer. * @type {Array} */ data: Array; /** * Passed in table configurations. This is the source of truth that helps us construct a table * based on the consumer needs and should be generic and highly customizable. * @type {INachoTableConfigs} */ tableConfigs: INachoTableConfigs; /** * Additional table classes passed in as a string to be added to the actual table itself. Helpful * for when the host application wants to add overrides to the base nacho stylings or simply for * BEM purposes * @type {string} */ tableClass: string; readonly tableClasses: { main: string; global: string; }; /** * Quick computation to determine whether or not we have any table configs */ noConfigs: boolean; /** * Initial computation for our fields. Can be expanded over time as our table operations grow * in complexity * @type {ComputedProperty} */ readonly fields: NachoTable['data']; }