@bpmn-io/form-js-editor 1.25.0 → 1.26.1
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 +2 -0
- package/dist/assets/form-js-editor.css +2 -0
- package/dist/index.cjs +656 -401
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +656 -401
- package/dist/index.es.js.map +1 -1
- package/dist/types/core/FormLayoutValidator.d.ts +8 -2
- package/dist/types/features/context-pad/DeleteActionProvider.d.ts +2 -1
- package/dist/types/features/dragging/Dragging.d.ts +1 -1
- package/dist/types/features/properties-panel/entries/AcceptEntry.d.ts +4 -0
- package/dist/types/features/properties-panel/entries/ColumnEntry.d.ts +1 -0
- package/dist/types/features/properties-panel/entries/ColumnsExpressionEntry.d.ts +1 -0
- package/dist/types/features/properties-panel/entries/DateTimeEntry.d.ts +1 -0
- package/dist/types/features/properties-panel/entries/DefaultValueEntry.d.ts +1 -1
- package/dist/types/features/properties-panel/entries/DisabledEntry.d.ts +1 -0
- package/dist/types/features/properties-panel/entries/DocumentsDataSource.d.ts +4 -0
- package/dist/types/features/properties-panel/entries/HeadersSourceSelectEntry.d.ts +1 -0
- package/dist/types/features/properties-panel/entries/HeightEntry.d.ts +4 -0
- package/dist/types/features/properties-panel/entries/IFrameUrlEntry.d.ts +1 -0
- package/dist/types/features/properties-panel/entries/InputKeyOptionsSourceEntry.d.ts +4 -0
- package/dist/types/features/properties-panel/entries/MaxHeightEntry.d.ts +4 -0
- package/dist/types/features/properties-panel/entries/NumberEntries.d.ts +4 -0
- package/dist/types/features/properties-panel/entries/OptionsSourceSelectEntry.d.ts +1 -0
- package/dist/types/features/properties-panel/entries/PaginationEntry.d.ts +1 -0
- package/dist/types/features/properties-panel/entries/RowCountEntry.d.ts +1 -0
- package/dist/types/features/properties-panel/entries/TableDataSourceEntry.d.ts +4 -0
- package/dist/types/features/properties-panel/entries/TextEntry.d.ts +1 -0
- package/dist/types/features/properties-panel/groups/AppearanceGroup.d.ts +1 -1
- package/dist/types/features/properties-panel/groups/ConditionGroup.d.ts +2 -2
- package/dist/types/features/properties-panel/groups/ConstraintsGroup.d.ts +2 -2
- package/dist/types/features/properties-panel/groups/CustomPropertiesGroup.d.ts +4 -4
- package/dist/types/features/properties-panel/groups/GeneralGroup.d.ts +1 -1
- package/dist/types/features/properties-panel/groups/LayoutGroup.d.ts +2 -2
- package/dist/types/features/properties-panel/groups/SecurityAttributesGroup.d.ts +3 -3
- package/dist/types/features/properties-panel/groups/SerializationGroup.d.ts +2 -2
- package/dist/types/features/properties-panel/groups/TableHeaderGroups.d.ts +1 -1
- package/dist/types/features/properties-panel/groups/ValidationGroup.d.ts +3 -2
- package/dist/types/features/repeat-render/EditorRepeatRenderManager.d.ts +2 -1
- package/package.json +7 -3
package/dist/index.es.js
CHANGED
|
@@ -23,6 +23,46 @@ import dragula from '@bpmn-io/draggle';
|
|
|
23
23
|
import { arrayMoveMutable } from 'array-move';
|
|
24
24
|
import Big from 'big.js';
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* @typedef { {
|
|
28
|
+
* [key: string]: string;
|
|
29
|
+
* } } TranslateReplacements
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A simple translation stub to be used for multi-language support
|
|
34
|
+
* in diagrams. Can be easily replaced with a more sophisticated
|
|
35
|
+
* solution.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
*
|
|
39
|
+
* ```javascript
|
|
40
|
+
* // use it inside any diagram component by injecting `translate`.
|
|
41
|
+
*
|
|
42
|
+
* function MyService(translate) {
|
|
43
|
+
* alert(translate('HELLO {you}', { you: 'You!' }));
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @param {string} template to interpolate
|
|
48
|
+
* @param {TranslateReplacements} [replacements] a map with substitutes
|
|
49
|
+
*
|
|
50
|
+
* @return {string} the translated string
|
|
51
|
+
*/
|
|
52
|
+
function translate(template, replacements) {
|
|
53
|
+
replacements = replacements || {};
|
|
54
|
+
return template.replace(/{([^}]+)}/g, function (_, key) {
|
|
55
|
+
return replacements[key] || '{' + key + '}';
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @type { import('didi').ModuleDeclaration }
|
|
61
|
+
*/
|
|
62
|
+
var TranslateModule = {
|
|
63
|
+
translate: ['value', translate]
|
|
64
|
+
};
|
|
65
|
+
|
|
26
66
|
var FN_REF = '__fn';
|
|
27
67
|
var DEFAULT_PRIORITY$4 = 1000;
|
|
28
68
|
var slice = Array.prototype.slice;
|
|
@@ -617,6 +657,10 @@ class FormFieldRegistry extends FormFieldRegistry$1 {
|
|
|
617
657
|
}
|
|
618
658
|
}
|
|
619
659
|
|
|
660
|
+
/**
|
|
661
|
+
* @typedef { import('diagram-js/lib/i18n/translate/translate').default } Translate
|
|
662
|
+
*/
|
|
663
|
+
|
|
620
664
|
const MAX_COLUMNS_PER_ROW = 16;
|
|
621
665
|
const MAX_COLUMNS = 16;
|
|
622
666
|
const MIN_COLUMNS = 2;
|
|
@@ -627,22 +671,28 @@ class FormLayoutValidator {
|
|
|
627
671
|
*
|
|
628
672
|
* @param { import('./FormLayouter').FormLayouter } formLayouter
|
|
629
673
|
* @param { import('./FormFieldRegistry').FormFieldRegistry } formFieldRegistry
|
|
674
|
+
* @param {Translate} translate
|
|
630
675
|
*/
|
|
631
|
-
constructor(formLayouter, formFieldRegistry) {
|
|
676
|
+
constructor(formLayouter, formFieldRegistry, translate) {
|
|
632
677
|
this._formLayouter = formLayouter;
|
|
633
678
|
this._formFieldRegistry = formFieldRegistry;
|
|
679
|
+
this._translate = translate;
|
|
634
680
|
}
|
|
635
681
|
validateField(field = {}, columns, row) {
|
|
636
682
|
// allow empty (auto columns)
|
|
637
683
|
if (Number.isInteger(columns)) {
|
|
638
684
|
// allow minimum cols
|
|
639
685
|
if (columns < MIN_COLUMNS) {
|
|
640
|
-
return
|
|
686
|
+
return this._translate('Minimum {value} columns are allowed', {
|
|
687
|
+
value: MIN_COLUMNS.toString()
|
|
688
|
+
});
|
|
641
689
|
}
|
|
642
690
|
|
|
643
691
|
// allow maximum cols
|
|
644
692
|
if (columns > MAX_COLUMNS) {
|
|
645
|
-
return
|
|
693
|
+
return this._translate('Maximum {value} columns are allowed', {
|
|
694
|
+
value: MAX_COLUMNS.toString()
|
|
695
|
+
});
|
|
646
696
|
}
|
|
647
697
|
}
|
|
648
698
|
if (!row) {
|
|
@@ -668,15 +718,19 @@ class FormLayoutValidator {
|
|
|
668
718
|
|
|
669
719
|
// do not allow overflows
|
|
670
720
|
if (sumColumns > MAX_COLUMNS_PER_ROW || sumAutoCols > 0 && sumColumns > calculateMaxColumnsWithAuto(sumAutoCols) || columns === MAX_COLUMNS_PER_ROW && sumFields > 1) {
|
|
671
|
-
return
|
|
721
|
+
return this._translate('New value exceeds the maximum of {value} columns per row', {
|
|
722
|
+
value: MAX_COLUMNS_PER_ROW.toString()
|
|
723
|
+
});
|
|
672
724
|
}
|
|
673
725
|
if (sumFields > MAX_FIELDS_PER_ROW) {
|
|
674
|
-
return
|
|
726
|
+
return this._translate('Maximum {value} fields per row are allowed', {
|
|
727
|
+
value: MAX_FIELDS_PER_ROW.toString()
|
|
728
|
+
});
|
|
675
729
|
}
|
|
676
730
|
return null;
|
|
677
731
|
}
|
|
678
732
|
}
|
|
679
|
-
FormLayoutValidator.$inject = ['formLayouter', 'formFieldRegistry'];
|
|
733
|
+
FormLayoutValidator.$inject = ['formLayouter', 'formFieldRegistry', 'translate'];
|
|
680
734
|
|
|
681
735
|
// helper //////////////////////
|
|
682
736
|
|
|
@@ -1006,6 +1060,7 @@ function EditorText(props) {
|
|
|
1006
1060
|
const Icon = iconsByType('text');
|
|
1007
1061
|
const templating = useService('templating');
|
|
1008
1062
|
const expressionLanguage = useService('expressionLanguage');
|
|
1063
|
+
const translate = useService('translate');
|
|
1009
1064
|
if (!text || !text.trim()) {
|
|
1010
1065
|
return jsx("div", {
|
|
1011
1066
|
class: editorFormFieldClasses(type),
|
|
@@ -1013,7 +1068,7 @@ function EditorText(props) {
|
|
|
1013
1068
|
class: "fjs-form-field-placeholder",
|
|
1014
1069
|
children: [jsx(Icon, {
|
|
1015
1070
|
viewBox: "0 0 54 54"
|
|
1016
|
-
}),
|
|
1071
|
+
}), translate('Text view is empty')]
|
|
1017
1072
|
})
|
|
1018
1073
|
});
|
|
1019
1074
|
}
|
|
@@ -1024,7 +1079,7 @@ function EditorText(props) {
|
|
|
1024
1079
|
class: "fjs-form-field-placeholder",
|
|
1025
1080
|
children: [jsx(Icon, {
|
|
1026
1081
|
viewBox: "0 0 54 54"
|
|
1027
|
-
}),
|
|
1082
|
+
}), translate('Text view is populated by an expression')]
|
|
1028
1083
|
})
|
|
1029
1084
|
});
|
|
1030
1085
|
}
|
|
@@ -1035,7 +1090,7 @@ function EditorText(props) {
|
|
|
1035
1090
|
class: "fjs-form-field-placeholder",
|
|
1036
1091
|
children: [jsx(Icon, {
|
|
1037
1092
|
viewBox: "0 0 54 54"
|
|
1038
|
-
}),
|
|
1093
|
+
}), translate('Text view is templated')]
|
|
1039
1094
|
})
|
|
1040
1095
|
});
|
|
1041
1096
|
}
|
|
@@ -1054,6 +1109,7 @@ function EditorHtml(props) {
|
|
|
1054
1109
|
const Icon = iconsByType(type);
|
|
1055
1110
|
const templating = useService('templating');
|
|
1056
1111
|
const expressionLanguage = useService('expressionLanguage');
|
|
1112
|
+
const translate = useService('translate');
|
|
1057
1113
|
if (!content || !content.trim()) {
|
|
1058
1114
|
return jsx("div", {
|
|
1059
1115
|
class: editorFormFieldClasses(type),
|
|
@@ -1061,7 +1117,7 @@ function EditorHtml(props) {
|
|
|
1061
1117
|
class: "fjs-form-field-placeholder",
|
|
1062
1118
|
children: [jsx(Icon, {
|
|
1063
1119
|
viewBox: "0 0 54 54"
|
|
1064
|
-
}),
|
|
1120
|
+
}), translate('Html view is empty')]
|
|
1065
1121
|
})
|
|
1066
1122
|
});
|
|
1067
1123
|
}
|
|
@@ -1072,7 +1128,7 @@ function EditorHtml(props) {
|
|
|
1072
1128
|
class: "fjs-form-field-placeholder",
|
|
1073
1129
|
children: [jsx(Icon, {
|
|
1074
1130
|
viewBox: "0 0 54 54"
|
|
1075
|
-
}),
|
|
1131
|
+
}), translate('Html view is populated by an expression')]
|
|
1076
1132
|
})
|
|
1077
1133
|
});
|
|
1078
1134
|
}
|
|
@@ -1083,7 +1139,7 @@ function EditorHtml(props) {
|
|
|
1083
1139
|
class: "fjs-form-field-placeholder",
|
|
1084
1140
|
children: [jsx(Icon, {
|
|
1085
1141
|
viewBox: "0 0 54 54"
|
|
1086
|
-
}),
|
|
1142
|
+
}), translate('Html view is templated')]
|
|
1087
1143
|
})
|
|
1088
1144
|
});
|
|
1089
1145
|
}
|
|
@@ -1101,16 +1157,23 @@ function EditorTable(props) {
|
|
|
1101
1157
|
id,
|
|
1102
1158
|
label
|
|
1103
1159
|
} = props.field;
|
|
1160
|
+
const translate = useService('translate');
|
|
1104
1161
|
const shouldUseMockColumns = typeof columnsExpression === 'string' && columnsExpression.length > 0 || Array.isArray(columns) && columns.length === 0;
|
|
1105
1162
|
const editorColumns = shouldUseMockColumns ? [{
|
|
1106
1163
|
key: '1',
|
|
1107
|
-
label: 'Column
|
|
1164
|
+
label: translate('Column {index}', {
|
|
1165
|
+
index: '1'
|
|
1166
|
+
})
|
|
1108
1167
|
}, {
|
|
1109
1168
|
key: '2',
|
|
1110
|
-
label: 'Column
|
|
1169
|
+
label: translate('Column {index}', {
|
|
1170
|
+
index: '2'
|
|
1171
|
+
})
|
|
1111
1172
|
}, {
|
|
1112
1173
|
key: '3',
|
|
1113
|
-
label: 'Column
|
|
1174
|
+
label: translate('Column {index}', {
|
|
1175
|
+
index: '3'
|
|
1176
|
+
})
|
|
1114
1177
|
}] : columns;
|
|
1115
1178
|
const prefixId = `fjs-form-${id}`;
|
|
1116
1179
|
return jsxs("div", {
|
|
@@ -1193,6 +1256,7 @@ function EditorDocumentPreview(props) {
|
|
|
1193
1256
|
field,
|
|
1194
1257
|
domId
|
|
1195
1258
|
} = props;
|
|
1259
|
+
const translate = useService('translate');
|
|
1196
1260
|
const {
|
|
1197
1261
|
label
|
|
1198
1262
|
} = field;
|
|
@@ -1211,7 +1275,7 @@ function EditorDocumentPreview(props) {
|
|
|
1211
1275
|
width: "32",
|
|
1212
1276
|
height: "24",
|
|
1213
1277
|
viewBox: "0 0 56 56"
|
|
1214
|
-
}),
|
|
1278
|
+
}), translate('Document preview')]
|
|
1215
1279
|
})
|
|
1216
1280
|
})]
|
|
1217
1281
|
});
|
|
@@ -1510,6 +1574,7 @@ function PaletteEntry(props) {
|
|
|
1510
1574
|
} = props;
|
|
1511
1575
|
const modeling = useService('modeling');
|
|
1512
1576
|
const formEditor = useService('formEditor');
|
|
1577
|
+
const translate = useService('translate');
|
|
1513
1578
|
const Icon = getPaletteIcon({
|
|
1514
1579
|
icon,
|
|
1515
1580
|
iconUrl,
|
|
@@ -1535,7 +1600,9 @@ function PaletteEntry(props) {
|
|
|
1535
1600
|
type: "button",
|
|
1536
1601
|
class: "fjs-palette-field fjs-drag-copy fjs-no-drop",
|
|
1537
1602
|
"data-field-type": type,
|
|
1538
|
-
title:
|
|
1603
|
+
title: translate('Create {label} element', {
|
|
1604
|
+
label: translate(label)
|
|
1605
|
+
}),
|
|
1539
1606
|
onKeyDown: onKeyDown,
|
|
1540
1607
|
children: [Icon ? jsx(Icon, {
|
|
1541
1608
|
class: "fjs-palette-field-icon",
|
|
@@ -1544,20 +1611,11 @@ function PaletteEntry(props) {
|
|
|
1544
1611
|
viewBox: "0 0 54 54"
|
|
1545
1612
|
}) : null, jsx("span", {
|
|
1546
1613
|
class: "fjs-palette-field-text",
|
|
1547
|
-
children: label
|
|
1614
|
+
children: translate(label)
|
|
1548
1615
|
})]
|
|
1549
1616
|
});
|
|
1550
1617
|
}
|
|
1551
1618
|
|
|
1552
|
-
// helpers ///////////
|
|
1553
|
-
|
|
1554
|
-
function getIndefiniteArticle(type) {
|
|
1555
|
-
if (['image'].includes(type)) {
|
|
1556
|
-
return 'an';
|
|
1557
|
-
}
|
|
1558
|
-
return 'a';
|
|
1559
|
-
}
|
|
1560
|
-
|
|
1561
1619
|
const PALETTE_GROUPS = [{
|
|
1562
1620
|
label: 'Input',
|
|
1563
1621
|
id: 'basic-input'
|
|
@@ -1576,6 +1634,7 @@ const PALETTE_GROUPS = [{
|
|
|
1576
1634
|
}];
|
|
1577
1635
|
function Palette(props) {
|
|
1578
1636
|
const formFields = useService('formFields');
|
|
1637
|
+
const translate = useService('translate');
|
|
1579
1638
|
const initialPaletteEntries = useRef(collectPaletteEntries(formFields));
|
|
1580
1639
|
const [paletteEntries, setPaletteEntries] = useState(initialPaletteEntries.current);
|
|
1581
1640
|
const [searchTerm, setSearchTerm] = useState('');
|
|
@@ -1591,10 +1650,10 @@ function Palette(props) {
|
|
|
1591
1650
|
if (!simplifiedSearchTerm) {
|
|
1592
1651
|
return true;
|
|
1593
1652
|
}
|
|
1594
|
-
const simplifiedEntryLabel = simplifyString(entry.label);
|
|
1653
|
+
const simplifiedEntryLabel = simplifyString(translate(entry.label));
|
|
1595
1654
|
const simplifiedEntryType = simplifyString(entry.type);
|
|
1596
1655
|
return simplifiedEntryLabel.includes(simplifiedSearchTerm) || simplifiedEntryType.includes(simplifiedSearchTerm);
|
|
1597
|
-
}, [searchTerm, simplifyString]);
|
|
1656
|
+
}, [searchTerm, simplifyString, translate]);
|
|
1598
1657
|
|
|
1599
1658
|
// filter entries on search change
|
|
1600
1659
|
useEffect(() => {
|
|
@@ -1612,8 +1671,8 @@ function Palette(props) {
|
|
|
1612
1671
|
class: "fjs-palette",
|
|
1613
1672
|
children: [jsx("div", {
|
|
1614
1673
|
class: "fjs-palette-header",
|
|
1615
|
-
title:
|
|
1616
|
-
children:
|
|
1674
|
+
title: translate('Components'),
|
|
1675
|
+
children: translate('Components')
|
|
1617
1676
|
}), jsxs("div", {
|
|
1618
1677
|
class: "fjs-palette-search-container",
|
|
1619
1678
|
children: [jsx("span", {
|
|
@@ -1623,12 +1682,12 @@ function Palette(props) {
|
|
|
1623
1682
|
class: "fjs-palette-search",
|
|
1624
1683
|
ref: inputRef,
|
|
1625
1684
|
type: "text",
|
|
1626
|
-
placeholder:
|
|
1685
|
+
placeholder: translate('Search components'),
|
|
1627
1686
|
value: searchTerm,
|
|
1628
1687
|
onInput: handleInput
|
|
1629
1688
|
}), searchTerm && jsx("button", {
|
|
1630
1689
|
type: "button",
|
|
1631
|
-
title:
|
|
1690
|
+
title: translate('Clear content'),
|
|
1632
1691
|
class: "fjs-palette-search-clear",
|
|
1633
1692
|
onClick: handleClear,
|
|
1634
1693
|
children: jsx(SvgClose, {})
|
|
@@ -1644,7 +1703,7 @@ function Palette(props) {
|
|
|
1644
1703
|
"data-group-id": id,
|
|
1645
1704
|
children: [jsx("span", {
|
|
1646
1705
|
class: "fjs-palette-group-title",
|
|
1647
|
-
children: label
|
|
1706
|
+
children: translate(label)
|
|
1648
1707
|
}), jsx("div", {
|
|
1649
1708
|
class: "fjs-palette-fields fjs-drag-container fjs-no-drop",
|
|
1650
1709
|
children: entries.map(entry => {
|
|
@@ -1656,7 +1715,7 @@ function Palette(props) {
|
|
|
1656
1715
|
})]
|
|
1657
1716
|
}, id)), groups.length == 0 && jsx("div", {
|
|
1658
1717
|
class: "fjs-palette-no-entries",
|
|
1659
|
-
children:
|
|
1718
|
+
children: translate('No components found.')
|
|
1660
1719
|
})]
|
|
1661
1720
|
}), jsx("div", {
|
|
1662
1721
|
class: "fjs-palette-footer",
|
|
@@ -5960,7 +6019,8 @@ var index = {
|
|
|
5960
6019
|
function getPropertiesPanelHeaderProvider(options = {}) {
|
|
5961
6020
|
const {
|
|
5962
6021
|
getDocumentationRef,
|
|
5963
|
-
formFields
|
|
6022
|
+
formFields,
|
|
6023
|
+
translate
|
|
5964
6024
|
} = options;
|
|
5965
6025
|
return {
|
|
5966
6026
|
getElementLabel: field => {
|
|
@@ -5996,10 +6056,10 @@ function getPropertiesPanelHeaderProvider(options = {}) {
|
|
|
5996
6056
|
type
|
|
5997
6057
|
} = field;
|
|
5998
6058
|
if (type === 'default') {
|
|
5999
|
-
return 'Form';
|
|
6059
|
+
return translate('Form');
|
|
6000
6060
|
}
|
|
6001
6061
|
const fieldDefinition = formFields.get(type).config;
|
|
6002
|
-
return fieldDefinition.name || fieldDefinition.label || type;
|
|
6062
|
+
return translate(fieldDefinition.name || fieldDefinition.label || type);
|
|
6003
6063
|
},
|
|
6004
6064
|
getDocumentationRef
|
|
6005
6065
|
};
|
|
@@ -6041,6 +6101,7 @@ function PropertiesPanel() {
|
|
|
6041
6101
|
const formFields = useService('formFields');
|
|
6042
6102
|
const propertiesPanel = useService('propertiesPanel');
|
|
6043
6103
|
const propertiesPanelConfig = useService('config.propertiesPanel') || EMPTY;
|
|
6104
|
+
const translate = useService('translate');
|
|
6044
6105
|
const {
|
|
6045
6106
|
feelPopupContainer
|
|
6046
6107
|
} = propertiesPanelConfig;
|
|
@@ -6092,8 +6153,9 @@ function PropertiesPanel() {
|
|
|
6092
6153
|
}, [providers, selectedFormField, editField]);
|
|
6093
6154
|
const PropertiesPanelHeaderProvider = useMemo(() => getPropertiesPanelHeaderProvider({
|
|
6094
6155
|
getDocumentationRef: propertiesPanelConfig.getDocumentationRef,
|
|
6095
|
-
formFields
|
|
6096
|
-
|
|
6156
|
+
formFields,
|
|
6157
|
+
translate
|
|
6158
|
+
}), [formFields, propertiesPanelConfig, translate]);
|
|
6097
6159
|
return (
|
|
6098
6160
|
// eslint-disable-next-line react/no-unknown-property
|
|
6099
6161
|
jsx("div", {
|
|
@@ -6650,26 +6712,29 @@ function ContextPadContent(props) {
|
|
|
6650
6712
|
}, entryId))
|
|
6651
6713
|
});
|
|
6652
6714
|
}
|
|
6653
|
-
function EmptyGroup(
|
|
6715
|
+
function EmptyGroup({
|
|
6716
|
+
translate
|
|
6717
|
+
}) {
|
|
6654
6718
|
return jsx("div", {
|
|
6655
6719
|
class: "fjs-empty-component",
|
|
6656
6720
|
children: jsx("span", {
|
|
6657
6721
|
class: "fjs-empty-component-text",
|
|
6658
|
-
children:
|
|
6722
|
+
children: translate('Drag and drop components here.')
|
|
6659
6723
|
})
|
|
6660
6724
|
});
|
|
6661
6725
|
}
|
|
6662
6726
|
function EmptyForm() {
|
|
6727
|
+
const translate = useService('translate');
|
|
6663
6728
|
return jsx("div", {
|
|
6664
6729
|
class: "fjs-empty-editor",
|
|
6665
6730
|
children: jsxs("div", {
|
|
6666
6731
|
class: "fjs-empty-editor-card",
|
|
6667
6732
|
children: [jsx(SvgEmptyForm, {}), jsx("h2", {
|
|
6668
|
-
children:
|
|
6733
|
+
children: translate('Build your form')
|
|
6669
6734
|
}), jsx("span", {
|
|
6670
|
-
children:
|
|
6735
|
+
children: translate('Drag and drop components here to start designing.')
|
|
6671
6736
|
}), jsx("span", {
|
|
6672
|
-
children:
|
|
6737
|
+
children: translate('Use the preview window to test your form.')
|
|
6673
6738
|
}), jsx(Slot, {
|
|
6674
6739
|
name: "editor-empty-state__footer"
|
|
6675
6740
|
})]
|
|
@@ -6677,8 +6742,11 @@ function EmptyForm() {
|
|
|
6677
6742
|
});
|
|
6678
6743
|
}
|
|
6679
6744
|
function Empty(props) {
|
|
6745
|
+
const translate = useService('translate');
|
|
6680
6746
|
if (['group', 'dynamiclist'].includes(props.field.type)) {
|
|
6681
|
-
return jsx(EmptyGroup, {
|
|
6747
|
+
return jsx(EmptyGroup, {
|
|
6748
|
+
translate: translate
|
|
6749
|
+
});
|
|
6682
6750
|
}
|
|
6683
6751
|
if (props.field.type === 'default') {
|
|
6684
6752
|
return jsx(EmptyForm, {});
|
|
@@ -7261,10 +7329,11 @@ FormFieldContextActions.$inject = ['eventBus'];
|
|
|
7261
7329
|
* @param {import('../../render/EditorFormFields').EditorFormFields} formFields
|
|
7262
7330
|
*/
|
|
7263
7331
|
class DeleteActionProvider {
|
|
7264
|
-
constructor(formFieldContextActions, modeling, formFieldRegistry, formFields) {
|
|
7332
|
+
constructor(formFieldContextActions, modeling, formFieldRegistry, formFields, translate) {
|
|
7265
7333
|
this._modeling = modeling;
|
|
7266
7334
|
this._formFieldRegistry = formFieldRegistry;
|
|
7267
7335
|
this._formFields = formFields;
|
|
7336
|
+
this._translate = translate;
|
|
7268
7337
|
formFieldContextActions.registerProvider(500, this);
|
|
7269
7338
|
}
|
|
7270
7339
|
|
|
@@ -7279,6 +7348,7 @@ class DeleteActionProvider {
|
|
|
7279
7348
|
const modeling = this._modeling;
|
|
7280
7349
|
const formFieldRegistry = this._formFieldRegistry;
|
|
7281
7350
|
const formFields = this._formFields;
|
|
7351
|
+
const translate = this._translate;
|
|
7282
7352
|
return {
|
|
7283
7353
|
delete: {
|
|
7284
7354
|
action: event => {
|
|
@@ -7287,14 +7357,14 @@ class DeleteActionProvider {
|
|
|
7287
7357
|
const index = getFormFieldIndex(parentField, formField);
|
|
7288
7358
|
modeling.removeFormField(formField, parentField, index);
|
|
7289
7359
|
},
|
|
7290
|
-
title: getRemoveButtonTitle(formField, formFields),
|
|
7360
|
+
title: getRemoveButtonTitle(formField, formFields, translate),
|
|
7291
7361
|
icon: 'delete',
|
|
7292
7362
|
group: 'actions'
|
|
7293
7363
|
}
|
|
7294
7364
|
};
|
|
7295
7365
|
}
|
|
7296
7366
|
}
|
|
7297
|
-
DeleteActionProvider.$inject = ['formFieldContextActions', 'modeling', 'formFieldRegistry', 'formFields'];
|
|
7367
|
+
DeleteActionProvider.$inject = ['formFieldContextActions', 'modeling', 'formFieldRegistry', 'formFields', 'translate'];
|
|
7298
7368
|
|
|
7299
7369
|
// helpers //////////
|
|
7300
7370
|
|
|
@@ -7312,12 +7382,14 @@ function getFormFieldIndex(parent, formField) {
|
|
|
7312
7382
|
function findPaletteEntry(type, formFields) {
|
|
7313
7383
|
return collectPaletteEntries(formFields).find(entry => entry.type === type);
|
|
7314
7384
|
}
|
|
7315
|
-
function getRemoveButtonTitle(formField, formFields) {
|
|
7385
|
+
function getRemoveButtonTitle(formField, formFields, translate) {
|
|
7316
7386
|
const entry = findPaletteEntry(formField.type, formFields);
|
|
7317
7387
|
if (!entry) {
|
|
7318
|
-
return 'Remove form field';
|
|
7388
|
+
return translate('Remove form field');
|
|
7319
7389
|
}
|
|
7320
|
-
return
|
|
7390
|
+
return translate('Remove {label}', {
|
|
7391
|
+
label: translate(entry.label)
|
|
7392
|
+
});
|
|
7321
7393
|
}
|
|
7322
7394
|
|
|
7323
7395
|
const ContextPadModule = {
|
|
@@ -9996,6 +10068,7 @@ function Action(props) {
|
|
|
9996
10068
|
id
|
|
9997
10069
|
} = props;
|
|
9998
10070
|
const path = ['action'];
|
|
10071
|
+
const translate = useService('translate');
|
|
9999
10072
|
const getValue = () => {
|
|
10000
10073
|
return get(field, path, '');
|
|
10001
10074
|
};
|
|
@@ -10003,10 +10076,10 @@ function Action(props) {
|
|
|
10003
10076
|
return editField(field, path, value);
|
|
10004
10077
|
};
|
|
10005
10078
|
const getOptions = () => [{
|
|
10006
|
-
label: 'Submit',
|
|
10079
|
+
label: translate('Submit'),
|
|
10007
10080
|
value: 'submit'
|
|
10008
10081
|
}, {
|
|
10009
|
-
label: 'Reset',
|
|
10082
|
+
label: translate('Reset'),
|
|
10010
10083
|
value: 'reset'
|
|
10011
10084
|
}];
|
|
10012
10085
|
return SelectEntry({
|
|
@@ -10014,7 +10087,7 @@ function Action(props) {
|
|
|
10014
10087
|
getOptions,
|
|
10015
10088
|
getValue,
|
|
10016
10089
|
id,
|
|
10017
|
-
label: 'Action',
|
|
10090
|
+
label: translate('Action'),
|
|
10018
10091
|
setValue
|
|
10019
10092
|
});
|
|
10020
10093
|
}
|
|
@@ -10042,6 +10115,7 @@ function AltText(props) {
|
|
|
10042
10115
|
id
|
|
10043
10116
|
} = props;
|
|
10044
10117
|
const debounce = useService('debounce');
|
|
10118
|
+
const translate = useService('translate');
|
|
10045
10119
|
const variables = useVariables().map(name => ({
|
|
10046
10120
|
name
|
|
10047
10121
|
}));
|
|
@@ -10058,8 +10132,8 @@ function AltText(props) {
|
|
|
10058
10132
|
feel: 'optional',
|
|
10059
10133
|
getValue,
|
|
10060
10134
|
id,
|
|
10061
|
-
label: 'Alternative text',
|
|
10062
|
-
tooltip: 'Descriptive text for screen reader accessibility.',
|
|
10135
|
+
label: translate('Alternative text'),
|
|
10136
|
+
tooltip: translate('Descriptive text for screen reader accessibility.'),
|
|
10063
10137
|
setValue,
|
|
10064
10138
|
singleLine: true,
|
|
10065
10139
|
variables
|
|
@@ -10088,6 +10162,7 @@ function Columns(props) {
|
|
|
10088
10162
|
id
|
|
10089
10163
|
} = props;
|
|
10090
10164
|
useService('debounce');
|
|
10165
|
+
const translate = useService('translate');
|
|
10091
10166
|
const formLayoutValidator = useService('formLayoutValidator');
|
|
10092
10167
|
const validate = useCallback(value => {
|
|
10093
10168
|
return formLayoutValidator.validateField(field, value ? parseInt(value) : null);
|
|
@@ -10105,7 +10180,7 @@ function Columns(props) {
|
|
|
10105
10180
|
};
|
|
10106
10181
|
const getOptions = () => {
|
|
10107
10182
|
return [{
|
|
10108
|
-
label: 'Auto',
|
|
10183
|
+
label: translate('Auto'),
|
|
10109
10184
|
value: AUTO_OPTION_VALUE
|
|
10110
10185
|
},
|
|
10111
10186
|
// todo(pinussilvestrus): make options dependant on field type
|
|
@@ -10115,7 +10190,7 @@ function Columns(props) {
|
|
|
10115
10190
|
return SelectEntry({
|
|
10116
10191
|
element: field,
|
|
10117
10192
|
id,
|
|
10118
|
-
label: 'Columns',
|
|
10193
|
+
label: translate('Columns'),
|
|
10119
10194
|
getOptions,
|
|
10120
10195
|
getValue,
|
|
10121
10196
|
setValue,
|
|
@@ -10252,6 +10327,7 @@ function Description(props) {
|
|
|
10252
10327
|
id
|
|
10253
10328
|
} = props;
|
|
10254
10329
|
const debounce = useService('debounce');
|
|
10330
|
+
const translate = useService('translate');
|
|
10255
10331
|
const variables = useVariables().map(name => ({
|
|
10256
10332
|
name
|
|
10257
10333
|
}));
|
|
@@ -10267,7 +10343,7 @@ function Description(props) {
|
|
|
10267
10343
|
element: field,
|
|
10268
10344
|
getValue,
|
|
10269
10345
|
id,
|
|
10270
|
-
label: 'Field description',
|
|
10346
|
+
label: translate('Field description'),
|
|
10271
10347
|
singleLine: true,
|
|
10272
10348
|
setValue,
|
|
10273
10349
|
variables
|
|
@@ -10278,8 +10354,10 @@ const EMPTY_OPTION = '';
|
|
|
10278
10354
|
function DefaultValueEntry(props) {
|
|
10279
10355
|
const {
|
|
10280
10356
|
editField,
|
|
10281
|
-
field
|
|
10357
|
+
field,
|
|
10358
|
+
getService
|
|
10282
10359
|
} = props;
|
|
10360
|
+
const translate = getService('translate');
|
|
10283
10361
|
const {
|
|
10284
10362
|
type
|
|
10285
10363
|
} = field;
|
|
@@ -10297,7 +10375,7 @@ function DefaultValueEntry(props) {
|
|
|
10297
10375
|
editField,
|
|
10298
10376
|
field,
|
|
10299
10377
|
id: 'defaultValue',
|
|
10300
|
-
label: 'Default value'
|
|
10378
|
+
label: translate('Default value')
|
|
10301
10379
|
};
|
|
10302
10380
|
entries.push({
|
|
10303
10381
|
...defaultValueBase,
|
|
@@ -10341,16 +10419,17 @@ function DefaultValueCheckbox(props) {
|
|
|
10341
10419
|
id,
|
|
10342
10420
|
label
|
|
10343
10421
|
} = props;
|
|
10422
|
+
const translate = useService('translate');
|
|
10344
10423
|
const {
|
|
10345
10424
|
defaultValue
|
|
10346
10425
|
} = field;
|
|
10347
10426
|
const path = ['defaultValue'];
|
|
10348
10427
|
const getOptions = () => {
|
|
10349
10428
|
return [{
|
|
10350
|
-
label: 'Checked',
|
|
10429
|
+
label: translate('Checked'),
|
|
10351
10430
|
value: 'true'
|
|
10352
10431
|
}, {
|
|
10353
|
-
label: 'Not checked',
|
|
10432
|
+
label: translate('Not checked'),
|
|
10354
10433
|
value: 'false'
|
|
10355
10434
|
}];
|
|
10356
10435
|
};
|
|
@@ -10381,6 +10460,7 @@ function DefaultValueNumber(props) {
|
|
|
10381
10460
|
serializeToString = false
|
|
10382
10461
|
} = field;
|
|
10383
10462
|
const debounce = useService('debounce');
|
|
10463
|
+
const translate = useService('translate');
|
|
10384
10464
|
const path = ['defaultValue'];
|
|
10385
10465
|
const getValue = e => {
|
|
10386
10466
|
let value = get(field, path);
|
|
@@ -10405,12 +10485,14 @@ function DefaultValueNumber(props) {
|
|
|
10405
10485
|
return;
|
|
10406
10486
|
}
|
|
10407
10487
|
if (!isValidNumber(value)) {
|
|
10408
|
-
return 'Should be a valid number';
|
|
10488
|
+
return translate('Should be a valid number.');
|
|
10409
10489
|
}
|
|
10410
10490
|
if (decimalDigitsSet && countDecimals(value) > decimalDigits) {
|
|
10411
|
-
return
|
|
10491
|
+
return translate('Should not contain more than {value} decimal digits.', {
|
|
10492
|
+
value: decimalDigits.toString()
|
|
10493
|
+
});
|
|
10412
10494
|
}
|
|
10413
|
-
}, [decimalDigitsSet, decimalDigits]);
|
|
10495
|
+
}, [decimalDigitsSet, decimalDigits, translate]);
|
|
10414
10496
|
return TextfieldEntry({
|
|
10415
10497
|
debounce,
|
|
10416
10498
|
label,
|
|
@@ -10432,10 +10514,11 @@ function DefaultValueSingleSelect(props) {
|
|
|
10432
10514
|
defaultValue = EMPTY_OPTION,
|
|
10433
10515
|
values = []
|
|
10434
10516
|
} = field;
|
|
10517
|
+
const translate = useService('translate');
|
|
10435
10518
|
const path = ['defaultValue'];
|
|
10436
10519
|
const getOptions = () => {
|
|
10437
10520
|
return [{
|
|
10438
|
-
label: '<none>',
|
|
10521
|
+
label: translate('<none>'),
|
|
10439
10522
|
value: EMPTY_OPTION
|
|
10440
10523
|
}, ...values];
|
|
10441
10524
|
};
|
|
@@ -10521,16 +10604,19 @@ function parseBooleanToString(value) {
|
|
|
10521
10604
|
function DisabledEntry(props) {
|
|
10522
10605
|
const {
|
|
10523
10606
|
editField,
|
|
10524
|
-
field
|
|
10607
|
+
field,
|
|
10608
|
+
getService
|
|
10525
10609
|
} = props;
|
|
10526
10610
|
const entries = [];
|
|
10611
|
+
const translate = getService('translate');
|
|
10527
10612
|
entries.push({
|
|
10528
10613
|
id: 'disabled',
|
|
10529
10614
|
component: Disabled,
|
|
10530
10615
|
editField: editField,
|
|
10531
10616
|
field: field,
|
|
10532
10617
|
isEdited: isEdited$7,
|
|
10533
|
-
isDefaultVisible: field => INPUTS.includes(field.type)
|
|
10618
|
+
isDefaultVisible: field => INPUTS.includes(field.type),
|
|
10619
|
+
translate: translate
|
|
10534
10620
|
});
|
|
10535
10621
|
return entries;
|
|
10536
10622
|
}
|
|
@@ -10538,7 +10624,8 @@ function Disabled(props) {
|
|
|
10538
10624
|
const {
|
|
10539
10625
|
editField,
|
|
10540
10626
|
field,
|
|
10541
|
-
id
|
|
10627
|
+
id,
|
|
10628
|
+
translate
|
|
10542
10629
|
} = props;
|
|
10543
10630
|
const path = ['disabled'];
|
|
10544
10631
|
const getValue = () => {
|
|
@@ -10551,8 +10638,8 @@ function Disabled(props) {
|
|
|
10551
10638
|
element: field,
|
|
10552
10639
|
getValue,
|
|
10553
10640
|
id,
|
|
10554
|
-
label: 'Disabled',
|
|
10555
|
-
tooltip: 'Disable this field when it should not be interactive for end-users. Its data will not be submitted. This setting takes precedence over read-only.',
|
|
10641
|
+
label: translate('Disabled'),
|
|
10642
|
+
tooltip: translate('Disable this field when it should not be interactive for end-users. Its data will not be submitted. This setting takes precedence over read-only.'),
|
|
10556
10643
|
inline: true,
|
|
10557
10644
|
setValue
|
|
10558
10645
|
});
|
|
@@ -10582,6 +10669,7 @@ function Id(props) {
|
|
|
10582
10669
|
} = props;
|
|
10583
10670
|
const formFieldRegistry = useService('formFieldRegistry');
|
|
10584
10671
|
const debounce = useService('debounce');
|
|
10672
|
+
const translate = useService('translate');
|
|
10585
10673
|
const path = ['id'];
|
|
10586
10674
|
const getValue = () => {
|
|
10587
10675
|
return get(field, path, '');
|
|
@@ -10594,20 +10682,20 @@ function Id(props) {
|
|
|
10594
10682
|
};
|
|
10595
10683
|
const validate = useCallback(value => {
|
|
10596
10684
|
if (typeof value !== 'string' || value.length === 0) {
|
|
10597
|
-
return 'Must not be empty.';
|
|
10685
|
+
return translate('Must not be empty.');
|
|
10598
10686
|
}
|
|
10599
10687
|
const assigned = formFieldRegistry._ids.assigned(value);
|
|
10600
10688
|
if (assigned && assigned !== field) {
|
|
10601
|
-
return 'Must be unique.';
|
|
10689
|
+
return translate('Must be unique.');
|
|
10602
10690
|
}
|
|
10603
|
-
return validateId(value) || null;
|
|
10604
|
-
}, [formFieldRegistry, field]);
|
|
10691
|
+
return validateId(value, translate) || null;
|
|
10692
|
+
}, [formFieldRegistry, field, translate]);
|
|
10605
10693
|
return TextfieldEntry({
|
|
10606
10694
|
debounce,
|
|
10607
10695
|
element: field,
|
|
10608
10696
|
getValue,
|
|
10609
10697
|
id,
|
|
10610
|
-
label: 'ID',
|
|
10698
|
+
label: translate('ID'),
|
|
10611
10699
|
setValue,
|
|
10612
10700
|
validate
|
|
10613
10701
|
});
|
|
@@ -10622,15 +10710,15 @@ const QNAME_REGEX = /^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i;
|
|
|
10622
10710
|
|
|
10623
10711
|
// for ID validation as per BPMN Schema (QName - Namespace)
|
|
10624
10712
|
const ID_REGEX = /^[a-z_][\w-.]*$/i;
|
|
10625
|
-
function validateId(idValue) {
|
|
10713
|
+
function validateId(idValue, translate) {
|
|
10626
10714
|
if (containsSpace(idValue)) {
|
|
10627
|
-
return 'Must not contain spaces.';
|
|
10715
|
+
return translate('Must not contain spaces.');
|
|
10628
10716
|
}
|
|
10629
10717
|
if (!ID_REGEX.test(idValue)) {
|
|
10630
10718
|
if (QNAME_REGEX.test(idValue)) {
|
|
10631
|
-
return 'Must not contain prefix.';
|
|
10719
|
+
return translate('Must not contain prefix.');
|
|
10632
10720
|
}
|
|
10633
|
-
return 'Must be a valid QName.';
|
|
10721
|
+
return translate('Must be a valid QName.');
|
|
10634
10722
|
}
|
|
10635
10723
|
}
|
|
10636
10724
|
function containsSpace(value) {
|
|
@@ -10668,6 +10756,7 @@ function Key$2(props) {
|
|
|
10668
10756
|
} = props;
|
|
10669
10757
|
const pathRegistry = useService('pathRegistry');
|
|
10670
10758
|
const debounce = useService('debounce');
|
|
10759
|
+
const translate = useService('translate');
|
|
10671
10760
|
const path = ['key'];
|
|
10672
10761
|
const getValue = () => {
|
|
10673
10762
|
return get(field, path, '');
|
|
@@ -10683,16 +10772,16 @@ function Key$2(props) {
|
|
|
10683
10772
|
return null;
|
|
10684
10773
|
}
|
|
10685
10774
|
if (!isString(value) || value.length === 0) {
|
|
10686
|
-
return 'Must not be empty.';
|
|
10775
|
+
return translate('Must not be empty.');
|
|
10687
10776
|
}
|
|
10688
10777
|
if (!isValidDotPath(value)) {
|
|
10689
|
-
return 'Must be a variable or a dot separated path.';
|
|
10778
|
+
return translate('Must be a variable or a dot separated path.');
|
|
10690
10779
|
}
|
|
10691
10780
|
if (hasIntegerPathSegment(value)) {
|
|
10692
|
-
return 'Must not contain numerical path segments.';
|
|
10781
|
+
return translate('Must not contain numerical path segments.');
|
|
10693
10782
|
}
|
|
10694
10783
|
if (isProhibitedPath(value)) {
|
|
10695
|
-
return 'Must not be a prohibited path.';
|
|
10784
|
+
return translate('Must not be a prohibited path.');
|
|
10696
10785
|
}
|
|
10697
10786
|
const replacements = {
|
|
10698
10787
|
[field.id]: value.split('.')
|
|
@@ -10712,16 +10801,16 @@ function Key$2(props) {
|
|
|
10712
10801
|
isClosed: true,
|
|
10713
10802
|
claimerId: field.id
|
|
10714
10803
|
});
|
|
10715
|
-
return canClaim ? null : 'Must not conflict with other key/path assignments.';
|
|
10716
|
-
}, [field, pathRegistry]);
|
|
10804
|
+
return canClaim ? null : translate('Must not conflict with other key/path assignments.');
|
|
10805
|
+
}, [field, pathRegistry, translate]);
|
|
10717
10806
|
return TextfieldEntry({
|
|
10718
10807
|
debounce,
|
|
10719
|
-
description: 'Binds to a form variable',
|
|
10808
|
+
description: translate('Binds to a form variable'),
|
|
10720
10809
|
element: field,
|
|
10721
10810
|
getValue,
|
|
10722
10811
|
id,
|
|
10723
|
-
label: 'Key',
|
|
10724
|
-
tooltip: 'Use a unique "key" to link the form element and the related input/output data. When dealing with nested data, break it down in the user task\'s input mapping before using it.',
|
|
10812
|
+
label: translate('Key'),
|
|
10813
|
+
tooltip: translate('Use a unique "key" to link the form element and the related input/output data. When dealing with nested data, break it down in the user task\'s input mapping before using it.'),
|
|
10725
10814
|
setValue,
|
|
10726
10815
|
validate
|
|
10727
10816
|
});
|
|
@@ -10760,6 +10849,7 @@ function Path(props) {
|
|
|
10760
10849
|
const fieldConfig = useService('formFields').get(field.type).config;
|
|
10761
10850
|
const isRepeating = fieldConfig.repeatable && field.isRepeating;
|
|
10762
10851
|
const path = ['path'];
|
|
10852
|
+
const translate = useService('translate');
|
|
10763
10853
|
const getValue = () => {
|
|
10764
10854
|
return get(field, path, '');
|
|
10765
10855
|
};
|
|
@@ -10771,7 +10861,7 @@ function Path(props) {
|
|
|
10771
10861
|
};
|
|
10772
10862
|
const validate = useCallback(value => {
|
|
10773
10863
|
if (!value && isRepeating) {
|
|
10774
|
-
return 'Must not be empty';
|
|
10864
|
+
return translate('Must not be empty');
|
|
10775
10865
|
}
|
|
10776
10866
|
|
|
10777
10867
|
// Early return for empty value in non-repeating cases or if the field path hasn't changed
|
|
@@ -10781,18 +10871,18 @@ function Path(props) {
|
|
|
10781
10871
|
|
|
10782
10872
|
// Validate dot-separated path format
|
|
10783
10873
|
if (!isValidDotPath(value)) {
|
|
10784
|
-
const msg = isRepeating ? 'Must be a variable or a dot-separated path' : 'Must be empty, a variable or a dot-separated path';
|
|
10874
|
+
const msg = isRepeating ? translate('Must be a variable or a dot-separated path.') : translate('Must be empty, a variable or a dot-separated path.');
|
|
10785
10875
|
return msg;
|
|
10786
10876
|
}
|
|
10787
10877
|
|
|
10788
10878
|
// Check for integer segments in the path
|
|
10789
10879
|
if (hasIntegerPathSegment(value)) {
|
|
10790
|
-
return 'Must not contain numerical path segments.';
|
|
10880
|
+
return translate('Must not contain numerical path segments.');
|
|
10791
10881
|
}
|
|
10792
10882
|
|
|
10793
10883
|
// Check for special prohibited paths
|
|
10794
10884
|
if (isProhibitedPath(value)) {
|
|
10795
|
-
return 'Must not be a prohibited path.';
|
|
10885
|
+
return translate('Must not be a prohibited path.');
|
|
10796
10886
|
}
|
|
10797
10887
|
|
|
10798
10888
|
// Check for path collisions
|
|
@@ -10814,20 +10904,20 @@ function Path(props) {
|
|
|
10814
10904
|
});
|
|
10815
10905
|
});
|
|
10816
10906
|
if (!canClaim) {
|
|
10817
|
-
return 'Must not cause two binding paths to collide';
|
|
10907
|
+
return translate('Must not cause two binding paths to collide');
|
|
10818
10908
|
}
|
|
10819
10909
|
|
|
10820
10910
|
// If all checks pass
|
|
10821
10911
|
return null;
|
|
10822
|
-
}, [field, isRepeating, pathRegistry]);
|
|
10823
|
-
const tooltip = isRepeating ? 'Routes the children of this component into a form variable, may be left empty to route at the root level.' : 'Routes the children of this component into a form variable.';
|
|
10912
|
+
}, [field, isRepeating, pathRegistry, translate]);
|
|
10913
|
+
const tooltip = isRepeating ? translate('Routes the children of this component into a form variable, may be left empty to route at the root level.') : translate('Routes the children of this component into a form variable.');
|
|
10824
10914
|
return TextfieldEntry({
|
|
10825
10915
|
debounce,
|
|
10826
|
-
description: 'Where the child variables of this component are pathed to.',
|
|
10916
|
+
description: translate('Where the child variables of this component are pathed to.'),
|
|
10827
10917
|
element: field,
|
|
10828
10918
|
getValue,
|
|
10829
10919
|
id,
|
|
10830
|
-
label: 'Path',
|
|
10920
|
+
label: translate('Path'),
|
|
10831
10921
|
tooltip,
|
|
10832
10922
|
setValue,
|
|
10833
10923
|
validate
|
|
@@ -10967,6 +11057,7 @@ const SimpleRangeIntegerEntry = props => {
|
|
|
10967
11057
|
max = Number.MAX_SAFE_INTEGER
|
|
10968
11058
|
} = props;
|
|
10969
11059
|
const debounce = useService('debounce');
|
|
11060
|
+
const translate = useService('translate');
|
|
10970
11061
|
const getValue = () => {
|
|
10971
11062
|
const value = get(field, path);
|
|
10972
11063
|
const isValid = isValidNumber(value) && Number.isInteger(value);
|
|
@@ -10983,15 +11074,19 @@ const SimpleRangeIntegerEntry = props => {
|
|
|
10983
11074
|
return;
|
|
10984
11075
|
}
|
|
10985
11076
|
if (!Number.isInteger(Number(value))) {
|
|
10986
|
-
return 'Should be an integer.';
|
|
11077
|
+
return translate('Should be an integer.');
|
|
10987
11078
|
}
|
|
10988
11079
|
if (Big(value).cmp(min) < 0) {
|
|
10989
|
-
return
|
|
11080
|
+
return translate('Should be at least {value}.', {
|
|
11081
|
+
value: min.toString()
|
|
11082
|
+
});
|
|
10990
11083
|
}
|
|
10991
11084
|
if (Big(value).cmp(max) > 0) {
|
|
10992
|
-
return
|
|
11085
|
+
return translate('Should be at most {value}.', {
|
|
11086
|
+
value: max.toString()
|
|
11087
|
+
});
|
|
10993
11088
|
}
|
|
10994
|
-
}, [min, max]);
|
|
11089
|
+
}, [min, max, translate]);
|
|
10995
11090
|
return TextfieldEntry({
|
|
10996
11091
|
debounce,
|
|
10997
11092
|
label,
|
|
@@ -11005,7 +11100,8 @@ const SimpleRangeIntegerEntry = props => {
|
|
|
11005
11100
|
|
|
11006
11101
|
function GroupAppearanceEntry(props) {
|
|
11007
11102
|
const {
|
|
11008
|
-
field
|
|
11103
|
+
field,
|
|
11104
|
+
translate
|
|
11009
11105
|
} = props;
|
|
11010
11106
|
const {
|
|
11011
11107
|
type
|
|
@@ -11016,7 +11112,7 @@ function GroupAppearanceEntry(props) {
|
|
|
11016
11112
|
const entries = [simpleBoolEntryFactory({
|
|
11017
11113
|
id: 'showOutline',
|
|
11018
11114
|
path: ['showOutline'],
|
|
11019
|
-
label: 'Show outline',
|
|
11115
|
+
label: translate('Show outline'),
|
|
11020
11116
|
isTrueDefault: true,
|
|
11021
11117
|
props
|
|
11022
11118
|
})];
|
|
@@ -11069,6 +11165,7 @@ function Label$2(props) {
|
|
|
11069
11165
|
id
|
|
11070
11166
|
} = props;
|
|
11071
11167
|
const debounce = useService('debounce');
|
|
11168
|
+
const translate = useService('translate');
|
|
11072
11169
|
const variables = useVariables().map(name => ({
|
|
11073
11170
|
name
|
|
11074
11171
|
}));
|
|
@@ -11079,7 +11176,7 @@ function Label$2(props) {
|
|
|
11079
11176
|
const setValue = value => {
|
|
11080
11177
|
return editField(field, path, value || '');
|
|
11081
11178
|
};
|
|
11082
|
-
const label = getLabelText(field.type);
|
|
11179
|
+
const label = translate(getLabelText(field.type));
|
|
11083
11180
|
return FeelTemplatingEntry({
|
|
11084
11181
|
debounce,
|
|
11085
11182
|
element: field,
|
|
@@ -11098,6 +11195,7 @@ function DateLabel(props) {
|
|
|
11098
11195
|
id
|
|
11099
11196
|
} = props;
|
|
11100
11197
|
const debounce = useService('debounce');
|
|
11198
|
+
const translate = useService('translate');
|
|
11101
11199
|
const variables = useVariables().map(name => ({
|
|
11102
11200
|
name
|
|
11103
11201
|
}));
|
|
@@ -11113,7 +11211,7 @@ function DateLabel(props) {
|
|
|
11113
11211
|
element: field,
|
|
11114
11212
|
getValue,
|
|
11115
11213
|
id,
|
|
11116
|
-
label: 'Date label',
|
|
11214
|
+
label: translate('Date label'),
|
|
11117
11215
|
singleLine: true,
|
|
11118
11216
|
setValue,
|
|
11119
11217
|
variables
|
|
@@ -11126,6 +11224,7 @@ function TimeLabel(props) {
|
|
|
11126
11224
|
id
|
|
11127
11225
|
} = props;
|
|
11128
11226
|
const debounce = useService('debounce');
|
|
11227
|
+
const translate = useService('translate');
|
|
11129
11228
|
const variables = useVariables().map(name => ({
|
|
11130
11229
|
name
|
|
11131
11230
|
}));
|
|
@@ -11141,7 +11240,7 @@ function TimeLabel(props) {
|
|
|
11141
11240
|
element: field,
|
|
11142
11241
|
getValue,
|
|
11143
11242
|
id,
|
|
11144
|
-
label: 'Time label',
|
|
11243
|
+
label: translate('Time label'),
|
|
11145
11244
|
singleLine: true,
|
|
11146
11245
|
setValue,
|
|
11147
11246
|
variables
|
|
@@ -11169,6 +11268,10 @@ function getLabelText(type) {
|
|
|
11169
11268
|
}
|
|
11170
11269
|
}
|
|
11171
11270
|
|
|
11271
|
+
/**
|
|
11272
|
+
* @typedef { import('diagram-js/lib/i18n/translate/translate').default } Translate
|
|
11273
|
+
*/
|
|
11274
|
+
|
|
11172
11275
|
function HeightEntry(props) {
|
|
11173
11276
|
const {
|
|
11174
11277
|
editField,
|
|
@@ -11204,6 +11307,7 @@ function Height(props) {
|
|
|
11204
11307
|
id
|
|
11205
11308
|
} = props;
|
|
11206
11309
|
const debounce = useService('debounce');
|
|
11310
|
+
const translate = useService('translate');
|
|
11207
11311
|
const getValue = e => get(field, ['height'], null);
|
|
11208
11312
|
const setValue = (value, error) => {
|
|
11209
11313
|
if (error) {
|
|
@@ -11214,12 +11318,12 @@ function Height(props) {
|
|
|
11214
11318
|
return NumberFieldEntry({
|
|
11215
11319
|
debounce,
|
|
11216
11320
|
description,
|
|
11217
|
-
label: 'Height',
|
|
11321
|
+
label: translate('Height'),
|
|
11218
11322
|
element: field,
|
|
11219
11323
|
id,
|
|
11220
11324
|
getValue,
|
|
11221
11325
|
setValue,
|
|
11222
|
-
validate: validate$9
|
|
11326
|
+
validate: useCallback(value => validate$9(value, translate), [translate])
|
|
11223
11327
|
});
|
|
11224
11328
|
}
|
|
11225
11329
|
|
|
@@ -11227,24 +11331,26 @@ function Height(props) {
|
|
|
11227
11331
|
|
|
11228
11332
|
/**
|
|
11229
11333
|
* @param {number|void} value
|
|
11334
|
+
* @param {Translate} translate
|
|
11230
11335
|
* @returns {string|null}
|
|
11231
11336
|
*/
|
|
11232
|
-
const validate$9 = value => {
|
|
11337
|
+
const validate$9 = (value, translate) => {
|
|
11233
11338
|
if (typeof value !== 'number') {
|
|
11234
|
-
return 'A number is required.';
|
|
11339
|
+
return translate('A number is required.');
|
|
11235
11340
|
}
|
|
11236
11341
|
if (!Number.isInteger(value)) {
|
|
11237
|
-
return 'Should be an integer.';
|
|
11342
|
+
return translate('Should be an integer.');
|
|
11238
11343
|
}
|
|
11239
11344
|
if (value < 1) {
|
|
11240
|
-
return 'Should be greater than zero.';
|
|
11345
|
+
return translate('Should be greater than zero.');
|
|
11241
11346
|
}
|
|
11242
11347
|
};
|
|
11243
11348
|
|
|
11244
11349
|
function IFrameHeightEntry(props) {
|
|
11350
|
+
const translate = props.getService('translate');
|
|
11245
11351
|
return [...HeightEntry({
|
|
11246
11352
|
...props,
|
|
11247
|
-
description: 'Height of the container in pixels.',
|
|
11353
|
+
description: translate('Height of the container in pixels.'),
|
|
11248
11354
|
isDefaultVisible: field => field.type === 'iframe'
|
|
11249
11355
|
})];
|
|
11250
11356
|
}
|
|
@@ -11273,6 +11379,7 @@ function Url(props) {
|
|
|
11273
11379
|
id
|
|
11274
11380
|
} = props;
|
|
11275
11381
|
const debounce = useService('debounce');
|
|
11382
|
+
const translate = useService('translate');
|
|
11276
11383
|
const variables = useVariables().map(name => ({
|
|
11277
11384
|
name
|
|
11278
11385
|
}));
|
|
@@ -11289,29 +11396,29 @@ function Url(props) {
|
|
|
11289
11396
|
feel: 'optional',
|
|
11290
11397
|
getValue,
|
|
11291
11398
|
id,
|
|
11292
|
-
label: 'URL',
|
|
11399
|
+
label: translate('URL'),
|
|
11293
11400
|
setValue,
|
|
11294
11401
|
singleLine: true,
|
|
11295
|
-
tooltip: getTooltip$1(),
|
|
11296
|
-
validate: validate$8,
|
|
11402
|
+
tooltip: getTooltip$1(translate),
|
|
11403
|
+
validate: useCallback(value => validate$8(value, translate), [translate]),
|
|
11297
11404
|
variables
|
|
11298
11405
|
});
|
|
11299
11406
|
}
|
|
11300
11407
|
|
|
11301
11408
|
// helper //////////////////////
|
|
11302
11409
|
|
|
11303
|
-
function getTooltip$1() {
|
|
11410
|
+
function getTooltip$1(translate) {
|
|
11304
11411
|
return jsxs(Fragment$1, {
|
|
11305
11412
|
children: [jsx("p", {
|
|
11306
|
-
children:
|
|
11413
|
+
children: translate('Enter a HTTPS URL to a source or populate it dynamically via a template or an expression (e.g., to pass a value from the variable).')
|
|
11307
11414
|
}), jsx("p", {
|
|
11308
|
-
children:
|
|
11415
|
+
children: translate('Please make sure that the URL is safe as it might impose security risks.')
|
|
11309
11416
|
}), jsxs("p", {
|
|
11310
|
-
children: [
|
|
11417
|
+
children: [translate('Not all external sources can be displayed in the iFrame. Read more about it in the'), ' ', jsx("a", {
|
|
11311
11418
|
target: "_blank",
|
|
11312
11419
|
href: "https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options",
|
|
11313
11420
|
rel: "noreferrer",
|
|
11314
|
-
children:
|
|
11421
|
+
children: translate('X-FRAME-OPTIONS documentation')
|
|
11315
11422
|
}), "."]
|
|
11316
11423
|
})]
|
|
11317
11424
|
});
|
|
@@ -11319,14 +11426,15 @@ function getTooltip$1() {
|
|
|
11319
11426
|
|
|
11320
11427
|
/**
|
|
11321
11428
|
* @param {string|void} value
|
|
11429
|
+
* @param {Translate} translate
|
|
11322
11430
|
* @returns {string|null}
|
|
11323
11431
|
*/
|
|
11324
|
-
const validate$8 = value => {
|
|
11432
|
+
const validate$8 = (value, translate) => {
|
|
11325
11433
|
if (!value || value.startsWith('=')) {
|
|
11326
11434
|
return;
|
|
11327
11435
|
}
|
|
11328
11436
|
if (!HTTPS_PATTERN.test(value)) {
|
|
11329
|
-
return 'For security reasons the URL must start with "https".';
|
|
11437
|
+
return translate('For security reasons the URL must start with "https".');
|
|
11330
11438
|
}
|
|
11331
11439
|
};
|
|
11332
11440
|
|
|
@@ -11353,6 +11461,7 @@ function Source$1(props) {
|
|
|
11353
11461
|
id
|
|
11354
11462
|
} = props;
|
|
11355
11463
|
const debounce = useService('debounce');
|
|
11464
|
+
const translate = useService('translate');
|
|
11356
11465
|
const variables = useVariables().map(name => ({
|
|
11357
11466
|
name
|
|
11358
11467
|
}));
|
|
@@ -11365,13 +11474,13 @@ function Source$1(props) {
|
|
|
11365
11474
|
};
|
|
11366
11475
|
return FeelTemplatingEntry({
|
|
11367
11476
|
debounce,
|
|
11368
|
-
description: 'Expression or static value (link/data URI)',
|
|
11477
|
+
description: translate('Expression or static value (link/data URI)'),
|
|
11369
11478
|
element: field,
|
|
11370
11479
|
feel: 'optional',
|
|
11371
11480
|
getValue,
|
|
11372
11481
|
id,
|
|
11373
|
-
label: 'Image source',
|
|
11374
|
-
tooltip: 'Link referring to a hosted image, or use a data URI directly to embed image data into the form.',
|
|
11482
|
+
label: translate('Image source'),
|
|
11483
|
+
tooltip: translate('Link referring to a hosted image, or use a data URI directly to embed image data into the form.'),
|
|
11375
11484
|
setValue,
|
|
11376
11485
|
singleLine: true,
|
|
11377
11486
|
variables
|
|
@@ -11401,6 +11510,7 @@ function Text(props) {
|
|
|
11401
11510
|
id
|
|
11402
11511
|
} = props;
|
|
11403
11512
|
const debounce = useService('debounce');
|
|
11513
|
+
const translate = useService('translate');
|
|
11404
11514
|
const variables = useVariables().map(name => ({
|
|
11405
11515
|
name
|
|
11406
11516
|
}));
|
|
@@ -11413,24 +11523,31 @@ function Text(props) {
|
|
|
11413
11523
|
};
|
|
11414
11524
|
return FeelTemplatingEntry({
|
|
11415
11525
|
debounce,
|
|
11416
|
-
description: description$2,
|
|
11526
|
+
description: description$2(translate),
|
|
11417
11527
|
element: field,
|
|
11418
11528
|
getValue,
|
|
11419
11529
|
id,
|
|
11420
|
-
label: 'Text',
|
|
11530
|
+
label: translate('Text'),
|
|
11421
11531
|
hostLanguage: 'markdown',
|
|
11422
11532
|
setValue,
|
|
11423
11533
|
variables
|
|
11424
11534
|
});
|
|
11425
11535
|
}
|
|
11426
|
-
|
|
11427
|
-
|
|
11428
|
-
|
|
11429
|
-
|
|
11430
|
-
|
|
11431
|
-
|
|
11432
|
-
|
|
11433
|
-
|
|
11536
|
+
|
|
11537
|
+
/**
|
|
11538
|
+
* @param {Translate} translate
|
|
11539
|
+
* @returns An Element with the description
|
|
11540
|
+
*/
|
|
11541
|
+
const description$2 = translate => {
|
|
11542
|
+
return jsxs(Fragment$1, {
|
|
11543
|
+
children: [translate('Supports markdown and templating.'), ' ', jsx("a", {
|
|
11544
|
+
href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-text/",
|
|
11545
|
+
target: "_blank",
|
|
11546
|
+
rel: "noreferrer",
|
|
11547
|
+
children: translate('Learn more')
|
|
11548
|
+
})]
|
|
11549
|
+
});
|
|
11550
|
+
};
|
|
11434
11551
|
|
|
11435
11552
|
function HtmlEntry(props) {
|
|
11436
11553
|
const {
|
|
@@ -11454,6 +11571,7 @@ function Content(props) {
|
|
|
11454
11571
|
id
|
|
11455
11572
|
} = props;
|
|
11456
11573
|
const debounce = useService('debounce');
|
|
11574
|
+
const translate = useService('translate');
|
|
11457
11575
|
const variables = useVariables().map(name => ({
|
|
11458
11576
|
name
|
|
11459
11577
|
}));
|
|
@@ -11466,11 +11584,11 @@ function Content(props) {
|
|
|
11466
11584
|
};
|
|
11467
11585
|
return FeelTemplatingEntry({
|
|
11468
11586
|
debounce,
|
|
11469
|
-
description: description$1,
|
|
11587
|
+
description: description$1(translate),
|
|
11470
11588
|
element: field,
|
|
11471
11589
|
getValue,
|
|
11472
11590
|
id,
|
|
11473
|
-
label: 'Content',
|
|
11591
|
+
label: translate('Content'),
|
|
11474
11592
|
hostLanguage: 'html',
|
|
11475
11593
|
validate: validate$7,
|
|
11476
11594
|
setValue,
|
|
@@ -11480,14 +11598,16 @@ function Content(props) {
|
|
|
11480
11598
|
|
|
11481
11599
|
// helpers //////////
|
|
11482
11600
|
|
|
11483
|
-
const description$1 =
|
|
11484
|
-
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
|
|
11488
|
-
|
|
11489
|
-
|
|
11490
|
-
})
|
|
11601
|
+
const description$1 = translate => {
|
|
11602
|
+
return jsxs(Fragment$1, {
|
|
11603
|
+
children: [translate('Supports HTML, styling, and templating. Styles are automatically scoped to the HTML component.'), ' ', jsx("a", {
|
|
11604
|
+
href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-html/",
|
|
11605
|
+
target: "_blank",
|
|
11606
|
+
rel: "noreferrer",
|
|
11607
|
+
children: translate('Learn more')
|
|
11608
|
+
})]
|
|
11609
|
+
});
|
|
11610
|
+
};
|
|
11491
11611
|
|
|
11492
11612
|
/**
|
|
11493
11613
|
* @param {string|void} value
|
|
@@ -11505,6 +11625,10 @@ const validate$7 = value => {
|
|
|
11505
11625
|
}
|
|
11506
11626
|
};
|
|
11507
11627
|
|
|
11628
|
+
/**
|
|
11629
|
+
* @typedef { import('diagram-js/lib/i18n/translate/translate').default } Translate
|
|
11630
|
+
*/
|
|
11631
|
+
|
|
11508
11632
|
function NumberEntries(props) {
|
|
11509
11633
|
const {
|
|
11510
11634
|
editField,
|
|
@@ -11537,6 +11661,7 @@ function NumberDecimalDigits(props) {
|
|
|
11537
11661
|
id
|
|
11538
11662
|
} = props;
|
|
11539
11663
|
const debounce = useService('debounce');
|
|
11664
|
+
const translate = useService('translate');
|
|
11540
11665
|
const getValue = e => get(field, ['decimalDigits']);
|
|
11541
11666
|
const setValue = (value, error) => {
|
|
11542
11667
|
if (error) {
|
|
@@ -11546,13 +11671,13 @@ function NumberDecimalDigits(props) {
|
|
|
11546
11671
|
};
|
|
11547
11672
|
return NumberFieldEntry({
|
|
11548
11673
|
debounce,
|
|
11549
|
-
label: 'Decimal digits',
|
|
11674
|
+
label: translate('Decimal digits'),
|
|
11550
11675
|
element: field,
|
|
11551
11676
|
step: 'any',
|
|
11552
11677
|
getValue,
|
|
11553
11678
|
id,
|
|
11554
11679
|
setValue,
|
|
11555
|
-
validate: validateNumberEntries
|
|
11680
|
+
validate: useCallback(value => validateNumberEntries(value, translate), [translate])
|
|
11556
11681
|
});
|
|
11557
11682
|
}
|
|
11558
11683
|
function NumberArrowStep(props) {
|
|
@@ -11565,6 +11690,7 @@ function NumberArrowStep(props) {
|
|
|
11565
11690
|
decimalDigits
|
|
11566
11691
|
} = field;
|
|
11567
11692
|
const debounce = useService('debounce');
|
|
11693
|
+
const translate = useService('translate');
|
|
11568
11694
|
const getValue = e => {
|
|
11569
11695
|
let value = get(field, ['increment']);
|
|
11570
11696
|
if (!isValidNumber(value)) return null;
|
|
@@ -11587,24 +11713,28 @@ function NumberArrowStep(props) {
|
|
|
11587
11713
|
return;
|
|
11588
11714
|
}
|
|
11589
11715
|
if (!isValidNumber(value)) {
|
|
11590
|
-
return 'Should be a valid number.';
|
|
11716
|
+
return translate('Should be a valid number.');
|
|
11591
11717
|
}
|
|
11592
11718
|
if (Big(value).cmp(0) <= 0) {
|
|
11593
|
-
return 'Should be greater than zero.';
|
|
11719
|
+
return translate('Should be greater than zero.');
|
|
11594
11720
|
}
|
|
11595
11721
|
if (decimalDigitsSet) {
|
|
11596
11722
|
const minimumValue = Big(`1e-${decimalDigits}`);
|
|
11597
11723
|
if (Big(value).cmp(minimumValue) < 0) {
|
|
11598
|
-
return
|
|
11724
|
+
return translate('Should be at least {value}.', {
|
|
11725
|
+
value: minimumValue.toString()
|
|
11726
|
+
});
|
|
11599
11727
|
}
|
|
11600
11728
|
if (countDecimals(value) > decimalDigits) {
|
|
11601
|
-
return
|
|
11729
|
+
return translate('Should not contain more than {value} decimal digits.', {
|
|
11730
|
+
value: decimalDigits.toString()
|
|
11731
|
+
});
|
|
11602
11732
|
}
|
|
11603
11733
|
}
|
|
11604
|
-
}, [decimalDigitsSet, decimalDigits]);
|
|
11734
|
+
}, [decimalDigitsSet, decimalDigits, translate]);
|
|
11605
11735
|
return TextfieldEntry({
|
|
11606
11736
|
debounce,
|
|
11607
|
-
label: 'Increment',
|
|
11737
|
+
label: translate('Increment'),
|
|
11608
11738
|
element: field,
|
|
11609
11739
|
getValue,
|
|
11610
11740
|
id,
|
|
@@ -11617,17 +11747,18 @@ function NumberArrowStep(props) {
|
|
|
11617
11747
|
|
|
11618
11748
|
/**
|
|
11619
11749
|
* @param {number|void} value
|
|
11750
|
+
* @param {Translate} translate
|
|
11620
11751
|
* @returns {string|void}
|
|
11621
11752
|
*/
|
|
11622
|
-
const validateNumberEntries = value => {
|
|
11753
|
+
const validateNumberEntries = (value, translate) => {
|
|
11623
11754
|
if (typeof value !== 'number') {
|
|
11624
11755
|
return;
|
|
11625
11756
|
}
|
|
11626
11757
|
if (!Number.isInteger(value)) {
|
|
11627
|
-
return 'Should be an integer.';
|
|
11758
|
+
return translate('Should be an integer.');
|
|
11628
11759
|
}
|
|
11629
11760
|
if (value < 0) {
|
|
11630
|
-
return 'Should be greater than or equal to zero.';
|
|
11761
|
+
return translate('Should be greater than or equal to zero.');
|
|
11631
11762
|
}
|
|
11632
11763
|
};
|
|
11633
11764
|
|
|
@@ -11663,6 +11794,7 @@ function ExpressionFieldExpression(props) {
|
|
|
11663
11794
|
id
|
|
11664
11795
|
} = props;
|
|
11665
11796
|
const debounce = useService('debounce');
|
|
11797
|
+
const translate = useService('translate');
|
|
11666
11798
|
const variables = useVariables().map(name => ({
|
|
11667
11799
|
name
|
|
11668
11800
|
}));
|
|
@@ -11672,12 +11804,12 @@ function ExpressionFieldExpression(props) {
|
|
|
11672
11804
|
};
|
|
11673
11805
|
return FeelEntry({
|
|
11674
11806
|
debounce,
|
|
11675
|
-
description: 'Define an expression to calculate the value of this field',
|
|
11807
|
+
description: translate('Define an expression to calculate the value of this field'),
|
|
11676
11808
|
element: field,
|
|
11677
11809
|
feel: 'required',
|
|
11678
11810
|
getValue,
|
|
11679
11811
|
id,
|
|
11680
|
-
label: 'Target value',
|
|
11812
|
+
label: translate('Target value'),
|
|
11681
11813
|
setValue,
|
|
11682
11814
|
variables
|
|
11683
11815
|
});
|
|
@@ -11688,20 +11820,21 @@ function ExpressionFieldComputeOn(props) {
|
|
|
11688
11820
|
field,
|
|
11689
11821
|
id
|
|
11690
11822
|
} = props;
|
|
11823
|
+
const translate = useService('translate');
|
|
11691
11824
|
const getValue = () => field.computeOn || '';
|
|
11692
11825
|
const setValue = value => {
|
|
11693
11826
|
editField(field, ['computeOn'], value);
|
|
11694
11827
|
};
|
|
11695
11828
|
const getOptions = () => [{
|
|
11696
11829
|
value: 'change',
|
|
11697
|
-
label: 'Value changes'
|
|
11830
|
+
label: translate('Value changes')
|
|
11698
11831
|
}, {
|
|
11699
11832
|
value: 'presubmit',
|
|
11700
|
-
label: 'Form submission'
|
|
11833
|
+
label: translate('Form submission')
|
|
11701
11834
|
}];
|
|
11702
11835
|
return SelectEntry({
|
|
11703
11836
|
id,
|
|
11704
|
-
label: 'Compute on',
|
|
11837
|
+
label: translate('Compute on'),
|
|
11705
11838
|
getValue,
|
|
11706
11839
|
setValue,
|
|
11707
11840
|
getOptions
|
|
@@ -11733,6 +11866,7 @@ function SerializeToString(props) {
|
|
|
11733
11866
|
const {
|
|
11734
11867
|
defaultValue
|
|
11735
11868
|
} = field;
|
|
11869
|
+
const translate = useService('translate');
|
|
11736
11870
|
const path = ['serializeToString'];
|
|
11737
11871
|
const getValue = () => {
|
|
11738
11872
|
return get(field, path, '');
|
|
@@ -11748,8 +11882,8 @@ function SerializeToString(props) {
|
|
|
11748
11882
|
element: field,
|
|
11749
11883
|
getValue,
|
|
11750
11884
|
id,
|
|
11751
|
-
label: 'Output as string',
|
|
11752
|
-
description: 'Allows arbitrary precision values',
|
|
11885
|
+
label: translate('Output as string'),
|
|
11886
|
+
description: translate('Allows arbitrary precision values'),
|
|
11753
11887
|
setValue
|
|
11754
11888
|
});
|
|
11755
11889
|
}
|
|
@@ -11757,15 +11891,18 @@ function SerializeToString(props) {
|
|
|
11757
11891
|
function DateTimeEntry(props) {
|
|
11758
11892
|
const {
|
|
11759
11893
|
editField,
|
|
11760
|
-
field
|
|
11894
|
+
field,
|
|
11895
|
+
getService
|
|
11761
11896
|
} = props;
|
|
11897
|
+
const translate = getService('translate');
|
|
11762
11898
|
const entries = [{
|
|
11763
11899
|
id: 'subtype',
|
|
11764
11900
|
component: DateTimeSubtypeSelect,
|
|
11765
11901
|
isEdited: isEdited$3,
|
|
11766
11902
|
editField,
|
|
11767
11903
|
field,
|
|
11768
|
-
isDefaultVisible: field => field.type === 'datetime'
|
|
11904
|
+
isDefaultVisible: field => field.type === 'datetime',
|
|
11905
|
+
translate
|
|
11769
11906
|
}];
|
|
11770
11907
|
entries.push({
|
|
11771
11908
|
id: 'use24h',
|
|
@@ -11773,7 +11910,8 @@ function DateTimeEntry(props) {
|
|
|
11773
11910
|
isEdited: isEdited$9,
|
|
11774
11911
|
editField,
|
|
11775
11912
|
field,
|
|
11776
|
-
isDefaultVisible: field => field.type === 'datetime' && (field.subtype === DATETIME_SUBTYPES.TIME || field.subtype === DATETIME_SUBTYPES.DATETIME)
|
|
11913
|
+
isDefaultVisible: field => field.type === 'datetime' && (field.subtype === DATETIME_SUBTYPES.TIME || field.subtype === DATETIME_SUBTYPES.DATETIME),
|
|
11914
|
+
translate
|
|
11777
11915
|
});
|
|
11778
11916
|
return entries;
|
|
11779
11917
|
}
|
|
@@ -11781,7 +11919,8 @@ function DateTimeSubtypeSelect(props) {
|
|
|
11781
11919
|
const {
|
|
11782
11920
|
editField,
|
|
11783
11921
|
field,
|
|
11784
|
-
id
|
|
11922
|
+
id,
|
|
11923
|
+
translate
|
|
11785
11924
|
} = props;
|
|
11786
11925
|
const getValue = e => get(field, DATETIME_SUBTYPE_PATH);
|
|
11787
11926
|
const clearTimeConfig = () => {
|
|
@@ -11821,12 +11960,12 @@ function DateTimeSubtypeSelect(props) {
|
|
|
11821
11960
|
};
|
|
11822
11961
|
const getDatetimeSubtypes = () => {
|
|
11823
11962
|
return Object.values(DATETIME_SUBTYPES).map(subtype => ({
|
|
11824
|
-
label: DATETIME_SUBTYPES_LABELS[subtype],
|
|
11963
|
+
label: translate(DATETIME_SUBTYPES_LABELS[subtype]),
|
|
11825
11964
|
value: subtype
|
|
11826
11965
|
}));
|
|
11827
11966
|
};
|
|
11828
11967
|
return SelectEntry({
|
|
11829
|
-
label: 'Subtype',
|
|
11968
|
+
label: translate('Subtype'),
|
|
11830
11969
|
element: field,
|
|
11831
11970
|
getOptions: getDatetimeSubtypes,
|
|
11832
11971
|
getValue,
|
|
@@ -11838,7 +11977,8 @@ function Use24h(props) {
|
|
|
11838
11977
|
const {
|
|
11839
11978
|
editField,
|
|
11840
11979
|
field,
|
|
11841
|
-
id
|
|
11980
|
+
id,
|
|
11981
|
+
translate
|
|
11842
11982
|
} = props;
|
|
11843
11983
|
const path = TIME_USE24H_PATH;
|
|
11844
11984
|
const getValue = () => {
|
|
@@ -11851,7 +11991,7 @@ function Use24h(props) {
|
|
|
11851
11991
|
element: field,
|
|
11852
11992
|
getValue,
|
|
11853
11993
|
id,
|
|
11854
|
-
label: 'Use 24h',
|
|
11994
|
+
label: translate('Use 24h'),
|
|
11855
11995
|
setValue
|
|
11856
11996
|
});
|
|
11857
11997
|
}
|
|
@@ -11897,6 +12037,7 @@ function DisallowPassedDates(props) {
|
|
|
11897
12037
|
id
|
|
11898
12038
|
} = props;
|
|
11899
12039
|
const path = DATE_DISALLOW_PAST_PATH;
|
|
12040
|
+
const translate = useService('translate');
|
|
11900
12041
|
const getValue = () => {
|
|
11901
12042
|
return get(field, path, '');
|
|
11902
12043
|
};
|
|
@@ -11907,7 +12048,7 @@ function DisallowPassedDates(props) {
|
|
|
11907
12048
|
element: field,
|
|
11908
12049
|
getValue,
|
|
11909
12050
|
id,
|
|
11910
|
-
label: 'Disallow past dates',
|
|
12051
|
+
label: translate('Disallow past dates'),
|
|
11911
12052
|
setValue
|
|
11912
12053
|
});
|
|
11913
12054
|
}
|
|
@@ -11918,6 +12059,7 @@ function TimeIntervalSelect(props) {
|
|
|
11918
12059
|
id
|
|
11919
12060
|
} = props;
|
|
11920
12061
|
const timeIntervals = [1, 5, 10, 15, 30, 60];
|
|
12062
|
+
const translate = useService('translate');
|
|
11921
12063
|
const getValue = e => get(field, TIME_INTERVAL_PATH);
|
|
11922
12064
|
const setValue = value => editField(field, TIME_INTERVAL_PATH, parseInt(value));
|
|
11923
12065
|
const getTimeIntervals = () => {
|
|
@@ -11927,7 +12069,7 @@ function TimeIntervalSelect(props) {
|
|
|
11927
12069
|
}));
|
|
11928
12070
|
};
|
|
11929
12071
|
return SelectEntry({
|
|
11930
|
-
label: 'Time interval',
|
|
12072
|
+
label: translate('Time interval'),
|
|
11931
12073
|
element: field,
|
|
11932
12074
|
getOptions: getTimeIntervals,
|
|
11933
12075
|
getValue,
|
|
@@ -11959,16 +12101,17 @@ function TimeFormatSelect(props) {
|
|
|
11959
12101
|
field,
|
|
11960
12102
|
id
|
|
11961
12103
|
} = props;
|
|
12104
|
+
const translate = useService('translate');
|
|
11962
12105
|
const getValue = e => get(field, TIME_SERIALISING_FORMAT_PATH);
|
|
11963
12106
|
const setValue = value => editField(field, TIME_SERIALISING_FORMAT_PATH, value);
|
|
11964
12107
|
const getTimeSerialisingFormats = () => {
|
|
11965
12108
|
return Object.values(TIME_SERIALISING_FORMATS).map(format => ({
|
|
11966
|
-
label: TIME_SERIALISINGFORMAT_LABELS[format],
|
|
12109
|
+
label: translate(TIME_SERIALISINGFORMAT_LABELS[format]),
|
|
11967
12110
|
value: format
|
|
11968
12111
|
}));
|
|
11969
12112
|
};
|
|
11970
12113
|
return SelectEntry({
|
|
11971
|
-
label: 'Time format',
|
|
12114
|
+
label: translate('Time format'),
|
|
11972
12115
|
element: field,
|
|
11973
12116
|
getOptions: getTimeSerialisingFormats,
|
|
11974
12117
|
getValue,
|
|
@@ -11978,10 +12121,11 @@ function TimeFormatSelect(props) {
|
|
|
11978
12121
|
}
|
|
11979
12122
|
|
|
11980
12123
|
function SelectEntries(props) {
|
|
12124
|
+
const translate = props.getService('translate');
|
|
11981
12125
|
const entries = [simpleBoolEntryFactory({
|
|
11982
12126
|
id: 'searchable',
|
|
11983
12127
|
path: ['searchable'],
|
|
11984
|
-
label: 'Searchable',
|
|
12128
|
+
label: translate('Searchable'),
|
|
11985
12129
|
props,
|
|
11986
12130
|
isDefaultVisible: field => field.type === 'select'
|
|
11987
12131
|
})];
|
|
@@ -12024,6 +12168,7 @@ function Label$1(props) {
|
|
|
12024
12168
|
validateFactory
|
|
12025
12169
|
} = props;
|
|
12026
12170
|
const debounce = useService('debounce');
|
|
12171
|
+
const translate = useService('translate');
|
|
12027
12172
|
const setValue = (value, error) => {
|
|
12028
12173
|
if (error) {
|
|
12029
12174
|
return;
|
|
@@ -12040,7 +12185,7 @@ function Label$1(props) {
|
|
|
12040
12185
|
element: field,
|
|
12041
12186
|
getValue,
|
|
12042
12187
|
id,
|
|
12043
|
-
label: 'Label',
|
|
12188
|
+
label: translate('Label'),
|
|
12044
12189
|
setValue,
|
|
12045
12190
|
validate
|
|
12046
12191
|
});
|
|
@@ -12054,6 +12199,7 @@ function Value$1(props) {
|
|
|
12054
12199
|
validateFactory
|
|
12055
12200
|
} = props;
|
|
12056
12201
|
const debounce = useService('debounce');
|
|
12202
|
+
const translate = useService('translate');
|
|
12057
12203
|
const setValue = (value, error) => {
|
|
12058
12204
|
if (error) {
|
|
12059
12205
|
return;
|
|
@@ -12077,7 +12223,7 @@ function Value$1(props) {
|
|
|
12077
12223
|
element: field,
|
|
12078
12224
|
getValue,
|
|
12079
12225
|
id,
|
|
12080
|
-
label: 'Value',
|
|
12226
|
+
label: translate('Value'),
|
|
12081
12227
|
setValue,
|
|
12082
12228
|
validate
|
|
12083
12229
|
});
|
|
@@ -12119,6 +12265,7 @@ function Key$1(props) {
|
|
|
12119
12265
|
validateFactory
|
|
12120
12266
|
} = props;
|
|
12121
12267
|
const debounce = useService('debounce');
|
|
12268
|
+
const translate = useService('translate');
|
|
12122
12269
|
const setValue = (value, error) => {
|
|
12123
12270
|
if (error) {
|
|
12124
12271
|
return;
|
|
@@ -12136,7 +12283,7 @@ function Key$1(props) {
|
|
|
12136
12283
|
element: field,
|
|
12137
12284
|
getValue,
|
|
12138
12285
|
id,
|
|
12139
|
-
label: 'Key',
|
|
12286
|
+
label: translate('Key'),
|
|
12140
12287
|
setValue,
|
|
12141
12288
|
validate
|
|
12142
12289
|
});
|
|
@@ -12150,6 +12297,7 @@ function Value(props) {
|
|
|
12150
12297
|
validateFactory
|
|
12151
12298
|
} = props;
|
|
12152
12299
|
const debounce = useService('debounce');
|
|
12300
|
+
const translate = useService('translate');
|
|
12153
12301
|
const setValue = value => {
|
|
12154
12302
|
const properties = get(field, ['properties']);
|
|
12155
12303
|
const key = Object.keys(properties)[index];
|
|
@@ -12165,7 +12313,7 @@ function Value(props) {
|
|
|
12165
12313
|
element: field,
|
|
12166
12314
|
getValue,
|
|
12167
12315
|
id,
|
|
12168
|
-
label: 'Value',
|
|
12316
|
+
label: translate('Value'),
|
|
12169
12317
|
setValue,
|
|
12170
12318
|
validate: validateFactory(getValue())
|
|
12171
12319
|
});
|
|
@@ -12241,21 +12389,24 @@ function OptionsSourceSelectEntry(props) {
|
|
|
12241
12389
|
const {
|
|
12242
12390
|
editField,
|
|
12243
12391
|
field,
|
|
12244
|
-
id
|
|
12392
|
+
id,
|
|
12393
|
+
translate
|
|
12245
12394
|
} = props;
|
|
12246
12395
|
return [{
|
|
12247
12396
|
id: id + '-select',
|
|
12248
12397
|
component: ValuesSourceSelect,
|
|
12249
12398
|
isEdited: isOptionsSourceEdited,
|
|
12250
12399
|
editField,
|
|
12251
|
-
field
|
|
12400
|
+
field,
|
|
12401
|
+
translate
|
|
12252
12402
|
}];
|
|
12253
12403
|
}
|
|
12254
12404
|
function ValuesSourceSelect(props) {
|
|
12255
12405
|
const {
|
|
12256
12406
|
editField,
|
|
12257
12407
|
field,
|
|
12258
|
-
id
|
|
12408
|
+
id,
|
|
12409
|
+
translate
|
|
12259
12410
|
} = props;
|
|
12260
12411
|
const getValue = getOptionsSource;
|
|
12261
12412
|
const setValue = value => {
|
|
@@ -12267,13 +12418,13 @@ function ValuesSourceSelect(props) {
|
|
|
12267
12418
|
};
|
|
12268
12419
|
const getOptionsSourceOptions = () => {
|
|
12269
12420
|
return Object.values(OPTIONS_SOURCES).map(valueSource => ({
|
|
12270
|
-
label: OPTIONS_SOURCES_LABELS[valueSource],
|
|
12421
|
+
label: translate(OPTIONS_SOURCES_LABELS[valueSource]),
|
|
12271
12422
|
value: valueSource
|
|
12272
12423
|
}));
|
|
12273
12424
|
};
|
|
12274
12425
|
return AutoFocusSelectEntry({
|
|
12275
12426
|
autoFocusEntry: getAutoFocusEntryId$1(field),
|
|
12276
|
-
label: 'Type',
|
|
12427
|
+
label: translate('Type'),
|
|
12277
12428
|
element: field,
|
|
12278
12429
|
getOptions: getOptionsSourceOptions,
|
|
12279
12430
|
getValue,
|
|
@@ -12317,10 +12468,11 @@ function InputValuesKey(props) {
|
|
|
12317
12468
|
id
|
|
12318
12469
|
} = props;
|
|
12319
12470
|
const debounce = useService('debounce');
|
|
12471
|
+
const translate = useService('translate');
|
|
12320
12472
|
const path = OPTIONS_SOURCES_PATHS[OPTIONS_SOURCES.INPUT];
|
|
12321
12473
|
const schema = '[\n {\n "label": "dollar",\n "value": "$"\n }\n]';
|
|
12322
12474
|
const tooltip = jsxs("div", {
|
|
12323
|
-
children: [
|
|
12475
|
+
children: [translate('The input property may be an array of simple values or alternatively follow this schema:'), jsx("pre", {
|
|
12324
12476
|
children: jsx("code", {
|
|
12325
12477
|
children: schema
|
|
12326
12478
|
})
|
|
@@ -12335,14 +12487,14 @@ function InputValuesKey(props) {
|
|
|
12335
12487
|
};
|
|
12336
12488
|
return TextfieldEntry({
|
|
12337
12489
|
debounce,
|
|
12338
|
-
description: 'Define which input property to populate the values from',
|
|
12490
|
+
description: translate('Define which input property to populate the values from'),
|
|
12339
12491
|
tooltip,
|
|
12340
12492
|
element: field,
|
|
12341
12493
|
getValue,
|
|
12342
12494
|
id,
|
|
12343
|
-
label: 'Input values key',
|
|
12495
|
+
label: translate('Input values key'),
|
|
12344
12496
|
setValue,
|
|
12345
|
-
validate: validate$6
|
|
12497
|
+
validate: useCallback(value => validate$6(value, translate), [translate])
|
|
12346
12498
|
});
|
|
12347
12499
|
}
|
|
12348
12500
|
|
|
@@ -12350,14 +12502,15 @@ function InputValuesKey(props) {
|
|
|
12350
12502
|
|
|
12351
12503
|
/**
|
|
12352
12504
|
* @param {string|void} value
|
|
12505
|
+
* @param {Translate} translate
|
|
12353
12506
|
* @returns {string|null}
|
|
12354
12507
|
*/
|
|
12355
|
-
const validate$6 = value => {
|
|
12508
|
+
const validate$6 = (value, translate) => {
|
|
12356
12509
|
if (typeof value !== 'string' || value.length === 0) {
|
|
12357
|
-
return 'Must not be empty.';
|
|
12510
|
+
return translate('Must not be empty.');
|
|
12358
12511
|
}
|
|
12359
12512
|
if (/\s/.test(value)) {
|
|
12360
|
-
return 'Must not contain spaces.';
|
|
12513
|
+
return translate('Must not contain spaces.');
|
|
12361
12514
|
}
|
|
12362
12515
|
return null;
|
|
12363
12516
|
};
|
|
@@ -12366,7 +12519,8 @@ function StaticOptionsSourceEntry(props) {
|
|
|
12366
12519
|
const {
|
|
12367
12520
|
editField,
|
|
12368
12521
|
field,
|
|
12369
|
-
id: idPrefix
|
|
12522
|
+
id: idPrefix,
|
|
12523
|
+
translate
|
|
12370
12524
|
} = props;
|
|
12371
12525
|
const {
|
|
12372
12526
|
values
|
|
@@ -12374,7 +12528,7 @@ function StaticOptionsSourceEntry(props) {
|
|
|
12374
12528
|
const addEntry = e => {
|
|
12375
12529
|
e.stopPropagation();
|
|
12376
12530
|
const index = values.length + 1;
|
|
12377
|
-
const entry = getIndexedEntry(index, values);
|
|
12531
|
+
const entry = getIndexedEntry(index, values, translate);
|
|
12378
12532
|
editField(field, OPTIONS_SOURCES_PATHS[OPTIONS_SOURCES.STATIC], arrayAdd(values, values.length, entry));
|
|
12379
12533
|
};
|
|
12380
12534
|
const removeEntry = entry => {
|
|
@@ -12393,11 +12547,11 @@ function StaticOptionsSourceEntry(props) {
|
|
|
12393
12547
|
return;
|
|
12394
12548
|
}
|
|
12395
12549
|
if (typeof value !== 'string' || value.length === 0) {
|
|
12396
|
-
return 'Must not be empty.';
|
|
12550
|
+
return translate('Must not be empty.');
|
|
12397
12551
|
}
|
|
12398
12552
|
const isValueAssigned = values.find(entry => getValue(entry) === value);
|
|
12399
12553
|
if (isValueAssigned) {
|
|
12400
|
-
return 'Must be unique.';
|
|
12554
|
+
return translate('Must be unique.');
|
|
12401
12555
|
}
|
|
12402
12556
|
};
|
|
12403
12557
|
};
|
|
@@ -12425,9 +12579,9 @@ function StaticOptionsSourceEntry(props) {
|
|
|
12425
12579
|
|
|
12426
12580
|
// helper
|
|
12427
12581
|
|
|
12428
|
-
function getIndexedEntry(index, values) {
|
|
12582
|
+
function getIndexedEntry(index, values, translate) {
|
|
12429
12583
|
const entry = {
|
|
12430
|
-
label: 'Value',
|
|
12584
|
+
label: translate('Value'),
|
|
12431
12585
|
value: 'value'
|
|
12432
12586
|
};
|
|
12433
12587
|
while (labelOrValueIsAlreadyAssignedForIndex(index, values)) {
|
|
@@ -12490,6 +12644,7 @@ function PrefixAdorner(props) {
|
|
|
12490
12644
|
getValue
|
|
12491
12645
|
} = props;
|
|
12492
12646
|
const debounce = useService('debounce');
|
|
12647
|
+
const translate = useService('translate');
|
|
12493
12648
|
const variables = useVariables().map(name => ({
|
|
12494
12649
|
name
|
|
12495
12650
|
}));
|
|
@@ -12499,7 +12654,7 @@ function PrefixAdorner(props) {
|
|
|
12499
12654
|
feel: 'optional',
|
|
12500
12655
|
getValue: getValue('prefixAdorner'),
|
|
12501
12656
|
id,
|
|
12502
|
-
label: 'Prefix',
|
|
12657
|
+
label: translate('Prefix'),
|
|
12503
12658
|
setValue: onChange('prefixAdorner'),
|
|
12504
12659
|
singleLine: true,
|
|
12505
12660
|
variables
|
|
@@ -12513,6 +12668,7 @@ function SuffixAdorner(props) {
|
|
|
12513
12668
|
getValue
|
|
12514
12669
|
} = props;
|
|
12515
12670
|
const debounce = useService('debounce');
|
|
12671
|
+
const translate = useService('translate');
|
|
12516
12672
|
const variables = useVariables().map(name => ({
|
|
12517
12673
|
name
|
|
12518
12674
|
}));
|
|
@@ -12521,7 +12677,7 @@ function SuffixAdorner(props) {
|
|
|
12521
12677
|
element: field,
|
|
12522
12678
|
getValue: getValue('suffixAdorner'),
|
|
12523
12679
|
id,
|
|
12524
|
-
label: 'Suffix',
|
|
12680
|
+
label: translate('Suffix'),
|
|
12525
12681
|
setValue: onChange('suffixAdorner'),
|
|
12526
12682
|
singleLine: true,
|
|
12527
12683
|
variables
|
|
@@ -12556,6 +12712,7 @@ function Readonly(props) {
|
|
|
12556
12712
|
id
|
|
12557
12713
|
} = props;
|
|
12558
12714
|
const debounce = useService('debounce');
|
|
12715
|
+
const translate = useService('translate');
|
|
12559
12716
|
const variables = useVariables().map(name => ({
|
|
12560
12717
|
name
|
|
12561
12718
|
}));
|
|
@@ -12572,8 +12729,8 @@ function Readonly(props) {
|
|
|
12572
12729
|
feel: 'optional',
|
|
12573
12730
|
getValue,
|
|
12574
12731
|
id,
|
|
12575
|
-
label: 'Read only',
|
|
12576
|
-
tooltip: 'Make this field read-only when it cannot be edited by the end-user, but its content is important for them to see. Its data will still be submitted.',
|
|
12732
|
+
label: translate('Read only'),
|
|
12733
|
+
tooltip: translate('Make this field read-only when it cannot be edited by the end-user, but its content is important for them to see. Its data will still be submitted.'),
|
|
12577
12734
|
setValue,
|
|
12578
12735
|
variables
|
|
12579
12736
|
});
|
|
@@ -12583,22 +12740,23 @@ function LayouterAppearanceEntry(props) {
|
|
|
12583
12740
|
const {
|
|
12584
12741
|
field
|
|
12585
12742
|
} = props;
|
|
12743
|
+
const translate = props.translate;
|
|
12586
12744
|
if (!['group', 'dynamiclist'].includes(field.type)) {
|
|
12587
12745
|
return [];
|
|
12588
12746
|
}
|
|
12589
12747
|
const entries = [simpleSelectEntryFactory({
|
|
12590
12748
|
id: 'verticalAlignment',
|
|
12591
12749
|
path: ['verticalAlignment'],
|
|
12592
|
-
label: 'Vertical alignment',
|
|
12750
|
+
label: translate('Vertical alignment'),
|
|
12593
12751
|
optionsArray: [{
|
|
12594
12752
|
value: 'start',
|
|
12595
|
-
label: 'Top'
|
|
12753
|
+
label: translate('Top')
|
|
12596
12754
|
}, {
|
|
12597
12755
|
value: 'center',
|
|
12598
|
-
label: 'Center'
|
|
12756
|
+
label: translate('Center')
|
|
12599
12757
|
}, {
|
|
12600
12758
|
value: 'end',
|
|
12601
|
-
label: 'Bottom'
|
|
12759
|
+
label: translate('Bottom')
|
|
12602
12760
|
}],
|
|
12603
12761
|
props
|
|
12604
12762
|
})];
|
|
@@ -12614,32 +12772,33 @@ function RepeatableEntry(props) {
|
|
|
12614
12772
|
type
|
|
12615
12773
|
} = field;
|
|
12616
12774
|
const formFieldDefinition = getService('formFields').get(type);
|
|
12775
|
+
const translate = getService('translate');
|
|
12617
12776
|
if (!formFieldDefinition || !formFieldDefinition.config.repeatable) {
|
|
12618
12777
|
return [];
|
|
12619
12778
|
}
|
|
12620
12779
|
const entries = [simpleRangeIntegerEntryFactory({
|
|
12621
12780
|
id: 'defaultRepetitions',
|
|
12622
12781
|
path: ['defaultRepetitions'],
|
|
12623
|
-
label: 'Default number of items',
|
|
12782
|
+
label: translate('Default number of items'),
|
|
12624
12783
|
min: 1,
|
|
12625
12784
|
max: 100,
|
|
12626
12785
|
props
|
|
12627
12786
|
}), simpleBoolEntryFactory({
|
|
12628
12787
|
id: 'allowAddRemove',
|
|
12629
12788
|
path: ['allowAddRemove'],
|
|
12630
|
-
label: 'Allow add/delete items',
|
|
12789
|
+
label: translate('Allow add/delete items'),
|
|
12631
12790
|
props
|
|
12632
12791
|
}), simpleBoolEntryFactory({
|
|
12633
12792
|
id: 'disableCollapse',
|
|
12634
12793
|
path: ['disableCollapse'],
|
|
12635
|
-
label: 'Disable collapse',
|
|
12794
|
+
label: translate('Disable collapse'),
|
|
12636
12795
|
props
|
|
12637
12796
|
})];
|
|
12638
12797
|
if (!field.disableCollapse) {
|
|
12639
12798
|
const nonCollapseItemsEntry = simpleRangeIntegerEntryFactory({
|
|
12640
12799
|
id: 'nonCollapsedItems',
|
|
12641
12800
|
path: ['nonCollapsedItems'],
|
|
12642
|
-
label: 'Number of non-collapsing items',
|
|
12801
|
+
label: translate('Number of non-collapsing items'),
|
|
12643
12802
|
min: 1,
|
|
12644
12803
|
props
|
|
12645
12804
|
});
|
|
@@ -12668,6 +12827,7 @@ function Condition(props) {
|
|
|
12668
12827
|
id
|
|
12669
12828
|
} = props;
|
|
12670
12829
|
const debounce = useService('debounce');
|
|
12830
|
+
const translate = useService('translate');
|
|
12671
12831
|
const variables = useVariables().map(name => ({
|
|
12672
12832
|
name
|
|
12673
12833
|
}));
|
|
@@ -12683,13 +12843,13 @@ function Condition(props) {
|
|
|
12683
12843
|
hide: value
|
|
12684
12844
|
});
|
|
12685
12845
|
};
|
|
12686
|
-
let label = 'Hide if';
|
|
12687
|
-
let description = 'Condition under which the field is hidden';
|
|
12846
|
+
let label = translate('Hide if');
|
|
12847
|
+
let description = translate('Condition under which the field is hidden');
|
|
12688
12848
|
|
|
12689
12849
|
// special case for expression fields which do not render
|
|
12690
12850
|
if (field.type === 'expression') {
|
|
12691
|
-
label = 'Deactivate if';
|
|
12692
|
-
description = 'Condition under which the field is deactivated';
|
|
12851
|
+
label = translate('Deactivate if');
|
|
12852
|
+
description = translate('Condition under which the field is deactivated');
|
|
12693
12853
|
}
|
|
12694
12854
|
return FeelEntry({
|
|
12695
12855
|
debounce,
|
|
@@ -12725,13 +12885,14 @@ function OptionsExpression(props) {
|
|
|
12725
12885
|
id
|
|
12726
12886
|
} = props;
|
|
12727
12887
|
const debounce = useService('debounce');
|
|
12888
|
+
const translate = useService('translate');
|
|
12728
12889
|
const variables = useVariables().map(name => ({
|
|
12729
12890
|
name
|
|
12730
12891
|
}));
|
|
12731
12892
|
const path = OPTIONS_SOURCES_PATHS[OPTIONS_SOURCES.EXPRESSION];
|
|
12732
12893
|
const schema = '[\n {\n "label": "dollar",\n "value": "$"\n }\n]';
|
|
12733
12894
|
const tooltip = jsxs("div", {
|
|
12734
|
-
children: [
|
|
12895
|
+
children: [translate('The expression may result in an array of simple values or alternatively follow this schema:'), jsx("pre", {
|
|
12735
12896
|
children: jsx("code", {
|
|
12736
12897
|
children: schema
|
|
12737
12898
|
})
|
|
@@ -12741,18 +12902,22 @@ function OptionsExpression(props) {
|
|
|
12741
12902
|
const setValue = value => editField(field, path, value || '');
|
|
12742
12903
|
return FeelEntry({
|
|
12743
12904
|
debounce,
|
|
12744
|
-
description: 'Define an expression to populate the options from.',
|
|
12905
|
+
description: translate('Define an expression to populate the options from.'),
|
|
12745
12906
|
tooltip,
|
|
12746
12907
|
element: field,
|
|
12747
12908
|
feel: 'required',
|
|
12748
12909
|
getValue,
|
|
12749
12910
|
id,
|
|
12750
|
-
label: 'Options expression',
|
|
12911
|
+
label: translate('Options expression'),
|
|
12751
12912
|
setValue,
|
|
12752
12913
|
variables
|
|
12753
12914
|
});
|
|
12754
12915
|
}
|
|
12755
12916
|
|
|
12917
|
+
/**
|
|
12918
|
+
* @typedef { import('diagram-js/lib/i18n/translate/translate').default } Translate
|
|
12919
|
+
*/
|
|
12920
|
+
|
|
12756
12921
|
function TableDataSourceEntry(props) {
|
|
12757
12922
|
const {
|
|
12758
12923
|
editField,
|
|
@@ -12776,6 +12941,7 @@ function Source(props) {
|
|
|
12776
12941
|
id
|
|
12777
12942
|
} = props;
|
|
12778
12943
|
const debounce = useService('debounce');
|
|
12944
|
+
const translate = useService('translate');
|
|
12779
12945
|
const variables = useVariables().map(name => ({
|
|
12780
12946
|
name
|
|
12781
12947
|
}));
|
|
@@ -12791,17 +12957,17 @@ function Source(props) {
|
|
|
12791
12957
|
};
|
|
12792
12958
|
return FeelTemplatingEntry({
|
|
12793
12959
|
debounce,
|
|
12794
|
-
description: 'Specify the source from which to populate the table',
|
|
12960
|
+
description: translate('Specify the source from which to populate the table'),
|
|
12795
12961
|
element: field,
|
|
12796
12962
|
feel: 'required',
|
|
12797
12963
|
getValue,
|
|
12798
12964
|
id,
|
|
12799
|
-
label: 'Data source',
|
|
12800
|
-
tooltip: 'Enter a form input variable that contains the data for the table or define an expression to populate the data dynamically.',
|
|
12965
|
+
label: translate('Data source'),
|
|
12966
|
+
tooltip: translate('Enter a form input variable that contains the data for the table or define an expression to populate the data dynamically.'),
|
|
12801
12967
|
setValue,
|
|
12802
12968
|
singleLine: true,
|
|
12803
12969
|
variables,
|
|
12804
|
-
validate: validate$5
|
|
12970
|
+
validate: useCallback(value => validate$5(value, translate), [translate])
|
|
12805
12971
|
});
|
|
12806
12972
|
}
|
|
12807
12973
|
|
|
@@ -12809,20 +12975,21 @@ function Source(props) {
|
|
|
12809
12975
|
|
|
12810
12976
|
/**
|
|
12811
12977
|
* @param {string|void} value
|
|
12978
|
+
* @param {Translate} translate
|
|
12812
12979
|
* @returns {string|null}
|
|
12813
12980
|
*/
|
|
12814
|
-
const validate$5 = value => {
|
|
12981
|
+
const validate$5 = (value, translate) => {
|
|
12815
12982
|
if (!isString(value) || value.length === 0) {
|
|
12816
|
-
return 'Must not be empty.';
|
|
12983
|
+
return translate('Must not be empty.');
|
|
12817
12984
|
}
|
|
12818
12985
|
if (value.startsWith('=')) {
|
|
12819
12986
|
return null;
|
|
12820
12987
|
}
|
|
12821
12988
|
if (!isValidDotPath(value)) {
|
|
12822
|
-
return 'Must be a variable or a dot separated path.';
|
|
12989
|
+
return translate('Must be a variable or a dot separated path.');
|
|
12823
12990
|
}
|
|
12824
12991
|
if (hasIntegerPathSegment(value)) {
|
|
12825
|
-
return 'Must not contain numerical path segments.';
|
|
12992
|
+
return translate('Must not contain numerical path segments.');
|
|
12826
12993
|
}
|
|
12827
12994
|
return null;
|
|
12828
12995
|
};
|
|
@@ -12830,8 +12997,10 @@ const validate$5 = value => {
|
|
|
12830
12997
|
function PaginationEntry(props) {
|
|
12831
12998
|
const {
|
|
12832
12999
|
editField,
|
|
12833
|
-
field
|
|
13000
|
+
field,
|
|
13001
|
+
getService
|
|
12834
13002
|
} = props;
|
|
13003
|
+
const translate = getService('translate');
|
|
12835
13004
|
const entries = [];
|
|
12836
13005
|
entries.push({
|
|
12837
13006
|
id: 'pagination',
|
|
@@ -12839,7 +13008,8 @@ function PaginationEntry(props) {
|
|
|
12839
13008
|
editField: editField,
|
|
12840
13009
|
field: field,
|
|
12841
13010
|
isEdited: isEdited$7,
|
|
12842
|
-
isDefaultVisible: field => field.type === 'table'
|
|
13011
|
+
isDefaultVisible: field => field.type === 'table',
|
|
13012
|
+
translate
|
|
12843
13013
|
});
|
|
12844
13014
|
return entries;
|
|
12845
13015
|
}
|
|
@@ -12847,7 +13017,8 @@ function Pagination(props) {
|
|
|
12847
13017
|
const {
|
|
12848
13018
|
editField,
|
|
12849
13019
|
field,
|
|
12850
|
-
id
|
|
13020
|
+
id,
|
|
13021
|
+
translate
|
|
12851
13022
|
} = props;
|
|
12852
13023
|
const defaultRowCount = 10;
|
|
12853
13024
|
const path = ['rowCount'];
|
|
@@ -12865,12 +13036,16 @@ function Pagination(props) {
|
|
|
12865
13036
|
element: field,
|
|
12866
13037
|
getValue,
|
|
12867
13038
|
id,
|
|
12868
|
-
label: 'Pagination',
|
|
13039
|
+
label: translate('Pagination'),
|
|
12869
13040
|
inline: true,
|
|
12870
13041
|
setValue
|
|
12871
13042
|
});
|
|
12872
13043
|
}
|
|
12873
13044
|
|
|
13045
|
+
/**
|
|
13046
|
+
* @typedef { import('diagram-js/lib/i18n/translate/translate').default } Translate
|
|
13047
|
+
*/
|
|
13048
|
+
|
|
12874
13049
|
const path$2 = ['rowCount'];
|
|
12875
13050
|
function RowCountEntry(props) {
|
|
12876
13051
|
const {
|
|
@@ -12895,6 +13070,7 @@ function RowCount(props) {
|
|
|
12895
13070
|
id
|
|
12896
13071
|
} = props;
|
|
12897
13072
|
const debounce = useService('debounce');
|
|
13073
|
+
const translate = useService('translate');
|
|
12898
13074
|
const getValue = () => get(field, path$2);
|
|
12899
13075
|
|
|
12900
13076
|
/**
|
|
@@ -12910,33 +13086,31 @@ function RowCount(props) {
|
|
|
12910
13086
|
};
|
|
12911
13087
|
return NumberFieldEntry({
|
|
12912
13088
|
debounce,
|
|
12913
|
-
label: 'Number of rows per page',
|
|
13089
|
+
label: translate('Number of rows per page'),
|
|
12914
13090
|
element: field,
|
|
12915
13091
|
id,
|
|
12916
13092
|
getValue,
|
|
12917
13093
|
setValue,
|
|
12918
|
-
validate: validate$4
|
|
13094
|
+
validate: useCallback(value => validate$4(value, translate), [translate])
|
|
12919
13095
|
});
|
|
12920
13096
|
}
|
|
12921
13097
|
|
|
12922
13098
|
// helpers //////////
|
|
12923
13099
|
|
|
12924
13100
|
/**
|
|
12925
|
-
* @param {
|
|
13101
|
+
* @param {number|undefined} value
|
|
13102
|
+
* @param {Translate} translate
|
|
12926
13103
|
* @returns {string|null}
|
|
12927
13104
|
*/
|
|
12928
|
-
const validate$4 = value => {
|
|
13105
|
+
const validate$4 = (value, translate) => {
|
|
12929
13106
|
if (isNil(value)) {
|
|
12930
13107
|
return null;
|
|
12931
13108
|
}
|
|
12932
|
-
if (!isNumber(value)) {
|
|
12933
|
-
return 'Must be number';
|
|
12934
|
-
}
|
|
12935
13109
|
if (!Number.isInteger(value)) {
|
|
12936
|
-
return 'Should be an integer.';
|
|
13110
|
+
return translate('Should be an integer.');
|
|
12937
13111
|
}
|
|
12938
13112
|
if (value < 1) {
|
|
12939
|
-
return 'Should be greater than zero.';
|
|
13113
|
+
return translate('Should be greater than zero.');
|
|
12940
13114
|
}
|
|
12941
13115
|
return null;
|
|
12942
13116
|
};
|
|
@@ -12951,7 +13125,6 @@ const OPTIONS = {
|
|
|
12951
13125
|
value: 'expression'
|
|
12952
13126
|
}
|
|
12953
13127
|
};
|
|
12954
|
-
const SELECT_OPTIONS = Object.values(OPTIONS);
|
|
12955
13128
|
const COLUMNS_PATH = ['columns'];
|
|
12956
13129
|
const COLUMNS_EXPRESSION_PATH = ['columnsExpression'];
|
|
12957
13130
|
const isHeadersSourceEdited = isEditedFromDefaultFactory(OPTIONS.static.value);
|
|
@@ -12959,22 +13132,32 @@ function HeadersSourceSelectEntry(props) {
|
|
|
12959
13132
|
const {
|
|
12960
13133
|
editField,
|
|
12961
13134
|
field,
|
|
12962
|
-
id
|
|
13135
|
+
id,
|
|
13136
|
+
translate
|
|
12963
13137
|
} = props;
|
|
12964
13138
|
return [{
|
|
12965
13139
|
id: id + '-select',
|
|
12966
13140
|
component: HeadersSourceSelect,
|
|
12967
13141
|
isEdited: isHeadersSourceEdited,
|
|
12968
13142
|
editField,
|
|
12969
|
-
field
|
|
13143
|
+
field,
|
|
13144
|
+
translate
|
|
12970
13145
|
}];
|
|
12971
13146
|
}
|
|
12972
13147
|
function HeadersSourceSelect(props) {
|
|
12973
13148
|
const {
|
|
12974
13149
|
editField,
|
|
12975
13150
|
field,
|
|
12976
|
-
id
|
|
13151
|
+
id,
|
|
13152
|
+
translate
|
|
12977
13153
|
} = props;
|
|
13154
|
+
const selectOptions = Object.values(OPTIONS).map(({
|
|
13155
|
+
label,
|
|
13156
|
+
value
|
|
13157
|
+
}) => ({
|
|
13158
|
+
label: translate(label),
|
|
13159
|
+
value
|
|
13160
|
+
}));
|
|
12978
13161
|
|
|
12979
13162
|
/**
|
|
12980
13163
|
* @returns {string|void}
|
|
@@ -13011,11 +13194,11 @@ function HeadersSourceSelect(props) {
|
|
|
13011
13194
|
}
|
|
13012
13195
|
};
|
|
13013
13196
|
const getValuesSourceOptions = () => {
|
|
13014
|
-
return
|
|
13197
|
+
return selectOptions;
|
|
13015
13198
|
};
|
|
13016
13199
|
return AutoFocusSelectEntry({
|
|
13017
13200
|
autoFocusEntry: getAutoFocusEntryId(field),
|
|
13018
|
-
label: 'Type',
|
|
13201
|
+
label: translate('Type'),
|
|
13019
13202
|
element: field,
|
|
13020
13203
|
getOptions: getValuesSourceOptions,
|
|
13021
13204
|
getValue,
|
|
@@ -13062,6 +13245,7 @@ function ColumnsExpression(props) {
|
|
|
13062
13245
|
id
|
|
13063
13246
|
} = props;
|
|
13064
13247
|
const debounce = useService('debounce');
|
|
13248
|
+
const translate = useService('translate');
|
|
13065
13249
|
const variables = useVariables().map(name => ({
|
|
13066
13250
|
name
|
|
13067
13251
|
}));
|
|
@@ -13082,7 +13266,7 @@ function ColumnsExpression(props) {
|
|
|
13082
13266
|
};
|
|
13083
13267
|
const schema = '[\n {\n "key": "column_1",\n "label": "Column 1"\n }\n]';
|
|
13084
13268
|
const tooltip = jsxs("div", {
|
|
13085
|
-
children: [
|
|
13269
|
+
children: [translate('The expression may result in an array of simple values or alternatively follow this schema:'), jsx("pre", {
|
|
13086
13270
|
children: jsx("code", {
|
|
13087
13271
|
children: schema
|
|
13088
13272
|
})
|
|
@@ -13090,17 +13274,17 @@ function ColumnsExpression(props) {
|
|
|
13090
13274
|
});
|
|
13091
13275
|
return FeelTemplatingEntry({
|
|
13092
13276
|
debounce,
|
|
13093
|
-
description: 'Specify an expression to populate column items',
|
|
13277
|
+
description: translate('Specify an expression to populate column items'),
|
|
13094
13278
|
element: field,
|
|
13095
13279
|
feel: 'required',
|
|
13096
13280
|
getValue,
|
|
13097
13281
|
id,
|
|
13098
|
-
label: 'Expression',
|
|
13282
|
+
label: translate('Expression'),
|
|
13099
13283
|
tooltip,
|
|
13100
13284
|
setValue,
|
|
13101
13285
|
singleLine: true,
|
|
13102
13286
|
variables,
|
|
13103
|
-
validate: validate$3
|
|
13287
|
+
validate: useCallback(value => validate$3(value, translate), [translate])
|
|
13104
13288
|
});
|
|
13105
13289
|
}
|
|
13106
13290
|
|
|
@@ -13108,15 +13292,20 @@ function ColumnsExpression(props) {
|
|
|
13108
13292
|
|
|
13109
13293
|
/**
|
|
13110
13294
|
* @param {string|void} value
|
|
13295
|
+
* @param {Translate} translate
|
|
13111
13296
|
* @returns {string|null}
|
|
13112
13297
|
*/
|
|
13113
|
-
const validate$3 = value => {
|
|
13298
|
+
const validate$3 = (value, translate) => {
|
|
13114
13299
|
if (!isString(value) || value.length === 0 || value === '=') {
|
|
13115
|
-
return 'Must not be empty.';
|
|
13300
|
+
return translate('Must not be empty.');
|
|
13116
13301
|
}
|
|
13117
13302
|
return null;
|
|
13118
13303
|
};
|
|
13119
13304
|
|
|
13305
|
+
/**
|
|
13306
|
+
* @typedef { import('diagram-js/lib/i18n/translate/translate').default } Translate
|
|
13307
|
+
*/
|
|
13308
|
+
|
|
13120
13309
|
const path$1 = 'columns';
|
|
13121
13310
|
const labelPath = 'label';
|
|
13122
13311
|
const keyPath = 'key';
|
|
@@ -13152,6 +13341,7 @@ function Label(props) {
|
|
|
13152
13341
|
index
|
|
13153
13342
|
} = props;
|
|
13154
13343
|
const debounce = useService('debounce');
|
|
13344
|
+
const translate = useService('translate');
|
|
13155
13345
|
|
|
13156
13346
|
/**
|
|
13157
13347
|
* @param {string|void} value
|
|
@@ -13173,7 +13363,7 @@ function Label(props) {
|
|
|
13173
13363
|
element: field,
|
|
13174
13364
|
getValue,
|
|
13175
13365
|
id,
|
|
13176
|
-
label: 'Label',
|
|
13366
|
+
label: translate('Label'),
|
|
13177
13367
|
setValue
|
|
13178
13368
|
});
|
|
13179
13369
|
}
|
|
@@ -13185,6 +13375,7 @@ function Key(props) {
|
|
|
13185
13375
|
index
|
|
13186
13376
|
} = props;
|
|
13187
13377
|
const debounce = useService('debounce');
|
|
13378
|
+
const translate = useService('translate');
|
|
13188
13379
|
|
|
13189
13380
|
/**
|
|
13190
13381
|
* @param {string|void} value
|
|
@@ -13206,9 +13397,9 @@ function Key(props) {
|
|
|
13206
13397
|
element: field,
|
|
13207
13398
|
getValue,
|
|
13208
13399
|
id,
|
|
13209
|
-
label: 'Key',
|
|
13400
|
+
label: translate('Key'),
|
|
13210
13401
|
setValue,
|
|
13211
|
-
validate: validate$2
|
|
13402
|
+
validate: useCallback(value => validate$2(value, translate), [translate])
|
|
13212
13403
|
});
|
|
13213
13404
|
}
|
|
13214
13405
|
|
|
@@ -13216,11 +13407,12 @@ function Key(props) {
|
|
|
13216
13407
|
|
|
13217
13408
|
/**
|
|
13218
13409
|
* @param {string|void} value
|
|
13410
|
+
* @param {Translate} translate
|
|
13219
13411
|
* @returns {string|null}
|
|
13220
13412
|
*/
|
|
13221
|
-
function validate$2(value) {
|
|
13413
|
+
function validate$2(value, translate) {
|
|
13222
13414
|
if (!isString(value) || value.length === 0) {
|
|
13223
|
-
return 'Must not be empty.';
|
|
13415
|
+
return translate('Must not be empty.');
|
|
13224
13416
|
}
|
|
13225
13417
|
return null;
|
|
13226
13418
|
}
|
|
@@ -13290,6 +13482,7 @@ function VersionTag(props) {
|
|
|
13290
13482
|
id
|
|
13291
13483
|
} = props;
|
|
13292
13484
|
const debounce = useService('debounce');
|
|
13485
|
+
const translate = useService('translate');
|
|
13293
13486
|
const path = ['versionTag'];
|
|
13294
13487
|
const getValue = () => {
|
|
13295
13488
|
return get(field, path, '');
|
|
@@ -13301,14 +13494,14 @@ function VersionTag(props) {
|
|
|
13301
13494
|
return editField(field, path, value);
|
|
13302
13495
|
};
|
|
13303
13496
|
const tooltip = jsx("div", {
|
|
13304
|
-
children:
|
|
13497
|
+
children: translate('Version tag by which this form can be referenced.')
|
|
13305
13498
|
});
|
|
13306
13499
|
return TextfieldEntry({
|
|
13307
13500
|
debounce,
|
|
13308
13501
|
element: field,
|
|
13309
13502
|
getValue,
|
|
13310
13503
|
id,
|
|
13311
|
-
label: 'Version tag',
|
|
13504
|
+
label: translate('Version tag'),
|
|
13312
13505
|
setValue,
|
|
13313
13506
|
tooltip
|
|
13314
13507
|
});
|
|
@@ -13336,6 +13529,7 @@ function Accept(props) {
|
|
|
13336
13529
|
field,
|
|
13337
13530
|
id
|
|
13338
13531
|
} = props;
|
|
13532
|
+
const translate = useService('translate');
|
|
13339
13533
|
const debounce = useService('debounce');
|
|
13340
13534
|
const variables = useVariables().map(name => ({
|
|
13341
13535
|
name
|
|
@@ -13352,24 +13546,29 @@ function Accept(props) {
|
|
|
13352
13546
|
element: field,
|
|
13353
13547
|
getValue,
|
|
13354
13548
|
id,
|
|
13355
|
-
label: 'Supported file formats',
|
|
13549
|
+
label: translate('Supported file formats'),
|
|
13356
13550
|
singleLine: true,
|
|
13357
13551
|
setValue,
|
|
13358
13552
|
variables,
|
|
13359
|
-
description
|
|
13553
|
+
description: description(translate)
|
|
13360
13554
|
});
|
|
13361
13555
|
}
|
|
13362
13556
|
|
|
13363
13557
|
// helpers //////////
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
13369
|
-
|
|
13370
|
-
children:
|
|
13371
|
-
|
|
13372
|
-
|
|
13558
|
+
/**
|
|
13559
|
+
* @param {Translate} translate
|
|
13560
|
+
* @returns Description Element
|
|
13561
|
+
*/
|
|
13562
|
+
const description = translate => {
|
|
13563
|
+
return jsxs(Fragment$1, {
|
|
13564
|
+
children: [translate('A comma-separated list of'), ' ', jsx("a", {
|
|
13565
|
+
href: "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers",
|
|
13566
|
+
target: "_blank",
|
|
13567
|
+
rel: "noreferrer",
|
|
13568
|
+
children: translate('file type specifiers')
|
|
13569
|
+
})]
|
|
13570
|
+
});
|
|
13571
|
+
};
|
|
13373
13572
|
|
|
13374
13573
|
function MultipleEntry(props) {
|
|
13375
13574
|
const {
|
|
@@ -13394,6 +13593,7 @@ function Multiple(props) {
|
|
|
13394
13593
|
id
|
|
13395
13594
|
} = props;
|
|
13396
13595
|
const debounce = useService('debounce');
|
|
13596
|
+
const translate = useService('translate');
|
|
13397
13597
|
const variables = useVariables().map(name => ({
|
|
13398
13598
|
name
|
|
13399
13599
|
}));
|
|
@@ -13410,7 +13610,7 @@ function Multiple(props) {
|
|
|
13410
13610
|
feel: 'optional',
|
|
13411
13611
|
getValue,
|
|
13412
13612
|
id,
|
|
13413
|
-
label: 'Upload multiple files',
|
|
13613
|
+
label: translate('Upload multiple files'),
|
|
13414
13614
|
inline: true,
|
|
13415
13615
|
setValue,
|
|
13416
13616
|
variables
|
|
@@ -13440,6 +13640,7 @@ function DocumentsDataSource(props) {
|
|
|
13440
13640
|
id
|
|
13441
13641
|
} = props;
|
|
13442
13642
|
const debounce = useService('debounce');
|
|
13643
|
+
const translate = useService('translate');
|
|
13443
13644
|
const variables = useVariables().map(name => ({
|
|
13444
13645
|
name
|
|
13445
13646
|
}));
|
|
@@ -13462,23 +13663,23 @@ function DocumentsDataSource(props) {
|
|
|
13462
13663
|
]`;
|
|
13463
13664
|
const tooltip = jsxs("div", {
|
|
13464
13665
|
children: [jsx("p", {
|
|
13465
|
-
children:
|
|
13666
|
+
children: translate('A source is a JSON object containing metadata for a document or an array of documents.')
|
|
13466
13667
|
}), jsx("p", {
|
|
13467
|
-
children:
|
|
13668
|
+
children: translate('Each entry must include a document ID, name, and MIME type.')
|
|
13468
13669
|
}), jsx("p", {
|
|
13469
|
-
children:
|
|
13670
|
+
children: translate('Additional details are optional. The expected format is as follows:')
|
|
13470
13671
|
}), jsx("pre", {
|
|
13471
13672
|
children: jsx("code", {
|
|
13472
13673
|
children: schema
|
|
13473
13674
|
})
|
|
13474
13675
|
}), jsx("p", {
|
|
13475
|
-
children:
|
|
13676
|
+
children: translate('When using Camunda Tasklist UI, additional document reference attributes are automatically handled. Modifying the document reference may affect the document preview functionality.')
|
|
13476
13677
|
}), jsxs("p", {
|
|
13477
|
-
children: [
|
|
13678
|
+
children: [translate('Learn more in our'), ' ', jsx("a", {
|
|
13478
13679
|
href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-document-preview/",
|
|
13479
13680
|
target: "_blank",
|
|
13480
13681
|
rel: "noopener noreferrer",
|
|
13481
|
-
children:
|
|
13682
|
+
children: translate('documentation')
|
|
13482
13683
|
}), "."]
|
|
13483
13684
|
})]
|
|
13484
13685
|
});
|
|
@@ -13487,13 +13688,13 @@ function DocumentsDataSource(props) {
|
|
|
13487
13688
|
element: field,
|
|
13488
13689
|
getValue,
|
|
13489
13690
|
id,
|
|
13490
|
-
label: 'Document reference',
|
|
13691
|
+
label: translate('Document reference'),
|
|
13491
13692
|
feel: 'required',
|
|
13492
13693
|
singleLine: true,
|
|
13493
13694
|
setValue,
|
|
13494
13695
|
variables,
|
|
13495
13696
|
tooltip,
|
|
13496
|
-
validate: validate$1
|
|
13697
|
+
validate: useCallback(value => validate$1(value, translate), [translate])
|
|
13497
13698
|
});
|
|
13498
13699
|
}
|
|
13499
13700
|
|
|
@@ -13501,14 +13702,19 @@ function DocumentsDataSource(props) {
|
|
|
13501
13702
|
|
|
13502
13703
|
/**
|
|
13503
13704
|
* @param {string|undefined} value
|
|
13705
|
+
* @param {Translate} translate
|
|
13504
13706
|
* @returns {string|null}
|
|
13505
13707
|
*/
|
|
13506
|
-
const validate$1 = value => {
|
|
13708
|
+
const validate$1 = (value, translate) => {
|
|
13507
13709
|
if (typeof value !== 'string' || value.length === 0) {
|
|
13508
|
-
return 'The document data source is required.';
|
|
13710
|
+
return translate('The document data source is required.');
|
|
13509
13711
|
}
|
|
13510
13712
|
};
|
|
13511
13713
|
|
|
13714
|
+
/**
|
|
13715
|
+
* @typedef { import('diagram-js/lib/i18n/translate/translate').default } Translate
|
|
13716
|
+
*/
|
|
13717
|
+
|
|
13512
13718
|
function MaxHeightEntry(props) {
|
|
13513
13719
|
const {
|
|
13514
13720
|
editField,
|
|
@@ -13532,43 +13738,42 @@ function MaxHeight(props) {
|
|
|
13532
13738
|
id
|
|
13533
13739
|
} = props;
|
|
13534
13740
|
const debounce = useService('debounce');
|
|
13741
|
+
const translate = useService('translate');
|
|
13535
13742
|
const path = ['maxHeight'];
|
|
13536
13743
|
const getValue = () => {
|
|
13537
|
-
return get(field, path
|
|
13744
|
+
return get(field, path);
|
|
13538
13745
|
};
|
|
13539
13746
|
const setValue = value => {
|
|
13540
13747
|
return editField(field, path, value);
|
|
13541
13748
|
};
|
|
13542
13749
|
return NumberFieldEntry({
|
|
13543
13750
|
debounce,
|
|
13544
|
-
label: 'Max height of preview container',
|
|
13751
|
+
label: translate('Max height of preview container'),
|
|
13545
13752
|
element: field,
|
|
13546
13753
|
id,
|
|
13547
13754
|
getValue,
|
|
13548
13755
|
setValue,
|
|
13549
|
-
validate,
|
|
13550
|
-
tooltip
|
|
13756
|
+
validate: useCallback(value => validate(value, translate), [translate]),
|
|
13757
|
+
description: translate(tooltip)
|
|
13551
13758
|
});
|
|
13552
13759
|
}
|
|
13553
13760
|
|
|
13554
13761
|
// helpers //////////
|
|
13555
13762
|
|
|
13556
13763
|
/**
|
|
13557
|
-
* @param {
|
|
13764
|
+
* @param {number|undefined} value
|
|
13765
|
+
* @param {Translate} translate
|
|
13558
13766
|
* @returns {string|null}
|
|
13559
13767
|
*/
|
|
13560
|
-
const validate = value => {
|
|
13561
|
-
if (value
|
|
13768
|
+
const validate = (value, translate) => {
|
|
13769
|
+
if (isNil(value)) {
|
|
13562
13770
|
return null;
|
|
13563
13771
|
}
|
|
13564
|
-
if (typeof value === 'string') {
|
|
13565
|
-
return 'Value must be a number.';
|
|
13566
|
-
}
|
|
13567
13772
|
if (!Number.isInteger(value)) {
|
|
13568
|
-
return 'Should be an integer.';
|
|
13773
|
+
return translate('Should be an integer.');
|
|
13569
13774
|
}
|
|
13570
13775
|
if (value < 1) {
|
|
13571
|
-
return 'Should be greater than zero.';
|
|
13776
|
+
return translate('Should be greater than zero.');
|
|
13572
13777
|
}
|
|
13573
13778
|
};
|
|
13574
13779
|
const tooltip = 'Documents whose height exceeds the defined value in pixels will be vertically scrollable';
|
|
@@ -13600,13 +13805,15 @@ function GeneralGroup(field, editField, getService) {
|
|
|
13600
13805
|
getService
|
|
13601
13806
|
}), ...DefaultValueEntry({
|
|
13602
13807
|
field,
|
|
13603
|
-
editField
|
|
13808
|
+
editField,
|
|
13809
|
+
getService
|
|
13604
13810
|
}), ...ActionEntry({
|
|
13605
13811
|
field,
|
|
13606
13812
|
editField
|
|
13607
13813
|
}), ...DateTimeEntry({
|
|
13608
13814
|
field,
|
|
13609
|
-
editField
|
|
13815
|
+
editField,
|
|
13816
|
+
getService
|
|
13610
13817
|
}), ...TextEntry({
|
|
13611
13818
|
field,
|
|
13612
13819
|
editField}), ...HtmlEntry({
|
|
@@ -13616,7 +13823,8 @@ function GeneralGroup(field, editField, getService) {
|
|
|
13616
13823
|
editField
|
|
13617
13824
|
}), ...IFrameHeightEntry({
|
|
13618
13825
|
field,
|
|
13619
|
-
editField
|
|
13826
|
+
editField,
|
|
13827
|
+
getService
|
|
13620
13828
|
}), ...HeightEntry({
|
|
13621
13829
|
field,
|
|
13622
13830
|
editField
|
|
@@ -13634,7 +13842,8 @@ function GeneralGroup(field, editField, getService) {
|
|
|
13634
13842
|
editField
|
|
13635
13843
|
}), ...SelectEntries({
|
|
13636
13844
|
field,
|
|
13637
|
-
editField
|
|
13845
|
+
editField,
|
|
13846
|
+
getService
|
|
13638
13847
|
}), ...AcceptEntry({
|
|
13639
13848
|
field,
|
|
13640
13849
|
editField
|
|
@@ -13643,7 +13852,8 @@ function GeneralGroup(field, editField, getService) {
|
|
|
13643
13852
|
editField
|
|
13644
13853
|
}), ...DisabledEntry({
|
|
13645
13854
|
field,
|
|
13646
|
-
editField
|
|
13855
|
+
editField,
|
|
13856
|
+
getService
|
|
13647
13857
|
}), ...ReadonlyEntry({
|
|
13648
13858
|
field,
|
|
13649
13859
|
editField
|
|
@@ -13652,7 +13862,8 @@ function GeneralGroup(field, editField, getService) {
|
|
|
13652
13862
|
editField
|
|
13653
13863
|
}), ...PaginationEntry({
|
|
13654
13864
|
field,
|
|
13655
|
-
editField
|
|
13865
|
+
editField,
|
|
13866
|
+
getService
|
|
13656
13867
|
}), ...RowCountEntry({
|
|
13657
13868
|
field,
|
|
13658
13869
|
editField
|
|
@@ -13663,14 +13874,15 @@ function GeneralGroup(field, editField, getService) {
|
|
|
13663
13874
|
if (entries.length === 0) {
|
|
13664
13875
|
return null;
|
|
13665
13876
|
}
|
|
13877
|
+
const translate = getService('translate');
|
|
13666
13878
|
return {
|
|
13667
13879
|
id: 'general',
|
|
13668
|
-
label: 'General',
|
|
13880
|
+
label: translate('General'),
|
|
13669
13881
|
entries
|
|
13670
13882
|
};
|
|
13671
13883
|
}
|
|
13672
13884
|
|
|
13673
|
-
function SerializationGroup(field, editField) {
|
|
13885
|
+
function SerializationGroup(field, editField, getService) {
|
|
13674
13886
|
const entries = [...NumberSerializationEntry({
|
|
13675
13887
|
field,
|
|
13676
13888
|
editField
|
|
@@ -13678,51 +13890,56 @@ function SerializationGroup(field, editField) {
|
|
|
13678
13890
|
field,
|
|
13679
13891
|
editField
|
|
13680
13892
|
})];
|
|
13893
|
+
const translate = getService('translate');
|
|
13681
13894
|
if (!entries.length) {
|
|
13682
13895
|
return null;
|
|
13683
13896
|
}
|
|
13684
13897
|
return {
|
|
13685
13898
|
id: 'serialization',
|
|
13686
|
-
label: 'Serialization',
|
|
13899
|
+
label: translate('Serialization'),
|
|
13687
13900
|
entries
|
|
13688
13901
|
};
|
|
13689
13902
|
}
|
|
13690
13903
|
|
|
13691
|
-
function ConstraintsGroup(field, editField) {
|
|
13904
|
+
function ConstraintsGroup(field, editField, getService) {
|
|
13692
13905
|
const entries = [...DateTimeConstraintsEntry({
|
|
13693
13906
|
field,
|
|
13694
13907
|
editField
|
|
13695
13908
|
})];
|
|
13909
|
+
const translate = getService('translate');
|
|
13696
13910
|
if (!entries.length) {
|
|
13697
13911
|
return null;
|
|
13698
13912
|
}
|
|
13699
13913
|
return {
|
|
13700
13914
|
id: 'constraints',
|
|
13701
|
-
label: 'Constraints',
|
|
13915
|
+
label: translate('Constraints'),
|
|
13702
13916
|
entries
|
|
13703
13917
|
};
|
|
13704
13918
|
}
|
|
13705
13919
|
|
|
13706
|
-
const VALIDATION_TYPE_OPTIONS = {
|
|
13707
|
-
|
|
13708
|
-
|
|
13709
|
-
|
|
13710
|
-
|
|
13711
|
-
|
|
13712
|
-
|
|
13713
|
-
|
|
13714
|
-
|
|
13715
|
-
|
|
13716
|
-
|
|
13717
|
-
|
|
13718
|
-
|
|
13920
|
+
const VALIDATION_TYPE_OPTIONS = translate => {
|
|
13921
|
+
return {
|
|
13922
|
+
custom: {
|
|
13923
|
+
value: '',
|
|
13924
|
+
label: translate('Custom')
|
|
13925
|
+
},
|
|
13926
|
+
email: {
|
|
13927
|
+
value: 'email',
|
|
13928
|
+
label: translate('Email')
|
|
13929
|
+
},
|
|
13930
|
+
phone: {
|
|
13931
|
+
value: 'phone',
|
|
13932
|
+
label: translate('Phone')
|
|
13933
|
+
}
|
|
13934
|
+
};
|
|
13719
13935
|
};
|
|
13720
|
-
function ValidationGroup(field, editField) {
|
|
13936
|
+
function ValidationGroup(field, editField, getService) {
|
|
13721
13937
|
const {
|
|
13722
13938
|
type
|
|
13723
13939
|
} = field;
|
|
13724
13940
|
const validate = get(field, ['validate'], {});
|
|
13725
|
-
const
|
|
13941
|
+
const translate = getService('translate');
|
|
13942
|
+
const isCustomValidation = [undefined, VALIDATION_TYPE_OPTIONS(translate).custom.value].includes(validate.validationType);
|
|
13726
13943
|
const hasPattern = !!get(field, ['validate', 'pattern']);
|
|
13727
13944
|
const onChange = key => {
|
|
13728
13945
|
return value => {
|
|
@@ -13742,7 +13959,8 @@ function ValidationGroup(field, editField) {
|
|
|
13742
13959
|
field,
|
|
13743
13960
|
isEdited: isEdited$9,
|
|
13744
13961
|
onChange,
|
|
13745
|
-
isDefaultVisible: field => INPUTS.includes(field.type)
|
|
13962
|
+
isDefaultVisible: field => INPUTS.includes(field.type),
|
|
13963
|
+
translate
|
|
13746
13964
|
}];
|
|
13747
13965
|
entries.push({
|
|
13748
13966
|
id: 'validationType',
|
|
@@ -13752,7 +13970,8 @@ function ValidationGroup(field, editField) {
|
|
|
13752
13970
|
editField,
|
|
13753
13971
|
isEdited: isEdited,
|
|
13754
13972
|
onChange,
|
|
13755
|
-
isDefaultVisible: field => field.type === 'textfield'
|
|
13973
|
+
isDefaultVisible: field => field.type === 'textfield',
|
|
13974
|
+
translate
|
|
13756
13975
|
});
|
|
13757
13976
|
entries.push({
|
|
13758
13977
|
id: 'minLength',
|
|
@@ -13761,7 +13980,8 @@ function ValidationGroup(field, editField) {
|
|
|
13761
13980
|
field,
|
|
13762
13981
|
isEdited: isEdited$5,
|
|
13763
13982
|
onChange,
|
|
13764
|
-
isDefaultVisible: field => INPUTS.includes(field.type) && (type === 'textarea' || type === 'textfield' && isCustomValidation)
|
|
13983
|
+
isDefaultVisible: field => INPUTS.includes(field.type) && (type === 'textarea' || type === 'textfield' && isCustomValidation),
|
|
13984
|
+
translate
|
|
13765
13985
|
}, {
|
|
13766
13986
|
id: 'maxLength',
|
|
13767
13987
|
component: MaxLength,
|
|
@@ -13769,7 +13989,8 @@ function ValidationGroup(field, editField) {
|
|
|
13769
13989
|
field,
|
|
13770
13990
|
isEdited: isEdited$5,
|
|
13771
13991
|
onChange,
|
|
13772
|
-
isDefaultVisible: field => INPUTS.includes(field.type) && (type === 'textarea' || type === 'textfield' && isCustomValidation)
|
|
13992
|
+
isDefaultVisible: field => INPUTS.includes(field.type) && (type === 'textarea' || type === 'textfield' && isCustomValidation),
|
|
13993
|
+
translate
|
|
13773
13994
|
});
|
|
13774
13995
|
entries.push({
|
|
13775
13996
|
id: 'pattern',
|
|
@@ -13778,7 +13999,8 @@ function ValidationGroup(field, editField) {
|
|
|
13778
13999
|
field,
|
|
13779
14000
|
isEdited: isEdited,
|
|
13780
14001
|
onChange,
|
|
13781
|
-
isDefaultVisible: field => INPUTS.includes(field.type) && type === 'textfield' && isCustomValidation
|
|
14002
|
+
isDefaultVisible: field => INPUTS.includes(field.type) && type === 'textfield' && isCustomValidation,
|
|
14003
|
+
translate
|
|
13782
14004
|
});
|
|
13783
14005
|
entries.push({
|
|
13784
14006
|
id: 'patternErrorMessage',
|
|
@@ -13787,7 +14009,8 @@ function ValidationGroup(field, editField) {
|
|
|
13787
14009
|
field,
|
|
13788
14010
|
isEdited: isEdited,
|
|
13789
14011
|
onChange,
|
|
13790
|
-
isDefaultVisible: field => INPUTS.includes(field.type) && type === 'textfield' && isCustomValidation && hasPattern
|
|
14012
|
+
isDefaultVisible: field => INPUTS.includes(field.type) && type === 'textfield' && isCustomValidation && hasPattern,
|
|
14013
|
+
translate
|
|
13791
14014
|
});
|
|
13792
14015
|
entries.push({
|
|
13793
14016
|
id: 'min',
|
|
@@ -13796,7 +14019,8 @@ function ValidationGroup(field, editField) {
|
|
|
13796
14019
|
field,
|
|
13797
14020
|
isEdited: isEdited$5,
|
|
13798
14021
|
onChange,
|
|
13799
|
-
isDefaultVisible: field => field.type === 'number'
|
|
14022
|
+
isDefaultVisible: field => field.type === 'number',
|
|
14023
|
+
translate
|
|
13800
14024
|
}, {
|
|
13801
14025
|
id: 'max',
|
|
13802
14026
|
component: Max,
|
|
@@ -13804,11 +14028,12 @@ function ValidationGroup(field, editField) {
|
|
|
13804
14028
|
field,
|
|
13805
14029
|
isEdited: isEdited$5,
|
|
13806
14030
|
onChange,
|
|
13807
|
-
isDefaultVisible: field => field.type === 'number'
|
|
14031
|
+
isDefaultVisible: field => field.type === 'number',
|
|
14032
|
+
translate
|
|
13808
14033
|
});
|
|
13809
14034
|
return {
|
|
13810
14035
|
id: 'validation',
|
|
13811
|
-
label: 'Validation',
|
|
14036
|
+
label: translate('Validation'),
|
|
13812
14037
|
entries
|
|
13813
14038
|
};
|
|
13814
14039
|
}
|
|
@@ -13817,13 +14042,14 @@ function Required(props) {
|
|
|
13817
14042
|
field,
|
|
13818
14043
|
getValue,
|
|
13819
14044
|
id,
|
|
13820
|
-
onChange
|
|
14045
|
+
onChange,
|
|
14046
|
+
translate
|
|
13821
14047
|
} = props;
|
|
13822
14048
|
return CheckboxEntry({
|
|
13823
14049
|
element: field,
|
|
13824
14050
|
getValue: getValue('required'),
|
|
13825
14051
|
id,
|
|
13826
|
-
label: 'Required',
|
|
14052
|
+
label: translate('Required'),
|
|
13827
14053
|
setValue: onChange('required')
|
|
13828
14054
|
});
|
|
13829
14055
|
}
|
|
@@ -13832,7 +14058,8 @@ function MinLength(props) {
|
|
|
13832
14058
|
field,
|
|
13833
14059
|
getValue,
|
|
13834
14060
|
id,
|
|
13835
|
-
onChange
|
|
14061
|
+
onChange,
|
|
14062
|
+
translate
|
|
13836
14063
|
} = props;
|
|
13837
14064
|
const debounce = useService('debounce');
|
|
13838
14065
|
const variables = useVariables().map(name => ({
|
|
@@ -13844,7 +14071,7 @@ function MinLength(props) {
|
|
|
13844
14071
|
feel: 'optional',
|
|
13845
14072
|
getValue: getValue('minLength'),
|
|
13846
14073
|
id,
|
|
13847
|
-
label: 'Minimum length',
|
|
14074
|
+
label: translate('Minimum length'),
|
|
13848
14075
|
min: 0,
|
|
13849
14076
|
setValue: onChange('minLength'),
|
|
13850
14077
|
variables
|
|
@@ -13855,7 +14082,8 @@ function MaxLength(props) {
|
|
|
13855
14082
|
field,
|
|
13856
14083
|
getValue,
|
|
13857
14084
|
id,
|
|
13858
|
-
onChange
|
|
14085
|
+
onChange,
|
|
14086
|
+
translate
|
|
13859
14087
|
} = props;
|
|
13860
14088
|
const debounce = useService('debounce');
|
|
13861
14089
|
const variables = useVariables().map(name => ({
|
|
@@ -13867,7 +14095,7 @@ function MaxLength(props) {
|
|
|
13867
14095
|
feel: 'optional',
|
|
13868
14096
|
getValue: getValue('maxLength'),
|
|
13869
14097
|
id,
|
|
13870
|
-
label: 'Maximum length',
|
|
14098
|
+
label: translate('Maximum length'),
|
|
13871
14099
|
min: 0,
|
|
13872
14100
|
setValue: onChange('maxLength'),
|
|
13873
14101
|
variables
|
|
@@ -13878,7 +14106,8 @@ function Pattern(props) {
|
|
|
13878
14106
|
field,
|
|
13879
14107
|
getValue,
|
|
13880
14108
|
id,
|
|
13881
|
-
onChange
|
|
14109
|
+
onChange,
|
|
14110
|
+
translate
|
|
13882
14111
|
} = props;
|
|
13883
14112
|
const debounce = useService('debounce');
|
|
13884
14113
|
return TextfieldEntry({
|
|
@@ -13886,7 +14115,7 @@ function Pattern(props) {
|
|
|
13886
14115
|
element: field,
|
|
13887
14116
|
getValue: getValue('pattern'),
|
|
13888
14117
|
id,
|
|
13889
|
-
label: 'Custom regular expression',
|
|
14118
|
+
label: translate('Custom regular expression'),
|
|
13890
14119
|
setValue: onChange('pattern')
|
|
13891
14120
|
});
|
|
13892
14121
|
}
|
|
@@ -13895,7 +14124,8 @@ function PatternErrorMessage(props) {
|
|
|
13895
14124
|
field,
|
|
13896
14125
|
getValue,
|
|
13897
14126
|
id,
|
|
13898
|
-
onChange
|
|
14127
|
+
onChange,
|
|
14128
|
+
translate
|
|
13899
14129
|
} = props;
|
|
13900
14130
|
const debounce = useService('debounce');
|
|
13901
14131
|
return TextfieldEntry({
|
|
@@ -13903,8 +14133,8 @@ function PatternErrorMessage(props) {
|
|
|
13903
14133
|
element: field,
|
|
13904
14134
|
getValue: getValue('patternErrorMessage'),
|
|
13905
14135
|
id,
|
|
13906
|
-
label: 'Custom error message',
|
|
13907
|
-
tooltip: 'The error message to display when the input does not match the regular expression.',
|
|
14136
|
+
label: translate('Custom error message'),
|
|
14137
|
+
tooltip: translate('The error message to display when the input does not match the regular expression.'),
|
|
13908
14138
|
setValue: onChange('patternErrorMessage')
|
|
13909
14139
|
});
|
|
13910
14140
|
}
|
|
@@ -13913,7 +14143,8 @@ function Min(props) {
|
|
|
13913
14143
|
field,
|
|
13914
14144
|
getValue,
|
|
13915
14145
|
id,
|
|
13916
|
-
onChange
|
|
14146
|
+
onChange,
|
|
14147
|
+
translate
|
|
13917
14148
|
} = props;
|
|
13918
14149
|
const debounce = useService('debounce');
|
|
13919
14150
|
const variables = useVariables().map(name => ({
|
|
@@ -13924,7 +14155,7 @@ function Min(props) {
|
|
|
13924
14155
|
element: field,
|
|
13925
14156
|
feel: 'optional',
|
|
13926
14157
|
id,
|
|
13927
|
-
label: 'Minimum',
|
|
14158
|
+
label: translate('Minimum'),
|
|
13928
14159
|
step: 'any',
|
|
13929
14160
|
getValue: getValue('min'),
|
|
13930
14161
|
setValue: onChange('min'),
|
|
@@ -13936,7 +14167,8 @@ function Max(props) {
|
|
|
13936
14167
|
field,
|
|
13937
14168
|
getValue,
|
|
13938
14169
|
id,
|
|
13939
|
-
onChange
|
|
14170
|
+
onChange,
|
|
14171
|
+
translate
|
|
13940
14172
|
} = props;
|
|
13941
14173
|
const debounce = useService('debounce');
|
|
13942
14174
|
const variables = useVariables().map(name => ({
|
|
@@ -13947,7 +14179,7 @@ function Max(props) {
|
|
|
13947
14179
|
element: field,
|
|
13948
14180
|
feel: 'optional',
|
|
13949
14181
|
id,
|
|
13950
|
-
label: 'Maximum',
|
|
14182
|
+
label: translate('Maximum'),
|
|
13951
14183
|
step: 'any',
|
|
13952
14184
|
getValue: getValue('max'),
|
|
13953
14185
|
setValue: onChange('max'),
|
|
@@ -13959,7 +14191,8 @@ function ValidationType(props) {
|
|
|
13959
14191
|
field,
|
|
13960
14192
|
getValue,
|
|
13961
14193
|
id,
|
|
13962
|
-
onChange
|
|
14194
|
+
onChange,
|
|
14195
|
+
translate
|
|
13963
14196
|
} = props;
|
|
13964
14197
|
useService('debounce');
|
|
13965
14198
|
const setValue = validationType => {
|
|
@@ -13969,10 +14202,10 @@ function ValidationType(props) {
|
|
|
13969
14202
|
element: field,
|
|
13970
14203
|
getValue: getValue('validationType'),
|
|
13971
14204
|
id,
|
|
13972
|
-
label: 'Validation pattern',
|
|
14205
|
+
label: translate('Validation pattern'),
|
|
13973
14206
|
setValue,
|
|
13974
|
-
getOptions: () => Object.values(VALIDATION_TYPE_OPTIONS),
|
|
13975
|
-
tooltip: getValue('validationType')() === VALIDATION_TYPE_OPTIONS.phone.value ? 'The built-in phone validation pattern is based on the E.164 standard with no spaces. Ex: +491234567890' : undefined
|
|
14207
|
+
getOptions: () => Object.values(VALIDATION_TYPE_OPTIONS(translate)),
|
|
14208
|
+
tooltip: getValue('validationType')() === VALIDATION_TYPE_OPTIONS(translate).phone.value ? translate('The built-in phone validation pattern is based on the E.164 standard with no spaces. Ex: +491234567890') : undefined
|
|
13976
14209
|
});
|
|
13977
14210
|
}
|
|
13978
14211
|
|
|
@@ -13981,6 +14214,7 @@ function OptionsGroups(field, editField, getService) {
|
|
|
13981
14214
|
type
|
|
13982
14215
|
} = field;
|
|
13983
14216
|
const formFields = getService('formFields');
|
|
14217
|
+
const translate = getService('translate');
|
|
13984
14218
|
const fieldDefinition = formFields.get(type).config;
|
|
13985
14219
|
if (!OPTIONS_INPUTS.includes(type) && !hasOptionsGroupsConfigured(fieldDefinition)) {
|
|
13986
14220
|
return [];
|
|
@@ -13996,12 +14230,13 @@ function OptionsGroups(field, editField, getService) {
|
|
|
13996
14230
|
*/
|
|
13997
14231
|
const groups = [{
|
|
13998
14232
|
id,
|
|
13999
|
-
label: 'Options source',
|
|
14000
|
-
tooltip: getValuesTooltip(),
|
|
14233
|
+
label: translate('Options source'),
|
|
14234
|
+
tooltip: getValuesTooltip(translate),
|
|
14001
14235
|
component: Group,
|
|
14002
14236
|
entries: OptionsSourceSelectEntry({
|
|
14003
14237
|
...context,
|
|
14004
|
-
id
|
|
14238
|
+
id,
|
|
14239
|
+
translate
|
|
14005
14240
|
})
|
|
14006
14241
|
}];
|
|
14007
14242
|
const valuesSource = getOptionsSource(field);
|
|
@@ -14009,7 +14244,7 @@ function OptionsGroups(field, editField, getService) {
|
|
|
14009
14244
|
const id = 'dynamicOptions';
|
|
14010
14245
|
groups.push({
|
|
14011
14246
|
id,
|
|
14012
|
-
label: 'Dynamic options',
|
|
14247
|
+
label: translate('Dynamic options'),
|
|
14013
14248
|
component: Group,
|
|
14014
14249
|
entries: InputKeyOptionsSourceEntry({
|
|
14015
14250
|
...context,
|
|
@@ -14020,18 +14255,22 @@ function OptionsGroups(field, editField, getService) {
|
|
|
14020
14255
|
const id = 'staticOptions';
|
|
14021
14256
|
groups.push({
|
|
14022
14257
|
id,
|
|
14023
|
-
label: 'Static options',
|
|
14024
|
-
component: ListGroup
|
|
14258
|
+
label: translate('Static options'),
|
|
14259
|
+
component: props => ListGroup({
|
|
14260
|
+
...props,
|
|
14261
|
+
translate
|
|
14262
|
+
}),
|
|
14025
14263
|
...StaticOptionsSourceEntry({
|
|
14026
14264
|
...context,
|
|
14027
|
-
id
|
|
14265
|
+
id,
|
|
14266
|
+
translate
|
|
14028
14267
|
})
|
|
14029
14268
|
});
|
|
14030
14269
|
} else if (valuesSource === OPTIONS_SOURCES.EXPRESSION) {
|
|
14031
14270
|
const id = 'optionsExpression';
|
|
14032
14271
|
groups.push({
|
|
14033
14272
|
id,
|
|
14034
|
-
label: 'Options expression',
|
|
14273
|
+
label: translate('Options expression'),
|
|
14035
14274
|
component: Group,
|
|
14036
14275
|
entries: OptionsExpressionEntry({
|
|
14037
14276
|
...context,
|
|
@@ -14044,15 +14283,16 @@ function OptionsGroups(field, editField, getService) {
|
|
|
14044
14283
|
|
|
14045
14284
|
// helpers //////////
|
|
14046
14285
|
|
|
14047
|
-
function getValuesTooltip() {
|
|
14048
|
-
return '"Static" defines a constant, predefined set of form options
|
|
14286
|
+
function getValuesTooltip(translate) {
|
|
14287
|
+
return translate('"Static" defines a constant, predefined set of form options.') + '\n\n' + translate('"Input data" defines options that are populated dynamically, adjusting based on variable data for flexible responses to different conditions or inputs.') + '\n\n' + translate('"Expression" defines options that are populated from a FEEL expression.');
|
|
14049
14288
|
}
|
|
14050
14289
|
|
|
14051
|
-
function CustomPropertiesGroup(field, editField) {
|
|
14290
|
+
function CustomPropertiesGroup(field, editField, getService) {
|
|
14052
14291
|
const {
|
|
14053
14292
|
properties = {},
|
|
14054
14293
|
type
|
|
14055
14294
|
} = field;
|
|
14295
|
+
const translate = getService('translate');
|
|
14056
14296
|
if (type === 'default') {
|
|
14057
14297
|
return null;
|
|
14058
14298
|
}
|
|
@@ -14073,10 +14313,10 @@ function CustomPropertiesGroup(field, editField) {
|
|
|
14073
14313
|
return;
|
|
14074
14314
|
}
|
|
14075
14315
|
if (typeof value !== 'string' || value.length === 0) {
|
|
14076
|
-
return 'Must not be empty.';
|
|
14316
|
+
return translate('Must not be empty.');
|
|
14077
14317
|
}
|
|
14078
14318
|
if (has(properties, value)) {
|
|
14079
|
-
return 'Must be unique.';
|
|
14319
|
+
return translate('Must be unique.');
|
|
14080
14320
|
}
|
|
14081
14321
|
};
|
|
14082
14322
|
};
|
|
@@ -14102,11 +14342,14 @@ function CustomPropertiesGroup(field, editField) {
|
|
|
14102
14342
|
});
|
|
14103
14343
|
return {
|
|
14104
14344
|
add: addEntry,
|
|
14105
|
-
component: ListGroup
|
|
14345
|
+
component: props => ListGroup({
|
|
14346
|
+
...props,
|
|
14347
|
+
translate
|
|
14348
|
+
}),
|
|
14106
14349
|
id: 'custom-values',
|
|
14107
14350
|
items,
|
|
14108
|
-
label: 'Custom properties',
|
|
14109
|
-
tooltip: 'Add properties directly to the form schema, useful to configure functionality in custom-built task applications and form renderers.'
|
|
14351
|
+
label: translate('Custom properties'),
|
|
14352
|
+
tooltip: translate('Add properties directly to the form schema, useful to configure functionality in custom-built task applications and form renderers.')
|
|
14110
14353
|
};
|
|
14111
14354
|
}
|
|
14112
14355
|
|
|
@@ -14134,15 +14377,18 @@ function removeKey(properties, oldKey) {
|
|
|
14134
14377
|
}
|
|
14135
14378
|
|
|
14136
14379
|
function AppearanceGroup(field, editField, getService) {
|
|
14380
|
+
const translate = getService('translate');
|
|
14137
14381
|
const entries = [...AdornerEntry({
|
|
14138
14382
|
field,
|
|
14139
14383
|
editField
|
|
14140
14384
|
}), ...GroupAppearanceEntry({
|
|
14141
14385
|
field,
|
|
14142
|
-
editField
|
|
14386
|
+
editField,
|
|
14387
|
+
translate
|
|
14143
14388
|
}), ...LayouterAppearanceEntry({
|
|
14144
14389
|
field,
|
|
14145
|
-
editField
|
|
14390
|
+
editField,
|
|
14391
|
+
translate
|
|
14146
14392
|
}), ...MaxHeightEntry({
|
|
14147
14393
|
field,
|
|
14148
14394
|
editField
|
|
@@ -14152,15 +14398,16 @@ function AppearanceGroup(field, editField, getService) {
|
|
|
14152
14398
|
}
|
|
14153
14399
|
return {
|
|
14154
14400
|
id: 'appearance',
|
|
14155
|
-
label: 'Appearance',
|
|
14401
|
+
label: translate('Appearance'),
|
|
14156
14402
|
entries
|
|
14157
14403
|
};
|
|
14158
14404
|
}
|
|
14159
14405
|
|
|
14160
|
-
function LayoutGroup(field, editField) {
|
|
14406
|
+
function LayoutGroup(field, editField, getService) {
|
|
14161
14407
|
const {
|
|
14162
14408
|
type
|
|
14163
14409
|
} = field;
|
|
14410
|
+
const translate = getService('translate');
|
|
14164
14411
|
if (type === 'default') {
|
|
14165
14412
|
return null;
|
|
14166
14413
|
}
|
|
@@ -14173,36 +14420,39 @@ function LayoutGroup(field, editField) {
|
|
|
14173
14420
|
}
|
|
14174
14421
|
return {
|
|
14175
14422
|
id: 'layout',
|
|
14176
|
-
label: 'Layout',
|
|
14423
|
+
label: translate('Layout'),
|
|
14177
14424
|
entries
|
|
14178
14425
|
};
|
|
14179
14426
|
}
|
|
14180
14427
|
|
|
14181
|
-
function SecurityAttributesGroup(field, editField) {
|
|
14428
|
+
function SecurityAttributesGroup(field, editField, getService) {
|
|
14182
14429
|
const {
|
|
14183
14430
|
type
|
|
14184
14431
|
} = field;
|
|
14432
|
+
const translate = getService('translate');
|
|
14185
14433
|
if (type !== 'iframe') {
|
|
14186
14434
|
return null;
|
|
14187
14435
|
}
|
|
14188
14436
|
const entries = createEntries({
|
|
14189
14437
|
field,
|
|
14190
|
-
editField
|
|
14438
|
+
editField,
|
|
14439
|
+
translate
|
|
14191
14440
|
});
|
|
14192
14441
|
if (!entries.length) {
|
|
14193
14442
|
return null;
|
|
14194
14443
|
}
|
|
14195
14444
|
return {
|
|
14196
14445
|
id: 'securityAttributes',
|
|
14197
|
-
label: 'Security attributes',
|
|
14446
|
+
label: translate('Security attributes'),
|
|
14198
14447
|
entries,
|
|
14199
|
-
tooltip: getTooltip()
|
|
14448
|
+
tooltip: getTooltip(translate)
|
|
14200
14449
|
};
|
|
14201
14450
|
}
|
|
14202
14451
|
function createEntries(props) {
|
|
14203
14452
|
const {
|
|
14204
14453
|
editField,
|
|
14205
|
-
field
|
|
14454
|
+
field,
|
|
14455
|
+
translate
|
|
14206
14456
|
} = props;
|
|
14207
14457
|
const securityEntries = SECURITY_ATTRIBUTES_DEFINITIONS.map(definition => {
|
|
14208
14458
|
const {
|
|
@@ -14211,7 +14461,7 @@ function createEntries(props) {
|
|
|
14211
14461
|
} = definition;
|
|
14212
14462
|
return simpleBoolEntryFactory({
|
|
14213
14463
|
id: property,
|
|
14214
|
-
label: label,
|
|
14464
|
+
label: translate(label),
|
|
14215
14465
|
isDefaultVisible: field => field.type === 'iframe',
|
|
14216
14466
|
path: ['security', property],
|
|
14217
14467
|
props,
|
|
@@ -14223,32 +14473,37 @@ function createEntries(props) {
|
|
|
14223
14473
|
});
|
|
14224
14474
|
});
|
|
14225
14475
|
return [{
|
|
14226
|
-
component: Advisory
|
|
14476
|
+
component: () => Advisory({
|
|
14477
|
+
translate
|
|
14478
|
+
})
|
|
14227
14479
|
}, ...securityEntries];
|
|
14228
14480
|
}
|
|
14229
14481
|
const Advisory = props => {
|
|
14482
|
+
const {
|
|
14483
|
+
translate
|
|
14484
|
+
} = props;
|
|
14230
14485
|
return jsx("div", {
|
|
14231
14486
|
class: "bio-properties-panel-description fjs-properties-panel-detached-description",
|
|
14232
|
-
children:
|
|
14487
|
+
children: translate('These options can incur security risks, especially if used in combination with dynamic links. Ensure that you are aware of them, that you trust the source url and only enable what your use case requires.')
|
|
14233
14488
|
});
|
|
14234
14489
|
};
|
|
14235
14490
|
|
|
14236
14491
|
// helpers //////////
|
|
14237
14492
|
|
|
14238
|
-
function getTooltip() {
|
|
14493
|
+
function getTooltip(translate) {
|
|
14239
14494
|
return jsx(Fragment$1, {
|
|
14240
14495
|
children: jsxs("p", {
|
|
14241
|
-
children: [
|
|
14496
|
+
children: [translate('Allow the iframe to access more functionality of your browser, details regarding the various options can be found in the'), ' ', jsx("a", {
|
|
14242
14497
|
target: "_blank",
|
|
14243
14498
|
href: "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe",
|
|
14244
14499
|
rel: "noreferrer",
|
|
14245
|
-
children:
|
|
14500
|
+
children: translate('MDN iFrame documentation.')
|
|
14246
14501
|
})]
|
|
14247
14502
|
})
|
|
14248
14503
|
});
|
|
14249
14504
|
}
|
|
14250
14505
|
|
|
14251
|
-
function ConditionGroup(field, editField) {
|
|
14506
|
+
function ConditionGroup(field, editField, getService) {
|
|
14252
14507
|
const {
|
|
14253
14508
|
type
|
|
14254
14509
|
} = field;
|
|
@@ -14259,18 +14514,20 @@ function ConditionGroup(field, editField) {
|
|
|
14259
14514
|
field,
|
|
14260
14515
|
editField
|
|
14261
14516
|
})];
|
|
14517
|
+
const translate = getService('translate');
|
|
14262
14518
|
return {
|
|
14263
14519
|
id: 'condition',
|
|
14264
|
-
label: 'Condition',
|
|
14520
|
+
label: translate('Condition'),
|
|
14265
14521
|
entries
|
|
14266
14522
|
};
|
|
14267
14523
|
}
|
|
14268
14524
|
|
|
14269
|
-
function TableHeaderGroups(field, editField) {
|
|
14525
|
+
function TableHeaderGroups(field, editField, getService) {
|
|
14270
14526
|
const {
|
|
14271
14527
|
type,
|
|
14272
14528
|
id: fieldId
|
|
14273
14529
|
} = field;
|
|
14530
|
+
const translate = getService('translate');
|
|
14274
14531
|
if (type !== 'table') {
|
|
14275
14532
|
return [];
|
|
14276
14533
|
}
|
|
@@ -14281,12 +14538,13 @@ function TableHeaderGroups(field, editField) {
|
|
|
14281
14538
|
*/
|
|
14282
14539
|
const groups = [{
|
|
14283
14540
|
id: `${fieldId}-columnsSource`,
|
|
14284
|
-
label: 'Headers source',
|
|
14285
|
-
tooltip:
|
|
14541
|
+
label: translate('Headers source'),
|
|
14542
|
+
tooltip: translate('"List of items" defines a constant, predefined set of form options.') + '\n\n' + translate('"Expression" defines options that are populated from a FEEL expression.') + '\n',
|
|
14286
14543
|
component: Group,
|
|
14287
14544
|
entries: [...HeadersSourceSelectEntry({
|
|
14288
14545
|
field,
|
|
14289
|
-
editField
|
|
14546
|
+
editField,
|
|
14547
|
+
translate
|
|
14290
14548
|
}), ...ColumnsExpressionEntry({
|
|
14291
14549
|
field,
|
|
14292
14550
|
editField
|
|
@@ -14296,8 +14554,11 @@ function TableHeaderGroups(field, editField) {
|
|
|
14296
14554
|
const id = `${fieldId}-columns`;
|
|
14297
14555
|
groups.push({
|
|
14298
14556
|
id,
|
|
14299
|
-
label: 'Header items',
|
|
14300
|
-
component: ListGroup
|
|
14557
|
+
label: translate('Header items'),
|
|
14558
|
+
component: props => ListGroup({
|
|
14559
|
+
...props,
|
|
14560
|
+
translate
|
|
14561
|
+
}),
|
|
14301
14562
|
...StaticColumnsSourceEntry({
|
|
14302
14563
|
field,
|
|
14303
14564
|
editField,
|
|
@@ -14308,13 +14569,6 @@ function TableHeaderGroups(field, editField) {
|
|
|
14308
14569
|
return groups;
|
|
14309
14570
|
}
|
|
14310
14571
|
|
|
14311
|
-
// helpers //////////
|
|
14312
|
-
|
|
14313
|
-
const TOOLTIP_TEXT = `"List of items" defines a constant, predefined set of form options.
|
|
14314
|
-
|
|
14315
|
-
"Expression" defines options that are populated from a FEEL expression.
|
|
14316
|
-
`;
|
|
14317
|
-
|
|
14318
14572
|
class PropertiesProvider {
|
|
14319
14573
|
constructor(propertiesPanel, injector) {
|
|
14320
14574
|
this._injector = injector;
|
|
@@ -14350,7 +14604,7 @@ class PropertiesProvider {
|
|
|
14350
14604
|
return groups;
|
|
14351
14605
|
}
|
|
14352
14606
|
const getService = (type, strict = true) => this._injector.get(type, strict);
|
|
14353
|
-
groups = [...groups, GeneralGroup(field, editField, getService), ...OptionsGroups(field, editField, getService), ...TableHeaderGroups(field, editField), SecurityAttributesGroup(field, editField), ConditionGroup(field, editField), LayoutGroup(field, editField), AppearanceGroup(field, editField), SerializationGroup(field, editField), ConstraintsGroup(field, editField), ValidationGroup(field, editField), CustomPropertiesGroup(field, editField)].filter(group => group != null);
|
|
14607
|
+
groups = [...groups, GeneralGroup(field, editField, getService), ...OptionsGroups(field, editField, getService), ...TableHeaderGroups(field, editField, getService), SecurityAttributesGroup(field, editField, getService), ConditionGroup(field, editField, getService), LayoutGroup(field, editField, getService), AppearanceGroup(field, editField, getService), SerializationGroup(field, editField, getService), ConstraintsGroup(field, editField, getService), ValidationGroup(field, editField, getService), CustomPropertiesGroup(field, editField, getService)].filter(group => group != null);
|
|
14354
14608
|
this._filterVisibleEntries(groups, field, getService);
|
|
14355
14609
|
|
|
14356
14610
|
// contract: if a group has no entries or items, it should not be displayed at all
|
|
@@ -14584,9 +14838,10 @@ var SvgRepeat = function SvgRepeat(props) {
|
|
|
14584
14838
|
};
|
|
14585
14839
|
|
|
14586
14840
|
class EditorRepeatRenderManager {
|
|
14587
|
-
constructor(formFields, formFieldRegistry) {
|
|
14841
|
+
constructor(formFields, formFieldRegistry, translate) {
|
|
14588
14842
|
this._formFields = formFields;
|
|
14589
14843
|
this._formFieldRegistry = formFieldRegistry;
|
|
14844
|
+
this._translate = translate;
|
|
14590
14845
|
this.RepeatFooter = this.RepeatFooter.bind(this);
|
|
14591
14846
|
}
|
|
14592
14847
|
|
|
@@ -14608,12 +14863,12 @@ class EditorRepeatRenderManager {
|
|
|
14608
14863
|
return jsxs("div", {
|
|
14609
14864
|
className: "fjs-repeat-render-footer",
|
|
14610
14865
|
children: [jsx(SvgRepeat, {}), jsx("span", {
|
|
14611
|
-
children:
|
|
14866
|
+
children: this._translate('Repeatable')
|
|
14612
14867
|
})]
|
|
14613
14868
|
});
|
|
14614
14869
|
}
|
|
14615
14870
|
}
|
|
14616
|
-
EditorRepeatRenderManager.$inject = ['formFields', 'formFieldRegistry'];
|
|
14871
|
+
EditorRepeatRenderManager.$inject = ['formFields', 'formFieldRegistry', 'translate'];
|
|
14617
14872
|
|
|
14618
14873
|
const RepeatRenderModule = {
|
|
14619
14874
|
__init__: ['repeatRenderManager'],
|
|
@@ -14841,7 +15096,7 @@ class FormEditor {
|
|
|
14841
15096
|
config: ['value', enrichedConfig]
|
|
14842
15097
|
}, {
|
|
14843
15098
|
formEditor: ['value', this]
|
|
14844
|
-
}, CoreModule, ...modules, ...additionalModules]);
|
|
15099
|
+
}, TranslateModule, CoreModule, ...modules, ...additionalModules]);
|
|
14845
15100
|
}
|
|
14846
15101
|
|
|
14847
15102
|
/**
|