@jk-core/components 1.1.17 → 1.1.19
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 +73 -73
- package/dist/index.js +1299 -997
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +8 -8
- package/dist/index.umd.cjs.map +1 -1
- package/dist/src/common/Carousel/index.d.ts +15 -0
- package/dist/src/common/RollingBanner/index.d.ts +11 -0
- package/dist/src/index.d.ts +3 -1
- package/dist/src/utils/ts/formatMoney.d.ts +1 -1
- package/package.json +99 -99
- package/src/Calendar/Calendar.module.scss +213 -213
- package/src/Calendar/RangeCalendar.tsx +125 -125
- package/src/Calendar/ScrollCalendar.module.scss +214 -214
- package/src/Calendar/ScrollCalendar.tsx +124 -124
- package/src/Calendar/SingleCalendar.tsx +121 -121
- package/src/Calendar/components/DateLabel/DateLabel.module.scss +89 -89
- package/src/Calendar/components/DateLabel/index.tsx +91 -91
- package/src/Calendar/components/DayTile/DayTile.module.scss +117 -117
- package/src/Calendar/components/DayTile/index.tsx +108 -108
- package/src/Calendar/components/MonthTile/MonthTile.module.scss +59 -59
- package/src/Calendar/components/MonthTile/index.tsx +50 -50
- package/src/Calendar/components/ViewSelector/ViewSelector.module.scss +48 -48
- package/src/Calendar/components/ViewSelector/index.tsx +49 -49
- package/src/Calendar/components/YearTile/YearTile.module.scss +85 -85
- package/src/Calendar/components/YearTile/index.tsx +65 -65
- package/src/Calendar/hooks/useCalendarNav.ts +83 -83
- package/src/Calendar/hooks/useDateSelect.ts +54 -54
- package/src/Calendar/index.scss +189 -189
- package/src/Calendar/index.tsx +66 -66
- package/src/Calendar/type.ts +3 -3
- package/src/Calendar/utils/getWeeksInMonth.ts +45 -45
- package/src/Calendar/utils/isInRange.ts +8 -8
- package/src/Calendar/utils/isSameDay.ts +21 -21
- package/src/assets/arrow.svg +11 -11
- package/src/assets/close.svg +15 -15
- package/src/assets/drop-arrow.svg +3 -3
- package/src/common/Accordion/Accordion.module.scss +53 -53
- package/src/common/Accordion/arrow-down.svg +3 -3
- package/src/common/Accordion/arrow-up.svg +3 -3
- package/src/common/Accordion/index.tsx +54 -54
- package/src/common/Breadcrumbs/Breadcrumbs.module.scss +46 -46
- package/src/common/Breadcrumbs/home.svg +5 -5
- package/src/common/Breadcrumbs/index.tsx +82 -82
- package/src/common/Button/Button.module.scss +127 -127
- package/src/common/Button/index.tsx +60 -60
- package/src/common/Card/Card.module.scss +28 -28
- package/src/common/Card/index.tsx +19 -19
- package/src/common/Carousel/Carousel.module.scss +222 -0
- package/src/common/Carousel/index.tsx +411 -0
- package/src/common/Divider/Divider.module.scss +101 -101
- package/src/common/Divider/index.tsx +24 -24
- package/src/common/DropDown/DropDown.module.scss +135 -135
- package/src/common/DropDown/List.tsx +156 -156
- package/src/common/DropDown/arrow-down.svg +3 -3
- package/src/common/DropDown/index.tsx +108 -108
- package/src/common/DropDown/search.svg +4 -4
- package/src/common/Pagination/Pagination.module.scss +210 -210
- package/src/common/Pagination/arrow-left.svg +11 -11
- package/src/common/Pagination/arrow-right.svg +11 -11
- package/src/common/Pagination/index.tsx +156 -156
- package/src/common/RollingBanner/RollingBanner.module.scss +126 -0
- package/src/common/RollingBanner/index.tsx +140 -0
- package/src/common/SegmentButton/SegmentButton.module.scss +46 -45
- package/src/common/SegmentButton/index.tsx +79 -79
- package/src/common/Skeleton/Skeleton.module.scss +80 -80
- package/src/common/Skeleton/index.tsx +47 -47
- package/src/common/SwitchButton/SwitchButton.module.scss +65 -65
- package/src/common/SwitchButton/index.tsx +57 -57
- package/src/common/Table/Table.module.scss +70 -70
- package/src/common/Table/index.tsx +128 -128
- package/src/index.scss +1 -1
- package/src/index.tsx +24 -22
- package/src/styles/color.scss +346 -346
- package/src/styles/font-face.scss +18 -18
- package/src/styles/font.scss +49 -49
- package/src/styles/mediaQuery.scss +22 -22
- package/src/styles/scrollbar.scss +71 -71
- package/src/svg.d.ts +6 -6
- package/src/utils/styles/mediaQuery.scss +22 -22
- package/src/utils/ts/allowDecimal.ts +4 -4
- package/src/utils/ts/autoHypen.ts +33 -33
- package/src/utils/ts/calculateMax.ts +24 -24
- package/src/utils/ts/checkIsMobilePlatform.ts +15 -15
- package/src/utils/ts/formatFileSize.ts +16 -16
- package/src/utils/ts/formatMoney.ts +16 -16
- package/src/utils/ts/gradientRatio.ts +61 -61
- package/src/utils/ts/kiloToMega.ts +30 -30
- package/src/utils/ts/maskingPhone.ts +8 -8
- package/src/utils/ts/toQueryString.ts +7 -7
- package/src/utils/ts/valueAsNumber.ts +15 -15
- package/src/vite-env.d.ts +2 -2
package/src/Calendar/index.scss
CHANGED
|
@@ -1,189 +1,189 @@
|
|
|
1
|
-
button {
|
|
2
|
-
border: none;
|
|
3
|
-
background-color: transparent;
|
|
4
|
-
user-select: none;
|
|
5
|
-
-webkit-user-select: none;
|
|
6
|
-
-moz-user-select: none;
|
|
7
|
-
cursor: pointer;
|
|
8
|
-
-webkit-tap-highlight-color: transparent; // 모바일 터치 하이라이트 색상 제거
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
body:not([data-theme="dark"]) {
|
|
12
|
-
--calendar-white: #ffffff;
|
|
13
|
-
--calendar-black: #000000;
|
|
14
|
-
--calendar-P-5: #eff5ff;
|
|
15
|
-
--calendar-P-10: #d3e1fb;
|
|
16
|
-
--calendar-P-20: #a7c4f7;
|
|
17
|
-
--calendar-P-30: #7ca6f3;
|
|
18
|
-
--calendar-P-40: #5089ef;
|
|
19
|
-
--calendar-P-50: #246beb;
|
|
20
|
-
--calendar-P-60: #1d56bc;
|
|
21
|
-
--calendar-P-70: #16408d;
|
|
22
|
-
--calendar-P-90: #07152f;
|
|
23
|
-
--calendar-P-100: #000000;
|
|
24
|
-
--calendar-S-5: #edf1f5;
|
|
25
|
-
--calendar-S-10: #cdd7e4;
|
|
26
|
-
--calendar-S-20: #b4c4d6;
|
|
27
|
-
--calendar-S-30: #99b0cb;
|
|
28
|
-
--calendar-S-40: #2a5c96;
|
|
29
|
-
--calendar-S-50: #003675;
|
|
30
|
-
--calendar-S-60: #002b5e;
|
|
31
|
-
--calendar-S-70: #002036;
|
|
32
|
-
--calendar-S-80: #00162f;
|
|
33
|
-
--calendar-S-90: #000b17;
|
|
34
|
-
--calendar-G-5: #f8f8f8;
|
|
35
|
-
--calendar-G-10: #f0f0f0;
|
|
36
|
-
--calendar-G-20: #e4e4e4;
|
|
37
|
-
--calendar-G-30: #d8d8d8;
|
|
38
|
-
--calendar-G-40: #c6c6c6;
|
|
39
|
-
--calendar-G-50: #8e8e8e;
|
|
40
|
-
--calendar-G-60: #717171;
|
|
41
|
-
--calendar-G-70: #555555;
|
|
42
|
-
--calendar-G-80: #2d2d2d;
|
|
43
|
-
--calendar-G-90: #1d1d1d;
|
|
44
|
-
--calendar-Point-5: #fdf2f3;
|
|
45
|
-
--calendar-Point-10: #f8d6d8;
|
|
46
|
-
--calendar-Point-20: #f5a3a8;
|
|
47
|
-
--calendar-Point-30: #f1747c;
|
|
48
|
-
--calendar-Point-40: #ec4651;
|
|
49
|
-
--calendar-Point-50: #e71825;
|
|
50
|
-
--calendar-Point-60: #b9131e;
|
|
51
|
-
--calendar-Point-70: #8b0e16;
|
|
52
|
-
--calendar-Point-80: #5c0a0f;
|
|
53
|
-
--calendar-Point-90: #2e0507;
|
|
54
|
-
--calendar-Warning-5: #fff8e9;
|
|
55
|
-
--calendar-Warning-10: #ffeac1;
|
|
56
|
-
--calendar-Warning-20: #ffe2a7;
|
|
57
|
-
--calendar-Warning-30: #ffd47c;
|
|
58
|
-
--calendar-Warning-40: #ffc550;
|
|
59
|
-
--calendar-Warning-50: #ffb724;
|
|
60
|
-
--calendar-Warning-60: #98690a;
|
|
61
|
-
--calendar-Warning-70: #66490e;
|
|
62
|
-
--calendar-Warning-80: #4d370b;
|
|
63
|
-
--calendar-Warning-90: #332507;
|
|
64
|
-
--calendar-Success-5: #eef7f0;
|
|
65
|
-
--calendar-Success-10: #cee9d4;
|
|
66
|
-
--calendar-Success-20: #b2dcbb;
|
|
67
|
-
--calendar-Success-30: #8cca99;
|
|
68
|
-
--calendar-Success-40: #33a14b;
|
|
69
|
-
--calendar-Success-50: #008a1e;
|
|
70
|
-
--calendar-Success-60: #006e18;
|
|
71
|
-
--calendar-Success-70: #005312;
|
|
72
|
-
--calendar-Success-80: #00370c;
|
|
73
|
-
--calendar-Success-90: #002207;
|
|
74
|
-
--calendar-Info-5: #e9f0ff;
|
|
75
|
-
--calendar-Info-10: #d4e1ff;
|
|
76
|
-
--calendar-Info-20: #a9c3ff;
|
|
77
|
-
--calendar-Info-30: #7da4ff;
|
|
78
|
-
--calendar-Info-40: #5286ff;
|
|
79
|
-
--calendar-Info-50: #2768ff;
|
|
80
|
-
--calendar-Info-60: #1f53cc;
|
|
81
|
-
--calendar-Info-70: #173e99;
|
|
82
|
-
--calendar-Info-80: #0c1f4d;
|
|
83
|
-
--calendar-Info-90: #040a1a;
|
|
84
|
-
--calendar-Red: #e40000;
|
|
85
|
-
--calendar-Red2: #ffe4e4;
|
|
86
|
-
--calendar-Green: #2fb400;
|
|
87
|
-
--calendar-Green-2: #d7ffe0;
|
|
88
|
-
--calendar-Orange: #ff8800;
|
|
89
|
-
--calendar-Orange-5: #ffead1;
|
|
90
|
-
--calendar-Orange-10: #ffdacc;
|
|
91
|
-
--calendar-Orange-30: #ff8f66;
|
|
92
|
-
--calendar-Orange-40: #ff6a33;
|
|
93
|
-
--calendar-Orange-50: #ff4500;
|
|
94
|
-
--calendar-Orange-60: #d53209;
|
|
95
|
-
--calendar-Orange-70: #992900;
|
|
96
|
-
--calendar-Orange-80: #661c00;
|
|
97
|
-
--calendar-Orange-90: #330e00;
|
|
98
|
-
--Calendar-Background: #ffffff;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
body[data-theme="dark"] {
|
|
102
|
-
--calendar-white: #000000;
|
|
103
|
-
--calendar-black: #ffffff;
|
|
104
|
-
--calendar-P-90: #eff5ff;
|
|
105
|
-
--calendar-P-80: #d3e1fb;
|
|
106
|
-
--calendar-P-70: #a7c4f7;
|
|
107
|
-
--calendar-P-60: #7ca6f3;
|
|
108
|
-
--calendar-P-50: #5089ef;
|
|
109
|
-
--calendar-P-40: #246beb;
|
|
110
|
-
--calendar-P-30: #225fc9;
|
|
111
|
-
--calendar-P-20: #1e53b4;
|
|
112
|
-
--calendar-P-10: #1b4ba3;
|
|
113
|
-
--calendar-P-5: #0f2b5f;
|
|
114
|
-
--calendar-S-90: #edf1f5;
|
|
115
|
-
--calendar-S-80: #cdd7e4;
|
|
116
|
-
--calendar-S-70: #b4c4d6;
|
|
117
|
-
--calendar-S-60: #99b0cb;
|
|
118
|
-
--calendar-S-50: #2a5c96;
|
|
119
|
-
--calendar-S-40: #003675;
|
|
120
|
-
--calendar-S-30: #002b5e;
|
|
121
|
-
--calendar-S-20: #002036;
|
|
122
|
-
--calendar-S-10: #00162f;
|
|
123
|
-
--calendar-S-5: #000b17;
|
|
124
|
-
--calendar-G-90: #f8f8f8;
|
|
125
|
-
--calendar-G-80: #f0f0f0;
|
|
126
|
-
--calendar-G-70: #e4e4e4;
|
|
127
|
-
--calendar-G-60: #d8d8d8;
|
|
128
|
-
--calendar-G-50: #c6c6c6;
|
|
129
|
-
--calendar-G-40: #8e8e8e;
|
|
130
|
-
--calendar-G-30: #717171;
|
|
131
|
-
--calendar-G-20: #555555;
|
|
132
|
-
--calendar-G-10: #2d2d2d;
|
|
133
|
-
--calendar-G-5: #1d1d1d;
|
|
134
|
-
--calendar-Point-5: #fdf2f3;
|
|
135
|
-
--calendar-Point-10: #f8d6d8;
|
|
136
|
-
--calendar-Point-20: #f5a3a8;
|
|
137
|
-
--calendar-Point-30: #f1747c;
|
|
138
|
-
--calendar-Point-40: #ec4651;
|
|
139
|
-
--calendar-Point-50: #e71825;
|
|
140
|
-
--calendar-Point-60: #b9131e;
|
|
141
|
-
--calendar-Point-70: #8b0e16;
|
|
142
|
-
--calendar-Point-80: #5c0a0f;
|
|
143
|
-
--calendar-Point-90: #2e0507;
|
|
144
|
-
--calendar-Warning-5: #fff8e9;
|
|
145
|
-
--calendar-Warning-10: #ffeac1;
|
|
146
|
-
--calendar-Warning-20: #ffe2a7;
|
|
147
|
-
--calendar-Warning-30: #ffd47c;
|
|
148
|
-
--calendar-Warning-40: #ffc550;
|
|
149
|
-
--calendar-Warning-50: #ffb724;
|
|
150
|
-
--calendar-Warning-60: #98690a;
|
|
151
|
-
--calendar-Warning-70: #66490e;
|
|
152
|
-
--calendar-Warning-80: #4d370b;
|
|
153
|
-
--calendar-Warning-90: #332507;
|
|
154
|
-
--calendar-Success-5: #eef7f0;
|
|
155
|
-
--calendar-Success-10: #cee9d4;
|
|
156
|
-
--calendar-Success-20: #b2dcbb;
|
|
157
|
-
--calendar-Success-30: #8cca99;
|
|
158
|
-
--calendar-Success-40: #33a14b;
|
|
159
|
-
--calendar-Success-50: #008a1e;
|
|
160
|
-
--calendar-Success-60: #006e18;
|
|
161
|
-
--calendar-Success-70: #005312;
|
|
162
|
-
--calendar-Success-80: #00370c;
|
|
163
|
-
--calendar-Success-90: #002207;
|
|
164
|
-
--calendar-Info-5: #e9f0ff;
|
|
165
|
-
--calendar-Info-10: #d4e1ff;
|
|
166
|
-
--calendar-Info-20: #a9c3ff;
|
|
167
|
-
--calendar-Info-30: #7da4ff;
|
|
168
|
-
--calendar-Info-40: #5286ff;
|
|
169
|
-
--calendar-Info-50: #2768ff;
|
|
170
|
-
--calendar-Info-60: #1f53cc;
|
|
171
|
-
--calendar-Info-70: #173e99;
|
|
172
|
-
--calendar-Info-80: #0c1f4d;
|
|
173
|
-
--calendar-Info-90: #040a1a;
|
|
174
|
-
--calendar-Red: #e40000;
|
|
175
|
-
--calendar-Red2: #ffe4e4;
|
|
176
|
-
--calendar-Green: #2fb400;
|
|
177
|
-
--calendar-Green-2: #d7ffe0;
|
|
178
|
-
--calendar-Orange: #ff8800;
|
|
179
|
-
--calendar-Orange-5: #ffead1;
|
|
180
|
-
--calendar-Orange-10: #ffdacc;
|
|
181
|
-
--calendar-Orange-30: #ff8f66;
|
|
182
|
-
--calendar-Orange-40: #ff6a33;
|
|
183
|
-
--calendar-Orange-50: #ff4500;
|
|
184
|
-
--calendar-Orange-60: #d53209;
|
|
185
|
-
--calendar-Orange-70: #992900;
|
|
186
|
-
--calendar-Orange-80: #661c00;
|
|
187
|
-
--calendar-Orange-90: #330e00;
|
|
188
|
-
--Calendar-Background: #ffffff;
|
|
189
|
-
}
|
|
1
|
+
button {
|
|
2
|
+
border: none;
|
|
3
|
+
background-color: transparent;
|
|
4
|
+
user-select: none;
|
|
5
|
+
-webkit-user-select: none;
|
|
6
|
+
-moz-user-select: none;
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
-webkit-tap-highlight-color: transparent; // 모바일 터치 하이라이트 색상 제거
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
body:not([data-theme="dark"]) {
|
|
12
|
+
--calendar-white: #ffffff;
|
|
13
|
+
--calendar-black: #000000;
|
|
14
|
+
--calendar-P-5: #eff5ff;
|
|
15
|
+
--calendar-P-10: #d3e1fb;
|
|
16
|
+
--calendar-P-20: #a7c4f7;
|
|
17
|
+
--calendar-P-30: #7ca6f3;
|
|
18
|
+
--calendar-P-40: #5089ef;
|
|
19
|
+
--calendar-P-50: #246beb;
|
|
20
|
+
--calendar-P-60: #1d56bc;
|
|
21
|
+
--calendar-P-70: #16408d;
|
|
22
|
+
--calendar-P-90: #07152f;
|
|
23
|
+
--calendar-P-100: #000000;
|
|
24
|
+
--calendar-S-5: #edf1f5;
|
|
25
|
+
--calendar-S-10: #cdd7e4;
|
|
26
|
+
--calendar-S-20: #b4c4d6;
|
|
27
|
+
--calendar-S-30: #99b0cb;
|
|
28
|
+
--calendar-S-40: #2a5c96;
|
|
29
|
+
--calendar-S-50: #003675;
|
|
30
|
+
--calendar-S-60: #002b5e;
|
|
31
|
+
--calendar-S-70: #002036;
|
|
32
|
+
--calendar-S-80: #00162f;
|
|
33
|
+
--calendar-S-90: #000b17;
|
|
34
|
+
--calendar-G-5: #f8f8f8;
|
|
35
|
+
--calendar-G-10: #f0f0f0;
|
|
36
|
+
--calendar-G-20: #e4e4e4;
|
|
37
|
+
--calendar-G-30: #d8d8d8;
|
|
38
|
+
--calendar-G-40: #c6c6c6;
|
|
39
|
+
--calendar-G-50: #8e8e8e;
|
|
40
|
+
--calendar-G-60: #717171;
|
|
41
|
+
--calendar-G-70: #555555;
|
|
42
|
+
--calendar-G-80: #2d2d2d;
|
|
43
|
+
--calendar-G-90: #1d1d1d;
|
|
44
|
+
--calendar-Point-5: #fdf2f3;
|
|
45
|
+
--calendar-Point-10: #f8d6d8;
|
|
46
|
+
--calendar-Point-20: #f5a3a8;
|
|
47
|
+
--calendar-Point-30: #f1747c;
|
|
48
|
+
--calendar-Point-40: #ec4651;
|
|
49
|
+
--calendar-Point-50: #e71825;
|
|
50
|
+
--calendar-Point-60: #b9131e;
|
|
51
|
+
--calendar-Point-70: #8b0e16;
|
|
52
|
+
--calendar-Point-80: #5c0a0f;
|
|
53
|
+
--calendar-Point-90: #2e0507;
|
|
54
|
+
--calendar-Warning-5: #fff8e9;
|
|
55
|
+
--calendar-Warning-10: #ffeac1;
|
|
56
|
+
--calendar-Warning-20: #ffe2a7;
|
|
57
|
+
--calendar-Warning-30: #ffd47c;
|
|
58
|
+
--calendar-Warning-40: #ffc550;
|
|
59
|
+
--calendar-Warning-50: #ffb724;
|
|
60
|
+
--calendar-Warning-60: #98690a;
|
|
61
|
+
--calendar-Warning-70: #66490e;
|
|
62
|
+
--calendar-Warning-80: #4d370b;
|
|
63
|
+
--calendar-Warning-90: #332507;
|
|
64
|
+
--calendar-Success-5: #eef7f0;
|
|
65
|
+
--calendar-Success-10: #cee9d4;
|
|
66
|
+
--calendar-Success-20: #b2dcbb;
|
|
67
|
+
--calendar-Success-30: #8cca99;
|
|
68
|
+
--calendar-Success-40: #33a14b;
|
|
69
|
+
--calendar-Success-50: #008a1e;
|
|
70
|
+
--calendar-Success-60: #006e18;
|
|
71
|
+
--calendar-Success-70: #005312;
|
|
72
|
+
--calendar-Success-80: #00370c;
|
|
73
|
+
--calendar-Success-90: #002207;
|
|
74
|
+
--calendar-Info-5: #e9f0ff;
|
|
75
|
+
--calendar-Info-10: #d4e1ff;
|
|
76
|
+
--calendar-Info-20: #a9c3ff;
|
|
77
|
+
--calendar-Info-30: #7da4ff;
|
|
78
|
+
--calendar-Info-40: #5286ff;
|
|
79
|
+
--calendar-Info-50: #2768ff;
|
|
80
|
+
--calendar-Info-60: #1f53cc;
|
|
81
|
+
--calendar-Info-70: #173e99;
|
|
82
|
+
--calendar-Info-80: #0c1f4d;
|
|
83
|
+
--calendar-Info-90: #040a1a;
|
|
84
|
+
--calendar-Red: #e40000;
|
|
85
|
+
--calendar-Red2: #ffe4e4;
|
|
86
|
+
--calendar-Green: #2fb400;
|
|
87
|
+
--calendar-Green-2: #d7ffe0;
|
|
88
|
+
--calendar-Orange: #ff8800;
|
|
89
|
+
--calendar-Orange-5: #ffead1;
|
|
90
|
+
--calendar-Orange-10: #ffdacc;
|
|
91
|
+
--calendar-Orange-30: #ff8f66;
|
|
92
|
+
--calendar-Orange-40: #ff6a33;
|
|
93
|
+
--calendar-Orange-50: #ff4500;
|
|
94
|
+
--calendar-Orange-60: #d53209;
|
|
95
|
+
--calendar-Orange-70: #992900;
|
|
96
|
+
--calendar-Orange-80: #661c00;
|
|
97
|
+
--calendar-Orange-90: #330e00;
|
|
98
|
+
--Calendar-Background: #ffffff;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
body[data-theme="dark"] {
|
|
102
|
+
--calendar-white: #000000;
|
|
103
|
+
--calendar-black: #ffffff;
|
|
104
|
+
--calendar-P-90: #eff5ff;
|
|
105
|
+
--calendar-P-80: #d3e1fb;
|
|
106
|
+
--calendar-P-70: #a7c4f7;
|
|
107
|
+
--calendar-P-60: #7ca6f3;
|
|
108
|
+
--calendar-P-50: #5089ef;
|
|
109
|
+
--calendar-P-40: #246beb;
|
|
110
|
+
--calendar-P-30: #225fc9;
|
|
111
|
+
--calendar-P-20: #1e53b4;
|
|
112
|
+
--calendar-P-10: #1b4ba3;
|
|
113
|
+
--calendar-P-5: #0f2b5f;
|
|
114
|
+
--calendar-S-90: #edf1f5;
|
|
115
|
+
--calendar-S-80: #cdd7e4;
|
|
116
|
+
--calendar-S-70: #b4c4d6;
|
|
117
|
+
--calendar-S-60: #99b0cb;
|
|
118
|
+
--calendar-S-50: #2a5c96;
|
|
119
|
+
--calendar-S-40: #003675;
|
|
120
|
+
--calendar-S-30: #002b5e;
|
|
121
|
+
--calendar-S-20: #002036;
|
|
122
|
+
--calendar-S-10: #00162f;
|
|
123
|
+
--calendar-S-5: #000b17;
|
|
124
|
+
--calendar-G-90: #f8f8f8;
|
|
125
|
+
--calendar-G-80: #f0f0f0;
|
|
126
|
+
--calendar-G-70: #e4e4e4;
|
|
127
|
+
--calendar-G-60: #d8d8d8;
|
|
128
|
+
--calendar-G-50: #c6c6c6;
|
|
129
|
+
--calendar-G-40: #8e8e8e;
|
|
130
|
+
--calendar-G-30: #717171;
|
|
131
|
+
--calendar-G-20: #555555;
|
|
132
|
+
--calendar-G-10: #2d2d2d;
|
|
133
|
+
--calendar-G-5: #1d1d1d;
|
|
134
|
+
--calendar-Point-5: #fdf2f3;
|
|
135
|
+
--calendar-Point-10: #f8d6d8;
|
|
136
|
+
--calendar-Point-20: #f5a3a8;
|
|
137
|
+
--calendar-Point-30: #f1747c;
|
|
138
|
+
--calendar-Point-40: #ec4651;
|
|
139
|
+
--calendar-Point-50: #e71825;
|
|
140
|
+
--calendar-Point-60: #b9131e;
|
|
141
|
+
--calendar-Point-70: #8b0e16;
|
|
142
|
+
--calendar-Point-80: #5c0a0f;
|
|
143
|
+
--calendar-Point-90: #2e0507;
|
|
144
|
+
--calendar-Warning-5: #fff8e9;
|
|
145
|
+
--calendar-Warning-10: #ffeac1;
|
|
146
|
+
--calendar-Warning-20: #ffe2a7;
|
|
147
|
+
--calendar-Warning-30: #ffd47c;
|
|
148
|
+
--calendar-Warning-40: #ffc550;
|
|
149
|
+
--calendar-Warning-50: #ffb724;
|
|
150
|
+
--calendar-Warning-60: #98690a;
|
|
151
|
+
--calendar-Warning-70: #66490e;
|
|
152
|
+
--calendar-Warning-80: #4d370b;
|
|
153
|
+
--calendar-Warning-90: #332507;
|
|
154
|
+
--calendar-Success-5: #eef7f0;
|
|
155
|
+
--calendar-Success-10: #cee9d4;
|
|
156
|
+
--calendar-Success-20: #b2dcbb;
|
|
157
|
+
--calendar-Success-30: #8cca99;
|
|
158
|
+
--calendar-Success-40: #33a14b;
|
|
159
|
+
--calendar-Success-50: #008a1e;
|
|
160
|
+
--calendar-Success-60: #006e18;
|
|
161
|
+
--calendar-Success-70: #005312;
|
|
162
|
+
--calendar-Success-80: #00370c;
|
|
163
|
+
--calendar-Success-90: #002207;
|
|
164
|
+
--calendar-Info-5: #e9f0ff;
|
|
165
|
+
--calendar-Info-10: #d4e1ff;
|
|
166
|
+
--calendar-Info-20: #a9c3ff;
|
|
167
|
+
--calendar-Info-30: #7da4ff;
|
|
168
|
+
--calendar-Info-40: #5286ff;
|
|
169
|
+
--calendar-Info-50: #2768ff;
|
|
170
|
+
--calendar-Info-60: #1f53cc;
|
|
171
|
+
--calendar-Info-70: #173e99;
|
|
172
|
+
--calendar-Info-80: #0c1f4d;
|
|
173
|
+
--calendar-Info-90: #040a1a;
|
|
174
|
+
--calendar-Red: #e40000;
|
|
175
|
+
--calendar-Red2: #ffe4e4;
|
|
176
|
+
--calendar-Green: #2fb400;
|
|
177
|
+
--calendar-Green-2: #d7ffe0;
|
|
178
|
+
--calendar-Orange: #ff8800;
|
|
179
|
+
--calendar-Orange-5: #ffead1;
|
|
180
|
+
--calendar-Orange-10: #ffdacc;
|
|
181
|
+
--calendar-Orange-30: #ff8f66;
|
|
182
|
+
--calendar-Orange-40: #ff6a33;
|
|
183
|
+
--calendar-Orange-50: #ff4500;
|
|
184
|
+
--calendar-Orange-60: #d53209;
|
|
185
|
+
--calendar-Orange-70: #992900;
|
|
186
|
+
--calendar-Orange-80: #661c00;
|
|
187
|
+
--calendar-Orange-90: #330e00;
|
|
188
|
+
--Calendar-Background: #ffffff;
|
|
189
|
+
}
|
package/src/Calendar/index.tsx
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
import RangeCalendar from './RangeCalendar';
|
|
3
|
-
import ScrollCalendar from './ScrollCalendar';
|
|
4
|
-
import SingleCalendar from './SingleCalendar';
|
|
5
|
-
import { CalendarRange, CalendarView } from './type';
|
|
6
|
-
|
|
7
|
-
import './index.scss';
|
|
8
|
-
|
|
9
|
-
interface CalendarProps {
|
|
10
|
-
className?: string;
|
|
11
|
-
date?: Date | CalendarRange;
|
|
12
|
-
view?: CalendarView;
|
|
13
|
-
setView?: (view:CalendarView)=>void;
|
|
14
|
-
tileContent?: (date: Date | undefined, view: CalendarView) => React.ReactNode;
|
|
15
|
-
onChange?:(date:Date | CalendarRange, method?:CalendarView)=>void;
|
|
16
|
-
min?: Date;
|
|
17
|
-
max?: Date;
|
|
18
|
-
onClose?: () => void;
|
|
19
|
-
viewSelector?: boolean;
|
|
20
|
-
selectRange?: boolean;
|
|
21
|
-
scroll?: boolean;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default function Calendar({
|
|
25
|
-
className = '', date: selectedDate, view, setView = () => { }, tileContent, onChange = () => { }, onClose, viewSelector = true,
|
|
26
|
-
min = new Date('2000-01-01'), max = new Date('2099-11-31'), selectRange = false, scroll = false,
|
|
27
|
-
}: CalendarProps) {
|
|
28
|
-
if (scroll) {
|
|
29
|
-
return (
|
|
30
|
-
<ScrollCalendar
|
|
31
|
-
className={className}
|
|
32
|
-
date={selectedDate as CalendarRange}
|
|
33
|
-
onChange={onChange}
|
|
34
|
-
min={min}
|
|
35
|
-
max={max}
|
|
36
|
-
/>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
if (selectRange) {
|
|
40
|
-
return (
|
|
41
|
-
<RangeCalendar
|
|
42
|
-
className={className}
|
|
43
|
-
date={selectedDate as CalendarRange}
|
|
44
|
-
onChange={onChange}
|
|
45
|
-
min={min}
|
|
46
|
-
max={max}
|
|
47
|
-
onClose={onClose}
|
|
48
|
-
/>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<SingleCalendar
|
|
54
|
-
className={className}
|
|
55
|
-
date={selectedDate as Date}
|
|
56
|
-
view={view}
|
|
57
|
-
setView={setView}
|
|
58
|
-
tileContent={tileContent}
|
|
59
|
-
onChange={onChange}
|
|
60
|
-
min={min}
|
|
61
|
-
max={max}
|
|
62
|
-
onClose={onClose}
|
|
63
|
-
viewSelector={viewSelector}
|
|
64
|
-
/>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
1
|
+
|
|
2
|
+
import RangeCalendar from './RangeCalendar';
|
|
3
|
+
import ScrollCalendar from './ScrollCalendar';
|
|
4
|
+
import SingleCalendar from './SingleCalendar';
|
|
5
|
+
import { CalendarRange, CalendarView } from './type';
|
|
6
|
+
|
|
7
|
+
import './index.scss';
|
|
8
|
+
|
|
9
|
+
interface CalendarProps {
|
|
10
|
+
className?: string;
|
|
11
|
+
date?: Date | CalendarRange;
|
|
12
|
+
view?: CalendarView;
|
|
13
|
+
setView?: (view:CalendarView)=>void;
|
|
14
|
+
tileContent?: (date: Date | undefined, view: CalendarView) => React.ReactNode;
|
|
15
|
+
onChange?:(date:Date | CalendarRange, method?:CalendarView)=>void;
|
|
16
|
+
min?: Date;
|
|
17
|
+
max?: Date;
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
viewSelector?: boolean;
|
|
20
|
+
selectRange?: boolean;
|
|
21
|
+
scroll?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default function Calendar({
|
|
25
|
+
className = '', date: selectedDate, view, setView = () => { }, tileContent, onChange = () => { }, onClose, viewSelector = true,
|
|
26
|
+
min = new Date('2000-01-01'), max = new Date('2099-11-31'), selectRange = false, scroll = false,
|
|
27
|
+
}: CalendarProps) {
|
|
28
|
+
if (scroll) {
|
|
29
|
+
return (
|
|
30
|
+
<ScrollCalendar
|
|
31
|
+
className={className}
|
|
32
|
+
date={selectedDate as CalendarRange}
|
|
33
|
+
onChange={onChange}
|
|
34
|
+
min={min}
|
|
35
|
+
max={max}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
if (selectRange) {
|
|
40
|
+
return (
|
|
41
|
+
<RangeCalendar
|
|
42
|
+
className={className}
|
|
43
|
+
date={selectedDate as CalendarRange}
|
|
44
|
+
onChange={onChange}
|
|
45
|
+
min={min}
|
|
46
|
+
max={max}
|
|
47
|
+
onClose={onClose}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<SingleCalendar
|
|
54
|
+
className={className}
|
|
55
|
+
date={selectedDate as Date}
|
|
56
|
+
view={view}
|
|
57
|
+
setView={setView}
|
|
58
|
+
tileContent={tileContent}
|
|
59
|
+
onChange={onChange}
|
|
60
|
+
min={min}
|
|
61
|
+
max={max}
|
|
62
|
+
onClose={onClose}
|
|
63
|
+
viewSelector={viewSelector}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
66
|
+
}
|
package/src/Calendar/type.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type CalendarView = 'day' | 'month' | 'year';
|
|
2
|
-
|
|
3
|
-
export type CalendarRange = [Date | null | undefined, Date | null | undefined];
|
|
1
|
+
export type CalendarView = 'day' | 'month' | 'year';
|
|
2
|
+
|
|
3
|
+
export type CalendarRange = [Date | null | undefined, Date | null | undefined];
|
|
@@ -1,45 +1,45 @@
|
|
|
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: 'before', date: prevDate });
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const currentDate = new Date(startOfMonth);
|
|
19
|
-
|
|
20
|
-
while (currentDate <= endOfMonth) {
|
|
21
|
-
currentWeek.push({ thisMonth: 'this', 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: 'after', 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
|
+
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: 'before', date: prevDate });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const currentDate = new Date(startOfMonth);
|
|
19
|
+
|
|
20
|
+
while (currentDate <= endOfMonth) {
|
|
21
|
+
currentWeek.push({ thisMonth: 'this', 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: 'after', 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 +1,8 @@
|
|
|
1
|
-
import { CalendarRange } from '@/Calendar/type';
|
|
2
|
-
|
|
3
|
-
const isInRange = (day: Date, range?:CalendarRange) => {
|
|
4
|
-
if (!range?.[0] || !range?.[1]) return false;
|
|
5
|
-
return day >= range[0] && day < range[1];
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export default isInRange;
|
|
1
|
+
import { CalendarRange } from '@/Calendar/type';
|
|
2
|
+
|
|
3
|
+
const isInRange = (day: Date, range?:CalendarRange) => {
|
|
4
|
+
if (!range?.[0] || !range?.[1]) return false;
|
|
5
|
+
return day >= range[0] && day < range[1];
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export default isInRange;
|
|
@@ -1,21 +1,21 @@
|
|
|
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
|
+
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;
|