scb-wc 0.1.108 → 0.1.109
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 +88 -93
- 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 +2 -2
- 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 +150 -33
- 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 +97 -0
- package/scb-wc.bundle.js +842 -842
- package/scb-wc.d.ts +194 -204
- package/shared/scb-icon-svg.js +2 -5
- package/mvc/components/scb-datepicker/scb-datepicker.js +0 -118
- 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 -102
- package/scb-components/scb-chevron/scb-chevron.d.ts +0 -11
- package/scb-components/scb-datepicker/scb-datepicker.d.ts +0 -41
- 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)
|
|
@@ -92,7 +111,7 @@ För MVC/MPA räcker det normalt att använda `scb-wc-selfhost.css`, eftersom de
|
|
|
92
111
|
|
|
93
112
|
## Alternativ 2: Använd i MVC/MPA via `<script type="module">`
|
|
94
113
|
|
|
95
|
-
Det här läget använder den färdig‑
|
|
114
|
+
Det här läget använder den färdig‑splittrade **MVC‑ESM**‑builden som följer med paketet under:
|
|
96
115
|
|
|
97
116
|
```text
|
|
98
117
|
node_modules/scb-wc/mvc/
|
|
@@ -105,7 +124,7 @@ Lägg till i din apps `package.json`:
|
|
|
105
124
|
```jsonc
|
|
106
125
|
{
|
|
107
126
|
"scripts": {
|
|
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
|
|
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);\""
|
|
109
128
|
}
|
|
110
129
|
}
|
|
111
130
|
```
|
|
@@ -153,7 +172,7 @@ Behöver du en annan webbrotsökväg (t.ex. om din `wwwroot` ligger någon annan
|
|
|
153
172
|
|
|
154
173
|
## Alternativ 3: Bundlad version (IIFE) för äldre miljöer
|
|
155
174
|
|
|
156
|
-
Om ESM inte stöds kan du använda den bundlade
|
|
175
|
+
Om ESM inte stöds kan du använda den bundlade varianten från paketroten.
|
|
157
176
|
Flytta följande tre filer från `node_modules/scb-wc` och använd dem i applikationen:
|
|
158
177
|
|
|
159
178
|
```text
|
|
@@ -176,7 +195,7 @@ node_modules/scb-wc/scb-typography.css
|
|
|
176
195
|
|
|
177
196
|
SCB Web Components fungerar även i Blazor‑appar när du vill använda samma komponenter i både MVC/MPA och Blazor.
|
|
178
197
|
|
|
179
|
-
Grundprincipen är
|
|
198
|
+
Grundprincipen är:
|
|
180
199
|
|
|
181
200
|
1. Använd MVC‑ESM‑builden (`node_modules/scb-wc/mvc`) och kopiera den till `wwwroot/ui` med `ui:install`.
|
|
182
201
|
2. Ladda `scb-blazor-bridge.js` från `wwwroot/ui` i din Blazor‑layout.
|
|
@@ -189,8 +208,8 @@ Lägg till ett script som kopierar interop-filen från `node_modules` till ditt
|
|
|
189
208
|
```jsonc
|
|
190
209
|
{
|
|
191
210
|
"scripts": {
|
|
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
|
|
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
|
|
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);\""
|
|
194
213
|
}
|
|
195
214
|
}
|
|
196
215
|
```
|
|
@@ -204,13 +223,13 @@ Exempel på layout:
|
|
|
204
223
|
<script type="module" src="~/ui/scb-blazor-bridge.js"></script>
|
|
205
224
|
```
|
|
206
225
|
|
|
207
|
-
`ScbBlazorInteropBase`
|
|
226
|
+
`ScbBlazorInteropBase` kan återanvändas mellan projekt som använder både `scb-wc@latest` och `scb-wc@next`.
|
|
208
227
|
|
|
209
228
|
---
|
|
210
229
|
|
|
211
230
|
## Viktigt
|
|
212
231
|
|
|
213
|
-
- `scb-wc@
|
|
232
|
+
- `scb-wc@latest` är produktionskanalen. Använd `scb-wc@next` för komponenter under utveckling och experiment.
|
|
214
233
|
- **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`).
|
|
215
234
|
- **Blanda inte MVC‑ESM och IIFE på samma sida.** Välj en distributionsform per sida/app.
|
|
216
235
|
- **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';
|
|
@@ -97,6 +95,3 @@ import './scb-viz/scb-viz-series-differentiation-registry.js';
|
|
|
97
95
|
import './scb-viz/scb-viz-series-differentiation-runtime.js';
|
|
98
96
|
import './scb-viz/scb-viz-table-runtime.js';
|
|
99
97
|
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';
|
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,66 +35,64 @@ 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 {
|
|
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
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
|
|
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, 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, ie as ScbGalleryGrid, Q as ScbGrid, X as ScbGridItem, le as ScbHeader, ae as ScbHeaderMenuGroup, oe as ScbHeaderMenuItem, se as ScbHeaderTab, ce as ScbHeaderUtility, ne as ScbHorizontalScroller, m as ScbIconButton, ue as ScbKeyFigureCard, y as ScbLink, d as ScbLinkCard, F as ScbList, f as ScbListCard, P as ScbListItem, me as ScbMenu, de as ScbMenuItem, ge as ScbNav, he as ScbNavItem, _e as ScbNotificationCard, W as ScbOptionsMenu, H as ScbOptionsMenuItem, U as ScbOptionsSubMenu, re as ScbOverlay, ve as ScbPagination, Fe as ScbPrimaryTab, ye as ScbProgressIndicator, be as ScbProgressStep, xe as ScbProgressStepper, A as ScbRadioButton, k as ScbRadioGroup, Se as ScbScrollspy, h as ScbSearch, Ie as ScbSecondaryTab, we as ScbSegmentedButton, Ce as ScbSegmentedItem, Ee as ScbSelect, Te as ScbSelectOption, De as ScbSkeleton, Oe as ScbSlider, ke as ScbSnackbar, p as ScbSocialCard, Z as ScbStack, Ae as ScbStatusPill, je as ScbStep, Me as ScbStepper, pe as ScbSubmenu, j as ScbSwitch, Ne as ScbTable, Pe as ScbTableAdvanced, Le as ScbTabs, E as ScbTextField, ze as ScbToc, Re as ScbTocItem, T as ScbTooltip, jt as ScbViz, fe 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, ee as hasScbSvgIcon, Ot as inferScbVizTableAlignments, Je as isScbVizFullscreenSupported, bt as isScbVizGroupedSeriesDifferentiationChart, xt as isScbVizHighchartsStyledMode, kt as normalizeScbVizRenderableCell, Ye as openScbVizPrintFrame, At as readScbVizTableDataFromSlot, te 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 };
|
|
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 { ScbHorizontalScroller as J } from "./scb-horizontal-scroller/scb-horizontal-scroller.js";
|
|
55
|
+
import { ScbOverlay as Y } from "./scb-overlay/scb-overlay.js";
|
|
56
|
+
import { ScbGalleryGrid as X } from "./scb-gallery-grid/scb-gallery-grid.js";
|
|
57
|
+
import { ScbHeaderMenuGroup as Z } from "./scb-header/scb-header-menu-group.js";
|
|
58
|
+
import { ScbHeaderMenuItem as Q } from "./scb-header/scb-header-menu-item.js";
|
|
59
|
+
import { ScbHeaderTab as $ } from "./scb-header/scb-header-tab.js";
|
|
60
|
+
import { ScbHeaderUtility as ee } from "./scb-header/scb-header-utility.js";
|
|
61
|
+
import { ScbHeader as te } from "./scb-header/scb-header.js";
|
|
62
|
+
import { ScbKeyFigureCard as ne } from "./scb-keyfigure-card/scb-keyfigure-card.js";
|
|
63
|
+
import { ScbMenuItem as re } from "./scb-menu/scb-menu-item.js";
|
|
64
|
+
import { ScbmenuSection as ie } from "./scb-menu/scb-menu-section.js";
|
|
65
|
+
import { ScbSubmenu as ae } from "./scb-menu/scb-sub-menu.js";
|
|
66
|
+
import { ScbMenu as oe } from "./scb-menu/scb-menu.js";
|
|
67
|
+
import { ScbNavItem as se } from "./scb-nav/scb-nav-item.js";
|
|
68
|
+
import { ScbNav as ce } from "./scb-nav/scb-nav.js";
|
|
69
|
+
import { ScbNotificationCard as le } from "./scb-notification-card/scb-notification-card.js";
|
|
70
|
+
import { ScbPagination as ue } from "./scb-pagination/scb-pagination.js";
|
|
71
|
+
import { ScbProgressIndicator as de } from "./scb-progress-indicator/scb-progress-indicator.js";
|
|
72
|
+
import { ScbProgressStep as fe } from "./scb-progress-stepper/scb-progress-step.js";
|
|
73
|
+
import { ScbProgressStepper as pe } from "./scb-progress-stepper/scb-progress-stepper.js";
|
|
74
|
+
import { ScbScrollspy as me } from "./scb-scrollspy/scb-scrollspy.js";
|
|
75
|
+
import { ScbSegmentedItem as he } from "./scb-segmented-button/scb-segmented-item.js";
|
|
76
|
+
import { ScbSegmentedButton as ge } from "./scb-segmented-button/scb-segmented-button.js";
|
|
77
|
+
import { ScbSelectOption as _e } from "./scb-select/scb-select-option.js";
|
|
78
|
+
import { ScbSelect as ve } from "./scb-select/scb-select.js";
|
|
79
|
+
import { ScbSkeleton as ye } from "./scb-skeleton/scb-skeleton.js";
|
|
80
|
+
import { ScbSlider as be } from "./scb-slider/scb-slider.js";
|
|
81
|
+
import { ScbSnackbar as xe } from "./scb-snackbar/scb-snackbar.js";
|
|
82
|
+
import { ScbStatusPill as Se } from "./scb-status-pill/scb-status-pill.js";
|
|
83
|
+
import { ScbStep as Ce } from "./scb-stepper/scb-step.js";
|
|
84
|
+
import { ScbStepper as we } from "./scb-stepper/scb-stepper.js";
|
|
85
|
+
import { ScbTable as Te } from "./scb-table/scb-table.js";
|
|
86
|
+
import { ScbTableAdvanced as Ee } from "./scb-table-advanced/scb-table-advanced.js";
|
|
87
|
+
import { ScbPrimaryTab as De } from "./scb-tabs/scb-primary-tab.js";
|
|
88
|
+
import { ScbSecondaryTab as Oe } from "./scb-tabs/scb-secondary-tab.js";
|
|
89
|
+
import { ScbTabs as ke } from "./scb-tabs/scb-tabs.js";
|
|
90
|
+
import { ScbTocItem as Ae } from "./scb-toc/scb-toc-item.js";
|
|
91
|
+
import { ScbToc as je } from "./scb-toc/scb-toc.js";
|
|
92
|
+
import { buildScbVizExportFileName as Me, createScbVizCsvBlob as Ne, createScbVizRasterBlobFromElement as Pe, createScbVizRasterDataUrlFromElement as Fe, downloadScbVizBlob as Ie, getScbVizCurrentFullscreenElement as Le, getScbVizExportBaseFileName as Re, getScbVizFullscreenDocument as ze, isScbVizFullscreenSupported as Be, openScbVizPrintFrame as Ve, runWithScbVizForcedPrintLightMode as He, toggleScbVizFullscreen as Ue } from "./scb-viz/scb-viz-actions-runtime.js";
|
|
93
|
+
import { buildScbVizPrintDocumentHtml as We, buildScbVizPrintableFooterHtml as Ge, buildScbVizPrintableTableHtml as Ke } from "./scb-viz/scb-viz-print-runtime.js";
|
|
94
|
+
import { appendScbVizSeriesDifferentiationPatternMarks as qe, getScbVizSeriesDifferentiationPatternDefinition as Je, getScbVizSeriesDifferentiationPatternKinds as Ye, getScbVizSeriesDifferentiationRegistry as Xe, getScbVizSeriesDifferentiationVariant as Ze, scbVizSeriesDifferentiationRegistry as Qe } from "./scb-viz/scb-viz-series-differentiation-registry.js";
|
|
95
|
+
import { clearScbVizSeriesDifferentiationColorClass as $e, clearScbVizSeriesDifferentiationMetadata as et, ensureScbVizGroupedSeriesDifferentiationStore as tt, ensureScbVizStyledModeSeriesPattern as nt, getScbVizGroupedSeriesDifferentiationKey as rt, getScbVizGroupedSeriesDifferentiationVariant as it, getScbVizGroupedSeriesDifferentiationVariantIndex as at, getScbVizHighchartsColorClassName as ot, getScbVizHighchartsSvgElement as st, getScbVizHighchartsSvgRoot as ct, getScbVizLegendSeriesDifferentiationTargets as lt, getScbVizSeriesDifferentiationColorIndex as ut, getScbVizSeriesDifferentiationVariantByIndex as dt, isScbVizGroupedSeriesDifferentiationChart as ft, isScbVizHighchartsStyledMode as pt, setScbVizSeriesDifferentiationColorClass as mt, setScbVizSeriesDifferentiationMetadata as ht, shouldShowScbVizSeriesDifferentiationAction as gt, usesScbVizGroupedPointDifferentiation as _t } from "./scb-viz/scb-viz-series-differentiation-runtime.js";
|
|
96
|
+
import { buildScbVizResolvedTableView as vt, createScbVizCsvRows as yt, inferScbVizTableAlignments as bt, normalizeScbVizRenderableCell as xt, readScbVizTableDataFromSlot as St } from "./scb-viz/scb-viz-table-runtime.js";
|
|
97
|
+
import { ScbViz as Ct } from "./scb-viz/scb-viz.js";
|
|
98
|
+
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 ScbGalleryGrid, K as ScbGrid, W as ScbGridItem, te as ScbHeader, Z as ScbHeaderMenuGroup, Q as ScbHeaderMenuItem, $ as ScbHeaderTab, ee as ScbHeaderUtility, J as ScbHorizontalScroller, l as ScbIconButton, ne as ScbKeyFigureCard, m as ScbLink, o as ScbLinkCard, k as ScbList, s as ScbListCard, O as ScbListItem, oe as ScbMenu, re as ScbMenuItem, ce as ScbNav, se as ScbNavItem, le as ScbNotificationCard, R as ScbOptionsMenu, I as ScbOptionsMenuItem, L as ScbOptionsSubMenu, Y as ScbOverlay, ue as ScbPagination, De as ScbPrimaryTab, de as ScbProgressIndicator, fe as ScbProgressStep, pe as ScbProgressStepper, w as ScbRadioButton, C as ScbRadioGroup, me as ScbScrollspy, u as ScbSearch, Oe as ScbSecondaryTab, ge as ScbSegmentedButton, he as ScbSegmentedItem, ve as ScbSelect, _e as ScbSelectOption, ye as ScbSkeleton, be as ScbSlider, xe as ScbSnackbar, c as ScbSocialCard, G as ScbStack, Se as ScbStatusPill, Ce as ScbStep, we as ScbStepper, ae as ScbSubmenu, T as ScbSwitch, Te as ScbTable, Ee as ScbTableAdvanced, ke as ScbTabs, b as ScbTextField, je as ScbToc, Ae as ScbTocItem, y as ScbTooltip, Ct as ScbViz, ie as ScbmenuSection, qe as appendScbVizSeriesDifferentiationPatternMarks, Me as buildScbVizExportFileName, We as buildScbVizPrintDocumentHtml, Ge as buildScbVizPrintableFooterHtml, Ke as buildScbVizPrintableTableHtml, vt as buildScbVizResolvedTableView, $e as clearScbVizSeriesDifferentiationColorClass, et as clearScbVizSeriesDifferentiationMetadata, Ne as createScbVizCsvBlob, yt as createScbVizCsvRows, Pe as createScbVizRasterBlobFromElement, Fe as createScbVizRasterDataUrlFromElement, Ie as downloadScbVizBlob, tt as ensureScbVizGroupedSeriesDifferentiationStore, nt as ensureScbVizStyledModeSeriesPattern, Le as getScbVizCurrentFullscreenElement, Re as getScbVizExportBaseFileName, ze as getScbVizFullscreenDocument, rt as getScbVizGroupedSeriesDifferentiationKey, it as getScbVizGroupedSeriesDifferentiationVariant, at as getScbVizGroupedSeriesDifferentiationVariantIndex, ot as getScbVizHighchartsColorClassName, st as getScbVizHighchartsSvgElement, ct as getScbVizHighchartsSvgRoot, lt as getScbVizLegendSeriesDifferentiationTargets, ut as getScbVizSeriesDifferentiationColorIndex, Je as getScbVizSeriesDifferentiationPatternDefinition, Ye as getScbVizSeriesDifferentiationPatternKinds, Xe as getScbVizSeriesDifferentiationRegistry, Ze as getScbVizSeriesDifferentiationVariant, dt as getScbVizSeriesDifferentiationVariantByIndex, bt as inferScbVizTableAlignments, Be as isScbVizFullscreenSupported, ft as isScbVizGroupedSeriesDifferentiationChart, pt as isScbVizHighchartsStyledMode, xt as normalizeScbVizRenderableCell, Ve as openScbVizPrintFrame, St as readScbVizTableDataFromSlot, He as runWithScbVizForcedPrintLightMode, Qe as scbVizSeriesDifferentiationRegistry, mt as setScbVizSeriesDifferentiationColorClass, ht as setScbVizSeriesDifferentiationMetadata, gt as shouldShowScbVizSeriesDifferentiationAction, Ue as toggleScbVizFullscreen, _t 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';
|
|
@@ -97,6 +95,3 @@ import './scb-viz/scb-viz-print-runtime.js';
|
|
|
97
95
|
import './scb-viz/scb-viz-series-differentiation-registry.js';
|
|
98
96
|
import './scb-viz/scb-viz-series-differentiation-runtime.js';
|
|
99
97
|
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{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 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=["../../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 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 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 P(){return f??(f=x(()=>import("../../vendor/lazy-focus-ring.js").then(p=>p.i),__vite__mapDeps([0,1,2]),import.meta.url)),f}function k(){return m??(m=x(()=>import("../../vendor/lazy-ripple.js"),__vite__mapDeps([3,2]),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 d=v.attributeName,g=this.getAttribute(d);if(d==="aria-label"){const _=(g||(this.label.trim()===""&&!this.__hasDefaultSlotContent?(this.icon||"").trim():"")).trim();_?u.setAttribute("aria-label",_):u.removeAttribute("aria-label")}else(d==="aria-controls"||d==="aria-expanded")&&(g===null?u.removeAttribute(d):u.setAttribute(d,g),d==="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 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([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{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`
|
|
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`
|
|
2
2
|
<div class="calendar-day calendar-day--other">
|
|
3
3
|
<span class="calendar-day-number">${b}</span>
|
|
4
4
|
</div>
|