@pdg/react-form 1.0.57 → 1.0.58
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/@private/PrivateDatePicker/PrivateDatePicker.types.d.ts +3 -6
- package/dist/@private/PrivateDateTimePicker/PrivateDateTimePicker.types.d.ts +3 -6
- package/dist/@types/types.d.ts +18 -18
- package/dist/Form/Form.types.d.ts +8 -8
- package/dist/FormContext/FormContext.d.ts +1 -1
- package/dist/FormContext/FormContext.types.d.ts +6 -6
- package/dist/FormContext/useFormState.d.ts +1 -1
- package/dist/FormItemCustom/FormAutocomplete/FormAutocomplete.d.ts +6 -2
- package/dist/FormItemCustom/FormAutocomplete/FormAutocomplete.types.d.ts +18 -18
- package/dist/FormItemCustom/FormCheckbox/FormCheckbox.types.d.ts +8 -7
- package/dist/FormItemCustom/FormDateRangePicker/FormDateRangePicker.types.d.ts +3 -3
- package/dist/FormItemCustom/FormDateRangePicker/InputDatePicker/InputDatePicker.types.d.ts +1 -1
- package/dist/FormItemCustom/FormFile/FormFile.types.d.ts +4 -3
- package/dist/FormItemCustom/FormRadioGroup/FormRadioGroup.d.ts +5 -2
- package/dist/FormItemCustom/FormRadioGroup/FormRadioGroup.types.d.ts +11 -11
- package/dist/FormItemCustom/FormRating/FormRating.types.d.ts +3 -5
- package/dist/FormItemCustom/FormTextEditor/FormTextEditor.types.d.ts +4 -3
- package/dist/FormItemCustom/FormToggleButtonGroup/FormToggleButtonGroup.d.ts +6 -2
- package/dist/FormItemCustom/FormToggleButtonGroup/FormToggleButtonGroup.types.d.ts +13 -13
- package/dist/FormItemTextFieldBase/FormCompanyNo/FormCompanyNo.d.ts +2 -4
- package/dist/FormItemTextFieldBase/FormCompanyNo/FormCompanyNo.types.d.ts +5 -5
- package/dist/FormItemTextFieldBase/FormEmail/FormEmail.d.ts +1 -2
- package/dist/FormItemTextFieldBase/FormEmail/FormEmail.types.d.ts +3 -1
- package/dist/FormItemTextFieldBase/FormHidden/FormHidden.types.d.ts +4 -5
- package/dist/FormItemTextFieldBase/FormMobile/FormMobile.d.ts +1 -4
- package/dist/FormItemTextFieldBase/FormMobile/FormMobile.types.d.ts +3 -1
- package/dist/FormItemTextFieldBase/FormNumber/FormNumber.d.ts +3 -3
- package/dist/FormItemTextFieldBase/FormNumber/FormNumber.types.d.ts +5 -6
- package/dist/FormItemTextFieldBase/FormNumber/NumberFormatCustom.d.ts +1 -2
- package/dist/FormItemTextFieldBase/FormPassword/FormPassword.d.ts +1 -2
- package/dist/FormItemTextFieldBase/FormPassword/FormPassword.types.d.ts +5 -3
- package/dist/FormItemTextFieldBase/FormPersonalNo/FormPersonalNo.d.ts +2 -3
- package/dist/FormItemTextFieldBase/FormPersonalNo/FormPersonalNo.types.d.ts +4 -2
- package/dist/FormItemTextFieldBase/FormSearch/FormSearch.d.ts +1 -2
- package/dist/FormItemTextFieldBase/FormSearch/FormSearch.types.d.ts +4 -2
- package/dist/FormItemTextFieldBase/FormSelect/FormSelect.d.ts +6 -13
- package/dist/FormItemTextFieldBase/FormSelect/FormSelect.types.d.ts +14 -15
- package/dist/FormItemTextFieldBase/FormTag/FormTag.d.ts +2 -3
- package/dist/FormItemTextFieldBase/FormTag/FormTag.types.d.ts +6 -8
- package/dist/FormItemTextFieldBase/FormTel/FormTel.d.ts +2 -4
- package/dist/FormItemTextFieldBase/FormTel/FormTel.types.d.ts +5 -5
- package/dist/FormItemTextFieldBase/FormText/FormText.d.ts +2 -3
- package/dist/FormItemTextFieldBase/FormText/FormText.types.d.ts +4 -2
- package/dist/FormItemTextFieldBase/FormTextField/FormTextField.d.ts +5 -15
- package/dist/FormItemTextFieldBase/FormTextField/FormTextField.types.d.ts +5 -4
- package/dist/FormItemTextFieldBase/FormTextarea/FormTextarea.d.ts +2 -3
- package/dist/FormItemTextFieldBase/FormTextarea/FormTextarea.types.d.ts +4 -2
- package/dist/FormItemTextFieldBase/FormUrl/FormUrl.d.ts +1 -2
- package/dist/FormItemTextFieldBase/FormUrl/FormUrl.types.d.ts +3 -1
- package/dist/index.esm.js +68 -79
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +68 -79
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,10 +3,9 @@ import { DesktopDatePickerProps } from '@mui/x-date-pickers';
|
|
|
3
3
|
import { CommonSxProps, FormDateType, FormDateValueItemCommands, FormTimeType, FormValueItemBaseCommands, FormValueItemProps } from '../../@types';
|
|
4
4
|
import { Dayjs } from 'dayjs';
|
|
5
5
|
export type PrivateDatePickerValue = Dayjs | null;
|
|
6
|
-
export interface PrivateDatePickerProps extends CommonSxProps, Partial<Omit<DesktopDatePickerProps<Dayjs>, 'children' | 'className' | 'style' | 'sx' | 'value' | 'inputFormat' | 'views' | 'onChange'>>,
|
|
6
|
+
export interface PrivateDatePickerProps extends CommonSxProps, Partial<Omit<DesktopDatePickerProps<Dayjs>, 'children' | 'className' | 'style' | 'sx' | 'value' | 'inputFormat' | 'views' | 'onChange'>>, FormValueItemProps<PrivateDatePickerValue, false> {
|
|
7
7
|
type: FormDateType;
|
|
8
8
|
time?: FormTimeType;
|
|
9
|
-
value?: PrivateDatePickerValue;
|
|
10
9
|
hours?: number[];
|
|
11
10
|
minutes?: number[];
|
|
12
11
|
seconds?: number[];
|
|
@@ -22,9 +21,7 @@ export interface PrivateDatePickerProps extends CommonSxProps, Partial<Omit<Desk
|
|
|
22
21
|
align?: 'left' | 'center' | 'right';
|
|
23
22
|
readOnlyInput?: boolean;
|
|
24
23
|
hidden?: boolean;
|
|
25
|
-
onChange?(value: PrivateDatePickerValue): void;
|
|
26
|
-
onValidate?(value: PrivateDatePickerValue): boolean | string;
|
|
27
24
|
}
|
|
28
|
-
export declare const PrivateDatePickerDefaultProps: Pick<PrivateDatePickerProps, 'showDaysOutsideCurrentMonth' | 'align'>;
|
|
29
|
-
export interface PrivateDatePickerCommands extends FormValueItemBaseCommands<PrivateDatePickerValue>, FormDateValueItemCommands {
|
|
25
|
+
export declare const PrivateDatePickerDefaultProps: Pick<PrivateDatePickerProps, 'showDaysOutsideCurrentMonth' | 'align' | 'value'>;
|
|
26
|
+
export interface PrivateDatePickerCommands extends FormValueItemBaseCommands<PrivateDatePickerValue, false>, FormDateValueItemCommands {
|
|
30
27
|
}
|
|
@@ -3,10 +3,9 @@ import { DesktopDateTimePickerProps } from '@mui/x-date-pickers';
|
|
|
3
3
|
import { CommonSxProps, FormDateType, FormDateValueItemCommands, FormTimeType, FormValueItemBaseCommands, FormValueItemProps } from '../../@types';
|
|
4
4
|
import { Dayjs } from 'dayjs';
|
|
5
5
|
export type PrivateDateTimePickerValue = Dayjs | null;
|
|
6
|
-
export interface PrivateDateTimePickerProps extends CommonSxProps, Partial<Omit<DesktopDateTimePickerProps<Dayjs>, 'children' | 'className' | 'style' | 'sx' | 'value' | 'inputFormat' | 'views' | 'onChange' | 'openTo' | 'view' | 'viewRenderers' | 'components' | 'componentsProps' | 'slots' | 'slotProps'>>,
|
|
6
|
+
export interface PrivateDateTimePickerProps extends CommonSxProps, Partial<Omit<DesktopDateTimePickerProps<Dayjs>, 'children' | 'className' | 'style' | 'sx' | 'value' | 'inputFormat' | 'views' | 'onChange' | 'openTo' | 'view' | 'viewRenderers' | 'components' | 'componentsProps' | 'slots' | 'slotProps'>>, FormValueItemProps<PrivateDateTimePickerValue, false> {
|
|
7
7
|
type: FormDateType;
|
|
8
8
|
time?: FormTimeType;
|
|
9
|
-
value?: PrivateDateTimePickerValue;
|
|
10
9
|
hours?: number[];
|
|
11
10
|
minutes?: number[];
|
|
12
11
|
seconds?: number[];
|
|
@@ -22,9 +21,7 @@ export interface PrivateDateTimePickerProps extends CommonSxProps, Partial<Omit<
|
|
|
22
21
|
align?: 'left' | 'center' | 'right';
|
|
23
22
|
readOnlyInput?: boolean;
|
|
24
23
|
hidden?: boolean;
|
|
25
|
-
onChange?(value: PrivateDateTimePickerValue): void;
|
|
26
|
-
onValidate?(value: PrivateDateTimePickerValue): boolean | string;
|
|
27
24
|
}
|
|
28
|
-
export declare const PrivateDateTimePickerDefaultProps: Pick<PrivateDateTimePickerProps, 'showDaysOutsideCurrentMonth' | 'align'>;
|
|
29
|
-
export interface PrivateDateTimePickerCommands extends FormValueItemBaseCommands<PrivateDateTimePickerValue>, FormDateValueItemCommands {
|
|
25
|
+
export declare const PrivateDateTimePickerDefaultProps: Pick<PrivateDateTimePickerProps, 'showDaysOutsideCurrentMonth' | 'align' | 'value'>;
|
|
26
|
+
export interface PrivateDateTimePickerCommands extends FormValueItemBaseCommands<PrivateDateTimePickerValue, false>, FormDateValueItemCommands {
|
|
30
27
|
}
|
package/dist/@types/types.d.ts
CHANGED
|
@@ -13,19 +13,19 @@ export interface CommonProps {
|
|
|
13
13
|
export interface CommonSxProps extends CommonProps {
|
|
14
14
|
sx?: SxProps<Theme>;
|
|
15
15
|
}
|
|
16
|
-
export type FormItemValue = any;
|
|
17
16
|
export type FormValue = string | number | boolean;
|
|
18
17
|
export interface FormValueMap {
|
|
19
18
|
[key: string]: FormValue;
|
|
20
19
|
}
|
|
20
|
+
export type FormValueType = 'single' | 'multiple' | 'any';
|
|
21
21
|
export type FormValueItemData = Record<string, any>;
|
|
22
|
-
export interface FormValueItemBaseCommands<
|
|
22
|
+
export interface FormValueItemBaseCommands<T, AllowUndefinedValue extends boolean, V = AllowUndefinedValue extends true ? T | undefined : T> {
|
|
23
23
|
getType(): 'default' | 'FormCheckbox' | 'FormToggleButtonGroup' | 'FormRadioGroup' | 'FormRating' | 'FormTextEditor' | 'FormAutocomplete' | 'FormDatePicker' | 'FormDateTimePicker' | 'FormTimePicker' | 'FormDateRangePicker' | 'FormFile';
|
|
24
24
|
getName(): string;
|
|
25
|
-
getReset():
|
|
25
|
+
getReset(): V;
|
|
26
26
|
reset(): void;
|
|
27
|
-
getValue():
|
|
28
|
-
setValue(value:
|
|
27
|
+
getValue(): V;
|
|
28
|
+
setValue(value: V): void;
|
|
29
29
|
getData(): FormValueItemData | undefined;
|
|
30
30
|
setData(data?: FormValueItemData): void;
|
|
31
31
|
isExceptValue(): boolean;
|
|
@@ -40,15 +40,15 @@ export interface FormArrayValueItemCommands {
|
|
|
40
40
|
isFormValueSort(): boolean;
|
|
41
41
|
getFormValueSeparator(): string | undefined;
|
|
42
42
|
}
|
|
43
|
-
export interface FormItemsValueItemCommands<
|
|
44
|
-
getItems():
|
|
45
|
-
setItems(items:
|
|
43
|
+
export interface FormItemsValueItemCommands<T> {
|
|
44
|
+
getItems(): T[] | undefined;
|
|
45
|
+
setItems(items: T[] | undefined): void;
|
|
46
46
|
}
|
|
47
|
-
export interface FormCheckValueItemCommands {
|
|
47
|
+
export interface FormCheckValueItemCommands<T> {
|
|
48
48
|
getChecked(): boolean;
|
|
49
49
|
setChecked(checked: boolean): void;
|
|
50
|
-
getUncheckedValue():
|
|
51
|
-
setUncheckedValue(uncheckedValue:
|
|
50
|
+
getUncheckedValue(): T;
|
|
51
|
+
setUncheckedValue(uncheckedValue: T): void;
|
|
52
52
|
}
|
|
53
53
|
export interface FormMultipleValueItemCommands {
|
|
54
54
|
isMultiple(): boolean;
|
|
@@ -70,14 +70,14 @@ export interface FormDateRangeValueItemCommands {
|
|
|
70
70
|
getFormValueStartName(): string;
|
|
71
71
|
getFormValueEndName(): string;
|
|
72
72
|
}
|
|
73
|
-
export interface FormValueItemCommands<
|
|
73
|
+
export interface FormValueItemCommands<T, AllowUndefinedValue extends boolean = true, ItemType = any> extends FormValueItemBaseCommands<T, AllowUndefinedValue>, Partial<FormArrayValueItemCommands>, Partial<FormItemsValueItemCommands<ItemType>>, Partial<FormCheckValueItemCommands<T>>, Partial<FormMultipleValueItemCommands>, Partial<FormLoadingValueItemCommands>, Partial<FormDateValueItemCommands>, Partial<FormDateRangeValueItemCommands> {
|
|
74
74
|
}
|
|
75
|
-
export interface FormValueItemCommandsMap<
|
|
76
|
-
[key: string]: FormValueItemCommands<
|
|
75
|
+
export interface FormValueItemCommandsMap<T, AllowUndefinedValue extends boolean = true, ItemType = any> {
|
|
76
|
+
[key: string]: FormValueItemCommands<T, AllowUndefinedValue, ItemType> | undefined;
|
|
77
77
|
}
|
|
78
|
-
export interface FormValueItemProps extends PartialPick<FormContextValue
|
|
78
|
+
export interface FormValueItemProps<T, AllowUndefinedValue extends boolean = true, V = AllowUndefinedValue extends true ? T | undefined : T> extends PartialPick<FormContextValue<T>, 'variant' | 'size' | 'color' | 'focused'> {
|
|
79
79
|
name: string;
|
|
80
|
-
value?:
|
|
80
|
+
value?: T;
|
|
81
81
|
labelIcon?: string;
|
|
82
82
|
label?: ReactNode;
|
|
83
83
|
width?: string | number;
|
|
@@ -88,6 +88,6 @@ export interface FormValueItemProps extends PartialPick<FormContextValue, 'varia
|
|
|
88
88
|
exceptValue?: boolean;
|
|
89
89
|
helperText?: ReactNode;
|
|
90
90
|
data?: FormValueItemData;
|
|
91
|
-
onChange?(value:
|
|
92
|
-
onValidate?(value:
|
|
91
|
+
onChange?(value: V): void;
|
|
92
|
+
onValidate?(value: V): true | string;
|
|
93
93
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { FormControlProps, GridProps, InputLabelProps } from '@mui/material';
|
|
3
|
-
import { PartialPick, CommonSxProps,
|
|
3
|
+
import { PartialPick, CommonSxProps, FormValue, FormValueMap, FormValueItemCommands, FormValueItemBaseCommands } from '../@types';
|
|
4
4
|
export interface FormInvalidItemInfo {
|
|
5
5
|
name: string;
|
|
6
|
-
commands: FormValueItemCommands
|
|
6
|
+
commands: FormValueItemCommands<any>;
|
|
7
7
|
}
|
|
8
8
|
export type FormInvalidItems = FormInvalidItemInfo[];
|
|
9
9
|
export interface FormProps extends CommonSxProps, PartialPick<FormControlProps, 'variant' | 'size' | 'color' | 'focused'>, PartialPick<GridProps, 'spacing'> {
|
|
@@ -13,22 +13,22 @@ export interface FormProps extends CommonSxProps, PartialPick<FormControlProps,
|
|
|
13
13
|
formColGap?: number;
|
|
14
14
|
onSubmit?(data: FormValueMap): void;
|
|
15
15
|
onInvalid?(invalidItems: FormInvalidItems): void;
|
|
16
|
-
onValueChange?(name: string, value:
|
|
17
|
-
onValueChangeByUser?(name: string, value:
|
|
16
|
+
onValueChange?(name: string, value: any): void;
|
|
17
|
+
onValueChangeByUser?(name: string, value: any): void;
|
|
18
18
|
}
|
|
19
19
|
export declare const FormDefaultProps: Pick<FormProps, 'variant' | 'size' | 'color' | 'spacing' | 'formColGap' | 'fullWidth' | 'fullHeight'>;
|
|
20
20
|
export interface FormCommands {
|
|
21
21
|
submit(): void;
|
|
22
22
|
getAllFormValue(): FormValueMap;
|
|
23
23
|
resetAll(): void;
|
|
24
|
-
getItem<T extends FormValueItemBaseCommands = FormValueItemCommands
|
|
24
|
+
getItem<T extends FormValueItemBaseCommands<any, true> = FormValueItemCommands<any>>(name: string): T | undefined;
|
|
25
25
|
exists(name: string): boolean;
|
|
26
|
-
getReset(name: string):
|
|
26
|
+
getReset(name: string): any;
|
|
27
27
|
getFormReset(name: string, subKey?: string): FormValue;
|
|
28
28
|
reset(name: string): void;
|
|
29
|
-
getValue(name: string):
|
|
29
|
+
getValue(name: string): any;
|
|
30
30
|
getFormValue(name: string, subKey?: string): FormValue;
|
|
31
|
-
setValue(name: string, value:
|
|
31
|
+
setValue(name: string, value: any): void;
|
|
32
32
|
isExceptValue(name: string): boolean;
|
|
33
33
|
isDisabled(name: string): boolean;
|
|
34
34
|
setDisabled(name: string, disabled: boolean): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FormContextValue } from './FormContext.types';
|
|
3
|
-
declare const FormContext: import("react").Context<FormContextValue
|
|
3
|
+
declare const FormContext: import("react").Context<FormContextValue<any, true>>;
|
|
4
4
|
export default FormContext;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { PartialPick, FormValueItemCommands
|
|
1
|
+
import { PartialPick, FormValueItemCommands } from '../@types';
|
|
2
2
|
import { FormProps } from '../Form/Form.types';
|
|
3
|
-
export interface FormContextValue extends PartialPick<FormProps, 'variant' | 'size' | 'color' | 'spacing' | 'formColGap' | 'focused' | 'labelShrink' | 'fullWidth'> {
|
|
3
|
+
export interface FormContextValue<T = any, AllowUndefinedValue extends boolean = true> extends PartialPick<FormProps, 'variant' | 'size' | 'color' | 'spacing' | 'formColGap' | 'focused' | 'labelShrink' | 'fullWidth'> {
|
|
4
4
|
id: string;
|
|
5
5
|
fullHeight?: boolean;
|
|
6
|
-
onAddValueItem(id: string, commands: FormValueItemCommands): void;
|
|
6
|
+
onAddValueItem(id: string, commands: FormValueItemCommands<T, AllowUndefinedValue>): void;
|
|
7
7
|
onRemoveValueItem(id: string): void;
|
|
8
|
-
onValueChange(name: string, value:
|
|
9
|
-
onValueChangeByUser(name: string, value:
|
|
10
|
-
onRequestSearchSubmit(name: string, value:
|
|
8
|
+
onValueChange(name: string, value: T): void;
|
|
9
|
+
onValueChangeByUser(name: string, value: T): void;
|
|
10
|
+
onRequestSearchSubmit(name: string, value: T): void;
|
|
11
11
|
formColAutoXs?: number;
|
|
12
12
|
formColWidth?: number;
|
|
13
13
|
onAddFormCol?(id: string, xs: number | undefined): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FormContextValue } from './FormContext.types';
|
|
2
|
-
export default function useFormState(): FormContextValue
|
|
2
|
+
export default function useFormState<T, AllowUndefinedValue extends boolean = true>(): FormContextValue<T, AllowUndefinedValue>;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FormAutocompleteProps
|
|
3
|
-
|
|
2
|
+
import { FormAutocompleteProps, FormAutocompleteCommands } from './FormAutocomplete.types';
|
|
3
|
+
import { FormValueType } from '../../@types';
|
|
4
|
+
interface WithForwardRefType<T, VT extends FormValueType = 'single'> extends React.FC<FormAutocompleteProps<T, VT>> {
|
|
5
|
+
<T, VT extends FormValueType = 'single'>(props: FormAutocompleteProps<T, VT> & React.RefAttributes<FormAutocompleteCommands<T, VT>>): ReturnType<React.FC<FormAutocompleteProps<T, VT>>>;
|
|
6
|
+
}
|
|
7
|
+
declare const FormAutocomplete: WithForwardRefType<any, 'any'>;
|
|
4
8
|
export default FormAutocomplete;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { CommonSxProps, FormMultipleValueItemCommands } from '../../@types';
|
|
2
|
+
import { CommonSxProps, FormMultipleValueItemCommands, FormValueType } from '../../@types';
|
|
3
3
|
import { FormArrayValueItemCommands, FormItemsValueItemCommands, FormLoadingValueItemCommands, FormValueItemBaseCommands, FormValueItemProps } from '../../@types';
|
|
4
4
|
import { FormTextFieldProps } from '../../FormItemTextFieldBase';
|
|
5
|
-
export
|
|
6
|
-
export interface FormAutocompleteItem {
|
|
5
|
+
export interface FormAutocompleteItem<T> {
|
|
7
6
|
label: string;
|
|
8
|
-
value:
|
|
7
|
+
value: T;
|
|
9
8
|
disabled?: boolean;
|
|
10
9
|
[key: string]: any;
|
|
11
10
|
}
|
|
12
|
-
export type
|
|
13
|
-
export type
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
export type FormAutocompleteItems<T> = FormAutocompleteItem<T>[];
|
|
12
|
+
export type FormAutocompleteValue<T, VT extends FormValueType = 'single', V = VT extends 'single' ? T : VT extends 'multiple' ? T[] : T | T[]> = V | undefined;
|
|
13
|
+
export type FormAutocompleteComponentValue<T, VT extends FormValueType = 'single', V = VT extends 'single' ? FormAutocompleteItem<T> : VT extends 'multiple' ? FormAutocompleteItem<T>[] : FormAutocompleteItem<T> | FormAutocompleteItem<T>[]> = V | null;
|
|
14
|
+
export interface FormAutocompleteProps<T, VT extends FormValueType = 'single'> extends CommonSxProps, Omit<FormValueItemProps<FormAutocompleteValue<T, VT>>, 'value'>, Pick<FormTextFieldProps<T>, 'required' | 'focused' | 'labelShrink'> {
|
|
15
|
+
value?: FormAutocompleteValue<T, VT>;
|
|
16
|
+
items?: FormAutocompleteItems<T>;
|
|
17
17
|
multiple?: boolean;
|
|
18
18
|
formValueSeparator?: string;
|
|
19
19
|
formValueSort?: boolean;
|
|
@@ -27,14 +27,14 @@ export interface FormAutocompleteProps extends CommonSxProps, Omit<FormValueItem
|
|
|
27
27
|
disableClearable?: boolean;
|
|
28
28
|
async?: boolean;
|
|
29
29
|
hidden?: boolean;
|
|
30
|
-
onLoadItems?: (inputValue?: string) => Promise<
|
|
31
|
-
onAsyncLoadValueItem?: (value: FormAutocompleteValue) => Promise<FormAutocompleteComponentValue
|
|
32
|
-
onRenderItem?: (item: FormAutocompleteItem) => ReactNode;
|
|
33
|
-
onRenderTag?: (item: FormAutocompleteItem) => ReactNode;
|
|
34
|
-
onValue?: (value: FormAutocompleteValue) => FormAutocompleteValue
|
|
35
|
-
onAddItem?: (item: FormAutocompleteItem) => boolean | Promise<boolean>;
|
|
36
|
-
getOptionDisabled?: (item: FormAutocompleteItem) => boolean;
|
|
30
|
+
onLoadItems?: (inputValue?: string) => Promise<FormAutocompleteItems<T>>;
|
|
31
|
+
onAsyncLoadValueItem?: (value: FormAutocompleteValue<T, VT>) => Promise<FormAutocompleteComponentValue<T, VT>>;
|
|
32
|
+
onRenderItem?: (item: FormAutocompleteItem<T>) => ReactNode;
|
|
33
|
+
onRenderTag?: (item: FormAutocompleteItem<T>) => ReactNode;
|
|
34
|
+
onValue?: (value: FormAutocompleteValue<T, VT>) => FormAutocompleteValue<T, VT>;
|
|
35
|
+
onAddItem?: (item: FormAutocompleteItem<T>) => boolean | Promise<boolean>;
|
|
36
|
+
getOptionDisabled?: (item: FormAutocompleteItem<T>) => boolean;
|
|
37
37
|
}
|
|
38
|
-
export declare const FormAutocompleteDefaultProps: Pick<FormAutocompleteProps
|
|
39
|
-
export interface FormAutocompleteCommands extends FormValueItemBaseCommands, FormArrayValueItemCommands, FormItemsValueItemCommands<FormAutocompleteItem
|
|
38
|
+
export declare const FormAutocompleteDefaultProps: Pick<FormAutocompleteProps<any>, 'formValueSeparator' | 'noOptionsText'>;
|
|
39
|
+
export interface FormAutocompleteCommands<T, VT extends FormValueType = 'single'> extends FormValueItemBaseCommands<FormAutocompleteValue<T, VT>, true>, FormArrayValueItemCommands, FormItemsValueItemCommands<FormAutocompleteItem<T>>, FormMultipleValueItemCommands, FormLoadingValueItemCommands {
|
|
40
40
|
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { ReactNode, RefObject } from 'react';
|
|
2
2
|
import { ButtonBaseActions, CheckboxProps } from '@mui/material';
|
|
3
|
-
import { CommonSxProps, FormCheckValueItemCommands,
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { CommonSxProps, FormCheckValueItemCommands, FormValueItemBaseCommands, FormValueItemProps } from '../../@types';
|
|
4
|
+
export type FormCheckboxValue = string | number | boolean;
|
|
5
|
+
export interface FormCheckboxCommands extends Omit<FormValueItemBaseCommands<FormCheckboxValue, false>, 'getReset'>, FormCheckValueItemCommands<FormCheckboxValue> {
|
|
6
|
+
getReset(): boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface FormCheckboxProps extends CommonSxProps, Omit<CheckboxProps, 'color' | 'name' | 'inputRef' | 'action' | 'required' | 'onChange'>, Omit<FormValueItemProps<FormCheckboxValue, false>, 'value' | 'onChange'> {
|
|
9
|
+
value?: FormCheckboxValue;
|
|
10
|
+
uncheckedValue?: FormCheckboxValue;
|
|
7
11
|
text?: ReactNode;
|
|
8
12
|
inputRef?: RefObject<HTMLInputElement>;
|
|
9
13
|
action?: RefObject<ButtonBaseActions>;
|
|
@@ -11,6 +15,3 @@ export interface FormCheckboxProps extends CommonSxProps, Omit<CheckboxProps, 'c
|
|
|
11
15
|
onChange?(checked: boolean): void;
|
|
12
16
|
}
|
|
13
17
|
export declare const FormCheckboxDefaultProps: Pick<FormCheckboxProps, 'checked' | 'value' | 'uncheckedValue'>;
|
|
14
|
-
export interface FormCheckboxCommands extends Omit<FormValueItemBaseCommands, 'getReset'>, FormCheckValueItemCommands {
|
|
15
|
-
getReset(): FormCheckboxProps['checked'];
|
|
16
|
-
}
|
|
@@ -7,7 +7,7 @@ import { InputDatePickerProps } from './InputDatePicker';
|
|
|
7
7
|
export type FormDateRangePickerDateValue = CustomDatePickerDateValue;
|
|
8
8
|
export type FormDateRangePickerValue = [FormDateRangePickerDateValue, FormDateRangePickerDateValue];
|
|
9
9
|
export type FormDateRangePickerCalendarCount = CustomDatePickerContainerCalendarCount;
|
|
10
|
-
export interface FormDateRangePickerProps extends CommonSxProps, Omit<FormValueItemProps
|
|
10
|
+
export interface FormDateRangePickerProps extends CommonSxProps, Omit<FormValueItemProps<FormDateRangePickerValue>, 'label' | 'labelIcon' | 'value' | 'width' | 'onChange'>, Pick<InputDatePickerProps, 'align'> {
|
|
11
11
|
value?: FormDateRangePickerValue;
|
|
12
12
|
startLabel?: ReactNode;
|
|
13
13
|
startLabelIcon?: string;
|
|
@@ -47,8 +47,8 @@ export interface FormDateRangePickerProps extends CommonSxProps, Omit<FormValueI
|
|
|
47
47
|
end: Dayjs;
|
|
48
48
|
}[];
|
|
49
49
|
onChange?(value: FormDateRangePickerValue): void;
|
|
50
|
-
onValidate?(value: FormDateRangePickerValue):
|
|
50
|
+
onValidate?(value: FormDateRangePickerValue): true | string;
|
|
51
51
|
}
|
|
52
52
|
export declare const FormDateRangePickerDefaultProps: Required<Pick<FormDateRangePickerProps, 'calendarCount' | 'format' | 'formValueFormat' | 'formValueStartNameSuffix' | 'formValueEndNameSuffix' | 'align'>>;
|
|
53
|
-
export interface FormDateRangePickerCommands extends FormValueItemBaseCommands<FormDateRangePickerValue>, FormDateValueItemCommands, FormDateRangeValueItemCommands {
|
|
53
|
+
export interface FormDateRangePickerCommands extends FormValueItemBaseCommands<FormDateRangePickerValue, false>, FormDateValueItemCommands, FormDateRangeValueItemCommands {
|
|
54
54
|
}
|
|
@@ -4,7 +4,7 @@ import { TextFieldProps } from '@mui/material';
|
|
|
4
4
|
import { FormValueItemProps } from '../../../@types';
|
|
5
5
|
import { DateValidationError } from '@mui/x-date-pickers';
|
|
6
6
|
export type InputDatePickerValue = Dayjs | null;
|
|
7
|
-
export interface InputDatePickerProps extends Pick<FormValueItemProps
|
|
7
|
+
export interface InputDatePickerProps extends Pick<FormValueItemProps<InputDatePickerValue>, 'variant' | 'size' | 'color' | 'focused' | 'fullWidth' | 'readOnly' | 'label' | 'labelIcon' | 'error'> {
|
|
8
8
|
className?: string;
|
|
9
9
|
style?: CSSProperties;
|
|
10
10
|
value: InputDatePickerValue;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CommonSxProps, FormValueItemCommands, FormValueItemProps } from '../../@types';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type FormFileValue = string;
|
|
4
|
+
export interface FormFileProps extends CommonSxProps, FormValueItemProps<FormFileValue, false> {
|
|
4
5
|
required?: boolean;
|
|
5
6
|
accept?: string;
|
|
6
7
|
hideUrl?: boolean;
|
|
@@ -23,5 +24,5 @@ export interface FormFileProps extends CommonSxProps, FormValueItemProps {
|
|
|
23
24
|
onFile?(file: File): Promise<string>;
|
|
24
25
|
onLink?(url: string): Promise<string>;
|
|
25
26
|
}
|
|
26
|
-
export declare const FormFileDefaultProps:
|
|
27
|
-
export type FormFileCommands = FormValueItemCommands
|
|
27
|
+
export declare const FormFileDefaultProps: Pick<FormFileProps, 'value'>;
|
|
28
|
+
export type FormFileCommands = FormValueItemCommands<FormFileValue, false>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FormRadioGroupProps
|
|
3
|
-
|
|
2
|
+
import { FormRadioGroupProps, FormRadioGroupCommands } from './FormRadioGroup.types';
|
|
3
|
+
interface WithForwardRefType<T> extends React.FC<FormRadioGroupProps<T>> {
|
|
4
|
+
<T>(props: FormRadioGroupProps<T> & React.RefAttributes<FormRadioGroupCommands<T>>): ReturnType<React.FC<FormRadioGroupProps<T>>>;
|
|
5
|
+
}
|
|
6
|
+
declare const FormRadioGroup: WithForwardRefType<any>;
|
|
4
7
|
export default FormRadioGroup;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { RadioGroupProps } from '@mui/material';
|
|
3
2
|
import { CommonSxProps, FormItemsValueItemCommands, FormLoadingValueItemCommands, FormValueItemBaseCommands, FormValueItemProps } from '../../@types';
|
|
4
|
-
export
|
|
5
|
-
export interface FormRadioGroupItem {
|
|
3
|
+
export interface FormRadioGroupItem<T> {
|
|
6
4
|
label: ReactNode;
|
|
7
|
-
value:
|
|
5
|
+
value: T;
|
|
8
6
|
disabled?: boolean;
|
|
9
7
|
}
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
export type FormRadioGroupItems<T> = FormRadioGroupItem<T>[];
|
|
9
|
+
export type FormRadioGroupValue<T> = T | undefined;
|
|
10
|
+
export interface FormRadioGroupProps<T> extends CommonSxProps, Omit<FormValueItemProps<T>, 'value'> {
|
|
11
|
+
value?: T;
|
|
12
|
+
items?: FormRadioGroupItem<T>[];
|
|
13
13
|
required?: boolean;
|
|
14
14
|
inline?: boolean;
|
|
15
15
|
loading?: boolean;
|
|
16
16
|
nowrap?: boolean;
|
|
17
17
|
hidden?: boolean;
|
|
18
|
-
onLoadItems?(): Promise<FormRadioGroupItem[]>;
|
|
19
|
-
onValue?(value:
|
|
18
|
+
onLoadItems?(): Promise<FormRadioGroupItem<T>[]>;
|
|
19
|
+
onValue?(value: FormRadioGroupValue<T>): FormRadioGroupValue<T>;
|
|
20
20
|
}
|
|
21
|
-
export declare const FormRadioGroupDefaultProps: Pick<FormRadioGroupProps
|
|
22
|
-
export interface FormRadioGroupCommands extends FormValueItemBaseCommands<
|
|
21
|
+
export declare const FormRadioGroupDefaultProps: Pick<FormRadioGroupProps<any>, 'inline'>;
|
|
22
|
+
export interface FormRadioGroupCommands<T> extends FormValueItemBaseCommands<T, true>, FormItemsValueItemCommands<FormRadioGroupItem<T>>, FormLoadingValueItemCommands {
|
|
23
23
|
}
|
|
@@ -2,15 +2,13 @@ import { RatingProps } from '@mui/material';
|
|
|
2
2
|
import { PartialPick, FormValueItemProps, FormValueItemBaseCommands } from '../../@types';
|
|
3
3
|
import { CommonSxProps } from '../../@types';
|
|
4
4
|
export type FormRatingValue = number;
|
|
5
|
-
export interface FormRatingProps extends CommonSxProps, PartialPick<RatingProps, 'highlightSelectedOnly' | 'max' | 'precision'>, Omit<FormValueItemProps,
|
|
6
|
-
value?: FormRatingValue;
|
|
5
|
+
export interface FormRatingProps extends CommonSxProps, PartialPick<RatingProps, 'highlightSelectedOnly' | 'max' | 'precision'>, Omit<FormValueItemProps<FormRatingValue, false>, 'fullWidth'> {
|
|
7
6
|
required?: boolean;
|
|
8
7
|
icon?: string;
|
|
9
8
|
emptyIcon?: string;
|
|
10
9
|
hidden?: boolean;
|
|
11
|
-
|
|
12
|
-
onValue?(value: number): number;
|
|
10
|
+
onValue?(value: FormRatingValue): FormRatingValue;
|
|
13
11
|
}
|
|
14
12
|
export declare const FormRatingDefaultProps: Pick<FormRatingProps, 'value' | 'precision'>;
|
|
15
|
-
export interface FormRatingCommands extends FormValueItemBaseCommands<FormRatingValue> {
|
|
13
|
+
export interface FormRatingCommands extends FormValueItemBaseCommands<FormRatingValue, false> {
|
|
16
14
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { CommonSxProps, FormValueItemCommands, FormValueItemProps } from '../../@types';
|
|
2
|
-
export
|
|
2
|
+
export type FormTextEditorValue = string;
|
|
3
|
+
export type FormTextEditorCommands = FormValueItemCommands<FormTextEditorValue, false>;
|
|
4
|
+
export interface FormTextEditorProps extends CommonSxProps, Omit<FormValueItemProps<FormTextEditorValue, false>, 'fullWidth'> {
|
|
3
5
|
required?: boolean;
|
|
4
6
|
menubar?: boolean;
|
|
5
7
|
height?: number;
|
|
6
8
|
hidden?: boolean;
|
|
7
9
|
onImageUpload?(blob: Blob, success: (url: string) => void, failure: (err: string) => void, progress?: (percent: number) => void): void;
|
|
8
10
|
}
|
|
9
|
-
export declare const FormTextEditorDefaultProps: Pick<FormTextEditorProps, 'menubar' | 'height'>;
|
|
10
|
-
export type FormTextEditorCommands = FormValueItemCommands;
|
|
11
|
+
export declare const FormTextEditorDefaultProps: Pick<FormTextEditorProps, 'value' | 'menubar' | 'height'>;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FormValueType } from '../../@types';
|
|
3
|
+
import { FormToggleButtonGroupProps, FormToggleButtonGroupCommands } from './FormToggleButtonGroup.types';
|
|
3
4
|
import './FormToggleButtonGroup.scss';
|
|
4
|
-
|
|
5
|
+
interface WithForwardRefType<T, VT extends FormValueType = 'single'> extends React.FC<FormToggleButtonGroupProps<T, VT>> {
|
|
6
|
+
<T, VT extends FormValueType = 'single'>(props: FormToggleButtonGroupProps<T, VT> & React.RefAttributes<FormToggleButtonGroupCommands<T, VT>>): ReturnType<React.FC<FormToggleButtonGroupProps<T, VT>>>;
|
|
7
|
+
}
|
|
8
|
+
declare const FormToggleButtonGroup: WithForwardRefType<any, 'any'>;
|
|
5
9
|
export default FormToggleButtonGroup;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ToggleButtonProps } from '@mui/material';
|
|
3
|
-
import { PartialPick, CommonSxProps, FormMultipleValueItemCommands, FormArrayValueItemCommands, FormItemsValueItemCommands, FormLoadingValueItemCommands, FormValueItemBaseCommands, FormValueItemProps } from '../../@types';
|
|
3
|
+
import { PartialPick, CommonSxProps, FormMultipleValueItemCommands, FormArrayValueItemCommands, FormItemsValueItemCommands, FormLoadingValueItemCommands, FormValueItemBaseCommands, FormValueItemProps, FormValueType } from '../../@types';
|
|
4
4
|
import { FormItemBaseProps } from '../FormItemBase';
|
|
5
|
-
export
|
|
6
|
-
export interface FormToggleButtonGroupItem {
|
|
5
|
+
export interface FormToggleButtonGroupItem<T> {
|
|
7
6
|
label: ReactNode;
|
|
8
|
-
value:
|
|
7
|
+
value: T;
|
|
9
8
|
disabled?: boolean;
|
|
10
9
|
color?: ToggleButtonProps['color'];
|
|
11
10
|
}
|
|
12
|
-
export type
|
|
13
|
-
export
|
|
11
|
+
export type FormToggleButtonGroupItems<T> = FormToggleButtonGroupItem<T>[];
|
|
12
|
+
export type FormToggleButtonGroupValue<T, VT extends FormValueType = 'single', V = VT extends 'single' ? T : VT extends 'multiple' ? T[] : T | T[]> = V | undefined;
|
|
13
|
+
export interface FormToggleButtonGroupProps<T, VT extends FormValueType = 'single'> extends CommonSxProps, Omit<FormValueItemProps<FormToggleButtonGroupValue<T, VT>>, 'value'>, PartialPick<FormItemBaseProps, 'required' | 'focused'> {
|
|
14
14
|
type?: 'button' | 'checkbox' | 'radio';
|
|
15
|
-
value?: FormToggleButtonGroupValue
|
|
16
|
-
items?: FormToggleButtonGroupItem[];
|
|
15
|
+
value?: FormToggleButtonGroupValue<T, VT>;
|
|
16
|
+
items?: FormToggleButtonGroupItem<T>[];
|
|
17
17
|
multiple?: boolean;
|
|
18
18
|
notAllowEmptyValue?: boolean;
|
|
19
19
|
formValueSeparator?: string;
|
|
@@ -21,11 +21,11 @@ export interface FormToggleButtonGroupProps extends CommonSxProps, Omit<FormValu
|
|
|
21
21
|
loading?: boolean;
|
|
22
22
|
hidden?: boolean;
|
|
23
23
|
itemWidth?: number | string;
|
|
24
|
-
onLoadItems?: () => Promise<FormToggleButtonGroupItem[]>;
|
|
25
|
-
onValue?: (value: FormToggleButtonGroupValue) => FormToggleButtonGroupValue
|
|
24
|
+
onLoadItems?: () => Promise<FormToggleButtonGroupItem<T>[]>;
|
|
25
|
+
onValue?: (value: FormToggleButtonGroupValue<T, VT>) => FormToggleButtonGroupValue<T, VT>;
|
|
26
26
|
}
|
|
27
|
-
export declare const FormToggleButtonGroupDefaultProps: Pick<FormToggleButtonGroupProps, 'type' | 'formValueSeparator'>;
|
|
28
|
-
export interface FormToggleButtonGroupExtraCommands extends FormArrayValueItemCommands, FormItemsValueItemCommands<FormToggleButtonGroupItem
|
|
27
|
+
export declare const FormToggleButtonGroupDefaultProps: Pick<FormToggleButtonGroupProps<any, 'any'>, 'type' | 'formValueSeparator'>;
|
|
28
|
+
export interface FormToggleButtonGroupExtraCommands<T> extends FormArrayValueItemCommands, FormItemsValueItemCommands<FormToggleButtonGroupItem<T>>, FormMultipleValueItemCommands, FormLoadingValueItemCommands {
|
|
29
29
|
}
|
|
30
|
-
export interface FormToggleButtonGroupCommands extends FormValueItemBaseCommands<FormToggleButtonGroupValue>, FormToggleButtonGroupExtraCommands {
|
|
30
|
+
export interface FormToggleButtonGroupCommands<T, VT extends FormValueType = 'single'> extends FormValueItemBaseCommands<FormToggleButtonGroupValue<T, VT>, true>, FormToggleButtonGroupExtraCommands<T> {
|
|
31
31
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const FormCompanyNo: React.ForwardRefExoticComponent<
|
|
4
|
-
value?: string | undefined;
|
|
5
|
-
} & React.RefAttributes<FormValueItemBaseCommands<any>>>;
|
|
2
|
+
import { FormCompanyNoProps as Props } from './FormCompanyNo.types';
|
|
3
|
+
declare const FormCompanyNo: React.ForwardRefExoticComponent<Props & React.RefAttributes<import("../FormText").FormTextCommands>>;
|
|
6
4
|
export default FormCompanyNo;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FormTextProps } from '../FormText';
|
|
2
|
-
export type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare const FormCompanyNoDefaultProps: Pick<
|
|
1
|
+
import { FormTextProps, FormTextCommands, FormTextValue } from '../FormText';
|
|
2
|
+
export type FormCompanyNoValue = FormTextValue;
|
|
3
|
+
export type FormCompanyNoCommands = FormTextCommands;
|
|
4
|
+
export type FormCompanyNoProps = Omit<FormTextProps, 'type' | 'maxLength'>;
|
|
5
|
+
export declare const FormCompanyNoDefaultProps: Pick<FormCompanyNoProps, 'validPattern'>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormEmailProps } from './FormEmail.types';
|
|
3
|
-
|
|
4
|
-
declare const FormEmail: React.ForwardRefExoticComponent<FormEmailProps & React.RefAttributes<FormValueItemBaseCommands<any>>>;
|
|
3
|
+
declare const FormEmail: React.ForwardRefExoticComponent<FormEmailProps & React.RefAttributes<import("../FormText").FormTextCommands>>;
|
|
5
4
|
export default FormEmail;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import { FormTextProps } from '../FormText';
|
|
1
|
+
import { FormTextProps, FormTextCommands } from '../FormText';
|
|
2
|
+
export type FormEmailValue = string;
|
|
3
|
+
export type FormEmailCommands = FormTextCommands;
|
|
2
4
|
export type FormEmailProps = Omit<FormTextProps, 'type'>;
|
|
3
5
|
export declare const FormEmailDefaultProps: Pick<FormEmailProps, 'validPattern'>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export type
|
|
1
|
+
import { FormTextFieldCommands, FormTextFieldProps } from '../FormTextField';
|
|
2
|
+
export type FormHiddenValue = any;
|
|
3
|
+
export type FormHiddenCommands = FormTextFieldCommands<FormHiddenValue>;
|
|
4
|
+
export type FormHiddenProps = Pick<FormTextFieldProps<FormHiddenValue>, 'className' | 'name' | 'value' | 'error' | 'required' | 'exceptValue' | 'onChange' | 'onValue' | 'onValidate'>;
|
|
4
5
|
export declare const FormHiddenDefaultProps: {};
|
|
5
|
-
export interface FormHiddenCommands extends FormValueItemBaseCommands {
|
|
6
|
-
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
declare const FormMobile: React.ForwardRefExoticComponent<Omit<import("..").FormTextProps, "type" | "value" | "maxLength"> & {
|
|
4
|
-
value?: string | undefined;
|
|
5
|
-
} & React.RefAttributes<FormValueItemBaseCommands<any>>>;
|
|
2
|
+
declare const FormMobile: React.ForwardRefExoticComponent<import("../FormTel").FormTelProps & React.RefAttributes<import("..").FormTextCommands>>;
|
|
6
3
|
export default FormMobile;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import { FormTelProps } from '../FormTel';
|
|
1
|
+
import { FormTelProps, FormTelCommands, FormTelValue } from '../FormTel';
|
|
2
|
+
export type FormMobileValue = FormTelValue;
|
|
3
|
+
export type FormMobileCommands = FormTelCommands;
|
|
2
4
|
export type FormMobileProps = FormTelProps;
|
|
3
5
|
export declare const FormMobileDefaultProps: Pick<FormMobileProps, 'validPattern'>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const FormNumber: React.ForwardRefExoticComponent<Omit<import("../
|
|
2
|
+
import { FormNumberCommands, FormNumberValue } from './FormNumber.types';
|
|
3
|
+
declare const FormNumber: React.ForwardRefExoticComponent<Omit<import("../FormTextField").FormTextFieldProps<FormNumberValue, false, FormNumberValue>, "type"> & {
|
|
4
4
|
allowLeadingZeros?: boolean | undefined;
|
|
5
5
|
allowNegative?: boolean | undefined;
|
|
6
6
|
thousandSeparator?: boolean | undefined;
|
|
@@ -8,5 +8,5 @@ declare const FormNumber: React.ForwardRefExoticComponent<Omit<import("../FormTe
|
|
|
8
8
|
decimalScale?: number | undefined;
|
|
9
9
|
prefix?: string | undefined;
|
|
10
10
|
suffix?: string | undefined;
|
|
11
|
-
} & React.RefAttributes<
|
|
11
|
+
} & React.RefAttributes<FormNumberCommands>>;
|
|
12
12
|
export default FormNumber;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type
|
|
1
|
+
import { FormTextFieldCommands, FormTextFieldProps } from '../FormTextField';
|
|
2
|
+
export type FormNumberValue = string | number;
|
|
3
|
+
export type FormNumberCommands = FormTextFieldCommands<FormNumberValue, false>;
|
|
4
|
+
export type FormNumberProps = Omit<FormTextFieldProps<FormNumberValue, false>, 'type'> & {
|
|
3
5
|
allowLeadingZeros?: boolean;
|
|
4
6
|
allowNegative?: boolean;
|
|
5
7
|
thousandSeparator?: boolean;
|
|
@@ -8,7 +10,4 @@ export type FormNumberProps = Omit<FormTextProps, 'type'> & {
|
|
|
8
10
|
prefix?: string;
|
|
9
11
|
suffix?: string;
|
|
10
12
|
};
|
|
11
|
-
export declare const FormNumberDefaultProps:
|
|
12
|
-
value?: unknown;
|
|
13
|
-
clear?: boolean | undefined;
|
|
14
|
-
};
|
|
13
|
+
export declare const FormNumberDefaultProps: Pick<FormNumberProps, 'value' | 'clear'>;
|