@economic/taco 2.26.5 → 2.26.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js +46 -49
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js.map +1 -1
- package/dist/primitives/Table/Core/features/useTableStyle.d.ts +60 -60
- package/dist/taco.cjs.development.js +46 -48
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +2 -2
@@ -10923,57 +10923,55 @@ function useTableStyleGrid(tableId, table, fontSize) {
|
|
10923
10923
|
const globalMinSize = getCellMinWidth(fontSize);
|
10924
10924
|
// header body ?footer
|
10925
10925
|
const gridTemplateRows = table.getRowModel().rows.length ? 'min-content 1fr min-content' : 'min-content 1fr';
|
10926
|
-
|
10927
|
-
|
10928
|
-
|
10929
|
-
|
10930
|
-
|
10931
|
-
|
10932
|
-
|
10933
|
-
|
10934
|
-
|
10935
|
-
|
10936
|
-
|
10937
|
-
|
10938
|
-
|
10939
|
-
|
10940
|
-
|
10941
|
-
|
10942
|
-
|
10943
|
-
|
10944
|
-
|
10926
|
+
let printGridTemplateColumns = '';
|
10927
|
+
const printHiddenColumns = [];
|
10928
|
+
const gridTemplateColumns = allVisibleColumns.reduce((accum, column, index) => {
|
10929
|
+
var _column$columnDef$min, _column$columnDef$met;
|
10930
|
+
if (table.options.enableGrouping && column.getIsGrouped()) {
|
10931
|
+
return accum;
|
10932
|
+
}
|
10933
|
+
const minSize = (_column$columnDef$min = column.columnDef.minSize) !== null && _column$columnDef$min !== void 0 ? _column$columnDef$min : globalMinSize;
|
10934
|
+
const width = columnSizing[column.id];
|
10935
|
+
let size;
|
10936
|
+
let printSize;
|
10937
|
+
if (column.id === '__actions') {
|
10938
|
+
const minWidth = tableMeta.rowActions.rowActionsLength * 32 + 8; /* button margins l+r */
|
10939
|
+
size = `minmax(${minWidth}px, auto)`;
|
10940
|
+
} else if (width !== undefined) {
|
10941
|
+
const isLastColumn = index === allVisibleColumns.length - 1;
|
10942
|
+
if (width === 'grow' || Number.isNaN(width) && !isLastColumn) {
|
10943
|
+
size = `minmax(max-content, 1fr)`;
|
10944
|
+
} else {
|
10945
|
+
const minWidth = width < minSize ? minSize : width;
|
10946
|
+
if (isLastColumn) {
|
10947
|
+
size = `minmax(${minWidth}px, auto)`;
|
10945
10948
|
} else {
|
10946
|
-
|
10947
|
-
if (isLastColumn) {
|
10948
|
-
size = `minmax(${minWidth}px, auto)`;
|
10949
|
-
} else {
|
10950
|
-
size = `${minWidth}px`;
|
10951
|
-
}
|
10949
|
+
size = `${minWidth}px`;
|
10952
10950
|
}
|
10953
|
-
} else {
|
10954
|
-
size = `minmax(max-content, auto)`;
|
10955
10951
|
}
|
10956
|
-
|
10957
|
-
|
10958
|
-
|
10959
|
-
|
10960
|
-
|
10961
|
-
|
10962
|
-
|
10963
|
-
|
10964
|
-
}
|
10965
|
-
|
10966
|
-
|
10967
|
-
|
10968
|
-
|
10969
|
-
|
10970
|
-
|
10971
|
-
|
10972
|
-
|
10973
|
-
|
10974
|
-
|
10975
|
-
|
10976
|
-
|
10952
|
+
} else {
|
10953
|
+
size = `minmax(max-content, auto)`;
|
10954
|
+
}
|
10955
|
+
if (((_column$columnDef$met = column.columnDef.meta) === null || _column$columnDef$met === void 0 ? void 0 : _column$columnDef$met.enablePrinting) === false) {
|
10956
|
+
printSize = '';
|
10957
|
+
printHiddenColumns.push(column.id);
|
10958
|
+
} else {
|
10959
|
+
printSize = 'auto';
|
10960
|
+
}
|
10961
|
+
printGridTemplateColumns = `${printGridTemplateColumns} ${printSize}`.trim();
|
10962
|
+
return `${accum} ${size}`.trim();
|
10963
|
+
}, '');
|
10964
|
+
// we have to be specific so that nested tables don't inherit the same css
|
10965
|
+
const hiddenColumns = printHiddenColumns.map(id => `table[data-taco^='table']#${tableId} > thead > tr > th[data-cell-id='${id}']\n,table[data-taco^='table']#${tableId} > tbody > tr > td[data-cell-id='${id}']\n`).join(',');
|
10966
|
+
const style = {
|
10967
|
+
gridTemplateColumns,
|
10968
|
+
gridTemplateRows
|
10969
|
+
};
|
10970
|
+
const stylesheet = `@media print { table[data-taco^='table']#${tableId} { grid-template-columns: ${printGridTemplateColumns}; } ${hiddenColumns ? `${hiddenColumns} { display: none; }` : ''}}`;
|
10971
|
+
return {
|
10972
|
+
style,
|
10973
|
+
stylesheet
|
10974
|
+
};
|
10977
10975
|
}
|
10978
10976
|
|
10979
10977
|
function useTableStyleColumnFreezing(tableId, table) {
|