@react-typed-forms/schemas 10.3.0 → 11.0.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/internal.d.ts CHANGED
@@ -1,4 +1 @@
1
- import { ChangeListenerFunc, Control } from "@react-typed-forms/core";
2
- export declare function useCalculatedControl<V>(calculate: () => V): Control<V>;
3
1
  export declare function cc(n: string | null | undefined): string | undefined;
4
- export declare function trackedStructure<A>(c: Control<A>, tracker: ChangeListenerFunc<any>): A;
package/lib/types.d.ts CHANGED
@@ -82,7 +82,8 @@ export declare enum DynamicPropertyType {
82
82
  Style = "Style",
83
83
  LayoutStyle = "LayoutStyle",
84
84
  AllowedOptions = "AllowedOptions",
85
- Label = "Label"
85
+ Label = "Label",
86
+ ActionData = "ActionData"
86
87
  }
87
88
  export interface EntityExpression {
88
89
  type: string;
@@ -288,6 +289,7 @@ export interface HtmlDisplay extends DisplayData {
288
289
  export interface ActionControlDefinition extends ControlDefinition {
289
290
  type: ControlDefinitionType.Action;
290
291
  actionId: string;
292
+ actionData: string;
291
293
  }
292
294
  export declare enum ValidatorType {
293
295
  Jsonata = "Jsonata",
package/lib/util.d.ts CHANGED
@@ -40,10 +40,11 @@ export declare function addMissingControls(fields: SchemaField[], controls: Cont
40
40
  export declare function useUpdatedRef<A>(a: A): MutableRefObject<A>;
41
41
  export declare function isControlReadonly(c: ControlDefinition): boolean;
42
42
  export declare function getDisplayOnlyOptions(d: ControlDefinition): DisplayOnlyRenderOptions | undefined;
43
- export declare function getTypeField(context: ControlDataContext): Control<string> | undefined;
43
+ export declare function getTypeField(context: ControlDataContext, fieldPath: SchemaField[]): Control<string> | undefined;
44
44
  export declare function visitControlDataArray<A>(controls: ControlDefinition[] | undefined | null, context: ControlDataContext, cb: (definition: DataControlDefinition, field: SchemaField, control: Control<any>, element: boolean) => A | undefined): A | undefined;
45
45
  export declare function visitControlData<A>(definition: ControlDefinition, ctx: ControlDataContext, cb: (definition: DataControlDefinition, field: SchemaField, control: Control<any>, element: boolean) => A | undefined): A | undefined;
46
- export declare function lookupChildControl(data: DataContext, child: JsonPath): Control<any> | undefined;
46
+ export declare function lookupChildControl(data: DataContext, path: SchemaField[]): Control<any> | undefined;
47
+ export declare function lookupChildControlPath(data: DataContext, jsonPath: JsonPath[]): Control<any> | undefined;
47
48
  export declare function cleanDataForSchema(v: {
48
49
  [k: string]: any;
49
50
  } | undefined, fields: SchemaField[]): any;
@@ -52,6 +53,7 @@ export declare function jsonPathString(jsonPath: JsonPath[], customIndex?: (n: n
52
53
  export declare function findChildDefinition(parent: ControlDefinition, childPath: number | number[]): ControlDefinition;
53
54
  export declare function getOverrideClass(className?: string | null): string | null | undefined;
54
55
  export declare function rendererClass(controlClass?: string | null, globalClass?: string | null): string | undefined;
56
+ export declare function watchControlLookup(base: Control<any> | undefined, path: (string | number)[]): Control<any> | undefined;
55
57
  export type HookDep = string | number | undefined | null;
56
58
  export interface DynamicHookGenerator<A, P> {
57
59
  deps: HookDep;
@@ -66,3 +68,4 @@ export declare function useDynamicHooks<P, Hooks extends Record<string, DynamicH
66
68
  export declare function toDepString(x: any): string;
67
69
  export declare function appendElementIndex(dataContext: ControlDataContext, elementIndex: number): ControlDataContext;
68
70
  export declare function applyLengthRestrictions<Min, Max>(length: number, min: number | null | undefined, max: number | null | undefined, minValue: Min, maxValue: Max): [Min | undefined, Max | undefined];
71
+ export declare function findFieldPath(fields: SchemaField[], fieldPath: string): SchemaField[] | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-typed-forms/schemas",
3
- "version": "10.3.0",
3
+ "version": "11.0.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "material-ui"
25
25
  ],
26
26
  "dependencies": {
27
- "@react-typed-forms/core": "^3.2.0",
27
+ "@react-typed-forms/core": "^3.3.2",
28
28
  "clsx": "^1 || ^2",
29
29
  "jsonata": "^2.0.4",
30
30
  "react": "^18.2.0"