classcard-ui 0.2.508 → 0.2.511
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/classcard-ui.common.js +94 -75
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +94 -75
- package/dist/classcard-ui.umd.js.map +1 -1
- package/dist/classcard-ui.umd.min.js +1 -1
- package/dist/classcard-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CCalendar/CCalendar.vue +30 -5
- package/src/components/CSelect/CSelect.vue +33 -39
package/package.json
CHANGED
|
@@ -90,9 +90,11 @@
|
|
|
90
90
|
}"
|
|
91
91
|
>{{ getDayFromDate(date) }}</time
|
|
92
92
|
>
|
|
93
|
-
<span v-if="
|
|
93
|
+
<span v-if="eventsCount" class="sr-only"
|
|
94
|
+
>{{ getEventsCountForDate(date) }} events</span
|
|
95
|
+
>
|
|
94
96
|
<span
|
|
95
|
-
v-if="
|
|
97
|
+
v-if="eventsCount"
|
|
96
98
|
class="-mx-0.5 mt-auto flex flex-wrap-reverse"
|
|
97
99
|
>
|
|
98
100
|
<span
|
|
@@ -103,9 +105,12 @@
|
|
|
103
105
|
</div>
|
|
104
106
|
</div>
|
|
105
107
|
</div>
|
|
106
|
-
<section class="mt-12">
|
|
108
|
+
<section v-if="eventData" class="mt-12">
|
|
107
109
|
<h2 class="font-semibold text-gray-900">
|
|
108
|
-
Schedule for
|
|
110
|
+
Schedule for
|
|
111
|
+
<time :datetime="selectedDateForDateTime">{{
|
|
112
|
+
formattedSelectedDate
|
|
113
|
+
}}</time>
|
|
109
114
|
</h2>
|
|
110
115
|
<ol class="mt-4 space-y-1 text-sm leading-6 text-gray-500">
|
|
111
116
|
<li
|
|
@@ -210,7 +215,11 @@ export default {
|
|
|
210
215
|
type: [String, Date],
|
|
211
216
|
default: () => null,
|
|
212
217
|
},
|
|
213
|
-
|
|
218
|
+
eventsCount: {
|
|
219
|
+
type: Array,
|
|
220
|
+
default: () => null,
|
|
221
|
+
},
|
|
222
|
+
eventsData: {
|
|
214
223
|
type: Array,
|
|
215
224
|
default: () => null,
|
|
216
225
|
},
|
|
@@ -245,6 +254,16 @@ export default {
|
|
|
245
254
|
formatForDateTime(date) {
|
|
246
255
|
return dayjs(date).format("YYYY-MM-DD");
|
|
247
256
|
},
|
|
257
|
+
getEventsCountForDate(date) {
|
|
258
|
+
let eventsCountObj = this.eventsCount.find((event) =>
|
|
259
|
+
dayjs(date).isSame(dayjs(event.date))
|
|
260
|
+
);
|
|
261
|
+
if (eventsCountObj) {
|
|
262
|
+
return eventsCountObj.eventsCount;
|
|
263
|
+
} else {
|
|
264
|
+
return 0;
|
|
265
|
+
}
|
|
266
|
+
},
|
|
248
267
|
},
|
|
249
268
|
computed: {
|
|
250
269
|
currentMonthAndYear() {
|
|
@@ -275,6 +294,12 @@ export default {
|
|
|
275
294
|
}
|
|
276
295
|
return dates;
|
|
277
296
|
},
|
|
297
|
+
formattedSelectedDate() {
|
|
298
|
+
return dayjs(this.value ?? dayjs()).format("MMMM D, YYYY");
|
|
299
|
+
},
|
|
300
|
+
selectedDateForDateTime() {
|
|
301
|
+
return dayjs(this.value ?? dayjs()).format("YYYY-MM-DD");
|
|
302
|
+
},
|
|
278
303
|
},
|
|
279
304
|
mounted() {
|
|
280
305
|
if (this.value) {
|
|
@@ -31,24 +31,20 @@
|
|
|
31
31
|
|
|
32
32
|
<div class="pointer-events-none absolute top-2 left-3 flex">
|
|
33
33
|
<span class="flex items-center" :style="selectedOptionStyles">
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
value
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
size="extraextrasmall"
|
|
49
|
-
:nameInitials="value.initials"
|
|
50
|
-
:rounded="true"
|
|
51
|
-
></c-avatar>
|
|
34
|
+
<div v-if="showImage && !selectSearch && value">
|
|
35
|
+
<c-avatar
|
|
36
|
+
v-if="value.photo"
|
|
37
|
+
size="extraextrasmall"
|
|
38
|
+
:image="value.photo"
|
|
39
|
+
:rounded="true"
|
|
40
|
+
></c-avatar>
|
|
41
|
+
<c-avatar
|
|
42
|
+
v-else
|
|
43
|
+
size="extraextrasmall"
|
|
44
|
+
:nameInitials="value.initials"
|
|
45
|
+
:rounded="true"
|
|
46
|
+
></c-avatar>
|
|
47
|
+
</div>
|
|
52
48
|
<c-icon
|
|
53
49
|
v-if="icon && !showImage"
|
|
54
50
|
:class="icon.class"
|
|
@@ -115,31 +111,29 @@
|
|
|
115
111
|
:class="option.isDisabled ? 'pointer-events-none opacity-50' : ''"
|
|
116
112
|
>
|
|
117
113
|
<span class="flex items-center">
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
114
|
+
<div v-if="option.showImage">
|
|
115
|
+
<c-avatar
|
|
116
|
+
v-if="option.photo"
|
|
117
|
+
size="extraextrasmall"
|
|
118
|
+
:image="option.photo"
|
|
119
|
+
:rounded="true"
|
|
120
|
+
></c-avatar>
|
|
121
|
+
<c-avatar
|
|
122
|
+
v-else
|
|
123
|
+
size="extraextrasmall"
|
|
124
|
+
:nameInitials="option.initials"
|
|
125
|
+
:rounded="true"
|
|
126
|
+
></c-avatar>
|
|
127
|
+
</div>
|
|
132
128
|
<c-icon
|
|
133
|
-
v-if="
|
|
134
|
-
:class="icon.class"
|
|
135
|
-
:name="icon.name"
|
|
136
|
-
:type="icon.type"
|
|
129
|
+
v-if="option.showIcon && option.icon"
|
|
130
|
+
:class="option.icon.class"
|
|
131
|
+
:name="option.icon.name"
|
|
132
|
+
:type="option.icon.type"
|
|
137
133
|
>
|
|
138
134
|
</c-icon>
|
|
139
135
|
<span
|
|
140
|
-
:class="
|
|
141
|
-
(showImage && option.photo) || option.initials ? 'ml-3' : ''
|
|
142
|
-
"
|
|
136
|
+
:class="option.photo || option.initials ? 'ml-3' : ''"
|
|
143
137
|
class="list-options block break-words font-normal"
|
|
144
138
|
>{{ option[renderOptionName] }}
|
|
145
139
|
</span>
|