@react-typed-forms/schemas 13.1.5 → 13.3.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 +3 -3
- 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 +17 -3
- package/lib/util.d.ts +2 -1
- package/package.json +1 -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;
|
|
@@ -213,7 +214,12 @@ export interface TextfieldRenderOptions extends RenderOptions {
|
|
|
213
214
|
placeholder?: string | null;
|
|
214
215
|
multiline?: boolean | null;
|
|
215
216
|
}
|
|
216
|
-
export interface
|
|
217
|
+
export interface CheckEntryClasses {
|
|
218
|
+
entryWrapperClass?: string | null;
|
|
219
|
+
selectedClass?: string | null;
|
|
220
|
+
notSelectedClass?: string | null;
|
|
221
|
+
}
|
|
222
|
+
export interface RadioButtonRenderOptions extends RenderOptions, CheckEntryClasses {
|
|
217
223
|
type: DataRenderType.Radio;
|
|
218
224
|
}
|
|
219
225
|
export interface StandardRenderer extends RenderOptions {
|
|
@@ -269,7 +275,7 @@ export type ArrayActionOptions = Pick<ArrayRenderOptions, "addText" | "addAction
|
|
|
269
275
|
disabled?: boolean;
|
|
270
276
|
designMode?: boolean;
|
|
271
277
|
};
|
|
272
|
-
export interface CheckListRenderOptions extends RenderOptions {
|
|
278
|
+
export interface CheckListRenderOptions extends RenderOptions, CheckEntryClasses {
|
|
273
279
|
type: DataRenderType.CheckList;
|
|
274
280
|
}
|
|
275
281
|
export interface SynchronisedRenderOptions extends RenderOptions {
|
|
@@ -307,7 +313,8 @@ export declare enum GroupRenderType {
|
|
|
307
313
|
Standard = "Standard",
|
|
308
314
|
Grid = "Grid",
|
|
309
315
|
Flex = "Flex",
|
|
310
|
-
GroupElement = "GroupElement"
|
|
316
|
+
GroupElement = "GroupElement",
|
|
317
|
+
SelectChild = "SelectChild"
|
|
311
318
|
}
|
|
312
319
|
export interface StandardGroupRenderer extends GroupRenderOptions {
|
|
313
320
|
type: GroupRenderType.Standard;
|
|
@@ -325,6 +332,10 @@ export interface GridRenderer extends GroupRenderOptions {
|
|
|
325
332
|
type: GroupRenderType.Grid;
|
|
326
333
|
columns?: number | null;
|
|
327
334
|
}
|
|
335
|
+
export interface SelectChildRenderer extends GroupRenderOptions {
|
|
336
|
+
type: GroupRenderType.SelectChild;
|
|
337
|
+
childIndexExpression?: EntityExpression | null;
|
|
338
|
+
}
|
|
328
339
|
export interface DisplayControlDefinition extends ControlDefinition {
|
|
329
340
|
type: ControlDefinitionType.Display;
|
|
330
341
|
displayData: DisplayData;
|
|
@@ -398,6 +409,7 @@ export interface ControlVisitor<A> {
|
|
|
398
409
|
}
|
|
399
410
|
export declare function visitControlDefinition<A>(x: ControlDefinition, visitor: ControlVisitor<A>, defaultValue: (c: ControlDefinition) => A): A;
|
|
400
411
|
export declare function isGridRenderer(options: GroupRenderOptions): options is GridRenderer;
|
|
412
|
+
export declare function isSelectChildRenderer(options: GroupRenderOptions): options is SelectChildRenderer;
|
|
401
413
|
export declare function isFlexRenderer(options: GroupRenderOptions): options is FlexRenderer;
|
|
402
414
|
export declare function isDisplayOnlyRenderer(options: RenderOptions): options is DisplayOnlyRenderOptions;
|
|
403
415
|
export declare function isTextfieldRenderer(options: RenderOptions): options is TextfieldRenderOptions;
|
|
@@ -408,3 +420,5 @@ export declare function isScalarField(sf: SchemaField): sf is SchemaField;
|
|
|
408
420
|
export declare function isCompoundField(sf: SchemaField): sf is CompoundField;
|
|
409
421
|
export declare function isDataControl(c: ControlDefinition): c is DataControlDefinition;
|
|
410
422
|
export declare function isGroupControl(c: ControlDefinition): c is GroupedControlsDefinition;
|
|
423
|
+
export type ControlActionHandler = (actionId: string, actionData: any, ctx: ControlDataContext) => (() => void) | undefined;
|
|
424
|
+
export declare function isCheckEntryClasses(options?: RenderOptions | null): options is CheckEntryClasses & RenderOptions;
|
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;
|