react-weekly-planning 1.0.29 → 1.0.30
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/__tests__/page.test.js +106 -46
- package/__tests__/page.test.tsx +117 -45
- package/babel.config.js +1 -0
- package/components/AddTask/index.js +17 -17
- package/components/AddTask/index.tsx +4 -0
- package/components/CalendarForWeek.js +50 -0
- package/components/{CalendarTable.tsx → CalendarForWeek.tsx} +49 -39
- package/components/CalendarForday.js +34 -0
- package/components/CalendarForday.tsx +130 -0
- package/components/DayContainer/index.js +15 -15
- package/components/DayContainer/index.tsx +1 -0
- package/components/GroupContainer/index.js +15 -15
- package/components/GroupContainer/index.tsx +1 -0
- package/components/GroupsHeadContainer/index.js +9 -9
- package/components/SumHoursContainer/index.js +15 -15
- package/components/SumHoursHead/index.js +9 -9
- package/components/TaskContainer/index.js +35 -35
- package/components/TaskContainer/index.tsx +1 -1
- package/components/TaskList/index.js +5 -0
- package/components/TaskList/index.tsx +20 -0
- package/contexts/CalendarContext.js +12 -12
- package/contexts/CalendarContext.tsx +4 -0
- package/definitions/index.js +1 -1
- package/definitions/index.ts +644 -4
- package/docs/global.html +4982 -4982
- package/docs/index.html +474 -474
- package/docs/index.ts.html +121 -121
- package/docs/scripts/linenumber.js +26 -26
- package/docs/scripts/search.js +38 -38
- package/docs/styles/iframe.css +12 -12
- package/docs/styles/prettify-jsdoc.css +111 -111
- package/docs/styles/prettify-tomorrow.css +132 -132
- package/docs/styles/reset.css +44 -44
- package/hooks/useCalendarDateState.js +19 -13
- package/hooks/useCalendarDateState.ts +28 -8
- package/index.js +70 -52
- package/index.tsx +57 -41
- package/jest.config.js +9 -9
- package/lib/slyles.js +21 -21
- package/lib/slyles.ts +1 -1
- package/lib/utils.js +619 -317
- package/lib/utils.ts +558 -6
- package/out/index.html +128 -128
- package/out/scripts/linenumber.js +26 -26
- package/out/scripts/search.js +38 -38
- package/out/styles/iframe.css +12 -12
- package/out/styles/prettify-jsdoc.css +111 -111
- package/out/styles/prettify-tomorrow.css +132 -132
- package/out/styles/reset.css +44 -44
- package/package.json +81 -71
- package/style.css +26 -4
- package/components/CalendarTable.js +0 -48
|
@@ -1,132 +1,132 @@
|
|
|
1
|
-
/* Tomorrow Theme */
|
|
2
|
-
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
|
|
3
|
-
/* Pretty printing styles. Used with prettify.js. */
|
|
4
|
-
/* SPAN elements with the classes below are added by prettyprint. */
|
|
5
|
-
/* plain text */
|
|
6
|
-
.pln {
|
|
7
|
-
color: #4d4d4c; }
|
|
8
|
-
|
|
9
|
-
@media screen {
|
|
10
|
-
/* string content */
|
|
11
|
-
.str {
|
|
12
|
-
color: #718c00; }
|
|
13
|
-
|
|
14
|
-
/* a keyword */
|
|
15
|
-
.kwd {
|
|
16
|
-
color: #8959a8; }
|
|
17
|
-
|
|
18
|
-
/* a comment */
|
|
19
|
-
.com {
|
|
20
|
-
color: #8e908c; }
|
|
21
|
-
|
|
22
|
-
/* a type name */
|
|
23
|
-
.typ {
|
|
24
|
-
color: #4271ae; }
|
|
25
|
-
|
|
26
|
-
/* a literal value */
|
|
27
|
-
.lit {
|
|
28
|
-
color: #f5871f; }
|
|
29
|
-
|
|
30
|
-
/* punctuation */
|
|
31
|
-
.pun {
|
|
32
|
-
color: #4d4d4c; }
|
|
33
|
-
|
|
34
|
-
/* lisp open bracket */
|
|
35
|
-
.opn {
|
|
36
|
-
color: #4d4d4c; }
|
|
37
|
-
|
|
38
|
-
/* lisp close bracket */
|
|
39
|
-
.clo {
|
|
40
|
-
color: #4d4d4c; }
|
|
41
|
-
|
|
42
|
-
/* a markup tag name */
|
|
43
|
-
.tag {
|
|
44
|
-
color: #c82829; }
|
|
45
|
-
|
|
46
|
-
/* a markup attribute name */
|
|
47
|
-
.atn {
|
|
48
|
-
color: #f5871f; }
|
|
49
|
-
|
|
50
|
-
/* a markup attribute value */
|
|
51
|
-
.atv {
|
|
52
|
-
color: #3e999f; }
|
|
53
|
-
|
|
54
|
-
/* a declaration */
|
|
55
|
-
.dec {
|
|
56
|
-
color: #f5871f; }
|
|
57
|
-
|
|
58
|
-
/* a variable name */
|
|
59
|
-
.var {
|
|
60
|
-
color: #c82829; }
|
|
61
|
-
|
|
62
|
-
/* a function name */
|
|
63
|
-
.fun {
|
|
64
|
-
color: #4271ae; } }
|
|
65
|
-
/* Use higher contrast and text-weight for printable form. */
|
|
66
|
-
@media print, projection {
|
|
67
|
-
.str {
|
|
68
|
-
color: #060; }
|
|
69
|
-
|
|
70
|
-
.kwd {
|
|
71
|
-
color: #006;
|
|
72
|
-
font-weight: bold; }
|
|
73
|
-
|
|
74
|
-
.com {
|
|
75
|
-
color: #600;
|
|
76
|
-
font-style: italic; }
|
|
77
|
-
|
|
78
|
-
.typ {
|
|
79
|
-
color: #404;
|
|
80
|
-
font-weight: bold; }
|
|
81
|
-
|
|
82
|
-
.lit {
|
|
83
|
-
color: #044; }
|
|
84
|
-
|
|
85
|
-
.pun, .opn, .clo {
|
|
86
|
-
color: #440; }
|
|
87
|
-
|
|
88
|
-
.tag {
|
|
89
|
-
color: #006;
|
|
90
|
-
font-weight: bold; }
|
|
91
|
-
|
|
92
|
-
.atn {
|
|
93
|
-
color: #404; }
|
|
94
|
-
|
|
95
|
-
.atv {
|
|
96
|
-
color: #060; } }
|
|
97
|
-
/* Style */
|
|
98
|
-
/*
|
|
99
|
-
pre.prettyprint {
|
|
100
|
-
background: white;
|
|
101
|
-
font-family: Consolas, Monaco, 'Andale Mono', monospace;
|
|
102
|
-
font-size: 12px;
|
|
103
|
-
line-height: 1.5;
|
|
104
|
-
border: 1px solid #ccc;
|
|
105
|
-
padding: 10px; }
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
|
-
/* Specify class=linenums on a pre to get line numbering */
|
|
109
|
-
ol.linenums {
|
|
110
|
-
margin-top: 0;
|
|
111
|
-
margin-bottom: 0; }
|
|
112
|
-
|
|
113
|
-
/* IE indents via margin-left */
|
|
114
|
-
li.L0,
|
|
115
|
-
li.L1,
|
|
116
|
-
li.L2,
|
|
117
|
-
li.L3,
|
|
118
|
-
li.L4,
|
|
119
|
-
li.L5,
|
|
120
|
-
li.L6,
|
|
121
|
-
li.L7,
|
|
122
|
-
li.L8,
|
|
123
|
-
li.L9 {
|
|
124
|
-
/* */ }
|
|
125
|
-
|
|
126
|
-
/* Alternate shading for lines */
|
|
127
|
-
li.L1,
|
|
128
|
-
li.L3,
|
|
129
|
-
li.L5,
|
|
130
|
-
li.L7,
|
|
131
|
-
li.L9 {
|
|
132
|
-
/* */ }
|
|
1
|
+
/* Tomorrow Theme */
|
|
2
|
+
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
|
|
3
|
+
/* Pretty printing styles. Used with prettify.js. */
|
|
4
|
+
/* SPAN elements with the classes below are added by prettyprint. */
|
|
5
|
+
/* plain text */
|
|
6
|
+
.pln {
|
|
7
|
+
color: #4d4d4c; }
|
|
8
|
+
|
|
9
|
+
@media screen {
|
|
10
|
+
/* string content */
|
|
11
|
+
.str {
|
|
12
|
+
color: #718c00; }
|
|
13
|
+
|
|
14
|
+
/* a keyword */
|
|
15
|
+
.kwd {
|
|
16
|
+
color: #8959a8; }
|
|
17
|
+
|
|
18
|
+
/* a comment */
|
|
19
|
+
.com {
|
|
20
|
+
color: #8e908c; }
|
|
21
|
+
|
|
22
|
+
/* a type name */
|
|
23
|
+
.typ {
|
|
24
|
+
color: #4271ae; }
|
|
25
|
+
|
|
26
|
+
/* a literal value */
|
|
27
|
+
.lit {
|
|
28
|
+
color: #f5871f; }
|
|
29
|
+
|
|
30
|
+
/* punctuation */
|
|
31
|
+
.pun {
|
|
32
|
+
color: #4d4d4c; }
|
|
33
|
+
|
|
34
|
+
/* lisp open bracket */
|
|
35
|
+
.opn {
|
|
36
|
+
color: #4d4d4c; }
|
|
37
|
+
|
|
38
|
+
/* lisp close bracket */
|
|
39
|
+
.clo {
|
|
40
|
+
color: #4d4d4c; }
|
|
41
|
+
|
|
42
|
+
/* a markup tag name */
|
|
43
|
+
.tag {
|
|
44
|
+
color: #c82829; }
|
|
45
|
+
|
|
46
|
+
/* a markup attribute name */
|
|
47
|
+
.atn {
|
|
48
|
+
color: #f5871f; }
|
|
49
|
+
|
|
50
|
+
/* a markup attribute value */
|
|
51
|
+
.atv {
|
|
52
|
+
color: #3e999f; }
|
|
53
|
+
|
|
54
|
+
/* a declaration */
|
|
55
|
+
.dec {
|
|
56
|
+
color: #f5871f; }
|
|
57
|
+
|
|
58
|
+
/* a variable name */
|
|
59
|
+
.var {
|
|
60
|
+
color: #c82829; }
|
|
61
|
+
|
|
62
|
+
/* a function name */
|
|
63
|
+
.fun {
|
|
64
|
+
color: #4271ae; } }
|
|
65
|
+
/* Use higher contrast and text-weight for printable form. */
|
|
66
|
+
@media print, projection {
|
|
67
|
+
.str {
|
|
68
|
+
color: #060; }
|
|
69
|
+
|
|
70
|
+
.kwd {
|
|
71
|
+
color: #006;
|
|
72
|
+
font-weight: bold; }
|
|
73
|
+
|
|
74
|
+
.com {
|
|
75
|
+
color: #600;
|
|
76
|
+
font-style: italic; }
|
|
77
|
+
|
|
78
|
+
.typ {
|
|
79
|
+
color: #404;
|
|
80
|
+
font-weight: bold; }
|
|
81
|
+
|
|
82
|
+
.lit {
|
|
83
|
+
color: #044; }
|
|
84
|
+
|
|
85
|
+
.pun, .opn, .clo {
|
|
86
|
+
color: #440; }
|
|
87
|
+
|
|
88
|
+
.tag {
|
|
89
|
+
color: #006;
|
|
90
|
+
font-weight: bold; }
|
|
91
|
+
|
|
92
|
+
.atn {
|
|
93
|
+
color: #404; }
|
|
94
|
+
|
|
95
|
+
.atv {
|
|
96
|
+
color: #060; } }
|
|
97
|
+
/* Style */
|
|
98
|
+
/*
|
|
99
|
+
pre.prettyprint {
|
|
100
|
+
background: white;
|
|
101
|
+
font-family: Consolas, Monaco, 'Andale Mono', monospace;
|
|
102
|
+
font-size: 12px;
|
|
103
|
+
line-height: 1.5;
|
|
104
|
+
border: 1px solid #ccc;
|
|
105
|
+
padding: 10px; }
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
/* Specify class=linenums on a pre to get line numbering */
|
|
109
|
+
ol.linenums {
|
|
110
|
+
margin-top: 0;
|
|
111
|
+
margin-bottom: 0; }
|
|
112
|
+
|
|
113
|
+
/* IE indents via margin-left */
|
|
114
|
+
li.L0,
|
|
115
|
+
li.L1,
|
|
116
|
+
li.L2,
|
|
117
|
+
li.L3,
|
|
118
|
+
li.L4,
|
|
119
|
+
li.L5,
|
|
120
|
+
li.L6,
|
|
121
|
+
li.L7,
|
|
122
|
+
li.L8,
|
|
123
|
+
li.L9 {
|
|
124
|
+
/* */ }
|
|
125
|
+
|
|
126
|
+
/* Alternate shading for lines */
|
|
127
|
+
li.L1,
|
|
128
|
+
li.L3,
|
|
129
|
+
li.L5,
|
|
130
|
+
li.L7,
|
|
131
|
+
li.L9 {
|
|
132
|
+
/* */ }
|
package/out/styles/reset.css
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
/* reset css */
|
|
2
|
-
html, body, div, span, applet, object, iframe,
|
|
3
|
-
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
4
|
-
a, abbr, acronym, address, big, cite, code,
|
|
5
|
-
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
6
|
-
small, strike, strong, sub, sup, tt, var,
|
|
7
|
-
b, u, i, center,
|
|
8
|
-
dl, dt, dd, ol, ul, li,
|
|
9
|
-
fieldset, form, label, legend,
|
|
10
|
-
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
11
|
-
article, aside, canvas, details, embed,
|
|
12
|
-
figure, figcaption, footer, header, hgroup,
|
|
13
|
-
menu, nav, output, ruby, section, summary,
|
|
14
|
-
time, mark, audio, video {
|
|
15
|
-
margin: 0;
|
|
16
|
-
padding: 0;
|
|
17
|
-
border: 0;
|
|
18
|
-
font-size: 100%;
|
|
19
|
-
font: inherit;
|
|
20
|
-
vertical-align: baseline;
|
|
21
|
-
}
|
|
22
|
-
/* HTML5 display-role reset for older browsers */
|
|
23
|
-
article, aside, details, figcaption, figure,
|
|
24
|
-
footer, header, hgroup, menu, nav, section {
|
|
25
|
-
display: block;
|
|
26
|
-
}
|
|
27
|
-
body {
|
|
28
|
-
line-height: 1;
|
|
29
|
-
}
|
|
30
|
-
ol, ul {
|
|
31
|
-
list-style: none;
|
|
32
|
-
}
|
|
33
|
-
blockquote, q {
|
|
34
|
-
quotes: none;
|
|
35
|
-
}
|
|
36
|
-
blockquote:before, blockquote:after,
|
|
37
|
-
q:before, q:after {
|
|
38
|
-
content: '';
|
|
39
|
-
content: none;
|
|
40
|
-
}
|
|
41
|
-
table {
|
|
42
|
-
border-collapse: collapse;
|
|
43
|
-
border-spacing: 0;
|
|
44
|
-
}
|
|
1
|
+
/* reset css */
|
|
2
|
+
html, body, div, span, applet, object, iframe,
|
|
3
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
4
|
+
a, abbr, acronym, address, big, cite, code,
|
|
5
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
6
|
+
small, strike, strong, sub, sup, tt, var,
|
|
7
|
+
b, u, i, center,
|
|
8
|
+
dl, dt, dd, ol, ul, li,
|
|
9
|
+
fieldset, form, label, legend,
|
|
10
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
11
|
+
article, aside, canvas, details, embed,
|
|
12
|
+
figure, figcaption, footer, header, hgroup,
|
|
13
|
+
menu, nav, output, ruby, section, summary,
|
|
14
|
+
time, mark, audio, video {
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
border: 0;
|
|
18
|
+
font-size: 100%;
|
|
19
|
+
font: inherit;
|
|
20
|
+
vertical-align: baseline;
|
|
21
|
+
}
|
|
22
|
+
/* HTML5 display-role reset for older browsers */
|
|
23
|
+
article, aside, details, figcaption, figure,
|
|
24
|
+
footer, header, hgroup, menu, nav, section {
|
|
25
|
+
display: block;
|
|
26
|
+
}
|
|
27
|
+
body {
|
|
28
|
+
line-height: 1;
|
|
29
|
+
}
|
|
30
|
+
ol, ul {
|
|
31
|
+
list-style: none;
|
|
32
|
+
}
|
|
33
|
+
blockquote, q {
|
|
34
|
+
quotes: none;
|
|
35
|
+
}
|
|
36
|
+
blockquote:before, blockquote:after,
|
|
37
|
+
q:before, q:after {
|
|
38
|
+
content: '';
|
|
39
|
+
content: none;
|
|
40
|
+
}
|
|
41
|
+
table {
|
|
42
|
+
border-collapse: collapse;
|
|
43
|
+
border-spacing: 0;
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,71 +1,81 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-weekly-planning",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"main": "index.js",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"test": "jest",
|
|
7
|
-
"test:watch": "jest --watch",
|
|
8
|
-
"build": "tsc",
|
|
9
|
-
"doc": "jsdoc -c jsdoc.json"
|
|
10
|
-
},
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/Yvesmorel/react-pweekly-planning.git"
|
|
14
|
-
},
|
|
15
|
-
"homepage": "https://github.com/Yvesmorel/react-pweekly-planning.git#readme",
|
|
16
|
-
"bugs": {
|
|
17
|
-
"url": "https://github.com/Yvesmorel/react-pweekly-planning/issues"
|
|
18
|
-
},
|
|
19
|
-
"keywords": [
|
|
20
|
-
"react",
|
|
21
|
-
"react-weekly-planning",
|
|
22
|
-
"schedule customizable",
|
|
23
|
-
"calendar",
|
|
24
|
-
"planning",
|
|
25
|
-
"weekly",
|
|
26
|
-
"task management",
|
|
27
|
-
"group tasks",
|
|
28
|
-
"schedule",
|
|
29
|
-
"event planning",
|
|
30
|
-
"date picker",
|
|
31
|
-
"week offset",
|
|
32
|
-
"calendar component",
|
|
33
|
-
"React calendar",
|
|
34
|
-
"task scheduler",
|
|
35
|
-
"weekly planning",
|
|
36
|
-
"productivity"
|
|
37
|
-
],
|
|
38
|
-
"author": "Kacou Yao Yves Morel",
|
|
39
|
-
"license": "MIT",
|
|
40
|
-
"description": "react-weekly-planning provides a React component for weekly planning. Easily set up and manage a weekly schedule with customizable tasks, groups and views.",
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"@babel/types": "^7.24.5",
|
|
43
|
-
"@types/babel__generator": "^7.6.8",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"babel-
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "react-weekly-planning",
|
|
3
|
+
"version": "1.0.30",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "jest --env=jsdom",
|
|
7
|
+
"test:watch": "jest --watch",
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"doc": "jsdoc -c jsdoc.json"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/Yvesmorel/react-pweekly-planning.git"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/Yvesmorel/react-pweekly-planning.git#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/Yvesmorel/react-pweekly-planning/issues"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"react",
|
|
21
|
+
"react-weekly-planning",
|
|
22
|
+
"schedule customizable",
|
|
23
|
+
"calendar",
|
|
24
|
+
"planning",
|
|
25
|
+
"weekly",
|
|
26
|
+
"task management",
|
|
27
|
+
"group tasks",
|
|
28
|
+
"schedule",
|
|
29
|
+
"event planning",
|
|
30
|
+
"date picker",
|
|
31
|
+
"week offset",
|
|
32
|
+
"calendar component",
|
|
33
|
+
"React calendar",
|
|
34
|
+
"task scheduler",
|
|
35
|
+
"weekly planning",
|
|
36
|
+
"productivity"
|
|
37
|
+
],
|
|
38
|
+
"author": "Kacou Yao Yves Morel",
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"description": "react-weekly-planning provides a React component for weekly planning. Easily set up and manage a weekly schedule with customizable tasks, groups and views.",
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@babel/types": "^7.24.5",
|
|
43
|
+
"@types/babel__generator": "^7.6.8",
|
|
44
|
+
"axios": "^1.7.9",
|
|
45
|
+
"dayjs": "^1.11.13",
|
|
46
|
+
"ical": "^0.8.0",
|
|
47
|
+
"ics-to-json": "^2.0.2",
|
|
48
|
+
"moment": "^2.30.1",
|
|
49
|
+
"react": "^18.3.1",
|
|
50
|
+
"react-dom": "^18.3.1",
|
|
51
|
+
"react-use-search": "^0.3.2",
|
|
52
|
+
"react-window": "^1.8.11",
|
|
53
|
+
"sass": "^1.77.2",
|
|
54
|
+
"ts-node": "^10.9.2",
|
|
55
|
+
"uuid": "^11.0.5"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@babel/core": "^7.24.5",
|
|
59
|
+
"@babel/preset-env": "^7.24.5",
|
|
60
|
+
"@babel/preset-react": "^7.24.1",
|
|
61
|
+
"@babel/preset-typescript": "^7.24.1",
|
|
62
|
+
"@testing-library/dom": "^10.4.0",
|
|
63
|
+
"@testing-library/jest-dom": "^6.4.5",
|
|
64
|
+
"@testing-library/react": "^15.0.7",
|
|
65
|
+
"@types/babel__core": "^7.20.5",
|
|
66
|
+
"@types/ical": "^0.8.3",
|
|
67
|
+
"@types/jest": "^29.5.12",
|
|
68
|
+
"@types/react": "^18.3.18",
|
|
69
|
+
"@types/react-dom": "^18.3.5",
|
|
70
|
+
"@types/react-window": "^1.8.8",
|
|
71
|
+
"babel-jest": "^29.7.0",
|
|
72
|
+
"better-docs": "^2.7.3",
|
|
73
|
+
"docdash": "^2.0.2",
|
|
74
|
+
"jest": "^29.7.0",
|
|
75
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
76
|
+
"react-test-renderer": "^18.3.1",
|
|
77
|
+
"tailwindcss": "^3.4.3",
|
|
78
|
+
"ts-jest": "^29.1.3",
|
|
79
|
+
"typescript": "^5.4.5"
|
|
80
|
+
}
|
|
81
|
+
}
|
package/style.css
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
justify-content: center;
|
|
24
24
|
column-gap: 10px;
|
|
25
25
|
flex-direction: column;
|
|
26
|
-
height:
|
|
26
|
+
height: auto;
|
|
27
27
|
border-left: 5px solid #457993;
|
|
28
28
|
background-color: #f4ffff;
|
|
29
29
|
color: #457993;
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
margin-bottom: 5px;
|
|
33
33
|
font-size: 13px;
|
|
34
34
|
overflow: auto;
|
|
35
|
+
padding: 2px;
|
|
36
|
+
z-index: 10;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
.tasklabel {
|
|
@@ -49,15 +51,16 @@
|
|
|
49
51
|
margin-left: 5px;
|
|
50
52
|
}
|
|
51
53
|
|
|
52
|
-
.planningCalendar{
|
|
54
|
+
.planningCalendar {
|
|
53
55
|
width: 100%;
|
|
54
56
|
height: 150px;
|
|
55
57
|
border-radius: 0.5rem;
|
|
56
58
|
z-index: 10;
|
|
57
59
|
}
|
|
58
|
-
|
|
60
|
+
|
|
61
|
+
.planningCalendar .dayTh {
|
|
59
62
|
color: #0f5173;
|
|
60
|
-
padding-left: 5px
|
|
63
|
+
padding-left: 5px;
|
|
61
64
|
}
|
|
62
65
|
.planningCalendar .totalTh {
|
|
63
66
|
color: #0f5173;
|
|
@@ -76,3 +79,22 @@
|
|
|
76
79
|
border-bottom: 1.5px solid #0f52737e;
|
|
77
80
|
padding: 2px;
|
|
78
81
|
}
|
|
82
|
+
.planningCalendar tr:nth-child(1){
|
|
83
|
+
z-index: 200;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.CalendarTableForDay {
|
|
87
|
+
display: flex;
|
|
88
|
+
gap: 10px;
|
|
89
|
+
width: 100vw;
|
|
90
|
+
height: auto;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.CalendarTableForDayTasksContainer {
|
|
94
|
+
flex: 1;
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-direction: column;
|
|
97
|
+
height: auto;
|
|
98
|
+
padding: 10px;
|
|
99
|
+
position: relative;
|
|
100
|
+
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import GroupContainer from "./GroupContainer";
|
|
4
|
-
import GroupsHeadContainer from "./GroupsHeadContainer";
|
|
5
|
-
import { groupTdStyle, theadTrStyle } from "../lib/slyles";
|
|
6
|
-
import DayContainer from "./DayContainer";
|
|
7
|
-
import SumHoursHead from "./SumHoursHead";
|
|
8
|
-
import { compareWeekOffset, getSessionStorageRecordForDragAndDrop, saveTasksToLocalStorage, sumHoursByGroups, } from "../lib/utils";
|
|
9
|
-
import TaskContainer from "./TaskContainer";
|
|
10
|
-
import AddTask from "./AddTask";
|
|
11
|
-
import SumHoursContainer from "./SumHoursContainer";
|
|
12
|
-
import { memo, useCallback, useEffect } from "react";
|
|
13
|
-
import useCalendarDateState from "../hooks/useCalendarDateState";
|
|
14
|
-
function CalendarTable(props) {
|
|
15
|
-
var _a;
|
|
16
|
-
const { dailyHours, weekDays } = useCalendarDateState(props.date, props.weekOffset);
|
|
17
|
-
const handleDragOver = useCallback((event) => {
|
|
18
|
-
event.preventDefault();
|
|
19
|
-
}, []);
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
saveTasksToLocalStorage(props.tasks);
|
|
22
|
-
}, [props.tasks]);
|
|
23
|
-
return (_jsxs("table", { className: `planningCalendar ${props.className}`, style: Object.assign({}, props.style), children: [_jsx("thead", { children: _jsxs("tr", { className: `${props.rowsClassName}`, style: Object.assign(Object.assign({}, theadTrStyle), props.rowsStyle), children: [_jsx("th", { className: "dayTh", children: _jsx(GroupsHeadContainer, { className: `${props.groupHeadContainerClassName}`, style: props.groupHeadContainerStyle, groupsHeadRender: props.groupsHeadRender }) }), weekDays.map((day, i) => (_jsx("th", { className: `${props.daysColsClassName}`, style: Object.assign({}, props.daysColsStyle), children: _jsx(DayContainer, { style: props.dayStyle, className: props.dayClassName, dayIndex: i, dayRender: props.dayRender, day: day.day, dayOfTheMonth: day.dayOfTheMonth, dayMonth: day.dayMonth, dayYear: day.dayYear }) }, i))), _jsx("th", { className: "totalTh", children: _jsx(SumHoursHead, { className: props.sumHoursHeadClassName, style: props.sumHoursHeadStyle, sumHoursHeadRender: props.sumHoursHeadRender }) })] }, "") }), _jsx("tbody", { children: (_a = props.groups) === null || _a === void 0 ? void 0 : _a.map((group, i) => (_jsxs("tr", { className: `${props.rowsClassName}`, style: Object.assign({}, props.rowsStyle), children: [_jsx("td", { className: `${props.groupsColsClassName}`, style: Object.assign(Object.assign({}, groupTdStyle), props.groupsColsStyle), children: _jsx(GroupContainer, { style: props.groupStyle, className: props.groupClassName, groupRender: props.groupRender, currentGroup: group, handleClickGroup: props.handleClickGroup }) }, i), dailyHours.map((_, positionDay) => {
|
|
24
|
-
var _a;
|
|
25
|
-
return (_jsx("td", { onDragOver: handleDragOver, onDrop: (event) => {
|
|
26
|
-
if (!props.handleDropTask || !props.tasks)
|
|
27
|
-
return;
|
|
28
|
-
const dropInfo = getSessionStorageRecordForDragAndDrop(props.tasks, positionDay, group.id);
|
|
29
|
-
if (!dropInfo)
|
|
30
|
-
return;
|
|
31
|
-
props.handleDropTask(event, dropInfo.taskDropStart, dropInfo.taskDropEnd, dropInfo.taskDropDate, group.id, positionDay, dropInfo.newTask, dropInfo.newTasks);
|
|
32
|
-
}, id: `td-${group.id}day-i`, children: _jsxs("div", { style: {
|
|
33
|
-
display: "flex",
|
|
34
|
-
width: "100%",
|
|
35
|
-
height: "100%",
|
|
36
|
-
flexDirection: "column",
|
|
37
|
-
padding: "5px",
|
|
38
|
-
}, children: [_jsx(_Fragment, { children: (_a = props.tasks) === null || _a === void 0 ? void 0 : _a.filter((task) => task.dayIndex === positionDay &&
|
|
39
|
-
task.groupId === group.id &&
|
|
40
|
-
compareWeekOffset(props.date, props.weekOffset || 0, task.taskDate)).sort((a, b) => a.taskStart - b.taskStart).map((task, taskKey) => {
|
|
41
|
-
return (_jsx(TaskContainer, { handleDragTask: props.handleDragTask, taskRender: props.taskRender, handleDragTaskEnd: props.handleDragTaskEnd, style: props.taskContainerStyle, className: `${props.taskContainerClassName}`, currentTask: task, handleClickTask: props.handleClickTask }, `${taskKey} task`));
|
|
42
|
-
}) }), _jsx(AddTask, { addTaskStyle: props.addTaskStyle, addTaskClassName: props.addTaskClassName, currentGroup: group, dayInfo: dailyHours[positionDay], addTaskRender: props.addTaskRender, handleAddTask: props.handleAddTask })] }, positionDay) }, `td-${group.id}day-i${positionDay}`));
|
|
43
|
-
}), _jsx("td", { children: _jsx(SumHoursContainer, { groupId: group.id, tasks: props.tasks, weekOffset: props.weekOffset || 0, calendarDate: props.date, sumHoursRender: props.sumHoursRender, sumHoursByGroups: sumHoursByGroups(group.id, props.tasks, props.weekOffset || 0, props.date), className: props.sumHoursContainerClassName, style: props.sumHoursContainerStyle }) }, `${i}sumHours`)] }, `${i} tr`))) })] }));
|
|
44
|
-
}
|
|
45
|
-
export default memo(CalendarTable, (prevProps, nextProps) => prevProps.tasks === nextProps.tasks &&
|
|
46
|
-
prevProps.date === nextProps.date &&
|
|
47
|
-
prevProps.groups === nextProps.groups &&
|
|
48
|
-
prevProps.weekOffset === nextProps.weekOffset);
|