slickgrid-react 2.6.4 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/.eslintrc +0 -3
  2. package/CHANGELOG.md +9 -0
  3. package/README.md +2 -2
  4. package/dist/cjs/components/slickgrid-react.d.ts +207 -207
  5. package/dist/cjs/components/slickgrid-react.js +1338 -1337
  6. package/dist/cjs/components/slickgrid-react.js.map +1 -1
  7. package/dist/cjs/components/slickgridEventAggregator.d.ts +10 -10
  8. package/dist/cjs/components/slickgridEventAggregator.js +11 -11
  9. package/dist/cjs/components/slickgridReactProps.d.ts +290 -288
  10. package/dist/cjs/components/slickgridReactProps.js +2 -2
  11. package/dist/cjs/constants.d.ts +23 -23
  12. package/dist/cjs/constants.js +90 -90
  13. package/dist/cjs/constants.js.map +1 -1
  14. package/dist/cjs/global-grid-options.d.ts +5 -5
  15. package/dist/cjs/global-grid-options.js +266 -266
  16. package/dist/cjs/index.d.ts +8 -8
  17. package/dist/cjs/index.js +30 -30
  18. package/dist/cjs/models/gridOption.interface.d.ts +6 -6
  19. package/dist/cjs/models/gridOption.interface.js +2 -2
  20. package/dist/cjs/models/index.d.ts +4 -4
  21. package/dist/cjs/models/index.js +20 -20
  22. package/dist/cjs/models/reactComponentOutput.interface.d.ts +6 -6
  23. package/dist/cjs/models/reactComponentOutput.interface.js +2 -2
  24. package/dist/cjs/models/slickGrid.interface.d.ts +6 -6
  25. package/dist/cjs/models/slickGrid.interface.js +2 -2
  26. package/dist/cjs/models/slickgridReactInstance.interface.d.ts +36 -36
  27. package/dist/cjs/models/slickgridReactInstance.interface.js +2 -2
  28. package/dist/cjs/services/container.service.d.ts +6 -6
  29. package/dist/cjs/services/container.service.js +15 -15
  30. package/dist/cjs/services/index.d.ts +4 -4
  31. package/dist/cjs/services/index.js +20 -20
  32. package/dist/cjs/services/reactUtil.service.d.ts +5 -5
  33. package/dist/cjs/services/reactUtil.service.js +27 -27
  34. package/dist/cjs/services/singletons.d.ts +6 -6
  35. package/dist/cjs/services/singletons.js +9 -9
  36. package/dist/cjs/services/translater.service.d.ts +25 -25
  37. package/dist/cjs/services/translater.service.js +40 -40
  38. package/dist/cjs/services/utilities.d.ts +7 -7
  39. package/dist/cjs/services/utilities.js +20 -20
  40. package/dist/cjs/slickgrid-config.d.ts +5 -5
  41. package/dist/cjs/slickgrid-config.js +10 -10
  42. package/dist/esm/components/slickgrid-react.d.ts +207 -207
  43. package/dist/esm/components/slickgrid-react.js +1317 -1315
  44. package/dist/esm/components/slickgrid-react.js.map +1 -1
  45. package/dist/esm/components/slickgridEventAggregator.d.ts +10 -10
  46. package/dist/esm/components/slickgridEventAggregator.js +7 -7
  47. package/dist/esm/components/slickgridReactProps.d.ts +290 -288
  48. package/dist/esm/components/slickgridReactProps.js +1 -1
  49. package/dist/esm/constants.d.ts +23 -23
  50. package/dist/esm/constants.js +87 -86
  51. package/dist/esm/constants.js.map +1 -1
  52. package/dist/esm/global-grid-options.d.ts +5 -5
  53. package/dist/esm/global-grid-options.js +263 -263
  54. package/dist/esm/index.d.ts +8 -8
  55. package/dist/esm/index.js +8 -8
  56. package/dist/esm/models/gridOption.interface.d.ts +6 -6
  57. package/dist/esm/models/gridOption.interface.js +1 -1
  58. package/dist/esm/models/index.d.ts +4 -4
  59. package/dist/esm/models/index.js +4 -4
  60. package/dist/esm/models/reactComponentOutput.interface.d.ts +6 -6
  61. package/dist/esm/models/reactComponentOutput.interface.js +1 -1
  62. package/dist/esm/models/slickGrid.interface.d.ts +6 -6
  63. package/dist/esm/models/slickGrid.interface.js +1 -1
  64. package/dist/esm/models/slickgridReactInstance.interface.d.ts +36 -36
  65. package/dist/esm/models/slickgridReactInstance.interface.js +1 -1
  66. package/dist/esm/services/container.service.d.ts +6 -6
  67. package/dist/esm/services/container.service.js +11 -11
  68. package/dist/esm/services/index.d.ts +4 -4
  69. package/dist/esm/services/index.js +4 -4
  70. package/dist/esm/services/reactUtil.service.d.ts +5 -5
  71. package/dist/esm/services/reactUtil.service.js +20 -20
  72. package/dist/esm/services/singletons.d.ts +6 -6
  73. package/dist/esm/services/singletons.js +6 -6
  74. package/dist/esm/services/translater.service.d.ts +25 -25
  75. package/dist/esm/services/translater.service.js +33 -33
  76. package/dist/esm/services/utilities.d.ts +7 -7
  77. package/dist/esm/services/utilities.js +16 -16
  78. package/dist/esm/slickgrid-config.d.ts +5 -5
  79. package/dist/esm/slickgrid-config.js +6 -6
  80. package/package.json +56 -48
  81. package/tsconfig.json +2 -2
  82. package/dist/amd/components/slickgrid-react.d.ts +0 -207
  83. package/dist/amd/components/slickgrid-react.js +0 -1325
  84. package/dist/amd/components/slickgrid-react.js.map +0 -1
  85. package/dist/amd/components/slickgridEventAggregator.d.ts +0 -10
  86. package/dist/amd/components/slickgridEventAggregator.js +0 -14
  87. package/dist/amd/components/slickgridEventAggregator.js.map +0 -1
  88. package/dist/amd/components/slickgridReactProps.d.ts +0 -288
  89. package/dist/amd/components/slickgridReactProps.js +0 -5
  90. package/dist/amd/components/slickgridReactProps.js.map +0 -1
  91. package/dist/amd/constants.d.ts +0 -23
  92. package/dist/amd/constants.js +0 -93
  93. package/dist/amd/constants.js.map +0 -1
  94. package/dist/amd/global-grid-options.d.ts +0 -5
  95. package/dist/amd/global-grid-options.js +0 -268
  96. package/dist/amd/global-grid-options.js.map +0 -1
  97. package/dist/amd/index.d.ts +0 -8
  98. package/dist/amd/index.js +0 -27
  99. package/dist/amd/index.js.map +0 -1
  100. package/dist/amd/models/gridOption.interface.d.ts +0 -6
  101. package/dist/amd/models/gridOption.interface.js +0 -5
  102. package/dist/amd/models/gridOption.interface.js.map +0 -1
  103. package/dist/amd/models/index.d.ts +0 -4
  104. package/dist/amd/models/index.js +0 -23
  105. package/dist/amd/models/index.js.map +0 -1
  106. package/dist/amd/models/reactComponentOutput.interface.d.ts +0 -6
  107. package/dist/amd/models/reactComponentOutput.interface.js +0 -5
  108. package/dist/amd/models/reactComponentOutput.interface.js.map +0 -1
  109. package/dist/amd/models/slickGrid.interface.d.ts +0 -6
  110. package/dist/amd/models/slickGrid.interface.js +0 -5
  111. package/dist/amd/models/slickGrid.interface.js.map +0 -1
  112. package/dist/amd/models/slickgridReactInstance.interface.d.ts +0 -36
  113. package/dist/amd/models/slickgridReactInstance.interface.js +0 -5
  114. package/dist/amd/models/slickgridReactInstance.interface.js.map +0 -1
  115. package/dist/amd/services/container.service.d.ts +0 -6
  116. package/dist/amd/services/container.service.js +0 -18
  117. package/dist/amd/services/container.service.js.map +0 -1
  118. package/dist/amd/services/index.d.ts +0 -4
  119. package/dist/amd/services/index.js +0 -23
  120. package/dist/amd/services/index.js.map +0 -1
  121. package/dist/amd/services/reactUtil.service.d.ts +0 -5
  122. package/dist/amd/services/reactUtil.service.js +0 -30
  123. package/dist/amd/services/reactUtil.service.js.map +0 -1
  124. package/dist/amd/services/singletons.d.ts +0 -6
  125. package/dist/amd/services/singletons.js +0 -9
  126. package/dist/amd/services/singletons.js.map +0 -1
  127. package/dist/amd/services/translater.service.d.ts +0 -25
  128. package/dist/amd/services/translater.service.js +0 -43
  129. package/dist/amd/services/translater.service.js.map +0 -1
  130. package/dist/amd/services/utilities.d.ts +0 -7
  131. package/dist/amd/services/utilities.js +0 -23
  132. package/dist/amd/services/utilities.js.map +0 -1
  133. package/dist/amd/slickgrid-config.d.ts +0 -5
  134. package/dist/amd/slickgrid-config.js +0 -12
  135. package/dist/amd/slickgrid-config.js.map +0 -1
package/.eslintrc CHANGED
@@ -10,9 +10,6 @@
10
10
  },
11
11
  "globals": {
12
12
  "Slick": true,
13
- "Slicker": true,
14
- "jQuery": true,
15
- "$": true,
16
13
  "_": true
17
14
  },
18
15
  "parserOptions": {
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
4
4
 
5
+ ## [3.0.1](https://github.com/ghiscoding/slickgrid-react/compare/v3.0.0...v3.0.1) (2023-05-30)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * prefer ESM module over CJS & prefer TS loaders ([#113](https://github.com/ghiscoding/slickgrid-react/issues/113)) ([3c1d510](https://github.com/ghiscoding/slickgrid-react/commit/3c1d510bcff82b331fbe0e4c47a7aa24fc6ff7e3))
11
+
12
+ # [3.0.0](https://github.com/ghiscoding/slickgrid-react/compare/v2.6.4...v3.0.0) (2023-05-29)
13
+
5
14
  ## [2.6.4](https://github.com/ghiscoding/slickgrid-react/compare/v2.6.3...v2.6.4) (2023-05-20)
6
15
 
7
16
 
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
  We now have a fully working and official release 2.x of Slickgrid-React and a new [Live Demo](https://ghiscoding.github.io/slickgrid-react-demos/) which is being used by Cypress E2E tests.
14
14
 
15
15
  ### Brief introduction
16
- One of the best javascript datagrid [SlickGrid](https://github.com/mleibman/SlickGrid) which was originally developed by @mleibman is now available to React. I have used a few datagrids and SlickGrid beats most of them in terms of functionalities and performance (it can easily deal with even a million row). We will be using the [6pac/SlickGrid](https://github.com/6pac/SlickGrid/) fork, it is the most active fork since the original @mleibman was retired some time ago by the original author for personal reasons. Also worth to know, that I also contributed a lot to the 6pac/SlickGrid fork for the benefit of all the SlickGrid libs that I maintain like this one here.
16
+ One of the best JavasSript datagrid [SlickGrid](https://github.com/mleibman/SlickGrid) which was originally developed by @mleibman is now available to React. SlickGrid beats most other datagrids in terms of functionalities and performance (it can easily deal with even a million row). Slickgrid-React is a wrapper on top of SlickGrid and we are using the [6pac/SlickGrid](https://github.com/6pac/SlickGrid/) fork which is the most active fork since the original was put on pause by its original author for personal reasons. Also worth to know, that I also contributed a lot to the 6pac/SlickGrid fork for the benefit of all the SlickGrid libraries that I maintain like this one here....
17
17
 
18
18
  ## Installation
19
19
  Refer to the **[Wiki - HOWTO Step by Step](https://github.com/ghiscoding/slickgrid-react/wiki/HOWTO--Step-by-Step)** and/or clone the [Slickgrid-React-Demos](https://github.com/ghiscoding/slickgrid-react-demos) repository. Please consult all Wikis before opening new issues, also consider asking installation and/or general questions on [Stack Overflow](https://stackoverflow.com/search?tab=newest&q=slickgrid) unless you think there's a bug with the library.
@@ -25,7 +25,7 @@ Refer to the **[Wiki - HOWTO Step by Step](https://github.com/ghiscoding/slickgr
25
25
  [slickgrid-react on NPM](https://www.npmjs.com/package/slickgrid-react)
26
26
 
27
27
  ### Live Demo page
28
- `Slickgrid-React` works with all `Bootstrap` versions and/or any other UI framework you wish to use (Bulma, Material Design, ...), you can see a demo of each one below. There are also 2 new styling Themes, Material & Salesforce which are also available. You can also use different SVG icons, you may want to look at the [Wiki - SVG Icons](https://github.com/ghiscoding/slickgrid-react/wiki/SVG-Icons)
28
+ `Slickgrid-React` works with all `Bootstrap` versions, you can see a demo of each one below. There are also extra styling themes for not just Bootstrap but also Material & Salesforce which are also available. You can also use different SVG icons, you may want to look at the [Wiki - SVG Icons](https://github.com/ghiscoding/slickgrid-react/wiki/SVG-Icons)
29
29
  - [Bootstrap 5 demo](https://ghiscoding.github.io/slickgrid-react) / [examples repo](https://github.com/ghiscoding/slickgrid-react-demos/tree/main/bootstrap5-i18n-demo)
30
30
 
31
31
  #### Working Demos
@@ -1,207 +1,207 @@
1
- import React from 'react';
2
- import 'slickgrid/slick.core';
3
- import 'slickgrid/slick.interactions';
4
- import 'slickgrid/slick.grid';
5
- import 'slickgrid/slick.dataview';
6
- import { BackendServiceApi, Column, EventSubscription, ExtensionList, ExternalResource, Locale, Metrics, Pagination, ServicePagination, SlickDataView, SlickEventHandler, SlickGrid, BackendUtilityService, CollectionService, ExtensionService, ExtensionUtility, FilterFactory, FilterService, GridEventService, GridService, GridStateService, GroupingAndColspanService, PaginationService, ResizerService, RxJsFacade, SharedService, SlickGroupItemMetadataProvider, SortService, TreeDataService } from '@slickgrid-universal/common';
7
- import { EventPubSubService } from '@slickgrid-universal/event-pub-sub';
8
- import { SlickFooterComponent } from '@slickgrid-universal/custom-footer-component';
9
- import { SlickEmptyWarningComponent } from '@slickgrid-universal/empty-warning-component';
10
- import { SlickPaginationComponent } from '@slickgrid-universal/pagination-component';
11
- import { SlickgridReactInstance, GridOption } from '../models/index';
12
- import { ReactUtilService, TranslaterService } from '../services/index';
13
- import { Subscription } from 'rxjs';
14
- import { SlickgridReactProps } from './slickgridReactProps';
15
- interface State {
16
- showPagination: boolean;
17
- _gridOptions: GridOption;
18
- paginationService: PaginationService;
19
- }
20
- export declare class SlickgridReact extends React.Component<SlickgridReactProps, State> {
21
- readonly props: SlickgridReactProps;
22
- protected _mounted: boolean;
23
- protected setStateValue(key: string, value: any, callback?: () => void): void;
24
- protected _columnDefinitions: Column[];
25
- protected _currentDatasetLength: number;
26
- protected _dataset: any[] | null;
27
- protected _elm?: HTMLDivElement | null;
28
- protected _eventHandler: SlickEventHandler;
29
- protected _eventPubSubService: EventPubSubService;
30
- protected _hideHeaderRowAfterPageLoad: boolean;
31
- protected _isGridInitialized: boolean;
32
- protected _isDatasetInitialized: boolean;
33
- protected _isDatasetHierarchicalInitialized: boolean;
34
- protected _isPaginationInitialized: boolean;
35
- protected _isLocalGrid: boolean;
36
- protected _paginationOptions: Pagination | undefined;
37
- protected _registeredResources: ExternalResource[];
38
- protected _gridOptions?: GridOption;
39
- protected get gridOptions(): GridOption;
40
- protected set gridOptions(options: GridOption);
41
- groupItemMetadataProvider?: SlickGroupItemMetadataProvider;
42
- backendServiceApi: BackendServiceApi | undefined;
43
- locales: Locale;
44
- metrics?: Metrics;
45
- showPagination: boolean;
46
- serviceList: any[];
47
- subscriptions: Array<EventSubscription | Subscription>;
48
- paginationData?: {
49
- gridOptions: GridOption;
50
- paginationService: PaginationService;
51
- };
52
- slickEmptyWarning: SlickEmptyWarningComponent | undefined;
53
- slickFooter: SlickFooterComponent | undefined;
54
- slickPagination: SlickPaginationComponent | undefined;
55
- backendUtilityService: BackendUtilityService;
56
- collectionService: CollectionService;
57
- extensionService: ExtensionService;
58
- extensionUtility: ExtensionUtility;
59
- filterFactory: FilterFactory;
60
- filterService: FilterService;
61
- gridEventService: GridEventService;
62
- gridService: GridService;
63
- gridStateService: GridStateService;
64
- groupingService: GroupingAndColspanService;
65
- protected get paginationService(): PaginationService;
66
- protected set paginationService(value: PaginationService);
67
- resizerService: ResizerService;
68
- rxjs?: RxJsFacade;
69
- sharedService: SharedService;
70
- sortService: SortService;
71
- treeDataService: TreeDataService;
72
- dataView: SlickDataView;
73
- grid: SlickGrid;
74
- totalItems: number;
75
- extensions: ExtensionList<any>;
76
- instances: SlickgridReactInstance | null;
77
- static defaultProps: {
78
- reactUtilService: ReactUtilService;
79
- containerService: import("../services/container.service").ContainerService;
80
- translaterService: TranslaterService;
81
- dataset: never[];
82
- gridId: string;
83
- columnDefinitions: never[];
84
- };
85
- get dataset(): any[];
86
- set dataset(newDataset: any[]);
87
- get datasetHierarchical(): any[] | undefined;
88
- set datasetHierarchical(newHierarchicalDataset: any[] | undefined);
89
- constructor(props: SlickgridReactProps);
90
- get eventHandler(): SlickEventHandler;
91
- get isDatasetInitialized(): boolean;
92
- set isDatasetInitialized(isInitialized: boolean);
93
- set isDatasetHierarchicalInitialized(isInitialized: boolean);
94
- get registeredResources(): ExternalResource[];
95
- componentDidMount(): void;
96
- initialization(eventHandler: SlickEventHandler): void;
97
- componentWillUnmount(shouldEmptyDomElementContainer?: boolean): void;
98
- emptyGridContainerElm(): void;
99
- dispose(shouldEmptyDomElementContainer?: boolean): void;
100
- componentDidUpdate(prevProps: SlickgridReactProps): void;
101
- columnDefinitionsChanged(): void;
102
- /**
103
- * Commits the current edit to the grid
104
- */
105
- commitEdit(target: Element): void;
106
- /**
107
- * Define our internal Post Process callback, it will execute internally after we get back result from the Process backend call
108
- * For now, this is GraphQL Service ONLY feature and it will basically
109
- * refresh the Dataset & Pagination without having the user to create his own PostProcess every time
110
- */
111
- createBackendApiInternalPostProcessCallback(gridOptions: GridOption): void;
112
- bindDifferentHooks(grid: SlickGrid, gridOptions: GridOption, dataView: SlickDataView): void;
113
- bindBackendCallbackFunctions(gridOptions: GridOption): void;
114
- bindResizeHook(grid: SlickGrid, options: GridOption): void;
115
- executeAfterDataviewCreated(_grid: SlickGrid, gridOptions: GridOption): void;
116
- /**
117
- * On a Pagination changed, we will trigger a Grid State changed with the new pagination info
118
- * Also if we use Row Selection or the Checkbox Selector with a Backend Service (Odata, GraphQL), we need to reset any selection
119
- */
120
- paginationChanged(pagination: ServicePagination): void;
121
- paginationOptionsChanged(newPaginationOptions: Pagination): void;
122
- /**
123
- * When dataset changes, we need to refresh the entire grid UI & possibly resize it as well
124
- * @param dataset
125
- */
126
- refreshGridData(dataset: any[], totalCount?: number): void;
127
- /**
128
- * Show the filter row displayed on first row, we can optionally pass false to hide it.
129
- * @param showing
130
- */
131
- showHeaderRow(showing?: boolean): boolean;
132
- /**
133
- * Check if there's any Pagination Presets defined in the Grid Options,
134
- * if there are then load them in the paginationOptions object
135
- */
136
- setPaginationOptionsWhenPresetDefined(gridOptions: GridOption, paginationOptions: Pagination): Pagination;
137
- /**
138
- * Dynamically change or update the column definitions list.
139
- * We will re-render the grid so that the new header and data shows up correctly.
140
- * If using i18n, we also need to trigger a re-translate of the column headers
141
- */
142
- updateColumnDefinitionsList(newColumnDefinitions: Column[]): void;
143
- /**
144
- * Loop through all column definitions and copy the original optional `width` properties optionally provided by the user.
145
- * We will use this when doing a resize by cell content, if user provided a `width` it won't override it.
146
- */
147
- protected copyColumnWidthsReference(columnDefinitions: Column[]): void;
148
- protected displayEmptyDataWarning(showWarning?: boolean): void;
149
- /** When data changes in the DataView, we'll refresh the metrics and/or display a warning if the dataset is empty */
150
- protected handleOnItemCountChanged(currentPageRowItemCount: number, totalItemCount: number): void;
151
- /** Initialize the Pagination Service once */
152
- protected initializePaginationService(paginationOptions: Pagination): void;
153
- /**
154
- * Render (or dispose) the Pagination Component, user can optionally provide False (to not show it) which will in term dispose of the Pagination,
155
- * also while disposing we can choose to omit the disposable of the Pagination Service (if we are simply toggling the Pagination, we want to keep the Service alive)
156
- * @param {Boolean} showPagination - show (new render) or not (dispose) the Pagination
157
- * @param {Boolean} shouldDisposePaginationService - when disposing the Pagination, do we also want to dispose of the Pagination Service? (defaults to True)
158
- */
159
- protected renderPagination(showPagination?: boolean): void;
160
- /** Load the Editor Collection asynchronously and replace the "collection" property when Promise resolves */
161
- protected loadEditorCollectionAsync(column: Column): void;
162
- protected insertDynamicPresetColumns(columnId: string, gridPresetColumns: Column[]): void;
163
- /** Load any possible Columns Grid Presets */
164
- protected loadColumnPresetsWhenDatasetInitialized(): void;
165
- /** Load any possible Filters Grid Presets */
166
- protected loadFilterPresetsWhenDatasetInitialized(): void;
167
- /**
168
- * local grid, check if we need to show the Pagination
169
- * if so then also check if there's any presets and finally initialize the PaginationService
170
- * a local grid with Pagination presets will potentially have a different total of items, we'll need to get it from the DataView and update our total
171
- */
172
- protected loadLocalGridPagination(dataset?: any[]): void;
173
- /** Load any Row Selections into the DataView that were presets by the user */
174
- protected loadRowSelectionPresetWhenExists(): void;
175
- protected mergeGridOptions(gridOptions: GridOption): GridOption;
176
- /** Pre-Register any Resource that don't require SlickGrid to be instantiated (for example RxJS Resource) */
177
- protected preRegisterResources(): void;
178
- protected registerResources(): void;
179
- /** Register the RxJS Resource in all necessary services which uses */
180
- protected registerRxJsResource(resource: RxJsFacade): void;
181
- /**
182
- * Takes a flat dataset with parent/child relationship, sort it (via its tree structure) and return the sorted flat array
183
- * @param {Array<Object>} flatDatasetInput - flat dataset input
184
- * @param {Boolean} forceGridRefresh - optionally force a full grid refresh
185
- * @returns {Array<Object>} sort flat parent/child dataset
186
- */
187
- protected sortTreeDataset<T>(flatDatasetInput: T[], forceGridRefresh?: boolean): T[];
188
- /**
189
- * For convenience to the user, we provide the property "editor" as an Slickgrid-React editor complex object
190
- * however "editor" is used internally by SlickGrid for it's own Editor Factory
191
- * so in our lib we will swap "editor" and copy it into a new property called "internalColumnEditor"
192
- * then take back "editor.model" and make it the new "editor" so that SlickGrid Editor Factory still works
193
- */
194
- protected swapInternalEditorToSlickGridFactoryEditor(columnDefinitions: Column[]): any[];
195
- /** translate all columns (including hidden columns) */
196
- protected translateColumnHeaderTitleKeys(): void;
197
- /** translate all column groups (including hidden columns) */
198
- protected translateColumnGroupKeys(): void;
199
- /**
200
- * Update the "internalColumnEditor.collection" property.
201
- * Since this is called after the async call resolves, the pointer will not be the same as the "column" argument passed.
202
- * Once we found the new pointer, we will reassign the "editor" and "collection" to the "internalColumnEditor" so it has newest collection
203
- */
204
- protected updateEditorCollection<T = any>(column: Column<T>, newCollection: T[]): void;
205
- render(): React.JSX.Element;
206
- }
207
- export {};
1
+ import React from 'react';
2
+ import 'slickgrid/slick.core';
3
+ import 'slickgrid/slick.interactions';
4
+ import 'slickgrid/slick.grid';
5
+ import 'slickgrid/slick.dataview';
6
+ import { BackendServiceApi, Column, EventSubscription, ExtensionList, ExternalResource, Locale, Metrics, Pagination, ServicePagination, SlickDataView, SlickEventHandler, SlickGrid, BackendUtilityService, CollectionService, ExtensionService, ExtensionUtility, FilterFactory, FilterService, GridEventService, GridService, GridStateService, GroupingAndColspanService, PaginationService, ResizerService, RxJsFacade, SharedService, SlickGroupItemMetadataProvider, SortService, TreeDataService } from '@slickgrid-universal/common';
7
+ import { EventPubSubService } from '@slickgrid-universal/event-pub-sub';
8
+ import { SlickFooterComponent } from '@slickgrid-universal/custom-footer-component';
9
+ import { SlickEmptyWarningComponent } from '@slickgrid-universal/empty-warning-component';
10
+ import { SlickPaginationComponent } from '@slickgrid-universal/pagination-component';
11
+ import { SlickgridReactInstance, GridOption } from '../models/index';
12
+ import { ReactUtilService, TranslaterService } from '../services/index';
13
+ import { Subscription } from 'rxjs';
14
+ import { SlickgridReactProps } from './slickgridReactProps';
15
+ interface State {
16
+ showPagination: boolean;
17
+ _gridOptions: GridOption;
18
+ paginationService: PaginationService;
19
+ }
20
+ export declare class SlickgridReact extends React.Component<SlickgridReactProps, State> {
21
+ readonly props: SlickgridReactProps;
22
+ protected _mounted: boolean;
23
+ protected setStateValue(key: string, value: any, callback?: () => void): void;
24
+ protected _columnDefinitions: Column[];
25
+ protected _currentDatasetLength: number;
26
+ protected _dataset: any[] | null;
27
+ protected _elm?: HTMLDivElement | null;
28
+ protected _eventHandler: SlickEventHandler;
29
+ protected _eventPubSubService: EventPubSubService;
30
+ protected _hideHeaderRowAfterPageLoad: boolean;
31
+ protected _isGridInitialized: boolean;
32
+ protected _isDatasetInitialized: boolean;
33
+ protected _isDatasetHierarchicalInitialized: boolean;
34
+ protected _isPaginationInitialized: boolean;
35
+ protected _isLocalGrid: boolean;
36
+ protected _paginationOptions: Pagination | undefined;
37
+ protected _registeredResources: ExternalResource[];
38
+ protected _gridOptions?: GridOption;
39
+ protected get gridOptions(): GridOption;
40
+ protected set gridOptions(options: GridOption);
41
+ groupItemMetadataProvider?: SlickGroupItemMetadataProvider;
42
+ backendServiceApi: BackendServiceApi | undefined;
43
+ locales: Locale;
44
+ metrics?: Metrics;
45
+ showPagination: boolean;
46
+ serviceList: any[];
47
+ subscriptions: Array<EventSubscription | Subscription>;
48
+ paginationData?: {
49
+ gridOptions: GridOption;
50
+ paginationService: PaginationService;
51
+ };
52
+ slickEmptyWarning: SlickEmptyWarningComponent | undefined;
53
+ slickFooter: SlickFooterComponent | undefined;
54
+ slickPagination: SlickPaginationComponent | undefined;
55
+ backendUtilityService: BackendUtilityService;
56
+ collectionService: CollectionService;
57
+ extensionService: ExtensionService;
58
+ extensionUtility: ExtensionUtility;
59
+ filterFactory: FilterFactory;
60
+ filterService: FilterService;
61
+ gridEventService: GridEventService;
62
+ gridService: GridService;
63
+ gridStateService: GridStateService;
64
+ groupingService: GroupingAndColspanService;
65
+ protected get paginationService(): PaginationService;
66
+ protected set paginationService(value: PaginationService);
67
+ resizerService: ResizerService;
68
+ rxjs?: RxJsFacade;
69
+ sharedService: SharedService;
70
+ sortService: SortService;
71
+ treeDataService: TreeDataService;
72
+ dataView: SlickDataView;
73
+ grid: SlickGrid;
74
+ totalItems: number;
75
+ extensions: ExtensionList<any>;
76
+ instances: SlickgridReactInstance | null;
77
+ static defaultProps: {
78
+ reactUtilService: ReactUtilService;
79
+ containerService: import("../services/container.service").ContainerService;
80
+ translaterService: TranslaterService;
81
+ dataset: never[];
82
+ gridId: string;
83
+ columnDefinitions: never[];
84
+ };
85
+ get dataset(): any[];
86
+ set dataset(newDataset: any[]);
87
+ get datasetHierarchical(): any[] | undefined;
88
+ set datasetHierarchical(newHierarchicalDataset: any[] | undefined);
89
+ constructor(props: SlickgridReactProps);
90
+ get eventHandler(): SlickEventHandler;
91
+ get isDatasetInitialized(): boolean;
92
+ set isDatasetInitialized(isInitialized: boolean);
93
+ set isDatasetHierarchicalInitialized(isInitialized: boolean);
94
+ get registeredResources(): ExternalResource[];
95
+ componentDidMount(): void;
96
+ initialization(eventHandler: SlickEventHandler): void;
97
+ componentWillUnmount(shouldEmptyDomElementContainer?: boolean): void;
98
+ emptyGridContainerElm(): void;
99
+ dispose(shouldEmptyDomElementContainer?: boolean): void;
100
+ componentDidUpdate(prevProps: SlickgridReactProps): void;
101
+ columnDefinitionsChanged(): void;
102
+ /**
103
+ * Commits the current edit to the grid
104
+ */
105
+ commitEdit(target: Element): void;
106
+ /**
107
+ * Define our internal Post Process callback, it will execute internally after we get back result from the Process backend call
108
+ * For now, this is GraphQL Service ONLY feature and it will basically
109
+ * refresh the Dataset & Pagination without having the user to create his own PostProcess every time
110
+ */
111
+ createBackendApiInternalPostProcessCallback(gridOptions: GridOption): void;
112
+ bindDifferentHooks(grid: SlickGrid, gridOptions: GridOption, dataView: SlickDataView): void;
113
+ bindBackendCallbackFunctions(gridOptions: GridOption): void;
114
+ bindResizeHook(grid: SlickGrid, options: GridOption): void;
115
+ executeAfterDataviewCreated(_grid: SlickGrid, gridOptions: GridOption): void;
116
+ /**
117
+ * On a Pagination changed, we will trigger a Grid State changed with the new pagination info
118
+ * Also if we use Row Selection or the Checkbox Selector with a Backend Service (Odata, GraphQL), we need to reset any selection
119
+ */
120
+ paginationChanged(pagination: ServicePagination): void;
121
+ paginationOptionsChanged(newPaginationOptions: Pagination): void;
122
+ /**
123
+ * When dataset changes, we need to refresh the entire grid UI & possibly resize it as well
124
+ * @param dataset
125
+ */
126
+ refreshGridData(dataset: any[], totalCount?: number): void;
127
+ /**
128
+ * Show the filter row displayed on first row, we can optionally pass false to hide it.
129
+ * @param showing
130
+ */
131
+ showHeaderRow(showing?: boolean): boolean;
132
+ /**
133
+ * Check if there's any Pagination Presets defined in the Grid Options,
134
+ * if there are then load them in the paginationOptions object
135
+ */
136
+ setPaginationOptionsWhenPresetDefined(gridOptions: GridOption, paginationOptions: Pagination): Pagination;
137
+ /**
138
+ * Dynamically change or update the column definitions list.
139
+ * We will re-render the grid so that the new header and data shows up correctly.
140
+ * If using i18n, we also need to trigger a re-translate of the column headers
141
+ */
142
+ updateColumnDefinitionsList(newColumnDefinitions: Column[]): void;
143
+ /**
144
+ * Loop through all column definitions and copy the original optional `width` properties optionally provided by the user.
145
+ * We will use this when doing a resize by cell content, if user provided a `width` it won't override it.
146
+ */
147
+ protected copyColumnWidthsReference(columnDefinitions: Column[]): void;
148
+ protected displayEmptyDataWarning(showWarning?: boolean): void;
149
+ /** When data changes in the DataView, we'll refresh the metrics and/or display a warning if the dataset is empty */
150
+ protected handleOnItemCountChanged(currentPageRowItemCount: number, totalItemCount: number): void;
151
+ /** Initialize the Pagination Service once */
152
+ protected initializePaginationService(paginationOptions: Pagination): void;
153
+ /**
154
+ * Render (or dispose) the Pagination Component, user can optionally provide False (to not show it) which will in term dispose of the Pagination,
155
+ * also while disposing we can choose to omit the disposable of the Pagination Service (if we are simply toggling the Pagination, we want to keep the Service alive)
156
+ * @param {Boolean} showPagination - show (new render) or not (dispose) the Pagination
157
+ * @param {Boolean} shouldDisposePaginationService - when disposing the Pagination, do we also want to dispose of the Pagination Service? (defaults to True)
158
+ */
159
+ protected renderPagination(showPagination?: boolean): void;
160
+ /** Load the Editor Collection asynchronously and replace the "collection" property when Promise resolves */
161
+ protected loadEditorCollectionAsync(column: Column): void;
162
+ protected insertDynamicPresetColumns(columnId: string, gridPresetColumns: Column[]): void;
163
+ /** Load any possible Columns Grid Presets */
164
+ protected loadColumnPresetsWhenDatasetInitialized(): void;
165
+ /** Load any possible Filters Grid Presets */
166
+ protected loadFilterPresetsWhenDatasetInitialized(): void;
167
+ /**
168
+ * local grid, check if we need to show the Pagination
169
+ * if so then also check if there's any presets and finally initialize the PaginationService
170
+ * a local grid with Pagination presets will potentially have a different total of items, we'll need to get it from the DataView and update our total
171
+ */
172
+ protected loadLocalGridPagination(dataset?: any[]): void;
173
+ /** Load any Row Selections into the DataView that were presets by the user */
174
+ protected loadRowSelectionPresetWhenExists(): void;
175
+ protected mergeGridOptions(gridOptions: GridOption): GridOption;
176
+ /** Pre-Register any Resource that don't require SlickGrid to be instantiated (for example RxJS Resource) */
177
+ protected preRegisterResources(): void;
178
+ protected registerResources(): void;
179
+ /** Register the RxJS Resource in all necessary services which uses */
180
+ protected registerRxJsResource(resource: RxJsFacade): void;
181
+ /**
182
+ * Takes a flat dataset with parent/child relationship, sort it (via its tree structure) and return the sorted flat array
183
+ * @param {Array<Object>} flatDatasetInput - flat dataset input
184
+ * @param {Boolean} forceGridRefresh - optionally force a full grid refresh
185
+ * @returns {Array<Object>} sort flat parent/child dataset
186
+ */
187
+ protected sortTreeDataset<T>(flatDatasetInput: T[], forceGridRefresh?: boolean): T[];
188
+ /**
189
+ * For convenience to the user, we provide the property "editor" as an Slickgrid-React editor complex object
190
+ * however "editor" is used internally by SlickGrid for it's own Editor Factory
191
+ * so in our lib we will swap "editor" and copy it into a new property called "internalColumnEditor"
192
+ * then take back "editor.model" and make it the new "editor" so that SlickGrid Editor Factory still works
193
+ */
194
+ protected swapInternalEditorToSlickGridFactoryEditor(columnDefinitions: Column[]): any[];
195
+ /** translate all columns (including hidden columns) */
196
+ protected translateColumnHeaderTitleKeys(): void;
197
+ /** translate all column groups (including hidden columns) */
198
+ protected translateColumnGroupKeys(): void;
199
+ /**
200
+ * Update the "internalColumnEditor.collection" property.
201
+ * Since this is called after the async call resolves, the pointer will not be the same as the "column" argument passed.
202
+ * Once we found the new pointer, we will reassign the "editor" and "collection" to the "internalColumnEditor" so it has newest collection
203
+ */
204
+ protected updateEditorCollection<T = any>(column: Column<T>, newCollection: T[]): void;
205
+ render(): React.JSX.Element;
206
+ }
207
+ export {};