scb-wc-test 0.1.162 → 0.1.164
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-card/scb-card.js +7 -7
- package/mvc/components/scb-fact-card/scb-fact-card-content.js +7 -7
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +4 -4
- package/mvc/components/scb-menu/scb-menu.js +10 -5
- package/mvc/components/scb-notification-card/scb-notification-card.js +6 -6
- package/mvc/components/scb-options-menu/scb-options-menu.js +8 -3
- package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +7 -7
- package/mvc/components/scb-scrollspy/scb-scrollspy.js +3 -3
- package/package.json +2 -2
- package/scb-card/scb-card.js +10 -10
- package/scb-fact-card/scb-fact-card-content.js +9 -9
- package/scb-keyfigure-card/scb-keyfigure-card.js +4 -4
- package/scb-menu/scb-menu.d.ts +10 -1
- package/scb-menu/scb-menu.js +63 -24
- package/scb-notification-card/scb-notification-card.js +4 -4
- package/scb-options-menu/scb-options-menu.d.ts +8 -0
- package/scb-options-menu/scb-options-menu.js +65 -32
- package/scb-progress-indicator/scb-progress-indicator.d.ts +9 -0
- package/scb-progress-indicator/scb-progress-indicator.js +95 -46
- package/scb-scrollspy/scb-scrollspy.d.ts +2 -2
- package/scb-scrollspy/scb-scrollspy.js +9 -9
- package/scb-wc-test.bundle.js +505 -495
|
@@ -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"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as f}from"../../vendor/preload-helper.js";import{a as $,n as r,i as k,x as s,t as _}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-list/scb-list.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-link/scb-link.js";import"../scb-avatar/scb-avatar.js";import"../scb-list/scb-list-item.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 i=customElements.define.bind(customElements);customElements.define=function(o,n,c){try{customElements.get(o)||i(o,n,c)}catch(l){var d=String(l||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var z=Object.defineProperty,w=Object.getOwnPropertyDescriptor,x=e=>{throw TypeError(e)},a=(e,i,o,n)=>{for(var c=n>1?void 0:n?w(i,o):i,d=e.length-1,l;d>=0;d--)(l=e[d])&&(c=(n?l(i,o,c):l(c))||c);return n&&c&&z(i,o,c),c},S=(e,i,o)=>i.has(e)||x("Cannot "+o),T=(e,i,o)=>i.has(e)?x("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,o),y=(e,i,o)=>(S(e,i,"access private method"),o),b,
|
|
2
|
+
import{_ as f}from"../../vendor/preload-helper.js";import{a as $,n as r,i as k,x as s,t as _}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-list/scb-list.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-link/scb-link.js";import"../scb-avatar/scb-avatar.js";import"../scb-list/scb-list-item.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 i=customElements.define.bind(customElements);customElements.define=function(o,n,c){try{customElements.get(o)||i(o,n,c)}catch(l){var d=String(l||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var z=Object.defineProperty,w=Object.getOwnPropertyDescriptor,x=e=>{throw TypeError(e)},a=(e,i,o,n)=>{for(var c=n>1?void 0:n?w(i,o):i,d=e.length-1,l;d>=0;d--)(l=e[d])&&(c=(n?l(i,o,c):l(c))||c);return n&&c&&z(i,o,c),c},S=(e,i,o)=>i.has(e)||x("Cannot "+o),T=(e,i,o)=>i.has(e)?x("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,o),y=(e,i,o)=>(S(e,i,"access private method"),o),b,g;let t=class extends k{constructor(){super(...arguments),T(this,b),this.type="",this.variant="",this.direction="",this.mediaType="",this.mediaHref="",this.mediaAlt="",this.mediaSrcset="",this.mediaSizes="",this.mediaLoading="auto",this.mediaDecoding="async",this.mediaFetchPriority="auto",this.mediaFit="cover",this.mediaPosition="center",this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.mediaPlaceholder=!1,this.cardHref="",this.title="",this.subtitle="",this.supportingText="",this.commentsText="",this.comments=0,this.commentsHref="",this.likesText="",this.likes=0,this.hasLiked=!1,this.likesInteractive=!1,this.sizing="stretch",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.spacing="",this.spacingTop="",this.spacingBottom="",this.spacingLeft="",this.spacingRight="",this.__onImgLoad=e=>{const i=e.currentTarget.closest(".media");i&&i.classList.add("is-loaded")},this.__onKeyDown=e=>{(e.key==="Enter"||e.key===" ")&&this.cardHref&&(e.preventDefault(),window.open(this.cardHref,"_self"))},this.__handleHrefNavigation=e=>{this.cardHref&&(e.target.closest("a")||window.open(this.cardHref,"_self"))}}get likeButton(){return this.type!=="social"?null:this.renderRoot.querySelector(".likes scb-icon-button")}__calcAspectWH(e){const i=(e||"").trim();if(!i)return{w:640,h:360};const o=i.includes("/")?i.split("/"):i.includes(":")?i.split(":"):i.includes("x")?i.split("x"):null;if(o&&o.length===2){const c=Number(o[0]),d=Number(o[1]);if(c>0&&d>0)return{w:c,h:d}}const n=Number(i);return isFinite(n)&&n>0?{w:1e3,h:Math.round(1e3/n)}:{w:640,h:360}}__mediaTemplate(){if((this.mediaType||"").toLowerCase()==="avatar")return s`
|
|
3
3
|
<div class="media">
|
|
4
4
|
<slot name="media">
|
|
5
5
|
<scb-avatar variant="icon" label="${this.title}" icon-name="person"></scb-avatar>
|
|
@@ -60,7 +60,7 @@ import{_ as f}from"../../vendor/preload-helper.js";import{a as $,n as r,i as k,x
|
|
|
60
60
|
<slot></slot>
|
|
61
61
|
</div>
|
|
62
62
|
</div>
|
|
63
|
-
`);case"social":const h=this.commentsHref,m=p=>{p.stopPropagation()},u=p=>{const
|
|
63
|
+
`);case"social":const h=this.commentsHref,m=p=>{p.stopPropagation()},u=p=>{const v=this.renderRoot?.querySelector(".scb-card");v&&(p?v.classList.add("no-hover"):v.classList.remove("no-hover"))};return l(s`
|
|
64
64
|
<div class="full-content">
|
|
65
65
|
<div class="top-content">
|
|
66
66
|
${this.title?s`<div class="header">${c(!!this.cardHref)}</div>`:""}
|
|
@@ -130,7 +130,7 @@ import{_ as f}from"../../vendor/preload-helper.js";import{a as $,n as r,i as k,x
|
|
|
130
130
|
${n?s`<div class="date">${n}</div>`:""}
|
|
131
131
|
</div>
|
|
132
132
|
</div>
|
|
133
|
-
`)}}updated(e){super.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("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("type")&&(this.type==="list"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")),this.style.setProperty("--scb-card-media-fit",this.mediaFit||"cover"),this.style.setProperty("--scb-card-media-position",this.mediaPosition||"center"),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&y(this,b,
|
|
133
|
+
`)}}updated(e){super.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("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("type")&&(this.type==="list"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")),this.style.setProperty("--scb-card-media-fit",this.mediaFit||"cover"),this.style.setProperty("--scb-card-media-position",this.mediaPosition||"center"),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&y(this,b,g).call(this)}async firstUpdated(e){t.__iconLoaded||(await f(()=>import("../../vendor/vendor-material.js").then(i=>i.i),__vite__mapDeps([0,1]),import.meta.url),t.__iconLoaded=!0),t.__rippleLoaded||(await f(()=>import("../../vendor/vendor-material.js").then(i=>i.r),__vite__mapDeps([0,1]),import.meta.url),t.__rippleLoaded=!0),y(this,b,g).call(this)}};b=new WeakSet;g=function(){const e=this.mapSpacingToken(this.spacing),i=this.mapSpacingToken(this.spacingTop)??e,o=this.mapSpacingToken(this.spacingBottom)??e,n=this.mapSpacingToken(this.spacingLeft),c=this.mapSpacingToken(this.spacingRight);i?this.style.setProperty("--scb-card-spacing-block-start",i):this.style.removeProperty("--scb-card-spacing-block-start"),o?this.style.setProperty("--scb-card-spacing-block-end",o):this.style.removeProperty("--scb-card-spacing-block-end"),n?this.style.setProperty("--scb-card-spacing-inline-start",n):this.style.removeProperty("--scb-card-spacing-inline-start"),c?this.style.setProperty("--scb-card-spacing-inline-end",c):this.style.removeProperty("--scb-card-spacing-inline-end")};t.__iconLoaded=!1;t.__rippleLoaded=!1;t.styles=$`
|
|
134
134
|
:host {
|
|
135
135
|
display: block;
|
|
136
136
|
box-sizing: border-box;
|
|
@@ -322,7 +322,7 @@ import{_ as f}from"../../vendor/preload-helper.js";import{a as $,n as r,i as k,x
|
|
|
322
322
|
.top-content {
|
|
323
323
|
display: flex;
|
|
324
324
|
flex-direction: column;
|
|
325
|
-
gap: var(--spacing-
|
|
325
|
+
gap: var(--spacing-4);
|
|
326
326
|
min-inline-size: 0;
|
|
327
327
|
}
|
|
328
328
|
|
|
@@ -364,9 +364,9 @@ import{_ as f}from"../../vendor/preload-helper.js";import{a as $,n as r,i as k,x
|
|
|
364
364
|
letter-spacing: var(--md-sys-typescale-title-medium-tracking);
|
|
365
365
|
}
|
|
366
366
|
.supporting-text {
|
|
367
|
-
font-size: var(--md-sys-typescale-body-
|
|
368
|
-
line-height: var(--md-sys-typescale-body-
|
|
369
|
-
letter-spacing: var(--md-sys-typescale-body-
|
|
367
|
+
font-size: var(--md-sys-typescale-body-medium-size);
|
|
368
|
+
line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
369
|
+
letter-spacing: var(--md-sys-typescale-body-medium-tracking);
|
|
370
370
|
}
|
|
371
371
|
.date {
|
|
372
372
|
font-size: var(--md-sys-typescale-body-medium-size);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as p,n as d,i as u,x as c,t as g}from"../../vendor/vendor.js";(function(){try{var a=typeof globalThis<"u"?globalThis:window;if(!a.__scb_ce_guard_installed__){a.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(e,s,t){try{customElements.get(e)||i(e,s,t)}catch(r){var l=String(r||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var m=Object.defineProperty,h=Object.getOwnPropertyDescriptor,o=(a,i,e,s)=>{for(var t=s>1?void 0:s?h(i,e):i,l=a.length-1,r;l>=0;l--)(r=a[l])&&(t=(s?r(i,e,t):r(t))||t);return s&&t&&m(i,e,t),t};let n=class extends u{constructor(){super(...arguments),this.title="",this.subtitle="",this.supportingText=""}render(){return c`
|
|
2
2
|
${this.title?c`<div class="label">${this.title}</div>`:""}
|
|
3
3
|
${this.subtitle?c`<div class="sub-label">${this.subtitle}</div>`:""}
|
|
4
4
|
${this.supportingText?c`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
@@ -6,11 +6,11 @@ import{a as d,n as p,i as u,x as c,t as g}from"../../vendor/vendor.js";(function
|
|
|
6
6
|
<div class="content links">
|
|
7
7
|
<slot></slot>
|
|
8
8
|
</div>
|
|
9
|
-
`}};
|
|
9
|
+
`}};n.styles=p`
|
|
10
10
|
:host {
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
|
-
gap: var(--spacing-
|
|
13
|
+
gap: var(--spacing-4);
|
|
14
14
|
width: 100%;
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -32,9 +32,9 @@ import{a as d,n as p,i as u,x as c,t as g}from"../../vendor/vendor.js";(function
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.supporting-text {
|
|
35
|
-
font-size: var(--md-sys-typescale-body-
|
|
36
|
-
line-height: var(--md-sys-typescale-body-
|
|
37
|
-
letter-spacing: var(--md-sys-typescale-body-
|
|
35
|
+
font-size: var(--md-sys-typescale-body-medium-size);
|
|
36
|
+
line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
37
|
+
letter-spacing: var(--md-sys-typescale-body-medium-tracking);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.content.links ::slotted(*) {
|
|
@@ -43,4 +43,4 @@ import{a as d,n as p,i as u,x as c,t as g}from"../../vendor/vendor.js";(function
|
|
|
43
43
|
flex-direction: column;
|
|
44
44
|
gap: var(--spacing-3);
|
|
45
45
|
}
|
|
46
|
-
`;o([
|
|
46
|
+
`;o([d({type:String,reflect:!0,attribute:"title"})],n.prototype,"title",2);o([d({type:String,reflect:!0,attribute:"subtitle"})],n.prototype,"subtitle",2);o([d({type:String,reflect:!0,attribute:"supporting-text"})],n.prototype,"supportingText",2);n=o([g("scb-fact-card-content")],n);
|
|
@@ -88,7 +88,7 @@ import{_ as d}from"../../vendor/preload-helper.js";import{a as f,n as a,i as m,x
|
|
|
88
88
|
font-family: var(--brand-font);
|
|
89
89
|
display: flex;
|
|
90
90
|
flex-direction: column;
|
|
91
|
-
gap: var(--spacing-
|
|
91
|
+
gap: var(--spacing-4);
|
|
92
92
|
position: relative;
|
|
93
93
|
border-radius: var(--md-sys-shape-corner-large);
|
|
94
94
|
background: var(--md-sys-color-surface-dim);
|
|
@@ -132,9 +132,9 @@ import{_ as d}from"../../vendor/preload-helper.js";import{a as f,n as a,i as m,x
|
|
|
132
132
|
.sub-label a { color: inherit; text-decoration: none; }
|
|
133
133
|
|
|
134
134
|
.supporting-text {
|
|
135
|
-
font-size: var(--md-sys-typescale-body-
|
|
136
|
-
line-height: var(--md-sys-typescale-body-
|
|
137
|
-
letter-spacing: var(--md-sys-typescale-body-
|
|
135
|
+
font-size: var(--md-sys-typescale-body-medium-size);
|
|
136
|
+
line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
137
|
+
letter-spacing: var(--md-sys-typescale-body-medium-tracking);
|
|
138
138
|
|
|
139
139
|
white-space: normal;
|
|
140
140
|
word-break: normal;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as u,n as c,i as h,E as y,x as d,t as v}from"../../vendor/vendor.js";import"../scb-divider/scb-divider.js";import"./scb-menu-item.js";import"./scb-menu-section.js";import"./scb-sub-menu.js";import"../../vendor/preload-helper.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,a,i){try{customElements.get(s)||t(s,a,i)}catch(o){var l=String(o||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var f=Object.defineProperty,_=Object.getOwnPropertyDescriptor,m=e=>{throw TypeError(e)},r=(e,t,s,a)=>{for(var i=a>1?void 0:a?_(t,s):t,l=e.length-1,o;l>=0;l--)(o=e[l])&&(i=(a?o(t,s,i):o(i))||i);return a&&i&&f(t,s,i),i},S=(e,t,s)=>t.has(e)||m("Cannot "+s),k=(e,t,s)=>t.has(e)?m("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),g=(e,t,s)=>(S(e,t,"access private method"),s),p,b;let n=class extends h{constructor(){super(...arguments),k(this,p),this.label="",this.subLabel="",this.spacing="",this.spacingTop="",this.spacingBottom="",this.spacingLeft="",this.spacingRight="",this._onGlobalSelect=e=>{const t=e;this.querySelectorAll("scb-menu-item").forEach(a=>a.selected=!1),this.contains(t.detail.item)&&(t.detail.item.selected=!0)}}render(){return d`
|
|
2
2
|
<nav
|
|
3
3
|
aria-label="${this.label}"
|
|
4
4
|
>
|
|
5
|
-
${this.label?
|
|
5
|
+
${this.label?d`
|
|
6
6
|
<div class="scb-menu-label-wrapper">
|
|
7
7
|
<div class="scb-menu-label">${this.label}</div>
|
|
8
8
|
<div class="scb-menu-sublabel">
|
|
@@ -10,18 +10,23 @@ import{a as b,n as d,i as m,E as p,x as o,t as u}from"../../vendor/vendor.js";im
|
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
12
12
|
<scb-divider></scb-divider>
|
|
13
|
-
`:
|
|
13
|
+
`:y}
|
|
14
14
|
<div class="panel">
|
|
15
15
|
<slot></slot>
|
|
16
16
|
</div>
|
|
17
17
|
</nav>
|
|
18
|
-
`}connectedCallback(){super.connectedCallback(),window.addEventListener("scb-menu-select",this._onGlobalSelect)}disconnectedCallback(){window.removeEventListener("scb-menu-select",this._onGlobalSelect),super.disconnectedCallback()}};n.styles=
|
|
18
|
+
`}firstUpdated(e){super.firstUpdated(e),g(this,p,b).call(this)}updated(e){super.updated(e),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&g(this,p,b).call(this)}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}connectedCallback(){super.connectedCallback(),window.addEventListener("scb-menu-select",this._onGlobalSelect)}disconnectedCallback(){window.removeEventListener("scb-menu-select",this._onGlobalSelect),super.disconnectedCallback()}};p=new WeakSet;b=function(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,s=this.mapSpacingToken(this.spacingBottom)??e,a=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-menu-spacing-block-start",t):this.style.removeProperty("--scb-menu-spacing-block-start"),s?this.style.setProperty("--scb-menu-spacing-block-end",s):this.style.removeProperty("--scb-menu-spacing-block-end"),a?this.style.setProperty("--scb-menu-spacing-inline-start",a):this.style.removeProperty("--scb-menu-spacing-inline-start"),i?this.style.setProperty("--scb-menu-spacing-inline-end",i):this.style.removeProperty("--scb-menu-spacing-inline-end")};n.styles=u`
|
|
19
19
|
:host {
|
|
20
20
|
display: block;
|
|
21
21
|
color: var(--md-sys-color-on-surface);
|
|
22
22
|
padding: var(--spacing-4, 12px);
|
|
23
23
|
background: var(--md-sys-color-surface-container);
|
|
24
24
|
font-family: var(--brand-font);
|
|
25
|
+
|
|
26
|
+
margin-block-start: var(--scb-menu-spacing-block-start, 0);
|
|
27
|
+
margin-block-end: var(--scb-menu-spacing-block-end, 0);
|
|
28
|
+
margin-inline-start: var(--scb-menu-spacing-inline-start, 0);
|
|
29
|
+
margin-inline-end: var(--scb-menu-spacing-inline-end, 0);
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
.scb-menu-label {
|
|
@@ -66,4 +71,4 @@ import{a as b,n as d,i as m,E as p,x as o,t as u}from"../../vendor/vendor.js";im
|
|
|
66
71
|
.panel {
|
|
67
72
|
contain: layout paint style;
|
|
68
73
|
}
|
|
69
|
-
`;
|
|
74
|
+
`;r([c({type:String})],n.prototype,"label",2);r([c({type:String,attribute:"sub-label"})],n.prototype,"subLabel",2);r([c({type:String,reflect:!0})],n.prototype,"spacing",2);r([c({type:String,attribute:"spacing-top",reflect:!0})],n.prototype,"spacingTop",2);r([c({type:String,attribute:"spacing-bottom",reflect:!0})],n.prototype,"spacingBottom",2);r([c({type:String,attribute:"spacing-left",reflect:!0})],n.prototype,"spacingLeft",2);r([c({type:String,attribute:"spacing-right",reflect:!0})],n.prototype,"spacingRight",2);n=r([v("scb-menu")],n);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h,n as o,i as d,x as l,t as
|
|
1
|
+
import{a as h,n as o,i as d,x as l,t as f}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-icon-button/scb-icon-button.js";import"../../vendor/preload-helper.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-button/scb-button.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var n=customElements.define.bind(customElements);customElements.define=function(s,r,a){try{customElements.get(s)||n(s,r,a)}catch(p){var c=String(p||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var g=Object.defineProperty,m=Object.getOwnPropertyDescriptor,e=(t,n,s,r)=>{for(var a=r>1?void 0:r?m(n,s):n,c=t.length-1,p;c>=0;c--)(p=t[c])&&(a=(r?p(n,s,a):p(a))||a);return r&&a&&g(n,s,a),a};let i=class extends d{constructor(){super(...arguments),this.variant="success",this.direction="horizontal",this.title="",this.subtitle="",this.supportingText="",this.open=!1,this.linkText="",this.linkHref="#",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="",this.spacingTop="",this.spacingBottom="",this.spacingLeft="",this.spacingRight="",this._closeNotification=()=>{this.open=!1;const t=new CustomEvent("close",{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(t)}}_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 n=(t??"").trim();return n?/^\d+$/.test(n)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(n,10)))})`:n:""}__applySpacing(){const t=this.__resolveSpacingToken(this.spacingTop||this.spacing),n=this.__resolveSpacingToken(this.spacingBottom||this.spacing),s=this.__resolveSpacingToken(this.spacingLeft||this.spacing),r=this.__resolveSpacingToken(this.spacingRight||this.spacing);t?this.style.marginBlockStart=t:this.style.removeProperty("margin-block-start"),n?this.style.marginBlockEnd=n:this.style.removeProperty("margin-block-end"),s?this.style.marginInlineStart=s:this.style.removeProperty("margin-inline-start"),r?this.style.marginInlineEnd=r: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",n=this.variant==="success"?"--_icon-color: var(--md-sys-color-on-success-container);":this.variant==="error"?"--_icon-color: var(--md-sys-color-on-error-container);":this.variant==="warning"?"--_icon-color: var(--md-sys-color-on-warning-container);":"--_icon-color: var(--md-sys-color-on-info-container);";return l`
|
|
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?l`
|
|
@@ -190,7 +190,7 @@ import{a as h,n as o,i as d,x as l,t as g}from"../../vendor/vendor.js";import"..
|
|
|
190
190
|
.notification-text-container {
|
|
191
191
|
display: flex;
|
|
192
192
|
flex-direction: column;
|
|
193
|
-
gap: var(--spacing-
|
|
193
|
+
gap: var(--spacing-4, 12px);
|
|
194
194
|
font-family: var(--brand-font, Inter);
|
|
195
195
|
font-style: normal;
|
|
196
196
|
min-width: 0;
|
|
@@ -225,10 +225,10 @@ import{a as h,n as o,i as d,x as l,t as g}from"../../vendor/vendor.js";import"..
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
.notification-text {
|
|
228
|
-
font-size: var(--md-sys-typescale-body-
|
|
228
|
+
font-size: var(--md-sys-typescale-body-medium-size, 16px);
|
|
229
229
|
font-weight: var(--weight-regular, 400);
|
|
230
|
-
line-height: var(--md-sys-typescale-body-
|
|
231
|
-
letter-spacing: var(--md-sys-typescale-body-
|
|
230
|
+
line-height: var(--md-sys-typescale-body-medium-line-height, 24px);
|
|
231
|
+
letter-spacing: var(--md-sys-typescale-body-medium-tracking, -0.15px);
|
|
232
232
|
|
|
233
233
|
white-space: normal;
|
|
234
234
|
word-break: normal;
|
|
@@ -280,4 +280,4 @@ import{a as h,n as o,i as d,x as l,t as g}from"../../vendor/vendor.js";import"..
|
|
|
280
280
|
box-shadow: 0 0 0 2px var(--md-sys-color-primary, #1976d2);
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
-
`];e([o({type:String})],i.prototype,"variant",2);e([o({type:String,reflect:!0})],i.prototype,"direction",2);e([o({type:String})],i.prototype,"title",2);e([o({type:String})],i.prototype,"subtitle",2);e([o({type:String,attribute:"supporting-text"})],i.prototype,"supportingText",2);e([o({type:Boolean,reflect:!0})],i.prototype,"open",2);e([o({type:String,attribute:"link-text"})],i.prototype,"linkText",2);e([o({type:String,attribute:"link-href"})],i.prototype,"linkHref",2);e([o({type:Boolean,attribute:"show-icon"})],i.prototype,"showIcon",2);e([o({type:Boolean,attribute:"show-close-button"})],i.prototype,"showCloseButton",2);e([o({type:String,reflect:!0})],i.prototype,"sizing",2);e([o({type:String,reflect:!0})],i.prototype,"width",2);e([o({type:String,reflect:!0,attribute:"max-width"})],i.prototype,"maxWidth",2);e([o({type:String,reflect:!0})],i.prototype,"height",2);e([o({type:String,reflect:!0,attribute:"max-height"})],i.prototype,"maxHeight",2);e([o({type:Boolean,reflect:!0,attribute:"full-height"})],i.prototype,"fullHeight",2);e([o({type:Boolean,reflect:!0,attribute:"full-width"})],i.prototype,"fullWidth",2);e([o({type:String})],i.prototype,"spacing",2);e([o({type:String,attribute:"spacing-top"})],i.prototype,"spacingTop",2);e([o({type:String,attribute:"spacing-bottom"})],i.prototype,"spacingBottom",2);e([o({type:String,attribute:"spacing-left"})],i.prototype,"spacingLeft",2);e([o({type:String,attribute:"spacing-right"})],i.prototype,"spacingRight",2);i=e([
|
|
283
|
+
`];e([o({type:String})],i.prototype,"variant",2);e([o({type:String,reflect:!0})],i.prototype,"direction",2);e([o({type:String})],i.prototype,"title",2);e([o({type:String})],i.prototype,"subtitle",2);e([o({type:String,attribute:"supporting-text"})],i.prototype,"supportingText",2);e([o({type:Boolean,reflect:!0})],i.prototype,"open",2);e([o({type:String,attribute:"link-text"})],i.prototype,"linkText",2);e([o({type:String,attribute:"link-href"})],i.prototype,"linkHref",2);e([o({type:Boolean,attribute:"show-icon"})],i.prototype,"showIcon",2);e([o({type:Boolean,attribute:"show-close-button"})],i.prototype,"showCloseButton",2);e([o({type:String,reflect:!0})],i.prototype,"sizing",2);e([o({type:String,reflect:!0})],i.prototype,"width",2);e([o({type:String,reflect:!0,attribute:"max-width"})],i.prototype,"maxWidth",2);e([o({type:String,reflect:!0})],i.prototype,"height",2);e([o({type:String,reflect:!0,attribute:"max-height"})],i.prototype,"maxHeight",2);e([o({type:Boolean,reflect:!0,attribute:"full-height"})],i.prototype,"fullHeight",2);e([o({type:Boolean,reflect:!0,attribute:"full-width"})],i.prototype,"fullWidth",2);e([o({type:String})],i.prototype,"spacing",2);e([o({type:String,attribute:"spacing-top"})],i.prototype,"spacingTop",2);e([o({type:String,attribute:"spacing-bottom"})],i.prototype,"spacingBottom",2);e([o({type:String,attribute:"spacing-left"})],i.prototype,"spacingLeft",2);e([o({type:String,attribute:"spacing-right"})],i.prototype,"spacingRight",2);i=e([f("scb-notification-card")],i);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{a as f,n as
|
|
1
|
+
import{a as f,n as c,i as b,x as y,t as v}from"../../vendor/vendor.js";import"./scb-options-menu-item.js";import"./scb-options-sub-menu.js";import"../scb-divider/scb-divider.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,s,n){try{customElements.get(e)||i(e,s,n)}catch(o){var a=String(o||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var E=Object.defineProperty,w=Object.getOwnPropertyDescriptor,p=(t,i,e,s)=>{for(var n=s>1?void 0:s?w(i,e):i,a=t.length-1,o;a>=0;a--)(o=t[a])&&(n=(s?o(i,e,n):o(n))||n);return s&&n&&E(i,e,n),n};let r=class extends b{constructor(){super(...arguments),this.open=!1,this.inSb=!1,this.spacing="",this.spacingTop="",this.spacingBottom="",this.spacingLeft="",this.spacingRight="",this.__lastTriggerEl=null,this.__onViewportChange=()=>{this.open&&this.__positionToTrigger()},this.__onDocumentClick=t=>{const i=this.__getActionFromEvent(t);if(i){i==="open"&&(this.__setOpen(!0),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0}))),i==="close"&&(this.__setOpen(!1),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))),i==="toggle"&&(this.__setOpen(!this.open),this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0,composed:!0}))),t.stopPropagation();return}if(!this.inSb&&this.open&&!this.isClickInScbMenu(t)){this.__setOpen(!1);return}},this.__onDocumentKeydown=t=>{if(this.open&&t.key==="Escape"){this.__setOpen(!1);return}}}firstUpdated(){this.__applySpacing()}render(){return y`
|
|
2
2
|
<div
|
|
3
3
|
role="menu"
|
|
4
4
|
class="scb-options-menu-panel${this.open?" open":""}"
|
|
5
5
|
>
|
|
6
6
|
<slot></slot>
|
|
7
7
|
</div>
|
|
8
|
-
`}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),window.addEventListener("resize",this.__onViewportChange,{passive:!0}),window.addEventListener("scroll",this.__onViewportChange,{passive:!0,capture:!0})}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),window.removeEventListener("resize",this.__onViewportChange),window.removeEventListener("scroll",this.__onViewportChange,!0),super.disconnectedCallback()}__setOpen(
|
|
8
|
+
`}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),window.addEventListener("resize",this.__onViewportChange,{passive:!0}),window.addEventListener("scroll",this.__onViewportChange,{passive:!0,capture:!0})}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),window.removeEventListener("resize",this.__onViewportChange),window.removeEventListener("scroll",this.__onViewportChange,!0),super.disconnectedCallback()}__setOpen(t){this.open=t}__getActionFromEvent(t){if(!this.id)return null;const i=t.composedPath();for(const e of i)if(e instanceof Element){if(e.getAttribute("data-menu-open")===this.id)return this.__lastTriggerEl=e,"open";if(e.getAttribute("data-menu-close")===this.id)return this.__lastTriggerEl=e,"close";if(e.getAttribute("data-menu-toggle")===this.id)return this.__lastTriggerEl=e,"toggle";if(e.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=e,"toggle"}return null}isClickInScbMenu(t){return t.composedPath().some(e=>e instanceof Element&&(e.tagName==="SCB-OPTIONS-MENU"||e.tagName==="SCB-OPTIONS-SUB-MENU"))}updated(t){t.has("open")&&(this.__applyOpenSideEffects(),this.open?this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.__applySpacing()}__applyOpenSideEffects(){this.__updateTriggersExpanded(),this.open?this.__positionToTrigger():this.__restoreFocusToTrigger()}__positionToTrigger(){if(!this.open||!this.__lastTriggerEl)return;const t=this.__lastTriggerEl,i=this.shadowRoot?.querySelector(".scb-options-menu-panel");i&&requestAnimationFrame(()=>{if(!this.open)return;const e=t.getBoundingClientRect(),s=i.getBoundingClientRect(),n=window.innerWidth,a=window.innerHeight,o=8,h=4;let l=e.left,u=e.bottom+h;const g=s.width,m=s.height;l+g>n-o&&(l=Math.max(o,n-o-g)),l<o&&(l=o);let d="top";if(u+m>a-o){const _=e.top-h-m;_>=o&&(u=_,d="bottom")}this.style.position="fixed",this.style.left=`${Math.round(l)}px`,this.style.top=`${Math.round(u)}px`,this.style.setProperty("--scb-options-menu-transform-origin",d)})}__restoreFocusToTrigger(){this.__lastTriggerEl&&requestAnimationFrame(()=>{this.__lastTriggerEl?.focus?.()})}__updateTriggersExpanded(){if(!this.id)return;const t=String(this.open),i=s=>{s.getAttribute("aria-controls")===this.id&&s.setAttribute("aria-expanded",t)};this.__lastTriggerEl&&i(this.__lastTriggerEl),document.querySelectorAll(`[aria-controls="${this.id}"], [data-menu-open="${this.id}"], [data-menu-close="${this.id}"], [data-menu-toggle="${this.id}"]`).forEach(i)}__applySpacing(){const t=this.__mapSpacingToken(this.spacing),i=this.__mapSpacingToken(this.spacingTop)??t,e=this.__mapSpacingToken(this.spacingBottom)??t,s=this.__mapSpacingToken(this.spacingLeft),n=this.__mapSpacingToken(this.spacingRight);i?this.style.setProperty("--scb-options-menu-spacing-block-start",i):this.style.removeProperty("--scb-options-menu-spacing-block-start"),e?this.style.setProperty("--scb-options-menu-spacing-block-end",e):this.style.removeProperty("--scb-options-menu-spacing-block-end"),s?this.style.setProperty("--scb-options-menu-spacing-inline-start",s):this.style.removeProperty("--scb-options-menu-spacing-inline-start"),n?this.style.setProperty("--scb-options-menu-spacing-inline-end",n):this.style.removeProperty("--scb-options-menu-spacing-inline-end")}__mapSpacingToken(t){if(!t)return;const i=String(t).trim();if(i)return/^\d+$/.test(i)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(i,10)))})`:i}};r.styles=f`
|
|
9
9
|
:host {
|
|
10
10
|
position: absolute;
|
|
11
11
|
display: block;
|
|
@@ -14,6 +14,11 @@ import{a as f,n as m,i as b,x as v,t as E}from"../../vendor/vendor.js";import"./
|
|
|
14
14
|
--scb-options-menu-max-width: 300px;
|
|
15
15
|
--scb-options-menu-max-height: 600px;
|
|
16
16
|
z-index: 1000;
|
|
17
|
+
|
|
18
|
+
margin-block-start: var(--scb-options-menu-spacing-block-start, 0);
|
|
19
|
+
margin-block-end: var(--scb-options-menu-spacing-block-end, 0);
|
|
20
|
+
margin-inline-start: var(--scb-options-menu-spacing-inline-start, 0);
|
|
21
|
+
margin-inline-end: var(--scb-options-menu-spacing-inline-end, 0);
|
|
17
22
|
}
|
|
18
23
|
:host > .scb-options-menu-panel {
|
|
19
24
|
padding: var(--spacing-3) 0;
|
|
@@ -43,4 +48,4 @@ import{a as f,n as m,i as b,x as v,t as E}from"../../vendor/vendor.js";import"./
|
|
|
43
48
|
opacity 0.25s cubic-bezier(0.23, 1, 0.32, 1),
|
|
44
49
|
transform 0.32s cubic-bezier(0.23, 1, 0.32, 1);
|
|
45
50
|
}
|
|
46
|
-
`;p([
|
|
51
|
+
`;p([c({type:Boolean,reflect:!0})],r.prototype,"open",2);p([c({type:Boolean,attribute:!1})],r.prototype,"inSb",2);p([c({type:String,reflect:!0})],r.prototype,"spacing",2);p([c({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",2);p([c({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",2);p([c({type:String,attribute:"spacing-left",reflect:!0})],r.prototype,"spacingLeft",2);p([c({type:String,attribute:"spacing-right",reflect:!0})],r.prototype,"spacingRight",2);r=p([v("scb-options-menu")],r);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as d,n,i as h,x as c,t as u}from"../../vendor/vendor.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,l,r){try{customElements.get(e)||i(e,l,r)}catch(p){var o=String(p||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,a=(t,i,e,l)=>{for(var r=l>1?void 0:l?f(i,e):i,o=t.length-1,p;o>=0;o--)(p=t[o])&&(r=(l?p(i,e,r):p(r))||r);return l&&r&&g(i,e,r),r};let s=class extends h{constructor(){super(...arguments),this.id="",this.type="circular",this.progress=25,this.isStatic=!0,this.spacing="",this.spacingTop="",this.spacingBottom="",this.spacingLeft="",this.spacingRight="",this._isSyncingAria=!1,this._defaultAriaLabelApplied=!1,this._defaultAriaValueTextApplied=!1}static get observedAttributes(){return[...super.observedAttributes,"role","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuetext"]}attributeChangedCallback(t,i,e){super.attributeChangedCallback(t,i,e),i!==e&&(t==="role"||t.startsWith("aria-"))&&this.syncAria()}connectedCallback(){super.connectedCallback(),this.syncAria()}clampProgress(t){return Number.isNaN(t)?0:Math.max(0,Math.min(100,t))}applyDefaultAriaLabel(t){const i=this.getAttribute("aria-labelledby"),e=this.getAttribute("aria-label");if(i){this._defaultAriaLabelApplied&&(this.removeAttribute("aria-label"),this._defaultAriaLabelApplied=!1);return}if(e!==null){this._defaultAriaLabelApplied&&e!==t&&(this._defaultAriaLabelApplied=!1);return}this.setAttribute("aria-label",t),this._defaultAriaLabelApplied=!0}syncAria(){if(!this._isSyncingAria){this._isSyncingAria=!0;try{if(this.hasAttribute("role")||this.setAttribute("role","progressbar"),this.hasAttribute("aria-valuemin")||this.setAttribute("aria-valuemin","0"),this.hasAttribute("aria-valuemax")||this.setAttribute("aria-valuemax","100"),this.type==="linear"&&!this.isStatic){this.removeAttribute("aria-valuenow");const e=this.getAttribute("aria-valuetext");e===null?(this.setAttribute("aria-valuetext","Laddar"),this._defaultAriaValueTextApplied=!0):this._defaultAriaValueTextApplied&&e!=="Laddar"&&(this._defaultAriaValueTextApplied=!1),this.applyDefaultAriaLabel("Laddar");return}const i=this.clampProgress(this.progress);this.setAttribute("aria-valuenow",String(i)),this._defaultAriaValueTextApplied&&(this.getAttribute("aria-valuetext")==="Laddar"&&this.removeAttribute("aria-valuetext"),this._defaultAriaValueTextApplied=!1),this.applyDefaultAriaLabel("Förlopp")}finally{this._isSyncingAria=!1}}}mapSpacingToken(t){if(!t)return;const i=String(t).trim();if(i)return/^\d+$/.test(i)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(i,10)))})`:i}applySpacing(){const t=this.mapSpacingToken(this.spacing),i=this.mapSpacingToken(this.spacingTop)??t,e=this.mapSpacingToken(this.spacingBottom)??t,l=this.mapSpacingToken(this.spacingLeft),r=this.mapSpacingToken(this.spacingRight);i?this.style.setProperty("--scb-progress-indicator-spacing-block-start",i):this.style.removeProperty("--scb-progress-indicator-spacing-block-start"),e?this.style.setProperty("--scb-progress-indicator-spacing-block-end",e):this.style.removeProperty("--scb-progress-indicator-spacing-block-end"),l?this.style.setProperty("--scb-progress-indicator-spacing-inline-start",l):this.style.removeProperty("--scb-progress-indicator-spacing-inline-start"),r?this.style.setProperty("--scb-progress-indicator-spacing-inline-end",r):this.style.removeProperty("--scb-progress-indicator-spacing-inline-end")}applyTypeLayout(){this.type==="linear"?(this.style.display="block",this.style.width="100%"):(this.style.removeProperty("display"),this.style.removeProperty("width"))}firstUpdated(t){this.applyTypeLayout(),this.applySpacing(),this.syncAria()}updated(t){super.updated(t),t.has("type")&&this.applyTypeLayout(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.applySpacing(),(t.has("type")||t.has("progress")||t.has("isStatic"))&&this.syncAria()}render(){return c`
|
|
2
2
|
<div class="scb-progress-indicator">
|
|
3
|
-
${this.type==="circular"?
|
|
3
|
+
${this.type==="circular"?c`
|
|
4
4
|
<div class="circular">
|
|
5
|
-
<svg class="circular-spin" viewBox="0 0 40 40">
|
|
5
|
+
<svg class="circular-spin" viewBox="0 0 40 40" aria-hidden="true" focusable="false">
|
|
6
6
|
<circle class="circular-bg" cx="20" cy="20" r="16" fill="none" stroke-width="4" />
|
|
7
7
|
<circle
|
|
8
8
|
class="circular-fg"
|
|
@@ -13,13 +13,13 @@ import{a as g,n as o,i as d,x as l,t as h}from"../../vendor/vendor.js";(function
|
|
|
13
13
|
/>
|
|
14
14
|
</svg>
|
|
15
15
|
</div>
|
|
16
|
-
`:
|
|
16
|
+
`:c`
|
|
17
17
|
<div class="linear" style="--progress-fill: var(--md-sys-color-primary);">
|
|
18
|
-
${this.isStatic?
|
|
18
|
+
${this.isStatic?c`<div class="linear-static" style="width: ${this.progress}%;"></div>`:c`<div class="linear-loader"></div>`}
|
|
19
19
|
</div>
|
|
20
20
|
`}
|
|
21
21
|
</div>
|
|
22
|
-
`}};
|
|
22
|
+
`}};s.styles=[d`
|
|
23
23
|
|
|
24
24
|
.circular {
|
|
25
25
|
display: flex;
|
|
@@ -84,4 +84,4 @@ import{a as g,n as o,i as d,x as l,t as h}from"../../vendor/vendor.js";(function
|
|
|
84
84
|
50% { margin-left: 30%; width: 60%; }
|
|
85
85
|
100% { margin-left: 100%; width: 40%; }
|
|
86
86
|
}
|
|
87
|
-
`];a([
|
|
87
|
+
`];a([n({type:String})],s.prototype,"id",2);a([n({type:String,reflect:!0})],s.prototype,"type",2);a([n({type:Number,reflect:!0})],s.prototype,"progress",2);a([n({type:Boolean,attribute:"is-static"})],s.prototype,"isStatic",2);a([n({type:String,reflect:!0})],s.prototype,"spacing",2);a([n({type:String,attribute:"spacing-top",reflect:!0})],s.prototype,"spacingTop",2);a([n({type:String,attribute:"spacing-bottom",reflect:!0})],s.prototype,"spacingBottom",2);a([n({type:String,attribute:"spacing-left",reflect:!0})],s.prototype,"spacingLeft",2);a([n({type:String,attribute:"spacing-right",reflect:!0})],s.prototype,"spacingRight",2);s=a([u("scb-progress-indicator")],s);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as w,i as R,x as y,t as A}from"../../vendor/vendor.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(s,i,n){try{customElements.get(s)||e(s,i,n)}catch(r){var o=String(r||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var T=Object.getOwnPropertyDescriptor,O=(t,e,s,i)=>{for(var n=i>1?void 0:i?T(e,s):e,o=t.length-1,r;o>=0;o--)(r=t[o])&&(n=r(n)||n);return n};let p=class extends R{constructor(){super(...arguments),this.navSelector="",this.offsetTop=0,this.offsetBottom=0,this.updateHash=!0,this.activeId="",this.layout="",this.sidebarNavWidth="320px",this.sidebarHeight="560px",this.stackHeight="",this.sidebarNavTop="0px",this.contentPadding="0px",this.__navEl=null,this.__contentEl=null,this.__contentShellEl=null,this.__links=[],this.__observer=null,this.__fallbackScrollRoot=null,this.__entries=new Map,this.__rafId=null,this.__scrollRafId=null,this.__hashAllowUpdates=!1,this.__hashBaselineReady=!1,this.__hashBaselinePos=0,this.__hashBaselineRafId=null,this.__hashScrollRoot=null,this.__hashSuspend=!1,this.__hashInitialApplied=!1,this.__onHashScrollBound=()=>this.__onHashScroll(),this.__scrollAnimSeq=0,this.__motionMeasureEl=null,this.__focusableRafId=null,this.__autoOffsetTop=0,this.__autoOffsetRafId=null,this.__navResizeObserver=null,this.__onNavClickBound=t=>this.__onNavClick(t),this.__onScrollFallbackBound=()=>this.__updateActiveFromRects(),this.__onResizeBound=()=>{this.__requestActiveRecalc(),this.__requestAutoOffsetMeasure()},this.__onSlotChange=()=>{const t=this.__navEl;this.__teardown(),this.__resolveSlots(),this.__requestEnsureContentFocusable(),this.__navEl&&this.__navEl.addEventListener("click",this.__onNavClickBound,!0),(t!==this.__navEl||!this.__links.length)&&this.__collectLinks(),this.__requestAutoOffsetMeasure(),this.__rebuildObserver(),this.__attachHashScrollRoot(),this.__applyInitialHashIfAny()}}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.__onResizeBound,{passive:!0})}firstUpdated(){this.__ensureMotionMeasureEl(),this.__resolveInternals(),this.__requestEnsureContentFocusable(),this.__requestAutoOffsetMeasure()}disconnectedCallback(){window.removeEventListener("resize",this.__onResizeBound),this.__teardown(),super.disconnectedCallback()}updated(t){if(t.has("navSelector")){this.__onSlotChange();return}if(t.has("layout")){this.__onSlotChange();return}(t.has("offsetTop")||t.has("offsetBottom"))&&(this.__rebuildObserver(),this.__attachHashScrollRoot()),(t.has("sidebarNavWidth")||t.has("sidebarHeight")||t.has("stackHeight")||t.has("sidebarNavTop")||t.has("contentPadding"))&&(this.__resolveInternals(),this.__requestEnsureContentFocusable(),this.__rebuildObserver())}__teardown(){this.__cancelScrollAnimation(),this.__cancelEnsureContentFocusable(),this.__cancelAutoOffsetMeasure(),this.__disconnectAutoOffsetObserver(),this.__disconnectObserver(),this.__navEl&&this.__navEl.removeEventListener("click",this.__onNavClickBound,!0),this.__fallbackScrollRoot&&this.__fallbackScrollRoot.removeEventListener?.("scroll",this.__onScrollFallbackBound),this.__fallbackScrollRoot=null,this.__entries.clear(),this.__links=[],this.__detachHashScrollRoot(),this.__cancelHashBaseline()}__cancelScrollAnimation(){this.__scrollAnimSeq++,this.__scrollRafId!==null&&(window.cancelAnimationFrame(this.__scrollRafId),this.__scrollRafId=null)}__cancelEnsureContentFocusable(){this.__focusableRafId!==null&&(window.cancelAnimationFrame(this.__focusableRafId),this.__focusableRafId=null)}__requestEnsureContentFocusable(){typeof window>"u"||(this.__cancelEnsureContentFocusable(),this.__focusableRafId=window.requestAnimationFrame(()=>{this.__focusableRafId=null,this.__ensureScrollableContentFocusable()}))}__ensureScrollableContentFocusable(){const t=this.__getScrollContainerEl();!(t instanceof HTMLElement)||t.hasAttribute("tabindex")||!(t.scrollHeight>t.clientHeight+1||t.scrollWidth>t.clientWidth+1)||t.querySelector('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"]), [contenteditable=""], [contenteditable="true"]')||t.setAttribute("tabindex","0")}__ensureMotionMeasureEl(){if(this.__motionMeasureEl)return;const t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.style.position="fixed",t.style.width="0",t.style.height="0",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.visibility="hidden",this.__motionMeasureEl=t,this.renderRoot.appendChild(t)}__disconnectObserver(){this.__observer&&(this.__observer.disconnect(),this.__observer=null)}__resolveInternals(){this.__contentShellEl=this.layout==="sidebar"?this.renderRoot.querySelector(".sidebar-content"):this.layout==="stack"?this.renderRoot.querySelector(".stack-shell"):null}__resolveSlots(){const t=this.renderRoot.querySelector('slot[name="nav"]'),e=this.renderRoot.querySelector('slot[name="content"]'),s=t?.assignedElements({flatten:!0})??[],i=e?.assignedElements({flatten:!0})??[],n=(this.navSelector||"").trim(),o=n?this.__queryExternalNav(n):s[0],r=i[0];this.__navEl=o instanceof HTMLElement?o:null,this.__contentEl=r instanceof HTMLElement?r:null,this.__resolveInternals()}__queryExternalNav(t){try{return this.getRootNode?.()?.querySelector?.(t)??document.querySelector(t)}catch{return null}}__getScrollContainerEl(){return this.layout==="sidebar"||this.layout==="stack"?this.__contentShellEl:this.__contentEl}__isOffsetTopExplicit(){return this.hasAttribute("offset-top")}__getEffectiveOffsetTop(){const t=this.__isOffsetTopExplicit()?this.offsetTop:this.__autoOffsetTop;return Math.max(0,t)}__cancelAutoOffsetMeasure(){this.__autoOffsetRafId!==null&&(window.cancelAnimationFrame(this.__autoOffsetRafId),this.__autoOffsetRafId=null)}__disconnectAutoOffsetObserver(){this.__navResizeObserver&&(this.__navResizeObserver.disconnect(),this.__navResizeObserver=null)}__requestAutoOffsetMeasure(){if(!(typeof window>"u")){if(this.__isOffsetTopExplicit()){this.__setAutoOffsetTop(0),this.__disconnectAutoOffsetObserver();return}this.__autoOffsetRafId===null&&(this.__autoOffsetRafId=window.requestAnimationFrame(()=>{this.__autoOffsetRafId=null,this.__measureAutoOffset()}))}}__measureAutoOffset(){const t=this.__navEl;if(this.__isOffsetTopExplicit()){this.__setAutoOffsetTop(0),this.__disconnectAutoOffsetObserver();return}if(!(t?.tagName==="SCB-NAV"&&(t.hasAttribute("sticky")||t.sticky===!0))){this.__setAutoOffsetTop(0),this.__disconnectAutoOffsetObserver();return}const s=Math.max(0,Math.round(t.getBoundingClientRect().height));this.__setAutoOffsetTop(s),!this.__navResizeObserver&&"ResizeObserver"in window&&(this.__navResizeObserver=new ResizeObserver(()=>{this.__requestAutoOffsetMeasure()}),this.__navResizeObserver.observe(t))}__setAutoOffsetTop(t){const e=Math.max(0,t);Math.abs(e-this.__autoOffsetTop)<1||(this.__autoOffsetTop=e,this.__rebuildObserver(),this.__requestActiveRecalc())}__rebuildObserver(){this.__disconnectObserver(),this.__entries.clear();const t=this.__getObserverRoot(),e=`-${Math.max(0,this.__getEffectiveOffsetTop())}px 0px -${Math.max(0,this.offsetBottom)}px 0px`;if(!(typeof window>"u")){if("IntersectionObserver"in window){this.__observer=new IntersectionObserver(s=>this.__onIntersect(s),{root:t,rootMargin:e,threshold:[0,.1,.25,.5,.75,1]});for(const s of this.__links)this.__observer.observe(s.targetEl);this.__requestActiveRecalc();return}this.__enableFallbackScrollSpy()}}__enableFallbackScrollSpy(){const e=this.__getObserverRoot()??window;this.__fallbackScrollRoot=e,e.addEventListener?.("scroll",this.__onScrollFallbackBound,{passive:!0}),this.__requestActiveRecalc()}__getObserverRoot(){const t=this.__getScrollContainerEl();return t instanceof HTMLElement&&(t.scrollHeight>t.clientHeight+1||t.scrollWidth>t.clientWidth+1)?t:null}__collectLinks(){const t=this.__navEl,e=this.__contentEl;if(!t||!e){this.__links=[];return}const s=Array.from(t.querySelectorAll('scb-drawer-item[item-href^="#"], a[href^="#"], button[data-href^="#"]')),i=[];for(const n of s){const o=this.__getHref(n);if(!o||!o.startsWith("#"))continue;const r=o.slice(1);if(!r)continue;const a=e.querySelector(`#${CSS.escape(r)}`);a&&i.push({id:r,navEl:n,targetEl:a})}this.__links=i}__getHref(t){return t.tagName==="A"?t.getAttribute("href")??"":t.tagName==="SCB-DRAWER-ITEM"?t.itemHref??t.getAttribute("item-href")??"":t.tagName==="BUTTON"?t.getAttribute("data-href")??"":t.getAttribute("href")??""}__onIntersect(t){for(const e of t){const s=e.target.id;s&&this.__entries.set(s,{id:s,isIntersecting:e.isIntersecting,top:e.boundingClientRect.top,ratio:e.intersectionRatio})}this.__requestActiveRecalc()}__requestActiveRecalc(){this.__rafId===null&&(this.__rafId=window.requestAnimationFrame(()=>{this.__rafId=null,this.__updateActiveFromEntries()}))}__updateActiveFromEntries(){if(this.__entries.size===0){this.__updateActiveFromRects();return}const t=Array.from(this.__entries.values()).filter(r=>r.isIntersecting);if(t.length===0)return;const e=this.__getObserverRoot(),i=((e?e.getBoundingClientRect():null)?.top??0)+Math.max(0,this.__getEffectiveOffsetTop()),o=t.filter(r=>r.top>=i).sort((r,a)=>r.top-a.top)[0]??t.sort((r,a)=>a.top-r.top)[0];o?.id&&this.__setActiveId(o.id,{updateHash:this.updateHash})}__updateActiveFromRects(){if(!this.__contentEl)return;const e=this.__getObserverRoot(),i=((e?e.getBoundingClientRect():null)?.top??0)+Math.max(0,this.__getEffectiveOffsetTop()),n=this.__links.map(a=>{const l=a.targetEl.getBoundingClientRect();return{id:a.id,top:l.top-i}}).filter(a=>Number.isFinite(a.top));if(n.length===0)return;const r=n.filter(a=>a.top>=0).sort((a,l)=>a.top-l.top)[0]??n.sort((a,l)=>l.top-a.top)[0];r?.id&&this.__setActiveId(r.id,{updateHash:this.updateHash})}__setActiveId(t,e){if(!t||t===this.activeId)return;this.activeId=t;const s=this.__links.find(i=>i.id===t);if(s){const i=this.__navEl;i?.tagName==="SCB-NAV"?i.activeHref=`#${t}`:(this.__applyActiveToNav(s.navEl),this.__expandAncestors(s.navEl))}if(e.updateHash&&this.__hashAllowUpdates&&typeof history<"u")try{history.replaceState(null,"",`#${encodeURIComponent(t)}`)}catch{}this.dispatchEvent(new CustomEvent("scb-scrollspy-active-changed",{bubbles:!0,composed:!0,detail:{id:t}}))}__applyActiveToNav(t){const e=this.__navEl;if(!e)return;const s=Array.from(e.querySelectorAll('scb-drawer-item[item-href^="#"], a[href^="#"], button[data-href^="#"]'));for(const i of s){const n=i===t;if(i.tagName==="SCB-DRAWER-ITEM"){const o=i;typeof o.selected=="boolean"&&(o.selected=n),n&&i.dispatchEvent(new CustomEvent("scb-drawer-select",{bubbles:!0,composed:!0,detail:{item:i}}))}else(i.tagName==="A"||i.tagName==="BUTTON")&&(n?i.setAttribute("aria-current","location"):i.removeAttribute("aria-current"))}}__expandAncestors(t){let e=t;for(;e;){if(e.tagName==="SCB-DRAWER-ITEM"){const s=e;typeof s.expanded=="boolean"&&(s.expanded=!0)}e=e.parentElement}}__scrollToTarget(t){const e=typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches,s=this.__getScrollContainerEl();if(s instanceof HTMLElement&&s.scrollHeight>s.clientHeight+1){const u=this.__getScrollTopInContainer(t,s)-this.__getEffectiveOffsetTop(),h=Math.max(0,s.scrollHeight-s.clientHeight),d=Math.min(h,Math.max(0,u));if(e){s.scrollTop=d;return}this.__animateScroll({get:()=>s.scrollTop,set:b=>{s.scrollTop=b},max:h,to:d});return}if(!(t instanceof HTMLElement))return;const i=t.getBoundingClientRect(),o=(window.scrollY||window.pageYOffset||0)+i.top-this.__getEffectiveOffsetTop(),r=document.documentElement,a=Math.max(0,r.scrollHeight-window.innerHeight),l=Math.min(a,Math.max(0,o));if(e){window.scrollTo(0,l);return}this.__animateScroll({get:()=>window.scrollY||window.pageYOffset||0,set:u=>window.scrollTo(0,u),max:a,to:l})}__getScrollTopInContainer(t,e){const s=e.getBoundingClientRect(),i=t.getBoundingClientRect();return e.scrollTop+(i.top-s.top)}__animateScroll(t){const e=t.get(),s=Math.min(t.max,Math.max(0,t.to));if(!Number.isFinite(e)||!Number.isFinite(s))return;if(Math.abs(s-e)<1){t.set(s);return}this.__cancelScrollAnimation(),this.__ensureMotionMeasureEl();const i=++this.__scrollAnimSeq,n=Math.abs(s-e),o=this.__getScrollDurationMs(n),r=this.__getScrollEasingFn(),a=performance.now(),l=u=>{if(i!==this.__scrollAnimSeq)return;const h=o<=0?1:Math.min(1,(u-a)/o),d=r(h);t.set(e+(s-e)*d),h<1?this.__scrollRafId=window.requestAnimationFrame(l):this.__scrollRafId=null};this.__scrollRafId=window.requestAnimationFrame(l)}__getScrollDurationMs(t){const e=this.__resolveTimeMs("var(--motion-duration-medium, 300ms)")??300,s=this.__resolveTimeMs("var(--motion-duration-long, 500ms)")??500,i=this.__resolveTimeMs("var(--motion-duration-extra-long, 700ms)")??700,n=Math.min(1,Math.max(0,t/1800)),o=e+(s-e)*n;return Math.min(i,Math.max(e,o))}__getScrollEasingFn(){const t=this.__resolveTimingFunction("var(--motion-easing-emphasized-decelerate, var(--motion-easing-emphasized, cubic-bezier(.69,.16,.2,.98)))")??"cubic-bezier(0.05, 0.7, 0.1, 1)";return this.__parseEasingFunction(t)??(s=>s)}__resolveTimeMs(t){const e=this.__motionMeasureEl;if(!e)return null;e.style.transitionDuration=t;const s=getComputedStyle(e).transitionDuration.split(",")[0]?.trim()??"";return this.__parseTimeToMs(s)}__resolveTimingFunction(t){const e=this.__motionMeasureEl;return e?(e.style.transitionTimingFunction=t,getComputedStyle(e).transitionTimingFunction.split(",")[0]?.trim()??null):null}__parseTimeToMs(t){const e=t.trim();if(!e)return null;const s=parseFloat(e);return Number.isFinite(s)?e.endsWith("ms")?s:e.endsWith("s")?s*1e3:null:null}__parseEasingFunction(t){const e=t.trim();if(!e)return null;if(e==="linear")return l=>l;const s=e.match(/cubic-bezier\(([^)]+)\)/i);if(!s)return null;const i=s[1].split(",").map(l=>parseFloat(l.trim())).filter(l=>Number.isFinite(l));if(i.length!==4)return null;const[n,o,r,a]=i;return this.__cubicBezier(n,o,r,a)}__cubicBezier(t,e,s,i){const n=3*t,o=3*(s-t)-n,r=1-n-o,a=3*e,l=3*(i-e)-a,u=1-a-l,h=c=>((r*c+o)*c+n)*c,d=c=>((u*c+l)*c+a)*c,b=c=>(3*r*c+2*o)*c+n,E=c=>{let _=c;for(let g=0;g<8;g++){const f=h(_)-c;if(Math.abs(f)<1e-6)return _;const S=b(_);if(Math.abs(S)<1e-6)break;_=_-f/S}let m=0,v=1;for(_=c;m<v;){const f=h(_)-c;if(Math.abs(f)<1e-6)return _;f>0?v=_:m=_,_=(v+m)/2}return _};return c=>{const _=E(Math.min(1,Math.max(0,c)));return d(_)}}__detachHashScrollRoot(){if(!this.__hashScrollRoot)return;const t=this.__hashScrollRoot;try{t instanceof Window?t.removeEventListener("scroll",this.__onHashScrollBound):t.removeEventListener("scroll",this.__onHashScrollBound)}catch{}this.__hashScrollRoot=null}__cancelHashBaseline(){this.__hashBaselineRafId!==null&&(window.cancelAnimationFrame(this.__hashBaselineRafId),this.__hashBaselineRafId=null),this.__hashBaselineReady=!1}__attachHashScrollRoot(){this.__detachHashScrollRoot();const e=this.__getObserverRoot()??window;this.__hashScrollRoot=e;try{e.addEventListener("scroll",this.__onHashScrollBound,{passive:!0})}catch{}this.__hashAllowUpdates=!1,this.__scheduleHashBaseline()}__scheduleHashBaseline(){this.__cancelHashBaseline();const t=()=>{this.__hashBaselinePos=this.__getHashScrollPos(),this.__hashBaselineReady=!0,this.__hashBaselineRafId=null};this.__hashBaselineRafId=window.requestAnimationFrame(()=>{this.__hashBaselineRafId=window.requestAnimationFrame(t)})}__getHashScrollPos(){const t=this.__hashScrollRoot;if(t instanceof Window)return t.scrollY||t.pageYOffset||0;if(t&&"scrollTop"in t){const e=t;return typeof e.scrollTop=="number"?e.scrollTop:0}return 0}__onHashScroll(){if(!this.updateHash||this.__hashSuspend||this.__hashAllowUpdates||!this.__hashBaselineReady)return;const t=this.__getHashScrollPos();Math.abs(t-this.__hashBaselinePos)>2&&(this.__hashAllowUpdates=!0)}__jumpToTarget(t){const e=this.__getScrollContainerEl();if(e instanceof HTMLElement&&e.scrollHeight>e.clientHeight+1){const l=this.__getScrollTopInContainer(t,e)-this.__getEffectiveOffsetTop(),u=Math.max(0,e.scrollHeight-e.clientHeight),h=Math.min(u,Math.max(0,l));e.scrollTop=h;return}if(!(t instanceof HTMLElement))return;const s=t.getBoundingClientRect(),n=(window.scrollY||window.pageYOffset||0)+s.top-this.__getEffectiveOffsetTop(),o=document.documentElement,r=Math.max(0,o.scrollHeight-window.innerHeight),a=Math.min(r,Math.max(0,n));window.scrollTo(0,a)}__applyInitialHashIfAny(){if(this.__hashInitialApplied)return;const t=typeof window<"u"?window.location.hash:"";if(!t||t.length<2)return;let e="";try{e=decodeURIComponent(t.slice(1))}catch{e=t.slice(1)}if(!e)return;const s=this.__links.find(i=>i.id===e);if(s?.targetEl){this.__hashInitialApplied=!0,this.__hashSuspend=!0;try{this.__jumpToTarget(s.targetEl),this.__setActiveId(e,{updateHash:!1})}finally{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{this.__hashSuspend=!1})})}}}__onNavClick(t){const e=this.__navEl,s=this.__contentEl;if(!e||!s)return;const n=t.composedPath().find(l=>l instanceof Element&&(l.tagName==="SCB-DRAWER-ITEM"||l.tagName==="A"||l.tagName==="BUTTON"));if(!n)return;const o=this.__getHref(n);if(!o||!o.startsWith("#"))return;const r=o.slice(1);if(!r)return;const a=s.querySelector(`#${CSS.escape(r)}`);a&&(t.preventDefault(),this.__hashAllowUpdates=!0,this.__scrollToTarget(a),this.__setActiveId(r,{updateHash:this.updateHash}))}render(){if(this.layout==="sidebar"){const t=[`--_scb-scrollspy-sidebar-nav-width: ${this.sidebarNavWidth}`,`--_scb-scrollspy-sidebar-height: ${this.sidebarHeight}`,`--_scb-scrollspy-sidebar-nav-top: ${this.sidebarNavTop}`,`--_scb-scrollspy-content-padding: ${this.contentPadding}`].join("; ");return y`
|
|
1
|
+
import{a as w,i as R,x as y,t as A}from"../../vendor/vendor.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(s,i,n){try{customElements.get(s)||e(s,i,n)}catch(r){var o=String(r||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var T=Object.getOwnPropertyDescriptor,O=(t,e,s,i)=>{for(var n=i>1?void 0:i?T(e,s):e,o=t.length-1,r;o>=0;o--)(r=t[o])&&(n=r(n)||n);return n};let p=class extends R{constructor(){super(...arguments),this.navSelector="",this.offsetTop=0,this.offsetBottom=0,this.updateHash=!0,this.activeId="",this.layout="",this.sidebarNavWidth="320px",this.sidebarHeight="560px",this.stackHeight="",this.sidebarNavTop="0px",this.contentPadding="0px",this.__navEl=null,this.__contentEl=null,this.__contentShellEl=null,this.__links=[],this.__observer=null,this.__fallbackScrollRoot=null,this.__entries=new Map,this.__rafId=null,this.__scrollRafId=null,this.__hashAllowUpdates=!1,this.__hashBaselineReady=!1,this.__hashBaselinePos=0,this.__hashBaselineRafId=null,this.__hashScrollRoot=null,this.__hashSuspend=!1,this.__hashInitialApplied=!1,this.__onHashScrollBound=()=>this.__onHashScroll(),this.__scrollAnimSeq=0,this.__motionMeasureEl=null,this.__focusableRafId=null,this.__autoOffsetTop=0,this.__autoOffsetRafId=null,this.__navResizeObserver=null,this.__onNavClickBound=t=>this.__onNavClick(t),this.__onScrollFallbackBound=()=>this.__updateActiveFromRects(),this.__onResizeBound=()=>{this.__requestActiveRecalc(),this.__requestAutoOffsetMeasure()},this.__onSlotChange=()=>{const t=this.__navEl;this.__teardown(),this.__resolveSlots(),this.__requestEnsureContentFocusable(),this.__navEl&&this.__navEl.addEventListener("click",this.__onNavClickBound,!0),(t!==this.__navEl||!this.__links.length)&&this.__collectLinks(),this.__requestAutoOffsetMeasure(),this.__rebuildObserver(),this.__attachHashScrollRoot(),this.__applyInitialHashIfAny()}}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.__onResizeBound,{passive:!0})}firstUpdated(){this.__ensureMotionMeasureEl(),this.__resolveInternals(),this.__requestEnsureContentFocusable(),this.__requestAutoOffsetMeasure()}disconnectedCallback(){window.removeEventListener("resize",this.__onResizeBound),this.__teardown(),super.disconnectedCallback()}updated(t){if(t.has("navSelector")){this.__onSlotChange();return}if(t.has("layout")){this.__onSlotChange();return}(t.has("offsetTop")||t.has("offsetBottom"))&&(this.__rebuildObserver(),this.__attachHashScrollRoot()),(t.has("sidebarNavWidth")||t.has("sidebarHeight")||t.has("stackHeight")||t.has("sidebarNavTop")||t.has("contentPadding"))&&(this.__resolveInternals(),this.__requestEnsureContentFocusable(),this.__rebuildObserver())}__teardown(){this.__cancelScrollAnimation(),this.__cancelEnsureContentFocusable(),this.__cancelAutoOffsetMeasure(),this.__disconnectAutoOffsetObserver(),this.__disconnectObserver(),this.__navEl&&this.__navEl.removeEventListener("click",this.__onNavClickBound,!0),this.__fallbackScrollRoot&&this.__fallbackScrollRoot.removeEventListener?.("scroll",this.__onScrollFallbackBound),this.__fallbackScrollRoot=null,this.__entries.clear(),this.__links=[],this.__detachHashScrollRoot(),this.__cancelHashBaseline()}__cancelScrollAnimation(){this.__scrollAnimSeq++,this.__scrollRafId!==null&&(window.cancelAnimationFrame(this.__scrollRafId),this.__scrollRafId=null)}__cancelEnsureContentFocusable(){this.__focusableRafId!==null&&(window.cancelAnimationFrame(this.__focusableRafId),this.__focusableRafId=null)}__requestEnsureContentFocusable(){typeof window>"u"||(this.__cancelEnsureContentFocusable(),this.__focusableRafId=window.requestAnimationFrame(()=>{this.__focusableRafId=null,this.__ensureScrollableContentFocusable()}))}__ensureScrollableContentFocusable(){const t=this.__getScrollContainerEl();!(t instanceof HTMLElement)||t.hasAttribute("tabindex")||!(t.scrollHeight>t.clientHeight+1||t.scrollWidth>t.clientWidth+1)||t.querySelector('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"]), [contenteditable=""], [contenteditable="true"]')||t.setAttribute("tabindex","0")}__ensureMotionMeasureEl(){if(this.__motionMeasureEl)return;const t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.style.position="fixed",t.style.width="0",t.style.height="0",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.visibility="hidden",this.__motionMeasureEl=t,this.renderRoot.appendChild(t)}__disconnectObserver(){this.__observer&&(this.__observer.disconnect(),this.__observer=null)}__resolveInternals(){this.__contentShellEl=this.layout==="sidebar"?this.renderRoot.querySelector(".sidebar-content"):this.layout==="stack"?this.renderRoot.querySelector(".stack-shell"):null}__resolveSlots(){const t=this.renderRoot.querySelector('slot[name="nav"]'),e=this.renderRoot.querySelector('slot[name="content"]'),s=t?.assignedElements({flatten:!0})??[],i=e?.assignedElements({flatten:!0})??[],n=(this.navSelector||"").trim(),o=n?this.__queryExternalNav(n):s[0],r=i[0];this.__navEl=o instanceof HTMLElement?o:null,this.__contentEl=r instanceof HTMLElement?r:null,this.__resolveInternals()}__queryExternalNav(t){try{return this.getRootNode?.()?.querySelector?.(t)??document.querySelector(t)}catch{return null}}__getScrollContainerEl(){return this.layout==="sidebar"||this.layout==="stack"?this.__contentShellEl:this.__contentEl}__isOffsetTopExplicit(){return this.hasAttribute("offset-top")}__getEffectiveOffsetTop(){const t=this.__isOffsetTopExplicit()?this.offsetTop:this.__autoOffsetTop;return Math.max(0,t)}__cancelAutoOffsetMeasure(){this.__autoOffsetRafId!==null&&(window.cancelAnimationFrame(this.__autoOffsetRafId),this.__autoOffsetRafId=null)}__disconnectAutoOffsetObserver(){this.__navResizeObserver&&(this.__navResizeObserver.disconnect(),this.__navResizeObserver=null)}__requestAutoOffsetMeasure(){if(!(typeof window>"u")){if(this.__isOffsetTopExplicit()){this.__setAutoOffsetTop(0),this.__disconnectAutoOffsetObserver();return}this.__autoOffsetRafId===null&&(this.__autoOffsetRafId=window.requestAnimationFrame(()=>{this.__autoOffsetRafId=null,this.__measureAutoOffset()}))}}__measureAutoOffset(){const t=this.__navEl;if(this.__isOffsetTopExplicit()){this.__setAutoOffsetTop(0),this.__disconnectAutoOffsetObserver();return}if(!(t?.tagName==="SCB-NAV"&&(t.hasAttribute("sticky")||t.sticky===!0))){this.__setAutoOffsetTop(0),this.__disconnectAutoOffsetObserver();return}const s=Math.max(0,Math.round(t.getBoundingClientRect().height));this.__setAutoOffsetTop(s),!this.__navResizeObserver&&"ResizeObserver"in window&&(this.__navResizeObserver=new ResizeObserver(()=>{this.__requestAutoOffsetMeasure()}),this.__navResizeObserver.observe(t))}__setAutoOffsetTop(t){const e=Math.max(0,t);Math.abs(e-this.__autoOffsetTop)<1||(this.__autoOffsetTop=e,this.__rebuildObserver(),this.__requestActiveRecalc())}__rebuildObserver(){this.__disconnectObserver(),this.__entries.clear();const t=this.__getObserverRoot(),e=`-${Math.max(0,this.__getEffectiveOffsetTop())}px 0px -${Math.max(0,this.offsetBottom)}px 0px`;if(!(typeof window>"u")){if("IntersectionObserver"in window){this.__observer=new IntersectionObserver(s=>this.__onIntersect(s),{root:t,rootMargin:e,threshold:[0,.1,.25,.5,.75,1]});for(const s of this.__links)this.__observer.observe(s.targetEl);this.__requestActiveRecalc();return}this.__enableFallbackScrollSpy()}}__enableFallbackScrollSpy(){const e=this.__getObserverRoot()??window;this.__fallbackScrollRoot=e,e.addEventListener?.("scroll",this.__onScrollFallbackBound,{passive:!0}),this.__requestActiveRecalc()}__getObserverRoot(){const t=this.__getScrollContainerEl();return t instanceof HTMLElement&&(t.scrollHeight>t.clientHeight+1||t.scrollWidth>t.clientWidth+1)?t:null}__collectLinks(){const t=this.__navEl,e=this.__contentEl;if(!t||!e){this.__links=[];return}const s=Array.from(t.querySelectorAll('scb-menu-item[item-href^="#"], a[href^="#"], button[data-href^="#"]')),i=[];for(const n of s){const o=this.__getHref(n);if(!o||!o.startsWith("#"))continue;const r=o.slice(1);if(!r)continue;const a=e.querySelector(`#${CSS.escape(r)}`);a&&i.push({id:r,navEl:n,targetEl:a})}this.__links=i}__getHref(t){return t.tagName==="A"?t.getAttribute("href")??"":t.tagName==="SCB-MENU-ITEM"?t.itemHref??t.getAttribute("item-href")??"":t.tagName==="BUTTON"?t.getAttribute("data-href")??"":t.getAttribute("href")??""}__onIntersect(t){for(const e of t){const s=e.target.id;s&&this.__entries.set(s,{id:s,isIntersecting:e.isIntersecting,top:e.boundingClientRect.top,ratio:e.intersectionRatio})}this.__requestActiveRecalc()}__requestActiveRecalc(){this.__rafId===null&&(this.__rafId=window.requestAnimationFrame(()=>{this.__rafId=null,this.__updateActiveFromEntries()}))}__updateActiveFromEntries(){if(this.__entries.size===0){this.__updateActiveFromRects();return}const t=Array.from(this.__entries.values()).filter(r=>r.isIntersecting);if(t.length===0)return;const e=this.__getObserverRoot(),i=((e?e.getBoundingClientRect():null)?.top??0)+Math.max(0,this.__getEffectiveOffsetTop()),o=t.filter(r=>r.top>=i).sort((r,a)=>r.top-a.top)[0]??t.sort((r,a)=>a.top-r.top)[0];o?.id&&this.__setActiveId(o.id,{updateHash:this.updateHash})}__updateActiveFromRects(){if(!this.__contentEl)return;const e=this.__getObserverRoot(),i=((e?e.getBoundingClientRect():null)?.top??0)+Math.max(0,this.__getEffectiveOffsetTop()),n=this.__links.map(a=>{const l=a.targetEl.getBoundingClientRect();return{id:a.id,top:l.top-i}}).filter(a=>Number.isFinite(a.top));if(n.length===0)return;const r=n.filter(a=>a.top>=0).sort((a,l)=>a.top-l.top)[0]??n.sort((a,l)=>l.top-a.top)[0];r?.id&&this.__setActiveId(r.id,{updateHash:this.updateHash})}__setActiveId(t,e){if(!t||t===this.activeId)return;this.activeId=t;const s=this.__links.find(i=>i.id===t);if(s){const i=this.__navEl;i?.tagName==="SCB-NAV"?i.activeHref=`#${t}`:(this.__applyActiveToNav(s.navEl),this.__expandAncestors(s.navEl))}if(e.updateHash&&this.__hashAllowUpdates&&typeof history<"u")try{history.replaceState(null,"",`#${encodeURIComponent(t)}`)}catch{}this.dispatchEvent(new CustomEvent("scb-scrollspy-active-changed",{bubbles:!0,composed:!0,detail:{id:t}}))}__applyActiveToNav(t){const e=this.__navEl;if(!e)return;const s=Array.from(e.querySelectorAll('scb-menu-item[item-href^="#"], a[href^="#"], button[data-href^="#"]'));for(const i of s){const n=i===t;if(i.tagName==="SCB-MENU-ITEM"){const o=i;typeof o.selected=="boolean"&&(o.selected=n),n&&i.dispatchEvent(new CustomEvent("scb-menu-select",{bubbles:!0,composed:!0,detail:{item:i}}))}else(i.tagName==="A"||i.tagName==="BUTTON")&&(n?i.setAttribute("aria-current","location"):i.removeAttribute("aria-current"))}}__expandAncestors(t){let e=t;for(;e;){if(e.tagName==="SCB-MENU-ITEM"){const s=e;typeof s.expanded=="boolean"&&(s.expanded=!0)}e=e.parentElement}}__scrollToTarget(t){const e=typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches,s=this.__getScrollContainerEl();if(s instanceof HTMLElement&&s.scrollHeight>s.clientHeight+1){const u=this.__getScrollTopInContainer(t,s)-this.__getEffectiveOffsetTop(),h=Math.max(0,s.scrollHeight-s.clientHeight),d=Math.min(h,Math.max(0,u));if(e){s.scrollTop=d;return}this.__animateScroll({get:()=>s.scrollTop,set:b=>{s.scrollTop=b},max:h,to:d});return}if(!(t instanceof HTMLElement))return;const i=t.getBoundingClientRect(),o=(window.scrollY||window.pageYOffset||0)+i.top-this.__getEffectiveOffsetTop(),r=document.documentElement,a=Math.max(0,r.scrollHeight-window.innerHeight),l=Math.min(a,Math.max(0,o));if(e){window.scrollTo(0,l);return}this.__animateScroll({get:()=>window.scrollY||window.pageYOffset||0,set:u=>window.scrollTo(0,u),max:a,to:l})}__getScrollTopInContainer(t,e){const s=e.getBoundingClientRect(),i=t.getBoundingClientRect();return e.scrollTop+(i.top-s.top)}__animateScroll(t){const e=t.get(),s=Math.min(t.max,Math.max(0,t.to));if(!Number.isFinite(e)||!Number.isFinite(s))return;if(Math.abs(s-e)<1){t.set(s);return}this.__cancelScrollAnimation(),this.__ensureMotionMeasureEl();const i=++this.__scrollAnimSeq,n=Math.abs(s-e),o=this.__getScrollDurationMs(n),r=this.__getScrollEasingFn(),a=performance.now(),l=u=>{if(i!==this.__scrollAnimSeq)return;const h=o<=0?1:Math.min(1,(u-a)/o),d=r(h);t.set(e+(s-e)*d),h<1?this.__scrollRafId=window.requestAnimationFrame(l):this.__scrollRafId=null};this.__scrollRafId=window.requestAnimationFrame(l)}__getScrollDurationMs(t){const e=this.__resolveTimeMs("var(--motion-duration-medium, 300ms)")??300,s=this.__resolveTimeMs("var(--motion-duration-long, 500ms)")??500,i=this.__resolveTimeMs("var(--motion-duration-extra-long, 700ms)")??700,n=Math.min(1,Math.max(0,t/1800)),o=e+(s-e)*n;return Math.min(i,Math.max(e,o))}__getScrollEasingFn(){const t=this.__resolveTimingFunction("var(--motion-easing-emphasized-decelerate, var(--motion-easing-emphasized, cubic-bezier(.69,.16,.2,.98)))")??"cubic-bezier(0.05, 0.7, 0.1, 1)";return this.__parseEasingFunction(t)??(s=>s)}__resolveTimeMs(t){const e=this.__motionMeasureEl;if(!e)return null;e.style.transitionDuration=t;const s=getComputedStyle(e).transitionDuration.split(",")[0]?.trim()??"";return this.__parseTimeToMs(s)}__resolveTimingFunction(t){const e=this.__motionMeasureEl;return e?(e.style.transitionTimingFunction=t,getComputedStyle(e).transitionTimingFunction.split(",")[0]?.trim()??null):null}__parseTimeToMs(t){const e=t.trim();if(!e)return null;const s=parseFloat(e);return Number.isFinite(s)?e.endsWith("ms")?s:e.endsWith("s")?s*1e3:null:null}__parseEasingFunction(t){const e=t.trim();if(!e)return null;if(e==="linear")return l=>l;const s=e.match(/cubic-bezier\(([^)]+)\)/i);if(!s)return null;const i=s[1].split(",").map(l=>parseFloat(l.trim())).filter(l=>Number.isFinite(l));if(i.length!==4)return null;const[n,o,r,a]=i;return this.__cubicBezier(n,o,r,a)}__cubicBezier(t,e,s,i){const n=3*t,o=3*(s-t)-n,r=1-n-o,a=3*e,l=3*(i-e)-a,u=1-a-l,h=c=>((r*c+o)*c+n)*c,d=c=>((u*c+l)*c+a)*c,b=c=>(3*r*c+2*o)*c+n,E=c=>{let _=c;for(let g=0;g<8;g++){const f=h(_)-c;if(Math.abs(f)<1e-6)return _;const S=b(_);if(Math.abs(S)<1e-6)break;_=_-f/S}let m=0,v=1;for(_=c;m<v;){const f=h(_)-c;if(Math.abs(f)<1e-6)return _;f>0?v=_:m=_,_=(v+m)/2}return _};return c=>{const _=E(Math.min(1,Math.max(0,c)));return d(_)}}__detachHashScrollRoot(){if(!this.__hashScrollRoot)return;const t=this.__hashScrollRoot;try{t instanceof Window?t.removeEventListener("scroll",this.__onHashScrollBound):t.removeEventListener("scroll",this.__onHashScrollBound)}catch{}this.__hashScrollRoot=null}__cancelHashBaseline(){this.__hashBaselineRafId!==null&&(window.cancelAnimationFrame(this.__hashBaselineRafId),this.__hashBaselineRafId=null),this.__hashBaselineReady=!1}__attachHashScrollRoot(){this.__detachHashScrollRoot();const e=this.__getObserverRoot()??window;this.__hashScrollRoot=e;try{e.addEventListener("scroll",this.__onHashScrollBound,{passive:!0})}catch{}this.__hashAllowUpdates=!1,this.__scheduleHashBaseline()}__scheduleHashBaseline(){this.__cancelHashBaseline();const t=()=>{this.__hashBaselinePos=this.__getHashScrollPos(),this.__hashBaselineReady=!0,this.__hashBaselineRafId=null};this.__hashBaselineRafId=window.requestAnimationFrame(()=>{this.__hashBaselineRafId=window.requestAnimationFrame(t)})}__getHashScrollPos(){const t=this.__hashScrollRoot;if(t instanceof Window)return t.scrollY||t.pageYOffset||0;if(t&&"scrollTop"in t){const e=t;return typeof e.scrollTop=="number"?e.scrollTop:0}return 0}__onHashScroll(){if(!this.updateHash||this.__hashSuspend||this.__hashAllowUpdates||!this.__hashBaselineReady)return;const t=this.__getHashScrollPos();Math.abs(t-this.__hashBaselinePos)>2&&(this.__hashAllowUpdates=!0)}__jumpToTarget(t){const e=this.__getScrollContainerEl();if(e instanceof HTMLElement&&e.scrollHeight>e.clientHeight+1){const l=this.__getScrollTopInContainer(t,e)-this.__getEffectiveOffsetTop(),u=Math.max(0,e.scrollHeight-e.clientHeight),h=Math.min(u,Math.max(0,l));e.scrollTop=h;return}if(!(t instanceof HTMLElement))return;const s=t.getBoundingClientRect(),n=(window.scrollY||window.pageYOffset||0)+s.top-this.__getEffectiveOffsetTop(),o=document.documentElement,r=Math.max(0,o.scrollHeight-window.innerHeight),a=Math.min(r,Math.max(0,n));window.scrollTo(0,a)}__applyInitialHashIfAny(){if(this.__hashInitialApplied)return;const t=typeof window<"u"?window.location.hash:"";if(!t||t.length<2)return;let e="";try{e=decodeURIComponent(t.slice(1))}catch{e=t.slice(1)}if(!e)return;const s=this.__links.find(i=>i.id===e);if(s?.targetEl){this.__hashInitialApplied=!0,this.__hashSuspend=!0;try{this.__jumpToTarget(s.targetEl),this.__setActiveId(e,{updateHash:!1})}finally{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{this.__hashSuspend=!1})})}}}__onNavClick(t){const e=this.__navEl,s=this.__contentEl;if(!e||!s)return;const n=t.composedPath().find(l=>l instanceof Element&&(l.tagName==="SCB-MENU-ITEM"||l.tagName==="A"||l.tagName==="BUTTON"));if(!n)return;const o=this.__getHref(n);if(!o||!o.startsWith("#"))return;const r=o.slice(1);if(!r)return;const a=s.querySelector(`#${CSS.escape(r)}`);a&&(t.preventDefault(),this.__hashAllowUpdates=!0,this.__scrollToTarget(a),this.__setActiveId(r,{updateHash:this.updateHash}))}render(){if(this.layout==="sidebar"){const t=[`--_scb-scrollspy-sidebar-nav-width: ${this.sidebarNavWidth}`,`--_scb-scrollspy-sidebar-height: ${this.sidebarHeight}`,`--_scb-scrollspy-sidebar-nav-top: ${this.sidebarNavTop}`,`--_scb-scrollspy-content-padding: ${this.contentPadding}`].join("; ");return y`
|
|
2
2
|
<div class="sidebar-layout" style=${t}>
|
|
3
3
|
<div class="sidebar-nav">
|
|
4
4
|
<slot name="nav" @slotchange=${this.__onSlotChange}></slot>
|
|
@@ -65,7 +65,7 @@ import{a as w,i as R,x as y,t as A}from"../../vendor/vendor.js";(function(){try{
|
|
|
65
65
|
box-sizing: border-box;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
:host([layout='sidebar']) ::slotted(scb-
|
|
69
|
-
border-radius: var(--scb-
|
|
68
|
+
:host([layout='sidebar']) ::slotted(scb-menu) {
|
|
69
|
+
border-radius: var(--scb-menu-surface-radius, 16px);
|
|
70
70
|
}
|
|
71
71
|
`;p=O([A("scb-scrollspy")],p);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.164",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -377,5 +377,5 @@
|
|
|
377
377
|
},
|
|
378
378
|
"./mvc/*": "./mvc/*"
|
|
379
379
|
},
|
|
380
|
-
"buildHash": "
|
|
380
|
+
"buildHash": "270B749AB5185762F2FB68930016D99C7B008EA7EC77CC82494DBA6EABFC07EB"
|
|
381
381
|
}
|
package/scb-card/scb-card.js
CHANGED
|
@@ -12,7 +12,7 @@ var w = Object.defineProperty, S = Object.getOwnPropertyDescriptor, x = (e) => {
|
|
|
12
12
|
for (var c = o > 1 ? void 0 : o ? S(i, n) : i, p = e.length - 1, d; p >= 0; p--)
|
|
13
13
|
(d = e[p]) && (c = (o ? d(i, n, c) : d(c)) || c);
|
|
14
14
|
return o && c && w(i, n, c), c;
|
|
15
|
-
}, _ = (e, i, n) => i.has(e) || x("Cannot " + n), T = (e, i, n) => i.has(e) ? x("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, n), y = (e, i, n) => (_(e, i, "access private method"), n), b,
|
|
15
|
+
}, _ = (e, i, n) => i.has(e) || x("Cannot " + n), T = (e, i, n) => i.has(e) ? x("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, n), y = (e, i, n) => (_(e, i, "access private method"), n), b, g;
|
|
16
16
|
let t = class extends k {
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments), T(this, b), this.type = "", this.variant = "", this.direction = "", this.mediaType = "", this.mediaHref = "", this.mediaAlt = "", this.mediaSrcset = "", this.mediaSizes = "", this.mediaLoading = "auto", this.mediaDecoding = "async", this.mediaFetchPriority = "auto", this.mediaFit = "cover", this.mediaPosition = "center", this.mediaWidth = "", this.mediaHeight = "", this.mediaAspect = "", this.mediaPlaceholder = !1, this.cardHref = "", this.title = "", this.subtitle = "", this.supportingText = "", this.commentsText = "", this.comments = 0, this.commentsHref = "", this.likesText = "", this.likes = 0, this.hasLiked = !1, this.likesInteractive = !1, this.sizing = "stretch", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "", this.spacing = "", this.spacingTop = "", this.spacingBottom = "", this.spacingLeft = "", this.spacingRight = "", this.__onImgLoad = (e) => {
|
|
@@ -136,8 +136,8 @@ let t = class extends k {
|
|
|
136
136
|
l.stopPropagation();
|
|
137
137
|
}, u = (l) => {
|
|
138
138
|
var f;
|
|
139
|
-
const
|
|
140
|
-
|
|
139
|
+
const v = (f = this.renderRoot) == null ? void 0 : f.querySelector(".scb-card");
|
|
140
|
+
v && (l ? v.classList.add("no-hover") : v.classList.remove("no-hover"));
|
|
141
141
|
};
|
|
142
142
|
return d(s`
|
|
143
143
|
<div class="full-content">
|
|
@@ -225,14 +225,14 @@ let t = class extends k {
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
updated(e) {
|
|
228
|
-
super.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("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("type") && (this.type === "list" ? this.setAttribute("data-density", "-2") : this.removeAttribute("data-density")), this.style.setProperty("--scb-card-media-fit", this.mediaFit || "cover"), this.style.setProperty("--scb-card-media-position", this.mediaPosition || "center"), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && y(this, b,
|
|
228
|
+
super.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("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("type") && (this.type === "list" ? this.setAttribute("data-density", "-2") : this.removeAttribute("data-density")), this.style.setProperty("--scb-card-media-fit", this.mediaFit || "cover"), this.style.setProperty("--scb-card-media-position", this.mediaPosition || "center"), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && y(this, b, g).call(this);
|
|
229
229
|
}
|
|
230
230
|
async firstUpdated(e) {
|
|
231
|
-
t.__iconLoaded || (await import("@material/web/icon/icon.js"), t.__iconLoaded = !0), t.__rippleLoaded || (await import("@material/web/ripple/ripple.js"), t.__rippleLoaded = !0), y(this, b,
|
|
231
|
+
t.__iconLoaded || (await import("@material/web/icon/icon.js"), t.__iconLoaded = !0), t.__rippleLoaded || (await import("@material/web/ripple/ripple.js"), t.__rippleLoaded = !0), y(this, b, g).call(this);
|
|
232
232
|
}
|
|
233
233
|
};
|
|
234
234
|
b = /* @__PURE__ */ new WeakSet();
|
|
235
|
-
|
|
235
|
+
g = function() {
|
|
236
236
|
const e = this.mapSpacingToken(this.spacing), i = this.mapSpacingToken(this.spacingTop) ?? e, n = this.mapSpacingToken(this.spacingBottom) ?? e, o = this.mapSpacingToken(this.spacingLeft), c = this.mapSpacingToken(this.spacingRight);
|
|
237
237
|
i ? this.style.setProperty("--scb-card-spacing-block-start", i) : this.style.removeProperty("--scb-card-spacing-block-start"), n ? this.style.setProperty("--scb-card-spacing-block-end", n) : this.style.removeProperty("--scb-card-spacing-block-end"), o ? this.style.setProperty("--scb-card-spacing-inline-start", o) : this.style.removeProperty("--scb-card-spacing-inline-start"), c ? this.style.setProperty("--scb-card-spacing-inline-end", c) : this.style.removeProperty("--scb-card-spacing-inline-end");
|
|
238
238
|
};
|
|
@@ -430,7 +430,7 @@ t.styles = $`
|
|
|
430
430
|
.top-content {
|
|
431
431
|
display: flex;
|
|
432
432
|
flex-direction: column;
|
|
433
|
-
gap: var(--spacing-
|
|
433
|
+
gap: var(--spacing-4);
|
|
434
434
|
min-inline-size: 0;
|
|
435
435
|
}
|
|
436
436
|
|
|
@@ -472,9 +472,9 @@ t.styles = $`
|
|
|
472
472
|
letter-spacing: var(--md-sys-typescale-title-medium-tracking);
|
|
473
473
|
}
|
|
474
474
|
.supporting-text {
|
|
475
|
-
font-size: var(--md-sys-typescale-body-
|
|
476
|
-
line-height: var(--md-sys-typescale-body-
|
|
477
|
-
letter-spacing: var(--md-sys-typescale-body-
|
|
475
|
+
font-size: var(--md-sys-typescale-body-medium-size);
|
|
476
|
+
line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
477
|
+
letter-spacing: var(--md-sys-typescale-body-medium-tracking);
|
|
478
478
|
}
|
|
479
479
|
.date {
|
|
480
480
|
font-size: var(--md-sys-typescale-body-medium-size);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { css as d, LitElement as
|
|
1
|
+
import { css as d, LitElement as m, html as l } from "lit";
|
|
2
2
|
import { property as o, customElement as u } from "lit/decorators.js";
|
|
3
|
-
var
|
|
4
|
-
for (var t = i > 1 ? void 0 : i ?
|
|
3
|
+
var g = Object.defineProperty, y = Object.getOwnPropertyDescriptor, r = (c, s, a, i) => {
|
|
4
|
+
for (var t = i > 1 ? void 0 : i ? y(s, a) : s, n = c.length - 1, p; n >= 0; n--)
|
|
5
5
|
(p = c[n]) && (t = (i ? p(s, a, t) : p(t)) || t);
|
|
6
|
-
return i && t &&
|
|
6
|
+
return i && t && g(s, a, t), t;
|
|
7
7
|
};
|
|
8
|
-
let e = class extends
|
|
8
|
+
let e = class extends m {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this.title = "", this.subtitle = "", this.supportingText = "";
|
|
11
11
|
}
|
|
@@ -25,7 +25,7 @@ e.styles = d`
|
|
|
25
25
|
:host {
|
|
26
26
|
display: flex;
|
|
27
27
|
flex-direction: column;
|
|
28
|
-
gap: var(--spacing-
|
|
28
|
+
gap: var(--spacing-4);
|
|
29
29
|
width: 100%;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -47,9 +47,9 @@ e.styles = d`
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.supporting-text {
|
|
50
|
-
font-size: var(--md-sys-typescale-body-
|
|
51
|
-
line-height: var(--md-sys-typescale-body-
|
|
52
|
-
letter-spacing: var(--md-sys-typescale-body-
|
|
50
|
+
font-size: var(--md-sys-typescale-body-medium-size);
|
|
51
|
+
line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
52
|
+
letter-spacing: var(--md-sys-typescale-body-medium-tracking);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.content.links ::slotted(*) {
|