@indico-data/design-system 2.60.0 → 2.60.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/tanstackTable/TankstackTable.types.d.ts +1 -0
- package/lib/components/tanstackTable/TanstackTable.d.ts +1 -1
- package/lib/index.css +30 -21
- package/lib/index.d.ts +2 -1
- package/lib/index.esm.css +30 -21
- package/lib/index.esm.js +2 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/table/styles/Table.scss +0 -9
- package/src/components/tanstackTable/TankstackTable.types.ts +1 -0
- package/src/components/tanstackTable/TanstackTable.stories.tsx +54 -0
- package/src/components/tanstackTable/TanstackTable.tsx +3 -2
- package/src/components/tanstackTable/components/ActionBar/ActionBar.scss +1 -1
- package/src/components/tanstackTable/styles/_variables.scss +16 -9
- package/src/components/tanstackTable/styles/table.scss +24 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Props } from './TankstackTable.types';
|
|
2
|
-
export declare function TanstackTable<T extends object>({ columns: defaultColumns, data, className, currentPage, rowCount, rowsPerPage, onChangePage, totalEntriesText, TableActions, error, enableRowSelection, clearFilters, hasFilters, showPagination, isLoading, defaultPinnedColumns, onRowClick, activeRows, actionBarClassName, ...rest }: Props<T & {
|
|
2
|
+
export declare function TanstackTable<T extends object>({ columns: defaultColumns, data, className, currentPage, rowCount, rowsPerPage, onChangePage, totalEntriesText, TableActions, error, enableRowSelection, clearFilters, hasFilters, showPagination, isLoading, defaultPinnedColumns, onRowClick, activeRows, isStriped, actionBarClassName, ...rest }: Props<T & {
|
|
3
3
|
id: string;
|
|
4
4
|
}>): import("react/jsx-runtime").JSX.Element;
|
package/lib/index.css
CHANGED
|
@@ -1045,13 +1045,6 @@ a:hover,
|
|
|
1045
1045
|
background-color: var(--pf-table-highlighted-color) !important;
|
|
1046
1046
|
}
|
|
1047
1047
|
|
|
1048
|
-
.table__pagination {
|
|
1049
|
-
padding-bottom: var(--pf-padding-4);
|
|
1050
|
-
padding-top: var(--pf-padding-4);
|
|
1051
|
-
background-color: var(--pf-table-pagination-background-color);
|
|
1052
|
-
padding-left: var(--pf-padding-4);
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
1048
|
.input {
|
|
1056
1049
|
padding: 10px;
|
|
1057
1050
|
}
|
|
@@ -2121,22 +2114,26 @@ form {
|
|
|
2121
2114
|
|
|
2122
2115
|
:root [data-theme=light] {
|
|
2123
2116
|
--pf-tanstack-table-background-color: var(--pf-white-color);
|
|
2124
|
-
--pf-tanstack-table-
|
|
2125
|
-
--pf-tanstack-table-
|
|
2126
|
-
--pf-tanstack-table-
|
|
2127
|
-
--pf-tanstack-table-
|
|
2117
|
+
--pf-tanstack-table-header-background-color: var(--pf-gray-color-900);
|
|
2118
|
+
--pf-tanstack-table-font-color: var(--pf-gray-color-300);
|
|
2119
|
+
--pf-tanstack-table-border-color: var(--pf-gray-color-700);
|
|
2120
|
+
--pf-tanstack-table-stripe-color: var(--pf-gray-color-950);
|
|
2121
|
+
--pf-tanstack-table-hover-color: var(--pf-secondary-color-900);
|
|
2128
2122
|
--pf-tanstack-table-disabled-color: var(--pf-gray-color-300);
|
|
2129
|
-
--pf-tanstack-table-checked-color: var(--pf-
|
|
2130
|
-
--pf-tanstack-table-clicked-color: var(--pf-
|
|
2131
|
-
--pf-tanstack-table-highlighted-color: var(--pf-gray-color-
|
|
2132
|
-
--pf-tanstack-table-highlighted-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.
|
|
2133
|
-
0 8px
|
|
2123
|
+
--pf-tanstack-table-checked-color: var(--pf-gray-color-900);
|
|
2124
|
+
--pf-tanstack-table-clicked-color: var(--pf-gray-color-800);
|
|
2125
|
+
--pf-tanstack-table-highlighted-color: var(--pf-gray-color-700);
|
|
2126
|
+
--pf-tanstack-table-highlighted-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1),
|
|
2127
|
+
0 4px 8px rgba(0, 0, 0, 0.1);
|
|
2134
2128
|
--pf-tanstack-table-font-size: var(--pf-font-size-body2);
|
|
2129
|
+
--pf-tanstack-table-pagination-background-color: var(--pf-tanstack-table-background-color);
|
|
2130
|
+
--pf-tanstack-table-pagination-font-color: var(--pf-tanstack-table-font-color);
|
|
2135
2131
|
}
|
|
2136
2132
|
|
|
2137
2133
|
:root [data-theme=dark],
|
|
2138
2134
|
:root {
|
|
2139
2135
|
--pf-tanstack-table-background-color: var(--pf-primary-color-800);
|
|
2136
|
+
--pf-tanstack-table-header-background-color: var(--pf-primary-color-800);
|
|
2140
2137
|
--pf-tanstack-table-font-color: var(--pf-white-color);
|
|
2141
2138
|
--pf-tanstack-table-border-color: var(--pf-tertiary-color-800);
|
|
2142
2139
|
--pf-tanstack-table-stripe-color: var(--pf-primary-color-700);
|
|
@@ -2150,6 +2147,7 @@ form {
|
|
|
2150
2147
|
0 8px 16px rgba(0, 0, 0, 0.3);
|
|
2151
2148
|
--pf-tanstack-table-font-size: var(--pf-font-size-body2);
|
|
2152
2149
|
--pf-tanstack-table-pagination-background-color: var(--pf-primary-color-700);
|
|
2150
|
+
--pf-tanstack-table-pagination-font-color: var(--pf-tanstack-table-font-color);
|
|
2153
2151
|
}
|
|
2154
2152
|
|
|
2155
2153
|
.tanstack-table__action-bar-test {
|
|
@@ -2175,7 +2173,7 @@ form {
|
|
|
2175
2173
|
left: 50%;
|
|
2176
2174
|
transform: translateX(-50%);
|
|
2177
2175
|
z-index: 90;
|
|
2178
|
-
box-shadow: 3px 1px 15px 0 rgba(0, 0, 0, 0.
|
|
2176
|
+
box-shadow: 3px 1px 15px 0 rgba(0, 0, 0, 0.45);
|
|
2179
2177
|
}
|
|
2180
2178
|
.tanstack-table__action-bar__container {
|
|
2181
2179
|
display: flex;
|
|
@@ -2269,6 +2267,9 @@ form {
|
|
|
2269
2267
|
border-radius: var(--pf-rounded-lg);
|
|
2270
2268
|
width: 100%;
|
|
2271
2269
|
}
|
|
2270
|
+
.tanstack-table.is-striped .tanstack-table__tbody tr:nth-child(odd) td {
|
|
2271
|
+
background-color: var(--pf-tanstack-table-stripe-color);
|
|
2272
|
+
}
|
|
2272
2273
|
.tanstack-table .is-loading {
|
|
2273
2274
|
border: var(--pf-border-thin) solid var(--pf-border-color);
|
|
2274
2275
|
height: 350px;
|
|
@@ -2289,7 +2290,7 @@ form {
|
|
|
2289
2290
|
}
|
|
2290
2291
|
.tanstack-table__thead__th {
|
|
2291
2292
|
color: var(--pf-tanstack-table-font-color);
|
|
2292
|
-
background: var(--pf-tanstack-table-background-color);
|
|
2293
|
+
background: var(--pf-tanstack-table-header-background-color);
|
|
2293
2294
|
font-size: var(--pf-tanstack-table-font-size);
|
|
2294
2295
|
font-weight: var(--pf-font-weight-medium);
|
|
2295
2296
|
box-sizing: border-box;
|
|
@@ -2323,14 +2324,14 @@ form {
|
|
|
2323
2324
|
border-right: none;
|
|
2324
2325
|
}
|
|
2325
2326
|
.tanstack-table__tbody__tr.is-selected td {
|
|
2326
|
-
background: var(--pf-tanstack-table-checked-color);
|
|
2327
|
+
background: var(--pf-tanstack-table-checked-color) !important;
|
|
2327
2328
|
}
|
|
2328
2329
|
.tanstack-table__tbody__tr.show-hover:hover td {
|
|
2329
|
-
background-color: var(--pf-tanstack-table-hover-color);
|
|
2330
|
+
background-color: var(--pf-tanstack-table-hover-color) !important;
|
|
2330
2331
|
cursor: pointer;
|
|
2331
2332
|
}
|
|
2332
2333
|
.tanstack-table__tbody__tr.is-clicked td {
|
|
2333
|
-
background-color: var(--pf-tanstack-table-clicked-color);
|
|
2334
|
+
background-color: var(--pf-tanstack-table-clicked-color) !important;
|
|
2334
2335
|
}
|
|
2335
2336
|
.tanstack-table__tbody__td {
|
|
2336
2337
|
font-size: var(--pf-font-size-base);
|
|
@@ -2381,6 +2382,14 @@ form {
|
|
|
2381
2382
|
display: block;
|
|
2382
2383
|
}
|
|
2383
2384
|
|
|
2385
|
+
.table__pagination {
|
|
2386
|
+
padding-bottom: var(--pf-padding-4);
|
|
2387
|
+
padding-top: var(--pf-padding-4);
|
|
2388
|
+
color: var(--pf-tanstack-table-pagination-font-color);
|
|
2389
|
+
background-color: var(--pf-tanstack-table-pagination-background-color);
|
|
2390
|
+
padding-left: var(--pf-padding-4);
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2384
2393
|
:root [data-theme=light] {
|
|
2385
2394
|
--pf-pill-primary-background-color: var(--pf-primary-color);
|
|
2386
2395
|
--pf-pill-primary-font-color: var(--pf-white-color);
|
package/lib/index.d.ts
CHANGED
|
@@ -551,6 +551,7 @@ type WithoutPaginationProps = {
|
|
|
551
551
|
type PaginationProps$1 = WithPaginationProps | WithoutPaginationProps;
|
|
552
552
|
type Props<T extends object> = {
|
|
553
553
|
data: T[];
|
|
554
|
+
isStriped?: boolean;
|
|
554
555
|
columns: ColumnDef<T & {
|
|
555
556
|
id: string;
|
|
556
557
|
}>[];
|
|
@@ -577,7 +578,7 @@ type Props<T extends object> = {
|
|
|
577
578
|
onSelectAllChange?: (isSelected: boolean) => void;
|
|
578
579
|
} & PaginationProps$1;
|
|
579
580
|
|
|
580
|
-
declare function TanstackTable<T extends object>({ columns: defaultColumns, data, className, currentPage, rowCount, rowsPerPage, onChangePage, totalEntriesText, TableActions, error, enableRowSelection, clearFilters, hasFilters, showPagination, isLoading, defaultPinnedColumns, onRowClick, activeRows, actionBarClassName, ...rest }: Props<T & {
|
|
581
|
+
declare function TanstackTable<T extends object>({ columns: defaultColumns, data, className, currentPage, rowCount, rowsPerPage, onChangePage, totalEntriesText, TableActions, error, enableRowSelection, clearFilters, hasFilters, showPagination, isLoading, defaultPinnedColumns, onRowClick, activeRows, isStriped, actionBarClassName, ...rest }: Props<T & {
|
|
581
582
|
id: string;
|
|
582
583
|
}>): react_jsx_runtime.JSX.Element;
|
|
583
584
|
|
package/lib/index.esm.css
CHANGED
|
@@ -1045,13 +1045,6 @@ a:hover,
|
|
|
1045
1045
|
background-color: var(--pf-table-highlighted-color) !important;
|
|
1046
1046
|
}
|
|
1047
1047
|
|
|
1048
|
-
.table__pagination {
|
|
1049
|
-
padding-bottom: var(--pf-padding-4);
|
|
1050
|
-
padding-top: var(--pf-padding-4);
|
|
1051
|
-
background-color: var(--pf-table-pagination-background-color);
|
|
1052
|
-
padding-left: var(--pf-padding-4);
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
1048
|
.input {
|
|
1056
1049
|
padding: 10px;
|
|
1057
1050
|
}
|
|
@@ -2121,22 +2114,26 @@ form {
|
|
|
2121
2114
|
|
|
2122
2115
|
:root [data-theme=light] {
|
|
2123
2116
|
--pf-tanstack-table-background-color: var(--pf-white-color);
|
|
2124
|
-
--pf-tanstack-table-
|
|
2125
|
-
--pf-tanstack-table-
|
|
2126
|
-
--pf-tanstack-table-
|
|
2127
|
-
--pf-tanstack-table-
|
|
2117
|
+
--pf-tanstack-table-header-background-color: var(--pf-gray-color-900);
|
|
2118
|
+
--pf-tanstack-table-font-color: var(--pf-gray-color-300);
|
|
2119
|
+
--pf-tanstack-table-border-color: var(--pf-gray-color-700);
|
|
2120
|
+
--pf-tanstack-table-stripe-color: var(--pf-gray-color-950);
|
|
2121
|
+
--pf-tanstack-table-hover-color: var(--pf-secondary-color-900);
|
|
2128
2122
|
--pf-tanstack-table-disabled-color: var(--pf-gray-color-300);
|
|
2129
|
-
--pf-tanstack-table-checked-color: var(--pf-
|
|
2130
|
-
--pf-tanstack-table-clicked-color: var(--pf-
|
|
2131
|
-
--pf-tanstack-table-highlighted-color: var(--pf-gray-color-
|
|
2132
|
-
--pf-tanstack-table-highlighted-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.
|
|
2133
|
-
0 8px
|
|
2123
|
+
--pf-tanstack-table-checked-color: var(--pf-gray-color-900);
|
|
2124
|
+
--pf-tanstack-table-clicked-color: var(--pf-gray-color-800);
|
|
2125
|
+
--pf-tanstack-table-highlighted-color: var(--pf-gray-color-700);
|
|
2126
|
+
--pf-tanstack-table-highlighted-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1),
|
|
2127
|
+
0 4px 8px rgba(0, 0, 0, 0.1);
|
|
2134
2128
|
--pf-tanstack-table-font-size: var(--pf-font-size-body2);
|
|
2129
|
+
--pf-tanstack-table-pagination-background-color: var(--pf-tanstack-table-background-color);
|
|
2130
|
+
--pf-tanstack-table-pagination-font-color: var(--pf-tanstack-table-font-color);
|
|
2135
2131
|
}
|
|
2136
2132
|
|
|
2137
2133
|
:root [data-theme=dark],
|
|
2138
2134
|
:root {
|
|
2139
2135
|
--pf-tanstack-table-background-color: var(--pf-primary-color-800);
|
|
2136
|
+
--pf-tanstack-table-header-background-color: var(--pf-primary-color-800);
|
|
2140
2137
|
--pf-tanstack-table-font-color: var(--pf-white-color);
|
|
2141
2138
|
--pf-tanstack-table-border-color: var(--pf-tertiary-color-800);
|
|
2142
2139
|
--pf-tanstack-table-stripe-color: var(--pf-primary-color-700);
|
|
@@ -2150,6 +2147,7 @@ form {
|
|
|
2150
2147
|
0 8px 16px rgba(0, 0, 0, 0.3);
|
|
2151
2148
|
--pf-tanstack-table-font-size: var(--pf-font-size-body2);
|
|
2152
2149
|
--pf-tanstack-table-pagination-background-color: var(--pf-primary-color-700);
|
|
2150
|
+
--pf-tanstack-table-pagination-font-color: var(--pf-tanstack-table-font-color);
|
|
2153
2151
|
}
|
|
2154
2152
|
|
|
2155
2153
|
.tanstack-table__action-bar-test {
|
|
@@ -2175,7 +2173,7 @@ form {
|
|
|
2175
2173
|
left: 50%;
|
|
2176
2174
|
transform: translateX(-50%);
|
|
2177
2175
|
z-index: 90;
|
|
2178
|
-
box-shadow: 3px 1px 15px 0 rgba(0, 0, 0, 0.
|
|
2176
|
+
box-shadow: 3px 1px 15px 0 rgba(0, 0, 0, 0.45);
|
|
2179
2177
|
}
|
|
2180
2178
|
.tanstack-table__action-bar__container {
|
|
2181
2179
|
display: flex;
|
|
@@ -2269,6 +2267,9 @@ form {
|
|
|
2269
2267
|
border-radius: var(--pf-rounded-lg);
|
|
2270
2268
|
width: 100%;
|
|
2271
2269
|
}
|
|
2270
|
+
.tanstack-table.is-striped .tanstack-table__tbody tr:nth-child(odd) td {
|
|
2271
|
+
background-color: var(--pf-tanstack-table-stripe-color);
|
|
2272
|
+
}
|
|
2272
2273
|
.tanstack-table .is-loading {
|
|
2273
2274
|
border: var(--pf-border-thin) solid var(--pf-border-color);
|
|
2274
2275
|
height: 350px;
|
|
@@ -2289,7 +2290,7 @@ form {
|
|
|
2289
2290
|
}
|
|
2290
2291
|
.tanstack-table__thead__th {
|
|
2291
2292
|
color: var(--pf-tanstack-table-font-color);
|
|
2292
|
-
background: var(--pf-tanstack-table-background-color);
|
|
2293
|
+
background: var(--pf-tanstack-table-header-background-color);
|
|
2293
2294
|
font-size: var(--pf-tanstack-table-font-size);
|
|
2294
2295
|
font-weight: var(--pf-font-weight-medium);
|
|
2295
2296
|
box-sizing: border-box;
|
|
@@ -2323,14 +2324,14 @@ form {
|
|
|
2323
2324
|
border-right: none;
|
|
2324
2325
|
}
|
|
2325
2326
|
.tanstack-table__tbody__tr.is-selected td {
|
|
2326
|
-
background: var(--pf-tanstack-table-checked-color);
|
|
2327
|
+
background: var(--pf-tanstack-table-checked-color) !important;
|
|
2327
2328
|
}
|
|
2328
2329
|
.tanstack-table__tbody__tr.show-hover:hover td {
|
|
2329
|
-
background-color: var(--pf-tanstack-table-hover-color);
|
|
2330
|
+
background-color: var(--pf-tanstack-table-hover-color) !important;
|
|
2330
2331
|
cursor: pointer;
|
|
2331
2332
|
}
|
|
2332
2333
|
.tanstack-table__tbody__tr.is-clicked td {
|
|
2333
|
-
background-color: var(--pf-tanstack-table-clicked-color);
|
|
2334
|
+
background-color: var(--pf-tanstack-table-clicked-color) !important;
|
|
2334
2335
|
}
|
|
2335
2336
|
.tanstack-table__tbody__td {
|
|
2336
2337
|
font-size: var(--pf-font-size-base);
|
|
@@ -2381,6 +2382,14 @@ form {
|
|
|
2381
2382
|
display: block;
|
|
2382
2383
|
}
|
|
2383
2384
|
|
|
2385
|
+
.table__pagination {
|
|
2386
|
+
padding-bottom: var(--pf-padding-4);
|
|
2387
|
+
padding-top: var(--pf-padding-4);
|
|
2388
|
+
color: var(--pf-tanstack-table-pagination-font-color);
|
|
2389
|
+
background-color: var(--pf-tanstack-table-pagination-background-color);
|
|
2390
|
+
padding-left: var(--pf-padding-4);
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2384
2393
|
:root [data-theme=light] {
|
|
2385
2394
|
--pf-pill-primary-background-color: var(--pf-primary-color);
|
|
2386
2395
|
--pf-pill-primary-font-color: var(--pf-white-color);
|
package/lib/index.esm.js
CHANGED
|
@@ -41312,7 +41312,7 @@ const TableBody = ({ table, onRowClick, isLoading, columnsLength, activeRows, })
|
|
|
41312
41312
|
};
|
|
41313
41313
|
|
|
41314
41314
|
function TanstackTable(_a) {
|
|
41315
|
-
var { columns: defaultColumns, data, className, currentPage, rowCount, rowsPerPage = 1000, onChangePage, totalEntriesText, TableActions, error, enableRowSelection = true, clearFilters, hasFilters, showPagination = true, isLoading = false, defaultPinnedColumns, onRowClick, activeRows = [], actionBarClassName } = _a, rest = __rest(_a, ["columns", "data", "className", "currentPage", "rowCount", "rowsPerPage", "onChangePage", "totalEntriesText", "TableActions", "error", "enableRowSelection", "clearFilters", "hasFilters", "showPagination", "isLoading", "defaultPinnedColumns", "onRowClick", "activeRows", "actionBarClassName"]);
|
|
41315
|
+
var { columns: defaultColumns, data, className, currentPage, rowCount, rowsPerPage = 1000, onChangePage, totalEntriesText, TableActions, error, enableRowSelection = true, clearFilters, hasFilters, showPagination = true, isLoading = false, defaultPinnedColumns, onRowClick, activeRows = [], isStriped = true, actionBarClassName } = _a, rest = __rest(_a, ["columns", "data", "className", "currentPage", "rowCount", "rowsPerPage", "onChangePage", "totalEntriesText", "TableActions", "error", "enableRowSelection", "clearFilters", "hasFilters", "showPagination", "isLoading", "defaultPinnedColumns", "onRowClick", "activeRows", "isStriped", "actionBarClassName"]);
|
|
41316
41316
|
const { columns, defaultData, windowWidth, rowSelection, // This refers to the checkboxes.
|
|
41317
41317
|
setRowSelection, formattedColumns, setFormattedColumns, } = useTanstackTable({
|
|
41318
41318
|
defaultColumns,
|
|
@@ -41356,6 +41356,7 @@ function TanstackTable(_a) {
|
|
|
41356
41356
|
};
|
|
41357
41357
|
return (jsxs("div", { className: "tanstack-table__outer-container", children: [jsxs("div", { className: "tanstack-table__container", children: [jsxs("table", { className: classNames('tanstack-table', className, {
|
|
41358
41358
|
'is-Loading': isLoading,
|
|
41359
|
+
'is-striped': isStriped,
|
|
41359
41360
|
}), children: [jsx("thead", { className: "tanstack-table__thead", children: jsx(TableHeader, { table: table, ref: thRefs }) }), jsx("tbody", { className: "tanstack-table__tbody", children: renderBody() })] }), hasSelectedRows && (jsx(ActionBar, { table: table, TableActions: TableActions, className: actionBarClassName }))] }), shouldRenderPagination ? (jsx(TablePagination, { currentPage: currentPage, rowCount: rowCount, onChangePage: onChangePage, rowsPerPage: rowsPerPage, totalEntriesText: totalEntriesText !== null && totalEntriesText !== void 0 ? totalEntriesText : `${totalRowsOnPage} of ${rowCount} entries` })) : null] }));
|
|
41360
41361
|
}
|
|
41361
41362
|
|