@hitachivantara/uikit-react-lab 5.46.13 → 6.0.0-next.1
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/dist/{esm/Flow → Flow}/Background/Background.js +1 -1
- package/dist/{esm/Flow → Flow}/Controls/Controls.js +1 -1
- package/dist/{esm/Flow → Flow}/DroppableFlow.js +1 -1
- package/dist/{esm/Flow → Flow}/Empty/Empty.js +1 -1
- package/dist/{esm/Flow → Flow}/Empty/Empty.styles.js +1 -1
- package/dist/{esm/Flow → Flow}/Flow.js +1 -1
- package/dist/{esm/Flow → Flow}/Flow.styles.js +1 -1
- package/dist/{esm/Flow → Flow}/Minimap/Minimap.js +1 -1
- package/dist/{esm/Flow → Flow}/Node/BaseNode.js +1 -1
- package/dist/{esm/Flow → Flow}/Node/Node.js +0 -3
- package/dist/{esm/Flow → Flow}/Sidebar/Sidebar.js +1 -1
- package/dist/Flow/base.js +732 -0
- package/dist/{esm/Flow → Flow}/hooks/useFlowInstance.js +1 -1
- package/dist/{esm/Flow → Flow}/hooks/useFlowNode.js +4 -4
- package/dist/{esm/Flow → Flow}/hooks/useNodeId.js +1 -1
- package/dist/{esm/StepNavigation → StepNavigation}/DefaultNavigation/DefaultNavigation.js +1 -3
- package/dist/{esm/StepNavigation → StepNavigation}/SimpleNavigation/SimpleNavigation.js +1 -3
- package/dist/{esm/StepNavigation → StepNavigation}/StepNavigation.js +2 -7
- package/dist/{esm/Wizard → Wizard}/WizardTitle/WizardTitle.js +31 -47
- package/dist/{esm/Wizard → Wizard}/WizardTitle/WizardTitle.styles.js +0 -10
- package/dist/{types/index.d.ts → index.d.ts} +63 -178
- package/dist/{esm/index.js → index.js} +12 -18
- package/package.json +15 -15
- package/dist/cjs/Blade/Blade.cjs +0 -174
- package/dist/cjs/Blade/Blade.styles.cjs +0 -71
- package/dist/cjs/Blades/Blades.cjs +0 -104
- package/dist/cjs/Blades/Blades.styles.cjs +0 -11
- package/dist/cjs/Dashboard/Dashboard.cjs +0 -63
- package/dist/cjs/Dashboard/Dashboard.styles.cjs +0 -196
- package/dist/cjs/Flow/Background/Background.cjs +0 -19
- package/dist/cjs/Flow/Controls/Controls.cjs +0 -96
- package/dist/cjs/Flow/DroppableFlow.cjs +0 -204
- package/dist/cjs/Flow/Empty/Empty.cjs +0 -12
- package/dist/cjs/Flow/Empty/Empty.styles.cjs +0 -16
- package/dist/cjs/Flow/Flow.cjs +0 -33
- package/dist/cjs/Flow/Flow.styles.cjs +0 -19
- package/dist/cjs/Flow/FlowContext/FlowContext.cjs +0 -25
- package/dist/cjs/Flow/FlowContext/NodeMetaContext.cjs +0 -43
- package/dist/cjs/Flow/Minimap/Minimap.cjs +0 -30
- package/dist/cjs/Flow/Minimap/Minimap.styles.cjs +0 -10
- package/dist/cjs/Flow/Node/BaseNode.cjs +0 -192
- package/dist/cjs/Flow/Node/BaseNode.styles.cjs +0 -135
- package/dist/cjs/Flow/Node/Node.cjs +0 -115
- package/dist/cjs/Flow/Node/Node.styles.cjs +0 -42
- package/dist/cjs/Flow/Node/Parameters/ParamRenderer.cjs +0 -19
- package/dist/cjs/Flow/Node/Parameters/Select.cjs +0 -41
- package/dist/cjs/Flow/Node/Parameters/Slider.cjs +0 -33
- package/dist/cjs/Flow/Node/Parameters/Text.cjs +0 -19
- package/dist/cjs/Flow/Node/utils.cjs +0 -54
- package/dist/cjs/Flow/Sidebar/Sidebar.cjs +0 -141
- package/dist/cjs/Flow/Sidebar/Sidebar.styles.cjs +0 -24
- package/dist/cjs/Flow/Sidebar/SidebarGroup/SidebarGroup.cjs +0 -62
- package/dist/cjs/Flow/Sidebar/SidebarGroup/SidebarGroup.styles.cjs +0 -34
- package/dist/cjs/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.cjs +0 -51
- package/dist/cjs/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.cjs +0 -35
- package/dist/cjs/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.styles.cjs +0 -23
- package/dist/cjs/Flow/base.cjs +0 -411
- package/dist/cjs/Flow/hooks/useFlowContext.cjs +0 -6
- package/dist/cjs/Flow/hooks/useFlowInstance.cjs +0 -7
- package/dist/cjs/Flow/hooks/useFlowNode.cjs +0 -134
- package/dist/cjs/Flow/hooks/useFlowNodeMeta.cjs +0 -10
- package/dist/cjs/Flow/hooks/useNode.cjs +0 -159
- package/dist/cjs/Flow/hooks/useNodeId.cjs +0 -8
- package/dist/cjs/Flow/nodes/DashboardNode.cjs +0 -88
- package/dist/cjs/Flow/nodes/DashboardNode.styles.cjs +0 -16
- package/dist/cjs/Flow/nodes/StickyNode.cjs +0 -441
- package/dist/cjs/StepNavigation/DefaultNavigation/DefaultNavigation.cjs +0 -56
- package/dist/cjs/StepNavigation/DefaultNavigation/Step/Step.cjs +0 -78
- package/dist/cjs/StepNavigation/DefaultNavigation/Step/Step.styles.cjs +0 -35
- package/dist/cjs/StepNavigation/DefaultNavigation/utils.cjs +0 -34
- package/dist/cjs/StepNavigation/SimpleNavigation/Dot/Dot.cjs +0 -43
- package/dist/cjs/StepNavigation/SimpleNavigation/Dot/Dot.styles.cjs +0 -18
- package/dist/cjs/StepNavigation/SimpleNavigation/SimpleNavigation.cjs +0 -52
- package/dist/cjs/StepNavigation/SimpleNavigation/utils.cjs +0 -13
- package/dist/cjs/StepNavigation/StepNavigation.cjs +0 -188
- package/dist/cjs/StepNavigation/StepNavigation.styles.cjs +0 -34
- package/dist/cjs/StepNavigation/utils.cjs +0 -8
- package/dist/cjs/Wizard/Wizard.cjs +0 -108
- package/dist/cjs/Wizard/Wizard.styles.cjs +0 -8
- package/dist/cjs/Wizard/WizardActions/WizardActions.cjs +0 -132
- package/dist/cjs/Wizard/WizardActions/WizardActions.styles.cjs +0 -22
- package/dist/cjs/Wizard/WizardContainer/WizardContainer.cjs +0 -31
- package/dist/cjs/Wizard/WizardContainer/WizardContainer.styles.cjs +0 -15
- package/dist/cjs/Wizard/WizardContent/WizardContent.cjs +0 -121
- package/dist/cjs/Wizard/WizardContent/WizardContent.styles.cjs +0 -38
- package/dist/cjs/Wizard/WizardContext/WizardContext.cjs +0 -15
- package/dist/cjs/Wizard/WizardTitle/WizardTitle.cjs +0 -97
- package/dist/cjs/Wizard/WizardTitle/WizardTitle.styles.cjs +0 -27
- package/dist/cjs/index.cjs +0 -93
- package/dist/esm/Flow/base.js +0 -411
- package/dist/esm/Flow/nodes/DashboardNode.js +0 -89
- package/dist/esm/Flow/nodes/DashboardNode.styles.js +0 -16
- package/dist/esm/Flow/nodes/StickyNode.js +0 -439
- /package/dist/{esm/Blade → Blade}/Blade.js +0 -0
- /package/dist/{esm/Blade → Blade}/Blade.styles.js +0 -0
- /package/dist/{esm/Blades → Blades}/Blades.js +0 -0
- /package/dist/{esm/Blades → Blades}/Blades.styles.js +0 -0
- /package/dist/{esm/Dashboard → Dashboard}/Dashboard.js +0 -0
- /package/dist/{esm/Dashboard → Dashboard}/Dashboard.styles.js +0 -0
- /package/dist/{esm/Flow → Flow}/FlowContext/FlowContext.js +0 -0
- /package/dist/{esm/Flow → Flow}/FlowContext/NodeMetaContext.js +0 -0
- /package/dist/{esm/Flow → Flow}/Minimap/Minimap.styles.js +0 -0
- /package/dist/{esm/Flow → Flow}/Node/BaseNode.styles.js +0 -0
- /package/dist/{esm/Flow → Flow}/Node/Node.styles.js +0 -0
- /package/dist/{esm/Flow → Flow}/Node/Parameters/ParamRenderer.js +0 -0
- /package/dist/{esm/Flow → Flow}/Node/Parameters/Select.js +0 -0
- /package/dist/{esm/Flow → Flow}/Node/Parameters/Slider.js +0 -0
- /package/dist/{esm/Flow → Flow}/Node/Parameters/Text.js +0 -0
- /package/dist/{esm/Flow → Flow}/Node/utils.js +0 -0
- /package/dist/{esm/Flow → Flow}/Sidebar/Sidebar.styles.js +0 -0
- /package/dist/{esm/Flow → Flow}/Sidebar/SidebarGroup/SidebarGroup.js +0 -0
- /package/dist/{esm/Flow → Flow}/Sidebar/SidebarGroup/SidebarGroup.styles.js +0 -0
- /package/dist/{esm/Flow → Flow}/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.js +0 -0
- /package/dist/{esm/Flow → Flow}/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.js +0 -0
- /package/dist/{esm/Flow → Flow}/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.styles.js +0 -0
- /package/dist/{esm/Flow → Flow}/hooks/useFlowContext.js +0 -0
- /package/dist/{esm/Flow → Flow}/hooks/useFlowNodeMeta.js +0 -0
- /package/dist/{esm/Flow → Flow}/hooks/useNode.js +0 -0
- /package/dist/{esm/StepNavigation → StepNavigation}/DefaultNavigation/Step/Step.js +0 -0
- /package/dist/{esm/StepNavigation → StepNavigation}/DefaultNavigation/Step/Step.styles.js +0 -0
- /package/dist/{esm/StepNavigation → StepNavigation}/DefaultNavigation/utils.js +0 -0
- /package/dist/{esm/StepNavigation → StepNavigation}/SimpleNavigation/Dot/Dot.js +0 -0
- /package/dist/{esm/StepNavigation → StepNavigation}/SimpleNavigation/Dot/Dot.styles.js +0 -0
- /package/dist/{esm/StepNavigation → StepNavigation}/SimpleNavigation/utils.js +0 -0
- /package/dist/{esm/StepNavigation → StepNavigation}/StepNavigation.styles.js +0 -0
- /package/dist/{esm/StepNavigation → StepNavigation}/utils.js +0 -0
- /package/dist/{esm/Wizard → Wizard}/Wizard.js +0 -0
- /package/dist/{esm/Wizard → Wizard}/Wizard.styles.js +0 -0
- /package/dist/{esm/Wizard → Wizard}/WizardActions/WizardActions.js +0 -0
- /package/dist/{esm/Wizard → Wizard}/WizardActions/WizardActions.styles.js +0 -0
- /package/dist/{esm/Wizard → Wizard}/WizardContainer/WizardContainer.js +0 -0
- /package/dist/{esm/Wizard → Wizard}/WizardContainer/WizardContainer.styles.js +0 -0
- /package/dist/{esm/Wizard → Wizard}/WizardContent/WizardContent.js +0 -0
- /package/dist/{esm/Wizard → Wizard}/WizardContent/WizardContent.styles.js +0 -0
- /package/dist/{esm/Wizard → Wizard}/WizardContext/WizardContext.js +0 -0
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
4
|
-
const { staticClasses, useClasses } = uikitReactCore.createClasses("HvDot", {
|
|
5
|
-
root: {
|
|
6
|
-
borderRadius: uikitReactCore.theme.radii.full,
|
|
7
|
-
zIndex: 1,
|
|
8
|
-
width: "var(--dotSize)",
|
|
9
|
-
height: "var(--dotSize)",
|
|
10
|
-
"&,:hover,:disabled": {
|
|
11
|
-
backgroundColor: "var(--dotColor)"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
active: {},
|
|
15
|
-
ghostDisabled: {}
|
|
16
|
-
});
|
|
17
|
-
exports.staticClasses = staticClasses;
|
|
18
|
-
exports.useClasses = useClasses;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
5
|
-
const utils = require("./utils.cjs");
|
|
6
|
-
const Dot = require("./Dot/Dot.cjs");
|
|
7
|
-
const HvSimpleNavigation = ({
|
|
8
|
-
numSteps,
|
|
9
|
-
stepSize = "sm",
|
|
10
|
-
getTitles,
|
|
11
|
-
getDynamicValues,
|
|
12
|
-
children,
|
|
13
|
-
...others
|
|
14
|
-
}) => {
|
|
15
|
-
const { activeTheme } = uikitReactCore.useTheme();
|
|
16
|
-
const dotSize = utils.dotSizes[stepSize];
|
|
17
|
-
const StepComponent = Dot.HvDot;
|
|
18
|
-
const stepsWidth = (numSteps + 0.5) * dotSize;
|
|
19
|
-
const { width, titleWidth, separatorWidth } = getDynamicValues(stepsWidth);
|
|
20
|
-
const maxWidth = Math.max(titleWidth - dotSize, separatorWidth);
|
|
21
|
-
const minWidth = Math.max(titleWidth - dotSize * 1.25, separatorWidth);
|
|
22
|
-
const Steps = children;
|
|
23
|
-
const titles = getTitles(({ rawTitle, number }) => ({
|
|
24
|
-
variant: "label",
|
|
25
|
-
title: `${number}. ${rawTitle}`,
|
|
26
|
-
titleWidth
|
|
27
|
-
}));
|
|
28
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...others, children: [
|
|
29
|
-
titles,
|
|
30
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31
|
-
Steps,
|
|
32
|
-
{
|
|
33
|
-
...{
|
|
34
|
-
stepsWidth,
|
|
35
|
-
navWidth: width,
|
|
36
|
-
separatorValues: {
|
|
37
|
-
minWidth,
|
|
38
|
-
maxWidth,
|
|
39
|
-
getColor: utils.getColor,
|
|
40
|
-
height: activeTheme?.stepNavigation.simpleSeparatorHeight || 0
|
|
41
|
-
},
|
|
42
|
-
stepValues: {
|
|
43
|
-
minSize: dotSize,
|
|
44
|
-
maxSize: 1.5 * dotSize,
|
|
45
|
-
StepComponent
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
] });
|
|
51
|
-
};
|
|
52
|
-
exports.HvSimpleNavigation = HvSimpleNavigation;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
4
|
-
const dotSizes = {
|
|
5
|
-
xs: 8,
|
|
6
|
-
sm: 10,
|
|
7
|
-
md: 12,
|
|
8
|
-
lg: 14,
|
|
9
|
-
xl: 16
|
|
10
|
-
};
|
|
11
|
-
const getColor = (state) => state === "Disabled" ? uikitStyles.theme.colors.textDisabled : uikitStyles.theme.colors.text;
|
|
12
|
-
exports.dotSizes = dotSizes;
|
|
13
|
-
exports.getColor = getColor;
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const styled = require("@emotion/styled");
|
|
5
|
-
const uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
6
|
-
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
7
|
-
const StepNavigation_styles = require("./StepNavigation.styles.cjs");
|
|
8
|
-
const utils = require("./utils.cjs");
|
|
9
|
-
const SimpleNavigation = require("./SimpleNavigation/SimpleNavigation.cjs");
|
|
10
|
-
const DefaultNavigation = require("./DefaultNavigation/DefaultNavigation.cjs");
|
|
11
|
-
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
12
|
-
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
13
|
-
const HvStepNavigation = ({
|
|
14
|
-
className,
|
|
15
|
-
classes: classesProp,
|
|
16
|
-
width,
|
|
17
|
-
steps,
|
|
18
|
-
stepSize,
|
|
19
|
-
showTitles,
|
|
20
|
-
type = "Default",
|
|
21
|
-
"aria-label": ariaLabel,
|
|
22
|
-
...others
|
|
23
|
-
}) => {
|
|
24
|
-
const { classes, css, cx } = StepNavigation_styles.useClasses(classesProp);
|
|
25
|
-
const { activeTheme } = uikitReactCore.useTheme();
|
|
26
|
-
const breakpoint = uikitReactCore.useWidth();
|
|
27
|
-
const stepSizeKey = stepSize ?? (["xs", "sm"].includes(breakpoint) ? "sm" : "md");
|
|
28
|
-
const hasTitles = showTitles ?? !["xs", "sm"].includes(breakpoint);
|
|
29
|
-
const styledLi = (containerSize) => styled__default.default("li")({
|
|
30
|
-
width: containerSize,
|
|
31
|
-
height: containerSize
|
|
32
|
-
});
|
|
33
|
-
const styledDiv = (containerSize) => styled__default.default("div")({
|
|
34
|
-
width: containerSize,
|
|
35
|
-
height: containerSize
|
|
36
|
-
});
|
|
37
|
-
const styledSeparatorElement = (title, separatorClassName, separatorHeight, separatorWidth, backgroundColor) => {
|
|
38
|
-
const widthValue = separatorWidth - 2 * Number(
|
|
39
|
-
(activeTheme?.stepNavigation.separatorMargin || "0px").replace(
|
|
40
|
-
"px",
|
|
41
|
-
""
|
|
42
|
-
)
|
|
43
|
-
);
|
|
44
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
45
|
-
"li",
|
|
46
|
-
{
|
|
47
|
-
"aria-hidden": true,
|
|
48
|
-
className: cx(
|
|
49
|
-
css({
|
|
50
|
-
height: separatorHeight,
|
|
51
|
-
width: widthValue,
|
|
52
|
-
backgroundColor,
|
|
53
|
-
margin: `0 ${uikitStyles.theme.stepNavigation.separatorMargin}`
|
|
54
|
-
}),
|
|
55
|
-
classes.separator
|
|
56
|
-
),
|
|
57
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: separatorClassName })
|
|
58
|
-
},
|
|
59
|
-
`separator-${title}`
|
|
60
|
-
);
|
|
61
|
-
};
|
|
62
|
-
const drawItems = ({
|
|
63
|
-
separatorValues: { minWidth, maxWidth, getColor, height },
|
|
64
|
-
stepValues: { minSize, maxSize, StepComponent }
|
|
65
|
-
}) => {
|
|
66
|
-
const items = steps.reduce(
|
|
67
|
-
(acc, { state, title, separatorClassName, ...props }, index) => {
|
|
68
|
-
const containerSize = state === "Current" ? maxSize : minSize;
|
|
69
|
-
const StepContainer = styledLi(containerSize);
|
|
70
|
-
const Step = styledDiv(Math.max(containerSize, 30));
|
|
71
|
-
const stepProps = {
|
|
72
|
-
size: stepSizeKey,
|
|
73
|
-
state,
|
|
74
|
-
title,
|
|
75
|
-
number: index + 1,
|
|
76
|
-
...props
|
|
77
|
-
};
|
|
78
|
-
const stepElement = /* @__PURE__ */ jsxRuntime.jsx(StepContainer, { className: classes.li, children: hasTitles ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
79
|
-
StepComponent,
|
|
80
|
-
{
|
|
81
|
-
"aria-label": `${title}`,
|
|
82
|
-
...stepProps
|
|
83
|
-
},
|
|
84
|
-
`step-${title}`
|
|
85
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
-
uikitReactCore.HvTooltip,
|
|
87
|
-
{
|
|
88
|
-
placement: "bottom",
|
|
89
|
-
title: /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTypography, { children: `${index + 1}. ${title}` }),
|
|
90
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(Step, { className: classes.li, children: /* @__PURE__ */ jsxRuntime.jsx(StepComponent, { "aria-label": `${title}`, ...stepProps }) }) })
|
|
91
|
-
}
|
|
92
|
-
) }, `step-${title}`);
|
|
93
|
-
if (index < steps.length - 1) {
|
|
94
|
-
const separatorElement = styledSeparatorElement(
|
|
95
|
-
title,
|
|
96
|
-
separatorClassName,
|
|
97
|
-
height,
|
|
98
|
-
[steps[index + 1].state, state].includes("Current") ? minWidth : maxWidth,
|
|
99
|
-
getColor(
|
|
100
|
-
steps[index + 1].state === "Disabled" ? "Disabled" : state,
|
|
101
|
-
uikitStyles.theme
|
|
102
|
-
)
|
|
103
|
-
);
|
|
104
|
-
acc.push(stepElement, separatorElement);
|
|
105
|
-
return acc;
|
|
106
|
-
}
|
|
107
|
-
acc.push(stepElement);
|
|
108
|
-
return acc;
|
|
109
|
-
},
|
|
110
|
-
[]
|
|
111
|
-
);
|
|
112
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ol", { className: classes.ol, children: items });
|
|
113
|
-
};
|
|
114
|
-
const getDynamicValues = (stepsWidth) => {
|
|
115
|
-
const themeBreakpoints = activeTheme?.breakpoints.values || {};
|
|
116
|
-
const maxWidth = width?.[breakpoint] ?? Math.max(
|
|
117
|
-
Number(hasTitles) * (utils.TITLE_WIDTH + utils.TITLE_MARGIN) * steps.length - utils.TITLE_MARGIN,
|
|
118
|
-
utils.SEPARATOR_WIDTH * (steps.length - 1) + stepsWidth
|
|
119
|
-
);
|
|
120
|
-
const next = Object.keys(themeBreakpoints).find(
|
|
121
|
-
(_, index, self) => index - 1 >= 0 ? self[index - 1] === breakpoint : false
|
|
122
|
-
);
|
|
123
|
-
const navWidth = Math.min(
|
|
124
|
-
maxWidth,
|
|
125
|
-
next ? themeBreakpoints[next] : maxWidth
|
|
126
|
-
);
|
|
127
|
-
const titleWidth = Number(hasTitles) * Math.ceil((navWidth + utils.TITLE_MARGIN) / steps.length);
|
|
128
|
-
const separatorWidth = Number(!hasTitles) * Math.ceil((navWidth - stepsWidth) / (steps.length - 1));
|
|
129
|
-
return { width: navWidth, titleWidth, separatorWidth };
|
|
130
|
-
};
|
|
131
|
-
const getTitles = (getTitleProps) => hasTitles ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.titles, children: steps.map(({ title: rawTitle, state, titleClassName }, index) => {
|
|
132
|
-
const {
|
|
133
|
-
variant = "label",
|
|
134
|
-
title = rawTitle,
|
|
135
|
-
titleWidth = 0,
|
|
136
|
-
titleDisabled = false
|
|
137
|
-
} = getTitleProps?.({
|
|
138
|
-
state,
|
|
139
|
-
rawTitle,
|
|
140
|
-
number: index + 1
|
|
141
|
-
}) ?? {};
|
|
142
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
143
|
-
uikitReactCore.HvTypography,
|
|
144
|
-
{
|
|
145
|
-
variant,
|
|
146
|
-
className: cx(
|
|
147
|
-
css({
|
|
148
|
-
textAlign: "center",
|
|
149
|
-
width: titleWidth - utils.TITLE_MARGIN,
|
|
150
|
-
marginRight: utils.TITLE_MARGIN
|
|
151
|
-
}),
|
|
152
|
-
titleClassName
|
|
153
|
-
),
|
|
154
|
-
disabled: titleDisabled,
|
|
155
|
-
children: title
|
|
156
|
-
},
|
|
157
|
-
title
|
|
158
|
-
);
|
|
159
|
-
}) }) : null;
|
|
160
|
-
const StepNavigation = {
|
|
161
|
-
Default: DefaultNavigation.HvDefaultNavigation,
|
|
162
|
-
Simple: SimpleNavigation.HvSimpleNavigation
|
|
163
|
-
}[type];
|
|
164
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
165
|
-
StepNavigation,
|
|
166
|
-
{
|
|
167
|
-
numSteps: steps.length,
|
|
168
|
-
stepSize: stepSizeKey,
|
|
169
|
-
getTitles,
|
|
170
|
-
getDynamicValues,
|
|
171
|
-
className: cx(classes.root, className),
|
|
172
|
-
...others,
|
|
173
|
-
children: ({ stepsWidth, navWidth, ...itemsProps }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
174
|
-
"nav",
|
|
175
|
-
{
|
|
176
|
-
style: {
|
|
177
|
-
width: `${navWidth}px`,
|
|
178
|
-
margin: 0
|
|
179
|
-
},
|
|
180
|
-
"aria-label": ariaLabel,
|
|
181
|
-
children: drawItems(itemsProps)
|
|
182
|
-
}
|
|
183
|
-
)
|
|
184
|
-
}
|
|
185
|
-
);
|
|
186
|
-
};
|
|
187
|
-
exports.stepNavigationClasses = StepNavigation_styles.staticClasses;
|
|
188
|
-
exports.HvStepNavigation = HvStepNavigation;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
4
|
-
const { staticClasses, useClasses } = uikitReactCore.createClasses("HvStepNavigation", {
|
|
5
|
-
root: {
|
|
6
|
-
display: "flex",
|
|
7
|
-
flexDirection: "column"
|
|
8
|
-
},
|
|
9
|
-
titles: {
|
|
10
|
-
marginTop: 8,
|
|
11
|
-
display: "flex"
|
|
12
|
-
},
|
|
13
|
-
ol: {
|
|
14
|
-
display: "flex",
|
|
15
|
-
alignItems: "center",
|
|
16
|
-
justifyContent: "center",
|
|
17
|
-
flexWrap: "wrap",
|
|
18
|
-
padding: 0,
|
|
19
|
-
listStyle: "none"
|
|
20
|
-
},
|
|
21
|
-
li: {
|
|
22
|
-
display: "flex",
|
|
23
|
-
alignItems: "center",
|
|
24
|
-
justifyContent: "center"
|
|
25
|
-
},
|
|
26
|
-
separator: {
|
|
27
|
-
userSelect: "none",
|
|
28
|
-
"& > div": {
|
|
29
|
-
display: "flex"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
exports.staticClasses = staticClasses;
|
|
34
|
-
exports.useClasses = useClasses;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const TITLE_MARGIN = 20;
|
|
4
|
-
const TITLE_WIDTH = 215;
|
|
5
|
-
const SEPARATOR_WIDTH = 100;
|
|
6
|
-
exports.SEPARATOR_WIDTH = SEPARATOR_WIDTH;
|
|
7
|
-
exports.TITLE_MARGIN = TITLE_MARGIN;
|
|
8
|
-
exports.TITLE_WIDTH = TITLE_WIDTH;
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const react = require("react");
|
|
5
|
-
const Wizard_styles = require("./Wizard.styles.cjs");
|
|
6
|
-
const WizardContext = require("./WizardContext/WizardContext.cjs");
|
|
7
|
-
const WizardContainer = require("./WizardContainer/WizardContainer.cjs");
|
|
8
|
-
const WizardTitle = require("./WizardTitle/WizardTitle.cjs");
|
|
9
|
-
const WizardContent = require("./WizardContent/WizardContent.cjs");
|
|
10
|
-
const WizardActions = require("./WizardActions/WizardActions.cjs");
|
|
11
|
-
const HvWizard = ({
|
|
12
|
-
className,
|
|
13
|
-
children,
|
|
14
|
-
onClose,
|
|
15
|
-
handleSubmit,
|
|
16
|
-
title,
|
|
17
|
-
open,
|
|
18
|
-
skippable = true,
|
|
19
|
-
loading = false,
|
|
20
|
-
hasSummary = false,
|
|
21
|
-
summaryContent,
|
|
22
|
-
labels = {
|
|
23
|
-
cancel: "Cancel",
|
|
24
|
-
next: "Next",
|
|
25
|
-
previous: "Previous",
|
|
26
|
-
skip: "Skip",
|
|
27
|
-
submit: "Submit",
|
|
28
|
-
summary: "Summary"
|
|
29
|
-
},
|
|
30
|
-
fixedHeight = false,
|
|
31
|
-
customStep,
|
|
32
|
-
classes: classesProp,
|
|
33
|
-
...others
|
|
34
|
-
}) => {
|
|
35
|
-
const { classes, cx } = Wizard_styles.useClasses(classesProp);
|
|
36
|
-
const [context, setContext] = react.useState({});
|
|
37
|
-
const [summary, setSummary] = react.useState(false);
|
|
38
|
-
const [tab, setTab] = react.useState(0);
|
|
39
|
-
const handleClose = react.useCallback(
|
|
40
|
-
(evt, reason) => {
|
|
41
|
-
if (reason !== "backdropClick") {
|
|
42
|
-
onClose?.(evt, reason);
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
[onClose]
|
|
46
|
-
);
|
|
47
|
-
react.useEffect(() => {
|
|
48
|
-
return () => {
|
|
49
|
-
if (!open) {
|
|
50
|
-
setContext(
|
|
51
|
-
(c) => Object.entries(c).reduce((acc, [key, child]) => {
|
|
52
|
-
acc[+key] = {
|
|
53
|
-
...child,
|
|
54
|
-
touched: false
|
|
55
|
-
};
|
|
56
|
-
return acc;
|
|
57
|
-
}, {})
|
|
58
|
-
);
|
|
59
|
-
setTab(0);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
}, [open]);
|
|
63
|
-
const value = react.useMemo(
|
|
64
|
-
() => ({ context, setContext, summary, setSummary, tab, setTab }),
|
|
65
|
-
[context, setContext, summary, setSummary, tab, setTab]
|
|
66
|
-
);
|
|
67
|
-
return /* @__PURE__ */ jsxRuntime.jsx(WizardContext.default.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
68
|
-
WizardContainer.HvWizardContainer,
|
|
69
|
-
{
|
|
70
|
-
className: cx(classes.root, className),
|
|
71
|
-
handleClose,
|
|
72
|
-
open,
|
|
73
|
-
...others,
|
|
74
|
-
children: [
|
|
75
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
76
|
-
WizardTitle.HvWizardTitle,
|
|
77
|
-
{
|
|
78
|
-
title,
|
|
79
|
-
hasSummary,
|
|
80
|
-
labels,
|
|
81
|
-
customStep
|
|
82
|
-
}
|
|
83
|
-
),
|
|
84
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
85
|
-
WizardContent.HvWizardContent,
|
|
86
|
-
{
|
|
87
|
-
loading,
|
|
88
|
-
fixedHeight,
|
|
89
|
-
summaryContent,
|
|
90
|
-
children
|
|
91
|
-
}
|
|
92
|
-
),
|
|
93
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
94
|
-
WizardActions.HvWizardActions,
|
|
95
|
-
{
|
|
96
|
-
loading,
|
|
97
|
-
skippable,
|
|
98
|
-
labels,
|
|
99
|
-
handleClose,
|
|
100
|
-
handleSubmit
|
|
101
|
-
}
|
|
102
|
-
)
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
) });
|
|
106
|
-
};
|
|
107
|
-
exports.wizardClasses = Wizard_styles.staticClasses;
|
|
108
|
-
exports.HvWizard = HvWizard;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
4
|
-
const { staticClasses, useClasses } = uikitReactCore.createClasses("HvWizard", {
|
|
5
|
-
root: {}
|
|
6
|
-
});
|
|
7
|
-
exports.staticClasses = staticClasses;
|
|
8
|
-
exports.useClasses = useClasses;
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const react = require("react");
|
|
5
|
-
const uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
6
|
-
const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
|
|
7
|
-
const WizardActions_styles = require("./WizardActions.styles.cjs");
|
|
8
|
-
const WizardContext = require("../WizardContext/WizardContext.cjs");
|
|
9
|
-
const HvWizardActions = ({
|
|
10
|
-
classes: classesProp,
|
|
11
|
-
handleClose,
|
|
12
|
-
handleSubmit,
|
|
13
|
-
loading = false,
|
|
14
|
-
skippable = false,
|
|
15
|
-
labels = {
|
|
16
|
-
cancel: "Cancel",
|
|
17
|
-
next: "Next",
|
|
18
|
-
previous: "Previous",
|
|
19
|
-
skip: "Skip",
|
|
20
|
-
submit: "Submit"
|
|
21
|
-
},
|
|
22
|
-
handleBeforeNext,
|
|
23
|
-
handleBeforePrevious
|
|
24
|
-
}) => {
|
|
25
|
-
const { classes, css, cx } = WizardActions_styles.useClasses(classesProp);
|
|
26
|
-
const { context, setContext, tab, setTab } = react.useContext(WizardContext.default);
|
|
27
|
-
const [pages, setPages] = react.useState(0);
|
|
28
|
-
const [canSubmit, setCanSubmit] = react.useState(false);
|
|
29
|
-
react.useEffect(() => {
|
|
30
|
-
const contextEntries = Object.entries(context);
|
|
31
|
-
if (contextEntries.length) {
|
|
32
|
-
setPages(contextEntries.length);
|
|
33
|
-
const validWizard = Object.entries(context).every(
|
|
34
|
-
([, value]) => value?.valid
|
|
35
|
-
);
|
|
36
|
-
if (validWizard !== canSubmit) {
|
|
37
|
-
setCanSubmit(validWizard);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}, [context, canSubmit, setCanSubmit, setPages]);
|
|
41
|
-
const lastPage = pages - 1;
|
|
42
|
-
const isLastPage = tab >= lastPage;
|
|
43
|
-
const handleSkip = react.useCallback(() => {
|
|
44
|
-
setContext(
|
|
45
|
-
(c) => Object.entries(c).reduce((acc, [key, child]) => {
|
|
46
|
-
acc[+key] = {
|
|
47
|
-
...child,
|
|
48
|
-
valid: child?.valid !== false
|
|
49
|
-
};
|
|
50
|
-
return acc;
|
|
51
|
-
}, {})
|
|
52
|
-
);
|
|
53
|
-
setTab(lastPage);
|
|
54
|
-
}, [setTab, lastPage, setContext]);
|
|
55
|
-
const handleSubmitInternal = react.useCallback(
|
|
56
|
-
() => handleSubmit(context),
|
|
57
|
-
[handleSubmit, context]
|
|
58
|
-
);
|
|
59
|
-
const nextDisabled = react.useMemo(() => {
|
|
60
|
-
if (loading) return true;
|
|
61
|
-
return !skippable && !context?.[tab]?.valid;
|
|
62
|
-
}, [context, loading, skippable, tab]);
|
|
63
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(uikitReactCore.HvDialogActions, { className: classes.actionsContainer, children: [
|
|
64
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
65
|
-
uikitReactCore.HvButton,
|
|
66
|
-
{
|
|
67
|
-
variant: "secondaryGhost",
|
|
68
|
-
onClick: handleClose,
|
|
69
|
-
className: classes.buttonWidth,
|
|
70
|
-
children: labels.cancel ?? "Cancel"
|
|
71
|
-
}
|
|
72
|
-
),
|
|
73
|
-
skippable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
74
|
-
uikitReactCore.HvButton,
|
|
75
|
-
{
|
|
76
|
-
variant: "secondaryGhost",
|
|
77
|
-
disabled: isLastPage,
|
|
78
|
-
className: classes.buttonWidth,
|
|
79
|
-
onClick: handleSkip,
|
|
80
|
-
children: labels.skip ?? "Skip"
|
|
81
|
-
}
|
|
82
|
-
),
|
|
83
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { "aria-hidden": true, className: css({ flex: 1 }), children: " " }),
|
|
84
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.buttonsContainer, children: [
|
|
85
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
-
uikitReactCore.HvButton,
|
|
87
|
-
{
|
|
88
|
-
variant: "secondaryGhost",
|
|
89
|
-
className: classes.buttonWidth,
|
|
90
|
-
disabled: tab <= 0,
|
|
91
|
-
onClick: () => {
|
|
92
|
-
if (handleBeforePrevious) {
|
|
93
|
-
handleBeforePrevious();
|
|
94
|
-
} else {
|
|
95
|
-
setTab((t) => t - 1);
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
startIcon: /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.Backwards, {}),
|
|
99
|
-
children: labels.previous ?? "Previous"
|
|
100
|
-
}
|
|
101
|
-
),
|
|
102
|
-
isLastPage ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
103
|
-
uikitReactCore.HvButton,
|
|
104
|
-
{
|
|
105
|
-
variant: "primary",
|
|
106
|
-
className: classes.buttonWidth,
|
|
107
|
-
disabled: loading || !canSubmit,
|
|
108
|
-
onClick: handleSubmitInternal,
|
|
109
|
-
children: labels.submit ?? "Submit"
|
|
110
|
-
}
|
|
111
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
112
|
-
uikitReactCore.HvButton,
|
|
113
|
-
{
|
|
114
|
-
variant: "secondaryGhost",
|
|
115
|
-
className: cx(classes.buttonWidth, classes.buttonSpacing),
|
|
116
|
-
onClick: () => {
|
|
117
|
-
if (handleBeforeNext) {
|
|
118
|
-
handleBeforeNext();
|
|
119
|
-
} else {
|
|
120
|
-
setTab((t) => t + 1);
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
disabled: nextDisabled,
|
|
124
|
-
endIcon: /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.Forwards, {}),
|
|
125
|
-
children: labels.next ?? "Next"
|
|
126
|
-
}
|
|
127
|
-
)
|
|
128
|
-
] })
|
|
129
|
-
] });
|
|
130
|
-
};
|
|
131
|
-
exports.wizardActionsClasses = WizardActions_styles.staticClasses;
|
|
132
|
-
exports.HvWizardActions = HvWizardActions;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
4
|
-
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
|
-
const { staticClasses, useClasses } = uikitReactCore.createClasses("HvWizardActions", {
|
|
6
|
-
actionsContainer: {},
|
|
7
|
-
buttonWidth: {
|
|
8
|
-
width: 120,
|
|
9
|
-
"& span": {
|
|
10
|
-
whiteSpace: "normal",
|
|
11
|
-
lineHeight: uikitStyles.theme.lineHeights.sm
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
buttonsContainer: {
|
|
15
|
-
display: "flex",
|
|
16
|
-
alignItems: "center",
|
|
17
|
-
gap: uikitStyles.theme.space.xs
|
|
18
|
-
},
|
|
19
|
-
buttonSpacing: {}
|
|
20
|
-
});
|
|
21
|
-
exports.staticClasses = staticClasses;
|
|
22
|
-
exports.useClasses = useClasses;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
5
|
-
const WizardContainer_styles = require("./WizardContainer.styles.cjs");
|
|
6
|
-
const HvWizardContainer = (props) => {
|
|
7
|
-
const {
|
|
8
|
-
classes: classesProp,
|
|
9
|
-
children,
|
|
10
|
-
handleClose,
|
|
11
|
-
...others
|
|
12
|
-
} = uikitReactCore.useDefaultProps("HvWizardContainer", props);
|
|
13
|
-
const { classes } = WizardContainer_styles.useClasses(classesProp);
|
|
14
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15
|
-
uikitReactCore.HvDialog,
|
|
16
|
-
{
|
|
17
|
-
classes: {
|
|
18
|
-
root: classes.root,
|
|
19
|
-
closeButton: classes.closeButton,
|
|
20
|
-
paper: classes.paper
|
|
21
|
-
},
|
|
22
|
-
onClose: handleClose,
|
|
23
|
-
fullWidth: true,
|
|
24
|
-
maxWidth: "lg",
|
|
25
|
-
...others,
|
|
26
|
-
children
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
exports.wizardContainerClasses = WizardContainer_styles.staticClasses;
|
|
31
|
-
exports.HvWizardContainer = HvWizardContainer;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
4
|
-
const { staticClasses, useClasses } = uikitReactCore.createClasses(
|
|
5
|
-
"HvWizardContainer",
|
|
6
|
-
{
|
|
7
|
-
root: {},
|
|
8
|
-
paper: {},
|
|
9
|
-
closeButton: {
|
|
10
|
-
display: "none"
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
);
|
|
14
|
-
exports.staticClasses = staticClasses;
|
|
15
|
-
exports.useClasses = useClasses;
|