@maif/react-forms 1.0.12 → 1.0.13
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/react-form.js +1 -1
- package/lib/form.js +30 -0
- package/package.json +1 -1
package/lib/form.js
CHANGED
|
@@ -345,6 +345,10 @@ var Form = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
|
345
345
|
case 'object':
|
|
346
346
|
var _value = watch(step.visible.ref);
|
|
347
347
|
|
|
348
|
+
console.log({
|
|
349
|
+
value: _value,
|
|
350
|
+
step: step
|
|
351
|
+
});
|
|
348
352
|
return (0, _Option.option)(step.visible.test).map(function (test) {
|
|
349
353
|
return test(_value);
|
|
350
354
|
}).getOrElse(_value);
|
|
@@ -478,6 +482,32 @@ var Step = function Step(_ref4) {
|
|
|
478
482
|
}));
|
|
479
483
|
}
|
|
480
484
|
|
|
485
|
+
var visibleStep = (0, _Option.option)(step).map(function (s) {
|
|
486
|
+
return s.visible;
|
|
487
|
+
}).map(function (visible) {
|
|
488
|
+
switch (_typeof(visible)) {
|
|
489
|
+
case 'object':
|
|
490
|
+
var value = watch(step.visible.ref);
|
|
491
|
+
console.log({
|
|
492
|
+
value: value,
|
|
493
|
+
step: step
|
|
494
|
+
});
|
|
495
|
+
return (0, _Option.option)(step.visible.test).map(function (test) {
|
|
496
|
+
return test(value);
|
|
497
|
+
}).getOrElse(value);
|
|
498
|
+
|
|
499
|
+
case 'boolean':
|
|
500
|
+
return visible;
|
|
501
|
+
|
|
502
|
+
default:
|
|
503
|
+
return true;
|
|
504
|
+
}
|
|
505
|
+
}).getOrElse(true);
|
|
506
|
+
|
|
507
|
+
if (!visibleStep) {
|
|
508
|
+
return null;
|
|
509
|
+
}
|
|
510
|
+
|
|
481
511
|
if (step.array) {
|
|
482
512
|
return /*#__PURE__*/_react["default"].createElement(ArrayStep, {
|
|
483
513
|
entry: entry,
|