@adaptabletools/adaptable-react-aggrid 23.0.4 → 23.0.5-canary.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.
- package/index.css +0 -64
- package/package.json +2 -2
- package/src/components/AdaptableProvider.js +1 -33
- package/src/components/AdaptableReact.js +0 -13
- package/src/index.js +0 -4
package/index.css
CHANGED
|
@@ -420,12 +420,6 @@
|
|
|
420
420
|
.twa\:mx-3 {
|
|
421
421
|
margin-inline: calc(var(--ab-base-space) * 3);
|
|
422
422
|
}
|
|
423
|
-
.twa\:mx-\[1px\] {
|
|
424
|
-
margin-inline: 1px;
|
|
425
|
-
}
|
|
426
|
-
.twa\:mx-\[px\] {
|
|
427
|
-
margin-inline: px;
|
|
428
|
-
}
|
|
429
423
|
.twa\:my-0 {
|
|
430
424
|
margin-block: 0;
|
|
431
425
|
}
|
|
@@ -444,9 +438,6 @@
|
|
|
444
438
|
.twa\:my-3 {
|
|
445
439
|
margin-block: calc(var(--ab-base-space) * 3);
|
|
446
440
|
}
|
|
447
|
-
.twa\:my-\[2px\] {
|
|
448
|
-
margin-block: 2px;
|
|
449
|
-
}
|
|
450
441
|
.twa\:\!mt-0 {
|
|
451
442
|
margin-top: 0 !important;
|
|
452
443
|
}
|
|
@@ -498,9 +489,6 @@
|
|
|
498
489
|
.twa\:mr-6 {
|
|
499
490
|
margin-right: calc(var(--ab-base-space) * 6);
|
|
500
491
|
}
|
|
501
|
-
.twa\:mr-\[2px\] {
|
|
502
|
-
margin-right: 2px;
|
|
503
|
-
}
|
|
504
492
|
.twa\:mb-0 {
|
|
505
493
|
margin-bottom: 0;
|
|
506
494
|
}
|
|
@@ -1161,9 +1149,6 @@
|
|
|
1161
1149
|
.twa\:min-w-\[min\(calc\(var\(--anchor-width\)\+--spacing\(7\)\)\,var\(--available-width\)\,80vw\)\] {
|
|
1162
1150
|
min-width: min(calc(var(--anchor-width) + calc(var(--ab-base-space) * 7)), var(--available-width), 80vw);
|
|
1163
1151
|
}
|
|
1164
|
-
.twa\:min-w-max {
|
|
1165
|
-
min-width: max-content;
|
|
1166
|
-
}
|
|
1167
1152
|
.twa\:flex-0 {
|
|
1168
1153
|
flex: 0;
|
|
1169
1154
|
}
|
|
@@ -1700,18 +1685,6 @@
|
|
|
1700
1685
|
.twa\:bg-accentlight {
|
|
1701
1686
|
background-color: var(--ab-color-accentlight);
|
|
1702
1687
|
}
|
|
1703
|
-
.twa\:bg-action-clone {
|
|
1704
|
-
background-color: var(--ab-color-action-clone);
|
|
1705
|
-
}
|
|
1706
|
-
.twa\:bg-action-delete {
|
|
1707
|
-
background-color: var(--ab-color-action-delete);
|
|
1708
|
-
}
|
|
1709
|
-
.twa\:bg-action-edit {
|
|
1710
|
-
background-color: var(--ab-color-action-edit);
|
|
1711
|
-
}
|
|
1712
|
-
.twa\:bg-action-share {
|
|
1713
|
-
background-color: var(--ab-color-action-share);
|
|
1714
|
-
}
|
|
1715
1688
|
.twa\:bg-background {
|
|
1716
1689
|
background-color: var(--ab-color-background);
|
|
1717
1690
|
}
|
|
@@ -1798,18 +1771,6 @@
|
|
|
1798
1771
|
.twa\:bg-clip-padding {
|
|
1799
1772
|
background-clip: padding-box;
|
|
1800
1773
|
}
|
|
1801
|
-
.twa\:fill-action-clone-foreground {
|
|
1802
|
-
fill: var(--ab-color-action-clone-foreground);
|
|
1803
|
-
}
|
|
1804
|
-
.twa\:fill-action-delete-foreground {
|
|
1805
|
-
fill: var(--ab-color-action-delete-foreground);
|
|
1806
|
-
}
|
|
1807
|
-
.twa\:fill-action-edit-foreground {
|
|
1808
|
-
fill: var(--ab-color-action-edit-foreground);
|
|
1809
|
-
}
|
|
1810
|
-
.twa\:fill-action-share-foreground {
|
|
1811
|
-
fill: var(--ab-color-action-share-foreground);
|
|
1812
|
-
}
|
|
1813
1774
|
.twa\:fill-current {
|
|
1814
1775
|
fill: currentcolor;
|
|
1815
1776
|
}
|
|
@@ -2144,18 +2105,6 @@
|
|
|
2144
2105
|
.twa\:text-accentlight {
|
|
2145
2106
|
color: var(--ab-color-accentlight);
|
|
2146
2107
|
}
|
|
2147
|
-
.twa\:text-action-clone-foreground {
|
|
2148
|
-
color: var(--ab-color-action-clone-foreground);
|
|
2149
|
-
}
|
|
2150
|
-
.twa\:text-action-delete-foreground {
|
|
2151
|
-
color: var(--ab-color-action-delete-foreground);
|
|
2152
|
-
}
|
|
2153
|
-
.twa\:text-action-edit-foreground {
|
|
2154
|
-
color: var(--ab-color-action-edit-foreground);
|
|
2155
|
-
}
|
|
2156
|
-
.twa\:text-action-share-foreground {
|
|
2157
|
-
color: var(--ab-color-action-share-foreground);
|
|
2158
|
-
}
|
|
2159
2108
|
.twa\:text-background {
|
|
2160
2109
|
color: var(--ab-color-background);
|
|
2161
2110
|
}
|
|
@@ -6532,15 +6481,6 @@
|
|
|
6532
6481
|
input.ab-Radio-input:checked:disabled::after {
|
|
6533
6482
|
background-color: #656565;
|
|
6534
6483
|
}
|
|
6535
|
-
.ab-Table td,.ab-Table th {
|
|
6536
|
-
padding: calc(var(--ab-base-space) * 2);
|
|
6537
|
-
}
|
|
6538
|
-
.ab-Table th {
|
|
6539
|
-
border-bottom: 2px solid var(--ab-color-primarydark);
|
|
6540
|
-
}
|
|
6541
|
-
.ab-Table tr:not(last-child) td {
|
|
6542
|
-
border-bottom: 1px solid var(--ab-color-primarylight);
|
|
6543
|
-
}
|
|
6544
6484
|
.ab-CheckBox,.ab-CheckBox *,.ab-CheckBox *:before,.ab-CheckBox *:after {
|
|
6545
6485
|
box-sizing: border-box;
|
|
6546
6486
|
}
|
|
@@ -6936,10 +6876,6 @@
|
|
|
6936
6876
|
.ab-FileDroppable,.ab-FileDroppable *,.ab-FileDroppable *:before,.ab-FileDroppable *:after {
|
|
6937
6877
|
box-sizing: border-box;
|
|
6938
6878
|
}
|
|
6939
|
-
.ab-WizardPanel > .ab-Panel__body {
|
|
6940
|
-
display: flex;
|
|
6941
|
-
flex-flow: column;
|
|
6942
|
-
}
|
|
6943
6879
|
.ab-Dashboard {
|
|
6944
6880
|
z-index: 1000;
|
|
6945
6881
|
user-select: none;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-react-aggrid",
|
|
3
|
-
"version": "23.0.
|
|
3
|
+
"version": "23.0.5-canary.1",
|
|
4
4
|
"description": "React version of AdapTable - the powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "contact sales@adaptabletools.com for details",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"tslib": "^2.8.1",
|
|
10
10
|
"react-redux": "9.2.0",
|
|
11
|
-
"@adaptabletools/adaptable": "23.0.
|
|
11
|
+
"@adaptabletools/adaptable": "23.0.5-canary.1"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"ag-grid-enterprise": ">=35.3.0",
|
|
@@ -10,7 +10,6 @@ const PLACEHOLDER_REDUX_STORE = {
|
|
|
10
10
|
getState: () => ({}),
|
|
11
11
|
subscribe: () => {
|
|
12
12
|
return () => {
|
|
13
|
-
/* noop unsubscribe */
|
|
14
13
|
};
|
|
15
14
|
},
|
|
16
15
|
dispatch: (a) => a,
|
|
@@ -22,7 +21,6 @@ var AdaptableAgGridStateTransitions;
|
|
|
22
21
|
AdaptableAgGridStateTransitions["INITIALIZE_AG_GRID"] = "INITIALIZE_AG_GRID";
|
|
23
22
|
})(AdaptableAgGridStateTransitions || (AdaptableAgGridStateTransitions = {}));
|
|
24
23
|
const agGridPropertySet = new Set(_GET_ALL_GRID_OPTIONS());
|
|
25
|
-
// -- ADAPTABLE PROVIDER -
|
|
26
24
|
const AdaptableAgGridContext = React.createContext(null);
|
|
27
25
|
export const useAdaptableAgGridContext = () => {
|
|
28
26
|
const context = React.useContext(AdaptableAgGridContext);
|
|
@@ -50,8 +48,6 @@ function usePromise() {
|
|
|
50
48
|
const AdaptableProvider = (props) => {
|
|
51
49
|
const [currentTransition, setCurrentTransition] = React.useState(AdaptableAgGridStateTransitions.AG_GRID_EMIT_PROPS);
|
|
52
50
|
const useIdResult = useId();
|
|
53
|
-
// Stable for the lifetime of this Provider — must not change when adaptableOptions
|
|
54
|
-
// is recreated on parent re-render (e.g. inline object literals in JSX).
|
|
55
51
|
const idRef = React.useRef(null);
|
|
56
52
|
if (idRef.current === null) {
|
|
57
53
|
idRef.current = `${props.adaptableOptions.adaptableId || 'adaptable'}-${useIdResult}`;
|
|
@@ -76,15 +72,8 @@ const AdaptableProvider = (props) => {
|
|
|
76
72
|
setCurrentTransition(AdaptableAgGridStateTransitions.INITIALIZE_AG_GRID);
|
|
77
73
|
return gridApiPromise;
|
|
78
74
|
}, [gridApiPromise]);
|
|
79
|
-
// this is a check to make sure the user is rendering Adaptable.AgGridReact inside Adaptable.Provider
|
|
80
|
-
// and not AgGridReact directly
|
|
81
|
-
// we're waiting 1s for this to happen
|
|
82
75
|
React.useEffect(() => {
|
|
83
76
|
const timeoutId = setTimeout(() => {
|
|
84
|
-
// this ref is updated in setAgridProps function in the context
|
|
85
|
-
// which is called by the Adaptable.AgGridReact component on mount
|
|
86
|
-
// so if this has not been updated, it means the user is not rendering Adaptable.AgGridReact
|
|
87
|
-
// so we show an error in the console and link to the docs
|
|
88
77
|
if (!adaptableAgGridReactRenderedRef.current) {
|
|
89
78
|
console.error('You are not rendering <Adaptable.AgGridReact /> inside <Adaptable.Provider />.');
|
|
90
79
|
console.error('You are probably rendering <AgGridReact /> directly. Please use <Adaptable.AgGridReact /> instead.');
|
|
@@ -111,17 +100,14 @@ const AdaptableProvider = (props) => {
|
|
|
111
100
|
setAgGridProps: (agGridProps) => {
|
|
112
101
|
adaptableAgGridReactRenderedRef.current = true;
|
|
113
102
|
setAgGridProps(agGridProps);
|
|
114
|
-
// get props and add the to gridOptions
|
|
115
103
|
const newGridOptions = {
|
|
116
104
|
...gridOptions,
|
|
117
105
|
...agGridProps,
|
|
118
106
|
};
|
|
119
|
-
// Check null or undefined
|
|
120
107
|
if (newGridOptions.reactiveCustomComponents == null) {
|
|
121
108
|
newGridOptions.reactiveCustomComponents = true;
|
|
122
109
|
}
|
|
123
110
|
setGridOptions(newGridOptions);
|
|
124
|
-
// Adaptable has everything it needs to initialize
|
|
125
111
|
setCurrentTransition(AdaptableAgGridStateTransitions.INITIALIZE_ADAPTABLE);
|
|
126
112
|
},
|
|
127
113
|
adaptableProps: {
|
|
@@ -131,15 +117,12 @@ const AdaptableProvider = (props) => {
|
|
|
131
117
|
}, children: _jsx(ReduxProvider, { store: adaptableApi?.internalApi.getAdaptableInstance()?.adaptableStore?.TheStore ??
|
|
132
118
|
PLACEHOLDER_REDUX_STORE, children: props.children }) }));
|
|
133
119
|
};
|
|
134
|
-
// -- ADAPTABLE UI WRAPPER -
|
|
135
120
|
const AdaptableUI = (props) => {
|
|
136
121
|
const { adaptableProps, modules, gridOptions, transition, onAdaptableReady } = useAdaptableAgGridContext();
|
|
137
122
|
if (transition === AdaptableAgGridStateTransitions.AG_GRID_EMIT_PROPS) {
|
|
138
123
|
return null;
|
|
139
124
|
}
|
|
140
|
-
return (_jsx(AdaptableReactComponent
|
|
141
|
-
// This needs to be first, so gridOptions is the one passed and not from props
|
|
142
|
-
, { ...adaptableProps, onAdaptableReady: onAdaptableReady, style: props.style, className: props.className, gridOptions: gridOptions, modules: modules }));
|
|
125
|
+
return (_jsx(AdaptableReactComponent, { ...adaptableProps, onAdaptableReady: onAdaptableReady, style: props.style, className: props.className, gridOptions: gridOptions, modules: modules }));
|
|
143
126
|
};
|
|
144
127
|
const readyAGGridAdaptableInstances = new Map();
|
|
145
128
|
const destroyCalledInstances = new Map();
|
|
@@ -181,7 +164,6 @@ const AdaptableAgGridReact = (props) => {
|
|
|
181
164
|
const agGridPassThroughProps = React.useMemo(() => {
|
|
182
165
|
return LIST_OF_PROPS_NOT_ON_GRID_OPTIONS.reduce((acc, key) => {
|
|
183
166
|
if (key in props) {
|
|
184
|
-
// @ts-ignore
|
|
185
167
|
acc[key] = props[key];
|
|
186
168
|
}
|
|
187
169
|
return acc;
|
|
@@ -191,7 +173,6 @@ const AdaptableAgGridReact = (props) => {
|
|
|
191
173
|
return null;
|
|
192
174
|
}
|
|
193
175
|
return (_jsx(AgGridReact, { ref: agGridRef, ...agGridPassThroughProps, modules: modules, onGridReady: (event) => {
|
|
194
|
-
// this is not called extra in strict mode
|
|
195
176
|
setAgGridApi(event.api);
|
|
196
177
|
if (props.onGridReady) {
|
|
197
178
|
props.onGridReady(event);
|
|
@@ -202,30 +183,17 @@ const AdaptableAgGridReact = (props) => {
|
|
|
202
183
|
setAgGridIsReady(true);
|
|
203
184
|
readyAGGridAdaptableInstances.set(id, true);
|
|
204
185
|
}, onGridPreDestroyed: () => {
|
|
205
|
-
// this is extra called in strict mode
|
|
206
|
-
// when doing the double render
|
|
207
|
-
// when we are in strict mode,
|
|
208
|
-
// if gridPreDestroyed is called the second time
|
|
209
|
-
// then we know it's a real destroy
|
|
210
186
|
if (destroyCalledInstances.get(id) === true) {
|
|
211
|
-
// so go ahead and reject the promise
|
|
212
187
|
gridApiPromiseReject('ag grid destroy');
|
|
213
188
|
destroyCalledInstances.delete(id);
|
|
214
189
|
return;
|
|
215
190
|
}
|
|
216
191
|
destroyCalledInstances.set(id, true);
|
|
217
192
|
if (readyAGGridAdaptableInstances.get(id) === true) {
|
|
218
|
-
// in strict mode, gridPreDestroyed is called extra on mount, before the onGridReady
|
|
219
|
-
// so if the instance is ready, we know it's a real destroy, not due to strict mode
|
|
220
|
-
// so we can reject the promise
|
|
221
193
|
readyAGGridAdaptableInstances.delete(id);
|
|
222
194
|
gridApiPromiseReject('ag grid destroy');
|
|
223
195
|
}
|
|
224
196
|
else {
|
|
225
|
-
// STILL, we might have an exception
|
|
226
|
-
// when strict mode is not enabled,
|
|
227
|
-
// then we really need to destroy the instance
|
|
228
|
-
// but we'll only do this if the instance is not in readyAGGridAdaptableInstances
|
|
229
197
|
setTimeout(() => {
|
|
230
198
|
if (!readyAGGridAdaptableInstances.get(id)) {
|
|
231
199
|
gridApiPromiseReject('ag grid destroy');
|
|
@@ -25,18 +25,6 @@ const AdaptableReact = ({ adaptableOptions, gridOptions, onAdaptableReady, ...pr
|
|
|
25
25
|
destroyAgGrid: false,
|
|
26
26
|
});
|
|
27
27
|
adaptableApiRef.current = null;
|
|
28
|
-
// We fully tore down a *ready* instance — i.e. a real unmount such as
|
|
29
|
-
// navigation or an HMR / Fast Refresh update (where the container is
|
|
30
|
-
// remounted but `id`, derived from `useId()`, stays the same). Clear the
|
|
31
|
-
// module-level guards so the instance is recreated when the container
|
|
32
|
-
// mounts again. Without this, `isInstanceStarted(id)` stays `true` and
|
|
33
|
-
// the destroyed instance is never replaced, leaving components holding a
|
|
34
|
-
// null api.
|
|
35
|
-
//
|
|
36
|
-
// In React StrictMode the transient unmount happens *before* the instance
|
|
37
|
-
// becomes ready, so `successInstances.get(id)` is not yet `true` and this
|
|
38
|
-
// branch is skipped — preserving the single in-flight init (no double
|
|
39
|
-
// initialization).
|
|
40
28
|
startedInstances.delete(id);
|
|
41
29
|
successInstances.delete(id);
|
|
42
30
|
}
|
|
@@ -69,7 +57,6 @@ const AdaptableReact = ({ adaptableOptions, gridOptions, onAdaptableReady, ...pr
|
|
|
69
57
|
})
|
|
70
58
|
.then((api) => {
|
|
71
59
|
adaptableApiRef.current = api;
|
|
72
|
-
//see #no_additional_react_root
|
|
73
60
|
setAdaptableJSXElement(api.internalApi.getAdaptableJSXElement());
|
|
74
61
|
if (onAdaptableReady) {
|
|
75
62
|
api.eventApi.on('AdaptableReady', onAdaptableReady);
|
package/src/index.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
// export { default } from './components/AdaptableReact';
|
|
2
1
|
import { AdaptableReactDateEditor, AdaptableReactNumberEditor, AdaptableReactPercentageEditor } from '@adaptabletools/adaptable';
|
|
3
2
|
export * from '@adaptabletools/adaptable';
|
|
4
|
-
// we want to shadow the `AdaptableNumberEditor`,
|
|
5
|
-
// `AdaptablePercentageEditor`, and `AdaptableDateEditor` from `@adaptabletools/adaptable`
|
|
6
|
-
// and pass the react variants for those editors
|
|
7
3
|
export const AdaptableNumberEditor = AdaptableReactNumberEditor;
|
|
8
4
|
export const AdaptablePercentageEditor = AdaptableReactPercentageEditor;
|
|
9
5
|
export const AdaptableDateEditor = AdaptableReactDateEditor;
|