scb-wc-test 0.1.358 → 0.1.360
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/mvc/components/scb-app-bar/scb-app-bar.js +32 -51
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +6 -6
- package/mvc/components/scb-card/scb-card.js +79 -79
- package/mvc/components/scb-fact-card/scb-fact-card-content.js +6 -6
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +1 -0
- package/mvc/components/scb-notification-card/scb-notification-card.js +6 -6
- package/mvc/components/scb-viz/scb-viz.js +2 -2
- package/package.json +2 -2
- package/scb-app-bar/scb-app-bar.d.ts +1 -0
- package/scb-app-bar/scb-app-bar.js +110 -123
- package/scb-calendar-card/scb-calendar-card.d.ts +1 -0
- package/scb-calendar-card/scb-calendar-card.js +24 -18
- package/scb-card/scb-card.d.ts +1 -0
- package/scb-card/scb-card.js +119 -108
- package/scb-fact-card/scb-fact-card-content.d.ts +2 -0
- package/scb-fact-card/scb-fact-card-content.js +30 -21
- package/scb-horizontal-scroller/scb-horizontal-scroller.js +1 -0
- package/scb-notification-card/scb-notification-card.d.ts +2 -0
- package/scb-notification-card/scb-notification-card.js +111 -102
- package/scb-viz/scb-viz.js +2 -2
- package/scb-wc-test.bundle.js +577 -595
|
@@ -1,68 +1,64 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as $,n as h,i as E,x as f,t as k}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";import"../scb-search/scb-search.js";import"../scb-avatar/scb-avatar.js";import"../../vendor/preload-helper.js";import"../../vendor/vendor-material.js";import"../scb-list/scb-list.js";import"../scb-list/scb-list-item.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,s,n){try{customElements.get(i)||e(i,s,n)}catch(o){var c=String(o||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var O=Object.defineProperty,B=Object.getOwnPropertyDescriptor,_=t=>{throw TypeError(t)},p=(t,e,i,s)=>{for(var n=s>1?void 0:s?B(e,i):e,c=t.length-1,o;c>=0;c--)(o=t[c])&&(n=(s?o(e,i,n):o(n))||n);return s&&n&&O(e,i,n),n},S=(t,e,i)=>e.has(t)||_("Cannot "+i),g=(t,e,i)=>(S(t,e,"read from private field"),i?i.call(t):e.get(t)),P=(t,e,i)=>e.has(t)?_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),r=(t,e,i)=>(S(t,e,"access private method"),i),a,m,b,u,v,x,y,d;let l=class extends E{constructor(){super(...arguments),P(this,a),this.title="",this.appBarTitle="",this.type="default",this.position="default",this.searchSupportingText="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__titleResizeRaf=0}connectedCallback(){super.connectedCallback(),typeof ResizeObserver<"u"&&(this.__titleResizeObserver=new ResizeObserver(()=>r(this,a,m).call(this)))}disconnectedCallback(){this.__titleResizeRaf&&(cancelAnimationFrame(this.__titleResizeRaf),this.__titleResizeRaf=0),this.__titleResizeObserver?.disconnect(),this.__titleResizeObserver=void 0,super.disconnectedCallback()}handleActionsSlotChange(t){t.target.assignedElements({flatten:!0}).forEach(s=>{if(s.tagName==="SCB-BUTTON"){const n=s;n.hasAttribute("size")||n.setAttribute("size","small")}}),r(this,a,m).call(this)}handleAvatarSlotChange(t){t.target.assignedElements({flatten:!0}).forEach(s=>{s.tagName==="SCB-AVATAR"&&s.setAttribute("size","small")}),r(this,a,m).call(this)}firstUpdated(){r(this,a,y).call(this),r(this,a,b).call(this)}updated(t){(t.has("title")||t.has("appBarTitle"))&&(this.dispatchEvent(new CustomEvent("title-changed",{detail:{title:g(this,a,d)},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("app-bar-title-changed",{detail:{appBarTitle:g(this,a,d)},bubbles:!0,composed:!0}))),t.has("position")&&this.dispatchEvent(new CustomEvent("position-changed",{detail:{position:this.position},bubbles:!0,composed:!0})),t.has("type")&&(this.dispatchEvent(new CustomEvent("type-changed",{detail:{type:this.type},bubbles:!0,composed:!0})),r(this,a,b).call(this)),t.has("searchSupportingText")&&this.dispatchEvent(new CustomEvent("search-supporting-text-changed",{detail:{searchSupportingText:this.searchSupportingText},bubbles:!0,composed:!0})),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&r(this,a,y).call(this)}mapSpacingToken(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}render(){switch(this.type){case"small-flexible":return f`
|
|
2
2
|
<header class="small-flexible ${this.position=="bottom"?"position-bottom":this.position=="top"?"position-top":""}" role="banner" aria-label="Small app bar">
|
|
3
3
|
<div class="leading">
|
|
4
4
|
<slot name="leading" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
5
5
|
</div>
|
|
6
|
-
<h1 class="headline">${this
|
|
6
|
+
<h1 class="headline">${g(this,a,d)}</h1>
|
|
7
7
|
<div class="trailing">
|
|
8
8
|
<slot name="trailing" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
9
9
|
<slot name="avatar" @slotchange=${this.handleAvatarSlotChange}></slot>
|
|
10
10
|
</div>
|
|
11
11
|
</header>
|
|
12
|
-
`;case"medium-flexible":return
|
|
12
|
+
`;case"medium-flexible":return f`
|
|
13
13
|
<header class="medium-flexible ${this.position=="bottom"?"position-bottom":this.position=="top"?"position-top":""}" role="banner" aria-label="Medium flexible app bar">
|
|
14
|
-
<div class="
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</div>
|
|
14
|
+
<div class="leading">
|
|
15
|
+
<slot name="leading" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
16
|
+
</div>
|
|
17
|
+
<h1 class="headline">${g(this,a,d)}</h1>
|
|
18
|
+
<div class="trailing">
|
|
19
|
+
<slot name="trailing" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
20
|
+
<slot name="avatar" @slotchange=${this.handleAvatarSlotChange}></slot>
|
|
22
21
|
</div>
|
|
23
|
-
<h1 class="headline">${this.title}</h1>
|
|
24
22
|
</header>
|
|
25
|
-
`;case"large-flexible":return
|
|
23
|
+
`;case"large-flexible":return f`
|
|
26
24
|
<header class="large-flexible ${this.position=="bottom"?"position-bottom":this.position=="top"?"position-top":""}" role="banner" aria-label="Large flexible app bar">
|
|
27
|
-
<div class="
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</div>
|
|
25
|
+
<div class="leading">
|
|
26
|
+
<slot name="leading" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
27
|
+
</div>
|
|
28
|
+
<h1 class="headline">${g(this,a,d)}</h1>
|
|
29
|
+
<div class="trailing">
|
|
30
|
+
<slot name="trailing" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
31
|
+
<slot name="avatar" @slotchange=${this.handleAvatarSlotChange}></slot>
|
|
35
32
|
</div>
|
|
36
|
-
<h1 class="headline">${this.title}</h1>
|
|
37
33
|
</header>
|
|
38
|
-
`;case"search":return
|
|
34
|
+
`;case"search":return f`
|
|
39
35
|
<header class="search ${this.position=="bottom"?"position-bottom":this.position=="top"?"position-top":""}" role="banner" aria-label="Search app bar">
|
|
40
36
|
<div class="leading">
|
|
41
37
|
<slot name="leading" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
42
38
|
</div>
|
|
43
39
|
<div class="search-container">
|
|
44
|
-
<scb-search supporting-text=${this.searchSupportingText}></scb-search>
|
|
40
|
+
<scb-search size="small" supporting-text=${this.searchSupportingText}></scb-search>
|
|
45
41
|
</div>
|
|
46
42
|
<div class="trailing">
|
|
47
43
|
<slot name="trailing" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
48
44
|
<slot name="avatar" @slotchange=${this.handleAvatarSlotChange}></slot>
|
|
49
45
|
</div>
|
|
50
46
|
</header>
|
|
51
|
-
`;default:return
|
|
47
|
+
`;default:return f`
|
|
52
48
|
<header class="default ${this.position=="bottom"?"position-bottom":this.position=="top"?"position-top":""}" role="banner" aria-label="Small app bar">
|
|
53
49
|
<div class="leading">
|
|
54
50
|
<slot name="leading" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
55
51
|
</div>
|
|
56
|
-
<h1 class="headline">${this
|
|
52
|
+
<h1 class="headline">${g(this,a,d)}</h1>
|
|
57
53
|
<div class="trailing">
|
|
58
54
|
<slot name="trailing" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
59
55
|
<slot name="avatar" @slotchange=${this.handleAvatarSlotChange}></slot>
|
|
60
56
|
</div>
|
|
61
57
|
</header>
|
|
62
|
-
`}}};
|
|
58
|
+
`}}};a=new WeakSet;m=function(){this.type==="default"&&(this.__titleResizeRaf||(this.__titleResizeRaf=requestAnimationFrame(()=>{this.__titleResizeRaf=0,r(this,a,x).call(this)})))};b=function(){this.__titleResizeObserver?.disconnect();const t=this.shadowRoot?.querySelector("header");if(t&&t.style.removeProperty("--scb-app-bar-title-max-width"),this.type!=="default"||!this.__titleResizeObserver)return;const e=this.shadowRoot?.querySelector("header.default");if(!e)return;const i=e.querySelector(".leading"),s=e.querySelector(".trailing");!i||!s||(this.__titleResizeObserver.observe(e),this.__titleResizeObserver.observe(i),this.__titleResizeObserver.observe(s),r(this,a,m).call(this))};u=function(t){if(!t)return 0;const e=parseFloat(t);return Number.isFinite(e)?e:0};v=function(t){const e=getComputedStyle(t);return r(this,a,u).call(this,e.columnGap||e.gap)};x=function(){const t=this.shadowRoot?.querySelector("header.default");if(!t)return;const e=t.querySelector(".leading"),i=t.querySelector(".trailing");if(!e||!i)return;const s=t.getBoundingClientRect(),n=e.getBoundingClientRect(),c=i.getBoundingClientRect(),o=getComputedStyle(t),C=r(this,a,u).call(this,o.paddingInlineStart||o.paddingLeft),R=r(this,a,u).call(this,o.paddingInlineEnd||o.paddingRight),T=Math.max(0,s.width-C-R),z=Math.max(n.width,c.width),A=Math.max(r(this,a,v).call(this,e),r(this,a,v).call(this,i)),w=Math.max(0,T-z*2-A*2);t.style.setProperty("--scb-app-bar-title-max-width",`${w}px`)};y=function(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,i=this.mapSpacingToken(this.spacingBottom)??t,s=this.mapSpacingToken(this.spacingLeft),n=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-app-bar-spacing-block-start",e):this.style.removeProperty("--scb-app-bar-spacing-block-start"),i?this.style.setProperty("--scb-app-bar-spacing-block-end",i):this.style.removeProperty("--scb-app-bar-spacing-block-end"),s?this.style.setProperty("--scb-app-bar-spacing-inline-start",s):this.style.removeProperty("--scb-app-bar-spacing-inline-start"),n?this.style.setProperty("--scb-app-bar-spacing-inline-end",n):this.style.removeProperty("--scb-app-bar-spacing-inline-end")};d=function(){return this.appBarTitle||this.title};l.styles=[$`
|
|
63
59
|
:host {
|
|
64
60
|
display: block;
|
|
65
|
-
font-family: var(--brand, Inter);
|
|
61
|
+
font-family: var(--brand-font, Inter, Arial, sans-serif);
|
|
66
62
|
position: relative;
|
|
67
63
|
container-type: inline-size;
|
|
68
64
|
container-name: app-bar-container;
|
|
@@ -87,14 +83,10 @@ import{a as z,n as p,i as $,x as d,t as A}from"../../vendor/vendor.js";import"..
|
|
|
87
83
|
height: var(--app-search-height);
|
|
88
84
|
}
|
|
89
85
|
header.medium-flexible {
|
|
90
|
-
|
|
91
|
-
align-items: flex-start;
|
|
92
|
-
padding: var(--spacing-5);
|
|
86
|
+
min-height: 96px;
|
|
93
87
|
}
|
|
94
88
|
header.large-flexible {
|
|
95
|
-
|
|
96
|
-
align-items: flex-start;
|
|
97
|
-
padding: var(--spacing-5);
|
|
89
|
+
min-height: 128px;
|
|
98
90
|
}
|
|
99
91
|
header.position-top {
|
|
100
92
|
position: fixed;
|
|
@@ -126,6 +118,7 @@ import{a as z,n as p,i as $,x as d,t as A}from"../../vendor/vendor.js";import"..
|
|
|
126
118
|
.headline {
|
|
127
119
|
flex: 1 1 auto;
|
|
128
120
|
text-align: center;
|
|
121
|
+
font-family: var(--md-sys-typescale-title-large-font, var(--brand-font, Inter, Arial, sans-serif));
|
|
129
122
|
font-size: var(--md-sys-typescale-title-large-size);
|
|
130
123
|
line-height: var(--md-sys-typescale-title-large-Line-Height, calc(var(--md-sys-typescale-title-large-size) * 1.3));
|
|
131
124
|
font-weight: 600;
|
|
@@ -136,20 +129,22 @@ import{a as z,n as p,i as $,x as d,t as A}from"../../vendor/vendor.js";import"..
|
|
|
136
129
|
margin-left: var(--spacing-5);
|
|
137
130
|
}
|
|
138
131
|
header.medium-flexible .headline {
|
|
132
|
+
font-family: var(--md-sys-typescale-headline-small-font, var(--brand-font, Inter, Arial, sans-serif));
|
|
139
133
|
font-size: var(--md-sys-typescale-headline-small-size);
|
|
140
134
|
line-height: 30px; /* denna variabel finns inte, men sätts i figma.. --md-sys-typescale-headline-small-Line-Height2 */
|
|
141
135
|
font-weight: 700;
|
|
142
136
|
letter-spacing: var(--md-sys-typescale-headline-small-Tracking);
|
|
143
137
|
text-align: left;
|
|
144
|
-
margin:
|
|
138
|
+
margin: 0 0 0 var(--spacing-3);
|
|
145
139
|
}
|
|
146
140
|
header.large-flexible .headline {
|
|
141
|
+
font-family: var(--md-sys-typescale-headline-medium-font, var(--brand-font, Inter, Arial, sans-serif));
|
|
147
142
|
font-size: var(--md-sys-typescale-headline-medium-size);
|
|
148
143
|
font-weight: 700;
|
|
149
144
|
line-height: var(--md-sys-typescale-headline-medium-Line-Height);
|
|
150
145
|
letter-spacing: var(--md-sys-typescale-headline-medium-Tracking);
|
|
151
146
|
text-align: left;
|
|
152
|
-
margin:
|
|
147
|
+
margin: 0 0 0 var(--spacing-3);
|
|
153
148
|
}
|
|
154
149
|
.search-container {
|
|
155
150
|
flex: 1 1 auto;
|
|
@@ -158,14 +153,6 @@ import{a as z,n as p,i as $,x as d,t as A}from"../../vendor/vendor.js";import"..
|
|
|
158
153
|
justify-content: center;
|
|
159
154
|
padding: 0 var(--spacing-3);
|
|
160
155
|
}
|
|
161
|
-
.action-elements {
|
|
162
|
-
width: 100%;
|
|
163
|
-
display: flex;
|
|
164
|
-
flex-direction: row;
|
|
165
|
-
justify-content: space-between;
|
|
166
|
-
align-items: center;
|
|
167
|
-
margin-bottom: var(--spacing-3);
|
|
168
|
-
}
|
|
169
156
|
.trailing{
|
|
170
157
|
display: flex;
|
|
171
158
|
align-items: center;
|
|
@@ -176,10 +163,4 @@ import{a as z,n as p,i as $,x as d,t as A}from"../../vendor/vendor.js";import"..
|
|
|
176
163
|
align-items: center;
|
|
177
164
|
gap: var(--spacing-2);
|
|
178
165
|
}
|
|
179
|
-
|
|
180
|
-
.action-elements > div {
|
|
181
|
-
display: flex;
|
|
182
|
-
align-items: center;
|
|
183
|
-
gap: var(--spacing-2);
|
|
184
|
-
}
|
|
185
|
-
`];c([p({type:String,reflect:!0})],r.prototype,"title",2);c([p({type:String,reflect:!0})],r.prototype,"type",2);c([p({type:String,reflect:!0})],r.prototype,"position",2);c([p({type:String,attribute:"search-supporting-text",reflect:!0})],r.prototype,"searchSupportingText",2);c([p({type:String,reflect:!0})],r.prototype,"spacing",2);c([p({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",2);c([p({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",2);c([p({type:String,attribute:"spacing-left",reflect:!0})],r.prototype,"spacingLeft",2);c([p({type:String,attribute:"spacing-right",reflect:!0})],r.prototype,"spacingRight",2);r=c([A("scb-app-bar")],r);
|
|
166
|
+
`];p([h({type:String,reflect:!0})],l.prototype,"title",2);p([h({type:String,attribute:"app-bar-title",reflect:!0})],l.prototype,"appBarTitle",2);p([h({type:String,reflect:!0})],l.prototype,"type",2);p([h({type:String,reflect:!0})],l.prototype,"position",2);p([h({type:String,attribute:"search-supporting-text",reflect:!0})],l.prototype,"searchSupportingText",2);p([h({type:String,reflect:!0})],l.prototype,"spacing",2);p([h({type:String,attribute:"spacing-top",reflect:!0})],l.prototype,"spacingTop",2);p([h({type:String,attribute:"spacing-bottom",reflect:!0})],l.prototype,"spacingBottom",2);p([h({type:String,attribute:"spacing-left",reflect:!0})],l.prototype,"spacingLeft",2);p([h({type:String,attribute:"spacing-right",reflect:!0})],l.prototype,"spacingRight",2);l=p([k("scb-app-bar")],l);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as
|
|
2
|
+
import{_ as y}from"../../vendor/preload-helper.js";import{a as w,n as r,i as _,x as o,t as k}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(s,c,n){try{customElements.get(s)||t(s,c,n)}catch(l){var d=String(l||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var S=Object.defineProperty,H=Object.getOwnPropertyDescriptor,v=e=>{throw TypeError(e)},i=(e,t,s,c)=>{for(var n=c>1?void 0:c?H(t,s):t,d=e.length-1,l;d>=0;d--)(l=e[d])&&(n=(c?l(t,s,n):l(n))||n);return c&&n&&S(t,s,n),n},u=(e,t,s)=>t.has(e)||v("Cannot "+s),f=(e,t,s)=>(u(e,t,"read from private field"),s?s.call(e):t.get(e)),$=(e,t,s)=>t.has(e)?v("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),h=(e,t,s)=>(u(e,t,"access private method"),s),p,g,x,m;let a=class extends _{constructor(){super(...arguments),$(this,p),this.variant="default",this.size="medium",this.date=null,this.direction="horizontal",this.title="",this.calendarCardTitle="",this.subtitle="",this.supportingText="",this.cardHref="",this.cardHrefNav="",this.showMedia=null,this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.width="",this.maxWidth="",this.minWidth="",this.height="",this.maxHeight="",this.minHeight="",this.sizing="stretch",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}async firstUpdated(){a.__iconLoaded||(await y(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),a.__iconLoaded=!0),a.__rippleLoaded||(await y(()=>import("../../vendor/vendor-material.js").then(e=>e.r),__vite__mapDeps([0,1]),import.meta.url),a.__rippleLoaded=!0),this.__applyInnerSizing(),h(this,p,m).call(this)}render(){const e=this.variant?`${this.variant.toLowerCase()}`:"",t=this.direction?`${this.direction.toLowerCase()}`:"",s=this.cardHref?"clickable":"",{day:c,month:n}=h(this,p,x).call(this),d=this.mediaWidth&&this.mediaWidth.trim()!==""?this.mediaWidth:"",l=this.mediaHeight&&this.mediaHeight.trim()!==""?this.mediaHeight:"",b=this.mediaAspect&&this.mediaAspect.trim()!==""?this.mediaAspect:"",z=`${d?`inline-size:${d};`:""}${l?`block-size:${l};`:""}${b?`aspect-ratio:${b};`:""}`;return o`
|
|
3
3
|
<div
|
|
4
4
|
class="calendar-card ${t} ${s} ${e}"
|
|
5
5
|
role="${this.cardHref?"link":"group"}"
|
|
6
|
-
aria-label="${this
|
|
6
|
+
aria-label="${f(this,p,g)||"Kalenderkort"}"
|
|
7
7
|
tabindex="${this.cardHref?"0":"-1"}"
|
|
8
8
|
@click=${this.cardHref?this._handleHrefNavigation:null}
|
|
9
9
|
@keydown=${this.cardHref?this._onKeyDown:null}
|
|
@@ -11,7 +11,7 @@ import{_ as b}from"../../vendor/preload-helper.js";import{a as u,n as r,i as x,x
|
|
|
11
11
|
>
|
|
12
12
|
${this.cardHref?o`<md-ripple></md-ripple>`:""}
|
|
13
13
|
${this.showMedia?o`
|
|
14
|
-
<div class="media" style="${
|
|
14
|
+
<div class="media" style="${z}" aria-label="Datum: ${c} ${n}">
|
|
15
15
|
<div class="day">${c}</div>
|
|
16
16
|
<div class="month">${n}</div>
|
|
17
17
|
</div>
|
|
@@ -19,7 +19,7 @@ import{_ as b}from"../../vendor/preload-helper.js";import{a as u,n as r,i as x,x
|
|
|
19
19
|
<div class="container">
|
|
20
20
|
<div class="header-container">
|
|
21
21
|
<div class="title-container">
|
|
22
|
-
<div class="title">${this
|
|
22
|
+
<div class="title">${f(this,p,g)}</div>
|
|
23
23
|
${this.cardHref?o`<div class="icon-container"><md-icon>arrow_forward</md-icon></div>`:""}
|
|
24
24
|
</div>
|
|
25
25
|
${this.subtitle?o`<div class="subtitle">${this.subtitle}</div>`:""}</div>
|
|
@@ -27,7 +27,7 @@ import{_ as b}from"../../vendor/preload-helper.js";import{a as u,n as r,i as x,x
|
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
${this.cardHref?o`<md-focus-ring></md-focus-ring>`:""}
|
|
30
|
-
`}__applyInnerSizing(){const e=this.renderRoot.querySelector(".calendar-card");if(!e)return;this.width&&this.width.trim()!==""?(e.style.inlineSize="100%",e.style.maxInlineSize="100%"):(e.style.removeProperty("inline-size"),e.style.removeProperty("max-inline-size")),this.height&&this.height.trim()!==""||this.sizing==="stretch"?e.style.blockSize="100%":e.style.removeProperty("block-size"),this.maxHeight&&this.maxHeight.trim()!==""?e.style.maxBlockSize="100%":e.style.removeProperty("max-block-size")}_onKeyDown(e){(e.key==="Enter"||e.key===" ")&&this.cardHref&&(window.open(this.cardHref,"_self"),e.preventDefault())}_handleHrefNavigation(){this.cardHref&&(this.cardHrefNav==="tab"?window.open(this.cardHref,"_blank"):this.cardHrefNav==="window"?window.open(this.cardHref,"_blank","noopener,noreferrer,width=800,height=600"):window.open(this.cardHref,"_self"))}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}updated(e){e.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),e.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),e.has("minWidth")&&(this.minWidth?this.style.minInlineSize=this.minWidth:this.style.removeProperty("min-inline-size")),e.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),e.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),e.has("minHeight")&&(this.minHeight?this.style.minBlockSize=this.minHeight:this.style.removeProperty("min-block-size")),(e.has("width")||e.has("height")||e.has("maxHeight")||e.has("sizing"))&&this.__applyInnerSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&h(this,p,
|
|
30
|
+
`}__applyInnerSizing(){const e=this.renderRoot.querySelector(".calendar-card");if(!e)return;this.width&&this.width.trim()!==""?(e.style.inlineSize="100%",e.style.maxInlineSize="100%"):(e.style.removeProperty("inline-size"),e.style.removeProperty("max-inline-size")),this.height&&this.height.trim()!==""||this.sizing==="stretch"?e.style.blockSize="100%":e.style.removeProperty("block-size"),this.maxHeight&&this.maxHeight.trim()!==""?e.style.maxBlockSize="100%":e.style.removeProperty("max-block-size")}_onKeyDown(e){(e.key==="Enter"||e.key===" ")&&this.cardHref&&(window.open(this.cardHref,"_self"),e.preventDefault())}_handleHrefNavigation(){this.cardHref&&(this.cardHrefNav==="tab"?window.open(this.cardHref,"_blank"):this.cardHrefNav==="window"?window.open(this.cardHref,"_blank","noopener,noreferrer,width=800,height=600"):window.open(this.cardHref,"_self"))}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}updated(e){e.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),e.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),e.has("minWidth")&&(this.minWidth?this.style.minInlineSize=this.minWidth:this.style.removeProperty("min-inline-size")),e.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),e.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),e.has("minHeight")&&(this.minHeight?this.style.minBlockSize=this.minHeight:this.style.removeProperty("min-block-size")),(e.has("width")||e.has("height")||e.has("maxHeight")||e.has("sizing"))&&this.__applyInnerSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&h(this,p,m).call(this)}};p=new WeakSet;g=function(){return this.calendarCardTitle||this.title};x=function(){const e={day:1,month:"Jan"};if(!this.date)return e;const t=this.date instanceof Date?this.date:(()=>{const l=new Date(String(this.date));return Number.isNaN(l.getTime())?null:l})();if(!t)return e;const s=t.getDate(),n=new Intl.DateTimeFormat("sv-SE",{month:"short"}).format(t).replace(".","").trim(),d=n.charAt(0).toUpperCase()+n.slice(1);return{day:s,month:d}};m=function(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,s=this.mapSpacingToken(this.spacingBottom)??e,c=this.mapSpacingToken(this.spacingLeft),n=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-calendar-card-spacing-block-start",t):this.style.removeProperty("--scb-calendar-card-spacing-block-start"),s?this.style.setProperty("--scb-calendar-card-spacing-block-end",s):this.style.removeProperty("--scb-calendar-card-spacing-block-end"),c?this.style.setProperty("--scb-calendar-card-spacing-inline-start",c):this.style.removeProperty("--scb-calendar-card-spacing-inline-start"),n?this.style.setProperty("--scb-calendar-card-spacing-inline-end",n):this.style.removeProperty("--scb-calendar-card-spacing-inline-end")};a.__iconLoaded=!1;a.__rippleLoaded=!1;a.styles=w`
|
|
31
31
|
:host {
|
|
32
32
|
display: block;
|
|
33
33
|
position: relative;
|
|
@@ -340,4 +340,4 @@ import{_ as b}from"../../vendor/preload-helper.js";import{a as u,n as r,i as x,x
|
|
|
340
340
|
overflow: visible;
|
|
341
341
|
text-overflow: clip;
|
|
342
342
|
}
|
|
343
|
-
`;i([r({type:String,reflect:!0})],a.prototype,"variant",2);i([r({type:String,reflect:!0})],a.prototype,"size",2);i([r({type:String,attribute:"date"})],a.prototype,"date",2);i([r({type:String,reflect:!0})],a.prototype,"direction",2);i([r({type:String,reflect:!0})],a.prototype,"title",2);i([r({type:String,reflect:!0})],a.prototype,"subtitle",2);i([r({type:String,attribute:"supporting-text",reflect:!0})],a.prototype,"supportingText",2);i([r({type:String,attribute:"card-href"})],a.prototype,"cardHref",2);i([r({type:String,attribute:"card-href-nav"})],a.prototype,"cardHrefNav",2);i([r({type:Boolean,reflect:!0,attribute:"show-media"})],a.prototype,"showMedia",2);i([r({type:String,attribute:"media-width"})],a.prototype,"mediaWidth",2);i([r({type:String,attribute:"media-height"})],a.prototype,"mediaHeight",2);i([r({type:String,attribute:"media-aspect"})],a.prototype,"mediaAspect",2);i([r({type:String,reflect:!0})],a.prototype,"width",2);i([r({type:String,reflect:!0,attribute:"max-width"})],a.prototype,"maxWidth",2);i([r({type:String,attribute:"min-width"})],a.prototype,"minWidth",2);i([r({type:String,reflect:!0})],a.prototype,"height",2);i([r({type:String,reflect:!0,attribute:"max-height"})],a.prototype,"maxHeight",2);i([r({type:String,attribute:"min-height"})],a.prototype,"minHeight",2);i([r({type:String,reflect:!0})],a.prototype,"sizing",2);i([r({type:String,reflect:!0})],a.prototype,"spacing",2);i([r({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",2);i([r({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",2);i([r({type:String,attribute:"spacing-left",reflect:!0})],a.prototype,"spacingLeft",2);i([r({type:String,attribute:"spacing-right",reflect:!0})],a.prototype,"spacingRight",2);a=i([
|
|
343
|
+
`;i([r({type:String,reflect:!0})],a.prototype,"variant",2);i([r({type:String,reflect:!0})],a.prototype,"size",2);i([r({type:String,attribute:"date"})],a.prototype,"date",2);i([r({type:String,reflect:!0})],a.prototype,"direction",2);i([r({type:String,reflect:!0})],a.prototype,"title",2);i([r({type:String,attribute:"calendar-card-title",reflect:!0})],a.prototype,"calendarCardTitle",2);i([r({type:String,reflect:!0})],a.prototype,"subtitle",2);i([r({type:String,attribute:"supporting-text",reflect:!0})],a.prototype,"supportingText",2);i([r({type:String,attribute:"card-href"})],a.prototype,"cardHref",2);i([r({type:String,attribute:"card-href-nav"})],a.prototype,"cardHrefNav",2);i([r({type:Boolean,reflect:!0,attribute:"show-media"})],a.prototype,"showMedia",2);i([r({type:String,attribute:"media-width"})],a.prototype,"mediaWidth",2);i([r({type:String,attribute:"media-height"})],a.prototype,"mediaHeight",2);i([r({type:String,attribute:"media-aspect"})],a.prototype,"mediaAspect",2);i([r({type:String,reflect:!0})],a.prototype,"width",2);i([r({type:String,reflect:!0,attribute:"max-width"})],a.prototype,"maxWidth",2);i([r({type:String,attribute:"min-width"})],a.prototype,"minWidth",2);i([r({type:String,reflect:!0})],a.prototype,"height",2);i([r({type:String,reflect:!0,attribute:"max-height"})],a.prototype,"maxHeight",2);i([r({type:String,attribute:"min-height"})],a.prototype,"minHeight",2);i([r({type:String,reflect:!0})],a.prototype,"sizing",2);i([r({type:String,reflect:!0})],a.prototype,"spacing",2);i([r({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",2);i([r({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",2);i([r({type:String,attribute:"spacing-left",reflect:!0})],a.prototype,"spacingLeft",2);i([r({type:String,attribute:"spacing-right",reflect:!0})],a.prototype,"spacingRight",2);a=i([k("scb-calendar-card")],a);
|