@bpmn-io/form-js-editor 0.10.0 → 0.11.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.css +11 -3
- package/dist/index.cjs +24 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +24 -10
- package/dist/index.es.js.map +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -6094,7 +6094,12 @@ function NumberArrowStep(props) {
|
|
|
6094
6094
|
if (!isValidNumber(value)) return null;
|
|
6095
6095
|
return value;
|
|
6096
6096
|
};
|
|
6097
|
-
const
|
|
6097
|
+
const clearLeadingZeroes = value => {
|
|
6098
|
+
if (!value) return value;
|
|
6099
|
+
const trimmed = value.replace(/^0+/g, '');
|
|
6100
|
+
return (trimmed.startsWith('.') ? '0' : '') + trimmed;
|
|
6101
|
+
};
|
|
6102
|
+
const setValue = value => editField(field, ['increment'], clearLeadingZeroes(value));
|
|
6098
6103
|
const decimalDigitsSet = decimalDigits || decimalDigits === 0;
|
|
6099
6104
|
return TextfieldEntry({
|
|
6100
6105
|
debounce,
|
|
@@ -6979,7 +6984,7 @@ function ConstraintsGroup(field, editField) {
|
|
|
6979
6984
|
|
|
6980
6985
|
const VALIDATION_TYPE_OPTIONS = {
|
|
6981
6986
|
custom: {
|
|
6982
|
-
value:
|
|
6987
|
+
value: undefined,
|
|
6983
6988
|
label: 'Custom'
|
|
6984
6989
|
},
|
|
6985
6990
|
email: {
|
|
@@ -7158,10 +7163,10 @@ function Min(props) {
|
|
|
7158
7163
|
return NumberFieldEntry({
|
|
7159
7164
|
debounce,
|
|
7160
7165
|
element: field,
|
|
7161
|
-
getValue: getValue('min'),
|
|
7162
7166
|
id,
|
|
7163
7167
|
label: 'Minimum',
|
|
7164
|
-
|
|
7168
|
+
step: 'any',
|
|
7169
|
+
getValue: getValue('min'),
|
|
7165
7170
|
setValue: onChange('min')
|
|
7166
7171
|
});
|
|
7167
7172
|
}
|
|
@@ -7176,10 +7181,10 @@ function Max(props) {
|
|
|
7176
7181
|
return NumberFieldEntry({
|
|
7177
7182
|
debounce,
|
|
7178
7183
|
element: field,
|
|
7179
|
-
getValue: getValue('max'),
|
|
7180
7184
|
id,
|
|
7181
7185
|
label: 'Maximum',
|
|
7182
|
-
|
|
7186
|
+
step: 'any',
|
|
7187
|
+
getValue: getValue('max'),
|
|
7183
7188
|
setValue: onChange('max')
|
|
7184
7189
|
});
|
|
7185
7190
|
}
|
|
@@ -7191,16 +7196,25 @@ function ValidationType(props) {
|
|
|
7191
7196
|
onChange
|
|
7192
7197
|
} = props;
|
|
7193
7198
|
const debounce = useService('debounce');
|
|
7199
|
+
const clearCustomValidation = () => {
|
|
7200
|
+
onChange('minLength')(undefined);
|
|
7201
|
+
onChange('maxLength')(undefined);
|
|
7202
|
+
onChange('pattern')(undefined);
|
|
7203
|
+
};
|
|
7204
|
+
const setValue = validationType => {
|
|
7205
|
+
if (validationType) {
|
|
7206
|
+
clearCustomValidation();
|
|
7207
|
+
}
|
|
7208
|
+
onChange('validationType')(validationType || undefined);
|
|
7209
|
+
};
|
|
7194
7210
|
return SelectEntry({
|
|
7195
7211
|
debounce,
|
|
7196
7212
|
element: field,
|
|
7197
7213
|
getValue: getValue('validationType'),
|
|
7198
7214
|
id,
|
|
7199
7215
|
label: 'Regular expression validation',
|
|
7200
|
-
setValue
|
|
7201
|
-
getOptions()
|
|
7202
|
-
return Object.values(VALIDATION_TYPE_OPTIONS);
|
|
7203
|
-
}
|
|
7216
|
+
setValue,
|
|
7217
|
+
getOptions: () => Object.values(VALIDATION_TYPE_OPTIONS)
|
|
7204
7218
|
});
|
|
7205
7219
|
}
|
|
7206
7220
|
|