@bpmn-io/form-js-viewer 1.15.3 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -529,6 +529,8 @@ const SECURITY_ATTRIBUTES_DEFINITIONS = [{
529
529
  label: 'Storage access by user'
530
530
  }];
531
531
 
532
+ const TEXT_VIEW_DEFAULT_TEXT = '# Text';
533
+
532
534
  function createInjector(bootstrapModules) {
533
535
  const injector = new Injector(bootstrapModules);
534
536
  injector.init();
@@ -3858,6 +3860,9 @@ function Numberfield(props) {
3858
3860
  e.preventDefault();
3859
3861
  return;
3860
3862
  }
3863
+ if (e.code === 'Enter') {
3864
+ flushOnChange && flushOnChange();
3865
+ }
3861
3866
  };
3862
3867
 
3863
3868
  // intercept key presses which would lead to an invalid number
@@ -4996,7 +5001,7 @@ Text.config = {
4996
5001
  name: 'Text view',
4997
5002
  group: 'presentation',
4998
5003
  create: (options = {}) => ({
4999
- text: '# Text',
5004
+ text: TEXT_VIEW_DEFAULT_TEXT,
5000
5005
  ...options
5001
5006
  }),
5002
5007
  getSubheading: field => {
@@ -5167,6 +5172,11 @@ function Textfield(props) {
5167
5172
  const onInputFocus = () => {
5168
5173
  onFocus && onFocus();
5169
5174
  };
5175
+ const onKeyDown = e => {
5176
+ if (e.code === 'Enter') {
5177
+ flushOnChange && flushOnChange();
5178
+ }
5179
+ };
5170
5180
  const descriptionId = `${domId}-description`;
5171
5181
  const errorMessageId = `${domId}-error-message`;
5172
5182
  return jsxs("div", {
@@ -5192,6 +5202,7 @@ function Textfield(props) {
5192
5202
  onInput: onInputChange,
5193
5203
  onBlur: onInputBlur,
5194
5204
  onFocus: onInputFocus,
5205
+ onKeyDown: onKeyDown,
5195
5206
  type: "text",
5196
5207
  value: value,
5197
5208
  "aria-describedby": [descriptionId, errorMessageId].join(' '),
@@ -7954,7 +7965,7 @@ EventBus.prototype.once = function (events, priority, callback, that) {
7954
7965
  * If no callback is given, all listeners for a given event name are being removed.
7955
7966
  *
7956
7967
  * @param {string|string[]} events
7957
- * @param {EventBusEventCallback} [callback]
7968
+ * @param {EventBusEventCallback<unknown>} [callback]
7958
7969
  */
7959
7970
  EventBus.prototype.off = function (events, callback) {
7960
7971
  events = isArray(events) ? events : [events];
@@ -8342,7 +8353,7 @@ function runNumberValidation(field, value) {
8342
8353
  function runPresetValidation(field, validation, value) {
8343
8354
  const errors = [];
8344
8355
  if (validation.pattern && value && !new RegExp(validation.pattern).test(value)) {
8345
- errors.push(`Field must match pattern ${validation.pattern}.`);
8356
+ errors.push(validation.patternErrorMessage || `Field must match pattern ${validation.pattern}.`);
8346
8357
  }
8347
8358
  if (validation.required) {
8348
8359
  const isUncheckedCheckbox = field.type === 'checkbox' && value === false;
@@ -9820,7 +9831,7 @@ class Form {
9820
9831
  }
9821
9832
  }
9822
9833
 
9823
- const schemaVersion = 18;
9834
+ const schemaVersion = 19;
9824
9835
 
9825
9836
  /**
9826
9837
  * @typedef { import('./types').CreateFormOptions } CreateFormOptions
@@ -9845,5 +9856,5 @@ function createForm(options) {
9845
9856
  });
9846
9857
  }
9847
9858
 
9848
- export { ALLOW_ATTRIBUTE, Button, Checkbox, Checklist, ConditionChecker, DATETIME_SUBTYPES, DATETIME_SUBTYPES_LABELS, DATETIME_SUBTYPE_PATH, DATE_DISALLOW_PAST_PATH, DATE_LABEL_PATH, Datetime, Default, Description, DocumentPreview, DynamicList, Errors, ExpressionField, ExpressionFieldModule, ExpressionLanguageModule, ExpressionLoopPreventer, FeelExpressionLanguage, FeelersTemplating, FieldFactory, FilePicker, Form, FormComponent, FormContext, FormField, FormFieldRegistry, FormFields, FormLayouter, FormRenderContext, Group, Html, IFrame, Image, Importer, Label, LocalExpressionContext, MINUTES_IN_DAY, MarkdownRenderer, MarkdownRendererModule, Numberfield, OPTIONS_SOURCES, OPTIONS_SOURCES_DEFAULTS, OPTIONS_SOURCES_LABELS, OPTIONS_SOURCES_PATHS, OPTIONS_SOURCE_DEFAULT, PathRegistry, Radio, RenderModule, RepeatRenderManager, RepeatRenderModule, SANDBOX_ATTRIBUTE, SECURITY_ATTRIBUTES_DEFINITIONS, Select, Separator, Spacer, TIME_INTERVAL_PATH, TIME_LABEL_PATH, TIME_SERIALISINGFORMAT_LABELS, TIME_SERIALISING_FORMATS, TIME_SERIALISING_FORMAT_PATH, TIME_USE24H_PATH, Table, Taglist, Text, Textarea, Textfield, ViewerCommands, ViewerCommandsModule, buildExpressionContext, clone, createForm, createFormContainer, createInjector, escapeHTML, formFields, generateIdForType, generateIndexForType, getAncestryList, getOptionsSource, getSchemaVariables, getScrollContainer, hasEqualValue, iconsByType, isRequired, pathParse, pathsEqual, runExpressionEvaluation, runRecursively, sanitizeDateTimePickerValue, sanitizeHTML, sanitizeIFrameSource, sanitizeImageSource, sanitizeMultiSelectValue, sanitizeSingleSelectValue, schemaVersion, useExpressionEvaluation, useSingleLineTemplateEvaluation, useTemplateEvaluation, wrapCSSStyles, wrapObjectKeysWithUnderscores };
9859
+ export { ALLOW_ATTRIBUTE, Button, Checkbox, Checklist, ConditionChecker, DATETIME_SUBTYPES, DATETIME_SUBTYPES_LABELS, DATETIME_SUBTYPE_PATH, DATE_DISALLOW_PAST_PATH, DATE_LABEL_PATH, Datetime, Default, Description, DocumentPreview, DynamicList, Errors, ExpressionField, ExpressionFieldModule, ExpressionLanguageModule, ExpressionLoopPreventer, FeelExpressionLanguage, FeelersTemplating, FieldFactory, FilePicker, Form, FormComponent, FormContext, FormField, FormFieldRegistry, FormFields, FormLayouter, FormRenderContext, Group, Html, IFrame, Image, Importer, Label, LocalExpressionContext, MINUTES_IN_DAY, MarkdownRenderer, MarkdownRendererModule, Numberfield, OPTIONS_SOURCES, OPTIONS_SOURCES_DEFAULTS, OPTIONS_SOURCES_LABELS, OPTIONS_SOURCES_PATHS, OPTIONS_SOURCE_DEFAULT, PathRegistry, Radio, RenderModule, RepeatRenderManager, RepeatRenderModule, SANDBOX_ATTRIBUTE, SECURITY_ATTRIBUTES_DEFINITIONS, Select, Separator, Spacer, TEXT_VIEW_DEFAULT_TEXT, TIME_INTERVAL_PATH, TIME_LABEL_PATH, TIME_SERIALISINGFORMAT_LABELS, TIME_SERIALISING_FORMATS, TIME_SERIALISING_FORMAT_PATH, TIME_USE24H_PATH, Table, Taglist, Text, Textarea, Textfield, ViewerCommands, ViewerCommandsModule, buildExpressionContext, clone, createForm, createFormContainer, createInjector, escapeHTML, formFields, generateIdForType, generateIndexForType, getAncestryList, getOptionsSource, getSchemaVariables, getScrollContainer, hasEqualValue, iconsByType, isRequired, pathParse, pathsEqual, runExpressionEvaluation, runRecursively, sanitizeDateTimePickerValue, sanitizeHTML, sanitizeIFrameSource, sanitizeImageSource, sanitizeMultiSelectValue, sanitizeSingleSelectValue, schemaVersion, useExpressionEvaluation, useSingleLineTemplateEvaluation, useTemplateEvaluation, wrapCSSStyles, wrapObjectKeysWithUnderscores };
9849
9860
  //# sourceMappingURL=index.es.js.map