@ehfuse/mui-form-controls 3.1.16 → 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";
@@ -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 { clampNumberToRange, formatNumber, formatNumberFieldDisplay, 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,15 +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;
16
42
  /** min/max 범위로 숫자 값 보정 (경계 미지정 시 해당 방향은 보정하지 않음) */
17
43
  export declare function clampNumberToRange(value: number | null | undefined, min?: number, max?: number): number | null;
18
44
  /** NumberField 입력란에 표시할 포맷 문자열 */
19
- export declare function formatNumberFieldDisplay(value: number, locale?: Intl.LocalesArgument, format?: Intl.NumberFormatOptions): string;
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.16",
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": {