@bpmn-io/form-js-editor 1.9.2 → 1.11.0-alpha.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
@@ -8985,7 +8985,7 @@ function isProhibitedPath(path) {
8985
8985
  return path.split('.').some(segment => prohibitedSegments.includes(segment));
8986
8986
  }
8987
8987
  const LABELED_NON_INPUTS = ['button', 'group', 'dynamiclist', 'iframe', 'table'];
8988
- const INPUTS = ['checkbox', 'checklist', 'datetime', 'number', 'radio', 'select', 'taglist', 'textfield', 'textarea'];
8988
+ const INPUTS = ['checkbox', 'checklist', 'datetime', 'number', 'radio', 'select', 'taglist', 'textfield', 'textarea', 'filepicker'];
8989
8989
  const OPTIONS_INPUTS = ['checklist', 'radio', 'select', 'taglist'];
8990
8990
  function hasEntryConfigured(formFieldDefinition, entryId) {
8991
8991
  const {
@@ -9478,7 +9478,7 @@ function DescriptionEntry(props) {
9478
9478
  editField: editField,
9479
9479
  field: field,
9480
9480
  isEdited: isEdited$6,
9481
- isDefaultVisible: field => INPUTS.includes(field.type)
9481
+ isDefaultVisible: field => field.type !== 'filepicker' && INPUTS.includes(field.type)
9482
9482
  });
9483
9483
  return entries;
9484
9484
  }
@@ -9530,26 +9530,26 @@ function DefaultValueEntry(props) {
9530
9530
  return matchers(field);
9531
9531
  };
9532
9532
  }
9533
- const defaulValueBase = {
9533
+ const defaultValueBase = {
9534
9534
  editField,
9535
9535
  field,
9536
9536
  id: 'defaultValue',
9537
9537
  label: 'Default value'
9538
9538
  };
9539
9539
  entries.push({
9540
- ...defaulValueBase,
9540
+ ...defaultValueBase,
9541
9541
  component: DefaultValueCheckbox,
9542
9542
  isEdited: isEdited$3,
9543
9543
  isDefaultVisible: isDefaultVisible(field => field.type === 'checkbox')
9544
9544
  });
9545
9545
  entries.push({
9546
- ...defaulValueBase,
9546
+ ...defaultValueBase,
9547
9547
  component: DefaultValueNumber,
9548
9548
  isEdited: isEdited,
9549
9549
  isDefaultVisible: isDefaultVisible(field => field.type === 'number')
9550
9550
  });
9551
9551
  entries.push({
9552
- ...defaulValueBase,
9552
+ ...defaultValueBase,
9553
9553
  component: DefaultValueSingleSelect,
9554
9554
  isEdited: isEdited$3,
9555
9555
  isDefaultVisible: isDefaultVisible(field => field.type === 'radio' || field.type === 'select')
@@ -9558,13 +9558,13 @@ function DefaultValueEntry(props) {
9558
9558
  // todo(Skaiir): implement a multiselect equivalent (cf. https://github.com/bpmn-io/form-js/issues/265)
9559
9559
 
9560
9560
  entries.push({
9561
- ...defaulValueBase,
9561
+ ...defaultValueBase,
9562
9562
  component: DefaultValueTextfield,
9563
9563
  isEdited: isEdited,
9564
9564
  isDefaultVisible: isDefaultVisible(field => field.type === 'textfield')
9565
9565
  });
9566
9566
  entries.push({
9567
- ...defaulValueBase,
9567
+ ...defaultValueBase,
9568
9568
  component: DefaultValueTextarea,
9569
9569
  isEdited: isEdited$1,
9570
9570
  isDefaultVisible: isDefaultVisible(field => field.type === 'textarea')
@@ -10646,7 +10646,7 @@ function Text(props) {
10646
10646
  };
10647
10647
  return FeelTemplatingEntry({
10648
10648
  debounce,
10649
- description: description$1,
10649
+ description: description$2,
10650
10650
  element: field,
10651
10651
  getValue,
10652
10652
  id,
@@ -10656,7 +10656,7 @@ function Text(props) {
10656
10656
  variables
10657
10657
  });
10658
10658
  }
10659
- const description$1 = jsxs(Fragment$1, {
10659
+ const description$2 = jsxs(Fragment$1, {
10660
10660
  children: ["Supports markdown and templating.", ' ', jsx("a", {
10661
10661
  href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-text/",
10662
10662
  target: "_blank",
@@ -10698,7 +10698,7 @@ function Content(props) {
10698
10698
  };
10699
10699
  return FeelTemplatingEntry({
10700
10700
  debounce,
10701
- description,
10701
+ description: description$1,
10702
10702
  element: field,
10703
10703
  getValue,
10704
10704
  id,
@@ -10712,7 +10712,7 @@ function Content(props) {
10712
10712
 
10713
10713
  // helpers //////////
10714
10714
 
10715
- const description = jsxs(Fragment$1, {
10715
+ const description$1 = jsxs(Fragment$1, {
10716
10716
  children: ["Supports HTML, styling, and templating. Styles are automatically scoped to the HTML component.", ' ', jsx("a", {
10717
10717
  href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-html/",
10718
10718
  target: "_blank",
@@ -12481,10 +12481,162 @@ function StaticColumnsSourceEntry(props) {
12481
12481
  };
12482
12482
  }
12483
12483
 
12484
+ function VersionTagEntry(props) {
12485
+ const {
12486
+ editField,
12487
+ field
12488
+ } = props;
12489
+ const entries = [];
12490
+ entries.push({
12491
+ id: 'versionTag',
12492
+ component: VersionTag,
12493
+ editField: editField,
12494
+ field: field,
12495
+ isEdited: isEdited,
12496
+ isDefaultVisible: field => field.type === 'default'
12497
+ });
12498
+ return entries;
12499
+ }
12500
+ function VersionTag(props) {
12501
+ const {
12502
+ editField,
12503
+ field,
12504
+ id
12505
+ } = props;
12506
+ const debounce = useService('debounce');
12507
+ const path = ['versionTag'];
12508
+ const getValue = () => {
12509
+ return get(field, path, '');
12510
+ };
12511
+ const setValue = (value, error) => {
12512
+ if (error) {
12513
+ return;
12514
+ }
12515
+ return editField(field, path, value);
12516
+ };
12517
+ const tooltip = jsx("div", {
12518
+ children: "Version tag by which this form can be referenced."
12519
+ });
12520
+ return TextfieldEntry({
12521
+ debounce,
12522
+ element: field,
12523
+ getValue,
12524
+ id,
12525
+ label: 'Version tag',
12526
+ setValue,
12527
+ tooltip
12528
+ });
12529
+ }
12530
+
12531
+ function AcceptEntry(props) {
12532
+ const {
12533
+ editField,
12534
+ field
12535
+ } = props;
12536
+ const entries = [];
12537
+ entries.push({
12538
+ id: 'accept',
12539
+ component: Accept,
12540
+ editField: editField,
12541
+ field: field,
12542
+ isEdited: isEdited$6,
12543
+ isDefaultVisible: field => field.type === 'filepicker'
12544
+ });
12545
+ return entries;
12546
+ }
12547
+ function Accept(props) {
12548
+ const {
12549
+ editField,
12550
+ field,
12551
+ id
12552
+ } = props;
12553
+ const debounce = useService('debounce');
12554
+ const variables = useVariables().map(name => ({
12555
+ name
12556
+ }));
12557
+ const path = ['accept'];
12558
+ const getValue = () => {
12559
+ return get(field, path, '');
12560
+ };
12561
+ const setValue = value => {
12562
+ return editField(field, path, value);
12563
+ };
12564
+ return FeelTemplatingEntry({
12565
+ debounce,
12566
+ element: field,
12567
+ getValue,
12568
+ id,
12569
+ label: 'Supported file formats',
12570
+ singleLine: true,
12571
+ setValue,
12572
+ variables,
12573
+ description
12574
+ });
12575
+ }
12576
+
12577
+ // helpers //////////
12578
+
12579
+ const description = jsxs(Fragment$1, {
12580
+ children: ["A comma-separated list of", ' ', jsx("a", {
12581
+ href: "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers",
12582
+ target: "_blank",
12583
+ children: "file type specifiers"
12584
+ })]
12585
+ });
12586
+
12587
+ function MultipleEntry(props) {
12588
+ const {
12589
+ editField,
12590
+ field
12591
+ } = props;
12592
+ const entries = [];
12593
+ entries.push({
12594
+ id: 'multiple',
12595
+ component: Multiple,
12596
+ editField: editField,
12597
+ field: field,
12598
+ isEdited: isEdited$6,
12599
+ isDefaultVisible: field => field.type === 'filepicker'
12600
+ });
12601
+ return entries;
12602
+ }
12603
+ function Multiple(props) {
12604
+ const {
12605
+ editField,
12606
+ field,
12607
+ id
12608
+ } = props;
12609
+ const debounce = useService('debounce');
12610
+ const variables = useVariables().map(name => ({
12611
+ name
12612
+ }));
12613
+ const path = ['multiple'];
12614
+ const getValue = () => {
12615
+ return get(field, path, '');
12616
+ };
12617
+ const setValue = value => {
12618
+ return editField(field, path, value);
12619
+ };
12620
+ return FeelToggleSwitchEntry({
12621
+ debounce,
12622
+ element: field,
12623
+ feel: 'optional',
12624
+ getValue,
12625
+ id,
12626
+ label: 'Select multiple files',
12627
+ inline: true,
12628
+ setValue,
12629
+ variables
12630
+ });
12631
+ }
12632
+
12484
12633
  function GeneralGroup(field, editField, getService) {
12485
12634
  const entries = [...IdEntry({
12486
12635
  field,
12487
12636
  editField
12637
+ }), ...VersionTagEntry({
12638
+ field,
12639
+ editField
12488
12640
  }), ...LabelEntry({
12489
12641
  field,
12490
12642
  editField
@@ -12544,6 +12696,12 @@ function GeneralGroup(field, editField, getService) {
12544
12696
  }), ...SelectEntries({
12545
12697
  field,
12546
12698
  editField
12699
+ }), ...AcceptEntry({
12700
+ field,
12701
+ editField
12702
+ }), ...MultipleEntry({
12703
+ field,
12704
+ editField
12547
12705
  }), ...DisabledEntry({
12548
12706
  field,
12549
12707
  editField