@bpmn-io/form-js-viewer 1.7.0 → 1.7.1

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
@@ -1589,7 +1589,8 @@ function useCleanupMultiSelectValue(props) {
1589
1589
 
1590
1590
  function Description(props) {
1591
1591
  const {
1592
- description
1592
+ description,
1593
+ id
1593
1594
  } = props;
1594
1595
  const evaluatedDescription = useSingleLineTemplateEvaluation(description || '', {
1595
1596
  debug: true
@@ -1598,6 +1599,7 @@ function Description(props) {
1598
1599
  return null;
1599
1600
  }
1600
1601
  return jsxRuntime.jsx("div", {
1602
+ id: id,
1601
1603
  class: "fjs-form-field-description",
1602
1604
  children: evaluatedDescription
1603
1605
  });
@@ -1628,6 +1630,7 @@ function Errors(props) {
1628
1630
  function Label(props) {
1629
1631
  const {
1630
1632
  id,
1633
+ htmlFor,
1631
1634
  label,
1632
1635
  collapseOnEmpty = true,
1633
1636
  required = false
@@ -1636,12 +1639,14 @@ function Label(props) {
1636
1639
  debug: true
1637
1640
  });
1638
1641
  return jsxRuntime.jsxs("label", {
1639
- for: id,
1642
+ id: id,
1643
+ for: htmlFor,
1640
1644
  class: classNames('fjs-form-field-label', {
1641
1645
  'fjs-incollapsible-label': !collapseOnEmpty
1642
1646
  }, props['class']),
1643
1647
  children: [props.children, evaluatedLabel, required && jsxRuntime.jsx("span", {
1644
1648
  class: "fjs-asterix",
1649
+ "aria-hidden": true,
1645
1650
  children: "*"
1646
1651
  })]
1647
1652
  });
@@ -1652,7 +1657,6 @@ function Checkbox(props) {
1652
1657
  const {
1653
1658
  disabled,
1654
1659
  errors = [],
1655
- errorMessageId,
1656
1660
  domId,
1657
1661
  onBlur,
1658
1662
  onFocus,
@@ -1676,6 +1680,8 @@ function Checkbox(props) {
1676
1680
  value: target.checked
1677
1681
  });
1678
1682
  };
1683
+ const descriptionId = `${domId}-description`;
1684
+ const errorMessageId = `${domId}-error-message`;
1679
1685
  return jsxRuntime.jsxs("div", {
1680
1686
  class: classNames(formFieldClasses(type$f, {
1681
1687
  errors,
@@ -1685,7 +1691,7 @@ function Checkbox(props) {
1685
1691
  'fjs-checked': value
1686
1692
  }),
1687
1693
  children: [jsxRuntime.jsx(Label, {
1688
- id: domId,
1694
+ htmlFor: domId,
1689
1695
  label: label,
1690
1696
  required: required,
1691
1697
  children: jsxRuntime.jsx("input", {
@@ -1698,13 +1704,16 @@ function Checkbox(props) {
1698
1704
  onChange: onChange,
1699
1705
  onBlur: () => onBlur && onBlur(),
1700
1706
  onFocus: () => onFocus && onFocus(),
1701
- "aria-describedby": errorMessageId
1707
+ required: required,
1708
+ "aria-invalid": errors.length > 0,
1709
+ "aria-describedby": [descriptionId, errorMessageId].join(' ')
1702
1710
  })
1703
1711
  }), jsxRuntime.jsx(Description, {
1712
+ id: descriptionId,
1704
1713
  description: description
1705
1714
  }), jsxRuntime.jsx(Errors, {
1706
- errors: errors,
1707
- id: errorMessageId
1715
+ id: errorMessageId,
1716
+ errors: errors
1708
1717
  })]
1709
1718
  });
1710
1719
  }
@@ -1727,7 +1736,6 @@ function Checklist(props) {
1727
1736
  const {
1728
1737
  disabled,
1729
1738
  errors = [],
1730
- errorMessageId,
1731
1739
  domId,
1732
1740
  onBlur,
1733
1741
  onFocus,
@@ -1774,6 +1782,8 @@ function Checklist(props) {
1774
1782
  values,
1775
1783
  onChange: props.onChange
1776
1784
  });
1785
+ const descriptionId = `${domId}-description`;
1786
+ const errorMessageId = `${domId}-error-message`;
1777
1787
  return jsxRuntime.jsxs("div", {
1778
1788
  class: classNames(formFieldClasses(type$e, {
1779
1789
  errors,
@@ -1788,7 +1798,7 @@ function Checklist(props) {
1788
1798
  const itemDomId = `${domId}-${index}`;
1789
1799
  const isChecked = hasEqualValue(o.value, values);
1790
1800
  return jsxRuntime.jsx(Label, {
1791
- id: itemDomId,
1801
+ htmlFor: itemDomId,
1792
1802
  label: o.label,
1793
1803
  class: classNames({
1794
1804
  'fjs-checked': isChecked
@@ -1804,14 +1814,17 @@ function Checklist(props) {
1804
1814
  onClick: () => toggleCheckbox(o.value),
1805
1815
  onBlur: onCheckboxBlur,
1806
1816
  onFocus: onCheckboxFocus,
1807
- "aria-describedby": errorMessageId
1817
+ required: required,
1818
+ "aria-invalid": errors.length > 0,
1819
+ "aria-describedby": [descriptionId, errorMessageId].join(' ')
1808
1820
  })
1809
1821
  });
1810
1822
  }), jsxRuntime.jsx(Description, {
1823
+ id: descriptionId,
1811
1824
  description: description
1812
1825
  }), jsxRuntime.jsx(Errors, {
1813
- errors: errors,
1814
- id: errorMessageId
1826
+ id: errorMessageId,
1827
+ errors: errors
1815
1828
  })]
1816
1829
  });
1817
1830
  }
@@ -1891,6 +1904,7 @@ function FormField(props) {
1891
1904
  }
1892
1905
  }, [viewerCommands, field, initialValue, initialValidationTrigger, indexes]);
1893
1906
  const onBlur = hooks.useCallback(() => {
1907
+ const value = minDash.get(data, valuePath);
1894
1908
  if (initialValidationTrigger) {
1895
1909
  setInitialValidationTrigger(false);
1896
1910
  viewerCommands.updateFieldValidation(field, value, indexes);
@@ -1898,7 +1912,7 @@ function FormField(props) {
1898
1912
  eventBus.fire('formField.blur', {
1899
1913
  formField: field
1900
1914
  });
1901
- }, [eventBus, field, indexes, value, viewerCommands, initialValidationTrigger]);
1915
+ }, [eventBus, field, indexes, viewerCommands, initialValidationTrigger, data, valuePath]);
1902
1916
  const onFocus = hooks.useCallback(() => {
1903
1917
  eventBus.fire('formField.focus', {
1904
1918
  formField: field
@@ -1922,7 +1936,6 @@ function FormField(props) {
1922
1936
  }
1923
1937
  const domId = `${prefixId(field.id, formId, indexes)}`;
1924
1938
  const fieldErrors = minDash.get(errors, [field.id, ...Object.values(indexes || {})]) || [];
1925
- const errorMessageId = errors.length === 0 ? undefined : `${domId}-error-message`;
1926
1939
  return jsxRuntime.jsx(Column, {
1927
1940
  field: field,
1928
1941
  class: gridColumnClasses(field),
@@ -1933,7 +1946,6 @@ function FormField(props) {
1933
1946
  ...props,
1934
1947
  disabled: disabled,
1935
1948
  errors: fieldErrors,
1936
- errorMessageId: errorMessageId,
1937
1949
  domId: domId,
1938
1950
  onChange: disabled || readonly ? noop$1 : onChangeIndexed,
1939
1951
  onBlur: disabled || readonly ? noop$1 : onBlur,
@@ -2336,7 +2348,7 @@ function Datepicker(props) {
2336
2348
  return jsxRuntime.jsxs("div", {
2337
2349
  class: "fjs-datetime-subsection",
2338
2350
  children: [jsxRuntime.jsx(Label, {
2339
- id: domId,
2351
+ htmlFor: domId,
2340
2352
  label: label,
2341
2353
  collapseOnEmpty: collapseLabelOnEmpty,
2342
2354
  required: required
@@ -2608,7 +2620,7 @@ function Timepicker(props) {
2608
2620
  return jsxRuntime.jsxs("div", {
2609
2621
  class: "fjs-datetime-subsection",
2610
2622
  children: [jsxRuntime.jsx(Label, {
2611
- id: domId,
2623
+ htmlFor: domId,
2612
2624
  label: label,
2613
2625
  collapseOnEmpty: collapseLabelOnEmpty,
2614
2626
  required: required
@@ -2795,6 +2807,7 @@ function Datetime(props) {
2795
2807
  });
2796
2808
  }, []);
2797
2809
  const errorMessageId = allErrors.length === 0 ? undefined : `${prefixId(id, formId)}-error-message`;
2810
+ const descriptionId = `${prefixId(id, formId)}-description`;
2798
2811
  const datePickerProps = {
2799
2812
  label: dateLabel,
2800
2813
  collapseLabelOnEmpty: !timeLabel,
@@ -2807,7 +2820,7 @@ function Datetime(props) {
2807
2820
  date: dateTime.date,
2808
2821
  readonly,
2809
2822
  setDate,
2810
- 'aria-describedby': errorMessageId
2823
+ 'aria-describedby': [descriptionId, errorMessageId].join(' ')
2811
2824
  };
2812
2825
  const timePickerProps = {
2813
2826
  label: timeLabel,
@@ -2822,7 +2835,7 @@ function Datetime(props) {
2822
2835
  timeInterval,
2823
2836
  time: dateTime.time,
2824
2837
  setTime,
2825
- 'aria-describedby': errorMessageId
2838
+ 'aria-describedby': [descriptionId, errorMessageId].join(' ')
2826
2839
  };
2827
2840
  return jsxRuntime.jsxs("div", {
2828
2841
  class: formFieldClasses(type$d, {
@@ -2841,6 +2854,7 @@ function Datetime(props) {
2841
2854
  ...timePickerProps
2842
2855
  })]
2843
2856
  }), jsxRuntime.jsx(Description, {
2857
+ id: descriptionId,
2844
2858
  description: description
2845
2859
  }), jsxRuntime.jsx(Errors, {
2846
2860
  errors: allErrors,
@@ -2944,7 +2958,7 @@ function IFrame(props) {
2944
2958
  readonly
2945
2959
  }),
2946
2960
  children: [jsxRuntime.jsx(Label, {
2947
- id: domId,
2961
+ htmlFor: domId,
2948
2962
  label: evaluatedLabel
2949
2963
  }), !evaluatedUrl && jsxRuntime.jsx(IFramePlaceholder, {
2950
2964
  text: "No content to show."
@@ -3490,7 +3504,6 @@ function Numberfield(props) {
3490
3504
  const {
3491
3505
  disabled,
3492
3506
  errors = [],
3493
- errorMessageId,
3494
3507
  domId,
3495
3508
  onBlur,
3496
3509
  onFocus,
@@ -3628,6 +3641,8 @@ function Numberfield(props) {
3628
3641
  e.preventDefault();
3629
3642
  }
3630
3643
  };
3644
+ const descriptionId = `${domId}-description`;
3645
+ const errorMessageId = `${domId}-error-message`;
3631
3646
  return jsxRuntime.jsxs("div", {
3632
3647
  class: formFieldClasses(type$a, {
3633
3648
  errors,
@@ -3635,7 +3650,7 @@ function Numberfield(props) {
3635
3650
  readonly
3636
3651
  }),
3637
3652
  children: [jsxRuntime.jsx(Label, {
3638
- id: domId,
3653
+ htmlFor: domId,
3639
3654
  label: label,
3640
3655
  required: required
3641
3656
  }), jsxRuntime.jsx(TemplatedInputAdorner, {
@@ -3669,7 +3684,9 @@ function Numberfield(props) {
3669
3684
  autoComplete: "off",
3670
3685
  step: incrementAmount,
3671
3686
  value: displayValue,
3672
- "aria-describedby": errorMessageId
3687
+ "aria-describedby": [descriptionId, errorMessageId].join(' '),
3688
+ required: required,
3689
+ "aria-invalid": errors.length > 0
3673
3690
  }), jsxRuntime.jsxs("div", {
3674
3691
  class: classNames('fjs-number-arrow-container', {
3675
3692
  'fjs-disabled': disabled,
@@ -3695,10 +3712,11 @@ function Numberfield(props) {
3695
3712
  })]
3696
3713
  })
3697
3714
  }), jsxRuntime.jsx(Description, {
3715
+ id: descriptionId,
3698
3716
  description: description
3699
3717
  }), jsxRuntime.jsx(Errors, {
3700
- errors: errors,
3701
- id: errorMessageId
3718
+ id: errorMessageId,
3719
+ errors: errors
3702
3720
  })]
3703
3721
  });
3704
3722
  }
@@ -3728,7 +3746,6 @@ function Radio(props) {
3728
3746
  const {
3729
3747
  disabled,
3730
3748
  errors = [],
3731
- errorMessageId,
3732
3749
  domId,
3733
3750
  onBlur,
3734
3751
  onFocus,
@@ -3774,6 +3791,8 @@ function Radio(props) {
3774
3791
  value,
3775
3792
  onChange: props.onChange
3776
3793
  });
3794
+ const descriptionId = `${domId}-description`;
3795
+ const errorMessageId = `${domId}-error-message`;
3777
3796
  return jsxRuntime.jsxs("div", {
3778
3797
  class: formFieldClasses(type$9, {
3779
3798
  errors,
@@ -3788,7 +3807,7 @@ function Radio(props) {
3788
3807
  const itemDomId = `${domId}-${index}`;
3789
3808
  const isChecked = isEqual(option.value, value);
3790
3809
  return jsxRuntime.jsx(Label, {
3791
- id: itemDomId,
3810
+ htmlFor: itemDomId,
3792
3811
  label: option.label,
3793
3812
  class: classNames({
3794
3813
  'fjs-checked': isChecked
@@ -3804,14 +3823,17 @@ function Radio(props) {
3804
3823
  onClick: () => onChange(option.value),
3805
3824
  onBlur: onRadioBlur,
3806
3825
  onFocus: onRadioFocus,
3807
- "aria-describedby": errorMessageId
3826
+ "aria-describedby": [descriptionId, errorMessageId].join(' '),
3827
+ required: required,
3828
+ "aria-invalid": errors.length > 0
3808
3829
  })
3809
3830
  }, index);
3810
3831
  }), jsxRuntime.jsx(Description, {
3832
+ id: descriptionId,
3811
3833
  description: description
3812
3834
  }), jsxRuntime.jsx(Errors, {
3813
- errors: errors,
3814
- id: errorMessageId
3835
+ id: errorMessageId,
3836
+ errors: errors
3815
3837
  })]
3816
3838
  });
3817
3839
  }
@@ -3876,7 +3898,7 @@ function SearchableSelect(props) {
3876
3898
 
3877
3899
  // whenever we change the underlying value, set the label to it
3878
3900
  hooks.useEffect(() => {
3879
- setFilter(label);
3901
+ setFilter(label || '');
3880
3902
  }, [label]);
3881
3903
  const filteredOptions = hooks.useMemo(() => {
3882
3904
  if (loadState !== LOAD_STATES.LOADED) {
@@ -3956,7 +3978,7 @@ function SearchableSelect(props) {
3956
3978
  }, [onFocus]);
3957
3979
  const onInputBlur = hooks.useCallback(() => {
3958
3980
  setIsDropdownExpanded(false);
3959
- setFilter(label);
3981
+ setFilter(label || '');
3960
3982
  onBlur && onBlur();
3961
3983
  }, [onBlur, label]);
3962
3984
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
@@ -4052,6 +4074,9 @@ function SimpleSelect(props) {
4052
4074
  }, [disabled, isDropdownExpanded, loadState, readonly, value]);
4053
4075
  const onMouseDown = hooks.useCallback(e => {
4054
4076
  const input = inputRef.current;
4077
+ if (disabled || !input) {
4078
+ return;
4079
+ }
4055
4080
  setIsDropdownExpanded(!isDropdownExpanded);
4056
4081
  if (isDropdownExpanded) {
4057
4082
  input.blur();
@@ -4059,7 +4084,7 @@ function SimpleSelect(props) {
4059
4084
  input.focus();
4060
4085
  }
4061
4086
  e.preventDefault();
4062
- }, [isDropdownExpanded]);
4087
+ }, [disabled, isDropdownExpanded]);
4063
4088
  const initialFocusIndex = hooks.useMemo(() => value && minDash.findIndex(options, o => o.value === value) || 0, [options, value]);
4064
4089
  const onInputFocus = hooks.useCallback(() => {
4065
4090
  if (!readonly) {
@@ -4131,7 +4156,6 @@ function Select(props) {
4131
4156
  const {
4132
4157
  disabled,
4133
4158
  errors = [],
4134
- errorMessageId,
4135
4159
  domId,
4136
4160
  onBlur,
4137
4161
  onFocus,
@@ -4149,6 +4173,8 @@ function Select(props) {
4149
4173
  const {
4150
4174
  required
4151
4175
  } = validate;
4176
+ const descriptionId = `${domId}-description`;
4177
+ const errorMessageId = `${domId}-error-message`;
4152
4178
  const selectProps = {
4153
4179
  domId,
4154
4180
  disabled,
@@ -4159,7 +4185,9 @@ function Select(props) {
4159
4185
  value,
4160
4186
  onChange,
4161
4187
  readonly,
4162
- 'aria-describedby': errorMessageId
4188
+ required,
4189
+ 'aria-invalid': errors.length > 0,
4190
+ 'aria-describedby': [descriptionId, errorMessageId].join(' ')
4163
4191
  };
4164
4192
  return jsxRuntime.jsxs("div", {
4165
4193
  class: formFieldClasses(type$8, {
@@ -4174,7 +4202,7 @@ function Select(props) {
4174
4202
  }
4175
4203
  },
4176
4204
  children: [jsxRuntime.jsx(Label, {
4177
- id: domId,
4205
+ htmlFor: domId,
4178
4206
  label: label,
4179
4207
  required: required
4180
4208
  }), searchable ? jsxRuntime.jsx(SearchableSelect, {
@@ -4182,10 +4210,11 @@ function Select(props) {
4182
4210
  }) : jsxRuntime.jsx(SimpleSelect, {
4183
4211
  ...selectProps
4184
4212
  }), jsxRuntime.jsx(Description, {
4213
+ id: descriptionId,
4185
4214
  description: description
4186
4215
  }), jsxRuntime.jsx(Errors, {
4187
- errors: errors,
4188
- id: errorMessageId
4216
+ id: errorMessageId,
4217
+ errors: errors
4189
4218
  })]
4190
4219
  });
4191
4220
  }
@@ -4318,7 +4347,6 @@ function Taglist(props) {
4318
4347
  const {
4319
4348
  disabled,
4320
4349
  errors = [],
4321
- errorMessageId,
4322
4350
  onFocus,
4323
4351
  domId,
4324
4352
  onBlur,
@@ -4454,6 +4482,8 @@ function Taglist(props) {
4454
4482
  inputRef.current.focus();
4455
4483
  };
4456
4484
  const shouldDisplayDropdown = hooks.useMemo(() => !disabled && loadState === LOAD_STATES.LOADED && isDropdownExpanded && !isEscapeClosed, [disabled, isDropdownExpanded, isEscapeClosed, loadState]);
4485
+ const descriptionId = `${domId}-description`;
4486
+ const errorMessageId = `${domId}-error-message`;
4457
4487
  return jsxRuntime.jsxs("div", {
4458
4488
  ref: focusScopeRef,
4459
4489
  class: formFieldClasses(type$5, {
@@ -4470,7 +4500,7 @@ function Taglist(props) {
4470
4500
  children: [jsxRuntime.jsx(Label, {
4471
4501
  label: label,
4472
4502
  required: required,
4473
- id: domId
4503
+ htmlFor: domId
4474
4504
  }), !disabled && !readonly && !!values.length && jsxRuntime.jsx(SkipLink, {
4475
4505
  className: "fjs-taglist-skip-link",
4476
4506
  label: "Skip to search",
@@ -4518,7 +4548,9 @@ function Taglist(props) {
4518
4548
  onMouseDown: () => setIsEscapeClose(false),
4519
4549
  onFocus: onInputFocus,
4520
4550
  onBlur: onInputBlur,
4521
- "aria-describedby": errorMessageId
4551
+ "aria-describedby": [descriptionId, errorMessageId].join(' '),
4552
+ required: required,
4553
+ "aria-invalid": errors.length > 0
4522
4554
  })]
4523
4555
  }), jsxRuntime.jsx("div", {
4524
4556
  class: "fjs-taglist-anchor",
@@ -4530,10 +4562,11 @@ function Taglist(props) {
4530
4562
  listenerElement: inputRef.current
4531
4563
  })
4532
4564
  }), jsxRuntime.jsx(Description, {
4565
+ id: descriptionId,
4533
4566
  description: description
4534
4567
  }), jsxRuntime.jsx(Errors, {
4535
- errors: errors,
4536
- id: errorMessageId
4568
+ id: errorMessageId,
4569
+ errors: errors
4537
4570
  })]
4538
4571
  });
4539
4572
  }
@@ -4850,7 +4883,6 @@ function Textfield(props) {
4850
4883
  const {
4851
4884
  disabled,
4852
4885
  errors = [],
4853
- errorMessageId,
4854
4886
  domId,
4855
4887
  onBlur,
4856
4888
  onFocus,
@@ -4886,6 +4918,8 @@ function Textfield(props) {
4886
4918
  const onInputFocus = () => {
4887
4919
  onFocus && onFocus();
4888
4920
  };
4921
+ const descriptionId = `${domId}-description`;
4922
+ const errorMessageId = `${domId}-error-message`;
4889
4923
  return jsxRuntime.jsxs("div", {
4890
4924
  class: formFieldClasses(type$2, {
4891
4925
  errors,
@@ -4893,7 +4927,7 @@ function Textfield(props) {
4893
4927
  readonly
4894
4928
  }),
4895
4929
  children: [jsxRuntime.jsx(Label, {
4896
- id: domId,
4930
+ htmlFor: domId,
4897
4931
  label: label,
4898
4932
  required: required
4899
4933
  }), jsxRuntime.jsx(TemplatedInputAdorner, {
@@ -4911,13 +4945,16 @@ function Textfield(props) {
4911
4945
  onFocus: onInputFocus,
4912
4946
  type: "text",
4913
4947
  value: value,
4914
- "aria-describedby": errorMessageId
4948
+ "aria-describedby": [descriptionId, errorMessageId].join(' '),
4949
+ required: required,
4950
+ "aria-invalid": errors.length > 0
4915
4951
  })
4916
4952
  }), jsxRuntime.jsx(Description, {
4953
+ id: descriptionId,
4917
4954
  description: description
4918
4955
  }), jsxRuntime.jsx(Errors, {
4919
- errors: errors,
4920
- id: errorMessageId
4956
+ id: errorMessageId,
4957
+ errors: errors
4921
4958
  })]
4922
4959
  });
4923
4960
  }
@@ -4950,7 +4987,6 @@ function Textarea(props) {
4950
4987
  const {
4951
4988
  disabled,
4952
4989
  errors = [],
4953
- errorMessageId,
4954
4990
  domId,
4955
4991
  onBlur,
4956
4992
  onFocus,
@@ -4994,6 +5030,8 @@ function Textarea(props) {
4994
5030
  hooks.useEffect(() => {
4995
5031
  autoSizeTextarea(textareaRef.current);
4996
5032
  }, []);
5033
+ const descriptionId = `${domId}-description`;
5034
+ const errorMessageId = `${domId}-error-message`;
4997
5035
  return jsxRuntime.jsxs("div", {
4998
5036
  class: formFieldClasses(type$1, {
4999
5037
  errors,
@@ -5001,7 +5039,7 @@ function Textarea(props) {
5001
5039
  readonly
5002
5040
  }),
5003
5041
  children: [jsxRuntime.jsx(Label, {
5004
- id: domId,
5042
+ htmlFor: domId,
5005
5043
  label: label,
5006
5044
  required: required
5007
5045
  }), jsxRuntime.jsx("textarea", {
@@ -5014,12 +5052,15 @@ function Textarea(props) {
5014
5052
  onFocus: onInputFocus,
5015
5053
  value: value,
5016
5054
  ref: textareaRef,
5017
- "aria-describedby": errorMessageId
5055
+ "aria-describedby": [descriptionId, errorMessageId].join(' '),
5056
+ required: required,
5057
+ "aria-invalid": errors.length > 0
5018
5058
  }), jsxRuntime.jsx(Description, {
5059
+ id: descriptionId,
5019
5060
  description: description
5020
5061
  }), jsxRuntime.jsx(Errors, {
5021
- errors: errors,
5022
- id: errorMessageId
5062
+ id: errorMessageId,
5063
+ errors: errors
5023
5064
  })]
5024
5065
  });
5025
5066
  }
@@ -5188,7 +5229,7 @@ function Table(props) {
5188
5229
  return jsxRuntime.jsxs("div", {
5189
5230
  class: formFieldClasses(type),
5190
5231
  children: [jsxRuntime.jsx(Label, {
5191
- id: prefixId(id),
5232
+ htmlFor: prefixId(id),
5192
5233
  label: label
5193
5234
  }), jsxRuntime.jsxs("div", {
5194
5235
  class: classNames('fjs-table-middle-container', {
@@ -5588,7 +5629,7 @@ class FormFields {
5588
5629
  }
5589
5630
 
5590
5631
  const EXPRESSION_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'conditional.hide', 'description', 'label', 'source', 'readonly', 'text', 'validate.min', 'validate.max', 'validate.minLength', 'validate.maxLength', 'valuesExpression', 'url', 'dataSource', 'columnsExpression'];
5591
- const TEMPLATE_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'description', 'label', 'source', 'text', 'url'];
5632
+ const TEMPLATE_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'description', 'label', 'source', 'text', 'content', 'url'];
5592
5633
 
5593
5634
  /**
5594
5635
  * @typedef { import('../types').Schema } Schema
@@ -6574,47 +6615,17 @@ class RepeatRenderManager {
6574
6615
  };
6575
6616
  const parentExpressionContextInfo = hooks.useContext(LocalExpressionContext);
6576
6617
  return jsxRuntime.jsx(jsxRuntime.Fragment, {
6577
- children: displayValues.map((value, index) => {
6578
- const elementProps = hooks.useMemo(() => ({
6579
- ...restProps,
6580
- indexes: {
6581
- ...(indexes || {}),
6582
- [repeaterField.id]: index
6583
- }
6584
- }), [index]);
6585
- const localExpressionContextInfo = hooks.useMemo(() => ({
6586
- data: parentExpressionContextInfo.data,
6587
- this: value,
6588
- parent: buildExpressionContext(parentExpressionContextInfo),
6589
- i: [...parentExpressionContextInfo.i, index + 1]
6590
- }), [index, value]);
6591
- return !showRemove ? jsxRuntime.jsx(LocalExpressionContext.Provider, {
6592
- value: localExpressionContextInfo,
6593
- children: jsxRuntime.jsx(RowsRenderer, {
6594
- ...elementProps
6595
- })
6596
- }) : jsxRuntime.jsxs("div", {
6597
- class: "fjs-repeat-row-container",
6598
- children: [jsxRuntime.jsx("div", {
6599
- class: "fjs-repeat-row-rows",
6600
- children: jsxRuntime.jsx(LocalExpressionContext.Provider, {
6601
- value: localExpressionContextInfo,
6602
- children: jsxRuntime.jsx(RowsRenderer, {
6603
- ...elementProps
6604
- })
6605
- })
6606
- }), jsxRuntime.jsx("button", {
6607
- class: "fjs-repeat-row-remove",
6608
- type: "button",
6609
- "aria-label": `Remove list item ${index + 1}`,
6610
- onClick: () => onDeleteItem(index),
6611
- children: jsxRuntime.jsx("div", {
6612
- class: "fjs-repeat-row-remove-icon-container",
6613
- children: jsxRuntime.jsx(DeleteSvg, {})
6614
- })
6615
- })]
6616
- });
6617
- })
6618
+ children: displayValues.map((value, index) => jsxRuntime.jsx(RepetitionScaffold, {
6619
+ index: index,
6620
+ value: value,
6621
+ parentExpressionContextInfo: parentExpressionContextInfo,
6622
+ repeaterField: repeaterField,
6623
+ RowsRenderer: RowsRenderer,
6624
+ indexes: indexes,
6625
+ onDeleteItem: onDeleteItem,
6626
+ showRemove: showRemove,
6627
+ ...restProps
6628
+ }, index))
6618
6629
  });
6619
6630
  }
6620
6631
  RepeatFooter(props) {
@@ -6706,6 +6717,73 @@ class RepeatRenderManager {
6706
6717
  return nonCollapsedItems ? nonCollapsedItems : DEFAULT_NON_COLLAPSED_ITEMS;
6707
6718
  }
6708
6719
  }
6720
+
6721
+ /**
6722
+ * Individual repetition of a repeated field and context scaffolding.
6723
+ *
6724
+ * @param {Object} props
6725
+ * @param {number} props.index
6726
+ * @param {Object} props.value
6727
+ * @param {Object} props.parentExpressionContextInfo
6728
+ * @param {Object} props.repeaterField
6729
+ * @param {Function} props.RowsRenderer
6730
+ * @param {Object} props.indexes
6731
+ * @param {Function} props.onDeleteItem
6732
+ * @param {boolean} props.showRemove
6733
+ */
6734
+
6735
+ const RepetitionScaffold = props => {
6736
+ const {
6737
+ index,
6738
+ value,
6739
+ parentExpressionContextInfo,
6740
+ repeaterField,
6741
+ RowsRenderer,
6742
+ indexes,
6743
+ onDeleteItem,
6744
+ showRemove,
6745
+ ...restProps
6746
+ } = props;
6747
+ const elementProps = hooks.useMemo(() => ({
6748
+ ...restProps,
6749
+ indexes: {
6750
+ ...(indexes || {}),
6751
+ [repeaterField.id]: index
6752
+ }
6753
+ }), [index, indexes, repeaterField.id, restProps]);
6754
+ const localExpressionContextInfo = hooks.useMemo(() => ({
6755
+ data: parentExpressionContextInfo.data,
6756
+ this: value,
6757
+ parent: buildExpressionContext(parentExpressionContextInfo),
6758
+ i: [...parentExpressionContextInfo.i, index + 1]
6759
+ }), [index, parentExpressionContextInfo, value]);
6760
+ return !showRemove ? jsxRuntime.jsx(LocalExpressionContext.Provider, {
6761
+ value: localExpressionContextInfo,
6762
+ children: jsxRuntime.jsx(RowsRenderer, {
6763
+ ...elementProps
6764
+ })
6765
+ }) : jsxRuntime.jsxs("div", {
6766
+ class: "fjs-repeat-row-container",
6767
+ children: [jsxRuntime.jsx("div", {
6768
+ class: "fjs-repeat-row-rows",
6769
+ children: jsxRuntime.jsx(LocalExpressionContext.Provider, {
6770
+ value: localExpressionContextInfo,
6771
+ children: jsxRuntime.jsx(RowsRenderer, {
6772
+ ...elementProps
6773
+ })
6774
+ })
6775
+ }), jsxRuntime.jsx("button", {
6776
+ class: "fjs-repeat-row-remove",
6777
+ type: "button",
6778
+ "aria-label": `Remove list item ${index + 1}`,
6779
+ onClick: () => onDeleteItem(index),
6780
+ children: jsxRuntime.jsx("div", {
6781
+ class: "fjs-repeat-row-remove-icon-container",
6782
+ children: jsxRuntime.jsx(DeleteSvg, {})
6783
+ })
6784
+ })]
6785
+ });
6786
+ };
6709
6787
  RepeatRenderManager.$inject = ['form', 'formFields', 'formFieldRegistry', 'pathRegistry'];
6710
6788
 
6711
6789
  const RepeatRenderModule = {