@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.
@@ -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,8 +0,0 @@
1
- import { CalendarRange } from '../type';
2
-
3
- const isInRange = (day: Date, range:CalendarRange) => {
4
- if (!range.start || !range.end) return false;
5
- return day > range.start && day < range.end;
6
- };
7
-
8
- export default isInRange;
@@ -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;
@@ -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>
@@ -1,3 +0,0 @@
1
- <svg width="25" height="25" viewBox="0 0 20 20" fill="none" stroke="#2D2D2D" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M5 7.5L10 13L15 7.5" stroke-width="1.4" stroke-linecap="round"/>
3
- </svg>
package/src/index.tsx DELETED
@@ -1,3 +0,0 @@
1
- import Calendar from './Calendar';
2
-
3
- export { Calendar };
@@ -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
@@ -1,6 +0,0 @@
1
- // svg를 ReactComponent처럼 사용하기 위해 선언
2
- declare module '*.svg' {
3
- import { HTMLAttributes } from 'react';
4
-
5
- export default React.Component<HTMLAttributes<HTMLDivElement>>;
6
- }
package/src/vite-env.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />