@maif/react-forms 1.0.49 → 1.0.52
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 +30 -105
- package/lib/index.js +30 -105
- package/package.json +1 -1
package/lib/esm/index.js
CHANGED
|
@@ -452,42 +452,6 @@ function _extends() {
|
|
|
452
452
|
return _extends.apply(this, arguments);
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
456
|
-
if (source == null) return {};
|
|
457
|
-
var target = {};
|
|
458
|
-
var sourceKeys = Object.keys(source);
|
|
459
|
-
var key, i;
|
|
460
|
-
|
|
461
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
462
|
-
key = sourceKeys[i];
|
|
463
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
464
|
-
target[key] = source[key];
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
return target;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
function _objectWithoutProperties(source, excluded) {
|
|
471
|
-
if (source == null) return {};
|
|
472
|
-
|
|
473
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
474
|
-
|
|
475
|
-
var key, i;
|
|
476
|
-
|
|
477
|
-
if (Object.getOwnPropertySymbols) {
|
|
478
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
479
|
-
|
|
480
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
481
|
-
key = sourceSymbolKeys[i];
|
|
482
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
483
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
484
|
-
target[key] = source[key];
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
return target;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
455
|
function _readOnlyError(name) {
|
|
492
456
|
throw new TypeError("\"" + name + "\" is read-only");
|
|
493
457
|
}
|
|
@@ -874,18 +838,13 @@ var BooleanInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
874
838
|
});
|
|
875
839
|
|
|
876
840
|
var Collapse = function Collapse(props) {
|
|
877
|
-
var
|
|
841
|
+
var _classNames4;
|
|
878
842
|
|
|
879
843
|
var _useState = useState(props.initCollapsed || props.collapsed),
|
|
880
844
|
_useState2 = _slicedToArray(_useState, 2),
|
|
881
845
|
collapsed = _useState2[0],
|
|
882
846
|
setCollapsed = _useState2[1];
|
|
883
847
|
|
|
884
|
-
var _useState3 = useState(false),
|
|
885
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
886
|
-
expandedAll = _useState4[0],
|
|
887
|
-
setExpandedAll = _useState4[1];
|
|
888
|
-
|
|
889
848
|
var classes = useCustomStyle();
|
|
890
849
|
|
|
891
850
|
var toggle = function toggle(e) {
|
|
@@ -893,15 +852,6 @@ var Collapse = function Collapse(props) {
|
|
|
893
852
|
setCollapsed(!collapsed);
|
|
894
853
|
};
|
|
895
854
|
|
|
896
|
-
var childrenWithProps = React.Children.map(props.children, function (child) {
|
|
897
|
-
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
898
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
899
|
-
collapsed: expandedAll
|
|
900
|
-
});
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
return child;
|
|
904
|
-
});
|
|
905
855
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("hr", {
|
|
906
856
|
className: classNames(_defineProperty$1({}, classes.collapse_error, props.errored))
|
|
907
857
|
}), /*#__PURE__*/React.createElement("div", {
|
|
@@ -909,19 +859,7 @@ var Collapse = function Collapse(props) {
|
|
|
909
859
|
onClick: toggle
|
|
910
860
|
}, /*#__PURE__*/React.createElement("span", {
|
|
911
861
|
className: classNames(classes.collapse_label, _defineProperty$1({}, classes.collapse_error, props.errored))
|
|
912
|
-
}, props.label), /*#__PURE__*/React.createElement("
|
|
913
|
-
style: {
|
|
914
|
-
marginLeft: 'auto'
|
|
915
|
-
},
|
|
916
|
-
className: classNames(classes.flex)
|
|
917
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
918
|
-
type: "button",
|
|
919
|
-
className: classNames(classes.btn, classes.btn_sm, _defineProperty$1({}, classes.collapse_error, props.errored)),
|
|
920
|
-
onClick: function onClick(e) {
|
|
921
|
-
if (e) e.stopPropagation();
|
|
922
|
-
setExpandedAll(!expandedAll);
|
|
923
|
-
}
|
|
924
|
-
}, expandedAll ? 'Expand all' : 'Collapse all'), /*#__PURE__*/React.createElement("button", {
|
|
862
|
+
}, props.label), /*#__PURE__*/React.createElement("button", {
|
|
925
863
|
type: "button",
|
|
926
864
|
className: classNames(classes.btn, classes.btn_sm, classes.ml_5, _defineProperty$1({}, classes.collapse_error, props.errored)),
|
|
927
865
|
onClick: toggle
|
|
@@ -929,9 +867,9 @@ var Collapse = function Collapse(props) {
|
|
|
929
867
|
size: 16
|
|
930
868
|
}), !collapsed && /*#__PURE__*/React.createElement(EyeOff, {
|
|
931
869
|
size: 16
|
|
932
|
-
})))
|
|
933
|
-
className: classNames("".concat(classes.ml_10), (
|
|
934
|
-
},
|
|
870
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
871
|
+
className: classNames("".concat(classes.ml_10), (_classNames4 = {}, _defineProperty$1(_classNames4, classes.display__none, !!collapsed), _defineProperty$1(_classNames4, classes.flex, !!props.inline), _defineProperty$1(_classNames4, classes.collapse__inline, !!props.inline), _classNames4))
|
|
872
|
+
}, props.children), props.lineEnd && /*#__PURE__*/React.createElement("hr", null));
|
|
935
873
|
};
|
|
936
874
|
|
|
937
875
|
var option = function option(x) {
|
|
@@ -28577,7 +28515,6 @@ function CodeInput(_ref) {
|
|
|
28577
28515
|
}, []);
|
|
28578
28516
|
useEffect(function () {
|
|
28579
28517
|
if (editor && (_typeof$1(value) === 'object' ? JSON.stringify(value, null, 2) : value) !== editor.state.doc.toString()) {
|
|
28580
|
-
console.log("set value", value, value === null || value === undefined ? '' : _typeof$1(value) === 'object' ? JSON.stringify(value, null, 2) : value, editor.state.doc.toString());
|
|
28581
28518
|
editor.dispatch({
|
|
28582
28519
|
changes: {
|
|
28583
28520
|
from: 0,
|
|
@@ -28991,6 +28928,15 @@ var CustomizableInput$1 = /*#__PURE__*/React.memo(function (props) {
|
|
|
28991
28928
|
|
|
28992
28929
|
return props.children;
|
|
28993
28930
|
}, function (prev, next) {
|
|
28931
|
+
console.debug({
|
|
28932
|
+
prev: prev,
|
|
28933
|
+
next: next
|
|
28934
|
+
});
|
|
28935
|
+
|
|
28936
|
+
if (next.render) {
|
|
28937
|
+
return false;
|
|
28938
|
+
}
|
|
28939
|
+
|
|
28994
28940
|
return prev.field.value === next.field.value && next.errorDisplayed === prev.errorDisplayed;
|
|
28995
28941
|
});
|
|
28996
28942
|
var ControlledInput = function ControlledInput(_ref) {
|
|
@@ -29071,8 +29017,6 @@ var ControlledInput = function ControlledInput(_ref) {
|
|
|
29071
29017
|
}, component ? component(field, props) : /*#__PURE__*/React.cloneElement(children, _objectSpread2$1({}, props)));
|
|
29072
29018
|
};
|
|
29073
29019
|
|
|
29074
|
-
var _excluded = ["schema", "flow", "parent", "inputWrapper", "maybeCustomHttpClient", "errorDisplayed", "value", "step", "functionalProperty", "index"];
|
|
29075
|
-
|
|
29076
29020
|
var usePrevious = function usePrevious(value) {
|
|
29077
29021
|
// The ref object is a generic container whose current property is mutable ...
|
|
29078
29022
|
// ... and can hold any value, similar to an instance property on a class
|
|
@@ -29092,8 +29036,7 @@ var BasicWrapper = function BasicWrapper(_ref) {
|
|
|
29092
29036
|
label = _ref.label,
|
|
29093
29037
|
help = _ref.help,
|
|
29094
29038
|
children = _ref.children,
|
|
29095
|
-
render = _ref.render
|
|
29096
|
-
collapsed = _ref.collapsed;
|
|
29039
|
+
render = _ref.render;
|
|
29097
29040
|
|
|
29098
29041
|
if (_typeof$1(entry) === 'object') {
|
|
29099
29042
|
return children;
|
|
@@ -29122,20 +29065,10 @@ var BasicWrapper = function BasicWrapper(_ref) {
|
|
|
29122
29065
|
label: label,
|
|
29123
29066
|
error: error,
|
|
29124
29067
|
help: help,
|
|
29125
|
-
children: children
|
|
29126
|
-
collapsed: collapsed
|
|
29068
|
+
children: children
|
|
29127
29069
|
});
|
|
29128
29070
|
}
|
|
29129
29071
|
|
|
29130
|
-
var childrenWithProps = React.Children.map(children, function (child) {
|
|
29131
|
-
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
29132
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
29133
|
-
collapsed: collapsed
|
|
29134
|
-
});
|
|
29135
|
-
}
|
|
29136
|
-
|
|
29137
|
-
return child;
|
|
29138
|
-
});
|
|
29139
29072
|
return /*#__PURE__*/React.createElement("div", {
|
|
29140
29073
|
className: "".concat(classes.mt_10, " ").concat(className),
|
|
29141
29074
|
style: {
|
|
@@ -29160,7 +29093,7 @@ var BasicWrapper = function BasicWrapper(_ref) {
|
|
|
29160
29093
|
marginLeft: '.5rem',
|
|
29161
29094
|
cursor: 'help'
|
|
29162
29095
|
}
|
|
29163
|
-
})))),
|
|
29096
|
+
})))), children, error && /*#__PURE__*/React.createElement("div", {
|
|
29164
29097
|
className: classNames(classes.feedback, _defineProperty$1({}, classes.txt_red, errorDisplayed))
|
|
29165
29098
|
}, error.message));
|
|
29166
29099
|
};
|
|
@@ -29550,8 +29483,7 @@ var Step = function Step(_ref8) {
|
|
|
29550
29483
|
index = _ref8.index,
|
|
29551
29484
|
functionalProperty = _ref8.functionalProperty,
|
|
29552
29485
|
parent = _ref8.parent,
|
|
29553
|
-
onAfterChange = _ref8.onAfterChange
|
|
29554
|
-
collapsed = _ref8.collapsed;
|
|
29486
|
+
onAfterChange = _ref8.onAfterChange;
|
|
29555
29487
|
var classes = useCustomStyle();
|
|
29556
29488
|
|
|
29557
29489
|
var _useFormContext2 = useFormContext(),
|
|
@@ -29572,8 +29504,7 @@ var Step = function Step(_ref8) {
|
|
|
29572
29504
|
return !!errors[step] && (dirtyFields[step] || touchedFields[step]);
|
|
29573
29505
|
});
|
|
29574
29506
|
return /*#__PURE__*/React.createElement(Collapse, _extends({}, entry, {
|
|
29575
|
-
errored: errored
|
|
29576
|
-
collapsed: collapsed
|
|
29507
|
+
errored: errored
|
|
29577
29508
|
}), entry.flow.map(function (en, entryIdx) {
|
|
29578
29509
|
var stp = schema[en];
|
|
29579
29510
|
_typeof$1(en) === 'object' ? undefined : en.split('.').reduce(function (object, key) {
|
|
@@ -29612,13 +29543,11 @@ var Step = function Step(_ref8) {
|
|
|
29612
29543
|
entry: en,
|
|
29613
29544
|
label: functionalProperty(en, (stp === null || stp === void 0 ? void 0 : stp.label) === null ? null : (stp === null || stp === void 0 ? void 0 : stp.label) || en),
|
|
29614
29545
|
help: stp === null || stp === void 0 ? void 0 : stp.help,
|
|
29615
|
-
render: inputWrapper
|
|
29616
|
-
collapsed: collapsed
|
|
29546
|
+
render: inputWrapper
|
|
29617
29547
|
}, /*#__PURE__*/React.createElement(Step, {
|
|
29618
29548
|
entry: en,
|
|
29619
29549
|
step: stp,
|
|
29620
29550
|
schema: schema,
|
|
29621
|
-
collapsed: collapsed,
|
|
29622
29551
|
inputWrapper: inputWrapper,
|
|
29623
29552
|
httpClient: httpClient,
|
|
29624
29553
|
defaultValue: stp === null || stp === void 0 ? void 0 : stp.defaultValue,
|
|
@@ -29696,8 +29625,7 @@ var Step = function Step(_ref8) {
|
|
|
29696
29625
|
defaultValue: (_props$defaultValue = props.defaultValue) === null || _props$defaultValue === void 0 ? void 0 : _props$defaultValue.value,
|
|
29697
29626
|
value: props.value,
|
|
29698
29627
|
index: idx,
|
|
29699
|
-
functionalProperty: functionalProperty
|
|
29700
|
-
collapsed: collapsed
|
|
29628
|
+
functionalProperty: functionalProperty
|
|
29701
29629
|
});
|
|
29702
29630
|
}
|
|
29703
29631
|
}));
|
|
@@ -29755,7 +29683,8 @@ var Step = function Step(_ref8) {
|
|
|
29755
29683
|
isMulti: step.isMulti,
|
|
29756
29684
|
createOption: step.createOption,
|
|
29757
29685
|
transformer: step.transformer,
|
|
29758
|
-
buttons: step.format === format.buttonsSelect
|
|
29686
|
+
buttons: step.format === format.buttonsSelect,
|
|
29687
|
+
optionsFrom: step.optionsFrom
|
|
29759
29688
|
}));
|
|
29760
29689
|
}
|
|
29761
29690
|
|
|
@@ -29788,7 +29717,8 @@ var Step = function Step(_ref8) {
|
|
|
29788
29717
|
createOption: step.createOption,
|
|
29789
29718
|
onCreateOption: step.onCreateOption,
|
|
29790
29719
|
transformer: step.transformer,
|
|
29791
|
-
buttons: step.format === format.buttonsSelect
|
|
29720
|
+
buttons: step.format === format.buttonsSelect,
|
|
29721
|
+
optionsFrom: step.optionsFrom
|
|
29792
29722
|
}));
|
|
29793
29723
|
|
|
29794
29724
|
default:
|
|
@@ -29830,7 +29760,8 @@ var Step = function Step(_ref8) {
|
|
|
29830
29760
|
createOption: step.createOption,
|
|
29831
29761
|
onCreateOption: step.onCreateOption,
|
|
29832
29762
|
transformer: step.transformer,
|
|
29833
|
-
buttons: step.format === format.buttonsSelect
|
|
29763
|
+
buttons: step.format === format.buttonsSelect,
|
|
29764
|
+
optionsFrom: step.optionsFrom
|
|
29834
29765
|
}));
|
|
29835
29766
|
|
|
29836
29767
|
case format.form:
|
|
@@ -29858,7 +29789,6 @@ var Step = function Step(_ref8) {
|
|
|
29858
29789
|
flow: flow,
|
|
29859
29790
|
step: step,
|
|
29860
29791
|
parent: entry,
|
|
29861
|
-
collapsed: collapsed,
|
|
29862
29792
|
inputWrapper: inputWrapper,
|
|
29863
29793
|
maybeCustomHttpClient: httpClient,
|
|
29864
29794
|
value: getValues(entry) || defaultValue,
|
|
@@ -29907,8 +29837,7 @@ var Step = function Step(_ref8) {
|
|
|
29907
29837
|
entry: entry,
|
|
29908
29838
|
errorDisplayed: errorDisplayed
|
|
29909
29839
|
}, /*#__PURE__*/React.createElement(ObjectInput, {
|
|
29910
|
-
className: classNames(_defineProperty$1({}, classes.input__invalid, errorDisplayed))
|
|
29911
|
-
possibleValues: step.options
|
|
29840
|
+
className: classNames(_defineProperty$1({}, classes.input__invalid, errorDisplayed))
|
|
29912
29841
|
}));
|
|
29913
29842
|
}
|
|
29914
29843
|
|
|
@@ -30119,8 +30048,7 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30119
30048
|
value = _ref12.value,
|
|
30120
30049
|
step = _ref12.step,
|
|
30121
30050
|
functionalProperty = _ref12.functionalProperty,
|
|
30122
|
-
index = _ref12.index
|
|
30123
|
-
props = _objectWithoutProperties(_ref12, _excluded);
|
|
30051
|
+
index = _ref12.index;
|
|
30124
30052
|
|
|
30125
30053
|
var _useFormContext4 = useFormContext(),
|
|
30126
30054
|
getValues = _useFormContext4.getValues,
|
|
@@ -30129,14 +30057,11 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30129
30057
|
_useFormContext4.trigger;
|
|
30130
30058
|
_useFormContext4.formState;
|
|
30131
30059
|
|
|
30132
|
-
var _useState7 = useState(!!step.collapsed
|
|
30060
|
+
var _useState7 = useState(!!step.collapsed),
|
|
30133
30061
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
30134
30062
|
collapsed = _useState8[0],
|
|
30135
30063
|
setCollapsed = _useState8[1];
|
|
30136
30064
|
|
|
30137
|
-
useEffect(function () {
|
|
30138
|
-
setCollapsed(props.collapsed);
|
|
30139
|
-
}, [props.collapsed]);
|
|
30140
30065
|
var classes = useCustomStyle();
|
|
30141
30066
|
var schemaAndFlow = option(step.conditionalSchema).map(function (condiSchema) {
|
|
30142
30067
|
var ref = option(condiSchema.ref).map(function (ref) {
|
package/lib/index.js
CHANGED
|
@@ -486,42 +486,6 @@ function _extends() {
|
|
|
486
486
|
return _extends.apply(this, arguments);
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
490
|
-
if (source == null) return {};
|
|
491
|
-
var target = {};
|
|
492
|
-
var sourceKeys = Object.keys(source);
|
|
493
|
-
var key, i;
|
|
494
|
-
|
|
495
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
496
|
-
key = sourceKeys[i];
|
|
497
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
498
|
-
target[key] = source[key];
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
return target;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
function _objectWithoutProperties(source, excluded) {
|
|
505
|
-
if (source == null) return {};
|
|
506
|
-
|
|
507
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
508
|
-
|
|
509
|
-
var key, i;
|
|
510
|
-
|
|
511
|
-
if (Object.getOwnPropertySymbols) {
|
|
512
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
513
|
-
|
|
514
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
515
|
-
key = sourceSymbolKeys[i];
|
|
516
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
517
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
518
|
-
target[key] = source[key];
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
return target;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
489
|
function _readOnlyError(name) {
|
|
526
490
|
throw new TypeError("\"" + name + "\" is read-only");
|
|
527
491
|
}
|
|
@@ -908,18 +872,13 @@ var BooleanInput = /*#__PURE__*/React__default["default"].forwardRef(function (_
|
|
|
908
872
|
});
|
|
909
873
|
|
|
910
874
|
var Collapse = function Collapse(props) {
|
|
911
|
-
var
|
|
875
|
+
var _classNames4;
|
|
912
876
|
|
|
913
877
|
var _useState = React.useState(props.initCollapsed || props.collapsed),
|
|
914
878
|
_useState2 = _slicedToArray(_useState, 2),
|
|
915
879
|
collapsed = _useState2[0],
|
|
916
880
|
setCollapsed = _useState2[1];
|
|
917
881
|
|
|
918
|
-
var _useState3 = React.useState(false),
|
|
919
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
920
|
-
expandedAll = _useState4[0],
|
|
921
|
-
setExpandedAll = _useState4[1];
|
|
922
|
-
|
|
923
882
|
var classes = useCustomStyle();
|
|
924
883
|
|
|
925
884
|
var toggle = function toggle(e) {
|
|
@@ -927,15 +886,6 @@ var Collapse = function Collapse(props) {
|
|
|
927
886
|
setCollapsed(!collapsed);
|
|
928
887
|
};
|
|
929
888
|
|
|
930
|
-
var childrenWithProps = React__default["default"].Children.map(props.children, function (child) {
|
|
931
|
-
if ( /*#__PURE__*/React__default["default"].isValidElement(child)) {
|
|
932
|
-
return /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
933
|
-
collapsed: expandedAll
|
|
934
|
-
});
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
return child;
|
|
938
|
-
});
|
|
939
889
|
return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("hr", {
|
|
940
890
|
className: classNames__default["default"](_defineProperty$1({}, classes.collapse_error, props.errored))
|
|
941
891
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -943,19 +893,7 @@ var Collapse = function Collapse(props) {
|
|
|
943
893
|
onClick: toggle
|
|
944
894
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
945
895
|
className: classNames__default["default"](classes.collapse_label, _defineProperty$1({}, classes.collapse_error, props.errored))
|
|
946
|
-
}, props.label), /*#__PURE__*/React__default["default"].createElement("
|
|
947
|
-
style: {
|
|
948
|
-
marginLeft: 'auto'
|
|
949
|
-
},
|
|
950
|
-
className: classNames__default["default"](classes.flex)
|
|
951
|
-
}, /*#__PURE__*/React__default["default"].createElement("button", {
|
|
952
|
-
type: "button",
|
|
953
|
-
className: classNames__default["default"](classes.btn, classes.btn_sm, _defineProperty$1({}, classes.collapse_error, props.errored)),
|
|
954
|
-
onClick: function onClick(e) {
|
|
955
|
-
if (e) e.stopPropagation();
|
|
956
|
-
setExpandedAll(!expandedAll);
|
|
957
|
-
}
|
|
958
|
-
}, expandedAll ? 'Expand all' : 'Collapse all'), /*#__PURE__*/React__default["default"].createElement("button", {
|
|
896
|
+
}, props.label), /*#__PURE__*/React__default["default"].createElement("button", {
|
|
959
897
|
type: "button",
|
|
960
898
|
className: classNames__default["default"](classes.btn, classes.btn_sm, classes.ml_5, _defineProperty$1({}, classes.collapse_error, props.errored)),
|
|
961
899
|
onClick: toggle
|
|
@@ -963,9 +901,9 @@ var Collapse = function Collapse(props) {
|
|
|
963
901
|
size: 16
|
|
964
902
|
}), !collapsed && /*#__PURE__*/React__default["default"].createElement(reactFeather.EyeOff, {
|
|
965
903
|
size: 16
|
|
966
|
-
})))
|
|
967
|
-
className: classNames__default["default"]("".concat(classes.ml_10), (
|
|
968
|
-
},
|
|
904
|
+
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
905
|
+
className: classNames__default["default"]("".concat(classes.ml_10), (_classNames4 = {}, _defineProperty$1(_classNames4, classes.display__none, !!collapsed), _defineProperty$1(_classNames4, classes.flex, !!props.inline), _defineProperty$1(_classNames4, classes.collapse__inline, !!props.inline), _classNames4))
|
|
906
|
+
}, props.children), props.lineEnd && /*#__PURE__*/React__default["default"].createElement("hr", null));
|
|
969
907
|
};
|
|
970
908
|
|
|
971
909
|
var option = function option(x) {
|
|
@@ -28611,7 +28549,6 @@ function CodeInput(_ref) {
|
|
|
28611
28549
|
}, []);
|
|
28612
28550
|
React.useEffect(function () {
|
|
28613
28551
|
if (editor && (_typeof$1(value) === 'object' ? JSON.stringify(value, null, 2) : value) !== editor.state.doc.toString()) {
|
|
28614
|
-
console.log("set value", value, value === null || value === undefined ? '' : _typeof$1(value) === 'object' ? JSON.stringify(value, null, 2) : value, editor.state.doc.toString());
|
|
28615
28552
|
editor.dispatch({
|
|
28616
28553
|
changes: {
|
|
28617
28554
|
from: 0,
|
|
@@ -29025,6 +28962,15 @@ var CustomizableInput$1 = /*#__PURE__*/React__default["default"].memo(function (
|
|
|
29025
28962
|
|
|
29026
28963
|
return props.children;
|
|
29027
28964
|
}, function (prev, next) {
|
|
28965
|
+
console.debug({
|
|
28966
|
+
prev: prev,
|
|
28967
|
+
next: next
|
|
28968
|
+
});
|
|
28969
|
+
|
|
28970
|
+
if (next.render) {
|
|
28971
|
+
return false;
|
|
28972
|
+
}
|
|
28973
|
+
|
|
29028
28974
|
return prev.field.value === next.field.value && next.errorDisplayed === prev.errorDisplayed;
|
|
29029
28975
|
});
|
|
29030
28976
|
var ControlledInput = function ControlledInput(_ref) {
|
|
@@ -29105,8 +29051,6 @@ var ControlledInput = function ControlledInput(_ref) {
|
|
|
29105
29051
|
}, component ? component(field, props) : /*#__PURE__*/React__default["default"].cloneElement(children, _objectSpread2$1({}, props)));
|
|
29106
29052
|
};
|
|
29107
29053
|
|
|
29108
|
-
var _excluded = ["schema", "flow", "parent", "inputWrapper", "maybeCustomHttpClient", "errorDisplayed", "value", "step", "functionalProperty", "index"];
|
|
29109
|
-
|
|
29110
29054
|
var usePrevious = function usePrevious(value) {
|
|
29111
29055
|
// The ref object is a generic container whose current property is mutable ...
|
|
29112
29056
|
// ... and can hold any value, similar to an instance property on a class
|
|
@@ -29126,8 +29070,7 @@ var BasicWrapper = function BasicWrapper(_ref) {
|
|
|
29126
29070
|
label = _ref.label,
|
|
29127
29071
|
help = _ref.help,
|
|
29128
29072
|
children = _ref.children,
|
|
29129
|
-
render = _ref.render
|
|
29130
|
-
collapsed = _ref.collapsed;
|
|
29073
|
+
render = _ref.render;
|
|
29131
29074
|
|
|
29132
29075
|
if (_typeof$1(entry) === 'object') {
|
|
29133
29076
|
return children;
|
|
@@ -29156,20 +29099,10 @@ var BasicWrapper = function BasicWrapper(_ref) {
|
|
|
29156
29099
|
label: label,
|
|
29157
29100
|
error: error,
|
|
29158
29101
|
help: help,
|
|
29159
|
-
children: children
|
|
29160
|
-
collapsed: collapsed
|
|
29102
|
+
children: children
|
|
29161
29103
|
});
|
|
29162
29104
|
}
|
|
29163
29105
|
|
|
29164
|
-
var childrenWithProps = React__default["default"].Children.map(children, function (child) {
|
|
29165
|
-
if ( /*#__PURE__*/React__default["default"].isValidElement(child)) {
|
|
29166
|
-
return /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
29167
|
-
collapsed: collapsed
|
|
29168
|
-
});
|
|
29169
|
-
}
|
|
29170
|
-
|
|
29171
|
-
return child;
|
|
29172
|
-
});
|
|
29173
29106
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
29174
29107
|
className: "".concat(classes.mt_10, " ").concat(className),
|
|
29175
29108
|
style: {
|
|
@@ -29194,7 +29127,7 @@ var BasicWrapper = function BasicWrapper(_ref) {
|
|
|
29194
29127
|
marginLeft: '.5rem',
|
|
29195
29128
|
cursor: 'help'
|
|
29196
29129
|
}
|
|
29197
|
-
})))),
|
|
29130
|
+
})))), children, error && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
29198
29131
|
className: classNames__default["default"](classes.feedback, _defineProperty$1({}, classes.txt_red, errorDisplayed))
|
|
29199
29132
|
}, error.message));
|
|
29200
29133
|
};
|
|
@@ -29584,8 +29517,7 @@ var Step = function Step(_ref8) {
|
|
|
29584
29517
|
index = _ref8.index,
|
|
29585
29518
|
functionalProperty = _ref8.functionalProperty,
|
|
29586
29519
|
parent = _ref8.parent,
|
|
29587
|
-
onAfterChange = _ref8.onAfterChange
|
|
29588
|
-
collapsed = _ref8.collapsed;
|
|
29520
|
+
onAfterChange = _ref8.onAfterChange;
|
|
29589
29521
|
var classes = useCustomStyle();
|
|
29590
29522
|
|
|
29591
29523
|
var _useFormContext2 = reactHookForm.useFormContext(),
|
|
@@ -29606,8 +29538,7 @@ var Step = function Step(_ref8) {
|
|
|
29606
29538
|
return !!errors[step] && (dirtyFields[step] || touchedFields[step]);
|
|
29607
29539
|
});
|
|
29608
29540
|
return /*#__PURE__*/React__default["default"].createElement(Collapse, _extends({}, entry, {
|
|
29609
|
-
errored: errored
|
|
29610
|
-
collapsed: collapsed
|
|
29541
|
+
errored: errored
|
|
29611
29542
|
}), entry.flow.map(function (en, entryIdx) {
|
|
29612
29543
|
var stp = schema[en];
|
|
29613
29544
|
_typeof$1(en) === 'object' ? undefined : en.split('.').reduce(function (object, key) {
|
|
@@ -29646,13 +29577,11 @@ var Step = function Step(_ref8) {
|
|
|
29646
29577
|
entry: en,
|
|
29647
29578
|
label: functionalProperty(en, (stp === null || stp === void 0 ? void 0 : stp.label) === null ? null : (stp === null || stp === void 0 ? void 0 : stp.label) || en),
|
|
29648
29579
|
help: stp === null || stp === void 0 ? void 0 : stp.help,
|
|
29649
|
-
render: inputWrapper
|
|
29650
|
-
collapsed: collapsed
|
|
29580
|
+
render: inputWrapper
|
|
29651
29581
|
}, /*#__PURE__*/React__default["default"].createElement(Step, {
|
|
29652
29582
|
entry: en,
|
|
29653
29583
|
step: stp,
|
|
29654
29584
|
schema: schema,
|
|
29655
|
-
collapsed: collapsed,
|
|
29656
29585
|
inputWrapper: inputWrapper,
|
|
29657
29586
|
httpClient: httpClient,
|
|
29658
29587
|
defaultValue: stp === null || stp === void 0 ? void 0 : stp.defaultValue,
|
|
@@ -29730,8 +29659,7 @@ var Step = function Step(_ref8) {
|
|
|
29730
29659
|
defaultValue: (_props$defaultValue = props.defaultValue) === null || _props$defaultValue === void 0 ? void 0 : _props$defaultValue.value,
|
|
29731
29660
|
value: props.value,
|
|
29732
29661
|
index: idx,
|
|
29733
|
-
functionalProperty: functionalProperty
|
|
29734
|
-
collapsed: collapsed
|
|
29662
|
+
functionalProperty: functionalProperty
|
|
29735
29663
|
});
|
|
29736
29664
|
}
|
|
29737
29665
|
}));
|
|
@@ -29789,7 +29717,8 @@ var Step = function Step(_ref8) {
|
|
|
29789
29717
|
isMulti: step.isMulti,
|
|
29790
29718
|
createOption: step.createOption,
|
|
29791
29719
|
transformer: step.transformer,
|
|
29792
|
-
buttons: step.format === format.buttonsSelect
|
|
29720
|
+
buttons: step.format === format.buttonsSelect,
|
|
29721
|
+
optionsFrom: step.optionsFrom
|
|
29793
29722
|
}));
|
|
29794
29723
|
}
|
|
29795
29724
|
|
|
@@ -29822,7 +29751,8 @@ var Step = function Step(_ref8) {
|
|
|
29822
29751
|
createOption: step.createOption,
|
|
29823
29752
|
onCreateOption: step.onCreateOption,
|
|
29824
29753
|
transformer: step.transformer,
|
|
29825
|
-
buttons: step.format === format.buttonsSelect
|
|
29754
|
+
buttons: step.format === format.buttonsSelect,
|
|
29755
|
+
optionsFrom: step.optionsFrom
|
|
29826
29756
|
}));
|
|
29827
29757
|
|
|
29828
29758
|
default:
|
|
@@ -29864,7 +29794,8 @@ var Step = function Step(_ref8) {
|
|
|
29864
29794
|
createOption: step.createOption,
|
|
29865
29795
|
onCreateOption: step.onCreateOption,
|
|
29866
29796
|
transformer: step.transformer,
|
|
29867
|
-
buttons: step.format === format.buttonsSelect
|
|
29797
|
+
buttons: step.format === format.buttonsSelect,
|
|
29798
|
+
optionsFrom: step.optionsFrom
|
|
29868
29799
|
}));
|
|
29869
29800
|
|
|
29870
29801
|
case format.form:
|
|
@@ -29892,7 +29823,6 @@ var Step = function Step(_ref8) {
|
|
|
29892
29823
|
flow: flow,
|
|
29893
29824
|
step: step,
|
|
29894
29825
|
parent: entry,
|
|
29895
|
-
collapsed: collapsed,
|
|
29896
29826
|
inputWrapper: inputWrapper,
|
|
29897
29827
|
maybeCustomHttpClient: httpClient,
|
|
29898
29828
|
value: getValues(entry) || defaultValue,
|
|
@@ -29941,8 +29871,7 @@ var Step = function Step(_ref8) {
|
|
|
29941
29871
|
entry: entry,
|
|
29942
29872
|
errorDisplayed: errorDisplayed
|
|
29943
29873
|
}, /*#__PURE__*/React__default["default"].createElement(ObjectInput, {
|
|
29944
|
-
className: classNames__default["default"](_defineProperty$1({}, classes.input__invalid, errorDisplayed))
|
|
29945
|
-
possibleValues: step.options
|
|
29874
|
+
className: classNames__default["default"](_defineProperty$1({}, classes.input__invalid, errorDisplayed))
|
|
29946
29875
|
}));
|
|
29947
29876
|
}
|
|
29948
29877
|
|
|
@@ -30153,8 +30082,7 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30153
30082
|
value = _ref12.value,
|
|
30154
30083
|
step = _ref12.step,
|
|
30155
30084
|
functionalProperty = _ref12.functionalProperty,
|
|
30156
|
-
index = _ref12.index
|
|
30157
|
-
props = _objectWithoutProperties(_ref12, _excluded);
|
|
30085
|
+
index = _ref12.index;
|
|
30158
30086
|
|
|
30159
30087
|
var _useFormContext4 = reactHookForm.useFormContext(),
|
|
30160
30088
|
getValues = _useFormContext4.getValues,
|
|
@@ -30163,14 +30091,11 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
30163
30091
|
_useFormContext4.trigger;
|
|
30164
30092
|
_useFormContext4.formState;
|
|
30165
30093
|
|
|
30166
|
-
var _useState7 = React.useState(!!step.collapsed
|
|
30094
|
+
var _useState7 = React.useState(!!step.collapsed),
|
|
30167
30095
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
30168
30096
|
collapsed = _useState8[0],
|
|
30169
30097
|
setCollapsed = _useState8[1];
|
|
30170
30098
|
|
|
30171
|
-
React.useEffect(function () {
|
|
30172
|
-
setCollapsed(props.collapsed);
|
|
30173
|
-
}, [props.collapsed]);
|
|
30174
30099
|
var classes = useCustomStyle();
|
|
30175
30100
|
var schemaAndFlow = option(step.conditionalSchema).map(function (condiSchema) {
|
|
30176
30101
|
var ref = option(condiSchema.ref).map(function (ref) {
|