@patternfly/react-core 4.249.0 → 4.250.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 +17 -0
- package/dist/esm/next/components/Select/Select.d.ts +28 -0
- package/dist/esm/next/components/Select/Select.d.ts.map +1 -0
- package/dist/esm/next/components/Select/Select.js +62 -0
- package/dist/esm/next/components/Select/Select.js.map +1 -0
- package/dist/esm/next/components/Select/SelectGroup.d.ts +12 -0
- package/dist/esm/next/components/Select/SelectGroup.d.ts.map +1 -0
- package/dist/esm/next/components/Select/SelectGroup.js +10 -0
- package/dist/esm/next/components/Select/SelectGroup.js.map +1 -0
- package/dist/esm/next/components/Select/SelectList.d.ts +10 -0
- package/dist/esm/next/components/Select/SelectList.d.ts.map +1 -0
- package/dist/esm/next/components/Select/SelectList.js +10 -0
- package/dist/esm/next/components/Select/SelectList.js.map +1 -0
- package/dist/esm/next/components/Select/SelectOption.d.ts +20 -0
- package/dist/esm/next/components/Select/SelectOption.d.ts.map +1 -0
- package/dist/esm/next/components/Select/SelectOption.js +10 -0
- package/dist/esm/next/components/Select/SelectOption.js.map +1 -0
- package/dist/esm/next/components/Select/index.d.ts +5 -0
- package/dist/esm/next/components/Select/index.d.ts.map +1 -0
- package/dist/esm/next/components/Select/index.js +5 -0
- package/dist/esm/next/components/Select/index.js.map +1 -0
- package/dist/esm/next/components/Wizard/Wizard.d.ts +9 -7
- package/dist/esm/next/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/Wizard.js +62 -48
- package/dist/esm/next/components/Wizard/Wizard.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardBody.d.ts +2 -2
- package/dist/esm/next/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardBody.js +1 -1
- package/dist/esm/next/components/Wizard/WizardBody.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardContext.d.ts +21 -20
- package/dist/esm/next/components/Wizard/WizardContext.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardContext.js +63 -32
- package/dist/esm/next/components/Wizard/WizardContext.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts +20 -6
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardFooter.js +13 -4
- package/dist/esm/next/components/Wizard/WizardFooter.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardHeader.d.ts +1 -1
- package/dist/esm/next/components/Wizard/WizardHeader.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardHeader.js +2 -2
- package/dist/esm/next/components/Wizard/WizardHeader.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNav.d.ts +5 -5
- package/dist/esm/next/components/Wizard/WizardNav.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNav.js +3 -4
- package/dist/esm/next/components/Wizard/WizardNav.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNavInternal.d.ts +14 -0
- package/dist/esm/next/components/Wizard/WizardNavInternal.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNavInternal.js +49 -0
- package/dist/esm/next/components/Wizard/WizardNavInternal.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNavItem.d.ts +12 -8
- package/dist/esm/next/components/Wizard/WizardNavItem.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNavItem.js +23 -12
- package/dist/esm/next/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardStep.d.ts +22 -6
- package/dist/esm/next/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardStep.js +20 -1
- package/dist/esm/next/components/Wizard/WizardStep.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts +9 -15
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardToggle.js +15 -50
- package/dist/esm/next/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.d.ts +2 -2
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.js +3 -3
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.js.map +1 -1
- package/dist/esm/next/components/Wizard/types.d.ts +37 -46
- package/dist/esm/next/components/Wizard/types.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/types.js +10 -2
- package/dist/esm/next/components/Wizard/types.js.map +1 -1
- package/dist/esm/next/components/Wizard/utils.d.ts +4 -5
- package/dist/esm/next/components/Wizard/utils.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/utils.js +20 -13
- package/dist/esm/next/components/Wizard/utils.js.map +1 -1
- package/dist/esm/next/components/index.d.ts +2 -1
- package/dist/esm/next/components/index.d.ts.map +1 -1
- package/dist/esm/next/components/index.js +2 -1
- package/dist/esm/next/components/index.js.map +1 -1
- package/dist/js/next/components/Select/Select.d.ts +28 -0
- package/dist/js/next/components/Select/Select.d.ts.map +1 -0
- package/dist/js/next/components/Select/Select.js +65 -0
- package/dist/js/next/components/Select/Select.js.map +1 -0
- package/dist/js/next/components/Select/SelectGroup.d.ts +12 -0
- package/dist/js/next/components/Select/SelectGroup.d.ts.map +1 -0
- package/dist/js/next/components/Select/SelectGroup.js +14 -0
- package/dist/js/next/components/Select/SelectGroup.js.map +1 -0
- package/dist/js/next/components/Select/SelectList.d.ts +10 -0
- package/dist/js/next/components/Select/SelectList.d.ts.map +1 -0
- package/dist/js/next/components/Select/SelectList.js +14 -0
- package/dist/js/next/components/Select/SelectList.js.map +1 -0
- package/dist/js/next/components/Select/SelectOption.d.ts +20 -0
- package/dist/js/next/components/Select/SelectOption.d.ts.map +1 -0
- package/dist/js/next/components/Select/SelectOption.js +14 -0
- package/dist/js/next/components/Select/SelectOption.js.map +1 -0
- package/dist/js/next/components/Select/index.d.ts +5 -0
- package/dist/js/next/components/Select/index.d.ts.map +1 -0
- package/dist/js/next/components/Select/index.js +8 -0
- package/dist/js/next/components/Select/index.js.map +1 -0
- package/dist/js/next/components/Wizard/Wizard.d.ts +9 -7
- package/dist/js/next/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/Wizard.js +59 -45
- package/dist/js/next/components/Wizard/Wizard.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardBody.d.ts +2 -2
- package/dist/js/next/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardBody.js +1 -1
- package/dist/js/next/components/Wizard/WizardBody.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardContext.d.ts +21 -20
- package/dist/js/next/components/Wizard/WizardContext.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardContext.js +61 -30
- package/dist/js/next/components/Wizard/WizardContext.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardFooter.d.ts +20 -6
- package/dist/js/next/components/Wizard/WizardFooter.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardFooter.js +15 -6
- package/dist/js/next/components/Wizard/WizardFooter.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardHeader.d.ts +1 -1
- package/dist/js/next/components/Wizard/WizardHeader.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardHeader.js +2 -2
- package/dist/js/next/components/Wizard/WizardHeader.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardNav.d.ts +5 -5
- package/dist/js/next/components/Wizard/WizardNav.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardNav.js +3 -4
- package/dist/js/next/components/Wizard/WizardNav.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardNavInternal.d.ts +14 -0
- package/dist/js/next/components/Wizard/WizardNavInternal.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardNavInternal.js +54 -0
- package/dist/js/next/components/Wizard/WizardNavInternal.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardNavItem.d.ts +12 -8
- package/dist/js/next/components/Wizard/WizardNavItem.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardNavItem.js +23 -12
- package/dist/js/next/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardStep.d.ts +22 -6
- package/dist/js/next/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardStep.js +20 -1
- package/dist/js/next/components/Wizard/WizardStep.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardToggle.d.ts +9 -15
- package/dist/js/next/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardToggle.js +15 -51
- package/dist/js/next/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.d.ts +2 -2
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.js +3 -3
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.js.map +1 -1
- package/dist/js/next/components/Wizard/types.d.ts +37 -46
- package/dist/js/next/components/Wizard/types.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/types.js +12 -3
- package/dist/js/next/components/Wizard/types.js.map +1 -1
- package/dist/js/next/components/Wizard/utils.d.ts +4 -5
- package/dist/js/next/components/Wizard/utils.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/utils.js +24 -15
- package/dist/js/next/components/Wizard/utils.js.map +1 -1
- package/dist/js/next/components/index.d.ts +2 -1
- package/dist/js/next/components/index.d.ts.map +1 -1
- package/dist/js/next/components/index.js +2 -1
- package/dist/js/next/components/index.js.map +1 -1
- package/dist/umd/react-core.min.css +940 -940
- package/package.json +2 -2
- package/src/next/components/Select/Select.tsx +129 -0
- package/src/next/components/Select/SelectGroup.tsx +24 -0
- package/src/next/components/Select/SelectList.tsx +21 -0
- package/src/next/components/Select/SelectOption.tsx +31 -0
- package/src/next/components/Select/examples/Select.md +37 -0
- package/src/next/components/Select/examples/SelectBasic.tsx +54 -0
- package/src/next/components/Select/examples/SelectCheckbox.tsx +67 -0
- package/src/next/components/Select/examples/SelectGrouped.tsx +63 -0
- package/src/next/components/Select/examples/SelectMultiTypeahead.tsx +195 -0
- package/src/next/components/Select/examples/SelectTypeahead.tsx +191 -0
- package/src/next/components/Select/index.ts +4 -0
- package/src/next/components/Wizard/Wizard.tsx +107 -64
- package/src/next/components/Wizard/WizardBody.tsx +4 -4
- package/src/next/components/Wizard/WizardContext.tsx +117 -65
- package/src/next/components/Wizard/WizardFooter.tsx +39 -17
- package/src/next/components/Wizard/WizardHeader.tsx +6 -3
- package/src/next/components/Wizard/WizardNav.tsx +9 -10
- package/src/next/components/Wizard/WizardNavInternal.tsx +137 -0
- package/src/next/components/Wizard/WizardNavItem.tsx +47 -20
- package/src/next/components/Wizard/WizardStep.tsx +52 -7
- package/src/next/components/Wizard/WizardToggle.tsx +24 -142
- package/src/next/components/Wizard/__tests__/Wizard.test.tsx +10 -13
- package/src/next/components/Wizard/__tests__/WizardBody.test.tsx +3 -3
- package/src/next/components/Wizard/__tests__/WizardFooter.test.tsx +11 -14
- package/src/next/components/Wizard/__tests__/WizardStep.test.tsx +100 -0
- package/src/next/components/Wizard/__tests__/WizardToggle.test.tsx +4 -4
- package/src/next/components/Wizard/examples/Wizard.md +40 -15
- package/src/next/components/Wizard/examples/WizardBasic.tsx +2 -2
- package/src/next/components/Wizard/examples/WizardCustomNav.tsx +4 -4
- package/src/next/components/Wizard/examples/WizardKitchenSink.tsx +126 -60
- package/src/next/components/Wizard/hooks/__tests__/useWizardFooter.test.tsx +23 -34
- package/src/next/components/Wizard/hooks/useWizardFooter.tsx +5 -5
- package/src/next/components/Wizard/types.tsx +59 -53
- package/src/next/components/Wizard/utils.ts +25 -16
- package/src/next/components/index.ts +2 -1
|
@@ -3,48 +3,79 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useWizardContext = exports.WizardContextProvider = exports.WizardContext = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
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
6
|
const types_1 = require("./types");
|
|
9
7
|
const utils_1 = require("./utils");
|
|
10
8
|
const WizardFooter_1 = require("./WizardFooter");
|
|
11
9
|
exports.WizardContext = react_1.default.createContext({});
|
|
12
|
-
|
|
13
|
-
const WizardContextProvider = ({ steps: initialSteps, footer: initialFooter, currentStepIndex, children, onNext, onBack, onClose, goToStepById, goToStepByName, goToStepByIndex }) => {
|
|
10
|
+
const WizardContextProvider = ({ steps: initialSteps, footer: initialFooter, currentStepIndex, isStepVisitRequired, children, onNext, onBack, onClose, goToStepById, goToStepByName, goToStepByIndex }) => {
|
|
14
11
|
const [steps, setSteps] = react_1.default.useState(initialSteps);
|
|
15
|
-
const [
|
|
16
|
-
const
|
|
17
|
-
const
|
|
12
|
+
const [currentFooter, setCurrentFooter] = react_1.default.useState(typeof initialFooter !== 'function' ? initialFooter : undefined);
|
|
13
|
+
const currentStep = utils_1.getCurrentStep(steps, currentStepIndex);
|
|
14
|
+
const goToNextStep = react_1.default.useCallback(() => onNext(steps), [onNext, steps]);
|
|
15
|
+
const goToPrevStep = react_1.default.useCallback(() => onBack(steps), [onBack, steps]);
|
|
16
|
+
const footer = react_1.default.useMemo(() => {
|
|
18
17
|
var _a;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
const wizardFooter = currentFooter || initialFooter;
|
|
19
|
+
if (types_1.isCustomWizardFooter(wizardFooter)) {
|
|
20
|
+
const customFooter = wizardFooter;
|
|
21
|
+
return typeof customFooter === 'function'
|
|
22
|
+
? customFooter(currentStep, goToNextStep, goToPrevStep, onClose)
|
|
23
|
+
: customFooter;
|
|
24
|
+
}
|
|
25
|
+
return (react_1.default.createElement(WizardFooter_1.WizardFooter, Object.assign({ currentStep: currentStep, onNext: goToNextStep, onBack: goToPrevStep, onClose: onClose, isBackDisabled: (currentStep === null || currentStep === void 0 ? void 0 : currentStep.id) === ((_a = steps[0]) === null || _a === void 0 ? void 0 : _a.id) }, wizardFooter)));
|
|
26
|
+
}, [currentFooter, initialFooter, currentStep, goToNextStep, goToPrevStep, onClose, steps]);
|
|
27
|
+
const getStep = react_1.default.useCallback((stepId) => steps.find(step => step.id === stepId), [steps]);
|
|
28
|
+
const setStep = react_1.default.useCallback((step) => setSteps(prevSteps => prevSteps.map(prevStep => {
|
|
29
|
+
if (prevStep.id === step.id) {
|
|
30
|
+
return Object.assign(Object.assign({}, prevStep), step);
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
+
return prevStep;
|
|
33
|
+
})), []);
|
|
34
|
+
const toggleStep = react_1.default.useCallback((stepId, isHidden) => setSteps(prevSteps => {
|
|
35
|
+
let stepToHide;
|
|
36
|
+
return prevSteps.map(prevStep => {
|
|
37
|
+
if (prevStep.id === stepId) {
|
|
38
|
+
// Don't hide the currently active step or its parent (if a sub-step).
|
|
39
|
+
if (isHidden &&
|
|
40
|
+
(currentStep.id === prevStep.id ||
|
|
41
|
+
(types_1.isWizardParentStep(prevStep) && prevStep.subStepIds.includes(currentStep.id)))) {
|
|
42
|
+
// eslint-disable-next-line no-console
|
|
43
|
+
console.error('Wizard: Unable to hide the current step or its parent.');
|
|
44
|
+
return prevStep;
|
|
45
|
+
}
|
|
46
|
+
stepToHide = Object.assign(Object.assign({}, prevStep), { isHidden });
|
|
47
|
+
return stepToHide;
|
|
48
|
+
}
|
|
49
|
+
// When isStepVisitRequired is enabled, if the step was previously hidden and not visited yet,
|
|
50
|
+
// when it is shown, all steps beyond it should be disabled to ensure it is visited.
|
|
51
|
+
if (isStepVisitRequired &&
|
|
52
|
+
(stepToHide === null || stepToHide === void 0 ? void 0 : stepToHide.isHidden) === false &&
|
|
53
|
+
!(stepToHide === null || stepToHide === void 0 ? void 0 : stepToHide.isVisited) &&
|
|
54
|
+
prevSteps.indexOf(stepToHide) < prevSteps.indexOf(prevStep)) {
|
|
55
|
+
return Object.assign(Object.assign({}, prevStep), { isVisited: false });
|
|
56
|
+
}
|
|
57
|
+
return prevStep;
|
|
58
|
+
});
|
|
59
|
+
}), [currentStep.id, isStepVisitRequired]);
|
|
32
60
|
return (react_1.default.createElement(exports.WizardContext.Provider, { value: {
|
|
33
61
|
steps,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
onBack,
|
|
62
|
+
currentStep,
|
|
63
|
+
currentStepIndex,
|
|
64
|
+
footer,
|
|
38
65
|
onClose,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
setFooter
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
66
|
+
getStep,
|
|
67
|
+
setStep,
|
|
68
|
+
toggleStep,
|
|
69
|
+
setFooter: setCurrentFooter,
|
|
70
|
+
onNext: goToNextStep,
|
|
71
|
+
onBack: goToPrevStep,
|
|
72
|
+
goToStepById: react_1.default.useCallback(id => goToStepById(steps, id), [goToStepById, steps]),
|
|
73
|
+
goToStepByName: react_1.default.useCallback(name => goToStepByName(steps, name), [goToStepByName, steps]),
|
|
74
|
+
goToStepByIndex: react_1.default.useCallback(index => goToStepByIndex(steps, index), [goToStepByIndex, steps])
|
|
75
|
+
} }, children));
|
|
46
76
|
};
|
|
47
77
|
exports.WizardContextProvider = WizardContextProvider;
|
|
78
|
+
exports.WizardContextProvider.displayName = 'WizardContextProvider';
|
|
48
79
|
const useWizardContext = () => react_1.default.useContext(exports.WizardContext);
|
|
49
80
|
exports.useWizardContext = useWizardContext;
|
|
50
81
|
//# sourceMappingURL=WizardContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardContext.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardContext.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,
|
|
1
|
+
{"version":3,"file":"WizardContext.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardContext.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,mCAAwG;AACxG,mCAAyC;AACzC,iDAAiE;AAiCpD,QAAA,aAAa,GAAG,eAAK,CAAC,aAAa,CAAC,EAAwB,CAAC,CAAC;AAgBpE,MAAM,qBAAqB,GAAwD,CAAC,EACzF,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,aAAa,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,YAAY,EACZ,cAAc,EACd,eAAe,EAChB,EAAE,EAAE;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IACvD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,eAAK,CAAC,QAAQ,CACtD,OAAO,aAAa,KAAK,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAChE,CAAC;IACF,MAAM,WAAW,GAAG,sBAAc,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAE5D,MAAM,YAAY,GAAG,eAAK,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;IAC7E,MAAM,YAAY,GAAG,eAAK,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;IAE7E,MAAM,MAAM,GAAG,eAAK,CAAC,OAAO,CAAC,GAAG,EAAE;;QAChC,MAAM,YAAY,GAAG,aAA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ACP,UAAU;YACV,SAAS,EAAE,gBAAgB;YAC3B,MAAM,EAAE,YAAY;YACpB,MAAM,EAAE,YAAY;YACpB,YAAY,EAAE,eAAK,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;YACrF,cAAc,EAAE,eAAK,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;YAC/F,eAAe,EAAE,eAAK,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;SACrG,IAEA,QAAQ,CACc,CAC1B,CAAC;AACJ,CAAC,CAAC;AA1HW,QAAA,qBAAqB,yBA0HhC;AAEF,6BAAqB,CAAC,WAAW,GAAG,uBAAuB,CAAC;AAErD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,eAAK,CAAC,UAAU,CAAC,qBAAa,CAAC,CAAC;AAAzD,QAAA,gBAAgB,oBAAyC"}
|
|
@@ -4,25 +4,39 @@ import { WizardControlStep, WizardNavStepFunction } from './types';
|
|
|
4
4
|
* Hosts the standard structure of a footer with ties to the active step so that text for buttons can vary from step to step.
|
|
5
5
|
*/
|
|
6
6
|
export interface WizardFooterProps {
|
|
7
|
-
/** The
|
|
8
|
-
|
|
7
|
+
/** The current step */
|
|
8
|
+
currentStep: WizardControlStep;
|
|
9
9
|
/** Next button callback */
|
|
10
10
|
onNext: () => WizardNavStepFunction | void;
|
|
11
11
|
/** Back button callback */
|
|
12
12
|
onBack: () => WizardNavStepFunction | void;
|
|
13
13
|
/** Cancel link callback */
|
|
14
14
|
onClose: () => void;
|
|
15
|
-
/** Custom text for the Next button. The
|
|
15
|
+
/** Custom text for the Next button. The current step's nextButtonText takes precedence. */
|
|
16
16
|
nextButtonText?: React.ReactNode;
|
|
17
17
|
/** Custom text for the Back button */
|
|
18
18
|
backButtonText?: React.ReactNode;
|
|
19
19
|
/** Custom text for the Cancel link */
|
|
20
20
|
cancelButtonText?: React.ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
|
|
21
|
+
/** Flag to disable the next button */
|
|
22
|
+
isNextDisabled?: boolean;
|
|
23
|
+
/** Flag to disable the back button */
|
|
24
|
+
isBackDisabled?: boolean;
|
|
25
|
+
/** True to hide the Back button */
|
|
26
|
+
isBackHidden?: boolean;
|
|
27
|
+
/** True to hide the Cancel button */
|
|
28
|
+
isCancelHidden?: boolean;
|
|
23
29
|
}
|
|
30
|
+
interface WizardFooterWrapperProps {
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export declare const WizardFooterWrapper: {
|
|
34
|
+
({ children }: WizardFooterWrapperProps): JSX.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
24
37
|
export declare const WizardFooter: {
|
|
25
|
-
({
|
|
38
|
+
({ currentStep, ...internalProps }: WizardFooterProps): JSX.Element;
|
|
26
39
|
displayName: string;
|
|
27
40
|
};
|
|
41
|
+
export {};
|
|
28
42
|
//# sourceMappingURL=WizardFooter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardFooter.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,
|
|
1
|
+
{"version":3,"file":"WizardFooter.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAwB,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEzF;;GAEG;AAEH,MAAM,WAAW,iBAAiB;IAChC,uBAAuB;IACvB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,2BAA2B;IAC3B,MAAM,EAAE,MAAM,qBAAqB,GAAG,IAAI,CAAC;IAC3C,2BAA2B;IAC3B,MAAM,EAAE,MAAM,qBAAqB,GAAG,IAAI,CAAC;IAC3C,2BAA2B;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,2FAA2F;IAC3F,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,sCAAsC;IACtC,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,sCAAsC;IACtC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sCAAsC;IACtC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mCAAmC;IACnC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qCAAqC;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,UAAU,wBAAwB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,mBAAmB;mBAAkB,wBAAwB;;CAEzE,CAAC;AAEF,eAAO,MAAM,YAAY;wCAAuC,iBAAiB;;CAGhF,CAAC"}
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WizardFooter = void 0;
|
|
3
|
+
exports.WizardFooter = exports.WizardFooterWrapper = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const react_styles_1 = require("@patternfly/react-styles");
|
|
7
7
|
const wizard_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Wizard/wizard"));
|
|
8
8
|
const Button_1 = require("../../../components/Button");
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const types_1 = require("./types");
|
|
10
|
+
const WizardFooterWrapper = ({ children }) => (react_1.default.createElement("footer", { className: react_styles_1.css(wizard_1.default.wizardFooter) }, children));
|
|
11
|
+
exports.WizardFooterWrapper = WizardFooterWrapper;
|
|
12
|
+
const WizardFooter = (_a) => {
|
|
13
|
+
var { currentStep } = _a, internalProps = tslib_1.__rest(_a, ["currentStep"]);
|
|
14
|
+
const currentStepFooter = !types_1.isCustomWizardFooter(currentStep.footer) && currentStep.footer;
|
|
15
|
+
return react_1.default.createElement(InternalWizardFooter, Object.assign({}, internalProps, currentStepFooter));
|
|
16
|
+
};
|
|
14
17
|
exports.WizardFooter = WizardFooter;
|
|
18
|
+
const InternalWizardFooter = ({ onNext, onBack, onClose, isNextDisabled, isBackDisabled, isBackHidden, isCancelHidden, nextButtonText = 'Next', backButtonText = 'Back', cancelButtonText = 'Cancel' }) => (react_1.default.createElement(exports.WizardFooterWrapper, null,
|
|
19
|
+
react_1.default.createElement(Button_1.Button, { variant: Button_1.ButtonVariant.primary, type: "submit", onClick: onNext, isDisabled: isNextDisabled }, nextButtonText),
|
|
20
|
+
!isBackHidden && (react_1.default.createElement(Button_1.Button, { variant: Button_1.ButtonVariant.secondary, onClick: onBack, isDisabled: isBackDisabled }, backButtonText)),
|
|
21
|
+
!isCancelHidden && (react_1.default.createElement("div", { className: wizard_1.default.wizardFooterCancel },
|
|
22
|
+
react_1.default.createElement(Button_1.Button, { variant: Button_1.ButtonVariant.link, onClick: onClose }, cancelButtonText)))));
|
|
23
|
+
exports.WizardFooterWrapper.displayName = 'WizardFooterWrapper';
|
|
15
24
|
exports.WizardFooter.displayName = 'WizardFooter';
|
|
16
25
|
//# sourceMappingURL=WizardFooter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardFooter.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardFooter.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0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AAM,EAAE,UAAU,EAAE,cAAc,IAClF,cAAc,CACR,CACV;IAEA,CAAC,cAAc,IAAI,CAClB,uCAAK,SAAS,EAAE,gBAAM,CAAC,kBAAkB;QACvC,8BAAC,eAAM,IAAC,OAAO,EAAE,sBAAa,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,IAClD,gBAAgB,CACV,CACL,CACP,CACmB,CACvB,CAAC;AAEF,2BAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAC;AACxD,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -9,7 +9,7 @@ export interface WizardHeaderProps {
|
|
|
9
9
|
/** Component type of the description */
|
|
10
10
|
descriptionComponent?: 'div' | 'p';
|
|
11
11
|
/** Flag indicating whether the close button should be in the header */
|
|
12
|
-
|
|
12
|
+
isCloseHidden?: boolean;
|
|
13
13
|
/** Aria-label applied to the X (Close) button */
|
|
14
14
|
closeButtonAriaLabel?: string;
|
|
15
15
|
/** id for the title */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardHeader.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,wCAAwC;IACxC,oBAAoB,CAAC,EAAE,KAAK,GAAG,GAAG,CAAC;IACnC,uEAAuE;IACvE,
|
|
1
|
+
{"version":3,"file":"WizardHeader.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,wCAAwC;IACxC,oBAAoB,CAAC,EAAE,KAAK,GAAG,GAAG,CAAC;IACnC,uEAAuE;IACvE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iDAAiD;IACjD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6BAA6B;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CA2BnE,CAAC"}
|
|
@@ -8,8 +8,8 @@ const react_styles_1 = require("@patternfly/react-styles");
|
|
|
8
8
|
const Button_1 = require("../../../components/Button");
|
|
9
9
|
const Title_1 = require("../../../components/Title");
|
|
10
10
|
const times_icon_1 = tslib_1.__importDefault(require('@patternfly/react-icons/dist/js/icons/times-icon'));
|
|
11
|
-
const WizardHeader = ({ onClose = () => undefined, title, description,
|
|
12
|
-
!
|
|
11
|
+
const WizardHeader = ({ onClose = () => undefined, title, description, isCloseHidden, closeButtonAriaLabel, titleId, descriptionComponent: Component = 'p', descriptionId }) => (React.createElement("div", { className: react_styles_1.css(wizard_1.default.wizardHeader) },
|
|
12
|
+
!isCloseHidden && (React.createElement(Button_1.Button, { variant: "plain", className: react_styles_1.css(wizard_1.default.wizardClose), "aria-label": closeButtonAriaLabel, onClick: onClose },
|
|
13
13
|
React.createElement(times_icon_1.default, { "aria-hidden": "true" }))),
|
|
14
14
|
React.createElement(Title_1.Title, { headingLevel: "h2", size: "3xl", className: react_styles_1.css(wizard_1.default.wizardTitle), "aria-label": title, id: titleId }, title || React.createElement(React.Fragment, null, "\u00A0")),
|
|
15
15
|
description && (React.createElement(Component, { className: react_styles_1.css(wizard_1.default.wizardDescription), id: descriptionId }, description))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardHeader.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardHeader.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,2GAA2E;AAC3E,2DAA+C;AAC/C,uDAAoD;AACpD,qDAAkD;AAClD,0GAA0E;AAqBnE,MAAM,YAAY,GAA+C,CAAC,EACvE,OAAO,GAAG,GAAG,EAAE,CAAC,SAAS,EACzB,KAAK,EACL,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"WizardHeader.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardHeader.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,2GAA2E;AAC3E,2DAA+C;AAC/C,uDAAoD;AACpD,qDAAkD;AAClD,0GAA0E;AAqBnE,MAAM,YAAY,GAA+C,CAAC,EACvE,OAAO,GAAG,GAAG,EAAE,CAAC,SAAS,EACzB,KAAK,EACL,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,OAAO,EACP,oBAAoB,EAAE,SAAS,GAAG,GAAG,EACrC,aAAa,EACK,EAAE,EAAE,CAAC,CACvB,6BAAK,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,YAAY,CAAC;IACrC,CAAC,aAAa,IAAI,CACjB,oBAAC,eAAM,IAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,WAAW,CAAC,gBAAc,oBAAoB,EAAE,OAAO,EAAE,OAAO;QAC5G,oBAAC,oBAAS,mBAAa,MAAM,GAAG,CACzB,CACV;IAED,oBAAC,aAAK,IAAC,YAAY,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,WAAW,CAAC,gBAAc,KAAK,EAAE,EAAE,EAAE,OAAO,IACnG,KAAK,IAAI,mDAAW,CACf;IAEP,WAAW,IAAI,CACd,oBAAC,SAAS,IAAC,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,iBAAiB,CAAC,EAAE,EAAE,EAAE,aAAa,IACnE,WAAW,CACF,CACb,CACG,CACP,CAAC;AA3BW,QAAA,YAAY,gBA2BvB;AAEF,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -2,14 +2,14 @@ import * as React from 'react';
|
|
|
2
2
|
export interface WizardNavProps {
|
|
3
3
|
/** children should be WizardNavItem components */
|
|
4
4
|
children?: any;
|
|
5
|
-
/** Aria-label applied to the
|
|
5
|
+
/** Aria-label applied to the navigation element */
|
|
6
6
|
'aria-label'?: string;
|
|
7
|
-
/** Sets the aria-labelledby attribute on the
|
|
7
|
+
/** Sets the aria-labelledby attribute on the navigation element */
|
|
8
8
|
'aria-labelledby'?: string;
|
|
9
|
-
/** Whether the
|
|
9
|
+
/** Whether the navigation is expanded */
|
|
10
10
|
isExpanded?: boolean;
|
|
11
|
-
/** True to return the inner list without the wrapping
|
|
12
|
-
|
|
11
|
+
/** True to return the inner list without the wrapping navigation element */
|
|
12
|
+
isInnerList?: boolean;
|
|
13
13
|
}
|
|
14
14
|
export declare const WizardNav: React.FunctionComponent<WizardNavProps>;
|
|
15
15
|
//# sourceMappingURL=WizardNav.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardNav.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNav.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,
|
|
1
|
+
{"version":3,"file":"WizardNav.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNav.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yCAAyC;IACzC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAoB7D,CAAC"}
|
|
@@ -5,10 +5,9 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const wizard_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Wizard/wizard"));
|
|
7
7
|
const react_styles_1 = require("@patternfly/react-styles");
|
|
8
|
-
const WizardNav = ({ children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, isExpanded = false,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return innerList;
|
|
8
|
+
const WizardNav = ({ children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, isExpanded = false, isInnerList = false }) => {
|
|
9
|
+
if (isInnerList) {
|
|
10
|
+
return React.createElement("ol", { className: react_styles_1.css(wizard_1.default.wizardNavList) }, children);
|
|
12
11
|
}
|
|
13
12
|
return (React.createElement("nav", { className: react_styles_1.css(wizard_1.default.wizardNav, isExpanded && wizard_1.default.modifiers.expanded), "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy },
|
|
14
13
|
React.createElement("ol", { className: react_styles_1.css(wizard_1.default.wizardNavList) }, children)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardNav.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNav.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,2GAA2E;AAC3E,2DAA+C;AAexC,MAAM,SAAS,GAA4C,CAAC,EACjE,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,UAAU,GAAG,KAAK,EAClB,
|
|
1
|
+
{"version":3,"file":"WizardNav.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNav.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,2GAA2E;AAC3E,2DAA+C;AAexC,MAAM,SAAS,GAA4C,CAAC,EACjE,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,KAAK,EACJ,EAAE,EAAE;IACnB,IAAI,WAAW,EAAE;QACf,OAAO,4BAAI,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,aAAa,CAAC,IAAG,QAAQ,CAAM,CAAC;KAClE;IAED,OAAO,CACL,6BACE,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,SAAS,EAAE,UAAU,IAAI,gBAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,gBAC7D,SAAS,qBACJ,cAAc;QAE/B,4BAAI,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,aAAa,CAAC,IAAG,QAAQ,CAAM,CACrD,CACP,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,SAAS,aAoBpB;AAEF,iBAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WizardProps } from './Wizard';
|
|
3
|
+
import { WizardNavProps } from './WizardNav';
|
|
4
|
+
/**
|
|
5
|
+
* Hosts deafult wizard navigation logic by utilizing the wizard's context and WizardNav/WizardNavItem.
|
|
6
|
+
* This component is not exposed to consumers.
|
|
7
|
+
*/
|
|
8
|
+
interface WizardNavInternalProps extends Pick<WizardProps, 'isStepVisitRequired'> {
|
|
9
|
+
nav: Partial<WizardNavProps>;
|
|
10
|
+
isNavExpanded: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const WizardNavInternal: ({ nav, isStepVisitRequired, isNavExpanded }: WizardNavInternalProps) => JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=WizardNavInternal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardNavInternal.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNavInternal.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAa,cAAc,EAAE,MAAM,aAAa,CAAC;AAGxD;;;GAGG;AAEH,UAAU,sBAAuB,SAAQ,IAAI,CAAC,WAAW,EAAE,qBAAqB,CAAC;IAC/E,GAAG,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7B,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,iBAAiB,gDAAiD,sBAAsB,gBAsHpG,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WizardNavInternal = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const types_1 = require("./types");
|
|
7
|
+
const WizardContext_1 = require("./WizardContext");
|
|
8
|
+
const WizardNav_1 = require("./WizardNav");
|
|
9
|
+
const WizardNavItem_1 = require("./WizardNavItem");
|
|
10
|
+
const WizardNavInternal = ({ nav, isStepVisitRequired, isNavExpanded }) => {
|
|
11
|
+
const { currentStep, steps, goToStepByIndex } = WizardContext_1.useWizardContext();
|
|
12
|
+
const wizardNavProps = Object.assign({ isExpanded: isNavExpanded, 'aria-label': (nav === null || nav === void 0 ? void 0 : nav['aria-label']) || 'Wizard steps' }, ((nav === null || nav === void 0 ? void 0 : nav['aria-labelledby']) && {
|
|
13
|
+
'aria-labelledby': nav['aria-labelledby']
|
|
14
|
+
}));
|
|
15
|
+
return (react_1.default.createElement(WizardNav_1.WizardNav, Object.assign({}, wizardNavProps), steps.map((step, index) => {
|
|
16
|
+
var _a;
|
|
17
|
+
const stepIndex = index + 1;
|
|
18
|
+
const customStepNavItem = types_1.isCustomWizardNavItem(step.navItem) && (react_1.default.createElement(react_1.default.Fragment, { key: step.id }, typeof step.navItem === 'function'
|
|
19
|
+
? step.navItem(step, currentStep, steps, goToStepByIndex)
|
|
20
|
+
: step.navItem));
|
|
21
|
+
if (types_1.isWizardParentStep(step) && !step.isHidden) {
|
|
22
|
+
let firstSubStepIndex;
|
|
23
|
+
let hasActiveChild = false;
|
|
24
|
+
const subNavItems = (_a = step.subStepIds) === null || _a === void 0 ? void 0 : _a.map((subStepId, subStepIndex) => {
|
|
25
|
+
const subStep = steps.find(step => step.id === subStepId);
|
|
26
|
+
const subStepOrderIndex = steps.indexOf(subStep) + 1;
|
|
27
|
+
const customSubStepNavItem = types_1.isCustomWizardNavItem(subStep.navItem) && (react_1.default.createElement(react_1.default.Fragment, { key: subStep.id }, typeof subStep.navItem === 'function'
|
|
28
|
+
? subStep.navItem(subStep, currentStep, steps, goToStepByIndex)
|
|
29
|
+
: subStep.navItem));
|
|
30
|
+
// Don't render the sub-step navigation item if the hidden property is enabled
|
|
31
|
+
if (subStep.isHidden) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
// Store the first sub-step index so that when its parent is clicked, the first sub-step is focused
|
|
35
|
+
if (subStepIndex === 0) {
|
|
36
|
+
firstSubStepIndex = subStepOrderIndex;
|
|
37
|
+
}
|
|
38
|
+
// When a sub-step is active, use this flag to set the parent step as active (isCurrent)
|
|
39
|
+
if ((currentStep === null || currentStep === void 0 ? void 0 : currentStep.id) === subStep.id) {
|
|
40
|
+
hasActiveChild = true;
|
|
41
|
+
}
|
|
42
|
+
return (customSubStepNavItem || (react_1.default.createElement(WizardNavItem_1.WizardNavItem, Object.assign({ key: subStep.id, id: subStep.id, content: subStep.name, isCurrent: (currentStep === null || currentStep === void 0 ? void 0 : currentStep.id) === subStep.id, isDisabled: subStep.isDisabled || (isStepVisitRequired && !subStep.isVisited), isVisited: subStep.isVisited, stepIndex: subStepOrderIndex, onNavItemClick: goToStepByIndex, status: subStep.status }, subStep.navItem))));
|
|
43
|
+
});
|
|
44
|
+
const hasEnabledChildren = react_1.default.Children.toArray(subNavItems).some(child => react_1.default.isValidElement(child) && !child.props.isDisabled);
|
|
45
|
+
return (customStepNavItem || (react_1.default.createElement(WizardNavItem_1.WizardNavItem, Object.assign({ key: step.id, id: step.id, content: step.name, isExpandable: true, isCurrent: hasActiveChild, isDisabled: !hasEnabledChildren, isVisited: step.isVisited, stepIndex: firstSubStepIndex, onNavItemClick: goToStepByIndex, status: step.status }, step.navItem),
|
|
46
|
+
react_1.default.createElement(WizardNav_1.WizardNav, Object.assign({}, wizardNavProps, { isInnerList: true }), subNavItems))));
|
|
47
|
+
}
|
|
48
|
+
if (types_1.isWizardBasicStep(step) && !step.isHidden) {
|
|
49
|
+
return (customStepNavItem || (react_1.default.createElement(WizardNavItem_1.WizardNavItem, Object.assign({ key: step.id, id: step.id, content: step.name, isCurrent: (currentStep === null || currentStep === void 0 ? void 0 : currentStep.id) === step.id, isDisabled: step.isDisabled || (isStepVisitRequired && !step.isVisited), isVisited: step.isVisited, stepIndex: stepIndex, onNavItemClick: goToStepByIndex, status: step.status }, step.navItem))));
|
|
50
|
+
}
|
|
51
|
+
})));
|
|
52
|
+
};
|
|
53
|
+
exports.WizardNavInternal = WizardNavInternal;
|
|
54
|
+
//# sourceMappingURL=WizardNavInternal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardNavInternal.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNavInternal.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,mCAAuF;AAEvF,mDAAmD;AACnD,2CAAwD;AACxD,mDAAgD;AAYzC,MAAM,iBAAiB,G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SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,eAAe,EAC/B,MAAM,EAAE,IAAI,CAAC,MAAM,IACf,IAAI,CAAC,OAAO,EAChB,CACH,CACF,CAAC;SACH;IACH,CAAC,CAAC,CACQ,CACb,CAAC;AACJ,CAAC,CAAC;AAtHW,QAAA,iBAAiB,qBAsH5B"}
|
|
@@ -2,24 +2,28 @@ import * as React from 'react';
|
|
|
2
2
|
export interface WizardNavItemProps {
|
|
3
3
|
/** Can nest a WizardNav component for substeps */
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
/** The content to display in the
|
|
5
|
+
/** The content to display in the navigation item */
|
|
6
6
|
content?: React.ReactNode;
|
|
7
|
-
/** Whether the
|
|
7
|
+
/** Whether the navigation item is the currently active item */
|
|
8
8
|
isCurrent?: boolean;
|
|
9
|
-
/** Whether the
|
|
9
|
+
/** Whether the navigation item is disabled */
|
|
10
10
|
isDisabled?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
11
|
+
/** Whether the navigation item has been visited */
|
|
12
|
+
isVisited?: boolean;
|
|
13
|
+
/** The step index passed into the onNavItemClick callback */
|
|
14
|
+
stepIndex: number;
|
|
15
|
+
/** Callback for when the navigation item is clicked */
|
|
16
|
+
onNavItemClick?: (stepIndex: number) => any;
|
|
15
17
|
/** Component used to render WizardNavItem */
|
|
16
18
|
navItemComponent?: 'button' | 'a';
|
|
17
19
|
/** An optional url to use for when using an anchor component */
|
|
18
20
|
href?: string;
|
|
19
21
|
/** Flag indicating that this NavItem has child steps and is expandable */
|
|
20
22
|
isExpandable?: boolean;
|
|
21
|
-
/** The id for the
|
|
23
|
+
/** The id for the navigation item */
|
|
22
24
|
id?: string | number;
|
|
25
|
+
/** Used to determine the icon displayed next to content. Default has no icon. */
|
|
26
|
+
status?: 'default' | 'error';
|
|
23
27
|
}
|
|
24
28
|
export declare const WizardNavItem: React.FunctionComponent<WizardNavItemProps>;
|
|
25
29
|
//# sourceMappingURL=WizardNavItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardNavItem.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNavItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"WizardNavItem.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNavItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,oDAAoD;IACpD,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mDAAmD;IACnD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,GAAG,CAAC;IAC5C,6CAA6C;IAC7C,gBAAgB,CAAC,EAAE,QAAQ,GAAG,GAAG,CAAC;IAClC,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qCAAqC;IACrC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,iFAAiF;IACjF,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CAC9B;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CA8FrE,CAAC"}
|
|
@@ -6,8 +6,10 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const react_styles_1 = require("@patternfly/react-styles");
|
|
7
7
|
const wizard_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Wizard/wizard"));
|
|
8
8
|
const angle_right_icon_1 = tslib_1.__importDefault(require('@patternfly/react-icons/dist/js/icons/angle-right-icon'));
|
|
9
|
+
const exclamation_circle_icon_1 = tslib_1.__importDefault(require('@patternfly/react-icons/dist/js/icons/exclamation-circle-icon'));
|
|
10
|
+
const types_1 = require("./types");
|
|
9
11
|
const WizardNavItem = (_a) => {
|
|
10
|
-
var { children = null, content = '', isCurrent = false, isDisabled = false,
|
|
12
|
+
var { children = null, content = '', isCurrent = false, isDisabled = false, isVisited = false, stepIndex, onNavItemClick = () => undefined, navItemComponent = 'button', href = null, isExpandable = false, id, status = 'default' } = _a, rest = tslib_1.__rest(_a, ["children", "content", "isCurrent", "isDisabled", "isVisited", "stepIndex", "onNavItemClick", "navItemComponent", "href", "isExpandable", "id", "status"]);
|
|
11
13
|
const NavItemComponent = navItemComponent;
|
|
12
14
|
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
13
15
|
React.useEffect(() => {
|
|
@@ -17,22 +19,31 @@ const WizardNavItem = (_a) => {
|
|
|
17
19
|
// eslint-disable-next-line no-console
|
|
18
20
|
console.error('WizardNavItem: When using an anchor, please provide an href');
|
|
19
21
|
}
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
const ariaLabel = React.useMemo(() => {
|
|
23
|
+
if (status === types_1.WizardNavItemStatus.Error || (isVisited && !isCurrent)) {
|
|
24
|
+
let label = content.toString();
|
|
25
|
+
if (status === types_1.WizardNavItemStatus.Error) {
|
|
26
|
+
label += `, ${status}`;
|
|
27
|
+
}
|
|
28
|
+
// No need to signify step is visited if current
|
|
29
|
+
if (isVisited && !isCurrent) {
|
|
30
|
+
label += ', visited';
|
|
31
|
+
}
|
|
32
|
+
return label;
|
|
33
|
+
}
|
|
34
|
+
}, [content, isCurrent, isVisited, status]);
|
|
27
35
|
return (React.createElement("li", { className: react_styles_1.css(wizard_1.default.wizardNavItem, isExpandable && wizard_1.default.modifiers.expandable, isExpandable && isExpanded && wizard_1.default.modifiers.expanded) },
|
|
28
|
-
React.createElement(NavItemComponent, Object.assign({}, rest, (navItemComponent === 'a' ?
|
|
36
|
+
React.createElement(NavItemComponent, Object.assign({}, rest, (navItemComponent === 'a' ? { tabIndex: isDisabled ? -1 : undefined, href } : { disabled: isDisabled }), (id && { id: id.toString() }), { onClick: e => {
|
|
29
37
|
e.preventDefault();
|
|
30
|
-
isExpandable ? setIsExpanded(!isExpanded || isCurrent) : onNavItemClick(
|
|
31
|
-
}, className: react_styles_1.css(wizard_1.default.wizardNavLink, isCurrent && wizard_1.default.modifiers.current, isDisabled && wizard_1.default.modifiers.disabled), "aria-disabled": isDisabled ? true : null, "aria-current": isCurrent && !children ? 'step' : false }, (isExpandable && { 'aria-expanded': isExpanded })), isExpandable ? (React.createElement(React.Fragment, null,
|
|
38
|
+
isExpandable ? setIsExpanded(!isExpanded || isCurrent) : onNavItemClick(stepIndex);
|
|
39
|
+
}, className: react_styles_1.css(wizard_1.default.wizardNavLink, isCurrent && wizard_1.default.modifiers.current, isDisabled && wizard_1.default.modifiers.disabled), "aria-disabled": isDisabled ? true : null, "aria-current": isCurrent && !children ? 'step' : false }, (isExpandable && { 'aria-expanded': isExpanded }), (ariaLabel && { 'aria-label': ariaLabel })), isExpandable ? (React.createElement(React.Fragment, null,
|
|
32
40
|
React.createElement("span", { className: react_styles_1.css(wizard_1.default.wizardNavLinkText) }, content),
|
|
33
41
|
React.createElement("span", { className: react_styles_1.css(wizard_1.default.wizardNavLinkToggle) },
|
|
34
42
|
React.createElement("span", { className: react_styles_1.css(wizard_1.default.wizardNavLinkToggleIcon) },
|
|
35
|
-
React.createElement(angle_right_icon_1.default, null))))) : (
|
|
43
|
+
React.createElement(angle_right_icon_1.default, null))))) : (React.createElement(React.Fragment, null,
|
|
44
|
+
content,
|
|
45
|
+
status === types_1.WizardNavItemStatus.Error && (React.createElement("span", { style: { marginLeft: 'var(--pf-global--spacer--sm)' } },
|
|
46
|
+
React.createElement(exclamation_circle_icon_1.default, { color: "var(--pf-global--danger-color--100)" })))))),
|
|
36
47
|
children));
|
|
37
48
|
};
|
|
38
49
|
exports.WizardNavItem = WizardNavItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardNavItem.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNavItem.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;
|
|
1
|
+
{"version":3,"file":"WizardNavItem.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNavItem.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,2DAA+C;AAC/C,2GAA2E;AAC3E,sHAAqF;AACrF,oIAAmG;AAEnG,mCAA8C;AA6BvC,MAAM,aAAa,GAAgD,CAAC,EActD,EAAE,EAAE;QAdkD,EACzE,QAAQ,GAAG,IAAI,EACf,OAAO,GAAG,EAAE,EACZ,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,SAAS,EACT,cAAc,GAAG,GAAG,EAAE,CAAC,SAAS,EAChC,gBAAgB,GAAG,QAAQ,EAC3B,IAAI,GAAG,IAAI,EACX,YAAY,GAAG,KAAK,EACpB,EAAE,EACF,MAAM,GAAG,SAAS,OAEC,EADhB,IAAI,sBAbkE,0JAc1E,CADQ;IAEP,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;IAC1C,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE1D,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,aAAa,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,IAAI,gBAAgB,KAA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
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { WizardNavItemType } from './types';
|
|
3
3
|
import { WizardBodyProps } from './WizardBody';
|
|
4
|
+
import { WizardFooterProps } from './WizardFooter';
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
* Also acts as a wrapper for content, with an optional inclusion of WizardBody.
|
|
6
|
+
* The primary child component for Wizard. Step props are used for the list of steps managed in context.
|
|
7
7
|
*/
|
|
8
|
-
export interface WizardStepProps
|
|
8
|
+
export interface WizardStepProps {
|
|
9
|
+
/** Name of the step's navigation item */
|
|
10
|
+
name: React.ReactNode;
|
|
11
|
+
/** Unique identifier */
|
|
12
|
+
id: string | number;
|
|
9
13
|
/** Optional for when the step is used as a parent to sub-steps */
|
|
10
14
|
children?: React.ReactNode;
|
|
11
15
|
/** Props for WizardBody that wraps content by default. Can be set to null for exclusion of WizardBody. */
|
|
12
|
-
body?: Omit<WizardBodyProps, 'children'> | null;
|
|
16
|
+
body?: Omit<Omit<WizardBodyProps, 'children'>, 'children'> | null;
|
|
13
17
|
/** Optional list of sub-steps */
|
|
14
18
|
steps?: React.ReactElement<WizardStepProps>[];
|
|
19
|
+
/** Flag to disable the step's navigation item */
|
|
20
|
+
isDisabled?: boolean;
|
|
21
|
+
/** Flag to represent whether the step has been visited (navigated to) */
|
|
22
|
+
isVisited?: boolean;
|
|
23
|
+
/** Flag to determine whether the step is hidden */
|
|
24
|
+
isHidden?: boolean;
|
|
25
|
+
/** Replaces the step's navigation item or its properties. */
|
|
26
|
+
navItem?: WizardNavItemType;
|
|
27
|
+
/** Replaces the step's footer. The step's footer takes precedance over the wizard's footer. */
|
|
28
|
+
footer?: React.ReactElement | Partial<WizardFooterProps>;
|
|
29
|
+
/** Used to determine icon next to the step's navigation item */
|
|
30
|
+
status?: 'default' | 'error';
|
|
15
31
|
}
|
|
16
32
|
export declare const WizardStep: {
|
|
17
|
-
({ body,
|
|
33
|
+
({ children, body, id, footer, isHidden, isDisabled, navItem, status }: WizardStepProps): JSX.Element;
|
|
18
34
|
displayName: string;
|
|
19
35
|
};
|
|
20
36
|
//# sourceMappingURL=WizardStep.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardStep.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardStep.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"WizardStep.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardStep.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAG3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;GAEG;AAEH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,wBAAwB;IACxB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,0GAA0G;IAC1G,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC;IAClE,iCAAiC;IACjC,KAAK,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,EAAE,CAAC;IAC9C,iDAAiD;IACjD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yEAAyE;IACzE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,+FAA+F;IAC/F,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACzD,gEAAgE;IAChE,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CAC9B;AAED,eAAO,MAAM,UAAU;4EAA2E,eAAe;;CA4BhH,CAAC"}
|