sellmate-design-system-react 0.4.0 → 0.6.0
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 +20 -0
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs +180 -37
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.d.ts +6 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.js +180 -37
- package/dist/components/SDateRangePicker/SDateRangePicker.js.map +1 -1
- package/dist/components/SGnb/SGnb.cjs +329 -100
- package/dist/components/SGnb/SGnb.cjs.map +1 -1
- package/dist/components/SGnb/SGnb.d.ts +24 -5
- package/dist/components/SGnb/SGnb.js +330 -101
- package/dist/components/SGnb/SGnb.js.map +1 -1
- package/dist/components/SGnb/gnb.config.d.ts +46 -12
- package/dist/components/SGnb/index.d.ts +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs +180 -37
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.js +180 -37
- package/dist/components/SKeyValueTable/SKeyValueTable.js.map +1 -1
- package/dist/components/SLayout/SLayout.cjs +37 -21
- package/dist/components/SLayout/SLayout.cjs.map +1 -1
- package/dist/components/SLayout/SLayout.d.ts +20 -1
- package/dist/components/SLayout/SLayout.js +37 -21
- package/dist/components/SLayout/SLayout.js.map +1 -1
- package/dist/components/SPage/SPage.cjs +38 -22
- package/dist/components/SPage/SPage.cjs.map +1 -1
- package/dist/components/SPage/SPage.js +38 -22
- package/dist/components/SPage/SPage.js.map +1 -1
- package/dist/components/STabs/STabs.cjs +15 -26
- package/dist/components/STabs/STabs.cjs.map +1 -1
- package/dist/components/STabs/STabs.d.ts +1 -1
- package/dist/components/STabs/STabs.js +15 -26
- package/dist/components/STabs/STabs.js.map +1 -1
- package/dist/components/STimePicker/STimePicker.cjs.map +1 -1
- package/dist/components/STimePicker/STimePicker.js.map +1 -1
- package/dist/components/STimeRangePicker/STimeRangePicker.cjs +3 -1
- package/dist/components/STimeRangePicker/STimeRangePicker.cjs.map +1 -1
- package/dist/components/STimeRangePicker/STimeRangePicker.js +3 -1
- package/dist/components/STimeRangePicker/STimeRangePicker.js.map +1 -1
- package/dist/index.cjs +531 -164
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +528 -165
- package/dist/index.js.map +1 -1
- package/dist/styles.css +73 -4
- package/dist/theme.css +1 -1
- package/package.json +3 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SColor } from '../../lib/color';
|
|
1
2
|
import type { SIconName } from '../SIcon';
|
|
2
3
|
import type { STagColor } from '../STag';
|
|
3
4
|
/** 메뉴 스타일: box = 라운드/좁은 들여쓰기, belt = 풀폭 행/넓은 들여쓰기 */
|
|
@@ -23,17 +24,13 @@ export interface SGnbMenuItem {
|
|
|
23
24
|
/** 하위 아이템 (있으면 펼침/접힘 대상) */
|
|
24
25
|
children?: SGnbMenuItem[];
|
|
25
26
|
}
|
|
26
|
-
/**
|
|
27
|
-
* 상단바(header 축). fix → gnbBelt-top-* 토큰, full → gnbBox-* 토큰.
|
|
28
|
-
* 배치까지 이 축이 정한다 — fix 는 GNB 컬럼 안, full 은 레이아웃 전폭.
|
|
29
|
-
*/
|
|
30
27
|
export declare const GNB_HEADER: Record<SGnbHeader, {
|
|
31
28
|
topHeight: string;
|
|
32
29
|
topPaddingX: string;
|
|
33
30
|
topGap: string;
|
|
34
31
|
logoHeight: string;
|
|
35
32
|
}>;
|
|
36
|
-
/** 메뉴(type 축). box → --cmp-
|
|
33
|
+
/** 메뉴(type 축). box → --cmp-gnb-box-*, belt → --cmp-gnb-belt-* (공통 치수는 --cmp-gnb-*) */
|
|
37
34
|
export declare const GNB_MENU: Record<SGnbType, {
|
|
38
35
|
bodyPaddingY: string;
|
|
39
36
|
itemMarginX: string;
|
|
@@ -53,8 +50,8 @@ export declare const GNB_MENU: Record<SGnbType, {
|
|
|
53
50
|
itemLineHeight: number;
|
|
54
51
|
}>;
|
|
55
52
|
/**
|
|
56
|
-
* 색상(color 축). light → --cmp-light-* 색, dark → --cmp-dark-* 색
|
|
57
|
-
* 상단바 아이콘 색(--cmp-*-top-icon)은 SGhostButton 이 자체 intent 토큰으로 칠한다:
|
|
53
|
+
* 색상(color 축). light → --cmp-gnb-light-* 색, dark → --cmp-gnb-dark-* 색
|
|
54
|
+
* 상단바 아이콘 색(--cmp-gnb-*-top-icon)은 SGhostButton 이 자체 intent 토큰으로 칠한다:
|
|
58
55
|
* light → --cmp-ghostButton-default-content, dark → --cmp-ghostButton-inverse-content (값 동일).
|
|
59
56
|
*/
|
|
60
57
|
export declare const GNB_COLORS: Record<SGnbColor, {
|
|
@@ -67,21 +64,58 @@ export declare const GNB_COLORS: Record<SGnbColor, {
|
|
|
67
64
|
itemColorHover: string;
|
|
68
65
|
itemColorActive: string;
|
|
69
66
|
itemChevron: string;
|
|
67
|
+
/** depth1 아이콘 색. 대응 --cmp-gnb-*-item-icon 토큰이 없어 팔레트 키로 직접 지정한다. */
|
|
68
|
+
itemIcon: SColor;
|
|
69
|
+
/** 레일 아이템 기본 색(아이콘+라벨). 선택 시엔 itemColorActive 를 쓴다. */
|
|
70
|
+
railFgDefault: string;
|
|
70
71
|
}>;
|
|
71
72
|
/** 축과 무관한 공통 레이아웃. */
|
|
72
73
|
export declare const GNB_COMMON: {
|
|
73
74
|
/** 접힘 레일 폭. header="full" 은 접으면 메뉴만 사라져 레일이 없으므로 fix 전용. */
|
|
74
75
|
foldWidth: string;
|
|
75
|
-
/**
|
|
76
|
-
* 상단바 아이콘 버튼 사이 간격. fix 레일(세로 스택)의 gap·상하 여백에 쓴다.
|
|
77
|
-
* 레일 전용 여백 토큰이 따로 없어 같은 값(8px)인 이 토큰으로 재해석했다.
|
|
78
|
-
*/
|
|
79
|
-
buttonGap: string;
|
|
80
76
|
};
|
|
77
|
+
/**
|
|
78
|
+
* 좌측 레일(useRail) — items 의 첫 depth 를 아이콘+라벨 버튼으로 세우는 1차 내비게이션.
|
|
79
|
+
* 선택 색은 레일 전용 토큰이 없어 메뉴 아이템의 선택 색(item-bg-selected / item-fg-selected)을 함께 쓴다.
|
|
80
|
+
*/
|
|
81
|
+
export declare const GNB_RAIL: {
|
|
82
|
+
padding: string;
|
|
83
|
+
gap: string;
|
|
84
|
+
itemWidth: string;
|
|
85
|
+
itemPaddingTop: string;
|
|
86
|
+
itemPaddingBottom: string;
|
|
87
|
+
itemRadius: string;
|
|
88
|
+
itemIcon: string;
|
|
89
|
+
itemFontSize: number;
|
|
90
|
+
itemLineHeight: number;
|
|
91
|
+
itemFontWeight: number;
|
|
92
|
+
itemFontWeightSelected: number;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* 레일 컬럼 폭 = rail-item-width(44) + rail-padding(12)*2.
|
|
96
|
+
* 토큰이 CSS 변수라 JS 에서 더할 수 없어 합을 상수로 둔다 (GNB_MENU_WIDTH 와 같은 이유).
|
|
97
|
+
*/
|
|
98
|
+
export declare const GNB_RAIL_WIDTH = 68;
|
|
99
|
+
/**
|
|
100
|
+
* 접힘/펼침 전환 시간(ms). GNB 폭·메뉴 슬라이드·상단바 페이드와 SLayout 의 메뉴 열 폭이
|
|
101
|
+
* 이 값을 공유해야 한 덩어리로 미끄러진다.
|
|
102
|
+
*/
|
|
103
|
+
export declare const GNB_FOLD_MS = 200;
|
|
104
|
+
/**
|
|
105
|
+
* 하위 메뉴 펼침/접힘 전환 시간(ms). 아이템을 눌러 children 이 열리고 닫힐 때
|
|
106
|
+
* 높이(grid-template-rows 0fr↔1fr)가 이 길이만큼 부드럽게 늘고 줄어든다.
|
|
107
|
+
* 폴드와 같은 값을 써서 두 모션이 한 언어로 읽히게 한다.
|
|
108
|
+
*/
|
|
109
|
+
export declare const GNB_EXPAND_MS = 200;
|
|
81
110
|
/**
|
|
82
111
|
* 메뉴 고정 폭. 두 header 모두 메뉴는 이 폭으로 좌측에 붙는다(토큰 없음 → 상수).
|
|
83
112
|
* header="full" 에서 SLayout 이 "메뉴 오른쪽 = 페이지" 영역을 잡을 때도 이 값을 쓴다.
|
|
84
113
|
*/
|
|
85
114
|
export declare const GNB_MENU_WIDTH = 240;
|
|
115
|
+
/**
|
|
116
|
+
* useRail 에서 value 를 품은 첫 depth(레일) 아이템의 value.
|
|
117
|
+
* value 자체가 레일 아이템이면 그 값을, 어디에도 없으면 undefined 를 반환한다.
|
|
118
|
+
*/
|
|
119
|
+
export declare function findGnbRailValue(items: SGnbMenuItem[], value: string): string | undefined;
|
|
86
120
|
/** value 로 선택된 아이템의 조상 value 목록(자기 자신 제외)을 반환 → 자동 펼침용 */
|
|
87
121
|
export declare function findGnbAncestors(items: SGnbMenuItem[], value: string): string[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { SGnb, type SGnbProps } from './SGnb';
|
|
2
|
-
export { GNB_HEADER, GNB_MENU, GNB_COLORS, GNB_COMMON, GNB_MENU_WIDTH, findGnbAncestors, type SGnbType, type SGnbHeader, type SGnbColor, type SGnbMenuItem, } from './gnb.config';
|
|
2
|
+
export { GNB_HEADER, GNB_MENU, GNB_COLORS, GNB_COMMON, GNB_FOLD_MS, GNB_MENU_WIDTH, GNB_RAIL, GNB_RAIL_WIDTH, findGnbAncestors, findGnbRailValue, type SGnbType, type SGnbHeader, type SGnbColor, type SGnbMenuItem, } from './gnb.config';
|
|
@@ -5424,25 +5424,45 @@ function SDatePicker({
|
|
|
5424
5424
|
}
|
|
5425
5425
|
);
|
|
5426
5426
|
}
|
|
5427
|
+
function splitDateTime(v) {
|
|
5428
|
+
if (!v) return { date: null, hour: "00", minute: "00" };
|
|
5429
|
+
const [date = "", time = ""] = v.split(" ");
|
|
5430
|
+
const [hour = "00", minute = "00"] = time.split(":");
|
|
5431
|
+
return { date: date || null, hour, minute };
|
|
5432
|
+
}
|
|
5427
5433
|
function RangeCalendar({
|
|
5428
5434
|
value,
|
|
5429
5435
|
selectable,
|
|
5430
5436
|
maxRange,
|
|
5437
|
+
useTimePicker = false,
|
|
5431
5438
|
onSelect,
|
|
5432
5439
|
onPendingStartChange,
|
|
5433
5440
|
onViewChange
|
|
5434
5441
|
}) {
|
|
5435
5442
|
const today = todayStr();
|
|
5436
|
-
const
|
|
5443
|
+
const initial = splitDateTime(value?.[0]);
|
|
5444
|
+
const base = initial.date || today;
|
|
5437
5445
|
const [y, setY] = react.useState(Number(base.split("-")[0]));
|
|
5438
5446
|
const [m, setM] = react.useState(Number(base.split("-")[1]));
|
|
5439
|
-
const [start, setStart] = react.useState(
|
|
5440
|
-
const [end, setEnd] = react.useState(value?.[1]
|
|
5447
|
+
const [start, setStart] = react.useState(initial.date);
|
|
5448
|
+
const [end, setEnd] = react.useState(splitDateTime(value?.[1]).date);
|
|
5441
5449
|
const [hover, setHover] = react.useState(null);
|
|
5450
|
+
const [sH, setSH] = react.useState(initial.hour);
|
|
5451
|
+
const [sM, setSM] = react.useState(initial.minute);
|
|
5452
|
+
const [eH, setEH] = react.useState(splitDateTime(value?.[1]).hour);
|
|
5453
|
+
const [eM, setEM] = react.useState(splitDateTime(value?.[1]).minute);
|
|
5454
|
+
const lastEmitted = react.useRef("");
|
|
5442
5455
|
react.useEffect(() => {
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5456
|
+
if (useTimePicker && JSON.stringify(value) === lastEmitted.current) return;
|
|
5457
|
+
const s = splitDateTime(value?.[0]);
|
|
5458
|
+
const e = splitDateTime(value?.[1]);
|
|
5459
|
+
setStart(s.date);
|
|
5460
|
+
setEnd(e.date);
|
|
5461
|
+
setSH(s.hour);
|
|
5462
|
+
setSM(s.minute);
|
|
5463
|
+
setEH(e.hour);
|
|
5464
|
+
setEM(e.minute);
|
|
5465
|
+
}, [value, useTimePicker]);
|
|
5446
5466
|
const setBase = (ny, nm) => {
|
|
5447
5467
|
setY(ny);
|
|
5448
5468
|
setM(nm);
|
|
@@ -5486,18 +5506,53 @@ function RangeCalendar({
|
|
|
5486
5506
|
const hasRange = !!(rStart && rEnd && rStart !== rEnd);
|
|
5487
5507
|
const inRange = (d) => !!(rStart && rEnd && d > rStart && d < rEnd);
|
|
5488
5508
|
const RANGE_BG = "var(--cmp-datepicker-calendar-range-bg)";
|
|
5509
|
+
const pad = (v) => String(Number(v) || 0).padStart(2, "0");
|
|
5510
|
+
const emit = (dateStart, dateEnd, time) => {
|
|
5511
|
+
const t = time ?? { sH, sM, eH, eM };
|
|
5512
|
+
const range = useTimePicker ? [`${dateStart} ${pad(t.sH)}:${pad(t.sM)}`, `${dateEnd} ${pad(t.eH)}:${pad(t.eM)}`] : [dateStart, dateEnd];
|
|
5513
|
+
lastEmitted.current = JSON.stringify(range);
|
|
5514
|
+
onSelect(range);
|
|
5515
|
+
};
|
|
5489
5516
|
const click = (d) => {
|
|
5490
5517
|
if (isDisabled(d)) return;
|
|
5491
5518
|
if (!start || complete || d < start) {
|
|
5492
5519
|
setStart(d);
|
|
5493
5520
|
setEnd(null);
|
|
5494
5521
|
setHover(null);
|
|
5522
|
+
if (useTimePicker) {
|
|
5523
|
+
setSH("00");
|
|
5524
|
+
setSM("00");
|
|
5525
|
+
setEH("23");
|
|
5526
|
+
setEM("59");
|
|
5527
|
+
}
|
|
5495
5528
|
onPendingStartChange?.(d);
|
|
5496
5529
|
return;
|
|
5497
5530
|
}
|
|
5498
5531
|
setEnd(d);
|
|
5499
5532
|
onPendingStartChange?.(null);
|
|
5500
|
-
|
|
5533
|
+
emit(start, d, useTimePicker ? { sH, sM, eH: "23", eM: "59" } : void 0);
|
|
5534
|
+
};
|
|
5535
|
+
const changeTime = (which, part, raw) => {
|
|
5536
|
+
const digits = raw.replace(/\D/g, "").slice(0, 2);
|
|
5537
|
+
const max = part === "h" ? 23 : 59;
|
|
5538
|
+
const next = digits !== "" && Number(digits) > max ? String(max) : digits;
|
|
5539
|
+
const nextTime = { sH, sM, eH, eM };
|
|
5540
|
+
if (which === "start") nextTime[part === "h" ? "sH" : "sM"] = next;
|
|
5541
|
+
else nextTime[part === "h" ? "eH" : "eM"] = next;
|
|
5542
|
+
setSH(nextTime.sH);
|
|
5543
|
+
setSM(nextTime.sM);
|
|
5544
|
+
setEH(nextTime.eH);
|
|
5545
|
+
setEM(nextTime.eM);
|
|
5546
|
+
if (start && end) emit(start, end, nextTime);
|
|
5547
|
+
};
|
|
5548
|
+
const blurTime = (which, part) => {
|
|
5549
|
+
if (which === "start") {
|
|
5550
|
+
if (part === "h") setSH(pad(sH));
|
|
5551
|
+
else setSM(pad(sM));
|
|
5552
|
+
} else {
|
|
5553
|
+
if (part === "h") setEH(pad(eH));
|
|
5554
|
+
else setEM(pad(eM));
|
|
5555
|
+
}
|
|
5501
5556
|
};
|
|
5502
5557
|
const GRID_COLS = "grid grid-cols-[repeat(7,var(--cmp-datepicker-calendar-day-width))]";
|
|
5503
5558
|
const renderPanel = (gy, gm, isLeft) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-[var(--cmp-datepicker-calendar-gap)]", children: [
|
|
@@ -5572,35 +5627,120 @@ function RangeCalendar({
|
|
|
5572
5627
|
);
|
|
5573
5628
|
}) })
|
|
5574
5629
|
] });
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5630
|
+
const renderTimeSection = (which, date, suffix) => {
|
|
5631
|
+
const active = !!date;
|
|
5632
|
+
const [yy = "", mm = "", dd = ""] = date ? date.split("-") : [];
|
|
5633
|
+
const hour = which === "start" ? sH : eH;
|
|
5634
|
+
const minute = which === "start" ? sM : eM;
|
|
5635
|
+
const num = (n, strip) => active && n !== "" ? strip ? String(Number(n)) : n : "-";
|
|
5636
|
+
const INPUT_CLS = "h-[var(--cmp-datepicker-sm-height)] w-[40px] rounded-[var(--cmp-datepicker-sm-radius)] border border-solid border-[color:var(--cmp-datepicker-border-default)] bg-[var(--cmp-datepicker-bg-default)] text-center text-[12px] font-medium leading-[20px] text-[color:var(--cmp-datepicker-text-default)] outline-none placeholder:text-[color:var(--cmp-datepicker-text-disabled)] focus:border-[color:var(--cmp-datepicker-border-focus)] disabled:cursor-not-allowed";
|
|
5637
|
+
const LABEL = "text-[color:var(--cmp-datepicker-calendar-time-date-label)]";
|
|
5638
|
+
const UNIT = "text-[color:var(--cmp-datepicker-calendar-time-date-unit)]";
|
|
5639
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5640
|
+
"div",
|
|
5641
|
+
{
|
|
5642
|
+
className: cn(
|
|
5643
|
+
"flex flex-1 items-center justify-center gap-[var(--cmp-datepicker-calendar-time-section-gap)] rounded-[var(--cmp-datepicker-calendar-time-radius)] px-[var(--cmp-datepicker-calendar-time-paddingX)] py-[var(--cmp-datepicker-calendar-time-paddingY)] text-[12px] font-medium leading-[20px]",
|
|
5644
|
+
active ? "bg-[var(--cmp-datepicker-calendar-time-bg-selected)]" : "bg-[var(--cmp-datepicker-calendar-time-bg-default)]"
|
|
5645
|
+
),
|
|
5646
|
+
children: [
|
|
5647
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex items-center gap-[var(--cmp-datepicker-calendar-time-date-gap)]", children: [
|
|
5648
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: LABEL, children: num(yy, false) }),
|
|
5649
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: UNIT, children: "\uB144" }),
|
|
5650
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: LABEL, children: num(mm, true) }),
|
|
5651
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: UNIT, children: "\uC6D4" }),
|
|
5652
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: LABEL, children: num(dd, true) }),
|
|
5653
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: UNIT, children: "\uC77C" })
|
|
5654
|
+
] }),
|
|
5655
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex items-center gap-[var(--cmp-datepicker-calendar-time-unit-gap)]", children: [
|
|
5656
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5657
|
+
"input",
|
|
5658
|
+
{
|
|
5659
|
+
type: "text",
|
|
5660
|
+
inputMode: "numeric",
|
|
5661
|
+
maxLength: 2,
|
|
5662
|
+
"aria-label": `${suffix} \uC2DC`,
|
|
5663
|
+
disabled: !active,
|
|
5664
|
+
value: active ? hour : "",
|
|
5665
|
+
placeholder: "--",
|
|
5666
|
+
onChange: (e) => changeTime(which, "h", e.target.value),
|
|
5667
|
+
onBlur: () => blurTime(which, "h"),
|
|
5668
|
+
className: INPUT_CLS
|
|
5669
|
+
}
|
|
5670
|
+
),
|
|
5671
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: LABEL, children: ":" }),
|
|
5672
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5673
|
+
"input",
|
|
5674
|
+
{
|
|
5675
|
+
type: "text",
|
|
5676
|
+
inputMode: "numeric",
|
|
5677
|
+
maxLength: 2,
|
|
5678
|
+
"aria-label": `${suffix} \uBD84`,
|
|
5679
|
+
disabled: !active,
|
|
5680
|
+
value: active ? minute : "",
|
|
5681
|
+
placeholder: "--",
|
|
5682
|
+
onChange: (e) => changeTime(which, "m", e.target.value),
|
|
5683
|
+
onBlur: () => blurTime(which, "m"),
|
|
5684
|
+
className: INPUT_CLS
|
|
5685
|
+
}
|
|
5686
|
+
)
|
|
5687
|
+
] }),
|
|
5688
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: UNIT, children: suffix })
|
|
5689
|
+
]
|
|
5690
|
+
}
|
|
5691
|
+
);
|
|
5692
|
+
};
|
|
5693
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5694
|
+
"div",
|
|
5695
|
+
{
|
|
5696
|
+
className: cn(
|
|
5697
|
+
"inline-flex flex-col gap-[var(--cmp-datepicker-calendar-gap)] rounded-[var(--cmp-datepicker-calendar-radius)] bg-[var(--cmp-datepicker-calendar-bg)] p-[var(--cmp-datepicker-calendar-paddingXY)] shadow-[2px_2px_12px_2px_rgba(0,0,0,0.2)] select-none",
|
|
5698
|
+
useTimePicker ? "h-auto" : "h-[364px]"
|
|
5600
5699
|
),
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5700
|
+
children: [
|
|
5701
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-center justify-center", children: [
|
|
5702
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-[var(--cmp-datepicker-calendar-gap)] text-[14px] font-medium leading-[24px]", children: [
|
|
5703
|
+
/* @__PURE__ */ jsxRuntime.jsx(SGhostButton, { icon: "chevronLeft", size: "xxs", ariaLabel: "prevYear", onClick: goPrevYear }),
|
|
5704
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex min-w-[40px] items-center justify-center text-center", children: y }),
|
|
5705
|
+
/* @__PURE__ */ jsxRuntime.jsx(SGhostButton, { icon: "chevronRight", size: "xxs", ariaLabel: "nextYear", onClick: goNextYear })
|
|
5706
|
+
] }),
|
|
5707
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5708
|
+
"button",
|
|
5709
|
+
{
|
|
5710
|
+
type: "button",
|
|
5711
|
+
onClick: goToday,
|
|
5712
|
+
className: "absolute right-0 h-[24px] min-w-[37px] cursor-pointer bg-transparent text-center text-[12px] font-medium leading-[24px] text-[color:var(--cmp-datepicker-calendar-day-default-text)] hover:underline",
|
|
5713
|
+
children: "\uC624\uB298"
|
|
5714
|
+
}
|
|
5715
|
+
)
|
|
5716
|
+
] }),
|
|
5717
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-[var(--cmp-datepicker-calendar-range-panelGap)]", children: [
|
|
5718
|
+
renderPanel(y, m, true),
|
|
5719
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5720
|
+
"span",
|
|
5721
|
+
{
|
|
5722
|
+
className: "w-px shrink-0 self-stretch bg-[var(--cmp-datepicker-calendar-range-divider)]",
|
|
5723
|
+
"aria-hidden": true
|
|
5724
|
+
}
|
|
5725
|
+
),
|
|
5726
|
+
renderPanel(nextMonthYM.year, nextMonthYM.month, false)
|
|
5727
|
+
] }),
|
|
5728
|
+
useTimePicker && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5729
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5730
|
+
"span",
|
|
5731
|
+
{
|
|
5732
|
+
className: "h-px w-full bg-[var(--cmp-datepicker-calendar-range-divider)]",
|
|
5733
|
+
"aria-hidden": true
|
|
5734
|
+
}
|
|
5735
|
+
),
|
|
5736
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-[var(--cmp-datepicker-calendar-time-gap)]", children: [
|
|
5737
|
+
renderTimeSection("start", start, "\uBD80\uD130"),
|
|
5738
|
+
renderTimeSection("end", end, "\uAE4C\uC9C0")
|
|
5739
|
+
] })
|
|
5740
|
+
] })
|
|
5741
|
+
]
|
|
5742
|
+
}
|
|
5743
|
+
);
|
|
5604
5744
|
}
|
|
5605
5745
|
function SDateRangePicker({
|
|
5606
5746
|
value,
|
|
@@ -5610,6 +5750,7 @@ function SDateRangePicker({
|
|
|
5610
5750
|
placeholder = "YYYY-MM-DD ~ YYYY-MM-DD",
|
|
5611
5751
|
selectable,
|
|
5612
5752
|
maxRange,
|
|
5753
|
+
useTimePicker = false,
|
|
5613
5754
|
disabled = false,
|
|
5614
5755
|
width,
|
|
5615
5756
|
name,
|
|
@@ -5653,8 +5794,9 @@ function SDateRangePicker({
|
|
|
5653
5794
|
setPendingStart(null);
|
|
5654
5795
|
onValueChange?.(r);
|
|
5655
5796
|
if (rules && rules.length > 0) setRuleError(runRules(r, rules));
|
|
5656
|
-
setOpen(false);
|
|
5797
|
+
if (!useTimePicker) setOpen(false);
|
|
5657
5798
|
};
|
|
5799
|
+
const resolvedPlaceholder = useTimePicker && placeholder === "YYYY-MM-DD ~ YYYY-MM-DD" ? "YYYY-MM-DD HH:mm ~ YYYY-MM-DD HH:mm" : placeholder;
|
|
5658
5800
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5659
5801
|
SField,
|
|
5660
5802
|
{
|
|
@@ -5721,7 +5863,7 @@ function SDateRangePicker({
|
|
|
5721
5863
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate text-right", children: startText }),
|
|
5722
5864
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-[4px]", children: "~" }),
|
|
5723
5865
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate text-left", children: endText })
|
|
5724
|
-
] }) :
|
|
5866
|
+
] }) : resolvedPlaceholder
|
|
5725
5867
|
}
|
|
5726
5868
|
)
|
|
5727
5869
|
]
|
|
@@ -5740,6 +5882,7 @@ function SDateRangePicker({
|
|
|
5740
5882
|
value: value ?? null,
|
|
5741
5883
|
selectable,
|
|
5742
5884
|
maxRange,
|
|
5885
|
+
useTimePicker,
|
|
5743
5886
|
onSelect: select,
|
|
5744
5887
|
onPendingStartChange: setPendingStart,
|
|
5745
5888
|
onViewChange
|