scb-wc 0.1.2 → 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 -1663
- package/blazor/scb-blazor-bridge.js +6827 -2517
- 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 -2517
- 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,104 @@
|
|
|
1
|
+
import"../../vendor/vendor-material.js";import{_ as h,b as g,g as m,h as o,y as f}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as r}from"../../vendor/decorate.js";import"./scb-nav-item.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,i,s){try{customElements.get(e)||t(e,i,s)}catch(c){var a=String(c||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var b,n=(b=class extends h{constructor(...t){super(...t),this.label="",this.activeHref="",this.activateOnClick=!0,this.sticky=!1,this.stickyTop="0px",this.stickyZIndex=5,this.stickyBackground="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__autoAriaLabel=!1,this.__itemIdPrefix=`scb-nav-${Math.random().toString(36).slice(2)}`,this.__itemIdCounter=0,this.__onSlotChange=async()=>{await this.__decorateItems(),this.__applyActiveHref()},this.__onClick=e=>{const i=e.composedPath().find(a=>a instanceof HTMLElement&&(a.tagName==="A"||a.tagName==="BUTTON"||a.tagName==="SCB-NAV-ITEM"));if(!i)return;const s=this.__getItemHref(i);this.dispatchEvent(new CustomEvent("scb-nav-select",{bubbles:!0,composed:!0,detail:{item:i,href:s}})),this.dispatchEvent(new CustomEvent("scbnavselect",{bubbles:!0,composed:!0,detail:{item:i,href:s}})),this.activateOnClick&&s&&(this.activeHref=s)}}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}__applySpacing(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,i=this.mapSpacingToken(this.spacingBottom)??t,s=this.mapSpacingToken(this.spacingLeft),a=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-nav-spacing-block-start",e):this.style.removeProperty("--scb-nav-spacing-block-start"),i?this.style.setProperty("--scb-nav-spacing-block-end",i):this.style.removeProperty("--scb-nav-spacing-block-end"),s?this.style.setProperty("--scb-nav-spacing-inline-start",s):this.style.removeProperty("--scb-nav-spacing-inline-start"),a?this.style.setProperty("--scb-nav-spacing-inline-end",a):this.style.removeProperty("--scb-nav-spacing-inline-end")}__syncStickyStyles(){if(!this.sticky){this.style.removeProperty("--_scb-nav-sticky-top"),this.style.removeProperty("--_scb-nav-sticky-z-index"),this.style.removeProperty("--_scb-nav-sticky-background");return}const t=(this.stickyTop||"").trim()||"0px";this.style.setProperty("--_scb-nav-sticky-top",t);const e=Number.isFinite(this.stickyZIndex)?this.stickyZIndex:5;this.style.setProperty("--_scb-nav-sticky-z-index",String(e));const i=(this.stickyBackground||"").trim();if(!i){this.style.removeProperty("--_scb-nav-sticky-background");return}const s=i.startsWith("--")?`var(${i})`:i;this.style.setProperty("--_scb-nav-sticky-background",s)}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","navigation"),this.__syncStickyStyles(),this.__syncAriaLabel()}async firstUpdated(){await this.__decorateItems(),this.__applyActiveHref(),this.__applySpacing()}updated(t){t.has("label")&&this.__syncAriaLabel(),(t.has("sticky")||t.has("stickyTop")||t.has("stickyZIndex")||t.has("stickyBackground"))&&this.__syncStickyStyles(),t.has("activeHref")&&this.__applyActiveHref(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.__applySpacing()}__syncAriaLabel(){if(this.hasAttribute("aria-label")){this.__autoAriaLabel=!1;return}const t=(this.label||"").trim();if(!t){this.__autoAriaLabel&&(this.removeAttribute("aria-label"),this.__autoAriaLabel=!1);return}this.setAttribute("aria-label",t),this.__autoAriaLabel=!0}async __decorateItems(){const t=this.__getSlottedItems();if(t.some(e=>e.tagName==="A"||e.tagName==="BUTTON"||e.tagName==="SCB-NAV-ITEM"))for(const e of t){const i=e instanceof HTMLAnchorElement,s=e instanceof HTMLButtonElement,a=e.tagName==="SCB-NAV-ITEM";if(!i&&!s&&!a||(s&&!e.hasAttribute("type")&&e.setAttribute("type","button"),e.getAttribute("data-scb-nav-decorated")==="true"))continue;e.id||(this.__itemIdCounter+=1,e.id=`${this.__itemIdPrefix}-${this.__itemIdCounter}`);const c=u=>{const v=e.querySelector(u);if(v instanceof HTMLElement)return v;const y=document.createElement(u);return e.appendChild(y),y},p=c("md-ripple");p&&p.style.setProperty("--md-ripple-focus-opacity","0");const l=c("md-focus-ring");l&&(l.setAttribute("inward",""),l.setAttribute("for",e.id),l.style.position="absolute",l.style.inset="0",l.style.pointerEvents="none",l.style.borderRadius="24px"),e.setAttribute("data-scb-nav-decorated","true")}}__getSlottedItems(){const t=this.renderRoot.querySelector("slot");return t?t.assignedElements({flatten:!0}).filter(e=>e instanceof HTMLElement):[]}__getItemHref(t){return t instanceof HTMLAnchorElement?(t.getAttribute("href")||"").trim():t.tagName==="SCB-NAV-ITEM"?(t.getAttribute("href")||t.getAttribute("data-href")||t.href||t.dataHref||"").trim():(t.getAttribute("data-href")||"").trim()}__applyActiveHref(){const t=(this.activeHref||"").trim(),e=this.__getSlottedItems();for(const i of e){const s=i instanceof HTMLAnchorElement,a=i instanceof HTMLButtonElement,c=i.tagName==="SCB-NAV-ITEM";if(!s&&!a&&!c)continue;a&&!i.hasAttribute("type")&&i.setAttribute("type","button");const p=this.__getItemHref(i);t&&p===t?(i.setAttribute("aria-current","location"),i.setAttribute("data-scb-nav-managed","true"),i.setAttribute("data-active","true")):(i.getAttribute("data-scb-nav-managed")==="true"&&(i.removeAttribute("aria-current"),i.removeAttribute("data-scb-nav-managed")),i.removeAttribute("data-active"))}}render(){return f`
|
|
2
|
+
<div class="scb-nav">
|
|
3
|
+
<div class="scb-nav__items" @click=${this.__onClick}>
|
|
4
|
+
<slot @slotchange=${this.__onSlotChange}></slot>
|
|
5
|
+
</div>
|
|
6
|
+
</div>
|
|
7
|
+
`}},b.styles=g`
|
|
8
|
+
:host {
|
|
9
|
+
display: block;
|
|
10
|
+
color: var(--md-sys-color-on-surface);
|
|
11
|
+
font-family: var(--brand-font, Inter);
|
|
12
|
+
margin-block-start: var(--scb-nav-spacing-block-start, 0);
|
|
13
|
+
margin-block-end: var(--scb-nav-spacing-block-end, 0);
|
|
14
|
+
margin-inline-start: var(--scb-nav-spacing-inline-start, 0);
|
|
15
|
+
margin-inline-end: var(--scb-nav-spacing-inline-end, 0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host([sticky]) {
|
|
19
|
+
position: sticky;
|
|
20
|
+
inset-block-start: var(
|
|
21
|
+
--_scb-nav-sticky-top,
|
|
22
|
+
var(--scb-nav-sticky-top, 0px)
|
|
23
|
+
);
|
|
24
|
+
z-index: var(
|
|
25
|
+
--_scb-nav-sticky-z-index,
|
|
26
|
+
var(--scb-nav-sticky-z-index, 5)
|
|
27
|
+
);
|
|
28
|
+
background: var(
|
|
29
|
+
--_scb-nav-sticky-background,
|
|
30
|
+
var(--scb-nav-sticky-background, var(--md-sys-color-surface-container-lowest))
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.scb-nav {
|
|
35
|
+
max-inline-size: var(--scb-nav-max-width, 1400px);
|
|
36
|
+
margin-inline: auto;
|
|
37
|
+
padding-block: var(--scb-nav-padding-block, var(--spacing-5, 16px));
|
|
38
|
+
padding-inline: var(--scb-nav-padding-inline, var(--spacing-0, 0px));
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.scb-nav__items {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: var(--scb-nav-gap, var(--spacing-3, 8px));
|
|
46
|
+
|
|
47
|
+
overflow-x: auto;
|
|
48
|
+
overflow-y: visible;
|
|
49
|
+
-webkit-overflow-scrolling: touch;
|
|
50
|
+
scrollbar-width: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.scb-nav__items::-webkit-scrollbar {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
::slotted(a),
|
|
58
|
+
::slotted(button),
|
|
59
|
+
::slotted(scb-nav-item) {
|
|
60
|
+
display: inline-flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
|
|
64
|
+
padding-block: var(--scb-nav-item-padding-block, var(--spacing-3, 8px));
|
|
65
|
+
padding-inline: var(--scb-nav-item-padding-inline, var(--spacing-5, 16px));
|
|
66
|
+
|
|
67
|
+
border-radius: var(--scb-nav-item-radius, var(--radius-full, 1000px));
|
|
68
|
+
|
|
69
|
+
background: transparent;
|
|
70
|
+
color: var(--md-sys-color-on-surface);
|
|
71
|
+
text-decoration: none;
|
|
72
|
+
border: 0;
|
|
73
|
+
|
|
74
|
+
font-family: inherit;
|
|
75
|
+
font-size: var(--md-sys-typescale-label-large-size);
|
|
76
|
+
line-height: var(--md-sys-typescale-label-large-line-height);
|
|
77
|
+
font-weight: var(--md-sys-typescale-label-large-weight);
|
|
78
|
+
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
white-space: nowrap;
|
|
81
|
+
user-select: none;
|
|
82
|
+
-webkit-tap-highlight-color: transparent;
|
|
83
|
+
box-sizing: border-box;
|
|
84
|
+
outline: none;
|
|
85
|
+
|
|
86
|
+
position: relative;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
::slotted(a:focus),
|
|
91
|
+
::slotted(button:focus),
|
|
92
|
+
::slotted(scb-nav-item:focus) {
|
|
93
|
+
outline: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
::slotted(a[aria-current]),
|
|
97
|
+
::slotted(button[aria-current]),
|
|
98
|
+
::slotted(scb-nav-item[aria-current]),
|
|
99
|
+
::slotted([data-active='true']) {
|
|
100
|
+
background: var(--md-sys-color-secondary-container);
|
|
101
|
+
color: var(--md-sys-color-on-secondary-container);
|
|
102
|
+
font-weight: 600;
|
|
103
|
+
}
|
|
104
|
+
`,b);r([o({type:String})],n.prototype,"label",void 0);r([o({type:String,attribute:"active-href"})],n.prototype,"activeHref",void 0);r([o({type:Boolean,attribute:"activate-on-click"})],n.prototype,"activateOnClick",void 0);r([o({type:Boolean,reflect:!0})],n.prototype,"sticky",void 0);r([o({type:String,attribute:"sticky-top"})],n.prototype,"stickyTop",void 0);r([o({type:Number,attribute:"sticky-z-index"})],n.prototype,"stickyZIndex",void 0);r([o({type:String,attribute:"sticky-background"})],n.prototype,"stickyBackground",void 0);r([o({type:String,reflect:!0})],n.prototype,"spacing",void 0);r([o({type:String,attribute:"spacing-top",reflect:!0})],n.prototype,"spacingTop",void 0);r([o({type:String,attribute:"spacing-bottom",reflect:!0})],n.prototype,"spacingBottom",void 0);r([o({type:String,attribute:"spacing-left",reflect:!0})],n.prototype,"spacingLeft",void 0);r([o({type:String,attribute:"spacing-right",reflect:!0})],n.prototype,"spacingRight",void 0);n=r([m("scb-nav")],n);
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import"../../vendor/vendor-material.js";import{_ as m,b as v,g as b,h as e,y as a}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t}from"../../vendor/decorate.js";import{n as y,t as p}from"../../vendor/assertClassBrand.js";import"../scb-icon-button/scb-icon-button.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__scb_ce_guard_installed__=!0;var o=customElements.define.bind(customElements);customElements.define=function(n,s,r){try{customElements.get(n)||o(n,s,r)}catch(g){var l=String(g||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw g}}}}catch{}})();var c,f,i=(c=new WeakSet,f=class extends m{constructor(...o){super(...o),y(this,c),this.variant="success",this.direction="horizontal",this.size="large",this.title="",this.notificationCardTitle="",this.subtitle="",this.supportingText="",this.open=!1,this.linkText="",this.linkHref="#",this.href="",this.showIcon=!1,this.showCloseButton=!1,this.sizing="stretch",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.fullHeight=!1,this.fullWidth=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._closeNotification=()=>{this.open=!1;const n=new CustomEvent("close",{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(n);const s=new CustomEvent("Close",{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(s)}}_iconForVariant(){switch(this.variant){case"success":return"check_circle";case"error":return"error";case"warning":return"warning";default:return"info"}}__resolveSpacingToken(o){const n=(o??"").trim();return n?/^\d+$/.test(n)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(n,10)))})`:n:""}__applySpacing(){const o=this.__resolveSpacingToken(this.spacingTop||this.spacing),n=this.__resolveSpacingToken(this.spacingBottom||this.spacing),s=this.__resolveSpacingToken(this.spacingLeft||this.spacing),r=this.__resolveSpacingToken(this.spacingRight||this.spacing);o?this.style.marginBlockStart=o:this.style.removeProperty("margin-block-start"),n?this.style.marginBlockEnd=n:this.style.removeProperty("margin-block-end"),s?this.style.marginInlineStart=s:this.style.removeProperty("margin-inline-start"),r?this.style.marginInlineEnd=r:this.style.removeProperty("margin-inline-end")}updated(o){super.updated(o),o.has("width")&&(this.width&&this.width.trim()!==""?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),o.has("maxWidth")&&(this.maxWidth&&this.maxWidth.trim()!==""?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),o.has("height")&&(this.height&&this.height.trim()!==""?this.style.blockSize=this.height:this.style.removeProperty("block-size")),o.has("maxHeight")&&(this.maxHeight&&this.maxHeight.trim()!==""?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),(o.has("spacing")||o.has("spacingTop")||o.has("spacingBottom")||o.has("spacingLeft")||o.has("spacingRight"))&&this.__applySpacing()}render(){const o=this.direction==="vertical"?"vertical":"horizontal",n=!!(h.call(p(c,this))||this.subtitle),s=!!(this.supportingText&&!h.call(p(c,this))&&!this.subtitle&&!this.linkText),r=this.variant==="success"?"--_icon-color: var(--md-sys-color-on-success-container, #007041);":this.variant==="error"?"--_icon-color: var(--md-sys-color-on-error-container, #942500);":this.variant==="warning"?"--_icon-color: var(--md-sys-color-on-warning-container, #6B5600);":"--_icon-color: var(--md-sys-color-on-info-container, #1E00BE);",l=this.linkHref&&this.linkHref!=="#"?this.linkHref:this.href||this.linkHref;return a`
|
|
2
|
+
<div class="notification" type=${this.variant} role="alert" aria-live="assertive" aria-atomic="true">
|
|
3
|
+
<div class="notification-main ${o}">
|
|
4
|
+
${this.showIcon?a`
|
|
5
|
+
<div class="notification-leading-icon">
|
|
6
|
+
<md-icon aria-hidden="true">${this._iconForVariant()}</md-icon>
|
|
7
|
+
</div>
|
|
8
|
+
`:null}
|
|
9
|
+
<div class="notification-text-container ${s?"no-gap":""}">
|
|
10
|
+
${n?a`
|
|
11
|
+
<div class="notification-title-container">
|
|
12
|
+
${h.call(p(c,this))?a`<div class="notification-title">${h.call(p(c,this))}</div>`:null}
|
|
13
|
+
${this.subtitle?a`<div class="notification-subtitle">${this.subtitle}</div>`:null}
|
|
14
|
+
</div>
|
|
15
|
+
`:null}
|
|
16
|
+
${this.supportingText?a`<div class="notification-text">${this.supportingText}</div>`:null}
|
|
17
|
+
${this.linkText?a`
|
|
18
|
+
<div class="notification-footer">
|
|
19
|
+
<a class="footer-link" href="${l}">${this.linkText}</a>
|
|
20
|
+
</div>
|
|
21
|
+
`:null}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
${this.showCloseButton?a`
|
|
25
|
+
<div class="notification-close-button">
|
|
26
|
+
<scb-icon-button
|
|
27
|
+
aria-label="Stäng meddelande"
|
|
28
|
+
icon="close"
|
|
29
|
+
style=${r}
|
|
30
|
+
@click=${this._closeNotification}
|
|
31
|
+
>
|
|
32
|
+
</scb-icon-button>
|
|
33
|
+
</div>
|
|
34
|
+
`:null}
|
|
35
|
+
</div>
|
|
36
|
+
<md-focus-ring></md-focus-ring>
|
|
37
|
+
`}},f.styles=[v`
|
|
38
|
+
:host {
|
|
39
|
+
display: block;
|
|
40
|
+
position: relative;
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
inline-size: 100%;
|
|
43
|
+
min-inline-size: 0;
|
|
44
|
+
/* Om det behövs kan maxbredd styras via css-variabel, samma idé som övriga kort */
|
|
45
|
+
max-inline-size: var(--scb-notification-card-max-w, none);
|
|
46
|
+
height: auto;
|
|
47
|
+
padding: var(--scb-notification-card-focus-ring-gap, 4px);
|
|
48
|
+
|
|
49
|
+
--scb-notification-card-padding: var(--spacing-5, 16px);
|
|
50
|
+
--scb-notification-card-column-gap: var(--spacing-4, 12px);
|
|
51
|
+
--scb-notification-card-row-gap: var(--spacing-3, 8px);
|
|
52
|
+
|
|
53
|
+
--scb-notification-main-horizontal-gap: var(--spacing-4, 12px);
|
|
54
|
+
--scb-notification-main-vertical-gap: var(--spacing-4, 12px);
|
|
55
|
+
--scb-notification-text-container-gap: var(--spacing-4, 12px);
|
|
56
|
+
|
|
57
|
+
--scb-notification-icon-size: var(--icon-size-small, 24px);
|
|
58
|
+
|
|
59
|
+
--scb-notification-title-size: var(--md-sys-typescale-headline-small-size, 24px);
|
|
60
|
+
--scb-notification-title-line-height: var(--md-sys-typescale-headline-small-line-height, 30px);
|
|
61
|
+
--scb-notification-title-letter-spacing: var(--md-sys-typescale-headline-small-tracking, -0.6px);
|
|
62
|
+
|
|
63
|
+
--scb-notification-subtitle-size: var(--md-sys-typescale-title-medium-size, 18px);
|
|
64
|
+
--scb-notification-subtitle-line-height: var(--md-sys-typescale-title-medium-line-height, 26px);
|
|
65
|
+
--scb-notification-subtitle-letter-spacing: var(--md-sys-typescale-title-medium-tracking, -0.3px);
|
|
66
|
+
|
|
67
|
+
--scb-notification-text-size: var(--md-sys-typescale-body-medium-size, 16px);
|
|
68
|
+
--scb-notification-text-line-height: var(--md-sys-typescale-body-medium-line-height, 24px);
|
|
69
|
+
--scb-notification-text-letter-spacing: var(--md-sys-typescale-body-medium-tracking, -0.15px);
|
|
70
|
+
|
|
71
|
+
--scb-notification-footer-size: 18px;
|
|
72
|
+
--scb-notification-footer-line-height: 26px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:host([size='medium']) {
|
|
76
|
+
--scb-notification-card-padding: var(--spacing-4, 12px);
|
|
77
|
+
--scb-notification-card-column-gap: var(--spacing-3, 8px);
|
|
78
|
+
--scb-notification-card-row-gap: var(--spacing-2, 4px);
|
|
79
|
+
|
|
80
|
+
--scb-notification-main-horizontal-gap: var(--spacing-3, 8px);
|
|
81
|
+
--scb-notification-main-vertical-gap: var(--spacing-3, 8px);
|
|
82
|
+
--scb-notification-text-container-gap: var(--spacing-3, 8px);
|
|
83
|
+
|
|
84
|
+
--scb-notification-icon-size: var(--icon-size-medium, 20px);
|
|
85
|
+
|
|
86
|
+
--scb-notification-title-size: var(--md-sys-typescale-title-large-size, 20px);
|
|
87
|
+
--scb-notification-title-line-height: var(--md-sys-typescale-title-large-line-height, 28px);
|
|
88
|
+
--scb-notification-title-letter-spacing: var(--md-sys-typescale-title-large-tracking, -0.3px);
|
|
89
|
+
|
|
90
|
+
--scb-notification-subtitle-size: var(--md-sys-typescale-title-small-size, 16px);
|
|
91
|
+
--scb-notification-subtitle-line-height: var(--md-sys-typescale-title-small-line-height, 24px);
|
|
92
|
+
--scb-notification-subtitle-letter-spacing: var(--md-sys-typescale-title-small-tracking, -0.2px);
|
|
93
|
+
|
|
94
|
+
--scb-notification-text-size: var(--md-sys-typescale-body-small-size, 14px);
|
|
95
|
+
--scb-notification-text-line-height: var(--md-sys-typescale-body-small-line-height, 20px);
|
|
96
|
+
--scb-notification-text-letter-spacing: var(--md-sys-typescale-body-small-tracking, -0.1px);
|
|
97
|
+
|
|
98
|
+
--scb-notification-footer-size: 16px;
|
|
99
|
+
--scb-notification-footer-line-height: 24px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:host([size='small']) {
|
|
103
|
+
--scb-notification-card-padding: var(--spacing-3, 8px);
|
|
104
|
+
--scb-notification-card-column-gap: var(--spacing-2, 4px);
|
|
105
|
+
--scb-notification-card-row-gap: var(--spacing-1, 2px);
|
|
106
|
+
|
|
107
|
+
--scb-notification-main-horizontal-gap: var(--spacing-2, 4px);
|
|
108
|
+
--scb-notification-main-vertical-gap: var(--spacing-2, 4px);
|
|
109
|
+
--scb-notification-text-container-gap: var(--spacing-2, 4px);
|
|
110
|
+
|
|
111
|
+
--scb-notification-icon-size: var(--icon-size-medium, 20px);
|
|
112
|
+
|
|
113
|
+
--scb-notification-title-size: var(--md-sys-typescale-title-medium-size, 18px);
|
|
114
|
+
--scb-notification-title-line-height: var(--md-sys-typescale-title-medium-line-height, 26px);
|
|
115
|
+
--scb-notification-title-letter-spacing: var(--md-sys-typescale-title-medium-tracking, -0.3px);
|
|
116
|
+
|
|
117
|
+
--scb-notification-subtitle-size: var(--md-sys-typescale-body-medium-size, 16px);
|
|
118
|
+
--scb-notification-subtitle-line-height: var(--md-sys-typescale-body-medium-line-height, 24px);
|
|
119
|
+
--scb-notification-subtitle-letter-spacing: var(--md-sys-typescale-body-medium-tracking, -0.15px);
|
|
120
|
+
|
|
121
|
+
--scb-notification-text-size: var(--md-sys-typescale-body-small-size, 14px);
|
|
122
|
+
--scb-notification-text-line-height: var(--md-sys-typescale-body-small-line-height, 20px);
|
|
123
|
+
--scb-notification-text-letter-spacing: var(--md-sys-typescale-body-small-tracking, -0.1px);
|
|
124
|
+
|
|
125
|
+
--scb-notification-footer-size: 14px;
|
|
126
|
+
--scb-notification-footer-line-height: 20px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* Stretch: fyller både bredd och höjd, som standard */
|
|
130
|
+
:host([sizing='stretch']) {
|
|
131
|
+
inline-size: 100%;
|
|
132
|
+
block-size: 100%;
|
|
133
|
+
max-inline-size: none;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Legacy full-width / full-height */
|
|
137
|
+
:host([full-width]) {
|
|
138
|
+
inline-size: 100%;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
:host([full-height]) {
|
|
142
|
+
block-size: 100%;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* content-width: samma upplägg som card / fact-card */
|
|
146
|
+
:host([sizing='content-width']) {
|
|
147
|
+
display: inline-block;
|
|
148
|
+
inline-size: auto;
|
|
149
|
+
block-size: auto;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:host([sizing='content-width']) .notification {
|
|
153
|
+
inline-size: max-content;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* content-height: bredd fyller, höjd styrs av innehåll */
|
|
157
|
+
:host([sizing='content-height']) {
|
|
158
|
+
inline-size: 100%;
|
|
159
|
+
block-size: auto;
|
|
160
|
+
max-inline-size: none;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* När värd-elementet fyller höjd ska själva kortet också göra det */
|
|
164
|
+
:host([height]) .notification,
|
|
165
|
+
:host([max-height]) .notification,
|
|
166
|
+
:host([sizing='stretch']) .notification,
|
|
167
|
+
:host([full-height]) .notification {
|
|
168
|
+
block-size: 100%;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* Öppen / stängd */
|
|
172
|
+
:host([open]) .notification {
|
|
173
|
+
display: flex;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
:host(:not([open])) .notification {
|
|
177
|
+
display: none;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.notification {
|
|
181
|
+
box-sizing: border-box;
|
|
182
|
+
border-radius: var(--md-sys-shape-corner-large, 16px);
|
|
183
|
+
padding: var(--scb-notification-card-padding);
|
|
184
|
+
display: flex;
|
|
185
|
+
flex-direction: row;
|
|
186
|
+
align-items: flex-start;
|
|
187
|
+
justify-content: space-between;
|
|
188
|
+
column-gap: var(--scb-notification-card-column-gap);
|
|
189
|
+
row-gap: var(--scb-notification-card-row-gap);
|
|
190
|
+
inline-size: 100%;
|
|
191
|
+
max-inline-size: 100%;
|
|
192
|
+
color: inherit;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* Variantfärger */
|
|
196
|
+
:host([variant='success']) .notification {
|
|
197
|
+
background: var(--md-sys-color-success-container, #E7FEE9);
|
|
198
|
+
color: var(--md-sys-color-on-success-container, #007041);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
:host([variant='error']) .notification {
|
|
202
|
+
background: var(--md-sys-color-error-container, #FFD7C7);
|
|
203
|
+
color: var(--md-sys-color-on-error-container, #942500);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
:host([variant='warning']) .notification {
|
|
207
|
+
background: var(--md-sys-color-warning-container, #FEEEA0);
|
|
208
|
+
color: var(--md-sys-color-on-warning-container, #6B5600);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
:host([variant='info']) .notification {
|
|
212
|
+
background: var(--md-sys-color-info-container, #D6F1FF);
|
|
213
|
+
color: var(--md-sys-color-on-info-container, #1E00BE);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.notification a {
|
|
217
|
+
text-decoration: underline;
|
|
218
|
+
text-decoration-thickness: 1px;
|
|
219
|
+
text-underline-offset: 0.1578em;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.notification a:hover {
|
|
223
|
+
text-decoration-thickness: 2px;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.notification-main {
|
|
227
|
+
display: flex;
|
|
228
|
+
flex: 1 1 auto;
|
|
229
|
+
min-width: 0;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.notification-main.horizontal {
|
|
233
|
+
flex-direction: row;
|
|
234
|
+
column-gap: var(--scb-notification-main-horizontal-gap);
|
|
235
|
+
row-gap: 0;
|
|
236
|
+
align-items: flex-start;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.notification-main.vertical {
|
|
240
|
+
flex-direction: column;
|
|
241
|
+
column-gap: 0;
|
|
242
|
+
row-gap: var(--scb-notification-main-vertical-gap);
|
|
243
|
+
align-items: flex-start;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.notification-leading-icon {
|
|
247
|
+
display: flex;
|
|
248
|
+
align-items: flex-start;
|
|
249
|
+
justify-content: center;
|
|
250
|
+
flex: 0 0 auto;
|
|
251
|
+
margin-top: 2px;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.notification-leading-icon md-icon {
|
|
255
|
+
font-size: var(--scb-notification-icon-size);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.notification-text-container {
|
|
259
|
+
display: flex;
|
|
260
|
+
flex-direction: column;
|
|
261
|
+
gap: var(--scb-notification-text-container-gap);
|
|
262
|
+
font-family: var(--brand-font, "Inter", sans-serif);
|
|
263
|
+
font-style: normal;
|
|
264
|
+
min-width: 0;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.notification-text-container.no-gap {
|
|
268
|
+
gap: 0;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.notification-title-container{
|
|
272
|
+
display: flex;
|
|
273
|
+
flex-direction: column;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.notification-title {
|
|
277
|
+
font-size: var(--scb-notification-title-size);
|
|
278
|
+
font-weight: var(--weight-bold, 700);
|
|
279
|
+
line-height: var(--scb-notification-title-line-height);
|
|
280
|
+
letter-spacing: var(--scb-notification-title-letter-spacing);
|
|
281
|
+
white-space: normal;
|
|
282
|
+
word-break: normal;
|
|
283
|
+
overflow-wrap: normal;
|
|
284
|
+
hyphens: auto;
|
|
285
|
+
overflow: visible;
|
|
286
|
+
text-overflow: clip;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.notification-subtitle {
|
|
290
|
+
font-size: var(--scb-notification-subtitle-size);
|
|
291
|
+
font-weight: var(--weight-semibold, 600);
|
|
292
|
+
line-height: var(--scb-notification-subtitle-line-height);
|
|
293
|
+
letter-spacing: var(--scb-notification-subtitle-letter-spacing);
|
|
294
|
+
white-space: normal;
|
|
295
|
+
word-break: normal;
|
|
296
|
+
overflow-wrap: normal;
|
|
297
|
+
hyphens: auto;
|
|
298
|
+
overflow: visible;
|
|
299
|
+
text-overflow: clip;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.notification-text {
|
|
303
|
+
font-size: var(--scb-notification-text-size);
|
|
304
|
+
font-weight: var(--weight-regular, 400);
|
|
305
|
+
line-height: var(--scb-notification-text-line-height);
|
|
306
|
+
letter-spacing: var(--scb-notification-text-letter-spacing);
|
|
307
|
+
|
|
308
|
+
white-space: normal;
|
|
309
|
+
word-break: normal;
|
|
310
|
+
overflow-wrap: normal;
|
|
311
|
+
hyphens: auto;
|
|
312
|
+
overflow: visible;
|
|
313
|
+
text-overflow: clip;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.notification-footer {
|
|
317
|
+
font-size: var(--scb-notification-footer-size);
|
|
318
|
+
margin-top: 4px;
|
|
319
|
+
line-height: var(--scb-notification-footer-line-height);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.footer-link {
|
|
323
|
+
display: inline-block;
|
|
324
|
+
vertical-align: middle;
|
|
325
|
+
transition: box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.footer-link:focus-visible {
|
|
329
|
+
outline: none;
|
|
330
|
+
border-radius: 4px;
|
|
331
|
+
animation: growShrinkRing 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
|
332
|
+
box-shadow: 0 0 0 2px var(--md-sys-color-primary, #1976d2);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.notification-close-button {
|
|
336
|
+
flex: 0 0 auto;
|
|
337
|
+
display: flex;
|
|
338
|
+
align-items: flex-start;
|
|
339
|
+
justify-content: flex-end;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/* Justering så att krysset linjerar bättre med ikon / titel */
|
|
343
|
+
.notification-close-button scb-icon-button {
|
|
344
|
+
margin-top: -5px;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
@keyframes growShrinkRing {
|
|
348
|
+
0% {
|
|
349
|
+
box-shadow: 0 0 0 2px var(--md-sys-color-primary, #1976d2);
|
|
350
|
+
}
|
|
351
|
+
50% {
|
|
352
|
+
box-shadow: 0 0 0 7px var(--md-sys-color-primary, #1976d2);
|
|
353
|
+
}
|
|
354
|
+
100% {
|
|
355
|
+
box-shadow: 0 0 0 2px var(--md-sys-color-primary, #1976d2);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
`],f);function h(){return this.notificationCardTitle||this.title}t([e({type:String})],i.prototype,"variant",void 0);t([e({type:String,reflect:!0})],i.prototype,"direction",void 0);t([e({type:String,reflect:!0})],i.prototype,"size",void 0);t([e({type:String})],i.prototype,"title",void 0);t([e({type:String,attribute:"notification-card-title"})],i.prototype,"notificationCardTitle",void 0);t([e({type:String})],i.prototype,"subtitle",void 0);t([e({type:String,attribute:"supporting-text"})],i.prototype,"supportingText",void 0);t([e({type:Boolean,reflect:!0})],i.prototype,"open",void 0);t([e({type:String,attribute:"link-text"})],i.prototype,"linkText",void 0);t([e({type:String,attribute:"link-href"})],i.prototype,"linkHref",void 0);t([e({type:String})],i.prototype,"href",void 0);t([e({type:Boolean,attribute:"show-icon"})],i.prototype,"showIcon",void 0);t([e({type:Boolean,attribute:"show-close-button"})],i.prototype,"showCloseButton",void 0);t([e({type:String,reflect:!0})],i.prototype,"sizing",void 0);t([e({type:String,reflect:!0})],i.prototype,"width",void 0);t([e({type:String,reflect:!0,attribute:"max-width"})],i.prototype,"maxWidth",void 0);t([e({type:String,reflect:!0})],i.prototype,"height",void 0);t([e({type:String,reflect:!0,attribute:"max-height"})],i.prototype,"maxHeight",void 0);t([e({type:Boolean,reflect:!0,attribute:"full-height"})],i.prototype,"fullHeight",void 0);t([e({type:Boolean,reflect:!0,attribute:"full-width"})],i.prototype,"fullWidth",void 0);t([e({type:String})],i.prototype,"spacing",void 0);t([e({type:String,attribute:"spacing-top"})],i.prototype,"spacingTop",void 0);t([e({type:String,attribute:"spacing-bottom"})],i.prototype,"spacingBottom",void 0);t([e({type:String,attribute:"spacing-left"})],i.prototype,"spacingLeft",void 0);t([e({type:String,attribute:"spacing-right"})],i.prototype,"spacingRight",void 0);i=t([b("scb-notification-card")],i);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import"../../vendor/vendor-material.js";import{_ as h,b as d,g as p,h as l,y as u}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as r}from"../../vendor/decorate.js";import"../scb-divider/scb-divider.js";(function(){try{var a=typeof globalThis<"u"?globalThis:window;if(!a.__scb_ce_guard_installed__){a.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(t,e,s){try{customElements.get(t)||i(t,e,s)}catch(b){var n=String(b||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw b}}}}catch{}})();var c,o=(c=class extends h{constructor(...i){super(...i),this.label="",this.hasSubMenu=!1,this.openLeft=!1,this.divider=!1,this.leadingIcon="",this.trailingIcon="",this.itemHref="",this.href="",this._observedSubMenu=null,this._syncSubMenuFlags=()=>{const t=this.nextElementSibling,e=!!(t&&t.tagName==="SCB-OPTIONS-SUB-MENU"),s=!!(e&&t.hasAttribute("open-left"));e!==this.hasSubMenu&&(this.hasSubMenu=e),s!==this.openLeft&&(this.openLeft=s);const n=e?t:null;n!==this._observedSubMenu&&(this._subMenuAttrObserver?.disconnect(),this._subMenuAttrObserver=void 0,this._observedSubMenu=n,n&&(this._subMenuAttrObserver=new MutationObserver(()=>this._syncSubMenuFlags()),this._subMenuAttrObserver.observe(n,{attributes:!0,attributeFilter:["open-left"]})))},this.handleClick=t=>{this._effectiveHref?this._navigateToHref(t):this._toggleSubMenu()},this._onBlur=t=>{const e=this.closest("scb-options-sub-menu");if(e&&e.open){const s=t.relatedTarget;(!s||!e.contains(s))&&(e.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("hidesubmenu",{bubbles:!0,composed:!0})))}},this._onFocus=()=>{const t=this.nextElementSibling;this.classList.contains("open-submenu")&&(t&&t.tagName==="SCB-OPTIONS-SUB-MENU"&&t.hasAttribute("open")||this.classList.remove("open-submenu"))},this._onKeyDown=t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault(),this.handleClick(t);return}if(t.key==="ArrowDown"){t.preventDefault();let e=this.nextElementSibling;for(;e&&e.tagName!=="SCB-OPTIONS-MENU-ITEM";)e=e.nextElementSibling;e&&e.shadowRoot?.querySelector("li")?.focus();return}if(t.key==="ArrowUp"){t.preventDefault();let e=this.previousElementSibling;for(;e&&e.tagName!=="SCB-OPTIONS-MENU-ITEM";)e=e.previousElementSibling;e&&e.shadowRoot?.querySelector("li")?.focus();return}if(t.key==="ArrowRight"){t.preventDefault();const e=this.nextElementSibling;e&&e.tagName==="SCB-OPTIONS-SUB-MENU"&&(e.hasAttribute("open")||(this._toggleSubMenu(),e.dispatchEvent(new CustomEvent("show-submenu",{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("showsubmenu",{bubbles:!0,composed:!0}))),setTimeout(()=>{const s=e.querySelector("scb-options-menu-item");s&&s.shadowRoot?.querySelector("li")?.focus()},0));return}if(t.key==="ArrowLeft"){t.preventDefault();const e=this.nextElementSibling;if(e&&e.tagName==="SCB-OPTIONS-SUB-MENU"&&e.hasAttribute("open")){this._toggleSubMenu(),e.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("hidesubmenu",{bubbles:!0,composed:!0}));return}const s=this.closest("scb-options-sub-menu");if(s){const n=s.previousElementSibling;n&&n.tagName==="SCB-OPTIONS-MENU-ITEM"&&n.shadowRoot?.querySelector("li")?.focus()}return}}}get _effectiveHref(){return this.itemHref||this.href}connectedCallback(){super.connectedCallback(),this._syncSubMenuFlags(),this._subMenuChildObserver??(this._subMenuChildObserver=new MutationObserver(()=>this._syncSubMenuFlags())),this._subMenuChildObserver.disconnect();const i=this.parentElement;i&&this._subMenuChildObserver.observe(i,{childList:!0})}disconnectedCallback(){this._subMenuChildObserver?.disconnect(),this._subMenuAttrObserver?.disconnect(),this._subMenuChildObserver=void 0,this._subMenuAttrObserver=void 0,this._observedSubMenu=null,super.disconnectedCallback()}render(){return u`
|
|
2
|
+
${this.divider?u`<scb-divider></scb-divider>`:""}
|
|
3
|
+
<li @click=${this.handleClick} @keydown=${this._onKeyDown} @blur=${this._onBlur} @focus=${this._onFocus} role="menuitem" tabindex="0">
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
<md-focus-ring inward></md-focus-ring>
|
|
7
|
+
${this._effectiveHref?u`<a href="${this._effectiveHref}">
|
|
8
|
+
${this.leadingIcon?u`<md-icon>${this.leadingIcon}</md-icon>`:""}
|
|
9
|
+
<div class="label">${this.label}</div>
|
|
10
|
+
${this.trailingIcon?u`<md-icon class="ti">${this.trailingIcon}</md-icon>`:""}
|
|
11
|
+
<md-ripple></md-ripple>
|
|
12
|
+
</a>`:u`
|
|
13
|
+
${this.leadingIcon?u`<md-icon>${this.leadingIcon}</md-icon>`:""}
|
|
14
|
+
<div class="label">${this.label}</div>
|
|
15
|
+
${this.trailingIcon?u`<md-icon class="ti">${this.trailingIcon}</md-icon>`:""}
|
|
16
|
+
<md-ripple></md-ripple>
|
|
17
|
+
`}
|
|
18
|
+
</li>
|
|
19
|
+
`}_navigateToHref(i){const t=this._effectiveHref;if(!t)return;const e={href:t},s=!this.dispatchEvent(new CustomEvent("item-navigate",{detail:e,bubbles:!0,composed:!0,cancelable:!0}))||!this.dispatchEvent(new CustomEvent("itemnavigate",{detail:e,bubbles:!0,composed:!0,cancelable:!0}));i.preventDefault(),i.stopPropagation(),s||(window.location.href=t)}_toggleSubMenu(){const i=this.nextElementSibling;i&&i.tagName==="SCB-OPTIONS-SUB-MENU"&&(this.classList.toggle("open-submenu"),i.hasAttribute("open")?(i.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0})),i.dispatchEvent(new CustomEvent("hidesubmenu",{bubbles:!0,composed:!0}))):(i.dispatchEvent(new CustomEvent("show-submenu",{bubbles:!0,composed:!0})),i.dispatchEvent(new CustomEvent("showsubmenu",{bubbles:!0,composed:!0}))))}},c.styles=d`
|
|
20
|
+
:host {
|
|
21
|
+
display: block;
|
|
22
|
+
}
|
|
23
|
+
:host li{
|
|
24
|
+
position: relative;
|
|
25
|
+
list-style: none;
|
|
26
|
+
padding: var(--scb-options-menu-item-padding-block, var(--spacing-3, 8px)) var(--scb-options-menu-item-padding-inline, var(--spacing-5, 16px));
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
min-height: var(--scb-options-menu-item-min-height, 56px);
|
|
29
|
+
display: flex;
|
|
30
|
+
gap: var(--scb-options-menu-item-gap, var(--spacing-4, 12px));
|
|
31
|
+
align-items: center;
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
:host li .label {
|
|
35
|
+
font-size: var(--scb-options-menu-label-font-size, var(--md-sys-typescale-body-large-size));
|
|
36
|
+
line-height: var(--scb-options-menu-label-line-height, var(--md-sys-typescale-body-large-line-height));
|
|
37
|
+
letter-spacing: var(--scb-options-menu-label-letter-spacing, var(--md-sys-typescale-body-large-tracking));
|
|
38
|
+
}
|
|
39
|
+
:host li md-focus-ring {
|
|
40
|
+
border-radius: var(--md-sys-shape-corner-small);
|
|
41
|
+
position: absolute;
|
|
42
|
+
inset: 0;
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
z-index: 1;
|
|
45
|
+
}
|
|
46
|
+
:host li md-icon {
|
|
47
|
+
--md-icon-size: var(--scb-options-menu-icon-size, 24px);
|
|
48
|
+
}
|
|
49
|
+
:host li md-icon.ti {
|
|
50
|
+
margin-left: auto;
|
|
51
|
+
}
|
|
52
|
+
:host li a {
|
|
53
|
+
display: flex;
|
|
54
|
+
gap: var(--scb-options-menu-item-gap, var(--spacing-4, 12px));
|
|
55
|
+
align-items: center;
|
|
56
|
+
color: var(--md-sys-color-on-surface);
|
|
57
|
+
text-decoration: none;
|
|
58
|
+
width: 100%;
|
|
59
|
+
}
|
|
60
|
+
:host(.open-submenu) li {
|
|
61
|
+
background: var(--md-sys-color-secondary-container);
|
|
62
|
+
}
|
|
63
|
+
:host li:focus {
|
|
64
|
+
outline: none;
|
|
65
|
+
}
|
|
66
|
+
`,c);r([l({type:String})],o.prototype,"label",void 0);r([l({type:Boolean})],o.prototype,"hasSubMenu",void 0);r([l({type:Boolean})],o.prototype,"openLeft",void 0);r([l({type:Boolean})],o.prototype,"divider",void 0);r([l({type:String,attribute:"leading-icon"})],o.prototype,"leadingIcon",void 0);r([l({type:String,attribute:"trailing-icon"})],o.prototype,"trailingIcon",void 0);r([l({type:String,attribute:"item-href"})],o.prototype,"itemHref",void 0);r([l({type:String})],o.prototype,"href",void 0);o=r([p("scb-options-menu-item")],o);
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import{_ as y,b as v,g as x,h as r,y as E}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as n}from"../../vendor/decorate.js";import"./scb-options-menu-item.js";import"./scb-options-sub-menu.js";(function(){try{var g=typeof globalThis<"u"?globalThis:window;if(!g.__scb_ce_guard_installed__){g.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,a){try{customElements.get(t)||e(t,i,a)}catch(l){var o=String(l||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var m,s=(m=class extends y{constructor(...e){super(...e),this.open=!1,this.size="large",this.inSb=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__lastTriggerEl=null,this.__onViewportChange=()=>{this.open&&this.__positionToTrigger()},this.__onDocumentClick=t=>{const i=this.__getActionFromEvent(t);if(i){i==="open"&&(this.__setOpen(!0),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0}))),i==="close"&&(this.__setOpen(!1),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))),i==="toggle"&&(this.__setOpen(!this.open),this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0,composed:!0}))),t.stopPropagation();return}if(!this.inSb&&this.open&&!this.isClickInScbMenu(t)){this.__setOpen(!1);return}},this.__onDocumentKeydown=t=>{if(this.open&&t.key==="Escape"){this.__setOpen(!1);return}}}firstUpdated(){this.__applySpacing()}render(){return E`
|
|
2
|
+
<div
|
|
3
|
+
role="menu"
|
|
4
|
+
class="scb-options-menu-panel${this.open?" open":""}"
|
|
5
|
+
>
|
|
6
|
+
<slot></slot>
|
|
7
|
+
</div>
|
|
8
|
+
`}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),window.addEventListener("resize",this.__onViewportChange,{passive:!0}),window.addEventListener("scroll",this.__onViewportChange,{passive:!0,capture:!0})}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),window.removeEventListener("resize",this.__onViewportChange),window.removeEventListener("scroll",this.__onViewportChange,!0),super.disconnectedCallback()}__setOpen(e){this.open=e}__getActionFromEvent(e){if(!this.id)return null;const t=e.composedPath();for(const i of t)if(i instanceof Element){if(i.getAttribute("data-menu-open")===this.id)return this.__lastTriggerEl=i,"open";if(i.getAttribute("data-menu-close")===this.id)return this.__lastTriggerEl=i,"close";if(i.getAttribute("data-menu-toggle")===this.id)return this.__lastTriggerEl=i,"toggle";if(i.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=i,"toggle"}return null}isClickInScbMenu(e){return e.composedPath().some(t=>t instanceof Element&&(t.tagName==="SCB-OPTIONS-MENU"||t.tagName==="SCB-OPTIONS-SUB-MENU"))}updated(e){e.has("open")&&(this.__applyOpenSideEffects(),this.open?this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this.__applySpacing()}__applyOpenSideEffects(){this.__updateTriggersExpanded(),this.open?this.__positionToTrigger():this.__restoreFocusToTrigger()}__positionToTrigger(){if(!this.open||!this.__lastTriggerEl)return;const e=this.__lastTriggerEl,t=this.shadowRoot?.querySelector(".scb-options-menu-panel");t&&requestAnimationFrame(()=>{if(!this.open)return;const i=e.getBoundingClientRect(),a=t.getBoundingClientRect(),o=window.innerWidth,l=window.innerHeight,p=8,d=4;let c=i.left,u=i.bottom+d;const h=a.width,b=a.height;c+h>o-p&&(c=Math.max(p,o-p-h)),c<p&&(c=p);let _="top";if(u+b>l-p){const f=i.top-d-b;f>=p&&(u=f,_="bottom")}this.style.position="fixed",this.style.left=`${Math.round(c)}px`,this.style.top=`${Math.round(u)}px`,this.style.setProperty("--scb-options-menu-transform-origin",_)})}__restoreFocusToTrigger(){this.__lastTriggerEl&&requestAnimationFrame(()=>{this.__lastTriggerEl?.focus?.()})}__updateTriggersExpanded(){if(!this.id)return;const e=String(this.open),t=i=>{i.getAttribute("aria-controls")===this.id&&i.setAttribute("aria-expanded",e)};this.__lastTriggerEl&&t(this.__lastTriggerEl),document.querySelectorAll(`[aria-controls="${this.id}"], [data-menu-open="${this.id}"], [data-menu-close="${this.id}"], [data-menu-toggle="${this.id}"]`).forEach(t)}__applySpacing(){const e=this.__mapSpacingToken(this.spacing),t=this.__mapSpacingToken(this.spacingTop)??e,i=this.__mapSpacingToken(this.spacingBottom)??e,a=this.__mapSpacingToken(this.spacingLeft),o=this.__mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-options-menu-spacing-block-start",t):this.style.removeProperty("--scb-options-menu-spacing-block-start"),i?this.style.setProperty("--scb-options-menu-spacing-block-end",i):this.style.removeProperty("--scb-options-menu-spacing-block-end"),a?this.style.setProperty("--scb-options-menu-spacing-inline-start",a):this.style.removeProperty("--scb-options-menu-spacing-inline-start"),o?this.style.setProperty("--scb-options-menu-spacing-inline-end",o):this.style.removeProperty("--scb-options-menu-spacing-inline-end")}__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}},m.styles=v`
|
|
9
|
+
:host {
|
|
10
|
+
position: absolute;
|
|
11
|
+
display: block;
|
|
12
|
+
width: fit-content;
|
|
13
|
+
font-family: var(--brand-font);
|
|
14
|
+
--scb-options-menu-max-width: 300px;
|
|
15
|
+
--scb-options-menu-max-height: 600px;
|
|
16
|
+
--scb-options-menu-panel-padding-block: var(--spacing-3, 8px);
|
|
17
|
+
--scb-options-menu-item-padding-inline: var(--spacing-5, 16px);
|
|
18
|
+
--scb-options-menu-item-padding-block: var(--spacing-3, 8px);
|
|
19
|
+
--scb-options-menu-item-gap: var(--spacing-4, 12px);
|
|
20
|
+
--scb-options-menu-item-min-height: 56px;
|
|
21
|
+
--scb-options-menu-label-font-size: var(--md-sys-typescale-body-large-size);
|
|
22
|
+
--scb-options-menu-label-line-height: var(--md-sys-typescale-body-large-line-height);
|
|
23
|
+
--scb-options-menu-label-letter-spacing: var(--md-sys-typescale-body-large-tracking);
|
|
24
|
+
--scb-options-menu-icon-size: 24px;
|
|
25
|
+
--scb-options-sub-menu-offset-top: -44px;
|
|
26
|
+
z-index: 1000;
|
|
27
|
+
|
|
28
|
+
margin-block-start: var(--scb-options-menu-spacing-block-start, 0);
|
|
29
|
+
margin-block-end: var(--scb-options-menu-spacing-block-end, 0);
|
|
30
|
+
margin-inline-start: var(--scb-options-menu-spacing-inline-start, 0);
|
|
31
|
+
margin-inline-end: var(--scb-options-menu-spacing-inline-end, 0);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([size='medium']) {
|
|
35
|
+
--scb-options-menu-panel-padding-block: var(--spacing-2, 4px);
|
|
36
|
+
--scb-options-menu-item-padding-inline: var(--spacing-5, 16px);
|
|
37
|
+
--scb-options-menu-item-padding-block: var(--spacing-2, 4px);
|
|
38
|
+
--scb-options-menu-item-gap: var(--spacing-3, 8px);
|
|
39
|
+
--scb-options-menu-item-min-height: 48px;
|
|
40
|
+
--scb-options-menu-label-font-size: var(--md-sys-typescale-body-medium-size);
|
|
41
|
+
--scb-options-menu-label-line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
42
|
+
--scb-options-menu-label-letter-spacing: var(--md-sys-typescale-body-medium-tracking);
|
|
43
|
+
--scb-options-menu-icon-size: 20px;
|
|
44
|
+
--scb-options-sub-menu-offset-top: -40px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host([size='small']) {
|
|
48
|
+
--scb-options-menu-panel-padding-block: var(--spacing-1, 2px);
|
|
49
|
+
--scb-options-menu-item-padding-inline: var(--spacing-4, 12px);
|
|
50
|
+
--scb-options-menu-item-padding-block: var(--spacing-2, 4px);
|
|
51
|
+
--scb-options-menu-item-gap: var(--spacing-3, 8px);
|
|
52
|
+
--scb-options-menu-item-min-height: 40px;
|
|
53
|
+
--scb-options-menu-label-font-size: var(--md-sys-typescale-body-small-size);
|
|
54
|
+
--scb-options-menu-label-line-height: var(--md-sys-typescale-body-small-line-height);
|
|
55
|
+
--scb-options-menu-label-letter-spacing: var(--md-sys-typescale-body-small-tracking);
|
|
56
|
+
--scb-options-menu-icon-size: 18px;
|
|
57
|
+
--scb-options-sub-menu-offset-top: -32px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:host > .scb-options-menu-panel {
|
|
61
|
+
padding: var(--scb-options-menu-panel-padding-block) 0;
|
|
62
|
+
color: var(--md-sys-color-on-surface);
|
|
63
|
+
border-radius: var(--md-sys-shape-corner-extra-small);
|
|
64
|
+
background: var(--md-sys-color-surface, #FFF);
|
|
65
|
+
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.30), 0 2px 6px 2px rgba(0, 0, 0, 0.15);
|
|
66
|
+
background: var(--md-sys-color-surface, #FFF);
|
|
67
|
+
opacity: 0;
|
|
68
|
+
max-height: 0;
|
|
69
|
+
transform: scaleY(0.8);
|
|
70
|
+
transform-origin: var(--scb-options-menu-transform-origin, top);
|
|
71
|
+
transition:
|
|
72
|
+
opacity 0.25s cubic-bezier(0.23, 1, 0.32, 1),
|
|
73
|
+
transform 0.32s cubic-bezier(0.23, 1, 0.32, 1);
|
|
74
|
+
will-change: opacity, transform;
|
|
75
|
+
|
|
76
|
+
}
|
|
77
|
+
:host > .scb-options-menu-panel.open {
|
|
78
|
+
opacity: 1;
|
|
79
|
+
transform: scaleY(1);
|
|
80
|
+
max-width: var(--scb-options-menu-max-width);
|
|
81
|
+
max-height: var(--scb-options-menu-max-height);
|
|
82
|
+
min-width: 112px;
|
|
83
|
+
overflow: visible;
|
|
84
|
+
transition:
|
|
85
|
+
opacity 0.25s cubic-bezier(0.23, 1, 0.32, 1),
|
|
86
|
+
transform 0.32s cubic-bezier(0.23, 1, 0.32, 1);
|
|
87
|
+
}
|
|
88
|
+
`,m);n([r({type:Boolean,reflect:!0})],s.prototype,"open",void 0);n([r({type:String,reflect:!0})],s.prototype,"size",void 0);n([r({type:Boolean,attribute:!1})],s.prototype,"inSb",void 0);n([r({type:String,reflect:!0})],s.prototype,"spacing",void 0);n([r({type:String,attribute:"spacing-top",reflect:!0})],s.prototype,"spacingTop",void 0);n([r({type:String,attribute:"spacing-bottom",reflect:!0})],s.prototype,"spacingBottom",void 0);n([r({type:String,attribute:"spacing-left",reflect:!0})],s.prototype,"spacingLeft",void 0);n([r({type:String,attribute:"spacing-right",reflect:!0})],s.prototype,"spacingRight",void 0);s=n([x("scb-options-menu")],s);
|