@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/README.md CHANGED
@@ -327,7 +327,7 @@ import { AddressTextField } from '@ehfuse/mui-form-controls/address';
327
327
  | `stepperAccelerateHoldDelay` | 누른 직후 1회 변경 후, 자동 반복까지 대기(ms) |
328
328
  | `stepperAccelerateRampDuration` | 시작 CPS→최대 CPS까지 걸리는 시간(ms) |
329
329
  | `stepperAccelerateCps` | 자동 반복 **시작** 속도 (초당 횟수) |
330
- | `thousandSeparator` | 기본 `true`(천 단위 그룹·입력 표시). `false`로 끔. Intl·로케일 규칙(`NumberTextField`의 콤마 고정과 다를 있음) |
330
+ | `thousandSeparator` | `boolean \| string` 기본 `true`. `false` · `string` 구분 문자 고정 · NumberField는 `true`일 때 Intl |
331
331
 
332
332
  `stepperEditable`, `stepperButtonDivider`, `spinnerDivider` 등 전체 props는 [API](./docs/ko/api.md#numberfield)를 참고하세요.
333
333
 
@@ -2,6 +2,7 @@ import * as React from "react";
2
2
  import { NumberField as BaseNumberField } from "@base-ui/react/number-field";
3
3
  import type { SxProps, Theme } from "@mui/material/styles";
4
4
  import type { FormLike } from "../types";
5
+ import { type ThousandSeparatorProp } from "../utils/number";
5
6
  export type NumberFieldVariant = "default" | "stepper";
6
7
  export type NumberFieldAlign = "left" | "center" | "right";
7
8
  export type NumberFieldProps = BaseNumberField.Root.Props & {
@@ -14,12 +15,13 @@ export type NumberFieldProps = BaseNumberField.Root.Props & {
14
15
  /** 입력 숫자 텍스트 정렬 방향. */
15
16
  align?: NumberFieldAlign;
16
17
  /**
17
- * 천 단위 구분자(표시·입력 모두 Base UI `Intl.NumberFormat`, 로케일 규칙).
18
- * `false`이면 천 단위 구분 없음. 그 외(기본)는 `format.useGrouping: true` 병합.
19
- * `format`·`locale`과 함께 사용 가능.
18
+ * 천 단위 구분.
19
+ * - `false`: 구분 없음
20
+ * - `true` / `undefined`(기본): `Intl` 로케일 규칙 (`locale`·`format`과 함께)
21
+ * - `string`: 구분 문자 직접 지정 (예: `","`, `"."`, `" "`)
20
22
  * @default true
21
23
  */
22
- thousandSeparator?: boolean;
24
+ thousandSeparator?: ThousandSeparatorProp;
23
25
  /** @default "default" — `stepper`는 [-] 값 [+] 가로 스테퍼 UI */
24
26
  variant?: NumberFieldVariant;
25
27
  /**
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { NumberField as BaseNumberField } from "@base-ui/react/number-field";
3
+ import { type ThousandSeparatorProp } from "../utils/number";
3
4
  type NumberSpinnerProps = BaseNumberField.Root.Props & {
4
5
  label?: React.ReactNode;
5
6
  size?: "small" | "medium";
@@ -7,9 +8,9 @@ type NumberSpinnerProps = BaseNumberField.Root.Props & {
7
8
  suffix?: React.ReactNode;
8
9
  /**
9
10
  * 천 단위 구분자(표시·입력, `Intl.NumberFormat`). `true`이면 `format.useGrouping: true` 병합.
10
- * @default true
11
+ * @default true — `string`이면 해당 문자로 그룹
11
12
  */
12
- thousandSeparator?: boolean;
13
+ thousandSeparator?: ThousandSeparatorProp;
13
14
  };
14
15
  export default function NumberSpinner({ id: idProp, label, error, size, suffix, thousandSeparator, locale, format, ...other }: NumberSpinnerProps): import("react/jsx-runtime").JSX.Element;
15
16
  export {};
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * useNumberFieldLiveGrouping.ts
3
3
  *
4
- * NumberField + thousandSeparator — 입력 중에도 천 단위 구분 표시
5
- * (Base UI는 타이핑 중 raw 숫자만 보여 주므로 표시값을 보조)
4
+ * NumberField — 입력 천 단위 구분 표시
6
5
  *
7
6
  * @license MIT
8
7
  * @copyright 2025 김영진 (Kim Young Jin)
9
8
  * @author 김영진 (ehfuse@gmail.com)
10
9
  */
11
10
  import * as React from "react";
12
- export declare function useNumberFieldLiveGrouping({ enabled, locale, format, }: {
13
- enabled: boolean;
11
+ import { type ThousandSeparatorProp } from "../utils/number";
12
+ export declare function useNumberFieldLiveGrouping({ thousandSeparator, locale, format, }: {
13
+ thousandSeparator?: ThousandSeparatorProp;
14
14
  locale?: Intl.LocalesArgument;
15
15
  format?: Intl.NumberFormatOptions;
16
16
  }): {
@@ -9,11 +9,13 @@
9
9
  */
10
10
  import * as React from "react";
11
11
  import type { NumberFieldRoot } from "@base-ui/react/number-field";
12
- export declare function useNumberFieldValueChange({ min, max, locale, format, onValueChange, inputRef, isControlled, setInternalValue, onLiveDisplaySync, }: {
12
+ import { type ThousandSeparatorProp } from "../utils/number";
13
+ export declare function useNumberFieldValueChange({ min, max, locale, format, thousandSeparator, onValueChange, inputRef, isControlled, setInternalValue, onLiveDisplaySync, }: {
13
14
  min?: number;
14
15
  max?: number;
15
16
  locale?: Intl.LocalesArgument;
16
17
  format?: Intl.NumberFormatOptions;
18
+ thousandSeparator?: ThousandSeparatorProp;
17
19
  onValueChange?: (value: number | null, eventDetails: NumberFieldRoot.ChangeEventDetails) => void;
18
20
  inputRef: React.RefObject<HTMLInputElement | null>;
19
21
  isControlled: boolean;