@pdg/react-form 1.0.56 → 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.
Files changed (64) hide show
  1. package/dist/@private/PrivateDatePicker/PrivateDatePicker.types.d.ts +3 -6
  2. package/dist/@private/PrivateDateTimePicker/PrivateDateTimePicker.d.ts +5 -0
  3. package/dist/@private/PrivateDateTimePicker/PrivateDateTimePicker.types.d.ts +27 -0
  4. package/dist/@private/PrivateDateTimePicker/index.d.ts +4 -0
  5. package/dist/@private/PrivateStaticDatePicker/PrivateStaticDatePicker.types.d.ts +0 -2
  6. package/dist/@private/PrivateStaticDateTimePicker/PrivateStaticDateTimePicker.d.ts +5 -0
  7. package/dist/@private/PrivateStaticDateTimePicker/PrivateStaticDateTimePicker.types.d.ts +22 -0
  8. package/dist/@private/PrivateStaticDateTimePicker/index.d.ts +4 -0
  9. package/dist/@private/index.d.ts +2 -0
  10. package/dist/@types/types.d.ts +18 -18
  11. package/dist/@util/date_time.d.ts +2 -2
  12. package/dist/Form/Form.types.d.ts +8 -8
  13. package/dist/FormContext/FormContext.d.ts +1 -1
  14. package/dist/FormContext/FormContext.types.d.ts +6 -6
  15. package/dist/FormContext/useFormState.d.ts +1 -1
  16. package/dist/FormItemCustom/FormAutocomplete/FormAutocomplete.d.ts +6 -2
  17. package/dist/FormItemCustom/FormAutocomplete/FormAutocomplete.types.d.ts +18 -18
  18. package/dist/FormItemCustom/FormCheckbox/FormCheckbox.types.d.ts +8 -7
  19. package/dist/FormItemCustom/FormDateRangePicker/FormDateRangePicker.types.d.ts +3 -3
  20. package/dist/FormItemCustom/FormDateRangePicker/InputDatePicker/InputDatePicker.types.d.ts +1 -1
  21. package/dist/FormItemCustom/FormDateTimePicker/FormDateTimePicker.types.d.ts +4 -4
  22. package/dist/FormItemCustom/FormFile/FormFile.types.d.ts +4 -3
  23. package/dist/FormItemCustom/FormRadioGroup/FormRadioGroup.d.ts +5 -2
  24. package/dist/FormItemCustom/FormRadioGroup/FormRadioGroup.types.d.ts +11 -11
  25. package/dist/FormItemCustom/FormRating/FormRating.types.d.ts +3 -5
  26. package/dist/FormItemCustom/FormTextEditor/FormTextEditor.types.d.ts +4 -3
  27. package/dist/FormItemCustom/FormTimePicker/FormTimePicker.types.d.ts +4 -4
  28. package/dist/FormItemCustom/FormToggleButtonGroup/FormToggleButtonGroup.d.ts +6 -2
  29. package/dist/FormItemCustom/FormToggleButtonGroup/FormToggleButtonGroup.types.d.ts +13 -13
  30. package/dist/FormItemTextFieldBase/FormCompanyNo/FormCompanyNo.d.ts +2 -4
  31. package/dist/FormItemTextFieldBase/FormCompanyNo/FormCompanyNo.types.d.ts +5 -5
  32. package/dist/FormItemTextFieldBase/FormEmail/FormEmail.d.ts +1 -2
  33. package/dist/FormItemTextFieldBase/FormEmail/FormEmail.types.d.ts +3 -1
  34. package/dist/FormItemTextFieldBase/FormHidden/FormHidden.types.d.ts +4 -5
  35. package/dist/FormItemTextFieldBase/FormMobile/FormMobile.d.ts +1 -4
  36. package/dist/FormItemTextFieldBase/FormMobile/FormMobile.types.d.ts +3 -1
  37. package/dist/FormItemTextFieldBase/FormNumber/FormNumber.d.ts +3 -3
  38. package/dist/FormItemTextFieldBase/FormNumber/FormNumber.types.d.ts +5 -6
  39. package/dist/FormItemTextFieldBase/FormNumber/NumberFormatCustom.d.ts +1 -2
  40. package/dist/FormItemTextFieldBase/FormPassword/FormPassword.d.ts +1 -2
  41. package/dist/FormItemTextFieldBase/FormPassword/FormPassword.types.d.ts +5 -3
  42. package/dist/FormItemTextFieldBase/FormPersonalNo/FormPersonalNo.d.ts +2 -3
  43. package/dist/FormItemTextFieldBase/FormPersonalNo/FormPersonalNo.types.d.ts +4 -2
  44. package/dist/FormItemTextFieldBase/FormSearch/FormSearch.d.ts +1 -2
  45. package/dist/FormItemTextFieldBase/FormSearch/FormSearch.types.d.ts +4 -2
  46. package/dist/FormItemTextFieldBase/FormSelect/FormSelect.d.ts +6 -13
  47. package/dist/FormItemTextFieldBase/FormSelect/FormSelect.types.d.ts +14 -15
  48. package/dist/FormItemTextFieldBase/FormTag/FormTag.d.ts +2 -3
  49. package/dist/FormItemTextFieldBase/FormTag/FormTag.types.d.ts +6 -8
  50. package/dist/FormItemTextFieldBase/FormTel/FormTel.d.ts +2 -4
  51. package/dist/FormItemTextFieldBase/FormTel/FormTel.types.d.ts +5 -5
  52. package/dist/FormItemTextFieldBase/FormText/FormText.d.ts +2 -3
  53. package/dist/FormItemTextFieldBase/FormText/FormText.types.d.ts +4 -2
  54. package/dist/FormItemTextFieldBase/FormTextField/FormTextField.d.ts +5 -15
  55. package/dist/FormItemTextFieldBase/FormTextField/FormTextField.types.d.ts +5 -4
  56. package/dist/FormItemTextFieldBase/FormTextarea/FormTextarea.d.ts +2 -3
  57. package/dist/FormItemTextFieldBase/FormTextarea/FormTextarea.types.d.ts +4 -2
  58. package/dist/FormItemTextFieldBase/FormUrl/FormUrl.d.ts +1 -2
  59. package/dist/FormItemTextFieldBase/FormUrl/FormUrl.types.d.ts +3 -1
  60. package/dist/index.esm.js +838 -157
  61. package/dist/index.esm.js.map +1 -1
  62. package/dist/index.js +837 -156
  63. package/dist/index.js.map +1 -1
  64. package/package.json +1 -1
@@ -1,6 +1,4 @@
1
1
  import React from 'react';
2
- import { FormValueItemBaseCommands } from '../../@types';
3
- declare const FormCompanyNo: React.ForwardRefExoticComponent<Omit<import("../FormText").FormTextProps, "type" | "value" | "maxLength"> & {
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 FormCompanyNoProps = Omit<FormTextProps, 'type' | 'value' | 'maxLength'> & {
3
- value?: string;
4
- };
5
- export declare const FormCompanyNoDefaultProps: Pick<FormTextProps, 'validPattern'>;
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
- import { FormValueItemBaseCommands } from '../../@types';
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 { FormTextProps } from '../FormText';
2
- import { FormValueItemBaseCommands } from '../../@types';
3
- export type FormHiddenProps = Pick<FormTextProps, 'className' | 'name' | 'value' | 'error' | 'required' | 'exceptValue' | 'onChange' | 'onValidate'>;
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
- import { FormValueItemBaseCommands } from '../../@types';
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 { FormValueItemBaseCommands } from '../../@types';
3
- declare const FormNumber: React.ForwardRefExoticComponent<Omit<import("../FormText").FormTextProps, "type"> & {
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<FormValueItemBaseCommands<any>>>;
11
+ } & React.RefAttributes<FormNumberCommands>>;
12
12
  export default FormNumber;
@@ -1,5 +1,7 @@
1
- import { FormTextProps } from '../FormText';
2
- export type FormNumberProps = Omit<FormTextProps, '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'>;
@@ -1,8 +1,7 @@
1
1
  import { NumericFormatProps } from 'react-number-format';
2
- import { FormNumberProps } from './FormNumber.types';
3
2
  import React from 'react';
4
3
  interface NumberFormatCustomProps extends Omit<NumericFormatProps, 'onChange'> {
5
- onChange: FormNumberProps['onChange'];
4
+ onChange: (value: any) => void;
6
5
  }
7
6
  declare const NumberFormatCustom: React.ForwardRefExoticComponent<NumberFormatCustomProps & React.RefAttributes<HTMLInputElement>>;
8
7
  export default NumberFormatCustom;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { FormValueItemBaseCommands } from '../../@types';
3
2
  import { FormPasswordProps as Props } from './FormPassword.types';
4
3
  import './FormPassword.scss';
5
- declare const FormPassword: React.ForwardRefExoticComponent<Props & React.RefAttributes<FormValueItemBaseCommands<any>>>;
4
+ declare const FormPassword: React.ForwardRefExoticComponent<Props & React.RefAttributes<import("../FormText").FormTextCommands>>;
6
5
  export default FormPassword;
@@ -1,5 +1,7 @@
1
- import { FormTextFieldProps } from '../FormTextField';
2
- export interface FormPasswordProps extends Omit<FormTextFieldProps, 'disableReturnKey' | 'type'> {
1
+ import { FormTextCommands, FormTextProps, FormTextValue } from '../FormText';
2
+ export type FormPasswordValue = FormTextValue;
3
+ export type FormPasswordCommands = FormTextCommands;
4
+ export interface FormPasswordProps extends Omit<FormTextProps, 'disableReturnKey' | 'type'> {
3
5
  eye?: boolean;
4
6
  }
5
- export declare const FormPasswordDefaultProps: Pick<FormPasswordProps, 'clear' | 'eye'>;
7
+ export declare const FormPasswordDefaultProps: Pick<FormPasswordProps, 'clear' | 'eye' | 'value'>;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { FormValueItemBaseCommands } from '../../@types';
3
- declare const FormPersonalNo: React.ForwardRefExoticComponent<Omit<import("../FormText").FormTextProps, "type" | "value" | "maxLength"> & {
2
+ declare const FormPersonalNo: React.ForwardRefExoticComponent<Omit<import("../FormText").FormTextProps, "value" | "type" | "maxLength"> & {
4
3
  value?: string | undefined;
5
- } & React.RefAttributes<FormValueItemBaseCommands<any>>>;
4
+ } & React.RefAttributes<import("../FormText").FormTextCommands>>;
6
5
  export default FormPersonalNo;
@@ -1,5 +1,7 @@
1
- import { FormTextProps } from '../FormText';
1
+ import { FormTextProps, FormTextCommands } from '../FormText';
2
+ export type FormPersonalNoValue = string;
3
+ export type FormPersonalNoCommands = FormTextCommands;
2
4
  export type FormPersonalNoProps = Omit<FormTextProps, 'type' | 'value' | 'maxLength'> & {
3
5
  value?: string;
4
6
  };
5
- export declare const FormPersonalNoDefaultProps: Pick<FormTextProps, 'validPattern'>;
7
+ export declare const FormPersonalNoDefaultProps: Pick<FormPersonalNoProps, 'validPattern'>;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { FormSearchProps as Props } from './FormSearch.types';
3
- import { FormValueItemBaseCommands } from '../../@types';
4
3
  import './FormSearch.scss';
5
- declare const FormSearch: React.ForwardRefExoticComponent<Props & React.RefAttributes<FormValueItemBaseCommands<any>>>;
4
+ declare const FormSearch: React.ForwardRefExoticComponent<Props & React.RefAttributes<import("../FormText").FormTextCommands>>;
6
5
  export default FormSearch;
@@ -1,6 +1,8 @@
1
- import { FormTextProps } from '../FormText';
1
+ import { FormTextProps, FormTextValue, FormTextCommands } from '../FormText';
2
+ export type FormSearchValue = FormTextValue;
3
+ export type FormSearchCommands = FormTextCommands;
2
4
  export type FormSearchProps = Omit<FormTextProps, 'type'>;
3
5
  export declare const FormSearchDefaultProps: {
4
- value?: unknown;
6
+ value?: string | undefined;
5
7
  clear?: boolean | undefined;
6
8
  };
@@ -1,16 +1,9 @@
1
1
  import React from 'react';
2
- import { FormValueItemCommands } from '../../@types';
3
- import { FormSelectItem, FormSelectValue } from './FormSelect.types';
2
+ import { FormSelectProps, FormSelectCommands } from './FormSelect.types';
4
3
  import './FormSelect.scss';
5
- declare const FormSelect: React.ForwardRefExoticComponent<Omit<import("../FormText").FormTextProps, "type" | "value" | "clear"> & {
6
- items?: FormSelectItem[] | undefined;
7
- value?: FormSelectValue;
8
- multiple?: boolean | undefined;
9
- checkbox?: boolean | undefined;
10
- formValueSeparator?: string | undefined;
11
- formValueSort?: boolean | undefined;
12
- minWidth?: string | number | undefined;
13
- loading?: boolean | undefined;
14
- onLoadItems?: (() => Promise<FormSelectItem[]>) | undefined;
15
- } & React.RefAttributes<FormValueItemCommands<FormSelectItem, any>>>;
4
+ import { FormValueType } from '../../@types';
5
+ interface WithForwardRefType<T, VT extends FormValueType = 'single'> extends React.FC<FormSelectProps<T, VT>> {
6
+ <T, VT extends FormValueType = 'single'>(props: FormSelectProps<T, VT> & React.RefAttributes<FormSelectCommands<T, VT>>): ReturnType<React.FC<FormSelectProps<T, VT>>>;
7
+ }
8
+ declare const FormSelect: WithForwardRefType<any, 'any'>;
16
9
  export default FormSelect;
@@ -1,26 +1,25 @@
1
- import { FormTextProps } from '../FormText';
2
1
  import { ReactNode } from 'react';
3
- import { FormArrayValueItemCommands, FormItemsValueItemCommands, FormLoadingValueItemCommands, FormValueItemBaseCommands, FormMultipleValueItemCommands } from '../../@types';
4
- export type FormSelectItemValue = string | number;
5
- export interface FormSelectItem {
2
+ import { FormArrayValueItemCommands, FormItemsValueItemCommands, FormLoadingValueItemCommands, FormValueItemBaseCommands, FormMultipleValueItemCommands, FormValueType } from '../../@types';
3
+ import { FormTextFieldProps } from '../FormTextField';
4
+ export type FormSelectValue<T, VT extends FormValueType = 'single', V = VT extends 'single' ? T : VT extends 'multiple' ? T[] : T | T[]> = V | undefined;
5
+ export interface FormSelectExtraCommands<T> extends FormArrayValueItemCommands, FormItemsValueItemCommands<FormSelectItem<T>>, FormMultipleValueItemCommands, FormLoadingValueItemCommands {
6
+ }
7
+ export interface FormSelectCommands<T, VT extends FormValueType = 'single'> extends FormValueItemBaseCommands<FormSelectValue<T, VT>, true>, FormSelectExtraCommands<T> {
8
+ }
9
+ export interface FormSelectItem<T> {
6
10
  label: ReactNode;
7
- value: FormSelectItemValue;
11
+ value: T;
8
12
  disabled?: boolean;
9
13
  }
10
- export type FormSelectValue = FormSelectItemValue | FormSelectItemValue[] | undefined;
11
- export type FormSelectProps = Omit<FormTextProps, 'type' | 'value' | 'clear'> & {
12
- items?: FormSelectItem[];
13
- value?: FormSelectValue;
14
+ export type FormSelectItems<T> = FormSelectItem<T>[];
15
+ export type FormSelectProps<T, VT extends FormValueType = 'single'> = Omit<FormTextFieldProps<FormSelectValue<T, VT>>, 'type' | 'clear'> & {
16
+ items?: FormSelectItems<T>;
14
17
  multiple?: boolean;
15
18
  checkbox?: boolean;
16
19
  formValueSeparator?: string;
17
20
  formValueSort?: boolean;
18
21
  minWidth?: string | number;
19
22
  loading?: boolean;
20
- onLoadItems?: () => Promise<FormSelectItem[]>;
23
+ onLoadItems?: () => Promise<FormSelectItem<T>[]>;
21
24
  };
22
- export declare const FormSelectDefaultProps: Pick<FormSelectProps, 'formValueSeparator' | 'minWidth'>;
23
- export interface FormSelectExtraCommands extends FormArrayValueItemCommands, FormItemsValueItemCommands<FormSelectItem>, FormMultipleValueItemCommands, FormLoadingValueItemCommands {
24
- }
25
- export interface FormSelectCommands extends FormValueItemBaseCommands, FormSelectExtraCommands {
26
- }
25
+ export declare const FormSelectDefaultProps: Pick<FormSelectProps<any>, 'formValueSeparator' | 'minWidth'>;
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import { FormTagCommands } from './FormTag.types';
2
+ import { FormTagCommands, FormTagValue } from './FormTag.types';
3
3
  import './FormTag.scss';
4
- declare const FormTag: React.ForwardRefExoticComponent<Omit<import("../FormText").FormTextProps, "type" | "value"> & {
5
- value?: string[] | undefined;
4
+ declare const FormTag: React.ForwardRefExoticComponent<Omit<import("..").FormTextFieldProps<FormTagValue, false, FormTagValue>, "type"> & {
6
5
  formValueSeparator?: string | undefined;
7
6
  formValueSort?: boolean | undefined;
8
7
  } & React.RefAttributes<FormTagCommands>>;
@@ -1,12 +1,10 @@
1
- import { FormTextProps } from '../FormText';
2
- import { FormArrayValueItemCommands, FormValueItemBaseCommands } from '../../@types';
3
- export type FormTagProps = Omit<FormTextProps, 'type' | 'value'> & {
4
- value?: string[];
1
+ import { FormArrayValueItemCommands } from '../../@types';
2
+ import { FormTextFieldCommands, FormTextFieldProps } from '../FormTextField';
3
+ export type FormTagValue = string[];
4
+ export type FormTagExtraCommands = FormArrayValueItemCommands;
5
+ export type FormTagCommands = FormTextFieldCommands<FormTagValue, false> & FormTagExtraCommands;
6
+ export type FormTagProps = Omit<FormTextFieldProps<FormTagValue, false>, 'type'> & {
5
7
  formValueSeparator?: string;
6
8
  formValueSort?: boolean;
7
9
  };
8
10
  export declare const FormTagDefaultProps: Pick<FormTagProps, 'value' | 'clear' | 'formValueSeparator'>;
9
- export interface FormTagExtraCommands extends FormArrayValueItemCommands {
10
- }
11
- export interface FormTagCommands extends FormValueItemBaseCommands, FormTagExtraCommands {
12
- }
@@ -1,6 +1,4 @@
1
1
  import React from 'react';
2
- import { FormValueItemBaseCommands } from '../../@types';
3
- declare const FormTel: React.ForwardRefExoticComponent<Omit<import("../FormText").FormTextProps, "type" | "value" | "maxLength"> & {
4
- value?: string | undefined;
5
- } & React.RefAttributes<FormValueItemBaseCommands<any>>>;
2
+ import { FormTelProps as Props } from './FormTel.types';
3
+ declare const FormTel: React.ForwardRefExoticComponent<Props & React.RefAttributes<import("../FormText").FormTextCommands>>;
6
4
  export default FormTel;
@@ -1,5 +1,5 @@
1
- import { FormTextProps } from '../FormText';
2
- export type FormTelProps = Omit<FormTextProps, 'type' | 'value' | 'maxLength'> & {
3
- value?: string;
4
- };
5
- export declare const FormTelDefaultProps: Pick<FormTextProps, 'validPattern'>;
1
+ import { FormTextProps, FormTextCommands, FormTextValue } from '../FormText';
2
+ export type FormTelValue = FormTextValue;
3
+ export type FormTelCommands = FormTextCommands;
4
+ export type FormTelProps = Omit<FormTextProps, 'type' | 'maxLength'>;
5
+ export declare const FormTelDefaultProps: Pick<FormTelProps, 'validPattern'>;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { FormTextProps as Props } from './FormText.types';
3
- import { FormValueItemBaseCommands } from '../../@types';
4
- declare const FormText: React.ForwardRefExoticComponent<Props & React.RefAttributes<FormValueItemBaseCommands<any>>>;
2
+ import { FormTextProps, FormTextCommands } from './FormText.types';
3
+ declare const FormText: React.ForwardRefExoticComponent<FormTextProps & React.RefAttributes<FormTextCommands>>;
5
4
  export default FormText;
@@ -1,3 +1,5 @@
1
- import { FormTextFieldProps } from '../FormTextField';
2
- export type FormTextProps = Omit<FormTextFieldProps, 'disableReturnKey' | 'minRows' | 'maxRows'>;
1
+ import { FormTextFieldProps, FormTextFieldCommands } from '../FormTextField';
2
+ export type FormTextValue = string;
3
+ export type FormTextCommands = FormTextFieldCommands<FormTextValue, false>;
4
+ export type FormTextProps = Omit<FormTextFieldProps<FormTextValue, false>, 'disableReturnKey' | 'minRows' | 'maxRows'>;
3
5
  export declare const FormTextDefaultProps: Pick<FormTextProps, 'clear' | 'value'>;
@@ -1,18 +1,8 @@
1
1
  import React from 'react';
2
- import { FormTextFieldCommands } from './FormTextField.types';
2
+ import { FormTextFieldProps, FormTextFieldCommands, FormTextFieldValue } from './FormTextField.types';
3
3
  import './FormTextField.scss';
4
- declare const FormTextField: React.ForwardRefExoticComponent<Omit<import("@mui/material").FilledTextFieldProps | import("@mui/material").OutlinedTextFieldProps | import("@mui/material").StandardTextFieldProps, "ref" | "name" | "onChange"> & Omit<import("../../@types").FormValueItemProps, "disabled" | "error" | "fullWidth" | "label" | "value"> & {
5
- icon?: string | undefined;
6
- clear?: boolean | undefined;
7
- maxLength?: number | undefined;
8
- labelShrink?: boolean | undefined;
9
- validPattern?: RegExp | undefined;
10
- invalidPattern?: RegExp | undefined;
11
- startAdornment?: React.ReactNode;
12
- endAdornment?: React.ReactNode;
13
- noFormValueItem?: boolean | undefined;
14
- hidden?: boolean | undefined;
15
- disableReturnKey?: boolean | undefined;
16
- onValue?(value: any): any;
17
- } & React.RefAttributes<FormTextFieldCommands>>;
4
+ interface WithForwardRefType<T = FormTextFieldValue, AllowUndefinedValue extends boolean = true> extends React.FC<FormTextFieldProps<T, AllowUndefinedValue>> {
5
+ <T = FormTextFieldValue, AllowUndefinedValue extends boolean = true>(props: FormTextFieldProps<T, AllowUndefinedValue> & React.RefAttributes<FormTextFieldCommands<T, AllowUndefinedValue>>): ReturnType<React.FC<FormTextFieldProps<T, AllowUndefinedValue>>>;
6
+ }
7
+ declare const FormTextField: WithForwardRefType;
18
8
  export default FormTextField;
@@ -1,9 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { TextFieldProps } from '@mui/material';
3
- import { FormItemValue, FormValueItemBaseCommands, FormValueItemProps } from '../../@types';
4
- export interface FormTextFieldCommands extends FormValueItemBaseCommands {
3
+ import { FormValueItemBaseCommands, FormValueItemProps } from '../../@types';
4
+ export type FormTextFieldValue = any;
5
+ export interface FormTextFieldCommands<T = FormTextFieldValue, AllowUndefinedValue extends boolean = true> extends FormValueItemBaseCommands<T, AllowUndefinedValue> {
5
6
  }
6
- export type FormTextFieldProps = Omit<TextFieldProps, 'ref' | 'name' | 'onChange'> & Omit<FormValueItemProps, 'value' | 'label' | 'fullWidth' | 'disabled' | 'error'> & {
7
+ export type FormTextFieldProps<T = FormTextFieldValue, AllowUndefinedValue extends boolean = true, V = AllowUndefinedValue extends true ? T | undefined : T> = Omit<TextFieldProps, 'ref' | 'name' | 'value' | 'onChange'> & Omit<FormValueItemProps<T, AllowUndefinedValue>, 'label' | 'fullWidth' | 'disabled' | 'error'> & {
7
8
  icon?: string;
8
9
  clear?: boolean;
9
10
  maxLength?: number;
@@ -15,6 +16,6 @@ export type FormTextFieldProps = Omit<TextFieldProps, 'ref' | 'name' | 'onChange
15
16
  noFormValueItem?: boolean;
16
17
  hidden?: boolean;
17
18
  disableReturnKey?: boolean;
18
- onValue?(value: FormItemValue): FormItemValue;
19
+ onValue?(value: V): V;
19
20
  };
20
21
  export declare const FormTextFieldDefaultProps: {};
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { FormTextareaProps as Props } from './FormTextarea.types';
3
- import { FormValueItemBaseCommands } from '../../@types';
2
+ import { FormTextareaProps as Props, FormTextareaCommands } from './FormTextarea.types';
4
3
  import './FormTextarea.scss';
5
- declare const FormTextarea: React.ForwardRefExoticComponent<Props & React.RefAttributes<FormValueItemBaseCommands<any>>>;
4
+ declare const FormTextarea: React.ForwardRefExoticComponent<Props & React.RefAttributes<FormTextareaCommands>>;
6
5
  export default FormTextarea;
@@ -1,3 +1,5 @@
1
- import { FormTextFieldProps } from '../FormTextField';
2
- export type FormTextareaProps = Omit<FormTextFieldProps, 'disableReturnKey' | 'type' | 'multiline' | 'minRows' | 'maxRows'>;
1
+ import { FormTextFieldProps, FormTextFieldCommands } from '../FormTextField';
2
+ export type FormTextareaValue = string;
3
+ export type FormTextareaCommands = FormTextFieldCommands<FormTextareaValue, false>;
4
+ export type FormTextareaProps = Omit<FormTextFieldProps<FormTextareaValue, false>, 'disableReturnKey' | 'type' | 'multiline' | 'minRows' | 'maxRows'>;
3
5
  export declare const FormTextareaDefaultProps: Pick<FormTextareaProps, 'clear' | 'rows' | 'value'>;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
2
  import { FormUrlProps as Props } from './FormUrl.types';
3
- import { FormValueItemBaseCommands } from '../../@types';
4
- declare const FormUrl: React.ForwardRefExoticComponent<Props & React.RefAttributes<FormValueItemBaseCommands<any>>>;
3
+ declare const FormUrl: React.ForwardRefExoticComponent<Props & React.RefAttributes<import("../FormText").FormTextCommands>>;
5
4
  export default FormUrl;
@@ -1,3 +1,5 @@
1
- import { FormTextProps } from '../FormText';
1
+ import { FormTextProps, FormTextValue, FormTextCommands } from '../FormText';
2
+ export type FormUrlValue = FormTextValue;
3
+ export type FormUrlCommands = FormTextCommands;
2
4
  export type FormUrlProps = Omit<FormTextProps, 'type'>;
3
5
  export declare const FormUrlDefaultProps: Pick<FormUrlProps, 'validPattern'>;