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,33 @@
|
|
|
1
|
+
import{_ as m,b as v,g as y,h as c,y as k}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as a}from"../../vendor/decorate.js";import{n as x,t as n}from"../../vendor/assertClassBrand.js";import{n as _,r as S,t as b}from"../../vendor/classPrivateFieldGet2.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(o,p,e){try{customElements.get(o)||t(o,p,e)}catch(u){var h=String(u||"");if(h.indexOf("already been used")===-1&&h.indexOf("NotSupportedError")===-1)throw u}}}}catch{}})();var l,r,d,i=(l=new WeakMap,r=new WeakSet,d=class extends m{constructor(...t){super(...t),x(this,r),S(this,l,void 0),this.orientation="vertical",this.disabled=!1,this.size="medium",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,_(l,this,()=>{const o=this.shadowRoot?.querySelector("slot");if(!o)return;const p=o.assignedElements({flatten:!0}).filter(e=>e.tagName.toLowerCase()==="scb-checkbox");for(const e of p){this.disabled?e.setAttribute("disabled",""):e.removeAttribute("disabled"),this.orientation==="horizontal"?e.setAttribute("orientation","horizontal"):e.removeAttribute("orientation");const h=e.hasAttribute("data-size-from-group");this.size==="medium"?h&&(e.removeAttribute("size"),e.removeAttribute("data-size-from-group")):(!e.hasAttribute("size")||h)&&(e.setAttribute("size",this.size),e.setAttribute("data-size-from-group",""))}})}render(){const t=this.orientation==="horizontal"?"row":"column";return k`
|
|
2
|
+
<div class="g" role="group" aria-disabled=${String(this.disabled)} style=${`--_dir:${t}`}>
|
|
3
|
+
<slot @slotchange=${b(l,this)}></slot>
|
|
4
|
+
</div>
|
|
5
|
+
`}firstUpdated(){n(r,this,f).call(this),b(l,this).call(this)}updated(t){(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&n(r,this,f).call(this),(t.has("disabled")||t.has("orientation")||t.has("size"))&&b(l,this).call(this)}},d.styles=v`
|
|
6
|
+
:host {
|
|
7
|
+
display: block;
|
|
8
|
+
/* Vertikal standard-spacing mellan items i gruppen */
|
|
9
|
+
--scb-checkbox-gap: var(--spacing-4, 12px);
|
|
10
|
+
|
|
11
|
+
margin-block-start: var(--scb-checkbox-group-spacing-block-start, 0);
|
|
12
|
+
margin-block-end: var(--scb-checkbox-group-spacing-block-end, 0);
|
|
13
|
+
margin-inline-start: var(--scb-checkbox-group-spacing-inline-start, 0);
|
|
14
|
+
margin-inline-end: var(--scb-checkbox-group-spacing-inline-end, 0);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Horisontell standard-spacing mellan items om spacing för gruppen inte overrideas via CSS-variabel */
|
|
18
|
+
:host([orientation='horizontal']) {
|
|
19
|
+
--scb-checkbox-gap: var(--spacing-8, 32px);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.g {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: var(--_dir, column);
|
|
25
|
+
align-items: flex-start;
|
|
26
|
+
gap: var(--scb-checkbox-gap);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* När checkboxar ligger i en grupp ska spacing ägas av gruppen, inte av enskilda items */
|
|
30
|
+
::slotted(scb-checkbox) {
|
|
31
|
+
--scb-checkbox-gap: 0;
|
|
32
|
+
}
|
|
33
|
+
`,d);function f(){const s=n(r,this,g).call(this,this.spacing),t=n(r,this,g).call(this,this.spacingTop)??s,o=n(r,this,g).call(this,this.spacingBottom)??s,p=n(r,this,g).call(this,this.spacingLeft),e=n(r,this,g).call(this,this.spacingRight);t?this.style.setProperty("--scb-checkbox-group-spacing-block-start",t):this.style.removeProperty("--scb-checkbox-group-spacing-block-start"),o?this.style.setProperty("--scb-checkbox-group-spacing-block-end",o):this.style.removeProperty("--scb-checkbox-group-spacing-block-end"),p?this.style.setProperty("--scb-checkbox-group-spacing-inline-start",p):this.style.removeProperty("--scb-checkbox-group-spacing-inline-start"),e?this.style.setProperty("--scb-checkbox-group-spacing-inline-end",e):this.style.removeProperty("--scb-checkbox-group-spacing-inline-end")}function g(s){if(!s)return;const t=String(s).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}a([c({type:String,reflect:!0})],i.prototype,"orientation",void 0);a([c({type:Boolean,reflect:!0})],i.prototype,"disabled",void 0);a([c({type:String,reflect:!0})],i.prototype,"size",void 0);a([c({type:String,reflect:!0})],i.prototype,"spacing",void 0);a([c({type:String,attribute:"spacing-top",reflect:!0})],i.prototype,"spacingTop",void 0);a([c({type:String,attribute:"spacing-bottom",reflect:!0})],i.prototype,"spacingBottom",void 0);a([c({type:String,attribute:"spacing-left",reflect:!0})],i.prototype,"spacingLeft",void 0);a([c({type:String,attribute:"spacing-right",reflect:!0})],i.prototype,"spacingRight",void 0);i=a([y("scb-checkbox-group")],i);
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import"../../vendor/vendor-material.js";import{_ as I,b as M,g as R,h as c,v as p,y as x}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as o}from"../../vendor/decorate.js";import{n as F,t as n}from"../../vendor/assertClassBrand.js";import{n as _,r as w,t as h}from"../../vendor/classPrivateFieldGet2.js";import"./scb-checkbox-group.js";(function(){try{var i=typeof globalThis<"u"?globalThis:window;if(!i.__scb_ce_guard_installed__){i.__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(V){var b=String(V||"");if(b.indexOf("already been used")===-1&&b.indexOf("NotSupportedError")===-1)throw V}}}}catch{}})();var r,u,g,m,k,L=!1,f=0,$=i=>{i.metaKey||i.altKey||i.ctrlKey||(L=!0)},d=()=>{L=!1},C=()=>{f===0&&(window.addEventListener("keydown",$,!0),window.addEventListener("pointerdown",d,!0),window.addEventListener("mousedown",d,!0),window.addEventListener("touchstart",d,!0)),f+=1},z=()=>{f=Math.max(0,f-1),f===0&&(window.removeEventListener("keydown",$,!0),window.removeEventListener("pointerdown",d,!0),window.removeEventListener("mousedown",d,!0),window.removeEventListener("touchstart",d,!0))},a=(r=new WeakSet,u=new WeakMap,g=new WeakMap,m=new WeakMap,k=class extends I{constructor(){super(),F(this,r),w(this,u,void 0),w(this,g,void 0),w(this,m,void 0),this._internals=null,this.disabled=!1,this.indeterminate=!1,this.checked=!1,this.required=!1,this.size="medium",this.label="",this.supportingText="",this.ariaLabel="",this.name="",this.value="on",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._form=null,this._formResetHandler=null,this._initialChecked=!1,this._customValidationMessage="",this._checkboxId="",this._showOuterFocusRing=!1,_(u,this,()=>{this.disabled||this.label?.trim()&&L&&n(r,this,y).call(this,!0)}),_(g,this,()=>{n(r,this,y).call(this,!1)}),_(m,this,()=>{n(r,this,y).call(this,!1)}),"attachInternals"in this&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),C(),this._checkboxId=this.id||`scb-checkbox-${Math.random().toString(36).slice(2,11)}`,this._initialChecked=this.checked,n(r,this,S).call(this),this.addEventListener("focusin",h(u,this)),this.addEventListener("focusout",h(g,this)),this.addEventListener("pointerdown",h(m,this),!0),this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.checked=this._initialChecked,this.indeterminate=!1,this.__syncFormValue()},this._form.addEventListener("reset",this._formResetHandler,!0)),this.__syncFormValue()}disconnectedCallback(){super.disconnectedCallback(),z(),this.removeEventListener("focusin",h(u,this)),this.removeEventListener("focusout",h(g,this)),this.removeEventListener("pointerdown",h(m,this),!0),this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0)}firstUpdated(){const e=this.shadowRoot?.querySelector("md-checkbox");e&&e.addEventListener("change",()=>{const t=e,s=!!t.checked,l=!!t.indeterminate;this.checked=s,this.indeterminate=l,this.dispatchEvent(new CustomEvent("change",{detail:{checked:s,indeterminate:l},bubbles:!0,composed:!0}))}),this.shadowRoot?.querySelector("label.wrap")?.addEventListener("click",t=>{if(!this.disabled&&!t.composedPath().some(s=>{const l=s;return l?.tagName?.toLowerCase?.()==="md-checkbox"||l?.classList?.contains("box-wrap")})){t.preventDefault();const s=this.shadowRoot.querySelector("md-checkbox");s&&(s.checked=!s.checked,s.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}}),this.__syncInnerAria(),this.__syncValidity(),n(r,this,E).call(this)}updated(e){super.updated(e),e.has("disabled")&&(this.toggleAttribute("aria-disabled",this.disabled),this.disabled&&n(r,this,y).call(this,!1)),(e.has("label")||e.has("supportingText")||e.has("ariaLabel"))&&this.__syncInnerAria(),e.has("label")&&n(r,this,S).call(this),(e.has("checked")||e.has("disabled")||e.has("value"))&&this.__syncFormValue(),(e.has("checked")||e.has("disabled")||e.has("required"))&&this.__syncValidity(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&n(r,this,E).call(this)}formDisabledCallback(e){this.disabled=e}__syncInnerAria(){const e=this.shadowRoot?.querySelector("md-checkbox")?.shadowRoot;if(!e)return;const t=e.querySelector('[role="checkbox"]')||e.querySelector('input[type="checkbox"]');if(!t)return;const s=!!this.label?.trim(),l=s?`${this._checkboxId}-label`:"",b=this.supportingText?`${this._checkboxId}-supporting-text`:"";s&&l?(t.setAttribute("aria-labelledby",l),t.removeAttribute("aria-label")):(t.removeAttribute("aria-labelledby"),this.ariaLabel?.trim()?t.setAttribute("aria-label",this.ariaLabel.trim()):t.removeAttribute("aria-label")),b?t.setAttribute("aria-describedby",b):t.removeAttribute("aria-describedby")}__getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!this.checked?"Markera det här fältet.":""}__syncValidity(){const e=this.shadowRoot?.querySelector("md-checkbox"),t=this.disabled?"":this.__getValidationMessage();this._internals&&(t?this._internals.setValidity({valueMissing:!0},t,e??void 0):this._internals.setValidity({})),this.toggleAttribute("aria-invalid",!!t)}checkValidity(){return!this.__getValidationMessage()}reportValidity(){return this.__syncValidity(),this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(e){this._customValidationMessage=e,this.__syncValidity()}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this.__getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}__syncFormValue(){if(!this._internals)return;const e=this.disabled||!this.checked?null:this.value;this._internals.setFormValue(e)}render(){const e=this.supportingText?`${this._checkboxId}-supporting-text`:void 0,t=!!this.label?.trim(),s=t?p:this.ariaLabel||p;return x`
|
|
2
|
+
<label class="wrap">
|
|
3
|
+
${t?x`<md-focus-ring class="outer-focus-ring" ?visible=${this._showOuterFocusRing}></md-focus-ring>`:p}
|
|
4
|
+
<div class="box-wrap">
|
|
5
|
+
<md-checkbox
|
|
6
|
+
id="${this._checkboxId}"
|
|
7
|
+
?disabled=${this.disabled}
|
|
8
|
+
?indeterminate=${this.indeterminate}
|
|
9
|
+
?checked=${this.checked}
|
|
10
|
+
?required=${this.required}
|
|
11
|
+
aria-label=${s}
|
|
12
|
+
></md-checkbox>
|
|
13
|
+
</div>
|
|
14
|
+
${t?x`<span class="lbl" id="${this._checkboxId}-label">${this.label}</span>`:p}
|
|
15
|
+
</label>
|
|
16
|
+
|
|
17
|
+
${this.supportingText?x`<div id="${e}" class="supporting-text">
|
|
18
|
+
${this.supportingText}
|
|
19
|
+
</div>`:p}
|
|
20
|
+
<slot></slot>
|
|
21
|
+
`}},k.formAssociated=!0,k.styles=M`
|
|
22
|
+
:host {
|
|
23
|
+
display: inline-grid;
|
|
24
|
+
grid-template-columns: auto;
|
|
25
|
+
grid-template-rows: auto auto;
|
|
26
|
+
row-gap: 0;
|
|
27
|
+
font-family: var(--brand-font, 'Inter', sans-serif);
|
|
28
|
+
|
|
29
|
+
--scb-checkbox-text-font: var(--md-sys-typescale-body-medium-font);
|
|
30
|
+
--scb-checkbox-text-size: var(--md-sys-typescale-body-medium-size);
|
|
31
|
+
--scb-checkbox-text-line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
32
|
+
--scb-checkbox-text-tracking: var(--md-sys-typescale-body-medium-tracking);
|
|
33
|
+
--scb-checkbox-text-weight: var(--md-sys-typescale-body-medium-weight, var(--weight-regular, 400));
|
|
34
|
+
|
|
35
|
+
margin-block-start: var(--scb-checkbox-spacing-block-start, 0);
|
|
36
|
+
margin-block-end: var(--scb-checkbox-spacing-block-end, 0);
|
|
37
|
+
margin-inline-start: var(--scb-checkbox-spacing-inline-start, 0);
|
|
38
|
+
margin-inline-end: var(--scb-checkbox-spacing-inline-end, 0);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([size='small']) {
|
|
42
|
+
--scb-checkbox-text-font: var(--md-sys-typescale-body-small-font);
|
|
43
|
+
--scb-checkbox-text-size: var(--md-sys-typescale-body-small-size);
|
|
44
|
+
--scb-checkbox-text-line-height: var(--md-sys-typescale-body-small-line-height);
|
|
45
|
+
--scb-checkbox-text-tracking: var(--md-sys-typescale-body-small-tracking);
|
|
46
|
+
--scb-checkbox-text-weight: var(--md-sys-typescale-body-small-weight, var(--weight-regular, 400));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host([size='large']) {
|
|
50
|
+
--scb-checkbox-text-font: var(--md-sys-typescale-body-large-font);
|
|
51
|
+
--scb-checkbox-text-size: var(--md-sys-typescale-body-large-size);
|
|
52
|
+
--scb-checkbox-text-line-height: var(--md-sys-typescale-body-large-line-height);
|
|
53
|
+
--scb-checkbox-text-tracking: var(--md-sys-typescale-body-large-tracking);
|
|
54
|
+
--scb-checkbox-text-weight: var(--md-sys-typescale-body-large-weight, var(--weight-regular, 400));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([orientation='horizontal']) {
|
|
58
|
+
margin-inline-end: var(--scb-checkbox-spacing-inline-end, var(--scb-checkbox-gap, var(--spacing-7, 24px)));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.wrap {
|
|
62
|
+
display: inline-flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: var(--spacing-5, 16px);
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
position: relative;
|
|
67
|
+
overflow: visible;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.outer-focus-ring {
|
|
71
|
+
position: absolute;
|
|
72
|
+
inset:
|
|
73
|
+
calc(var(--spacing-2, 4px) * -1) /* topp */
|
|
74
|
+
calc(var(--spacing-4, 12px) * -1) /* höger */
|
|
75
|
+
calc(var(--spacing-2, 4px) * -1) /* botten */
|
|
76
|
+
calc(var(--spacing-4, 12px) * -1); /* vänster */
|
|
77
|
+
pointer-events: none;
|
|
78
|
+
--md-focus-ring-shape-start-start: var(--radius-s, 8px);
|
|
79
|
+
--md-focus-ring-shape-start-end: var(--radius-s, 8px);
|
|
80
|
+
--md-focus-ring-shape-end-start: var(--radius-s, 8px);
|
|
81
|
+
--md-focus-ring-shape-end-end: var(--radius-s, px);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:host([data-has-label]) md-checkbox::part(focus-ring) {
|
|
85
|
+
display: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host([disabled]) .wrap {
|
|
89
|
+
cursor: default;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.box-wrap {
|
|
93
|
+
height: var(--scb-checkbox-target, 40px);
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
justify-content: center;
|
|
97
|
+
overflow: visible;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
md-checkbox {
|
|
101
|
+
margin: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.lbl {
|
|
105
|
+
color: var(--md-sys-color-on-surface);
|
|
106
|
+
font-family: var(--scb-checkbox-text-font, var(--brand-font));
|
|
107
|
+
font-size: var(--scb-checkbox-text-size);
|
|
108
|
+
line-height: var(--scb-checkbox-text-line-height);
|
|
109
|
+
font-weight: var(--scb-checkbox-text-weight);
|
|
110
|
+
letter-spacing: var(--scb-checkbox-text-tracking);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:host([disabled]) .lbl {
|
|
114
|
+
color: var(--n-60);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.supporting-text {
|
|
118
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
119
|
+
font-family: var(--scb-checkbox-text-font, var(--brand-font));
|
|
120
|
+
font-size: var(--scb-checkbox-text-size);
|
|
121
|
+
line-height: var(--scb-checkbox-text-line-height, 20px);
|
|
122
|
+
font-weight: var(--scb-checkbox-text-weight);
|
|
123
|
+
letter-spacing: var(--scb-checkbox-text-tracking);
|
|
124
|
+
margin-left: calc(var(--spacing-3, 6px) + var(--scb-checkbox-target, 40px));
|
|
125
|
+
margin-bottom: var(--spacing-4, 8px);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:host([disabled]) .supporting-text {
|
|
129
|
+
color: var(--n-60);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@media (prefers-color-scheme: dark) {
|
|
133
|
+
.lbl {
|
|
134
|
+
color: var(--md-sys-color-on-surface);
|
|
135
|
+
}
|
|
136
|
+
.supporting-text {
|
|
137
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
`,k);function y(i){this._showOuterFocusRing!==i&&(this._showOuterFocusRing=i,this.requestUpdate())}function S(){const i=!!this.label?.trim();this.toggleAttribute("data-has-label",i),i||n(r,this,y).call(this,!1)}function E(){const i=n(r,this,v).call(this,this.spacing),e=n(r,this,v).call(this,this.spacingTop)??i,t=n(r,this,v).call(this,this.spacingBottom)??i,s=n(r,this,v).call(this,this.spacingLeft),l=n(r,this,v).call(this,this.spacingRight);e?this.style.setProperty("--scb-checkbox-spacing-block-start",e):this.style.removeProperty("--scb-checkbox-spacing-block-start"),t?this.style.setProperty("--scb-checkbox-spacing-block-end",t):this.style.removeProperty("--scb-checkbox-spacing-block-end"),s?this.style.setProperty("--scb-checkbox-spacing-inline-start",s):this.style.removeProperty("--scb-checkbox-spacing-inline-start"),l?this.style.setProperty("--scb-checkbox-spacing-inline-end",l):this.style.removeProperty("--scb-checkbox-spacing-inline-end")}function v(i){if(!i)return;const e=String(i).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}o([c({type:Boolean,reflect:!0})],a.prototype,"disabled",void 0);o([c({type:Boolean,reflect:!0})],a.prototype,"indeterminate",void 0);o([c({type:Boolean,reflect:!0})],a.prototype,"checked",void 0);o([c({type:Boolean,reflect:!0})],a.prototype,"required",void 0);o([c({type:String,reflect:!0})],a.prototype,"size",void 0);o([c({type:String})],a.prototype,"label",void 0);o([c({type:String,attribute:"supporting-text"})],a.prototype,"supportingText",void 0);o([c({type:String,reflect:!0,attribute:"aria-label"})],a.prototype,"ariaLabel",void 0);o([c({type:String})],a.prototype,"name",void 0);o([c({type:String})],a.prototype,"value",void 0);o([c({type:String,reflect:!0})],a.prototype,"spacing",void 0);o([c({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",void 0);o([c({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",void 0);o([c({type:String,attribute:"spacing-left",reflect:!0})],a.prototype,"spacingLeft",void 0);o([c({type:String,attribute:"spacing-right",reflect:!0})],a.prototype,"spacingRight",void 0);a=o([R("scb-checkbox")],a);export{a as ScbCheckbox};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import{_ as f,b as l,g as v,h as d,m,y as p}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as a}from"../../vendor/decorate.js";(function(){try{var o=typeof globalThis<"u"?globalThis:window;if(!o.__scb_ce_guard_installed__){o.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,c,h){try{customElements.get(t)||e(t,c,h)}catch(i){var s=String(i||"");if(s.indexOf("already been used")===-1&&s.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();var n,r=(n=class extends f{constructor(...e){super(...e),this.open=!1,this.animationPhase="idle"}willUpdate(e){e.has("open")&&(e.get("open")??!this.open)!==this.open&&(this.animationPhase=this.open?"opening":"closing")}render(){return p`
|
|
2
|
+
<svg
|
|
3
|
+
class="chevron-icon ${this.animationPhase==="idle"?"":`chevron--${this.animationPhase}`}"
|
|
4
|
+
viewBox="0 0 24 24"
|
|
5
|
+
aria-hidden="true"
|
|
6
|
+
focusable="false"
|
|
7
|
+
>
|
|
8
|
+
<line class="bar bar--left" x1="5" y1="12" x2="12" y2="12"></line>
|
|
9
|
+
<line class="bar bar--right" x1="12" y1="12" x2="19" y2="12"></line>
|
|
10
|
+
</svg>
|
|
11
|
+
`}},n.styles=l`
|
|
12
|
+
:host {
|
|
13
|
+
display: block;
|
|
14
|
+
width: var(--scb-chevron-size, 24px);
|
|
15
|
+
height: var(--scb-chevron-size, 24px);
|
|
16
|
+
color: inherit;
|
|
17
|
+
--chevron-offset-down: 2.3px;
|
|
18
|
+
--chevron-offset-up: -2.3px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.chevron-icon {
|
|
22
|
+
display: block;
|
|
23
|
+
width: var(--scb-chevron-size, 24px);
|
|
24
|
+
height: var(--scb-chevron-size, 24px);
|
|
25
|
+
overflow: visible;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.chevron-icon .bar {
|
|
29
|
+
fill: none;
|
|
30
|
+
stroke: currentColor;
|
|
31
|
+
stroke-width: 1.5;
|
|
32
|
+
stroke-linecap: square;
|
|
33
|
+
stroke-linejoin: miter;
|
|
34
|
+
stroke-miterlimit: 2;
|
|
35
|
+
shape-rendering: geometricPrecision;
|
|
36
|
+
vector-effect: non-scaling-stroke;
|
|
37
|
+
transform-box: view-box;
|
|
38
|
+
transform-origin: 12px 12px;
|
|
39
|
+
will-change: transform;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.chevron-icon .bar--left {
|
|
43
|
+
transform: translateY(var(--chevron-offset-down)) rotate(45deg);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.chevron-icon .bar--right {
|
|
47
|
+
transform: translateY(var(--chevron-offset-down)) rotate(-45deg);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host([open]) .chevron-icon .bar--left {
|
|
51
|
+
transform: translateY(var(--chevron-offset-up)) rotate(-45deg);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host([open]) .chevron-icon .bar--right {
|
|
55
|
+
transform: translateY(var(--chevron-offset-up)) rotate(45deg);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.chevron-icon.chevron--opening .bar--left {
|
|
59
|
+
animation: chevron-left-open 100ms linear;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.chevron-icon.chevron--opening .bar--right {
|
|
63
|
+
animation: chevron-right-open 100ms linear;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.chevron-icon.chevron--closing .bar--left {
|
|
67
|
+
animation: chevron-left-close 100ms linear;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.chevron-icon.chevron--closing .bar--right {
|
|
71
|
+
animation: chevron-right-close 100ms linear;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@keyframes chevron-left-open {
|
|
75
|
+
0% {
|
|
76
|
+
transform: translateY(var(--chevron-offset-down)) rotate(45deg);
|
|
77
|
+
}
|
|
78
|
+
50% {
|
|
79
|
+
transform: translateY(0px) rotate(0deg);
|
|
80
|
+
}
|
|
81
|
+
100% {
|
|
82
|
+
transform: translateY(var(--chevron-offset-up)) rotate(-45deg);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@keyframes chevron-right-open {
|
|
87
|
+
0% {
|
|
88
|
+
transform: translateY(var(--chevron-offset-down)) rotate(-45deg);
|
|
89
|
+
}
|
|
90
|
+
50% {
|
|
91
|
+
transform: translateY(0px) rotate(0deg);
|
|
92
|
+
}
|
|
93
|
+
100% {
|
|
94
|
+
transform: translateY(var(--chevron-offset-up)) rotate(45deg);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@keyframes chevron-left-close {
|
|
99
|
+
0% {
|
|
100
|
+
transform: translateY(var(--chevron-offset-up)) rotate(-45deg);
|
|
101
|
+
}
|
|
102
|
+
50% {
|
|
103
|
+
transform: translateY(0px) rotate(0deg);
|
|
104
|
+
}
|
|
105
|
+
100% {
|
|
106
|
+
transform: translateY(var(--chevron-offset-down)) rotate(45deg);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@keyframes chevron-right-close {
|
|
111
|
+
0% {
|
|
112
|
+
transform: translateY(var(--chevron-offset-up)) rotate(45deg);
|
|
113
|
+
}
|
|
114
|
+
50% {
|
|
115
|
+
transform: translateY(0px) rotate(0deg);
|
|
116
|
+
}
|
|
117
|
+
100% {
|
|
118
|
+
transform: translateY(var(--chevron-offset-down)) rotate(-45deg);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
`,n);a([d({type:Boolean,reflect:!0})],r.prototype,"open",void 0);a([m()],r.prototype,"animationPhase",void 0);r=a([v("scb-chevron")],r);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js","../../vendor/vendor-lit.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as v,b as f,g as _,h as s,y as n}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as i}from"../../vendor/decorate.js";import{n as g,t as u}from"../../vendor/assertClassBrand.js";import{t as p}from"../../vendor/preload-helper.js";(function(){try{var r=typeof globalThis<"u"?globalThis:window;if(!r.__scb_ce_guard_installed__){r.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(a,c,d){try{customElements.get(a)||t(a,c,d)}catch(l){var o=String(l||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var h,m,e=(h=new WeakSet,m=class extends v{constructor(){super(),g(this,h),this.variant="assist",this.label="",this.icon="",this.disabled=!1,this.elevated=!1,this.removable=!1,this.selected=!1,this.disableToggle=!1,this.href="",this.target="",this.name="",this.value="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.size="medium",this._internals=null,this.__loadedVariants=new Set,this.__chipSetLoaded=!1,this.__iconLoaded=!1,this._onFilterClick=t=>{if(this.disableToggle){const a=t.currentTarget;a&&(a.selected=this.selected),t.preventDefault();return}this._toggleSelected()},"attachInternals"in this&&(this._internals=this.attachInternals())}updated(t){super.updated(t),(t.has("variant")||t.has("icon"))&&this.__ensureDepsLoaded(),t.has("disabled")&&(this.toggleAttribute("aria-disabled",this.disabled),this.dispatchEvent(new CustomEvent("disabled-changed",{detail:{disabled:this.disabled},bubbles:!0,composed:!0}))),t.has("variant")&&this.dispatchEvent(new CustomEvent("variant-changed",{detail:{variant:this.variant},bubbles:!0,composed:!0})),t.has("label")&&this.dispatchEvent(new CustomEvent("label-changed",{detail:{label:this.label},bubbles:!0,composed:!0})),t.has("elevated")&&this.dispatchEvent(new CustomEvent("elevated-changed",{detail:{elevated:this.elevated},bubbles:!0,composed:!0})),t.has("icon")&&this.dispatchEvent(new CustomEvent("icon-changed",{detail:{icon:this.icon},bubbles:!0,composed:!0})),t.has("size")&&this.dispatchEvent(new CustomEvent("size-changed",{detail:{size:this.size},bubbles:!0,composed:!0})),(t.has("selected")||t.has("disabled")||t.has("variant")||t.has("value")||t.has("name"))&&this._updateFormValue(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&u(h,this,b).call(this)}firstUpdated(){this.__ensureDepsLoaded(),u(h,this,b).call(this),this._updateFormValue()}async __ensureDepsLoaded(){if(!this.__loadedVariants.has(this.variant)){switch(this.variant){case"assist":await p(()=>import("../../vendor/vendor-material.js").then(t=>t.c),__vite__mapDeps([0,1,2]),import.meta.url);break;case"filter":await p(()=>import("../../vendor/vendor-material.js").then(t=>t.o),__vite__mapDeps([0,1,2]),import.meta.url);break}this.__loadedVariants.add(this.variant)}!this._insideChipSet&&!this.__chipSetLoaded&&(await p(()=>import("../../vendor/vendor-material.js").then(t=>t.s),__vite__mapDeps([0,1,2]),import.meta.url),this.__chipSetLoaded=!0),this.icon&&!this.__iconLoaded&&(await p(()=>import("../../vendor/vendor-material.js").then(t=>t.p),__vite__mapDeps([0,1,2]),import.meta.url),this.__iconLoaded=!0)}get _insideChipSet(){return!!this.closest("md-chip-set")}render(){const t=this._renderChip();return this._insideChipSet?t:n`<md-chip-set>${t}</md-chip-set>`}_renderChip(){const t=this.icon?n`<md-icon slot="icon">${this.icon}</md-icon>`:null;switch(this.variant){case"assist":{const a=this.target==="_blank"?"noopener noreferrer":void 0;return n`
|
|
3
|
+
<md-assist-chip
|
|
4
|
+
label=${this.label}
|
|
5
|
+
?disabled=${this.disabled}
|
|
6
|
+
?elevated=${this.elevated}
|
|
7
|
+
href=${this.href||void 0}
|
|
8
|
+
target=${this.href&&this.target||void 0}
|
|
9
|
+
rel=${a}
|
|
10
|
+
@update-focus=${this._forward}
|
|
11
|
+
>
|
|
12
|
+
${t}
|
|
13
|
+
</md-assist-chip>
|
|
14
|
+
`}case"filter":return n`
|
|
15
|
+
<md-filter-chip
|
|
16
|
+
label=${this.label}
|
|
17
|
+
?disabled=${this.disabled}
|
|
18
|
+
?removable=${this.removable}
|
|
19
|
+
?selected=${this.selected}
|
|
20
|
+
@remove=${this._onRemove}
|
|
21
|
+
@update-focus=${this._forward}
|
|
22
|
+
@click=${this._onFilterClick}
|
|
23
|
+
>
|
|
24
|
+
${t}
|
|
25
|
+
</md-filter-chip>
|
|
26
|
+
`;default:return n``}}_toggleSelected(){this.selected=!this.selected,this.dispatchEvent(new CustomEvent("selected-changed",{detail:{selected:this.selected},bubbles:!0,composed:!0})),this._updateFormValue()}_onRemove(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove",{detail:{label:this.label},bubbles:!0,composed:!0}))}_forward(t){this.dispatchEvent(new CustomEvent(t.type,{detail:t.detail,bubbles:!0,composed:!0}))}_updateFormValue(){if(!this._internals)return;if(!(this.variant==="filter"&&this.selected&&!this.disabled&&this.name)){this._internals.setFormValue(null),this._internals.setValidity({});return}const t=this.value||this.label||"";this._internals.setFormValue(t,this.name),this._internals.setValidity({})}formDisabledCallback(t){this.disabled=t}mapSpacingToken(t){if(!t)return;const a=String(t).trim();if(a)return/^\d+$/.test(a)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(a,10)))})`:a}},m.formAssociated=!0,m.styles=f`
|
|
27
|
+
:host {
|
|
28
|
+
display: inline-block;
|
|
29
|
+
margin-block-start: var(--scb-chip-spacing-block-start, 0);
|
|
30
|
+
margin-block-end: var(--scb-chip-spacing-block-end, 0);
|
|
31
|
+
margin-inline-start: var(--scb-chip-spacing-inline-start, 0);
|
|
32
|
+
margin-inline-end: var(--scb-chip-spacing-inline-end, 0);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Sätt samma färg på label för assist som är på filter */
|
|
36
|
+
:host md-assist-chip {
|
|
37
|
+
--_label-text-color: var(--md-sys-color-on-surface-variant);
|
|
38
|
+
--_hover-label-text-color: var(--md-sys-color-on-surface-variant);
|
|
39
|
+
--_focus-label-text-color: var(--md-sys-color-on-surface-variant);
|
|
40
|
+
--_pressed-label-text-color: var(--md-sys-color-on-surface-variant);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Storlekar: små/medium/stora chips via tokens.
|
|
44
|
+
Medium (default) är Material-standardvärdena. */
|
|
45
|
+
:host([size='small']) md-assist-chip,
|
|
46
|
+
:host([size='small']) md-filter-chip {
|
|
47
|
+
--md-assist-chip-label-text-size: var(--md-sys-typescale-label-small-size);
|
|
48
|
+
--md-filter-chip-label-text-size: var(--md-sys-typescale-label-small-size);
|
|
49
|
+
}
|
|
50
|
+
:host([size='medium']) md-assist-chip,
|
|
51
|
+
:host([size='medium']) md-filter-chip {
|
|
52
|
+
--md-assist-chip-label-text-size: var(--md-sys-typescale-label-medium-size);
|
|
53
|
+
--md-filter-chip-label-text-size: var(--md-sys-typescale-label-medium-size);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host([size='large']) md-assist-chip,
|
|
57
|
+
:host([size='large']) md-filter-chip {
|
|
58
|
+
--md-assist-chip-label-text-size: var(--md-sys-typescale-body-large-size);
|
|
59
|
+
--md-filter-chip-label-text-size: var(--md-sys-typescale-body-large-size);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* md-icon {
|
|
63
|
+
color: var(--md-sys-color-on-surface);
|
|
64
|
+
font-size: var(--md-sys-typescale-body-large-size);
|
|
65
|
+
} */
|
|
66
|
+
`,m);function b(){const r=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop),a=this.mapSpacingToken(this.spacingBottom),c=this.mapSpacingToken(this.spacingLeft),d=this.mapSpacingToken(this.spacingRight),o=t??r,l=a??r;o?this.style.setProperty("--scb-chip-spacing-block-start",o):this.style.removeProperty("--scb-chip-spacing-block-start"),l?this.style.setProperty("--scb-chip-spacing-block-end",l):this.style.removeProperty("--scb-chip-spacing-block-end"),c?this.style.setProperty("--scb-chip-spacing-inline-start",c):this.style.removeProperty("--scb-chip-spacing-inline-start"),d?this.style.setProperty("--scb-chip-spacing-inline-end",d):this.style.removeProperty("--scb-chip-spacing-inline-end")}i([s({type:String,reflect:!0})],e.prototype,"variant",void 0);i([s({type:String})],e.prototype,"label",void 0);i([s({type:String})],e.prototype,"icon",void 0);i([s({type:Boolean,reflect:!0})],e.prototype,"disabled",void 0);i([s({type:Boolean,reflect:!0})],e.prototype,"elevated",void 0);i([s({type:Boolean,reflect:!0})],e.prototype,"removable",void 0);i([s({type:Boolean,reflect:!0})],e.prototype,"selected",void 0);i([s({type:Boolean,reflect:!0,attribute:"disable-toggle"})],e.prototype,"disableToggle",void 0);i([s({type:String})],e.prototype,"href",void 0);i([s({type:String})],e.prototype,"target",void 0);i([s({type:String})],e.prototype,"name",void 0);i([s({type:String})],e.prototype,"value",void 0);i([s({type:String,reflect:!0})],e.prototype,"spacing",void 0);i([s({type:String,reflect:!0,attribute:"spacing-top"})],e.prototype,"spacingTop",void 0);i([s({type:String,reflect:!0,attribute:"spacing-bottom"})],e.prototype,"spacingBottom",void 0);i([s({type:String,reflect:!0,attribute:"spacing-left"})],e.prototype,"spacingLeft",void 0);i([s({type:String,reflect:!0,attribute:"spacing-right"})],e.prototype,"spacingRight",void 0);i([s({type:String,reflect:!0})],e.prototype,"size",void 0);e=i([_("scb-chip")],e);
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import{_ as f,b as v,g as y,h as a,y as h}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as n}from"../../vendor/decorate.js";import{n as _,t as d}from"../../vendor/assertClassBrand.js";import"../scb-button/scb-button.js";(function(){try{var l=typeof globalThis<"u"?globalThis:window;if(!l.__scb_ce_guard_installed__){l.__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(r){var p=String(r||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var c,u,o=(c=new WeakSet,u=class extends f{constructor(...t){super(...t),_(this,c),this._contentId=`scb-collapse-content-${Math.random().toString(36).substr(2,9)}`,this.variant="elements",this.collapsedHeight=40,this.visibleElements=1,this.expanded=!1,this._elementCount=0,this.expandButtonLabel="Mer",this.collapseButtonLabel="Mindre",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.itemsGap=void 0,this._contentHeight=0}get _regionLabel(){return`${this.expanded?this.collapseButtonLabel:this.expandButtonLabel} – ${this._contentId}`}toggle(){this.expanded=!this.expanded}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}willUpdate(t){t.has("variant")&&(this._measureContent(!1),this._countElements(!1))}firstUpdated(){requestAnimationFrame(()=>{this._measureContent(),this._countElements()});const t=this.shadowRoot?.querySelector("slot");t&&t.addEventListener("slotchange",()=>{requestAnimationFrame(()=>{this._measureContent(),this._countElements(),d(c,this,g).call(this)})}),d(c,this,b).call(this),d(c,this,g).call(this)}updated(t){(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&d(c,this,b).call(this),t.has("itemsGap")&&(d(c,this,g).call(this),this._measureContent()),t.has("expanded")&&(d(c,this,g).call(this),this.dispatchEvent(new CustomEvent("expandedchange",{detail:{expanded:this.expanded},bubbles:!0,composed:!0})))}_measureContent(t=!0){if(this.variant==="height"){const e=this.shadowRoot?.querySelector("slot");if(e){const i=e.assignedNodes({flatten:!0});let s=0;i.forEach(r=>{if(r.nodeType===Node.ELEMENT_NODE){const m=r;s+=m.offsetHeight||m.scrollHeight||0}});const p=s;p!==this._contentHeight&&(this._contentHeight=p,t&&this.requestUpdate())}}}_countElements(t=!0){if(this.variant==="elements"){const e=this.shadowRoot?.querySelector("slot");if(e){const i=e.assignedNodes({flatten:!0}).filter(s=>s.nodeType===Node.ELEMENT_NODE).length;i!==this._elementCount&&(this._elementCount=i,t&&this.requestUpdate())}}}render(){if(this.variant==="height"){const t=this.expanded?`${this._contentHeight}px`:`${this.collapsedHeight}px`,e=this._contentHeight>this.collapsedHeight;return h`
|
|
2
|
+
<div
|
|
3
|
+
class="collapse-content"
|
|
4
|
+
id="${this._contentId}"
|
|
5
|
+
style="max-height: ${t};"
|
|
6
|
+
role="region"
|
|
7
|
+
aria-label="${this._regionLabel}"
|
|
8
|
+
>
|
|
9
|
+
<slot></slot>
|
|
10
|
+
${e&&!this.expanded?h`<div class="collapse-gradient-overlay"></div>`:""}
|
|
11
|
+
</div>
|
|
12
|
+
${e?h`
|
|
13
|
+
<scb-button
|
|
14
|
+
id="${this._contentId}-button"
|
|
15
|
+
@click="${this.toggle}"
|
|
16
|
+
variant="text"
|
|
17
|
+
label="${this.expanded?this.collapseButtonLabel:this.expandButtonLabel}"
|
|
18
|
+
icon="${this.expanded?"keyboard_arrow_up":"keyboard_arrow_down"}"
|
|
19
|
+
aria-controls="${this._contentId}"
|
|
20
|
+
aria-expanded="${this.expanded?"true":"false"}"
|
|
21
|
+
>
|
|
22
|
+
</scb-button>
|
|
23
|
+
`:""}
|
|
24
|
+
`}else{const t=typeof this.visibleElements=="string"?parseInt(this.visibleElements,10):this.visibleElements,e=this._elementCount>t;return setTimeout(()=>{const i=this.shadowRoot?.querySelector("slot");i&&i.assignedNodes({flatten:!0}).filter(s=>s.nodeType===Node.ELEMENT_NODE).forEach((s,p)=>{const r=s;!this.expanded&&p>=t?r.classList.add("scb-collapsed-hidden"):r.classList.remove("scb-collapsed-hidden")})},0),h`
|
|
25
|
+
<div
|
|
26
|
+
class="collapse-content"
|
|
27
|
+
id="${this._contentId}"
|
|
28
|
+
role="region"
|
|
29
|
+
aria-label="${this._regionLabel}"
|
|
30
|
+
>
|
|
31
|
+
<slot></slot>
|
|
32
|
+
</div>
|
|
33
|
+
${e?h`
|
|
34
|
+
<scb-button
|
|
35
|
+
id="${this._contentId}-button"
|
|
36
|
+
@click="${this.toggle}"
|
|
37
|
+
variant="text"
|
|
38
|
+
label="${this.expanded?this.collapseButtonLabel:this.expandButtonLabel}"
|
|
39
|
+
icon="${this.expanded?"keyboard_arrow_up":"keyboard_arrow_down"}"
|
|
40
|
+
aria-controls="${this._contentId}"
|
|
41
|
+
aria-expanded="${this.expanded?"true":"false"}"
|
|
42
|
+
>
|
|
43
|
+
</scb-button>
|
|
44
|
+
`:""}
|
|
45
|
+
`}}},u.styles=v`
|
|
46
|
+
:host {
|
|
47
|
+
display: block;
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
margin-block-start: var(--scb-collapse-spacing-block-start, 0);
|
|
50
|
+
margin-block-end: var(--scb-collapse-spacing-block-end, 0);
|
|
51
|
+
margin-inline-start: var(--scb-collapse-spacing-inline-start, 0);
|
|
52
|
+
margin-inline-end: var(--scb-collapse-spacing-inline-end, 0);
|
|
53
|
+
}
|
|
54
|
+
.collapse-content {
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
transition: max-height var(--motion-duration-medium) var(--motion-easing-standard);
|
|
57
|
+
}
|
|
58
|
+
.collapse-gradient-overlay {
|
|
59
|
+
position: absolute;
|
|
60
|
+
left: 0;
|
|
61
|
+
right: 0;
|
|
62
|
+
bottom: 0;
|
|
63
|
+
height: 48px;
|
|
64
|
+
pointer-events: none;
|
|
65
|
+
background: linear-gradient(180deg, rgba(255,255,255,0) 0%, var(--md-sys-color-surface) 100%);
|
|
66
|
+
z-index: 1;
|
|
67
|
+
}
|
|
68
|
+
.collapse-content {
|
|
69
|
+
position: relative;
|
|
70
|
+
}
|
|
71
|
+
scb-button {
|
|
72
|
+
margin-top: 8px;
|
|
73
|
+
}
|
|
74
|
+
::slotted(.scb-collapsed-hidden) {
|
|
75
|
+
max-height: 0 !important;
|
|
76
|
+
opacity: 0;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
transition: max-height var(--motion-duration-medium) var(--motion-easing-standard), opacity var(--motion-duration-medium) var(--motion-easing-standard);
|
|
79
|
+
pointer-events: none;
|
|
80
|
+
margin: 0 !important;
|
|
81
|
+
padding: 0 !important;
|
|
82
|
+
}
|
|
83
|
+
::slotted(*) {
|
|
84
|
+
max-height: 1000px;
|
|
85
|
+
transition: max-height var(--motion-duration-medium) var(--motion-easing-standard), opacity var(--motion-duration-medium) var(--motion-easing-standard);
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
display: block;
|
|
88
|
+
}
|
|
89
|
+
`,u);function b(){const l=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??l,e=this.mapSpacingToken(this.spacingBottom)??l,i=this.mapSpacingToken(this.spacingLeft),s=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-collapse-spacing-block-start",t):this.style.removeProperty("--scb-collapse-spacing-block-start"),e?this.style.setProperty("--scb-collapse-spacing-block-end",e):this.style.removeProperty("--scb-collapse-spacing-block-end"),i?this.style.setProperty("--scb-collapse-spacing-inline-start",i):this.style.removeProperty("--scb-collapse-spacing-inline-start"),s?this.style.setProperty("--scb-collapse-spacing-inline-end",s):this.style.removeProperty("--scb-collapse-spacing-inline-end")}function g(){const l=this.mapSpacingToken(this.itemsGap);l?this.style.setProperty("--scb-collapse-items-gap",l):this.style.removeProperty("--scb-collapse-items-gap");const t=this.shadowRoot?.querySelector("slot");t&&t.assignedNodes({flatten:!0}).filter(e=>e.nodeType===Node.ELEMENT_NODE).forEach((e,i)=>{const s=e;i===0||!l?s.style.removeProperty("margin-block-start"):s.style.setProperty("margin-block-start","var(--scb-collapse-items-gap)")})}n([a({type:String})],o.prototype,"variant",void 0);n([a({type:Number,attribute:"collapsed-height",reflect:!0})],o.prototype,"collapsedHeight",void 0);n([a({type:Number,attribute:"visible-elements",reflect:!0})],o.prototype,"visibleElements",void 0);n([a({type:Boolean,reflect:!0})],o.prototype,"expanded",void 0);n([a({type:String,attribute:"expand-button-label",reflect:!0})],o.prototype,"expandButtonLabel",void 0);n([a({type:String,attribute:"collapse-button-label",reflect:!0})],o.prototype,"collapseButtonLabel",void 0);n([a({type:String,reflect:!0})],o.prototype,"spacing",void 0);n([a({type:String,attribute:"spacing-top",reflect:!0})],o.prototype,"spacingTop",void 0);n([a({type:String,attribute:"spacing-bottom",reflect:!0})],o.prototype,"spacingBottom",void 0);n([a({type:String,attribute:"spacing-left",reflect:!0})],o.prototype,"spacingLeft",void 0);n([a({type:String,attribute:"spacing-right",reflect:!0})],o.prototype,"spacingRight",void 0);n([a({type:String,attribute:"items-gap",reflect:!0})],o.prototype,"itemsGap",void 0);o=n([y("scb-collapse")],o);
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import{_ as d,b as h,g as u,h as n,y as g}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as s}from"../../vendor/decorate.js";import"../scb-button/scb-button.js";(function(){try{var r=typeof globalThis<"u"?globalThis:window;if(!r.__scb_ce_guard_installed__){r.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,i,a){try{customElements.get(e)||t(e,i,a)}catch(l){var c=String(l||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var p,o=(p=class extends d{constructor(...t){super(...t),this.open=!0,this.autoRemove=!0,this.title="",this.supportingText="",this.ariaLabel="Cookie-inställningar",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._updateButtonWidth=()=>{const e=window.innerWidth<=480,i=this.shadowRoot.querySelector('slot[name="buttons"]');i&&i.assignedElements().forEach(a=>{e?a.setAttribute("full-width",""):a.removeAttribute("full-width")})}}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,a=this.mapSpacingToken(this.spacingLeft),c=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-cookies-consent-spacing-block-start",e):this.style.removeProperty("--scb-cookies-consent-spacing-block-start"),i?this.style.setProperty("--scb-cookies-consent-spacing-block-end",i):this.style.removeProperty("--scb-cookies-consent-spacing-block-end"),a?this.style.setProperty("--scb-cookies-consent-spacing-inline-start",a):this.style.removeProperty("--scb-cookies-consent-spacing-inline-start"),c?this.style.setProperty("--scb-cookies-consent-spacing-inline-end",c):this.style.removeProperty("--scb-cookies-consent-spacing-inline-end")}firstUpdated(t){this._updateButtonWidth(),window.addEventListener("resize",this._updateButtonWidth),this.addEventListener("click",e=>{const i=e.target;i.slot==="buttons"&&(i.id==="accept-btn"?this.closeAndRemove("cookies-accept"):i.id==="decline-btn"?this.closeAndRemove("cookies-decline"):i.id==="handle-btn"&&this.closeAndRemove("cookies-handle"))}),this.applySpacing()}updated(t){super.updated(t),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.applySpacing(),t.has("open")&&this.open&&this._updateButtonWidth()}connectedCallback(){super.connectedCallback(),this.id||(this.id="cookie-consent")}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._updateButtonWidth)}closeAndRemove(t){this.dispatchEvent(new CustomEvent(t));const e=t.includes("-")?t.replace(/-/g,""):"";e&&e!==t&&this.dispatchEvent(new CustomEvent(e)),this.autoRemove?this.remove():this.open=!1}render(){return this.open?g`
|
|
2
|
+
<div role="dialog" class="cookies-consent" aria-modal="true" aria-label=${this.ariaLabel}>
|
|
3
|
+
<h2>${this.title}</h2>
|
|
4
|
+
<div>
|
|
5
|
+
${this.supportingText}
|
|
6
|
+
</div>
|
|
7
|
+
<div class="button-container">
|
|
8
|
+
<slot name="buttons"></slot>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
`:null}},p.styles=h`
|
|
12
|
+
:host {
|
|
13
|
+
position: fixed;
|
|
14
|
+
width: 100%;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
bottom: 32px;
|
|
18
|
+
left: 32px;
|
|
19
|
+
background: #fff;
|
|
20
|
+
color: #222;
|
|
21
|
+
box-shadow: 0 8px 10px -6px #0000001a, 0 20px 25px -5px #0000001a;
|
|
22
|
+
color: var(--md-sys-color-on-surface, #0f0865);
|
|
23
|
+
background: var(--md-sys-color-surface, #fff);
|
|
24
|
+
border-radius: 16px;
|
|
25
|
+
padding: 36px 0;
|
|
26
|
+
z-index: 1000;
|
|
27
|
+
gap: 16px;
|
|
28
|
+
font-family: 'Inter', sans-serif;
|
|
29
|
+
|
|
30
|
+
margin-block-start: var(--scb-cookies-consent-spacing-block-start, 0);
|
|
31
|
+
margin-block-end: var(--scb-cookies-consent-spacing-block-end, 0);
|
|
32
|
+
margin-inline-start: var(--scb-cookies-consent-spacing-inline-start, 0);
|
|
33
|
+
margin-inline-end: var(--scb-cookies-consent-spacing-inline-end, 0);
|
|
34
|
+
}
|
|
35
|
+
.cookies-consent {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
gap: 16px;
|
|
39
|
+
padding: 0 20px;
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
margin: 0 auto;
|
|
42
|
+
max-width: 1440px;
|
|
43
|
+
position: relative;
|
|
44
|
+
width: 100%;
|
|
45
|
+
}
|
|
46
|
+
.cookies-consent h2 {
|
|
47
|
+
font-size: 16px;
|
|
48
|
+
line-height: 24px;
|
|
49
|
+
margin: 0;
|
|
50
|
+
hyphens: auto;
|
|
51
|
+
}
|
|
52
|
+
.button-container {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
gap: 8px;
|
|
56
|
+
justify-content: flex-start;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
::slotted{
|
|
60
|
+
md-filled-button {
|
|
61
|
+
width: 100%;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@media only screen and (min-width: 481px) {
|
|
66
|
+
:host {
|
|
67
|
+
width: auto;
|
|
68
|
+
max-width: 650px;
|
|
69
|
+
}
|
|
70
|
+
.button-container {
|
|
71
|
+
flex-direction: row;
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-wrap: wrap;
|
|
74
|
+
gap: 8px;
|
|
75
|
+
justify-content: flex-start;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
`,p);s([n({type:Boolean})],o.prototype,"open",void 0);s([n({type:Boolean,attribute:"auto-remove",converter:{fromAttribute:r=>r!=="false"}})],o.prototype,"autoRemove",void 0);s([n({type:String,reflect:!0})],o.prototype,"title",void 0);s([n({type:String,attribute:"supporting-text",reflect:!0})],o.prototype,"supportingText",void 0);s([n({type:String,attribute:"aria-label",reflect:!0})],o.prototype,"ariaLabel",void 0);s([n({type:String,reflect:!0})],o.prototype,"spacing",void 0);s([n({type:String,attribute:"spacing-top",reflect:!0})],o.prototype,"spacingTop",void 0);s([n({type:String,attribute:"spacing-bottom",reflect:!0})],o.prototype,"spacingBottom",void 0);s([n({type:String,attribute:"spacing-left",reflect:!0})],o.prototype,"spacingLeft",void 0);s([n({type:String,attribute:"spacing-right",reflect:!0})],o.prototype,"spacingRight",void 0);o=s([u("scb-cookies-consent")],o);
|