@hortiview/shared-components 0.0.9707 → 0.0.9939

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 (39) hide show
  1. package/README.md +23 -0
  2. package/dist/components/AlertBanner/AlertBanner.test.js +2 -2
  3. package/dist/components/BaseView/BaseView.test.js +2 -2
  4. package/dist/components/BasicHeading/BasicHeading.test.js +2 -2
  5. package/dist/components/BlockView/BlockView.test.js +2 -2
  6. package/dist/components/ChipCard/ChipCard.test.js +2 -2
  7. package/dist/components/ContextMenu/ContextMenu.test.js +2 -2
  8. package/dist/components/DeleteModal/DeleteModal.test.js +2 -2
  9. package/dist/components/Disclaimer/Disclaimer.test.js +2 -2
  10. package/dist/components/EmptyView/EmptyView.test.js +2 -2
  11. package/dist/components/Filter/Filter.test.js +2 -2
  12. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.js +2 -2
  13. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +2 -2
  14. package/dist/components/FormComponents/FormRadio/FormRadio.test.js +2 -2
  15. package/dist/components/FormComponents/FormSelect/FormSelect.test.js +3 -3
  16. package/dist/components/FormComponents/FormSlider/FormSlider.test.js +2 -2
  17. package/dist/components/FormComponents/FormText/FormText.test.js +2 -2
  18. package/dist/components/GenericTable/GenericTable.test.js +2 -2
  19. package/dist/components/GenericTable/Mobile/GenericCard.test.js +2 -2
  20. package/dist/components/GenericTable/Mobile/GenericCardList.test.js +2 -2
  21. package/dist/components/HashTabView/HashTabView.test.js +2 -2
  22. package/dist/components/HeaderFilter/HeaderFilter.test.js +2 -2
  23. package/dist/components/Iconify/Iconify.test.js +2 -2
  24. package/dist/components/InfoGroup/InfoGroup.test.js +2 -2
  25. package/dist/components/ListArea/ListArea.test.js +2 -2
  26. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +2 -2
  27. package/dist/components/LoadingSpinner/Default/LoadingSpinner.d.ts +11 -1
  28. package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +61 -47
  29. package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.js +17 -11
  30. package/dist/components/OverflowTooltip/OverflowTooltip.test.js +3 -3
  31. package/dist/components/Scrollbar/scrollbar.test.js +2 -2
  32. package/dist/components/SearchBar/SearchBar.test.js +2 -2
  33. package/dist/components/VerticalDivider/VerticalDivider.test.js +2 -2
  34. package/dist/hooks/useBreakpoints.test.js +2 -2
  35. package/dist/{index-DW4oU_OU.js → index-IMXII42b.js} +1 -1
  36. package/dist/{react.esm-Dy4VzU4L.js → react.esm-CHvVvf3L.js} +1 -1
  37. package/dist/services/services.test.js +1 -1
  38. package/dist/{vi.JYQecGiw-BbUbJcT8.js → vi.JYQecGiw-BpOAB4v6.js} +1 -0
  39. package/package.json +1 -1
package/README.md CHANGED
@@ -709,6 +709,29 @@ return <>
709
709
  </>
710
710
  ```
711
711
 
712
+
713
+ The Loading spinner will automatically change to another text, after a certain waiting time, the text and time are adjustable.
714
+ This behavior is enabled per default (10 seconds) - it can be disabled by passing `null` to impatienceMessage.
715
+
716
+ ```JSX
717
+ import { LoadingSpinner } from '@hortiview/shared-components';
718
+
719
+ const [loading, setLoading] = useState(false)
720
+
721
+ const onSubmit = () => {
722
+ setLoading(true);
723
+ await someComplexLogicThatTakesVeryLong();
724
+ setLoading(false);
725
+ }
726
+ return <>
727
+ {loading && <LoadingSpinner text='Loading something ...' impatienceTimeout={20} impatienceMessage={'Something takes longer than expected'} />}
728
+ <Form obSubmit={onSubmit} />
729
+ <Button type='submit' />
730
+ </>
731
+ ```
732
+
733
+
734
+
712
735
  ### Modal
713
736
 
714
737
  Provides the normal elements modal with one additional change. If you are on fullscreen modal size the max-height and max-width is set to 100svh/svw (Smallest ViewPort height/width).
@@ -1,8 +1,8 @@
1
1
  import { jsx as e, Fragment as m } from "react/jsx-runtime";
2
- import { a as t, s } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a as t, s } from "../../react.esm-CHvVvf3L.js";
3
3
  import { a as l } from "../../useBreakpoints-MzTZ0tCT.js";
4
4
  import { AlertBanner as n } from "./AlertBanner.js";
5
- import { d as c, b as p, t as r, g as o, v as a } from "../../vi.JYQecGiw-BbUbJcT8.js";
5
+ import { d as c, b as p, t as r, g as o, v as a } from "../../vi.JYQecGiw-BpOAB4v6.js";
6
6
  c("AlertBanner Test", () => {
7
7
  p(() => {
8
8
  a.spyOn(l, "useBreakpoints").mockReturnValue({
@@ -1,8 +1,8 @@
1
1
  import { jsx as a, Fragment as s } from "react/jsx-runtime";
2
- import { a as r, s as e, f as p } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a as r, s as e, f as p } from "../../react.esm-CHvVvf3L.js";
3
3
  import { a as l } from "../../useBreakpoints-MzTZ0tCT.js";
4
4
  import { BaseView as i } from "./BaseView.js";
5
- import { d as u, b as m, t as n, g as t, v as c } from "../../vi.JYQecGiw-BbUbJcT8.js";
5
+ import { d as u, b as m, t as n, g as t, v as c } from "../../vi.JYQecGiw-BpOAB4v6.js";
6
6
  u("BaseView Test", () => {
7
7
  m(() => {
8
8
  c.spyOn(l, "useBreakpoints").mockReturnValue({
@@ -1,8 +1,8 @@
1
1
  import { jsx as o, Fragment as c } from "react/jsx-runtime";
2
2
  import { Button as g } from "@element/react-components";
3
3
  import { BasicHeading as a } from "./BasicHeading.js";
4
- import { a as i, s as n } from "../../react.esm-Dy4VzU4L.js";
5
- import { d as h, t as s, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { a as i, s as n } from "../../react.esm-CHvVvf3L.js";
5
+ import { d as h, t as s, g as e } from "../../vi.JYQecGiw-BpOAB4v6.js";
6
6
  h("BasicHeading-Test", () => {
7
7
  s("render small container without content", () => {
8
8
  i(/* @__PURE__ */ o(a, { heading: "Test" }));
@@ -1,7 +1,7 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
- import { a as s, s as o, f as n } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a as s, s as o, f as n } from "../../react.esm-CHvVvf3L.js";
3
3
  import { BlockView as i } from "./BlockView.js";
4
- import { d as a, v as B, t as r, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { d as a, v as B, t as r, g as t } from "../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  a("BlockView Test", () => {
6
6
  const c = B.fn(), e = {
7
7
  id: "1",
@@ -1,7 +1,7 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { a, s as i } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a, s as i } from "../../react.esm-CHvVvf3L.js";
3
3
  import { ChipCard as n } from "./ChipCard.js";
4
- import { d as s, t as c, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { d as s, t as c, g as t } from "../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  s("ChipCard Component", () => {
6
6
  const r = "Test Label", o = "domain";
7
7
  c("renders the correct label and icon", () => {
@@ -1,7 +1,7 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { a as B, s as t, f as o, w as s } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a as B, s as t, f as o, w as s } from "../../react.esm-CHvVvf3L.js";
3
3
  import { ContextMenu as p } from "./ContextMenu.js";
4
- import { v as l, d as k, t as T, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { v as l, d as k, t as T, g as e } from "../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  const C = l.fn(), a = l.fn(), i = l.fn(), g = [
6
6
  { primaryText: "Open", onClick: C, leadingBlock: "add" },
7
7
  { primaryText: "Delete", onClick: i, leadingBlock: "delete_outline" },
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { a as c, s as e } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a as c, s as e } from "../../react.esm-CHvVvf3L.js";
3
3
  import { DeleteModal as b } from "./DeleteModal.js";
4
- import { d as B, t as a, v as o, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { d as B, t as a, v as o, g as t } from "../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  B("DeleteModal Test", () => {
6
6
  a("should render the DeleteModal properly", () => {
7
7
  c(
@@ -1,7 +1,7 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { a as r, s as t } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a as r, s as t } from "../../react.esm-CHvVvf3L.js";
3
3
  import { Disclaimer as s } from "./Disclaimer.js";
4
- import { d as i, t as m, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { d as i, t as m, g as e } from "../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  i("Disclaimer test", () => {
6
6
  m("should render with default text", () => {
7
7
  r(/* @__PURE__ */ o(s, { text: "disclaimer.default" })), e(t.getByText("disclaimer.default")).toBeInTheDocument();
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { a as s, s as o, w as r, f as l } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a as s, s as o, w as r, f as l } from "../../react.esm-CHvVvf3L.js";
3
3
  import { EmptyView as c } from "./EmptyView.js";
4
- import { d as h, t as T, g as e, v as d } from "../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { d as h, t as T, g as e, v as d } from "../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  h("EmptyView", () => {
6
6
  T("should render", () => {
7
7
  s(/* @__PURE__ */ n(c, {})), e(o.getByText("dashbord")).toBeInTheDocument();
@@ -1,8 +1,8 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { a, s as t, f as c, t as u, w as d } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a, s as t, f as c, t as u, w as d } from "../../react.esm-CHvVvf3L.js";
3
3
  import { a as s } from "../../useBreakpoints-MzTZ0tCT.js";
4
4
  import { Filter as T } from "./Filter.js";
5
- import { v as x, b as f, d as y, t as B, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
5
+ import { v as x, b as f, d as y, t as B, g as e } from "../../vi.JYQecGiw-BpOAB4v6.js";
6
6
  const o = x.fn();
7
7
  f(() => {
8
8
  x.spyOn(s, "useBreakpoints").mockReturnValue({
@@ -1,7 +1,7 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { a as n, s as t, f as m } from "../../../react.esm-Dy4VzU4L.js";
2
+ import { a as n, s as t, f as m } from "../../../react.esm-CHvVvf3L.js";
3
3
  import { FormCheckBox as c } from "./FormCheckBox.js";
4
- import { v as e, d as h, t as l, g as r } from "../../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { v as e, d as h, t as l, g as r } from "../../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  const a = e.fn();
6
6
  e.mock("react-hook-form", () => ({
7
7
  ...e.importActual("react-hook-form"),
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { a as s, s as a, f as m } from "../../../react.esm-Dy4VzU4L.js";
2
+ import { a as s, s as a, f as m } from "../../../react.esm-CHvVvf3L.js";
3
3
  import { FormDatePicker as c } from "./FormDatePicker.js";
4
- import { v as e, d as f, t as l, g as r } from "../../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { v as e, d as f, t as l, g as r } from "../../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  const i = e.fn();
6
6
  e.mock("react-hook-form", () => ({
7
7
  ...e.importActual("react-hook-form"),
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { a as s, s as t, f as m } from "../../../react.esm-Dy4VzU4L.js";
2
+ import { a as s, s as t, f as m } from "../../../react.esm-CHvVvf3L.js";
3
3
  import { FormRadio as l } from "./FormRadio.js";
4
- import { v as e, d as c, t as i, g as o } from "../../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { v as e, d as c, t as i, g as o } from "../../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  const r = e.fn();
6
6
  e.mock("react-hook-form", () => ({
7
7
  ...e.importActual("react-hook-form"),
@@ -1,9 +1,9 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { a, s as t, f as T, w as p } from "../../../react.esm-Dy4VzU4L.js";
3
- import { u as B } from "../../../index-DW4oU_OU.js";
2
+ import { a, s as t, f as T, w as p } from "../../../react.esm-CHvVvf3L.js";
3
+ import { u as B } from "../../../index-IMXII42b.js";
4
4
  import { FormSelect as i } from "./FormSelect.js";
5
5
  import { SelectTooltipText as d } from "./SelectTooltipText.js";
6
- import { v as n, d as f, t as u, g as e } from "../../../vi.JYQecGiw-BbUbJcT8.js";
6
+ import { v as n, d as f, t as u, g as e } from "../../../vi.JYQecGiw-BpOAB4v6.js";
7
7
  const g = n.fn();
8
8
  n.mock("react-hook-form", () => ({
9
9
  ...n.importActual("react-hook-form"),
@@ -1,7 +1,7 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { a, s as n } from "../../../react.esm-Dy4VzU4L.js";
2
+ import { a, s as n } from "../../../react.esm-CHvVvf3L.js";
3
3
  import { FormSlider as l } from "./FormSlider.js";
4
- import { v as e, d as m, t as i, g as r } from "../../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { v as e, d as m, t as i, g as r } from "../../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  const o = e.fn();
6
6
  e.mock("react-hook-form", () => ({
7
7
  ...e.importActual("react-hook-form"),
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { a as s, s as r, f as d } from "../../../react.esm-Dy4VzU4L.js";
2
+ import { a as s, s as r, f as d } from "../../../react.esm-CHvVvf3L.js";
3
3
  import { FormText as o } from "./FormText.js";
4
- import { v as a, d as u, t as l, g as e } from "../../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { v as a, d as u, t as l, g as e } from "../../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  const m = a.fn();
6
6
  a.mock("react-hook-form", () => ({
7
7
  ...a.importActual("react-hook-form"),
@@ -1,8 +1,8 @@
1
1
  import { jsx as a, jsxs as B } from "react/jsx-runtime";
2
- import { a as o, s as e } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a as o, s as e } from "../../react.esm-CHvVvf3L.js";
3
3
  import { a as m } from "../../useBreakpoints-MzTZ0tCT.js";
4
4
  import { GenericTable as s } from "./GenericTable.js";
5
- import { d as h, v as r, t as i, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
5
+ import { d as h, v as r, t as i, g as t } from "../../vi.JYQecGiw-BpOAB4v6.js";
6
6
  h("GenericTable Test", () => {
7
7
  r.spyOn(m, "useBreakpoints").mockReturnValue({
8
8
  isDesktop: !0,
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { a as c, s as o } from "../../../react.esm-Dy4VzU4L.js";
2
+ import { a as c, s as o } from "../../../react.esm-CHvVvf3L.js";
3
3
  import { GenericCard as i } from "./GenericCard.js";
4
- import { d as m, t as s, g as e } from "../../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { d as m, t as s, g as e } from "../../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  m("GenericCard", () => {
6
6
  const d = {
7
7
  id: 1,
@@ -1,7 +1,7 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { a as r, s as n, w as l } from "../../../react.esm-Dy4VzU4L.js";
2
+ import { a as r, s as n, w as l } from "../../../react.esm-CHvVvf3L.js";
3
3
  import { GenericCardList as s } from "./GenericCardList.js";
4
- import { d as g, t as i, g as e } from "../../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { d as g, t as i, g as e } from "../../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  g("GenericCardList", () => {
6
6
  const d = [
7
7
  { id: "name", header: "Name", accessor: "name", asCardTitle: !0 },
@@ -1,7 +1,7 @@
1
1
  import { jsx as n, Fragment as o } from "react/jsx-runtime";
2
- import { a, s as e, f as r } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a, s as e, f as r } from "../../react.esm-CHvVvf3L.js";
3
3
  import { HashTabView as c } from "./HashTabView.js";
4
- import { d as h, t as l, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { d as h, t as l, g as t } from "../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  const m = [
6
6
  {
7
7
  title: "Map",
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { a as i, s as t, f as T } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a as i, s as t, f as T } from "../../react.esm-CHvVvf3L.js";
3
3
  import { HeaderFilter as s } from "./HeaderFilter.js";
4
- import { d as c, t as o, v as l, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { d as c, t as o, v as l, g as e } from "../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  c("HeaderFilter-Test", () => {
6
6
  o("render header filter", () => {
7
7
  i(
@@ -1,8 +1,8 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { I as c } from "../../Iconify-DoU6pP1o.js";
3
3
  import { AvailableCustomIcons as l } from "../../enums/AvailableCustomIcons.js";
4
- import { a as r, w as s, s as i } from "../../react.esm-Dy4VzU4L.js";
5
- import { d as f, t as a, g as o } from "../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { a as r, w as s, s as i } from "../../react.esm-CHvVvf3L.js";
5
+ import { d as f, t as a, g as o } from "../../vi.JYQecGiw-BpOAB4v6.js";
6
6
  f("Iconify Test", async () => {
7
7
  const m = Object.keys(l).filter((e) => isNaN(Number(e)));
8
8
  a.each(m)("render available custom icon (%s)", async (e) => {
@@ -1,7 +1,7 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { a as l, s as t } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a as l, s as t } from "../../react.esm-CHvVvf3L.js";
3
3
  import { InfoGroup as r } from "./InfoGroup.js";
4
- import { d as s, t as i, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { d as s, t as i, g as e } from "../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  s("InfoGroup Test", () => {
6
6
  i("render Single InfoGroup", () => {
7
7
  l(/* @__PURE__ */ o(r, { fields: m }));
@@ -1,9 +1,9 @@
1
1
  import { jsx as r, Fragment as i } from "react/jsx-runtime";
2
2
  import { TypoButton as p } from "@element/react-components";
3
- import { a as s, s as a, f as u } from "../../react.esm-Dy4VzU4L.js";
3
+ import { a as s, s as a, f as u } from "../../react.esm-CHvVvf3L.js";
4
4
  import { ListArea as c } from "./ListArea.js";
5
5
  import { getGroupedItems as h } from "./ListAreaService.js";
6
- import { d as m, t as n, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
6
+ import { d as m, t as n, g as t } from "../../vi.JYQecGiw-BpOAB4v6.js";
7
7
  m("ListArea Test", () => {
8
8
  const o = [
9
9
  {
@@ -1,8 +1,8 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { BigLoadingSpinner as n } from "./BigLoadingSpinner.js";
3
- import { a as i, s as e } from "../../../react.esm-Dy4VzU4L.js";
3
+ import { a as i, s as e } from "../../../react.esm-CHvVvf3L.js";
4
4
  import { s as r } from "../../../bigLoadingSpinner.module-GgbFol8k.js";
5
- import { d as g, t as a, g as t } from "../../../vi.JYQecGiw-BbUbJcT8.js";
5
+ import { d as g, t as a, g as t } from "../../../vi.JYQecGiw-BpOAB4v6.js";
6
6
  g("BigLoadingSpinner Test", () => {
7
7
  a("render BigLoadingSpinner with custom loading text", () => {
8
8
  i(/* @__PURE__ */ o(n, { text: "Please wait..." })), t(e.getByText("Please wait...")).toBeInTheDocument(), t(e.getByRole("progressbar")).toBeInTheDocument();
@@ -23,6 +23,14 @@ type LoadingSpinnerProps = {
23
23
  * render only the spinner without any text
24
24
  */
25
25
  spinnerOnly?: boolean;
26
+ /**
27
+ * message to show after 10 seconds of loading
28
+ */
29
+ impatienceMessage?: string | null;
30
+ /**
31
+ * time in seconds to show the impatience message
32
+ */
33
+ impatienceTimeout?: number;
26
34
  };
27
35
  /**
28
36
  * A loading spinner component that can be used to show loading state in the application.
@@ -33,10 +41,12 @@ type LoadingSpinnerProps = {
33
41
  * @param textPosition position of the text relative to the spinner (bottom, right)
34
42
  * @param color color of the spinner (primary, secondary)
35
43
  * @param spinnerOnly render only the spinner without any text
44
+ * @param impatienceMessage message to show after 10 seconds of loading (default: 'This is taking longer than expected. Please be patient.')
45
+ * @param impatienceTimeout time in seconds to show the impatience message (default: 10)
36
46
  * @example <LoadingSpinner text='Something is loading.' />
37
47
  * @example <LoadingSpinner size='big' />
38
48
  * @example <LoadingSpinner size='md' center color='primary' spinnerOnly={true} />
39
49
  * @returns a loading spinner component
40
50
  */
41
- export declare const LoadingSpinner: ({ size, center, text, textPosition, color, spinnerOnly, }: LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element;
51
+ export declare const LoadingSpinner: ({ size, center, text, textPosition, color, spinnerOnly, impatienceMessage, impatienceTimeout, }: LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element;
42
52
  export {};
@@ -1,49 +1,63 @@
1
- import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
- import { CircularProgress as t, Padding as l, Group as g, TypoBody as m } from "@element/react-components";
3
- import { BigLoadingSpinner as p } from "../Big/BigLoadingSpinner.js";
4
- import { s as c } from "../../../loadingSpinner.module-CLtqSMWA.js";
5
- const C = ({
6
- size: i,
7
- center: o = !1,
8
- text: e,
9
- textPosition: a = "bottom",
10
- color: n = "primary",
11
- spinnerOnly: d = !1
12
- }) => i === "big" ? /* @__PURE__ */ r(p, { text: e }) : d ? /* @__PURE__ */ r(
13
- t,
14
- {
15
- "data-testid": "loading-spinner",
16
- themeColor: n,
17
- indicatorSize: i ?? "md"
18
- }
19
- ) : /* @__PURE__ */ r(
20
- l,
21
- {
22
- variant: "standard",
23
- style: { textAlign: "center" },
24
- className: o ? c.loadingSpinnerContainer : "",
25
- children: /* @__PURE__ */ s(
26
- g,
27
- {
28
- direction: a === "right" ? "horizontal" : "vertical",
29
- gap: "dense",
30
- primaryAlign: "center",
31
- secondaryAlign: "center",
32
- children: [
33
- /* @__PURE__ */ r(
34
- t,
35
- {
36
- "data-testid": "loading-spinner",
37
- themeColor: n,
38
- indicatorSize: i ?? "lg"
39
- }
40
- ),
41
- /* @__PURE__ */ r(m, { themeColor: `text-${n}-on-background`, tag: "div", children: e })
42
- ]
43
- }
44
- )
45
- }
46
- );
1
+ import { jsx as r, jsxs as u } from "react/jsx-runtime";
2
+ import { CircularProgress as s, Padding as h, Group as x, TypoBody as y } from "@element/react-components";
3
+ import { useState as v, useEffect as S, useMemo as C } from "react";
4
+ import { BigLoadingSpinner as b } from "../Big/BigLoadingSpinner.js";
5
+ import { s as A } from "../../../loadingSpinner.module-CLtqSMWA.js";
6
+ const I = ({
7
+ size: t,
8
+ center: l = !1,
9
+ text: i,
10
+ textPosition: g = "bottom",
11
+ color: e = "primary",
12
+ spinnerOnly: m = !1,
13
+ //Due to we don't have (and want) to use a translation logic in this component, we are using a hardcoded message
14
+ impatienceMessage: n = "This is taking longer than expected. Please be patient.",
15
+ impatienceTimeout: o = 10
16
+ }) => {
17
+ const [a, c] = v(0);
18
+ S(() => {
19
+ const p = setInterval(() => {
20
+ c((f) => f + 1);
21
+ }, 1e3);
22
+ return () => clearInterval(p);
23
+ }, []);
24
+ const d = C(() => n && a > o ? n : i, [n, o, i, a]);
25
+ return t === "big" ? /* @__PURE__ */ r(b, { text: d }) : m ? /* @__PURE__ */ r(
26
+ s,
27
+ {
28
+ "data-testid": "loading-spinner",
29
+ themeColor: e,
30
+ indicatorSize: t ?? "md"
31
+ }
32
+ ) : /* @__PURE__ */ r(
33
+ h,
34
+ {
35
+ variant: "standard",
36
+ style: { textAlign: "center" },
37
+ className: l ? A.loadingSpinnerContainer : "",
38
+ children: /* @__PURE__ */ u(
39
+ x,
40
+ {
41
+ direction: g === "right" ? "horizontal" : "vertical",
42
+ gap: "dense",
43
+ primaryAlign: "center",
44
+ secondaryAlign: "center",
45
+ children: [
46
+ /* @__PURE__ */ r(
47
+ s,
48
+ {
49
+ "data-testid": "loading-spinner",
50
+ themeColor: e,
51
+ indicatorSize: t ?? "lg"
52
+ }
53
+ ),
54
+ /* @__PURE__ */ r(y, { themeColor: `text-${e}-on-background`, tag: "div", "data-testid": "loading-text", children: d })
55
+ ]
56
+ }
57
+ )
58
+ }
59
+ );
60
+ };
47
61
  export {
48
- C as LoadingSpinner
62
+ I as LoadingSpinner
49
63
  };
@@ -1,13 +1,19 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { a as r, s as e } from "../../../react.esm-Dy4VzU4L.js";
3
- import { LoadingSpinner as o } from "./LoadingSpinner.js";
4
- import { d as a, t as i, g as n } from "../../../vi.JYQecGiw-BbUbJcT8.js";
5
- a("LoadingSpinner Test", () => {
6
- i("render LoadingSpinner without additional params", () => {
7
- r(/* @__PURE__ */ t(o, {})), n(e.getByRole("progressbar")).toBeInTheDocument();
8
- }), i("render LoadingSpinner with spinner only", () => {
9
- r(/* @__PURE__ */ t(o, { spinnerOnly: !0 })), n(e.getByRole("progressbar")).toBeInTheDocument(), n(e.queryByText("Loading")).not.toBeInTheDocument();
10
- }), i("render LoadingSpinner with custom loading text", () => {
11
- r(/* @__PURE__ */ t(o, { text: "Please wait..." })), n(e.getByText("Please wait...")).toBeInTheDocument();
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { a, s as e, b as s } from "../../../react.esm-CHvVvf3L.js";
3
+ import { LoadingSpinner as i } from "./LoadingSpinner.js";
4
+ import { d as m, b as d, t as o, g as t, a as r } from "../../../vi.JYQecGiw-BpOAB4v6.js";
5
+ m("LoadingSpinner Test", () => {
6
+ d(() => {
7
+ r.useFakeTimers();
8
+ }), o("render LoadingSpinner without additional params", () => {
9
+ a(/* @__PURE__ */ n(i, {})), t(e.getByRole("progressbar")).toBeInTheDocument();
10
+ }), o("render LoadingSpinner with spinner only", () => {
11
+ a(/* @__PURE__ */ n(i, { spinnerOnly: !0 })), t(e.getByRole("progressbar")).toBeInTheDocument(), t(e.queryByText("Loading")).not.toBeInTheDocument();
12
+ }), o("render LoadingSpinner with custom loading text", () => {
13
+ a(/* @__PURE__ */ n(i, { text: "Please wait..." })), t(e.getByText("Please wait...")).toBeInTheDocument();
14
+ }), o("render loadingspinner with text changed to impatience message after 10 seconds", async () => {
15
+ a(/* @__PURE__ */ n(i, { text: "Please wait...", impatienceTimeout: 1 })), t(e.getByText("Please wait...")).toBeInTheDocument(), s(() => {
16
+ r.advanceTimersByTime(2e3);
17
+ }), t(e.getByText("This is taking longer than expected. Please be patient.")).toBeInTheDocument();
12
18
  });
13
19
  });
@@ -1,9 +1,9 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { TypoDisplay as n } from "@element/react-components";
3
- import { a as i, s as e, w as s } from "../../react.esm-Dy4VzU4L.js";
4
- import { u as a } from "../../index-DW4oU_OU.js";
3
+ import { a as i, s as e, w as s } from "../../react.esm-CHvVvf3L.js";
4
+ import { u as a } from "../../index-IMXII42b.js";
5
5
  import { OverflowTooltip as c } from "./OverflowTooltip.js";
6
- import { d as u, t as p, g as r } from "../../vi.JYQecGiw-BbUbJcT8.js";
6
+ import { d as u, t as p, g as r } from "../../vi.JYQecGiw-BpOAB4v6.js";
7
7
  u("OverflowTooltip Test", () => {
8
8
  p("should render OverflowTooltip on hover", async () => {
9
9
  Object.defineProperty(HTMLElement.prototype, "clientWidth", {
@@ -1,7 +1,7 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { a, s as e } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a, s as e } from "../../react.esm-CHvVvf3L.js";
3
3
  import { ScrollbarY as d, ScrollbarX as l } from "./Scrollbar.js";
4
- import { d as c, t, g as o } from "../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { d as c, t, g as o } from "../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  c("Scrollbar", () => {
6
6
  t("should render Y correctly", () => {
7
7
  a(/* @__PURE__ */ s("div", { "data-testid": "div", className: d }));
@@ -1,7 +1,7 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import { a as r, s as t, f as h, b as l } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a as r, s as t, f as h, b as l } from "../../react.esm-CHvVvf3L.js";
3
3
  import { SearchBar as s } from "./SearchBar.js";
4
- import { d as m, t as o, v as n, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { d as m, t as o, v as n, g as e } from "../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  m("SearchBar Test", () => {
6
6
  o("renders SearchBar component", () => {
7
7
  r(
@@ -1,7 +1,7 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { a as r } from "../../react.esm-Dy4VzU4L.js";
2
+ import { a as r } from "../../react.esm-CHvVvf3L.js";
3
3
  import { VerticalDivider as s } from "./VerticalDivider.js";
4
- import { d as o, t as l, g as i } from "../../vi.JYQecGiw-BbUbJcT8.js";
4
+ import { d as o, t as l, g as i } from "../../vi.JYQecGiw-BpOAB4v6.js";
5
5
  o("VerticalDivider Test", () => {
6
6
  l("it should render with basic styling", () => {
7
7
  r(/* @__PURE__ */ e(s, {}));
@@ -1,6 +1,6 @@
1
- import { r as t, w as s } from "../react.esm-Dy4VzU4L.js";
1
+ import { r as t, w as s } from "../react.esm-CHvVvf3L.js";
2
2
  import { u as o } from "../useBreakpoints-MzTZ0tCT.js";
3
- import { d as a, t as i, g as r } from "../vi.JYQecGiw-BbUbJcT8.js";
3
+ import { d as a, t as i, g as r } from "../vi.JYQecGiw-BpOAB4v6.js";
4
4
  a("useBreakpoint Test", () => {
5
5
  i("returns object", () => {
6
6
  const { result: e } = t(() => o());
@@ -1,4 +1,4 @@
1
- import { c as zs, d as _o, e as Dl, l as Ws } from "./react.esm-Dy4VzU4L.js";
1
+ import { c as zs, d as _o, e as Dl, l as Ws } from "./react.esm-CHvVvf3L.js";
2
2
  function g(e, t, r) {
3
3
  return e.namespaceURI && e.namespaceURI !== "http://www.w3.org/1999/xhtml" || (t = Array.isArray(t) ? t : [
4
4
  t
@@ -2,7 +2,7 @@ import * as mt from "react";
2
2
  import Ac from "react";
3
3
  import It from "react-dom";
4
4
  import { c as Bi, g as Tp } from "./_commonjsHelpers-CT_km90n.js";
5
- import { r as qp } from "./vi.JYQecGiw-BbUbJcT8.js";
5
+ import { r as qp } from "./vi.JYQecGiw-BpOAB4v6.js";
6
6
  var Yl = { exports: {} }, ne = {};
7
7
  /**
8
8
  * @license React
@@ -1,6 +1,6 @@
1
1
  import { getBlockNumberByDto as r } from "./BlockService.js";
2
2
  import { capitalizeFirstLetters as a, trimLeadingAndTrailingSpaces as o } from "./UtilService.js";
3
- import { d as n, t as e, g as s } from "../vi.JYQecGiw-BbUbJcT8.js";
3
+ import { d as n, t as e, g as s } from "../vi.JYQecGiw-BpOAB4v6.js";
4
4
  n("Services Test", () => {
5
5
  n("capitalizeFirstLetters", () => {
6
6
  e("should capitalize first letters of a lower case string", () => {
@@ -9786,6 +9786,7 @@ function Od() {
9786
9786
  }
9787
9787
  const Ad = Od(), dn = Ad;
9788
9788
  export {
9789
+ dn as a,
9789
9790
  _d as b,
9790
9791
  Pd as d,
9791
9792
  Dp as g,
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": "0.0.9707",
4
+ "version": "0.0.9939",
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>",