@maif/react-forms 1.0.48 → 1.0.51
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 +60 -36
- package/lib/index.js +60 -36
- 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
|
|
@@ -29281,6 +29281,11 @@ var Form = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
|
|
|
29281
29281
|
});
|
|
29282
29282
|
};
|
|
29283
29283
|
|
|
29284
|
+
var _useState = useState(false),
|
|
29285
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29286
|
+
expandedAll = _useState2[0],
|
|
29287
|
+
setExpandedAll = _useState2[1];
|
|
29288
|
+
|
|
29284
29289
|
var defaultValues = getDefaultValues(formFlow, schema, value); //FIXME: get real schema through the switch
|
|
29285
29290
|
|
|
29286
29291
|
var _resolver = function resolver(rawData) {
|
|
@@ -29300,10 +29305,10 @@ var Form = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
|
|
|
29300
29305
|
mode: 'onChange'
|
|
29301
29306
|
});
|
|
29302
29307
|
|
|
29303
|
-
var
|
|
29304
|
-
|
|
29305
|
-
initialReseted =
|
|
29306
|
-
setReset =
|
|
29308
|
+
var _useState3 = useState(false),
|
|
29309
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29310
|
+
initialReseted = _useState4[0],
|
|
29311
|
+
setReset = _useState4[1];
|
|
29307
29312
|
|
|
29308
29313
|
useEffect(function () {
|
|
29309
29314
|
_reset(cleanInputArray(value, defaultValues, flow, schema));
|
|
@@ -29369,7 +29374,19 @@ var Form = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
|
|
|
29369
29374
|
var clean = cleanOutputArray(data, schema);
|
|
29370
29375
|
onSubmit(clean);
|
|
29371
29376
|
}, onError)
|
|
29372
|
-
},
|
|
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) {
|
|
29373
29390
|
var step = schema[entry];
|
|
29374
29391
|
|
|
29375
29392
|
if (!step && typeof entry === 'string') {
|
|
@@ -29417,7 +29434,8 @@ var Form = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
|
|
|
29417
29434
|
schema: schema,
|
|
29418
29435
|
inputWrapper: inputWrapper,
|
|
29419
29436
|
httpClient: maybeCustomHttpClient,
|
|
29420
|
-
functionalProperty: functionalProperty
|
|
29437
|
+
functionalProperty: functionalProperty,
|
|
29438
|
+
expandedAll: expandedAll
|
|
29421
29439
|
}));
|
|
29422
29440
|
}), /*#__PURE__*/React.createElement(Footer, {
|
|
29423
29441
|
render: footer,
|
|
@@ -29475,7 +29493,8 @@ var Step = function Step(_ref8) {
|
|
|
29475
29493
|
index = _ref8.index,
|
|
29476
29494
|
functionalProperty = _ref8.functionalProperty,
|
|
29477
29495
|
parent = _ref8.parent,
|
|
29478
|
-
onAfterChange = _ref8.onAfterChange
|
|
29496
|
+
onAfterChange = _ref8.onAfterChange,
|
|
29497
|
+
expandedAll = _ref8.expandedAll;
|
|
29479
29498
|
var classes = useCustomStyle();
|
|
29480
29499
|
|
|
29481
29500
|
var _useFormContext2 = useFormContext(),
|
|
@@ -29540,6 +29559,7 @@ var Step = function Step(_ref8) {
|
|
|
29540
29559
|
entry: en,
|
|
29541
29560
|
step: stp,
|
|
29542
29561
|
schema: schema,
|
|
29562
|
+
expandedAll: expandedAll,
|
|
29543
29563
|
inputWrapper: inputWrapper,
|
|
29544
29564
|
httpClient: httpClient,
|
|
29545
29565
|
defaultValue: stp === null || stp === void 0 ? void 0 : stp.defaultValue,
|
|
@@ -29617,7 +29637,8 @@ var Step = function Step(_ref8) {
|
|
|
29617
29637
|
defaultValue: (_props$defaultValue = props.defaultValue) === null || _props$defaultValue === void 0 ? void 0 : _props$defaultValue.value,
|
|
29618
29638
|
value: props.value,
|
|
29619
29639
|
index: idx,
|
|
29620
|
-
functionalProperty: functionalProperty
|
|
29640
|
+
functionalProperty: functionalProperty,
|
|
29641
|
+
expandedAll: expandedAll
|
|
29621
29642
|
});
|
|
29622
29643
|
}
|
|
29623
29644
|
}));
|
|
@@ -29675,7 +29696,8 @@ var Step = function Step(_ref8) {
|
|
|
29675
29696
|
isMulti: step.isMulti,
|
|
29676
29697
|
createOption: step.createOption,
|
|
29677
29698
|
transformer: step.transformer,
|
|
29678
|
-
buttons: step.format === format.buttonsSelect
|
|
29699
|
+
buttons: step.format === format.buttonsSelect,
|
|
29700
|
+
optionsFrom: step.optionsFrom
|
|
29679
29701
|
}));
|
|
29680
29702
|
}
|
|
29681
29703
|
|
|
@@ -29708,7 +29730,8 @@ var Step = function Step(_ref8) {
|
|
|
29708
29730
|
createOption: step.createOption,
|
|
29709
29731
|
onCreateOption: step.onCreateOption,
|
|
29710
29732
|
transformer: step.transformer,
|
|
29711
|
-
buttons: step.format === format.buttonsSelect
|
|
29733
|
+
buttons: step.format === format.buttonsSelect,
|
|
29734
|
+
optionsFrom: step.optionsFrom
|
|
29712
29735
|
}));
|
|
29713
29736
|
|
|
29714
29737
|
default:
|
|
@@ -29750,7 +29773,8 @@ var Step = function Step(_ref8) {
|
|
|
29750
29773
|
createOption: step.createOption,
|
|
29751
29774
|
onCreateOption: step.onCreateOption,
|
|
29752
29775
|
transformer: step.transformer,
|
|
29753
|
-
buttons: step.format === format.buttonsSelect
|
|
29776
|
+
buttons: step.format === format.buttonsSelect,
|
|
29777
|
+
optionsFrom: step.optionsFrom
|
|
29754
29778
|
}));
|
|
29755
29779
|
|
|
29756
29780
|
case format.form:
|
|
@@ -29783,7 +29807,8 @@ var Step = function Step(_ref8) {
|
|
|
29783
29807
|
value: getValues(entry) || defaultValue,
|
|
29784
29808
|
index: index,
|
|
29785
29809
|
functionalProperty: functionalProperty,
|
|
29786
|
-
errorDisplayed: errorDisplayed
|
|
29810
|
+
errorDisplayed: errorDisplayed,
|
|
29811
|
+
expandedAll: expandedAll
|
|
29787
29812
|
}));
|
|
29788
29813
|
|
|
29789
29814
|
case format.code:
|
|
@@ -29826,8 +29851,7 @@ var Step = function Step(_ref8) {
|
|
|
29826
29851
|
entry: entry,
|
|
29827
29852
|
errorDisplayed: errorDisplayed
|
|
29828
29853
|
}, /*#__PURE__*/React.createElement(ObjectInput, {
|
|
29829
|
-
className: classNames(_defineProperty$1({}, classes.input__invalid, errorDisplayed))
|
|
29830
|
-
possibleValues: step.options
|
|
29854
|
+
className: classNames(_defineProperty$1({}, classes.input__invalid, errorDisplayed))
|
|
29831
29855
|
}));
|
|
29832
29856
|
}
|
|
29833
29857
|
|
|
@@ -29852,15 +29876,15 @@ var Step = function Step(_ref8) {
|
|
|
29852
29876
|
var FileInput = function FileInput(_ref10) {
|
|
29853
29877
|
var onChange = _ref10.onChange;
|
|
29854
29878
|
|
|
29855
|
-
var
|
|
29856
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
29857
|
-
uploading = _useState4[0],
|
|
29858
|
-
setUploading = _useState4[1];
|
|
29859
|
-
|
|
29860
|
-
var _useState5 = useState(undefined),
|
|
29879
|
+
var _useState5 = useState(false),
|
|
29861
29880
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
29862
|
-
|
|
29863
|
-
|
|
29881
|
+
uploading = _useState6[0],
|
|
29882
|
+
setUploading = _useState6[1];
|
|
29883
|
+
|
|
29884
|
+
var _useState7 = useState(undefined),
|
|
29885
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
29886
|
+
input = _useState8[0],
|
|
29887
|
+
setInput = _useState8[1];
|
|
29864
29888
|
|
|
29865
29889
|
var setFiles = function setFiles(e) {
|
|
29866
29890
|
var files = e.target.files;
|
|
@@ -30038,7 +30062,8 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30038
30062
|
value = _ref12.value,
|
|
30039
30063
|
step = _ref12.step,
|
|
30040
30064
|
functionalProperty = _ref12.functionalProperty,
|
|
30041
|
-
index = _ref12.index
|
|
30065
|
+
index = _ref12.index,
|
|
30066
|
+
expandedAll = _ref12.expandedAll;
|
|
30042
30067
|
|
|
30043
30068
|
var _useFormContext4 = useFormContext(),
|
|
30044
30069
|
getValues = _useFormContext4.getValues,
|
|
@@ -30047,17 +30072,15 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30047
30072
|
_useFormContext4.trigger;
|
|
30048
30073
|
_useFormContext4.formState;
|
|
30049
30074
|
|
|
30050
|
-
var
|
|
30051
|
-
|
|
30052
|
-
collapsed =
|
|
30053
|
-
setCollapsed =
|
|
30054
|
-
|
|
30055
|
-
var classes = useCustomStyle(); // TODO - voir ce qui se passe et à quoi ça sert
|
|
30056
|
-
// const v = getValues(parent);
|
|
30057
|
-
// useEffect(() => {
|
|
30058
|
-
// trigger(parent)
|
|
30059
|
-
// }, [JSON.stringify(v)])
|
|
30075
|
+
var _useState9 = useState(!!step.collapsed),
|
|
30076
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
30077
|
+
collapsed = _useState10[0],
|
|
30078
|
+
setCollapsed = _useState10[1];
|
|
30060
30079
|
|
|
30080
|
+
var classes = useCustomStyle();
|
|
30081
|
+
useEffect(function () {
|
|
30082
|
+
if (!expandedAll || expandedAll && parent.split('.').length >= 2) setCollapsed(expandedAll);
|
|
30083
|
+
}, [expandedAll]);
|
|
30061
30084
|
var schemaAndFlow = option(step.conditionalSchema).map(function (condiSchema) {
|
|
30062
30085
|
var ref = option(condiSchema.ref).map(function (ref) {
|
|
30063
30086
|
return getValues(ref);
|
|
@@ -30176,7 +30199,8 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30176
30199
|
inputWrapper: inputWrapper,
|
|
30177
30200
|
httpClient: maybeCustomHttpClient,
|
|
30178
30201
|
defaultValue: value && value[entry],
|
|
30179
|
-
functionalProperty: functionalProperty
|
|
30202
|
+
functionalProperty: functionalProperty,
|
|
30203
|
+
expandedAll: expandedAll
|
|
30180
30204
|
}));
|
|
30181
30205
|
}));
|
|
30182
30206
|
};
|
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
|
|
@@ -29315,6 +29315,11 @@ var Form = /*#__PURE__*/React__default["default"].forwardRef(function (_ref7, re
|
|
|
29315
29315
|
});
|
|
29316
29316
|
};
|
|
29317
29317
|
|
|
29318
|
+
var _useState = React.useState(false),
|
|
29319
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29320
|
+
expandedAll = _useState2[0],
|
|
29321
|
+
setExpandedAll = _useState2[1];
|
|
29322
|
+
|
|
29318
29323
|
var defaultValues = getDefaultValues(formFlow, schema, value); //FIXME: get real schema through the switch
|
|
29319
29324
|
|
|
29320
29325
|
var _resolver = function resolver(rawData) {
|
|
@@ -29334,10 +29339,10 @@ var Form = /*#__PURE__*/React__default["default"].forwardRef(function (_ref7, re
|
|
|
29334
29339
|
mode: 'onChange'
|
|
29335
29340
|
});
|
|
29336
29341
|
|
|
29337
|
-
var
|
|
29338
|
-
|
|
29339
|
-
initialReseted =
|
|
29340
|
-
setReset =
|
|
29342
|
+
var _useState3 = React.useState(false),
|
|
29343
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29344
|
+
initialReseted = _useState4[0],
|
|
29345
|
+
setReset = _useState4[1];
|
|
29341
29346
|
|
|
29342
29347
|
React.useEffect(function () {
|
|
29343
29348
|
_reset(cleanInputArray(value, defaultValues, flow, schema));
|
|
@@ -29403,7 +29408,19 @@ var Form = /*#__PURE__*/React__default["default"].forwardRef(function (_ref7, re
|
|
|
29403
29408
|
var clean = cleanOutputArray(data, schema);
|
|
29404
29409
|
onSubmit(clean);
|
|
29405
29410
|
}, onError)
|
|
29406
|
-
},
|
|
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) {
|
|
29407
29424
|
var step = schema[entry];
|
|
29408
29425
|
|
|
29409
29426
|
if (!step && typeof entry === 'string') {
|
|
@@ -29451,7 +29468,8 @@ var Form = /*#__PURE__*/React__default["default"].forwardRef(function (_ref7, re
|
|
|
29451
29468
|
schema: schema,
|
|
29452
29469
|
inputWrapper: inputWrapper,
|
|
29453
29470
|
httpClient: maybeCustomHttpClient,
|
|
29454
|
-
functionalProperty: functionalProperty
|
|
29471
|
+
functionalProperty: functionalProperty,
|
|
29472
|
+
expandedAll: expandedAll
|
|
29455
29473
|
}));
|
|
29456
29474
|
}), /*#__PURE__*/React__default["default"].createElement(Footer, {
|
|
29457
29475
|
render: footer,
|
|
@@ -29509,7 +29527,8 @@ var Step = function Step(_ref8) {
|
|
|
29509
29527
|
index = _ref8.index,
|
|
29510
29528
|
functionalProperty = _ref8.functionalProperty,
|
|
29511
29529
|
parent = _ref8.parent,
|
|
29512
|
-
onAfterChange = _ref8.onAfterChange
|
|
29530
|
+
onAfterChange = _ref8.onAfterChange,
|
|
29531
|
+
expandedAll = _ref8.expandedAll;
|
|
29513
29532
|
var classes = useCustomStyle();
|
|
29514
29533
|
|
|
29515
29534
|
var _useFormContext2 = reactHookForm.useFormContext(),
|
|
@@ -29574,6 +29593,7 @@ var Step = function Step(_ref8) {
|
|
|
29574
29593
|
entry: en,
|
|
29575
29594
|
step: stp,
|
|
29576
29595
|
schema: schema,
|
|
29596
|
+
expandedAll: expandedAll,
|
|
29577
29597
|
inputWrapper: inputWrapper,
|
|
29578
29598
|
httpClient: httpClient,
|
|
29579
29599
|
defaultValue: stp === null || stp === void 0 ? void 0 : stp.defaultValue,
|
|
@@ -29651,7 +29671,8 @@ var Step = function Step(_ref8) {
|
|
|
29651
29671
|
defaultValue: (_props$defaultValue = props.defaultValue) === null || _props$defaultValue === void 0 ? void 0 : _props$defaultValue.value,
|
|
29652
29672
|
value: props.value,
|
|
29653
29673
|
index: idx,
|
|
29654
|
-
functionalProperty: functionalProperty
|
|
29674
|
+
functionalProperty: functionalProperty,
|
|
29675
|
+
expandedAll: expandedAll
|
|
29655
29676
|
});
|
|
29656
29677
|
}
|
|
29657
29678
|
}));
|
|
@@ -29709,7 +29730,8 @@ var Step = function Step(_ref8) {
|
|
|
29709
29730
|
isMulti: step.isMulti,
|
|
29710
29731
|
createOption: step.createOption,
|
|
29711
29732
|
transformer: step.transformer,
|
|
29712
|
-
buttons: step.format === format.buttonsSelect
|
|
29733
|
+
buttons: step.format === format.buttonsSelect,
|
|
29734
|
+
optionsFrom: step.optionsFrom
|
|
29713
29735
|
}));
|
|
29714
29736
|
}
|
|
29715
29737
|
|
|
@@ -29742,7 +29764,8 @@ var Step = function Step(_ref8) {
|
|
|
29742
29764
|
createOption: step.createOption,
|
|
29743
29765
|
onCreateOption: step.onCreateOption,
|
|
29744
29766
|
transformer: step.transformer,
|
|
29745
|
-
buttons: step.format === format.buttonsSelect
|
|
29767
|
+
buttons: step.format === format.buttonsSelect,
|
|
29768
|
+
optionsFrom: step.optionsFrom
|
|
29746
29769
|
}));
|
|
29747
29770
|
|
|
29748
29771
|
default:
|
|
@@ -29784,7 +29807,8 @@ var Step = function Step(_ref8) {
|
|
|
29784
29807
|
createOption: step.createOption,
|
|
29785
29808
|
onCreateOption: step.onCreateOption,
|
|
29786
29809
|
transformer: step.transformer,
|
|
29787
|
-
buttons: step.format === format.buttonsSelect
|
|
29810
|
+
buttons: step.format === format.buttonsSelect,
|
|
29811
|
+
optionsFrom: step.optionsFrom
|
|
29788
29812
|
}));
|
|
29789
29813
|
|
|
29790
29814
|
case format.form:
|
|
@@ -29817,7 +29841,8 @@ var Step = function Step(_ref8) {
|
|
|
29817
29841
|
value: getValues(entry) || defaultValue,
|
|
29818
29842
|
index: index,
|
|
29819
29843
|
functionalProperty: functionalProperty,
|
|
29820
|
-
errorDisplayed: errorDisplayed
|
|
29844
|
+
errorDisplayed: errorDisplayed,
|
|
29845
|
+
expandedAll: expandedAll
|
|
29821
29846
|
}));
|
|
29822
29847
|
|
|
29823
29848
|
case format.code:
|
|
@@ -29860,8 +29885,7 @@ var Step = function Step(_ref8) {
|
|
|
29860
29885
|
entry: entry,
|
|
29861
29886
|
errorDisplayed: errorDisplayed
|
|
29862
29887
|
}, /*#__PURE__*/React__default["default"].createElement(ObjectInput, {
|
|
29863
|
-
className: classNames__default["default"](_defineProperty$1({}, classes.input__invalid, errorDisplayed))
|
|
29864
|
-
possibleValues: step.options
|
|
29888
|
+
className: classNames__default["default"](_defineProperty$1({}, classes.input__invalid, errorDisplayed))
|
|
29865
29889
|
}));
|
|
29866
29890
|
}
|
|
29867
29891
|
|
|
@@ -29886,15 +29910,15 @@ var Step = function Step(_ref8) {
|
|
|
29886
29910
|
var FileInput = function FileInput(_ref10) {
|
|
29887
29911
|
var onChange = _ref10.onChange;
|
|
29888
29912
|
|
|
29889
|
-
var
|
|
29890
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
29891
|
-
uploading = _useState4[0],
|
|
29892
|
-
setUploading = _useState4[1];
|
|
29893
|
-
|
|
29894
|
-
var _useState5 = React.useState(undefined),
|
|
29913
|
+
var _useState5 = React.useState(false),
|
|
29895
29914
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
29896
|
-
|
|
29897
|
-
|
|
29915
|
+
uploading = _useState6[0],
|
|
29916
|
+
setUploading = _useState6[1];
|
|
29917
|
+
|
|
29918
|
+
var _useState7 = React.useState(undefined),
|
|
29919
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
29920
|
+
input = _useState8[0],
|
|
29921
|
+
setInput = _useState8[1];
|
|
29898
29922
|
|
|
29899
29923
|
var setFiles = function setFiles(e) {
|
|
29900
29924
|
var files = e.target.files;
|
|
@@ -30072,7 +30096,8 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30072
30096
|
value = _ref12.value,
|
|
30073
30097
|
step = _ref12.step,
|
|
30074
30098
|
functionalProperty = _ref12.functionalProperty,
|
|
30075
|
-
index = _ref12.index
|
|
30099
|
+
index = _ref12.index,
|
|
30100
|
+
expandedAll = _ref12.expandedAll;
|
|
30076
30101
|
|
|
30077
30102
|
var _useFormContext4 = reactHookForm.useFormContext(),
|
|
30078
30103
|
getValues = _useFormContext4.getValues,
|
|
@@ -30081,17 +30106,15 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30081
30106
|
_useFormContext4.trigger;
|
|
30082
30107
|
_useFormContext4.formState;
|
|
30083
30108
|
|
|
30084
|
-
var
|
|
30085
|
-
|
|
30086
|
-
collapsed =
|
|
30087
|
-
setCollapsed =
|
|
30088
|
-
|
|
30089
|
-
var classes = useCustomStyle(); // TODO - voir ce qui se passe et à quoi ça sert
|
|
30090
|
-
// const v = getValues(parent);
|
|
30091
|
-
// useEffect(() => {
|
|
30092
|
-
// trigger(parent)
|
|
30093
|
-
// }, [JSON.stringify(v)])
|
|
30109
|
+
var _useState9 = React.useState(!!step.collapsed),
|
|
30110
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
30111
|
+
collapsed = _useState10[0],
|
|
30112
|
+
setCollapsed = _useState10[1];
|
|
30094
30113
|
|
|
30114
|
+
var classes = useCustomStyle();
|
|
30115
|
+
React.useEffect(function () {
|
|
30116
|
+
if (!expandedAll || expandedAll && parent.split('.').length >= 2) setCollapsed(expandedAll);
|
|
30117
|
+
}, [expandedAll]);
|
|
30095
30118
|
var schemaAndFlow = option(step.conditionalSchema).map(function (condiSchema) {
|
|
30096
30119
|
var ref = option(condiSchema.ref).map(function (ref) {
|
|
30097
30120
|
return getValues(ref);
|
|
@@ -30210,7 +30233,8 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30210
30233
|
inputWrapper: inputWrapper,
|
|
30211
30234
|
httpClient: maybeCustomHttpClient,
|
|
30212
30235
|
defaultValue: value && value[entry],
|
|
30213
|
-
functionalProperty: functionalProperty
|
|
30236
|
+
functionalProperty: functionalProperty,
|
|
30237
|
+
expandedAll: expandedAll
|
|
30214
30238
|
}));
|
|
30215
30239
|
}));
|
|
30216
30240
|
};
|