@react-typed-forms/schemas-html 4.0.0 → 4.1.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/lib/index.js CHANGED
@@ -663,11 +663,13 @@ function createTabsRenderer(options = {}) {
663
663
  designMode,
664
664
  formNode,
665
665
  className,
666
- renderChild
666
+ renderChild,
667
+ state
667
668
  },
668
669
  tabOptions
669
670
  }, isVisible) {
670
- const tabIndex = useControl(0);
671
+ var _tabIndex$value;
672
+ const tabIndex = state.meta.fields.tabIndex.as();
671
673
  const {
672
674
  tabClass,
673
675
  labelClass,
@@ -676,7 +678,7 @@ function createTabsRenderer(options = {}) {
676
678
  activeClass,
677
679
  contentClass
678
680
  } = options;
679
- const currentTab = tabIndex.value;
681
+ const currentTab = (_tabIndex$value = tabIndex.value) != null ? _tabIndex$value : 0;
680
682
  return designMode ? /*#__PURE__*/jsx(Fragment, {
681
683
  children: formNode.getChildNodes().map((x, i) => renderTabs([x], i))
682
684
  }) : renderTabs(formNode.getChildNodes().filter((x, i) => isVisible(i)), 0);
@@ -1698,21 +1700,19 @@ function createOptionalAdornment(options = {}) {
1698
1700
  control: editing,
1699
1701
  className: options.checkClass
1700
1702
  }))(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);
1703
+ wrapMarkup("children", children => {
1704
+ const props = {
1705
+ allValues: getAllValues(dataControl),
1706
+ editing,
1707
+ children,
1708
+ adornment,
1709
+ nullToggler,
1710
+ dataContext,
1711
+ options,
1712
+ dataControl
1713
+ };
1714
+ return options.customRender ? options.customRender(props) : /*#__PURE__*/jsx(OptionalEditRenderer, _extends({}, props));
1715
+ })(rl);
1716
1716
  },
1717
1717
  priority: 0,
1718
1718
  adornment
@@ -1726,13 +1726,17 @@ function OptionalEditRenderer({
1726
1726
  options,
1727
1727
  adornment,
1728
1728
  editing,
1729
- dataControl
1729
+ renderMultiValues,
1730
+ allValues,
1731
+ nullToggler
1730
1732
  }) {
1731
1733
  var _effect = useComponentTracking();
1732
1734
  try {
1733
- var _options$setNullText, _options$multiValuesT;
1734
- const nullToggler = getNullToggler(dataControl);
1735
- const allValues = getAllValues(dataControl);
1735
+ var _renderMultiValues, _options$setNullText;
1736
+ (_renderMultiValues = renderMultiValues) != null ? _renderMultiValues : renderMultiValues = () => {
1737
+ var _options$multiValuesT;
1738
+ return (_options$multiValuesT = options.multiValuesText) != null ? _options$multiValuesT : "Differing values";
1739
+ };
1736
1740
  const multipleValues = allValues.value.length > 1;
1737
1741
  const nullEdit = adornment.allowNull ? /*#__PURE__*/jsxs("div", {
1738
1742
  className: options.nullWrapperClass,
@@ -1748,7 +1752,7 @@ function OptionalEditRenderer({
1748
1752
  className: options.className,
1749
1753
  children: multipleValues && editing.value === false ? /*#__PURE__*/jsx("div", {
1750
1754
  className: options.multiValuesClass,
1751
- children: (_options$multiValuesT = options.multiValuesText) != null ? _options$multiValuesT : "Differing values"
1755
+ children: renderMultiValues(allValues)
1752
1756
  }) : /*#__PURE__*/jsxs("div", {
1753
1757
  className: options.childWrapperClass,
1754
1758
  children: [nullEdit, children]