scb-wc 0.1.144 → 0.1.145
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 +41 -22
- package/all.js +0 -5
- package/index.js +90 -95
- package/mvc/components/all.js +0 -5
- package/mvc/components/scb-accordion/scb-accordion-item.js +1 -1
- package/mvc/components/scb-button/scb-button.js +3 -3
- package/mvc/components/scb-calendar/scb-calendar.js +1 -1
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +4 -4
- package/mvc/components/scb-card/scb-card.js +2 -2
- package/mvc/components/scb-dropdown/scb-dropdown.js +1 -1
- package/mvc/components/scb-header/scb-header.js +2 -2
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +6 -6
- package/mvc/components/scb-icon-button/scb-icon-button.js +5 -5
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -6
- package/mvc/components/scb-list/scb-list-item.js +2 -2
- package/mvc/components/scb-menu/scb-menu-item.js +1 -1
- package/mvc/components/scb-nav/scb-nav.js +1 -1
- package/mvc/components/scb-options-menu/scb-options-menu-item.js +1 -1
- package/mvc/components/scb-progress-stepper/scb-progress-step.js +1 -1
- package/mvc/components/scb-search/scb-search.js +1 -1
- package/mvc/components/scb-segmented-button/scb-segmented-item.js +1 -1
- package/mvc/components/scb-select/scb-select-option.js +1 -1
- package/mvc/components/scb-select/scb-select.js +1 -1
- package/mvc/components/scb-stepper/scb-step.js +1 -1
- package/mvc/components/scb-textfield/scb-textfield.js +159 -28
- package/mvc/components/scb-toc/scb-toc-item.js +1 -1
- package/mvc/vendor/lazy-focus-ring.js +2 -0
- package/mvc/vendor/lazy-ripple.js +2 -0
- package/mvc/{components/scb-chevron → vendor}/scb-chevron.js +1 -1
- package/mvc/vendor/scb-icon-svg.js +11 -0
- package/package.json +2 -2
- package/scb-chevron/scb-chevron.js +0 -1
- package/scb-datepicker/scb-datepicker.js +0 -1
- package/scb-wc-public-entry/index.d.ts +99 -0
- package/scb-wc.bundle.js +268 -268
- package/scb-wc.d.ts +198 -208
- package/shared/scb-icon-svg.js +2 -5
- package/mvc/components/scb-datepicker/scb-datepicker.js +0 -132
- package/mvc/components/shared/lazy-focus-ring.js +0 -2
- package/mvc/components/shared/lazy-ripple.js +0 -2
- package/mvc/components/shared/scb-icon-svg.js +0 -11
- package/scb-components/index.d.ts +0 -104
- package/scb-components/scb-chevron/scb-chevron.d.ts +0 -11
- package/scb-components/scb-datepicker/scb-datepicker.d.ts +0 -45
- package/scb-components/shared/lazy-focus-ring.d.ts +0 -4
- package/scb-components/shared/lazy-ripple.d.ts +0 -9
- package/scb-components/shared/scb-icon-svg.d.ts +0 -3
package/README.md
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
# Om SCB Web Components
|
|
1
|
+
# Om SCB Web Components
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
> Installera `scb-wc` via `@next` för komponenter under utveckling. API, utseende och beteende kan ändras eller tas bort mellan versioner.
|
|
5
|
-
|
|
6
|
-
SCB Web Components preview finns för att underlätta skapandet av enhetliga, tillgängliga och användbara webbapplikationer.
|
|
3
|
+
SCB Web Components finns för att underlätta skapandet av enhetliga, tillgängliga och användbara webbapplikationer.
|
|
7
4
|
|
|
8
5
|
Komponenterna bygger på:
|
|
9
6
|
- [Lit](https://lit.dev/)
|
|
@@ -11,32 +8,54 @@ Komponenterna bygger på:
|
|
|
11
8
|
|
|
12
9
|
## Storybook och dokumentation (internt)
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
Produktionskomponenterna dokumenteras och demonstreras i Storybook på SCB:s interna adress:
|
|
15
12
|
|
|
16
|
-
-
|
|
13
|
+
- Prod: https://webcomponents.scb.intra
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
Testkomponenterna finns på:
|
|
19
16
|
|
|
20
|
-
-
|
|
17
|
+
- Test: https://webcomponentstest.scb.intra
|
|
21
18
|
|
|
22
19
|
---
|
|
23
20
|
|
|
24
21
|
## Kom igång
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
Rekommenderad startväg:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
npx scb-wc init html my-app
|
|
27
|
+
npx scb-wc init html-service my-service
|
|
28
|
+
npx scb-wc init react my-react-app
|
|
29
|
+
npx scb-wc init react-service my-react-service
|
|
30
|
+
npx scb-wc init blazor my-blazor-app
|
|
31
|
+
npx scb-wc init blazor-service my-blazor-service
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Webbplatsmallarna skapar en liten starterapp med:
|
|
35
|
+
- `scb-header`
|
|
36
|
+
- `scb-footer`
|
|
37
|
+
- `scb-grid`
|
|
38
|
+
- några vanliga komponenter
|
|
39
|
+
|
|
40
|
+
Webbtjänstmallarna skapar en starterapp med:
|
|
41
|
+
- `scb-app-bar`
|
|
42
|
+
- `scb-search`
|
|
43
|
+
- `scb-table-advanced`
|
|
44
|
+
- komponenter för actions och status
|
|
45
|
+
|
|
46
|
+
Välj sedan den starter som ligger närmast din app och kör `npm install` i den nya mappen.
|
|
28
47
|
|
|
29
|
-
|
|
48
|
+
Om du redan har en app med `package.json`, kör kommandon i den mappen och installera paketet:
|
|
30
49
|
|
|
31
50
|
```sh
|
|
32
|
-
npm install scb-wc
|
|
51
|
+
npm install scb-wc
|
|
33
52
|
```
|
|
34
53
|
|
|
35
54
|
---
|
|
36
55
|
|
|
37
56
|
## Alternativ 1: Använd som ES‑moduler (t.ex. i React, Vue, SPA)
|
|
38
57
|
|
|
39
|
-
Importera CSS och de
|
|
58
|
+
Importera CSS och de komponenter du använder (bäst för tree‑shaking):
|
|
40
59
|
|
|
41
60
|
```js
|
|
42
61
|
// Global CSS + tokens (måste bara importeras en gång)
|
|
@@ -102,7 +121,7 @@ För MVC/MPA räcker det normalt att använda `scb-wc-selfhost.css`, eftersom de
|
|
|
102
121
|
|
|
103
122
|
## Alternativ 2: Använd i MVC/MPA via `<script type="module">`
|
|
104
123
|
|
|
105
|
-
Det här läget använder den färdig‑
|
|
124
|
+
Det här läget använder den färdig‑splittrade **MVC‑ESM**‑builden som följer med paketet under:
|
|
106
125
|
|
|
107
126
|
```text
|
|
108
127
|
node_modules/scb-wc/mvc/
|
|
@@ -115,7 +134,7 @@ Lägg till i din apps `package.json`:
|
|
|
115
134
|
```jsonc
|
|
116
135
|
{
|
|
117
136
|
"scripts": {
|
|
118
|
-
"ui:install": "node -e \"const fs=require('fs'),p=require('path');const src=p.resolve('node_modules/scb-wc/mvc');if(!fs.existsSync(src)){console.error('Hittar inte '+src+'. Har du kört npm install scb-wc
|
|
137
|
+
"ui:install": "node -e \"const fs=require('fs'),p=require('path');const src=p.resolve('node_modules/scb-wc/mvc');if(!fs.existsSync(src)){console.error('Hittar inte '+src+'. Har du kört npm install scb-wc?');process.exit(1);}const start=process.env.INIT_CWD||process.cwd();const ov=process.env.npm_config_ui_wwwroot;function findBase(){if(ov){return p.isAbsolute(ov)?ov:p.resolve(start,ov);}let d=start;while(true){const cand=p.join(d,'wwwroot');if(fs.existsSync(cand)) return cand;const up=p.dirname(d);if(up===d) return p.resolve(start,'wwwroot');d=up;}}const base=findBase();const dst=p.resolve(base,'ui');fs.rmSync(dst,{recursive:true,force:true});fs.mkdirSync(base,{recursive:true});fs.cpSync(src,dst,{recursive:true});console.log('Kopierade '+src+' → '+dst);\""
|
|
119
138
|
}
|
|
120
139
|
}
|
|
121
140
|
```
|
|
@@ -164,7 +183,7 @@ Behöver du en annan webbrotsökväg (t.ex. om din `wwwroot` ligger någon annan
|
|
|
164
183
|
|
|
165
184
|
## Alternativ 3: Bundlad version (IIFE) för äldre miljöer
|
|
166
185
|
|
|
167
|
-
Om ESM inte stöds kan du använda den bundlade
|
|
186
|
+
Om ESM inte stöds kan du använda den bundlade varianten från paketroten.
|
|
168
187
|
Flytta följande tre filer från `node_modules/scb-wc` och använd dem i applikationen:
|
|
169
188
|
|
|
170
189
|
```text
|
|
@@ -189,7 +208,7 @@ Lägg till `scb-compact.css` om sidan ska använda compact-typografi.
|
|
|
189
208
|
|
|
190
209
|
SCB Web Components fungerar även i Blazor‑appar när du vill använda samma komponenter i både MVC/MPA och Blazor.
|
|
191
210
|
|
|
192
|
-
Grundprincipen är
|
|
211
|
+
Grundprincipen är:
|
|
193
212
|
|
|
194
213
|
1. Använd MVC‑ESM‑builden (`node_modules/scb-wc/mvc`) och kopiera den till `wwwroot/ui` med `ui:install`.
|
|
195
214
|
2. Ladda `scb-blazor-bridge.js` från `wwwroot/ui` i din Blazor‑layout.
|
|
@@ -202,8 +221,8 @@ Lägg till ett script som kopierar interop-filen från `node_modules` till ditt
|
|
|
202
221
|
```jsonc
|
|
203
222
|
{
|
|
204
223
|
"scripts": {
|
|
205
|
-
"ui:install": "node -e \"const fs=require('fs'),p=require('path');const src=p.resolve('node_modules/scb-wc/mvc');if(!fs.existsSync(src)){console.error('Hittar inte '+src+'. Har du kört npm install scb-wc
|
|
206
|
-
"ui:blazor:interop": "node -e \"const fs=require('fs'),p=require('path');const start=process.env.INIT_CWD||process.cwd();const src=p.resolve('node_modules/scb-wc/blazor/ScbBlazorInteropBase.cs');if(!fs.existsSync(src)){console.error('Hittar inte '+src+'. Har du kört npm install scb-wc
|
|
224
|
+
"ui:install": "node -e \"const fs=require('fs'),p=require('path');const src=p.resolve('node_modules/scb-wc/mvc');if(!fs.existsSync(src)){console.error('Hittar inte '+src+'. Har du kört npm install scb-wc?');process.exit(1);}const start=process.env.INIT_CWD||process.cwd();const ov=process.env.npm_config_ui_wwwroot;function findBase(){if(ov){return p.isAbsolute(ov)?ov:p.resolve(start,ov);}let d=start;while(true){const cand=p.join(d,'wwwroot');if(fs.existsSync(cand)) return cand;const up=p.dirname(d);if(up===d) return p.resolve(start,'wwwroot');d=up;}}const base=findBase();const dst=p.resolve(base,'ui');fs.rmSync(dst,{recursive:true,force:true});fs.mkdirSync(base,{recursive:true});fs.cpSync(src,dst,{recursive:true});console.log('Kopierade '+src+' → '+dst);\"",
|
|
225
|
+
"ui:blazor:interop": "node -e \"const fs=require('fs'),p=require('path');const start=process.env.INIT_CWD||process.cwd();const src=p.resolve('node_modules/scb-wc/blazor/ScbBlazorInteropBase.cs');if(!fs.existsSync(src)){console.error('Hittar inte '+src+'. Har du kört npm install scb-wc?');process.exit(1);}const dst=p.resolve(start,'ScbBlazor/ScbBlazorInteropBase.cs');fs.mkdirSync(p.dirname(dst),{recursive:true});fs.copyFileSync(src,dst);console.log('Kopierade '+src+' → '+dst);\""
|
|
207
226
|
}
|
|
208
227
|
}
|
|
209
228
|
```
|
|
@@ -217,13 +236,13 @@ Exempel på layout:
|
|
|
217
236
|
<script type="module" src="~/ui/scb-blazor-bridge.js"></script>
|
|
218
237
|
```
|
|
219
238
|
|
|
220
|
-
`ScbBlazorInteropBase`
|
|
239
|
+
`ScbBlazorInteropBase` kan återanvändas mellan projekt som använder både `scb-wc@latest` och `scb-wc@next`.
|
|
221
240
|
|
|
222
241
|
---
|
|
223
242
|
|
|
224
243
|
## Viktigt
|
|
225
244
|
|
|
226
|
-
- `scb-wc@
|
|
245
|
+
- `scb-wc@latest` är produktionskanalen. Använd `scb-wc@next` för komponenter under utveckling och experiment.
|
|
227
246
|
- **Kör kommandon i mappen med din `package.json`.** Placeringen av `package.json` styr standardmål för `ui:install` (rot → `wwwroot/ui`, `ClientApp/` → använd `--ui_wwwroot=../wwwroot`).
|
|
228
247
|
- **Blanda inte MVC‑ESM och IIFE på samma sida.** Välj en distributionsform per sida/app.
|
|
229
248
|
- **Blazor:** Se till att `scb-blazor-bridge.js` laddas efter att komponent‑JS:et finns på sidan, och att `ScbBlazorInteropBase` inte dupliceras i flera namespaces i samma lösning.
|
package/all.js
CHANGED
|
@@ -18,12 +18,10 @@ import './scb-card/scb-list-card.js';
|
|
|
18
18
|
import './scb-card/scb-social-card.js';
|
|
19
19
|
import './scb-checkbox/scb-checkbox-group.js';
|
|
20
20
|
import './scb-checkbox/scb-checkbox.js';
|
|
21
|
-
import './scb-chevron/scb-chevron.js';
|
|
22
21
|
import './scb-chip/scb-chip.js';
|
|
23
22
|
import './scb-collapse/scb-collapse.js';
|
|
24
23
|
import './scb-container-card/scb-container-card.js';
|
|
25
24
|
import './scb-cookies-consent/scb-cookies-consent.js';
|
|
26
|
-
import './scb-datepicker/scb-datepicker.js';
|
|
27
25
|
import './scb-dialog/scb-dialog.js';
|
|
28
26
|
import './scb-divider/scb-divider.js';
|
|
29
27
|
import './scb-drawer/scb-drawer.js';
|
|
@@ -99,6 +97,3 @@ import './scb-viz/scb-viz-series-differentiation-registry.js';
|
|
|
99
97
|
import './scb-viz/scb-viz-series-differentiation-runtime.js';
|
|
100
98
|
import './scb-viz/scb-viz-table-runtime.js';
|
|
101
99
|
import './scb-viz/scb-viz.js';
|
|
102
|
-
import './shared/lazy-focus-ring.js';
|
|
103
|
-
import './shared/lazy-ripple.js';
|
|
104
|
-
import './shared/scb-icon-svg.js';
|
package/index.js
CHANGED
|
@@ -1,34 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ScbAccordion as s } from "./scb-accordion/scb-accordion.js";
|
|
6
|
-
import { ScbActionCard as c, ScbCard as l, ScbContainerCard as u, ScbLinkCard as d, ScbListCard as f, ScbSocialCard as p } from "./scb-card/scb-card.js";
|
|
1
|
+
import { ScbAccordionItem as e } from "./scb-accordion/scb-accordion-item.js";
|
|
2
|
+
import { ScbButton as t } from "./scb-button/scb-button.js";
|
|
3
|
+
import { ScbAccordion as n } from "./scb-accordion/scb-accordion.js";
|
|
4
|
+
import { ScbActionCard as r, ScbCard as i, ScbContainerCard as a, ScbLinkCard as o, ScbListCard as s, ScbSocialCard as c } from "./scb-card/scb-card.js";
|
|
7
5
|
import "./scb-action-card/scb-action-card.js";
|
|
8
|
-
import { ScbIconButton as
|
|
9
|
-
import { ScbSearch as
|
|
10
|
-
import { ScbAvatar as
|
|
11
|
-
import { ScbAppBar as
|
|
12
|
-
import { ScbBadge as
|
|
13
|
-
import { ScbLink as
|
|
14
|
-
import { SCBBreadcrumbItem as
|
|
15
|
-
import { SCBBreadcrumb as
|
|
16
|
-
import { ScbCalendarEvent as
|
|
17
|
-
import { ScbDivider as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import { ScbCalendarCard as L } from "./scb-calendar-card/scb-calendar-card.js";
|
|
6
|
+
import { ScbIconButton as l } from "./scb-icon-button/scb-icon-button.js";
|
|
7
|
+
import { ScbSearch as u } from "./scb-search/scb-search.js";
|
|
8
|
+
import { ScbAvatar as d } from "./scb-avatar/scb-avatar.js";
|
|
9
|
+
import { ScbAppBar as f } from "./scb-app-bar/scb-app-bar.js";
|
|
10
|
+
import { ScbBadge as p } from "./scb-badge/scb-badge.js";
|
|
11
|
+
import { ScbLink as m } from "./scb-link/scb-link.js";
|
|
12
|
+
import { SCBBreadcrumbItem as h } from "./scb-breadcrumb/scb-breadcrumb-item.js";
|
|
13
|
+
import { SCBBreadcrumb as g } from "./scb-breadcrumb/scb-breadcrumb.js";
|
|
14
|
+
import { ScbCalendarEvent as _ } from "./scb-calendar/scb-calendar-event.js";
|
|
15
|
+
import { ScbDivider as v } from "./scb-divider/scb-divider.js";
|
|
16
|
+
import { ScbTooltip as y } from "./scb-tooltip/scb-tooltip.js";
|
|
17
|
+
import { ScbTextField as b } from "./scb-textfield/scb-textfield.js";
|
|
18
|
+
import { ScbCheckboxGroup as x } from "./scb-checkbox/scb-checkbox-group.js";
|
|
19
|
+
import { ScbCheckbox as S } from "./scb-checkbox/scb-checkbox.js";
|
|
20
|
+
import { ScbRadioGroup as C } from "./scb-radio-button/scb-radio-group.js";
|
|
21
|
+
import { ScbRadioButton as w } from "./scb-radio-button/scb-radio-button.js";
|
|
22
|
+
import { ScbSwitch as T } from "./scb-switch/scb-switch.js";
|
|
23
|
+
import { ScbChip as E } from "./scb-chip/scb-chip.js";
|
|
24
|
+
import { ScbDialog as D } from "./scb-dialog/scb-dialog.js";
|
|
25
|
+
import { ScbListItem as O } from "./scb-list/scb-list-item.js";
|
|
26
|
+
import { ScbList as k } from "./scb-list/scb-list.js";
|
|
27
|
+
import { ScbCalendar as A } from "./scb-calendar/scb-calendar.js";
|
|
28
|
+
import { ScbCalendarCard as j } from "./scb-calendar-card/scb-calendar-card.js";
|
|
32
29
|
import "./scb-card/scb-action-card.js";
|
|
33
30
|
import "./scb-container-card/scb-container-card.js";
|
|
34
31
|
import "./scb-card/scb-container-card.js";
|
|
@@ -38,68 +35,66 @@ import "./scb-list-card/scb-list-card.js";
|
|
|
38
35
|
import "./scb-card/scb-list-card.js";
|
|
39
36
|
import "./scb-social-card/scb-social-card.js";
|
|
40
37
|
import "./scb-card/scb-social-card.js";
|
|
41
|
-
import { ScbCollapse as
|
|
42
|
-
import { ScbCookiesConsent as
|
|
43
|
-
import { ScbDrawer as
|
|
44
|
-
import { ScbDropZone as
|
|
45
|
-
import { ScbOptionsMenuItem as
|
|
46
|
-
import { ScbOptionsSubMenu as
|
|
47
|
-
import { ScbOptionsMenu as
|
|
48
|
-
import { ScbDropdown as
|
|
49
|
-
import { ScbFab as
|
|
50
|
-
import { ScbFactCardContent as
|
|
51
|
-
import { ScbFactCard as
|
|
52
|
-
import { ScbFooterSection as
|
|
53
|
-
import { ScbGridItem as
|
|
54
|
-
import { ScbStack as
|
|
55
|
-
import { ScbGrid as
|
|
56
|
-
import { ScbFooter as
|
|
57
|
-
import { ScbIcon as
|
|
58
|
-
import { ScbNotificationCard as
|
|
59
|
-
import { ScbFormErrorSummary as
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
|
|
104
|
-
import { ensureRippleReady as Pt, syncRippleToControl as Ft } from "./shared/lazy-ripple.js";
|
|
105
|
-
export { x as SCBBreadcrumb, b as SCBBreadcrumbItem, s as ScbAccordion, a as ScbAccordionItem, c as ScbActionCard, _ as ScbAppBar, g as ScbAvatar, v as ScbBadge, o as ScbButton, I as ScbCalendar, L as ScbCalendarCard, S as ScbCalendarEvent, l as ScbCard, O as ScbCheckbox, D as ScbCheckboxGroup, i as ScbChevron, M as ScbChip, R as ScbCollapse, u as ScbContainerCard, z as ScbCookiesConsent, w as ScbDatepicker, N as ScbDialog, C as ScbDivider, B as ScbDrawer, V as ScbDropZone, G as ScbDropdown, K as ScbFab, J as ScbFactCard, q as ScbFactCardContent, $ as ScbFooter, Y as ScbFooterSection, ne as ScbFormErrorSummary, se as ScbGalleryGrid, Q as ScbGrid, X as ScbGridItem, fe as ScbHeader, ce as ScbHeaderMenuGroup, le as ScbHeaderMenuItem, ue as ScbHeaderTab, de as ScbHeaderUtility, ae as ScbHorizontalScroller, ee as ScbIcon, m as ScbIconButton, pe as ScbKeyFigureCard, y as ScbLink, d as ScbLinkCard, F as ScbList, f as ScbListCard, P as ScbListItem, _e as ScbMenu, me as ScbMenuItem, ye as ScbNav, ve as ScbNavItem, te as ScbNotificationCard, W as ScbOptionsMenu, H as ScbOptionsMenuItem, U as ScbOptionsSubMenu, oe as ScbOverlay, be as ScbPagination, Le as ScbPrimaryTab, xe as ScbProgressIndicator, Se as ScbProgressStep, Ce as ScbProgressStepper, A as ScbRadioButton, k as ScbRadioGroup, we as ScbScrollspy, h as ScbSearch, Re as ScbSecondaryTab, Ee as ScbSegmentedButton, Te as ScbSegmentedItem, Oe as ScbSelect, De as ScbSelectOption, ke as ScbSkeleton, Ae as ScbSlider, je as ScbSnackbar, p as ScbSocialCard, Z as ScbStack, Me as ScbStatusPill, Ne as ScbStep, Pe as ScbStepper, ge as ScbSubmenu, j as ScbSwitch, Fe as ScbTable, Ie as ScbTableAdvanced, ze as ScbTabs, E as ScbTextField, Ve as ScbToc, Be as ScbTocItem, T as ScbTooltip, Nt as ScbViz, he as ScbmenuSection, e as addLazyFocusRingListeners, rt as appendScbVizSeriesDifferentiationPatternMarks, He as buildScbVizExportFileName, et as buildScbVizPrintDocumentHtml, tt as buildScbVizPrintableFooterHtml, nt as buildScbVizPrintableTableHtml, Ot as buildScbVizResolvedTableView, lt as clearScbVizSeriesDifferentiationColorClass, ut as clearScbVizSeriesDifferentiationMetadata, Ue as createScbVizCsvBlob, kt as createScbVizCsvRows, We as createScbVizRasterBlobFromElement, Ge as createScbVizRasterDataUrlFromElement, Ke as downloadScbVizBlob, t as ensureFocusRingOnFocusVisible, n as ensureFocusRingOnTab, r as ensureFocusRingReady, Pt as ensureRippleReady, dt as ensureScbVizGroupedSeriesDifferentiationStore, ft as ensureScbVizStyledModeSeriesPattern, qe as getScbVizCurrentFullscreenElement, Je as getScbVizExportBaseFileName, Ye as getScbVizFullscreenDocument, pt as getScbVizGroupedSeriesDifferentiationKey, mt as getScbVizGroupedSeriesDifferentiationVariant, ht as getScbVizGroupedSeriesDifferentiationVariantIndex, gt as getScbVizHighchartsColorClassName, _t as getScbVizHighchartsSvgElement, vt as getScbVizHighchartsSvgRoot, yt as getScbVizLegendSeriesDifferentiationTargets, bt as getScbVizSeriesDifferentiationColorIndex, it as getScbVizSeriesDifferentiationPatternDefinition, at as getScbVizSeriesDifferentiationPatternKinds, ot as getScbVizSeriesDifferentiationRegistry, st as getScbVizSeriesDifferentiationVariant, xt as getScbVizSeriesDifferentiationVariantByIndex, re as hasScbSvgIcon, At as inferScbVizTableAlignments, Xe as isScbVizFullscreenSupported, St as isScbVizGroupedSeriesDifferentiationChart, Ct as isScbVizHighchartsStyledMode, jt as normalizeScbVizRenderableCell, Ze as openScbVizPrintFrame, Mt as readScbVizTableDataFromSlot, ie as renderScbIcon, Qe as runWithScbVizForcedPrintLightMode, ct as scbVizSeriesDifferentiationRegistry, wt as setScbVizSeriesDifferentiationColorClass, Tt as setScbVizSeriesDifferentiationMetadata, Et as shouldShowScbVizSeriesDifferentiationAction, Ft as syncRippleToControl, $e as toggleScbVizFullscreen, Dt as usesScbVizGroupedPointDifferentiation };
|
|
38
|
+
import { ScbCollapse as M } from "./scb-collapse/scb-collapse.js";
|
|
39
|
+
import { ScbCookiesConsent as N } from "./scb-cookies-consent/scb-cookies-consent.js";
|
|
40
|
+
import { ScbDrawer as P } from "./scb-drawer/scb-drawer.js";
|
|
41
|
+
import { ScbDropZone as F } from "./scb-drop-zone/scb-drop-zone.js";
|
|
42
|
+
import { ScbOptionsMenuItem as I } from "./scb-options-menu/scb-options-menu-item.js";
|
|
43
|
+
import { ScbOptionsSubMenu as L } from "./scb-options-menu/scb-options-sub-menu.js";
|
|
44
|
+
import { ScbOptionsMenu as R } from "./scb-options-menu/scb-options-menu.js";
|
|
45
|
+
import { ScbDropdown as z } from "./scb-dropdown/scb-dropdown.js";
|
|
46
|
+
import { ScbFab as B } from "./scb-fab/scb-fab.js";
|
|
47
|
+
import { ScbFactCardContent as V } from "./scb-fact-card/scb-fact-card-content.js";
|
|
48
|
+
import { ScbFactCard as H } from "./scb-fact-card/scb-fact-card.js";
|
|
49
|
+
import { ScbFooterSection as U } from "./scb-footer/scb-footer-section.js";
|
|
50
|
+
import { ScbGridItem as W } from "./scb-grid/scb-grid-item.js";
|
|
51
|
+
import { ScbStack as G } from "./scb-grid/scb-stack.js";
|
|
52
|
+
import { ScbGrid as K } from "./scb-grid/scb-grid.js";
|
|
53
|
+
import { ScbFooter as q } from "./scb-footer/scb-footer.js";
|
|
54
|
+
import { ScbIcon as J } from "./scb-icon/scb-icon.js";
|
|
55
|
+
import { ScbNotificationCard as Y } from "./scb-notification-card/scb-notification-card.js";
|
|
56
|
+
import { ScbFormErrorSummary as X } from "./scb-form-error-summary/scb-form-error-summary.js";
|
|
57
|
+
import { ScbHorizontalScroller as Z } from "./scb-horizontal-scroller/scb-horizontal-scroller.js";
|
|
58
|
+
import { ScbOverlay as Q } from "./scb-overlay/scb-overlay.js";
|
|
59
|
+
import { ScbGalleryGrid as $ } from "./scb-gallery-grid/scb-gallery-grid.js";
|
|
60
|
+
import { ScbHeaderMenuGroup as ee } from "./scb-header/scb-header-menu-group.js";
|
|
61
|
+
import { ScbHeaderMenuItem as te } from "./scb-header/scb-header-menu-item.js";
|
|
62
|
+
import { ScbHeaderTab as ne } from "./scb-header/scb-header-tab.js";
|
|
63
|
+
import { ScbHeaderUtility as re } from "./scb-header/scb-header-utility.js";
|
|
64
|
+
import { ScbHeader as ie } from "./scb-header/scb-header.js";
|
|
65
|
+
import { ScbKeyFigureCard as ae } from "./scb-keyfigure-card/scb-keyfigure-card.js";
|
|
66
|
+
import { ScbMenuItem as oe } from "./scb-menu/scb-menu-item.js";
|
|
67
|
+
import { ScbmenuSection as se } from "./scb-menu/scb-menu-section.js";
|
|
68
|
+
import { ScbSubmenu as ce } from "./scb-menu/scb-sub-menu.js";
|
|
69
|
+
import { ScbMenu as le } from "./scb-menu/scb-menu.js";
|
|
70
|
+
import { ScbNavItem as ue } from "./scb-nav/scb-nav-item.js";
|
|
71
|
+
import { ScbNav as de } from "./scb-nav/scb-nav.js";
|
|
72
|
+
import { ScbPagination as fe } from "./scb-pagination/scb-pagination.js";
|
|
73
|
+
import { ScbProgressIndicator as pe } from "./scb-progress-indicator/scb-progress-indicator.js";
|
|
74
|
+
import { ScbProgressStep as me } from "./scb-progress-stepper/scb-progress-step.js";
|
|
75
|
+
import { ScbProgressStepper as he } from "./scb-progress-stepper/scb-progress-stepper.js";
|
|
76
|
+
import { ScbScrollspy as ge } from "./scb-scrollspy/scb-scrollspy.js";
|
|
77
|
+
import { ScbSegmentedItem as _e } from "./scb-segmented-button/scb-segmented-item.js";
|
|
78
|
+
import { ScbSegmentedButton as ve } from "./scb-segmented-button/scb-segmented-button.js";
|
|
79
|
+
import { ScbSelectOption as ye } from "./scb-select/scb-select-option.js";
|
|
80
|
+
import { ScbSelect as be } from "./scb-select/scb-select.js";
|
|
81
|
+
import { ScbSkeleton as xe } from "./scb-skeleton/scb-skeleton.js";
|
|
82
|
+
import { ScbSlider as Se } from "./scb-slider/scb-slider.js";
|
|
83
|
+
import { ScbSnackbar as Ce } from "./scb-snackbar/scb-snackbar.js";
|
|
84
|
+
import { ScbStatusPill as we } from "./scb-status-pill/scb-status-pill.js";
|
|
85
|
+
import { ScbStep as Te } from "./scb-stepper/scb-step.js";
|
|
86
|
+
import { ScbStepper as Ee } from "./scb-stepper/scb-stepper.js";
|
|
87
|
+
import { ScbTable as De } from "./scb-table/scb-table.js";
|
|
88
|
+
import { ScbTableAdvanced as Oe } from "./scb-table-advanced/scb-table-advanced.js";
|
|
89
|
+
import { ScbPrimaryTab as ke } from "./scb-tabs/scb-primary-tab.js";
|
|
90
|
+
import { ScbSecondaryTab as Ae } from "./scb-tabs/scb-secondary-tab.js";
|
|
91
|
+
import { ScbTabs as je } from "./scb-tabs/scb-tabs.js";
|
|
92
|
+
import { ScbTocItem as Me } from "./scb-toc/scb-toc-item.js";
|
|
93
|
+
import { ScbToc as Ne } from "./scb-toc/scb-toc.js";
|
|
94
|
+
import { buildScbVizExportFileName as Pe, createScbVizCsvBlob as Fe, createScbVizRasterBlobFromElement as Ie, createScbVizRasterDataUrlFromElement as Le, downloadScbVizBlob as Re, getScbVizCurrentFullscreenElement as ze, getScbVizExportBaseFileName as Be, getScbVizFullscreenDocument as Ve, isScbVizFullscreenSupported as He, openScbVizPrintFrame as Ue, runWithScbVizForcedPrintLightMode as We, toggleScbVizFullscreen as Ge } from "./scb-viz/scb-viz-actions-runtime.js";
|
|
95
|
+
import { buildScbVizPrintDocumentHtml as Ke, buildScbVizPrintableFooterHtml as qe, buildScbVizPrintableTableHtml as Je } from "./scb-viz/scb-viz-print-runtime.js";
|
|
96
|
+
import { appendScbVizSeriesDifferentiationPatternMarks as Ye, getScbVizSeriesDifferentiationPatternDefinition as Xe, getScbVizSeriesDifferentiationPatternKinds as Ze, getScbVizSeriesDifferentiationRegistry as Qe, getScbVizSeriesDifferentiationVariant as $e, scbVizSeriesDifferentiationRegistry as et } from "./scb-viz/scb-viz-series-differentiation-registry.js";
|
|
97
|
+
import { clearScbVizSeriesDifferentiationColorClass as tt, clearScbVizSeriesDifferentiationMetadata as nt, ensureScbVizGroupedSeriesDifferentiationStore as rt, ensureScbVizStyledModeSeriesPattern as it, getScbVizGroupedSeriesDifferentiationKey as at, getScbVizGroupedSeriesDifferentiationVariant as ot, getScbVizGroupedSeriesDifferentiationVariantIndex as st, getScbVizHighchartsColorClassName as ct, getScbVizHighchartsSvgElement as lt, getScbVizHighchartsSvgRoot as ut, getScbVizLegendSeriesDifferentiationTargets as dt, getScbVizSeriesDifferentiationColorIndex as ft, getScbVizSeriesDifferentiationVariantByIndex as pt, isScbVizGroupedSeriesDifferentiationChart as mt, isScbVizHighchartsStyledMode as ht, setScbVizSeriesDifferentiationColorClass as gt, setScbVizSeriesDifferentiationMetadata as _t, shouldShowScbVizSeriesDifferentiationAction as vt, usesScbVizGroupedPointDifferentiation as yt } from "./scb-viz/scb-viz-series-differentiation-runtime.js";
|
|
98
|
+
import { buildScbVizResolvedTableView as bt, createScbVizCsvRows as xt, inferScbVizTableAlignments as St, normalizeScbVizRenderableCell as Ct, readScbVizTableDataFromSlot as wt } from "./scb-viz/scb-viz-table-runtime.js";
|
|
99
|
+
import { ScbViz as Tt } from "./scb-viz/scb-viz.js";
|
|
100
|
+
export { g as SCBBreadcrumb, h as SCBBreadcrumbItem, n as ScbAccordion, e as ScbAccordionItem, r as ScbActionCard, f as ScbAppBar, d as ScbAvatar, p as ScbBadge, t as ScbButton, A as ScbCalendar, j as ScbCalendarCard, _ as ScbCalendarEvent, i as ScbCard, S as ScbCheckbox, x as ScbCheckboxGroup, E as ScbChip, M as ScbCollapse, a as ScbContainerCard, N as ScbCookiesConsent, D as ScbDialog, v as ScbDivider, P as ScbDrawer, F as ScbDropZone, z as ScbDropdown, B as ScbFab, H as ScbFactCard, V as ScbFactCardContent, q as ScbFooter, U as ScbFooterSection, X as ScbFormErrorSummary, $ as ScbGalleryGrid, K as ScbGrid, W as ScbGridItem, ie as ScbHeader, ee as ScbHeaderMenuGroup, te as ScbHeaderMenuItem, ne as ScbHeaderTab, re as ScbHeaderUtility, Z as ScbHorizontalScroller, J as ScbIcon, l as ScbIconButton, ae as ScbKeyFigureCard, m as ScbLink, o as ScbLinkCard, k as ScbList, s as ScbListCard, O as ScbListItem, le as ScbMenu, oe as ScbMenuItem, de as ScbNav, ue as ScbNavItem, Y as ScbNotificationCard, R as ScbOptionsMenu, I as ScbOptionsMenuItem, L as ScbOptionsSubMenu, Q as ScbOverlay, fe as ScbPagination, ke as ScbPrimaryTab, pe as ScbProgressIndicator, me as ScbProgressStep, he as ScbProgressStepper, w as ScbRadioButton, C as ScbRadioGroup, ge as ScbScrollspy, u as ScbSearch, Ae as ScbSecondaryTab, ve as ScbSegmentedButton, _e as ScbSegmentedItem, be as ScbSelect, ye as ScbSelectOption, xe as ScbSkeleton, Se as ScbSlider, Ce as ScbSnackbar, c as ScbSocialCard, G as ScbStack, we as ScbStatusPill, Te as ScbStep, Ee as ScbStepper, ce as ScbSubmenu, T as ScbSwitch, De as ScbTable, Oe as ScbTableAdvanced, je as ScbTabs, b as ScbTextField, Ne as ScbToc, Me as ScbTocItem, y as ScbTooltip, Tt as ScbViz, se as ScbmenuSection, Ye as appendScbVizSeriesDifferentiationPatternMarks, Pe as buildScbVizExportFileName, Ke as buildScbVizPrintDocumentHtml, qe as buildScbVizPrintableFooterHtml, Je as buildScbVizPrintableTableHtml, bt as buildScbVizResolvedTableView, tt as clearScbVizSeriesDifferentiationColorClass, nt as clearScbVizSeriesDifferentiationMetadata, Fe as createScbVizCsvBlob, xt as createScbVizCsvRows, Ie as createScbVizRasterBlobFromElement, Le as createScbVizRasterDataUrlFromElement, Re as downloadScbVizBlob, rt as ensureScbVizGroupedSeriesDifferentiationStore, it as ensureScbVizStyledModeSeriesPattern, ze as getScbVizCurrentFullscreenElement, Be as getScbVizExportBaseFileName, Ve as getScbVizFullscreenDocument, at as getScbVizGroupedSeriesDifferentiationKey, ot as getScbVizGroupedSeriesDifferentiationVariant, st as getScbVizGroupedSeriesDifferentiationVariantIndex, ct as getScbVizHighchartsColorClassName, lt as getScbVizHighchartsSvgElement, ut as getScbVizHighchartsSvgRoot, dt as getScbVizLegendSeriesDifferentiationTargets, ft as getScbVizSeriesDifferentiationColorIndex, Xe as getScbVizSeriesDifferentiationPatternDefinition, Ze as getScbVizSeriesDifferentiationPatternKinds, Qe as getScbVizSeriesDifferentiationRegistry, $e as getScbVizSeriesDifferentiationVariant, pt as getScbVizSeriesDifferentiationVariantByIndex, St as inferScbVizTableAlignments, He as isScbVizFullscreenSupported, mt as isScbVizGroupedSeriesDifferentiationChart, ht as isScbVizHighchartsStyledMode, Ct as normalizeScbVizRenderableCell, Ue as openScbVizPrintFrame, wt as readScbVizTableDataFromSlot, We as runWithScbVizForcedPrintLightMode, et as scbVizSeriesDifferentiationRegistry, gt as setScbVizSeriesDifferentiationColorClass, _t as setScbVizSeriesDifferentiationMetadata, vt as shouldShowScbVizSeriesDifferentiationAction, Ge as toggleScbVizFullscreen, yt as usesScbVizGroupedPointDifferentiation };
|
package/mvc/components/all.js
CHANGED
|
@@ -18,12 +18,10 @@ import './scb-card/scb-list-card.js';
|
|
|
18
18
|
import './scb-card/scb-social-card.js';
|
|
19
19
|
import './scb-checkbox/scb-checkbox.js';
|
|
20
20
|
import './scb-checkbox/scb-checkbox-group.js';
|
|
21
|
-
import './scb-chevron/scb-chevron.js';
|
|
22
21
|
import './scb-chip/scb-chip.js';
|
|
23
22
|
import './scb-collapse/scb-collapse.js';
|
|
24
23
|
import './scb-container-card/scb-container-card.js';
|
|
25
24
|
import './scb-cookies-consent/scb-cookies-consent.js';
|
|
26
|
-
import './scb-datepicker/scb-datepicker.js';
|
|
27
25
|
import './scb-dialog/scb-dialog.js';
|
|
28
26
|
import './scb-divider/scb-divider.js';
|
|
29
27
|
import './scb-drawer/scb-drawer.js';
|
|
@@ -99,6 +97,3 @@ import './scb-viz/scb-viz-print-runtime.js';
|
|
|
99
97
|
import './scb-viz/scb-viz-series-differentiation-registry.js';
|
|
100
98
|
import './scb-viz/scb-viz-series-differentiation-runtime.js';
|
|
101
99
|
import './scb-viz/scb-viz-table-runtime.js';
|
|
102
|
-
import './shared/lazy-focus-ring.js';
|
|
103
|
-
import './shared/lazy-ripple.js';
|
|
104
|
-
import './shared/scb-icon-svg.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as l,h as m,m as b,p as o,v as s,y as h}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{
|
|
1
|
+
import{g as l,h as m,m as b,p as o,v as s,y as h}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{n as u}from"../../vendor/lazy-focus-ring.js";import{t as r}from"../../vendor/decorate.js";import"../../vendor/scb-chevron.js";(function(){try{var g=typeof globalThis<"u"?globalThis:window;if(!g.__scb_ce_guard_installed__){g.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(t,e,v){try{customElements.get(t)||i(t,e,v)}catch(c){var n=String(c||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var d,p,a=(d=class extends m{constructor(...i){super(...i),this.open=!1,this.title="",this.content="",this.overline="",this.supportingText="",this.leading=!1,this.leadingVariant="",this.leadingIcon="",this.imgHrefImage="",this.avatarLabel="",this.avatarAlt="",this.avatarVariant="icon",this.avatarSrc="",this.density=0,this._unique=p._uid(),this._ignoreNextNativeTitleAttrChange=!1,this._onSummaryClick=t=>{t.preventDefault();const e=!this.open;this.closest("scb-accordion")?.onItemToggled?.(this,e),this.setOpen(e)},this._onToggle=t=>{const e=t.currentTarget;e.open||(e.open=!0),this._applyInertByOpen()}}static _uid(){return globalThis.crypto?.randomUUID?.()??`${p._uidPrefix}-${++p._uidSeq}`}static get observedAttributes(){const i=super.observedAttributes||[];return i.includes("title")?i:[...i,"title"]}attributeChangedCallback(i,t,e){if(i==="title"&&this._ignoreNextNativeTitleAttrChange){this._ignoreNextNativeTitleAttrChange=!1;return}super.attributeChangedCallback(i,t,e),i==="title"&&e!==null&&(this._ignoreNextNativeTitleAttrChange=!0,this.removeAttribute("title"))}firstUpdated(){this._applyInertByOpen()}_applyInertByOpen(){const i=this.renderRoot.querySelector(".scb-accordion-bottom");i&&(this.open?(i.removeAttribute("inert"),i.setAttribute("aria-hidden","false")):(i.setAttribute("inert",""),i.setAttribute("aria-hidden","true")))}_onKeyDown(i){const t=this.closest("scb-accordion"),e=Array.from(t?.querySelectorAll("scb-accordion-item")||[]).map(c=>c.renderRoot.querySelector("details")?.querySelector(".scb-accordion-top")||null).filter(c=>!!c),v=i.currentTarget,n=e.indexOf(v);switch(i.key){case"ArrowDown":i.preventDefault(),n<e.length-1&&e[n+1].focus();break;case"ArrowUp":i.preventDefault(),n>0&&e[n-1].focus();break;case"Home":i.preventDefault(),e.length&&e[0].focus();break;case"End":i.preventDefault(),e.length&&e[e.length-1].focus();break}}setOpen(i){this.open=!!i;const t=this.renderRoot.querySelector("details");t&&!t.open&&(t.open=!0),this._applyInertByOpen()}updated(i){if(i.has("open")){const t=this.renderRoot.querySelector("details");t&&!t.open&&(t.open=!0),this._applyInertByOpen(),this.dispatchEvent(new CustomEvent("open-changed",{detail:{open:this.open,title:this.title},bubbles:!0,composed:!0}))}}render(){const i=`bottom-${this._unique}`,t=`header-${this._unique}`,e=this.leading?this.leadingVariant==="image"&&this.imgHrefImage?s`<img part="leading-image" class="img" src="${this.imgHrefImage}" alt="" />`:this.leadingVariant==="avatar"?s`
|
|
2
2
|
<scb-avatar
|
|
3
3
|
label=${this.avatarLabel}
|
|
4
4
|
alt=${this.avatarAlt}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["
|
|
2
|
-
import{g as s,h as z,m as N,p as o,v as c,y as w}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as x}from"../../vendor/preload-helper.js";import{t as a}from"../../vendor/decorate.js";import{n as P,t as k}from"../../vendor/assertClassBrand.js";(function(){try{var
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/lazy-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/preload-helper.js","../../vendor/lazy-ripple.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{g as s,h as z,m as N,p as o,v as c,y as w}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as x}from"../../vendor/preload-helper.js";import{t as a}from"../../vendor/decorate.js";import{n as P,t as k}from"../../vendor/assertClassBrand.js";(function(){try{var p=typeof globalThis<"u"?globalThis:window;if(!p.__scb_ce_guard_installed__){p.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,i,r){try{customElements.get(e)||t(e,i,r)}catch(b){var l=String(b||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw b}}}}catch{}})();var h,f,m;function $(){return f??(f=x(()=>import("../../vendor/lazy-focus-ring.js").then(p=>p.i),__vite__mapDeps([0,1,2]),import.meta.url)),f}function R(){return m??(m=x(()=>import("../../vendor/lazy-ripple.js"),__vite__mapDeps([3,2]),import.meta.url)),m}var n=(h=new WeakSet,class extends z{constructor(...t){super(...t),P(this,h),this.variant="filled",this.size="medium",this.type="button",this.label="Button",this.trailingIcon=!1,this.icon="",this.iconFilled=!1,this.disabled=!1,this.fullWidth=!1,this.href="",this.target="",this.rel="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__hasDefaultSlotContent=!1,this.__nativeFocusRingReady=!1,this.__nativeRippleReady=!1,this.__nativeRipplePendingClick=!1,this.__ensureNativeFocusRing=()=>{this.__nativeFocusRingReady||$().then(({ensureFocusRingReady:e})=>(e(),customElements.whenDefined("md-focus-ring"))).then(()=>{this.__nativeFocusRingReady=!0,this.toggleAttribute("data-native-focus-ring-ready",!0),this.requestUpdate(),this.updateComplete.then(()=>this.__syncNativeFocusRingControl())})},this.__onNativeFocusIn=e=>{const i=e.composedPath()[0];i instanceof HTMLElement&&i.matches(":focus-visible")&&this.__ensureNativeFocusRing()},this.__ensureNativeRipple=e=>{this.__nativeRippleReady||this.disabled||(e&&(this.__nativeRipplePendingPointerEvent=e),R().then(({ensureRippleReady:i})=>i()).then(()=>{this.disabled||(this.__nativeRippleReady=!0,this.requestUpdate(),this.updateComplete.then(()=>{this.__syncNativeFocusRingControl(),this.__replayNativeRippleState()}))}))},this.__onNativePointerWarmup=e=>{this.__ensureNativeRipple(e)},this.__onNativeClick=e=>{if(this.disabled){e.preventDefault(),e.stopPropagation();return}(!this.__nativeRippleReady||this.__nativeRipplePendingPointerEvent)&&(this.__nativeRipplePendingClick=!0,this.__ensureNativeRipple())}}__getNativeControl(){return this.renderRoot.querySelector(".native-button")}__handleDefaultSlotChange(t){const e=t.target.assignedNodes({flatten:!0}).some(i=>i.nodeType===Node.TEXT_NODE?!!i.textContent?.trim():i.nodeType===Node.ELEMENT_NODE);this.__hasDefaultSlotContent!==e&&(this.__hasDefaultSlotContent=e,this.requestUpdate()),this.updateComplete.then(()=>this.__syncAriaToInner())}__syncAriaToInner(){const t=this.__getNativeControl();t&&this.__syncAriaToControl(t)}__syncAriaToControl(t){const e=(this.getAttribute("aria-label")||"").trim(),i=this.label.trim()===""&&!this.__hasDefaultSlotContent?(this.icon||"").trim():"",r=e||i;r?t.setAttribute("aria-label",r):t.removeAttribute("aria-label");const l=this.getAttribute("aria-controls");l!==null?t.setAttribute("aria-controls",l):t.removeAttribute("aria-controls");const b=this.getAttribute("aria-haspopup");b!==null?t.setAttribute("aria-haspopup",b):t.removeAttribute("aria-haspopup");const _=this.getAttribute("aria-expanded");_!==null?t.setAttribute("aria-expanded",_):t.removeAttribute("aria-expanded"),this.__ariaObserver?.disconnect(),this.__ariaObserver=new MutationObserver(S=>{const d=this.__getNativeControl();if(d)for(const v of S){if(v.type!=="attributes"||!v.attributeName)continue;const u=v.attributeName,g=this.getAttribute(u);if(u==="aria-label"){const y=(g||(this.label.trim()===""&&!this.__hasDefaultSlotContent?(this.icon||"").trim():"")).trim();y?d.setAttribute("aria-label",y):d.removeAttribute("aria-label")}else(u==="aria-controls"||u==="aria-expanded"||u==="aria-haspopup")&&(g===null?d.removeAttribute(u):d.setAttribute(u,g))}}),this.__ariaObserver.observe(this,{attributes:!0,attributeFilter:["aria-label","aria-controls","aria-expanded","aria-haspopup"]})}connectedCallback(){super.connectedCallback()}focus(t){const e=this.__getNativeControl();if(e){e.focus(t);return}this.updateComplete.then(()=>this.__getNativeControl()?.focus(t))}blur(){this.__getNativeControl()?.blur()}firstUpdated(){(this.type==="submit"||this.type==="reset")&&this.addEventListener("click",()=>{if(!this.disabled){const t=this.closest("form");t&&(this.type==="submit"&&t.requestSubmit(),this.type==="reset"&&t.reset())}}),k(h,this,C).call(this)}updated(t){(t.has("variant")||t.has("label")||t.has("icon")||t.has("href"))&&this.updateComplete.then(()=>this.__syncAriaToInner()),(this.__nativeFocusRingReady||this.__nativeRippleReady)&&this.updateComplete.then(()=>this.__syncNativeFocusRingControl()),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&k(h,this,C).call(this)}disconnectedCallback(){this.__ariaObserver?.disconnect(),super.disconnectedCallback()}__syncNativeFocusRingControl(){const t=this.renderRoot.querySelector("md-focus-ring"),e=this.__getNativeControl();t&&e&&(t.control=e,t.visible=e.matches(":focus-visible"));const i=this.renderRoot.querySelector("md-ripple");i&&e&&(i.control=e)}async __replayNativeRippleState(){const t=this.renderRoot.querySelector("md-ripple"),e=this.__getNativeControl(),i=this.__nativeRipplePendingPointerEvent,r=this.__nativeRipplePendingClick;this.__nativeRipplePendingPointerEvent=void 0,this.__nativeRipplePendingClick=!1;const{syncRippleToControl:l}=await R();await l(t,e,i,r)}mapSpacingToken(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}static get styles(){return w`:host{display:inline-flex;block-size:var(--scb-button-block-size, auto);margin-block-start:var(--scb-button-spacing-block-start, 0);margin-block-end:var(--scb-button-spacing-block-end, 0);margin-inline-start:var(--scb-button-spacing-inline-start, 0);margin-inline-end:var(--scb-button-spacing-inline-end, 0);--scb-button-font-variation-settings:'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;--scb-button-padding-block:calc(var(--spacing-5) - var(--spacing-1));--scb-button-label-text-line-height:var(--md-sys-typescale-label-small-line-height);--scb-button-container-height:calc(
|
|
3
3
|
var(--scb-button-label-text-line-height) + var(--scb-button-padding-block) + var(--scb-button-padding-block)
|
|
4
4
|
);--scb-button-padding-inline:var(--spacing-5);--scb-button-icon-edge-space:var(--spacing-5);--scb-button-icon-gap:var(--spacing-3);--scb-button-icon-size:var(--icon-size-small, 20px)}:host([size='extra-small']),:host([size='small']){--scb-button-padding-inline:var(--spacing-4);--scb-button-icon-edge-space:var(--spacing-4);--scb-button-icon-gap:var(--spacing-2);--scb-button-icon-size:var(--icon-size-small, 20px)}:host([size='extra-small']){--scb-button-padding-block:calc(var(--spacing-3) - var(--spacing-1))}:host([size='small']){--scb-button-padding-block:calc(var(--spacing-4) - var(--spacing-1))}:host([size='large']){--scb-button-padding-block:var(--spacing-5);--scb-button-label-text-line-height:var(--md-sys-typescale-label-medium-line-height);--scb-button-padding-inline:var(--spacing-7);--scb-button-icon-edge-space:var(--spacing-7);--scb-button-icon-gap:var(--spacing-3);--scb-button-icon-size:var(--icon-size-medium, 24px)}:host([icon-filled]){--scb-button-font-variation-settings:'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24}.native-button,.native-button-wrap{position:relative;display:inline-flex}.native-button-wrap{border-radius:var(--md-sys-shape-corner-full, 999px)}.native-button{z-index:0;box-sizing:border-box;align-items:center;justify-content:center;gap:var(--scb-button-icon-gap);min-block-size:var(--scb-button-block-size, var(--scb-button-container-height));block-size:var(--scb-button-block-size, var(--scb-button-container-height));min-inline-size:64px;inline-size:auto;padding-block:var(--scb-button-padding-block);padding-inline:var(--scb-button-padding-inline);overflow:hidden;border:0;border-radius:inherit;background:0 0;color:var(--md-sys-color-primary);font-family:var(--md-sys-typescale-label-small-font);font-size:var(--md-sys-typescale-label-small-size);font-weight:var(--md-sys-typescale-label-small-weight);line-height:var(--md-sys-typescale-label-small-line-height);letter-spacing:normal;text-align:center;text-decoration:none;white-space:nowrap;cursor:pointer;appearance:none;-webkit-appearance:none;touch-action:manipulation}::slotted(*){display:inline!important;margin:0!important;color:inherit!important;font:inherit!important;letter-spacing:inherit!important;line-height:inherit!important}.native-button::before{content:"";position:absolute;inset:0;z-index:-1;background:currentColor;opacity:0;pointer-events:none;transition:opacity var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease)}.native-button:hover::before{opacity:var(--md-sys-state-hover-state-layer-opacity, 0.08)}.native-button:active::before{opacity:var(--md-sys-state-pressed-state-layer-opacity, 0.12)}.native-button:focus{outline:0}:host(:not([data-native-focus-ring-ready])) .native-button:focus-visible{outline:var(--stroke-border-m, 2px) solid var(--md-sys-color-primary);outline-offset:var(--spacing-1, 2px)}.native-button:disabled,.native-button[aria-disabled=true]{color:rgb(15 8 101/38%);cursor:default;opacity:1;pointer-events:none}:host(:not([variant])) .native-button,:host([variant='filled']) .native-button{border-color:transparent;background:var(--md-sys-color-primary);color:var(--md-sys-color-on-primary)}:host([variant='outlined']) .native-button{background:0 0;color:var(--md-sys-color-primary);box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--md-sys-color-outline)}:host([variant='outlined']) .native-button:disabled,:host([variant='outlined']) .native-button[aria-disabled=true]{color:rgb(15 8 101/38%);box-shadow:inset 0 0 0 var(--stroke-border, 1px) rgb(15 8 101/12%)}:host([variant='filled-tonal']) .native-button{border-color:transparent;background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container)}:host(:not([variant])) .native-button:disabled,:host(:not([variant])) .native-button[aria-disabled=true],:host([variant='filled']) .native-button:disabled,:host([variant='filled']) .native-button[aria-disabled=true],:host([variant='filled-tonal']) .native-button:disabled,:host([variant='filled-tonal']) .native-button[aria-disabled=true]{background:rgb(15 8 101/12%);color:rgb(15 8 101/38%)}:host([variant='text']) .native-button{min-inline-size:0;background:0 0;color:var(--md-sys-color-primary)}:host([variant='text']) .native-button:disabled,:host([variant='text']) .native-button[aria-disabled=true]{color:rgb(15 8 101/38%)}:host([size='large']) .native-button{font-family:var(--md-sys-typescale-label-medium-font);font-size:var(--md-sys-typescale-label-medium-size);font-weight:var(--md-sys-typescale-label-medium-weight);line-height:var(--md-sys-typescale-label-medium-line-height);letter-spacing:normal}.native-icon{flex:0 0 auto;display:inline-block;inline-size:var(--scb-button-icon-size);block-size:var(--scb-button-icon-size);overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--scb-button-icon-size);line-height:1;text-align:center;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-feature-settings:"liga"1;font-variation-settings:var(--scb-button-font-variation-settings);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.native-icon.scb-svg-icon{fill:currentColor;font:inherit}.native-button-wrap md-ripple{position:absolute;inset:0;border-radius:inherit;pointer-events:none}.native-button-wrap md-focus-ring{pointer-events:none}:host([full-width]){display:flex;inline-size:100%}:host([full-width]) .native-button,:host([full-width]) .native-button-wrap{inline-size:100%;flex:1 1 auto}`}render(){const t=!!this.icon?.trim(),e=t?c`<span class="native-icon" part="icon" aria-hidden="true">${this.icon}</span>`:s,i=this.label.trim()===""&&!this.__hasDefaultSlotContent?this.icon:void 0,r=c`
|
|
5
5
|
<slot
|
|
@@ -48,4 +48,4 @@ import{g as s,h as z,m as N,p as o,v as c,y as w}from"../../vendor/vendor.js";im
|
|
|
48
48
|
${this.__nativeRippleReady?c`<md-ripple aria-hidden="true"></md-ripple>`:s}
|
|
49
49
|
${this.__nativeFocusRingReady?c`<md-focus-ring aria-hidden="true"></md-focus-ring>`:s}
|
|
50
50
|
</span>
|
|
51
|
-
`}});function C(){const
|
|
51
|
+
`}});function C(){const p=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??p,e=this.mapSpacingToken(this.spacingBottom)??p,i=this.mapSpacingToken(this.spacingLeft),r=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-button-spacing-block-start",t):this.style.removeProperty("--scb-button-spacing-block-start"),e?this.style.setProperty("--scb-button-spacing-block-end",e):this.style.removeProperty("--scb-button-spacing-block-end"),i?this.style.setProperty("--scb-button-spacing-inline-start",i):this.style.removeProperty("--scb-button-spacing-inline-start"),r?this.style.setProperty("--scb-button-spacing-inline-end",r):this.style.removeProperty("--scb-button-spacing-inline-end")}a([o({type:String,reflect:!0})],n.prototype,"variant",void 0);a([o({type:String,reflect:!0})],n.prototype,"size",void 0);a([o({type:String,reflect:!0})],n.prototype,"type",void 0);a([o({type:String})],n.prototype,"label",void 0);a([o({type:Boolean,attribute:"trailing-icon"})],n.prototype,"trailingIcon",void 0);a([o({type:String})],n.prototype,"icon",void 0);a([o({type:Boolean,attribute:"icon-filled",reflect:!0})],n.prototype,"iconFilled",void 0);a([o({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0);a([o({type:Boolean,attribute:"full-width",reflect:!0})],n.prototype,"fullWidth",void 0);a([o({type:String})],n.prototype,"href",void 0);a([o({type:String})],n.prototype,"target",void 0);a([o({type:String})],n.prototype,"rel",void 0);a([o({type:String,reflect:!0})],n.prototype,"spacing",void 0);a([o({type:String,attribute:"spacing-top",reflect:!0})],n.prototype,"spacingTop",void 0);a([o({type:String,attribute:"spacing-bottom",reflect:!0})],n.prototype,"spacingBottom",void 0);a([o({type:String,attribute:"spacing-left",reflect:!0})],n.prototype,"spacingLeft",void 0);a([o({type:String,attribute:"spacing-right",reflect:!0})],n.prototype,"spacingRight",void 0);n=a([N("scb-button")],n);export{n as ScbButton};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as J,h as W,m as B,p as _,v as E,y as P}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{addLazyFocusRingListeners as U}from"../shared/lazy-focus-ring.js";import{t as v}from"../../vendor/decorate.js";import{n as G,t as H}from"../../vendor/assertClassBrand.js";import"../scb-icon-button/scb-icon-button.js";import"./scb-calendar-event.js";import"../scb-dialog/scb-dialog.js";import"../scb-list/scb-list.js";(function(){try{var $=typeof globalThis<"u"?globalThis:window;if(!$.__scb_ce_guard_installed__){$.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,n){try{customElements.get(e)||t(e,s,n)}catch(a){var i=String(a||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var L,O,q={fromAttribute($){if($===null)return!1;const t=$.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!=="no"}},f=(L=new WeakSet,O=class extends W{constructor(...t){super(...t),G(this,L),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this.eventsJson=void 0,this._eventsFromJson=null,this._eventsJsonLast=void 0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=e=>{const s=Array.from(this.shadowRoot?.querySelectorAll(".calendar-day.has-event")??[]),n=this.shadowRoot?.activeElement,i=n&&s.includes(n)?n:document.activeElement,a=s.indexOf(i);if(a===-1)return;let d=a;const o=this.disableWeekend?5:7;switch(e.key){case"ArrowRight":d=a+1<s.length?a+1:a;break;case"ArrowLeft":d=a-1>=0?a-1:a;break;case"ArrowDown":d=a+o<s.length?a+o:a;break;case"ArrowUp":d=a-o>=0?a-o:a;break;case"Home":d=0;break;case"End":d=s.length-1;break;default:return}d!==a&&(e.preventDefault(),s[d].focus())},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._popupEvent=null,this._handleDialogClose=()=>{this._popupEvent=null,this.requestUpdate(),this._restoreDayFocus()},this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{this._lastActiveDay?.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}get value(){return this.selectedDate}set value(t){const e=(t??"")+"";e!==this.selectedDate&&(this.selectedDate=e)}static get observedAttributes(){return[...super.observedAttributes??[],"value"]}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),t==="value"&&(this.value=s??"")}connectedCallback(){super.connectedCallback(),this._removeLazyFocusRingListeners=U(this,this.renderRoot),H(L,this,K).call(this);const t=Number(this.displayYear),e=Number(this.displayMonth);!Number.isNaN(t)&&!Number.isNaN(e)&&e>=1&&e<=12&&(this._current=new Date(t,e-1,1)),this._syncDisplayFromCurrent(!1),this.addEventListener("change",this._onEventChanged),this._mutationObserver=new MutationObserver(()=>{this.requestUpdate()}),this._mutationObserver.observe(this,{childList:!0}),this.addEventListener("keydown",this._onCalendarKeyDown)}disconnectedCallback(){this.removeEventListener("change",this._onEventChanged),this._removeLazyFocusRingListeners?.(),this._removeLazyFocusRingListeners=void 0,super.disconnectedCallback(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null),this.removeEventListener("keydown",this._onCalendarKeyDown)}mapSpacingToken(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}updated(t){if(super.updated?.(t),t.has("eventsJson")&&(this._eventsJsonLast=void 0,this._eventsFromJson=null),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&H(L,this,K).call(this),!this._syncingDisplay&&(t.has("displayYear")||t.has("displayMonth"))){const e=Number(this.displayYear),s=Number(this.displayMonth);if(!Number.isNaN(e)&&!Number.isNaN(s)&&s>=1&&s<=12){const n=this._current.getFullYear(),i=this._current.getMonth()+1;(n!==e||i!==s)&&(this._current=new Date(e,s-1,1),this._dispatchMonthChange(e,s),this.requestUpdate())}}}_ensureEventsFromJson(){const t=(this.eventsJson??"").trim();if(!t){this._eventsFromJson=null,this._eventsJsonLast=t;return}if(!(this._eventsJsonLast===t&&this._eventsFromJson!==null)){this._eventsJsonLast=t;try{const e=JSON.parse(t);Array.isArray(e)?this._eventsFromJson=e:this._eventsFromJson=[]}catch{this._eventsFromJson=[]}}}_getEventInputs(){return Array.isArray(this.events)?this.events:(this._ensureEventsFromJson(),this._eventsFromJson!==null?this._eventsFromJson:null)}_normalizeEventInput(t){const e=t.title??"",s=t.description??"",n=t.href??"",i=t.startDate??t["start-date"]??t.start??t.date??"",a=t.endDate??t["end-date"]??t.end??"";return{title:e+"",description:s?s+"":void 0,href:n?n+"":void 0,start:i?i+"":void 0,end:a?a+"":void 0}}_toLocalEventDate(t,e){const s=(t??"").trim();if(!s)return null;if(!s.includes("T")){const i=s.split("-").map(c=>Number(c));if(i.length!==3||i.some(c=>Number.isNaN(c)))return null;const[a,d,o]=i;return e?new Date(a,d-1,o,23,59,59,999):new Date(a,d-1,o,0,0,0,0)}const n=new Date(s);return Number.isNaN(n.getTime())?null:n}_toDateKey(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}_buildEventMapFromInputs(t){const e=new Map;for(const s of t){const n=this._normalizeEventInput(s),i=n.start||"",a=n.end||"";if(!(!i||!n.title))if(i&&a){const d=this._toLocalEventDate(i,!1),o=this._toLocalEventDate(a,!0);if(!d||!o)continue;if(o<d){const c=i.split("T")[0],u=e.get(c)||[];u.push({title:n.title,description:n.description,href:n.href,start:i,end:a}),e.set(c,u);continue}for(let c=new Date(d);c<=o;c.setDate(c.getDate()+1)){const u=this._toDateKey(c),k=e.get(u)||[];k.push({title:n.title,description:n.description,href:n.href,start:i,end:a}),e.set(u,k)}}else{const d=i.split("T")[0],o=e.get(d)||[];o.push({title:n.title,description:n.description,href:n.href,start:i}),e.set(d,o)}}return e}_buildEventMapFromChildren(){const t=Array.from(this.querySelectorAll("scb-calendar-event")),e=new Map;for(const s of t){const n=s,i=(n.startDate??n.date??"")+""||s.getAttribute("start-date")||s.getAttribute("date")||"",a=(n.endDate??"")+""||s.getAttribute("end-date")||"";if(i&&a){const d=this._toLocalEventDate(i,!1),o=this._toLocalEventDate(a,!0);if(!d||!o)continue;if(o<d){const c=i.split("T")[0],u=e.get(c)||[];u.push({title:s.title??"",description:s.description,href:n.href||s.getAttribute("href")||void 0,start:i,end:a}),e.set(c,u);continue}for(let c=new Date(d);c<=o;c.setDate(c.getDate()+1)){const u=this._toDateKey(c),k=e.get(u)||[];k.push({title:s.title??"",description:s.description,href:n.href||s.getAttribute("href")||void 0,start:i,end:a}),e.set(u,k)}}else if(i&&s.title){const d=i.split("T")[0],o=e.get(d)||[];o.push({title:s.title,description:s.description,href:n.href||s.getAttribute("href")||void 0,start:i}),e.set(d,o)}}return e}_syncDisplayFromCurrent(t=!0){const e=this._current.getFullYear(),s=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=e,this.displayMonth=s}finally{this._syncingDisplay=!1}t&&this._dispatchMonthChange(e,s)}_dispatchMonthChange(t,e){const s={displayYear:t,displayMonth:e};this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:s})),this.dispatchEvent(new CustomEvent("scbcalendarmonthchange",{bubbles:!0,composed:!0,detail:s}))}_dispatchSelect(t){const e={selectedDate:t};this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:e})),this.dispatchEvent(new CustomEvent("scbcalendarselect",{bubbles:!0,composed:!0,detail:e}))}_formatDayLabel(t){return new Intl.DateTimeFormat(this.lang==="en"?"en-GB":"sv-SE",{day:"numeric",month:"long",year:"numeric"}).format(t)}_formatDayAriaLabel(t,e,s){const n=s.map(a=>`${a.prefix||""}${a.title}`.trim()).filter(Boolean),i=[this._formatDayLabel(t)];return e&&i.push(e),n.length===1?i.push(this.lang==="en"?`1 event: ${n[0]}`:`1 händelse: ${n[0]}`):n.length>1&&i.push(this.lang==="en"?`${n.length} events: ${n.join(", ")}`:`${n.length} händelser: ${n.join(", ")}`),i.join(". ")}_daysInMonth(t,e){return new Date(t,e+1,0).getDate()}_firstDayOfWeek(t,e){const s=new Date(t,e,1).getDay();return s===0?6:s-1}_prevMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()-1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_nextMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()+1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_showEventPopup(t){this._popupEvent=t,this.selectedDate=t.date,this._dispatchSelect(t.date),this._lastActiveDay=this.shadowRoot?.activeElement||document.activeElement,this.requestUpdate(),this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelector("scb-dialog");e&&(document.activeElement&&(e.__lastTriggerEl=document.activeElement),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.open=!0})}),e.addEventListener("close",this._handleDialogClose,{once:!0}))})}_addDays(t,e){const s=new Date(t.valueOf());return s.setDate(s.getDate()+e),s}_easterDay(t){if(typeof this._easterDateCalculated["Ar"+t]<"u")return new Date(this._easterDateCalculated["Ar"+t]);let e=t;e<100&&(e=e+1900),e<1950&&(e=e+100);const s=e%19,n=e%4,i=e%7,a=(19*s+24)%30,d=(2*n+4*i+6*a+5)%7;let o=22+a+d,c=0;o==57&&(o-=7),o==56&&a==28&&d==6&&s>10&&(o-=7),o>31?(o-=31,c=4):c=3;const u=new Date(e,c-1,o);return this._easterDateCalculated["Ar"+t]=u,new Date(this._easterDateCalculated["Ar"+t])}_swedishHolidayName(t){const e=t.getMonth();if(e===1||e===6||e===7||e===8)return null;const s=t.getMonth()+1,n=t.getDate(),i=t.getFullYear(),a=this._easterDay(i),d=this.lang==="en",o=[["Nyårsdagen","New Year's Day",s===1&&n===1],["Trettondedag jul","Epiphany",s===1&&n===6],["Långfredag","Good Friday",+t==+this._addDays(a,-2)],["Påskdagen","Easter Sunday",+t==+a],["Annandag påsk","Easter Monday",+t==+this._addDays(a,1)],["Kristi himmelsfärdsdag","Ascension Day",+t==+this._addDays(a,39)],["Pingstdagen","Pentecost",+t==+this._addDays(a,50)&&i<2005],["Första maj","May Day",s===5&&n===1],["Nationaldagen","National Day",s===6&&n===6&&i>=2005],["Midsommarafton","Midsummer's Eve",s===6&&n>=19&&n<=25&&t.getDay()===5],["Midsommardagen","Midsummer's Day",s===6&&n>=20&&n<=26&&t.getDay()===6],["Julafton","Christmas Eve",s===12&&n===24],["Juldagen","Christmas Day",s===12&&n===25],["Annandag jul","Boxing Day",s===12&&n===26],["Alla helgons dag","All Saints' Day",s===10&&n>=31&&t.getDay()===6||s===11&&n<=6&&t.getDay()===6]];for(const c of o){const[u,k,F]=c;if(F)return d?k:u}return null}render(){const t=this._current.getFullYear(),e=this._current.getMonth(),s=this._daysInMonth(t,e),n=this._firstDayOfWeek(t,e),i=this._today,a=this.lang==="en",d=a?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let o=a?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(o=o.slice(0,5));const c=this._getEventInputs(),u=c?this._buildEventMapFromInputs(c):this._buildEventMapFromChildren(),k=[];let F=1;for(let r=0;r<6;r++){const h=[],b=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let p=F;for(let D=0;D<b.length;D++){const w=b[D];if(r===0&&w<n){if(!this.disableWeekend||w<5){const T=e===0?11:e-1,x=e===0?t-1:t,g=this._daysInMonth(x,T)-(n-w-1),N=new Date(x,T,g);h.push(E`
|
|
1
|
+
import{g as J,h as W,m as B,p as _,v as E,y as P}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as U}from"../../vendor/lazy-focus-ring.js";import{t as v}from"../../vendor/decorate.js";import{n as G,t as H}from"../../vendor/assertClassBrand.js";import"../scb-icon-button/scb-icon-button.js";import"./scb-calendar-event.js";import"../scb-dialog/scb-dialog.js";import"../scb-list/scb-list.js";(function(){try{var $=typeof globalThis<"u"?globalThis:window;if(!$.__scb_ce_guard_installed__){$.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,n){try{customElements.get(e)||t(e,s,n)}catch(a){var i=String(a||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var L,O,q={fromAttribute($){if($===null)return!1;const t=$.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!=="no"}},f=(L=new WeakSet,O=class extends W{constructor(...t){super(...t),G(this,L),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this.eventsJson=void 0,this._eventsFromJson=null,this._eventsJsonLast=void 0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=e=>{const s=Array.from(this.shadowRoot?.querySelectorAll(".calendar-day.has-event")??[]),n=this.shadowRoot?.activeElement,i=n&&s.includes(n)?n:document.activeElement,a=s.indexOf(i);if(a===-1)return;let d=a;const o=this.disableWeekend?5:7;switch(e.key){case"ArrowRight":d=a+1<s.length?a+1:a;break;case"ArrowLeft":d=a-1>=0?a-1:a;break;case"ArrowDown":d=a+o<s.length?a+o:a;break;case"ArrowUp":d=a-o>=0?a-o:a;break;case"Home":d=0;break;case"End":d=s.length-1;break;default:return}d!==a&&(e.preventDefault(),s[d].focus())},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._popupEvent=null,this._handleDialogClose=()=>{this._popupEvent=null,this.requestUpdate(),this._restoreDayFocus()},this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{this._lastActiveDay?.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}get value(){return this.selectedDate}set value(t){const e=(t??"")+"";e!==this.selectedDate&&(this.selectedDate=e)}static get observedAttributes(){return[...super.observedAttributes??[],"value"]}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),t==="value"&&(this.value=s??"")}connectedCallback(){super.connectedCallback(),this._removeLazyFocusRingListeners=U(this,this.renderRoot),H(L,this,K).call(this);const t=Number(this.displayYear),e=Number(this.displayMonth);!Number.isNaN(t)&&!Number.isNaN(e)&&e>=1&&e<=12&&(this._current=new Date(t,e-1,1)),this._syncDisplayFromCurrent(!1),this.addEventListener("change",this._onEventChanged),this._mutationObserver=new MutationObserver(()=>{this.requestUpdate()}),this._mutationObserver.observe(this,{childList:!0}),this.addEventListener("keydown",this._onCalendarKeyDown)}disconnectedCallback(){this.removeEventListener("change",this._onEventChanged),this._removeLazyFocusRingListeners?.(),this._removeLazyFocusRingListeners=void 0,super.disconnectedCallback(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null),this.removeEventListener("keydown",this._onCalendarKeyDown)}mapSpacingToken(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}updated(t){if(super.updated?.(t),t.has("eventsJson")&&(this._eventsJsonLast=void 0,this._eventsFromJson=null),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&H(L,this,K).call(this),!this._syncingDisplay&&(t.has("displayYear")||t.has("displayMonth"))){const e=Number(this.displayYear),s=Number(this.displayMonth);if(!Number.isNaN(e)&&!Number.isNaN(s)&&s>=1&&s<=12){const n=this._current.getFullYear(),i=this._current.getMonth()+1;(n!==e||i!==s)&&(this._current=new Date(e,s-1,1),this._dispatchMonthChange(e,s),this.requestUpdate())}}}_ensureEventsFromJson(){const t=(this.eventsJson??"").trim();if(!t){this._eventsFromJson=null,this._eventsJsonLast=t;return}if(!(this._eventsJsonLast===t&&this._eventsFromJson!==null)){this._eventsJsonLast=t;try{const e=JSON.parse(t);Array.isArray(e)?this._eventsFromJson=e:this._eventsFromJson=[]}catch{this._eventsFromJson=[]}}}_getEventInputs(){return Array.isArray(this.events)?this.events:(this._ensureEventsFromJson(),this._eventsFromJson!==null?this._eventsFromJson:null)}_normalizeEventInput(t){const e=t.title??"",s=t.description??"",n=t.href??"",i=t.startDate??t["start-date"]??t.start??t.date??"",a=t.endDate??t["end-date"]??t.end??"";return{title:e+"",description:s?s+"":void 0,href:n?n+"":void 0,start:i?i+"":void 0,end:a?a+"":void 0}}_toLocalEventDate(t,e){const s=(t??"").trim();if(!s)return null;if(!s.includes("T")){const i=s.split("-").map(c=>Number(c));if(i.length!==3||i.some(c=>Number.isNaN(c)))return null;const[a,d,o]=i;return e?new Date(a,d-1,o,23,59,59,999):new Date(a,d-1,o,0,0,0,0)}const n=new Date(s);return Number.isNaN(n.getTime())?null:n}_toDateKey(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}_buildEventMapFromInputs(t){const e=new Map;for(const s of t){const n=this._normalizeEventInput(s),i=n.start||"",a=n.end||"";if(!(!i||!n.title))if(i&&a){const d=this._toLocalEventDate(i,!1),o=this._toLocalEventDate(a,!0);if(!d||!o)continue;if(o<d){const c=i.split("T")[0],u=e.get(c)||[];u.push({title:n.title,description:n.description,href:n.href,start:i,end:a}),e.set(c,u);continue}for(let c=new Date(d);c<=o;c.setDate(c.getDate()+1)){const u=this._toDateKey(c),k=e.get(u)||[];k.push({title:n.title,description:n.description,href:n.href,start:i,end:a}),e.set(u,k)}}else{const d=i.split("T")[0],o=e.get(d)||[];o.push({title:n.title,description:n.description,href:n.href,start:i}),e.set(d,o)}}return e}_buildEventMapFromChildren(){const t=Array.from(this.querySelectorAll("scb-calendar-event")),e=new Map;for(const s of t){const n=s,i=(n.startDate??n.date??"")+""||s.getAttribute("start-date")||s.getAttribute("date")||"",a=(n.endDate??"")+""||s.getAttribute("end-date")||"";if(i&&a){const d=this._toLocalEventDate(i,!1),o=this._toLocalEventDate(a,!0);if(!d||!o)continue;if(o<d){const c=i.split("T")[0],u=e.get(c)||[];u.push({title:s.title??"",description:s.description,href:n.href||s.getAttribute("href")||void 0,start:i,end:a}),e.set(c,u);continue}for(let c=new Date(d);c<=o;c.setDate(c.getDate()+1)){const u=this._toDateKey(c),k=e.get(u)||[];k.push({title:s.title??"",description:s.description,href:n.href||s.getAttribute("href")||void 0,start:i,end:a}),e.set(u,k)}}else if(i&&s.title){const d=i.split("T")[0],o=e.get(d)||[];o.push({title:s.title,description:s.description,href:n.href||s.getAttribute("href")||void 0,start:i}),e.set(d,o)}}return e}_syncDisplayFromCurrent(t=!0){const e=this._current.getFullYear(),s=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=e,this.displayMonth=s}finally{this._syncingDisplay=!1}t&&this._dispatchMonthChange(e,s)}_dispatchMonthChange(t,e){const s={displayYear:t,displayMonth:e};this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:s})),this.dispatchEvent(new CustomEvent("scbcalendarmonthchange",{bubbles:!0,composed:!0,detail:s}))}_dispatchSelect(t){const e={selectedDate:t};this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:e})),this.dispatchEvent(new CustomEvent("scbcalendarselect",{bubbles:!0,composed:!0,detail:e}))}_formatDayLabel(t){return new Intl.DateTimeFormat(this.lang==="en"?"en-GB":"sv-SE",{day:"numeric",month:"long",year:"numeric"}).format(t)}_formatDayAriaLabel(t,e,s){const n=s.map(a=>`${a.prefix||""}${a.title}`.trim()).filter(Boolean),i=[this._formatDayLabel(t)];return e&&i.push(e),n.length===1?i.push(this.lang==="en"?`1 event: ${n[0]}`:`1 händelse: ${n[0]}`):n.length>1&&i.push(this.lang==="en"?`${n.length} events: ${n.join(", ")}`:`${n.length} händelser: ${n.join(", ")}`),i.join(". ")}_daysInMonth(t,e){return new Date(t,e+1,0).getDate()}_firstDayOfWeek(t,e){const s=new Date(t,e,1).getDay();return s===0?6:s-1}_prevMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()-1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_nextMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()+1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_showEventPopup(t){this._popupEvent=t,this.selectedDate=t.date,this._dispatchSelect(t.date),this._lastActiveDay=this.shadowRoot?.activeElement||document.activeElement,this.requestUpdate(),this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelector("scb-dialog");e&&(document.activeElement&&(e.__lastTriggerEl=document.activeElement),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.open=!0})}),e.addEventListener("close",this._handleDialogClose,{once:!0}))})}_addDays(t,e){const s=new Date(t.valueOf());return s.setDate(s.getDate()+e),s}_easterDay(t){if(typeof this._easterDateCalculated["Ar"+t]<"u")return new Date(this._easterDateCalculated["Ar"+t]);let e=t;e<100&&(e=e+1900),e<1950&&(e=e+100);const s=e%19,n=e%4,i=e%7,a=(19*s+24)%30,d=(2*n+4*i+6*a+5)%7;let o=22+a+d,c=0;o==57&&(o-=7),o==56&&a==28&&d==6&&s>10&&(o-=7),o>31?(o-=31,c=4):c=3;const u=new Date(e,c-1,o);return this._easterDateCalculated["Ar"+t]=u,new Date(this._easterDateCalculated["Ar"+t])}_swedishHolidayName(t){const e=t.getMonth();if(e===1||e===6||e===7||e===8)return null;const s=t.getMonth()+1,n=t.getDate(),i=t.getFullYear(),a=this._easterDay(i),d=this.lang==="en",o=[["Nyårsdagen","New Year's Day",s===1&&n===1],["Trettondedag jul","Epiphany",s===1&&n===6],["Långfredag","Good Friday",+t==+this._addDays(a,-2)],["Påskdagen","Easter Sunday",+t==+a],["Annandag påsk","Easter Monday",+t==+this._addDays(a,1)],["Kristi himmelsfärdsdag","Ascension Day",+t==+this._addDays(a,39)],["Pingstdagen","Pentecost",+t==+this._addDays(a,50)&&i<2005],["Första maj","May Day",s===5&&n===1],["Nationaldagen","National Day",s===6&&n===6&&i>=2005],["Midsommarafton","Midsummer's Eve",s===6&&n>=19&&n<=25&&t.getDay()===5],["Midsommardagen","Midsummer's Day",s===6&&n>=20&&n<=26&&t.getDay()===6],["Julafton","Christmas Eve",s===12&&n===24],["Juldagen","Christmas Day",s===12&&n===25],["Annandag jul","Boxing Day",s===12&&n===26],["Alla helgons dag","All Saints' Day",s===10&&n>=31&&t.getDay()===6||s===11&&n<=6&&t.getDay()===6]];for(const c of o){const[u,k,F]=c;if(F)return d?k:u}return null}render(){const t=this._current.getFullYear(),e=this._current.getMonth(),s=this._daysInMonth(t,e),n=this._firstDayOfWeek(t,e),i=this._today,a=this.lang==="en",d=a?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let o=a?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(o=o.slice(0,5));const c=this._getEventInputs(),u=c?this._buildEventMapFromInputs(c):this._buildEventMapFromChildren(),k=[];let F=1;for(let r=0;r<6;r++){const h=[],b=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let p=F;for(let D=0;D<b.length;D++){const w=b[D];if(r===0&&w<n){if(!this.disableWeekend||w<5){const T=e===0?11:e-1,x=e===0?t-1:t,g=this._daysInMonth(x,T)-(n-w-1),N=new Date(x,T,g);h.push(E`
|
|
2
2
|
<div
|
|
3
3
|
class="calendar-day calendar-day--other"
|
|
4
4
|
role="gridcell"
|