@react-typed-forms/schemas-html 4.1.0 → 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/components/DefaultDisplayOnly.d.ts +3 -2
- package/lib/index.cjs +4 -2
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +4 -2
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { FormRenderer, SchemaDataNode, SchemaInterface } from "@react-typed-forms/schemas";
|
|
3
|
-
export declare function DefaultDisplayOnly({ dataNode, className, emptyText, schemaInterface, style, renderer, textClass, inline, }: {
|
|
2
|
+
import { ControlState, FormRenderer, SchemaDataNode, SchemaInterface } from "@react-typed-forms/schemas";
|
|
3
|
+
export declare function DefaultDisplayOnly({ dataNode, className, emptyText, schemaInterface, style, renderer, textClass, inline, state, }: {
|
|
4
4
|
dataNode: SchemaDataNode;
|
|
5
5
|
schemaInterface: SchemaInterface;
|
|
6
6
|
className?: string;
|
|
@@ -9,4 +9,5 @@ export declare function DefaultDisplayOnly({ dataNode, className, emptyText, sch
|
|
|
9
9
|
inline: boolean;
|
|
10
10
|
renderer: FormRenderer;
|
|
11
11
|
emptyText?: string | null;
|
|
12
|
+
state: ControlState;
|
|
12
13
|
}): JSX.Element;
|
package/lib/index.cjs
CHANGED
|
@@ -644,8 +644,9 @@ function DefaultDisplayOnly(_ref) {
|
|
|
644
644
|
style = _ref.style,
|
|
645
645
|
renderer = _ref.renderer,
|
|
646
646
|
textClass = _ref.textClass,
|
|
647
|
-
inline = _ref.inline
|
|
648
|
-
|
|
647
|
+
inline = _ref.inline,
|
|
648
|
+
state = _ref.state;
|
|
649
|
+
var text = state.display != null ? state.display : (_ref2 = schemaInterface.isEmptyValue(dataNode.schema.field, dataNode.control.value) ? emptyText : schemaInterface.textValueForData(dataNode)) != null ? _ref2 : "";
|
|
649
650
|
var Div = renderer.html.Div;
|
|
650
651
|
return /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
651
652
|
style: style,
|
|
@@ -2141,6 +2142,7 @@ function createDefaultDataRenderer(options) {
|
|
|
2141
2142
|
className: "@ " + schemas.rendererClass(p.className, displayOnlyClass),
|
|
2142
2143
|
children: /*#__PURE__*/jsxRuntime.jsx(DefaultDisplayOnly, {
|
|
2143
2144
|
dataNode: props.dataNode,
|
|
2145
|
+
state: props.state,
|
|
2144
2146
|
schemaInterface: props.dataContext.schemaInterface,
|
|
2145
2147
|
className: props.className,
|
|
2146
2148
|
textClass: props.textClass,
|