@zeedhi/zd-calendar-common 1.6.0 → 1.7.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 +1 -1
- package/dist/calendar-common.esm.js +20 -2
- package/dist/calendar-common.umd.js +20 -2
- package/package.json +2 -2
- package/types/calendar.d.ts +6 -1
- package/types/interfaces.d.ts +5 -0
package/README.md
CHANGED
|
@@ -33,6 +33,7 @@ class Calendar extends ComponentRender {
|
|
|
33
33
|
this.intervalHeight = 48;
|
|
34
34
|
this.intervalMinutes = 60;
|
|
35
35
|
this.intervalStyle = null;
|
|
36
|
+
this.dayStyle = null;
|
|
36
37
|
this.intervalWidth = 60;
|
|
37
38
|
this.locale = I18n.instance.language;
|
|
38
39
|
this.localeFirstDayOfYear = 0;
|
|
@@ -48,8 +49,12 @@ class Calendar extends ComponentRender {
|
|
|
48
49
|
this.type = 'month';
|
|
49
50
|
this.weekdayFormat = null;
|
|
50
51
|
this.weekdays = [0, 1, 2, 3, 4, 5, 6];
|
|
52
|
+
this.canEditEvent = true;
|
|
53
|
+
this.canDeleteEvent = true;
|
|
51
54
|
this.showHeader = this.getInitValue('showHeader', props.showHeader, this.showHeader);
|
|
52
55
|
this.title = this.getInitValue('title', props.title, this.title);
|
|
56
|
+
this.canDeleteEvent = this.getInitValue('canDeleteEvent', props.canDeleteEvent, this.canDeleteEvent);
|
|
57
|
+
this.canEditEvent = this.getInitValue('canEditEvent', props.canEditEvent, this.canEditEvent);
|
|
53
58
|
this.categories = this.getInitValue('categories', props.categories, this.categories);
|
|
54
59
|
this.categoryDays = this.getInitValue('categoryDays', props.categoryDays, this.categoryDays);
|
|
55
60
|
this.categoryForInvalid = this.getInitValue('categoryForInvalid', props.categoryForInvalid, this.categoryForInvalid);
|
|
@@ -83,6 +88,7 @@ class Calendar extends ComponentRender {
|
|
|
83
88
|
this.intervalHeight = this.getInitValue('intervalHeight', props.intervalHeight, this.intervalHeight);
|
|
84
89
|
this.intervalMinutes = this.getInitValue('intervalMinutes', props.intervalMinutes, this.intervalMinutes);
|
|
85
90
|
this.intervalStyle = this.getInitValue('intervalStyle', props.intervalStyle, this.intervalStyle);
|
|
91
|
+
this.dayStyle = this.getInitValue('dayStyle', props.dayStyle, this.dayStyle);
|
|
86
92
|
this.intervalWidth = this.getInitValue('intervalWidth', props.intervalWidth, this.intervalWidth);
|
|
87
93
|
this.locale = this.getInitValue('locale', props.locale, this.locale);
|
|
88
94
|
this.localeFirstDayOfYear = this.getInitValue('localeFirstDayOfYear', props.localeFirstDayOfYear, this.localeFirstDayOfYear);
|
|
@@ -182,8 +188,20 @@ class Calendar extends ComponentRender {
|
|
|
182
188
|
clickDay(element, event) {
|
|
183
189
|
this.callEvent('clickDay', { event, element, component: this });
|
|
184
190
|
}
|
|
185
|
-
clickEvent(element, event) {
|
|
186
|
-
this.callEvent('clickEvent', {
|
|
191
|
+
clickEvent(calendarEvent, element, event) {
|
|
192
|
+
this.callEvent('clickEvent', {
|
|
193
|
+
calendarEvent, event, element, component: this,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
clickDeleteEvent(calendarEvent, element, event) {
|
|
197
|
+
this.callEvent('clickDeleteEvent', {
|
|
198
|
+
calendarEvent, event, element, component: this,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
clickEditEvent(calendarEvent, element, event) {
|
|
202
|
+
this.callEvent('clickEditEvent', {
|
|
203
|
+
calendarEvent, event, element, component: this,
|
|
204
|
+
});
|
|
187
205
|
}
|
|
188
206
|
clickDayCategory(element, event) {
|
|
189
207
|
this.callEvent('clickDayCategory', { event, element, component: this });
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
this.intervalHeight = 48;
|
|
37
37
|
this.intervalMinutes = 60;
|
|
38
38
|
this.intervalStyle = null;
|
|
39
|
+
this.dayStyle = null;
|
|
39
40
|
this.intervalWidth = 60;
|
|
40
41
|
this.locale = core.I18n.instance.language;
|
|
41
42
|
this.localeFirstDayOfYear = 0;
|
|
@@ -51,8 +52,12 @@
|
|
|
51
52
|
this.type = 'month';
|
|
52
53
|
this.weekdayFormat = null;
|
|
53
54
|
this.weekdays = [0, 1, 2, 3, 4, 5, 6];
|
|
55
|
+
this.canEditEvent = true;
|
|
56
|
+
this.canDeleteEvent = true;
|
|
54
57
|
this.showHeader = this.getInitValue('showHeader', props.showHeader, this.showHeader);
|
|
55
58
|
this.title = this.getInitValue('title', props.title, this.title);
|
|
59
|
+
this.canDeleteEvent = this.getInitValue('canDeleteEvent', props.canDeleteEvent, this.canDeleteEvent);
|
|
60
|
+
this.canEditEvent = this.getInitValue('canEditEvent', props.canEditEvent, this.canEditEvent);
|
|
56
61
|
this.categories = this.getInitValue('categories', props.categories, this.categories);
|
|
57
62
|
this.categoryDays = this.getInitValue('categoryDays', props.categoryDays, this.categoryDays);
|
|
58
63
|
this.categoryForInvalid = this.getInitValue('categoryForInvalid', props.categoryForInvalid, this.categoryForInvalid);
|
|
@@ -86,6 +91,7 @@
|
|
|
86
91
|
this.intervalHeight = this.getInitValue('intervalHeight', props.intervalHeight, this.intervalHeight);
|
|
87
92
|
this.intervalMinutes = this.getInitValue('intervalMinutes', props.intervalMinutes, this.intervalMinutes);
|
|
88
93
|
this.intervalStyle = this.getInitValue('intervalStyle', props.intervalStyle, this.intervalStyle);
|
|
94
|
+
this.dayStyle = this.getInitValue('dayStyle', props.dayStyle, this.dayStyle);
|
|
89
95
|
this.intervalWidth = this.getInitValue('intervalWidth', props.intervalWidth, this.intervalWidth);
|
|
90
96
|
this.locale = this.getInitValue('locale', props.locale, this.locale);
|
|
91
97
|
this.localeFirstDayOfYear = this.getInitValue('localeFirstDayOfYear', props.localeFirstDayOfYear, this.localeFirstDayOfYear);
|
|
@@ -185,8 +191,20 @@
|
|
|
185
191
|
clickDay(element, event) {
|
|
186
192
|
this.callEvent('clickDay', { event, element, component: this });
|
|
187
193
|
}
|
|
188
|
-
clickEvent(element, event) {
|
|
189
|
-
this.callEvent('clickEvent', {
|
|
194
|
+
clickEvent(calendarEvent, element, event) {
|
|
195
|
+
this.callEvent('clickEvent', {
|
|
196
|
+
calendarEvent, event, element, component: this,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
clickDeleteEvent(calendarEvent, element, event) {
|
|
200
|
+
this.callEvent('clickDeleteEvent', {
|
|
201
|
+
calendarEvent, event, element, component: this,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
clickEditEvent(calendarEvent, element, event) {
|
|
205
|
+
this.callEvent('clickEditEvent', {
|
|
206
|
+
calendarEvent, event, element, component: this,
|
|
207
|
+
});
|
|
190
208
|
}
|
|
191
209
|
clickDayCategory(element, event) {
|
|
192
210
|
this.callEvent('clickDayCategory', { event, element, component: this });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/zd-calendar-common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Powered by Zeedhi",
|
|
5
5
|
"main": "dist/calendar-common.umd.js",
|
|
6
6
|
"module": "dist/calendar-common.esm.js",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"@zeedhi/common": "*",
|
|
24
24
|
"@zeedhi/core": "*"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "26b12f1ca3ad6e8900a8207633f56b3e2d85923d"
|
|
27
27
|
}
|
package/types/calendar.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export declare class Calendar extends ComponentRender implements ICalendar {
|
|
|
36
36
|
intervalHeight?: number | string;
|
|
37
37
|
intervalMinutes?: number | string;
|
|
38
38
|
intervalStyle?: Function | null;
|
|
39
|
+
dayStyle?: ((date: string) => object | string) | null;
|
|
39
40
|
intervalWidth?: number | string;
|
|
40
41
|
locale?: string;
|
|
41
42
|
localeFirstDayOfYear?: number | string;
|
|
@@ -55,6 +56,8 @@ export declare class Calendar extends ComponentRender implements ICalendar {
|
|
|
55
56
|
weekdayFormat?: Function | null;
|
|
56
57
|
weekdays?: string | string[] | number[];
|
|
57
58
|
selectTypeData?: {};
|
|
59
|
+
canEditEvent?: ((event: CalendarEvents) => boolean) | boolean;
|
|
60
|
+
canDeleteEvent?: ((event: CalendarEvents) => boolean) | boolean;
|
|
58
61
|
/**
|
|
59
62
|
* Events registered to the calendar
|
|
60
63
|
*/
|
|
@@ -82,7 +85,9 @@ export declare class Calendar extends ComponentRender implements ICalendar {
|
|
|
82
85
|
clickDate(element: any, event: Event): void;
|
|
83
86
|
clickMore(element: any, event: Event): void;
|
|
84
87
|
clickDay(element: any, event: Event): void;
|
|
85
|
-
clickEvent(element: any, event: Event): void;
|
|
88
|
+
clickEvent(calendarEvent: CalendarEvents, element: any, event: Event): void;
|
|
89
|
+
clickDeleteEvent(calendarEvent: CalendarEvents, element: any, event: Event): void;
|
|
90
|
+
clickEditEvent(calendarEvent: CalendarEvents, element: any, event: Event): void;
|
|
86
91
|
clickDayCategory(element: any, event: Event): void;
|
|
87
92
|
clickInterval(element: any, event: Event): void;
|
|
88
93
|
clickTime(element: any, event: Event): void;
|
package/types/interfaces.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export interface ICalendarEvents<T = ICalendarEventParam | IEventParam<any>> ext
|
|
|
28
28
|
clickDay?: IEvent<T> | string;
|
|
29
29
|
clickMore?: IEvent<T> | string;
|
|
30
30
|
clickEvent?: IEvent<T> | string;
|
|
31
|
+
clickDeleteEvent?: IEvent<T> | string;
|
|
32
|
+
clickEditEvent?: IEvent<T> | string;
|
|
31
33
|
clickDayCategory?: IEvent<T> | string;
|
|
32
34
|
clickInterval?: IEvent<T> | string;
|
|
33
35
|
clickTime?: IEvent<T> | string;
|
|
@@ -53,6 +55,8 @@ export interface ICalendar extends IComponentRender {
|
|
|
53
55
|
categoryHideDynamic?: boolean | string;
|
|
54
56
|
categoryShowAll?: boolean | string;
|
|
55
57
|
categoryText?: string | Function;
|
|
58
|
+
canEditEvent?: ((event: CalendarEvents) => boolean) | boolean;
|
|
59
|
+
canDeleteEvent?: ((event: CalendarEvents) => boolean) | boolean;
|
|
56
60
|
color?: string;
|
|
57
61
|
dayFormat?: Function | null;
|
|
58
62
|
end?: string | number | Date;
|
|
@@ -80,6 +84,7 @@ export interface ICalendar extends IComponentRender {
|
|
|
80
84
|
intervalHeight?: number | string;
|
|
81
85
|
intervalMinutes?: number | string;
|
|
82
86
|
intervalStyle?: Function | null;
|
|
87
|
+
dayStyle?: ((date: string) => object | string) | null;
|
|
83
88
|
intervalWidth?: number | string;
|
|
84
89
|
locale?: string;
|
|
85
90
|
localeFirstDayOfYear?: string | number;
|