@uniai-fe/uds-primitives 0.6.6 → 0.6.8
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/styles.css +4 -0
- package/package.json +1 -1
- package/src/components/alternate/styles/unit.scss +5 -0
- package/src/components/input/markup/date/Template.tsx +3 -0
- package/src/components/input/markup/date/footer/Template.tsx +13 -3
- package/src/components/input/markup/date/range/Template.tsx +7 -2
- package/src/components/input/types/date.ts +36 -0
package/dist/styles.css
CHANGED
package/package.json
CHANGED
|
@@ -42,6 +42,7 @@ const INPUT_DATE_TABLE_FORMAT = "YY-MM-DD";
|
|
|
42
42
|
* @param {"default" | "active" | "focused" | "success" | "error" | "disabled" | "loading"} [props.state="default"] trigger input state
|
|
43
43
|
* @param {ReactNode} [props.header] 패널 header 콘텐츠
|
|
44
44
|
* @param {ReactNode} [props.footer] 패널 footer 콘텐츠
|
|
45
|
+
* @param {InputCalendarTexts} [props.texts] 기본 Date 문구
|
|
45
46
|
* @param {unknown} [props.timePicker] TimePicker 확장용 예약 슬롯(현재 미구현)
|
|
46
47
|
* @param {boolean} [props.calendarOpened] calendar 열림 제어 상태
|
|
47
48
|
* @param {(event: MouseEvent<Element>) => void} [props.onClick] trigger 클릭 핸들러
|
|
@@ -68,6 +69,7 @@ const InputDateTemplate = forwardRef<HTMLDivElement, InputCalendarProps>(
|
|
|
68
69
|
state = "default",
|
|
69
70
|
header,
|
|
70
71
|
footer,
|
|
72
|
+
texts,
|
|
71
73
|
calendarOpened,
|
|
72
74
|
onClick: triggerOnClick,
|
|
73
75
|
id,
|
|
@@ -147,6 +149,7 @@ const InputDateTemplate = forwardRef<HTMLDivElement, InputCalendarProps>(
|
|
|
147
149
|
onToday={() => updateValue(getTodayValue())}
|
|
148
150
|
// 변경: Apply 버튼 클릭 시 calendar를 닫는다.
|
|
149
151
|
onApply={() => setInternalCalendarOpen(false)}
|
|
152
|
+
texts={texts}
|
|
150
153
|
/>
|
|
151
154
|
);
|
|
152
155
|
|
|
@@ -14,6 +14,7 @@ import InputDateFooterUtilContainer from "./UtilContainer";
|
|
|
14
14
|
* @param {() => void} [props.onToday] today 버튼 클릭 핸들러
|
|
15
15
|
* @param {() => void} [props.onApply] apply 버튼 클릭 핸들러
|
|
16
16
|
* @param {boolean} [props.disabled] 전체 버튼 disabled 여부
|
|
17
|
+
* @param {InputCalendarTexts} [props.texts] 기본 Date 문구
|
|
17
18
|
* @example
|
|
18
19
|
* <InputDateFooterTemplate onClear={onClear} onToday={onToday} onApply={onApply} />
|
|
19
20
|
*/
|
|
@@ -23,14 +24,23 @@ export default function InputDateFooterTemplate({
|
|
|
23
24
|
onToday,
|
|
24
25
|
onApply,
|
|
25
26
|
disabled,
|
|
27
|
+
texts,
|
|
26
28
|
}: InputCalendarFooterTemplateProps) {
|
|
27
29
|
return (
|
|
28
30
|
<InputDateFooterTemplateContainer className={className}>
|
|
29
31
|
<InputDateFooterUtilContainer>
|
|
30
|
-
<InputDateClearButton disabled={disabled} onClick={onClear}
|
|
31
|
-
|
|
32
|
+
<InputDateClearButton disabled={disabled} onClick={onClear}>
|
|
33
|
+
{texts?.clear}
|
|
34
|
+
</InputDateClearButton>
|
|
35
|
+
<InputDateTodayButton disabled={disabled} onClick={onToday}>
|
|
36
|
+
{texts?.today}
|
|
37
|
+
</InputDateTodayButton>
|
|
32
38
|
</InputDateFooterUtilContainer>
|
|
33
|
-
<InputDateApplyButton
|
|
39
|
+
<InputDateApplyButton
|
|
40
|
+
disabled={disabled}
|
|
41
|
+
label={texts?.apply}
|
|
42
|
+
onClick={onApply}
|
|
43
|
+
/>
|
|
34
44
|
</InputDateFooterTemplateContainer>
|
|
35
45
|
);
|
|
36
46
|
}
|
|
@@ -46,6 +46,7 @@ const INPUT_DATE_RANGE_TABLE_FORMAT = "YY-MM-DD";
|
|
|
46
46
|
* @param {"default" | "active" | "focused" | "success" | "error" | "disabled" | "loading"} [props.state="default"] trigger input state
|
|
47
47
|
* @param {ReactNode} [props.header] 패널 header 콘텐츠
|
|
48
48
|
* @param {ReactNode} [props.footer] 패널 footer 콘텐츠
|
|
49
|
+
* @param {InputCalendarTexts} [props.texts] 기본 Date 문구
|
|
49
50
|
* @param {boolean} [props.calendarOpened] calendar 열림 제어 상태
|
|
50
51
|
* @param {string} [props.id] trigger id
|
|
51
52
|
* @param {ReactNode} [props.trigger] 커스텀 trigger 슬롯
|
|
@@ -78,6 +79,7 @@ const InputDateRangeTemplate = forwardRef<HTMLElement, InputCalendarRangeProps>(
|
|
|
78
79
|
state = "default",
|
|
79
80
|
header,
|
|
80
81
|
footer,
|
|
82
|
+
texts,
|
|
81
83
|
calendarOpened,
|
|
82
84
|
onClick: triggerOnClick,
|
|
83
85
|
id,
|
|
@@ -171,7 +173,9 @@ const InputDateRangeTemplate = forwardRef<HTMLElement, InputCalendarRangeProps>(
|
|
|
171
173
|
const today = getTodayValue();
|
|
172
174
|
updateValue([today, today]);
|
|
173
175
|
}}
|
|
174
|
-
|
|
176
|
+
>
|
|
177
|
+
{texts?.today}
|
|
178
|
+
</InputDateTodayButton>
|
|
175
179
|
</InputDateFooterUtilContainer>
|
|
176
180
|
<InputDateFooterUtilContainer className="input-date-range-footer-row">
|
|
177
181
|
<InputDateClearButton
|
|
@@ -179,12 +183,13 @@ const InputDateRangeTemplate = forwardRef<HTMLElement, InputCalendarRangeProps>(
|
|
|
179
183
|
disabled={disabled}
|
|
180
184
|
onClick={() => updateValue(createEmptyRangeValue())}
|
|
181
185
|
>
|
|
182
|
-
삭제하기
|
|
186
|
+
{texts?.clear ?? "삭제하기"}
|
|
183
187
|
</InputDateClearButton>
|
|
184
188
|
{/* 변경: range footer는 삭제/적용을 같은 row에 두고 Apply 폭을 content 기준으로 줄인다. */}
|
|
185
189
|
<InputDateApplyButton
|
|
186
190
|
className="input-date-range-apply-button"
|
|
187
191
|
disabled={disabled}
|
|
192
|
+
label={texts?.apply}
|
|
188
193
|
onClick={() => setInternalCalendarOpen(false)}
|
|
189
194
|
/>
|
|
190
195
|
</InputDateFooterUtilContainer>
|
|
@@ -148,6 +148,7 @@ export interface InputCalendarTriggerRenderProps {
|
|
|
148
148
|
* @property {InputState} [state] trigger input state
|
|
149
149
|
* @property {ReactNode} [header] 커스텀 header 콘텐츠
|
|
150
150
|
* @property {ReactNode} [footer] 커스텀 footer 콘텐츠
|
|
151
|
+
* @property {InputCalendarTexts} [texts] 기본 Date 문구
|
|
151
152
|
* @property {unknown} [timePicker] TimePicker 확장용 예약 슬롯(현재 미구현)
|
|
152
153
|
* @property {boolean} [calendarOpened] calendar 열림 제어 여부
|
|
153
154
|
* @property {ReactNode} [trigger] 커스텀 trigger 슬롯
|
|
@@ -198,6 +199,10 @@ export interface InputCalendarProps extends InputCalendarTriggerProps {
|
|
|
198
199
|
* 커스텀 footer 콘텐츠
|
|
199
200
|
*/
|
|
200
201
|
footer?: ReactNode;
|
|
202
|
+
/**
|
|
203
|
+
* 기본 Date 문구
|
|
204
|
+
*/
|
|
205
|
+
texts?: InputCalendarTexts;
|
|
201
206
|
/**
|
|
202
207
|
* TimePicker 확장용 예약 슬롯(현재 미구현).
|
|
203
208
|
* 추후 Calendar Body 조합 확장 시점에 구체 타입을 확정한다.
|
|
@@ -236,6 +241,7 @@ export interface InputCalendarProps extends InputCalendarTriggerProps {
|
|
|
236
241
|
* @property {InputState} [state] trigger input state
|
|
237
242
|
* @property {ReactNode} [header] 커스텀 header 콘텐츠
|
|
238
243
|
* @property {ReactNode} [footer] 커스텀 footer 콘텐츠
|
|
244
|
+
* @property {InputCalendarTexts} [texts] 기본 Date 문구
|
|
239
245
|
* @property {boolean} [calendarOpened] calendar 열림 제어 여부
|
|
240
246
|
* @property {string} [id] trigger id
|
|
241
247
|
* @property {ReactNode} [trigger] 커스텀 trigger 슬롯
|
|
@@ -308,6 +314,10 @@ export interface InputCalendarRangeProps {
|
|
|
308
314
|
* 커스텀 footer 콘텐츠
|
|
309
315
|
*/
|
|
310
316
|
footer?: ReactNode;
|
|
317
|
+
/**
|
|
318
|
+
* 기본 Date 문구
|
|
319
|
+
*/
|
|
320
|
+
texts?: InputCalendarTexts;
|
|
311
321
|
/**
|
|
312
322
|
* calendar 열림 제어 여부
|
|
313
323
|
* - 지정되면 제어형(open state controlled)으로 동작한다.
|
|
@@ -369,6 +379,27 @@ export interface InputCalendarApplyButtonProps extends InputCalendarInlineButton
|
|
|
369
379
|
label?: ReactNode;
|
|
370
380
|
}
|
|
371
381
|
|
|
382
|
+
/**
|
|
383
|
+
* Input Date 기본 문구.
|
|
384
|
+
* @property {ReactNode} [clear] clear 버튼 라벨
|
|
385
|
+
* @property {ReactNode} [today] today 버튼 라벨
|
|
386
|
+
* @property {ReactNode} [apply] apply 버튼 라벨
|
|
387
|
+
*/
|
|
388
|
+
export interface InputCalendarTexts {
|
|
389
|
+
/**
|
|
390
|
+
* clear 버튼 라벨
|
|
391
|
+
*/
|
|
392
|
+
clear?: ReactNode;
|
|
393
|
+
/**
|
|
394
|
+
* today 버튼 라벨
|
|
395
|
+
*/
|
|
396
|
+
today?: ReactNode;
|
|
397
|
+
/**
|
|
398
|
+
* apply 버튼 라벨
|
|
399
|
+
*/
|
|
400
|
+
apply?: ReactNode;
|
|
401
|
+
}
|
|
402
|
+
|
|
372
403
|
/**
|
|
373
404
|
* Footer template의 util 버튼 컨테이너 props.
|
|
374
405
|
* @property {ReactNode} [children] util 버튼(children)
|
|
@@ -408,6 +439,7 @@ export interface InputCalendarFooterTemplateContainerProps {
|
|
|
408
439
|
* @property {() => void} [onToday] today 버튼 클릭 핸들러
|
|
409
440
|
* @property {() => void} [onApply] apply 버튼 클릭 핸들러
|
|
410
441
|
* @property {boolean} [disabled] 전체 버튼 disabled 여부
|
|
442
|
+
* @property {InputCalendarTexts} [texts] 기본 Date 문구
|
|
411
443
|
*/
|
|
412
444
|
export interface InputCalendarFooterTemplateProps {
|
|
413
445
|
/**
|
|
@@ -430,4 +462,8 @@ export interface InputCalendarFooterTemplateProps {
|
|
|
430
462
|
* 전체 버튼 disabled 여부
|
|
431
463
|
*/
|
|
432
464
|
disabled?: boolean;
|
|
465
|
+
/**
|
|
466
|
+
* 기본 Date 문구
|
|
467
|
+
*/
|
|
468
|
+
texts?: InputCalendarTexts;
|
|
433
469
|
}
|