@mezzanine-ui/core
Advanced tools
Comparing version 0.8.1 to 0.9.0
{ | ||
"name": "@mezzanine-ui/core", | ||
"version": "0.8.1", | ||
"version": "0.9.0", | ||
"description": "Core for mezzanine-ui", | ||
@@ -5,0 +5,0 @@ "author": "Mezzanine", |
@@ -1,1 +0,1 @@ | ||
export { tableBodyPrefix, tableCellPrefix, tableClasses, tableHeaderPrefix, tablePrefix } from './table.js'; | ||
export { getCellStyle, getColumnStyle, tableBodyPrefix, tableCellPrefix, tableClasses, tableHeaderPrefix, tablePrefix } from './table.js'; |
@@ -15,2 +15,5 @@ export declare const tablePrefix = "mzn-table"; | ||
readonly bodyRowCellWrapper: `${string}__row__cellWrapper`; | ||
readonly bodyRowExpandedTableWrapper: `${string}__row__expandedTableWrapper`; | ||
readonly bodyRowExpandedTable: `${string}__row__expandedTable`; | ||
readonly bodyRowExpandedTableRow: `${string}__row__expandedTableRow`; | ||
readonly cell: string; | ||
@@ -46,3 +49,3 @@ readonly cellEllipsis: `${string}__ellipsis`; | ||
sorter?(a: any, b: any): number; | ||
onSorted?(sortedDataSource: SourceType[]): void; | ||
onSorted?(dataIndex: string, sortedType: string): void; | ||
editable?: boolean; | ||
@@ -55,2 +58,3 @@ setCellProps?(record: SourceType): TableRecord<unknown>; | ||
}; | ||
export declare type ExpandedTableColumn = Omit<TableColumn<TableRecord<unknown>>, 'title' | 'renderTitle' | 'align' | 'headerClassName' | 'width' | 'sorter' | 'onSorted' | 'editable' | 'setCellProps'>; | ||
export declare type TableFetchMore = { | ||
@@ -76,4 +80,8 @@ callback?(): any; | ||
className?: string; | ||
expandedRowRender(record: SourceType): any; | ||
expandedRowRender(record: SourceType): string | { | ||
dataSource: TableDataSource[]; | ||
columns?: ExpandedTableColumn[]; | ||
}; | ||
rowExpandable?(record: SourceType): boolean; | ||
onExpand?(record: SourceType, status: boolean): void; | ||
} | ||
@@ -108,1 +116,4 @@ /** === Feature Pagination */ | ||
} | ||
/** styling */ | ||
export declare function getColumnStyle(column: TableColumn<TableRecord<unknown>>): {}; | ||
export declare function getCellStyle(column: TableColumn<TableRecord<unknown>>): {}; |
@@ -15,2 +15,5 @@ const tablePrefix = 'mzn-table'; | ||
bodyRowCellWrapper: `${tableBodyPrefix}__row__cellWrapper`, | ||
bodyRowExpandedTableWrapper: `${tableBodyPrefix}__row__expandedTableWrapper`, | ||
bodyRowExpandedTable: `${tableBodyPrefix}__row__expandedTable`, | ||
bodyRowExpandedTableRow: `${tableBodyPrefix}__row__expandedTableRow`, | ||
cell: tableCellPrefix, | ||
@@ -27,3 +30,29 @@ cellEllipsis: `${tableCellPrefix}__ellipsis`, | ||
}; | ||
/** styling */ | ||
function getColumnStyle(column) { | ||
if (!column) | ||
return {}; | ||
let style = {}; | ||
if (column.width) { | ||
style = { | ||
...style, | ||
width: column.width, | ||
maxWidth: column.width, | ||
}; | ||
} | ||
return style; | ||
} | ||
function getCellStyle(column) { | ||
if (!column) | ||
return {}; | ||
let style = {}; | ||
if (column.align) { | ||
style = { | ||
...style, | ||
justifyContent: column.align === 'center' ? column.align : `flex-${column.align}`, | ||
}; | ||
} | ||
return style; | ||
} | ||
export { tableBodyPrefix, tableCellPrefix, tableClasses, tableHeaderPrefix, tablePrefix }; | ||
export { getCellStyle, getColumnStyle, tableBodyPrefix, tableCellPrefix, tableClasses, tableHeaderPrefix, tablePrefix }; |
Sorry, the diff of this file is not supported yet
194356
2364