@ehfuse/mui-form-controls 3.3.15 → 3.4.1
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/FormControlsConfig.d.ts +7 -1
- package/dist/MonthTextField.d.ts +8 -0
- package/dist/PeriodTextField.d.ts +26 -0
- package/dist/YearTextField.d.ts +8 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +52 -2
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +52 -2
- package/dist/index.mjs.map +4 -4
- package/dist/types.d.ts +17 -0
- package/package.json +2 -2
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* FormControlsConfig.tsx
|
|
3
3
|
*
|
|
4
4
|
* 앱 전체에 걸 기본값 — 날짜·시간 칸마다 prop 을 달지 않고 한 곳에서 켠다.
|
|
5
|
-
*
|
|
5
|
+
* `pickerCentered`(달력·시간 선택을 칸 옆 팝오버 대신 화면 가운데 창으로)와
|
|
6
|
+
* `timePickerVariant`(시간을 숫자 목록 대신 [오전/오후][시][분] 바퀴로 고르기 — 휴대폰 터치용)가 있다.
|
|
6
7
|
* 휴대폰에서는 칸 바로 아래 뜨는 팝오버가 화면 끝에 걸리거나 키보드·하단 막대에 가려 쓰기 불편해서,
|
|
7
8
|
* 앱이 좁은 화면일 때만 `<FormControlsConfigProvider pickerCentered>` 로 감싸 쓰게 한다.
|
|
8
9
|
* 칸에 `pickerCentered` 를 직접 주면 그 값이 이긴다. Provider 가 없으면 예전 동작(팝오버) 그대로다.
|
|
@@ -15,10 +16,15 @@ import { type ReactNode } from "react";
|
|
|
15
16
|
/** 앱 전체 기본값. */
|
|
16
17
|
export interface FormControlsConfig {
|
|
17
18
|
pickerCentered?: boolean;
|
|
19
|
+
timePickerVariant?: TimePickerVariant;
|
|
18
20
|
}
|
|
21
|
+
/** 시간 고르는 방식 — "list" 숫자 목록(기본) · "wheel" [오전/오후][시][분] 바퀴. */
|
|
22
|
+
export type TimePickerVariant = "list" | "wheel";
|
|
19
23
|
/** 앱 전체 기본값을 건다. */
|
|
20
24
|
export declare function FormControlsConfigProvider({ children, ...config }: FormControlsConfig & {
|
|
21
25
|
children: ReactNode;
|
|
22
26
|
}): import("react/jsx-runtime").JSX.Element;
|
|
23
27
|
/** 칸 값이 있으면 그것을, 없으면 앱 기본값을 쓴다(날짜·시간 칸 안에서 부른다). */
|
|
24
28
|
export declare function usePickerCentered(own: boolean | undefined): boolean;
|
|
29
|
+
/** 시간 고르는 방식 — 칸 값 → 앱 기본값 → "list"(예전 동작) 순. */
|
|
30
|
+
export declare function useTimePickerVariant(own: TimePickerVariant | undefined): TimePickerVariant;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MonthTextField.tsx — 년월 입력칸. 값은 "YYYY-MM", 칸을 벗어나면 "2026년 11월" 로 보이고, 달력은 월만 고른다.
|
|
3
|
+
*
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright 2025 김영진 (Kim Young Jin)
|
|
6
|
+
* @author 김영진 (ehfuse@gmail.com)
|
|
7
|
+
*/
|
|
8
|
+
export declare const MonthTextField: import("react").ForwardRefExoticComponent<Omit<import("./types").PeriodTextFieldProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PeriodTextField.tsx — 년월(MonthTextField) · 년도(YearTextField) 입력칸의 공용 바탕
|
|
3
|
+
*
|
|
4
|
+
* 값은 "YYYY-MM"(년월) · "YYYY"(년도) 문자열로 주고받는다.
|
|
5
|
+
* - 칸을 벗어나 있으면 "2026년 11월" · "2026년" 처럼 읽기 좋은 글로 보인다(displayFormat 으로 바꾼다).
|
|
6
|
+
* - 칸을 누르면 숫자로 친다("2026-11" · "2026") — 칸을 벗어날 때 완성된 값이면 알리고, 덜 쳤으면 이전 값으로 돌린다.
|
|
7
|
+
* - 달력 아이콘은 월만(년도만) 고르는 달력을 연다(@ehfuse/mui-datetime-picker 의 monthOnly · yearOnly).
|
|
8
|
+
*
|
|
9
|
+
* DateTextField 의 format="YYYY-MM" 는 날짜 칸이라 달력이 날짜를 고르게 했고 표시도 숫자뿐이었다 — 달 · 해만 다루는 칸을 따로 둔다.
|
|
10
|
+
*
|
|
11
|
+
* @license MIT
|
|
12
|
+
* @copyright 2025 김영진 (Kim Young Jin)
|
|
13
|
+
* @author 김영진 (ehfuse@gmail.com)
|
|
14
|
+
*/
|
|
15
|
+
import React from "react";
|
|
16
|
+
export type PeriodMode = "month" | "year";
|
|
17
|
+
/** 년월 · 년도 칸 — readonly/disabled 는 읽기 좋은 글 박스로, form 이 있으면 form 에 묶는다. */
|
|
18
|
+
export declare const PeriodTextField: React.ForwardRefExoticComponent<Omit<Omit<import("./types").TextFieldProps, "type"> & import("./types").BaseTextFieldProps & {
|
|
19
|
+
displayFormat?: (year: number, month: number) => string;
|
|
20
|
+
minDate?: Date;
|
|
21
|
+
maxDate?: Date;
|
|
22
|
+
calendarIcon?: boolean;
|
|
23
|
+
pickerCentered?: boolean;
|
|
24
|
+
} & {
|
|
25
|
+
mode: PeriodMode;
|
|
26
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YearTextField.tsx — 년도 입력칸. 값은 "YYYY", 칸을 벗어나면 "2026년" 으로 보이고, 달력은 년도만 고른다.
|
|
3
|
+
*
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright 2025 김영진 (Kim Young Jin)
|
|
6
|
+
* @author 김영진 (ehfuse@gmail.com)
|
|
7
|
+
*/
|
|
8
|
+
export declare const YearTextField: import("react").ForwardRefExoticComponent<Omit<import("./types").PeriodTextFieldProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* @copyright 2025 김영진 (Kim Young Jin)
|
|
6
6
|
* @author 김영진 (ehfuse@gmail.com)
|
|
7
7
|
*/
|
|
8
|
-
export { FormControlsConfigProvider, usePickerCentered } from "./FormControlsConfig";
|
|
9
|
-
export type { FormControlsConfig } from "./FormControlsConfig";
|
|
8
|
+
export { FormControlsConfigProvider, usePickerCentered, useTimePickerVariant } from "./FormControlsConfig";
|
|
9
|
+
export type { FormControlsConfig, TimePickerVariant } from "./FormControlsConfig";
|
|
10
10
|
export { SearchTextField } from "./SearchTextField";
|
|
11
11
|
export { ClearTextField } from "./ClearTextField";
|
|
12
12
|
export { TagsTextField } from "./TagsTextField";
|
|
@@ -36,6 +36,8 @@ export { isJuminValueValid, isJuminValueInvalidState, sanitizeJuminFrontBirthDig
|
|
|
36
36
|
export { VerificationCodeTextField } from "./VerificationCodeTextField";
|
|
37
37
|
export { EmailTextField } from "./EmailTextField";
|
|
38
38
|
export { DateTextField } from "./DateTextField";
|
|
39
|
+
export { MonthTextField } from "./MonthTextField";
|
|
40
|
+
export { YearTextField } from "./YearTextField";
|
|
39
41
|
export { TimeTextField } from "./TimeTextField";
|
|
40
42
|
export { DateTimeTextField } from "./DateTimeTextField";
|
|
41
43
|
export { BizNumTextField } from "./BizNumTextField";
|
|
@@ -49,4 +51,4 @@ export { ReadonlyDisplay } from "./components/ReadonlyDisplay";
|
|
|
49
51
|
export type { ReadonlyDisplayProps } from "./components/ReadonlyDisplay";
|
|
50
52
|
export { ReadonlyField, shouldRenderReadonlyBox, } from "./components/ReadonlyField";
|
|
51
53
|
export { CardIcon, VisaIcon, MastercardIcon, AmexIcon, JcbIcon, DinersIcon, DiscoverIcon, UnionPayIcon, BcIcon, } from "./icons";
|
|
52
|
-
export type { SearchTextFieldProps, ClearTextFieldProps, TagsTextFieldProps, PasswordTextFieldProps, TextFieldProps, TextAreaProps, CheckboxProps, SwitchProps, RadioGroupProps, RadioOption, DateRangeProps, SliderProps, RatingProps, ToggleButtonProps, ToggleButtonGroupProps, ToggleButtonGroupOption, ButtonGroupProps, StepperProps, AutocompleteProps, AutocompleteOption, SelectProps, SelectOption, LabelSelectProps, LabelSelectOption, AddressTextFieldProps, DaumPostcodeData, PasswordValidationRules, PasswordValidationResult, PhoneTextFieldProps, PhoneFormat, NumberTextFieldProps, JuminTextFieldProps, JuminInfo, VerificationCodeTextFieldProps, VerificationCodeType, EmailTextFieldProps, CustomDomain, DateTextFieldProps, DateFormat, TimeTextFieldProps, TimeFormat, DateTimeTextFieldProps, DateTimeFormat, BizNumTextFieldProps, CorpNumTextFieldProps, CardNumTextFieldProps, CardNumTextFieldHandle, BankAccountTextFieldProps, BankAccountVerifyRequest, BankAccountVerifyResult, BankAccountVerifyStatus, SelectChangeEvent, } from "./types";
|
|
54
|
+
export type { SearchTextFieldProps, ClearTextFieldProps, TagsTextFieldProps, PasswordTextFieldProps, TextFieldProps, TextAreaProps, CheckboxProps, SwitchProps, RadioGroupProps, RadioOption, DateRangeProps, SliderProps, RatingProps, ToggleButtonProps, ToggleButtonGroupProps, ToggleButtonGroupOption, ButtonGroupProps, StepperProps, AutocompleteProps, AutocompleteOption, SelectProps, SelectOption, LabelSelectProps, LabelSelectOption, AddressTextFieldProps, DaumPostcodeData, PasswordValidationRules, PasswordValidationResult, PhoneTextFieldProps, PhoneFormat, NumberTextFieldProps, JuminTextFieldProps, JuminInfo, VerificationCodeTextFieldProps, VerificationCodeType, EmailTextFieldProps, CustomDomain, DateTextFieldProps, MonthTextFieldProps, YearTextFieldProps, PeriodTextFieldProps, DateFormat, TimeTextFieldProps, TimeFormat, DateTimeTextFieldProps, DateTimeFormat, BizNumTextFieldProps, CorpNumTextFieldProps, CardNumTextFieldProps, CardNumTextFieldHandle, BankAccountTextFieldProps, BankAccountVerifyRequest, BankAccountVerifyResult, BankAccountVerifyStatus, SelectChangeEvent, } from "./types";
|