Debian Codegraph @

node/@patternfly/react-core/dist/js/components/Wizard/WizardFooter.js

raw
1 "use strict";
2 Object.defineProperty(exports, "__esModule", { value: true });
3 exports.WizardFooter = exports.WizardFooterWrapper = void 0;
4 const tslib_1 = require("tslib");
5 const jsx_runtime_1 = require("react/jsx-runtime");
6 const react_styles_1 = require("@patternfly/react-styles");
7 const wizard_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Wizard/wizard"));
8 const Button_1 = require("../Button");
9 const types_1 = require("./types");
10 const ActionList_1 = require("../ActionList");
11 const WizardFooterWrapper = (_a) => {
12 var { children, className } = _a, props = tslib_1.__rest(_a, ["children", "className"]);
13 return ((0, jsx_runtime_1.jsx)("footer", Object.assign({ className: (0, react_styles_1.css)(wizard_1.default.wizardFooter, className) }, props, { children: children })));
14 };
15 exports.WizardFooterWrapper = WizardFooterWrapper;
16 const WizardFooter = (_a) => {
17 var { activeStep } = _a, internalProps = tslib_1.__rest(_a, ["activeStep"]);
18 const activeStepFooter = !(0, types_1.isCustomWizardFooter)(activeStep === null || activeStep === void 0 ? void 0 : activeStep.footer) && (activeStep === null || activeStep === void 0 ? void 0 : activeStep.footer);
19 return (0, jsx_runtime_1.jsx)(InternalWizardFooter, Object.assign({}, internalProps, activeStepFooter));
20 };
21 exports.WizardFooter = WizardFooter;
22 const InternalWizardFooter = (_a) => {
23 var { onNext, onBack, onClose, isNextDisabled, isBackDisabled, isBackHidden, isCancelHidden, nextButtonText = 'Next', backButtonText = 'Back', cancelButtonText = 'Cancel', nextButtonProps, backButtonProps, cancelButtonProps, className } = _a, props = tslib_1.__rest(_a, ["onNext", "onBack", "onClose", "isNextDisabled", "isBackDisabled", "isBackHidden", "isCancelHidden", "nextButtonText", "backButtonText", "cancelButtonText", "nextButtonProps", "backButtonProps", "cancelButtonProps", "className"]);
24 return ((0, jsx_runtime_1.jsx)(exports.WizardFooterWrapper, Object.assign({ className: className }, props, { children: (0, jsx_runtime_1.jsxs)(ActionList_1.ActionList, { children: [(0, jsx_runtime_1.jsxs)(ActionList_1.ActionListGroup, { children: [!isBackHidden && ((0, jsx_runtime_1.jsx)(ActionList_1.ActionListItem, { children: (0, jsx_runtime_1.jsx)(Button_1.Button, Object.assign({ variant: Button_1.ButtonVariant.secondary, onClick: onBack, isDisabled: isBackDisabled }, backButtonProps, { children: backButtonText })) })), (0, jsx_runtime_1.jsx)(ActionList_1.ActionListItem, { children: (0, jsx_runtime_1.jsx)(Button_1.Button, Object.assign({ variant: Button_1.ButtonVariant.primary, type: "submit", onClick: onNext, isDisabled: isNextDisabled }, nextButtonProps, { children: nextButtonText })) })] }), !isCancelHidden && ((0, jsx_runtime_1.jsx)(ActionList_1.ActionListGroup, { children: (0, jsx_runtime_1.jsx)(ActionList_1.ActionListItem, { children: (0, jsx_runtime_1.jsx)(Button_1.Button, Object.assign({ variant: Button_1.ButtonVariant.link, onClick: onClose }, cancelButtonProps, { children: cancelButtonText })) }) }))] }) })));
25 };
26 exports.WizardFooterWrapper.displayName = 'WizardFooterWrapper';
27 exports.WizardFooter.displayName = 'WizardFooter';
28 //# sourceMappingURL=WizardFooter.js.map