@bluemarble/bm-components 1.6.0 → 1.7.1
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/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -233,6 +233,7 @@ interface UseGridProps$1<T> {
|
|
|
233
233
|
}
|
|
234
234
|
declare function useGrid<T extends Record<string, any>>({ columns, filters, search, rowsPerPageOptions, defaultData: externalDefaultData, defaultCurrentPage, defaultSortedBy }: UseGridProps$1<T>): {
|
|
235
235
|
data: T[];
|
|
236
|
+
updatedTimes: number;
|
|
236
237
|
set: (data: T[]) => void;
|
|
237
238
|
onSortBy: (prop: string) => void;
|
|
238
239
|
sortedBy: SortedByProps$1[];
|
package/dist/index.d.ts
CHANGED
|
@@ -233,6 +233,7 @@ interface UseGridProps$1<T> {
|
|
|
233
233
|
}
|
|
234
234
|
declare function useGrid<T extends Record<string, any>>({ columns, filters, search, rowsPerPageOptions, defaultData: externalDefaultData, defaultCurrentPage, defaultSortedBy }: UseGridProps$1<T>): {
|
|
235
235
|
data: T[];
|
|
236
|
+
updatedTimes: number;
|
|
236
237
|
set: (data: T[]) => void;
|
|
237
238
|
onSortBy: (prop: string) => void;
|
|
238
239
|
sortedBy: SortedByProps$1[];
|
package/dist/index.js
CHANGED
|
@@ -4701,6 +4701,7 @@ function useGrid({
|
|
|
4701
4701
|
);
|
|
4702
4702
|
const [currentPage, setCurrentPage] = _react.useState.call(void 0, defaultCurrentPage || 0);
|
|
4703
4703
|
const [rowsPerPage, setRowsPerPage] = _react.useState.call(void 0, rowsPerPageOptions[0]);
|
|
4704
|
+
const [updatedTimes, setUpdatedTimes] = _react.useState.call(void 0, 0);
|
|
4704
4705
|
const toggleSortedDirection = _react.useCallback.call(void 0,
|
|
4705
4706
|
(direction) => {
|
|
4706
4707
|
if (direction === "asc")
|
|
@@ -4740,6 +4741,7 @@ function useGrid({
|
|
|
4740
4741
|
[toggleSortedDirection, sortedBy]
|
|
4741
4742
|
);
|
|
4742
4743
|
const set = _react.useCallback.call(void 0, (data) => {
|
|
4744
|
+
setUpdatedTimes((prev) => prev + 1);
|
|
4743
4745
|
setDefaultData(data);
|
|
4744
4746
|
}, []);
|
|
4745
4747
|
const sortData = _react.useCallback.call(void 0,
|
|
@@ -4793,6 +4795,7 @@ function useGrid({
|
|
|
4793
4795
|
const totalNumberOfPages = Math.ceil(filteredData.length / rowsPerPage) - 1;
|
|
4794
4796
|
return {
|
|
4795
4797
|
data: displayData,
|
|
4798
|
+
updatedTimes,
|
|
4796
4799
|
set,
|
|
4797
4800
|
onSortBy,
|
|
4798
4801
|
sortedBy,
|