@kong-ui-public/dashboard-renderer 0.32.21 → 0.32.22

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,25 +1,25 @@
1
- import { ref as I, watchEffect as ye, inject as j, defineComponent as S, onUnmounted as ae, computed as g, watch as he, resolveComponent as P, unref as l, openBlock as d, createBlock as v, withCtx as b, createTextVNode as G, toDisplayString as F, renderSlot as H, createCommentVNode as k, useCssVars as B, createElementVNode as N, createVNode as T, mergeProps as ie, createSlots as se, createElementBlock as E, normalizeProps as me, guardReactiveProps as fe, resolveDynamicComponent as ge, onMounted as ve, Fragment as be, renderList as _e, normalizeClass as qe, normalizeStyle as X } from "vue";
2
- import { SimpleChart as Ce, AnalyticsChart as Ee, TopNTable as Se, CsvExportModal as xe, ChartMetricDisplay as Te } from "@kong-ui-public/analytics-chart";
3
- import Ae from "swrv";
1
+ import { ref as k, watchEffect as he, inject as j, defineComponent as S, onUnmounted as ie, computed as g, watch as me, resolveComponent as P, unref as l, openBlock as d, createBlock as v, withCtx as b, createTextVNode as G, toDisplayString as F, renderSlot as H, createCommentVNode as I, useCssVars as V, createElementVNode as N, createVNode as T, mergeProps as se, createSlots as ce, createElementBlock as E, normalizeProps as fe, guardReactiveProps as ge, resolveDynamicComponent as ve, onMounted as be, Fragment as _e, renderList as qe, normalizeClass as Ce, normalizeStyle as X } from "vue";
2
+ import { SimpleChart as Ee, AnalyticsChart as Se, TopNTable as xe, CsvExportModal as Te, ChartMetricDisplay as Ae } from "@kong-ui-public/analytics-chart";
3
+ import Re from "swrv";
4
4
  import "axios";
5
- import { createI18n as De, i18nTComponent as Re } from "@kong-ui-public/i18n";
6
- import { stripUnknownFilters as ke, Timeframe as Ie, TimePeriods as we, msToGranularity as Oe, granularityValues as Fe, exploreFilterTypesV2 as Pe, exploreAggregations as Le, queryableExploreDimensions as Ne, filterableExploreDimensions as je, basicExploreAggregations as ze, queryableBasicExploreDimensions as $e, filterableBasicExploreDimensions as Ke, aiExploreAggregations as Be, queryableAiExploreDimensions as Ve, filterableAiExploreDimensions as Me, relativeTimeRangeValuesV4 as Ue } from "@kong-ui-public/analytics-utilities";
7
- import { MetricsProvider as Ge, MetricsConsumer as He } from "@kong-ui-public/analytics-metric-provider";
8
- import { EntityLink as Qe } from "@kong-ui-public/entities-shared";
9
- import { EditIcon as Je, MoreIcon as Ze } from "@kong/icons";
10
- import { useAnalyticsConfigStore as We } from "@kong-ui-public/analytics-config-store";
11
- var ce = /* @__PURE__ */ ((e) => (e.VALIDATING = "VALIDATING", e.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", e.PENDING = "PENDING", e.SUCCESS = "SUCCESS", e.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", e.ERROR = "ERROR", e.STALE_IF_ERROR = "STALE_IF_ERROR", e))(ce || {});
12
- const Ye = (e) => {
5
+ import { createI18n as De, i18nTComponent as Ie } from "@kong-ui-public/i18n";
6
+ import { stripUnknownFilters as ke, Timeframe as we, TimePeriods as Oe, msToGranularity as Fe, granularityValues as Pe, exploreFilterTypesV2 as ee, requestFilterTypeEmptyV2 as Le, exploreAggregations as Ne, queryableExploreDimensions as je, filterableExploreDimensions as ze, basicExploreAggregations as $e, queryableBasicExploreDimensions as Ke, filterableBasicExploreDimensions as Ve, aiExploreAggregations as Be, queryableAiExploreDimensions as Me, filterableAiExploreDimensions as Ue, relativeTimeRangeValuesV4 as Ge } from "@kong-ui-public/analytics-utilities";
7
+ import { MetricsProvider as He, MetricsConsumer as Qe } from "@kong-ui-public/analytics-metric-provider";
8
+ import { EntityLink as Je } from "@kong-ui-public/entities-shared";
9
+ import { EditIcon as Ze, MoreIcon as We } from "@kong/icons";
10
+ import { useAnalyticsConfigStore as Ye } from "@kong-ui-public/analytics-config-store";
11
+ var le = /* @__PURE__ */ ((e) => (e.VALIDATING = "VALIDATING", e.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", e.PENDING = "PENDING", e.SUCCESS = "SUCCESS", e.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", e.ERROR = "ERROR", e.STALE_IF_ERROR = "STALE_IF_ERROR", e))(le || {});
12
+ const Xe = (e) => {
13
13
  var r, t, o, i, n;
14
14
  return e ? !!// TODO: revisit: currently only the first check ever matters?
15
15
  ((r = Object.keys(e)) != null && r.length || (t = e.data) != null && t.length || (i = (o = e.data) == null ? void 0 : o.data) != null && i.length || !((n = e.data) != null && n.data) && typeof e.data == "object" && Object.keys(e == null ? void 0 : e.data).length) : !1;
16
16
  };
17
- function Xe(e = I({}), r, t, o = Ye) {
18
- const i = I(
17
+ function et(e = k({}), r, t, o = Xe) {
18
+ const i = k(
19
19
  "PENDING"
20
20
  /* PENDING */
21
21
  );
22
- return ye(() => {
22
+ return he(() => {
23
23
  const n = o(e.value);
24
24
  if (e.value && n && t.value) {
25
25
  i.value = "VALIDATING_HAS_DATA";
@@ -48,10 +48,10 @@ function Xe(e = I({}), r, t, o = Ye) {
48
48
  e.value === void 0 && r && (i.value = "ERROR");
49
49
  }), {
50
50
  state: i,
51
- swrvState: ce
51
+ swrvState: le
52
52
  };
53
53
  }
54
- const et = {
54
+ const tt = {
55
55
  noQueryBridge: "No query bridge provided. Unable to render dashboard.",
56
56
  trendRange: {
57
57
  "24h": "Last 24-Hour Summary",
@@ -59,35 +59,35 @@ const et = {
59
59
  "30d": "Last 30-Day Summary"
60
60
  },
61
61
  edit: "Edit"
62
- }, tt = {
63
- timeRangeExceeded: "The time range for this report is outside of your organization's data retention period"
64
62
  }, rt = {
63
+ timeRangeExceeded: "The time range for this report is outside of your organization's data retention period"
64
+ }, ot = {
65
65
  defaultFilename: "Chart Export",
66
66
  exportAsCsv: "Export as CSV"
67
- }, ot = "Explore", nt = {
68
- renderer: et,
69
- queryDataProvider: tt,
70
- csvExport: rt,
71
- jumpToExplore: ot
67
+ }, nt = "Explore", at = {
68
+ renderer: tt,
69
+ queryDataProvider: rt,
70
+ csvExport: ot,
71
+ jumpToExplore: nt
72
72
  };
73
- function at() {
74
- const e = De("en-us", nt);
73
+ function it() {
74
+ const e = De("en-us", at);
75
75
  return {
76
76
  i18n: e,
77
- i18nT: Re(e)
77
+ i18nT: Ie(e)
78
78
  // Translation component <i18n-t>
79
79
  };
80
80
  }
81
- const V = 170, z = "analytics-query-provider", ee = "{entity-id}", it = "{cp-id}", st = "{timeframe}", ct = 30 * 1e3;
82
- function lt() {
81
+ const B = 170, z = "analytics-query-provider", te = "{entity-id}", st = "{cp-id}", ct = "{timeframe}", lt = 30 * 1e3;
82
+ function ut() {
83
83
  const e = j(z);
84
84
  return {
85
85
  evaluateFeatureFlag: (t, o) => e ? e.evaluateFeatureFlagFn(t, o) : o
86
86
  };
87
87
  }
88
88
  const w = {
89
- useI18n: at,
90
- useEvaluateFeatureFlag: lt
89
+ useI18n: it,
90
+ useEvaluateFeatureFlag: ut
91
91
  }, Q = /* @__PURE__ */ S({
92
92
  __name: "QueryDataProvider",
93
93
  props: {
@@ -99,13 +99,13 @@ const w = {
99
99
  emits: ["chart-data", "queryComplete"],
100
100
  setup(e, { emit: r }) {
101
101
  const t = e, o = r, { i18n: i } = w.useI18n(), n = j(z), c = () => t.queryReady && n ? JSON.stringify([t.query, t.context, t.refreshCounter]) : null, a = new AbortController();
102
- ae(() => {
102
+ ie(() => {
103
103
  a.abort();
104
104
  });
105
105
  const u = (p, f, _) => {
106
106
  const q = [];
107
107
  return f && q.push(...f), q.push(...ke(p, _)), q;
108
- }, { data: y, error: A, isValidating: D } = Ae(c, async () => {
108
+ }, { data: y, error: A, isValidating: R } = Re(c, async () => {
109
109
  var p, f, _, q;
110
110
  try {
111
111
  let {
@@ -126,15 +126,15 @@ const w = {
126
126
  };
127
127
  return n == null ? void 0 : n.queryFn(U, a);
128
128
  } catch (s) {
129
- R.value = ((f = (p = s == null ? void 0 : s.response) == null ? void 0 : p.data) == null ? void 0 : f.message) === "Range not allowed for this tier" ? i.t("queryDataProvider.timeRangeExceeded") : ((q = (_ = s == null ? void 0 : s.response) == null ? void 0 : _.data) == null ? void 0 : q.message) || (s == null ? void 0 : s.message);
129
+ D.value = ((f = (p = s == null ? void 0 : s.response) == null ? void 0 : p.data) == null ? void 0 : f.message) === "Range not allowed for this tier" ? i.t("queryDataProvider.timeRangeExceeded") : ((q = (_ = s == null ? void 0 : s.response) == null ? void 0 : _.data) == null ? void 0 : q.message) || (s == null ? void 0 : s.message);
130
130
  } finally {
131
131
  o("queryComplete");
132
132
  }
133
133
  }, {
134
134
  refreshInterval: t.context.refreshInterval,
135
135
  revalidateOnFocus: !1
136
- }), { state: m, swrvState: x } = Xe(y, A, D), R = I(null), h = g(() => m.value === x.ERROR || !!R.value), C = g(() => !t.queryReady || m.value === x.PENDING);
137
- return he(y, (p) => {
136
+ }), { state: m, swrvState: x } = et(y, A, R), D = k(null), h = g(() => m.value === x.ERROR || !!D.value), C = g(() => !t.queryReady || m.value === x.PENDING);
137
+ return me(y, (p) => {
138
138
  p && o("chart-data", p);
139
139
  }), (p, f) => {
140
140
  const _ = P("KSkeleton"), q = P("KEmptyState");
@@ -149,16 +149,16 @@ const w = {
149
149
  "icon-variant": "error"
150
150
  }, {
151
151
  default: b(() => [
152
- G(F(R.value), 1)
152
+ G(F(D.value), 1)
153
153
  ]),
154
154
  _: 1
155
155
  })) : l(y) ? H(p.$slots, "default", {
156
156
  key: 2,
157
157
  data: l(y)
158
- }) : k("", !0);
158
+ }) : I("", !0);
159
159
  };
160
160
  }
161
- }), ut = { class: "analytics-chart" }, dt = /* @__PURE__ */ S({
161
+ }), dt = { class: "analytics-chart" }, pt = /* @__PURE__ */ S({
162
162
  __name: "SimpleChartRenderer",
163
163
  props: {
164
164
  query: {},
@@ -169,7 +169,7 @@ const w = {
169
169
  refreshCounter: {}
170
170
  },
171
171
  setup(e) {
172
- B((t) => ({
172
+ V((t) => ({
173
173
  bc149350: `${t.height}px`
174
174
  }));
175
175
  const r = e;
@@ -180,8 +180,8 @@ const w = {
180
180
  "refresh-counter": t.refreshCounter
181
181
  }, {
182
182
  default: b(({ data: i }) => [
183
- N("div", ut, [
184
- T(l(Ce), {
183
+ N("div", dt, [
184
+ T(l(Ee), {
185
185
  "chart-data": i,
186
186
  "chart-options": r.chartOptions,
187
187
  "synthetics-data-key": t.chartOptions.syntheticsDataKey
@@ -196,7 +196,7 @@ const w = {
196
196
  for (const [o, i] of r)
197
197
  t[o] = i;
198
198
  return t;
199
- }, pt = /* @__PURE__ */ L(dt, [["__scopeId", "data-v-e770c4a0"]]), yt = { class: "analytics-chart" }, ht = /* @__PURE__ */ S({
199
+ }, yt = /* @__PURE__ */ L(pt, [["__scopeId", "data-v-e770c4a0"]]), ht = { class: "analytics-chart" }, mt = /* @__PURE__ */ S({
200
200
  __name: "BaseAnalyticsChartRenderer",
201
201
  props: {
202
202
  query: {},
@@ -227,21 +227,21 @@ const w = {
227
227
  return "";
228
228
  }), A = () => {
229
229
  o("edit-tile");
230
- }, D = (m) => {
230
+ }, R = (m) => {
231
231
  o("chart-data", m);
232
232
  };
233
233
  return (m, x) => {
234
- const R = P("KDropdownItem");
234
+ const D = P("KDropdownItem");
235
235
  return d(), v(Q, {
236
236
  context: m.context,
237
237
  query: m.query,
238
238
  "query-ready": m.queryReady,
239
239
  "refresh-counter": m.refreshCounter,
240
- onChartData: D
240
+ onChartData: R
241
241
  }, {
242
242
  default: b(({ data: h }) => [
243
- N("div", yt, [
244
- T(l(Ee), ie({
243
+ N("div", ht, [
244
+ T(l(Se), se({
245
245
  "allow-csv-export": m.chartOptions.allowCsvExport,
246
246
  "chart-data": h,
247
247
  "chart-options": u.value,
@@ -251,11 +251,11 @@ const w = {
251
251
  "show-menu": m.context.editable,
252
252
  "synthetics-data-key": m.chartOptions.syntheticsDataKey,
253
253
  "tooltip-title": ""
254
- }, m.extraProps), se({ _: 2 }, [
254
+ }, m.extraProps), ce({ _: 2 }, [
255
255
  m.context.editable ? {
256
256
  name: "menu-items",
257
257
  fn: b(() => [
258
- T(R, { onClick: A }, {
258
+ T(D, { onClick: A }, {
259
259
  default: b(() => [
260
260
  G(F(l(n).t("renderer.edit")), 1)
261
261
  ]),
@@ -271,7 +271,7 @@ const w = {
271
271
  }, 8, ["context", "query", "query-ready", "refresh-counter"]);
272
272
  };
273
273
  }
274
- }), le = /* @__PURE__ */ L(ht, [["__scopeId", "data-v-1bc587d3"]]), te = /* @__PURE__ */ S({
274
+ }), ue = /* @__PURE__ */ L(mt, [["__scopeId", "data-v-1bc587d3"]]), re = /* @__PURE__ */ S({
275
275
  __name: "BarChartRenderer",
276
276
  props: {
277
277
  query: {},
@@ -282,7 +282,7 @@ const w = {
282
282
  refreshCounter: {}
283
283
  },
284
284
  setup(e) {
285
- return (r, t) => (d(), v(le, {
285
+ return (r, t) => (d(), v(ue, {
286
286
  "chart-options": r.chartOptions,
287
287
  context: r.context,
288
288
  "extra-props": { showAnnotations: !1 },
@@ -292,7 +292,7 @@ const w = {
292
292
  "refresh-counter": r.refreshCounter
293
293
  }, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
294
294
  }
295
- }), re = /* @__PURE__ */ S({
295
+ }), oe = /* @__PURE__ */ S({
296
296
  __name: "TimeseriesChartRenderer",
297
297
  props: {
298
298
  query: {},
@@ -303,7 +303,7 @@ const w = {
303
303
  refreshCounter: {}
304
304
  },
305
305
  setup(e) {
306
- return (r, t) => (d(), v(le, {
306
+ return (r, t) => (d(), v(ue, {
307
307
  "chart-options": r.chartOptions,
308
308
  context: r.context,
309
309
  height: r.height,
@@ -312,7 +312,7 @@ const w = {
312
312
  "refresh-counter": r.refreshCounter
313
313
  }, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
314
314
  }
315
- }), mt = { class: "metric-card-tile-wrapper" }, ft = /* @__PURE__ */ S({
315
+ }), ft = { class: "metric-card-tile-wrapper" }, gt = /* @__PURE__ */ S({
316
316
  __name: "GoldenSignalsRenderer",
317
317
  props: {
318
318
  query: {},
@@ -323,7 +323,7 @@ const w = {
323
323
  refreshCounter: {}
324
324
  },
325
325
  setup(e) {
326
- B((c) => ({
326
+ V((c) => ({
327
327
  "3e99e905": l(o) ? "90%" : "100%",
328
328
  "345e89d8": l(o) ? "auto" : "100%",
329
329
  "7fa58fd9": l(o) ? "100%" : "none"
@@ -331,7 +331,7 @@ const w = {
331
331
  const r = e, { evaluateFeatureFlag: t } = w.useEvaluateFeatureFlag(), o = t("ma-3043-analytics-chart-kebab-menu", !1), i = g(() => {
332
332
  const c = r.context.timeSpec;
333
333
  if (c.type === "absolute")
334
- return new Ie({
334
+ return new we({
335
335
  key: "custom",
336
336
  timeframeText: "custom",
337
337
  display: "custom",
@@ -343,7 +343,7 @@ const w = {
343
343
  isRelative: !1,
344
344
  allowedTiers: ["free", "plus", "enterprise"]
345
345
  });
346
- const a = we.get(c.time_range);
346
+ const a = Oe.get(c.time_range);
347
347
  if (!a)
348
348
  throw new Error("Unknown time range");
349
349
  return a;
@@ -367,16 +367,16 @@ const w = {
367
367
  refreshCounter: r.refreshCounter
368
368
  };
369
369
  });
370
- return (c, a) => (d(), E("div", mt, [
371
- T(l(Ge), me(fe(n.value)), {
370
+ return (c, a) => (d(), E("div", ft, [
371
+ T(l(He), fe(ge(n.value)), {
372
372
  default: b(() => [
373
- T(l(He))
373
+ T(l(Qe))
374
374
  ]),
375
375
  _: 1
376
376
  }, 16)
377
377
  ]));
378
378
  }
379
- }), gt = /* @__PURE__ */ L(ft, [["__scopeId", "data-v-84c4c1c8"]]), oe = "#6c7489", ne = "20px", ue = "20px", vt = /* @__PURE__ */ S({
379
+ }), vt = /* @__PURE__ */ L(gt, [["__scopeId", "data-v-84c4c1c8"]]), ne = "#6c7489", ae = "20px", de = "20px", bt = /* @__PURE__ */ S({
380
380
  __name: "TopNTableRenderer",
381
381
  props: {
382
382
  query: {},
@@ -392,9 +392,9 @@ const w = {
392
392
  if ((c = r.chartOptions) != null && c.entityLink)
393
393
  if (n.id.includes(":")) {
394
394
  const [a, u] = n.id.split(":");
395
- return r.chartOptions.entityLink.replace(it, a).replace(ee, u);
395
+ return r.chartOptions.entityLink.replace(st, a).replace(te, u);
396
396
  } else
397
- return r.chartOptions.entityLink.replace(ee, n.id);
397
+ return r.chartOptions.entityLink.replace(te, n.id);
398
398
  return "";
399
399
  };
400
400
  return (n, c) => (d(), v(Q, {
@@ -404,16 +404,16 @@ const w = {
404
404
  "refresh-counter": n.refreshCounter
405
405
  }, {
406
406
  default: b(({ data: a }) => [
407
- T(l(Se), {
407
+ T(l(xe), {
408
408
  data: a,
409
409
  description: !l(o) && n.chartOptions.description || "",
410
410
  "synthetics-data-key": n.chartOptions.syntheticsDataKey,
411
411
  title: !l(o) && n.chartOptions.chartTitle || ""
412
- }, se({ _: 2 }, [
412
+ }, ce({ _: 2 }, [
413
413
  r.chartOptions.entityLink ? {
414
414
  name: "name",
415
415
  fn: b(({ record: u }) => [
416
- T(l(Qe), {
416
+ T(l(Je), {
417
417
  "entity-link-data": {
418
418
  id: u.id,
419
419
  label: u.name,
@@ -429,33 +429,33 @@ const w = {
429
429
  _: 1
430
430
  }, 8, ["context", "query", "query-ready", "refresh-counter"]));
431
431
  }
432
- }), bt = { class: "tile-boundary" }, _t = {
432
+ }), _t = { class: "tile-boundary" }, qt = {
433
433
  key: 0,
434
434
  class: "tile-header"
435
- }, qt = { class: "title" }, Ct = {
435
+ }, Ct = { class: "title" }, Et = {
436
436
  key: 0,
437
437
  class: "tile-actions"
438
- }, Et = {
438
+ }, St = {
439
439
  class: "chart-export-trigger",
440
440
  "data-testid": "csv-export-button"
441
- }, St = {
441
+ }, xt = {
442
442
  key: 1,
443
443
  class: "header-description"
444
- }, xt = { class: "tile-content" }, Tt = /* @__PURE__ */ S({
444
+ }, Tt = { class: "tile-content" }, At = /* @__PURE__ */ S({
445
445
  __name: "DashboardTile",
446
446
  props: {
447
447
  definition: {},
448
448
  context: {},
449
- height: { default: V },
449
+ height: { default: B },
450
450
  queryReady: { type: Boolean },
451
451
  refreshCounter: {}
452
452
  },
453
453
  emits: ["edit-tile"],
454
454
  setup(e, { emit: r }) {
455
- B((s) => ({
455
+ V((s) => ({
456
456
  "1cbe86ac": `${s.height}px`
457
457
  }));
458
- const t = parseInt(ue, 10), o = e, i = r, n = j(z), { evaluateFeatureFlag: c } = w.useEvaluateFeatureFlag(), { i18n: a } = w.useI18n(), u = c("ma-3043-analytics-chart-kebab-menu", !1), y = I(), A = I(!1), D = g(() => {
458
+ const t = parseInt(de, 10), o = e, i = r, n = j(z), { evaluateFeatureFlag: c } = w.useEvaluateFeatureFlag(), { i18n: a } = w.useI18n(), u = c("ma-3043-analytics-chart-kebab-menu", !1), y = k(), A = k(!1), R = g(() => {
459
459
  if (n && n.exploreBaseUrl) {
460
460
  const s = {
461
461
  filters: [...o.context.filters, ...o.definition.query.filters ?? []],
@@ -467,17 +467,17 @@ const w = {
467
467
  return `${n.exploreBaseUrl()}?q=${JSON.stringify(s)}&d=${O}&c=${o.definition.chart.type}`;
468
468
  }
469
469
  return "";
470
- }), m = g(() => a.t("csvExport.defaultFilename")), x = g(() => u && !["golden_signals", "top_n", "gauge"].includes(o.definition.chart.type)), R = {
471
- timeseries_line: re,
472
- timeseries_bar: re,
473
- horizontal_bar: te,
474
- vertical_bar: te,
475
- gauge: pt,
476
- golden_signals: gt,
477
- top_n: vt,
470
+ }), m = g(() => a.t("csvExport.defaultFilename")), x = g(() => u && !["golden_signals", "top_n", "gauge"].includes(o.definition.chart.type)), D = {
471
+ timeseries_line: oe,
472
+ timeseries_bar: oe,
473
+ horizontal_bar: re,
474
+ vertical_bar: re,
475
+ gauge: yt,
476
+ golden_signals: vt,
477
+ top_n: bt,
478
478
  slottable: void 0
479
479
  }, h = g(() => {
480
- const s = R[o.definition.chart.type];
480
+ const s = D[o.definition.chart.type];
481
481
  return s && {
482
482
  component: s,
483
483
  rendererProps: {
@@ -489,7 +489,7 @@ const w = {
489
489
  refreshCounter: o.refreshCounter
490
490
  }
491
491
  };
492
- }), C = g(() => y.value ? Oe(y.value.meta.granularity_ms) : void 0), p = () => {
492
+ }), C = g(() => y.value ? Fe(y.value.meta.granularity_ms) : void 0), p = () => {
493
493
  i("edit-tile", o.definition);
494
494
  }, f = (s) => {
495
495
  y.value = s;
@@ -500,65 +500,65 @@ const w = {
500
500
  };
501
501
  return (s, O) => {
502
502
  const K = P("KDropdownItem"), U = P("KDropdown");
503
- return d(), E("div", bt, [
504
- l(u) && s.definition.chart.type !== "slottable" ? (d(), E("div", _t, [
505
- N("div", qt, F(s.definition.chart.chartTitle), 1),
506
- x.value ? (d(), E("div", Ct, [
507
- s.context.editable ? (d(), v(l(Je), {
503
+ return d(), E("div", _t, [
504
+ l(u) && s.definition.chart.type !== "slottable" ? (d(), E("div", qt, [
505
+ N("div", Ct, F(s.definition.chart.chartTitle), 1),
506
+ x.value ? (d(), E("div", Et, [
507
+ s.context.editable ? (d(), v(l(Ze), {
508
508
  key: 0,
509
509
  class: "edit-icon",
510
- color: l(oe),
511
- size: l(ne),
510
+ color: l(ne),
511
+ size: l(ae),
512
512
  onClick: p
513
- }, null, 8, ["color", "size"])) : k("", !0),
513
+ }, null, 8, ["color", "size"])) : I("", !0),
514
514
  T(U, {
515
515
  class: "dropdown",
516
516
  "data-testid": "chart-action-menu",
517
517
  "kpop-attributes": { placement: "bottom-end" }
518
518
  }, {
519
519
  items: b(() => [
520
- D.value ? (d(), v(K, {
520
+ R.value ? (d(), v(K, {
521
521
  key: 0,
522
522
  "data-testid": "chart-jump-to-explore",
523
- item: { label: l(a).t("jumpToExplore"), to: D.value }
524
- }, null, 8, ["item"])) : k("", !0),
523
+ item: { label: l(a).t("jumpToExplore"), to: R.value }
524
+ }, null, 8, ["item"])) : I("", !0),
525
525
  "allowCsvExport" in s.definition.chart && s.definition.chart.allowCsvExport ? (d(), v(K, {
526
526
  key: 1,
527
527
  class: "chart-export-button",
528
528
  "data-testid": "chart-csv-export",
529
- onClick: O[0] || (O[0] = (Jt) => q())
529
+ onClick: O[0] || (O[0] = (Zt) => q())
530
530
  }, {
531
531
  default: b(() => [
532
- N("span", Et, F(l(a).t("csvExport.exportAsCsv")), 1)
532
+ N("span", St, F(l(a).t("csvExport.exportAsCsv")), 1)
533
533
  ]),
534
534
  _: 1
535
- })) : k("", !0)
535
+ })) : I("", !0)
536
536
  ]),
537
537
  default: b(() => [
538
- T(l(Ze), {
538
+ T(l(We), {
539
539
  class: "kebab-action-menu",
540
- color: l(oe),
540
+ color: l(ne),
541
541
  "data-testid": "kebab-action-menu",
542
- size: l(ne)
542
+ size: l(ae)
543
543
  }, null, 8, ["color", "size"])
544
544
  ]),
545
545
  _: 1
546
546
  })
547
- ])) : "description" in s.definition.chart ? (d(), E("div", St, F(s.definition.chart.description), 1)) : k("", !0),
548
- A.value ? (d(), v(l(xe), {
547
+ ])) : "description" in s.definition.chart ? (d(), E("div", xt, F(s.definition.chart.description), 1)) : I("", !0),
548
+ A.value ? (d(), v(l(Te), {
549
549
  key: 2,
550
550
  "chart-data": y.value,
551
551
  filename: m.value,
552
552
  onToggleModal: _
553
- }, null, 8, ["chart-data", "filename"])) : k("", !0)
554
- ])) : k("", !0),
555
- N("div", xt, [
556
- h.value ? (d(), v(ge(h.value.component), ie({ key: 0 }, h.value.rendererProps, { onChartData: f }), null, 16)) : k("", !0)
553
+ }, null, 8, ["chart-data", "filename"])) : I("", !0)
554
+ ])) : I("", !0),
555
+ N("div", Tt, [
556
+ h.value ? (d(), v(ve(h.value.component), se({ key: 0 }, h.value.rendererProps, { onChartData: f }), null, 16)) : I("", !0)
557
557
  ])
558
558
  ]);
559
559
  };
560
560
  }
561
- }), At = /* @__PURE__ */ L(Tt, [["__scopeId", "data-v-94b33bca"]]), Dt = (e, r, t) => {
561
+ }), Rt = /* @__PURE__ */ L(At, [["__scopeId", "data-v-94b33bca"]]), Dt = (e, r, t) => {
562
562
  const o = /* @__PURE__ */ new Map();
563
563
  t.forEach((n) => {
564
564
  const c = n.layout.position.row, a = o.get(c), u = n.layout.size.rows === 1 && !!n.layout.size.fitToContent;
@@ -568,7 +568,7 @@ const w = {
568
568
  for (let n = 0; n < e; n++)
569
569
  o.get(n) ? i.push("auto") : i.push(`${r}px`);
570
570
  return i;
571
- }, Rt = /* @__PURE__ */ S({
571
+ }, It = /* @__PURE__ */ S({
572
572
  __name: "GridLayout",
573
573
  props: {
574
574
  gridSize: {
@@ -578,7 +578,7 @@ const w = {
578
578
  tileHeight: {
579
579
  type: Number,
580
580
  required: !1,
581
- default: () => V
581
+ default: () => B
582
582
  },
583
583
  tiles: {
584
584
  type: Array,
@@ -586,18 +586,18 @@ const w = {
586
586
  }
587
587
  },
588
588
  setup(e) {
589
- B((a) => ({
589
+ V((a) => ({
590
590
  "3bc5e939": e.gridSize.cols,
591
591
  "77aa3028": n.value
592
592
  }));
593
- const r = e, t = I(null), o = I(0), i = new ResizeObserver((a) => {
593
+ const r = e, t = k(null), o = k(0), i = new ResizeObserver((a) => {
594
594
  window.requestAnimationFrame(() => {
595
595
  !Array.isArray(a) || !a.length || (o.value = a[0].contentRect.width);
596
596
  });
597
597
  });
598
- ve(() => {
598
+ be(() => {
599
599
  t.value && i.observe(t.value);
600
- }), ae(() => {
600
+ }), ie(() => {
601
601
  t.value && i.unobserve(t.value);
602
602
  });
603
603
  const n = g(() => {
@@ -618,9 +618,9 @@ const w = {
618
618
  ref: t,
619
619
  class: "kong-ui-public-grid-layout"
620
620
  }, [
621
- (d(!0), E(be, null, _e(c.value, (y) => (d(), E("div", {
621
+ (d(!0), E(_e, null, qe(c.value, (y) => (d(), E("div", {
622
622
  key: y.key,
623
- class: qe(["grid-cell", {
623
+ class: Ce(["grid-cell", {
624
624
  "empty-cell": !y.tile
625
625
  }]),
626
626
  style: X(y.style)
@@ -632,10 +632,10 @@ const w = {
632
632
  ], 6))), 128))
633
633
  ], 512));
634
634
  }
635
- }), kt = /* @__PURE__ */ L(Rt, [["__scopeId", "data-v-f43eb7b8"]]), It = { class: "kong-ui-public-dashboard-renderer" }, wt = {
635
+ }), kt = /* @__PURE__ */ L(It, [["__scopeId", "data-v-f43eb7b8"]]), wt = { class: "kong-ui-public-dashboard-renderer" }, Ot = {
636
636
  key: 0,
637
637
  class: "tile-container"
638
- }, Ot = /* @__PURE__ */ S({
638
+ }, Ft = /* @__PURE__ */ S({
639
639
  __name: "DashboardRenderer",
640
640
  props: {
641
641
  context: {},
@@ -643,16 +643,16 @@ const w = {
643
643
  },
644
644
  emits: ["edit-tile"],
645
645
  setup(e, { expose: r, emit: t }) {
646
- const o = e, i = t, { i18n: n } = w.useI18n(), c = I(0), a = j(z);
646
+ const o = e, i = t, { i18n: n } = w.useI18n(), c = k(0), a = j(z);
647
647
  a || (console.warn("Analytics dashboards require a query bridge supplied via provide / inject."), console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"), console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements"));
648
- const u = We(), y = g(() => o.context.timeSpec ? o.context.timeSpec : {
648
+ const u = Ye(), y = g(() => o.context.timeSpec ? o.context.timeSpec : {
649
649
  type: "relative",
650
650
  time_range: u.defaultQueryTimeForOrg
651
- }), A = g(() => !!o.context.timeSpec || !u.loading), D = g(() => o.config.tiles.map((h, C) => {
651
+ }), A = g(() => !!o.context.timeSpec || !u.loading), R = g(() => o.config.tiles.map((h, C) => {
652
652
  var f;
653
653
  let p = h.definition;
654
654
  if ("description" in p.chart) {
655
- const _ = (f = p.chart.description) == null ? void 0 : f.replace(st, () => {
655
+ const _ = (f = p.chart.description) == null ? void 0 : f.replace(ct, () => {
656
656
  const s = `renderer.trendRange.${y.value.type === "absolute" ? "custom" : y.value.time_range}`;
657
657
  return n.te(s) ? n.t(s) : "";
658
658
  });
@@ -672,7 +672,7 @@ const w = {
672
672
  };
673
673
  })), m = g(() => {
674
674
  let { tz: h, refreshInterval: C, editable: p } = o.context;
675
- return h || (h = new Intl.DateTimeFormat().resolvedOptions().timeZone), C === void 0 && (C = ct), p === void 0 && (p = !1), {
675
+ return h || (h = new Intl.DateTimeFormat().resolvedOptions().timeZone), C === void 0 && (C = lt), p === void 0 && (p = !1), {
676
676
  ...o.context,
677
677
  tz: h,
678
678
  timeSpec: y.value,
@@ -686,22 +686,22 @@ const w = {
686
686
  c.value++;
687
687
  } }), (h, C) => {
688
688
  const p = P("KAlert");
689
- return d(), E("div", It, [
689
+ return d(), E("div", wt, [
690
690
  l(a) ? (d(), v(kt, {
691
691
  key: 1,
692
692
  "grid-size": h.config.gridSize,
693
693
  "tile-height": h.config.tileHeight,
694
- tiles: D.value
694
+ tiles: R.value
695
695
  }, {
696
696
  tile: b(({ tile: f }) => [
697
- f.meta.chart.type === "slottable" ? (d(), E("div", wt, [
697
+ f.meta.chart.type === "slottable" ? (d(), E("div", Ot, [
698
698
  H(h.$slots, f.meta.chart.id, {}, void 0, !0)
699
- ])) : (d(), v(At, {
699
+ ])) : (d(), v(Rt, {
700
700
  key: 1,
701
701
  class: "tile-container",
702
702
  context: m.value,
703
703
  definition: f.meta,
704
- height: f.layout.size.rows * (h.config.tileHeight || l(V)) + parseInt(l(ue), 10),
704
+ height: f.layout.size.rows * (h.config.tileHeight || l(B)) + parseInt(l(de), 10),
705
705
  "query-ready": A.value,
706
706
  "refresh-counter": c.value,
707
707
  onEditTile: (_) => x(f)
@@ -720,7 +720,7 @@ const w = {
720
720
  ]);
721
721
  };
722
722
  }
723
- }), ir = /* @__PURE__ */ L(Ot, [["__scopeId", "data-v-26130807"]]), sr = [
723
+ }), sr = /* @__PURE__ */ L(Ft, [["__scopeId", "data-v-26130807"]]), cr = [
724
724
  "horizontal_bar",
725
725
  "vertical_bar",
726
726
  "gauge",
@@ -733,9 +733,9 @@ const w = {
733
733
  type: "string"
734
734
  }, $ = {
735
735
  type: "string"
736
- }, de = {
737
- type: "boolean"
738
736
  }, pe = {
737
+ type: "boolean"
738
+ }, ye = {
739
739
  type: ["object", "array"],
740
740
  items: {
741
741
  type: "string"
@@ -743,7 +743,7 @@ const w = {
743
743
  additionalProperties: {
744
744
  type: "string"
745
745
  }
746
- }, Ft = {
746
+ }, Pt = {
747
747
  type: "object",
748
748
  properties: {
749
749
  type: {
@@ -756,7 +756,7 @@ const w = {
756
756
  },
757
757
  required: ["type", "id"],
758
758
  additionalProperties: !1
759
- }, Pt = {
759
+ }, Lt = {
760
760
  type: "object",
761
761
  properties: {
762
762
  type: {
@@ -766,14 +766,14 @@ const w = {
766
766
  stacked: {
767
767
  type: "boolean"
768
768
  },
769
- chartDatasetColors: pe,
769
+ chartDatasetColors: ye,
770
770
  syntheticsDataKey: M,
771
771
  chartTitle: $,
772
- allowCsvExport: de
772
+ allowCsvExport: pe
773
773
  },
774
774
  required: ["type"],
775
775
  additionalProperties: !1
776
- }, Lt = {
776
+ }, Nt = {
777
777
  type: "object",
778
778
  properties: {
779
779
  type: {
@@ -789,14 +789,14 @@ const w = {
789
789
  type: "number"
790
790
  }
791
791
  },
792
- chartDatasetColors: pe,
792
+ chartDatasetColors: ye,
793
793
  syntheticsDataKey: M,
794
794
  chartTitle: $,
795
- allowCsvExport: de
795
+ allowCsvExport: pe
796
796
  },
797
797
  required: ["type"],
798
798
  additionalProperties: !1
799
- }, Nt = {
799
+ }, jt = {
800
800
  type: "object",
801
801
  properties: {
802
802
  type: {
@@ -805,7 +805,7 @@ const w = {
805
805
  },
806
806
  metricDisplay: {
807
807
  type: "string",
808
- enum: Object.values(Te)
808
+ enum: Object.values(Ae)
809
809
  },
810
810
  reverseDataset: {
811
811
  type: "boolean"
@@ -818,7 +818,7 @@ const w = {
818
818
  },
819
819
  required: ["type"],
820
820
  additionalProperties: !1
821
- }, jt = {
821
+ }, zt = {
822
822
  type: "object",
823
823
  properties: {
824
824
  chartTitle: $,
@@ -836,7 +836,7 @@ const w = {
836
836
  },
837
837
  required: ["type"],
838
838
  additionalProperties: !1
839
- }, zt = {
839
+ }, $t = {
840
840
  type: "object",
841
841
  properties: {
842
842
  chartTitle: $,
@@ -856,7 +856,7 @@ const w = {
856
856
  },
857
857
  required: ["type"],
858
858
  additionalProperties: !1
859
- }, $t = {
859
+ }, Kt = {
860
860
  type: "object",
861
861
  properties: {
862
862
  tz: {
@@ -871,7 +871,7 @@ const w = {
871
871
  },
872
872
  time_range: {
873
873
  type: "string",
874
- enum: Ue,
874
+ enum: Ge,
875
875
  default: "1h"
876
876
  }
877
877
  },
@@ -880,7 +880,7 @@ const w = {
880
880
  "time_range"
881
881
  ],
882
882
  additionalProperties: !1
883
- }, Kt = {
883
+ }, Vt = {
884
884
  type: "object",
885
885
  description: "A duration representing an exact start and end time.",
886
886
  properties: {
@@ -910,14 +910,14 @@ const w = {
910
910
  granularity: {
911
911
  type: "string",
912
912
  description: 'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',
913
- enum: Fe
913
+ enum: Pe
914
914
  },
915
915
  time_range: {
916
916
  type: "object",
917
917
  description: "The time range to query.",
918
918
  anyOf: [
919
- $t,
920
- Kt
919
+ Kt,
920
+ Vt
921
921
  ],
922
922
  default: {
923
923
  type: "relative",
@@ -948,32 +948,78 @@ const w = {
948
948
  }
949
949
  }), Y = (e) => ({
950
950
  type: "array",
951
- description: "A list of filters to apply to the query.",
951
+ description: "A list of filters to apply to the query",
952
952
  items: {
953
- type: "object",
954
- description: "A filter that specifies which data to include in the query",
955
- properties: {
956
- dimension: {
957
- type: "string",
958
- enum: e
953
+ oneOf: [
954
+ {
955
+ type: "object",
956
+ description: "A filter that specifies which data to include in the query",
957
+ properties: {
958
+ dimension: {
959
+ type: "string",
960
+ enum: e
961
+ },
962
+ type: {
963
+ type: "string",
964
+ enum: ee
965
+ },
966
+ values: {
967
+ type: "array",
968
+ items: {
969
+ type: ["string", "number", "null"]
970
+ }
971
+ }
972
+ },
973
+ required: [
974
+ "dimension",
975
+ "type",
976
+ "values"
977
+ ],
978
+ additionalProperties: !1
959
979
  },
960
- type: {
961
- type: "string",
962
- enum: Pe
980
+ {
981
+ type: "object",
982
+ description: "In filter",
983
+ properties: {
984
+ field: {
985
+ type: "string",
986
+ enum: e
987
+ },
988
+ operator: {
989
+ type: "string",
990
+ enum: ee
991
+ },
992
+ value: {
993
+ type: ["string", "number", "null"]
994
+ }
995
+ },
996
+ required: [
997
+ "field",
998
+ "operator",
999
+ "value"
1000
+ ],
1001
+ additionalProperties: !1
963
1002
  },
964
- values: {
965
- type: "array",
966
- items: {
967
- type: ["string", "number", "null"]
968
- }
1003
+ {
1004
+ type: "object",
1005
+ description: "Empty filter",
1006
+ properties: {
1007
+ field: {
1008
+ type: "string",
1009
+ enum: e
1010
+ },
1011
+ operator: {
1012
+ type: "string",
1013
+ enum: Le
1014
+ }
1015
+ },
1016
+ required: [
1017
+ "field",
1018
+ "operator"
1019
+ ],
1020
+ additionalProperties: !1
969
1021
  }
970
- },
971
- required: [
972
- "dimension",
973
- "type",
974
- "values"
975
- ],
976
- additionalProperties: !1
1022
+ ]
977
1023
  }
978
1024
  }), Bt = {
979
1025
  type: "object",
@@ -985,14 +1031,14 @@ const w = {
985
1031
  "advanced"
986
1032
  ]
987
1033
  },
988
- metrics: Z(Le),
989
- dimensions: W(Ne),
990
- filters: Y(je),
1034
+ metrics: Z(Ne),
1035
+ dimensions: W(je),
1036
+ filters: Y(ze),
991
1037
  ...J
992
1038
  },
993
1039
  required: ["datasource"],
994
1040
  additionalProperties: !1
995
- }, Vt = {
1041
+ }, Mt = {
996
1042
  type: "object",
997
1043
  description: "A query to launch at the basic explore API",
998
1044
  properties: {
@@ -1002,14 +1048,14 @@ const w = {
1002
1048
  "basic"
1003
1049
  ]
1004
1050
  },
1005
- metrics: Z(ze),
1006
- dimensions: W($e),
1007
- filters: Y(Ke),
1051
+ metrics: Z($e),
1052
+ dimensions: W(Ke),
1053
+ filters: Y(Ve),
1008
1054
  ...J
1009
1055
  },
1010
1056
  required: ["datasource"],
1011
1057
  additionalProperties: !1
1012
- }, Mt = {
1058
+ }, Ut = {
1013
1059
  type: "object",
1014
1060
  description: "A query to launch at the AI explore API",
1015
1061
  properties: {
@@ -1020,25 +1066,25 @@ const w = {
1020
1066
  ]
1021
1067
  },
1022
1068
  metrics: Z(Be),
1023
- dimensions: W(Ve),
1024
- filters: Y(Me),
1069
+ dimensions: W(Me),
1070
+ filters: Y(Ue),
1025
1071
  ...J
1026
1072
  },
1027
1073
  required: ["datasource"],
1028
1074
  additionalProperties: !1
1029
- }, Ut = {
1030
- anyOf: [Bt, Vt, Mt]
1031
1075
  }, Gt = {
1076
+ anyOf: [Bt, Mt, Ut]
1077
+ }, Ht = {
1032
1078
  type: "object",
1033
1079
  properties: {
1034
- query: Ut,
1080
+ query: Gt,
1035
1081
  chart: {
1036
- anyOf: [Pt, Nt, Lt, zt, jt, Ft]
1082
+ anyOf: [Lt, jt, Nt, $t, zt, Pt]
1037
1083
  }
1038
1084
  },
1039
1085
  required: ["query", "chart"],
1040
1086
  additionalProperties: !1
1041
- }, Ht = {
1087
+ }, Qt = {
1042
1088
  type: "object",
1043
1089
  properties: {
1044
1090
  position: {
@@ -1075,24 +1121,24 @@ const w = {
1075
1121
  },
1076
1122
  required: ["position", "size"],
1077
1123
  additionalProperties: !1
1078
- }, Qt = {
1124
+ }, Jt = {
1079
1125
  type: "object",
1080
1126
  properties: {
1081
- definition: Gt,
1082
- layout: Ht
1127
+ definition: Ht,
1128
+ layout: Qt
1083
1129
  },
1084
1130
  required: ["definition", "layout"],
1085
1131
  additionalProperties: !1
1086
- }, cr = {
1132
+ }, lr = {
1087
1133
  type: "object",
1088
1134
  properties: {
1089
1135
  tiles: {
1090
1136
  type: "array",
1091
- items: Qt
1137
+ items: Jt
1092
1138
  },
1093
1139
  tileHeight: {
1094
1140
  type: "number",
1095
- description: `Height of each tile in pixels. Default: ${V}`
1141
+ description: `Height of each tile in pixels. Default: ${B}`
1096
1142
  },
1097
1143
  gridSize: {
1098
1144
  type: "object",
@@ -1113,27 +1159,27 @@ const w = {
1113
1159
  additionalProperties: !1
1114
1160
  };
1115
1161
  export {
1116
- it as CP_ID_TOKEN,
1117
- V as DEFAULT_TILE_HEIGHT,
1118
- ct as DEFAULT_TILE_REFRESH_INTERVAL_MS,
1119
- ir as DashboardRenderer,
1120
- ee as ENTITY_ID_TOKEN,
1162
+ st as CP_ID_TOKEN,
1163
+ B as DEFAULT_TILE_HEIGHT,
1164
+ lt as DEFAULT_TILE_REFRESH_INTERVAL_MS,
1165
+ sr as DashboardRenderer,
1166
+ te as ENTITY_ID_TOKEN,
1121
1167
  kt as GridLayout,
1122
1168
  z as INJECT_QUERY_PROVIDER,
1123
- st as TIMEFRAME_TOKEN,
1124
- Mt as aiQuerySchema,
1125
- Pt as barChartSchema,
1126
- Vt as basicQuerySchema,
1127
- cr as dashboardConfigSchema,
1128
- sr as dashboardTileTypes,
1169
+ ct as TIMEFRAME_TOKEN,
1170
+ Ut as aiQuerySchema,
1171
+ Lt as barChartSchema,
1172
+ Mt as basicQuerySchema,
1173
+ lr as dashboardConfigSchema,
1174
+ cr as dashboardTileTypes,
1129
1175
  Bt as exploreV4QuerySchema,
1130
- Nt as gaugeChartSchema,
1131
- zt as metricCardSchema,
1132
- Ft as slottableSchema,
1133
- Qt as tileConfigSchema,
1134
- Gt as tileDefinitionSchema,
1135
- Ht as tileLayoutSchema,
1136
- Lt as timeseriesChartSchema,
1137
- jt as topNTableSchema,
1138
- Ut as validDashboardQuery
1176
+ jt as gaugeChartSchema,
1177
+ $t as metricCardSchema,
1178
+ Pt as slottableSchema,
1179
+ Jt as tileConfigSchema,
1180
+ Ht as tileDefinitionSchema,
1181
+ Qt as tileLayoutSchema,
1182
+ Nt as timeseriesChartSchema,
1183
+ zt as topNTableSchema,
1184
+ Gt as validDashboardQuery
1139
1185
  };