@pdg/react-form 1.0.81 → 1.0.82

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.
@@ -22,7 +22,7 @@ export interface FormValueMap {
22
22
  }
23
23
  export type FormValueItemData = Record<string, any>;
24
24
  export interface FormValueItemBaseCommands<T, AllowUndefinedValue extends boolean, V = AllowUndefinedValue extends true ? T | undefined : T> {
25
- getType(): 'default' | 'FormCheckbox' | 'FormToggleButtonGroup' | 'FormRadioGroup' | 'FormRating' | 'FormTextEditor' | 'FormAutocomplete' | 'FormDatePicker' | 'FormDateTimePicker' | 'FormTimePicker' | 'FormDateRangePicker' | 'FormMonthPicker' | 'FormMonthRangePicker' | 'FormYearPicker' | 'FormYearRangePicker' | 'FormFile';
25
+ getType(): 'default' | 'FormCheckbox' | 'FormToggleButtonGroup' | 'FormRadioGroup' | 'FormRating' | 'FormTextEditor' | 'FormAutocomplete' | 'FormDatePicker' | 'FormDateTimePicker' | 'FormTimePicker' | 'FormDateRangePicker' | 'FormMonthPicker' | 'FormMonthRangePicker' | 'FormYearPicker' | 'FormYearRangePicker' | 'FormFile' | 'FormSwitch';
26
26
  getName(): string;
27
27
  getReset(): V;
28
28
  reset(): void;
@@ -5,18 +5,45 @@ import { Dayjs } from 'dayjs';
5
5
  export declare function getDateValidationErrorText(error: DateValidationError | DateTimeValidationError): "형식이 일치하지 않습니다." | "선택할 수 없는 날짜입니다." | undefined;
6
6
  export declare function getDateTimeFormat(type: FormDateType, time?: FormTimeType): string;
7
7
  export declare function getDateTimeFormValueFormat(type: FormDateType, time?: FormTimeType): string;
8
+ /********************************************************************************************************************
9
+ * getAvailableDateValFormat
10
+ * ******************************************************************************************************************/
8
11
  export declare function getAvailableDateValFormat(type: FormAvailableDateType): string;
9
12
  export declare function getAvailableDateValFormat(type: FormDateType, time?: FormTimeType): string;
13
+ /********************************************************************************************************************
14
+ * getDateValFormat
15
+ * ******************************************************************************************************************/
10
16
  export declare function getDateValFormat(type: FormDateType, time?: FormTimeType): string;
17
+ /********************************************************************************************************************
18
+ * getAvailableDateType
19
+ * ******************************************************************************************************************/
11
20
  export declare function getAvailableDateType(type: FormDateType, time?: FormTimeType): FormAvailableDateType;
21
+ /********************************************************************************************************************
22
+ * makeAvailableDate
23
+ * ******************************************************************************************************************/
12
24
  export declare function makeAvailableDate(minDate: Dayjs | undefined, maxDate: Dayjs | undefined, disablePast: boolean, disableFuture: boolean): FormAvailableDate;
25
+ /********************************************************************************************************************
26
+ * getAvailableDate
27
+ * ******************************************************************************************************************/
13
28
  export declare function getAvailableDate(availableDate: FormAvailableDate, type: FormAvailableDateType): [Dayjs | null, Dayjs | null];
14
29
  export declare function getAvailableDate(availableDate: FormAvailableDate, type: FormDateType, time?: FormTimeType): [Dayjs | null, Dayjs | null];
30
+ /********************************************************************************************************************
31
+ * getAvailableDateVal
32
+ * ******************************************************************************************************************/
15
33
  export declare function getAvailableDateVal(availableDate: FormAvailableDate, type: FormAvailableDateType): [number | null, number | null];
16
34
  export declare function getAvailableDateVal(availableDate: FormAvailableDate, type: FormDateType, time?: FormTimeType): [number | null, number | null];
35
+ /********************************************************************************************************************
36
+ * getDateVal
37
+ * ******************************************************************************************************************/
17
38
  export declare function getDateValForAvailableDate(date: Dayjs, type: FormDateType, time?: FormTimeType): number;
39
+ /********************************************************************************************************************
40
+ * isDateAvailable
41
+ * ******************************************************************************************************************/
18
42
  export declare function isDateAvailable(date: Dayjs, availableDate: FormAvailableDate, type: FormAvailableDateType): boolean;
19
43
  export declare function isDateAvailable(date: Dayjs, availableDate: FormAvailableDate, type: FormDateType, time?: FormTimeType): boolean;
44
+ /********************************************************************************************************************
45
+ * checkDateAvailable
46
+ * ******************************************************************************************************************/
20
47
  export type checkDateAvailableResult = 'available' | 'min' | 'max';
21
48
  export declare function checkDateAvailable(date: Dayjs, availableDate: FormAvailableDate, type: FormAvailableDateType): checkDateAvailableResult;
22
49
  export declare function checkDateAvailable(date: Dayjs, availableDate: FormAvailableDate, type: FormDateType, time?: FormTimeType): checkDateAvailableResult;
@@ -9,10 +9,12 @@ export interface FormContextValue<T = any, AllowUndefinedValue extends boolean =
9
9
  onValueChange(name: string, value: T): void;
10
10
  onValueChangeByUser(name: string, value: T): void;
11
11
  onRequestSearchSubmit(name: string, value: T): void;
12
+ /** FormRow */
12
13
  formColAutoXs?: number;
13
14
  formColWidth?: number;
14
15
  onAddFormCol?(id: string, xs: number | undefined): void;
15
16
  onRemoveFormCol?(id: string): void;
17
+ /** FormCol */
16
18
  formColXs?: number;
17
19
  formColWithLabel?: boolean;
18
20
  formColWithHelperText?: boolean;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { FormSwitchProps as Props, FormSwitchCommands } from './FormSwitch.types';
3
+ declare const FormSwitch: React.ForwardRefExoticComponent<Props & React.RefAttributes<FormSwitchCommands>>;
4
+ export default FormSwitch;
@@ -0,0 +1,12 @@
1
+ import { FormValueItemProps, FormValueItemBaseCommands } from '../../@types';
2
+ import { CommonSxProps } from '../../@types';
3
+ import { ReactNode } from 'react';
4
+ import { FormControlLabelProps } from '@mui/material';
5
+ export interface FormSwitchProps extends CommonSxProps, Omit<FormValueItemProps<boolean, false>, 'fullWidth'> {
6
+ switchLabel?: ReactNode;
7
+ switchLabelProps?: Omit<FormControlLabelProps, 'children' | 'control' | 'label' | 'required' | 'disabled'>;
8
+ onValue?(value: boolean): boolean;
9
+ }
10
+ export declare const FormSwitchDefaultProps: {};
11
+ export interface FormSwitchCommands extends FormValueItemBaseCommands<boolean, false> {
12
+ }
@@ -0,0 +1,4 @@
1
+ import FormSwitch from './FormSwitch';
2
+ export default FormSwitch;
3
+ export { FormSwitch };
4
+ export * from './FormSwitch.types';
@@ -14,3 +14,4 @@ export * from './FormMonthPicker';
14
14
  export * from './FormMonthRangePicker';
15
15
  export * from './FormYearPicker';
16
16
  export * from './FormYearRangePicker';
17
+ export * from './FormSwitch';