@react-typed-forms/schemas-rn 2.2.0 → 2.2.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.
@@ -4,5 +4,6 @@ export type RNHtmlRendererProps = {
4
4
  className?: string;
5
5
  html?: string;
6
6
  style?: React.CSSProperties | undefined;
7
+ noSelection?: boolean | null;
7
8
  } & Pick<RenderHTMLProps, "baseStyle" | "tagsStyles" | "systemFonts" | "contentWidth">;
8
- export declare function RNHtmlRenderer({ className, html, style, contentWidth, ...props }: RNHtmlRendererProps): import("react/jsx-runtime").JSX.Element | undefined;
9
+ export declare function RNHtmlRenderer({ className, html, style, contentWidth, noSelection, ...props }: RNHtmlRendererProps): import("react/jsx-runtime").JSX.Element | undefined;
package/lib/index.cjs CHANGED
@@ -601,7 +601,7 @@ function RNDateTimePicker(_ref) {
601
601
  }
602
602
  }
603
603
 
604
- var _excluded$8 = ["className", "html", "style", "contentWidth"];
604
+ var _excluded$8 = ["className", "html", "style", "contentWidth", "noSelection"];
605
605
  function RNHtmlRenderer(_ref) {
606
606
  var _effect = core.useComponentTracking();
607
607
  try {
@@ -609,6 +609,7 @@ function RNHtmlRenderer(_ref) {
609
609
  html = _ref.html,
610
610
  style = _ref.style,
611
611
  contentWidth = _ref.contentWidth,
612
+ noSelection = _ref.noSelection,
612
613
  props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
613
614
  if (!html) return;
614
615
  var source = {
@@ -619,7 +620,7 @@ function RNHtmlRenderer(_ref) {
619
620
  className: className,
620
621
  children: jsxRuntime.jsx(RenderHtml__default["default"], _extends({
621
622
  defaultTextProps: {
622
- selectable: true
623
+ selectable: !noSelection
623
624
  },
624
625
  contentWidth: contentWidth != null ? contentWidth : reactNative.Dimensions.get("window").width,
625
626
  source: source
@@ -1192,12 +1193,13 @@ function DefaultDisplay(_ref) {
1192
1193
  });
1193
1194
  case schemas.DisplayDataType.Text:
1194
1195
  var text = display ? schemas.coerceToString(display.value) : data.text;
1195
- return jsxRuntime.jsx(Div, {
1196
+ return jsxRuntime.jsx(RNDiv, {
1196
1197
  style: style,
1197
1198
  className: schemas.rendererClass(className, options.textClassName),
1198
1199
  textClass: schemas.rendererClass(textClass, options.textTextClass),
1199
1200
  text: text,
1200
- inline: displayProps.inline
1201
+ inline: displayProps.inline,
1202
+ noSelection: displayProps.noSelection
1201
1203
  });
1202
1204
  case schemas.DisplayDataType.Html:
1203
1205
  var htmlClassName = options.htmlClassName,
@@ -1205,6 +1207,7 @@ function DefaultDisplay(_ref) {
1205
1207
  return jsxRuntime.jsx(RNHtmlRenderer, _extends({
1206
1208
  style: style,
1207
1209
  className: schemas.rendererClass(className, htmlClassName),
1210
+ noSelection: displayProps.noSelection,
1208
1211
  html: display ? schemas.coerceToString(display.value) : data.html
1209
1212
  }, props));
1210
1213
  case schemas.DisplayDataType.Custom:
@@ -2518,7 +2521,7 @@ function createDefaultDataRenderer(options) {
2518
2521
  inline: props.inline,
2519
2522
  renderer: renderers,
2520
2523
  emptyText: schemas.isDisplayOnlyRenderer(renderOptions) && renderOptions.emptyText ? renderOptions.emptyText : defaultEmptyText,
2521
- noSelection: schemas.isDisplayOnlyRenderer(renderOptions) ? renderOptions.noSelection : undefined
2524
+ noSelection: props.definition.noSelection
2522
2525
  })
2523
2526
  });
2524
2527
  };
@@ -2811,7 +2814,8 @@ function RNDiv(_ref8) {
2811
2814
  props = _objectWithoutPropertiesLoose(_ref8, _excluded3);
2812
2815
  if (html != null) {
2813
2816
  return jsxRuntime.jsx(RNHtmlRenderer, _extends({}, props, {
2814
- html: html
2817
+ html: html,
2818
+ noSelection: noSelection
2815
2819
  }));
2816
2820
  }
2817
2821
  if (inline) {