scb-wc 0.1.3 → 0.1.4
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 +194 -164
- package/all.js +91 -5
- package/blazor/CustomEvents.cs +83 -0
- package/blazor/ScbBlazorInteropBase.cs +4460 -1674
- package/blazor/scb-blazor-bridge.js +6827 -2805
- package/blazor/wrappers/ScbAccordion.razor +50 -0
- package/blazor/wrappers/ScbAppBar.razor +95 -0
- package/blazor/wrappers/ScbBreadcrumb.razor +59 -0
- package/blazor/wrappers/ScbCalendar.razor +100 -0
- package/blazor/wrappers/ScbCalendarCard.razor +189 -0
- package/blazor/wrappers/ScbCheckbox.razor +92 -0
- package/blazor/wrappers/ScbCollapse.razor +76 -0
- package/blazor/wrappers/ScbCookiesConsent.razor +106 -0
- package/blazor/wrappers/ScbDatepicker.razor +77 -0
- package/blazor/wrappers/ScbDialog.razor +72 -0
- package/blazor/wrappers/ScbDrawer.razor +64 -0
- package/blazor/wrappers/ScbDropZone.razor +168 -0
- package/blazor/wrappers/ScbDropdown.razor +76 -0
- package/blazor/wrappers/ScbHorizontalScroller.razor +137 -0
- package/blazor/wrappers/ScbList.razor +77 -0
- package/blazor/wrappers/ScbMenu.razor +71 -0
- package/blazor/wrappers/ScbNav.razor +92 -0
- package/blazor/wrappers/ScbNotificationCard.razor +122 -0
- package/blazor/wrappers/ScbOptionsMenu.razor +88 -0
- package/blazor/wrappers/ScbPagination.razor +80 -0
- package/blazor/wrappers/ScbRadioGroup.razor +94 -0
- package/blazor/wrappers/ScbSearch.razor +83 -0
- package/blazor/wrappers/ScbSegmentedButton.razor +85 -0
- package/blazor/wrappers/ScbSelect.razor +79 -0
- package/blazor/wrappers/ScbSlider.razor +96 -0
- package/blazor/wrappers/ScbSnackbar.razor +93 -0
- package/blazor/wrappers/ScbSwitch.razor +92 -0
- package/blazor/wrappers/ScbTable.razor +67 -0
- package/blazor/wrappers/ScbTableAdvanced.razor +78 -0
- package/blazor/wrappers/ScbTabs.razor +55 -0
- package/blazor/wrappers/ScbTextfield.razor +104 -0
- package/blazor/wrappers/ScbTooltip.razor +88 -0
- package/blazor/wrappers/ScbViz.razor +142 -0
- package/demo-data-preview.svg +12 -0
- package/dummy.png +0 -0
- package/fonts/inter/files/inter-latin-wght-italic.woff2 +0 -0
- package/fonts/inter/files/inter-latin-wght-normal.woff2 +0 -0
- package/fonts/material-symbols-outlined/files/material-symbols-outlined-latin-wght-normal.woff2 +0 -0
- package/index.js +91 -1
- package/mvc/components/all.js +90 -1
- package/mvc/components/scb-accordion/scb-accordion-item.js +211 -0
- package/mvc/components/scb-accordion/scb-accordion.js +44 -0
- package/mvc/components/scb-app-bar/scb-app-bar.js +166 -0
- package/mvc/components/scb-avatar/scb-avatar.js +111 -0
- package/mvc/components/scb-badge/scb-badge.js +80 -0
- package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +14 -0
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +96 -0
- package/mvc/components/scb-button/scb-button.js +268 -0
- package/mvc/components/scb-calendar/scb-calendar-event.js +6 -0
- package/mvc/components/scb-calendar/scb-calendar.js +168 -0
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +346 -0
- package/mvc/components/scb-card/scb-card.js +761 -0
- package/mvc/components/scb-checkbox/scb-checkbox-group.js +33 -0
- package/mvc/components/scb-checkbox/scb-checkbox.js +140 -0
- package/mvc/components/scb-chevron/scb-chevron.js +121 -0
- package/mvc/components/scb-chip/scb-chip.js +66 -0
- package/mvc/components/scb-collapse/scb-collapse.js +89 -0
- package/mvc/components/scb-cookies-consent/scb-cookies-consent.js +78 -0
- package/mvc/components/scb-datepicker/scb-datepicker.js +296 -0
- package/mvc/components/scb-dialog/scb-dialog.js +265 -0
- package/mvc/components/scb-divider/scb-divider.js +69 -0
- package/mvc/components/scb-drawer/scb-drawer.js +128 -0
- package/mvc/components/scb-drop-zone/scb-drop-zone.js +555 -0
- package/mvc/components/scb-dropdown/scb-dropdown.js +306 -0
- package/mvc/components/scb-fab/scb-fab.js +108 -0
- package/mvc/components/scb-fact-card/scb-fact-card-content.js +46 -0
- package/mvc/components/scb-fact-card/scb-fact-card.js +226 -0
- package/mvc/components/scb-footer/scb-footer-section.js +3 -0
- package/mvc/components/scb-footer/scb-footer.js +210 -0
- package/mvc/components/scb-gallery-grid/scb-gallery-grid.js +131 -0
- package/mvc/components/scb-grid/scb-grid-item.js +11 -0
- package/mvc/components/scb-grid/scb-grid.js +98 -0
- package/mvc/components/scb-grid/scb-stack.js +33 -0
- package/mvc/components/scb-header/scb-header-menu-group.js +1 -0
- package/mvc/components/scb-header/scb-header-menu-item.js +5 -0
- package/mvc/components/scb-header/scb-header-tab.js +5 -0
- package/mvc/components/scb-header/scb-header-utility.js +1 -0
- package/mvc/components/scb-header/scb-header.js +681 -0
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +196 -0
- package/mvc/components/scb-icon-button/scb-icon-button.js +171 -0
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +212 -0
- package/mvc/components/scb-link/scb-link.js +61 -0
- package/mvc/components/scb-list/scb-list-item.js +153 -0
- package/mvc/components/scb-list/scb-list.js +26 -0
- package/mvc/components/scb-menu/scb-menu-item.js +205 -0
- package/mvc/components/scb-menu/scb-menu-section.js +42 -0
- package/mvc/components/scb-menu/scb-menu.js +81 -0
- package/mvc/components/scb-menu/scb-sub-menu.js +10 -0
- package/mvc/components/scb-nav/scb-nav-item.js +28 -0
- package/mvc/components/scb-nav/scb-nav.js +104 -0
- package/mvc/components/scb-notification-card/scb-notification-card.js +358 -0
- package/mvc/components/scb-options-menu/scb-options-menu-item.js +66 -0
- package/mvc/components/scb-options-menu/scb-options-menu.js +88 -0
- package/mvc/components/scb-options-menu/scb-options-sub-menu.js +34 -0
- package/mvc/components/scb-overlay/scb-overlay.js +49 -0
- package/mvc/components/scb-pagination/scb-pagination.js +312 -0
- package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +87 -0
- package/mvc/components/scb-progress-stepper/scb-progress-step.js +147 -0
- package/mvc/components/scb-progress-stepper/scb-progress-stepper.js +62 -0
- package/mvc/components/scb-radio-button/scb-radio-button.js +132 -0
- package/mvc/components/scb-radio-button/scb-radio-group.js +43 -0
- package/mvc/components/scb-scrollspy/scb-scrollspy.js +79 -0
- package/mvc/components/scb-search/scb-search.js +292 -0
- package/mvc/components/scb-segmented-button/scb-segmented-button.js +32 -0
- package/mvc/components/scb-segmented-button/scb-segmented-item.js +74 -0
- package/mvc/components/scb-select/scb-select-option.js +61 -0
- package/mvc/components/scb-select/scb-select.js +284 -0
- package/mvc/components/scb-skeleton/scb-skeleton.js +38 -0
- package/mvc/components/scb-slider/scb-slider.js +27 -0
- package/mvc/components/scb-snackbar/scb-snackbar.js +128 -0
- package/mvc/components/scb-status-pill/scb-status-pill.js +45 -0
- package/mvc/components/scb-stepper/scb-step.js +239 -0
- package/mvc/components/scb-stepper/scb-stepper.js +139 -0
- package/mvc/components/scb-switch/scb-switch.js +59 -0
- package/mvc/components/scb-table/scb-table.js +51 -0
- package/mvc/components/scb-table-advanced/scb-table-advanced.js +76 -0
- package/mvc/components/scb-tabs/scb-primary-tab.js +6 -0
- package/mvc/components/scb-tabs/scb-secondary-tab.js +6 -0
- package/mvc/components/scb-tabs/scb-tabs.js +28 -0
- package/mvc/components/scb-textfield/scb-textfield.js +595 -0
- package/mvc/components/scb-toc/scb-toc-item.js +303 -0
- package/mvc/components/scb-toc/scb-toc.js +19 -0
- package/mvc/components/scb-tooltip/scb-tooltip.js +196 -0
- package/mvc/components/scb-vignette/scb-vignette.js +37 -0
- package/mvc/components/scb-viz/scb-viz-actions-runtime.js +2 -0
- package/mvc/components/scb-viz/scb-viz-print-runtime.js +98 -0
- package/mvc/components/scb-viz/scb-viz-series-differentiation-registry.js +1 -0
- package/mvc/components/scb-viz/scb-viz-series-differentiation-runtime.js +1 -0
- package/mvc/components/scb-viz/scb-viz-table-runtime.js +1 -0
- package/mvc/components/scb-viz/scb-viz.js +1140 -0
- package/mvc/fonts/inter/files/inter-latin-wght-italic.woff2 +0 -0
- package/mvc/fonts/inter/files/inter-latin-wght-normal.woff2 +0 -0
- package/mvc/fonts/material-symbols-outlined/files/material-symbols-outlined-latin-wght-normal.woff2 +0 -0
- package/mvc/scb-blazor-bridge.js +6827 -2805
- package/mvc/scb-logo.svg +20 -20
- package/mvc/scb-typography.css +1 -1
- package/mvc/scb-wc.css +3 -2
- package/mvc/scb.svg +13 -13
- package/mvc/vendor/assertClassBrand.js +1 -0
- package/mvc/vendor/classPrivateFieldGet2.js +1 -0
- package/mvc/vendor/decorate.js +1 -0
- package/mvc/vendor/preload-helper.js +1 -0
- package/mvc/vendor/vendor-lit.js +1 -0
- package/mvc/vendor/vendor-material.js +364 -0
- package/mvc/vendor/vendor.js +4 -0
- package/package.json +420 -77
- package/scb-accordion/scb-accordion-item.js +340 -0
- package/scb-accordion/scb-accordion.js +151 -0
- package/scb-app-bar/scb-app-bar.js +317 -0
- package/scb-avatar/scb-avatar.js +197 -0
- package/scb-badge/scb-badge.js +165 -0
- package/scb-breadcrumb/scb-breadcrumb-item.js +62 -0
- package/scb-breadcrumb/scb-breadcrumb.js +255 -0
- package/scb-button/scb-button.js +398 -0
- package/scb-calendar/scb-calendar-event.js +48 -0
- package/scb-calendar/scb-calendar.js +700 -0
- package/scb-calendar-card/scb-calendar-card.js +505 -0
- package/scb-card/scb-card.js +1231 -0
- package/scb-checkbox/scb-checkbox-group.js +104 -0
- package/scb-checkbox/scb-checkbox.js +316 -0
- package/scb-chevron/scb-chevron.js +144 -0
- package/scb-chip/scb-chip.js +234 -0
- package/scb-collapse/scb-collapse.js +231 -0
- package/scb-cookies-consent/scb-cookies-consent.js +164 -0
- package/scb-datepicker/scb-datepicker.js +470 -0
- package/scb-dialog/scb-dialog.js +574 -0
- package/scb-divider/scb-divider.js +119 -0
- package/scb-drawer/scb-drawer.js +297 -0
- package/scb-drop-zone/scb-drop-zone.js +965 -0
- package/scb-dropdown/scb-dropdown.js +598 -0
- package/scb-fab/scb-fab.js +190 -0
- package/scb-fact-card/scb-fact-card-content.js +82 -0
- package/scb-fact-card/scb-fact-card.js +376 -0
- package/scb-footer/scb-footer-section.js +23 -0
- package/scb-footer/scb-footer.js +343 -0
- package/scb-gallery-grid/scb-gallery-grid.js +242 -0
- package/scb-grid/scb-grid-item.js +81 -0
- package/scb-grid/scb-grid.js +200 -0
- package/scb-grid/scb-stack.js +120 -0
- package/scb-header/scb-header-menu-group.js +21 -0
- package/scb-header/scb-header-menu-item.js +22 -0
- package/scb-header/scb-header-tab.js +25 -0
- package/scb-header/scb-header-utility.js +27 -0
- package/scb-header/scb-header.js +1358 -0
- package/scb-horizontal-scroller/scb-horizontal-scroller.js +353 -0
- package/scb-icon-button/scb-icon-button.js +335 -0
- package/scb-keyfigure-card/scb-keyfigure-card.js +340 -0
- package/scb-link/scb-link.js +136 -0
- package/scb-list/scb-list-item.js +297 -0
- package/scb-list/scb-list.js +119 -0
- package/scb-menu/scb-menu-item.js +330 -0
- package/scb-menu/scb-menu-section.js +60 -0
- package/scb-menu/scb-menu.js +154 -0
- package/scb-menu/scb-sub-menu.js +36 -0
- package/scb-nav/scb-nav-item.js +96 -0
- package/scb-nav/scb-nav.js +263 -0
- package/scb-notification-card/scb-notification-card.js +479 -0
- package/scb-options-menu/scb-options-menu-item.js +218 -0
- package/scb-options-menu/scb-options-menu.js +237 -0
- package/scb-options-menu/scb-options-sub-menu.js +69 -0
- package/scb-overlay/scb-overlay.js +144 -0
- package/scb-pagination/scb-pagination.js +438 -0
- package/scb-progress-indicator/scb-progress-indicator.js +199 -0
- package/scb-progress-stepper/scb-progress-step.js +213 -0
- package/scb-progress-stepper/scb-progress-stepper.js +132 -0
- package/scb-radio-button/scb-radio-button.js +249 -0
- package/scb-radio-button/scb-radio-group.js +216 -0
- package/scb-scrollspy/scb-scrollspy.js +670 -0
- package/scb-search/scb-search.js +643 -0
- package/scb-segmented-button/scb-segmented-button.js +215 -0
- package/scb-segmented-button/scb-segmented-item.js +133 -0
- package/scb-select/scb-select-option.js +88 -0
- package/scb-select/scb-select.js +517 -0
- package/scb-skeleton/scb-skeleton.js +92 -0
- package/scb-slider/scb-slider.js +98 -0
- package/scb-snackbar/scb-snackbar.js +223 -0
- package/scb-status-pill/scb-status-pill.js +100 -0
- package/scb-stepper/scb-step.js +311 -0
- package/scb-stepper/scb-stepper.js +325 -0
- package/scb-switch/scb-switch.js +182 -0
- package/scb-table/scb-table.js +202 -0
- package/scb-table-advanced/scb-table-advanced.js +327 -0
- package/scb-tabs/scb-primary-tab.js +68 -0
- package/scb-tabs/scb-secondary-tab.js +68 -0
- package/scb-tabs/scb-tabs.js +100 -0
- package/scb-test-components/index.d.ts +90 -0
- package/scb-test-components/scb-accordion/scb-accordion-item.d.ts +39 -0
- package/scb-test-components/scb-accordion/scb-accordion.d.ts +27 -0
- package/scb-test-components/scb-app-bar/scb-app-bar.d.ts +25 -0
- package/scb-test-components/scb-avatar/scb-avatar.d.ts +37 -0
- package/scb-test-components/scb-badge/scb-badge.d.ts +28 -0
- package/scb-test-components/scb-breadcrumb/scb-breadcrumb-item.d.ts +15 -0
- package/scb-test-components/scb-breadcrumb/scb-breadcrumb.d.ts +27 -0
- package/scb-test-components/scb-button/scb-button.d.ts +40 -0
- package/scb-test-components/scb-calendar/scb-calendar-event.d.ts +15 -0
- package/scb-test-components/scb-calendar/scb-calendar.d.ts +77 -0
- package/scb-test-components/scb-calendar-card/scb-calendar-card.d.ts +45 -0
- package/scb-test-components/scb-card/scb-card.d.ts +101 -0
- package/scb-test-components/scb-checkbox/scb-checkbox-group.d.ts +23 -0
- package/scb-test-components/scb-checkbox/scb-checkbox.d.ts +52 -0
- package/scb-test-components/scb-chevron/scb-chevron.d.ts +13 -0
- package/scb-test-components/scb-chip/scb-chip.d.ts +61 -0
- package/scb-test-components/scb-collapse/scb-collapse.d.ts +29 -0
- package/scb-test-components/scb-cookies-consent/scb-cookies-consent.d.ts +23 -0
- package/scb-test-components/scb-datepicker/scb-datepicker.d.ts +39 -0
- package/scb-test-components/scb-dialog/scb-dialog.d.ts +72 -0
- package/scb-test-components/scb-divider/scb-divider.d.ts +34 -0
- package/scb-test-components/scb-drawer/scb-drawer.d.ts +72 -0
- package/scb-test-components/scb-drop-zone/scb-drop-zone.d.ts +143 -0
- package/scb-test-components/scb-dropdown/scb-dropdown.d.ts +70 -0
- package/scb-test-components/scb-fab/scb-fab.d.ts +42 -0
- package/scb-test-components/scb-fact-card/scb-fact-card-content.d.ts +15 -0
- package/scb-test-components/scb-fact-card/scb-fact-card.d.ts +49 -0
- package/scb-test-components/scb-footer/scb-footer-section.d.ts +20 -0
- package/scb-test-components/scb-footer/scb-footer.d.ts +31 -0
- package/scb-test-components/scb-gallery-grid/scb-gallery-grid.d.ts +20 -0
- package/scb-test-components/scb-grid/scb-grid-item.d.ts +32 -0
- package/scb-test-components/scb-grid/scb-grid.d.ts +36 -0
- package/scb-test-components/scb-grid/scb-stack.d.ts +32 -0
- package/scb-test-components/scb-header/scb-header-menu-group.d.ts +12 -0
- package/scb-test-components/scb-header/scb-header-menu-item.d.ts +13 -0
- package/scb-test-components/scb-header/scb-header-tab.d.ts +13 -0
- package/scb-test-components/scb-header/scb-header-utility.d.ts +14 -0
- package/scb-test-components/scb-header/scb-header.d.ts +132 -0
- package/scb-test-components/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +47 -0
- package/scb-test-components/scb-icon-button/scb-icon-button.d.ts +76 -0
- package/scb-test-components/scb-keyfigure-card/scb-keyfigure-card.d.ts +46 -0
- package/scb-test-components/scb-link/scb-link.d.ts +25 -0
- package/scb-test-components/scb-list/scb-list-item.d.ts +38 -0
- package/scb-test-components/scb-list/scb-list.d.ts +26 -0
- package/scb-test-components/scb-menu/scb-menu-item.d.ts +52 -0
- package/scb-test-components/scb-menu/scb-menu-section.d.ts +11 -0
- package/scb-test-components/scb-menu/scb-menu.d.ts +25 -0
- package/scb-test-components/scb-menu/scb-sub-menu.d.ts +14 -0
- package/scb-test-components/scb-nav/scb-nav-item.d.ts +20 -0
- package/scb-test-components/scb-nav/scb-nav.d.ts +50 -0
- package/scb-test-components/scb-notification-card/scb-notification-card.d.ts +46 -0
- package/scb-test-components/scb-options-menu/scb-options-menu-item.d.ts +29 -0
- package/scb-test-components/scb-options-menu/scb-options-menu.d.ts +35 -0
- package/scb-test-components/scb-options-menu/scb-options-sub-menu.d.ts +11 -0
- package/scb-test-components/scb-overlay/scb-overlay.d.ts +24 -0
- package/scb-test-components/scb-pagination/scb-pagination.d.ts +36 -0
- package/scb-test-components/scb-progress-indicator/scb-progress-indicator.d.ts +28 -0
- package/scb-test-components/scb-progress-stepper/scb-progress-step.d.ts +21 -0
- package/scb-test-components/scb-progress-stepper/scb-progress-stepper.d.ts +22 -0
- package/scb-test-components/scb-radio-button/scb-radio-button.d.ts +26 -0
- package/scb-test-components/scb-radio-button/scb-radio-group.d.ts +49 -0
- package/scb-test-components/scb-scrollspy/scb-scrollspy.d.ts +217 -0
- package/scb-test-components/scb-search/scb-search.d.ts +96 -0
- package/scb-test-components/scb-segmented-button/scb-segmented-button.d.ts +80 -0
- package/scb-test-components/scb-segmented-button/scb-segmented-item.d.ts +21 -0
- package/scb-test-components/scb-select/scb-select-option.d.ts +16 -0
- package/scb-test-components/scb-select/scb-select.d.ts +62 -0
- package/scb-test-components/scb-skeleton/scb-skeleton.d.ts +25 -0
- package/scb-test-components/scb-slider/scb-slider.d.ts +28 -0
- package/scb-test-components/scb-snackbar/scb-snackbar.d.ts +24 -0
- package/scb-test-components/scb-status-pill/scb-status-pill.d.ts +22 -0
- package/scb-test-components/scb-stepper/scb-step.d.ts +22 -0
- package/scb-test-components/scb-stepper/scb-stepper.d.ts +47 -0
- package/scb-test-components/scb-switch/scb-switch.d.ts +52 -0
- package/scb-test-components/scb-table/scb-table.d.ts +24 -0
- package/scb-test-components/scb-table-advanced/scb-table-advanced.d.ts +39 -0
- package/scb-test-components/scb-tabs/scb-primary-tab.d.ts +15 -0
- package/scb-test-components/scb-tabs/scb-secondary-tab.d.ts +15 -0
- package/scb-test-components/scb-tabs/scb-tabs.d.ts +21 -0
- package/scb-test-components/scb-textfield/scb-textfield.d.ts +75 -0
- package/scb-test-components/scb-toc/scb-toc-item.d.ts +38 -0
- package/scb-test-components/scb-toc/scb-toc.d.ts +27 -0
- package/scb-test-components/scb-tooltip/scb-tooltip.d.ts +51 -0
- package/scb-test-components/scb-vignette/scb-vignette.d.ts +20 -0
- package/scb-test-components/scb-viz/scb-viz-actions-runtime.d.ts +26 -0
- package/scb-test-components/scb-viz/scb-viz-print-runtime.d.ts +27 -0
- package/scb-test-components/scb-viz/scb-viz-series-differentiation-registry.d.ts +21 -0
- package/scb-test-components/scb-viz/scb-viz-series-differentiation-runtime.d.ts +42 -0
- package/scb-test-components/scb-viz/scb-viz-table-runtime.d.ts +28 -0
- package/scb-test-components/scb-viz/scb-viz.d.ts +207 -0
- package/scb-textfield/scb-textfield.js +827 -0
- package/scb-toc/scb-toc-item.js +477 -0
- package/scb-toc/scb-toc.js +101 -0
- package/scb-tooltip/scb-tooltip.js +402 -0
- package/scb-typography.css +1 -1
- package/scb-vignette/scb-vignette.js +88 -0
- package/scb-viz/scb-viz-actions-runtime.js +143 -0
- package/scb-viz/scb-viz-print-runtime.js +121 -0
- package/scb-viz/scb-viz-series-differentiation-registry.js +117 -0
- package/scb-viz/scb-viz-series-differentiation-runtime.js +126 -0
- package/scb-viz/scb-viz-table-runtime.js +86 -0
- package/scb-viz/scb-viz.js +2195 -0
- package/scb-wc-selfhost.css +29 -0
- package/scb-wc.bundle.js +12893 -1099
- package/scb-wc.css +3 -2
- package/scb-wc.d.ts +180 -0
- package/index.d.ts +0 -0
- package/mvc/components/index.js +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{_ as l,b as h,g as b,h as a,y as c}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as r}from"../../vendor/decorate.js";import"../scb-link/scb-link.js";(function(){try{var s=typeof globalThis<"u"?globalThis:window;if(!s.__scb_ce_guard_installed__){s.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(i,o,d){try{customElements.get(i)||t(i,o,d)}catch(u){var n=String(u||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw u}}}}catch{}})();var e=class extends l{constructor(...t){super(...t),this.label="",this.isCurrent=!1,this.href=""}connectedCallback(){if(super.connectedCallback(),this.hasAttribute("current")&&!this.hasAttribute("is-current")&&(this.isCurrent=!0),!this.href){const t=this.getAttribute("href");t&&(this.href=t)}}static get styles(){return h`
|
|
2
|
+
.breadcrumb-separator {
|
|
3
|
+
margin: var(--spacing-0) var(--spacing-3);
|
|
4
|
+
color: var(--md-sys-color-on-surface);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.breadcrumb-current {
|
|
8
|
+
color: var(--md-sys-color-on-surface);
|
|
9
|
+
font-family: var(--brand-font, var(--brand, "Inter"), sans-serif);
|
|
10
|
+
}
|
|
11
|
+
`}updated(t){t.has("isCurrent")&&(this.dispatchEvent(new CustomEvent("current-changed",{detail:{isCurrent:this.isCurrent},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("currentchanged",{detail:{isCurrent:this.isCurrent,value:this.isCurrent},bubbles:!0,composed:!0})))}render(){return!0===this.isCurrent?c`<span class="breadcrumb-current">${this.label}</span>`:c`
|
|
12
|
+
<scb-link href="${this.href||this.getAttribute("href")||""}">${this.label}</scb-link>
|
|
13
|
+
<span class="breadcrumb-separator">/</span>
|
|
14
|
+
`}};r([a({type:String})],e.prototype,"label",void 0);r([a({type:Boolean,attribute:"is-current",reflect:!0})],e.prototype,"isCurrent",void 0);r([a({type:String,attribute:"item-href"})],e.prototype,"href",void 0);e=r([b("scb-breadcrumb-item")],e);
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import"../../vendor/vendor-material.js";import{_ as v,b as k,g as _,h as p,y as d}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as c}from"../../vendor/decorate.js";import{n as w,t as g}from"../../vendor/assertClassBrand.js";import"../scb-link/scb-link.js";import"./scb-breadcrumb-item.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,s,l){try{customElements.get(t)||e(t,s,l)}catch(r){var o=String(r||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var m,n=(m=new WeakSet,class extends v{constructor(...e){super(...e),w(this,m),this.showAll=!1,this.currentIndex=void 0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}static get styles(){return k`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
margin-block-start: var(--scb-breadcrumb-spacing-block-start, 0);
|
|
5
|
+
margin-block-end: var(--scb-breadcrumb-spacing-block-end, 0);
|
|
6
|
+
margin-inline-start: var(--scb-breadcrumb-spacing-inline-start, 0);
|
|
7
|
+
margin-inline-end: var(--scb-breadcrumb-spacing-inline-end, 0);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.scb-breadcrumb {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
flex-wrap: wrap;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.breadcrumb-item {
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.breadcrumb-separator {
|
|
22
|
+
margin: var(--spacing-0) var(--spacing-3);
|
|
23
|
+
color: var(--md-sys-color-on-surface);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.breadcrumb-current {
|
|
27
|
+
color: var(--md-sys-color-on-surface);
|
|
28
|
+
font-family: var(--brand-font, var(--brand, "Inter"), sans-serif);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ellipsis {
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
color: var(--md-sys-color-primary);
|
|
35
|
+
position: relative;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ellipsis:focus {
|
|
39
|
+
outline: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.breadcrumb-animate {
|
|
43
|
+
opacity: 0;
|
|
44
|
+
transform: translateY(10px);
|
|
45
|
+
animation: fadeInBreadcrumb 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
md-focus-ring {
|
|
49
|
+
position: absolute;
|
|
50
|
+
inset: 0;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
display: none;
|
|
53
|
+
border-radius: var(
|
|
54
|
+
--scb-card-focus-ring-radius,
|
|
55
|
+
var(--md-sys-shape-corner-large)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ellipsis:focus md-focus-ring {
|
|
60
|
+
display: block;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes fadeInBreadcrumb {
|
|
64
|
+
to {
|
|
65
|
+
opacity: 1;
|
|
66
|
+
transform: translateY(0);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`}connectedCallback(){super.connectedCallback(),this._observer=new MutationObserver(()=>{this.requestUpdate()}),this._observer.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","item-href","href","is-current","current"]})}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}firstUpdated(){g(m,this,y).call(this)}updated(e){e.has("showAll")&&(this.dispatchEvent(new CustomEvent("show-all-changed",{detail:{showAll:this.showAll},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("showallchanged",{detail:{showAll:this.showAll,value:this.showAll},bubbles:!0,composed:!0}))),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&g(m,this,y).call(this)}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}_onEllipsisClick(){this.showAll?this.showAll=!1:(this.showAll=!0,this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelectorAll(".scb-breadcrumb.expanded .breadcrumb-item");e&&(e.forEach((t,s)=>{t.classList.add("breadcrumb-animate"),t.style.animationDelay=`${s*60}ms`}),setTimeout(()=>{e.forEach(t=>{t.classList.remove("breadcrumb-animate"),t.style.animationDelay=""})},600))}))}getItemLabel(e){const t=e.label;return typeof t=="string"?t:e.getAttribute("label")??""}getItemHref(e){const t=e;return typeof t.itemHref=="string"?t.itemHref:typeof t.href=="string"?t.href:e.getAttribute("item-href")??e.getAttribute("href")??""}render(){const e=Array.from(this.children).filter(r=>r.tagName.toLowerCase()==="scb-breadcrumb-item"),t=Math.max(0,e.length-1);let s=t;if(e.length>0){const r=typeof this.currentIndex=="number"&&!Number.isNaN(this.currentIndex)?Math.trunc(this.currentIndex):void 0;if(typeof r=="number"&&r>=0&&r<e.length)s=r;else for(let i=e.length-1;i>=0;i--){const a=e[i];if(typeof a.isCurrent=="boolean"?a.isCurrent:e[i].hasAttribute("is-current")||e[i].hasAttribute("current")){s=i;break}}e.forEach((i,a)=>{i.toggleAttribute("is-current",a===s)})}const l=e.length>6&&!this.showAll&&s===t,o=[];if(l){const r=e.slice(0,3),i=e.slice(-3);r.forEach((a,u)=>{o.push({type:"item",item:a,isCurrent:u===s})}),o.push({type:"ellipsis"}),i.forEach((a,u)=>{const h=e.length-3+u;o.push({type:"item",item:a,isCurrent:h===s})})}else e.forEach((r,i)=>{o.push({type:"item",item:r,isCurrent:i===s})});return d`
|
|
70
|
+
<div class="scb-breadcrumb ${l?"collapsed":"expanded"}">
|
|
71
|
+
${o.map((r,i)=>{const a=i===0?d``:d`<span class="breadcrumb-separator">/</span>`;if(r.type==="ellipsis")return d`
|
|
72
|
+
${a}
|
|
73
|
+
<span
|
|
74
|
+
class="breadcrumb-item ellipsis"
|
|
75
|
+
aria-label="Visa alla"
|
|
76
|
+
role="button"
|
|
77
|
+
tabindex="0"
|
|
78
|
+
@click=${this._onEllipsisClick}
|
|
79
|
+
@keydown=${f=>{(f.key==="Enter"||f.key===" ")&&this._onEllipsisClick()}}
|
|
80
|
+
>
|
|
81
|
+
<md-icon>
|
|
82
|
+
<md-focus-ring></md-focus-ring>
|
|
83
|
+
more_horiz
|
|
84
|
+
</md-icon>
|
|
85
|
+
</span>
|
|
86
|
+
`;const u=this.getItemLabel(r.item),h=this.getItemHref(r.item);return r.isCurrent?d`
|
|
87
|
+
${a}
|
|
88
|
+
<span class="breadcrumb-item breadcrumb-current">${u}</span>
|
|
89
|
+
`:d`
|
|
90
|
+
${a}
|
|
91
|
+
<span class="breadcrumb-item">
|
|
92
|
+
<scb-link href="${h}">${u}</scb-link>
|
|
93
|
+
</span>
|
|
94
|
+
`})}
|
|
95
|
+
</div>
|
|
96
|
+
`}});function y(){const b=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??b,t=this.mapSpacingToken(this.spacingBottom)??b,s=this.mapSpacingToken(this.spacingLeft),l=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-breadcrumb-spacing-block-start",e):this.style.removeProperty("--scb-breadcrumb-spacing-block-start"),t?this.style.setProperty("--scb-breadcrumb-spacing-block-end",t):this.style.removeProperty("--scb-breadcrumb-spacing-block-end"),s?this.style.setProperty("--scb-breadcrumb-spacing-inline-start",s):this.style.removeProperty("--scb-breadcrumb-spacing-inline-start"),l?this.style.setProperty("--scb-breadcrumb-spacing-inline-end",l):this.style.removeProperty("--scb-breadcrumb-spacing-inline-end")}c([p({type:Boolean,attribute:"show-all",reflect:!0})],n.prototype,"showAll",void 0);c([p({type:Number,attribute:"current-index",reflect:!0})],n.prototype,"currentIndex",void 0);c([p({type:String,reflect:!0})],n.prototype,"spacing",void 0);c([p({type:String,attribute:"spacing-top",reflect:!0})],n.prototype,"spacingTop",void 0);c([p({type:String,attribute:"spacing-bottom",reflect:!0})],n.prototype,"spacingBottom",void 0);c([p({type:String,attribute:"spacing-left",reflect:!0})],n.prototype,"spacingLeft",void 0);c([p({type:String,attribute:"spacing-right",reflect:!0})],n.prototype,"spacingRight",void 0);n=c([_("scb-breadcrumb")],n);
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import"../../vendor/vendor-material.js";import{_ as z,b as A,g as S,h as l,v as i,y as b}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as a}from"../../vendor/decorate.js";import{n as I,t as k}from"../../vendor/assertClassBrand.js";(function(){try{var c=typeof globalThis<"u"?globalThis:window;if(!c.__scb_ce_guard_installed__){c.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,o,s){try{customElements.get(e)||t(e,o,s)}catch(u){var p=String(u||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw u}}}}catch{}})();var g,n=(g=new WeakSet,class extends z{constructor(...t){super(...t),I(this,g),this.variant="filled",this.size="medium",this.type="button",this.label="Button",this.trailingIcon=!1,this.icon="",this.iconFilled=!1,this.disabled=!1,this.fullWidth=!1,this.href="",this.target="",this.rel="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}__getMdHost(){return this.renderRoot.querySelector("md-filled-button, md-outlined-button, md-filled-tonal-button, md-text-button")}__getInnerNativeButton(t){return t?.shadowRoot?.querySelector("button")??null}__syncAriaToInner(){const t=this.__getMdHost(),e=this.__getInnerNativeButton(t);if(!t||!e)return;const o=(this.getAttribute("aria-label")||"").trim(),s=(t.getAttribute("aria-label")||"").trim(),p=this.label.trim()===""?(this.icon||"").trim():"",u=o||s||p;u?e.setAttribute("aria-label",u):e.removeAttribute("aria-label");const y=this.getAttribute("aria-controls");y!==null?e.setAttribute("aria-controls",y):e.removeAttribute("aria-controls");const f=this.getAttribute("aria-expanded");f!==null?e.setAttribute("aria-expanded",f):e.removeAttribute("aria-expanded"),t.removeAttribute("aria-label"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-expanded"),this.removeAttribute("aria-expanded"),this.__ariaObserver?.disconnect(),this.__ariaObserver=new MutationObserver($=>{const r=this.__getMdHost(),m=this.__getInnerNativeButton(r);if(!(!r||!m)){for(const h of $){if(h.type!=="attributes"||!h.attributeName)continue;const d=h.attributeName,v=this.getAttribute(d);if(d==="aria-label"){const w=(r.getAttribute("aria-label")||"").trim(),x=(v||w||(this.label.trim()===""?(this.icon||"").trim():"")).trim();x?m.setAttribute("aria-label",x):m.removeAttribute("aria-label"),r.removeAttribute("aria-label")}else(d==="aria-controls"||d==="aria-expanded")&&(v===null?m.removeAttribute(d):m.setAttribute(d,v),d==="aria-expanded"&&this.removeAttribute("aria-expanded"))}r.removeAttribute("aria-label"),r.removeAttribute("aria-controls"),r.removeAttribute("aria-expanded")}}),this.__ariaObserver.observe(this,{attributes:!0,attributeFilter:["aria-label","aria-controls","aria-expanded"]})}firstUpdated(){(this.type==="submit"||this.type==="reset")&&this.addEventListener("click",()=>{if(!this.disabled){const t=this.closest("form");t&&(this.type==="submit"&&t.requestSubmit(),this.type==="reset"&&t.reset())}}),this.__syncAriaToInner(),k(g,this,_).call(this)}updated(t){t.has("variant")&&this.__syncAriaToInner(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&k(g,this,_).call(this)}disconnectedCallback(){this.__ariaObserver?.disconnect(),super.disconnectedCallback()}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}static get styles(){return A`
|
|
2
|
+
/* Gör hosten stretchbar i t.ex. flex/grid */
|
|
3
|
+
:host {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
block-size: var(--scb-button-block-size, auto);
|
|
6
|
+
margin-block-start: var(--scb-button-spacing-block-start, 0);
|
|
7
|
+
margin-block-end: var(--scb-button-spacing-block-end, 0);
|
|
8
|
+
margin-inline-start: var(--scb-button-spacing-inline-start, 0);
|
|
9
|
+
margin-inline-end: var(--scb-button-spacing-inline-end, 0);
|
|
10
|
+
--scb-button-font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
|
11
|
+
--scb-button-padding-block: calc(var(--spacing-4) - var(--spacing-1));
|
|
12
|
+
--scb-button-label-text-line-height: var(--md-sys-typescale-label-small-line-height);
|
|
13
|
+
--scb-button-container-height: calc(
|
|
14
|
+
var(--scb-button-label-text-line-height) + var(--scb-button-padding-block) + var(--scb-button-padding-block)
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
--scb-button-padding-inline: var(--spacing-5);
|
|
19
|
+
--scb-button-icon-edge-space: var(--spacing-5);
|
|
20
|
+
--scb-button-icon-gap: var(--spacing-3);
|
|
21
|
+
--scb-button-icon-size: var(--icon-size-small, 20px);
|
|
22
|
+
|
|
23
|
+
/* Label, mappar till md-sys-typescale-label-small */
|
|
24
|
+
--md-filled-button-label-text-font: var(--md-sys-typescale-label-small-font);
|
|
25
|
+
--md-filled-button-label-text-size: var(--md-sys-typescale-label-small-size);
|
|
26
|
+
--md-filled-button-label-text-line-height: var(--md-sys-typescale-label-small-line-height);
|
|
27
|
+
--md-filled-button-label-text-tracking: var(--md-sys-typescale-label-small-tracking);
|
|
28
|
+
--md-filled-button-label-text-weight: var(--md-sys-typescale-label-small-weight);
|
|
29
|
+
|
|
30
|
+
--md-outlined-button-label-text-font: var(--md-sys-typescale-label-small-font);
|
|
31
|
+
--md-outlined-button-label-text-size: var(--md-sys-typescale-label-small-size);
|
|
32
|
+
--md-outlined-button-label-text-line-height: var(--md-sys-typescale-label-small-line-height);
|
|
33
|
+
--md-outlined-button-label-text-tracking: var(--md-sys-typescale-label-small-tracking);
|
|
34
|
+
--md-outlined-button-label-text-weight: var(--md-sys-typescale-label-small-weight);
|
|
35
|
+
|
|
36
|
+
--md-filled-tonal-button-label-text-font: var(--md-sys-typescale-label-small-font);
|
|
37
|
+
--md-filled-tonal-button-label-text-size: var(--md-sys-typescale-label-small-size);
|
|
38
|
+
--md-filled-tonal-button-label-text-line-height: var(--md-sys-typescale-label-small-line-height);
|
|
39
|
+
--md-filled-tonal-button-label-text-tracking: var(--md-sys-typescale-label-small-tracking);
|
|
40
|
+
--md-filled-tonal-button-label-text-weight: var(--md-sys-typescale-label-small-weight);
|
|
41
|
+
|
|
42
|
+
--md-text-button-label-text-font: var(--md-sys-typescale-label-small-font);
|
|
43
|
+
--md-text-button-label-text-size: var(--md-sys-typescale-label-small-size);
|
|
44
|
+
--md-text-button-label-text-line-height: var(--md-sys-typescale-label-small-line-height);
|
|
45
|
+
--md-text-button-label-text-tracking: var(--md-sys-typescale-label-small-tracking);
|
|
46
|
+
--md-text-button-label-text-weight: var(--md-sys-typescale-label-small-weight);
|
|
47
|
+
|
|
48
|
+
/* Grundpadding (utan ikon) */
|
|
49
|
+
--md-filled-button-leading-space: var(--scb-button-padding-inline);
|
|
50
|
+
--md-filled-button-trailing-space: var(--scb-button-padding-inline);
|
|
51
|
+
--md-outlined-button-leading-space: var(--scb-button-padding-inline);
|
|
52
|
+
--md-outlined-button-trailing-space: var(--scb-button-padding-inline);
|
|
53
|
+
--md-filled-tonal-button-leading-space: var(--scb-button-padding-inline);
|
|
54
|
+
--md-filled-tonal-button-trailing-space: var(--scb-button-padding-inline);
|
|
55
|
+
--md-text-button-leading-space: var(--scb-button-padding-inline);
|
|
56
|
+
--md-text-button-trailing-space: var(--scb-button-padding-inline);
|
|
57
|
+
|
|
58
|
+
/* Med ikon: avstånd till ytterkanter + mellan ikon och label */
|
|
59
|
+
--md-filled-button-with-leading-icon-leading-space: var(--scb-button-icon-edge-space);
|
|
60
|
+
--md-filled-button-with-leading-icon-trailing-space: var(--scb-button-padding-inline);
|
|
61
|
+
--md-filled-button-with-trailing-icon-leading-space: var(--scb-button-padding-inline);
|
|
62
|
+
--md-filled-button-with-trailing-icon-trailing-space: var(--scb-button-icon-edge-space);
|
|
63
|
+
|
|
64
|
+
--md-outlined-button-with-leading-icon-leading-space: var(--scb-button-icon-edge-space);
|
|
65
|
+
--md-outlined-button-with-leading-icon-trailing-space: var(--scb-button-padding-inline);
|
|
66
|
+
--md-outlined-button-with-trailing-icon-leading-space: var(--scb-button-padding-inline);
|
|
67
|
+
--md-outlined-button-with-trailing-icon-trailing-space: var(--scb-button-icon-edge-space);
|
|
68
|
+
|
|
69
|
+
--md-filled-tonal-button-with-leading-icon-leading-space: var(--scb-button-icon-edge-space);
|
|
70
|
+
--md-filled-tonal-button-with-leading-icon-trailing-space: var(--scb-button-padding-inline);
|
|
71
|
+
--md-filled-tonal-button-with-trailing-icon-leading-space: var(--scb-button-padding-inline);
|
|
72
|
+
--md-filled-tonal-button-with-trailing-icon-trailing-space: var(--scb-button-icon-edge-space);
|
|
73
|
+
|
|
74
|
+
--md-text-button-with-leading-icon-leading-space: var(--scb-button-icon-edge-space);
|
|
75
|
+
--md-text-button-with-leading-icon-trailing-space: var(--scb-button-padding-inline);
|
|
76
|
+
--md-text-button-with-trailing-icon-leading-space: var(--scb-button-padding-inline);
|
|
77
|
+
--md-text-button-with-trailing-icon-trailing-space: var(--scb-button-icon-edge-space);
|
|
78
|
+
|
|
79
|
+
/* Ikonstorlek */
|
|
80
|
+
--md-filled-button-icon-size: var(--scb-button-icon-size);
|
|
81
|
+
--md-outlined-button-icon-size: var(--scb-button-icon-size);
|
|
82
|
+
--md-filled-tonal-button-icon-size: var(--scb-button-icon-size);
|
|
83
|
+
--md-text-button-icon-size: var(--scb-button-icon-size);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:host([size='small']) {
|
|
87
|
+
--scb-button-padding-block: calc(var(--spacing-3) - var(--spacing-1));
|
|
88
|
+
--scb-button-padding-inline: var(--spacing-4);
|
|
89
|
+
--scb-button-icon-edge-space: var(--spacing-4);
|
|
90
|
+
--scb-button-icon-gap: var(--spacing-2);
|
|
91
|
+
--scb-button-icon-size: var(--icon-size-small, 20px);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([size='large']) {
|
|
95
|
+
--scb-button-padding-block: var(--spacing-5);
|
|
96
|
+
--scb-button-label-text-line-height: var(--md-sys-typescale-label-medium-line-height);
|
|
97
|
+
|
|
98
|
+
--scb-button-padding-inline: var(--spacing-7);
|
|
99
|
+
--scb-button-icon-edge-space: var(--spacing-7);
|
|
100
|
+
--scb-button-icon-gap: var(--spacing-3);
|
|
101
|
+
--scb-button-icon-size: var(--icon-size-medium, 24px);
|
|
102
|
+
|
|
103
|
+
/* Label, mappar till md-sys-typescale-label-medium */
|
|
104
|
+
--md-filled-button-label-text-font: var(--md-sys-typescale-label-medium-font);
|
|
105
|
+
--md-filled-button-label-text-size: var(--md-sys-typescale-label-medium-size);
|
|
106
|
+
--md-filled-button-label-text-line-height: var(--md-sys-typescale-label-medium-line-height);
|
|
107
|
+
--md-filled-button-label-text-tracking: var(--md-sys-typescale-label-medium-tracking);
|
|
108
|
+
--md-filled-button-label-text-weight: var(--md-sys-typescale-label-medium-weight);
|
|
109
|
+
|
|
110
|
+
--md-outlined-button-label-text-font: var(--md-sys-typescale-label-medium-font);
|
|
111
|
+
--md-outlined-button-label-text-size: var(--md-sys-typescale-label-medium-size);
|
|
112
|
+
--md-outlined-button-label-text-line-height: var(--md-sys-typescale-label-medium-line-height);
|
|
113
|
+
--md-outlined-button-label-text-tracking: var(--md-sys-typescale-label-medium-tracking);
|
|
114
|
+
--md-outlined-button-label-text-weight: var(--md-sys-typescale-label-medium-weight);
|
|
115
|
+
|
|
116
|
+
--md-filled-tonal-button-label-text-font: var(--md-sys-typescale-label-medium-font);
|
|
117
|
+
--md-filled-tonal-button-label-text-size: var(--md-sys-typescale-label-medium-size);
|
|
118
|
+
--md-filled-tonal-button-label-text-line-height: var(--md-sys-typescale-label-medium-line-height);
|
|
119
|
+
--md-filled-tonal-button-label-text-tracking: var(--md-sys-typescale-label-medium-tracking);
|
|
120
|
+
--md-filled-tonal-button-label-text-weight: var(--md-sys-typescale-label-medium-weight);
|
|
121
|
+
|
|
122
|
+
--md-text-button-label-text-font: var(--md-sys-typescale-label-medium-font);
|
|
123
|
+
--md-text-button-label-text-size: var(--md-sys-typescale-label-medium-size);
|
|
124
|
+
--md-text-button-label-text-line-height: var(--md-sys-typescale-label-medium-line-height);
|
|
125
|
+
--md-text-button-label-text-tracking: var(--md-sys-typescale-label-medium-tracking);
|
|
126
|
+
--md-text-button-label-text-weight: var(--md-sys-typescale-label-medium-weight);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:host([icon-filled]) {
|
|
130
|
+
--scb-button-font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
md-icon {
|
|
134
|
+
--md-icon-font-variation-settings: var(--scb-button-font-variation-settings) !important;
|
|
135
|
+
font-variation-settings: var(--scb-button-font-variation-settings) !important;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:host([full-width]) {
|
|
139
|
+
display: flex;
|
|
140
|
+
inline-size: 100%;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Låt inre md-knappar fylla hostens höjd */
|
|
144
|
+
md-filled-button,
|
|
145
|
+
md-outlined-button,
|
|
146
|
+
md-filled-tonal-button,
|
|
147
|
+
md-text-button {
|
|
148
|
+
block-size: var(--scb-button-block-size, auto);
|
|
149
|
+
gap: var(--scb-button-icon-gap);
|
|
150
|
+
--md-filled-button-container-height: var(--scb-button-block-size, var(--scb-button-container-height));
|
|
151
|
+
--md-outlined-button-container-height: var(--scb-button-block-size, var(--scb-button-container-height));
|
|
152
|
+
--md-filled-tonal-button-container-height: var(--scb-button-block-size, var(--scb-button-container-height));
|
|
153
|
+
--md-text-button-container-height: var(--scb-button-block-size, var(--scb-button-container-height));
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:host([full-width]) md-filled-button,
|
|
157
|
+
:host([full-width]) md-outlined-button,
|
|
158
|
+
:host([full-width]) md-filled-tonal-button,
|
|
159
|
+
:host([full-width]) md-text-button {
|
|
160
|
+
inline-size: 100%;
|
|
161
|
+
flex: 1 1 auto;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* Errorvarianter */
|
|
165
|
+
/*
|
|
166
|
+
md-filled-button[variant='error'],
|
|
167
|
+
md-outlined-button[variant='error'],
|
|
168
|
+
md-filled-tonal-button[variant='error'],
|
|
169
|
+
md-text-button[variant='error'] {
|
|
170
|
+
--md-sys-color-primary: var(--md-sys-color-error);
|
|
171
|
+
--md-sys-color-on-primary: var(--md-sys-color-on-error);
|
|
172
|
+
}
|
|
173
|
+
*/
|
|
174
|
+
|
|
175
|
+
/* Outlined – röd outline vid error + tjockare vid hover */
|
|
176
|
+
/*
|
|
177
|
+
md-outlined-button[variant='error'] {
|
|
178
|
+
--_outline-color: var(--md-sys-color-error);
|
|
179
|
+
--md-outlined-button-pressed-outline-color: var(--md-sys-color-error);
|
|
180
|
+
}
|
|
181
|
+
*/
|
|
182
|
+
/* md-outlined-button[variant='error']:hover, */
|
|
183
|
+
md-outlined-button:hover {
|
|
184
|
+
--md-outlined-button-outline-width: var(--spacing-1, 1px);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* Filled-tonal – error-färger */
|
|
188
|
+
/*
|
|
189
|
+
md-filled-tonal-button[variant='error'] {
|
|
190
|
+
--md-filled-tonal-button-container-color: var(--md-sys-color-error-container);
|
|
191
|
+
--md-filled-tonal-button-label-text-color: var(--md-sys-color-on-error-container);
|
|
192
|
+
--md-filled-tonal-button-hover-label-text-color: var(--md-sys-color-on-error-container);
|
|
193
|
+
--md-filled-tonal-button-pressed-label-text-color: var(--md-sys-color-on-error-container);
|
|
194
|
+
--md-filled-tonal-button-focus-label-text-color: var(--md-sys-color-on-error-container);
|
|
195
|
+
--md-filled-tonal-button-icon-color: var(--md-sys-color-on-error-container);
|
|
196
|
+
--md-filled-tonal-button-hover-icon-color: var(--md-sys-color-on-error-container);
|
|
197
|
+
--md-filled-tonal-button-pressed-icon-color: var(--md-sys-color-on-error-container);
|
|
198
|
+
--md-filled-tonal-button-focus-icon-color: var(--md-sys-color-on-error-container);
|
|
199
|
+
--md-filled-tonal-button-hover-state-layer-color: var(--md-sys-color-on-error-container);
|
|
200
|
+
--md-filled-tonal-button-pressed-state-layer-color: var(--md-sys-color-on-error-container);
|
|
201
|
+
}
|
|
202
|
+
@media (prefers-color-scheme: dark) {
|
|
203
|
+
md-filled-tonal-button[variant='error'] {
|
|
204
|
+
--md-filled-tonal-button-container-color: var(--md-sys-color-on-error);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
*/
|
|
208
|
+
`}render(){const t=!!this.icon?.trim(),e=t?b`<md-icon slot="icon" part="icon" ?filled=${this.iconFilled} aria-hidden="true">${this.icon}</md-icon>`:i,o=i,s=this.label.trim()===""?this.icon:void 0;switch(this.variant){case"filled":return b`
|
|
209
|
+
<md-filled-button
|
|
210
|
+
type=${this.type}
|
|
211
|
+
variant=${o}
|
|
212
|
+
?trailing-icon=${this.trailingIcon}
|
|
213
|
+
?disabled=${this.disabled}
|
|
214
|
+
aria-label=${s}
|
|
215
|
+
href=${this.href||i}
|
|
216
|
+
target=${this.target||i}
|
|
217
|
+
rel=${this.rel||i}
|
|
218
|
+
>
|
|
219
|
+
${t&&!this.trailingIcon?e:i}
|
|
220
|
+
${this.label}
|
|
221
|
+
${t&&this.trailingIcon?e:i}
|
|
222
|
+
</md-filled-button>
|
|
223
|
+
`;case"outlined":return b`
|
|
224
|
+
<md-outlined-button
|
|
225
|
+
type=${this.type}
|
|
226
|
+
variant=${o}
|
|
227
|
+
?trailing-icon=${this.trailingIcon}
|
|
228
|
+
?disabled=${this.disabled}
|
|
229
|
+
aria-label=${s}
|
|
230
|
+
href=${this.href||i}
|
|
231
|
+
target=${this.target||i}
|
|
232
|
+
rel=${this.rel||i}
|
|
233
|
+
>
|
|
234
|
+
${t&&!this.trailingIcon?e:i}
|
|
235
|
+
${this.label}
|
|
236
|
+
${t&&this.trailingIcon?e:i}
|
|
237
|
+
</md-outlined-button>
|
|
238
|
+
`;case"filled-tonal":return b`
|
|
239
|
+
<md-filled-tonal-button
|
|
240
|
+
type=${this.type}
|
|
241
|
+
variant=${o}
|
|
242
|
+
?trailing-icon=${this.trailingIcon}
|
|
243
|
+
?disabled=${this.disabled}
|
|
244
|
+
aria-label=${s}
|
|
245
|
+
href=${this.href||i}
|
|
246
|
+
target=${this.target||i}
|
|
247
|
+
rel=${this.rel||i}
|
|
248
|
+
>
|
|
249
|
+
${t&&!this.trailingIcon?e:i}
|
|
250
|
+
${this.label}
|
|
251
|
+
${t&&this.trailingIcon?e:i}
|
|
252
|
+
</md-filled-tonal-button>
|
|
253
|
+
`;case"text":return b`
|
|
254
|
+
<md-text-button
|
|
255
|
+
type=${this.type}
|
|
256
|
+
variant=${o}
|
|
257
|
+
?trailing-icon=${this.trailingIcon}
|
|
258
|
+
?disabled=${this.disabled}
|
|
259
|
+
aria-label=${s}
|
|
260
|
+
href=${this.href||i}
|
|
261
|
+
target=${this.target||i}
|
|
262
|
+
rel=${this.rel||i}
|
|
263
|
+
>
|
|
264
|
+
${t&&!this.trailingIcon?e:i}
|
|
265
|
+
${this.label}
|
|
266
|
+
${t&&this.trailingIcon?e:i}
|
|
267
|
+
</md-text-button>
|
|
268
|
+
`;default:return b``}}});function _(){const c=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??c,e=this.mapSpacingToken(this.spacingBottom)??c,o=this.mapSpacingToken(this.spacingLeft),s=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-button-spacing-block-start",t):this.style.removeProperty("--scb-button-spacing-block-start"),e?this.style.setProperty("--scb-button-spacing-block-end",e):this.style.removeProperty("--scb-button-spacing-block-end"),o?this.style.setProperty("--scb-button-spacing-inline-start",o):this.style.removeProperty("--scb-button-spacing-inline-start"),s?this.style.setProperty("--scb-button-spacing-inline-end",s):this.style.removeProperty("--scb-button-spacing-inline-end")}a([l({type:String,reflect:!0})],n.prototype,"variant",void 0);a([l({type:String,reflect:!0})],n.prototype,"size",void 0);a([l({type:String,reflect:!0})],n.prototype,"type",void 0);a([l({type:String})],n.prototype,"label",void 0);a([l({type:Boolean,attribute:"trailing-icon"})],n.prototype,"trailingIcon",void 0);a([l({type:String})],n.prototype,"icon",void 0);a([l({type:Boolean,attribute:"icon-filled",reflect:!0})],n.prototype,"iconFilled",void 0);a([l({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0);a([l({type:Boolean,attribute:"full-width",reflect:!0})],n.prototype,"fullWidth",void 0);a([l({type:String})],n.prototype,"href",void 0);a([l({type:String})],n.prototype,"target",void 0);a([l({type:String})],n.prototype,"rel",void 0);a([l({type:String,reflect:!0})],n.prototype,"spacing",void 0);a([l({type:String,attribute:"spacing-top",reflect:!0})],n.prototype,"spacingTop",void 0);a([l({type:String,attribute:"spacing-bottom",reflect:!0})],n.prototype,"spacingBottom",void 0);a([l({type:String,attribute:"spacing-left",reflect:!0})],n.prototype,"spacingLeft",void 0);a([l({type:String,attribute:"spacing-right",reflect:!0})],n.prototype,"spacingRight",void 0);n=a([S("scb-button")],n);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{_ as l,b as p,g as b,h as i,y as h}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as a}from"../../vendor/decorate.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,c){try{customElements.get(e)||t(e,s,c)}catch(u){var o=String(u||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw u}}}}catch{}})();var n,r=(n=class extends l{constructor(...t){super(...t),this.title="",this.description="",this.startDate="",this.endDate="",this.href=""}get date(){return this.startDate}set date(t){const e=(t??"")+"";e!==this.startDate&&(this.startDate=e)}static get observedAttributes(){return[...super.observedAttributes??[],"date"]}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),t==="date"&&(this.date=s??"")}updated(t){super.updated?.(t),(t.has("title")||t.has("description")||t.has("startDate")||t.has("endDate")||t.has("href"))&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}render(){return h`
|
|
2
|
+
`}},n.styles=p`
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
}
|
|
6
|
+
`,n);a([i({type:String})],r.prototype,"title",void 0);a([i({type:String})],r.prototype,"description",void 0);a([i({type:String,attribute:"start-date"})],r.prototype,"startDate",void 0);a([i({type:String,attribute:"end-date"})],r.prototype,"endDate",void 0);a([i({type:String})],r.prototype,"href",void 0);r=a([b("scb-calendar-event")],r);
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import"../../vendor/vendor-material.js";import{_ as q,b as H,g as W,h as _,y as T}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as v}from"../../vendor/decorate.js";import{n as P,t as Y}from"../../vendor/assertClassBrand.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-list/scb-list.js";import"./scb-calendar-event.js";import"../scb-dialog/scb-dialog.js";(function(){try{var x=typeof globalThis<"u"?globalThis:window;if(!x.__scb_ce_guard_installed__){x.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,a){try{customElements.get(e)||t(e,s,a)}catch(n){var i=String(n||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var F,J,m=(F=new WeakSet,J=class extends q{constructor(...t){super(...t),P(this,F),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this.eventsJson=void 0,this._eventsFromJson=null,this._eventsJsonLast=void 0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=e=>{const s=Array.from(this.shadowRoot?.querySelectorAll(".calendar-day.has-event")??[]),a=this.shadowRoot?.activeElement,i=a&&s.includes(a)?a:document.activeElement,n=s.indexOf(i);if(n===-1)return;let d=n;const l=this.disableWeekend?5:7;switch(e.key){case"ArrowRight":d=n+1<s.length?n+1:n;break;case"ArrowLeft":d=n-1>=0?n-1:n;break;case"ArrowDown":d=n+l<s.length?n+l:n;break;case"ArrowUp":d=n-l>=0?n-l:n;break;default:return}d!==n&&(e.preventDefault(),s[d].focus())},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._popupEvent=null,this._handleDialogClose=()=>{this._popupEvent=null,this.requestUpdate(),this._restoreDayFocus()},this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{this._lastActiveDay?.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}get value(){return this.selectedDate}set value(t){const e=(t??"")+"";e!==this.selectedDate&&(this.selectedDate=e)}static get observedAttributes(){return[...super.observedAttributes??[],"value"]}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),t==="value"&&(this.value=s??"")}connectedCallback(){super.connectedCallback(),Y(F,this,I).call(this);const t=Number(this.displayYear),e=Number(this.displayMonth);!Number.isNaN(t)&&!Number.isNaN(e)&&e>=1&&e<=12&&(this._current=new Date(t,e-1,1)),this._syncDisplayFromCurrent(!1),this.addEventListener("change",this._onEventChanged),this._mutationObserver=new MutationObserver(()=>{this.requestUpdate()}),this._mutationObserver.observe(this,{childList:!0}),this.addEventListener("keydown",this._onCalendarKeyDown)}disconnectedCallback(){this.removeEventListener("change",this._onEventChanged),super.disconnectedCallback(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null),this.removeEventListener("keydown",this._onCalendarKeyDown)}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}updated(t){if(super.updated?.(t),t.has("eventsJson")&&(this._eventsJsonLast=void 0,this._eventsFromJson=null),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&Y(F,this,I).call(this),!this._syncingDisplay&&(t.has("displayYear")||t.has("displayMonth"))){const e=Number(this.displayYear),s=Number(this.displayMonth);if(!Number.isNaN(e)&&!Number.isNaN(s)&&s>=1&&s<=12){const a=this._current.getFullYear(),i=this._current.getMonth()+1;(a!==e||i!==s)&&(this._current=new Date(e,s-1,1),this._dispatchMonthChange(e,s),this.requestUpdate())}}}_ensureEventsFromJson(){const t=(this.eventsJson??"").trim();if(!t){this._eventsFromJson=null,this._eventsJsonLast=t;return}if(!(this._eventsJsonLast===t&&this._eventsFromJson!==null)){this._eventsJsonLast=t;try{const e=JSON.parse(t);Array.isArray(e)?this._eventsFromJson=e:this._eventsFromJson=[]}catch{this._eventsFromJson=[]}}}_getEventInputs(){return Array.isArray(this.events)?this.events:(this._ensureEventsFromJson(),this._eventsFromJson!==null?this._eventsFromJson:null)}_normalizeEventInput(t){const e=t.title??"",s=t.description??"",a=t.href??"",i=t.startDate??t["start-date"]??t.start??t.date??"",n=t.endDate??t["end-date"]??t.end??"";return{title:e+"",description:s?s+"":void 0,href:a?a+"":void 0,start:i?i+"":void 0,end:n?n+"":void 0}}_toLocalEventDate(t,e){const s=(t??"").trim();if(!s)return null;if(!s.includes("T")){const i=s.split("-").map(c=>Number(c));if(i.length!==3||i.some(c=>Number.isNaN(c)))return null;const[n,d,l]=i;return e?new Date(n,d-1,l,23,59,59,999):new Date(n,d-1,l,0,0,0,0)}const a=new Date(s);return Number.isNaN(a.getTime())?null:a}_toDateKey(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}_buildEventMapFromInputs(t){const e=new Map;for(const s of t){const a=this._normalizeEventInput(s),i=a.start||"",n=a.end||"";if(!(!i||!a.title))if(i&&n){const d=this._toLocalEventDate(i,!1),l=this._toLocalEventDate(n,!0);if(!d||!l)continue;if(l<d){const c=i.split("T")[0],y=e.get(c)||[];y.push({title:a.title,description:a.description,href:a.href,start:i,end:n}),e.set(c,y);continue}for(let c=new Date(d);c<=l;c.setDate(c.getDate()+1)){const y=this._toDateKey(c),E=e.get(y)||[];E.push({title:a.title,description:a.description,href:a.href,start:i,end:n}),e.set(y,E)}}else{const d=i.split("T")[0],l=e.get(d)||[];l.push({title:a.title,description:a.description,href:a.href,start:i}),e.set(d,l)}}return e}_buildEventMapFromChildren(){const t=Array.from(this.querySelectorAll("scb-calendar-event")),e=new Map;for(const s of t){const a=s,i=(a.startDate??a.date??"")+""||s.getAttribute("start-date")||s.getAttribute("date")||"",n=(a.endDate??"")+""||s.getAttribute("end-date")||"";if(i&&n){const d=this._toLocalEventDate(i,!1),l=this._toLocalEventDate(n,!0);if(!d||!l)continue;if(l<d){const c=i.split("T")[0],y=e.get(c)||[];y.push({title:s.title??"",description:s.description,href:a.href||s.getAttribute("href")||void 0,start:i,end:n}),e.set(c,y);continue}for(let c=new Date(d);c<=l;c.setDate(c.getDate()+1)){const y=this._toDateKey(c),E=e.get(y)||[];E.push({title:s.title??"",description:s.description,href:a.href||s.getAttribute("href")||void 0,start:i,end:n}),e.set(y,E)}}else if(i&&s.title){const d=i.split("T")[0],l=e.get(d)||[];l.push({title:s.title,description:s.description,href:a.href||s.getAttribute("href")||void 0,start:i}),e.set(d,l)}}return e}_syncDisplayFromCurrent(t=!0){const e=this._current.getFullYear(),s=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=e,this.displayMonth=s}finally{this._syncingDisplay=!1}t&&this._dispatchMonthChange(e,s)}_dispatchMonthChange(t,e){const s={displayYear:t,displayMonth:e};this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:s})),this.dispatchEvent(new CustomEvent("scbcalendarmonthchange",{bubbles:!0,composed:!0,detail:s}))}_dispatchSelect(t){const e={selectedDate:t};this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:e})),this.dispatchEvent(new CustomEvent("scbcalendarselect",{bubbles:!0,composed:!0,detail:e}))}_daysInMonth(t,e){return new Date(t,e+1,0).getDate()}_firstDayOfWeek(t,e){const s=new Date(t,e,1).getDay();return s===0?6:s-1}_prevMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()-1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_nextMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()+1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_showEventPopup(t){this._popupEvent=t,this.selectedDate=t.date,this._dispatchSelect(t.date),this._lastActiveDay=this.shadowRoot?.activeElement||document.activeElement,this.requestUpdate(),this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelector("scb-dialog");e&&(document.activeElement&&(e.__lastTriggerEl=document.activeElement),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.open=!0})}),e.addEventListener("close",this._handleDialogClose,{once:!0}))})}_addDays(t,e){const s=new Date(t.valueOf());return s.setDate(s.getDate()+e),s}_easterDay(t){if(typeof this._easterDateCalculated["Ar"+t]<"u")return new Date(this._easterDateCalculated["Ar"+t]);let e=t;e<100&&(e=e+1900),e<1950&&(e=e+100);const s=e%19,a=e%4,i=e%7,n=(19*s+24)%30,d=(2*a+4*i+6*n+5)%7;let l=22+n+d,c=0;l==57&&(l-=7),l==56&&n==28&&d==6&&s>10&&(l-=7),l>31?(l-=31,c=4):c=3;const y=new Date(e,c-1,l);return this._easterDateCalculated["Ar"+t]=y,new Date(this._easterDateCalculated["Ar"+t])}_swedishHolidayName(t){const e=t.getMonth();if(e===1||e===6||e===7||e===8)return null;const s=t.getMonth()+1,a=t.getDate(),i=t.getFullYear(),n=this._easterDay(i),d=this.lang==="en",l=[["Nyårsdagen","New Year's Day",s===1&&a===1],["Trettondedag jul","Epiphany",s===1&&a===6],["Långfredag","Good Friday",+t==+this._addDays(n,-2)],["Påskdagen","Easter Sunday",+t==+n],["Annandag påsk","Easter Monday",+t==+this._addDays(n,1)],["Kristi himmelsfärdsdag","Ascension Day",+t==+this._addDays(n,39)],["Pingstdagen","Pentecost",+t==+this._addDays(n,50)&&i<2005],["Första maj","May Day",s===5&&a===1],["Nationaldagen","National Day",s===6&&a===6&&i>=2005],["Midsommarafton","Midsummer's Eve",s===6&&a>=19&&a<=25&&t.getDay()===5],["Midsommardagen","Midsummer's Day",s===6&&a>=20&&a<=26&&t.getDay()===6],["Julafton","Christmas Eve",s===12&&a===24],["Juldagen","Christmas Day",s===12&&a===25],["Annandag jul","Boxing Day",s===12&&a===26],["Alla helgons dag","All Saints' Day",s===10&&a>=31&&t.getDay()===6||s===11&&a<=6&&t.getDay()===6]];for(const c of l){const[y,E,A]=c;if(A)return d?E:y}return null}render(){const t=this._current.getFullYear(),e=this._current.getMonth(),s=this._daysInMonth(t,e),a=this._firstDayOfWeek(t,e),i=this._today,n=this.lang==="en",d=n?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let l=n?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(l=l.slice(0,5));const c=this._getEventInputs(),y=c?this._buildEventMapFromInputs(c):this._buildEventMapFromChildren(),E=[];let A=1;for(let r=0;r<6;r++){const h=[],f=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let p=A;for(let D=0;D<f.length;D++){const w=f[D];if(r===0&&w<a){if(!this.disableWeekend||w<5){const k=e===0?11:e-1,N=e===0?t-1:t,b=this._daysInMonth(N,k)-(a-w-1);h.push(T`
|
|
2
|
+
<div class="calendar-day calendar-day--other">
|
|
3
|
+
<span class="calendar-day-number">${b}</span>
|
|
4
|
+
</div>
|
|
5
|
+
`)}}else if(p>s)h.push(T`<div></div>`);else{let k=new Date(t,e,p);if(this.disableWeekend)for(;k.getDay()===0||k.getDay()===6;)p++,k=new Date(t,e,p);if(p>s){h.push(T`<div></div>`);continue}const N=i.getFullYear()===t&&i.getMonth()===e&&i.getDate()===p,b=`${t}-${String(e+1).padStart(2,"0")}-${String(p).padStart(2,"0")}`,K=new Date(t,e,p);let L=!1,M=null;this.publicHolidays&&(M=this._swedishHolidayName(K),L=!!M);let u=y.get(b)||[];u=[...u].sort((o,g)=>{const S=o.start&&b===o.start.split("T")[0]?o.start:o.end&&b===o.end.split("T")[0]?o.end:"",$=g.start&&b===g.start.split("T")[0]?g.start:g.end&&g.end.split("T")[0]?g.end:"",C=S&&S.includes("T"),O=$&&$.includes("T");return C&&O?S.localeCompare($):C?-1:O?1:o.title.localeCompare(g.title)});const j=[...u].map(o=>{let g="",S="";if(o.start&&o.end){const $=o.start.split("T")[0],C=o.end.split("T")[0];b===$&&b===C&&o.start.includes("T")&&o.end.includes("T")?g=o.start.split("T")[1].substring(0,5)+"–"+o.end.split("T")[1].substring(0,5):b===$&&o.start.includes("T")?g=o.start.split("T")[1].substring(0,5):b===C&&o.end.includes("T")&&$!==C?(g=o.end.split("T")[1].substring(0,5),S=n?"cont. ":"fort. "):b===C&&o.end.includes("T")?g=o.end.split("T")[1].substring(0,5):b!==$&&(g="",S=n?"cont. ":"fort. ")}else o.start&&o.start.includes("T")&&(g=o.start.split("T")[1].substring(0,5));return{...o,time:g,prefix:S}});h.push(T`
|
|
6
|
+
<div
|
|
7
|
+
class="calendar-day${N?" today":""}${u.length?" has-event":""}${L?" calendar-day--holiday":""}"
|
|
8
|
+
tabindex=${u.length?"0":void 0}
|
|
9
|
+
@click=${u.length?(()=>this._showEventPopup({date:b,events:u})):null}
|
|
10
|
+
@keydown=${u.length?(o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),this._showEventPopup({date:b,events:u}))}):null}
|
|
11
|
+
title=${M||(u.length===1?u[0].title:u.length>1?u.map(o=>o.title).join(", "):"")}
|
|
12
|
+
role=${u.length?"button":void 0}
|
|
13
|
+
aria-label=${M||(u.length?u.length===1?u[0].title:u.map(o=>o.title).join(", "):void 0)}
|
|
14
|
+
>
|
|
15
|
+
<md-focus-ring inward></md-focus-ring>
|
|
16
|
+
<span class="calendar-day-number">${p} ${M?T`<span class="calendar-day-holiday-name">${M}</span>`:""}</span>
|
|
17
|
+
<div class="calendar-titles-wrapper">
|
|
18
|
+
${j.map(o=>T`<span class="calendar-day-event-title">${o.prefix||""}${o.title}</span>`)}
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
`),p++}}if(A=p,E.push(T`<div class="calendar-grid">${h}</div>`),A>s)break}return T`
|
|
22
|
+
<div class="calendar-header">
|
|
23
|
+
<scb-icon-button @click=${this._prevMonth} icon="chevron_left" aria-label="${n?"Previous month":"Föregående månad"}"></scb-icon-button>
|
|
24
|
+
<span>${d[e]} ${t}</span>
|
|
25
|
+
<scb-icon-button @click=${this._nextMonth} icon="chevron_right" aria-label="${n?"Next month":"Nästa månad"}"></scb-icon-button>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="calendar-grid calendar-grid-days">
|
|
28
|
+
${l.map(r=>T`<div>${r}</div>`)}
|
|
29
|
+
</div>
|
|
30
|
+
<div class="calendar-weeks">
|
|
31
|
+
${E}
|
|
32
|
+
</div>
|
|
33
|
+
${this._popupEvent&&Array.isArray(this._popupEvent.events)?T`
|
|
34
|
+
<scb-dialog variant="floating" open label="${n?"Events":"Händelser"} ${this._popupEvent.date}">
|
|
35
|
+
<scb-list>
|
|
36
|
+
${[...this._popupEvent.events].sort((r,h)=>{const f=r.start&&r.start.includes("T")?r.start:r.end&&r.end.includes("T")?r.end:"",p=h.start&&h.start.includes("T")?h.start:h.end&&h.end.includes("T")?h.end:"",D=f&&f.includes("T"),w=p&&p.includes("T");return D&&w?f.localeCompare(p):D?-1:w?1:r.title.localeCompare(h.title)}).map(r=>{const h=this._popupEvent?.date??"";let f="",p="",D="";if(r.start&&r.end){const w=r.start.split("T")[0],k=r.end.split("T")[0];w===k&&r.start.includes("T")&&r.end.includes("T")?f=r.start.split("T")[1].substring(0,5)+" – "+r.end.split("T")[1].substring(0,5):h===w&&r.start.includes("T")&&(f="Start: "+r.start.split("T")[1].substring(0,5)+(n?" (Extended event) ":" (Flerdagsevenemang) ")),h===k&&r.end.includes("T")&&w!==k&&(D=(n?"End: ":"Slut: ")+r.end.split("T")[1].substring(0,5)),h!==w&&(p=n?"cont. ":"fort. ")}else r.start&&r.start.includes("T")&&(f=r.start.split("T")[1].substring(0,5));return r.href?T`
|
|
37
|
+
<scb-list-item
|
|
38
|
+
type="link"
|
|
39
|
+
item-href="${r.href}"
|
|
40
|
+
label="${p}${r.title}"
|
|
41
|
+
supporting-text="${r.description?r.description:""}"
|
|
42
|
+
overline="${f||""}${D||""}"
|
|
43
|
+
>
|
|
44
|
+
</scb-list-item>`:T`
|
|
45
|
+
<scb-list-item
|
|
46
|
+
label="${p}${r.title}"
|
|
47
|
+
supporting-text="${r.description?r.description:""}"
|
|
48
|
+
overline="${f||""}${D||""}"
|
|
49
|
+
>
|
|
50
|
+
</scb-list-item>`})}
|
|
51
|
+
</scb-list>
|
|
52
|
+
</scb-dialog>
|
|
53
|
+
`:""}
|
|
54
|
+
`}},J.styles=H`
|
|
55
|
+
:host {
|
|
56
|
+
display: block;
|
|
57
|
+
margin-block-start: var(--scb-calendar-spacing-block-start, 0);
|
|
58
|
+
margin-block-end: var(--scb-calendar-spacing-block-end, 0);
|
|
59
|
+
margin-inline-start: var(--scb-calendar-spacing-inline-start, 0);
|
|
60
|
+
margin-inline-end: var(--scb-calendar-spacing-inline-end, 0);
|
|
61
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
62
|
+
padding: var(--spacing-5);
|
|
63
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
64
|
+
background: var(--md-sys-color-surface);
|
|
65
|
+
font-family: var(--brand-font);
|
|
66
|
+
}
|
|
67
|
+
.calendar-header {
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: space-between;
|
|
71
|
+
margin-bottom: var(--spacing-5);
|
|
72
|
+
border-bottom: 1px solid rgb(224, 224, 224);
|
|
73
|
+
padding-bottom: var(--spacing-3);
|
|
74
|
+
}
|
|
75
|
+
.calendar-grid {
|
|
76
|
+
display: grid;
|
|
77
|
+
gap: var(--spacing-2);
|
|
78
|
+
margin-bottom: var(--spacing-2);
|
|
79
|
+
grid-template-columns: repeat(7, 1fr);
|
|
80
|
+
}
|
|
81
|
+
:host([disable-weekend]) .calendar-grid {
|
|
82
|
+
grid-template-columns: repeat(5, 1fr);
|
|
83
|
+
}
|
|
84
|
+
.calendar-grid-days{
|
|
85
|
+
font-weight: 600;
|
|
86
|
+
margin-bottom: var(--spacing-5);
|
|
87
|
+
}
|
|
88
|
+
.calendar-weeks {
|
|
89
|
+
display: grid;
|
|
90
|
+
grid-auto-rows: 1fr;
|
|
91
|
+
}
|
|
92
|
+
.calendar-titles-wrapper{
|
|
93
|
+
display: grid;
|
|
94
|
+
gap: var(--spacing-2);
|
|
95
|
+
}
|
|
96
|
+
.calendar-day {
|
|
97
|
+
border-radius: 6px;
|
|
98
|
+
min-height: 50px;
|
|
99
|
+
display: flex;
|
|
100
|
+
padding: var(--spacing-3);
|
|
101
|
+
box-sizing: border-box;
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
gap: var(--spacing-3);
|
|
104
|
+
border: 1px solid var(--md-sys-color-outline-variant, #e0e0e0);
|
|
105
|
+
flex-direction: column;
|
|
106
|
+
}
|
|
107
|
+
.calendar-day--holiday {
|
|
108
|
+
background: var(--md-sys-color-error-container);
|
|
109
|
+
}
|
|
110
|
+
.calendar-day.has-event:focus {
|
|
111
|
+
outline: none;
|
|
112
|
+
}
|
|
113
|
+
md-focus-ring {
|
|
114
|
+
border-radius: 6px;
|
|
115
|
+
}
|
|
116
|
+
.calendar-day--other {
|
|
117
|
+
color: light-dark(var(--n-40), var(--n-70));
|
|
118
|
+
}
|
|
119
|
+
.calendar-day--other .calendar-day-event-title {
|
|
120
|
+
color: inherit;
|
|
121
|
+
}
|
|
122
|
+
.calendar-day--other .calendar-day-number {
|
|
123
|
+
font-weight: var(--weight-regular);
|
|
124
|
+
}
|
|
125
|
+
.calendar-day-number {
|
|
126
|
+
font-size: var(--md-sys-typescale-label-small-size);
|
|
127
|
+
line-height: var(--md-sys-typescale-label-small-line-height); /* vissa tabeller i Figma visar 21 */
|
|
128
|
+
font-weight: var(--md-sys-typescale-label-small-weight);
|
|
129
|
+
letter-spacing: var(--md-sys-typescale-label-small-tracking);
|
|
130
|
+
display: flex;
|
|
131
|
+
gap: 8px;
|
|
132
|
+
}
|
|
133
|
+
.calendar-day-event-title {
|
|
134
|
+
font-size: 12px;
|
|
135
|
+
color: var(--md-sys-color-primary);
|
|
136
|
+
white-space: nowrap;
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
text-overflow: ellipsis;
|
|
139
|
+
display: block;
|
|
140
|
+
width: 100%;
|
|
141
|
+
}
|
|
142
|
+
.calendar-day-holiday-name{
|
|
143
|
+
color: var(--md-sys-color-on-error-container);
|
|
144
|
+
font-weight: var(--md-sys-typescale-body-medium-weight);
|
|
145
|
+
font-size: 12px;
|
|
146
|
+
white-space: nowrap;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
text-overflow: ellipsis;
|
|
149
|
+
display: block;
|
|
150
|
+
width: 100%;
|
|
151
|
+
}
|
|
152
|
+
.calendar-day.today {
|
|
153
|
+
background: var(--md-sys-color-secondary-container);
|
|
154
|
+
|
|
155
|
+
}
|
|
156
|
+
.calendar-day.has-event {
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
position: relative;
|
|
159
|
+
border: 1px solid var(--md-sys-color-primary);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.event-popup-list{
|
|
163
|
+
display: flex;
|
|
164
|
+
flex-direction: column;
|
|
165
|
+
gap: var(--spacing-4);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
`,J);function I(){const x=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??x,e=this.mapSpacingToken(this.spacingBottom)??x,s=this.mapSpacingToken(this.spacingLeft),a=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-calendar-spacing-block-start",t):this.style.removeProperty("--scb-calendar-spacing-block-start"),e?this.style.setProperty("--scb-calendar-spacing-block-end",e):this.style.removeProperty("--scb-calendar-spacing-block-end"),s?this.style.setProperty("--scb-calendar-spacing-inline-start",s):this.style.removeProperty("--scb-calendar-spacing-inline-start"),a?this.style.setProperty("--scb-calendar-spacing-inline-end",a):this.style.removeProperty("--scb-calendar-spacing-inline-end")}v([_({type:String})],m.prototype,"lang",void 0);v([_({type:Boolean,attribute:"disable-weekend"})],m.prototype,"disableWeekend",void 0);v([_({type:Boolean,attribute:"public-holidays"})],m.prototype,"publicHolidays",void 0);v([_({type:Number,attribute:"display-year",reflect:!0})],m.prototype,"displayYear",void 0);v([_({type:Number,attribute:"display-month",reflect:!0})],m.prototype,"displayMonth",void 0);v([_({type:String,attribute:"selected-date",reflect:!0})],m.prototype,"selectedDate",void 0);v([_({attribute:!1})],m.prototype,"events",void 0);v([_({type:String,attribute:"events-json"})],m.prototype,"eventsJson",void 0);v([_({type:String,reflect:!0})],m.prototype,"spacing",void 0);v([_({type:String,attribute:"spacing-top",reflect:!0})],m.prototype,"spacingTop",void 0);v([_({type:String,attribute:"spacing-bottom",reflect:!0})],m.prototype,"spacingBottom",void 0);v([_({type:String,attribute:"spacing-left",reflect:!0})],m.prototype,"spacingLeft",void 0);v([_({type:String,attribute:"spacing-right",reflect:!0})],m.prototype,"spacingRight",void 0);m=v([W("scb-calendar")],m);
|