@slickgrid-universal/vanilla-bundle 5.3.4 → 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/dist/cjs/components/slick-vanilla-grid-bundle.js +69 -11
- package/dist/cjs/components/slick-vanilla-grid-bundle.js.map +1 -1
- package/dist/esm/components/slick-vanilla-grid-bundle.js +70 -12
- package/dist/esm/components/slick-vanilla-grid-bundle.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/components/slick-vanilla-grid-bundle.d.ts +8 -4
- package/dist/types/components/slick-vanilla-grid-bundle.d.ts.map +1 -1
- package/package.json +11 -10
- package/src/components/slick-vanilla-grid-bundle.ts +82 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BackendServiceApi, Column, ExtensionList, ExternalResource, GridOption, Metrics, Pagination, ServicePagination, Subscription
|
|
1
|
+
import type { BackendService, BackendServiceApi, Column, ExtensionList, ExternalResource, GridOption, Metrics, Pagination, RxJsFacade, ServicePagination, Subscription } from '@slickgrid-universal/common';
|
|
2
2
|
import { SlickGroupItemMetadataProvider, BackendUtilityService, CollectionService, ExtensionService, ExtensionUtility, FilterFactory, FilterService, GridEventService, GridService, GridStateService, GroupingAndColspanService, PaginationService, ResizerService, SharedService, SortService, type TranslaterService, TreeDataService, SlickEventHandler, SlickDataView, SlickGrid } from '@slickgrid-universal/common';
|
|
3
3
|
import { EventPubSubService } from '@slickgrid-universal/event-pub-sub';
|
|
4
4
|
import { SlickEmptyWarningComponent } from '@slickgrid-universal/empty-warning-component';
|
|
@@ -25,6 +25,7 @@ export declare class SlickVanillaGridBundle<TData = any> {
|
|
|
25
25
|
protected _extensions: ExtensionList<any> | undefined;
|
|
26
26
|
protected _paginationOptions: Pagination | undefined;
|
|
27
27
|
protected _registeredResources: ExternalResource[];
|
|
28
|
+
protected _scrollEndCalled: boolean;
|
|
28
29
|
protected _slickgridInitialized: boolean;
|
|
29
30
|
protected _slickerGridInstances: SlickerGridInstance | undefined;
|
|
30
31
|
backendServiceApi: BackendServiceApi | undefined;
|
|
@@ -63,6 +64,7 @@ export declare class SlickVanillaGridBundle<TData = any> {
|
|
|
63
64
|
slickEmptyWarning: SlickEmptyWarningComponent | undefined;
|
|
64
65
|
slickFooter: SlickFooterComponent | undefined;
|
|
65
66
|
slickPagination: SlickPaginationComponent | undefined;
|
|
67
|
+
get backendService(): BackendService | undefined;
|
|
66
68
|
get eventHandler(): SlickEventHandler;
|
|
67
69
|
get columnDefinitions(): Column<TData>[];
|
|
68
70
|
set columnDefinitions(columnDefinitions: Column<TData>[]);
|
|
@@ -116,15 +118,17 @@ export declare class SlickVanillaGridBundle<TData = any> {
|
|
|
116
118
|
dispose(shouldEmptyDomElementContainer?: boolean): void;
|
|
117
119
|
disposeExternalResources(): void;
|
|
118
120
|
initialization(gridContainerElm: HTMLElement, eventHandler: SlickEventHandler, inputDataset?: TData[]): void;
|
|
121
|
+
hasBackendInfiniteScroll(): boolean;
|
|
119
122
|
mergeGridOptions(gridOptions: GridOption): GridOption;
|
|
120
123
|
/**
|
|
121
124
|
* Define our internal Post Process callback, it will execute internally after we get back result from the Process backend call
|
|
122
|
-
*
|
|
123
|
-
* refresh the Dataset & Pagination without
|
|
125
|
+
* Currently ONLY available with the GraphQL Backend Service.
|
|
126
|
+
* The behavior is to refresh the Dataset & Pagination without requiring the user to create his own PostProcess every time
|
|
124
127
|
*/
|
|
125
128
|
createBackendApiInternalPostProcessCallback(gridOptions?: GridOption): void;
|
|
126
129
|
bindDifferentHooks(grid: SlickGrid, gridOptions: GridOption, dataView: SlickDataView<TData>): void;
|
|
127
130
|
bindBackendCallbackFunctions(gridOptions: GridOption): void;
|
|
131
|
+
protected addBackendInfiniteScrollCallback(): void;
|
|
128
132
|
bindResizeHook(grid: SlickGrid, options: GridOption): void;
|
|
129
133
|
executeAfterDataviewCreated(gridOptions: GridOption): void;
|
|
130
134
|
/**
|
|
@@ -153,7 +157,7 @@ export declare class SlickVanillaGridBundle<TData = any> {
|
|
|
153
157
|
* Check if there's any Pagination Presets defined in the Grid Options,
|
|
154
158
|
* if there are then load them in the paginationOptions object
|
|
155
159
|
*/
|
|
156
|
-
setPaginationOptionsWhenPresetDefined(gridOptions: GridOption, paginationOptions: Pagination): Pagination;
|
|
160
|
+
protected setPaginationOptionsWhenPresetDefined(gridOptions: GridOption, paginationOptions: Pagination): Pagination;
|
|
157
161
|
setDarkMode(dark?: boolean): void;
|
|
158
162
|
/**
|
|
159
163
|
* Loop through all column definitions and copy the original optional `width` properties optionally provided by the user.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slick-vanilla-grid-bundle.d.ts","sourceRoot":"","sources":["../../../src/components/slick-vanilla-grid-bundle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EAEjB,MAAM,EAEN,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,UAAU,EAEV,iBAAiB,EACjB,YAAY,
|
|
1
|
+
{"version":3,"file":"slick-vanilla-grid-bundle.d.ts","sourceRoot":"","sources":["../../../src/components/slick-vanilla-grid-bundle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAEjB,MAAM,EAEN,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,UAAU,EACV,UAAU,EAEV,iBAAiB,EACjB,YAAY,EACb,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAKL,8BAA8B,EAG9B,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,yBAAyB,EAEzB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,WAAW,EAEX,KAAK,iBAAiB,EACtB,eAAe,EAKf,iBAAiB,EACjB,aAAa,EACb,SAAS,EACV,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAoB,kBA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AAS,KAAK,GAAG,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,GAAG,IAAI;CAgBrG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slickgrid-universal/vanilla-bundle",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0",
|
|
4
4
|
"description": "Vanilla Slick Grid Bundle - Framework agnostic the output is to be used in vanilla JS/TS - Written in TypeScript and we also use Vite to bundle everything into a single JS file.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
".": {
|
|
9
9
|
"types": "./dist/types/index.d.ts",
|
|
10
10
|
"import": "./dist/esm/index.js",
|
|
11
|
-
"require": "./dist/cjs/index.js"
|
|
11
|
+
"require": "./dist/cjs/index.js",
|
|
12
|
+
"default": "./dist/esm/index.js"
|
|
12
13
|
},
|
|
13
14
|
"./package.json": "./package.json"
|
|
14
15
|
},
|
|
@@ -37,13 +38,13 @@
|
|
|
37
38
|
"not dead"
|
|
38
39
|
],
|
|
39
40
|
"dependencies": {
|
|
40
|
-
"@slickgrid-universal/binding": "~5.
|
|
41
|
-
"@slickgrid-universal/common": "~5.
|
|
42
|
-
"@slickgrid-universal/custom-footer-component": "~5.
|
|
43
|
-
"@slickgrid-universal/empty-warning-component": "~5.
|
|
44
|
-
"@slickgrid-universal/event-pub-sub": "~5.
|
|
45
|
-
"@slickgrid-universal/pagination-component": "~5.
|
|
46
|
-
"@slickgrid-universal/utils": "~5.
|
|
41
|
+
"@slickgrid-universal/binding": "~5.5.0",
|
|
42
|
+
"@slickgrid-universal/common": "~5.5.0",
|
|
43
|
+
"@slickgrid-universal/custom-footer-component": "~5.5.0",
|
|
44
|
+
"@slickgrid-universal/empty-warning-component": "~5.5.0",
|
|
45
|
+
"@slickgrid-universal/event-pub-sub": "~5.5.0",
|
|
46
|
+
"@slickgrid-universal/pagination-component": "~5.5.0",
|
|
47
|
+
"@slickgrid-universal/utils": "~5.5.0",
|
|
47
48
|
"dequal": "^2.0.3",
|
|
48
49
|
"sortablejs": "^1.15.2",
|
|
49
50
|
"whatwg-fetch": "^3.6.20"
|
|
@@ -52,5 +53,5 @@
|
|
|
52
53
|
"type": "ko_fi",
|
|
53
54
|
"url": "https://ko-fi.com/ghiscoding"
|
|
54
55
|
},
|
|
55
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "bc7ad96ca72c4d7509c160b77a50a2b071028dff"
|
|
56
57
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { dequal } from 'dequal/lite';
|
|
2
2
|
import type {
|
|
3
|
+
BackendService,
|
|
3
4
|
BackendServiceApi,
|
|
4
5
|
BackendServiceOption,
|
|
5
6
|
Column,
|
|
@@ -9,10 +10,10 @@ import type {
|
|
|
9
10
|
GridOption,
|
|
10
11
|
Metrics,
|
|
11
12
|
Pagination,
|
|
13
|
+
RxJsFacade,
|
|
12
14
|
SelectEditor,
|
|
13
15
|
ServicePagination,
|
|
14
16
|
Subscription,
|
|
15
|
-
RxJsFacade,
|
|
16
17
|
} from '@slickgrid-universal/common';
|
|
17
18
|
|
|
18
19
|
import {
|
|
@@ -47,7 +48,7 @@ import {
|
|
|
47
48
|
unsubscribeAll,
|
|
48
49
|
SlickEventHandler,
|
|
49
50
|
SlickDataView,
|
|
50
|
-
SlickGrid
|
|
51
|
+
SlickGrid,
|
|
51
52
|
} from '@slickgrid-universal/common';
|
|
52
53
|
import { extend } from '@slickgrid-universal/utils';
|
|
53
54
|
import { EventNamingStyle, EventPubSubService } from '@slickgrid-universal/event-pub-sub';
|
|
@@ -77,6 +78,7 @@ export class SlickVanillaGridBundle<TData = any> {
|
|
|
77
78
|
protected _extensions: ExtensionList<any> | undefined;
|
|
78
79
|
protected _paginationOptions: Pagination | undefined;
|
|
79
80
|
protected _registeredResources: ExternalResource[] = [];
|
|
81
|
+
protected _scrollEndCalled = false;
|
|
80
82
|
protected _slickgridInitialized = false;
|
|
81
83
|
protected _slickerGridInstances: SlickerGridInstance | undefined;
|
|
82
84
|
backendServiceApi: BackendServiceApi | undefined;
|
|
@@ -122,6 +124,10 @@ export class SlickVanillaGridBundle<TData = any> {
|
|
|
122
124
|
slickFooter: SlickFooterComponent | undefined;
|
|
123
125
|
slickPagination: SlickPaginationComponent | undefined;
|
|
124
126
|
|
|
127
|
+
get backendService(): BackendService | undefined {
|
|
128
|
+
return this.gridOptions.backendServiceApi?.service;
|
|
129
|
+
}
|
|
130
|
+
|
|
125
131
|
get eventHandler(): SlickEventHandler {
|
|
126
132
|
return this._eventHandler;
|
|
127
133
|
}
|
|
@@ -422,6 +428,9 @@ export class SlickVanillaGridBundle<TData = any> {
|
|
|
422
428
|
this.treeDataService?.dispose();
|
|
423
429
|
this.universalContainerService?.dispose();
|
|
424
430
|
|
|
431
|
+
// dispose backend service when defined and a dispose method exists
|
|
432
|
+
this.backendService?.dispose?.();
|
|
433
|
+
|
|
425
434
|
// dispose all registered external resources
|
|
426
435
|
this.disposeExternalResources();
|
|
427
436
|
|
|
@@ -497,7 +506,10 @@ export class SlickVanillaGridBundle<TData = any> {
|
|
|
497
506
|
this._eventPubSubService.eventNamingStyle = this._gridOptions?.eventNamingStyle ?? EventNamingStyle.camelCase;
|
|
498
507
|
this._paginationOptions = this.gridOptions?.pagination;
|
|
499
508
|
|
|
500
|
-
|
|
509
|
+
// unless specified, we'll create an internal postProcess callback (currently only available for GraphQL)
|
|
510
|
+
if (this._gridOptions.backendServiceApi && !this._gridOptions.backendServiceApi?.disableInternalPostProcess) {
|
|
511
|
+
this.createBackendApiInternalPostProcessCallback(this._gridOptions);
|
|
512
|
+
}
|
|
501
513
|
|
|
502
514
|
if (!this.customDataView) {
|
|
503
515
|
const dataviewInlineFilters = this._gridOptions?.dataView?.inlineFilters ?? false;
|
|
@@ -670,7 +682,7 @@ export class SlickVanillaGridBundle<TData = any> {
|
|
|
670
682
|
dispose: this.dispose.bind(this),
|
|
671
683
|
|
|
672
684
|
// return all available Services (non-singleton)
|
|
673
|
-
backendService: this.
|
|
685
|
+
backendService: this.backendService,
|
|
674
686
|
eventPubSubService: this._eventPubSubService,
|
|
675
687
|
filterService: this.filterService,
|
|
676
688
|
gridEventService: this.gridEventService,
|
|
@@ -693,6 +705,10 @@ export class SlickVanillaGridBundle<TData = any> {
|
|
|
693
705
|
this._isGridInitialized = true;
|
|
694
706
|
}
|
|
695
707
|
|
|
708
|
+
hasBackendInfiniteScroll(): boolean {
|
|
709
|
+
return !!this.backendService?.options?.infiniteScroll;
|
|
710
|
+
}
|
|
711
|
+
|
|
696
712
|
mergeGridOptions(gridOptions: GridOption): GridOption {
|
|
697
713
|
const options = extend<GridOption>(true, {}, GlobalGridOptions, gridOptions);
|
|
698
714
|
|
|
@@ -722,8 +738,8 @@ export class SlickVanillaGridBundle<TData = any> {
|
|
|
722
738
|
|
|
723
739
|
/**
|
|
724
740
|
* Define our internal Post Process callback, it will execute internally after we get back result from the Process backend call
|
|
725
|
-
*
|
|
726
|
-
* refresh the Dataset & Pagination without
|
|
741
|
+
* Currently ONLY available with the GraphQL Backend Service.
|
|
742
|
+
* The behavior is to refresh the Dataset & Pagination without requiring the user to create his own PostProcess every time
|
|
727
743
|
*/
|
|
728
744
|
createBackendApiInternalPostProcessCallback(gridOptions?: GridOption): void {
|
|
729
745
|
const backendApi = gridOptions?.backendServiceApi;
|
|
@@ -877,7 +893,7 @@ export class SlickVanillaGridBundle<TData = any> {
|
|
|
877
893
|
backendApiService.updateSorters(undefined, sortColumns);
|
|
878
894
|
}
|
|
879
895
|
// Pagination "presets"
|
|
880
|
-
if (backendApiService.updatePagination && gridOptions.presets.pagination) {
|
|
896
|
+
if (backendApiService.updatePagination && gridOptions.presets.pagination && !this.hasBackendInfiniteScroll()) {
|
|
881
897
|
const { pageNumber, pageSize } = gridOptions.presets.pagination;
|
|
882
898
|
backendApiService.updatePagination(pageNumber, pageSize);
|
|
883
899
|
}
|
|
@@ -920,6 +936,56 @@ export class SlickVanillaGridBundle<TData = any> {
|
|
|
920
936
|
}
|
|
921
937
|
});
|
|
922
938
|
}
|
|
939
|
+
|
|
940
|
+
// when user enables Infinite Scroll
|
|
941
|
+
if (backendApi.service.options?.infiniteScroll) {
|
|
942
|
+
this.addBackendInfiniteScrollCallback();
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
protected addBackendInfiniteScrollCallback(): void {
|
|
948
|
+
if (this.slickGrid && this.gridOptions.backendServiceApi && this.hasBackendInfiniteScroll() && !this.gridOptions.backendServiceApi?.onScrollEnd) {
|
|
949
|
+
const onScrollEnd = () => {
|
|
950
|
+
this.backendUtilityService.setInfiniteScrollBottomHit(true);
|
|
951
|
+
|
|
952
|
+
// even if we're not showing pagination, we still use pagination service behind the scene
|
|
953
|
+
// to keep track of the scroll position and fetch next set of data (aka next page)
|
|
954
|
+
// we also need a flag to know if we reached the of the dataset or not (no more pages)
|
|
955
|
+
this.paginationService.goToNextPage().then(hasNext => {
|
|
956
|
+
if (!hasNext) {
|
|
957
|
+
this.backendUtilityService.setInfiniteScrollBottomHit(false);
|
|
958
|
+
}
|
|
959
|
+
});
|
|
960
|
+
};
|
|
961
|
+
this.gridOptions.backendServiceApi.onScrollEnd = onScrollEnd;
|
|
962
|
+
|
|
963
|
+
// subscribe to SlickGrid onScroll to determine when reaching the end of the scroll bottom position
|
|
964
|
+
// run onScrollEnd() method when that happens
|
|
965
|
+
this._eventHandler.subscribe(this.slickGrid.onScroll, (_e, args) => {
|
|
966
|
+
const viewportElm = args.grid.getViewportNode()!;
|
|
967
|
+
if (
|
|
968
|
+
['mousewheel', 'scroll'].includes(args.triggeredBy || '')
|
|
969
|
+
&& this.paginationService?.totalItems
|
|
970
|
+
&& args.scrollTop > 0
|
|
971
|
+
&& Math.ceil(viewportElm.offsetHeight + args.scrollTop) >= args.scrollHeight
|
|
972
|
+
) {
|
|
973
|
+
if (!this._scrollEndCalled) {
|
|
974
|
+
onScrollEnd();
|
|
975
|
+
this._scrollEndCalled = true;
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
});
|
|
979
|
+
|
|
980
|
+
// use postProcess to identify when scrollEnd process is finished to avoid calling the scrollEnd multiple times
|
|
981
|
+
// we also need to keep a ref of the user's postProcess and call it after our own postProcess
|
|
982
|
+
const orgPostProcess = this.gridOptions.backendServiceApi.postProcess;
|
|
983
|
+
this.gridOptions.backendServiceApi.postProcess = (processResult: any) => {
|
|
984
|
+
this._scrollEndCalled = false;
|
|
985
|
+
if (orgPostProcess) {
|
|
986
|
+
orgPostProcess(processResult);
|
|
987
|
+
}
|
|
988
|
+
};
|
|
923
989
|
}
|
|
924
990
|
}
|
|
925
991
|
|
|
@@ -1010,7 +1076,7 @@ export class SlickVanillaGridBundle<TData = any> {
|
|
|
1010
1076
|
}
|
|
1011
1077
|
|
|
1012
1078
|
// 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
|
|
1013
|
-
this.showPagination = (this._gridOptions && (this._gridOptions.enablePagination || (this._gridOptions.backendServiceApi && this._gridOptions.enablePagination === undefined)))
|
|
1079
|
+
this.showPagination = !!(this._gridOptions && (this._gridOptions.enablePagination || (this._gridOptions.backendServiceApi && this._gridOptions.enablePagination === undefined)));
|
|
1014
1080
|
|
|
1015
1081
|
if (this._paginationOptions && this._gridOptions?.pagination && this._gridOptions?.backendServiceApi) {
|
|
1016
1082
|
const paginationOptions = this.setPaginationOptionsWhenPresetDefined(this._gridOptions, this._paginationOptions);
|
|
@@ -1092,10 +1158,14 @@ export class SlickVanillaGridBundle<TData = any> {
|
|
|
1092
1158
|
* Check if there's any Pagination Presets defined in the Grid Options,
|
|
1093
1159
|
* if there are then load them in the paginationOptions object
|
|
1094
1160
|
*/
|
|
1095
|
-
setPaginationOptionsWhenPresetDefined(gridOptions: GridOption, paginationOptions: Pagination): Pagination {
|
|
1161
|
+
protected setPaginationOptionsWhenPresetDefined(gridOptions: GridOption, paginationOptions: Pagination): Pagination {
|
|
1096
1162
|
if (gridOptions.presets?.pagination && paginationOptions && !this._isPaginationInitialized) {
|
|
1097
|
-
|
|
1098
|
-
|
|
1163
|
+
if (this.hasBackendInfiniteScroll()) {
|
|
1164
|
+
console.warn('[Slickgrid-Universal] `presets.pagination` is not supported with Infinite Scroll, reverting to first page.');
|
|
1165
|
+
} else {
|
|
1166
|
+
paginationOptions.pageSize = gridOptions.presets.pagination.pageSize;
|
|
1167
|
+
paginationOptions.pageNumber = gridOptions.presets.pagination.pageNumber;
|
|
1168
|
+
}
|
|
1099
1169
|
}
|
|
1100
1170
|
return paginationOptions;
|
|
1101
1171
|
}
|
|
@@ -1184,9 +1254,7 @@ export class SlickVanillaGridBundle<TData = any> {
|
|
|
1184
1254
|
this.slickPagination.renderPagination(this._gridParentContainerElm);
|
|
1185
1255
|
this._isPaginationInitialized = true;
|
|
1186
1256
|
} else if (!showPagination) {
|
|
1187
|
-
|
|
1188
|
-
this.slickPagination.dispose();
|
|
1189
|
-
}
|
|
1257
|
+
this.slickPagination?.dispose();
|
|
1190
1258
|
this._isPaginationInitialized = false;
|
|
1191
1259
|
}
|
|
1192
1260
|
}
|