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,234 @@
|
|
|
1
|
+
import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.126.0/helpers/decorate.js";
|
|
2
|
+
import { LitElement as t, css as n, html as r } from "lit";
|
|
3
|
+
import { customElement as i, property as a } from "lit/decorators.js";
|
|
4
|
+
//#region src/scb-test-components/scb-chip/scb-chip.ts
|
|
5
|
+
var o = class extends t {
|
|
6
|
+
static {
|
|
7
|
+
this.formAssociated = !0;
|
|
8
|
+
}
|
|
9
|
+
constructor() {
|
|
10
|
+
super(), 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 = /* @__PURE__ */ new Set(), this.__chipSetLoaded = !1, this.__iconLoaded = !1, this._onFilterClick = (e) => {
|
|
11
|
+
if (this.disableToggle) {
|
|
12
|
+
let t = e.currentTarget;
|
|
13
|
+
t && (t.selected = this.selected), e.preventDefault();
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
this._toggleSelected();
|
|
17
|
+
}, "attachInternals" in this && (this._internals = this.attachInternals());
|
|
18
|
+
}
|
|
19
|
+
updated(e) {
|
|
20
|
+
super.updated(e), (e.has("variant") || e.has("icon")) && this.__ensureDepsLoaded(), e.has("disabled") && (this.toggleAttribute("aria-disabled", this.disabled), this.dispatchEvent(new CustomEvent("disabled-changed", {
|
|
21
|
+
detail: { disabled: this.disabled },
|
|
22
|
+
bubbles: !0,
|
|
23
|
+
composed: !0
|
|
24
|
+
}))), e.has("variant") && this.dispatchEvent(new CustomEvent("variant-changed", {
|
|
25
|
+
detail: { variant: this.variant },
|
|
26
|
+
bubbles: !0,
|
|
27
|
+
composed: !0
|
|
28
|
+
})), e.has("label") && this.dispatchEvent(new CustomEvent("label-changed", {
|
|
29
|
+
detail: { label: this.label },
|
|
30
|
+
bubbles: !0,
|
|
31
|
+
composed: !0
|
|
32
|
+
})), e.has("elevated") && this.dispatchEvent(new CustomEvent("elevated-changed", {
|
|
33
|
+
detail: { elevated: this.elevated },
|
|
34
|
+
bubbles: !0,
|
|
35
|
+
composed: !0
|
|
36
|
+
})), e.has("icon") && this.dispatchEvent(new CustomEvent("icon-changed", {
|
|
37
|
+
detail: { icon: this.icon },
|
|
38
|
+
bubbles: !0,
|
|
39
|
+
composed: !0
|
|
40
|
+
})), e.has("size") && this.dispatchEvent(new CustomEvent("size-changed", {
|
|
41
|
+
detail: { size: this.size },
|
|
42
|
+
bubbles: !0,
|
|
43
|
+
composed: !0
|
|
44
|
+
})), (e.has("selected") || e.has("disabled") || e.has("variant") || e.has("value") || e.has("name")) && this._updateFormValue(), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this.#e();
|
|
45
|
+
}
|
|
46
|
+
firstUpdated() {
|
|
47
|
+
this.__ensureDepsLoaded(), this.#e(), this._updateFormValue();
|
|
48
|
+
}
|
|
49
|
+
async __ensureDepsLoaded() {
|
|
50
|
+
if (!this.__loadedVariants.has(this.variant)) {
|
|
51
|
+
switch (this.variant) {
|
|
52
|
+
case "assist":
|
|
53
|
+
await import("@material/web/chips/assist-chip.js");
|
|
54
|
+
break;
|
|
55
|
+
case "filter":
|
|
56
|
+
await import("@material/web/chips/filter-chip.js");
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
this.__loadedVariants.add(this.variant);
|
|
60
|
+
}
|
|
61
|
+
!this._insideChipSet && !this.__chipSetLoaded && (await import("@material/web/chips/chip-set.js"), this.__chipSetLoaded = !0), this.icon && !this.__iconLoaded && (await import("@material/web/icon/icon.js"), this.__iconLoaded = !0);
|
|
62
|
+
}
|
|
63
|
+
static {
|
|
64
|
+
this.styles = n`
|
|
65
|
+
:host {
|
|
66
|
+
display: inline-block;
|
|
67
|
+
margin-block-start: var(--scb-chip-spacing-block-start, 0);
|
|
68
|
+
margin-block-end: var(--scb-chip-spacing-block-end, 0);
|
|
69
|
+
margin-inline-start: var(--scb-chip-spacing-inline-start, 0);
|
|
70
|
+
margin-inline-end: var(--scb-chip-spacing-inline-end, 0);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Sätt samma färg på label för assist som är på filter */
|
|
74
|
+
:host md-assist-chip {
|
|
75
|
+
--_label-text-color: var(--md-sys-color-on-surface-variant);
|
|
76
|
+
--_hover-label-text-color: var(--md-sys-color-on-surface-variant);
|
|
77
|
+
--_focus-label-text-color: var(--md-sys-color-on-surface-variant);
|
|
78
|
+
--_pressed-label-text-color: var(--md-sys-color-on-surface-variant);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Storlekar: små/medium/stora chips via tokens.
|
|
82
|
+
Medium (default) är Material-standardvärdena. */
|
|
83
|
+
:host([size='small']) md-assist-chip,
|
|
84
|
+
:host([size='small']) md-filter-chip {
|
|
85
|
+
--md-assist-chip-label-text-size: var(--md-sys-typescale-label-small-size);
|
|
86
|
+
--md-filter-chip-label-text-size: var(--md-sys-typescale-label-small-size);
|
|
87
|
+
}
|
|
88
|
+
:host([size='medium']) md-assist-chip,
|
|
89
|
+
:host([size='medium']) md-filter-chip {
|
|
90
|
+
--md-assist-chip-label-text-size: var(--md-sys-typescale-label-medium-size);
|
|
91
|
+
--md-filter-chip-label-text-size: var(--md-sys-typescale-label-medium-size);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([size='large']) md-assist-chip,
|
|
95
|
+
:host([size='large']) md-filter-chip {
|
|
96
|
+
--md-assist-chip-label-text-size: var(--md-sys-typescale-body-large-size);
|
|
97
|
+
--md-filter-chip-label-text-size: var(--md-sys-typescale-body-large-size);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* md-icon {
|
|
101
|
+
color: var(--md-sys-color-on-surface);
|
|
102
|
+
font-size: var(--md-sys-typescale-body-large-size);
|
|
103
|
+
} */
|
|
104
|
+
`;
|
|
105
|
+
}
|
|
106
|
+
get _insideChipSet() {
|
|
107
|
+
return !!this.closest("md-chip-set");
|
|
108
|
+
}
|
|
109
|
+
render() {
|
|
110
|
+
let e = this._renderChip();
|
|
111
|
+
return this._insideChipSet ? e : r`<md-chip-set>${e}</md-chip-set>`;
|
|
112
|
+
}
|
|
113
|
+
_renderChip() {
|
|
114
|
+
let e = this.icon ? r`<md-icon slot="icon">${this.icon}</md-icon>` : null;
|
|
115
|
+
switch (this.variant) {
|
|
116
|
+
case "assist": {
|
|
117
|
+
let t = this.target === "_blank" ? "noopener noreferrer" : void 0;
|
|
118
|
+
return r`
|
|
119
|
+
<md-assist-chip
|
|
120
|
+
label=${this.label}
|
|
121
|
+
?disabled=${this.disabled}
|
|
122
|
+
?elevated=${this.elevated}
|
|
123
|
+
href=${this.href || void 0}
|
|
124
|
+
target=${this.href && this.target || void 0}
|
|
125
|
+
rel=${t}
|
|
126
|
+
@update-focus=${this._forward}
|
|
127
|
+
>
|
|
128
|
+
${e}
|
|
129
|
+
</md-assist-chip>
|
|
130
|
+
`;
|
|
131
|
+
}
|
|
132
|
+
case "filter": return r`
|
|
133
|
+
<md-filter-chip
|
|
134
|
+
label=${this.label}
|
|
135
|
+
?disabled=${this.disabled}
|
|
136
|
+
?removable=${this.removable}
|
|
137
|
+
?selected=${this.selected}
|
|
138
|
+
@remove=${this._onRemove}
|
|
139
|
+
@update-focus=${this._forward}
|
|
140
|
+
@click=${this._onFilterClick}
|
|
141
|
+
>
|
|
142
|
+
${e}
|
|
143
|
+
</md-filter-chip>
|
|
144
|
+
`;
|
|
145
|
+
default: return r``;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
_toggleSelected() {
|
|
149
|
+
this.selected = !this.selected, this.dispatchEvent(new CustomEvent("selected-changed", {
|
|
150
|
+
detail: { selected: this.selected },
|
|
151
|
+
bubbles: !0,
|
|
152
|
+
composed: !0
|
|
153
|
+
})), this._updateFormValue();
|
|
154
|
+
}
|
|
155
|
+
_onRemove(e) {
|
|
156
|
+
e.stopPropagation(), this.dispatchEvent(new CustomEvent("remove", {
|
|
157
|
+
detail: { label: this.label },
|
|
158
|
+
bubbles: !0,
|
|
159
|
+
composed: !0
|
|
160
|
+
}));
|
|
161
|
+
}
|
|
162
|
+
_forward(e) {
|
|
163
|
+
this.dispatchEvent(new CustomEvent(e.type, {
|
|
164
|
+
detail: e.detail,
|
|
165
|
+
bubbles: !0,
|
|
166
|
+
composed: !0
|
|
167
|
+
}));
|
|
168
|
+
}
|
|
169
|
+
_updateFormValue() {
|
|
170
|
+
if (!this._internals) return;
|
|
171
|
+
if (!(this.variant === "filter" && this.selected && !this.disabled && this.name)) {
|
|
172
|
+
this._internals.setFormValue(null), this._internals.setValidity({});
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
let e = this.value || this.label || "";
|
|
176
|
+
this._internals.setFormValue(e, this.name), this._internals.setValidity({});
|
|
177
|
+
}
|
|
178
|
+
formDisabledCallback(e) {
|
|
179
|
+
this.disabled = e;
|
|
180
|
+
}
|
|
181
|
+
mapSpacingToken(e) {
|
|
182
|
+
if (!e) return;
|
|
183
|
+
let t = String(e).trim();
|
|
184
|
+
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
185
|
+
}
|
|
186
|
+
#e() {
|
|
187
|
+
let e = this.mapSpacingToken(this.spacing), t = this.mapSpacingToken(this.spacingTop), n = this.mapSpacingToken(this.spacingBottom), r = this.mapSpacingToken(this.spacingLeft), i = this.mapSpacingToken(this.spacingRight), a = t ?? e, o = n ?? e;
|
|
188
|
+
a ? this.style.setProperty("--scb-chip-spacing-block-start", a) : this.style.removeProperty("--scb-chip-spacing-block-start"), o ? this.style.setProperty("--scb-chip-spacing-block-end", o) : this.style.removeProperty("--scb-chip-spacing-block-end"), r ? this.style.setProperty("--scb-chip-spacing-inline-start", r) : this.style.removeProperty("--scb-chip-spacing-inline-start"), i ? this.style.setProperty("--scb-chip-spacing-inline-end", i) : this.style.removeProperty("--scb-chip-spacing-inline-end");
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
e([a({
|
|
192
|
+
type: String,
|
|
193
|
+
reflect: !0
|
|
194
|
+
})], o.prototype, "variant", void 0), e([a({ type: String })], o.prototype, "label", void 0), e([a({ type: String })], o.prototype, "icon", void 0), e([a({
|
|
195
|
+
type: Boolean,
|
|
196
|
+
reflect: !0
|
|
197
|
+
})], o.prototype, "disabled", void 0), e([a({
|
|
198
|
+
type: Boolean,
|
|
199
|
+
reflect: !0
|
|
200
|
+
})], o.prototype, "elevated", void 0), e([a({
|
|
201
|
+
type: Boolean,
|
|
202
|
+
reflect: !0
|
|
203
|
+
})], o.prototype, "removable", void 0), e([a({
|
|
204
|
+
type: Boolean,
|
|
205
|
+
reflect: !0
|
|
206
|
+
})], o.prototype, "selected", void 0), e([a({
|
|
207
|
+
type: Boolean,
|
|
208
|
+
reflect: !0,
|
|
209
|
+
attribute: "disable-toggle"
|
|
210
|
+
})], o.prototype, "disableToggle", void 0), e([a({ type: String })], o.prototype, "href", void 0), e([a({ type: String })], o.prototype, "target", void 0), e([a({ type: String })], o.prototype, "name", void 0), e([a({ type: String })], o.prototype, "value", void 0), e([a({
|
|
211
|
+
type: String,
|
|
212
|
+
reflect: !0
|
|
213
|
+
})], o.prototype, "spacing", void 0), e([a({
|
|
214
|
+
type: String,
|
|
215
|
+
reflect: !0,
|
|
216
|
+
attribute: "spacing-top"
|
|
217
|
+
})], o.prototype, "spacingTop", void 0), e([a({
|
|
218
|
+
type: String,
|
|
219
|
+
reflect: !0,
|
|
220
|
+
attribute: "spacing-bottom"
|
|
221
|
+
})], o.prototype, "spacingBottom", void 0), e([a({
|
|
222
|
+
type: String,
|
|
223
|
+
reflect: !0,
|
|
224
|
+
attribute: "spacing-left"
|
|
225
|
+
})], o.prototype, "spacingLeft", void 0), e([a({
|
|
226
|
+
type: String,
|
|
227
|
+
reflect: !0,
|
|
228
|
+
attribute: "spacing-right"
|
|
229
|
+
})], o.prototype, "spacingRight", void 0), e([a({
|
|
230
|
+
type: String,
|
|
231
|
+
reflect: !0
|
|
232
|
+
})], o.prototype, "size", void 0), o = e([i("scb-chip")], o);
|
|
233
|
+
//#endregion
|
|
234
|
+
export { o as ScbChip };
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.126.0/helpers/decorate.js";
|
|
2
|
+
import "../scb-button/scb-button.js";
|
|
3
|
+
import { LitElement as t, css as n, html as r } from "lit";
|
|
4
|
+
import { customElement as i, property as a } from "lit/decorators.js";
|
|
5
|
+
//#region src/scb-test-components/scb-collapse/scb-collapse.ts
|
|
6
|
+
var o = class extends t {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), 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;
|
|
9
|
+
}
|
|
10
|
+
get _regionLabel() {
|
|
11
|
+
return `${this.expanded ? this.collapseButtonLabel : this.expandButtonLabel} – ${this._contentId}`;
|
|
12
|
+
}
|
|
13
|
+
static {
|
|
14
|
+
this.styles = n`
|
|
15
|
+
:host {
|
|
16
|
+
display: block;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
margin-block-start: var(--scb-collapse-spacing-block-start, 0);
|
|
19
|
+
margin-block-end: var(--scb-collapse-spacing-block-end, 0);
|
|
20
|
+
margin-inline-start: var(--scb-collapse-spacing-inline-start, 0);
|
|
21
|
+
margin-inline-end: var(--scb-collapse-spacing-inline-end, 0);
|
|
22
|
+
}
|
|
23
|
+
.collapse-content {
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
transition: max-height var(--motion-duration-medium) var(--motion-easing-standard);
|
|
26
|
+
}
|
|
27
|
+
.collapse-gradient-overlay {
|
|
28
|
+
position: absolute;
|
|
29
|
+
left: 0;
|
|
30
|
+
right: 0;
|
|
31
|
+
bottom: 0;
|
|
32
|
+
height: 48px;
|
|
33
|
+
pointer-events: none;
|
|
34
|
+
background: linear-gradient(180deg, rgba(255,255,255,0) 0%, var(--md-sys-color-surface) 100%);
|
|
35
|
+
z-index: 1;
|
|
36
|
+
}
|
|
37
|
+
.collapse-content {
|
|
38
|
+
position: relative;
|
|
39
|
+
}
|
|
40
|
+
scb-button {
|
|
41
|
+
margin-top: 8px;
|
|
42
|
+
}
|
|
43
|
+
::slotted(.scb-collapsed-hidden) {
|
|
44
|
+
max-height: 0 !important;
|
|
45
|
+
opacity: 0;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
transition: max-height var(--motion-duration-medium) var(--motion-easing-standard), opacity var(--motion-duration-medium) var(--motion-easing-standard);
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
margin: 0 !important;
|
|
50
|
+
padding: 0 !important;
|
|
51
|
+
}
|
|
52
|
+
::slotted(*) {
|
|
53
|
+
max-height: 1000px;
|
|
54
|
+
transition: max-height var(--motion-duration-medium) var(--motion-easing-standard), opacity var(--motion-duration-medium) var(--motion-easing-standard);
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
display: block;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
}
|
|
60
|
+
toggle() {
|
|
61
|
+
this.expanded = !this.expanded;
|
|
62
|
+
}
|
|
63
|
+
mapSpacingToken(e) {
|
|
64
|
+
if (!e) return;
|
|
65
|
+
let t = String(e).trim();
|
|
66
|
+
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
67
|
+
}
|
|
68
|
+
#e() {
|
|
69
|
+
let e = this.mapSpacingToken(this.spacing), t = this.mapSpacingToken(this.spacingTop) ?? e, n = this.mapSpacingToken(this.spacingBottom) ?? e, r = this.mapSpacingToken(this.spacingLeft), i = this.mapSpacingToken(this.spacingRight);
|
|
70
|
+
t ? this.style.setProperty("--scb-collapse-spacing-block-start", t) : this.style.removeProperty("--scb-collapse-spacing-block-start"), n ? this.style.setProperty("--scb-collapse-spacing-block-end", n) : this.style.removeProperty("--scb-collapse-spacing-block-end"), r ? this.style.setProperty("--scb-collapse-spacing-inline-start", r) : this.style.removeProperty("--scb-collapse-spacing-inline-start"), i ? this.style.setProperty("--scb-collapse-spacing-inline-end", i) : this.style.removeProperty("--scb-collapse-spacing-inline-end");
|
|
71
|
+
}
|
|
72
|
+
#t() {
|
|
73
|
+
let e = this.mapSpacingToken(this.itemsGap);
|
|
74
|
+
e ? this.style.setProperty("--scb-collapse-items-gap", e) : this.style.removeProperty("--scb-collapse-items-gap");
|
|
75
|
+
let t = this.shadowRoot?.querySelector("slot");
|
|
76
|
+
t && t.assignedNodes({ flatten: !0 }).filter((e) => e.nodeType === Node.ELEMENT_NODE).forEach((t, n) => {
|
|
77
|
+
let r = t;
|
|
78
|
+
n === 0 || !e ? r.style.removeProperty("margin-block-start") : r.style.setProperty("margin-block-start", "var(--scb-collapse-items-gap)");
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
willUpdate(e) {
|
|
82
|
+
e.has("variant") && (this._measureContent(!1), this._countElements(!1));
|
|
83
|
+
}
|
|
84
|
+
firstUpdated() {
|
|
85
|
+
requestAnimationFrame(() => {
|
|
86
|
+
this._measureContent(), this._countElements();
|
|
87
|
+
});
|
|
88
|
+
let e = this.shadowRoot?.querySelector("slot");
|
|
89
|
+
e && e.addEventListener("slotchange", () => {
|
|
90
|
+
requestAnimationFrame(() => {
|
|
91
|
+
this._measureContent(), this._countElements(), this.#t();
|
|
92
|
+
});
|
|
93
|
+
}), this.#e(), this.#t();
|
|
94
|
+
}
|
|
95
|
+
updated(e) {
|
|
96
|
+
(e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this.#e(), e.has("itemsGap") && (this.#t(), this._measureContent()), e.has("expanded") && (this.#t(), this.dispatchEvent(new CustomEvent("expandedchange", {
|
|
97
|
+
detail: { expanded: this.expanded },
|
|
98
|
+
bubbles: !0,
|
|
99
|
+
composed: !0
|
|
100
|
+
})));
|
|
101
|
+
}
|
|
102
|
+
_measureContent(e = !0) {
|
|
103
|
+
if (this.variant === "height") {
|
|
104
|
+
let t = this.shadowRoot?.querySelector("slot");
|
|
105
|
+
if (t) {
|
|
106
|
+
let n = t.assignedNodes({ flatten: !0 }), r = 0;
|
|
107
|
+
n.forEach((e) => {
|
|
108
|
+
if (e.nodeType === Node.ELEMENT_NODE) {
|
|
109
|
+
let t = e;
|
|
110
|
+
r += t.offsetHeight || t.scrollHeight || 0;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
let i = r;
|
|
114
|
+
i !== this._contentHeight && (this._contentHeight = i, e && this.requestUpdate());
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
_countElements(e = !0) {
|
|
119
|
+
if (this.variant === "elements") {
|
|
120
|
+
let t = this.shadowRoot?.querySelector("slot");
|
|
121
|
+
if (t) {
|
|
122
|
+
let n = t.assignedNodes({ flatten: !0 }).filter((e) => e.nodeType === Node.ELEMENT_NODE).length;
|
|
123
|
+
n !== this._elementCount && (this._elementCount = n, e && this.requestUpdate());
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
render() {
|
|
128
|
+
if (this.variant === "height") {
|
|
129
|
+
let e = this.expanded ? `${this._contentHeight}px` : `${this.collapsedHeight}px`, t = this._contentHeight > this.collapsedHeight;
|
|
130
|
+
return r`
|
|
131
|
+
<div
|
|
132
|
+
class="collapse-content"
|
|
133
|
+
id="${this._contentId}"
|
|
134
|
+
style="max-height: ${e};"
|
|
135
|
+
role="region"
|
|
136
|
+
aria-label="${this._regionLabel}"
|
|
137
|
+
>
|
|
138
|
+
<slot></slot>
|
|
139
|
+
${t && !this.expanded ? r`<div class="collapse-gradient-overlay"></div>` : ""}
|
|
140
|
+
</div>
|
|
141
|
+
${t ? r`
|
|
142
|
+
<scb-button
|
|
143
|
+
id="${this._contentId}-button"
|
|
144
|
+
@click="${this.toggle}"
|
|
145
|
+
variant="text"
|
|
146
|
+
label="${this.expanded ? this.collapseButtonLabel : this.expandButtonLabel}"
|
|
147
|
+
icon="${this.expanded ? "keyboard_arrow_up" : "keyboard_arrow_down"}"
|
|
148
|
+
aria-controls="${this._contentId}"
|
|
149
|
+
aria-expanded="${this.expanded ? "true" : "false"}"
|
|
150
|
+
>
|
|
151
|
+
</scb-button>
|
|
152
|
+
` : ""}
|
|
153
|
+
`;
|
|
154
|
+
} else {
|
|
155
|
+
let e = typeof this.visibleElements == "string" ? parseInt(this.visibleElements, 10) : this.visibleElements, t = this._elementCount > e;
|
|
156
|
+
return setTimeout(() => {
|
|
157
|
+
let t = this.shadowRoot?.querySelector("slot");
|
|
158
|
+
t && t.assignedNodes({ flatten: !0 }).filter((e) => e.nodeType === Node.ELEMENT_NODE).forEach((t, n) => {
|
|
159
|
+
let r = t;
|
|
160
|
+
!this.expanded && n >= e ? r.classList.add("scb-collapsed-hidden") : r.classList.remove("scb-collapsed-hidden");
|
|
161
|
+
});
|
|
162
|
+
}, 0), r`
|
|
163
|
+
<div
|
|
164
|
+
class="collapse-content"
|
|
165
|
+
id="${this._contentId}"
|
|
166
|
+
role="region"
|
|
167
|
+
aria-label="${this._regionLabel}"
|
|
168
|
+
>
|
|
169
|
+
<slot></slot>
|
|
170
|
+
</div>
|
|
171
|
+
${t ? r`
|
|
172
|
+
<scb-button
|
|
173
|
+
id="${this._contentId}-button"
|
|
174
|
+
@click="${this.toggle}"
|
|
175
|
+
variant="text"
|
|
176
|
+
label="${this.expanded ? this.collapseButtonLabel : this.expandButtonLabel}"
|
|
177
|
+
icon="${this.expanded ? "keyboard_arrow_up" : "keyboard_arrow_down"}"
|
|
178
|
+
aria-controls="${this._contentId}"
|
|
179
|
+
aria-expanded="${this.expanded ? "true" : "false"}"
|
|
180
|
+
>
|
|
181
|
+
</scb-button>
|
|
182
|
+
` : ""}
|
|
183
|
+
`;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
e([a({ type: String })], o.prototype, "variant", void 0), e([a({
|
|
188
|
+
type: Number,
|
|
189
|
+
attribute: "collapsed-height",
|
|
190
|
+
reflect: !0
|
|
191
|
+
})], o.prototype, "collapsedHeight", void 0), e([a({
|
|
192
|
+
type: Number,
|
|
193
|
+
attribute: "visible-elements",
|
|
194
|
+
reflect: !0
|
|
195
|
+
})], o.prototype, "visibleElements", void 0), e([a({
|
|
196
|
+
type: Boolean,
|
|
197
|
+
reflect: !0
|
|
198
|
+
})], o.prototype, "expanded", void 0), e([a({
|
|
199
|
+
type: String,
|
|
200
|
+
attribute: "expand-button-label",
|
|
201
|
+
reflect: !0
|
|
202
|
+
})], o.prototype, "expandButtonLabel", void 0), e([a({
|
|
203
|
+
type: String,
|
|
204
|
+
attribute: "collapse-button-label",
|
|
205
|
+
reflect: !0
|
|
206
|
+
})], o.prototype, "collapseButtonLabel", void 0), e([a({
|
|
207
|
+
type: String,
|
|
208
|
+
reflect: !0
|
|
209
|
+
})], o.prototype, "spacing", void 0), e([a({
|
|
210
|
+
type: String,
|
|
211
|
+
attribute: "spacing-top",
|
|
212
|
+
reflect: !0
|
|
213
|
+
})], o.prototype, "spacingTop", void 0), e([a({
|
|
214
|
+
type: String,
|
|
215
|
+
attribute: "spacing-bottom",
|
|
216
|
+
reflect: !0
|
|
217
|
+
})], o.prototype, "spacingBottom", void 0), e([a({
|
|
218
|
+
type: String,
|
|
219
|
+
attribute: "spacing-left",
|
|
220
|
+
reflect: !0
|
|
221
|
+
})], o.prototype, "spacingLeft", void 0), e([a({
|
|
222
|
+
type: String,
|
|
223
|
+
attribute: "spacing-right",
|
|
224
|
+
reflect: !0
|
|
225
|
+
})], o.prototype, "spacingRight", void 0), e([a({
|
|
226
|
+
type: String,
|
|
227
|
+
attribute: "items-gap",
|
|
228
|
+
reflect: !0
|
|
229
|
+
})], o.prototype, "itemsGap", void 0), o = e([i("scb-collapse")], o);
|
|
230
|
+
//#endregion
|
|
231
|
+
export { o as ScbCollapse };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.126.0/helpers/decorate.js";
|
|
2
|
+
import "../scb-button/scb-button.js";
|
|
3
|
+
import { LitElement as t, css as n, html as r } from "lit";
|
|
4
|
+
import { customElement as i, property as a } from "lit/decorators.js";
|
|
5
|
+
//#region src/scb-test-components/scb-cookies-consent/scb-cookies-consent.ts
|
|
6
|
+
var o = class extends t {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), 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 = () => {
|
|
9
|
+
let e = window.innerWidth <= 480, t = this.shadowRoot.querySelector("slot[name=\"buttons\"]");
|
|
10
|
+
t && t.assignedElements().forEach((t) => {
|
|
11
|
+
e ? t.setAttribute("full-width", "") : t.removeAttribute("full-width");
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
static {
|
|
16
|
+
this.styles = n`
|
|
17
|
+
:host {
|
|
18
|
+
position: fixed;
|
|
19
|
+
width: 100%;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
bottom: 32px;
|
|
23
|
+
left: 32px;
|
|
24
|
+
background: #fff;
|
|
25
|
+
color: #222;
|
|
26
|
+
box-shadow: 0 8px 10px -6px #0000001a, 0 20px 25px -5px #0000001a;
|
|
27
|
+
color: var(--md-sys-color-on-surface, #0f0865);
|
|
28
|
+
background: var(--md-sys-color-surface, #fff);
|
|
29
|
+
border-radius: 16px;
|
|
30
|
+
padding: 36px 0;
|
|
31
|
+
z-index: 1000;
|
|
32
|
+
gap: 16px;
|
|
33
|
+
font-family: 'Inter', sans-serif;
|
|
34
|
+
|
|
35
|
+
margin-block-start: var(--scb-cookies-consent-spacing-block-start, 0);
|
|
36
|
+
margin-block-end: var(--scb-cookies-consent-spacing-block-end, 0);
|
|
37
|
+
margin-inline-start: var(--scb-cookies-consent-spacing-inline-start, 0);
|
|
38
|
+
margin-inline-end: var(--scb-cookies-consent-spacing-inline-end, 0);
|
|
39
|
+
}
|
|
40
|
+
.cookies-consent {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
gap: 16px;
|
|
44
|
+
padding: 0 20px;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
margin: 0 auto;
|
|
47
|
+
max-width: 1440px;
|
|
48
|
+
position: relative;
|
|
49
|
+
width: 100%;
|
|
50
|
+
}
|
|
51
|
+
.cookies-consent h2 {
|
|
52
|
+
font-size: 16px;
|
|
53
|
+
line-height: 24px;
|
|
54
|
+
margin: 0;
|
|
55
|
+
hyphens: auto;
|
|
56
|
+
}
|
|
57
|
+
.button-container {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
gap: 8px;
|
|
61
|
+
justify-content: flex-start;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
::slotted{
|
|
65
|
+
md-filled-button {
|
|
66
|
+
width: 100%;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@media only screen and (min-width: 481px) {
|
|
71
|
+
:host {
|
|
72
|
+
width: auto;
|
|
73
|
+
max-width: 650px;
|
|
74
|
+
}
|
|
75
|
+
.button-container {
|
|
76
|
+
flex-direction: row;
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
gap: 8px;
|
|
80
|
+
justify-content: flex-start;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
}
|
|
85
|
+
mapSpacingToken(e) {
|
|
86
|
+
if (!e) return;
|
|
87
|
+
let t = String(e).trim();
|
|
88
|
+
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
89
|
+
}
|
|
90
|
+
applySpacing() {
|
|
91
|
+
let e = this.mapSpacingToken(this.spacing), t = this.mapSpacingToken(this.spacingTop) ?? e, n = this.mapSpacingToken(this.spacingBottom) ?? e, r = this.mapSpacingToken(this.spacingLeft), i = this.mapSpacingToken(this.spacingRight);
|
|
92
|
+
t ? this.style.setProperty("--scb-cookies-consent-spacing-block-start", t) : this.style.removeProperty("--scb-cookies-consent-spacing-block-start"), n ? this.style.setProperty("--scb-cookies-consent-spacing-block-end", n) : this.style.removeProperty("--scb-cookies-consent-spacing-block-end"), r ? this.style.setProperty("--scb-cookies-consent-spacing-inline-start", r) : this.style.removeProperty("--scb-cookies-consent-spacing-inline-start"), i ? this.style.setProperty("--scb-cookies-consent-spacing-inline-end", i) : this.style.removeProperty("--scb-cookies-consent-spacing-inline-end");
|
|
93
|
+
}
|
|
94
|
+
firstUpdated(e) {
|
|
95
|
+
this._updateButtonWidth(), window.addEventListener("resize", this._updateButtonWidth), this.addEventListener("click", (e) => {
|
|
96
|
+
let t = e.target;
|
|
97
|
+
t.slot === "buttons" && (t.id === "accept-btn" ? this.closeAndRemove("cookies-accept") : t.id === "decline-btn" ? this.closeAndRemove("cookies-decline") : t.id === "handle-btn" && this.closeAndRemove("cookies-handle"));
|
|
98
|
+
}), this.applySpacing();
|
|
99
|
+
}
|
|
100
|
+
updated(e) {
|
|
101
|
+
super.updated(e), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this.applySpacing(), e.has("open") && this.open && this._updateButtonWidth();
|
|
102
|
+
}
|
|
103
|
+
connectedCallback() {
|
|
104
|
+
super.connectedCallback(), this.id ||= "cookie-consent";
|
|
105
|
+
}
|
|
106
|
+
disconnectedCallback() {
|
|
107
|
+
super.disconnectedCallback(), window.removeEventListener("resize", this._updateButtonWidth);
|
|
108
|
+
}
|
|
109
|
+
closeAndRemove(e) {
|
|
110
|
+
this.dispatchEvent(new CustomEvent(e));
|
|
111
|
+
let t = e.includes("-") ? e.replace(/-/g, "") : "";
|
|
112
|
+
t && t !== e && this.dispatchEvent(new CustomEvent(t)), this.autoRemove ? this.remove() : this.open = !1;
|
|
113
|
+
}
|
|
114
|
+
render() {
|
|
115
|
+
return this.open ? r`
|
|
116
|
+
<div role="dialog" class="cookies-consent" aria-modal="true" aria-label=${this.ariaLabel}>
|
|
117
|
+
<h2>${this.title}</h2>
|
|
118
|
+
<div>
|
|
119
|
+
${this.supportingText}
|
|
120
|
+
</div>
|
|
121
|
+
<div class="button-container">
|
|
122
|
+
<slot name="buttons"></slot>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
` : null;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
e([a({ type: Boolean })], o.prototype, "open", void 0), e([a({
|
|
129
|
+
type: Boolean,
|
|
130
|
+
attribute: "auto-remove",
|
|
131
|
+
converter: { fromAttribute: (e) => e !== "false" }
|
|
132
|
+
})], o.prototype, "autoRemove", void 0), e([a({
|
|
133
|
+
type: String,
|
|
134
|
+
reflect: !0
|
|
135
|
+
})], o.prototype, "title", void 0), e([a({
|
|
136
|
+
type: String,
|
|
137
|
+
attribute: "supporting-text",
|
|
138
|
+
reflect: !0
|
|
139
|
+
})], o.prototype, "supportingText", void 0), e([a({
|
|
140
|
+
type: String,
|
|
141
|
+
attribute: "aria-label",
|
|
142
|
+
reflect: !0
|
|
143
|
+
})], o.prototype, "ariaLabel", void 0), e([a({
|
|
144
|
+
type: String,
|
|
145
|
+
reflect: !0
|
|
146
|
+
})], o.prototype, "spacing", void 0), e([a({
|
|
147
|
+
type: String,
|
|
148
|
+
attribute: "spacing-top",
|
|
149
|
+
reflect: !0
|
|
150
|
+
})], o.prototype, "spacingTop", void 0), e([a({
|
|
151
|
+
type: String,
|
|
152
|
+
attribute: "spacing-bottom",
|
|
153
|
+
reflect: !0
|
|
154
|
+
})], o.prototype, "spacingBottom", void 0), e([a({
|
|
155
|
+
type: String,
|
|
156
|
+
attribute: "spacing-left",
|
|
157
|
+
reflect: !0
|
|
158
|
+
})], o.prototype, "spacingLeft", void 0), e([a({
|
|
159
|
+
type: String,
|
|
160
|
+
attribute: "spacing-right",
|
|
161
|
+
reflect: !0
|
|
162
|
+
})], o.prototype, "spacingRight", void 0), o = e([i("scb-cookies-consent")], o);
|
|
163
|
+
//#endregion
|
|
164
|
+
export { o as ScbCookiesConsent };
|