@react-typed-forms/schemas-html 4.0.0 → 4.0.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/lib/adornments/optionalAdornment.d.ts +3 -6
- package/lib/index.cjs +12 -12
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +22 -20
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -1698,21 +1698,19 @@ function createOptionalAdornment(options = {}) {
|
|
|
1698
1698
|
control: editing,
|
|
1699
1699
|
className: options.checkClass
|
|
1700
1700
|
}))(rl);
|
|
1701
|
-
wrapMarkup("children", children =>
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
dataControl: dataControl
|
|
1715
|
-
}))(rl);
|
|
1701
|
+
wrapMarkup("children", children => {
|
|
1702
|
+
const props = {
|
|
1703
|
+
allValues: getAllValues(dataControl),
|
|
1704
|
+
editing,
|
|
1705
|
+
children,
|
|
1706
|
+
adornment,
|
|
1707
|
+
nullToggler,
|
|
1708
|
+
dataContext,
|
|
1709
|
+
options,
|
|
1710
|
+
dataControl
|
|
1711
|
+
};
|
|
1712
|
+
return options.customRender ? options.customRender(props) : /*#__PURE__*/jsx(OptionalEditRenderer, _extends({}, props));
|
|
1713
|
+
})(rl);
|
|
1716
1714
|
},
|
|
1717
1715
|
priority: 0,
|
|
1718
1716
|
adornment
|
|
@@ -1726,13 +1724,17 @@ function OptionalEditRenderer({
|
|
|
1726
1724
|
options,
|
|
1727
1725
|
adornment,
|
|
1728
1726
|
editing,
|
|
1729
|
-
|
|
1727
|
+
renderMultiValues,
|
|
1728
|
+
allValues,
|
|
1729
|
+
nullToggler
|
|
1730
1730
|
}) {
|
|
1731
1731
|
var _effect = useComponentTracking();
|
|
1732
1732
|
try {
|
|
1733
|
-
var _options$setNullText
|
|
1734
|
-
|
|
1735
|
-
|
|
1733
|
+
var _options$setNullText;
|
|
1734
|
+
renderMultiValues != null ? renderMultiValues : renderMultiValues = () => {
|
|
1735
|
+
var _options$multiValuesT;
|
|
1736
|
+
return (_options$multiValuesT = options.multiValuesText) != null ? _options$multiValuesT : "Differing values";
|
|
1737
|
+
};
|
|
1736
1738
|
const multipleValues = allValues.value.length > 1;
|
|
1737
1739
|
const nullEdit = adornment.allowNull ? /*#__PURE__*/jsxs("div", {
|
|
1738
1740
|
className: options.nullWrapperClass,
|
|
@@ -1748,7 +1750,7 @@ function OptionalEditRenderer({
|
|
|
1748
1750
|
className: options.className,
|
|
1749
1751
|
children: multipleValues && editing.value === false ? /*#__PURE__*/jsx("div", {
|
|
1750
1752
|
className: options.multiValuesClass,
|
|
1751
|
-
children: (
|
|
1753
|
+
children: renderMultiValues(allValues)
|
|
1752
1754
|
}) : /*#__PURE__*/jsxs("div", {
|
|
1753
1755
|
className: options.childWrapperClass,
|
|
1754
1756
|
children: [nullEdit, children]
|