react-native-better-html 1.0.11 → 1.0.13
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/index.d.mts +102 -58
- package/dist/index.d.ts +102 -58
- package/dist/index.js +359 -103
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +373 -116
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BetterCoreProviderConfig, DeepPartialRecord, BetterCoreConfig, OmitProps, IconName, AnyOtherString, AssetName, LoaderName } from 'react-better-core';
|
|
1
|
+
import { BetterCoreProviderConfig, DeepPartialRecord, BetterCoreConfig, OmitProps, PartialRecord, IconName, AnyOtherString, AssetName, LoaderName } from 'react-better-core';
|
|
2
2
|
export { AnyOtherString, AssetName, AssetsConfig, Color, ColorName, ColorTheme, Colors, Country, DeepPartialRecord, ExcludeOptions, IconName, IconsConfig, LoaderConfig, LoaderName, OmitProps, PartialRecord, PickAllRequired, PickValue, Styles, Theme, ThemeConfig, colorThemeControls, countries, darkenColor, desaturateColor, eventPreventDefault, eventPreventStop, eventStopPropagation, formatPhoneNumber, generateRandomString, getPluralWord, lightenColor, loaderControls, saturateColor, useBooleanState, useDebounceState, useLoader, useLoaderControls, useTheme } from 'react-better-core';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import * as react_native from 'react-native';
|
|
6
|
-
import { ViewStyle, GestureResponderEvent, ViewProps as ViewProps$1, TextProps as TextProps$1,
|
|
6
|
+
import { ViewStyle, TextInput, TextStyle, FocusEvent, NativeSyntheticEvent, NativeTouchEvent, TextInputSubmitEditingEvent, GestureResponderEvent, ViewProps as ViewProps$1, TextProps as TextProps$1, ColorValue, ImageSourcePropType, ImageProps as ImageProps$1, ImageStyle, StatusBar as StatusBar$1 } from 'react-native';
|
|
7
7
|
import { EaseFunction, PropsTransforms } from '@legendapp/motion';
|
|
8
8
|
|
|
9
9
|
type AppConfig = {};
|
|
@@ -46,6 +46,76 @@ type ComponentPropWithRef<ComponentRef, ComponentProps> = ComponentProps & {
|
|
|
46
46
|
|
|
47
47
|
declare const pressStrength: () => Record<"z05" | "z1" | "z2" | "z3", number>;
|
|
48
48
|
|
|
49
|
+
type InputFieldProps = {
|
|
50
|
+
placeholder?: string;
|
|
51
|
+
/** @default "text" */
|
|
52
|
+
type?: "text" | "date" | "time";
|
|
53
|
+
/** @default false */
|
|
54
|
+
iOSDateTimeFullSize?: boolean;
|
|
55
|
+
prefix?: string | React.ReactNode;
|
|
56
|
+
suffix?: string | React.ReactNode;
|
|
57
|
+
defaultValue?: string;
|
|
58
|
+
value?: string | number;
|
|
59
|
+
/** @default true */
|
|
60
|
+
editable?: boolean;
|
|
61
|
+
label?: string;
|
|
62
|
+
isError?: boolean;
|
|
63
|
+
infoMessage?: string;
|
|
64
|
+
errorMessage?: string;
|
|
65
|
+
/** @default false */
|
|
66
|
+
autoFocus?: boolean;
|
|
67
|
+
autoCapitalize?: React.ComponentProps<typeof TextInput>["autoCapitalize"];
|
|
68
|
+
autoComplete?: React.ComponentProps<typeof TextInput>["autoComplete"];
|
|
69
|
+
autoCorrect?: React.ComponentProps<typeof TextInput>["autoCorrect"];
|
|
70
|
+
/** @default "default" */
|
|
71
|
+
keyboardAppearance?: React.ComponentProps<typeof TextInput>["keyboardAppearance"];
|
|
72
|
+
keyboardType?: React.ComponentProps<typeof TextInput>["keyboardType"];
|
|
73
|
+
/** @default false */
|
|
74
|
+
secureTextEntry?: boolean;
|
|
75
|
+
returnKeyLabel?: React.ComponentProps<typeof TextInput>["enterKeyHint"];
|
|
76
|
+
returnKeyType?: React.ComponentProps<typeof TextInput>["returnKeyType"];
|
|
77
|
+
height?: number;
|
|
78
|
+
/** @default 16 */
|
|
79
|
+
fontSize?: number;
|
|
80
|
+
/** @default 400 */
|
|
81
|
+
fontWeight?: TextStyle["fontWeight"];
|
|
82
|
+
/** @default 20 */
|
|
83
|
+
lineHeight?: number;
|
|
84
|
+
textAlign?: React.ComponentProps<typeof TextInput>["textAlign"];
|
|
85
|
+
/** @default false */
|
|
86
|
+
required?: boolean;
|
|
87
|
+
/** @default false */
|
|
88
|
+
disabled?: boolean;
|
|
89
|
+
maxLength?: number;
|
|
90
|
+
/** @default false */
|
|
91
|
+
multiline?: boolean;
|
|
92
|
+
/** @default 2 */
|
|
93
|
+
numberOfLines?: number;
|
|
94
|
+
onFocus?: (event: FocusEvent) => void;
|
|
95
|
+
onBlur?: (event: FocusEvent) => void;
|
|
96
|
+
onChange?: (text: string) => void;
|
|
97
|
+
onPress?: (event: NativeSyntheticEvent<NativeTouchEvent>) => void;
|
|
98
|
+
onPressPrefix?: (event: NativeSyntheticEvent<NativeTouchEvent>) => void;
|
|
99
|
+
onPressSuffix?: (event: NativeSyntheticEvent<NativeTouchEvent>) => void;
|
|
100
|
+
onPressEnter?: (event: TextInputSubmitEditingEvent) => void;
|
|
101
|
+
} & Pick<ComponentPaddingProps, "paddingHorizontal" | "paddingVertical">;
|
|
102
|
+
type InputFieldRef = TextInput;
|
|
103
|
+
type InputFieldComponentType = {
|
|
104
|
+
(props: ComponentPropWithRef<TextInput, InputFieldProps>): React.ReactElement;
|
|
105
|
+
email: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
|
|
106
|
+
password: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
|
|
107
|
+
code: (props: ComponentPropWithRef<TextInput, InputFieldProps & {
|
|
108
|
+
/** @default false */
|
|
109
|
+
isSmall?: boolean;
|
|
110
|
+
}>) => React.ReactElement;
|
|
111
|
+
};
|
|
112
|
+
declare const InputFieldComponent: InputFieldComponentType;
|
|
113
|
+
declare const InputField: typeof InputFieldComponent & {
|
|
114
|
+
email: typeof InputFieldComponent.email;
|
|
115
|
+
password: typeof InputFieldComponent.password;
|
|
116
|
+
code: typeof InputFieldComponent.code;
|
|
117
|
+
};
|
|
118
|
+
|
|
49
119
|
declare function useDevice(): {
|
|
50
120
|
safeArea: {
|
|
51
121
|
/** @description The safe area insets after calculations. Recommended to use this instead of the raw insets. */
|
|
@@ -72,6 +142,35 @@ declare function useKeyboard(): {
|
|
|
72
142
|
willOpen: boolean;
|
|
73
143
|
height: number;
|
|
74
144
|
};
|
|
145
|
+
type FormFieldValue = string | number | boolean;
|
|
146
|
+
declare function useForm<FormFields extends Record<string | number, FormFieldValue | FormFieldValue[] | undefined>>(options: {
|
|
147
|
+
defaultValues: FormFields;
|
|
148
|
+
requiredFields?: (keyof FormFields)[];
|
|
149
|
+
additional?: {
|
|
150
|
+
/** @default "done" */
|
|
151
|
+
lastInputFieldReturnKeyLabel?: React.ComponentProps<typeof TextInput>["enterKeyHint"];
|
|
152
|
+
};
|
|
153
|
+
onSubmit?: (values: FormFields) => void | Promise<void>;
|
|
154
|
+
validate?: (values: FormFields) => PartialRecord<keyof FormFields, string>;
|
|
155
|
+
}): {
|
|
156
|
+
values: FormFields;
|
|
157
|
+
errors: Partial<Record<keyof FormFields, string>>;
|
|
158
|
+
isSubmitting: boolean;
|
|
159
|
+
setFieldValue: <FieldName extends keyof FormFields>(field: FieldName, value: FormFields[FieldName] | undefined) => void;
|
|
160
|
+
setFieldsValue: (values: Partial<FormFields>) => void;
|
|
161
|
+
getInputFieldProps: <FieldName extends keyof FormFields>(field: FieldName) => ComponentPropWithRef<InputFieldRef, InputFieldProps>;
|
|
162
|
+
focusField: (field: keyof FormFields) => void;
|
|
163
|
+
inputFieldRefs: Record<keyof FormFields, TextInput | undefined>;
|
|
164
|
+
validate: () => {};
|
|
165
|
+
onSubmit: (event?: React.FormEvent<HTMLFormElement>) => Promise<void>;
|
|
166
|
+
reset: () => void;
|
|
167
|
+
requiredFields: (keyof FormFields)[] | undefined;
|
|
168
|
+
isDirty: boolean;
|
|
169
|
+
isValid: boolean;
|
|
170
|
+
canSubmit: boolean;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
declare const getFormErrorObject: <FormFields extends ReturnType<typeof useForm>["values"]>(formValues: FormFields) => PartialRecord<keyof FormFields, string>;
|
|
75
174
|
|
|
76
175
|
declare function generateAsyncStorage<AsyncStorage extends object>(): {
|
|
77
176
|
setItem: <StorageName extends keyof AsyncStorage>(name: StorageName, value: AsyncStorage[StorageName]) => void;
|
|
@@ -314,61 +413,6 @@ declare const Image: typeof ImageComponent & {
|
|
|
314
413
|
profileImage: typeof ImageComponent.profileImage;
|
|
315
414
|
};
|
|
316
415
|
|
|
317
|
-
type InputFieldProps = {
|
|
318
|
-
placeholder?: string;
|
|
319
|
-
prefix?: string | React.ReactNode;
|
|
320
|
-
suffix?: string | React.ReactNode;
|
|
321
|
-
defaultValue?: string;
|
|
322
|
-
value?: string | number;
|
|
323
|
-
/** @default true */
|
|
324
|
-
editable?: boolean;
|
|
325
|
-
label?: string;
|
|
326
|
-
isError?: boolean;
|
|
327
|
-
infoMessage?: string;
|
|
328
|
-
errorMessage?: string;
|
|
329
|
-
/** @default false */
|
|
330
|
-
autoFocus?: boolean;
|
|
331
|
-
autoCapitalize?: React.ComponentProps<typeof TextInput>["autoCapitalize"];
|
|
332
|
-
autoComplete?: React.ComponentProps<typeof TextInput>["autoComplete"];
|
|
333
|
-
autoCorrect?: React.ComponentProps<typeof TextInput>["autoCorrect"];
|
|
334
|
-
/** @default "default" */
|
|
335
|
-
keyboardAppearance?: React.ComponentProps<typeof TextInput>["keyboardAppearance"];
|
|
336
|
-
keyboardType?: React.ComponentProps<typeof TextInput>["keyboardType"];
|
|
337
|
-
/** @default false */
|
|
338
|
-
secureTextEntry?: boolean;
|
|
339
|
-
returnKeyLabel?: React.ComponentProps<typeof TextInput>["enterKeyHint"];
|
|
340
|
-
returnKeyType?: React.ComponentProps<typeof TextInput>["returnKeyType"];
|
|
341
|
-
height?: number;
|
|
342
|
-
/** @default 16 */
|
|
343
|
-
fontSize?: number;
|
|
344
|
-
/** @default 400 */
|
|
345
|
-
fontWeight?: TextStyle["fontWeight"];
|
|
346
|
-
/** @default 20 */
|
|
347
|
-
lineHeight?: number;
|
|
348
|
-
textAlign?: React.ComponentProps<typeof TextInput>["textAlign"];
|
|
349
|
-
onFocus?: (event: FocusEvent) => void;
|
|
350
|
-
onBlur?: (event: FocusEvent) => void;
|
|
351
|
-
onChange?: (text: string) => void;
|
|
352
|
-
onPress?: (event: NativeSyntheticEvent<NativeTouchEvent>) => void;
|
|
353
|
-
onPressEnter?: (event: TextInputSubmitEditingEvent) => void;
|
|
354
|
-
} & Pick<ComponentPaddingProps, "paddingHorizontal" | "paddingVertical">;
|
|
355
|
-
type InputFieldRef = TextInput;
|
|
356
|
-
type InputFieldComponentType = {
|
|
357
|
-
(props: ComponentPropWithRef<TextInput, InputFieldProps>): React.ReactElement;
|
|
358
|
-
email: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
|
|
359
|
-
password: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
|
|
360
|
-
code: (props: ComponentPropWithRef<TextInput, InputFieldProps & {
|
|
361
|
-
/** @default false */
|
|
362
|
-
isSmall?: boolean;
|
|
363
|
-
}>) => React.ReactElement;
|
|
364
|
-
};
|
|
365
|
-
declare const InputFieldComponent: InputFieldComponentType;
|
|
366
|
-
declare const InputField: typeof InputFieldComponent & {
|
|
367
|
-
email: typeof InputFieldComponent.email;
|
|
368
|
-
password: typeof InputFieldComponent.password;
|
|
369
|
-
code: typeof InputFieldComponent.code;
|
|
370
|
-
};
|
|
371
|
-
|
|
372
416
|
type StatusBarProps = {
|
|
373
417
|
darkStatusBar?: boolean;
|
|
374
418
|
/** @default false */
|
|
@@ -384,4 +428,4 @@ type AsyncStoragePluginOptions = {};
|
|
|
384
428
|
declare const defaultAsyncStoragePluginOptions: Required<AsyncStoragePluginOptions>;
|
|
385
429
|
declare const asyncStoragePlugin: BetterComponentsPluginConstructor<AsyncStoragePluginOptions>;
|
|
386
430
|
|
|
387
|
-
export { Animate, type AnimateTextProps, type AnimateViewProps, type AppConfig, type AsyncStoragePluginOptions, type BetterComponentsConfig, type BetterComponentsPlugin, _default$1 as BetterComponentsProvider, type BetterComponentsProviderConfig, Button, type ButtonProps, type ComponentMarginProps, type ComponentPaddingProps, type FooterProps, Image, type ImageProps, InputField, type InputFieldProps, type InputFieldRef, Loader, type LoaderProps, type LoaderSize, type PluginName, ScreenHolder, type ScreenHolderProps, _default as StatusBar, type StatusBarProps, Text, type TextProps, View, type ViewProps, asyncStoragePlugin, defaultAsyncStoragePluginOptions, generateAsyncStorage, pressStrength, useBetterComponentsContext, useDevice, useKeyboard };
|
|
431
|
+
export { Animate, type AnimateTextProps, type AnimateViewProps, type AppConfig, type AsyncStoragePluginOptions, type BetterComponentsConfig, type BetterComponentsPlugin, _default$1 as BetterComponentsProvider, type BetterComponentsProviderConfig, Button, type ButtonProps, type ComponentMarginProps, type ComponentPaddingProps, type FooterProps, Image, type ImageProps, InputField, type InputFieldProps, type InputFieldRef, Loader, type LoaderProps, type LoaderSize, type PluginName, ScreenHolder, type ScreenHolderProps, _default as StatusBar, type StatusBarProps, Text, type TextProps, View, type ViewProps, asyncStoragePlugin, defaultAsyncStoragePluginOptions, generateAsyncStorage, getFormErrorObject, pressStrength, useBetterComponentsContext, useDevice, useForm, useKeyboard };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BetterCoreProviderConfig, DeepPartialRecord, BetterCoreConfig, OmitProps, IconName, AnyOtherString, AssetName, LoaderName } from 'react-better-core';
|
|
1
|
+
import { BetterCoreProviderConfig, DeepPartialRecord, BetterCoreConfig, OmitProps, PartialRecord, IconName, AnyOtherString, AssetName, LoaderName } from 'react-better-core';
|
|
2
2
|
export { AnyOtherString, AssetName, AssetsConfig, Color, ColorName, ColorTheme, Colors, Country, DeepPartialRecord, ExcludeOptions, IconName, IconsConfig, LoaderConfig, LoaderName, OmitProps, PartialRecord, PickAllRequired, PickValue, Styles, Theme, ThemeConfig, colorThemeControls, countries, darkenColor, desaturateColor, eventPreventDefault, eventPreventStop, eventStopPropagation, formatPhoneNumber, generateRandomString, getPluralWord, lightenColor, loaderControls, saturateColor, useBooleanState, useDebounceState, useLoader, useLoaderControls, useTheme } from 'react-better-core';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import * as react_native from 'react-native';
|
|
6
|
-
import { ViewStyle, GestureResponderEvent, ViewProps as ViewProps$1, TextProps as TextProps$1,
|
|
6
|
+
import { ViewStyle, TextInput, TextStyle, FocusEvent, NativeSyntheticEvent, NativeTouchEvent, TextInputSubmitEditingEvent, GestureResponderEvent, ViewProps as ViewProps$1, TextProps as TextProps$1, ColorValue, ImageSourcePropType, ImageProps as ImageProps$1, ImageStyle, StatusBar as StatusBar$1 } from 'react-native';
|
|
7
7
|
import { EaseFunction, PropsTransforms } from '@legendapp/motion';
|
|
8
8
|
|
|
9
9
|
type AppConfig = {};
|
|
@@ -46,6 +46,76 @@ type ComponentPropWithRef<ComponentRef, ComponentProps> = ComponentProps & {
|
|
|
46
46
|
|
|
47
47
|
declare const pressStrength: () => Record<"z05" | "z1" | "z2" | "z3", number>;
|
|
48
48
|
|
|
49
|
+
type InputFieldProps = {
|
|
50
|
+
placeholder?: string;
|
|
51
|
+
/** @default "text" */
|
|
52
|
+
type?: "text" | "date" | "time";
|
|
53
|
+
/** @default false */
|
|
54
|
+
iOSDateTimeFullSize?: boolean;
|
|
55
|
+
prefix?: string | React.ReactNode;
|
|
56
|
+
suffix?: string | React.ReactNode;
|
|
57
|
+
defaultValue?: string;
|
|
58
|
+
value?: string | number;
|
|
59
|
+
/** @default true */
|
|
60
|
+
editable?: boolean;
|
|
61
|
+
label?: string;
|
|
62
|
+
isError?: boolean;
|
|
63
|
+
infoMessage?: string;
|
|
64
|
+
errorMessage?: string;
|
|
65
|
+
/** @default false */
|
|
66
|
+
autoFocus?: boolean;
|
|
67
|
+
autoCapitalize?: React.ComponentProps<typeof TextInput>["autoCapitalize"];
|
|
68
|
+
autoComplete?: React.ComponentProps<typeof TextInput>["autoComplete"];
|
|
69
|
+
autoCorrect?: React.ComponentProps<typeof TextInput>["autoCorrect"];
|
|
70
|
+
/** @default "default" */
|
|
71
|
+
keyboardAppearance?: React.ComponentProps<typeof TextInput>["keyboardAppearance"];
|
|
72
|
+
keyboardType?: React.ComponentProps<typeof TextInput>["keyboardType"];
|
|
73
|
+
/** @default false */
|
|
74
|
+
secureTextEntry?: boolean;
|
|
75
|
+
returnKeyLabel?: React.ComponentProps<typeof TextInput>["enterKeyHint"];
|
|
76
|
+
returnKeyType?: React.ComponentProps<typeof TextInput>["returnKeyType"];
|
|
77
|
+
height?: number;
|
|
78
|
+
/** @default 16 */
|
|
79
|
+
fontSize?: number;
|
|
80
|
+
/** @default 400 */
|
|
81
|
+
fontWeight?: TextStyle["fontWeight"];
|
|
82
|
+
/** @default 20 */
|
|
83
|
+
lineHeight?: number;
|
|
84
|
+
textAlign?: React.ComponentProps<typeof TextInput>["textAlign"];
|
|
85
|
+
/** @default false */
|
|
86
|
+
required?: boolean;
|
|
87
|
+
/** @default false */
|
|
88
|
+
disabled?: boolean;
|
|
89
|
+
maxLength?: number;
|
|
90
|
+
/** @default false */
|
|
91
|
+
multiline?: boolean;
|
|
92
|
+
/** @default 2 */
|
|
93
|
+
numberOfLines?: number;
|
|
94
|
+
onFocus?: (event: FocusEvent) => void;
|
|
95
|
+
onBlur?: (event: FocusEvent) => void;
|
|
96
|
+
onChange?: (text: string) => void;
|
|
97
|
+
onPress?: (event: NativeSyntheticEvent<NativeTouchEvent>) => void;
|
|
98
|
+
onPressPrefix?: (event: NativeSyntheticEvent<NativeTouchEvent>) => void;
|
|
99
|
+
onPressSuffix?: (event: NativeSyntheticEvent<NativeTouchEvent>) => void;
|
|
100
|
+
onPressEnter?: (event: TextInputSubmitEditingEvent) => void;
|
|
101
|
+
} & Pick<ComponentPaddingProps, "paddingHorizontal" | "paddingVertical">;
|
|
102
|
+
type InputFieldRef = TextInput;
|
|
103
|
+
type InputFieldComponentType = {
|
|
104
|
+
(props: ComponentPropWithRef<TextInput, InputFieldProps>): React.ReactElement;
|
|
105
|
+
email: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
|
|
106
|
+
password: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
|
|
107
|
+
code: (props: ComponentPropWithRef<TextInput, InputFieldProps & {
|
|
108
|
+
/** @default false */
|
|
109
|
+
isSmall?: boolean;
|
|
110
|
+
}>) => React.ReactElement;
|
|
111
|
+
};
|
|
112
|
+
declare const InputFieldComponent: InputFieldComponentType;
|
|
113
|
+
declare const InputField: typeof InputFieldComponent & {
|
|
114
|
+
email: typeof InputFieldComponent.email;
|
|
115
|
+
password: typeof InputFieldComponent.password;
|
|
116
|
+
code: typeof InputFieldComponent.code;
|
|
117
|
+
};
|
|
118
|
+
|
|
49
119
|
declare function useDevice(): {
|
|
50
120
|
safeArea: {
|
|
51
121
|
/** @description The safe area insets after calculations. Recommended to use this instead of the raw insets. */
|
|
@@ -72,6 +142,35 @@ declare function useKeyboard(): {
|
|
|
72
142
|
willOpen: boolean;
|
|
73
143
|
height: number;
|
|
74
144
|
};
|
|
145
|
+
type FormFieldValue = string | number | boolean;
|
|
146
|
+
declare function useForm<FormFields extends Record<string | number, FormFieldValue | FormFieldValue[] | undefined>>(options: {
|
|
147
|
+
defaultValues: FormFields;
|
|
148
|
+
requiredFields?: (keyof FormFields)[];
|
|
149
|
+
additional?: {
|
|
150
|
+
/** @default "done" */
|
|
151
|
+
lastInputFieldReturnKeyLabel?: React.ComponentProps<typeof TextInput>["enterKeyHint"];
|
|
152
|
+
};
|
|
153
|
+
onSubmit?: (values: FormFields) => void | Promise<void>;
|
|
154
|
+
validate?: (values: FormFields) => PartialRecord<keyof FormFields, string>;
|
|
155
|
+
}): {
|
|
156
|
+
values: FormFields;
|
|
157
|
+
errors: Partial<Record<keyof FormFields, string>>;
|
|
158
|
+
isSubmitting: boolean;
|
|
159
|
+
setFieldValue: <FieldName extends keyof FormFields>(field: FieldName, value: FormFields[FieldName] | undefined) => void;
|
|
160
|
+
setFieldsValue: (values: Partial<FormFields>) => void;
|
|
161
|
+
getInputFieldProps: <FieldName extends keyof FormFields>(field: FieldName) => ComponentPropWithRef<InputFieldRef, InputFieldProps>;
|
|
162
|
+
focusField: (field: keyof FormFields) => void;
|
|
163
|
+
inputFieldRefs: Record<keyof FormFields, TextInput | undefined>;
|
|
164
|
+
validate: () => {};
|
|
165
|
+
onSubmit: (event?: React.FormEvent<HTMLFormElement>) => Promise<void>;
|
|
166
|
+
reset: () => void;
|
|
167
|
+
requiredFields: (keyof FormFields)[] | undefined;
|
|
168
|
+
isDirty: boolean;
|
|
169
|
+
isValid: boolean;
|
|
170
|
+
canSubmit: boolean;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
declare const getFormErrorObject: <FormFields extends ReturnType<typeof useForm>["values"]>(formValues: FormFields) => PartialRecord<keyof FormFields, string>;
|
|
75
174
|
|
|
76
175
|
declare function generateAsyncStorage<AsyncStorage extends object>(): {
|
|
77
176
|
setItem: <StorageName extends keyof AsyncStorage>(name: StorageName, value: AsyncStorage[StorageName]) => void;
|
|
@@ -314,61 +413,6 @@ declare const Image: typeof ImageComponent & {
|
|
|
314
413
|
profileImage: typeof ImageComponent.profileImage;
|
|
315
414
|
};
|
|
316
415
|
|
|
317
|
-
type InputFieldProps = {
|
|
318
|
-
placeholder?: string;
|
|
319
|
-
prefix?: string | React.ReactNode;
|
|
320
|
-
suffix?: string | React.ReactNode;
|
|
321
|
-
defaultValue?: string;
|
|
322
|
-
value?: string | number;
|
|
323
|
-
/** @default true */
|
|
324
|
-
editable?: boolean;
|
|
325
|
-
label?: string;
|
|
326
|
-
isError?: boolean;
|
|
327
|
-
infoMessage?: string;
|
|
328
|
-
errorMessage?: string;
|
|
329
|
-
/** @default false */
|
|
330
|
-
autoFocus?: boolean;
|
|
331
|
-
autoCapitalize?: React.ComponentProps<typeof TextInput>["autoCapitalize"];
|
|
332
|
-
autoComplete?: React.ComponentProps<typeof TextInput>["autoComplete"];
|
|
333
|
-
autoCorrect?: React.ComponentProps<typeof TextInput>["autoCorrect"];
|
|
334
|
-
/** @default "default" */
|
|
335
|
-
keyboardAppearance?: React.ComponentProps<typeof TextInput>["keyboardAppearance"];
|
|
336
|
-
keyboardType?: React.ComponentProps<typeof TextInput>["keyboardType"];
|
|
337
|
-
/** @default false */
|
|
338
|
-
secureTextEntry?: boolean;
|
|
339
|
-
returnKeyLabel?: React.ComponentProps<typeof TextInput>["enterKeyHint"];
|
|
340
|
-
returnKeyType?: React.ComponentProps<typeof TextInput>["returnKeyType"];
|
|
341
|
-
height?: number;
|
|
342
|
-
/** @default 16 */
|
|
343
|
-
fontSize?: number;
|
|
344
|
-
/** @default 400 */
|
|
345
|
-
fontWeight?: TextStyle["fontWeight"];
|
|
346
|
-
/** @default 20 */
|
|
347
|
-
lineHeight?: number;
|
|
348
|
-
textAlign?: React.ComponentProps<typeof TextInput>["textAlign"];
|
|
349
|
-
onFocus?: (event: FocusEvent) => void;
|
|
350
|
-
onBlur?: (event: FocusEvent) => void;
|
|
351
|
-
onChange?: (text: string) => void;
|
|
352
|
-
onPress?: (event: NativeSyntheticEvent<NativeTouchEvent>) => void;
|
|
353
|
-
onPressEnter?: (event: TextInputSubmitEditingEvent) => void;
|
|
354
|
-
} & Pick<ComponentPaddingProps, "paddingHorizontal" | "paddingVertical">;
|
|
355
|
-
type InputFieldRef = TextInput;
|
|
356
|
-
type InputFieldComponentType = {
|
|
357
|
-
(props: ComponentPropWithRef<TextInput, InputFieldProps>): React.ReactElement;
|
|
358
|
-
email: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
|
|
359
|
-
password: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
|
|
360
|
-
code: (props: ComponentPropWithRef<TextInput, InputFieldProps & {
|
|
361
|
-
/** @default false */
|
|
362
|
-
isSmall?: boolean;
|
|
363
|
-
}>) => React.ReactElement;
|
|
364
|
-
};
|
|
365
|
-
declare const InputFieldComponent: InputFieldComponentType;
|
|
366
|
-
declare const InputField: typeof InputFieldComponent & {
|
|
367
|
-
email: typeof InputFieldComponent.email;
|
|
368
|
-
password: typeof InputFieldComponent.password;
|
|
369
|
-
code: typeof InputFieldComponent.code;
|
|
370
|
-
};
|
|
371
|
-
|
|
372
416
|
type StatusBarProps = {
|
|
373
417
|
darkStatusBar?: boolean;
|
|
374
418
|
/** @default false */
|
|
@@ -384,4 +428,4 @@ type AsyncStoragePluginOptions = {};
|
|
|
384
428
|
declare const defaultAsyncStoragePluginOptions: Required<AsyncStoragePluginOptions>;
|
|
385
429
|
declare const asyncStoragePlugin: BetterComponentsPluginConstructor<AsyncStoragePluginOptions>;
|
|
386
430
|
|
|
387
|
-
export { Animate, type AnimateTextProps, type AnimateViewProps, type AppConfig, type AsyncStoragePluginOptions, type BetterComponentsConfig, type BetterComponentsPlugin, _default$1 as BetterComponentsProvider, type BetterComponentsProviderConfig, Button, type ButtonProps, type ComponentMarginProps, type ComponentPaddingProps, type FooterProps, Image, type ImageProps, InputField, type InputFieldProps, type InputFieldRef, Loader, type LoaderProps, type LoaderSize, type PluginName, ScreenHolder, type ScreenHolderProps, _default as StatusBar, type StatusBarProps, Text, type TextProps, View, type ViewProps, asyncStoragePlugin, defaultAsyncStoragePluginOptions, generateAsyncStorage, pressStrength, useBetterComponentsContext, useDevice, useKeyboard };
|
|
431
|
+
export { Animate, type AnimateTextProps, type AnimateViewProps, type AppConfig, type AsyncStoragePluginOptions, type BetterComponentsConfig, type BetterComponentsPlugin, _default$1 as BetterComponentsProvider, type BetterComponentsProviderConfig, Button, type ButtonProps, type ComponentMarginProps, type ComponentPaddingProps, type FooterProps, Image, type ImageProps, InputField, type InputFieldProps, type InputFieldRef, Loader, type LoaderProps, type LoaderSize, type PluginName, ScreenHolder, type ScreenHolderProps, _default as StatusBar, type StatusBarProps, Text, type TextProps, View, type ViewProps, asyncStoragePlugin, defaultAsyncStoragePluginOptions, generateAsyncStorage, getFormErrorObject, pressStrength, useBetterComponentsContext, useDevice, useForm, useKeyboard };
|