@ehfuse/mui-form-controls 3.1.15 → 3.1.17

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
@@ -356,7 +356,8 @@ export type PhoneTextFieldProps = Omit<TextFieldProps, "type"> & BaseTextFieldPr
356
356
  * 숫자 텍스트 필드 타입
357
357
  */
358
358
  export type NumberTextFieldProps = Omit<TextFieldProps, "type"> & BaseTextFieldProps & {
359
- thousandSeparator?: boolean;
359
+ /** `false` 끔 · `true`/`undefined` 콤마(`,`) · `string` 구분 문자 지정 (예: `"."`, `" "`) */
360
+ thousandSeparator?: boolean | string;
360
361
  decimalLength?: number;
361
362
  decimalFixed?: boolean;
362
363
  textAlign?: "left" | "center" | "right";
@@ -529,6 +530,11 @@ export type BizNumTextFieldProps = Omit<TextFieldProps, "type" | "value"> & Base
529
530
  fontColor?: string;
530
531
  fontFamily?: string;
531
532
  };
533
+ /** CardNumTextField ref — `focus()`는 이어 쓸 위치로, `blur()`는 포커스 해제 */
534
+ export type CardNumTextFieldHandle = {
535
+ focus: () => void;
536
+ blur: () => void;
537
+ };
532
538
  /**
533
539
  * 카드번호 텍스트 필드 타입
534
540
  */
@@ -8,7 +8,8 @@
8
8
  export { isLeapYear, getDaysInMonth, getSeparator, formatDate, getMaxLength, getCompleteLength, parseDateParts, validateDate, parseToDate, clampDateValue, extractDateFormat, hasSecondField, constrainDateNumbers, formatDateValue, formatToPlaceholder, getSegmentRange, hasYearInFormat, has2DigitYear, convertYY2YYYY, parseDateWithInternalYear, buildDateOutputValue, dateToNumbers, tryParsePastedDateTimeClipboard, tryParsePastedDateClipboard, } from "./date";
9
9
  export type { ParsedPasteDateTime, ParsedPasteDateOnly } from "./date";
10
10
  export { getTimeFieldCount, is12HourFormat, validateTime, clampTimeValue, } from "./time";
11
- export { formatNumber, parseNumber } from "./number";
11
+ export { clampNumberToRange, formatNumber, formatNumberFieldDisplay, isThousandGroupingEnabled, parseNumber, resolveThousandSeparator, stripGroupingFromInput, } from "./number";
12
+ export type { ResolvedThousandSeparator, ThousandSeparatorProp, } from "./number";
12
13
  export { DEFAULT_EMAIL_DOMAINS, validateEmail } from "./email";
13
14
  export { formatPhoneNumber, getPhoneMaxLength } from "./phone";
14
15
  export { DEFAULT_SPECIAL_CHARS, DEFAULT_PASSWORD_VALIDATION_RULES, validatePassword, } from "./password";
@@ -5,11 +5,43 @@
5
5
  * @copyright 2025 김영진 (Kim Young Jin)
6
6
  * @author 김영진 (ehfuse@gmail.com)
7
7
  */
8
+ /** `false` 끔 · `true`/`undefined` 기본 그룹 · `string` 구분 문자 직접 지정 */
9
+ export type ThousandSeparatorProp = boolean | string | undefined;
10
+ export type ResolvedThousandSeparator = {
11
+ enabled: false;
12
+ } | {
13
+ enabled: true;
14
+ kind: "intl";
15
+ } | {
16
+ enabled: true;
17
+ kind: "char";
18
+ char: string;
19
+ };
20
+ /**
21
+ * thousandSeparator 해석
22
+ * @param intlWhenTrue `true`/`undefined`일 때 Intl 그룹(NumberField), 아니면 `,`(NumberTextField)
23
+ */
24
+ export declare function resolveThousandSeparator(value: ThousandSeparatorProp, options?: {
25
+ intlWhenTrue?: boolean;
26
+ }): ResolvedThousandSeparator;
27
+ export declare function isThousandGroupingEnabled(value: ThousandSeparatorProp, options?: {
28
+ intlWhenTrue?: boolean;
29
+ }): boolean;
30
+ /** 표시 문자열에서 천 단위 구분 문자 제거 */
31
+ export declare function stripGroupingFromInput(value: string, thousandSeparator: ThousandSeparatorProp, options?: {
32
+ intlWhenTrue?: boolean;
33
+ }): string;
8
34
  /**
9
35
  * 숫자 포맷팅 함수
10
36
  */
11
- export declare function formatNumber(value: string, thousandSeparator: boolean, decimalLength?: number): string;
37
+ export declare function formatNumber(value: string, thousandSeparator: ThousandSeparatorProp, decimalLength?: number): string;
12
38
  /**
13
39
  * 표시 값에서 실제 숫자 값 추출
14
40
  */
15
- export declare function parseNumber(displayValue: string): string;
41
+ export declare function parseNumber(displayValue: string, thousandSeparator?: ThousandSeparatorProp): string;
42
+ /** min/max 범위로 숫자 값 보정 (경계 미지정 시 해당 방향은 보정하지 않음) */
43
+ export declare function clampNumberToRange(value: number | null | undefined, min?: number, max?: number): number | null;
44
+ /** NumberField 입력란에 표시할 포맷 문자열 */
45
+ export declare function formatNumberFieldDisplay(value: number, locale?: Intl.LocalesArgument, format?: Intl.NumberFormatOptions, thousandSeparator?: ThousandSeparatorProp, options?: {
46
+ intlWhenTrue?: boolean;
47
+ }): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ehfuse/mui-form-controls",
3
- "version": "3.1.15",
3
+ "version": "3.1.17",
4
4
  "description": "Material-UI form controls and text fields for complex forms",
5
5
  "private": false,
6
6
  "publishConfig": {