@operato/event-view 7.1.6 → 7.1.27

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.
@@ -3,7 +3,7 @@ import { html, TemplateResult } from 'lit'
3
3
  import { BizEvent, CALENDAR, EventProvider } from '../src/types.js'
4
4
 
5
5
  class SampleEventProvider implements EventProvider {
6
- fetchEventsForCalendar(calendar: CALENDAR) {
6
+ async fetchEventsForCalendar(calendar: CALENDAR) {
7
7
  const map = new Map<Date, BizEvent[]>()
8
8
 
9
9
  calendar.forEach(({ date }) =>
@@ -75,7 +75,7 @@ interface Story<T> {
75
75
  }
76
76
 
77
77
  interface ArgTypes {
78
- mode?: string
78
+ mode?: 'monthly' | 'weekly'
79
79
  }
80
80
 
81
81
  const Template: Story<ArgTypes> = ({ mode = 'monthly' }: ArgTypes) => html`
@@ -102,7 +102,14 @@ const Template: Story<ArgTypes> = ({ mode = 'monthly' }: ArgTypes) => html`
102
102
  rel="stylesheet"
103
103
  />
104
104
 
105
- <ox-event-view mode=${mode} .eventProvider=${new SampleEventProvider()}> </ox-event-view>
105
+ <ox-event-view
106
+ mode="${mode}"
107
+ .eventProvider=${new SampleEventProvider()}
108
+ @select-date=${(e: CustomEvent) => {
109
+ console.log(e.detail)
110
+ }}
111
+ >
112
+ </ox-event-view>
106
113
  `
107
114
 
108
115
  export const Regular = Template.bind({})
@@ -9,7 +9,8 @@ body {
9
9
  /* monthly layout */
10
10
  --calendar-monthly-ol-margin: var(--margin-default) 0;
11
11
  --calendar-monthly-ol-top-border: 2px solid var(--md-sys-color-secondary);
12
- --calendar-current-monty-background-color: var(--md-sys-color-surface-variant);
12
+ --calendar-current-month-background-color: var(--md-sys-color-surface-variant);
13
+ --calendar-current-month-color: var(--md-sys-color-on-surface);
13
14
  --calendar-monthly-label-align: left;
14
15
  --calendar-monthly-label-padding: var(--padding-narrow) 0;
15
16
  --calendar-monthly-label-color: var(--md-sys-color-secondary);
@@ -18,6 +19,7 @@ body {
18
19
  --calendar-monthly-date-label-margin: var(--margin-narrow);
19
20
  --calendar-monthly-date-label-padding: 0px 6px;
20
21
  --calendar-monthly-date-label-color: var(--md-sys-color-on-primary);
22
+ --calendar-monthly-date-min-height: 120px;
21
23
 
22
24
  --calendar-monthly-background-color: #f4f4f4;
23
25
  --calendar-monthly-event-border-radius: var(--border-radius);
@@ -35,6 +37,7 @@ body {
35
37
  --calendar-weekly-ol-margin: var(--margin-default) 0;
36
38
  --calendar-weekly-ol-top-border: 2px solid var(--md-sys-color-secondary);
37
39
  --calendar-current-week-background-color: var(--md-sys-color-surface-variant);
40
+ --calendar-current-week-color: var(--md-sys-color-on-surface);
38
41
  --calendar-weekly-label-align: center;
39
42
  --calendar-weekly-label-padding: var(--padding-narrow) 0;
40
43
  --calendar-weekly-label-color: var(--md-sys-color-secondary);