slickgrid-react 5.10.0 → 5.10.2

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.
Files changed (32) hide show
  1. package/dist/cjs/components/slickgrid-react.js +17 -21
  2. package/dist/cjs/components/slickgrid-react.js.map +1 -1
  3. package/dist/cjs/extensions/slickRowDetailView.js +0 -1
  4. package/dist/cjs/extensions/slickRowDetailView.js.map +1 -1
  5. package/dist/cjs/index.js.map +1 -1
  6. package/dist/esm/components/slickgrid-react.js +17 -21
  7. package/dist/esm/components/slickgrid-react.js.map +1 -1
  8. package/dist/esm/extensions/slickRowDetailView.js +0 -1
  9. package/dist/esm/extensions/slickRowDetailView.js.map +1 -1
  10. package/dist/esm/index.js.map +1 -1
  11. package/dist/types/components/slickgrid-react.d.ts +1 -6
  12. package/dist/types/components/slickgrid-react.d.ts.map +1 -1
  13. package/dist/types/components/slickgridReactProps.d.ts +1 -1
  14. package/dist/types/components/slickgridReactProps.d.ts.map +1 -1
  15. package/dist/types/extensions/slickRowDetailView.d.ts.map +1 -1
  16. package/dist/types/index.d.ts +1 -2
  17. package/dist/types/index.d.ts.map +1 -1
  18. package/dist/types/models/gridOption.interface.d.ts +3 -1
  19. package/dist/types/models/gridOption.interface.d.ts.map +1 -1
  20. package/package.json +39 -38
  21. package/src/slickgrid-react/components/slickgrid-react.tsx +6 -16
  22. package/src/slickgrid-react/components/slickgridReactProps.ts +6 -7
  23. package/src/slickgrid-react/extensions/slickRowDetailView.ts +0 -1
  24. package/src/slickgrid-react/index.ts +0 -2
  25. package/src/slickgrid-react/models/gridOption.interface.ts +4 -1
  26. package/dist/cjs/components/slickgridEventAggregator.js +0 -12
  27. package/dist/cjs/components/slickgridEventAggregator.js.map +0 -1
  28. package/dist/esm/components/slickgridEventAggregator.js +0 -8
  29. package/dist/esm/components/slickgridEventAggregator.js.map +0 -1
  30. package/dist/types/components/slickgridEventAggregator.d.ts +0 -11
  31. package/dist/types/components/slickgridEventAggregator.d.ts.map +0 -1
  32. package/src/slickgrid-react/components/slickgridEventAggregator.ts +0 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slickgrid-react",
3
- "version": "5.10.0",
3
+ "version": "5.10.2",
4
4
  "description": "Slickgrid components made available in React",
5
5
  "keywords": [
6
6
  "react",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "repository": {
28
28
  "type": "git",
29
- "url": "https://github.com/ghiscoding/slickgrid-react.git"
29
+ "url": "git+https://github.com/ghiscoding/slickgrid-react.git"
30
30
  },
31
31
  "license": "MIT",
32
32
  "author": "Ghislain B.",
@@ -83,79 +83,80 @@
83
83
  "/src/slickgrid-react"
84
84
  ],
85
85
  "dependencies": {
86
- "@slickgrid-universal/common": "~5.10.0",
87
- "@slickgrid-universal/custom-footer-component": "~5.10.0",
88
- "@slickgrid-universal/empty-warning-component": "~5.10.0",
89
- "@slickgrid-universal/event-pub-sub": "~5.9.0",
90
- "@slickgrid-universal/pagination-component": "~5.10.0",
91
- "@slickgrid-universal/row-detail-view-plugin": "~5.10.0",
86
+ "@slickgrid-universal/common": "~5.10.2",
87
+ "@slickgrid-universal/custom-footer-component": "~5.10.2",
88
+ "@slickgrid-universal/empty-warning-component": "~5.10.2",
89
+ "@slickgrid-universal/event-pub-sub": "~5.10.2",
90
+ "@slickgrid-universal/pagination-component": "~5.10.2",
91
+ "@slickgrid-universal/row-detail-view-plugin": "~5.10.2",
92
92
  "dequal": "^2.0.3",
93
- "i18next": "^23.16.4",
94
- "sortablejs": "^1.15.3"
93
+ "i18next": "^23.16.8",
94
+ "sortablejs": "^1.15.6"
95
+ },
96
+ "peerDependencies": {
97
+ "react": ">=18.0.0"
95
98
  },
96
99
  "devDependencies": {
97
100
  "@4tw/cypress-drag-drop": "^2.2.5",
98
- "@arethetypeswrong/cli": "^0.16.4",
99
- "@faker-js/faker": "^9.1.0",
101
+ "@faker-js/faker": "^9.2.0",
100
102
  "@fnando/sparkline": "^0.3.10",
101
103
  "@formkit/tempo": "^0.1.2",
102
104
  "@popperjs/core": "^2.11.8",
103
- "@release-it/conventional-changelog": "^9.0.2",
104
- "@slickgrid-universal/composite-editor-component": "~5.10.0",
105
- "@slickgrid-universal/custom-tooltip-plugin": "~5.10.0",
106
- "@slickgrid-universal/excel-export": "~5.10.0",
107
- "@slickgrid-universal/graphql": "~5.10.0",
108
- "@slickgrid-universal/odata": "~5.10.0",
109
- "@slickgrid-universal/rxjs-observable": "~5.10.0",
110
- "@slickgrid-universal/text-export": "~5.10.0",
111
- "@types/dompurify": "^3.0.5",
105
+ "@release-it/conventional-changelog": "^9.0.3",
106
+ "@slickgrid-universal/composite-editor-component": "~5.10.2",
107
+ "@slickgrid-universal/custom-tooltip-plugin": "~5.10.2",
108
+ "@slickgrid-universal/excel-export": "~5.10.2",
109
+ "@slickgrid-universal/graphql": "~5.10.2",
110
+ "@slickgrid-universal/odata": "~5.10.2",
111
+ "@slickgrid-universal/rxjs-observable": "~5.10.2",
112
+ "@slickgrid-universal/text-export": "~5.10.2",
112
113
  "@types/fnando__sparkline": "^0.3.7",
113
114
  "@types/i18next-xhr-backend": "^1.4.2",
114
- "@types/node": "^22.8.6",
115
+ "@types/node": "^22.10.1",
115
116
  "@types/react": "^18.3.12",
116
117
  "@types/react-dom": "^18.3.1",
117
118
  "@types/sortablejs": "^1.15.8",
118
119
  "@types/text-encoding-utf-8": "^1.0.5",
119
- "@vitejs/plugin-react": "^4.3.3",
120
+ "@vitejs/plugin-react": "^4.3.4",
120
121
  "bootstrap": "^5.3.3",
121
- "concurrently": "^9.0.1",
122
+ "concurrently": "^9.1.0",
122
123
  "copyfiles": "^2.4.1",
123
124
  "custom-event-polyfill": "^1.0.7",
124
- "cypress": "^13.15.1",
125
+ "cypress": "^13.16.0",
125
126
  "cypress-real-events": "^1.13.0",
126
- "dompurify": "^3.1.7",
127
- "eslint": "^9.14.0",
127
+ "dompurify": "^3.2.2",
128
+ "eslint": "^9.16.0",
128
129
  "eslint-plugin-cypress": "^4.1.0",
129
130
  "eslint-plugin-import": "^2.31.0",
130
- "eslint-plugin-n": "^17.12.0",
131
+ "eslint-plugin-n": "^17.14.0",
131
132
  "eslint-plugin-prefer-arrow": "^1.2.3",
132
133
  "eslint-plugin-react": "^7.37.2",
133
134
  "eslint-plugin-react-hooks": "^5.0.0",
134
135
  "fetch-jsonp": "^1.3.0",
135
- "globals": "^15.11.0",
136
- "i18next-http-backend": "^2.6.2",
136
+ "globals": "^15.12.0",
137
+ "i18next-http-backend": "^2.7.1",
137
138
  "isomorphic-fetch": "^3.0.0",
138
139
  "npm-run-all2": "^7.0.1",
139
140
  "react": "^18.3.1",
140
141
  "react-dom": "^18.3.1",
141
- "react-i18next": "^15.1.0",
142
- "react-router-dom": "^6.27.0",
142
+ "react-i18next": "^15.1.3",
143
+ "react-router-dom": "^7.0.1",
143
144
  "regenerator-runtime": "^0.14.1",
144
145
  "release-it": "^17.10.0",
145
146
  "rimraf": "^5.0.10",
146
147
  "rxjs": "^7.8.1",
147
- "sass": "^1.80.6",
148
+ "sass": "^1.81.0",
148
149
  "serve": "^14.2.4",
149
- "typescript": "^5.6.3",
150
- "typescript-eslint": "^8.12.2",
151
- "vite": "^5.4.10",
150
+ "typescript": "^5.7.2",
151
+ "typescript-eslint": "^8.16.0",
152
+ "vite": "^6.0.1",
152
153
  "vite-plugin-svgr": "^4.3.0",
153
- "vite-tsconfig-paths": "^5.0.1"
154
+ "vite-tsconfig-paths": "^5.1.3"
154
155
  },
155
156
  "engines": {
156
157
  "node": ">=18.19.0"
157
158
  },
158
159
  "resolutions": {
159
- "caniuse-lite": "1.0.30001676"
160
+ "caniuse-lite": "1.0.30001679"
160
161
  }
161
162
  }
@@ -12,7 +12,6 @@ import {
12
12
  type ExternalResource,
13
13
  GridStateType,
14
14
  type ItemMetadata,
15
- type Locale,
16
15
  type Metrics,
17
16
  type Pagination,
18
17
  type PaginationMetadata,
@@ -58,7 +57,6 @@ import i18next from 'i18next';
58
57
  import React from 'react';
59
58
  import type { Subscription } from 'rxjs';
60
59
 
61
- import { Constants } from '../constants';
62
60
  import { GlobalGridOptions } from '../global-grid-options';
63
61
  import type { SlickgridReactInstance, GridOption, } from '../models/index';
64
62
  import { disposeAllSubscriptions } from '../services/utilities';
@@ -136,15 +134,10 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
136
134
 
137
135
  groupItemMetadataProvider?: SlickGroupItemMetadataProvider;
138
136
  backendServiceApi: BackendServiceApi | undefined;
139
- locales!: Locale;
140
137
  metrics?: Metrics;
141
138
  showPagination = false;
142
139
  serviceList: any[] = [];
143
140
  subscriptions: Array<EventSubscription | Subscription> = [];
144
- paginationData?: {
145
- gridOptions: GridOption;
146
- paginationService: PaginationService;
147
- };
148
141
 
149
142
  // components
150
143
  slickEmptyWarning: SlickEmptyWarningComponent | undefined;
@@ -217,7 +210,9 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
217
210
  set datasetHierarchical(newHierarchicalDataset: any[] | undefined) {
218
211
  const isDatasetEqual = dequal(newHierarchicalDataset, this.sharedService?.hierarchicalDataset ?? []);
219
212
  const prevFlatDatasetLn = this._currentDatasetLength;
220
- this.sharedService.hierarchicalDataset = newHierarchicalDataset;
213
+ if (this.sharedService) {
214
+ this.sharedService.hierarchicalDataset = newHierarchicalDataset;
215
+ }
221
216
 
222
217
  if (newHierarchicalDataset && this.props.columnDefinitions && this.filterService?.clearFilters) {
223
218
  this.filterService.clearFilters();
@@ -358,7 +353,7 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
358
353
  // React doesn't play well with Custom Events & also the render is called after the constructor which brings a second problem
359
354
  // to fix both issues, we need to do the following:
360
355
  // loop through all component props and subscribe to the ones that startsWith "on", we'll assume that it's the custom events
361
- // we'll and call their listeners when events are dispatching
356
+ // we'll then call the assigned listener(s) when events are dispatching
362
357
  for (const prop in this.props) {
363
358
  if (prop.startsWith('on')) {
364
359
  this.subscriptions.push(
@@ -428,7 +423,6 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
428
423
  this._currentDatasetLength = this._dataset.length;
429
424
  this._gridOptions = this.mergeGridOptions(this._gridOptions);
430
425
  this._paginationOptions = this._gridOptions?.pagination;
431
- this.locales = this._gridOptions?.locales ?? Constants.locales;
432
426
  this.backendServiceApi = this._gridOptions?.backendServiceApi;
433
427
  this._isLocalGrid = !this.backendServiceApi; // considered a local grid if it doesn't have a backend service set
434
428
 
@@ -718,7 +712,7 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
718
712
  columnDefinitionsChanged() {
719
713
  this._columnDefinitions = this.props.columnDefinitions;
720
714
  if (this._isGridInitialized) {
721
- this.updateColumnDefinitionsList(this.props.columnDefinitions);
715
+ this.updateColumnDefinitionsList(this._columnDefinitions);
722
716
  }
723
717
  if (this._columnDefinitions.length > 0) {
724
718
  this.copyColumnWidthsReference(this._columnDefinitions);
@@ -1217,10 +1211,6 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
1217
1211
  /** Initialize the Pagination Service once */
1218
1212
  protected initializePaginationService(paginationOptions: Pagination) {
1219
1213
  if (this.grid && this.gridOptions) {
1220
- this.paginationData = {
1221
- gridOptions: this.gridOptions,
1222
- paginationService: this.paginationService,
1223
- };
1224
1214
  this.paginationService.totalItems = this.totalItems;
1225
1215
  this.paginationService.init(this.grid, paginationOptions, this.backendServiceApi);
1226
1216
  this.subscriptions.push(
@@ -1575,7 +1565,7 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
1575
1565
  protected suggestDateParsingWhenHelpful() {
1576
1566
  if (this.dataView?.getItemCount() > WARN_NO_PREPARSE_DATE_SIZE && !this.gridOptions.silenceWarnings && !this.gridOptions.preParseDateColumns && this.grid.getColumns().some(c => isColumnDateType(c.type))) {
1577
1567
  console.warn(
1578
- '[Slickgrid-Universal] For getting better perf, we suggest you enable the `preParseDateColumns` grid option, ' +
1568
+ '[Slickgrid-React] For getting better perf, we suggest you enable the `preParseDateColumns` grid option, ' +
1579
1569
  'for more info visit => https://ghiscoding.gitbook.io/slickgrid-react/column-functionalities/sorting#pre-parse-date-columns-for-better-perf'
1580
1570
  );
1581
1571
  }
@@ -1,15 +1,10 @@
1
1
  import type {
2
2
  Column,
3
3
  ContainerService,
4
+ DragRowMove,
4
5
  ExtensionList,
5
6
  GridOption,
6
- Pagination,
7
- SlickControlList,
8
- SlickDataView,
9
- SlickPluginList,
10
- TranslaterService,
11
7
  OnActiveCellChangedEventArgs,
12
- DragRowMove,
13
8
  OnAddNewRowEventArgs,
14
9
  OnAutosizeColumnsEventArgs,
15
10
  OnBeforeAppendCellEventArgs,
@@ -50,8 +45,13 @@ import type {
50
45
  OnRowsChangedEventArgs,
51
46
  OnRowsOrCountChangedEventArgs,
52
47
  OnSetItemsCalledEventArgs,
48
+ Pagination,
53
49
  PagingInfo,
50
+ SlickControlList,
51
+ SlickDataView,
54
52
  SlickGrid,
53
+ SlickPluginList,
54
+ TranslaterService,
55
55
  } from '@slickgrid-universal/common';
56
56
  import type { SlickgridReactInstance } from '../models';
57
57
 
@@ -135,7 +135,6 @@ export interface SlickgridReactProps {
135
135
  onRowsOrCountChanged?: (e: CustomEvent<{ eventData: any; args: OnRowsOrCountChangedEventArgs; }>) => void;
136
136
  onSetItemsCalled?: (e: CustomEvent<{ eventData: any; args: OnSetItemsCalledEventArgs; }>) => void;
137
137
 
138
-
139
138
  // Slickgrid-React events
140
139
  onAfterExportToExcel?: (e: CustomEvent<any>) => void;
141
140
  onBeforePaginationChange?: (e: CustomEvent<any>) => void;
@@ -246,7 +246,6 @@ export class SlickRowDetailView extends UniversalSlickRowDetailView {
246
246
  const detailContainer = document.createElement('section');
247
247
  containerElements[containerElements.length - 1]!.appendChild(detailContainer);
248
248
 
249
- console.log('elm', containerElements[containerElements.length - 1])
250
249
  const { root } = await loadReactComponentDynamically(this._preloadComponent, detailContainer as HTMLElement);
251
250
  const viewObj = this._views.find(obj => obj.id === item[this.datasetIdPropName]);
252
251
  this._root = root;
@@ -3,7 +3,6 @@ export * from '@slickgrid-universal/common';
3
3
 
4
4
  import { SlickgridReact } from './components/slickgrid-react';
5
5
  import { SlickRowDetailView } from './extensions/slickRowDetailView';
6
- import type { SlickgridEventAggregator } from './components/slickgridEventAggregator';
7
6
  import type { SlickgridConfig } from './slickgrid-config';
8
7
 
9
8
  import type {
@@ -20,7 +19,6 @@ export {
20
19
  } from './services/index';
21
20
 
22
21
  export {
23
- type SlickgridEventAggregator,
24
22
  type SlickgridReactInstance,
25
23
  type SlickgridReactComponentOutput,
26
24
  type GridOption,
@@ -1,9 +1,12 @@
1
- import type { GridOption as UniversalGridOption } from '@slickgrid-universal/common';
1
+ import type { BasePaginationComponent, BasePaginationModel, GridOption as UniversalGridOption } from '@slickgrid-universal/common';
2
2
  import type * as i18next from 'i18next';
3
3
 
4
4
  import type { RowDetailView } from './rowDetailView.interface';
5
5
 
6
6
  export interface GridOption extends UniversalGridOption {
7
+ /** External Custom Pagination Component that can be provided by the user */
8
+ customPaginationComponent?: typeof BasePaginationComponent | (() => BasePaginationModel);
9
+
7
10
  /** I18N translation service instance */
8
11
  i18n?: i18next.i18n;
9
12
 
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SlickgridEventAggregator = void 0;
4
- /**
5
- * A class that will be used for internal communication of parent-child
6
- *
7
- * All methods are abstract for typings purposes only
8
- */
9
- class SlickgridEventAggregator {
10
- }
11
- exports.SlickgridEventAggregator = SlickgridEventAggregator;
12
- //# sourceMappingURL=slickgridEventAggregator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slickgridEventAggregator.js","sourceRoot":"","sources":["../../../src/slickgrid-react/components/slickgridEventAggregator.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,MAAsB,wBAAwB;CAI7C;AAJD,4DAIC"}
@@ -1,8 +0,0 @@
1
- /**
2
- * A class that will be used for internal communication of parent-child
3
- *
4
- * All methods are abstract for typings purposes only
5
- */
6
- export class SlickgridEventAggregator {
7
- }
8
- //# sourceMappingURL=slickgridEventAggregator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slickgridEventAggregator.js","sourceRoot":"","sources":["../../../src/slickgrid-react/components/slickgridEventAggregator.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,OAAgB,wBAAwB;CAI7C"}
@@ -1,11 +0,0 @@
1
- import type { EventSubscription } from '@slickgrid-universal/common';
2
- /**
3
- * A class that will be used for internal communication of parent-child
4
- *
5
- * All methods are abstract for typings purposes only
6
- */
7
- export declare abstract class SlickgridEventAggregator {
8
- abstract publish(event: string, data: any): void;
9
- abstract subscribe(event: string, callback: (data: any) => void): EventSubscription;
10
- }
11
- //# sourceMappingURL=slickgridEventAggregator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slickgridEventAggregator.d.ts","sourceRoot":"","sources":["../../../src/slickgrid-react/components/slickgridEventAggregator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;;;GAIG;AACH,8BAAsB,wBAAwB;IAC5C,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI;IAEhD,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,iBAAiB;CACpF"}
@@ -1,12 +0,0 @@
1
- import type { EventSubscription } from '@slickgrid-universal/common';
2
-
3
- /**
4
- * A class that will be used for internal communication of parent-child
5
- *
6
- * All methods are abstract for typings purposes only
7
- */
8
- export abstract class SlickgridEventAggregator {
9
- abstract publish(event: string, data: any): void;
10
-
11
- abstract subscribe(event: string, callback: (data: any) => void): EventSubscription;
12
- }