@ehfuse/mui-form-controls 3.1.16 → 3.1.18
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/LICENSE +21 -21
- package/README.md +1 -1
- package/dist/address.js.map +1 -1
- package/dist/address.mjs.map +1 -1
- package/dist/components/NumberField.d.ts +6 -4
- package/dist/components/NumberSpinner.d.ts +3 -2
- package/dist/hooks/useNumberFieldLiveGrouping.d.ts +4 -4
- package/dist/hooks/useNumberFieldValueChange.d.ts +3 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +2 -3
- package/dist/index.mjs.map +3 -3
- package/dist/types.d.ts +2 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/number.d.ts +31 -3
- package/package.json +1 -1
- package/dist/SwitchField.d.ts +0 -10
- package/dist/ToggleButtonGroupField.d.ts +0 -10
- package/dist/devDebug.d.ts +0 -35
- package/dist/utils/outlinedFieldStyles.d.ts +0 -5
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
|
-
|
|
359
|
+
/** `false` 끔 · `true`/`undefined` 콤마(`,`) · `string` 구분 문자 지정 (예: `"."`, `" "`) */
|
|
360
|
+
thousandSeparator?: boolean | string;
|
|
360
361
|
decimalLength?: number;
|
|
361
362
|
decimalFixed?: boolean;
|
|
362
363
|
textAlign?: "left" | "center" | "right";
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -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";
|
package/dist/utils/number.d.ts
CHANGED
|
@@ -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:
|
|
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
|
|
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
package/dist/SwitchField.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SwitchField.tsx
|
|
3
|
-
*
|
|
4
|
-
* @license MIT
|
|
5
|
-
* @copyright 2025 김영진 (Kim Young Jin)
|
|
6
|
-
* @author 김영진 (ehfuse@gmail.com)
|
|
7
|
-
*/
|
|
8
|
-
import React from "react";
|
|
9
|
-
import type { SwitchFieldProps } from "./types";
|
|
10
|
-
export declare const SwitchField: React.ForwardRefExoticComponent<Omit<SwitchFieldProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ToggleButtonGroupField.tsx
|
|
3
|
-
*
|
|
4
|
-
* @license MIT
|
|
5
|
-
* @copyright 2025 김영진 (Kim Young Jin)
|
|
6
|
-
* @author 김영진 (ehfuse@gmail.com)
|
|
7
|
-
*/
|
|
8
|
-
import React from "react";
|
|
9
|
-
import type { ToggleButtonGroupFieldProps } from "./types";
|
|
10
|
-
export declare const ToggleButtonGroupField: React.ForwardRefExoticComponent<Omit<ToggleButtonGroupFieldProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
package/dist/devDebug.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 패키지 전역 개발용 콘솔 로그 스위치.
|
|
3
|
-
* 앱 진입 시 `setMuiFormControlsDebug(true)` 한 번이면
|
|
4
|
-
* DateTextField / TimeTextField / DateTimeTextField 등에서 value 동기화 로그가 출력된다.
|
|
5
|
-
* 필드가 많으면 `nameIncludes` / `nameMatch`, 컴포넌트만 골라서는 `scopes`로 범위를 줄일 수 있다.
|
|
6
|
-
*
|
|
7
|
-
* @license MIT
|
|
8
|
-
*/
|
|
9
|
-
/** value 동기화 로그를 낼 수 있는 컴포넌트 scope (muiFormControlsDevLog 첫 인자와 동일) */
|
|
10
|
-
export type MuiFormControlsDebugScope = "DateTextField" | "TimeTextField" | "DateTimeTextField";
|
|
11
|
-
export type MuiFormControlsDebugOptions = {
|
|
12
|
-
/** `name` prop에 이 부분 문자열이 있을 때만 로그 (여러 필드일 때 노이즈 감소) */
|
|
13
|
-
nameIncludes?: string;
|
|
14
|
-
/** `name` prop이 이 정규식과 맞을 때만 로그 */
|
|
15
|
-
nameMatch?: RegExp;
|
|
16
|
-
/**
|
|
17
|
-
* 한 개 이상이면 **이 컴포넌트(scope)에서만** 로그.
|
|
18
|
-
* 생략 또는 빈 배열이면 scope 제한 없음(이름 필터만 적용).
|
|
19
|
-
*/
|
|
20
|
-
scopes?: MuiFormControlsDebugScope[];
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* @param enabled 로그 출력 여부
|
|
24
|
-
* @param options `scopes` / `nameIncludes` / `nameMatch`로 범위 축소 (조건은 AND)
|
|
25
|
-
*/
|
|
26
|
-
export declare function setMuiFormControlsDebug(enabled: boolean, options?: MuiFormControlsDebugOptions): void;
|
|
27
|
-
export declare function getMuiFormControlsDebug(): boolean;
|
|
28
|
-
export declare function getMuiFormControlsDebugOptions(): Readonly<MuiFormControlsDebugOptions & {
|
|
29
|
-
enabled: boolean;
|
|
30
|
-
}>;
|
|
31
|
-
/**
|
|
32
|
-
* 컴포넌트 내부 전용.
|
|
33
|
-
* @param scope 예: "DateTextField"
|
|
34
|
-
*/
|
|
35
|
-
export declare function muiFormControlsDevLog(scope: string, payload: Record<string, unknown>): void;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { SxProps, Theme } from "@mui/material/styles";
|
|
2
|
-
export declare const CLOSED_OUTLINED_BORDER_COLOR = "rgba(0, 0, 0, 0.23)";
|
|
3
|
-
export declare const CLOSED_OUTLINED_LABEL_COLOR = "rgba(0, 0, 0, 0.6)";
|
|
4
|
-
export declare const outlinedFieldFocusToneSx: SxProps<Theme>;
|
|
5
|
-
export declare const outlinedFieldReadonlyToneSx: SxProps<Theme>;
|