@ehfuse/mui-form-controls 3.1.17 → 3.1.19

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.
@@ -24,6 +24,19 @@ export type NumberFieldProps = BaseNumberField.Root.Props & {
24
24
  thousandSeparator?: ThousandSeparatorProp;
25
25
  /** @default "default" — `stepper`는 [-] 값 [+] 가로 스테퍼 UI */
26
26
  variant?: NumberFieldVariant;
27
+ /**
28
+ * 값이 정확히 0일 때 입력칸을 빈칸으로 표시한다 (placeholder만 노출).
29
+ *
30
+ * 내부 값은 항상 숫자(0 포함)로 유지되므로 base-ui의 스피너 증감이 정상 동작한다
31
+ * (빈칸=0에서 ▲ → 1, 1에서 ▼ → 0=빈칸). 표시(렌더링)만 비우며,
32
+ * `onValueChange`로는 숫자 0이 그대로 전달된다. 포커스/입력 중에는 사용자가
33
+ * 타이핑한 값을 그대로 보여주고, 비포커스 상태에서만 0을 빈칸으로 표시한다.
34
+ *
35
+ * `default`·`stepper` 두 variant 모두에 적용된다.
36
+ * 0을 그대로 `0`으로 표시하려면 `clearWhenZero={false}`로 끈다.
37
+ * @default true
38
+ */
39
+ clearWhenZero?: boolean;
27
40
  /**
28
41
  * `variant="stepper"`일 때 가운데를 키패드·키보드로 직접 입력할지 여부.
29
42
  * @default false — Typography로 숫자만 표시 (장바구니 수량 UI 등)
@@ -9,10 +9,16 @@
9
9
  */
10
10
  import * as React from "react";
11
11
  import { type ThousandSeparatorProp } from "../utils/number";
12
- export declare function useNumberFieldLiveGrouping({ thousandSeparator, locale, format, }: {
12
+ export declare function useNumberFieldLiveGrouping({ thousandSeparator, locale, format, clearWhenZero, }: {
13
13
  thousandSeparator?: ThousandSeparatorProp;
14
14
  locale?: Intl.LocalesArgument;
15
15
  format?: Intl.NumberFormatOptions;
16
+ /**
17
+ * 값이 정확히 0이고 입력칸에 포커스가 없을 때 표시 문자열을 빈 문자열로 비운다.
18
+ * 내부 숫자 값(0)은 그대로 유지되므로 스피너 증감은 정상 동작한다.
19
+ * @default false
20
+ */
21
+ clearWhenZero?: boolean;
16
22
  }): {
17
23
  getDisplayValue: (baseInputValue: string) => string;
18
24
  syncBaseInputValue: (baseInputValue: string) => void;