@react-typed-forms/schemas 14.1.0 → 14.1.2
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/controlDefinition.d.ts +8 -1
- package/lib/controlRender.d.ts +2 -1
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/renderers.d.ts +2 -1
- package/lib/schemaField.d.ts +5 -3
- package/lib/util.d.ts +10 -1
- package/package.json +3 -3
package/lib/renderers.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { ActionRendererProps, AdornmentProps, AdornmentRenderer, ArrayRendererProps, ControlLayoutProps, DataRendererProps, DisplayRendererProps, FormRenderer, GroupRendererProps, LabelRendererProps, LabelType, RenderedControl, VisibilityRendererProps } from "./controlRender";
|
|
3
|
-
import { AccordionAdornment, ControlAdornment, IconAdornment, SetFieldAdornment } from "./controlDefinition";
|
|
3
|
+
import { AccordionAdornment, ControlAdornment, IconAdornment, OptionalAdornment, SetFieldAdornment } from "./controlDefinition";
|
|
4
4
|
export interface DefaultRenderers {
|
|
5
5
|
data: DataRendererRegistration;
|
|
6
6
|
label: LabelRendererRegistration;
|
|
@@ -63,6 +63,7 @@ export type RendererRegistration = DataRendererRegistration | GroupRendererRegis
|
|
|
63
63
|
export declare function isIconAdornment(a: ControlAdornment): a is IconAdornment;
|
|
64
64
|
export declare function isAccordionAdornment(a: ControlAdornment): a is AccordionAdornment;
|
|
65
65
|
export declare function isSetFieldAdornment(a: ControlAdornment): a is SetFieldAdornment;
|
|
66
|
+
export declare function isOptionalAdornment(a: ControlAdornment): a is OptionalAdornment;
|
|
66
67
|
export declare function createLayoutRenderer(render: LayoutRendererRegistration["render"], options?: Partial<LayoutRendererRegistration>): LayoutRendererRegistration;
|
|
67
68
|
export declare function createActionRenderer(actionId: string | string[] | undefined, render: ActionRendererRegistration["render"], options?: Partial<ActionRendererRegistration>): ActionRendererRegistration;
|
|
68
69
|
export declare function createArrayRenderer(render: ArrayRendererRegistration["render"], options?: Partial<ArrayRendererRegistration>): ArrayRendererRegistration;
|
package/lib/schemaField.d.ts
CHANGED
|
@@ -198,8 +198,8 @@ export interface SchemaInterface {
|
|
|
198
198
|
makeEqualityFunc(field: SchemaNode, element?: boolean): EqualityFunc;
|
|
199
199
|
makeControlSetup(field: SchemaNode, element?: boolean): ControlSetup<any>;
|
|
200
200
|
}
|
|
201
|
-
export interface SchemaTreeLookup
|
|
202
|
-
getSchema(schemaId:
|
|
201
|
+
export interface SchemaTreeLookup {
|
|
202
|
+
getSchema(schemaId: string): SchemaNode | undefined;
|
|
203
203
|
}
|
|
204
204
|
export interface SchemaNode extends SchemaTreeLookup {
|
|
205
205
|
id: string;
|
|
@@ -220,7 +220,9 @@ export interface SchemaDataNode {
|
|
|
220
220
|
export declare function findField(fields: SchemaField[], field: string): SchemaField | undefined;
|
|
221
221
|
export declare function isScalarField(sf: SchemaField): sf is SchemaField;
|
|
222
222
|
export declare function isCompoundField(sf: SchemaField): sf is CompoundField;
|
|
223
|
-
export declare function createSchemaLookup<A extends Record<string, SchemaField[]>>(schemaMap: A):
|
|
223
|
+
export declare function createSchemaLookup<A extends Record<string, SchemaField[]>>(schemaMap: A): {
|
|
224
|
+
getSchema(schemaId: keyof A): SchemaNode;
|
|
225
|
+
};
|
|
224
226
|
export declare function makeSchemaDataNode(schema: SchemaNode, control: Control<unknown>, parent?: SchemaDataNode, elementIndex?: number): SchemaDataNode;
|
|
225
227
|
export declare function schemaDataForFieldRef(fieldRef: string | undefined, schema: SchemaDataNode): SchemaDataNode;
|
|
226
228
|
export declare function schemaForFieldRef(fieldRef: string | undefined, schema: SchemaNode): SchemaNode;
|
package/lib/util.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ControlActionHandler, ControlDefinition, DataControlDefinition, DisplayOnlyRenderOptions, GroupRenderOptions } from "./controlDefinition";
|
|
2
2
|
import { MutableRefObject } from "react";
|
|
3
3
|
import { CompoundField, FieldOption, SchemaDataNode, SchemaField, SchemaNode } from "./schemaField";
|
|
4
|
+
import { Control } from "@react-typed-forms/core";
|
|
4
5
|
/**
|
|
5
6
|
* Interface representing the classes for a control.
|
|
6
7
|
*/
|
|
@@ -244,4 +245,12 @@ export declare function isControlDisplayOnly(def: ControlDefinition): boolean;
|
|
|
244
245
|
*/
|
|
245
246
|
export declare function actionHandlers(...handlers: (ControlActionHandler | undefined)[]): ControlActionHandler;
|
|
246
247
|
export declare function getDiffObject(dataNode: SchemaDataNode, force?: boolean): any;
|
|
247
|
-
export declare function
|
|
248
|
+
export declare function getNullToggler(c: Control<any>): Control<boolean>;
|
|
249
|
+
export declare function getLastDefinedValue<V>(control: Control<V>): Control<V>;
|
|
250
|
+
export declare function getIsEditing(control: Control<any>): Control<boolean | undefined>;
|
|
251
|
+
export declare function getAllValues(control: Control<any>): Control<unknown[]>;
|
|
252
|
+
export declare function applyValues(dataNode: SchemaDataNode, value: unknown): void;
|
|
253
|
+
export declare function collectDifferences(dataNode: SchemaDataNode, values: unknown[]): () => {
|
|
254
|
+
editable: number;
|
|
255
|
+
editing: number;
|
|
256
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-typed-forms/schemas",
|
|
3
|
-
"version": "14.1.
|
|
3
|
+
"version": "14.1.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.cjs",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"react": "^18.2.0",
|
|
44
|
+
"@react-typed-forms/core": "^4.0.0",
|
|
44
45
|
"@react-typed-forms/transform": "^0.2.0",
|
|
45
46
|
"jest": "^29.7.0",
|
|
46
47
|
"tsx": "^4.19.1",
|
|
@@ -55,8 +56,7 @@
|
|
|
55
56
|
"nswag": "^13.18.2",
|
|
56
57
|
"prettier": "^3.0.3",
|
|
57
58
|
"rimraf": "^3.0.2",
|
|
58
|
-
"typescript": "^5.6.2"
|
|
59
|
-
"@react-typed-forms/core": "4.0.3"
|
|
59
|
+
"typescript": "^5.6.2"
|
|
60
60
|
},
|
|
61
61
|
"gitHead": "698e16cd3ab31b7dd0528fc76536f4d3205ce8c6",
|
|
62
62
|
"scripts": {
|