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,340 @@
|
|
|
1
|
+
import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.126.0/helpers/decorate.js";
|
|
2
|
+
import { LitElement as t, css as n, html as r } from "lit";
|
|
3
|
+
import { customElement as i, property as a } from "lit/decorators.js";
|
|
4
|
+
import "@material/web/focus/md-focus-ring.js";
|
|
5
|
+
//#region src/scb-test-components/scb-keyfigure-card/scb-keyfigure-card.ts
|
|
6
|
+
var o, s = class extends t {
|
|
7
|
+
static {
|
|
8
|
+
o = this;
|
|
9
|
+
}
|
|
10
|
+
constructor(...e) {
|
|
11
|
+
super(...e), this.keyfigure = 0, this.subtitle = "", this.supportingText = "", this.cardHref = "", this.href = "", this.icon = "", this.size = "large", this.unit = "", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "", this.sizing = "stretch", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this.__onKeyDown = (e) => {
|
|
12
|
+
let t = this.__effectiveHref;
|
|
13
|
+
(e.key === "Enter" || e.key === " ") && t && (e.preventDefault(), this.__navigate(t, e));
|
|
14
|
+
}, this.__handleHrefNavigation = (e) => {
|
|
15
|
+
let t = this.__effectiveHref;
|
|
16
|
+
t && (e.target.closest("a") || this.__navigate(t, e));
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
static {
|
|
20
|
+
this.__iconLoaded = !1;
|
|
21
|
+
}
|
|
22
|
+
static {
|
|
23
|
+
this.__rippleLoaded = !1;
|
|
24
|
+
}
|
|
25
|
+
static {
|
|
26
|
+
this.styles = n`
|
|
27
|
+
:host {
|
|
28
|
+
display: block;
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
position: relative;
|
|
31
|
+
inline-size: 100%;
|
|
32
|
+
min-inline-size: 0;
|
|
33
|
+
padding: var(--scb-keyfigure-card-focus-ring-gap, 4px);
|
|
34
|
+
margin-block-start: var(--scb-keyfigure-card-spacing-block-start, 0);
|
|
35
|
+
margin-block-end: var(--scb-keyfigure-card-spacing-block-end, 0);
|
|
36
|
+
margin-inline-start: var(--scb-keyfigure-card-spacing-inline-start, 0);
|
|
37
|
+
margin-inline-end: var(--scb-keyfigure-card-spacing-inline-end, 0);
|
|
38
|
+
|
|
39
|
+
--scb-keyfigure-card-padding: var(--spacing-7, 24px);
|
|
40
|
+
--scb-keyfigure-card-gap: var(--spacing-4, 12px);
|
|
41
|
+
--scb-keyfigure-card-keyfigure-gap: var(--spacing-3, 8px);
|
|
42
|
+
|
|
43
|
+
--scb-keyfigure-card-value-size: var(--md-sys-typescale-headline-large-size, 28px);
|
|
44
|
+
--scb-keyfigure-card-value-line-height: var(--md-sys-typescale-headline-large-line-height, 34px);
|
|
45
|
+
--scb-keyfigure-card-value-letter-spacing: var(--md-sys-typescale-headline-large-tracking, -0.6px);
|
|
46
|
+
|
|
47
|
+
--scb-keyfigure-card-subtitle-size: var(--md-sys-typescale-title-medium-size, 18px);
|
|
48
|
+
--scb-keyfigure-card-subtitle-line-height: var(--md-sys-typescale-title-medium-line-height, 26px);
|
|
49
|
+
--scb-keyfigure-card-subtitle-letter-spacing: var(--md-sys-typescale-title-medium-tracking, -0.3px);
|
|
50
|
+
|
|
51
|
+
--scb-keyfigure-card-supporting-size: var(--md-sys-typescale-body-medium-size, 16px);
|
|
52
|
+
--scb-keyfigure-card-supporting-line-height: var(--md-sys-typescale-body-medium-line-height, 24px);
|
|
53
|
+
--scb-keyfigure-card-supporting-letter-spacing: var(--md-sys-typescale-body-medium-tracking, -0.15px);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host([size='medium']) {
|
|
57
|
+
--scb-keyfigure-card-padding: var(--spacing-6, 20px);
|
|
58
|
+
--scb-keyfigure-card-gap: var(--spacing-3, 8px);
|
|
59
|
+
--scb-keyfigure-card-keyfigure-gap: var(--spacing-2, 4px);
|
|
60
|
+
|
|
61
|
+
--scb-keyfigure-card-value-size: var(--md-sys-typescale-headline-small-size, 24px);
|
|
62
|
+
--scb-keyfigure-card-value-line-height: var(--md-sys-typescale-headline-small-line-height, 30px);
|
|
63
|
+
--scb-keyfigure-card-value-letter-spacing: var(--md-sys-typescale-headline-small-tracking, -0.6px);
|
|
64
|
+
|
|
65
|
+
--scb-keyfigure-card-subtitle-size: var(--md-sys-typescale-title-small-size, 16px);
|
|
66
|
+
--scb-keyfigure-card-subtitle-line-height: var(--md-sys-typescale-title-small-line-height, 24px);
|
|
67
|
+
--scb-keyfigure-card-subtitle-letter-spacing: var(--md-sys-typescale-title-small-tracking, -0.2px);
|
|
68
|
+
|
|
69
|
+
--scb-keyfigure-card-supporting-size: var(--md-sys-typescale-body-small-size, 14px);
|
|
70
|
+
--scb-keyfigure-card-supporting-line-height: var(--md-sys-typescale-body-small-line-height, 20px);
|
|
71
|
+
--scb-keyfigure-card-supporting-letter-spacing: var(--md-sys-typescale-body-small-tracking, -0.1px);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:host([size='small']) {
|
|
75
|
+
--scb-keyfigure-card-padding: var(--spacing-5, 16px);
|
|
76
|
+
--scb-keyfigure-card-gap: var(--spacing-3, 8px);
|
|
77
|
+
--scb-keyfigure-card-keyfigure-gap: var(--spacing-2, 4px);
|
|
78
|
+
|
|
79
|
+
--scb-keyfigure-card-value-size: var(--md-sys-typescale-title-large-size, 20px);
|
|
80
|
+
--scb-keyfigure-card-value-line-height: var(--md-sys-typescale-title-large-line-height, 28px);
|
|
81
|
+
--scb-keyfigure-card-value-letter-spacing: var(--md-sys-typescale-title-large-tracking, -0.3px);
|
|
82
|
+
|
|
83
|
+
--scb-keyfigure-card-subtitle-size: var(--md-sys-typescale-body-medium-size, 16px);
|
|
84
|
+
--scb-keyfigure-card-subtitle-line-height: var(--md-sys-typescale-body-medium-line-height, 24px);
|
|
85
|
+
--scb-keyfigure-card-subtitle-letter-spacing: var(--md-sys-typescale-body-medium-tracking, -0.15px);
|
|
86
|
+
|
|
87
|
+
--scb-keyfigure-card-supporting-size: var(--md-sys-typescale-body-small-size, 14px);
|
|
88
|
+
--scb-keyfigure-card-supporting-line-height: var(--md-sys-typescale-body-small-line-height, 20px);
|
|
89
|
+
--scb-keyfigure-card-supporting-letter-spacing: var(--md-sys-typescale-body-small-tracking, -0.1px);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host([size='standard']) {
|
|
93
|
+
--scb-keyfigure-card-value-size: var(--md-sys-typescale-headline-large-size, 28px);
|
|
94
|
+
--scb-keyfigure-card-value-line-height: var(--md-sys-typescale-headline-large-line-height, 34px);
|
|
95
|
+
--scb-keyfigure-card-value-letter-spacing: var(--md-sys-typescale-headline-large-tracking, -0.6px);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* Ska vi ha tabulära eller inte? */
|
|
99
|
+
.scb-keyfigure-card,
|
|
100
|
+
.scb-keyfigure-card .keyfigure,
|
|
101
|
+
.scb-keyfigure-card .value {
|
|
102
|
+
font-variant-numeric: proportional-nums !important;
|
|
103
|
+
font-feature-settings: "tnum" 0, "pnum" 1;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:host([sizing="stretch"]) {
|
|
107
|
+
inline-size: 100%;
|
|
108
|
+
block-size: 100%;
|
|
109
|
+
max-inline-size: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:host([sizing="content-width"]) {
|
|
113
|
+
display: inline-block;
|
|
114
|
+
inline-size: auto;
|
|
115
|
+
block-size: auto;
|
|
116
|
+
}
|
|
117
|
+
:host([sizing="content-width"]) .scb-keyfigure-card {
|
|
118
|
+
inline-size: max-content;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:host([sizing="content-height"]) {
|
|
122
|
+
inline-size: 100%;
|
|
123
|
+
block-size: auto;
|
|
124
|
+
max-inline-size: none;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
md-focus-ring {
|
|
128
|
+
position: absolute;
|
|
129
|
+
inset: 0;
|
|
130
|
+
pointer-events: none;
|
|
131
|
+
display: none;
|
|
132
|
+
border-radius: var(--scb-keyfigure-card-focus-ring-radius, var(--md-sys-shape-corner-large, 16px));
|
|
133
|
+
}
|
|
134
|
+
.scb-keyfigure-card:focus-visible + md-focus-ring { display: block; }
|
|
135
|
+
|
|
136
|
+
.scb-keyfigure-card {
|
|
137
|
+
color: var(--md-sys-color-on-surface, #0F0865);
|
|
138
|
+
font-family: var(--brand-font, "Inter", sans-serif);
|
|
139
|
+
display: flex;
|
|
140
|
+
flex-direction: column;
|
|
141
|
+
gap: var(--scb-keyfigure-card-gap);
|
|
142
|
+
position: relative;
|
|
143
|
+
border-radius: var(--md-sys-shape-corner-large, 16px);
|
|
144
|
+
background: var(--md-sys-color-surface-dim, #F9F8EF);
|
|
145
|
+
padding: var(--scb-keyfigure-card-padding);
|
|
146
|
+
box-sizing: border-box;
|
|
147
|
+
inline-size: 100%;
|
|
148
|
+
max-inline-size: 100%;
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
font-variant-numeric: tabular-nums;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.scb-keyfigure-card:focus,
|
|
154
|
+
.scb-keyfigure-card:focus-visible { outline: none; }
|
|
155
|
+
|
|
156
|
+
.keyfigure {
|
|
157
|
+
display: flex;
|
|
158
|
+
justify-content: space-between;
|
|
159
|
+
align-items: center;
|
|
160
|
+
gap: var(--scb-keyfigure-card-keyfigure-gap);
|
|
161
|
+
font-size: var(--scb-keyfigure-card-value-size);
|
|
162
|
+
font-weight: var(--weight-bold, 700);
|
|
163
|
+
line-height: var(--scb-keyfigure-card-value-line-height);
|
|
164
|
+
letter-spacing: var(--scb-keyfigure-card-value-letter-spacing);
|
|
165
|
+
}
|
|
166
|
+
.keyfigure .value { white-space: nowrap; }
|
|
167
|
+
.keyfigure .unit { margin-inline-start: .25em; white-space: nowrap; }
|
|
168
|
+
|
|
169
|
+
.sub-label {
|
|
170
|
+
font-size: var(--scb-keyfigure-card-subtitle-size);
|
|
171
|
+
font-weight: var(--weight-semibold, 600);
|
|
172
|
+
line-height: var(--scb-keyfigure-card-subtitle-line-height);
|
|
173
|
+
letter-spacing: var(--scb-keyfigure-card-subtitle-letter-spacing);
|
|
174
|
+
|
|
175
|
+
white-space: normal;
|
|
176
|
+
word-break: normal;
|
|
177
|
+
overflow-wrap: normal;
|
|
178
|
+
hyphens: auto;
|
|
179
|
+
overflow: visible;
|
|
180
|
+
text-overflow: clip;
|
|
181
|
+
}
|
|
182
|
+
.sub-label a { color: inherit; text-decoration: none; }
|
|
183
|
+
|
|
184
|
+
.supporting-text {
|
|
185
|
+
font-size: var(--scb-keyfigure-card-supporting-size);
|
|
186
|
+
line-height: var(--scb-keyfigure-card-supporting-line-height);
|
|
187
|
+
letter-spacing: var(--scb-keyfigure-card-supporting-letter-spacing);
|
|
188
|
+
|
|
189
|
+
white-space: normal;
|
|
190
|
+
word-break: normal;
|
|
191
|
+
overflow-wrap: normal;
|
|
192
|
+
hyphens: auto;
|
|
193
|
+
overflow: visible;
|
|
194
|
+
text-overflow: clip;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.scb-keyfigure-card.clickable { cursor: pointer; }
|
|
198
|
+
|
|
199
|
+
:host([size='large']) {
|
|
200
|
+
--scb-keyfigure-card-value-size: var(--md-sys-typescale-display-medium-size, 36px);
|
|
201
|
+
--scb-keyfigure-card-value-line-height: var(--md-sys-typescale-display-medium-line-height, 42px);
|
|
202
|
+
--scb-keyfigure-card-value-letter-spacing: var(--md-sys-typescale-display-medium-tracking, -0.6px);
|
|
203
|
+
}
|
|
204
|
+
`;
|
|
205
|
+
}
|
|
206
|
+
formatNumber(e) {
|
|
207
|
+
if (typeof e == "number") return e.toLocaleString("sv-SE").replace(/\u00A0/g, " ");
|
|
208
|
+
let t = Number(e);
|
|
209
|
+
return Number.isNaN(t) ? String(e) : t.toLocaleString("sv-SE").replace(/\u00A0/g, " ");
|
|
210
|
+
}
|
|
211
|
+
async firstUpdated() {
|
|
212
|
+
o.__iconLoaded || (await import("@material/web/icon/icon.js"), o.__iconLoaded = !0), o.__rippleLoaded || (await import("@material/web/ripple/ripple.js"), o.__rippleLoaded = !0), this.__applyInnerSizing(), this.#e();
|
|
213
|
+
}
|
|
214
|
+
get __effectiveHref() {
|
|
215
|
+
return (this.cardHref || this.href || "").trim();
|
|
216
|
+
}
|
|
217
|
+
render() {
|
|
218
|
+
let e = this.__effectiveHref, t = !!e, n = this.formatNumber(this.keyfigure), i = (this.unit || "").trim(), a = i ? `${n} ${i}` : n;
|
|
219
|
+
return r`
|
|
220
|
+
<div
|
|
221
|
+
class="scb-keyfigure-card ${t ? "clickable" : ""} ${this.size}"
|
|
222
|
+
role=${t ? "link" : "group"}
|
|
223
|
+
tabindex=${t ? "0" : "-1"}
|
|
224
|
+
aria-label=${this.subtitle || a}
|
|
225
|
+
@click=${t ? this.__handleHrefNavigation : null}
|
|
226
|
+
@keydown=${t ? this.__onKeyDown : null}
|
|
227
|
+
style="cursor:${t ? "pointer" : "default"};"
|
|
228
|
+
>
|
|
229
|
+
${t ? r`<md-ripple></md-ripple>` : ""}
|
|
230
|
+
${this.icon ? r`<md-icon>${this.icon}</md-icon>` : ""}
|
|
231
|
+
|
|
232
|
+
${this.keyfigure !== void 0 && this.keyfigure !== null && this.keyfigure !== "" ? r`
|
|
233
|
+
<div class="keyfigure">
|
|
234
|
+
<span class="value" aria-label="${a}">
|
|
235
|
+
${n}${i ? r`<span class="unit" aria-hidden="true">\u00A0${i}</span>` : ""}
|
|
236
|
+
</span>
|
|
237
|
+
${t ? r`<md-icon>arrow_forward</md-icon>` : ""}
|
|
238
|
+
</div>
|
|
239
|
+
` : ""}
|
|
240
|
+
|
|
241
|
+
${this.subtitle ? r`
|
|
242
|
+
<div class="sub-label">
|
|
243
|
+
${t ? r`<a href="${e}" tabindex="-1">${this.subtitle}</a>` : this.subtitle}
|
|
244
|
+
</div>
|
|
245
|
+
` : ""}
|
|
246
|
+
|
|
247
|
+
${this.supportingText ? r`<div class="supporting-text">${this.supportingText}</div>` : ""}
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
${t ? r`<md-focus-ring></md-focus-ring>` : ""}
|
|
251
|
+
`;
|
|
252
|
+
}
|
|
253
|
+
__applyInnerSizing() {
|
|
254
|
+
let e = this.renderRoot.querySelector(".scb-keyfigure-card");
|
|
255
|
+
e && (this.width && this.width.trim() !== "" ? (e.style.inlineSize = "100%", e.style.maxInlineSize = "100%") : (e.style.removeProperty("inline-size"), e.style.removeProperty("max-inline-size")), this.height && this.height.trim() !== "" || this.sizing === "stretch" ? e.style.blockSize = "100%" : e.style.removeProperty("block-size"), this.maxHeight && this.maxHeight.trim() !== "" ? e.style.maxBlockSize = "100%" : e.style.removeProperty("max-block-size"));
|
|
256
|
+
}
|
|
257
|
+
updated(e) {
|
|
258
|
+
super.updated(e), e.has("width") && (this.width ? this.style.inlineSize = this.width : this.style.removeProperty("inline-size")), e.has("maxWidth") && (this.maxWidth ? this.style.maxInlineSize = this.maxWidth : this.style.removeProperty("max-inline-size")), e.has("height") && (this.height ? this.style.blockSize = this.height : this.style.removeProperty("block-size")), e.has("maxHeight") && (this.maxHeight ? this.style.maxBlockSize = this.maxHeight : this.style.removeProperty("max-block-size")), (e.has("width") || e.has("height") || e.has("maxHeight") || e.has("sizing")) && this.__applyInnerSizing(), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this.#e();
|
|
259
|
+
}
|
|
260
|
+
mapSpacingToken(e) {
|
|
261
|
+
if (!e) return;
|
|
262
|
+
let t = String(e).trim();
|
|
263
|
+
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
264
|
+
}
|
|
265
|
+
#e() {
|
|
266
|
+
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);
|
|
267
|
+
t ? this.style.setProperty("--scb-keyfigure-card-spacing-block-start", t) : this.style.removeProperty("--scb-keyfigure-card-spacing-block-start"), n ? this.style.setProperty("--scb-keyfigure-card-spacing-block-end", n) : this.style.removeProperty("--scb-keyfigure-card-spacing-block-end"), r ? this.style.setProperty("--scb-keyfigure-card-spacing-inline-start", r) : this.style.removeProperty("--scb-keyfigure-card-spacing-inline-start"), i ? this.style.setProperty("--scb-keyfigure-card-spacing-inline-end", i) : this.style.removeProperty("--scb-keyfigure-card-spacing-inline-end");
|
|
268
|
+
}
|
|
269
|
+
__dispatchNavigateEvents(e, t) {
|
|
270
|
+
let n = { href: e }, r = new CustomEvent("card-navigate", {
|
|
271
|
+
detail: n,
|
|
272
|
+
bubbles: !0,
|
|
273
|
+
composed: !0,
|
|
274
|
+
cancelable: !0
|
|
275
|
+
}), i = new CustomEvent("cardnavigate", {
|
|
276
|
+
detail: n,
|
|
277
|
+
bubbles: !0,
|
|
278
|
+
composed: !0,
|
|
279
|
+
cancelable: !0
|
|
280
|
+
});
|
|
281
|
+
return this.dispatchEvent(r) && this.dispatchEvent(i);
|
|
282
|
+
}
|
|
283
|
+
__navigate(e, t) {
|
|
284
|
+
this.__dispatchNavigateEvents(e, t) && (window.location.href = e);
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
e([a({ attribute: "keyfigure" })], s.prototype, "keyfigure", void 0), e([a({
|
|
288
|
+
type: String,
|
|
289
|
+
attribute: "subtitle"
|
|
290
|
+
})], s.prototype, "subtitle", void 0), e([a({
|
|
291
|
+
type: String,
|
|
292
|
+
attribute: "supporting-text"
|
|
293
|
+
})], s.prototype, "supportingText", void 0), e([a({
|
|
294
|
+
type: String,
|
|
295
|
+
attribute: "card-href"
|
|
296
|
+
})], s.prototype, "cardHref", void 0), e([a({
|
|
297
|
+
type: String,
|
|
298
|
+
attribute: "href"
|
|
299
|
+
})], s.prototype, "href", void 0), e([a({ type: String })], s.prototype, "icon", void 0), e([a({
|
|
300
|
+
type: String,
|
|
301
|
+
reflect: !0
|
|
302
|
+
})], s.prototype, "size", void 0), e([a({ type: String })], s.prototype, "unit", void 0), e([a({
|
|
303
|
+
type: String,
|
|
304
|
+
reflect: !0
|
|
305
|
+
})], s.prototype, "width", void 0), e([a({
|
|
306
|
+
type: String,
|
|
307
|
+
reflect: !0,
|
|
308
|
+
attribute: "max-width"
|
|
309
|
+
})], s.prototype, "maxWidth", void 0), e([a({
|
|
310
|
+
type: String,
|
|
311
|
+
reflect: !0
|
|
312
|
+
})], s.prototype, "height", void 0), e([a({
|
|
313
|
+
type: String,
|
|
314
|
+
reflect: !0,
|
|
315
|
+
attribute: "max-height"
|
|
316
|
+
})], s.prototype, "maxHeight", void 0), e([a({
|
|
317
|
+
type: String,
|
|
318
|
+
reflect: !0
|
|
319
|
+
})], s.prototype, "sizing", void 0), e([a({
|
|
320
|
+
type: String,
|
|
321
|
+
reflect: !0
|
|
322
|
+
})], s.prototype, "spacing", void 0), e([a({
|
|
323
|
+
type: String,
|
|
324
|
+
reflect: !0,
|
|
325
|
+
attribute: "spacing-top"
|
|
326
|
+
})], s.prototype, "spacingTop", void 0), e([a({
|
|
327
|
+
type: String,
|
|
328
|
+
reflect: !0,
|
|
329
|
+
attribute: "spacing-bottom"
|
|
330
|
+
})], s.prototype, "spacingBottom", void 0), e([a({
|
|
331
|
+
type: String,
|
|
332
|
+
reflect: !0,
|
|
333
|
+
attribute: "spacing-left"
|
|
334
|
+
})], s.prototype, "spacingLeft", void 0), e([a({
|
|
335
|
+
type: String,
|
|
336
|
+
reflect: !0,
|
|
337
|
+
attribute: "spacing-right"
|
|
338
|
+
})], s.prototype, "spacingRight", void 0), s = o = e([i("scb-keyfigure-card")], s);
|
|
339
|
+
//#endregion
|
|
340
|
+
export { s as ScbKeyFigureCard };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.126.0/helpers/decorate.js";
|
|
2
|
+
import { LitElement as t, css as n, html as r } from "lit";
|
|
3
|
+
import { customElement as i, property as a } from "lit/decorators.js";
|
|
4
|
+
import "@material/web/focus/md-focus-ring.js";
|
|
5
|
+
import { ifDefined as o } from "lit/directives/if-defined.js";
|
|
6
|
+
//#region src/scb-test-components/scb-link/scb-link.ts
|
|
7
|
+
var s = class extends t {
|
|
8
|
+
constructor(...e) {
|
|
9
|
+
super(...e), this.href = "", this.disabled = !1, this.ariaLabel = "", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this.#t = (e) => {
|
|
10
|
+
this.disabled && (e.preventDefault(), e.stopPropagation());
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
static {
|
|
14
|
+
this.styles = n`
|
|
15
|
+
:host {
|
|
16
|
+
display: inline-block;
|
|
17
|
+
position: relative;
|
|
18
|
+
padding: var(--scb-link-focus-ring-gap, 4px);
|
|
19
|
+
font-family: var(--brand-font, inherit);
|
|
20
|
+
color: var(--md-sys-color-on-surface);
|
|
21
|
+
width: fit-content;
|
|
22
|
+
margin-block-start: var(--scb-link-spacing-block-start, 0);
|
|
23
|
+
margin-block-end: var(--scb-link-spacing-block-end, 0);
|
|
24
|
+
margin-inline-start: var(--scb-link-spacing-inline-start, 0);
|
|
25
|
+
margin-inline-end: var(--scb-link-spacing-inline-end, 0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
md-focus-ring {
|
|
29
|
+
position: absolute;
|
|
30
|
+
inset: 0;
|
|
31
|
+
pointer-events: none;
|
|
32
|
+
display: none;
|
|
33
|
+
border-radius: var(--scb-link-focus-ring-radius, var(--md-sys-shape-corner-small, 1px));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
a {
|
|
37
|
+
text-decoration: var(--scb-link-decoration, underline);
|
|
38
|
+
text-underline-offset: var(--scb-link-underline-offset, .22em);
|
|
39
|
+
text-decoration-thickness: var(--scb-link-underline-thickness, 1px);
|
|
40
|
+
|
|
41
|
+
color: var(--scb-link-color, var(--md-sys-color-primary));
|
|
42
|
+
border-radius: var(--radius-2, 2px);
|
|
43
|
+
outline: none;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
transition: text-decoration-thickness .12s ease;
|
|
46
|
+
|
|
47
|
+
white-space: var(--scb-link-white-space, normal);
|
|
48
|
+
}
|
|
49
|
+
a:hover { text-decoration-thickness: var(--scb-link-hover-thickness, 2px); }
|
|
50
|
+
a:focus { outline: none; }
|
|
51
|
+
|
|
52
|
+
:host([disabled]) a {
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
opacity: .64;
|
|
55
|
+
text-decoration: none;
|
|
56
|
+
cursor: default;
|
|
57
|
+
}
|
|
58
|
+
a:focus-visible + md-focus-ring {
|
|
59
|
+
display: block;
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
firstUpdated() {
|
|
64
|
+
this.#e();
|
|
65
|
+
}
|
|
66
|
+
updated(e) {
|
|
67
|
+
(e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this.#e();
|
|
68
|
+
}
|
|
69
|
+
mapSpacingToken(e) {
|
|
70
|
+
if (!e) return;
|
|
71
|
+
let t = String(e).trim();
|
|
72
|
+
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
73
|
+
}
|
|
74
|
+
#e() {
|
|
75
|
+
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);
|
|
76
|
+
t ? this.style.setProperty("--scb-link-spacing-block-start", t) : this.style.removeProperty("--scb-link-spacing-block-start"), n ? this.style.setProperty("--scb-link-spacing-block-end", n) : this.style.removeProperty("--scb-link-spacing-block-end"), r ? this.style.setProperty("--scb-link-spacing-inline-start", r) : this.style.removeProperty("--scb-link-spacing-inline-start"), i ? this.style.setProperty("--scb-link-spacing-inline-end", i) : this.style.removeProperty("--scb-link-spacing-inline-end");
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
let e = this.target === "_blank" && !this.rel ? "noopener noreferrer" : this.rel;
|
|
80
|
+
return r`
|
|
81
|
+
<a
|
|
82
|
+
part="anchor"
|
|
83
|
+
href=${o(this.disabled ? void 0 : this.href || void 0)}
|
|
84
|
+
target=${o(this.target)}
|
|
85
|
+
rel=${o(e)}
|
|
86
|
+
download=${o(this.download)}
|
|
87
|
+
aria-disabled=${this.disabled ? "true" : "false"}
|
|
88
|
+
aria-label=${o(this.ariaLabel || void 0)}
|
|
89
|
+
@click=${this.#t}
|
|
90
|
+
><slot></slot></a>
|
|
91
|
+
|
|
92
|
+
<md-focus-ring></md-focus-ring>
|
|
93
|
+
`;
|
|
94
|
+
}
|
|
95
|
+
#t;
|
|
96
|
+
};
|
|
97
|
+
e([a({
|
|
98
|
+
type: String,
|
|
99
|
+
reflect: !0
|
|
100
|
+
})], s.prototype, "href", void 0), e([a({
|
|
101
|
+
type: String,
|
|
102
|
+
reflect: !0
|
|
103
|
+
})], s.prototype, "target", void 0), e([a({
|
|
104
|
+
type: String,
|
|
105
|
+
reflect: !0
|
|
106
|
+
})], s.prototype, "rel", void 0), e([a({
|
|
107
|
+
type: String,
|
|
108
|
+
reflect: !0
|
|
109
|
+
})], s.prototype, "download", void 0), e([a({
|
|
110
|
+
type: Boolean,
|
|
111
|
+
reflect: !0
|
|
112
|
+
})], s.prototype, "disabled", void 0), e([a({
|
|
113
|
+
type: String,
|
|
114
|
+
attribute: "aria-label"
|
|
115
|
+
})], s.prototype, "ariaLabel", void 0), e([a({
|
|
116
|
+
type: String,
|
|
117
|
+
reflect: !0
|
|
118
|
+
})], s.prototype, "spacing", void 0), e([a({
|
|
119
|
+
type: String,
|
|
120
|
+
attribute: "spacing-top",
|
|
121
|
+
reflect: !0
|
|
122
|
+
})], s.prototype, "spacingTop", void 0), e([a({
|
|
123
|
+
type: String,
|
|
124
|
+
attribute: "spacing-bottom",
|
|
125
|
+
reflect: !0
|
|
126
|
+
})], s.prototype, "spacingBottom", void 0), e([a({
|
|
127
|
+
type: String,
|
|
128
|
+
attribute: "spacing-left",
|
|
129
|
+
reflect: !0
|
|
130
|
+
})], s.prototype, "spacingLeft", void 0), e([a({
|
|
131
|
+
type: String,
|
|
132
|
+
attribute: "spacing-right",
|
|
133
|
+
reflect: !0
|
|
134
|
+
})], s.prototype, "spacingRight", void 0), s = e([i("scb-link")], s);
|
|
135
|
+
//#endregion
|
|
136
|
+
export { s as ScbLink };
|