@infinilabs/discover 0.0.8 → 0.0.10

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.
@@ -1,5 +1,5 @@
1
1
  import { o as __toESM, r as __export, t as __commonJSMin } from "./chunk-D-4zIDrl.js";
2
- import { C as BehaviorSubject, E as Subscription, T as operate, _ as onRedirectNoIndexPattern, b as FilterManager, d as baseFormattersPublic, f as getTimezone, g as onUnsupportedTimePattern, h as IndexPatternsApiClient, l as generateFilters, m as SavedObjectsClientPublicToCommon, n as search, p as deserializeFieldFormat, u as createSearchBar, v as TimeHistory, w as createOperatorSubscriber, x as AutocompleteService, y as Timefilter } from "./public-Bb76DDzt.js";
2
+ import { C as BehaviorSubject, E as Subscription, T as operate, _ as onRedirectNoIndexPattern, b as FilterManager, d as baseFormattersPublic, f as getTimezone, g as onUnsupportedTimePattern, h as IndexPatternsApiClient, l as generateFilters, m as SavedObjectsClientPublicToCommon, n as search, p as deserializeFieldFormat, u as createSearchBar, v as TimeHistory, w as createOperatorSubscriber, x as AutocompleteService, y as Timefilter } from "./public-BGDT-6rG.js";
3
3
  import { a as createHashHistory, c as require_object_assign, d as FieldIcon, i as setIndexPatterns$1, l as require_url, o as _extends, t as getIndexPatterns, u as FieldButton } from "./services-C8UxrSbr.js";
4
4
  import { t as require_classnames } from "./classnames-BCXlvRQ0.js";
5
5
  import { t as require_lodash } from "./lodash-Gv_ptthU.js";
@@ -1263,40 +1263,40 @@ var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((e) => {
1263
1263
  function Z(e) {
1264
1264
  return A(e) === m;
1265
1265
  }
1266
- function qZ(e) {
1266
+ function zZ(e) {
1267
1267
  return A(e) === f;
1268
1268
  }
1269
- function JZ(e) {
1269
+ function BZ(e) {
1270
1270
  return A(e) === u;
1271
1271
  }
1272
- function YZ(e) {
1272
+ function VZ(e) {
1273
1273
  return typeof e == "object" && !!e && e.$$typeof === n;
1274
1274
  }
1275
- function XZ(e) {
1275
+ function HZ(e) {
1276
1276
  return A(e) === g;
1277
1277
  }
1278
- function ZZ(e) {
1278
+ function UZ(e) {
1279
1279
  return A(e) === a;
1280
1280
  }
1281
- function QZ(e) {
1281
+ function WZ(e) {
1282
1282
  return A(e) === S;
1283
1283
  }
1284
- function $Z(e) {
1284
+ function GZ(e) {
1285
1285
  return A(e) === x;
1286
1286
  }
1287
- function eQ(e) {
1287
+ function KZ(e) {
1288
1288
  return A(e) === i;
1289
1289
  }
1290
- function tQ(e) {
1290
+ function qZ(e) {
1291
1291
  return A(e) === s;
1292
1292
  }
1293
1293
  function Q(e) {
1294
1294
  return A(e) === o;
1295
1295
  }
1296
- function nQ(e) {
1296
+ function JZ(e) {
1297
1297
  return A(e) === y;
1298
1298
  }
1299
- e.AsyncMode = M, e.ConcurrentMode = N, e.ContextConsumer = P, e.ContextProvider = F, e.Element = I, e.ForwardRef = L, e.Fragment = R, e.Lazy = z, e.Memo = B, e.Portal = V, e.Profiler = U, e.StrictMode = W, e.Suspense = G, e.isAsyncMode = J, e.isConcurrentMode = Z, e.isContextConsumer = qZ, e.isContextProvider = JZ, e.isElement = YZ, e.isForwardRef = XZ, e.isFragment = ZZ, e.isLazy = QZ, e.isMemo = $Z, e.isPortal = eQ, e.isProfiler = tQ, e.isStrictMode = Q, e.isSuspense = nQ, e.isValidElementType = O, e.typeOf = A;
1299
+ e.AsyncMode = M, e.ConcurrentMode = N, e.ContextConsumer = P, e.ContextProvider = F, e.Element = I, e.ForwardRef = L, e.Fragment = R, e.Lazy = z, e.Memo = B, e.Portal = V, e.Profiler = U, e.StrictMode = W, e.Suspense = G, e.isAsyncMode = J, e.isConcurrentMode = Z, e.isContextConsumer = zZ, e.isContextProvider = BZ, e.isElement = VZ, e.isForwardRef = HZ, e.isFragment = UZ, e.isLazy = WZ, e.isMemo = GZ, e.isPortal = KZ, e.isProfiler = qZ, e.isStrictMode = Q, e.isSuspense = JZ, e.isValidElementType = O, e.typeOf = A;
1300
1300
  })();
1301
1301
  })), require_react_is = /* @__PURE__ */ __commonJSMin(((e, t) => {
1302
1302
  process.env.NODE_ENV === "production" ? t.exports = require_react_is_production_min() : t.exports = require_react_is_development();
@@ -3084,25 +3084,25 @@ function highlight_default(e, t) {
3084
3084
  numberStyle: A,
3085
3085
  startingLineNumber: T,
3086
3086
  codeString: W
3087
- }) : null, Z = s.hljs || s["pre[class*=\"language-\"]"] || { backgroundColor: "#fff" }, qZ = isHighlightJs(G) ? "hljs" : "prismjs", JZ = y ? Object.assign({}, K, { style: Object.assign({}, Z, f) }) : Object.assign({}, K, {
3088
- className: K.className ? `${qZ} ${K.className}` : qZ,
3087
+ }) : null, Z = s.hljs || s["pre[class*=\"language-\"]"] || { backgroundColor: "#fff" }, zZ = isHighlightJs(G) ? "hljs" : "prismjs", BZ = y ? Object.assign({}, K, { style: Object.assign({}, Z, f) }) : Object.assign({}, K, {
3088
+ className: K.className ? `${zZ} ${K.className}` : zZ,
3089
3089
  style: Object.assign({}, f)
3090
3090
  });
3091
- if (P ? m.style = _objectSpread({ whiteSpace: "pre-wrap" }, m.style) : m.style = _objectSpread({ whiteSpace: "pre" }, m.style), !G) return /* @__PURE__ */ React.createElement(z, JZ, J, /* @__PURE__ */ React.createElement(V, m, W));
3091
+ if (P ? m.style = _objectSpread({ whiteSpace: "pre-wrap" }, m.style) : m.style = _objectSpread({ whiteSpace: "pre" }, m.style), !G) return /* @__PURE__ */ React.createElement(z, BZ, J, /* @__PURE__ */ React.createElement(V, m, W));
3092
3092
  (M === void 0 && L || P) && (M = !0), L ||= defaultRenderer;
3093
- var YZ = [{
3093
+ var VZ = [{
3094
3094
  type: "text",
3095
3095
  value: W
3096
- }], XZ = getCodeTree({
3096
+ }], HZ = getCodeTree({
3097
3097
  astGenerator: G,
3098
3098
  language: i,
3099
3099
  code: W,
3100
- defaultCodeValue: YZ
3100
+ defaultCodeValue: VZ
3101
3101
  });
3102
- XZ.language === null && (XZ.value = YZ);
3103
- var ZZ = T + (W.match(/\n/g)?.length ?? 0), QZ = processLines(XZ, M, I, x, C, T, ZZ, A, P);
3104
- return /* @__PURE__ */ React.createElement(z, JZ, /* @__PURE__ */ React.createElement(V, m, !C && J, L({
3105
- rows: QZ,
3102
+ HZ.language === null && (HZ.value = VZ);
3103
+ var UZ = T + (W.match(/\n/g)?.length ?? 0), WZ = processLines(HZ, M, I, x, C, T, UZ, A, P);
3104
+ return /* @__PURE__ */ React.createElement(z, BZ, /* @__PURE__ */ React.createElement(V, m, !C && J, L({
3105
+ rows: WZ,
3106
3106
  stylesheet: s,
3107
3107
  useInlineStyles: y
3108
3108
  })));
@@ -20908,213 +20908,85 @@ function _displayField(e, t, n, i = !1, a) {
20908
20908
  dangerouslySetInnerHTML: { __html: o }
20909
20909
  }) : /* @__PURE__ */ jsx("span", { dangerouslySetInnerHTML: { __html: o } });
20910
20910
  }
20911
- var extendStatics = function(e, t) {
20912
- return extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
20913
- e.__proto__ = t;
20914
- } || function(e, t) {
20915
- for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
20916
- }, extendStatics(e, t);
20917
- };
20918
- function __extends(e, t) {
20919
- extendStatics(e, t);
20920
- function n() {
20921
- this.constructor = e;
20922
- }
20923
- e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
20924
- }
20925
- var __assign = function() {
20926
- return __assign = Object.assign || function(e) {
20927
- for (var t, n = 1, i = arguments.length; n < i; n++) for (var a in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, a) && (e[a] = t[a]);
20928
- return e;
20929
- }, __assign.apply(this, arguments);
20930
- };
20931
- function throttle(e, t, n, i) {
20932
- var a, o = !1, s = 0;
20933
- function u() {
20934
- a && clearTimeout(a);
20935
- }
20936
- function f() {
20937
- u(), o = !0;
20938
- }
20939
- typeof t != "boolean" && (i = n, n = t, t = void 0);
20940
- function p() {
20941
- var f = this, p = Date.now() - s, m = arguments;
20942
- if (o) return;
20943
- function g() {
20944
- s = Date.now(), n.apply(f, m);
20945
- }
20946
- function y() {
20947
- a = void 0;
20948
- }
20949
- i && !a && g(), u(), i === void 0 && p > e ? g() : t !== !0 && (a = setTimeout(i ? y : g, i === void 0 ? e - p : e));
20950
- }
20951
- return p.cancel = f, p;
20952
- }
20953
- var ThresholdUnits = {
20954
- Pixel: "Pixel",
20955
- Percent: "Percent"
20956
- }, defaultThreshold = {
20957
- unit: ThresholdUnits.Percent,
20958
- value: .8
20959
- };
20960
- function parseThreshold(e) {
20961
- return typeof e == "number" ? {
20962
- unit: ThresholdUnits.Percent,
20963
- value: e * 100
20964
- } : typeof e == "string" ? e.match(/^(\d*(\.\d+)?)px$/) ? {
20965
- unit: ThresholdUnits.Pixel,
20966
- value: parseFloat(e)
20967
- } : e.match(/^(\d*(\.\d+)?)%$/) ? {
20968
- unit: ThresholdUnits.Percent,
20969
- value: parseFloat(e)
20970
- } : (console.warn("scrollThreshold format is invalid. Valid formats: \"120px\", \"50%\"..."), defaultThreshold) : (console.warn("scrollThreshold should be string or number"), defaultThreshold);
20971
- }
20972
- var index_es_default = function(e) {
20973
- __extends(t, e);
20974
- function t(t) {
20975
- var n = e.call(this, t) || this;
20976
- return n.lastScrollTop = 0, n.actionTriggered = !1, n.startY = 0, n.currentY = 0, n.dragging = !1, n.maxPullDownDistance = 0, n.getScrollableTarget = function() {
20977
- return n.props.scrollableTarget instanceof HTMLElement ? n.props.scrollableTarget : typeof n.props.scrollableTarget == "string" ? document.getElementById(n.props.scrollableTarget) : (n.props.scrollableTarget === null && console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n "), null);
20978
- }, n.onStart = function(e) {
20979
- n.lastScrollTop || (n.dragging = !0, e instanceof MouseEvent ? n.startY = e.pageY : e instanceof TouchEvent && (n.startY = e.touches[0].pageY), n.currentY = n.startY, n._infScroll && (n._infScroll.style.willChange = "transform", n._infScroll.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)"));
20980
- }, n.onMove = function(e) {
20981
- n.dragging && (e instanceof MouseEvent ? n.currentY = e.pageY : e instanceof TouchEvent && (n.currentY = e.touches[0].pageY), !(n.currentY < n.startY) && (n.currentY - n.startY >= Number(n.props.pullDownToRefreshThreshold) && n.setState({ pullToRefreshThresholdBreached: !0 }), !(n.currentY - n.startY > n.maxPullDownDistance * 1.5) && n._infScroll && (n._infScroll.style.overflow = "visible", n._infScroll.style.transform = "translate3d(0px, " + (n.currentY - n.startY) + "px, 0px)")));
20982
- }, n.onEnd = function() {
20983
- n.startY = 0, n.currentY = 0, n.dragging = !1, n.state.pullToRefreshThresholdBreached && (n.props.refreshFunction && n.props.refreshFunction(), n.setState({ pullToRefreshThresholdBreached: !1 })), requestAnimationFrame(function() {
20984
- n._infScroll && (n._infScroll.style.overflow = "auto", n._infScroll.style.transform = "none", n._infScroll.style.willChange = "unset");
20985
- });
20986
- }, n.onScrollListener = function(e) {
20987
- typeof n.props.onScroll == "function" && setTimeout(function() {
20988
- return n.props.onScroll && n.props.onScroll(e);
20989
- }, 0);
20990
- var t = n.props.height || n._scrollableNode ? e.target : document.documentElement.scrollTop ? document.documentElement : document.body;
20991
- n.actionTriggered || ((n.props.inverse ? n.isElementAtTop(t, n.props.scrollThreshold) : n.isElementAtBottom(t, n.props.scrollThreshold)) && n.props.hasMore && (n.actionTriggered = !0, n.setState({ showLoader: !0 }), n.props.next && n.props.next()), n.lastScrollTop = t.scrollTop);
20992
- }, n.state = {
20993
- showLoader: !1,
20994
- pullToRefreshThresholdBreached: !1,
20995
- prevDataLength: t.dataLength
20996
- }, n.throttledOnScrollListener = throttle(150, n.onScrollListener).bind(n), n.onStart = n.onStart.bind(n), n.onMove = n.onMove.bind(n), n.onEnd = n.onEnd.bind(n), n;
20997
- }
20998
- return t.prototype.componentDidMount = function() {
20999
- if (this.props.dataLength === void 0) throw Error("mandatory prop \"dataLength\" is missing. The prop is needed when loading more content. Check README.md for usage");
21000
- if (this._scrollableNode = this.getScrollableTarget(), this.el = this.props.height ? this._infScroll : this._scrollableNode || window, this.el && this.el.addEventListener("scroll", this.throttledOnScrollListener), typeof this.props.initialScrollY == "number" && this.el && this.el instanceof HTMLElement && this.el.scrollHeight > this.props.initialScrollY && this.el.scrollTo(0, this.props.initialScrollY), this.props.pullDownToRefresh && this.el && (this.el.addEventListener("touchstart", this.onStart), this.el.addEventListener("touchmove", this.onMove), this.el.addEventListener("touchend", this.onEnd), this.el.addEventListener("mousedown", this.onStart), this.el.addEventListener("mousemove", this.onMove), this.el.addEventListener("mouseup", this.onEnd), this.maxPullDownDistance = this._pullDown && this._pullDown.firstChild && this._pullDown.firstChild.getBoundingClientRect().height || 0, this.forceUpdate(), typeof this.props.refreshFunction != "function")) throw Error("Mandatory prop \"refreshFunction\" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage'");
21001
- }, t.prototype.componentWillUnmount = function() {
21002
- this.el && (this.el.removeEventListener("scroll", this.throttledOnScrollListener), this.props.pullDownToRefresh && (this.el.removeEventListener("touchstart", this.onStart), this.el.removeEventListener("touchmove", this.onMove), this.el.removeEventListener("touchend", this.onEnd), this.el.removeEventListener("mousedown", this.onStart), this.el.removeEventListener("mousemove", this.onMove), this.el.removeEventListener("mouseup", this.onEnd)));
21003
- }, t.prototype.componentDidUpdate = function(e) {
21004
- this.props.dataLength !== e.dataLength && (this.actionTriggered = !1, this.setState({ showLoader: !1 }));
21005
- }, t.getDerivedStateFromProps = function(e, t) {
21006
- return e.dataLength === t.prevDataLength ? null : __assign(__assign({}, t), { prevDataLength: e.dataLength });
21007
- }, t.prototype.isElementAtTop = function(e, t) {
21008
- t === void 0 && (t = .8);
21009
- var n = e === document.body || e === document.documentElement ? window.screen.availHeight : e.clientHeight, i = parseThreshold(t);
21010
- return i.unit === ThresholdUnits.Pixel ? e.scrollTop <= i.value + n - e.scrollHeight + 1 : e.scrollTop <= i.value / 100 + n - e.scrollHeight + 1;
21011
- }, t.prototype.isElementAtBottom = function(e, t) {
21012
- t === void 0 && (t = .8);
21013
- var n = e === document.body || e === document.documentElement ? window.screen.availHeight : e.clientHeight, i = parseThreshold(t);
21014
- return i.unit === ThresholdUnits.Pixel ? e.scrollTop + n >= e.scrollHeight - i.value : e.scrollTop + n >= i.value / 100 * e.scrollHeight;
21015
- }, t.prototype.render = function() {
21016
- var e = this, t = __assign({
21017
- height: this.props.height || "auto",
21018
- overflow: "auto",
21019
- WebkitOverflowScrolling: "touch"
21020
- }, this.props.style), n = this.props.hasChildren || !!(this.props.children && this.props.children instanceof Array && this.props.children.length), i = this.props.pullDownToRefresh && this.props.height ? { overflow: "auto" } : {};
21021
- return React.createElement("div", {
21022
- style: i,
21023
- className: "infinite-scroll-component__outerdiv"
21024
- }, React.createElement("div", {
21025
- className: "infinite-scroll-component " + (this.props.className || ""),
21026
- ref: function(t) {
21027
- return e._infScroll = t;
21028
- },
21029
- style: t
21030
- }, this.props.pullDownToRefresh && React.createElement("div", {
21031
- style: { position: "relative" },
21032
- ref: function(t) {
21033
- return e._pullDown = t;
21034
- }
21035
- }, React.createElement("div", { style: {
21036
- position: "absolute",
21037
- left: 0,
21038
- right: 0,
21039
- top: -1 * this.maxPullDownDistance
21040
- } }, this.state.pullToRefreshThresholdBreached ? this.props.releaseToRefreshContent : this.props.pullDownToRefreshContent)), this.props.children, !this.state.showLoader && !n && this.props.hasMore && this.props.loader, this.state.showLoader && this.props.hasMore && this.props.loader, !this.props.hasMore && this.props.endMessage));
21041
- }, t;
21042
- }(Component), { Text: Text$1 } = Typography;
20911
+ var { Text: Text$1 } = Typography;
21043
20912
  function LoadingSpinner() {
21044
20913
  return /* @__PURE__ */ jsx("div", {
21045
20914
  style: { textAlign: "center" },
21046
20915
  children: /* @__PURE__ */ jsx(Spin, {})
21047
20916
  });
21048
20917
  }
21049
- var pageCount = 20, table_default = React.memo(({ columns: e, hits: t, sortOrder: n, indexPattern: i, onFilter: a, onMoveColumn: o, onAddColumn: s, onRemoveColumn: u, onChangeSortOrder: f, document: p, hitsTotal: m, queryFrom: g, setQueryFrom: y, formatDisplayName: b, formatHit: x, pageSize: S = pageCount, scrollableTarget: C, scrollThreshold: w, hasMore: T = !0, filterIconRender: E, theme: O }) => {
21050
- let A = useRef(null);
20918
+ var pageCount = 20, table_default = React.memo(({ columns: e, hits: t, sortOrder: n, indexPattern: i, onFilter: a, onMoveColumn: o, onAddColumn: s, onRemoveColumn: u, onChangeSortOrder: f, document: p, hitsTotal: m, queryFrom: g, setQueryFrom: y, formatDisplayName: b, formatHit: x, pageSize: S = pageCount, hasMore: C = !0, filterIconRender: w, theme: T }) => {
20919
+ let E = useRef(null), [O, A] = useState(!1), M = useCallback(() => {
20920
+ let e = g + S;
20921
+ e < m && !O && (A(!0), y(e));
20922
+ }, [
20923
+ g,
20924
+ S,
20925
+ m,
20926
+ y,
20927
+ O
20928
+ ]);
21051
20929
  return useEffect(() => {
21052
- let e = A.current ? A.current : window.document.documentElement;
20930
+ g === 0 && (A(!1), E.current && (E.current.scrollTop = 0));
20931
+ }, [g]), useEffect(() => {
20932
+ A(!1);
20933
+ }, [t.length]), useEffect(() => {
20934
+ let e = E.current;
21053
20935
  if (!e) return;
21054
20936
  let n = () => {
21055
- let n = T && t.length < m, i = e.scrollHeight <= e.clientHeight;
21056
- n && i && y(g + S);
21057
- }, i = new ResizeObserver(() => {
21058
- n();
21059
- });
21060
- return i.observe(e), n(), () => {
21061
- i.disconnect();
21062
- };
20937
+ let n = C && t.length < m, i = e.scrollHeight <= e.clientHeight + 2;
20938
+ n && i && !O && M();
20939
+ }, i = new ResizeObserver(n);
20940
+ return i.observe(e), n(), () => i.disconnect();
21063
20941
  }, [
21064
20942
  t.length,
21065
20943
  m,
21066
- T,
21067
- g,
21068
- S,
21069
- y
21070
- ]), /* @__PURE__ */ jsx("div", {
21071
- ref: A,
21072
- className: "infini-discover-table flex-1 overflow-auto",
21073
- children: A.current && /* @__PURE__ */ jsx(index_es_default, {
21074
- dataLength: t.length,
21075
- next: () => {
21076
- y(g + S);
21077
- },
21078
- hasMore: T && t.length < m,
21079
- loader: /* @__PURE__ */ jsx("h4", {
21080
- style: {
21081
- textAlign: "center",
21082
- margin: "10px auto"
21083
- },
21084
- children: /* @__PURE__ */ jsx(LoadingSpinner, {})
21085
- }),
21086
- endMessage: null,
21087
- scrollableTarget: A.current,
21088
- scrollThreshold: w,
21089
- children: t.length ? /* @__PURE__ */ jsxs("table", {
21090
- className: "kbn-table table",
21091
- children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx(TableHeader, {
21092
- columns: e,
21093
- defaultSortOrder: "desc",
21094
- hideTimeColumn: !1,
21095
- indexPattern: i,
21096
- isShortDots: !1,
21097
- onChangeSortOrder: f,
21098
- onMoveColumn: o,
21099
- onRemoveColumn: u,
21100
- sortOrder: n || [],
21101
- formatDisplayName: b
21102
- }) }), /* @__PURE__ */ jsx("tbody", { children: t.map((t, n) => /* @__PURE__ */ jsx(TableRow, {
21103
- onFilter: a,
21104
- columns: e,
21105
- hideTimeColumn: !1,
21106
- indexPattern: i,
21107
- isShortDots: !1,
21108
- onAddColumn: s,
21109
- onRemoveColumn: u,
21110
- row: t,
21111
- document: p,
21112
- formatHit: x,
21113
- filterIconRender: E,
21114
- theme: O
21115
- }, "discover-table-row" + t._id)) })]
21116
- }) : null
21117
- })
20944
+ C,
20945
+ M,
20946
+ O
20947
+ ]), /* @__PURE__ */ jsxs("div", {
20948
+ ref: E,
20949
+ onScroll: (e) => {
20950
+ let n = e.currentTarget, i = C && t.length < m;
20951
+ n.scrollHeight - n.scrollTop <= n.clientHeight + 50 && i && !O && M();
20952
+ },
20953
+ className: "infini-discover-table flex-1 min-h-0 overflow-y-auto",
20954
+ style: { position: "relative" },
20955
+ children: [t.length > 0 ? /* @__PURE__ */ jsxs("table", {
20956
+ className: "kbn-table table",
20957
+ children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx(TableHeader, {
20958
+ columns: e,
20959
+ defaultSortOrder: "desc",
20960
+ hideTimeColumn: !1,
20961
+ indexPattern: i,
20962
+ isShortDots: !1,
20963
+ onChangeSortOrder: f,
20964
+ onMoveColumn: o,
20965
+ onRemoveColumn: u,
20966
+ sortOrder: n || [],
20967
+ formatDisplayName: b
20968
+ }) }), /* @__PURE__ */ jsx("tbody", { children: t.map((t) => /* @__PURE__ */ jsx(TableRow, {
20969
+ onFilter: a,
20970
+ columns: e,
20971
+ hideTimeColumn: !1,
20972
+ indexPattern: i,
20973
+ isShortDots: !1,
20974
+ onAddColumn: s,
20975
+ onRemoveColumn: u,
20976
+ row: t,
20977
+ document: p,
20978
+ formatHit: x,
20979
+ filterIconRender: w,
20980
+ theme: T
20981
+ }, "discover-table-row" + t._id)) })]
20982
+ }) : null, (O || C && t.length < m) && /* @__PURE__ */ jsx("div", {
20983
+ style: {
20984
+ padding: "12px 0",
20985
+ textAlign: "center",
20986
+ width: "100%"
20987
+ },
20988
+ children: /* @__PURE__ */ jsx(LoadingSpinner, {})
20989
+ })]
21118
20990
  });
21119
20991
  });
21120
20992
  init_moment();
@@ -21154,8 +21026,8 @@ var Info_default = ({ bucketInterval: e, dateFormat: t = "YYYY-MM-DD H:mm", time
21154
21026
  });
21155
21027
  };
21156
21028
  function ResultHeader(e) {
21157
- let { showCollapse: t, collapseState: n, setCollapseState: i, took: a, total: o, timeChartProps: s, onDownloadQuery: u, downloading: f = !1 } = e, p = t.sideBar && n.sideBar, m = t.histogram, [g, y] = useState(!1), [b] = Form.useForm(), { i18n: x } = useContext(GlobalConfigContext), S = x?.download || {}, C = useRef(!1), w = async (e, t, n) => {
21158
- if (C.current) return;
21029
+ let { showCollapse: t, collapseState: n, setCollapseState: i, took: a, total: o, timeChartProps: s, onDownloadQuery: u, downloading: f = !1, exportMaxSize: p = 1e4 } = e, m = t.sideBar && n.sideBar, g = t.histogram, [y, b] = useState(!1), [x] = Form.useForm(), { i18n: S } = useContext(GlobalConfigContext), C = S?.download || {}, w = useRef(!1), T = async (e, t, n) => {
21030
+ if (w.current) return;
21159
21031
  let i = [...t];
21160
21032
  n && (i = [n, ...i.filter((e) => e !== n)]);
21161
21033
  let a = e.map((e) => {
@@ -21165,20 +21037,20 @@ function ResultHeader(e) {
21165
21037
  return n = e === "_source" ? t : e in t ? t[e] : e.split(".").reduce((e, t) => e ? e[t] : void 0, t), typeof n == "object" && n && (n = JSON.stringify(n)), `"${String(n ?? "").replace(/"/g, "\"\"")}"`;
21166
21038
  }).join(",");
21167
21039
  }), o = [i.join(","), ...a].join("\n"), s = new Blob(["" + o], { type: "text/csv;charset=utf-8;" }), u = window.document.createElement("a"), f = URL.createObjectURL(s);
21168
- u.setAttribute("href", f), u.setAttribute("download", `${(/* @__PURE__ */ new Date()).getTime()}.csv`), u.style.visibility = "hidden", window.document.body.appendChild(u), u.click(), window.document.body.removeChild(u), y(!1), b.resetFields();
21169
- }, T = () => {
21170
- C.current = !1, y(!0);
21171
- }, E = async () => {
21172
- let { from: e, size: t } = await b.validateFields();
21173
- u?.(e - 1, t, w);
21174
- }, O = () => {
21175
- y(!1), b.resetFields(), C.current = !0;
21040
+ u.setAttribute("href", f), u.setAttribute("download", `${(/* @__PURE__ */ new Date()).getTime()}.csv`), u.style.visibility = "hidden", window.document.body.appendChild(u), u.click(), window.document.body.removeChild(u), b(!1), x.resetFields();
21041
+ }, E = () => {
21042
+ w.current = !1, b(!0);
21043
+ }, O = async () => {
21044
+ let { from: e, size: t } = await x.validateFields();
21045
+ t > p && (t = p), e + t > o && (t = o - e), t = Math.max(1, t), u?.(e, t, T);
21046
+ }, A = () => {
21047
+ b(!1), x.resetFields(), w.current = !0;
21176
21048
  };
21177
21049
  return /* @__PURE__ */ jsxs("div", {
21178
21050
  className: "flex items-center justify-between p-8px",
21179
21051
  children: [
21180
21052
  /* @__PURE__ */ jsxs(Space.Compact, { children: [
21181
- p && /* @__PURE__ */ jsx(Button, {
21053
+ m && /* @__PURE__ */ jsx(Button, {
21182
21054
  className: "flex-shrink-0",
21183
21055
  icon: /* @__PURE__ */ jsx(PanelLeftOpen, { className: "w-14px h-14px" }),
21184
21056
  onClick: () => {
@@ -21188,7 +21060,7 @@ function ResultHeader(e) {
21188
21060
  });
21189
21061
  }
21190
21062
  }),
21191
- m && /* @__PURE__ */ jsx(Button, {
21063
+ g && /* @__PURE__ */ jsx(Button, {
21192
21064
  className: "flex-shrink-0",
21193
21065
  icon: n.histogram ? /* @__PURE__ */ jsx(PanelTopOpen, { className: "w-14px h-14px" }) : /* @__PURE__ */ jsx(PanelTopClose, { className: "w-14px h-14px" }),
21194
21066
  onClick: () => {
@@ -21202,7 +21074,7 @@ function ResultHeader(e) {
21202
21074
  className: "flex-shrink-0",
21203
21075
  icon: /* @__PURE__ */ jsx(Download, { className: "w-14px h-14px" }),
21204
21076
  onClick: () => {
21205
- T();
21077
+ E();
21206
21078
  }
21207
21079
  })
21208
21080
  ] }),
@@ -21212,32 +21084,32 @@ function ResultHeader(e) {
21212
21084
  ...s || {}
21213
21085
  }),
21214
21086
  /* @__PURE__ */ jsx(Modal, {
21215
- title: S.title || "Export search as CSV",
21087
+ title: C.title || `Export search as CSV (max: ${p})`,
21216
21088
  closable: !0,
21217
- open: g,
21218
- onOk: E,
21219
- onCancel: O,
21089
+ open: y,
21090
+ onOk: O,
21091
+ onCancel: A,
21220
21092
  destroyOnHidden: !0,
21221
21093
  okButtonProps: { loading: f },
21222
21094
  children: /* @__PURE__ */ jsxs(Form, {
21223
- form: b,
21095
+ form: x,
21224
21096
  layout: "vertical",
21225
21097
  className: "mt-24px",
21226
21098
  initialValues: {
21227
- from: 1,
21099
+ from: 0,
21228
21100
  size: 20
21229
21101
  },
21230
21102
  children: [/* @__PURE__ */ jsx(Form.Item, {
21231
- label: S.from || "From",
21103
+ label: "From",
21232
21104
  name: "from",
21233
21105
  required: !0,
21234
21106
  children: /* @__PURE__ */ jsx(InputNumber, {
21235
21107
  className: "w-full",
21236
- min: 1,
21237
- max: o
21108
+ min: 0,
21109
+ max: o - 1
21238
21110
  })
21239
21111
  }), /* @__PURE__ */ jsx(Form.Item, {
21240
- label: S.size || "Size",
21112
+ label: "Size",
21241
21113
  name: "size",
21242
21114
  required: !0,
21243
21115
  children: /* @__PURE__ */ jsx(InputNumber, {
@@ -51659,7 +51531,7 @@ appendIconComponentCache({
51659
51531
  var import_lodash = require_lodash();
51660
51532
  loader.config({ monaco: editor_main_exports });
51661
51533
  var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringManager, timefilter, storage, getEsQuery, getSearchParams, intervalOptions, getTimeBuckets, fetchESRequest, services, setIndexPatterns } = getContext(), SearchBar = createSearchBar(), isFrist = !0, Discover = (e) => {
51662
- let { indexPattern: t, setIndexPattern: n, onIndexPatternChange: i, onSearch: o, scrollableTarget: s, queryParams: u = {}, setQueryParams: f, locale: m, theme: g } = e, [b, x] = useState({
51534
+ let { indexPattern: t, setIndexPattern: n, onIndexPatternChange: i, onSearch: o, queryParams: s = {}, setQueryParams: u, locale: f, theme: m, exportMaxSize: g = 1e4 } = e, [b, x] = useState({
51663
51535
  sideBar: !1,
51664
51536
  histogram: !1
51665
51537
  }), [S, C] = useState(() => getTimezone()), [w, T] = useState({
@@ -51679,18 +51551,18 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51679
51551
  aggregations: { counts: { buckets: [] } }
51680
51552
  }), E = useRef();
51681
51553
  useEffect(() => {
51682
- u.range && u.range[0] && u.range[1] && timefilter.setTime({
51683
- from: u.range[0],
51684
- to: u.range[1]
51685
- }), Array.isArray(u.filters) && u.filters.length > 0 && filterManager.setFilters(u.filters.filter((e) => !!e.meta).map((e) => ({
51554
+ s.range && s.range[0] && s.range[1] && timefilter.setTime({
51555
+ from: s.range[0],
51556
+ to: s.range[1]
51557
+ }), Array.isArray(s.filters) && s.filters.length > 0 && filterManager.setFilters(s.filters.filter((e) => !!e.meta).map((e) => ({
51686
51558
  ...e,
51687
51559
  store: FilterStateStore.APP_STATE
51688
51560
  })));
51689
51561
  }, []);
51690
51562
  let [O, A] = useState({
51691
- columns: u.columns || ["_source"],
51563
+ columns: s.columns || ["_source"],
51692
51564
  interval: "15s",
51693
- sort: u.sort || []
51565
+ sort: s.sort || []
51694
51566
  }), M = {
51695
51567
  type: "string",
51696
51568
  field: "",
@@ -51717,18 +51589,18 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51717
51589
  } })), e;
51718
51590
  }, [t]), [R, z] = React.useState(0), B = O.columns, V = useCallback(async (e) => {
51719
51591
  if (!t || !o) return;
51720
- K("loading"), e?.isScrollLoad || z(0);
51592
+ K((e) => e === "next" ? e : "loading"), e?.isScrollLoad || z(0);
51721
51593
  let n = e?.sort || O.sort, i = getSearchParams(t, e?.interval || O.interval, e?.sort || O.sort, e?.aggs || null, N || {}, e?.isScrollLoad ? R : 0, !1), a = (0, import_lodash.cloneDeep)(i?.body?.query?.bool?.filter || []);
51722
51594
  if (a.length > 0) {
51723
51595
  let t = a[a.length - 1];
51724
51596
  t?.hasOwnProperty("range") && (e?.rangeFilter ? (a[a.length - 1] = (0, import_lodash.cloneDeep)(e?.rangeFilter), i.body.query.bool.filter = a) : E.current = t);
51725
51597
  }
51726
- let { index: s, body: p } = i, m = await o(s, p);
51598
+ let { index: f, body: p } = i, m = await o(f, p);
51727
51599
  (!m || !m.hits) && (m.hits = { hits: [] }), T(m);
51728
51600
  let { query: g } = queryStringManager.getQuery(), y = filterManager.getFilters();
51729
- f((e) => ({
51601
+ u((e) => ({
51730
51602
  ...e,
51731
- query: g == u.query ? u.query : g,
51603
+ query: g == s.query ? s.query : g,
51732
51604
  range: [timefilter._time?.from, timefilter._time?.to],
51733
51605
  sort: n,
51734
51606
  timeField: t.timeFieldName,
@@ -51747,7 +51619,7 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51747
51619
  N,
51748
51620
  R,
51749
51621
  t?.timeFieldName,
51750
- u
51622
+ s
51751
51623
  ]);
51752
51624
  useEffect(() => {
51753
51625
  R > 0 && V({
@@ -51827,7 +51699,7 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51827
51699
  O.interval
51828
51700
  ]);
51829
51701
  useEffect(() => {
51830
- f((e) => ({
51702
+ u((e) => ({
51831
51703
  ...e,
51832
51704
  columns: O.columns
51833
51705
  }));
@@ -51843,76 +51715,76 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51843
51715
  sort: []
51844
51716
  }), V({ sort: [] });
51845
51717
  }, [t]);
51846
- let { onAddColumn: JZ, onRemoveColumn: YZ, onMoveColumn: XZ, onSetColumns: ZZ } = useMemo(() => getStateColumnActions({
51718
+ let { onAddColumn: BZ, onRemoveColumn: VZ, onMoveColumn: HZ, onSetColumns: UZ } = useMemo(() => getStateColumnActions({
51847
51719
  indexPattern: t,
51848
51720
  setAppState: A,
51849
51721
  state: O,
51850
51722
  useNewFieldsApi: !1
51851
- }), [t, O]), QZ = useCallback((e) => {
51723
+ }), [t, O]), WZ = useCallback((e) => {
51852
51724
  A({
51853
51725
  ...O,
51854
51726
  sort: e
51855
51727
  }), V({ sort: e.reverse() });
51856
- }, [O, t]), $Z = useCallback((e, n, i) => {
51728
+ }, [O, t]), GZ = useCallback((e, n, i) => {
51857
51729
  typeof e == "string" || e.name;
51858
51730
  let a = generateFilters(filterManager, e, n, i, String(t.id));
51859
51731
  filterManager.addFilters(a), V();
51860
- }, [t, V]), eQ = useCallback((e) => {
51732
+ }, [t, V]), KZ = useCallback((e) => {
51861
51733
  timefilter.setTime({
51862
51734
  from: moment_default(e.from).toISOString(),
51863
51735
  to: moment_default(e.to).toISOString(),
51864
51736
  mode: "absolute"
51865
51737
  }), V();
51866
- }, [timefilter]), tQ = w.hits.hits || [], [Q, nQ] = useState([]);
51738
+ }, [timefilter]), qZ = w.hits.hits || [], [Q, JZ] = useState([]);
51867
51739
  useMemo(() => {
51868
- tQ.length > 0 ? nQ(R > 0 ? (e) => [...e, ...tQ] : tQ) : R === 0 && nQ([]);
51869
- }, [tQ]);
51870
- let rQ = {
51740
+ qZ.length > 0 ? JZ(R > 0 ? (e) => [...e, ...qZ] : qZ) : R === 0 && JZ([]);
51741
+ }, [qZ]);
51742
+ let YZ = {
51871
51743
  savedSearch: {},
51872
51744
  timefield: t?.getTimeField()?.displayName,
51873
51745
  chartAggConfigs: {}
51874
- }, iQ = {};
51875
- for (let e of Q) for (let n of Object.keys(t.flattenHit(e, !0))) iQ[n] = (iQ[n] || 0) + 1;
51876
- let aQ = Number.isInteger(w.hits.total?.value) ? w.hits.total?.value : 0, oQ = t?.timeFieldName != "", sQ = useCallback(async ({ _index: e, _id: t, _type: n, _source: i, is_new: a }) => !1, [V]), cQ = useCallback(async ({ _index: e, _id: t, _type: n }) => !1, [V]), lQ = useMemo(() => ({
51877
- saveDocument: sQ,
51878
- deleteDocument: cQ
51879
- }), [sQ, cQ]), uQ = async (e, n, i) => {
51746
+ }, XZ = {};
51747
+ for (let e of Q) for (let n of Object.keys(t.flattenHit(e, !0))) XZ[n] = (XZ[n] || 0) + 1;
51748
+ let ZZ = Number.isInteger(w.hits.total?.value) ? w.hits.total?.value : 0, QZ = t?.timeFieldName != "", $Z = useCallback(async ({ _index: e, _id: t, _type: n, _source: i, is_new: a }) => !1, [V]), eQ = useCallback(async ({ _index: e, _id: t, _type: n }) => !1, [V]), tQ = useMemo(() => ({
51749
+ saveDocument: $Z,
51750
+ deleteDocument: eQ
51751
+ }), [$Z, eQ]), nQ = async (e, n, i) => {
51880
51752
  let a = e?.spec?.name || e?.name;
51881
51753
  if (!a || !o) return;
51882
51754
  if (e.isMulti) a = `${a}.keyword`;
51883
51755
  else if (e?.spec?.aggregatable !== !0) return;
51884
51756
  n && n();
51885
- let s = u.sampleRecords === "all" ? { top5: { terms: {
51757
+ let u = s.sampleRecords === "all" ? { top5: { terms: {
51886
51758
  field: a,
51887
- size: u.topNumber || 5
51759
+ size: s.topNumber || 5
51888
51760
  } } } : {
51889
51761
  sample: {
51890
- sampler: { shard_size: u.sampleSize || 5e3 },
51762
+ sampler: { shard_size: s.sampleSize || 5e3 },
51891
51763
  aggs: {
51892
51764
  sample_count: { value_count: { field: a } },
51893
51765
  top5: { terms: {
51894
51766
  field: a,
51895
- size: u.topNumber || 5,
51767
+ size: s.topNumber || 5,
51896
51768
  shard_size: 25
51897
51769
  } }
51898
51770
  }
51899
51771
  },
51900
51772
  top5: { terms: {
51901
51773
  field: a,
51902
- size: u.topNumber || 5,
51774
+ size: s.topNumber || 5,
51903
51775
  shard_size: 25
51904
51776
  } }
51905
- }, f = getSearchParams(t, O.interval, O.sort, s, N || {}, 0, !0, 0), p = f?.body?.query?.bool?.filter || [];
51777
+ }, f = getSearchParams(t, O.interval, O.sort, u, N || {}, 0, !0, 0), p = f?.body?.query?.bool?.filter || [];
51906
51778
  if (p.length > 0 && E.current) {
51907
51779
  let e = p[p.length - 1], t = (0, import_lodash.cloneDeep)(E.current);
51908
51780
  e?.hasOwnProperty("range") ? (p[p.length - 1] = t, f.body.query.bool.filter = p) : p.push(t), f.body.query.bool.filter = p;
51909
51781
  }
51910
51782
  let { index: m, body: g } = f, y = await o(m, g);
51911
51783
  if (i) {
51912
- let e = u.sampleRecords === "all" ? y?.aggregations?.top5?.buckets : y?.aggregations?.sample?.top5?.buckets, t = u.sampleRecords === "all" ? y?.aggregations?.top5?.sum_other_doc_count : y?.aggregations?.sample?.sample_count?.value;
51784
+ let e = s.sampleRecords === "all" ? y?.aggregations?.top5?.buckets : y?.aggregations?.sample?.top5?.buckets, t = s.sampleRecords === "all" ? y?.aggregations?.top5?.sum_other_doc_count : y?.aggregations?.sample?.sample_count?.value;
51913
51785
  i(e || [], t || 0);
51914
51786
  }
51915
- }, dQ = async (e) => {
51787
+ }, rQ = async (e) => {
51916
51788
  L.unsubscribe(), t.timeFieldName = e, n(t);
51917
51789
  let i = [[e, "desc"]];
51918
51790
  A({
@@ -51920,20 +51792,20 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51920
51792
  columns: ["_source"],
51921
51793
  sort: i
51922
51794
  }), V({ sort: i });
51923
- }, fQ = async (e, n, i) => {
51795
+ }, iQ = async (e, n, i) => {
51924
51796
  if (!o) return;
51925
51797
  K("downloading");
51926
51798
  let { index: a, body: s } = getSearchParams(t, O.interval, O.sort, null, N || {}, e, !1, n), u = await o(a, s), f = Array.isArray(u?.hits?.hits) ? u?.hits?.hits : [], p = t.timeFieldName;
51927
- i?.(f, B, p), K("none");
51799
+ i?.(f, B, p), K("ready");
51928
51800
  };
51929
51801
  return /* @__PURE__ */ jsxs(Card, {
51930
- className: "h-full flex flex-col",
51931
- classNames: { body: "!p-0 h-full flex-1 flex flex-col" },
51802
+ className: "h-full",
51803
+ classNames: { body: "!p-0 h-full flex flex-col" },
51932
51804
  children: [/* @__PURE__ */ jsx(SearchBar, {
51933
51805
  showSearchBar: !1,
51934
51806
  showQueryBar: !0,
51935
51807
  showQueryInput: !0,
51936
- showDatePicker: oQ,
51808
+ showDatePicker: QZ,
51937
51809
  showFilterBar: !0,
51938
51810
  useDefaultBehaviors: !0,
51939
51811
  screenTitle: "",
@@ -51944,7 +51816,7 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51944
51816
  filterManager,
51945
51817
  query: {
51946
51818
  language: "kuery",
51947
- query: u.query || ""
51819
+ query: s.query || ""
51948
51820
  },
51949
51821
  queryStringManager,
51950
51822
  queryString: queryStringManager,
@@ -51952,16 +51824,16 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51952
51824
  storage,
51953
51825
  onQuerySubmit: V,
51954
51826
  services,
51955
- dateRangeFrom: u.range && u.range[0],
51956
- dateRangeTo: u.range && u.range[1],
51827
+ dateRangeFrom: s.range && s.range[0],
51828
+ dateRangeTo: s.range && s.range[1],
51957
51829
  selectedIndexPattern: t,
51958
51830
  setIndexPattern: (e) => {
51959
51831
  L.unsubscribe(), i(e);
51960
51832
  },
51961
51833
  indices: e.indices,
51962
51834
  histogramData: J,
51963
- timefilterUpdateHandler: eQ,
51964
- histogramOpts: rQ,
51835
+ timefilterUpdateHandler: KZ,
51836
+ histogramOpts: YZ,
51965
51837
  timeSetting: {
51966
51838
  ...Z || {},
51967
51839
  showTimeSetting: !0,
@@ -51975,102 +51847,107 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51975
51847
  value: t
51976
51848
  })),
51977
51849
  onTimeSettingChange: ({ timeField: e, timeInterval: n }) => {
51978
- t.timeFieldName !== e && dQ(e), Z?.stateInterval !== n && U(n);
51850
+ t.timeFieldName !== e && rQ(e), Z?.stateInterval !== n && U(n);
51979
51851
  },
51980
51852
  timeZone: S,
51981
51853
  onTimeZoneChange: C,
51982
51854
  recentlyUsedRanges: []
51983
51855
  },
51984
- locale: m,
51985
- theme: g
51856
+ locale: f,
51857
+ theme: m
51986
51858
  }), /* @__PURE__ */ jsx("div", {
51987
- className: "flex flex-1 min-h-0 border-t border-t-solid border-[var(--ant-color-border)]",
51988
- children: G === "none" && R === 0 ? /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(DiscoverNoResults, {
51989
- timeFieldName: rQ.timefield,
51990
- queryLanguage: O.query?.language || "",
51991
- range: u.range
51992
- }) }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [!b.sideBar && /* @__PURE__ */ jsx("div", {
51993
- className: "min-h-0 w-300px p-8px border-r border-r-solid border-[var(--ant-color-border)]",
51994
- children: /* @__PURE__ */ jsx(SidebarMemoized, {
51995
- config: {},
51996
- columns: B,
51997
- fieldCounts: iQ,
51998
- hits: Q,
51999
- indexPatterns: [t],
52000
- onAddField: JZ,
52001
- onAddFilter: $Z,
52002
- onRemoveField: YZ,
52003
- selectedIndexPattern: t,
52004
- setIndexPattern: () => {},
52005
- setAppState: A,
52006
- state: O,
52007
- distinctParams: N,
52008
- onDistinctParamsChange: F,
52009
- total: aQ,
52010
- onFieldAgg: uQ,
52011
- whetherToSample: u.whetherToSample,
52012
- sampleSize: u.sampleSize,
52013
- topNumber: u.topNumber,
52014
- onCollapseToggle: () => {
52015
- x((e) => ({
52016
- ...e,
52017
- sideBar: !e.sideBar
52018
- }));
52019
- }
52020
- })
52021
- }), /* @__PURE__ */ jsxs("div", {
52022
- className: "flex-1 flex flex-col min-h-0 overflow-hidden relative",
52023
- children: [
52024
- /* @__PURE__ */ jsx("div", {
52025
- style: { display: G !== "loading" && G !== "downloading" ? "none" : "" },
52026
- children: /* @__PURE__ */ jsx("div", {
52027
- className: "dscOverlay",
52028
- children: /* @__PURE__ */ jsx(LoadingSpinner, {})
52029
- })
52030
- }),
52031
- /* @__PURE__ */ jsx(ResultHeader, {
52032
- showCollapse: {
52033
- sideBar: !0,
52034
- histogram: !!J
52035
- },
52036
- collapseState: b,
52037
- setCollapseState: x,
52038
- took: w.took || 1,
52039
- total: aQ,
52040
- timeChartProps: Z,
52041
- onDownloadQuery: fQ,
52042
- downloading: G === "downloading"
52043
- }),
52044
- !b.histogram && rQ.chartAggConfigs && J && Q.length !== 0 && /* @__PURE__ */ jsx("div", {
52045
- className: "dscTimechart",
52046
- children: /* @__PURE__ */ jsx("div", {
52047
- className: "h-100px dscHistogramGrid",
52048
- children: /* @__PURE__ */ jsx(DiscoverHistogram, {
52049
- chartData: J,
52050
- timefilterUpdateHandler: eQ,
52051
- theme: g
52052
- })
52053
- })
52054
- }),
52055
- Q && Q.length > 0 ? /* @__PURE__ */ jsx(table_default, {
51859
+ className: "flex-1 min-h-0 relative",
51860
+ children: /* @__PURE__ */ jsx("div", {
51861
+ className: "absolute inset-0 flex border-t border-t-solid border-[var(--ant-color-border)]",
51862
+ children: G === "none" && R === 0 ? /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(DiscoverNoResults, {
51863
+ timeFieldName: YZ.timefield,
51864
+ queryLanguage: O.query?.language || "",
51865
+ range: s.range
51866
+ }) }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [!b.sideBar && /* @__PURE__ */ jsx("div", {
51867
+ className: "h-full w-300px p-8px border-r border-r-solid border-[var(--ant-color-border)] overflow-y-auto infini-discover-side",
51868
+ children: /* @__PURE__ */ jsx(SidebarMemoized, {
51869
+ config: {},
52056
51870
  columns: B,
52057
- sortOrder: O.sort || [],
52058
- indexPattern: t,
52059
- onFilter: $Z,
52060
- onRemoveColumn: YZ,
52061
- onMoveColumn: XZ,
52062
- onAddColumn: JZ,
52063
- onChangeSortOrder: QZ,
52064
- document: lQ,
51871
+ fieldCounts: XZ,
52065
51872
  hits: Q,
52066
- hitsTotal: aQ,
52067
- queryFrom: R,
52068
- setQueryFrom: z,
52069
- scrollableTarget: s,
52070
- theme: g
52071
- }) : null
52072
- ]
52073
- })] })
51873
+ indexPatterns: [t],
51874
+ onAddField: BZ,
51875
+ onAddFilter: GZ,
51876
+ onRemoveField: VZ,
51877
+ selectedIndexPattern: t,
51878
+ setIndexPattern: () => {},
51879
+ setAppState: A,
51880
+ state: O,
51881
+ distinctParams: N,
51882
+ onDistinctParamsChange: F,
51883
+ total: ZZ,
51884
+ onFieldAgg: nQ,
51885
+ whetherToSample: s.whetherToSample,
51886
+ sampleSize: s.sampleSize,
51887
+ topNumber: s.topNumber,
51888
+ onCollapseToggle: () => {
51889
+ x((e) => ({
51890
+ ...e,
51891
+ sideBar: !e.sideBar
51892
+ }));
51893
+ }
51894
+ })
51895
+ }), /* @__PURE__ */ jsxs("div", {
51896
+ className: "flex-1 flex flex-col h-full overflow-hidden relative",
51897
+ children: [
51898
+ /* @__PURE__ */ jsx("div", {
51899
+ style: { display: G !== "loading" && G !== "downloading" ? "none" : "" },
51900
+ children: /* @__PURE__ */ jsx("div", {
51901
+ className: "dscOverlay",
51902
+ children: /* @__PURE__ */ jsx(LoadingSpinner, {})
51903
+ })
51904
+ }),
51905
+ /* @__PURE__ */ jsx(ResultHeader, {
51906
+ showCollapse: {
51907
+ sideBar: !0,
51908
+ histogram: !!J
51909
+ },
51910
+ collapseState: b,
51911
+ setCollapseState: x,
51912
+ took: w.took || 1,
51913
+ total: ZZ,
51914
+ timeChartProps: Z,
51915
+ onDownloadQuery: iQ,
51916
+ downloading: G === "downloading",
51917
+ exportMaxSize: g
51918
+ }),
51919
+ !b.histogram && YZ.chartAggConfigs && J && Q.length !== 0 && /* @__PURE__ */ jsx("div", {
51920
+ className: "dscTimechart",
51921
+ children: /* @__PURE__ */ jsx("div", {
51922
+ className: "h-100px dscHistogramGrid",
51923
+ children: /* @__PURE__ */ jsx(DiscoverHistogram, {
51924
+ chartData: J,
51925
+ timefilterUpdateHandler: KZ,
51926
+ theme: m
51927
+ })
51928
+ })
51929
+ }),
51930
+ Q && Q.length > 0 ? /* @__PURE__ */ jsx(table_default, {
51931
+ columns: B,
51932
+ sortOrder: O.sort || [],
51933
+ indexPattern: t,
51934
+ onFilter: GZ,
51935
+ onRemoveColumn: VZ,
51936
+ onMoveColumn: HZ,
51937
+ onAddColumn: BZ,
51938
+ onChangeSortOrder: WZ,
51939
+ document: tQ,
51940
+ hits: Q,
51941
+ hitsTotal: ZZ,
51942
+ queryFrom: R,
51943
+ setQueryFrom: (e) => {
51944
+ K("next"), z(e);
51945
+ },
51946
+ theme: m
51947
+ }) : null
51948
+ ]
51949
+ })] })
51950
+ })
52074
51951
  })]
52075
51952
  });
52076
51953
  }, Container = ({ children: e }) => /* @__PURE__ */ jsx(Card, {
@@ -52080,7 +51957,7 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
52080
51957
  });
52081
51958
  const GlobalConfigContext = React.createContext({});
52082
51959
  var components_default = (e) => {
52083
- let { loading: t = !1, indices: n = [], getIndexPattern: i, onSearch: a, onSuggestions: o, scrollableTarget: s, queryParams: u, setQueryParams: f, locale: p, theme: m = "light", i18n: g = {} } = e, [y, b] = useState(), x = useRef({
51960
+ let { loading: t = !1, indices: n = [], getIndexPattern: i, onSearch: a, onSuggestions: o, queryParams: s, setQueryParams: u, locale: f, theme: p = "light", i18n: m = {}, exportMaxSize: g = 1e4 } = e, [y, b] = useState(), x = useRef({
52084
51961
  pendingIndex: null,
52085
51962
  loadedIndex: null
52086
51963
  }), S = async (e, t) => {
@@ -52091,7 +51968,7 @@ var components_default = (e) => {
52091
51968
  let i = [];
52092
51969
  n.fields.forEach((e) => {
52093
51970
  e.spec.type === "date" && i.push(e.spec.name);
52094
- }), i && i.length >= 1 && (t && i.includes(t) ? n.timeFieldName = t : n.timeFieldName === "" && (n.timeFieldName = i[0])), n.id !== u?.index && f((e) => ({
51971
+ }), i && i.length >= 1 && (t && i.includes(t) ? n.timeFieldName = t : n.timeFieldName === "" && (n.timeFieldName = i[0])), n.id !== s?.index && u((e) => ({
52095
51972
  ...e,
52096
51973
  index: n.id
52097
51974
  })), b(n);
@@ -52102,30 +51979,30 @@ var components_default = (e) => {
52102
51979
  o && services.data.autocomplete.setup({ onSuggestions: o }), i && services.indexPatternService.setup({ getIndexPattern: i });
52103
51980
  }, []), useEffect(() => {
52104
51981
  if (!Array.isArray(n) || n.length === 0) return;
52105
- let e = n.find((e) => e.name === u?.index);
52106
- (!e || e.disabled) && (e = n.find((e) => !e.disabled)), e && S(e.name, u?.timeField);
51982
+ let e = n.find((e) => e.name === s?.index);
51983
+ (!e || e.disabled) && (e = n.find((e) => !e.disabled)), e && S(e.name, s?.timeField);
52107
51984
  }, [
52108
51985
  n,
52109
- u?.index,
52110
- u?.timeField
51986
+ s?.index,
51987
+ s?.timeField
52111
51988
  ]), useEffect(() => {
52112
51989
  x.current = {
52113
51990
  pendingIndex: null,
52114
51991
  loadedIndex: null
52115
51992
  };
52116
51993
  }, [n]), t ? /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(Spin, { spinning: t }) }) : !n || n.length === 0 || !y ? /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(Empty, { image: Empty.PRESENTED_IMAGE_SIMPLE }) }) : /* @__PURE__ */ jsx(GlobalConfigContext.Provider, {
52117
- value: { i18n: g },
51994
+ value: { i18n: m },
52118
51995
  children: /* @__PURE__ */ jsx(Discover, {
52119
51996
  indices: n,
52120
51997
  indexPattern: y,
52121
51998
  setIndexPattern: b,
52122
51999
  onIndexPatternChange: S,
52123
52000
  onSearch: a,
52124
- scrollableTarget: s,
52125
- queryParams: u,
52126
- setQueryParams: f,
52127
- locale: p,
52128
- theme: m
52001
+ queryParams: s,
52002
+ setQueryParams: u,
52003
+ locale: f,
52004
+ theme: p,
52005
+ exportMaxSize: g
52129
52006
  })
52130
52007
  });
52131
52008
  };