@databrainhq/plugin 0.16.14 → 0.16.15

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.
@@ -207558,7 +207558,7 @@ const uh0 = "_gridDisplay_mim6z_61", ch0 = "_gridDisplay2_mim6z_69", fh0 = "_fle
207558
207558
  t5 || D3 ? /* @__PURE__ */ E.jsxs(
207559
207559
  "div",
207560
207560
  {
207561
- className: `dbn-h-full ${J5.length && P === "inside" ? !t5 && D3 ? "dbn-w-[30%] dbn-mt-1 dbn-items-start" : "dbn-w-[40%] dbn-items-end" : "dbn-w-full dbn-items-end"} dbn-flex dbn-gap-1 dbn-flex-wrap dbn-justify-end`,
207561
+ className: `dbn-h-full ${J5.length && P === "inside" ? !t5 && D3 ? "dbn-w-[30%]" : "dbn-w-[40%]" : "dbn-w-full "} dbn-flex dbn-gap-1 dbn-flex-wrap dbn-items-end dbn-justify-end`,
207562
207562
  children: [
207563
207563
  (B7 = O3 == null ? void 0 : O3.dynamicXAxis) != null && B7.isEnabled ? /* @__PURE__ */ E.jsx(
207564
207564
  de,
@@ -209786,29 +209786,29 @@ const uh0 = "_gridDisplay_mim6z_61", ch0 = "_gridDisplay2_mim6z_69", fh0 = "_fle
209786
209786
  dropdownTheme: i,
209787
209787
  isFilter: a
209788
209788
  }) => {
209789
- var g, h;
209789
+ var h, I;
209790
209790
  const [o, s] = X0.useState({
209791
209791
  min: null,
209792
209792
  max: null
209793
209793
  }), r = X0.useRef(null), [C, l] = X0.useState(""), [e, A] = X0.useState(""), u = () => {
209794
- var I;
209795
- s({ min: null, max: null }), l(""), A(""), (I = r.current) == null || I.click(), n == null || n(t.name, "", "");
209794
+ var y;
209795
+ s({ min: null, max: null }), l(""), A(""), (y = r.current) == null || y.click(), n == null || n(t.name, "", "");
209796
209796
  }, f = () => {
209797
- var I;
209797
+ var y;
209798
209798
  if (o.min === null || o.max === null) {
209799
209799
  A("Invalid value");
209800
209800
  return;
209801
209801
  }
209802
- n == null || n(t.name, `${o.min} AND ${o.max}`), l(`Between ${o.min} to ${o.max}`), A(""), (I = r.current) == null || I.click();
209802
+ n == null || n(t.name, `${o.min} AND ${o.max}`), l(`Between ${o.min} to ${o.max}`), A(""), (y = r.current) == null || y.click();
209803
209803
  };
209804
209804
  X0.useEffect(() => {
209805
- var I;
209805
+ var y;
209806
209806
  if (t != null && t.value && typeof (t == null ? void 0 : t.value) == "string") {
209807
- const y = (I = t == null ? void 0 : t.value) == null ? void 0 : I.split(" AND "), w = Number(y[0] || 0), V = Number(y[1] || 0);
209808
- s({ min: w, max: V }), l(`Between ${w} to ${V}`);
209807
+ const w = (y = t == null ? void 0 : t.value) == null ? void 0 : y.split(" AND "), V = Number(w[0] || 0), D = Number(w[1] || 0);
209808
+ s({ min: V, max: D }), l(`Between ${V} to ${D}`);
209809
209809
  }
209810
209810
  }, [t == null ? void 0 : t.value]);
209811
- const d = window.CSS && CSS.supports("width", "clamp(1px, 1px, 1px)");
209811
+ const d = window.CSS && CSS.supports("width", "clamp(1px, 1px, 1px)"), g = (i == null ? void 0 : i.variant) ?? "floating";
209812
209812
  return /* @__PURE__ */ E.jsx(E.Fragment, { children: /* @__PURE__ */ E.jsx(
209813
209813
  yl,
209814
209814
  {
@@ -209817,7 +209817,7 @@ const uh0 = "_gridDisplay_mim6z_61", ch0 = "_gridDisplay2_mim6z_69", fh0 = "_fle
209817
209817
  menuWidth: "200px",
209818
209818
  tabMenu: !0,
209819
209819
  buttonContent: /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
209820
- (i == null ? void 0 : i.variant) === "static" && /* @__PURE__ */ E.jsx(E.Fragment, { children: a ? /* @__PURE__ */ E.jsx("span", { className: "dbn-inline-block dbn-text-xs dbn-leading-6 dbn-font-medium dbn-font-sans dbn-selectBox-text", children: t == null ? void 0 : t.name }) : /* @__PURE__ */ E.jsx(u5, { variant: "input-label", color: "primary-title", children: t == null ? void 0 : t.name }) }),
209820
+ g === "static" && /* @__PURE__ */ E.jsx(E.Fragment, { children: a ? /* @__PURE__ */ E.jsx("span", { className: "dbn-inline-block dbn-text-xs dbn-leading-6 dbn-font-medium dbn-font-sans dbn-selectBox-text", children: t == null ? void 0 : t.name }) : /* @__PURE__ */ E.jsx(u5, { variant: "input-label", color: "primary-title", children: t == null ? void 0 : t.name }) }),
209821
209821
  /* @__PURE__ */ E.jsxs(
209822
209822
  "div",
209823
209823
  {
@@ -209827,10 +209827,10 @@ const uh0 = "_gridDisplay_mim6z_61", ch0 = "_gridDisplay2_mim6z_69", fh0 = "_fle
209827
209827
  containerType: "inline-size"
209828
209828
  },
209829
209829
  ref: r,
209830
- "data-testid": (g = t == null ? void 0 : t.name) == null ? void 0 : g.toLowerCase().replaceAll(" ", "-").concat("-dropdown"),
209830
+ "data-testid": (h = t == null ? void 0 : t.name) == null ? void 0 : h.toLowerCase().replaceAll(" ", "-").concat("-dropdown"),
209831
209831
  children: [
209832
209832
  /* @__PURE__ */ E.jsxs("div", { className: OA.numberFieldLabelText, children: [
209833
- a && (i == null ? void 0 : i.variant) === "floating" ? /* @__PURE__ */ E.jsx(
209833
+ g === "floating" ? a ? /* @__PURE__ */ E.jsx(
209834
209834
  "span",
209835
209835
  {
209836
209836
  className: `${[
@@ -209848,7 +209848,7 @@ const uh0 = "_gridDisplay_mim6z_61", ch0 = "_gridDisplay2_mim6z_69", fh0 = "_fle
209848
209848
  ].join(" ")}`,
209849
209849
  children: t == null ? void 0 : t.name
209850
209850
  }
209851
- ),
209851
+ ) : null,
209852
209852
  /* @__PURE__ */ E.jsx(
209853
209853
  "span",
209854
209854
  {
@@ -209876,7 +209876,7 @@ const uh0 = "_gridDisplay_mim6z_61", ch0 = "_gridDisplay2_mim6z_69", fh0 = "_fle
209876
209876
  "div",
209877
209877
  {
209878
209878
  className: OA.numberFieldWrapper,
209879
- "data-testid": (h = t == null ? void 0 : t.name) == null ? void 0 : h.toLowerCase().replaceAll(" ", "-").concat("-menu"),
209879
+ "data-testid": (I = t == null ? void 0 : t.name) == null ? void 0 : I.toLowerCase().replaceAll(" ", "-").concat("-menu"),
209880
209880
  children: [
209881
209881
  /* @__PURE__ */ E.jsx(
209882
209882
  f8,
@@ -209886,10 +209886,10 @@ const uh0 = "_gridDisplay_mim6z_61", ch0 = "_gridDisplay2_mim6z_69", fh0 = "_fle
209886
209886
  defaultValue: o.min,
209887
209887
  className: a ? "dbn-selectBox-text" : "",
209888
209888
  isFilter: a,
209889
- onChange: ({ target: { value: I } }) => {
209890
- s((y) => ({
209891
- ...y,
209892
- min: I === "" ? null : Number(I)
209889
+ onChange: ({ target: { value: y } }) => {
209890
+ s((w) => ({
209891
+ ...w,
209892
+ min: y === "" ? null : Number(y)
209893
209893
  }));
209894
209894
  }
209895
209895
  }
@@ -209902,10 +209902,10 @@ const uh0 = "_gridDisplay_mim6z_61", ch0 = "_gridDisplay2_mim6z_69", fh0 = "_fle
209902
209902
  isFilter: a,
209903
209903
  className: a ? "dbn-selectBox-text" : "",
209904
209904
  defaultValue: o.max,
209905
- onChange: ({ target: { value: I } }) => {
209906
- s((y) => ({
209907
- ...y,
209908
- max: I === "" ? null : Number(I)
209905
+ onChange: ({ target: { value: y } }) => {
209906
+ s((w) => ({
209907
+ ...w,
209908
+ max: y === "" ? null : Number(y)
209909
209909
  }));
209910
209910
  }
209911
209911
  }
@@ -216611,18 +216611,28 @@ const Uv0 = "_dbcLastLevel_1y1tv_19", jv0 = "_otherLevels_1y1tv_35", zv0 = "_cli
216611
216611
  ),
216612
216612
  C && /* @__PURE__ */ E.jsx(u5, { variant: "body-text-2", color: "alert", children: C })
216613
216613
  ] }), cE = ({ children: t }) => {
216614
- const [n, i] = X0.useState();
216614
+ const [n, i] = X0.useState(), a = (o) => {
216615
+ const s = [".dbn-selectBox", ".dbn-selectBox-text"], r = new RegExp(
216616
+ s.map((l) => `${l}\\s*[^}]*}`).join("|"),
216617
+ "g"
216618
+ ), C = o.match(r);
216619
+ return C ? C.join(`
216620
+ `) : "";
216621
+ };
216615
216622
  return X0.useLayoutEffect(() => {
216616
- const a = document.querySelector("#dbn-portal") || document.createElement("div");
216617
- if (a.setAttribute("id", "dbn-portal"), document.body.querySelector("#dbn-portal") || document.body.appendChild(a), document.querySelector("dbn-dashboard") || document.querySelector("dbn-metric") || document.querySelector("dbn-create-metric")) {
216618
- const o = document.querySelector("#dbn-styles"), s = a.shadowRoot || a.attachShadow({ mode: "open" });
216619
- if (o && !s.querySelector("#dbn-portal-style")) {
216620
- const r = document.createElement("style");
216621
- r.innerHTML = o.innerHTML, r.setAttribute("id", "dbn-portal-style"), s.appendChild(r);
216622
- }
216623
- if (!s.querySelector("#global-style")) {
216624
- const r = document.createElement("style");
216625
- r.innerHTML = `
216623
+ var r;
216624
+ const o = document.querySelector("#dbn-portal") || document.createElement("div");
216625
+ o.setAttribute("id", "dbn-portal"), document.body.querySelector("#dbn-portal") || document.body.appendChild(o);
216626
+ const s = document.querySelector("dbn-dashboard") || document.querySelector("dbn-metric") || document.querySelector("dbn-create-metric");
216627
+ if (s) {
216628
+ const C = document.querySelector("#dbn-styles"), l = o.shadowRoot || o.attachShadow({ mode: "open" });
216629
+ if (C && !l.querySelector("#dbn-portal-style")) {
216630
+ const e = document.createElement("style");
216631
+ e.innerHTML = C.innerHTML, e.setAttribute("id", "dbn-portal-style"), l.appendChild(e);
216632
+ }
216633
+ if (!l.querySelector("#global-style")) {
216634
+ const e = document.createElement("style");
216635
+ e.innerHTML = `
216626
216636
  *,
216627
216637
  ::before,
216628
216638
  ::after {
@@ -216658,11 +216668,16 @@ const Uv0 = "_dbcLastLevel_1y1tv_19", jv0 = "_otherLevels_1y1tv_35", zv0 = "_cli
216658
216668
  h1, h2, h3, h4, h5, h6 {
216659
216669
  margin: 0;
216660
216670
  }
216661
- `, r.setAttribute("id", "global-style"), s.appendChild(r);
216671
+ table {
216672
+ text-indent: 0;
216673
+ border-color: inherit;
216674
+ border-collapse: collapse;
216675
+ }
216676
+ `, e.setAttribute("id", "global-style"), l.appendChild(e);
216662
216677
  }
216663
- if (!s.querySelector("#svg")) {
216664
- const r = document.createElement("div");
216665
- r.setAttribute("id", "svg"), r.style.display = "none", r.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg">
216678
+ if (!l.querySelector("#svg")) {
216679
+ const e = document.createElement("div");
216680
+ e.setAttribute("id", "svg"), e.style.display = "none", e.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg">
216666
216681
  <symbol
216667
216682
  id="edit-dataset"
216668
216683
  width="16"
@@ -219578,13 +219593,22 @@ const Uv0 = "_dbcLastLevel_1y1tv_19", jv0 = "_otherLevels_1y1tv_35", zv0 = "_cli
219578
219593
  fill="#0D0D0D"
219579
219594
  />
219580
219595
  </symbol>
219581
- </svg>`, s.appendChild(r);
219596
+ </svg>`, l.appendChild(e);
219597
+ }
219598
+ if (!l.querySelector("#dbn-admin-style")) {
219599
+ const e = (r = s == null ? void 0 : s.shadowRoot) == null ? void 0 : r.querySelector(
219600
+ 'style[id^="dbn-"][id$="-admin-styles"]'
219601
+ );
219602
+ if (e) {
219603
+ const A = document.createElement("style"), u = a(e.innerHTML);
219604
+ A.innerHTML = u, A.setAttribute("id", "dbn-admin-style"), l.appendChild(A);
219605
+ }
219582
219606
  }
219583
- i(s);
219607
+ i(l);
219584
219608
  } else {
219585
- if (!a.querySelector("#global-style")) {
219586
- const o = document.createElement("style");
219587
- o.innerHTML = `
219609
+ if (!o.querySelector("#global-style")) {
219610
+ const C = document.createElement("style");
219611
+ C.innerHTML = `
219588
219612
  *,
219589
219613
  ::before,
219590
219614
  ::after {
@@ -219609,9 +219633,9 @@ const Uv0 = "_dbcLastLevel_1y1tv_19", jv0 = "_otherLevels_1y1tv_35", zv0 = "_cli
219609
219633
  h1, h2, h3, h4, h5, h6 {
219610
219634
  margin: 0;
219611
219635
  }
219612
- `, o.setAttribute("id", "global-style"), a.appendChild(o);
219636
+ `, C.setAttribute("id", "global-style"), o.appendChild(C);
219613
219637
  }
219614
- i(a);
219638
+ i(o);
219615
219639
  }
219616
219640
  }, []), n ? Eq.createPortal(t, n) : null;
219617
219641
  };