@devtable/dashboard 14.21.0 → 14.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2425,7 +2425,7 @@ function hm() {
2425
2425
  } = $.useContext(ts);
2426
2426
  return e ? document.getElementById(e) : null;
2427
2427
  }
2428
- const rs = "14.21.0", pm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2428
+ const rs = "14.22.1", pm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2429
2429
  __proto__: null,
2430
2430
  version: rs
2431
2431
  }, Symbol.toStringTag, { value: "Module" }));
@@ -4728,7 +4728,7 @@ const ti = {
4728
4728
  function Ye(e, t) {
4729
4729
  e.messageChannels.getChannel("viz").emit("rendered", t);
4730
4730
  }
4731
- function v9(e, t) {
4731
+ function w9(e, t) {
4732
4732
  return e.messageChannels.getChannel("viz").on("rendered", t), () => {
4733
4733
  e.messageChannels.getChannel("viz").off("rendered", t);
4734
4734
  };
@@ -22936,7 +22936,7 @@ class g5 {
22936
22936
  };
22937
22937
  }
22938
22938
  }
22939
- class w9 {
22939
+ class S9 {
22940
22940
  constructor(t) {
22941
22941
  this.implementation = t;
22942
22942
  }
@@ -24774,12 +24774,12 @@ const P5 = m.model("FilterDateRangeConfigMeta", {
24774
24774
  p.disabled || d.push(p), p.children.forEach(h);
24775
24775
  };
24776
24776
  return e.forEach(h), d;
24777
- }, [e, a]), o = z(() => new Set(i.map((d) => d.value)), [i]), l = z(() => new Set(t.map((d) => d.value)), [t]), s = z(() => (console.log(l, o), l.size !== o.size ? !1 : Array.from(o).every((d) => l.has(d))), [l, o]);
24777
+ }, [e, a]), o = z(() => new Set(i.map((d) => d.value)), [i]), l = z(() => new Set(t.map((d) => d.value)), [t]), s = z(() => l.size !== o.size ? !1 : Array.from(o).every((d) => l.has(d)), [l, o]);
24778
24778
  return {
24779
24779
  allValueSet: o,
24780
24780
  selectedValueSet: l,
24781
24781
  toggleSelectAll: () => {
24782
- if (console.log(s), s) {
24782
+ if (s) {
24783
24783
  n([]);
24784
24784
  return;
24785
24785
  }
@@ -25811,7 +25811,7 @@ const nd = m.model("ViewDivisionConfig", {
25811
25811
  const n = e.panelIDs.filter((a) => a !== t);
25812
25812
  e.panelIDs.length = 0, e.panelIDs.push(...n);
25813
25813
  }
25814
- })), on = "13.45.0", S9 = {
25814
+ })), on = "13.45.0", C9 = {
25815
25815
  definition: {
25816
25816
  sqlSnippets: [],
25817
25817
  queries: [],
@@ -26691,9 +26691,14 @@ const v3 = I5.views((e) => ({
26691
26691
  get metricQueryPayload() {
26692
26692
  if (e.type !== ie.MericoMetricSystem)
26693
26693
  return null;
26694
- const t = this.payload, n = e.config, a = n.filters.reduce((h, p) => (h[p.dimension] = {
26695
- eq: C.get(t, p.variable)
26696
- }, h), {}), i = {
26694
+ const t = this.payload, n = e.config, a = n.filters.reduce((h, p) => {
26695
+ const g = C.get(t, p.variable);
26696
+ return Array.isArray(g) ? h[p.dimension] = {
26697
+ in: g
26698
+ } : h[p.dimension] = {
26699
+ eq: g
26700
+ }, h;
26701
+ }, {}), i = {
26697
26702
  id: n.id,
26698
26703
  type: n.type,
26699
26704
  filters: a,
@@ -27900,7 +27905,7 @@ function G3(e) {
27900
27905
  }, [e]);
27901
27906
  }
27902
27907
  const Dd = "N/A";
27903
- function C9() {
27908
+ function k9() {
27904
27909
  const e = Pr(), t = e.content.views.visibleViews;
27905
27910
  return z(() => t.map((i) => {
27906
27911
  var o;
@@ -28574,7 +28579,7 @@ function kz(e, t, n) {
28574
28579
  fullScreenPanel: d
28575
28580
  };
28576
28581
  }
28577
- function k9(e) {
28582
+ function z9(e) {
28578
28583
  const t = Pr(), n = z(() => t.content.panels.findByID(e.panelId), [e.panelId]);
28579
28584
  return n ? /* @__PURE__ */ r(cz, { withAddon: !1, withPanelTitle: !1, withInteraction: !1, children: /* @__PURE__ */ r(Ei, { panel: n, panelStyle: {} }) }) : null;
28580
28585
  }
@@ -29018,7 +29023,7 @@ const Oz = D(({
29018
29023
  ] }) });
29019
29024
  });
29020
29025
  var Qz = /* @__PURE__ */ ((e) => (e.Use = "use", e.Edit = "edit", e))(Qz || {});
29021
- const z9 = {
29026
+ const T9 = {
29022
29027
  [U.Division]: "Division",
29023
29028
  [U.Tabs]: "Tabs",
29024
29029
  [U.Modal]: "Modal"
@@ -29026,7 +29031,7 @@ const z9 = {
29026
29031
  [U.Division]: "rgba(255, 0, 0, 0.2)",
29027
29032
  [U.Modal]: "rgba(0, 0, 0, 0.2)",
29028
29033
  [U.Tabs]: "rgba(255, 200, 100, 0.4)"
29029
- }, T9 = {
29034
+ }, D9 = {
29030
29035
  [U.Division]: "#ff4000",
29031
29036
  [U.Modal]: "#000",
29032
29037
  [U.Tabs]: "#ffad18"
@@ -30808,7 +30813,7 @@ const TT = m.model({
30808
30813
  }, e);
30809
30814
  }
30810
30815
  });
30811
- function D9(e, t) {
30816
+ function I9(e, t) {
30812
30817
  t.filters && je(e.filters.current, t.filters);
30813
30818
  }
30814
30819
  function DT({
@@ -36037,9 +36042,21 @@ function gI(e) {
36037
36042
  }), Jr.init().then((a) => console.log("monaco instance:", a));
36038
36043
  }, []);
36039
36044
  }
36045
+ const fI = (e) => {
36046
+ const t = ae((n) => {
36047
+ const a = n || window.event;
36048
+ return a.preventDefault(), a && (a.returnValue = ""), "";
36049
+ }, []);
36050
+ N(() => {
36051
+ if (e)
36052
+ return window.addEventListener("beforeunload", t), () => {
36053
+ window.removeEventListener("beforeunload", t);
36054
+ };
36055
+ }, [e]);
36056
+ };
36040
36057
  _s();
36041
36058
  Fs();
36042
- const fI = {
36059
+ const bI = {
36043
36060
  root: {
36044
36061
  height: "100vh",
36045
36062
  display: "flex",
@@ -36058,7 +36075,7 @@ const fI = {
36058
36075
  // main header & sub header
36059
36076
  height: "100vh"
36060
36077
  }
36061
- }, bI = ({
36078
+ }, yI = ({
36062
36079
  context: e,
36063
36080
  dashboard: t,
36064
36081
  content: n,
@@ -36094,7 +36111,7 @@ const fI = {
36094
36111
  const I = async () => {
36095
36112
  await a(v.json, v.content.json);
36096
36113
  }, M = Pt(Ii, []), R = Gd(M);
36097
- return cl("@devtable/dashboard editor", {
36114
+ return fI(v.content.changed), cl("@devtable/dashboard editor", {
36098
36115
  context: e,
36099
36116
  dashboard: t,
36100
36117
  content: n,
@@ -36125,7 +36142,7 @@ const fI = {
36125
36142
  },
36126
36143
  breakpoint: "xxs"
36127
36144
  //FIXME(leto): not sure
36128
- }, styles: fI, children: [
36145
+ }, styles: bI, children: [
36129
36146
  /* @__PURE__ */ r(t6, { onExit: h, saveDashboardChanges: I, headerSlot: s }),
36130
36147
  /* @__PURE__ */ r(D6, {}),
36131
36148
  /* @__PURE__ */ r(Xe.Main, { children: /* @__PURE__ */ r(V, { className: `${i} dashboard-root`, sx: {
@@ -36135,7 +36152,7 @@ const fI = {
36135
36152
  /* @__PURE__ */ r(pI, {})
36136
36153
  ] }) })
36137
36154
  ] }) }) }) }) }) }) }) });
36138
- }, I9 = D(ee(bI));
36155
+ }, M9 = D(ee(yI));
36139
36156
  const ou = m.model({
36140
36157
  id: m.string,
36141
36158
  name: m.string,
@@ -36239,7 +36256,7 @@ const ou = m.model({
36239
36256
  // setupAutoSave();
36240
36257
  // },
36241
36258
  }));
36242
- function yI({
36259
+ function _I({
36243
36260
  id: e,
36244
36261
  name: t,
36245
36262
  dashboard_id: n,
@@ -36282,7 +36299,7 @@ function yI({
36282
36299
  }
36283
36300
  });
36284
36301
  }
36285
- const _I = m.model({
36302
+ const xI = m.model({
36286
36303
  id: m.identifier,
36287
36304
  name: m.string,
36288
36305
  group: m.string,
@@ -36292,18 +36309,18 @@ const _I = m.model({
36292
36309
  globalSQLSnippets: od,
36293
36310
  context: $i
36294
36311
  });
36295
- function xI({
36312
+ function vI({
36296
36313
  id: e,
36297
36314
  name: t,
36298
36315
  group: n,
36299
36316
  content_id: a
36300
36317
  }, i, o, l, s, c, d) {
36301
- return _I.create({
36318
+ return xI.create({
36302
36319
  id: e,
36303
36320
  name: t,
36304
36321
  group: n,
36305
36322
  content_id: a,
36306
- content: yI(i, s, c, d),
36323
+ content: _I(i, s, c, d),
36307
36324
  datasources: {
36308
36325
  list: o
36309
36326
  },
@@ -36315,7 +36332,7 @@ function xI({
36315
36332
  }
36316
36333
  _s();
36317
36334
  Fs();
36318
- const vI = ({
36335
+ const wI = ({
36319
36336
  context: e,
36320
36337
  dashboard: t,
36321
36338
  content: n,
@@ -36334,7 +36351,7 @@ const vI = ({
36334
36351
  data: g = []
36335
36352
  } = dn(Pi), {
36336
36353
  data: _ = []
36337
- } = dn(xd), b = $.useMemo(() => xI(t, n, g, _, e, s ?? {}, d ?? null), [t, n]);
36354
+ } = dn(xd), b = $.useMemo(() => vI(t, n, g, _, e, s ?? {}, d ?? null), [t, n]);
36338
36355
  Qd(b.content, !1), $.useEffect(() => {
36339
36356
  b.context.replace(e);
36340
36357
  }, [e]), $.useEffect(() => {
@@ -36372,13 +36389,13 @@ const vI = ({
36372
36389
  }, children: /* @__PURE__ */ r(Rr.Provider, { value: {
36373
36390
  inEditMode: !1
36374
36391
  }, children: /* @__PURE__ */ r(V, { className: `${a} dashboard-root`, children: /* @__PURE__ */ r(Kt.Provider, { value: v, children: /* @__PURE__ */ r(qr, { configure: I, children: b.content.views.visibleViews.map((M) => /* @__PURE__ */ r(qi, { view: M }, M.id)) }) }) }) }) }) }) }) }) }) }) }) });
36375
- }, M9 = D(vI), L9 = () => Promise.resolve().then(() => pm).then(({
36392
+ }, L9 = D(wI), V9 = () => Promise.resolve().then(() => pm).then(({
36376
36393
  version: e
36377
36394
  }) => (console.log(`[@devtable/dashboard] version: ${e}`), e));
36378
36395
  export {
36379
36396
  dt as APIClient,
36380
36397
  on as CURRENT_SCHEMA_VERSION,
36381
- k9 as ClientPanelRender,
36398
+ z9 as ClientPanelRender,
36382
36399
  jd as ContentModel,
36383
36400
  cs as ContentModelContextProvider,
36384
36401
  ou as ContentRenderModel,
@@ -36386,12 +36403,12 @@ export {
36386
36403
  ba as DEFAULT_CUSTOM_MODAL_TITLE,
36387
36404
  f5 as DashboardApiClient,
36388
36405
  b5 as DashboardApiFacadeClient,
36389
- I9 as DashboardEditor,
36406
+ M9 as DashboardEditor,
36390
36407
  H as DashboardFilterType,
36391
36408
  Qz as DashboardMode,
36392
36409
  IT as DashboardModel,
36393
36410
  is as DashboardModelContextProvider,
36394
- _I as DashboardRenderModel,
36411
+ xI as DashboardRenderModel,
36395
36412
  ls as DashboardThemeContextProvider,
36396
36413
  jz as DashboardViewEditor,
36397
36414
  qi as DashboardViewRender,
@@ -36404,7 +36421,7 @@ export {
36404
36421
  Md as DescriptionPopover,
36405
36422
  k3 as DraftModel,
36406
36423
  U as EViewComponentType,
36407
- w9 as FacadeApiClient,
36424
+ S9 as FacadeApiClient,
36408
36425
  qc as FilterCheckboxConfigMeta,
36409
36426
  jc as FilterDateRangeConfigMeta,
36410
36427
  td as FilterMeta,
@@ -36445,15 +36462,15 @@ export {
36445
36462
  I5 as QueryMeta,
36446
36463
  Uz as QueryModel,
36447
36464
  vd as QueryRenderModel,
36448
- M9 as ReadOnlyDashboard,
36465
+ L9 as ReadOnlyDashboard,
36449
36466
  V5 as SQLSnippetMeta,
36450
36467
  S3 as SQLSnippetRenderModel,
36451
36468
  Yz as SQLSnippetsModel,
36452
36469
  Cd as SQLSnippetsRenderModel,
36453
36470
  w5 as VariableMeta,
36454
36471
  Gz as ViewComponentTypeBackground,
36455
- T9 as ViewComponentTypeColor,
36456
- z9 as ViewComponentTypeName,
36472
+ D9 as ViewComponentTypeColor,
36473
+ T9 as ViewComponentTypeName,
36457
36474
  nd as ViewDivisionConfig,
36458
36475
  d3 as ViewMeta,
36459
36476
  rd as ViewModalConfig,
@@ -36462,13 +36479,13 @@ export {
36462
36479
  zT as ViewsModel,
36463
36480
  cd as ViewsRenderModel,
36464
36481
  pz as Viz,
36465
- D9 as applyPartialDashboard,
36482
+ I9 as applyPartialDashboard,
36466
36483
  Lc as configureAPIClient,
36467
36484
  DT as createContentModel,
36468
- yI as createContentRenderModel,
36485
+ _I as createContentRenderModel,
36469
36486
  ld as createContextMeta,
36470
36487
  MT as createDashboardModel,
36471
- xI as createDashboardRenderModel,
36488
+ vI as createDashboardRenderModel,
36472
36489
  z3 as createDraft,
36473
36490
  A5 as createFilterCheckboxConfig,
36474
36491
  R5 as createFilterDateRangeConfig,
@@ -36491,10 +36508,10 @@ export {
36491
36508
  p3 as getInitialViewsRenderModel,
36492
36509
  g3 as getNewPanel,
36493
36510
  $5 as getStaticDateRangeDefaultValue,
36494
- L9 as getVersion,
36495
- S9 as initialDashboardContent,
36511
+ V9 as getVersion,
36512
+ C9 as initialDashboardContent,
36496
36513
  Ye as notifyVizRendered,
36497
- v9 as onVizRendered,
36514
+ w9 as onVizRendered,
36498
36515
  wn as pluginManager,
36499
36516
  Pr as useDashboardContext,
36500
36517
  Mm as useDashboardThemeContext,
@@ -36508,5 +36525,5 @@ export {
36508
36525
  Te as useRenderContentModelContext,
36509
36526
  Im as useRenderDashboardContext,
36510
36527
  rt as useRenderPanelContext,
36511
- C9 as useVisibleFilters
36528
+ k9 as useVisibleFilters
36512
36529
  };