@react-typed-forms/schemas 13.1.5 → 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/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;
@@ -307,7 +308,8 @@ export declare enum GroupRenderType {
307
308
  Standard = "Standard",
308
309
  Grid = "Grid",
309
310
  Flex = "Flex",
310
- GroupElement = "GroupElement"
311
+ GroupElement = "GroupElement",
312
+ SelectChild = "SelectChild"
311
313
  }
312
314
  export interface StandardGroupRenderer extends GroupRenderOptions {
313
315
  type: GroupRenderType.Standard;
@@ -325,6 +327,10 @@ export interface GridRenderer extends GroupRenderOptions {
325
327
  type: GroupRenderType.Grid;
326
328
  columns?: number | null;
327
329
  }
330
+ export interface SelectChildRenderer extends GroupRenderOptions {
331
+ type: GroupRenderType.SelectChild;
332
+ childIndexExpression?: EntityExpression | null;
333
+ }
328
334
  export interface DisplayControlDefinition extends ControlDefinition {
329
335
  type: ControlDefinitionType.Display;
330
336
  displayData: DisplayData;
@@ -398,6 +404,7 @@ export interface ControlVisitor<A> {
398
404
  }
399
405
  export declare function visitControlDefinition<A>(x: ControlDefinition, visitor: ControlVisitor<A>, defaultValue: (c: ControlDefinition) => A): A;
400
406
  export declare function isGridRenderer(options: GroupRenderOptions): options is GridRenderer;
407
+ export declare function isSelectChildRenderer(options: GroupRenderOptions): options is SelectChildRenderer;
401
408
  export declare function isFlexRenderer(options: GroupRenderOptions): options is FlexRenderer;
402
409
  export declare function isDisplayOnlyRenderer(options: RenderOptions): options is DisplayOnlyRenderOptions;
403
410
  export declare function isTextfieldRenderer(options: RenderOptions): options is TextfieldRenderOptions;
@@ -408,3 +415,4 @@ export declare function isScalarField(sf: SchemaField): sf is SchemaField;
408
415
  export declare function isCompoundField(sf: SchemaField): sf is CompoundField;
409
416
  export declare function isDataControl(c: ControlDefinition): c is DataControlDefinition;
410
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,4 +1,4 @@
1
- import { CompoundField, ControlDefinition, DataControlDefinition, DisplayOnlyRenderOptions, FieldOption, GroupRenderOptions, 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
4
  export interface ControlClasses {
@@ -71,3 +71,4 @@ export declare function coerceToString(v: unknown): string;
71
71
  export declare function getGroupRendererOptions(def: ControlDefinition): GroupRenderOptions | undefined;
72
72
  export declare function getGroupClassOverrides(def: ControlDefinition): ControlClasses;
73
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.1.5",
3
+ "version": "13.2.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.cjs",