@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 +174 -96
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +174 -96
- package/dist/index.es.js.map +1 -1
- package/dist/types/render/components/Label.d.ts +4 -2
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1569,7 +1569,8 @@ function useCleanupMultiSelectValue(props) {
|
|
|
1569
1569
|
|
|
1570
1570
|
function Description(props) {
|
|
1571
1571
|
const {
|
|
1572
|
-
description
|
|
1572
|
+
description,
|
|
1573
|
+
id
|
|
1573
1574
|
} = props;
|
|
1574
1575
|
const evaluatedDescription = useSingleLineTemplateEvaluation(description || '', {
|
|
1575
1576
|
debug: true
|
|
@@ -1578,6 +1579,7 @@ function Description(props) {
|
|
|
1578
1579
|
return null;
|
|
1579
1580
|
}
|
|
1580
1581
|
return jsx("div", {
|
|
1582
|
+
id: id,
|
|
1581
1583
|
class: "fjs-form-field-description",
|
|
1582
1584
|
children: evaluatedDescription
|
|
1583
1585
|
});
|
|
@@ -1608,6 +1610,7 @@ function Errors(props) {
|
|
|
1608
1610
|
function Label(props) {
|
|
1609
1611
|
const {
|
|
1610
1612
|
id,
|
|
1613
|
+
htmlFor,
|
|
1611
1614
|
label,
|
|
1612
1615
|
collapseOnEmpty = true,
|
|
1613
1616
|
required = false
|
|
@@ -1616,12 +1619,14 @@ function Label(props) {
|
|
|
1616
1619
|
debug: true
|
|
1617
1620
|
});
|
|
1618
1621
|
return jsxs("label", {
|
|
1619
|
-
|
|
1622
|
+
id: id,
|
|
1623
|
+
for: htmlFor,
|
|
1620
1624
|
class: classNames('fjs-form-field-label', {
|
|
1621
1625
|
'fjs-incollapsible-label': !collapseOnEmpty
|
|
1622
1626
|
}, props['class']),
|
|
1623
1627
|
children: [props.children, evaluatedLabel, required && jsx("span", {
|
|
1624
1628
|
class: "fjs-asterix",
|
|
1629
|
+
"aria-hidden": true,
|
|
1625
1630
|
children: "*"
|
|
1626
1631
|
})]
|
|
1627
1632
|
});
|
|
@@ -1632,7 +1637,6 @@ function Checkbox(props) {
|
|
|
1632
1637
|
const {
|
|
1633
1638
|
disabled,
|
|
1634
1639
|
errors = [],
|
|
1635
|
-
errorMessageId,
|
|
1636
1640
|
domId,
|
|
1637
1641
|
onBlur,
|
|
1638
1642
|
onFocus,
|
|
@@ -1656,6 +1660,8 @@ function Checkbox(props) {
|
|
|
1656
1660
|
value: target.checked
|
|
1657
1661
|
});
|
|
1658
1662
|
};
|
|
1663
|
+
const descriptionId = `${domId}-description`;
|
|
1664
|
+
const errorMessageId = `${domId}-error-message`;
|
|
1659
1665
|
return jsxs("div", {
|
|
1660
1666
|
class: classNames(formFieldClasses(type$f, {
|
|
1661
1667
|
errors,
|
|
@@ -1665,7 +1671,7 @@ function Checkbox(props) {
|
|
|
1665
1671
|
'fjs-checked': value
|
|
1666
1672
|
}),
|
|
1667
1673
|
children: [jsx(Label, {
|
|
1668
|
-
|
|
1674
|
+
htmlFor: domId,
|
|
1669
1675
|
label: label,
|
|
1670
1676
|
required: required,
|
|
1671
1677
|
children: jsx("input", {
|
|
@@ -1678,13 +1684,16 @@ function Checkbox(props) {
|
|
|
1678
1684
|
onChange: onChange,
|
|
1679
1685
|
onBlur: () => onBlur && onBlur(),
|
|
1680
1686
|
onFocus: () => onFocus && onFocus(),
|
|
1681
|
-
|
|
1687
|
+
required: required,
|
|
1688
|
+
"aria-invalid": errors.length > 0,
|
|
1689
|
+
"aria-describedby": [descriptionId, errorMessageId].join(' ')
|
|
1682
1690
|
})
|
|
1683
1691
|
}), jsx(Description, {
|
|
1692
|
+
id: descriptionId,
|
|
1684
1693
|
description: description
|
|
1685
1694
|
}), jsx(Errors, {
|
|
1686
|
-
|
|
1687
|
-
|
|
1695
|
+
id: errorMessageId,
|
|
1696
|
+
errors: errors
|
|
1688
1697
|
})]
|
|
1689
1698
|
});
|
|
1690
1699
|
}
|
|
@@ -1707,7 +1716,6 @@ function Checklist(props) {
|
|
|
1707
1716
|
const {
|
|
1708
1717
|
disabled,
|
|
1709
1718
|
errors = [],
|
|
1710
|
-
errorMessageId,
|
|
1711
1719
|
domId,
|
|
1712
1720
|
onBlur,
|
|
1713
1721
|
onFocus,
|
|
@@ -1754,6 +1762,8 @@ function Checklist(props) {
|
|
|
1754
1762
|
values,
|
|
1755
1763
|
onChange: props.onChange
|
|
1756
1764
|
});
|
|
1765
|
+
const descriptionId = `${domId}-description`;
|
|
1766
|
+
const errorMessageId = `${domId}-error-message`;
|
|
1757
1767
|
return jsxs("div", {
|
|
1758
1768
|
class: classNames(formFieldClasses(type$e, {
|
|
1759
1769
|
errors,
|
|
@@ -1768,7 +1778,7 @@ function Checklist(props) {
|
|
|
1768
1778
|
const itemDomId = `${domId}-${index}`;
|
|
1769
1779
|
const isChecked = hasEqualValue(o.value, values);
|
|
1770
1780
|
return jsx(Label, {
|
|
1771
|
-
|
|
1781
|
+
htmlFor: itemDomId,
|
|
1772
1782
|
label: o.label,
|
|
1773
1783
|
class: classNames({
|
|
1774
1784
|
'fjs-checked': isChecked
|
|
@@ -1784,14 +1794,17 @@ function Checklist(props) {
|
|
|
1784
1794
|
onClick: () => toggleCheckbox(o.value),
|
|
1785
1795
|
onBlur: onCheckboxBlur,
|
|
1786
1796
|
onFocus: onCheckboxFocus,
|
|
1787
|
-
|
|
1797
|
+
required: required,
|
|
1798
|
+
"aria-invalid": errors.length > 0,
|
|
1799
|
+
"aria-describedby": [descriptionId, errorMessageId].join(' ')
|
|
1788
1800
|
})
|
|
1789
1801
|
});
|
|
1790
1802
|
}), jsx(Description, {
|
|
1803
|
+
id: descriptionId,
|
|
1791
1804
|
description: description
|
|
1792
1805
|
}), jsx(Errors, {
|
|
1793
|
-
|
|
1794
|
-
|
|
1806
|
+
id: errorMessageId,
|
|
1807
|
+
errors: errors
|
|
1795
1808
|
})]
|
|
1796
1809
|
});
|
|
1797
1810
|
}
|
|
@@ -1871,6 +1884,7 @@ function FormField(props) {
|
|
|
1871
1884
|
}
|
|
1872
1885
|
}, [viewerCommands, field, initialValue, initialValidationTrigger, indexes]);
|
|
1873
1886
|
const onBlur = useCallback(() => {
|
|
1887
|
+
const value = get(data, valuePath);
|
|
1874
1888
|
if (initialValidationTrigger) {
|
|
1875
1889
|
setInitialValidationTrigger(false);
|
|
1876
1890
|
viewerCommands.updateFieldValidation(field, value, indexes);
|
|
@@ -1878,7 +1892,7 @@ function FormField(props) {
|
|
|
1878
1892
|
eventBus.fire('formField.blur', {
|
|
1879
1893
|
formField: field
|
|
1880
1894
|
});
|
|
1881
|
-
}, [eventBus, field, indexes,
|
|
1895
|
+
}, [eventBus, field, indexes, viewerCommands, initialValidationTrigger, data, valuePath]);
|
|
1882
1896
|
const onFocus = useCallback(() => {
|
|
1883
1897
|
eventBus.fire('formField.focus', {
|
|
1884
1898
|
formField: field
|
|
@@ -1902,7 +1916,6 @@ function FormField(props) {
|
|
|
1902
1916
|
}
|
|
1903
1917
|
const domId = `${prefixId(field.id, formId, indexes)}`;
|
|
1904
1918
|
const fieldErrors = get(errors, [field.id, ...Object.values(indexes || {})]) || [];
|
|
1905
|
-
const errorMessageId = errors.length === 0 ? undefined : `${domId}-error-message`;
|
|
1906
1919
|
return jsx(Column, {
|
|
1907
1920
|
field: field,
|
|
1908
1921
|
class: gridColumnClasses(field),
|
|
@@ -1913,7 +1926,6 @@ function FormField(props) {
|
|
|
1913
1926
|
...props,
|
|
1914
1927
|
disabled: disabled,
|
|
1915
1928
|
errors: fieldErrors,
|
|
1916
|
-
errorMessageId: errorMessageId,
|
|
1917
1929
|
domId: domId,
|
|
1918
1930
|
onChange: disabled || readonly ? noop$1 : onChangeIndexed,
|
|
1919
1931
|
onBlur: disabled || readonly ? noop$1 : onBlur,
|
|
@@ -2316,7 +2328,7 @@ function Datepicker(props) {
|
|
|
2316
2328
|
return jsxs("div", {
|
|
2317
2329
|
class: "fjs-datetime-subsection",
|
|
2318
2330
|
children: [jsx(Label, {
|
|
2319
|
-
|
|
2331
|
+
htmlFor: domId,
|
|
2320
2332
|
label: label,
|
|
2321
2333
|
collapseOnEmpty: collapseLabelOnEmpty,
|
|
2322
2334
|
required: required
|
|
@@ -2588,7 +2600,7 @@ function Timepicker(props) {
|
|
|
2588
2600
|
return jsxs("div", {
|
|
2589
2601
|
class: "fjs-datetime-subsection",
|
|
2590
2602
|
children: [jsx(Label, {
|
|
2591
|
-
|
|
2603
|
+
htmlFor: domId,
|
|
2592
2604
|
label: label,
|
|
2593
2605
|
collapseOnEmpty: collapseLabelOnEmpty,
|
|
2594
2606
|
required: required
|
|
@@ -2775,6 +2787,7 @@ function Datetime(props) {
|
|
|
2775
2787
|
});
|
|
2776
2788
|
}, []);
|
|
2777
2789
|
const errorMessageId = allErrors.length === 0 ? undefined : `${prefixId(id, formId)}-error-message`;
|
|
2790
|
+
const descriptionId = `${prefixId(id, formId)}-description`;
|
|
2778
2791
|
const datePickerProps = {
|
|
2779
2792
|
label: dateLabel,
|
|
2780
2793
|
collapseLabelOnEmpty: !timeLabel,
|
|
@@ -2787,7 +2800,7 @@ function Datetime(props) {
|
|
|
2787
2800
|
date: dateTime.date,
|
|
2788
2801
|
readonly,
|
|
2789
2802
|
setDate,
|
|
2790
|
-
'aria-describedby': errorMessageId
|
|
2803
|
+
'aria-describedby': [descriptionId, errorMessageId].join(' ')
|
|
2791
2804
|
};
|
|
2792
2805
|
const timePickerProps = {
|
|
2793
2806
|
label: timeLabel,
|
|
@@ -2802,7 +2815,7 @@ function Datetime(props) {
|
|
|
2802
2815
|
timeInterval,
|
|
2803
2816
|
time: dateTime.time,
|
|
2804
2817
|
setTime,
|
|
2805
|
-
'aria-describedby': errorMessageId
|
|
2818
|
+
'aria-describedby': [descriptionId, errorMessageId].join(' ')
|
|
2806
2819
|
};
|
|
2807
2820
|
return jsxs("div", {
|
|
2808
2821
|
class: formFieldClasses(type$d, {
|
|
@@ -2821,6 +2834,7 @@ function Datetime(props) {
|
|
|
2821
2834
|
...timePickerProps
|
|
2822
2835
|
})]
|
|
2823
2836
|
}), jsx(Description, {
|
|
2837
|
+
id: descriptionId,
|
|
2824
2838
|
description: description
|
|
2825
2839
|
}), jsx(Errors, {
|
|
2826
2840
|
errors: allErrors,
|
|
@@ -2924,7 +2938,7 @@ function IFrame(props) {
|
|
|
2924
2938
|
readonly
|
|
2925
2939
|
}),
|
|
2926
2940
|
children: [jsx(Label, {
|
|
2927
|
-
|
|
2941
|
+
htmlFor: domId,
|
|
2928
2942
|
label: evaluatedLabel
|
|
2929
2943
|
}), !evaluatedUrl && jsx(IFramePlaceholder, {
|
|
2930
2944
|
text: "No content to show."
|
|
@@ -3470,7 +3484,6 @@ function Numberfield(props) {
|
|
|
3470
3484
|
const {
|
|
3471
3485
|
disabled,
|
|
3472
3486
|
errors = [],
|
|
3473
|
-
errorMessageId,
|
|
3474
3487
|
domId,
|
|
3475
3488
|
onBlur,
|
|
3476
3489
|
onFocus,
|
|
@@ -3608,6 +3621,8 @@ function Numberfield(props) {
|
|
|
3608
3621
|
e.preventDefault();
|
|
3609
3622
|
}
|
|
3610
3623
|
};
|
|
3624
|
+
const descriptionId = `${domId}-description`;
|
|
3625
|
+
const errorMessageId = `${domId}-error-message`;
|
|
3611
3626
|
return jsxs("div", {
|
|
3612
3627
|
class: formFieldClasses(type$a, {
|
|
3613
3628
|
errors,
|
|
@@ -3615,7 +3630,7 @@ function Numberfield(props) {
|
|
|
3615
3630
|
readonly
|
|
3616
3631
|
}),
|
|
3617
3632
|
children: [jsx(Label, {
|
|
3618
|
-
|
|
3633
|
+
htmlFor: domId,
|
|
3619
3634
|
label: label,
|
|
3620
3635
|
required: required
|
|
3621
3636
|
}), jsx(TemplatedInputAdorner, {
|
|
@@ -3649,7 +3664,9 @@ function Numberfield(props) {
|
|
|
3649
3664
|
autoComplete: "off",
|
|
3650
3665
|
step: incrementAmount,
|
|
3651
3666
|
value: displayValue,
|
|
3652
|
-
"aria-describedby": errorMessageId
|
|
3667
|
+
"aria-describedby": [descriptionId, errorMessageId].join(' '),
|
|
3668
|
+
required: required,
|
|
3669
|
+
"aria-invalid": errors.length > 0
|
|
3653
3670
|
}), jsxs("div", {
|
|
3654
3671
|
class: classNames('fjs-number-arrow-container', {
|
|
3655
3672
|
'fjs-disabled': disabled,
|
|
@@ -3675,10 +3692,11 @@ function Numberfield(props) {
|
|
|
3675
3692
|
})]
|
|
3676
3693
|
})
|
|
3677
3694
|
}), jsx(Description, {
|
|
3695
|
+
id: descriptionId,
|
|
3678
3696
|
description: description
|
|
3679
3697
|
}), jsx(Errors, {
|
|
3680
|
-
|
|
3681
|
-
|
|
3698
|
+
id: errorMessageId,
|
|
3699
|
+
errors: errors
|
|
3682
3700
|
})]
|
|
3683
3701
|
});
|
|
3684
3702
|
}
|
|
@@ -3708,7 +3726,6 @@ function Radio(props) {
|
|
|
3708
3726
|
const {
|
|
3709
3727
|
disabled,
|
|
3710
3728
|
errors = [],
|
|
3711
|
-
errorMessageId,
|
|
3712
3729
|
domId,
|
|
3713
3730
|
onBlur,
|
|
3714
3731
|
onFocus,
|
|
@@ -3754,6 +3771,8 @@ function Radio(props) {
|
|
|
3754
3771
|
value,
|
|
3755
3772
|
onChange: props.onChange
|
|
3756
3773
|
});
|
|
3774
|
+
const descriptionId = `${domId}-description`;
|
|
3775
|
+
const errorMessageId = `${domId}-error-message`;
|
|
3757
3776
|
return jsxs("div", {
|
|
3758
3777
|
class: formFieldClasses(type$9, {
|
|
3759
3778
|
errors,
|
|
@@ -3768,7 +3787,7 @@ function Radio(props) {
|
|
|
3768
3787
|
const itemDomId = `${domId}-${index}`;
|
|
3769
3788
|
const isChecked = isEqual(option.value, value);
|
|
3770
3789
|
return jsx(Label, {
|
|
3771
|
-
|
|
3790
|
+
htmlFor: itemDomId,
|
|
3772
3791
|
label: option.label,
|
|
3773
3792
|
class: classNames({
|
|
3774
3793
|
'fjs-checked': isChecked
|
|
@@ -3784,14 +3803,17 @@ function Radio(props) {
|
|
|
3784
3803
|
onClick: () => onChange(option.value),
|
|
3785
3804
|
onBlur: onRadioBlur,
|
|
3786
3805
|
onFocus: onRadioFocus,
|
|
3787
|
-
"aria-describedby": errorMessageId
|
|
3806
|
+
"aria-describedby": [descriptionId, errorMessageId].join(' '),
|
|
3807
|
+
required: required,
|
|
3808
|
+
"aria-invalid": errors.length > 0
|
|
3788
3809
|
})
|
|
3789
3810
|
}, index);
|
|
3790
3811
|
}), jsx(Description, {
|
|
3812
|
+
id: descriptionId,
|
|
3791
3813
|
description: description
|
|
3792
3814
|
}), jsx(Errors, {
|
|
3793
|
-
|
|
3794
|
-
|
|
3815
|
+
id: errorMessageId,
|
|
3816
|
+
errors: errors
|
|
3795
3817
|
})]
|
|
3796
3818
|
});
|
|
3797
3819
|
}
|
|
@@ -3856,7 +3878,7 @@ function SearchableSelect(props) {
|
|
|
3856
3878
|
|
|
3857
3879
|
// whenever we change the underlying value, set the label to it
|
|
3858
3880
|
useEffect(() => {
|
|
3859
|
-
setFilter(label);
|
|
3881
|
+
setFilter(label || '');
|
|
3860
3882
|
}, [label]);
|
|
3861
3883
|
const filteredOptions = useMemo(() => {
|
|
3862
3884
|
if (loadState !== LOAD_STATES.LOADED) {
|
|
@@ -3936,7 +3958,7 @@ function SearchableSelect(props) {
|
|
|
3936
3958
|
}, [onFocus]);
|
|
3937
3959
|
const onInputBlur = useCallback(() => {
|
|
3938
3960
|
setIsDropdownExpanded(false);
|
|
3939
|
-
setFilter(label);
|
|
3961
|
+
setFilter(label || '');
|
|
3940
3962
|
onBlur && onBlur();
|
|
3941
3963
|
}, [onBlur, label]);
|
|
3942
3964
|
return jsxs(Fragment, {
|
|
@@ -4032,6 +4054,9 @@ function SimpleSelect(props) {
|
|
|
4032
4054
|
}, [disabled, isDropdownExpanded, loadState, readonly, value]);
|
|
4033
4055
|
const onMouseDown = useCallback(e => {
|
|
4034
4056
|
const input = inputRef.current;
|
|
4057
|
+
if (disabled || !input) {
|
|
4058
|
+
return;
|
|
4059
|
+
}
|
|
4035
4060
|
setIsDropdownExpanded(!isDropdownExpanded);
|
|
4036
4061
|
if (isDropdownExpanded) {
|
|
4037
4062
|
input.blur();
|
|
@@ -4039,7 +4064,7 @@ function SimpleSelect(props) {
|
|
|
4039
4064
|
input.focus();
|
|
4040
4065
|
}
|
|
4041
4066
|
e.preventDefault();
|
|
4042
|
-
}, [isDropdownExpanded]);
|
|
4067
|
+
}, [disabled, isDropdownExpanded]);
|
|
4043
4068
|
const initialFocusIndex = useMemo(() => value && findIndex(options, o => o.value === value) || 0, [options, value]);
|
|
4044
4069
|
const onInputFocus = useCallback(() => {
|
|
4045
4070
|
if (!readonly) {
|
|
@@ -4111,7 +4136,6 @@ function Select(props) {
|
|
|
4111
4136
|
const {
|
|
4112
4137
|
disabled,
|
|
4113
4138
|
errors = [],
|
|
4114
|
-
errorMessageId,
|
|
4115
4139
|
domId,
|
|
4116
4140
|
onBlur,
|
|
4117
4141
|
onFocus,
|
|
@@ -4129,6 +4153,8 @@ function Select(props) {
|
|
|
4129
4153
|
const {
|
|
4130
4154
|
required
|
|
4131
4155
|
} = validate;
|
|
4156
|
+
const descriptionId = `${domId}-description`;
|
|
4157
|
+
const errorMessageId = `${domId}-error-message`;
|
|
4132
4158
|
const selectProps = {
|
|
4133
4159
|
domId,
|
|
4134
4160
|
disabled,
|
|
@@ -4139,7 +4165,9 @@ function Select(props) {
|
|
|
4139
4165
|
value,
|
|
4140
4166
|
onChange,
|
|
4141
4167
|
readonly,
|
|
4142
|
-
|
|
4168
|
+
required,
|
|
4169
|
+
'aria-invalid': errors.length > 0,
|
|
4170
|
+
'aria-describedby': [descriptionId, errorMessageId].join(' ')
|
|
4143
4171
|
};
|
|
4144
4172
|
return jsxs("div", {
|
|
4145
4173
|
class: formFieldClasses(type$8, {
|
|
@@ -4154,7 +4182,7 @@ function Select(props) {
|
|
|
4154
4182
|
}
|
|
4155
4183
|
},
|
|
4156
4184
|
children: [jsx(Label, {
|
|
4157
|
-
|
|
4185
|
+
htmlFor: domId,
|
|
4158
4186
|
label: label,
|
|
4159
4187
|
required: required
|
|
4160
4188
|
}), searchable ? jsx(SearchableSelect, {
|
|
@@ -4162,10 +4190,11 @@ function Select(props) {
|
|
|
4162
4190
|
}) : jsx(SimpleSelect, {
|
|
4163
4191
|
...selectProps
|
|
4164
4192
|
}), jsx(Description, {
|
|
4193
|
+
id: descriptionId,
|
|
4165
4194
|
description: description
|
|
4166
4195
|
}), jsx(Errors, {
|
|
4167
|
-
|
|
4168
|
-
|
|
4196
|
+
id: errorMessageId,
|
|
4197
|
+
errors: errors
|
|
4169
4198
|
})]
|
|
4170
4199
|
});
|
|
4171
4200
|
}
|
|
@@ -4298,7 +4327,6 @@ function Taglist(props) {
|
|
|
4298
4327
|
const {
|
|
4299
4328
|
disabled,
|
|
4300
4329
|
errors = [],
|
|
4301
|
-
errorMessageId,
|
|
4302
4330
|
onFocus,
|
|
4303
4331
|
domId,
|
|
4304
4332
|
onBlur,
|
|
@@ -4434,6 +4462,8 @@ function Taglist(props) {
|
|
|
4434
4462
|
inputRef.current.focus();
|
|
4435
4463
|
};
|
|
4436
4464
|
const shouldDisplayDropdown = useMemo(() => !disabled && loadState === LOAD_STATES.LOADED && isDropdownExpanded && !isEscapeClosed, [disabled, isDropdownExpanded, isEscapeClosed, loadState]);
|
|
4465
|
+
const descriptionId = `${domId}-description`;
|
|
4466
|
+
const errorMessageId = `${domId}-error-message`;
|
|
4437
4467
|
return jsxs("div", {
|
|
4438
4468
|
ref: focusScopeRef,
|
|
4439
4469
|
class: formFieldClasses(type$5, {
|
|
@@ -4450,7 +4480,7 @@ function Taglist(props) {
|
|
|
4450
4480
|
children: [jsx(Label, {
|
|
4451
4481
|
label: label,
|
|
4452
4482
|
required: required,
|
|
4453
|
-
|
|
4483
|
+
htmlFor: domId
|
|
4454
4484
|
}), !disabled && !readonly && !!values.length && jsx(SkipLink, {
|
|
4455
4485
|
className: "fjs-taglist-skip-link",
|
|
4456
4486
|
label: "Skip to search",
|
|
@@ -4498,7 +4528,9 @@ function Taglist(props) {
|
|
|
4498
4528
|
onMouseDown: () => setIsEscapeClose(false),
|
|
4499
4529
|
onFocus: onInputFocus,
|
|
4500
4530
|
onBlur: onInputBlur,
|
|
4501
|
-
"aria-describedby": errorMessageId
|
|
4531
|
+
"aria-describedby": [descriptionId, errorMessageId].join(' '),
|
|
4532
|
+
required: required,
|
|
4533
|
+
"aria-invalid": errors.length > 0
|
|
4502
4534
|
})]
|
|
4503
4535
|
}), jsx("div", {
|
|
4504
4536
|
class: "fjs-taglist-anchor",
|
|
@@ -4510,10 +4542,11 @@ function Taglist(props) {
|
|
|
4510
4542
|
listenerElement: inputRef.current
|
|
4511
4543
|
})
|
|
4512
4544
|
}), jsx(Description, {
|
|
4545
|
+
id: descriptionId,
|
|
4513
4546
|
description: description
|
|
4514
4547
|
}), jsx(Errors, {
|
|
4515
|
-
|
|
4516
|
-
|
|
4548
|
+
id: errorMessageId,
|
|
4549
|
+
errors: errors
|
|
4517
4550
|
})]
|
|
4518
4551
|
});
|
|
4519
4552
|
}
|
|
@@ -4830,7 +4863,6 @@ function Textfield(props) {
|
|
|
4830
4863
|
const {
|
|
4831
4864
|
disabled,
|
|
4832
4865
|
errors = [],
|
|
4833
|
-
errorMessageId,
|
|
4834
4866
|
domId,
|
|
4835
4867
|
onBlur,
|
|
4836
4868
|
onFocus,
|
|
@@ -4866,6 +4898,8 @@ function Textfield(props) {
|
|
|
4866
4898
|
const onInputFocus = () => {
|
|
4867
4899
|
onFocus && onFocus();
|
|
4868
4900
|
};
|
|
4901
|
+
const descriptionId = `${domId}-description`;
|
|
4902
|
+
const errorMessageId = `${domId}-error-message`;
|
|
4869
4903
|
return jsxs("div", {
|
|
4870
4904
|
class: formFieldClasses(type$2, {
|
|
4871
4905
|
errors,
|
|
@@ -4873,7 +4907,7 @@ function Textfield(props) {
|
|
|
4873
4907
|
readonly
|
|
4874
4908
|
}),
|
|
4875
4909
|
children: [jsx(Label, {
|
|
4876
|
-
|
|
4910
|
+
htmlFor: domId,
|
|
4877
4911
|
label: label,
|
|
4878
4912
|
required: required
|
|
4879
4913
|
}), jsx(TemplatedInputAdorner, {
|
|
@@ -4891,13 +4925,16 @@ function Textfield(props) {
|
|
|
4891
4925
|
onFocus: onInputFocus,
|
|
4892
4926
|
type: "text",
|
|
4893
4927
|
value: value,
|
|
4894
|
-
"aria-describedby": errorMessageId
|
|
4928
|
+
"aria-describedby": [descriptionId, errorMessageId].join(' '),
|
|
4929
|
+
required: required,
|
|
4930
|
+
"aria-invalid": errors.length > 0
|
|
4895
4931
|
})
|
|
4896
4932
|
}), jsx(Description, {
|
|
4933
|
+
id: descriptionId,
|
|
4897
4934
|
description: description
|
|
4898
4935
|
}), jsx(Errors, {
|
|
4899
|
-
|
|
4900
|
-
|
|
4936
|
+
id: errorMessageId,
|
|
4937
|
+
errors: errors
|
|
4901
4938
|
})]
|
|
4902
4939
|
});
|
|
4903
4940
|
}
|
|
@@ -4930,7 +4967,6 @@ function Textarea(props) {
|
|
|
4930
4967
|
const {
|
|
4931
4968
|
disabled,
|
|
4932
4969
|
errors = [],
|
|
4933
|
-
errorMessageId,
|
|
4934
4970
|
domId,
|
|
4935
4971
|
onBlur,
|
|
4936
4972
|
onFocus,
|
|
@@ -4974,6 +5010,8 @@ function Textarea(props) {
|
|
|
4974
5010
|
useEffect(() => {
|
|
4975
5011
|
autoSizeTextarea(textareaRef.current);
|
|
4976
5012
|
}, []);
|
|
5013
|
+
const descriptionId = `${domId}-description`;
|
|
5014
|
+
const errorMessageId = `${domId}-error-message`;
|
|
4977
5015
|
return jsxs("div", {
|
|
4978
5016
|
class: formFieldClasses(type$1, {
|
|
4979
5017
|
errors,
|
|
@@ -4981,7 +5019,7 @@ function Textarea(props) {
|
|
|
4981
5019
|
readonly
|
|
4982
5020
|
}),
|
|
4983
5021
|
children: [jsx(Label, {
|
|
4984
|
-
|
|
5022
|
+
htmlFor: domId,
|
|
4985
5023
|
label: label,
|
|
4986
5024
|
required: required
|
|
4987
5025
|
}), jsx("textarea", {
|
|
@@ -4994,12 +5032,15 @@ function Textarea(props) {
|
|
|
4994
5032
|
onFocus: onInputFocus,
|
|
4995
5033
|
value: value,
|
|
4996
5034
|
ref: textareaRef,
|
|
4997
|
-
"aria-describedby": errorMessageId
|
|
5035
|
+
"aria-describedby": [descriptionId, errorMessageId].join(' '),
|
|
5036
|
+
required: required,
|
|
5037
|
+
"aria-invalid": errors.length > 0
|
|
4998
5038
|
}), jsx(Description, {
|
|
5039
|
+
id: descriptionId,
|
|
4999
5040
|
description: description
|
|
5000
5041
|
}), jsx(Errors, {
|
|
5001
|
-
|
|
5002
|
-
|
|
5042
|
+
id: errorMessageId,
|
|
5043
|
+
errors: errors
|
|
5003
5044
|
})]
|
|
5004
5045
|
});
|
|
5005
5046
|
}
|
|
@@ -5168,7 +5209,7 @@ function Table(props) {
|
|
|
5168
5209
|
return jsxs("div", {
|
|
5169
5210
|
class: formFieldClasses(type),
|
|
5170
5211
|
children: [jsx(Label, {
|
|
5171
|
-
|
|
5212
|
+
htmlFor: prefixId(id),
|
|
5172
5213
|
label: label
|
|
5173
5214
|
}), jsxs("div", {
|
|
5174
5215
|
class: classNames('fjs-table-middle-container', {
|
|
@@ -5568,7 +5609,7 @@ class FormFields {
|
|
|
5568
5609
|
}
|
|
5569
5610
|
|
|
5570
5611
|
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'];
|
|
5571
|
-
const TEMPLATE_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'description', 'label', 'source', 'text', 'url'];
|
|
5612
|
+
const TEMPLATE_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'description', 'label', 'source', 'text', 'content', 'url'];
|
|
5572
5613
|
|
|
5573
5614
|
/**
|
|
5574
5615
|
* @typedef { import('../types').Schema } Schema
|
|
@@ -6554,47 +6595,17 @@ class RepeatRenderManager {
|
|
|
6554
6595
|
};
|
|
6555
6596
|
const parentExpressionContextInfo = useContext(LocalExpressionContext);
|
|
6556
6597
|
return jsx(Fragment, {
|
|
6557
|
-
children: displayValues.map((value, index) => {
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
parent: buildExpressionContext(parentExpressionContextInfo),
|
|
6569
|
-
i: [...parentExpressionContextInfo.i, index + 1]
|
|
6570
|
-
}), [index, value]);
|
|
6571
|
-
return !showRemove ? jsx(LocalExpressionContext.Provider, {
|
|
6572
|
-
value: localExpressionContextInfo,
|
|
6573
|
-
children: jsx(RowsRenderer, {
|
|
6574
|
-
...elementProps
|
|
6575
|
-
})
|
|
6576
|
-
}) : jsxs("div", {
|
|
6577
|
-
class: "fjs-repeat-row-container",
|
|
6578
|
-
children: [jsx("div", {
|
|
6579
|
-
class: "fjs-repeat-row-rows",
|
|
6580
|
-
children: jsx(LocalExpressionContext.Provider, {
|
|
6581
|
-
value: localExpressionContextInfo,
|
|
6582
|
-
children: jsx(RowsRenderer, {
|
|
6583
|
-
...elementProps
|
|
6584
|
-
})
|
|
6585
|
-
})
|
|
6586
|
-
}), jsx("button", {
|
|
6587
|
-
class: "fjs-repeat-row-remove",
|
|
6588
|
-
type: "button",
|
|
6589
|
-
"aria-label": `Remove list item ${index + 1}`,
|
|
6590
|
-
onClick: () => onDeleteItem(index),
|
|
6591
|
-
children: jsx("div", {
|
|
6592
|
-
class: "fjs-repeat-row-remove-icon-container",
|
|
6593
|
-
children: jsx(DeleteSvg, {})
|
|
6594
|
-
})
|
|
6595
|
-
})]
|
|
6596
|
-
});
|
|
6597
|
-
})
|
|
6598
|
+
children: displayValues.map((value, index) => jsx(RepetitionScaffold, {
|
|
6599
|
+
index: index,
|
|
6600
|
+
value: value,
|
|
6601
|
+
parentExpressionContextInfo: parentExpressionContextInfo,
|
|
6602
|
+
repeaterField: repeaterField,
|
|
6603
|
+
RowsRenderer: RowsRenderer,
|
|
6604
|
+
indexes: indexes,
|
|
6605
|
+
onDeleteItem: onDeleteItem,
|
|
6606
|
+
showRemove: showRemove,
|
|
6607
|
+
...restProps
|
|
6608
|
+
}, index))
|
|
6598
6609
|
});
|
|
6599
6610
|
}
|
|
6600
6611
|
RepeatFooter(props) {
|
|
@@ -6686,6 +6697,73 @@ class RepeatRenderManager {
|
|
|
6686
6697
|
return nonCollapsedItems ? nonCollapsedItems : DEFAULT_NON_COLLAPSED_ITEMS;
|
|
6687
6698
|
}
|
|
6688
6699
|
}
|
|
6700
|
+
|
|
6701
|
+
/**
|
|
6702
|
+
* Individual repetition of a repeated field and context scaffolding.
|
|
6703
|
+
*
|
|
6704
|
+
* @param {Object} props
|
|
6705
|
+
* @param {number} props.index
|
|
6706
|
+
* @param {Object} props.value
|
|
6707
|
+
* @param {Object} props.parentExpressionContextInfo
|
|
6708
|
+
* @param {Object} props.repeaterField
|
|
6709
|
+
* @param {Function} props.RowsRenderer
|
|
6710
|
+
* @param {Object} props.indexes
|
|
6711
|
+
* @param {Function} props.onDeleteItem
|
|
6712
|
+
* @param {boolean} props.showRemove
|
|
6713
|
+
*/
|
|
6714
|
+
|
|
6715
|
+
const RepetitionScaffold = props => {
|
|
6716
|
+
const {
|
|
6717
|
+
index,
|
|
6718
|
+
value,
|
|
6719
|
+
parentExpressionContextInfo,
|
|
6720
|
+
repeaterField,
|
|
6721
|
+
RowsRenderer,
|
|
6722
|
+
indexes,
|
|
6723
|
+
onDeleteItem,
|
|
6724
|
+
showRemove,
|
|
6725
|
+
...restProps
|
|
6726
|
+
} = props;
|
|
6727
|
+
const elementProps = useMemo(() => ({
|
|
6728
|
+
...restProps,
|
|
6729
|
+
indexes: {
|
|
6730
|
+
...(indexes || {}),
|
|
6731
|
+
[repeaterField.id]: index
|
|
6732
|
+
}
|
|
6733
|
+
}), [index, indexes, repeaterField.id, restProps]);
|
|
6734
|
+
const localExpressionContextInfo = useMemo(() => ({
|
|
6735
|
+
data: parentExpressionContextInfo.data,
|
|
6736
|
+
this: value,
|
|
6737
|
+
parent: buildExpressionContext(parentExpressionContextInfo),
|
|
6738
|
+
i: [...parentExpressionContextInfo.i, index + 1]
|
|
6739
|
+
}), [index, parentExpressionContextInfo, value]);
|
|
6740
|
+
return !showRemove ? jsx(LocalExpressionContext.Provider, {
|
|
6741
|
+
value: localExpressionContextInfo,
|
|
6742
|
+
children: jsx(RowsRenderer, {
|
|
6743
|
+
...elementProps
|
|
6744
|
+
})
|
|
6745
|
+
}) : jsxs("div", {
|
|
6746
|
+
class: "fjs-repeat-row-container",
|
|
6747
|
+
children: [jsx("div", {
|
|
6748
|
+
class: "fjs-repeat-row-rows",
|
|
6749
|
+
children: jsx(LocalExpressionContext.Provider, {
|
|
6750
|
+
value: localExpressionContextInfo,
|
|
6751
|
+
children: jsx(RowsRenderer, {
|
|
6752
|
+
...elementProps
|
|
6753
|
+
})
|
|
6754
|
+
})
|
|
6755
|
+
}), jsx("button", {
|
|
6756
|
+
class: "fjs-repeat-row-remove",
|
|
6757
|
+
type: "button",
|
|
6758
|
+
"aria-label": `Remove list item ${index + 1}`,
|
|
6759
|
+
onClick: () => onDeleteItem(index),
|
|
6760
|
+
children: jsx("div", {
|
|
6761
|
+
class: "fjs-repeat-row-remove-icon-container",
|
|
6762
|
+
children: jsx(DeleteSvg, {})
|
|
6763
|
+
})
|
|
6764
|
+
})]
|
|
6765
|
+
});
|
|
6766
|
+
};
|
|
6689
6767
|
RepeatRenderManager.$inject = ['form', 'formFields', 'formFieldRegistry', 'pathRegistry'];
|
|
6690
6768
|
|
|
6691
6769
|
const RepeatRenderModule = {
|