@hortiview/shared-components 1.3.5 → 1.4.0

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.
Files changed (26) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/{BigLoadingSpinner-iegTbDcD.js → BigLoadingSpinner-CqSGYzZA.js} +2 -2
  3. package/dist/components/AlertBanner/AlertBanner.js +14 -14
  4. package/dist/components/BlockView/BlockView.js +26 -24
  5. package/dist/components/ContextMenu/ContextMenu.js +29 -29
  6. package/dist/components/ContextMenu/ContextMenu.test.js +1 -1
  7. package/dist/components/Disclaimer/Disclaimer.js +7 -6
  8. package/dist/components/EmptyView/EmptyView.js +47 -37
  9. package/dist/components/Filter/Filter.d.ts +2 -1
  10. package/dist/components/Filter/Filter.js +107 -90
  11. package/dist/components/FormComponents/FormSelect/FormSelect.d.ts +1 -1
  12. package/dist/components/FormComponents/FormSelect/FormSelect.js +22 -22
  13. package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +6 -6
  14. package/dist/components/FormComponents/FormToggle/FormToggle.d.ts +3 -1
  15. package/dist/components/FormComponents/FormToggle/FormToggle.js +32 -26
  16. package/dist/components/FormComponents/FormToggle/FormToggle.test.js +19 -15
  17. package/dist/components/GenericTable/Mobile/GenericCardList.js +10 -10
  18. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +1 -1
  19. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +1 -1
  20. package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +1 -1
  21. package/dist/components/OverflowTooltip/OverflowTooltip.js +10 -9
  22. package/dist/components/SearchBar/SearchBar.js +3 -2
  23. package/dist/components/Select/Select.d.ts +1 -1
  24. package/dist/components/Select/Select.js +34 -27
  25. package/dist/components/VerticalDivider/VerticalDivider.js +12 -5
  26. package/package.json +1 -1
@@ -1,27 +1,28 @@
1
- import { jsxs as a, Fragment as m, jsx as s } from "react/jsx-runtime";
1
+ import { jsxs as c, Fragment as m, jsx as s } from "react/jsx-runtime";
2
2
  import { b as p } from "../../index.es-CF_xy2ns.js";
3
- import { useState as h, useMemo as d, cloneElement as f } from "react";
3
+ import { useState as d, useMemo as h, cloneElement as f } from "react";
4
4
  import { M as w } from "../../react-tooltip.min-DSY6KDqS.js";
5
5
  import { hasChildWithGreaterWidth as W } from "./OverflowTooltipService.js";
6
- import '../../assets/OverflowTooltip.css';const u = "_truncate_wgwcv_1", b = {
6
+ import '../../assets/OverflowTooltip.css';const u = "_truncate_wgwcv_1", v = {
7
7
  truncate: u
8
8
  }, E = ({ id: o, text: l, children: e }) => {
9
- const [i, n] = h(!1), r = d(
9
+ const [i, r] = d(!1), n = h(
10
10
  () => f(e, {
11
11
  "data-tooltip-id": o,
12
12
  onMouseEnter: ({ currentTarget: t }) => {
13
- const c = t.clientWidth < t.scrollWidth || t.clientHeight < t.scrollHeight || W(t, t.parentElement?.clientWidth);
14
- n(c);
13
+ const a = t.clientWidth < t.scrollWidth || t.clientHeight < t.scrollHeight || W(t, t.parentElement?.clientWidth);
14
+ r(a);
15
15
  },
16
- className: `${b.truncate} ${e.props.className}`
16
+ className: `${v.truncate} ${e.props.className}`
17
17
  }),
18
18
  [e, o]
19
19
  );
20
- return /* @__PURE__ */ a(m, { children: [
21
- r,
20
+ return /* @__PURE__ */ c(m, { children: [
21
+ n,
22
22
  /* @__PURE__ */ s(
23
23
  w,
24
24
  {
25
+ "data-testid": "overflow-tooltip",
25
26
  id: o,
26
27
  noArrow: !0,
27
28
  place: "bottom",
@@ -3,7 +3,7 @@ import { I as c } from "../../index.es-0lQcz8m1.js";
3
3
  import { T as i } from "../../index.es-25EARqhH.js";
4
4
  import '../../assets/SearchBar.css';const l = "_searchbar_gnvwc_1", u = {
5
5
  searchbar: l
6
- }, b = ({
6
+ }, f = ({
7
7
  className: o = "",
8
8
  dense: n = !1,
9
9
  searchTerm: a,
@@ -23,6 +23,7 @@ import '../../assets/SearchBar.css';const l = "_searchbar_gnvwc_1", u = {
23
23
  trailingIcon: /* @__PURE__ */ r(
24
24
  c,
25
25
  {
26
+ "data-testid": "search-bar-icon-button",
26
27
  icon: a ? "close" : "search",
27
28
  onClick: () => a ? t("") : void 0
28
29
  }
@@ -30,5 +31,5 @@ import '../../assets/SearchBar.css';const l = "_searchbar_gnvwc_1", u = {
30
31
  }
31
32
  );
32
33
  export {
33
- b as SearchBar
34
+ f as SearchBar
34
35
  };
@@ -11,4 +11,4 @@ export type ExtendedSelectProps = SelectProps & {
11
11
  * @param portalClassName Custom class name for the portal. Only works if portalContainer is not set.
12
12
  * @param props Element Select props
13
13
  */
14
- export declare const Select: ({ menuMaxHeight, portalClassName, className, hoisted, ...props }: ExtendedSelectProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const Select: ({ menuMaxHeight, portalClassName, "data-testid": dataTestId, className, hoisted, ...props }: ExtendedSelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,34 +1,41 @@
1
- import { jsx as m, Fragment as u } from "react/jsx-runtime";
2
- import { S as d } from "../../index.es-UHKFl8Da.js";
3
- import { useEffect as a } from "react";
4
- import '../../assets/Select.css';const i = "_customPortal_8wq49_1", f = "_customSelect_8wq49_7", s = {
5
- customPortal: i,
6
- customSelect: f
7
- }, _ = ({
8
- menuMaxHeight: n = "15rem",
9
- portalClassName: e,
10
- className: r,
11
- hoisted: o,
12
- ...l
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { S as f } from "../../index.es-UHKFl8Da.js";
3
+ import { useEffect as n } from "react";
4
+ import { u as S } from "../../uniqueId-NU3-C36A.js";
5
+ import '../../assets/Select.css';const p = "_customPortal_8wq49_1", $ = "_customSelect_8wq49_7", r = {
6
+ customPortal: p,
7
+ customSelect: $
8
+ }, P = ({
9
+ menuMaxHeight: s = "15rem",
10
+ portalClassName: o,
11
+ "data-testid": l = "custom-select",
12
+ className: u,
13
+ hoisted: c,
14
+ ...d
13
15
  }) => {
14
- const t = `custom-portal-${e ?? "default"}`;
15
- return a(() => {
16
- if (o && !document.getElementById(t)) {
17
- const c = document.createElement("div");
18
- c.id = t, c.className = `${s.customPortal} ${e ?? ""}`, document.body.appendChild(c);
16
+ const e = `custom-portal-${o ?? "default"}`, m = S("elementSelectForTestId-");
17
+ return n(() => {
18
+ if (c && !document.getElementById(e)) {
19
+ const t = document.createElement("div");
20
+ t.id = e, t.className = `${r.customPortal} ${o ?? ""}`, document.body.appendChild(t);
19
21
  }
20
- }, [o, t, e]), /* @__PURE__ */ m(u, { children: /* @__PURE__ */ m(
21
- d,
22
+ }, [c, e, o]), n(() => {
23
+ const t = document.querySelectorAll(`#${m} input[role="combobox"]`);
24
+ t && t.forEach((i) => {
25
+ i.setAttribute("data-testid", l);
26
+ });
27
+ }, [l, m]), /* @__PURE__ */ a(
28
+ f,
22
29
  {
23
- "data-testid": "custom-select",
24
- menuMaxHeight: n,
25
- hoisted: o,
26
- portalContainer: document.getElementById(t) ? `#${t}` : void 0,
27
- className: `${s.customSelect} ${r ?? ""}`,
28
- ...l
30
+ menuMaxHeight: s,
31
+ hoisted: c,
32
+ id: m,
33
+ portalContainer: document.getElementById(e) ? `#${e}` : void 0,
34
+ className: `${r.customSelect} ${u ?? ""}`,
35
+ ...d
29
36
  }
30
- ) });
37
+ );
31
38
  };
32
39
  export {
33
- _ as Select
40
+ P as Select
34
41
  };
@@ -1,7 +1,14 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import '../../assets/VerticalDivider.css';const d = "_divider_opvom_1", s = {
3
- divider: d
4
- }, o = ({ height: i = "2rem", className: e = "" }) => /* @__PURE__ */ r("div", { className: `${s.divider} ${e}`, style: { height: i } });
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import '../../assets/VerticalDivider.css';const r = "_divider_opvom_1", t = {
3
+ divider: r
4
+ }, v = ({ height: i = "2rem", className: e = "" }) => /* @__PURE__ */ d(
5
+ "div",
6
+ {
7
+ "data-testid": "vertical-divider",
8
+ className: `${t.divider} ${e}`,
9
+ style: { height: i }
10
+ }
11
+ );
5
12
  export {
6
- o as VerticalDivider
13
+ v as VerticalDivider
7
14
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hortiview/shared-components",
3
3
  "description": "This is a shared component library. It should used in the HortiView platform and its modules.",
4
- "version": "1.3.5",
4
+ "version": "1.4.0",
5
5
  "type": "module",
6
6
  "repository": "https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared",
7
7
  "author": "Falk Menge <falk.menge.ext@bayer.com>",