@hortiview/shared-components 2.14.0 → 2.16.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.
- package/CHANGELOG.md +16 -0
- package/dist/AlertBanner-aW6joVUm.js +35 -0
- package/dist/GenericCard-IWX-Bmb_.js +90 -0
- package/dist/assets/ButtonCard.css +1 -0
- package/dist/assets/ConfirmationModal.css +1 -0
- package/dist/assets/GenericCard.css +1 -1
- package/dist/assets/GenericTable.css +1 -1
- package/dist/assets/InfoCard.css +1 -1
- package/dist/assets/stepper.css +1 -1
- package/dist/components/AlertBanner/AlertBanner.d.ts +5 -1
- package/dist/components/AlertBanner/AlertBanner.js +1 -1
- package/dist/components/AlertBanner/AlertBanner.test.js +9 -7
- package/dist/components/AlertBanner/LinkBanner.js +1 -1
- package/dist/components/AlertBanner/LinkBanner.test.js +3 -3
- package/dist/components/BaseView/BaseView.test.js +1 -1
- package/dist/components/ButtonCard/ButtonCard.d.ts +42 -0
- package/dist/components/ButtonCard/ButtonCard.js +51 -0
- package/dist/components/ButtonCard/ButtonCard.test.d.ts +1 -0
- package/dist/components/ButtonCard/ButtonCard.test.js +92 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.d.ts +77 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.js +90 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.test.d.ts +1 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.test.js +221 -0
- package/dist/components/DeleteModal/DeleteModal.js +6 -6
- package/dist/components/Filter/Filter.js +3 -3
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +1 -1
- package/dist/components/FormComponents/FormNumber/CustomTextField.js +1 -1
- package/dist/components/FormComponents/FormSlider/FormSlider.js +1 -1
- package/dist/components/FormComponents/FormText/FormText.js +1 -1
- package/dist/components/GenericTable/GenericTable.js +145 -137
- package/dist/components/GenericTable/Mobile/GenericCard.js +1 -1
- package/dist/components/GenericTable/Mobile/GenericCard.test.js +1 -1
- package/dist/components/GenericTable/Mobile/GenericCardList.js +11 -11
- package/dist/components/InfoCard/InfoCard.d.ts +6 -2
- package/dist/components/InfoCard/InfoCard.js +50 -37
- package/dist/components/InfoCard/InfoCard.test.js +40 -18
- package/dist/components/ModulePadding/ModulePadding.js +2 -2
- package/dist/components/SearchBar/SearchBar.js +1 -1
- package/dist/components/Stepper/Stepper.d.ts +13 -6
- package/dist/components/Stepper/Stepper.js +94 -39
- package/dist/components/Stepper/Stepper.test.js +305 -121
- package/dist/components/Stepper/components/StepperButton.js +1 -1
- package/dist/components/Stepper/components/StepperHeader.d.ts +1 -10
- package/dist/components/Stepper/components/StepperHeader.js +140 -69
- package/dist/components/Stepper/components/StepperItem.d.ts +8 -0
- package/dist/components/Stepper/components/StepperItem.js +44 -0
- package/dist/components/Stepper/stepperTypes.d.ts +105 -46
- package/dist/components/Stepper/stepperTypes.js +4 -1
- package/dist/{index.es-B74L_Dje.js → index.es-BYcQTTL8.js} +3 -3
- package/dist/{index.es-C7cC1Hdu.js → index.es-C32E1Lcb.js} +1 -1
- package/dist/main.d.ts +2 -1
- package/dist/main.js +118 -116
- package/dist/services/UtilService.js +2 -2
- package/dist/stepper.module-DR_FbENS.js +23 -0
- package/package.json +3 -2
- package/dist/AlertBanner-Ci-F-6S9.js +0 -26
- package/dist/GenericCard-CeqYrtLH.js +0 -89
- package/dist/components/Stepper/components/StepperIndicator.d.ts +0 -9
- package/dist/components/Stepper/components/StepperIndicator.js +0 -16
- package/dist/stepper.module-c-CWmpkt.js +0 -15
|
@@ -4,7 +4,7 @@ import "../../../index.es-CeQB6igi.js";
|
|
|
4
4
|
import "../../../index.es-SjZ_-d7U.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "../../OverflowTooltip/OverflowTooltip.js";
|
|
7
|
-
import { G } from "../../../GenericCard-
|
|
7
|
+
import { G } from "../../../GenericCard-IWX-Bmb_.js";
|
|
8
8
|
export {
|
|
9
9
|
G as GenericCard
|
|
10
10
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { a as c, s as o } from "../../../react.esm-Bm0cAgpZ.js";
|
|
3
|
-
import { G as i } from "../../../GenericCard-
|
|
3
|
+
import { G as i } from "../../../GenericCard-IWX-Bmb_.js";
|
|
4
4
|
import { d as m, t as s, g as e } from "../../../vi.bdSIJ99Y-B308Q-4w.js";
|
|
5
5
|
m("GenericCard", () => {
|
|
6
6
|
const d = {
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { G as
|
|
3
|
-
import { P as
|
|
2
|
+
import { G as l } from "../../../index.es-oxil0uFe.js";
|
|
3
|
+
import { P as c } from "../../../index.es-BanVdXEd.js";
|
|
4
4
|
import { a as o } from "../../../index.es-SjZ_-d7U.js";
|
|
5
|
-
import { s as
|
|
6
|
-
const
|
|
5
|
+
import { s as e, G as m } from "../../../GenericCard-IWX-Bmb_.js";
|
|
6
|
+
const g = ({
|
|
7
7
|
columns: n,
|
|
8
|
-
data:
|
|
8
|
+
data: t,
|
|
9
9
|
hiddenColumns: a = [],
|
|
10
|
-
noContentText:
|
|
11
|
-
}) =>
|
|
10
|
+
noContentText: s
|
|
11
|
+
}) => t?.length === 0 ? /* @__PURE__ */ r("div", { "data-testid": "empty-generic-card-list", className: e.emptyContainer, children: /* @__PURE__ */ r(c, { variant: "standard", style: { textAlign: "center" }, className: e.empty, children: /* @__PURE__ */ r(o, { children: s }) }) }) : (
|
|
12
12
|
// needs the div to surround the Group by an element with display: block to avoid visual errors
|
|
13
|
-
/* @__PURE__ */ r("div", {
|
|
13
|
+
/* @__PURE__ */ r("div", { className: e.fullWidth, children: /* @__PURE__ */ r(l, { fullWidth: !0, direction: "vertical", primaryAlign: "center", secondaryAlign: "center", children: t?.map((i, d) => /* @__PURE__ */ r(
|
|
14
14
|
m,
|
|
15
15
|
{
|
|
16
|
-
item:
|
|
16
|
+
item: i,
|
|
17
17
|
columns: n,
|
|
18
18
|
hiddenColumns: a
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
i.id ?? d
|
|
21
21
|
)) }) })
|
|
22
22
|
);
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
g as GenericCardList
|
|
25
25
|
};
|
|
@@ -12,7 +12,11 @@ export type InfoCardProps = {
|
|
|
12
12
|
/**
|
|
13
13
|
* Type of the failed health check. Depending on the type, a different icon of 3rem size will be displayed.
|
|
14
14
|
*/
|
|
15
|
-
type: 'database' | 'iot' | 'platform' | 'done' | 'other';
|
|
15
|
+
type: 'database' | 'iot' | 'platform' | 'done' | 'other' | 'celebration';
|
|
16
|
+
/**
|
|
17
|
+
* The color of the icon. Depending on the type, a different default color will be applied, but it can be overridden by providing a value for this prop.
|
|
18
|
+
*/
|
|
19
|
+
colorOverride?: 'primary' | 'secondary' | 'success' | 'danger';
|
|
16
20
|
/**
|
|
17
21
|
* The card has a default outline. For design consistency, this prop should only be set to 'false' if the card is embedded, e.g. in a table.
|
|
18
22
|
*/
|
|
@@ -22,4 +26,4 @@ export type InfoCardProps = {
|
|
|
22
26
|
*/
|
|
23
27
|
isFullHeight?: boolean;
|
|
24
28
|
};
|
|
25
|
-
export declare const InfoCard: ({ title, subtitle, type, isOutlined, isFullHeight, }: InfoCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const InfoCard: ({ title, subtitle, type, colorOverride, isOutlined, isFullHeight, }: InfoCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,59 +1,72 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { C as
|
|
3
|
-
import { G as
|
|
4
|
-
import { P as
|
|
5
|
-
import { T as
|
|
6
|
-
import { Iconify as
|
|
7
|
-
import '../../assets/InfoCard.css';const
|
|
8
|
-
database:
|
|
9
|
-
spin:
|
|
10
|
-
done:
|
|
11
|
-
iot:
|
|
12
|
-
platform:
|
|
13
|
-
other:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { C as _, a as p, b as m } from "../../index.es-BPv5dCFQ.js";
|
|
3
|
+
import { G as h } from "../../index.es-oxil0uFe.js";
|
|
4
|
+
import { P as u } from "../../index.es-BanVdXEd.js";
|
|
5
|
+
import { T as c } from "../../index.es-SjZ_-d7U.js";
|
|
6
|
+
import { Iconify as f } from "../Iconify/Iconify.js";
|
|
7
|
+
import '../../assets/InfoCard.css';const g = "_database_1vpro_1", v = "_spin_1vpro_1", y = "_done_1vpro_16", b = "_iot_1vpro_20", C = "_platform_1vpro_21", x = "_other_1vpro_22", N = "_celebration_1vpro_26", H = "_primary_1vpro_30", T = "_secondary_1vpro_34", k = "_danger_1vpro_38", I = "_success_1vpro_42", A = "_crossedOut_1vpro_46", O = "_fullHeight_1vpro_65", j = "_centerText_1vpro_69", r = {
|
|
8
|
+
database: g,
|
|
9
|
+
spin: v,
|
|
10
|
+
done: y,
|
|
11
|
+
iot: b,
|
|
12
|
+
platform: C,
|
|
13
|
+
other: x,
|
|
14
|
+
celebration: N,
|
|
15
|
+
primary: H,
|
|
16
|
+
secondary: T,
|
|
17
|
+
danger: k,
|
|
18
|
+
success: I,
|
|
19
|
+
crossedOut: A,
|
|
20
|
+
fullHeight: O,
|
|
21
|
+
centerText: j
|
|
22
|
+
}, q = ({
|
|
23
|
+
title: o,
|
|
24
|
+
subtitle: t,
|
|
25
|
+
type: n,
|
|
26
|
+
colorOverride: i,
|
|
27
|
+
isOutlined: l = !0,
|
|
28
|
+
isFullHeight: s = !1
|
|
23
29
|
}) => {
|
|
24
|
-
const
|
|
30
|
+
const a = s ? r.fullHeight : "";
|
|
25
31
|
return /* @__PURE__ */ e(
|
|
26
|
-
|
|
32
|
+
_,
|
|
27
33
|
{
|
|
28
|
-
variant:
|
|
29
|
-
"data-testid": `${
|
|
34
|
+
variant: l ? "outlined" : "flat",
|
|
35
|
+
"data-testid": `${n}-health-check-failed-card`,
|
|
30
36
|
bodyAlignment: "centered",
|
|
31
|
-
height:
|
|
32
|
-
children: /* @__PURE__ */ e(
|
|
33
|
-
|
|
37
|
+
height: s ? "100%" : "auto",
|
|
38
|
+
children: /* @__PURE__ */ e(p, { className: a, children: /* @__PURE__ */ e(u, { variant: "airy", className: a, children: /* @__PURE__ */ e(m, { className: a, children: /* @__PURE__ */ d(
|
|
39
|
+
h,
|
|
34
40
|
{
|
|
35
41
|
gap: "none",
|
|
36
42
|
primaryAlign: "center",
|
|
37
43
|
secondaryAlign: "center",
|
|
38
44
|
direction: "vertical",
|
|
39
45
|
fullWidth: !0,
|
|
40
|
-
className:
|
|
46
|
+
className: r.centerText,
|
|
41
47
|
children: [
|
|
42
|
-
/* @__PURE__ */ e(
|
|
43
|
-
/* @__PURE__ */ e(
|
|
44
|
-
/* @__PURE__ */ e(
|
|
48
|
+
/* @__PURE__ */ e(F, { type: n, colorOverride: i }),
|
|
49
|
+
/* @__PURE__ */ e(c, { level: 1, bold: !0, children: o }),
|
|
50
|
+
/* @__PURE__ */ e(c, { level: 2, themeColor: "text-secondary-on-background", children: t })
|
|
45
51
|
]
|
|
46
52
|
}
|
|
47
53
|
) }) }) })
|
|
48
54
|
}
|
|
49
55
|
);
|
|
50
|
-
},
|
|
56
|
+
}, B = {
|
|
51
57
|
database: "sync",
|
|
52
58
|
iot: "settings_input_antenna",
|
|
53
59
|
platform: "engineering",
|
|
54
60
|
done: "sunny-check",
|
|
55
|
-
other: "error"
|
|
56
|
-
|
|
61
|
+
other: "error",
|
|
62
|
+
celebration: "celebration"
|
|
63
|
+
}, F = ({
|
|
64
|
+
type: o,
|
|
65
|
+
colorOverride: t
|
|
66
|
+
}) => {
|
|
67
|
+
const n = t ? r[t] : r[o];
|
|
68
|
+
return /* @__PURE__ */ e("span", { className: o === "iot" ? r.crossedOut : "", children: /* @__PURE__ */ e(f, { icon: B[o], className: n, iconSize: "xlarge" }) });
|
|
69
|
+
};
|
|
57
70
|
export {
|
|
58
|
-
|
|
71
|
+
q as InfoCard
|
|
59
72
|
};
|
|
@@ -1,26 +1,48 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { a as r, s as
|
|
3
|
-
import { InfoCard as
|
|
4
|
-
import { d as
|
|
5
|
-
|
|
6
|
-
const
|
|
2
|
+
import { a as r, s as t } from "../../react.esm-Bm0cAgpZ.js";
|
|
3
|
+
import { InfoCard as n } from "./InfoCard.js";
|
|
4
|
+
import { d as l, t as i, g as o } from "../../vi.bdSIJ99Y-B308Q-4w.js";
|
|
5
|
+
l("HealthCheckFailed Component", () => {
|
|
6
|
+
const c = "Test Title", s = "Test Subtitle";
|
|
7
7
|
i("displays the correct title and subtitle", () => {
|
|
8
|
-
r(/* @__PURE__ */ a(
|
|
8
|
+
r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "database" })), o(t.getByText(c)).toBeInTheDocument(), o(t.getByText(s)).toBeInTheDocument();
|
|
9
9
|
}), i('displays the correct icon for type "database"', () => {
|
|
10
|
-
r(/* @__PURE__ */ a(
|
|
11
|
-
const
|
|
12
|
-
|
|
10
|
+
r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "database" }));
|
|
11
|
+
const e = t.getByText("sync");
|
|
12
|
+
o(e).toBeInTheDocument(), o(t.getByTestId("database-health-check-failed-card")).toBeInTheDocument();
|
|
13
13
|
}), i('displays the correct icon for type "iot"', () => {
|
|
14
|
-
r(/* @__PURE__ */ a(
|
|
15
|
-
const
|
|
16
|
-
|
|
14
|
+
r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "iot" }));
|
|
15
|
+
const e = t.getByText("settings_input_antenna");
|
|
16
|
+
o(e).toBeInTheDocument(), o(t.getByTestId("iot-health-check-failed-card")).toBeInTheDocument();
|
|
17
17
|
}), i('displays the correct icon for type "platform"', () => {
|
|
18
|
-
r(/* @__PURE__ */ a(
|
|
19
|
-
const
|
|
20
|
-
|
|
18
|
+
r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "platform" }));
|
|
19
|
+
const e = t.getByText("engineering");
|
|
20
|
+
o(e).toBeInTheDocument(), o(t.getByTestId("platform-health-check-failed-card")).toBeInTheDocument();
|
|
21
21
|
}), i('displays the correct icon for type "other"', () => {
|
|
22
|
-
r(/* @__PURE__ */ a(
|
|
23
|
-
const
|
|
24
|
-
|
|
22
|
+
r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "other" }));
|
|
23
|
+
const e = t.getByText("error");
|
|
24
|
+
o(e).toBeInTheDocument(), o(t.getByTestId("other-health-check-failed-card")).toBeInTheDocument();
|
|
25
|
+
}), i('displays the correct icon for type "celebration"', () => {
|
|
26
|
+
r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "celebration" }));
|
|
27
|
+
const e = t.getByText("celebration");
|
|
28
|
+
o(e).toBeInTheDocument(), o(t.getByTestId("celebration-health-check-failed-card")).toBeInTheDocument();
|
|
29
|
+
}), i("applies colorOverride class for primary", () => {
|
|
30
|
+
r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "database", colorOverride: "primary" }));
|
|
31
|
+
const e = t.getByText("sync").closest("span")?.querySelector("svg, span, i");
|
|
32
|
+
o(e?.className).toMatch(/primary/);
|
|
33
|
+
}), i("applies colorOverride class for secondary", () => {
|
|
34
|
+
r(
|
|
35
|
+
/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "database", colorOverride: "secondary" })
|
|
36
|
+
);
|
|
37
|
+
const e = t.getByText("sync").closest("span")?.querySelector("svg, span, i");
|
|
38
|
+
o(e?.className).toMatch(/secondary/);
|
|
39
|
+
}), i("applies colorOverride class for success", () => {
|
|
40
|
+
r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "database", colorOverride: "success" }));
|
|
41
|
+
const e = t.getByText("sync").closest("span")?.querySelector("svg, span, i");
|
|
42
|
+
o(e?.className).toMatch(/success/);
|
|
43
|
+
}), i("applies colorOverride class for danger", () => {
|
|
44
|
+
r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "database", colorOverride: "danger" }));
|
|
45
|
+
const e = t.getByText("sync").closest("span")?.querySelector("svg, span, i");
|
|
46
|
+
o(e?.className).toMatch(/danger/);
|
|
25
47
|
});
|
|
26
48
|
});
|
|
@@ -5,6 +5,8 @@ import "react";
|
|
|
5
5
|
import { u as m } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
6
6
|
import "../../react-tooltip.min-CVsI--2Y.js";
|
|
7
7
|
import "../../orderBy-DLBJlgdL.js";
|
|
8
|
+
import "../../index-CuHybtft.js";
|
|
9
|
+
import "../SharedComponentsPermissionProvider/PermissionContext.js";
|
|
8
10
|
import "../../uniqueId-BNVTeImh.js";
|
|
9
11
|
import "react-hook-form";
|
|
10
12
|
import "../../get-D8IXqiys.js";
|
|
@@ -12,8 +14,6 @@ import "../../isArray-BjSPDQ4v.js";
|
|
|
12
14
|
import "../../isString-DVA49FEo.js";
|
|
13
15
|
import "../../omit-CYY_mIYv.js";
|
|
14
16
|
import "../../types/Time.js";
|
|
15
|
-
import "../../index-CuHybtft.js";
|
|
16
|
-
import "../SharedComponentsPermissionProvider/PermissionContext.js";
|
|
17
17
|
import "../../react.esm-Bm0cAgpZ.js";
|
|
18
18
|
const D = ({ children: o }) => {
|
|
19
19
|
const { isDesktop: t } = m();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { I as l } from "../../index.es-t87yNd9Y.js";
|
|
3
|
-
import { T as u } from "../../index.es-
|
|
3
|
+
import { T as u } from "../../index.es-BYcQTTL8.js";
|
|
4
4
|
import '../../assets/SearchBar.css';const b = "_searchbar_g83qp_1", d = {
|
|
5
5
|
searchbar: b
|
|
6
6
|
}, g = ({
|
|
@@ -3,19 +3,26 @@ import { StepperProps } from './stepperTypes';
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A component that displays a stepper with a header, content, and navigation buttons.<br />
|
|
6
|
-
* Available in
|
|
6
|
+
* Available in three display types: 'desktop', 'small' and 'dots'.<br />
|
|
7
|
+
*
|
|
8
|
+
* - Desktop: Default EDS-like styling
|
|
9
|
+
* - Small: A compact version of the desktop stepper showing only the current step and total steps in the header, as well as the title of the current step.
|
|
10
|
+
* - Dots: A minimal version showing only centered dots for each step and the title of the current step in the header.
|
|
11
|
+
*
|
|
7
12
|
*
|
|
8
13
|
* **!! Be aware that the stepper is not a controlled component, so you need to manage the current step, content and loading state yourself. !!**
|
|
9
14
|
*
|
|
10
|
-
* @param stepperType - The type of the stepper indicator. Defaults to '
|
|
15
|
+
* @param stepperType - The type of the stepper indicator. Defaults to 'desktop'.
|
|
11
16
|
* @param steps - An array of steps for the stepper.
|
|
12
|
-
* @param
|
|
13
|
-
*
|
|
14
|
-
* @param
|
|
17
|
+
* @param currentStepId - The current step id, matching the id property of one of the steps in
|
|
18
|
+
* the steps array.
|
|
19
|
+
* @param overwriteTotalSteps - A custom total number of steps to display in the stepper header. Only applicable for 'small' stepper.
|
|
15
20
|
* @param isStepLoading - A boolean indicating if the current step is loading. If true, the next button will be disabled and show a loading state.
|
|
16
21
|
* @param showStepperHeader - An indicator of whether to show the stepper header. Defaults to true.
|
|
22
|
+
* @param showStepperButtons - An indicator of whether to show the stepper buttons. Defaults to true.
|
|
17
23
|
* @param stepperButtonAlignment - The alignment of the stepper button group. Defaults to 'center'.
|
|
18
24
|
* @param showPreviousButtonOnFirstStep - A flag which indicates if the previous button should be shown on the first step. This can be useful for canceling the stepper. Defaults to false.
|
|
25
|
+
* @param children - The content to be displayed in the stepper.
|
|
19
26
|
* @returns
|
|
20
27
|
*/
|
|
21
|
-
export declare const Stepper: ({ stepperType, steps,
|
|
28
|
+
export declare const Stepper: ({ stepperType, steps, currentStepId, overwriteTotalSteps, isStepLoading, showStepperHeader, showStepperButtons, stepperButtonAlignment, showPreviousButtonOnFirstStep, children, }: PropsWithChildren<StepperProps>) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,23 +1,70 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { G as
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { StepperPreviousButton as
|
|
5
|
-
import { StepperHeader as
|
|
6
|
-
import { s as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
isStepLoading:
|
|
14
|
-
showStepperHeader:
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { G as u } from "../../index.es-oxil0uFe.js";
|
|
3
|
+
import { useMemo as v } from "react";
|
|
4
|
+
import { StepperPreviousButton as g, StepperNextButton as A } from "./components/StepperButton.js";
|
|
5
|
+
import { StepperHeader as k } from "./components/StepperHeader.js";
|
|
6
|
+
import { s as D } from "../../stepper.module-DR_FbENS.js";
|
|
7
|
+
import { StepperType as S } from "./stepperTypes.js";
|
|
8
|
+
const T = ({
|
|
9
|
+
stepperType: h = S.DESKTOP,
|
|
10
|
+
steps: i,
|
|
11
|
+
currentStepId: o,
|
|
12
|
+
overwriteTotalSteps: P,
|
|
13
|
+
isStepLoading: x,
|
|
14
|
+
showStepperHeader: y = !0,
|
|
15
|
+
showStepperButtons: c = !0,
|
|
16
|
+
stepperButtonAlignment: C = "center",
|
|
17
|
+
showPreviousButtonOnFirstStep: d = !1,
|
|
18
|
+
children: B
|
|
17
19
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
const p = v(() => {
|
|
21
|
+
const s = i.map((r, e) => (e === 0 && r.excludeFromHeader && console.error(
|
|
22
|
+
"The first step is excluded from the header. Please check your configuration."
|
|
23
|
+
), {
|
|
24
|
+
step: r,
|
|
25
|
+
isActive: !1,
|
|
26
|
+
isCompleted: !1,
|
|
27
|
+
isRendered: !r.excludeFromHeader,
|
|
28
|
+
isFirst: e === 0,
|
|
29
|
+
isLast: e === i.length - 1
|
|
30
|
+
})), l = i.findIndex((r) => r.id === o);
|
|
31
|
+
l === -1 && console.error(
|
|
32
|
+
`Current step with id ${o} not found in steps array. Bad configuration?`
|
|
33
|
+
);
|
|
34
|
+
let f = o;
|
|
35
|
+
for (let r = 0; r < s.length; r++) {
|
|
36
|
+
const e = s[r];
|
|
37
|
+
if (r > l) {
|
|
38
|
+
e.isActive = !1, e.isCompleted = !1;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (e.step.id === o)
|
|
42
|
+
if (e.isRendered)
|
|
43
|
+
e.isActive = !0, e.isCompleted = !1;
|
|
44
|
+
else {
|
|
45
|
+
const a = s.find((b) => b.step.id === f);
|
|
46
|
+
a && (a.isActive = !0, a.isCompleted = e.step.excludedStepCompletesPreviousStep ?? !1);
|
|
47
|
+
}
|
|
48
|
+
r < l && (e.isActive = !1, e.isCompleted = !0, e.isRendered && (f = e.step.id));
|
|
49
|
+
}
|
|
50
|
+
return s;
|
|
51
|
+
}, [i, o]), t = v(() => p.find((s) => s.isActive), [p]);
|
|
52
|
+
if (!t)
|
|
53
|
+
return console.error(
|
|
54
|
+
`No active step found for currentStepId ${o}. Please check your configuration.`
|
|
55
|
+
), null;
|
|
56
|
+
if (c) {
|
|
57
|
+
if (!t.step.nextButtonProps?.onClick || !t.step.nextButtonProps?.label)
|
|
58
|
+
return console.error(
|
|
59
|
+
`Next button props not found for current step with id ${o}. If you want to use the stepper buttons, make sure to provide nextButtonProps for each step.`
|
|
60
|
+
), null;
|
|
61
|
+
if ((!t.isFirst || d) && (!t.step.prevButtonProps?.onClick || !t.step.prevButtonProps?.label))
|
|
62
|
+
return console.error(
|
|
63
|
+
`Previous button props not found for current step with id ${o}. If you want to use the stepper buttons, make sure to provide prevButtonProps for each applicable step.`
|
|
64
|
+
), null;
|
|
65
|
+
}
|
|
66
|
+
return /* @__PURE__ */ m(
|
|
67
|
+
u,
|
|
21
68
|
{
|
|
22
69
|
"data-testid": "stepper",
|
|
23
70
|
fullWidth: !0,
|
|
@@ -26,51 +73,59 @@ const j = ({
|
|
|
26
73
|
primaryAlign: "center",
|
|
27
74
|
secondaryAlign: "center",
|
|
28
75
|
children: [
|
|
29
|
-
|
|
30
|
-
|
|
76
|
+
y ? /* @__PURE__ */ n(
|
|
77
|
+
k,
|
|
31
78
|
{
|
|
32
|
-
stepperType:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
customTotalSteps: a
|
|
79
|
+
stepperType: h,
|
|
80
|
+
stepsData: p,
|
|
81
|
+
overwriteTotalSteps: P
|
|
36
82
|
}
|
|
37
83
|
) : null,
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
84
|
+
/* @__PURE__ */ n(
|
|
85
|
+
u,
|
|
40
86
|
{
|
|
41
87
|
"data-testid": "stepper-content",
|
|
42
88
|
fullWidth: !0,
|
|
43
|
-
className:
|
|
89
|
+
className: D.stepperContent,
|
|
44
90
|
gap: "airy",
|
|
45
91
|
secondaryAlign: "center",
|
|
46
92
|
direction: "vertical",
|
|
47
|
-
children:
|
|
93
|
+
children: B
|
|
48
94
|
}
|
|
49
95
|
),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
96
|
+
c ? /* @__PURE__ */ m(
|
|
97
|
+
u,
|
|
52
98
|
{
|
|
53
99
|
"data-testid": "stepper-buttons",
|
|
54
100
|
fullWidth: !0,
|
|
55
101
|
secondaryAlign: "center",
|
|
56
|
-
primaryAlign:
|
|
102
|
+
primaryAlign: C,
|
|
57
103
|
children: [
|
|
58
|
-
(t
|
|
59
|
-
/* @__PURE__ */ r(
|
|
104
|
+
(!t.isFirst || d) && /* @__PURE__ */ n(
|
|
60
105
|
g,
|
|
61
106
|
{
|
|
62
|
-
...
|
|
63
|
-
|
|
64
|
-
|
|
107
|
+
...t.step.prevButtonProps,
|
|
108
|
+
onClick: t.step.prevButtonProps.onClick,
|
|
109
|
+
label: t.step.prevButtonProps.label
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
/* @__PURE__ */ n(
|
|
113
|
+
A,
|
|
114
|
+
{
|
|
115
|
+
...t.step.nextButtonProps,
|
|
116
|
+
onClick: t.step.nextButtonProps.onClick,
|
|
117
|
+
label: t.step.nextButtonProps.label,
|
|
118
|
+
isStepLoading: x,
|
|
119
|
+
isLastStep: t.isLast
|
|
65
120
|
}
|
|
66
121
|
)
|
|
67
122
|
]
|
|
68
123
|
}
|
|
69
|
-
)
|
|
124
|
+
) : null
|
|
70
125
|
]
|
|
71
126
|
}
|
|
72
127
|
);
|
|
73
128
|
};
|
|
74
129
|
export {
|
|
75
|
-
|
|
130
|
+
T as Stepper
|
|
76
131
|
};
|