scb-wc 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +194 -164
- package/all.js +91 -5
- package/blazor/CustomEvents.cs +83 -0
- package/blazor/ScbBlazorInteropBase.cs +4460 -1674
- package/blazor/scb-blazor-bridge.js +6827 -2805
- package/blazor/wrappers/ScbAccordion.razor +50 -0
- package/blazor/wrappers/ScbAppBar.razor +95 -0
- package/blazor/wrappers/ScbBreadcrumb.razor +59 -0
- package/blazor/wrappers/ScbCalendar.razor +100 -0
- package/blazor/wrappers/ScbCalendarCard.razor +189 -0
- package/blazor/wrappers/ScbCheckbox.razor +92 -0
- package/blazor/wrappers/ScbCollapse.razor +76 -0
- package/blazor/wrappers/ScbCookiesConsent.razor +106 -0
- package/blazor/wrappers/ScbDatepicker.razor +77 -0
- package/blazor/wrappers/ScbDialog.razor +72 -0
- package/blazor/wrappers/ScbDrawer.razor +64 -0
- package/blazor/wrappers/ScbDropZone.razor +168 -0
- package/blazor/wrappers/ScbDropdown.razor +76 -0
- package/blazor/wrappers/ScbHorizontalScroller.razor +137 -0
- package/blazor/wrappers/ScbList.razor +77 -0
- package/blazor/wrappers/ScbMenu.razor +71 -0
- package/blazor/wrappers/ScbNav.razor +92 -0
- package/blazor/wrappers/ScbNotificationCard.razor +122 -0
- package/blazor/wrappers/ScbOptionsMenu.razor +88 -0
- package/blazor/wrappers/ScbPagination.razor +80 -0
- package/blazor/wrappers/ScbRadioGroup.razor +94 -0
- package/blazor/wrappers/ScbSearch.razor +83 -0
- package/blazor/wrappers/ScbSegmentedButton.razor +85 -0
- package/blazor/wrappers/ScbSelect.razor +79 -0
- package/blazor/wrappers/ScbSlider.razor +96 -0
- package/blazor/wrappers/ScbSnackbar.razor +93 -0
- package/blazor/wrappers/ScbSwitch.razor +92 -0
- package/blazor/wrappers/ScbTable.razor +67 -0
- package/blazor/wrappers/ScbTableAdvanced.razor +78 -0
- package/blazor/wrappers/ScbTabs.razor +55 -0
- package/blazor/wrappers/ScbTextfield.razor +104 -0
- package/blazor/wrappers/ScbTooltip.razor +88 -0
- package/blazor/wrappers/ScbViz.razor +142 -0
- package/demo-data-preview.svg +12 -0
- package/dummy.png +0 -0
- package/fonts/inter/files/inter-latin-wght-italic.woff2 +0 -0
- package/fonts/inter/files/inter-latin-wght-normal.woff2 +0 -0
- package/fonts/material-symbols-outlined/files/material-symbols-outlined-latin-wght-normal.woff2 +0 -0
- package/index.js +91 -1
- package/mvc/components/all.js +90 -1
- package/mvc/components/scb-accordion/scb-accordion-item.js +211 -0
- package/mvc/components/scb-accordion/scb-accordion.js +44 -0
- package/mvc/components/scb-app-bar/scb-app-bar.js +166 -0
- package/mvc/components/scb-avatar/scb-avatar.js +111 -0
- package/mvc/components/scb-badge/scb-badge.js +80 -0
- package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +14 -0
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +96 -0
- package/mvc/components/scb-button/scb-button.js +268 -0
- package/mvc/components/scb-calendar/scb-calendar-event.js +6 -0
- package/mvc/components/scb-calendar/scb-calendar.js +168 -0
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +346 -0
- package/mvc/components/scb-card/scb-card.js +761 -0
- package/mvc/components/scb-checkbox/scb-checkbox-group.js +33 -0
- package/mvc/components/scb-checkbox/scb-checkbox.js +140 -0
- package/mvc/components/scb-chevron/scb-chevron.js +121 -0
- package/mvc/components/scb-chip/scb-chip.js +66 -0
- package/mvc/components/scb-collapse/scb-collapse.js +89 -0
- package/mvc/components/scb-cookies-consent/scb-cookies-consent.js +78 -0
- package/mvc/components/scb-datepicker/scb-datepicker.js +296 -0
- package/mvc/components/scb-dialog/scb-dialog.js +265 -0
- package/mvc/components/scb-divider/scb-divider.js +69 -0
- package/mvc/components/scb-drawer/scb-drawer.js +128 -0
- package/mvc/components/scb-drop-zone/scb-drop-zone.js +555 -0
- package/mvc/components/scb-dropdown/scb-dropdown.js +306 -0
- package/mvc/components/scb-fab/scb-fab.js +108 -0
- package/mvc/components/scb-fact-card/scb-fact-card-content.js +46 -0
- package/mvc/components/scb-fact-card/scb-fact-card.js +226 -0
- package/mvc/components/scb-footer/scb-footer-section.js +3 -0
- package/mvc/components/scb-footer/scb-footer.js +210 -0
- package/mvc/components/scb-gallery-grid/scb-gallery-grid.js +131 -0
- package/mvc/components/scb-grid/scb-grid-item.js +11 -0
- package/mvc/components/scb-grid/scb-grid.js +98 -0
- package/mvc/components/scb-grid/scb-stack.js +33 -0
- package/mvc/components/scb-header/scb-header-menu-group.js +1 -0
- package/mvc/components/scb-header/scb-header-menu-item.js +5 -0
- package/mvc/components/scb-header/scb-header-tab.js +5 -0
- package/mvc/components/scb-header/scb-header-utility.js +1 -0
- package/mvc/components/scb-header/scb-header.js +681 -0
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +196 -0
- package/mvc/components/scb-icon-button/scb-icon-button.js +171 -0
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +212 -0
- package/mvc/components/scb-link/scb-link.js +61 -0
- package/mvc/components/scb-list/scb-list-item.js +153 -0
- package/mvc/components/scb-list/scb-list.js +26 -0
- package/mvc/components/scb-menu/scb-menu-item.js +205 -0
- package/mvc/components/scb-menu/scb-menu-section.js +42 -0
- package/mvc/components/scb-menu/scb-menu.js +81 -0
- package/mvc/components/scb-menu/scb-sub-menu.js +10 -0
- package/mvc/components/scb-nav/scb-nav-item.js +28 -0
- package/mvc/components/scb-nav/scb-nav.js +104 -0
- package/mvc/components/scb-notification-card/scb-notification-card.js +358 -0
- package/mvc/components/scb-options-menu/scb-options-menu-item.js +66 -0
- package/mvc/components/scb-options-menu/scb-options-menu.js +88 -0
- package/mvc/components/scb-options-menu/scb-options-sub-menu.js +34 -0
- package/mvc/components/scb-overlay/scb-overlay.js +49 -0
- package/mvc/components/scb-pagination/scb-pagination.js +312 -0
- package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +87 -0
- package/mvc/components/scb-progress-stepper/scb-progress-step.js +147 -0
- package/mvc/components/scb-progress-stepper/scb-progress-stepper.js +62 -0
- package/mvc/components/scb-radio-button/scb-radio-button.js +132 -0
- package/mvc/components/scb-radio-button/scb-radio-group.js +43 -0
- package/mvc/components/scb-scrollspy/scb-scrollspy.js +79 -0
- package/mvc/components/scb-search/scb-search.js +292 -0
- package/mvc/components/scb-segmented-button/scb-segmented-button.js +32 -0
- package/mvc/components/scb-segmented-button/scb-segmented-item.js +74 -0
- package/mvc/components/scb-select/scb-select-option.js +61 -0
- package/mvc/components/scb-select/scb-select.js +284 -0
- package/mvc/components/scb-skeleton/scb-skeleton.js +38 -0
- package/mvc/components/scb-slider/scb-slider.js +27 -0
- package/mvc/components/scb-snackbar/scb-snackbar.js +128 -0
- package/mvc/components/scb-status-pill/scb-status-pill.js +45 -0
- package/mvc/components/scb-stepper/scb-step.js +239 -0
- package/mvc/components/scb-stepper/scb-stepper.js +139 -0
- package/mvc/components/scb-switch/scb-switch.js +59 -0
- package/mvc/components/scb-table/scb-table.js +51 -0
- package/mvc/components/scb-table-advanced/scb-table-advanced.js +76 -0
- package/mvc/components/scb-tabs/scb-primary-tab.js +6 -0
- package/mvc/components/scb-tabs/scb-secondary-tab.js +6 -0
- package/mvc/components/scb-tabs/scb-tabs.js +28 -0
- package/mvc/components/scb-textfield/scb-textfield.js +595 -0
- package/mvc/components/scb-toc/scb-toc-item.js +303 -0
- package/mvc/components/scb-toc/scb-toc.js +19 -0
- package/mvc/components/scb-tooltip/scb-tooltip.js +196 -0
- package/mvc/components/scb-vignette/scb-vignette.js +37 -0
- package/mvc/components/scb-viz/scb-viz-actions-runtime.js +2 -0
- package/mvc/components/scb-viz/scb-viz-print-runtime.js +98 -0
- package/mvc/components/scb-viz/scb-viz-series-differentiation-registry.js +1 -0
- package/mvc/components/scb-viz/scb-viz-series-differentiation-runtime.js +1 -0
- package/mvc/components/scb-viz/scb-viz-table-runtime.js +1 -0
- package/mvc/components/scb-viz/scb-viz.js +1140 -0
- package/mvc/fonts/inter/files/inter-latin-wght-italic.woff2 +0 -0
- package/mvc/fonts/inter/files/inter-latin-wght-normal.woff2 +0 -0
- package/mvc/fonts/material-symbols-outlined/files/material-symbols-outlined-latin-wght-normal.woff2 +0 -0
- package/mvc/scb-blazor-bridge.js +6827 -2805
- package/mvc/scb-logo.svg +20 -20
- package/mvc/scb-typography.css +1 -1
- package/mvc/scb-wc.css +3 -2
- package/mvc/scb.svg +13 -13
- package/mvc/vendor/assertClassBrand.js +1 -0
- package/mvc/vendor/classPrivateFieldGet2.js +1 -0
- package/mvc/vendor/decorate.js +1 -0
- package/mvc/vendor/preload-helper.js +1 -0
- package/mvc/vendor/vendor-lit.js +1 -0
- package/mvc/vendor/vendor-material.js +364 -0
- package/mvc/vendor/vendor.js +4 -0
- package/package.json +420 -77
- package/scb-accordion/scb-accordion-item.js +340 -0
- package/scb-accordion/scb-accordion.js +151 -0
- package/scb-app-bar/scb-app-bar.js +317 -0
- package/scb-avatar/scb-avatar.js +197 -0
- package/scb-badge/scb-badge.js +165 -0
- package/scb-breadcrumb/scb-breadcrumb-item.js +62 -0
- package/scb-breadcrumb/scb-breadcrumb.js +255 -0
- package/scb-button/scb-button.js +398 -0
- package/scb-calendar/scb-calendar-event.js +48 -0
- package/scb-calendar/scb-calendar.js +700 -0
- package/scb-calendar-card/scb-calendar-card.js +505 -0
- package/scb-card/scb-card.js +1231 -0
- package/scb-checkbox/scb-checkbox-group.js +104 -0
- package/scb-checkbox/scb-checkbox.js +316 -0
- package/scb-chevron/scb-chevron.js +144 -0
- package/scb-chip/scb-chip.js +234 -0
- package/scb-collapse/scb-collapse.js +231 -0
- package/scb-cookies-consent/scb-cookies-consent.js +164 -0
- package/scb-datepicker/scb-datepicker.js +470 -0
- package/scb-dialog/scb-dialog.js +574 -0
- package/scb-divider/scb-divider.js +119 -0
- package/scb-drawer/scb-drawer.js +297 -0
- package/scb-drop-zone/scb-drop-zone.js +965 -0
- package/scb-dropdown/scb-dropdown.js +598 -0
- package/scb-fab/scb-fab.js +190 -0
- package/scb-fact-card/scb-fact-card-content.js +82 -0
- package/scb-fact-card/scb-fact-card.js +376 -0
- package/scb-footer/scb-footer-section.js +23 -0
- package/scb-footer/scb-footer.js +343 -0
- package/scb-gallery-grid/scb-gallery-grid.js +242 -0
- package/scb-grid/scb-grid-item.js +81 -0
- package/scb-grid/scb-grid.js +200 -0
- package/scb-grid/scb-stack.js +120 -0
- package/scb-header/scb-header-menu-group.js +21 -0
- package/scb-header/scb-header-menu-item.js +22 -0
- package/scb-header/scb-header-tab.js +25 -0
- package/scb-header/scb-header-utility.js +27 -0
- package/scb-header/scb-header.js +1358 -0
- package/scb-horizontal-scroller/scb-horizontal-scroller.js +353 -0
- package/scb-icon-button/scb-icon-button.js +335 -0
- package/scb-keyfigure-card/scb-keyfigure-card.js +340 -0
- package/scb-link/scb-link.js +136 -0
- package/scb-list/scb-list-item.js +297 -0
- package/scb-list/scb-list.js +119 -0
- package/scb-menu/scb-menu-item.js +330 -0
- package/scb-menu/scb-menu-section.js +60 -0
- package/scb-menu/scb-menu.js +154 -0
- package/scb-menu/scb-sub-menu.js +36 -0
- package/scb-nav/scb-nav-item.js +96 -0
- package/scb-nav/scb-nav.js +263 -0
- package/scb-notification-card/scb-notification-card.js +479 -0
- package/scb-options-menu/scb-options-menu-item.js +218 -0
- package/scb-options-menu/scb-options-menu.js +237 -0
- package/scb-options-menu/scb-options-sub-menu.js +69 -0
- package/scb-overlay/scb-overlay.js +144 -0
- package/scb-pagination/scb-pagination.js +438 -0
- package/scb-progress-indicator/scb-progress-indicator.js +199 -0
- package/scb-progress-stepper/scb-progress-step.js +213 -0
- package/scb-progress-stepper/scb-progress-stepper.js +132 -0
- package/scb-radio-button/scb-radio-button.js +249 -0
- package/scb-radio-button/scb-radio-group.js +216 -0
- package/scb-scrollspy/scb-scrollspy.js +670 -0
- package/scb-search/scb-search.js +643 -0
- package/scb-segmented-button/scb-segmented-button.js +215 -0
- package/scb-segmented-button/scb-segmented-item.js +133 -0
- package/scb-select/scb-select-option.js +88 -0
- package/scb-select/scb-select.js +517 -0
- package/scb-skeleton/scb-skeleton.js +92 -0
- package/scb-slider/scb-slider.js +98 -0
- package/scb-snackbar/scb-snackbar.js +223 -0
- package/scb-status-pill/scb-status-pill.js +100 -0
- package/scb-stepper/scb-step.js +311 -0
- package/scb-stepper/scb-stepper.js +325 -0
- package/scb-switch/scb-switch.js +182 -0
- package/scb-table/scb-table.js +202 -0
- package/scb-table-advanced/scb-table-advanced.js +327 -0
- package/scb-tabs/scb-primary-tab.js +68 -0
- package/scb-tabs/scb-secondary-tab.js +68 -0
- package/scb-tabs/scb-tabs.js +100 -0
- package/scb-test-components/index.d.ts +90 -0
- package/scb-test-components/scb-accordion/scb-accordion-item.d.ts +39 -0
- package/scb-test-components/scb-accordion/scb-accordion.d.ts +27 -0
- package/scb-test-components/scb-app-bar/scb-app-bar.d.ts +25 -0
- package/scb-test-components/scb-avatar/scb-avatar.d.ts +37 -0
- package/scb-test-components/scb-badge/scb-badge.d.ts +28 -0
- package/scb-test-components/scb-breadcrumb/scb-breadcrumb-item.d.ts +15 -0
- package/scb-test-components/scb-breadcrumb/scb-breadcrumb.d.ts +27 -0
- package/scb-test-components/scb-button/scb-button.d.ts +40 -0
- package/scb-test-components/scb-calendar/scb-calendar-event.d.ts +15 -0
- package/scb-test-components/scb-calendar/scb-calendar.d.ts +77 -0
- package/scb-test-components/scb-calendar-card/scb-calendar-card.d.ts +45 -0
- package/scb-test-components/scb-card/scb-card.d.ts +101 -0
- package/scb-test-components/scb-checkbox/scb-checkbox-group.d.ts +23 -0
- package/scb-test-components/scb-checkbox/scb-checkbox.d.ts +52 -0
- package/scb-test-components/scb-chevron/scb-chevron.d.ts +13 -0
- package/scb-test-components/scb-chip/scb-chip.d.ts +61 -0
- package/scb-test-components/scb-collapse/scb-collapse.d.ts +29 -0
- package/scb-test-components/scb-cookies-consent/scb-cookies-consent.d.ts +23 -0
- package/scb-test-components/scb-datepicker/scb-datepicker.d.ts +39 -0
- package/scb-test-components/scb-dialog/scb-dialog.d.ts +72 -0
- package/scb-test-components/scb-divider/scb-divider.d.ts +34 -0
- package/scb-test-components/scb-drawer/scb-drawer.d.ts +72 -0
- package/scb-test-components/scb-drop-zone/scb-drop-zone.d.ts +143 -0
- package/scb-test-components/scb-dropdown/scb-dropdown.d.ts +70 -0
- package/scb-test-components/scb-fab/scb-fab.d.ts +42 -0
- package/scb-test-components/scb-fact-card/scb-fact-card-content.d.ts +15 -0
- package/scb-test-components/scb-fact-card/scb-fact-card.d.ts +49 -0
- package/scb-test-components/scb-footer/scb-footer-section.d.ts +20 -0
- package/scb-test-components/scb-footer/scb-footer.d.ts +31 -0
- package/scb-test-components/scb-gallery-grid/scb-gallery-grid.d.ts +20 -0
- package/scb-test-components/scb-grid/scb-grid-item.d.ts +32 -0
- package/scb-test-components/scb-grid/scb-grid.d.ts +36 -0
- package/scb-test-components/scb-grid/scb-stack.d.ts +32 -0
- package/scb-test-components/scb-header/scb-header-menu-group.d.ts +12 -0
- package/scb-test-components/scb-header/scb-header-menu-item.d.ts +13 -0
- package/scb-test-components/scb-header/scb-header-tab.d.ts +13 -0
- package/scb-test-components/scb-header/scb-header-utility.d.ts +14 -0
- package/scb-test-components/scb-header/scb-header.d.ts +132 -0
- package/scb-test-components/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +47 -0
- package/scb-test-components/scb-icon-button/scb-icon-button.d.ts +76 -0
- package/scb-test-components/scb-keyfigure-card/scb-keyfigure-card.d.ts +46 -0
- package/scb-test-components/scb-link/scb-link.d.ts +25 -0
- package/scb-test-components/scb-list/scb-list-item.d.ts +38 -0
- package/scb-test-components/scb-list/scb-list.d.ts +26 -0
- package/scb-test-components/scb-menu/scb-menu-item.d.ts +52 -0
- package/scb-test-components/scb-menu/scb-menu-section.d.ts +11 -0
- package/scb-test-components/scb-menu/scb-menu.d.ts +25 -0
- package/scb-test-components/scb-menu/scb-sub-menu.d.ts +14 -0
- package/scb-test-components/scb-nav/scb-nav-item.d.ts +20 -0
- package/scb-test-components/scb-nav/scb-nav.d.ts +50 -0
- package/scb-test-components/scb-notification-card/scb-notification-card.d.ts +46 -0
- package/scb-test-components/scb-options-menu/scb-options-menu-item.d.ts +29 -0
- package/scb-test-components/scb-options-menu/scb-options-menu.d.ts +35 -0
- package/scb-test-components/scb-options-menu/scb-options-sub-menu.d.ts +11 -0
- package/scb-test-components/scb-overlay/scb-overlay.d.ts +24 -0
- package/scb-test-components/scb-pagination/scb-pagination.d.ts +36 -0
- package/scb-test-components/scb-progress-indicator/scb-progress-indicator.d.ts +28 -0
- package/scb-test-components/scb-progress-stepper/scb-progress-step.d.ts +21 -0
- package/scb-test-components/scb-progress-stepper/scb-progress-stepper.d.ts +22 -0
- package/scb-test-components/scb-radio-button/scb-radio-button.d.ts +26 -0
- package/scb-test-components/scb-radio-button/scb-radio-group.d.ts +49 -0
- package/scb-test-components/scb-scrollspy/scb-scrollspy.d.ts +217 -0
- package/scb-test-components/scb-search/scb-search.d.ts +96 -0
- package/scb-test-components/scb-segmented-button/scb-segmented-button.d.ts +80 -0
- package/scb-test-components/scb-segmented-button/scb-segmented-item.d.ts +21 -0
- package/scb-test-components/scb-select/scb-select-option.d.ts +16 -0
- package/scb-test-components/scb-select/scb-select.d.ts +62 -0
- package/scb-test-components/scb-skeleton/scb-skeleton.d.ts +25 -0
- package/scb-test-components/scb-slider/scb-slider.d.ts +28 -0
- package/scb-test-components/scb-snackbar/scb-snackbar.d.ts +24 -0
- package/scb-test-components/scb-status-pill/scb-status-pill.d.ts +22 -0
- package/scb-test-components/scb-stepper/scb-step.d.ts +22 -0
- package/scb-test-components/scb-stepper/scb-stepper.d.ts +47 -0
- package/scb-test-components/scb-switch/scb-switch.d.ts +52 -0
- package/scb-test-components/scb-table/scb-table.d.ts +24 -0
- package/scb-test-components/scb-table-advanced/scb-table-advanced.d.ts +39 -0
- package/scb-test-components/scb-tabs/scb-primary-tab.d.ts +15 -0
- package/scb-test-components/scb-tabs/scb-secondary-tab.d.ts +15 -0
- package/scb-test-components/scb-tabs/scb-tabs.d.ts +21 -0
- package/scb-test-components/scb-textfield/scb-textfield.d.ts +75 -0
- package/scb-test-components/scb-toc/scb-toc-item.d.ts +38 -0
- package/scb-test-components/scb-toc/scb-toc.d.ts +27 -0
- package/scb-test-components/scb-tooltip/scb-tooltip.d.ts +51 -0
- package/scb-test-components/scb-vignette/scb-vignette.d.ts +20 -0
- package/scb-test-components/scb-viz/scb-viz-actions-runtime.d.ts +26 -0
- package/scb-test-components/scb-viz/scb-viz-print-runtime.d.ts +27 -0
- package/scb-test-components/scb-viz/scb-viz-series-differentiation-registry.d.ts +21 -0
- package/scb-test-components/scb-viz/scb-viz-series-differentiation-runtime.d.ts +42 -0
- package/scb-test-components/scb-viz/scb-viz-table-runtime.d.ts +28 -0
- package/scb-test-components/scb-viz/scb-viz.d.ts +207 -0
- package/scb-textfield/scb-textfield.js +827 -0
- package/scb-toc/scb-toc-item.js +477 -0
- package/scb-toc/scb-toc.js +101 -0
- package/scb-tooltip/scb-tooltip.js +402 -0
- package/scb-typography.css +1 -1
- package/scb-vignette/scb-vignette.js +88 -0
- package/scb-viz/scb-viz-actions-runtime.js +143 -0
- package/scb-viz/scb-viz-print-runtime.js +121 -0
- package/scb-viz/scb-viz-series-differentiation-registry.js +117 -0
- package/scb-viz/scb-viz-series-differentiation-runtime.js +126 -0
- package/scb-viz/scb-viz-table-runtime.js +86 -0
- package/scb-viz/scb-viz.js +2195 -0
- package/scb-wc-selfhost.css +29 -0
- package/scb-wc.bundle.js +12893 -1099
- package/scb-wc.css +3 -2
- package/scb-wc.d.ts +180 -0
- package/index.d.ts +0 -0
- package/mvc/components/index.js +0 -1
|
@@ -0,0 +1,213 @@
|
|
|
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, state as o } from "lit/decorators.js";
|
|
4
|
+
import "@material/web/focus/md-focus-ring.js";
|
|
5
|
+
import "@material/web/ripple/ripple.js";
|
|
6
|
+
//#region src/scb-test-components/scb-progress-stepper/scb-progress-step.ts
|
|
7
|
+
var s = class extends t {
|
|
8
|
+
constructor(...e) {
|
|
9
|
+
super(...e), this.width = "100%", this.active = !1, this.disabled = !1, this.href = "", this.label = "", this.position = "top", this._stepId = `scb-step-${Math.random().toString(36).slice(2)}`;
|
|
10
|
+
}
|
|
11
|
+
static {
|
|
12
|
+
this.styles = n`
|
|
13
|
+
:host {
|
|
14
|
+
display: block;
|
|
15
|
+
width: var(--progress-step-width, 100%);
|
|
16
|
+
height: 100%;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
background: transparent;
|
|
19
|
+
position: relative;
|
|
20
|
+
}
|
|
21
|
+
.progress-step {
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 100%;
|
|
24
|
+
background: transparent;
|
|
25
|
+
position: relative;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
border-right: 2px solid var(--md-sys-color-surface);
|
|
28
|
+
outline: none;
|
|
29
|
+
box-shadow: none;
|
|
30
|
+
display: block;
|
|
31
|
+
}
|
|
32
|
+
:host(.last-step) .progress-step {
|
|
33
|
+
border-right: none !important;
|
|
34
|
+
}
|
|
35
|
+
.progress-step:focus {
|
|
36
|
+
outline: none;
|
|
37
|
+
box-shadow: none;
|
|
38
|
+
}
|
|
39
|
+
:host([active]) .progress-step {
|
|
40
|
+
border-right: 2px solid var(--md-sys-color-surface);
|
|
41
|
+
}
|
|
42
|
+
:host([disabled]) {
|
|
43
|
+
cursor: not-allowed;
|
|
44
|
+
}
|
|
45
|
+
:host([disabled]) .progress-step {
|
|
46
|
+
background: #e6e6e699;
|
|
47
|
+
border-right: 2px solid #e6e6e699;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
md-focus-ring {
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
position: absolute;
|
|
53
|
+
inset: 0;
|
|
54
|
+
opacity: 0;
|
|
55
|
+
border-radius: 0;
|
|
56
|
+
transition: opacity 0.15s;
|
|
57
|
+
z-index: 4;
|
|
58
|
+
}
|
|
59
|
+
.progress-step:focus + md-focus-ring,
|
|
60
|
+
.progress-step:focus-visible + md-focus-ring {
|
|
61
|
+
opacity: 1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.tooltip {
|
|
65
|
+
visibility: hidden;
|
|
66
|
+
opacity: 0;
|
|
67
|
+
position: absolute;
|
|
68
|
+
left: 50%;
|
|
69
|
+
transform: translateX(-50%);
|
|
70
|
+
z-index: 10;
|
|
71
|
+
max-width: 220px;
|
|
72
|
+
width: max-content;
|
|
73
|
+
background: var(--md-sys-color-inverse-surface);
|
|
74
|
+
border-radius: var(--md-sys-shape-corner-extra-small);
|
|
75
|
+
padding: var(--spacing-2) var(--spacing-3);
|
|
76
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
77
|
+
font-family: var(--brand-font);
|
|
78
|
+
font-size: var(--md-sys-typescale-body-small-size);
|
|
79
|
+
font-style: normal;
|
|
80
|
+
line-height: var(--md-sys-typescale-body-small-line-height);
|
|
81
|
+
letter-spacing: var(--md-sys-typescale-body-small-tracking);
|
|
82
|
+
white-space: normal;
|
|
83
|
+
pointer-events: none;
|
|
84
|
+
transition: opacity 0.2s, visibility 0.2s;
|
|
85
|
+
text-align: center;
|
|
86
|
+
}
|
|
87
|
+
.tooltip.top {
|
|
88
|
+
top: calc(100% + 10px);
|
|
89
|
+
}
|
|
90
|
+
.tooltip.bottom {
|
|
91
|
+
bottom: calc(100% + 10px);
|
|
92
|
+
}
|
|
93
|
+
.progress-step:hover ~ .tooltip,
|
|
94
|
+
.progress-step:focus ~ .tooltip {
|
|
95
|
+
visibility: visible;
|
|
96
|
+
opacity: 1;
|
|
97
|
+
}
|
|
98
|
+
.tooltip::after {
|
|
99
|
+
content: '';
|
|
100
|
+
position: absolute;
|
|
101
|
+
left: 50%;
|
|
102
|
+
transform: translateX(-50%);
|
|
103
|
+
width: 0;
|
|
104
|
+
height: 0;
|
|
105
|
+
pointer-events: none;
|
|
106
|
+
display: block;
|
|
107
|
+
}
|
|
108
|
+
.tooltip.top::after {
|
|
109
|
+
top: -6px;
|
|
110
|
+
border-left: 8px solid transparent;
|
|
111
|
+
border-right: 8px solid transparent;
|
|
112
|
+
border-bottom: 8px solid var(--md-sys-color-inverse-surface);
|
|
113
|
+
border-top: none;
|
|
114
|
+
}
|
|
115
|
+
.tooltip.bottom::after {
|
|
116
|
+
bottom: -6px;
|
|
117
|
+
border-left: 8px solid transparent;
|
|
118
|
+
border-right: 8px solid transparent;
|
|
119
|
+
border-top: 8px solid var(--md-sys-color-inverse-surface);
|
|
120
|
+
border-bottom: none;
|
|
121
|
+
}
|
|
122
|
+
.tooltip.tooltip-left::after {
|
|
123
|
+
left: 2px;
|
|
124
|
+
transform: none;
|
|
125
|
+
}
|
|
126
|
+
.tooltip.tooltip-right::after {
|
|
127
|
+
right: 2px;
|
|
128
|
+
left: auto;
|
|
129
|
+
transform: none;
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
}
|
|
133
|
+
updated(e) {
|
|
134
|
+
super.updated?.(e), this.style.setProperty("--progress-step-width", this.width);
|
|
135
|
+
}
|
|
136
|
+
_onClick() {
|
|
137
|
+
let e = {
|
|
138
|
+
width: this.width,
|
|
139
|
+
label: this.label,
|
|
140
|
+
active: this.active,
|
|
141
|
+
disabled: this.disabled,
|
|
142
|
+
href: this.href || void 0
|
|
143
|
+
};
|
|
144
|
+
this.dispatchEvent(new CustomEvent("step-click", {
|
|
145
|
+
detail: e,
|
|
146
|
+
bubbles: !0,
|
|
147
|
+
composed: !0
|
|
148
|
+
})), this.dispatchEvent(new CustomEvent("stepclick", {
|
|
149
|
+
detail: e,
|
|
150
|
+
bubbles: !0,
|
|
151
|
+
composed: !0
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
firstUpdated(e) {
|
|
155
|
+
super.firstUpdated?.(e), this._setupTooltipPositioning();
|
|
156
|
+
}
|
|
157
|
+
_setupTooltipPositioning() {
|
|
158
|
+
new MutationObserver(() => this._adjustTooltipPosition()).observe(this, {
|
|
159
|
+
attributes: !0,
|
|
160
|
+
childList: !0,
|
|
161
|
+
subtree: !0
|
|
162
|
+
}), window.addEventListener("resize", () => this._adjustTooltipPosition());
|
|
163
|
+
}
|
|
164
|
+
_adjustTooltipPosition() {
|
|
165
|
+
let e = this.renderRoot.querySelector(".tooltip");
|
|
166
|
+
if (!e) return;
|
|
167
|
+
e.style.left = "50%", e.style.right = "", e.style.transform = "translateX(-50%)", e.classList.remove("tooltip-left", "tooltip-right");
|
|
168
|
+
let t = e.getBoundingClientRect();
|
|
169
|
+
t.right > window.innerWidth - 8 && (e.style.left = "auto", e.style.right = "8px", e.style.transform = "none", e.classList.add("tooltip-right")), t.left < 8 && (e.style.left = "8px", e.style.right = "auto", e.style.transform = "none", e.classList.add("tooltip-left"));
|
|
170
|
+
}
|
|
171
|
+
render() {
|
|
172
|
+
return r`
|
|
173
|
+
${this.href && !this.disabled ? r`
|
|
174
|
+
<a
|
|
175
|
+
id=${this._stepId}
|
|
176
|
+
class="progress-step"
|
|
177
|
+
href=${this.href}
|
|
178
|
+
@click=${this._onClick}
|
|
179
|
+
tabindex="0"
|
|
180
|
+
role="link"
|
|
181
|
+
aria-disabled="false"
|
|
182
|
+
>
|
|
183
|
+
<md-ripple></md-ripple>
|
|
184
|
+
</a>
|
|
185
|
+
` : r`
|
|
186
|
+
<div
|
|
187
|
+
id=${this._stepId}
|
|
188
|
+
class="progress-step"
|
|
189
|
+
@click=${this._onClick}
|
|
190
|
+
tabindex=${this.disabled ? -1 : 0}
|
|
191
|
+
role="button"
|
|
192
|
+
aria-disabled=${this.disabled ? "true" : "false"}
|
|
193
|
+
>
|
|
194
|
+
${this.disabled ? "" : r`<md-ripple></md-ripple>`}
|
|
195
|
+
</div>
|
|
196
|
+
`}
|
|
197
|
+
${this.disabled ? "" : r`<md-focus-ring for="${this._stepId}"></md-focus-ring>`}
|
|
198
|
+
${this.label && !this.disabled ? r`<div class="tooltip ${this.position === "bottom" ? "bottom" : "top"}">${this.label}</div>` : ""}
|
|
199
|
+
`;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
e([a({ type: String })], s.prototype, "width", void 0), e([a({
|
|
203
|
+
type: Boolean,
|
|
204
|
+
reflect: !0
|
|
205
|
+
})], s.prototype, "active", void 0), e([a({
|
|
206
|
+
type: Boolean,
|
|
207
|
+
reflect: !0
|
|
208
|
+
})], s.prototype, "disabled", void 0), e([a({
|
|
209
|
+
type: String,
|
|
210
|
+
reflect: !0
|
|
211
|
+
})], s.prototype, "href", void 0), e([a({ type: String })], s.prototype, "label", void 0), e([a({ type: String })], s.prototype, "position", void 0), e([o()], s.prototype, "_stepId", void 0), s = e([i("scb-progress-step")], s);
|
|
212
|
+
//#endregion
|
|
213
|
+
export { s as ScbProgressStep };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.126.0/helpers/decorate.js";
|
|
2
|
+
import { ScbProgressStep as t } from "./scb-progress-step.js";
|
|
3
|
+
import { LitElement as n, css as r, html as i } from "lit";
|
|
4
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
5
|
+
//#region src/scb-test-components/scb-progress-stepper/scb-progress-stepper.ts
|
|
6
|
+
var s = class extends n {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), this.progressWidth = 23, this.height = "normal", this.position = "top", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0;
|
|
9
|
+
}
|
|
10
|
+
static {
|
|
11
|
+
this.styles = r`
|
|
12
|
+
:host {
|
|
13
|
+
display: block;
|
|
14
|
+
width: 100%;
|
|
15
|
+
font-family: var(--brand-font);
|
|
16
|
+
position: absolute;
|
|
17
|
+
top: 0;
|
|
18
|
+
--progress-step-height: 8px;
|
|
19
|
+
|
|
20
|
+
margin-block-start: var(--scb-progress-stepper-spacing-block-start, 0);
|
|
21
|
+
margin-block-end: var(--scb-progress-stepper-spacing-block-end, 0);
|
|
22
|
+
margin-inline-start: var(--scb-progress-stepper-spacing-inline-start, 0);
|
|
23
|
+
margin-inline-end: var(--scb-progress-stepper-spacing-inline-end, 0);
|
|
24
|
+
}
|
|
25
|
+
:host([position="bottom"]) {
|
|
26
|
+
top: auto;
|
|
27
|
+
bottom: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([height="normal"]) .progress-bar, :host([height="normal"]) .progress-container {
|
|
31
|
+
height: var(--progress-step-height);
|
|
32
|
+
}
|
|
33
|
+
:host(:hover[height="normal"]) .progress-bar, :host(:hover[height="normal"]) .progress-container {
|
|
34
|
+
--progress-step-height: 16px;
|
|
35
|
+
height: var(--progress-step-height);
|
|
36
|
+
}
|
|
37
|
+
:host([height="high"]) .progress-bar, :host([height="high"]) .progress-container {
|
|
38
|
+
--progress-step-height: 16px;
|
|
39
|
+
height: var(--progress-step-height);
|
|
40
|
+
}
|
|
41
|
+
.progress-bar, .progress-container {
|
|
42
|
+
transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
43
|
+
}
|
|
44
|
+
.progress-bar {
|
|
45
|
+
width: 100%;
|
|
46
|
+
background: var(--md-sys-color-secondary-container);
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
position: absolute;
|
|
49
|
+
}
|
|
50
|
+
.progress-bar__fill {
|
|
51
|
+
height: 100%;
|
|
52
|
+
background: var(--md-sys-color-primary);
|
|
53
|
+
transition: width 0.3s ease;
|
|
54
|
+
position: absolute;
|
|
55
|
+
z-index: 0;
|
|
56
|
+
max-width: 100%;
|
|
57
|
+
}
|
|
58
|
+
.progress-container {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
width: 100%;
|
|
62
|
+
position: relative;
|
|
63
|
+
gap: 0;
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
}
|
|
67
|
+
mapSpacingToken(e) {
|
|
68
|
+
if (!e) return;
|
|
69
|
+
let t = String(e).trim();
|
|
70
|
+
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
71
|
+
}
|
|
72
|
+
applySpacing() {
|
|
73
|
+
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);
|
|
74
|
+
t ? this.style.setProperty("--scb-progress-stepper-spacing-block-start", t) : this.style.removeProperty("--scb-progress-stepper-spacing-block-start"), n ? this.style.setProperty("--scb-progress-stepper-spacing-block-end", n) : this.style.removeProperty("--scb-progress-stepper-spacing-block-end"), r ? this.style.setProperty("--scb-progress-stepper-spacing-inline-start", r) : this.style.removeProperty("--scb-progress-stepper-spacing-inline-start"), i ? this.style.setProperty("--scb-progress-stepper-spacing-inline-end", i) : this.style.removeProperty("--scb-progress-stepper-spacing-inline-end");
|
|
75
|
+
}
|
|
76
|
+
updated(e) {
|
|
77
|
+
(e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this.applySpacing();
|
|
78
|
+
let n = this.shadowRoot?.querySelector("slot");
|
|
79
|
+
if (!n) return;
|
|
80
|
+
e.has("progressWidth") && n.dispatchEvent(new Event("slotchange"));
|
|
81
|
+
let r = n.assignedElements({ flatten: !0 }), i = this.progressWidth, a = 0;
|
|
82
|
+
r.forEach((e, n) => {
|
|
83
|
+
if (e instanceof t) {
|
|
84
|
+
let t = typeof e.width == "string" ? parseFloat(e.width.replace("%", "")) : Number(e.width);
|
|
85
|
+
a += t, this.position == "bottom" ? e.setAttribute("position", "bottom") : e.setAttribute("position", "top"), a <= i + 2 ? e.setAttribute("active", "true") : e.removeAttribute("active"), n === r.length - 1 ? e.classList.add("last-step") : e.classList.remove("last-step");
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
render() {
|
|
90
|
+
return i`
|
|
91
|
+
<div class="progress-bar">
|
|
92
|
+
<div class="progress-bar__fill" style="width: ${this.progressWidth}%;"></div>
|
|
93
|
+
</div>
|
|
94
|
+
<div class="progress-container">
|
|
95
|
+
<slot></slot>
|
|
96
|
+
</div>
|
|
97
|
+
`;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
e([o({
|
|
101
|
+
type: Number,
|
|
102
|
+
reflect: !0,
|
|
103
|
+
attribute: "progress-width",
|
|
104
|
+
hasChanged: (e, t) => e !== t
|
|
105
|
+
})], s.prototype, "progressWidth", void 0), e([o({
|
|
106
|
+
type: String,
|
|
107
|
+
reflect: !0
|
|
108
|
+
})], s.prototype, "height", void 0), e([o({
|
|
109
|
+
type: String,
|
|
110
|
+
reflect: !0
|
|
111
|
+
})], s.prototype, "position", void 0), e([o({
|
|
112
|
+
type: String,
|
|
113
|
+
reflect: !0
|
|
114
|
+
})], s.prototype, "spacing", void 0), e([o({
|
|
115
|
+
type: String,
|
|
116
|
+
attribute: "spacing-top",
|
|
117
|
+
reflect: !0
|
|
118
|
+
})], s.prototype, "spacingTop", void 0), e([o({
|
|
119
|
+
type: String,
|
|
120
|
+
attribute: "spacing-bottom",
|
|
121
|
+
reflect: !0
|
|
122
|
+
})], s.prototype, "spacingBottom", void 0), e([o({
|
|
123
|
+
type: String,
|
|
124
|
+
attribute: "spacing-left",
|
|
125
|
+
reflect: !0
|
|
126
|
+
})], s.prototype, "spacingLeft", void 0), e([o({
|
|
127
|
+
type: String,
|
|
128
|
+
attribute: "spacing-right",
|
|
129
|
+
reflect: !0
|
|
130
|
+
})], s.prototype, "spacingRight", void 0), s = e([a("scb-progress-stepper")], s);
|
|
131
|
+
//#endregion
|
|
132
|
+
export { s as ScbProgressStepper };
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.126.0/helpers/decorate.js";
|
|
2
|
+
import "./scb-radio-group.js";
|
|
3
|
+
import { LitElement as t, css as n, html as r, nothing as i } from "lit";
|
|
4
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
5
|
+
import "@material/web/focus/md-focus-ring.js";
|
|
6
|
+
import "@material/web/radio/radio.js";
|
|
7
|
+
//#region src/scb-test-components/scb-radio-button/scb-radio-button.ts
|
|
8
|
+
var s = !1, c = 0, l = (e) => {
|
|
9
|
+
e.metaKey || e.altKey || e.ctrlKey || (s = !0);
|
|
10
|
+
}, u = () => {
|
|
11
|
+
s = !1;
|
|
12
|
+
}, d = () => {
|
|
13
|
+
c === 0 && (window.addEventListener("keydown", l, !0), window.addEventListener("pointerdown", u, !0), window.addEventListener("mousedown", u, !0), window.addEventListener("touchstart", u, !0)), c += 1;
|
|
14
|
+
}, f = () => {
|
|
15
|
+
c = Math.max(0, c - 1), c === 0 && (window.removeEventListener("keydown", l, !0), window.removeEventListener("pointerdown", u, !0), window.removeEventListener("mousedown", u, !0), window.removeEventListener("touchstart", u, !0));
|
|
16
|
+
}, p = class extends t {
|
|
17
|
+
constructor(...e) {
|
|
18
|
+
super(...e), this.disabled = !1, this.checked = !1, this.name = "", this.value = "", this.size = "medium", this.deselectable = !1, this.label = "", this.supportingText = "", this.ariaLabel = "", this._radioId = "", this._showOuterFocusRing = !1, this.#n = () => {
|
|
19
|
+
this.disabled || this.label?.trim() && s && this.#e(!0);
|
|
20
|
+
}, this.#r = () => {
|
|
21
|
+
this.#e(!1);
|
|
22
|
+
}, this.#i = () => {
|
|
23
|
+
this.#e(!1);
|
|
24
|
+
}, this._onClick = (e) => {
|
|
25
|
+
if (this.disabled) return;
|
|
26
|
+
e.preventDefault(), e.stopPropagation();
|
|
27
|
+
let t = this.deselectable ? !this.checked : !0;
|
|
28
|
+
t !== this.checked && (this.checked = t, this.#a(), this.checked && this.dispatchEvent(new CustomEvent("scb-radio-change", {
|
|
29
|
+
detail: {
|
|
30
|
+
name: this.name,
|
|
31
|
+
source: this
|
|
32
|
+
},
|
|
33
|
+
bubbles: !0,
|
|
34
|
+
composed: !0
|
|
35
|
+
})), this.dispatchEvent(new Event("input", {
|
|
36
|
+
bubbles: !0,
|
|
37
|
+
composed: !0
|
|
38
|
+
})), this.dispatchEvent(new CustomEvent("change", {
|
|
39
|
+
detail: {
|
|
40
|
+
checked: this.checked,
|
|
41
|
+
value: this.checked ? this.value : ""
|
|
42
|
+
},
|
|
43
|
+
bubbles: !0,
|
|
44
|
+
composed: !0
|
|
45
|
+
})));
|
|
46
|
+
}, this._onRadioChange = (e) => {
|
|
47
|
+
e.detail.name === this.name && e.detail.source !== this && (this.checked = !1);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
#e(e) {
|
|
51
|
+
this._showOuterFocusRing !== e && (this._showOuterFocusRing = e, this.requestUpdate());
|
|
52
|
+
}
|
|
53
|
+
#t() {
|
|
54
|
+
let e = !!this.label?.trim();
|
|
55
|
+
this.toggleAttribute("data-has-label", e), e || this.#e(!1);
|
|
56
|
+
}
|
|
57
|
+
#n;
|
|
58
|
+
#r;
|
|
59
|
+
#i;
|
|
60
|
+
connectedCallback() {
|
|
61
|
+
super.connectedCallback(), d(), this._radioId = this.id || `scb-radio-${Math.random().toString(36).substr(2, 9)}`, this.#t(), this.addEventListener("focusin", this.#n), this.addEventListener("focusout", this.#r), this.addEventListener("pointerdown", this.#i, !0), document.addEventListener("scb-radio-change", this._onRadioChange);
|
|
62
|
+
}
|
|
63
|
+
disconnectedCallback() {
|
|
64
|
+
super.disconnectedCallback(), f(), this.removeEventListener("focusin", this.#n), this.removeEventListener("focusout", this.#r), this.removeEventListener("pointerdown", this.#i, !0), document.removeEventListener("scb-radio-change", this._onRadioChange);
|
|
65
|
+
}
|
|
66
|
+
firstUpdated() {
|
|
67
|
+
this.__syncInnerAria(), this.#a();
|
|
68
|
+
}
|
|
69
|
+
updated(e) {
|
|
70
|
+
super.updated(e), e.has("disabled") && (this.toggleAttribute("aria-disabled", this.disabled), this.disabled && this.#e(!1)), (e.has("label") || e.has("supportingText") || e.has("ariaLabel")) && this.__syncInnerAria(), e.has("label") && this.#t(), e.has("checked") && this.#a();
|
|
71
|
+
}
|
|
72
|
+
#a() {
|
|
73
|
+
let e = this.shadowRoot?.querySelector("md-radio");
|
|
74
|
+
e && (e.checked = this.checked, this.checked ? e.setAttribute("checked", "") : e.removeAttribute("checked"));
|
|
75
|
+
}
|
|
76
|
+
__syncInnerAria() {
|
|
77
|
+
let e = this.shadowRoot?.querySelector("md-radio")?.shadowRoot;
|
|
78
|
+
if (!e) return;
|
|
79
|
+
let t = e.querySelector("[role=\"radio\"]") || e.querySelector("input[type=\"radio\"]");
|
|
80
|
+
if (!t) return;
|
|
81
|
+
let n = !!this.label?.trim(), r = n ? `${this._radioId}-label` : "", i = this.supportingText ? `${this._radioId}-supporting-text` : "";
|
|
82
|
+
n && r ? (t.setAttribute("aria-labelledby", r), t.removeAttribute("aria-label")) : (t.removeAttribute("aria-labelledby"), this.ariaLabel?.trim() ? t.setAttribute("aria-label", this.ariaLabel.trim()) : t.removeAttribute("aria-label")), i ? t.setAttribute("aria-describedby", i) : t.removeAttribute("aria-describedby");
|
|
83
|
+
}
|
|
84
|
+
static {
|
|
85
|
+
this.styles = n`
|
|
86
|
+
/* layout med inline-grid */
|
|
87
|
+
:host {
|
|
88
|
+
display: inline-grid;
|
|
89
|
+
grid-template-columns: auto;
|
|
90
|
+
grid-template-rows: auto auto;
|
|
91
|
+
row-gap: 0;
|
|
92
|
+
font-family: var(--brand-font, 'Inter', sans-serif);
|
|
93
|
+
|
|
94
|
+
--scb-radio-text-font: var(--md-sys-typescale-body-medium-font);
|
|
95
|
+
--scb-radio-text-size: var(--md-sys-typescale-body-medium-size);
|
|
96
|
+
--scb-radio-text-line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
97
|
+
--scb-radio-text-tracking: var(--md-sys-typescale-body-medium-tracking);
|
|
98
|
+
--scb-radio-text-weight: var(--md-sys-typescale-body-medium-weight, var(--weight-regular, 400));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:host([size='small']) {
|
|
102
|
+
--scb-radio-text-font: var(--md-sys-typescale-body-small-font);
|
|
103
|
+
--scb-radio-text-size: var(--md-sys-typescale-body-small-size);
|
|
104
|
+
--scb-radio-text-line-height: var(--md-sys-typescale-body-small-line-height);
|
|
105
|
+
--scb-radio-text-tracking: var(--md-sys-typescale-body-small-tracking);
|
|
106
|
+
--scb-radio-text-weight: var(--md-sys-typescale-body-small-weight, var(--weight-regular, 400));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
:host([size='large']) {
|
|
110
|
+
--scb-radio-text-font: var(--md-sys-typescale-body-large-font);
|
|
111
|
+
--scb-radio-text-size: var(--md-sys-typescale-body-large-size);
|
|
112
|
+
--scb-radio-text-line-height: var(--md-sys-typescale-body-large-line-height);
|
|
113
|
+
--scb-radio-text-tracking: var(--md-sys-typescale-body-large-tracking);
|
|
114
|
+
--scb-radio-text-weight: var(--md-sys-typescale-body-large-weight, var(--weight-regular, 400));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Styr horisontellt avstånd när den placeras i horisontell layout */
|
|
118
|
+
:host([orientation="horizontal"]) {
|
|
119
|
+
margin-inline-end: var(--scb-radio-gap, var(--spacing-7, 24px));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* Wrapper för md-radio + label */
|
|
123
|
+
.wrap {
|
|
124
|
+
display: inline-flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
gap: var(--spacing-5, 16px);
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
overflow: visible;
|
|
129
|
+
position: relative;
|
|
130
|
+
}
|
|
131
|
+
:host([disabled]) .wrap { cursor: default; }
|
|
132
|
+
|
|
133
|
+
.outer-focus-ring {
|
|
134
|
+
position: absolute;
|
|
135
|
+
inset:
|
|
136
|
+
calc(var(--spacing-2, 4px) * -1) /* topp */
|
|
137
|
+
calc(var(--spacing-4, 12px) * -1) /* höger */
|
|
138
|
+
calc(var(--spacing-2, 4px) * -1) /* botten */
|
|
139
|
+
calc(var(--spacing-4, 12px) * -1); /* vänster */
|
|
140
|
+
pointer-events: none;
|
|
141
|
+
--md-focus-ring-shape-start-start: var(--radius-s, 8px);
|
|
142
|
+
--md-focus-ring-shape-start-end: var(--radius-s, 8px);
|
|
143
|
+
--md-focus-ring-shape-end-start: var(--radius-s, 8px);
|
|
144
|
+
--md-focus-ring-shape-end-end: var(--radius-s, 8px);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
:host([data-has-label]) md-radio::part(focus-ring) {
|
|
148
|
+
display: none;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Hit-yta runt md-radio */
|
|
152
|
+
.radio-wrap {
|
|
153
|
+
height: var(--scb-radio-target, 40px);
|
|
154
|
+
align-items: center;
|
|
155
|
+
display: flex;
|
|
156
|
+
justify-content: center;
|
|
157
|
+
overflow: visible;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* Nollställ md-radio marginal */
|
|
161
|
+
md-radio { margin: 0; }
|
|
162
|
+
|
|
163
|
+
/* Label-styling */
|
|
164
|
+
.lbl {
|
|
165
|
+
color: var(--md-sys-color-on-surface);
|
|
166
|
+
font-family: var(--scb-radio-text-font, var(--brand-font));
|
|
167
|
+
font-size: var(--scb-radio-text-size);
|
|
168
|
+
line-height: var(--scb-radio-text-line-height);
|
|
169
|
+
font-weight: var(--scb-radio-text-weight);
|
|
170
|
+
letter-spacing: var(--scb-radio-text-tracking);
|
|
171
|
+
margin-top: var(--spacing-1, 2px);
|
|
172
|
+
}
|
|
173
|
+
:host([disabled]) .lbl { color: var(--n-60); }
|
|
174
|
+
|
|
175
|
+
/* Supporting text styling */
|
|
176
|
+
.supporting-text {
|
|
177
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
178
|
+
font-family: var(--scb-radio-text-font, var(--brand-font));
|
|
179
|
+
font-size: var(--scb-radio-text-size);
|
|
180
|
+
line-height: var(--scb-radio-text-line-height, 20px);
|
|
181
|
+
font-weight: var(--scb-radio-text-weight);
|
|
182
|
+
letter-spacing: var(--scb-radio-text-tracking);
|
|
183
|
+
/* gap + wrapperbredd så texten linjerar med labeln */
|
|
184
|
+
margin-left: calc(var(--spacing-3, 6px) + var(--scb-radio-target, 40px));
|
|
185
|
+
margin-bottom: var(--spacing-4, 8px);
|
|
186
|
+
}
|
|
187
|
+
:host([disabled]) .supporting-text { color: var(--n-60); }
|
|
188
|
+
|
|
189
|
+
/* Anpassning för mörkt läge */
|
|
190
|
+
@media (prefers-color-scheme: dark) {
|
|
191
|
+
.lbl { color: var(--md-sys-color-on-surface); }
|
|
192
|
+
.supporting-text { color: var(--md-sys-color-on-surface-variant); }
|
|
193
|
+
}
|
|
194
|
+
`;
|
|
195
|
+
}
|
|
196
|
+
render() {
|
|
197
|
+
let e = this.supportingText ? `${this._radioId}-supporting-text` : void 0, t = !!this.label?.trim(), n = t ? i : this.ariaLabel || i;
|
|
198
|
+
return r`
|
|
199
|
+
<label class="wrap">
|
|
200
|
+
${t ? r`<md-focus-ring class="outer-focus-ring" ?visible=${this._showOuterFocusRing}></md-focus-ring>` : i}
|
|
201
|
+
<div class="radio-wrap">
|
|
202
|
+
<md-radio
|
|
203
|
+
id="${this._radioId}"
|
|
204
|
+
?disabled=${this.disabled}
|
|
205
|
+
?checked=${this.checked}
|
|
206
|
+
name="${this.name}"
|
|
207
|
+
value="${this.value}"
|
|
208
|
+
aria-label=${n}
|
|
209
|
+
aria-describedby=${e ?? i}
|
|
210
|
+
@click=${this._onClick}
|
|
211
|
+
></md-radio>
|
|
212
|
+
</div>
|
|
213
|
+
${t ? r`<span class="lbl" id="${this._radioId}-label">${this.label}</span>` : i}
|
|
214
|
+
</label>
|
|
215
|
+
|
|
216
|
+
${this.supportingText ? r`<div id="${e}" class="supporting-text">
|
|
217
|
+
${this.supportingText}
|
|
218
|
+
</div>` : i}
|
|
219
|
+
<slot></slot>
|
|
220
|
+
`;
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
e([o({
|
|
224
|
+
type: Boolean,
|
|
225
|
+
reflect: !0
|
|
226
|
+
})], p.prototype, "disabled", void 0), e([o({
|
|
227
|
+
type: Boolean,
|
|
228
|
+
reflect: !0
|
|
229
|
+
})], p.prototype, "checked", void 0), e([o({
|
|
230
|
+
type: String,
|
|
231
|
+
reflect: !0
|
|
232
|
+
})], p.prototype, "name", void 0), e([o({
|
|
233
|
+
type: String,
|
|
234
|
+
reflect: !0
|
|
235
|
+
})], p.prototype, "value", void 0), e([o({
|
|
236
|
+
type: String,
|
|
237
|
+
reflect: !0
|
|
238
|
+
})], p.prototype, "size", void 0), e([o({
|
|
239
|
+
type: Boolean,
|
|
240
|
+
reflect: !0
|
|
241
|
+
})], p.prototype, "deselectable", void 0), e([o({ type: String })], p.prototype, "label", void 0), e([o({
|
|
242
|
+
type: String,
|
|
243
|
+
attribute: "supporting-text"
|
|
244
|
+
})], p.prototype, "supportingText", void 0), e([o({
|
|
245
|
+
type: String,
|
|
246
|
+
attribute: "aria-label"
|
|
247
|
+
})], p.prototype, "ariaLabel", void 0), p = e([a("scb-radio-button")], p);
|
|
248
|
+
//#endregion
|
|
249
|
+
export { p as ScbRadioButton };
|