scb-wc 0.1.90 → 0.1.92
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 +22 -41
- package/all.js +5 -0
- package/fonts/material-symbols-outlined/files/material-symbols-outlined-subset.woff2 +0 -0
- package/index.js +93 -88
- package/mvc/components/all.js +5 -0
- 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 +5 -5
- package/mvc/{vendor → components/scb-chevron}/scb-chevron.js +1 -1
- package/mvc/components/scb-datepicker/scb-datepicker.js +118 -0
- 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 +8 -8
- package/mvc/components/scb-list/scb-list.js +2 -2
- package/mvc/components/scb-menu/scb-menu-item.js +1 -1
- package/mvc/components/scb-nav/scb-nav.js +7 -7
- package/mvc/components/scb-options-menu/scb-options-menu-item.js +1 -1
- package/mvc/components/scb-progress-stepper/scb-progress-step.js +2 -2
- 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 +24 -141
- package/mvc/components/scb-toc/scb-toc-item.js +1 -1
- package/mvc/components/shared/lazy-focus-ring.js +2 -0
- package/mvc/components/shared/lazy-ripple.js +2 -0
- package/mvc/components/shared/scb-icon-svg.js +11 -0
- package/mvc/fonts/material-symbols-outlined/files/material-symbols-outlined-subset.woff2 +0 -0
- package/package.json +2 -2
- package/scb-chevron/scb-chevron.js +1 -0
- package/scb-components/index.d.ts +102 -0
- package/scb-components/scb-chevron/scb-chevron.d.ts +11 -0
- package/scb-components/scb-datepicker/scb-datepicker.d.ts +41 -0
- package/scb-components/scb-list/scb-list-item.d.ts +4 -0
- package/scb-components/scb-list/scb-list.d.ts +1 -0
- package/scb-components/scb-nav/scb-nav.d.ts +2 -0
- package/scb-components/shared/lazy-focus-ring.d.ts +4 -0
- package/scb-components/shared/lazy-ripple.d.ts +9 -0
- package/scb-components/shared/scb-icon-svg.d.ts +3 -0
- package/scb-datepicker/scb-datepicker.js +1 -0
- package/scb-list/scb-list-item.js +16 -6
- package/scb-list/scb-list.js +9 -5
- package/scb-nav/scb-nav.js +7 -3
- package/scb-wc.bundle.js +265 -266
- package/scb-wc.d.ts +204 -194
- package/mvc/vendor/lazy-focus-ring.js +0 -2
- package/mvc/vendor/lazy-ripple.js +0 -2
- package/mvc/vendor/scb-icon-svg.js +0 -11
- package/scb-wc-public-entry/index.d.ts +0 -97
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
# Om SCB Web Components
|
|
1
|
+
# Om SCB Web Components Preview
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> ⚠️ **Previewkanal**
|
|
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.
|
|
4
7
|
|
|
5
8
|
Komponenterna bygger på:
|
|
6
9
|
- [Lit](https://lit.dev/)
|
|
@@ -8,54 +11,32 @@ Komponenterna bygger på:
|
|
|
8
11
|
|
|
9
12
|
## Storybook och dokumentation (internt)
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
Previewkomponenterna dokumenteras och demonstreras i Storybook på SCB:s interna testadress:
|
|
12
15
|
|
|
13
|
-
-
|
|
16
|
+
- Test: <https://webcomponentstest.scb.intra>
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
Den publika/stabila Storybooken finns på:
|
|
16
19
|
|
|
17
|
-
-
|
|
20
|
+
- Prod: <https://webcomponents.scb.intra>
|
|
18
21
|
|
|
19
22
|
---
|
|
20
23
|
|
|
21
24
|
## Kom igång
|
|
22
25
|
|
|
23
|
-
|
|
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.
|
|
26
|
+
> **Obs:** Kör alla kommandon i mappen där din `package.json` ligger.
|
|
27
|
+
> Har du ingen? Kör `npm init -y` i projektroten (eller annan lämplig mapp).
|
|
47
28
|
|
|
48
|
-
|
|
29
|
+
Installera previewkanalen:
|
|
49
30
|
|
|
50
31
|
```sh
|
|
51
|
-
npm install scb-wc
|
|
32
|
+
npm install scb-wc@next
|
|
52
33
|
```
|
|
53
34
|
|
|
54
35
|
---
|
|
55
36
|
|
|
56
37
|
## Alternativ 1: Använd som ES‑moduler (t.ex. i React, Vue, SPA)
|
|
57
38
|
|
|
58
|
-
Importera CSS och de
|
|
39
|
+
Importera CSS och de testkomponenter du använder (bäst för tree‑shaking):
|
|
59
40
|
|
|
60
41
|
```js
|
|
61
42
|
// Global CSS + tokens (måste bara importeras en gång)
|
|
@@ -111,7 +92,7 @@ För MVC/MPA räcker det normalt att använda `scb-wc-selfhost.css`, eftersom de
|
|
|
111
92
|
|
|
112
93
|
## Alternativ 2: Använd i MVC/MPA via `<script type="module">`
|
|
113
94
|
|
|
114
|
-
Det här läget använder den färdig‑
|
|
95
|
+
Det här läget använder den färdig‑splittade **MVC‑ESM**‑builden som följer med paketet under:
|
|
115
96
|
|
|
116
97
|
```text
|
|
117
98
|
node_modules/scb-wc/mvc/
|
|
@@ -124,7 +105,7 @@ Lägg till i din apps `package.json`:
|
|
|
124
105
|
```jsonc
|
|
125
106
|
{
|
|
126
107
|
"scripts": {
|
|
127
|
-
"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);\""
|
|
108
|
+
"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@next?');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);\""
|
|
128
109
|
}
|
|
129
110
|
}
|
|
130
111
|
```
|
|
@@ -172,7 +153,7 @@ Behöver du en annan webbrotsökväg (t.ex. om din `wwwroot` ligger någon annan
|
|
|
172
153
|
|
|
173
154
|
## Alternativ 3: Bundlad version (IIFE) för äldre miljöer
|
|
174
155
|
|
|
175
|
-
Om ESM inte stöds kan du använda den bundlade varianten från paketroten.
|
|
156
|
+
Om ESM inte stöds kan du använda den bundlade test‑varianten från paketroten.
|
|
176
157
|
Flytta följande tre filer från `node_modules/scb-wc` och använd dem i applikationen:
|
|
177
158
|
|
|
178
159
|
```text
|
|
@@ -195,7 +176,7 @@ node_modules/scb-wc/scb-typography.css
|
|
|
195
176
|
|
|
196
177
|
SCB Web Components fungerar även i Blazor‑appar när du vill använda samma komponenter i både MVC/MPA och Blazor.
|
|
197
178
|
|
|
198
|
-
Grundprincipen är
|
|
179
|
+
Grundprincipen är samma som för `scb-wc`:
|
|
199
180
|
|
|
200
181
|
1. Använd MVC‑ESM‑builden (`node_modules/scb-wc/mvc`) och kopiera den till `wwwroot/ui` med `ui:install`.
|
|
201
182
|
2. Ladda `scb-blazor-bridge.js` från `wwwroot/ui` i din Blazor‑layout.
|
|
@@ -208,8 +189,8 @@ Lägg till ett script som kopierar interop-filen från `node_modules` till ditt
|
|
|
208
189
|
```jsonc
|
|
209
190
|
{
|
|
210
191
|
"scripts": {
|
|
211
|
-
"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);\"",
|
|
212
|
-
"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);\""
|
|
192
|
+
"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@next?');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);\"",
|
|
193
|
+
"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@next?');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);\""
|
|
213
194
|
}
|
|
214
195
|
}
|
|
215
196
|
```
|
|
@@ -223,13 +204,13 @@ Exempel på layout:
|
|
|
223
204
|
<script type="module" src="~/ui/scb-blazor-bridge.js"></script>
|
|
224
205
|
```
|
|
225
206
|
|
|
226
|
-
`ScbBlazorInteropBase` kan
|
|
207
|
+
`ScbBlazorInteropBase` är samma bas‑klass i preview- och public-kanalen. Du kan därför dela samma C#‑fil mellan projekt som använder `scb-wc@next` och `scb-wc@latest`.
|
|
227
208
|
|
|
228
209
|
---
|
|
229
210
|
|
|
230
211
|
## Viktigt
|
|
231
212
|
|
|
232
|
-
- `scb-wc@
|
|
213
|
+
- `scb-wc@next` är **previewkanalen**. Komponenter kan ändras eller tas bort mellan versioner. Använd `scb-wc@latest` i externa produktionsmiljöer.
|
|
233
214
|
- **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`).
|
|
234
215
|
- **Blanda inte MVC‑ESM och IIFE på samma sida.** Välj en distributionsform per sida/app.
|
|
235
216
|
- **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,10 +18,12 @@ 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';
|
|
21
22
|
import './scb-chip/scb-chip.js';
|
|
22
23
|
import './scb-collapse/scb-collapse.js';
|
|
23
24
|
import './scb-container-card/scb-container-card.js';
|
|
24
25
|
import './scb-cookies-consent/scb-cookies-consent.js';
|
|
26
|
+
import './scb-datepicker/scb-datepicker.js';
|
|
25
27
|
import './scb-dialog/scb-dialog.js';
|
|
26
28
|
import './scb-divider/scb-divider.js';
|
|
27
29
|
import './scb-drawer/scb-drawer.js';
|
|
@@ -95,3 +97,6 @@ import './scb-viz/scb-viz-series-differentiation-registry.js';
|
|
|
95
97
|
import './scb-viz/scb-viz-series-differentiation-runtime.js';
|
|
96
98
|
import './scb-viz/scb-viz-table-runtime.js';
|
|
97
99
|
import './scb-viz/scb-viz.js';
|
|
100
|
+
import './shared/lazy-focus-ring.js';
|
|
101
|
+
import './shared/lazy-ripple.js';
|
|
102
|
+
import './shared/scb-icon-svg.js';
|
|
Binary file
|
package/index.js
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { addLazyFocusRingListeners as e, ensureFocusRingOnFocusVisible as t, ensureFocusRingOnTab as n, ensureFocusRingReady as r } from "./shared/lazy-focus-ring.js";
|
|
2
|
+
import { ScbChevron as i } from "./scb-chevron/scb-chevron.js";
|
|
3
|
+
import { ScbAccordionItem as a } from "./scb-accordion/scb-accordion-item.js";
|
|
4
|
+
import { ScbButton as o } from "./scb-button/scb-button.js";
|
|
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";
|
|
5
7
|
import "./scb-action-card/scb-action-card.js";
|
|
6
|
-
import { ScbIconButton as
|
|
7
|
-
import { ScbSearch as
|
|
8
|
-
import { ScbAvatar as
|
|
9
|
-
import { ScbAppBar as
|
|
10
|
-
import { ScbBadge as
|
|
11
|
-
import { ScbLink as
|
|
12
|
-
import { SCBBreadcrumbItem as
|
|
13
|
-
import { SCBBreadcrumb as
|
|
14
|
-
import { ScbCalendarEvent as
|
|
15
|
-
import { ScbDivider as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
8
|
+
import { ScbIconButton as m } from "./scb-icon-button/scb-icon-button.js";
|
|
9
|
+
import { ScbSearch as h } from "./scb-search/scb-search.js";
|
|
10
|
+
import { ScbAvatar as g } from "./scb-avatar/scb-avatar.js";
|
|
11
|
+
import { ScbAppBar as _ } from "./scb-app-bar/scb-app-bar.js";
|
|
12
|
+
import { ScbBadge as v } from "./scb-badge/scb-badge.js";
|
|
13
|
+
import { ScbLink as y } from "./scb-link/scb-link.js";
|
|
14
|
+
import { SCBBreadcrumbItem as b } from "./scb-breadcrumb/scb-breadcrumb-item.js";
|
|
15
|
+
import { SCBBreadcrumb as x } from "./scb-breadcrumb/scb-breadcrumb.js";
|
|
16
|
+
import { ScbCalendarEvent as S } from "./scb-calendar/scb-calendar-event.js";
|
|
17
|
+
import { ScbDivider as C } from "./scb-divider/scb-divider.js";
|
|
18
|
+
import { ScbDatepicker as w } from "./scb-datepicker/scb-datepicker.js";
|
|
19
|
+
import { ScbTextField as T } from "./scb-textfield/scb-textfield.js";
|
|
20
|
+
import { ScbCheckboxGroup as E } from "./scb-checkbox/scb-checkbox-group.js";
|
|
21
|
+
import { ScbCheckbox as D } from "./scb-checkbox/scb-checkbox.js";
|
|
22
|
+
import { ScbRadioGroup as O } from "./scb-radio-button/scb-radio-group.js";
|
|
23
|
+
import { ScbRadioButton as k } from "./scb-radio-button/scb-radio-button.js";
|
|
24
|
+
import { ScbSwitch as A } from "./scb-switch/scb-switch.js";
|
|
25
|
+
import { ScbChip as j } from "./scb-chip/scb-chip.js";
|
|
26
|
+
import { ScbDialog as M } from "./scb-dialog/scb-dialog.js";
|
|
27
|
+
import { ScbListItem as N } from "./scb-list/scb-list-item.js";
|
|
28
|
+
import { ScbList as P } from "./scb-list/scb-list.js";
|
|
29
|
+
import { ScbCalendar as F } from "./scb-calendar/scb-calendar.js";
|
|
30
|
+
import { ScbCalendarCard as I } from "./scb-calendar-card/scb-calendar-card.js";
|
|
28
31
|
import "./scb-card/scb-action-card.js";
|
|
29
32
|
import "./scb-container-card/scb-container-card.js";
|
|
30
33
|
import "./scb-card/scb-container-card.js";
|
|
@@ -34,65 +37,67 @@ import "./scb-list-card/scb-list-card.js";
|
|
|
34
37
|
import "./scb-card/scb-list-card.js";
|
|
35
38
|
import "./scb-social-card/scb-social-card.js";
|
|
36
39
|
import "./scb-card/scb-social-card.js";
|
|
37
|
-
import { ScbCollapse as
|
|
38
|
-
import { ScbCookiesConsent as
|
|
39
|
-
import { ScbDrawer as
|
|
40
|
-
import { ScbDropZone as
|
|
41
|
-
import { ScbOptionsMenuItem as
|
|
42
|
-
import { ScbOptionsSubMenu as
|
|
43
|
-
import { ScbOptionsMenu as
|
|
44
|
-
import { ScbDropdown as
|
|
45
|
-
import { ScbFab as
|
|
46
|
-
import { ScbFactCardContent as
|
|
47
|
-
import { ScbFactCard as
|
|
48
|
-
import { ScbFooterSection as
|
|
49
|
-
import { ScbGridItem as
|
|
50
|
-
import { ScbStack as
|
|
51
|
-
import { ScbGrid as
|
|
52
|
-
import { ScbFooter as
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
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
|
-
|
|
40
|
+
import { ScbCollapse as L } from "./scb-collapse/scb-collapse.js";
|
|
41
|
+
import { ScbCookiesConsent as R } from "./scb-cookies-consent/scb-cookies-consent.js";
|
|
42
|
+
import { ScbDrawer as z } from "./scb-drawer/scb-drawer.js";
|
|
43
|
+
import { ScbDropZone as B } from "./scb-drop-zone/scb-drop-zone.js";
|
|
44
|
+
import { ScbOptionsMenuItem as V } from "./scb-options-menu/scb-options-menu-item.js";
|
|
45
|
+
import { ScbOptionsSubMenu as H } from "./scb-options-menu/scb-options-sub-menu.js";
|
|
46
|
+
import { ScbOptionsMenu as U } from "./scb-options-menu/scb-options-menu.js";
|
|
47
|
+
import { ScbDropdown as W } from "./scb-dropdown/scb-dropdown.js";
|
|
48
|
+
import { ScbFab as G } from "./scb-fab/scb-fab.js";
|
|
49
|
+
import { ScbFactCardContent as K } from "./scb-fact-card/scb-fact-card-content.js";
|
|
50
|
+
import { ScbFactCard as q } from "./scb-fact-card/scb-fact-card.js";
|
|
51
|
+
import { ScbFooterSection as J } from "./scb-footer/scb-footer-section.js";
|
|
52
|
+
import { ScbGridItem as Y } from "./scb-grid/scb-grid-item.js";
|
|
53
|
+
import { ScbStack as X } from "./scb-grid/scb-stack.js";
|
|
54
|
+
import { ScbGrid as Z } from "./scb-grid/scb-grid.js";
|
|
55
|
+
import { ScbFooter as Q } from "./scb-footer/scb-footer.js";
|
|
56
|
+
import { hasScbSvgIcon as $, renderScbIcon as ee } from "./shared/scb-icon-svg.js";
|
|
57
|
+
import { ScbHorizontalScroller as te } from "./scb-horizontal-scroller/scb-horizontal-scroller.js";
|
|
58
|
+
import { ScbOverlay as ne } from "./scb-overlay/scb-overlay.js";
|
|
59
|
+
import { ScbGalleryGrid as re } from "./scb-gallery-grid/scb-gallery-grid.js";
|
|
60
|
+
import { ScbHeaderMenuGroup as ie } from "./scb-header/scb-header-menu-group.js";
|
|
61
|
+
import { ScbHeaderMenuItem as ae } from "./scb-header/scb-header-menu-item.js";
|
|
62
|
+
import { ScbHeaderTab as oe } from "./scb-header/scb-header-tab.js";
|
|
63
|
+
import { ScbHeaderUtility as se } from "./scb-header/scb-header-utility.js";
|
|
64
|
+
import { ScbHeader as ce } from "./scb-header/scb-header.js";
|
|
65
|
+
import { ScbKeyFigureCard as le } from "./scb-keyfigure-card/scb-keyfigure-card.js";
|
|
66
|
+
import { ScbMenuItem as ue } from "./scb-menu/scb-menu-item.js";
|
|
67
|
+
import { ScbmenuSection as de } from "./scb-menu/scb-menu-section.js";
|
|
68
|
+
import { ScbSubmenu as fe } from "./scb-menu/scb-sub-menu.js";
|
|
69
|
+
import { ScbMenu as pe } from "./scb-menu/scb-menu.js";
|
|
70
|
+
import { ScbNavItem as me } from "./scb-nav/scb-nav-item.js";
|
|
71
|
+
import { ScbNav as he } from "./scb-nav/scb-nav.js";
|
|
72
|
+
import { ScbNotificationCard as ge } from "./scb-notification-card/scb-notification-card.js";
|
|
73
|
+
import { ScbPagination as _e } from "./scb-pagination/scb-pagination.js";
|
|
74
|
+
import { ScbProgressIndicator as ve } from "./scb-progress-indicator/scb-progress-indicator.js";
|
|
75
|
+
import { ScbProgressStep as ye } from "./scb-progress-stepper/scb-progress-step.js";
|
|
76
|
+
import { ScbProgressStepper as be } from "./scb-progress-stepper/scb-progress-stepper.js";
|
|
77
|
+
import { ScbScrollspy as xe } from "./scb-scrollspy/scb-scrollspy.js";
|
|
78
|
+
import { ScbSegmentedItem as Se } from "./scb-segmented-button/scb-segmented-item.js";
|
|
79
|
+
import { ScbSegmentedButton as Ce } from "./scb-segmented-button/scb-segmented-button.js";
|
|
80
|
+
import { ScbSelectOption as we } from "./scb-select/scb-select-option.js";
|
|
81
|
+
import { ScbSelect as Te } from "./scb-select/scb-select.js";
|
|
82
|
+
import { ScbSkeleton as Ee } from "./scb-skeleton/scb-skeleton.js";
|
|
83
|
+
import { ScbSlider as De } from "./scb-slider/scb-slider.js";
|
|
84
|
+
import { ScbSnackbar as Oe } from "./scb-snackbar/scb-snackbar.js";
|
|
85
|
+
import { ScbStatusPill as ke } from "./scb-status-pill/scb-status-pill.js";
|
|
86
|
+
import { ScbStep as Ae } from "./scb-stepper/scb-step.js";
|
|
87
|
+
import { ScbStepper as je } from "./scb-stepper/scb-stepper.js";
|
|
88
|
+
import { ScbTable as Me } from "./scb-table/scb-table.js";
|
|
89
|
+
import { ScbTableAdvanced as Ne } from "./scb-table-advanced/scb-table-advanced.js";
|
|
90
|
+
import { ScbPrimaryTab as Pe } from "./scb-tabs/scb-primary-tab.js";
|
|
91
|
+
import { ScbSecondaryTab as Fe } from "./scb-tabs/scb-secondary-tab.js";
|
|
92
|
+
import { ScbTabs as Ie } from "./scb-tabs/scb-tabs.js";
|
|
93
|
+
import { ScbTocItem as Le } from "./scb-toc/scb-toc-item.js";
|
|
94
|
+
import { ScbToc as Re } from "./scb-toc/scb-toc.js";
|
|
95
|
+
import { ScbTooltip as ze } from "./scb-tooltip/scb-tooltip.js";
|
|
96
|
+
import { buildScbVizExportFileName as Be, createScbVizCsvBlob as Ve, createScbVizRasterBlobFromElement as He, createScbVizRasterDataUrlFromElement as Ue, downloadScbVizBlob as We, getScbVizCurrentFullscreenElement as Ge, getScbVizExportBaseFileName as Ke, getScbVizFullscreenDocument as qe, isScbVizFullscreenSupported as Je, openScbVizPrintFrame as Ye, runWithScbVizForcedPrintLightMode as Xe, toggleScbVizFullscreen as Ze } from "./scb-viz/scb-viz-actions-runtime.js";
|
|
97
|
+
import { buildScbVizPrintDocumentHtml as Qe, buildScbVizPrintableFooterHtml as $e, buildScbVizPrintableTableHtml as et } from "./scb-viz/scb-viz-print-runtime.js";
|
|
98
|
+
import { appendScbVizSeriesDifferentiationPatternMarks as tt, getScbVizSeriesDifferentiationPatternDefinition as nt, getScbVizSeriesDifferentiationPatternKinds as rt, getScbVizSeriesDifferentiationRegistry as it, getScbVizSeriesDifferentiationVariant as at, scbVizSeriesDifferentiationRegistry as ot } from "./scb-viz/scb-viz-series-differentiation-registry.js";
|
|
99
|
+
import { clearScbVizSeriesDifferentiationColorClass as st, clearScbVizSeriesDifferentiationMetadata as ct, ensureScbVizGroupedSeriesDifferentiationStore as lt, ensureScbVizStyledModeSeriesPattern as ut, getScbVizGroupedSeriesDifferentiationKey as dt, getScbVizGroupedSeriesDifferentiationVariant as ft, getScbVizGroupedSeriesDifferentiationVariantIndex as pt, getScbVizHighchartsColorClassName as mt, getScbVizHighchartsSvgElement as ht, getScbVizHighchartsSvgRoot as gt, getScbVizLegendSeriesDifferentiationTargets as _t, getScbVizSeriesDifferentiationColorIndex as vt, getScbVizSeriesDifferentiationVariantByIndex as yt, isScbVizGroupedSeriesDifferentiationChart as bt, isScbVizHighchartsStyledMode as xt, setScbVizSeriesDifferentiationColorClass as St, setScbVizSeriesDifferentiationMetadata as Ct, shouldShowScbVizSeriesDifferentiationAction as wt, usesScbVizGroupedPointDifferentiation as Tt } from "./scb-viz/scb-viz-series-differentiation-runtime.js";
|
|
100
|
+
import { buildScbVizResolvedTableView as Et, createScbVizCsvRows as Dt, inferScbVizTableAlignments as Ot, normalizeScbVizRenderableCell as kt, readScbVizTableDataFromSlot as At } from "./scb-viz/scb-viz-table-runtime.js";
|
|
101
|
+
import { ScbViz as jt } from "./scb-viz/scb-viz.js";
|
|
102
|
+
import { ensureRippleReady as Mt, syncRippleToControl as Nt } from "./shared/lazy-ripple.js";
|
|
103
|
+
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, F as ScbCalendar, I as ScbCalendarCard, S as ScbCalendarEvent, l as ScbCard, D as ScbCheckbox, E as ScbCheckboxGroup, i as ScbChevron, j as ScbChip, L as ScbCollapse, u as ScbContainerCard, R as ScbCookiesConsent, w as ScbDatepicker, M as ScbDialog, C as ScbDivider, z as ScbDrawer, B as ScbDropZone, W as ScbDropdown, G as ScbFab, q as ScbFactCard, K as ScbFactCardContent, Q as ScbFooter, J as ScbFooterSection, re as ScbGalleryGrid, Z as ScbGrid, Y as ScbGridItem, ce as ScbHeader, ie as ScbHeaderMenuGroup, ae as ScbHeaderMenuItem, oe as ScbHeaderTab, se as ScbHeaderUtility, te as ScbHorizontalScroller, m as ScbIconButton, le as ScbKeyFigureCard, y as ScbLink, d as ScbLinkCard, P as ScbList, f as ScbListCard, N as ScbListItem, pe as ScbMenu, ue as ScbMenuItem, he as ScbNav, me as ScbNavItem, ge as ScbNotificationCard, U as ScbOptionsMenu, V as ScbOptionsMenuItem, H as ScbOptionsSubMenu, ne as ScbOverlay, _e as ScbPagination, Pe as ScbPrimaryTab, ve as ScbProgressIndicator, ye as ScbProgressStep, be as ScbProgressStepper, k as ScbRadioButton, O as ScbRadioGroup, xe as ScbScrollspy, h as ScbSearch, Fe as ScbSecondaryTab, Ce as ScbSegmentedButton, Se as ScbSegmentedItem, Te as ScbSelect, we as ScbSelectOption, Ee as ScbSkeleton, De as ScbSlider, Oe as ScbSnackbar, p as ScbSocialCard, X as ScbStack, ke as ScbStatusPill, Ae as ScbStep, je as ScbStepper, fe as ScbSubmenu, A as ScbSwitch, Me as ScbTable, Ne as ScbTableAdvanced, Ie as ScbTabs, T as ScbTextField, Re as ScbToc, Le as ScbTocItem, ze as ScbTooltip, jt as ScbViz, de as ScbmenuSection, e as addLazyFocusRingListeners, tt as appendScbVizSeriesDifferentiationPatternMarks, Be as buildScbVizExportFileName, Qe as buildScbVizPrintDocumentHtml, $e as buildScbVizPrintableFooterHtml, et as buildScbVizPrintableTableHtml, Et as buildScbVizResolvedTableView, st as clearScbVizSeriesDifferentiationColorClass, ct as clearScbVizSeriesDifferentiationMetadata, Ve as createScbVizCsvBlob, Dt as createScbVizCsvRows, He as createScbVizRasterBlobFromElement, Ue as createScbVizRasterDataUrlFromElement, We as downloadScbVizBlob, t as ensureFocusRingOnFocusVisible, n as ensureFocusRingOnTab, r as ensureFocusRingReady, Mt as ensureRippleReady, lt as ensureScbVizGroupedSeriesDifferentiationStore, ut as ensureScbVizStyledModeSeriesPattern, Ge as getScbVizCurrentFullscreenElement, Ke as getScbVizExportBaseFileName, qe as getScbVizFullscreenDocument, dt as getScbVizGroupedSeriesDifferentiationKey, ft as getScbVizGroupedSeriesDifferentiationVariant, pt as getScbVizGroupedSeriesDifferentiationVariantIndex, mt as getScbVizHighchartsColorClassName, ht as getScbVizHighchartsSvgElement, gt as getScbVizHighchartsSvgRoot, _t as getScbVizLegendSeriesDifferentiationTargets, vt as getScbVizSeriesDifferentiationColorIndex, nt as getScbVizSeriesDifferentiationPatternDefinition, rt as getScbVizSeriesDifferentiationPatternKinds, it as getScbVizSeriesDifferentiationRegistry, at as getScbVizSeriesDifferentiationVariant, yt as getScbVizSeriesDifferentiationVariantByIndex, $ as hasScbSvgIcon, Ot as inferScbVizTableAlignments, Je as isScbVizFullscreenSupported, bt as isScbVizGroupedSeriesDifferentiationChart, xt as isScbVizHighchartsStyledMode, kt as normalizeScbVizRenderableCell, Ye as openScbVizPrintFrame, At as readScbVizTableDataFromSlot, ee as renderScbIcon, Xe as runWithScbVizForcedPrintLightMode, ot as scbVizSeriesDifferentiationRegistry, St as setScbVizSeriesDifferentiationColorClass, Ct as setScbVizSeriesDifferentiationMetadata, wt as shouldShowScbVizSeriesDifferentiationAction, Nt as syncRippleToControl, Ze as toggleScbVizFullscreen, Tt as usesScbVizGroupedPointDifferentiation };
|
package/mvc/components/all.js
CHANGED
|
@@ -18,10 +18,12 @@ 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';
|
|
21
22
|
import './scb-chip/scb-chip.js';
|
|
22
23
|
import './scb-collapse/scb-collapse.js';
|
|
23
24
|
import './scb-container-card/scb-container-card.js';
|
|
24
25
|
import './scb-cookies-consent/scb-cookies-consent.js';
|
|
26
|
+
import './scb-datepicker/scb-datepicker.js';
|
|
25
27
|
import './scb-dialog/scb-dialog.js';
|
|
26
28
|
import './scb-divider/scb-divider.js';
|
|
27
29
|
import './scb-drawer/scb-drawer.js';
|
|
@@ -95,3 +97,6 @@ import './scb-viz/scb-viz-print-runtime.js';
|
|
|
95
97
|
import './scb-viz/scb-viz-series-differentiation-registry.js';
|
|
96
98
|
import './scb-viz/scb-viz-series-differentiation-runtime.js';
|
|
97
99
|
import './scb-viz/scb-viz-table-runtime.js';
|
|
100
|
+
import './shared/lazy-focus-ring.js';
|
|
101
|
+
import './shared/lazy-ripple.js';
|
|
102
|
+
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{ensureFocusRingOnFocusVisible as u}from"../shared/lazy-focus-ring.js";import{t as r}from"../../vendor/decorate.js";import"../scb-chevron/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 C,m as w,p as o,v as c,y as N}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 z,t as y}from"../../vendor/assertClassBrand.js";(function(){try{var
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../shared/lazy-focus-ring.js","../../vendor/preload-helper.js","../shared/lazy-ripple.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{g as s,h as C,m as w,p as o,v as c,y as N}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 z,t as y}from"../../vendor/assertClassBrand.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__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 P(){return f??(f=x(()=>import("../shared/lazy-focus-ring.js"),__vite__mapDeps([0,1]),import.meta.url)),f}function k(){return m??(m=x(()=>import("../shared/lazy-ripple.js"),__vite__mapDeps([2,1]),import.meta.url)),m}var n=(h=new WeakSet,class extends C{constructor(...t){super(...t),z(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||P().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),k().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-expanded");b!==null?t.setAttribute("aria-expanded",b):t.removeAttribute("aria-expanded"),this.removeAttribute("aria-expanded"),this.__ariaObserver?.disconnect(),this.__ariaObserver=new MutationObserver(S=>{const u=this.__getNativeControl();if(u)for(const v of S){if(v.type!=="attributes"||!v.attributeName)continue;const p=v.attributeName,g=this.getAttribute(p);if(p==="aria-label"){const _=(g||(this.label.trim()===""&&!this.__hasDefaultSlotContent?(this.icon||"").trim():"")).trim();_?u.setAttribute("aria-label",_):u.removeAttribute("aria-label")}else(p==="aria-controls"||p==="aria-expanded")&&(g===null?u.removeAttribute(p):u.setAttribute(p,g),p==="aria-expanded"&&this.removeAttribute("aria-expanded"))}}),this.__ariaObserver.observe(this,{attributes:!0,attributeFilter:["aria-label","aria-controls","aria-expanded"]})}connectedCallback(){super.connectedCallback()}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())}}),y(h,this,R).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"))&&y(h,this,R).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 k();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 N`:host,:host([size='small']){--scb-button-icon-size:var(--icon-size-small, 20px)}: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-4) - 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)}:host([size='small']){--scb-button-padding-block:calc(var(--spacing-3) - var(--spacing-1));--scb-button-padding-inline:var(--spacing-4);--scb-button-icon-edge-space:var(--spacing-4);--scb-button-icon-gap:var(--spacing-2)}: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}.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 C,m as w,p as o,v as c,y as N}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 R(){const
|
|
51
|
+
`}});function R(){const d=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??d,e=this.mapSpacingToken(this.spacingBottom)??d,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([w("scb-button")],n);export{n as ScbButton};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as q,m as z,p as _,v as T,y as H}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as W}from"../../vendor/lazy-focus-ring.js";import{t as v}from"../../vendor/decorate.js";import{n as P,t as Y}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 k=typeof globalThis<"u"?globalThis:window;if(!k.__scb_ce_guard_installed__){k.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,a){try{customElements.get(e)||t(e,s,a)}catch(n){var i=String(n||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var x,L,R={fromAttribute(k){if(k===null)return!1;const t=k.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!=="no"}},m=(x=new WeakSet,L=class extends q{constructor(...t){super(...t),P(this,x),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")??[]),a=this.shadowRoot?.activeElement,i=a&&s.includes(a)?a:document.activeElement,n=s.indexOf(i);if(n===-1)return;let d=n;const l=this.disableWeekend?5:7;switch(e.key){case"ArrowRight":d=n+1<s.length?n+1:n;break;case"ArrowLeft":d=n-1>=0?n-1:n;break;case"ArrowDown":d=n+l<s.length?n+l:n;break;case"ArrowUp":d=n-l>=0?n-l:n;break;default:return}d!==n&&(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=W(this,this.renderRoot),Y(x,this,I).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"))&&Y(x,this,I).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 a=this._current.getFullYear(),i=this._current.getMonth()+1;(a!==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??"",a=t.href??"",i=t.startDate??t["start-date"]??t.start??t.date??"",n=t.endDate??t["end-date"]??t.end??"";return{title:e+"",description:s?s+"":void 0,href:a?a+"":void 0,start:i?i+"":void 0,end:n?n+"":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[n,d,l]=i;return e?new Date(n,d-1,l,23,59,59,999):new Date(n,d-1,l,0,0,0,0)}const a=new Date(s);return Number.isNaN(a.getTime())?null:a}_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 a=this._normalizeEventInput(s),i=a.start||"",n=a.end||"";if(!(!i||!a.title))if(i&&n){const d=this._toLocalEventDate(i,!1),l=this._toLocalEventDate(n,!0);if(!d||!l)continue;if(l<d){const c=i.split("T")[0],y=e.get(c)||[];y.push({title:a.title,description:a.description,href:a.href,start:i,end:n}),e.set(c,y);continue}for(let c=new Date(d);c<=l;c.setDate(c.getDate()+1)){const y=this._toDateKey(c),E=e.get(y)||[];E.push({title:a.title,description:a.description,href:a.href,start:i,end:n}),e.set(y,E)}}else{const d=i.split("T")[0],l=e.get(d)||[];l.push({title:a.title,description:a.description,href:a.href,start:i}),e.set(d,l)}}return e}_buildEventMapFromChildren(){const t=Array.from(this.querySelectorAll("scb-calendar-event")),e=new Map;for(const s of t){const a=s,i=(a.startDate??a.date??"")+""||s.getAttribute("start-date")||s.getAttribute("date")||"",n=(a.endDate??"")+""||s.getAttribute("end-date")||"";if(i&&n){const d=this._toLocalEventDate(i,!1),l=this._toLocalEventDate(n,!0);if(!d||!l)continue;if(l<d){const c=i.split("T")[0],y=e.get(c)||[];y.push({title:s.title??"",description:s.description,href:a.href||s.getAttribute("href")||void 0,start:i,end:n}),e.set(c,y);continue}for(let c=new Date(d);c<=l;c.setDate(c.getDate()+1)){const y=this._toDateKey(c),E=e.get(y)||[];E.push({title:s.title??"",description:s.description,href:a.href||s.getAttribute("href")||void 0,start:i,end:n}),e.set(y,E)}}else if(i&&s.title){const d=i.split("T")[0],l=e.get(d)||[];l.push({title:s.title,description:s.description,href:a.href||s.getAttribute("href")||void 0,start:i}),e.set(d,l)}}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}))}_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,a=e%4,i=e%7,n=(19*s+24)%30,d=(2*a+4*i+6*n+5)%7;let l=22+n+d,c=0;l==57&&(l-=7),l==56&&n==28&&d==6&&s>10&&(l-=7),l>31?(l-=31,c=4):c=3;const y=new Date(e,c-1,l);return this._easterDateCalculated["Ar"+t]=y,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,a=t.getDate(),i=t.getFullYear(),n=this._easterDay(i),d=this.lang==="en",l=[["Nyårsdagen","New Year's Day",s===1&&a===1],["Trettondedag jul","Epiphany",s===1&&a===6],["Långfredag","Good Friday",+t==+this._addDays(n,-2)],["Påskdagen","Easter Sunday",+t==+n],["Annandag påsk","Easter Monday",+t==+this._addDays(n,1)],["Kristi himmelsfärdsdag","Ascension Day",+t==+this._addDays(n,39)],["Pingstdagen","Pentecost",+t==+this._addDays(n,50)&&i<2005],["Första maj","May Day",s===5&&a===1],["Nationaldagen","National Day",s===6&&a===6&&i>=2005],["Midsommarafton","Midsummer's Eve",s===6&&a>=19&&a<=25&&t.getDay()===5],["Midsommardagen","Midsummer's Day",s===6&&a>=20&&a<=26&&t.getDay()===6],["Julafton","Christmas Eve",s===12&&a===24],["Juldagen","Christmas Day",s===12&&a===25],["Annandag jul","Boxing Day",s===12&&a===26],["Alla helgons dag","All Saints' Day",s===10&&a>=31&&t.getDay()===6||s===11&&a<=6&&t.getDay()===6]];for(const c of l){const[y,E,A]=c;if(A)return d?E:y}return null}render(){const t=this._current.getFullYear(),e=this._current.getMonth(),s=this._daysInMonth(t,e),a=this._firstDayOfWeek(t,e),i=this._today,n=this.lang==="en",d=n?["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 l=n?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(l=l.slice(0,5));const c=this._getEventInputs(),y=c?this._buildEventMapFromInputs(c):this._buildEventMapFromChildren(),E=[];let A=1;for(let r=0;r<6;r++){const h=[],f=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let p=A;for(let D=0;D<f.length;D++){const w=f[D];if(r===0&&w<a){if(!this.disableWeekend||w<5){const M=e===0?11:e-1,N=e===0?t-1:t,b=this._daysInMonth(N,M)-(a-w-1);h.push(T`
|
|
1
|
+
import{h as q,m as z,p as _,v as T,y as H}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{addLazyFocusRingListeners as W}from"../shared/lazy-focus-ring.js";import{t as v}from"../../vendor/decorate.js";import{n as P,t as Y}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 k=typeof globalThis<"u"?globalThis:window;if(!k.__scb_ce_guard_installed__){k.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,a){try{customElements.get(e)||t(e,s,a)}catch(n){var i=String(n||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var x,L,R={fromAttribute(k){if(k===null)return!1;const t=k.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!=="no"}},m=(x=new WeakSet,L=class extends q{constructor(...t){super(...t),P(this,x),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")??[]),a=this.shadowRoot?.activeElement,i=a&&s.includes(a)?a:document.activeElement,n=s.indexOf(i);if(n===-1)return;let d=n;const l=this.disableWeekend?5:7;switch(e.key){case"ArrowRight":d=n+1<s.length?n+1:n;break;case"ArrowLeft":d=n-1>=0?n-1:n;break;case"ArrowDown":d=n+l<s.length?n+l:n;break;case"ArrowUp":d=n-l>=0?n-l:n;break;default:return}d!==n&&(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=W(this,this.renderRoot),Y(x,this,I).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"))&&Y(x,this,I).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 a=this._current.getFullYear(),i=this._current.getMonth()+1;(a!==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??"",a=t.href??"",i=t.startDate??t["start-date"]??t.start??t.date??"",n=t.endDate??t["end-date"]??t.end??"";return{title:e+"",description:s?s+"":void 0,href:a?a+"":void 0,start:i?i+"":void 0,end:n?n+"":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[n,d,l]=i;return e?new Date(n,d-1,l,23,59,59,999):new Date(n,d-1,l,0,0,0,0)}const a=new Date(s);return Number.isNaN(a.getTime())?null:a}_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 a=this._normalizeEventInput(s),i=a.start||"",n=a.end||"";if(!(!i||!a.title))if(i&&n){const d=this._toLocalEventDate(i,!1),l=this._toLocalEventDate(n,!0);if(!d||!l)continue;if(l<d){const c=i.split("T")[0],y=e.get(c)||[];y.push({title:a.title,description:a.description,href:a.href,start:i,end:n}),e.set(c,y);continue}for(let c=new Date(d);c<=l;c.setDate(c.getDate()+1)){const y=this._toDateKey(c),E=e.get(y)||[];E.push({title:a.title,description:a.description,href:a.href,start:i,end:n}),e.set(y,E)}}else{const d=i.split("T")[0],l=e.get(d)||[];l.push({title:a.title,description:a.description,href:a.href,start:i}),e.set(d,l)}}return e}_buildEventMapFromChildren(){const t=Array.from(this.querySelectorAll("scb-calendar-event")),e=new Map;for(const s of t){const a=s,i=(a.startDate??a.date??"")+""||s.getAttribute("start-date")||s.getAttribute("date")||"",n=(a.endDate??"")+""||s.getAttribute("end-date")||"";if(i&&n){const d=this._toLocalEventDate(i,!1),l=this._toLocalEventDate(n,!0);if(!d||!l)continue;if(l<d){const c=i.split("T")[0],y=e.get(c)||[];y.push({title:s.title??"",description:s.description,href:a.href||s.getAttribute("href")||void 0,start:i,end:n}),e.set(c,y);continue}for(let c=new Date(d);c<=l;c.setDate(c.getDate()+1)){const y=this._toDateKey(c),E=e.get(y)||[];E.push({title:s.title??"",description:s.description,href:a.href||s.getAttribute("href")||void 0,start:i,end:n}),e.set(y,E)}}else if(i&&s.title){const d=i.split("T")[0],l=e.get(d)||[];l.push({title:s.title,description:s.description,href:a.href||s.getAttribute("href")||void 0,start:i}),e.set(d,l)}}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}))}_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,a=e%4,i=e%7,n=(19*s+24)%30,d=(2*a+4*i+6*n+5)%7;let l=22+n+d,c=0;l==57&&(l-=7),l==56&&n==28&&d==6&&s>10&&(l-=7),l>31?(l-=31,c=4):c=3;const y=new Date(e,c-1,l);return this._easterDateCalculated["Ar"+t]=y,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,a=t.getDate(),i=t.getFullYear(),n=this._easterDay(i),d=this.lang==="en",l=[["Nyårsdagen","New Year's Day",s===1&&a===1],["Trettondedag jul","Epiphany",s===1&&a===6],["Långfredag","Good Friday",+t==+this._addDays(n,-2)],["Påskdagen","Easter Sunday",+t==+n],["Annandag påsk","Easter Monday",+t==+this._addDays(n,1)],["Kristi himmelsfärdsdag","Ascension Day",+t==+this._addDays(n,39)],["Pingstdagen","Pentecost",+t==+this._addDays(n,50)&&i<2005],["Första maj","May Day",s===5&&a===1],["Nationaldagen","National Day",s===6&&a===6&&i>=2005],["Midsommarafton","Midsummer's Eve",s===6&&a>=19&&a<=25&&t.getDay()===5],["Midsommardagen","Midsummer's Day",s===6&&a>=20&&a<=26&&t.getDay()===6],["Julafton","Christmas Eve",s===12&&a===24],["Juldagen","Christmas Day",s===12&&a===25],["Annandag jul","Boxing Day",s===12&&a===26],["Alla helgons dag","All Saints' Day",s===10&&a>=31&&t.getDay()===6||s===11&&a<=6&&t.getDay()===6]];for(const c of l){const[y,E,A]=c;if(A)return d?E:y}return null}render(){const t=this._current.getFullYear(),e=this._current.getMonth(),s=this._daysInMonth(t,e),a=this._firstDayOfWeek(t,e),i=this._today,n=this.lang==="en",d=n?["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 l=n?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(l=l.slice(0,5));const c=this._getEventInputs(),y=c?this._buildEventMapFromInputs(c):this._buildEventMapFromChildren(),E=[];let A=1;for(let r=0;r<6;r++){const h=[],f=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let p=A;for(let D=0;D<f.length;D++){const w=f[D];if(r===0&&w<a){if(!this.disableWeekend||w<5){const M=e===0?11:e-1,N=e===0?t-1:t,b=this._daysInMonth(N,M)-(a-w-1);h.push(T`
|
|
2
2
|
<div class="calendar-day calendar-day--other">
|
|
3
3
|
<span class="calendar-day-number">${b}</span>
|
|
4
4
|
</div>
|