scb-wc-test 0.1.1
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/README.md +130 -0
- package/all.js +54 -0
- package/dummy.png +0 -0
- package/index.d.ts +54 -0
- package/index.js +108 -0
- package/mvc/components/all.js +53 -0
- package/mvc/components/scb-accordion/scb-accordion-item.js +194 -0
- package/mvc/components/scb-accordion/scb-accordion.js +5 -0
- package/mvc/components/scb-app-bar/scb-app-bar.js +144 -0
- package/mvc/components/scb-avatar/scb-avatar.js +99 -0
- package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +17 -0
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +52 -0
- package/mvc/components/scb-button/scb-button.js +121 -0
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +140 -0
- package/mvc/components/scb-card/scb-card.js +256 -0
- package/mvc/components/scb-checkbox/scb-checkbox-group.js +33 -0
- package/mvc/components/scb-checkbox/scb-checkbox.js +99 -0
- package/mvc/components/scb-chips/scb-chip.js +46 -0
- package/mvc/components/scb-dialog/scb-dialog.js +158 -0
- package/mvc/components/scb-divider/scb-divider.js +53 -0
- package/mvc/components/scb-drawer/scb-drawer-item.js +114 -0
- package/mvc/components/scb-drawer/scb-drawer-section.js +19 -0
- package/mvc/components/scb-drawer/scb-drawer.js +79 -0
- package/mvc/components/scb-drawer/scb-sub-drawer.js +10 -0
- package/mvc/components/scb-fact-card/scb-fact-card-content.js +44 -0
- package/mvc/components/scb-fact-card/scb-fact-card.js +66 -0
- package/mvc/components/scb-footer/scb-footer-section.js +3 -0
- package/mvc/components/scb-footer/scb-footer.js +205 -0
- package/mvc/components/scb-grid/scb-grid-item.js +9 -0
- package/mvc/components/scb-grid/scb-grid.js +81 -0
- package/mvc/components/scb-grid/scb-stack.js +16 -0
- package/mvc/components/scb-header/scb-header-drawer-group.js +1 -0
- package/mvc/components/scb-header/scb-header-drawer-item.js +1 -0
- package/mvc/components/scb-header/scb-header-tab.js +1 -0
- package/mvc/components/scb-header/scb-header-utility.js +1 -0
- package/mvc/components/scb-header/scb-header.js +240 -0
- package/mvc/components/scb-icon-button/scb-icon-button.js +95 -0
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +69 -0
- package/mvc/components/scb-link/scb-link.js +31 -0
- package/mvc/components/scb-list/scb-list-item.js +38 -0
- package/mvc/components/scb-list/scb-list.js +10 -0
- package/mvc/components/scb-menu/scb-menu-item.js +44 -0
- package/mvc/components/scb-menu/scb-menu.js +17 -0
- package/mvc/components/scb-menu/scb-sub-menu.js +29 -0
- package/mvc/components/scb-notification/scb-notification.js +120 -0
- package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +84 -0
- package/mvc/components/scb-radio-button/scb-radio-button.js +95 -0
- package/mvc/components/scb-radio-button/scb-radio-group.js +28 -0
- package/mvc/components/scb-search/scb-search.js +211 -0
- package/mvc/components/scb-snackbar/scb-snackbar.js +83 -0
- package/mvc/components/scb-status-pill/scb-status-pill.js +31 -0
- package/mvc/components/scb-switch/scb-switch.js +54 -0
- package/mvc/components/scb-tabs/scb-primary-tab.js +7 -0
- package/mvc/components/scb-tabs/scb-secondary-tab.js +7 -0
- package/mvc/components/scb-tabs/scb-tabs.js +23 -0
- package/mvc/components/scb-textfield/scb-textfield.js +135 -0
- package/mvc/components/scb-toc/scb-toc-item.js +84 -0
- package/mvc/components/scb-toc/scb-toc.js +6 -0
- package/mvc/components/scb-tooltip/scb-tooltip.js +216 -0
- package/mvc/scb-logo.svg +21 -0
- package/mvc/scb-wc-test.css +1 -0
- package/mvc/scb.svg +14 -0
- package/mvc/vendor/preload-helper.js +1 -0
- package/mvc/vendor/vendor-lit.js +1 -0
- package/mvc/vendor/vendor-material.js +764 -0
- package/mvc/vendor/vendor.js +68 -0
- package/package.json +248 -0
- package/scb-accordion/scb-accordion-item.d.ts +37 -0
- package/scb-accordion/scb-accordion-item.js +343 -0
- package/scb-accordion/scb-accordion.d.ts +6 -0
- package/scb-accordion/scb-accordion.js +33 -0
- package/scb-app-bar/scb-app-bar.d.ts +10 -0
- package/scb-app-bar/scb-app-bar.js +192 -0
- package/scb-avatar/scb-avatar.d.ts +30 -0
- package/scb-avatar/scb-avatar.js +169 -0
- package/scb-breadcrumb/scb-breadcrumb-item.d.ts +9 -0
- package/scb-breadcrumb/scb-breadcrumb-item.js +54 -0
- package/scb-breadcrumb/scb-breadcrumb.d.ts +16 -0
- package/scb-breadcrumb/scb-breadcrumb.js +105 -0
- package/scb-button/scb-button.d.ts +26 -0
- package/scb-button/scb-button.js +247 -0
- package/scb-calendar-card/scb-calendar-card.d.ts +20 -0
- package/scb-calendar-card/scb-calendar-card.js +191 -0
- package/scb-card/scb-card.d.ts +24 -0
- package/scb-card/scb-card.js +345 -0
- package/scb-checkbox/scb-checkbox-group.d.ts +17 -0
- package/scb-checkbox/scb-checkbox-group.js +80 -0
- package/scb-checkbox/scb-checkbox.d.ts +20 -0
- package/scb-checkbox/scb-checkbox.js +157 -0
- package/scb-chips/scb-chip.d.ts +24 -0
- package/scb-chips/scb-chip.js +150 -0
- package/scb-dialog/scb-dialog.d.ts +58 -0
- package/scb-dialog/scb-dialog.js +390 -0
- package/scb-divider/scb-divider.d.ts +9 -0
- package/scb-divider/scb-divider.js +85 -0
- package/scb-drawer/scb-drawer-item.d.ts +61 -0
- package/scb-drawer/scb-drawer-item.js +220 -0
- package/scb-drawer/scb-drawer-section.d.ts +7 -0
- package/scb-drawer/scb-drawer-section.js +44 -0
- package/scb-drawer/scb-drawer.d.ts +97 -0
- package/scb-drawer/scb-drawer.js +258 -0
- package/scb-drawer/scb-sub-drawer.d.ts +10 -0
- package/scb-drawer/scb-sub-drawer.js +43 -0
- package/scb-fact-card/scb-fact-card-content.d.ts +10 -0
- package/scb-fact-card/scb-fact-card-content.js +83 -0
- package/scb-fact-card/scb-fact-card.d.ts +15 -0
- package/scb-fact-card/scb-fact-card.js +110 -0
- package/scb-footer/scb-footer-section.d.ts +21 -0
- package/scb-footer/scb-footer-section.js +28 -0
- package/scb-footer/scb-footer.d.ts +27 -0
- package/scb-footer/scb-footer.js +326 -0
- package/scb-grid/scb-grid-item.d.ts +28 -0
- package/scb-grid/scb-grid-item.js +66 -0
- package/scb-grid/scb-grid.d.ts +33 -0
- package/scb-grid/scb-grid.js +152 -0
- package/scb-grid/scb-stack.d.ts +29 -0
- package/scb-grid/scb-stack.js +82 -0
- package/scb-header/scb-header-drawer-group.d.ts +13 -0
- package/scb-header/scb-header-drawer-group.js +28 -0
- package/scb-header/scb-header-drawer-item.d.ts +14 -0
- package/scb-header/scb-header-drawer-item.js +31 -0
- package/scb-header/scb-header-tab.d.ts +13 -0
- package/scb-header/scb-header-tab.js +28 -0
- package/scb-header/scb-header-utility.d.ts +14 -0
- package/scb-header/scb-header-utility.js +31 -0
- package/scb-header/scb-header.d.ts +105 -0
- package/scb-header/scb-header.js +618 -0
- package/scb-icon-button/scb-icon-button.d.ts +31 -0
- package/scb-icon-button/scb-icon-button.js +208 -0
- package/scb-keyfigure-card/scb-keyfigure-card.d.ts +13 -0
- package/scb-keyfigure-card/scb-keyfigure-card.js +119 -0
- package/scb-link/scb-link.d.ts +17 -0
- package/scb-link/scb-link.js +74 -0
- package/scb-list/scb-list-item.d.ts +32 -0
- package/scb-list/scb-list-item.js +144 -0
- package/scb-list/scb-list.d.ts +8 -0
- package/scb-list/scb-list.js +39 -0
- package/scb-logo.svg +21 -0
- package/scb-menu/scb-menu-item.d.ts +22 -0
- package/scb-menu/scb-menu-item.js +107 -0
- package/scb-menu/scb-menu.d.ts +21 -0
- package/scb-menu/scb-menu.js +98 -0
- package/scb-menu/scb-sub-menu.d.ts +12 -0
- package/scb-menu/scb-sub-menu.js +69 -0
- package/scb-notification/scb-notification.d.ts +16 -0
- package/scb-notification/scb-notification.js +187 -0
- package/scb-progress-indicator/scb-progress-indicator.d.ts +11 -0
- package/scb-progress-indicator/scb-progress-indicator.js +122 -0
- package/scb-radio-button/scb-radio-button.d.ts +19 -0
- package/scb-radio-button/scb-radio-button.js +176 -0
- package/scb-radio-button/scb-radio-group.d.ts +20 -0
- package/scb-radio-button/scb-radio-group.js +81 -0
- package/scb-search/scb-search.d.ts +45 -0
- package/scb-search/scb-search.js +410 -0
- package/scb-snackbar/scb-snackbar.d.ts +17 -0
- package/scb-snackbar/scb-snackbar.js +140 -0
- package/scb-status-pill/scb-status-pill.d.ts +9 -0
- package/scb-status-pill/scb-status-pill.js +62 -0
- package/scb-switch/scb-switch.d.ts +21 -0
- package/scb-switch/scb-switch.js +111 -0
- package/scb-tabs/scb-primary-tab.d.ts +17 -0
- package/scb-tabs/scb-primary-tab.js +93 -0
- package/scb-tabs/scb-secondary-tab.d.ts +17 -0
- package/scb-tabs/scb-secondary-tab.js +97 -0
- package/scb-tabs/scb-tabs.d.ts +10 -0
- package/scb-tabs/scb-tabs.js +66 -0
- package/scb-textfield/scb-textfield.d.ts +41 -0
- package/scb-textfield/scb-textfield.js +258 -0
- package/scb-toc/scb-toc-item.d.ts +21 -0
- package/scb-toc/scb-toc-item.js +196 -0
- package/scb-toc/scb-toc.d.ts +6 -0
- package/scb-toc/scb-toc.js +27 -0
- package/scb-tooltip/scb-tooltip.d.ts +32 -0
- package/scb-tooltip/scb-tooltip.js +329 -0
- package/scb-wc-test.bundle.js +5429 -0
- package/scb-wc-test.css +1 -0
- package/scb-wc-test.d.ts +106 -0
- package/scb.svg +14 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import{b as l,n as c,i as p,x as v,t as h}from"../../vendor/vendor.js";var b=Object.defineProperty,m=Object.getOwnPropertyDescriptor,o=(d,i,n,e)=>{for(var t=e>1?void 0:e?m(i,n):i,s=d.length-1,a;s>=0;s--)(a=d[s])&&(t=(e?a(i,n,t):a(t))||t);return e&&t&&b(i,n,t),t};let r=class extends p{constructor(){super(...arguments),this.variant="thin",this.direction="horizontal",this.inset="both"}render(){return v`
|
|
2
|
+
<div class="scb-divider"
|
|
3
|
+
variant=${this.variant}
|
|
4
|
+
direction=${this.direction}
|
|
5
|
+
></div>
|
|
6
|
+
`}};r.styles=[l`
|
|
7
|
+
:host {
|
|
8
|
+
content: '';
|
|
9
|
+
display: block;
|
|
10
|
+
border-top: 1px solid var(--md-sys-color-outline-variant);
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host([variant="bold"]) {
|
|
15
|
+
border-top: 1px solid var(--md-sys-color-outline);
|
|
16
|
+
}
|
|
17
|
+
:host([direction="vertical"]) {
|
|
18
|
+
border-top: none;
|
|
19
|
+
border-left: 1px solid var(--md-sys-color-outline-variant);
|
|
20
|
+
height: calc(100% - 20px);
|
|
21
|
+
margin: 10px;
|
|
22
|
+
width: 2px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host([variant="bold"][direction="vertical"]) {
|
|
26
|
+
border-left: 1px solid var(--md-sys-color-outline);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
// // // :host([inset="both"]:not([direction="vertical"])) {
|
|
31
|
+
// // // margin: 0 32px;
|
|
32
|
+
// // // }
|
|
33
|
+
|
|
34
|
+
// // // :host([inset="start"]:not([direction="vertical"])) {
|
|
35
|
+
// // // margin-left: 32px;
|
|
36
|
+
// // // }
|
|
37
|
+
|
|
38
|
+
// // // :host([inset="end"]:not([direction="vertical"])) {
|
|
39
|
+
// // // margin-right: 32px;
|
|
40
|
+
// // // }
|
|
41
|
+
|
|
42
|
+
// // // :host([inset="both"][direction="vertical"]) {
|
|
43
|
+
// // // margin: 32px 0;
|
|
44
|
+
// // // }
|
|
45
|
+
|
|
46
|
+
// // // :host([inset="start"][direction="vertical"]) {
|
|
47
|
+
// // // margin-top: 32px;
|
|
48
|
+
// // // }
|
|
49
|
+
|
|
50
|
+
// // // :host([inset="end"][direction="vertical"]) {
|
|
51
|
+
// // // margin-bottom: 32px;
|
|
52
|
+
// // // }
|
|
53
|
+
`];o([c({type:String,reflect:!0})],r.prototype,"variant",2);o([c({type:String,reflect:!0})],r.prototype,"direction",2);o([c({type:String,reflect:!0})],r.prototype,"inset",2);r=o([h("scb-divider")],r);
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js","../scb-icon-button/scb-icon-button.js","../../vendor/preload-helper.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as p}from"../../vendor/preload-helper.js";import{b,n as l,r as h,i as u,x as r,t as _}from"../../vendor/vendor.js";var m=Object.defineProperty,f=Object.getOwnPropertyDescriptor,i=(e,t,o,a)=>{for(var n=a>1?void 0:a?f(t,o):t,d=e.length-1,c;d>=0;d--)(c=e[d])&&(n=(a?c(t,o,n):c(n))||n);return a&&n&&m(t,o,n),n};let s=class extends u{constructor(){super(...arguments),this.label="",this.selected=!1,this.leadingIcon="",this.itemHref="",this.hasSlotContent=!1,this.expanded=!1,this.__submenuId=`sub-${Math.random().toString(36).slice(2)}`,this._toggleExpand=e=>{e&&e.stopPropagation(),this.hasSlotContent&&(this.expanded=!this.expanded)},this._onButtonClick=e=>{e.stopPropagation(),this._dispatchSelect(),this._toggleExpand()},this._onLinkClick=()=>{this._dispatchSelect()},this._onKeyDown=e=>{const t=Array.from(this.parentElement?.querySelectorAll("scb-drawer-item")||[]),o=t.indexOf(this);switch(e.key){case"ArrowDown":{e.preventDefault(),(t[o+1]||t[0]).shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}case"ArrowUp":{e.preventDefault(),(t[o-1]||t[t.length-1]).shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}case"Home":{e.preventDefault(),t[0].shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}case"End":{e.preventDefault(),t[t.length-1].shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}}}}async __ensureDepsLoaded(){s.__rippleLoaded||(await p(()=>import("../../vendor/vendor-material.js").then(e=>e.r),__vite__mapDeps([0,1]),import.meta.url),s.__rippleLoaded=!0),this.leadingIcon&&!s.__iconLoaded&&(await p(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),s.__iconLoaded=!0),this.hasSlotContent&&!s.__iconButtonLoaded&&(await p(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([2,3,1]),import.meta.url),s.__iconButtonLoaded=!0)}_onSlotChange(e){const o=e.target.assignedElements({flatten:!0});this.hasSlotContent=o.length>0&&o.every(a=>a.tagName==="SCB-SUB-DRAWER")}_dispatchSelect(){this.dispatchEvent(new CustomEvent("scb-drawer-select",{bubbles:!0,composed:!0,detail:{item:this}}))}async firstUpdated(){const e=this.renderRoot.querySelector("slot");if(e){const t=e.assignedElements({flatten:!0});this.hasSlotContent=t.length>0&&t.every(o=>o.tagName==="SCB-SUB-DRAWER")}await this.__ensureDepsLoaded()}updated(e){e.has("leadingIcon")&&this.leadingIcon&&this.__ensureDepsLoaded(),e.has("hasSlotContent")&&this.hasSlotContent&&this.__ensureDepsLoaded()}render(){const e=!!this.leadingIcon,t=!!this.itemHref,o=this.hasSlotContent;return r`
|
|
3
|
+
<div class="scb-drawer-item">
|
|
4
|
+
<div class="scb-drawer-item-label" ?selected=${this.selected}>
|
|
5
|
+
${t?r`
|
|
6
|
+
<a
|
|
7
|
+
class="scb-drawer-label-text"
|
|
8
|
+
aria-label="${this.label}"
|
|
9
|
+
href="${this.itemHref}"
|
|
10
|
+
aria-current=${this.selected?"page":void 0}
|
|
11
|
+
@click=${this._onLinkClick}
|
|
12
|
+
@keydown=${this._onKeyDown}
|
|
13
|
+
>
|
|
14
|
+
<span class="scb-drawer-click ${e?"has-icon":""}">
|
|
15
|
+
<md-ripple></md-ripple>
|
|
16
|
+
${e?r`<md-icon>${this.leadingIcon}</md-icon>`:""}
|
|
17
|
+
${this.label}
|
|
18
|
+
</span>
|
|
19
|
+
</a>
|
|
20
|
+
`:r`
|
|
21
|
+
<button
|
|
22
|
+
type="button"
|
|
23
|
+
class="scb-drawer-label-text"
|
|
24
|
+
@click=${this._onButtonClick}
|
|
25
|
+
@keydown=${this._onKeyDown}
|
|
26
|
+
${o?"aria-expanded="+String(this.expanded):""}
|
|
27
|
+
${o?"aria-controls="+this.__submenuId:""}
|
|
28
|
+
>
|
|
29
|
+
<span class="scb-drawer-click ${e?"has-icon":""}">
|
|
30
|
+
<md-ripple></md-ripple>
|
|
31
|
+
${e?r`<md-icon>${this.leadingIcon}</md-icon>`:""}
|
|
32
|
+
${this.label}
|
|
33
|
+
</span>
|
|
34
|
+
</button>
|
|
35
|
+
`}
|
|
36
|
+
|
|
37
|
+
${o?r`
|
|
38
|
+
<!-- Separat ikonknapp: presentational + ej tabbbar, ingen ARIA-state -->
|
|
39
|
+
<scb-icon-button
|
|
40
|
+
icon="${this.expanded?"expand_less":"expand_more"}"
|
|
41
|
+
role="presentation"
|
|
42
|
+
tabindex="-1"
|
|
43
|
+
@click=${a=>{a.stopPropagation(),this._toggleExpand(a)}}
|
|
44
|
+
></scb-icon-button>
|
|
45
|
+
`:""}
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div id="${this.__submenuId}" class="submenu ${this.expanded?"expanded":""}">
|
|
49
|
+
<slot @slotchange=${this._onSlotChange}></slot>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
`}};s.__rippleLoaded=!1;s.__iconLoaded=!1;s.__iconButtonLoaded=!1;s.styles=b`
|
|
53
|
+
.scb-drawer-item-label {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
position: relative;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.scb-drawer-label-text {
|
|
60
|
+
width: 100%;
|
|
61
|
+
display: block;
|
|
62
|
+
background: transparent;
|
|
63
|
+
border: 0;
|
|
64
|
+
text-align: left;
|
|
65
|
+
font: inherit;
|
|
66
|
+
color: inherit;
|
|
67
|
+
text-decoration: none;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
padding: 0;
|
|
70
|
+
margin: 0;
|
|
71
|
+
appearance: none;
|
|
72
|
+
-webkit-appearance: none;
|
|
73
|
+
box-sizing: border-box;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.scb-drawer-label-text:focus-visible {
|
|
77
|
+
outline: 2px solid var(--md-focus-ring-color, var(--p-40));
|
|
78
|
+
outline-offset: 2px;
|
|
79
|
+
border-radius: 28px;
|
|
80
|
+
box-shadow: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.scb-drawer-click {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
gap: 12px;
|
|
87
|
+
padding: 14px 20px;
|
|
88
|
+
border-radius: 28px;
|
|
89
|
+
position: relative;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
color: var(--md-sys-color-on-surface);
|
|
92
|
+
}
|
|
93
|
+
.scb-drawer-click.has-icon { padding: 14px 12px; }
|
|
94
|
+
|
|
95
|
+
.scb-drawer-item-label[selected] .scb-drawer-click,
|
|
96
|
+
:host([selected]) .scb-drawer-click {
|
|
97
|
+
color: var(--md-sys-color-on-secondary-container);
|
|
98
|
+
background: var(--md-sys-color-secondary-container);
|
|
99
|
+
font-weight: 600;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
scb-icon-button {
|
|
103
|
+
margin-left: auto;
|
|
104
|
+
flex: 0 0 auto;
|
|
105
|
+
}
|
|
106
|
+
.submenu {
|
|
107
|
+
display: none;
|
|
108
|
+
padding-left: 16px;
|
|
109
|
+
}
|
|
110
|
+
.submenu.expanded {
|
|
111
|
+
display: block;
|
|
112
|
+
padding-left: 16px;
|
|
113
|
+
}
|
|
114
|
+
`;i([l({type:String})],s.prototype,"label",2);i([l({type:Boolean,reflect:!0})],s.prototype,"selected",2);i([l({type:String,attribute:"leading-icon"})],s.prototype,"leadingIcon",2);i([l({type:String,attribute:"item-href"})],s.prototype,"itemHref",2);i([h()],s.prototype,"hasSlotContent",2);i([h()],s.prototype,"expanded",2);s=i([_("scb-drawer-item")],s);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{b,n,i as p,x as o,t as v}from"../../vendor/vendor.js";import"../scb-divider/scb-divider.js";var w=Object.defineProperty,f=Object.getOwnPropertyDescriptor,d=(l,e,t,s)=>{for(var r=s>1?void 0:s?f(e,t):e,c=l.length-1,a;c>=0;c--)(a=l[c])&&(r=(s?a(e,t,r):a(r))||r);return s&&r&&w(e,t,r),r};let i=class extends p{constructor(){super(...arguments),this.label=""}render(){return o`
|
|
2
|
+
|
|
3
|
+
<scb-divider></scb-divider>
|
|
4
|
+
${this.label?o`
|
|
5
|
+
<div class="scb-drawer-section">
|
|
6
|
+
<div class="scb-drawer-label">${this.label}</div>
|
|
7
|
+
</div>`:""}
|
|
8
|
+
`}};i.styles=b`
|
|
9
|
+
.scb-drawer-section {
|
|
10
|
+
display: block;
|
|
11
|
+
width: 100%;
|
|
12
|
+
padding: 14px 12px;
|
|
13
|
+
color: var(--md-sys-color-on-surface);
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
}
|
|
16
|
+
scb-divider {
|
|
17
|
+
margin: 4px 12px;
|
|
18
|
+
}
|
|
19
|
+
`;d([n({type:String})],i.prototype,"label",2);i=d([v("scb-drawer-section")],i);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import{b as u,n as i,i as p,E as d,x as f,t as _}from"../../vendor/vendor.js";import"../scb-divider/scb-divider.js";import"./scb-drawer-item.js";import"./scb-drawer-section.js";import"./scb-sub-drawer.js";import"../../vendor/preload-helper.js";var h=Object.defineProperty,v=Object.getOwnPropertyDescriptor,s=(t,o,r,a)=>{for(var l=a>1?void 0:a?v(o,r):o,n=t.length-1,c;n>=0;n--)(c=t[n])&&(l=(a?c(o,r,l):c(l))||l);return a&&l&&h(o,r,l),l};let e=class extends p{constructor(){super(...arguments),this.label="",this.subLabel="",this.floating=!1,this.left=!0,this.right=!1,this.open=!1,this.overlay=!1,this.lockScroll=!1,this.closeOnOverlay=!0,this.modal=!1,this.__lastTriggerEl=null,this._onGlobalSelect=t=>{const o=t;this.querySelectorAll("scb-drawer-item").forEach(a=>a.selected=!1),this.contains(o.detail.item)&&(o.detail.item.selected=!0)},this.__onDocumentClick=t=>{const o=this.__getActionFromEvent(t);if(o){o==="open"&&this.__setOpen(!0),o==="close"&&this.__setOpen(!1),o==="toggle"&&this.__setOpen(!this.open),t.stopPropagation();return}this.floating&&this.open&&!this.overlay&&(t.composedPath().includes(this)||this.__setOpen(!1))},this.__onDocumentKeydown=t=>{if(this.open){if(t.key==="Escape"){this.__setOpen(!1);return}if(this.overlay&&t.key==="Tab"){const o=this.__getFocusable();if(o.length===0)return;const r=o[0],a=o[o.length-1],l=this.renderRoot,n=l.activeElement||document.activeElement;t.shiftKey?(n===r||!l.contains(n))&&(t.preventDefault(),a.focus()):(n===a||!l.contains(n))&&(t.preventDefault(),r.focus())}}}}static __ensureOverlayStyles(){if(typeof document>"u"||document.getElementById("scb-drawer-overlay-styles"))return;const t=document.createElement("style");t.id="scb-drawer-overlay-styles",t.textContent=`
|
|
2
|
+
.scb-drawer-global-overlay {
|
|
3
|
+
position: fixed;
|
|
4
|
+
inset: 0;
|
|
5
|
+
background: var(--scb-drawer-overlay-color, rgba(0,0,0,0.32));
|
|
6
|
+
opacity: 0;
|
|
7
|
+
pointer-events: none;
|
|
8
|
+
transition: opacity 200ms ease;
|
|
9
|
+
z-index: var(--scb-drawer-overlay-z, 999);
|
|
10
|
+
}
|
|
11
|
+
.scb-drawer-global-overlay.is-visible {
|
|
12
|
+
opacity: 1;
|
|
13
|
+
pointer-events: auto;
|
|
14
|
+
}
|
|
15
|
+
`,document.head.appendChild(t)}static __ensureOverlay(){if(typeof document>"u"||e.__overlayEl)return;e.__ensureOverlayStyles();const t=document.createElement("div");t.className="scb-drawer-global-overlay",t.addEventListener("mousedown",()=>{const o=e.__overlayStack[e.__overlayStack.length-1];o&&o.closeOnOverlay&&o.__setOpen(!1)}),document.body.appendChild(t),e.__overlayEl=t}static __showOverlay(t){e.__ensureOverlay(),e.__overlayEl&&(e.__overlayStack.includes(t)||e.__overlayStack.push(t),e.__overlayEl.classList.add("is-visible"))}static __hideOverlay(t){const o=e.__overlayStack.indexOf(t);o>=0&&e.__overlayStack.splice(o,1),e.__overlayStack.length===0&&e.__overlayEl&&e.__overlayEl.classList.remove("is-visible")}static __lockScrollEnable(){typeof document>"u"||(e.__lockedCount===0&&(e.__prevDocOverflow=document.documentElement.style.overflow||"",e.__prevBodyOverflow=document.body.style.overflow||"",document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden"),e.__lockedCount++)}static __lockScrollDisable(){typeof document>"u"||(e.__lockedCount=Math.max(0,e.__lockedCount-1),e.__lockedCount===0&&(document.documentElement.style.overflow=e.__prevDocOverflow??"",document.body.style.overflow=e.__prevBodyOverflow??""))}render(){const t=this.modal&&this.overlay&&this.floating;return f`
|
|
16
|
+
<nav
|
|
17
|
+
aria-label="${this.label}"
|
|
18
|
+
role=${t?"dialog":d}
|
|
19
|
+
aria-modal=${t?"true":d}
|
|
20
|
+
>
|
|
21
|
+
${this.label?f`
|
|
22
|
+
<div class="scb-drawer-label-wrapper">
|
|
23
|
+
<div class="scb-drawer-label">${this.label}</div>
|
|
24
|
+
<div class="scb-drawer-sublabel">${this.subLabel}</div>
|
|
25
|
+
</div>
|
|
26
|
+
<scb-divider></scb-divider>
|
|
27
|
+
`:d}
|
|
28
|
+
<slot></slot>
|
|
29
|
+
</nav>
|
|
30
|
+
`}connectedCallback(){super.connectedCallback(),window.addEventListener("scb-drawer-select",this._onGlobalSelect),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0)}disconnectedCallback(){window.removeEventListener("scb-drawer-select",this._onGlobalSelect),document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.overlay&&(e.__hideOverlay(this),this.lockScroll&&e.__lockScrollDisable()),super.disconnectedCallback()}__getActionFromEvent(t){if(!this.id)return null;const o=t.composedPath();for(const r of o)if(r instanceof Element){if(r.getAttribute("data-drawer-open")===this.id)return this.__lastTriggerEl=r,"open";if(r.getAttribute("data-drawer-close")===this.id)return this.__lastTriggerEl=r,"close";if(r.getAttribute("data-drawer-toggle")===this.id)return this.__lastTriggerEl=r,"toggle";if(r.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=r,"toggle"}return null}__getFocusable(){const t=this.renderRoot;return Array.from(t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(o=>!o.hasAttribute("disabled")&&o.tabIndex>=0)}__setOpen(t){this.open=t}updated(t){if(t.has("open")){const o=t.get("open");this.__applyOpenSideEffects(o,this.open)}t.has("right")&&this.right&&this.left&&(this.left=!1),t.has("left")&&this.left&&this.right&&(this.right=!1)}__applyOpenSideEffects(t,o){this.floating&&this.overlay&&(o?(e.__showOverlay(this),this.lockScroll&&e.__lockScrollEnable()):(e.__hideOverlay(this),this.lockScroll&&e.__lockScrollDisable())),this.__updateTriggersExpanded(),o&&!t?(this.updateComplete.then(()=>{this.__getFocusable()[0]?.focus?.()}),this.dispatchEvent(new CustomEvent("scb-drawer-opened",{bubbles:!0,composed:!0}))):!o&&t&&(this.__lastTriggerEl?.focus?.(),this.dispatchEvent(new CustomEvent("scb-drawer-closed",{bubbles:!0,composed:!0})))}__updateTriggersExpanded(){if(!this.id)return;document.querySelectorAll(`[aria-controls="${this.id}"], [data-drawer-open="${this.id}"], [data-drawer-close="${this.id}"], [data-drawer-toggle="${this.id}"]`).forEach(o=>{o.hasAttribute("aria-controls")&&o.setAttribute("aria-expanded",String(this.open))})}};e.__overlayEl=null;e.__overlayStack=[];e.__lockedCount=0;e.__prevDocOverflow=null;e.__prevBodyOverflow=null;e.styles=u`
|
|
31
|
+
:host {
|
|
32
|
+
display: block;
|
|
33
|
+
color: var(--md-sys-color-on-surface);
|
|
34
|
+
padding: 12px;
|
|
35
|
+
background: var(--md-sys-color-surface-container-low);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Floating drawer */
|
|
39
|
+
:host([floating]) {
|
|
40
|
+
position: fixed;
|
|
41
|
+
top: 0;
|
|
42
|
+
height: 100vh;
|
|
43
|
+
width: clamp(280px, 70vw, 360px);
|
|
44
|
+
background: var(--md-sys-color-surface-container-low);
|
|
45
|
+
box-shadow: 2px 0 12px rgba(0,0,0,0.15);
|
|
46
|
+
z-index: var(--scb-drawer-z, 1000);
|
|
47
|
+
transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
|
|
48
|
+
opacity: 0;
|
|
49
|
+
visibility: hidden;
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Vänsterläge (default) */
|
|
54
|
+
:host([floating][left]) { left: 0; transform: translateX(-100%); }
|
|
55
|
+
:host([floating][left][open]) {
|
|
56
|
+
transform: translateX(0);
|
|
57
|
+
opacity: 1;
|
|
58
|
+
visibility: visible;
|
|
59
|
+
pointer-events: auto;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Högerläge */
|
|
63
|
+
:host([floating][right]) {
|
|
64
|
+
right: 0;
|
|
65
|
+
transform: translateX(100%);
|
|
66
|
+
box-shadow: -2px 0 12px rgba(0,0,0,0.15);
|
|
67
|
+
}
|
|
68
|
+
:host([floating][right][open]) {
|
|
69
|
+
transform: translateX(0);
|
|
70
|
+
opacity: 1;
|
|
71
|
+
visibility: visible;
|
|
72
|
+
pointer-events: auto;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.scb-drawer-label { font-size: 16px; font-weight: 600; line-height: 24px; }
|
|
76
|
+
.scb-drawer-sublabel { font-size: 14px; line-height: 20px; }
|
|
77
|
+
.scb-drawer-label-wrapper { padding: 12px; color: inherit; }
|
|
78
|
+
scb-divider { margin: 4px 12px; }
|
|
79
|
+
`;s([i({type:String})],e.prototype,"label",2);s([i({type:String,attribute:"sub-label"})],e.prototype,"subLabel",2);s([i({type:Boolean,reflect:!0})],e.prototype,"floating",2);s([i({type:Boolean,reflect:!0})],e.prototype,"left",2);s([i({type:Boolean,reflect:!0})],e.prototype,"right",2);s([i({type:Boolean,reflect:!0})],e.prototype,"open",2);s([i({type:Boolean,reflect:!0})],e.prototype,"overlay",2);s([i({type:Boolean,reflect:!0,attribute:"lock-scroll"})],e.prototype,"lockScroll",2);s([i({type:Boolean,reflect:!0,attribute:"close-on-overlay"})],e.prototype,"closeOnOverlay",2);s([i({type:Boolean,reflect:!0})],e.prototype,"modal",2);e=s([_("scb-drawer")],e);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{b as i,n as b,i as d,x as p,t as u}from"../../vendor/vendor.js";var v=Object.defineProperty,w=Object.getOwnPropertyDescriptor,o=(l,e,r,s)=>{for(var t=s>1?void 0:s?w(e,r):e,c=l.length-1,n;c>=0;c--)(n=l[c])&&(t=(s?n(e,r,t):n(t))||t);return s&&t&&v(e,r,t),t};let a=class extends d{constructor(){super(...arguments),this.label="",this._onGlobalSelect=l=>{const e=l;this.querySelectorAll("scb-drawer-item").forEach(s=>s.selected=!1),this.contains(e.detail.item)&&(e.detail.item.selected=!0)}}connectedCallback(){super.connectedCallback(),window.addEventListener("scb-drawer-select",this._onGlobalSelect)}disconnectedCallback(){window.removeEventListener("scb-drawer-select",this._onGlobalSelect),super.disconnectedCallback()}render(){return p`
|
|
2
|
+
<nav aria-label="${this.label}">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</nav>
|
|
5
|
+
`}};a.styles=i`
|
|
6
|
+
:host {
|
|
7
|
+
display: block;
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
`;o([b({type:String})],a.prototype,"label",2);a=o([u("scb-sub-drawer")],a);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import{b as d,n as c,i as g,x as a,t as h}from"../../vendor/vendor.js";var u=Object.defineProperty,y=Object.getOwnPropertyDescriptor,r=(l,e,s,n)=>{for(var t=n>1?void 0:n?y(e,s):e,o=l.length-1,p;o>=0;o--)(p=l[o])&&(t=(n?p(e,s,t):p(t))||t);return n&&t&&u(e,s,t),t};let i=class extends g{constructor(){super(...arguments),this.label="",this.subLabel="",this.supportingText=""}render(){return a`
|
|
2
|
+
${this.label?a`
|
|
3
|
+
<div class="label">
|
|
4
|
+
${this.label}
|
|
5
|
+
</div>`:""}
|
|
6
|
+
${this.subLabel?a`<div class="sub-label">${this.subLabel}</div>`:""}
|
|
7
|
+
${this.supportingText?a`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
8
|
+
<slot @slotchange=${this.requestUpdate}></slot>
|
|
9
|
+
${this._hasSlotContent()?a`<div class="content links"><slot></slot></div>`:""}
|
|
10
|
+
`}_hasSlotContent(){const l=this.shadowRoot&&this.shadowRoot.querySelector("slot");if(!l)return!1;const e=l.assignedNodes({flatten:!0});return e.length>0&&e.some(s=>s.nodeType===Node.TEXT_NODE?s.textContent?.trim():!0)}};i.styles=d`
|
|
11
|
+
:host {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: var(--spacing-3);
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
.label{
|
|
18
|
+
letter-spacing: var(--md-sys-typescale-headline-small-Tracking);
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
align-items: center;
|
|
22
|
+
font-size: var(--md-sys-typescale-headline-small-size);
|
|
23
|
+
font-weight: var(--weight-bold);
|
|
24
|
+
line-height: var(--md-sys-typescale-headline-small-line-height);
|
|
25
|
+
letter-spacing: var(--md-sys-typescale-headline-small-Tracking);
|
|
26
|
+
}
|
|
27
|
+
.sub-label {
|
|
28
|
+
font-size: var(--md-sys-typescale-title-medium-size);
|
|
29
|
+
font-weight: var(--weight-semibold);
|
|
30
|
+
line-height: var(--md-sys-typescale-title-medium-line-height);
|
|
31
|
+
letter-spacing: var(--md-sys-typescale-title-medium-tracking);
|
|
32
|
+
}
|
|
33
|
+
.supporting-text {
|
|
34
|
+
font-size: var(--md-sys-typescale-body-large-size);
|
|
35
|
+
line-height: var(--md-sys-typescale-body-large-line-height);
|
|
36
|
+
letter-spacing: var(--md-sys-typescale-body-large-tracking);
|
|
37
|
+
}
|
|
38
|
+
.content.links ::slotted(*) {
|
|
39
|
+
margin-top: var(--spacing-3);
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
gap: var(--spacing-3);
|
|
43
|
+
}
|
|
44
|
+
`;r([c({type:String})],i.prototype,"label",2);r([c({type:String,attribute:"sub-label"})],i.prototype,"subLabel",2);r([c({type:String,attribute:"supporting-text"})],i.prototype,"supportingText",2);i=r([h("scb-fact-card-content")],i);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import{b as l,n as s,i as u,x as d,t as b}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-icon-button/scb-icon-button.js";import"./scb-fact-card-content.js";import"../../vendor/preload-helper.js";var h=Object.defineProperty,v=Object.getOwnPropertyDescriptor,r=(i,a,c,e)=>{for(var o=e>1?void 0:e?v(a,c):a,n=i.length-1,p;n>=0;n--)(p=i[n])&&(o=(e?p(a,c,o):p(o))||o);return e&&o&&h(a,c,o),o};let t=class extends u{constructor(){super(...arguments),this.variant="filled",this.label="",this.subLabel="",this.supportingText="",this.icon="",this.showCloseButton=!0}render(){const i=this.variant==="outlined"?"outlined":"filled";return d`
|
|
2
|
+
${this.icon?d`<div class="icon-wrapper ${i}"><md-icon>${this.icon}</md-icon></div>`:""}
|
|
3
|
+
<div class="scb-fact-card ${i} ${this.icon?"no-topleft-radius":""} ${this.showCloseButton?"has-close":""}">
|
|
4
|
+
${this.showCloseButton?d`<scb-icon-button variant="standard" icon="close"></scb-icon-button>`:""}
|
|
5
|
+
<div class="content">
|
|
6
|
+
<slot></slot>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
`}};t.styles=l`
|
|
10
|
+
:host{ --scb-card-min-w: 580px; }
|
|
11
|
+
:host {
|
|
12
|
+
max-width: var(--scb-card-min-w);
|
|
13
|
+
width: 100%;
|
|
14
|
+
display: block;
|
|
15
|
+
position: relative;
|
|
16
|
+
}
|
|
17
|
+
.scb-fact-card {
|
|
18
|
+
color: var(--md-sys-color-on-surface);
|
|
19
|
+
max-width: var(--scb-card-min-w);
|
|
20
|
+
position: relative;
|
|
21
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
22
|
+
background: var(--md-sys-color-surface-dim);
|
|
23
|
+
padding: var(--spacing-7);
|
|
24
|
+
}
|
|
25
|
+
.scb-fact-card.has-close {
|
|
26
|
+
padding-right: 80px;
|
|
27
|
+
}
|
|
28
|
+
.scb-fact-card.no-topleft-radius {
|
|
29
|
+
border-top-left-radius: 0 ;
|
|
30
|
+
margin-top: 40px;
|
|
31
|
+
}
|
|
32
|
+
.scb-fact-card.outlined {
|
|
33
|
+
border: 1px solid var(--md-sys-color-outline);
|
|
34
|
+
background: var(--md-sys-color-surface);
|
|
35
|
+
}
|
|
36
|
+
.icon-wrapper {
|
|
37
|
+
top: -40px;
|
|
38
|
+
position: absolute;
|
|
39
|
+
z-index: 1;
|
|
40
|
+
padding: 16px 24px;
|
|
41
|
+
padding-bottom: 0;
|
|
42
|
+
width: fit-content;
|
|
43
|
+
border-radius: 1000px 1000px 0 0 / 1000px 1000px 0 0; /* halvmåne upptill */
|
|
44
|
+
background: var(--md-sys-color-surface-dim);
|
|
45
|
+
line-height: 0;
|
|
46
|
+
}
|
|
47
|
+
.icon-wrapper.outlined {
|
|
48
|
+
border: 1px solid var(--md-sys-color-outline);
|
|
49
|
+
border-bottom: none;
|
|
50
|
+
background: var(--md-sys-color-surface);
|
|
51
|
+
}
|
|
52
|
+
scb-icon-button {
|
|
53
|
+
position: absolute;
|
|
54
|
+
right: 12px;
|
|
55
|
+
top: 12px;
|
|
56
|
+
}
|
|
57
|
+
.scb-fact-card.clickable {
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
}
|
|
60
|
+
.content {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
gap: var(--spacing-8);
|
|
64
|
+
width: 100%;
|
|
65
|
+
}
|
|
66
|
+
`;r([s({type:String})],t.prototype,"variant",2);r([s({type:String})],t.prototype,"label",2);r([s({type:String,attribute:"sub-label"})],t.prototype,"subLabel",2);r([s({type:String,attribute:"supporting-text"})],t.prototype,"supportingText",2);r([s({type:String})],t.prototype,"icon",2);r([s({type:Boolean,attribute:"show-close-button"})],t.prototype,"showCloseButton",2);t=r([b("scb-fact-card")],t);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{b as c,n as f,i as u,x as a,t as v}from"../../vendor/vendor.js";var _=Object.defineProperty,b=Object.getOwnPropertyDescriptor,p=(i,t,o,r)=>{for(var e=r>1?void 0:r?b(t,o):t,n=i.length-1,l;n>=0;n--)(l=i[n])&&(e=(r?l(t,o,e):l(e))||e);return r&&e&&_(t,o,e),e};let s=class extends u{constructor(){super(...arguments),this.title=""}render(){return a`<slot></slot>`}};s.styles=c`
|
|
2
|
+
:host { display: none; }
|
|
3
|
+
`;p([f({type:String,reflect:!0})],s.prototype,"title",2);s=p([v("scb-footer-section")],s);
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import{b as E,n as y,i as H,x as v,t as L}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";var T=Object.defineProperty,P=Object.getOwnPropertyDescriptor,O=t=>{throw TypeError(t)},x=(t,e,i,a)=>{for(var r=a>1?void 0:a?P(e,i):e,c=t.length-1,m;c>=0;c--)(m=t[c])&&(r=(a?m(e,i,r):m(r))||r);return a&&r&&T(e,i,r),r},w=(t,e,i)=>e.has(t)||O("Cannot "+i),l=(t,e,i)=>(w(t,e,"read from private field"),i?i.call(t):e.get(t)),d=(t,e,i)=>e.has(t)?O("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),o=(t,e,i,a)=>(w(t,e,"write to private field"),e.set(t,i),i),n=(t,e,i)=>(w(t,e,"access private method"),i),p,f,h,u,s,M,C,N,k,_,W,B,S;let g=class extends H{constructor(){super(...arguments),d(this,s),this.maxWidth="1440px",this.sections=[],this.description="Statistikmyndigheten SCB förser samhället med statistik för beslutsfattande, debatt och forskning.",d(this,p,null),d(this,f,""),d(this,h),d(this,u,!1),d(this,_,8)}connectedCallback(){super.connectedCallback(),n(this,s,k).call(this,!0),n(this,s,M).call(this)}disconnectedCallback(){super.disconnectedCallback(),l(this,h)?.disconnect()}render(){const t=l(this,s,N);return v`
|
|
2
|
+
<footer class="outer" role="contentinfo" style=${`--scb-footer-max-width:${this.maxWidth}`}>
|
|
3
|
+
<nav aria-label="Sidfot med länkar">
|
|
4
|
+
<scb-grid
|
|
5
|
+
.colsCompact=${4}
|
|
6
|
+
.colsMedium=${8}
|
|
7
|
+
.colsExpanded=${8}
|
|
8
|
+
padding-block="0"
|
|
9
|
+
.maxWidth=${this.maxWidth}
|
|
10
|
+
>
|
|
11
|
+
${n(this,s,W).call(this,t)}
|
|
12
|
+
</scb-grid>
|
|
13
|
+
</nav>
|
|
14
|
+
|
|
15
|
+
<div class="brand">
|
|
16
|
+
<div class="brand-inner">
|
|
17
|
+
<svg class="logo" viewBox="0 0 48 54" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
|
|
18
|
+
<g clip-path="url(#clip0_4974_83818)">
|
|
19
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M25.6527 6.07812C25.6527 5.15909 24.9076 4.41482 23.9877 4.41482C23.0677 4.41482 22.3226 5.15909 22.3226 6.07812V48.0391C22.3226 48.9601 23.0677 49.7061 23.9877 49.7061C24.9076 49.7061 25.6527 48.9601 25.6527 48.0391V32.9153C25.6527 32.8056 25.744 32.7163 25.8527 32.7163H31.3245C31.4342 32.7163 31.5245 32.8056 31.5245 32.9153V48.1711C31.5245 51.3899 28.1496 54 23.9877 54C19.8241 54 16.4501 51.3899 16.4501 48.1711V5.82708C16.4501 2.6103 19.8241 0 23.9877 0C28.1496 0 31.5245 2.6103 31.5245 5.82708V20.8893C31.5245 21.0009 31.4342 21.0883 31.3245 21.0883H25.8527C25.744 21.0883 25.6527 21.0009 25.6527 20.8893V6.07812Z" fill="white"/>
|
|
20
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.198901 10.8446C-0.152687 13.293 -0.0290117 17.3078 0.49751 19.5627C1.07611 22.0203 4.41288 26.9878 5.91609 29.2948C7.42127 31.5999 9.42869 34.0073 9.39892 37.2185V44.9097C9.39892 45.8287 8.65375 46.5748 7.73382 46.5748C6.81659 46.5748 6.0715 45.8287 6.0715 44.9097V33.1217C6.0715 33.012 5.9803 32.9208 5.86868 32.9208H0.39893C0.287311 32.9208 0.198901 33.012 0.198901 33.1217V45.2613C0.198901 48.4798 3.57282 51.0901 7.73382 51.0901C11.8975 51.0901 15.2714 48.4798 15.2714 45.2613V37.2185C15.2463 31.7023 13.7412 30.8985 11.7877 27.5906C10.3886 25.2148 6.94682 20.3143 6.37003 17.8566C5.8417 15.6018 5.86491 12.9916 6.0715 10.6194C6.0715 9.70039 6.81659 8.95432 7.73382 8.95432C8.65375 8.95432 9.39892 9.70039 9.39892 10.6194V21.1032C9.39892 21.2129 9.48913 21.3022 9.60166 21.3022H15.0706C15.183 21.3022 15.2714 21.2129 15.2714 21.1032V10.8446C15.2714 7.62408 11.8975 5.01575 7.73382 5.01575C3.57282 5.01575 0.198901 7.62408 0.198901 10.8446Z" fill="white"/>
|
|
21
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M32.8911 5.46411H41.2883C44.7561 5.46411 47.5674 8.27534 47.5674 11.7414V20.547C47.5674 23.0158 45.9488 25.0995 43.7161 25.8139V25.933C45.9488 26.6456 47.5674 28.7312 47.5674 31.2018V44.6438C47.5674 47.6988 45.0873 50.1768 42.0344 50.1768L32.8911 50.1823C32.7786 50.1823 32.6892 50.0911 32.6892 49.9832V5.66324C32.6892 5.55539 32.7786 5.46411 32.8911 5.46411ZM38.7636 9.83067C38.6502 9.83067 38.5608 9.92179 38.5608 10.0316V23.9255C38.5608 24.039 38.6502 24.1284 38.7636 24.1284H39.5898C40.6948 24.1284 41.5916 23.2297 41.5916 22.1246V11.8343C41.5916 10.7293 40.6948 9.83067 39.5898 9.83067H38.7636ZM38.7636 28.5432C38.6502 28.5432 38.5608 28.6325 38.5608 28.7423V45.7971C38.5608 45.9088 38.6502 46 38.7636 46H39.7514C40.8584 46 41.7534 45.1014 41.7534 43.9962V30.5469C41.7534 29.4381 40.8584 28.5432 39.7514 28.5432H38.7636Z" fill="white"/>
|
|
22
|
+
</g>
|
|
23
|
+
<defs><clipPath id="clip0_4974_83818"><rect width="48" height="54" fill="white"/></clipPath></defs>
|
|
24
|
+
</svg>
|
|
25
|
+
|
|
26
|
+
<p class="desc">${this.description}</p>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</footer>
|
|
30
|
+
`}};p=new WeakMap;f=new WeakMap;h=new WeakMap;u=new WeakMap;s=new WeakSet;M=function(){l(this,h)?.disconnect(),o(this,h,new MutationObserver(t=>{for(const e of t){if(e.type==="childList"){const i=[...e.addedNodes].some(r=>r.tagName==="SCB-FOOTER-SECTION"||r.tagName==="SCB-LINK"),a=[...e.removedNodes].some(r=>r.tagName==="SCB-FOOTER-SECTION"||r.tagName==="SCB-LINK");if(i||a){n(this,s,C).call(this);return}}if(e.type==="attributes"&&(e.target.tagName==="SCB-FOOTER-SECTION"||e.target.tagName==="SCB-LINK")){n(this,s,C).call(this);return}}})),l(this,h).observe(this,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["title","href","target"]})};C=function(){l(this,u)||(o(this,u,!0),queueMicrotask(()=>{o(this,u,!1),n(this,s,k).call(this,!1)}))};N=function(){return l(this,p)??this.sections??[]};k=function(t=!1){const e=Array.from(this.querySelectorAll("scb-footer-section"));if(!e.length){l(this,p)!==null&&(o(this,p,null),o(this,f,""),t||this.requestUpdate());return}const i=e.map(r=>{const c=(r.getAttribute("title")||"").trim(),m=Array.from(r.querySelectorAll("scb-link")).map(b=>{const A=(b.getAttribute("href")||"").trim(),$=b.getAttribute("target"),V={label:(b.textContent||"").trim(),href:A};return $&&(V.target=$),V});return{title:c,links:m}}),a=JSON.stringify(i);a!==l(this,f)&&(o(this,f,a),o(this,p,i),t||this.requestUpdate())};_=new WeakMap;W=function(t){const e=[],a=t.length;if(a>0&&a<4)return e.push(v`
|
|
31
|
+
<scb-grid-item
|
|
32
|
+
col-span-compact="4"
|
|
33
|
+
col-span-medium="8"
|
|
34
|
+
col-span-expanded="${l(this,_)}"
|
|
35
|
+
>
|
|
36
|
+
<div class="center-row">
|
|
37
|
+
${t.map((r,c)=>n(this,s,S).call(this,r,c,!0))}
|
|
38
|
+
</div>
|
|
39
|
+
</scb-grid-item>
|
|
40
|
+
`),e;for(let r=0;r<a;r++)e.push(n(this,s,B).call(this,t[r],r));return e};B=function(t,e){return v`
|
|
41
|
+
<scb-grid-item
|
|
42
|
+
col-span-compact="4"
|
|
43
|
+
col-span-medium="4"
|
|
44
|
+
col-span-expanded="2"
|
|
45
|
+
>
|
|
46
|
+
${n(this,s,S).call(this,t,e,!1)}
|
|
47
|
+
</scb-grid-item>
|
|
48
|
+
`};S=function(t,e,i){return v`
|
|
49
|
+
<section class="group ${i?"group--centered":""}" aria-labelledby=${`scb-footer-sec-${e}`}>
|
|
50
|
+
<h3 id=${`scb-footer-sec-${e}`} class="title">${t.title}</h3>
|
|
51
|
+
<ul>
|
|
52
|
+
${t.links.map(a=>v`
|
|
53
|
+
<li>
|
|
54
|
+
<scb-link .href=${a.href} .target=${a.target??void 0}>${a.label}</scb-link>
|
|
55
|
+
</li>
|
|
56
|
+
`)}
|
|
57
|
+
</ul>
|
|
58
|
+
</section>
|
|
59
|
+
`};g.styles=E`
|
|
60
|
+
:host {
|
|
61
|
+
display: block;
|
|
62
|
+
color: var(--p-100);
|
|
63
|
+
background: var(--scb-footer-bg, var(--p-20));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Yttre behållare */
|
|
67
|
+
.outer {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
align-items: center;
|
|
71
|
+
padding: var(--spacing-10, 48px) 0 var(--spacing-5, 16px);
|
|
72
|
+
gap: var(--spacing-4, 12px);
|
|
73
|
+
align-self: stretch;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
nav { width: 100%; }
|
|
77
|
+
|
|
78
|
+
/* Grid */
|
|
79
|
+
scb-grid {
|
|
80
|
+
--scb-grid-padding-inline: var(--spacing-8, 32px);
|
|
81
|
+
--scb-grid-row-gap: var(--spacing-9, 40px);
|
|
82
|
+
--scb-grid-column-gap: var(--spacing-9, 40px);
|
|
83
|
+
--scb-grid-gap: var(--spacing-9, 40px) var(--spacing-9, 40px);
|
|
84
|
+
--scb-grid-max-width: var(--scb-footer-max-width, 1440px);
|
|
85
|
+
}
|
|
86
|
+
/* ↑ lite mer luft mellan rader när sektioner staplas */
|
|
87
|
+
@media (max-width: 839.98px) {
|
|
88
|
+
scb-grid { --scb-grid-row-gap: var(--spacing-11, 64px); }
|
|
89
|
+
}
|
|
90
|
+
@media (min-width: 840px) {
|
|
91
|
+
scb-grid { --scb-grid-row-gap: var(--spacing-11, 64px); }
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Kolumn (grupp) */
|
|
95
|
+
.group {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
gap: var(--spacing-7, 24px);
|
|
99
|
+
min-width: 248px;
|
|
100
|
+
flex: 1 0 0;
|
|
101
|
+
align-self: stretch;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* Grupp i centrerad rad: innehållsbredd i desktop för visuell centrering */
|
|
105
|
+
@media (min-width: 840px) {
|
|
106
|
+
.group--centered {
|
|
107
|
+
flex: 0 1 auto;
|
|
108
|
+
min-width: 248px;
|
|
109
|
+
max-width: 420px;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* Radbehållare för centrerat läge (desktop) */
|
|
114
|
+
@media (min-width: 840px) {
|
|
115
|
+
.center-row {
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: start;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
gap: var(--spacing-9, 40px);
|
|
120
|
+
width: 100%;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Extra topmarginal för grupper som hamnar på senare/undre rader i compact/medium */
|
|
125
|
+
@media (max-width: 599px) {
|
|
126
|
+
scb-grid-item:nth-child(n+2) .group { margin-top: var(--spacing-7, 24px); }
|
|
127
|
+
}
|
|
128
|
+
@media (min-width: 600px) and (max-width: 839px) {
|
|
129
|
+
scb-grid-item:nth-child(n+3) .group { margin-top: var(--spacing-7, 24px); }
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Rubrik (Title/Medium) */
|
|
133
|
+
.title {
|
|
134
|
+
margin: 0;
|
|
135
|
+
color: var(--p-100);
|
|
136
|
+
font-family: var(--brand-font);
|
|
137
|
+
font-size: var(--md-sys-typescale-title-medium-size);
|
|
138
|
+
line-height: var(--md-sys-typescale-title-medium-line-height);
|
|
139
|
+
letter-spacing: var(--md-sys-typescale-title-medium-tracking);
|
|
140
|
+
font-weight: var(--weight-semibold);
|
|
141
|
+
align-self: stretch;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Länklista */
|
|
145
|
+
ul {
|
|
146
|
+
list-style: none;
|
|
147
|
+
margin: 0;
|
|
148
|
+
padding: 0;
|
|
149
|
+
display: flex;
|
|
150
|
+
flex-direction: column;
|
|
151
|
+
gap: var(--spacing-5, 16px);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* Länkar i fot */
|
|
155
|
+
scb-link {
|
|
156
|
+
--scb-link-color: var(--p-100);
|
|
157
|
+
--scb-link-visited-color: var(--p-100);
|
|
158
|
+
}
|
|
159
|
+
scb-link::part(anchor) {
|
|
160
|
+
font-family: var(--brand-font);
|
|
161
|
+
font-size: var(--md-sys-typescale-body-medium-size);
|
|
162
|
+
line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
163
|
+
font-weight: var(--weight-regular);
|
|
164
|
+
letter-spacing: var(--md-sys-typescale-body-medium-tracking, -0.15px);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* Brand-block */
|
|
168
|
+
.brand {
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
align-items: center;
|
|
172
|
+
align-self: stretch;
|
|
173
|
+
padding: var(--spacing-9, 40px) var(--spacing-8, 32px);
|
|
174
|
+
gap: var(--spacing-5, 16px);
|
|
175
|
+
}
|
|
176
|
+
.brand-inner {
|
|
177
|
+
width: 100%;
|
|
178
|
+
max-width: var(--scb-footer-max-width, 1440px);
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-direction: column;
|
|
181
|
+
align-items: center;
|
|
182
|
+
gap: var(--spacing-5, 16px);
|
|
183
|
+
margin-inline: auto;
|
|
184
|
+
}
|
|
185
|
+
.logo { width: 48px; height: 54px; display: block; }
|
|
186
|
+
|
|
187
|
+
/* Slogan/beskrivning: max 312 (mobil), 376 (≥600px). Bryter alltid tjusigt. */
|
|
188
|
+
.desc {
|
|
189
|
+
margin: 0;
|
|
190
|
+
text-align: center;
|
|
191
|
+
opacity: .9;
|
|
192
|
+
font-family: var(--brand-font);
|
|
193
|
+
font-size: var(--md-sys-typescale-body-small-size);
|
|
194
|
+
line-height: var(--md-sys-typescale-body-small-line-height);
|
|
195
|
+
font-weight: var(--weight-regular);
|
|
196
|
+
letter-spacing: var(--md-sys-typescale-body-small-tracking, -0.1px);
|
|
197
|
+
color: var(--p-100);
|
|
198
|
+
width: min(100%, 312px);
|
|
199
|
+
overflow-wrap: anywhere;
|
|
200
|
+
}
|
|
201
|
+
@media (min-width: 600px) { .desc { width: min(100%, 376px); } }
|
|
202
|
+
|
|
203
|
+
.spacer { display: none; }
|
|
204
|
+
@media (min-width: 840px) { .spacer { display: block; } }
|
|
205
|
+
`;x([y({type:String,attribute:"max-width",reflect:!0,converter:{fromAttribute:t=>{if(t==null)return"1440px";const e=t.trim();return e===""?"1440px":/^\d+$/.test(e)?`${e}px`:e}}})],g.prototype,"maxWidth",2);x([y({type:Array})],g.prototype,"sections",2);x([y({type:String})],g.prototype,"description",2);g=x([L("scb-footer")],g);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{b as f,n as o,i as m,x as b,t as g}from"../../vendor/vendor.js";var v=Object.defineProperty,S=Object.getOwnPropertyDescriptor,y=e=>{throw TypeError(e)},a=(e,t,i,c)=>{for(var l=c>1?void 0:c?S(t,i):t,h=e.length-1,u;h>=0;h--)(u=e[h])&&(l=(c?u(t,i,l):u(l))||l);return c&&l&&v(t,i,l),l},_=(e,t,i)=>t.has(e)||y("Cannot "+i),x=(e,t,i)=>t.has(e)?y("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),p=(e,t,i)=>(_(e,t,"access private method"),i),r,d,n;let s=class extends m{constructor(){super(...arguments),x(this,r),this.fit=!1}firstUpdated(){p(this,r,d).call(this)}updated(){p(this,r,d).call(this)}render(){return b`<slot></slot>`}};r=new WeakSet;d=function(){p(this,r,n).call(this,"--col-span",this.hasAttribute("col-span")?String(this.colSpan):null),p(this,r,n).call(this,"--col-span-compact",this.hasAttribute("col-span-compact")?String(this.colSpanCompact):null),p(this,r,n).call(this,"--col-span-medium",this.hasAttribute("col-span-medium")?String(this.colSpanMedium):null),p(this,r,n).call(this,"--col-span-expanded",this.hasAttribute("col-span-expanded")?String(this.colSpanExpanded):null),this.align?this.style.setProperty("--scb-grid-item-align",this.align):this.style.removeProperty("--scb-grid-item-align"),this.justify?this.style.setProperty("--scb-grid-item-justify",this.justify):this.style.removeProperty("--scb-grid-item-justify")};n=function(e,t){t===null||t===""?this.style.removeProperty(e):this.style.setProperty(e,t)};s.styles=f`
|
|
2
|
+
:host {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
display: block;
|
|
5
|
+
align-self: var(--scb-grid-item-align, auto);
|
|
6
|
+
justify-self: var(--scb-grid-item-justify, auto);
|
|
7
|
+
}
|
|
8
|
+
:host([fit]) { width: fit-content; max-width: 100%; }
|
|
9
|
+
`;a([o({type:Number,attribute:"col-span",reflect:!0})],s.prototype,"colSpan",2);a([o({type:Number,attribute:"col-span-compact",reflect:!0})],s.prototype,"colSpanCompact",2);a([o({type:Number,attribute:"col-span-medium",reflect:!0})],s.prototype,"colSpanMedium",2);a([o({type:Number,attribute:"col-span-expanded",reflect:!0})],s.prototype,"colSpanExpanded",2);a([o({type:String,reflect:!0})],s.prototype,"align",2);a([o({type:String,reflect:!0})],s.prototype,"justify",2);a([o({type:Boolean,reflect:!0})],s.prototype,"fit",2);s=a([g("scb-grid-item")],s);
|