@react-typed-forms/schemas 14.1.3 → 14.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/controlDefinition.d.ts +21 -2
- package/lib/controlRender.d.ts +3 -2
- package/lib/index.cjs +3392 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +2869 -1
- package/lib/index.js.map +1 -1
- package/lib/renderers.d.ts +2 -2
- package/lib/util.d.ts +12 -1
- package/package.json +3 -2
- package/src/controlBuilder.ts +268 -0
- package/src/controlDefinition.ts +792 -0
- package/src/controlRender.tsx +1252 -0
- package/src/createFormRenderer.tsx +218 -0
- package/src/defaultSchemaInterface.ts +191 -0
- package/src/dynamicHooks.ts +98 -0
- package/src/entityExpression.ts +38 -0
- package/src/hooks.tsx +459 -0
- package/src/index.ts +14 -0
- package/src/renderers.tsx +205 -0
- package/src/schemaBuilder.ts +318 -0
- package/src/schemaField.ts +552 -0
- package/src/schemaValidator.ts +32 -0
- package/src/util.ts +1039 -0
- package/src/validators.ts +217 -0
|
@@ -139,7 +139,8 @@ export declare enum DataRenderType {
|
|
|
139
139
|
NullToggle = "NullToggle",
|
|
140
140
|
Autocomplete = "Autocomplete",
|
|
141
141
|
Jsonata = "Jsonata",
|
|
142
|
-
Array = "Array"
|
|
142
|
+
Array = "Array",
|
|
143
|
+
ArrayElement = "ArrayElement"
|
|
143
144
|
}
|
|
144
145
|
export interface TextfieldRenderOptions extends RenderOptions {
|
|
145
146
|
type: DataRenderType.Textfield;
|
|
@@ -179,6 +180,7 @@ export interface DateTimeRenderOptions extends RenderOptions {
|
|
|
179
180
|
type: DataRenderType.DateTime;
|
|
180
181
|
format?: string | null;
|
|
181
182
|
forceMidnight?: boolean;
|
|
183
|
+
forceStandard?: boolean;
|
|
182
184
|
}
|
|
183
185
|
export interface IconListRenderOptions extends RenderOptions {
|
|
184
186
|
type: DataRenderType.IconList;
|
|
@@ -207,12 +209,19 @@ export interface ArrayRenderOptions extends RenderOptions {
|
|
|
207
209
|
addActionId?: string | null;
|
|
208
210
|
removeText?: string | null;
|
|
209
211
|
removeActionId?: string | null;
|
|
212
|
+
editText?: string | null;
|
|
213
|
+
editActionId?: string | null;
|
|
210
214
|
noAdd?: boolean | null;
|
|
211
215
|
noRemove?: boolean | null;
|
|
212
216
|
noReorder?: boolean | null;
|
|
213
217
|
childOptions?: RenderOptions | null;
|
|
218
|
+
editExternal?: boolean | null;
|
|
214
219
|
}
|
|
215
|
-
export
|
|
220
|
+
export interface ArrayElementRenderOptions extends RenderOptions {
|
|
221
|
+
type: DataRenderType.ArrayElement;
|
|
222
|
+
showInline?: boolean | null;
|
|
223
|
+
}
|
|
224
|
+
export type ArrayActionOptions = Pick<ArrayRenderOptions, "addText" | "addActionId" | "removeText" | "removeActionId" | "noAdd" | "noRemove" | "noReorder" | "editExternal" | "editActionId" | "editText"> & {
|
|
216
225
|
readonly?: boolean;
|
|
217
226
|
disabled?: boolean;
|
|
218
227
|
designMode?: boolean;
|
|
@@ -329,6 +338,7 @@ export declare function isTabsRenderer(options: GroupRenderOptions): options is
|
|
|
329
338
|
export declare function isFlexRenderer(options: GroupRenderOptions): options is FlexRenderer;
|
|
330
339
|
export declare function isDisplayOnlyRenderer(options: RenderOptions): options is DisplayOnlyRenderOptions;
|
|
331
340
|
export declare function isTextfieldRenderer(options: RenderOptions): options is TextfieldRenderOptions;
|
|
341
|
+
export declare function isDateTimeRenderer(options: RenderOptions): options is DateTimeRenderOptions;
|
|
332
342
|
export declare function isAutocompleteRenderer(options: RenderOptions): options is AutocompleteRenderOptions;
|
|
333
343
|
export declare function isAutoCompleteClasses(options?: RenderOptions | null): options is AutocompleteClasses & RenderOptions;
|
|
334
344
|
export declare function isDataGroupRenderer(options?: RenderOptions | null): options is DataGroupRenderOptions;
|
|
@@ -371,5 +381,14 @@ export declare function getRootDataNode(dataNode: SchemaDataNode): SchemaDataNod
|
|
|
371
381
|
export declare function getJsonPath(dataNode: SchemaDataNode): (string | number)[];
|
|
372
382
|
export declare function getSchemaPath(schemaNode: SchemaNode): SchemaField[];
|
|
373
383
|
export declare function getSchemaFieldList(schema: SchemaNode): SchemaField[];
|
|
384
|
+
/**
|
|
385
|
+
* @deprecated use visitFormNodeData instead
|
|
386
|
+
*/
|
|
374
387
|
export declare function visitControlDataArray<A>(controls: ControlDefinition[] | undefined | null, context: SchemaDataNode, cb: (definition: DataControlDefinition, node: SchemaDataNode) => A | undefined): A | undefined;
|
|
388
|
+
/**
|
|
389
|
+
* @deprecated use visitFormDataInContext instead
|
|
390
|
+
*/
|
|
375
391
|
export declare function visitControlData<A>(definition: ControlDefinition, ctx: SchemaDataNode, cb: (definition: DataControlDefinition, field: SchemaDataNode) => A | undefined): A | undefined;
|
|
392
|
+
export type ControlDataVisitor<A> = (dataNode: SchemaDataNode, definition: DataControlDefinition) => A | undefined;
|
|
393
|
+
export declare function visitFormData<A>(node: FormNode, dataNode: SchemaDataNode, cb: ControlDataVisitor<A>, notSelf?: boolean): A | undefined;
|
|
394
|
+
export declare function visitFormDataInContext<A>(parentContext: SchemaDataNode, node: FormNode, cb: ControlDataVisitor<A>): A | undefined;
|
package/lib/controlRender.d.ts
CHANGED
|
@@ -91,6 +91,7 @@ export interface ArrayRendererProps {
|
|
|
91
91
|
addAction?: ActionRendererProps;
|
|
92
92
|
required: boolean;
|
|
93
93
|
removeAction?: (elemIndex: number) => ActionRendererProps;
|
|
94
|
+
editAction?: (elemIndex: number) => ActionRendererProps;
|
|
94
95
|
renderElement: (elemIndex: number, wrapEntry: (children: ReactNode) => ReactNode) => ReactNode;
|
|
95
96
|
arrayControl: Control<any[] | undefined | null>;
|
|
96
97
|
className?: string;
|
|
@@ -348,8 +349,8 @@ export declare function getLengthRestrictions(definition: DataControlDefinition)
|
|
|
348
349
|
min: number | null | undefined;
|
|
349
350
|
max: number | null | undefined;
|
|
350
351
|
};
|
|
351
|
-
export declare function createArrayActions(control: Control<any[]>, field: SchemaField, options?: ArrayActionOptions): Pick<ArrayRendererProps, "addAction" | "removeAction" | "arrayControl">;
|
|
352
|
-
export declare function applyArrayLengthRestrictions({ arrayControl, min, max, addAction: aa, removeAction: ra, required, }: Pick<ArrayRendererProps, "addAction" | "removeAction" | "arrayControl" | "min" | "max" | "required">, disable?: boolean): Pick<ArrayRendererProps, "addAction" | "removeAction"> & {
|
|
352
|
+
export declare function createArrayActions(control: Control<any[]>, field: SchemaField, options?: ArrayActionOptions): Pick<ArrayRendererProps, "addAction" | "removeAction" | "editAction" | "arrayControl">;
|
|
353
|
+
export declare function applyArrayLengthRestrictions({ arrayControl, min, max, editAction, addAction: aa, removeAction: ra, required, }: Pick<ArrayRendererProps, "addAction" | "removeAction" | "editAction" | "arrayControl" | "min" | "max" | "required">, disable?: boolean): Pick<ArrayRendererProps, "addAction" | "removeAction" | "editAction"> & {
|
|
353
354
|
addDisabled: boolean;
|
|
354
355
|
removeDisabled: boolean;
|
|
355
356
|
};
|