@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.cjs CHANGED
@@ -9005,7 +9005,7 @@ function isProhibitedPath(path) {
9005
9005
  return path.split('.').some(segment => prohibitedSegments.includes(segment));
9006
9006
  }
9007
9007
  const LABELED_NON_INPUTS = ['button', 'group', 'dynamiclist', 'iframe', 'table'];
9008
- const INPUTS = ['checkbox', 'checklist', 'datetime', 'number', 'radio', 'select', 'taglist', 'textfield', 'textarea'];
9008
+ const INPUTS = ['checkbox', 'checklist', 'datetime', 'number', 'radio', 'select', 'taglist', 'textfield', 'textarea', 'filepicker'];
9009
9009
  const OPTIONS_INPUTS = ['checklist', 'radio', 'select', 'taglist'];
9010
9010
  function hasEntryConfigured(formFieldDefinition, entryId) {
9011
9011
  const {
@@ -9498,7 +9498,7 @@ function DescriptionEntry(props) {
9498
9498
  editField: editField,
9499
9499
  field: field,
9500
9500
  isEdited: isEdited$6,
9501
- isDefaultVisible: field => INPUTS.includes(field.type)
9501
+ isDefaultVisible: field => field.type !== 'filepicker' && INPUTS.includes(field.type)
9502
9502
  });
9503
9503
  return entries;
9504
9504
  }
@@ -9550,26 +9550,26 @@ function DefaultValueEntry(props) {
9550
9550
  return matchers(field);
9551
9551
  };
9552
9552
  }
9553
- const defaulValueBase = {
9553
+ const defaultValueBase = {
9554
9554
  editField,
9555
9555
  field,
9556
9556
  id: 'defaultValue',
9557
9557
  label: 'Default value'
9558
9558
  };
9559
9559
  entries.push({
9560
- ...defaulValueBase,
9560
+ ...defaultValueBase,
9561
9561
  component: DefaultValueCheckbox,
9562
9562
  isEdited: isEdited$3,
9563
9563
  isDefaultVisible: isDefaultVisible(field => field.type === 'checkbox')
9564
9564
  });
9565
9565
  entries.push({
9566
- ...defaulValueBase,
9566
+ ...defaultValueBase,
9567
9567
  component: DefaultValueNumber,
9568
9568
  isEdited: isEdited,
9569
9569
  isDefaultVisible: isDefaultVisible(field => field.type === 'number')
9570
9570
  });
9571
9571
  entries.push({
9572
- ...defaulValueBase,
9572
+ ...defaultValueBase,
9573
9573
  component: DefaultValueSingleSelect,
9574
9574
  isEdited: isEdited$3,
9575
9575
  isDefaultVisible: isDefaultVisible(field => field.type === 'radio' || field.type === 'select')
@@ -9578,13 +9578,13 @@ function DefaultValueEntry(props) {
9578
9578
  // todo(Skaiir): implement a multiselect equivalent (cf. https://github.com/bpmn-io/form-js/issues/265)
9579
9579
 
9580
9580
  entries.push({
9581
- ...defaulValueBase,
9581
+ ...defaultValueBase,
9582
9582
  component: DefaultValueTextfield,
9583
9583
  isEdited: isEdited,
9584
9584
  isDefaultVisible: isDefaultVisible(field => field.type === 'textfield')
9585
9585
  });
9586
9586
  entries.push({
9587
- ...defaulValueBase,
9587
+ ...defaultValueBase,
9588
9588
  component: DefaultValueTextarea,
9589
9589
  isEdited: isEdited$1,
9590
9590
  isDefaultVisible: isDefaultVisible(field => field.type === 'textarea')
@@ -10666,7 +10666,7 @@ function Text(props) {
10666
10666
  };
10667
10667
  return FeelTemplatingEntry({
10668
10668
  debounce,
10669
- description: description$1,
10669
+ description: description$2,
10670
10670
  element: field,
10671
10671
  getValue,
10672
10672
  id,
@@ -10676,7 +10676,7 @@ function Text(props) {
10676
10676
  variables
10677
10677
  });
10678
10678
  }
10679
- const description$1 = jsxRuntime.jsxs(jsxRuntime.Fragment, {
10679
+ const description$2 = jsxRuntime.jsxs(jsxRuntime.Fragment, {
10680
10680
  children: ["Supports markdown and templating.", ' ', jsxRuntime.jsx("a", {
10681
10681
  href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-text/",
10682
10682
  target: "_blank",
@@ -10718,7 +10718,7 @@ function Content(props) {
10718
10718
  };
10719
10719
  return FeelTemplatingEntry({
10720
10720
  debounce,
10721
- description,
10721
+ description: description$1,
10722
10722
  element: field,
10723
10723
  getValue,
10724
10724
  id,
@@ -10732,7 +10732,7 @@ function Content(props) {
10732
10732
 
10733
10733
  // helpers //////////
10734
10734
 
10735
- const description = jsxRuntime.jsxs(jsxRuntime.Fragment, {
10735
+ const description$1 = jsxRuntime.jsxs(jsxRuntime.Fragment, {
10736
10736
  children: ["Supports HTML, styling, and templating. Styles are automatically scoped to the HTML component.", ' ', jsxRuntime.jsx("a", {
10737
10737
  href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-html/",
10738
10738
  target: "_blank",
@@ -12501,10 +12501,162 @@ function StaticColumnsSourceEntry(props) {
12501
12501
  };
12502
12502
  }
12503
12503
 
12504
+ function VersionTagEntry(props) {
12505
+ const {
12506
+ editField,
12507
+ field
12508
+ } = props;
12509
+ const entries = [];
12510
+ entries.push({
12511
+ id: 'versionTag',
12512
+ component: VersionTag,
12513
+ editField: editField,
12514
+ field: field,
12515
+ isEdited: isEdited,
12516
+ isDefaultVisible: field => field.type === 'default'
12517
+ });
12518
+ return entries;
12519
+ }
12520
+ function VersionTag(props) {
12521
+ const {
12522
+ editField,
12523
+ field,
12524
+ id
12525
+ } = props;
12526
+ const debounce = useService('debounce');
12527
+ const path = ['versionTag'];
12528
+ const getValue = () => {
12529
+ return minDash.get(field, path, '');
12530
+ };
12531
+ const setValue = (value, error) => {
12532
+ if (error) {
12533
+ return;
12534
+ }
12535
+ return editField(field, path, value);
12536
+ };
12537
+ const tooltip = jsxRuntime.jsx("div", {
12538
+ children: "Version tag by which this form can be referenced."
12539
+ });
12540
+ return TextfieldEntry({
12541
+ debounce,
12542
+ element: field,
12543
+ getValue,
12544
+ id,
12545
+ label: 'Version tag',
12546
+ setValue,
12547
+ tooltip
12548
+ });
12549
+ }
12550
+
12551
+ function AcceptEntry(props) {
12552
+ const {
12553
+ editField,
12554
+ field
12555
+ } = props;
12556
+ const entries = [];
12557
+ entries.push({
12558
+ id: 'accept',
12559
+ component: Accept,
12560
+ editField: editField,
12561
+ field: field,
12562
+ isEdited: isEdited$6,
12563
+ isDefaultVisible: field => field.type === 'filepicker'
12564
+ });
12565
+ return entries;
12566
+ }
12567
+ function Accept(props) {
12568
+ const {
12569
+ editField,
12570
+ field,
12571
+ id
12572
+ } = props;
12573
+ const debounce = useService('debounce');
12574
+ const variables = useVariables().map(name => ({
12575
+ name
12576
+ }));
12577
+ const path = ['accept'];
12578
+ const getValue = () => {
12579
+ return minDash.get(field, path, '');
12580
+ };
12581
+ const setValue = value => {
12582
+ return editField(field, path, value);
12583
+ };
12584
+ return FeelTemplatingEntry({
12585
+ debounce,
12586
+ element: field,
12587
+ getValue,
12588
+ id,
12589
+ label: 'Supported file formats',
12590
+ singleLine: true,
12591
+ setValue,
12592
+ variables,
12593
+ description
12594
+ });
12595
+ }
12596
+
12597
+ // helpers //////////
12598
+
12599
+ const description = jsxRuntime.jsxs(jsxRuntime.Fragment, {
12600
+ children: ["A comma-separated list of", ' ', jsxRuntime.jsx("a", {
12601
+ href: "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers",
12602
+ target: "_blank",
12603
+ children: "file type specifiers"
12604
+ })]
12605
+ });
12606
+
12607
+ function MultipleEntry(props) {
12608
+ const {
12609
+ editField,
12610
+ field
12611
+ } = props;
12612
+ const entries = [];
12613
+ entries.push({
12614
+ id: 'multiple',
12615
+ component: Multiple,
12616
+ editField: editField,
12617
+ field: field,
12618
+ isEdited: isEdited$6,
12619
+ isDefaultVisible: field => field.type === 'filepicker'
12620
+ });
12621
+ return entries;
12622
+ }
12623
+ function Multiple(props) {
12624
+ const {
12625
+ editField,
12626
+ field,
12627
+ id
12628
+ } = props;
12629
+ const debounce = useService('debounce');
12630
+ const variables = useVariables().map(name => ({
12631
+ name
12632
+ }));
12633
+ const path = ['multiple'];
12634
+ const getValue = () => {
12635
+ return minDash.get(field, path, '');
12636
+ };
12637
+ const setValue = value => {
12638
+ return editField(field, path, value);
12639
+ };
12640
+ return FeelToggleSwitchEntry({
12641
+ debounce,
12642
+ element: field,
12643
+ feel: 'optional',
12644
+ getValue,
12645
+ id,
12646
+ label: 'Select multiple files',
12647
+ inline: true,
12648
+ setValue,
12649
+ variables
12650
+ });
12651
+ }
12652
+
12504
12653
  function GeneralGroup(field, editField, getService) {
12505
12654
  const entries = [...IdEntry({
12506
12655
  field,
12507
12656
  editField
12657
+ }), ...VersionTagEntry({
12658
+ field,
12659
+ editField
12508
12660
  }), ...LabelEntry({
12509
12661
  field,
12510
12662
  editField
@@ -12564,6 +12716,12 @@ function GeneralGroup(field, editField, getService) {
12564
12716
  }), ...SelectEntries({
12565
12717
  field,
12566
12718
  editField
12719
+ }), ...AcceptEntry({
12720
+ field,
12721
+ editField
12722
+ }), ...MultipleEntry({
12723
+ field,
12724
+ editField
12567
12725
  }), ...DisabledEntry({
12568
12726
  field,
12569
12727
  editField