scb-wc-test 0.1.83 → 0.1.85
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 +2 -2
- package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +12 -7
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +48 -27
- package/mvc/components/scb-footer/scb-footer.js +1 -1
- package/mvc/components/scb-grid/scb-grid.js +1 -1
- package/mvc/components/scb-header/scb-header.js +1 -1
- package/mvc/components/scb-textfield/scb-textfield.js +1 -0
- package/mvc/components/scb-tooltip/scb-tooltip.js +5 -9
- package/package.json +2 -2
- package/scb-app-bar/scb-app-bar.js +3 -3
- package/scb-breadcrumb/scb-breadcrumb-item.d.ts +6 -0
- package/scb-breadcrumb/scb-breadcrumb-item.js +33 -18
- package/scb-breadcrumb/scb-breadcrumb.d.ts +3 -2
- package/scb-breadcrumb/scb-breadcrumb.js +89 -47
- package/scb-grid/scb-grid.js +12 -10
- package/scb-textfield/scb-textfield.js +1 -0
- package/scb-tooltip/scb-tooltip.d.ts +3 -0
- package/scb-tooltip/scb-tooltip.js +78 -66
- package/scb-wc-test.bundle.js +168 -145
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h,n as d,i as c,x as r,t as m}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-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-tooltip/scb-tooltip.js";import"../scb-button/scb-button.js";import"../scb-list/scb-list.js";import"../scb-list/scb-list-item.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(a,t,i){try{customElements.get(a)||s(a,t,i)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var g=Object.defineProperty,
|
|
1
|
+
import{a as h,n as d,i as c,x as r,t as m}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-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-tooltip/scb-tooltip.js";import"../scb-button/scb-button.js";import"../scb-list/scb-list.js";import"../scb-list/scb-list-item.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(a,t,i){try{customElements.get(a)||s(a,t,i)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=(e,s,a,t)=>{for(var i=t>1?void 0:t?f(s,a):s,n=e.length-1,o;n>=0;n--)(o=e[n])&&(i=(t?o(s,a,i):o(i))||i);return t&&i&&g(s,a,i),i};let l=class extends c{constructor(){super(...arguments),this.title="",this.type="default",this.position="default",this.searchSupportingText=""}handleAvatarSlotChange(e){e.target.assignedElements({flatten:!0}).forEach(t=>{t.tagName==="SCB-AVATAR"&&t.setAttribute("size","small")})}updated(e){e.has("title")&&this.dispatchEvent(new CustomEvent("title-changed",{detail:{title:this.title},bubbles:!0,composed:!0})),e.has("position")&&this.dispatchEvent(new CustomEvent("position-changed",{detail:{position:this.position},bubbles:!0,composed:!0})),e.has("type")&&this.dispatchEvent(new CustomEvent("type-changed",{detail:{type:this.type},bubbles:!0,composed:!0})),e.has("searchSupportingText")&&this.dispatchEvent(new CustomEvent("search-supporting-text-changed",{detail:{searchSupportingText:this.searchSupportingText},bubbles:!0,composed:!0}))}render(){switch(this.type){case"small-flexible":return r`
|
|
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"></slot>
|
|
@@ -156,4 +156,4 @@ import{a as h,n as d,i as c,x as r,t as m}from"../../vendor/vendor.js";import"..
|
|
|
156
156
|
display: flex;
|
|
157
157
|
align-items: center;
|
|
158
158
|
}
|
|
159
|
-
`];p([d({type:String})],l.prototype,"title",2);p([d({type:String})],l.prototype,"type",2);p([d({type:String,reflect:!0})],l.prototype,"position",2);p([d({type:String,attribute:"search-supporting-text"})],l.prototype,"searchSupportingText",2);l=p([m("scb-app-bar")],l);
|
|
159
|
+
`];p([d({type:String,reflect:!0})],l.prototype,"title",2);p([d({type:String,reflect:!0})],l.prototype,"type",2);p([d({type:String,reflect:!0})],l.prototype,"position",2);p([d({type:String,attribute:"search-supporting-text",reflect:!0})],l.prototype,"searchSupportingText",2);l=p([m("scb-app-bar")],l);
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import{n as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import{n as o,t as b,i as p,a as d,x as l}from"../../vendor/vendor.js";import"../scb-link/scb-link.js";import"../../vendor/vendor-material.js";(function(){try{var r=typeof globalThis<"u"?globalThis:window;if(!r.__scb_ce_guard_installed__){r.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(t,a,e){try{customElements.get(t)||s(t,a,e)}catch(i){var n=String(i||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();var f=Object.defineProperty,h=Object.getOwnPropertyDescriptor,u=(r,s,t,a)=>{for(var e=a>1?void 0:a?h(s,t):s,n=r.length-1,i;n>=0;n--)(i=r[n])&&(e=(a?i(s,t,e):i(e))||e);return a&&e&&f(s,t,e),e};let c=class extends p{constructor(){super(...arguments),this.label="",this.isCurrent=!1,this.href=""}static get styles(){return d`
|
|
2
|
+
.breadcrumb-separator {
|
|
3
|
+
margin: var(--spacing-0) var(--spacing-3);
|
|
4
|
+
color: var(--md-sys-color-on-surface);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.breadcrumb-current {
|
|
8
|
+
color: var(--md-sys-color-on-surface);
|
|
9
|
+
font-weight: var(--weight-semibold);
|
|
10
|
+
}
|
|
11
|
+
`}updated(r){r.has("isCurrent")&&this.dispatchEvent(new CustomEvent("current-changed",{detail:{isCurrent:this.isCurrent},bubbles:!0,composed:!0}))}render(){switch(!0){case this.isCurrent:return l`<span class="breadcrumb-current">${this.label}</span>`;default:return l`
|
|
7
12
|
<scb-link href="${this.href}">${this.label}</scb-link>
|
|
8
13
|
<span class="breadcrumb-separator">/</span>
|
|
9
|
-
`}}};
|
|
14
|
+
`}}};u([o({type:String})],c.prototype,"label",2);u([o({type:Boolean,attribute:"is-current",reflect:!0})],c.prototype,"isCurrent",2);u([o({type:String,attribute:"item-href"})],c.prototype,"href",2);c=u([b("scb-breadcrumb-item")],c);
|
|
@@ -1,66 +1,87 @@
|
|
|
1
|
-
import{n as d,t as b,i as
|
|
1
|
+
import{n as d,t as b,i as p,a as u,x as o}from"../../vendor/vendor.js";import"./scb-breadcrumb-item.js";import"../../vendor/vendor-material.js";import"../scb-link/scb-link.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(s,a,t){try{customElements.get(s)||r(s,a,t)}catch(l){var i=String(l||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var m=Object.defineProperty,h=Object.getOwnPropertyDescriptor,c=(e,r,s,a)=>{for(var t=a>1?void 0:a?h(r,s):r,i=e.length-1,l;i>=0;i--)(l=e[i])&&(t=(a?l(r,s,t):l(t))||t);return a&&t&&m(r,s,t),t};let n=class extends p{constructor(){super(...arguments),this.showAll=!1}static get styles(){return u`
|
|
2
2
|
.scb-breadcrumb {
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
5
5
|
flex-wrap: wrap;
|
|
6
6
|
}
|
|
7
|
+
|
|
7
8
|
.breadcrumb-separator {
|
|
8
9
|
margin: var(--spacing-0) var(--spacing-3);
|
|
9
10
|
color: var(--md-sys-color-on-surface);
|
|
10
11
|
}
|
|
12
|
+
|
|
11
13
|
.collapsed > scb-breadcrumb-item {
|
|
12
14
|
display: none;
|
|
13
15
|
}
|
|
14
|
-
|
|
15
|
-
.collapsed > scb-breadcrumb-item:nth-
|
|
16
|
+
|
|
17
|
+
.collapsed > scb-breadcrumb-item:nth-child(-n + 3),
|
|
18
|
+
.collapsed > scb-breadcrumb-item:nth-last-child(-n + 3) {
|
|
16
19
|
display: flex;
|
|
17
20
|
align-items: anchor-center;
|
|
18
21
|
}
|
|
19
|
-
|
|
20
|
-
outline: none;
|
|
21
|
-
}
|
|
22
|
+
|
|
22
23
|
.ellipsis {
|
|
23
24
|
cursor: pointer;
|
|
24
25
|
display: inline-flex;
|
|
25
26
|
color: var(--md-sys-color-primary);
|
|
26
27
|
position: relative;
|
|
27
28
|
}
|
|
29
|
+
|
|
30
|
+
.ellipsis:focus {
|
|
31
|
+
outline: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
.collapsed .ellipsis {
|
|
29
35
|
display: inline-flex;
|
|
30
36
|
}
|
|
37
|
+
|
|
31
38
|
.expanded .ellipsis {
|
|
32
39
|
display: none;
|
|
33
40
|
}
|
|
41
|
+
|
|
34
42
|
.breadcrumb-animate {
|
|
35
43
|
opacity: 0;
|
|
36
44
|
transform: translateY(10px);
|
|
37
|
-
animation: fadeInBreadcrumb 0.4s cubic-bezier(0.4,0,0.2,1) forwards;
|
|
45
|
+
animation: fadeInBreadcrumb 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
|
|
38
46
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
|
|
48
|
+
md-focus-ring {
|
|
49
|
+
position: absolute;
|
|
50
|
+
inset: 0;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
display: none;
|
|
53
|
+
border-radius: var(
|
|
54
|
+
--scb-card-focus-ring-radius,
|
|
55
|
+
var(--md-sys-shape-corner-large)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ellipsis:focus md-focus-ring {
|
|
60
|
+
display: block;
|
|
61
|
+
}
|
|
62
|
+
|
|
49
63
|
@keyframes fadeInBreadcrumb {
|
|
50
64
|
to {
|
|
51
65
|
opacity: 1;
|
|
52
66
|
transform: translateY(0);
|
|
53
67
|
}
|
|
54
68
|
}
|
|
55
|
-
`}_onEllipsisClick(){this.showAll?this.showAll=!1:(this.showAll=!0,this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelectorAll(".scb-breadcrumb.expanded > scb-breadcrumb-item");e&&(e.forEach((r,s)=>{r.classList.add("breadcrumb-animate"),r.style.animationDelay=`${s*60}ms`}),setTimeout(()=>{e.forEach(r=>{r.classList.remove("breadcrumb-animate"),r.style.animationDelay=""})},600))}))}
|
|
69
|
+
`}connectedCallback(){super.connectedCallback(),this._observer=new MutationObserver(()=>{this.requestUpdate()}),this._observer.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}updated(e){e.has("showAll")&&this.dispatchEvent(new CustomEvent("show-all-changed",{detail:{showAll:this.showAll},bubbles:!0,composed:!0}))}_onEllipsisClick(){this.showAll?this.showAll=!1:(this.showAll=!0,this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelectorAll(".scb-breadcrumb.expanded > scb-breadcrumb-item");e&&(e.forEach((r,s)=>{r.classList.add("breadcrumb-animate"),r.style.animationDelay=`${s*60}ms`}),setTimeout(()=>{e.forEach(r=>{r.classList.remove("breadcrumb-animate"),r.style.animationDelay=""})},600))}))}render(){let e=[];if(this.children.length||(e=Array.from(this.shadowRoot?this.shadowRoot.querySelectorAll("scb-breadcrumb-item"):[])),e.length||(e=Array.from(this.children).filter(s=>s.tagName.toLowerCase()==="scb-breadcrumb-item")),e.length>0){const s=e.length-1;e.forEach((a,t)=>{a.toggleAttribute("is-current",t===s)})}const r=e.length>6&&!this.showAll;return o`
|
|
56
70
|
<div class="scb-breadcrumb ${r?"collapsed":"expanded"}">
|
|
57
|
-
${r?e.map((s,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
71
|
+
${r?e.map((s,a)=>a===3?o`<span
|
|
72
|
+
class="ellipsis"
|
|
73
|
+
aria-label="Visa alla"
|
|
74
|
+
role="button"
|
|
75
|
+
tabindex="0"
|
|
76
|
+
@click=${this._onEllipsisClick}
|
|
77
|
+
@keydown=${t=>{(t.key==="Enter"||t.key===" ")&&this._onEllipsisClick()}}
|
|
78
|
+
>
|
|
79
|
+
<md-icon>
|
|
80
|
+
<md-focus-ring></md-focus-ring>
|
|
81
|
+
more_horiz
|
|
82
|
+
</md-icon>
|
|
83
|
+
</span>
|
|
84
|
+
<span class="breadcrumb-separator">/</span>
|
|
85
|
+
${s}`:o`${s}`):e.map(s=>s)}
|
|
65
86
|
</div>
|
|
66
|
-
`}};c([d({type:Boolean})],n.prototype,"showAll",2);n=c([b("scb-breadcrumb")],n);
|
|
87
|
+
`}};c([d({type:Boolean,attribute:"show-all",reflect:!0})],n.prototype,"showAll",2);n=c([b("scb-breadcrumb")],n);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as A,n as x,i as B,x as v,t as H}from"../../vendor/vendor.js";import"../scb-link/scb-link.js";import"../scb-grid/scb-grid.js";import"../scb-grid/scb-grid-item.js";import"./scb-footer-section.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(i,a,r){try{customElements.get(i)||t(i,a,r)}catch(c){var n=String(c||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var T=Object.defineProperty,z=Object.getOwnPropertyDescriptor,O=e=>{throw TypeError(e)},b=(e,t,i,a)=>{for(var r=a>1?void 0:a?z(t,i):t,n=e.length-1,c;n>=0;n--)(c=e[n])&&(r=(a?c(t,i,r):c(r))||r);return a&&r&&T(t,i,r),r},C=(e,t,i)=>t.has(e)||O("Cannot "+i),l=(e,t,i)=>(C(e,t,"read from private field"),i?i.call(e):t.get(e)),h=(e,t,i)=>t.has(e)?O("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),d=(e,t,i,a)=>(C(e,t,"write to private field"),t.set(e,i),i),o=(e,t,i)=>(C(e,t,"access private method"),i),f,m,g,u,s,N,w,E,_,k,M,W,S;let p=class extends B{constructor(){super(...arguments),h(this,s),this.maxWidth="1440px",this.deferPaint=!1,this.sections=[],this.description="Statistikmyndigheten SCB förser samhället med statistik för beslutsfattande, debatt och forskning.",h(this,f,null),h(this,m,""),h(this,g),h(this,u,!1),h(this,k,8)}connectedCallback(){super.connectedCallback(),this.style.setProperty("--scb-footer-max-width",this.maxWidth),o(this,s,_).call(this,!0),o(this,s,N).call(this)}updated(e){e.has("maxWidth")&&this.style.setProperty("--scb-footer-max-width",this.maxWidth)}disconnectedCallback(){super.disconnectedCallback(),l(this,g)?.disconnect()}render(){const e=l(this,s,E);return v`
|
|
1
|
+
import{a as A,n as x,i as B,x as v,t as H}from"../../vendor/vendor.js";import"../scb-link/scb-link.js";import"../scb-grid/scb-grid.js";import"../scb-grid/scb-grid-item.js";import"./scb-footer-section.js";import"../../vendor/vendor-material.js";import"../scb-grid/scb-stack.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(i,a,r){try{customElements.get(i)||t(i,a,r)}catch(c){var n=String(c||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var T=Object.defineProperty,z=Object.getOwnPropertyDescriptor,O=e=>{throw TypeError(e)},b=(e,t,i,a)=>{for(var r=a>1?void 0:a?z(t,i):t,n=e.length-1,c;n>=0;n--)(c=e[n])&&(r=(a?c(t,i,r):c(r))||r);return a&&r&&T(t,i,r),r},C=(e,t,i)=>t.has(e)||O("Cannot "+i),l=(e,t,i)=>(C(e,t,"read from private field"),i?i.call(e):t.get(e)),h=(e,t,i)=>t.has(e)?O("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),d=(e,t,i,a)=>(C(e,t,"write to private field"),t.set(e,i),i),o=(e,t,i)=>(C(e,t,"access private method"),i),f,m,g,u,s,N,w,E,_,k,M,W,S;let p=class extends B{constructor(){super(...arguments),h(this,s),this.maxWidth="1440px",this.deferPaint=!1,this.sections=[],this.description="Statistikmyndigheten SCB förser samhället med statistik för beslutsfattande, debatt och forskning.",h(this,f,null),h(this,m,""),h(this,g),h(this,u,!1),h(this,k,8)}connectedCallback(){super.connectedCallback(),this.style.setProperty("--scb-footer-max-width",this.maxWidth),o(this,s,_).call(this,!0),o(this,s,N).call(this)}updated(e){e.has("maxWidth")&&this.style.setProperty("--scb-footer-max-width",this.maxWidth)}disconnectedCallback(){super.disconnectedCallback(),l(this,g)?.disconnect()}render(){const e=l(this,s,E);return v`
|
|
2
2
|
<footer class="outer" role="contentinfo">
|
|
3
3
|
<nav aria-label="Sidfot med länkar">
|
|
4
4
|
<scb-grid
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h,n as s,i as b,x as v,t as y}from"../../vendor/vendor.js";(function(){try{var r=typeof globalThis<"u"?globalThis:window;if(!r.__scb_ce_guard_installed__){r.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(i,n,o){try{customElements.get(i)||t(i,n,o)}catch(p){var c=String(p||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var w=Object.defineProperty,f=Object.getOwnPropertyDescriptor,u=r=>{throw TypeError(r)},a=(r,t,i,n)=>{for(var o=n>1?void 0:n?f(t,i):t,c=r.length-1,p;c>=0;c--)(p=r[c])&&(o=(n?p(t,i,o):p(o))||o);return n&&o&&w(t,i,o),o},x=(r,t,i)=>t.has(r)||u("Cannot "+i),_=(r,t,i)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,i),l=(r,t,i)=>(x(r,t,"access private method"),i),d,m
|
|
1
|
+
import{a as h,n as s,i as b,x as v,t as y}from"../../vendor/vendor.js";import"./scb-grid-item.js";import"./scb-stack.js";(function(){try{var r=typeof globalThis<"u"?globalThis:window;if(!r.__scb_ce_guard_installed__){r.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(i,n,o){try{customElements.get(i)||t(i,n,o)}catch(p){var c=String(p||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var w=Object.defineProperty,f=Object.getOwnPropertyDescriptor,u=r=>{throw TypeError(r)},a=(r,t,i,n)=>{for(var o=n>1?void 0:n?f(t,i):t,c=r.length-1,p;c>=0;c--)(p=r[c])&&(o=(n?p(t,i,o):p(o))||o);return n&&o&&w(t,i,o),o},x=(r,t,i)=>t.has(r)||u("Cannot "+i),_=(r,t,i)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,i),l=(r,t,i)=>(x(r,t,"access private method"),i),d,g,m;let e=class extends b{constructor(){super(...arguments),_(this,d),this.colsCompact=4,this.colsMedium=8,this.colsExpanded=12,this.gap="",this.rowGap="",this.columnGap="",this.alignItems="stretch",this.justifyItems="stretch",this.paddingInline="",this.paddingBlock="",this.maxWidth="",this.autoRows=""}firstUpdated(){l(this,d,g).call(this)}updated(){l(this,d,g).call(this)}mapSpacingToken(r){if(!r)return;const t=String(r).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}parseGapShorthand(r){if(!r)return{};const t=r.trim().split(/\s+/);if(t.length===1){const i=this.mapSpacingToken(t[0]);return{row:i,col:i}}return{row:this.mapSpacingToken(t[0]),col:this.mapSpacingToken(t[1])}}render(){return v`<div class="grid"><slot></slot></div>`}};d=new WeakSet;g=function(){this.style.setProperty("--scb-grid-cols-compact",String(this.colsCompact)),this.style.setProperty("--scb-grid-cols-medium",String(this.colsMedium)),this.style.setProperty("--scb-grid-cols-expanded",String(this.colsExpanded));const r="var(--spacing-7, 24px)",t=this.parseGapShorthand(this.gap),i=this.mapSpacingToken(this.rowGap)??t.row??r,n=this.mapSpacingToken(this.columnGap)??t.col??r;this.style.setProperty("--scb-grid-row-gap",i),this.style.setProperty("--scb-grid-column-gap",n),this.style.setProperty("--scb-grid-gap",`${i} ${n}`),this.style.setProperty("--scb-grid-align-items",this.alignItems),this.style.setProperty("--scb-grid-justify-items",this.justifyItems);const o=this.mapSpacingToken(this.paddingInline),c=this.mapSpacingToken(this.paddingBlock);l(this,d,m).call(this,"--scb-grid-max-width",this.maxWidth),l(this,d,m).call(this,"--scb-grid-padding-inline",o??""),l(this,d,m).call(this,"--scb-grid-padding-block",c??""),l(this,d,m).call(this,"--scb-grid-auto-rows",this.autoRows)};m=function(r,t){t?this.style.setProperty(r,t):this.style.removeProperty(r)};e.styles=h`
|
|
2
2
|
:host {
|
|
3
3
|
box-sizing: border-box;
|
|
4
4
|
display: block;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../scb-drawer/scb-drawer.js","../../vendor/preload-helper.js","../../vendor/vendor.js","../scb-divider/scb-divider.js","../scb-tabs/scb-tabs.js","../../vendor/vendor-material.js","../scb-tabs/scb-primary-tab.js","../scb-tabs/scb-secondary-tab.js","../scb-search/scb-search.js","../scb-list/scb-list.js","../scb-list/scb-list-item.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as g}from"../../vendor/preload-helper.js";import{a as x,n as l,r as u,i as S,x as c,E as d,t as C}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-grid/scb-grid-item.js";import"../scb-grid/scb-grid.js";import"../scb-link/scb-link.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";import"../scb-tooltip/scb-tooltip.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(r,i,o){try{customElements.get(r)||t(r,i,o)}catch(n){var h=String(n||"");if(h.indexOf("already been used")===-1&&h.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var T=Object.defineProperty,$=Object.getOwnPropertyDescriptor,a=(e,t,r,i)=>{for(var o=i>1?void 0:i?$(t,r):t,h=e.length-1,n;h>=0;h--)(n=e[h])&&(o=(i?n(t,r,o):n(o))||o);return i&&o&&T(t,r,o),o};const v={fromAttribute:e=>e==null?!0:!/^(false|0|off|no)$/i.test(e),toAttribute:e=>String(!!e)};let s=class extends S{constructor(){super(...arguments),this.maxWidth="1440px",this.logoText="",this.logoHref="/",this.banner=!1,this.tabs=[],this.activeTab=0,this.utilityItems=[],this.showDrawer=!0,this.showSearch=!0,this.includeUtilityInDrawer=!1,this.searchText="",this._drawerId="main-drawer",this._drawerMounted=!1,this._drawerExpanded=!1,this._searchId="header-search",this._slotTabs=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{this._scheduleMeasure()},this._onDrawerSelect=e=>{this.dispatchEvent(new CustomEvent("drawer-select",{detail:e.detail,bubbles:!0,composed:!0})),this._closeDrawerNow()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._harvestPending=!1,this.__drawerLoaded=!1,this.__tabsLoaded=!1,this.__searchLoaded=!1,this._harvest=()=>{const e=this._slotEl;if(!e)return;const t=e.assignedElements({flatten:!0}),r=[],i=[],o=[],h=n=>({label:n.getAttribute("label")??"",href:n.getAttribute("href")??void 0,icon:n.getAttribute("icon")??void 0});for(const n of t){const p=n.tagName.toLowerCase();if(p==="scb-header-tab"){r.push({label:n.getAttribute("label")??"",href:n.getAttribute("href")??"#"});continue}if(p==="scb-header-utility"){i.push({label:n.getAttribute("label")??"",href:n.getAttribute("href")??"#",target:n.getAttribute("target")??void 0});continue}if(p==="scb-header-drawer-group"){const b={label:n.getAttribute("label")??"",icon:n.getAttribute("icon")??void 0,children:[]};n.querySelectorAll("scb-header-drawer-item").forEach(m=>b.children.push(h(m))),o.push(b);continue}p==="scb-header-drawer-item"&&o.push(h(n))}this._slotTabs=r,this._slotUtils=i,this._slotMenu=o,queueMicrotask(()=>{this.updateComplete.then(()=>{this._applyActiveToTabs(),this._scheduleMeasure()})})},this._measure=()=>{const e=this._top,t=this._logoGroup;if(!e||!t)return;const r=window.innerWidth,i=e.clientWidth,o=this._overflows(this._util),h=this._overflows(this._tabsEl),n=r<this.BP_MD||o||h;this._collapsed?!n&&i>=this._unlockAtWidth&&this._setCollapsed(!1):n&&(this._unlockAtWidth=i+this._HYST,this._setCollapsed(!0));let p=!1;if(this.showSearch&&r>=this.BP_SM&&r<this.BP_MD&&this._searchWrap){const m=getComputedStyle(this._searchWrap),y=Math.max(this._num(m.minWidth,this._tokenPx("--scb-header-search-min",320)),this._tokenPx("--scb-header-search-min",320)),_=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),f=this.showDrawer&&(r<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-large",48):0;p=t.getBoundingClientRect().width+_+y+_+f+8>i+.5}this._setHideSearch(p);let b=!1;if(this.showDrawer&&(r<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const m=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),y=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-large",48),_=(this._logoGroup?.getBoundingClientRect().width||0)+m+y;this._hideLogoText?b=!(i>=this._logoTextUnlockAt):_>i+.5&&(b=!0,this._logoTextUnlockAt=i+this._HYST)}else b=!1,this._logoTextUnlockAt=0;this._setHideLogoText(b)},this._onMenuClick=async e=>{e.preventDefault(),e.stopPropagation(),this.showDrawer&&(this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),await this._ensureDrawerMounted(),await s._nextFrame(),await s._nextFrame(),this._openDrawerNow())},this._onSearchClick=e=>{const t=this._searchEl;if(t?.submit&&typeof t.submit=="function"){t.submit();return}const r=t?.value??"";this.searchText=r,this.dispatchEvent(new CustomEvent("search-click",{detail:{value:r},bubbles:!0,composed:!0})),t?.focus?.()},this._onTabsChange=e=>{const r=e?.detail?.activeTabIndex??e.target?.activeTabIndex??0;this.activeTab=r;const o=(this._slotTabs.length?this._slotTabs:this.tabs)[r]?.href??"";this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:r,href:o},bubbles:!0,composed:!0}))},this._onSearchInput=e=>{this.searchText=e.detail?.value??"",this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0}))},this._onSearchSubmit=e=>{this.searchText=e.detail?.value??"",this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:e.detail?.active},bubbles:!0,composed:!0}))},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0}))}}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",s.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",s.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}async __ensureDrawer(){if(!this.__drawerLoaded)return this.__ensureDrawerPromise??(this.__ensureDrawerPromise=(async()=>{await g(()=>import("../scb-drawer/scb-drawer.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),this.__drawerLoaded=!0})()),this.__ensureDrawerPromise}async __ensureTabs(){if(!this.__tabsLoaded)return this.__ensureTabsPromise??(this.__ensureTabsPromise=(async()=>{await Promise.all([g(()=>import("../scb-tabs/scb-tabs.js"),__vite__mapDeps([4,5,2,6,1,7]),import.meta.url),g(()=>import("../scb-tabs/scb-secondary-tab.js"),__vite__mapDeps([7,1,5,2]),import.meta.url)]),this.__tabsLoaded=!0})()),this.__ensureTabsPromise}async __ensureSearch(){if(!this.__searchLoaded)return this.__ensureSearchPromise??(this.__ensureSearchPromise=(async()=>{await g(()=>import("../scb-search/scb-search.js"),__vite__mapDeps([8,2,9,1,10,5]),import.meta.url),this.__searchLoaded=!0})()),this.__ensureSearchPromise}get _slotEl(){return this.shadowRoot?.querySelector("slot#data-slot")??null}get _top(){return this.renderRoot.querySelector(".top-row")}get _util(){return this.renderRoot.querySelector(".utility")}get _tabsEl(){return this.renderRoot.querySelector("scb-tabs")}get _logoGroup(){return this.renderRoot.querySelector(".logo-wrap")||this.renderRoot.querySelector(".logo-group")}get _searchWrap(){return this.renderRoot.querySelector(".search")}get _menuBtn(){return this.renderRoot.querySelector(".menu-trigger")}get _searchEl(){return this.renderRoot.querySelector(`#${this._searchId}`)}_attachSlotObservers(){this._slotMo?.disconnect();const e=new MutationObserver(t=>{this._scheduleHarvest()});this._slotMo=e,e.observe(this,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["label","href","icon","target"]})}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute("data-collapsed",""):this.removeAttribute("data-collapsed"))}_setHideSearch(e){e?this.setAttribute("data-hide-search",""):this.removeAttribute("data-hide-search")}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute("data-hide-logo-text",""):this.removeAttribute("data-hide-logo-text"))}_num(e,t){const r=Number.parseFloat(String(e??"").trim());return Number.isFinite(r)?r:t}_tokenPx(e,t){const r=getComputedStyle(this);return this._num(r.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!=="none":!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}firstUpdated(){this.updateComplete.then(()=>{this._harvest(),this._attachSlotObservers()});const e=this._top;e&&(this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(e)),window.addEventListener("resize",this._onWindowResize,{passive:!0});const t=this._menuBtn,r=()=>this._ensureDrawerMounted();t?.addEventListener("pointerenter",r,{once:!0}),t?.addEventListener("focusin",r,{once:!0}),t?.addEventListener("touchstart",r,{once:!0,passive:!0});const i=o=>"requestIdleCallback"in window?window.requestIdleCallback(o,{timeout:1500}):setTimeout(o,600);this.showDrawer&&i(()=>{this.__ensureDrawer()}),this._collapsed||i(()=>{this.__ensureTabs()}),this.showSearch&&i(()=>{this.__ensureSearch()})}updated(e){e.has("searchMax")&&this.style.setProperty("--scb-header-search-max",this.searchMax??"480px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"320px"),e.has("searchHeight")&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty("--scb-search-height",this.searchHeight.trim()):this.style.removeProperty("--scb-search-height")),(e.has("utilityItems")||e.has("tabs")||e.has("logoText")||e.has("activeTab")||e.has("_slotTabs")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("showSearch")||e.has("searchMax")||e.has("searchMin"))&&this.updateComplete.then(()=>{this._scheduleMeasure(),this._applyActiveToTabs()}),e.has("showSearch")&&this.showSearch&&!this.__searchLoaded&&this.__ensureSearch()}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}async _ensureDrawerMounted(){this._drawerMounted||(await this.__ensureDrawer(),this._drawerMounted=!0,await this.updateComplete)}_openDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0,e.setAttribute("open",""),e.show?.(),e.openDrawer?.(),this._drawerExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})))}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1),this._drawerExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0}))}_syncMenuBtnAria(){const e=this.renderRoot.querySelector(".menu-trigger");e&&e.setAttribute("aria-expanded",String(this._drawerExpanded))}_applyActiveToTabs(){const e=this._tabsEl;if(!e)return;e.activeTabIndex=this.activeTab,e.querySelectorAll("scb-secondary-tab").forEach((r,i)=>{r.selected=i===this.activeTab})}_renderDrawerNodes(e){return!e||e.length===0?c``:c`${e.map(t=>{const r=Array.isArray(t.children)&&t.children.length>0;return c`
|
|
2
|
+
import{_ as g}from"../../vendor/preload-helper.js";import{a as x,n as l,r as u,i as S,x as c,E as d,t as C}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-grid/scb-grid-item.js";import"../scb-grid/scb-grid.js";import"../scb-link/scb-link.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";import"../scb-grid/scb-stack.js";import"../scb-tooltip/scb-tooltip.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(r,i,o){try{customElements.get(r)||t(r,i,o)}catch(n){var h=String(n||"");if(h.indexOf("already been used")===-1&&h.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var T=Object.defineProperty,$=Object.getOwnPropertyDescriptor,a=(e,t,r,i)=>{for(var o=i>1?void 0:i?$(t,r):t,h=e.length-1,n;h>=0;h--)(n=e[h])&&(o=(i?n(t,r,o):n(o))||o);return i&&o&&T(t,r,o),o};const v={fromAttribute:e=>e==null?!0:!/^(false|0|off|no)$/i.test(e),toAttribute:e=>String(!!e)};let s=class extends S{constructor(){super(...arguments),this.maxWidth="1440px",this.logoText="",this.logoHref="/",this.banner=!1,this.tabs=[],this.activeTab=0,this.utilityItems=[],this.showDrawer=!0,this.showSearch=!0,this.includeUtilityInDrawer=!1,this.searchText="",this._drawerId="main-drawer",this._drawerMounted=!1,this._drawerExpanded=!1,this._searchId="header-search",this._slotTabs=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{this._scheduleMeasure()},this._onDrawerSelect=e=>{this.dispatchEvent(new CustomEvent("drawer-select",{detail:e.detail,bubbles:!0,composed:!0})),this._closeDrawerNow()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._harvestPending=!1,this.__drawerLoaded=!1,this.__tabsLoaded=!1,this.__searchLoaded=!1,this._harvest=()=>{const e=this._slotEl;if(!e)return;const t=e.assignedElements({flatten:!0}),r=[],i=[],o=[],h=n=>({label:n.getAttribute("label")??"",href:n.getAttribute("href")??void 0,icon:n.getAttribute("icon")??void 0});for(const n of t){const p=n.tagName.toLowerCase();if(p==="scb-header-tab"){r.push({label:n.getAttribute("label")??"",href:n.getAttribute("href")??"#"});continue}if(p==="scb-header-utility"){i.push({label:n.getAttribute("label")??"",href:n.getAttribute("href")??"#",target:n.getAttribute("target")??void 0});continue}if(p==="scb-header-drawer-group"){const b={label:n.getAttribute("label")??"",icon:n.getAttribute("icon")??void 0,children:[]};n.querySelectorAll("scb-header-drawer-item").forEach(m=>b.children.push(h(m))),o.push(b);continue}p==="scb-header-drawer-item"&&o.push(h(n))}this._slotTabs=r,this._slotUtils=i,this._slotMenu=o,queueMicrotask(()=>{this.updateComplete.then(()=>{this._applyActiveToTabs(),this._scheduleMeasure()})})},this._measure=()=>{const e=this._top,t=this._logoGroup;if(!e||!t)return;const r=window.innerWidth,i=e.clientWidth,o=this._overflows(this._util),h=this._overflows(this._tabsEl),n=r<this.BP_MD||o||h;this._collapsed?!n&&i>=this._unlockAtWidth&&this._setCollapsed(!1):n&&(this._unlockAtWidth=i+this._HYST,this._setCollapsed(!0));let p=!1;if(this.showSearch&&r>=this.BP_SM&&r<this.BP_MD&&this._searchWrap){const m=getComputedStyle(this._searchWrap),y=Math.max(this._num(m.minWidth,this._tokenPx("--scb-header-search-min",320)),this._tokenPx("--scb-header-search-min",320)),_=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),f=this.showDrawer&&(r<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-large",48):0;p=t.getBoundingClientRect().width+_+y+_+f+8>i+.5}this._setHideSearch(p);let b=!1;if(this.showDrawer&&(r<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const m=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),y=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-large",48),_=(this._logoGroup?.getBoundingClientRect().width||0)+m+y;this._hideLogoText?b=!(i>=this._logoTextUnlockAt):_>i+.5&&(b=!0,this._logoTextUnlockAt=i+this._HYST)}else b=!1,this._logoTextUnlockAt=0;this._setHideLogoText(b)},this._onMenuClick=async e=>{e.preventDefault(),e.stopPropagation(),this.showDrawer&&(this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),await this._ensureDrawerMounted(),await s._nextFrame(),await s._nextFrame(),this._openDrawerNow())},this._onSearchClick=e=>{const t=this._searchEl;if(t?.submit&&typeof t.submit=="function"){t.submit();return}const r=t?.value??"";this.searchText=r,this.dispatchEvent(new CustomEvent("search-click",{detail:{value:r},bubbles:!0,composed:!0})),t?.focus?.()},this._onTabsChange=e=>{const r=e?.detail?.activeTabIndex??e.target?.activeTabIndex??0;this.activeTab=r;const o=(this._slotTabs.length?this._slotTabs:this.tabs)[r]?.href??"";this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:r,href:o},bubbles:!0,composed:!0}))},this._onSearchInput=e=>{this.searchText=e.detail?.value??"",this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0}))},this._onSearchSubmit=e=>{this.searchText=e.detail?.value??"",this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:e.detail?.active},bubbles:!0,composed:!0}))},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0}))}}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",s.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",s.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}async __ensureDrawer(){if(!this.__drawerLoaded)return this.__ensureDrawerPromise??(this.__ensureDrawerPromise=(async()=>{await g(()=>import("../scb-drawer/scb-drawer.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),this.__drawerLoaded=!0})()),this.__ensureDrawerPromise}async __ensureTabs(){if(!this.__tabsLoaded)return this.__ensureTabsPromise??(this.__ensureTabsPromise=(async()=>{await Promise.all([g(()=>import("../scb-tabs/scb-tabs.js"),__vite__mapDeps([4,5,2,6,1,7]),import.meta.url),g(()=>import("../scb-tabs/scb-secondary-tab.js"),__vite__mapDeps([7,1,5,2]),import.meta.url)]),this.__tabsLoaded=!0})()),this.__ensureTabsPromise}async __ensureSearch(){if(!this.__searchLoaded)return this.__ensureSearchPromise??(this.__ensureSearchPromise=(async()=>{await g(()=>import("../scb-search/scb-search.js"),__vite__mapDeps([8,2,9,1,10,5]),import.meta.url),this.__searchLoaded=!0})()),this.__ensureSearchPromise}get _slotEl(){return this.shadowRoot?.querySelector("slot#data-slot")??null}get _top(){return this.renderRoot.querySelector(".top-row")}get _util(){return this.renderRoot.querySelector(".utility")}get _tabsEl(){return this.renderRoot.querySelector("scb-tabs")}get _logoGroup(){return this.renderRoot.querySelector(".logo-wrap")||this.renderRoot.querySelector(".logo-group")}get _searchWrap(){return this.renderRoot.querySelector(".search")}get _menuBtn(){return this.renderRoot.querySelector(".menu-trigger")}get _searchEl(){return this.renderRoot.querySelector(`#${this._searchId}`)}_attachSlotObservers(){this._slotMo?.disconnect();const e=new MutationObserver(t=>{this._scheduleHarvest()});this._slotMo=e,e.observe(this,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["label","href","icon","target"]})}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute("data-collapsed",""):this.removeAttribute("data-collapsed"))}_setHideSearch(e){e?this.setAttribute("data-hide-search",""):this.removeAttribute("data-hide-search")}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute("data-hide-logo-text",""):this.removeAttribute("data-hide-logo-text"))}_num(e,t){const r=Number.parseFloat(String(e??"").trim());return Number.isFinite(r)?r:t}_tokenPx(e,t){const r=getComputedStyle(this);return this._num(r.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!=="none":!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}firstUpdated(){this.updateComplete.then(()=>{this._harvest(),this._attachSlotObservers()});const e=this._top;e&&(this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(e)),window.addEventListener("resize",this._onWindowResize,{passive:!0});const t=this._menuBtn,r=()=>this._ensureDrawerMounted();t?.addEventListener("pointerenter",r,{once:!0}),t?.addEventListener("focusin",r,{once:!0}),t?.addEventListener("touchstart",r,{once:!0,passive:!0});const i=o=>"requestIdleCallback"in window?window.requestIdleCallback(o,{timeout:1500}):setTimeout(o,600);this.showDrawer&&i(()=>{this.__ensureDrawer()}),this._collapsed||i(()=>{this.__ensureTabs()}),this.showSearch&&i(()=>{this.__ensureSearch()})}updated(e){e.has("searchMax")&&this.style.setProperty("--scb-header-search-max",this.searchMax??"480px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"320px"),e.has("searchHeight")&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty("--scb-search-height",this.searchHeight.trim()):this.style.removeProperty("--scb-search-height")),(e.has("utilityItems")||e.has("tabs")||e.has("logoText")||e.has("activeTab")||e.has("_slotTabs")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("showSearch")||e.has("searchMax")||e.has("searchMin"))&&this.updateComplete.then(()=>{this._scheduleMeasure(),this._applyActiveToTabs()}),e.has("showSearch")&&this.showSearch&&!this.__searchLoaded&&this.__ensureSearch()}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}async _ensureDrawerMounted(){this._drawerMounted||(await this.__ensureDrawer(),this._drawerMounted=!0,await this.updateComplete)}_openDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0,e.setAttribute("open",""),e.show?.(),e.openDrawer?.(),this._drawerExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})))}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1),this._drawerExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0}))}_syncMenuBtnAria(){const e=this.renderRoot.querySelector(".menu-trigger");e&&e.setAttribute("aria-expanded",String(this._drawerExpanded))}_applyActiveToTabs(){const e=this._tabsEl;if(!e)return;e.activeTabIndex=this.activeTab,e.querySelectorAll("scb-secondary-tab").forEach((r,i)=>{r.selected=i===this.activeTab})}_renderDrawerNodes(e){return!e||e.length===0?c``:c`${e.map(t=>{const r=Array.isArray(t.children)&&t.children.length>0;return c`
|
|
3
3
|
<scb-drawer-item
|
|
4
4
|
label=${t.label}
|
|
5
5
|
?selected=${!1}
|
|
@@ -47,6 +47,7 @@ import{_ as h}from"../../vendor/preload-helper.js";import{i as p,x as c,a as u,n
|
|
|
47
47
|
--scb-textfield-tel-max-width:400px;
|
|
48
48
|
--scb-textfield-url-max-width:400px;
|
|
49
49
|
--scb-textfield-textarea-max-width:600px;
|
|
50
|
+
font-family: var(--brand-font);
|
|
50
51
|
}
|
|
51
52
|
:host([type="number"]) {
|
|
52
53
|
--scb-textfield-max-width: var(--scb-textfield-number-max-width);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as F,n as p,i as I,x
|
|
1
|
+
import{a as F,n as p,i as I,x,E as V,t as j}from"../../vendor/vendor.js";import"../scb-button/scb-button.js";import"../../vendor/vendor-material.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(o,r,i){try{customElements.get(o)||e(o,r,i)}catch(d){var c=String(d||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var q=Object.defineProperty,X=Object.getOwnPropertyDescriptor,h=(t,e,o,r)=>{for(var i=r>1?void 0:r?X(e,o):e,c=t.length-1,d;c>=0;c--)(d=t[c])&&(i=(r?d(e,o,i):d(i))||i);return r&&i&&q(e,o,i),i};let Y=0,l=class extends I{constructor(){super(...arguments),this.variant="plain",this.arrow=null,this.supportingtext="",this.label="",this.trigger="hover",this.position="top",this.open=!1,this.delay=.25,this.offset=0,this._hoverActive=!1,this._clickActive=!1,this._hideTimeout=null,this._triggerEl=null,this._originalPosition="top",this._tooltipId=`scb-tooltip-${++Y}`,this._onTriggerMouseEnter=()=>{this._hoverActive=!0,this.open=!0},this._onTriggerMouseLeave=()=>{this._hoverActive=!1,this._clickActive||(this.open=!1)},this._onTriggerFocus=()=>{this._hoverActive=!0,this.open=!0},this._onTriggerBlur=()=>{this._hoverActive=!1,this._clickActive||(this.open=!1)},this._onTooltipMouseEnter=()=>{(this.trigger==="hover"||this.trigger==="hover-click")&&(this._hoverActive=!0,this.open=!0)},this._onTooltipMouseLeave=()=>{(this.trigger==="hover"||this.trigger==="hover-click")&&(this._hoverActive=!1,this._clickActive||(this.open=!1))},this._onTriggerClick=()=>{this._clickActive=!this._clickActive,this._clickActive?this.open=!0:this._hoverActive||(this.open=!1)}}firstUpdated(){if(this._originalPosition=this.position,this._updateDelayCss(),this._updateTriggerElement(),this._updateTooltipHoverListeners(),this.open){const t=this._getTooltipElement();t&&this._showTooltip(t)}}updated(t){if(t.has("trigger")&&(this._updateTriggerElement(),this._updateTooltipHoverListeners()),t.has("delay")&&this._updateDelayCss(),t.has("open")){const e=this._getTooltipElement();if(!e)return;this.open?this._showTooltip(e):this._hideTooltip(e)}}disconnectedCallback(){super.disconnectedCallback(),this._detachTriggerListeners();const t=this._getTooltipElement();t&&(t.removeEventListener("mouseenter",this._onTooltipMouseEnter),t.removeEventListener("mouseleave",this._onTooltipMouseLeave)),this._hideTimeout!==null&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=null)}_getTooltipElement(){return this.renderRoot.querySelector(".scb-tooltip")}_updateDelayCss(){const t=Number.isFinite(this.delay)?this.delay:.25;this.style.setProperty("--delay",`${t}s`)}_findTriggerElement(){const t=this.querySelector("[scb-tooltip-anchor]:not([slot])");return t||(Array.from(this.children).find(o=>o.nodeType===Node.ELEMENT_NODE)??null)}_updateTriggerElement(){const t=this._triggerEl;t&&(this._detachTriggerListeners(),t.removeAttribute("aria-describedby"));const e=this._findTriggerElement();this._triggerEl=e,e&&(e.setAttribute("aria-describedby",this._tooltipId),(this.trigger==="click"||this.trigger==="hover-click")&&e.addEventListener("click",this._onTriggerClick),(this.trigger==="hover"||this.trigger==="hover-click")&&(e.addEventListener("mouseenter",this._onTriggerMouseEnter),e.addEventListener("mouseleave",this._onTriggerMouseLeave),e.addEventListener("focus",this._onTriggerFocus),e.addEventListener("blur",this._onTriggerBlur)))}_updateTooltipHoverListeners(){const t=this._getTooltipElement();t&&(t.removeEventListener("mouseenter",this._onTooltipMouseEnter),t.removeEventListener("mouseleave",this._onTooltipMouseLeave),(this.trigger==="hover"||this.trigger==="hover-click")&&(t.addEventListener("mouseenter",this._onTooltipMouseEnter),t.addEventListener("mouseleave",this._onTooltipMouseLeave)))}_detachTriggerListeners(){const t=this._triggerEl;t&&(t.removeEventListener("click",this._onTriggerClick),t.removeEventListener("mouseenter",this._onTriggerMouseEnter),t.removeEventListener("mouseleave",this._onTriggerMouseLeave),t.removeEventListener("focus",this._onTriggerFocus),t.removeEventListener("blur",this._onTriggerBlur))}_showTooltip(t){this._hideTimeout!==null&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=null);const e=this._triggerEl;this._resetPosition(),t.classList.remove("hidden"),t.setAttribute("aria-hidden","false"),requestAnimationFrame(()=>{e&&this._positionTooltip(t,e),t.setAttribute("open","")})}_hideTooltip(t){t.removeAttribute("open"),t.setAttribute("aria-hidden","true"),this._scheduleHidden(t)}_scheduleHidden(t){const e=(Number.isFinite(this.delay)?this.delay:.25)*1e3;if(e<=0){t.classList.add("hidden");return}this._hideTimeout=window.setTimeout(()=>{t.classList.add("hidden"),this._hideTimeout=null},e)}_resetPosition(){this.position=this._originalPosition}_positionTooltip(t,e){const o=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=this.getBoundingClientRect(),f=(this.offset??0)+8,v=8,b=v,y=window.innerHeight-v,T=v,w=window.innerWidth-v,C=s=>s>=b&&s+r.height<=y,O=s=>s>=T&&s+r.width<=w,E=(s,n,a,u)=>{let g=0;s<a&&(g+=a-s);const _=s+n;return _>u&&(g+=_-u),g},$=s=>{let n=0,a=0;switch(s){case"top":n=o.top-i.top-r.height-f,a=o.left-i.left+(o.width-r.width)/2;break;case"bottom":n=o.bottom-i.top+f,a=o.left-i.left+(o.width-r.width)/2;break;case"left":a=o.left-i.left-r.width-f,n=o.top-i.top+(o.height-r.height)/2;break;case"right":a=o.right-i.left+f,n=o.top-i.top+(o.height-r.height)/2;break}const u=n+i.top,g=a+i.left,_=E(u,r.height,b,y),R=E(g,r.width,T,w);return{pos:s,top:n,left:a,fitsV:C(u),fitsH:O(g),totalOverflow:_+R}},L=this.position==="top"||this.position==="bottom",k=this.position,P=this._getOppositePosition(k),M=[k,P,L?"left":"top",L?"right":"bottom"].map($);let m=M.find(s=>s.fitsV&&s.fitsH)??M.reduce((s,n)=>n.totalOverflow<s.totalOverflow?n:s);const A=(s,n,a)=>Math.min(Math.max(s,n),a),S=b-i.top,H=y-r.height-i.top,B=T-i.left,D=w-r.width-i.left,z=A(m.top,S,H),N=A(m.left,B,D);t.style.top=`${z}px`,t.style.left=`${N}px`,this.position!==m.pos&&(this.position=m.pos)}_getOppositePosition(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}_onDefaultSlotChange(){this._updateTriggerElement()}render(){const t=this.arrow?x`<svg
|
|
2
2
|
class="scb-tooltip-arrow"
|
|
3
3
|
xmlns="http://www.w3.org/2000/svg"
|
|
4
4
|
width="13"
|
|
@@ -10,7 +10,7 @@ import{a as F,n as p,i as I,x as T,E as V,t as j}from"../../vendor/vendor.js";im
|
|
|
10
10
|
d="M6.5 6L0.5 0H12.5L6.5 6Z"
|
|
11
11
|
fill="var(--md-sys-color-inverse-surface, #0F0865)"
|
|
12
12
|
/>
|
|
13
|
-
</svg>`:V,e=this.label||this.supportingtext;return this.variant==="rich"?
|
|
13
|
+
</svg>`:V,e=this.label||this.supportingtext;return this.variant==="rich"?x`
|
|
14
14
|
<div
|
|
15
15
|
id=${this._tooltipId}
|
|
16
16
|
class="scb-tooltip hidden"
|
|
@@ -29,7 +29,7 @@ import{a as F,n as p,i as I,x as T,E as V,t as j}from"../../vendor/vendor.js";im
|
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
31
|
<slot @slotchange=${this._onDefaultSlotChange}></slot>
|
|
32
|
-
`:
|
|
32
|
+
`:x`
|
|
33
33
|
<div
|
|
34
34
|
id=${this._tooltipId}
|
|
35
35
|
class="scb-tooltip hidden"
|
|
@@ -49,7 +49,7 @@ import{a as F,n as p,i as I,x as T,E as V,t as j}from"../../vendor/vendor.js";im
|
|
|
49
49
|
:host {
|
|
50
50
|
position: relative;
|
|
51
51
|
display: inline-block;
|
|
52
|
-
--delay:
|
|
52
|
+
--delay: 0.25s;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.scb-tooltip {
|
|
@@ -81,10 +81,6 @@ import{a as F,n as p,i as I,x as T,E as V,t as j}from"../../vendor/vendor.js";im
|
|
|
81
81
|
letter-spacing: var(--md-sys-typescale-body-small-tracking);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
::slotted([scb-tooltip-button]) {
|
|
85
|
-
display: inline-flex;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
84
|
/* Plain variant */
|
|
89
85
|
|
|
90
86
|
:host([variant='plain']) .scb-tooltip {
|
|
@@ -193,4 +189,4 @@ import{a as F,n as p,i as I,x as T,E as V,t as j}from"../../vendor/vendor.js";im
|
|
|
193
189
|
gap: var(--spacing-3);
|
|
194
190
|
align-self: stretch;
|
|
195
191
|
}
|
|
196
|
-
`;
|
|
192
|
+
`;h([p({type:String,reflect:!0})],l.prototype,"variant",2);h([p({type:Boolean,reflect:!0})],l.prototype,"arrow",2);h([p({type:String,attribute:"supporting-text"})],l.prototype,"supportingtext",2);h([p({type:String})],l.prototype,"label",2);h([p({type:String,reflect:!0})],l.prototype,"trigger",2);h([p({type:String,reflect:!0})],l.prototype,"position",2);h([p({type:Boolean,reflect:!0})],l.prototype,"open",2);h([p({type:Number,reflect:!0})],l.prototype,"delay",2);h([p({type:Number,reflect:!0})],l.prototype,"offset",2);l=h([j("scb-tooltip")],l);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.85",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -308,5 +308,5 @@
|
|
|
308
308
|
},
|
|
309
309
|
"./mvc/*": "./mvc/*"
|
|
310
310
|
},
|
|
311
|
-
"buildHash": "
|
|
311
|
+
"buildHash": "4F58F947604759E0982755EA02A05271C24FA94C5C8C5347293C2AC511236F65"
|
|
312
312
|
}
|
|
@@ -198,16 +198,16 @@ a.styles = [
|
|
|
198
198
|
`
|
|
199
199
|
];
|
|
200
200
|
n([
|
|
201
|
-
r({ type: String })
|
|
201
|
+
r({ type: String, reflect: !0 })
|
|
202
202
|
], a.prototype, "title", 2);
|
|
203
203
|
n([
|
|
204
|
-
r({ type: String })
|
|
204
|
+
r({ type: String, reflect: !0 })
|
|
205
205
|
], a.prototype, "type", 2);
|
|
206
206
|
n([
|
|
207
207
|
r({ type: String, reflect: !0 })
|
|
208
208
|
], a.prototype, "position", 2);
|
|
209
209
|
n([
|
|
210
|
-
r({ type: String, attribute: "search-supporting-text" })
|
|
210
|
+
r({ type: String, attribute: "search-supporting-text", reflect: !0 })
|
|
211
211
|
], a.prototype, "searchSupportingText", 2);
|
|
212
212
|
a = n([
|
|
213
213
|
m("scb-app-bar")
|
|
@@ -4,5 +4,11 @@ export declare class SCBBreadcrumbItem extends LitElement {
|
|
|
4
4
|
isCurrent: boolean;
|
|
5
5
|
href: string;
|
|
6
6
|
static get styles(): import('lit').CSSResult;
|
|
7
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
7
8
|
protected render(): TemplateResult;
|
|
8
9
|
}
|
|
10
|
+
declare global {
|
|
11
|
+
interface HTMLElementTagNameMap {
|
|
12
|
+
'scb-breadcrumb-item': SCBBreadcrumbItem;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -1,23 +1,38 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as
|
|
1
|
+
import { LitElement as p, css as b, html as l } from "lit";
|
|
2
|
+
import { property as u, customElement as m } from "lit/decorators.js";
|
|
3
3
|
import "../scb-link/scb-link.js";
|
|
4
|
-
var
|
|
5
|
-
for (var r =
|
|
6
|
-
(
|
|
7
|
-
return
|
|
4
|
+
var h = Object.defineProperty, f = Object.getOwnPropertyDescriptor, n = (t, s, i, a) => {
|
|
5
|
+
for (var r = a > 1 ? void 0 : a ? f(s, i) : s, c = t.length - 1, o; c >= 0; c--)
|
|
6
|
+
(o = t[c]) && (r = (a ? o(s, i, r) : o(r)) || r);
|
|
7
|
+
return a && r && h(s, i, r), r;
|
|
8
8
|
};
|
|
9
|
-
let e = class extends
|
|
9
|
+
let e = class extends p {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments), this.label = "", this.isCurrent = !1, this.href = "";
|
|
12
12
|
}
|
|
13
13
|
static get styles() {
|
|
14
14
|
return b`
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
.breadcrumb-separator {
|
|
16
|
+
margin: var(--spacing-0) var(--spacing-3);
|
|
17
|
+
color: var(--md-sys-color-on-surface);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.breadcrumb-current {
|
|
21
|
+
color: var(--md-sys-color-on-surface);
|
|
22
|
+
font-weight: var(--weight-semibold);
|
|
23
|
+
}
|
|
19
24
|
`;
|
|
20
25
|
}
|
|
26
|
+
// Sänd event när isCurrent ändras (för Blazor-bryggan: current-changed)
|
|
27
|
+
updated(t) {
|
|
28
|
+
t.has("isCurrent") && this.dispatchEvent(
|
|
29
|
+
new CustomEvent("current-changed", {
|
|
30
|
+
detail: { isCurrent: this.isCurrent },
|
|
31
|
+
bubbles: !0,
|
|
32
|
+
composed: !0
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
}
|
|
21
36
|
render() {
|
|
22
37
|
switch (!0) {
|
|
23
38
|
case this.isCurrent:
|
|
@@ -30,16 +45,16 @@ let e = class extends u {
|
|
|
30
45
|
}
|
|
31
46
|
}
|
|
32
47
|
};
|
|
33
|
-
|
|
34
|
-
|
|
48
|
+
n([
|
|
49
|
+
u({ type: String })
|
|
35
50
|
], e.prototype, "label", 2);
|
|
36
|
-
|
|
37
|
-
|
|
51
|
+
n([
|
|
52
|
+
u({ type: Boolean, attribute: "is-current", reflect: !0 })
|
|
38
53
|
], e.prototype, "isCurrent", 2);
|
|
39
|
-
|
|
40
|
-
|
|
54
|
+
n([
|
|
55
|
+
u({ type: String, attribute: "item-href" })
|
|
41
56
|
], e.prototype, "href", 2);
|
|
42
|
-
e =
|
|
57
|
+
e = n([
|
|
43
58
|
m("scb-breadcrumb-item")
|
|
44
59
|
], e);
|
|
45
60
|
export {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
2
|
export declare class SCBBreadcrumb extends LitElement {
|
|
3
3
|
showAll: boolean;
|
|
4
|
-
static get styles(): import('lit').CSSResult;
|
|
5
|
-
private _onEllipsisClick;
|
|
6
4
|
private _observer?;
|
|
5
|
+
static get styles(): import('lit').CSSResult;
|
|
7
6
|
connectedCallback(): void;
|
|
8
7
|
disconnectedCallback(): void;
|
|
8
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
9
|
+
private _onEllipsisClick;
|
|
9
10
|
render(): TemplateResult;
|
|
10
11
|
}
|
|
11
12
|
declare global {
|