@ehfuse/mui-form-controls 3.0.60 → 3.0.61
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 +39 -0
- package/dist/SwitchField.d.ts +10 -0
- package/dist/ToggleButtonGroupField.d.ts +10 -0
- package/dist/address.js.map +1 -1
- package/dist/address.mjs.map +1 -1
- package/dist/devDebug.d.ts +35 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +4 -4
- package/dist/types.d.ts +17 -0
- package/dist/utils/date.d.ts +31 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/outlinedFieldStyles.d.ts +5 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -286,6 +286,23 @@ export type TagsTextFieldProps = Omit<TextFieldProps, "value" | "defaultValue" |
|
|
|
286
286
|
spaceToConfirm?: boolean;
|
|
287
287
|
backspaceToDelete?: boolean;
|
|
288
288
|
showDeleteIcon?: boolean;
|
|
289
|
+
/**
|
|
290
|
+
* X 클릭 직전. `false`를 반환하면 삭제를 진행하지 않음(동기 가드·모달 전 차단 등).
|
|
291
|
+
* `onDelete`가 없을 때만 기본 삭제와 조합됨.
|
|
292
|
+
*/
|
|
293
|
+
onDeleteBefore?: (event: React.SyntheticEvent, tag: string, index: number) => boolean | void;
|
|
294
|
+
/**
|
|
295
|
+
* X 클릭 시 호출. 지정하면 **기본 삭제는 하지 않으며** 이 콜백만 실행됨.
|
|
296
|
+
* 모달 확인 후 `onChange`/`form.setFormValue`로 배열에서 제거하면 됨.
|
|
297
|
+
* 지정하지 않으면 내부에서 태그를 제거한 뒤 `onChange`만 호출함.
|
|
298
|
+
*/
|
|
299
|
+
onDelete?: (event: React.SyntheticEvent, tag: string, index: number) => void;
|
|
300
|
+
/**
|
|
301
|
+
* 태그 칩 본문 클릭 시(삭제 아이콘 제외). 상세 모달·라우팅 등에 사용.
|
|
302
|
+
* `chipProps.onClick`이 있으면 먼저 호출한 뒤, `event.defaultPrevented`가 아니면 이 콜백을 호출함.
|
|
303
|
+
* `draggable`이 true이면 짧은 클릭과 드래그가 겹칠 수 있음(센서는 기본 5px 이동 후 드래그).
|
|
304
|
+
*/
|
|
305
|
+
onTagClick?: (event: React.MouseEvent, tag: string, index: number) => void;
|
|
289
306
|
};
|
|
290
307
|
/**
|
|
291
308
|
* 비밀번호 유효성 검사 규칙
|
package/dist/utils/date.d.ts
CHANGED
|
@@ -112,3 +112,34 @@ export declare function buildDateOutputValue(formattedValue: string, format: Dat
|
|
|
112
112
|
* Date 객체에서 포맷에 맞는 숫자 문자열 생성
|
|
113
113
|
*/
|
|
114
114
|
export declare function dateToNumbers(date: Date, format: DateFormat): string;
|
|
115
|
+
export type ParsedPasteDateTime = {
|
|
116
|
+
dateDisplay: string;
|
|
117
|
+
hour: string;
|
|
118
|
+
minute: string;
|
|
119
|
+
second: string;
|
|
120
|
+
/** 연도 없는 날짜 포맷에서 ISO 등으로 연도를 알 수 있을 때 */
|
|
121
|
+
internalYear?: number | null;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* DateTimeTextField용: 클립보드 텍스트가 현재 날짜·시간 포맷과 호환되면 파싱 결과를 반환한다.
|
|
125
|
+
* AM/PM 없는 시간은 24시간 해석 후 12시간 표시로 변환한다.
|
|
126
|
+
*/
|
|
127
|
+
export declare function tryParsePastedDateTimeClipboard(raw: string, dateFormat: DateFormat, _dateTimeFormat: DateTimeFormat, options: {
|
|
128
|
+
hasSecond: boolean;
|
|
129
|
+
is12Hour: boolean;
|
|
130
|
+
minDateTime?: Date;
|
|
131
|
+
maxDateTime?: Date;
|
|
132
|
+
minTime?: string;
|
|
133
|
+
maxTime?: string;
|
|
134
|
+
}): ParsedPasteDateTime | null;
|
|
135
|
+
export type ParsedPasteDateOnly = {
|
|
136
|
+
display: string;
|
|
137
|
+
internalYear?: number | null;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* DateTextField용: "YYYY-MM-DD" 또는 "YYYY-MM-DD HH:mm" 등에서 날짜만 파싱
|
|
141
|
+
*/
|
|
142
|
+
export declare function tryParsePastedDateClipboard(raw: string, dateFormat: DateFormat, options: {
|
|
143
|
+
minDate?: Date;
|
|
144
|
+
maxDate?: Date;
|
|
145
|
+
}): ParsedPasteDateOnly | null;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* @copyright 2025 김영진 (Kim Young Jin)
|
|
6
6
|
* @author 김영진 (ehfuse@gmail.com)
|
|
7
7
|
*/
|
|
8
|
-
export { isLeapYear, getDaysInMonth, getSeparator, formatDate, getMaxLength, getCompleteLength, parseDateParts, validateDate, parseToDate, clampDateValue, extractDateFormat, hasSecondField, constrainDateNumbers, formatDateValue, formatToPlaceholder, getSegmentRange, hasYearInFormat, has2DigitYear, convertYY2YYYY, parseDateWithInternalYear, buildDateOutputValue, dateToNumbers, } from "./date";
|
|
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
|
+
export type { ParsedPasteDateTime, ParsedPasteDateOnly } from "./date";
|
|
9
10
|
export { getTimeFieldCount, is12HourFormat, validateTime, clampTimeValue, } from "./time";
|
|
10
11
|
export { formatNumber, parseNumber } from "./number";
|
|
11
12
|
export { DEFAULT_EMAIL_DOMAINS, validateEmail } from "./email";
|
|
@@ -0,0 +1,5 @@
|
|
|
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>;
|