scb-wc 0.1.165 → 0.1.166
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 +30 -17
- package/all.js +5 -0
- package/index.js +95 -90
- 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 +2 -2
- package/mvc/{vendor → components/scb-chevron}/scb-chevron.js +1 -1
- package/mvc/components/scb-datepicker/scb-datepicker.js +132 -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 +2 -2
- package/mvc/components/scb-menu/scb-menu-item.js +1 -1
- package/mvc/components/scb-nav/scb-nav.js +1 -1
- package/mvc/components/scb-options-menu/scb-options-menu-item.js +1 -1
- package/mvc/components/scb-progress-stepper/scb-progress-step.js +1 -1
- package/mvc/components/scb-search/scb-search.js +1 -1
- package/mvc/components/scb-segmented-button/scb-segmented-item.js +3 -3
- 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 +40 -171
- 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/package.json +2 -2
- package/scb-components/index.d.ts +104 -0
- package/scb-components/scb-chevron/scb-chevron.d.ts +11 -0
- package/scb-components/scb-datepicker/scb-datepicker.d.ts +45 -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-wc.bundle.js +258 -258
- package/scb-wc.d.ts +208 -198
- package/shared/scb-icon-svg.js +5 -2
- 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 -99
package/README.md
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
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 innehåller SCB:s gemensamma webbkomponenter.
|
|
4
7
|
|
|
5
8
|
## Dokumentation
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
Previewkomponenterna dokumenteras och demonstreras i Storybook på SCB:s interna testadress:
|
|
8
11
|
|
|
9
|
-
-
|
|
12
|
+
- Test: <https://webcomponentstest.scb.intra>
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
Den publika/stabila Storybooken finns på:
|
|
12
15
|
|
|
13
|
-
-
|
|
16
|
+
- Prod: <https://webcomponents.scb.intra>
|
|
14
17
|
|
|
15
18
|
## Kom igång
|
|
16
19
|
|
|
@@ -19,7 +22,7 @@ Testkomponenterna finns på:
|
|
|
19
22
|
Välj den teknik du använder. Exemplet skapar en vanlig webbplats:
|
|
20
23
|
|
|
21
24
|
```sh
|
|
22
|
-
npx scb-wc init html my-app
|
|
25
|
+
npx scb-wc@next init html my-app
|
|
23
26
|
cd my-app
|
|
24
27
|
npm install
|
|
25
28
|
npm run dev
|
|
@@ -36,7 +39,7 @@ Byt `html` mot:
|
|
|
36
39
|
Kör kommandot i mappen där appens `package.json` ligger:
|
|
37
40
|
|
|
38
41
|
```sh
|
|
39
|
-
npm install scb-wc
|
|
42
|
+
npm install scb-wc@next
|
|
40
43
|
```
|
|
41
44
|
|
|
42
45
|
Importera CSS och bara de komponenter som sidan använder:
|
|
@@ -55,9 +58,9 @@ Lägg sedan komponenten i sidan:
|
|
|
55
58
|
|
|
56
59
|
### Nästa steg
|
|
57
60
|
|
|
58
|
-
- Öppna Kom igång i [
|
|
59
|
-
- Öppna [mallar och exempel](https://
|
|
60
|
-
- Öppna [komponentöversikten](https://
|
|
61
|
+
- Öppna Kom igång i [Test Storybook](https://webcomponentstest.scb.intra/?path=/docs/docs-kom-igång--beskrivning) för HTML/CSS, React, MVC och Blazor.
|
|
62
|
+
- Öppna [mallar och exempel](https://webcomponentstest.scb.intra/?path=/docs/examples-and-templates-att-använda-mallar-och-exempel--beskrivning) när du vill bygga en hel sida.
|
|
63
|
+
- Öppna [komponentöversikten](https://webcomponentstest.scb.intra/?path=/story/components-översikt-alla-komponenter-exposé--expose) när du vill välja nästa komponent.
|
|
61
64
|
|
|
62
65
|
## Kort referens
|
|
63
66
|
|
|
@@ -85,15 +88,15 @@ Webbplatsmallarna använder standardläget. Service- och appmallarna laddar Comp
|
|
|
85
88
|
|
|
86
89
|
### MVC och statiska webbplatser
|
|
87
90
|
|
|
88
|
-
Paketets färdiga MVC-filer ligger i `node_modules/scb-wc/mvc/`. Följ det kopierbara MVC-exemplet i [Kom igång](https://
|
|
91
|
+
Paketets färdiga MVC-filer ligger i `node_modules/scb-wc/mvc/`. Följ det kopierbara MVC-exemplet i [Kom igång](https://webcomponentstest.scb.intra/?path=/docs/docs-kom-igång--beskrivning). Det visar vilket `ui:install`-script som ska läggas i appens `package.json` och vilka filer layouten ska ladda.
|
|
89
92
|
|
|
90
93
|
### Blazor
|
|
91
94
|
|
|
92
|
-
Blazor använder samma MVC-filer plus wrappers och interop under `node_modules/scb-wc/blazor/`. Följ [Kom igång](https://
|
|
95
|
+
Blazor använder samma MVC-filer plus wrappers och interop under `node_modules/scb-wc/blazor/`. Följ [Kom igång](https://webcomponentstest.scb.intra/?path=/docs/docs-kom-igång--beskrivning) för första installationen och [Blazor-guiden](https://webcomponentstest.scb.intra/?path=/docs/docs-om-användning-i-blazor--beskrivning) när integrationen behöver state, parametrar eller events.
|
|
93
96
|
|
|
94
97
|
### Fonter och egna ikoner
|
|
95
98
|
|
|
96
|
-
Vanliga appar använder `scb-wc.css`. Selfhost och egna Material Symbols-subset är avancerade val. Följ [Foundations/Icons](https://
|
|
99
|
+
Vanliga appar använder `scb-wc.css`. Selfhost och egna Material Symbols-subset är avancerade val. Följ [Foundations/Icons](https://webcomponentstest.scb.intra/?path=/docs/foundations-icons-ikoner--beskrivning) om appen inte får ladda Google Fonts eller behöver fler ikoner än paketets `icons.json`.
|
|
97
100
|
|
|
98
101
|
### Bundlad version
|
|
99
102
|
|
|
@@ -109,14 +112,24 @@ Blanda inte bundle och MVC-ESM på samma sida.
|
|
|
109
112
|
|
|
110
113
|
### Uppdatera paketet
|
|
111
114
|
|
|
112
|
-
Kör i appens mapp
|
|
115
|
+
Kör först i appens mapp:
|
|
113
116
|
|
|
114
117
|
```sh
|
|
115
|
-
npm
|
|
118
|
+
npm outdated scb-wc
|
|
116
119
|
```
|
|
117
120
|
|
|
121
|
+
Om en ny version finns, läs [Uppdatera SCB Web Components](https://webcomponentstest.scb.intra/?path=/docs/docs-uppdatera-version-i-din-app--beskrivning). Där står om versionen kräver ändringar i appen och eventuella migrationssteg.
|
|
122
|
+
|
|
123
|
+
Uppdatera sedan paketet, bygg appen och kör appens vanliga tester:
|
|
124
|
+
|
|
125
|
+
```sh
|
|
126
|
+
npm install scb-wc@next
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
För MVC och Blazor behöver du även köra appens befintliga kopieringsscript efter installationen. Exakta steg finns på uppdateringssidan.
|
|
130
|
+
|
|
118
131
|
## Viktigt
|
|
119
132
|
|
|
120
|
-
- `scb-wc@
|
|
133
|
+
- `scb-wc@next` är **previewkanalen**. Komponenter kan ändras eller tas bort mellan versioner. Använd `scb-wc@latest` i externa produktionsmiljöer.
|
|
121
134
|
- Kör alltid npm-kommandon i mappen där appens `package.json` ligger.
|
|
122
135
|
- Ladda inte samma komponent på flera sätt på samma sida.
|
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';
|
|
@@ -97,3 +99,6 @@ import './scb-viz/scb-viz-series-differentiation-registry.js';
|
|
|
97
99
|
import './scb-viz/scb-viz-series-differentiation-runtime.js';
|
|
98
100
|
import './scb-viz/scb-viz-table-runtime.js';
|
|
99
101
|
import './scb-viz/scb-viz.js';
|
|
102
|
+
import './shared/lazy-focus-ring.js';
|
|
103
|
+
import './shared/lazy-ripple.js';
|
|
104
|
+
import './shared/scb-icon-svg.js';
|
package/index.js
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { addLazyFocusRingListeners as e, ensureFocusRingOnFocusVisible as t, ensureFocusRingOnTab as n, ensureFocusRingReady as r } from "./shared/lazy-focus-ring.js";
|
|
2
|
+
import { ScbAvatar as i } from "./scb-avatar/scb-avatar.js";
|
|
3
|
+
import { ScbChevron as a } from "./scb-chevron/scb-chevron.js";
|
|
4
|
+
import { ScbAccordionItem as o } from "./scb-accordion/scb-accordion-item.js";
|
|
5
|
+
import { ScbButton as s } from "./scb-button/scb-button.js";
|
|
6
|
+
import { ScbAccordion as c } from "./scb-accordion/scb-accordion.js";
|
|
7
|
+
import { ScbActionCard as l, ScbCard as u, ScbContainerCard as d, ScbLinkCard as f, ScbListCard as p, ScbSocialCard as m } from "./scb-card/scb-card.js";
|
|
6
8
|
import "./scb-action-card/scb-action-card.js";
|
|
7
|
-
import { ScbIconButton as
|
|
8
|
-
import { ScbSearch 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 {
|
|
28
|
-
import {
|
|
9
|
+
import { ScbIconButton as h } from "./scb-icon-button/scb-icon-button.js";
|
|
10
|
+
import { ScbSearch as g } from "./scb-search/scb-search.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 { ScbTooltip as T } from "./scb-tooltip/scb-tooltip.js";
|
|
20
|
+
import { ScbTextField as E } from "./scb-textfield/scb-textfield.js";
|
|
21
|
+
import { ScbCheckboxGroup as D } from "./scb-checkbox/scb-checkbox-group.js";
|
|
22
|
+
import { ScbCheckbox as O } from "./scb-checkbox/scb-checkbox.js";
|
|
23
|
+
import { ScbRadioGroup as k } from "./scb-radio-button/scb-radio-group.js";
|
|
24
|
+
import { ScbRadioButton as A } from "./scb-radio-button/scb-radio-button.js";
|
|
25
|
+
import { ScbSwitch as j } from "./scb-switch/scb-switch.js";
|
|
26
|
+
import { ScbChip as M } from "./scb-chip/scb-chip.js";
|
|
27
|
+
import { ScbDialog as N } from "./scb-dialog/scb-dialog.js";
|
|
28
|
+
import { ScbListItem as P } from "./scb-list/scb-list-item.js";
|
|
29
|
+
import { ScbList as F } from "./scb-list/scb-list.js";
|
|
30
|
+
import { ScbCalendar as I } from "./scb-calendar/scb-calendar.js";
|
|
31
|
+
import { ScbCalendarCard as L } from "./scb-calendar-card/scb-calendar-card.js";
|
|
29
32
|
import "./scb-card/scb-action-card.js";
|
|
30
33
|
import "./scb-container-card/scb-container-card.js";
|
|
31
34
|
import "./scb-card/scb-container-card.js";
|
|
@@ -35,66 +38,68 @@ import "./scb-list-card/scb-list-card.js";
|
|
|
35
38
|
import "./scb-card/scb-list-card.js";
|
|
36
39
|
import "./scb-social-card/scb-social-card.js";
|
|
37
40
|
import "./scb-card/scb-social-card.js";
|
|
38
|
-
import { ScbCollapse as
|
|
39
|
-
import { ScbCookiesConsent as
|
|
40
|
-
import { ScbDrawer as
|
|
41
|
-
import { ScbDropZone as
|
|
42
|
-
import { ScbOptionsMenuItem as
|
|
43
|
-
import { ScbOptionsSubMenu as
|
|
44
|
-
import { ScbOptionsMenu as
|
|
45
|
-
import { ScbDropdown as
|
|
46
|
-
import { ScbFab as
|
|
47
|
-
import { ScbFactCardContent as
|
|
48
|
-
import { ScbFactCard as
|
|
49
|
-
import { ScbFooterSection as
|
|
50
|
-
import { ScbGridItem as
|
|
51
|
-
import { ScbStack as
|
|
52
|
-
import { ScbGrid as
|
|
53
|
-
import { ScbFooter as
|
|
54
|
-
import { ScbIcon as
|
|
55
|
-
import { ScbNotificationCard as
|
|
56
|
-
import { ScbFormErrorSummary 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
|
-
|
|
41
|
+
import { ScbCollapse as R } from "./scb-collapse/scb-collapse.js";
|
|
42
|
+
import { ScbCookiesConsent as z } from "./scb-cookies-consent/scb-cookies-consent.js";
|
|
43
|
+
import { ScbDrawer as B } from "./scb-drawer/scb-drawer.js";
|
|
44
|
+
import { ScbDropZone as V } from "./scb-drop-zone/scb-drop-zone.js";
|
|
45
|
+
import { ScbOptionsMenuItem as H } from "./scb-options-menu/scb-options-menu-item.js";
|
|
46
|
+
import { ScbOptionsSubMenu as U } from "./scb-options-menu/scb-options-sub-menu.js";
|
|
47
|
+
import { ScbOptionsMenu as W } from "./scb-options-menu/scb-options-menu.js";
|
|
48
|
+
import { ScbDropdown as G } from "./scb-dropdown/scb-dropdown.js";
|
|
49
|
+
import { ScbFab as K } from "./scb-fab/scb-fab.js";
|
|
50
|
+
import { ScbFactCardContent as q } from "./scb-fact-card/scb-fact-card-content.js";
|
|
51
|
+
import { ScbFactCard as J } from "./scb-fact-card/scb-fact-card.js";
|
|
52
|
+
import { ScbFooterSection as Y } from "./scb-footer/scb-footer-section.js";
|
|
53
|
+
import { ScbGridItem as X } from "./scb-grid/scb-grid-item.js";
|
|
54
|
+
import { ScbStack as Z } from "./scb-grid/scb-stack.js";
|
|
55
|
+
import { ScbGrid as Q } from "./scb-grid/scb-grid.js";
|
|
56
|
+
import { ScbFooter as $ } from "./scb-footer/scb-footer.js";
|
|
57
|
+
import { ScbIcon as ee } from "./scb-icon/scb-icon.js";
|
|
58
|
+
import { ScbNotificationCard as te } from "./scb-notification-card/scb-notification-card.js";
|
|
59
|
+
import { ScbFormErrorSummary as ne } from "./scb-form-error-summary/scb-form-error-summary.js";
|
|
60
|
+
import { hasScbSvgIcon as re, renderScbIcon as ie } from "./shared/scb-icon-svg.js";
|
|
61
|
+
import { ScbHorizontalScroller as ae } from "./scb-horizontal-scroller/scb-horizontal-scroller.js";
|
|
62
|
+
import { ScbOverlay as oe } from "./scb-overlay/scb-overlay.js";
|
|
63
|
+
import { ScbGalleryGrid as se } from "./scb-gallery-grid/scb-gallery-grid.js";
|
|
64
|
+
import { ScbHeaderMenuGroup as ce } from "./scb-header/scb-header-menu-group.js";
|
|
65
|
+
import { ScbHeaderMenuItem as le } from "./scb-header/scb-header-menu-item.js";
|
|
66
|
+
import { ScbHeaderTab as ue } from "./scb-header/scb-header-tab.js";
|
|
67
|
+
import { ScbHeaderUtility as de } from "./scb-header/scb-header-utility.js";
|
|
68
|
+
import { ScbHeader as fe } from "./scb-header/scb-header.js";
|
|
69
|
+
import { ScbKeyFigureCard as pe } from "./scb-keyfigure-card/scb-keyfigure-card.js";
|
|
70
|
+
import { ScbMenuItem as me } from "./scb-menu/scb-menu-item.js";
|
|
71
|
+
import { ScbmenuSection as he } from "./scb-menu/scb-menu-section.js";
|
|
72
|
+
import { ScbSubmenu as ge } from "./scb-menu/scb-sub-menu.js";
|
|
73
|
+
import { ScbMenu as _e } from "./scb-menu/scb-menu.js";
|
|
74
|
+
import { ScbNavItem as ve } from "./scb-nav/scb-nav-item.js";
|
|
75
|
+
import { ScbNav as ye } from "./scb-nav/scb-nav.js";
|
|
76
|
+
import { ScbPagination as be } from "./scb-pagination/scb-pagination.js";
|
|
77
|
+
import { ScbProgressIndicator as xe } from "./scb-progress-indicator/scb-progress-indicator.js";
|
|
78
|
+
import { ScbProgressStep as Se } from "./scb-progress-stepper/scb-progress-step.js";
|
|
79
|
+
import { ScbProgressStepper as Ce } from "./scb-progress-stepper/scb-progress-stepper.js";
|
|
80
|
+
import { ScbScrollspy as we } from "./scb-scrollspy/scb-scrollspy.js";
|
|
81
|
+
import { ScbSegmentedItem as Te } from "./scb-segmented-button/scb-segmented-item.js";
|
|
82
|
+
import { ScbSegmentedButton as Ee } from "./scb-segmented-button/scb-segmented-button.js";
|
|
83
|
+
import { ScbSelectOption as De } from "./scb-select/scb-select-option.js";
|
|
84
|
+
import { ScbSelect as Oe } from "./scb-select/scb-select.js";
|
|
85
|
+
import { ScbSkeleton as ke } from "./scb-skeleton/scb-skeleton.js";
|
|
86
|
+
import { ScbSlider as Ae } from "./scb-slider/scb-slider.js";
|
|
87
|
+
import { ScbSnackbar as je } from "./scb-snackbar/scb-snackbar.js";
|
|
88
|
+
import { ScbStatusPill as Me } from "./scb-status-pill/scb-status-pill.js";
|
|
89
|
+
import { ScbStep as Ne } from "./scb-stepper/scb-step.js";
|
|
90
|
+
import { ScbStepper as Pe } from "./scb-stepper/scb-stepper.js";
|
|
91
|
+
import { ScbTable as Fe } from "./scb-table/scb-table.js";
|
|
92
|
+
import { ScbTableAdvanced as Ie } from "./scb-table-advanced/scb-table-advanced.js";
|
|
93
|
+
import { ScbPrimaryTab as Le } from "./scb-tabs/scb-primary-tab.js";
|
|
94
|
+
import { ScbSecondaryTab as Re } from "./scb-tabs/scb-secondary-tab.js";
|
|
95
|
+
import { ScbTabs as ze } from "./scb-tabs/scb-tabs.js";
|
|
96
|
+
import { ScbTocItem as Be } from "./scb-toc/scb-toc-item.js";
|
|
97
|
+
import { ScbToc as Ve } from "./scb-toc/scb-toc.js";
|
|
98
|
+
import { buildScbVizExportFileName as He, createScbVizCsvBlob as Ue, createScbVizRasterBlobFromElement as We, createScbVizRasterDataUrlFromElement as Ge, downloadScbVizBlob as Ke, getScbVizCurrentFullscreenElement as qe, getScbVizExportBaseFileName as Je, getScbVizFullscreenDocument as Ye, isScbVizFullscreenSupported as Xe, openScbVizPrintFrame as Ze, runWithScbVizForcedPrintLightMode as Qe, toggleScbVizFullscreen as $e } from "./scb-viz/scb-viz-actions-runtime.js";
|
|
99
|
+
import { buildScbVizPrintDocumentHtml as et, buildScbVizPrintableFooterHtml as tt, buildScbVizPrintableTableHtml as nt } from "./scb-viz/scb-viz-print-runtime.js";
|
|
100
|
+
import { appendScbVizSeriesDifferentiationPatternMarks as rt, getScbVizSeriesDifferentiationPatternDefinition as it, getScbVizSeriesDifferentiationPatternKinds as at, getScbVizSeriesDifferentiationRegistry as ot, getScbVizSeriesDifferentiationVariant as st, scbVizSeriesDifferentiationRegistry as ct } from "./scb-viz/scb-viz-series-differentiation-registry.js";
|
|
101
|
+
import { clearScbVizSeriesDifferentiationColorClass as lt, clearScbVizSeriesDifferentiationMetadata as ut, ensureScbVizGroupedSeriesDifferentiationStore as dt, ensureScbVizStyledModeSeriesPattern as ft, getScbVizGroupedSeriesDifferentiationKey as pt, getScbVizGroupedSeriesDifferentiationVariant as mt, getScbVizGroupedSeriesDifferentiationVariantIndex as ht, getScbVizHighchartsColorClassName as gt, getScbVizHighchartsSvgElement as _t, getScbVizHighchartsSvgRoot as vt, getScbVizLegendSeriesDifferentiationTargets as yt, getScbVizSeriesDifferentiationColorIndex as bt, getScbVizSeriesDifferentiationVariantByIndex as xt, isScbVizGroupedSeriesDifferentiationChart as St, isScbVizHighchartsStyledMode as Ct, setScbVizSeriesDifferentiationColorClass as wt, setScbVizSeriesDifferentiationMetadata as Tt, shouldShowScbVizSeriesDifferentiationAction as Et, usesScbVizGroupedPointDifferentiation as Dt } from "./scb-viz/scb-viz-series-differentiation-runtime.js";
|
|
102
|
+
import { buildScbVizResolvedTableView as Ot, createScbVizCsvRows as kt, inferScbVizTableAlignments as At, normalizeScbVizRenderableCell as jt, readScbVizTableDataFromSlot as Mt } from "./scb-viz/scb-viz-table-runtime.js";
|
|
103
|
+
import { ScbViz as Nt } from "./scb-viz/scb-viz.js";
|
|
104
|
+
import { ensureRippleReady as Pt, syncRippleToControl as Ft } from "./shared/lazy-ripple.js";
|
|
105
|
+
export { x as SCBBreadcrumb, b as SCBBreadcrumbItem, c as ScbAccordion, o as ScbAccordionItem, l as ScbActionCard, _ as ScbAppBar, i as ScbAvatar, v as ScbBadge, s as ScbButton, I as ScbCalendar, L as ScbCalendarCard, S as ScbCalendarEvent, u as ScbCard, O as ScbCheckbox, D as ScbCheckboxGroup, a as ScbChevron, M as ScbChip, R as ScbCollapse, d as ScbContainerCard, z as ScbCookiesConsent, w as ScbDatepicker, N as ScbDialog, C as ScbDivider, B as ScbDrawer, V as ScbDropZone, G as ScbDropdown, K as ScbFab, J as ScbFactCard, q as ScbFactCardContent, $ as ScbFooter, Y as ScbFooterSection, ne as ScbFormErrorSummary, se as ScbGalleryGrid, Q as ScbGrid, X as ScbGridItem, fe as ScbHeader, ce as ScbHeaderMenuGroup, le as ScbHeaderMenuItem, ue as ScbHeaderTab, de as ScbHeaderUtility, ae as ScbHorizontalScroller, ee as ScbIcon, h as ScbIconButton, pe as ScbKeyFigureCard, y as ScbLink, f as ScbLinkCard, F as ScbList, p as ScbListCard, P as ScbListItem, _e as ScbMenu, me as ScbMenuItem, ye as ScbNav, ve as ScbNavItem, te as ScbNotificationCard, W as ScbOptionsMenu, H as ScbOptionsMenuItem, U as ScbOptionsSubMenu, oe as ScbOverlay, be as ScbPagination, Le as ScbPrimaryTab, xe as ScbProgressIndicator, Se as ScbProgressStep, Ce as ScbProgressStepper, A as ScbRadioButton, k as ScbRadioGroup, we as ScbScrollspy, g as ScbSearch, Re as ScbSecondaryTab, Ee as ScbSegmentedButton, Te as ScbSegmentedItem, Oe as ScbSelect, De as ScbSelectOption, ke as ScbSkeleton, Ae as ScbSlider, je as ScbSnackbar, m as ScbSocialCard, Z as ScbStack, Me as ScbStatusPill, Ne as ScbStep, Pe as ScbStepper, ge as ScbSubmenu, j as ScbSwitch, Fe as ScbTable, Ie as ScbTableAdvanced, ze as ScbTabs, E as ScbTextField, Ve as ScbToc, Be as ScbTocItem, T as ScbTooltip, Nt as ScbViz, he as ScbmenuSection, e as addLazyFocusRingListeners, rt as appendScbVizSeriesDifferentiationPatternMarks, He as buildScbVizExportFileName, et as buildScbVizPrintDocumentHtml, tt as buildScbVizPrintableFooterHtml, nt as buildScbVizPrintableTableHtml, Ot as buildScbVizResolvedTableView, lt as clearScbVizSeriesDifferentiationColorClass, ut as clearScbVizSeriesDifferentiationMetadata, Ue as createScbVizCsvBlob, kt as createScbVizCsvRows, We as createScbVizRasterBlobFromElement, Ge as createScbVizRasterDataUrlFromElement, Ke as downloadScbVizBlob, t as ensureFocusRingOnFocusVisible, n as ensureFocusRingOnTab, r as ensureFocusRingReady, Pt as ensureRippleReady, dt as ensureScbVizGroupedSeriesDifferentiationStore, ft as ensureScbVizStyledModeSeriesPattern, qe as getScbVizCurrentFullscreenElement, Je as getScbVizExportBaseFileName, Ye as getScbVizFullscreenDocument, pt as getScbVizGroupedSeriesDifferentiationKey, mt as getScbVizGroupedSeriesDifferentiationVariant, ht as getScbVizGroupedSeriesDifferentiationVariantIndex, gt as getScbVizHighchartsColorClassName, _t as getScbVizHighchartsSvgElement, vt as getScbVizHighchartsSvgRoot, yt as getScbVizLegendSeriesDifferentiationTargets, bt as getScbVizSeriesDifferentiationColorIndex, it as getScbVizSeriesDifferentiationPatternDefinition, at as getScbVizSeriesDifferentiationPatternKinds, ot as getScbVizSeriesDifferentiationRegistry, st as getScbVizSeriesDifferentiationVariant, xt as getScbVizSeriesDifferentiationVariantByIndex, re as hasScbSvgIcon, At as inferScbVizTableAlignments, Xe as isScbVizFullscreenSupported, St as isScbVizGroupedSeriesDifferentiationChart, Ct as isScbVizHighchartsStyledMode, jt as normalizeScbVizRenderableCell, Ze as openScbVizPrintFrame, Mt as readScbVizTableDataFromSlot, ie as renderScbIcon, Qe as runWithScbVizForcedPrintLightMode, ct as scbVizSeriesDifferentiationRegistry, wt as setScbVizSeriesDifferentiationColorClass, Tt as setScbVizSeriesDifferentiationMetadata, Et as shouldShowScbVizSeriesDifferentiationAction, Ft as syncRippleToControl, $e as toggleScbVizFullscreen, Dt as usesScbVizGroupedPointDifferentiation };
|
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';
|
|
@@ -97,3 +99,6 @@ import './scb-viz/scb-viz-print-runtime.js';
|
|
|
97
99
|
import './scb-viz/scb-viz-series-differentiation-registry.js';
|
|
98
100
|
import './scb-viz/scb-viz-series-differentiation-runtime.js';
|
|
99
101
|
import './scb-viz/scb-viz-table-runtime.js';
|
|
102
|
+
import './shared/lazy-focus-ring.js';
|
|
103
|
+
import './shared/lazy-ripple.js';
|
|
104
|
+
import './shared/scb-icon-svg.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as l,h as p,m as u,p as o,v as a,y as m}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 p,m as u,p as o,v as a,y as m}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{ensureFocusRingOnFocusVisible as h}from"../shared/lazy-focus-ring.js";import{t as n}from"../../vendor/decorate.js";import"../scb-avatar/scb-avatar.js";import"../scb-chevron/scb-chevron.js";(function(){try{var v=typeof globalThis<"u"?globalThis:window;if(!v.__scb_ce_guard_installed__){v.__scb_ce_guard_installed__=!0;var c=customElements.define.bind(customElements);customElements.define=function(i,t,b){try{customElements.get(i)||c(i,t,b)}catch(s){var e=String(s||"");if(e.indexOf("already been used")===-1&&e.indexOf("NotSupportedError")===-1)throw s}}}}catch{}})();var d,g,r=(d=class extends p{constructor(...c){super(...c),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=g._uid(),this._ignoreNextNativeTitleAttrChange=!1,this._onSummaryClick=i=>{i.preventDefault();const t=!this.open;this.closest("scb-accordion")?.onItemToggled?.(this,t),this.setOpen(t)},this._onToggle=i=>{const t=i.currentTarget;t.open||(t.open=!0),this._applyInertByOpen()}}static _uid(){return globalThis.crypto?.randomUUID?.()??`${g._uidPrefix}-${++g._uidSeq}`}static get observedAttributes(){const c=super.observedAttributes||[];return c.includes("title")?c:[...c,"title"]}attributeChangedCallback(c,i,t){if(c==="title"&&this._ignoreNextNativeTitleAttrChange){this._ignoreNextNativeTitleAttrChange=!1;return}super.attributeChangedCallback(c,i,t),c==="title"&&t!==null&&(this._ignoreNextNativeTitleAttrChange=!0,this.removeAttribute("title"))}firstUpdated(){this._applyInertByOpen()}_applyInertByOpen(){const c=this.renderRoot.querySelector(".scb-accordion-bottom");c&&(this.open?(c.removeAttribute("inert"),c.setAttribute("aria-hidden","false")):(c.setAttribute("inert",""),c.setAttribute("aria-hidden","true")))}_onKeyDown(c){const i=this.closest("scb-accordion"),t=Array.from(i?.querySelectorAll("scb-accordion-item")||[]).map(s=>s.renderRoot.querySelector("details")?.querySelector(".scb-accordion-top")||null).filter(s=>!!s),b=c.currentTarget,e=t.indexOf(b);switch(c.key){case"ArrowDown":c.preventDefault(),e<t.length-1&&t[e+1].focus();break;case"ArrowUp":c.preventDefault(),e>0&&t[e-1].focus();break;case"Home":c.preventDefault(),t.length&&t[0].focus();break;case"End":c.preventDefault(),t.length&&t[t.length-1].focus();break}}setOpen(c){this.open=!!c;const i=this.renderRoot.querySelector("details");i&&!i.open&&(i.open=!0),this._applyInertByOpen()}updated(c){if(c.has("open")){const i=this.renderRoot.querySelector("details");i&&!i.open&&(i.open=!0),this._applyInertByOpen(),this.dispatchEvent(new CustomEvent("open-changed",{detail:{open:this.open,title:this.title},bubbles:!0,composed:!0}))}}render(){const c=`bottom-${this._unique}`,i=`header-${this._unique}`,t=this.leading?this.leadingVariant==="image"&&this.imgHrefImage?a`<img part="leading-image" class="img" src="${this.imgHrefImage}" alt="" />`:this.leadingVariant==="avatar"?a`
|
|
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 l,h as w,m as A,p as s,v as c,y as C}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as R}from"../../vendor/preload-helper.js";import{t as N}from"../../vendor/component-defaults.js";import{t as n}from"../../vendor/decorate.js";import{n as T,t as x}from"../../vendor/assertClassBrand.js";(function(){try{var b=typeof globalThis<"u"?globalThis:window;if(!b.__scb_ce_guard_installed__){b.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,o){try{customElements.get(t)||e(t,i,o)}catch(u){var r=String(u||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw u}}}}catch{}})();var h,g,f;function P(){return g??(g=R(()=>import("../../vendor/lazy-focus-ring.js").then(b=>b.i),__vite__mapDeps([0,1,2]),import.meta.url)),g}function k(){return f??(f=R(()=>import("../../vendor/lazy-ripple.js"),__vite__mapDeps([3,2]),import.meta.url)),f}var a=(h=new WeakSet,class extends w{constructor(...e){super(...e),T(this,h),this.variant="filled",this.size=N["scb-button"].size,this.type="button",this.name="",this.value="",this.formId=null,this.formAction="",this.formEnctype="",this.formMethod="",this.formNoValidate=!1,this.formTarget="",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:t})=>(t(),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=t=>{const i=t.composedPath()[0];i instanceof HTMLElement&&i.matches(":focus-visible")&&this.__ensureNativeFocusRing()},this.__ensureNativeRipple=t=>{this.__nativeRippleReady||this.disabled||(t&&(this.__nativeRipplePendingPointerEvent=t),k().then(({ensureRippleReady:i})=>i()).then(()=>{this.disabled||(this.__nativeRippleReady=!0,this.requestUpdate(),this.updateComplete.then(()=>{this.__syncNativeFocusRingControl(),this.__replayNativeRippleState()}))}))},this.__onNativePointerWarmup=t=>{this.__ensureNativeRipple(t)},this.__onNativeClick=t=>{if(this.disabled){t.preventDefault(),t.stopPropagation();return}(!this.__nativeRippleReady||this.__nativeRipplePendingPointerEvent)&&(this.__nativeRipplePendingClick=!0,this.__ensureNativeRipple()),!this.href&&queueMicrotask(()=>{if(t.defaultPrevented||this.disabled||this.href)return;const i=this.__getAssociatedForm();if(!i)return;const o=this.__normalizedButtonType();o==="submit"&&this.__requestFormSubmit(i),o==="reset"&&i.reset()})}}__getNativeControl(){return this.renderRoot.querySelector(".native-button")}__handleDefaultSlotChange(e){const t=e.target.assignedNodes({flatten:!0}).some(i=>i.nodeType===Node.TEXT_NODE?!!i.textContent?.trim():i.nodeType===Node.ELEMENT_NODE);this.__hasDefaultSlotContent!==t&&(this.__hasDefaultSlotContent=t,this.requestUpdate()),this.updateComplete.then(()=>this.__syncAriaToInner())}__syncAriaToInner(){const e=this.__getNativeControl();e&&this.__syncAriaToControl(e)}__syncAriaToControl(e){const t=(this.getAttribute("aria-label")||"").trim(),i=this.label.trim()===""&&!this.__hasDefaultSlotContent?(this.icon||"").trim():"",o=t||i;o?e.setAttribute("aria-label",o):e.removeAttribute("aria-label");const r=this.getAttribute("aria-controls");r!==null?e.setAttribute("aria-controls",r):e.removeAttribute("aria-controls");const u=this.getAttribute("aria-haspopup");u!==null?e.setAttribute("aria-haspopup",u):e.removeAttribute("aria-haspopup");const y=this.getAttribute("aria-expanded");y!==null?e.setAttribute("aria-expanded",y):e.removeAttribute("aria-expanded"),this.__ariaObserver?.disconnect(),this.__ariaObserver=new MutationObserver(S=>{const d=this.__getNativeControl();if(d)for(const m of S){if(m.type!=="attributes"||!m.attributeName)continue;const p=m.attributeName,v=this.getAttribute(p);if(p==="aria-label"){const _=(v||(this.label.trim()===""&&!this.__hasDefaultSlotContent?(this.icon||"").trim():"")).trim();_?d.setAttribute("aria-label",_):d.removeAttribute("aria-label")}else(p==="aria-controls"||p==="aria-expanded"||p==="aria-haspopup")&&(v===null?d.removeAttribute(p):d.setAttribute(p,v))}}),this.__ariaObserver.observe(this,{attributes:!0,attributeFilter:["aria-label","aria-controls","aria-expanded","aria-haspopup"]})}connectedCallback(){super.connectedCallback()}focus(e){const t=this.__getNativeControl();if(t){t.focus(e);return}this.updateComplete.then(()=>this.__getNativeControl()?.focus(e))}blur(){this.__getNativeControl()?.blur()}firstUpdated(){x(h,this,z).call(this)}updated(e){(e.has("variant")||e.has("label")||e.has("icon")||e.has("href"))&&this.updateComplete.then(()=>this.__syncAriaToInner()),(this.__nativeFocusRingReady||this.__nativeRippleReady)&&this.updateComplete.then(()=>this.__syncNativeFocusRingControl()),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&x(h,this,z).call(this)}disconnectedCallback(){this.__ariaObserver?.disconnect(),super.disconnectedCallback()}__normalizedButtonType(){return this.type==="submit"||this.type==="reset"?this.type:"button"}__getAssociatedForm(){if(this.formId!==null||this.hasAttribute("form")){const e=(this.formId??this.getAttribute("form")??"").trim();if(!e)return null;const t=this.getRootNode(),i=t instanceof Document||t instanceof ShadowRoot?t.getElementById(e):null;return i instanceof HTMLFormElement?i:null}return this.closest("form")}get form(){return this.__getAssociatedForm()}__requestFormSubmit(e){const t=this.ownerDocument.createElement("button");t.type="submit",t.hidden=!0,t.tabIndex=-1,t.setAttribute("aria-hidden","true"),t.setAttribute("data-scb-button-submitter","");const i=[["name",this.name,this.hasAttribute("name")],["value",this.value,this.hasAttribute("value")],["formaction",this.formAction,this.hasAttribute("formaction")],["formenctype",this.formEnctype,this.hasAttribute("formenctype")],["formmethod",this.formMethod,this.hasAttribute("formmethod")],["formtarget",this.formTarget,this.hasAttribute("formtarget")]];for(const[o,r,u]of i)(u||r!=="")&&t.setAttribute(o,r);this.formNoValidate&&t.setAttribute("formnovalidate",""),e.append(t);try{e.requestSubmit(t)}finally{t.remove()}}__syncNativeFocusRingControl(){const e=this.renderRoot.querySelector("md-focus-ring"),t=this.__getNativeControl();e&&t&&(e.control=t,e.visible=t.matches(":focus-visible"));const i=this.renderRoot.querySelector("md-ripple");i&&t&&(i.control=t)}async __replayNativeRippleState(){const e=this.renderRoot.querySelector("md-ripple"),t=this.__getNativeControl(),i=this.__nativeRipplePendingPointerEvent,o=this.__nativeRipplePendingClick;this.__nativeRipplePendingPointerEvent=void 0,this.__nativeRipplePendingClick=!1;const{syncRippleToControl:r}=await k();await r(e,t,i,o)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}static get styles(){return C`: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-container-height:var(--scb-buttons-control-size-medium, var(--scb-control-size-medium, var(--scale-10, 40px)));--scb-button-padding-block:var(--scb-buttons-padding-block-medium, var(--spacing-3, 8px));--scb-button-padding-inline:var(--scb-buttons-padding-inline-medium, var(--spacing-5, 16px));--scb-button-icon-edge-space:var(--scb-buttons-padding-inline-medium, var(--spacing-5, 16px));--scb-button-icon-gap:var(--scb-buttons-gap-medium, var(--spacing-3, 8px));--scb-button-icon-size:var(--scb-buttons-icon-size-medium, var(--icon-size-small, 20px));--scb-button-shape-radius:var(--scb-buttons-shape-radius-medium, var(--radius-full, 999px));--scb-button-label-text-font:var(--scb-buttons-text-medium-font, var(--scb-typography-label-medium-font, var(--md-sys-typescale-label-medium-font)));--scb-button-label-text-size:var(--scb-buttons-text-medium-size, var(--scb-typography-label-medium-size, var(--md-sys-typescale-label-medium-size)));--scb-button-label-text-weight:var(--scb-buttons-text-medium-weight, var(--scb-typography-label-medium-weight, var(--md-sys-typescale-label-medium-weight)));--scb-button-label-text-line-height:var(--scb-buttons-text-medium-line-height, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height)));--scb-button-label-text-tracking:var(--scb-buttons-text-medium-tracking, var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking)))}:host([size='extra-small']){--scb-button-container-height:var(--scb-buttons-control-size-extra-small, var(--scb-control-size-extra-small, var(--scale-08, 32px)));--scb-button-padding-block:var(--scb-buttons-padding-block-extra-small, var(--spacing-2, 4px));--scb-button-padding-inline:var(--scb-buttons-padding-inline-extra-small, var(--spacing-4, 12px));--scb-button-icon-edge-space:var(--scb-buttons-padding-inline-extra-small, var(--spacing-4, 12px));--scb-button-icon-gap:var(--scb-buttons-gap-extra-small, var(--spacing-2, 4px));--scb-button-icon-size:var(--scb-buttons-icon-size-extra-small, var(--icon-size-small, 20px));--scb-button-shape-radius:var(--scb-buttons-shape-radius-extra-small, var(--radius-full, 999px));--scb-button-label-text-font:var(--scb-buttons-text-extra-small-font, var(--scb-typography-label-medium-font, var(--md-sys-typescale-label-medium-font)));--scb-button-label-text-size:var(--scb-buttons-text-extra-small-size, var(--scb-typography-label-medium-size, var(--md-sys-typescale-label-medium-size)));--scb-button-label-text-weight:var(--scb-buttons-text-extra-small-weight, var(--scb-typography-label-medium-weight, var(--md-sys-typescale-label-medium-weight)));--scb-button-label-text-line-height:var(--scb-buttons-text-extra-small-line-height, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height)));--scb-button-label-text-tracking:var(--scb-buttons-text-extra-small-tracking, var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking)))}:host([size='small']){--scb-button-container-height:var(--scb-buttons-control-size-small, var(--scb-control-size-small, var(--scale-08, 32px)));--scb-button-padding-block:var(--scb-buttons-padding-block-small, var(--spacing-2, 4px));--scb-button-padding-inline:var(--scb-buttons-padding-inline-small, var(--spacing-4, 12px));--scb-button-icon-edge-space:var(--scb-buttons-padding-inline-small, var(--spacing-4, 12px));--scb-button-icon-gap:var(--scb-buttons-gap-small, var(--spacing-2, 4px));--scb-button-icon-size:var(--scb-buttons-icon-size-small, var(--icon-size-small, 20px));--scb-button-shape-radius:var(--scb-buttons-shape-radius-small, var(--radius-full, 999px));--scb-button-label-text-font:var(--scb-buttons-text-small-font, var(--scb-typography-label-medium-font, var(--md-sys-typescale-label-medium-font)));--scb-button-label-text-size:var(--scb-buttons-text-small-size, var(--scb-typography-label-medium-size, var(--md-sys-typescale-label-medium-size)));--scb-button-label-text-weight:var(--scb-buttons-text-small-weight, var(--scb-typography-label-medium-weight, var(--md-sys-typescale-label-medium-weight)));--scb-button-label-text-line-height:var(--scb-buttons-text-small-line-height, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height)));--scb-button-label-text-tracking:var(--scb-buttons-text-small-tracking, var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking)))}:host([size='large']){--scb-button-container-height:var(--scb-buttons-control-size-large, var(--scb-control-size-large, var(--scale-12, 56px)));--scb-button-padding-block:var(--scb-buttons-padding-block-large, var(--spacing-5, 16px));--scb-button-padding-inline:var(--scb-buttons-padding-inline-large, var(--spacing-7, 20px));--scb-button-icon-edge-space:var(--scb-buttons-padding-inline-large, var(--spacing-7, 20px));--scb-button-icon-gap:var(--scb-buttons-gap-large, var(--spacing-3, 8px));--scb-button-icon-size:var(--scb-buttons-icon-size-large, var(--icon-size-medium, 24px));--scb-button-shape-radius:var(--scb-buttons-shape-radius-large, var(--radius-full, 999px));--scb-button-label-text-font:var(--scb-buttons-text-large-font, var(--scb-typography-label-medium-font, var(--md-sys-typescale-label-medium-font)));--scb-button-label-text-size:var(--scb-buttons-text-large-size, var(--scb-typography-label-medium-size, var(--md-sys-typescale-label-medium-size)));--scb-button-label-text-weight:var(--scb-buttons-text-large-weight, var(--scb-typography-label-medium-weight, var(--md-sys-typescale-label-medium-weight)));--scb-button-label-text-line-height:var(--scb-buttons-text-large-line-height, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height)));--scb-button-label-text-tracking:var(--scb-buttons-text-large-tracking, var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking)))}: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(--scb-button-shape-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(--scb-button-label-text-font);font-size:var(--scb-button-label-text-size);font-weight:var(--scb-button-label-text-weight);line-height:var(--scb-button-label-text-line-height, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height)));letter-spacing:var(--scb-button-label-text-tracking, normal);text-align:center;text-decoration:none;white-space:nowrap;cursor:pointer;appearance:none;-webkit-appearance:none;touch-action:manipulation}::slotted(*){display:inline!important;margin:0!important;color:inherit!important;font:inherit!important;letter-spacing:inherit!important;line-height:inherit!important}.native-button::before{content:"";position:absolute;inset:0;z-index:-1;background:currentColor;opacity:0;pointer-events:none;transition:opacity var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease)}.native-button:hover::before{opacity:var(--md-sys-state-hover-state-layer-opacity, 0.08)}.native-button:active::before{opacity:var(--md-sys-state-pressed-state-layer-opacity, 0.12)}.native-button:focus{outline:0}:host(:not([data-native-focus-ring-ready])) .native-button:focus-visible{outline:var(--stroke-border-m, 2px) solid var(--md-sys-color-primary);outline-offset:var(--spacing-1, 2px)}.native-button:disabled,.native-button[aria-disabled=true]{color:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content));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:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--scb-color-compat-disabled-container)}: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:var(--scb-button-disabled-container-color, var(--scb-color-compat-disabled-container));color:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content))}: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:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content))}.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 e=!!this.icon?.trim(),t=e?c`<span class="native-icon" part="icon" aria-hidden="true">${this.icon}</span>`:l,i=this.label.trim()===""&&!this.__hasDefaultSlotContent?this.icon:void 0,o=c`
|
|
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 l,h as w,m as A,p as s,v as c,y as C}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as R}from"../../vendor/preload-helper.js";import{t as N}from"../../vendor/component-defaults.js";import{t as n}from"../../vendor/decorate.js";import{n as T,t as x}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 e=customElements.define.bind(customElements);customElements.define=function(t,i,o){try{customElements.get(t)||e(t,i,o)}catch(b){var r=String(b||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw b}}}}catch{}})();var h,g,f;function P(){return g??(g=R(()=>import("../shared/lazy-focus-ring.js"),__vite__mapDeps([0,1]),import.meta.url)),g}function k(){return f??(f=R(()=>import("../shared/lazy-ripple.js"),__vite__mapDeps([2,1]),import.meta.url)),f}var a=(h=new WeakSet,class extends w{constructor(...e){super(...e),T(this,h),this.variant="filled",this.size=N["scb-button"].size,this.type="button",this.name="",this.value="",this.formId=null,this.formAction="",this.formEnctype="",this.formMethod="",this.formNoValidate=!1,this.formTarget="",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:t})=>(t(),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=t=>{const i=t.composedPath()[0];i instanceof HTMLElement&&i.matches(":focus-visible")&&this.__ensureNativeFocusRing()},this.__ensureNativeRipple=t=>{this.__nativeRippleReady||this.disabled||(t&&(this.__nativeRipplePendingPointerEvent=t),k().then(({ensureRippleReady:i})=>i()).then(()=>{this.disabled||(this.__nativeRippleReady=!0,this.requestUpdate(),this.updateComplete.then(()=>{this.__syncNativeFocusRingControl(),this.__replayNativeRippleState()}))}))},this.__onNativePointerWarmup=t=>{this.__ensureNativeRipple(t)},this.__onNativeClick=t=>{if(this.disabled){t.preventDefault(),t.stopPropagation();return}(!this.__nativeRippleReady||this.__nativeRipplePendingPointerEvent)&&(this.__nativeRipplePendingClick=!0,this.__ensureNativeRipple()),!this.href&&queueMicrotask(()=>{if(t.defaultPrevented||this.disabled||this.href)return;const i=this.__getAssociatedForm();if(!i)return;const o=this.__normalizedButtonType();o==="submit"&&this.__requestFormSubmit(i),o==="reset"&&i.reset()})}}__getNativeControl(){return this.renderRoot.querySelector(".native-button")}__handleDefaultSlotChange(e){const t=e.target.assignedNodes({flatten:!0}).some(i=>i.nodeType===Node.TEXT_NODE?!!i.textContent?.trim():i.nodeType===Node.ELEMENT_NODE);this.__hasDefaultSlotContent!==t&&(this.__hasDefaultSlotContent=t,this.requestUpdate()),this.updateComplete.then(()=>this.__syncAriaToInner())}__syncAriaToInner(){const e=this.__getNativeControl();e&&this.__syncAriaToControl(e)}__syncAriaToControl(e){const t=(this.getAttribute("aria-label")||"").trim(),i=this.label.trim()===""&&!this.__hasDefaultSlotContent?(this.icon||"").trim():"",o=t||i;o?e.setAttribute("aria-label",o):e.removeAttribute("aria-label");const r=this.getAttribute("aria-controls");r!==null?e.setAttribute("aria-controls",r):e.removeAttribute("aria-controls");const b=this.getAttribute("aria-haspopup");b!==null?e.setAttribute("aria-haspopup",b):e.removeAttribute("aria-haspopup");const y=this.getAttribute("aria-expanded");y!==null?e.setAttribute("aria-expanded",y):e.removeAttribute("aria-expanded"),this.__ariaObserver?.disconnect(),this.__ariaObserver=new MutationObserver(S=>{const d=this.__getNativeControl();if(d)for(const m of S){if(m.type!=="attributes"||!m.attributeName)continue;const u=m.attributeName,v=this.getAttribute(u);if(u==="aria-label"){const _=(v||(this.label.trim()===""&&!this.__hasDefaultSlotContent?(this.icon||"").trim():"")).trim();_?d.setAttribute("aria-label",_):d.removeAttribute("aria-label")}else(u==="aria-controls"||u==="aria-expanded"||u==="aria-haspopup")&&(v===null?d.removeAttribute(u):d.setAttribute(u,v))}}),this.__ariaObserver.observe(this,{attributes:!0,attributeFilter:["aria-label","aria-controls","aria-expanded","aria-haspopup"]})}connectedCallback(){super.connectedCallback()}focus(e){const t=this.__getNativeControl();if(t){t.focus(e);return}this.updateComplete.then(()=>this.__getNativeControl()?.focus(e))}blur(){this.__getNativeControl()?.blur()}firstUpdated(){x(h,this,z).call(this)}updated(e){(e.has("variant")||e.has("label")||e.has("icon")||e.has("href"))&&this.updateComplete.then(()=>this.__syncAriaToInner()),(this.__nativeFocusRingReady||this.__nativeRippleReady)&&this.updateComplete.then(()=>this.__syncNativeFocusRingControl()),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&x(h,this,z).call(this)}disconnectedCallback(){this.__ariaObserver?.disconnect(),super.disconnectedCallback()}__normalizedButtonType(){return this.type==="submit"||this.type==="reset"?this.type:"button"}__getAssociatedForm(){if(this.formId!==null||this.hasAttribute("form")){const e=(this.formId??this.getAttribute("form")??"").trim();if(!e)return null;const t=this.getRootNode(),i=t instanceof Document||t instanceof ShadowRoot?t.getElementById(e):null;return i instanceof HTMLFormElement?i:null}return this.closest("form")}get form(){return this.__getAssociatedForm()}__requestFormSubmit(e){const t=this.ownerDocument.createElement("button");t.type="submit",t.hidden=!0,t.tabIndex=-1,t.setAttribute("aria-hidden","true"),t.setAttribute("data-scb-button-submitter","");const i=[["name",this.name,this.hasAttribute("name")],["value",this.value,this.hasAttribute("value")],["formaction",this.formAction,this.hasAttribute("formaction")],["formenctype",this.formEnctype,this.hasAttribute("formenctype")],["formmethod",this.formMethod,this.hasAttribute("formmethod")],["formtarget",this.formTarget,this.hasAttribute("formtarget")]];for(const[o,r,b]of i)(b||r!=="")&&t.setAttribute(o,r);this.formNoValidate&&t.setAttribute("formnovalidate",""),e.append(t);try{e.requestSubmit(t)}finally{t.remove()}}__syncNativeFocusRingControl(){const e=this.renderRoot.querySelector("md-focus-ring"),t=this.__getNativeControl();e&&t&&(e.control=t,e.visible=t.matches(":focus-visible"));const i=this.renderRoot.querySelector("md-ripple");i&&t&&(i.control=t)}async __replayNativeRippleState(){const e=this.renderRoot.querySelector("md-ripple"),t=this.__getNativeControl(),i=this.__nativeRipplePendingPointerEvent,o=this.__nativeRipplePendingClick;this.__nativeRipplePendingPointerEvent=void 0,this.__nativeRipplePendingClick=!1;const{syncRippleToControl:r}=await k();await r(e,t,i,o)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}static get styles(){return C`: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-container-height:var(--scb-buttons-control-size-medium, var(--scb-control-size-medium, var(--scale-10, 40px)));--scb-button-padding-block:var(--scb-buttons-padding-block-medium, var(--spacing-3, 8px));--scb-button-padding-inline:var(--scb-buttons-padding-inline-medium, var(--spacing-5, 16px));--scb-button-icon-edge-space:var(--scb-buttons-padding-inline-medium, var(--spacing-5, 16px));--scb-button-icon-gap:var(--scb-buttons-gap-medium, var(--spacing-3, 8px));--scb-button-icon-size:var(--scb-buttons-icon-size-medium, var(--icon-size-small, 20px));--scb-button-shape-radius:var(--scb-buttons-shape-radius-medium, var(--radius-full, 999px));--scb-button-label-text-font:var(--scb-buttons-text-medium-font, var(--scb-typography-label-medium-font, var(--md-sys-typescale-label-medium-font)));--scb-button-label-text-size:var(--scb-buttons-text-medium-size, var(--scb-typography-label-medium-size, var(--md-sys-typescale-label-medium-size)));--scb-button-label-text-weight:var(--scb-buttons-text-medium-weight, var(--scb-typography-label-medium-weight, var(--md-sys-typescale-label-medium-weight)));--scb-button-label-text-line-height:var(--scb-buttons-text-medium-line-height, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height)));--scb-button-label-text-tracking:var(--scb-buttons-text-medium-tracking, var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking)))}:host([size='extra-small']){--scb-button-container-height:var(--scb-buttons-control-size-extra-small, var(--scb-control-size-extra-small, var(--scale-08, 32px)));--scb-button-padding-block:var(--scb-buttons-padding-block-extra-small, var(--spacing-2, 4px));--scb-button-padding-inline:var(--scb-buttons-padding-inline-extra-small, var(--spacing-4, 12px));--scb-button-icon-edge-space:var(--scb-buttons-padding-inline-extra-small, var(--spacing-4, 12px));--scb-button-icon-gap:var(--scb-buttons-gap-extra-small, var(--spacing-2, 4px));--scb-button-icon-size:var(--scb-buttons-icon-size-extra-small, var(--icon-size-small, 20px));--scb-button-shape-radius:var(--scb-buttons-shape-radius-extra-small, var(--radius-full, 999px));--scb-button-label-text-font:var(--scb-buttons-text-extra-small-font, var(--scb-typography-label-medium-font, var(--md-sys-typescale-label-medium-font)));--scb-button-label-text-size:var(--scb-buttons-text-extra-small-size, var(--scb-typography-label-medium-size, var(--md-sys-typescale-label-medium-size)));--scb-button-label-text-weight:var(--scb-buttons-text-extra-small-weight, var(--scb-typography-label-medium-weight, var(--md-sys-typescale-label-medium-weight)));--scb-button-label-text-line-height:var(--scb-buttons-text-extra-small-line-height, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height)));--scb-button-label-text-tracking:var(--scb-buttons-text-extra-small-tracking, var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking)))}:host([size='small']){--scb-button-container-height:var(--scb-buttons-control-size-small, var(--scb-control-size-small, var(--scale-08, 32px)));--scb-button-padding-block:var(--scb-buttons-padding-block-small, var(--spacing-2, 4px));--scb-button-padding-inline:var(--scb-buttons-padding-inline-small, var(--spacing-4, 12px));--scb-button-icon-edge-space:var(--scb-buttons-padding-inline-small, var(--spacing-4, 12px));--scb-button-icon-gap:var(--scb-buttons-gap-small, var(--spacing-2, 4px));--scb-button-icon-size:var(--scb-buttons-icon-size-small, var(--icon-size-small, 20px));--scb-button-shape-radius:var(--scb-buttons-shape-radius-small, var(--radius-full, 999px));--scb-button-label-text-font:var(--scb-buttons-text-small-font, var(--scb-typography-label-medium-font, var(--md-sys-typescale-label-medium-font)));--scb-button-label-text-size:var(--scb-buttons-text-small-size, var(--scb-typography-label-medium-size, var(--md-sys-typescale-label-medium-size)));--scb-button-label-text-weight:var(--scb-buttons-text-small-weight, var(--scb-typography-label-medium-weight, var(--md-sys-typescale-label-medium-weight)));--scb-button-label-text-line-height:var(--scb-buttons-text-small-line-height, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height)));--scb-button-label-text-tracking:var(--scb-buttons-text-small-tracking, var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking)))}:host([size='large']){--scb-button-container-height:var(--scb-buttons-control-size-large, var(--scb-control-size-large, var(--scale-12, 56px)));--scb-button-padding-block:var(--scb-buttons-padding-block-large, var(--spacing-5, 16px));--scb-button-padding-inline:var(--scb-buttons-padding-inline-large, var(--spacing-7, 20px));--scb-button-icon-edge-space:var(--scb-buttons-padding-inline-large, var(--spacing-7, 20px));--scb-button-icon-gap:var(--scb-buttons-gap-large, var(--spacing-3, 8px));--scb-button-icon-size:var(--scb-buttons-icon-size-large, var(--icon-size-medium, 24px));--scb-button-shape-radius:var(--scb-buttons-shape-radius-large, var(--radius-full, 999px));--scb-button-label-text-font:var(--scb-buttons-text-large-font, var(--scb-typography-label-medium-font, var(--md-sys-typescale-label-medium-font)));--scb-button-label-text-size:var(--scb-buttons-text-large-size, var(--scb-typography-label-medium-size, var(--md-sys-typescale-label-medium-size)));--scb-button-label-text-weight:var(--scb-buttons-text-large-weight, var(--scb-typography-label-medium-weight, var(--md-sys-typescale-label-medium-weight)));--scb-button-label-text-line-height:var(--scb-buttons-text-large-line-height, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height)));--scb-button-label-text-tracking:var(--scb-buttons-text-large-tracking, var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking)))}: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(--scb-button-shape-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(--scb-button-label-text-font);font-size:var(--scb-button-label-text-size);font-weight:var(--scb-button-label-text-weight);line-height:var(--scb-button-label-text-line-height, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height)));letter-spacing:var(--scb-button-label-text-tracking, normal);text-align:center;text-decoration:none;white-space:nowrap;cursor:pointer;appearance:none;-webkit-appearance:none;touch-action:manipulation}::slotted(*){display:inline!important;margin:0!important;color:inherit!important;font:inherit!important;letter-spacing:inherit!important;line-height:inherit!important}.native-button::before{content:"";position:absolute;inset:0;z-index:-1;background:currentColor;opacity:0;pointer-events:none;transition:opacity var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease)}.native-button:hover::before{opacity:var(--md-sys-state-hover-state-layer-opacity, 0.08)}.native-button:active::before{opacity:var(--md-sys-state-pressed-state-layer-opacity, 0.12)}.native-button:focus{outline:0}:host(:not([data-native-focus-ring-ready])) .native-button:focus-visible{outline:var(--stroke-border-m, 2px) solid var(--md-sys-color-primary);outline-offset:var(--spacing-1, 2px)}.native-button:disabled,.native-button[aria-disabled=true]{color:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content));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:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--scb-color-compat-disabled-container)}: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:var(--scb-button-disabled-container-color, var(--scb-color-compat-disabled-container));color:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content))}: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:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content))}.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 e=!!this.icon?.trim(),t=e?c`<span class="native-icon" part="icon" aria-hidden="true">${this.icon}</span>`:l,i=this.label.trim()===""&&!this.__hasDefaultSlotContent?this.icon:void 0,o=c`
|
|
3
3
|
<slot
|
|
4
4
|
@slotchange=${this.__handleDefaultSlotChange}
|
|
5
5
|
style=${this.__hasDefaultSlotContent?l:"display: none"}
|
|
@@ -46,4 +46,4 @@ import{g as l,h as w,m as A,p as s,v as c,y as C}from"../../vendor/vendor.js";im
|
|
|
46
46
|
${this.__nativeRippleReady?c`<md-ripple aria-hidden="true"></md-ripple>`:l}
|
|
47
47
|
${this.__nativeFocusRingReady?c`<md-focus-ring aria-hidden="true"></md-focus-ring>`:l}
|
|
48
48
|
</span>
|
|
49
|
-
`}});function z(){const
|
|
49
|
+
`}});function z(){const p=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??p,t=this.mapSpacingToken(this.spacingBottom)??p,i=this.mapSpacingToken(this.spacingLeft),o=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-button-spacing-block-start",e):this.style.removeProperty("--scb-button-spacing-block-start"),t?this.style.setProperty("--scb-button-spacing-block-end",t):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"),o?this.style.setProperty("--scb-button-spacing-inline-end",o):this.style.removeProperty("--scb-button-spacing-inline-end")}n([s({type:String,reflect:!0})],a.prototype,"variant",void 0);n([s({type:String,reflect:!0})],a.prototype,"size",void 0);n([s({type:String,reflect:!0})],a.prototype,"type",void 0);n([s({type:String})],a.prototype,"name",void 0);n([s({type:String})],a.prototype,"value",void 0);n([s({type:String,attribute:"form"})],a.prototype,"formId",void 0);n([s({type:String,attribute:"formaction"})],a.prototype,"formAction",void 0);n([s({type:String,attribute:"formenctype"})],a.prototype,"formEnctype",void 0);n([s({type:String,attribute:"formmethod"})],a.prototype,"formMethod",void 0);n([s({type:Boolean,attribute:"formnovalidate"})],a.prototype,"formNoValidate",void 0);n([s({type:String,attribute:"formtarget"})],a.prototype,"formTarget",void 0);n([s({type:String})],a.prototype,"label",void 0);n([s({type:Boolean,attribute:"trailing-icon"})],a.prototype,"trailingIcon",void 0);n([s({type:String})],a.prototype,"icon",void 0);n([s({type:Boolean,attribute:"icon-filled",reflect:!0})],a.prototype,"iconFilled",void 0);n([s({type:Boolean,reflect:!0})],a.prototype,"disabled",void 0);n([s({type:Boolean,attribute:"full-width",reflect:!0})],a.prototype,"fullWidth",void 0);n([s({type:String})],a.prototype,"href",void 0);n([s({type:String})],a.prototype,"target",void 0);n([s({type:String})],a.prototype,"rel",void 0);n([s({type:String,reflect:!0})],a.prototype,"spacing",void 0);n([s({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",void 0);n([s({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",void 0);n([s({type:String,attribute:"spacing-left",reflect:!0})],a.prototype,"spacingLeft",void 0);n([s({type:String,attribute:"spacing-right",reflect:!0})],a.prototype,"spacingRight",void 0);a=n([A("scb-button")],a);export{a as ScbButton};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as z,h as Q,m as X,p as _,v as k,y as Z}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as V}from"../../vendor/lazy-focus-ring.js";import{t as f}from"../../vendor/decorate.js";import{n as tt,t as I}from"../../vendor/assertClassBrand.js";import"../scb-icon-button/scb-icon-button.js";import"./scb-calendar-event.js";import"../scb-dialog/scb-dialog.js";import"../scb-list/scb-list.js";(function(){try{var $=typeof globalThis<"u"?globalThis:window;if(!$.__scb_ce_guard_installed__){$.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,a,s){try{customElements.get(e)||t(e,a,s)}catch(r){var n=String(r||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var L,O,H={fromAttribute($){if($===null)return!1;const t=$.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!=="no"}},m=(L=new WeakSet,O=class extends Q{constructor(...t){super(...t),tt(this,L),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this.eventsJson=void 0,this._eventsFromJson=null,this._eventsJsonLast=void 0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=e=>{const a=Array.from(this.shadowRoot?.querySelectorAll(".calendar-day[data-date]")??[]),s=this.shadowRoot?.activeElement,n=s&&a.includes(s)?s:document.activeElement,r=a.indexOf(n);if(r===-1)return;let l;switch(e.key){case"ArrowRight":l=a[r+1];break;case"ArrowLeft":l=a[r-1];break;case"ArrowDown":l=this.__dayOffsetFrom(n,7);break;case"ArrowUp":l=this.__dayOffsetFrom(n,-7);break;case"Home":l=Array.from(n.closest('[role="row"]')?.querySelectorAll(".calendar-day[data-date]")??[])[0];break;case"End":{const o=Array.from(n.closest('[role="row"]')?.querySelectorAll(".calendar-day[data-date]")??[]);l=o[o.length-1];break}case"PageUp":e.preventDefault(),this.__focusAdjacentMonth(n,-1);return;case"PageDown":e.preventDefault(),this.__focusAdjacentMonth(n,1);return;default:return}l&&l!==n&&(e.preventDefault(),this.__focusCalendarDay(l))},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._rovingDate="",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,a){super.attributeChangedCallback(t,e,a),t==="value"&&(this.value=a??"")}connectedCallback(){super.connectedCallback(),this._removeLazyFocusRingListeners=V(this,this.renderRoot),I(L,this,W).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"))&&I(L,this,W).call(this),!this._syncingDisplay&&(t.has("displayYear")||t.has("displayMonth"))){const e=Number(this.displayYear),a=Number(this.displayMonth);if(!Number.isNaN(e)&&!Number.isNaN(a)&&a>=1&&a<=12){const s=this._current.getFullYear(),n=this._current.getMonth()+1;(s!==e||n!==a)&&(this._current=new Date(e,a-1,1),this._dispatchMonthChange(e,a),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??"",a=t.description??"",s=t.href??"",n=t.startDate??t["start-date"]??t.start??t.date??"",r=t.endDate??t["end-date"]??t.end??"";return{title:e+"",description:a?a+"":void 0,href:s?s+"":void 0,start:n?n+"":void 0,end:r?r+"":void 0}}_toLocalEventDate(t,e){const a=(t??"").trim();if(!a)return null;if(!a.includes("T")){const n=a.split("-").map(d=>Number(d));if(n.length!==3||n.some(d=>Number.isNaN(d)))return null;const[r,l,o]=n;return e?new Date(r,l-1,o,23,59,59,999):new Date(r,l-1,o,0,0,0,0)}const s=new Date(a);return Number.isNaN(s.getTime())?null:s}_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 a of t){const s=this._normalizeEventInput(a),n=s.start||"",r=s.end||"";if(!(!n||!s.title))if(n&&r){const l=this._toLocalEventDate(n,!1),o=this._toLocalEventDate(r,!0);if(!l||!o)continue;if(o<l){const d=n.split("T")[0],u=e.get(d)||[];u.push({title:s.title,description:s.description,href:s.href,start:n,end:r}),e.set(d,u);continue}for(let d=new Date(l);d<=o;d.setDate(d.getDate()+1)){const u=this._toDateKey(d),T=e.get(u)||[];T.push({title:s.title,description:s.description,href:s.href,start:n,end:r}),e.set(u,T)}}else{const l=n.split("T")[0],o=e.get(l)||[];o.push({title:s.title,description:s.description,href:s.href,start:n}),e.set(l,o)}}return e}_buildEventMapFromChildren(){const t=Array.from(this.querySelectorAll("scb-calendar-event")),e=new Map;for(const a of t){const s=a,n=(s.startDate??s.date??"")+""||a.getAttribute("start-date")||a.getAttribute("date")||"",r=(s.endDate??"")+""||a.getAttribute("end-date")||"";if(n&&r){const l=this._toLocalEventDate(n,!1),o=this._toLocalEventDate(r,!0);if(!l||!o)continue;if(o<l){const d=n.split("T")[0],u=e.get(d)||[];u.push({title:a.title??"",description:a.description,href:s.href||a.getAttribute("href")||void 0,start:n,end:r}),e.set(d,u);continue}for(let d=new Date(l);d<=o;d.setDate(d.getDate()+1)){const u=this._toDateKey(d),T=e.get(u)||[];T.push({title:a.title??"",description:a.description,href:s.href||a.getAttribute("href")||void 0,start:n,end:r}),e.set(u,T)}}else if(n&&a.title){const l=n.split("T")[0],o=e.get(l)||[];o.push({title:a.title,description:a.description,href:s.href||a.getAttribute("href")||void 0,start:n}),e.set(l,o)}}return e}_syncDisplayFromCurrent(t=!0){const e=this._current.getFullYear(),a=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=e,this.displayMonth=a}finally{this._syncingDisplay=!1}t&&this._dispatchMonthChange(e,a)}_dispatchMonthChange(t,e){const a={displayYear:t,displayMonth:e};this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:a})),this.dispatchEvent(new CustomEvent("scbcalendarmonthchange",{bubbles:!0,composed:!0,detail:a}))}_dispatchSelect(t){const e={selectedDate:t};this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:e})),this.dispatchEvent(new CustomEvent("scbcalendarselect",{bubbles:!0,composed:!0,detail:e}))}_formatDayLabel(t){return new Intl.DateTimeFormat(this.lang==="en"?"en-GB":"sv-SE",{day:"numeric",month:"long",year:"numeric"}).format(t)}_formatDayAriaLabel(t,e,a){const s=a.map(r=>`${r.prefix||""}${r.title}`.trim()).filter(Boolean),n=[this._formatDayLabel(t)];return e&&n.push(e),s.length===1?n.push(this.lang==="en"?`1 event: ${s[0]}`:`1 händelse: ${s[0]}`):s.length>1&&n.push(this.lang==="en"?`${s.length} events: ${s.join(", ")}`:`${s.length} händelser: ${s.join(", ")}`),n.join(". ")}__dayOffsetFrom(t,e){const a=t.dataset.date;if(!a)return;const s=new Date(`${a}T12:00:00`);s.setDate(s.getDate()+e);const n=this.__formatDateKey(s);return this.shadowRoot?.querySelector(`.calendar-day[data-date="${n}"]`)??void 0}__formatDateKey(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}__focusCalendarDay(t){this.shadowRoot?.querySelectorAll(".calendar-day[data-date]").forEach(e=>{e.tabIndex=e===t?0:-1}),this._rovingDate=t.dataset.date??"",t.focus()}__focusAdjacentMonth(t,e){const a=t.dataset.date;if(!a)return;const s=new Date(`${a}T12:00:00`),n=new Date(s.getFullYear(),s.getMonth()+e,1),r=Math.min(s.getDate(),this._daysInMonth(n.getFullYear(),n.getMonth())),l=new Date(n.getFullYear(),n.getMonth(),r);this._current=new Date(l.getFullYear(),l.getMonth(),1),this.selectedDate="",this._popupEvent=null,this._rovingDate=this.__formatDateKey(l),this._syncDisplayFromCurrent(),this.requestUpdate(),this.updateComplete.then(()=>{const o=this.shadowRoot?.querySelector(`.calendar-day[data-date="${this._rovingDate}"]`);o&&this.__focusCalendarDay(o)})}_daysInMonth(t,e){return new Date(t,e+1,0).getDate()}_firstDayOfWeek(t,e){const a=new Date(t,e,1).getDay();return a===0?6:a-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 a=new Date(t.valueOf());return a.setDate(a.getDate()+e),a}_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 a=e%19,s=e%4,n=e%7,r=(19*a+24)%30,l=(2*s+4*n+6*r+5)%7;let o=22+r+l,d=0;o==57&&(o-=7),o==56&&r==28&&l==6&&a>10&&(o-=7),o>31?(o-=31,d=4):d=3;const u=new Date(e,d-1,o);return this._easterDateCalculated["Ar"+t]=u,new Date(this._easterDateCalculated["Ar"+t])}_swedishHolidayName(t){const e=t.getMonth();if(e===1||e===6||e===7||e===8)return null;const a=t.getMonth()+1,s=t.getDate(),n=t.getFullYear(),r=this._easterDay(n),l=this.lang==="en",o=[["Nyårsdagen","New Year's Day",a===1&&s===1],["Trettondedag jul","Epiphany",a===1&&s===6],["Långfredag","Good Friday",+t==+this._addDays(r,-2)],["Påskdagen","Easter Sunday",+t==+r],["Annandag påsk","Easter Monday",+t==+this._addDays(r,1)],["Kristi himmelsfärdsdag","Ascension Day",+t==+this._addDays(r,39)],["Pingstdagen","Pentecost",+t==+this._addDays(r,50)&&n<2005],["Första maj","May Day",a===5&&s===1],["Nationaldagen","National Day",a===6&&s===6&&n>=2005],["Midsommarafton","Midsummer's Eve",a===6&&s>=19&&s<=25&&t.getDay()===5],["Midsommardagen","Midsummer's Day",a===6&&s>=20&&s<=26&&t.getDay()===6],["Julafton","Christmas Eve",a===12&&s===24],["Juldagen","Christmas Day",a===12&&s===25],["Annandag jul","Boxing Day",a===12&&s===26],["Alla helgons dag","All Saints' Day",a===10&&s>=31&&t.getDay()===6||a===11&&s<=6&&t.getDay()===6]];for(const d of o){const[u,T,M]=d;if(M)return l?T:u}return null}render(){const t=this._current.getFullYear(),e=this._current.getMonth(),a=this._daysInMonth(t,e),s=this._firstDayOfWeek(t,e),n=this._today,r=this.lang==="en",l=r?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let o=r?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(o=o.slice(0,5));const d=this._getEventInputs(),u=d?this._buildEventMapFromInputs(d):this._buildEventMapFromChildren(),T=`${t}-${String(e+1).padStart(2,"0")}-`,M=new Date(t,e,1);if(this.disableWeekend)for(;M.getDay()===0||M.getDay()===6;)M.setDate(M.getDate()+1);const P=this.__formatDateKey(n),B=[...u.keys()].find(i=>{if(!i.startsWith(T))return!1;if(!this.disableWeekend)return!0;const h=new Date(`${i}T12:00:00`);return h.getDay()!==0&&h.getDay()!==6}),U=[this._rovingDate,this.selectedDate,P,B,this.__formatDateKey(M)].find(i=>i?.startsWith(T))??this.__formatDateKey(M),K=[];let N=1;for(let i=0;i<6;i++){const h=[],b=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let p=N;for(let D=0;D<b.length;D++){const w=b[D];if(i===0&&w<s){if(!this.disableWeekend||w<5){const E=e===0?11:e-1,C=e===0?t-1:t,y=this._daysInMonth(C,E)-(s-w-1),J=new Date(C,E,y);h.push(k`
|
|
1
|
+
import{g as z,h as Q,m as X,p as _,v as k,y as Z}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{addLazyFocusRingListeners as V}from"../shared/lazy-focus-ring.js";import{t as f}from"../../vendor/decorate.js";import{n as tt,t as I}from"../../vendor/assertClassBrand.js";import"../scb-icon-button/scb-icon-button.js";import"./scb-calendar-event.js";import"../scb-dialog/scb-dialog.js";import"../scb-list/scb-list.js";(function(){try{var $=typeof globalThis<"u"?globalThis:window;if(!$.__scb_ce_guard_installed__){$.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,a,s){try{customElements.get(e)||t(e,a,s)}catch(r){var n=String(r||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var L,O,H={fromAttribute($){if($===null)return!1;const t=$.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!=="no"}},m=(L=new WeakSet,O=class extends Q{constructor(...t){super(...t),tt(this,L),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this.eventsJson=void 0,this._eventsFromJson=null,this._eventsJsonLast=void 0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=e=>{const a=Array.from(this.shadowRoot?.querySelectorAll(".calendar-day[data-date]")??[]),s=this.shadowRoot?.activeElement,n=s&&a.includes(s)?s:document.activeElement,r=a.indexOf(n);if(r===-1)return;let l;switch(e.key){case"ArrowRight":l=a[r+1];break;case"ArrowLeft":l=a[r-1];break;case"ArrowDown":l=this.__dayOffsetFrom(n,7);break;case"ArrowUp":l=this.__dayOffsetFrom(n,-7);break;case"Home":l=Array.from(n.closest('[role="row"]')?.querySelectorAll(".calendar-day[data-date]")??[])[0];break;case"End":{const o=Array.from(n.closest('[role="row"]')?.querySelectorAll(".calendar-day[data-date]")??[]);l=o[o.length-1];break}case"PageUp":e.preventDefault(),this.__focusAdjacentMonth(n,-1);return;case"PageDown":e.preventDefault(),this.__focusAdjacentMonth(n,1);return;default:return}l&&l!==n&&(e.preventDefault(),this.__focusCalendarDay(l))},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._rovingDate="",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,a){super.attributeChangedCallback(t,e,a),t==="value"&&(this.value=a??"")}connectedCallback(){super.connectedCallback(),this._removeLazyFocusRingListeners=V(this,this.renderRoot),I(L,this,W).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"))&&I(L,this,W).call(this),!this._syncingDisplay&&(t.has("displayYear")||t.has("displayMonth"))){const e=Number(this.displayYear),a=Number(this.displayMonth);if(!Number.isNaN(e)&&!Number.isNaN(a)&&a>=1&&a<=12){const s=this._current.getFullYear(),n=this._current.getMonth()+1;(s!==e||n!==a)&&(this._current=new Date(e,a-1,1),this._dispatchMonthChange(e,a),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??"",a=t.description??"",s=t.href??"",n=t.startDate??t["start-date"]??t.start??t.date??"",r=t.endDate??t["end-date"]??t.end??"";return{title:e+"",description:a?a+"":void 0,href:s?s+"":void 0,start:n?n+"":void 0,end:r?r+"":void 0}}_toLocalEventDate(t,e){const a=(t??"").trim();if(!a)return null;if(!a.includes("T")){const n=a.split("-").map(d=>Number(d));if(n.length!==3||n.some(d=>Number.isNaN(d)))return null;const[r,l,o]=n;return e?new Date(r,l-1,o,23,59,59,999):new Date(r,l-1,o,0,0,0,0)}const s=new Date(a);return Number.isNaN(s.getTime())?null:s}_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 a of t){const s=this._normalizeEventInput(a),n=s.start||"",r=s.end||"";if(!(!n||!s.title))if(n&&r){const l=this._toLocalEventDate(n,!1),o=this._toLocalEventDate(r,!0);if(!l||!o)continue;if(o<l){const d=n.split("T")[0],u=e.get(d)||[];u.push({title:s.title,description:s.description,href:s.href,start:n,end:r}),e.set(d,u);continue}for(let d=new Date(l);d<=o;d.setDate(d.getDate()+1)){const u=this._toDateKey(d),T=e.get(u)||[];T.push({title:s.title,description:s.description,href:s.href,start:n,end:r}),e.set(u,T)}}else{const l=n.split("T")[0],o=e.get(l)||[];o.push({title:s.title,description:s.description,href:s.href,start:n}),e.set(l,o)}}return e}_buildEventMapFromChildren(){const t=Array.from(this.querySelectorAll("scb-calendar-event")),e=new Map;for(const a of t){const s=a,n=(s.startDate??s.date??"")+""||a.getAttribute("start-date")||a.getAttribute("date")||"",r=(s.endDate??"")+""||a.getAttribute("end-date")||"";if(n&&r){const l=this._toLocalEventDate(n,!1),o=this._toLocalEventDate(r,!0);if(!l||!o)continue;if(o<l){const d=n.split("T")[0],u=e.get(d)||[];u.push({title:a.title??"",description:a.description,href:s.href||a.getAttribute("href")||void 0,start:n,end:r}),e.set(d,u);continue}for(let d=new Date(l);d<=o;d.setDate(d.getDate()+1)){const u=this._toDateKey(d),T=e.get(u)||[];T.push({title:a.title??"",description:a.description,href:s.href||a.getAttribute("href")||void 0,start:n,end:r}),e.set(u,T)}}else if(n&&a.title){const l=n.split("T")[0],o=e.get(l)||[];o.push({title:a.title,description:a.description,href:s.href||a.getAttribute("href")||void 0,start:n}),e.set(l,o)}}return e}_syncDisplayFromCurrent(t=!0){const e=this._current.getFullYear(),a=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=e,this.displayMonth=a}finally{this._syncingDisplay=!1}t&&this._dispatchMonthChange(e,a)}_dispatchMonthChange(t,e){const a={displayYear:t,displayMonth:e};this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:a})),this.dispatchEvent(new CustomEvent("scbcalendarmonthchange",{bubbles:!0,composed:!0,detail:a}))}_dispatchSelect(t){const e={selectedDate:t};this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:e})),this.dispatchEvent(new CustomEvent("scbcalendarselect",{bubbles:!0,composed:!0,detail:e}))}_formatDayLabel(t){return new Intl.DateTimeFormat(this.lang==="en"?"en-GB":"sv-SE",{day:"numeric",month:"long",year:"numeric"}).format(t)}_formatDayAriaLabel(t,e,a){const s=a.map(r=>`${r.prefix||""}${r.title}`.trim()).filter(Boolean),n=[this._formatDayLabel(t)];return e&&n.push(e),s.length===1?n.push(this.lang==="en"?`1 event: ${s[0]}`:`1 händelse: ${s[0]}`):s.length>1&&n.push(this.lang==="en"?`${s.length} events: ${s.join(", ")}`:`${s.length} händelser: ${s.join(", ")}`),n.join(". ")}__dayOffsetFrom(t,e){const a=t.dataset.date;if(!a)return;const s=new Date(`${a}T12:00:00`);s.setDate(s.getDate()+e);const n=this.__formatDateKey(s);return this.shadowRoot?.querySelector(`.calendar-day[data-date="${n}"]`)??void 0}__formatDateKey(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}__focusCalendarDay(t){this.shadowRoot?.querySelectorAll(".calendar-day[data-date]").forEach(e=>{e.tabIndex=e===t?0:-1}),this._rovingDate=t.dataset.date??"",t.focus()}__focusAdjacentMonth(t,e){const a=t.dataset.date;if(!a)return;const s=new Date(`${a}T12:00:00`),n=new Date(s.getFullYear(),s.getMonth()+e,1),r=Math.min(s.getDate(),this._daysInMonth(n.getFullYear(),n.getMonth())),l=new Date(n.getFullYear(),n.getMonth(),r);this._current=new Date(l.getFullYear(),l.getMonth(),1),this.selectedDate="",this._popupEvent=null,this._rovingDate=this.__formatDateKey(l),this._syncDisplayFromCurrent(),this.requestUpdate(),this.updateComplete.then(()=>{const o=this.shadowRoot?.querySelector(`.calendar-day[data-date="${this._rovingDate}"]`);o&&this.__focusCalendarDay(o)})}_daysInMonth(t,e){return new Date(t,e+1,0).getDate()}_firstDayOfWeek(t,e){const a=new Date(t,e,1).getDay();return a===0?6:a-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 a=new Date(t.valueOf());return a.setDate(a.getDate()+e),a}_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 a=e%19,s=e%4,n=e%7,r=(19*a+24)%30,l=(2*s+4*n+6*r+5)%7;let o=22+r+l,d=0;o==57&&(o-=7),o==56&&r==28&&l==6&&a>10&&(o-=7),o>31?(o-=31,d=4):d=3;const u=new Date(e,d-1,o);return this._easterDateCalculated["Ar"+t]=u,new Date(this._easterDateCalculated["Ar"+t])}_swedishHolidayName(t){const e=t.getMonth();if(e===1||e===6||e===7||e===8)return null;const a=t.getMonth()+1,s=t.getDate(),n=t.getFullYear(),r=this._easterDay(n),l=this.lang==="en",o=[["Nyårsdagen","New Year's Day",a===1&&s===1],["Trettondedag jul","Epiphany",a===1&&s===6],["Långfredag","Good Friday",+t==+this._addDays(r,-2)],["Påskdagen","Easter Sunday",+t==+r],["Annandag påsk","Easter Monday",+t==+this._addDays(r,1)],["Kristi himmelsfärdsdag","Ascension Day",+t==+this._addDays(r,39)],["Pingstdagen","Pentecost",+t==+this._addDays(r,50)&&n<2005],["Första maj","May Day",a===5&&s===1],["Nationaldagen","National Day",a===6&&s===6&&n>=2005],["Midsommarafton","Midsummer's Eve",a===6&&s>=19&&s<=25&&t.getDay()===5],["Midsommardagen","Midsummer's Day",a===6&&s>=20&&s<=26&&t.getDay()===6],["Julafton","Christmas Eve",a===12&&s===24],["Juldagen","Christmas Day",a===12&&s===25],["Annandag jul","Boxing Day",a===12&&s===26],["Alla helgons dag","All Saints' Day",a===10&&s>=31&&t.getDay()===6||a===11&&s<=6&&t.getDay()===6]];for(const d of o){const[u,T,M]=d;if(M)return l?T:u}return null}render(){const t=this._current.getFullYear(),e=this._current.getMonth(),a=this._daysInMonth(t,e),s=this._firstDayOfWeek(t,e),n=this._today,r=this.lang==="en",l=r?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let o=r?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(o=o.slice(0,5));const d=this._getEventInputs(),u=d?this._buildEventMapFromInputs(d):this._buildEventMapFromChildren(),T=`${t}-${String(e+1).padStart(2,"0")}-`,M=new Date(t,e,1);if(this.disableWeekend)for(;M.getDay()===0||M.getDay()===6;)M.setDate(M.getDate()+1);const P=this.__formatDateKey(n),B=[...u.keys()].find(i=>{if(!i.startsWith(T))return!1;if(!this.disableWeekend)return!0;const h=new Date(`${i}T12:00:00`);return h.getDay()!==0&&h.getDay()!==6}),U=[this._rovingDate,this.selectedDate,P,B,this.__formatDateKey(M)].find(i=>i?.startsWith(T))??this.__formatDateKey(M),K=[];let N=1;for(let i=0;i<6;i++){const h=[],b=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let p=N;for(let D=0;D<b.length;D++){const w=b[D];if(i===0&&w<s){if(!this.disableWeekend||w<5){const E=e===0?11:e-1,C=e===0?t-1:t,y=this._daysInMonth(C,E)-(s-w-1),J=new Date(C,E,y);h.push(k`
|
|
2
2
|
<div
|
|
3
3
|
class="calendar-day calendar-day--other"
|
|
4
4
|
role="gridcell"
|