@operato/event-view 1.0.0-beta.12 → 1.0.0-beta.15

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.
@@ -1,60 +1,39 @@
1
- import { html, TemplateResult } from 'lit';
2
- import '../src/event-view.js';
1
+ import '../src/event-view.js'
2
+
3
+ import { html, TemplateResult } from 'lit'
3
4
 
4
5
  export default {
5
6
  title: 'EventView',
6
7
  component: 'event-view',
7
8
  argTypes: {
8
- title: { control: 'text' },
9
- counter: { control: 'number' },
10
- textColor: { control: 'color' },
9
+ format: { control: 'select', options: ['monthly', 'weekly'], description: 'set event view format' }
11
10
  }
12
- };
11
+ }
13
12
 
14
13
  interface Story<T> {
15
- (args: T): TemplateResult;
16
- args?: Partial<T>;
17
- argTypes?: Record<string, unknown>;
14
+ (args: T): TemplateResult
15
+ args?: Partial<T>
16
+ argTypes?: Record<string, unknown>
18
17
  }
19
18
 
20
19
  interface ArgTypes {
21
- title?: string;
22
- counter?: number;
23
- textColor?: string;
24
- slot?: TemplateResult;
20
+ format?: string
25
21
  }
26
22
 
27
- const Template: Story<ArgTypes> = ({
28
- title = 'Hello world',
29
- counter = 5,
30
- textColor,
31
- slot,
32
- }: ArgTypes) => html`
33
- <event-view
34
- style="--event-view-text-color: ${textColor || 'black'}"
35
- .title=${title}
36
- .counter=${counter}
37
- >
38
- ${slot}
39
- </event-view>
40
- `;
41
-
42
- export const Regular = Template.bind({});
43
-
44
- export const CustomTitle = Template.bind({});
45
- CustomTitle.args = {
46
- title: 'My title',
47
- };
48
-
49
- export const CustomCounter = Template.bind({});
50
- CustomCounter.args = {
51
- counter: 123456,
52
- };
53
-
54
- export const SlottedContent = Template.bind({});
55
- SlottedContent.args = {
56
- slot: html`<p>Slotted content</p>`,
57
- };
58
- SlottedContent.argTypes = {
59
- slot: { table: { disable: true } },
60
- };
23
+ const Template: Story<ArgTypes> = ({ format = 'monthly' }: ArgTypes) =>
24
+ html`
25
+ <link rel="stylesheet" href="/themes/app-theme.css" />
26
+ <link rel="stylesheet" href="/themes/calendar-theme.css" />
27
+
28
+ <event-view format=${format}> </event-view>
29
+ `
30
+
31
+ export const Regular = Template.bind({})
32
+ Regular.args = {
33
+ format: 'monthly'
34
+ }
35
+
36
+ export const WeeklyEventView = Template.bind({})
37
+ WeeklyEventView.args = {
38
+ format: 'weekly'
39
+ }
@@ -25,6 +25,27 @@ body {
25
25
  --calendar-monthly-event-padding: 2px var(--padding-default);
26
26
  --calendar-monthly-event-border: 3px solid #ccc;
27
27
  --calendar-monthly-event-border-width: 0 0 0 3px;
28
+
29
+ /* weekly layout */
30
+ --calendar-weekly-ol-margin: var(--margin-default) 0;
31
+ --calendar-weekly-ol-top-border: 2px solid rgba(var(--secondary-color-rgb), 0.7);
32
+ --calendar-current-week-background-color: var(--theme-white-color);
33
+ --calendar-weekly-label-align: center;
34
+ --calendar-weekly-label-padding: var(--padding-narrow) 0;
35
+ --calendar-weekly-label-color: rgba(var(--secondary-color-rgb), 0.8);
36
+ --calendar-weekly-opacity: 0.5;
37
+ --calendar-weekly-date-label-background-color: var(--status-danger-color);
38
+ --calendar-weekly-date-label-margin: var(--margin-narrow);
39
+ --calendar-weekly-date-label-padding: 5px var(--padding-narrow);
40
+ --calendar-weekly-date-label-color: var(--theme-white-color);
41
+
42
+ --calendar-weekly-background-color: #f4f4f4;
43
+ --calendar-weekly-event-border-radius: var(--border-radius);
44
+ --calendar-weekly-event-margin: var(--padding-narrow) 0 0 0;
45
+ --calendar-weekly-event-padding: 2px var(--padding-default);
46
+ --calendar-weekly-event-border: 3px solid #ccc;
47
+ --calendar-weekly-event-border-width: 0 0 0 3px;
48
+
28
49
  }
29
50
 
30
51
  @media only screen and (max-width: 460px) {
package/tsconfig.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "es2018",
3
+ "target": "esnext",
4
4
  "module": "esnext",
5
5
  "moduleResolution": "node",
6
+ "resolveJsonModule": true,
6
7
  "noEmitOnError": true,
7
8
  "lib": ["es2017", "dom"],
8
9
  "strict": true,