@ostack.tech/ui 0.2.3 → 0.3.0
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/dist/ostack-ui.css +3 -0
- package/dist/ostack-ui.css.map +1 -1
- package/dist/ostack-ui.js +57 -27
- package/dist/ostack-ui.js.map +1 -1
- package/dist/types/components/DataTable/DataTable.d.ts +5 -0
- package/dist/types/components/DataTable/DataTableContext.d.ts +3 -1
- package/package.json +1 -1
- package/scss/components/DataTable/_DataTable.scss +5 -0
|
@@ -182,6 +182,11 @@ export interface DataTableProps<T = any> extends ComponentPropsWithoutRef<"div">
|
|
|
182
182
|
* @param selectedRows Array containing the keys of the newly selected rows.
|
|
183
183
|
*/
|
|
184
184
|
onSelectedRowsChange?: (selectedRows: Key[]) => void;
|
|
185
|
+
/**
|
|
186
|
+
* Keys of the rows whose selections should be disabled (rows with the
|
|
187
|
+
* identifiers provided will have their selection checkboxes disabled).
|
|
188
|
+
*/
|
|
189
|
+
disabledSelections?: Key[];
|
|
185
190
|
/**
|
|
186
191
|
* Function used to render each row. This function should typically return a
|
|
187
192
|
* `DataTableRow` with the provided properties. This function is useful to
|
|
@@ -52,6 +52,7 @@ export interface DataTableState<T = any> {
|
|
|
52
52
|
sortBy: string | null;
|
|
53
53
|
sortDirection: SortDirection;
|
|
54
54
|
selectedRows: [Set<Key>];
|
|
55
|
+
disabledSelections?: Set<Key>;
|
|
55
56
|
scrolledRangeStart: number;
|
|
56
57
|
scrolledRangeEnd: number;
|
|
57
58
|
tableHeadHeight?: number;
|
|
@@ -102,9 +103,10 @@ export interface UseCreateDataTableContextOptions<T> extends Omit<DataTableConte
|
|
|
102
103
|
defaultSelectedRows?: Key[];
|
|
103
104
|
selectedRows?: Key[];
|
|
104
105
|
onSelectedRowsChange?: (selectedRows: Key[]) => void;
|
|
106
|
+
disabledSelections?: Key[];
|
|
105
107
|
}
|
|
106
108
|
/** Hook which creates the data table context value. */
|
|
107
|
-
export declare function useCreateDataTableContext<T>({ displayMode, columns, rows, getRows, rowKey, loadingCount, required, loading, renderRow, renderCell, dynamicRowHeight, estimatedRowHeight, overscan, apiRef, leafColumns, headCount, defaultOffset, offset, onOffsetChange, defaultLimit, limit, onLimitChange, defaultFilter, filter, onFilterChange, defaultSortBy, sortBy, defaultSortDirection, sortDirection, onSort, showSelectionColumn, defaultSelectedRows, selectedRows, onSelectedRowsChange, }: UseCreateDataTableContextOptions<T>): {
|
|
109
|
+
export declare function useCreateDataTableContext<T>({ displayMode, columns, rows, getRows, rowKey, loadingCount, required, loading, renderRow, renderCell, dynamicRowHeight, estimatedRowHeight, overscan, apiRef, leafColumns, headCount, defaultOffset, offset, onOffsetChange, defaultLimit, limit, onLimitChange, defaultFilter, filter, onFilterChange, defaultSortBy, sortBy, defaultSortDirection, sortDirection, onSort, showSelectionColumn, defaultSelectedRows, selectedRows, onSelectedRowsChange, disabledSelections, }: UseCreateDataTableContextOptions<T>): {
|
|
108
110
|
displayMode: DataTableDisplayMode;
|
|
109
111
|
rowKey: string | number | symbol | ((row: any) => Key);
|
|
110
112
|
required: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -103,6 +103,11 @@
|
|
|
103
103
|
margin-bottom: 0;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
// Selection column
|
|
107
|
+
&__selection-column-cell .#{$prefix}checkbox__container {
|
|
108
|
+
background-color: transparent;
|
|
109
|
+
}
|
|
110
|
+
|
|
106
111
|
@include media-breakpoint-down(sm) {
|
|
107
112
|
&__rows-per-page,
|
|
108
113
|
&__pagination {
|