@ehfuse/mui-form-controls 3.0.58 → 3.0.60

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/types.d.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import * as React from "react";
9
9
  import type { TextFieldProps as MuiTextFieldProps } from "@mui/material/TextField";
10
+ import type { ChipProps } from "@mui/material/Chip";
10
11
  import type { SxProps, Theme } from "@mui/material/styles";
11
12
  import type { CheckboxProps as MuiCheckboxProps } from "@mui/material/Checkbox";
12
13
  import type { SwitchProps as MuiSwitchProps } from "@mui/material/Switch";
@@ -271,6 +272,21 @@ export type ClearTextFieldProps = TextFieldProps & BaseTextFieldProps & {
271
272
  spellCheck?: boolean;
272
273
  onClear?: () => void;
273
274
  };
275
+ export type TagsTextFieldProps = Omit<TextFieldProps, "value" | "defaultValue" | "onChange" | "type" | "select" | "multiline"> & BaseTextFieldProps & {
276
+ value?: string[];
277
+ defaultValue?: string[];
278
+ onChange?: (value: string[]) => void;
279
+ separators?: string[];
280
+ allowDuplicates?: boolean;
281
+ maxTags?: number;
282
+ chipProps?: Partial<ChipProps>;
283
+ chipsSx?: SxProps<Theme>;
284
+ deleteIconSx?: SxProps<Theme>;
285
+ draggable?: boolean;
286
+ spaceToConfirm?: boolean;
287
+ backspaceToDelete?: boolean;
288
+ showDeleteIcon?: boolean;
289
+ };
274
290
  /**
275
291
  * 비밀번호 유효성 검사 규칙
276
292
  */
@@ -374,11 +390,16 @@ export type JuminInfo = {
374
390
  * 주민등록번호 텍스트 필드 타입
375
391
  *
376
392
  * **오류 표시(테두리·라벨)**: MUI `error`(TextField)와 emitChange와 동일한 내부 유효성(생일·13자·체크섬)을
377
- * `finalError = Boolean(error) || (내부 실패)`로 병합한다. `error === true`이면 내부가 유효해도 항상 오류 스타일.
393
+ * `finalError = Boolean(error) || (내부 실패)`로 병합한다. 내부 실패로 빨간 테두리는 마스킹 7자리·비마스킹 13자리가
394
+ * 모두 채워진 뒤에만 적용된다(입력 중에는 표시하지 않음). `error === true`이면 내부가 유효해도 항상 오류 스타일.
378
395
  *
379
396
  * `invalidBorderColor`(`ValidatableTextFieldProps`)는 `finalError`일 때
380
397
  * notched outline·`InputLabel`에 적용(미지정 시 `theme.palette.error`). `helperText` 색은 MUI 기본.
381
398
  *
399
+ * `showInvalidTooltip`이 `true`이면 `finalError`일 때 MUI `Tooltip`으로 안내 문구를 연다(오류가 해소되면 닫힌다).
400
+ * 툴팁은 `placement="top"`·`arrow`로 입력 영역(앵커)을 가리키는 화살표를 표시한다. 문구는 패키지 고정 한국어 문구를 쓴다.
401
+ *
402
+ * @see isJuminValueValid
382
403
  * @see isJuminValueInvalidState
383
404
  */
384
405
  export type JuminTextFieldProps = Omit<TextFieldProps, "type" | "onChange" | "value"> & BaseTextFieldProps & ValidatableTextFieldProps & {
@@ -391,6 +412,8 @@ export type JuminTextFieldProps = Omit<TextFieldProps, "type" | "onChange" | "va
391
412
  fontColor?: string;
392
413
  fontFamily?: string;
393
414
  onChange?: (info: JuminInfo) => void;
415
+ /** `true`이면 유효하지 않을 때(`finalError`) 툴팁 표시를 허용한다. 기본 `false`. */
416
+ showInvalidTooltip?: boolean;
394
417
  };
395
418
  /**
396
419
  * 커스텀 도메인 정의 (아이콘 포함)
@@ -14,4 +14,4 @@ export { DEFAULT_SPECIAL_CHARS, DEFAULT_PASSWORD_VALIDATION_RULES, validatePassw
14
14
  export { validateBusinessNumber } from "./biznum";
15
15
  export { validateCardNumber, detectCardBrand } from "./card";
16
16
  export type { CardBrand } from "./card";
17
- export { REGION_MAP, extractJuminInfo, validateJuminChecksum, validateJuminBirthDate, isJuminValueInvalidState, } from "./jumin";
17
+ export { REGION_MAP, extractJuminInfo, validateJuminChecksum, validateJuminBirthDate, isJuminValueValid, isJuminValueInvalidState, sanitizeJuminFrontBirthDigits, canAppendJuminBirthDigit, maxDayForJuminFrontYyMm, } from "./jumin";
@@ -25,9 +25,26 @@ export declare function validateJuminChecksum(numbers: string): boolean;
25
25
  * 주민등록번호 생년월일 유효성 검증
26
26
  */
27
27
  export declare function validateJuminBirthDate(numbers: string): boolean;
28
+ /**
29
+ * 앞 6자리(YYMMDD)만 있을 때, 성별코드가 없어 세기를 모르므로 19xx·20xx 중
30
+ * 해당 월의 일수가 더 큰 값을 사용한다(윤년·평년 모두 반영).
31
+ */
32
+ export declare function maxDayForJuminFrontYyMm(yy: string, mmStr: string): number;
33
+ /** YYMMDD 앞부분(prefix 0~5자리)에 한 자리를 붙일 수 있는지 */
34
+ export declare function canAppendJuminBirthDigit(prefix: string, digit: string): boolean;
35
+ /**
36
+ * 주민번호 앞 6자리(YYMMDD)에서 월(01~12)·일(해당 월 최대 일수) 규칙을 만족하는
37
+ * 최대 접두만 남긴다. 붙여넣기·입력 필터에 사용한다.
38
+ */
39
+ export declare function sanitizeJuminFrontBirthDigits(value: string): string;
40
+ /**
41
+ * 마스킹 7자리·비마스킹 13자리가 모두 채워졌을 때 전체 값이 유효한지.
42
+ * (`JuminTextField`의 `emitChange`·`onValidationChange`와 동일 규칙)
43
+ */
44
+ export declare function isJuminValueValid(fullValue: string, mask: boolean, validateChecksum: boolean): boolean;
28
45
  /**
29
46
  * JuminTextField(emitChange)와 동일한 규칙으로, 현재 앞/뒤 숫자를 이었을 때
30
47
  * 오류 UI(빨간 테두리)에 해당하는지. 값이 없으면 `false` (빨간 테두리 없음).
31
- * 부분 입력 중에도 (기존 동작) 오류로 처리된다.
48
+ * 마스킹 7자리·비마스킹 13자리가 모두 채워진 뒤에만 내부 유효성 실패 시 `true`이다.
32
49
  */
33
50
  export declare function isJuminValueInvalidState(fullValue: string, mask: boolean, validateChecksum: boolean): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ehfuse/mui-form-controls",
3
- "version": "3.0.58",
3
+ "version": "3.0.60",
4
4
  "description": "Material-UI form controls and text fields for complex forms",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -86,5 +86,11 @@
86
86
  "react-daum-postcode": {
87
87
  "optional": true
88
88
  }
89
+ },
90
+ "dependencies": {
91
+ "@dnd-kit/core": "^6.3.1",
92
+ "@dnd-kit/modifiers": "^9.0.0",
93
+ "@dnd-kit/sortable": "^10.0.0",
94
+ "@dnd-kit/utilities": "^3.2.2"
89
95
  }
90
96
  }