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,438 @@
|
|
|
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-link/scb-link.js";
|
|
5
|
+
import { LitElement as t, css as n, html as r } from "lit";
|
|
6
|
+
import { customElement as i, property as a } from "lit/decorators.js";
|
|
7
|
+
import "@material/web/focus/md-focus-ring.js";
|
|
8
|
+
import "@material/web/icon/icon.js";
|
|
9
|
+
//#region src/scb-test-components/scb-pagination/scb-pagination.ts
|
|
10
|
+
var o = class extends t {
|
|
11
|
+
constructor(...e) {
|
|
12
|
+
super(...e), this.variant = "icon-text", this.page = 1, this.totalPages = 0, this.pagingHref = "", this.baseUri = "", this.paginationAriaLabel = "Paginering", this.currentAriaLabel = "Nuvarande sida, ", this.pagingNumberAriaLabel = "Gå till sida ", this.isNarrow = window.innerWidth <= 768, this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this._onResize = () => {
|
|
13
|
+
this.isNarrow = window.innerWidth <= 768;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
static {
|
|
17
|
+
this.styles = [n`
|
|
18
|
+
:host {
|
|
19
|
+
display: block;
|
|
20
|
+
width: 100%;
|
|
21
|
+
|
|
22
|
+
margin-block-start: var(--scb-pagination-spacing-block-start, 0);
|
|
23
|
+
margin-block-end: var(--scb-pagination-spacing-block-end, 0);
|
|
24
|
+
margin-inline-start: var(--scb-pagination-spacing-inline-start, 0);
|
|
25
|
+
margin-inline-end: var(--scb-pagination-spacing-inline-end, 0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host .pagination {
|
|
29
|
+
--md-text-button-label-text-color: var(--md-sys-color-on-surface, #0F0865);
|
|
30
|
+
--md-text-button-pressed-state-layer-color: var(--md-sys-color-on-surface, #0F0865);
|
|
31
|
+
--md-text-button-focus-label-text-color: var(--md-sys-color-on-surface, #0F0865);
|
|
32
|
+
--md-text-button-hover-label-text-color: var(--md-sys-color-on-surface, #0F0865);
|
|
33
|
+
--md-text-button-pressed-label-text-color: var(--md-sys-color-on-surface, #0F0865);
|
|
34
|
+
--md-text-button-hover-state-layer-color: var(--md-sys-color-on-surface, #0F0865);
|
|
35
|
+
--md-text-button-label-text-weight: var(--weight-regular, 400);
|
|
36
|
+
--md-text-button-label-text-line-height: var(--md-sys-typescale-body-medium-line-height, 24px);
|
|
37
|
+
--md-text-button-label-text-size: var(--md-sys-typescale-body-medium-size, 16px);
|
|
38
|
+
--md-text-button-icon-color: var(--md-sys-color-on-surface, #0F0865);
|
|
39
|
+
--md-text-button-focus-icon-color: var(--md-sys-color-on-surface, #0F0865);
|
|
40
|
+
--md-text-button-hover-icon-color: var(--md-sys-color-on-surface, #0F0865);
|
|
41
|
+
--md-text-button-pressed-icon-color: var(--md-sys-color-on-surface, #0F0865);
|
|
42
|
+
--scb-link-decoration: none;
|
|
43
|
+
--scb-link-color: var(--md-sys-color-on-surface, #0F0865);
|
|
44
|
+
|
|
45
|
+
scb-link.page-number a {
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
text-decoration: none;
|
|
48
|
+
display: inline-flex;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.pagination {
|
|
53
|
+
width: 100%;
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
gap: 0;
|
|
57
|
+
}
|
|
58
|
+
.pagination-row {
|
|
59
|
+
width: 100%;
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: row;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 4px;
|
|
64
|
+
}
|
|
65
|
+
.pagination-row .prev {
|
|
66
|
+
display: flex;
|
|
67
|
+
justify-content: flex-start;
|
|
68
|
+
width: auto;
|
|
69
|
+
}
|
|
70
|
+
.pagination-row ol {
|
|
71
|
+
width: auto;
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: row;
|
|
74
|
+
justify-content: flex-start;
|
|
75
|
+
gap: 4px;
|
|
76
|
+
margin: 0;
|
|
77
|
+
padding: 0;
|
|
78
|
+
list-style: none;
|
|
79
|
+
}
|
|
80
|
+
.pagination-row ol li {
|
|
81
|
+
min-width: 40px;
|
|
82
|
+
min-height: 40px;
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
}
|
|
87
|
+
.pagination-row .next {
|
|
88
|
+
display: flex;
|
|
89
|
+
justify-content: flex-start;
|
|
90
|
+
align-items: center;
|
|
91
|
+
width: auto;
|
|
92
|
+
margin-top: 0;
|
|
93
|
+
}
|
|
94
|
+
scb-link.page-number a {
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
text-decoration: none;
|
|
97
|
+
display: inline-flex;
|
|
98
|
+
}
|
|
99
|
+
.pagination-row ol li scb-link.page-number {
|
|
100
|
+
--scb-link-focus-ring-gap: 0;
|
|
101
|
+
--scb-link-decoration: none;
|
|
102
|
+
--scb-link-hover-thickness: 1px;
|
|
103
|
+
display: inline-flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
width: 40px;
|
|
107
|
+
height: 40px;
|
|
108
|
+
border-radius: 999px;
|
|
109
|
+
}
|
|
110
|
+
.pagination-row ol li scb-link.page-number::part(anchor) {
|
|
111
|
+
display: inline-flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
width: 40px;
|
|
115
|
+
height: 40px;
|
|
116
|
+
border-radius: 999px;
|
|
117
|
+
color: var(--md-sys-color-on-surface, #0F0865);
|
|
118
|
+
cursor: pointer;
|
|
119
|
+
text-decoration: none;
|
|
120
|
+
transition: background-color 120ms linear;
|
|
121
|
+
}
|
|
122
|
+
.pagination-row ol li scb-link.page-number::part(anchor):hover {
|
|
123
|
+
background: color-mix(
|
|
124
|
+
in srgb,
|
|
125
|
+
var(--md-text-button-hover-state-layer-color, var(--md-sys-color-on-surface, #0F0865)) 8%,
|
|
126
|
+
transparent
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
.pagination-row ol li scb-link.page-number::part(anchor):focus-visible {
|
|
130
|
+
background: color-mix(
|
|
131
|
+
in srgb,
|
|
132
|
+
var(--md-sys-color-on-surface, #0F0865) 10%,
|
|
133
|
+
transparent
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
.page-number.active {
|
|
137
|
+
display: inline-flex;
|
|
138
|
+
align-items: center;
|
|
139
|
+
justify-content: center;
|
|
140
|
+
border-radius: 50%;
|
|
141
|
+
background: var(--md-sys-color-primary, #1F44FF);
|
|
142
|
+
color: var(--md-sys-color-on-primary, #FFF);
|
|
143
|
+
text-align: center;
|
|
144
|
+
width: 40px;
|
|
145
|
+
height: 40px;
|
|
146
|
+
}
|
|
147
|
+
.page-number.active {
|
|
148
|
+
font-family: var(--brand-font, 'Inter', sans-serif);
|
|
149
|
+
}
|
|
150
|
+
.ellipsis {
|
|
151
|
+
margin: 0 4px;
|
|
152
|
+
color: #888;
|
|
153
|
+
user-select: none;
|
|
154
|
+
pointer-events: none;
|
|
155
|
+
}
|
|
156
|
+
scb-button[disabled] {
|
|
157
|
+
opacity: 0.5;
|
|
158
|
+
pointer-events: none;
|
|
159
|
+
}
|
|
160
|
+
.paging-action-link {
|
|
161
|
+
display: inline-flex;
|
|
162
|
+
text-decoration: none;
|
|
163
|
+
}
|
|
164
|
+
.paging-action-link[aria-disabled='true'] {
|
|
165
|
+
opacity: 0.5;
|
|
166
|
+
pointer-events: none;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@media (max-width: 768px) {
|
|
170
|
+
.pagination .prev {
|
|
171
|
+
display: flex;
|
|
172
|
+
justify-content: flex-start;
|
|
173
|
+
}
|
|
174
|
+
.pagination .next {
|
|
175
|
+
width: 100%;
|
|
176
|
+
margin-top: 8px;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@media (max-width: 390px) {
|
|
181
|
+
.pagination-row {
|
|
182
|
+
flex-direction: column;
|
|
183
|
+
gap: 0;
|
|
184
|
+
}
|
|
185
|
+
.pagination-row .prev {
|
|
186
|
+
width: 100%;
|
|
187
|
+
margin-bottom: 8px;
|
|
188
|
+
align-items: center;
|
|
189
|
+
}
|
|
190
|
+
.pagination-row ol {
|
|
191
|
+
width: 100%;
|
|
192
|
+
align-items: center;
|
|
193
|
+
}
|
|
194
|
+
.pagination-row .next {
|
|
195
|
+
width: 100%;
|
|
196
|
+
margin-top: 8px;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
`];
|
|
200
|
+
}
|
|
201
|
+
_emitPageChange(e) {
|
|
202
|
+
let t = { page: e };
|
|
203
|
+
this.dispatchEvent(new CustomEvent("page-change", {
|
|
204
|
+
detail: t,
|
|
205
|
+
bubbles: !0,
|
|
206
|
+
composed: !0
|
|
207
|
+
})), this.dispatchEvent(new CustomEvent("pagechange", {
|
|
208
|
+
detail: t,
|
|
209
|
+
bubbles: !0,
|
|
210
|
+
composed: !0
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
213
|
+
_getPagingHref(e) {
|
|
214
|
+
if (!this.pagingHref) return;
|
|
215
|
+
let t = (this.baseUri || "").trim(), n = t || window.location.href, r = new URL(n, window.location.href), i = this.pagingHref.trim().replace(/^[?&]/, "").split("=")[0];
|
|
216
|
+
if (i) return r.searchParams.delete(i), r.searchParams.set(i, String(e)), /^https?:\/\//i.test(t) ? r.toString() : `${r.pathname}${r.search}${r.hash}`;
|
|
217
|
+
}
|
|
218
|
+
_handlePageSelection(e, t) {
|
|
219
|
+
!this.pagingHref && t && t.preventDefault(), this.page = e, this._emitPageChange(e);
|
|
220
|
+
}
|
|
221
|
+
_prevPage(e) {
|
|
222
|
+
if (this.page <= 1) {
|
|
223
|
+
!this.pagingHref && e && e.preventDefault();
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
this._handlePageSelection(this.page - 1, e);
|
|
227
|
+
}
|
|
228
|
+
_nextPage(e) {
|
|
229
|
+
if (this.page >= this.totalPages) {
|
|
230
|
+
!this.pagingHref && e && e.preventDefault();
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
this._handlePageSelection(this.page + 1, e);
|
|
234
|
+
}
|
|
235
|
+
connectedCallback() {
|
|
236
|
+
super.connectedCallback(), window.addEventListener("resize", this._onResize), this._onResize();
|
|
237
|
+
}
|
|
238
|
+
disconnectedCallback() {
|
|
239
|
+
super.disconnectedCallback(), window.removeEventListener("resize", this._onResize);
|
|
240
|
+
}
|
|
241
|
+
mapSpacingToken(e) {
|
|
242
|
+
if (e == null) return;
|
|
243
|
+
let t = String(e).trim();
|
|
244
|
+
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
245
|
+
}
|
|
246
|
+
__applySpacing() {
|
|
247
|
+
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);
|
|
248
|
+
t ? this.style.setProperty("--scb-pagination-spacing-block-start", t) : this.style.removeProperty("--scb-pagination-spacing-block-start"), n ? this.style.setProperty("--scb-pagination-spacing-block-end", n) : this.style.removeProperty("--scb-pagination-spacing-block-end"), r ? this.style.setProperty("--scb-pagination-spacing-inline-start", r) : this.style.removeProperty("--scb-pagination-spacing-inline-start"), i ? this.style.setProperty("--scb-pagination-spacing-inline-end", i) : this.style.removeProperty("--scb-pagination-spacing-inline-end");
|
|
249
|
+
}
|
|
250
|
+
firstUpdated() {
|
|
251
|
+
this.__applySpacing();
|
|
252
|
+
}
|
|
253
|
+
updated(e) {
|
|
254
|
+
super.updated(e), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this.__applySpacing();
|
|
255
|
+
}
|
|
256
|
+
render() {
|
|
257
|
+
if (this.totalPages === 0) return null;
|
|
258
|
+
let e = this.variant ? `${this.variant.toLowerCase()}` : "", t = [], { page: n, totalPages: i } = this, a = window.innerWidth <= 768, o = a ? 1 : 2, s = this._getPagingHref(Math.max(1, this.page - 1)), c = this._getPagingHref(Math.min(this.totalPages, this.page + 1)), l = this.pagingHref ? this.variant === "icon" ? r`<a
|
|
259
|
+
class="paging-action-link"
|
|
260
|
+
href=${s}
|
|
261
|
+
@click=${this._prevPage}
|
|
262
|
+
aria-label="Föregående sida"
|
|
263
|
+
aria-disabled=${this.page === 1 ? "true" : "false"}
|
|
264
|
+
>
|
|
265
|
+
<scb-icon-button
|
|
266
|
+
icon="chevron_left"
|
|
267
|
+
?disabled=${this.page === 1}
|
|
268
|
+
aria-label="Föregående sida"
|
|
269
|
+
></scb-icon-button>
|
|
270
|
+
</a>` : r`<a
|
|
271
|
+
class="paging-action-link"
|
|
272
|
+
href=${s}
|
|
273
|
+
@click=${this._prevPage}
|
|
274
|
+
aria-label="Föregående sida"
|
|
275
|
+
aria-disabled=${this.page === 1 ? "true" : "false"}
|
|
276
|
+
>
|
|
277
|
+
<scb-button
|
|
278
|
+
variant="text"
|
|
279
|
+
label="Föregående"
|
|
280
|
+
icon="chevron_left"
|
|
281
|
+
?disabled=${this.page === 1}
|
|
282
|
+
aria-label="Föregående sida"
|
|
283
|
+
></scb-button>
|
|
284
|
+
</a>` : this.variant === "icon" ? r`<scb-icon-button
|
|
285
|
+
icon="chevron_left"
|
|
286
|
+
@click=${this._prevPage}
|
|
287
|
+
?disabled=${this.page === 1}
|
|
288
|
+
aria-label="Föregående sida"
|
|
289
|
+
></scb-icon-button>` : r`<scb-button
|
|
290
|
+
variant="text"
|
|
291
|
+
label="Föregående"
|
|
292
|
+
icon="chevron_left"
|
|
293
|
+
@click=${this._prevPage}
|
|
294
|
+
?disabled=${this.page === 1}
|
|
295
|
+
aria-label="Föregående sida"
|
|
296
|
+
></scb-button>`, u = this.pagingHref ? this.variant === "icon" ? r`<a
|
|
297
|
+
class="paging-action-link"
|
|
298
|
+
href=${c}
|
|
299
|
+
@click=${this._nextPage}
|
|
300
|
+
aria-label="Nästa sida"
|
|
301
|
+
aria-disabled=${this.page === this.totalPages ? "true" : "false"}
|
|
302
|
+
>
|
|
303
|
+
<scb-icon-button
|
|
304
|
+
icon="chevron_right"
|
|
305
|
+
?disabled=${this.page === this.totalPages}
|
|
306
|
+
aria-label="Nästa sida"
|
|
307
|
+
></scb-icon-button>
|
|
308
|
+
</a>` : r`<a
|
|
309
|
+
class="paging-action-link"
|
|
310
|
+
href=${c}
|
|
311
|
+
@click=${this._nextPage}
|
|
312
|
+
aria-label="Nästa sida"
|
|
313
|
+
aria-disabled=${this.page === this.totalPages ? "true" : "false"}
|
|
314
|
+
>
|
|
315
|
+
<scb-button
|
|
316
|
+
variant="text"
|
|
317
|
+
label="Nästa"
|
|
318
|
+
icon="chevron_right"
|
|
319
|
+
iconPosition="right"
|
|
320
|
+
?disabled=${this.page === this.totalPages}
|
|
321
|
+
aria-label="Nästa sida"
|
|
322
|
+
trailing-icon
|
|
323
|
+
></scb-button>
|
|
324
|
+
</a>` : this.variant === "icon" ? r`<scb-icon-button
|
|
325
|
+
icon="chevron_right"
|
|
326
|
+
@click=${this._nextPage}
|
|
327
|
+
?disabled=${this.page === this.totalPages}
|
|
328
|
+
aria-label="Nästa sida"
|
|
329
|
+
></scb-icon-button>` : r`<scb-button
|
|
330
|
+
variant="text"
|
|
331
|
+
label="Nästa"
|
|
332
|
+
icon="chevron_right"
|
|
333
|
+
iconPosition="right"
|
|
334
|
+
@click=${this._nextPage}
|
|
335
|
+
?disabled=${this.page === this.totalPages}
|
|
336
|
+
aria-label="Nästa sida"
|
|
337
|
+
trailing-icon
|
|
338
|
+
></scb-button>`, d = (e) => e === n ? r`
|
|
339
|
+
<li>
|
|
340
|
+
<span
|
|
341
|
+
class="page-number active"
|
|
342
|
+
aria-current="page"
|
|
343
|
+
aria-label="${this.currentAriaLabel} ${e}"
|
|
344
|
+
>${e}</span
|
|
345
|
+
>
|
|
346
|
+
</li>
|
|
347
|
+
` : r`
|
|
348
|
+
<li>
|
|
349
|
+
<scb-link
|
|
350
|
+
class="page-number${e === n ? " active" : ""}"
|
|
351
|
+
@click=${(t) => this._handlePageSelection(e, t)}
|
|
352
|
+
aria-current=${e === n ? "page" : void 0}
|
|
353
|
+
aria-label="${this.pagingNumberAriaLabel} ${e}"
|
|
354
|
+
href=${this._getPagingHref(e)}
|
|
355
|
+
?disabled=${e === n}
|
|
356
|
+
>${e}</scb-link
|
|
357
|
+
>
|
|
358
|
+
</li>
|
|
359
|
+
`;
|
|
360
|
+
if (i <= 8) for (let e = 1; e <= i; e++) t.push(d(e));
|
|
361
|
+
else if (t.push(d(1)), n <= 4 && !a) {
|
|
362
|
+
for (let e = 2; e <= 5; e++) t.push(d(e));
|
|
363
|
+
i > 6 ? (t.push(r`<li><span class="ellipsis" aria-hidden="true">…</span></li>`), t.push(d(i))) : i === 6 && t.push(d(i));
|
|
364
|
+
} else if (n <= 3 && a) {
|
|
365
|
+
for (let e = 2; e <= 3; e++) t.push(d(e));
|
|
366
|
+
i > 4 ? (t.push(r`<li><span class="ellipsis" aria-hidden="true">…</span></li>`), t.push(d(i))) : i === 4 && t.push(d(i));
|
|
367
|
+
} else if (n >= i - (o + 1)) {
|
|
368
|
+
t.push(r`<li><span class="ellipsis" aria-hidden="true">…</span></li>`);
|
|
369
|
+
for (let e = i - o * 2; e <= i; e++) e > 1 && t.push(d(e));
|
|
370
|
+
} else {
|
|
371
|
+
t.push(r`<li><span class="ellipsis" aria-hidden="true">…</span></li>`);
|
|
372
|
+
for (let e = n - o; e <= n + o; e++) e > 1 && e < i && t.push(d(e));
|
|
373
|
+
t.push(r`<li><span class="ellipsis" aria-hidden="true">…</span></li>`), t.push(d(i));
|
|
374
|
+
}
|
|
375
|
+
return a ? r`
|
|
376
|
+
<nav aria-label="${this.paginationAriaLabel}" class="pagination ${e}">
|
|
377
|
+
<div class="pagination-row">
|
|
378
|
+
<div class="prev">
|
|
379
|
+
${l}
|
|
380
|
+
</div>
|
|
381
|
+
<ol>
|
|
382
|
+
${t}
|
|
383
|
+
</ol>
|
|
384
|
+
</div>
|
|
385
|
+
<div class="next">
|
|
386
|
+
${u}
|
|
387
|
+
</div>
|
|
388
|
+
</nav>
|
|
389
|
+
` : r`
|
|
390
|
+
<nav aria-label="${this.paginationAriaLabel}" class="pagination ${e}">
|
|
391
|
+
<div class="pagination-row">
|
|
392
|
+
<div class="prev">
|
|
393
|
+
${l}
|
|
394
|
+
</div>
|
|
395
|
+
<ol>
|
|
396
|
+
${t}
|
|
397
|
+
</ol>
|
|
398
|
+
<div class="next">
|
|
399
|
+
${u}
|
|
400
|
+
</div>
|
|
401
|
+
</div>
|
|
402
|
+
</nav>
|
|
403
|
+
`;
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
e([a({ type: String })], o.prototype, "variant", void 0), e([a({ type: Number })], o.prototype, "page", void 0), e([a({
|
|
407
|
+
type: Number,
|
|
408
|
+
attribute: "total-pages"
|
|
409
|
+
})], o.prototype, "totalPages", void 0), e([a({
|
|
410
|
+
type: String,
|
|
411
|
+
attribute: "paging-href"
|
|
412
|
+
})], o.prototype, "pagingHref", void 0), e([a({
|
|
413
|
+
type: String,
|
|
414
|
+
attribute: "base-uri"
|
|
415
|
+
})], o.prototype, "baseUri", void 0), e([a({
|
|
416
|
+
type: String,
|
|
417
|
+
attribute: "pagination-aria-label"
|
|
418
|
+
})], o.prototype, "paginationAriaLabel", void 0), e([a({
|
|
419
|
+
type: String,
|
|
420
|
+
attribute: "current-aria-label"
|
|
421
|
+
})], o.prototype, "currentAriaLabel", void 0), e([a({
|
|
422
|
+
type: String,
|
|
423
|
+
attribute: "paging-number-aria-label"
|
|
424
|
+
})], o.prototype, "pagingNumberAriaLabel", void 0), e([a({ type: Boolean })], o.prototype, "isNarrow", void 0), e([a({ type: String })], o.prototype, "spacing", void 0), e([a({
|
|
425
|
+
type: String,
|
|
426
|
+
attribute: "spacing-top"
|
|
427
|
+
})], o.prototype, "spacingTop", void 0), e([a({
|
|
428
|
+
type: String,
|
|
429
|
+
attribute: "spacing-bottom"
|
|
430
|
+
})], o.prototype, "spacingBottom", void 0), e([a({
|
|
431
|
+
type: String,
|
|
432
|
+
attribute: "spacing-left"
|
|
433
|
+
})], o.prototype, "spacingLeft", void 0), e([a({
|
|
434
|
+
type: String,
|
|
435
|
+
attribute: "spacing-right"
|
|
436
|
+
})], o.prototype, "spacingRight", void 0), o = e([i("scb-pagination")], o);
|
|
437
|
+
//#endregion
|
|
438
|
+
export { o as ScbPagination };
|
|
@@ -0,0 +1,199 @@
|
|
|
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-progress-indicator/scb-progress-indicator.ts
|
|
5
|
+
var o = class extends t {
|
|
6
|
+
constructor(...e) {
|
|
7
|
+
super(...e), this.id = "", this.type = "circular", this.progress = 25, this.isStatic = !0, this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this._isSyncingAria = !1, this._defaultAriaLabelApplied = !1, this._defaultAriaValueTextApplied = !1;
|
|
8
|
+
}
|
|
9
|
+
static {
|
|
10
|
+
this.styles = [n`
|
|
11
|
+
|
|
12
|
+
.circular {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
width: 46px;
|
|
17
|
+
height: 46px;
|
|
18
|
+
position: relative;
|
|
19
|
+
}
|
|
20
|
+
.circular-spin {
|
|
21
|
+
animation: spin 1s linear infinite;
|
|
22
|
+
width: 46px;
|
|
23
|
+
height: 46px ;
|
|
24
|
+
position: relative;
|
|
25
|
+
z-index: 1;
|
|
26
|
+
}
|
|
27
|
+
@keyframes spin {
|
|
28
|
+
0% { transform: rotate(0deg); }
|
|
29
|
+
100% { transform: rotate(360deg); }
|
|
30
|
+
}
|
|
31
|
+
.circular-bg {
|
|
32
|
+
stroke: var(--md-sys-color-secondary-container);
|
|
33
|
+
}
|
|
34
|
+
.circular-fg {
|
|
35
|
+
transition: stroke-dashoffset 0.3s ease;
|
|
36
|
+
}
|
|
37
|
+
.linear {
|
|
38
|
+
width: 100%;
|
|
39
|
+
height: 6px;
|
|
40
|
+
background: var(--md-sys-color-secondary-container);
|
|
41
|
+
border-radius: 3px;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
position: relative;
|
|
44
|
+
}
|
|
45
|
+
:host {
|
|
46
|
+
display: inline-block;
|
|
47
|
+
margin-block-start: var(--scb-progress-indicator-spacing-block-start, 0);
|
|
48
|
+
margin-block-end: var(--scb-progress-indicator-spacing-block-end, 0);
|
|
49
|
+
margin-inline-start: var(--scb-progress-indicator-spacing-inline-start, 0);
|
|
50
|
+
margin-inline-end: var(--scb-progress-indicator-spacing-inline-end, 0);
|
|
51
|
+
--progress-fill: var(--md-sys-color-primary);
|
|
52
|
+
}
|
|
53
|
+
:host([type='linear']) {
|
|
54
|
+
display: block;
|
|
55
|
+
width: 100%;
|
|
56
|
+
}
|
|
57
|
+
.linear-loader {
|
|
58
|
+
height: 100%;
|
|
59
|
+
width: 40%;
|
|
60
|
+
background: var(--progress-fill);
|
|
61
|
+
border-radius: 3px;
|
|
62
|
+
animation: linear-progress 1.2s cubic-bezier(.4,0,.2,1) infinite;
|
|
63
|
+
}
|
|
64
|
+
.linear-static {
|
|
65
|
+
height: 100%;
|
|
66
|
+
border-radius: 3px;
|
|
67
|
+
transition: width 0.3s ease;
|
|
68
|
+
background: var(--progress-fill);
|
|
69
|
+
}
|
|
70
|
+
@keyframes linear-progress {
|
|
71
|
+
0% { margin-left: -40%; width: 40%; }
|
|
72
|
+
50% { margin-left: 30%; width: 60%; }
|
|
73
|
+
100% { margin-left: 100%; width: 40%; }
|
|
74
|
+
}
|
|
75
|
+
`];
|
|
76
|
+
}
|
|
77
|
+
static get observedAttributes() {
|
|
78
|
+
return [
|
|
79
|
+
...super.observedAttributes,
|
|
80
|
+
"role",
|
|
81
|
+
"aria-label",
|
|
82
|
+
"aria-labelledby",
|
|
83
|
+
"aria-valuemin",
|
|
84
|
+
"aria-valuemax",
|
|
85
|
+
"aria-valuetext"
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
attributeChangedCallback(e, t, n) {
|
|
89
|
+
super.attributeChangedCallback(e, t, n), t !== n && (e === "role" || e.startsWith("aria-")) && this.syncAria();
|
|
90
|
+
}
|
|
91
|
+
connectedCallback() {
|
|
92
|
+
super.connectedCallback(), this.syncAria();
|
|
93
|
+
}
|
|
94
|
+
clampProgress(e) {
|
|
95
|
+
return Number.isNaN(e) ? 0 : Math.max(0, Math.min(100, e));
|
|
96
|
+
}
|
|
97
|
+
applyDefaultAriaLabel(e) {
|
|
98
|
+
let t = this.getAttribute("aria-labelledby"), n = this.getAttribute("aria-label");
|
|
99
|
+
if (t) {
|
|
100
|
+
this._defaultAriaLabelApplied &&= (this.removeAttribute("aria-label"), !1);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (n !== null) {
|
|
104
|
+
this._defaultAriaLabelApplied && n !== e && (this._defaultAriaLabelApplied = !1);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
this.setAttribute("aria-label", e), this._defaultAriaLabelApplied = !0;
|
|
108
|
+
}
|
|
109
|
+
syncAria() {
|
|
110
|
+
if (!this._isSyncingAria) {
|
|
111
|
+
this._isSyncingAria = !0;
|
|
112
|
+
try {
|
|
113
|
+
if (this.hasAttribute("role") || this.setAttribute("role", "progressbar"), this.hasAttribute("aria-valuemin") || this.setAttribute("aria-valuemin", "0"), this.hasAttribute("aria-valuemax") || this.setAttribute("aria-valuemax", "100"), this.type === "linear" && !this.isStatic) {
|
|
114
|
+
this.removeAttribute("aria-valuenow");
|
|
115
|
+
let e = this.getAttribute("aria-valuetext");
|
|
116
|
+
e === null ? (this.setAttribute("aria-valuetext", "Laddar"), this._defaultAriaValueTextApplied = !0) : this._defaultAriaValueTextApplied && e !== "Laddar" && (this._defaultAriaValueTextApplied = !1), this.applyDefaultAriaLabel("Laddar");
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
let e = this.clampProgress(this.progress);
|
|
120
|
+
this.setAttribute("aria-valuenow", String(e)), this._defaultAriaValueTextApplied &&= (this.getAttribute("aria-valuetext") === "Laddar" && this.removeAttribute("aria-valuetext"), !1), this.applyDefaultAriaLabel("Förlopp");
|
|
121
|
+
} finally {
|
|
122
|
+
this._isSyncingAria = !1;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
mapSpacingToken(e) {
|
|
127
|
+
if (!e) return;
|
|
128
|
+
let t = String(e).trim();
|
|
129
|
+
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
130
|
+
}
|
|
131
|
+
applySpacing() {
|
|
132
|
+
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);
|
|
133
|
+
t ? this.style.setProperty("--scb-progress-indicator-spacing-block-start", t) : this.style.removeProperty("--scb-progress-indicator-spacing-block-start"), n ? this.style.setProperty("--scb-progress-indicator-spacing-block-end", n) : this.style.removeProperty("--scb-progress-indicator-spacing-block-end"), r ? this.style.setProperty("--scb-progress-indicator-spacing-inline-start", r) : this.style.removeProperty("--scb-progress-indicator-spacing-inline-start"), i ? this.style.setProperty("--scb-progress-indicator-spacing-inline-end", i) : this.style.removeProperty("--scb-progress-indicator-spacing-inline-end");
|
|
134
|
+
}
|
|
135
|
+
applyTypeLayout() {
|
|
136
|
+
this.type === "linear" ? (this.style.display = "block", this.style.width = "100%") : (this.style.removeProperty("display"), this.style.removeProperty("width"));
|
|
137
|
+
}
|
|
138
|
+
firstUpdated(e) {
|
|
139
|
+
this.applyTypeLayout(), this.applySpacing(), this.syncAria();
|
|
140
|
+
}
|
|
141
|
+
updated(e) {
|
|
142
|
+
super.updated(e), e.has("type") && this.applyTypeLayout(), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this.applySpacing(), (e.has("type") || e.has("progress") || e.has("isStatic")) && this.syncAria();
|
|
143
|
+
}
|
|
144
|
+
render() {
|
|
145
|
+
return r`
|
|
146
|
+
<div class="scb-progress-indicator">
|
|
147
|
+
${this.type === "circular" ? r`
|
|
148
|
+
<div class="circular">
|
|
149
|
+
<svg class="circular-spin" viewBox="0 0 40 40" aria-hidden="true" focusable="false">
|
|
150
|
+
<circle class="circular-bg" cx="20" cy="20" r="16" fill="none" stroke-width="4" />
|
|
151
|
+
<circle
|
|
152
|
+
class="circular-fg"
|
|
153
|
+
cx="20" cy="20" r="16" fill="none" stroke-width="4"
|
|
154
|
+
stroke="var(--md-sys-color-primary)"
|
|
155
|
+
stroke-dasharray="${2 * Math.PI * 16}"
|
|
156
|
+
stroke-dashoffset="${(1 - this.progress / 100) * 2 * Math.PI * 16}"
|
|
157
|
+
/>
|
|
158
|
+
</svg>
|
|
159
|
+
</div>
|
|
160
|
+
` : r`
|
|
161
|
+
<div class="linear" style="--progress-fill: var(--md-sys-color-primary);">
|
|
162
|
+
${this.isStatic ? r`<div class="linear-static" style="width: ${this.progress}%;"></div>` : r`<div class="linear-loader"></div>`}
|
|
163
|
+
</div>
|
|
164
|
+
`}
|
|
165
|
+
</div>
|
|
166
|
+
`;
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
e([a({ type: String })], o.prototype, "id", void 0), e([a({
|
|
170
|
+
type: String,
|
|
171
|
+
reflect: !0
|
|
172
|
+
})], o.prototype, "type", void 0), e([a({
|
|
173
|
+
type: Number,
|
|
174
|
+
reflect: !0
|
|
175
|
+
})], o.prototype, "progress", void 0), e([a({
|
|
176
|
+
type: Boolean,
|
|
177
|
+
attribute: "is-static"
|
|
178
|
+
})], o.prototype, "isStatic", void 0), e([a({
|
|
179
|
+
type: String,
|
|
180
|
+
reflect: !0
|
|
181
|
+
})], o.prototype, "spacing", void 0), e([a({
|
|
182
|
+
type: String,
|
|
183
|
+
attribute: "spacing-top",
|
|
184
|
+
reflect: !0
|
|
185
|
+
})], o.prototype, "spacingTop", void 0), e([a({
|
|
186
|
+
type: String,
|
|
187
|
+
attribute: "spacing-bottom",
|
|
188
|
+
reflect: !0
|
|
189
|
+
})], o.prototype, "spacingBottom", void 0), e([a({
|
|
190
|
+
type: String,
|
|
191
|
+
attribute: "spacing-left",
|
|
192
|
+
reflect: !0
|
|
193
|
+
})], o.prototype, "spacingLeft", void 0), e([a({
|
|
194
|
+
type: String,
|
|
195
|
+
attribute: "spacing-right",
|
|
196
|
+
reflect: !0
|
|
197
|
+
})], o.prototype, "spacingRight", void 0), o = e([i("scb-progress-indicator")], o);
|
|
198
|
+
//#endregion
|
|
199
|
+
export { o as ScbProgressIndicator };
|