@ehfuse/mui-form-controls 1.3.19 → 1.3.20
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/README.md +34 -0
- package/dist/SwitchField.d.ts +10 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +8 -1
- package/dist/index.mjs.map +4 -4
- package/dist/types.d.ts +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,6 +42,7 @@ MUI 기반 폼 컨트롤과 텍스트 필드 컴포넌트 모음
|
|
|
42
42
|
| **Slider** | MUI Slider 래퍼 (폼 통합) | [API](./docs/ko/api.md#slider) |
|
|
43
43
|
| **Stepper** | 스텝 진행 표시 컴포넌트 | [API](./docs/ko/api.md#stepper) |
|
|
44
44
|
| **Switch** | MUI Switch 래퍼 (폼 통합) | [API](./docs/ko/api.md#switch) |
|
|
45
|
+
| **SwitchField** | 라벨 포함 Switch 필드 (`FormControlLabel` + `Switch`) | [API](./docs/ko/api.md#switchfield) |
|
|
45
46
|
| **ToggleButton** | 토글 버튼 컴포넌트 | [API](./docs/ko/api.md#togglebutton) |
|
|
46
47
|
|
|
47
48
|
## 훅 (Hooks)
|
|
@@ -102,6 +103,7 @@ import {
|
|
|
102
103
|
Checkbox,
|
|
103
104
|
RadioGroup,
|
|
104
105
|
Switch,
|
|
106
|
+
SwitchField,
|
|
105
107
|
Slider,
|
|
106
108
|
DateRange,
|
|
107
109
|
TextArea,
|
|
@@ -252,6 +254,38 @@ import {
|
|
|
252
254
|
/>
|
|
253
255
|
```
|
|
254
256
|
|
|
257
|
+
## Boolean 필드 표준 패턴
|
|
258
|
+
|
|
259
|
+
`Switch`를 boolean 입력의 기본 form-binding 컴포넌트로 사용합니다.
|
|
260
|
+
|
|
261
|
+
```tsx
|
|
262
|
+
import { Switch, SwitchField } from "@ehfuse/mui-form-controls";
|
|
263
|
+
|
|
264
|
+
// 1) 단일 스위치 (라벨 없음)
|
|
265
|
+
<Switch form={form} name="deceased_disability_certificate" />
|
|
266
|
+
|
|
267
|
+
// 2) 라벨 포함 스위치 (권장)
|
|
268
|
+
<SwitchField
|
|
269
|
+
form={form}
|
|
270
|
+
name="deceased_disability_certificate"
|
|
271
|
+
label="장애인 증명서 제출"
|
|
272
|
+
/>
|
|
273
|
+
|
|
274
|
+
// 3) readOnly / disabled
|
|
275
|
+
<SwitchField
|
|
276
|
+
form={form}
|
|
277
|
+
name="deceased_disability_certificate"
|
|
278
|
+
label="수정 불가 항목"
|
|
279
|
+
readonly
|
|
280
|
+
/>
|
|
281
|
+
<SwitchField
|
|
282
|
+
form={form}
|
|
283
|
+
name="deceased_disability_certificate"
|
|
284
|
+
label="비활성 항목"
|
|
285
|
+
disabled
|
|
286
|
+
/>
|
|
287
|
+
```
|
|
288
|
+
|
|
255
289
|
## 문서 / Documentation
|
|
256
290
|
|
|
257
291
|
- [한국어 문서](./docs/ko/getting-started.md)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SwitchField.tsx
|
|
3
|
+
*
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright 2025 김영진 (Kim Young Jin)
|
|
6
|
+
* @author 김영진 (ehfuse@gmail.com)
|
|
7
|
+
*/
|
|
8
|
+
import React from "react";
|
|
9
|
+
import type { SwitchFieldProps } from "./types";
|
|
10
|
+
export declare const SwitchField: React.ForwardRefExoticComponent<Omit<SwitchFieldProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export { TextArea } from "./TextArea";
|
|
|
13
13
|
export { Checkbox } from "./Checkbox";
|
|
14
14
|
export { RadioGroup } from "./RadioGroup";
|
|
15
15
|
export { Switch } from "./Switch";
|
|
16
|
+
export { SwitchField } from "./SwitchField";
|
|
16
17
|
export { Rating } from "./Rating";
|
|
17
18
|
export { ToggleButton } from "./ToggleButton";
|
|
18
19
|
export { ButtonGroup } from "./ButtonGroup";
|
|
@@ -37,4 +38,4 @@ export { BizNumTextField } from "./BizNumTextField";
|
|
|
37
38
|
export { CardNumTextField } from "./CardNumTextField";
|
|
38
39
|
export { useKoreanHolidays, useKoreanHolidaysRange } from "./hooks";
|
|
39
40
|
export { CardIcon, VisaIcon, MastercardIcon, AmexIcon, JcbIcon, DinersIcon, DiscoverIcon, UnionPayIcon, BcIcon, } from "./icons";
|
|
40
|
-
export type { SearchTextFieldProps, ClearTextFieldProps, PasswordTextFieldProps, TextFieldProps, TextAreaProps, CheckboxProps, SwitchProps, RadioGroupProps, RadioOption, DateRangeProps, SliderProps, RatingProps, ToggleButtonProps, ButtonGroupProps, StepperProps, AutocompleteProps, AutocompleteOption, SelectProps, SelectOption, LabelSelectProps, LabelSelectOption, PasswordValidationRules, PasswordValidationResult, PhoneTextFieldProps, PhoneFormat, AddressTextFieldProps, DaumPostcodeData, NumberTextFieldProps, JuminTextFieldProps, JuminInfo, VerificationCodeTextFieldProps, VerificationCodeType, EmailTextFieldProps, CustomDomain, DateTextFieldProps, DateFormat, TimeTextFieldProps, TimeFormat, DateTimeTextFieldProps, DateTimeFormat, BizNumTextFieldProps, CardNumTextFieldProps, SelectChangeEvent, } from "./types";
|
|
41
|
+
export type { SearchTextFieldProps, ClearTextFieldProps, PasswordTextFieldProps, TextFieldProps, TextAreaProps, CheckboxProps, SwitchProps, SwitchFieldProps, RadioGroupProps, RadioOption, DateRangeProps, SliderProps, RatingProps, ToggleButtonProps, ButtonGroupProps, StepperProps, AutocompleteProps, AutocompleteOption, SelectProps, SelectOption, LabelSelectProps, LabelSelectOption, PasswordValidationRules, PasswordValidationResult, PhoneTextFieldProps, PhoneFormat, AddressTextFieldProps, DaumPostcodeData, NumberTextFieldProps, JuminTextFieldProps, JuminInfo, VerificationCodeTextFieldProps, VerificationCodeType, EmailTextFieldProps, CustomDomain, DateTextFieldProps, DateFormat, TimeTextFieldProps, TimeFormat, DateTimeTextFieldProps, DateTimeFormat, BizNumTextFieldProps, CardNumTextFieldProps, SelectChangeEvent, } from "./types";
|