reactaform 1.5.0 → 1.8.1
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/dist/common-Awfy-0XP.js +1 -0
- package/dist/{common-DRxsgpaH.mjs → common-BZgeDhcm.mjs} +40 -15
- package/dist/common-BmlrZtLZ.js +1 -0
- package/dist/common-CBecOKIA.mjs +123 -0
- package/dist/{common-CTK4jqc5.mjs → common-CsY8BnXg.mjs} +58 -33
- package/dist/common-D8L4oP0c.js +1 -0
- package/dist/common-DnEDu-7h.mjs +123 -0
- package/dist/common-udunqMU-.js +1 -0
- package/dist/components/LayoutComponents.d.ts +77 -0
- package/dist/components/PopupOptionMenu.d.ts +16 -0
- package/dist/components/ReactaForm.d.ts +4 -0
- package/dist/components/ReactaFormProvider.d.ts +5 -0
- package/dist/components/ReactaFormRenderer.d.ts +10 -0
- package/dist/components/SubmissionButton.d.ts +8 -0
- package/dist/components/SubmissionMessage.d.ts +7 -0
- package/dist/components/Tooltip.d.ts +8 -0
- package/dist/components/fields/CheckboxInput.d.ts +5 -0
- package/dist/components/fields/ColorInput.d.ts +13 -0
- package/dist/components/fields/DateInput.d.ts +11 -0
- package/dist/components/fields/DropdownInput.d.ts +16 -0
- package/dist/components/fields/EmailInput.d.ts +5 -0
- package/dist/components/fields/FileInput.d.ts +5 -0
- package/dist/components/fields/FloatArrayInput.d.ts +8 -0
- package/dist/components/fields/FloatInput.d.ts +9 -0
- package/dist/components/fields/ImageDisplay.d.ts +18 -0
- package/dist/components/fields/IntegerArrayInput.d.ts +9 -0
- package/dist/components/fields/IntegerInput.d.ts +6 -0
- package/dist/components/fields/MultiSelection.d.ts +9 -0
- package/dist/components/fields/MultilineTextInput.d.ts +6 -0
- package/dist/components/fields/NumericStepperInput.d.ts +6 -0
- package/dist/components/fields/PasswordInput.d.ts +6 -0
- package/dist/components/fields/PhoneInput.d.ts +6 -0
- package/dist/components/fields/RadioInput.d.ts +8 -0
- package/dist/components/fields/RatingInput.d.ts +9 -0
- package/dist/components/fields/Separator.d.ts +21 -0
- package/dist/components/fields/SliderInput.d.ts +5 -0
- package/dist/components/fields/SpinInput.d.ts +5 -0
- package/dist/components/fields/SwitchInput.d.ts +8 -0
- package/dist/components/fields/TextInput.d.ts +8 -0
- package/dist/components/fields/TimeInput.d.ts +6 -0
- package/dist/components/fields/UnitValueInput.d.ts +5 -0
- package/dist/components/fields/UrlInput.d.ts +9 -0
- package/dist/components/renderFields.d.ts +3 -0
- package/dist/core/baseRegistry.d.ts +15 -0
- package/dist/core/componentRegistry.d.ts +15 -0
- package/dist/core/env.d.ts +1 -0
- package/dist/core/fieldVisibility.d.ts +25 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/pluginRegistry.d.ts +45 -0
- package/dist/core/reactaFormModel.d.ts +31 -0
- package/dist/core/reactaFormTypes.d.ts +148 -0
- package/dist/core/submissionHandlerRegistry.d.ts +7 -0
- package/dist/core/submitForm.d.ts +9 -0
- package/dist/hooks/useDebouncedCallback.d.ts +27 -0
- package/dist/hooks/useDropdownPosition.d.ts +6 -0
- package/dist/hooks/useFieldValidator.d.ts +2 -0
- package/dist/hooks/useReactaFormContext.d.ts +4 -0
- package/dist/hooks/useUncontrolledValidatedInput.d.ts +18 -0
- package/dist/hooks/useUnitValueField.d.ts +13 -0
- package/dist/index.d.ts +10 -9
- package/dist/reactaform.cjs.js +18 -5
- package/dist/reactaform.css +1 -1
- package/dist/reactaform.es.js +4346 -3991
- package/dist/utils/cssClasses.d.ts +14 -0
- package/dist/utils/definitionSerializers.d.ts +62 -0
- package/dist/utils/groupingHelpers.d.ts +24 -0
- package/dist/utils/themeUtils.d.ts +31 -0
- package/dist/utils/translationCache.d.ts +43 -0
- package/dist/utils/unitValueMapper.d.ts +14 -0
- package/dist/validation/registerBuiltinTypeValidators.d.ts +11 -0
- package/dist/validation/validateColorField.d.ts +2 -0
- package/dist/validation/validateDateField.d.ts +2 -0
- package/dist/validation/validateEmailField.d.ts +2 -0
- package/dist/validation/validateFieldPattern.d.ts +3 -0
- package/dist/validation/validateFileField.d.ts +2 -0
- package/dist/validation/validateFloatField.d.ts +3 -0
- package/dist/validation/validateIntegerField.d.ts +3 -0
- package/dist/validation/validatePhoneField.d.ts +2 -0
- package/dist/validation/validateRatingField.d.ts +2 -0
- package/dist/validation/validateSelectionFields.d.ts +3 -0
- package/dist/validation/validateTextField.d.ts +2 -0
- package/dist/validation/validateTimeField.d.ts +2 -0
- package/dist/validation/validateUnitValueField.d.ts +2 -0
- package/dist/validation/validateUrlField.d.ts +2 -0
- package/dist/validation/validation.d.ts +12 -0
- package/dist/validation/validationHandlerRegistry.d.ts +20 -0
- package/package.json +14 -34
- package/dist/common-BeJOG7Z0.js +0 -1
- package/dist/common-Crb-me6O.js +0 -1
- package/dist/common-DINaqn4M.mjs +0 -98
- package/dist/common-DLr0UoG9.js +0 -1
- package/dist/common-DRIndE7S.js +0 -1
- package/dist/common-DXEjsP3o.mjs +0 -98
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type DebouncedCallback = {
|
|
2
|
+
callback: (...args: unknown[]) => void;
|
|
3
|
+
cancel: () => void;
|
|
4
|
+
flush: () => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* useDebouncedCallback
|
|
8
|
+
* - callback: function to call
|
|
9
|
+
* - wait: debounce delay in ms
|
|
10
|
+
* - options.leading: if true, call on leading edge (optional)
|
|
11
|
+
*
|
|
12
|
+
* Returns { callback, cancel, flush } where callback is debounced.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useDebouncedCallback(callback: (...args: unknown[]) => unknown, wait?: number, options?: {
|
|
15
|
+
leading?: boolean;
|
|
16
|
+
trailing?: boolean;
|
|
17
|
+
}): DebouncedCallback;
|
|
18
|
+
/**
|
|
19
|
+
* createDebouncedCallback - non-hook variant that returns the same API but
|
|
20
|
+
* doesn't use React hooks. Useful for creating many debounced callbacks
|
|
21
|
+
* programmatically (e.g., driven from a static schema) while handling
|
|
22
|
+
* lifecycle cleanup manually.
|
|
23
|
+
*/
|
|
24
|
+
export declare function createDebouncedCallback(callback: (...args: unknown[]) => unknown, wait?: number, options?: {
|
|
25
|
+
leading?: boolean;
|
|
26
|
+
trailing?: boolean;
|
|
27
|
+
}): DebouncedCallback;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ReactaFormContextType } from '../core/reactaFormTypes';
|
|
2
|
+
export declare const ReactaFormContext: import("react").Context<ReactaFormContextType | undefined>;
|
|
3
|
+
declare const useReactaFormContext: () => ReactaFormContextType;
|
|
4
|
+
export default useReactaFormContext;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type UseUncontrolledValidatedInputProps = {
|
|
3
|
+
value?: string | number;
|
|
4
|
+
onChange?: (value: string) => void;
|
|
5
|
+
onError?: (error: string | null) => void;
|
|
6
|
+
validate: (value: string) => string | null;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Handles:
|
|
10
|
+
* - Uncontrolled input
|
|
11
|
+
* - Validation
|
|
12
|
+
* - Error sync
|
|
13
|
+
*/
|
|
14
|
+
export declare function useUncontrolledValidatedInput<T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement>({ value, onChange, onError, validate, }: UseUncontrolledValidatedInputProps): {
|
|
15
|
+
inputRef: React.MutableRefObject<T | null>;
|
|
16
|
+
error: string | null;
|
|
17
|
+
handleChange: (e: React.ChangeEvent<T>) => void;
|
|
18
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DefinitionPropertyField } from "../core/reactaFormTypes";
|
|
2
|
+
export declare function useUnitValueField(definitionName: string, field: DefinitionPropertyField, value: [string | number, string], unitFactors: {
|
|
3
|
+
default: string;
|
|
4
|
+
labels: Record<string, string>;
|
|
5
|
+
reverseLabels?: Record<string, string>;
|
|
6
|
+
}, t: (key: string) => string, onChange?: (v: [string, string], err: string | null) => void, onError?: (err: string | null) => void): {
|
|
7
|
+
value: string;
|
|
8
|
+
unit: string;
|
|
9
|
+
error: string | null;
|
|
10
|
+
setValue: (v: string) => void;
|
|
11
|
+
setUnit: (u: string) => void;
|
|
12
|
+
setBoth: (v: string, u: string) => void;
|
|
13
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -6,19 +6,20 @@ export { ReactaFormProvider } from './components/ReactaFormProvider';
|
|
|
6
6
|
export { default as useReactaFormContext } from './hooks/useReactaFormContext';
|
|
7
7
|
export { StandardFieldLayout } from './components/LayoutComponents';
|
|
8
8
|
export { CSS_CLASSES, combineClasses } from './utils/cssClasses';
|
|
9
|
-
export type { ReactaFormContextType, ReactaFormProviderProps, DefinitionPropertyField, ReactaDefinition, ReactaInstance, ReactaFormProps, FieldValueType, ErrorType,
|
|
10
|
-
export { registerComponent, getComponent, } from './core/
|
|
11
|
-
export { validateFieldValue
|
|
12
|
-
|
|
13
|
-
export type
|
|
9
|
+
export type { ReactaFormContextType, ReactaFormProviderProps, DefinitionPropertyField, ReactaDefinition, ReactaInstance, ReactaFormProps, FieldValueType, ErrorType, FieldCustomValidationHandler, FieldTypeValidationHandler, FormValidationHandler, FormSubmissionHandler, InputOnChange, BaseInputProps, TranslationFunction, FieldValidationMode } from './core/reactaFormTypes';
|
|
10
|
+
export { registerComponent, getComponent, } from './core/componentRegistry';
|
|
11
|
+
export { validateFieldValue, // Deprecated, use validateFieldWithHandler instead
|
|
12
|
+
validateFieldWithCustomHandler } from './validation/validation';
|
|
13
|
+
export { type ReactaFormPlugin, type ConflictResolution, type PluginRegistrationOptions, type PluginConflict, registerPlugin, unregisterPlugin, getPlugin, getAllPlugins, hasPlugin, registerComponents, } from './core/pluginRegistry';
|
|
14
14
|
export type { LoadDefinitionOptions, DefinitionLoadResult, InstanceLoadResult, } from './core/reactaFormModel';
|
|
15
15
|
export { loadJsonDefinition, createInstanceFromDefinition, // Create new instance with default values
|
|
16
16
|
loadInstance, // Load existing instance (valuesMap)
|
|
17
17
|
upgradeInstanceToLatestDefinition } from './core/reactaFormModel';
|
|
18
|
-
export { registerSubmissionHandler, } from './core/
|
|
19
|
-
export {
|
|
20
|
-
export type
|
|
21
|
-
export {
|
|
18
|
+
export { registerSubmissionHandler, } from './core/submissionHandlerRegistry';
|
|
19
|
+
export { registerFieldCustomValidationHandler, registerFieldTypeValidationHandler, registerFormValidationHandler, } from './validation/validationHandlerRegistry';
|
|
20
|
+
export { type DebouncedCallback, useDebouncedCallback } from './hooks/useDebouncedCallback';
|
|
21
|
+
export { useFieldValidator } from './hooks/useFieldValidator';
|
|
22
|
+
export { useUncontrolledValidatedInput, type UseUncontrolledValidatedInputProps } from './hooks/useUncontrolledValidatedInput';
|
|
22
23
|
export * as Units from './utils/unitValueMapper';
|
|
23
24
|
export { isDarkTheme } from './utils/themeUtils';
|
|
24
25
|
export { serializeInstance, deserializeInstance, serializeDefinition, deserializeDefinition } from './utils/definitionSerializers';
|