scb-wc-test 0.1.105 → 0.1.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mvc/components/scb-accordion/scb-accordion.js +8 -2
- package/mvc/components/scb-avatar/scb-avatar.js +19 -10
- package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +2 -3
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +13 -7
- package/mvc/components/scb-button/scb-button.js +34 -32
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +13 -11
- package/mvc/components/scb-card/scb-card.js +44 -41
- package/mvc/components/scb-checkbox/scb-checkbox-group.js +15 -13
- package/mvc/components/scb-checkbox/scb-checkbox.js +6 -6
- package/mvc/components/scb-chip/scb-chip.js +27 -7
- package/mvc/components/scb-divider/scb-divider.js +41 -15
- package/mvc/components/scb-fact-card/scb-fact-card.js +37 -18
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +71 -43
- package/mvc/components/scb-icon-button/scb-icon-button.js +16 -10
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -4
- package/mvc/components/scb-list/scb-list.js +3 -3
- package/mvc/components/scb-notification-card/scb-notification-card.js +5 -5
- package/mvc/components/scb-pagination/scb-pagination.js +165 -107
- package/mvc/components/scb-radio-button/scb-radio-group.js +22 -11
- package/mvc/components/scb-search/scb-search.js +84 -32
- package/mvc/components/scb-segmented-button/scb-segmented-button.js +15 -13
- package/mvc/components/scb-status-pill/scb-status-pill.js +17 -13
- package/mvc/components/scb-stepper/scb-stepper.js +32 -29
- package/mvc/components/scb-switch/scb-switch.js +11 -8
- package/mvc/components/scb-tabs/scb-tabs.js +22 -19
- package/mvc/components/scb-textfield/scb-textfield.js +14 -10
- package/mvc/components/scb-toc/scb-toc.js +6 -3
- package/mvc/components/scb-viz/scb-viz.js +188 -178
- package/package.json +2 -2
- package/scb-accordion/scb-accordion.d.ts +13 -0
- package/scb-accordion/scb-accordion.js +53 -21
- package/scb-avatar/scb-avatar.d.ts +6 -0
- package/scb-avatar/scb-avatar.js +96 -61
- package/scb-breadcrumb/scb-breadcrumb-item.js +8 -9
- package/scb-breadcrumb/scb-breadcrumb.d.ts +6 -0
- package/scb-breadcrumb/scb-breadcrumb.js +61 -30
- package/scb-button/scb-button.d.ts +10 -0
- package/scb-button/scb-button.js +89 -65
- package/scb-calendar-card/scb-calendar-card.d.ts +5 -0
- package/scb-calendar-card/scb-calendar-card.js +79 -55
- package/scb-card/scb-card.d.ts +5 -0
- package/scb-card/scb-card.js +165 -140
- package/scb-checkbox/scb-checkbox-group.d.ts +3 -1
- package/scb-checkbox/scb-checkbox-group.js +59 -40
- package/scb-checkbox/scb-checkbox.d.ts +11 -0
- package/scb-checkbox/scb-checkbox.js +78 -56
- package/scb-chip/scb-chip.d.ts +24 -0
- package/scb-chip/scb-chip.js +137 -65
- package/scb-divider/scb-divider.d.ts +14 -0
- package/scb-divider/scb-divider.js +91 -43
- package/scb-fact-card/scb-fact-card.d.ts +10 -0
- package/scb-fact-card/scb-fact-card.js +135 -94
- package/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +10 -0
- package/scb-horizontal-scroller/scb-horizontal-scroller.js +179 -120
- package/scb-icon-button/scb-icon-button.d.ts +10 -1
- package/scb-icon-button/scb-icon-button.js +88 -59
- package/scb-keyfigure-card/scb-keyfigure-card.d.ts +10 -0
- package/scb-keyfigure-card/scb-keyfigure-card.js +76 -52
- package/scb-list/scb-list.d.ts +7 -1
- package/scb-list/scb-list.js +62 -40
- package/scb-notification-card/scb-notification-card.d.ts +5 -0
- package/scb-notification-card/scb-notification-card.js +56 -39
- package/scb-pagination/scb-pagination.d.ts +12 -1
- package/scb-pagination/scb-pagination.js +235 -147
- package/scb-radio-button/scb-radio-group.d.ts +14 -3
- package/scb-radio-button/scb-radio-group.js +120 -67
- package/scb-search/scb-search.d.ts +15 -2
- package/scb-search/scb-search.js +152 -69
- package/scb-segmented-button/scb-segmented-button.d.ts +45 -4
- package/scb-segmented-button/scb-segmented-button.js +163 -72
- package/scb-status-pill/scb-status-pill.d.ts +12 -1
- package/scb-status-pill/scb-status-pill.js +51 -27
- package/scb-stepper/scb-stepper.d.ts +11 -3
- package/scb-stepper/scb-stepper.js +134 -101
- package/scb-switch/scb-switch.d.ts +21 -2
- package/scb-switch/scb-switch.js +97 -45
- package/scb-tabs/scb-tabs.d.ts +8 -0
- package/scb-tabs/scb-tabs.js +74 -44
- package/scb-textfield/scb-textfield.d.ts +7 -0
- package/scb-textfield/scb-textfield.js +43 -16
- package/scb-toc/scb-toc.d.ts +10 -1
- package/scb-toc/scb-toc.js +49 -18
- package/scb-viz/scb-viz.d.ts +10 -3
- package/scb-viz/scb-viz.js +278 -236
- package/scb-wc-test.bundle.js +1184 -901
|
@@ -1,52 +1,111 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
|
|
1
|
+
import{a as d,n as g,i as h,x as o,t as b}from"../../vendor/vendor.js";import"../scb-link/scb-link.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";(function(){try{var a=typeof globalThis<"u"?globalThis:window;if(!a.__scb_ce_guard_installed__){a.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,i,r){try{customElements.get(s)||e(s,i,r)}catch(n){var c=String(n||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var u=Object.defineProperty,v=Object.getOwnPropertyDescriptor,p=(a,e,s,i)=>{for(var r=i>1?void 0:i?v(e,s):e,c=a.length-1,n;c>=0;c--)(n=a[c])&&(r=(i?n(e,s,r):n(r))||r);return i&&r&&u(e,s,r),r};let l=class extends h{constructor(){super(...arguments),this.variant="icon-text",this.page=1,this.totalPages=0,this.pagingHref="/products?page=",this.paginationAriaLabel="Paginering",this.currentAriaLabel="Nuvarande sida, ",this.pagingNumberAriaLabel="Gå till sida ",this.isNarrow=window.innerWidth<=768,this.spacing="",this.spacingTop="",this.spacingBottom="",this._onResize=()=>{this.isNarrow=window.innerWidth<=768}}_prevPage(){this.page>1&&this.page--,this.dispatchEvent(new CustomEvent("page-change",{detail:{page:this.page}}))}_nextPage(){this.page<this.totalPages&&this.page++,this.dispatchEvent(new CustomEvent("page-change",{detail:{page:this.page}}))}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this._onResize),this._onResize()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._onResize)}__resolveSpacingToken(a){const e=(a??"").trim();return e?/^(?:[0-9]|1[0-4])$/.test(e)?`var(--spacing-${e})`:e:""}__applySpacing(){const a=this.__resolveSpacingToken(this.spacingTop||this.spacing),e=this.__resolveSpacingToken(this.spacingBottom||this.spacing);a?this.style.marginBlockStart=a:this.style.removeProperty("margin-block-start"),e?this.style.marginBlockEnd=e:this.style.removeProperty("margin-block-end")}updated(a){super.updated(a),(a.has("spacing")||a.has("spacingTop")||a.has("spacingBottom"))&&this.__applySpacing()}render(){if(this.totalPages===0)return null;const a=this.variant?`${this.variant.toLowerCase()}`:"",e=[],{page:s,totalPages:i}=this,r=window.innerWidth<=768,c=r?1:2,n=t=>t===s?o`
|
|
2
|
+
<li>
|
|
3
|
+
<span
|
|
4
|
+
class="page-number active"
|
|
5
|
+
aria-current="page"
|
|
6
|
+
aria-label="${this.currentAriaLabel} ${t}"
|
|
7
|
+
>${t}</span
|
|
8
|
+
>
|
|
9
|
+
</li>
|
|
10
|
+
`:o`
|
|
11
|
+
<li>
|
|
12
|
+
<scb-link
|
|
13
|
+
class="page-number${t===s?" active":""}"
|
|
13
14
|
@click=${()=>{this.page=t,this.dispatchEvent(new CustomEvent("page-change",{detail:{page:t}}))}}
|
|
14
|
-
aria-current=${t===
|
|
15
|
+
aria-current=${t===s?"page":void 0}
|
|
15
16
|
aria-label="${this.pagingNumberAriaLabel} ${t}"
|
|
16
17
|
href=${this.pagingHref}${t}
|
|
17
|
-
?disabled=${t===
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
${this.variant==="icon"?s`<scb-icon-button icon="chevron_left" @click=${this._prevPage} ?disabled=${this.page===1} aria-label="Föregående sida"></scb-icon-button>`:s`<scb-button variant="text" label="Föregående" icon="chevron_left" @click=${this._prevPage} ?disabled=${this.page===1} aria-label="Föregående sida"></scb-button>`}
|
|
39
|
-
</div>
|
|
40
|
-
<ol>
|
|
41
|
-
${e}
|
|
42
|
-
</ol>
|
|
43
|
-
<div class="next">
|
|
44
|
-
${this.variant==="icon"?s`<scb-icon-button icon="chevron_right" @click=${this._nextPage} ?disabled=${this.page===this.totalPages} aria-label="Nästa sida"></scb-icon-button>`:s`<scb-button variant="text" label="Nästa" icon="chevron_right" iconPosition="right" @click=${this._nextPage} ?disabled=${this.page===this.totalPages} aria-label="Nästa sida" trailing-icon></scb-button>`}
|
|
45
|
-
</div>
|
|
18
|
+
?disabled=${t===s}
|
|
19
|
+
>${t}</scb-link
|
|
20
|
+
>
|
|
21
|
+
</li>
|
|
22
|
+
`;if(i<=8)for(let t=1;t<=i;t++)e.push(n(t));else if(e.push(n(1)),s<=4&&!r){for(let t=2;t<=5;t++)e.push(n(t));i>6?(e.push(o`<li><span class="ellipsis" aria-hidden="true">…</span></li>`),e.push(n(i))):i===6&&e.push(n(i))}else if(s<=3&&r){for(let t=2;t<=3;t++)e.push(n(t));i>4?(e.push(o`<li><span class="ellipsis" aria-hidden="true">…</span></li>`),e.push(n(i))):i===4&&e.push(n(i))}else if(s>=i-(c+1)){e.push(o`<li><span class="ellipsis" aria-hidden="true">…</span></li>`);for(let t=i-c*2;t<=i;t++)t>1&&e.push(n(t))}else{e.push(o`<li><span class="ellipsis" aria-hidden="true">…</span></li>`);for(let t=s-c;t<=s+c;t++)t>1&&t<i&&e.push(n(t));e.push(o`<li><span class="ellipsis" aria-hidden="true">…</span></li>`),e.push(n(i))}return r?o`
|
|
23
|
+
<nav aria-label="${this.paginationAriaLabel}" class="pagination ${a}">
|
|
24
|
+
<div class="pagination-row">
|
|
25
|
+
<div class="prev">
|
|
26
|
+
${this.variant==="icon"?o`<scb-icon-button
|
|
27
|
+
icon="chevron_left"
|
|
28
|
+
@click=${this._prevPage}
|
|
29
|
+
?disabled=${this.page===1}
|
|
30
|
+
aria-label="Föregående sida"
|
|
31
|
+
></scb-icon-button>`:o`<scb-button
|
|
32
|
+
variant="text"
|
|
33
|
+
label="Föregående"
|
|
34
|
+
icon="chevron_left"
|
|
35
|
+
@click=${this._prevPage}
|
|
36
|
+
?disabled=${this.page===1}
|
|
37
|
+
aria-label="Föregående sida"
|
|
38
|
+
></scb-button>`}
|
|
46
39
|
</div>
|
|
40
|
+
<ol>
|
|
41
|
+
${e}
|
|
42
|
+
</ol>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="next">
|
|
45
|
+
${this.variant==="icon"?o`<scb-icon-button
|
|
46
|
+
icon="chevron_right"
|
|
47
|
+
@click=${this._nextPage}
|
|
48
|
+
?disabled=${this.page===this.totalPages}
|
|
49
|
+
aria-label="Nästa sida"
|
|
50
|
+
></scb-icon-button>`:o`<scb-button
|
|
51
|
+
variant="text"
|
|
52
|
+
label="Nästa"
|
|
53
|
+
icon="chevron_right"
|
|
54
|
+
iconPosition="right"
|
|
55
|
+
@click=${this._nextPage}
|
|
56
|
+
?disabled=${this.page===this.totalPages}
|
|
57
|
+
aria-label="Nästa sida"
|
|
58
|
+
trailing-icon
|
|
59
|
+
></scb-button>`}
|
|
60
|
+
</div>
|
|
47
61
|
</nav>
|
|
48
|
-
`
|
|
49
|
-
|
|
62
|
+
`:o`
|
|
63
|
+
<nav aria-label="${this.paginationAriaLabel}" class="pagination ${a}">
|
|
64
|
+
<div class="pagination-row">
|
|
65
|
+
<div class="prev">
|
|
66
|
+
${this.variant==="icon"?o`<scb-icon-button
|
|
67
|
+
icon="chevron_left"
|
|
68
|
+
@click=${this._prevPage}
|
|
69
|
+
?disabled=${this.page===1}
|
|
70
|
+
aria-label="Föregående sida"
|
|
71
|
+
></scb-icon-button>`:o`<scb-button
|
|
72
|
+
variant="text"
|
|
73
|
+
label="Föregående"
|
|
74
|
+
icon="chevron_left"
|
|
75
|
+
@click=${this._prevPage}
|
|
76
|
+
?disabled=${this.page===1}
|
|
77
|
+
aria-label="Föregående sida"
|
|
78
|
+
></scb-button>`}
|
|
79
|
+
</div>
|
|
80
|
+
<ol>
|
|
81
|
+
${e}
|
|
82
|
+
</ol>
|
|
83
|
+
<div class="next">
|
|
84
|
+
${this.variant==="icon"?o`<scb-icon-button
|
|
85
|
+
icon="chevron_right"
|
|
86
|
+
@click=${this._nextPage}
|
|
87
|
+
?disabled=${this.page===this.totalPages}
|
|
88
|
+
aria-label="Nästa sida"
|
|
89
|
+
></scb-icon-button>`:o`<scb-button
|
|
90
|
+
variant="text"
|
|
91
|
+
label="Nästa"
|
|
92
|
+
icon="chevron_right"
|
|
93
|
+
iconPosition="right"
|
|
94
|
+
@click=${this._nextPage}
|
|
95
|
+
?disabled=${this.page===this.totalPages}
|
|
96
|
+
aria-label="Nästa sida"
|
|
97
|
+
trailing-icon
|
|
98
|
+
></scb-button>`}
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</nav>
|
|
102
|
+
`}};l.styles=[d`
|
|
103
|
+
:host {
|
|
104
|
+
display: block;
|
|
105
|
+
width: 100%;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host .pagination {
|
|
50
109
|
--md-text-button-label-text-color: var(--md-sys-color-on-surface, #0F0865);
|
|
51
110
|
--md-text-button-pressed-state-layer-color: var(--md-sys-color-on-surface, #0F0865);
|
|
52
111
|
--md-text-button-focus-label-text-color: var(--md-sys-color-on-surface, #0F0865);
|
|
@@ -55,68 +114,68 @@ import{a as g,n as d,i as b,x as s,t as h}from"../../vendor/vendor.js";import"..
|
|
|
55
114
|
--md-text-button-label-text-weight: var(--weight-regular, 400);
|
|
56
115
|
--md-text-button-label-text-line-height: var(--md-sys-typescale-body-medium-line-height, 24px);
|
|
57
116
|
--md-text-button-label-text-size: var(--md-sys-typescale-body-medium-size, 16px);
|
|
58
|
-
--md-text-button-icon-color
|
|
59
|
-
--md-text-button-focus-icon-color
|
|
60
|
-
--md-text-button-hover-icon-color
|
|
61
|
-
--md-text-button-pressed-icon-color
|
|
117
|
+
--md-text-button-icon-color: var(--md-sys-color-on-surface, #0F0865);
|
|
118
|
+
--md-text-button-focus-icon-color: var(--md-sys-color-on-surface, #0F0865);
|
|
119
|
+
--md-text-button-hover-icon-color: var(--md-sys-color-on-surface, #0F0865);
|
|
120
|
+
--md-text-button-pressed-icon-color: var(--md-sys-color-on-surface, #0F0865);
|
|
62
121
|
--scb-link-decoration: none;
|
|
63
122
|
--scb-link-color: var(--md-sys-color-on-surface, #0F0865);
|
|
64
123
|
|
|
65
124
|
scb-link.page-number a {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
text-decoration: none;
|
|
127
|
+
display: inline-flex;
|
|
69
128
|
}
|
|
70
|
-
|
|
129
|
+
}
|
|
71
130
|
|
|
72
|
-
|
|
131
|
+
.pagination {
|
|
73
132
|
width: 100%;
|
|
74
133
|
display: flex;
|
|
75
134
|
flex-direction: column;
|
|
76
135
|
gap: 0;
|
|
77
|
-
|
|
78
|
-
|
|
136
|
+
}
|
|
137
|
+
.pagination-row {
|
|
79
138
|
width: 100%;
|
|
80
139
|
display: flex;
|
|
81
140
|
flex-direction: row;
|
|
82
141
|
align-items: center;
|
|
83
142
|
gap: 4px;
|
|
84
|
-
|
|
85
|
-
|
|
143
|
+
}
|
|
144
|
+
.pagination-row .prev {
|
|
86
145
|
display: flex;
|
|
87
146
|
justify-content: flex-start;
|
|
88
147
|
width: auto;
|
|
89
|
-
|
|
90
|
-
|
|
148
|
+
}
|
|
149
|
+
.pagination-row ol {
|
|
91
150
|
width: auto;
|
|
92
151
|
display: flex;
|
|
93
152
|
flex-direction: row;
|
|
94
|
-
justify-content: flex-start;
|
|
153
|
+
justify-content: flex-start;
|
|
95
154
|
gap: 4px;
|
|
96
155
|
margin: 0;
|
|
97
156
|
padding: 0;
|
|
98
157
|
list-style: none;
|
|
99
|
-
|
|
100
|
-
|
|
158
|
+
}
|
|
159
|
+
.pagination-row ol li {
|
|
101
160
|
min-width: 40px;
|
|
102
161
|
min-height: 40px;
|
|
103
162
|
display: flex;
|
|
104
163
|
align-items: center;
|
|
105
164
|
justify-content: center;
|
|
106
|
-
|
|
107
|
-
|
|
165
|
+
}
|
|
166
|
+
.pagination-row .next {
|
|
108
167
|
display: flex;
|
|
109
168
|
justify-content: flex-start;
|
|
110
|
-
align-items: center;
|
|
169
|
+
align-items: center;
|
|
111
170
|
width: auto;
|
|
112
|
-
margin-top: 0;
|
|
113
|
-
|
|
114
|
-
|
|
171
|
+
margin-top: 0;
|
|
172
|
+
}
|
|
173
|
+
scb-link.page-number a {
|
|
115
174
|
cursor: pointer;
|
|
116
175
|
text-decoration: none;
|
|
117
176
|
display: inline-flex;
|
|
118
|
-
|
|
119
|
-
|
|
177
|
+
}
|
|
178
|
+
.page-number.active {
|
|
120
179
|
display: inline-flex;
|
|
121
180
|
align-items: center;
|
|
122
181
|
justify-content: center;
|
|
@@ -126,50 +185,49 @@ import{a as g,n as d,i as b,x as s,t as h}from"../../vendor/vendor.js";import"..
|
|
|
126
185
|
text-align: center;
|
|
127
186
|
width: 40px;
|
|
128
187
|
height: 40px;
|
|
129
|
-
|
|
130
|
-
|
|
188
|
+
}
|
|
189
|
+
.page-number.active {
|
|
131
190
|
font-family: var(--brand-font, 'Inter', sans-serif);
|
|
132
|
-
|
|
133
|
-
|
|
191
|
+
}
|
|
192
|
+
.ellipsis {
|
|
134
193
|
margin: 0 4px;
|
|
135
194
|
color: #888;
|
|
136
195
|
user-select: none;
|
|
137
196
|
pointer-events: none;
|
|
138
|
-
|
|
139
|
-
|
|
197
|
+
}
|
|
198
|
+
scb-button[disabled] {
|
|
140
199
|
opacity: 0.5;
|
|
141
200
|
pointer-events: none;
|
|
142
201
|
}
|
|
143
202
|
|
|
144
|
-
@media (max-width: 768px) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
203
|
+
@media (max-width: 768px) {
|
|
204
|
+
.pagination .prev {
|
|
205
|
+
display: flex;
|
|
206
|
+
justify-content: flex-start;
|
|
207
|
+
}
|
|
208
|
+
.pagination .next {
|
|
209
|
+
width: 100%;
|
|
210
|
+
margin-top: 8px;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
155
213
|
|
|
156
|
-
@media (max-width: 390px) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
`];
|
|
214
|
+
@media (max-width: 390px) {
|
|
215
|
+
.pagination-row {
|
|
216
|
+
flex-direction: column;
|
|
217
|
+
gap: 0;
|
|
218
|
+
}
|
|
219
|
+
.pagination-row .prev {
|
|
220
|
+
width: 100%;
|
|
221
|
+
margin-bottom: 8px;
|
|
222
|
+
align-items: center;
|
|
223
|
+
}
|
|
224
|
+
.pagination-row ol {
|
|
225
|
+
width: 100%;
|
|
226
|
+
align-items: center;
|
|
227
|
+
}
|
|
228
|
+
.pagination-row .next {
|
|
229
|
+
width: 100%;
|
|
230
|
+
margin-top: 8px;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
`];p([g({type:String})],l.prototype,"variant",2);p([g({type:Number})],l.prototype,"page",2);p([g({type:Number,attribute:"total-pages"})],l.prototype,"totalPages",2);p([g({type:String,attribute:"paging-href"})],l.prototype,"pagingHref",2);p([g({type:String,attribute:"pagination-aria-label"})],l.prototype,"paginationAriaLabel",2);p([g({type:String,attribute:"current-aria-label"})],l.prototype,"currentAriaLabel",2);p([g({type:String,attribute:"paging-number-aria-label"})],l.prototype,"pagingNumberAriaLabel",2);p([g({type:Boolean})],l.prototype,"isNarrow",2);p([g({type:String})],l.prototype,"spacing",2);p([g({type:String,attribute:"spacing-top"})],l.prototype,"spacingTop",2);p([g({type:String,attribute:"spacing-bottom"})],l.prototype,"spacingBottom",2);l=p([b("scb-pagination")],l);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as k,n as c,i as S,x as C,t as w}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(i,s,a){try{customElements.get(i)||e(i,s,a)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var V=Object.defineProperty,E=Object.getOwnPropertyDescriptor,_=t=>{throw TypeError(t)},l=(t,e,i,s)=>{for(var a=s>1?void 0:s?E(e,i):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(a=(s?o(e,i,a):o(a))||a);return s&&a&&V(e,i,a),a},y=(t,e,i)=>e.has(t)||_("Cannot "+i),h=(t,e,i)=>(y(t,e,"read from private field"),i?i.call(t):e.get(t)),f=(t,e,i)=>e.has(t)?_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),u=(t,e,i)=>(y(t,e,"access private method"),i),m,d,g,p,v,b;let r=class extends S{constructor(){super(),f(this,p),this.name="",this.orientation="vertical",this.disabled=!1,this.ariaLabel=null,this.spacing="",this.spacingTop="",this.spacingBottom="",this.value="",this._internals=null,this._form=null,this._formResetHandler=null,this._initialValue="",f(this,m,()=>{const t=this.shadowRoot?.querySelector("slot");return t?t.assignedElements({flatten:!0}).filter(e=>e.tagName.toLowerCase()==="scb-radio-button"):[]}),f(this,d,()=>{const t=h(this,m).call(this);if(!t.length)return;let e=null;for(const i of t){const s=i;this.name&&i.setAttribute("name",this.name),this.disabled?i.setAttribute("disabled",""):i.removeAttribute("disabled"),this.orientation==="horizontal"?i.setAttribute("orientation","horizontal"):i.removeAttribute("orientation");const a=s.value??i.getAttribute("value")??"",n=typeof s.checked=="boolean"?s.checked:i.hasAttribute("checked");if(this.value){const o=String(a)===this.value;o&&!n?s.checked=!0:!o&&n&&(s.checked=!1)}else n&&e===null&&(e=String(a))}!this.value&&e!==null&&(this.value=e)}),f(this,g,t=>{const e=t.composedPath().find(s=>s?.tagName?.toLowerCase()==="scb-radio-button"),i=e?.value??e?.getAttribute?.("value")??t.target?.value??"";this.value=String(i??""),this.dispatchEvent(new CustomEvent("scb-change",{detail:{value:String(i??""),originalIsTrusted:t?.isTrusted===!0},bubbles:!0,composed:!0}))}),"attachInternals"in this&&(this._internals=this.attachInternals())}render(){const t=this.orientation==="horizontal"?"row":"column";return C`
|
|
2
2
|
<div
|
|
3
3
|
class="g"
|
|
4
4
|
role="radiogroup"
|
|
@@ -6,23 +6,34 @@ import{a as b,n as d,i as v,x as _,t as y}from"../../vendor/vendor.js";(function
|
|
|
6
6
|
aria-label=${this.ariaLabel??""}
|
|
7
7
|
style=${`--_dir:${t}`}
|
|
8
8
|
>
|
|
9
|
-
<slot @slotchange=${
|
|
9
|
+
<slot @slotchange=${h(this,d)}></slot>
|
|
10
10
|
</div>
|
|
11
|
-
`}firstUpdated(){
|
|
12
|
-
:host {
|
|
11
|
+
`}firstUpdated(){u(this,p,v).call(this),h(this,d).call(this),this.addEventListener("change",h(this,g)),this._initialValue=this.value,this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.value=this._initialValue,this.requestUpdate(),h(this,d).call(this),this.__syncFormValue()},this._form.addEventListener("reset",this._formResetHandler,!0)),this.__syncFormValue()}disconnectedCallback(){this.removeEventListener("change",h(this,g)),this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),super.disconnectedCallback()}updated(t){(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&u(this,p,v).call(this),(t.has("name")||t.has("disabled")||t.has("orientation")||t.has("value"))&&h(this,d).call(this),(t.has("value")||t.has("disabled")||t.has("name"))&&this.__syncFormValue()}formDisabledCallback(t){this.disabled=t}__syncFormValue(){if(!this._internals)return;const t=typeof this.name=="string"&&this.name.trim()!=="",e=typeof this.value=="string"&&this.value.trim()!=="",i=this.disabled||!t||!e?null:this.value;this._internals.setFormValue(i)}};m=new WeakMap;d=new WeakMap;g=new WeakMap;p=new WeakSet;v=function(){const t=u(this,p,b).call(this,this.spacing),e=u(this,p,b).call(this,this.spacingTop)??t,i=u(this,p,b).call(this,this.spacingBottom)??t;e?this.style.setProperty("--scb-radio-group-spacing-block-start",e):this.style.removeProperty("--scb-radio-group-spacing-block-start"),i?this.style.setProperty("--scb-radio-group-spacing-block-end",i):this.style.removeProperty("--scb-radio-group-spacing-block-end")};b=function(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e};r.formAssociated=!0;r.styles=k`
|
|
12
|
+
:host {
|
|
13
|
+
display: block;
|
|
14
|
+
|
|
15
|
+
/* Vertikal standard-spacing mellan items i gruppen */
|
|
16
|
+
--scb-radio-gap: var(--spacing-4, 12px);
|
|
17
|
+
|
|
18
|
+
/* Vertikalt avstånd mot omgivande innehåll, styrs via spacing/spacing-top/spacing-bottom */
|
|
19
|
+
margin-block-start: var(--scb-radio-group-spacing-block-start, 0);
|
|
20
|
+
margin-block-end: var(--scb-radio-group-spacing-block-end, 0);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Horisontell standard-spacing mellan items om gap inte overrideas via CSS-variabel */
|
|
24
|
+
:host([orientation='horizontal']) {
|
|
25
|
+
--scb-radio-gap: var(--spacing-8, 32px);
|
|
26
|
+
}
|
|
13
27
|
|
|
14
28
|
.g {
|
|
15
29
|
display: flex;
|
|
16
30
|
flex-direction: var(--_dir, column);
|
|
17
|
-
gap: 0; /* default: inget extra gap */
|
|
18
31
|
align-items: flex-start;
|
|
32
|
+
gap: var(--scb-radio-gap);
|
|
19
33
|
}
|
|
20
34
|
|
|
21
|
-
/*
|
|
22
|
-
|
|
23
|
-
gap: var(--scb-radio-gap, 12px);
|
|
24
|
-
}
|
|
25
|
-
:host([spacing="group"]) ::slotted(scb-radio-button) {
|
|
35
|
+
/* När radioknappar ligger i en grupp ska spacing ägas av gruppen, inte av enskilda items */
|
|
36
|
+
::slotted(scb-radio-button) {
|
|
26
37
|
--scb-radio-gap: 0;
|
|
27
38
|
}
|
|
28
|
-
`;l([
|
|
39
|
+
`;l([c({type:String})],r.prototype,"name",2);l([c({type:String,reflect:!0})],r.prototype,"orientation",2);l([c({type:Boolean,reflect:!0})],r.prototype,"disabled",2);l([c({type:String,attribute:"aria-label"})],r.prototype,"ariaLabel",2);l([c({type:String,reflect:!0})],r.prototype,"spacing",2);l([c({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",2);l([c({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",2);l([c({type:String,reflect:!0})],r.prototype,"value",2);r=l([w("scb-radio-group")],r);
|