@hybridcore/ui 1.5.21 → 1.5.23

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,24 +1,24 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { useMemo as i } from "react";
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { useMemo as m } from "react";
3
3
  import s from "lodash";
4
4
  import n from "./variable.js";
5
5
  const c = ({
6
6
  template: r,
7
7
  data: t
8
8
  }) => {
9
- const a = i(() => {
9
+ const p = m(() => {
10
10
  let e = /* @__PURE__ */ new Map();
11
11
  return r.properties.forEach((o) => {
12
- const p = `${r.type}-${r.templateKey}-${o.propertyId}`;
13
- e.set(p, o.name);
12
+ const a = `${r.type}-${r.templateKey}-${o.propertyId}`;
13
+ e.set(a, o);
14
14
  }), e;
15
15
  }, [r]);
16
- return s.keys(t.variables).map((e, o) => /* @__PURE__ */ m(
16
+ return s.keys(t.variables).map((e, o) => /* @__PURE__ */ i(
17
17
  n,
18
18
  {
19
19
  type: e,
20
20
  data: s.get(t.variables, e),
21
- propertyNames: a,
21
+ properties: p,
22
22
  hashPrefix: `${t.template.type}-${t.template.templateKey}-`
23
23
  },
24
24
  o
@@ -1,9 +1,9 @@
1
- import { jsx as o, Fragment as g, jsxs as v } from "react/jsx-runtime";
2
- import { Box as a } from "@mui/material";
3
- import m from "lodash";
4
- import x from "dayjs";
5
- import { VariableRoot as V, VariableRow as Y, VariableTitle as h, VariableValue as d } from "./styled.js";
6
- const j = [
1
+ import { jsx as o, Fragment as m, jsxs as g } from "react/jsx-runtime";
2
+ import { Box as b } from "@mui/material";
3
+ import V from "lodash";
4
+ import Y from "dayjs";
5
+ import { VariableRoot as x, VariableRow as d, VariableTitle as j, VariableValue as D } from "./styled.js";
6
+ const T = [
7
7
  "string",
8
8
  "boolean",
9
9
  "date",
@@ -15,42 +15,43 @@ const j = [
15
15
  "list",
16
16
  "text",
17
17
  "composite-list"
18
- ], i = ({ title: r, value: e }) => /* @__PURE__ */ v(Y, { children: [
19
- /* @__PURE__ */ o(h, { variant: "subtitle2", children: r }),
20
- /* @__PURE__ */ o(d, { variant: "body2", children: e })
21
- ] }), s = ({ title: r, value: e }) => /* @__PURE__ */ o(i, { title: r, value: e }), D = ({ title: r, value: e }) => /* @__PURE__ */ o(i, { title: r, value: e ? "Yes" : "No" }), T = ({ title: r, value: e }) => {
22
- const u = x(e).format("DD/MM/YYYY");
18
+ ], i = ({ title: r, value: e }) => /* @__PURE__ */ g(d, { children: [
19
+ /* @__PURE__ */ o(j, { variant: "subtitle2", children: r }),
20
+ /* @__PURE__ */ o(D, { variant: "body2", children: e })
21
+ ] }), s = ({ title: r, value: e }) => /* @__PURE__ */ o(i, { title: r, value: e }), h = ({ title: r, value: e }) => /* @__PURE__ */ o(i, { title: r, value: e ? "Yes" : "No" }), B = ({ title: r, value: e }) => {
22
+ const u = Y(e).format("DD/MM/YYYY");
23
23
  return /* @__PURE__ */ o(i, { title: r, value: u });
24
- }, c = ({ title: r, value: e }) => {
24
+ }, f = ({ title: r, value: e }) => {
25
25
  const u = (e ?? []).join(", ");
26
26
  return /* @__PURE__ */ o(i, { title: r, value: u });
27
27
  };
28
- function P({
28
+ function _({
29
29
  type: r,
30
30
  data: e,
31
31
  filter: u,
32
- propertyNames: b,
33
- hashPrefix: f
32
+ properties: a,
33
+ hashPrefix: c
34
34
  }) {
35
- return r === "geometry" ? /* @__PURE__ */ o(g, {}) : /* @__PURE__ */ o(V, { children: m.keys(e).filter(
36
- (l) => u === void 0 || u === "" || l.includes(u)
37
- ).map((l, t) => {
38
- const n = b.get(f + l);
39
- return j.includes(r) ? /* @__PURE__ */ v(a, { mb: 1, className: "variable", children: [
35
+ return r === "geometry" ? /* @__PURE__ */ o(m, {}) : /* @__PURE__ */ o(x, { children: V.keys(e).filter((l) => {
36
+ const t = a.get(c + l);
37
+ return t && !t.visible ? !1 : u === void 0 || u === "" || l.includes(u);
38
+ }).map((l, t) => {
39
+ const v = a.get(c + l), n = v ? v.name : "";
40
+ return T.includes(r) ? /* @__PURE__ */ g(b, { mb: 1, className: "variable", children: [
40
41
  r === "string" && /* @__PURE__ */ o(s, { title: n, value: e[l] }),
41
- r === "boolean" && /* @__PURE__ */ o(D, { title: n, value: e[l] }),
42
- r === "date" && /* @__PURE__ */ o(T, { title: n, value: e[l] }),
42
+ r === "boolean" && /* @__PURE__ */ o(h, { title: n, value: e[l] }),
43
+ r === "date" && /* @__PURE__ */ o(B, { title: n, value: e[l] }),
43
44
  r === "byte" && /* @__PURE__ */ o(s, { title: n, value: e[l] }),
44
45
  r === "double" && /* @__PURE__ */ o(s, { title: n, value: e[l] }),
45
46
  r === "integer" && /* @__PURE__ */ o(s, { title: n, value: e[l] }),
46
47
  r === "long" && /* @__PURE__ */ o(s, { title: n, value: e[l] }),
47
48
  r === "enum" && /* @__PURE__ */ o(s, { title: n, value: e[l] }),
48
- r === "list" && /* @__PURE__ */ o(c, { title: n, value: e[l] }),
49
+ r === "list" && /* @__PURE__ */ o(f, { title: n, value: e[l] }),
49
50
  r === "text" && /* @__PURE__ */ o(s, { title: n, value: e[l] }),
50
- r === "composite-list" && /* @__PURE__ */ o(c, { title: n, value: e[l] })
51
- ] }, t) : /* @__PURE__ */ o(a, {}, t);
51
+ r === "composite-list" && /* @__PURE__ */ o(f, { title: n, value: e[l] })
52
+ ] }, t) : /* @__PURE__ */ o(b, {}, t);
52
53
  }) });
53
54
  }
54
55
  export {
55
- P as default
56
+ _ as default
56
57
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hybridcore/ui",
3
3
  "description": "Hybrid Core UI Library",
4
- "version": "1.5.21",
4
+ "version": "1.5.23",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",