scb-wc-test 0.1.11 → 0.1.13
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/all.js +2 -0
- package/index.d.ts +1 -0
- package/index.js +34 -32
- package/mvc/components/all.js +1 -0
- package/mvc/components/scb-accordion/scb-accordion-item.js +21 -61
- package/mvc/components/scb-app-bar/scb-app-bar.js +1 -1
- package/mvc/components/scb-avatar/scb-avatar.js +1 -1
- package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +1 -1
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +1 -1
- package/mvc/components/scb-button/scb-button.js +1 -1
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +165 -126
- package/mvc/components/scb-card/scb-card.js +223 -217
- package/mvc/components/scb-checkbox/scb-checkbox-group.js +1 -1
- package/mvc/components/scb-checkbox/scb-checkbox.js +9 -11
- package/mvc/components/scb-chips/scb-chip.js +1 -1
- package/mvc/components/scb-dialog/scb-dialog.js +2 -2
- package/mvc/components/scb-divider/scb-divider.js +43 -53
- package/mvc/components/scb-drawer/scb-drawer-item.js +2 -2
- package/mvc/components/scb-drawer/scb-drawer-section.js +4 -4
- package/mvc/components/scb-drawer/scb-drawer.js +1 -1
- package/mvc/components/scb-drawer/scb-sub-drawer.js +1 -1
- package/mvc/components/scb-fact-card/scb-fact-card-content.js +1 -1
- package/mvc/components/scb-fact-card/scb-fact-card.js +68 -55
- package/mvc/components/scb-footer/scb-footer-section.js +2 -2
- package/mvc/components/scb-footer/scb-footer.js +1 -1
- package/mvc/components/scb-grid/scb-grid-item.js +5 -3
- package/mvc/components/scb-grid/scb-grid.js +27 -10
- package/mvc/components/scb-grid/scb-stack.js +10 -6
- package/mvc/components/scb-header/scb-header-drawer-group.js +1 -1
- package/mvc/components/scb-header/scb-header-drawer-item.js +1 -1
- package/mvc/components/scb-header/scb-header-tab.js +1 -1
- package/mvc/components/scb-header/scb-header-utility.js +1 -1
- package/mvc/components/scb-header/scb-header.js +53 -49
- package/mvc/components/scb-icon-button/scb-icon-button.js +45 -80
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +84 -58
- package/mvc/components/scb-link/scb-link.js +39 -16
- package/mvc/components/scb-list/scb-list-item.js +115 -37
- package/mvc/components/scb-list/scb-list.js +16 -7
- package/mvc/components/scb-menu/scb-menu-item.js +1 -1
- package/mvc/components/scb-menu/scb-menu.js +1 -1
- package/mvc/components/scb-menu/scb-sub-menu.js +1 -1
- package/mvc/components/scb-notification/scb-notification.js +1 -1
- package/mvc/components/scb-notification-card/scb-notification-card.js +187 -0
- package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +1 -1
- package/mvc/components/scb-radio-button/scb-radio-button.js +29 -36
- package/mvc/components/scb-radio-button/scb-radio-group.js +1 -1
- package/mvc/components/scb-search/scb-search.js +48 -37
- package/mvc/components/scb-snackbar/scb-snackbar.js +8 -8
- package/mvc/components/scb-status-pill/scb-status-pill.js +1 -1
- package/mvc/components/scb-switch/scb-switch.js +1 -1
- package/mvc/components/scb-tabs/scb-primary-tab.js +1 -1
- package/mvc/components/scb-tabs/scb-secondary-tab.js +1 -1
- package/mvc/components/scb-tabs/scb-tabs.js +1 -1
- package/mvc/components/scb-textfield/scb-textfield.js +1 -1
- package/mvc/components/scb-toc/scb-toc-item.js +1 -1
- package/mvc/components/scb-toc/scb-toc.js +2 -2
- package/mvc/components/scb-tooltip/scb-tooltip.js +1 -1
- package/mvc/vendor/vendor-material.js +232 -312
- package/mvc/vendor/vendor.js +19 -23
- package/package.json +6 -2
- package/scb-accordion/scb-accordion-item.js +47 -98
- package/scb-calendar-card/scb-calendar-card.d.ts +6 -4
- package/scb-calendar-card/scb-calendar-card.js +207 -154
- package/scb-card/scb-card.d.ts +8 -3
- package/scb-card/scb-card.js +265 -250
- package/scb-checkbox/scb-checkbox.d.ts +1 -0
- package/scb-checkbox/scb-checkbox.js +56 -49
- package/scb-divider/scb-divider.d.ts +16 -4
- package/scb-divider/scb-divider.js +63 -69
- package/scb-fact-card/scb-fact-card.d.ts +8 -7
- package/scb-fact-card/scb-fact-card.js +100 -78
- package/scb-grid/scb-grid-item.d.ts +7 -2
- package/scb-grid/scb-grid-item.js +47 -33
- package/scb-grid/scb-grid.d.ts +7 -3
- package/scb-grid/scb-grid.js +57 -21
- package/scb-grid/scb-stack.d.ts +5 -1
- package/scb-grid/scb-stack.js +57 -31
- package/scb-header/scb-header.d.ts +1 -2
- package/scb-header/scb-header.js +154 -162
- package/scb-icon-button/scb-icon-button.d.ts +15 -11
- package/scb-icon-button/scb-icon-button.js +149 -132
- package/scb-keyfigure-card/scb-keyfigure-card.d.ts +6 -1
- package/scb-keyfigure-card/scb-keyfigure-card.js +139 -93
- package/scb-link/scb-link.d.ts +1 -0
- package/scb-link/scb-link.js +65 -38
- package/scb-list/scb-list-item.d.ts +8 -5
- package/scb-list/scb-list-item.js +183 -73
- package/scb-list/scb-list.d.ts +5 -0
- package/scb-list/scb-list.js +71 -21
- package/scb-notification-card/scb-notification-card.d.ts +18 -0
- package/scb-notification-card/scb-notification-card.js +264 -0
- package/scb-radio-button/scb-radio-button.js +46 -53
- package/scb-search/scb-search.d.ts +8 -0
- package/scb-search/scb-search.js +176 -139
- package/scb-wc-test.bundle.js +1870 -1546
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import{a as d,n as e,i as h,x as a,t as f}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-button/scb-button.js";(function(){try{var o=typeof globalThis<"u"?globalThis:window;if(!o.__scb_ce_guard_installed__){o.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(n,c,s){try{customElements.get(n)||r(n,c,s)}catch(p){var l=String(p||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var y=Object.defineProperty,x=Object.getOwnPropertyDescriptor,i=(o,r,n,c)=>{for(var s=c>1?void 0:c?x(r,n):r,l=o.length-1,p;l>=0;l--)(p=o[l])&&(s=(c?p(r,n,s):p(s))||s);return c&&s&&y(r,n,s),s};let t=class extends h{constructor(){super(...arguments),this.type="success",this.direction="horizontal",this.title="",this.subtitle="",this.supportingText="",this.open=!1,this.linkText="",this.linkhref="#",this.showIcon=!1,this.showCloseButton=!1,this._closeNotification=()=>{this.open=!1;const o=new CustomEvent("close",{detail:{open:this.open}});this.dispatchEvent(o)}}_iconForType(){switch(this.type){case"success":return"check_circle";case"error":return"error";case"warning":return"warning";case"info":return"info";default:return"info"}}render(){const o=this.type?`${this.type.toLowerCase()}`:"",r=this.direction?`${this.direction.toLowerCase()}`:"",n=this.linkhref?"clickable":"";return a`
|
|
2
|
+
<div class="notification ${r} ${n} ${o}" type=${this.type} role="alert" aria-live="assertive" aria-atomic="true" style="display: ${this.open?"flex":"none"};">
|
|
3
|
+
<div class="notification-content">
|
|
4
|
+
${this.showIcon||this.showCloseButton?a`<div class="notification-header">
|
|
5
|
+
${this.showIcon?a`<md-icon>${this._iconForType()}</md-icon>`:""}
|
|
6
|
+
</div>`:""}
|
|
7
|
+
<div class="notification-text-container">
|
|
8
|
+
${this.title?a`<div class="notification-title">${this.title}</div>`:""}
|
|
9
|
+
${this.subtitle?a`<div class="notification-subtitle">${this.subtitle}</div>`:""}
|
|
10
|
+
${this.supportingText?a`<div class="notification-text">${this.supportingText}</div>`:""}
|
|
11
|
+
${this.linkText?a`
|
|
12
|
+
<div class="notification-footer">
|
|
13
|
+
<a class="footer-link" href="${this.linkhref}">${this.linkText}</a>
|
|
14
|
+
</div>
|
|
15
|
+
`:""}
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
${this.showCloseButton?a`<scb-icon-button icon="close" @click=${this._closeNotification}
|
|
19
|
+
style="--_icon-color: ${this.type==="success"?"var(--md-sys-color-on-success-container)":this.type==="error"?"var(--md-sys-color-on-error-container)":this.type==="warning"?"var(--md-sys-color-on-warning-container)":"var(--md-sys-color-on-info-container)"};"></scb-icon-button>`:""}
|
|
20
|
+
</div>
|
|
21
|
+
`}};t.styles=[d`
|
|
22
|
+
:host {
|
|
23
|
+
display: block;
|
|
24
|
+
position: relative;
|
|
25
|
+
container-type: inline-size;
|
|
26
|
+
container-name: notification-container;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.notification {
|
|
30
|
+
border-radius: 12px;
|
|
31
|
+
padding: 16px;
|
|
32
|
+
display: flex;
|
|
33
|
+
gap: 12px;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
|
|
36
|
+
&.horizontal {
|
|
37
|
+
max-width: 600px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&.vertical {
|
|
41
|
+
max-width: 580px;
|
|
42
|
+
|
|
43
|
+
.notification-content{
|
|
44
|
+
flex-direction: row;
|
|
45
|
+
gap: var(--spacing-spacing-4, 12px);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@container notification-container (min-width: 400px) {
|
|
51
|
+
.notification {
|
|
52
|
+
flex-direction: row;
|
|
53
|
+
}
|
|
54
|
+
.notification-label {
|
|
55
|
+
margin-right: 40px;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.notification-text-container {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
gap: var(--Spacing-Spacing-3, 8px);
|
|
63
|
+
|
|
64
|
+
.notification-title {
|
|
65
|
+
display: flex;
|
|
66
|
+
padding: 0 0 var(--spacing-spacing-0, 0) 0;
|
|
67
|
+
align-items: flex-start;
|
|
68
|
+
align-self: stretch;
|
|
69
|
+
font-family: var(--Brand, Inter);
|
|
70
|
+
font-size: var(--md-sys-typescale-headline-small-Size, 24px);
|
|
71
|
+
font-style: normal;
|
|
72
|
+
font-weight: var(--weight-bold, 700);
|
|
73
|
+
line-height: var(--md-sys-typescale-headline-small-line-height2, 30px);
|
|
74
|
+
letter-spacing: var(--md-sys-typescale-headline-small-tracking, -0.6px);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.notification-subtitle {
|
|
78
|
+
display: flex;
|
|
79
|
+
padding: 0 0 var(--spacing-spacing-0, 0) 0;
|
|
80
|
+
align-items: flex-start;
|
|
81
|
+
align-self: stretch;
|
|
82
|
+
font-family: var(--Brand, Inter);
|
|
83
|
+
font-size: var(--md-sys-typescale-title-medium-size, 18px);
|
|
84
|
+
font-style: normal;
|
|
85
|
+
font-weight: var(--weight-semibold, 600);
|
|
86
|
+
line-height: var(--md-sys-typescale-title-medium-line-height, 26px);
|
|
87
|
+
letter-spacing: var(--md-sys-typescale-title-medium-tracking, -0.3px);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.notification-text {
|
|
91
|
+
padding: 0 0 var(--spacing-spacing-0, 0) 0;
|
|
92
|
+
align-items: flex-start;
|
|
93
|
+
align-self: stretch;
|
|
94
|
+
font-family: var(--Brand, Inter);
|
|
95
|
+
font-size: var(--md-sys-typescale-body-large-size, 18px);
|
|
96
|
+
font-style: normal;
|
|
97
|
+
font-weight: var(--eeight-regular, 400);
|
|
98
|
+
line-height: var(--md-sys-typescale-body-large-line-height, 26px);
|
|
99
|
+
letter-spacing: var(--md-sys-typescale-body-large-tracking, -0.3px);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.notification[type="success"] {
|
|
104
|
+
background: var(--md-sys-color-success-container);
|
|
105
|
+
color: var(--md-sys-color-on-success-container);
|
|
106
|
+
|
|
107
|
+
a {
|
|
108
|
+
text-decoration: underline;
|
|
109
|
+
text-decoration-thickness: 1px;
|
|
110
|
+
text-underline-offset: .1578em;
|
|
111
|
+
color: var(--md-sys-color-on-success-container);
|
|
112
|
+
&:hover {text-decoration-thickness: 2px;}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&::part(scb-icon-button){
|
|
116
|
+
--icon-color: var(--md-sys-color-on-success-container);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.notification[type="error"] {
|
|
121
|
+
background: var(--md-sys-color-error-container);
|
|
122
|
+
color: var(--md-sys-color-on-error-container);
|
|
123
|
+
a {
|
|
124
|
+
text-decoration: underline;
|
|
125
|
+
text-decoration-thickness: 1px;
|
|
126
|
+
text-underline-offset: .1578em;
|
|
127
|
+
color: var(--md-sys-color-on-error-container);
|
|
128
|
+
&:hover {text-decoration-thickness: 2px;}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.notification[type="warning"] {
|
|
133
|
+
background: var(--md-sys-color-warning-container);
|
|
134
|
+
color: var(--md-sys-color-on-warning-container);
|
|
135
|
+
a {
|
|
136
|
+
text-decoration: underline;
|
|
137
|
+
text-decoration-thickness: 1px;
|
|
138
|
+
text-underline-offset: .1578em;
|
|
139
|
+
color: var(--md-sys-color-on-warning-container);
|
|
140
|
+
&:hover {text-decoration-thickness: 2px;}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.notification[type="info"] {
|
|
145
|
+
background: var(--md-sys-color-info-container);
|
|
146
|
+
color: var(--md-sys-color-on-info-container);
|
|
147
|
+
a {
|
|
148
|
+
text-decoration: underline;
|
|
149
|
+
text-decoration-thickness: 1px;
|
|
150
|
+
text-underline-offset: .1578em;
|
|
151
|
+
color: var(--md-sys-color-on-info-container);
|
|
152
|
+
&:hover {text-decoration-thickness: 2px;}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.notification-header scb-icon-button {
|
|
157
|
+
position: absolute;
|
|
158
|
+
right: 8px;
|
|
159
|
+
top: 8px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.notification-content {
|
|
163
|
+
display: flex;
|
|
164
|
+
flex-direction: column;
|
|
165
|
+
gap: 4px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
slot {
|
|
169
|
+
font-size: 18px;
|
|
170
|
+
line-height: 26px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.notification-footer {
|
|
174
|
+
font-size: 18px;
|
|
175
|
+
margin-top: 4px;
|
|
176
|
+
line-height: 26px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
:host([open]) .notification {
|
|
180
|
+
opacity: 1;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
:host(:not([open])) .notification {
|
|
184
|
+
opacity: 0;
|
|
185
|
+
pointer-events: none;
|
|
186
|
+
}
|
|
187
|
+
`];i([e({type:String})],t.prototype,"type",2);i([e({type:String,reflect:!0})],t.prototype,"direction",2);i([e({type:String})],t.prototype,"title",2);i([e({type:String})],t.prototype,"subtitle",2);i([e({type:String,attribute:"supporting-text"})],t.prototype,"supportingText",2);i([e({type:Boolean,reflect:!0})],t.prototype,"open",2);i([e({type:String,attribute:"link-text"})],t.prototype,"linkText",2);i([e({type:String,attribute:"link-href"})],t.prototype,"linkhref",2);i([e({type:Boolean,attribute:"show-icon"})],t.prototype,"showIcon",2);i([e({type:Boolean,attribute:"show-close-button"})],t.prototype,"showCloseButton",2);t=i([f("scb-notification-card")],t);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as p,n as d,i as f,x as n,t as h}from"../../vendor/vendor.js";(function(){try{var c=typeof globalThis<"u"?globalThis:window;if(!c.__scb_ce_guard_installed__){c.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,r){try{customElements.get(e)||t(e,s,r)}catch(o){var a=String(o||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var u=Object.defineProperty,g=Object.getOwnPropertyDescriptor,l=(c,t,e,s)=>{for(var r=s>1?void 0:s?g(t,e):t,a=c.length-1,o;a>=0;a--)(o=c[a])&&(r=(s?o(t,e,r):o(r))||r);return s&&r&&u(t,e,r),r};let i=class extends f{constructor(){super(...arguments),this.id="",this.type="circular",this.progress=25,this.isStatic=!0}render(){return n`
|
|
2
2
|
<div class="scb-progress-indicator">
|
|
3
3
|
${this.type==="circular"?n`
|
|
4
4
|
<div class="circular">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as p,x as c,
|
|
1
|
+
import{i as p,x as c,a as h,n as l,t as u}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(r,o,i){try{customElements.get(r)||t(r,o,i)}catch(d){var n=String(d||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var g=Object.defineProperty,b=Object.getOwnPropertyDescriptor,s=(e,t,r,o)=>{for(var i=o>1?void 0:o?b(t,r):t,n=e.length-1,d;n>=0;n--)(d=e[n])&&(i=(o?d(t,r,i):d(i))||i);return o&&i&&g(t,r,i),i};let a=class extends p{constructor(){super(...arguments),this.disabled=!1,this.checked=!1,this.name="",this.value="",this.label="",this.supportingText="",this._radioId="",this._onMdRadioChange=e=>{if(this.disabled)return;const t=e.target;t&&t.checked&&(this.checked=!0,this.dispatchEvent(new CustomEvent("scb-radio-change",{detail:{name:this.name,source:this},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked,value:this.value},bubbles:!0,composed:!0})))},this._onRadioChange=e=>{e.detail.name===this.name&&e.detail.source!==this&&(this.checked=!1)}}connectedCallback(){super.connectedCallback(),this._radioId=this.id||`scb-radio-${Math.random().toString(36).substr(2,9)}`,document.addEventListener("scb-radio-change",this._onRadioChange)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("scb-radio-change",this._onRadioChange)}firstUpdated(){const e=this.shadowRoot?.querySelector("md-radio");e&&e.addEventListener("input",()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))})}updated(e){super.updated(e),e.has("disabled")&&this.toggleAttribute("aria-disabled",this.disabled)}render(){const e=this.supportingText?`${this._radioId}-supporting-text`:void 0;return c`
|
|
2
2
|
<label class="wrap">
|
|
3
3
|
<div class="radio-wrap">
|
|
4
4
|
<md-radio
|
|
@@ -20,33 +20,36 @@ import{i as p,x as c,b as h,n as l,t as u}from"../../vendor/vendor.js";import"..
|
|
|
20
20
|
${this.supportingText}
|
|
21
21
|
</div>`:""}
|
|
22
22
|
<slot></slot>
|
|
23
|
-
`}};
|
|
23
|
+
`}};a.styles=h`
|
|
24
24
|
/* layout med inline-grid */
|
|
25
25
|
:host {
|
|
26
26
|
display: inline-grid;
|
|
27
27
|
grid-template-columns: auto;
|
|
28
28
|
grid-template-rows: auto auto;
|
|
29
|
-
row-gap: 4px;
|
|
29
|
+
row-gap: var(--spacing-2, 4px);
|
|
30
30
|
font-family: var(--brand-font, 'Inter', sans-serif);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/* Styr horisontellt avstånd när den placeras i horisontell layout */
|
|
34
|
+
:host([orientation="horizontal"]) {
|
|
35
|
+
margin-inline-end: var(--scb-radio-gap, var(--spacing-7, 24px));
|
|
36
|
+
}
|
|
37
|
+
|
|
33
38
|
/* Wrapper för md-radio + label */
|
|
34
39
|
.wrap {
|
|
35
40
|
display: inline-flex;
|
|
36
41
|
align-items: center;
|
|
37
|
-
|
|
42
|
+
padding: var(--spacing-2, 4px);
|
|
43
|
+
gap: var(--spacing-2, 4px);
|
|
38
44
|
cursor: pointer;
|
|
39
|
-
/* låt ripple/state-layer synas */
|
|
40
45
|
overflow: visible;
|
|
41
46
|
}
|
|
42
|
-
:host([disabled]) .wrap {
|
|
43
|
-
cursor: default;
|
|
44
|
-
}
|
|
47
|
+
:host([disabled]) .wrap { cursor: default; }
|
|
45
48
|
|
|
46
|
-
/* Hit-yta runt md-radio
|
|
49
|
+
/* Hit-yta runt md-radio */
|
|
47
50
|
.radio-wrap {
|
|
48
|
-
height: var(--scb-radio-target,
|
|
49
|
-
width: var(--scb-radio-target,
|
|
51
|
+
height: var(--scb-radio-target, 40px);
|
|
52
|
+
width: var(--scb-radio-target, 40px);
|
|
50
53
|
align-items: center;
|
|
51
54
|
display: flex;
|
|
52
55
|
justify-content: center;
|
|
@@ -54,42 +57,32 @@ import{i as p,x as c,b as h,n as l,t as u}from"../../vendor/vendor.js";import"..
|
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
/* Nollställ md-radio marginal */
|
|
57
|
-
md-radio {
|
|
58
|
-
margin: 0;
|
|
59
|
-
}
|
|
60
|
+
md-radio { margin: 0; }
|
|
60
61
|
|
|
61
62
|
/* Label-styling */
|
|
62
63
|
.lbl {
|
|
63
64
|
color: var(--md-sys-color-on-surface);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
font-family: var(--brand-font);
|
|
66
|
+
font-size: var(--md-sys-typescale-body-medium-size);
|
|
67
|
+
line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
68
|
+
font-weight: var(--weight-regular, 400);
|
|
69
|
+
letter-spacing: var(--md-sys-typescale-body-medium-tracking);
|
|
70
|
+
margin-top: var(--spacing-1, 2px);
|
|
69
71
|
}
|
|
72
|
+
:host([disabled]) .lbl { color: var(--n-60); }
|
|
70
73
|
|
|
71
74
|
/* Supporting text styling */
|
|
72
75
|
.supporting-text {
|
|
73
76
|
color: var(--md-sys-color-on-surface-variant);
|
|
74
|
-
line-height:
|
|
75
|
-
/*
|
|
76
|
-
margin-left: calc(
|
|
77
|
-
}
|
|
78
|
-
:host([disabled]) .supporting-text {
|
|
79
|
-
color: var(--n-60);
|
|
77
|
+
line-height: var(--md-sys-typescale-body-medium-line-height, 20px);
|
|
78
|
+
/* gap + wrapperbredd så texten linjerar med labeln */
|
|
79
|
+
margin-left: calc(var(--spacing-2, 4px) + var(--scb-radio-target, 40px));
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
:host([orientation="horizontal"]) {
|
|
83
|
-
margin-inline-end: var(--scb-radio-gap, 24px); /* tweakable */
|
|
84
|
-
}
|
|
81
|
+
:host([disabled]) .supporting-text { color: var(--n-60); }
|
|
85
82
|
|
|
86
83
|
/* Anpassning för mörkt läge */
|
|
87
84
|
@media (prefers-color-scheme: dark) {
|
|
88
|
-
.lbl {
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
.supporting-text {
|
|
92
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
93
|
-
}
|
|
85
|
+
.lbl { color: var(--md-sys-color-on-surface); }
|
|
86
|
+
.supporting-text { color: var(--md-sys-color-on-surface-variant); }
|
|
94
87
|
}
|
|
95
|
-
`;s([l({type:Boolean,reflect:!0})],
|
|
88
|
+
`;s([l({type:Boolean,reflect:!0})],a.prototype,"disabled",2);s([l({type:Boolean,reflect:!0})],a.prototype,"checked",2);s([l({type:String,reflect:!0})],a.prototype,"name",2);s([l({type:String,reflect:!0})],a.prototype,"value",2);s([l({type:String})],a.prototype,"label",2);s([l({type:String,attribute:"supporting-text"})],a.prototype,"supportingText",2);a=s([u("scb-radio-button")],a);export{a as ScbRadioButton};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as h,n as p,i as f,x as g,t as b}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 a=customElements.define.bind(customElements);customElements.define=function(e,s,r){try{customElements.get(e)||a(e,s,r)}catch(n){var o=String(n||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var _=Object.defineProperty,v=Object.getOwnPropertyDescriptor,u=t=>{throw TypeError(t)},l=(t,a,e,s)=>{for(var r=s>1?void 0:s?v(a,e):a,o=t.length-1,n;o>=0;o--)(n=t[o])&&(r=(s?n(a,e,r):n(r))||r);return s&&r&&_(a,e,r),r},y=(t,a,e)=>a.has(t)||u("Cannot "+e),c=(t,a,e)=>(y(t,a,"read from private field"),e?e.call(t):a.get(t)),m=(t,a,e)=>a.has(t)?u("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),d;let i=class extends f{constructor(){super(...arguments),this.name="",this.orientation="vertical",this.disabled=!1,this.ariaLabel=null,this.spacing="item",m(this,d,()=>{const t=this.shadowRoot?.querySelector("slot");if(!t)return;const a=t.assignedElements({flatten:!0}).filter(e=>e.tagName.toLowerCase()==="scb-radio-button");for(const e of a)this.name&&e.setAttribute("name",this.name),this.disabled?e.setAttribute("disabled",""):e.removeAttribute("disabled"),this.orientation==="horizontal"?e.setAttribute("orientation","horizontal"):e.removeAttribute("orientation"),this.spacing==="group"?e.style.setProperty("--scb-radio-gap","0"):e.style.removeProperty("--scb-radio-gap")})}render(){const t=this.orientation==="horizontal"?"row":"column";return g`
|
|
2
2
|
<div
|
|
3
3
|
class="g"
|
|
4
4
|
role="radiogroup"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as y,n as h,i as x,E as b,x as u,t as w}from"../../vendor/vendor.js";import"../scb-list/scb-list.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";import"../scb-list/scb-list-item.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,n,i){try{customElements.get(s)||e(s,n,i)}catch(o){var r=String(o||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var A=Object.defineProperty,I=Object.getOwnPropertyDescriptor,c=(t,e,s,n)=>{for(var i=n>1?void 0:n?I(e,s):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(i=(n?o(e,s,i):o(i))||i);return n&&i&&A(e,s,i),i};let S=0,a=class extends x{constructor(){super(...arguments),this.supportingText="Hinted search text",this.value="",this.size="default",this.fullScreen=!1,this._inputFocused=!1,this._visibleSuggestions=0,this._activeIndex=-1,this._listboxId=`scb-search-listbox-${++S}`,this._kbMode=!1,this._listScrollHandler=()=>{const t=this._getActiveItem();this._kbMode&&t&&this._positionOptionRing(t)}}connectedCallback(){super.connectedCallback(),this._onWindowResize=this._onWindowResize.bind(this),window.addEventListener("resize",this._onWindowResize,{passive:!0})}disconnectedCallback(){const t=this._inputEl();t&&this._boundNativeKeydown&&t.removeEventListener("keydown",this._boundNativeKeydown,!0),this._detachListScrollListener(),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}firstUpdated(){this._ensureListboxA11y(),this._updateComboboxA11y();const t=this._inputEl();t&&(this._boundNativeKeydown=e=>this._handleKey(e),t.addEventListener("keydown",this._boundNativeKeydown,!0))}updated(){this._ensureListboxA11y(),this._updateComboboxA11y(),this._attachListScrollListener()}render(){const t=(this.value??"").trim().length>0,e=this._inputFocused&&t&&this._hasSuggestions;return u`
|
|
2
2
|
<div class="ripple-wrapper">
|
|
3
|
-
<md-icon class="leading">${
|
|
3
|
+
<md-icon class="leading">${t?"arrow_back":"search"}</md-icon>
|
|
4
4
|
|
|
5
5
|
<input
|
|
6
6
|
id="searchInput"
|
|
7
7
|
type="search"
|
|
8
8
|
name="textfield"
|
|
9
|
-
class=${
|
|
9
|
+
class=${e?"with-list":""}
|
|
10
10
|
.value=${this.value}
|
|
11
11
|
placeholder=${this.supportingText}
|
|
12
12
|
autocomplete="off"
|
|
@@ -16,19 +16,23 @@ import{b as y,n as d,i as x,E as b,x as h,t as A}from"../../vendor/vendor.js";im
|
|
|
16
16
|
aria-label=${this.supportingText||"Sök"}
|
|
17
17
|
/>
|
|
18
18
|
|
|
19
|
-
${
|
|
19
|
+
${t?u`<button class="clear-btn" @click=${this._clearInput} tabindex="-1" aria-label="Rensa sökfält">
|
|
20
20
|
<md-icon>close</md-icon>
|
|
21
|
-
</button>`:this.trailingIcon?
|
|
21
|
+
</button>`:this.trailingIcon?u`<span class="trailing"><md-icon>${this.trailingIcon}</md-icon></span>`:b}
|
|
22
22
|
|
|
23
23
|
<md-ripple></md-ripple>
|
|
24
|
+
<md-focus-ring class="input-ring"></md-focus-ring>
|
|
24
25
|
</div>
|
|
25
26
|
|
|
26
|
-
<div class="list-divider" aria-hidden=${String(!(this.fullScreen&&
|
|
27
|
+
<div class="list-divider" aria-hidden=${String(!(this.fullScreen&&e))}></div>
|
|
27
28
|
|
|
28
|
-
${
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
${e?u`
|
|
30
|
+
<scb-list class="suggestion-list" id=${this._listboxId}>
|
|
31
|
+
<slot @slotchange=${this._onSlotChange}></slot>
|
|
32
|
+
</scb-list>
|
|
33
|
+
<md-focus-ring id="optionRing" class="option-ring"></md-focus-ring>
|
|
34
|
+
`:b}
|
|
35
|
+
`}submit(){const t=this._getActiveItem(),e={value:this.value};t&&(e.active=this._itemPayload(t)),this.dispatchEvent(new CustomEvent("scb-search-submit",{detail:e,bubbles:!0,composed:!0}))}get _hasSuggestions(){return this._visibleSuggestions>=0?this._visibleSuggestions>0:Array.from(this.getElementsByTagName("scb-list-item")).some(e=>!e.hasAttribute("hidden")&&e.style.display!=="none")}_onSlotChange(){this._filterSuggestions(this.value)}_onInput(t){const e=t.target;this.value=e.value,this._filterSuggestions(this.value),this._activeIndex=-1,this._kbMode=!1,this._updateComboboxA11y(),this.dispatchEvent(new CustomEvent("scb-search-input",{detail:{value:this.value},bubbles:!0,composed:!0}))}_onFocus(){this._inputFocused=!0,this._filterSuggestions(this.value),this._updateComboboxA11y(),this.requestUpdate()}_onBlur(){setTimeout(()=>{this._inputFocused=!1,this._activeIndex=-1,this._kbMode=!1,this._updateComboboxA11y(),this._hideOptionRing(),this.requestUpdate()},100)}_handleKey(t){if(!this._inputEl())return;const s=this._getVisibleItems(),n=(this.value??"").trim().length>0,i=this._inputFocused&&n&&s.length>0,r=t.key,o=t.keyCode,l=r==="ArrowDown"||r==="Down"||o===40,d=r==="ArrowUp"||r==="Up"||o===38,g=r==="Home"||o===36,v=r==="End"||o===35,_=r==="Enter"||o===13,f=r==="Escape"||r==="Esc"||o===27;if(l){if(!i)return;t.preventDefault(),this._kbMode=!0,this._moveActive(s,1);return}if(d){if(!i)return;t.preventDefault(),this._kbMode=!0,this._moveActive(s,-1);return}if(g){if(!i)return;t.preventDefault(),this._kbMode=!0,this._activeIndex=s.length?0:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(v){if(!i)return;t.preventDefault(),this._kbMode=!0,this._activeIndex=s.length?s.length-1:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(_){if(!i){this.submit();return}t.preventDefault();const p=this._getActiveItem();if(p){const m=p.getAttribute("label")||"";this.value=m,this.dispatchEvent(new CustomEvent("scb-search-submit",{detail:{value:this.value,active:this._itemPayload(p)},bubbles:!0,composed:!0})),this._visibleSuggestions=0,this._activeIndex=-1,this._kbMode=!1,this._hideOptionRing(),this.requestUpdate()}else this.submit();return}if(f){t.preventDefault(),this._clearInput();return}}_clearInput(){this.value="",this._activeIndex=-1,this._kbMode=!1;const t=this._inputEl();t?.focus(),t&&(t.value=""),this._filterSuggestions(""),this._updateComboboxA11y(),this._hideOptionRing(),this.dispatchEvent(new CustomEvent("scb-search-clear",{bubbles:!0,composed:!0}))}_filterSuggestions(t){const e=(t??"").trim().toLowerCase(),s=Array.from(this.querySelectorAll("scb-list-item"));let n=0;for(const i of s){const r=(i.getAttribute("label")||"").toLowerCase(),o=(i.getAttribute("supporting-text")||"").toLowerCase(),l=`${r} ${o}`.trim();e!==""&&l.includes(e)?(i.removeAttribute("hidden"),n++):i.setAttribute("hidden",""),this._ensureOptionA11y(i)}this._visibleSuggestions=n,this._activeIndex>=n&&(this._activeIndex=-1),this._updateComboboxA11y(),this.requestUpdate()}_inputEl(){return this.renderRoot?.querySelector("#searchInput")??null}_listEl(){return this.renderRoot?.querySelector("scb-list.suggestion-list")??null}_ringEl(){return this.renderRoot?.querySelector("#optionRing")??null}_getVisibleItems(){return Array.from(this.querySelectorAll("scb-list-item")).filter(e=>!e.hasAttribute("hidden")&&e.style.display!=="none")}_getActiveItem(){const t=this._getVisibleItems();return this._activeIndex<0||this._activeIndex>=t.length?null:t[this._activeIndex]??null}_moveActive(t,e){if(!t.length){this._activeIndex=-1,this._updateComboboxA11y(),this._hideOptionRing();return}let s=this._activeIndex+e;this._activeIndex===-1?s=e>0?0:t.length-1:(s<0&&(s=0),s>=t.length&&(s=t.length-1)),this._activeIndex=s,this._updateComboboxA11y(),this._scrollActiveIntoView()}_scrollActiveIntoView(){const t=this._getActiveItem();t&&t.scrollIntoView({block:"nearest"})}_itemPayload(t){return{label:t.getAttribute("label")||"",supportingText:t.getAttribute("supporting-text")||"",href:t.getAttribute("href")||"",type:t.getAttribute("type")||"",id:t.id||""}}_ensureListboxA11y(){const t=this._listEl();t&&(t.id||(t.id=this._listboxId),t.setAttribute("role","listbox"),t.setAttribute("aria-label","Sökförslag")),Array.from(this.querySelectorAll("scb-list-item")).forEach(s=>this._ensureOptionA11y(s))}_ensureOptionA11y(t){t.id||(t.id=`${this._listboxId}-opt-${Math.random().toString(36).slice(2,8)}`),t.setAttribute("role","option"),t.setAttribute("tabindex","-1")}_updateComboboxA11y(){const t=this._inputEl();if(!t)return;const e=this._getVisibleItems(),s=(this.value??"").trim().length>0,n=this._inputFocused&&s&&e.length>0;t.setAttribute("role","combobox"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-controls",this._listboxId),t.setAttribute("aria-expanded",String(n));const i=n?this._getActiveItem():null;i?.id?t.setAttribute("aria-activedescendant",i.id):t.removeAttribute("aria-activedescendant"),this._kbMode&&i&&n?this._positionOptionRing(i):this._hideOptionRing()}_positionOptionRing(t){const e=this._ringEl(),s=this._listEl();if(!e||!s)return;const n=this.getBoundingClientRect(),i=t.getBoundingClientRect(),r=i.top-n.top,o=i.left-n.left,l=i.width,d=i.height;e.style.top=`${r}px`,e.style.left=`${o}px`,e.style.width=`${l}px`,e.style.height=`${d}px`,e.setAttribute("data-show","true")}_hideOptionRing(){const t=this._ringEl();t&&t.removeAttribute("data-show")}_onWindowResize(){const t=this._getActiveItem();this._kbMode&&t&&this._positionOptionRing(t)}_attachListScrollListener(){const t=this._listEl();!t||this._listWithHandler===t||(this._detachListScrollListener(),t.addEventListener("scroll",this._listScrollHandler,{passive:!0}),this._listWithHandler=t)}_detachListScrollListener(){this._listWithHandler&&(this._listWithHandler.removeEventListener("scroll",this._listScrollHandler),this._listWithHandler=void 0)}};a.styles=y`
|
|
32
36
|
:host {
|
|
33
37
|
display: flex;
|
|
34
38
|
flex-direction: column;
|
|
@@ -77,6 +81,31 @@ import{b as y,n as d,i as x,E as b,x as h,t as A}from"../../vendor/vendor.js";im
|
|
|
77
81
|
width: 100%;
|
|
78
82
|
}
|
|
79
83
|
|
|
84
|
+
md-focus-ring.input-ring {
|
|
85
|
+
position: absolute;
|
|
86
|
+
inset: 0;
|
|
87
|
+
pointer-events: none;
|
|
88
|
+
display: none;
|
|
89
|
+
border-radius: var(--scb-search-radius);
|
|
90
|
+
z-index: 4;
|
|
91
|
+
}
|
|
92
|
+
.ripple-wrapper:focus-within md-focus-ring.input-ring { display: block; }
|
|
93
|
+
input.with-list ~ md-focus-ring.input-ring {
|
|
94
|
+
border-radius: var(--scb-search-open-radius) var(--scb-search-open-radius) 0 0;
|
|
95
|
+
}
|
|
96
|
+
:host([full-screen]) md-focus-ring.input-ring {
|
|
97
|
+
border-radius: var(--radius-none, 0px) !important;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
md-focus-ring.option-ring {
|
|
101
|
+
position: absolute;
|
|
102
|
+
display: none;
|
|
103
|
+
pointer-events: none;
|
|
104
|
+
z-index: 11;
|
|
105
|
+
border-radius: var(--md-sys-shape-corner-small, 8px);
|
|
106
|
+
}
|
|
107
|
+
md-focus-ring.option-ring[data-show="true"] { display: block; }
|
|
108
|
+
|
|
80
109
|
.leading {
|
|
81
110
|
position: absolute;
|
|
82
111
|
left: var(--scb-search-padding-x);
|
|
@@ -91,13 +120,9 @@ import{b as y,n as d,i as x,E as b,x as h,t as A}from"../../vendor/vendor.js";im
|
|
|
91
120
|
color: var(--md-sys-color-on-surface-variant);
|
|
92
121
|
z-index: 2;
|
|
93
122
|
}
|
|
94
|
-
.leading md-icon {
|
|
95
|
-
font-size: var(--scb-search-icon-size);
|
|
96
|
-
line-height: 1;
|
|
97
|
-
}
|
|
123
|
+
.leading md-icon { font-size: var(--scb-search-icon-size); line-height: 1; }
|
|
98
124
|
|
|
99
|
-
.trailing,
|
|
100
|
-
.clear-btn {
|
|
125
|
+
.trailing, .clear-btn {
|
|
101
126
|
position: absolute;
|
|
102
127
|
right: var(--scb-search-padding-x);
|
|
103
128
|
top: 50%;
|
|
@@ -112,12 +137,7 @@ import{b as y,n as d,i as x,E as b,x as h,t as A}from"../../vendor/vendor.js";im
|
|
|
112
137
|
}
|
|
113
138
|
.trailing md-icon { pointer-events: none; font-size: var(--scb-search-icon-size); }
|
|
114
139
|
|
|
115
|
-
.clear-btn {
|
|
116
|
-
background: none;
|
|
117
|
-
border: 0;
|
|
118
|
-
padding: 0;
|
|
119
|
-
cursor: pointer;
|
|
120
|
-
}
|
|
140
|
+
.clear-btn { background: none; border: 0; padding: 0; cursor: pointer; }
|
|
121
141
|
.clear-btn[hidden] { display: none; }
|
|
122
142
|
|
|
123
143
|
input[type="search"] {
|
|
@@ -161,11 +181,7 @@ import{b as y,n as d,i as x,E as b,x as h,t as A}from"../../vendor/vendor.js";im
|
|
|
161
181
|
--md-ripple-hover-opacity: 0;
|
|
162
182
|
}
|
|
163
183
|
|
|
164
|
-
input[type="search"]::-webkit-search-cancel-button {
|
|
165
|
-
-webkit-appearance: none;
|
|
166
|
-
appearance: none;
|
|
167
|
-
display: none;
|
|
168
|
-
}
|
|
184
|
+
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
|
|
169
185
|
|
|
170
186
|
input.with-list { border-radius: var(--scb-search-open-radius) var(--scb-search-open-radius) 0 0; }
|
|
171
187
|
input.with-list ~ md-ripple { border-radius: var(--scb-search-open-radius) var(--scb-search-open-radius) 0 0; }
|
|
@@ -180,21 +196,16 @@ import{b as y,n as d,i as x,E as b,x as h,t as A}from"../../vendor/vendor.js";im
|
|
|
180
196
|
border: var(--stroke-border, 1px) solid var(--md-sys-color-outline);
|
|
181
197
|
border-top: 0;
|
|
182
198
|
border-radius: 0 0 var(--scb-search-open-radius) var(--scb-search-open-radius);
|
|
183
|
-
overflow:
|
|
199
|
+
overflow: auto;
|
|
184
200
|
box-sizing: border-box;
|
|
201
|
+
max-height: var(--scb-search-suggestions-max-h, 60vh);
|
|
185
202
|
}
|
|
186
203
|
|
|
187
204
|
:host([full-screen]) input[type="search"],
|
|
188
205
|
:host([full-screen]) input.with-list,
|
|
189
|
-
:host([full-screen]) input.with-list ~ md-ripple,
|
|
190
|
-
:host([full-screen]) md-ripple {
|
|
191
|
-
border-radius: var(--radius-none, 0px) !important;
|
|
192
|
-
}
|
|
206
|
+
:host([full-screen]) input.with-list ~ md-ripple { border-radius: var(--radius-none, 0px) !important; }
|
|
193
207
|
:host([full-screen]) scb-list.suggestion-list {
|
|
194
|
-
position: static;
|
|
195
|
-
border: 0;
|
|
196
|
-
border-radius: 0;
|
|
197
|
-
background: transparent;
|
|
208
|
+
position: static; border: 0; border-radius: 0; background: transparent;
|
|
198
209
|
}
|
|
199
210
|
|
|
200
211
|
.list-divider {
|
|
@@ -208,4 +219,4 @@ import{b as y,n as d,i as x,E as b,x as h,t as A}from"../../vendor/vendor.js";im
|
|
|
208
219
|
@media (prefers-color-scheme: dark) {
|
|
209
220
|
:host { color: var(--md-sys-color-on-surface); }
|
|
210
221
|
}
|
|
211
|
-
`;
|
|
222
|
+
`;c([h({type:String,attribute:"trailing-icon"})],a.prototype,"trailingIcon",2);c([h({type:String,attribute:"supporting-text"})],a.prototype,"supportingText",2);c([h({type:String})],a.prototype,"value",2);c([h({type:String,reflect:!0})],a.prototype,"size",2);c([h({type:Boolean,attribute:"full-screen",reflect:!0})],a.prototype,"fullScreen",2);a=c([w("scb-search")],a);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as p,n as a,i as u,x as r,t as b}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";import"../../vendor/preload-helper.js";import"../../vendor/vendor-material.js";import"../scb-tooltip/scb-tooltip.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var o=customElements.define.bind(customElements);customElements.define=function(e,c,i){try{customElements.get(e)||o(e,c,i)}catch(d){var l=String(d||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var m=Object.defineProperty,h=Object.getOwnPropertyDescriptor,n=(t,o,e,c)=>{for(var i=c>1?void 0:c?h(o,e):o,l=t.length-1,d;l>=0;l--)(d=t[l])&&(i=(c?d(o,e,i):d(i))||i);return c&&i&&m(o,e,i),i};let s=class extends u{constructor(){super(...arguments),this.message="",this.open=!1,this.actionText="",this.showClose=!1,this.fixed=!1,this.fadeout=!1,this.withLongerAction=!1}handleAction(){this.dispatchEvent(new CustomEvent("snackbar-action")),this.open=!1}handleClose(){this.dispatchEvent(new CustomEvent("snackbar-close")),this.open=!1}updated(t){super.updated(t),(t.has("open")||t.has("fadeout"))&&(this.open&&this.fadeout?(window.clearTimeout(this._fadeoutTimer),this._fadeoutTimer=window.setTimeout(()=>{this.open=!1},5e3)):window.clearTimeout(this._fadeoutTimer))}render(){const t=!!this.actionText,o=!!this.showClose;let e="snackbar";return!t&&!o&&(e+=" no-actions"),this.withLongerAction&&(e+=" longer-action"),r`
|
|
2
2
|
<div class="${e}" ?hidden=${!this.open}>
|
|
3
|
-
${this.withLongerAction?
|
|
3
|
+
${this.withLongerAction?r`
|
|
4
4
|
<div class="message">${this.message}</div>
|
|
5
5
|
<div class="actions">
|
|
6
|
-
${t?
|
|
7
|
-
${o?
|
|
6
|
+
${t?r`<scb-button variant="text" label=${this.actionText} @click=${this.handleAction}></scb-button>`:""}
|
|
7
|
+
${o?r`<scb-icon-button icon="close" @click=${this.handleClose} aria-label="Stäng"></scb-icon-button>`:""}
|
|
8
8
|
</div>
|
|
9
|
-
`:
|
|
9
|
+
`:r`
|
|
10
10
|
<span class="message">${this.message}</span>
|
|
11
|
-
${t?
|
|
12
|
-
${o?
|
|
11
|
+
${t?r`<scb-button variant="text" label=${this.actionText} @click=${this.handleAction}></scb-button>`:""}
|
|
12
|
+
${o?r`<scb-icon-button icon="close" @click=${this.handleClose} aria-label="Stäng"></scb-icon-button>`:""}
|
|
13
13
|
`}
|
|
14
14
|
|
|
15
15
|
</div>
|
|
@@ -80,4 +80,4 @@ import{b as p,n as r,i as u,x as a,t as b}from"../../vendor/vendor.js";import"..
|
|
|
80
80
|
--md-focus-ring-color: var(--md-sys-color-inverse-on-surface);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
`;
|
|
83
|
+
`;n([a({type:String})],s.prototype,"message",2);n([a({type:Boolean,reflect:!0})],s.prototype,"open",2);n([a({type:String,attribute:"action-text"})],s.prototype,"actionText",2);n([a({type:Boolean,attribute:"show-close"})],s.prototype,"showClose",2);n([a({type:Boolean,reflect:!0})],s.prototype,"fixed",2);n([a({type:Boolean})],s.prototype,"fadeout",2);n([a({type:Boolean,attribute:"with-longer-action"})],s.prototype,"withLongerAction",2);s=n([b("scb-snackbar")],s);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as u,n as d,i as p,x as a,t as h}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";(function(){try{var c=typeof globalThis<"u"?globalThis:window;if(!c.__scb_ce_guard_installed__){c.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(t,o,s){try{customElements.get(t)||r(t,o,s)}catch(n){var e=String(n||"");if(e.indexOf("already been used")===-1&&e.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var b=Object.defineProperty,m=Object.getOwnPropertyDescriptor,l=(c,r,t,o)=>{for(var s=o>1?void 0:o?m(r,t):r,e=c.length-1,n;e>=0;e--)(n=c[e])&&(s=(o?n(r,t,s):n(s))||s);return o&&s&&b(r,t,s),s};let i=class extends p{constructor(){super(...arguments),this.status="",this.label="",this.showIcon=!1}render(){return a`
|
|
2
2
|
${this.showIcon?this.status==="success"?a`<md-icon>check_circle</md-icon>`:this.status==="warning"?a`<md-icon>warning</md-icon>`:this.status==="error"?a`<md-icon>error</md-icon>`:"":""}
|
|
3
3
|
<span>${this.label}</span>
|
|
4
4
|
`}};i.styles=u`
|
|
@@ -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 b}from"../../vendor/preload-helper.js";import{i as _,E as h,x as p,
|
|
2
|
+
import{_ as b}from"../../vendor/preload-helper.js";import{i as _,E as h,x as p,a as v,n as c,t as y}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,r,a){try{customElements.get(s)||e(s,r,a)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var w=Object.defineProperty,g=Object.getOwnPropertyDescriptor,f=t=>{throw TypeError(t)},l=(t,e,s,r)=>{for(var a=r>1?void 0:r?g(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(a=(r?o(e,s,a):o(a))||a);return r&&a&&w(e,s,a),a},u=(t,e,s)=>e.has(t)||f("Cannot "+s),m=(t,e,s)=>(u(t,e,"read from private field"),e.get(t)),E=(t,e,s)=>e.has(t)?f("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),x=(t,e,s,r)=>(u(t,e,"write to private field"),e.set(t,s),s),d;let i=class extends _{constructor(){super(...arguments),this.label="",this.ariaLabel="",this.icons=!1,this.selected=!1,this.disabled=!1,this.fullWidth=!1,E(this,d,!1)}updated(){this.toggleAttribute("aria-disabled",this.disabled)}async firstUpdated(){m(this,d)||(await b(()=>import("../../vendor/vendor-material.js").then(e=>e._),__vite__mapDeps([0,1]),import.meta.url),x(this,d,!0)),this.shadowRoot?.querySelector("md-switch")?.addEventListener("change",e=>{this.selected=e.target.selected,this.dispatchEvent(new CustomEvent("change",{detail:{selected:this.selected},bubbles:!0,composed:!0}))})}render(){const t=this.label.trim().length>0,e=t?h:this.ariaLabel||h,s=p`
|
|
3
3
|
<md-switch
|
|
4
4
|
?icons=${this.icons}
|
|
5
5
|
?selected=${this.selected}
|
|
@@ -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 u}from"../../vendor/preload-helper.js";import{b as d}from"../../vendor/vendor-material.js";import{
|
|
2
|
+
import{_ as u}from"../../vendor/preload-helper.js";import{b as d}from"../../vendor/vendor-material.js";import{a as _,n as l,t as p}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(n,o,i){try{customElements.get(n)||e(n,o,i)}catch(r){var s=String(r||"");if(s.indexOf("already been used")===-1&&s.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var h=Object.defineProperty,f=Object.getOwnPropertyDescriptor,a=(t,e,n,o)=>{for(var i=o>1?void 0:o?f(e,n):e,s=t.length-1,r;s>=0;s--)(r=t[s])&&(i=(o?r(e,n,i):r(i))||i);return o&&i&&h(e,n,i),i};let c=class extends d{constructor(){super(...arguments),this.iconOnly=!1,this.inlineIcon=!1,this._onActivate=()=>{const t=this.textContent?.trim()??"";this.dispatchEvent(new CustomEvent("activate",{detail:{label:t},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab")}get icon(){return this._icon}set icon(t){const e=this._icon;e!==t&&(this._icon=t,this.requestUpdate("icon",e),this.updateIconSlot())}firstUpdated(t){super.firstUpdated(t),this.addEventListener("click",this._onActivate),this._icon&&this.updateIconSlot()}updated(){if(super.updated(),this.setAttribute("aria-selected",this.active?"true":"false"),this.iconOnly&&!this.hasAttribute("aria-label")){const t=this.textContent?.trim()??"";t&&this.setAttribute("aria-label",t)}}async ensureMdIconLoaded(){const t=globalThis;t.__mdIconLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),t.__mdIconLoaded=!0)}async updateIconSlot(){const t=this.querySelector('md-icon[slot="icon"]');if(!this._icon){t?.remove();return}if(await this.ensureMdIconLoaded(),t)t.textContent=this._icon;else{const e=document.createElement("md-icon");e.setAttribute("slot","icon"),e.textContent=this._icon,this.appendChild(e)}}};c.styles=[...d.styles,_`
|
|
3
3
|
/* Icon-only: dölj textslot */
|
|
4
4
|
:host([icon-only]) slot:not([name='icon']) {
|
|
5
5
|
display: none;
|
|
@@ -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 u}from"../../vendor/preload-helper.js";import{a as l}from"../../vendor/vendor-material.js";import{
|
|
2
|
+
import{_ as u}from"../../vendor/preload-helper.js";import{a as l}from"../../vendor/vendor-material.js";import{a as _,n as d,t as h}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(o,n,i){try{customElements.get(o)||e(o,n,i)}catch(r){var s=String(r||"");if(s.indexOf("already been used")===-1&&s.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var p=Object.defineProperty,b=Object.getOwnPropertyDescriptor,a=(t,e,o,n)=>{for(var i=n>1?void 0:n?b(e,o):e,s=t.length-1,r;s>=0;s--)(r=t[s])&&(i=(n?r(e,o,i):r(i))||i);return n&&i&&p(e,o,i),i};let c=class extends l{constructor(){super(...arguments),this.iconOnly=!1,this._onActivate=()=>{const t=this.textContent?.trim()??"";this.dispatchEvent(new CustomEvent("activate",{detail:{label:t},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab")}get icon(){return this._icon}set icon(t){const e=this._icon;e!==t&&(this._icon=t,this.requestUpdate("icon",e),this.updateIconSlot())}firstUpdated(t){if(super.firstUpdated(t),this.iconOnly&&!this.hasAttribute("aria-label")){const e=this.textContent?.trim()??"";e&&this.setAttribute("aria-label",e)}this.addEventListener("click",this._onActivate),this._icon&&this.updateIconSlot()}updated(){if(super.updated(),this.iconOnly&&!this.hasAttribute("aria-label")){const t=this.textContent?.trim()??"";t&&this.setAttribute("aria-label",t)}}async ensureMdIconLoaded(){const t=globalThis;t.__mdIconLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),t.__mdIconLoaded=!0)}async updateIconSlot(){const t=this.querySelector('md-icon[slot="icon"]');if(!this._icon){t?.remove();return}if(await this.ensureMdIconLoaded(),t)t.textContent=this._icon;else{const e=document.createElement("md-icon");e.setAttribute("slot","icon"),e.textContent=this._icon,this.appendChild(e)}}};c.styles=[...l.styles,_`
|
|
3
3
|
/* Icon-only: göm all text utom slot="icon" */
|
|
4
4
|
:host([icon-only]) slot:not([name='icon']) {
|
|
5
5
|
display: none;
|