@maif/react-forms 1.0.47 → 1.0.50
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/lib/esm/index.js +65 -32
- package/lib/index.js +65 -32
- package/package.json +1 -1
package/lib/esm/index.js
CHANGED
|
@@ -848,7 +848,7 @@ var Collapse = function Collapse(props) {
|
|
|
848
848
|
var classes = useCustomStyle();
|
|
849
849
|
|
|
850
850
|
var toggle = function toggle(e) {
|
|
851
|
-
if (e && e.preventDefault) e.
|
|
851
|
+
if (e && e.preventDefault) e.stopPropagation();
|
|
852
852
|
setCollapsed(!collapsed);
|
|
853
853
|
};
|
|
854
854
|
|
|
@@ -861,7 +861,7 @@ var Collapse = function Collapse(props) {
|
|
|
861
861
|
className: classNames(classes.collapse_label, _defineProperty$1({}, classes.collapse_error, props.errored))
|
|
862
862
|
}, props.label), /*#__PURE__*/React.createElement("button", {
|
|
863
863
|
type: "button",
|
|
864
|
-
className: classNames(classes.btn, classes.btn_sm, _defineProperty$1({}, classes.collapse_error, props.errored)),
|
|
864
|
+
className: classNames(classes.btn, classes.btn_sm, classes.ml_5, _defineProperty$1({}, classes.collapse_error, props.errored)),
|
|
865
865
|
onClick: toggle
|
|
866
866
|
}, !!collapsed && /*#__PURE__*/React.createElement(Eye, {
|
|
867
867
|
size: 16
|
|
@@ -28504,6 +28504,13 @@ function CodeInput(_ref) {
|
|
|
28504
28504
|
e.stopImmediatePropagation();
|
|
28505
28505
|
});
|
|
28506
28506
|
if (setRef) setRef(e);
|
|
28507
|
+
e.dispatch({
|
|
28508
|
+
changes: {
|
|
28509
|
+
from: 0,
|
|
28510
|
+
to: e.state.doc.length,
|
|
28511
|
+
insert: value === null || value === undefined ? '' : _typeof$1(value) === 'object' ? JSON.stringify(value, null, 2) : value
|
|
28512
|
+
}
|
|
28513
|
+
});
|
|
28507
28514
|
setEditor(e);
|
|
28508
28515
|
}, []);
|
|
28509
28516
|
useEffect(function () {
|
|
@@ -29274,6 +29281,11 @@ var Form = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
|
|
|
29274
29281
|
});
|
|
29275
29282
|
};
|
|
29276
29283
|
|
|
29284
|
+
var _useState = useState(false),
|
|
29285
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29286
|
+
expandedAll = _useState2[0],
|
|
29287
|
+
setExpandedAll = _useState2[1];
|
|
29288
|
+
|
|
29277
29289
|
var defaultValues = getDefaultValues(formFlow, schema, value); //FIXME: get real schema through the switch
|
|
29278
29290
|
|
|
29279
29291
|
var _resolver = function resolver(rawData) {
|
|
@@ -29293,10 +29305,10 @@ var Form = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
|
|
|
29293
29305
|
mode: 'onChange'
|
|
29294
29306
|
});
|
|
29295
29307
|
|
|
29296
|
-
var
|
|
29297
|
-
|
|
29298
|
-
initialReseted =
|
|
29299
|
-
setReset =
|
|
29308
|
+
var _useState3 = useState(false),
|
|
29309
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29310
|
+
initialReseted = _useState4[0],
|
|
29311
|
+
setReset = _useState4[1];
|
|
29300
29312
|
|
|
29301
29313
|
useEffect(function () {
|
|
29302
29314
|
_reset(cleanInputArray(value, defaultValues, flow, schema));
|
|
@@ -29342,7 +29354,11 @@ var Form = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
|
|
|
29342
29354
|
}, onError)();
|
|
29343
29355
|
},
|
|
29344
29356
|
trigger: trigger,
|
|
29345
|
-
methods: methods
|
|
29357
|
+
methods: _objectSpread2$1(_objectSpread2$1({}, methods), {}, {
|
|
29358
|
+
data: function data() {
|
|
29359
|
+
return cleanOutputArray(getValues(), schema);
|
|
29360
|
+
}
|
|
29361
|
+
})
|
|
29346
29362
|
};
|
|
29347
29363
|
});
|
|
29348
29364
|
return /*#__PURE__*/React.createElement(FormProvider, methods, /*#__PURE__*/React.createElement(Watcher, {
|
|
@@ -29358,7 +29374,19 @@ var Form = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
|
|
|
29358
29374
|
var clean = cleanOutputArray(data, schema);
|
|
29359
29375
|
onSubmit(clean);
|
|
29360
29376
|
}, onError)
|
|
29361
|
-
},
|
|
29377
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
29378
|
+
className: classNames(classes.flex, classes.mt_20)
|
|
29379
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
29380
|
+
type: "button",
|
|
29381
|
+
className: classNames(classes.btn, classes.btn_sm),
|
|
29382
|
+
style: {
|
|
29383
|
+
marginLeft: 'auto'
|
|
29384
|
+
},
|
|
29385
|
+
onClick: function onClick(e) {
|
|
29386
|
+
if (e) e.stopPropagation();
|
|
29387
|
+
setExpandedAll(!expandedAll);
|
|
29388
|
+
}
|
|
29389
|
+
}, expandedAll ? 'Expand all' : 'Collapse all')), formFlow.map(function (entry, idx) {
|
|
29362
29390
|
var step = schema[entry];
|
|
29363
29391
|
|
|
29364
29392
|
if (!step && typeof entry === 'string') {
|
|
@@ -29406,7 +29434,8 @@ var Form = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
|
|
|
29406
29434
|
schema: schema,
|
|
29407
29435
|
inputWrapper: inputWrapper,
|
|
29408
29436
|
httpClient: maybeCustomHttpClient,
|
|
29409
|
-
functionalProperty: functionalProperty
|
|
29437
|
+
functionalProperty: functionalProperty,
|
|
29438
|
+
expandedAll: expandedAll
|
|
29410
29439
|
}));
|
|
29411
29440
|
}), /*#__PURE__*/React.createElement(Footer, {
|
|
29412
29441
|
render: footer,
|
|
@@ -29464,7 +29493,8 @@ var Step = function Step(_ref8) {
|
|
|
29464
29493
|
index = _ref8.index,
|
|
29465
29494
|
functionalProperty = _ref8.functionalProperty,
|
|
29466
29495
|
parent = _ref8.parent,
|
|
29467
|
-
onAfterChange = _ref8.onAfterChange
|
|
29496
|
+
onAfterChange = _ref8.onAfterChange,
|
|
29497
|
+
expandedAll = _ref8.expandedAll;
|
|
29468
29498
|
var classes = useCustomStyle();
|
|
29469
29499
|
|
|
29470
29500
|
var _useFormContext2 = useFormContext(),
|
|
@@ -29529,6 +29559,7 @@ var Step = function Step(_ref8) {
|
|
|
29529
29559
|
entry: en,
|
|
29530
29560
|
step: stp,
|
|
29531
29561
|
schema: schema,
|
|
29562
|
+
expandedAll: expandedAll,
|
|
29532
29563
|
inputWrapper: inputWrapper,
|
|
29533
29564
|
httpClient: httpClient,
|
|
29534
29565
|
defaultValue: stp === null || stp === void 0 ? void 0 : stp.defaultValue,
|
|
@@ -29606,7 +29637,8 @@ var Step = function Step(_ref8) {
|
|
|
29606
29637
|
defaultValue: (_props$defaultValue = props.defaultValue) === null || _props$defaultValue === void 0 ? void 0 : _props$defaultValue.value,
|
|
29607
29638
|
value: props.value,
|
|
29608
29639
|
index: idx,
|
|
29609
|
-
functionalProperty: functionalProperty
|
|
29640
|
+
functionalProperty: functionalProperty,
|
|
29641
|
+
expandedAll: expandedAll
|
|
29610
29642
|
});
|
|
29611
29643
|
}
|
|
29612
29644
|
}));
|
|
@@ -29772,7 +29804,8 @@ var Step = function Step(_ref8) {
|
|
|
29772
29804
|
value: getValues(entry) || defaultValue,
|
|
29773
29805
|
index: index,
|
|
29774
29806
|
functionalProperty: functionalProperty,
|
|
29775
|
-
errorDisplayed: errorDisplayed
|
|
29807
|
+
errorDisplayed: errorDisplayed,
|
|
29808
|
+
expandedAll: expandedAll
|
|
29776
29809
|
}));
|
|
29777
29810
|
|
|
29778
29811
|
case format.code:
|
|
@@ -29841,15 +29874,15 @@ var Step = function Step(_ref8) {
|
|
|
29841
29874
|
var FileInput = function FileInput(_ref10) {
|
|
29842
29875
|
var onChange = _ref10.onChange;
|
|
29843
29876
|
|
|
29844
|
-
var
|
|
29845
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
29846
|
-
uploading = _useState4[0],
|
|
29847
|
-
setUploading = _useState4[1];
|
|
29848
|
-
|
|
29849
|
-
var _useState5 = useState(undefined),
|
|
29877
|
+
var _useState5 = useState(false),
|
|
29850
29878
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
29851
|
-
|
|
29852
|
-
|
|
29879
|
+
uploading = _useState6[0],
|
|
29880
|
+
setUploading = _useState6[1];
|
|
29881
|
+
|
|
29882
|
+
var _useState7 = useState(undefined),
|
|
29883
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
29884
|
+
input = _useState8[0],
|
|
29885
|
+
setInput = _useState8[1];
|
|
29853
29886
|
|
|
29854
29887
|
var setFiles = function setFiles(e) {
|
|
29855
29888
|
var files = e.target.files;
|
|
@@ -30027,7 +30060,8 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30027
30060
|
value = _ref12.value,
|
|
30028
30061
|
step = _ref12.step,
|
|
30029
30062
|
functionalProperty = _ref12.functionalProperty,
|
|
30030
|
-
index = _ref12.index
|
|
30063
|
+
index = _ref12.index,
|
|
30064
|
+
expandedAll = _ref12.expandedAll;
|
|
30031
30065
|
|
|
30032
30066
|
var _useFormContext4 = useFormContext(),
|
|
30033
30067
|
getValues = _useFormContext4.getValues,
|
|
@@ -30036,17 +30070,15 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30036
30070
|
_useFormContext4.trigger;
|
|
30037
30071
|
_useFormContext4.formState;
|
|
30038
30072
|
|
|
30039
|
-
var
|
|
30040
|
-
|
|
30041
|
-
collapsed =
|
|
30042
|
-
setCollapsed =
|
|
30043
|
-
|
|
30044
|
-
var classes = useCustomStyle(); // TODO - voir ce qui se passe et à quoi ça sert
|
|
30045
|
-
// const v = getValues(parent);
|
|
30046
|
-
// useEffect(() => {
|
|
30047
|
-
// trigger(parent)
|
|
30048
|
-
// }, [JSON.stringify(v)])
|
|
30073
|
+
var _useState9 = useState(!!step.collapsed),
|
|
30074
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
30075
|
+
collapsed = _useState10[0],
|
|
30076
|
+
setCollapsed = _useState10[1];
|
|
30049
30077
|
|
|
30078
|
+
var classes = useCustomStyle();
|
|
30079
|
+
useEffect(function () {
|
|
30080
|
+
if (!expandedAll || expandedAll && parent.split('.').length >= 2) setCollapsed(expandedAll);
|
|
30081
|
+
}, [expandedAll]);
|
|
30050
30082
|
var schemaAndFlow = option(step.conditionalSchema).map(function (condiSchema) {
|
|
30051
30083
|
var ref = option(condiSchema.ref).map(function (ref) {
|
|
30052
30084
|
return getValues(ref);
|
|
@@ -30165,7 +30197,8 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30165
30197
|
inputWrapper: inputWrapper,
|
|
30166
30198
|
httpClient: maybeCustomHttpClient,
|
|
30167
30199
|
defaultValue: value && value[entry],
|
|
30168
|
-
functionalProperty: functionalProperty
|
|
30200
|
+
functionalProperty: functionalProperty,
|
|
30201
|
+
expandedAll: expandedAll
|
|
30169
30202
|
}));
|
|
30170
30203
|
}));
|
|
30171
30204
|
};
|
package/lib/index.js
CHANGED
|
@@ -882,7 +882,7 @@ var Collapse = function Collapse(props) {
|
|
|
882
882
|
var classes = useCustomStyle();
|
|
883
883
|
|
|
884
884
|
var toggle = function toggle(e) {
|
|
885
|
-
if (e && e.preventDefault) e.
|
|
885
|
+
if (e && e.preventDefault) e.stopPropagation();
|
|
886
886
|
setCollapsed(!collapsed);
|
|
887
887
|
};
|
|
888
888
|
|
|
@@ -895,7 +895,7 @@ var Collapse = function Collapse(props) {
|
|
|
895
895
|
className: classNames__default["default"](classes.collapse_label, _defineProperty$1({}, classes.collapse_error, props.errored))
|
|
896
896
|
}, props.label), /*#__PURE__*/React__default["default"].createElement("button", {
|
|
897
897
|
type: "button",
|
|
898
|
-
className: classNames__default["default"](classes.btn, classes.btn_sm, _defineProperty$1({}, classes.collapse_error, props.errored)),
|
|
898
|
+
className: classNames__default["default"](classes.btn, classes.btn_sm, classes.ml_5, _defineProperty$1({}, classes.collapse_error, props.errored)),
|
|
899
899
|
onClick: toggle
|
|
900
900
|
}, !!collapsed && /*#__PURE__*/React__default["default"].createElement(reactFeather.Eye, {
|
|
901
901
|
size: 16
|
|
@@ -28538,6 +28538,13 @@ function CodeInput(_ref) {
|
|
|
28538
28538
|
e.stopImmediatePropagation();
|
|
28539
28539
|
});
|
|
28540
28540
|
if (setRef) setRef(e);
|
|
28541
|
+
e.dispatch({
|
|
28542
|
+
changes: {
|
|
28543
|
+
from: 0,
|
|
28544
|
+
to: e.state.doc.length,
|
|
28545
|
+
insert: value === null || value === undefined ? '' : _typeof$1(value) === 'object' ? JSON.stringify(value, null, 2) : value
|
|
28546
|
+
}
|
|
28547
|
+
});
|
|
28541
28548
|
setEditor(e);
|
|
28542
28549
|
}, []);
|
|
28543
28550
|
React.useEffect(function () {
|
|
@@ -29308,6 +29315,11 @@ var Form = /*#__PURE__*/React__default["default"].forwardRef(function (_ref7, re
|
|
|
29308
29315
|
});
|
|
29309
29316
|
};
|
|
29310
29317
|
|
|
29318
|
+
var _useState = React.useState(false),
|
|
29319
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29320
|
+
expandedAll = _useState2[0],
|
|
29321
|
+
setExpandedAll = _useState2[1];
|
|
29322
|
+
|
|
29311
29323
|
var defaultValues = getDefaultValues(formFlow, schema, value); //FIXME: get real schema through the switch
|
|
29312
29324
|
|
|
29313
29325
|
var _resolver = function resolver(rawData) {
|
|
@@ -29327,10 +29339,10 @@ var Form = /*#__PURE__*/React__default["default"].forwardRef(function (_ref7, re
|
|
|
29327
29339
|
mode: 'onChange'
|
|
29328
29340
|
});
|
|
29329
29341
|
|
|
29330
|
-
var
|
|
29331
|
-
|
|
29332
|
-
initialReseted =
|
|
29333
|
-
setReset =
|
|
29342
|
+
var _useState3 = React.useState(false),
|
|
29343
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29344
|
+
initialReseted = _useState4[0],
|
|
29345
|
+
setReset = _useState4[1];
|
|
29334
29346
|
|
|
29335
29347
|
React.useEffect(function () {
|
|
29336
29348
|
_reset(cleanInputArray(value, defaultValues, flow, schema));
|
|
@@ -29376,7 +29388,11 @@ var Form = /*#__PURE__*/React__default["default"].forwardRef(function (_ref7, re
|
|
|
29376
29388
|
}, onError)();
|
|
29377
29389
|
},
|
|
29378
29390
|
trigger: trigger,
|
|
29379
|
-
methods: methods
|
|
29391
|
+
methods: _objectSpread2$1(_objectSpread2$1({}, methods), {}, {
|
|
29392
|
+
data: function data() {
|
|
29393
|
+
return cleanOutputArray(getValues(), schema);
|
|
29394
|
+
}
|
|
29395
|
+
})
|
|
29380
29396
|
};
|
|
29381
29397
|
});
|
|
29382
29398
|
return /*#__PURE__*/React__default["default"].createElement(reactHookForm.FormProvider, methods, /*#__PURE__*/React__default["default"].createElement(Watcher, {
|
|
@@ -29392,7 +29408,19 @@ var Form = /*#__PURE__*/React__default["default"].forwardRef(function (_ref7, re
|
|
|
29392
29408
|
var clean = cleanOutputArray(data, schema);
|
|
29393
29409
|
onSubmit(clean);
|
|
29394
29410
|
}, onError)
|
|
29395
|
-
},
|
|
29411
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
29412
|
+
className: classNames__default["default"](classes.flex, classes.mt_20)
|
|
29413
|
+
}, /*#__PURE__*/React__default["default"].createElement("button", {
|
|
29414
|
+
type: "button",
|
|
29415
|
+
className: classNames__default["default"](classes.btn, classes.btn_sm),
|
|
29416
|
+
style: {
|
|
29417
|
+
marginLeft: 'auto'
|
|
29418
|
+
},
|
|
29419
|
+
onClick: function onClick(e) {
|
|
29420
|
+
if (e) e.stopPropagation();
|
|
29421
|
+
setExpandedAll(!expandedAll);
|
|
29422
|
+
}
|
|
29423
|
+
}, expandedAll ? 'Expand all' : 'Collapse all')), formFlow.map(function (entry, idx) {
|
|
29396
29424
|
var step = schema[entry];
|
|
29397
29425
|
|
|
29398
29426
|
if (!step && typeof entry === 'string') {
|
|
@@ -29440,7 +29468,8 @@ var Form = /*#__PURE__*/React__default["default"].forwardRef(function (_ref7, re
|
|
|
29440
29468
|
schema: schema,
|
|
29441
29469
|
inputWrapper: inputWrapper,
|
|
29442
29470
|
httpClient: maybeCustomHttpClient,
|
|
29443
|
-
functionalProperty: functionalProperty
|
|
29471
|
+
functionalProperty: functionalProperty,
|
|
29472
|
+
expandedAll: expandedAll
|
|
29444
29473
|
}));
|
|
29445
29474
|
}), /*#__PURE__*/React__default["default"].createElement(Footer, {
|
|
29446
29475
|
render: footer,
|
|
@@ -29498,7 +29527,8 @@ var Step = function Step(_ref8) {
|
|
|
29498
29527
|
index = _ref8.index,
|
|
29499
29528
|
functionalProperty = _ref8.functionalProperty,
|
|
29500
29529
|
parent = _ref8.parent,
|
|
29501
|
-
onAfterChange = _ref8.onAfterChange
|
|
29530
|
+
onAfterChange = _ref8.onAfterChange,
|
|
29531
|
+
expandedAll = _ref8.expandedAll;
|
|
29502
29532
|
var classes = useCustomStyle();
|
|
29503
29533
|
|
|
29504
29534
|
var _useFormContext2 = reactHookForm.useFormContext(),
|
|
@@ -29563,6 +29593,7 @@ var Step = function Step(_ref8) {
|
|
|
29563
29593
|
entry: en,
|
|
29564
29594
|
step: stp,
|
|
29565
29595
|
schema: schema,
|
|
29596
|
+
expandedAll: expandedAll,
|
|
29566
29597
|
inputWrapper: inputWrapper,
|
|
29567
29598
|
httpClient: httpClient,
|
|
29568
29599
|
defaultValue: stp === null || stp === void 0 ? void 0 : stp.defaultValue,
|
|
@@ -29640,7 +29671,8 @@ var Step = function Step(_ref8) {
|
|
|
29640
29671
|
defaultValue: (_props$defaultValue = props.defaultValue) === null || _props$defaultValue === void 0 ? void 0 : _props$defaultValue.value,
|
|
29641
29672
|
value: props.value,
|
|
29642
29673
|
index: idx,
|
|
29643
|
-
functionalProperty: functionalProperty
|
|
29674
|
+
functionalProperty: functionalProperty,
|
|
29675
|
+
expandedAll: expandedAll
|
|
29644
29676
|
});
|
|
29645
29677
|
}
|
|
29646
29678
|
}));
|
|
@@ -29806,7 +29838,8 @@ var Step = function Step(_ref8) {
|
|
|
29806
29838
|
value: getValues(entry) || defaultValue,
|
|
29807
29839
|
index: index,
|
|
29808
29840
|
functionalProperty: functionalProperty,
|
|
29809
|
-
errorDisplayed: errorDisplayed
|
|
29841
|
+
errorDisplayed: errorDisplayed,
|
|
29842
|
+
expandedAll: expandedAll
|
|
29810
29843
|
}));
|
|
29811
29844
|
|
|
29812
29845
|
case format.code:
|
|
@@ -29875,15 +29908,15 @@ var Step = function Step(_ref8) {
|
|
|
29875
29908
|
var FileInput = function FileInput(_ref10) {
|
|
29876
29909
|
var onChange = _ref10.onChange;
|
|
29877
29910
|
|
|
29878
|
-
var
|
|
29879
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
29880
|
-
uploading = _useState4[0],
|
|
29881
|
-
setUploading = _useState4[1];
|
|
29882
|
-
|
|
29883
|
-
var _useState5 = React.useState(undefined),
|
|
29911
|
+
var _useState5 = React.useState(false),
|
|
29884
29912
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
29885
|
-
|
|
29886
|
-
|
|
29913
|
+
uploading = _useState6[0],
|
|
29914
|
+
setUploading = _useState6[1];
|
|
29915
|
+
|
|
29916
|
+
var _useState7 = React.useState(undefined),
|
|
29917
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
29918
|
+
input = _useState8[0],
|
|
29919
|
+
setInput = _useState8[1];
|
|
29887
29920
|
|
|
29888
29921
|
var setFiles = function setFiles(e) {
|
|
29889
29922
|
var files = e.target.files;
|
|
@@ -30061,7 +30094,8 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30061
30094
|
value = _ref12.value,
|
|
30062
30095
|
step = _ref12.step,
|
|
30063
30096
|
functionalProperty = _ref12.functionalProperty,
|
|
30064
|
-
index = _ref12.index
|
|
30097
|
+
index = _ref12.index,
|
|
30098
|
+
expandedAll = _ref12.expandedAll;
|
|
30065
30099
|
|
|
30066
30100
|
var _useFormContext4 = reactHookForm.useFormContext(),
|
|
30067
30101
|
getValues = _useFormContext4.getValues,
|
|
@@ -30070,17 +30104,15 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30070
30104
|
_useFormContext4.trigger;
|
|
30071
30105
|
_useFormContext4.formState;
|
|
30072
30106
|
|
|
30073
|
-
var
|
|
30074
|
-
|
|
30075
|
-
collapsed =
|
|
30076
|
-
setCollapsed =
|
|
30077
|
-
|
|
30078
|
-
var classes = useCustomStyle(); // TODO - voir ce qui se passe et à quoi ça sert
|
|
30079
|
-
// const v = getValues(parent);
|
|
30080
|
-
// useEffect(() => {
|
|
30081
|
-
// trigger(parent)
|
|
30082
|
-
// }, [JSON.stringify(v)])
|
|
30107
|
+
var _useState9 = React.useState(!!step.collapsed),
|
|
30108
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
30109
|
+
collapsed = _useState10[0],
|
|
30110
|
+
setCollapsed = _useState10[1];
|
|
30083
30111
|
|
|
30112
|
+
var classes = useCustomStyle();
|
|
30113
|
+
React.useEffect(function () {
|
|
30114
|
+
if (!expandedAll || expandedAll && parent.split('.').length >= 2) setCollapsed(expandedAll);
|
|
30115
|
+
}, [expandedAll]);
|
|
30084
30116
|
var schemaAndFlow = option(step.conditionalSchema).map(function (condiSchema) {
|
|
30085
30117
|
var ref = option(condiSchema.ref).map(function (ref) {
|
|
30086
30118
|
return getValues(ref);
|
|
@@ -30199,7 +30231,8 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30199
30231
|
inputWrapper: inputWrapper,
|
|
30200
30232
|
httpClient: maybeCustomHttpClient,
|
|
30201
30233
|
defaultValue: value && value[entry],
|
|
30202
|
-
functionalProperty: functionalProperty
|
|
30234
|
+
functionalProperty: functionalProperty,
|
|
30235
|
+
expandedAll: expandedAll
|
|
30203
30236
|
}));
|
|
30204
30237
|
}));
|
|
30205
30238
|
};
|