@conboai/storybook.components 0.4.26 → 0.4.28

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.
@@ -19,6 +19,7 @@ export type PollutionColors = "red" | "green" | "yellow";
19
19
  export type Pollution = {
20
20
  id: string;
21
21
  value: PollutionColors;
22
+ text: string;
22
23
  };
23
24
  export declare enum PollutionBgColors {
24
25
  red = "#EB5757",
@@ -67586,53 +67586,61 @@ function nce({
67586
67586
  pollutions: d
67587
67587
  }) {
67588
67588
  if (!e) return null;
67589
- const h = (m, v) => {
67590
- if (!m) return v;
67591
- if (m && m.includes("_fill")) {
67592
- const y = jE(m, "_fill");
67593
- if (r != null && r.includes(y)) return ece;
67594
- if (o != null && o.includes(y)) return tce;
67595
- }
67596
- if (d && Qle(m)) {
67597
- const y = D4(m, d);
67598
- return y && A4(m, y.value) || v;
67599
- }
67600
- return v;
67601
- }, f = (m, v) => {
67602
- if (!m) return v;
67603
- if (d && m.endsWith("_pollution_bubble")) {
67604
- const y = D4(m, d);
67605
- return y && A4(m, y.value) || v;
67606
- }
67607
- return v;
67608
- }, b = (m) => m ? m === "fullname" ? c ? "block" : "none" : m.endsWith("_hover") ? "none" : m.includes("_selected") ? (i ? n && Kle(m, n) : n && m === `${n}_selected`) ? "block" : "none" : m.endsWith("_pollution") ? (d == null ? void 0 : d.find((y) => m === `${y.id}_pollution`)) ? "block" : "none" : "block" : "block", g = (m, v) => {
67609
- const { id: y, clusterid: C } = m, E = {};
67610
- return C && (E.className = "svg-clickable", E.onClick = () => {
67611
- var k;
67612
- const w = ((k = C.match(/a2_(x\d+)/)) == null ? void 0 : k[1]) || "";
67613
- t && t(C, w);
67614
- }, E.onMouseEnter = () => {
67615
- y && s && s(y.split("_")[0]);
67616
- }), (v === "svg" && u || y != null && y.endsWith("_bubble")) && (E.style = { ...E.style, textAnchor: "middle" }), y === "fullname" && (E.style = { ...E.style, textAnchor: "start" }), y != null && y.endsWith("_fullname_right_to_left") && (E.style = { ...E.style, textAnchor: "end" }), y != null && y.endsWith("_hover") && (E.className = "svg_hover_area"), E;
67617
- }, p = (m) => {
67618
- if (!m) return null;
67619
- if (typeof m == "string") return m;
67620
- const { tag: v, attributes: y, children: C, text: E } = m, { id: w, fill: k, stroke: L } = y, _ = h(w, k), B = f(w, L), O = b(w), D = g(y, v), M = {
67621
- ...Jle(y),
67622
- ...D,
67623
- ...v === "svg" && l || {},
67624
- fill: _,
67625
- stroke: B,
67626
- key: w || Math.random(),
67589
+ const h = (v, y) => {
67590
+ if (!v) return y;
67591
+ if (v && v.includes("_fill")) {
67592
+ const C = jE(v, "_fill");
67593
+ if (r != null && r.includes(C)) return ece;
67594
+ if (o != null && o.includes(C)) return tce;
67595
+ }
67596
+ if (d && Qle(v)) {
67597
+ const C = D4(v, d);
67598
+ return C && A4(v, C.value) || y;
67599
+ }
67600
+ return y;
67601
+ }, f = (v, y) => {
67602
+ if (!v) return y;
67603
+ if (d && v.endsWith("_pollution_bubble")) {
67604
+ const C = D4(v, d);
67605
+ return C && A4(v, C.value) || y;
67606
+ }
67607
+ return y;
67608
+ }, b = (v) => v ? v === "fullname" ? c ? "block" : "none" : v.endsWith("_hover") ? "none" : v.includes("_selected") ? (i ? n && Kle(v, n) : n && v === `${n}_selected`) ? "block" : "none" : v.endsWith("_pollution") ? (d == null ? void 0 : d.find((C) => v === `${C.id}_pollution`)) ? "block" : "none" : "block" : "block", g = (v) => {
67609
+ const y = d == null ? void 0 : d.find((C) => v.attributes.id === `${C.id}_pollution_text`);
67610
+ y && (v.children = v.children.map((C) => ({
67611
+ ...C,
67612
+ text: y == null ? void 0 : y.text
67613
+ })));
67614
+ }, p = (v, y) => {
67615
+ const { id: C, clusterid: E } = v, w = {};
67616
+ return E && (w.className = "svg-clickable", w.onClick = () => {
67617
+ var L;
67618
+ const k = ((L = E.match(/a2_(x\d+)/)) == null ? void 0 : L[1]) || "";
67619
+ t && t(E, k);
67620
+ }, w.onMouseEnter = () => {
67621
+ C && s && s(C.split("_")[0]);
67622
+ }), (y === "svg" && u || C != null && C.endsWith("_bubble")) && (w.style = { ...w.style, textAnchor: "middle" }), C === "fullname" && (w.style = { ...w.style, textAnchor: "start" }), C != null && C.endsWith("_fullname_right_to_left") && (w.style = { ...w.style, textAnchor: "end" }), C != null && C.endsWith("_hover") && (w.className = "svg_hover_area"), w;
67623
+ }, m = (v) => {
67624
+ var R;
67625
+ if (!v) return null;
67626
+ if (typeof v == "string") return v;
67627
+ v.tag === "text" && ((R = v.attributes.id) != null && R.endsWith("_pollution_text")) && g(v);
67628
+ const { tag: y, attributes: C, children: E, text: w } = v, { id: k, fill: L, stroke: _ } = C, B = h(k, L), O = f(k, _), D = b(k), I = p(C, y), x = {
67629
+ ...Jle(C),
67630
+ ...I,
67631
+ ...y === "svg" && l || {},
67632
+ fill: B,
67633
+ stroke: O,
67634
+ key: k || Math.random(),
67627
67635
  style: {
67628
67636
  pointerEvents: "none",
67629
- display: O,
67630
- ...D.style
67637
+ display: D,
67638
+ ...I.style
67631
67639
  }
67632
- }, x = v === "tspan" && E ? [E] : C.map(p);
67633
- return dl(v, M, x);
67640
+ }, T = y === "tspan" && w ? [w] : E.map(m);
67641
+ return dl(y, x, T);
67634
67642
  };
67635
- return /* @__PURE__ */ H.jsx(H.Fragment, { children: p(e) });
67643
+ return /* @__PURE__ */ H.jsx(H.Fragment, { children: m(e) });
67636
67644
  }
67637
67645
  const Wye = xr(nce), rce = (e, t) => ({
67638
67646
  "&.MuiTextField-root": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conboai/storybook.components",
3
- "version": "0.4.26",
3
+ "version": "0.4.28",
4
4
  "main": "dist/storybook.components.mjs",
5
5
  "types": "dist/build/index.d.ts",
6
6
  "files": [