@ehfuse/mui-form-controls 3.5.6 → 3.5.7

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.
@@ -13,6 +13,18 @@ import type { SxProps, Theme } from "@mui/material";
13
13
  import { type PropertyAppearance } from "./appearance";
14
14
  import { type PropertyRowLayoutProps } from "./PropertyRow";
15
15
  import { type PropertyBindingProps } from "./binding";
16
+ /**
17
+ * 속성 칸의 자동 꼴(3.5.7) — "phone" 은 치는 대로 하이픈(010-1234-5678 · 02-123-4567 · 1588-0000), "number" 는 천 단위 쉼표(1,234,000).
18
+ * 쉼표는 보이기만 하고 저장(onCommit)에는 쉼표 없는 숫자 글이 간다. 전화는 하이픈을 넣은 꼴 그대로 저장한다(폼의 PhoneTextField includeDash 와 같다).
19
+ */
20
+ export type PropertyInputFormat = "phone" | "number";
21
+ /**
22
+ * 전화번호 꼴 — 숫자 · 하이픈 · 공백만 친 글에 하이픈을 넣는다. 국제번호(+82) · 내선(내선 12) 같은 글은 친 그대로 둔다.
23
+ * 끝에 붙는 하이픈("010-")은 뺀다 — 지우는 중에 하이픈이 되살아나 Backspace 가 걸리지 않게, 덜 친 번호가 "010-" 으로 저장되지 않게.
24
+ */
25
+ export declare function formatPropertyPhone(raw: string): string;
26
+ /** 천 단위 쉼표 — 숫자가 아닌 글은 그대로 둔다(검사는 parse · onCommit 이 한다). */
27
+ export declare function formatPropertyNumber(raw: string): string;
16
28
  export interface PropertyInputProps extends PropertyBindingProps<string> {
17
29
  placeholder?: string;
18
30
  multiline?: boolean;
@@ -29,6 +41,11 @@ export interface PropertyInputProps extends PropertyBindingProps<string> {
29
41
  * 저장 전에 친 글을 바꾼다(전화번호 하이픈 · 8자리 날짜 등). null 을 돌려주면 틀린 값 — 저장하지 않고 되돌린다.
30
42
  */
31
43
  parse?: (raw: string) => string | null;
44
+ /**
45
+ * 자동 꼴(3.5.7) — "phone" 은 치는 대로 하이픈, "number" 는 천 단위 쉼표(저장은 쉼표 없는 숫자 글). inputMode 를 안 주면 tel · numeric 이 된다.
46
+ * 사업자번호 · 주민번호처럼 제 꼴이 있는 번호, 연도 · 우편번호처럼 쉼표가 어색한 숫자에는 주지 않는다.
47
+ */
48
+ format?: PropertyInputFormat;
32
49
  /** Esc 로 고치기를 물린다(창이 닫히지 않게 이벤트를 멈춘다). 기본 true. */
33
50
  escapeReverts?: boolean;
34
51
  /** 한글 조합 중의 Enter 에도 칸을 벗어난다(예전 업무함 동작). 기본 false — 조합을 마치는 Enter 는 그대로 둔다. */
@@ -8,10 +8,11 @@
8
8
  export { DEFAULT_PROPERTY_APPEARANCE, usePropertyAppearance } from "./appearance";
9
9
  export type { PropertyAppearance } from "./appearance";
10
10
  export { PropertyRow, PropertyGrid, PropertyEmpty, PROPERTY_GRID_TWO_COLUMN_MIN, PROPERTY_GRID_FOUR_COLUMN_MIN, PROPERTY_GRID_FOUR_CQ, } from "./PropertyRow";
11
+ export type { PropertyInputFormat } from "./PropertyText";
11
12
  export type { PropertyRowProps, PropertyRowLayoutProps, PropertyGridProps } from "./PropertyRow";
12
13
  export { withPropertyForm, writeFormValue } from "./binding";
13
14
  export type { PropertyBindingProps, PropertyCommitHandler } from "./binding";
14
- export { PropertyInput, PROPERTY_BORDERED_SX, PropertyText, PropertyTextArea, PropertyDate, PropertyDateInput, PropertyTextDate, PropertyTextDateInput, isDateText, normalizeDateText, parseDateText } from "./PropertyText";
15
+ export { formatPropertyNumber, formatPropertyPhone, PropertyInput, PROPERTY_BORDERED_SX, PropertyText, PropertyTextArea, PropertyDate, PropertyDateInput, PropertyTextDate, PropertyTextDateInput, isDateText, normalizeDateText, parseDateText } from "./PropertyText";
15
16
  export type { PropertyInputProps, PropertyTextProps, PropertyDateInputProps } from "./PropertyText";
16
17
  export { PropertySelect, PropertyMultiSelect, PropertySwitch } from "./PropertySelect";
17
18
  export type { PropertyOption, PropertySelectValue, PropertySelectProps, PropertyMultiSelectProps, PropertySwitchProps } from "./PropertySelect";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ehfuse/mui-form-controls",
3
- "version": "3.5.6",
3
+ "version": "3.5.7",
4
4
  "description": "Material-UI form controls and text fields for complex forms",
5
5
  "private": false,
6
6
  "publishConfig": {