@m4l/components 9.79.1 → 9.80.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/components/Pager/subcomponents/CustomTablePagination/CustomTablePagination.d.ts.map +1 -1
- package/components/Pager/subcomponents/CustomTablePagination/CustomTablePagination.js +53 -61
- package/components/Pager/subcomponents/RowsPerPageSelect/RowsPerPageSelect.d.ts +7 -0
- package/components/Pager/subcomponents/RowsPerPageSelect/RowsPerPageSelect.d.ts.map +1 -0
- package/components/Pager/subcomponents/RowsPerPageSelect/RowsPerPageSelect.js +28 -0
- package/components/Pager/subcomponents/RowsPerPageSelect/types.d.ts +20 -0
- package/components/Pager/subcomponents/RowsPerPageSelect/types.d.ts.map +1 -0
- package/components/datagrids/Datagrid.styles.d.ts.map +1 -1
- package/components/datagrids/Datagrid.styles.js +329 -298
- package/components/datagrids/components/BaseDataGrid/BaseDataGrid.d.ts.map +1 -1
- package/components/datagrids/components/BaseDataGrid/BaseDataGrid.js +101 -95
- package/components/datagrids/constants.d.ts +7 -0
- package/components/datagrids/constants.d.ts.map +1 -1
- package/components/datagrids/constants.js +10 -6
- package/components/datagrids/contexts/DataGridContext/DataGridContext.d.ts.map +1 -1
- package/components/datagrids/contexts/DataGridContext/DataGridContext.js +112 -102
- package/components/datagrids/contexts/DataGridContext/types.d.ts +18 -3
- package/components/datagrids/contexts/DataGridContext/types.d.ts.map +1 -1
- package/components/datagrids/dictionary.d.ts +4 -0
- package/components/datagrids/dictionary.d.ts.map +1 -1
- package/components/datagrids/dictionary.js +12 -6
- package/components/datagrids/helpers/index.d.ts +5 -0
- package/components/datagrids/helpers/index.d.ts.map +1 -1
- package/components/datagrids/helpers/normalizeHeaderClickDeferMs.d.ts +5 -0
- package/components/datagrids/helpers/normalizeHeaderClickDeferMs.d.ts.map +1 -0
- package/components/datagrids/helpers/normalizeHeaderClickDeferMs.js +7 -0
- package/components/datagrids/helpers/shared/attachScrollElement/attachScrollElement.d.ts +9 -0
- package/components/datagrids/helpers/shared/attachScrollElement/attachScrollElement.d.ts.map +1 -0
- package/components/datagrids/helpers/shared/attachScrollElement/attachScrollElement.js +14 -0
- package/components/datagrids/helpers/shared/attachScrollElement/index.d.ts +3 -0
- package/components/datagrids/helpers/shared/attachScrollElement/index.d.ts.map +1 -0
- package/components/datagrids/helpers/shared/attachScrollElement/types.d.ts +14 -0
- package/components/datagrids/helpers/shared/attachScrollElement/types.d.ts.map +1 -0
- package/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/buildCursorExportPaginationInfo.d.ts +4 -0
- package/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/buildCursorExportPaginationInfo.d.ts.map +1 -0
- package/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/buildCursorExportPaginationInfo.js +10 -0
- package/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/index.d.ts +3 -0
- package/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/index.d.ts.map +1 -0
- package/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/types.d.ts +7 -0
- package/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/types.d.ts.map +1 -0
- package/components/datagrids/helpers/shared/getInfinitePageSize/getInfinitePageSize.d.ts +4 -0
- package/components/datagrids/helpers/shared/getInfinitePageSize/getInfinitePageSize.d.ts.map +1 -0
- package/components/datagrids/helpers/shared/getInfinitePageSize/getInfinitePageSize.js +12 -0
- package/components/datagrids/helpers/shared/getInfinitePageSize/index.d.ts +3 -0
- package/components/datagrids/helpers/shared/getInfinitePageSize/index.d.ts.map +1 -0
- package/components/datagrids/helpers/shared/getInfinitePageSize/types.d.ts +8 -0
- package/components/datagrids/helpers/shared/getInfinitePageSize/types.d.ts.map +1 -0
- package/components/datagrids/helpers/shared/isNearBottom/index.d.ts +2 -0
- package/components/datagrids/helpers/shared/isNearBottom/index.d.ts.map +1 -0
- package/components/datagrids/helpers/shared/isNearBottom/isNearBottom.d.ts +15 -0
- package/components/datagrids/helpers/shared/isNearBottom/isNearBottom.d.ts.map +1 -0
- package/components/datagrids/helpers/shared/isNearBottom/isNearBottom.js +6 -0
- package/components/datagrids/hooks/index.d.ts +2 -0
- package/components/datagrids/hooks/index.d.ts.map +1 -1
- package/components/datagrids/hooks/shared/useInfiniteScroll/index.d.ts +3 -0
- package/components/datagrids/hooks/shared/useInfiniteScroll/index.d.ts.map +1 -0
- package/components/datagrids/hooks/shared/useInfiniteScroll/types.d.ts +26 -0
- package/components/datagrids/hooks/shared/useInfiniteScroll/types.d.ts.map +1 -0
- package/components/datagrids/hooks/shared/useInfiniteScroll/useInfiniteScroll.d.ts +13 -0
- package/components/datagrids/hooks/shared/useInfiniteScroll/useInfiniteScroll.d.ts.map +1 -0
- package/components/datagrids/hooks/shared/useInfiniteScroll/useInfiniteScroll.js +69 -0
- package/components/datagrids/hooks/useInfiniteScrollGate/index.d.ts +3 -0
- package/components/datagrids/hooks/useInfiniteScrollGate/index.d.ts.map +1 -0
- package/components/datagrids/hooks/useInfiniteScrollGate/types.d.ts +32 -0
- package/components/datagrids/hooks/useInfiniteScrollGate/types.d.ts.map +1 -0
- package/components/datagrids/hooks/useInfiniteScrollGate/useInfiniteScrollGate.d.ts +17 -0
- package/components/datagrids/hooks/useInfiniteScrollGate/useInfiniteScrollGate.d.ts.map +1 -0
- package/components/datagrids/hooks/useInfiniteScrollGate/useInfiniteScrollGate.js +20 -0
- package/components/datagrids/hooks/useRemeasureOnReady/useRemeasureOnReady.d.ts +4 -1
- package/components/datagrids/hooks/useRemeasureOnReady/useRemeasureOnReady.d.ts.map +1 -1
- package/components/datagrids/hooks/useRemeasureOnReady/useRemeasureOnReady.js +33 -25
- package/components/datagrids/index.d.ts +5 -2
- package/components/datagrids/index.d.ts.map +1 -1
- package/components/datagrids/slots/DataGridEnum.d.ts +4 -0
- package/components/datagrids/slots/DataGridEnum.d.ts.map +1 -1
- package/components/datagrids/slots/DataGridEnum.js +5 -4
- package/components/datagrids/slots/DataGridSlot.d.ts +11 -0
- package/components/datagrids/slots/DataGridSlot.d.ts.map +1 -1
- package/components/datagrids/slots/DataGridSlot.js +121 -113
- package/components/datagrids/subcomponents/InfiniteScrollStatus/InfiniteScrollStatus.d.ts +8 -0
- package/components/datagrids/subcomponents/InfiniteScrollStatus/InfiniteScrollStatus.d.ts.map +1 -0
- package/components/datagrids/subcomponents/InfiniteScrollStatus/InfiniteScrollStatus.js +46 -0
- package/components/datagrids/subcomponents/InfiniteScrollStatus/index.d.ts +3 -0
- package/components/datagrids/subcomponents/InfiniteScrollStatus/index.d.ts.map +1 -0
- package/components/datagrids/subcomponents/InfiniteScrollStatus/types.d.ts +11 -0
- package/components/datagrids/subcomponents/InfiniteScrollStatus/types.d.ts.map +1 -0
- package/components/datagrids/subcomponents/index.d.ts +1 -0
- package/components/datagrids/subcomponents/index.d.ts.map +1 -1
- package/components/datagrids/tests/helpers/InfiniteScrollStory.d.ts +9 -0
- package/components/datagrids/tests/helpers/InfiniteScrollStory.d.ts.map +1 -0
- package/components/datagrids/tests/helpers/infiniteScrollStoryHelpers.d.ts +22 -0
- package/components/datagrids/tests/helpers/infiniteScrollStoryHelpers.d.ts.map +1 -0
- package/components/datagrids/types.d.ts +69 -4
- package/components/datagrids/types.d.ts.map +1 -1
- package/components/datagrids/views/CardsView/CardsView.d.ts.map +1 -1
- package/components/datagrids/views/CardsView/CardsView.js +90 -79
- package/components/datagrids/views/CardsView/helpers/observeContainerWidth/index.d.ts +3 -0
- package/components/datagrids/views/CardsView/helpers/observeContainerWidth/index.d.ts.map +1 -0
- package/components/datagrids/views/CardsView/helpers/observeContainerWidth/observeContainerWidth.d.ts +9 -0
- package/components/datagrids/views/CardsView/helpers/observeContainerWidth/observeContainerWidth.d.ts.map +1 -0
- package/components/datagrids/views/CardsView/helpers/observeContainerWidth/observeContainerWidth.js +13 -0
- package/components/datagrids/views/CardsView/helpers/observeContainerWidth/types.d.ts +14 -0
- package/components/datagrids/views/CardsView/helpers/observeContainerWidth/types.d.ts.map +1 -0
- package/components/datagrids/views/CardsView/hooks/useCardsPerRow/types.d.ts +15 -0
- package/components/datagrids/views/CardsView/hooks/useCardsPerRow/types.d.ts.map +1 -0
- package/components/datagrids/views/CardsView/hooks/useCardsPerRow/useCardsPerRow.d.ts.map +1 -1
- package/components/datagrids/views/CardsView/hooks/useCardsPerRow/useCardsPerRow.js +18 -14
- package/components/datagrids/views/ListView/ListView.d.ts.map +1 -1
- package/components/datagrids/views/ListView/ListView.js +65 -54
- package/components/datagrids/views/TableView/TableView.d.ts.map +1 -1
- package/components/datagrids/views/TableView/TableView.js +119 -111
- package/components/datagrids/views/TableView/helpers/getDragHeaderRenderer/getDragHeaderRenderer.d.ts +1 -0
- package/components/datagrids/views/TableView/helpers/getDragHeaderRenderer/getDragHeaderRenderer.d.ts.map +1 -1
- package/components/datagrids/views/TableView/helpers/getDragHeaderRenderer/getDragHeaderRenderer.js +9 -8
- package/components/datagrids/views/TableView/hooks/useColumnSortRules/index.d.ts +2 -0
- package/components/datagrids/views/TableView/hooks/useColumnSortRules/index.d.ts.map +1 -0
- package/components/datagrids/views/TableView/hooks/useColumnSortRules/useColumnSortRules.d.ts +25 -0
- package/components/datagrids/views/TableView/hooks/useColumnSortRules/useColumnSortRules.d.ts.map +1 -0
- package/components/datagrids/views/TableView/hooks/useColumnSortRules/useColumnSortRules.js +97 -0
- package/components/datagrids/views/TableView/hooks/useHeaderMenuActions/useHeaderMenuActions.d.ts.map +1 -1
- package/components/datagrids/views/TableView/hooks/useHeaderMenuActions/useHeaderMenuActions.js +117 -138
- package/components/datagrids/views/TableView/hooks/useSortColumnsRows/useSortColumnsRows.d.ts.map +1 -1
- package/components/datagrids/views/TableView/hooks/useSortColumnsRows/useSortColumnsRows.js +57 -54
- package/components/datagrids/views/TableView/subcomponents/DraggableHeaderRenderer/DraggableHeaderRenderer.d.ts.map +1 -1
- package/components/datagrids/views/TableView/subcomponents/DraggableHeaderRenderer/DraggableHeaderRenderer.js +108 -82
- package/components/datagrids/views/TableView/subcomponents/DraggableHeaderRenderer/types.d.ts +2 -0
- package/components/datagrids/views/TableView/subcomponents/DraggableHeaderRenderer/types.d.ts.map +1 -1
- package/components/extended/mui/IconButton/IconButton.styles.d.ts +1 -1
- package/index.js +737 -732
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { RowKey, RowHeightVariants, GridProps, OnChangeConfig } from '../../types';
|
|
2
|
+
import { RowKey, RowHeightVariants, GridProps, OnChangeConfig, InfiniteScrollOptions } from '../../types';
|
|
3
3
|
import { Maybe } from '@m4l/core';
|
|
4
4
|
import { ActionsSlots, ColumnsConfigSlots, ControlNavigateSlots, DataGridSlots, RowsCountSlots, TableSlots, TextEditorSlots } from '../../slots/DataGridEnum';
|
|
5
5
|
import { SortColumn } from 'react-data-grid';
|
|
@@ -88,13 +88,18 @@ export interface IGridConfigExtended extends IGridConfig {
|
|
|
88
88
|
/** Modo de vista actual (table/cards/list) */
|
|
89
89
|
viewMode?: ViewMode;
|
|
90
90
|
}
|
|
91
|
-
export interface DataGridProviderProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<GridProps<TRow, TSummaryRow, TKey>, 'rows' | 'columns' | 'rowActionsGetter' | 'rowHeaderHeights' | 'rowHeights' | 'initialRowHeightVariant' | 'checkedRows' | 'onCheckedRowsChange' | 'checkedRowsMultiple' | 'rowKeyGetter' | 'externalSortSettings' | 'externalFilterSettings' | 'defaultViewMode' | 'cardsViewConfig' | 'listViewConfig' | 'reorderable'> {
|
|
91
|
+
export interface DataGridProviderProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<GridProps<TRow, TSummaryRow, TKey>, 'rows' | 'columns' | 'rowActionsGetter' | 'rowHeaderHeights' | 'rowHeights' | 'initialRowHeightVariant' | 'checkedRows' | 'onCheckedRowsChange' | 'checkedRowsMultiple' | 'rowKeyGetter' | 'externalSortSettings' | 'externalFilterSettings' | 'defaultViewMode' | 'cardsViewConfig' | 'listViewConfig' | 'reorderable' | 'headerClickDeferMs'> {
|
|
92
92
|
id: number | string;
|
|
93
93
|
children: ReactNode;
|
|
94
94
|
rowsCount: number;
|
|
95
95
|
size: GridProps<any, any, any>['size'];
|
|
96
96
|
viewMode?: ViewMode;
|
|
97
97
|
onViewModeChange?: (viewMode: ViewMode) => void;
|
|
98
|
+
/**
|
|
99
|
+
* Infinite scroll options, only present while the infinite scroll mode is on.
|
|
100
|
+
* Undefined means the grid works as before (pager or plain list).
|
|
101
|
+
*/
|
|
102
|
+
infiniteScrollOptions?: InfiniteScrollOptions;
|
|
98
103
|
/** Configuración inicial del DataGrid */
|
|
99
104
|
defaultConfig?: IGridConfigExtended;
|
|
100
105
|
/** Callback para persistir cambios de configuración */
|
|
@@ -113,7 +118,7 @@ export type RowHeightState = {
|
|
|
113
118
|
rowHeight: number;
|
|
114
119
|
rowHeaderHeight: number;
|
|
115
120
|
};
|
|
116
|
-
export interface DataGridContextProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<DataGridProviderProps<TRow, TSummaryRow, TKey>, 'rows' | 'checkedRows' | 'onCheckedRowsChange' | 'checkedRowsMultiple' | 'rowHeights' | 'rowsCount' | 'rowActionsGetter' | 'rowKeyGetter' | 'externalSortSettings' | 'externalFilterSettings' | 'viewMode' | 'onViewModeChange' | 'defaultViewMode' | 'cardsViewConfig' | 'listViewConfig'> {
|
|
121
|
+
export interface DataGridContextProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<DataGridProviderProps<TRow, TSummaryRow, TKey>, 'rows' | 'checkedRows' | 'onCheckedRowsChange' | 'checkedRowsMultiple' | 'rowHeights' | 'rowsCount' | 'rowActionsGetter' | 'rowKeyGetter' | 'externalSortSettings' | 'externalFilterSettings' | 'viewMode' | 'onViewModeChange' | 'defaultViewMode' | 'cardsViewConfig' | 'listViewConfig' | 'infiniteScrollOptions' | 'headerClickDeferMs'> {
|
|
117
122
|
/** Callback para persistir cambios de configuración */
|
|
118
123
|
onChangeConfig?: OnChangeConfig;
|
|
119
124
|
/**
|
|
@@ -137,5 +142,15 @@ export interface DataGridContextProps<TRow, TSummaryRow, TKey extends RowKey = R
|
|
|
137
142
|
size: GridProps<any, any, any>['size'];
|
|
138
143
|
sortColumns: SortColumn[];
|
|
139
144
|
setSortColumns: React.Dispatch<React.SetStateAction<SortColumn[]>>;
|
|
145
|
+
/**
|
|
146
|
+
* Calls `infiniteScrollOptions.onLoadMore` once if another page can be loaded and no
|
|
147
|
+
* request is pending. Returns true when it was called.
|
|
148
|
+
*/
|
|
149
|
+
requestLoadMore: () => boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Reopens the infinite scroll gate and requests the next page again, for a retry
|
|
152
|
+
* action after a failed load.
|
|
153
|
+
*/
|
|
154
|
+
retryLoadMore: () => boolean;
|
|
140
155
|
}
|
|
141
156
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/contexts/DataGridContext/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,SAAS,EACT,cAAc,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/contexts/DataGridContext/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,qBAAqB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,UAAU,EACV,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,E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ACd,IAAI,CAAC;IACV,aAAa,EAAE,aAAa,EAAE,CAAC;IAC/B,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;IACnD,YAAY,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,sBAAsB,EAAE,MAAM,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,uBAAuB,EAAE,iBAAiB,CAAC;IAC3C,mBAAmB,EAAE,CAAC,SAAS,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5D,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChE,OAAO,CAAC,EAAE,MAAM,CACZ,aAAa,GACb,YAAY,GACZ,cAAc,GACd,UAAU,GACV,eAAe,GACf,kBAAkB,GAClB,oBAAoB,EACtB,MAAM,CACP,CAAC;IACF,IAAI,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IACvC,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACnE;;;OAGG;IACH,eAAe,EAAE,MAAM,OAAO,CAAC;IAC/B;;;OAGG;IACH,aAAa,EAAE,MAAM,OAAO,CAAC;CAC9B"}
|
|
@@ -7,6 +7,7 @@ export declare const DICTIONARY: {
|
|
|
7
7
|
LABEL_ACTIONS: string;
|
|
8
8
|
LABEL_ROWS_PER_PAGE: string;
|
|
9
9
|
LABEL_OF: string;
|
|
10
|
+
LABEL_ROWS: string;
|
|
10
11
|
DENSITY_COMPACT: string;
|
|
11
12
|
DENSITY_STANDARD: string;
|
|
12
13
|
DENSITY_CONFORTABLE: string;
|
|
@@ -44,5 +45,8 @@ export declare const DICTIONARY: {
|
|
|
44
45
|
TOOLTIP_EXPORT: string;
|
|
45
46
|
DETAILS: string;
|
|
46
47
|
EDIT_PLACEHOLDER: string;
|
|
48
|
+
LOADING_MORE: string;
|
|
49
|
+
LOAD_MORE_ERROR: string;
|
|
50
|
+
RETRY_LOAD_MORE: string;
|
|
47
51
|
};
|
|
48
52
|
//# sourceMappingURL=dictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/datagrids/dictionary.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,sBAAsB,cAAc,CAAC;AAElD;;GAEG;AACH,wBAAgB,+BAA+B,aAK9C;AAED,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/datagrids/dictionary.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,sBAAsB,cAAc,CAAC;AAElD;;GAEG;AACH,wBAAgB,+BAA+B,aAK9C;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CtB,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { getMenuActionsComponentsDictionary as
|
|
1
|
+
import { getMenuActionsComponentsDictionary as t } from "../MenuActions/dictionary.js";
|
|
2
2
|
import { getModalDictionary as e } from "../ModalDialog/dictionary.js";
|
|
3
3
|
import { getPagerComponentsDictionary as E } from "../Pager/dicctionary.js";
|
|
4
4
|
import { DATAGRID_ID_DICTIONARY as _ } from "./constants.js";
|
|
5
|
-
const
|
|
5
|
+
const o = "data_grid";
|
|
6
6
|
function s() {
|
|
7
|
-
return [
|
|
7
|
+
return [o].concat(E()).concat(t()).concat(e());
|
|
8
8
|
}
|
|
9
9
|
const I = {
|
|
10
|
-
|
|
10
|
+
LABEL_OF: "pager.of",
|
|
11
|
+
LABEL_ROWS: "pager.rows",
|
|
12
|
+
DENSITY_COMPACT: `${o}.density_compact`,
|
|
11
13
|
DENSITY_STANDARD: `${_}.density_standard`,
|
|
12
14
|
DENSITY_CONFORTABLE: `${_}.density_confortable`,
|
|
13
15
|
DENSITY_TOOLTIP: `${_}.tooltip_density`,
|
|
@@ -44,10 +46,14 @@ const I = {
|
|
|
44
46
|
TOOLTIP_VIEW_MODE: `${_}.tooltip_view_mode`,
|
|
45
47
|
TOOLTIP_EXPORT: `${_}.tooltip_export`,
|
|
46
48
|
DETAILS: `${_}.details`,
|
|
47
|
-
EDIT_PLACEHOLDER: `${_}.edit_placeholder
|
|
49
|
+
EDIT_PLACEHOLDER: `${_}.edit_placeholder`,
|
|
50
|
+
// Infinite scroll mode labels (status bar under the view)
|
|
51
|
+
LOADING_MORE: `${_}.loading_more`,
|
|
52
|
+
LOAD_MORE_ERROR: `${_}.load_more_error`,
|
|
53
|
+
RETRY_LOAD_MORE: `${_}.retry_load_more`
|
|
48
54
|
};
|
|
49
55
|
export {
|
|
50
|
-
|
|
56
|
+
o as DATAGRID_DICTIONARY_ID,
|
|
51
57
|
I as DICTIONARY,
|
|
52
58
|
s as getDataGridComponentsDictionary
|
|
53
59
|
};
|
|
@@ -12,5 +12,10 @@ export { getViewSuffix } from './shared/getViewSuffix';
|
|
|
12
12
|
export { getInitialColumnsConfig } from './shared/getInitialColumnsConfig';
|
|
13
13
|
export { getDataGridRowsFromSet } from './shared/getDataGridRowsFromSet';
|
|
14
14
|
export { getDefaultAction } from './shared/getDefaultAction';
|
|
15
|
+
export { isNearBottom } from './shared/isNearBottom';
|
|
16
|
+
export { attachScrollElement } from './shared/attachScrollElement';
|
|
17
|
+
export { buildCursorExportPaginationInfo } from './shared/buildCursorExportPaginationInfo';
|
|
18
|
+
export { getInfinitePageSize } from './shared/getInfinitePageSize';
|
|
19
|
+
export type { GetInfinitePageSizeParams } from './shared/getInfinitePageSize';
|
|
15
20
|
export { resolveVisibleColumnNames } from './shared/resolveVisibleColumnNames';
|
|
16
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/datagrids/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/datagrids/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,YAAY,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeHeaderClickDeferMs.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/datagrids/helpers/normalizeHeaderClickDeferMs.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAMlE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AttachedScrollElement } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Listens to the vertical scroll and the size changes of a scroll box.
|
|
4
|
+
* @param element - Scroll box of the view.
|
|
5
|
+
* @param onCheck - Called on every vertical scroll and every size change of the box.
|
|
6
|
+
* @returns The listened element and the function that stops listening to it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function attachScrollElement(element: HTMLElement, onCheck: () => void): AttachedScrollElement;
|
|
9
|
+
//# sourceMappingURL=attachScrollElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachScrollElement.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/helpers/shared/attachScrollElement/attachScrollElement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,IAAI,GAClB,qBAAqB,CA6BvB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function l(r, o) {
|
|
2
|
+
let s = r.scrollTop;
|
|
3
|
+
const e = () => {
|
|
4
|
+
r.scrollTop !== s && (s = r.scrollTop, o());
|
|
5
|
+
};
|
|
6
|
+
r.addEventListener("scroll", e, { passive: !0 });
|
|
7
|
+
const c = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(o);
|
|
8
|
+
return c?.observe(r), { element: r, detach: () => {
|
|
9
|
+
r.removeEventListener("scroll", e), c?.disconnect();
|
|
10
|
+
} };
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
l as attachScrollElement
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/helpers/shared/attachScrollElement/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scroll box being listened to, with the function that stops listening to it.
|
|
3
|
+
*/
|
|
4
|
+
export interface AttachedScrollElement {
|
|
5
|
+
/**
|
|
6
|
+
* Element whose scroll and size changes are being listened to.
|
|
7
|
+
*/
|
|
8
|
+
element: HTMLElement;
|
|
9
|
+
/**
|
|
10
|
+
* Removes the scroll listener and disconnects the size observer.
|
|
11
|
+
*/
|
|
12
|
+
detach: () => void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/helpers/shared/attachScrollElement/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC;IACrB;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CursorExportPaginationInfo, CursorExportPaginationInput } from './types';
|
|
2
|
+
/** Build cursor export pagination info with the total record count only. */
|
|
3
|
+
export declare function buildCursorExportPaginationInfo({ totalRecords, }: CursorExportPaginationInput): CursorExportPaginationInfo;
|
|
4
|
+
//# sourceMappingURL=buildCursorExportPaginationInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildCursorExportPaginationInfo.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/buildCursorExportPaginationInfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAEvF,4EAA4E;AAC5E,wBAAgB,+BAA+B,CAAC,EAC9C,YAAY,GACb,EAAE,2BAA2B,GAAG,0BAA0B,CAI1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,YAAY,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,2BAA2B;IAC1C,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { GetInfinitePageSizeParams } from './types';
|
|
2
|
+
/** Calculate a bounded infinite-scroll page size from the visible grid area. */
|
|
3
|
+
export declare function getInfinitePageSize({ boxHeight, itemHeight, itemsPerRow, min, max, }: GetInfinitePageSizeParams): number;
|
|
4
|
+
//# sourceMappingURL=getInfinitePageSize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getInfinitePageSize.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/helpers/shared/getInfinitePageSize/getInfinitePageSize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEzD,gFAAgF;AAChF,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,UAAU,EACV,WAAW,EACX,GAAG,EACH,GAAG,GACJ,EAAE,yBAAyB,GAAG,MAAM,CAWpC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function t({
|
|
2
|
+
boxHeight: n,
|
|
3
|
+
itemHeight: r,
|
|
4
|
+
itemsPerRow: i,
|
|
5
|
+
min: e,
|
|
6
|
+
max: a
|
|
7
|
+
}) {
|
|
8
|
+
return !Number.isFinite(n) || n === 0 || !Number.isFinite(r) || r === 0 ? e : Math.min(a, Math.max(e, Math.ceil(n / r) * i * 2));
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
t as getInfinitePageSize
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/helpers/shared/getInfinitePageSize/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/helpers/shared/getInfinitePageSize/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/helpers/shared/isNearBottom/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tells whether a scroll box is within `threshold` pixels of its bottom edge.
|
|
3
|
+
*
|
|
4
|
+
* Content shorter than the box (nothing to scroll) also counts as "near the bottom",
|
|
5
|
+
* so a first page that does not fill the view still triggers the next load.
|
|
6
|
+
* @param element - Element that owns the vertical scroll.
|
|
7
|
+
* @param threshold - Distance in pixels from the bottom edge that counts as "near".
|
|
8
|
+
* @returns True when the remaining scrollable distance is at most `threshold`.
|
|
9
|
+
* @example
|
|
10
|
+
* // scrollHeight 1000, clientHeight 400, scrollTop 500 → 100 px left
|
|
11
|
+
* isNearBottom(element, 400); // true
|
|
12
|
+
* isNearBottom(element, 50); // false
|
|
13
|
+
*/
|
|
14
|
+
export declare function isNearBottom(element: HTMLElement, threshold: number): boolean;
|
|
15
|
+
//# sourceMappingURL=isNearBottom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isNearBottom.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/helpers/shared/isNearBottom/isNearBottom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAE7E"}
|
|
@@ -8,4 +8,6 @@ export { useViewConfig } from './useViewConfig';
|
|
|
8
8
|
export { useChangeColumnsConfig } from './useChangeColumnsConfig';
|
|
9
9
|
export { useChangeColumnsOrder } from './useChangeColumnsOrder';
|
|
10
10
|
export { useRemeasureOnReady } from './useRemeasureOnReady';
|
|
11
|
+
export { useInfiniteScrollGate } from './useInfiniteScrollGate';
|
|
12
|
+
export { useInfiniteScroll } from './shared/useInfiniteScroll';
|
|
11
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/datagrids/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/datagrids/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/hooks/shared/useInfiniteScroll/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the useInfiniteScroll hook.
|
|
3
|
+
*/
|
|
4
|
+
export interface UseInfiniteScrollProps {
|
|
5
|
+
/**
|
|
6
|
+
* Returns the element that owns the vertical scroll of the view: the react-data-grid
|
|
7
|
+
* root in the table view, the scroll container in the cards and list views.
|
|
8
|
+
* Must be a stable function (memoized by the view). It is called after every render, so
|
|
9
|
+
* it may return a different element, or none, while the view stays mounted.
|
|
10
|
+
*/
|
|
11
|
+
getScrollElement: () => HTMLElement | null | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Total height of the content as computed by the view's virtualizer (`totalSize`). The hook
|
|
14
|
+
* re-checks when it changes, because a virtualized view can shrink its content without any
|
|
15
|
+
* scroll event or box resize reaching the hook in time: in the cards view, a wider box fits
|
|
16
|
+
* more cards per row and the rows are regrouped only after the box's resize callbacks ran.
|
|
17
|
+
*/
|
|
18
|
+
contentHeight?: number;
|
|
19
|
+
/** Returns the measured height of one virtual item in the view, when available. */
|
|
20
|
+
getItemHeight?: () => number | undefined;
|
|
21
|
+
/** Number of records displayed in each virtual row. */
|
|
22
|
+
itemsPerRow?: number;
|
|
23
|
+
/** Height included above the scrollable rows, such as the table header. */
|
|
24
|
+
headerHeight?: number;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/hooks/shared/useInfiniteScroll/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,gBAAgB,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACvD;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACzC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UseInfiniteScrollProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Requests the next page of the infinite scroll mode when the view nears the end of its rows.
|
|
4
|
+
*
|
|
5
|
+
* It listens to the scroll of the view's own box (not the react-data-grid `onScroll` prop,
|
|
6
|
+
* which a consumer `onScroll` spread later would override) and also re-checks when a page
|
|
7
|
+
* lands, the loading ends, the box is resized or the row height changes, because those move
|
|
8
|
+
* the content without any scroll event. Does nothing while the infinite scroll mode is off.
|
|
9
|
+
* @param props - Getters for the scroll element and measured item height, plus the content
|
|
10
|
+
* height computed by the view's virtualizer.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useInfiniteScroll({ getScrollElement, contentHeight, getItemHeight, itemsPerRow, headerHeight, }: UseInfiniteScrollProps): void;
|
|
13
|
+
//# sourceMappingURL=useInfiniteScroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInfiniteScroll.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/hooks/shared/useInfiniteScroll/useInfiniteScroll.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,WAAe,EACf,YAAgB,GACjB,EAAE,sBAAsB,GAAG,IAAI,CAoH/B"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useRef as d, useCallback as D, useEffect as s } from "react";
|
|
2
|
+
import { DATAGRID_INFINITE_MIN_PAGE_SIZE as G, DATAGRID_INFINITE_MAX_PAGE_SIZE as T } from "../../../constants.js";
|
|
3
|
+
import { getInfinitePageSize as b } from "../../../helpers/shared/getInfinitePageSize/getInfinitePageSize.js";
|
|
4
|
+
import { isNearBottom as v } from "../../../helpers/shared/isNearBottom/isNearBottom.js";
|
|
5
|
+
import { attachScrollElement as w } from "../../../helpers/shared/attachScrollElement/attachScrollElement.js";
|
|
6
|
+
import { useDataGrid as k } from "../useDataGrid/useDataGrid.js";
|
|
7
|
+
function z({
|
|
8
|
+
getScrollElement: t,
|
|
9
|
+
contentHeight: R,
|
|
10
|
+
getItemHeight: a,
|
|
11
|
+
itemsPerRow: u = 1,
|
|
12
|
+
headerHeight: f = 0
|
|
13
|
+
}) {
|
|
14
|
+
const { infiniteScrollOptions: r, requestLoadMore: m, rows: _, currentRowHeight: A } = k(), n = r !== void 0, p = r?.threshold, E = r?.hasMore, M = r?.isLoadingMore, I = r?.rowsPerPage, P = r?.onRowsPerPageChange, c = r?.resetKey, g = d(c), o = d(null), i = D(() => {
|
|
15
|
+
const e = t();
|
|
16
|
+
if (!e || e.clientHeight === 0)
|
|
17
|
+
return;
|
|
18
|
+
const h = a?.();
|
|
19
|
+
if (n && h !== void 0 && h !== 0) {
|
|
20
|
+
const N = b({
|
|
21
|
+
boxHeight: e.clientHeight - f,
|
|
22
|
+
itemHeight: h,
|
|
23
|
+
itemsPerRow: u,
|
|
24
|
+
min: G,
|
|
25
|
+
max: T
|
|
26
|
+
});
|
|
27
|
+
N !== I && P?.(N);
|
|
28
|
+
}
|
|
29
|
+
v(e, p ?? e.clientHeight) && m();
|
|
30
|
+
}, [
|
|
31
|
+
t,
|
|
32
|
+
f,
|
|
33
|
+
n,
|
|
34
|
+
a,
|
|
35
|
+
u,
|
|
36
|
+
P,
|
|
37
|
+
m,
|
|
38
|
+
I,
|
|
39
|
+
p
|
|
40
|
+
]), l = d(i);
|
|
41
|
+
s(() => {
|
|
42
|
+
l.current = i;
|
|
43
|
+
const e = n && t() || null;
|
|
44
|
+
o.current?.element !== e && (o.current?.detach(), o.current = e ? w(e, () => l.current()) : null, e && l.current());
|
|
45
|
+
}), s(
|
|
46
|
+
() => () => {
|
|
47
|
+
o.current?.detach(), o.current = null;
|
|
48
|
+
},
|
|
49
|
+
[]
|
|
50
|
+
), s(() => {
|
|
51
|
+
n && i();
|
|
52
|
+
}, [
|
|
53
|
+
n,
|
|
54
|
+
i,
|
|
55
|
+
_.length,
|
|
56
|
+
E,
|
|
57
|
+
M,
|
|
58
|
+
A,
|
|
59
|
+
R,
|
|
60
|
+
a,
|
|
61
|
+
u,
|
|
62
|
+
f
|
|
63
|
+
]), s(() => {
|
|
64
|
+
g.current !== c && (g.current = c, t()?.scrollTo({ top: 0, behavior: "instant" }));
|
|
65
|
+
}, [c, t]);
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
z as useInfiniteScroll
|
|
69
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/hooks/useInfiniteScrollGate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { InfiniteScrollOptions } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the useInfiniteScrollGate hook.
|
|
4
|
+
*/
|
|
5
|
+
export interface UseInfiniteScrollGateProps {
|
|
6
|
+
/**
|
|
7
|
+
* Infinite scroll options received by the DataGrid. Undefined means the mode is off
|
|
8
|
+
* and every request is refused.
|
|
9
|
+
*/
|
|
10
|
+
infiniteScrollOptions?: InfiniteScrollOptions;
|
|
11
|
+
/**
|
|
12
|
+
* Number of rows received by the DataGrid. A change means a page arrived
|
|
13
|
+
* (or the list was restarted), which reopens the gate.
|
|
14
|
+
*/
|
|
15
|
+
rowsCount: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Value returned by the useInfiniteScrollGate hook.
|
|
19
|
+
*/
|
|
20
|
+
export interface UseInfiniteScrollGateResult {
|
|
21
|
+
/**
|
|
22
|
+
* Calls `onLoadMore` once if more rows can be loaded and no request is pending.
|
|
23
|
+
* Returns true when `onLoadMore` was called.
|
|
24
|
+
*/
|
|
25
|
+
requestLoadMore: () => boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Reopens the gate and requests the next page again. Meant for a "retry" action
|
|
28
|
+
* after a failed load, because a failed load does not reopen the gate by itself.
|
|
29
|
+
*/
|
|
30
|
+
retryLoadMore: () => boolean;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/hooks/useInfiniteScrollGate/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,eAAe,EAAE,MAAM,OAAO,CAAC;IAC/B;;;OAGG;IACH,aAAa,EAAE,MAAM,OAAO,CAAC;CAC9B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { UseInfiniteScrollGateProps, UseInfiniteScrollGateResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Decides whether the next page may be requested, so `onLoadMore` is never called twice
|
|
4
|
+
* for the same page.
|
|
5
|
+
*
|
|
6
|
+
* Lives in the DataGrid provider, above the views: `useRemeasureOnReady` can remount the
|
|
7
|
+
* view subtree, and a lock kept inside a view would be lost with it.
|
|
8
|
+
*
|
|
9
|
+
* The lock closes when `onLoadMore` is called and reopens only when the number of rows
|
|
10
|
+
* changes (a page arrived or the list restarted), when `resetKey` changes, or through
|
|
11
|
+
* `retryLoadMore`. It does not reopen when `isLoadingMore` turns false: after a failed
|
|
12
|
+
* load the rows do not change, and reopening there would retry on every scroll event.
|
|
13
|
+
* @param props - Infinite scroll options and current number of rows.
|
|
14
|
+
* @returns Functions to request the next page and to retry after a failure.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useInfiniteScrollGate({ infiniteScrollOptions, rowsCount, }: UseInfiniteScrollGateProps): UseInfiniteScrollGateResult;
|
|
17
|
+
//# sourceMappingURL=useInfiniteScrollGate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInfiniteScrollGate.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/hooks/useInfiniteScrollGate/useInfiniteScrollGate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAEvF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,qBAAqB,EACrB,SAAS,GACV,EAAE,0BAA0B,GAAG,2BAA2B,CAmC1D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useRef as s, useLayoutEffect as n, useCallback as c } from "react";
|
|
2
|
+
function M({
|
|
3
|
+
infiniteScrollOptions: e,
|
|
4
|
+
rowsCount: a
|
|
5
|
+
}) {
|
|
6
|
+
const u = s(e), r = s(!1), f = e?.resetKey;
|
|
7
|
+
n(() => {
|
|
8
|
+
u.current = e;
|
|
9
|
+
}, [e]), n(() => {
|
|
10
|
+
r.current = !1;
|
|
11
|
+
}, [a, f]);
|
|
12
|
+
const o = c(() => {
|
|
13
|
+
const t = u.current;
|
|
14
|
+
return !t || !t.hasMore || t.isLoadingMore || r.current ? !1 : (r.current = !0, t.onLoadMore(), !0);
|
|
15
|
+
}, []), d = c(() => (r.current = !1, o()), [o]);
|
|
16
|
+
return { requestLoadMore: o, retryLoadMore: d };
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
M as useInfiniteScrollGate
|
|
20
|
+
};
|
|
@@ -3,7 +3,10 @@ import { UseRemeasureOnReadyParams } from './types';
|
|
|
3
3
|
* Returns a key that increments once, after the container width settles, ONLY
|
|
4
4
|
* when react-data-grid ended up with a stale grid width (its columns fill far
|
|
5
5
|
* less than the actual grid element). Bumping the key remounts the grid subtree
|
|
6
|
-
* so RDG re-reads the container and re-measures its `auto` columns.
|
|
6
|
+
* so RDG re-reads the container and re-measures its `auto` columns. The remount
|
|
7
|
+
* is skipped after user interaction; in that case, columns keep their initial
|
|
8
|
+
* width, measured at about 0.55 and 0.62 of the grid width in the two affected
|
|
9
|
+
* modules.
|
|
7
10
|
* @param params - Reference to the DataGrid root container.
|
|
8
11
|
* @returns Numeric key used to remount the grid subtree.
|
|
9
12
|
*/
|