@bpmn-io/form-js-editor 0.12.0 → 0.12.2

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.
@@ -168,6 +168,7 @@
168
168
  * Context Pad
169
169
  */
170
170
  .fjs-editor-container .fjs-context-pad {
171
+ z-index: 2;
171
172
  position: absolute;
172
173
  top: 3px;
173
174
  right: 3px;
package/dist/index.cjs CHANGED
@@ -717,7 +717,7 @@ function EditorText(props) {
717
717
  type,
718
718
  text = ''
719
719
  } = props.field;
720
- const Icon = formJsViewer.iconsByType['text'];
720
+ const Icon = formJsViewer.iconsByType('text');
721
721
  if (!text) {
722
722
  return jsxRuntime.jsx("div", {
723
723
  class: editorFormFieldClasses(type),
@@ -883,11 +883,11 @@ function Palette(props) {
883
883
  label,
884
884
  type
885
885
  }) => {
886
- const Icon = formJsViewer.iconsByType[type];
886
+ const Icon = formJsViewer.iconsByType(type);
887
887
  return jsxRuntime.jsxs("div", {
888
888
  class: "fjs-palette-field fjs-drag-copy fjs-no-drop",
889
889
  "data-field-type": type,
890
- title: `Create a ${label} element`,
890
+ title: `Create ${getIndefiniteArticle(type)} ${label} element`,
891
891
  children: [Icon ? jsxRuntime.jsx(Icon, {
892
892
  class: "fjs-palette-field-icon",
893
893
  width: "36",
@@ -926,6 +926,12 @@ function groupEntries(entries) {
926
926
  });
927
927
  return groups.filter(g => g.entries.length);
928
928
  }
929
+ function getIndefiniteArticle(type) {
930
+ if (['image'].includes(type)) {
931
+ return 'an';
932
+ }
933
+ return 'a';
934
+ }
929
935
 
930
936
  const CURSOR_CLS_PATTERN = /^fjs-cursor-.*$/;
931
937
  function set(mode) {
@@ -1264,7 +1270,7 @@ function CreatePreview(props) {
1264
1270
  } = hooks$1.useContext(DragAndDropContext$1);
1265
1271
  function handleCloned(clone, original, type) {
1266
1272
  const fieldType = clone.dataset.fieldType;
1267
- const Icon = formJsViewer.iconsByType[fieldType];
1273
+ const Icon = formJsViewer.iconsByType(fieldType);
1268
1274
  const {
1269
1275
  label
1270
1276
  } = findPaletteEntry(fieldType);
@@ -5487,7 +5493,7 @@ const PropertiesPanelHeaderProvider = {
5487
5493
  const {
5488
5494
  type
5489
5495
  } = field;
5490
- const Icon = formJsViewer.iconsByType[type];
5496
+ const Icon = formJsViewer.iconsByType(type);
5491
5497
  if (Icon) {
5492
5498
  return () => jsxRuntime.jsx(Icon, {
5493
5499
  width: "36",
@@ -5734,6 +5740,7 @@ function Description(props) {
5734
5740
  });
5735
5741
  }
5736
5742
 
5743
+ const EMPTY_OPTION = null;
5737
5744
  function DefaultOptionEntry(props) {
5738
5745
  const {
5739
5746
  editField,
@@ -5879,13 +5886,14 @@ function DefaultValueSingleSelect(props) {
5879
5886
  label
5880
5887
  } = props;
5881
5888
  const {
5882
- defaultValue,
5889
+ defaultValue = EMPTY_OPTION,
5883
5890
  values = []
5884
5891
  } = field;
5885
5892
  const path = ['defaultValue'];
5886
5893
  const getOptions = () => {
5887
5894
  return [{
5888
- label: '<none>'
5895
+ label: '<none>',
5896
+ value: EMPTY_OPTION
5889
5897
  }, ...values];
5890
5898
  };
5891
5899
  const setValue = value => {
@@ -7345,7 +7353,7 @@ function ConstraintsGroup(field, editField) {
7345
7353
 
7346
7354
  const VALIDATION_TYPE_OPTIONS = {
7347
7355
  custom: {
7348
- value: undefined,
7356
+ value: '',
7349
7357
  label: 'Custom'
7350
7358
  },
7351
7359
  email: {
@@ -7362,7 +7370,7 @@ function ValidationGroup(field, editField) {
7362
7370
  type
7363
7371
  } = field;
7364
7372
  const validate = minDash.get(field, ['validate'], {});
7365
- const isCustomValidation = [undefined, VALIDATION_TYPE_OPTIONS.custom.value].includes(validate && validate.validationType);
7373
+ const isCustomValidation = [undefined, VALIDATION_TYPE_OPTIONS.custom.value].includes(validate.validationType);
7366
7374
  if (!(INPUTS.includes(type) && type !== 'checkbox' && type !== 'checklist' && type !== 'taglist')) {
7367
7375
  return null;
7368
7376
  }