scb-wc-test 0.1.346 → 0.1.347
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-list/scb-list-item.js +11 -10
- package/mvc/components/scb-notification-card/scb-notification-card.js +15 -9
- package/package.json +2 -2
- package/scb-list/scb-list-item.d.ts +1 -0
- package/scb-list/scb-list-item.js +11 -7
- package/scb-notification-card/scb-notification-card.js +14 -8
- package/scb-wc-test.bundle.js +395 -388
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js","../scb-checkbox/scb-checkbox.js","../scb-checkbox/scb-checkbox-group.js","../scb-switch/scb-switch.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as
|
|
2
|
+
import{_ as m}from"../../vendor/preload-helper.js";import{n as s,t as I,i as L,a as E,E as l,x as n}from"../../vendor/vendor.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 i=customElements.define.bind(customElements);customElements.define=function(e,d,c){try{customElements.get(e)||i(e,d,c)}catch(p){var o=String(p||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var T=Object.defineProperty,P=Object.getOwnPropertyDescriptor,V=t=>{throw TypeError(t)},r=(t,i,e,d)=>{for(var c=d>1?void 0:d?P(i,e):i,o=t.length-1,p;o>=0;o--)(p=t[o])&&(c=(d?p(i,e,c):p(c))||c);return d&&c&&T(i,e,c),c},k=(t,i,e)=>i.has(t)||V("Cannot "+e),v=(t,i,e)=>(k(t,i,"read from private field"),e?e.call(t):i.get(t)),g=(t,i,e)=>i.has(t)?V("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(t):i.set(t,e),_=(t,i,e,d)=>(k(t,i,"write to private field"),i.set(t,e),e),$=(t,i,e)=>(k(t,i,"access private method"),e),f,y,b,u,w,x;let a=class extends L{constructor(){super(...arguments),g(this,u),this.type="text",this.href="",this.itemHref="",this.target="",this.disabled=!1,this.label="",this.supportingText="",this.overline="",this.leading=!1,this.leadingVariant="",this.leadingIcon="",this.avatarLabel="",this.avatarAlt="",this.avatarVariant="icon",this.avatarSrc="",this.imgHrefImage="",this.trailing=!1,this.trailingVariant="",this.trailingIcon="",this.trailingSwitchLabel="",this.density=0,this.noDivider=!1,g(this,f,!1),g(this,y,!1),g(this,b,!1),this.onRowClick=()=>{if(this.type==="link"&&(this.href||this.itemHref))return;const t=this.shadowRoot?.querySelector("scb-checkbox"),i=this.shadowRoot?.querySelector("scb-switch");t&&(t.checked=!t.checked),i&&(i.selected=!i.selected)},g(this,x,t=>{if(!t.defaultPrevented&&(t.key==="Enter"||t.key===" ")){if(this.type==="link"){const i=this.shadowRoot?.querySelector("a[href]");if(i){t.preventDefault(),i.click();return}}t.preventDefault(),this.onRowClick()}})}static get styles(){return E`
|
|
3
3
|
:host {
|
|
4
4
|
border-bottom: var(--stroke-border, 1px) solid var(--md-sys-color-outline-variant);
|
|
5
5
|
margin-bottom: calc(var(--stroke-border, 1px) * -1);
|
|
@@ -106,7 +106,7 @@ import{_ as b}from"../../vendor/preload-helper.js";import{n as s,t as I,i as E,a
|
|
|
106
106
|
width: 100%;
|
|
107
107
|
gap: 12px;
|
|
108
108
|
}
|
|
109
|
-
`}async firstUpdated(){await $(this,u,w).call(this),this.addEventListener("keydown",v(this,x))}updated(t){super.updated(t),(t.has("leading")||t.has("leadingVariant")||t.has("trailing")||t.has("trailingVariant")||t.has("type")||t.has("target"))&&$(this,u,w).call(this)}render(){const t=this.leading?(()=>{switch(this.leadingVariant){case"icon":return this.leadingIcon?n`<div class="leading"><md-icon>${this.leadingIcon}</md-icon></div>`:
|
|
109
|
+
`}async firstUpdated(){await $(this,u,w).call(this),this.addEventListener("keydown",v(this,x))}updated(t){super.updated(t),(t.has("leading")||t.has("leadingVariant")||t.has("trailing")||t.has("trailingVariant")||t.has("type")||t.has("target"))&&$(this,u,w).call(this)}render(){const t=this.leading?(()=>{switch(this.leadingVariant){case"icon":return this.leadingIcon?n`<div class="leading"><md-icon>${this.leadingIcon}</md-icon></div>`:l;case"avatar":return n`
|
|
110
110
|
<div class="leading">
|
|
111
111
|
<scb-avatar
|
|
112
112
|
label=${this.avatarLabel}
|
|
@@ -117,7 +117,7 @@ import{_ as b}from"../../vendor/preload-helper.js";import{n as s,t as I,i as E,a
|
|
|
117
117
|
variant=${this.avatarVariant}
|
|
118
118
|
></scb-avatar>
|
|
119
119
|
</div>
|
|
120
|
-
`;case"image":return this.imgHrefImage?n`<div class="leading"><img class="img" part="leading-image" src="${this.imgHrefImage}" alt="" /></div>`:
|
|
120
|
+
`;case"image":return this.imgHrefImage?n`<div class="leading"><img class="img" part="leading-image" src="${this.imgHrefImage}" alt="" /></div>`:l;default:return l}})():l,i=this.href||this.itemHref||"",e=this.target==="_blank"?"open_in_new":"chevron_right",d=this.label?`Välj ${this.label}`:"Välj",c=this.label?`Växla ${this.label}`:"Växla";let o=l;if(this.trailing)if(this.trailingVariant==="icon"){const h=this.trailingIcon||(this.type==="link"?e:"");o=h?n`<div class="trailing"><md-icon>${h}</md-icon></div>`:l}else this.trailingVariant==="checkbox"?o=n`
|
|
121
121
|
<div class="trailing">
|
|
122
122
|
<scb-checkbox
|
|
123
123
|
aria-label=${d}
|
|
@@ -126,22 +126,23 @@ import{_ as b}from"../../vendor/preload-helper.js";import{n as s,t as I,i as E,a
|
|
|
126
126
|
</div>`:this.trailingVariant==="switch"&&(o=n`
|
|
127
127
|
<div class="trailing">
|
|
128
128
|
<scb-switch
|
|
129
|
-
|
|
129
|
+
label=${this.trailingSwitchLabel||l}
|
|
130
|
+
aria-label=${c}
|
|
130
131
|
@click=${h=>h.stopPropagation()}
|
|
131
132
|
></scb-switch>
|
|
132
|
-
</div>`);else this.type==="link"&&(o=n`<div class="trailing"><md-icon>${e}</md-icon></div>`);const p=this.type==="link"&&this.target==="_blank"?"noopener noreferrer":
|
|
133
|
+
</div>`);else this.type==="link"&&(o=n`<div class="trailing"><md-icon>${e}</md-icon></div>`);const p=this.type==="link"&&this.target==="_blank"?"noopener noreferrer":l,S=n`
|
|
133
134
|
${t}
|
|
134
135
|
<div class="texts">
|
|
135
|
-
${this.overline?n`<div class="overline">${this.overline}</div>`:
|
|
136
|
+
${this.overline?n`<div class="overline">${this.overline}</div>`:l}
|
|
136
137
|
<div class="label">${this.label}</div>
|
|
137
|
-
${this.supportingText?n`<div class="supporting-text">${this.supportingText}</div>`:
|
|
138
|
+
${this.supportingText?n`<div class="supporting-text">${this.supportingText}</div>`:l}
|
|
138
139
|
</div>
|
|
139
140
|
${o}
|
|
140
141
|
`;return n`
|
|
141
142
|
<div class="row" @click=${this.onRowClick} ?inert=${this.disabled} aria-disabled=${this.disabled?"true":"false"}>
|
|
142
|
-
${this.type==="link"&&i?n`<a class="link" href=${i} target=${this.target||
|
|
143
|
-
${this.type==="link"?n`<md-ripple></md-ripple>`:
|
|
143
|
+
${this.type==="link"&&i?n`<a class="link" href=${i} target=${this.target||l} rel=${p}>${S}</a>`:S}
|
|
144
|
+
${this.type==="link"?n`<md-ripple></md-ripple>`:l}
|
|
144
145
|
</div>
|
|
145
146
|
|
|
146
147
|
<md-focus-ring></md-focus-ring>
|
|
147
|
-
`}};f=new WeakMap;y=new WeakMap;
|
|
148
|
+
`}};f=new WeakMap;y=new WeakMap;b=new WeakMap;u=new WeakSet;w=async function(){const t=this.type==="link"&&(!this.trailing||this.trailingVariant==="icon");(this.leading&&this.leadingVariant==="icon"||this.trailing&&this.trailingVariant==="icon"||t)&&!v(this,f)&&(await m(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),_(this,f,!0)),this.trailing&&this.trailingVariant==="checkbox"&&!v(this,y)&&(await m(()=>import("../scb-checkbox/scb-checkbox.js"),__vite__mapDeps([2,1,0,3]),import.meta.url),_(this,y,!0)),this.trailing&&this.trailingVariant==="switch"&&!v(this,b)&&(await m(()=>import("../scb-switch/scb-switch.js"),__vite__mapDeps([4,1,0]),import.meta.url),_(this,b,!0))};x=new WeakMap;r([s({type:String,reflect:!0,attribute:"type"})],a.prototype,"type",2);r([s({type:String})],a.prototype,"href",2);r([s({type:String,attribute:"item-href"})],a.prototype,"itemHref",2);r([s({type:String,attribute:"target"})],a.prototype,"target",2);r([s({type:Boolean,attribute:"disabled"})],a.prototype,"disabled",2);r([s({type:String,reflect:!0})],a.prototype,"label",2);r([s({type:String,attribute:"supporting-text"})],a.prototype,"supportingText",2);r([s({type:String,attribute:"overline"})],a.prototype,"overline",2);r([s({type:Boolean})],a.prototype,"leading",2);r([s({type:String,attribute:"leading-variant",reflect:!0})],a.prototype,"leadingVariant",2);r([s({type:String,attribute:"leading-icon"})],a.prototype,"leadingIcon",2);r([s({type:String,attribute:"avatar-label"})],a.prototype,"avatarLabel",2);r([s({type:String,attribute:"avatar-alt"})],a.prototype,"avatarAlt",2);r([s({type:String,attribute:"avatar-variant"})],a.prototype,"avatarVariant",2);r([s({type:String,attribute:"avatar-src"})],a.prototype,"avatarSrc",2);r([s({type:String,reflect:!0,attribute:"img-href-image"})],a.prototype,"imgHrefImage",2);r([s({type:Boolean})],a.prototype,"trailing",2);r([s({type:String,attribute:"trailing-variant",reflect:!0})],a.prototype,"trailingVariant",2);r([s({type:String,attribute:"trailing-icon"})],a.prototype,"trailingIcon",2);r([s({type:String,attribute:"trailing-switch-label"})],a.prototype,"trailingSwitchLabel",2);r([s({type:Number,reflect:!0})],a.prototype,"density",2);r([s({type:Boolean,attribute:"no-divider",reflect:!0})],a.prototype,"noDivider",2);a=r([I("scb-list-item")],a);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h,n,i as f,x as c,t as
|
|
1
|
+
import{a as h,n,i as f,x as c,t as g}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-icon-button/scb-icon-button.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 o=customElements.define.bind(customElements);customElements.define=function(s,a,r){try{customElements.get(s)||o(s,a,r)}catch(p){var l=String(p||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var d=Object.defineProperty,m=Object.getOwnPropertyDescriptor,e=(t,o,s,a)=>{for(var r=a>1?void 0:a?m(o,s):o,l=t.length-1,p;l>=0;l--)(p=t[l])&&(r=(a?p(o,s,r):p(r))||r);return a&&r&&d(o,s,r),r};let i=class extends f{constructor(){super(...arguments),this.variant="success",this.direction="horizontal",this.size="large",this.title="",this.subtitle="",this.supportingText="",this.open=!1,this.linkText="",this.linkHref="#",this.href="",this.showIcon=!1,this.showCloseButton=!1,this.sizing="stretch",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.fullHeight=!1,this.fullWidth=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._closeNotification=()=>{this.open=!1;const t=new CustomEvent("close",{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(t);const o=new CustomEvent("Close",{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(o)}}_iconForVariant(){switch(this.variant){case"success":return"check_circle";case"error":return"error";case"warning":return"warning";case"info":default:return"info"}}__resolveSpacingToken(t){const o=(t??"").trim();return o?/^\d+$/.test(o)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(o,10)))})`:o:""}__applySpacing(){const t=this.__resolveSpacingToken(this.spacingTop||this.spacing),o=this.__resolveSpacingToken(this.spacingBottom||this.spacing),s=this.__resolveSpacingToken(this.spacingLeft||this.spacing),a=this.__resolveSpacingToken(this.spacingRight||this.spacing);t?this.style.marginBlockStart=t:this.style.removeProperty("margin-block-start"),o?this.style.marginBlockEnd=o:this.style.removeProperty("margin-block-end"),s?this.style.marginInlineStart=s:this.style.removeProperty("margin-inline-start"),a?this.style.marginInlineEnd=a:this.style.removeProperty("margin-inline-end")}updated(t){super.updated(t),t.has("width")&&(this.width&&this.width.trim()!==""?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),t.has("maxWidth")&&(this.maxWidth&&this.maxWidth.trim()!==""?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),t.has("height")&&(this.height&&this.height.trim()!==""?this.style.blockSize=this.height:this.style.removeProperty("block-size")),t.has("maxHeight")&&(this.maxHeight&&this.maxHeight.trim()!==""?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.__applySpacing()}render(){const t=this.direction==="vertical"?"vertical":"horizontal",o=!!(this.title||this.subtitle),s=!!(this.supportingText&&!this.title&&!this.subtitle&&!this.linkText),a=this.variant==="success"?"--_icon-color: var(--md-sys-color-on-success-container, #007041);":this.variant==="error"?"--_icon-color: var(--md-sys-color-on-error-container, #942500);":this.variant==="warning"?"--_icon-color: var(--md-sys-color-on-warning-container, #6B5600);":"--_icon-color: var(--md-sys-color-on-info-container, #1E00BE);",r=this.linkHref&&this.linkHref!=="#"?this.linkHref:this.href||this.linkHref;return c`
|
|
2
2
|
<div class="notification" type=${this.variant} role="alert" aria-live="assertive" aria-atomic="true">
|
|
3
3
|
<div class="notification-main ${t}">
|
|
4
4
|
${this.showIcon?c`
|
|
@@ -6,15 +6,17 @@ import{a as h,n,i as f,x as c,t as d}from"../../vendor/vendor.js";import"../../v
|
|
|
6
6
|
<md-icon aria-hidden="true">${this._iconForVariant()}</md-icon>
|
|
7
7
|
</div>
|
|
8
8
|
`:null}
|
|
9
|
-
<div class="notification-text-container">
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
<div class="notification-text-container ${s?"no-gap":""}">
|
|
10
|
+
${o?c`
|
|
11
|
+
<div class="notification-title-container">
|
|
12
|
+
${this.title?c`<div class="notification-title">${this.title}</div>`:null}
|
|
13
|
+
${this.subtitle?c`<div class="notification-subtitle">${this.subtitle}</div>`:null}
|
|
14
|
+
</div>
|
|
15
|
+
`:null}
|
|
14
16
|
${this.supportingText?c`<div class="notification-text">${this.supportingText}</div>`:null}
|
|
15
17
|
${this.linkText?c`
|
|
16
18
|
<div class="notification-footer">
|
|
17
|
-
<a class="footer-link" href="${
|
|
19
|
+
<a class="footer-link" href="${r}">${this.linkText}</a>
|
|
18
20
|
</div>
|
|
19
21
|
`:null}
|
|
20
22
|
</div>
|
|
@@ -24,7 +26,7 @@ import{a as h,n,i as f,x as c,t as d}from"../../vendor/vendor.js";import"../../v
|
|
|
24
26
|
<scb-icon-button
|
|
25
27
|
aria-label="Stäng meddelande"
|
|
26
28
|
icon="close"
|
|
27
|
-
style=${
|
|
29
|
+
style=${a}
|
|
28
30
|
@click=${this._closeNotification}
|
|
29
31
|
>
|
|
30
32
|
</scb-icon-button>
|
|
@@ -262,6 +264,10 @@ import{a as h,n,i as f,x as c,t as d}from"../../vendor/vendor.js";import"../../v
|
|
|
262
264
|
min-width: 0;
|
|
263
265
|
}
|
|
264
266
|
|
|
267
|
+
.notification-text-container.no-gap {
|
|
268
|
+
gap: 0;
|
|
269
|
+
}
|
|
270
|
+
|
|
265
271
|
.notification-title-container{
|
|
266
272
|
display: flex;
|
|
267
273
|
flex-direction: column;
|
|
@@ -349,4 +355,4 @@ import{a as h,n,i as f,x as c,t as d}from"../../vendor/vendor.js";import"../../v
|
|
|
349
355
|
box-shadow: 0 0 0 2px var(--md-sys-color-primary, #1976d2);
|
|
350
356
|
}
|
|
351
357
|
}
|
|
352
|
-
`];e([n({type:String})],i.prototype,"variant",2);e([n({type:String,reflect:!0})],i.prototype,"direction",2);e([n({type:String,reflect:!0})],i.prototype,"size",2);e([n({type:String})],i.prototype,"title",2);e([n({type:String})],i.prototype,"subtitle",2);e([n({type:String,attribute:"supporting-text"})],i.prototype,"supportingText",2);e([n({type:Boolean,reflect:!0})],i.prototype,"open",2);e([n({type:String,attribute:"link-text"})],i.prototype,"linkText",2);e([n({type:String,attribute:"link-href"})],i.prototype,"linkHref",2);e([n({type:String})],i.prototype,"href",2);e([n({type:Boolean,attribute:"show-icon"})],i.prototype,"showIcon",2);e([n({type:Boolean,attribute:"show-close-button"})],i.prototype,"showCloseButton",2);e([n({type:String,reflect:!0})],i.prototype,"sizing",2);e([n({type:String,reflect:!0})],i.prototype,"width",2);e([n({type:String,reflect:!0,attribute:"max-width"})],i.prototype,"maxWidth",2);e([n({type:String,reflect:!0})],i.prototype,"height",2);e([n({type:String,reflect:!0,attribute:"max-height"})],i.prototype,"maxHeight",2);e([n({type:Boolean,reflect:!0,attribute:"full-height"})],i.prototype,"fullHeight",2);e([n({type:Boolean,reflect:!0,attribute:"full-width"})],i.prototype,"fullWidth",2);e([n({type:String})],i.prototype,"spacing",2);e([n({type:String,attribute:"spacing-top"})],i.prototype,"spacingTop",2);e([n({type:String,attribute:"spacing-bottom"})],i.prototype,"spacingBottom",2);e([n({type:String,attribute:"spacing-left"})],i.prototype,"spacingLeft",2);e([n({type:String,attribute:"spacing-right"})],i.prototype,"spacingRight",2);i=e([
|
|
358
|
+
`];e([n({type:String})],i.prototype,"variant",2);e([n({type:String,reflect:!0})],i.prototype,"direction",2);e([n({type:String,reflect:!0})],i.prototype,"size",2);e([n({type:String})],i.prototype,"title",2);e([n({type:String})],i.prototype,"subtitle",2);e([n({type:String,attribute:"supporting-text"})],i.prototype,"supportingText",2);e([n({type:Boolean,reflect:!0})],i.prototype,"open",2);e([n({type:String,attribute:"link-text"})],i.prototype,"linkText",2);e([n({type:String,attribute:"link-href"})],i.prototype,"linkHref",2);e([n({type:String})],i.prototype,"href",2);e([n({type:Boolean,attribute:"show-icon"})],i.prototype,"showIcon",2);e([n({type:Boolean,attribute:"show-close-button"})],i.prototype,"showCloseButton",2);e([n({type:String,reflect:!0})],i.prototype,"sizing",2);e([n({type:String,reflect:!0})],i.prototype,"width",2);e([n({type:String,reflect:!0,attribute:"max-width"})],i.prototype,"maxWidth",2);e([n({type:String,reflect:!0})],i.prototype,"height",2);e([n({type:String,reflect:!0,attribute:"max-height"})],i.prototype,"maxHeight",2);e([n({type:Boolean,reflect:!0,attribute:"full-height"})],i.prototype,"fullHeight",2);e([n({type:Boolean,reflect:!0,attribute:"full-width"})],i.prototype,"fullWidth",2);e([n({type:String})],i.prototype,"spacing",2);e([n({type:String,attribute:"spacing-top"})],i.prototype,"spacingTop",2);e([n({type:String,attribute:"spacing-bottom"})],i.prototype,"spacingBottom",2);e([n({type:String,attribute:"spacing-left"})],i.prototype,"spacingLeft",2);e([n({type:String,attribute:"spacing-right"})],i.prototype,"spacingRight",2);i=e([g("scb-notification-card")],i);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.347",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -414,5 +414,5 @@
|
|
|
414
414
|
},
|
|
415
415
|
"./mvc/*": "./mvc/*"
|
|
416
416
|
},
|
|
417
|
-
"buildHash": "
|
|
417
|
+
"buildHash": "1017C6A675E9A08A9187307311F5F7DFB4855F92F7DAB0A57D559FAE7E4F7069"
|
|
418
418
|
}
|
|
@@ -20,6 +20,7 @@ export declare class ScbListItem extends LitElement {
|
|
|
20
20
|
trailing: boolean;
|
|
21
21
|
trailingVariant: '' | 'icon' | 'checkbox' | 'switch';
|
|
22
22
|
trailingIcon: string;
|
|
23
|
+
trailingSwitchLabel: string;
|
|
23
24
|
density: -4 | -2 | 0;
|
|
24
25
|
noDivider: boolean;
|
|
25
26
|
static get styles(): import('lit').CSSResult;
|
|
@@ -2,16 +2,16 @@ import { LitElement as V, css as I, nothing as o, html as n } from "lit";
|
|
|
2
2
|
import { property as s, customElement as L } from "lit/decorators.js";
|
|
3
3
|
import "@material/web/focus/md-focus-ring.js";
|
|
4
4
|
import "@material/web/ripple/ripple.js";
|
|
5
|
-
var z = Object.defineProperty, C = Object.getOwnPropertyDescriptor,
|
|
5
|
+
var z = Object.defineProperty, C = Object.getOwnPropertyDescriptor, _ = (t) => {
|
|
6
6
|
throw TypeError(t);
|
|
7
7
|
}, r = (t, i, e, l) => {
|
|
8
8
|
for (var c = l > 1 ? void 0 : l ? C(i, e) : i, p = t.length - 1, h; p >= 0; p--)
|
|
9
9
|
(h = t[p]) && (c = (l ? h(i, e, c) : h(c)) || c);
|
|
10
10
|
return l && c && z(i, e, c), c;
|
|
11
|
-
}, x = (t, i, e) => i.has(t) ||
|
|
11
|
+
}, x = (t, i, e) => i.has(t) || _("Cannot " + e), v = (t, i, e) => (x(t, i, "read from private field"), e ? e.call(t) : i.get(t)), g = (t, i, e) => i.has(t) ? _("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(t) : i.set(t, e), m = (t, i, e, l) => (x(t, i, "write to private field"), i.set(t, e), e), $ = (t, i, e) => (x(t, i, "access private method"), e), f, u, b, y, w, k;
|
|
12
12
|
let a = class extends V {
|
|
13
13
|
constructor() {
|
|
14
|
-
super(...arguments), g(this, y), this.type = "text", this.href = "", this.itemHref = "", this.target = "", this.disabled = !1, this.label = "", this.supportingText = "", this.overline = "", this.leading = !1, this.leadingVariant = "", this.leadingIcon = "", this.avatarLabel = "", this.avatarAlt = "", this.avatarVariant = "icon", this.avatarSrc = "", this.imgHrefImage = "", this.trailing = !1, this.trailingVariant = "", this.trailingIcon = "", this.density = 0, this.noDivider = !1, g(this, f, !1), g(this, u, !1), g(this,
|
|
14
|
+
super(...arguments), g(this, y), this.type = "text", this.href = "", this.itemHref = "", this.target = "", this.disabled = !1, this.label = "", this.supportingText = "", this.overline = "", this.leading = !1, this.leadingVariant = "", this.leadingIcon = "", this.avatarLabel = "", this.avatarAlt = "", this.avatarVariant = "icon", this.avatarSrc = "", this.imgHrefImage = "", this.trailing = !1, this.trailingVariant = "", this.trailingIcon = "", this.trailingSwitchLabel = "", this.density = 0, this.noDivider = !1, g(this, f, !1), g(this, u, !1), g(this, b, !1), this.onRowClick = () => {
|
|
15
15
|
var e, l;
|
|
16
16
|
if (this.type === "link" && (this.href || this.itemHref)) return;
|
|
17
17
|
const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("scb-checkbox"), i = (l = this.shadowRoot) == null ? void 0 : l.querySelector("scb-switch");
|
|
@@ -184,12 +184,13 @@ let a = class extends V {
|
|
|
184
184
|
</div>` : this.trailingVariant === "switch" && (p = n`
|
|
185
185
|
<div class="trailing">
|
|
186
186
|
<scb-switch
|
|
187
|
+
label=${this.trailingSwitchLabel || o}
|
|
187
188
|
aria-label=${c}
|
|
188
189
|
@click=${(d) => d.stopPropagation()}
|
|
189
190
|
></scb-switch>
|
|
190
191
|
</div>`);
|
|
191
192
|
else this.type === "link" && (p = n`<div class="trailing"><md-icon>${e}</md-icon></div>`);
|
|
192
|
-
const h = this.type === "link" && this.target === "_blank" ? "noopener noreferrer" : o,
|
|
193
|
+
const h = this.type === "link" && this.target === "_blank" ? "noopener noreferrer" : o, S = n`
|
|
193
194
|
${t}
|
|
194
195
|
<div class="texts">
|
|
195
196
|
${this.overline ? n`<div class="overline">${this.overline}</div>` : o}
|
|
@@ -200,7 +201,7 @@ let a = class extends V {
|
|
|
200
201
|
`;
|
|
201
202
|
return n`
|
|
202
203
|
<div class="row" @click=${this.onRowClick} ?inert=${this.disabled} aria-disabled=${this.disabled ? "true" : "false"}>
|
|
203
|
-
${this.type === "link" && i ? n`<a class="link" href=${i} target=${this.target || o} rel=${h}>${
|
|
204
|
+
${this.type === "link" && i ? n`<a class="link" href=${i} target=${this.target || o} rel=${h}>${S}</a>` : S}
|
|
204
205
|
${this.type === "link" ? n`<md-ripple></md-ripple>` : o}
|
|
205
206
|
</div>
|
|
206
207
|
|
|
@@ -210,11 +211,11 @@ let a = class extends V {
|
|
|
210
211
|
};
|
|
211
212
|
f = /* @__PURE__ */ new WeakMap();
|
|
212
213
|
u = /* @__PURE__ */ new WeakMap();
|
|
213
|
-
|
|
214
|
+
b = /* @__PURE__ */ new WeakMap();
|
|
214
215
|
y = /* @__PURE__ */ new WeakSet();
|
|
215
216
|
w = async function() {
|
|
216
217
|
const t = this.type === "link" && (!this.trailing || this.trailingVariant === "icon");
|
|
217
|
-
(this.leading && this.leadingVariant === "icon" || this.trailing && this.trailingVariant === "icon" || t) && !v(this, f) && (await import("@material/web/icon/icon.js"),
|
|
218
|
+
(this.leading && this.leadingVariant === "icon" || this.trailing && this.trailingVariant === "icon" || t) && !v(this, f) && (await import("@material/web/icon/icon.js"), m(this, f, !0)), this.trailing && this.trailingVariant === "checkbox" && !v(this, u) && (await import("../scb-checkbox/scb-checkbox.js"), m(this, u, !0)), this.trailing && this.trailingVariant === "switch" && !v(this, b) && (await import("../scb-switch/scb-switch.js"), m(this, b, !0));
|
|
218
219
|
};
|
|
219
220
|
k = /* @__PURE__ */ new WeakMap();
|
|
220
221
|
r([
|
|
@@ -274,6 +275,9 @@ r([
|
|
|
274
275
|
r([
|
|
275
276
|
s({ type: String, attribute: "trailing-icon" })
|
|
276
277
|
], a.prototype, "trailingIcon", 2);
|
|
278
|
+
r([
|
|
279
|
+
s({ type: String, attribute: "trailing-switch-label" })
|
|
280
|
+
], a.prototype, "trailingSwitchLabel", 2);
|
|
277
281
|
r([
|
|
278
282
|
s({ type: Number, reflect: !0 })
|
|
279
283
|
], a.prototype, "density", 2);
|
|
@@ -51,7 +51,7 @@ let i = class extends f {
|
|
|
51
51
|
super.updated(n), n.has("width") && (this.width && this.width.trim() !== "" ? this.style.inlineSize = this.width : this.style.removeProperty("inline-size")), n.has("maxWidth") && (this.maxWidth && this.maxWidth.trim() !== "" ? this.style.maxInlineSize = this.maxWidth : this.style.removeProperty("max-inline-size")), n.has("height") && (this.height && this.height.trim() !== "" ? this.style.blockSize = this.height : this.style.removeProperty("block-size")), n.has("maxHeight") && (this.maxHeight && this.maxHeight.trim() !== "" ? this.style.maxBlockSize = this.maxHeight : this.style.removeProperty("max-block-size")), (n.has("spacing") || n.has("spacingTop") || n.has("spacingBottom") || n.has("spacingLeft") || n.has("spacingRight")) && this.__applySpacing();
|
|
52
52
|
}
|
|
53
53
|
render() {
|
|
54
|
-
const n = this.direction === "vertical" ? "vertical" : "horizontal", o = this.variant === "success" ? "--_icon-color: var(--md-sys-color-on-success-container, #007041);" : this.variant === "error" ? "--_icon-color: var(--md-sys-color-on-error-container, #942500);" : this.variant === "warning" ? "--_icon-color: var(--md-sys-color-on-warning-container, #6B5600);" : "--_icon-color: var(--md-sys-color-on-info-container, #1E00BE);",
|
|
54
|
+
const n = this.direction === "vertical" ? "vertical" : "horizontal", o = !!(this.title || this.subtitle), s = !!(this.supportingText && !this.title && !this.subtitle && !this.linkText), a = this.variant === "success" ? "--_icon-color: var(--md-sys-color-on-success-container, #007041);" : this.variant === "error" ? "--_icon-color: var(--md-sys-color-on-error-container, #942500);" : this.variant === "warning" ? "--_icon-color: var(--md-sys-color-on-warning-container, #6B5600);" : "--_icon-color: var(--md-sys-color-on-info-container, #1E00BE);", r = this.linkHref && this.linkHref !== "#" ? this.linkHref : this.href || this.linkHref;
|
|
55
55
|
return c`
|
|
56
56
|
<div class="notification" type=${this.variant} role="alert" aria-live="assertive" aria-atomic="true">
|
|
57
57
|
<div class="notification-main ${n}">
|
|
@@ -60,15 +60,17 @@ let i = class extends f {
|
|
|
60
60
|
<md-icon aria-hidden="true">${this._iconForVariant()}</md-icon>
|
|
61
61
|
</div>
|
|
62
62
|
` : null}
|
|
63
|
-
<div class="notification-text-container">
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
<div class="notification-text-container ${s ? "no-gap" : ""}">
|
|
64
|
+
${o ? c`
|
|
65
|
+
<div class="notification-title-container">
|
|
66
|
+
${this.title ? c`<div class="notification-title">${this.title}</div>` : null}
|
|
67
|
+
${this.subtitle ? c`<div class="notification-subtitle">${this.subtitle}</div>` : null}
|
|
68
|
+
</div>
|
|
69
|
+
` : null}
|
|
68
70
|
${this.supportingText ? c`<div class="notification-text">${this.supportingText}</div>` : null}
|
|
69
71
|
${this.linkText ? c`
|
|
70
72
|
<div class="notification-footer">
|
|
71
|
-
<a class="footer-link" href="${
|
|
73
|
+
<a class="footer-link" href="${r}">${this.linkText}</a>
|
|
72
74
|
</div>
|
|
73
75
|
` : null}
|
|
74
76
|
</div>
|
|
@@ -78,7 +80,7 @@ let i = class extends f {
|
|
|
78
80
|
<scb-icon-button
|
|
79
81
|
aria-label="Stäng meddelande"
|
|
80
82
|
icon="close"
|
|
81
|
-
style=${
|
|
83
|
+
style=${a}
|
|
82
84
|
@click=${this._closeNotification}
|
|
83
85
|
>
|
|
84
86
|
</scb-icon-button>
|
|
@@ -320,6 +322,10 @@ i.styles = [
|
|
|
320
322
|
min-width: 0;
|
|
321
323
|
}
|
|
322
324
|
|
|
325
|
+
.notification-text-container.no-gap {
|
|
326
|
+
gap: 0;
|
|
327
|
+
}
|
|
328
|
+
|
|
323
329
|
.notification-title-container{
|
|
324
330
|
display: flex;
|
|
325
331
|
flex-direction: column;
|