@devtron-labs/devtron-fe-common-lib 1.4.3 → 1.4.5

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 (25) hide show
  1. package/dist/{@code-editor-CJzLZbk_.js → @code-editor-DOrCsZCp.js} +4634 -4540
  2. package/dist/{@common-rjsf-C-eNkDr9.js → @common-rjsf-DfTsF2Ah.js} +2 -2
  3. package/dist/{@framer-motion-BxQTtYmm.js → @framer-motion-CdgdF0KV.js} +1 -1
  4. package/dist/{@react-dates-M_eJUVeH.js → @react-dates-CtQV2TLr.js} +1 -1
  5. package/dist/{@react-select-CywptBlV.js → @react-select-Cn3OpC9h.js} +1 -1
  6. package/dist/@react-virtualized-sticky-tree-CVJYfMx0.js +452 -0
  7. package/dist/{@vendor-QI4m26H1.js → @vendor-CwAQS8iU.js} +5895 -5492
  8. package/dist/Common/CodeEditor/CodeEditor.reducer.d.ts +13 -1
  9. package/dist/Common/CodeEditor/types.d.ts +4 -2
  10. package/dist/Common/Constants.d.ts +1 -0
  11. package/dist/Pages/GlobalConfigurations/BuildInfra/UseBuildInfraForm.d.ts +1 -1
  12. package/dist/Pages/GlobalConfigurations/BuildInfra/constants.d.ts +2 -2
  13. package/dist/Pages/GlobalConfigurations/BuildInfra/services.d.ts +3 -4
  14. package/dist/Pages/GlobalConfigurations/BuildInfra/types.d.ts +39 -17
  15. package/dist/Pages/GlobalConfigurations/BuildInfra/utils.d.ts +4 -3
  16. package/dist/Pages/ResourceBrowser/service.d.ts +2 -0
  17. package/dist/Shared/Components/VirtualizedList/VirtualizedList.component.d.ts +2 -0
  18. package/dist/Shared/Components/VirtualizedList/VirtualizedList.constants.d.ts +2 -0
  19. package/dist/Shared/Components/VirtualizedList/VirtualizedList.types.d.ts +36 -0
  20. package/dist/Shared/Components/VirtualizedList/index.d.ts +2 -0
  21. package/dist/Shared/Components/index.d.ts +1 -0
  22. package/dist/Shared/Hooks/useGetResourceKindsOptions/types.d.ts +1 -0
  23. package/dist/Shared/Services/types.d.ts +4 -0
  24. package/dist/index.js +341 -338
  25. package/package.json +6 -1
@@ -1,8 +1,8 @@
1
- import { j as n, J as A } from "./@vendor-QI4m26H1.js";
1
+ import { j as n, J as A } from "./@vendor-CwAQS8iU.js";
2
2
  import E, { forwardRef as $ } from "react";
3
3
  import L, { getDefaultRegistry as k } from "@rjsf/core";
4
4
  import D from "@rjsf/validator-ajv8";
5
- import { T as y, c as H, a as U, i as J, d as w } from "./@code-editor-CJzLZbk_.js";
5
+ import { T as y, c as H, a as U, i as J, d as w } from "./@code-editor-DOrCsZCp.js";
6
6
  import M, { components as O } from "react-select";
7
7
  import { getUiOptions as B, getTemplate as I, getSubmitButtonOptions as W, ADDITIONAL_PROPERTY_FLAG as P, errorId as V, englishStringTranslator as q, TranslatableString as K, titleId as Y, canExpand as z, deepEquals as G } from "@rjsf/utils";
8
8
  import { ReactComponent as Q } from "./assets/ic-chevron-down.fc70d7a7.svg";
@@ -1,4 +1,4 @@
1
- import { g as ct, l as m, o as I, p as Yr, q as we, r as T, t as at, v as zt, w as ae, x as Xe, y as J, z as kr, B as Qn, C as Xr, D as ti, E as ei, F as ri, G as ni, H as ii, I as Wr, K as ai, L as oi, M as si, N as ui, O as li, P as fi, S as ci, T as yt, U as k, V as pe, W as Zr, X as vi, Y as di, Z as W, $, a0 as pi, a1 as he, a2 as Dt, a3 as hi, a4 as mi, a5 as $r, a6 as Mt, a7 as O, a8 as me, a9 as gi, aa as oe, ab as yi } from "./@vendor-QI4m26H1.js";
1
+ import { g as ct, l as m, o as I, p as Yr, q as we, r as T, t as at, v as zt, w as ae, x as Xe, y as J, z as kr, B as Qn, C as Xr, D as ti, E as ei, F as ri, G as ni, H as ii, I as Wr, K as ai, L as oi, M as si, N as ui, O as li, P as fi, S as ci, T as yt, U as k, V as pe, W as Zr, X as vi, Y as di, Z as W, $, a0 as pi, a1 as he, a2 as Dt, a3 as hi, a4 as mi, a5 as $r, a6 as Mt, a7 as O, a8 as me, a9 as gi, aa as oe, ab as yi } from "./@vendor-CwAQS8iU.js";
2
2
  import * as K from "react";
3
3
  import Ee, { createContext as bt, useContext as F, useLayoutEffect as Pi, useEffect as G, useState as qr, useRef as q, useCallback as ge, useMemo as It, forwardRef as bi, createElement as Vi, cloneElement as Ti, Children as Si, isValidElement as xi } from "react";
4
4
  var We = "production", Le = typeof process > "u" || process.env === void 0 ? We : process.env.NODE_ENV || We, Q = function(t) {
@@ -1,5 +1,5 @@
1
1
  import Te from "react";
2
- import { ac as xe, ad as we, ae as ve, af as lr, ag as Le, ah as Je, ai as tt, aj as at, ak as et, al as lt, am as rt, an as Xn, ao as sr, ap as Jn, aq as bt, ar as Go, as as dr, at as eo, au as to, av as ao, aw as $o, ax as Yo, ay as ur, az as Fe, aA as Rt, aB as Uo, aC as cr, aD as Qo, aE as Cr, aF as Zo, aG as Xo, aH as Jo } from "./@vendor-QI4m26H1.js";
2
+ import { ac as xe, ad as we, ae as ve, af as lr, ag as Le, ah as Je, ai as tt, aj as at, ak as et, al as lt, am as rt, an as Xn, ao as sr, ap as Jn, aq as bt, ar as Go, as as dr, at as eo, au as to, av as ao, aw as $o, ax as Yo, ay as ur, az as Fe, aA as Rt, aB as Uo, aC as cr, aD as Qo, aE as Cr, aF as Zo, aG as Xo, aH as Jo } from "./@vendor-CwAQS8iU.js";
3
3
  import { r as Ne, g as ei, h as ti } from "./@moment-C_WeV3Af.js";
4
4
  import './assets/@react-dates.css';var ro = {}, Wt = {}, jt = {}, Mr;
5
5
  function Ve() {
@@ -1,4 +1,4 @@
1
- import { aI as xt, aJ as Bt, aK as Ft, aL as v, aM as U, aN as xe, ay as re, aO as h, aG as f, aP as Y, aQ as Vt, aR as Ue, aS as Et, aT as yt, aU as Wt, aV as Xt, aW as Zt, aX as ne } from "./@vendor-QI4m26H1.js";
1
+ import { aI as xt, aJ as Bt, aK as Ft, aL as v, aM as U, aN as xe, ay as re, aO as h, aG as f, aP as Y, aQ as Vt, aR as Ue, aS as Et, aT as yt, aU as Wt, aV as Xt, aW as Zt, aX as ne } from "./@vendor-CwAQS8iU.js";
2
2
  import * as y from "react";
3
3
  import { useContext as Nt, useRef as j, useState as ee, createContext as St, useMemo as q, useCallback as D, Component as Rt, Fragment as Be, useEffect as Qe, forwardRef as Ht } from "react";
4
4
  import { createPortal as Tt } from "react-dom";
@@ -0,0 +1,452 @@
1
+ var v = Object.defineProperty;
2
+ var E = (a, h, e) => h in a ? v(a, h, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[h] = e;
3
+ var f = (a, h, e) => E(a, typeof h != "symbol" ? h + "" : h, e);
4
+ import u, { createRef as k } from "react";
5
+ import { aY as x } from "./@vendor-CwAQS8iU.js";
6
+ const b = () => typeof navigator < "u" && /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor) ? "-webkit-sticky" : "sticky";
7
+ var g;
8
+ (function(a) {
9
+ a.OBSERVED = "observed", a.REQUESTED = "requested";
10
+ })(g || (g = {}));
11
+ class N extends u.PureComponent {
12
+ constructor(e) {
13
+ super(e);
14
+ f(this, "nodes");
15
+ f(this, "getChildrenCache");
16
+ f(this, "rowRenderCache");
17
+ f(this, "rowRenderRange");
18
+ f(this, "structureChanged");
19
+ f(this, "elemRef", k());
20
+ f(this, "pendingScrollTop");
21
+ f(this, "treeToRender");
22
+ this.props.apiRef && this.props.apiRef(this), this.state = {
23
+ scrollTop: 0,
24
+ currNodePos: 0,
25
+ scrollTick: !1
26
+ }, this.nodes = [], this.structureChanged = !1, this.onScroll = this.onScroll.bind(this), this.getChildrenCache = {}, this.rowRenderCache = {}, this.rowRenderRange = void 0;
27
+ }
28
+ /**
29
+ * Converts the consumer's tree structure into a flat array with root at index: 0,
30
+ * including information about the top and height of each node.
31
+ *
32
+ * i.e:
33
+ * [
34
+ * { id: 'root', top: 0, index: 0, height: 100. isSticky: true , zIndex: 0, stickyTop: 10 },
35
+ * { id: 'child1', top: 10, index: 1, parentIndex: 0 height: 10, isSticky: false },
36
+ * ...
37
+ * ]
38
+ */
39
+ flattenTree(e, t = this.props, i = [], s = !1, r = !1, o = void 0, d = { totalHeight: 0 }) {
40
+ const n = i.length, S = e.height !== void 0 ? e.height : t.rowHeight, R = o !== void 0 ? i[o] : void 0, { isSticky: T = !1, stickyTop: w = 0, zIndex: I = 0, node: m } = e, p = {
41
+ id: m.id,
42
+ isSticky: T,
43
+ stickyTop: w,
44
+ zIndex: I,
45
+ node: m,
46
+ top: d.totalHeight,
47
+ isLeafNode: !1,
48
+ meta: e.meta,
49
+ parentIndex: o,
50
+ parentInfo: R,
51
+ depth: R !== void 0 ? R.depth + 1 : 0,
52
+ height: S,
53
+ index: n,
54
+ isFirstChild: s,
55
+ isLastChild: r,
56
+ totalHeight: 0
57
+ };
58
+ i.push(p), R !== void 0 && R.children.push(n), d.totalHeight += S;
59
+ const l = t.getChildren(e.node, p);
60
+ if (t.isModelImmutable) {
61
+ let c = this.getChildrenCache[p.id];
62
+ (l === void 0 || c !== l) && (delete this.rowRenderCache[p.id], this.getChildrenCache[p.id] = l, c && l && (l.length !== c.length || !l.every((C, y) => C.node.id === c[y].node.id)) && (this.structureChanged = !0, this.getBranchChildrenIds(l).forEach((C) => delete this.rowRenderCache[C])));
63
+ } else
64
+ this.structureChanged = !0;
65
+ if (Array.isArray(l)) {
66
+ p.children = [];
67
+ for (let c = 0; c < l.length; c++) {
68
+ const C = l[c];
69
+ this.flattenTree(C, t, i, c === 0, c === l.length - 1, n, d);
70
+ }
71
+ } else
72
+ p.isLeafNode = !0;
73
+ return p.totalHeight = d.totalHeight - p.top, i;
74
+ }
75
+ getBranchChildrenIds(e, t = []) {
76
+ return e && e.forEach((i) => {
77
+ t.push(i.node.id), this.getBranchChildrenIds(this.getChildrenCache[i.node.id], t);
78
+ }), t;
79
+ }
80
+ UNSAFE_componentWillMount() {
81
+ this.refreshCachedMetadata(this.props), this.storeRenderTree(this.props, this.state);
82
+ }
83
+ treeDataUpdated(e) {
84
+ return e.root !== this.props.root || e.getChildren !== this.props.getChildren || e.rowHeight !== this.props.rowHeight;
85
+ }
86
+ UNSAFE_componentWillReceiveProps(e) {
87
+ this.treeDataUpdated(e) && this.refreshCachedMetadata(e), e.scrollIndex !== void 0 && e.scrollIndex >= 0 && this.scrollIndexIntoView(e.scrollIndex);
88
+ }
89
+ UNSAFE_componentWillUpdate(e, t) {
90
+ (t.scrollTick === this.state.scrollTick || t.currNodePos !== this.state.currNodePos) && this.storeRenderTree(e, t);
91
+ }
92
+ getNode(e) {
93
+ return this.nodes[this.getNodeIndex(e)]?.node;
94
+ }
95
+ /**
96
+ * Returns the index of the node in a flat list tree (post-order traversal).
97
+ *
98
+ * @param nodeId The node index to get the index for.
99
+ * @returns {number}
100
+ */
101
+ getNodeIndex(e) {
102
+ return this.nodes.findIndex((t) => t.id === e);
103
+ }
104
+ /**
105
+ * Returns the node that appears higher than this node (either a parent, sibling or child of the sibling above).
106
+ * @param nodeId The node to get the previous node of.
107
+ * @returns {*}
108
+ */
109
+ getPreviousNodeId(e) {
110
+ const t = this.getNodeIndex(e);
111
+ if (t !== -1) {
112
+ const i = this.nodes[t - 1];
113
+ if (i)
114
+ return i.id;
115
+ }
116
+ }
117
+ /**
118
+ * Returns the node that appears lower than this node (sibling or sibling of the node's parent).
119
+ * @param nodeId The node to get the next node of.
120
+ * @returns {*}
121
+ */
122
+ getNextNodeId(e) {
123
+ const t = this.getNodeIndex(e);
124
+ if (t !== -1) {
125
+ const i = this.nodes[t + 1];
126
+ if (i)
127
+ return i.id;
128
+ }
129
+ }
130
+ /**
131
+ * Returns true if the node is completely visible and is not obscured.
132
+ * This will return false when the node is partially obscured.
133
+ *
134
+ * @param nodeId The id of the node to check
135
+ * @param includeObscured if true, this method will return true for partially visible nodes.
136
+ * @returns {boolean}
137
+ */
138
+ isNodeVisible(e, t = !1) {
139
+ return this.isIndexVisible(this.getNodeIndex(e), t);
140
+ }
141
+ /**
142
+ * Returns true if the node is completely visible and is not obscured, unless includeObscured is specified.
143
+ * This will return false when the node is partially obscured, unless includeObscured is set to true.
144
+ *
145
+ * @param index The index of the node to check, generally retrieved via getNodeIndex()
146
+ * @param includeObscured if true, this method will return true for partially visible nodes.
147
+ * @returns {boolean}
148
+ */
149
+ isIndexVisible(e, t = !1) {
150
+ let i;
151
+ const s = this.nodes[e];
152
+ if (!s)
153
+ return !1;
154
+ if (s.isSticky && e === this.state.currNodePos || this.getParentPath(this.state.currNodePos).includes(this.nodes[e]))
155
+ return !0;
156
+ const r = this.getScrollTop();
157
+ if (t ? this.elemRef.current && (i = r <= s.top + s.height - s.stickyTop && r + this.props.height >= s.top) : i = this.isIndexInViewport(e), i) {
158
+ const o = this.getParentPath(e, !1);
159
+ for (let d = 0; d < o.length; d++) {
160
+ const n = o[d];
161
+ if (n.isSticky && (!t && n.stickyTop + n.height > s.top - r || t && n.stickyTop + n.height > s.top + s.height - r))
162
+ return !1;
163
+ }
164
+ return !0;
165
+ }
166
+ return !1;
167
+ }
168
+ /**
169
+ * Returns true if the node is within the view port window. Note this this will return FALSE for visible sticky nodes that are
170
+ * partially out of view disregarding sticky, which is useful when the node will become unstuck. This may occur when the node is
171
+ * collapsed in a tree. In this case, you want to scroll this node back into view so that the collapsed node stays in the same position.
172
+ *
173
+ * @param nodeId The id of the node to check
174
+ * @returns {boolean}
175
+ */
176
+ isNodeInViewport(e) {
177
+ return this.isIndexInViewport(this.getNodeIndex(e));
178
+ }
179
+ /**
180
+ * Returns true if the node is within the view port window. Note this this will return FALSE for visible sticky nodes that are
181
+ * partially out of view disregarding sticky, which is useful when the node will become unstuck. This may occur when the node is
182
+ * collapsed in a tree. In this case, you want to scroll this node back into view so that the collapsed node stays in the same position.
183
+ *
184
+ * This also returns false if the node is partially out of view.
185
+ *
186
+ * @param index The node index, generally retrieved via getNodeIndex()
187
+ * @returns {boolean}
188
+ */
189
+ isIndexInViewport(e) {
190
+ let t = this.nodes[e];
191
+ if (!t || !this.elemRef)
192
+ return !1;
193
+ const i = this.getScrollTop();
194
+ return i <= t.top - t.stickyTop && i + this.props.height >= t.top + t.height;
195
+ }
196
+ /**
197
+ * Returns the top of the node with the specified id.
198
+ * @param nodeId
199
+ */
200
+ getNodeTop(e) {
201
+ return this.getIndexTop(this.getNodeIndex(e));
202
+ }
203
+ /**
204
+ * Returns the top of the node with the specified index.
205
+ * @param index
206
+ */
207
+ getIndexTop(e) {
208
+ const t = this.nodes[e];
209
+ return t ? t.top : -1;
210
+ }
211
+ /**
212
+ * Returns the scrollTop of the scrollable element
213
+ *
214
+ * @return returns -1 if the elem does not exist.
215
+ */
216
+ getScrollTop() {
217
+ return this.elemRef.current ? this.elemRef.current.scrollTop : -1;
218
+ }
219
+ /**
220
+ * Returns the scrollLeft of the scrollable element
221
+ *
222
+ * @return returns -1 if the elem does not exist.
223
+ */
224
+ getScrollLeft() {
225
+ return this.elemRef.current ? this.elemRef.current.scrollLeft : -1;
226
+ }
227
+ /**
228
+ * Sets the scrollTop position of the scrollable element.
229
+ * @param scrollTop
230
+ */
231
+ setScrollTop(e) {
232
+ isNaN(e) || this.setScrollTopAndClosestNode(e, this.state.currNodePos, g.REQUESTED);
233
+ }
234
+ /**
235
+ * Sets the scrollLeft position of the scrollable element.
236
+ * @param scrollLeft
237
+ */
238
+ setScrollLeft(e) {
239
+ !isNaN(e) && this.elemRef.current && (this.elemRef.current.scrollLeft = e);
240
+ }
241
+ /**
242
+ * Scrolls the node into view so that it is visible.
243
+ *
244
+ * @param nodeId The node id of the node to scroll into view.
245
+ * @param alignToTop if true, the node will aligned to the top of viewport, or sticky parent. If false, the bottom of the node will
246
+ * be aligned with the bottom of the viewport.
247
+ */
248
+ scrollNodeIntoView(e, t = !0) {
249
+ this.scrollIndexIntoView(this.getNodeIndex(e), t);
250
+ }
251
+ /**
252
+ * Scrolls the node into view so that it is visible.
253
+ *
254
+ * @param index The index of the node.
255
+ * @param alignToTop if true, the node will aligned to the top of viewport, or sticky parent. If false, the bottom of the node will
256
+ * be aligned with the bottom of the viewport.
257
+ */
258
+ scrollIndexIntoView(e, t = !0) {
259
+ let i = this.nodes[e];
260
+ if (i !== void 0) {
261
+ let s;
262
+ if (t)
263
+ if (i.isSticky)
264
+ s = i.top - i.stickyTop;
265
+ else {
266
+ const r = this.getParentPath(e, !1);
267
+ for (let o = 0; o < r.length; o++) {
268
+ const d = r[o];
269
+ if (d.isSticky) {
270
+ s = i.top - d.stickyTop - d.height;
271
+ break;
272
+ }
273
+ }
274
+ s === void 0 && (s = i.top);
275
+ }
276
+ else
277
+ s = i.top - this.props.height + i.height;
278
+ this.setScrollTop(s);
279
+ }
280
+ }
281
+ componentDidUpdate(e, t) {
282
+ if (this.state.scrollReason === g.REQUESTED && this.elemRef.current && this.state.scrollTop >= 0 && this.state.scrollTop !== this.elemRef.current.scrollTop && (this.elemRef.current.scrollTop = this.state.scrollTop), this.props.onRowsRendered !== void 0 && (t.currNodePos !== this.state.currNodePos || this.treeDataUpdated(e))) {
283
+ const i = this.rowRenderRange, s = this.nodes[i.visibleStart], r = this.nodes[i.visibleEnd];
284
+ this.props.onRowsRendered({
285
+ overscanStartIndex: i.start,
286
+ overscanStopIndex: i.end,
287
+ startIndex: i.visibleStart,
288
+ stopIndex: i.visibleEnd,
289
+ startNode: s && s,
290
+ endNode: r && r,
291
+ nodes: this.nodes
292
+ });
293
+ }
294
+ }
295
+ refreshCachedMetadata(e) {
296
+ this.structureChanged = !1, this.nodes = this.flattenTree(e.root, e), this.structureChanged && this.elemRef && this.setScrollTopAndClosestNode(this.pendingScrollTop || this.getScrollTop(), 0, g.REQUESTED);
297
+ }
298
+ recomputeTree() {
299
+ this.props.root !== void 0 && this.props.getChildren !== void 0 && (this.refreshCachedMetadata(this.props), this.forceUpdate());
300
+ }
301
+ storeRenderTree(e, t) {
302
+ this.treeToRender = this.renderParentTree(e, t);
303
+ }
304
+ forceUpdate() {
305
+ this.getChildrenCache = {}, this.rowRenderCache = {}, this.storeRenderTree(this.props, this.state), super.forceUpdate();
306
+ }
307
+ renderParentTree(e, t) {
308
+ this.rowRenderRange = this.getRenderRowRange(e, t);
309
+ const i = this.getParentPath(this.rowRenderRange.start), s = /* @__PURE__ */ new Set();
310
+ for (let r = 0; r < i.length; r++)
311
+ s.add(i[r].index);
312
+ for (let r = this.rowRenderRange.start; r <= this.rowRenderRange.end; r++)
313
+ s.add(this.nodes[r].index);
314
+ return this.props.renderRoot ? u.createElement("div", { className: "rv-sticky-node-list", style: { width: "100%", position: "absolute", top: 0 } }, this.renderChildWithChildren(e, t, this.nodes[0], 0, s)) : this.renderParentContainer(e, t, this.nodes[0], s);
315
+ }
316
+ renderParentContainer(e, t, i, s) {
317
+ return u.createElement("div", { className: "rv-sticky-node-list", style: { position: "absolute", width: "100%", height: i.totalHeight - i.height } }, this.renderChildren(e, t, i, s));
318
+ }
319
+ getChildContainerStyle(e, t) {
320
+ return { position: "absolute", top: t, height: e.totalHeight, width: "100%" };
321
+ }
322
+ renderChildWithChildren(e, t, i, s, r) {
323
+ return u.createElement(
324
+ "div",
325
+ { key: `rv-node-${i.id}`, className: "rv-sticky-parent-node", style: this.getChildContainerStyle(i, s) },
326
+ this.renderNode(e, t, i, this.getClientNodeStyle(i)),
327
+ this.renderParentContainer(e, t, i, r)
328
+ );
329
+ }
330
+ getClientNodeStyle(e) {
331
+ const t = { height: e.height };
332
+ return e.isSticky && (t.position = b(), t.top = e.stickyTop, t.zIndex = e.zIndex), t;
333
+ }
334
+ getClientLeafNodeStyle(e, t) {
335
+ return {
336
+ position: "absolute",
337
+ top: t,
338
+ height: e.height,
339
+ width: "100%"
340
+ };
341
+ }
342
+ renderChildren(e, t, i, s) {
343
+ const r = [];
344
+ let o = 0;
345
+ return i.children.forEach((d) => {
346
+ const n = this.nodes[d];
347
+ s.has(d) && ("children" in n && n.children.length > 0 ? r.push(this.renderChildWithChildren(e, t, n, o, s)) : n.isSticky || e.wrapAllLeafNodes ? r.push(u.createElement("div", { className: "rv-sticky-leaf-node", key: `rv-node-${n.id}`, style: this.getChildContainerStyle(n, o) }, this.renderNode(e, t, n, this.getClientNodeStyle(n)))) : r.push(this.renderNode(e, t, n, this.getClientLeafNodeStyle(n, o)))), o += n.totalHeight;
348
+ }), r;
349
+ }
350
+ renderNode(e, t, i, s) {
351
+ if (e.isModelImmutable && this.rowRenderCache[i.id])
352
+ return this.rowRenderCache[i.id];
353
+ const r = e.rowRenderer({ node: i.node, nodeInfo: i, style: s, meta: e.meta });
354
+ return e.isModelImmutable && (this.rowRenderCache[i.id] = r), r;
355
+ }
356
+ /**
357
+ * Determines the start and end number of the range to be rendered.
358
+ * @returns {{start: number, end: number}} Indexes within nodes
359
+ */
360
+ getRenderRowRange(e, t) {
361
+ let i = e.overscanRowCount > 0 ? e.overscanRowCount : 1, s = t.currNodePos - i;
362
+ s < 0 && (s = 0);
363
+ let r = t.currNodePos + 1;
364
+ for (; this.nodes[r] && this.nodes[r].top < t.scrollTop + e.height; )
365
+ r++;
366
+ let o = r + i;
367
+ return o > this.nodes.length - 1 && (o = this.nodes.length - 1), { start: s, end: o, visibleStart: t.currNodePos, visibleEnd: r };
368
+ }
369
+ /**
370
+ * Returns the parent path from nodes for the specified index within nodes.
371
+ * @param nodeIndex
372
+ * @param topDownOrder if true, the array with index 0 will be the root node, otherwise 0 will be the immediate parent.
373
+ * @returns {Array<TreeNode>}
374
+ */
375
+ getParentPath(e, t = !0) {
376
+ let i = this.nodes[e];
377
+ const s = [];
378
+ for (; i; )
379
+ i = this.nodes[i.parentIndex], i && s.push(i);
380
+ return t ? s.reverse() : s;
381
+ }
382
+ /**
383
+ * Searches from the current node position downwards to see if the top of nodes above are greater
384
+ * than or equal to the current scrollTop
385
+ * @param scrollTop
386
+ * @param searchPos
387
+ * @returns {number}
388
+ */
389
+ forwardSearch(e, t) {
390
+ const i = this.nodes;
391
+ for (let s = t; s < i.length; s++)
392
+ if (i[s].top >= e)
393
+ return s;
394
+ return i.length - 1;
395
+ }
396
+ /**
397
+ * Searches from the current node position upwards to see if the top of nodes above are less than
398
+ * or equal the current scrollTop.
399
+ * @param scrollTop
400
+ * @param searchPos
401
+ * @returns {number}
402
+ */
403
+ backwardSearch(e, t) {
404
+ const i = this.nodes;
405
+ for (let s = Math.min(t, Math.max(i.length - 1, 0)); s >= 0; s--)
406
+ if (i[s].top <= e)
407
+ return s;
408
+ return 0;
409
+ }
410
+ /**
411
+ * Sets the scroll top in state and finds and sets the closest node to that scroll top.
412
+ */
413
+ setScrollTopAndClosestNode(e, t, i) {
414
+ if (e === this.state.scrollTop || (this.elemRef.current && e >= this.elemRef.current.scrollHeight - this.elemRef.current.offsetHeight && (e = this.elemRef.current.scrollHeight - this.elemRef.current.offsetHeight), e === this.state.scrollTop))
415
+ return;
416
+ let s;
417
+ (e > this.state.scrollTop || t === 0) && (s = this.forwardSearch(e, t)), e < this.state.scrollTop && s === void 0 && (s = this.backwardSearch(e, t)), this.pendingScrollTop = e, this.setState({ currNodePos: s || 0, scrollTop: e, scrollReason: i }, () => {
418
+ this.pendingScrollTop = void 0;
419
+ });
420
+ }
421
+ onScroll(e) {
422
+ const { scrollTop: t, scrollLeft: i } = e.target, s = this.state.scrollReason || g.OBSERVED;
423
+ this.setScrollTopAndClosestNode(t, this.state.currNodePos, s), this.props.onScroll !== void 0 && this.props.onScroll({ scrollTop: t, scrollLeft: i, scrollReason: s }), this.setState({ scrollTick: !this.state.scrollTick, scrollReason: void 0 });
424
+ }
425
+ render() {
426
+ let e = { overflow: "auto", position: "relative" };
427
+ return this.props.inlineWidthHeight !== !1 && (this.props.width && (e.width = this.props.width), this.props.height && (e.height = this.props.height)), u.createElement("div", { ref: this.elemRef, className: "rv-sticky-tree", style: e, onScroll: this.onScroll }, this.treeToRender);
428
+ }
429
+ }
430
+ f(N, "defaultProps", {
431
+ overscanRowCount: 10,
432
+ renderRoot: !0,
433
+ wrapAllLeafNodes: !1,
434
+ isModelImmutable: !1
435
+ });
436
+ class U extends u.PureComponent {
437
+ constructor(h) {
438
+ super(h), this.state = {};
439
+ }
440
+ render() {
441
+ return u.createElement(x, { bounds: !0, onResize: (h) => {
442
+ this.setState({ width: h.bounds.width, height: h.bounds.height }), this.props.onResize !== void 0 && this.props.onResize(h);
443
+ } }, ({ measureRef: h }) => u.createElement(
444
+ "div",
445
+ { ref: h, className: this.props.className },
446
+ u.createElement(N, { ref: this.props.treeRef, width: this.state.width, height: this.state.height, ...this.props })
447
+ ));
448
+ }
449
+ }
450
+ export {
451
+ U as A
452
+ };