@react-typed-forms/schemas-html 4.0.1 → 4.1.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
@@ -545,12 +545,13 @@ function DefaultDisplayOnly({
545
545
  style,
546
546
  renderer,
547
547
  textClass,
548
- inline
548
+ inline,
549
+ state
549
550
  }) {
550
551
  var _effect = useComponentTracking();
551
552
  try {
552
553
  var _ref;
553
- const text = (_ref = schemaInterface.isEmptyValue(dataNode.schema.field, dataNode.control.value) ? emptyText : schemaInterface.textValueForData(dataNode)) != null ? _ref : "";
554
+ const text = state.display != null ? state.display : (_ref = schemaInterface.isEmptyValue(dataNode.schema.field, dataNode.control.value) ? emptyText : schemaInterface.textValueForData(dataNode)) != null ? _ref : "";
554
555
  const {
555
556
  Div
556
557
  } = renderer.html;
@@ -663,11 +664,13 @@ function createTabsRenderer(options = {}) {
663
664
  designMode,
664
665
  formNode,
665
666
  className,
666
- renderChild
667
+ renderChild,
668
+ state
667
669
  },
668
670
  tabOptions
669
671
  }, isVisible) {
670
- const tabIndex = useControl(0);
672
+ var _tabIndex$value;
673
+ const tabIndex = state.meta.fields.tabIndex.as();
671
674
  const {
672
675
  tabClass,
673
676
  labelClass,
@@ -676,7 +679,7 @@ function createTabsRenderer(options = {}) {
676
679
  activeClass,
677
680
  contentClass
678
681
  } = options;
679
- const currentTab = tabIndex.value;
682
+ const currentTab = (_tabIndex$value = tabIndex.value) != null ? _tabIndex$value : 0;
680
683
  return designMode ? /*#__PURE__*/jsx(Fragment, {
681
684
  children: formNode.getChildNodes().map((x, i) => renderTabs([x], i))
682
685
  }) : renderTabs(formNode.getChildNodes().filter((x, i) => isVisible(i)), 0);
@@ -1730,8 +1733,8 @@ function OptionalEditRenderer({
1730
1733
  }) {
1731
1734
  var _effect = useComponentTracking();
1732
1735
  try {
1733
- var _options$setNullText;
1734
- renderMultiValues != null ? renderMultiValues : renderMultiValues = () => {
1736
+ var _renderMultiValues, _options$setNullText;
1737
+ (_renderMultiValues = renderMultiValues) != null ? _renderMultiValues : renderMultiValues = () => {
1735
1738
  var _options$multiValuesT;
1736
1739
  return (_options$multiValuesT = options.multiValuesText) != null ? _options$multiValuesT : "Differing values";
1737
1740
  };
@@ -1987,6 +1990,7 @@ function createDefaultDataRenderer(options = {}) {
1987
1990
  className: "@ " + rendererClass(p.className, displayOnlyClass),
1988
1991
  children: /*#__PURE__*/jsx(DefaultDisplayOnly, {
1989
1992
  dataNode: props.dataNode,
1993
+ state: props.state,
1990
1994
  schemaInterface: props.dataContext.schemaInterface,
1991
1995
  className: props.className,
1992
1996
  textClass: props.textClass,