scb-wc-test 0.1.116 → 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/mvc/components/scb-textfield/scb-textfield.js +40 -59
- 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-textfield/scb-textfield.js +52 -65
- package/scb-wc-test.bundle.js +551 -437
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);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as v,n as a,r as x,i as g,x as d,t as y}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-datepicker/scb-datepicker.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";import"../scb-divider/scb-divider.js";import"../../vendor/preload-helper.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(i,l,n){try{customElements.get(i)||e(i,l,n)}catch(h){var p=String(h||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw h}}}}catch{}})();var _=Object.defineProperty,w=Object.getOwnPropertyDescriptor,m=t=>{throw TypeError(t)},r=(t,e,i,l)=>{for(var n=l>1?void 0:l?w(e,i):e,p=t.length-1,h;p>=0;p--)(h=t[p])&&(n=(l?h(e,i,n):h(n))||n);return l&&n&&_(e,i,n),n},$=(t,e,i)=>e.has(t)||m("Cannot "+i),k=(t,e,i)=>e.has(t)?m("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),c=(t,e,i)=>($(t,e,"access private method"),i),o,f,b,u;let s=class extends g{constructor(){super(),k(this,o),this._internals=null,this._inputFocused=!1,this._kbShouldShowRing=!1,this._onGlobalKeydown=t=>{t.key==="Tab"&&(this._kbShouldShowRing=!0,this._inputFocused&&c(this,o,u).call(this))},this._onGlobalPointerDown=()=>{this._kbShouldShowRing=!1,this._inputFocused&&c(this,o,u).call(this)},this.type="text",this.label="",this.supportingText="",this.errorText="",this.leadingIcon="",this.name="",this.pattern="",this.value="",this.underLabel="",this.error=!1,this.disabled=!1,this.required=!1,this.spacing="",this.spacingTop="",this.spacingBottom="",this._form=null,this._formSubmitHandler=null,this._formResetHandler=null,this._initialValue="",this._inputId="",this._showDatepicker=!1,this._toggleDatepicker=()=>{this._showDatepicker=!this._showDatepicker},this._onDateSelected=t=>{if(this.value=t.detail.value,this._showDatepicker=!1,this._internals){const e=this.disabled?null:this.value;this._internals.setFormValue(e)}if(this.pattern){const e=new RegExp(this.pattern);this.error=!e.test(this.value)}this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("onValueChanged",{detail:{value:this.value},bubbles:!0,composed:!0}))},"attachInternals"in this&&(this._internals=this.attachInternals())}render(){const t=this.leadingIcon?d`<md-icon class="scb-textfield-icon">${this.leadingIcon}</md-icon>`:null,e=this.error?d`<md-icon class="scb-textfield-error-icon" aria-hidden="true">error</md-icon>`:null;this.underLabel=this.error?this.errorText||"Ogiltig inmatning.":this.supportingText,this.value=this.value||"";const i=this.underLabel?`${this._inputId}-supporting-text`:void 0,l=this.type==="search"&&this.value?d`
|
|
1
|
+
import{a as v,n as a,r as x,i as g,x as d,t as y}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-datepicker/scb-datepicker.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";import"../scb-divider/scb-divider.js";import"../../vendor/preload-helper.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(i,l,n){try{customElements.get(i)||e(i,l,n)}catch(h){var p=String(h||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw h}}}}catch{}})();var _=Object.defineProperty,w=Object.getOwnPropertyDescriptor,m=t=>{throw TypeError(t)},r=(t,e,i,l)=>{for(var n=l>1?void 0:l?w(e,i):e,p=t.length-1,h;p>=0;p--)(h=t[p])&&(n=(l?h(e,i,n):h(n))||n);return l&&n&&_(e,i,n),n},$=(t,e,i)=>e.has(t)||m("Cannot "+i),k=(t,e,i)=>e.has(t)?m("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),c=(t,e,i)=>($(t,e,"access private method"),i),o,f,b,u;let s=class extends g{constructor(){super(),k(this,o),this._internals=null,this._inputFocused=!1,this._kbShouldShowRing=!1,this._onGlobalKeydown=t=>{t.key==="Tab"&&(this._kbShouldShowRing=!0,this._inputFocused&&c(this,o,u).call(this))},this._onGlobalPointerDown=()=>{this._kbShouldShowRing=!1,this._inputFocused&&c(this,o,u).call(this)},this.type="text",this.label="",this.supportingText="",this.errorText="",this.leadingIcon="",this.name="",this.pattern="",this.value="",this.underLabel="",this.error=!1,this.disabled=!1,this.required=!1,this.spacing="",this.spacingTop="",this.spacingBottom="",this._form=null,this._formSubmitHandler=null,this._formResetHandler=null,this._initialValue="",this._inputId="",this._showDatepicker=!1,this._toggleDatepicker=()=>{this._showDatepicker=!this._showDatepicker},this._onDateSelected=t=>{if(this.value=t.detail.value,this._showDatepicker=!1,this._internals){const e=this.disabled?null:this.value;this._internals.setFormValue(e)}if(this.pattern)if(!this.value)this.error=!1;else{const e=new RegExp(this.pattern);this.error=!e.test(this.value)}this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("onValueChanged",{detail:{value:this.value},bubbles:!0,composed:!0}))},"attachInternals"in this&&(this._internals=this.attachInternals())}render(){const t=this.leadingIcon?d`<md-icon class="scb-textfield-icon">${this.leadingIcon}</md-icon>`:null,e=this.error?d`<md-icon class="scb-textfield-error-icon" aria-hidden="true">error</md-icon>`:null;this.underLabel=this.error?this.errorText||"Ogiltig inmatning.":this.supportingText,this.value=this.value||"";const i=this.underLabel?`${this._inputId}-supporting-text`:void 0,l=this.type==="search"&&this.value?d`
|
|
2
2
|
<button
|
|
3
3
|
type="button"
|
|
4
4
|
class="scb-textfield-clear"
|
|
@@ -6,30 +6,9 @@ import{a as v,n as a,r as x,i as g,x as d,t as y}from"../../vendor/vendor.js";im
|
|
|
6
6
|
aria-label="Rensa fält"
|
|
7
7
|
>
|
|
8
8
|
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
|
9
|
-
<circle
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
r="10"
|
|
13
|
-
fill="none"
|
|
14
|
-
stroke="currentColor"
|
|
15
|
-
stroke-width="2"
|
|
16
|
-
></circle>
|
|
17
|
-
<line
|
|
18
|
-
x1="8"
|
|
19
|
-
y1="8"
|
|
20
|
-
x2="16"
|
|
21
|
-
y2="16"
|
|
22
|
-
stroke="currentColor"
|
|
23
|
-
stroke-width="2"
|
|
24
|
-
></line>
|
|
25
|
-
<line
|
|
26
|
-
x1="16"
|
|
27
|
-
y1="8"
|
|
28
|
-
x2="8"
|
|
29
|
-
y2="16"
|
|
30
|
-
stroke="currentColor"
|
|
31
|
-
stroke-width="2"
|
|
32
|
-
></line>
|
|
9
|
+
<circle cx="12" cy="12" r="10" fill="none" stroke="currentColor" stroke-width="2"></circle>
|
|
10
|
+
<line x1="8" y1="8" x2="16" y2="16" stroke="currentColor" stroke-width="2"></line>
|
|
11
|
+
<line x1="16" y1="8" x2="8" y2="16" stroke="currentColor" stroke-width="2"></line>
|
|
33
12
|
</svg>
|
|
34
13
|
</button>
|
|
35
14
|
`:null;return this.type==="textarea"?d`
|
|
@@ -84,12 +63,13 @@ ${this.value}</textarea
|
|
|
84
63
|
<md-focus-ring class="input-ring"></md-focus-ring>
|
|
85
64
|
</div>
|
|
86
65
|
${this.error?e:d`
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
66
|
+
<scb-icon-button
|
|
67
|
+
class="scb-textfield-datepicker-button"
|
|
68
|
+
icon="calendar_today"
|
|
69
|
+
@click=${this._toggleDatepicker}
|
|
70
|
+
aria-label="Välj datum"
|
|
71
|
+
></scb-icon-button>
|
|
72
|
+
`}
|
|
93
73
|
<scb-datepicker
|
|
94
74
|
.selectedValue=${this.value}
|
|
95
75
|
.open=${this._showDatepicker}
|
|
@@ -105,33 +85,34 @@ ${this.value}</textarea
|
|
|
105
85
|
>
|
|
106
86
|
<div class="scb-textfield-wrapper" style="position:relative;">
|
|
107
87
|
${t}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
88
|
+
<div class="ripple-wrapper">
|
|
89
|
+
<input
|
|
90
|
+
class="scb-textfield${this.error?" has-error-icon":""}"
|
|
91
|
+
.value=${this.value}
|
|
92
|
+
type="text"
|
|
93
|
+
name="${this.name}"
|
|
94
|
+
id="${this._inputId}"
|
|
95
|
+
?disabled=${this.disabled}
|
|
96
|
+
?required=${this.required}
|
|
97
|
+
aria-invalid=${this.error?"true":"false"}
|
|
98
|
+
aria-describedby=${i}
|
|
99
|
+
readonly
|
|
100
|
+
@focus=${this._toggleDatepicker}
|
|
101
|
+
@click=${this._toggleDatepicker}
|
|
102
|
+
/>
|
|
103
|
+
|
|
104
|
+
<md-ripple></md-ripple>
|
|
105
|
+
<md-focus-ring class="input-ring"></md-focus-ring>
|
|
126
106
|
</div>
|
|
127
107
|
|
|
128
108
|
${this.error?e:d`
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
109
|
+
<scb-icon-button
|
|
110
|
+
class="scb-textfield-datepicker-button"
|
|
111
|
+
icon="calendar_today"
|
|
112
|
+
@click=${this._toggleDatepicker}
|
|
113
|
+
aria-label="Välj datum"
|
|
114
|
+
></scb-icon-button>
|
|
115
|
+
`}
|
|
135
116
|
<scb-datepicker
|
|
136
117
|
variant="datetime-local"
|
|
137
118
|
.selectedValue=${this.value}
|
|
@@ -193,7 +174,7 @@ ${this.value}</textarea
|
|
|
193
174
|
<md-focus-ring class="input-ring"></md-focus-ring>
|
|
194
175
|
</div>
|
|
195
176
|
</div>
|
|
196
|
-
`}firstUpdated(t){super.firstUpdated(t),this._initialValue=this.value;const e=this.shadowRoot?.querySelector(".scb-textfield");e&&(e.addEventListener("input",()=>{const i=e;if(this.value=i.value,this._internals){const l=this.disabled?null:this.value;this._internals.setFormValue(l)}if(this.pattern){const l=new RegExp(this.pattern);this.error=!l.test(this.value)}this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("onValueChanged",{detail:{value:this.value},bubbles:!0,composed:!0}))}),e.addEventListener("change",()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),e.addEventListener("select",()=>{this.dispatchEvent(new Event("select",{bubbles:!0,composed:!0}))}),e.addEventListener("focus",()=>{this._inputFocused=!0,c(this,o,u).call(this)}),e.addEventListener("blur",()=>{this._inputFocused=!1,c(this,o,u).call(this)})),c(this,o,f).call(this)}updated(t){if(super.updated(t),this.toggleAttribute("aria-disabled",this.disabled),this._internals&&(t.has("value")||t.has("disabled"))){const e=this.disabled?null:this.value;this._internals.setFormValue(e)}(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&c(this,o,f).call(this)}formDisabledCallback(t){this.disabled=t}connectedCallback(){super.connectedCallback(),this._inputId=this.id||`scb-textfield-${Math.random().toString(36).substr(2,9)}`,this._formSubmitHandler=t=>{this.reportValidity()||(t.preventDefault(),t.stopPropagation())},this._form=this.closest("form"),this._form&&(this._form.addEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler=()=>{this.value=this._initialValue;const t=this.shadowRoot?.querySelector(".scb-textfield");t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&(t.value=this._initialValue),this.error=!1},this._form.addEventListener("reset",this._formResetHandler,!0)),window.addEventListener("keydown",this._onGlobalKeydown,!0),window.addEventListener("pointerdown",this._onGlobalPointerDown,!0)}disconnectedCallback(){super.disconnectedCallback(),this._form&&this._formSubmitHandler&&(this._form.removeEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0)),window.removeEventListener("keydown",this._onGlobalKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalPointerDown,!0)}reportValidity(){const t=this.shadowRoot?.querySelector(".scb-textfield");if(t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)){this.required&&!t.value?t.setCustomValidity(this.errorText||"Ogiltig inmatning."):t.setCustomValidity("");const e=t.reportValidity();this.error=!e;const i=e?"":this.errorText||t.validationMessage||"Ogiltig inmatning.";return e||(this.errorText=i),this._internals&&(e?this._internals.setValidity({}):this._internals.setValidity({customError:!0},i,t)),e}return!0}_onClearClick(){const t=this.shadowRoot?.querySelector(".scb-textfield");if(t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)){if(t.value="",this.value="",this._internals){const e=this.disabled?null:this.value;this._internals.setFormValue(e),this._internals.setValidity({})}this.error=!1,t.setCustomValidity(""),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("onValueChanged",{detail:{value:this.value},bubbles:!0,composed:!0})),t.focus()}}};o=new WeakSet;f=function(){const t=c(this,o,b).call(this,this.spacing),e=c(this,o,b).call(this,this.spacingTop)??t,i=c(this,o,b).call(this,this.spacingBottom)??t;e?this.style.setProperty("--scb-textfield-spacing-block-start",e):this.style.removeProperty("--scb-textfield-spacing-block-start"),i?this.style.setProperty("--scb-textfield-spacing-block-end",i):this.style.removeProperty("--scb-textfield-spacing-block-end")};b=function(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e};u=function(){const t=this.renderRoot?.querySelector(".ripple-wrapper");t&&(this._inputFocused&&this._kbShouldShowRing?t.setAttribute("data-kb-focus","true"):t.removeAttribute("data-kb-focus"))};s.formAssociated=!0;s.styles=[v`
|
|
177
|
+
`}firstUpdated(t){super.firstUpdated(t),this._initialValue=this.value;const e=this.shadowRoot?.querySelector(".scb-textfield");e&&(e.addEventListener("input",()=>{const i=e;if(this.value=i.value,this._internals){const l=this.disabled?null:this.value;this._internals.setFormValue(l)}if(this.pattern)if(!this.value)this.error=!1;else{const l=new RegExp(this.pattern);this.error=!l.test(this.value)}this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("onValueChanged",{detail:{value:this.value},bubbles:!0,composed:!0}))}),e.addEventListener("change",()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),e.addEventListener("select",()=>{this.dispatchEvent(new Event("select",{bubbles:!0,composed:!0}))}),e.addEventListener("focus",()=>{this._inputFocused=!0,c(this,o,u).call(this)}),e.addEventListener("blur",()=>{this._inputFocused=!1,c(this,o,u).call(this)})),c(this,o,f).call(this)}updated(t){if(super.updated(t),this.toggleAttribute("aria-disabled",this.disabled),this._internals&&(t.has("value")||t.has("disabled"))){const e=this.disabled?null:this.value;this._internals.setFormValue(e)}(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&c(this,o,f).call(this)}formDisabledCallback(t){this.disabled=t}connectedCallback(){super.connectedCallback(),this._inputId=this.id||`scb-textfield-${Math.random().toString(36).substr(2,9)}`,this._formSubmitHandler=t=>{this.reportValidity()||(t.preventDefault(),t.stopPropagation())},this._form=this.closest("form"),this._form&&(this._form.addEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler=()=>{this.value=this._initialValue;const t=this.shadowRoot?.querySelector(".scb-textfield");t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&(t.value=this._initialValue),this.error=!1},this._form.addEventListener("reset",this._formResetHandler,!0)),window.addEventListener("keydown",this._onGlobalKeydown,!0),window.addEventListener("pointerdown",this._onGlobalPointerDown,!0)}disconnectedCallback(){super.disconnectedCallback(),this._form&&this._formSubmitHandler&&(this._form.removeEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0)),window.removeEventListener("keydown",this._onGlobalKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalPointerDown,!0)}reportValidity(){const t=this.shadowRoot?.querySelector(".scb-textfield");if(t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)){this.required&&!t.value?t.setCustomValidity(this.errorText||"Ogiltig inmatning."):t.setCustomValidity("");const e=t.reportValidity();this.error=!e;const i=e?"":this.errorText||t.validationMessage||"Ogiltig inmatning.";return e||(this.errorText=i),this._internals&&(e?this._internals.setValidity({}):this._internals.setValidity({customError:!0},i,t)),e}return!0}_onClearClick(){const t=this.shadowRoot?.querySelector(".scb-textfield");if(t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)){if(t.value="",this.value="",this._internals){const e=this.disabled?null:this.value;this._internals.setFormValue(e),this._internals.setValidity({})}this.error=!1,t.setCustomValidity(""),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("onValueChanged",{detail:{value:this.value},bubbles:!0,composed:!0})),t.focus()}}};o=new WeakSet;f=function(){const t=c(this,o,b).call(this,this.spacing),e=c(this,o,b).call(this,this.spacingTop)??t,i=c(this,o,b).call(this,this.spacingBottom)??t;e?this.style.setProperty("--scb-textfield-spacing-block-start",e):this.style.removeProperty("--scb-textfield-spacing-block-start"),i?this.style.setProperty("--scb-textfield-spacing-block-end",i):this.style.removeProperty("--scb-textfield-spacing-block-end")};b=function(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e};u=function(){const t=this.renderRoot?.querySelector(".ripple-wrapper");t&&(this._inputFocused&&this._kbShouldShowRing?t.setAttribute("data-kb-focus","true"):t.removeAttribute("data-kb-focus"))};s.formAssociated=!0;s.styles=[v`
|
|
197
178
|
:host {
|
|
198
179
|
--scb-textfield-number-max-width: 280px;
|
|
199
180
|
--scb-textfield-text-max-width: 400px;
|
|
@@ -249,9 +230,9 @@ ${this.value}</textarea
|
|
|
249
230
|
:host([type='time']) {
|
|
250
231
|
--scb-textfield-max-width: var(--scb-textfield-text-max-width);
|
|
251
232
|
}
|
|
252
|
-
input[type=
|
|
253
|
-
|
|
254
|
-
|
|
233
|
+
input[type='time']::-webkit-calendar-picker-indicator {
|
|
234
|
+
display: none;
|
|
235
|
+
background: none;
|
|
255
236
|
}
|
|
256
237
|
|
|
257
238
|
:host {
|