@hybridcore/ui 1.4.12 → 1.4.13

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,74 +1,74 @@
1
- import { jsx as s, Fragment as p } from "react/jsx-runtime";
1
+ import { jsx as s, Fragment as m } from "react/jsx-runtime";
2
2
  import a from "lodash";
3
- import { CollapsibleCard as v } from "../collapsible-card/index.js";
4
- import u from "./property.js";
3
+ import { CollapsibleCard as y } from "../collapsible-card/index.js";
4
+ import p from "./property.js";
5
5
  const N = ({
6
- values: f,
6
+ values: o,
7
7
  templates: d,
8
- inputVariant: m,
8
+ inputVariant: u,
9
9
  onChange: h
10
10
  }) => {
11
- const c = (t) => (r) => {
12
- if (t) {
13
- let e = f.find((l) => l.templateKey === t);
11
+ const c = (f) => (r) => {
12
+ if (f) {
13
+ let e = o.find((l) => l.templateKey === f);
14
14
  if (e) {
15
15
  const l = a.keys(r)[0];
16
- let i = e.filters.findIndex(
17
- (o) => o.fieldName === l
16
+ let t = e.filters.findIndex(
17
+ (n) => n.fieldName === l
18
18
  );
19
- const n = a.get(r, l);
20
- a.values(n).filter((o) => o !== "").length === 0 && i !== -1 ? e.filters.splice(i, 1) : i !== -1 ? e.filters[i] = {
19
+ const i = a.get(r, l);
20
+ a.values(i).filter((n) => !(a.isArray(n) && n.length === 0 || n === "")).length === 0 && t !== -1 ? e.filters.splice(t, 1) : t !== -1 ? e.filters[t] = {
21
21
  fieldName: l,
22
- value: n
22
+ value: i
23
23
  } : e.filters.push({
24
24
  fieldName: l,
25
- value: n
25
+ value: i
26
26
  });
27
27
  }
28
- h(f);
28
+ h(o);
29
29
  } else console.warn("Template could not be found!");
30
30
  };
31
- if (f.length === 1) {
32
- const t = f[0], r = d.get(t.templateKey);
33
- return /* @__PURE__ */ s(p, { children: r == null ? void 0 : r.properties.map((e, l) => {
34
- let i = {};
35
- const n = t.filters.find(
36
- (o) => o.fieldName === e.propertyId
31
+ if (o.length === 1) {
32
+ const f = o[0], r = d.get(f.templateKey);
33
+ return /* @__PURE__ */ s(m, { children: r == null ? void 0 : r.properties.map((e, l) => {
34
+ let t = {};
35
+ const i = f.filters.find(
36
+ (n) => n.fieldName === e.propertyId
37
37
  );
38
- return n && (i = n.value), /* @__PURE__ */ s(
39
- u,
38
+ return i && (t = i.value), /* @__PURE__ */ s(
39
+ p,
40
40
  {
41
41
  property: e,
42
- value: i,
42
+ value: t,
43
43
  size: "small",
44
- variant: m,
44
+ variant: u,
45
45
  onChange: c(r == null ? void 0 : r.templateKey)
46
46
  },
47
47
  l
48
48
  );
49
49
  }) });
50
50
  }
51
- return f.map((t, r) => {
52
- const e = d.get(t.templateKey);
51
+ return o.map((f, r) => {
52
+ const e = d.get(f.templateKey);
53
53
  return /* @__PURE__ */ s(
54
- v,
54
+ y,
55
55
  {
56
56
  header: e == null ? void 0 : e.name,
57
- content: /* @__PURE__ */ s(p, { children: e == null ? void 0 : e.properties.map((l, i) => {
58
- let n = {};
59
- const o = t.filters.find(
57
+ content: /* @__PURE__ */ s(m, { children: e == null ? void 0 : e.properties.map((l, t) => {
58
+ let i = {};
59
+ const n = f.filters.find(
60
60
  (g) => g.fieldName === l.propertyId
61
61
  );
62
- return o && (n = o.value), /* @__PURE__ */ s(
63
- u,
62
+ return n && (i = n.value), /* @__PURE__ */ s(
63
+ p,
64
64
  {
65
65
  property: l,
66
- value: n,
66
+ value: i,
67
67
  size: "small",
68
- variant: m,
68
+ variant: u,
69
69
  onChange: c(e == null ? void 0 : e.templateKey)
70
70
  },
71
- i
71
+ t
72
72
  );
73
73
  }) })
74
74
  },
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.4.12",
4
+ "version": "1.4.13",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",