@maif/react-forms 1.0.57 → 1.0.60
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 +80 -87
- package/lib/index.css +114 -114
- package/lib/index.js +80 -87
- package/package.json +1 -1
package/lib/esm/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import 'fs';
|
|
2
1
|
import * as yup from 'yup';
|
|
3
2
|
import React, { useState, useRef, useEffect, useImperativeHandle } from 'react';
|
|
4
3
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
@@ -547,28 +546,28 @@ var BooleanInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
547
546
|
};
|
|
548
547
|
|
|
549
548
|
return /*#__PURE__*/React.createElement("div", {
|
|
550
|
-
className: classNames((_classNames = {}, _defineProperty$1(_classNames, 'cursor_pointer', !readOnly), _defineProperty$1(_classNames, 'cursor_not_allowed', readOnly), _classNames))
|
|
549
|
+
className: classNames((_classNames = {}, _defineProperty$1(_classNames, 'mrf-cursor_pointer', !readOnly), _defineProperty$1(_classNames, 'mrf-cursor_not_allowed', readOnly), _classNames))
|
|
551
550
|
}, !!value && /*#__PURE__*/React.createElement("div", {
|
|
552
|
-
className: classNames('content_switch_button_on'),
|
|
551
|
+
className: classNames('mrf-content_switch_button_on'),
|
|
553
552
|
onClick: function onClick() {
|
|
554
553
|
return handleClick(false);
|
|
555
554
|
}
|
|
556
555
|
}, /*#__PURE__*/React.createElement("div", {
|
|
557
|
-
className: classNames('switch_button_on')
|
|
556
|
+
className: classNames('mrf-switch_button_on')
|
|
558
557
|
})), !value && value !== null && /*#__PURE__*/React.createElement("div", {
|
|
559
|
-
className: classNames('content_switch_button_off'),
|
|
558
|
+
className: classNames('mrf-content_switch_button_off'),
|
|
560
559
|
onClick: function onClick() {
|
|
561
560
|
return handleClick(true);
|
|
562
561
|
}
|
|
563
562
|
}, /*#__PURE__*/React.createElement("div", {
|
|
564
|
-
className: classNames('switch_button_off')
|
|
563
|
+
className: classNames('mrf-switch_button_off')
|
|
565
564
|
})), value === null && /*#__PURE__*/React.createElement("div", {
|
|
566
|
-
className: classNames('content_switch_button_null'),
|
|
565
|
+
className: classNames('mrf-content_switch_button_null'),
|
|
567
566
|
onClick: function onClick() {
|
|
568
567
|
return handleClick(true);
|
|
569
568
|
}
|
|
570
569
|
}, /*#__PURE__*/React.createElement("div", {
|
|
571
|
-
className: classNames('switch_button_null')
|
|
570
|
+
className: classNames('mrf-switch_button_null')
|
|
572
571
|
})));
|
|
573
572
|
});
|
|
574
573
|
|
|
@@ -586,22 +585,22 @@ var Collapse = function Collapse(props) {
|
|
|
586
585
|
};
|
|
587
586
|
|
|
588
587
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("hr", {
|
|
589
|
-
className: classNames(_defineProperty$1({}, 'collapse_error', props.errored))
|
|
588
|
+
className: classNames(_defineProperty$1({}, 'mrf-collapse_error', props.errored))
|
|
590
589
|
}), /*#__PURE__*/React.createElement("div", {
|
|
591
|
-
className: "cursor_pointer flex jc_between",
|
|
590
|
+
className: "mrf-cursor_pointer mrf-flex mrf-jc_between",
|
|
592
591
|
onClick: toggle
|
|
593
592
|
}, /*#__PURE__*/React.createElement("span", {
|
|
594
|
-
className: classNames('collapse_label', _defineProperty$1({}, 'collapse_error', props.errored))
|
|
593
|
+
className: classNames('mrf-collapse_label', _defineProperty$1({}, 'mrf-collapse_error', props.errored))
|
|
595
594
|
}, props.label), /*#__PURE__*/React.createElement("button", {
|
|
596
595
|
type: "button",
|
|
597
|
-
className: classNames('btn', 'btn_sm', 'ml_5', _defineProperty$1({}, 'collapse_error', props.errored)),
|
|
596
|
+
className: classNames('mrf-btn', 'mrf-btn_sm', 'mrf-ml_5', _defineProperty$1({}, 'mrf-collapse_error', props.errored)),
|
|
598
597
|
onClick: toggle
|
|
599
598
|
}, !!collapsed && /*#__PURE__*/React.createElement(Eye, {
|
|
600
599
|
size: 16
|
|
601
600
|
}), !collapsed && /*#__PURE__*/React.createElement(EyeOff, {
|
|
602
601
|
size: 16
|
|
603
602
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
604
|
-
className: classNames('ml_10', (_classNames4 = {}, _defineProperty$1(_classNames4, 'display__none', !!collapsed), _defineProperty$1(_classNames4, 'flex', !!props.inline), _defineProperty$1(_classNames4, 'collapse__inline', !!props.inline), _classNames4))
|
|
603
|
+
className: classNames('mrf-ml_10', (_classNames4 = {}, _defineProperty$1(_classNames4, 'mrf-display__none', !!collapsed), _defineProperty$1(_classNames4, 'mrf-flex', !!props.inline), _defineProperty$1(_classNames4, 'mrf-collapse__inline', !!props.inline), _classNames4))
|
|
605
604
|
}, props.children), props.lineEnd && /*#__PURE__*/React.createElement("hr", null));
|
|
606
605
|
};
|
|
607
606
|
|
|
@@ -853,7 +852,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function (props, _) {
|
|
|
853
852
|
key: idx,
|
|
854
853
|
type: "button",
|
|
855
854
|
disabled: props.disabled,
|
|
856
|
-
className: classNames(props.className, 'btn btn_grey ml_5', {
|
|
855
|
+
className: classNames(props.className, 'mrf-btn mrf-btn_grey mrf-ml_5', {
|
|
857
856
|
active: active
|
|
858
857
|
}),
|
|
859
858
|
onClick: function onClick() {
|
|
@@ -1005,7 +1004,7 @@ var ObjectInput = function ObjectInput(props) {
|
|
|
1005
1004
|
}, Object.keys(internalState || {}).length === 0 && /*#__PURE__*/React.createElement("button", {
|
|
1006
1005
|
disabled: props.disabled,
|
|
1007
1006
|
type: "button",
|
|
1008
|
-
className: "flex btn btn_blue btn_sm",
|
|
1007
|
+
className: "mrf-flex mrf-btn mrf-btn_blue mrf-btn_sm",
|
|
1009
1008
|
onClick: addFirst
|
|
1010
1009
|
}, /*#__PURE__*/React.createElement(PlusCircle, null)), Object.entries(internalState || {}).map(function (_ref9, idx) {
|
|
1011
1010
|
var _ref10 = _slicedToArray(_ref9, 2),
|
|
@@ -1015,12 +1014,12 @@ var ObjectInput = function ObjectInput(props) {
|
|
|
1015
1014
|
value = _ref10$.value;
|
|
1016
1015
|
|
|
1017
1016
|
return /*#__PURE__*/React.createElement("div", {
|
|
1018
|
-
className: "flex mt_5",
|
|
1017
|
+
className: "mrf-flex mrf-mt_5",
|
|
1019
1018
|
key: idx
|
|
1020
1019
|
}, /*#__PURE__*/React.createElement("input", {
|
|
1021
1020
|
disabled: props.disabled,
|
|
1022
1021
|
type: "text",
|
|
1023
|
-
className: "w_50 input",
|
|
1022
|
+
className: "mrf-w_50 mrf-input",
|
|
1024
1023
|
placeholder: props.placeholderKey,
|
|
1025
1024
|
value: key,
|
|
1026
1025
|
onChange: function onChange(e) {
|
|
@@ -1029,7 +1028,7 @@ var ObjectInput = function ObjectInput(props) {
|
|
|
1029
1028
|
}), /*#__PURE__*/React.createElement("input", {
|
|
1030
1029
|
disabled: props.disabled,
|
|
1031
1030
|
type: "text",
|
|
1032
|
-
className: "w_50 input",
|
|
1031
|
+
className: "mrf-w_50 mrf-input",
|
|
1033
1032
|
placeholder: props.placeholderValue,
|
|
1034
1033
|
value: value,
|
|
1035
1034
|
onChange: function onChange(e) {
|
|
@@ -1038,14 +1037,14 @@ var ObjectInput = function ObjectInput(props) {
|
|
|
1038
1037
|
}), /*#__PURE__*/React.createElement("button", {
|
|
1039
1038
|
disabled: props.disabled,
|
|
1040
1039
|
type: "button",
|
|
1041
|
-
className: "flex btn btn_red btn_sm ml_10",
|
|
1040
|
+
className: "mrf-flex mrf-btn mrf-btn_red mrf-btn_sm mrf-ml_10",
|
|
1042
1041
|
onClick: function onClick() {
|
|
1043
1042
|
return remove(id);
|
|
1044
1043
|
}
|
|
1045
1044
|
}, /*#__PURE__*/React.createElement(MinusCircle, null)), idx === Object.keys(internalState).length - 1 && /*#__PURE__*/React.createElement("button", {
|
|
1046
1045
|
disabled: props.disabled,
|
|
1047
1046
|
type: "button",
|
|
1048
|
-
className: "flex btn btn_blue btn_sm ml_5",
|
|
1047
|
+
className: "mrf-flex mrf-btn mrf-btn_blue mrf-btn_sm mrf-ml_5",
|
|
1049
1048
|
onClick: addNext
|
|
1050
1049
|
}, /*#__PURE__*/React.createElement(PlusCircle, null)));
|
|
1051
1050
|
}));
|
|
@@ -28442,7 +28441,7 @@ var MarkdownInput = function MarkdownInput(props) {
|
|
|
28442
28441
|
}];
|
|
28443
28442
|
|
|
28444
28443
|
var showPreview = function showPreview() {
|
|
28445
|
-
var parent = _toConsumableArray$1(document.getElementsByClassName('preview'));
|
|
28444
|
+
var parent = _toConsumableArray$1(document.getElementsByClassName('mrf-preview'));
|
|
28446
28445
|
|
|
28447
28446
|
if (parent.length > 0) _toConsumableArray$1(parent[0].querySelectorAll('pre code')).forEach(function (block) {
|
|
28448
28447
|
return hljs.highlightElement(block);
|
|
@@ -28457,7 +28456,7 @@ var MarkdownInput = function MarkdownInput(props) {
|
|
|
28457
28456
|
|
|
28458
28457
|
return /*#__PURE__*/React.createElement("button", {
|
|
28459
28458
|
type: "button",
|
|
28460
|
-
className: classNames('btn_for_descriptionToolbar'),
|
|
28459
|
+
className: classNames('mrf-btn_for_descriptionToolbar'),
|
|
28461
28460
|
"aria-label": command.name,
|
|
28462
28461
|
title: command.name,
|
|
28463
28462
|
key: "toolbar-btn-".concat(idx),
|
|
@@ -28493,7 +28492,7 @@ var MarkdownInput = function MarkdownInput(props) {
|
|
|
28493
28492
|
}
|
|
28494
28493
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
|
|
28495
28494
|
type: "button",
|
|
28496
|
-
className: "btn btn_sm",
|
|
28495
|
+
className: "mrf-btn mrf-btn_sm",
|
|
28497
28496
|
style: {
|
|
28498
28497
|
color: !preview ? '#7f96af' : 'white',
|
|
28499
28498
|
backgroundColor: preview ? '#7f96af' : 'white'
|
|
@@ -28503,7 +28502,7 @@ var MarkdownInput = function MarkdownInput(props) {
|
|
|
28503
28502
|
}
|
|
28504
28503
|
}, "Write"), /*#__PURE__*/React.createElement("button", {
|
|
28505
28504
|
type: "button",
|
|
28506
|
-
className: "btn btn_sm ml_5",
|
|
28505
|
+
className: "mrf-btn mrf-btn_sm mrf-ml_5",
|
|
28507
28506
|
style: {
|
|
28508
28507
|
color: preview ? '#7f96af' : 'white',
|
|
28509
28508
|
backgroundColor: preview ? 'white' : '#7f96af'
|
|
@@ -28512,13 +28511,13 @@ var MarkdownInput = function MarkdownInput(props) {
|
|
|
28512
28511
|
return setPreview(true);
|
|
28513
28512
|
}
|
|
28514
28513
|
}, "Preview"))), /*#__PURE__*/React.createElement("div", {
|
|
28515
|
-
className: "flex flexWrap"
|
|
28514
|
+
className: "mrf-flex mrf-flexWrap"
|
|
28516
28515
|
}, injectButtons())), !preview && /*#__PURE__*/React.createElement(CodeInput, _extends({}, props, {
|
|
28517
28516
|
setRef: function setRef(e) {
|
|
28518
28517
|
return ref.current = e;
|
|
28519
28518
|
}
|
|
28520
28519
|
})), preview && /*#__PURE__*/React.createElement("div", {
|
|
28521
|
-
className: "preview",
|
|
28520
|
+
className: "mrf-preview",
|
|
28522
28521
|
dangerouslySetInnerHTML: {
|
|
28523
28522
|
__html: converter.makeHtml(props.value)
|
|
28524
28523
|
}
|
|
@@ -28840,19 +28839,19 @@ var BasicWrapper = function BasicWrapper(_ref) {
|
|
|
28840
28839
|
}
|
|
28841
28840
|
|
|
28842
28841
|
return /*#__PURE__*/React.createElement("div", {
|
|
28843
|
-
className: "mt_10",
|
|
28842
|
+
className: "mrf-mt_10",
|
|
28844
28843
|
style: {
|
|
28845
28844
|
position: 'relative'
|
|
28846
28845
|
}
|
|
28847
28846
|
}, label && /*#__PURE__*/React.createElement("label", {
|
|
28848
|
-
className: "flex ai_center mb_5",
|
|
28847
|
+
className: "mrf-flex mrf-ai_center mrf-mb_5",
|
|
28849
28848
|
htmlFor: entry
|
|
28850
28849
|
}, /*#__PURE__*/React.createElement("span", null, label), help && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ReactToolTip, {
|
|
28851
28850
|
html: true,
|
|
28852
28851
|
place: 'bottom',
|
|
28853
28852
|
id: id
|
|
28854
28853
|
}), /*#__PURE__*/React.createElement("span", {
|
|
28855
|
-
className: "flex ai_center",
|
|
28854
|
+
className: "mrf-flex mrf-ai_center",
|
|
28856
28855
|
"data-html": true,
|
|
28857
28856
|
"data-tip": help,
|
|
28858
28857
|
"data-for": id
|
|
@@ -28864,7 +28863,7 @@ var BasicWrapper = function BasicWrapper(_ref) {
|
|
|
28864
28863
|
cursor: 'help'
|
|
28865
28864
|
}
|
|
28866
28865
|
})))), children, error && /*#__PURE__*/React.createElement("div", {
|
|
28867
|
-
className: classNames('feedback', _defineProperty$1({}, 'txt_red', errorDisplayed))
|
|
28866
|
+
className: classNames('mrf-feedback', _defineProperty$1({}, 'mrf-txt_red', errorDisplayed))
|
|
28868
28867
|
}, error.message));
|
|
28869
28868
|
};
|
|
28870
28869
|
|
|
@@ -29046,13 +29045,7 @@ var Form = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
|
|
|
29046
29045
|
_ref7$options = _ref7.options,
|
|
29047
29046
|
options = _ref7$options === void 0 ? {} : _ref7$options;
|
|
29048
29047
|
_ref7.nostyle;
|
|
29049
|
-
|
|
29050
|
-
var _useState = useState(schema),
|
|
29051
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
29052
|
-
calcSchema = _useState2[0];
|
|
29053
|
-
_useState2[1];
|
|
29054
|
-
|
|
29055
|
-
var formFlow = flow || Object.keys(calcSchema);
|
|
29048
|
+
var formFlow = flow || Object.keys(schema);
|
|
29056
29049
|
|
|
29057
29050
|
var maybeCustomHttpClient = function maybeCustomHttpClient(url, method) {
|
|
29058
29051
|
//todo: if present props.resolve()
|
|
@@ -29069,7 +29062,7 @@ var Form = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
|
|
|
29069
29062
|
});
|
|
29070
29063
|
};
|
|
29071
29064
|
|
|
29072
|
-
var defaultValues = getDefaultValues(formFlow,
|
|
29065
|
+
var defaultValues = getDefaultValues(formFlow, schema, value); //FIXME: get real schema through the switch
|
|
29073
29066
|
|
|
29074
29067
|
var _resolver = function resolver(rawData) {
|
|
29075
29068
|
var _getShapeAndDependenc2 = getShapeAndDependencies(formFlow, schema, [], rawData),
|
|
@@ -29088,10 +29081,10 @@ var Form = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
|
|
|
29088
29081
|
mode: 'onChange'
|
|
29089
29082
|
});
|
|
29090
29083
|
|
|
29091
|
-
var
|
|
29092
|
-
|
|
29093
|
-
initialReseted =
|
|
29094
|
-
|
|
29084
|
+
var _useState = useState(false),
|
|
29085
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29086
|
+
initialReseted = _useState2[0];
|
|
29087
|
+
_useState2[1]; // useEffect(() => {
|
|
29095
29088
|
// reset(cleanInputArray(value, defaultValues, flow, schema))
|
|
29096
29089
|
// setReset(true)
|
|
29097
29090
|
// }, [reset])
|
|
@@ -29110,7 +29103,7 @@ var Form = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
|
|
|
29110
29103
|
watch = methods.watch;
|
|
29111
29104
|
useHashEffect(function () {
|
|
29112
29105
|
_reset(_objectSpread2$1({}, cleanInputArray(value, defaultValues, flow, schema)));
|
|
29113
|
-
}, [value,
|
|
29106
|
+
}, [value, schema]);
|
|
29114
29107
|
|
|
29115
29108
|
var functionalProperty = function functionalProperty(entry, prop) {
|
|
29116
29109
|
if (typeof prop === 'function') {
|
|
@@ -29147,7 +29140,7 @@ var Form = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
|
|
|
29147
29140
|
handleSubmit: _handleSubmit,
|
|
29148
29141
|
watch: methods.watch
|
|
29149
29142
|
}), /*#__PURE__*/React.createElement("form", {
|
|
29150
|
-
className: className || "pr_15 w_100",
|
|
29143
|
+
className: className || "mrf-pr_15 mrf-w_100",
|
|
29151
29144
|
onSubmit: _handleSubmit(function (data) {
|
|
29152
29145
|
var clean = cleanOutputArray(data, schema);
|
|
29153
29146
|
onSubmit(clean);
|
|
@@ -29223,9 +29216,9 @@ var Footer = function Footer(props) {
|
|
|
29223
29216
|
|
|
29224
29217
|
var isSubmitDisplayed = ((_props$actions = props.actions) === null || _props$actions === void 0 ? void 0 : (_props$actions$submit = _props$actions.submit) === null || _props$actions$submit === void 0 ? void 0 : _props$actions$submit.display) === undefined ? true : !!((_props$actions2 = props.actions) !== null && _props$actions2 !== void 0 && (_props$actions2$submi = _props$actions2.submit) !== null && _props$actions2$submi !== void 0 && _props$actions2$submi.display);
|
|
29225
29218
|
return /*#__PURE__*/React.createElement("div", {
|
|
29226
|
-
className: "flex jc_end mt_5"
|
|
29219
|
+
className: "mrf-flex mrf-jc_end mrf-mt_5"
|
|
29227
29220
|
}, ((_props$actions3 = props.actions) === null || _props$actions3 === void 0 ? void 0 : (_props$actions3$cance = _props$actions3.cancel) === null || _props$actions3$cance === void 0 ? void 0 : _props$actions3$cance.display) && /*#__PURE__*/React.createElement("button", {
|
|
29228
|
-
className: "btn btn_red",
|
|
29221
|
+
className: "mrf-btn mrf-btn_red",
|
|
29229
29222
|
type: "button",
|
|
29230
29223
|
onClick: function onClick() {
|
|
29231
29224
|
var _props$actions4;
|
|
@@ -29233,11 +29226,11 @@ var Footer = function Footer(props) {
|
|
|
29233
29226
|
return (_props$actions4 = props.actions) === null || _props$actions4 === void 0 ? void 0 : _props$actions4.cancel.action();
|
|
29234
29227
|
}
|
|
29235
29228
|
}, ((_props$actions5 = props.actions) === null || _props$actions5 === void 0 ? void 0 : (_props$actions5$cance = _props$actions5.cancel) === null || _props$actions5$cance === void 0 ? void 0 : _props$actions5$cance.label) || 'Cancel'), ((_props$actions6 = props.actions) === null || _props$actions6 === void 0 ? void 0 : (_props$actions6$reset = _props$actions6.reset) === null || _props$actions6$reset === void 0 ? void 0 : _props$actions6$reset.display) && /*#__PURE__*/React.createElement("button", {
|
|
29236
|
-
className: "btn btn_red",
|
|
29229
|
+
className: "mrf-btn mrf-btn_red",
|
|
29237
29230
|
type: "button",
|
|
29238
29231
|
onClick: props.reset
|
|
29239
29232
|
}, ((_props$actions7 = props.actions) === null || _props$actions7 === void 0 ? void 0 : (_props$actions7$reset = _props$actions7.reset) === null || _props$actions7$reset === void 0 ? void 0 : _props$actions7$reset.label) || 'Reset'), isSubmitDisplayed && /*#__PURE__*/React.createElement("button", {
|
|
29240
|
-
className: "btn btn_green ml_10",
|
|
29233
|
+
className: "mrf-btn mrf-btn_green mrf-ml_10",
|
|
29241
29234
|
type: "submit"
|
|
29242
29235
|
}, ((_props$actions8 = props.actions) === null || _props$actions8 === void 0 ? void 0 : (_props$actions8$submi = _props$actions8.submit) === null || _props$actions8$submi === void 0 ? void 0 : _props$actions8$submi.label) || 'Save'));
|
|
29243
29236
|
};
|
|
@@ -29411,7 +29404,7 @@ var Step = function Step(_ref8) {
|
|
|
29411
29404
|
errorDisplayed: errorDisplayed
|
|
29412
29405
|
}, /*#__PURE__*/React.createElement("textarea", {
|
|
29413
29406
|
type: "text",
|
|
29414
|
-
className: classNames('input', step.className, _defineProperty$1({}, 'input__invalid', errorDisplayed))
|
|
29407
|
+
className: classNames('mrf-input', step.className, _defineProperty$1({}, 'mrf-mrf-input__invalid', errorDisplayed))
|
|
29415
29408
|
}));
|
|
29416
29409
|
|
|
29417
29410
|
case format.code:
|
|
@@ -29423,7 +29416,7 @@ var Step = function Step(_ref8) {
|
|
|
29423
29416
|
entry: entry,
|
|
29424
29417
|
errorDisplayed: errorDisplayed
|
|
29425
29418
|
}, /*#__PURE__*/React.createElement(Component, {
|
|
29426
|
-
className: classNames(step.className, _defineProperty$1({}, 'input__invalid', errorDisplayed))
|
|
29419
|
+
className: classNames(step.className, _defineProperty$1({}, 'mrf-input__invalid', errorDisplayed))
|
|
29427
29420
|
}));
|
|
29428
29421
|
|
|
29429
29422
|
case format.markdown:
|
|
@@ -29433,7 +29426,7 @@ var Step = function Step(_ref8) {
|
|
|
29433
29426
|
entry: entry,
|
|
29434
29427
|
errorDisplayed: errorDisplayed
|
|
29435
29428
|
}, /*#__PURE__*/React.createElement(MarkdownInput, {
|
|
29436
|
-
className: classNames(step.className, _defineProperty$1({}, 'input__invalid', errorDisplayed))
|
|
29429
|
+
className: classNames(step.className, _defineProperty$1({}, 'mrf-input__invalid', errorDisplayed))
|
|
29437
29430
|
}));
|
|
29438
29431
|
|
|
29439
29432
|
case format.buttonsSelect:
|
|
@@ -29445,7 +29438,7 @@ var Step = function Step(_ref8) {
|
|
|
29445
29438
|
entry: entry,
|
|
29446
29439
|
errorDisplayed: errorDisplayed
|
|
29447
29440
|
}, /*#__PURE__*/React.createElement(SelectInput, _extends({
|
|
29448
|
-
className: classNames('flex_grow_1', step.className, _defineProperty$1({}, 'input__invalid', errorDisplayed)),
|
|
29441
|
+
className: classNames('mrf-flex_grow_1', step.className, _defineProperty$1({}, 'mrf-input__invalid', errorDisplayed)),
|
|
29449
29442
|
disabled: functionalProperty(entry, step.disabled)
|
|
29450
29443
|
}, step.props, {
|
|
29451
29444
|
possibleValues: step.options,
|
|
@@ -29466,7 +29459,7 @@ var Step = function Step(_ref8) {
|
|
|
29466
29459
|
errorDisplayed: errorDisplayed
|
|
29467
29460
|
}, /*#__PURE__*/React.createElement("input", {
|
|
29468
29461
|
type: step.format || 'text',
|
|
29469
|
-
className: classNames('input', step.className, _defineProperty$1({}, 'input__invalid', errorDisplayed))
|
|
29462
|
+
className: classNames('mrf-input', step.className, _defineProperty$1({}, 'mrf-input__invalid', errorDisplayed))
|
|
29470
29463
|
}));
|
|
29471
29464
|
}
|
|
29472
29465
|
|
|
@@ -29480,7 +29473,7 @@ var Step = function Step(_ref8) {
|
|
|
29480
29473
|
entry: entry,
|
|
29481
29474
|
errorDisplayed: errorDisplayed
|
|
29482
29475
|
}, /*#__PURE__*/React.createElement(SelectInput, _extends({
|
|
29483
|
-
className: classNames('content', step.className, _defineProperty$1({}, 'input__invalid', errorDisplayed))
|
|
29476
|
+
className: classNames('mrf-content', step.className, _defineProperty$1({}, 'mrf-input__invalid', errorDisplayed))
|
|
29484
29477
|
}, step.props, {
|
|
29485
29478
|
possibleValues: step.options,
|
|
29486
29479
|
httpClient: httpClient,
|
|
@@ -29500,7 +29493,7 @@ var Step = function Step(_ref8) {
|
|
|
29500
29493
|
errorDisplayed: errorDisplayed
|
|
29501
29494
|
}, /*#__PURE__*/React.createElement("input", {
|
|
29502
29495
|
type: step.format || 'number',
|
|
29503
|
-
className: classNames('input', step.className, _defineProperty$1({}, 'input__invalid', errorDisplayed))
|
|
29496
|
+
className: classNames('mrf-input', step.className, _defineProperty$1({}, 'mrf-input__invalid', errorDisplayed))
|
|
29504
29497
|
}));
|
|
29505
29498
|
}
|
|
29506
29499
|
|
|
@@ -29510,7 +29503,7 @@ var Step = function Step(_ref8) {
|
|
|
29510
29503
|
entry: entry,
|
|
29511
29504
|
errorDisplayed: errorDisplayed
|
|
29512
29505
|
}, /*#__PURE__*/React.createElement(BooleanInput, {
|
|
29513
|
-
className: classNames(
|
|
29506
|
+
className: classNames(step.className, _defineProperty$1({}, 'mrf-input__invalid', errorDisplayed))
|
|
29514
29507
|
}));
|
|
29515
29508
|
|
|
29516
29509
|
case type.object:
|
|
@@ -29523,7 +29516,7 @@ var Step = function Step(_ref8) {
|
|
|
29523
29516
|
entry: entry,
|
|
29524
29517
|
errorDisplayed: errorDisplayed
|
|
29525
29518
|
}, /*#__PURE__*/React.createElement(SelectInput, _extends({
|
|
29526
|
-
className: classNames('flex_grow_1', step.className, _defineProperty$1({}, 'input__invalid', errorDisplayed))
|
|
29519
|
+
className: classNames('mrf-flex_grow_1', step.className, _defineProperty$1({}, 'mrf-input__invalid', errorDisplayed))
|
|
29527
29520
|
}, step.props, {
|
|
29528
29521
|
possibleValues: step.options,
|
|
29529
29522
|
httpClient: httpClient,
|
|
@@ -29576,7 +29569,7 @@ var Step = function Step(_ref8) {
|
|
|
29576
29569
|
errorDisplayed: errorDisplayed,
|
|
29577
29570
|
component: function component(field, props) {
|
|
29578
29571
|
return /*#__PURE__*/React.createElement(CodeInput, _extends({}, props, {
|
|
29579
|
-
className: classNames(step.className, _defineProperty$1({}, 'input__invalid', error)),
|
|
29572
|
+
className: classNames(step.className, _defineProperty$1({}, 'mrf-input__invalid', error)),
|
|
29580
29573
|
onChange: function onChange(e) {
|
|
29581
29574
|
_readOnlyError("errorDisplayed");
|
|
29582
29575
|
var v;
|
|
@@ -29608,7 +29601,7 @@ var Step = function Step(_ref8) {
|
|
|
29608
29601
|
entry: entry,
|
|
29609
29602
|
errorDisplayed: errorDisplayed
|
|
29610
29603
|
}, /*#__PURE__*/React.createElement(ObjectInput, {
|
|
29611
|
-
className: classNames(step.className, _defineProperty$1({}, 'input__invalid', errorDisplayed))
|
|
29604
|
+
className: classNames(step.className, _defineProperty$1({}, 'mrf-input__invalid', errorDisplayed))
|
|
29612
29605
|
}));
|
|
29613
29606
|
}
|
|
29614
29607
|
|
|
@@ -29619,7 +29612,7 @@ var Step = function Step(_ref8) {
|
|
|
29619
29612
|
entry: entry,
|
|
29620
29613
|
errorDisplayed: errorDisplayed
|
|
29621
29614
|
}, /*#__PURE__*/React.createElement(DatePicker, {
|
|
29622
|
-
className: classNames('datepicker', step.className, _defineProperty$1({}, 'input__invalid', errorDisplayed)),
|
|
29615
|
+
className: classNames('mrf-datepicker', step.className, _defineProperty$1({}, 'mrf-input__invalid', errorDisplayed)),
|
|
29623
29616
|
formatStyle: "large"
|
|
29624
29617
|
}));
|
|
29625
29618
|
|
|
@@ -29633,15 +29626,15 @@ var Step = function Step(_ref8) {
|
|
|
29633
29626
|
var FileInput = function FileInput(_ref10) {
|
|
29634
29627
|
var onChange = _ref10.onChange;
|
|
29635
29628
|
|
|
29636
|
-
var
|
|
29637
|
-
|
|
29638
|
-
uploading =
|
|
29639
|
-
setUploading =
|
|
29629
|
+
var _useState3 = useState(false),
|
|
29630
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29631
|
+
uploading = _useState4[0],
|
|
29632
|
+
setUploading = _useState4[1];
|
|
29640
29633
|
|
|
29641
|
-
var
|
|
29642
|
-
|
|
29643
|
-
input =
|
|
29644
|
-
setInput =
|
|
29634
|
+
var _useState5 = useState(undefined),
|
|
29635
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
29636
|
+
input = _useState6[0],
|
|
29637
|
+
setInput = _useState6[1];
|
|
29645
29638
|
|
|
29646
29639
|
var setFiles = function setFiles(e) {
|
|
29647
29640
|
var files = e.target.files;
|
|
@@ -29656,24 +29649,24 @@ var Step = function Step(_ref8) {
|
|
|
29656
29649
|
|
|
29657
29650
|
var files = field.value || [];
|
|
29658
29651
|
return /*#__PURE__*/React.createElement("div", {
|
|
29659
|
-
className: classNames('flex', 'ai_center', step.className, _defineProperty$1({}, 'input__invalid', error))
|
|
29652
|
+
className: classNames('mrf-flex', 'mrf-ai_center', step.className, _defineProperty$1({}, 'mrf-input__invalid', error))
|
|
29660
29653
|
}, /*#__PURE__*/React.createElement("input", {
|
|
29661
29654
|
ref: function ref(r) {
|
|
29662
29655
|
return setInput(r);
|
|
29663
29656
|
},
|
|
29664
29657
|
type: "file",
|
|
29665
29658
|
multiple: true,
|
|
29666
|
-
className:
|
|
29659
|
+
className: "mrf-d_none",
|
|
29667
29660
|
onChange: setFiles
|
|
29668
29661
|
}), /*#__PURE__*/React.createElement("button", {
|
|
29669
29662
|
type: "button",
|
|
29670
|
-
className: "btn btn_sm flex ai_center",
|
|
29663
|
+
className: "mrf-btn mrf-btn_sm mrf-flex mrf-ai_center",
|
|
29671
29664
|
disabled: uploading || functionalProperty(entry, step.disabled),
|
|
29672
29665
|
onClick: trigger
|
|
29673
29666
|
}, uploading && /*#__PURE__*/React.createElement(Loader, null), !uploading && /*#__PURE__*/React.createElement(Upload, null), /*#__PURE__*/React.createElement("span", {
|
|
29674
|
-
className: "ml_5"
|
|
29667
|
+
className: "mrf-ml_5"
|
|
29675
29668
|
}, "Select file(s)")), /*#__PURE__*/React.createElement("span", {
|
|
29676
|
-
className: "ml_5"
|
|
29669
|
+
className: "mrf-ml_5"
|
|
29677
29670
|
}, files.length <= 0 ? 'No files selected' : files.map(function (r) {
|
|
29678
29671
|
return r.name;
|
|
29679
29672
|
}).join(" , ")));
|
|
@@ -29695,7 +29688,7 @@ var Step = function Step(_ref8) {
|
|
|
29695
29688
|
entry: entry,
|
|
29696
29689
|
component: function component(field, props) {
|
|
29697
29690
|
return /*#__PURE__*/React.createElement(CodeInput, _extends({}, props, {
|
|
29698
|
-
className: classNames(_defineProperty$1({}, 'input__invalid', error)),
|
|
29691
|
+
className: classNames(_defineProperty$1({}, 'mrf-input__invalid', error)),
|
|
29699
29692
|
onChange: function onChange(v) {
|
|
29700
29693
|
field.onChange(v);
|
|
29701
29694
|
option(step.onChange).map(function (onChange) {
|
|
@@ -29753,7 +29746,7 @@ var ArrayStep = function ArrayStep(_ref11) {
|
|
|
29753
29746
|
return /*#__PURE__*/React.createElement("div", {
|
|
29754
29747
|
key: field.id
|
|
29755
29748
|
}, /*#__PURE__*/React.createElement("div", {
|
|
29756
|
-
className:
|
|
29749
|
+
className: "mrf-ai_center mrf-mt_5",
|
|
29757
29750
|
style: {
|
|
29758
29751
|
position: 'relative'
|
|
29759
29752
|
}
|
|
@@ -29772,7 +29765,7 @@ var ArrayStep = function ArrayStep(_ref11) {
|
|
|
29772
29765
|
top: '2px',
|
|
29773
29766
|
right: 0
|
|
29774
29767
|
},
|
|
29775
|
-
className:
|
|
29768
|
+
className: "mrf-btn mrf-btn_red mrf-btn_sm mrf-ml_5",
|
|
29776
29769
|
disabled: disabled,
|
|
29777
29770
|
onClick: function onClick() {
|
|
29778
29771
|
remove(idx);
|
|
@@ -29782,10 +29775,10 @@ var ArrayStep = function ArrayStep(_ref11) {
|
|
|
29782
29775
|
size: 16
|
|
29783
29776
|
}))));
|
|
29784
29777
|
}), /*#__PURE__*/React.createElement("div", {
|
|
29785
|
-
className:
|
|
29778
|
+
className: "mrf-flex mrf-jc_flex_end"
|
|
29786
29779
|
}, /*#__PURE__*/React.createElement("button", {
|
|
29787
29780
|
type: "button",
|
|
29788
|
-
className: classNames('btn', 'btn_blue', 'btn_sm', 'mt_5', _defineProperty$1({}, 'input__invalid', errorDisplayed)),
|
|
29781
|
+
className: classNames('mrf-btn', 'mrf-btn_blue', 'mrf-btn_sm', 'mrf-mt_5', _defineProperty$1({}, 'mrf-input__invalid', errorDisplayed)),
|
|
29789
29782
|
onClick: function onClick() {
|
|
29790
29783
|
var newValue = cleanInputArray({}, getValues(entry), step.flow, step.schema);
|
|
29791
29784
|
append({
|
|
@@ -29802,7 +29795,7 @@ var ArrayStep = function ArrayStep(_ref11) {
|
|
|
29802
29795
|
},
|
|
29803
29796
|
disabled: disabled
|
|
29804
29797
|
}, "Add"), error && /*#__PURE__*/React.createElement("div", {
|
|
29805
|
-
className: "invalid-feedback"
|
|
29798
|
+
className: "mrf-invalid-feedback"
|
|
29806
29799
|
}, error.message)));
|
|
29807
29800
|
};
|
|
29808
29801
|
|
|
@@ -29825,10 +29818,10 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
29825
29818
|
setValue = _useFormContext4.setValue,
|
|
29826
29819
|
watch = _useFormContext4.watch;
|
|
29827
29820
|
|
|
29828
|
-
var
|
|
29829
|
-
|
|
29830
|
-
collapsed =
|
|
29831
|
-
setCollapsed =
|
|
29821
|
+
var _useState7 = useState(!!step.collapsed),
|
|
29822
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
29823
|
+
collapsed = _useState8[0],
|
|
29824
|
+
setCollapsed = _useState8[1];
|
|
29832
29825
|
|
|
29833
29826
|
useWatch(step === null || step === void 0 ? void 0 : (_step$conditionalSche = step.conditionalSchema) === null || _step$conditionalSche === void 0 ? void 0 : _step$conditionalSche.ref);
|
|
29834
29827
|
var schemaAndFlow = option(step.conditionalSchema).map(function (condiSchema) {
|
|
@@ -29896,13 +29889,13 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
29896
29889
|
return x.visibleStep;
|
|
29897
29890
|
}).length >= 1 && step.label !== null;
|
|
29898
29891
|
return /*#__PURE__*/React.createElement("div", {
|
|
29899
|
-
className: classNames((_classNames17 = {}, _defineProperty$1(_classNames17, 'nestedform__border', bordered), _defineProperty$1(_classNames17, 'border__error', !!errorDisplayed), _classNames17)),
|
|
29892
|
+
className: classNames((_classNames17 = {}, _defineProperty$1(_classNames17, 'mrf-nestedform__border', bordered), _defineProperty$1(_classNames17, 'mrf-border__error', !!errorDisplayed), _classNames17)),
|
|
29900
29893
|
style: {
|
|
29901
29894
|
position: 'relative'
|
|
29902
29895
|
}
|
|
29903
29896
|
}, !!step.collapsable && schemaAndFlow.flow.length > 1 && collapsed && /*#__PURE__*/React.createElement(ChevronDown, {
|
|
29904
29897
|
size: 30,
|
|
29905
|
-
className:
|
|
29898
|
+
className: "mrf-cursor_pointer",
|
|
29906
29899
|
style: {
|
|
29907
29900
|
position: 'absolute',
|
|
29908
29901
|
top: -35,
|
|
@@ -29915,7 +29908,7 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
29915
29908
|
}
|
|
29916
29909
|
}), !!step.collapsable && schemaAndFlow.flow.length > 1 && !collapsed && /*#__PURE__*/React.createElement(ChevronUp, {
|
|
29917
29910
|
size: 30,
|
|
29918
|
-
className:
|
|
29911
|
+
className: "mrf-cursor_pointer",
|
|
29919
29912
|
style: {
|
|
29920
29913
|
position: 'absolute',
|
|
29921
29914
|
top: -35,
|
|
@@ -29938,7 +29931,7 @@ var NestedForm = function NestedForm(_ref12) {
|
|
|
29938
29931
|
|
|
29939
29932
|
return /*#__PURE__*/React.createElement(BasicWrapper, {
|
|
29940
29933
|
key: "".concat(entry, ".").concat(idx),
|
|
29941
|
-
className: classNames(_defineProperty$1({}, 'display__none', collapsed && !step.visibleOnCollapse || !visibleStep)),
|
|
29934
|
+
className: classNames(_defineProperty$1({}, 'mrf-display__none', collapsed && !step.visibleOnCollapse || !visibleStep)),
|
|
29942
29935
|
entry: "".concat(parent, ".").concat(entry),
|
|
29943
29936
|
label: functionalProperty(entry, (step === null || step === void 0 ? void 0 : step.label) === null ? null : (step === null || step === void 0 ? void 0 : step.label) || entry),
|
|
29944
29937
|
help: step.help,
|