variable-explorer 0.1.0__py3-none-any.whl

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 (49) hide show
  1. variable_explorer/__init__.py +7 -0
  2. variable_explorer/_version.py +4 -0
  3. variable_explorer/kernel/__init__.py +5 -0
  4. variable_explorer/kernel/comm_handler.py +255 -0
  5. variable_explorer/kernel/data_provider.py +235 -0
  6. variable_explorer/kernel/editor.py +88 -0
  7. variable_explorer/kernel/introspection.py +186 -0
  8. variable_explorer/kernel/serialization.py +73 -0
  9. variable_explorer/kernel/sorter.py +34 -0
  10. variable_explorer/kernel/statistics.py +101 -0
  11. variable_explorer/labextension/build_log.json +726 -0
  12. variable_explorer/labextension/package.json +96 -0
  13. variable_explorer/labextension/schemas/variable-explorer/package.json.orig +91 -0
  14. variable_explorer/labextension/schemas/variable-explorer/plugin.json +75 -0
  15. variable_explorer/labextension/static/lib_index_js.88a2cd3be0f2bf49f0eb.js +1417 -0
  16. variable_explorer/labextension/static/lib_index_js.88a2cd3be0f2bf49f0eb.js.map +1 -0
  17. variable_explorer/labextension/static/remoteEntry.a8ed3dcc7548f0b68f93.js +576 -0
  18. variable_explorer/labextension/static/remoteEntry.a8ed3dcc7548f0b68f93.js.map +1 -0
  19. variable_explorer/labextension/static/style.js +4 -0
  20. variable_explorer/labextension/static/style_index_js-data_font_woff2_charset_utf-8_base64_d09GMgABAAAAABmsAAsAAAAANbQAABlcAAEAAAAAA-5c9677.c69a59632d259bde8f84.js +785 -0
  21. variable_explorer/labextension/static/style_index_js-data_font_woff2_charset_utf-8_base64_d09GMgABAAAAABmsAAsAAAAANbQAABlcAAEAAAAAA-5c9677.c69a59632d259bde8f84.js.map +1 -0
  22. variable_explorer/labextension/static/vendors-node_modules_ag-grid-community_dist_package_main_esm_mjs.c38425b170e91e5db052.js +50347 -0
  23. variable_explorer/labextension/static/vendors-node_modules_ag-grid-community_dist_package_main_esm_mjs.c38425b170e91e5db052.js.map +1 -0
  24. variable_explorer/labextension/static/vendors-node_modules_ag-grid-community_styles_ag-grid_css-node_modules_ag-grid-community_styl-7d25f0.7424d30423d9f1c112f6.js +8124 -0
  25. variable_explorer/labextension/static/vendors-node_modules_ag-grid-community_styles_ag-grid_css-node_modules_ag-grid-community_styl-7d25f0.7424d30423d9f1c112f6.js.map +1 -0
  26. variable_explorer/labextension/static/vendors-node_modules_ag-grid-react_dist_package_index_esm_mjs.ca52d36c364e6562240a.js +2917 -0
  27. variable_explorer/labextension/static/vendors-node_modules_ag-grid-react_dist_package_index_esm_mjs.ca52d36c364e6562240a.js.map +1 -0
  28. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/build_log.json +726 -0
  29. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/install.json +5 -0
  30. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/package.json +96 -0
  31. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/schemas/variable-explorer/package.json.orig +91 -0
  32. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/schemas/variable-explorer/plugin.json +75 -0
  33. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/static/lib_index_js.88a2cd3be0f2bf49f0eb.js +1417 -0
  34. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/static/lib_index_js.88a2cd3be0f2bf49f0eb.js.map +1 -0
  35. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/static/remoteEntry.a8ed3dcc7548f0b68f93.js +576 -0
  36. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/static/remoteEntry.a8ed3dcc7548f0b68f93.js.map +1 -0
  37. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/static/style.js +4 -0
  38. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/static/style_index_js-data_font_woff2_charset_utf-8_base64_d09GMgABAAAAABmsAAsAAAAANbQAABlcAAEAAAAAA-5c9677.c69a59632d259bde8f84.js +785 -0
  39. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/static/style_index_js-data_font_woff2_charset_utf-8_base64_d09GMgABAAAAABmsAAsAAAAANbQAABlcAAEAAAAAA-5c9677.c69a59632d259bde8f84.js.map +1 -0
  40. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/static/vendors-node_modules_ag-grid-community_dist_package_main_esm_mjs.c38425b170e91e5db052.js +50347 -0
  41. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/static/vendors-node_modules_ag-grid-community_dist_package_main_esm_mjs.c38425b170e91e5db052.js.map +1 -0
  42. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/static/vendors-node_modules_ag-grid-community_styles_ag-grid_css-node_modules_ag-grid-community_styl-7d25f0.7424d30423d9f1c112f6.js +8124 -0
  43. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/static/vendors-node_modules_ag-grid-community_styles_ag-grid_css-node_modules_ag-grid-community_styl-7d25f0.7424d30423d9f1c112f6.js.map +1 -0
  44. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/static/vendors-node_modules_ag-grid-react_dist_package_index_esm_mjs.ca52d36c364e6562240a.js +2917 -0
  45. variable_explorer-0.1.0.data/data/share/jupyter/labextensions/variable-explorer/static/vendors-node_modules_ag-grid-react_dist_package_index_esm_mjs.ca52d36c364e6562240a.js.map +1 -0
  46. variable_explorer-0.1.0.dist-info/METADATA +80 -0
  47. variable_explorer-0.1.0.dist-info/RECORD +49 -0
  48. variable_explorer-0.1.0.dist-info/WHEEL +4 -0
  49. variable_explorer-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,2917 @@
1
+ "use strict";
2
+ (self["webpackChunkvariable_explorer"] = self["webpackChunkvariable_explorer"] || []).push([["vendors-node_modules_ag-grid-react_dist_package_index_esm_mjs"],{
3
+
4
+ /***/ "./node_modules/ag-grid-react/dist/package/index.esm.mjs"
5
+ /*!***************************************************************!*\
6
+ !*** ./node_modules/ag-grid-react/dist/package/index.esm.mjs ***!
7
+ \***************************************************************/
8
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9
+
10
+ __webpack_require__.r(__webpack_exports__);
11
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12
+ /* harmony export */ AgGridReact: () => (/* binding */ AgGridReact),
13
+ /* harmony export */ CustomComponentContext: () => (/* binding */ CustomContext),
14
+ /* harmony export */ getInstance: () => (/* binding */ getInstance),
15
+ /* harmony export */ useGridCellEditor: () => (/* binding */ useGridCellEditor),
16
+ /* harmony export */ useGridDate: () => (/* binding */ useGridDate),
17
+ /* harmony export */ useGridFilter: () => (/* binding */ useGridFilter),
18
+ /* harmony export */ useGridFloatingFilter: () => (/* binding */ useGridFloatingFilter),
19
+ /* harmony export */ useGridMenuItem: () => (/* binding */ useGridMenuItem),
20
+ /* harmony export */ warnReactiveCustomComponents: () => (/* binding */ warnReactiveCustomComponents)
21
+ /* harmony export */ });
22
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
23
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
24
+ /* harmony import */ var ag_grid_community__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ag-grid-community */ "webpack/sharing/consume/default/ag-grid-community/ag-grid-community");
25
+ /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "webpack/sharing/consume/default/react-dom");
26
+ /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
27
+ // packages/ag-grid-react/src/agGridReact.tsx
28
+
29
+
30
+ // packages/ag-grid-react/src/reactUi/agGridReactUi.tsx
31
+
32
+
33
+
34
+ // packages/ag-grid-react/src/reactUi/cellRenderer/groupCellRenderer.tsx
35
+
36
+
37
+
38
+ // packages/ag-grid-react/src/reactUi/beansContext.tsx
39
+
40
+ var BeansContext = react__WEBPACK_IMPORTED_MODULE_0___default().createContext({});
41
+
42
+ // packages/ag-grid-react/src/reactUi/jsComp.tsx
43
+ var showJsComp = (compDetails, context, eParent, ref) => {
44
+ const doNothing = !compDetails || compDetails.componentFromFramework || context.isDestroyed();
45
+ if (doNothing) {
46
+ return;
47
+ }
48
+ const promise = compDetails.newAgStackInstance();
49
+ if (promise == null) {
50
+ return;
51
+ }
52
+ let comp;
53
+ let compGui;
54
+ let destroyed = false;
55
+ promise.then((c) => {
56
+ if (destroyed) {
57
+ context.destroyBean(c);
58
+ return;
59
+ }
60
+ comp = c;
61
+ compGui = comp.getGui();
62
+ eParent.appendChild(compGui);
63
+ setRef(ref, comp);
64
+ });
65
+ return () => {
66
+ destroyed = true;
67
+ if (!comp) {
68
+ return;
69
+ }
70
+ compGui?.parentElement?.removeChild(compGui);
71
+ context.destroyBean(comp);
72
+ if (ref) {
73
+ setRef(ref, void 0);
74
+ }
75
+ };
76
+ };
77
+ var setRef = (ref, value) => {
78
+ if (!ref) {
79
+ return;
80
+ }
81
+ if (ref instanceof Function) {
82
+ const refCallback = ref;
83
+ refCallback(value);
84
+ } else {
85
+ const refObj = ref;
86
+ refObj.current = value;
87
+ }
88
+ };
89
+
90
+ // packages/ag-grid-react/src/reactUi/utils.tsx
91
+
92
+
93
+ var classesList = (...list) => {
94
+ const filtered = list.filter((s) => s != null && s !== "");
95
+ return filtered.join(" ");
96
+ };
97
+ var CssClasses = class _CssClasses {
98
+ constructor(...initialClasses) {
99
+ this.classesMap = {};
100
+ initialClasses.forEach((className) => {
101
+ this.classesMap[className] = true;
102
+ });
103
+ }
104
+ setClass(className, on) {
105
+ const nothingHasChanged = !!this.classesMap[className] == on;
106
+ if (nothingHasChanged) {
107
+ return this;
108
+ }
109
+ const res = new _CssClasses();
110
+ res.classesMap = { ...this.classesMap };
111
+ res.classesMap[className] = on;
112
+ return res;
113
+ }
114
+ toString() {
115
+ const res = Object.keys(this.classesMap).filter((key) => this.classesMap[key]).join(" ");
116
+ return res;
117
+ }
118
+ };
119
+ var isComponentStateless = (Component2) => {
120
+ const hasSymbol = () => typeof Symbol === "function" && Symbol.for;
121
+ const getMemoType = () => hasSymbol() ? Symbol.for("react.memo") : 60115;
122
+ return typeof Component2 === "function" && !(Component2.prototype && Component2.prototype.isReactComponent) || typeof Component2 === "object" && Component2.$$typeof === getMemoType();
123
+ };
124
+ var reactVersion = react__WEBPACK_IMPORTED_MODULE_0___default().version?.split(".")[0];
125
+ var isReactVersion17Minus = reactVersion === "16" || reactVersion === "17";
126
+ function isReact19() {
127
+ return reactVersion === "19";
128
+ }
129
+ var disableFlushSync = false;
130
+ function runWithoutFlushSync(func) {
131
+ if (!disableFlushSync) {
132
+ setTimeout(() => disableFlushSync = false, 0);
133
+ }
134
+ disableFlushSync = true;
135
+ return func();
136
+ }
137
+ var agFlushSync = (useFlushSync, fn) => {
138
+ if (!isReactVersion17Minus && useFlushSync && !disableFlushSync) {
139
+ react_dom__WEBPACK_IMPORTED_MODULE_2___default().flushSync(fn);
140
+ } else {
141
+ fn();
142
+ }
143
+ };
144
+ function getNextValueIfDifferent(prev, next, maintainOrder) {
145
+ if (next == null || prev == null) {
146
+ return next;
147
+ }
148
+ if (prev === next || next.length === 0 && prev.length === 0) {
149
+ return prev;
150
+ }
151
+ if (maintainOrder || prev.length === 0 && next.length > 0 || prev.length > 0 && next.length === 0) {
152
+ return next;
153
+ }
154
+ const oldValues = [];
155
+ const newValues = [];
156
+ const prevMap = /* @__PURE__ */ new Map();
157
+ const nextMap = /* @__PURE__ */ new Map();
158
+ for (let i = 0; i < next.length; i++) {
159
+ const c = next[i];
160
+ nextMap.set(c.instanceId, c);
161
+ }
162
+ for (let i = 0; i < prev.length; i++) {
163
+ const c = prev[i];
164
+ prevMap.set(c.instanceId, c);
165
+ if (nextMap.has(c.instanceId)) {
166
+ oldValues.push(c);
167
+ }
168
+ }
169
+ for (let i = 0; i < next.length; i++) {
170
+ const c = next[i];
171
+ const instanceId = c.instanceId;
172
+ if (!prevMap.has(instanceId)) {
173
+ newValues.push(c);
174
+ }
175
+ }
176
+ if (oldValues.length === prev.length && newValues.length === 0) {
177
+ return prev;
178
+ }
179
+ if (oldValues.length === 0 && newValues.length === next.length) {
180
+ return next;
181
+ }
182
+ if (oldValues.length === 0) {
183
+ return newValues;
184
+ }
185
+ if (newValues.length === 0) {
186
+ return oldValues;
187
+ }
188
+ return [...oldValues, ...newValues];
189
+ }
190
+
191
+ // packages/ag-grid-react/src/reactUi/cellRenderer/groupCellRenderer.tsx
192
+ var GroupCellRenderer = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((props, ref) => {
193
+ const { ctrlsFactory, context } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BeansContext);
194
+ const eGui = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
195
+ const eValueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
196
+ const eCheckboxRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
197
+ const eExpandedRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
198
+ const eContractedRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
199
+ const ctrlRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
200
+ const [innerCompDetails, setInnerCompDetails] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
201
+ const [childCount, setChildCount] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
202
+ const [value, setValue] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
203
+ const [cssClasses, setCssClasses] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => new CssClasses());
204
+ const [expandedCssClasses, setExpandedCssClasses] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => new CssClasses("ag-hidden"));
205
+ const [contractedCssClasses, setContractedCssClasses] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => new CssClasses("ag-hidden"));
206
+ const [checkboxCssClasses, setCheckboxCssClasses] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => new CssClasses("ag-invisible"));
207
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(ref, () => {
208
+ return {
209
+ // force new instance when grid tries to refresh
210
+ refresh() {
211
+ return false;
212
+ }
213
+ };
214
+ });
215
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(() => {
216
+ return showJsComp(innerCompDetails, context, eValueRef.current);
217
+ }, [innerCompDetails]);
218
+ const setRef2 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((eRef) => {
219
+ eGui.current = eRef;
220
+ if (!eRef) {
221
+ ctrlRef.current = context.destroyBean(ctrlRef.current);
222
+ return;
223
+ }
224
+ const compProxy = {
225
+ setInnerRenderer: (details, valueToDisplay) => {
226
+ setInnerCompDetails(details);
227
+ setValue(valueToDisplay);
228
+ },
229
+ setChildCount: (count) => setChildCount(count),
230
+ addOrRemoveCssClass: (name, on) => setCssClasses((prev) => prev.setClass(name, on)),
231
+ setContractedDisplayed: (displayed) => setContractedCssClasses((prev) => prev.setClass("ag-hidden", !displayed)),
232
+ setExpandedDisplayed: (displayed) => setExpandedCssClasses((prev) => prev.setClass("ag-hidden", !displayed)),
233
+ setCheckboxVisible: (visible) => setCheckboxCssClasses((prev) => prev.setClass("ag-invisible", !visible))
234
+ };
235
+ const groupCellRendererCtrl = ctrlsFactory.getInstance("groupCellRendererCtrl");
236
+ if (groupCellRendererCtrl) {
237
+ ctrlRef.current = context.createBean(groupCellRendererCtrl);
238
+ ctrlRef.current.init(
239
+ compProxy,
240
+ eRef,
241
+ eCheckboxRef.current,
242
+ eExpandedRef.current,
243
+ eContractedRef.current,
244
+ GroupCellRenderer,
245
+ props
246
+ );
247
+ }
248
+ }, []);
249
+ const className = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => `ag-cell-wrapper ${cssClasses.toString()}`, [cssClasses]);
250
+ const expandedClassName = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => `ag-group-expanded ${expandedCssClasses.toString()}`, [expandedCssClasses]);
251
+ const contractedClassName = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(
252
+ () => `ag-group-contracted ${contractedCssClasses.toString()}`,
253
+ [contractedCssClasses]
254
+ );
255
+ const checkboxClassName = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => `ag-group-checkbox ${checkboxCssClasses.toString()}`, [checkboxCssClasses]);
256
+ const useFwRenderer = innerCompDetails && innerCompDetails.componentFromFramework;
257
+ const FwRenderer = useFwRenderer ? innerCompDetails.componentClass : void 0;
258
+ const useValue = innerCompDetails == null && value != null;
259
+ const escapedValue = (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._escapeString)(value, true);
260
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
261
+ "span",
262
+ {
263
+ className,
264
+ ref: setRef2,
265
+ ...!props.colDef ? { role: ctrlRef.current?.getCellAriaRole() } : {}
266
+ },
267
+ /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: expandedClassName, ref: eExpandedRef }),
268
+ /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: contractedClassName, ref: eContractedRef }),
269
+ /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: checkboxClassName, ref: eCheckboxRef }),
270
+ /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "ag-group-value", ref: eValueRef }, useValue && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, escapedValue), useFwRenderer && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(FwRenderer, { ...innerCompDetails.params })),
271
+ /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "ag-group-child-count" }, childCount)
272
+ );
273
+ });
274
+ var groupCellRenderer_default = GroupCellRenderer;
275
+
276
+ // packages/ag-grid-react/src/shared/customComp/customComponentWrapper.ts
277
+
278
+
279
+ // packages/ag-grid-react/src/reactUi/customComp/customWrapperComp.tsx
280
+
281
+
282
+ // packages/ag-grid-react/src/shared/customComp/customContext.ts
283
+
284
+ var CustomContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({
285
+ setMethods: () => {
286
+ }
287
+ });
288
+
289
+ // packages/ag-grid-react/src/reactUi/customComp/customWrapperComp.tsx
290
+ var CustomWrapperComp = (params) => {
291
+ const { initialProps, addUpdateCallback, CustomComponentClass, setMethods } = params;
292
+ const [{ key, ...props }, setProps] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(initialProps);
293
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
294
+ addUpdateCallback((newProps) => setProps(newProps));
295
+ }, []);
296
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CustomContext.Provider, { value: { setMethods } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CustomComponentClass, { key, ...props }));
297
+ };
298
+ var customWrapperComp_default = (0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(CustomWrapperComp);
299
+
300
+ // packages/ag-grid-react/src/shared/reactComponent.ts
301
+
302
+
303
+
304
+
305
+ // packages/ag-grid-react/src/shared/keyGenerator.ts
306
+ var counter = 0;
307
+ function generateNewKey() {
308
+ return `agPortalKey_${++counter}`;
309
+ }
310
+
311
+ // packages/ag-grid-react/src/shared/reactComponent.ts
312
+ var ReactComponent = class {
313
+ constructor(reactComponent, portalManager, componentType, suppressFallbackMethods) {
314
+ this.portal = null;
315
+ this.oldPortal = null;
316
+ this.reactComponent = reactComponent;
317
+ this.portalManager = portalManager;
318
+ this.componentType = componentType;
319
+ this.suppressFallbackMethods = !!suppressFallbackMethods;
320
+ this.statelessComponent = this.isStateless(this.reactComponent);
321
+ this.key = generateNewKey();
322
+ this.portalKey = generateNewKey();
323
+ this.instanceCreated = this.isStatelessComponent() ? ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.AgPromise.resolve(false) : new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.AgPromise((resolve) => {
324
+ this.resolveInstanceCreated = resolve;
325
+ });
326
+ }
327
+ getGui() {
328
+ return this.eParentElement;
329
+ }
330
+ /** `getGui()` returns the parent element. This returns the actual root element. */
331
+ getRootElement() {
332
+ const firstChild = this.eParentElement.firstChild;
333
+ return firstChild;
334
+ }
335
+ destroy() {
336
+ if (this.componentInstance && typeof this.componentInstance.destroy == "function") {
337
+ this.componentInstance.destroy();
338
+ }
339
+ const portal = this.portal;
340
+ if (portal) {
341
+ this.portalManager.destroyPortal(portal);
342
+ }
343
+ }
344
+ createParentElement(params) {
345
+ const componentWrappingElement = this.portalManager.getComponentWrappingElement();
346
+ const eParentElement = document.createElement(componentWrappingElement || "div");
347
+ eParentElement.classList.add("ag-react-container");
348
+ params.reactContainer = eParentElement;
349
+ return eParentElement;
350
+ }
351
+ addParentContainerStyleAndClasses() {
352
+ if (!this.componentInstance) {
353
+ return;
354
+ }
355
+ if (this.componentInstance.getReactContainerStyle && this.componentInstance.getReactContainerStyle()) {
356
+ (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._warnOnce)(
357
+ 'Since v31.1 "getReactContainerStyle" is deprecated. Apply styling directly to ".ag-react-container" if needed.'
358
+ );
359
+ Object.assign(this.eParentElement.style, this.componentInstance.getReactContainerStyle());
360
+ }
361
+ if (this.componentInstance.getReactContainerClasses && this.componentInstance.getReactContainerClasses()) {
362
+ (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._warnOnce)(
363
+ 'Since v31.1 "getReactContainerClasses" is deprecated. Apply styling directly to ".ag-react-container" if needed.'
364
+ );
365
+ const parentContainerClasses = this.componentInstance.getReactContainerClasses();
366
+ parentContainerClasses.forEach((className) => this.eParentElement.classList.add(className));
367
+ }
368
+ }
369
+ statelessComponentRendered() {
370
+ return this.eParentElement.childElementCount > 0 || this.eParentElement.childNodes.length > 0;
371
+ }
372
+ getFrameworkComponentInstance() {
373
+ return this.componentInstance;
374
+ }
375
+ isStatelessComponent() {
376
+ return this.statelessComponent;
377
+ }
378
+ getReactComponentName() {
379
+ return this.reactComponent.name;
380
+ }
381
+ getMemoType() {
382
+ return this.hasSymbol() ? Symbol.for("react.memo") : 60115;
383
+ }
384
+ hasSymbol() {
385
+ return typeof Symbol === "function" && Symbol.for;
386
+ }
387
+ isStateless(Component2) {
388
+ return typeof Component2 === "function" && !(Component2.prototype && Component2.prototype.isReactComponent) || typeof Component2 === "object" && Component2.$$typeof === this.getMemoType();
389
+ }
390
+ hasMethod(name) {
391
+ const frameworkComponentInstance = this.getFrameworkComponentInstance();
392
+ return !!frameworkComponentInstance && frameworkComponentInstance[name] != null || this.fallbackMethodAvailable(name);
393
+ }
394
+ callMethod(name, args) {
395
+ const frameworkComponentInstance = this.getFrameworkComponentInstance();
396
+ if (this.isStatelessComponent()) {
397
+ return this.fallbackMethod(name, !!args && args[0] ? args[0] : {});
398
+ } else if (!frameworkComponentInstance) {
399
+ setTimeout(() => this.callMethod(name, args));
400
+ return;
401
+ }
402
+ const method = frameworkComponentInstance[name];
403
+ if (method) {
404
+ return method.apply(frameworkComponentInstance, args);
405
+ }
406
+ if (this.fallbackMethodAvailable(name)) {
407
+ return this.fallbackMethod(name, !!args && args[0] ? args[0] : {});
408
+ }
409
+ }
410
+ addMethod(name, callback) {
411
+ this[name] = callback;
412
+ }
413
+ init(params) {
414
+ this.eParentElement = this.createParentElement(params);
415
+ this.createOrUpdatePortal(params);
416
+ return new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.AgPromise((resolve) => this.createReactComponent(resolve));
417
+ }
418
+ createOrUpdatePortal(params) {
419
+ if (!this.isStatelessComponent()) {
420
+ this.ref = (element) => {
421
+ this.componentInstance = element;
422
+ this.addParentContainerStyleAndClasses();
423
+ this.resolveInstanceCreated?.(true);
424
+ this.resolveInstanceCreated = void 0;
425
+ };
426
+ params.ref = this.ref;
427
+ }
428
+ this.reactElement = this.createElement(this.reactComponent, { ...params, key: this.key });
429
+ this.portal = (0,react_dom__WEBPACK_IMPORTED_MODULE_2__.createPortal)(
430
+ this.reactElement,
431
+ this.eParentElement,
432
+ this.portalKey
433
+ // fixed deltaRowModeRefreshCompRenderer
434
+ );
435
+ }
436
+ createElement(reactComponent, props) {
437
+ return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(reactComponent, props);
438
+ }
439
+ createReactComponent(resolve) {
440
+ this.portalManager.mountReactPortal(this.portal, this, resolve);
441
+ }
442
+ rendered() {
443
+ return this.isStatelessComponent() && this.statelessComponentRendered() || !!(!this.isStatelessComponent() && this.getFrameworkComponentInstance());
444
+ }
445
+ /*
446
+ * fallback methods - these will be invoked if a corresponding instance method is not present
447
+ * for example if refresh is called and is not available on the component instance, then refreshComponent on this
448
+ * class will be invoked instead
449
+ *
450
+ * Currently only refresh is supported
451
+ */
452
+ refreshComponent(args) {
453
+ this.oldPortal = this.portal;
454
+ this.createOrUpdatePortal(args);
455
+ this.portalManager.updateReactPortal(this.oldPortal, this.portal);
456
+ }
457
+ fallbackMethod(name, params) {
458
+ const method = this[`${name}Component`];
459
+ if (!this.suppressFallbackMethods && !!method) {
460
+ return method.bind(this)(params);
461
+ }
462
+ }
463
+ fallbackMethodAvailable(name) {
464
+ if (this.suppressFallbackMethods) {
465
+ return false;
466
+ }
467
+ const method = this[`${name}Component`];
468
+ return !!method;
469
+ }
470
+ };
471
+
472
+ // packages/ag-grid-react/src/shared/customComp/customComponentWrapper.ts
473
+ function addOptionalMethods(optionalMethodNames, providedMethods, component) {
474
+ optionalMethodNames.forEach((methodName) => {
475
+ const providedMethod = providedMethods[methodName];
476
+ if (providedMethod) {
477
+ component[methodName] = providedMethod;
478
+ }
479
+ });
480
+ }
481
+ var CustomComponentWrapper = class extends ReactComponent {
482
+ constructor() {
483
+ super(...arguments);
484
+ this.awaitUpdateCallback = new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.AgPromise((resolve) => {
485
+ this.resolveUpdateCallback = resolve;
486
+ });
487
+ this.wrapperComponent = customWrapperComp_default;
488
+ }
489
+ init(params) {
490
+ this.sourceParams = params;
491
+ return super.init(this.getProps());
492
+ }
493
+ addMethod() {
494
+ }
495
+ getInstance() {
496
+ return this.instanceCreated.then(() => this.componentInstance);
497
+ }
498
+ getFrameworkComponentInstance() {
499
+ return this;
500
+ }
501
+ createElement(reactComponent, props) {
502
+ return super.createElement(this.wrapperComponent, {
503
+ initialProps: props,
504
+ CustomComponentClass: reactComponent,
505
+ setMethods: (methods) => this.setMethods(methods),
506
+ addUpdateCallback: (callback) => {
507
+ this.updateCallback = () => {
508
+ callback(this.getProps());
509
+ return new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.AgPromise((resolve) => {
510
+ setTimeout(() => {
511
+ resolve();
512
+ });
513
+ });
514
+ };
515
+ this.resolveUpdateCallback();
516
+ }
517
+ });
518
+ }
519
+ setMethods(methods) {
520
+ this.providedMethods = methods;
521
+ addOptionalMethods(this.getOptionalMethods(), this.providedMethods, this);
522
+ }
523
+ getOptionalMethods() {
524
+ return [];
525
+ }
526
+ getProps() {
527
+ return {
528
+ ...this.sourceParams,
529
+ key: this.key,
530
+ ref: this.ref
531
+ };
532
+ }
533
+ refreshProps() {
534
+ if (this.updateCallback) {
535
+ return this.updateCallback();
536
+ }
537
+ return new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.AgPromise(
538
+ (resolve) => this.awaitUpdateCallback.then(() => {
539
+ this.updateCallback().then(() => resolve());
540
+ })
541
+ );
542
+ }
543
+ };
544
+
545
+ // packages/ag-grid-react/src/shared/customComp/cellRendererComponentWrapper.ts
546
+ var CellRendererComponentWrapper = class extends CustomComponentWrapper {
547
+ refresh(params) {
548
+ this.sourceParams = params;
549
+ this.refreshProps();
550
+ return true;
551
+ }
552
+ };
553
+
554
+ // packages/ag-grid-react/src/shared/customComp/dateComponentWrapper.ts
555
+ var DateComponentWrapper = class extends CustomComponentWrapper {
556
+ constructor() {
557
+ super(...arguments);
558
+ this.date = null;
559
+ this.onDateChange = (date) => this.updateDate(date);
560
+ }
561
+ getDate() {
562
+ return this.date;
563
+ }
564
+ setDate(date) {
565
+ this.date = date;
566
+ this.refreshProps();
567
+ }
568
+ refresh(params) {
569
+ this.sourceParams = params;
570
+ this.refreshProps();
571
+ }
572
+ getOptionalMethods() {
573
+ return ["afterGuiAttached", "setInputPlaceholder", "setInputAriaLabel", "setDisabled"];
574
+ }
575
+ updateDate(date) {
576
+ this.setDate(date);
577
+ this.sourceParams.onDateChanged();
578
+ }
579
+ getProps() {
580
+ const props = super.getProps();
581
+ props.date = this.date;
582
+ props.onDateChange = this.onDateChange;
583
+ delete props.onDateChanged;
584
+ return props;
585
+ }
586
+ };
587
+
588
+ // packages/ag-grid-react/src/shared/customComp/dragAndDropImageComponentWrapper.ts
589
+ var DragAndDropImageComponentWrapper = class extends CustomComponentWrapper {
590
+ constructor() {
591
+ super(...arguments);
592
+ this.label = "";
593
+ this.icon = null;
594
+ this.shake = false;
595
+ }
596
+ setIcon(iconName, shake) {
597
+ this.icon = iconName;
598
+ this.shake = shake;
599
+ this.refreshProps();
600
+ }
601
+ setLabel(label) {
602
+ this.label = label;
603
+ this.refreshProps();
604
+ }
605
+ getProps() {
606
+ const props = super.getProps();
607
+ const { label, icon, shake } = this;
608
+ props.label = label;
609
+ props.icon = icon;
610
+ props.shake = shake;
611
+ return props;
612
+ }
613
+ };
614
+
615
+ // packages/ag-grid-react/src/shared/customComp/filterComponentWrapper.ts
616
+ var FilterComponentWrapper = class extends CustomComponentWrapper {
617
+ constructor() {
618
+ super(...arguments);
619
+ this.model = null;
620
+ this.onModelChange = (model) => this.updateModel(model);
621
+ this.onUiChange = () => this.sourceParams.filterChangedCallback();
622
+ this.expectingNewMethods = true;
623
+ this.hasBeenActive = false;
624
+ }
625
+ isFilterActive() {
626
+ return this.model != null;
627
+ }
628
+ doesFilterPass(params) {
629
+ return this.providedMethods.doesFilterPass(params);
630
+ }
631
+ getModel() {
632
+ return this.model;
633
+ }
634
+ setModel(model) {
635
+ this.expectingNewMethods = true;
636
+ this.model = model;
637
+ this.hasBeenActive || (this.hasBeenActive = this.isFilterActive());
638
+ return this.refreshProps();
639
+ }
640
+ refresh(newParams) {
641
+ this.sourceParams = newParams;
642
+ this.refreshProps();
643
+ return true;
644
+ }
645
+ getOptionalMethods() {
646
+ return ["afterGuiAttached", "afterGuiDetached", "onNewRowsLoaded", "getModelAsString", "onAnyFilterChanged"];
647
+ }
648
+ setMethods(methods) {
649
+ if (this.expectingNewMethods === false && this.hasBeenActive && this.providedMethods?.doesFilterPass !== methods?.doesFilterPass) {
650
+ setTimeout(() => {
651
+ this.sourceParams.filterChangedCallback();
652
+ });
653
+ }
654
+ this.expectingNewMethods = false;
655
+ super.setMethods(methods);
656
+ }
657
+ updateModel(model) {
658
+ this.setModel(model).then(() => this.sourceParams.filterChangedCallback());
659
+ }
660
+ getProps() {
661
+ const props = super.getProps();
662
+ props.model = this.model;
663
+ props.onModelChange = this.onModelChange;
664
+ props.onUiChange = this.onUiChange;
665
+ delete props.filterChangedCallback;
666
+ delete props.filterModifiedCallback;
667
+ delete props.valueGetter;
668
+ return props;
669
+ }
670
+ };
671
+
672
+ // packages/ag-grid-react/src/shared/customComp/floatingFilterComponentProxy.ts
673
+
674
+ function updateFloatingFilterParent(params, model) {
675
+ params.parentFilterInstance((instance) => {
676
+ (instance.setModel(model) || ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.AgPromise.resolve()).then(() => {
677
+ params.filterParams.filterChangedCallback();
678
+ });
679
+ });
680
+ }
681
+ var FloatingFilterComponentProxy = class {
682
+ constructor(floatingFilterParams, refreshProps) {
683
+ this.floatingFilterParams = floatingFilterParams;
684
+ this.refreshProps = refreshProps;
685
+ this.model = null;
686
+ this.onModelChange = (model) => this.updateModel(model);
687
+ }
688
+ getProps() {
689
+ return {
690
+ ...this.floatingFilterParams,
691
+ model: this.model,
692
+ onModelChange: this.onModelChange
693
+ };
694
+ }
695
+ onParentModelChanged(parentModel) {
696
+ this.model = parentModel;
697
+ this.refreshProps();
698
+ }
699
+ refresh(params) {
700
+ this.floatingFilterParams = params;
701
+ this.refreshProps();
702
+ }
703
+ setMethods(methods) {
704
+ addOptionalMethods(this.getOptionalMethods(), methods, this);
705
+ }
706
+ getOptionalMethods() {
707
+ return ["afterGuiAttached"];
708
+ }
709
+ updateModel(model) {
710
+ this.model = model;
711
+ this.refreshProps();
712
+ updateFloatingFilterParent(this.floatingFilterParams, model);
713
+ }
714
+ };
715
+
716
+ // packages/ag-grid-react/src/shared/customComp/floatingFilterComponentWrapper.ts
717
+ var FloatingFilterComponentWrapper = class extends CustomComponentWrapper {
718
+ constructor() {
719
+ super(...arguments);
720
+ this.model = null;
721
+ this.onModelChange = (model) => this.updateModel(model);
722
+ }
723
+ onParentModelChanged(parentModel) {
724
+ this.model = parentModel;
725
+ this.refreshProps();
726
+ }
727
+ refresh(newParams) {
728
+ this.sourceParams = newParams;
729
+ this.refreshProps();
730
+ }
731
+ getOptionalMethods() {
732
+ return ["afterGuiAttached"];
733
+ }
734
+ updateModel(model) {
735
+ this.model = model;
736
+ this.refreshProps();
737
+ updateFloatingFilterParent(this.sourceParams, model);
738
+ }
739
+ getProps() {
740
+ const props = super.getProps();
741
+ props.model = this.model;
742
+ props.onModelChange = this.onModelChange;
743
+ return props;
744
+ }
745
+ };
746
+
747
+ // packages/ag-grid-react/src/shared/customComp/loadingOverlayComponentWrapper.ts
748
+ var LoadingOverlayComponentWrapper = class extends CustomComponentWrapper {
749
+ refresh(params) {
750
+ this.sourceParams = params;
751
+ this.refreshProps();
752
+ }
753
+ };
754
+
755
+ // packages/ag-grid-react/src/shared/customComp/menuItemComponentWrapper.ts
756
+ var MenuItemComponentWrapper = class extends CustomComponentWrapper {
757
+ constructor() {
758
+ super(...arguments);
759
+ this.active = false;
760
+ this.expanded = false;
761
+ this.onActiveChange = (active) => this.updateActive(active);
762
+ }
763
+ setActive(active) {
764
+ this.awaitSetActive(active);
765
+ }
766
+ setExpanded(expanded) {
767
+ this.expanded = expanded;
768
+ this.refreshProps();
769
+ }
770
+ getOptionalMethods() {
771
+ return ["select", "configureDefaults"];
772
+ }
773
+ awaitSetActive(active) {
774
+ this.active = active;
775
+ return this.refreshProps();
776
+ }
777
+ updateActive(active) {
778
+ const result = this.awaitSetActive(active);
779
+ if (active) {
780
+ result.then(() => this.sourceParams.onItemActivated());
781
+ }
782
+ }
783
+ getProps() {
784
+ const props = super.getProps();
785
+ props.active = this.active;
786
+ props.expanded = this.expanded;
787
+ props.onActiveChange = this.onActiveChange;
788
+ delete props.onItemActivated;
789
+ return props;
790
+ }
791
+ };
792
+
793
+ // packages/ag-grid-react/src/shared/customComp/noRowsOverlayComponentWrapper.ts
794
+ var NoRowsOverlayComponentWrapper = class extends CustomComponentWrapper {
795
+ refresh(params) {
796
+ this.sourceParams = params;
797
+ this.refreshProps();
798
+ }
799
+ };
800
+
801
+ // packages/ag-grid-react/src/shared/customComp/statusPanelComponentWrapper.ts
802
+ var StatusPanelComponentWrapper = class extends CustomComponentWrapper {
803
+ refresh(params) {
804
+ this.sourceParams = params;
805
+ this.refreshProps();
806
+ return true;
807
+ }
808
+ };
809
+
810
+ // packages/ag-grid-react/src/shared/customComp/toolPanelComponentWrapper.ts
811
+ var ToolPanelComponentWrapper = class extends CustomComponentWrapper {
812
+ constructor() {
813
+ super(...arguments);
814
+ this.onStateChange = (state) => this.updateState(state);
815
+ }
816
+ refresh(params) {
817
+ this.sourceParams = params;
818
+ this.refreshProps();
819
+ return true;
820
+ }
821
+ getState() {
822
+ return this.state;
823
+ }
824
+ updateState(state) {
825
+ this.state = state;
826
+ this.refreshProps();
827
+ this.sourceParams.onStateUpdated();
828
+ }
829
+ getProps() {
830
+ const props = super.getProps();
831
+ props.state = this.state;
832
+ props.onStateChange = this.onStateChange;
833
+ return props;
834
+ }
835
+ };
836
+
837
+ // packages/ag-grid-react/src/shared/customComp/util.ts
838
+
839
+ function getInstance(wrapperComponent, callback) {
840
+ const promise = wrapperComponent?.getInstance?.() ?? ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.AgPromise.resolve(void 0);
841
+ promise.then((comp) => callback(comp));
842
+ }
843
+ function warnReactiveCustomComponents() {
844
+ (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._warnOnce)("As of v32, using custom components with `reactiveCustomComponents = false` is deprecated.");
845
+ }
846
+
847
+ // packages/ag-grid-react/src/shared/portalManager.ts
848
+ var MAX_COMPONENT_CREATION_TIME_IN_MS = 1e3;
849
+ var PortalManager = class {
850
+ constructor(refresher, wrappingElement, maxComponentCreationTimeMs) {
851
+ this.destroyed = false;
852
+ this.portals = [];
853
+ this.hasPendingPortalUpdate = false;
854
+ this.wrappingElement = wrappingElement ? wrappingElement : "div";
855
+ this.refresher = refresher;
856
+ this.maxComponentCreationTimeMs = maxComponentCreationTimeMs ? maxComponentCreationTimeMs : MAX_COMPONENT_CREATION_TIME_IN_MS;
857
+ }
858
+ getPortals() {
859
+ return this.portals;
860
+ }
861
+ destroy() {
862
+ this.destroyed = true;
863
+ }
864
+ destroyPortal(portal) {
865
+ this.portals = this.portals.filter((curPortal) => curPortal !== portal);
866
+ this.batchUpdate();
867
+ }
868
+ getComponentWrappingElement() {
869
+ return this.wrappingElement;
870
+ }
871
+ mountReactPortal(portal, reactComponent, resolve) {
872
+ this.portals = [...this.portals, portal];
873
+ this.waitForInstance(reactComponent, resolve);
874
+ this.batchUpdate();
875
+ }
876
+ updateReactPortal(oldPortal, newPortal) {
877
+ this.portals[this.portals.indexOf(oldPortal)] = newPortal;
878
+ this.batchUpdate();
879
+ }
880
+ batchUpdate() {
881
+ if (this.hasPendingPortalUpdate) {
882
+ return;
883
+ }
884
+ setTimeout(() => {
885
+ if (!this.destroyed) {
886
+ this.refresher();
887
+ this.hasPendingPortalUpdate = false;
888
+ }
889
+ });
890
+ this.hasPendingPortalUpdate = true;
891
+ }
892
+ waitForInstance(reactComponent, resolve, startTime = Date.now()) {
893
+ if (this.destroyed) {
894
+ resolve(null);
895
+ return;
896
+ }
897
+ if (reactComponent.rendered()) {
898
+ resolve(reactComponent);
899
+ } else {
900
+ if (Date.now() - startTime >= this.maxComponentCreationTimeMs && !this.hasPendingPortalUpdate) {
901
+ return;
902
+ }
903
+ window.setTimeout(() => {
904
+ this.waitForInstance(reactComponent, resolve, startTime);
905
+ });
906
+ }
907
+ }
908
+ };
909
+
910
+ // packages/ag-grid-react/src/reactUi/gridComp.tsx
911
+
912
+
913
+
914
+ // packages/ag-grid-react/src/reactUi/gridBodyComp.tsx
915
+
916
+
917
+
918
+ // packages/ag-grid-react/src/reactUi/header/gridHeaderComp.tsx
919
+
920
+
921
+
922
+ // packages/ag-grid-react/src/reactUi/header/headerRowContainerComp.tsx
923
+
924
+
925
+
926
+ // packages/ag-grid-react/src/reactUi/header/headerRowComp.tsx
927
+
928
+
929
+
930
+ // packages/ag-grid-react/src/reactUi/header/headerCellComp.tsx
931
+
932
+
933
+ var HeaderCellComp = ({ ctrl }) => {
934
+ const isAlive = ctrl.isAlive();
935
+ const { context } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BeansContext);
936
+ const colId = isAlive ? ctrl.getColId() : void 0;
937
+ const [userCompDetails, setUserCompDetails] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
938
+ const compBean = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
939
+ const eGui = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
940
+ const eResize = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
941
+ const eHeaderCompWrapper = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
942
+ const userCompRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
943
+ const cssClassManager = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
944
+ if (isAlive && !cssClassManager.current) {
945
+ cssClassManager.current = new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.CssClassManager(() => eGui.current);
946
+ }
947
+ const setRef2 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((eRef) => {
948
+ eGui.current = eRef;
949
+ compBean.current = eRef ? context.createBean(new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._EmptyBean()) : context.destroyBean(compBean.current);
950
+ if (!eRef || !isAlive) {
951
+ return;
952
+ }
953
+ const compProxy = {
954
+ setWidth: (width) => {
955
+ if (eGui.current) {
956
+ eGui.current.style.width = width;
957
+ }
958
+ },
959
+ addOrRemoveCssClass: (name, on) => cssClassManager.current.addOrRemoveCssClass(name, on),
960
+ setAriaSort: (sort) => {
961
+ if (eGui.current) {
962
+ sort ? (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._setAriaSort)(eGui.current, sort) : (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._removeAriaSort)(eGui.current);
963
+ }
964
+ },
965
+ setUserCompDetails: (compDetails) => setUserCompDetails(compDetails),
966
+ getUserCompInstance: () => userCompRef.current || void 0
967
+ };
968
+ ctrl.setComp(compProxy, eRef, eResize.current, eHeaderCompWrapper.current, compBean.current);
969
+ const selectAllGui = ctrl.getSelectAllGui();
970
+ eResize.current?.insertAdjacentElement("afterend", selectAllGui);
971
+ compBean.current.addDestroyFunc(() => selectAllGui.remove());
972
+ }, []);
973
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(
974
+ () => showJsComp(userCompDetails, context, eHeaderCompWrapper.current, userCompRef),
975
+ [userCompDetails]
976
+ );
977
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
978
+ ctrl.setDragSource(eGui.current);
979
+ }, [userCompDetails]);
980
+ const userCompStateless = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
981
+ const res = userCompDetails?.componentFromFramework && isComponentStateless(userCompDetails.componentClass);
982
+ return !!res;
983
+ }, [userCompDetails]);
984
+ const reactUserComp = userCompDetails && userCompDetails.componentFromFramework;
985
+ const UserCompClass = userCompDetails && userCompDetails.componentClass;
986
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: setRef2, className: "ag-header-cell", "col-id": colId, role: "columnheader" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: eResize, className: "ag-header-cell-resize", role: "presentation" }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: eHeaderCompWrapper, className: "ag-header-cell-comp-wrapper", role: "presentation" }, reactUserComp && userCompStateless && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(UserCompClass, { ...userCompDetails.params }), reactUserComp && !userCompStateless && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(UserCompClass, { ...userCompDetails.params, ref: userCompRef })));
987
+ };
988
+ var headerCellComp_default = (0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(HeaderCellComp);
989
+
990
+ // packages/ag-grid-react/src/reactUi/header/headerFilterCellComp.tsx
991
+
992
+
993
+ var HeaderFilterCellComp = ({ ctrl }) => {
994
+ const { context, gos } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BeansContext);
995
+ const [cssClasses, setCssClasses] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(
996
+ () => new CssClasses("ag-header-cell", "ag-floating-filter")
997
+ );
998
+ const [cssBodyClasses, setBodyCssClasses] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => new CssClasses());
999
+ const [cssButtonWrapperClasses, setButtonWrapperCssClasses] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(
1000
+ () => new CssClasses("ag-floating-filter-button", "ag-hidden")
1001
+ );
1002
+ const [buttonWrapperAriaHidden, setButtonWrapperAriaHidden] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("false");
1003
+ const [userCompDetails, setUserCompDetails] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1004
+ const [, setRenderKey] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1);
1005
+ const compBean = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1006
+ const eGui = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1007
+ const eFloatingFilterBody = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1008
+ const eButtonWrapper = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1009
+ const eButtonShowMainFilter = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1010
+ const userCompResolve = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1011
+ const userCompPromise = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1012
+ const userCompRef = (value) => {
1013
+ if (value == null) {
1014
+ return;
1015
+ }
1016
+ userCompResolve.current && userCompResolve.current(value);
1017
+ };
1018
+ const setRef2 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((eRef) => {
1019
+ eGui.current = eRef;
1020
+ compBean.current = eRef ? context.createBean(new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._EmptyBean()) : context.destroyBean(compBean.current);
1021
+ if (!eRef) {
1022
+ return;
1023
+ }
1024
+ userCompPromise.current = new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.AgPromise((resolve) => {
1025
+ userCompResolve.current = resolve;
1026
+ });
1027
+ const compProxy = {
1028
+ addOrRemoveCssClass: (name, on) => setCssClasses((prev) => prev.setClass(name, on)),
1029
+ addOrRemoveBodyCssClass: (name, on) => setBodyCssClasses((prev) => prev.setClass(name, on)),
1030
+ setButtonWrapperDisplayed: (displayed) => {
1031
+ setButtonWrapperCssClasses((prev) => prev.setClass("ag-hidden", !displayed));
1032
+ setButtonWrapperAriaHidden(!displayed ? "true" : "false");
1033
+ },
1034
+ setWidth: (width) => {
1035
+ if (eGui.current) {
1036
+ eGui.current.style.width = width;
1037
+ }
1038
+ },
1039
+ setCompDetails: (compDetails) => setUserCompDetails(compDetails),
1040
+ getFloatingFilterComp: () => userCompPromise.current ? userCompPromise.current : null,
1041
+ setMenuIcon: (eIcon) => eButtonShowMainFilter.current?.appendChild(eIcon)
1042
+ };
1043
+ ctrl.setComp(compProxy, eRef, eButtonShowMainFilter.current, eFloatingFilterBody.current, compBean.current);
1044
+ }, []);
1045
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(
1046
+ () => showJsComp(userCompDetails, context, eFloatingFilterBody.current, userCompRef),
1047
+ [userCompDetails]
1048
+ );
1049
+ const className = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => cssClasses.toString(), [cssClasses]);
1050
+ const bodyClassName = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => cssBodyClasses.toString(), [cssBodyClasses]);
1051
+ const buttonWrapperClassName = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => cssButtonWrapperClasses.toString(), [cssButtonWrapperClasses]);
1052
+ const userCompStateless = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
1053
+ const res = userCompDetails && userCompDetails.componentFromFramework && isComponentStateless(userCompDetails.componentClass);
1054
+ return !!res;
1055
+ }, [userCompDetails]);
1056
+ const reactiveCustomComponents = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => gos.get("reactiveCustomComponents"), []);
1057
+ const floatingFilterCompProxy = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
1058
+ if (userCompDetails) {
1059
+ if (reactiveCustomComponents) {
1060
+ const compProxy = new FloatingFilterComponentProxy(
1061
+ userCompDetails.params,
1062
+ () => setRenderKey((prev) => prev + 1)
1063
+ );
1064
+ userCompRef(compProxy);
1065
+ return compProxy;
1066
+ } else if (userCompDetails.componentFromFramework) {
1067
+ warnReactiveCustomComponents();
1068
+ }
1069
+ }
1070
+ return void 0;
1071
+ }, [userCompDetails]);
1072
+ const floatingFilterProps = floatingFilterCompProxy?.getProps();
1073
+ const reactUserComp = userCompDetails && userCompDetails.componentFromFramework;
1074
+ const UserCompClass = userCompDetails && userCompDetails.componentClass;
1075
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: setRef2, className, role: "gridcell" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: eFloatingFilterBody, className: bodyClassName, role: "presentation" }, reactUserComp && !reactiveCustomComponents && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(UserCompClass, { ...userCompDetails.params, ref: userCompStateless ? () => {
1076
+ } : userCompRef }), reactUserComp && reactiveCustomComponents && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
1077
+ CustomContext.Provider,
1078
+ {
1079
+ value: {
1080
+ setMethods: (methods) => floatingFilterCompProxy.setMethods(methods)
1081
+ }
1082
+ },
1083
+ /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(UserCompClass, { ...floatingFilterProps })
1084
+ )), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
1085
+ "div",
1086
+ {
1087
+ ref: eButtonWrapper,
1088
+ "aria-hidden": buttonWrapperAriaHidden,
1089
+ className: buttonWrapperClassName,
1090
+ role: "presentation"
1091
+ },
1092
+ /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
1093
+ "button",
1094
+ {
1095
+ ref: eButtonShowMainFilter,
1096
+ type: "button",
1097
+ className: "ag-button ag-floating-filter-button-button",
1098
+ tabIndex: -1
1099
+ }
1100
+ )
1101
+ ));
1102
+ };
1103
+ var headerFilterCellComp_default = (0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(HeaderFilterCellComp);
1104
+
1105
+ // packages/ag-grid-react/src/reactUi/header/headerGroupCellComp.tsx
1106
+
1107
+
1108
+ var HeaderGroupCellComp = ({ ctrl }) => {
1109
+ const { context } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BeansContext);
1110
+ const [cssClasses, setCssClasses] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => new CssClasses());
1111
+ const [cssResizableClasses, setResizableCssClasses] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => new CssClasses());
1112
+ const [resizableAriaHidden, setResizableAriaHidden] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("false");
1113
+ const [ariaExpanded, setAriaExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1114
+ const [userCompDetails, setUserCompDetails] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1115
+ const colId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ctrl.getColId(), []);
1116
+ const compBean = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1117
+ const eGui = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1118
+ const eResize = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1119
+ const eHeaderCompWrapper = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1120
+ const userCompRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1121
+ const setRef2 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((eRef) => {
1122
+ eGui.current = eRef;
1123
+ compBean.current = eRef ? context.createBean(new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._EmptyBean()) : context.destroyBean(compBean.current);
1124
+ if (!eRef) {
1125
+ return;
1126
+ }
1127
+ const compProxy = {
1128
+ setWidth: (width) => {
1129
+ if (eGui.current) {
1130
+ eGui.current.style.width = width;
1131
+ }
1132
+ },
1133
+ addOrRemoveCssClass: (name, on) => setCssClasses((prev) => prev.setClass(name, on)),
1134
+ setHeaderWrapperHidden: (hidden) => {
1135
+ const headerCompWrapper = eHeaderCompWrapper.current;
1136
+ if (!headerCompWrapper) {
1137
+ return;
1138
+ }
1139
+ if (hidden) {
1140
+ headerCompWrapper.style.setProperty("display", "none");
1141
+ } else {
1142
+ headerCompWrapper.style.removeProperty("display");
1143
+ }
1144
+ },
1145
+ setHeaderWrapperMaxHeight: (value) => {
1146
+ const headerCompWrapper = eHeaderCompWrapper.current;
1147
+ if (!headerCompWrapper) {
1148
+ return;
1149
+ }
1150
+ if (value != null) {
1151
+ headerCompWrapper.style.setProperty("max-height", `${value}px`);
1152
+ } else {
1153
+ headerCompWrapper.style.removeProperty("max-height");
1154
+ }
1155
+ headerCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height", value != null);
1156
+ },
1157
+ setUserCompDetails: (compDetails) => setUserCompDetails(compDetails),
1158
+ setResizableDisplayed: (displayed) => {
1159
+ setResizableCssClasses((prev) => prev.setClass("ag-hidden", !displayed));
1160
+ setResizableAriaHidden(!displayed ? "true" : "false");
1161
+ },
1162
+ setAriaExpanded: (expanded) => setAriaExpanded(expanded),
1163
+ getUserCompInstance: () => userCompRef.current || void 0
1164
+ };
1165
+ ctrl.setComp(compProxy, eRef, eResize.current, eHeaderCompWrapper.current, compBean.current);
1166
+ }, []);
1167
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(() => showJsComp(userCompDetails, context, eHeaderCompWrapper.current), [userCompDetails]);
1168
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1169
+ if (eGui.current) {
1170
+ ctrl.setDragSource(eGui.current);
1171
+ }
1172
+ }, [userCompDetails]);
1173
+ const userCompStateless = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
1174
+ const res = userCompDetails?.componentFromFramework && isComponentStateless(userCompDetails.componentClass);
1175
+ return !!res;
1176
+ }, [userCompDetails]);
1177
+ const className = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => "ag-header-group-cell " + cssClasses.toString(), [cssClasses]);
1178
+ const resizableClassName = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(
1179
+ () => "ag-header-cell-resize " + cssResizableClasses.toString(),
1180
+ [cssResizableClasses]
1181
+ );
1182
+ const reactUserComp = userCompDetails && userCompDetails.componentFromFramework;
1183
+ const UserCompClass = userCompDetails && userCompDetails.componentClass;
1184
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: setRef2, className, "col-id": colId, role: "columnheader", "aria-expanded": ariaExpanded }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: eHeaderCompWrapper, className: "ag-header-cell-comp-wrapper", role: "presentation" }, reactUserComp && userCompStateless && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(UserCompClass, { ...userCompDetails.params }), reactUserComp && !userCompStateless && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(UserCompClass, { ...userCompDetails.params, ref: userCompRef })), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: eResize, "aria-hidden": resizableAriaHidden, className: resizableClassName }));
1185
+ };
1186
+ var headerGroupCellComp_default = (0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(HeaderGroupCellComp);
1187
+
1188
+ // packages/ag-grid-react/src/reactUi/header/headerRowComp.tsx
1189
+ var HeaderRowComp = ({ ctrl }) => {
1190
+ const { context } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BeansContext);
1191
+ const { topOffset, rowHeight } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ctrl.getTopAndHeight(), []);
1192
+ const ariaRowIndex = ctrl.getAriaRowIndex();
1193
+ const className = ctrl.getHeaderRowClass();
1194
+ const [height, setHeight] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => rowHeight + "px");
1195
+ const [top, setTop] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => topOffset + "px");
1196
+ const cellCtrlsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1197
+ const prevCellCtrlsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1198
+ const [cellCtrls, setCellCtrls] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => ctrl.getHeaderCtrls());
1199
+ const compBean = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1200
+ const eGui = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1201
+ const setRef2 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((eRef) => {
1202
+ eGui.current = eRef;
1203
+ compBean.current = eRef ? context.createBean(new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._EmptyBean()) : context.destroyBean(compBean.current);
1204
+ if (!eRef) {
1205
+ return;
1206
+ }
1207
+ const compProxy = {
1208
+ setHeight: (height2) => setHeight(height2),
1209
+ setTop: (top2) => setTop(top2),
1210
+ setHeaderCtrls: (ctrls, forceOrder, afterScroll) => {
1211
+ prevCellCtrlsRef.current = cellCtrlsRef.current;
1212
+ cellCtrlsRef.current = ctrls;
1213
+ const next = getNextValueIfDifferent(prevCellCtrlsRef.current, ctrls, forceOrder);
1214
+ if (next !== prevCellCtrlsRef.current) {
1215
+ agFlushSync(afterScroll, () => setCellCtrls(next));
1216
+ }
1217
+ },
1218
+ setWidth: (width) => {
1219
+ if (eGui.current) {
1220
+ eGui.current.style.width = width;
1221
+ }
1222
+ }
1223
+ };
1224
+ ctrl.setComp(compProxy, compBean.current, false);
1225
+ }, []);
1226
+ const style = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(
1227
+ () => ({
1228
+ height,
1229
+ top
1230
+ }),
1231
+ [height, top]
1232
+ );
1233
+ const createCellJsx = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((cellCtrl) => {
1234
+ switch (ctrl.getType()) {
1235
+ case ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.HeaderRowType.COLUMN_GROUP:
1236
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(headerGroupCellComp_default, { ctrl: cellCtrl, key: cellCtrl.instanceId });
1237
+ case ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.HeaderRowType.FLOATING_FILTER:
1238
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(headerFilterCellComp_default, { ctrl: cellCtrl, key: cellCtrl.instanceId });
1239
+ default:
1240
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(headerCellComp_default, { ctrl: cellCtrl, key: cellCtrl.instanceId });
1241
+ }
1242
+ }, []);
1243
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: setRef2, className, role: "row", style, "aria-rowindex": ariaRowIndex }, cellCtrls.map(createCellJsx));
1244
+ };
1245
+ var headerRowComp_default = (0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(HeaderRowComp);
1246
+
1247
+ // packages/ag-grid-react/src/reactUi/header/headerRowContainerComp.tsx
1248
+ var HeaderRowContainerComp = ({ pinned }) => {
1249
+ const [displayed, setDisplayed] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true);
1250
+ const [headerRowCtrls, setHeaderRowCtrls] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
1251
+ const { context } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BeansContext);
1252
+ const eGui = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1253
+ const eCenterContainer = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1254
+ const headerRowCtrlRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1255
+ const pinnedLeft = pinned === "left";
1256
+ const pinnedRight = pinned === "right";
1257
+ const centre = !pinnedLeft && !pinnedRight;
1258
+ const setRef2 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((eRef) => {
1259
+ eGui.current = eRef;
1260
+ headerRowCtrlRef.current = eRef ? context.createBean(new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.HeaderRowContainerCtrl(pinned)) : context.destroyBean(headerRowCtrlRef.current);
1261
+ if (!eRef) {
1262
+ return;
1263
+ }
1264
+ const compProxy = {
1265
+ setDisplayed,
1266
+ setCtrls: (ctrls) => setHeaderRowCtrls(ctrls),
1267
+ // centre only
1268
+ setCenterWidth: (width) => {
1269
+ if (eCenterContainer.current) {
1270
+ eCenterContainer.current.style.width = width;
1271
+ }
1272
+ },
1273
+ setViewportScrollLeft: (left) => {
1274
+ if (eGui.current) {
1275
+ eGui.current.scrollLeft = left;
1276
+ }
1277
+ },
1278
+ // pinned only
1279
+ setPinnedContainerWidth: (width) => {
1280
+ if (eGui.current) {
1281
+ eGui.current.style.width = width;
1282
+ eGui.current.style.minWidth = width;
1283
+ eGui.current.style.maxWidth = width;
1284
+ }
1285
+ }
1286
+ };
1287
+ headerRowCtrlRef.current.setComp(compProxy, eGui.current);
1288
+ }, []);
1289
+ const className = !displayed ? "ag-hidden" : "";
1290
+ const insertRowsJsx = () => headerRowCtrls.map((ctrl) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(headerRowComp_default, { ctrl, key: ctrl.instanceId }));
1291
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, pinnedLeft && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
1292
+ "div",
1293
+ {
1294
+ ref: setRef2,
1295
+ className: "ag-pinned-left-header " + className,
1296
+ "aria-hidden": !displayed,
1297
+ role: "rowgroup"
1298
+ },
1299
+ insertRowsJsx()
1300
+ ), pinnedRight && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
1301
+ "div",
1302
+ {
1303
+ ref: setRef2,
1304
+ className: "ag-pinned-right-header " + className,
1305
+ "aria-hidden": !displayed,
1306
+ role: "rowgroup"
1307
+ },
1308
+ insertRowsJsx()
1309
+ ), centre && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: setRef2, className: "ag-header-viewport " + className, role: "presentation" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: eCenterContainer, className: "ag-header-container", role: "rowgroup" }, insertRowsJsx())));
1310
+ };
1311
+ var headerRowContainerComp_default = (0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(HeaderRowContainerComp);
1312
+
1313
+ // packages/ag-grid-react/src/reactUi/header/gridHeaderComp.tsx
1314
+ var GridHeaderComp = () => {
1315
+ const [cssClasses, setCssClasses] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => new CssClasses());
1316
+ const [height, setHeight] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1317
+ const { context } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BeansContext);
1318
+ const eGui = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1319
+ const gridCtrlRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1320
+ const setRef2 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((eRef) => {
1321
+ eGui.current = eRef;
1322
+ gridCtrlRef.current = eRef ? context.createBean(new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.GridHeaderCtrl()) : context.destroyBean(gridCtrlRef.current);
1323
+ if (!eRef)
1324
+ return;
1325
+ const compProxy = {
1326
+ addOrRemoveCssClass: (name, on) => setCssClasses((prev) => prev.setClass(name, on)),
1327
+ setHeightAndMinHeight: (height2) => setHeight(height2)
1328
+ };
1329
+ gridCtrlRef.current.setComp(compProxy, eRef, eRef);
1330
+ }, []);
1331
+ const className = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
1332
+ const res = cssClasses.toString();
1333
+ return "ag-header " + res;
1334
+ }, [cssClasses]);
1335
+ const style = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(
1336
+ () => ({
1337
+ height,
1338
+ minHeight: height
1339
+ }),
1340
+ [height]
1341
+ );
1342
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: setRef2, className, style, role: "presentation" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(headerRowContainerComp_default, { pinned: "left" }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(headerRowContainerComp_default, { pinned: null }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(headerRowContainerComp_default, { pinned: "right" }));
1343
+ };
1344
+ var gridHeaderComp_default = (0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(GridHeaderComp);
1345
+
1346
+ // packages/ag-grid-react/src/reactUi/reactComment.tsx
1347
+
1348
+ var useReactCommentEffect = (comment, eForCommentRef) => {
1349
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1350
+ const eForComment = eForCommentRef.current;
1351
+ if (eForComment) {
1352
+ const eParent = eForComment.parentElement;
1353
+ if (eParent) {
1354
+ const eComment = document.createComment(comment);
1355
+ eParent.insertBefore(eComment, eForComment);
1356
+ return () => {
1357
+ eParent.removeChild(eComment);
1358
+ };
1359
+ }
1360
+ }
1361
+ }, [comment]);
1362
+ };
1363
+ var reactComment_default = useReactCommentEffect;
1364
+
1365
+ // packages/ag-grid-react/src/reactUi/rows/rowContainerComp.tsx
1366
+
1367
+
1368
+
1369
+ // packages/ag-grid-react/src/reactUi/rows/rowComp.tsx
1370
+
1371
+
1372
+
1373
+ // packages/ag-grid-react/src/reactUi/cells/cellComp.tsx
1374
+
1375
+
1376
+
1377
+ // packages/ag-grid-react/src/shared/customComp/cellEditorComponentProxy.ts
1378
+
1379
+ var CellEditorComponentProxy = class {
1380
+ constructor(cellEditorParams, refreshProps) {
1381
+ this.cellEditorParams = cellEditorParams;
1382
+ this.refreshProps = refreshProps;
1383
+ this.instanceCreated = new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.AgPromise((resolve) => {
1384
+ this.resolveInstanceCreated = resolve;
1385
+ });
1386
+ this.onValueChange = (value) => this.updateValue(value);
1387
+ this.value = cellEditorParams.value;
1388
+ }
1389
+ getProps() {
1390
+ return {
1391
+ ...this.cellEditorParams,
1392
+ initialValue: this.cellEditorParams.value,
1393
+ value: this.value,
1394
+ onValueChange: this.onValueChange
1395
+ };
1396
+ }
1397
+ getValue() {
1398
+ return this.value;
1399
+ }
1400
+ refresh(params) {
1401
+ this.cellEditorParams = params;
1402
+ this.refreshProps();
1403
+ }
1404
+ setMethods(methods) {
1405
+ addOptionalMethods(this.getOptionalMethods(), methods, this);
1406
+ }
1407
+ getInstance() {
1408
+ return this.instanceCreated.then(() => this.componentInstance);
1409
+ }
1410
+ setRef(componentInstance) {
1411
+ this.componentInstance = componentInstance;
1412
+ this.resolveInstanceCreated?.();
1413
+ this.resolveInstanceCreated = void 0;
1414
+ }
1415
+ getOptionalMethods() {
1416
+ return ["isCancelBeforeStart", "isCancelAfterEnd", "focusIn", "focusOut", "afterGuiAttached"];
1417
+ }
1418
+ updateValue(value) {
1419
+ this.value = value;
1420
+ this.refreshProps();
1421
+ }
1422
+ };
1423
+
1424
+ // packages/ag-grid-react/src/reactUi/cells/popupEditorComp.tsx
1425
+
1426
+
1427
+
1428
+ // packages/ag-grid-react/src/reactUi/useEffectOnce.tsx
1429
+
1430
+ var useEffectOnce = (effect) => {
1431
+ const effectFn = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(effect);
1432
+ const destroyFn = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1433
+ const effectCalled = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
1434
+ const rendered = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
1435
+ const [, setVal] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
1436
+ if (effectCalled.current) {
1437
+ rendered.current = true;
1438
+ }
1439
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1440
+ if (!effectCalled.current) {
1441
+ destroyFn.current = effectFn.current();
1442
+ effectCalled.current = true;
1443
+ }
1444
+ setVal((val) => val + 1);
1445
+ return () => {
1446
+ if (!rendered.current) {
1447
+ return;
1448
+ }
1449
+ destroyFn.current?.();
1450
+ };
1451
+ }, []);
1452
+ };
1453
+
1454
+ // packages/ag-grid-react/src/reactUi/cells/popupEditorComp.tsx
1455
+ var PopupEditorComp = (props) => {
1456
+ const [popupEditorWrapper, setPopupEditorWrapper] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1457
+ const { context, popupService, localeService, gos, editService } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BeansContext);
1458
+ useEffectOnce(() => {
1459
+ const { editDetails, cellCtrl, eParentCell } = props;
1460
+ const { compDetails } = editDetails;
1461
+ const useModelPopup = gos.get("stopEditingWhenCellsLoseFocus");
1462
+ const wrapper = context.createBean(editService.createPopupEditorWrapper(compDetails.params));
1463
+ const ePopupGui = wrapper.getGui();
1464
+ if (props.jsChildComp) {
1465
+ const eChildGui = props.jsChildComp.getGui();
1466
+ if (eChildGui) {
1467
+ ePopupGui.appendChild(eChildGui);
1468
+ }
1469
+ }
1470
+ const positionParams = {
1471
+ column: cellCtrl.getColumn(),
1472
+ rowNode: cellCtrl.getRowNode(),
1473
+ type: "popupCellEditor",
1474
+ eventSource: eParentCell,
1475
+ ePopup: ePopupGui,
1476
+ position: editDetails.popupPosition,
1477
+ keepWithinBounds: true
1478
+ };
1479
+ const positionCallback = popupService.positionPopupByComponent.bind(popupService, positionParams);
1480
+ const translate = localeService.getLocaleTextFunc();
1481
+ const addPopupRes = popupService.addPopup({
1482
+ modal: useModelPopup,
1483
+ eChild: ePopupGui,
1484
+ closeOnEsc: true,
1485
+ closedCallback: () => {
1486
+ cellCtrl.onPopupEditorClosed();
1487
+ },
1488
+ anchorToElement: eParentCell,
1489
+ positionCallback,
1490
+ ariaLabel: translate("ariaLabelCellEditor", "Cell Editor")
1491
+ });
1492
+ const hideEditorPopup = addPopupRes ? addPopupRes.hideFunc : void 0;
1493
+ setPopupEditorWrapper(wrapper);
1494
+ props.jsChildComp?.afterGuiAttached?.();
1495
+ return () => {
1496
+ hideEditorPopup?.();
1497
+ context.destroyBean(wrapper);
1498
+ };
1499
+ });
1500
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, popupEditorWrapper && props.wrappedContent && (0,react_dom__WEBPACK_IMPORTED_MODULE_2__.createPortal)(props.wrappedContent, popupEditorWrapper.getGui()));
1501
+ };
1502
+ var popupEditorComp_default = (0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(PopupEditorComp);
1503
+
1504
+ // packages/ag-grid-react/src/reactUi/cells/showJsRenderer.tsx
1505
+
1506
+ var useJsCellRenderer = (showDetails, showTools, eCellValue, cellValueVersion, jsCellRendererRef, eGui) => {
1507
+ const { context } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BeansContext);
1508
+ const destroyCellRenderer = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
1509
+ const comp = jsCellRendererRef.current;
1510
+ if (!comp) {
1511
+ return;
1512
+ }
1513
+ const compGui = comp.getGui();
1514
+ if (compGui && compGui.parentElement) {
1515
+ compGui.parentElement.removeChild(compGui);
1516
+ }
1517
+ context.destroyBean(comp);
1518
+ jsCellRendererRef.current = void 0;
1519
+ }, []);
1520
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1521
+ const showValue = showDetails != null;
1522
+ const jsCompDetails = showDetails?.compDetails && !showDetails.compDetails.componentFromFramework;
1523
+ const waitingForToolsSetup = showTools && eCellValue == null;
1524
+ const showComp = showValue && jsCompDetails && !waitingForToolsSetup;
1525
+ if (!showComp) {
1526
+ destroyCellRenderer();
1527
+ return;
1528
+ }
1529
+ const compDetails = showDetails.compDetails;
1530
+ if (jsCellRendererRef.current) {
1531
+ const comp = jsCellRendererRef.current;
1532
+ const attemptRefresh = comp.refresh != null && showDetails.force == false;
1533
+ const refreshResult = attemptRefresh ? comp.refresh(compDetails.params) : false;
1534
+ const refreshWorked = refreshResult === true || refreshResult === void 0;
1535
+ if (refreshWorked) {
1536
+ return;
1537
+ }
1538
+ destroyCellRenderer();
1539
+ }
1540
+ const promise = compDetails.newAgStackInstance();
1541
+ if (promise == null) {
1542
+ return;
1543
+ }
1544
+ promise.then((comp) => {
1545
+ if (!comp) {
1546
+ return;
1547
+ }
1548
+ const compGui = comp.getGui();
1549
+ if (!compGui) {
1550
+ return;
1551
+ }
1552
+ const parent = showTools ? eCellValue : eGui.current;
1553
+ parent.appendChild(compGui);
1554
+ jsCellRendererRef.current = comp;
1555
+ });
1556
+ }, [showDetails, showTools, cellValueVersion]);
1557
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1558
+ return destroyCellRenderer;
1559
+ }, []);
1560
+ };
1561
+ var showJsRenderer_default = useJsCellRenderer;
1562
+
1563
+ // packages/ag-grid-react/src/reactUi/cells/cellComp.tsx
1564
+ var jsxEditorProxy = (editDetails, CellEditorClass, setRef2) => {
1565
+ const { compProxy } = editDetails;
1566
+ setRef2(compProxy);
1567
+ const props = compProxy.getProps();
1568
+ const isStateless = isComponentStateless(CellEditorClass);
1569
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
1570
+ CustomContext.Provider,
1571
+ {
1572
+ value: {
1573
+ setMethods: (methods) => compProxy.setMethods(methods)
1574
+ }
1575
+ },
1576
+ isStateless ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CellEditorClass, { ...props }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CellEditorClass, { ...props, ref: (ref) => compProxy.setRef(ref) })
1577
+ );
1578
+ };
1579
+ var jsxEditor = (editDetails, CellEditorClass, setRef2) => {
1580
+ const newFormat = editDetails.compProxy;
1581
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, newFormat ? jsxEditorProxy(editDetails, CellEditorClass, setRef2) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CellEditorClass, { ...editDetails.compDetails.params, ref: setRef2 }));
1582
+ };
1583
+ var jsxEditValue = (editDetails, setCellEditorRef, eGui, cellCtrl, jsEditorComp) => {
1584
+ const compDetails = editDetails.compDetails;
1585
+ const CellEditorClass = compDetails.componentClass;
1586
+ const reactInlineEditor = compDetails.componentFromFramework && !editDetails.popup;
1587
+ const reactPopupEditor = compDetails.componentFromFramework && editDetails.popup;
1588
+ const jsPopupEditor = !compDetails.componentFromFramework && editDetails.popup;
1589
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, reactInlineEditor && jsxEditor(editDetails, CellEditorClass, setCellEditorRef), reactPopupEditor && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
1590
+ popupEditorComp_default,
1591
+ {
1592
+ editDetails,
1593
+ cellCtrl,
1594
+ eParentCell: eGui,
1595
+ wrappedContent: jsxEditor(editDetails, CellEditorClass, setCellEditorRef)
1596
+ }
1597
+ ), jsPopupEditor && jsEditorComp && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
1598
+ popupEditorComp_default,
1599
+ {
1600
+ editDetails,
1601
+ cellCtrl,
1602
+ eParentCell: eGui,
1603
+ jsChildComp: jsEditorComp
1604
+ }
1605
+ ));
1606
+ };
1607
+ var jsxShowValue = (showDetails, key, parentId, cellRendererRef, showCellWrapper, reactCellRendererStateless, setECellValue) => {
1608
+ const { compDetails, value } = showDetails;
1609
+ const noCellRenderer = !compDetails;
1610
+ const reactCellRenderer = compDetails && compDetails.componentFromFramework;
1611
+ const CellRendererClass = compDetails && compDetails.componentClass;
1612
+ const valueForNoCellRenderer = value?.toString ? value.toString() : value;
1613
+ const bodyJsxFunc = () => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, noCellRenderer && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, valueForNoCellRenderer), reactCellRenderer && !reactCellRendererStateless && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CellRendererClass, { ...compDetails.params, key, ref: cellRendererRef }), reactCellRenderer && reactCellRendererStateless && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CellRendererClass, { ...compDetails.params, key }));
1614
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, showCellWrapper ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { role: "presentation", id: `cell-${parentId}`, className: "ag-cell-value", ref: setECellValue }, bodyJsxFunc()) : bodyJsxFunc());
1615
+ };
1616
+ var CellComp = ({
1617
+ cellCtrl,
1618
+ printLayout,
1619
+ editingRow
1620
+ }) => {
1621
+ const { context } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BeansContext);
1622
+ const { colIdSanitised, instanceId } = cellCtrl;
1623
+ const compBean = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1624
+ const [renderDetails, setRenderDetails] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(
1625
+ () => cellCtrl.isCellRenderer() ? void 0 : { compDetails: void 0, value: cellCtrl.getValueToDisplay(), force: false }
1626
+ );
1627
+ const [editDetails, setEditDetails] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1628
+ const [renderKey, setRenderKey] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1);
1629
+ const [userStyles, setUserStyles] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1630
+ const [includeSelection, setIncludeSelection] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
1631
+ const [includeRowDrag, setIncludeRowDrag] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
1632
+ const [includeDndSource, setIncludeDndSource] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
1633
+ const [jsEditorComp, setJsEditorComp] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1634
+ const forceWrapper = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => cellCtrl.isForceWrapper(), [cellCtrl]);
1635
+ const cellAriaRole = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => cellCtrl.getCellAriaRole(), [cellCtrl]);
1636
+ const eGui = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1637
+ const cellRendererRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1638
+ const jsCellRendererRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1639
+ const cellEditorRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1640
+ const eCellWrapper = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1641
+ const cellWrapperDestroyFuncs = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]);
1642
+ const eCellValue = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1643
+ const [cellValueVersion, setCellValueVersion] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
1644
+ const setCellValueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((ref) => {
1645
+ eCellValue.current = ref;
1646
+ setCellValueVersion((v) => v + 1);
1647
+ }, []);
1648
+ const showTools = renderDetails != null && (includeSelection || includeDndSource || includeRowDrag);
1649
+ const showCellWrapper = forceWrapper || showTools;
1650
+ const setCellEditorRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(
1651
+ (cellEditor) => {
1652
+ cellEditorRef.current = cellEditor;
1653
+ if (cellEditor) {
1654
+ const editingCancelledByUserComp = cellEditor.isCancelBeforeStart && cellEditor.isCancelBeforeStart();
1655
+ setTimeout(() => {
1656
+ if (editingCancelledByUserComp) {
1657
+ cellCtrl.stopEditing(true);
1658
+ cellCtrl.focusCell(true);
1659
+ } else {
1660
+ cellCtrl.cellEditorAttached();
1661
+ }
1662
+ });
1663
+ }
1664
+ },
1665
+ [cellCtrl]
1666
+ );
1667
+ const cssClassManager = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1668
+ if (!cssClassManager.current) {
1669
+ cssClassManager.current = new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.CssClassManager(() => eGui.current);
1670
+ }
1671
+ showJsRenderer_default(renderDetails, showCellWrapper, eCellValue.current, cellValueVersion, jsCellRendererRef, eGui);
1672
+ const lastRenderDetails = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1673
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(() => {
1674
+ const oldDetails = lastRenderDetails.current;
1675
+ const newDetails = renderDetails;
1676
+ lastRenderDetails.current = renderDetails;
1677
+ if (oldDetails == null || oldDetails.compDetails == null || newDetails == null || newDetails.compDetails == null) {
1678
+ return;
1679
+ }
1680
+ const oldCompDetails = oldDetails.compDetails;
1681
+ const newCompDetails = newDetails.compDetails;
1682
+ if (oldCompDetails.componentClass != newCompDetails.componentClass) {
1683
+ return;
1684
+ }
1685
+ if (cellRendererRef.current?.refresh == null) {
1686
+ return;
1687
+ }
1688
+ const result = cellRendererRef.current.refresh(newCompDetails.params);
1689
+ if (result != true) {
1690
+ setRenderKey((prev) => prev + 1);
1691
+ }
1692
+ }, [renderDetails]);
1693
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(() => {
1694
+ const doingJsEditor = editDetails && !editDetails.compDetails.componentFromFramework;
1695
+ if (!doingJsEditor) {
1696
+ return;
1697
+ }
1698
+ const compDetails = editDetails.compDetails;
1699
+ const isPopup = editDetails.popup === true;
1700
+ const cellEditorPromise = compDetails.newAgStackInstance();
1701
+ cellEditorPromise.then((cellEditor) => {
1702
+ if (!cellEditor) {
1703
+ return;
1704
+ }
1705
+ const compGui = cellEditor.getGui();
1706
+ setCellEditorRef(cellEditor);
1707
+ if (!isPopup) {
1708
+ const parentEl = (forceWrapper ? eCellWrapper : eGui).current;
1709
+ parentEl?.appendChild(compGui);
1710
+ cellEditor.afterGuiAttached && cellEditor.afterGuiAttached();
1711
+ }
1712
+ setJsEditorComp(cellEditor);
1713
+ });
1714
+ return () => {
1715
+ cellEditorPromise.then((cellEditor) => {
1716
+ const compGui = cellEditor.getGui();
1717
+ context.destroyBean(cellEditor);
1718
+ setCellEditorRef(void 0);
1719
+ setJsEditorComp(void 0);
1720
+ compGui?.parentElement?.removeChild(compGui);
1721
+ });
1722
+ };
1723
+ }, [editDetails]);
1724
+ const setCellWrapperRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(
1725
+ (eRef) => {
1726
+ eCellWrapper.current = eRef;
1727
+ if (!eRef) {
1728
+ cellWrapperDestroyFuncs.current.forEach((f) => f());
1729
+ cellWrapperDestroyFuncs.current = [];
1730
+ return;
1731
+ }
1732
+ const addComp = (comp) => {
1733
+ if (comp) {
1734
+ const eGui2 = comp.getGui();
1735
+ eRef.insertAdjacentElement("afterbegin", eGui2);
1736
+ cellWrapperDestroyFuncs.current.push(() => {
1737
+ context.destroyBean(comp);
1738
+ (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._removeFromParent)(eGui2);
1739
+ });
1740
+ }
1741
+ return comp;
1742
+ };
1743
+ if (includeSelection) {
1744
+ const checkboxSelectionComp = cellCtrl.createSelectionCheckbox();
1745
+ addComp(checkboxSelectionComp);
1746
+ }
1747
+ if (includeDndSource) {
1748
+ addComp(cellCtrl.createDndSource());
1749
+ }
1750
+ if (includeRowDrag) {
1751
+ addComp(cellCtrl.createRowDragComp());
1752
+ }
1753
+ },
1754
+ [cellCtrl, context, includeDndSource, includeRowDrag, includeSelection]
1755
+ );
1756
+ const setRef2 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((eRef) => {
1757
+ eGui.current = eRef;
1758
+ compBean.current = eRef ? context.createBean(new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._EmptyBean()) : context.destroyBean(compBean.current);
1759
+ if (!eRef || !cellCtrl) {
1760
+ return;
1761
+ }
1762
+ const compProxy = {
1763
+ addOrRemoveCssClass: (name, on) => cssClassManager.current.addOrRemoveCssClass(name, on),
1764
+ setUserStyles: (styles) => setUserStyles(styles),
1765
+ getFocusableElement: () => eGui.current,
1766
+ setIncludeSelection: (include) => setIncludeSelection(include),
1767
+ setIncludeRowDrag: (include) => setIncludeRowDrag(include),
1768
+ setIncludeDndSource: (include) => setIncludeDndSource(include),
1769
+ getCellEditor: () => cellEditorRef.current || null,
1770
+ getCellRenderer: () => cellRendererRef.current ?? jsCellRendererRef.current,
1771
+ getParentOfValue: () => eCellValue.current ?? eCellWrapper.current ?? eGui.current,
1772
+ setRenderDetails: (compDetails, value, force) => {
1773
+ setRenderDetails((prev) => {
1774
+ if (prev?.compDetails !== compDetails || prev?.value !== value || prev?.force !== force) {
1775
+ return {
1776
+ value,
1777
+ compDetails,
1778
+ force
1779
+ };
1780
+ } else {
1781
+ return prev;
1782
+ }
1783
+ });
1784
+ },
1785
+ setEditDetails: (compDetails, popup, popupPosition, reactiveCustomComponents) => {
1786
+ if (compDetails) {
1787
+ let compProxy2 = void 0;
1788
+ if (reactiveCustomComponents) {
1789
+ compProxy2 = new CellEditorComponentProxy(
1790
+ compDetails.params,
1791
+ () => setRenderKey((prev) => prev + 1)
1792
+ );
1793
+ } else if (compDetails.componentFromFramework) {
1794
+ warnReactiveCustomComponents();
1795
+ }
1796
+ setEditDetails({
1797
+ compDetails,
1798
+ popup,
1799
+ popupPosition,
1800
+ compProxy: compProxy2
1801
+ });
1802
+ if (!popup) {
1803
+ setRenderDetails(void 0);
1804
+ }
1805
+ } else {
1806
+ setEditDetails((editDetails2) => {
1807
+ if (editDetails2?.compProxy) {
1808
+ cellEditorRef.current = void 0;
1809
+ }
1810
+ return void 0;
1811
+ });
1812
+ }
1813
+ }
1814
+ };
1815
+ const cellWrapperOrUndefined = eCellWrapper.current || void 0;
1816
+ cellCtrl.setComp(compProxy, eRef, cellWrapperOrUndefined, printLayout, editingRow, compBean.current);
1817
+ }, []);
1818
+ const reactCellRendererStateless = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
1819
+ const res = renderDetails?.compDetails?.componentFromFramework && isComponentStateless(renderDetails.compDetails.componentClass);
1820
+ return !!res;
1821
+ }, [renderDetails]);
1822
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(() => {
1823
+ if (!eGui.current) {
1824
+ return;
1825
+ }
1826
+ cssClassManager.current.addOrRemoveCssClass("ag-cell-value", !showCellWrapper);
1827
+ cssClassManager.current.addOrRemoveCssClass("ag-cell-inline-editing", !!editDetails && !editDetails.popup);
1828
+ cssClassManager.current.addOrRemoveCssClass("ag-cell-popup-editing", !!editDetails && !!editDetails.popup);
1829
+ cssClassManager.current.addOrRemoveCssClass("ag-cell-not-inline-editing", !editDetails || !!editDetails.popup);
1830
+ cellCtrl.getRowCtrl()?.setInlineEditingCss();
1831
+ if (cellCtrl.shouldRestoreFocus() && !cellCtrl.isEditing()) {
1832
+ eGui.current.focus({ preventScroll: true });
1833
+ }
1834
+ });
1835
+ const showContents = () => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, renderDetails != null && jsxShowValue(
1836
+ renderDetails,
1837
+ renderKey,
1838
+ instanceId,
1839
+ cellRendererRef,
1840
+ showCellWrapper,
1841
+ reactCellRendererStateless,
1842
+ setCellValueRef
1843
+ ), editDetails != null && jsxEditValue(editDetails, setCellEditorRef, eGui.current, cellCtrl, jsEditorComp));
1844
+ const onBlur = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => cellCtrl.onFocusOut(), []);
1845
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: setRef2, style: userStyles, role: cellAriaRole, "col-id": colIdSanitised, onBlur }, showCellWrapper ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "ag-cell-wrapper", role: "presentation", ref: setCellWrapperRef }, showContents()) : showContents());
1846
+ };
1847
+ var cellComp_default = (0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(CellComp);
1848
+
1849
+ // packages/ag-grid-react/src/reactUi/rows/rowComp.tsx
1850
+ var RowComp = ({ rowCtrl, containerType }) => {
1851
+ const { context, gos } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BeansContext);
1852
+ const compBean = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1853
+ const domOrderRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(rowCtrl.getDomOrder());
1854
+ const isFullWidth = rowCtrl.isFullWidth();
1855
+ const isDisplayed = rowCtrl.getRowNode().displayed;
1856
+ const [rowIndex, setRowIndex] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => isDisplayed ? rowCtrl.getRowIndex() : null);
1857
+ const [rowId, setRowId] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => rowCtrl.getRowId());
1858
+ const [rowBusinessKey, setRowBusinessKey] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => rowCtrl.getBusinessKey());
1859
+ const [userStyles, setUserStyles] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => rowCtrl.getRowStyles());
1860
+ const cellCtrlsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1861
+ const prevCellCtrlsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1862
+ const [cellCtrls, setCellCtrls] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => null);
1863
+ const [fullWidthCompDetails, setFullWidthCompDetails] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1864
+ const [top, setTop] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(
1865
+ () => isDisplayed ? rowCtrl.getInitialRowTop(containerType) : void 0
1866
+ );
1867
+ const [transform, setTransform] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(
1868
+ () => isDisplayed ? rowCtrl.getInitialTransform(containerType) : void 0
1869
+ );
1870
+ const eGui = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1871
+ const fullWidthCompRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1872
+ const autoHeightSetup = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
1873
+ const [autoHeightSetupAttempt, setAutoHeightSetupAttempt] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
1874
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1875
+ if (autoHeightSetup.current || !fullWidthCompDetails || autoHeightSetupAttempt > 10) {
1876
+ return;
1877
+ }
1878
+ const eChild = eGui.current?.firstChild;
1879
+ if (eChild) {
1880
+ rowCtrl.setupDetailRowAutoHeight(eChild);
1881
+ autoHeightSetup.current = true;
1882
+ } else {
1883
+ setAutoHeightSetupAttempt((prev) => prev + 1);
1884
+ }
1885
+ }, [fullWidthCompDetails, autoHeightSetupAttempt]);
1886
+ const cssClassManager = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1887
+ if (!cssClassManager.current) {
1888
+ cssClassManager.current = new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.CssClassManager(() => eGui.current);
1889
+ }
1890
+ const setRef2 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((eRef) => {
1891
+ eGui.current = eRef;
1892
+ compBean.current = eRef ? context.createBean(new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._EmptyBean()) : context.destroyBean(compBean.current);
1893
+ if (!eRef) {
1894
+ rowCtrl.unsetComp(containerType);
1895
+ return;
1896
+ }
1897
+ if (!rowCtrl.isAlive()) {
1898
+ return;
1899
+ }
1900
+ const compProxy = {
1901
+ // the rowTop is managed by state, instead of direct style manipulation by rowCtrl (like all the other styles)
1902
+ // as we need to have an initial value when it's placed into he DOM for the first time, for animation to work.
1903
+ setTop,
1904
+ setTransform,
1905
+ // i found using React for managing classes at the row level was to slow, as modifying classes caused a lot of
1906
+ // React code to execute, so avoiding React for managing CSS Classes made the grid go much faster.
1907
+ addOrRemoveCssClass: (name, on) => cssClassManager.current.addOrRemoveCssClass(name, on),
1908
+ setDomOrder: (domOrder) => domOrderRef.current = domOrder,
1909
+ setRowIndex,
1910
+ setRowId,
1911
+ setRowBusinessKey,
1912
+ setUserStyles,
1913
+ // if we don't maintain the order, then cols will be ripped out and into the dom
1914
+ // when cols reordered, which would stop the CSS transitions from working
1915
+ setCellCtrls: (next, useFlushSync) => {
1916
+ prevCellCtrlsRef.current = cellCtrlsRef.current;
1917
+ const nextCells = getNextValueIfDifferent(prevCellCtrlsRef.current, next, domOrderRef.current);
1918
+ if (nextCells !== prevCellCtrlsRef.current) {
1919
+ cellCtrlsRef.current = nextCells;
1920
+ agFlushSync(useFlushSync, () => setCellCtrls(nextCells));
1921
+ }
1922
+ },
1923
+ showFullWidth: (compDetails) => setFullWidthCompDetails(compDetails),
1924
+ getFullWidthCellRenderer: () => fullWidthCompRef.current,
1925
+ refreshFullWidth: (getUpdatedParams) => {
1926
+ if (canRefreshFullWidthRef.current) {
1927
+ setFullWidthCompDetails((prevFullWidthCompDetails) => ({
1928
+ ...prevFullWidthCompDetails,
1929
+ params: getUpdatedParams()
1930
+ }));
1931
+ return true;
1932
+ } else {
1933
+ if (!fullWidthCompRef.current || !fullWidthCompRef.current.refresh) {
1934
+ return false;
1935
+ }
1936
+ return fullWidthCompRef.current.refresh(getUpdatedParams());
1937
+ }
1938
+ }
1939
+ };
1940
+ rowCtrl.setComp(compProxy, eRef, containerType, compBean.current);
1941
+ }, []);
1942
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(
1943
+ () => showJsComp(fullWidthCompDetails, context, eGui.current, fullWidthCompRef),
1944
+ [fullWidthCompDetails]
1945
+ );
1946
+ const rowStyles = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
1947
+ const res = { top, transform };
1948
+ Object.assign(res, userStyles);
1949
+ return res;
1950
+ }, [top, transform, userStyles]);
1951
+ const showFullWidthFramework = isFullWidth && fullWidthCompDetails?.componentFromFramework;
1952
+ const showCells = !isFullWidth && cellCtrls != null;
1953
+ const reactFullWidthCellRendererStateless = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
1954
+ const res = fullWidthCompDetails?.componentFromFramework && isComponentStateless(fullWidthCompDetails.componentClass);
1955
+ return !!res;
1956
+ }, [fullWidthCompDetails]);
1957
+ const canRefreshFullWidthRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
1958
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1959
+ canRefreshFullWidthRef.current = reactFullWidthCellRendererStateless && !!fullWidthCompDetails && !!gos.get("reactiveCustomComponents");
1960
+ }, [reactFullWidthCellRendererStateless, fullWidthCompDetails]);
1961
+ const showCellsJsx = () => cellCtrls?.map((cellCtrl) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
1962
+ cellComp_default,
1963
+ {
1964
+ cellCtrl,
1965
+ editingRow: rowCtrl.isEditing(),
1966
+ printLayout: rowCtrl.isPrintLayout(),
1967
+ key: cellCtrl.instanceId
1968
+ }
1969
+ ));
1970
+ const showFullWidthFrameworkJsx = () => {
1971
+ const FullWidthComp = fullWidthCompDetails.componentClass;
1972
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, reactFullWidthCellRendererStateless ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(FullWidthComp, { ...fullWidthCompDetails.params }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(FullWidthComp, { ...fullWidthCompDetails.params, ref: fullWidthCompRef }));
1973
+ };
1974
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
1975
+ "div",
1976
+ {
1977
+ ref: setRef2,
1978
+ role: "row",
1979
+ style: rowStyles,
1980
+ "row-index": rowIndex,
1981
+ "row-id": rowId,
1982
+ "row-business-key": rowBusinessKey
1983
+ },
1984
+ showCells && showCellsJsx(),
1985
+ showFullWidthFramework && showFullWidthFrameworkJsx()
1986
+ );
1987
+ };
1988
+ var rowComp_default = (0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(RowComp);
1989
+
1990
+ // packages/ag-grid-react/src/reactUi/rows/rowContainerComp.tsx
1991
+ var RowContainerComp = ({ name }) => {
1992
+ const { context } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BeansContext);
1993
+ const containerOptions = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._getRowContainerOptions)(name), [name]);
1994
+ const eViewport = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1995
+ const eContainer = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1996
+ const rowCtrlsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]);
1997
+ const prevRowCtrlsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]);
1998
+ const [rowCtrlsOrdered, setRowCtrlsOrdered] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => []);
1999
+ const domOrderRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
2000
+ const rowContainerCtrlRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
2001
+ const viewportClasses = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => classesList(containerOptions.viewport), [containerOptions]);
2002
+ const containerClasses = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => classesList(containerOptions.container), [containerOptions]);
2003
+ const isCenter = containerOptions.type === "center";
2004
+ const topLevelRef = isCenter ? eViewport : eContainer;
2005
+ reactComment_default(" AG Row Container " + name + " ", topLevelRef);
2006
+ const areElementsReady = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
2007
+ if (isCenter) {
2008
+ return eViewport.current != null && eContainer.current != null;
2009
+ }
2010
+ return eContainer.current != null;
2011
+ }, []);
2012
+ const areElementsRemoved = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
2013
+ if (isCenter) {
2014
+ return eViewport.current == null && eContainer.current == null;
2015
+ }
2016
+ return eContainer.current == null;
2017
+ }, []);
2018
+ const setRef2 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
2019
+ if (areElementsRemoved()) {
2020
+ rowContainerCtrlRef.current = context.destroyBean(rowContainerCtrlRef.current);
2021
+ }
2022
+ if (areElementsReady()) {
2023
+ const updateRowCtrlsOrdered = (useFlushSync) => {
2024
+ const next = getNextValueIfDifferent(
2025
+ prevRowCtrlsRef.current,
2026
+ rowCtrlsRef.current,
2027
+ domOrderRef.current
2028
+ );
2029
+ if (next !== prevRowCtrlsRef.current) {
2030
+ prevRowCtrlsRef.current = next;
2031
+ agFlushSync(useFlushSync, () => setRowCtrlsOrdered(next));
2032
+ }
2033
+ };
2034
+ const compProxy = {
2035
+ setHorizontalScroll: (offset) => {
2036
+ if (eViewport.current) {
2037
+ eViewport.current.scrollLeft = offset;
2038
+ }
2039
+ },
2040
+ setViewportHeight: (height) => {
2041
+ if (eViewport.current) {
2042
+ eViewport.current.style.height = height;
2043
+ }
2044
+ },
2045
+ setRowCtrls: ({ rowCtrls, useFlushSync }) => {
2046
+ const useFlush = !!useFlushSync && rowCtrlsRef.current.length > 0 && rowCtrls.length > 0;
2047
+ rowCtrlsRef.current = rowCtrls;
2048
+ updateRowCtrlsOrdered(useFlush);
2049
+ },
2050
+ setDomOrder: (domOrder) => {
2051
+ if (domOrderRef.current != domOrder) {
2052
+ domOrderRef.current = domOrder;
2053
+ updateRowCtrlsOrdered(false);
2054
+ }
2055
+ },
2056
+ setContainerWidth: (width) => {
2057
+ if (eContainer.current) {
2058
+ eContainer.current.style.width = width;
2059
+ }
2060
+ },
2061
+ setOffsetTop: (offset) => {
2062
+ if (eContainer.current) {
2063
+ eContainer.current.style.transform = `translateY(${offset})`;
2064
+ }
2065
+ }
2066
+ };
2067
+ rowContainerCtrlRef.current = context.createBean(new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.RowContainerCtrl(name));
2068
+ rowContainerCtrlRef.current.setComp(compProxy, eContainer.current, eViewport.current);
2069
+ }
2070
+ }, [areElementsReady, areElementsRemoved]);
2071
+ const setContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(
2072
+ (e) => {
2073
+ eContainer.current = e;
2074
+ setRef2();
2075
+ },
2076
+ [setRef2]
2077
+ );
2078
+ const setViewportRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(
2079
+ (e) => {
2080
+ eViewport.current = e;
2081
+ setRef2();
2082
+ },
2083
+ [setRef2]
2084
+ );
2085
+ const buildContainer = () => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: containerClasses, ref: setContainerRef, role: "rowgroup" }, rowCtrlsOrdered.map((rowCtrl) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(rowComp_default, { rowCtrl, containerType: containerOptions.type, key: rowCtrl.instanceId })));
2086
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, isCenter ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: viewportClasses, ref: setViewportRef, role: "presentation" }, buildContainer()) : buildContainer());
2087
+ };
2088
+ var rowContainerComp_default = (0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(RowContainerComp);
2089
+
2090
+ // packages/ag-grid-react/src/reactUi/gridBodyComp.tsx
2091
+ var GridBodyComp = () => {
2092
+ const { context, resizeObserverService } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BeansContext);
2093
+ const [rowAnimationClass, setRowAnimationClass] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
2094
+ const [topHeight, setTopHeight] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
2095
+ const [bottomHeight, setBottomHeight] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
2096
+ const [stickyTopHeight, setStickyTopHeight] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("0px");
2097
+ const [stickyTopTop, setStickyTopTop] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("0px");
2098
+ const [stickyTopWidth, setStickyTopWidth] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("100%");
2099
+ const [stickyBottomHeight, setStickyBottomHeight] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("0px");
2100
+ const [stickyBottomBottom, setStickyBottomBottom] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("0px");
2101
+ const [stickyBottomWidth, setStickyBottomWidth] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("100%");
2102
+ const [topDisplay, setTopDisplay] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
2103
+ const [bottomDisplay, setBottomDisplay] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
2104
+ const [forceVerticalScrollClass, setForceVerticalScrollClass] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
2105
+ const [topAndBottomOverflowY, setTopAndBottomOverflowY] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
2106
+ const [cellSelectableCss, setCellSelectableCss] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
2107
+ const [layoutClass, setLayoutClass] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("ag-layout-normal");
2108
+ const cssClassManager = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
2109
+ if (!cssClassManager.current) {
2110
+ cssClassManager.current = new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.CssClassManager(() => eRoot.current);
2111
+ }
2112
+ const eRoot = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
2113
+ const eTop = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
2114
+ const eStickyTop = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
2115
+ const eStickyBottom = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
2116
+ const eBody = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
2117
+ const eBodyViewport = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
2118
+ const eBottom = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
2119
+ const beansToDestroy = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]);
2120
+ const destroyFuncs = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]);
2121
+ reactComment_default(" AG Grid Body ", eRoot);
2122
+ reactComment_default(" AG Pinned Top ", eTop);
2123
+ reactComment_default(" AG Sticky Top ", eStickyTop);
2124
+ reactComment_default(" AG Middle ", eBodyViewport);
2125
+ reactComment_default(" AG Pinned Bottom ", eBottom);
2126
+ const setRef2 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((eRef) => {
2127
+ eRoot.current = eRef;
2128
+ if (!eRef) {
2129
+ beansToDestroy.current = context.destroyBeans(beansToDestroy.current);
2130
+ destroyFuncs.current.forEach((f) => f());
2131
+ destroyFuncs.current = [];
2132
+ return;
2133
+ }
2134
+ if (!context) {
2135
+ return;
2136
+ }
2137
+ const attachToDom = (eParent, eChild) => {
2138
+ eParent.appendChild(eChild);
2139
+ destroyFuncs.current.push(() => eParent.removeChild(eChild));
2140
+ };
2141
+ const newComp = (compClass) => {
2142
+ const comp = context.createBean(new compClass());
2143
+ beansToDestroy.current.push(comp);
2144
+ return comp;
2145
+ };
2146
+ const addComp = (eParent, compClass, comment) => {
2147
+ attachToDom(eParent, document.createComment(comment));
2148
+ attachToDom(eParent, newComp(compClass).getGui());
2149
+ };
2150
+ addComp(eRef, ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.FakeHScrollComp, " AG Fake Horizontal Scroll ");
2151
+ addComp(eRef, ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.OverlayWrapperComponent, " AG Overlay Wrapper ");
2152
+ if (eBody.current) {
2153
+ addComp(eBody.current, ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.FakeVScrollComp, " AG Fake Vertical Scroll ");
2154
+ }
2155
+ const compProxy = {
2156
+ setRowAnimationCssOnBodyViewport: setRowAnimationClass,
2157
+ setColumnCount: (count) => {
2158
+ if (eRoot.current) {
2159
+ (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._setAriaColCount)(eRoot.current, count);
2160
+ }
2161
+ },
2162
+ setRowCount: (count) => {
2163
+ if (eRoot.current) {
2164
+ (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._setAriaRowCount)(eRoot.current, count);
2165
+ }
2166
+ },
2167
+ setTopHeight,
2168
+ setBottomHeight,
2169
+ setStickyTopHeight,
2170
+ setStickyTopTop,
2171
+ setStickyTopWidth,
2172
+ setTopDisplay,
2173
+ setBottomDisplay,
2174
+ setColumnMovingCss: (cssClass, flag) => cssClassManager.current.addOrRemoveCssClass(cssClass, flag),
2175
+ updateLayoutClasses: setLayoutClass,
2176
+ setAlwaysVerticalScrollClass: setForceVerticalScrollClass,
2177
+ setPinnedTopBottomOverflowY: setTopAndBottomOverflowY,
2178
+ setCellSelectableCss: (cssClass, flag) => setCellSelectableCss(flag ? cssClass : null),
2179
+ setBodyViewportWidth: (width) => {
2180
+ if (eBodyViewport.current) {
2181
+ eBodyViewport.current.style.width = width;
2182
+ }
2183
+ },
2184
+ registerBodyViewportResizeListener: (listener) => {
2185
+ if (eBodyViewport.current) {
2186
+ const unsubscribeFromResize = resizeObserverService.observeResize(eBodyViewport.current, listener);
2187
+ destroyFuncs.current.push(() => unsubscribeFromResize());
2188
+ }
2189
+ },
2190
+ setStickyBottomHeight,
2191
+ setStickyBottomBottom,
2192
+ setStickyBottomWidth
2193
+ };
2194
+ const ctrl = context.createBean(new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.GridBodyCtrl());
2195
+ beansToDestroy.current.push(ctrl);
2196
+ ctrl.setComp(
2197
+ compProxy,
2198
+ eRef,
2199
+ eBodyViewport.current,
2200
+ eTop.current,
2201
+ eBottom.current,
2202
+ eStickyTop.current,
2203
+ eStickyBottom.current
2204
+ );
2205
+ }, []);
2206
+ const rootClasses = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => classesList("ag-root", "ag-unselectable", layoutClass), [layoutClass]);
2207
+ const bodyViewportClasses = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(
2208
+ () => classesList(
2209
+ "ag-body-viewport",
2210
+ rowAnimationClass,
2211
+ layoutClass,
2212
+ forceVerticalScrollClass,
2213
+ cellSelectableCss
2214
+ ),
2215
+ [rowAnimationClass, layoutClass, forceVerticalScrollClass, cellSelectableCss]
2216
+ );
2217
+ const bodyClasses = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => classesList("ag-body", layoutClass), [layoutClass]);
2218
+ const topClasses = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => classesList("ag-floating-top", cellSelectableCss), [cellSelectableCss]);
2219
+ const stickyTopClasses = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => classesList("ag-sticky-top", cellSelectableCss), [cellSelectableCss]);
2220
+ const stickyBottomClasses = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(
2221
+ () => classesList("ag-sticky-bottom", stickyBottomHeight === "0px" ? "ag-hidden" : null, cellSelectableCss),
2222
+ [cellSelectableCss, stickyBottomHeight]
2223
+ );
2224
+ const bottomClasses = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => classesList("ag-floating-bottom", cellSelectableCss), [cellSelectableCss]);
2225
+ const topStyle = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(
2226
+ () => ({
2227
+ height: topHeight,
2228
+ minHeight: topHeight,
2229
+ display: topDisplay,
2230
+ overflowY: topAndBottomOverflowY
2231
+ }),
2232
+ [topHeight, topDisplay, topAndBottomOverflowY]
2233
+ );
2234
+ const stickyTopStyle = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(
2235
+ () => ({
2236
+ height: stickyTopHeight,
2237
+ top: stickyTopTop,
2238
+ width: stickyTopWidth
2239
+ }),
2240
+ [stickyTopHeight, stickyTopTop, stickyTopWidth]
2241
+ );
2242
+ const stickyBottomStyle = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(
2243
+ () => ({
2244
+ height: stickyBottomHeight,
2245
+ bottom: stickyBottomBottom,
2246
+ width: stickyBottomWidth
2247
+ }),
2248
+ [stickyBottomHeight, stickyBottomBottom, stickyBottomWidth]
2249
+ );
2250
+ const bottomStyle = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(
2251
+ () => ({
2252
+ height: bottomHeight,
2253
+ minHeight: bottomHeight,
2254
+ display: bottomDisplay,
2255
+ overflowY: topAndBottomOverflowY
2256
+ }),
2257
+ [bottomHeight, bottomDisplay, topAndBottomOverflowY]
2258
+ );
2259
+ const createRowContainer = (container) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(rowContainerComp_default, { name: container, key: `${container}-container` });
2260
+ const createSection = ({
2261
+ section,
2262
+ children,
2263
+ className,
2264
+ style
2265
+ }) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: section, className, role: "presentation", style }, children.map(createRowContainer));
2266
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: setRef2, className: rootClasses, role: "treegrid" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(gridHeaderComp_default, null), createSection({
2267
+ section: eTop,
2268
+ className: topClasses,
2269
+ style: topStyle,
2270
+ children: ["topLeft", "topCenter", "topRight", "topFullWidth"]
2271
+ }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: bodyClasses, ref: eBody, role: "presentation" }, createSection({
2272
+ section: eBodyViewport,
2273
+ className: bodyViewportClasses,
2274
+ children: ["left", "center", "right", "fullWidth"]
2275
+ })), createSection({
2276
+ section: eStickyTop,
2277
+ className: stickyTopClasses,
2278
+ style: stickyTopStyle,
2279
+ children: ["stickyTopLeft", "stickyTopCenter", "stickyTopRight", "stickyTopFullWidth"]
2280
+ }), createSection({
2281
+ section: eStickyBottom,
2282
+ className: stickyBottomClasses,
2283
+ style: stickyBottomStyle,
2284
+ children: ["stickyBottomLeft", "stickyBottomCenter", "stickyBottomRight", "stickyBottomFullWidth"]
2285
+ }), createSection({
2286
+ section: eBottom,
2287
+ className: bottomClasses,
2288
+ style: bottomStyle,
2289
+ children: ["bottomLeft", "bottomCenter", "bottomRight", "bottomFullWidth"]
2290
+ }));
2291
+ };
2292
+ var gridBodyComp_default = (0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(GridBodyComp);
2293
+
2294
+ // packages/ag-grid-react/src/reactUi/tabGuardComp.tsx
2295
+
2296
+
2297
+ var TabGuardCompRef = (props, forwardRef4) => {
2298
+ const { children, eFocusableElement, onTabKeyDown, gridCtrl, forceFocusOutWhenTabGuardsAreEmpty } = props;
2299
+ const { context } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BeansContext);
2300
+ const topTabGuardRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
2301
+ const bottomTabGuardRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
2302
+ const tabGuardCtrlRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
2303
+ const setTabIndex = (value) => {
2304
+ const processedValue = value == null ? void 0 : parseInt(value, 10).toString();
2305
+ [topTabGuardRef, bottomTabGuardRef].forEach((tabGuard) => {
2306
+ if (processedValue === void 0) {
2307
+ tabGuard.current?.removeAttribute("tabindex");
2308
+ } else {
2309
+ tabGuard.current?.setAttribute("tabindex", processedValue);
2310
+ }
2311
+ });
2312
+ };
2313
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(forwardRef4, () => ({
2314
+ forceFocusOutOfContainer(up) {
2315
+ tabGuardCtrlRef.current?.forceFocusOutOfContainer(up);
2316
+ }
2317
+ }));
2318
+ const setupCtrl = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
2319
+ const topTabGuard = topTabGuardRef.current;
2320
+ const bottomTabGuard = bottomTabGuardRef.current;
2321
+ if (!topTabGuard && !bottomTabGuard) {
2322
+ tabGuardCtrlRef.current = context.destroyBean(tabGuardCtrlRef.current);
2323
+ return;
2324
+ }
2325
+ if (topTabGuard && bottomTabGuard) {
2326
+ const compProxy = {
2327
+ setTabIndex
2328
+ };
2329
+ tabGuardCtrlRef.current = context.createBean(
2330
+ new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.TabGuardCtrl({
2331
+ comp: compProxy,
2332
+ eTopGuard: topTabGuard,
2333
+ eBottomGuard: bottomTabGuard,
2334
+ eFocusableElement,
2335
+ onTabKeyDown,
2336
+ forceFocusOutWhenTabGuardsAreEmpty,
2337
+ focusInnerElement: (fromBottom) => gridCtrl.focusInnerElement(fromBottom)
2338
+ })
2339
+ );
2340
+ }
2341
+ }, []);
2342
+ const setTopRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(
2343
+ (e) => {
2344
+ topTabGuardRef.current = e;
2345
+ setupCtrl();
2346
+ },
2347
+ [setupCtrl]
2348
+ );
2349
+ const setBottomRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(
2350
+ (e) => {
2351
+ bottomTabGuardRef.current = e;
2352
+ setupCtrl();
2353
+ },
2354
+ [setupCtrl]
2355
+ );
2356
+ const createTabGuard = (side) => {
2357
+ const className = side === "top" ? ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.TabGuardClassNames.TAB_GUARD_TOP : ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.TabGuardClassNames.TAB_GUARD_BOTTOM;
2358
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
2359
+ "div",
2360
+ {
2361
+ className: `${ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.TabGuardClassNames.TAB_GUARD} ${className}`,
2362
+ role: "presentation",
2363
+ ref: side === "top" ? setTopRef : setBottomRef
2364
+ }
2365
+ );
2366
+ };
2367
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, createTabGuard("top"), children, createTabGuard("bottom"));
2368
+ };
2369
+ var TabGuardComp = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(TabGuardCompRef);
2370
+ var tabGuardComp_default = (0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(TabGuardComp);
2371
+
2372
+ // packages/ag-grid-react/src/reactUi/gridComp.tsx
2373
+ var GridComp = ({ context }) => {
2374
+ const [rtlClass, setRtlClass] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
2375
+ const [gridThemeClass, setGridThemeClass] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
2376
+ const [layoutClass, setLayoutClass] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
2377
+ const [cursor, setCursor] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
2378
+ const [userSelect, setUserSelect] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
2379
+ const [initialised, setInitialised] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
2380
+ const [tabGuardReady, setTabGuardReady] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
2381
+ const gridCtrlRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
2382
+ const eRootWrapperRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
2383
+ const tabGuardRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
2384
+ const [eGridBodyParent, setGridBodyParent] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
2385
+ const focusInnerElementRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(() => void 0);
2386
+ const paginationCompRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
2387
+ const focusableContainersRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]);
2388
+ const onTabKeyDown = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => void 0, []);
2389
+ const beans = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
2390
+ if (context.isDestroyed()) {
2391
+ return null;
2392
+ }
2393
+ return context.getBeans();
2394
+ }, [context]);
2395
+ reactComment_default(" AG Grid ", eRootWrapperRef);
2396
+ const setRef2 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((eRef) => {
2397
+ eRootWrapperRef.current = eRef;
2398
+ gridCtrlRef.current = eRef ? context.createBean(new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.GridCtrl()) : context.destroyBean(gridCtrlRef.current);
2399
+ if (!eRef || context.isDestroyed()) {
2400
+ return;
2401
+ }
2402
+ const gridCtrl = gridCtrlRef.current;
2403
+ focusInnerElementRef.current = gridCtrl.focusInnerElement.bind(gridCtrl);
2404
+ const compProxy = {
2405
+ destroyGridUi: () => {
2406
+ },
2407
+ // do nothing, as framework users destroy grid by removing the comp
2408
+ setRtlClass,
2409
+ setGridThemeClass,
2410
+ forceFocusOutOfContainer: (up) => {
2411
+ if (!up && paginationCompRef.current?.isDisplayed()) {
2412
+ paginationCompRef.current.forceFocusOutOfContainer(up);
2413
+ return;
2414
+ }
2415
+ tabGuardRef.current?.forceFocusOutOfContainer(up);
2416
+ },
2417
+ updateLayoutClasses: setLayoutClass,
2418
+ getFocusableContainers: () => {
2419
+ const comps = [];
2420
+ const gridBodyCompEl = eRootWrapperRef.current?.querySelector(".ag-root");
2421
+ if (gridBodyCompEl) {
2422
+ comps.push({ getGui: () => gridBodyCompEl });
2423
+ }
2424
+ focusableContainersRef.current.forEach((comp) => {
2425
+ if (comp.isDisplayed()) {
2426
+ comps.push(comp);
2427
+ }
2428
+ });
2429
+ return comps;
2430
+ },
2431
+ setCursor,
2432
+ setUserSelect
2433
+ };
2434
+ gridCtrl.setComp(compProxy, eRef, eRef);
2435
+ setInitialised(true);
2436
+ }, []);
2437
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
2438
+ const gridCtrl = gridCtrlRef.current;
2439
+ const eRootWrapper = eRootWrapperRef.current;
2440
+ if (!tabGuardReady || !beans || !gridCtrl || !eGridBodyParent || !eRootWrapper) {
2441
+ return;
2442
+ }
2443
+ const beansToDestroy = [];
2444
+ const {
2445
+ watermarkSelector,
2446
+ paginationSelector,
2447
+ sideBarSelector,
2448
+ statusBarSelector,
2449
+ gridHeaderDropZonesSelector
2450
+ } = gridCtrl.getOptionalSelectors();
2451
+ const additionalEls = [];
2452
+ if (gridHeaderDropZonesSelector) {
2453
+ const headerDropZonesComp = context.createBean(new gridHeaderDropZonesSelector.component());
2454
+ const eGui = headerDropZonesComp.getGui();
2455
+ eRootWrapper.insertAdjacentElement("afterbegin", eGui);
2456
+ additionalEls.push(eGui);
2457
+ beansToDestroy.push(headerDropZonesComp);
2458
+ }
2459
+ if (sideBarSelector) {
2460
+ const sideBarComp = context.createBean(new sideBarSelector.component());
2461
+ const eGui = sideBarComp.getGui();
2462
+ const bottomTabGuard = eGridBodyParent.querySelector(".ag-tab-guard-bottom");
2463
+ if (bottomTabGuard) {
2464
+ bottomTabGuard.insertAdjacentElement("beforebegin", eGui);
2465
+ additionalEls.push(eGui);
2466
+ }
2467
+ beansToDestroy.push(sideBarComp);
2468
+ focusableContainersRef.current.push(sideBarComp);
2469
+ }
2470
+ const addComponentToDom = (component) => {
2471
+ const comp = context.createBean(new component());
2472
+ const eGui = comp.getGui();
2473
+ eRootWrapper.insertAdjacentElement("beforeend", eGui);
2474
+ additionalEls.push(eGui);
2475
+ beansToDestroy.push(comp);
2476
+ return comp;
2477
+ };
2478
+ if (statusBarSelector) {
2479
+ addComponentToDom(statusBarSelector.component);
2480
+ }
2481
+ if (paginationSelector) {
2482
+ const paginationComp = addComponentToDom(paginationSelector.component);
2483
+ paginationCompRef.current = paginationComp;
2484
+ focusableContainersRef.current.push(paginationComp);
2485
+ }
2486
+ if (watermarkSelector) {
2487
+ addComponentToDom(watermarkSelector.component);
2488
+ }
2489
+ return () => {
2490
+ context.destroyBeans(beansToDestroy);
2491
+ additionalEls.forEach((el) => {
2492
+ el.parentElement?.removeChild(el);
2493
+ });
2494
+ };
2495
+ }, [tabGuardReady, eGridBodyParent, beans]);
2496
+ const rootWrapperClasses = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(
2497
+ () => classesList("ag-root-wrapper", rtlClass, gridThemeClass, layoutClass),
2498
+ [rtlClass, gridThemeClass, layoutClass]
2499
+ );
2500
+ const rootWrapperBodyClasses = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(
2501
+ () => classesList("ag-root-wrapper-body", "ag-focus-managed", layoutClass),
2502
+ [layoutClass]
2503
+ );
2504
+ const topStyle = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(
2505
+ () => ({
2506
+ userSelect: userSelect != null ? userSelect : "",
2507
+ WebkitUserSelect: userSelect != null ? userSelect : "",
2508
+ cursor: cursor != null ? cursor : ""
2509
+ }),
2510
+ [userSelect, cursor]
2511
+ );
2512
+ const setTabGuardCompRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((ref) => {
2513
+ tabGuardRef.current = ref;
2514
+ setTabGuardReady(ref !== null);
2515
+ }, []);
2516
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: setRef2, className: rootWrapperClasses, style: topStyle, role: "presentation" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: rootWrapperBodyClasses, ref: setGridBodyParent, role: "presentation" }, initialised && eGridBodyParent && beans && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(BeansContext.Provider, { value: beans }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
2517
+ tabGuardComp_default,
2518
+ {
2519
+ ref: setTabGuardCompRef,
2520
+ eFocusableElement: eGridBodyParent,
2521
+ onTabKeyDown,
2522
+ gridCtrl: gridCtrlRef.current,
2523
+ forceFocusOutWhenTabGuardsAreEmpty: true
2524
+ },
2525
+ // we wait for initialised before rending the children, so GridComp has created and registered with it's
2526
+ // GridCtrl before we create the child GridBodyComp. Otherwise the GridBodyComp would initialise first,
2527
+ // before we have set the the Layout CSS classes, causing the GridBodyComp to render rows to a grid that
2528
+ // doesn't have it's height specified, which would result if all the rows getting rendered (and if many rows,
2529
+ // hangs the UI)
2530
+ /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(gridBodyComp_default, null)
2531
+ ))));
2532
+ };
2533
+ var gridComp_default = (0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(GridComp);
2534
+
2535
+ // packages/ag-grid-react/src/reactUi/renderStatusService.tsx
2536
+
2537
+ var RenderStatusService = class extends ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.BeanStub {
2538
+ wireBeans(beans) {
2539
+ this.ctrlsService = beans.ctrlsService;
2540
+ }
2541
+ areHeaderCellsRendered() {
2542
+ return this.ctrlsService.getHeaderRowContainerCtrls().every((container) => container.getAllCtrls().every((ctrl) => ctrl.areCellsRendered()));
2543
+ }
2544
+ };
2545
+
2546
+ // packages/ag-grid-react/src/reactUi/agGridReactUi.tsx
2547
+ var AgGridReactUi = (props) => {
2548
+ const apiRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
2549
+ const eGui = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
2550
+ const portalManager = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
2551
+ const destroyFuncs = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]);
2552
+ const whenReadyFuncs = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]);
2553
+ const prevProps = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(props);
2554
+ const frameworkOverridesRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
2555
+ const gridIdRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
2556
+ const ready = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
2557
+ const [context, setContext] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(void 0);
2558
+ const [, setPortalRefresher] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
2559
+ const setRef2 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((eRef) => {
2560
+ eGui.current = eRef;
2561
+ if (!eRef) {
2562
+ destroyFuncs.current.forEach((f) => f());
2563
+ destroyFuncs.current.length = 0;
2564
+ return;
2565
+ }
2566
+ const modules = props.modules || [];
2567
+ if (!portalManager.current) {
2568
+ portalManager.current = new PortalManager(
2569
+ () => setPortalRefresher((prev) => prev + 1),
2570
+ props.componentWrappingElement,
2571
+ props.maxComponentCreationTimeMs
2572
+ );
2573
+ destroyFuncs.current.push(() => {
2574
+ portalManager.current?.destroy();
2575
+ portalManager.current = null;
2576
+ });
2577
+ }
2578
+ const mergedGridOps = (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._combineAttributesAndGridOptions)(props.gridOptions, props);
2579
+ const processQueuedUpdates = () => {
2580
+ if (ready.current) {
2581
+ const getFn = () => frameworkOverridesRef.current?.shouldQueueUpdates() ? void 0 : whenReadyFuncs.current.shift();
2582
+ let fn = getFn();
2583
+ while (fn) {
2584
+ fn();
2585
+ fn = getFn();
2586
+ }
2587
+ }
2588
+ };
2589
+ const frameworkOverrides = new ReactFrameworkOverrides(processQueuedUpdates);
2590
+ frameworkOverridesRef.current = frameworkOverrides;
2591
+ const renderStatusService = new RenderStatusService();
2592
+ const gridParams = {
2593
+ providedBeanInstances: {
2594
+ frameworkComponentWrapper: new ReactFrameworkComponentWrapper(
2595
+ portalManager.current,
2596
+ mergedGridOps.reactiveCustomComponents ?? (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._getGlobalGridOption)("reactiveCustomComponents") ?? true
2597
+ ),
2598
+ renderStatusService
2599
+ },
2600
+ modules,
2601
+ frameworkOverrides
2602
+ };
2603
+ const createUiCallback = (context2) => {
2604
+ setContext(context2);
2605
+ context2.createBean(renderStatusService);
2606
+ destroyFuncs.current.push(() => {
2607
+ context2.destroy();
2608
+ });
2609
+ context2.getBean("ctrlsService").whenReady(
2610
+ {
2611
+ addDestroyFunc: (func) => {
2612
+ destroyFuncs.current.push(func);
2613
+ }
2614
+ },
2615
+ () => {
2616
+ if (context2.isDestroyed()) {
2617
+ return;
2618
+ }
2619
+ const api = apiRef.current;
2620
+ if (api) {
2621
+ props.setGridApi?.(api);
2622
+ }
2623
+ }
2624
+ );
2625
+ };
2626
+ const acceptChangesCallback = (context2) => {
2627
+ context2.getBean("ctrlsService").whenReady(
2628
+ {
2629
+ addDestroyFunc: (func) => {
2630
+ destroyFuncs.current.push(func);
2631
+ }
2632
+ },
2633
+ () => {
2634
+ whenReadyFuncs.current.forEach((f) => f());
2635
+ whenReadyFuncs.current.length = 0;
2636
+ ready.current = true;
2637
+ }
2638
+ );
2639
+ };
2640
+ const gridCoreCreator = new ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.GridCoreCreator();
2641
+ mergedGridOps.gridId ?? (mergedGridOps.gridId = gridIdRef.current);
2642
+ apiRef.current = gridCoreCreator.create(
2643
+ eRef,
2644
+ mergedGridOps,
2645
+ createUiCallback,
2646
+ acceptChangesCallback,
2647
+ gridParams
2648
+ );
2649
+ destroyFuncs.current.push(() => {
2650
+ apiRef.current = void 0;
2651
+ });
2652
+ if (apiRef.current) {
2653
+ gridIdRef.current = apiRef.current.getGridId();
2654
+ }
2655
+ }, []);
2656
+ const style = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
2657
+ return {
2658
+ height: "100%",
2659
+ ...props.containerStyle || {}
2660
+ };
2661
+ }, [props.containerStyle]);
2662
+ const processWhenReady = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((func) => {
2663
+ if (ready.current && !frameworkOverridesRef.current?.shouldQueueUpdates()) {
2664
+ func();
2665
+ } else {
2666
+ whenReadyFuncs.current.push(func);
2667
+ }
2668
+ }, []);
2669
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
2670
+ const changes = extractGridPropertyChanges(prevProps.current, props);
2671
+ prevProps.current = props;
2672
+ processWhenReady(() => {
2673
+ if (apiRef.current) {
2674
+ (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._processOnChange)(changes, apiRef.current);
2675
+ }
2676
+ });
2677
+ }, [props]);
2678
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { style, className: props.className, ref: setRef2 }, context && !context.isDestroyed() ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(gridComp_default, { context }) : null, portalManager.current?.getPortals() ?? null);
2679
+ };
2680
+ function extractGridPropertyChanges(prevProps, nextProps) {
2681
+ const changes = {};
2682
+ Object.keys(nextProps).forEach((propKey) => {
2683
+ const propValue = nextProps[propKey];
2684
+ if (prevProps[propKey] !== propValue) {
2685
+ changes[propKey] = propValue;
2686
+ }
2687
+ });
2688
+ return changes;
2689
+ }
2690
+ var ReactFrameworkComponentWrapper = class extends ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.BaseComponentWrapper {
2691
+ constructor(parent, reactiveCustomComponents) {
2692
+ super();
2693
+ this.parent = parent;
2694
+ this.reactiveCustomComponents = reactiveCustomComponents;
2695
+ }
2696
+ createWrapper(UserReactComponent, componentType) {
2697
+ if (this.reactiveCustomComponents) {
2698
+ const getComponentClass = (propertyName) => {
2699
+ switch (propertyName) {
2700
+ case "filter":
2701
+ return FilterComponentWrapper;
2702
+ case "floatingFilterComponent":
2703
+ return FloatingFilterComponentWrapper;
2704
+ case "dateComponent":
2705
+ return DateComponentWrapper;
2706
+ case "dragAndDropImageComponent":
2707
+ return DragAndDropImageComponentWrapper;
2708
+ case "loadingOverlayComponent":
2709
+ return LoadingOverlayComponentWrapper;
2710
+ case "noRowsOverlayComponent":
2711
+ return NoRowsOverlayComponentWrapper;
2712
+ case "statusPanel":
2713
+ return StatusPanelComponentWrapper;
2714
+ case "toolPanel":
2715
+ return ToolPanelComponentWrapper;
2716
+ case "menuItem":
2717
+ return MenuItemComponentWrapper;
2718
+ case "cellRenderer":
2719
+ return CellRendererComponentWrapper;
2720
+ }
2721
+ };
2722
+ const ComponentClass = getComponentClass(componentType.propertyName);
2723
+ if (ComponentClass) {
2724
+ return new ComponentClass(UserReactComponent, this.parent, componentType);
2725
+ }
2726
+ } else {
2727
+ switch (componentType.propertyName) {
2728
+ case "filter":
2729
+ case "floatingFilterComponent":
2730
+ case "dateComponent":
2731
+ case "dragAndDropImageComponent":
2732
+ case "loadingOverlayComponent":
2733
+ case "noRowsOverlayComponent":
2734
+ case "statusPanel":
2735
+ case "toolPanel":
2736
+ case "menuItem":
2737
+ case "cellRenderer":
2738
+ warnReactiveCustomComponents();
2739
+ break;
2740
+ }
2741
+ }
2742
+ const suppressFallbackMethods = !componentType.cellRenderer && componentType.propertyName !== "toolPanel";
2743
+ return new ReactComponent(UserReactComponent, this.parent, componentType, suppressFallbackMethods);
2744
+ }
2745
+ };
2746
+ var DetailCellRenderer = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((props, ref) => {
2747
+ const { ctrlsFactory, context, gos, resizeObserverService, rowModel } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BeansContext);
2748
+ const [cssClasses, setCssClasses] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => new CssClasses());
2749
+ const [gridCssClasses, setGridCssClasses] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => new CssClasses());
2750
+ const [detailGridOptions, setDetailGridOptions] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
2751
+ const [detailRowData, setDetailRowData] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
2752
+ const ctrlRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
2753
+ const eGuiRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
2754
+ const resizeObserverDestroyFunc = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
2755
+ const parentModules = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.ModuleRegistry.__getGridRegisteredModules(props.api.getGridId()), [props]);
2756
+ const topClassName = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => cssClasses.toString() + " ag-details-row", [cssClasses]);
2757
+ const gridClassName = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => gridCssClasses.toString() + " ag-details-grid", [gridCssClasses]);
2758
+ if (ref) {
2759
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(ref, () => ({
2760
+ refresh() {
2761
+ return ctrlRef.current?.refresh() ?? false;
2762
+ }
2763
+ }));
2764
+ }
2765
+ if (props.template) {
2766
+ (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._warnOnce)(
2767
+ "detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://ag-grid.com/react-data-grid/master-detail-custom-detail/"
2768
+ );
2769
+ }
2770
+ const setRef2 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((eRef) => {
2771
+ eGuiRef.current = eRef;
2772
+ if (!eRef) {
2773
+ ctrlRef.current = context.destroyBean(ctrlRef.current);
2774
+ resizeObserverDestroyFunc.current?.();
2775
+ return;
2776
+ }
2777
+ const compProxy = {
2778
+ addOrRemoveCssClass: (name, on) => setCssClasses((prev) => prev.setClass(name, on)),
2779
+ addOrRemoveDetailGridCssClass: (name, on) => setGridCssClasses((prev) => prev.setClass(name, on)),
2780
+ setDetailGrid: (gridOptions) => setDetailGridOptions(gridOptions),
2781
+ setRowData: (rowData) => setDetailRowData(rowData),
2782
+ getGui: () => eGuiRef.current
2783
+ };
2784
+ const ctrl = ctrlsFactory.getInstance("detailCellRenderer");
2785
+ if (!ctrl) {
2786
+ return;
2787
+ }
2788
+ context.createBean(ctrl);
2789
+ ctrl.init(compProxy, props);
2790
+ ctrlRef.current = ctrl;
2791
+ if (gos.get("detailRowAutoHeight")) {
2792
+ const checkRowSizeFunc = () => {
2793
+ if (eGuiRef.current == null) {
2794
+ return;
2795
+ }
2796
+ const clientHeight = eGuiRef.current.clientHeight;
2797
+ if (clientHeight != null && clientHeight > 0) {
2798
+ const updateRowHeightFunc = () => {
2799
+ props.node.setRowHeight(clientHeight);
2800
+ if ((0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._isClientSideRowModel)(gos) || (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__._isServerSideRowModel)(gos)) {
2801
+ rowModel.onRowHeightChanged();
2802
+ }
2803
+ };
2804
+ setTimeout(updateRowHeightFunc, 0);
2805
+ }
2806
+ };
2807
+ resizeObserverDestroyFunc.current = resizeObserverService.observeResize(eRef, checkRowSizeFunc);
2808
+ checkRowSizeFunc();
2809
+ }
2810
+ }, []);
2811
+ const setGridApi = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((api) => {
2812
+ ctrlRef.current?.registerDetailWithMaster(api);
2813
+ }, []);
2814
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: topClassName, ref: setRef2 }, detailGridOptions && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
2815
+ AgGridReactUi,
2816
+ {
2817
+ className: gridClassName,
2818
+ ...detailGridOptions,
2819
+ modules: parentModules,
2820
+ rowData: detailRowData,
2821
+ setGridApi
2822
+ }
2823
+ ));
2824
+ });
2825
+ var ReactFrameworkOverrides = class extends ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.VanillaFrameworkOverrides {
2826
+ constructor(processQueuedUpdates) {
2827
+ super("react");
2828
+ this.processQueuedUpdates = processQueuedUpdates;
2829
+ this.queueUpdates = false;
2830
+ this.frameworkComponents = {
2831
+ agGroupCellRenderer: groupCellRenderer_default,
2832
+ agGroupRowRenderer: groupCellRenderer_default,
2833
+ agDetailCellRenderer: DetailCellRenderer
2834
+ };
2835
+ this.wrapIncoming = (callback, source) => {
2836
+ if (source === "ensureVisible") {
2837
+ return runWithoutFlushSync(callback);
2838
+ }
2839
+ return callback();
2840
+ };
2841
+ this.renderingEngine = "react";
2842
+ }
2843
+ frameworkComponent(name) {
2844
+ return this.frameworkComponents[name];
2845
+ }
2846
+ isFrameworkComponent(comp) {
2847
+ if (!comp) {
2848
+ return false;
2849
+ }
2850
+ const prototype = comp.prototype;
2851
+ const isJsComp = prototype && "getGui" in prototype;
2852
+ return !isJsComp;
2853
+ }
2854
+ getLockOnRefresh() {
2855
+ this.queueUpdates = true;
2856
+ }
2857
+ releaseLockOnRefresh() {
2858
+ this.queueUpdates = false;
2859
+ this.processQueuedUpdates();
2860
+ }
2861
+ shouldQueueUpdates() {
2862
+ return this.queueUpdates;
2863
+ }
2864
+ runWhenReadyAsync() {
2865
+ return isReact19();
2866
+ }
2867
+ };
2868
+
2869
+ // packages/ag-grid-react/src/agGridReact.tsx
2870
+ var AgGridReact = class extends react__WEBPACK_IMPORTED_MODULE_0__.Component {
2871
+ constructor() {
2872
+ super(...arguments);
2873
+ this.apiListeners = [];
2874
+ this.setGridApi = (api) => {
2875
+ this.api = api;
2876
+ this.apiListeners.forEach((listener) => listener(api));
2877
+ };
2878
+ }
2879
+ registerApiListener(listener) {
2880
+ this.apiListeners.push(listener);
2881
+ }
2882
+ componentWillUnmount() {
2883
+ this.apiListeners.length = 0;
2884
+ }
2885
+ render() {
2886
+ return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AgGridReactUi, { ...this.props, setGridApi: this.setGridApi });
2887
+ }
2888
+ };
2889
+
2890
+ // packages/ag-grid-react/src/shared/customComp/interfaces.ts
2891
+
2892
+ function useGridCustomComponent(methods) {
2893
+ const { setMethods } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(CustomContext);
2894
+ setMethods(methods);
2895
+ }
2896
+ function useGridCellEditor(callbacks) {
2897
+ useGridCustomComponent(callbacks);
2898
+ }
2899
+ function useGridDate(callbacks) {
2900
+ return useGridCustomComponent(callbacks);
2901
+ }
2902
+ function useGridFilter(callbacks) {
2903
+ return useGridCustomComponent(callbacks);
2904
+ }
2905
+ function useGridFloatingFilter(callbacks) {
2906
+ useGridCustomComponent(callbacks);
2907
+ }
2908
+ function useGridMenuItem(callbacks) {
2909
+ useGridCustomComponent(callbacks);
2910
+ }
2911
+
2912
+
2913
+
2914
+ /***/ }
2915
+
2916
+ }]);
2917
+ //# sourceMappingURL=vendors-node_modules_ag-grid-react_dist_package_index_esm_mjs.ca52d36c364e6562240a.js.map