@resistdesign/voltra 3.0.0-alpha.34 → 3.0.0-alpha.35
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/app/forms/UI.d.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Shared AutoForm UI components driven by renderer suites.
|
|
5
5
|
*/
|
|
6
|
-
import { FC } from "react";
|
|
7
6
|
import type { ReactElement } from "react";
|
|
7
|
+
import { FC } from "react";
|
|
8
8
|
import type { TypeInfo, TypeOperation } from "../../common/TypeParsing/TypeInfo";
|
|
9
|
-
import type { AutoFieldProps,
|
|
9
|
+
import type { AutoFieldProps, CustomTypeActionPayload, CustomValidatorMap, FormController, FormValues, RelationActionPayload, TranslateValidationErrorCode } from "./types";
|
|
10
10
|
import type { ResolvedSuite } from "./core/types";
|
|
11
11
|
/**
|
|
12
12
|
* Renderer contract used by shared AutoForm components.
|
|
@@ -70,6 +70,10 @@ export interface AutoFormProps {
|
|
|
70
70
|
/** Optional custom validators keyed by field name. */
|
|
71
71
|
customValidatorMap?: CustomValidatorMap;
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Default translation from error descriptors to readable messages.
|
|
75
|
+
*/
|
|
76
|
+
export declare const defaultTranslateValidationErrorCode: TranslateValidationErrorCode;
|
|
73
77
|
/**
|
|
74
78
|
* Build a controller from type metadata and render an auto form.
|
|
75
79
|
*
|
package/app/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { createEasyLayout, getEasyLayoutTemplateDetails, getPascalCaseAreaName } from '../chunk-
|
|
1
|
+
export { createEasyLayout, getEasyLayoutTemplateDetails, getPascalCaseAreaName } from '../chunk-BKRJZXWX.js';
|
|
2
2
|
export { computeTrackPixels } from '../chunk-TJFTWPXQ.js';
|
|
3
|
-
export { AutoForm, AutoFormView, Route, RouteContext, RouteContextConsumer, RouteContextProvider, RouteProvider, buildHistoryPath, buildQueryString, buildRoutePath, canUseBrowserHistory, computeAreaBounds, createAutoField, createBrowserRouteAdapter, createFormRenderer, createHistoryBackHandler, createManualRouteAdapter, createMemoryHistory, createNativeRouteAdapter, createRouteAdapterFromHistory, createUniversalAdapter, getFieldKind, parseHistoryPath, parseTemplate, resolveSuite, useFormEngine, useRouteContext, validateAreas } from '../chunk-
|
|
3
|
+
export { AutoForm, AutoFormView, Route, RouteContext, RouteContextConsumer, RouteContextProvider, RouteProvider, buildHistoryPath, buildQueryString, buildRoutePath, canUseBrowserHistory, computeAreaBounds, createAutoField, createBrowserRouteAdapter, createFormRenderer, createHistoryBackHandler, createManualRouteAdapter, createMemoryHistory, createNativeRouteAdapter, createRouteAdapterFromHistory, createUniversalAdapter, defaultTranslateValidationErrorCode, getFieldKind, parseHistoryPath, parseTemplate, resolveSuite, useFormEngine, useRouteContext, validateAreas } from '../chunk-X3NHBZUT.js';
|
|
4
4
|
import '../chunk-7AMEFPPP.js';
|
|
5
5
|
import '../chunk-WTD5BBJP.js';
|
|
6
6
|
import { mergeStringPaths, PATH_DELIMITER } from '../chunk-GYWRAW3Y.js';
|
|
@@ -1024,7 +1024,7 @@ var AutoFormView = ({
|
|
|
1024
1024
|
submitDisabled,
|
|
1025
1025
|
onRelationAction,
|
|
1026
1026
|
onCustomTypeAction,
|
|
1027
|
-
translateValidationErrorCode
|
|
1027
|
+
translateValidationErrorCode = defaultTranslateValidationErrorCode
|
|
1028
1028
|
}) => {
|
|
1029
1029
|
const FormRoot = renderer.suite.primitives?.FormRoot ?? fallbackFormRoot;
|
|
1030
1030
|
const Button = renderer.suite.primitives?.Button ?? fallbackButton;
|
|
@@ -1114,14 +1114,13 @@ var AutoForm = ({
|
|
|
1114
1114
|
onCustomTypeAction,
|
|
1115
1115
|
operation,
|
|
1116
1116
|
submitDisabled,
|
|
1117
|
-
translateValidationErrorCode,
|
|
1117
|
+
translateValidationErrorCode = defaultTranslateValidationErrorCode,
|
|
1118
1118
|
customValidatorMap
|
|
1119
1119
|
}) => {
|
|
1120
1120
|
const controller = useFormEngine(initialValues, typeInfo, {
|
|
1121
1121
|
operation,
|
|
1122
1122
|
customValidatorMap
|
|
1123
1123
|
});
|
|
1124
|
-
const resolvedTranslateValidationErrorCode = translateValidationErrorCode ?? defaultTranslateValidationErrorCode;
|
|
1125
1124
|
useEffect(() => {
|
|
1126
1125
|
if (onValuesChange) {
|
|
1127
1126
|
onValuesChange(controller.values);
|
|
@@ -1136,9 +1135,9 @@ var AutoForm = ({
|
|
|
1136
1135
|
onRelationAction,
|
|
1137
1136
|
onCustomTypeAction,
|
|
1138
1137
|
submitDisabled,
|
|
1139
|
-
translateValidationErrorCode
|
|
1138
|
+
translateValidationErrorCode
|
|
1140
1139
|
}
|
|
1141
1140
|
);
|
|
1142
1141
|
};
|
|
1143
1142
|
|
|
1144
|
-
export { AutoForm, AutoFormView, Route, RouteContext, RouteContextConsumer, RouteContextProvider, RouteProvider, buildHistoryPath, buildQueryString, buildRoutePath, canUseBrowserHistory, computeAreaBounds, createAutoField, createBrowserRouteAdapter, createFormRenderer, createHistoryBackHandler, createManualRouteAdapter, createMemoryHistory, createNativeRouteAdapter, createRouteAdapterFromHistory, createUniversalAdapter, getFieldKind, parseHistoryPath, parseTemplate, resolveSuite, useFormEngine, useRouteContext, validateAreas };
|
|
1143
|
+
export { AutoForm, AutoFormView, Route, RouteContext, RouteContextConsumer, RouteContextProvider, RouteProvider, buildHistoryPath, buildQueryString, buildRoutePath, canUseBrowserHistory, computeAreaBounds, createAutoField, createBrowserRouteAdapter, createFormRenderer, createHistoryBackHandler, createManualRouteAdapter, createMemoryHistory, createNativeRouteAdapter, createRouteAdapterFromHistory, createUniversalAdapter, defaultTranslateValidationErrorCode, getFieldKind, parseHistoryPath, parseTemplate, resolveSuite, useFormEngine, useRouteContext, validateAreas };
|
package/native/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computeTrackPixels } from '../chunk-TJFTWPXQ.js';
|
|
2
|
-
import { createFormRenderer, createHistoryBackHandler, buildHistoryPath, AutoFormView, AutoForm, parseTemplate, validateAreas, computeAreaBounds, parseHistoryPath, createMemoryHistory, Route, buildRoutePath } from '../chunk-
|
|
2
|
+
import { createFormRenderer, createHistoryBackHandler, buildHistoryPath, AutoFormView, AutoForm, parseTemplate, validateAreas, computeAreaBounds, parseHistoryPath, createMemoryHistory, Route, buildRoutePath } from '../chunk-X3NHBZUT.js';
|
|
3
3
|
import { ERROR_MESSAGE_CONSTANTS } from '../chunk-WTD5BBJP.js';
|
|
4
4
|
import { getPathArray } from '../chunk-GYWRAW3Y.js';
|
|
5
5
|
import '../chunk-I2KLQ2HA.js';
|
package/package.json
CHANGED
package/web/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createEasyLayout } from '../chunk-
|
|
2
|
-
import { createFormRenderer, AutoFormView, AutoForm, createBrowserRouteAdapter, Route } from '../chunk-
|
|
1
|
+
import { createEasyLayout } from '../chunk-BKRJZXWX.js';
|
|
2
|
+
import { createFormRenderer, AutoFormView, AutoForm, createBrowserRouteAdapter, Route } from '../chunk-X3NHBZUT.js';
|
|
3
3
|
import { ERROR_MESSAGE_CONSTANTS } from '../chunk-WTD5BBJP.js';
|
|
4
4
|
import '../chunk-GYWRAW3Y.js';
|
|
5
5
|
import { __export, __reExport } from '../chunk-I2KLQ2HA.js';
|