slickgrid-react 5.3.2 → 5.5.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/README.md +1 -1
- package/dist/cjs/components/slickgrid-react.js +93 -29
- package/dist/cjs/components/slickgrid-react.js.map +1 -1
- package/dist/cjs/global-grid-options.js +8 -4
- package/dist/cjs/global-grid-options.js.map +1 -1
- package/dist/esm/components/slickgrid-react.js +93 -29
- package/dist/esm/components/slickgrid-react.js.map +1 -1
- package/dist/esm/global-grid-options.js +8 -4
- package/dist/esm/global-grid-options.js.map +1 -1
- package/dist/types/components/slickgrid-react.d.ts +8 -4
- package/dist/types/components/slickgrid-react.d.ts.map +1 -1
- package/package.json +32 -32
- package/src/slickgrid-react/components/slickgrid-react.tsx +85 -15
- package/src/slickgrid-react/global-grid-options.ts +6 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type BackendServiceApi, type Column, type EventSubscription, type ExtensionList, type ExternalResource, type Locale, type Metrics, type Pagination, type ServicePagination, SlickDataView, SlickEventHandler, SlickGrid, BackendUtilityService, CollectionService, ExtensionService, ExtensionUtility, FilterFactory, FilterService, GridEventService, GridService, GridStateService, GroupingAndColspanService, PaginationService, ResizerService, type RxJsFacade, SharedService, SlickGroupItemMetadataProvider, SortService, TreeDataService } from '@slickgrid-universal/common';
|
|
2
|
+
import { type BackendService, type BackendServiceApi, type Column, type EventSubscription, type ExtensionList, type ExternalResource, type Locale, type Metrics, type Pagination, type ServicePagination, SlickDataView, SlickEventHandler, SlickGrid, BackendUtilityService, CollectionService, ExtensionService, ExtensionUtility, FilterFactory, FilterService, GridEventService, GridService, GridStateService, GroupingAndColspanService, PaginationService, ResizerService, type RxJsFacade, SharedService, SlickGroupItemMetadataProvider, SortService, TreeDataService } from '@slickgrid-universal/common';
|
|
3
3
|
import { EventPubSubService } from '@slickgrid-universal/event-pub-sub';
|
|
4
4
|
import { SlickFooterComponent } from '@slickgrid-universal/custom-footer-component';
|
|
5
5
|
import { SlickEmptyWarningComponent } from '@slickgrid-universal/empty-warning-component';
|
|
@@ -32,6 +32,7 @@ export declare class SlickgridReact<TData = any> extends React.Component<Slickgr
|
|
|
32
32
|
protected _isLocalGrid: boolean;
|
|
33
33
|
protected _paginationOptions: Pagination | undefined;
|
|
34
34
|
protected _registeredResources: ExternalResource[];
|
|
35
|
+
protected _scrollEndCalled: boolean;
|
|
35
36
|
protected _gridOptions?: GridOption;
|
|
36
37
|
protected get gridOptions(): GridOption;
|
|
37
38
|
protected set gridOptions(options: GridOption);
|
|
@@ -84,6 +85,7 @@ export declare class SlickgridReact<TData = any> extends React.Component<Slickgr
|
|
|
84
85
|
get datasetHierarchical(): any[] | undefined;
|
|
85
86
|
set datasetHierarchical(newHierarchicalDataset: any[] | undefined);
|
|
86
87
|
constructor(props: SlickgridReactProps);
|
|
88
|
+
get backendService(): BackendService | undefined;
|
|
87
89
|
get eventHandler(): SlickEventHandler;
|
|
88
90
|
get isDatasetInitialized(): boolean;
|
|
89
91
|
set isDatasetInitialized(isInitialized: boolean);
|
|
@@ -99,12 +101,13 @@ export declare class SlickgridReact<TData = any> extends React.Component<Slickgr
|
|
|
99
101
|
columnDefinitionsChanged(): void;
|
|
100
102
|
/**
|
|
101
103
|
* Define our internal Post Process callback, it will execute internally after we get back result from the Process backend call
|
|
102
|
-
*
|
|
103
|
-
* refresh the Dataset & Pagination without
|
|
104
|
+
* Currently ONLY available with the GraphQL Backend Service.
|
|
105
|
+
* The behavior is to refresh the Dataset & Pagination without requiring the user to create his own PostProcess every time
|
|
104
106
|
*/
|
|
105
107
|
createBackendApiInternalPostProcessCallback(gridOptions: GridOption): void;
|
|
106
108
|
bindDifferentHooks(grid: SlickGrid, gridOptions: GridOption, dataView: SlickDataView): void;
|
|
107
109
|
bindBackendCallbackFunctions(gridOptions: GridOption): void;
|
|
110
|
+
protected addBackendInfiniteScrollCallback(): void;
|
|
108
111
|
bindResizeHook(grid: SlickGrid, options: GridOption): void;
|
|
109
112
|
executeAfterDataviewCreated(_grid: SlickGrid, gridOptions: GridOption): void;
|
|
110
113
|
/**
|
|
@@ -127,7 +130,7 @@ export declare class SlickgridReact<TData = any> extends React.Component<Slickgr
|
|
|
127
130
|
* Check if there's any Pagination Presets defined in the Grid Options,
|
|
128
131
|
* if there are then load them in the paginationOptions object
|
|
129
132
|
*/
|
|
130
|
-
setPaginationOptionsWhenPresetDefined(gridOptions: GridOption, paginationOptions: Pagination): Pagination;
|
|
133
|
+
protected setPaginationOptionsWhenPresetDefined(gridOptions: GridOption, paginationOptions: Pagination): Pagination;
|
|
131
134
|
setDarkMode(dark?: boolean): void;
|
|
132
135
|
/**
|
|
133
136
|
* Dynamically change or update the column definitions list.
|
|
@@ -167,6 +170,7 @@ export declare class SlickgridReact<TData = any> extends React.Component<Slickgr
|
|
|
167
170
|
protected loadLocalGridPagination(dataset?: any[]): void;
|
|
168
171
|
/** Load any Row Selections into the DataView that were presets by the user */
|
|
169
172
|
protected loadRowSelectionPresetWhenExists(): void;
|
|
173
|
+
hasBackendInfiniteScroll(gridOptions?: GridOption): boolean;
|
|
170
174
|
protected mergeGridOptions(gridOptions: GridOption): GridOption;
|
|
171
175
|
/** Add a register a new external resource, user could also optional dispose all previous resources before pushing any new resources to the resources array list. */
|
|
172
176
|
registerExternalResources(resources: ExternalResource[], disposePreviousResources?: boolean): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slickgrid-react.d.ts","sourceRoot":"","sources":["../../../src/slickgrid-react/components/slickgrid-react.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAGL,KAAK,iBAAiB,EAEtB,KAAK,MAAM,EAEX,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EAGrB,KAAK,MAAM,EACX,KAAK,OAAO,EACZ,KAAK,UAAU,EAEf,KAAK,iBAAiB,EACtB,aAAa,EACb,iBAAiB,EACjB,SAAS,EAGT,qBAAqB,EACrB,iBAAiB,EAEjB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,yBAAyB,EAEzB,iBAAiB,EACjB,cAAc,EACd,KAAK,UAAU,EACf,aAAa,EACb,8BAA8B,EAE9B,WAAW,EACX,eAAe,EAKhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAMrF,OAAO,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAG,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EACL,gBAAgB,EAEhB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAGzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,UAAU,KAAK;IACb,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,UAAU,CAAC;IACzB,iBAAiB,EAAE,iBAAiB,CAAC;CACtC;AAQD,qBAAa,cAAc,CAAC,KAAK,GAAG,GAAG,CAAE,SAAQ,KAAK,CAAC,SAAS,CAAC,mBAAmB,EAAE,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"slickgrid-react.d.ts","sourceRoot":"","sources":["../../../src/slickgrid-react/components/slickgrid-react.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EAEtB,KAAK,MAAM,EAEX,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,gBA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;;OAKG;IACH,SAAS,CAAC,eAAe,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAAE,EAAE,gBAAgB,UAAQ,GAAG,CAAC,EAAE;IA+BlF,sGAAsG;IACtG,SAAS,CAAC,oBAAoB,CAAC,iBAAiB,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE;IAgBnF;;;OAGG;IACH,SAAS,CAAC,sBAAsB,CAAC,CAAC,SAAS,KAAK,GAAG,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE;IAe7F,MAAM;CAcP"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slickgrid-react",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0",
|
|
4
4
|
"description": "Slickgrid components made available in React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -83,13 +83,13 @@
|
|
|
83
83
|
"/src/slickgrid-react"
|
|
84
84
|
],
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@slickgrid-universal/common": "~5.
|
|
87
|
-
"@slickgrid-universal/custom-footer-component": "~5.
|
|
88
|
-
"@slickgrid-universal/empty-warning-component": "~5.
|
|
89
|
-
"@slickgrid-universal/event-pub-sub": "~5.
|
|
90
|
-
"@slickgrid-universal/pagination-component": "~5.
|
|
86
|
+
"@slickgrid-universal/common": "~5.5.0",
|
|
87
|
+
"@slickgrid-universal/custom-footer-component": "~5.5.0",
|
|
88
|
+
"@slickgrid-universal/empty-warning-component": "~5.5.0",
|
|
89
|
+
"@slickgrid-universal/event-pub-sub": "~5.5.0",
|
|
90
|
+
"@slickgrid-universal/pagination-component": "~5.5.0",
|
|
91
91
|
"dequal": "^2.0.3",
|
|
92
|
-
"i18next": "^23.
|
|
92
|
+
"i18next": "^23.12.2",
|
|
93
93
|
"sortablejs": "^1.15.2"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
@@ -99,18 +99,18 @@
|
|
|
99
99
|
"@formkit/tempo": "^0.1.2",
|
|
100
100
|
"@popperjs/core": "^2.11.8",
|
|
101
101
|
"@release-it/conventional-changelog": "^8.0.1",
|
|
102
|
-
"@slickgrid-universal/composite-editor-component": "~5.
|
|
103
|
-
"@slickgrid-universal/custom-tooltip-plugin": "~5.
|
|
104
|
-
"@slickgrid-universal/excel-export": "~5.
|
|
105
|
-
"@slickgrid-universal/graphql": "~5.
|
|
106
|
-
"@slickgrid-universal/odata": "~5.
|
|
107
|
-
"@slickgrid-universal/rxjs-observable": "~5.
|
|
108
|
-
"@slickgrid-universal/text-export": "~5.
|
|
102
|
+
"@slickgrid-universal/composite-editor-component": "~5.5.0",
|
|
103
|
+
"@slickgrid-universal/custom-tooltip-plugin": "~5.5.0",
|
|
104
|
+
"@slickgrid-universal/excel-export": "~5.5.0",
|
|
105
|
+
"@slickgrid-universal/graphql": "~5.5.0",
|
|
106
|
+
"@slickgrid-universal/odata": "~5.5.0",
|
|
107
|
+
"@slickgrid-universal/rxjs-observable": "~5.5.0",
|
|
108
|
+
"@slickgrid-universal/text-export": "~5.5.0",
|
|
109
109
|
"@types/dompurify": "^3.0.5",
|
|
110
110
|
"@types/fnando__sparkline": "^0.3.7",
|
|
111
111
|
"@types/i18next-xhr-backend": "^1.4.2",
|
|
112
112
|
"@types/jest": "^29.5.12",
|
|
113
|
-
"@types/node": "^
|
|
113
|
+
"@types/node": "^22.1.0",
|
|
114
114
|
"@types/react": "^18.3.3",
|
|
115
115
|
"@types/react-dom": "^18.3.0",
|
|
116
116
|
"@types/sortablejs": "^1.15.8",
|
|
@@ -124,20 +124,20 @@
|
|
|
124
124
|
"copyfiles": "^2.4.1",
|
|
125
125
|
"css-loader": "^7.1.2",
|
|
126
126
|
"custom-event-polyfill": "^1.0.7",
|
|
127
|
-
"cypress": "^13.13.
|
|
127
|
+
"cypress": "^13.13.2",
|
|
128
128
|
"cypress-real-events": "^1.13.0",
|
|
129
129
|
"dompurify": "^3.1.6",
|
|
130
|
-
"esbuild-loader": "^4.2.
|
|
131
|
-
"eslint": "^9.
|
|
132
|
-
"eslint-plugin-cypress": "^3.
|
|
130
|
+
"esbuild-loader": "^4.2.2",
|
|
131
|
+
"eslint": "^9.8.0",
|
|
132
|
+
"eslint-plugin-cypress": "^3.4.0",
|
|
133
133
|
"eslint-plugin-import": "^2.29.1",
|
|
134
|
-
"eslint-plugin-n": "^17.
|
|
134
|
+
"eslint-plugin-n": "^17.10.2",
|
|
135
135
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
136
|
-
"eslint-plugin-react": "^7.
|
|
136
|
+
"eslint-plugin-react": "^7.35.0",
|
|
137
137
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
138
138
|
"fetch-jsonp": "^1.3.0",
|
|
139
|
-
"globals": "^15.
|
|
140
|
-
"html-loader": "5.
|
|
139
|
+
"globals": "^15.9.0",
|
|
140
|
+
"html-loader": "5.1.0",
|
|
141
141
|
"html-webpack-plugin": "5.6.0",
|
|
142
142
|
"i18next-http-backend": "^2.5.2",
|
|
143
143
|
"isomorphic-fetch": "^3.0.0",
|
|
@@ -151,20 +151,20 @@
|
|
|
151
151
|
"promise-polyfill": "^8.3.0",
|
|
152
152
|
"react": "^18.3.1",
|
|
153
153
|
"react-dom": "^18.3.1",
|
|
154
|
-
"react-i18next": "^
|
|
155
|
-
"react-router-dom": "^6.
|
|
154
|
+
"react-i18next": "^15.0.0",
|
|
155
|
+
"react-router-dom": "^6.26.0",
|
|
156
156
|
"regenerator-runtime": "^0.14.1",
|
|
157
|
-
"release-it": "^17.
|
|
158
|
-
"rimraf": "^5.0.
|
|
157
|
+
"release-it": "^17.6.0",
|
|
158
|
+
"rimraf": "^5.0.10",
|
|
159
159
|
"rxjs": "^7.8.1",
|
|
160
160
|
"sass": "^1.77.8",
|
|
161
|
-
"sass-loader": "^
|
|
161
|
+
"sass-loader": "^16.0.0",
|
|
162
162
|
"serve": "^14.2.3",
|
|
163
163
|
"style-loader": "4.0.0",
|
|
164
|
-
"ts-jest": "^29.2.
|
|
164
|
+
"ts-jest": "^29.2.4",
|
|
165
165
|
"ts-loader": "^9.5.1",
|
|
166
|
-
"typescript": "^5.5.
|
|
167
|
-
"typescript-eslint": "^
|
|
166
|
+
"typescript": "^5.5.4",
|
|
167
|
+
"typescript-eslint": "^8.0.1",
|
|
168
168
|
"webpack": "^5.93.0",
|
|
169
169
|
"webpack-cli": "^5.1.4",
|
|
170
170
|
"webpack-dev-server": "^5.0.4"
|
|
@@ -174,6 +174,6 @@
|
|
|
174
174
|
"npm": ">=8.5.0"
|
|
175
175
|
},
|
|
176
176
|
"resolutions": {
|
|
177
|
-
"caniuse-lite": "1.0.
|
|
177
|
+
"caniuse-lite": "1.0.30001649"
|
|
178
178
|
}
|
|
179
179
|
}
|
|
@@ -5,6 +5,7 @@ import React from 'react';
|
|
|
5
5
|
import {
|
|
6
6
|
// interfaces/types
|
|
7
7
|
type AutocompleterEditor,
|
|
8
|
+
type BackendService,
|
|
8
9
|
type BackendServiceApi,
|
|
9
10
|
type BackendServiceOption,
|
|
10
11
|
type Column,
|
|
@@ -116,6 +117,7 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
|
|
|
116
117
|
protected _isLocalGrid = true;
|
|
117
118
|
protected _paginationOptions: Pagination | undefined;
|
|
118
119
|
protected _registeredResources: ExternalResource[] = [];
|
|
120
|
+
protected _scrollEndCalled = false;
|
|
119
121
|
protected _gridOptions?: GridOption;
|
|
120
122
|
|
|
121
123
|
protected get gridOptions(): GridOption {
|
|
@@ -332,6 +334,10 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
|
|
|
332
334
|
this.props.containerService.registerInstance('TreeDataService', this.treeDataService);
|
|
333
335
|
}
|
|
334
336
|
|
|
337
|
+
get backendService(): BackendService | undefined {
|
|
338
|
+
return this.gridOptions.backendServiceApi?.service;
|
|
339
|
+
}
|
|
340
|
+
|
|
335
341
|
get eventHandler(): SlickEventHandler {
|
|
336
342
|
return this._eventHandler;
|
|
337
343
|
}
|
|
@@ -379,6 +385,11 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
|
|
|
379
385
|
this.initialization(this._eventHandler);
|
|
380
386
|
this._isGridInitialized = true;
|
|
381
387
|
|
|
388
|
+
// if we have a backendServiceApi and the enablePagination is undefined, we'll assume that we do want to see it, else get that defined value
|
|
389
|
+
if (!this.hasBackendInfiniteScroll()) {
|
|
390
|
+
this.gridOptions.enablePagination = !!((this.gridOptions.backendServiceApi && this.gridOptions.enablePagination === undefined) ? true : this.gridOptions.enablePagination);
|
|
391
|
+
}
|
|
392
|
+
|
|
382
393
|
if (!this._isPaginationInitialized && !this.props.datasetHierarchical && this._gridOptions?.enablePagination && this._isLocalGrid) {
|
|
383
394
|
this.showPagination = true;
|
|
384
395
|
this.loadLocalGridPagination(this.dataset);
|
|
@@ -425,7 +436,10 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
|
|
|
425
436
|
this.backendServiceApi = this._gridOptions?.backendServiceApi;
|
|
426
437
|
this._isLocalGrid = !this.backendServiceApi; // considered a local grid if it doesn't have a backend service set
|
|
427
438
|
|
|
428
|
-
|
|
439
|
+
// unless specified, we'll create an internal postProcess callback (currently only available for GraphQL)
|
|
440
|
+
if (this.gridOptions.backendServiceApi && !this.gridOptions.backendServiceApi?.disableInternalPostProcess) {
|
|
441
|
+
this.createBackendApiInternalPostProcessCallback(this._gridOptions);
|
|
442
|
+
}
|
|
429
443
|
|
|
430
444
|
if (!this.props.customDataView) {
|
|
431
445
|
const dataviewInlineFilters = this._gridOptions.dataView && this._gridOptions.dataView.inlineFilters || false;
|
|
@@ -576,7 +590,7 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
|
|
|
576
590
|
dispose: this.dispose.bind(this),
|
|
577
591
|
|
|
578
592
|
// return all available Services (non-singleton)
|
|
579
|
-
backendService: this.
|
|
593
|
+
backendService: this.backendService,
|
|
580
594
|
eventPubSubService: this._eventPubSubService,
|
|
581
595
|
filterService: this.filterService,
|
|
582
596
|
gridEventService: this.gridEventService,
|
|
@@ -619,6 +633,9 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
|
|
|
619
633
|
});
|
|
620
634
|
this.serviceList = [];
|
|
621
635
|
|
|
636
|
+
// dispose backend service when defined and a dispose method exists
|
|
637
|
+
this.backendService?.dispose?.();
|
|
638
|
+
|
|
622
639
|
// dispose all registered external resources
|
|
623
640
|
this.disposeExternalResources();
|
|
624
641
|
|
|
@@ -712,8 +729,8 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
|
|
|
712
729
|
|
|
713
730
|
/**
|
|
714
731
|
* Define our internal Post Process callback, it will execute internally after we get back result from the Process backend call
|
|
715
|
-
*
|
|
716
|
-
* refresh the Dataset & Pagination without
|
|
732
|
+
* Currently ONLY available with the GraphQL Backend Service.
|
|
733
|
+
* The behavior is to refresh the Dataset & Pagination without requiring the user to create his own PostProcess every time
|
|
717
734
|
*/
|
|
718
735
|
createBackendApiInternalPostProcessCallback(gridOptions: GridOption) {
|
|
719
736
|
const backendApi = gridOptions?.backendServiceApi;
|
|
@@ -899,7 +916,7 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
|
|
|
899
916
|
backendApiService.updateSorters(undefined, sortColumns);
|
|
900
917
|
}
|
|
901
918
|
// Pagination "presets"
|
|
902
|
-
if (backendApiService.updatePagination && gridOptions.presets.pagination) {
|
|
919
|
+
if (backendApiService.updatePagination && gridOptions.presets.pagination && !this.hasBackendInfiniteScroll()) {
|
|
903
920
|
const { pageNumber, pageSize } = gridOptions.presets.pagination;
|
|
904
921
|
backendApiService.updatePagination(pageNumber, pageSize);
|
|
905
922
|
}
|
|
@@ -943,6 +960,56 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
|
|
|
943
960
|
}
|
|
944
961
|
});
|
|
945
962
|
}
|
|
963
|
+
|
|
964
|
+
// when user enables Infinite Scroll
|
|
965
|
+
if (backendApi.service.options?.infiniteScroll) {
|
|
966
|
+
this.addBackendInfiniteScrollCallback();
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
protected addBackendInfiniteScrollCallback(): void {
|
|
972
|
+
if (this.grid && this.gridOptions.backendServiceApi && this.hasBackendInfiniteScroll() && !this.gridOptions.backendServiceApi?.onScrollEnd) {
|
|
973
|
+
const onScrollEnd = () => {
|
|
974
|
+
this.backendUtilityService.setInfiniteScrollBottomHit(true);
|
|
975
|
+
|
|
976
|
+
// even if we're not showing pagination, we still use pagination service behind the scene
|
|
977
|
+
// to keep track of the scroll position and fetch next set of data (aka next page)
|
|
978
|
+
// we also need a flag to know if we reached the of the dataset or not (no more pages)
|
|
979
|
+
this.paginationService.goToNextPage().then(hasNext => {
|
|
980
|
+
if (!hasNext) {
|
|
981
|
+
this.backendUtilityService.setInfiniteScrollBottomHit(false);
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
};
|
|
985
|
+
this.gridOptions.backendServiceApi.onScrollEnd = onScrollEnd;
|
|
986
|
+
|
|
987
|
+
// subscribe to SlickGrid onScroll to determine when reaching the end of the scroll bottom position
|
|
988
|
+
// run onScrollEnd() method when that happens
|
|
989
|
+
this._eventHandler.subscribe(this.grid.onScroll, (_e, args) => {
|
|
990
|
+
const viewportElm = args.grid.getViewportNode()!;
|
|
991
|
+
if (
|
|
992
|
+
['mousewheel', 'scroll'].includes(args.triggeredBy || '')
|
|
993
|
+
&& this.paginationService?.totalItems
|
|
994
|
+
&& args.scrollTop > 0
|
|
995
|
+
&& Math.ceil(viewportElm.offsetHeight + args.scrollTop) >= args.scrollHeight
|
|
996
|
+
) {
|
|
997
|
+
if (!this._scrollEndCalled) {
|
|
998
|
+
onScrollEnd();
|
|
999
|
+
this._scrollEndCalled = true;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
});
|
|
1003
|
+
|
|
1004
|
+
// use postProcess to identify when scrollEnd process is finished to avoid calling the scrollEnd multiple times
|
|
1005
|
+
// we also need to keep a ref of the user's postProcess and call it after our own postProcess
|
|
1006
|
+
const orgPostProcess = this.gridOptions.backendServiceApi.postProcess;
|
|
1007
|
+
this.gridOptions.backendServiceApi.postProcess = (processResult: any) => {
|
|
1008
|
+
this._scrollEndCalled = false;
|
|
1009
|
+
if (orgPostProcess) {
|
|
1010
|
+
orgPostProcess(processResult);
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
946
1013
|
}
|
|
947
1014
|
}
|
|
948
1015
|
|
|
@@ -1046,7 +1113,7 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
|
|
|
1046
1113
|
}
|
|
1047
1114
|
|
|
1048
1115
|
// display the Pagination component only after calling this refresh data first, we call it here so that if we preset pagination page number it will be shown correctly
|
|
1049
|
-
this.showPagination = (this._gridOptions && (this._gridOptions.enablePagination || (this._gridOptions.backendServiceApi && this._gridOptions.enablePagination === undefined)))
|
|
1116
|
+
this.showPagination = !!(this._gridOptions && (this._gridOptions.enablePagination || (this._gridOptions.backendServiceApi && this._gridOptions.enablePagination === undefined)));
|
|
1050
1117
|
if (this._paginationOptions && this._gridOptions?.pagination && this._gridOptions?.backendServiceApi) {
|
|
1051
1118
|
const paginationOptions = this.setPaginationOptionsWhenPresetDefined(this._gridOptions, this._paginationOptions);
|
|
1052
1119
|
|
|
@@ -1090,10 +1157,14 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
|
|
|
1090
1157
|
* Check if there's any Pagination Presets defined in the Grid Options,
|
|
1091
1158
|
* if there are then load them in the paginationOptions object
|
|
1092
1159
|
*/
|
|
1093
|
-
setPaginationOptionsWhenPresetDefined(gridOptions: GridOption, paginationOptions: Pagination): Pagination {
|
|
1160
|
+
protected setPaginationOptionsWhenPresetDefined(gridOptions: GridOption, paginationOptions: Pagination): Pagination {
|
|
1094
1161
|
if (gridOptions.presets?.pagination && gridOptions.pagination) {
|
|
1095
|
-
|
|
1096
|
-
|
|
1162
|
+
if (this.hasBackendInfiniteScroll()) {
|
|
1163
|
+
console.warn('[Aurelia-Slickgrid] `presets.pagination` is not supported with Infinite Scroll, reverting to first page.');
|
|
1164
|
+
} else {
|
|
1165
|
+
paginationOptions.pageSize = gridOptions.presets.pagination.pageSize;
|
|
1166
|
+
paginationOptions.pageNumber = gridOptions.presets.pagination.pageNumber;
|
|
1167
|
+
}
|
|
1097
1168
|
}
|
|
1098
1169
|
return paginationOptions;
|
|
1099
1170
|
}
|
|
@@ -1210,9 +1281,7 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
|
|
|
1210
1281
|
this.slickPagination.renderPagination(this._elm as HTMLDivElement);
|
|
1211
1282
|
this._isPaginationInitialized = true;
|
|
1212
1283
|
} else if (!showPagination) {
|
|
1213
|
-
|
|
1214
|
-
this.slickPagination.dispose();
|
|
1215
|
-
}
|
|
1284
|
+
this.slickPagination?.dispose();
|
|
1216
1285
|
this._isPaginationInitialized = false;
|
|
1217
1286
|
}
|
|
1218
1287
|
}
|
|
@@ -1355,6 +1424,10 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
|
|
|
1355
1424
|
}
|
|
1356
1425
|
}
|
|
1357
1426
|
|
|
1427
|
+
hasBackendInfiniteScroll(gridOptions?: GridOption): boolean {
|
|
1428
|
+
return !!(gridOptions || this.gridOptions).backendServiceApi?.service.options?.infiniteScroll;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1358
1431
|
protected mergeGridOptions(gridOptions: GridOption): GridOption {
|
|
1359
1432
|
// use extend to deep merge & copy to avoid immutable properties being changed in GlobalGridOptions after a route change
|
|
1360
1433
|
const options = extend(true, {}, GlobalGridOptions, gridOptions) as GridOption;
|
|
@@ -1367,9 +1440,6 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
|
|
|
1367
1440
|
options.showHeaderRow = options.enableFiltering;
|
|
1368
1441
|
}
|
|
1369
1442
|
|
|
1370
|
-
// if we have a backendServiceApi and the enablePagination is undefined, we'll assume that we do want to see it, else get that defined value
|
|
1371
|
-
options.enablePagination = ((gridOptions.backendServiceApi && gridOptions.enablePagination === undefined) ? true : gridOptions.enablePagination) || false;
|
|
1372
|
-
|
|
1373
1443
|
// using copy extend to do a deep clone has an unwanted side on objects and pageSizes but ES6 spread has other worst side effects
|
|
1374
1444
|
// so we will just overwrite the pageSizes when needed, this is the only one causing issues so far.
|
|
1375
1445
|
// On a deep extend, Object and Array are extended, but object wrappers on primitive types such as String, Boolean, and Number are not.
|
|
@@ -256,10 +256,14 @@ export const GlobalGridOptions: Partial<GridOption> = {
|
|
|
256
256
|
* else we'll simply return the column name title
|
|
257
257
|
*/
|
|
258
258
|
function pickerHeaderColumnValueExtractor(column: Column, gridOptions?: GridOption) {
|
|
259
|
+
let colName = column?.columnPickerLabel ?? column?.name ?? '';
|
|
260
|
+
if (colName instanceof HTMLElement || colName instanceof DocumentFragment) {
|
|
261
|
+
colName = colName.textContent || '';
|
|
262
|
+
}
|
|
259
263
|
const headerGroup = column?.columnGroup || '';
|
|
260
264
|
const columnGroupSeparator = gridOptions?.columnGroupSeparator ?? ' - ';
|
|
261
265
|
if (headerGroup) {
|
|
262
|
-
return headerGroup + columnGroupSeparator +
|
|
266
|
+
return headerGroup + columnGroupSeparator + colName;
|
|
263
267
|
}
|
|
264
|
-
return
|
|
268
|
+
return colName;
|
|
265
269
|
}
|