@cloudflare/component-multistep-modal 5.0.0 → 5.0.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/CHANGELOG.md +14 -0
- package/es/MultistepModal.js +3 -10
- package/lib/MultistepModal.js +11 -38
- package/package.json +4 -4
- package/src/MultistepModal.tsx +1 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 5.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @cloudflare/component-button@8.5.11
|
|
8
|
+
- @cloudflare/component-modal@8.0.35
|
|
9
|
+
- @cloudflare/component-progress@9.0.40
|
|
10
|
+
|
|
11
|
+
## 5.0.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- b30668d911: Modified MultiStep Modal to not call the nextOnClick callback when cancelOnClick is activated
|
|
16
|
+
|
|
3
17
|
## 5.0.0
|
|
4
18
|
|
|
5
19
|
### Major Changes
|
package/es/MultistepModal.js
CHANGED
|
@@ -147,16 +147,9 @@ class MultistepModal extends React.Component {
|
|
|
147
147
|
if (onCancelClickBehaviour === OnCancelClickBehaviour.ADVANCE) {
|
|
148
148
|
onNextStep && onNextStep(step + 1);
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
step: step + 1
|
|
154
|
-
});
|
|
155
|
-
} else {
|
|
156
|
-
_this.setState({
|
|
157
|
-
step: step + 1
|
|
158
|
-
});
|
|
159
|
-
} // Go back to the previous Step
|
|
150
|
+
_this.setState({
|
|
151
|
+
step: step + 1
|
|
152
|
+
}); // Go back to the previous Step
|
|
160
153
|
|
|
161
154
|
} else if (onCancelClickBehaviour === OnCancelClickBehaviour.BACK) {
|
|
162
155
|
onPrevStep && onPrevStep(step - 1);
|
package/lib/MultistepModal.js
CHANGED
|
@@ -204,13 +204,12 @@ var MultistepModal = /*#__PURE__*/function (_React$Component) {
|
|
|
204
204
|
}, !hideCancel && /*#__PURE__*/_react.default.createElement(_componentButton.Button, {
|
|
205
205
|
type: "default",
|
|
206
206
|
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
207
|
-
var res;
|
|
208
207
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
209
208
|
while (1) {
|
|
210
209
|
switch (_context.prev = _context.next) {
|
|
211
210
|
case 0:
|
|
212
211
|
if (!cancelOnClick) {
|
|
213
|
-
_context.next =
|
|
212
|
+
_context.next = 6;
|
|
214
213
|
break;
|
|
215
214
|
}
|
|
216
215
|
|
|
@@ -218,40 +217,15 @@ var MultistepModal = /*#__PURE__*/function (_React$Component) {
|
|
|
218
217
|
return cancelOnClick();
|
|
219
218
|
|
|
220
219
|
case 3:
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
onNextStep && onNextStep(step + 1);
|
|
227
|
-
|
|
228
|
-
if (!nextOnClick) {
|
|
229
|
-
_context.next = 12;
|
|
230
|
-
break;
|
|
231
|
-
}
|
|
220
|
+
// Advance to the next Step
|
|
221
|
+
if (onCancelClickBehaviour === _types.OnCancelClickBehaviour.ADVANCE) {
|
|
222
|
+
onNextStep && onNextStep(step + 1);
|
|
232
223
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
case 8:
|
|
237
|
-
res = _context.sent;
|
|
238
|
-
res && _this2.setState({
|
|
239
|
-
step: step + 1
|
|
240
|
-
});
|
|
241
|
-
_context.next = 13;
|
|
242
|
-
break;
|
|
243
|
-
|
|
244
|
-
case 12:
|
|
245
|
-
_this2.setState({
|
|
246
|
-
step: step + 1
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
case 13:
|
|
250
|
-
_context.next = 16;
|
|
251
|
-
break;
|
|
224
|
+
_this2.setState({
|
|
225
|
+
step: step + 1
|
|
226
|
+
}); // Go back to the previous Step
|
|
252
227
|
|
|
253
|
-
|
|
254
|
-
if (onCancelClickBehaviour === _types.OnCancelClickBehaviour.BACK) {
|
|
228
|
+
} else if (onCancelClickBehaviour === _types.OnCancelClickBehaviour.BACK) {
|
|
255
229
|
onPrevStep && onPrevStep(step - 1);
|
|
256
230
|
|
|
257
231
|
_this2.setState({
|
|
@@ -262,14 +236,13 @@ var MultistepModal = /*#__PURE__*/function (_React$Component) {
|
|
|
262
236
|
onClose();
|
|
263
237
|
}
|
|
264
238
|
|
|
265
|
-
|
|
266
|
-
_context.next = 19;
|
|
239
|
+
_context.next = 7;
|
|
267
240
|
break;
|
|
268
241
|
|
|
269
|
-
case
|
|
242
|
+
case 6:
|
|
270
243
|
onClose();
|
|
271
244
|
|
|
272
|
-
case
|
|
245
|
+
case 7:
|
|
273
246
|
case "end":
|
|
274
247
|
return _context.stop();
|
|
275
248
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/component-multistep-modal",
|
|
3
3
|
"description": "Multistep modal with a progress bar",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.2",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
7
7
|
"author": "Vojtech Miksu <vojtech@cloudflare.com>",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@cloudflare/component-box": "^4.0.6",
|
|
17
|
-
"@cloudflare/component-button": "^8.5.
|
|
18
|
-
"@cloudflare/component-modal": "^8.0.
|
|
19
|
-
"@cloudflare/component-progress": "^9.0.
|
|
17
|
+
"@cloudflare/component-button": "^8.5.11",
|
|
18
|
+
"@cloudflare/component-modal": "^8.0.35",
|
|
19
|
+
"@cloudflare/component-progress": "^9.0.40",
|
|
20
20
|
"@cloudflare/component-test-dummy": "^4.0.6",
|
|
21
21
|
"@cloudflare/intl-react": "^1.9.80",
|
|
22
22
|
"prop-types": "^15.6.0"
|
package/src/MultistepModal.tsx
CHANGED
|
@@ -185,12 +185,7 @@ class MultistepModal extends React.Component<IMultistepModalProps> {
|
|
|
185
185
|
OnCancelClickBehaviour.ADVANCE
|
|
186
186
|
) {
|
|
187
187
|
onNextStep && onNextStep(step + 1);
|
|
188
|
-
|
|
189
|
-
const res = await nextOnClick();
|
|
190
|
-
res && this.setState({ step: step + 1 });
|
|
191
|
-
} else {
|
|
192
|
-
this.setState({ step: step + 1 });
|
|
193
|
-
}
|
|
188
|
+
this.setState({ step: step + 1 });
|
|
194
189
|
// Go back to the previous Step
|
|
195
190
|
} else if (
|
|
196
191
|
onCancelClickBehaviour === OnCancelClickBehaviour.BACK
|