@jk-core/components 0.0.5 → 0.0.7
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/index.js +399 -471
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +19 -10
- package/dist/index.umd.cjs.map +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/style.css +402 -1
- package/dist/style.css.map +1 -0
- package/package.json +10 -4
- package/src/Calendar/{Calendar.module.scss → scss/_calendar.scss} +9 -0
- package/src/Calendar/scss/_tile.scss +214 -0
- package/src/{styles/color.scss → Calendar/scss/_variables.scss} +1 -0
- package/src/Calendar/scss/main.scss +3 -0
- package/src/Calendar/components/DayTile/DayTile.module.scss +0 -79
- package/src/Calendar/components/DayTile/index.tsx +0 -52
- package/src/Calendar/components/MonthTile/MonthTile.module.scss +0 -44
- package/src/Calendar/components/MonthTile/index.tsx +0 -38
- package/src/Calendar/components/YearTile/YearTile.module.scss +0 -85
- package/src/Calendar/components/YearTile/index.tsx +0 -60
- package/src/Calendar/components/mixin.module.scss +0 -5
- package/src/Calendar/hooks/useCalendarNav.ts +0 -80
- package/src/Calendar/hooks/useDateSelect.ts +0 -47
- package/src/Calendar/index.tsx +0 -166
- package/src/Calendar/type.ts +0 -6
- package/src/Calendar/utils/getWeeksInMonth.ts +0 -45
- package/src/Calendar/utils/isInRange.ts +0 -8
- package/src/Calendar/utils/isSameDay.ts +0 -21
- package/src/assets/close.svg +0 -16
- package/src/assets/drop-arrow.svg +0 -3
- package/src/index.tsx +0 -3
- package/src/styles/mediaQuery.scss +0 -22
- package/src/svg.d.ts +0 -6
- package/src/vite-env.d.ts +0 -1
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
const getWeeksInMonth = (viewDate:Date) => {
|
|
2
|
-
const startOfMonth = new Date(viewDate.getFullYear(), viewDate.getMonth(), 1);
|
|
3
|
-
const endOfMonth = new Date(viewDate.getFullYear(), viewDate.getMonth() + 1, 0);
|
|
4
|
-
const weeks = [];
|
|
5
|
-
let currentWeek = [];
|
|
6
|
-
|
|
7
|
-
const startDayOfWeek = startOfMonth.getDay();
|
|
8
|
-
if (startDayOfWeek !== 0) {
|
|
9
|
-
const prevMonthEnd = new Date(startOfMonth);
|
|
10
|
-
prevMonthEnd.setDate(0);
|
|
11
|
-
for (let i = startDayOfWeek - 1; i >= 0; i -= 1) {
|
|
12
|
-
const prevDate = new Date(prevMonthEnd);
|
|
13
|
-
prevDate.setDate(prevMonthEnd.getDate() - i);
|
|
14
|
-
currentWeek.push({ thisMonth: false, date: prevDate });
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const currentDate = new Date(startOfMonth);
|
|
19
|
-
|
|
20
|
-
while (currentDate <= endOfMonth) {
|
|
21
|
-
currentWeek.push({ thisMonth: true, date: new Date(currentDate) });
|
|
22
|
-
if (currentDate.getDay() === 6) {
|
|
23
|
-
weeks.push(currentWeek);
|
|
24
|
-
currentWeek = [];
|
|
25
|
-
}
|
|
26
|
-
currentDate.setDate(currentDate.getDate() + 1);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const endDayOfWeek = endOfMonth.getDay();
|
|
30
|
-
if (endDayOfWeek !== 6) {
|
|
31
|
-
for (let i = 1; i <= 6 - endDayOfWeek; i += 1) {
|
|
32
|
-
const nextDate = new Date(endOfMonth);
|
|
33
|
-
nextDate.setDate(endOfMonth.getDate() + i);
|
|
34
|
-
currentWeek.push({ thisMonth: false, date: nextDate });
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (currentWeek.length > 0) {
|
|
39
|
-
weeks.push(currentWeek);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return weeks;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export default getWeeksInMonth;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CalendarView } from '../type';
|
|
2
|
-
|
|
3
|
-
const isSameDay = (date1: Date | null, date2: Date | null, view: CalendarView = 'day'): boolean => {
|
|
4
|
-
if (date1 === null || date2 === null) return false;
|
|
5
|
-
|
|
6
|
-
switch (view) {
|
|
7
|
-
case 'day':
|
|
8
|
-
return date1.getFullYear() === date2.getFullYear()
|
|
9
|
-
&& date1.getMonth() === date2.getMonth()
|
|
10
|
-
&& date1.getDate() === date2.getDate();
|
|
11
|
-
case 'month':
|
|
12
|
-
return date1.getFullYear() === date2.getFullYear()
|
|
13
|
-
&& date1.getMonth() === date2.getMonth();
|
|
14
|
-
case 'year':
|
|
15
|
-
return date1.getFullYear() === date2.getFullYear();
|
|
16
|
-
default:
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default isSameDay;
|
package/src/assets/close.svg
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
2
|
-
|
|
3
|
-
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
|
|
4
|
-
<svg width="64px" height="64px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#000000" fill="#000000" stroke-width="0.696">
|
|
5
|
-
|
|
6
|
-
<g id="SVGRepo_bgCarrier" stroke-width="0"/>
|
|
7
|
-
|
|
8
|
-
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"/>
|
|
9
|
-
|
|
10
|
-
<g id="SVGRepo_iconCarrier">
|
|
11
|
-
|
|
12
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.207 6.207a1 1 0 0 0-1.414-1.414L12 10.586 6.207 4.793a1 1 0 0 0-1.414 1.414L10.586 12l-5.793 5.793a1 1 0 1 0 1.414 1.414L12 13.414l5.793 5.793a1 1 0 0 0 1.414-1.414L13.414 12l5.793-5.793z" />
|
|
13
|
-
|
|
14
|
-
</g>
|
|
15
|
-
|
|
16
|
-
</svg>
|
package/src/index.tsx
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// 스크롤바 너비 14px 추가
|
|
2
|
-
$pc: 1396px;
|
|
3
|
-
$tablet: 1395px;
|
|
4
|
-
$mobile: 774px;
|
|
5
|
-
|
|
6
|
-
@mixin pc {
|
|
7
|
-
@media (min-width: $pc) {
|
|
8
|
-
@content;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@mixin tablet {
|
|
13
|
-
@media (max-width: $tablet) {
|
|
14
|
-
@content;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
@mixin mobile {
|
|
19
|
-
@media (max-width: $mobile) {
|
|
20
|
-
@content;
|
|
21
|
-
}
|
|
22
|
-
}
|
package/src/svg.d.ts
DELETED
package/src/vite-env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|