@bpmn-io/form-js-editor 1.25.0 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/assets/form-js-editor-base.css +2 -0
  2. package/dist/assets/form-js-editor.css +2 -0
  3. package/dist/index.cjs +656 -401
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.es.js +656 -401
  6. package/dist/index.es.js.map +1 -1
  7. package/dist/types/core/FormLayoutValidator.d.ts +8 -2
  8. package/dist/types/features/context-pad/DeleteActionProvider.d.ts +2 -1
  9. package/dist/types/features/dragging/Dragging.d.ts +1 -1
  10. package/dist/types/features/properties-panel/entries/AcceptEntry.d.ts +4 -0
  11. package/dist/types/features/properties-panel/entries/ColumnEntry.d.ts +1 -0
  12. package/dist/types/features/properties-panel/entries/ColumnsExpressionEntry.d.ts +1 -0
  13. package/dist/types/features/properties-panel/entries/DateTimeEntry.d.ts +1 -0
  14. package/dist/types/features/properties-panel/entries/DefaultValueEntry.d.ts +1 -1
  15. package/dist/types/features/properties-panel/entries/DisabledEntry.d.ts +1 -0
  16. package/dist/types/features/properties-panel/entries/DocumentsDataSource.d.ts +4 -0
  17. package/dist/types/features/properties-panel/entries/HeadersSourceSelectEntry.d.ts +1 -0
  18. package/dist/types/features/properties-panel/entries/HeightEntry.d.ts +4 -0
  19. package/dist/types/features/properties-panel/entries/IFrameUrlEntry.d.ts +1 -0
  20. package/dist/types/features/properties-panel/entries/InputKeyOptionsSourceEntry.d.ts +4 -0
  21. package/dist/types/features/properties-panel/entries/MaxHeightEntry.d.ts +4 -0
  22. package/dist/types/features/properties-panel/entries/NumberEntries.d.ts +4 -0
  23. package/dist/types/features/properties-panel/entries/OptionsSourceSelectEntry.d.ts +1 -0
  24. package/dist/types/features/properties-panel/entries/PaginationEntry.d.ts +1 -0
  25. package/dist/types/features/properties-panel/entries/RowCountEntry.d.ts +1 -0
  26. package/dist/types/features/properties-panel/entries/TableDataSourceEntry.d.ts +4 -0
  27. package/dist/types/features/properties-panel/entries/TextEntry.d.ts +1 -0
  28. package/dist/types/features/properties-panel/groups/AppearanceGroup.d.ts +1 -1
  29. package/dist/types/features/properties-panel/groups/ConditionGroup.d.ts +2 -2
  30. package/dist/types/features/properties-panel/groups/ConstraintsGroup.d.ts +2 -2
  31. package/dist/types/features/properties-panel/groups/CustomPropertiesGroup.d.ts +4 -4
  32. package/dist/types/features/properties-panel/groups/GeneralGroup.d.ts +1 -1
  33. package/dist/types/features/properties-panel/groups/LayoutGroup.d.ts +2 -2
  34. package/dist/types/features/properties-panel/groups/SecurityAttributesGroup.d.ts +3 -3
  35. package/dist/types/features/properties-panel/groups/SerializationGroup.d.ts +2 -2
  36. package/dist/types/features/properties-panel/groups/TableHeaderGroups.d.ts +1 -1
  37. package/dist/types/features/properties-panel/groups/ValidationGroup.d.ts +3 -2
  38. package/dist/types/features/repeat-render/EditorRepeatRenderManager.d.ts +2 -1
  39. package/package.json +7 -3
package/dist/index.cjs CHANGED
@@ -43,6 +43,46 @@ function _interopNamespaceDefault(e) {
43
43
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
44
44
  var focusTrap__namespace = /*#__PURE__*/_interopNamespaceDefault(focusTrap);
45
45
 
46
+ /**
47
+ * @typedef { {
48
+ * [key: string]: string;
49
+ * } } TranslateReplacements
50
+ */
51
+
52
+ /**
53
+ * A simple translation stub to be used for multi-language support
54
+ * in diagrams. Can be easily replaced with a more sophisticated
55
+ * solution.
56
+ *
57
+ * @example
58
+ *
59
+ * ```javascript
60
+ * // use it inside any diagram component by injecting `translate`.
61
+ *
62
+ * function MyService(translate) {
63
+ * alert(translate('HELLO {you}', { you: 'You!' }));
64
+ * }
65
+ * ```
66
+ *
67
+ * @param {string} template to interpolate
68
+ * @param {TranslateReplacements} [replacements] a map with substitutes
69
+ *
70
+ * @return {string} the translated string
71
+ */
72
+ function translate(template, replacements) {
73
+ replacements = replacements || {};
74
+ return template.replace(/{([^}]+)}/g, function (_, key) {
75
+ return replacements[key] || '{' + key + '}';
76
+ });
77
+ }
78
+
79
+ /**
80
+ * @type { import('didi').ModuleDeclaration }
81
+ */
82
+ var TranslateModule = {
83
+ translate: ['value', translate]
84
+ };
85
+
46
86
  var FN_REF = '__fn';
47
87
  var DEFAULT_PRIORITY$4 = 1000;
48
88
  var slice = Array.prototype.slice;
@@ -637,6 +677,10 @@ class FormFieldRegistry extends formJsViewer.FormFieldRegistry {
637
677
  }
638
678
  }
639
679
 
680
+ /**
681
+ * @typedef { import('diagram-js/lib/i18n/translate/translate').default } Translate
682
+ */
683
+
640
684
  const MAX_COLUMNS_PER_ROW = 16;
641
685
  const MAX_COLUMNS = 16;
642
686
  const MIN_COLUMNS = 2;
@@ -647,22 +691,28 @@ class FormLayoutValidator {
647
691
  *
648
692
  * @param { import('./FormLayouter').FormLayouter } formLayouter
649
693
  * @param { import('./FormFieldRegistry').FormFieldRegistry } formFieldRegistry
694
+ * @param {Translate} translate
650
695
  */
651
- constructor(formLayouter, formFieldRegistry) {
696
+ constructor(formLayouter, formFieldRegistry, translate) {
652
697
  this._formLayouter = formLayouter;
653
698
  this._formFieldRegistry = formFieldRegistry;
699
+ this._translate = translate;
654
700
  }
655
701
  validateField(field = {}, columns, row) {
656
702
  // allow empty (auto columns)
657
703
  if (Number.isInteger(columns)) {
658
704
  // allow minimum cols
659
705
  if (columns < MIN_COLUMNS) {
660
- return `Minimum ${MIN_COLUMNS} columns are allowed`;
706
+ return this._translate('Minimum {value} columns are allowed', {
707
+ value: MIN_COLUMNS.toString()
708
+ });
661
709
  }
662
710
 
663
711
  // allow maximum cols
664
712
  if (columns > MAX_COLUMNS) {
665
- return `Maximum ${MAX_COLUMNS} columns are allowed`;
713
+ return this._translate('Maximum {value} columns are allowed', {
714
+ value: MAX_COLUMNS.toString()
715
+ });
666
716
  }
667
717
  }
668
718
  if (!row) {
@@ -688,15 +738,19 @@ class FormLayoutValidator {
688
738
 
689
739
  // do not allow overflows
690
740
  if (sumColumns > MAX_COLUMNS_PER_ROW || sumAutoCols > 0 && sumColumns > calculateMaxColumnsWithAuto(sumAutoCols) || columns === MAX_COLUMNS_PER_ROW && sumFields > 1) {
691
- return `New value exceeds the maximum of ${MAX_COLUMNS_PER_ROW} columns per row`;
741
+ return this._translate('New value exceeds the maximum of {value} columns per row', {
742
+ value: MAX_COLUMNS_PER_ROW.toString()
743
+ });
692
744
  }
693
745
  if (sumFields > MAX_FIELDS_PER_ROW) {
694
- return `Maximum ${MAX_FIELDS_PER_ROW} fields per row are allowed`;
746
+ return this._translate('Maximum {value} fields per row are allowed', {
747
+ value: MAX_FIELDS_PER_ROW.toString()
748
+ });
695
749
  }
696
750
  return null;
697
751
  }
698
752
  }
699
- FormLayoutValidator.$inject = ['formLayouter', 'formFieldRegistry'];
753
+ FormLayoutValidator.$inject = ['formLayouter', 'formFieldRegistry', 'translate'];
700
754
 
701
755
  // helper //////////////////////
702
756
 
@@ -1026,6 +1080,7 @@ function EditorText(props) {
1026
1080
  const Icon = formJsViewer.iconsByType('text');
1027
1081
  const templating = useService('templating');
1028
1082
  const expressionLanguage = useService('expressionLanguage');
1083
+ const translate = useService('translate');
1029
1084
  if (!text || !text.trim()) {
1030
1085
  return jsxRuntime.jsx("div", {
1031
1086
  class: editorFormFieldClasses(type),
@@ -1033,7 +1088,7 @@ function EditorText(props) {
1033
1088
  class: "fjs-form-field-placeholder",
1034
1089
  children: [jsxRuntime.jsx(Icon, {
1035
1090
  viewBox: "0 0 54 54"
1036
- }), "Text view is empty"]
1091
+ }), translate('Text view is empty')]
1037
1092
  })
1038
1093
  });
1039
1094
  }
@@ -1044,7 +1099,7 @@ function EditorText(props) {
1044
1099
  class: "fjs-form-field-placeholder",
1045
1100
  children: [jsxRuntime.jsx(Icon, {
1046
1101
  viewBox: "0 0 54 54"
1047
- }), "Text view is populated by an expression"]
1102
+ }), translate('Text view is populated by an expression')]
1048
1103
  })
1049
1104
  });
1050
1105
  }
@@ -1055,7 +1110,7 @@ function EditorText(props) {
1055
1110
  class: "fjs-form-field-placeholder",
1056
1111
  children: [jsxRuntime.jsx(Icon, {
1057
1112
  viewBox: "0 0 54 54"
1058
- }), "Text view is templated"]
1113
+ }), translate('Text view is templated')]
1059
1114
  })
1060
1115
  });
1061
1116
  }
@@ -1074,6 +1129,7 @@ function EditorHtml(props) {
1074
1129
  const Icon = formJsViewer.iconsByType(type);
1075
1130
  const templating = useService('templating');
1076
1131
  const expressionLanguage = useService('expressionLanguage');
1132
+ const translate = useService('translate');
1077
1133
  if (!content || !content.trim()) {
1078
1134
  return jsxRuntime.jsx("div", {
1079
1135
  class: editorFormFieldClasses(type),
@@ -1081,7 +1137,7 @@ function EditorHtml(props) {
1081
1137
  class: "fjs-form-field-placeholder",
1082
1138
  children: [jsxRuntime.jsx(Icon, {
1083
1139
  viewBox: "0 0 54 54"
1084
- }), "Html view is empty"]
1140
+ }), translate('Html view is empty')]
1085
1141
  })
1086
1142
  });
1087
1143
  }
@@ -1092,7 +1148,7 @@ function EditorHtml(props) {
1092
1148
  class: "fjs-form-field-placeholder",
1093
1149
  children: [jsxRuntime.jsx(Icon, {
1094
1150
  viewBox: "0 0 54 54"
1095
- }), "Html view is populated by an expression"]
1151
+ }), translate('Html view is populated by an expression')]
1096
1152
  })
1097
1153
  });
1098
1154
  }
@@ -1103,7 +1159,7 @@ function EditorHtml(props) {
1103
1159
  class: "fjs-form-field-placeholder",
1104
1160
  children: [jsxRuntime.jsx(Icon, {
1105
1161
  viewBox: "0 0 54 54"
1106
- }), "Html view is templated"]
1162
+ }), translate('Html view is templated')]
1107
1163
  })
1108
1164
  });
1109
1165
  }
@@ -1121,16 +1177,23 @@ function EditorTable(props) {
1121
1177
  id,
1122
1178
  label
1123
1179
  } = props.field;
1180
+ const translate = useService('translate');
1124
1181
  const shouldUseMockColumns = typeof columnsExpression === 'string' && columnsExpression.length > 0 || Array.isArray(columns) && columns.length === 0;
1125
1182
  const editorColumns = shouldUseMockColumns ? [{
1126
1183
  key: '1',
1127
- label: 'Column 1'
1184
+ label: translate('Column {index}', {
1185
+ index: '1'
1186
+ })
1128
1187
  }, {
1129
1188
  key: '2',
1130
- label: 'Column 2'
1189
+ label: translate('Column {index}', {
1190
+ index: '2'
1191
+ })
1131
1192
  }, {
1132
1193
  key: '3',
1133
- label: 'Column 3'
1194
+ label: translate('Column {index}', {
1195
+ index: '3'
1196
+ })
1134
1197
  }] : columns;
1135
1198
  const prefixId = `fjs-form-${id}`;
1136
1199
  return jsxRuntime.jsxs("div", {
@@ -1213,6 +1276,7 @@ function EditorDocumentPreview(props) {
1213
1276
  field,
1214
1277
  domId
1215
1278
  } = props;
1279
+ const translate = useService('translate');
1216
1280
  const {
1217
1281
  label
1218
1282
  } = field;
@@ -1231,7 +1295,7 @@ function EditorDocumentPreview(props) {
1231
1295
  width: "32",
1232
1296
  height: "24",
1233
1297
  viewBox: "0 0 56 56"
1234
- }), "Document preview"]
1298
+ }), translate('Document preview')]
1235
1299
  })
1236
1300
  })]
1237
1301
  });
@@ -1530,6 +1594,7 @@ function PaletteEntry(props) {
1530
1594
  } = props;
1531
1595
  const modeling = useService('modeling');
1532
1596
  const formEditor = useService('formEditor');
1597
+ const translate = useService('translate');
1533
1598
  const Icon = getPaletteIcon({
1534
1599
  icon,
1535
1600
  iconUrl,
@@ -1555,7 +1620,9 @@ function PaletteEntry(props) {
1555
1620
  type: "button",
1556
1621
  class: "fjs-palette-field fjs-drag-copy fjs-no-drop",
1557
1622
  "data-field-type": type,
1558
- title: `Create ${getIndefiniteArticle(type)} ${label} element`,
1623
+ title: translate('Create {label} element', {
1624
+ label: translate(label)
1625
+ }),
1559
1626
  onKeyDown: onKeyDown,
1560
1627
  children: [Icon ? jsxRuntime.jsx(Icon, {
1561
1628
  class: "fjs-palette-field-icon",
@@ -1564,20 +1631,11 @@ function PaletteEntry(props) {
1564
1631
  viewBox: "0 0 54 54"
1565
1632
  }) : null, jsxRuntime.jsx("span", {
1566
1633
  class: "fjs-palette-field-text",
1567
- children: label
1634
+ children: translate(label)
1568
1635
  })]
1569
1636
  });
1570
1637
  }
1571
1638
 
1572
- // helpers ///////////
1573
-
1574
- function getIndefiniteArticle(type) {
1575
- if (['image'].includes(type)) {
1576
- return 'an';
1577
- }
1578
- return 'a';
1579
- }
1580
-
1581
1639
  const PALETTE_GROUPS = [{
1582
1640
  label: 'Input',
1583
1641
  id: 'basic-input'
@@ -1596,6 +1654,7 @@ const PALETTE_GROUPS = [{
1596
1654
  }];
1597
1655
  function Palette(props) {
1598
1656
  const formFields = useService('formFields');
1657
+ const translate = useService('translate');
1599
1658
  const initialPaletteEntries = hooks.useRef(collectPaletteEntries(formFields));
1600
1659
  const [paletteEntries, setPaletteEntries] = hooks.useState(initialPaletteEntries.current);
1601
1660
  const [searchTerm, setSearchTerm] = hooks.useState('');
@@ -1611,10 +1670,10 @@ function Palette(props) {
1611
1670
  if (!simplifiedSearchTerm) {
1612
1671
  return true;
1613
1672
  }
1614
- const simplifiedEntryLabel = simplifyString(entry.label);
1673
+ const simplifiedEntryLabel = simplifyString(translate(entry.label));
1615
1674
  const simplifiedEntryType = simplifyString(entry.type);
1616
1675
  return simplifiedEntryLabel.includes(simplifiedSearchTerm) || simplifiedEntryType.includes(simplifiedSearchTerm);
1617
- }, [searchTerm, simplifyString]);
1676
+ }, [searchTerm, simplifyString, translate]);
1618
1677
 
1619
1678
  // filter entries on search change
1620
1679
  hooks.useEffect(() => {
@@ -1632,8 +1691,8 @@ function Palette(props) {
1632
1691
  class: "fjs-palette",
1633
1692
  children: [jsxRuntime.jsx("div", {
1634
1693
  class: "fjs-palette-header",
1635
- title: "Components",
1636
- children: "Components"
1694
+ title: translate('Components'),
1695
+ children: translate('Components')
1637
1696
  }), jsxRuntime.jsxs("div", {
1638
1697
  class: "fjs-palette-search-container",
1639
1698
  children: [jsxRuntime.jsx("span", {
@@ -1643,12 +1702,12 @@ function Palette(props) {
1643
1702
  class: "fjs-palette-search",
1644
1703
  ref: inputRef,
1645
1704
  type: "text",
1646
- placeholder: "Search components",
1705
+ placeholder: translate('Search components'),
1647
1706
  value: searchTerm,
1648
1707
  onInput: handleInput
1649
1708
  }), searchTerm && jsxRuntime.jsx("button", {
1650
1709
  type: "button",
1651
- title: "Clear content",
1710
+ title: translate('Clear content'),
1652
1711
  class: "fjs-palette-search-clear",
1653
1712
  onClick: handleClear,
1654
1713
  children: jsxRuntime.jsx(SvgClose, {})
@@ -1664,7 +1723,7 @@ function Palette(props) {
1664
1723
  "data-group-id": id,
1665
1724
  children: [jsxRuntime.jsx("span", {
1666
1725
  class: "fjs-palette-group-title",
1667
- children: label
1726
+ children: translate(label)
1668
1727
  }), jsxRuntime.jsx("div", {
1669
1728
  class: "fjs-palette-fields fjs-drag-container fjs-no-drop",
1670
1729
  children: entries.map(entry => {
@@ -1676,7 +1735,7 @@ function Palette(props) {
1676
1735
  })]
1677
1736
  }, id)), groups.length == 0 && jsxRuntime.jsx("div", {
1678
1737
  class: "fjs-palette-no-entries",
1679
- children: "No components found."
1738
+ children: translate('No components found.')
1680
1739
  })]
1681
1740
  }), jsxRuntime.jsx("div", {
1682
1741
  class: "fjs-palette-footer",
@@ -5980,7 +6039,8 @@ var index = {
5980
6039
  function getPropertiesPanelHeaderProvider(options = {}) {
5981
6040
  const {
5982
6041
  getDocumentationRef,
5983
- formFields
6042
+ formFields,
6043
+ translate
5984
6044
  } = options;
5985
6045
  return {
5986
6046
  getElementLabel: field => {
@@ -6016,10 +6076,10 @@ function getPropertiesPanelHeaderProvider(options = {}) {
6016
6076
  type
6017
6077
  } = field;
6018
6078
  if (type === 'default') {
6019
- return 'Form';
6079
+ return translate('Form');
6020
6080
  }
6021
6081
  const fieldDefinition = formFields.get(type).config;
6022
- return fieldDefinition.name || fieldDefinition.label || type;
6082
+ return translate(fieldDefinition.name || fieldDefinition.label || type);
6023
6083
  },
6024
6084
  getDocumentationRef
6025
6085
  };
@@ -6061,6 +6121,7 @@ function PropertiesPanel() {
6061
6121
  const formFields = useService('formFields');
6062
6122
  const propertiesPanel = useService('propertiesPanel');
6063
6123
  const propertiesPanelConfig = useService('config.propertiesPanel') || EMPTY;
6124
+ const translate = useService('translate');
6064
6125
  const {
6065
6126
  feelPopupContainer
6066
6127
  } = propertiesPanelConfig;
@@ -6112,8 +6173,9 @@ function PropertiesPanel() {
6112
6173
  }, [providers, selectedFormField, editField]);
6113
6174
  const PropertiesPanelHeaderProvider = hooks.useMemo(() => getPropertiesPanelHeaderProvider({
6114
6175
  getDocumentationRef: propertiesPanelConfig.getDocumentationRef,
6115
- formFields
6116
- }), [formFields, propertiesPanelConfig]);
6176
+ formFields,
6177
+ translate
6178
+ }), [formFields, propertiesPanelConfig, translate]);
6117
6179
  return (
6118
6180
  // eslint-disable-next-line react/no-unknown-property
6119
6181
  jsxRuntime.jsx("div", {
@@ -6670,26 +6732,29 @@ function ContextPadContent(props) {
6670
6732
  }, entryId))
6671
6733
  });
6672
6734
  }
6673
- function EmptyGroup() {
6735
+ function EmptyGroup({
6736
+ translate
6737
+ }) {
6674
6738
  return jsxRuntime.jsx("div", {
6675
6739
  class: "fjs-empty-component",
6676
6740
  children: jsxRuntime.jsx("span", {
6677
6741
  class: "fjs-empty-component-text",
6678
- children: "Drag and drop components here."
6742
+ children: translate('Drag and drop components here.')
6679
6743
  })
6680
6744
  });
6681
6745
  }
6682
6746
  function EmptyForm() {
6747
+ const translate = useService('translate');
6683
6748
  return jsxRuntime.jsx("div", {
6684
6749
  class: "fjs-empty-editor",
6685
6750
  children: jsxRuntime.jsxs("div", {
6686
6751
  class: "fjs-empty-editor-card",
6687
6752
  children: [jsxRuntime.jsx(SvgEmptyForm, {}), jsxRuntime.jsx("h2", {
6688
- children: "Build your form"
6753
+ children: translate('Build your form')
6689
6754
  }), jsxRuntime.jsx("span", {
6690
- children: "Drag and drop components here to start designing."
6755
+ children: translate('Drag and drop components here to start designing.')
6691
6756
  }), jsxRuntime.jsx("span", {
6692
- children: "Use the preview window to test your form."
6757
+ children: translate('Use the preview window to test your form.')
6693
6758
  }), jsxRuntime.jsx(Slot, {
6694
6759
  name: "editor-empty-state__footer"
6695
6760
  })]
@@ -6697,8 +6762,11 @@ function EmptyForm() {
6697
6762
  });
6698
6763
  }
6699
6764
  function Empty(props) {
6765
+ const translate = useService('translate');
6700
6766
  if (['group', 'dynamiclist'].includes(props.field.type)) {
6701
- return jsxRuntime.jsx(EmptyGroup, {});
6767
+ return jsxRuntime.jsx(EmptyGroup, {
6768
+ translate: translate
6769
+ });
6702
6770
  }
6703
6771
  if (props.field.type === 'default') {
6704
6772
  return jsxRuntime.jsx(EmptyForm, {});
@@ -7281,10 +7349,11 @@ FormFieldContextActions.$inject = ['eventBus'];
7281
7349
  * @param {import('../../render/EditorFormFields').EditorFormFields} formFields
7282
7350
  */
7283
7351
  class DeleteActionProvider {
7284
- constructor(formFieldContextActions, modeling, formFieldRegistry, formFields) {
7352
+ constructor(formFieldContextActions, modeling, formFieldRegistry, formFields, translate) {
7285
7353
  this._modeling = modeling;
7286
7354
  this._formFieldRegistry = formFieldRegistry;
7287
7355
  this._formFields = formFields;
7356
+ this._translate = translate;
7288
7357
  formFieldContextActions.registerProvider(500, this);
7289
7358
  }
7290
7359
 
@@ -7299,6 +7368,7 @@ class DeleteActionProvider {
7299
7368
  const modeling = this._modeling;
7300
7369
  const formFieldRegistry = this._formFieldRegistry;
7301
7370
  const formFields = this._formFields;
7371
+ const translate = this._translate;
7302
7372
  return {
7303
7373
  delete: {
7304
7374
  action: event => {
@@ -7307,14 +7377,14 @@ class DeleteActionProvider {
7307
7377
  const index = getFormFieldIndex(parentField, formField);
7308
7378
  modeling.removeFormField(formField, parentField, index);
7309
7379
  },
7310
- title: getRemoveButtonTitle(formField, formFields),
7380
+ title: getRemoveButtonTitle(formField, formFields, translate),
7311
7381
  icon: 'delete',
7312
7382
  group: 'actions'
7313
7383
  }
7314
7384
  };
7315
7385
  }
7316
7386
  }
7317
- DeleteActionProvider.$inject = ['formFieldContextActions', 'modeling', 'formFieldRegistry', 'formFields'];
7387
+ DeleteActionProvider.$inject = ['formFieldContextActions', 'modeling', 'formFieldRegistry', 'formFields', 'translate'];
7318
7388
 
7319
7389
  // helpers //////////
7320
7390
 
@@ -7332,12 +7402,14 @@ function getFormFieldIndex(parent, formField) {
7332
7402
  function findPaletteEntry(type, formFields) {
7333
7403
  return collectPaletteEntries(formFields).find(entry => entry.type === type);
7334
7404
  }
7335
- function getRemoveButtonTitle(formField, formFields) {
7405
+ function getRemoveButtonTitle(formField, formFields, translate) {
7336
7406
  const entry = findPaletteEntry(formField.type, formFields);
7337
7407
  if (!entry) {
7338
- return 'Remove form field';
7408
+ return translate('Remove form field');
7339
7409
  }
7340
- return `Remove ${entry.label}`;
7410
+ return translate('Remove {label}', {
7411
+ label: translate(entry.label)
7412
+ });
7341
7413
  }
7342
7414
 
7343
7415
  const ContextPadModule = {
@@ -10016,6 +10088,7 @@ function Action(props) {
10016
10088
  id
10017
10089
  } = props;
10018
10090
  const path = ['action'];
10091
+ const translate = useService('translate');
10019
10092
  const getValue = () => {
10020
10093
  return minDash.get(field, path, '');
10021
10094
  };
@@ -10023,10 +10096,10 @@ function Action(props) {
10023
10096
  return editField(field, path, value);
10024
10097
  };
10025
10098
  const getOptions = () => [{
10026
- label: 'Submit',
10099
+ label: translate('Submit'),
10027
10100
  value: 'submit'
10028
10101
  }, {
10029
- label: 'Reset',
10102
+ label: translate('Reset'),
10030
10103
  value: 'reset'
10031
10104
  }];
10032
10105
  return SelectEntry({
@@ -10034,7 +10107,7 @@ function Action(props) {
10034
10107
  getOptions,
10035
10108
  getValue,
10036
10109
  id,
10037
- label: 'Action',
10110
+ label: translate('Action'),
10038
10111
  setValue
10039
10112
  });
10040
10113
  }
@@ -10062,6 +10135,7 @@ function AltText(props) {
10062
10135
  id
10063
10136
  } = props;
10064
10137
  const debounce = useService('debounce');
10138
+ const translate = useService('translate');
10065
10139
  const variables = useVariables().map(name => ({
10066
10140
  name
10067
10141
  }));
@@ -10078,8 +10152,8 @@ function AltText(props) {
10078
10152
  feel: 'optional',
10079
10153
  getValue,
10080
10154
  id,
10081
- label: 'Alternative text',
10082
- tooltip: 'Descriptive text for screen reader accessibility.',
10155
+ label: translate('Alternative text'),
10156
+ tooltip: translate('Descriptive text for screen reader accessibility.'),
10083
10157
  setValue,
10084
10158
  singleLine: true,
10085
10159
  variables
@@ -10108,6 +10182,7 @@ function Columns(props) {
10108
10182
  id
10109
10183
  } = props;
10110
10184
  useService('debounce');
10185
+ const translate = useService('translate');
10111
10186
  const formLayoutValidator = useService('formLayoutValidator');
10112
10187
  const validate = hooks.useCallback(value => {
10113
10188
  return formLayoutValidator.validateField(field, value ? parseInt(value) : null);
@@ -10125,7 +10200,7 @@ function Columns(props) {
10125
10200
  };
10126
10201
  const getOptions = () => {
10127
10202
  return [{
10128
- label: 'Auto',
10203
+ label: translate('Auto'),
10129
10204
  value: AUTO_OPTION_VALUE
10130
10205
  },
10131
10206
  // todo(pinussilvestrus): make options dependant on field type
@@ -10135,7 +10210,7 @@ function Columns(props) {
10135
10210
  return SelectEntry({
10136
10211
  element: field,
10137
10212
  id,
10138
- label: 'Columns',
10213
+ label: translate('Columns'),
10139
10214
  getOptions,
10140
10215
  getValue,
10141
10216
  setValue,
@@ -10272,6 +10347,7 @@ function Description(props) {
10272
10347
  id
10273
10348
  } = props;
10274
10349
  const debounce = useService('debounce');
10350
+ const translate = useService('translate');
10275
10351
  const variables = useVariables().map(name => ({
10276
10352
  name
10277
10353
  }));
@@ -10287,7 +10363,7 @@ function Description(props) {
10287
10363
  element: field,
10288
10364
  getValue,
10289
10365
  id,
10290
- label: 'Field description',
10366
+ label: translate('Field description'),
10291
10367
  singleLine: true,
10292
10368
  setValue,
10293
10369
  variables
@@ -10298,8 +10374,10 @@ const EMPTY_OPTION = '';
10298
10374
  function DefaultValueEntry(props) {
10299
10375
  const {
10300
10376
  editField,
10301
- field
10377
+ field,
10378
+ getService
10302
10379
  } = props;
10380
+ const translate = getService('translate');
10303
10381
  const {
10304
10382
  type
10305
10383
  } = field;
@@ -10317,7 +10395,7 @@ function DefaultValueEntry(props) {
10317
10395
  editField,
10318
10396
  field,
10319
10397
  id: 'defaultValue',
10320
- label: 'Default value'
10398
+ label: translate('Default value')
10321
10399
  };
10322
10400
  entries.push({
10323
10401
  ...defaultValueBase,
@@ -10361,16 +10439,17 @@ function DefaultValueCheckbox(props) {
10361
10439
  id,
10362
10440
  label
10363
10441
  } = props;
10442
+ const translate = useService('translate');
10364
10443
  const {
10365
10444
  defaultValue
10366
10445
  } = field;
10367
10446
  const path = ['defaultValue'];
10368
10447
  const getOptions = () => {
10369
10448
  return [{
10370
- label: 'Checked',
10449
+ label: translate('Checked'),
10371
10450
  value: 'true'
10372
10451
  }, {
10373
- label: 'Not checked',
10452
+ label: translate('Not checked'),
10374
10453
  value: 'false'
10375
10454
  }];
10376
10455
  };
@@ -10401,6 +10480,7 @@ function DefaultValueNumber(props) {
10401
10480
  serializeToString = false
10402
10481
  } = field;
10403
10482
  const debounce = useService('debounce');
10483
+ const translate = useService('translate');
10404
10484
  const path = ['defaultValue'];
10405
10485
  const getValue = e => {
10406
10486
  let value = minDash.get(field, path);
@@ -10425,12 +10505,14 @@ function DefaultValueNumber(props) {
10425
10505
  return;
10426
10506
  }
10427
10507
  if (!isValidNumber(value)) {
10428
- return 'Should be a valid number';
10508
+ return translate('Should be a valid number.');
10429
10509
  }
10430
10510
  if (decimalDigitsSet && countDecimals(value) > decimalDigits) {
10431
- return `Should not contain more than ${decimalDigits} decimal digits`;
10511
+ return translate('Should not contain more than {value} decimal digits.', {
10512
+ value: decimalDigits.toString()
10513
+ });
10432
10514
  }
10433
- }, [decimalDigitsSet, decimalDigits]);
10515
+ }, [decimalDigitsSet, decimalDigits, translate]);
10434
10516
  return TextfieldEntry({
10435
10517
  debounce,
10436
10518
  label,
@@ -10452,10 +10534,11 @@ function DefaultValueSingleSelect(props) {
10452
10534
  defaultValue = EMPTY_OPTION,
10453
10535
  values = []
10454
10536
  } = field;
10537
+ const translate = useService('translate');
10455
10538
  const path = ['defaultValue'];
10456
10539
  const getOptions = () => {
10457
10540
  return [{
10458
- label: '<none>',
10541
+ label: translate('<none>'),
10459
10542
  value: EMPTY_OPTION
10460
10543
  }, ...values];
10461
10544
  };
@@ -10541,16 +10624,19 @@ function parseBooleanToString(value) {
10541
10624
  function DisabledEntry(props) {
10542
10625
  const {
10543
10626
  editField,
10544
- field
10627
+ field,
10628
+ getService
10545
10629
  } = props;
10546
10630
  const entries = [];
10631
+ const translate = getService('translate');
10547
10632
  entries.push({
10548
10633
  id: 'disabled',
10549
10634
  component: Disabled,
10550
10635
  editField: editField,
10551
10636
  field: field,
10552
10637
  isEdited: isEdited$7,
10553
- isDefaultVisible: field => INPUTS.includes(field.type)
10638
+ isDefaultVisible: field => INPUTS.includes(field.type),
10639
+ translate: translate
10554
10640
  });
10555
10641
  return entries;
10556
10642
  }
@@ -10558,7 +10644,8 @@ function Disabled(props) {
10558
10644
  const {
10559
10645
  editField,
10560
10646
  field,
10561
- id
10647
+ id,
10648
+ translate
10562
10649
  } = props;
10563
10650
  const path = ['disabled'];
10564
10651
  const getValue = () => {
@@ -10571,8 +10658,8 @@ function Disabled(props) {
10571
10658
  element: field,
10572
10659
  getValue,
10573
10660
  id,
10574
- label: 'Disabled',
10575
- 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.',
10661
+ label: translate('Disabled'),
10662
+ 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.'),
10576
10663
  inline: true,
10577
10664
  setValue
10578
10665
  });
@@ -10602,6 +10689,7 @@ function Id(props) {
10602
10689
  } = props;
10603
10690
  const formFieldRegistry = useService('formFieldRegistry');
10604
10691
  const debounce = useService('debounce');
10692
+ const translate = useService('translate');
10605
10693
  const path = ['id'];
10606
10694
  const getValue = () => {
10607
10695
  return minDash.get(field, path, '');
@@ -10614,20 +10702,20 @@ function Id(props) {
10614
10702
  };
10615
10703
  const validate = hooks.useCallback(value => {
10616
10704
  if (typeof value !== 'string' || value.length === 0) {
10617
- return 'Must not be empty.';
10705
+ return translate('Must not be empty.');
10618
10706
  }
10619
10707
  const assigned = formFieldRegistry._ids.assigned(value);
10620
10708
  if (assigned && assigned !== field) {
10621
- return 'Must be unique.';
10709
+ return translate('Must be unique.');
10622
10710
  }
10623
- return validateId(value) || null;
10624
- }, [formFieldRegistry, field]);
10711
+ return validateId(value, translate) || null;
10712
+ }, [formFieldRegistry, field, translate]);
10625
10713
  return TextfieldEntry({
10626
10714
  debounce,
10627
10715
  element: field,
10628
10716
  getValue,
10629
10717
  id,
10630
- label: 'ID',
10718
+ label: translate('ID'),
10631
10719
  setValue,
10632
10720
  validate
10633
10721
  });
@@ -10642,15 +10730,15 @@ const QNAME_REGEX = /^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i;
10642
10730
 
10643
10731
  // for ID validation as per BPMN Schema (QName - Namespace)
10644
10732
  const ID_REGEX = /^[a-z_][\w-.]*$/i;
10645
- function validateId(idValue) {
10733
+ function validateId(idValue, translate) {
10646
10734
  if (containsSpace(idValue)) {
10647
- return 'Must not contain spaces.';
10735
+ return translate('Must not contain spaces.');
10648
10736
  }
10649
10737
  if (!ID_REGEX.test(idValue)) {
10650
10738
  if (QNAME_REGEX.test(idValue)) {
10651
- return 'Must not contain prefix.';
10739
+ return translate('Must not contain prefix.');
10652
10740
  }
10653
- return 'Must be a valid QName.';
10741
+ return translate('Must be a valid QName.');
10654
10742
  }
10655
10743
  }
10656
10744
  function containsSpace(value) {
@@ -10688,6 +10776,7 @@ function Key$2(props) {
10688
10776
  } = props;
10689
10777
  const pathRegistry = useService('pathRegistry');
10690
10778
  const debounce = useService('debounce');
10779
+ const translate = useService('translate');
10691
10780
  const path = ['key'];
10692
10781
  const getValue = () => {
10693
10782
  return minDash.get(field, path, '');
@@ -10703,16 +10792,16 @@ function Key$2(props) {
10703
10792
  return null;
10704
10793
  }
10705
10794
  if (!minDash.isString(value) || value.length === 0) {
10706
- return 'Must not be empty.';
10795
+ return translate('Must not be empty.');
10707
10796
  }
10708
10797
  if (!isValidDotPath(value)) {
10709
- return 'Must be a variable or a dot separated path.';
10798
+ return translate('Must be a variable or a dot separated path.');
10710
10799
  }
10711
10800
  if (hasIntegerPathSegment(value)) {
10712
- return 'Must not contain numerical path segments.';
10801
+ return translate('Must not contain numerical path segments.');
10713
10802
  }
10714
10803
  if (isProhibitedPath(value)) {
10715
- return 'Must not be a prohibited path.';
10804
+ return translate('Must not be a prohibited path.');
10716
10805
  }
10717
10806
  const replacements = {
10718
10807
  [field.id]: value.split('.')
@@ -10732,16 +10821,16 @@ function Key$2(props) {
10732
10821
  isClosed: true,
10733
10822
  claimerId: field.id
10734
10823
  });
10735
- return canClaim ? null : 'Must not conflict with other key/path assignments.';
10736
- }, [field, pathRegistry]);
10824
+ return canClaim ? null : translate('Must not conflict with other key/path assignments.');
10825
+ }, [field, pathRegistry, translate]);
10737
10826
  return TextfieldEntry({
10738
10827
  debounce,
10739
- description: 'Binds to a form variable',
10828
+ description: translate('Binds to a form variable'),
10740
10829
  element: field,
10741
10830
  getValue,
10742
10831
  id,
10743
- label: 'Key',
10744
- 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.',
10832
+ label: translate('Key'),
10833
+ 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.'),
10745
10834
  setValue,
10746
10835
  validate
10747
10836
  });
@@ -10780,6 +10869,7 @@ function Path(props) {
10780
10869
  const fieldConfig = useService('formFields').get(field.type).config;
10781
10870
  const isRepeating = fieldConfig.repeatable && field.isRepeating;
10782
10871
  const path = ['path'];
10872
+ const translate = useService('translate');
10783
10873
  const getValue = () => {
10784
10874
  return minDash.get(field, path, '');
10785
10875
  };
@@ -10791,7 +10881,7 @@ function Path(props) {
10791
10881
  };
10792
10882
  const validate = hooks.useCallback(value => {
10793
10883
  if (!value && isRepeating) {
10794
- return 'Must not be empty';
10884
+ return translate('Must not be empty');
10795
10885
  }
10796
10886
 
10797
10887
  // Early return for empty value in non-repeating cases or if the field path hasn't changed
@@ -10801,18 +10891,18 @@ function Path(props) {
10801
10891
 
10802
10892
  // Validate dot-separated path format
10803
10893
  if (!isValidDotPath(value)) {
10804
- const msg = isRepeating ? 'Must be a variable or a dot-separated path' : 'Must be empty, a variable or a dot-separated path';
10894
+ const msg = isRepeating ? translate('Must be a variable or a dot-separated path.') : translate('Must be empty, a variable or a dot-separated path.');
10805
10895
  return msg;
10806
10896
  }
10807
10897
 
10808
10898
  // Check for integer segments in the path
10809
10899
  if (hasIntegerPathSegment(value)) {
10810
- return 'Must not contain numerical path segments.';
10900
+ return translate('Must not contain numerical path segments.');
10811
10901
  }
10812
10902
 
10813
10903
  // Check for special prohibited paths
10814
10904
  if (isProhibitedPath(value)) {
10815
- return 'Must not be a prohibited path.';
10905
+ return translate('Must not be a prohibited path.');
10816
10906
  }
10817
10907
 
10818
10908
  // Check for path collisions
@@ -10834,20 +10924,20 @@ function Path(props) {
10834
10924
  });
10835
10925
  });
10836
10926
  if (!canClaim) {
10837
- return 'Must not cause two binding paths to collide';
10927
+ return translate('Must not cause two binding paths to collide');
10838
10928
  }
10839
10929
 
10840
10930
  // If all checks pass
10841
10931
  return null;
10842
- }, [field, isRepeating, pathRegistry]);
10843
- 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.';
10932
+ }, [field, isRepeating, pathRegistry, translate]);
10933
+ 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.');
10844
10934
  return TextfieldEntry({
10845
10935
  debounce,
10846
- description: 'Where the child variables of this component are pathed to.',
10936
+ description: translate('Where the child variables of this component are pathed to.'),
10847
10937
  element: field,
10848
10938
  getValue,
10849
10939
  id,
10850
- label: 'Path',
10940
+ label: translate('Path'),
10851
10941
  tooltip,
10852
10942
  setValue,
10853
10943
  validate
@@ -10987,6 +11077,7 @@ const SimpleRangeIntegerEntry = props => {
10987
11077
  max = Number.MAX_SAFE_INTEGER
10988
11078
  } = props;
10989
11079
  const debounce = useService('debounce');
11080
+ const translate = useService('translate');
10990
11081
  const getValue = () => {
10991
11082
  const value = minDash.get(field, path);
10992
11083
  const isValid = isValidNumber(value) && Number.isInteger(value);
@@ -11003,15 +11094,19 @@ const SimpleRangeIntegerEntry = props => {
11003
11094
  return;
11004
11095
  }
11005
11096
  if (!Number.isInteger(Number(value))) {
11006
- return 'Should be an integer.';
11097
+ return translate('Should be an integer.');
11007
11098
  }
11008
11099
  if (Big(value).cmp(min) < 0) {
11009
- return `Should be at least ${min}.`;
11100
+ return translate('Should be at least {value}.', {
11101
+ value: min.toString()
11102
+ });
11010
11103
  }
11011
11104
  if (Big(value).cmp(max) > 0) {
11012
- return `Should be at most ${max}.`;
11105
+ return translate('Should be at most {value}.', {
11106
+ value: max.toString()
11107
+ });
11013
11108
  }
11014
- }, [min, max]);
11109
+ }, [min, max, translate]);
11015
11110
  return TextfieldEntry({
11016
11111
  debounce,
11017
11112
  label,
@@ -11025,7 +11120,8 @@ const SimpleRangeIntegerEntry = props => {
11025
11120
 
11026
11121
  function GroupAppearanceEntry(props) {
11027
11122
  const {
11028
- field
11123
+ field,
11124
+ translate
11029
11125
  } = props;
11030
11126
  const {
11031
11127
  type
@@ -11036,7 +11132,7 @@ function GroupAppearanceEntry(props) {
11036
11132
  const entries = [simpleBoolEntryFactory({
11037
11133
  id: 'showOutline',
11038
11134
  path: ['showOutline'],
11039
- label: 'Show outline',
11135
+ label: translate('Show outline'),
11040
11136
  isTrueDefault: true,
11041
11137
  props
11042
11138
  })];
@@ -11089,6 +11185,7 @@ function Label$2(props) {
11089
11185
  id
11090
11186
  } = props;
11091
11187
  const debounce = useService('debounce');
11188
+ const translate = useService('translate');
11092
11189
  const variables = useVariables().map(name => ({
11093
11190
  name
11094
11191
  }));
@@ -11099,7 +11196,7 @@ function Label$2(props) {
11099
11196
  const setValue = value => {
11100
11197
  return editField(field, path, value || '');
11101
11198
  };
11102
- const label = getLabelText(field.type);
11199
+ const label = translate(getLabelText(field.type));
11103
11200
  return FeelTemplatingEntry({
11104
11201
  debounce,
11105
11202
  element: field,
@@ -11118,6 +11215,7 @@ function DateLabel(props) {
11118
11215
  id
11119
11216
  } = props;
11120
11217
  const debounce = useService('debounce');
11218
+ const translate = useService('translate');
11121
11219
  const variables = useVariables().map(name => ({
11122
11220
  name
11123
11221
  }));
@@ -11133,7 +11231,7 @@ function DateLabel(props) {
11133
11231
  element: field,
11134
11232
  getValue,
11135
11233
  id,
11136
- label: 'Date label',
11234
+ label: translate('Date label'),
11137
11235
  singleLine: true,
11138
11236
  setValue,
11139
11237
  variables
@@ -11146,6 +11244,7 @@ function TimeLabel(props) {
11146
11244
  id
11147
11245
  } = props;
11148
11246
  const debounce = useService('debounce');
11247
+ const translate = useService('translate');
11149
11248
  const variables = useVariables().map(name => ({
11150
11249
  name
11151
11250
  }));
@@ -11161,7 +11260,7 @@ function TimeLabel(props) {
11161
11260
  element: field,
11162
11261
  getValue,
11163
11262
  id,
11164
- label: 'Time label',
11263
+ label: translate('Time label'),
11165
11264
  singleLine: true,
11166
11265
  setValue,
11167
11266
  variables
@@ -11189,6 +11288,10 @@ function getLabelText(type) {
11189
11288
  }
11190
11289
  }
11191
11290
 
11291
+ /**
11292
+ * @typedef { import('diagram-js/lib/i18n/translate/translate').default } Translate
11293
+ */
11294
+
11192
11295
  function HeightEntry(props) {
11193
11296
  const {
11194
11297
  editField,
@@ -11224,6 +11327,7 @@ function Height(props) {
11224
11327
  id
11225
11328
  } = props;
11226
11329
  const debounce = useService('debounce');
11330
+ const translate = useService('translate');
11227
11331
  const getValue = e => minDash.get(field, ['height'], null);
11228
11332
  const setValue = (value, error) => {
11229
11333
  if (error) {
@@ -11234,12 +11338,12 @@ function Height(props) {
11234
11338
  return NumberFieldEntry({
11235
11339
  debounce,
11236
11340
  description,
11237
- label: 'Height',
11341
+ label: translate('Height'),
11238
11342
  element: field,
11239
11343
  id,
11240
11344
  getValue,
11241
11345
  setValue,
11242
- validate: validate$9
11346
+ validate: hooks.useCallback(value => validate$9(value, translate), [translate])
11243
11347
  });
11244
11348
  }
11245
11349
 
@@ -11247,24 +11351,26 @@ function Height(props) {
11247
11351
 
11248
11352
  /**
11249
11353
  * @param {number|void} value
11354
+ * @param {Translate} translate
11250
11355
  * @returns {string|null}
11251
11356
  */
11252
- const validate$9 = value => {
11357
+ const validate$9 = (value, translate) => {
11253
11358
  if (typeof value !== 'number') {
11254
- return 'A number is required.';
11359
+ return translate('A number is required.');
11255
11360
  }
11256
11361
  if (!Number.isInteger(value)) {
11257
- return 'Should be an integer.';
11362
+ return translate('Should be an integer.');
11258
11363
  }
11259
11364
  if (value < 1) {
11260
- return 'Should be greater than zero.';
11365
+ return translate('Should be greater than zero.');
11261
11366
  }
11262
11367
  };
11263
11368
 
11264
11369
  function IFrameHeightEntry(props) {
11370
+ const translate = props.getService('translate');
11265
11371
  return [...HeightEntry({
11266
11372
  ...props,
11267
- description: 'Height of the container in pixels.',
11373
+ description: translate('Height of the container in pixels.'),
11268
11374
  isDefaultVisible: field => field.type === 'iframe'
11269
11375
  })];
11270
11376
  }
@@ -11293,6 +11399,7 @@ function Url(props) {
11293
11399
  id
11294
11400
  } = props;
11295
11401
  const debounce = useService('debounce');
11402
+ const translate = useService('translate');
11296
11403
  const variables = useVariables().map(name => ({
11297
11404
  name
11298
11405
  }));
@@ -11309,29 +11416,29 @@ function Url(props) {
11309
11416
  feel: 'optional',
11310
11417
  getValue,
11311
11418
  id,
11312
- label: 'URL',
11419
+ label: translate('URL'),
11313
11420
  setValue,
11314
11421
  singleLine: true,
11315
- tooltip: getTooltip$1(),
11316
- validate: validate$8,
11422
+ tooltip: getTooltip$1(translate),
11423
+ validate: hooks.useCallback(value => validate$8(value, translate), [translate]),
11317
11424
  variables
11318
11425
  });
11319
11426
  }
11320
11427
 
11321
11428
  // helper //////////////////////
11322
11429
 
11323
- function getTooltip$1() {
11430
+ function getTooltip$1(translate) {
11324
11431
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
11325
11432
  children: [jsxRuntime.jsx("p", {
11326
- children: "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)."
11433
+ 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).')
11327
11434
  }), jsxRuntime.jsx("p", {
11328
- children: "Please make sure that the URL is safe as it might impose security risks."
11435
+ children: translate('Please make sure that the URL is safe as it might impose security risks.')
11329
11436
  }), jsxRuntime.jsxs("p", {
11330
- children: ["Not all external sources can be displayed in the iFrame. Read more about it in the", ' ', jsxRuntime.jsx("a", {
11437
+ children: [translate('Not all external sources can be displayed in the iFrame. Read more about it in the'), ' ', jsxRuntime.jsx("a", {
11331
11438
  target: "_blank",
11332
11439
  href: "https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options",
11333
11440
  rel: "noreferrer",
11334
- children: "X-FRAME-OPTIONS documentation"
11441
+ children: translate('X-FRAME-OPTIONS documentation')
11335
11442
  }), "."]
11336
11443
  })]
11337
11444
  });
@@ -11339,14 +11446,15 @@ function getTooltip$1() {
11339
11446
 
11340
11447
  /**
11341
11448
  * @param {string|void} value
11449
+ * @param {Translate} translate
11342
11450
  * @returns {string|null}
11343
11451
  */
11344
- const validate$8 = value => {
11452
+ const validate$8 = (value, translate) => {
11345
11453
  if (!value || value.startsWith('=')) {
11346
11454
  return;
11347
11455
  }
11348
11456
  if (!HTTPS_PATTERN.test(value)) {
11349
- return 'For security reasons the URL must start with "https".';
11457
+ return translate('For security reasons the URL must start with "https".');
11350
11458
  }
11351
11459
  };
11352
11460
 
@@ -11373,6 +11481,7 @@ function Source$1(props) {
11373
11481
  id
11374
11482
  } = props;
11375
11483
  const debounce = useService('debounce');
11484
+ const translate = useService('translate');
11376
11485
  const variables = useVariables().map(name => ({
11377
11486
  name
11378
11487
  }));
@@ -11385,13 +11494,13 @@ function Source$1(props) {
11385
11494
  };
11386
11495
  return FeelTemplatingEntry({
11387
11496
  debounce,
11388
- description: 'Expression or static value (link/data URI)',
11497
+ description: translate('Expression or static value (link/data URI)'),
11389
11498
  element: field,
11390
11499
  feel: 'optional',
11391
11500
  getValue,
11392
11501
  id,
11393
- label: 'Image source',
11394
- tooltip: 'Link referring to a hosted image, or use a data URI directly to embed image data into the form.',
11502
+ label: translate('Image source'),
11503
+ tooltip: translate('Link referring to a hosted image, or use a data URI directly to embed image data into the form.'),
11395
11504
  setValue,
11396
11505
  singleLine: true,
11397
11506
  variables
@@ -11421,6 +11530,7 @@ function Text(props) {
11421
11530
  id
11422
11531
  } = props;
11423
11532
  const debounce = useService('debounce');
11533
+ const translate = useService('translate');
11424
11534
  const variables = useVariables().map(name => ({
11425
11535
  name
11426
11536
  }));
@@ -11433,24 +11543,31 @@ function Text(props) {
11433
11543
  };
11434
11544
  return FeelTemplatingEntry({
11435
11545
  debounce,
11436
- description: description$2,
11546
+ description: description$2(translate),
11437
11547
  element: field,
11438
11548
  getValue,
11439
11549
  id,
11440
- label: 'Text',
11550
+ label: translate('Text'),
11441
11551
  hostLanguage: 'markdown',
11442
11552
  setValue,
11443
11553
  variables
11444
11554
  });
11445
11555
  }
11446
- const description$2 = jsxRuntime.jsxs(jsxRuntime.Fragment, {
11447
- children: ["Supports markdown and templating.", ' ', jsxRuntime.jsx("a", {
11448
- href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-text/",
11449
- target: "_blank",
11450
- rel: "noreferrer",
11451
- children: "Learn more"
11452
- })]
11453
- });
11556
+
11557
+ /**
11558
+ * @param {Translate} translate
11559
+ * @returns An Element with the description
11560
+ */
11561
+ const description$2 = translate => {
11562
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
11563
+ children: [translate('Supports markdown and templating.'), ' ', jsxRuntime.jsx("a", {
11564
+ href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-text/",
11565
+ target: "_blank",
11566
+ rel: "noreferrer",
11567
+ children: translate('Learn more')
11568
+ })]
11569
+ });
11570
+ };
11454
11571
 
11455
11572
  function HtmlEntry(props) {
11456
11573
  const {
@@ -11474,6 +11591,7 @@ function Content(props) {
11474
11591
  id
11475
11592
  } = props;
11476
11593
  const debounce = useService('debounce');
11594
+ const translate = useService('translate');
11477
11595
  const variables = useVariables().map(name => ({
11478
11596
  name
11479
11597
  }));
@@ -11486,11 +11604,11 @@ function Content(props) {
11486
11604
  };
11487
11605
  return FeelTemplatingEntry({
11488
11606
  debounce,
11489
- description: description$1,
11607
+ description: description$1(translate),
11490
11608
  element: field,
11491
11609
  getValue,
11492
11610
  id,
11493
- label: 'Content',
11611
+ label: translate('Content'),
11494
11612
  hostLanguage: 'html',
11495
11613
  validate: validate$7,
11496
11614
  setValue,
@@ -11500,14 +11618,16 @@ function Content(props) {
11500
11618
 
11501
11619
  // helpers //////////
11502
11620
 
11503
- const description$1 = jsxRuntime.jsxs(jsxRuntime.Fragment, {
11504
- children: ["Supports HTML, styling, and templating. Styles are automatically scoped to the HTML component.", ' ', jsxRuntime.jsx("a", {
11505
- href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-html/",
11506
- target: "_blank",
11507
- rel: "noreferrer",
11508
- children: "Learn more"
11509
- })]
11510
- });
11621
+ const description$1 = translate => {
11622
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
11623
+ children: [translate('Supports HTML, styling, and templating. Styles are automatically scoped to the HTML component.'), ' ', jsxRuntime.jsx("a", {
11624
+ href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-html/",
11625
+ target: "_blank",
11626
+ rel: "noreferrer",
11627
+ children: translate('Learn more')
11628
+ })]
11629
+ });
11630
+ };
11511
11631
 
11512
11632
  /**
11513
11633
  * @param {string|void} value
@@ -11525,6 +11645,10 @@ const validate$7 = value => {
11525
11645
  }
11526
11646
  };
11527
11647
 
11648
+ /**
11649
+ * @typedef { import('diagram-js/lib/i18n/translate/translate').default } Translate
11650
+ */
11651
+
11528
11652
  function NumberEntries(props) {
11529
11653
  const {
11530
11654
  editField,
@@ -11557,6 +11681,7 @@ function NumberDecimalDigits(props) {
11557
11681
  id
11558
11682
  } = props;
11559
11683
  const debounce = useService('debounce');
11684
+ const translate = useService('translate');
11560
11685
  const getValue = e => minDash.get(field, ['decimalDigits']);
11561
11686
  const setValue = (value, error) => {
11562
11687
  if (error) {
@@ -11566,13 +11691,13 @@ function NumberDecimalDigits(props) {
11566
11691
  };
11567
11692
  return NumberFieldEntry({
11568
11693
  debounce,
11569
- label: 'Decimal digits',
11694
+ label: translate('Decimal digits'),
11570
11695
  element: field,
11571
11696
  step: 'any',
11572
11697
  getValue,
11573
11698
  id,
11574
11699
  setValue,
11575
- validate: validateNumberEntries
11700
+ validate: hooks.useCallback(value => validateNumberEntries(value, translate), [translate])
11576
11701
  });
11577
11702
  }
11578
11703
  function NumberArrowStep(props) {
@@ -11585,6 +11710,7 @@ function NumberArrowStep(props) {
11585
11710
  decimalDigits
11586
11711
  } = field;
11587
11712
  const debounce = useService('debounce');
11713
+ const translate = useService('translate');
11588
11714
  const getValue = e => {
11589
11715
  let value = minDash.get(field, ['increment']);
11590
11716
  if (!isValidNumber(value)) return null;
@@ -11607,24 +11733,28 @@ function NumberArrowStep(props) {
11607
11733
  return;
11608
11734
  }
11609
11735
  if (!isValidNumber(value)) {
11610
- return 'Should be a valid number.';
11736
+ return translate('Should be a valid number.');
11611
11737
  }
11612
11738
  if (Big(value).cmp(0) <= 0) {
11613
- return 'Should be greater than zero.';
11739
+ return translate('Should be greater than zero.');
11614
11740
  }
11615
11741
  if (decimalDigitsSet) {
11616
11742
  const minimumValue = Big(`1e-${decimalDigits}`);
11617
11743
  if (Big(value).cmp(minimumValue) < 0) {
11618
- return `Should be at least ${minimumValue.toString()}.`;
11744
+ return translate('Should be at least {value}.', {
11745
+ value: minimumValue.toString()
11746
+ });
11619
11747
  }
11620
11748
  if (countDecimals(value) > decimalDigits) {
11621
- return `Should not contain more than ${decimalDigits} decimal digits.`;
11749
+ return translate('Should not contain more than {value} decimal digits.', {
11750
+ value: decimalDigits.toString()
11751
+ });
11622
11752
  }
11623
11753
  }
11624
- }, [decimalDigitsSet, decimalDigits]);
11754
+ }, [decimalDigitsSet, decimalDigits, translate]);
11625
11755
  return TextfieldEntry({
11626
11756
  debounce,
11627
- label: 'Increment',
11757
+ label: translate('Increment'),
11628
11758
  element: field,
11629
11759
  getValue,
11630
11760
  id,
@@ -11637,17 +11767,18 @@ function NumberArrowStep(props) {
11637
11767
 
11638
11768
  /**
11639
11769
  * @param {number|void} value
11770
+ * @param {Translate} translate
11640
11771
  * @returns {string|void}
11641
11772
  */
11642
- const validateNumberEntries = value => {
11773
+ const validateNumberEntries = (value, translate) => {
11643
11774
  if (typeof value !== 'number') {
11644
11775
  return;
11645
11776
  }
11646
11777
  if (!Number.isInteger(value)) {
11647
- return 'Should be an integer.';
11778
+ return translate('Should be an integer.');
11648
11779
  }
11649
11780
  if (value < 0) {
11650
- return 'Should be greater than or equal to zero.';
11781
+ return translate('Should be greater than or equal to zero.');
11651
11782
  }
11652
11783
  };
11653
11784
 
@@ -11683,6 +11814,7 @@ function ExpressionFieldExpression(props) {
11683
11814
  id
11684
11815
  } = props;
11685
11816
  const debounce = useService('debounce');
11817
+ const translate = useService('translate');
11686
11818
  const variables = useVariables().map(name => ({
11687
11819
  name
11688
11820
  }));
@@ -11692,12 +11824,12 @@ function ExpressionFieldExpression(props) {
11692
11824
  };
11693
11825
  return FeelEntry({
11694
11826
  debounce,
11695
- description: 'Define an expression to calculate the value of this field',
11827
+ description: translate('Define an expression to calculate the value of this field'),
11696
11828
  element: field,
11697
11829
  feel: 'required',
11698
11830
  getValue,
11699
11831
  id,
11700
- label: 'Target value',
11832
+ label: translate('Target value'),
11701
11833
  setValue,
11702
11834
  variables
11703
11835
  });
@@ -11708,20 +11840,21 @@ function ExpressionFieldComputeOn(props) {
11708
11840
  field,
11709
11841
  id
11710
11842
  } = props;
11843
+ const translate = useService('translate');
11711
11844
  const getValue = () => field.computeOn || '';
11712
11845
  const setValue = value => {
11713
11846
  editField(field, ['computeOn'], value);
11714
11847
  };
11715
11848
  const getOptions = () => [{
11716
11849
  value: 'change',
11717
- label: 'Value changes'
11850
+ label: translate('Value changes')
11718
11851
  }, {
11719
11852
  value: 'presubmit',
11720
- label: 'Form submission'
11853
+ label: translate('Form submission')
11721
11854
  }];
11722
11855
  return SelectEntry({
11723
11856
  id,
11724
- label: 'Compute on',
11857
+ label: translate('Compute on'),
11725
11858
  getValue,
11726
11859
  setValue,
11727
11860
  getOptions
@@ -11753,6 +11886,7 @@ function SerializeToString(props) {
11753
11886
  const {
11754
11887
  defaultValue
11755
11888
  } = field;
11889
+ const translate = useService('translate');
11756
11890
  const path = ['serializeToString'];
11757
11891
  const getValue = () => {
11758
11892
  return minDash.get(field, path, '');
@@ -11768,8 +11902,8 @@ function SerializeToString(props) {
11768
11902
  element: field,
11769
11903
  getValue,
11770
11904
  id,
11771
- label: 'Output as string',
11772
- description: 'Allows arbitrary precision values',
11905
+ label: translate('Output as string'),
11906
+ description: translate('Allows arbitrary precision values'),
11773
11907
  setValue
11774
11908
  });
11775
11909
  }
@@ -11777,15 +11911,18 @@ function SerializeToString(props) {
11777
11911
  function DateTimeEntry(props) {
11778
11912
  const {
11779
11913
  editField,
11780
- field
11914
+ field,
11915
+ getService
11781
11916
  } = props;
11917
+ const translate = getService('translate');
11782
11918
  const entries = [{
11783
11919
  id: 'subtype',
11784
11920
  component: DateTimeSubtypeSelect,
11785
11921
  isEdited: isEdited$3,
11786
11922
  editField,
11787
11923
  field,
11788
- isDefaultVisible: field => field.type === 'datetime'
11924
+ isDefaultVisible: field => field.type === 'datetime',
11925
+ translate
11789
11926
  }];
11790
11927
  entries.push({
11791
11928
  id: 'use24h',
@@ -11793,7 +11930,8 @@ function DateTimeEntry(props) {
11793
11930
  isEdited: isEdited$9,
11794
11931
  editField,
11795
11932
  field,
11796
- isDefaultVisible: field => field.type === 'datetime' && (field.subtype === formJsViewer.DATETIME_SUBTYPES.TIME || field.subtype === formJsViewer.DATETIME_SUBTYPES.DATETIME)
11933
+ isDefaultVisible: field => field.type === 'datetime' && (field.subtype === formJsViewer.DATETIME_SUBTYPES.TIME || field.subtype === formJsViewer.DATETIME_SUBTYPES.DATETIME),
11934
+ translate
11797
11935
  });
11798
11936
  return entries;
11799
11937
  }
@@ -11801,7 +11939,8 @@ function DateTimeSubtypeSelect(props) {
11801
11939
  const {
11802
11940
  editField,
11803
11941
  field,
11804
- id
11942
+ id,
11943
+ translate
11805
11944
  } = props;
11806
11945
  const getValue = e => minDash.get(field, formJsViewer.DATETIME_SUBTYPE_PATH);
11807
11946
  const clearTimeConfig = () => {
@@ -11841,12 +11980,12 @@ function DateTimeSubtypeSelect(props) {
11841
11980
  };
11842
11981
  const getDatetimeSubtypes = () => {
11843
11982
  return Object.values(formJsViewer.DATETIME_SUBTYPES).map(subtype => ({
11844
- label: formJsViewer.DATETIME_SUBTYPES_LABELS[subtype],
11983
+ label: translate(formJsViewer.DATETIME_SUBTYPES_LABELS[subtype]),
11845
11984
  value: subtype
11846
11985
  }));
11847
11986
  };
11848
11987
  return SelectEntry({
11849
- label: 'Subtype',
11988
+ label: translate('Subtype'),
11850
11989
  element: field,
11851
11990
  getOptions: getDatetimeSubtypes,
11852
11991
  getValue,
@@ -11858,7 +11997,8 @@ function Use24h(props) {
11858
11997
  const {
11859
11998
  editField,
11860
11999
  field,
11861
- id
12000
+ id,
12001
+ translate
11862
12002
  } = props;
11863
12003
  const path = formJsViewer.TIME_USE24H_PATH;
11864
12004
  const getValue = () => {
@@ -11871,7 +12011,7 @@ function Use24h(props) {
11871
12011
  element: field,
11872
12012
  getValue,
11873
12013
  id,
11874
- label: 'Use 24h',
12014
+ label: translate('Use 24h'),
11875
12015
  setValue
11876
12016
  });
11877
12017
  }
@@ -11917,6 +12057,7 @@ function DisallowPassedDates(props) {
11917
12057
  id
11918
12058
  } = props;
11919
12059
  const path = formJsViewer.DATE_DISALLOW_PAST_PATH;
12060
+ const translate = useService('translate');
11920
12061
  const getValue = () => {
11921
12062
  return minDash.get(field, path, '');
11922
12063
  };
@@ -11927,7 +12068,7 @@ function DisallowPassedDates(props) {
11927
12068
  element: field,
11928
12069
  getValue,
11929
12070
  id,
11930
- label: 'Disallow past dates',
12071
+ label: translate('Disallow past dates'),
11931
12072
  setValue
11932
12073
  });
11933
12074
  }
@@ -11938,6 +12079,7 @@ function TimeIntervalSelect(props) {
11938
12079
  id
11939
12080
  } = props;
11940
12081
  const timeIntervals = [1, 5, 10, 15, 30, 60];
12082
+ const translate = useService('translate');
11941
12083
  const getValue = e => minDash.get(field, formJsViewer.TIME_INTERVAL_PATH);
11942
12084
  const setValue = value => editField(field, formJsViewer.TIME_INTERVAL_PATH, parseInt(value));
11943
12085
  const getTimeIntervals = () => {
@@ -11947,7 +12089,7 @@ function TimeIntervalSelect(props) {
11947
12089
  }));
11948
12090
  };
11949
12091
  return SelectEntry({
11950
- label: 'Time interval',
12092
+ label: translate('Time interval'),
11951
12093
  element: field,
11952
12094
  getOptions: getTimeIntervals,
11953
12095
  getValue,
@@ -11979,16 +12121,17 @@ function TimeFormatSelect(props) {
11979
12121
  field,
11980
12122
  id
11981
12123
  } = props;
12124
+ const translate = useService('translate');
11982
12125
  const getValue = e => minDash.get(field, formJsViewer.TIME_SERIALISING_FORMAT_PATH);
11983
12126
  const setValue = value => editField(field, formJsViewer.TIME_SERIALISING_FORMAT_PATH, value);
11984
12127
  const getTimeSerialisingFormats = () => {
11985
12128
  return Object.values(formJsViewer.TIME_SERIALISING_FORMATS).map(format => ({
11986
- label: formJsViewer.TIME_SERIALISINGFORMAT_LABELS[format],
12129
+ label: translate(formJsViewer.TIME_SERIALISINGFORMAT_LABELS[format]),
11987
12130
  value: format
11988
12131
  }));
11989
12132
  };
11990
12133
  return SelectEntry({
11991
- label: 'Time format',
12134
+ label: translate('Time format'),
11992
12135
  element: field,
11993
12136
  getOptions: getTimeSerialisingFormats,
11994
12137
  getValue,
@@ -11998,10 +12141,11 @@ function TimeFormatSelect(props) {
11998
12141
  }
11999
12142
 
12000
12143
  function SelectEntries(props) {
12144
+ const translate = props.getService('translate');
12001
12145
  const entries = [simpleBoolEntryFactory({
12002
12146
  id: 'searchable',
12003
12147
  path: ['searchable'],
12004
- label: 'Searchable',
12148
+ label: translate('Searchable'),
12005
12149
  props,
12006
12150
  isDefaultVisible: field => field.type === 'select'
12007
12151
  })];
@@ -12044,6 +12188,7 @@ function Label$1(props) {
12044
12188
  validateFactory
12045
12189
  } = props;
12046
12190
  const debounce = useService('debounce');
12191
+ const translate = useService('translate');
12047
12192
  const setValue = (value, error) => {
12048
12193
  if (error) {
12049
12194
  return;
@@ -12060,7 +12205,7 @@ function Label$1(props) {
12060
12205
  element: field,
12061
12206
  getValue,
12062
12207
  id,
12063
- label: 'Label',
12208
+ label: translate('Label'),
12064
12209
  setValue,
12065
12210
  validate
12066
12211
  });
@@ -12074,6 +12219,7 @@ function Value$1(props) {
12074
12219
  validateFactory
12075
12220
  } = props;
12076
12221
  const debounce = useService('debounce');
12222
+ const translate = useService('translate');
12077
12223
  const setValue = (value, error) => {
12078
12224
  if (error) {
12079
12225
  return;
@@ -12097,7 +12243,7 @@ function Value$1(props) {
12097
12243
  element: field,
12098
12244
  getValue,
12099
12245
  id,
12100
- label: 'Value',
12246
+ label: translate('Value'),
12101
12247
  setValue,
12102
12248
  validate
12103
12249
  });
@@ -12139,6 +12285,7 @@ function Key$1(props) {
12139
12285
  validateFactory
12140
12286
  } = props;
12141
12287
  const debounce = useService('debounce');
12288
+ const translate = useService('translate');
12142
12289
  const setValue = (value, error) => {
12143
12290
  if (error) {
12144
12291
  return;
@@ -12156,7 +12303,7 @@ function Key$1(props) {
12156
12303
  element: field,
12157
12304
  getValue,
12158
12305
  id,
12159
- label: 'Key',
12306
+ label: translate('Key'),
12160
12307
  setValue,
12161
12308
  validate
12162
12309
  });
@@ -12170,6 +12317,7 @@ function Value(props) {
12170
12317
  validateFactory
12171
12318
  } = props;
12172
12319
  const debounce = useService('debounce');
12320
+ const translate = useService('translate');
12173
12321
  const setValue = value => {
12174
12322
  const properties = minDash.get(field, ['properties']);
12175
12323
  const key = Object.keys(properties)[index];
@@ -12185,7 +12333,7 @@ function Value(props) {
12185
12333
  element: field,
12186
12334
  getValue,
12187
12335
  id,
12188
- label: 'Value',
12336
+ label: translate('Value'),
12189
12337
  setValue,
12190
12338
  validate: validateFactory(getValue())
12191
12339
  });
@@ -12261,21 +12409,24 @@ function OptionsSourceSelectEntry(props) {
12261
12409
  const {
12262
12410
  editField,
12263
12411
  field,
12264
- id
12412
+ id,
12413
+ translate
12265
12414
  } = props;
12266
12415
  return [{
12267
12416
  id: id + '-select',
12268
12417
  component: ValuesSourceSelect,
12269
12418
  isEdited: isOptionsSourceEdited,
12270
12419
  editField,
12271
- field
12420
+ field,
12421
+ translate
12272
12422
  }];
12273
12423
  }
12274
12424
  function ValuesSourceSelect(props) {
12275
12425
  const {
12276
12426
  editField,
12277
12427
  field,
12278
- id
12428
+ id,
12429
+ translate
12279
12430
  } = props;
12280
12431
  const getValue = formJsViewer.getOptionsSource;
12281
12432
  const setValue = value => {
@@ -12287,13 +12438,13 @@ function ValuesSourceSelect(props) {
12287
12438
  };
12288
12439
  const getOptionsSourceOptions = () => {
12289
12440
  return Object.values(formJsViewer.OPTIONS_SOURCES).map(valueSource => ({
12290
- label: formJsViewer.OPTIONS_SOURCES_LABELS[valueSource],
12441
+ label: translate(formJsViewer.OPTIONS_SOURCES_LABELS[valueSource]),
12291
12442
  value: valueSource
12292
12443
  }));
12293
12444
  };
12294
12445
  return AutoFocusSelectEntry({
12295
12446
  autoFocusEntry: getAutoFocusEntryId$1(field),
12296
- label: 'Type',
12447
+ label: translate('Type'),
12297
12448
  element: field,
12298
12449
  getOptions: getOptionsSourceOptions,
12299
12450
  getValue,
@@ -12337,10 +12488,11 @@ function InputValuesKey(props) {
12337
12488
  id
12338
12489
  } = props;
12339
12490
  const debounce = useService('debounce');
12491
+ const translate = useService('translate');
12340
12492
  const path = formJsViewer.OPTIONS_SOURCES_PATHS[formJsViewer.OPTIONS_SOURCES.INPUT];
12341
12493
  const schema = '[\n {\n "label": "dollar",\n "value": "$"\n }\n]';
12342
12494
  const tooltip = jsxRuntime.jsxs("div", {
12343
- children: ["The input property may be an array of simple values or alternatively follow this schema:", jsxRuntime.jsx("pre", {
12495
+ children: [translate('The input property may be an array of simple values or alternatively follow this schema:'), jsxRuntime.jsx("pre", {
12344
12496
  children: jsxRuntime.jsx("code", {
12345
12497
  children: schema
12346
12498
  })
@@ -12355,14 +12507,14 @@ function InputValuesKey(props) {
12355
12507
  };
12356
12508
  return TextfieldEntry({
12357
12509
  debounce,
12358
- description: 'Define which input property to populate the values from',
12510
+ description: translate('Define which input property to populate the values from'),
12359
12511
  tooltip,
12360
12512
  element: field,
12361
12513
  getValue,
12362
12514
  id,
12363
- label: 'Input values key',
12515
+ label: translate('Input values key'),
12364
12516
  setValue,
12365
- validate: validate$6
12517
+ validate: hooks.useCallback(value => validate$6(value, translate), [translate])
12366
12518
  });
12367
12519
  }
12368
12520
 
@@ -12370,14 +12522,15 @@ function InputValuesKey(props) {
12370
12522
 
12371
12523
  /**
12372
12524
  * @param {string|void} value
12525
+ * @param {Translate} translate
12373
12526
  * @returns {string|null}
12374
12527
  */
12375
- const validate$6 = value => {
12528
+ const validate$6 = (value, translate) => {
12376
12529
  if (typeof value !== 'string' || value.length === 0) {
12377
- return 'Must not be empty.';
12530
+ return translate('Must not be empty.');
12378
12531
  }
12379
12532
  if (/\s/.test(value)) {
12380
- return 'Must not contain spaces.';
12533
+ return translate('Must not contain spaces.');
12381
12534
  }
12382
12535
  return null;
12383
12536
  };
@@ -12386,7 +12539,8 @@ function StaticOptionsSourceEntry(props) {
12386
12539
  const {
12387
12540
  editField,
12388
12541
  field,
12389
- id: idPrefix
12542
+ id: idPrefix,
12543
+ translate
12390
12544
  } = props;
12391
12545
  const {
12392
12546
  values
@@ -12394,7 +12548,7 @@ function StaticOptionsSourceEntry(props) {
12394
12548
  const addEntry = e => {
12395
12549
  e.stopPropagation();
12396
12550
  const index = values.length + 1;
12397
- const entry = getIndexedEntry(index, values);
12551
+ const entry = getIndexedEntry(index, values, translate);
12398
12552
  editField(field, formJsViewer.OPTIONS_SOURCES_PATHS[formJsViewer.OPTIONS_SOURCES.STATIC], arrayAdd(values, values.length, entry));
12399
12553
  };
12400
12554
  const removeEntry = entry => {
@@ -12413,11 +12567,11 @@ function StaticOptionsSourceEntry(props) {
12413
12567
  return;
12414
12568
  }
12415
12569
  if (typeof value !== 'string' || value.length === 0) {
12416
- return 'Must not be empty.';
12570
+ return translate('Must not be empty.');
12417
12571
  }
12418
12572
  const isValueAssigned = values.find(entry => getValue(entry) === value);
12419
12573
  if (isValueAssigned) {
12420
- return 'Must be unique.';
12574
+ return translate('Must be unique.');
12421
12575
  }
12422
12576
  };
12423
12577
  };
@@ -12445,9 +12599,9 @@ function StaticOptionsSourceEntry(props) {
12445
12599
 
12446
12600
  // helper
12447
12601
 
12448
- function getIndexedEntry(index, values) {
12602
+ function getIndexedEntry(index, values, translate) {
12449
12603
  const entry = {
12450
- label: 'Value',
12604
+ label: translate('Value'),
12451
12605
  value: 'value'
12452
12606
  };
12453
12607
  while (labelOrValueIsAlreadyAssignedForIndex(index, values)) {
@@ -12510,6 +12664,7 @@ function PrefixAdorner(props) {
12510
12664
  getValue
12511
12665
  } = props;
12512
12666
  const debounce = useService('debounce');
12667
+ const translate = useService('translate');
12513
12668
  const variables = useVariables().map(name => ({
12514
12669
  name
12515
12670
  }));
@@ -12519,7 +12674,7 @@ function PrefixAdorner(props) {
12519
12674
  feel: 'optional',
12520
12675
  getValue: getValue('prefixAdorner'),
12521
12676
  id,
12522
- label: 'Prefix',
12677
+ label: translate('Prefix'),
12523
12678
  setValue: onChange('prefixAdorner'),
12524
12679
  singleLine: true,
12525
12680
  variables
@@ -12533,6 +12688,7 @@ function SuffixAdorner(props) {
12533
12688
  getValue
12534
12689
  } = props;
12535
12690
  const debounce = useService('debounce');
12691
+ const translate = useService('translate');
12536
12692
  const variables = useVariables().map(name => ({
12537
12693
  name
12538
12694
  }));
@@ -12541,7 +12697,7 @@ function SuffixAdorner(props) {
12541
12697
  element: field,
12542
12698
  getValue: getValue('suffixAdorner'),
12543
12699
  id,
12544
- label: 'Suffix',
12700
+ label: translate('Suffix'),
12545
12701
  setValue: onChange('suffixAdorner'),
12546
12702
  singleLine: true,
12547
12703
  variables
@@ -12576,6 +12732,7 @@ function Readonly(props) {
12576
12732
  id
12577
12733
  } = props;
12578
12734
  const debounce = useService('debounce');
12735
+ const translate = useService('translate');
12579
12736
  const variables = useVariables().map(name => ({
12580
12737
  name
12581
12738
  }));
@@ -12592,8 +12749,8 @@ function Readonly(props) {
12592
12749
  feel: 'optional',
12593
12750
  getValue,
12594
12751
  id,
12595
- label: 'Read only',
12596
- 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.',
12752
+ label: translate('Read only'),
12753
+ 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.'),
12597
12754
  setValue,
12598
12755
  variables
12599
12756
  });
@@ -12603,22 +12760,23 @@ function LayouterAppearanceEntry(props) {
12603
12760
  const {
12604
12761
  field
12605
12762
  } = props;
12763
+ const translate = props.translate;
12606
12764
  if (!['group', 'dynamiclist'].includes(field.type)) {
12607
12765
  return [];
12608
12766
  }
12609
12767
  const entries = [simpleSelectEntryFactory({
12610
12768
  id: 'verticalAlignment',
12611
12769
  path: ['verticalAlignment'],
12612
- label: 'Vertical alignment',
12770
+ label: translate('Vertical alignment'),
12613
12771
  optionsArray: [{
12614
12772
  value: 'start',
12615
- label: 'Top'
12773
+ label: translate('Top')
12616
12774
  }, {
12617
12775
  value: 'center',
12618
- label: 'Center'
12776
+ label: translate('Center')
12619
12777
  }, {
12620
12778
  value: 'end',
12621
- label: 'Bottom'
12779
+ label: translate('Bottom')
12622
12780
  }],
12623
12781
  props
12624
12782
  })];
@@ -12634,32 +12792,33 @@ function RepeatableEntry(props) {
12634
12792
  type
12635
12793
  } = field;
12636
12794
  const formFieldDefinition = getService('formFields').get(type);
12795
+ const translate = getService('translate');
12637
12796
  if (!formFieldDefinition || !formFieldDefinition.config.repeatable) {
12638
12797
  return [];
12639
12798
  }
12640
12799
  const entries = [simpleRangeIntegerEntryFactory({
12641
12800
  id: 'defaultRepetitions',
12642
12801
  path: ['defaultRepetitions'],
12643
- label: 'Default number of items',
12802
+ label: translate('Default number of items'),
12644
12803
  min: 1,
12645
12804
  max: 100,
12646
12805
  props
12647
12806
  }), simpleBoolEntryFactory({
12648
12807
  id: 'allowAddRemove',
12649
12808
  path: ['allowAddRemove'],
12650
- label: 'Allow add/delete items',
12809
+ label: translate('Allow add/delete items'),
12651
12810
  props
12652
12811
  }), simpleBoolEntryFactory({
12653
12812
  id: 'disableCollapse',
12654
12813
  path: ['disableCollapse'],
12655
- label: 'Disable collapse',
12814
+ label: translate('Disable collapse'),
12656
12815
  props
12657
12816
  })];
12658
12817
  if (!field.disableCollapse) {
12659
12818
  const nonCollapseItemsEntry = simpleRangeIntegerEntryFactory({
12660
12819
  id: 'nonCollapsedItems',
12661
12820
  path: ['nonCollapsedItems'],
12662
- label: 'Number of non-collapsing items',
12821
+ label: translate('Number of non-collapsing items'),
12663
12822
  min: 1,
12664
12823
  props
12665
12824
  });
@@ -12688,6 +12847,7 @@ function Condition(props) {
12688
12847
  id
12689
12848
  } = props;
12690
12849
  const debounce = useService('debounce');
12850
+ const translate = useService('translate');
12691
12851
  const variables = useVariables().map(name => ({
12692
12852
  name
12693
12853
  }));
@@ -12703,13 +12863,13 @@ function Condition(props) {
12703
12863
  hide: value
12704
12864
  });
12705
12865
  };
12706
- let label = 'Hide if';
12707
- let description = 'Condition under which the field is hidden';
12866
+ let label = translate('Hide if');
12867
+ let description = translate('Condition under which the field is hidden');
12708
12868
 
12709
12869
  // special case for expression fields which do not render
12710
12870
  if (field.type === 'expression') {
12711
- label = 'Deactivate if';
12712
- description = 'Condition under which the field is deactivated';
12871
+ label = translate('Deactivate if');
12872
+ description = translate('Condition under which the field is deactivated');
12713
12873
  }
12714
12874
  return FeelEntry({
12715
12875
  debounce,
@@ -12745,13 +12905,14 @@ function OptionsExpression(props) {
12745
12905
  id
12746
12906
  } = props;
12747
12907
  const debounce = useService('debounce');
12908
+ const translate = useService('translate');
12748
12909
  const variables = useVariables().map(name => ({
12749
12910
  name
12750
12911
  }));
12751
12912
  const path = formJsViewer.OPTIONS_SOURCES_PATHS[formJsViewer.OPTIONS_SOURCES.EXPRESSION];
12752
12913
  const schema = '[\n {\n "label": "dollar",\n "value": "$"\n }\n]';
12753
12914
  const tooltip = jsxRuntime.jsxs("div", {
12754
- children: ["The expression may result in an array of simple values or alternatively follow this schema:", jsxRuntime.jsx("pre", {
12915
+ children: [translate('The expression may result in an array of simple values or alternatively follow this schema:'), jsxRuntime.jsx("pre", {
12755
12916
  children: jsxRuntime.jsx("code", {
12756
12917
  children: schema
12757
12918
  })
@@ -12761,18 +12922,22 @@ function OptionsExpression(props) {
12761
12922
  const setValue = value => editField(field, path, value || '');
12762
12923
  return FeelEntry({
12763
12924
  debounce,
12764
- description: 'Define an expression to populate the options from.',
12925
+ description: translate('Define an expression to populate the options from.'),
12765
12926
  tooltip,
12766
12927
  element: field,
12767
12928
  feel: 'required',
12768
12929
  getValue,
12769
12930
  id,
12770
- label: 'Options expression',
12931
+ label: translate('Options expression'),
12771
12932
  setValue,
12772
12933
  variables
12773
12934
  });
12774
12935
  }
12775
12936
 
12937
+ /**
12938
+ * @typedef { import('diagram-js/lib/i18n/translate/translate').default } Translate
12939
+ */
12940
+
12776
12941
  function TableDataSourceEntry(props) {
12777
12942
  const {
12778
12943
  editField,
@@ -12796,6 +12961,7 @@ function Source(props) {
12796
12961
  id
12797
12962
  } = props;
12798
12963
  const debounce = useService('debounce');
12964
+ const translate = useService('translate');
12799
12965
  const variables = useVariables().map(name => ({
12800
12966
  name
12801
12967
  }));
@@ -12811,17 +12977,17 @@ function Source(props) {
12811
12977
  };
12812
12978
  return FeelTemplatingEntry({
12813
12979
  debounce,
12814
- description: 'Specify the source from which to populate the table',
12980
+ description: translate('Specify the source from which to populate the table'),
12815
12981
  element: field,
12816
12982
  feel: 'required',
12817
12983
  getValue,
12818
12984
  id,
12819
- label: 'Data source',
12820
- tooltip: 'Enter a form input variable that contains the data for the table or define an expression to populate the data dynamically.',
12985
+ label: translate('Data source'),
12986
+ tooltip: translate('Enter a form input variable that contains the data for the table or define an expression to populate the data dynamically.'),
12821
12987
  setValue,
12822
12988
  singleLine: true,
12823
12989
  variables,
12824
- validate: validate$5
12990
+ validate: hooks.useCallback(value => validate$5(value, translate), [translate])
12825
12991
  });
12826
12992
  }
12827
12993
 
@@ -12829,20 +12995,21 @@ function Source(props) {
12829
12995
 
12830
12996
  /**
12831
12997
  * @param {string|void} value
12998
+ * @param {Translate} translate
12832
12999
  * @returns {string|null}
12833
13000
  */
12834
- const validate$5 = value => {
13001
+ const validate$5 = (value, translate) => {
12835
13002
  if (!minDash.isString(value) || value.length === 0) {
12836
- return 'Must not be empty.';
13003
+ return translate('Must not be empty.');
12837
13004
  }
12838
13005
  if (value.startsWith('=')) {
12839
13006
  return null;
12840
13007
  }
12841
13008
  if (!isValidDotPath(value)) {
12842
- return 'Must be a variable or a dot separated path.';
13009
+ return translate('Must be a variable or a dot separated path.');
12843
13010
  }
12844
13011
  if (hasIntegerPathSegment(value)) {
12845
- return 'Must not contain numerical path segments.';
13012
+ return translate('Must not contain numerical path segments.');
12846
13013
  }
12847
13014
  return null;
12848
13015
  };
@@ -12850,8 +13017,10 @@ const validate$5 = value => {
12850
13017
  function PaginationEntry(props) {
12851
13018
  const {
12852
13019
  editField,
12853
- field
13020
+ field,
13021
+ getService
12854
13022
  } = props;
13023
+ const translate = getService('translate');
12855
13024
  const entries = [];
12856
13025
  entries.push({
12857
13026
  id: 'pagination',
@@ -12859,7 +13028,8 @@ function PaginationEntry(props) {
12859
13028
  editField: editField,
12860
13029
  field: field,
12861
13030
  isEdited: isEdited$7,
12862
- isDefaultVisible: field => field.type === 'table'
13031
+ isDefaultVisible: field => field.type === 'table',
13032
+ translate
12863
13033
  });
12864
13034
  return entries;
12865
13035
  }
@@ -12867,7 +13037,8 @@ function Pagination(props) {
12867
13037
  const {
12868
13038
  editField,
12869
13039
  field,
12870
- id
13040
+ id,
13041
+ translate
12871
13042
  } = props;
12872
13043
  const defaultRowCount = 10;
12873
13044
  const path = ['rowCount'];
@@ -12885,12 +13056,16 @@ function Pagination(props) {
12885
13056
  element: field,
12886
13057
  getValue,
12887
13058
  id,
12888
- label: 'Pagination',
13059
+ label: translate('Pagination'),
12889
13060
  inline: true,
12890
13061
  setValue
12891
13062
  });
12892
13063
  }
12893
13064
 
13065
+ /**
13066
+ * @typedef { import('diagram-js/lib/i18n/translate/translate').default } Translate
13067
+ */
13068
+
12894
13069
  const path$2 = ['rowCount'];
12895
13070
  function RowCountEntry(props) {
12896
13071
  const {
@@ -12915,6 +13090,7 @@ function RowCount(props) {
12915
13090
  id
12916
13091
  } = props;
12917
13092
  const debounce = useService('debounce');
13093
+ const translate = useService('translate');
12918
13094
  const getValue = () => minDash.get(field, path$2);
12919
13095
 
12920
13096
  /**
@@ -12930,33 +13106,31 @@ function RowCount(props) {
12930
13106
  };
12931
13107
  return NumberFieldEntry({
12932
13108
  debounce,
12933
- label: 'Number of rows per page',
13109
+ label: translate('Number of rows per page'),
12934
13110
  element: field,
12935
13111
  id,
12936
13112
  getValue,
12937
13113
  setValue,
12938
- validate: validate$4
13114
+ validate: hooks.useCallback(value => validate$4(value, translate), [translate])
12939
13115
  });
12940
13116
  }
12941
13117
 
12942
13118
  // helpers //////////
12943
13119
 
12944
13120
  /**
12945
- * @param {string|void} value
13121
+ * @param {number|undefined} value
13122
+ * @param {Translate} translate
12946
13123
  * @returns {string|null}
12947
13124
  */
12948
- const validate$4 = value => {
13125
+ const validate$4 = (value, translate) => {
12949
13126
  if (minDash.isNil(value)) {
12950
13127
  return null;
12951
13128
  }
12952
- if (!minDash.isNumber(value)) {
12953
- return 'Must be number';
12954
- }
12955
13129
  if (!Number.isInteger(value)) {
12956
- return 'Should be an integer.';
13130
+ return translate('Should be an integer.');
12957
13131
  }
12958
13132
  if (value < 1) {
12959
- return 'Should be greater than zero.';
13133
+ return translate('Should be greater than zero.');
12960
13134
  }
12961
13135
  return null;
12962
13136
  };
@@ -12971,7 +13145,6 @@ const OPTIONS = {
12971
13145
  value: 'expression'
12972
13146
  }
12973
13147
  };
12974
- const SELECT_OPTIONS = Object.values(OPTIONS);
12975
13148
  const COLUMNS_PATH = ['columns'];
12976
13149
  const COLUMNS_EXPRESSION_PATH = ['columnsExpression'];
12977
13150
  const isHeadersSourceEdited = isEditedFromDefaultFactory(OPTIONS.static.value);
@@ -12979,22 +13152,32 @@ function HeadersSourceSelectEntry(props) {
12979
13152
  const {
12980
13153
  editField,
12981
13154
  field,
12982
- id
13155
+ id,
13156
+ translate
12983
13157
  } = props;
12984
13158
  return [{
12985
13159
  id: id + '-select',
12986
13160
  component: HeadersSourceSelect,
12987
13161
  isEdited: isHeadersSourceEdited,
12988
13162
  editField,
12989
- field
13163
+ field,
13164
+ translate
12990
13165
  }];
12991
13166
  }
12992
13167
  function HeadersSourceSelect(props) {
12993
13168
  const {
12994
13169
  editField,
12995
13170
  field,
12996
- id
13171
+ id,
13172
+ translate
12997
13173
  } = props;
13174
+ const selectOptions = Object.values(OPTIONS).map(({
13175
+ label,
13176
+ value
13177
+ }) => ({
13178
+ label: translate(label),
13179
+ value
13180
+ }));
12998
13181
 
12999
13182
  /**
13000
13183
  * @returns {string|void}
@@ -13031,11 +13214,11 @@ function HeadersSourceSelect(props) {
13031
13214
  }
13032
13215
  };
13033
13216
  const getValuesSourceOptions = () => {
13034
- return SELECT_OPTIONS;
13217
+ return selectOptions;
13035
13218
  };
13036
13219
  return AutoFocusSelectEntry({
13037
13220
  autoFocusEntry: getAutoFocusEntryId(field),
13038
- label: 'Type',
13221
+ label: translate('Type'),
13039
13222
  element: field,
13040
13223
  getOptions: getValuesSourceOptions,
13041
13224
  getValue,
@@ -13082,6 +13265,7 @@ function ColumnsExpression(props) {
13082
13265
  id
13083
13266
  } = props;
13084
13267
  const debounce = useService('debounce');
13268
+ const translate = useService('translate');
13085
13269
  const variables = useVariables().map(name => ({
13086
13270
  name
13087
13271
  }));
@@ -13102,7 +13286,7 @@ function ColumnsExpression(props) {
13102
13286
  };
13103
13287
  const schema = '[\n {\n "key": "column_1",\n "label": "Column 1"\n }\n]';
13104
13288
  const tooltip = jsxRuntime.jsxs("div", {
13105
- children: ["The expression may result in an array of simple values or alternatively follow this schema:", jsxRuntime.jsx("pre", {
13289
+ children: [translate('The expression may result in an array of simple values or alternatively follow this schema:'), jsxRuntime.jsx("pre", {
13106
13290
  children: jsxRuntime.jsx("code", {
13107
13291
  children: schema
13108
13292
  })
@@ -13110,17 +13294,17 @@ function ColumnsExpression(props) {
13110
13294
  });
13111
13295
  return FeelTemplatingEntry({
13112
13296
  debounce,
13113
- description: 'Specify an expression to populate column items',
13297
+ description: translate('Specify an expression to populate column items'),
13114
13298
  element: field,
13115
13299
  feel: 'required',
13116
13300
  getValue,
13117
13301
  id,
13118
- label: 'Expression',
13302
+ label: translate('Expression'),
13119
13303
  tooltip,
13120
13304
  setValue,
13121
13305
  singleLine: true,
13122
13306
  variables,
13123
- validate: validate$3
13307
+ validate: hooks.useCallback(value => validate$3(value, translate), [translate])
13124
13308
  });
13125
13309
  }
13126
13310
 
@@ -13128,15 +13312,20 @@ function ColumnsExpression(props) {
13128
13312
 
13129
13313
  /**
13130
13314
  * @param {string|void} value
13315
+ * @param {Translate} translate
13131
13316
  * @returns {string|null}
13132
13317
  */
13133
- const validate$3 = value => {
13318
+ const validate$3 = (value, translate) => {
13134
13319
  if (!minDash.isString(value) || value.length === 0 || value === '=') {
13135
- return 'Must not be empty.';
13320
+ return translate('Must not be empty.');
13136
13321
  }
13137
13322
  return null;
13138
13323
  };
13139
13324
 
13325
+ /**
13326
+ * @typedef { import('diagram-js/lib/i18n/translate/translate').default } Translate
13327
+ */
13328
+
13140
13329
  const path$1 = 'columns';
13141
13330
  const labelPath = 'label';
13142
13331
  const keyPath = 'key';
@@ -13172,6 +13361,7 @@ function Label(props) {
13172
13361
  index
13173
13362
  } = props;
13174
13363
  const debounce = useService('debounce');
13364
+ const translate = useService('translate');
13175
13365
 
13176
13366
  /**
13177
13367
  * @param {string|void} value
@@ -13193,7 +13383,7 @@ function Label(props) {
13193
13383
  element: field,
13194
13384
  getValue,
13195
13385
  id,
13196
- label: 'Label',
13386
+ label: translate('Label'),
13197
13387
  setValue
13198
13388
  });
13199
13389
  }
@@ -13205,6 +13395,7 @@ function Key(props) {
13205
13395
  index
13206
13396
  } = props;
13207
13397
  const debounce = useService('debounce');
13398
+ const translate = useService('translate');
13208
13399
 
13209
13400
  /**
13210
13401
  * @param {string|void} value
@@ -13226,9 +13417,9 @@ function Key(props) {
13226
13417
  element: field,
13227
13418
  getValue,
13228
13419
  id,
13229
- label: 'Key',
13420
+ label: translate('Key'),
13230
13421
  setValue,
13231
- validate: validate$2
13422
+ validate: hooks.useCallback(value => validate$2(value, translate), [translate])
13232
13423
  });
13233
13424
  }
13234
13425
 
@@ -13236,11 +13427,12 @@ function Key(props) {
13236
13427
 
13237
13428
  /**
13238
13429
  * @param {string|void} value
13430
+ * @param {Translate} translate
13239
13431
  * @returns {string|null}
13240
13432
  */
13241
- function validate$2(value) {
13433
+ function validate$2(value, translate) {
13242
13434
  if (!minDash.isString(value) || value.length === 0) {
13243
- return 'Must not be empty.';
13435
+ return translate('Must not be empty.');
13244
13436
  }
13245
13437
  return null;
13246
13438
  }
@@ -13310,6 +13502,7 @@ function VersionTag(props) {
13310
13502
  id
13311
13503
  } = props;
13312
13504
  const debounce = useService('debounce');
13505
+ const translate = useService('translate');
13313
13506
  const path = ['versionTag'];
13314
13507
  const getValue = () => {
13315
13508
  return minDash.get(field, path, '');
@@ -13321,14 +13514,14 @@ function VersionTag(props) {
13321
13514
  return editField(field, path, value);
13322
13515
  };
13323
13516
  const tooltip = jsxRuntime.jsx("div", {
13324
- children: "Version tag by which this form can be referenced."
13517
+ children: translate('Version tag by which this form can be referenced.')
13325
13518
  });
13326
13519
  return TextfieldEntry({
13327
13520
  debounce,
13328
13521
  element: field,
13329
13522
  getValue,
13330
13523
  id,
13331
- label: 'Version tag',
13524
+ label: translate('Version tag'),
13332
13525
  setValue,
13333
13526
  tooltip
13334
13527
  });
@@ -13356,6 +13549,7 @@ function Accept(props) {
13356
13549
  field,
13357
13550
  id
13358
13551
  } = props;
13552
+ const translate = useService('translate');
13359
13553
  const debounce = useService('debounce');
13360
13554
  const variables = useVariables().map(name => ({
13361
13555
  name
@@ -13372,24 +13566,29 @@ function Accept(props) {
13372
13566
  element: field,
13373
13567
  getValue,
13374
13568
  id,
13375
- label: 'Supported file formats',
13569
+ label: translate('Supported file formats'),
13376
13570
  singleLine: true,
13377
13571
  setValue,
13378
13572
  variables,
13379
- description
13573
+ description: description(translate)
13380
13574
  });
13381
13575
  }
13382
13576
 
13383
13577
  // helpers //////////
13384
-
13385
- const description = jsxRuntime.jsxs(jsxRuntime.Fragment, {
13386
- children: ["A comma-separated list of", ' ', jsxRuntime.jsx("a", {
13387
- href: "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers",
13388
- target: "_blank",
13389
- rel: "noreferrer",
13390
- children: "file type specifiers"
13391
- })]
13392
- });
13578
+ /**
13579
+ * @param {Translate} translate
13580
+ * @returns Description Element
13581
+ */
13582
+ const description = translate => {
13583
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
13584
+ children: [translate('A comma-separated list of'), ' ', jsxRuntime.jsx("a", {
13585
+ href: "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers",
13586
+ target: "_blank",
13587
+ rel: "noreferrer",
13588
+ children: translate('file type specifiers')
13589
+ })]
13590
+ });
13591
+ };
13393
13592
 
13394
13593
  function MultipleEntry(props) {
13395
13594
  const {
@@ -13414,6 +13613,7 @@ function Multiple(props) {
13414
13613
  id
13415
13614
  } = props;
13416
13615
  const debounce = useService('debounce');
13616
+ const translate = useService('translate');
13417
13617
  const variables = useVariables().map(name => ({
13418
13618
  name
13419
13619
  }));
@@ -13430,7 +13630,7 @@ function Multiple(props) {
13430
13630
  feel: 'optional',
13431
13631
  getValue,
13432
13632
  id,
13433
- label: 'Upload multiple files',
13633
+ label: translate('Upload multiple files'),
13434
13634
  inline: true,
13435
13635
  setValue,
13436
13636
  variables
@@ -13460,6 +13660,7 @@ function DocumentsDataSource(props) {
13460
13660
  id
13461
13661
  } = props;
13462
13662
  const debounce = useService('debounce');
13663
+ const translate = useService('translate');
13463
13664
  const variables = useVariables().map(name => ({
13464
13665
  name
13465
13666
  }));
@@ -13482,23 +13683,23 @@ function DocumentsDataSource(props) {
13482
13683
  ]`;
13483
13684
  const tooltip = jsxRuntime.jsxs("div", {
13484
13685
  children: [jsxRuntime.jsx("p", {
13485
- children: "A source is a JSON object containing metadata for a document or an array of documents."
13686
+ children: translate('A source is a JSON object containing metadata for a document or an array of documents.')
13486
13687
  }), jsxRuntime.jsx("p", {
13487
- children: "Each entry must include a document ID, name, and MIME type."
13688
+ children: translate('Each entry must include a document ID, name, and MIME type.')
13488
13689
  }), jsxRuntime.jsx("p", {
13489
- children: "Additional details are optional. The expected format is as follows:"
13690
+ children: translate('Additional details are optional. The expected format is as follows:')
13490
13691
  }), jsxRuntime.jsx("pre", {
13491
13692
  children: jsxRuntime.jsx("code", {
13492
13693
  children: schema
13493
13694
  })
13494
13695
  }), jsxRuntime.jsx("p", {
13495
- children: "When using Camunda Tasklist UI, additional document reference attributes are automatically handled. Modifying the document reference may affect the document preview functionality."
13696
+ children: translate('When using Camunda Tasklist UI, additional document reference attributes are automatically handled. Modifying the document reference may affect the document preview functionality.')
13496
13697
  }), jsxRuntime.jsxs("p", {
13497
- children: ["Learn more in our", ' ', jsxRuntime.jsx("a", {
13698
+ children: [translate('Learn more in our'), ' ', jsxRuntime.jsx("a", {
13498
13699
  href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-document-preview/",
13499
13700
  target: "_blank",
13500
13701
  rel: "noopener noreferrer",
13501
- children: "documentation"
13702
+ children: translate('documentation')
13502
13703
  }), "."]
13503
13704
  })]
13504
13705
  });
@@ -13507,13 +13708,13 @@ function DocumentsDataSource(props) {
13507
13708
  element: field,
13508
13709
  getValue,
13509
13710
  id,
13510
- label: 'Document reference',
13711
+ label: translate('Document reference'),
13511
13712
  feel: 'required',
13512
13713
  singleLine: true,
13513
13714
  setValue,
13514
13715
  variables,
13515
13716
  tooltip,
13516
- validate: validate$1
13717
+ validate: hooks.useCallback(value => validate$1(value, translate), [translate])
13517
13718
  });
13518
13719
  }
13519
13720
 
@@ -13521,14 +13722,19 @@ function DocumentsDataSource(props) {
13521
13722
 
13522
13723
  /**
13523
13724
  * @param {string|undefined} value
13725
+ * @param {Translate} translate
13524
13726
  * @returns {string|null}
13525
13727
  */
13526
- const validate$1 = value => {
13728
+ const validate$1 = (value, translate) => {
13527
13729
  if (typeof value !== 'string' || value.length === 0) {
13528
- return 'The document data source is required.';
13730
+ return translate('The document data source is required.');
13529
13731
  }
13530
13732
  };
13531
13733
 
13734
+ /**
13735
+ * @typedef { import('diagram-js/lib/i18n/translate/translate').default } Translate
13736
+ */
13737
+
13532
13738
  function MaxHeightEntry(props) {
13533
13739
  const {
13534
13740
  editField,
@@ -13552,43 +13758,42 @@ function MaxHeight(props) {
13552
13758
  id
13553
13759
  } = props;
13554
13760
  const debounce = useService('debounce');
13761
+ const translate = useService('translate');
13555
13762
  const path = ['maxHeight'];
13556
13763
  const getValue = () => {
13557
- return minDash.get(field, path, '');
13764
+ return minDash.get(field, path);
13558
13765
  };
13559
13766
  const setValue = value => {
13560
13767
  return editField(field, path, value);
13561
13768
  };
13562
13769
  return NumberFieldEntry({
13563
13770
  debounce,
13564
- label: 'Max height of preview container',
13771
+ label: translate('Max height of preview container'),
13565
13772
  element: field,
13566
13773
  id,
13567
13774
  getValue,
13568
13775
  setValue,
13569
- validate,
13570
- tooltip
13776
+ validate: hooks.useCallback(value => validate(value, translate), [translate]),
13777
+ description: translate(tooltip)
13571
13778
  });
13572
13779
  }
13573
13780
 
13574
13781
  // helpers //////////
13575
13782
 
13576
13783
  /**
13577
- * @param {string|number|undefined} value
13784
+ * @param {number|undefined} value
13785
+ * @param {Translate} translate
13578
13786
  * @returns {string|null}
13579
13787
  */
13580
- const validate = value => {
13581
- if (value === undefined || value === '') {
13788
+ const validate = (value, translate) => {
13789
+ if (minDash.isNil(value)) {
13582
13790
  return null;
13583
13791
  }
13584
- if (typeof value === 'string') {
13585
- return 'Value must be a number.';
13586
- }
13587
13792
  if (!Number.isInteger(value)) {
13588
- return 'Should be an integer.';
13793
+ return translate('Should be an integer.');
13589
13794
  }
13590
13795
  if (value < 1) {
13591
- return 'Should be greater than zero.';
13796
+ return translate('Should be greater than zero.');
13592
13797
  }
13593
13798
  };
13594
13799
  const tooltip = 'Documents whose height exceeds the defined value in pixels will be vertically scrollable';
@@ -13620,13 +13825,15 @@ function GeneralGroup(field, editField, getService) {
13620
13825
  getService
13621
13826
  }), ...DefaultValueEntry({
13622
13827
  field,
13623
- editField
13828
+ editField,
13829
+ getService
13624
13830
  }), ...ActionEntry({
13625
13831
  field,
13626
13832
  editField
13627
13833
  }), ...DateTimeEntry({
13628
13834
  field,
13629
- editField
13835
+ editField,
13836
+ getService
13630
13837
  }), ...TextEntry({
13631
13838
  field,
13632
13839
  editField}), ...HtmlEntry({
@@ -13636,7 +13843,8 @@ function GeneralGroup(field, editField, getService) {
13636
13843
  editField
13637
13844
  }), ...IFrameHeightEntry({
13638
13845
  field,
13639
- editField
13846
+ editField,
13847
+ getService
13640
13848
  }), ...HeightEntry({
13641
13849
  field,
13642
13850
  editField
@@ -13654,7 +13862,8 @@ function GeneralGroup(field, editField, getService) {
13654
13862
  editField
13655
13863
  }), ...SelectEntries({
13656
13864
  field,
13657
- editField
13865
+ editField,
13866
+ getService
13658
13867
  }), ...AcceptEntry({
13659
13868
  field,
13660
13869
  editField
@@ -13663,7 +13872,8 @@ function GeneralGroup(field, editField, getService) {
13663
13872
  editField
13664
13873
  }), ...DisabledEntry({
13665
13874
  field,
13666
- editField
13875
+ editField,
13876
+ getService
13667
13877
  }), ...ReadonlyEntry({
13668
13878
  field,
13669
13879
  editField
@@ -13672,7 +13882,8 @@ function GeneralGroup(field, editField, getService) {
13672
13882
  editField
13673
13883
  }), ...PaginationEntry({
13674
13884
  field,
13675
- editField
13885
+ editField,
13886
+ getService
13676
13887
  }), ...RowCountEntry({
13677
13888
  field,
13678
13889
  editField
@@ -13683,14 +13894,15 @@ function GeneralGroup(field, editField, getService) {
13683
13894
  if (entries.length === 0) {
13684
13895
  return null;
13685
13896
  }
13897
+ const translate = getService('translate');
13686
13898
  return {
13687
13899
  id: 'general',
13688
- label: 'General',
13900
+ label: translate('General'),
13689
13901
  entries
13690
13902
  };
13691
13903
  }
13692
13904
 
13693
- function SerializationGroup(field, editField) {
13905
+ function SerializationGroup(field, editField, getService) {
13694
13906
  const entries = [...NumberSerializationEntry({
13695
13907
  field,
13696
13908
  editField
@@ -13698,51 +13910,56 @@ function SerializationGroup(field, editField) {
13698
13910
  field,
13699
13911
  editField
13700
13912
  })];
13913
+ const translate = getService('translate');
13701
13914
  if (!entries.length) {
13702
13915
  return null;
13703
13916
  }
13704
13917
  return {
13705
13918
  id: 'serialization',
13706
- label: 'Serialization',
13919
+ label: translate('Serialization'),
13707
13920
  entries
13708
13921
  };
13709
13922
  }
13710
13923
 
13711
- function ConstraintsGroup(field, editField) {
13924
+ function ConstraintsGroup(field, editField, getService) {
13712
13925
  const entries = [...DateTimeConstraintsEntry({
13713
13926
  field,
13714
13927
  editField
13715
13928
  })];
13929
+ const translate = getService('translate');
13716
13930
  if (!entries.length) {
13717
13931
  return null;
13718
13932
  }
13719
13933
  return {
13720
13934
  id: 'constraints',
13721
- label: 'Constraints',
13935
+ label: translate('Constraints'),
13722
13936
  entries
13723
13937
  };
13724
13938
  }
13725
13939
 
13726
- const VALIDATION_TYPE_OPTIONS = {
13727
- custom: {
13728
- value: '',
13729
- label: 'Custom'
13730
- },
13731
- email: {
13732
- value: 'email',
13733
- label: 'Email'
13734
- },
13735
- phone: {
13736
- value: 'phone',
13737
- label: 'Phone'
13738
- }
13940
+ const VALIDATION_TYPE_OPTIONS = translate => {
13941
+ return {
13942
+ custom: {
13943
+ value: '',
13944
+ label: translate('Custom')
13945
+ },
13946
+ email: {
13947
+ value: 'email',
13948
+ label: translate('Email')
13949
+ },
13950
+ phone: {
13951
+ value: 'phone',
13952
+ label: translate('Phone')
13953
+ }
13954
+ };
13739
13955
  };
13740
- function ValidationGroup(field, editField) {
13956
+ function ValidationGroup(field, editField, getService) {
13741
13957
  const {
13742
13958
  type
13743
13959
  } = field;
13744
13960
  const validate = minDash.get(field, ['validate'], {});
13745
- const isCustomValidation = [undefined, VALIDATION_TYPE_OPTIONS.custom.value].includes(validate.validationType);
13961
+ const translate = getService('translate');
13962
+ const isCustomValidation = [undefined, VALIDATION_TYPE_OPTIONS(translate).custom.value].includes(validate.validationType);
13746
13963
  const hasPattern = !!minDash.get(field, ['validate', 'pattern']);
13747
13964
  const onChange = key => {
13748
13965
  return value => {
@@ -13762,7 +13979,8 @@ function ValidationGroup(field, editField) {
13762
13979
  field,
13763
13980
  isEdited: isEdited$9,
13764
13981
  onChange,
13765
- isDefaultVisible: field => INPUTS.includes(field.type)
13982
+ isDefaultVisible: field => INPUTS.includes(field.type),
13983
+ translate
13766
13984
  }];
13767
13985
  entries.push({
13768
13986
  id: 'validationType',
@@ -13772,7 +13990,8 @@ function ValidationGroup(field, editField) {
13772
13990
  editField,
13773
13991
  isEdited: isEdited,
13774
13992
  onChange,
13775
- isDefaultVisible: field => field.type === 'textfield'
13993
+ isDefaultVisible: field => field.type === 'textfield',
13994
+ translate
13776
13995
  });
13777
13996
  entries.push({
13778
13997
  id: 'minLength',
@@ -13781,7 +14000,8 @@ function ValidationGroup(field, editField) {
13781
14000
  field,
13782
14001
  isEdited: isEdited$5,
13783
14002
  onChange,
13784
- isDefaultVisible: field => INPUTS.includes(field.type) && (type === 'textarea' || type === 'textfield' && isCustomValidation)
14003
+ isDefaultVisible: field => INPUTS.includes(field.type) && (type === 'textarea' || type === 'textfield' && isCustomValidation),
14004
+ translate
13785
14005
  }, {
13786
14006
  id: 'maxLength',
13787
14007
  component: MaxLength,
@@ -13789,7 +14009,8 @@ function ValidationGroup(field, editField) {
13789
14009
  field,
13790
14010
  isEdited: isEdited$5,
13791
14011
  onChange,
13792
- isDefaultVisible: field => INPUTS.includes(field.type) && (type === 'textarea' || type === 'textfield' && isCustomValidation)
14012
+ isDefaultVisible: field => INPUTS.includes(field.type) && (type === 'textarea' || type === 'textfield' && isCustomValidation),
14013
+ translate
13793
14014
  });
13794
14015
  entries.push({
13795
14016
  id: 'pattern',
@@ -13798,7 +14019,8 @@ function ValidationGroup(field, editField) {
13798
14019
  field,
13799
14020
  isEdited: isEdited,
13800
14021
  onChange,
13801
- isDefaultVisible: field => INPUTS.includes(field.type) && type === 'textfield' && isCustomValidation
14022
+ isDefaultVisible: field => INPUTS.includes(field.type) && type === 'textfield' && isCustomValidation,
14023
+ translate
13802
14024
  });
13803
14025
  entries.push({
13804
14026
  id: 'patternErrorMessage',
@@ -13807,7 +14029,8 @@ function ValidationGroup(field, editField) {
13807
14029
  field,
13808
14030
  isEdited: isEdited,
13809
14031
  onChange,
13810
- isDefaultVisible: field => INPUTS.includes(field.type) && type === 'textfield' && isCustomValidation && hasPattern
14032
+ isDefaultVisible: field => INPUTS.includes(field.type) && type === 'textfield' && isCustomValidation && hasPattern,
14033
+ translate
13811
14034
  });
13812
14035
  entries.push({
13813
14036
  id: 'min',
@@ -13816,7 +14039,8 @@ function ValidationGroup(field, editField) {
13816
14039
  field,
13817
14040
  isEdited: isEdited$5,
13818
14041
  onChange,
13819
- isDefaultVisible: field => field.type === 'number'
14042
+ isDefaultVisible: field => field.type === 'number',
14043
+ translate
13820
14044
  }, {
13821
14045
  id: 'max',
13822
14046
  component: Max,
@@ -13824,11 +14048,12 @@ function ValidationGroup(field, editField) {
13824
14048
  field,
13825
14049
  isEdited: isEdited$5,
13826
14050
  onChange,
13827
- isDefaultVisible: field => field.type === 'number'
14051
+ isDefaultVisible: field => field.type === 'number',
14052
+ translate
13828
14053
  });
13829
14054
  return {
13830
14055
  id: 'validation',
13831
- label: 'Validation',
14056
+ label: translate('Validation'),
13832
14057
  entries
13833
14058
  };
13834
14059
  }
@@ -13837,13 +14062,14 @@ function Required(props) {
13837
14062
  field,
13838
14063
  getValue,
13839
14064
  id,
13840
- onChange
14065
+ onChange,
14066
+ translate
13841
14067
  } = props;
13842
14068
  return CheckboxEntry({
13843
14069
  element: field,
13844
14070
  getValue: getValue('required'),
13845
14071
  id,
13846
- label: 'Required',
14072
+ label: translate('Required'),
13847
14073
  setValue: onChange('required')
13848
14074
  });
13849
14075
  }
@@ -13852,7 +14078,8 @@ function MinLength(props) {
13852
14078
  field,
13853
14079
  getValue,
13854
14080
  id,
13855
- onChange
14081
+ onChange,
14082
+ translate
13856
14083
  } = props;
13857
14084
  const debounce = useService('debounce');
13858
14085
  const variables = useVariables().map(name => ({
@@ -13864,7 +14091,7 @@ function MinLength(props) {
13864
14091
  feel: 'optional',
13865
14092
  getValue: getValue('minLength'),
13866
14093
  id,
13867
- label: 'Minimum length',
14094
+ label: translate('Minimum length'),
13868
14095
  min: 0,
13869
14096
  setValue: onChange('minLength'),
13870
14097
  variables
@@ -13875,7 +14102,8 @@ function MaxLength(props) {
13875
14102
  field,
13876
14103
  getValue,
13877
14104
  id,
13878
- onChange
14105
+ onChange,
14106
+ translate
13879
14107
  } = props;
13880
14108
  const debounce = useService('debounce');
13881
14109
  const variables = useVariables().map(name => ({
@@ -13887,7 +14115,7 @@ function MaxLength(props) {
13887
14115
  feel: 'optional',
13888
14116
  getValue: getValue('maxLength'),
13889
14117
  id,
13890
- label: 'Maximum length',
14118
+ label: translate('Maximum length'),
13891
14119
  min: 0,
13892
14120
  setValue: onChange('maxLength'),
13893
14121
  variables
@@ -13898,7 +14126,8 @@ function Pattern(props) {
13898
14126
  field,
13899
14127
  getValue,
13900
14128
  id,
13901
- onChange
14129
+ onChange,
14130
+ translate
13902
14131
  } = props;
13903
14132
  const debounce = useService('debounce');
13904
14133
  return TextfieldEntry({
@@ -13906,7 +14135,7 @@ function Pattern(props) {
13906
14135
  element: field,
13907
14136
  getValue: getValue('pattern'),
13908
14137
  id,
13909
- label: 'Custom regular expression',
14138
+ label: translate('Custom regular expression'),
13910
14139
  setValue: onChange('pattern')
13911
14140
  });
13912
14141
  }
@@ -13915,7 +14144,8 @@ function PatternErrorMessage(props) {
13915
14144
  field,
13916
14145
  getValue,
13917
14146
  id,
13918
- onChange
14147
+ onChange,
14148
+ translate
13919
14149
  } = props;
13920
14150
  const debounce = useService('debounce');
13921
14151
  return TextfieldEntry({
@@ -13923,8 +14153,8 @@ function PatternErrorMessage(props) {
13923
14153
  element: field,
13924
14154
  getValue: getValue('patternErrorMessage'),
13925
14155
  id,
13926
- label: 'Custom error message',
13927
- tooltip: 'The error message to display when the input does not match the regular expression.',
14156
+ label: translate('Custom error message'),
14157
+ tooltip: translate('The error message to display when the input does not match the regular expression.'),
13928
14158
  setValue: onChange('patternErrorMessage')
13929
14159
  });
13930
14160
  }
@@ -13933,7 +14163,8 @@ function Min(props) {
13933
14163
  field,
13934
14164
  getValue,
13935
14165
  id,
13936
- onChange
14166
+ onChange,
14167
+ translate
13937
14168
  } = props;
13938
14169
  const debounce = useService('debounce');
13939
14170
  const variables = useVariables().map(name => ({
@@ -13944,7 +14175,7 @@ function Min(props) {
13944
14175
  element: field,
13945
14176
  feel: 'optional',
13946
14177
  id,
13947
- label: 'Minimum',
14178
+ label: translate('Minimum'),
13948
14179
  step: 'any',
13949
14180
  getValue: getValue('min'),
13950
14181
  setValue: onChange('min'),
@@ -13956,7 +14187,8 @@ function Max(props) {
13956
14187
  field,
13957
14188
  getValue,
13958
14189
  id,
13959
- onChange
14190
+ onChange,
14191
+ translate
13960
14192
  } = props;
13961
14193
  const debounce = useService('debounce');
13962
14194
  const variables = useVariables().map(name => ({
@@ -13967,7 +14199,7 @@ function Max(props) {
13967
14199
  element: field,
13968
14200
  feel: 'optional',
13969
14201
  id,
13970
- label: 'Maximum',
14202
+ label: translate('Maximum'),
13971
14203
  step: 'any',
13972
14204
  getValue: getValue('max'),
13973
14205
  setValue: onChange('max'),
@@ -13979,7 +14211,8 @@ function ValidationType(props) {
13979
14211
  field,
13980
14212
  getValue,
13981
14213
  id,
13982
- onChange
14214
+ onChange,
14215
+ translate
13983
14216
  } = props;
13984
14217
  useService('debounce');
13985
14218
  const setValue = validationType => {
@@ -13989,10 +14222,10 @@ function ValidationType(props) {
13989
14222
  element: field,
13990
14223
  getValue: getValue('validationType'),
13991
14224
  id,
13992
- label: 'Validation pattern',
14225
+ label: translate('Validation pattern'),
13993
14226
  setValue,
13994
- getOptions: () => Object.values(VALIDATION_TYPE_OPTIONS),
13995
- 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
14227
+ getOptions: () => Object.values(VALIDATION_TYPE_OPTIONS(translate)),
14228
+ 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
13996
14229
  });
13997
14230
  }
13998
14231
 
@@ -14001,6 +14234,7 @@ function OptionsGroups(field, editField, getService) {
14001
14234
  type
14002
14235
  } = field;
14003
14236
  const formFields = getService('formFields');
14237
+ const translate = getService('translate');
14004
14238
  const fieldDefinition = formFields.get(type).config;
14005
14239
  if (!OPTIONS_INPUTS.includes(type) && !hasOptionsGroupsConfigured(fieldDefinition)) {
14006
14240
  return [];
@@ -14016,12 +14250,13 @@ function OptionsGroups(field, editField, getService) {
14016
14250
  */
14017
14251
  const groups = [{
14018
14252
  id,
14019
- label: 'Options source',
14020
- tooltip: getValuesTooltip(),
14253
+ label: translate('Options source'),
14254
+ tooltip: getValuesTooltip(translate),
14021
14255
  component: Group,
14022
14256
  entries: OptionsSourceSelectEntry({
14023
14257
  ...context,
14024
- id
14258
+ id,
14259
+ translate
14025
14260
  })
14026
14261
  }];
14027
14262
  const valuesSource = formJsViewer.getOptionsSource(field);
@@ -14029,7 +14264,7 @@ function OptionsGroups(field, editField, getService) {
14029
14264
  const id = 'dynamicOptions';
14030
14265
  groups.push({
14031
14266
  id,
14032
- label: 'Dynamic options',
14267
+ label: translate('Dynamic options'),
14033
14268
  component: Group,
14034
14269
  entries: InputKeyOptionsSourceEntry({
14035
14270
  ...context,
@@ -14040,18 +14275,22 @@ function OptionsGroups(field, editField, getService) {
14040
14275
  const id = 'staticOptions';
14041
14276
  groups.push({
14042
14277
  id,
14043
- label: 'Static options',
14044
- component: ListGroup,
14278
+ label: translate('Static options'),
14279
+ component: props => ListGroup({
14280
+ ...props,
14281
+ translate
14282
+ }),
14045
14283
  ...StaticOptionsSourceEntry({
14046
14284
  ...context,
14047
- id
14285
+ id,
14286
+ translate
14048
14287
  })
14049
14288
  });
14050
14289
  } else if (valuesSource === formJsViewer.OPTIONS_SOURCES.EXPRESSION) {
14051
14290
  const id = 'optionsExpression';
14052
14291
  groups.push({
14053
14292
  id,
14054
- label: 'Options expression',
14293
+ label: translate('Options expression'),
14055
14294
  component: Group,
14056
14295
  entries: OptionsExpressionEntry({
14057
14296
  ...context,
@@ -14064,15 +14303,16 @@ function OptionsGroups(field, editField, getService) {
14064
14303
 
14065
14304
  // helpers //////////
14066
14305
 
14067
- function getValuesTooltip() {
14068
- return '"Static" defines a constant, predefined set of form options.\n\n' + '"Input data" defines options that are populated dynamically, adjusting based on variable data for flexible responses to different conditions or inputs.\n\n' + '"Expression" defines options that are populated from a FEEL expression.';
14306
+ function getValuesTooltip(translate) {
14307
+ 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.');
14069
14308
  }
14070
14309
 
14071
- function CustomPropertiesGroup(field, editField) {
14310
+ function CustomPropertiesGroup(field, editField, getService) {
14072
14311
  const {
14073
14312
  properties = {},
14074
14313
  type
14075
14314
  } = field;
14315
+ const translate = getService('translate');
14076
14316
  if (type === 'default') {
14077
14317
  return null;
14078
14318
  }
@@ -14093,10 +14333,10 @@ function CustomPropertiesGroup(field, editField) {
14093
14333
  return;
14094
14334
  }
14095
14335
  if (typeof value !== 'string' || value.length === 0) {
14096
- return 'Must not be empty.';
14336
+ return translate('Must not be empty.');
14097
14337
  }
14098
14338
  if (minDash.has(properties, value)) {
14099
- return 'Must be unique.';
14339
+ return translate('Must be unique.');
14100
14340
  }
14101
14341
  };
14102
14342
  };
@@ -14122,11 +14362,14 @@ function CustomPropertiesGroup(field, editField) {
14122
14362
  });
14123
14363
  return {
14124
14364
  add: addEntry,
14125
- component: ListGroup,
14365
+ component: props => ListGroup({
14366
+ ...props,
14367
+ translate
14368
+ }),
14126
14369
  id: 'custom-values',
14127
14370
  items,
14128
- label: 'Custom properties',
14129
- tooltip: 'Add properties directly to the form schema, useful to configure functionality in custom-built task applications and form renderers.'
14371
+ label: translate('Custom properties'),
14372
+ tooltip: translate('Add properties directly to the form schema, useful to configure functionality in custom-built task applications and form renderers.')
14130
14373
  };
14131
14374
  }
14132
14375
 
@@ -14154,15 +14397,18 @@ function removeKey(properties, oldKey) {
14154
14397
  }
14155
14398
 
14156
14399
  function AppearanceGroup(field, editField, getService) {
14400
+ const translate = getService('translate');
14157
14401
  const entries = [...AdornerEntry({
14158
14402
  field,
14159
14403
  editField
14160
14404
  }), ...GroupAppearanceEntry({
14161
14405
  field,
14162
- editField
14406
+ editField,
14407
+ translate
14163
14408
  }), ...LayouterAppearanceEntry({
14164
14409
  field,
14165
- editField
14410
+ editField,
14411
+ translate
14166
14412
  }), ...MaxHeightEntry({
14167
14413
  field,
14168
14414
  editField
@@ -14172,15 +14418,16 @@ function AppearanceGroup(field, editField, getService) {
14172
14418
  }
14173
14419
  return {
14174
14420
  id: 'appearance',
14175
- label: 'Appearance',
14421
+ label: translate('Appearance'),
14176
14422
  entries
14177
14423
  };
14178
14424
  }
14179
14425
 
14180
- function LayoutGroup(field, editField) {
14426
+ function LayoutGroup(field, editField, getService) {
14181
14427
  const {
14182
14428
  type
14183
14429
  } = field;
14430
+ const translate = getService('translate');
14184
14431
  if (type === 'default') {
14185
14432
  return null;
14186
14433
  }
@@ -14193,36 +14440,39 @@ function LayoutGroup(field, editField) {
14193
14440
  }
14194
14441
  return {
14195
14442
  id: 'layout',
14196
- label: 'Layout',
14443
+ label: translate('Layout'),
14197
14444
  entries
14198
14445
  };
14199
14446
  }
14200
14447
 
14201
- function SecurityAttributesGroup(field, editField) {
14448
+ function SecurityAttributesGroup(field, editField, getService) {
14202
14449
  const {
14203
14450
  type
14204
14451
  } = field;
14452
+ const translate = getService('translate');
14205
14453
  if (type !== 'iframe') {
14206
14454
  return null;
14207
14455
  }
14208
14456
  const entries = createEntries({
14209
14457
  field,
14210
- editField
14458
+ editField,
14459
+ translate
14211
14460
  });
14212
14461
  if (!entries.length) {
14213
14462
  return null;
14214
14463
  }
14215
14464
  return {
14216
14465
  id: 'securityAttributes',
14217
- label: 'Security attributes',
14466
+ label: translate('Security attributes'),
14218
14467
  entries,
14219
- tooltip: getTooltip()
14468
+ tooltip: getTooltip(translate)
14220
14469
  };
14221
14470
  }
14222
14471
  function createEntries(props) {
14223
14472
  const {
14224
14473
  editField,
14225
- field
14474
+ field,
14475
+ translate
14226
14476
  } = props;
14227
14477
  const securityEntries = formJsViewer.SECURITY_ATTRIBUTES_DEFINITIONS.map(definition => {
14228
14478
  const {
@@ -14231,7 +14481,7 @@ function createEntries(props) {
14231
14481
  } = definition;
14232
14482
  return simpleBoolEntryFactory({
14233
14483
  id: property,
14234
- label: label,
14484
+ label: translate(label),
14235
14485
  isDefaultVisible: field => field.type === 'iframe',
14236
14486
  path: ['security', property],
14237
14487
  props,
@@ -14243,32 +14493,37 @@ function createEntries(props) {
14243
14493
  });
14244
14494
  });
14245
14495
  return [{
14246
- component: Advisory
14496
+ component: () => Advisory({
14497
+ translate
14498
+ })
14247
14499
  }, ...securityEntries];
14248
14500
  }
14249
14501
  const Advisory = props => {
14502
+ const {
14503
+ translate
14504
+ } = props;
14250
14505
  return jsxRuntime.jsx("div", {
14251
14506
  class: "bio-properties-panel-description fjs-properties-panel-detached-description",
14252
- children: "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."
14507
+ 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.')
14253
14508
  });
14254
14509
  };
14255
14510
 
14256
14511
  // helpers //////////
14257
14512
 
14258
- function getTooltip() {
14513
+ function getTooltip(translate) {
14259
14514
  return jsxRuntime.jsx(jsxRuntime.Fragment, {
14260
14515
  children: jsxRuntime.jsxs("p", {
14261
- children: ["Allow the iframe to access more functionality of your browser, details regarding the various options can be found in the", ' ', jsxRuntime.jsx("a", {
14516
+ children: [translate('Allow the iframe to access more functionality of your browser, details regarding the various options can be found in the'), ' ', jsxRuntime.jsx("a", {
14262
14517
  target: "_blank",
14263
14518
  href: "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe",
14264
14519
  rel: "noreferrer",
14265
- children: "MDN iFrame documentation."
14520
+ children: translate('MDN iFrame documentation.')
14266
14521
  })]
14267
14522
  })
14268
14523
  });
14269
14524
  }
14270
14525
 
14271
- function ConditionGroup(field, editField) {
14526
+ function ConditionGroup(field, editField, getService) {
14272
14527
  const {
14273
14528
  type
14274
14529
  } = field;
@@ -14279,18 +14534,20 @@ function ConditionGroup(field, editField) {
14279
14534
  field,
14280
14535
  editField
14281
14536
  })];
14537
+ const translate = getService('translate');
14282
14538
  return {
14283
14539
  id: 'condition',
14284
- label: 'Condition',
14540
+ label: translate('Condition'),
14285
14541
  entries
14286
14542
  };
14287
14543
  }
14288
14544
 
14289
- function TableHeaderGroups(field, editField) {
14545
+ function TableHeaderGroups(field, editField, getService) {
14290
14546
  const {
14291
14547
  type,
14292
14548
  id: fieldId
14293
14549
  } = field;
14550
+ const translate = getService('translate');
14294
14551
  if (type !== 'table') {
14295
14552
  return [];
14296
14553
  }
@@ -14301,12 +14558,13 @@ function TableHeaderGroups(field, editField) {
14301
14558
  */
14302
14559
  const groups = [{
14303
14560
  id: `${fieldId}-columnsSource`,
14304
- label: 'Headers source',
14305
- tooltip: TOOLTIP_TEXT,
14561
+ label: translate('Headers source'),
14562
+ 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',
14306
14563
  component: Group,
14307
14564
  entries: [...HeadersSourceSelectEntry({
14308
14565
  field,
14309
- editField
14566
+ editField,
14567
+ translate
14310
14568
  }), ...ColumnsExpressionEntry({
14311
14569
  field,
14312
14570
  editField
@@ -14316,8 +14574,11 @@ function TableHeaderGroups(field, editField) {
14316
14574
  const id = `${fieldId}-columns`;
14317
14575
  groups.push({
14318
14576
  id,
14319
- label: 'Header items',
14320
- component: ListGroup,
14577
+ label: translate('Header items'),
14578
+ component: props => ListGroup({
14579
+ ...props,
14580
+ translate
14581
+ }),
14321
14582
  ...StaticColumnsSourceEntry({
14322
14583
  field,
14323
14584
  editField,
@@ -14328,13 +14589,6 @@ function TableHeaderGroups(field, editField) {
14328
14589
  return groups;
14329
14590
  }
14330
14591
 
14331
- // helpers //////////
14332
-
14333
- const TOOLTIP_TEXT = `"List of items" defines a constant, predefined set of form options.
14334
-
14335
- "Expression" defines options that are populated from a FEEL expression.
14336
- `;
14337
-
14338
14592
  class PropertiesProvider {
14339
14593
  constructor(propertiesPanel, injector) {
14340
14594
  this._injector = injector;
@@ -14370,7 +14624,7 @@ class PropertiesProvider {
14370
14624
  return groups;
14371
14625
  }
14372
14626
  const getService = (type, strict = true) => this._injector.get(type, strict);
14373
- 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);
14627
+ 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);
14374
14628
  this._filterVisibleEntries(groups, field, getService);
14375
14629
 
14376
14630
  // contract: if a group has no entries or items, it should not be displayed at all
@@ -14604,9 +14858,10 @@ var SvgRepeat = function SvgRepeat(props) {
14604
14858
  };
14605
14859
 
14606
14860
  class EditorRepeatRenderManager {
14607
- constructor(formFields, formFieldRegistry) {
14861
+ constructor(formFields, formFieldRegistry, translate) {
14608
14862
  this._formFields = formFields;
14609
14863
  this._formFieldRegistry = formFieldRegistry;
14864
+ this._translate = translate;
14610
14865
  this.RepeatFooter = this.RepeatFooter.bind(this);
14611
14866
  }
14612
14867
 
@@ -14628,12 +14883,12 @@ class EditorRepeatRenderManager {
14628
14883
  return jsxRuntime.jsxs("div", {
14629
14884
  className: "fjs-repeat-render-footer",
14630
14885
  children: [jsxRuntime.jsx(SvgRepeat, {}), jsxRuntime.jsx("span", {
14631
- children: "Repeatable"
14886
+ children: this._translate('Repeatable')
14632
14887
  })]
14633
14888
  });
14634
14889
  }
14635
14890
  }
14636
- EditorRepeatRenderManager.$inject = ['formFields', 'formFieldRegistry'];
14891
+ EditorRepeatRenderManager.$inject = ['formFields', 'formFieldRegistry', 'translate'];
14637
14892
 
14638
14893
  const RepeatRenderModule = {
14639
14894
  __init__: ['repeatRenderManager'],
@@ -14861,7 +15116,7 @@ class FormEditor {
14861
15116
  config: ['value', enrichedConfig]
14862
15117
  }, {
14863
15118
  formEditor: ['value', this]
14864
- }, CoreModule, ...modules, ...additionalModules]);
15119
+ }, TranslateModule, CoreModule, ...modules, ...additionalModules]);
14865
15120
  }
14866
15121
 
14867
15122
  /**