@anker-in/ui 0.1.9 → 0.1.10
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/demo-room.d.mts +3 -57
- package/dist/demo-room.d.ts +3 -57
- package/dist/demo-room.js +18 -211
- package/dist/demo-room.js.map +1 -1
- package/dist/demo-room.mjs +19 -210
- package/dist/demo-room.mjs.map +1 -1
- package/dist/index.js +314 -164
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +314 -164
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -73,7 +73,10 @@ var StudioCard = ({
|
|
|
73
73
|
"div",
|
|
74
74
|
{
|
|
75
75
|
...props,
|
|
76
|
-
className: cn(
|
|
76
|
+
className: cn(
|
|
77
|
+
"p-6 cursor-pointer transition-colors duration-200",
|
|
78
|
+
className
|
|
79
|
+
),
|
|
77
80
|
style: {
|
|
78
81
|
backgroundColor: isHovered ? "#f3f4f6" : "transparent",
|
|
79
82
|
...style
|
|
@@ -95,7 +98,7 @@ var StudioCard = ({
|
|
|
95
98
|
pageData.away
|
|
96
99
|
] })
|
|
97
100
|
] }),
|
|
98
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 mb-3", children: [
|
|
101
|
+
availableTime && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 mb-3", children: [
|
|
99
102
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
100
103
|
"svg",
|
|
101
104
|
{
|
|
@@ -149,7 +152,7 @@ var StudioCard = ({
|
|
|
149
152
|
}
|
|
150
153
|
),
|
|
151
154
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-gray-600", children: [
|
|
152
|
-
pageData.available,
|
|
155
|
+
availableTime === pageData.noAvailableTime ? "" : pageData.available,
|
|
153
156
|
" ",
|
|
154
157
|
availableTime
|
|
155
158
|
] }) })
|
|
@@ -384,7 +387,7 @@ var StudioMap = ({
|
|
|
384
387
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
385
388
|
<path d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z"/>
|
|
386
389
|
</svg>
|
|
387
|
-
<span style="vertical-align: middle;"
|
|
390
|
+
<span style="vertical-align: middle;"> ${location.availableTime === pageData?.noAvailableTime ? "" : pageData.available} ${location.availableTime}</span>
|
|
388
391
|
</div>` : ""}
|
|
389
392
|
<div style="margin-bottom: 8px; color: #666;">
|
|
390
393
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
@@ -1268,13 +1271,13 @@ var RoomsList = ({
|
|
|
1268
1271
|
state,
|
|
1269
1272
|
zipCode: "",
|
|
1270
1273
|
country,
|
|
1271
|
-
lat: Number(room.latitude) ||
|
|
1272
|
-
lng: Number(room.longitude) ||
|
|
1274
|
+
lat: Number(room.latitude) || 0,
|
|
1275
|
+
lng: Number(room.longitude) || 0,
|
|
1273
1276
|
availableTime: nextAvailableTimeslot ? `${nextAvailableTimeslot.start_time}` : mergedPageData.noAvailableTime,
|
|
1274
1277
|
euifyMakeModel: room?.description
|
|
1275
1278
|
};
|
|
1276
1279
|
});
|
|
1277
|
-
}, [demoRooms]);
|
|
1280
|
+
}, [demoRooms, mergedPageData.defaultCountry, mergedPageData.noAvailableTime]);
|
|
1278
1281
|
const filteredStudioLocations = React2.useMemo(() => {
|
|
1279
1282
|
if (!selectedLocation) return studioLocations;
|
|
1280
1283
|
return studioLocations.filter((location) => {
|
|
@@ -1396,7 +1399,10 @@ var RoomsList = ({
|
|
|
1396
1399
|
onSchedule,
|
|
1397
1400
|
onMouseEnter: () => setHoveredRoomId(item.id),
|
|
1398
1401
|
onMouseLeave: () => setHoveredRoomId(null),
|
|
1399
|
-
pageData:
|
|
1402
|
+
pageData: {
|
|
1403
|
+
...mergedPageData.studioCard,
|
|
1404
|
+
noAvailableTime: mergedPageData?.noAvailableTime
|
|
1405
|
+
}
|
|
1400
1406
|
},
|
|
1401
1407
|
item.id
|
|
1402
1408
|
);
|
|
@@ -1429,7 +1435,10 @@ var RoomsList = ({
|
|
|
1429
1435
|
hoveredLocationId: hoveredRoomId,
|
|
1430
1436
|
onSchedule,
|
|
1431
1437
|
mapHeight: "794px",
|
|
1432
|
-
pageData:
|
|
1438
|
+
pageData: {
|
|
1439
|
+
...mergedPageData.map,
|
|
1440
|
+
noAvailableTime: pageData?.noAvailableTime
|
|
1441
|
+
}
|
|
1433
1442
|
}
|
|
1434
1443
|
) })
|
|
1435
1444
|
] })
|
|
@@ -1644,6 +1653,21 @@ var QuestionnaireForm = ({
|
|
|
1644
1653
|
const [errors, setErrors] = React2.useState({});
|
|
1645
1654
|
const [agreements, setAgreements] = React2.useState({});
|
|
1646
1655
|
const [agreementError, setAgreementError] = React2.useState("");
|
|
1656
|
+
const [phoneCountryCodes, setPhoneCountryCodes] = React2.useState({});
|
|
1657
|
+
const defaultCountryCodes = [
|
|
1658
|
+
{ code: "+1", country: "US/CA" },
|
|
1659
|
+
{ code: "+86", country: "CN" },
|
|
1660
|
+
{ code: "+44", country: "UK" },
|
|
1661
|
+
{ code: "+81", country: "JP" },
|
|
1662
|
+
{ code: "+82", country: "KR" },
|
|
1663
|
+
{ code: "+65", country: "SG" },
|
|
1664
|
+
{ code: "+852", country: "HK" },
|
|
1665
|
+
{ code: "+886", country: "TW" },
|
|
1666
|
+
{ code: "+61", country: "AU" },
|
|
1667
|
+
{ code: "+49", country: "DE" },
|
|
1668
|
+
{ code: "+33", country: "FR" }
|
|
1669
|
+
];
|
|
1670
|
+
const countryCodes = pageData?.countryCodes || defaultCountryCodes;
|
|
1647
1671
|
const getQuestionId = (question) => {
|
|
1648
1672
|
return question.id || question.key || "";
|
|
1649
1673
|
};
|
|
@@ -1660,6 +1684,22 @@ var QuestionnaireForm = ({
|
|
|
1660
1684
|
});
|
|
1661
1685
|
}
|
|
1662
1686
|
};
|
|
1687
|
+
const handleEmailBlur = (questionId, value) => {
|
|
1688
|
+
if (!value) return;
|
|
1689
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
1690
|
+
if (!emailRegex.test(value)) {
|
|
1691
|
+
setErrors((prev) => ({
|
|
1692
|
+
...prev,
|
|
1693
|
+
[questionId]: "Please enter a valid email address"
|
|
1694
|
+
}));
|
|
1695
|
+
}
|
|
1696
|
+
};
|
|
1697
|
+
const handleCountryCodeChange = (questionId, code) => {
|
|
1698
|
+
setPhoneCountryCodes((prev) => ({
|
|
1699
|
+
...prev,
|
|
1700
|
+
[questionId]: code
|
|
1701
|
+
}));
|
|
1702
|
+
};
|
|
1663
1703
|
const handleCheckboxChange = (questionId, optionValue, checked) => {
|
|
1664
1704
|
const currentValues = responses[questionId] || [];
|
|
1665
1705
|
const newValues = checked ? [...currentValues, optionValue] : currentValues.filter((v) => v !== optionValue);
|
|
@@ -1705,7 +1745,22 @@ var QuestionnaireForm = ({
|
|
|
1705
1745
|
const handleSubmit = (e) => {
|
|
1706
1746
|
e.preventDefault();
|
|
1707
1747
|
if (validateForm()) {
|
|
1708
|
-
|
|
1748
|
+
const finalResponses = { ...responses };
|
|
1749
|
+
questions.forEach((question) => {
|
|
1750
|
+
if (question.type === "tel" || question.type === "phone") {
|
|
1751
|
+
const questionId = getQuestionId(question);
|
|
1752
|
+
const countryCode = phoneCountryCodes[questionId] || "+1";
|
|
1753
|
+
const phoneNumber = responses[questionId];
|
|
1754
|
+
if (phoneNumber) {
|
|
1755
|
+
finalResponses[questionId] = phoneNumber;
|
|
1756
|
+
if (questionId === "phone" || questionId === "customer_phone_number") {
|
|
1757
|
+
finalResponses["phone_code"] = countryCode;
|
|
1758
|
+
finalResponses["customer_phone_code"] = countryCode;
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
});
|
|
1763
|
+
onSubmit?.(finalResponses);
|
|
1709
1764
|
}
|
|
1710
1765
|
};
|
|
1711
1766
|
const renderQuestion = (question) => {
|
|
@@ -1713,9 +1768,6 @@ var QuestionnaireForm = ({
|
|
|
1713
1768
|
const hasError = !!errors[questionId];
|
|
1714
1769
|
switch (question.type) {
|
|
1715
1770
|
case "text":
|
|
1716
|
-
case "email":
|
|
1717
|
-
case "tel":
|
|
1718
|
-
case "phone":
|
|
1719
1771
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1720
1772
|
"input",
|
|
1721
1773
|
{
|
|
@@ -1730,6 +1782,76 @@ var QuestionnaireForm = ({
|
|
|
1730
1782
|
)
|
|
1731
1783
|
}
|
|
1732
1784
|
);
|
|
1785
|
+
case "email":
|
|
1786
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1787
|
+
"input",
|
|
1788
|
+
{
|
|
1789
|
+
type: "email",
|
|
1790
|
+
value: responses[questionId] || "",
|
|
1791
|
+
onChange: (e) => handleChange(questionId, e.target.value),
|
|
1792
|
+
onBlur: (e) => handleEmailBlur(questionId, e.target.value),
|
|
1793
|
+
placeholder: question.placeholder,
|
|
1794
|
+
className: cn(
|
|
1795
|
+
"w-full px-4 py-3 rounded-lg border text-base",
|
|
1796
|
+
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:border-transparent",
|
|
1797
|
+
hasError ? "border-red-500" : "border-[#E4E5E6]"
|
|
1798
|
+
)
|
|
1799
|
+
}
|
|
1800
|
+
);
|
|
1801
|
+
case "tel":
|
|
1802
|
+
case "phone":
|
|
1803
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
1804
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
1805
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1806
|
+
"select",
|
|
1807
|
+
{
|
|
1808
|
+
value: phoneCountryCodes[questionId] || "+1",
|
|
1809
|
+
onChange: (e) => handleCountryCodeChange(questionId, e.target.value),
|
|
1810
|
+
className: cn(
|
|
1811
|
+
"appearance-none pl-3 pr-8 py-3 rounded-lg border text-base",
|
|
1812
|
+
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:border-transparent",
|
|
1813
|
+
"bg-white cursor-pointer w-[80px]",
|
|
1814
|
+
hasError ? "border-red-500" : "border-[#E4E5E6]"
|
|
1815
|
+
),
|
|
1816
|
+
children: countryCodes.map((item) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: item.code, children: item.code }, item.code))
|
|
1817
|
+
}
|
|
1818
|
+
),
|
|
1819
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1820
|
+
"svg",
|
|
1821
|
+
{
|
|
1822
|
+
width: "12",
|
|
1823
|
+
height: "8",
|
|
1824
|
+
viewBox: "0 0 12 8",
|
|
1825
|
+
fill: "none",
|
|
1826
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1827
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1828
|
+
"path",
|
|
1829
|
+
{
|
|
1830
|
+
d: "M1 1.5L6 6.5L11 1.5",
|
|
1831
|
+
stroke: "#9CA3AF",
|
|
1832
|
+
strokeWidth: "1.5",
|
|
1833
|
+
strokeLinecap: "round",
|
|
1834
|
+
strokeLinejoin: "round"
|
|
1835
|
+
}
|
|
1836
|
+
)
|
|
1837
|
+
}
|
|
1838
|
+
) })
|
|
1839
|
+
] }),
|
|
1840
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1841
|
+
"input",
|
|
1842
|
+
{
|
|
1843
|
+
type: "tel",
|
|
1844
|
+
value: responses[questionId] || "",
|
|
1845
|
+
onChange: (e) => handleChange(questionId, e.target.value),
|
|
1846
|
+
placeholder: question.placeholder,
|
|
1847
|
+
className: cn(
|
|
1848
|
+
"flex-1 px-4 py-3 rounded-lg border text-base",
|
|
1849
|
+
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:border-transparent",
|
|
1850
|
+
hasError ? "border-red-500" : "border-[#E4E5E6]"
|
|
1851
|
+
)
|
|
1852
|
+
}
|
|
1853
|
+
)
|
|
1854
|
+
] });
|
|
1733
1855
|
case "textarea":
|
|
1734
1856
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1735
1857
|
"textarea",
|
|
@@ -1835,7 +1957,8 @@ var QuestionnaireForm = ({
|
|
|
1835
1957
|
question.label,
|
|
1836
1958
|
question.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500 ml-1", children: "*" })
|
|
1837
1959
|
] }),
|
|
1838
|
-
question.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-sm text-gray-600 mt-1", children: question.description })
|
|
1960
|
+
question.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-sm text-gray-600 mt-1", children: question.description }),
|
|
1961
|
+
question.type === "email" && questionId === "email" && pageData?.emailDescription && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-sm text-gray-600 mt-1", children: pageData.emailDescription })
|
|
1839
1962
|
] }),
|
|
1840
1963
|
renderQuestion(question),
|
|
1841
1964
|
question.hint && !errors[questionId] && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500", children: question.hint }),
|
|
@@ -1909,7 +2032,6 @@ var DateTimePicker = ({
|
|
|
1909
2032
|
onBookingSuccess
|
|
1910
2033
|
}) => {
|
|
1911
2034
|
const { token } = antd.theme.useToken();
|
|
1912
|
-
const [selectMonth, setSelectMonth] = React2.useState("");
|
|
1913
2035
|
const [selectedDate, setSelectedDate] = React2.useState(null);
|
|
1914
2036
|
const [calendarValue, setCalendarValue] = React2.useState(dayjs__default.default());
|
|
1915
2037
|
const [selectedTimeslotId, setSelectedTimeslotId] = React2.useState(
|
|
@@ -1934,9 +2056,8 @@ var DateTimePicker = ({
|
|
|
1934
2056
|
locale,
|
|
1935
2057
|
{ enabled: !!demoRoomCode && !!demoRoom?.questionnaire_id }
|
|
1936
2058
|
);
|
|
1937
|
-
const
|
|
1938
|
-
const
|
|
1939
|
-
const endDate = currentDate.endOf("month").format("YYYY-MM-DD");
|
|
2059
|
+
const startDate = calendarValue.startOf("month").format("YYYY-MM-DD");
|
|
2060
|
+
const endDate = calendarValue.endOf("month").format("YYYY-MM-DD");
|
|
1940
2061
|
const {
|
|
1941
2062
|
data: timeslotsData,
|
|
1942
2063
|
loading: timeslotsLoading,
|
|
@@ -1992,6 +2113,28 @@ var DateTimePicker = ({
|
|
|
1992
2113
|
setIsInitialized(true);
|
|
1993
2114
|
}
|
|
1994
2115
|
}, [timeslotsData, isInitialized, selectedDate]);
|
|
2116
|
+
React2.useEffect(() => {
|
|
2117
|
+
if (!timeslotsData?.timeslots || !isInitialized) return;
|
|
2118
|
+
if (selectedDate && selectedDate.isSame(calendarValue, "month")) {
|
|
2119
|
+
return;
|
|
2120
|
+
}
|
|
2121
|
+
const currentMonthStart = calendarValue.startOf("month");
|
|
2122
|
+
const currentMonthEnd = calendarValue.endOf("month");
|
|
2123
|
+
const now = dayjs__default.default();
|
|
2124
|
+
const availableTimeslots = timeslotsData.timeslots.filter((slot) => {
|
|
2125
|
+
const slotDate = dayjs__default.default(slot.start_time);
|
|
2126
|
+
return slot.status === "available" && slotDate.isAfter(now) && (slotDate.isAfter(currentMonthStart) || slotDate.isSame(currentMonthStart, "day")) && (slotDate.isBefore(currentMonthEnd) || slotDate.isSame(currentMonthEnd, "day"));
|
|
2127
|
+
});
|
|
2128
|
+
if (availableTimeslots.length > 0) {
|
|
2129
|
+
const sortedSlots = [...availableTimeslots].sort(
|
|
2130
|
+
(a, b) => dayjs__default.default(a.start_time).unix() - dayjs__default.default(b.start_time).unix()
|
|
2131
|
+
);
|
|
2132
|
+
const firstSlot = sortedSlots[0];
|
|
2133
|
+
const firstDate = dayjs__default.default(firstSlot.start_time);
|
|
2134
|
+
setSelectedDate(firstDate);
|
|
2135
|
+
setSelectedTimeslotId(firstSlot.id);
|
|
2136
|
+
}
|
|
2137
|
+
}, [calendarValue, timeslotsData, isInitialized, selectedDate]);
|
|
1995
2138
|
const formatTimeslot = (slot) => {
|
|
1996
2139
|
const start = dayjs__default.default(slot.start_time).format("h:mm A");
|
|
1997
2140
|
const end = dayjs__default.default(slot.end_time).format("h:mm A");
|
|
@@ -2020,8 +2163,13 @@ var DateTimePicker = ({
|
|
|
2020
2163
|
}
|
|
2021
2164
|
}
|
|
2022
2165
|
},
|
|
2023
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2024
|
-
|
|
2166
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2167
|
+
"div",
|
|
2168
|
+
{
|
|
2169
|
+
style: wrapperStyle,
|
|
2170
|
+
className: "calendar-custom-cell w-[calc(824/1920*100vw)] min-l:max-w-[824px] l:w-full",
|
|
2171
|
+
children: [
|
|
2172
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
2025
2173
|
.calendar-custom-cell .ant-picker-cell {
|
|
2026
2174
|
padding: 6px !important;
|
|
2027
2175
|
text-align: center !important;
|
|
@@ -2114,164 +2262,162 @@ var DateTimePicker = ({
|
|
|
2114
2262
|
display: none !important;
|
|
2115
2263
|
}
|
|
2116
2264
|
` }),
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
{
|
|
2144
|
-
className: `ant-picker-cell-inner ${isSelected ? "ant-picker-cell-inner-selected" : ""} ${isToday ? "ant-picker-cell-inner-today" : ""}`,
|
|
2145
|
-
style: {
|
|
2146
|
-
backgroundColor: isSelected ? "#3ADB67" : void 0,
|
|
2147
|
-
color: isSelected ? "white" : isDisabled ? "#BDBDBD" : void 0,
|
|
2148
|
-
borderColor: isSelected ? "#3ADB67" : isToday ? "#3ADB67" : void 0
|
|
2149
|
-
},
|
|
2150
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ant-picker-calendar-date-value", children: date.date() })
|
|
2151
|
-
}
|
|
2152
|
-
);
|
|
2153
|
-
},
|
|
2154
|
-
headerRender: ({ value, onChange }) => {
|
|
2155
|
-
const year = value.year();
|
|
2156
|
-
const month = value.month();
|
|
2157
|
-
const yearOptions = Array.from({ length: 20 }, (_, i) => {
|
|
2158
|
-
const label = year - 10 + i;
|
|
2159
|
-
return { label, value: label };
|
|
2160
|
-
});
|
|
2161
|
-
const monthOptions = value.localeData().months().map((label, index) => ({
|
|
2162
|
-
label,
|
|
2163
|
-
value: index
|
|
2164
|
-
}));
|
|
2165
|
-
const monthText = monthOptions?.find((item) => {
|
|
2166
|
-
return item?.value === month;
|
|
2167
|
-
});
|
|
2168
|
-
setSelectMonth(monthText?.label || "");
|
|
2169
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
2170
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2171
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2172
|
-
antd.Select,
|
|
2265
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2266
|
+
antd.Calendar,
|
|
2267
|
+
{
|
|
2268
|
+
fullscreen: false,
|
|
2269
|
+
value: calendarValue,
|
|
2270
|
+
onSelect: (date) => {
|
|
2271
|
+
setSelectedDate(date);
|
|
2272
|
+
setCalendarValue(date);
|
|
2273
|
+
},
|
|
2274
|
+
onPanelChange: (date) => {
|
|
2275
|
+
setCalendarValue(date);
|
|
2276
|
+
},
|
|
2277
|
+
disabledDate: (current) => {
|
|
2278
|
+
if (!current) return false;
|
|
2279
|
+
if (current.isSame(dayjs__default.default(), "day")) return false;
|
|
2280
|
+
if (current.isBefore(dayjs__default.default(), "day")) return true;
|
|
2281
|
+
const dateStr = current.format("YYYY-MM-DD");
|
|
2282
|
+
return !availableDates.has(dateStr);
|
|
2283
|
+
},
|
|
2284
|
+
fullCellRender: (date) => {
|
|
2285
|
+
const isSelected = selectedDate && date.isSame(selectedDate, "day");
|
|
2286
|
+
const isToday = date.isSame(dayjs__default.default(), "day");
|
|
2287
|
+
const dateStr = date.format("YYYY-MM-DD");
|
|
2288
|
+
const isDisabled = !isToday && (date.isBefore(dayjs__default.default(), "day") || !availableDates.has(dateStr));
|
|
2289
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2290
|
+
"div",
|
|
2173
2291
|
{
|
|
2174
|
-
|
|
2175
|
-
options: monthOptions,
|
|
2176
|
-
onChange: (newMonth) => {
|
|
2177
|
-
const now = value.clone().month(newMonth);
|
|
2178
|
-
onChange(now);
|
|
2179
|
-
},
|
|
2180
|
-
variant: "borderless",
|
|
2181
|
-
className: "text-2xl font-medium",
|
|
2182
|
-
popupMatchSelectWidth: false,
|
|
2292
|
+
className: `ant-picker-cell-inner ${isSelected ? "ant-picker-cell-inner-selected" : ""} ${isToday ? "ant-picker-cell-inner-today" : ""}`,
|
|
2183
2293
|
style: {
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
}
|
|
2188
|
-
),
|
|
2189
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2190
|
-
antd.Select,
|
|
2191
|
-
{
|
|
2192
|
-
value: year,
|
|
2193
|
-
options: yearOptions,
|
|
2194
|
-
onChange: (newYear) => {
|
|
2195
|
-
const now = value.clone().year(newYear);
|
|
2196
|
-
onChange(now);
|
|
2294
|
+
backgroundColor: isSelected ? "#3ADB67" : void 0,
|
|
2295
|
+
color: isSelected ? "white" : isDisabled ? "#BDBDBD" : void 0,
|
|
2296
|
+
borderColor: isSelected ? "#3ADB67" : isToday ? "#3ADB67" : void 0
|
|
2197
2297
|
},
|
|
2198
|
-
|
|
2199
|
-
className: "text-2xl font-medium",
|
|
2200
|
-
popupMatchSelectWidth: false,
|
|
2201
|
-
style: {
|
|
2202
|
-
fontSize: "24px",
|
|
2203
|
-
fontWeight: 500
|
|
2204
|
-
}
|
|
2298
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ant-picker-calendar-date-value", children: date.date() })
|
|
2205
2299
|
}
|
|
2206
|
-
)
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2300
|
+
);
|
|
2301
|
+
},
|
|
2302
|
+
headerRender: ({ value, onChange }) => {
|
|
2303
|
+
const year = value.year();
|
|
2304
|
+
const month = value.month();
|
|
2305
|
+
const yearOptions = Array.from({ length: 20 }, (_, i) => {
|
|
2306
|
+
const label = year - 10 + i;
|
|
2307
|
+
return { label, value: label };
|
|
2308
|
+
});
|
|
2309
|
+
const monthOptions = value.localeData().months().map((label, index) => ({
|
|
2310
|
+
label,
|
|
2311
|
+
value: index
|
|
2312
|
+
}));
|
|
2313
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
2314
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2315
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2316
|
+
antd.Select,
|
|
2219
2317
|
{
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2318
|
+
value: month,
|
|
2319
|
+
options: monthOptions,
|
|
2320
|
+
onChange: (newMonth) => {
|
|
2321
|
+
const now = value.clone().month(newMonth);
|
|
2322
|
+
onChange(now);
|
|
2323
|
+
},
|
|
2324
|
+
variant: "borderless",
|
|
2325
|
+
className: "text-2xl font-medium",
|
|
2326
|
+
popupMatchSelectWidth: false,
|
|
2327
|
+
style: {
|
|
2328
|
+
fontSize: "24px",
|
|
2329
|
+
fontWeight: 500
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
),
|
|
2333
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2334
|
+
antd.Select,
|
|
2335
|
+
{
|
|
2336
|
+
value: year,
|
|
2337
|
+
options: yearOptions,
|
|
2338
|
+
onChange: (newYear) => {
|
|
2339
|
+
const now = value.clone().year(newYear);
|
|
2340
|
+
onChange(now);
|
|
2341
|
+
},
|
|
2342
|
+
variant: "borderless",
|
|
2343
|
+
className: "text-2xl font-medium",
|
|
2344
|
+
popupMatchSelectWidth: false,
|
|
2345
|
+
style: {
|
|
2346
|
+
fontSize: "24px",
|
|
2347
|
+
fontWeight: 500
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
)
|
|
2351
|
+
] }),
|
|
2352
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2353
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2354
|
+
"button",
|
|
2355
|
+
{
|
|
2356
|
+
onClick: () => {
|
|
2357
|
+
const newDate = value.subtract(1, "month");
|
|
2358
|
+
onChange(newDate);
|
|
2359
|
+
},
|
|
2360
|
+
className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
|
|
2225
2361
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2226
|
-
"
|
|
2362
|
+
"svg",
|
|
2227
2363
|
{
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2364
|
+
width: "20",
|
|
2365
|
+
height: "20",
|
|
2366
|
+
viewBox: "0 0 20 20",
|
|
2367
|
+
fill: "none",
|
|
2368
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2369
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2370
|
+
"path",
|
|
2371
|
+
{
|
|
2372
|
+
d: "M12 16L6 10L12 4",
|
|
2373
|
+
stroke: "currentColor",
|
|
2374
|
+
strokeWidth: "2",
|
|
2375
|
+
strokeLinecap: "round",
|
|
2376
|
+
strokeLinejoin: "round"
|
|
2377
|
+
}
|
|
2378
|
+
)
|
|
2233
2379
|
}
|
|
2234
2380
|
)
|
|
2235
2381
|
}
|
|
2236
|
-
)
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2240
|
-
"button",
|
|
2241
|
-
{
|
|
2242
|
-
onClick: () => {
|
|
2243
|
-
const newDate = value.add(1, "month");
|
|
2244
|
-
onChange(newDate);
|
|
2245
|
-
},
|
|
2246
|
-
className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
|
|
2247
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2248
|
-
"svg",
|
|
2382
|
+
),
|
|
2383
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2384
|
+
"button",
|
|
2249
2385
|
{
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2386
|
+
onClick: () => {
|
|
2387
|
+
const newDate = value.add(1, "month");
|
|
2388
|
+
onChange(newDate);
|
|
2389
|
+
},
|
|
2390
|
+
className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
|
|
2255
2391
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2256
|
-
"
|
|
2392
|
+
"svg",
|
|
2257
2393
|
{
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2394
|
+
width: "20",
|
|
2395
|
+
height: "20",
|
|
2396
|
+
viewBox: "0 0 20 20",
|
|
2397
|
+
fill: "none",
|
|
2398
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2399
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2400
|
+
"path",
|
|
2401
|
+
{
|
|
2402
|
+
d: "M8 4L14 10L8 16",
|
|
2403
|
+
stroke: "currentColor",
|
|
2404
|
+
strokeWidth: "2",
|
|
2405
|
+
strokeLinecap: "round",
|
|
2406
|
+
strokeLinejoin: "round"
|
|
2407
|
+
}
|
|
2408
|
+
)
|
|
2263
2409
|
}
|
|
2264
2410
|
)
|
|
2265
2411
|
}
|
|
2266
2412
|
)
|
|
2267
|
-
}
|
|
2268
|
-
)
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2413
|
+
] })
|
|
2414
|
+
] });
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
)
|
|
2418
|
+
]
|
|
2419
|
+
}
|
|
2420
|
+
)
|
|
2275
2421
|
}
|
|
2276
2422
|
),
|
|
2277
2423
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white p-[24px] rounded-[12px] flex-1", children: [
|
|
@@ -2311,7 +2457,7 @@ var DateTimePicker = ({
|
|
|
2311
2457
|
)
|
|
2312
2458
|
}
|
|
2313
2459
|
),
|
|
2314
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center", children:
|
|
2460
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: selectedDate ? selectedDate.format("MMMM D, YYYY") : "" }),
|
|
2315
2461
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2316
2462
|
"button",
|
|
2317
2463
|
{
|
|
@@ -2380,7 +2526,11 @@ var DateTimePicker = ({
|
|
|
2380
2526
|
},
|
|
2381
2527
|
slot.id
|
|
2382
2528
|
);
|
|
2383
|
-
}) })
|
|
2529
|
+
}) }),
|
|
2530
|
+
!timeslotsLoading && dayTimeslots?.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-4 text-right", children: pageData?.timezone?.replace(
|
|
2531
|
+
"{{timezone}}",
|
|
2532
|
+
demoRoom?.timezone || timezone || ""
|
|
2533
|
+
) })
|
|
2384
2534
|
] })
|
|
2385
2535
|
] }),
|
|
2386
2536
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-12", children: [
|
|
@@ -2532,7 +2682,7 @@ var DemoRoomDetail = ({
|
|
|
2532
2682
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm mt-2", children: error.message })
|
|
2533
2683
|
] }) });
|
|
2534
2684
|
}
|
|
2535
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-8 l:flex l:flex-col items-start", children: [
|
|
2685
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-8 l:flex l:flex-col items-start py-[24px]", children: [
|
|
2536
2686
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 py-[24px]", children: [
|
|
2537
2687
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-[40px] font-bold text-gray-900 leading-tight", children: title }),
|
|
2538
2688
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: descriptions.map((desc, index) => /* @__PURE__ */ jsxRuntime.jsx(
|