scb-wc-test 0.1.117 → 0.1.118
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/all.js +4 -0
- package/index.d.ts +2 -0
- package/index.js +126 -122
- package/mvc/components/all.js +2 -0
- package/mvc/components/scb-calendar/scb-calendar-event.js +12 -0
- package/mvc/components/scb-calendar/scb-calendar.js +123 -0
- package/package.json +10 -2
- package/scb-calendar/scb-calendar-event.d.ts +8 -0
- package/scb-calendar/scb-calendar-event.js +42 -0
- package/scb-calendar/scb-calendar.d.ts +16 -0
- package/scb-calendar/scb-calendar.js +212 -0
- package/scb-wc-test.bundle.js +513 -380
package/all.js
CHANGED
|
@@ -10,6 +10,8 @@ import './mvc/components/scb-badge/scb-badge.js';
|
|
|
10
10
|
import './mvc/components/scb-breadcrumb/scb-breadcrumb-item.js';
|
|
11
11
|
import './mvc/components/scb-breadcrumb/scb-breadcrumb.js';
|
|
12
12
|
import './mvc/components/scb-button/scb-button.js';
|
|
13
|
+
import './mvc/components/scb-calendar/scb-calendar-event.js';
|
|
14
|
+
import './mvc/components/scb-calendar/scb-calendar.js';
|
|
13
15
|
import './mvc/components/scb-calendar-card/scb-calendar-card.js';
|
|
14
16
|
import './mvc/components/scb-card/scb-card.js';
|
|
15
17
|
import './mvc/components/scb-checkbox/scb-checkbox-group.js';
|
|
@@ -83,6 +85,8 @@ import './scb-badge/scb-badge.js';
|
|
|
83
85
|
import './scb-breadcrumb/scb-breadcrumb-item.js';
|
|
84
86
|
import './scb-breadcrumb/scb-breadcrumb.js';
|
|
85
87
|
import './scb-button/scb-button.js';
|
|
88
|
+
import './scb-calendar/scb-calendar-event.js';
|
|
89
|
+
import './scb-calendar/scb-calendar.js';
|
|
86
90
|
import './scb-calendar-card/scb-calendar-card.js';
|
|
87
91
|
import './scb-card/scb-card.js';
|
|
88
92
|
import './scb-checkbox/scb-checkbox-group.js';
|
package/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export * from './scb-badge/scb-badge';
|
|
|
6
6
|
export * from './scb-breadcrumb/scb-breadcrumb-item';
|
|
7
7
|
export * from './scb-breadcrumb/scb-breadcrumb';
|
|
8
8
|
export * from './scb-button/scb-button';
|
|
9
|
+
export * from './scb-calendar/scb-calendar-event';
|
|
10
|
+
export * from './scb-calendar/scb-calendar';
|
|
9
11
|
export * from './scb-calendar-card/scb-calendar-card';
|
|
10
12
|
export * from './scb-card/scb-card';
|
|
11
13
|
export * from './scb-checkbox/scb-checkbox-group';
|
package/index.js
CHANGED
|
@@ -5,67 +5,69 @@ import { ScbAvatar as b } from "./scb-avatar/scb-avatar.js";
|
|
|
5
5
|
import { ScbBadge as f } from "./scb-badge/scb-badge.js";
|
|
6
6
|
import { SCBBreadcrumbItem as i } from "./scb-breadcrumb/scb-breadcrumb-item.js";
|
|
7
7
|
import { SCBBreadcrumb as d } from "./scb-breadcrumb/scb-breadcrumb.js";
|
|
8
|
-
import { ScbButton as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
8
|
+
import { ScbButton as u } from "./scb-button/scb-button.js";
|
|
9
|
+
import { ScbCalendarEvent as s } from "./scb-calendar/scb-calendar-event.js";
|
|
10
|
+
import { ScbCalendar as B } from "./scb-calendar/scb-calendar.js";
|
|
11
|
+
import { ScbCalendarCard as D } from "./scb-calendar-card/scb-calendar-card.js";
|
|
12
|
+
import { ScbCard as T } from "./scb-card/scb-card.js";
|
|
13
|
+
import { ScbCheckboxGroup as F } from "./scb-checkbox/scb-checkbox-group.js";
|
|
14
|
+
import { ScbCheckbox as P } from "./scb-checkbox/scb-checkbox.js";
|
|
15
|
+
import { ScbChip as G } from "./scb-chip/scb-chip.js";
|
|
16
|
+
import { ScbCookiesConsent as A } from "./scb-cookies-consent/scb-cookies-consent.js";
|
|
17
|
+
import { ScbDatepicker as L } from "./scb-datepicker/scb-datepicker.js";
|
|
18
|
+
import { ScbDialog as z } from "./scb-dialog/scb-dialog.js";
|
|
19
|
+
import { ScbDivider as E } from "./scb-divider/scb-divider.js";
|
|
20
|
+
import { ScbDrawerItem as N } from "./scb-drawer/scb-drawer-item.js";
|
|
21
|
+
import { ScbDrawerSection as U } from "./scb-drawer/scb-drawer-section.js";
|
|
22
|
+
import { ScbDrawer as j } from "./scb-drawer/scb-drawer.js";
|
|
23
|
+
import { ScbSubDrawer as J } from "./scb-drawer/scb-sub-drawer.js";
|
|
24
|
+
import { ScbFactCardContent as W } from "./scb-fact-card/scb-fact-card-content.js";
|
|
25
|
+
import { ScbFactCard as Y } from "./scb-fact-card/scb-fact-card.js";
|
|
26
|
+
import { ScbFooterSection as _ } from "./scb-footer/scb-footer-section.js";
|
|
27
|
+
import { ScbFooter as rr } from "./scb-footer/scb-footer.js";
|
|
28
|
+
import { ScbGridItem as er } from "./scb-grid/scb-grid-item.js";
|
|
29
|
+
import { ScbGrid as cr } from "./scb-grid/scb-grid.js";
|
|
30
|
+
import { ScbStack as pr } from "./scb-grid/scb-stack.js";
|
|
31
|
+
import { ScbHeaderDrawerGroup as br } from "./scb-header/scb-header-drawer-group.js";
|
|
32
|
+
import { ScbHeaderDrawerItem as fr } from "./scb-header/scb-header-drawer-item.js";
|
|
33
|
+
import { ScbHeaderTab as ir } from "./scb-header/scb-header-tab.js";
|
|
34
|
+
import { ScbHeaderUtility as dr } from "./scb-header/scb-header-utility.js";
|
|
35
|
+
import { ScbHeader as ur } from "./scb-header/scb-header.js";
|
|
36
|
+
import { ScbHorizontalScroller as sr } from "./scb-horizontal-scroller/scb-horizontal-scroller.js";
|
|
37
|
+
import { ScbIconButton as Br } from "./scb-icon-button/scb-icon-button.js";
|
|
38
|
+
import { ScbKeyFigureCard as Dr } from "./scb-keyfigure-card/scb-keyfigure-card.js";
|
|
39
|
+
import { ScbLink as Tr } from "./scb-link/scb-link.js";
|
|
40
|
+
import { ScbListItem as Fr } from "./scb-list/scb-list-item.js";
|
|
41
|
+
import { ScbList as Pr } from "./scb-list/scb-list.js";
|
|
42
|
+
import { ScbMenuItem as Gr } from "./scb-menu/scb-menu-item.js";
|
|
43
|
+
import { ScbMenu as Ar } from "./scb-menu/scb-menu.js";
|
|
44
|
+
import { ScbSubMenu as Lr } from "./scb-menu/scb-sub-menu.js";
|
|
45
|
+
import { ScbNotificationCard as zr } from "./scb-notification-card/scb-notification-card.js";
|
|
46
|
+
import { ScbPagination as Er } from "./scb-pagination/scb-pagination.js";
|
|
47
|
+
import { ScbProgressIndicator as Nr } from "./scb-progress-indicator/scb-progress-indicator.js";
|
|
48
|
+
import { ScbProgressStep as Ur } from "./scb-progress-stepper/scb-progress-step.js";
|
|
49
|
+
import { ScbProgressStepper as jr } from "./scb-progress-stepper/scb-progress-stepper.js";
|
|
50
|
+
import { ScbRadioButton as Jr } from "./scb-radio-button/scb-radio-button.js";
|
|
51
|
+
import { ScbRadioGroup as Wr } from "./scb-radio-button/scb-radio-group.js";
|
|
52
|
+
import { ScbSearch as Yr } from "./scb-search/scb-search.js";
|
|
53
|
+
import { ScbSegmentedButton as _r } from "./scb-segmented-button/scb-segmented-button.js";
|
|
54
|
+
import { ScbSegmentedItem as ro } from "./scb-segmented-button/scb-segmented-item.js";
|
|
55
|
+
import { ScbSelectOption as eo } from "./scb-select/scb-select-option.js";
|
|
56
|
+
import { ScbSelect as co } from "./scb-select/scb-select.js";
|
|
57
|
+
import { ScbSkeleton as po } from "./scb-skeleton/scb-skeleton.js";
|
|
58
|
+
import { ScbSnackbar as bo } from "./scb-snackbar/scb-snackbar.js";
|
|
59
|
+
import { ScbStatusPill as fo } from "./scb-status-pill/scb-status-pill.js";
|
|
60
|
+
import { ScbStep as io } from "./scb-stepper/scb-step.js";
|
|
61
|
+
import { ScbStepper as Co } from "./scb-stepper/scb-stepper.js";
|
|
62
|
+
import { ScbSwitch as lo } from "./scb-switch/scb-switch.js";
|
|
63
|
+
import { ScbPrimaryTab as Io } from "./scb-tabs/scb-primary-tab.js";
|
|
64
|
+
import { ScbSecondaryTab as go } from "./scb-tabs/scb-secondary-tab.js";
|
|
65
|
+
import { ScbTabs as ko } from "./scb-tabs/scb-tabs.js";
|
|
66
|
+
import { ScbTextField as wo } from "./scb-textfield/scb-textfield.js";
|
|
67
|
+
import { ScbTocItem as Ho } from "./scb-toc/scb-toc-item.js";
|
|
68
|
+
import { ScbToc as ho } from "./scb-toc/scb-toc.js";
|
|
69
|
+
import { ScbTooltip as yo } from "./scb-tooltip/scb-tooltip.js";
|
|
70
|
+
import { ScbViz as vo } from "./scb-viz/scb-viz.js";
|
|
69
71
|
export {
|
|
70
72
|
d as SCBBreadcrumb,
|
|
71
73
|
i as SCBBreadcrumbItem,
|
|
@@ -74,65 +76,67 @@ export {
|
|
|
74
76
|
p as ScbAppBar,
|
|
75
77
|
b as ScbAvatar,
|
|
76
78
|
f as ScbBadge,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
G as
|
|
85
|
-
A as
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
Y as
|
|
93
|
-
W as
|
|
94
|
-
rr as
|
|
95
|
-
_ as
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
br as
|
|
100
|
-
fr as
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
sr as
|
|
104
|
-
Br as
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
Pr as
|
|
108
|
-
Fr as
|
|
109
|
-
Ar as
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
Jr as
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
fo as
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
79
|
+
u as ScbButton,
|
|
80
|
+
B as ScbCalendar,
|
|
81
|
+
D as ScbCalendarCard,
|
|
82
|
+
s as ScbCalendarEvent,
|
|
83
|
+
T as ScbCard,
|
|
84
|
+
P as ScbCheckbox,
|
|
85
|
+
F as ScbCheckboxGroup,
|
|
86
|
+
G as ScbChip,
|
|
87
|
+
A as ScbCookiesConsent,
|
|
88
|
+
L as ScbDatepicker,
|
|
89
|
+
z as ScbDialog,
|
|
90
|
+
E as ScbDivider,
|
|
91
|
+
j as ScbDrawer,
|
|
92
|
+
N as ScbDrawerItem,
|
|
93
|
+
U as ScbDrawerSection,
|
|
94
|
+
Y as ScbFactCard,
|
|
95
|
+
W as ScbFactCardContent,
|
|
96
|
+
rr as ScbFooter,
|
|
97
|
+
_ as ScbFooterSection,
|
|
98
|
+
cr as ScbGrid,
|
|
99
|
+
er as ScbGridItem,
|
|
100
|
+
ur as ScbHeader,
|
|
101
|
+
br as ScbHeaderDrawerGroup,
|
|
102
|
+
fr as ScbHeaderDrawerItem,
|
|
103
|
+
ir as ScbHeaderTab,
|
|
104
|
+
dr as ScbHeaderUtility,
|
|
105
|
+
sr as ScbHorizontalScroller,
|
|
106
|
+
Br as ScbIconButton,
|
|
107
|
+
Dr as ScbKeyFigureCard,
|
|
108
|
+
Tr as ScbLink,
|
|
109
|
+
Pr as ScbList,
|
|
110
|
+
Fr as ScbListItem,
|
|
111
|
+
Ar as ScbMenu,
|
|
112
|
+
Gr as ScbMenuItem,
|
|
113
|
+
zr as ScbNotificationCard,
|
|
114
|
+
Er as ScbPagination,
|
|
115
|
+
Io as ScbPrimaryTab,
|
|
116
|
+
Nr as ScbProgressIndicator,
|
|
117
|
+
Ur as ScbProgressStep,
|
|
118
|
+
jr as ScbProgressStepper,
|
|
119
|
+
Jr as ScbRadioButton,
|
|
120
|
+
Wr as ScbRadioGroup,
|
|
121
|
+
Yr as ScbSearch,
|
|
122
|
+
go as ScbSecondaryTab,
|
|
123
|
+
_r as ScbSegmentedButton,
|
|
124
|
+
ro as ScbSegmentedItem,
|
|
125
|
+
co as ScbSelect,
|
|
126
|
+
eo as ScbSelectOption,
|
|
127
|
+
po as ScbSkeleton,
|
|
128
|
+
bo as ScbSnackbar,
|
|
129
|
+
pr as ScbStack,
|
|
130
|
+
fo as ScbStatusPill,
|
|
131
|
+
io as ScbStep,
|
|
132
|
+
Co as ScbStepper,
|
|
133
|
+
J as ScbSubDrawer,
|
|
134
|
+
Lr as ScbSubMenu,
|
|
135
|
+
lo as ScbSwitch,
|
|
136
|
+
ko as ScbTabs,
|
|
137
|
+
wo as ScbTextField,
|
|
138
|
+
ho as ScbToc,
|
|
139
|
+
Ho as ScbTocItem,
|
|
140
|
+
yo as ScbTooltip,
|
|
141
|
+
vo as ScbViz
|
|
138
142
|
};
|
package/mvc/components/all.js
CHANGED
|
@@ -7,6 +7,8 @@ import './scb-breadcrumb/scb-breadcrumb.js';
|
|
|
7
7
|
import './scb-breadcrumb/scb-breadcrumb-item.js';
|
|
8
8
|
import './scb-button/scb-button.js';
|
|
9
9
|
import './scb-calendar-card/scb-calendar-card.js';
|
|
10
|
+
import './scb-calendar/scb-calendar.js';
|
|
11
|
+
import './scb-calendar/scb-calendar-event.js';
|
|
10
12
|
import './scb-card/scb-card.js';
|
|
11
13
|
import './scb-checkbox/scb-checkbox.js';
|
|
12
14
|
import './scb-checkbox/scb-checkbox-group.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{a as p,n as d,i as c,x as f,t as _}from"../../vendor/vendor.js";(function(){try{var a=typeof globalThis<"u"?globalThis:window;if(!a.__scb_ce_guard_installed__){a.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(e,i,t){try{customElements.get(e)||r(e,i,t)}catch(n){var s=String(n||"");if(s.indexOf("already been used")===-1&&s.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var u=Object.defineProperty,h=Object.getOwnPropertyDescriptor,l=(a,r,e,i)=>{for(var t=i>1?void 0:i?h(r,e):r,s=a.length-1,n;s>=0;s--)(n=a[s])&&(t=(i?n(r,e,t):n(t))||t);return i&&t&&u(r,e,t),t};let o=class extends c{constructor(){super(...arguments),this.title="",this.date="",this.description=""}render(){return f`
|
|
2
|
+
<div>
|
|
3
|
+
<h3>${this.title}</h3>
|
|
4
|
+
<p>${this.date}</p>
|
|
5
|
+
<p>${this.description}</p>
|
|
6
|
+
</div>
|
|
7
|
+
`}};o.styles=p`
|
|
8
|
+
:host {
|
|
9
|
+
display: block;
|
|
10
|
+
font-family: var(--brand-font, Arial, sans-serif)
|
|
11
|
+
}
|
|
12
|
+
`;l([d({type:String})],o.prototype,"title",2);l([d({type:String})],o.prototype,"date",2);l([d({type:String})],o.prototype,"description",2);o=l([_("scb-calendar-event")],o);
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import{a as x,n as m,i as w,x as d,t as $}from"../../vendor/vendor.js";import"./scb-calendar-event.js";import"../scb-icon-button/scb-icon-button.js";import"../../vendor/preload-helper.js";import"../../vendor/vendor-material.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(n,s,a){try{customElements.get(n)||e(n,s,a)}catch(i){var l=String(i||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();var M=Object.defineProperty,D=Object.getOwnPropertyDescriptor,g=(t,e,n,s)=>{for(var a=s>1?void 0:s?D(e,n):e,l=t.length-1,i;l>=0;l--)(i=t[l])&&(a=(s?i(e,n,a):i(a))||a);return s&&a&&M(e,n,a),a};let v=class extends w{constructor(){super(...arguments),this.label="",this.value="",this._today=new Date,this._current=new Date,this._popupEvent=null}_daysInMonth(t,e){return new Date(t,e+1,0).getDate()}_firstDayOfWeek(t,e){return new Date(t,e,1).getDay()}_prevMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()-1,1),this.requestUpdate()}_nextMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()+1,1),this.requestUpdate()}_showEventPopup(t){this._popupEvent=t,this.requestUpdate(),setTimeout(()=>{const e=n=>{n.target?.closest(".event-popup")||this._closePopup()};window.addEventListener("mousedown",e,{once:!0})},0)}_closePopup(){this._popupEvent=null,this.requestUpdate()}render(){const t=this._current.getFullYear(),e=this._current.getMonth(),n=this._daysInMonth(t,e),s=this._firstDayOfWeek(t,e),a=this._today,l=Array.from(this.querySelectorAll("scb-calendar-event")),i=new Map;for(const r of l)if(r.date&&r.title){const p=i.get(r.date)||[];p.push({title:r.title,description:r.description}),i.set(r.date,p)}const f=[];let c=1;for(let r=0;r<6;r++){const p=[];for(let h=0;h<7;h++)if(r===0&&h<s){const b=e===0?11:e-1,y=e===0?t-1:t,u=this._daysInMonth(y,b)-(s-h-1);p.push(d`
|
|
2
|
+
<div class="calendar-day calendar-day--other">
|
|
3
|
+
<span class="calendar-day-number">${u}</span>
|
|
4
|
+
</div>
|
|
5
|
+
`)}else if(c>n)p.push(d`<div></div>`);else{const b=a.getFullYear()===t&&a.getMonth()===e&&a.getDate()===c,y=`${t}-${String(e+1).padStart(2,"0")}-${String(c).padStart(2,"0")}`,o=i.get(y)||[];p.push(d`
|
|
6
|
+
<div
|
|
7
|
+
class="calendar-day${b?" today":""}${o.length?" has-event":""}"
|
|
8
|
+
@click=${o.length?()=>this._showEventPopup({date:y,events:o}):null}
|
|
9
|
+
title=${o.length===1?o[0].title:o.length>1?o.map(u=>u.title).join(", "):""}
|
|
10
|
+
>
|
|
11
|
+
<span class="calendar-day-number">${c}</span>
|
|
12
|
+
<div class="calendar-titles-wrapper">
|
|
13
|
+
${o.map(u=>d`<span class="calendar-day-event-title">${u.title}</span>`)}
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
`),c++}if(f.push(d`<div class="calendar-grid">${p}</div>`),c>n)break}const _=["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];return d`
|
|
17
|
+
<div class="calendar-header">
|
|
18
|
+
<scb-icon-button @click=${this._prevMonth} icon="chevron_left" aria-label="Föregående månad"></scb-icon-button>
|
|
19
|
+
<span>${_[e]} ${t}</span>
|
|
20
|
+
<scb-icon-button @click=${this._nextMonth} icon="chevron_right" aria-label="Nästa månad"></scb-icon-button>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="calendar-grid calendar-grid-days">
|
|
23
|
+
<div>Mån</div><div>Tis</div><div>Ons</div><div>Tor</div><div>Fre</div><div>Lör</div><div>Sön</div>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="calendar-weeks">
|
|
26
|
+
${f}
|
|
27
|
+
<div>
|
|
28
|
+
${this._popupEvent&&Array.isArray(this._popupEvent.events)?d`
|
|
29
|
+
<div class="event-popup-backdrop" @click=${this._closePopup}></div>
|
|
30
|
+
<div class="event-popup">
|
|
31
|
+
<button class="close-btn" @click=${this._closePopup} title="Stäng">×</button>
|
|
32
|
+
<div>${this._popupEvent.date}</div>
|
|
33
|
+
<ul>
|
|
34
|
+
${this._popupEvent.events.map(r=>d`<li><strong>${r.title}</strong>${r.description?d`<div>${r.description}</div>`:""}</li>`)}
|
|
35
|
+
</ul>
|
|
36
|
+
</div>
|
|
37
|
+
`:""}
|
|
38
|
+
`}};v.styles=x`
|
|
39
|
+
:host {
|
|
40
|
+
display: block;
|
|
41
|
+
font-family: var(--brand-font, Arial, sans-serif);
|
|
42
|
+
background: var(--md-sys-color-surface, #fff);
|
|
43
|
+
color: var(--md-sys-color-on-surface, #222);
|
|
44
|
+
border-radius: 12px;
|
|
45
|
+
border: var(--scb-elevation-2, 0 2px 8px rgba(0,0,0,0.08));
|
|
46
|
+
padding: 16px;
|
|
47
|
+
}
|
|
48
|
+
.calendar-header {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: space-between;
|
|
52
|
+
margin-bottom: 16px;
|
|
53
|
+
border-bottom: 1px solid rgb(224, 224, 224);
|
|
54
|
+
padding-bottom: 8px;
|
|
55
|
+
}
|
|
56
|
+
.calendar-grid {
|
|
57
|
+
display: grid;
|
|
58
|
+
grid-template-columns: repeat(7, 1fr);
|
|
59
|
+
gap: 4px;
|
|
60
|
+
margin-bottom: 4px;
|
|
61
|
+
}
|
|
62
|
+
.calendar-grid-days{
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
margin-bottom: 16px;
|
|
65
|
+
}
|
|
66
|
+
.calendar-weeks {
|
|
67
|
+
display: grid;
|
|
68
|
+
grid-auto-rows: 1fr;
|
|
69
|
+
}
|
|
70
|
+
.calendar-titles-wrapper{
|
|
71
|
+
display: grid;
|
|
72
|
+
gap: 4px;
|
|
73
|
+
}
|
|
74
|
+
.calendar-day {
|
|
75
|
+
border-radius: 6px;
|
|
76
|
+
min-height: 3.2em;
|
|
77
|
+
display: flex;
|
|
78
|
+
padding: 8px;
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
gap: 8px;
|
|
82
|
+
border: 1px solid #e0e0e0;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
}
|
|
85
|
+
.calendar-day--other {
|
|
86
|
+
opacity: 0.4;
|
|
87
|
+
}
|
|
88
|
+
.calendar-day-number {
|
|
89
|
+
font-size: 1em;
|
|
90
|
+
line-height: 1.2;
|
|
91
|
+
}
|
|
92
|
+
.calendar-day-event-title {
|
|
93
|
+
font-size: 12px;
|
|
94
|
+
color: var(--md-sys-color-primary);
|
|
95
|
+
white-space: nowrap;
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
text-overflow: ellipsis;
|
|
98
|
+
display: block;
|
|
99
|
+
width: 100%;
|
|
100
|
+
}
|
|
101
|
+
.calendar-day.today {
|
|
102
|
+
border: 1px solid var(--md-sys-color-primary);
|
|
103
|
+
}
|
|
104
|
+
.calendar-day.has-event {
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
border: 2px solid var(--md-sys-color-primary);
|
|
107
|
+
position: relative;
|
|
108
|
+
}
|
|
109
|
+
.event-popup {
|
|
110
|
+
position: fixed;
|
|
111
|
+
z-index: 1000;
|
|
112
|
+
background: #fff;
|
|
113
|
+
color: #222;
|
|
114
|
+
border-radius: 10px;
|
|
115
|
+
box-shadow: 0 4px 24px rgba(0,0,0,0.18);
|
|
116
|
+
min-width: 220px;
|
|
117
|
+
max-width: 320px;
|
|
118
|
+
padding: 16px 20px 16px 20px;
|
|
119
|
+
top: 30%;
|
|
120
|
+
left: 50%;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
`;g([m({type:String})],v.prototype,"label",2);g([m({type:String})],v.prototype,"value",2);v=g([$("scb-calendar")],v);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.118",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -103,6 +103,14 @@
|
|
|
103
103
|
"import": "./scb-button/scb-button.js",
|
|
104
104
|
"require": "./scb-button/scb-button.js"
|
|
105
105
|
},
|
|
106
|
+
"./scb-calendar": {
|
|
107
|
+
"import": "./scb-calendar/scb-calendar.js",
|
|
108
|
+
"require": "./scb-calendar/scb-calendar.js"
|
|
109
|
+
},
|
|
110
|
+
"./scb-calendar/scb-calendar-event": {
|
|
111
|
+
"import": "./scb-calendar/scb-calendar-event.js",
|
|
112
|
+
"require": "./scb-calendar/scb-calendar-event.js"
|
|
113
|
+
},
|
|
106
114
|
"./scb-calendar-card": {
|
|
107
115
|
"import": "./scb-calendar-card/scb-calendar-card.js",
|
|
108
116
|
"require": "./scb-calendar-card/scb-calendar-card.js"
|
|
@@ -345,5 +353,5 @@
|
|
|
345
353
|
},
|
|
346
354
|
"./mvc/*": "./mvc/*"
|
|
347
355
|
},
|
|
348
|
-
"buildHash": "
|
|
356
|
+
"buildHash": "5163F09E157CFC736420587AFE2434E158CD391731A5E8185003D695ECA7F8C9"
|
|
349
357
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { css as c, LitElement as d, html as f } from "lit";
|
|
2
|
+
import { property as l, customElement as h } from "lit/decorators.js";
|
|
3
|
+
var v = Object.defineProperty, m = Object.getOwnPropertyDescriptor, p = (a, r, i, s) => {
|
|
4
|
+
for (var t = s > 1 ? void 0 : s ? m(r, i) : r, o = a.length - 1, n; o >= 0; o--)
|
|
5
|
+
(n = a[o]) && (t = (s ? n(r, i, t) : n(t)) || t);
|
|
6
|
+
return s && t && v(r, i, t), t;
|
|
7
|
+
};
|
|
8
|
+
let e = class extends d {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments), this.title = "", this.date = "", this.description = "";
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
return f`
|
|
14
|
+
<div>
|
|
15
|
+
<h3>${this.title}</h3>
|
|
16
|
+
<p>${this.date}</p>
|
|
17
|
+
<p>${this.description}</p>
|
|
18
|
+
</div>
|
|
19
|
+
`;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
e.styles = c`
|
|
23
|
+
:host {
|
|
24
|
+
display: block;
|
|
25
|
+
font-family: var(--brand-font, Arial, sans-serif)
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
p([
|
|
29
|
+
l({ type: String })
|
|
30
|
+
], e.prototype, "title", 2);
|
|
31
|
+
p([
|
|
32
|
+
l({ type: String })
|
|
33
|
+
], e.prototype, "date", 2);
|
|
34
|
+
p([
|
|
35
|
+
l({ type: String })
|
|
36
|
+
], e.prototype, "description", 2);
|
|
37
|
+
e = p([
|
|
38
|
+
h("scb-calendar-event")
|
|
39
|
+
], e);
|
|
40
|
+
export {
|
|
41
|
+
e as ScbCalendarEvent
|
|
42
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class ScbCalendar extends LitElement {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
static styles: import('lit').CSSResult;
|
|
6
|
+
private _today;
|
|
7
|
+
private _current;
|
|
8
|
+
private _popupEvent;
|
|
9
|
+
private _daysInMonth;
|
|
10
|
+
private _firstDayOfWeek;
|
|
11
|
+
private _prevMonth;
|
|
12
|
+
private _nextMonth;
|
|
13
|
+
private _showEventPopup;
|
|
14
|
+
private _closePopup;
|
|
15
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
16
|
+
}
|