@elliemae/ds-wizard 2.2.0-alpha.2 → 2.2.0-beta.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/cjs/DSWizard.stories.js +18 -0
- package/cjs/WizardStep.js +63 -76
- package/cjs/WizardSteps.js +56 -58
- package/cjs/blockNames.js +11 -39
- package/cjs/index.js +15 -41
- package/cjs/stories/steps.js +36 -57
- package/cjs/stories/wizzard-overview.stories.js +61 -0
- package/cjs/useWizard.js +24 -48
- package/esm/DSWizard.stories.js +13 -0
- package/esm/WizardStep.js +54 -47
- package/esm/WizardSteps.js +42 -26
- package/esm/blockNames.js +5 -10
- package/esm/index.js +3 -12
- package/esm/stories/steps.js +28 -28
- package/esm/stories/wizzard-overview.stories.js +52 -0
- package/esm/useWizard.js +19 -16
- package/package.json +6 -6
- package/types/WizardStep.d.ts +1 -9
- package/types/WizardSteps.d.ts +1 -6
- package/cjs/WizardStep.js.map +0 -7
- package/cjs/WizardSteps.js.map +0 -7
- package/cjs/blockNames.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/stories/steps.js.map +0 -7
- package/cjs/useWizard.js.map +0 -7
- package/esm/WizardStep.js.map +0 -7
- package/esm/WizardSteps.js.map +0 -7
- package/esm/blockNames.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/stories/steps.js.map +0 -7
- package/esm/useWizard.js.map +0 -7
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dsWizard = require('@elliemae/ds-wizard');
|
|
6
|
+
var wizzardOverview_stories = require('./stories/wizzard-overview.stories.js');
|
|
7
|
+
|
|
8
|
+
/* eslint-disable import/no-unresolved */
|
|
9
|
+
var DSWizard_stories = {
|
|
10
|
+
title: 'Wizzard',
|
|
11
|
+
component: dsWizard.WizardStepsIndicator,
|
|
12
|
+
parameters: {
|
|
13
|
+
propsSchemas: dsWizard.WizzardWithSchema
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.Overview = wizzardOverview_stories.Overview;
|
|
18
|
+
exports["default"] = DSWizard_stories;
|
package/cjs/WizardStep.js
CHANGED
|
@@ -1,85 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var reactDesc = require('react-desc');
|
|
8
|
+
var dsClassnames = require('@elliemae/ds-classnames');
|
|
9
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
10
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
11
|
+
var blockNames = require('./blockNames.js');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
16
|
+
|
|
17
|
+
var _Checkmark;
|
|
18
|
+
const Item = dsClassnames.aggregatedClasses('div')("".concat(blockNames.indicatorItemBlockName), null, _ref => {
|
|
19
|
+
let {
|
|
20
|
+
active,
|
|
21
|
+
completed
|
|
22
|
+
} = _ref;
|
|
23
|
+
return {
|
|
24
|
+
active,
|
|
25
|
+
completed
|
|
26
26
|
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var WizardStep_exports = {};
|
|
29
|
-
__export(WizardStep_exports, {
|
|
30
|
-
WizzardStepWithSchema: () => WizzardStepWithSchema,
|
|
31
|
-
default: () => WizardStep_default
|
|
32
27
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
iconCompleted = /* @__PURE__ */ import_react.default.createElement(import_ds_icons.Checkmark, null),
|
|
52
|
-
iconActive = null,
|
|
53
|
-
active = false,
|
|
54
|
-
completed = false,
|
|
55
|
-
index = 0
|
|
56
|
-
}) {
|
|
57
|
-
const currentIcon = (0, import_react.useMemo)(() => {
|
|
58
|
-
if (active)
|
|
59
|
-
return iconActive;
|
|
60
|
-
if (completed)
|
|
61
|
-
return iconCompleted;
|
|
28
|
+
const Wrapper = dsClassnames.aggregatedClasses('div')("".concat(blockNames.indicatorItemBlockName, "-wrapper"));
|
|
29
|
+
const Label = dsClassnames.aggregatedClasses('span')(blockNames.indicatorItemBlockName, 'label');
|
|
30
|
+
const Bullet = dsClassnames.aggregatedClasses('div')(blockNames.indicatorItemBlockName, 'bullet');
|
|
31
|
+
const BulletWrapper = dsClassnames.aggregatedClasses('div')(blockNames.indicatorItemBlockName, 'bullet-wrapper');
|
|
32
|
+
|
|
33
|
+
function WizardStep(_ref2) {
|
|
34
|
+
let {
|
|
35
|
+
label = '',
|
|
36
|
+
icon = null,
|
|
37
|
+
iconCompleted = _Checkmark || (_Checkmark = /*#__PURE__*/_jsx__default["default"](dsIcons.Checkmark, {})),
|
|
38
|
+
iconActive = null,
|
|
39
|
+
active = false,
|
|
40
|
+
completed = false,
|
|
41
|
+
index = 0
|
|
42
|
+
} = _ref2;
|
|
43
|
+
const currentIcon = React.useMemo(() => {
|
|
44
|
+
if (active) return iconActive;
|
|
45
|
+
if (completed) return iconCompleted;
|
|
62
46
|
return icon;
|
|
63
47
|
}, [active, completed]) || icon;
|
|
64
|
-
const iconWithOptions =
|
|
65
|
-
color:
|
|
48
|
+
const iconWithOptions = React.useMemo(() => /*#__PURE__*/React.isValidElement(currentIcon) ? /*#__PURE__*/React.cloneElement(currentIcon, {
|
|
49
|
+
color: dsUtilities.get(currentIcon, ['props', 'color']) || ['brand-primary', completed ? 600 : 500]
|
|
66
50
|
}) : currentIcon || index + 1, [currentIcon]);
|
|
67
|
-
return
|
|
68
|
-
classProps: {
|
|
69
|
-
|
|
51
|
+
return /*#__PURE__*/_jsx__default["default"](Item, {
|
|
52
|
+
classProps: {
|
|
53
|
+
active,
|
|
54
|
+
completed
|
|
55
|
+
}
|
|
56
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](Wrapper, {}, void 0, /*#__PURE__*/_jsx__default["default"](BulletWrapper, {}, void 0, /*#__PURE__*/_jsx__default["default"](Bullet, {}, void 0, iconWithOptions)), /*#__PURE__*/_jsx__default["default"](Label, {}, void 0, label)));
|
|
70
57
|
}
|
|
58
|
+
|
|
71
59
|
const wizzardStepProps = {
|
|
72
|
-
label:
|
|
73
|
-
icon:
|
|
74
|
-
iconCompleted:
|
|
75
|
-
iconActive:
|
|
76
|
-
active:
|
|
77
|
-
completed:
|
|
78
|
-
index:
|
|
60
|
+
label: reactDesc.PropTypes.string.description('Step label'),
|
|
61
|
+
icon: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.element, reactDesc.PropTypes.string]).description('Default icon or number'),
|
|
62
|
+
iconCompleted: reactDesc.PropTypes.element.description('Icon when the step is completed').defaultValue(dsIcons.Checkmark),
|
|
63
|
+
iconActive: reactDesc.PropTypes.element.description('Icon when the step is active'),
|
|
64
|
+
active: reactDesc.PropTypes.bool.description('Whether the step is active or not').defaultValue(false),
|
|
65
|
+
completed: reactDesc.PropTypes.bool.description('Whether the step is completed or not').defaultValue(false),
|
|
66
|
+
index: reactDesc.PropTypes.number.description('Current item index')
|
|
79
67
|
};
|
|
80
|
-
|
|
81
|
-
const WizzardStepWithSchema = (0, import_react_desc.describe)(WizardStep);
|
|
68
|
+
const WizzardStepWithSchema = reactDesc.describe(WizardStep);
|
|
82
69
|
WizzardStepWithSchema.propTypes = wizzardStepProps;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
70
|
+
|
|
71
|
+
exports.WizzardStepWithSchema = WizzardStepWithSchema;
|
|
72
|
+
exports["default"] = WizardStep;
|
package/cjs/WizardSteps.js
CHANGED
|
@@ -1,68 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
14
|
+
var React = require('react');
|
|
15
|
+
var reactDesc = require('react-desc');
|
|
16
|
+
var dsClassnames = require('@elliemae/ds-classnames');
|
|
17
|
+
var WizardStep = require('./WizardStep.js');
|
|
18
|
+
var blockNames = require('./blockNames.js');
|
|
19
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
20
|
+
|
|
21
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
|
+
|
|
23
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
24
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
25
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
26
|
+
|
|
27
|
+
const _excluded = ["current", "steps", "children"];
|
|
28
|
+
|
|
29
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
30
|
+
|
|
31
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
32
|
+
const StepsWrapper = dsClassnames.aggregatedClasses('div')(blockNames.indicatorBlockName);
|
|
33
|
+
|
|
34
|
+
function WizardSteps(_ref) {
|
|
35
|
+
let {
|
|
36
|
+
current = 0,
|
|
37
|
+
steps,
|
|
38
|
+
children
|
|
39
|
+
} = _ref,
|
|
40
|
+
otherProps = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
41
|
+
|
|
42
|
+
const items = React.useMemo(() => {
|
|
42
43
|
const mergeStepProps = (step, index) => ({
|
|
43
44
|
index,
|
|
44
45
|
active: current === index,
|
|
45
46
|
completed: index < current
|
|
46
47
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
...step,
|
|
50
|
-
...mergeStepProps(step, index)
|
|
51
|
-
})) : import_react.default.Children.map(children, (item, index) => (0, import_react.cloneElement)(item, mergeStepProps(item, index)));
|
|
48
|
+
|
|
49
|
+
return steps ? steps.map((step, index) => /*#__PURE__*/jsxRuntime.jsx(WizardStep["default"], _objectSpread(_objectSpread({}, step), mergeStepProps(step, index)), index)) : React__default["default"].Children.map(children, (item, index) => /*#__PURE__*/React.cloneElement(item, mergeStepProps(item, index)));
|
|
52
50
|
}, [current, children]);
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
}
|
|
51
|
+
return /*#__PURE__*/jsxRuntime.jsx(StepsWrapper, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
52
|
+
children: items
|
|
53
|
+
}));
|
|
56
54
|
}
|
|
57
|
-
|
|
55
|
+
|
|
56
|
+
WizardSteps.Item = WizardStep["default"];
|
|
58
57
|
const wizzardProps = {
|
|
59
|
-
current:
|
|
60
|
-
steps:
|
|
61
|
-
children:
|
|
58
|
+
current: reactDesc.PropTypes.number.description('Current active state index').defaultValue(0),
|
|
59
|
+
steps: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.shape({})).description('Array of steps objects').defaultValue([]).isRequired,
|
|
60
|
+
children: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.instanceOf(WizardStep["default"])).description('List of WizardStep components')
|
|
62
61
|
};
|
|
63
|
-
|
|
64
|
-
const WizzardWithSchema = (0, import_react_desc.describe)(WizardSteps);
|
|
62
|
+
const WizzardWithSchema = reactDesc.describe(WizardSteps);
|
|
65
63
|
WizzardWithSchema.propTypes = wizzardProps;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
|
|
65
|
+
exports.WizzardWithSchema = WizzardWithSchema;
|
|
66
|
+
exports["default"] = WizardSteps;
|
package/cjs/blockNames.js
CHANGED
|
@@ -1,39 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var blockNames_exports = {};
|
|
29
|
-
__export(blockNames_exports, {
|
|
30
|
-
indicatorBlockName: () => indicatorBlockName,
|
|
31
|
-
indicatorItemBlockName: () => indicatorItemBlockName,
|
|
32
|
-
wizardBlockName: () => wizardBlockName
|
|
33
|
-
});
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
const wizardBlockName = "wizard";
|
|
36
|
-
const indicatorBlockName = `${wizardBlockName}-steps-indicator`;
|
|
37
|
-
const indicatorItemBlockName = `${indicatorBlockName}-step`;
|
|
38
|
-
module.exports = __toCommonJS(blockNames_exports);
|
|
39
|
-
//# sourceMappingURL=blockNames.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const wizardBlockName = 'wizard';
|
|
6
|
+
const indicatorBlockName = "".concat(wizardBlockName, "-steps-indicator");
|
|
7
|
+
const indicatorItemBlockName = "".concat(indicatorBlockName, "-step");
|
|
8
|
+
|
|
9
|
+
exports.indicatorBlockName = indicatorBlockName;
|
|
10
|
+
exports.indicatorItemBlockName = indicatorItemBlockName;
|
|
11
|
+
exports.wizardBlockName = wizardBlockName;
|
package/cjs/index.js
CHANGED
|
@@ -1,41 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var src_exports = {};
|
|
29
|
-
__export(src_exports, {
|
|
30
|
-
WizardStep: () => import_WizardStep.default,
|
|
31
|
-
WizardStepsIndicator: () => import_WizardSteps.default,
|
|
32
|
-
WizzardStepWithSchema: () => import_WizardStep.WizzardStepWithSchema,
|
|
33
|
-
WizzardWithSchema: () => import_WizardSteps.WizzardWithSchema,
|
|
34
|
-
useWizard: () => import_useWizard.default
|
|
35
|
-
});
|
|
36
|
-
var React = __toESM(require("react"));
|
|
37
|
-
var import_WizardSteps = __toESM(require("./WizardSteps"));
|
|
38
|
-
var import_WizardStep = __toESM(require("./WizardStep"));
|
|
39
|
-
var import_useWizard = __toESM(require("./useWizard"));
|
|
40
|
-
module.exports = __toCommonJS(src_exports);
|
|
41
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var WizardSteps = require('./WizardSteps.js');
|
|
6
|
+
var WizardStep = require('./WizardStep.js');
|
|
7
|
+
var useWizard = require('./useWizard.js');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.WizardStepsIndicator = WizardSteps["default"];
|
|
12
|
+
exports.WizzardWithSchema = WizardSteps.WizzardWithSchema;
|
|
13
|
+
exports.WizardStep = WizardStep["default"];
|
|
14
|
+
exports.WizzardStepWithSchema = WizardStep.WizzardStepWithSchema;
|
|
15
|
+
exports.useWizard = useWizard;
|
package/cjs/stories/steps.js
CHANGED
|
@@ -1,57 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const Step4Content = () => /* @__PURE__ */ import_react.default.createElement("div", null, "Step 4 Content");
|
|
38
|
-
const steps = [
|
|
39
|
-
{
|
|
40
|
-
label: "Step 1",
|
|
41
|
-
content: Step1Content
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
label: "Step Lorem Ipsum",
|
|
45
|
-
content: Step2Content
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
label: "Step Lorem",
|
|
49
|
-
content: Step3Content
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
label: "Step Lorem 4",
|
|
53
|
-
content: Step4Content
|
|
54
|
-
}
|
|
55
|
-
];
|
|
56
|
-
module.exports = __toCommonJS(steps_exports);
|
|
57
|
-
//# sourceMappingURL=steps.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
require('react');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
11
|
+
|
|
12
|
+
var _div, _div2, _div3, _div4;
|
|
13
|
+
|
|
14
|
+
const Step1Content = () => _div || (_div = /*#__PURE__*/_jsx__default["default"]("div", {}, void 0, "Step 1 Content"));
|
|
15
|
+
|
|
16
|
+
const Step2Content = () => _div2 || (_div2 = /*#__PURE__*/_jsx__default["default"]("div", {}, void 0, "Step 2 Content"));
|
|
17
|
+
|
|
18
|
+
const Step3Content = () => _div3 || (_div3 = /*#__PURE__*/_jsx__default["default"]("div", {}, void 0, "Step 3 Content"));
|
|
19
|
+
|
|
20
|
+
const Step4Content = () => _div4 || (_div4 = /*#__PURE__*/_jsx__default["default"]("div", {}, void 0, "Step 4 Content"));
|
|
21
|
+
|
|
22
|
+
const steps = [{
|
|
23
|
+
label: 'Step 1',
|
|
24
|
+
content: Step1Content
|
|
25
|
+
}, {
|
|
26
|
+
label: 'Step Lorem Ipsum',
|
|
27
|
+
content: Step2Content
|
|
28
|
+
}, {
|
|
29
|
+
label: 'Step Lorem',
|
|
30
|
+
content: Step3Content
|
|
31
|
+
}, {
|
|
32
|
+
label: 'Step Lorem 4',
|
|
33
|
+
content: Step4Content
|
|
34
|
+
}];
|
|
35
|
+
|
|
36
|
+
exports.steps = steps;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
require('react');
|
|
7
|
+
var dsWizard = require('@elliemae/ds-wizard');
|
|
8
|
+
var DSButton = require('@elliemae/ds-button');
|
|
9
|
+
var steps = require('./steps.js');
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
11
|
+
|
|
12
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
+
|
|
14
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
15
|
+
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
16
|
+
|
|
17
|
+
const Overview = () => {
|
|
18
|
+
const {
|
|
19
|
+
WizardCurrentContent,
|
|
20
|
+
current,
|
|
21
|
+
next,
|
|
22
|
+
previous,
|
|
23
|
+
canNext,
|
|
24
|
+
canPrevious
|
|
25
|
+
} = dsWizard.useWizard({
|
|
26
|
+
steps: steps.steps
|
|
27
|
+
});
|
|
28
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
29
|
+
children: [/*#__PURE__*/_jsx__default["default"](dsWizard.WizardStepsIndicator, {
|
|
30
|
+
current: current,
|
|
31
|
+
steps: steps.steps
|
|
32
|
+
}), /*#__PURE__*/_jsx__default["default"]("div", {
|
|
33
|
+
style: {
|
|
34
|
+
margin: '10px 0',
|
|
35
|
+
padding: 10,
|
|
36
|
+
border: '1px solid #ddd'
|
|
37
|
+
}
|
|
38
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](WizardCurrentContent, {
|
|
39
|
+
data: {
|
|
40
|
+
someExtraData: 'step information'
|
|
41
|
+
}
|
|
42
|
+
})), /*#__PURE__*/_jsx__default["default"]("div", {
|
|
43
|
+
style: {
|
|
44
|
+
display: 'flex',
|
|
45
|
+
width: 180,
|
|
46
|
+
justifyContent: 'space-between'
|
|
47
|
+
}
|
|
48
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
|
|
49
|
+
buttonType: "secondary",
|
|
50
|
+
disabled: !canPrevious,
|
|
51
|
+
labelText: "Previous",
|
|
52
|
+
onClick: previous
|
|
53
|
+
}), /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
|
|
54
|
+
disabled: !canNext,
|
|
55
|
+
labelText: "Next",
|
|
56
|
+
onClick: next
|
|
57
|
+
}))]
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
exports.Overview = Overview;
|