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,317 @@
|
|
|
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 "../scb-search/scb-search.js";
|
|
5
|
+
import "../scb-avatar/scb-avatar.js";
|
|
6
|
+
import { LitElement as t, css as n, html as r } from "lit";
|
|
7
|
+
import { customElement as i, property as a } from "lit/decorators.js";
|
|
8
|
+
//#region src/scb-test-components/scb-app-bar/scb-app-bar.ts
|
|
9
|
+
var o = class extends t {
|
|
10
|
+
constructor(...e) {
|
|
11
|
+
super(...e), this.title = "", this.appBarTitle = "", this.type = "default", this.position = "default", this.searchSupportingText = "", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this.__titleResizeRaf = 0;
|
|
12
|
+
}
|
|
13
|
+
static {
|
|
14
|
+
this.styles = [n`
|
|
15
|
+
:host {
|
|
16
|
+
display: block;
|
|
17
|
+
font-family: var(--brand-font, Inter, Arial, sans-serif);
|
|
18
|
+
position: relative;
|
|
19
|
+
container-type: inline-size;
|
|
20
|
+
container-name: app-bar-container;
|
|
21
|
+
--app-search-height: 64px;
|
|
22
|
+
margin-block-start: var(--scb-app-bar-spacing-block-start, 0);
|
|
23
|
+
margin-block-end: var(--scb-app-bar-spacing-block-end, 0);
|
|
24
|
+
margin-inline-start: var(--scb-app-bar-spacing-inline-start, 0);
|
|
25
|
+
margin-inline-end: var(--scb-app-bar-spacing-inline-end, 0);
|
|
26
|
+
}
|
|
27
|
+
header {
|
|
28
|
+
background: var(--md-sys-color-surface-container);
|
|
29
|
+
color: var(--md-sys-color-on-surface);
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
padding: 0 var(--spacing-5);
|
|
33
|
+
position: relative;
|
|
34
|
+
z-index: 10;
|
|
35
|
+
transition: height 0.3s;
|
|
36
|
+
min-height: var(--app-search-height);
|
|
37
|
+
}
|
|
38
|
+
header.search {
|
|
39
|
+
height: var(--app-search-height);
|
|
40
|
+
}
|
|
41
|
+
header.medium-flexible {
|
|
42
|
+
min-height: 96px;
|
|
43
|
+
}
|
|
44
|
+
header.large-flexible {
|
|
45
|
+
min-height: 128px;
|
|
46
|
+
}
|
|
47
|
+
header.position-top {
|
|
48
|
+
position: fixed;
|
|
49
|
+
top: 0;
|
|
50
|
+
left: 0;
|
|
51
|
+
right: 0;
|
|
52
|
+
z-index: 100;
|
|
53
|
+
}
|
|
54
|
+
header.position-bottom {
|
|
55
|
+
position: fixed;
|
|
56
|
+
bottom: 0;
|
|
57
|
+
left: 0;
|
|
58
|
+
right: 0;
|
|
59
|
+
z-index: 100;
|
|
60
|
+
}
|
|
61
|
+
header.default .trailing {
|
|
62
|
+
margin-inline-start: auto;
|
|
63
|
+
}
|
|
64
|
+
header.default .headline {
|
|
65
|
+
position: absolute;
|
|
66
|
+
inset-inline-start: 50%;
|
|
67
|
+
inset-block-start: 50%;
|
|
68
|
+
transform: translate(-50%, -50%);
|
|
69
|
+
max-width: var(--scb-app-bar-title-max-width, 100%);
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
text-overflow: ellipsis;
|
|
72
|
+
white-space: nowrap;
|
|
73
|
+
}
|
|
74
|
+
.headline {
|
|
75
|
+
flex: 1 1 auto;
|
|
76
|
+
text-align: center;
|
|
77
|
+
font-family: var(--md-sys-typescale-title-large-font, var(--brand-font, Inter, Arial, sans-serif));
|
|
78
|
+
font-size: var(--md-sys-typescale-title-large-size);
|
|
79
|
+
line-height: var(--md-sys-typescale-title-large-Line-Height, calc(var(--md-sys-typescale-title-large-size) * 1.3));
|
|
80
|
+
font-weight: 600;
|
|
81
|
+
margin: 0;
|
|
82
|
+
}
|
|
83
|
+
header.small-flexible .headline {
|
|
84
|
+
text-align: left;
|
|
85
|
+
margin-left: var(--spacing-5);
|
|
86
|
+
}
|
|
87
|
+
header.medium-flexible .headline {
|
|
88
|
+
font-family: var(--md-sys-typescale-headline-small-font, var(--brand-font, Inter, Arial, sans-serif));
|
|
89
|
+
font-size: var(--md-sys-typescale-headline-small-size);
|
|
90
|
+
line-height: 30px; /* denna variabel finns inte, men sätts i figma.. --md-sys-typescale-headline-small-Line-Height2 */
|
|
91
|
+
font-weight: 700;
|
|
92
|
+
letter-spacing: var(--md-sys-typescale-headline-small-Tracking);
|
|
93
|
+
text-align: left;
|
|
94
|
+
margin: 0 0 0 var(--spacing-3);
|
|
95
|
+
}
|
|
96
|
+
header.large-flexible .headline {
|
|
97
|
+
font-family: var(--md-sys-typescale-headline-medium-font, var(--brand-font, Inter, Arial, sans-serif));
|
|
98
|
+
font-size: var(--md-sys-typescale-headline-medium-size);
|
|
99
|
+
font-weight: 700;
|
|
100
|
+
line-height: var(--md-sys-typescale-headline-medium-Line-Height);
|
|
101
|
+
letter-spacing: var(--md-sys-typescale-headline-medium-Tracking);
|
|
102
|
+
text-align: left;
|
|
103
|
+
margin: 0 0 0 var(--spacing-3);
|
|
104
|
+
}
|
|
105
|
+
.search-container {
|
|
106
|
+
flex: 1 1 auto;
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
padding: 0 var(--spacing-3);
|
|
111
|
+
}
|
|
112
|
+
.trailing{
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
gap: var(--spacing-2);
|
|
116
|
+
}
|
|
117
|
+
.leading {
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
gap: var(--spacing-2);
|
|
121
|
+
}
|
|
122
|
+
`];
|
|
123
|
+
}
|
|
124
|
+
connectedCallback() {
|
|
125
|
+
super.connectedCallback(), typeof ResizeObserver < "u" && (this.__titleResizeObserver = new ResizeObserver(() => this.#e()));
|
|
126
|
+
}
|
|
127
|
+
disconnectedCallback() {
|
|
128
|
+
this.__titleResizeRaf &&= (cancelAnimationFrame(this.__titleResizeRaf), 0), this.__titleResizeObserver?.disconnect(), this.__titleResizeObserver = void 0, super.disconnectedCallback();
|
|
129
|
+
}
|
|
130
|
+
handleActionsSlotChange(e) {
|
|
131
|
+
e.target.assignedElements({ flatten: !0 }).forEach((e) => {
|
|
132
|
+
if (e.tagName === "SCB-BUTTON") {
|
|
133
|
+
let t = e;
|
|
134
|
+
t.hasAttribute("size") || t.setAttribute("size", "small");
|
|
135
|
+
}
|
|
136
|
+
}), this.#e();
|
|
137
|
+
}
|
|
138
|
+
handleAvatarSlotChange(e) {
|
|
139
|
+
e.target.assignedElements({ flatten: !0 }).forEach((e) => {
|
|
140
|
+
e.tagName === "SCB-AVATAR" && e.setAttribute("size", "small");
|
|
141
|
+
}), this.#e();
|
|
142
|
+
}
|
|
143
|
+
firstUpdated() {
|
|
144
|
+
this.#a(), this.#t();
|
|
145
|
+
}
|
|
146
|
+
updated(e) {
|
|
147
|
+
(e.has("title") || e.has("appBarTitle")) && (this.dispatchEvent(new CustomEvent("title-changed", {
|
|
148
|
+
detail: { title: this.#o },
|
|
149
|
+
bubbles: !0,
|
|
150
|
+
composed: !0
|
|
151
|
+
})), this.dispatchEvent(new CustomEvent("app-bar-title-changed", {
|
|
152
|
+
detail: { appBarTitle: this.#o },
|
|
153
|
+
bubbles: !0,
|
|
154
|
+
composed: !0
|
|
155
|
+
}))), e.has("position") && this.dispatchEvent(new CustomEvent("position-changed", {
|
|
156
|
+
detail: { position: this.position },
|
|
157
|
+
bubbles: !0,
|
|
158
|
+
composed: !0
|
|
159
|
+
})), e.has("type") && (this.dispatchEvent(new CustomEvent("type-changed", {
|
|
160
|
+
detail: { type: this.type },
|
|
161
|
+
bubbles: !0,
|
|
162
|
+
composed: !0
|
|
163
|
+
})), this.#t()), e.has("searchSupportingText") && this.dispatchEvent(new CustomEvent("search-supporting-text-changed", {
|
|
164
|
+
detail: { searchSupportingText: this.searchSupportingText },
|
|
165
|
+
bubbles: !0,
|
|
166
|
+
composed: !0
|
|
167
|
+
})), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this.#a();
|
|
168
|
+
}
|
|
169
|
+
#e() {
|
|
170
|
+
this.type === "default" && (this.__titleResizeRaf ||= requestAnimationFrame(() => {
|
|
171
|
+
this.__titleResizeRaf = 0, this.#i();
|
|
172
|
+
}));
|
|
173
|
+
}
|
|
174
|
+
#t() {
|
|
175
|
+
this.__titleResizeObserver?.disconnect();
|
|
176
|
+
let e = this.shadowRoot?.querySelector("header");
|
|
177
|
+
if (e && e.style.removeProperty("--scb-app-bar-title-max-width"), this.type !== "default" || !this.__titleResizeObserver) return;
|
|
178
|
+
let t = this.shadowRoot?.querySelector("header.default");
|
|
179
|
+
if (!t) return;
|
|
180
|
+
let n = t.querySelector(".leading"), r = t.querySelector(".trailing");
|
|
181
|
+
!n || !r || (this.__titleResizeObserver.observe(t), this.__titleResizeObserver.observe(n), this.__titleResizeObserver.observe(r), this.#e());
|
|
182
|
+
}
|
|
183
|
+
#n(e) {
|
|
184
|
+
if (!e) return 0;
|
|
185
|
+
let t = parseFloat(e);
|
|
186
|
+
return Number.isFinite(t) ? t : 0;
|
|
187
|
+
}
|
|
188
|
+
#r(e) {
|
|
189
|
+
let t = getComputedStyle(e);
|
|
190
|
+
return this.#n(t.columnGap || t.gap);
|
|
191
|
+
}
|
|
192
|
+
#i() {
|
|
193
|
+
let e = this.shadowRoot?.querySelector("header.default");
|
|
194
|
+
if (!e) return;
|
|
195
|
+
let t = e.querySelector(".leading"), n = e.querySelector(".trailing");
|
|
196
|
+
if (!t || !n) return;
|
|
197
|
+
let r = e.getBoundingClientRect(), i = t.getBoundingClientRect(), a = n.getBoundingClientRect(), o = getComputedStyle(e), s = this.#n(o.paddingInlineStart || o.paddingLeft), c = this.#n(o.paddingInlineEnd || o.paddingRight), l = Math.max(0, r.width - s - c), u = Math.max(i.width, a.width), d = Math.max(this.#r(t), this.#r(n)), f = Math.max(0, l - u * 2 - d * 2);
|
|
198
|
+
e.style.setProperty("--scb-app-bar-title-max-width", `${f}px`);
|
|
199
|
+
}
|
|
200
|
+
mapSpacingToken(e) {
|
|
201
|
+
if (!e) return;
|
|
202
|
+
let t = String(e).trim();
|
|
203
|
+
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
204
|
+
}
|
|
205
|
+
#a() {
|
|
206
|
+
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);
|
|
207
|
+
t ? this.style.setProperty("--scb-app-bar-spacing-block-start", t) : this.style.removeProperty("--scb-app-bar-spacing-block-start"), n ? this.style.setProperty("--scb-app-bar-spacing-block-end", n) : this.style.removeProperty("--scb-app-bar-spacing-block-end"), r ? this.style.setProperty("--scb-app-bar-spacing-inline-start", r) : this.style.removeProperty("--scb-app-bar-spacing-inline-start"), i ? this.style.setProperty("--scb-app-bar-spacing-inline-end", i) : this.style.removeProperty("--scb-app-bar-spacing-inline-end");
|
|
208
|
+
}
|
|
209
|
+
get #o() {
|
|
210
|
+
return this.appBarTitle || this.title;
|
|
211
|
+
}
|
|
212
|
+
render() {
|
|
213
|
+
switch (this.type) {
|
|
214
|
+
case "small-flexible": return r`
|
|
215
|
+
<header class="small-flexible ${this.position == "bottom" ? "position-bottom" : this.position == "top" ? "position-top" : ""}" role="banner" aria-label="Small app bar">
|
|
216
|
+
<div class="leading">
|
|
217
|
+
<slot name="leading" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
218
|
+
</div>
|
|
219
|
+
<h1 class="headline">${this.#o}</h1>
|
|
220
|
+
<div class="trailing">
|
|
221
|
+
<slot name="trailing" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
222
|
+
<slot name="avatar" @slotchange=${this.handleAvatarSlotChange}></slot>
|
|
223
|
+
</div>
|
|
224
|
+
</header>
|
|
225
|
+
`;
|
|
226
|
+
case "medium-flexible": return r`
|
|
227
|
+
<header class="medium-flexible ${this.position == "bottom" ? "position-bottom" : this.position == "top" ? "position-top" : ""}" role="banner" aria-label="Medium flexible app bar">
|
|
228
|
+
<div class="leading">
|
|
229
|
+
<slot name="leading" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
230
|
+
</div>
|
|
231
|
+
<h1 class="headline">${this.#o}</h1>
|
|
232
|
+
<div class="trailing">
|
|
233
|
+
<slot name="trailing" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
234
|
+
<slot name="avatar" @slotchange=${this.handleAvatarSlotChange}></slot>
|
|
235
|
+
</div>
|
|
236
|
+
</header>
|
|
237
|
+
`;
|
|
238
|
+
case "large-flexible": return r`
|
|
239
|
+
<header class="large-flexible ${this.position == "bottom" ? "position-bottom" : this.position == "top" ? "position-top" : ""}" role="banner" aria-label="Large flexible app bar">
|
|
240
|
+
<div class="leading">
|
|
241
|
+
<slot name="leading" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
242
|
+
</div>
|
|
243
|
+
<h1 class="headline">${this.#o}</h1>
|
|
244
|
+
<div class="trailing">
|
|
245
|
+
<slot name="trailing" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
246
|
+
<slot name="avatar" @slotchange=${this.handleAvatarSlotChange}></slot>
|
|
247
|
+
</div>
|
|
248
|
+
</header>
|
|
249
|
+
`;
|
|
250
|
+
case "search": return r`
|
|
251
|
+
<header class="search ${this.position == "bottom" ? "position-bottom" : this.position == "top" ? "position-top" : ""}" role="banner" aria-label="Search app bar">
|
|
252
|
+
<div class="leading">
|
|
253
|
+
<slot name="leading" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
254
|
+
</div>
|
|
255
|
+
<div class="search-container">
|
|
256
|
+
<scb-search size="small" supporting-text=${this.searchSupportingText}></scb-search>
|
|
257
|
+
</div>
|
|
258
|
+
<div class="trailing">
|
|
259
|
+
<slot name="trailing" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
260
|
+
<slot name="avatar" @slotchange=${this.handleAvatarSlotChange}></slot>
|
|
261
|
+
</div>
|
|
262
|
+
</header>
|
|
263
|
+
`;
|
|
264
|
+
default: return r`
|
|
265
|
+
<header class="default ${this.position == "bottom" ? "position-bottom" : this.position == "top" ? "position-top" : ""}" role="banner" aria-label="Small app bar">
|
|
266
|
+
<div class="leading">
|
|
267
|
+
<slot name="leading" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
268
|
+
</div>
|
|
269
|
+
<h1 class="headline">${this.#o}</h1>
|
|
270
|
+
<div class="trailing">
|
|
271
|
+
<slot name="trailing" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
272
|
+
<slot name="avatar" @slotchange=${this.handleAvatarSlotChange}></slot>
|
|
273
|
+
</div>
|
|
274
|
+
</header>
|
|
275
|
+
`;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
e([a({
|
|
280
|
+
type: String,
|
|
281
|
+
reflect: !0
|
|
282
|
+
})], o.prototype, "title", void 0), e([a({
|
|
283
|
+
type: String,
|
|
284
|
+
attribute: "app-bar-title",
|
|
285
|
+
reflect: !0
|
|
286
|
+
})], o.prototype, "appBarTitle", void 0), e([a({
|
|
287
|
+
type: String,
|
|
288
|
+
reflect: !0
|
|
289
|
+
})], o.prototype, "type", void 0), e([a({
|
|
290
|
+
type: String,
|
|
291
|
+
reflect: !0
|
|
292
|
+
})], o.prototype, "position", void 0), e([a({
|
|
293
|
+
type: String,
|
|
294
|
+
attribute: "search-supporting-text",
|
|
295
|
+
reflect: !0
|
|
296
|
+
})], o.prototype, "searchSupportingText", void 0), e([a({
|
|
297
|
+
type: String,
|
|
298
|
+
reflect: !0
|
|
299
|
+
})], o.prototype, "spacing", void 0), e([a({
|
|
300
|
+
type: String,
|
|
301
|
+
attribute: "spacing-top",
|
|
302
|
+
reflect: !0
|
|
303
|
+
})], o.prototype, "spacingTop", void 0), e([a({
|
|
304
|
+
type: String,
|
|
305
|
+
attribute: "spacing-bottom",
|
|
306
|
+
reflect: !0
|
|
307
|
+
})], o.prototype, "spacingBottom", void 0), e([a({
|
|
308
|
+
type: String,
|
|
309
|
+
attribute: "spacing-left",
|
|
310
|
+
reflect: !0
|
|
311
|
+
})], o.prototype, "spacingLeft", void 0), e([a({
|
|
312
|
+
type: String,
|
|
313
|
+
attribute: "spacing-right",
|
|
314
|
+
reflect: !0
|
|
315
|
+
})], o.prototype, "spacingRight", void 0), o = e([i("scb-app-bar")], o);
|
|
316
|
+
//#endregion
|
|
317
|
+
export { o as ScbAppBar };
|
|
@@ -0,0 +1,197 @@
|
|
|
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, state as s } from "lit/decorators.js";
|
|
4
|
+
//#region src/scb-test-components/scb-avatar/scb-avatar.ts
|
|
5
|
+
var c = class extends t {
|
|
6
|
+
constructor(...e) {
|
|
7
|
+
super(...e), this.src = "", this.alt = "", this.label = "", this.size = "medium", this.shape = "circular", this.iconName = "", this.variant = "image", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this._imgError = !1, this._hasIconSlot = !1, this._onImgLoad = () => {
|
|
8
|
+
this._imgError = !1, this.dispatchEvent(new CustomEvent("image-load", {
|
|
9
|
+
bubbles: !0,
|
|
10
|
+
composed: !0
|
|
11
|
+
}));
|
|
12
|
+
}, this._onImgError = () => {
|
|
13
|
+
this._imgError = !0, this.dispatchEvent(new CustomEvent("image-error", {
|
|
14
|
+
bubbles: !0,
|
|
15
|
+
composed: !0
|
|
16
|
+
}));
|
|
17
|
+
}, this._onIconSlotChange = (e) => {
|
|
18
|
+
let t = e.currentTarget;
|
|
19
|
+
this._hasIconSlot = (t.assignedNodes({ flatten: !0 }) || []).length > 0;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
static {
|
|
23
|
+
this.styles = n`
|
|
24
|
+
:host {
|
|
25
|
+
display: inline-block;
|
|
26
|
+
vertical-align: middle;
|
|
27
|
+
margin-block-start: var(--scb-avatar-spacing-block-start, 0);
|
|
28
|
+
margin-block-end: var(--scb-avatar-spacing-block-end, 0);
|
|
29
|
+
margin-inline-start: var(--scb-avatar-spacing-inline-start, 0);
|
|
30
|
+
margin-inline-end: var(--scb-avatar-spacing-inline-end, 0);
|
|
31
|
+
|
|
32
|
+
--_size: 40px;
|
|
33
|
+
--_font-size: 16px;
|
|
34
|
+
--_bg: var(--md-sys-color-primary-fixed-dim, var(--md-sys-color-primary-container));
|
|
35
|
+
--_fg: var(--md-sys-color-on-primary-fixed, var(--md-sys-color-on-primary-container));
|
|
36
|
+
--_radius: var(--radius-full, 1000px);
|
|
37
|
+
--_border: 0 solid transparent;
|
|
38
|
+
|
|
39
|
+
font-family: var(--brand-font, Inter, system-ui, sans-serif);
|
|
40
|
+
color-scheme: light dark;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host([size="small"]) { --_size: 32px; --_font-size: var(--md-sys-typescale-label-medium-size, 14px); }
|
|
44
|
+
:host([size="medium"]) { --_size: 40px; --_font-size: var(--md-sys-typescale-label-large-size, 16px); }
|
|
45
|
+
:host([size="large"]) { --_size: 56px; --_font-size: var(--md-sys-typescale-title-large-size, 20px); }
|
|
46
|
+
:host([size="xlarge"]) { --_size: 80px; --_font-size: var(--md-sys-typescale-headline-medium-size, 28px); }
|
|
47
|
+
|
|
48
|
+
:host([shape="circular"]) { --_radius: var(--radius-full, 1000px); }
|
|
49
|
+
:host([shape="rounded"]) { --_radius: var(--radius-s, 8px); }
|
|
50
|
+
:host([shape="square"]) { --_radius: 0; }
|
|
51
|
+
|
|
52
|
+
.container {
|
|
53
|
+
inline-size: var(--_size);
|
|
54
|
+
block-size: var(--_size);
|
|
55
|
+
border-radius: var(--_radius);
|
|
56
|
+
position: relative;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
user-select: none;
|
|
59
|
+
line-height: 1;
|
|
60
|
+
border: var(--_border);
|
|
61
|
+
display: grid;
|
|
62
|
+
place-items: center;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:host([variant="image"]) .container { background: none; }
|
|
66
|
+
:host([variant="image"]) img.photo {
|
|
67
|
+
width: 100%;
|
|
68
|
+
height: 100%;
|
|
69
|
+
object-fit: cover;
|
|
70
|
+
display: block;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host([size="small"]) { --_icon-size: var(--icon-size-small, 20px); }
|
|
74
|
+
:host([size="medium"]) { --_icon-size: var(--icon-size-medium, 24px); }
|
|
75
|
+
:host([size="large"]) { --_icon-size: var(--icon-size-large, 30px); }
|
|
76
|
+
:host([size="xlarge"]) { --_icon-size: var(--icon-size-xlarge, 48px); }
|
|
77
|
+
:host([variant="icon"]) .container { background: var(--_bg); color: var(--_fg); }
|
|
78
|
+
|
|
79
|
+
img.icon {
|
|
80
|
+
width: var(--_icon-size);
|
|
81
|
+
height: var(--_icon-size);
|
|
82
|
+
object-fit: contain;
|
|
83
|
+
display: block;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.fallback {
|
|
87
|
+
display: grid;
|
|
88
|
+
place-items: center;
|
|
89
|
+
width: 100%;
|
|
90
|
+
height: 100%;
|
|
91
|
+
font-size: var(--_font-size);
|
|
92
|
+
font-weight: var(--weight-semibold, 600);
|
|
93
|
+
letter-spacing: .01em;
|
|
94
|
+
text-transform: uppercase;
|
|
95
|
+
color: var(--_fg);
|
|
96
|
+
background: var(--_bg);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:host([variant="image"]) .fallback {
|
|
100
|
+
color: var(--md-sys-color-on-primary-container);
|
|
101
|
+
background: var(--md-sys-color-primary-container);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
::slotted([slot="icon"]) {
|
|
105
|
+
width: var(--_icon-size);
|
|
106
|
+
height: var(--_icon-size);
|
|
107
|
+
line-height: 1;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:host(:focus-visible) .container {
|
|
111
|
+
outline: var(--md-focus-ring-width, 2px) solid var(--md-focus-ring-color, var(--p-40));
|
|
112
|
+
outline-offset: 2px;
|
|
113
|
+
border-radius: var(--_radius);
|
|
114
|
+
}
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
async firstUpdated() {
|
|
118
|
+
this.variant === "icon" && await import("@material/web/icon/icon.js"), this.#e();
|
|
119
|
+
}
|
|
120
|
+
updated(e) {
|
|
121
|
+
super.updated(e), e.has("variant") && this.variant === "icon" && import("@material/web/icon/icon.js"), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this.#e();
|
|
122
|
+
}
|
|
123
|
+
_initials() {
|
|
124
|
+
let e = (this.label || this.alt || "").trim();
|
|
125
|
+
if (!e) return "?";
|
|
126
|
+
let t = e.split(/\s+/).filter(Boolean);
|
|
127
|
+
return t.length === 1 ? t[0].slice(0, 1).toUpperCase() : (t[0].slice(0, 1) + t[t.length - 1].slice(0, 1)).toUpperCase();
|
|
128
|
+
}
|
|
129
|
+
_ariaLabel() {
|
|
130
|
+
return (this.label || this.alt || "").trim() || null;
|
|
131
|
+
}
|
|
132
|
+
mapSpacingToken(e) {
|
|
133
|
+
if (!e) return;
|
|
134
|
+
let t = String(e).trim();
|
|
135
|
+
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
136
|
+
}
|
|
137
|
+
#e() {
|
|
138
|
+
let e = this.mapSpacingToken(this.spacing), t = this.mapSpacingToken(this.spacingTop) ?? e, n = this.mapSpacingToken(this.spacingBottom) ?? e, r = this.mapSpacingToken(this.spacingLeft) ?? e, i = this.mapSpacingToken(this.spacingRight) ?? e;
|
|
139
|
+
t ? this.style.setProperty("--scb-avatar-spacing-block-start", t) : this.style.removeProperty("--scb-avatar-spacing-block-start"), n ? this.style.setProperty("--scb-avatar-spacing-block-end", n) : this.style.removeProperty("--scb-avatar-spacing-block-end"), r ? this.style.setProperty("--scb-avatar-spacing-inline-start", r) : this.style.removeProperty("--scb-avatar-spacing-inline-start"), i ? this.style.setProperty("--scb-avatar-spacing-inline-end", i) : this.style.removeProperty("--scb-avatar-spacing-inline-end");
|
|
140
|
+
}
|
|
141
|
+
render() {
|
|
142
|
+
let e = this._ariaLabel(), t = this.variant === "image" && !!this.src && !this._imgError, n = r`${i}
|
|
143
|
+
<slot name="icon" @slotchange=${this._onIconSlotChange}></slot>
|
|
144
|
+
${this._hasIconSlot ? i : this.iconName ? r`<md-icon aria-hidden="true">${this.iconName}</md-icon>` : r`<div class="fallback" part="fallback">${this._initials()}</div>`}
|
|
145
|
+
`, a = t ? r`<img
|
|
146
|
+
class="photo"
|
|
147
|
+
part="image"
|
|
148
|
+
src=${this.src}
|
|
149
|
+
alt=${this.alt}
|
|
150
|
+
@load=${this._onImgLoad}
|
|
151
|
+
@error=${this._onImgError}
|
|
152
|
+
/>` : r`
|
|
153
|
+
<slot name="icon" @slotchange=${this._onIconSlotChange}></slot>
|
|
154
|
+
${this._hasIconSlot ? i : this.iconName ? r`<md-icon aria-hidden="true">${this.iconName}</md-icon>` : r`<div class="fallback" part="fallback">${this._initials()}</div>`}
|
|
155
|
+
`;
|
|
156
|
+
return r`
|
|
157
|
+
<div class="container" part="container" role="img" aria-label=${e ?? i}>
|
|
158
|
+
${this.variant === "icon" ? n : a}
|
|
159
|
+
</div>
|
|
160
|
+
`;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
e([o({ type: String })], c.prototype, "src", void 0), e([o({ type: String })], c.prototype, "alt", void 0), e([o({ type: String })], c.prototype, "label", void 0), e([o({
|
|
164
|
+
type: String,
|
|
165
|
+
reflect: !0
|
|
166
|
+
})], c.prototype, "size", void 0), e([o({
|
|
167
|
+
type: String,
|
|
168
|
+
reflect: !0
|
|
169
|
+
})], c.prototype, "shape", void 0), e([o({
|
|
170
|
+
type: String,
|
|
171
|
+
attribute: "icon-name",
|
|
172
|
+
reflect: !0
|
|
173
|
+
})], c.prototype, "iconName", void 0), e([o({
|
|
174
|
+
type: String,
|
|
175
|
+
reflect: !0
|
|
176
|
+
})], c.prototype, "variant", void 0), e([o({
|
|
177
|
+
type: String,
|
|
178
|
+
reflect: !0
|
|
179
|
+
})], c.prototype, "spacing", void 0), e([o({
|
|
180
|
+
type: String,
|
|
181
|
+
attribute: "spacing-top",
|
|
182
|
+
reflect: !0
|
|
183
|
+
})], c.prototype, "spacingTop", void 0), e([o({
|
|
184
|
+
type: String,
|
|
185
|
+
attribute: "spacing-bottom",
|
|
186
|
+
reflect: !0
|
|
187
|
+
})], c.prototype, "spacingBottom", void 0), e([o({
|
|
188
|
+
type: String,
|
|
189
|
+
attribute: "spacing-left",
|
|
190
|
+
reflect: !0
|
|
191
|
+
})], c.prototype, "spacingLeft", void 0), e([o({
|
|
192
|
+
type: String,
|
|
193
|
+
attribute: "spacing-right",
|
|
194
|
+
reflect: !0
|
|
195
|
+
})], c.prototype, "spacingRight", void 0), e([s()], c.prototype, "_imgError", void 0), e([s()], c.prototype, "_hasIconSlot", void 0), c = e([a("scb-avatar")], c);
|
|
196
|
+
//#endregion
|
|
197
|
+
export { c as ScbAvatar };
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.126.0/helpers/decorate.js";
|
|
2
|
+
import { LitElement as t, css as n, html as r } from "lit";
|
|
3
|
+
import { customElement as i, property as a } from "lit/decorators.js";
|
|
4
|
+
//#region src/scb-test-components/scb-badge/scb-badge.ts
|
|
5
|
+
var o = class extends t {
|
|
6
|
+
constructor(...e) {
|
|
7
|
+
super(...e), this._slotClickHandler = (e) => {
|
|
8
|
+
let t = this.shadowRoot?.querySelector("slot"), n = e.target;
|
|
9
|
+
n && n !== t && n.dispatchEvent(new CustomEvent("hide-badge", {
|
|
10
|
+
bubbles: !0,
|
|
11
|
+
composed: !0
|
|
12
|
+
}));
|
|
13
|
+
}, this.autoHide = !1, this.sizing = "fit-content", this.position = "relative", this.positionTop = 0, this.positionRight = void 0, this.positionSide = "right", this.positionLeft = void 0, this.value = "", this.label = "", this.hidden = !1, this.variant = "dot", this._badgeVisible = !0, this._onHideBadge = () => {
|
|
14
|
+
this._badgeVisible = !1, this.requestUpdate();
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
static {
|
|
18
|
+
this.styles = n`
|
|
19
|
+
:host {
|
|
20
|
+
display: block;
|
|
21
|
+
position: relative;
|
|
22
|
+
overflow: visible;
|
|
23
|
+
width: fit-content;
|
|
24
|
+
--scb-badge-font-size: var(--scale-01);
|
|
25
|
+
--scb-badge-line-height: 100%;
|
|
26
|
+
--scb-badge-relative-gap: 0px;
|
|
27
|
+
--scb-badge-background-color: var(--md-sys-color-error);
|
|
28
|
+
--scb-badge-color: var(--md-sys-color-on-error);
|
|
29
|
+
--scb-badge-width: 8px;
|
|
30
|
+
--scb-badge-height: 8px;
|
|
31
|
+
}
|
|
32
|
+
:host([sizing="fit-parent"]) {
|
|
33
|
+
width: 100%;
|
|
34
|
+
}
|
|
35
|
+
:host([variant="value"]) .badge {
|
|
36
|
+
width: fit-content;
|
|
37
|
+
padding: 6px;
|
|
38
|
+
}
|
|
39
|
+
:host([variant="value"]) .badge.badge-value-empty{
|
|
40
|
+
width: var(--scb-badge-width);
|
|
41
|
+
padding: var(--spacing-2);
|
|
42
|
+
}
|
|
43
|
+
:host([hidden]) .badge {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
.badge {
|
|
47
|
+
transition: transform 0.25s cubic-bezier(.4,2,.6,1), opacity 0.18s linear;
|
|
48
|
+
will-change: transform, opacity;
|
|
49
|
+
}
|
|
50
|
+
.badge--hide {
|
|
51
|
+
opacity: 0;
|
|
52
|
+
transform: scale(1.3);
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
}
|
|
55
|
+
.badge{
|
|
56
|
+
background-color: var(--scb-badge-background-color);
|
|
57
|
+
color: var(--scb-badge-color);
|
|
58
|
+
font-size: var(--scb-badge-font-size);
|
|
59
|
+
font-weight: var(--weight-semibold);
|
|
60
|
+
line-height: var(--scb-badge-line-height);
|
|
61
|
+
letter-spacing: var(--md-sys-typescale-label-medium-tracking);
|
|
62
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
width: var(--scb-badge-width);
|
|
67
|
+
height: var(--scb-badge-height);
|
|
68
|
+
position: absolute;
|
|
69
|
+
top: var(--scb-badge-absolute-top);
|
|
70
|
+
left: calc(100% - var(--scb-badge-absolute-right));
|
|
71
|
+
white-space: nowrap;
|
|
72
|
+
}
|
|
73
|
+
:host([position-side="left"]) .badge {
|
|
74
|
+
left: var(--scb-badge-absolute-left);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host([position="relative"]) .badge {
|
|
78
|
+
position: relative;
|
|
79
|
+
top: unset;
|
|
80
|
+
left: unset;
|
|
81
|
+
}
|
|
82
|
+
:host([position="relative"]) .badge-content {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
gap: var(--scb-badge-relative-gap);
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
89
|
+
}
|
|
90
|
+
firstUpdated() {
|
|
91
|
+
let e = this.shadowRoot?.querySelector("slot");
|
|
92
|
+
this.autoHide && e && e.addEventListener("click", this._slotClickHandler);
|
|
93
|
+
}
|
|
94
|
+
updated() {
|
|
95
|
+
let e = this.shadowRoot?.querySelector("slot");
|
|
96
|
+
e && (this.autoHide ? e.addEventListener("click", this._slotClickHandler) : e.removeEventListener("click", this._slotClickHandler));
|
|
97
|
+
}
|
|
98
|
+
connectedCallback() {
|
|
99
|
+
super.connectedCallback(), this.addEventListener("hide-badge", this._onHideBadge);
|
|
100
|
+
}
|
|
101
|
+
disconnectedCallback() {
|
|
102
|
+
this.removeEventListener("hide-badge", this._onHideBadge), super.disconnectedCallback();
|
|
103
|
+
}
|
|
104
|
+
mapSpacingToken(e) {
|
|
105
|
+
if (e == null) return;
|
|
106
|
+
if (typeof e == "number" && !Number.isNaN(e)) return `${e}px`;
|
|
107
|
+
let t = String(e).trim();
|
|
108
|
+
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
109
|
+
}
|
|
110
|
+
render() {
|
|
111
|
+
let e = this.mapSpacingToken(this.positionRight) ?? "var(--spacing-4)", t = this.mapSpacingToken(this.positionLeft) ?? "var(--spacing-4)", n = this.mapSpacingToken(this.positionTop) ?? "0px";
|
|
112
|
+
this.style.setProperty("--scb-badge-absolute-top", n), this.style.setProperty("--scb-badge-absolute-right", e), this.style.setProperty("--scb-badge-absolute-left", t);
|
|
113
|
+
let i = this.value;
|
|
114
|
+
!isNaN(Number(this.value)) && this.value.length > 4 && (i = this.value.slice(0, 4) + "+");
|
|
115
|
+
let a = this.variant === "value" && !this.value ? "badge-value-empty" : "", o = this._badgeVisible ? "" : "badge--hide", s = this.label || (this.variant === "dot" ? "Indikator" : `Märke: ${i}`);
|
|
116
|
+
return r`
|
|
117
|
+
<div class="badge-content">
|
|
118
|
+
<slot></slot>
|
|
119
|
+
<div
|
|
120
|
+
class="badge ${a} ${o}"
|
|
121
|
+
role="status"
|
|
122
|
+
aria-label="${this.variant, s}"
|
|
123
|
+
aria-hidden="${this.variant === "dot" && !this.label ? "true" : "false"}">${this.variant === "dot" ? "" : i}</div>
|
|
124
|
+
</div>
|
|
125
|
+
`;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
e([a({
|
|
129
|
+
type: Boolean,
|
|
130
|
+
reflect: !0,
|
|
131
|
+
attribute: "auto-hide"
|
|
132
|
+
})], o.prototype, "autoHide", void 0), e([a({
|
|
133
|
+
type: String,
|
|
134
|
+
reflect: !0
|
|
135
|
+
})], o.prototype, "sizing", void 0), e([a({
|
|
136
|
+
type: String,
|
|
137
|
+
reflect: !0
|
|
138
|
+
})], o.prototype, "position", void 0), e([a({
|
|
139
|
+
type: String,
|
|
140
|
+
attribute: "position-top"
|
|
141
|
+
})], o.prototype, "positionTop", void 0), e([a({
|
|
142
|
+
type: String,
|
|
143
|
+
attribute: "position-right"
|
|
144
|
+
})], o.prototype, "positionRight", void 0), e([a({
|
|
145
|
+
type: String,
|
|
146
|
+
reflect: !0,
|
|
147
|
+
attribute: "position-side"
|
|
148
|
+
})], o.prototype, "positionSide", void 0), e([a({
|
|
149
|
+
type: String,
|
|
150
|
+
attribute: "position-left"
|
|
151
|
+
})], o.prototype, "positionLeft", void 0), e([a({
|
|
152
|
+
type: String,
|
|
153
|
+
reflect: !0
|
|
154
|
+
})], o.prototype, "value", void 0), e([a({
|
|
155
|
+
type: String,
|
|
156
|
+
reflect: !0
|
|
157
|
+
})], o.prototype, "label", void 0), e([a({
|
|
158
|
+
type: Boolean,
|
|
159
|
+
reflect: !0
|
|
160
|
+
})], o.prototype, "hidden", void 0), e([a({
|
|
161
|
+
type: String,
|
|
162
|
+
reflect: !0
|
|
163
|
+
})], o.prototype, "variant", void 0), o = e([i("scb-badge")], o);
|
|
164
|
+
//#endregion
|
|
165
|
+
export { o as ScbBadge };
|