@loadsmart/miranda-react 3.0.0-alpha.2 → 3.0.0-beta.2
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/components/Accordion/index.d.ts +0 -2
- package/dist/components/Badge/index.d.ts +0 -2
- package/dist/components/Banner/Banner.d.ts +1 -0
- package/dist/components/Banner/index.d.ts +1 -3
- package/dist/components/Button/index.d.ts +0 -2
- package/dist/components/Card/index.d.ts +0 -2
- package/dist/components/Checkbox/index.d.ts +0 -2
- package/dist/components/Dialog/index.d.ts +0 -2
- package/dist/components/Divider/index.d.ts +0 -1
- package/dist/components/Drawer/index.d.ts +0 -2
- package/dist/components/Dropdown/index.d.ts +0 -2
- package/dist/components/EmptyState/index.d.ts +0 -1
- package/dist/components/Field/index.d.ts +0 -2
- package/dist/components/Header/index.d.ts +0 -1
- package/dist/components/Icon/index.d.ts +0 -2
- package/dist/components/LabeledValue/index.d.ts +0 -2
- package/dist/components/Layout/index.d.ts +0 -2
- package/dist/components/Link/Link.d.ts +2 -0
- package/dist/components/Link/index.d.ts +1 -3
- package/dist/components/LogoLoader/index.d.ts +0 -2
- package/dist/components/PageContent/index.d.ts +0 -4
- package/dist/components/Pagination/index.d.ts +0 -2
- package/dist/components/ProgressBar/ProgressBar.d.ts +2 -0
- package/dist/components/ProgressBar/index.d.ts +1 -3
- package/dist/components/ProgressBarCountdown/index.d.ts +0 -2
- package/dist/components/RadioGroup/index.d.ts +0 -2
- package/dist/components/Section/index.d.ts +0 -2
- package/dist/components/SpinnerWheel/index.d.ts +0 -2
- package/dist/components/Steps/index.d.ts +0 -2
- package/dist/components/Switch/index.d.ts +0 -2
- package/dist/components/Table/index.d.ts +1 -2
- package/dist/components/Tabs/index.d.ts +1 -2
- package/dist/components/Tag/index.d.ts +0 -2
- package/dist/components/Text/index.d.ts +0 -2
- package/dist/components/TextArea/index.d.ts +0 -2
- package/dist/components/TextField/index.d.ts +0 -2
- package/dist/components/Timeline/index.d.ts +0 -2
- package/dist/components/ToggleGroup/index.d.ts +0 -2
- package/dist/components/Tooltip/Tooltip.d.ts +2 -1
- package/dist/components/Tooltip/index.d.ts +1 -3
- package/dist/index.d.ts +67 -0
- package/dist/index.js +1202 -40
- package/package.json +3 -3
- package/dist/Accordion-CRFOEG8P.js +0 -35
- package/dist/ActionableTag-CiY3ktmR.js +0 -30
- package/dist/Badge-bksnMK0y.js +0 -10
- package/dist/Banner-DKi8HnhY.js +0 -67
- package/dist/Button-MYGS0n5V.js +0 -16
- package/dist/Card-DMVgqLq2.js +0 -88
- package/dist/Checkbox-OA3mt9qr.js +0 -19
- package/dist/Dialog-BXmQb7iZ.js +0 -92
- package/dist/Divider-Ce0Poebo.js +0 -10
- package/dist/Drawer-DAL5BRMS.js +0 -84
- package/dist/Dropdown-BZq7wxH2.js +0 -47
- package/dist/EmptyState-N_H8UALy.js +0 -49
- package/dist/Field-DUTm4XZx.js +0 -31
- package/dist/Header-BVVroF-a.js +0 -47
- package/dist/Icon-JSXp1ySp.js +0 -10
- package/dist/LabeledValue-BEj3zEk5.js +0 -33
- package/dist/Layout-yKvtIEmV.js +0 -81
- package/dist/Link-XqV4DM9g.js +0 -10
- package/dist/LogoLoader-Bjplh2u3.js +0 -10
- package/dist/PageContent-Bu0ofdVV.js +0 -19
- package/dist/Pagination-D2HYqeb2.js +0 -13
- package/dist/ProgressBar-CdwVUs1k.js +0 -10
- package/dist/ProgressBarCountdown-BsTb_5jd.js +0 -10
- package/dist/RadioGroup-QWrSrVvv.js +0 -28
- package/dist/Section-BcuVyQXQ.js +0 -24
- package/dist/SpinnerWheel-BqMAxsBi.js +0 -10
- package/dist/Switch-Uq5TuNqD.js +0 -13
- package/dist/Table-DlnVsR0p.js +0 -78
- package/dist/Tabs-9eHquUoD.js +0 -34
- package/dist/Text-BUtQqPKN.js +0 -10
- package/dist/TextArea-DNtv4x9o.js +0 -18
- package/dist/TextField-BHj0EHuT.js +0 -20
- package/dist/Timeline-MCAixOaW.js +0 -68
- package/dist/ToggleGroup-ig9rKVtU.js +0 -33
- package/dist/Tooltip-0sGIbwe8.js +0 -15
- package/dist/accordion.js +0 -5
- package/dist/badge.js +0 -4
- package/dist/banner.js +0 -5
- package/dist/button.js +0 -5
- package/dist/card.js +0 -5
- package/dist/checkbox.js +0 -5
- package/dist/createComponent-Cye6h9wF.js +0 -120
- package/dist/dialog.js +0 -5
- package/dist/divider.js +0 -4
- package/dist/drawer.js +0 -5
- package/dist/dropdown.js +0 -5
- package/dist/emptystate.js +0 -5
- package/dist/field.js +0 -5
- package/dist/header.js +0 -4
- package/dist/icon.js +0 -4
- package/dist/labeledvalue.js +0 -5
- package/dist/layout.js +0 -5
- package/dist/link.js +0 -4
- package/dist/logoloader.js +0 -4
- package/dist/pagecontent.js +0 -4
- package/dist/pagination.js +0 -4
- package/dist/progressbar.js +0 -4
- package/dist/progressbarcountdown.js +0 -4
- package/dist/radiogroup.js +0 -5
- package/dist/section.js +0 -5
- package/dist/spinnerwheel.js +0 -4
- package/dist/steps.js +0 -4
- package/dist/switch.js +0 -4
- package/dist/table.js +0 -4
- package/dist/tabs.js +0 -5
- package/dist/tag.js +0 -5
- package/dist/text.js +0 -4
- package/dist/textarea.js +0 -5
- package/dist/textfield.js +0 -5
- package/dist/timeline.js +0 -4
- package/dist/togglegroup.js +0 -5
- package/dist/tooltip.js +0 -5
- package/dist/useSteps-O9Ch5_pJ.js +0 -88
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
function _extends() {
|
|
4
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
5
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
6
|
-
var source = arguments[i];
|
|
7
|
-
for (var key in source) {
|
|
8
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9
|
-
target[key] = source[key];
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return target;
|
|
14
|
-
};
|
|
15
|
-
return _extends.apply(this, arguments);
|
|
16
|
-
}
|
|
17
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
18
|
-
if (!o) return;
|
|
19
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
20
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
21
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
22
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
23
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
24
|
-
}
|
|
25
|
-
function _arrayLikeToArray(arr, len) {
|
|
26
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
27
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
28
|
-
return arr2;
|
|
29
|
-
}
|
|
30
|
-
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
31
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
32
|
-
if (it) return (it = it.call(o)).next.bind(it);
|
|
33
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
34
|
-
if (it) o = it;
|
|
35
|
-
var i = 0;
|
|
36
|
-
return function () {
|
|
37
|
-
if (i >= o.length) return {
|
|
38
|
-
done: true
|
|
39
|
-
};
|
|
40
|
-
return {
|
|
41
|
-
done: false,
|
|
42
|
-
value: o[i++]
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* @license
|
|
51
|
-
* Copyright 2018 Google LLC
|
|
52
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
53
|
-
*/
|
|
54
|
-
var e = new Set(["children", "localName", "ref", "style", "className"]),
|
|
55
|
-
n = new WeakMap(),
|
|
56
|
-
t = function t(e, _t, o, l, a) {
|
|
57
|
-
var s = a == null ? void 0 : a[_t];
|
|
58
|
-
void 0 === s ? (e[_t] = o, null == o && _t in HTMLElement.prototype && e.removeAttribute(_t)) : o !== l && function (e, t, o) {
|
|
59
|
-
var l = n.get(e);
|
|
60
|
-
void 0 === l && n.set(e, l = new Map());
|
|
61
|
-
var a = l.get(t);
|
|
62
|
-
void 0 !== o ? void 0 === a ? (l.set(t, a = {
|
|
63
|
-
handleEvent: o
|
|
64
|
-
}), e.addEventListener(t, a)) : a.handleEvent = o : void 0 !== a && (l["delete"](t), e.removeEventListener(t, a));
|
|
65
|
-
}(e, s, o);
|
|
66
|
-
},
|
|
67
|
-
o = function o(_ref) {
|
|
68
|
-
var n = _ref.react,
|
|
69
|
-
o = _ref.tagName,
|
|
70
|
-
l = _ref.elementClass,
|
|
71
|
-
a = _ref.events,
|
|
72
|
-
s = _ref.displayName;
|
|
73
|
-
var c = new Set(Object.keys(a != null ? a : {})),
|
|
74
|
-
r = n.forwardRef(function (s, r) {
|
|
75
|
-
var i = n.useRef(new Map()),
|
|
76
|
-
d = n.useRef(null),
|
|
77
|
-
f = {},
|
|
78
|
-
u = {};
|
|
79
|
-
for (var _i = 0, _Object$entries = Object.entries(s); _i < _Object$entries.length; _i++) {
|
|
80
|
-
var _Object$entries$_i = _Object$entries[_i],
|
|
81
|
-
_n = _Object$entries$_i[0],
|
|
82
|
-
_t2 = _Object$entries$_i[1];
|
|
83
|
-
e.has(_n) ? f["className" === _n ? "class" : _n] = _t2 : c.has(_n) || _n in l.prototype ? u[_n] = _t2 : f[_n] = _t2;
|
|
84
|
-
}
|
|
85
|
-
return n.useLayoutEffect(function () {
|
|
86
|
-
if (null === d.current) return;
|
|
87
|
-
var e = new Map();
|
|
88
|
-
for (var _n2 in u) t(d.current, _n2, s[_n2], i.current.get(_n2), a), i.current["delete"](_n2), e.set(_n2, s[_n2]);
|
|
89
|
-
for (var _iterator = _createForOfIteratorHelperLoose(i.current), _step; !(_step = _iterator()).done;) {
|
|
90
|
-
var _step$value = _step.value,
|
|
91
|
-
_e = _step$value[0],
|
|
92
|
-
_n3 = _step$value[1];
|
|
93
|
-
t(d.current, _e, void 0, _n3, a);
|
|
94
|
-
}
|
|
95
|
-
i.current = e;
|
|
96
|
-
}), n.useLayoutEffect(function () {
|
|
97
|
-
var _d$current;
|
|
98
|
-
(_d$current = d.current) == null || _d$current.removeAttribute("defer-hydration");
|
|
99
|
-
}, []), f.suppressHydrationWarning = !0, n.createElement(o, _extends({}, f, {
|
|
100
|
-
ref: n.useCallback(function (e) {
|
|
101
|
-
d.current = e, "function" == typeof r ? r(e) : null !== r && (r.current = e);
|
|
102
|
-
}, [r])
|
|
103
|
-
}));
|
|
104
|
-
});
|
|
105
|
-
return r.displayName = s != null ? s : l.name, r;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
const createComponent = ({ subComponents, ...options }) => {
|
|
109
|
-
const ReactComponent = o({
|
|
110
|
-
react: React,
|
|
111
|
-
...options,
|
|
112
|
-
});
|
|
113
|
-
const ComponentWithSubComponents = ReactComponent;
|
|
114
|
-
if (subComponents) {
|
|
115
|
-
Object.assign(ComponentWithSubComponents, subComponents);
|
|
116
|
-
}
|
|
117
|
-
return ComponentWithSubComponents;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
export { createComponent as c };
|
package/dist/dialog.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { D as Dialog } from './Dialog-BXmQb7iZ.js';
|
|
2
|
-
export { DIALOG_SIZES, DIALOG_VARIANTS, Dialog as WCDialog, DialogActionPrimary as WCDialogActionPrimary, DialogActionSecondary as WCDialogActionSecondary, DialogActionTertiary as WCDialogActionTertiary, DialogActions as WCDialogActions, DialogBody as WCDialogBody, DialogClose as WCDialogClose, DialogFooter as WCDialogFooter, DialogHeader as WCDialogHeader } from '@loadsmart/miranda-wc';
|
|
3
|
-
import './createComponent-Cye6h9wF.js';
|
|
4
|
-
import 'react';
|
|
5
|
-
import 'react/jsx-runtime';
|
package/dist/divider.js
DELETED
package/dist/drawer.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { D as Drawer } from './Drawer-DAL5BRMS.js';
|
|
2
|
-
export { DRAWER_SIZES, Drawer as WCDrawer, DrawerActionPrimary as WCDrawerActionPrimary, DrawerActionSecondary as WCDrawerActionSecondary, DrawerActionTertiary as WCDrawerActionTertiary, DrawerActions as WCDrawerActions, DrawerBody as WCDrawerBody, DrawerClose as WCDrawerClose, DrawerHeader as WCDrawerHeader } from '@loadsmart/miranda-wc';
|
|
3
|
-
import './createComponent-Cye6h9wF.js';
|
|
4
|
-
import 'react';
|
|
5
|
-
import 'react/jsx-runtime';
|
package/dist/dropdown.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { D as Dropdown, b as DropdownItem, a as DropdownMenu, c as DropdownTrigger } from './Dropdown-BZq7wxH2.js';
|
|
2
|
-
export { Dropdown as WCDropdown, DropdownItem as WCDropdownItem, DropdownMenu as WCDropdownMenu, DropdownTrigger as WCDropdownTrigger } from '@loadsmart/miranda-wc';
|
|
3
|
-
import './createComponent-Cye6h9wF.js';
|
|
4
|
-
import 'react';
|
|
5
|
-
import 'react/jsx-runtime';
|
package/dist/emptystate.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { E as EmptyState } from './EmptyState-N_H8UALy.js';
|
|
2
|
-
export { EMPTY_STATE_VARIANTS, EmptyState as WCEmptyState, EmptyStateAction as WCEmptyStateAction, EmptyStateHeader as WCEmptyStateHeader, EmptyStateIllustration as WCEmptyStateIllustration, EmptyStateMessage as WCEmptyStateMessage } from '@loadsmart/miranda-wc';
|
|
3
|
-
import './createComponent-Cye6h9wF.js';
|
|
4
|
-
import 'react';
|
|
5
|
-
import 'react/jsx-runtime';
|
package/dist/field.js
DELETED
package/dist/header.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { H as Header, a as HeaderActions, b as HeaderTitle, S as SubHeader } from './Header-BVVroF-a.js';
|
|
2
|
-
export { Header as WCHeader, HeaderActions as WCHeaderActions, HeaderContent as WCHeaderContent, HeaderTitle as WCHeaderTitle, SubHeader as WCSubHeader } from '@loadsmart/miranda-wc';
|
|
3
|
-
import './createComponent-Cye6h9wF.js';
|
|
4
|
-
import 'react';
|
package/dist/icon.js
DELETED
package/dist/labeledvalue.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { b as LabeledValue, L as LabeledValueLabel, a as LabeledValueValue } from './LabeledValue-BEj3zEk5.js';
|
|
2
|
-
export { LabeledValue as WCLabeledValue, LabeledValueLabel as WCLabeledValueLabel, LabeledValueValue as WCLabeledValueValue } from '@loadsmart/miranda-wc';
|
|
3
|
-
import 'react/jsx-runtime';
|
|
4
|
-
import 'react';
|
|
5
|
-
import './createComponent-Cye6h9wF.js';
|
package/dist/layout.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { B as Box, C as Column, d as Container, a as Grid, G as Group, L as Layout, R as Row, b as Sidebar, S as Stack, c as Switcher } from './Layout-yKvtIEmV.js';
|
|
2
|
-
export { Box as WCBox, Column as WCColumn, Container as WCContainer, Grid as WCGrid, Group as WCGroup, Row as WCRow, Sidebar as WCSidebar, Stack as WCStack, Switcher as WCSwitcher } from '@loadsmart/miranda-wc';
|
|
3
|
-
import './createComponent-Cye6h9wF.js';
|
|
4
|
-
import 'react';
|
|
5
|
-
import 'react/jsx-runtime';
|
package/dist/link.js
DELETED
package/dist/logoloader.js
DELETED
package/dist/pagecontent.js
DELETED
package/dist/pagination.js
DELETED
package/dist/progressbar.js
DELETED
package/dist/radiogroup.js
DELETED
package/dist/section.js
DELETED
package/dist/spinnerwheel.js
DELETED
package/dist/steps.js
DELETED
package/dist/switch.js
DELETED
package/dist/table.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { T as Table, i as TableActions, b as TableBody, f as TableCell, h as TableFeedback, c as TableFoot, a as TableHead, e as TableHeadCell, d as TableRow, g as TableToolbar } from './Table-DlnVsR0p.js';
|
|
2
|
-
export { Table as WCTable, TableActions as WCTableActions, TableBody as WCTableBody, TableCell as WCTableCell, TableFeedback as WCTableFeedback, TableFoot as WCTableFoot, TableHead as WCTableHead, TableHeadCell as WCTableHeadCell, TableRow as WCTableRow, TableToolbar as WCTableToolbar } from '@loadsmart/miranda-wc';
|
|
3
|
-
import './createComponent-Cye6h9wF.js';
|
|
4
|
-
import 'react';
|
package/dist/tabs.js
DELETED
package/dist/tag.js
DELETED
package/dist/text.js
DELETED
package/dist/textarea.js
DELETED
package/dist/textfield.js
DELETED
package/dist/timeline.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { T as Timeline, b as TimelineExpandableItem, a as TimelineItem, c as TimelineItemBody, d as TimelineItemFooter, e as TimelineItemHeader, f as TimelineItemHeaderSubtitle, g as TimelineItemHeaderTitle, h as TimelineItemIcon } from './Timeline-MCAixOaW.js';
|
|
2
|
-
export { Timeline as WCTimeline, TimelineExpandableItem as WCTimelineExpandableItem, TimelineItem as WCTimelineItem, TimelineItemBody as WCTimelineItemBody, TimelineItemFooter as WCTimelineItemFooter, TimelineItemHeader as WCTimelineItemHeader, TimelineItemHeaderSubtitle as WCTimelineItemHeaderSubtitle, TimelineItemHeaderTitle as WCTimelineItemHeaderTitle, TimelineItemIcon as WCTimelineItemIcon } from '@loadsmart/miranda-wc';
|
|
3
|
-
import './createComponent-Cye6h9wF.js';
|
|
4
|
-
import 'react';
|
package/dist/togglegroup.js
DELETED
package/dist/tooltip.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { Step as Step$1, Steps as Steps$1 } from '@loadsmart/miranda-wc';
|
|
2
|
-
import { c as createComponent } from './createComponent-Cye6h9wF.js';
|
|
3
|
-
import { useState, useCallback } from 'react';
|
|
4
|
-
|
|
5
|
-
const Step = createComponent({
|
|
6
|
-
tagName: 'm-step',
|
|
7
|
-
elementClass: Step$1,
|
|
8
|
-
displayName: 'Step',
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
const Steps = createComponent({
|
|
12
|
-
tagName: 'm-steps',
|
|
13
|
-
elementClass: Steps$1,
|
|
14
|
-
displayName: 'Steps',
|
|
15
|
-
events: {
|
|
16
|
-
onChange: 'm-change',
|
|
17
|
-
onComplete: 'm-complete',
|
|
18
|
-
onNavigate: 'm-navigate',
|
|
19
|
-
onNext: 'm-next',
|
|
20
|
-
onPrevious: 'm-previous',
|
|
21
|
-
},
|
|
22
|
-
subComponents: {
|
|
23
|
-
Step,
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
function createCustomEvent(eventName, detail) {
|
|
28
|
-
const event = new CustomEvent(eventName, {
|
|
29
|
-
bubbles: true,
|
|
30
|
-
detail,
|
|
31
|
-
});
|
|
32
|
-
return event;
|
|
33
|
-
}
|
|
34
|
-
function useSteps() {
|
|
35
|
-
const [stepsElement, setStepsElement] = useState(null);
|
|
36
|
-
const registerSteps = useCallback(() => {
|
|
37
|
-
return {
|
|
38
|
-
ref(element) {
|
|
39
|
-
if (element == null || stepsElement != null) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
setStepsElement(element);
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
}, [stepsElement]);
|
|
46
|
-
const navigateToStep = useCallback(
|
|
47
|
-
/**
|
|
48
|
-
* Either `'previous'`, `'next'`, or step name.
|
|
49
|
-
*/
|
|
50
|
-
(step) => {
|
|
51
|
-
if (stepsElement == null) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const navigateToNextStep = () => {
|
|
55
|
-
return createCustomEvent('m-next');
|
|
56
|
-
};
|
|
57
|
-
const navigateToPreviousStep = () => {
|
|
58
|
-
return createCustomEvent('m-previous');
|
|
59
|
-
};
|
|
60
|
-
let event;
|
|
61
|
-
switch (step) {
|
|
62
|
-
case 'next':
|
|
63
|
-
event = navigateToNextStep();
|
|
64
|
-
break;
|
|
65
|
-
case 'previous':
|
|
66
|
-
event = navigateToPreviousStep();
|
|
67
|
-
break;
|
|
68
|
-
default:
|
|
69
|
-
event = createCustomEvent('m-navigate', step);
|
|
70
|
-
}
|
|
71
|
-
stepsElement.dispatchEvent(event);
|
|
72
|
-
}, [stepsElement]);
|
|
73
|
-
const completeStep = useCallback(() => {
|
|
74
|
-
if (stepsElement == null) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
const event = createCustomEvent('m-complete');
|
|
78
|
-
stepsElement.dispatchEvent(event);
|
|
79
|
-
}, [stepsElement]);
|
|
80
|
-
return {
|
|
81
|
-
elementRef: stepsElement,
|
|
82
|
-
registerSteps,
|
|
83
|
-
navigateToStep,
|
|
84
|
-
completeStep,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export { Steps as S, Step as a, useSteps as u };
|