qaema-ui 0.0.13 → 0.0.14

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 +1 @@
1
- {"version":3,"file":"FilterActiveBar.d.ts","sourceRoot":"","sources":["../../src/lib/components/FilterActiveBar.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAiBxD,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,aAAa,EAAE,UAAU,EAAE,CAAC;IAC5B,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AAIF,QAAA,MAAM,eAAe,GAAI,qCAAqC,oBAAoB,4CA8CjF,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"FilterActiveBar.d.ts","sourceRoot":"","sources":["../../src/lib/components/FilterActiveBar.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAiBxD,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,aAAa,EAAE,UAAU,EAAE,CAAC;IAC5B,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AAIF,QAAA,MAAM,eAAe,GAAI,qCAAqC,oBAAoB,4CA2DjF,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,41 +1,48 @@
1
- import { j as n } from "../_virtual/jsx-runtime.js";
2
- import { useTranslation as f } from "react-i18next";
3
- import s from "styled-components";
4
- import x from "../hooks/useBadgeVariant.js";
5
- import v from "./Badge.js";
6
- import g from "./Typography.js";
7
- const j = s.div`
8
- margin-bottom: ${({ theme: o }) => o.spacing.l};
9
- `, B = s.div`
1
+ import { j as o } from "../_virtual/jsx-runtime.js";
2
+ import { useTranslation as g } from "react-i18next";
3
+ import u from "styled-components";
4
+ import y from "../hooks/useBadgeVariant.js";
5
+ import N from "./Badge.js";
6
+ import j from "./Typography.js";
7
+ const B = u.div`
8
+ margin-bottom: ${({ theme: s }) => s.spacing.l};
9
+ `, b = u.div`
10
10
  display: flex;
11
11
  flex-wrap: wrap;
12
12
  gap: 8px;
13
- `, S = ({ fields: o, activeFilters: i, onRemove: l }) => {
14
- const { t: d } = f(), c = x("default"), m = (e) => {
15
- l(e);
16
- }, p = (e) => {
17
- const r = o.find((t) => t.accessor === e.fieldName);
13
+ `, F = ({ fields: s, activeFilters: d, onRemove: p }) => {
14
+ const { t: m } = g(), f = y("default"), h = (e) => {
15
+ p(e);
16
+ }, v = (e) => {
17
+ var i, c;
18
+ const r = s.find((t) => t.accessor === e.fieldName);
18
19
  if (!r) return e.value;
19
- const a = (t, u, h) => /* @__PURE__ */ n.jsxs(g, { variant: "span", color: c.color, children: [
20
+ let a = e.value;
21
+ if (r.type === "select") {
22
+ const t = (c = (i = r == null ? void 0 : r.options) == null ? void 0 : i.filter((n) => typeof n.value == "number" ? n.value === Number(a) : n.value === a)) == null ? void 0 : c[0];
23
+ if (!t) return e.value;
24
+ a = t == null ? void 0 : t.label;
25
+ }
26
+ const l = (t, n, x) => /* @__PURE__ */ o.jsxs(j, { variant: "span", color: f.color, children: [
20
27
  t,
21
28
  " ",
22
- /* @__PURE__ */ n.jsx("strong", { children: d(h) }),
29
+ /* @__PURE__ */ o.jsx("strong", { children: m(x) }),
23
30
  " ",
24
- u
31
+ n
25
32
  ] });
26
33
  switch (e.operator) {
27
34
  case "=":
28
- return a(r.header, e.value, "LBL_IS");
35
+ return l(r.header, a, "LBL_IS");
29
36
  case "like":
30
- return a(r.header, e.value, "CONTAINS");
37
+ return l(r.header, a, "CONTAINS");
31
38
  case "between":
32
- return a(r.header, e.value, "BETWEEN");
39
+ return l(r.header, a, "BETWEEN");
33
40
  default:
34
- return a(r.header, e.value, "LBL_IS");
41
+ return l(r.header, a, "LBL_IS");
35
42
  }
36
43
  };
37
- return /* @__PURE__ */ n.jsx(j, { children: /* @__PURE__ */ n.jsx(B, { children: i.map((e) => o.find((a) => a.accessor === e.fieldName) ? /* @__PURE__ */ n.jsx(v, { onClose: () => m(e.fieldName), children: p(e) }, e.fieldName) : null) }) });
44
+ return /* @__PURE__ */ o.jsx(B, { children: /* @__PURE__ */ o.jsx(b, { children: d.map((e) => s.find((a) => a.accessor === e.fieldName) ? /* @__PURE__ */ o.jsx(N, { onClose: () => h(e.fieldName), children: v(e) }, e.fieldName) : null) }) });
38
45
  };
39
46
  export {
40
- S as default
47
+ F as default
41
48
  };