@smart-solutions-tech/smart-angular-calendar 0.0.1 → 0.0.2
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/esm2020/lib/components/calendar/calendar.component.mjs +150 -0
- package/esm2020/lib/components/calendar-event/calendar-event.component.mjs +21 -0
- package/esm2020/lib/components/more-events-modal/more-events-modal.component.mjs +38 -0
- package/esm2020/lib/components/smart-calendar/smart-calendar.component.mjs +19 -0
- package/esm2020/lib/pipes/translate.pipe.mjs +20 -0
- package/esm2020/lib/services/translation.service.mjs +29 -0
- package/esm2020/lib/smart-angular-calendar.module.mjs +22 -7
- package/esm2020/lib/translations.mjs +26 -0
- package/esm2020/lib/types.mjs +2 -0
- package/esm2020/lib/utils/colors.mjs +13 -0
- package/esm2020/public-api.mjs +2 -2
- package/fesm2015/smart-solutions-tech-smart-angular-calendar.mjs +304 -21
- package/fesm2015/smart-solutions-tech-smart-angular-calendar.mjs.map +1 -1
- package/fesm2020/smart-solutions-tech-smart-angular-calendar.mjs +304 -21
- package/fesm2020/smart-solutions-tech-smart-angular-calendar.mjs.map +1 -1
- package/lib/components/calendar/calendar.component.d.ts +46 -0
- package/lib/components/calendar-event/calendar-event.component.d.ts +11 -0
- package/lib/components/more-events-modal/more-events-modal.component.d.ts +16 -0
- package/lib/components/smart-calendar/smart-calendar.component.d.ts +10 -0
- package/lib/pipes/translate.pipe.d.ts +13 -0
- package/lib/services/translation.service.d.ts +12 -0
- package/lib/smart-angular-calendar.module.d.ts +7 -2
- package/lib/translations.d.ts +3 -0
- package/lib/types.d.ts +29 -0
- package/lib/utils/colors.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
- package/esm2020/lib/smart-angular-calendar.component.mjs +0 -22
- package/lib/smart-angular-calendar.component.d.ts +0 -8
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Component, NgModule } from '@angular/core';
|
|
2
|
+
import { Injectable, Component, Input, Pipe, EventEmitter, Output, ViewChild, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
3
5
|
|
|
4
6
|
class SmartAngularCalendarService {
|
|
5
7
|
constructor() { }
|
|
@@ -13,40 +15,321 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
13
15
|
}]
|
|
14
16
|
}], ctorParameters: function () { return []; } });
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
const isDarkColor = (hexColor, threshold = 0.5) => {
|
|
19
|
+
const hex = hexColor.replace('#', '');
|
|
20
|
+
const r = parseInt(hex.substring(0, 2), 16);
|
|
21
|
+
const g = parseInt(hex.substring(2, 4), 16);
|
|
22
|
+
const b = parseInt(hex.substring(4, 6), 16);
|
|
23
|
+
const [rs, gs, bs] = [r, g, b].map((c) => {
|
|
24
|
+
const cs = c / 255;
|
|
25
|
+
return cs <= 0.03928 ? cs / 12.92 : Math.pow((cs + 0.055) / 1.055, 2.4);
|
|
26
|
+
});
|
|
27
|
+
const luminance = 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
|
|
28
|
+
return luminance < threshold;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
class CalendarEventComponent {
|
|
32
|
+
constructor() {
|
|
33
|
+
this.isDarkColor = false;
|
|
34
|
+
}
|
|
18
35
|
ngOnInit() {
|
|
36
|
+
this.isDarkColor = isDarkColor(this.event.color || '#000000');
|
|
19
37
|
}
|
|
20
38
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
smart-angular-calendar works!
|
|
25
|
-
</p>
|
|
26
|
-
`, isInline: true });
|
|
27
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SmartAngularCalendarComponent, decorators: [{
|
|
39
|
+
CalendarEventComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CalendarEventComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
40
|
+
CalendarEventComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CalendarEventComponent, selector: "lib-calendar-event", inputs: { event: "event" }, ngImport: i0, template: "<div class=\"calendar-event-component\" style=\"--color: {{ event.color }};\" [ngClass]=\"{'dark-color': isDarkColor}\"\r\n [title]=\"event.title\">\r\n <div class=\"event-title\">{{ event.title }}</div>\r\n</div>", styles: [".calendar-event-component{position:relative;z-index:1;background-color:var(--color, rgba(0, 0, 0, .05));border-radius:4px;padding:2px 8px;cursor:pointer;-webkit-user-select:none;user-select:none;color:#212121}.calendar-event-component.dark-color{color:#fafafa}.event-title{font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CalendarEventComponent, decorators: [{
|
|
28
42
|
type: Component,
|
|
29
|
-
args: [{ selector: 'lib-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
args: [{ selector: 'lib-calendar-event', template: "<div class=\"calendar-event-component\" style=\"--color: {{ event.color }};\" [ngClass]=\"{'dark-color': isDarkColor}\"\r\n [title]=\"event.title\">\r\n <div class=\"event-title\">{{ event.title }}</div>\r\n</div>", styles: [".calendar-event-component{position:relative;z-index:1;background-color:var(--color, rgba(0, 0, 0, .05));border-radius:4px;padding:2px 8px;cursor:pointer;-webkit-user-select:none;user-select:none;color:#212121}.calendar-event-component.dark-color{color:#fafafa}.event-title{font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"] }]
|
|
44
|
+
}], ctorParameters: function () { return []; }, propDecorators: { event: [{
|
|
45
|
+
type: Input
|
|
46
|
+
}] } });
|
|
47
|
+
|
|
48
|
+
const TRANSLATIONS = {
|
|
49
|
+
en: {
|
|
50
|
+
sun: 'Sunday',
|
|
51
|
+
mon: 'Monday',
|
|
52
|
+
tue: 'Tuesday',
|
|
53
|
+
wed: 'Wednesday',
|
|
54
|
+
thu: 'Thursday',
|
|
55
|
+
fri: 'Friday',
|
|
56
|
+
sat: 'Saturday',
|
|
57
|
+
moreEvents: 'More events',
|
|
58
|
+
nMoreEvents: '{{n}} More events'
|
|
59
|
+
},
|
|
60
|
+
es: {
|
|
61
|
+
sun: 'Domingo',
|
|
62
|
+
mon: 'Lunes',
|
|
63
|
+
tue: 'Martes',
|
|
64
|
+
wed: 'Miércoles',
|
|
65
|
+
thu: 'Jueves',
|
|
66
|
+
fri: 'Viernes',
|
|
67
|
+
sat: 'Sábado',
|
|
68
|
+
moreEvents: 'Más eventos',
|
|
69
|
+
nMoreEvents: '{{n}} Eventos más'
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
class TranslationService {
|
|
74
|
+
constructor() {
|
|
75
|
+
this.currentLanguage = 'en';
|
|
76
|
+
}
|
|
77
|
+
translate(tag, args) {
|
|
78
|
+
if (tag === 'nMoreEvents' && args) {
|
|
79
|
+
const n = args['n'];
|
|
80
|
+
return TRANSLATIONS[this.currentLanguage][tag].replace('{{n}}', n);
|
|
81
|
+
}
|
|
82
|
+
return TRANSLATIONS[this.currentLanguage][tag];
|
|
83
|
+
}
|
|
84
|
+
setLanguage(lang) {
|
|
85
|
+
if (TRANSLATIONS[lang]) {
|
|
86
|
+
this.currentLanguage = lang;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
TranslationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TranslationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
91
|
+
TranslationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TranslationService, providedIn: 'root' });
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TranslationService, decorators: [{
|
|
93
|
+
type: Injectable,
|
|
94
|
+
args: [{
|
|
95
|
+
providedIn: 'root'
|
|
96
|
+
}]
|
|
34
97
|
}], ctorParameters: function () { return []; } });
|
|
35
98
|
|
|
99
|
+
class TranslatePipe {
|
|
100
|
+
constructor(translationService) {
|
|
101
|
+
this.translationService = translationService;
|
|
102
|
+
}
|
|
103
|
+
transform(tag, args) {
|
|
104
|
+
return this.translationService.translate(tag, args);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
TranslatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TranslatePipe, deps: [{ token: TranslationService }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
108
|
+
TranslatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TranslatePipe, name: "translate" });
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TranslatePipe, decorators: [{
|
|
110
|
+
type: Pipe,
|
|
111
|
+
args: [{
|
|
112
|
+
name: 'translate'
|
|
113
|
+
}]
|
|
114
|
+
}], ctorParameters: function () { return [{ type: TranslationService }]; } });
|
|
115
|
+
|
|
116
|
+
class MoreEventsModalComponent {
|
|
117
|
+
constructor() {
|
|
118
|
+
this.events = [];
|
|
119
|
+
this.close = new EventEmitter();
|
|
120
|
+
this.eventClick = new EventEmitter();
|
|
121
|
+
}
|
|
122
|
+
ngOnInit() {
|
|
123
|
+
}
|
|
124
|
+
isDarkColor(color) {
|
|
125
|
+
return isDarkColor(color || '#ffffff');
|
|
126
|
+
}
|
|
127
|
+
onClose() {
|
|
128
|
+
this.close.emit();
|
|
129
|
+
}
|
|
130
|
+
onEventClick(event) {
|
|
131
|
+
this.eventClick.emit(event);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
MoreEventsModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MoreEventsModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
135
|
+
MoreEventsModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MoreEventsModalComponent, selector: "lib-more-events-modal", inputs: { events: "events", date: "date" }, outputs: { close: "close", eventClick: "eventClick" }, ngImport: i0, template: "<div class=\"more-events-modal-component\">\n <div class=\"backdrop\" (click)=\"onClose()\"></div>\n\n <div class=\"modal\">\n <div class=\"header\">\n <div class=\"title\">{{'moreEvents' | translate}}</div>\n <div class=\"subtitle\">{{date.toLocaleDateString()}}</div>\n\n <button class=\"btn-close\" (click)=\"onClose()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\n class=\"feather feather-x\" fill=\"yellow\">\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n\n <div class=\"events-list\">\n <div class=\"event-item\" *ngFor=\"let event of events\" style=\"--color: {{event.color}};\"\n [ngClass]=\"{'is-dark':isDarkColor(event.color)}\" (click)=\"onEventClick(event)\">\n <div class=\"event-title\">{{ event.title }}</div>\n </div>\n </div>\n </div>\n</div>", styles: [".more-events-modal-component{position:absolute;top:0;left:0;z-index:1;display:flex;align-items:center;justify-content:center;width:100vw;height:100vh;box-shadow:0 2px 8px #00000026}.more-events-modal-component .backdrop{position:absolute;top:0;left:0;z-index:1;width:100%;height:100%;background-color:#00000080;cursor:pointer}.modal{z-index:2;display:flex;flex-direction:column;max-width:400px;width:100%;max-height:80vh;margin:24px;background-color:#fff;border-radius:8px}.header{position:relative;display:flex;flex-direction:column;padding:16px 64px 16px 16px}.title{font-size:18px;font-weight:700}.subtitle{font-size:13px;color:#666}.btn-close{position:absolute;top:8px;right:8px;display:flex;align-items:center;justify-content:center;width:36px;height:36px;background:none;border:none;border-radius:50%;cursor:pointer}.btn-close:hover{background-color:#f0f0f0}.events-list{flex:1 1 auto;display:flex;flex-direction:column;gap:4px;padding:0 16px 16px;overflow-y:auto}.events-list .event-item{display:flex;padding:8px;background-color:var(--color, #e2e2e2);border-radius:4px;color:#212121;cursor:pointer;-webkit-user-select:none;user-select:none}.events-list .event-item.is-dark{color:#fafafa}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
136
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MoreEventsModalComponent, decorators: [{
|
|
137
|
+
type: Component,
|
|
138
|
+
args: [{ selector: 'lib-more-events-modal', template: "<div class=\"more-events-modal-component\">\n <div class=\"backdrop\" (click)=\"onClose()\"></div>\n\n <div class=\"modal\">\n <div class=\"header\">\n <div class=\"title\">{{'moreEvents' | translate}}</div>\n <div class=\"subtitle\">{{date.toLocaleDateString()}}</div>\n\n <button class=\"btn-close\" (click)=\"onClose()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\n class=\"feather feather-x\" fill=\"yellow\">\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n\n <div class=\"events-list\">\n <div class=\"event-item\" *ngFor=\"let event of events\" style=\"--color: {{event.color}};\"\n [ngClass]=\"{'is-dark':isDarkColor(event.color)}\" (click)=\"onEventClick(event)\">\n <div class=\"event-title\">{{ event.title }}</div>\n </div>\n </div>\n </div>\n</div>", styles: [".more-events-modal-component{position:absolute;top:0;left:0;z-index:1;display:flex;align-items:center;justify-content:center;width:100vw;height:100vh;box-shadow:0 2px 8px #00000026}.more-events-modal-component .backdrop{position:absolute;top:0;left:0;z-index:1;width:100%;height:100%;background-color:#00000080;cursor:pointer}.modal{z-index:2;display:flex;flex-direction:column;max-width:400px;width:100%;max-height:80vh;margin:24px;background-color:#fff;border-radius:8px}.header{position:relative;display:flex;flex-direction:column;padding:16px 64px 16px 16px}.title{font-size:18px;font-weight:700}.subtitle{font-size:13px;color:#666}.btn-close{position:absolute;top:8px;right:8px;display:flex;align-items:center;justify-content:center;width:36px;height:36px;background:none;border:none;border-radius:50%;cursor:pointer}.btn-close:hover{background-color:#f0f0f0}.events-list{flex:1 1 auto;display:flex;flex-direction:column;gap:4px;padding:0 16px 16px;overflow-y:auto}.events-list .event-item{display:flex;padding:8px;background-color:var(--color, #e2e2e2);border-radius:4px;color:#212121;cursor:pointer;-webkit-user-select:none;user-select:none}.events-list .event-item.is-dark{color:#fafafa}\n"] }]
|
|
139
|
+
}], ctorParameters: function () { return []; }, propDecorators: { events: [{
|
|
140
|
+
type: Input
|
|
141
|
+
}], date: [{
|
|
142
|
+
type: Input
|
|
143
|
+
}], close: [{
|
|
144
|
+
type: Output
|
|
145
|
+
}], eventClick: [{
|
|
146
|
+
type: Output
|
|
147
|
+
}] } });
|
|
148
|
+
|
|
149
|
+
class CalendarComponent {
|
|
150
|
+
constructor() {
|
|
151
|
+
this.currentMonth = {
|
|
152
|
+
year: new Date().getFullYear(),
|
|
153
|
+
month: new Date().getMonth() + 1
|
|
154
|
+
};
|
|
155
|
+
this.events = [];
|
|
156
|
+
this.startAt = 'sunday';
|
|
157
|
+
this.monthChange = new EventEmitter();
|
|
158
|
+
this.dayCells = [];
|
|
159
|
+
this.weekDays = [
|
|
160
|
+
{ tag: 'sun' },
|
|
161
|
+
{ tag: 'mon' },
|
|
162
|
+
{ tag: 'tue' },
|
|
163
|
+
{ tag: 'wed' },
|
|
164
|
+
{ tag: 'thu' },
|
|
165
|
+
{ tag: 'fri' },
|
|
166
|
+
{ tag: 'sat' },
|
|
167
|
+
];
|
|
168
|
+
this.showMoreEventsModal = false;
|
|
169
|
+
this.moreEventsModalEvents = [];
|
|
170
|
+
this.resizeListener = () => {
|
|
171
|
+
this.setCalendarBodyHeight();
|
|
172
|
+
this.setMaxEventsInDayCell();
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
isToday(date) {
|
|
176
|
+
const today = new Date();
|
|
177
|
+
return date.getDate() === today.getDate() &&
|
|
178
|
+
date.getMonth() === today.getMonth() &&
|
|
179
|
+
date.getFullYear() === today.getFullYear();
|
|
180
|
+
}
|
|
181
|
+
getEventsForDay(date) {
|
|
182
|
+
return this.events.filter(event => {
|
|
183
|
+
const eventStart = new Date(event.start);
|
|
184
|
+
const eventEnd = event.end ? new Date(event.end) : eventStart;
|
|
185
|
+
return date >= new Date(eventStart.getFullYear(), eventStart.getMonth(), eventStart.getDate()) &&
|
|
186
|
+
date <= new Date(eventEnd.getFullYear(), eventEnd.getMonth(), eventEnd.getDate());
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
initDaysCells() {
|
|
190
|
+
const daysInMonth = new Date(this.currentMonth.year, this.currentMonth.month, 0).getDate();
|
|
191
|
+
const firstDayOfWeek = new Date(this.currentMonth.year, this.currentMonth.month - 1, 1).getDay();
|
|
192
|
+
const prevDaysCount = this.startAt === 'monday' ? (firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1) : firstDayOfWeek;
|
|
193
|
+
// const nextDaysCount = (7 - ((prevDaysCount + daysInMonth) % 7)) % 7;
|
|
194
|
+
const nextDaysCount = 42 - (prevDaysCount + daysInMonth); // Always show 6 weeks
|
|
195
|
+
this.dayCells = [];
|
|
196
|
+
for (let i = 0; i < prevDaysCount; i++) {
|
|
197
|
+
const date = new Date(this.currentMonth.year, this.currentMonth.month - 1, i - prevDaysCount + 1);
|
|
198
|
+
const _events = this.getEventsForDay(date);
|
|
199
|
+
this.dayCells.push({
|
|
200
|
+
date,
|
|
201
|
+
events: _events,
|
|
202
|
+
isOutsideMonth: true,
|
|
203
|
+
isToday: this.isToday(date)
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
for (let day = 1; day <= daysInMonth; day++) {
|
|
207
|
+
const date = new Date(this.currentMonth.year, this.currentMonth.month - 1, day);
|
|
208
|
+
const _events = this.getEventsForDay(date);
|
|
209
|
+
this.dayCells.push({
|
|
210
|
+
date,
|
|
211
|
+
events: _events,
|
|
212
|
+
isToday: this.isToday(date)
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
for (let i = 1; i <= nextDaysCount; i++) {
|
|
216
|
+
const date = new Date(this.currentMonth.year, this.currentMonth.month - 1, daysInMonth + i);
|
|
217
|
+
const _events = this.getEventsForDay(date);
|
|
218
|
+
this.dayCells.push({
|
|
219
|
+
date,
|
|
220
|
+
events: _events,
|
|
221
|
+
isOutsideMonth: true,
|
|
222
|
+
isToday: this.isToday(date)
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
setCalendarBodyHeight() {
|
|
227
|
+
this.calendarBodyHeight = this.calendarBodyRef.nativeElement.clientHeight;
|
|
228
|
+
}
|
|
229
|
+
setMaxEventsInDayCell() {
|
|
230
|
+
const element = document.getElementsByClassName('events-list')[0];
|
|
231
|
+
console.log(element);
|
|
232
|
+
if (element) {
|
|
233
|
+
const eventItemHeight = 22;
|
|
234
|
+
this.maxEventsInDayCell = Math.floor(element.clientHeight / eventItemHeight) - 1;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
openMoreEventsModal(date, events) {
|
|
238
|
+
this.moreEventsModalDate = date;
|
|
239
|
+
this.moreEventsModalEvents = events;
|
|
240
|
+
this.showMoreEventsModal = true;
|
|
241
|
+
}
|
|
242
|
+
closeMoreEventsModal() {
|
|
243
|
+
this.showMoreEventsModal = false;
|
|
244
|
+
this.moreEventsModalDate = undefined;
|
|
245
|
+
this.moreEventsModalEvents = [];
|
|
246
|
+
}
|
|
247
|
+
ngOnInit() {
|
|
248
|
+
if (this.startAt === 'monday') {
|
|
249
|
+
this.weekDays = [
|
|
250
|
+
{ tag: 'mon' },
|
|
251
|
+
{ tag: 'tue' },
|
|
252
|
+
{ tag: 'wed' },
|
|
253
|
+
{ tag: 'thu' },
|
|
254
|
+
{ tag: 'fri' },
|
|
255
|
+
{ tag: 'sat' },
|
|
256
|
+
{ tag: 'sun' },
|
|
257
|
+
];
|
|
258
|
+
}
|
|
259
|
+
this.initDaysCells();
|
|
260
|
+
}
|
|
261
|
+
ngAfterViewInit() {
|
|
262
|
+
window.addEventListener('resize', this.resizeListener);
|
|
263
|
+
setTimeout(() => {
|
|
264
|
+
this.setCalendarBodyHeight();
|
|
265
|
+
this.setMaxEventsInDayCell();
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
onDestroy() {
|
|
269
|
+
window.removeEventListener('resize', this.resizeListener);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
CalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
273
|
+
CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CalendarComponent, selector: "lib-calendar", inputs: { currentMonth: "currentMonth", events: "events", startAt: "startAt" }, outputs: { monthChange: "monthChange" }, viewQueries: [{ propertyName: "calendarRef", first: true, predicate: ["calendar"], descendants: true }, { propertyName: "calendarBodyRef", first: true, predicate: ["calendarBody"], descendants: true }], ngImport: i0, template: "<div class=\"calendar-component\">\r\n <div class=\"header\">\r\n Header {{ maxEventsInDayCell }}\r\n </div>\r\n\r\n <div class=\"body\" #calendarBody>\r\n <div class=\"week-days\">\r\n <div class=\"week-day\" *ngFor=\"let day of weekDays\">\r\n {{ day.tag | translate | slice:0:3 }}\r\n </div>\r\n </div>\r\n\r\n <div class=\"days-grid\">\r\n <div class=\"day-cell\" *ngFor=\"let day of dayCells; let i = index\"\r\n [ngClass]=\"{'outside-month': day.isOutsideMonth, 'is-today': day.isToday}\">\r\n <div class=\"day-number\">\r\n {{ day.date.getDate() }}\r\n </div>\r\n\r\n <div class=\"events-list\">\r\n <lib-calendar-event *ngFor=\"let event of day.events | slice:0:maxEventsInDayCell\"\r\n [event]=\"event\"></lib-calendar-event>\r\n\r\n <div class=\"more-events\" *ngIf=\"day.events.length > (maxEventsInDayCell || 0)\"\r\n (click)=\"openMoreEventsModal(day.date, day.events)\">\r\n {{'nMoreEvents' | translate: {n:(day.events.length - (maxEventsInDayCell || 0))} }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"footer\">\r\n Footer\r\n </div>\r\n\r\n <lib-more-events-modal *ngIf=\"showMoreEventsModal && moreEventsModalDate\" [events]=\"moreEventsModalEvents\"\r\n [date]=\"moreEventsModalDate\" (close)=\"closeMoreEventsModal()\"\r\n (eventClick)=\"closeMoreEventsModal()\"></lib-more-events-modal>\r\n</div>", styles: ["*{box-sizing:border-box;margin:0;padding:0}.calendar-component{display:flex;flex-direction:column;width:100%;height:100%}.header{flex-shrink:0;background-color:#add8e6}.body{flex:1 1 0;display:flex;flex-direction:column;width:100%;min-height:0;height:100%}.week-days{flex-shrink:0;display:grid;grid-template-columns:repeat(7,1fr);width:100%;background-color:#f4f4f4}.week-day{display:flex;align-items:center;justify-content:center;padding:4px;background-color:#fff;font-size:14px;color:#00000080}.days-grid{flex:1 1 0;display:grid;grid-template-columns:repeat(7,1fr);gap:1px;grid-auto-rows:1fr;width:100%;padding:1px;background-color:#f4f4f4;min-height:0;height:100%}.day-cell{display:flex;flex-direction:column;gap:4px;padding:4px;background-color:#fff;overflow:hidden}.day-cell .day-number{display:flex;align-items:center;justify-content:center;width:fit-content;aspect-ratio:1;padding:2px;border-radius:50%;font-size:12px;line-height:16px;font-weight:600;-webkit-user-select:none;user-select:none}.day-cell.outside-month{background-color:#f8f8f8}.day-cell.is-today .day-number{background-color:#007bff;color:#fff}.day-cell .events-list{flex:1 1 auto;display:flex;flex-direction:column;gap:2px;overflow:hidden;min-height:0;max-height:100%}.day-cell .events-list .more-events{padding:2px 8px;border-radius:4px;font-size:12px;color:#555;cursor:pointer}.day-cell .events-list .more-events:hover{background-color:#eee}.footer{flex-shrink:0;background-color:#add8e6}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CalendarEventComponent, selector: "lib-calendar-event", inputs: ["event"] }, { kind: "component", type: MoreEventsModalComponent, selector: "lib-more-events-modal", inputs: ["events", "date"], outputs: ["close", "eventClick"] }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
274
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CalendarComponent, decorators: [{
|
|
275
|
+
type: Component,
|
|
276
|
+
args: [{ selector: 'lib-calendar', template: "<div class=\"calendar-component\">\r\n <div class=\"header\">\r\n Header {{ maxEventsInDayCell }}\r\n </div>\r\n\r\n <div class=\"body\" #calendarBody>\r\n <div class=\"week-days\">\r\n <div class=\"week-day\" *ngFor=\"let day of weekDays\">\r\n {{ day.tag | translate | slice:0:3 }}\r\n </div>\r\n </div>\r\n\r\n <div class=\"days-grid\">\r\n <div class=\"day-cell\" *ngFor=\"let day of dayCells; let i = index\"\r\n [ngClass]=\"{'outside-month': day.isOutsideMonth, 'is-today': day.isToday}\">\r\n <div class=\"day-number\">\r\n {{ day.date.getDate() }}\r\n </div>\r\n\r\n <div class=\"events-list\">\r\n <lib-calendar-event *ngFor=\"let event of day.events | slice:0:maxEventsInDayCell\"\r\n [event]=\"event\"></lib-calendar-event>\r\n\r\n <div class=\"more-events\" *ngIf=\"day.events.length > (maxEventsInDayCell || 0)\"\r\n (click)=\"openMoreEventsModal(day.date, day.events)\">\r\n {{'nMoreEvents' | translate: {n:(day.events.length - (maxEventsInDayCell || 0))} }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"footer\">\r\n Footer\r\n </div>\r\n\r\n <lib-more-events-modal *ngIf=\"showMoreEventsModal && moreEventsModalDate\" [events]=\"moreEventsModalEvents\"\r\n [date]=\"moreEventsModalDate\" (close)=\"closeMoreEventsModal()\"\r\n (eventClick)=\"closeMoreEventsModal()\"></lib-more-events-modal>\r\n</div>", styles: ["*{box-sizing:border-box;margin:0;padding:0}.calendar-component{display:flex;flex-direction:column;width:100%;height:100%}.header{flex-shrink:0;background-color:#add8e6}.body{flex:1 1 0;display:flex;flex-direction:column;width:100%;min-height:0;height:100%}.week-days{flex-shrink:0;display:grid;grid-template-columns:repeat(7,1fr);width:100%;background-color:#f4f4f4}.week-day{display:flex;align-items:center;justify-content:center;padding:4px;background-color:#fff;font-size:14px;color:#00000080}.days-grid{flex:1 1 0;display:grid;grid-template-columns:repeat(7,1fr);gap:1px;grid-auto-rows:1fr;width:100%;padding:1px;background-color:#f4f4f4;min-height:0;height:100%}.day-cell{display:flex;flex-direction:column;gap:4px;padding:4px;background-color:#fff;overflow:hidden}.day-cell .day-number{display:flex;align-items:center;justify-content:center;width:fit-content;aspect-ratio:1;padding:2px;border-radius:50%;font-size:12px;line-height:16px;font-weight:600;-webkit-user-select:none;user-select:none}.day-cell.outside-month{background-color:#f8f8f8}.day-cell.is-today .day-number{background-color:#007bff;color:#fff}.day-cell .events-list{flex:1 1 auto;display:flex;flex-direction:column;gap:2px;overflow:hidden;min-height:0;max-height:100%}.day-cell .events-list .more-events{padding:2px 8px;border-radius:4px;font-size:12px;color:#555;cursor:pointer}.day-cell .events-list .more-events:hover{background-color:#eee}.footer{flex-shrink:0;background-color:#add8e6}\n"] }]
|
|
277
|
+
}], ctorParameters: function () { return []; }, propDecorators: { currentMonth: [{
|
|
278
|
+
type: Input
|
|
279
|
+
}], events: [{
|
|
280
|
+
type: Input
|
|
281
|
+
}], startAt: [{
|
|
282
|
+
type: Input
|
|
283
|
+
}], monthChange: [{
|
|
284
|
+
type: Output
|
|
285
|
+
}], calendarRef: [{
|
|
286
|
+
type: ViewChild,
|
|
287
|
+
args: ['calendar']
|
|
288
|
+
}], calendarBodyRef: [{
|
|
289
|
+
type: ViewChild,
|
|
290
|
+
args: ['calendarBody']
|
|
291
|
+
}] } });
|
|
292
|
+
|
|
293
|
+
class SmartCalendarComponent {
|
|
294
|
+
constructor() {
|
|
295
|
+
this.events = [];
|
|
296
|
+
}
|
|
297
|
+
ngOnInit() {
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
SmartCalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SmartCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
301
|
+
SmartCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: SmartCalendarComponent, selector: "smart-calendar", inputs: { events: "events" }, ngImport: i0, template: "<div class=\"smart-calendar-component\">\n <lib-calendar [events]=\"events\"></lib-calendar>\n</div>", styles: [".smart-calendar-component{width:100%;height:100%;background-color:#fff;border:1px solid #dddddd}\n"], dependencies: [{ kind: "component", type: CalendarComponent, selector: "lib-calendar", inputs: ["currentMonth", "events", "startAt"], outputs: ["monthChange"] }] });
|
|
302
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SmartCalendarComponent, decorators: [{
|
|
303
|
+
type: Component,
|
|
304
|
+
args: [{ selector: 'smart-calendar', template: "<div class=\"smart-calendar-component\">\n <lib-calendar [events]=\"events\"></lib-calendar>\n</div>", styles: [".smart-calendar-component{width:100%;height:100%;background-color:#fff;border:1px solid #dddddd}\n"] }]
|
|
305
|
+
}], ctorParameters: function () { return []; }, propDecorators: { events: [{
|
|
306
|
+
type: Input
|
|
307
|
+
}] } });
|
|
308
|
+
|
|
36
309
|
class SmartAngularCalendarModule {
|
|
37
310
|
}
|
|
38
311
|
SmartAngularCalendarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SmartAngularCalendarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
39
|
-
SmartAngularCalendarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SmartAngularCalendarModule, declarations: [
|
|
40
|
-
|
|
312
|
+
SmartAngularCalendarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SmartAngularCalendarModule, declarations: [SmartCalendarComponent,
|
|
313
|
+
CalendarComponent,
|
|
314
|
+
TranslatePipe,
|
|
315
|
+
CalendarEventComponent,
|
|
316
|
+
MoreEventsModalComponent], imports: [CommonModule], exports: [SmartCalendarComponent] });
|
|
317
|
+
SmartAngularCalendarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SmartAngularCalendarModule, imports: [CommonModule] });
|
|
41
318
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SmartAngularCalendarModule, decorators: [{
|
|
42
319
|
type: NgModule,
|
|
43
320
|
args: [{
|
|
44
321
|
declarations: [
|
|
45
|
-
|
|
322
|
+
SmartCalendarComponent,
|
|
323
|
+
CalendarComponent,
|
|
324
|
+
TranslatePipe,
|
|
325
|
+
CalendarEventComponent,
|
|
326
|
+
MoreEventsModalComponent
|
|
327
|
+
],
|
|
328
|
+
imports: [
|
|
329
|
+
CommonModule
|
|
46
330
|
],
|
|
47
|
-
imports: [],
|
|
48
331
|
exports: [
|
|
49
|
-
|
|
332
|
+
SmartCalendarComponent
|
|
50
333
|
]
|
|
51
334
|
}]
|
|
52
335
|
}] });
|
|
@@ -59,5 +342,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
59
342
|
* Generated bundle index. Do not edit.
|
|
60
343
|
*/
|
|
61
344
|
|
|
62
|
-
export {
|
|
345
|
+
export { SmartAngularCalendarModule, SmartAngularCalendarService, SmartCalendarComponent };
|
|
63
346
|
//# sourceMappingURL=smart-solutions-tech-smart-angular-calendar.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smart-solutions-tech-smart-angular-calendar.mjs","sources":["../../../projects/smart-angular-calendar/src/lib/smart-angular-calendar.service.ts","../../../projects/smart-angular-calendar/src/lib/smart-angular-calendar.component.ts","../../../projects/smart-angular-calendar/src/lib/smart-angular-calendar.module.ts","../../../projects/smart-angular-calendar/src/public-api.ts","../../../projects/smart-angular-calendar/src/smart-solutions-tech-smart-angular-calendar.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SmartAngularCalendarService {\r\n\r\n constructor() { }\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'lib-smart-angular-calendar',\r\n template: `\r\n <p>\r\n smart-angular-calendar works!\r\n </p>\r\n `,\r\n styles: [\r\n ]\r\n})\r\nexport class SmartAngularCalendarComponent implements OnInit {\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { SmartAngularCalendarComponent } from './smart-angular-calendar.component';\r\n\r\n\r\n\r\n@NgModule({\r\n declarations: [\r\n SmartAngularCalendarComponent\r\n ],\r\n imports: [\r\n ],\r\n exports: [\r\n SmartAngularCalendarComponent\r\n ]\r\n})\r\nexport class SmartAngularCalendarModule { }\r\n","/*\r\n * Public API Surface of smart-angular-calendar\r\n */\r\n\r\nexport * from './lib/smart-angular-calendar.service';\r\nexport * from './lib/smart-angular-calendar.component';\r\nexport * from './lib/smart-angular-calendar.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAKa,2BAA2B,CAAA;AAEtC,IAAA,WAAA,GAAA,GAAiB;;wHAFN,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA3B,2BAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,cAF1B,MAAM,EAAA,CAAA,CAAA;2FAEP,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAHvC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;MCQY,6BAA6B,CAAA;AAExC,IAAA,WAAA,GAAA,GAAiB;IAEjB,QAAQ,GAAA;KACP;;0HALU,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA7B,6BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,6BAA6B,EAR9B,QAAA,EAAA,4BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA;;;;AAIT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA;2FAIU,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAVzC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,4BAA4B,EAC5B,QAAA,EAAA,CAAA;;;;AAIT,EAAA,CAAA,EAAA,CAAA;;;MCOU,0BAA0B,CAAA;;uHAA1B,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;wHAA1B,0BAA0B,EAAA,YAAA,EAAA,CARnC,6BAA6B,CAAA,EAAA,OAAA,EAAA,CAK7B,6BAA6B,CAAA,EAAA,CAAA,CAAA;wHAGpB,0BAA0B,EAAA,CAAA,CAAA;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAVtC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,6BAA6B;AAC9B,qBAAA;AACD,oBAAA,OAAO,EAAE,EACR;AACD,oBAAA,OAAO,EAAE;wBACP,6BAA6B;AAC9B,qBAAA;AACF,iBAAA,CAAA;;;ACdD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"smart-solutions-tech-smart-angular-calendar.mjs","sources":["../../../projects/smart-angular-calendar/src/lib/smart-angular-calendar.service.ts","../../../projects/smart-angular-calendar/src/lib/utils/colors.ts","../../../projects/smart-angular-calendar/src/lib/components/calendar-event/calendar-event.component.ts","../../../projects/smart-angular-calendar/src/lib/components/calendar-event/calendar-event.component.html","../../../projects/smart-angular-calendar/src/lib/translations.ts","../../../projects/smart-angular-calendar/src/lib/services/translation.service.ts","../../../projects/smart-angular-calendar/src/lib/pipes/translate.pipe.ts","../../../projects/smart-angular-calendar/src/lib/components/more-events-modal/more-events-modal.component.ts","../../../projects/smart-angular-calendar/src/lib/components/more-events-modal/more-events-modal.component.html","../../../projects/smart-angular-calendar/src/lib/components/calendar/calendar.component.ts","../../../projects/smart-angular-calendar/src/lib/components/calendar/calendar.component.html","../../../projects/smart-angular-calendar/src/lib/components/smart-calendar/smart-calendar.component.ts","../../../projects/smart-angular-calendar/src/lib/components/smart-calendar/smart-calendar.component.html","../../../projects/smart-angular-calendar/src/lib/smart-angular-calendar.module.ts","../../../projects/smart-angular-calendar/src/public-api.ts","../../../projects/smart-angular-calendar/src/smart-solutions-tech-smart-angular-calendar.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SmartAngularCalendarService {\r\n\r\n constructor() { }\r\n}\r\n","export const isDarkColor = (hexColor: string, threshold: number = 0.5): boolean => {\r\n const hex = hexColor.replace('#', '');\r\n\r\n const r = parseInt(hex.substring(0, 2), 16);\r\n const g = parseInt(hex.substring(2, 4), 16);\r\n const b = parseInt(hex.substring(4, 6), 16);\r\n\r\n const [rs, gs, bs] = [r, g, b].map((c) => {\r\n const cs = c / 255;\r\n return cs <= 0.03928 ? cs / 12.92 : Math.pow((cs + 0.055) / 1.055, 2.4);\r\n });\r\n const luminance = 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;\r\n\r\n return luminance < threshold;\r\n}","import { Component, Input, OnInit } from '@angular/core';\r\nimport { CalendarEvent } from '../../types';\r\nimport { isDarkColor } from '../../utils/colors';\r\n\r\n@Component({\r\n selector: 'lib-calendar-event',\r\n templateUrl: './calendar-event.component.html',\r\n styleUrls: ['./calendar-event.component.scss']\r\n})\r\nexport class CalendarEventComponent implements OnInit {\r\n\r\n @Input() event!: CalendarEvent;\r\n\r\n isDarkColor: boolean = false;\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n this.isDarkColor = isDarkColor(this.event.color || '#000000');\r\n }\r\n\r\n}\r\n","<div class=\"calendar-event-component\" style=\"--color: {{ event.color }};\" [ngClass]=\"{'dark-color': isDarkColor}\"\r\n [title]=\"event.title\">\r\n <div class=\"event-title\">{{ event.title }}</div>\r\n</div>","import { Translation } from \"./types\";\r\n\r\nconst TRANSLATIONS: Record<string, Translation> = {\r\n en: {\r\n sun: 'Sunday',\r\n mon: 'Monday',\r\n tue: 'Tuesday',\r\n wed: 'Wednesday',\r\n thu: 'Thursday',\r\n fri: 'Friday',\r\n sat: 'Saturday',\r\n moreEvents: 'More events',\r\n nMoreEvents: '{{n}} More events'\r\n },\r\n es: {\r\n sun: 'Domingo',\r\n mon: 'Lunes',\r\n tue: 'Martes',\r\n wed: 'Miércoles',\r\n thu: 'Jueves',\r\n fri: 'Viernes',\r\n sat: 'Sábado',\r\n moreEvents: 'Más eventos',\r\n nMoreEvents: '{{n}} Eventos más'\r\n },\r\n}\r\n\r\nexport default TRANSLATIONS;","import { Injectable } from '@angular/core';\nimport TRANSLATIONS from '../translations';\nimport { Translation } from '../types';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class TranslationService {\n private currentLanguage = 'en';\n\n constructor() { }\n\n translate(tag: keyof Translation, args?: { [key: string]: any }): string {\n if (tag === 'nMoreEvents' && args) {\n const n = args['n'];\n return TRANSLATIONS[this.currentLanguage][tag].replace('{{n}}', n);\n }\n\n return TRANSLATIONS[this.currentLanguage][tag];\n }\n\n setLanguage(lang: string): void {\n if (TRANSLATIONS[lang]) {\n this.currentLanguage = lang;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport TRANSLATIONS from '../translations';\nimport { TranslationService } from '../services/translation.service';\nimport { Translation } from '../types';\n\n@Pipe({\n name: 'translate'\n})\nexport class TranslatePipe implements PipeTransform {\n\n constructor(\n private translationService: TranslationService\n ) { }\n\n transform(tag: keyof Translation, args?: { [key: string]: any }): string {\n return this.translationService.translate(tag as keyof Translation, args);\n }\n\n}\n","import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\nimport { CalendarEvent } from '../../types';\nimport { isDarkColor } from '../../utils/colors';\n\n@Component({\n selector: 'lib-more-events-modal',\n templateUrl: './more-events-modal.component.html',\n styleUrls: ['./more-events-modal.component.scss']\n})\nexport class MoreEventsModalComponent implements OnInit {\n\n @Input() events: CalendarEvent[] = [];\n @Input() date!: Date;\n\n @Output() close = new EventEmitter();\n @Output() eventClick = new EventEmitter<CalendarEvent>();\n\n constructor() { }\n\n ngOnInit(): void {\n }\n\n isDarkColor(color?: string): boolean {\n return isDarkColor(color || '#ffffff');\n }\n\n onClose() {\n this.close.emit();\n }\n\n onEventClick(event: CalendarEvent) {\n this.eventClick.emit(event);\n }\n\n}\n","<div class=\"more-events-modal-component\">\n <div class=\"backdrop\" (click)=\"onClose()\"></div>\n\n <div class=\"modal\">\n <div class=\"header\">\n <div class=\"title\">{{'moreEvents' | translate}}</div>\n <div class=\"subtitle\">{{date.toLocaleDateString()}}</div>\n\n <button class=\"btn-close\" (click)=\"onClose()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\n class=\"feather feather-x\" fill=\"yellow\">\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n\n <div class=\"events-list\">\n <div class=\"event-item\" *ngFor=\"let event of events\" style=\"--color: {{event.color}};\"\n [ngClass]=\"{'is-dark':isDarkColor(event.color)}\" (click)=\"onEventClick(event)\">\n <div class=\"event-title\">{{ event.title }}</div>\n </div>\n </div>\n </div>\n</div>","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { CalendarEvent, DayCell, WeekDay } from '../../types';\r\n\r\n@Component({\r\n selector: 'lib-calendar',\r\n templateUrl: './calendar.component.html',\r\n styleUrls: ['./calendar.component.scss']\r\n})\r\nexport class CalendarComponent implements OnInit, AfterViewInit {\r\n\r\n @Input() currentMonth: { year: number, month: number } = {\r\n year: new Date().getFullYear(),\r\n month: new Date().getMonth() + 1\r\n };\r\n\r\n @Input() events: CalendarEvent[] = [];\r\n\r\n @Input() startAt: 'monday' | 'sunday' = 'sunday';\r\n\r\n @Output() monthChange = new EventEmitter<{\r\n newMonth: { year: number, month: number },\r\n oldMonth: { year: number, month: number }\r\n }>();\r\n\r\n @ViewChild('calendar') calendarRef!: ElementRef;\r\n @ViewChild('calendarBody') calendarBodyRef!: ElementRef;\r\n\r\n calendarWidth?: number;\r\n columnWidth?: number;\r\n calendarBodyHeight?: number;\r\n maxEventsInDayCell?: number;\r\n\r\n dayCells: DayCell[] = [];\r\n\r\n weekDays: WeekDay[] = [\r\n { tag: 'sun' },\r\n { tag: 'mon' },\r\n { tag: 'tue' },\r\n { tag: 'wed' },\r\n { tag: 'thu' },\r\n { tag: 'fri' },\r\n { tag: 'sat' },\r\n ];\r\n\r\n showMoreEventsModal: boolean = false;\r\n moreEventsModalDate?: Date;\r\n moreEventsModalEvents: CalendarEvent[] = [];\r\n\r\n constructor() { }\r\n\r\n isToday(date: Date): boolean {\r\n const today = new Date();\r\n return date.getDate() === today.getDate() &&\r\n date.getMonth() === today.getMonth() &&\r\n date.getFullYear() === today.getFullYear();\r\n }\r\n\r\n getEventsForDay(date: Date): CalendarEvent[] {\r\n return this.events.filter(event => {\r\n const eventStart = new Date(event.start);\r\n const eventEnd = event.end ? new Date(event.end) : eventStart;\r\n\r\n return date >= new Date(eventStart.getFullYear(), eventStart.getMonth(), eventStart.getDate()) &&\r\n date <= new Date(eventEnd.getFullYear(), eventEnd.getMonth(), eventEnd.getDate());\r\n });\r\n }\r\n\r\n initDaysCells() {\r\n const daysInMonth = new Date(this.currentMonth.year, this.currentMonth.month, 0).getDate();\r\n const firstDayOfWeek = new Date(this.currentMonth.year, this.currentMonth.month - 1, 1).getDay();\r\n const prevDaysCount = this.startAt === 'monday' ? (firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1) : firstDayOfWeek;\r\n // const nextDaysCount = (7 - ((prevDaysCount + daysInMonth) % 7)) % 7;\r\n const nextDaysCount = 42 - (prevDaysCount + daysInMonth); // Always show 6 weeks\r\n\r\n this.dayCells = [];\r\n\r\n for (let i = 0; i < prevDaysCount; i++) {\r\n const date = new Date(this.currentMonth.year, this.currentMonth.month - 1, i - prevDaysCount + 1);\r\n const _events = this.getEventsForDay(date);\r\n\r\n this.dayCells.push({\r\n date,\r\n events: _events,\r\n isOutsideMonth: true,\r\n isToday: this.isToday(date)\r\n });\r\n }\r\n\r\n for (let day = 1; day <= daysInMonth; day++) {\r\n const date = new Date(this.currentMonth.year, this.currentMonth.month - 1, day);\r\n const _events = this.getEventsForDay(date);\r\n\r\n this.dayCells.push({\r\n date,\r\n events: _events,\r\n isToday: this.isToday(date)\r\n });\r\n }\r\n\r\n for (let i = 1; i <= nextDaysCount; i++) {\r\n const date = new Date(this.currentMonth.year, this.currentMonth.month - 1, daysInMonth + i);\r\n const _events = this.getEventsForDay(date);\r\n\r\n this.dayCells.push({\r\n date,\r\n events: _events,\r\n isOutsideMonth: true,\r\n isToday: this.isToday(date)\r\n });\r\n }\r\n }\r\n\r\n setCalendarBodyHeight() {\r\n this.calendarBodyHeight = this.calendarBodyRef.nativeElement.clientHeight;\r\n }\r\n\r\n setMaxEventsInDayCell() {\r\n const element = document.getElementsByClassName('events-list')[0] as HTMLElement;\r\n console.log(element);\r\n\r\n if (element) {\r\n const eventItemHeight = 22;\r\n this.maxEventsInDayCell = Math.floor(element.clientHeight / eventItemHeight) - 1;\r\n }\r\n }\r\n\r\n openMoreEventsModal(date: Date, events: CalendarEvent[]) {\r\n this.moreEventsModalDate = date;\r\n this.moreEventsModalEvents = events;\r\n this.showMoreEventsModal = true;\r\n }\r\n\r\n closeMoreEventsModal() {\r\n this.showMoreEventsModal = false;\r\n this.moreEventsModalDate = undefined;\r\n this.moreEventsModalEvents = [];\r\n }\r\n\r\n resizeListener = () => {\r\n this.setCalendarBodyHeight();\r\n this.setMaxEventsInDayCell();\r\n }\r\n\r\n ngOnInit(): void {\r\n if (this.startAt === 'monday') {\r\n this.weekDays = [\r\n { tag: 'mon' },\r\n { tag: 'tue' },\r\n { tag: 'wed' },\r\n { tag: 'thu' },\r\n { tag: 'fri' },\r\n { tag: 'sat' },\r\n { tag: 'sun' },\r\n ];\r\n }\r\n\r\n this.initDaysCells();\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n window.addEventListener('resize', this.resizeListener);\r\n\r\n setTimeout(() => {\r\n this.setCalendarBodyHeight();\r\n this.setMaxEventsInDayCell();\r\n });\r\n }\r\n\r\n onDestroy(): void {\r\n window.removeEventListener('resize', this.resizeListener);\r\n }\r\n}\r\n","<div class=\"calendar-component\">\r\n <div class=\"header\">\r\n Header {{ maxEventsInDayCell }}\r\n </div>\r\n\r\n <div class=\"body\" #calendarBody>\r\n <div class=\"week-days\">\r\n <div class=\"week-day\" *ngFor=\"let day of weekDays\">\r\n {{ day.tag | translate | slice:0:3 }}\r\n </div>\r\n </div>\r\n\r\n <div class=\"days-grid\">\r\n <div class=\"day-cell\" *ngFor=\"let day of dayCells; let i = index\"\r\n [ngClass]=\"{'outside-month': day.isOutsideMonth, 'is-today': day.isToday}\">\r\n <div class=\"day-number\">\r\n {{ day.date.getDate() }}\r\n </div>\r\n\r\n <div class=\"events-list\">\r\n <lib-calendar-event *ngFor=\"let event of day.events | slice:0:maxEventsInDayCell\"\r\n [event]=\"event\"></lib-calendar-event>\r\n\r\n <div class=\"more-events\" *ngIf=\"day.events.length > (maxEventsInDayCell || 0)\"\r\n (click)=\"openMoreEventsModal(day.date, day.events)\">\r\n {{'nMoreEvents' | translate: {n:(day.events.length - (maxEventsInDayCell || 0))} }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"footer\">\r\n Footer\r\n </div>\r\n\r\n <lib-more-events-modal *ngIf=\"showMoreEventsModal && moreEventsModalDate\" [events]=\"moreEventsModalEvents\"\r\n [date]=\"moreEventsModalDate\" (close)=\"closeMoreEventsModal()\"\r\n (eventClick)=\"closeMoreEventsModal()\"></lib-more-events-modal>\r\n</div>","import { Component, Input, OnInit } from '@angular/core';\nimport { CalendarEvent } from '../../types';\n\n@Component({\n selector: 'smart-calendar',\n templateUrl: './smart-calendar.component.html',\n styleUrls: ['./smart-calendar.component.scss']\n})\nexport class SmartCalendarComponent implements OnInit {\n\n @Input() events: CalendarEvent[] = [];\n\n constructor() { }\n\n ngOnInit(): void {\n }\n\n}\n","<div class=\"smart-calendar-component\">\n <lib-calendar [events]=\"events\"></lib-calendar>\n</div>","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SmartCalendarComponent } from './components/smart-calendar/smart-calendar.component';\r\nimport { CalendarComponent } from './components/calendar/calendar.component';\r\nimport { TranslatePipe } from './pipes/translate.pipe';\r\nimport { CalendarEventComponent } from './components/calendar-event/calendar-event.component';\nimport { MoreEventsModalComponent } from './components/more-events-modal/more-events-modal.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n SmartCalendarComponent,\r\n CalendarComponent,\r\n TranslatePipe,\r\n CalendarEventComponent,\r\n MoreEventsModalComponent\r\n ],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: [\r\n SmartCalendarComponent\r\n ]\r\n})\r\nexport class SmartAngularCalendarModule { }\r\n","/*\r\n * Public API Surface of smart-angular-calendar\r\n */\r\n\r\nexport * from './lib/smart-angular-calendar.service';\r\nexport * from './lib/components/smart-calendar/smart-calendar.component';\r\nexport * from './lib/smart-angular-calendar.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.TranslationService","i2.TranslatePipe","i2.CalendarEventComponent","i3.MoreEventsModalComponent","i4.TranslatePipe","i1.CalendarComponent"],"mappings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A,CAAA,CAAA;AAGb,0BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,YANnC,YAAY,CAAA,EAAA,CAAA,CAAA;2FAMH,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAftC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,sBAAsB;wBACtB,iBAAiB;wBACjB,aAAa;wBACb,sBAAsB;wBACtB,wBAAwB;AACzB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,sBAAsB;AACvB,qBAAA;AACF,iBAAA,CAAA;;;ACtBD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { CalendarEvent, DayCell, WeekDay } from '../../types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class CalendarComponent implements OnInit, AfterViewInit {
|
|
5
|
+
currentMonth: {
|
|
6
|
+
year: number;
|
|
7
|
+
month: number;
|
|
8
|
+
};
|
|
9
|
+
events: CalendarEvent[];
|
|
10
|
+
startAt: 'monday' | 'sunday';
|
|
11
|
+
monthChange: EventEmitter<{
|
|
12
|
+
newMonth: {
|
|
13
|
+
year: number;
|
|
14
|
+
month: number;
|
|
15
|
+
};
|
|
16
|
+
oldMonth: {
|
|
17
|
+
year: number;
|
|
18
|
+
month: number;
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
21
|
+
calendarRef: ElementRef;
|
|
22
|
+
calendarBodyRef: ElementRef;
|
|
23
|
+
calendarWidth?: number;
|
|
24
|
+
columnWidth?: number;
|
|
25
|
+
calendarBodyHeight?: number;
|
|
26
|
+
maxEventsInDayCell?: number;
|
|
27
|
+
dayCells: DayCell[];
|
|
28
|
+
weekDays: WeekDay[];
|
|
29
|
+
showMoreEventsModal: boolean;
|
|
30
|
+
moreEventsModalDate?: Date;
|
|
31
|
+
moreEventsModalEvents: CalendarEvent[];
|
|
32
|
+
constructor();
|
|
33
|
+
isToday(date: Date): boolean;
|
|
34
|
+
getEventsForDay(date: Date): CalendarEvent[];
|
|
35
|
+
initDaysCells(): void;
|
|
36
|
+
setCalendarBodyHeight(): void;
|
|
37
|
+
setMaxEventsInDayCell(): void;
|
|
38
|
+
openMoreEventsModal(date: Date, events: CalendarEvent[]): void;
|
|
39
|
+
closeMoreEventsModal(): void;
|
|
40
|
+
resizeListener: () => void;
|
|
41
|
+
ngOnInit(): void;
|
|
42
|
+
ngAfterViewInit(): void;
|
|
43
|
+
onDestroy(): void;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarComponent, never>;
|
|
45
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarComponent, "lib-calendar", never, { "currentMonth": "currentMonth"; "events": "events"; "startAt": "startAt"; }, { "monthChange": "monthChange"; }, never, never, false>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { CalendarEvent } from '../../types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class CalendarEventComponent implements OnInit {
|
|
5
|
+
event: CalendarEvent;
|
|
6
|
+
isDarkColor: boolean;
|
|
7
|
+
constructor();
|
|
8
|
+
ngOnInit(): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarEventComponent, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarEventComponent, "lib-calendar-event", never, { "event": "event"; }, {}, never, never, false>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { CalendarEvent } from '../../types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MoreEventsModalComponent implements OnInit {
|
|
5
|
+
events: CalendarEvent[];
|
|
6
|
+
date: Date;
|
|
7
|
+
close: EventEmitter<any>;
|
|
8
|
+
eventClick: EventEmitter<CalendarEvent>;
|
|
9
|
+
constructor();
|
|
10
|
+
ngOnInit(): void;
|
|
11
|
+
isDarkColor(color?: string): boolean;
|
|
12
|
+
onClose(): void;
|
|
13
|
+
onEventClick(event: CalendarEvent): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MoreEventsModalComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MoreEventsModalComponent, "lib-more-events-modal", never, { "events": "events"; "date": "date"; }, { "close": "close"; "eventClick": "eventClick"; }, never, never, false>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { CalendarEvent } from '../../types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class SmartCalendarComponent implements OnInit {
|
|
5
|
+
events: CalendarEvent[];
|
|
6
|
+
constructor();
|
|
7
|
+
ngOnInit(): void;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SmartCalendarComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SmartCalendarComponent, "smart-calendar", never, { "events": "events"; }, {}, never, never, false>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { TranslationService } from '../services/translation.service';
|
|
3
|
+
import { Translation } from '../types';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class TranslatePipe implements PipeTransform {
|
|
6
|
+
private translationService;
|
|
7
|
+
constructor(translationService: TranslationService);
|
|
8
|
+
transform(tag: keyof Translation, args?: {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}): string;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TranslatePipe, never>;
|
|
12
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TranslatePipe, "translate", false>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Translation } from '../types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class TranslationService {
|
|
4
|
+
private currentLanguage;
|
|
5
|
+
constructor();
|
|
6
|
+
translate(tag: keyof Translation, args?: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}): string;
|
|
9
|
+
setLanguage(lang: string): void;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TranslationService, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TranslationService>;
|
|
12
|
+
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./smart-
|
|
2
|
+
import * as i1 from "./components/smart-calendar/smart-calendar.component";
|
|
3
|
+
import * as i2 from "./components/calendar/calendar.component";
|
|
4
|
+
import * as i3 from "./pipes/translate.pipe";
|
|
5
|
+
import * as i4 from "./components/calendar-event/calendar-event.component";
|
|
6
|
+
import * as i5 from "./components/more-events-modal/more-events-modal.component";
|
|
7
|
+
import * as i6 from "@angular/common";
|
|
3
8
|
export declare class SmartAngularCalendarModule {
|
|
4
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<SmartAngularCalendarModule, never>;
|
|
5
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<SmartAngularCalendarModule, [typeof i1.
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SmartAngularCalendarModule, [typeof i1.SmartCalendarComponent, typeof i2.CalendarComponent, typeof i3.TranslatePipe, typeof i4.CalendarEventComponent, typeof i5.MoreEventsModalComponent], [typeof i6.CommonModule], [typeof i1.SmartCalendarComponent]>;
|
|
6
11
|
static ɵinj: i0.ɵɵInjectorDeclaration<SmartAngularCalendarModule>;
|
|
7
12
|
}
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface Translation {
|
|
2
|
+
sun: string;
|
|
3
|
+
mon: string;
|
|
4
|
+
tue: string;
|
|
5
|
+
wed: string;
|
|
6
|
+
thu: string;
|
|
7
|
+
fri: string;
|
|
8
|
+
sat: string;
|
|
9
|
+
moreEvents: string;
|
|
10
|
+
nMoreEvents: string;
|
|
11
|
+
}
|
|
12
|
+
export interface WeekDay {
|
|
13
|
+
tag: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';
|
|
14
|
+
}
|
|
15
|
+
export interface CalendarEvent {
|
|
16
|
+
id: string;
|
|
17
|
+
title: string;
|
|
18
|
+
start: Date;
|
|
19
|
+
end?: Date;
|
|
20
|
+
allDay?: boolean;
|
|
21
|
+
color?: string;
|
|
22
|
+
meta?: any;
|
|
23
|
+
}
|
|
24
|
+
export interface DayCell {
|
|
25
|
+
date: Date;
|
|
26
|
+
events: CalendarEvent[];
|
|
27
|
+
isOutsideMonth?: boolean;
|
|
28
|
+
isToday?: boolean;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isDarkColor: (hexColor: string, threshold?: number) => boolean;
|