@bpmn-io/form-js-editor 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/form-js-editor-base.css +22 -0
- package/dist/assets/form-js-editor.css +22 -0
- package/dist/index.cjs +196 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +196 -82
- package/dist/index.es.js.map +1 -1
- package/dist/types/features/properties-panel/entries/SpacerEntry.d.ts +9 -0
- package/dist/types/features/properties-panel/entries/index.d.ts +1 -0
- package/dist/types/render/components/icons/index.d.ts +1 -1
- package/package.json +4 -4
package/dist/index.es.js
CHANGED
|
@@ -934,15 +934,15 @@ function useService$1 (type, strict) {
|
|
|
934
934
|
return getService(type, strict);
|
|
935
935
|
}
|
|
936
936
|
|
|
937
|
-
var _path$
|
|
938
|
-
function _extends$
|
|
937
|
+
var _path$4;
|
|
938
|
+
function _extends$4() { _extends$4 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
|
|
939
939
|
var SvgClose = function SvgClose(props) {
|
|
940
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
940
|
+
return /*#__PURE__*/React.createElement("svg", _extends$4({
|
|
941
941
|
xmlns: "http://www.w3.org/2000/svg",
|
|
942
942
|
width: 16,
|
|
943
943
|
height: 16,
|
|
944
944
|
fill: "currentColor"
|
|
945
|
-
}, props), _path$
|
|
945
|
+
}, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
|
|
946
946
|
fillRule: "evenodd",
|
|
947
947
|
d: "m12 4.7-.7-.7L8 7.3 4.7 4l-.7.7L7.3 8 4 11.3l.7.7L8 8.7l3.3 3.3.7-.7L8.7 8 12 4.7Z",
|
|
948
948
|
clipRule: "evenodd"
|
|
@@ -950,10 +950,10 @@ var SvgClose = function SvgClose(props) {
|
|
|
950
950
|
};
|
|
951
951
|
var CloseIcon = SvgClose;
|
|
952
952
|
|
|
953
|
-
var _path$
|
|
954
|
-
function _extends$
|
|
953
|
+
var _path$3, _path2$1;
|
|
954
|
+
function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
|
|
955
955
|
var SvgDelete = function SvgDelete(props) {
|
|
956
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
956
|
+
return /*#__PURE__*/React.createElement("svg", _extends$3({
|
|
957
957
|
xmlns: "http://www.w3.org/2000/svg",
|
|
958
958
|
width: 16,
|
|
959
959
|
height: 16,
|
|
@@ -974,27 +974,27 @@ var SvgDelete = function SvgDelete(props) {
|
|
|
974
974
|
mixBlendMode: "multiply"
|
|
975
975
|
},
|
|
976
976
|
transform: "translate(.536)"
|
|
977
|
-
}), _path$
|
|
977
|
+
}), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
|
|
978
978
|
fill: "currentcolor",
|
|
979
979
|
d: "M7.536 6h-1v6h1V6Zm3 0h-1v6h1V6Z"
|
|
980
|
-
})), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
|
|
980
|
+
})), _path2$1 || (_path2$1 = /*#__PURE__*/React.createElement("path", {
|
|
981
981
|
fill: "currentcolor",
|
|
982
982
|
d: "M2.536 3v1h1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4h1V3h-12Zm2 11V4h8v10h-8Zm6-13h-4v1h4V1Z"
|
|
983
983
|
})));
|
|
984
984
|
};
|
|
985
985
|
var DeleteIcon$1 = SvgDelete;
|
|
986
986
|
|
|
987
|
-
var _path$
|
|
988
|
-
function _extends$
|
|
987
|
+
var _path$2;
|
|
988
|
+
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
|
|
989
989
|
var SvgDraggable = function SvgDraggable(props) {
|
|
990
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
990
|
+
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
991
991
|
xmlns: "http://www.w3.org/2000/svg",
|
|
992
992
|
xmlSpace: "preserve",
|
|
993
993
|
width: 16,
|
|
994
994
|
height: 16,
|
|
995
995
|
fill: "currentcolor",
|
|
996
996
|
viewBox: "0 0 32 32"
|
|
997
|
-
}, props), _path$
|
|
997
|
+
}, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
|
|
998
998
|
d: "M10 6h4v4h-4zm8 0h4v4h-4zm-8 8h4v4h-4zm8 0h4v4h-4zm-8 8h4v4h-4zm8 0h4v4h-4z"
|
|
999
999
|
})), /*#__PURE__*/React.createElement("path", {
|
|
1000
1000
|
d: "M0 0h32v32H0z",
|
|
@@ -1005,21 +1005,76 @@ var SvgDraggable = function SvgDraggable(props) {
|
|
|
1005
1005
|
};
|
|
1006
1006
|
var DraggableIcon = SvgDraggable;
|
|
1007
1007
|
|
|
1008
|
-
var _path;
|
|
1009
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1008
|
+
var _path$1;
|
|
1009
|
+
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
1010
1010
|
var SvgSearch = function SvgSearch(props) {
|
|
1011
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
1011
|
+
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
1012
1012
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1013
1013
|
width: 15,
|
|
1014
1014
|
height: 15,
|
|
1015
1015
|
fill: "none"
|
|
1016
|
-
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
1016
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
1017
1017
|
fill: "currentColor",
|
|
1018
1018
|
d: "m14.5 13.793-3.776-3.776a5.508 5.508 0 1 0-.707.707l3.776 3.776.707-.707ZM2 6.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0Z"
|
|
1019
1019
|
})));
|
|
1020
1020
|
};
|
|
1021
1021
|
var SearchIcon = SvgSearch;
|
|
1022
1022
|
|
|
1023
|
+
var _path, _rect, _mask, _path2, _path3, _path4, _path5, _path6;
|
|
1024
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1025
|
+
var SvgEmptyForm = function SvgEmptyForm(props) {
|
|
1026
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
1027
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1028
|
+
width: 126,
|
|
1029
|
+
height: 96,
|
|
1030
|
+
fill: "none"
|
|
1031
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
1032
|
+
fill: "#FF832B",
|
|
1033
|
+
fillRule: "evenodd",
|
|
1034
|
+
d: "M70 78v8a3 3 0 0 1-3 3h-8v-5h6v-6h5Zm0-16h-5V46h5v16Zm0-32h-5v-6h-6v-5h8a3 3 0 0 1 3 3v8ZM43 19v5H27v-5h16Zm-32 0v5H5v6H0v-8a3 3 0 0 1 3-3h8ZM0 46h5v16H0V46Zm0 32h5v6h6v5H3a3 3 0 0 1-3-3v-8Zm27 11v-5h16v5H27Z",
|
|
1035
|
+
clipRule: "evenodd"
|
|
1036
|
+
})), _rect || (_rect = /*#__PURE__*/React.createElement("rect", {
|
|
1037
|
+
width: 70,
|
|
1038
|
+
height: 70,
|
|
1039
|
+
fill: "#E5E5E5",
|
|
1040
|
+
rx: 3,
|
|
1041
|
+
transform: "matrix(-1 0 0 1 94 0)"
|
|
1042
|
+
})), _mask || (_mask = /*#__PURE__*/React.createElement("mask", {
|
|
1043
|
+
id: "EmptyForm_svg__a",
|
|
1044
|
+
fill: "#fff"
|
|
1045
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
1046
|
+
fillRule: "evenodd",
|
|
1047
|
+
d: "M87.085 88.684 75.43 45.185l43.499 11.656-11.044 8.072 8.557 8.556-12.728 12.728-8.557-8.556-8.072 11.043Z",
|
|
1048
|
+
clipRule: "evenodd"
|
|
1049
|
+
}))), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
|
|
1050
|
+
fill: "#393939",
|
|
1051
|
+
fillRule: "evenodd",
|
|
1052
|
+
d: "M87.085 88.684 75.43 45.185l43.499 11.656-11.044 8.072 8.557 8.556-12.728 12.728-8.557-8.556-8.072 11.043Z",
|
|
1053
|
+
clipRule: "evenodd"
|
|
1054
|
+
})), _path3 || (_path3 = /*#__PURE__*/React.createElement("path", {
|
|
1055
|
+
fill: "#393939",
|
|
1056
|
+
d: "M75.43 45.185 70.6 46.48l-2.241-8.365 8.365 2.242-1.294 4.83Zm11.655 43.499 4.037 2.95-6.163 8.432-2.704-10.088 4.83-1.294Zm31.844-31.843 1.294-4.83 10.088 2.703-8.432 6.163-2.95-4.036Zm-11.044 8.072-3.535 3.535-4.128-4.127 4.713-3.445 2.95 4.037Zm8.557 8.556 3.535-3.535 3.536 3.535-3.536 3.536-3.535-3.536Zm-12.728 12.728 3.536 3.536-3.536 3.535-3.536-3.535 3.536-3.536Zm-8.557-8.556-4.036-2.951 3.444-4.713 4.128 4.128-3.536 3.535ZM80.26 43.89 91.915 87.39l-9.66 2.588L70.6 46.48l9.66-2.588Zm37.375 17.78L74.136 50.014l2.588-9.66 43.499 11.656-2.589 9.66Zm-12.699-.795 11.043-8.072 5.901 8.073-11.043 8.072-5.901-8.073Zm7.971 16.129-8.556-8.557 7.071-7.07 8.556 8.556-7.071 7.07Zm-12.728 5.657 12.728-12.728 7.071 7.07-12.727 12.729-7.072-7.071Zm-1.485-8.557 8.557 8.557-7.072 7.07-8.556-8.556 7.07-7.071ZM83.049 85.733 91.12 74.69l8.073 5.901-8.072 11.044-8.073-5.902Z",
|
|
1057
|
+
mask: "url(#EmptyForm_svg__a)"
|
|
1058
|
+
})), _path4 || (_path4 = /*#__PURE__*/React.createElement("path", {
|
|
1059
|
+
stroke: "#000",
|
|
1060
|
+
strokeLinecap: "round",
|
|
1061
|
+
strokeWidth: 3,
|
|
1062
|
+
d: "m69.431 39.163-9.192-9.192"
|
|
1063
|
+
})), _path5 || (_path5 = /*#__PURE__*/React.createElement("path", {
|
|
1064
|
+
stroke: "#000",
|
|
1065
|
+
strokeLinecap: "round",
|
|
1066
|
+
strokeWidth: 3,
|
|
1067
|
+
d: "M1.5-1.5h8",
|
|
1068
|
+
transform: "matrix(-1 0 0 1 68.213 50.123)"
|
|
1069
|
+
})), _path6 || (_path6 = /*#__PURE__*/React.createElement("path", {
|
|
1070
|
+
stroke: "#000",
|
|
1071
|
+
strokeLinecap: "round",
|
|
1072
|
+
strokeWidth: 3,
|
|
1073
|
+
d: "M78.969 36.367v-8"
|
|
1074
|
+
})));
|
|
1075
|
+
};
|
|
1076
|
+
var EmptyFormIcon = SvgEmptyForm;
|
|
1077
|
+
|
|
1023
1078
|
function EditorText(props) {
|
|
1024
1079
|
const {
|
|
1025
1080
|
type,
|
|
@@ -1028,7 +1083,7 @@ function EditorText(props) {
|
|
|
1028
1083
|
const Icon = iconsByType('text');
|
|
1029
1084
|
const templating = useService$1('templating');
|
|
1030
1085
|
const expressionLanguage = useService$1('expressionLanguage');
|
|
1031
|
-
if (!text) {
|
|
1086
|
+
if (!text || !text.trim()) {
|
|
1032
1087
|
return jsx("div", {
|
|
1033
1088
|
class: editorFormFieldClasses(type),
|
|
1034
1089
|
children: jsxs("div", {
|
|
@@ -1929,7 +1984,19 @@ function ContextPad(props) {
|
|
|
1929
1984
|
});
|
|
1930
1985
|
}
|
|
1931
1986
|
function Empty(props) {
|
|
1932
|
-
return
|
|
1987
|
+
return jsx("div", {
|
|
1988
|
+
class: "fjs-empty-editor",
|
|
1989
|
+
children: jsxs("div", {
|
|
1990
|
+
class: "fjs-empty-editor-card",
|
|
1991
|
+
children: [jsx(EmptyFormIcon, {}), jsx("h2", {
|
|
1992
|
+
children: "Build your form"
|
|
1993
|
+
}), jsx("span", {
|
|
1994
|
+
children: "Drag and drop components here to start designing."
|
|
1995
|
+
}), jsx("span", {
|
|
1996
|
+
children: "Use the preview window to test your form."
|
|
1997
|
+
})]
|
|
1998
|
+
})
|
|
1999
|
+
});
|
|
1933
2000
|
}
|
|
1934
2001
|
function Element$1(props) {
|
|
1935
2002
|
const eventBus = useService$1('eventBus'),
|
|
@@ -6089,11 +6156,9 @@ function NumberFieldEntry(props) {
|
|
|
6089
6156
|
onBlur,
|
|
6090
6157
|
validate
|
|
6091
6158
|
} = props;
|
|
6092
|
-
const [cachedInvalidValue, setCachedInvalidValue] = useState(null);
|
|
6093
6159
|
const globalError = useError(id);
|
|
6094
6160
|
const [localError, setLocalError] = useState(null);
|
|
6095
6161
|
let value = getValue(element);
|
|
6096
|
-
const previousValue = usePrevious(value);
|
|
6097
6162
|
useEffect(() => {
|
|
6098
6163
|
if (isFunction(validate)) {
|
|
6099
6164
|
const newValidationError = validate(value) || null;
|
|
@@ -6105,16 +6170,9 @@ function NumberFieldEntry(props) {
|
|
|
6105
6170
|
if (isFunction(validate)) {
|
|
6106
6171
|
newValidationError = validate(newValue) || null;
|
|
6107
6172
|
}
|
|
6108
|
-
|
|
6109
|
-
setCachedInvalidValue(newValue);
|
|
6110
|
-
} else {
|
|
6111
|
-
setValue(newValue);
|
|
6112
|
-
}
|
|
6173
|
+
setValue(newValue, newValidationError);
|
|
6113
6174
|
setLocalError(newValidationError);
|
|
6114
6175
|
};
|
|
6115
|
-
if (previousValue === value && localError) {
|
|
6116
|
-
value = cachedInvalidValue;
|
|
6117
|
-
}
|
|
6118
6176
|
const error = globalError || localError;
|
|
6119
6177
|
return jsxs("div", {
|
|
6120
6178
|
class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),
|
|
@@ -6561,11 +6619,9 @@ function FeelEntry(props) {
|
|
|
6561
6619
|
onFocus,
|
|
6562
6620
|
onBlur
|
|
6563
6621
|
} = props;
|
|
6564
|
-
const [cachedInvalidValue, setCachedInvalidValue] = useState(null);
|
|
6565
6622
|
const [validationError, setValidationError] = useState(null);
|
|
6566
6623
|
const [localError, setLocalError] = useState(null);
|
|
6567
6624
|
let value = getValue(element);
|
|
6568
|
-
const previousValue = usePrevious(value);
|
|
6569
6625
|
useEffect(() => {
|
|
6570
6626
|
if (isFunction(validate)) {
|
|
6571
6627
|
const newValidationError = validate(value) || null;
|
|
@@ -6577,22 +6633,16 @@ function FeelEntry(props) {
|
|
|
6577
6633
|
if (isFunction(validate)) {
|
|
6578
6634
|
newValidationError = validate(newValue) || null;
|
|
6579
6635
|
}
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
if (newValue !== value) {
|
|
6585
|
-
setValue(newValue);
|
|
6586
|
-
}
|
|
6636
|
+
|
|
6637
|
+
// don't create multiple commandStack entries for the same value
|
|
6638
|
+
if (newValue !== value) {
|
|
6639
|
+
setValue(newValue, newValidationError);
|
|
6587
6640
|
}
|
|
6588
6641
|
setValidationError(newValidationError);
|
|
6589
6642
|
});
|
|
6590
6643
|
const onError = useCallback(err => {
|
|
6591
6644
|
setLocalError(err);
|
|
6592
6645
|
}, []);
|
|
6593
|
-
if (previousValue === value && validationError) {
|
|
6594
|
-
value = cachedInvalidValue;
|
|
6595
|
-
}
|
|
6596
6646
|
const temporaryError = useError(id);
|
|
6597
6647
|
const error = localError || temporaryError || validationError;
|
|
6598
6648
|
return jsxs("div", {
|
|
@@ -6823,11 +6873,9 @@ function SelectEntry(props) {
|
|
|
6823
6873
|
validate
|
|
6824
6874
|
} = props;
|
|
6825
6875
|
const options = getOptions(element);
|
|
6826
|
-
const [cachedInvalidValue, setCachedInvalidValue] = useState(null);
|
|
6827
6876
|
const globalError = useError(id);
|
|
6828
6877
|
const [localError, setLocalError] = useState(null);
|
|
6829
6878
|
let value = getValue(element);
|
|
6830
|
-
const previousValue = usePrevious(value);
|
|
6831
6879
|
useEffect(() => {
|
|
6832
6880
|
if (isFunction(validate)) {
|
|
6833
6881
|
const newValidationError = validate(value) || null;
|
|
@@ -6839,16 +6887,9 @@ function SelectEntry(props) {
|
|
|
6839
6887
|
if (isFunction(validate)) {
|
|
6840
6888
|
newValidationError = validate(newValue) || null;
|
|
6841
6889
|
}
|
|
6842
|
-
|
|
6843
|
-
setCachedInvalidValue(newValue);
|
|
6844
|
-
} else {
|
|
6845
|
-
setValue(newValue);
|
|
6846
|
-
}
|
|
6890
|
+
setValue(newValue, newValidationError);
|
|
6847
6891
|
setLocalError(newValidationError);
|
|
6848
6892
|
};
|
|
6849
|
-
if (previousValue === value && localError) {
|
|
6850
|
-
value = cachedInvalidValue;
|
|
6851
|
-
}
|
|
6852
6893
|
const error = globalError || localError;
|
|
6853
6894
|
return jsxs("div", {
|
|
6854
6895
|
class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),
|
|
@@ -6979,11 +7020,9 @@ function TextAreaEntry(props) {
|
|
|
6979
7020
|
onBlur,
|
|
6980
7021
|
autoResize
|
|
6981
7022
|
} = props;
|
|
6982
|
-
const [cachedInvalidValue, setCachedInvalidValue] = useState(null);
|
|
6983
7023
|
const globalError = useError(id);
|
|
6984
7024
|
const [localError, setLocalError] = useState(null);
|
|
6985
7025
|
let value = getValue(element);
|
|
6986
|
-
const previousValue = usePrevious(value);
|
|
6987
7026
|
useEffect(() => {
|
|
6988
7027
|
if (isFunction(validate)) {
|
|
6989
7028
|
const newValidationError = validate(value) || null;
|
|
@@ -6995,16 +7034,9 @@ function TextAreaEntry(props) {
|
|
|
6995
7034
|
if (isFunction(validate)) {
|
|
6996
7035
|
newValidationError = validate(newValue) || null;
|
|
6997
7036
|
}
|
|
6998
|
-
|
|
6999
|
-
setCachedInvalidValue(newValue);
|
|
7000
|
-
} else {
|
|
7001
|
-
setValue(newValue);
|
|
7002
|
-
}
|
|
7037
|
+
setValue(newValue, newValidationError);
|
|
7003
7038
|
setLocalError(newValidationError);
|
|
7004
7039
|
};
|
|
7005
|
-
if (previousValue === value && localError) {
|
|
7006
|
-
value = cachedInvalidValue;
|
|
7007
|
-
}
|
|
7008
7040
|
const error = globalError || localError;
|
|
7009
7041
|
return jsxs("div", {
|
|
7010
7042
|
class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),
|
|
@@ -7119,11 +7151,9 @@ function TextfieldEntry(props) {
|
|
|
7119
7151
|
onFocus,
|
|
7120
7152
|
onBlur
|
|
7121
7153
|
} = props;
|
|
7122
|
-
const [cachedInvalidValue, setCachedInvalidValue] = useState(null);
|
|
7123
7154
|
const globalError = useError(id);
|
|
7124
7155
|
const [localError, setLocalError] = useState(null);
|
|
7125
7156
|
let value = getValue(element);
|
|
7126
|
-
const previousValue = usePrevious(value);
|
|
7127
7157
|
useEffect(() => {
|
|
7128
7158
|
if (isFunction(validate)) {
|
|
7129
7159
|
const newValidationError = validate(value) || null;
|
|
@@ -7135,16 +7165,9 @@ function TextfieldEntry(props) {
|
|
|
7135
7165
|
if (isFunction(validate)) {
|
|
7136
7166
|
newValidationError = validate(newValue) || null;
|
|
7137
7167
|
}
|
|
7138
|
-
|
|
7139
|
-
setCachedInvalidValue(newValue);
|
|
7140
|
-
} else {
|
|
7141
|
-
setValue(newValue);
|
|
7142
|
-
}
|
|
7168
|
+
setValue(newValue, newValidationError);
|
|
7143
7169
|
setLocalError(newValidationError);
|
|
7144
7170
|
};
|
|
7145
|
-
if (previousValue === value && localError) {
|
|
7146
|
-
value = cachedInvalidValue;
|
|
7147
|
-
}
|
|
7148
7171
|
const error = globalError || localError;
|
|
7149
7172
|
return jsxs("div", {
|
|
7150
7173
|
class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),
|
|
@@ -7229,6 +7252,7 @@ const labelsByType = {
|
|
|
7229
7252
|
number: 'NUMBER',
|
|
7230
7253
|
radio: 'RADIO',
|
|
7231
7254
|
select: 'SELECT',
|
|
7255
|
+
spacer: 'SPACER',
|
|
7232
7256
|
taglist: 'TAGLIST',
|
|
7233
7257
|
text: 'TEXT VIEW',
|
|
7234
7258
|
textfield: 'TEXT FIELD',
|
|
@@ -7431,7 +7455,10 @@ function Columns(props) {
|
|
|
7431
7455
|
const validate = value => {
|
|
7432
7456
|
return formLayoutValidator.validateField(field, value ? parseInt(value) : null);
|
|
7433
7457
|
};
|
|
7434
|
-
const setValue = value => {
|
|
7458
|
+
const setValue = (value, error) => {
|
|
7459
|
+
if (error) {
|
|
7460
|
+
return;
|
|
7461
|
+
}
|
|
7435
7462
|
const layout = get(field, ['layout'], {});
|
|
7436
7463
|
const newValue = value ? parseInt(value) : null;
|
|
7437
7464
|
editField(field, ['layout'], set$1(layout, ['columns'], newValue));
|
|
@@ -7639,7 +7666,10 @@ function DefaultValueNumber(props) {
|
|
|
7639
7666
|
// Enforces decimal notation so that we do not submit defaults in exponent form
|
|
7640
7667
|
return serializeToString ? Big(value).toFixed() : value;
|
|
7641
7668
|
};
|
|
7642
|
-
const setValue = value => {
|
|
7669
|
+
const setValue = (value, error) => {
|
|
7670
|
+
if (error) {
|
|
7671
|
+
return;
|
|
7672
|
+
}
|
|
7643
7673
|
let newValue;
|
|
7644
7674
|
if (isValidNumber(value)) {
|
|
7645
7675
|
newValue = serializeToString ? value : Number(value);
|
|
@@ -7830,7 +7860,10 @@ function Id(props) {
|
|
|
7830
7860
|
const getValue = () => {
|
|
7831
7861
|
return get(field, path, '');
|
|
7832
7862
|
};
|
|
7833
|
-
const setValue = value => {
|
|
7863
|
+
const setValue = (value, error) => {
|
|
7864
|
+
if (error) {
|
|
7865
|
+
return;
|
|
7866
|
+
}
|
|
7834
7867
|
return editField(field, path, value);
|
|
7835
7868
|
};
|
|
7836
7869
|
const validate = value => {
|
|
@@ -7910,7 +7943,10 @@ function Key$1(props) {
|
|
|
7910
7943
|
const getValue = () => {
|
|
7911
7944
|
return get(field, path, '');
|
|
7912
7945
|
};
|
|
7913
|
-
const setValue = value => {
|
|
7946
|
+
const setValue = (value, error) => {
|
|
7947
|
+
if (error) {
|
|
7948
|
+
return;
|
|
7949
|
+
}
|
|
7914
7950
|
return editField(field, path, value);
|
|
7915
7951
|
};
|
|
7916
7952
|
const validate = value => {
|
|
@@ -8165,7 +8201,7 @@ function Text(props) {
|
|
|
8165
8201
|
return get(field, path, '');
|
|
8166
8202
|
};
|
|
8167
8203
|
const setValue = value => {
|
|
8168
|
-
return editField(field, path, value);
|
|
8204
|
+
return editField(field, path, value || '');
|
|
8169
8205
|
};
|
|
8170
8206
|
const description = useMemo(() => jsxs(Fragment$1, {
|
|
8171
8207
|
children: ["Supports markdown and templating. ", jsx("a", {
|
|
@@ -8187,6 +8223,57 @@ function Text(props) {
|
|
|
8187
8223
|
});
|
|
8188
8224
|
}
|
|
8189
8225
|
|
|
8226
|
+
function SpacerEntry(props) {
|
|
8227
|
+
const {
|
|
8228
|
+
editField,
|
|
8229
|
+
field,
|
|
8230
|
+
id
|
|
8231
|
+
} = props;
|
|
8232
|
+
const {
|
|
8233
|
+
type
|
|
8234
|
+
} = field;
|
|
8235
|
+
if (type !== 'spacer') {
|
|
8236
|
+
return [];
|
|
8237
|
+
}
|
|
8238
|
+
const entries = [];
|
|
8239
|
+
entries.push({
|
|
8240
|
+
id: id + '-height',
|
|
8241
|
+
component: SpacerHeight,
|
|
8242
|
+
isEdited: isEdited$6,
|
|
8243
|
+
editField,
|
|
8244
|
+
field
|
|
8245
|
+
});
|
|
8246
|
+
return entries;
|
|
8247
|
+
}
|
|
8248
|
+
function SpacerHeight(props) {
|
|
8249
|
+
const {
|
|
8250
|
+
editField,
|
|
8251
|
+
field,
|
|
8252
|
+
id
|
|
8253
|
+
} = props;
|
|
8254
|
+
const debounce = useService('debounce');
|
|
8255
|
+
const getValue = e => get(field, ['height']);
|
|
8256
|
+
const setValue = (value, error) => {
|
|
8257
|
+
if (error) {
|
|
8258
|
+
return;
|
|
8259
|
+
}
|
|
8260
|
+
editField(field, ['height'], value);
|
|
8261
|
+
};
|
|
8262
|
+
return NumberFieldEntry({
|
|
8263
|
+
debounce,
|
|
8264
|
+
label: 'Height',
|
|
8265
|
+
element: field,
|
|
8266
|
+
id,
|
|
8267
|
+
getValue,
|
|
8268
|
+
setValue,
|
|
8269
|
+
validate: value => {
|
|
8270
|
+
if (value === undefined || value === null) return;
|
|
8271
|
+
if (value < 1) return 'Should be greater than zero.';
|
|
8272
|
+
if (!Number.isInteger(value)) return 'Should be an integer.';
|
|
8273
|
+
}
|
|
8274
|
+
});
|
|
8275
|
+
}
|
|
8276
|
+
|
|
8190
8277
|
function NumberEntries(props) {
|
|
8191
8278
|
const {
|
|
8192
8279
|
editField,
|
|
@@ -8224,7 +8311,12 @@ function NumberDecimalDigits(props) {
|
|
|
8224
8311
|
} = props;
|
|
8225
8312
|
const debounce = useService('debounce');
|
|
8226
8313
|
const getValue = e => get(field, ['decimalDigits']);
|
|
8227
|
-
const setValue = value =>
|
|
8314
|
+
const setValue = (value, error) => {
|
|
8315
|
+
if (error) {
|
|
8316
|
+
return;
|
|
8317
|
+
}
|
|
8318
|
+
editField(field, ['decimalDigits'], value);
|
|
8319
|
+
};
|
|
8228
8320
|
return NumberFieldEntry({
|
|
8229
8321
|
debounce,
|
|
8230
8322
|
label: 'Decimal digits',
|
|
@@ -8260,7 +8352,12 @@ function NumberArrowStep(props) {
|
|
|
8260
8352
|
const trimmed = value.replace(/^0+/g, '');
|
|
8261
8353
|
return (trimmed.startsWith('.') ? '0' : '') + trimmed;
|
|
8262
8354
|
};
|
|
8263
|
-
const setValue = value =>
|
|
8355
|
+
const setValue = (value, error) => {
|
|
8356
|
+
if (error) {
|
|
8357
|
+
return;
|
|
8358
|
+
}
|
|
8359
|
+
editField(field, ['increment'], clearLeadingZeroes(value));
|
|
8360
|
+
};
|
|
8264
8361
|
const decimalDigitsSet = decimalDigits || decimalDigits === 0;
|
|
8265
8362
|
return TextfieldEntry({
|
|
8266
8363
|
debounce,
|
|
@@ -8669,7 +8766,10 @@ function Label(props) {
|
|
|
8669
8766
|
validateFactory
|
|
8670
8767
|
} = props;
|
|
8671
8768
|
const debounce = useService('debounce');
|
|
8672
|
-
const setValue = value => {
|
|
8769
|
+
const setValue = (value, error) => {
|
|
8770
|
+
if (error) {
|
|
8771
|
+
return;
|
|
8772
|
+
}
|
|
8673
8773
|
const values = get(field, ['values']);
|
|
8674
8774
|
return editField(field, 'values', set$1(values, [index, 'label'], value));
|
|
8675
8775
|
};
|
|
@@ -8695,7 +8795,10 @@ function Value$1(props) {
|
|
|
8695
8795
|
validateFactory
|
|
8696
8796
|
} = props;
|
|
8697
8797
|
const debounce = useService('debounce');
|
|
8698
|
-
const setValue = value => {
|
|
8798
|
+
const setValue = (value, error) => {
|
|
8799
|
+
if (error) {
|
|
8800
|
+
return;
|
|
8801
|
+
}
|
|
8699
8802
|
const values = get(field, ['values']);
|
|
8700
8803
|
return editField(field, 'values', set$1(values, [index, 'value'], value));
|
|
8701
8804
|
};
|
|
@@ -8749,7 +8852,10 @@ function Key(props) {
|
|
|
8749
8852
|
validateFactory
|
|
8750
8853
|
} = props;
|
|
8751
8854
|
const debounce = useService('debounce');
|
|
8752
|
-
const setValue = value => {
|
|
8855
|
+
const setValue = (value, error) => {
|
|
8856
|
+
if (error) {
|
|
8857
|
+
return;
|
|
8858
|
+
}
|
|
8753
8859
|
const properties = get(field, ['properties']);
|
|
8754
8860
|
const key = Object.keys(properties)[index];
|
|
8755
8861
|
return editField(field, 'properties', updateKey(properties, key, value));
|
|
@@ -8960,7 +9066,12 @@ function InputValuesKey(props) {
|
|
|
8960
9066
|
const debounce = useService('debounce');
|
|
8961
9067
|
const path = VALUES_SOURCES_PATHS[VALUES_SOURCES.INPUT];
|
|
8962
9068
|
const getValue = () => get(field, path, '');
|
|
8963
|
-
const setValue = value
|
|
9069
|
+
const setValue = (value, error) => {
|
|
9070
|
+
if (error) {
|
|
9071
|
+
return;
|
|
9072
|
+
}
|
|
9073
|
+
editField(field, path, value || '');
|
|
9074
|
+
};
|
|
8964
9075
|
const validate = value => {
|
|
8965
9076
|
if (isUndefined(value) || !value.length) {
|
|
8966
9077
|
return 'Must not be empty.';
|
|
@@ -9317,6 +9428,9 @@ function GeneralGroup(field, editField, getService) {
|
|
|
9317
9428
|
field,
|
|
9318
9429
|
editField,
|
|
9319
9430
|
getService
|
|
9431
|
+
}), ...SpacerEntry({
|
|
9432
|
+
field,
|
|
9433
|
+
editField
|
|
9320
9434
|
}), ...NumberEntries({
|
|
9321
9435
|
field,
|
|
9322
9436
|
editField
|