balm-ui
Version:
A modular and customizable UI library based on Material Design and Vue 3
49 lines (48 loc) • 963 B
JavaScript
// Define data table constants
export default {
cssClasses: {
left: 'mdc-data-table__cell--left',
center: 'mdc-data-table__cell--center',
right: 'mdc-data-table__cell--right'
},
CELL: {
ROW_ID: 'rowId',
CHECKBOX: 'checkbox',
SELECTED: 'selected',
ACTIONS: 'actions',
// common config
VALUE: 'value',
NUMBER: 'numeric',
ALIGN: 'align',
CLASS: 'class',
STYLE: 'style',
// thead config
SORTING: 'sort',
ROWSPAN: 'rowspan',
COLSPAN: 'colspan',
// tbody & tfoot config
FIELD: 'field',
FUNCTION: 'fn',
SLOT: 'slot',
FIXED: 'fixed',
// tfoot config
FUNCTION_NAME: 'fnName' // For AGG
},
SORTING: {
ICON: 'arrow_upward',
ASC: 'asc',
DESC: 'desc'
},
AGG: {
COUNT: 'count',
SUM: 'sum',
AVG: 'avg',
MAX: 'max',
MIN: 'min'
},
EVENTS: {
CHANGE: 'update:modelValue',
SORTED: 'sorted'
},
CHECKBOX_COL_WIDTH: 50 // px
};