@chaaanito/event-resource-calendar 1.0.1 → 1.2.0
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 +64 -25
- package/jsconfig.json +12 -0
- package/package.json +17 -2
- package/src/event-resource.types.js +98 -0
- package/src/index.js +155 -524
- package/src/styles.css +171 -0
package/src/styles.css
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
.er-container {
|
|
2
|
+
font-family:
|
|
3
|
+
system-ui,
|
|
4
|
+
-apple-system,
|
|
5
|
+
sans-serif;
|
|
6
|
+
border: 1px solid #e5e7eb;
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
background: #fff;
|
|
9
|
+
width: 100%;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
}
|
|
13
|
+
.er-toolbar {
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: space-between;
|
|
16
|
+
align-items: center;
|
|
17
|
+
padding: 12px 16px;
|
|
18
|
+
border-bottom: 1px solid #e5e7eb;
|
|
19
|
+
background: #f9fafb;
|
|
20
|
+
border-radius: 8px 8px 0 0;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
gap: 12px;
|
|
23
|
+
}
|
|
24
|
+
.er-toolbar-group {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: 8px;
|
|
28
|
+
}
|
|
29
|
+
.er-btn {
|
|
30
|
+
padding: 6px 12px;
|
|
31
|
+
background: #fff;
|
|
32
|
+
border: 1px solid #d1d5db;
|
|
33
|
+
border-radius: 6px;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
font-size: 0.875rem;
|
|
36
|
+
font-weight: 500;
|
|
37
|
+
color: #374151;
|
|
38
|
+
transition: all 0.2s;
|
|
39
|
+
}
|
|
40
|
+
.er-btn:hover {
|
|
41
|
+
background: #f3f4f6;
|
|
42
|
+
}
|
|
43
|
+
.er-btn.active {
|
|
44
|
+
background: #e0e7ff;
|
|
45
|
+
color: #4f46e5;
|
|
46
|
+
border-color: #c7d2fe;
|
|
47
|
+
}
|
|
48
|
+
.er-date-picker {
|
|
49
|
+
padding: 5px 10px;
|
|
50
|
+
border: 1px solid #d1d5db;
|
|
51
|
+
border-radius: 6px;
|
|
52
|
+
font-family: inherit;
|
|
53
|
+
font-size: 0.875rem;
|
|
54
|
+
color: #374151;
|
|
55
|
+
background: #fff;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
}
|
|
58
|
+
.er-holiday-badge {
|
|
59
|
+
font-size: 0.875rem;
|
|
60
|
+
font-weight: 600;
|
|
61
|
+
color: #059669;
|
|
62
|
+
background: #d1fae5;
|
|
63
|
+
padding: 4px 10px;
|
|
64
|
+
border-radius: 9999px;
|
|
65
|
+
margin-left: 8px;
|
|
66
|
+
}
|
|
67
|
+
.er-grid-wrapper {
|
|
68
|
+
overflow: auto;
|
|
69
|
+
max-height: 65vh;
|
|
70
|
+
width: 100%;
|
|
71
|
+
}
|
|
72
|
+
.er-grid {
|
|
73
|
+
display: grid;
|
|
74
|
+
grid-auto-rows: minmax(60px, auto);
|
|
75
|
+
}
|
|
76
|
+
.er-header-cell {
|
|
77
|
+
padding: 12px;
|
|
78
|
+
font-size: 0.875rem;
|
|
79
|
+
background: #f9fafb;
|
|
80
|
+
border-bottom: 1px solid #e5e7eb;
|
|
81
|
+
border-right: 1px solid #e5e7eb;
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
box-sizing: border-box;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.er-grid.er-sticky .er-corner {
|
|
88
|
+
position: sticky;
|
|
89
|
+
top: 0;
|
|
90
|
+
left: 0;
|
|
91
|
+
z-index: 3;
|
|
92
|
+
background: #f9fafb;
|
|
93
|
+
}
|
|
94
|
+
.er-grid.er-sticky .er-time-header {
|
|
95
|
+
position: sticky;
|
|
96
|
+
top: 0;
|
|
97
|
+
z-index: 2;
|
|
98
|
+
background: #f9fafb;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
color: #4b5563;
|
|
101
|
+
}
|
|
102
|
+
.er-grid.er-sticky .er-room-header {
|
|
103
|
+
position: sticky;
|
|
104
|
+
left: 0;
|
|
105
|
+
z-index: 2;
|
|
106
|
+
background: #f9fafb;
|
|
107
|
+
justify-content: flex-start;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.er-grid:not(.er-sticky) .er-corner,
|
|
111
|
+
.er-grid:not(.er-sticky) .er-time-header,
|
|
112
|
+
.er-grid:not(.er-sticky) .er-room-header {
|
|
113
|
+
position: static;
|
|
114
|
+
background: #f9fafb;
|
|
115
|
+
}
|
|
116
|
+
.er-grid:not(.er-sticky) .er-time-header {
|
|
117
|
+
justify-content: center;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.er-grid-cell {
|
|
121
|
+
border-bottom: 1px solid #e5e7eb;
|
|
122
|
+
border-right: 1px solid #e5e7eb;
|
|
123
|
+
padding: 4px;
|
|
124
|
+
transition: background-color 0.2s;
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
gap: 4px;
|
|
129
|
+
box-sizing: border-box;
|
|
130
|
+
}
|
|
131
|
+
.er-grid-cell:hover {
|
|
132
|
+
background-color: #f3f4f6;
|
|
133
|
+
}
|
|
134
|
+
.er-holiday-cell {
|
|
135
|
+
background-color: #fdfbf7;
|
|
136
|
+
}
|
|
137
|
+
.er-holiday-cell:hover {
|
|
138
|
+
background-color: #fef3c7;
|
|
139
|
+
}
|
|
140
|
+
.er-event {
|
|
141
|
+
padding: 4px 8px;
|
|
142
|
+
border-radius: 4px;
|
|
143
|
+
color: white;
|
|
144
|
+
font-size: 0.75rem;
|
|
145
|
+
font-weight: 500;
|
|
146
|
+
white-space: nowrap;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
text-overflow: ellipsis;
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
151
|
+
}
|
|
152
|
+
.er-event:hover {
|
|
153
|
+
transform: scale(1.02);
|
|
154
|
+
z-index: 10;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.er-rich-wrapper {
|
|
158
|
+
display: flex;
|
|
159
|
+
flex-direction: column;
|
|
160
|
+
width: 100%;
|
|
161
|
+
gap: 2px;
|
|
162
|
+
}
|
|
163
|
+
.er-rich-title {
|
|
164
|
+
font-weight: 600;
|
|
165
|
+
color: #111827;
|
|
166
|
+
}
|
|
167
|
+
.er-rich-subtitle {
|
|
168
|
+
font-size: 0.75rem;
|
|
169
|
+
color: #6b7280;
|
|
170
|
+
font-weight: 400;
|
|
171
|
+
}
|