@pdg/react-form 1.0.131 → 1.0.133

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.
@@ -9,9 +9,9 @@ export interface PrivateTimeSectionProps {
9
9
  width: number;
10
10
  cols: 1 | 2 | 3;
11
11
  availableDate: FormAvailableDate;
12
- hourSelectRef: React.RefObject<PrivateTimeSelectCommands>;
13
- minuteSelectRef: React.RefObject<PrivateTimeSelectCommands>;
14
- secondSelectRef: React.RefObject<PrivateTimeSelectCommands>;
12
+ hourSelectRef: React.RefObject<PrivateTimeSelectCommands | null>;
13
+ minuteSelectRef: React.RefObject<PrivateTimeSelectCommands | null>;
14
+ secondSelectRef: React.RefObject<PrivateTimeSelectCommands | null>;
15
15
  hours?: number[];
16
16
  minutes?: number[];
17
17
  seconds?: number[];
@@ -12,6 +12,7 @@ export interface FormProps extends CommonSxProps, PartialPick<FormControlProps,
12
12
  fullHeight?: boolean;
13
13
  formColGap?: number;
14
14
  disabled?: boolean;
15
+ submitWhenReturnKey?: boolean;
15
16
  onSubmit?(data: FormValueMap): void;
16
17
  onInvalid?(invalidItems: FormInvalidItems): void;
17
18
  onValueChange?(name: string, value: any): void;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { FormButtonProps as Props } from './FormButton.types';
3
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>>;
3
+ declare const _default: React.NamedExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
4
4
  export default _default;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { FormLabelProps as Props } from './FormLabel.types';
3
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLLabelElement>>>;
3
+ declare const _default: React.NamedExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLLabelElement>>;
4
4
  export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { FormContextValue } from './FormContext.types';
3
2
  declare const FormContext: import("react").Context<FormContextValue<any, true>>;
4
3
  export default FormContext;
@@ -4,10 +4,12 @@ export interface FormContextValue<T = any, AllowUndefinedValue extends boolean =
4
4
  id: string;
5
5
  fullHeight?: boolean;
6
6
  disabled?: boolean;
7
+ submitWhenReturnKey?: boolean;
7
8
  onAddValueItem(id: string, commands: FormValueItemCommands<T, AllowUndefinedValue>): void;
8
9
  onRemoveValueItem(id: string): void;
9
10
  onValueChange(name: string, value: T): void;
10
11
  onValueChangeByUser(name: string, value: T): void;
12
+ onRequestSubmit(name: string, value: T): void;
11
13
  onRequestSearchSubmit(name: string, value: T): void;
12
14
  /** FormRow */
13
15
  formColAutoXs?: number;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { FormAutocompleteProps, FormAutocompleteCommands, FormAutocompleteSingleValue } from './FormAutocomplete.types';
3
- declare const FormAutocomplete: (<T extends FormAutocompleteSingleValue, Multiple extends boolean | undefined>(props: FormAutocompleteProps<T, Multiple> & React.RefAttributes<FormAutocompleteCommands<T, Multiple>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & Pick<React.ForwardRefExoticComponent<any>, "displayName" | "propTypes" | "$$typeof">;
3
+ declare const FormAutocomplete: (<T extends FormAutocompleteSingleValue, Multiple extends boolean | undefined>(props: FormAutocompleteProps<T, Multiple> & React.RefAttributes<FormAutocompleteCommands<T, Multiple>>) => React.ReactElement | null) & Pick<React.ForwardRefExoticComponent<any>, "displayName" | "propTypes" | "$$typeof">;
4
4
  export default FormAutocomplete;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { FormRadioGroupProps, FormRadioGroupCommands, FormRadioGroupSingleValue } from './FormRadioGroup.types';
3
- declare const FormRadioGroup: (<T extends FormRadioGroupSingleValue>(props: FormRadioGroupProps<T> & React.RefAttributes<FormRadioGroupCommands<T>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & Pick<React.ForwardRefExoticComponent<any>, "displayName" | "propTypes" | "$$typeof">;
3
+ declare const FormRadioGroup: (<T extends FormRadioGroupSingleValue>(props: FormRadioGroupProps<T> & React.RefAttributes<FormRadioGroupCommands<T>>) => React.ReactElement | null) & Pick<React.ForwardRefExoticComponent<any>, "displayName" | "propTypes" | "$$typeof">;
4
4
  export default FormRadioGroup;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { FormToggleButtonGroupProps, FormToggleButtonGroupCommands, FormToggleButtonGroupSingleValue } from './FormToggleButtonGroup.types';
3
3
  import './FormToggleButtonGroup.scss';
4
- declare const FormToggleButtonGroup: (<T extends FormToggleButtonGroupSingleValue, Multiple extends boolean | undefined>(props: FormToggleButtonGroupProps<T, Multiple> & React.RefAttributes<FormToggleButtonGroupCommands<T, Multiple>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & Pick<React.ForwardRefExoticComponent<any>, "displayName" | "propTypes" | "$$typeof">;
4
+ declare const FormToggleButtonGroup: (<T extends FormToggleButtonGroupSingleValue, Multiple extends boolean | undefined>(props: FormToggleButtonGroupProps<T, Multiple> & React.RefAttributes<FormToggleButtonGroupCommands<T, Multiple>>) => React.ReactElement | null) & Pick<React.ForwardRefExoticComponent<any>, "displayName" | "propTypes" | "$$typeof">;
5
5
  export default FormToggleButtonGroup;
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { FormNumberCommands } from './FormNumber.types';
3
3
  declare const FormNumber: React.ForwardRefExoticComponent<Omit<import("../FormTextField").FormTextFieldProps<number>, "type"> & {
4
- allowNegative?: boolean | undefined;
5
- thousandSeparator?: boolean | undefined;
6
- allowDecimal?: boolean | undefined;
7
- decimalScale?: number | undefined;
8
- prefix?: string | undefined;
9
- suffix?: string | undefined;
4
+ allowNegative?: boolean;
5
+ thousandSeparator?: boolean;
6
+ allowDecimal?: boolean;
7
+ decimalScale?: number;
8
+ prefix?: string;
9
+ suffix?: string;
10
10
  } & React.RefAttributes<FormNumberCommands>>;
11
11
  export default FormNumber;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  declare const FormPersonalNo: React.ForwardRefExoticComponent<Omit<import("../FormText").FormTextProps, "value" | "type" | "maxLength"> & {
3
- value?: string | undefined;
4
- skipPersonalNumberValidateCheck?: boolean | undefined;
3
+ value?: string;
4
+ skipPersonalNumberValidateCheck?: boolean;
5
5
  } & React.RefAttributes<import("../FormText").FormTextCommands>>;
6
6
  export default FormPersonalNo;
@@ -1,15 +1,14 @@
1
1
  import React from 'react';
2
2
  import { FormSelectCommands, FormSelectSingleValue } from './FormSelect.types';
3
- import { FormTextFieldProps } from '../FormTextField';
4
3
  import './FormSelect.scss';
5
- declare const FormSelect: (<T extends FormSelectSingleValue, Multiple extends boolean | undefined>(props: Omit<FormTextFieldProps<import("./FormSelect.types").FormSelectValue<T, Multiple>, false>, "type" | "clear"> & {
4
+ declare const FormSelect: (<T extends FormSelectSingleValue, Multiple extends boolean | undefined>(props: Omit<import("../FormTextField").FormTextFieldProps<import("./FormSelect.types").FormSelectValue<T, Multiple>, false>, "type" | "clear"> & {
6
5
  items?: import("./FormSelect.types").FormSelectItems<T> | undefined;
7
6
  multiple?: Multiple | undefined;
8
- checkbox?: boolean | undefined;
9
- formValueSeparator?: string | undefined;
10
- formValueSort?: boolean | undefined;
11
- minWidth?: string | number | undefined;
12
- loading?: boolean | undefined;
7
+ checkbox?: boolean;
8
+ formValueSeparator?: string;
9
+ formValueSort?: boolean;
10
+ minWidth?: string | number;
11
+ loading?: boolean;
13
12
  onLoadItems?: (() => Promise<import("./FormSelect.types").FormSelectItem<T>[]>) | undefined;
14
- } & React.RefAttributes<FormSelectCommands<T, Multiple>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & Pick<React.ForwardRefExoticComponent<any>, "displayName" | "propTypes" | "$$typeof">;
13
+ } & React.RefAttributes<FormSelectCommands<T, Multiple>>) => React.ReactElement | null) & Pick<React.ForwardRefExoticComponent<any>, "displayName" | "propTypes" | "$$typeof">;
15
14
  export default FormSelect;
@@ -1,13 +1,12 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import { FormTagCommands, FormTagValue } from './FormTag.types';
3
- import './FormTag.scss';
4
3
  import { FormTextFieldProps } from '../FormTextField';
5
4
  declare const FormTag: React.ForwardRefExoticComponent<Omit<FormTextFieldProps<FormTagValue, false>, "type"> & {
6
- formValueSeparator?: string | undefined;
7
- formValueSort?: boolean | undefined;
8
- limitTags?: number | undefined;
9
- getLimitTagsText?: ((more: number) => React.ReactNode) | undefined;
10
- onAppendTag?: ((tag: string) => boolean) | undefined;
11
- onRemoveTag?: ((tag: string) => boolean) | undefined;
5
+ formValueSeparator?: string;
6
+ formValueSort?: boolean;
7
+ limitTags?: number;
8
+ getLimitTagsText?: (more: number) => ReactNode;
9
+ onAppendTag?: (tag: string) => boolean;
10
+ onRemoveTag?: (tag: string) => boolean;
12
11
  } & React.RefAttributes<FormTagCommands>>;
13
12
  export default FormTag;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { FormTagTextProps as Props } from './FormTagText.types';
3
+ import { FormTextCommands } from '../../FormText';
4
+ export declare const FormTagText: React.ForwardRefExoticComponent<Props & React.RefAttributes<FormTextCommands>>;
5
+ export default FormTagText;
@@ -0,0 +1,4 @@
1
+ import { FormTextProps } from '../../FormText';
2
+ export interface FormTagTextProps extends Omit<FormTextProps, 'value' | 'onChange'> {
3
+ onAppendTag(tag: string): void;
4
+ }
@@ -0,0 +1,4 @@
1
+ import FormTagText from './FormTagText';
2
+ export default FormTagText;
3
+ export { FormTagText };
4
+ export * from './FormTagText.types';
@@ -4,7 +4,7 @@ import { FormValueItemBaseCommands, FormValueItemProps } from '../../@types';
4
4
  export type FormTextFieldValue = any;
5
5
  export interface FormTextFieldCommands<T = FormTextFieldValue, AllowUndefinedValue extends boolean = true> extends FormValueItemBaseCommands<T, AllowUndefinedValue> {
6
6
  }
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
+ export type FormTextFieldProps<T = FormTextFieldValue, AllowUndefinedValue extends boolean = true, V = AllowUndefinedValue extends true ? T | undefined : T> = Omit<TextFieldProps, 'ref' | 'name' | 'value' | 'onChange' | 'InputProps' | 'InputLabelProps' | 'inputProps' | 'SelectProps' | 'FormHelperTextProps' | 'aria-dropeffect' | 'aria-grabbed'> & Omit<FormValueItemProps<T, AllowUndefinedValue>, 'label' | 'fullWidth' | 'disabled' | 'error'> & {
8
8
  icon?: string;
9
9
  clear?: boolean;
10
10
  maxLength?: number;
@@ -15,5 +15,6 @@ export type FormTextFieldProps<T = FormTextFieldValue, AllowUndefinedValue exten
15
15
  endAdornment?: ReactNode;
16
16
  noFormValueItem?: boolean;
17
17
  disableReturnKey?: boolean;
18
+ submitWhenReturnKey?: boolean;
18
19
  onValue?(value: V): V;
19
20
  };