@react-typed-forms/schemas 13.1.4 → 13.2.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/controlRender.d.ts +16 -6
- package/lib/hooks.d.ts +1 -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/types.d.ts +14 -2
- package/lib/util.d.ts +10 -1
- package/package.json +6 -4
- package/lib/internal.d.ts +0 -1
package/lib/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Control } from "@react-typed-forms/core";
|
|
2
2
|
import { SchemaDataNode, SchemaNode } from "./treeNodes";
|
|
3
|
+
import { ControlDataContext } from "./util";
|
|
3
4
|
export interface SchemaField {
|
|
4
5
|
type: string;
|
|
5
6
|
field: string;
|
|
@@ -298,12 +299,17 @@ export interface GroupedControlsDefinition extends ControlDefinition {
|
|
|
298
299
|
export interface GroupRenderOptions {
|
|
299
300
|
type: string;
|
|
300
301
|
hideTitle?: boolean | null;
|
|
302
|
+
childStyleClass?: string | null;
|
|
303
|
+
childLayoutClass?: string | null;
|
|
304
|
+
childLabelClass?: string | null;
|
|
305
|
+
displayOnly?: boolean | null;
|
|
301
306
|
}
|
|
302
307
|
export declare enum GroupRenderType {
|
|
303
308
|
Standard = "Standard",
|
|
304
309
|
Grid = "Grid",
|
|
305
310
|
Flex = "Flex",
|
|
306
|
-
GroupElement = "GroupElement"
|
|
311
|
+
GroupElement = "GroupElement",
|
|
312
|
+
SelectChild = "SelectChild"
|
|
307
313
|
}
|
|
308
314
|
export interface StandardGroupRenderer extends GroupRenderOptions {
|
|
309
315
|
type: GroupRenderType.Standard;
|
|
@@ -321,6 +327,10 @@ export interface GridRenderer extends GroupRenderOptions {
|
|
|
321
327
|
type: GroupRenderType.Grid;
|
|
322
328
|
columns?: number | null;
|
|
323
329
|
}
|
|
330
|
+
export interface SelectChildRenderer extends GroupRenderOptions {
|
|
331
|
+
type: GroupRenderType.SelectChild;
|
|
332
|
+
childIndexExpression?: EntityExpression | null;
|
|
333
|
+
}
|
|
324
334
|
export interface DisplayControlDefinition extends ControlDefinition {
|
|
325
335
|
type: ControlDefinitionType.Display;
|
|
326
336
|
displayData: DisplayData;
|
|
@@ -394,13 +404,15 @@ export interface ControlVisitor<A> {
|
|
|
394
404
|
}
|
|
395
405
|
export declare function visitControlDefinition<A>(x: ControlDefinition, visitor: ControlVisitor<A>, defaultValue: (c: ControlDefinition) => A): A;
|
|
396
406
|
export declare function isGridRenderer(options: GroupRenderOptions): options is GridRenderer;
|
|
407
|
+
export declare function isSelectChildRenderer(options: GroupRenderOptions): options is SelectChildRenderer;
|
|
397
408
|
export declare function isFlexRenderer(options: GroupRenderOptions): options is FlexRenderer;
|
|
398
409
|
export declare function isDisplayOnlyRenderer(options: RenderOptions): options is DisplayOnlyRenderOptions;
|
|
399
410
|
export declare function isTextfieldRenderer(options: RenderOptions): options is TextfieldRenderOptions;
|
|
400
|
-
export declare function isDataGroupRenderer(options
|
|
411
|
+
export declare function isDataGroupRenderer(options?: RenderOptions | null): options is DataGroupRenderOptions;
|
|
401
412
|
export declare function isArrayRenderer(options: RenderOptions): options is ArrayRenderOptions;
|
|
402
413
|
export declare function findField(fields: SchemaField[], field: string): SchemaField | undefined;
|
|
403
414
|
export declare function isScalarField(sf: SchemaField): sf is SchemaField;
|
|
404
415
|
export declare function isCompoundField(sf: SchemaField): sf is CompoundField;
|
|
405
416
|
export declare function isDataControl(c: ControlDefinition): c is DataControlDefinition;
|
|
406
417
|
export declare function isGroupControl(c: ControlDefinition): c is GroupedControlsDefinition;
|
|
418
|
+
export type ControlActionHandler = (actionId: string, actionData: any, ctx: ControlDataContext) => (() => void) | undefined;
|
package/lib/util.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { CompoundField, ControlDefinition, DataControlDefinition, DisplayOnlyRenderOptions, FieldOption, SchemaField, SchemaInterface } from "./types";
|
|
1
|
+
import { CompoundField, ControlActionHandler, ControlDefinition, DataControlDefinition, DisplayOnlyRenderOptions, FieldOption, GroupRenderOptions, SchemaField, SchemaInterface } from "./types";
|
|
2
2
|
import { MutableRefObject } from "react";
|
|
3
3
|
import { SchemaDataNode } from "./treeNodes";
|
|
4
|
+
export interface ControlClasses {
|
|
5
|
+
styleClass?: string;
|
|
6
|
+
layoutClass?: string;
|
|
7
|
+
labelClass?: string;
|
|
8
|
+
}
|
|
4
9
|
export type JsonPath = string | number;
|
|
5
10
|
export interface FormContextData {
|
|
6
11
|
option?: FieldOption;
|
|
@@ -63,3 +68,7 @@ export declare function applyLengthRestrictions<Min, Max>(length: number, min: n
|
|
|
63
68
|
export declare function findFieldPath(fields: SchemaField[], fieldPath: string | undefined): SchemaField[] | undefined;
|
|
64
69
|
export declare function mergeObjects<A extends Record<string, any> | undefined>(o1: A, o2: A, doMerge?: (k: keyof NonNullable<A>, v1: unknown, v2: unknown) => unknown): A;
|
|
65
70
|
export declare function coerceToString(v: unknown): string;
|
|
71
|
+
export declare function getGroupRendererOptions(def: ControlDefinition): GroupRenderOptions | undefined;
|
|
72
|
+
export declare function getGroupClassOverrides(def: ControlDefinition): ControlClasses;
|
|
73
|
+
export declare function isControlDisplayOnly(def: ControlDefinition): boolean;
|
|
74
|
+
export declare function actionHandlers(...handlers: (ControlActionHandler | undefined)[]): ControlActionHandler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-typed-forms/schemas",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.cjs",
|
|
@@ -33,13 +33,15 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"clsx": "^1 || ^2",
|
|
35
35
|
"uuid": "^10.0.0",
|
|
36
|
-
"jsonata": "^2.0.4"
|
|
37
|
-
"@react-typed-forms/core": "^3.6.1"
|
|
36
|
+
"jsonata": "^2.0.4"
|
|
38
37
|
},
|
|
39
38
|
"peerDependencies": {
|
|
40
|
-
"react": "^18.2.0"
|
|
39
|
+
"react": "^18.2.0",
|
|
40
|
+
"@react-typed-forms/core": "^3.6.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
+
"react": "^18.2.0",
|
|
44
|
+
"@react-typed-forms/core": "^3.6.1",
|
|
43
45
|
"@react-typed-forms/transform": "^0.2.0",
|
|
44
46
|
"@types/uuid": "^10.0.0",
|
|
45
47
|
"@types/react": "^18.2.28",
|
package/lib/internal.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function cc(n: string | null | undefined): string | undefined;
|