@x-plat/design-system 0.4.2 → 0.4.4
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/components/Calendar/index.cjs +132 -69
- package/dist/components/Calendar/index.css +40 -23
- package/dist/components/Calendar/index.d.cts +0 -13
- package/dist/components/Calendar/index.d.ts +0 -13
- package/dist/components/Calendar/index.js +133 -70
- package/dist/components/DatePicker/index.cjs +126 -37
- package/dist/components/DatePicker/index.css +51 -8
- package/dist/components/DatePicker/index.js +127 -38
- package/dist/components/ImageSelector/index.css +1 -0
- package/dist/components/Modal/index.css +1 -1
- package/dist/components/PopOver/index.css +1 -0
- package/dist/components/index.cjs +258 -106
- package/dist/components/index.css +93 -31
- package/dist/components/index.js +262 -110
- package/dist/index.cjs +258 -106
- package/dist/index.css +93 -31
- package/dist/index.js +264 -112
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5776,7 +5776,7 @@ var MONTH_LABELS = {
|
|
|
5776
5776
|
};
|
|
5777
5777
|
|
|
5778
5778
|
// src/components/Calendar/Calendar.tsx
|
|
5779
|
-
import { jsx as jsx301, jsxs as jsxs193 } from "react/jsx-runtime";
|
|
5779
|
+
import { Fragment, jsx as jsx301, jsxs as jsxs193 } from "react/jsx-runtime";
|
|
5780
5780
|
var Calendar = (props) => {
|
|
5781
5781
|
const {
|
|
5782
5782
|
year: yearProp,
|
|
@@ -5804,6 +5804,10 @@ var Calendar = (props) => {
|
|
|
5804
5804
|
setYear,
|
|
5805
5805
|
setMonth
|
|
5806
5806
|
} = useCalendar(yearProp, monthProp);
|
|
5807
|
+
const [pickerMode, setPickerMode] = React3.useState("days");
|
|
5808
|
+
const [yearRangeStart, setYearRangeStart] = React3.useState(
|
|
5809
|
+
Math.floor(year / 12) * 12
|
|
5810
|
+
);
|
|
5807
5811
|
React3.useEffect(() => {
|
|
5808
5812
|
if (yearProp !== void 0) setYear(yearProp);
|
|
5809
5813
|
}, [yearProp, setYear]);
|
|
@@ -5811,22 +5815,54 @@ var Calendar = (props) => {
|
|
|
5811
5815
|
if (monthProp !== void 0) setMonth(monthProp);
|
|
5812
5816
|
}, [monthProp, setMonth]);
|
|
5813
5817
|
const handlePrev = () => {
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
+
if (pickerMode === "days") {
|
|
5819
|
+
goToPrevMonth();
|
|
5820
|
+
const prevMonth = month === 0 ? 11 : month - 1;
|
|
5821
|
+
const prevYear = month === 0 ? year - 1 : year;
|
|
5822
|
+
onMonthChange?.(prevYear, prevMonth);
|
|
5823
|
+
} else if (pickerMode === "months") {
|
|
5824
|
+
setYear(year - 1);
|
|
5825
|
+
onMonthChange?.(year - 1, month);
|
|
5826
|
+
} else {
|
|
5827
|
+
setYearRangeStart((s) => s - 12);
|
|
5828
|
+
}
|
|
5818
5829
|
};
|
|
5819
5830
|
const handleNext = () => {
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5831
|
+
if (pickerMode === "days") {
|
|
5832
|
+
goToNextMonth();
|
|
5833
|
+
const nextMonth = month === 11 ? 0 : month + 1;
|
|
5834
|
+
const nextYear = month === 11 ? year + 1 : year;
|
|
5835
|
+
onMonthChange?.(nextYear, nextMonth);
|
|
5836
|
+
} else if (pickerMode === "months") {
|
|
5837
|
+
setYear(year + 1);
|
|
5838
|
+
onMonthChange?.(year + 1, month);
|
|
5839
|
+
} else {
|
|
5840
|
+
setYearRangeStart((s) => s + 12);
|
|
5841
|
+
}
|
|
5824
5842
|
};
|
|
5825
5843
|
const handleToday = () => {
|
|
5826
5844
|
goToToday();
|
|
5845
|
+
setPickerMode("days");
|
|
5827
5846
|
const today = /* @__PURE__ */ new Date();
|
|
5828
5847
|
onMonthChange?.(today.getFullYear(), today.getMonth());
|
|
5829
5848
|
};
|
|
5849
|
+
const handleTitleClick = () => {
|
|
5850
|
+
if (pickerMode === "days") setPickerMode("months");
|
|
5851
|
+
else if (pickerMode === "months") {
|
|
5852
|
+
setYearRangeStart(Math.floor(year / 12) * 12);
|
|
5853
|
+
setPickerMode("years");
|
|
5854
|
+
}
|
|
5855
|
+
};
|
|
5856
|
+
const handleMonthSelect = (m) => {
|
|
5857
|
+
setMonth(m);
|
|
5858
|
+
setPickerMode("days");
|
|
5859
|
+
onMonthChange?.(year, m);
|
|
5860
|
+
};
|
|
5861
|
+
const handleYearSelect = (y) => {
|
|
5862
|
+
setYear(y);
|
|
5863
|
+
setPickerMode("months");
|
|
5864
|
+
onMonthChange?.(y, month);
|
|
5865
|
+
};
|
|
5830
5866
|
const isDisabled = (date) => {
|
|
5831
5867
|
if (minDate && date < new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate())) return true;
|
|
5832
5868
|
if (maxDate && date > new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate())) return true;
|
|
@@ -5834,6 +5870,8 @@ var Calendar = (props) => {
|
|
|
5834
5870
|
};
|
|
5835
5871
|
const getEventsForDay = (date) => events.filter((e) => isSameDay(e.date, date));
|
|
5836
5872
|
const weekdays = WEEKDAY_LABELS[locale];
|
|
5873
|
+
const monthLabels = MONTH_LABELS[locale];
|
|
5874
|
+
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
5837
5875
|
return /* @__PURE__ */ jsxs193(
|
|
5838
5876
|
"div",
|
|
5839
5877
|
{
|
|
@@ -5841,29 +5879,71 @@ var Calendar = (props) => {
|
|
|
5841
5879
|
style: selectedColor ? { "--calendar-selected-color": `var(--${selectedColor})` } : void 0,
|
|
5842
5880
|
children: [
|
|
5843
5881
|
/* @__PURE__ */ jsxs193("div", { className: "calendar-header", children: [
|
|
5844
|
-
/* @__PURE__ */ jsx301("button", { className: "calendar-nav", onClick: handlePrev, "aria-label": "\uC774\uC804
|
|
5845
|
-
/* @__PURE__ */ jsx301("
|
|
5846
|
-
/* @__PURE__ */ jsx301("button", { className: "calendar-nav", onClick: handleNext, "aria-label": "\uB2E4\uC74C
|
|
5882
|
+
/* @__PURE__ */ jsx301("button", { className: "calendar-nav", onClick: handlePrev, "aria-label": "\uC774\uC804", children: /* @__PURE__ */ jsx301(ChevronLeftIcon_default, {}) }),
|
|
5883
|
+
/* @__PURE__ */ jsx301("button", { className: "calendar-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
5884
|
+
/* @__PURE__ */ jsx301("button", { className: "calendar-nav", onClick: handleNext, "aria-label": "\uB2E4\uC74C", children: /* @__PURE__ */ jsx301(ChevronRightIcon_default, {}) }),
|
|
5847
5885
|
showToday && /* @__PURE__ */ jsx301("button", { className: "calendar-today-btn", onClick: handleToday, children: locale === "ko" ? "\uC624\uB298" : "Today" })
|
|
5848
5886
|
] }),
|
|
5849
|
-
/* @__PURE__ */ jsx301("div", { className: "calendar-
|
|
5850
|
-
|
|
5887
|
+
pickerMode === "years" && /* @__PURE__ */ jsx301("div", { className: "calendar-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
5888
|
+
const y = yearRangeStart + i;
|
|
5889
|
+
return /* @__PURE__ */ jsx301(
|
|
5890
|
+
"button",
|
|
5891
|
+
{
|
|
5892
|
+
type: "button",
|
|
5893
|
+
className: clsx_default("calendar-picker-cell", y === year && "active"),
|
|
5894
|
+
onClick: () => handleYearSelect(y),
|
|
5895
|
+
children: y
|
|
5896
|
+
},
|
|
5897
|
+
y
|
|
5898
|
+
);
|
|
5899
|
+
}) }),
|
|
5900
|
+
pickerMode === "months" && /* @__PURE__ */ jsx301("div", { className: "calendar-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ jsx301(
|
|
5901
|
+
"button",
|
|
5851
5902
|
{
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
i === 6 && "saturday"
|
|
5856
|
-
),
|
|
5903
|
+
type: "button",
|
|
5904
|
+
className: clsx_default("calendar-picker-cell", i === month && "active"),
|
|
5905
|
+
onClick: () => handleMonthSelect(i),
|
|
5857
5906
|
children: label
|
|
5858
5907
|
},
|
|
5859
|
-
|
|
5908
|
+
i
|
|
5860
5909
|
)) }),
|
|
5861
|
-
/* @__PURE__ */
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5910
|
+
pickerMode === "days" && /* @__PURE__ */ jsxs193(Fragment, { children: [
|
|
5911
|
+
/* @__PURE__ */ jsx301("div", { className: "calendar-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx301(
|
|
5912
|
+
"div",
|
|
5913
|
+
{
|
|
5914
|
+
className: clsx_default(
|
|
5915
|
+
"calendar-weekday",
|
|
5916
|
+
i === 0 && "sunday",
|
|
5917
|
+
i === 6 && "saturday"
|
|
5918
|
+
),
|
|
5919
|
+
children: label
|
|
5920
|
+
},
|
|
5921
|
+
label
|
|
5922
|
+
)) }),
|
|
5923
|
+
/* @__PURE__ */ jsx301("div", { className: "calendar-grid", children: days.map((day, idx) => {
|
|
5924
|
+
const dayEvents = getEventsForDay(day.date);
|
|
5925
|
+
const disabled = isDisabled(day.date);
|
|
5926
|
+
const isSelected = selectedDate ? isSameDay(day.date, selectedDate) : false;
|
|
5927
|
+
if (renderDay) {
|
|
5928
|
+
return /* @__PURE__ */ jsx301(
|
|
5929
|
+
"div",
|
|
5930
|
+
{
|
|
5931
|
+
className: clsx_default(
|
|
5932
|
+
"calendar-day",
|
|
5933
|
+
!day.isCurrentMonth && "outside",
|
|
5934
|
+
disabled && "disabled",
|
|
5935
|
+
isSelected && "selected",
|
|
5936
|
+
day.isToday && "today"
|
|
5937
|
+
),
|
|
5938
|
+
onClick: () => {
|
|
5939
|
+
if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
|
|
5940
|
+
},
|
|
5941
|
+
children: renderDay(day, dayEvents)
|
|
5942
|
+
},
|
|
5943
|
+
idx
|
|
5944
|
+
);
|
|
5945
|
+
}
|
|
5946
|
+
return /* @__PURE__ */ jsxs193(
|
|
5867
5947
|
"div",
|
|
5868
5948
|
{
|
|
5869
5949
|
className: clsx_default(
|
|
@@ -5871,57 +5951,40 @@ var Calendar = (props) => {
|
|
|
5871
5951
|
!day.isCurrentMonth && "outside",
|
|
5872
5952
|
disabled && "disabled",
|
|
5873
5953
|
isSelected && "selected",
|
|
5874
|
-
day.isToday && "today"
|
|
5954
|
+
day.isToday && "today",
|
|
5955
|
+
day.isSunday && "sunday",
|
|
5956
|
+
day.isSaturday && "saturday"
|
|
5875
5957
|
),
|
|
5876
5958
|
onClick: () => {
|
|
5877
5959
|
if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
|
|
5878
5960
|
},
|
|
5879
|
-
children:
|
|
5961
|
+
children: [
|
|
5962
|
+
/* @__PURE__ */ jsx301("span", { className: "calendar-day-number", children: day.day }),
|
|
5963
|
+
dayEvents.length > 0 && /* @__PURE__ */ jsxs193("div", { className: "calendar-day-events", children: [
|
|
5964
|
+
dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ jsx301(
|
|
5965
|
+
"span",
|
|
5966
|
+
{
|
|
5967
|
+
className: "calendar-event-dot",
|
|
5968
|
+
style: { backgroundColor: event.color ?? "var(--xplat-blue-500)" },
|
|
5969
|
+
title: event.label,
|
|
5970
|
+
onClick: (e) => {
|
|
5971
|
+
e.stopPropagation();
|
|
5972
|
+
onEventClick?.(event);
|
|
5973
|
+
}
|
|
5974
|
+
},
|
|
5975
|
+
ei
|
|
5976
|
+
)),
|
|
5977
|
+
dayEvents.length > 3 && /* @__PURE__ */ jsxs193("span", { className: "calendar-event-more", children: [
|
|
5978
|
+
"+",
|
|
5979
|
+
dayEvents.length - 3
|
|
5980
|
+
] })
|
|
5981
|
+
] })
|
|
5982
|
+
]
|
|
5880
5983
|
},
|
|
5881
5984
|
idx
|
|
5882
5985
|
);
|
|
5883
|
-
}
|
|
5884
|
-
|
|
5885
|
-
"div",
|
|
5886
|
-
{
|
|
5887
|
-
className: clsx_default(
|
|
5888
|
-
"calendar-day",
|
|
5889
|
-
!day.isCurrentMonth && "outside",
|
|
5890
|
-
disabled && "disabled",
|
|
5891
|
-
isSelected && "selected",
|
|
5892
|
-
day.isToday && "today",
|
|
5893
|
-
day.isSunday && "sunday",
|
|
5894
|
-
day.isSaturday && "saturday"
|
|
5895
|
-
),
|
|
5896
|
-
onClick: () => {
|
|
5897
|
-
if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
|
|
5898
|
-
},
|
|
5899
|
-
children: [
|
|
5900
|
-
/* @__PURE__ */ jsx301("span", { className: "calendar-day-number", children: day.day }),
|
|
5901
|
-
dayEvents.length > 0 && /* @__PURE__ */ jsxs193("div", { className: "calendar-day-events", children: [
|
|
5902
|
-
dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ jsx301(
|
|
5903
|
-
"span",
|
|
5904
|
-
{
|
|
5905
|
-
className: "calendar-event-dot",
|
|
5906
|
-
style: { backgroundColor: event.color ?? "var(--xplat-blue-500)" },
|
|
5907
|
-
title: event.label,
|
|
5908
|
-
onClick: (e) => {
|
|
5909
|
-
e.stopPropagation();
|
|
5910
|
-
onEventClick?.(event);
|
|
5911
|
-
}
|
|
5912
|
-
},
|
|
5913
|
-
ei
|
|
5914
|
-
)),
|
|
5915
|
-
dayEvents.length > 3 && /* @__PURE__ */ jsxs193("span", { className: "calendar-event-more", children: [
|
|
5916
|
-
"+",
|
|
5917
|
-
dayEvents.length - 3
|
|
5918
|
-
] })
|
|
5919
|
-
] })
|
|
5920
|
-
]
|
|
5921
|
-
},
|
|
5922
|
-
idx
|
|
5923
|
-
);
|
|
5924
|
-
}) })
|
|
5986
|
+
}) })
|
|
5987
|
+
] })
|
|
5925
5988
|
]
|
|
5926
5989
|
}
|
|
5927
5990
|
);
|
|
@@ -20815,7 +20878,7 @@ var useClickOutside_default = useClickOutside;
|
|
|
20815
20878
|
|
|
20816
20879
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
20817
20880
|
import React9 from "react";
|
|
20818
|
-
import { jsx as jsx312, jsxs as jsxs199 } from "react/jsx-runtime";
|
|
20881
|
+
import { Fragment as Fragment2, jsx as jsx312, jsxs as jsxs199 } from "react/jsx-runtime";
|
|
20819
20882
|
var DayCell = React9.memo(
|
|
20820
20883
|
({
|
|
20821
20884
|
day,
|
|
@@ -20859,10 +20922,14 @@ var SingleDatePicker = (props) => {
|
|
|
20859
20922
|
} = props;
|
|
20860
20923
|
const initialYear = value?.getFullYear();
|
|
20861
20924
|
const initialMonth = value?.getMonth();
|
|
20862
|
-
const { year, month, days, goToPrevMonth, goToNextMonth } = useCalendar(
|
|
20925
|
+
const { year, month, days, goToPrevMonth, goToNextMonth, setYear, setMonth } = useCalendar(
|
|
20863
20926
|
initialYear,
|
|
20864
20927
|
initialMonth
|
|
20865
20928
|
);
|
|
20929
|
+
const [pickerMode, setPickerMode] = React9.useState("days");
|
|
20930
|
+
const [yearRangeStart, setYearRangeStart] = React9.useState(
|
|
20931
|
+
Math.floor((initialYear ?? (/* @__PURE__ */ new Date()).getFullYear()) / 12) * 12
|
|
20932
|
+
);
|
|
20866
20933
|
const minTime = React9.useMemo(
|
|
20867
20934
|
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
20868
20935
|
[minDate]
|
|
@@ -20884,7 +20951,34 @@ var SingleDatePicker = (props) => {
|
|
|
20884
20951
|
},
|
|
20885
20952
|
[onChange]
|
|
20886
20953
|
);
|
|
20954
|
+
const handlePrev = () => {
|
|
20955
|
+
if (pickerMode === "days") goToPrevMonth();
|
|
20956
|
+
else if (pickerMode === "months") setYear(year - 1);
|
|
20957
|
+
else setYearRangeStart((s) => s - 12);
|
|
20958
|
+
};
|
|
20959
|
+
const handleNext = () => {
|
|
20960
|
+
if (pickerMode === "days") goToNextMonth();
|
|
20961
|
+
else if (pickerMode === "months") setYear(year + 1);
|
|
20962
|
+
else setYearRangeStart((s) => s + 12);
|
|
20963
|
+
};
|
|
20964
|
+
const handleTitleClick = () => {
|
|
20965
|
+
if (pickerMode === "days") setPickerMode("months");
|
|
20966
|
+
else if (pickerMode === "months") {
|
|
20967
|
+
setYearRangeStart(Math.floor(year / 12) * 12);
|
|
20968
|
+
setPickerMode("years");
|
|
20969
|
+
}
|
|
20970
|
+
};
|
|
20971
|
+
const handleMonthSelect = (m) => {
|
|
20972
|
+
setMonth(m);
|
|
20973
|
+
setPickerMode("days");
|
|
20974
|
+
};
|
|
20975
|
+
const handleYearSelect = (y) => {
|
|
20976
|
+
setYear(y);
|
|
20977
|
+
setPickerMode("months");
|
|
20978
|
+
};
|
|
20887
20979
|
const weekdays = WEEKDAY_LABELS[locale];
|
|
20980
|
+
const monthLabels = MONTH_LABELS[locale];
|
|
20981
|
+
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
20888
20982
|
return /* @__PURE__ */ jsxs199(
|
|
20889
20983
|
"div",
|
|
20890
20984
|
{
|
|
@@ -20892,41 +20986,66 @@ var SingleDatePicker = (props) => {
|
|
|
20892
20986
|
style: { "--datepicker-active-color": `var(--${color2})` },
|
|
20893
20987
|
children: [
|
|
20894
20988
|
/* @__PURE__ */ jsxs199("div", { className: "datepicker-header", children: [
|
|
20895
|
-
/* @__PURE__ */ jsx312("button", { className: "datepicker-nav", onClick:
|
|
20896
|
-
/* @__PURE__ */ jsx312("
|
|
20897
|
-
/* @__PURE__ */ jsx312("button", { className: "datepicker-nav", onClick:
|
|
20989
|
+
/* @__PURE__ */ jsx312("button", { className: "datepicker-nav", onClick: handlePrev, type: "button", children: /* @__PURE__ */ jsx312(ChevronLeftIcon_default, {}) }),
|
|
20990
|
+
/* @__PURE__ */ jsx312("button", { className: "datepicker-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
20991
|
+
/* @__PURE__ */ jsx312("button", { className: "datepicker-nav", onClick: handleNext, type: "button", children: /* @__PURE__ */ jsx312(ChevronRightIcon_default, {}) })
|
|
20898
20992
|
] }),
|
|
20899
|
-
/* @__PURE__ */ jsx312("div", { className: "datepicker-
|
|
20900
|
-
|
|
20993
|
+
pickerMode === "years" && /* @__PURE__ */ jsx312("div", { className: "datepicker-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
20994
|
+
const y = yearRangeStart + i;
|
|
20995
|
+
return /* @__PURE__ */ jsx312(
|
|
20996
|
+
"button",
|
|
20997
|
+
{
|
|
20998
|
+
type: "button",
|
|
20999
|
+
className: clsx_default("datepicker-picker-cell", y === year && "active"),
|
|
21000
|
+
onClick: () => handleYearSelect(y),
|
|
21001
|
+
children: y
|
|
21002
|
+
},
|
|
21003
|
+
y
|
|
21004
|
+
);
|
|
21005
|
+
}) }),
|
|
21006
|
+
pickerMode === "months" && /* @__PURE__ */ jsx312("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ jsx312(
|
|
21007
|
+
"button",
|
|
20901
21008
|
{
|
|
20902
|
-
|
|
20903
|
-
|
|
20904
|
-
|
|
20905
|
-
i === 6 && "saturday"
|
|
20906
|
-
),
|
|
21009
|
+
type: "button",
|
|
21010
|
+
className: clsx_default("datepicker-picker-cell", i === month && "active"),
|
|
21011
|
+
onClick: () => handleMonthSelect(i),
|
|
20907
21012
|
children: label
|
|
20908
21013
|
},
|
|
20909
|
-
|
|
21014
|
+
i
|
|
20910
21015
|
)) }),
|
|
20911
|
-
/* @__PURE__ */
|
|
20912
|
-
|
|
20913
|
-
|
|
20914
|
-
const selected = value ? isSameDay(day.date, value) : false;
|
|
20915
|
-
const highlighted = highlightSet.has(
|
|
20916
|
-
`${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
|
|
20917
|
-
);
|
|
20918
|
-
return /* @__PURE__ */ jsx312(
|
|
20919
|
-
DayCell,
|
|
21016
|
+
pickerMode === "days" && /* @__PURE__ */ jsxs199(Fragment2, { children: [
|
|
21017
|
+
/* @__PURE__ */ jsx312("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx312(
|
|
21018
|
+
"div",
|
|
20920
21019
|
{
|
|
20921
|
-
|
|
20922
|
-
|
|
20923
|
-
|
|
20924
|
-
|
|
20925
|
-
|
|
21020
|
+
className: clsx_default(
|
|
21021
|
+
"datepicker-weekday",
|
|
21022
|
+
i === 0 && "sunday",
|
|
21023
|
+
i === 6 && "saturday"
|
|
21024
|
+
),
|
|
21025
|
+
children: label
|
|
20926
21026
|
},
|
|
20927
|
-
|
|
20928
|
-
)
|
|
20929
|
-
|
|
21027
|
+
label
|
|
21028
|
+
)) }),
|
|
21029
|
+
/* @__PURE__ */ jsx312("div", { className: "datepicker-grid", children: days.map((day, idx) => {
|
|
21030
|
+
const t = day.date.getTime();
|
|
21031
|
+
const disabled = t < minTime || t > maxTime;
|
|
21032
|
+
const selected = value ? isSameDay(day.date, value) : false;
|
|
21033
|
+
const highlighted = highlightSet.has(
|
|
21034
|
+
`${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
|
|
21035
|
+
);
|
|
21036
|
+
return /* @__PURE__ */ jsx312(
|
|
21037
|
+
DayCell,
|
|
21038
|
+
{
|
|
21039
|
+
day,
|
|
21040
|
+
disabled,
|
|
21041
|
+
selected,
|
|
21042
|
+
highlighted,
|
|
21043
|
+
onSelect: handleSelect
|
|
21044
|
+
},
|
|
21045
|
+
idx
|
|
21046
|
+
);
|
|
21047
|
+
}) })
|
|
21048
|
+
] })
|
|
20930
21049
|
]
|
|
20931
21050
|
}
|
|
20932
21051
|
);
|
|
@@ -21041,9 +21160,24 @@ var RangePicker = (props) => {
|
|
|
21041
21160
|
} = props;
|
|
21042
21161
|
const startCal = useCalendar(startDate.getFullYear(), startDate.getMonth());
|
|
21043
21162
|
const endCal = useCalendar(endDate.getFullYear(), endDate.getMonth());
|
|
21044
|
-
const isDisabled = (date) => {
|
|
21045
|
-
|
|
21046
|
-
if (
|
|
21163
|
+
const isDisabled = (date, type) => {
|
|
21164
|
+
const d = date.getTime();
|
|
21165
|
+
if (minDate) {
|
|
21166
|
+
const min = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime();
|
|
21167
|
+
if (d < min) return true;
|
|
21168
|
+
}
|
|
21169
|
+
if (maxDate) {
|
|
21170
|
+
const max = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime();
|
|
21171
|
+
if (d > max) return true;
|
|
21172
|
+
}
|
|
21173
|
+
if (type === "end") {
|
|
21174
|
+
const start = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate()).getTime();
|
|
21175
|
+
if (d < start) return true;
|
|
21176
|
+
}
|
|
21177
|
+
if (type === "start") {
|
|
21178
|
+
const end = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate()).getTime();
|
|
21179
|
+
if (d > end) return true;
|
|
21180
|
+
}
|
|
21047
21181
|
return false;
|
|
21048
21182
|
};
|
|
21049
21183
|
const weekdays = WEEKDAY_LABELS[locale];
|
|
@@ -21052,9 +21186,25 @@ var RangePicker = (props) => {
|
|
|
21052
21186
|
return /* @__PURE__ */ jsxs201("div", { className: "datepicker-range-panel", children: [
|
|
21053
21187
|
/* @__PURE__ */ jsx315("span", { className: "datepicker-range-label", children: label }),
|
|
21054
21188
|
/* @__PURE__ */ jsxs201("div", { className: "datepicker-header", children: [
|
|
21055
|
-
/* @__PURE__ */ jsx315(
|
|
21189
|
+
/* @__PURE__ */ jsx315(
|
|
21190
|
+
"button",
|
|
21191
|
+
{
|
|
21192
|
+
className: "datepicker-nav",
|
|
21193
|
+
onClick: cal.goToPrevMonth,
|
|
21194
|
+
type: "button",
|
|
21195
|
+
children: /* @__PURE__ */ jsx315(ChevronLeftIcon_default, {})
|
|
21196
|
+
}
|
|
21197
|
+
),
|
|
21056
21198
|
/* @__PURE__ */ jsx315("span", { className: "datepicker-title", children: locale === "ko" ? `${cal.year}\uB144 ${MONTH_LABELS.ko[cal.month]}` : `${MONTH_LABELS.en[cal.month]} ${cal.year}` }),
|
|
21057
|
-
/* @__PURE__ */ jsx315(
|
|
21199
|
+
/* @__PURE__ */ jsx315(
|
|
21200
|
+
"button",
|
|
21201
|
+
{
|
|
21202
|
+
className: "datepicker-nav",
|
|
21203
|
+
onClick: cal.goToNextMonth,
|
|
21204
|
+
type: "button",
|
|
21205
|
+
children: /* @__PURE__ */ jsx315(ChevronRightIcon_default, {})
|
|
21206
|
+
}
|
|
21207
|
+
)
|
|
21058
21208
|
] }),
|
|
21059
21209
|
/* @__PURE__ */ jsx315("div", { className: "datepicker-weekdays", children: weekdays.map((w, i) => /* @__PURE__ */ jsx315(
|
|
21060
21210
|
"div",
|
|
@@ -21069,7 +21219,7 @@ var RangePicker = (props) => {
|
|
|
21069
21219
|
w
|
|
21070
21220
|
)) }),
|
|
21071
21221
|
/* @__PURE__ */ jsx315("div", { className: "datepicker-grid", children: cal.days.map((day, idx) => {
|
|
21072
|
-
const disabled = isDisabled(day.date);
|
|
21222
|
+
const disabled = isDisabled(day.date, type);
|
|
21073
21223
|
const isStart = isSameDay(day.date, startDate);
|
|
21074
21224
|
const isEnd = isSameDay(day.date, endDate);
|
|
21075
21225
|
const inRange2 = isInRange(day.date, startDate, endDate);
|
|
@@ -21110,7 +21260,9 @@ var RangePicker = (props) => {
|
|
|
21110
21260
|
"div",
|
|
21111
21261
|
{
|
|
21112
21262
|
className: clsx_default("lib-xplat-datepicker", "range"),
|
|
21113
|
-
style: {
|
|
21263
|
+
style: {
|
|
21264
|
+
"--datepicker-active-color": `var(--${color2})`
|
|
21265
|
+
},
|
|
21114
21266
|
children: [
|
|
21115
21267
|
renderCalendar(startCal, "start"),
|
|
21116
21268
|
renderCalendar(endCal, "end")
|
|
@@ -21135,7 +21287,7 @@ var PopupPicker = (props) => {
|
|
|
21135
21287
|
};
|
|
21136
21288
|
return /* @__PURE__ */ jsxs202("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
21137
21289
|
React12.cloneElement(component, { onClick: handleClick }),
|
|
21138
|
-
/* @__PURE__ */ jsx316(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs202("div", { className: "lib-xplat-popup-datepicker-card", children: [
|
|
21290
|
+
/* @__PURE__ */ jsx316(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
21139
21291
|
/* @__PURE__ */ jsxs202("div", { className: "popup-datepicker-content", children: [
|
|
21140
21292
|
type === "single" && /* @__PURE__ */ jsx316(
|
|
21141
21293
|
SingleDatePicker_default,
|
|
@@ -22063,10 +22215,10 @@ Radio.displayName = "Radio";
|
|
|
22063
22215
|
var Radio_default = Radio;
|
|
22064
22216
|
|
|
22065
22217
|
// src/components/Radio/RadioGroup.tsx
|
|
22066
|
-
import { Fragment, jsx as jsx330 } from "react/jsx-runtime";
|
|
22218
|
+
import { Fragment as Fragment3, jsx as jsx330 } from "react/jsx-runtime";
|
|
22067
22219
|
var RadioGroup = (props) => {
|
|
22068
22220
|
const { children, ...rest } = props;
|
|
22069
|
-
return /* @__PURE__ */ jsx330(
|
|
22221
|
+
return /* @__PURE__ */ jsx330(Fragment3, { children: /* @__PURE__ */ jsx330(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
22070
22222
|
};
|
|
22071
22223
|
RadioGroup.displayName = "RadioGroup";
|
|
22072
22224
|
var RadioGroup_default = RadioGroup;
|
|
@@ -23076,11 +23228,11 @@ Header.displayName = "Header";
|
|
|
23076
23228
|
var Header_default = Header;
|
|
23077
23229
|
|
|
23078
23230
|
// src/layout/Layout/Layout.tsx
|
|
23079
|
-
import { Fragment as
|
|
23231
|
+
import { Fragment as Fragment4, jsx as jsx352, jsxs as jsxs222 } from "react/jsx-runtime";
|
|
23080
23232
|
var Layout = (props) => {
|
|
23081
23233
|
const { header, sideBar, children } = props;
|
|
23082
23234
|
return /* @__PURE__ */ jsx352("div", { className: "lib-xplat-layout", children: /* @__PURE__ */ jsxs222("div", { className: "lib-xplat-layout-content-wrapper", children: [
|
|
23083
|
-
sideBar && /* @__PURE__ */ jsx352(
|
|
23235
|
+
sideBar && /* @__PURE__ */ jsx352(Fragment4, { children: sideBar }),
|
|
23084
23236
|
/* @__PURE__ */ jsxs222("div", { className: "lib-xplat-layout-content", children: [
|
|
23085
23237
|
header && /* @__PURE__ */ jsx352("div", { className: "lib-xplat-layout-conent-header", children: header }),
|
|
23086
23238
|
children
|