@operato/event-view 1.2.21 → 1.2.22
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/CHANGELOG.md +12 -0
- package/dist/src/calendar-monthly-styles.js +6 -1
- package/dist/src/calendar-monthly-styles.js.map +1 -1
- package/dist/src/calendar-monthly.d.ts +1 -10
- package/dist/src/calendar-monthly.js +5 -17
- package/dist/src/calendar-monthly.js.map +1 -1
- package/dist/src/calendar-weekly-styles.js +2 -2
- package/dist/src/calendar-weekly-styles.js.map +1 -1
- package/dist/src/calendar-weekly.d.ts +1 -10
- package/dist/src/calendar-weekly.js +3 -21
- package/dist/src/calendar-weekly.js.map +1 -1
- package/dist/src/common.d.ts +15 -0
- package/dist/src/common.js +13 -0
- package/dist/src/common.js.map +1 -0
- package/dist/src/event-provider.d.ts +2 -3
- package/dist/src/event-provider.js.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/ox-event-view.d.ts +2 -0
- package/dist/src/ox-event-view.js +5 -3
- package/dist/src/ox-event-view.js.map +1 -1
- package/dist/src/sample-event-provider.d.ts +3 -2
- package/dist/src/sample-event-provider.js +100 -4
- package/dist/src/sample-event-provider.js.map +1 -1
- package/dist/src/types.d.ts +20 -0
- package/dist/src/types.js +13 -0
- package/dist/src/types.js.map +1 -0
- package/dist/stories/index.stories.js +54 -1
- package/dist/stories/index.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -2
- package/src/calendar-monthly-styles.ts +6 -1
- package/src/calendar-monthly.ts +7 -33
- package/src/calendar-weekly-styles.ts +2 -2
- package/src/calendar-weekly.ts +5 -38
- package/src/index.ts +2 -1
- package/src/ox-event-view.ts +4 -3
- package/src/types.ts +38 -0
- package/stories/index.stories.ts +60 -2
- package/themes/calendar-theme.css +1 -2
- package/src/biz-event.ts +0 -6
- package/src/event-provider.ts +0 -6
- package/src/sample-event-provider.ts +0 -116
package/stories/index.stories.ts
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
1
|
import '../src/ox-event-view.js'
|
|
2
|
-
|
|
3
2
|
import { html, TemplateResult } from 'lit'
|
|
3
|
+
import { BizEvent, CALENDAR, EventProvider } from '../src/types.js'
|
|
4
|
+
|
|
5
|
+
class SampleEventProvider implements EventProvider {
|
|
6
|
+
fetchEventsForCalendar(calendar: CALENDAR) {
|
|
7
|
+
const map = new Map<Date, BizEvent[]>()
|
|
8
|
+
|
|
9
|
+
calendar.forEach(({ date }) =>
|
|
10
|
+
map.set(date, [
|
|
11
|
+
{
|
|
12
|
+
due: '2021-08-21',
|
|
13
|
+
title: 'HAHAHA',
|
|
14
|
+
color: 'yellow'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
due: '2021-08-21',
|
|
18
|
+
title: 'HOHOHO',
|
|
19
|
+
color: 'lime'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
due: '2021-08-21',
|
|
23
|
+
title: 'HIHIHI',
|
|
24
|
+
color: 'yellow'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
due: '2021-08-21',
|
|
28
|
+
title: 'HEHEHE',
|
|
29
|
+
color: 'white'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
due: '2021-08-21',
|
|
33
|
+
title: 'KEKEKE',
|
|
34
|
+
color: 'yellow'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
due: '2021-08-21',
|
|
38
|
+
title: 'MEMEME',
|
|
39
|
+
color: 'orange'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
due: '2021-08-21',
|
|
43
|
+
title: 'MOMOMO',
|
|
44
|
+
color: 'lime'
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
due: '2021-08-21',
|
|
48
|
+
title: 'QUOQUO',
|
|
49
|
+
color: 'navy'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
due: '2021-08-21',
|
|
53
|
+
title: 'ZZXXCC',
|
|
54
|
+
color: 'gray'
|
|
55
|
+
}
|
|
56
|
+
])
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
return map
|
|
60
|
+
}
|
|
61
|
+
}
|
|
4
62
|
|
|
5
63
|
export default {
|
|
6
64
|
title: 'EventView',
|
|
@@ -26,7 +84,7 @@ const Template: Story<ArgTypes> = ({ mode = 'monthly' }: ArgTypes) =>
|
|
|
26
84
|
<link rel="stylesheet" href="/themes/calendar-theme.css" />
|
|
27
85
|
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
|
28
86
|
|
|
29
|
-
<ox-event-view mode=${mode}> </ox-event-view>
|
|
87
|
+
<ox-event-view mode=${mode} .eventProvider=${new SampleEventProvider()}> </ox-event-view>
|
|
30
88
|
`
|
|
31
89
|
|
|
32
90
|
export const Regular = Template.bind({})
|
|
@@ -36,7 +36,7 @@ body {
|
|
|
36
36
|
--calendar-weekly-opacity: 0.5;
|
|
37
37
|
--calendar-weekly-date-label-background-color: var(--status-danger-color);
|
|
38
38
|
--calendar-weekly-date-label-margin: var(--margin-narrow);
|
|
39
|
-
--calendar-weekly-date-label-padding:
|
|
39
|
+
--calendar-weekly-date-label-padding: 3px var(--padding-narrow);
|
|
40
40
|
--calendar-weekly-date-label-color: var(--theme-white-color);
|
|
41
41
|
|
|
42
42
|
--calendar-weekly-background-color: #f4f4f4;
|
|
@@ -45,7 +45,6 @@ body {
|
|
|
45
45
|
--calendar-weekly-event-padding: 2px var(--padding-default);
|
|
46
46
|
--calendar-weekly-event-border: 3px solid #ccc;
|
|
47
47
|
--calendar-weekly-event-border-width: 0 0 0 3px;
|
|
48
|
-
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
@media only screen and (max-width: 460px) {
|
package/src/biz-event.ts
DELETED
package/src/event-provider.ts
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { EventProvider } from './event-provider'
|
|
2
|
-
|
|
3
|
-
export class SampleMonthlyEventProvider implements EventProvider {
|
|
4
|
-
fetchEventsForDate(date: Date, options: any) {
|
|
5
|
-
return [
|
|
6
|
-
{
|
|
7
|
-
due: '2021-08-21',
|
|
8
|
-
title: 'HAHAHA',
|
|
9
|
-
color: 'yellow'
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
due: '2021-08-21',
|
|
13
|
-
title: 'HOHOHO',
|
|
14
|
-
color: 'lime'
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
due: '2021-08-21',
|
|
18
|
-
title: 'HIHIHI',
|
|
19
|
-
color: 'yellow'
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
due: '2021-08-21',
|
|
23
|
-
title: 'HEHEHE',
|
|
24
|
-
color: 'white'
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
due: '2021-08-21',
|
|
28
|
-
title: 'KEKEKE',
|
|
29
|
-
color: 'yellow'
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
due: '2021-08-21',
|
|
33
|
-
title: 'MEMEME',
|
|
34
|
-
color: 'orange'
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
due: '2021-08-21',
|
|
38
|
-
title: 'MOMOMO',
|
|
39
|
-
color: 'lime'
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
due: '2021-08-21',
|
|
43
|
-
title: 'QUOQUO',
|
|
44
|
-
color: 'navy'
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
due: '2021-08-21',
|
|
48
|
-
title: 'ZZXXCC',
|
|
49
|
-
color: 'gray'
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
fetchEventsForDuration(from: Date, to: Date, options: any) {
|
|
55
|
-
return []
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export class SampleWeeklyEventProvider implements EventProvider {
|
|
60
|
-
fetchEventsForDate(date: Date, options: any) {
|
|
61
|
-
return [
|
|
62
|
-
{
|
|
63
|
-
due: '2021-08-21',
|
|
64
|
-
title: 'HAHAHA',
|
|
65
|
-
color: 'yellow',
|
|
66
|
-
clickEvent: function (title: string, due: string) {
|
|
67
|
-
console.log('clicked...', title, due)
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
due: '2021-08-21',
|
|
72
|
-
title: 'HOHOHO',
|
|
73
|
-
color: 'lime'
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
due: '2021-08-21',
|
|
77
|
-
title: 'HIHIHI',
|
|
78
|
-
color: 'yellow'
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
due: '2021-08-21',
|
|
82
|
-
title: 'HEHEHE',
|
|
83
|
-
color: 'white'
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
due: '2021-08-21',
|
|
87
|
-
title: 'KEKEKE',
|
|
88
|
-
color: 'yellow'
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
due: '2021-08-21',
|
|
92
|
-
title: 'MEMEME',
|
|
93
|
-
color: 'orange'
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
due: '2021-08-21',
|
|
97
|
-
title: 'MOMOMO',
|
|
98
|
-
color: 'lime'
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
due: '2021-08-21',
|
|
102
|
-
title: 'QUOQUO',
|
|
103
|
-
color: 'navy'
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
due: '2021-08-21',
|
|
107
|
-
title: 'ZZXXCC',
|
|
108
|
-
color: 'gray'
|
|
109
|
-
}
|
|
110
|
-
]
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
fetchEventsForDuration(from: Date, to: Date, options: any) {
|
|
114
|
-
return []
|
|
115
|
-
}
|
|
116
|
-
}
|