@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/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 => options.customRender ? options.customRender({
1702
- allValues: getAllValues(dataControl),
1703
- editing,
1704
- children,
1705
- adornment,
1706
- nullToggler,
1707
- dataContext,
1708
- options
1709
- }) : /*#__PURE__*/jsx(OptionalEditRenderer, {
1710
- children: children,
1711
- options: options,
1712
- editing: editing.as(),
1713
- adornment: adornment,
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
- dataControl
1727
+ renderMultiValues,
1728
+ allValues,
1729
+ nullToggler
1730
1730
  }) {
1731
1731
  var _effect = useComponentTracking();
1732
1732
  try {
1733
- var _options$setNullText, _options$multiValuesT;
1734
- const nullToggler = getNullToggler(dataControl);
1735
- const allValues = getAllValues(dataControl);
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: (_options$multiValuesT = options.multiValuesText) != null ? _options$multiValuesT : "Differing values"
1753
+ children: renderMultiValues(allValues)
1752
1754
  }) : /*#__PURE__*/jsxs("div", {
1753
1755
  className: options.childWrapperClass,
1754
1756
  children: [nullEdit, children]