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,574 @@
|
|
|
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-textfield/scb-textfield.js";
|
|
5
|
+
import "../scb-checkbox/scb-checkbox.js";
|
|
6
|
+
import "../scb-radio-button/scb-radio-button.js";
|
|
7
|
+
import "../scb-switch/scb-switch.js";
|
|
8
|
+
import "../scb-chip/scb-chip.js";
|
|
9
|
+
import { LitElement as t, css as n, html as r, nothing as i } from "lit";
|
|
10
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
11
|
+
import "@material/web/icon/icon.js";
|
|
12
|
+
//#region src/scb-test-components/scb-dialog/scb-dialog.ts
|
|
13
|
+
var s = class extends t {
|
|
14
|
+
constructor(...e) {
|
|
15
|
+
super(...e), this.open = !1, this.inSb = !1, this.scrimClose = !0, this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this.variant = "basic", this.label = "", this.icon = "", this.supportingText = "", this.okButton = "OK", this.cancelButton = "Avbryt", this.deleteButton = "Delete", this.confirmButton = "Ta bort", this.denyButton = "Avbryt", this.resetButton = "Återställ", this.submitButton = "Spara", this.formId = "", this.formAction = "", this.formMethod = "", this.__lastTriggerEl = null, this.__onDocumentClick = (e) => {
|
|
16
|
+
this.__getActionFromEvent(e) === "toggle" && (this.__setOpen(!this.open), e.stopPropagation());
|
|
17
|
+
}, this.__onDocumentKeydown = (e) => {
|
|
18
|
+
this.open && e.key === "Escape" && (this.__fire("esc"), this.__setOpen(!1));
|
|
19
|
+
}, this.__onScrimClick = () => {
|
|
20
|
+
this.scrimClose && (this.__fire("scrim"), this.__setOpen(!1));
|
|
21
|
+
}, this.__onOk = () => {
|
|
22
|
+
this.__fire("ok"), this.__setOpen(!1);
|
|
23
|
+
}, this.__onCancel = () => {
|
|
24
|
+
this.__fire("cancel"), this.__setOpen(!1);
|
|
25
|
+
}, this.__onConfirm = () => {
|
|
26
|
+
this.__fire("confirm"), this.__setOpen(!1);
|
|
27
|
+
}, this.__onDeny = () => {
|
|
28
|
+
this.__fire("deny"), this.__setOpen(!1);
|
|
29
|
+
}, this.__onReset = () => {
|
|
30
|
+
let e = this.shadowRoot?.querySelector("form");
|
|
31
|
+
e instanceof HTMLFormElement && (this.__clearGeneratedFormValues(e), e.reset()), (this.shadowRoot?.querySelector("slot")?.assignedElements({ flatten: !0 }) ?? []).forEach((e) => {
|
|
32
|
+
let t = e.tagName;
|
|
33
|
+
t === "SCB-TEXTFIELD" && (e.value = ""), t === "SCB-CHECKBOX" && (e.checked = !1), t === "SCB-RADIO-BUTTON" && (e.checked = !1), t === "SCB-SWITCH" && (e.selected = !1), t === "SCB-CHIP" && (e.selected = !1);
|
|
34
|
+
}), this.__fire("reset");
|
|
35
|
+
}, this.__onSubmit = () => {
|
|
36
|
+
let e = this.shadowRoot?.querySelector("form");
|
|
37
|
+
if (e instanceof HTMLFormElement) {
|
|
38
|
+
if (this.__syncSlottedFormValues(e), !this.__validateFormAndSlottedFields(e)) return;
|
|
39
|
+
e.requestSubmit();
|
|
40
|
+
}
|
|
41
|
+
this.__fire("submit"), this.__setOpen(!1);
|
|
42
|
+
}, this.__onKeydownTrap = (e) => {
|
|
43
|
+
if (!this.open || e.key !== "Tab") return;
|
|
44
|
+
let t = Array.from(this.shadowRoot.querySelectorAll("button,[href],input,select,textarea,[tabindex]:not([tabindex=\"-1\"])")).filter((e) => !e.hasAttribute("disabled"));
|
|
45
|
+
if (!t.length) return;
|
|
46
|
+
let n = t[0], r = t[t.length - 1];
|
|
47
|
+
e.shiftKey && document.activeElement === n ? (r.focus(), e.preventDefault()) : !e.shiftKey && document.activeElement === r && (n.focus(), e.preventDefault());
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
static {
|
|
51
|
+
this.styles = n`
|
|
52
|
+
:host {
|
|
53
|
+
display:block;
|
|
54
|
+
position:relative;
|
|
55
|
+
font-family: var(--brand, Inter);
|
|
56
|
+
|
|
57
|
+
margin-block-start: var(--scb-dialog-spacing-block-start, 0);
|
|
58
|
+
margin-block-end: var(--scb-dialog-spacing-block-end, 0);
|
|
59
|
+
margin-inline-start: var(--scb-dialog-spacing-inline-start, 0);
|
|
60
|
+
margin-inline-end: var(--scb-dialog-spacing-inline-end, 0);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.scrim {
|
|
64
|
+
position: var(--scb-dialog-scrim-position, fixed);
|
|
65
|
+
inset: 0;
|
|
66
|
+
/* var från tokens, tonas med opacity via color-mix */
|
|
67
|
+
background: color-mix(in srgb, var(--md-sys-color-scrim) 32%, transparent);
|
|
68
|
+
z-index: var(--z-dialog-scrim, 1000);
|
|
69
|
+
opacity: 1;
|
|
70
|
+
transition: opacity var(--motion-duration-short, 0.25s);
|
|
71
|
+
transition-timing-function: var(--motion-easing-standard, cubic-bezier(0.2, 0, 0, 1));
|
|
72
|
+
height: var(--scb-dialog-scrim-height, auto);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.container {
|
|
76
|
+
outline: none;
|
|
77
|
+
position: var(--scb-dialog-container-position, fixed);
|
|
78
|
+
inset: 50% auto auto 50%;
|
|
79
|
+
transform: translate(-50%, -50%) scale(1);
|
|
80
|
+
|
|
81
|
+
background: var(--md-sys-color-surface);
|
|
82
|
+
color: var(--md-sys-color-on-surface);
|
|
83
|
+
|
|
84
|
+
/* radius mappad till spacing-token som fallback */
|
|
85
|
+
border-radius: var(--scb-dialog-radius, var(--spacing-5, 16px));
|
|
86
|
+
|
|
87
|
+
/* skugga mappad till shadow-token + spacing-tokens */
|
|
88
|
+
box-shadow:
|
|
89
|
+
0 var(--spacing-1, 2px)
|
|
90
|
+
var(--spacing-5, 16px)
|
|
91
|
+
color-mix(in srgb, var(--md-sys-color-shadow) 20%, transparent);
|
|
92
|
+
|
|
93
|
+
/* width/height via CSS custom props med px-fallback */
|
|
94
|
+
min-width: var(--scb-dialog-min-w, 340px);
|
|
95
|
+
width: var(--scb-dialog-width, auto);
|
|
96
|
+
max-width: var(--scb-dialog-max-w, 90vw);
|
|
97
|
+
max-height: var(--scb-dialog-max-h, 90vh);
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
display:flex; flex-direction:column;
|
|
102
|
+
|
|
103
|
+
/* padding mappad till spacing-token */
|
|
104
|
+
padding: var(--scb-dialog-padding, var(--spacing-7, 24px));
|
|
105
|
+
|
|
106
|
+
z-index: var(--z-dialog, 1001);
|
|
107
|
+
opacity: 1;
|
|
108
|
+
transition:
|
|
109
|
+
opacity var(--motion-duration-medium, 0.3s),
|
|
110
|
+
transform var(--motion-duration-medium, 0.3s);
|
|
111
|
+
transition-timing-function: var(--motion-easing-emphasized-decelerate, cubic-bezier(0.05, 0.7, 0.1, 1));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:host(:not([open])) .scrim,
|
|
115
|
+
:host(:not([open])) .container { opacity:0; pointer-events:none; }
|
|
116
|
+
|
|
117
|
+
:host([open]) .scrim {
|
|
118
|
+
animation:
|
|
119
|
+
var(--motion-keyframe-fade-in, scb-kf-fade-in)
|
|
120
|
+
var(--motion-duration-short, 0.25s)
|
|
121
|
+
var(--motion-easing-standard, cubic-bezier(0.2, 0, 0, 1))
|
|
122
|
+
both;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:host([open]) .container {
|
|
126
|
+
animation:
|
|
127
|
+
var(--motion-keyframe-fade-in, scb-kf-fade-in)
|
|
128
|
+
var(--motion-duration-medium, 0.3s)
|
|
129
|
+
var(--motion-easing-emphasized-decelerate, cubic-bezier(0.05, 0.7, 0.1, 1))
|
|
130
|
+
both;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Header: ikon över rubrik */
|
|
134
|
+
.header {
|
|
135
|
+
display:flex;
|
|
136
|
+
align-items:flex-start;
|
|
137
|
+
gap: var(--spacing-4, 12px);
|
|
138
|
+
margin-bottom: var(--spacing-5, 16px);
|
|
139
|
+
}
|
|
140
|
+
.header .title {
|
|
141
|
+
display:flex;
|
|
142
|
+
flex-direction:column; /* ikon ovanför label */
|
|
143
|
+
gap: var(--spacing-3, 8px);
|
|
144
|
+
}
|
|
145
|
+
.header .label {
|
|
146
|
+
/* typografi mappad till md-sys-typescale tokens */
|
|
147
|
+
font-weight: var(--md-sys-typescale-headline-small-weight, 700);
|
|
148
|
+
font-size: var(--md-sys-typescale-headline-small-size, 1.5rem);
|
|
149
|
+
line-height: var(--md-sys-typescale-headline-small-line-height, 2rem);
|
|
150
|
+
}
|
|
151
|
+
.header .close { margin-left:auto; }
|
|
152
|
+
|
|
153
|
+
.dialog-icon {
|
|
154
|
+
inline-size: var(--scb-dialog-icon-size, var(--spacing-7, 24px));
|
|
155
|
+
block-size: var(--scb-dialog-icon-size, var(--spacing-7, 24px));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.content {
|
|
159
|
+
flex: 1 1 auto;
|
|
160
|
+
overflow:auto;
|
|
161
|
+
margin-bottom: var(--spacing-5, 16px);
|
|
162
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.content-surface {
|
|
166
|
+
border-radius: calc(var(--scb-dialog-radius, var(--spacing-5, 16px)) - var(--spacing-2, 4px));
|
|
167
|
+
overflow: hidden;
|
|
168
|
+
background: var(--md-sys-color-surface-container-lowest, var(--md-sys-color-surface));
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
:host([variant="iframe"]) .container {
|
|
172
|
+
--scb-dialog-min-w: var(--scb-dialog-min-w-iframe, var(--scb-dialog-min-w-floating, 360px));
|
|
173
|
+
--scb-dialog-padding: var(--scb-dialog-padding-iframe, var(--spacing-3, 8px) var(--spacing-3, 8px) var(--spacing-3, 8px));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
:host([variant="iframe"]) .header {
|
|
177
|
+
display: grid;
|
|
178
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
179
|
+
align-items: start;
|
|
180
|
+
gap: var(--spacing-2, 4px);
|
|
181
|
+
margin-bottom: var(--spacing-3, 8px);
|
|
182
|
+
padding-block: var(--scb-dialog-header-padding-block-iframe, var(--spacing-3, 8px));
|
|
183
|
+
padding-inline-start: var(--scb-dialog-header-padding-inline-start-iframe, var(--spacing-3, 8px));
|
|
184
|
+
padding-inline-end: var(--scb-dialog-header-padding-inline-end-iframe, var(--spacing-3, 8px));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
:host([variant="iframe"]) .header .title {
|
|
188
|
+
min-width: 0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
:host([variant="iframe"]) .header .label {
|
|
192
|
+
padding-inline-start: var(--scb-dialog-header-label-padding-inline-start-iframe, 0);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
:host([variant="iframe"]) .header .close {
|
|
196
|
+
margin-left: 0;
|
|
197
|
+
align-self: start;
|
|
198
|
+
justify-self: end;
|
|
199
|
+
margin-top: var(--spacing-negative-2, -4px);
|
|
200
|
+
margin-right: var(--spacing-negative-4, -12px);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
:host([variant="iframe"]) .content {
|
|
204
|
+
margin-bottom: 0;
|
|
205
|
+
color: inherit;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
:host([variant="iframe"]) .content-surface {
|
|
209
|
+
block-size: 100%;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
:host([variant="iframe"]) ::slotted(iframe) {
|
|
213
|
+
display: block;
|
|
214
|
+
inline-size: 100%;
|
|
215
|
+
block-size: var(--scb-dialog-iframe-height, min(70vh, 720px));
|
|
216
|
+
border: 0;
|
|
217
|
+
background: var(--md-sys-color-surface-container-lowest, var(--md-sys-color-surface));
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.actions {
|
|
221
|
+
display:flex;
|
|
222
|
+
align-items:center;
|
|
223
|
+
gap: var(--spacing-3, 8px);
|
|
224
|
+
justify-content:flex-end;
|
|
225
|
+
}
|
|
226
|
+
.actions .start { margin-right:auto; }
|
|
227
|
+
|
|
228
|
+
/* Min-bredder per variant (override-ningsbara via CSS custom props) */
|
|
229
|
+
:host([variant="choose"]) .container { --scb-dialog-min-w: var(--scb-dialog-min-w-choose, 280px); }
|
|
230
|
+
:host([variant="alert"]) .container { --scb-dialog-min-w: var(--scb-dialog-min-w-alert, 320px); }
|
|
231
|
+
:host([variant="confirm"]) .container { --scb-dialog-min-w: var(--scb-dialog-min-w-confirm, 360px); }
|
|
232
|
+
|
|
233
|
+
/* Form-layout: enkel kolumn-grid med gap */
|
|
234
|
+
:host([variant="form"]) form{
|
|
235
|
+
display:grid;
|
|
236
|
+
grid-template-columns: 1fr;
|
|
237
|
+
gap: var(--scb-form-gap, var(--spacing-6, 20px)); /* <— token + fallback */
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
:host([variant="form"]) .content {
|
|
241
|
+
overflow: visible;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
:host([variant="floating"]) .container { --scb-dialog-min-w: var(--scb-dialog-min-w-floating, 360px); }
|
|
245
|
+
|
|
246
|
+
/* Choose: gör slottade radios vertikala med spacing */
|
|
247
|
+
:host([variant="choose"]) ::slotted(scb-radio-button) {
|
|
248
|
+
display:block;
|
|
249
|
+
margin-block: var(--scb-choice-gap, 6px);
|
|
250
|
+
}
|
|
251
|
+
/* Keyframes för motion-tokens (behövs för att animationer ska fungera i shadow DOM) */
|
|
252
|
+
@keyframes scb-kf-fade-in {
|
|
253
|
+
from { opacity: 0; }
|
|
254
|
+
to { opacity: 1; }
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
@keyframes scb-kf-fade-out {
|
|
258
|
+
from { opacity: 1; }
|
|
259
|
+
to { opacity: 0; }
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
`;
|
|
263
|
+
}
|
|
264
|
+
__getActionFromEvent(e) {
|
|
265
|
+
if (!this.id) return null;
|
|
266
|
+
for (let t of e.composedPath()) if (t instanceof Element && (t.getAttribute("data-dialog-toggle") === this.id || t.getAttribute("aria-controls") === this.id)) return this.__lastTriggerEl = t, "toggle";
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
connectedCallback() {
|
|
270
|
+
super.connectedCallback(), this.__applyZIndex(), this.__applyMaxSize(), document.addEventListener("click", this.__onDocumentClick, !1), document.addEventListener("keydown", this.__onDocumentKeydown, !0), this.addEventListener("keydown", this.__onKeydownTrap);
|
|
271
|
+
}
|
|
272
|
+
disconnectedCallback() {
|
|
273
|
+
document.removeEventListener("click", this.__onDocumentClick, !1), document.removeEventListener("keydown", this.__onDocumentKeydown, !0), this.removeEventListener("keydown", this.__onKeydownTrap), super.disconnectedCallback();
|
|
274
|
+
}
|
|
275
|
+
__applyZIndex() {
|
|
276
|
+
let e = typeof this.zIndex == "number" && Number.isFinite(this.zIndex) ? this.zIndex : void 0;
|
|
277
|
+
if (e === void 0) {
|
|
278
|
+
this.style.removeProperty("--z-dialog-scrim"), this.style.removeProperty("--z-dialog");
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
this.style.setProperty("--z-dialog-scrim", String(e)), this.style.setProperty("--z-dialog", String(e + 1));
|
|
282
|
+
}
|
|
283
|
+
__applyMaxSize() {
|
|
284
|
+
let e = (this.maxW ?? "").trim(), t = (this.maxH ?? "").trim();
|
|
285
|
+
e ? (this.style.setProperty("--scb-dialog-max-w", e), this.style.setProperty("--scb-dialog-width", `min(${e}, 90vw)`)) : (this.style.removeProperty("--scb-dialog-max-w"), this.style.removeProperty("--scb-dialog-width")), t ? this.style.setProperty("--scb-dialog-max-h", t) : this.style.removeProperty("--scb-dialog-max-h");
|
|
286
|
+
}
|
|
287
|
+
updated(e) {
|
|
288
|
+
if (e.has("zIndex") && this.__applyZIndex(), (e.has("maxW") || e.has("maxH")) && this.__applyMaxSize(), e.has("open")) {
|
|
289
|
+
let t = e.get("open");
|
|
290
|
+
this.__updateTriggersExpanded(), this.open && !t ? this.updateComplete.then(() => {
|
|
291
|
+
let e = this.shadowRoot?.querySelector("button,[href],input,select,textarea,[tabindex]:not([tabindex=\"-1\"])");
|
|
292
|
+
e ? e.focus() : this.shadowRoot?.querySelector(".container")?.focus();
|
|
293
|
+
}) : !this.open && t && this.__lastTriggerEl?.focus?.(), this.__toggleScrollLock(this.open);
|
|
294
|
+
}
|
|
295
|
+
(e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this.__applySpacing();
|
|
296
|
+
}
|
|
297
|
+
__updateTriggersExpanded() {
|
|
298
|
+
this.id && document.querySelectorAll(`[aria-controls="${this.id}"], [data-dialog-toggle="${this.id}"]`).forEach((e) => {
|
|
299
|
+
e.hasAttribute("aria-controls") && e.setAttribute("aria-expanded", String(this.open));
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
__toggleScrollLock(e) {
|
|
303
|
+
if (this.inSb) return;
|
|
304
|
+
let t = document.documentElement, n = document.body;
|
|
305
|
+
if (e) {
|
|
306
|
+
let e = window.innerWidth - t.clientWidth;
|
|
307
|
+
t.style.overflow = "hidden", n.style.paddingRight = e > 0 ? `${e}px` : "";
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
t.style.overflow = "", n.style.paddingRight = "";
|
|
311
|
+
}
|
|
312
|
+
mapSpacingToken(e) {
|
|
313
|
+
if (!e) return;
|
|
314
|
+
let t = String(e).trim();
|
|
315
|
+
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
316
|
+
}
|
|
317
|
+
__applySpacing() {
|
|
318
|
+
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);
|
|
319
|
+
t ? this.style.setProperty("--scb-dialog-spacing-block-start", t) : this.style.removeProperty("--scb-dialog-spacing-block-start"), n ? this.style.setProperty("--scb-dialog-spacing-block-end", n) : this.style.removeProperty("--scb-dialog-spacing-block-end"), r ? this.style.setProperty("--scb-dialog-spacing-inline-start", r) : this.style.removeProperty("--scb-dialog-spacing-inline-start"), i ? this.style.setProperty("--scb-dialog-spacing-inline-end", i) : this.style.removeProperty("--scb-dialog-spacing-inline-end");
|
|
320
|
+
}
|
|
321
|
+
__setOpen(e) {
|
|
322
|
+
this.open = e, this.__fire(e ? "open" : "close");
|
|
323
|
+
}
|
|
324
|
+
__fire(e, t) {
|
|
325
|
+
this.dispatchEvent(new CustomEvent(e, {
|
|
326
|
+
detail: t,
|
|
327
|
+
bubbles: !0,
|
|
328
|
+
composed: !0
|
|
329
|
+
}));
|
|
330
|
+
}
|
|
331
|
+
__getSlottedElements() {
|
|
332
|
+
let e = this.shadowRoot?.querySelector("slot");
|
|
333
|
+
if (!(e instanceof HTMLSlotElement)) return [];
|
|
334
|
+
let t = e.assignedElements({ flatten: !0 }), n = [];
|
|
335
|
+
for (let e of t) n.push(e, ...Array.from(e.querySelectorAll("*")));
|
|
336
|
+
return n;
|
|
337
|
+
}
|
|
338
|
+
__appendHiddenFormValue(e, t, n) {
|
|
339
|
+
let r = document.createElement("input");
|
|
340
|
+
r.type = "hidden", r.name = t, r.value = n, r.setAttribute("data-scb-dialog-generated", "true"), e.append(r);
|
|
341
|
+
}
|
|
342
|
+
__clearGeneratedFormValues(e) {
|
|
343
|
+
e.querySelectorAll("input[data-scb-dialog-generated=\"true\"]").forEach((e) => e.remove());
|
|
344
|
+
}
|
|
345
|
+
__syncSlottedFormValues(e) {
|
|
346
|
+
this.__clearGeneratedFormValues(e), this.__getSlottedElements().forEach((t) => {
|
|
347
|
+
if (!(t instanceof HTMLElement)) return;
|
|
348
|
+
let n = (t.getAttribute("name") ?? "").trim();
|
|
349
|
+
if (n && !(t.disabled === !0 || t.hasAttribute("disabled"))) {
|
|
350
|
+
if (t instanceof HTMLInputElement) {
|
|
351
|
+
if (t.form === e) return;
|
|
352
|
+
let r = (t.type || "").toLowerCase();
|
|
353
|
+
if (r === "checkbox" || r === "radio") {
|
|
354
|
+
t.checked && this.__appendHiddenFormValue(e, n, t.value || "on");
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
this.__appendHiddenFormValue(e, n, t.value ?? "");
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
if (t instanceof HTMLTextAreaElement) {
|
|
361
|
+
if (t.form === e) return;
|
|
362
|
+
this.__appendHiddenFormValue(e, n, t.value ?? "");
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
if (t instanceof HTMLSelectElement) {
|
|
366
|
+
if (t.form === e) return;
|
|
367
|
+
if (t.multiple) {
|
|
368
|
+
Array.from(t.selectedOptions).forEach((t) => {
|
|
369
|
+
this.__appendHiddenFormValue(e, n, t.value);
|
|
370
|
+
});
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
this.__appendHiddenFormValue(e, n, t.value ?? "");
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
switch (t.tagName) {
|
|
377
|
+
case "SCB-TEXTFIELD":
|
|
378
|
+
this.__appendHiddenFormValue(e, n, String(t.value ?? ""));
|
|
379
|
+
return;
|
|
380
|
+
case "SCB-CHECKBOX":
|
|
381
|
+
t.checked && this.__appendHiddenFormValue(e, n, String(t.value ?? t.getAttribute("value") ?? "on"));
|
|
382
|
+
return;
|
|
383
|
+
case "SCB-RADIO-BUTTON":
|
|
384
|
+
t.checked && this.__appendHiddenFormValue(e, n, String(t.value ?? t.getAttribute("value") ?? "on"));
|
|
385
|
+
return;
|
|
386
|
+
case "SCB-SWITCH":
|
|
387
|
+
(t.selected || t.checked) && this.__appendHiddenFormValue(e, n, String(t.value ?? t.getAttribute("value") ?? "on"));
|
|
388
|
+
return;
|
|
389
|
+
case "SCB-CHIP":
|
|
390
|
+
t.selected && this.__appendHiddenFormValue(e, n, String(t.value ?? t.getAttribute("value") ?? "on"));
|
|
391
|
+
return;
|
|
392
|
+
default: "value" in t && this.__appendHiddenFormValue(e, n, String(t.value ?? ""));
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
__validateFormAndSlottedFields(e) {
|
|
398
|
+
let t = (e) => e.disabled === !0 || e.hasAttribute("disabled"), n = e.reportValidity(), r = null, i = /* @__PURE__ */ new Set();
|
|
399
|
+
return this.__getSlottedElements().forEach((e) => {
|
|
400
|
+
if (!(e instanceof HTMLElement) || i.has(e) || t(e)) return;
|
|
401
|
+
i.add(e);
|
|
402
|
+
let a = e;
|
|
403
|
+
if (e.tagName === "SCB-TEXTFIELD" && a.error === !0) {
|
|
404
|
+
r ||= e, n = !1;
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
if (typeof a.reportValidity == "function") {
|
|
408
|
+
let t = !!a.reportValidity();
|
|
409
|
+
!t && !r && (r = e), n &&= t;
|
|
410
|
+
}
|
|
411
|
+
}), !n && r && r.focus(), n;
|
|
412
|
+
}
|
|
413
|
+
__slotIsEmpty() {
|
|
414
|
+
let e = this.shadowRoot?.querySelector("slot");
|
|
415
|
+
return e ? e.assignedElements({ flatten: !0 }).length === 0 : !0;
|
|
416
|
+
}
|
|
417
|
+
renderHeader(e) {
|
|
418
|
+
let t = this.variant === "form" || this.variant === "floating" || this.variant === "iframe";
|
|
419
|
+
return r`
|
|
420
|
+
<div class="header">
|
|
421
|
+
<div class="title">
|
|
422
|
+
${this.icon ? r`<md-icon class="dialog-icon">${this.icon}</md-icon>` : i}
|
|
423
|
+
<div class="label" id=${e}>${this.label}</div>
|
|
424
|
+
</div>
|
|
425
|
+
${t ? r`<scb-icon-button class="close" icon="close" @click=${this.__onCancel}></scb-icon-button>` : i}
|
|
426
|
+
</div>
|
|
427
|
+
`;
|
|
428
|
+
}
|
|
429
|
+
renderContentDefault(e) {
|
|
430
|
+
return r`
|
|
431
|
+
<div class="content" id=${e}>
|
|
432
|
+
${this.__slotIsEmpty() && this.supportingText ? r`${this.supportingText}` : r`<slot></slot>`}
|
|
433
|
+
</div>
|
|
434
|
+
`;
|
|
435
|
+
}
|
|
436
|
+
renderContentIframe(e) {
|
|
437
|
+
return r`
|
|
438
|
+
<div class="content" id=${e}>
|
|
439
|
+
<div class="content-surface">
|
|
440
|
+
${this.__slotIsEmpty() && this.supportingText ? r`${this.supportingText}` : r`<slot></slot>`}
|
|
441
|
+
</div>
|
|
442
|
+
</div>
|
|
443
|
+
`;
|
|
444
|
+
}
|
|
445
|
+
renderActions() {
|
|
446
|
+
switch (this.variant) {
|
|
447
|
+
case "alert": return r`<div class="actions">
|
|
448
|
+
<scb-button variant="text" label=${this.okButton} @click=${this.__onOk}></scb-button>
|
|
449
|
+
</div>`;
|
|
450
|
+
case "confirm": return r`<div class="actions">
|
|
451
|
+
<scb-button variant="text" label=${this.confirmButton} @click=${this.__onConfirm}></scb-button>
|
|
452
|
+
<scb-button variant="text" label=${this.denyButton} @click=${this.__onDeny}></scb-button>
|
|
453
|
+
</div>`;
|
|
454
|
+
case "choose": return r`<div class="actions">
|
|
455
|
+
<scb-button variant="text" label=${this.cancelButton} @click=${this.__onCancel}></scb-button>
|
|
456
|
+
<scb-button variant="text" label=${this.okButton} @click=${this.__onOk}></scb-button>
|
|
457
|
+
</div>`;
|
|
458
|
+
case "form": return r`<div class="actions">
|
|
459
|
+
<scb-button class="start" variant="text" label=${this.resetButton} @click=${this.__onReset}></scb-button>
|
|
460
|
+
<scb-button variant="text" label=${this.cancelButton} @click=${this.__onCancel}></scb-button>
|
|
461
|
+
<scb-button variant="text" type="submit" label=${this.submitButton} @click=${this.__onSubmit}></scb-button>
|
|
462
|
+
</div>`;
|
|
463
|
+
case "floating":
|
|
464
|
+
case "iframe": return i;
|
|
465
|
+
default: return r`<div class="actions">
|
|
466
|
+
<scb-button variant="text" label=${this.cancelButton} @click=${this.__onCancel}></scb-button>
|
|
467
|
+
<scb-button variant="text" label=${this.okButton} @click=${this.__onOk}></scb-button>
|
|
468
|
+
</div>`;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
renderBody(e, t) {
|
|
472
|
+
return this.variant === "form" ? r`
|
|
473
|
+
${this.renderHeader(e)}
|
|
474
|
+
<div class="content" id=${t}>
|
|
475
|
+
<form id=${this.formId} action=${this.formAction} method=${this.formMethod || i}>
|
|
476
|
+
<slot></slot>
|
|
477
|
+
</form>
|
|
478
|
+
</div>
|
|
479
|
+
${this.renderActions()}
|
|
480
|
+
` : this.variant === "iframe" ? r`${this.renderHeader(e)} ${this.renderContentIframe(t)} ${this.renderActions()}` : r`${this.renderHeader(e)} ${this.renderContentDefault(t)} ${this.renderActions()}`;
|
|
481
|
+
}
|
|
482
|
+
render() {
|
|
483
|
+
let e = "dlg-title", t = "dlg-desc";
|
|
484
|
+
return r`
|
|
485
|
+
<div class="scrim" @click=${this.__onScrimClick} aria-hidden="true"></div>
|
|
486
|
+
<div
|
|
487
|
+
class="container"
|
|
488
|
+
tabindex="-1"
|
|
489
|
+
role="dialog"
|
|
490
|
+
aria-modal="true"
|
|
491
|
+
aria-labelledby=${e}
|
|
492
|
+
aria-describedby=${t}
|
|
493
|
+
>
|
|
494
|
+
${this.renderBody(e, t)}
|
|
495
|
+
</div>
|
|
496
|
+
`;
|
|
497
|
+
}
|
|
498
|
+
};
|
|
499
|
+
e([o({
|
|
500
|
+
type: Boolean,
|
|
501
|
+
reflect: !0
|
|
502
|
+
})], s.prototype, "open", void 0), e([o({
|
|
503
|
+
type: String,
|
|
504
|
+
attribute: "max-w",
|
|
505
|
+
reflect: !0
|
|
506
|
+
})], s.prototype, "maxW", void 0), e([o({
|
|
507
|
+
type: String,
|
|
508
|
+
attribute: "max-h",
|
|
509
|
+
reflect: !0
|
|
510
|
+
})], s.prototype, "maxH", void 0), e([o({
|
|
511
|
+
type: Number,
|
|
512
|
+
attribute: "z-index",
|
|
513
|
+
reflect: !0
|
|
514
|
+
})], s.prototype, "zIndex", void 0), e([o({
|
|
515
|
+
type: Boolean,
|
|
516
|
+
attribute: !1
|
|
517
|
+
})], s.prototype, "inSb", void 0), e([o({
|
|
518
|
+
type: Boolean,
|
|
519
|
+
attribute: "scrim-close"
|
|
520
|
+
})], s.prototype, "scrimClose", void 0), e([o({
|
|
521
|
+
type: String,
|
|
522
|
+
reflect: !0
|
|
523
|
+
})], s.prototype, "spacing", void 0), e([o({
|
|
524
|
+
type: String,
|
|
525
|
+
attribute: "spacing-top",
|
|
526
|
+
reflect: !0
|
|
527
|
+
})], s.prototype, "spacingTop", void 0), e([o({
|
|
528
|
+
type: String,
|
|
529
|
+
attribute: "spacing-bottom",
|
|
530
|
+
reflect: !0
|
|
531
|
+
})], s.prototype, "spacingBottom", void 0), e([o({
|
|
532
|
+
type: String,
|
|
533
|
+
attribute: "spacing-left",
|
|
534
|
+
reflect: !0
|
|
535
|
+
})], s.prototype, "spacingLeft", void 0), e([o({
|
|
536
|
+
type: String,
|
|
537
|
+
attribute: "spacing-right",
|
|
538
|
+
reflect: !0
|
|
539
|
+
})], s.prototype, "spacingRight", void 0), e([o({ type: String })], s.prototype, "variant", void 0), e([o({ type: String })], s.prototype, "label", void 0), e([o({ type: String })], s.prototype, "icon", void 0), e([o({
|
|
540
|
+
type: String,
|
|
541
|
+
attribute: "supporting-text"
|
|
542
|
+
})], s.prototype, "supportingText", void 0), e([o({
|
|
543
|
+
type: String,
|
|
544
|
+
attribute: "ok-button"
|
|
545
|
+
})], s.prototype, "okButton", void 0), e([o({
|
|
546
|
+
type: String,
|
|
547
|
+
attribute: "cancel-button"
|
|
548
|
+
})], s.prototype, "cancelButton", void 0), e([o({
|
|
549
|
+
type: String,
|
|
550
|
+
attribute: "delete-button"
|
|
551
|
+
})], s.prototype, "deleteButton", void 0), e([o({
|
|
552
|
+
type: String,
|
|
553
|
+
attribute: "confirm-button"
|
|
554
|
+
})], s.prototype, "confirmButton", void 0), e([o({
|
|
555
|
+
type: String,
|
|
556
|
+
attribute: "deny-button"
|
|
557
|
+
})], s.prototype, "denyButton", void 0), e([o({
|
|
558
|
+
type: String,
|
|
559
|
+
attribute: "reset-button"
|
|
560
|
+
})], s.prototype, "resetButton", void 0), e([o({
|
|
561
|
+
type: String,
|
|
562
|
+
attribute: "submit-button"
|
|
563
|
+
})], s.prototype, "submitButton", void 0), e([o({
|
|
564
|
+
type: String,
|
|
565
|
+
attribute: "form-id"
|
|
566
|
+
})], s.prototype, "formId", void 0), e([o({
|
|
567
|
+
type: String,
|
|
568
|
+
attribute: "form-action"
|
|
569
|
+
})], s.prototype, "formAction", void 0), e([o({
|
|
570
|
+
type: String,
|
|
571
|
+
attribute: "form-method"
|
|
572
|
+
})], s.prototype, "formMethod", void 0), s = e([a("scb-dialog")], s);
|
|
573
|
+
//#endregion
|
|
574
|
+
export { s as ScbDialog };
|
|
@@ -0,0 +1,119 @@
|
|
|
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-divider/scb-divider.ts
|
|
5
|
+
var o = class extends t {
|
|
6
|
+
constructor(...e) {
|
|
7
|
+
super(...e), this.variant = "thin", this.direction = "horizontal", this.inset = "none", this.overlay = !1, this.anchor = "end", this.spacing = void 0;
|
|
8
|
+
}
|
|
9
|
+
static {
|
|
10
|
+
this.styles = n`
|
|
11
|
+
:host {
|
|
12
|
+
--scb-divider-color: var(--md-sys-color-outline-variant);
|
|
13
|
+
--scb-divider-thickness: 1px;
|
|
14
|
+
--scb-divider-gap: var(--scb-grid-column-gap, var(--spacing-6, 24px));
|
|
15
|
+
--scb-divider-spacing-orth: 0;
|
|
16
|
+
|
|
17
|
+
display: block;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
pointer-events: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([variant='bold']) {
|
|
23
|
+
--scb-divider-color: var(--md-sys-color-outline);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Horisontell avdelare: drar ut sig på inline-led, spacing på block-led (ovan/under). */
|
|
27
|
+
:host(:not([direction='vertical'])) {
|
|
28
|
+
inline-size: 100%;
|
|
29
|
+
block-size: var(--scb-divider-thickness);
|
|
30
|
+
background: var(--scb-divider-color);
|
|
31
|
+
margin-block: var(--scb-divider-spacing-orth, 0);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([inset='both']:not([direction='vertical'])) {
|
|
35
|
+
margin-inline: var(--spacing-8, 32px);
|
|
36
|
+
}
|
|
37
|
+
:host([inset='start']:not([direction='vertical'])) {
|
|
38
|
+
margin-inline-start: var(--spacing-8, 32px);
|
|
39
|
+
}
|
|
40
|
+
:host([inset='end']:not([direction='vertical'])) {
|
|
41
|
+
margin-inline-end: var(--spacing-8, 32px);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Vertikal avdelare: drar ut sig på block-led, spacing på inline-led (vänster/höger). */
|
|
45
|
+
:host([direction='vertical']:not([overlay])) {
|
|
46
|
+
inline-size: var(--scb-divider-thickness);
|
|
47
|
+
block-size: 100%;
|
|
48
|
+
background: var(--scb-divider-color);
|
|
49
|
+
align-self: stretch;
|
|
50
|
+
justify-self: center;
|
|
51
|
+
margin-inline: var(--scb-divider-spacing-orth, 0);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host([direction='vertical'][inset='both']:not([overlay])) {
|
|
55
|
+
margin-block: var(--spacing-8, 32px);
|
|
56
|
+
}
|
|
57
|
+
:host([direction='vertical'][inset='start']:not([overlay])) {
|
|
58
|
+
margin-block-start: var(--spacing-8, 32px);
|
|
59
|
+
}
|
|
60
|
+
:host([direction='vertical'][inset='end']:not([overlay])) {
|
|
61
|
+
margin-block-end: var(--spacing-8, 32px);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Overlay-variant för vertikal avdelare, spacing ignoreras (absolut positionerad). */
|
|
65
|
+
:host([overlay][direction='vertical']) {
|
|
66
|
+
position: absolute;
|
|
67
|
+
top: 0;
|
|
68
|
+
bottom: 0;
|
|
69
|
+
inline-size: var(--scb-divider-thickness);
|
|
70
|
+
background: var(--scb-divider-color);
|
|
71
|
+
}
|
|
72
|
+
:host([overlay][direction='vertical'][anchor='end']) {
|
|
73
|
+
right: calc(var(--scb-divider-gap) / -2);
|
|
74
|
+
}
|
|
75
|
+
:host([overlay][direction='vertical'][anchor='start']) {
|
|
76
|
+
left: calc(var(--scb-divider-gap) / -2);
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
firstUpdated() {
|
|
81
|
+
this.#e();
|
|
82
|
+
}
|
|
83
|
+
updated(e) {
|
|
84
|
+
e.has("spacing") && this.#e();
|
|
85
|
+
}
|
|
86
|
+
mapSpacingToken(e) {
|
|
87
|
+
if (!e) return;
|
|
88
|
+
let t = String(e).trim();
|
|
89
|
+
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
90
|
+
}
|
|
91
|
+
#e() {
|
|
92
|
+
let e = this.mapSpacingToken(this.spacing);
|
|
93
|
+
e ? this.style.setProperty("--scb-divider-spacing-orth", e) : this.style.removeProperty("--scb-divider-spacing-orth");
|
|
94
|
+
}
|
|
95
|
+
render() {
|
|
96
|
+
return r``;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
e([a({
|
|
100
|
+
type: String,
|
|
101
|
+
reflect: !0
|
|
102
|
+
})], o.prototype, "variant", void 0), e([a({
|
|
103
|
+
type: String,
|
|
104
|
+
reflect: !0
|
|
105
|
+
})], o.prototype, "direction", void 0), e([a({
|
|
106
|
+
type: String,
|
|
107
|
+
reflect: !0
|
|
108
|
+
})], o.prototype, "inset", void 0), e([a({
|
|
109
|
+
type: Boolean,
|
|
110
|
+
reflect: !0
|
|
111
|
+
})], o.prototype, "overlay", void 0), e([a({
|
|
112
|
+
type: String,
|
|
113
|
+
reflect: !0
|
|
114
|
+
})], o.prototype, "anchor", void 0), e([a({
|
|
115
|
+
type: String,
|
|
116
|
+
reflect: !0
|
|
117
|
+
})], o.prototype, "spacing", void 0), o = e([i("scb-divider")], o);
|
|
118
|
+
//#endregion
|
|
119
|
+
export { o as ScbDivider };
|