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,353 @@
|
|
|
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 "../scb-icon-button/scb-icon-button.js";
|
|
4
|
+
import { LitElement as t, css as n, html as r } from "lit";
|
|
5
|
+
import { customElement as i, property as a, state as o } from "lit/decorators.js";
|
|
6
|
+
import "@material/web/focus/md-focus-ring.js";
|
|
7
|
+
//#region src/scb-test-components/scb-horizontal-scroller/scb-horizontal-scroller.ts
|
|
8
|
+
var s = class extends t {
|
|
9
|
+
constructor(...e) {
|
|
10
|
+
super(...e), this.variant = "standard", this.width = "100%", this.showScrollbar = !1, this.rightScrollButtonLabel = "Scrolla höger", this.leftScrollButtonLabel = "Scrolla vänster", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this.contentFlex = !1, this.internalGap = "", this._canScrollLeft = !1, this._canScrollRight = !1, this.updateScrollButtons = () => {
|
|
11
|
+
let e = this.scrollerEl || this.shadowRoot?.querySelector(".scb-horizontal-scroller");
|
|
12
|
+
if (!e) {
|
|
13
|
+
this._canScrollLeft &&= !1, this._canScrollRight &&= !1, this.removeAttribute("data-scroll-left"), this.removeAttribute("data-scroll-right");
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
let t = e.scrollLeft > 0, n = e.scrollLeft + e.clientWidth < e.scrollWidth - 1;
|
|
17
|
+
this._canScrollLeft !== t && (this._canScrollLeft = t), this._canScrollRight !== n && (this._canScrollRight = n), t ? this.setAttribute("data-scroll-left", "") : this.removeAttribute("data-scroll-left"), n ? this.setAttribute("data-scroll-right", "") : this.removeAttribute("data-scroll-right");
|
|
18
|
+
}, this.lastScrollLeft = 0, this.isScrolling = !1, this.scrollEndTimeout = null, this.scrollerEl = null, this.slotEl = null, this.sizeObserver = null, this.resizeRaf = null, this.handleScroll = () => {
|
|
19
|
+
let e = this.shadowRoot?.querySelector(".scb-horizontal-scroller");
|
|
20
|
+
e && (this.updateScrollButtons(), this.dispatchCustomEventWithAlias("scb-scroll", { scrollLeft: e.scrollLeft }), this.isScrolling || (this.isScrolling = !0, this.dispatchCustomEventWithAlias("scb-scroll-start", { scrollLeft: e.scrollLeft })), clearTimeout(this.scrollEndTimeout), this.scrollEndTimeout = setTimeout(() => {
|
|
21
|
+
this.isScrolling = !1, this.dispatchCustomEventWithAlias("scb-scroll-end", { scrollLeft: e.scrollLeft });
|
|
22
|
+
}, 120), e.scrollLeft > this.lastScrollLeft ? this.dispatchCustomEventWithAlias("scb-scroll-right", { scrollLeft: e.scrollLeft }) : e.scrollLeft < this.lastScrollLeft && this.dispatchCustomEventWithAlias("scb-scroll-left", { scrollLeft: e.scrollLeft }), this.lastScrollLeft = e.scrollLeft);
|
|
23
|
+
}, this.handleWheel = (e) => {
|
|
24
|
+
let t = this.scrollerEl || this.shadowRoot?.querySelector(".scb-horizontal-scroller");
|
|
25
|
+
if (!t || e.deltaY === 0) return;
|
|
26
|
+
let n = t.scrollLeft, r = n > 0, i = n + t.clientWidth < t.scrollWidth - 1;
|
|
27
|
+
!r && !i || (t.scrollLeft += e.deltaY, t.scrollLeft !== n && e.preventDefault());
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
static {
|
|
31
|
+
this.styles = n`
|
|
32
|
+
:host {
|
|
33
|
+
display: flex;
|
|
34
|
+
position: relative;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: var(--spacing-3);
|
|
37
|
+
padding: 0;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
margin-block-start: var(--scb-horizontal-scroller-spacing-block-start, 0);
|
|
40
|
+
margin-block-end: var(--scb-horizontal-scroller-spacing-block-end, 0);
|
|
41
|
+
margin-inline-start: var(--scb-horizontal-scroller-spacing-inline-start, 0);
|
|
42
|
+
margin-inline-end: var(--scb-horizontal-scroller-spacing-inline-end, 0);
|
|
43
|
+
}
|
|
44
|
+
.scb-horizontal-scroller {
|
|
45
|
+
overflow-x: auto;
|
|
46
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
47
|
+
scrollbar-width: none;
|
|
48
|
+
width: 100%;
|
|
49
|
+
}
|
|
50
|
+
:host([show-scrollbar]) .scb-horizontal-scroller {
|
|
51
|
+
scrollbar-width: auto;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host([content-flex]) .scb-horizontal-scroller {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: row;
|
|
57
|
+
flex: 1 1 auto;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.scb-horizontal-scroller::-webkit-scrollbar {
|
|
61
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
62
|
+
height: 4px;
|
|
63
|
+
width: 10px;
|
|
64
|
+
}
|
|
65
|
+
.scb-horizontal-scroller::-webkit-scrollbar-thumb {
|
|
66
|
+
background: var(--md-sys-color-on-surface);
|
|
67
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
}
|
|
70
|
+
.scb-horizontal-scroller::-webkit-scrollbar-track {
|
|
71
|
+
background: var(--md-sys-color-secondary-container);
|
|
72
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
73
|
+
}
|
|
74
|
+
.scb-horizontal-scroller:focus {
|
|
75
|
+
outline: none;
|
|
76
|
+
}
|
|
77
|
+
md-focus-ring {
|
|
78
|
+
border-radius: var(--scb-card-focus-ring-radius, var(--md-sys-shape-corner-large));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host([show-scrollbar]) .scb-horizontal-scroller.canScroll {
|
|
82
|
+
padding-bottom: var(--spacing-5);
|
|
83
|
+
}
|
|
84
|
+
slot {
|
|
85
|
+
display: block;
|
|
86
|
+
box-sizing: border-box;
|
|
87
|
+
padding-block: var(--spacing-3);
|
|
88
|
+
padding-inline: 2px;
|
|
89
|
+
min-width: var(--scb-horizontal-scroller-width, auto);
|
|
90
|
+
}
|
|
91
|
+
:host([content-flex]) .scb-horizontal-scroller slot {
|
|
92
|
+
display: flex;
|
|
93
|
+
gap: var(--scb-horizontal-scroller-internal-gap);
|
|
94
|
+
}
|
|
95
|
+
.scroll-button-left {
|
|
96
|
+
left: 0px;
|
|
97
|
+
position: absolute;
|
|
98
|
+
z-index: 3;
|
|
99
|
+
}
|
|
100
|
+
.scroll-button-right {
|
|
101
|
+
right: 2px;
|
|
102
|
+
position: absolute;
|
|
103
|
+
z-index: 3;
|
|
104
|
+
}
|
|
105
|
+
.scroll-shadow-left,
|
|
106
|
+
.scroll-shadow-right {
|
|
107
|
+
position: absolute;
|
|
108
|
+
top: 0;
|
|
109
|
+
width: 5px;
|
|
110
|
+
bottom: 0;
|
|
111
|
+
pointer-events: none;
|
|
112
|
+
background: none;
|
|
113
|
+
box-shadow: none;
|
|
114
|
+
transition: box-shadow 0.2s;
|
|
115
|
+
z-index: 2;
|
|
116
|
+
}
|
|
117
|
+
.scroll-shadow-left {
|
|
118
|
+
left: 0;
|
|
119
|
+
}
|
|
120
|
+
.scroll-shadow-right {
|
|
121
|
+
right: 0;
|
|
122
|
+
}
|
|
123
|
+
:host([data-scroll-left]) .scroll-shadow-left {
|
|
124
|
+
background: var(--md-sys-color-surface-container-lowest);
|
|
125
|
+
box-shadow:
|
|
126
|
+
12px 0 30px rgba(0, 0, 0, 0.24),
|
|
127
|
+
4px 0 12px rgba(78, 5, 5, 0.14);
|
|
128
|
+
}
|
|
129
|
+
:host([data-scroll-left]) .scroll-shadow-left::after {
|
|
130
|
+
content: '';
|
|
131
|
+
position: absolute;
|
|
132
|
+
inset-block: 0;
|
|
133
|
+
}
|
|
134
|
+
:host([data-scroll-right]) .scroll-shadow-right {
|
|
135
|
+
background: var(--md-sys-color-surface-container-lowest);
|
|
136
|
+
box-shadow:
|
|
137
|
+
-12px 0 30px rgba(0, 0, 0, 0.24),
|
|
138
|
+
-4px 0 12px rgba(0, 0, 0, 0.14);
|
|
139
|
+
}
|
|
140
|
+
:host([data-scroll-right]) .scroll-shadow-right::after {
|
|
141
|
+
content: '';
|
|
142
|
+
position: absolute;
|
|
143
|
+
inset-block: 0;
|
|
144
|
+
}
|
|
145
|
+
:host([variant='inline']) {
|
|
146
|
+
flex-direction: column;
|
|
147
|
+
align-items: unset;
|
|
148
|
+
padding: 0;
|
|
149
|
+
.scroll-buttons {
|
|
150
|
+
display: flex;
|
|
151
|
+
gap: var(--spacing-3);
|
|
152
|
+
}
|
|
153
|
+
.scroll-button-right {
|
|
154
|
+
position: relative;
|
|
155
|
+
right: unset;
|
|
156
|
+
z-index: auto;
|
|
157
|
+
margin-left: auto;
|
|
158
|
+
}
|
|
159
|
+
.scroll-button-left {
|
|
160
|
+
position: relative;
|
|
161
|
+
left: unset;
|
|
162
|
+
z-index: auto;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
:host([variant='inline'][show-scrollbar]) {
|
|
166
|
+
gap: var(--spacing-5);
|
|
167
|
+
}
|
|
168
|
+
`;
|
|
169
|
+
}
|
|
170
|
+
getScrollStep() {
|
|
171
|
+
let e = this.scrollerEl || this.shadowRoot?.querySelector(".scb-horizontal-scroller");
|
|
172
|
+
return e ? Math.max(Math.round(e.clientWidth * .8), 120) : 200;
|
|
173
|
+
}
|
|
174
|
+
doScrollBy(e) {
|
|
175
|
+
let t = this.shadowRoot?.querySelector(".scb-horizontal-scroller");
|
|
176
|
+
t && t.scrollBy({
|
|
177
|
+
left: e,
|
|
178
|
+
behavior: "smooth"
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
connectedCallback() {
|
|
182
|
+
super.connectedCallback(), this.style.setProperty("--scb-horizontal-scroller-width", this.width);
|
|
183
|
+
}
|
|
184
|
+
disconnectedCallback() {
|
|
185
|
+
super.disconnectedCallback(), this.scrollerEl && (this.scrollerEl.removeEventListener("scroll", this.handleScroll), this.scrollerEl.removeEventListener("wheel", this.handleWheel)), this.sizeObserver &&= (this.sizeObserver.disconnect(), null), this.resizeRaf !== null && (cancelAnimationFrame(this.resizeRaf), this.resizeRaf = null), this.scrollEndTimeout &&= (clearTimeout(this.scrollEndTimeout), null), this.scrollerEl = null, this.slotEl = null;
|
|
186
|
+
}
|
|
187
|
+
dispatchCustomEvent(e, t = {}) {
|
|
188
|
+
this.dispatchEvent(new CustomEvent(e, {
|
|
189
|
+
detail: t,
|
|
190
|
+
bubbles: !0,
|
|
191
|
+
composed: !0
|
|
192
|
+
}));
|
|
193
|
+
}
|
|
194
|
+
dispatchCustomEventWithAlias(e, t = {}) {
|
|
195
|
+
if (this.dispatchCustomEvent(e, t), e.includes("-")) {
|
|
196
|
+
let n = e.replace(/-/g, "");
|
|
197
|
+
this.dispatchCustomEvent(n, t);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
firstUpdated() {
|
|
201
|
+
this.scrollerEl = this.shadowRoot?.querySelector(".scb-horizontal-scroller"), this.slotEl = this.shadowRoot?.querySelector("slot");
|
|
202
|
+
let e = this.shadowRoot?.querySelector(".scroll-shadow-left"), t = this.shadowRoot?.querySelector(".scroll-shadow-right");
|
|
203
|
+
this.scrollerEl && (this.scrollerEl.addEventListener("scroll", this.handleScroll), this.scrollerEl.addEventListener("wheel", this.handleWheel, { passive: !1 }));
|
|
204
|
+
let n = () => {
|
|
205
|
+
if (this.slotEl && e && t) {
|
|
206
|
+
let n = this.slotEl.getBoundingClientRect();
|
|
207
|
+
e.style.height = `${n.height}px`, t.style.height = `${n.height}px`;
|
|
208
|
+
}
|
|
209
|
+
}, r = () => {
|
|
210
|
+
n(), this.updateScrollButtons();
|
|
211
|
+
}, i = () => {
|
|
212
|
+
this.resizeRaf === null && (this.resizeRaf = requestAnimationFrame(() => {
|
|
213
|
+
this.resizeRaf = null, r();
|
|
214
|
+
}));
|
|
215
|
+
};
|
|
216
|
+
requestAnimationFrame(() => {
|
|
217
|
+
r();
|
|
218
|
+
}), this.slotEl && this.slotEl.addEventListener("slotchange", () => {
|
|
219
|
+
i();
|
|
220
|
+
}), this.sizeObserver = new ResizeObserver(() => {
|
|
221
|
+
i();
|
|
222
|
+
}), this.scrollerEl && this.sizeObserver.observe(this.scrollerEl), this.slotEl && this.sizeObserver.observe(this.slotEl), this.#e(), this.#t();
|
|
223
|
+
}
|
|
224
|
+
updated(e) {
|
|
225
|
+
e.has("width") && this.style.setProperty("--scb-horizontal-scroller-width", this.width), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this.#e(), (e.has("internalGap") || e.has("contentFlex")) && this.#t();
|
|
226
|
+
}
|
|
227
|
+
mapSpacingToken(e) {
|
|
228
|
+
if (!e) return;
|
|
229
|
+
let t = String(e).trim();
|
|
230
|
+
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
231
|
+
}
|
|
232
|
+
#e() {
|
|
233
|
+
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;
|
|
234
|
+
a ? this.style.setProperty("--scb-horizontal-scroller-spacing-block-start", a) : this.style.removeProperty("--scb-horizontal-scroller-spacing-block-start"), o ? this.style.setProperty("--scb-horizontal-scroller-spacing-block-end", o) : this.style.removeProperty("--scb-horizontal-scroller-spacing-block-end"), r ? this.style.setProperty("--scb-horizontal-scroller-spacing-inline-start", r) : this.style.removeProperty("--scb-horizontal-scroller-spacing-inline-start"), i ? this.style.setProperty("--scb-horizontal-scroller-spacing-inline-end", i) : this.style.removeProperty("--scb-horizontal-scroller-spacing-inline-end");
|
|
235
|
+
}
|
|
236
|
+
#t() {
|
|
237
|
+
let e = this.mapSpacingToken(this.internalGap);
|
|
238
|
+
this.contentFlex && e ? this.style.setProperty("--scb-horizontal-scroller-internal-gap", e) : this.style.removeProperty("--scb-horizontal-scroller-internal-gap");
|
|
239
|
+
}
|
|
240
|
+
render() {
|
|
241
|
+
let e = this.variant, t = this._canScrollLeft || this._canScrollRight;
|
|
242
|
+
switch (e) {
|
|
243
|
+
case "inline": return r`
|
|
244
|
+
<div class="scb-horizontal-scroller ${t ? "canScroll" : ""}" tabindex="0">
|
|
245
|
+
${this.variant == "inline" ? "" : r`<div class="scroll-shadow-left"></div>`}
|
|
246
|
+
<slot></slot>
|
|
247
|
+
<md-focus-ring inward></md-focus-ring>
|
|
248
|
+
${this.variant == "inline" ? "" : r`<div class="scroll-shadow-right"></div>`}
|
|
249
|
+
</div>
|
|
250
|
+
${t ? r`
|
|
251
|
+
<div class="scroll-buttons">
|
|
252
|
+
${this._canScrollLeft ? r`
|
|
253
|
+
<scb-button
|
|
254
|
+
class="scroll-button-left"
|
|
255
|
+
variant="text"
|
|
256
|
+
label="${this.leftScrollButtonLabel}"
|
|
257
|
+
aria-label="Scrolla vänster"
|
|
258
|
+
icon="chevron_left"
|
|
259
|
+
@click="${() => this.doScrollBy(-this.getScrollStep())}"
|
|
260
|
+
></scb-button>
|
|
261
|
+
` : ""}
|
|
262
|
+
|
|
263
|
+
${this._canScrollRight ? r`
|
|
264
|
+
<scb-button
|
|
265
|
+
class="scroll-button-right"
|
|
266
|
+
variant="text"
|
|
267
|
+
label="${this.rightScrollButtonLabel}"
|
|
268
|
+
aria-label="Scrolla höger"
|
|
269
|
+
icon="chevron_right"
|
|
270
|
+
trailing-icon
|
|
271
|
+
@click="${() => this.doScrollBy(this.getScrollStep())}"
|
|
272
|
+
></scb-button>
|
|
273
|
+
` : ""}
|
|
274
|
+
</div>
|
|
275
|
+
` : ""}
|
|
276
|
+
`;
|
|
277
|
+
default: return r`
|
|
278
|
+
${this._canScrollLeft ? r`
|
|
279
|
+
<scb-icon-button
|
|
280
|
+
class="scroll-button-left"
|
|
281
|
+
icon="chevron_left"
|
|
282
|
+
aria-label="Scrolla vänster"
|
|
283
|
+
variant="filled-tonal"
|
|
284
|
+
@click="${() => this.doScrollBy(-this.getScrollStep())}"
|
|
285
|
+
></scb-icon-button>
|
|
286
|
+
` : ""}
|
|
287
|
+
<div class="scroll-shadow-left"></div>
|
|
288
|
+
<div class="scb-horizontal-scroller ${t ? "canScroll" : ""}">
|
|
289
|
+
<slot></slot>
|
|
290
|
+
<md-focus-ring inward></md-focus-ring>
|
|
291
|
+
</div>
|
|
292
|
+
<div class="scroll-shadow-right"></div>
|
|
293
|
+
${this._canScrollRight ? r`
|
|
294
|
+
<scb-icon-button
|
|
295
|
+
class="scroll-button-right"
|
|
296
|
+
icon="chevron_right"
|
|
297
|
+
aria-label="Scrolla höger"
|
|
298
|
+
variant="filled-tonal"
|
|
299
|
+
@click="${() => this.doScrollBy(this.getScrollStep())}"
|
|
300
|
+
></scb-icon-button>
|
|
301
|
+
` : ""}
|
|
302
|
+
`;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
e([a({
|
|
307
|
+
type: String,
|
|
308
|
+
reflect: !0
|
|
309
|
+
})], s.prototype, "variant", void 0), e([a({
|
|
310
|
+
type: String,
|
|
311
|
+
reflect: !0
|
|
312
|
+
})], s.prototype, "width", void 0), e([a({
|
|
313
|
+
type: Boolean,
|
|
314
|
+
reflect: !0,
|
|
315
|
+
attribute: "show-scrollbar"
|
|
316
|
+
})], s.prototype, "showScrollbar", void 0), e([a({
|
|
317
|
+
type: String,
|
|
318
|
+
reflect: !0,
|
|
319
|
+
attribute: "right-scroll-button-label"
|
|
320
|
+
})], s.prototype, "rightScrollButtonLabel", void 0), e([a({
|
|
321
|
+
type: String,
|
|
322
|
+
reflect: !0,
|
|
323
|
+
attribute: "left-scroll-button-label"
|
|
324
|
+
})], s.prototype, "leftScrollButtonLabel", void 0), e([a({
|
|
325
|
+
type: String,
|
|
326
|
+
reflect: !0
|
|
327
|
+
})], s.prototype, "spacing", void 0), e([a({
|
|
328
|
+
type: String,
|
|
329
|
+
reflect: !0,
|
|
330
|
+
attribute: "spacing-top"
|
|
331
|
+
})], s.prototype, "spacingTop", void 0), e([a({
|
|
332
|
+
type: String,
|
|
333
|
+
reflect: !0,
|
|
334
|
+
attribute: "spacing-bottom"
|
|
335
|
+
})], s.prototype, "spacingBottom", void 0), e([a({
|
|
336
|
+
type: String,
|
|
337
|
+
reflect: !0,
|
|
338
|
+
attribute: "spacing-left"
|
|
339
|
+
})], s.prototype, "spacingLeft", void 0), e([a({
|
|
340
|
+
type: String,
|
|
341
|
+
reflect: !0,
|
|
342
|
+
attribute: "spacing-right"
|
|
343
|
+
})], s.prototype, "spacingRight", void 0), e([a({
|
|
344
|
+
type: Boolean,
|
|
345
|
+
reflect: !0,
|
|
346
|
+
attribute: "content-flex"
|
|
347
|
+
})], s.prototype, "contentFlex", void 0), e([a({
|
|
348
|
+
type: String,
|
|
349
|
+
reflect: !0,
|
|
350
|
+
attribute: "internal-gap"
|
|
351
|
+
})], s.prototype, "internalGap", void 0), e([o()], s.prototype, "_canScrollLeft", void 0), e([o()], s.prototype, "_canScrollRight", void 0), s = e([i("scb-horizontal-scroller")], s);
|
|
352
|
+
//#endregion
|
|
353
|
+
export { s as ScbHorizontalScroller };
|
|
@@ -0,0 +1,335 @@
|
|
|
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, nothing as i } from "lit";
|
|
3
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
4
|
+
import "@material/web/icon/icon.js";
|
|
5
|
+
//#region src/scb-test-components/scb-icon-button/scb-icon-button.ts
|
|
6
|
+
var s = class extends t {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), this.icon = "home", this.ariaLabel = "", this.variant = "standard", this.size = "medium", this.shape = "round", this.toggle = !1, this.selected = !1, this.toggleofficon = "add", this.toggleonicon = "remove", this.disabled = !1, this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this.href = "", this.target = "", this.rel = "", this.__filledValue = !1, this.__loadedVariants = /* @__PURE__ */ new Set(), this.__iconLoaded = !1, this.__lastMdHost = null, this.__onInnerChange = () => {
|
|
9
|
+
let e = !!this.__getMdHost()?.selected;
|
|
10
|
+
this.toggle && (this.selected = e), this.dispatchEvent(new CustomEvent("change", {
|
|
11
|
+
detail: { selected: e },
|
|
12
|
+
bubbles: !0,
|
|
13
|
+
composed: !0
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
get filled() {
|
|
18
|
+
return this.__filledValue;
|
|
19
|
+
}
|
|
20
|
+
set filled(e) {
|
|
21
|
+
let t = !!e, n = this.__filledValue;
|
|
22
|
+
n !== t && (this.__filledValue = t, this.requestUpdate("filled", n), this.requestUpdate("iconFilled", n));
|
|
23
|
+
}
|
|
24
|
+
get iconFilled() {
|
|
25
|
+
return this.__filledValue;
|
|
26
|
+
}
|
|
27
|
+
set iconFilled(e) {
|
|
28
|
+
let t = !!e, n = this.__filledValue;
|
|
29
|
+
n !== t && (this.__filledValue = t, this.requestUpdate("iconFilled", n), this.requestUpdate("filled", n));
|
|
30
|
+
}
|
|
31
|
+
async firstUpdated() {
|
|
32
|
+
await this.__ensureDepsLoaded(), await this.updateComplete, this.__attachChangeListener(), this.__syncTitleAndAria(), this.#e();
|
|
33
|
+
}
|
|
34
|
+
updated(e) {
|
|
35
|
+
if (super.updated(e), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this.#e(), e.has("variant")) {
|
|
36
|
+
this.__ensureDepsLoaded().then(() => {
|
|
37
|
+
queueMicrotask(() => {
|
|
38
|
+
this.__attachChangeListener(), this.__syncTitleAndAria();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
(e.has("toggle") || e.has("icon") || e.has("toggleofficon") || e.has("toggleonicon") || e.has("selected") || e.has("disabled") || e.has("ariaLabel")) && queueMicrotask(() => {
|
|
44
|
+
this.__attachChangeListener(), this.__syncTitleAndAria();
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
disconnectedCallback() {
|
|
48
|
+
this.__lastMdHost?.removeEventListener?.("change", this.__onInnerChange), this.__lastMdHost = null, super.disconnectedCallback();
|
|
49
|
+
}
|
|
50
|
+
async __ensureDepsLoaded() {
|
|
51
|
+
if (!this.__loadedVariants.has(this.variant)) {
|
|
52
|
+
switch (this.variant) {
|
|
53
|
+
case "filled":
|
|
54
|
+
await import("@material/web/iconbutton/filled-icon-button.js");
|
|
55
|
+
break;
|
|
56
|
+
case "outlined":
|
|
57
|
+
await import("@material/web/iconbutton/outlined-icon-button.js");
|
|
58
|
+
break;
|
|
59
|
+
case "filled-tonal":
|
|
60
|
+
await import("@material/web/iconbutton/filled-tonal-icon-button.js");
|
|
61
|
+
break;
|
|
62
|
+
default:
|
|
63
|
+
await import("@material/web/iconbutton/icon-button.js");
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
this.__loadedVariants.add(this.variant);
|
|
67
|
+
}
|
|
68
|
+
this.__iconLoaded ||= (await import("@material/web/icon/icon.js"), !0);
|
|
69
|
+
}
|
|
70
|
+
__getMdHost() {
|
|
71
|
+
return this.renderRoot.querySelector("md-filled-icon-button, md-outlined-icon-button, md-filled-tonal-icon-button, md-icon-button");
|
|
72
|
+
}
|
|
73
|
+
__attachChangeListener() {
|
|
74
|
+
let e = this.__getMdHost();
|
|
75
|
+
e && e !== this.__lastMdHost && (this.__lastMdHost?.removeEventListener?.("change", this.__onInnerChange), e.addEventListener("change", this.__onInnerChange), this.__lastMdHost = e), this.toggle && e && "selected" in e && (e.selected = this.selected);
|
|
76
|
+
}
|
|
77
|
+
__syncTitleAndAria() {
|
|
78
|
+
let e = this.__getMdHost();
|
|
79
|
+
if (!e) return;
|
|
80
|
+
let t = (this.getAttribute("title") || "").trim(), n = (this.ariaLabel || this.getAttribute("aria-label") || "").trim(), r = this.getAttribute("aria-controls"), i = this.getAttribute("aria-expanded"), a = n || t || this.icon.trim() || void 0;
|
|
81
|
+
a ? e.setAttribute("aria-label", a) : e.removeAttribute("aria-label"), r === null ? e.removeAttribute("aria-controls") : e.setAttribute("aria-controls", r), i === null ? e.removeAttribute("aria-expanded") : e.setAttribute("aria-expanded", i);
|
|
82
|
+
}
|
|
83
|
+
mapSpacingToken(e) {
|
|
84
|
+
if (!e) return;
|
|
85
|
+
let t = String(e).trim();
|
|
86
|
+
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
87
|
+
}
|
|
88
|
+
#e() {
|
|
89
|
+
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);
|
|
90
|
+
t ? this.style.setProperty("--scb-icon-button-spacing-block-start", t) : this.style.removeProperty("--scb-icon-button-spacing-block-start"), n ? this.style.setProperty("--scb-icon-button-spacing-block-end", n) : this.style.removeProperty("--scb-icon-button-spacing-block-end"), r ? this.style.setProperty("--scb-icon-button-spacing-inline-start", r) : this.style.removeProperty("--scb-icon-button-spacing-inline-start"), i ? this.style.setProperty("--scb-icon-button-spacing-inline-end", i) : this.style.removeProperty("--scb-icon-button-spacing-inline-end");
|
|
91
|
+
}
|
|
92
|
+
static {
|
|
93
|
+
this.styles = n`
|
|
94
|
+
:host {
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
margin-block-start: var(--scb-icon-button-spacing-block-start, 0);
|
|
97
|
+
margin-block-end: var(--scb-icon-button-spacing-block-end, 0);
|
|
98
|
+
margin-inline-start: var(--scb-icon-button-spacing-inline-start, 0);
|
|
99
|
+
margin-inline-end: var(--scb-icon-button-spacing-inline-end, 0);
|
|
100
|
+
--scb-icon-button-font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
|
101
|
+
--scb-icon-button-shape-radius: var(--radius-full, 1000px);
|
|
102
|
+
|
|
103
|
+
--scb-icon-button-shape-square-radius: var(--radius-m, 12px);
|
|
104
|
+
--scb-icon-button-shape-square-radius-large: var(--radius-l, 16px);
|
|
105
|
+
|
|
106
|
+
--scb-icon-button-icon-size: var(--icon-size-medium, 24px);
|
|
107
|
+
--scb-icon-button-padding: var(--spacing-3, 12px);
|
|
108
|
+
--scb-icon-button-container-size: calc(
|
|
109
|
+
var(--scb-icon-button-icon-size) + (var(--scb-icon-button-padding) * 2)
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:host([size="tiny"]) {
|
|
114
|
+
--scb-icon-button-icon-size: var(--icon-size-tiny, 12px);
|
|
115
|
+
--scb-icon-button-padding: var(--spacing-1, 4px);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:host([size="extra-small"]) {
|
|
119
|
+
--scb-icon-button-icon-size: var(--icon-size-extra-small, 16px);
|
|
120
|
+
--scb-icon-button-padding: var(--spacing-2, 8px);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:host([size="small"]) {
|
|
124
|
+
--scb-icon-button-icon-size: var(--icon-size-small, 20px);
|
|
125
|
+
--scb-icon-button-padding: calc(var(--spacing-3, 12px) - var(--spacing-1, 4px));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:host([size="medium"]) {
|
|
129
|
+
--scb-icon-button-icon-size: var(--icon-size-medium, 24px);
|
|
130
|
+
--scb-icon-button-padding: var(--spacing-3, 12px);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:host([size="large"]) {
|
|
134
|
+
--scb-icon-button-icon-size: var(--icon-size-medium, 24px);
|
|
135
|
+
--scb-icon-button-padding: var(--spacing-5, 20px);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:host([shape="square"]) {
|
|
139
|
+
--scb-icon-button-shape-radius: var(--scb-icon-button-shape-square-radius);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:host([shape="square"][size="large"]) {
|
|
143
|
+
--scb-icon-button-shape-radius: var(--scb-icon-button-shape-square-radius-large);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
:host([filled]),
|
|
147
|
+
:host([icon-filled]) {
|
|
148
|
+
--scb-icon-button-font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
md-icon {
|
|
152
|
+
--md-icon-size: var(--scb-icon-button-icon-size);
|
|
153
|
+
font-size: var(--scb-icon-button-icon-size) !important;
|
|
154
|
+
--md-icon-font-variation-settings: var(--scb-icon-button-font-variation-settings) !important;
|
|
155
|
+
font-variation-settings: var(--scb-icon-button-font-variation-settings) !important;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
md-icon-button {
|
|
159
|
+
--md-icon-button-icon-size: var(--scb-icon-button-icon-size);
|
|
160
|
+
--md-icon-button-container-size: var(--scb-icon-button-container-size);
|
|
161
|
+
--md-icon-button-state-layer-size: var(--scb-icon-button-container-size);
|
|
162
|
+
--md-icon-button-container-width: var(--scb-icon-button-container-size);
|
|
163
|
+
--md-icon-button-container-height: var(--scb-icon-button-container-size);
|
|
164
|
+
--md-icon-button-state-layer-width: var(--scb-icon-button-container-size);
|
|
165
|
+
--md-icon-button-state-layer-height: var(--scb-icon-button-container-size);
|
|
166
|
+
--md-icon-button-container-shape: var(--scb-icon-button-shape-radius);
|
|
167
|
+
border-radius: var(--scb-icon-button-shape-radius) !important;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
md-filled-icon-button {
|
|
171
|
+
--md-filled-icon-button-icon-size: var(--scb-icon-button-icon-size);
|
|
172
|
+
--md-filled-icon-button-container-width: var(--scb-icon-button-container-size);
|
|
173
|
+
--md-filled-icon-button-container-height: var(--scb-icon-button-container-size);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
md-filled-tonal-icon-button {
|
|
177
|
+
--md-filled-tonal-icon-button-icon-size: var(--scb-icon-button-icon-size);
|
|
178
|
+
--md-filled-tonal-icon-button-container-width: var(--scb-icon-button-container-size);
|
|
179
|
+
--md-filled-tonal-icon-button-container-height: var(--scb-icon-button-container-size);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
md-outlined-icon-button {
|
|
183
|
+
--md-outlined-icon-button-icon-size: var(--scb-icon-button-icon-size);
|
|
184
|
+
--md-outlined-icon-button-container-width: var(--scb-icon-button-container-size);
|
|
185
|
+
--md-outlined-icon-button-container-height: var(--scb-icon-button-container-size);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
md-icon-button,
|
|
189
|
+
md-filled-icon-button,
|
|
190
|
+
md-outlined-icon-button,
|
|
191
|
+
md-filled-tonal-icon-button {
|
|
192
|
+
--md-icon-button-container-shape: var(--scb-icon-button-shape-radius);
|
|
193
|
+
--md-filled-icon-button-container-shape: var(--scb-icon-button-shape-radius);
|
|
194
|
+
--md-outlined-icon-button-container-shape: var(--scb-icon-button-shape-radius);
|
|
195
|
+
--md-filled-tonal-icon-button-container-shape: var(--scb-icon-button-shape-radius);
|
|
196
|
+
--md-icon-font-variation-settings: var(--scb-icon-button-font-variation-settings);
|
|
197
|
+
border-radius: var(--scb-icon-button-shape-radius) !important;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
md-icon-button::part(button),
|
|
201
|
+
md-filled-icon-button::part(button),
|
|
202
|
+
md-outlined-icon-button::part(button),
|
|
203
|
+
md-filled-tonal-icon-button::part(button) {
|
|
204
|
+
border-radius: var(--scb-icon-button-shape-radius) !important;
|
|
205
|
+
}
|
|
206
|
+
`;
|
|
207
|
+
}
|
|
208
|
+
__renderToggleIcons() {
|
|
209
|
+
return r`
|
|
210
|
+
<md-icon ?filled=${this.iconFilled || this.filled} aria-hidden="true">${this.toggleofficon}</md-icon>
|
|
211
|
+
<md-icon ?filled=${this.iconFilled || this.filled} slot="selected" aria-hidden="true">${this.toggleonicon}</md-icon>
|
|
212
|
+
`;
|
|
213
|
+
}
|
|
214
|
+
__renderSingleIcon() {
|
|
215
|
+
return r`<md-icon ?filled=${this.iconFilled || this.filled} aria-hidden="true">${this.icon}</md-icon>`;
|
|
216
|
+
}
|
|
217
|
+
__renderMd() {
|
|
218
|
+
let e = this.toggle ? this.__renderToggleIcons() : this.__renderSingleIcon();
|
|
219
|
+
if (this.toggle) switch (this.variant) {
|
|
220
|
+
case "filled": return r`
|
|
221
|
+
<md-filled-icon-button
|
|
222
|
+
toggle
|
|
223
|
+
?selected=${this.selected}
|
|
224
|
+
?disabled=${this.disabled}
|
|
225
|
+
href=${this.href || i}
|
|
226
|
+
target=${this.target || i}
|
|
227
|
+
rel=${this.rel || i}
|
|
228
|
+
>
|
|
229
|
+
${e}
|
|
230
|
+
</md-filled-icon-button>
|
|
231
|
+
`;
|
|
232
|
+
case "outlined": return r`
|
|
233
|
+
<md-outlined-icon-button
|
|
234
|
+
toggle
|
|
235
|
+
?selected=${this.selected}
|
|
236
|
+
?disabled=${this.disabled}
|
|
237
|
+
href=${this.href || i}
|
|
238
|
+
target=${this.target || i}
|
|
239
|
+
rel=${this.rel || i}
|
|
240
|
+
>
|
|
241
|
+
${e}
|
|
242
|
+
</md-outlined-icon-button>
|
|
243
|
+
`;
|
|
244
|
+
case "filled-tonal": return r`
|
|
245
|
+
<md-filled-tonal-icon-button
|
|
246
|
+
toggle
|
|
247
|
+
?selected=${this.selected}
|
|
248
|
+
?disabled=${this.disabled}
|
|
249
|
+
href=${this.href || i}
|
|
250
|
+
target=${this.target || i}
|
|
251
|
+
rel=${this.rel || i}
|
|
252
|
+
>
|
|
253
|
+
${e}
|
|
254
|
+
</md-filled-tonal-icon-button>
|
|
255
|
+
`;
|
|
256
|
+
default: return r`
|
|
257
|
+
<md-icon-button toggle ?selected=${this.selected} ?disabled=${this.disabled} href=${this.href || i} target=${this.target || i} rel=${this.rel || i}>
|
|
258
|
+
${e}
|
|
259
|
+
</md-icon-button>
|
|
260
|
+
`;
|
|
261
|
+
}
|
|
262
|
+
switch (this.variant) {
|
|
263
|
+
case "filled": return r`
|
|
264
|
+
<md-filled-icon-button ?disabled=${this.disabled} href=${this.href || i} target=${this.target || i} rel=${this.rel || i}>
|
|
265
|
+
${e}
|
|
266
|
+
</md-filled-icon-button>
|
|
267
|
+
`;
|
|
268
|
+
case "outlined": return r`
|
|
269
|
+
<md-outlined-icon-button ?disabled=${this.disabled} href=${this.href || i} target=${this.target || i} rel=${this.rel || i}>
|
|
270
|
+
${e}
|
|
271
|
+
</md-outlined-icon-button>
|
|
272
|
+
`;
|
|
273
|
+
case "filled-tonal": return r`
|
|
274
|
+
<md-filled-tonal-icon-button ?disabled=${this.disabled} href=${this.href || i} target=${this.target || i} rel=${this.rel || i}>
|
|
275
|
+
${e}
|
|
276
|
+
</md-filled-tonal-icon-button>
|
|
277
|
+
`;
|
|
278
|
+
default: return r`
|
|
279
|
+
<md-icon-button ?disabled=${this.disabled} href=${this.href || i} target=${this.target || i} rel=${this.rel || i}>
|
|
280
|
+
${e}
|
|
281
|
+
</md-icon-button>
|
|
282
|
+
`;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
render() {
|
|
286
|
+
return this.__renderMd();
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
e([o({ type: String })], s.prototype, "icon", void 0), e([o({
|
|
290
|
+
type: Boolean,
|
|
291
|
+
reflect: !0
|
|
292
|
+
})], s.prototype, "filled", null), e([o({
|
|
293
|
+
type: Boolean,
|
|
294
|
+
attribute: "icon-filled",
|
|
295
|
+
reflect: !0
|
|
296
|
+
})], s.prototype, "iconFilled", null), e([o({
|
|
297
|
+
type: String,
|
|
298
|
+
attribute: "aria-label"
|
|
299
|
+
})], s.prototype, "ariaLabel", void 0), e([o({ type: String })], s.prototype, "variant", void 0), e([o({
|
|
300
|
+
type: String,
|
|
301
|
+
reflect: !0
|
|
302
|
+
})], s.prototype, "size", void 0), e([o({
|
|
303
|
+
type: String,
|
|
304
|
+
reflect: !0
|
|
305
|
+
})], s.prototype, "shape", void 0), e([o({
|
|
306
|
+
type: Boolean,
|
|
307
|
+
reflect: !0
|
|
308
|
+
})], s.prototype, "toggle", void 0), e([o({
|
|
309
|
+
type: Boolean,
|
|
310
|
+
reflect: !0
|
|
311
|
+
})], s.prototype, "selected", void 0), e([o({ type: String })], s.prototype, "toggleofficon", void 0), e([o({ type: String })], s.prototype, "toggleonicon", void 0), e([o({
|
|
312
|
+
type: Boolean,
|
|
313
|
+
reflect: !0
|
|
314
|
+
})], s.prototype, "disabled", void 0), e([o({
|
|
315
|
+
type: String,
|
|
316
|
+
reflect: !0
|
|
317
|
+
})], s.prototype, "spacing", void 0), e([o({
|
|
318
|
+
type: String,
|
|
319
|
+
attribute: "spacing-top",
|
|
320
|
+
reflect: !0
|
|
321
|
+
})], s.prototype, "spacingTop", void 0), e([o({
|
|
322
|
+
type: String,
|
|
323
|
+
attribute: "spacing-bottom",
|
|
324
|
+
reflect: !0
|
|
325
|
+
})], s.prototype, "spacingBottom", void 0), e([o({
|
|
326
|
+
type: String,
|
|
327
|
+
attribute: "spacing-left",
|
|
328
|
+
reflect: !0
|
|
329
|
+
})], s.prototype, "spacingLeft", void 0), e([o({
|
|
330
|
+
type: String,
|
|
331
|
+
attribute: "spacing-right",
|
|
332
|
+
reflect: !0
|
|
333
|
+
})], s.prototype, "spacingRight", void 0), e([o({ type: String })], s.prototype, "href", void 0), e([o({ type: String })], s.prototype, "target", void 0), e([o({ type: String })], s.prototype, "rel", void 0), s = e([a("scb-icon-button")], s);
|
|
334
|
+
//#endregion
|
|
335
|
+
export { s as ScbIconButton };
|