@bk2k/ui 0.6.8 → 0.7.1
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/BUILDING.md +56 -2
- package/CHANGELOG.md +199 -0
- package/USAGE.md +102 -28
- package/custom-elements.json +1 -1
- package/dist/charts/chart-tokens.js +1 -1
- package/dist/charts/fields.d.ts +20 -0
- package/dist/charts/fields.js +27 -0
- package/dist/charts/frame.d.ts +2 -0
- package/dist/charts/frame.js +2 -1
- package/dist/clipboard.js +1 -0
- package/dist/components/bk-alert.js +3 -2
- package/dist/components/bk-avatar-group.js +4 -6
- package/dist/components/bk-avatar.d.ts +10 -0
- package/dist/components/bk-avatar.js +17 -0
- package/dist/components/bk-bar.js +2 -0
- package/dist/components/bk-button-group.js +1 -1
- package/dist/components/bk-button-top.js +2 -1
- package/dist/components/bk-button.d.ts +42 -14
- package/dist/components/bk-button.js +67 -20
- package/dist/components/bk-card.d.ts +7 -0
- package/dist/components/bk-card.js +21 -2
- package/dist/components/bk-carousel-controls.d.ts +2 -0
- package/dist/components/bk-carousel-controls.js +4 -2
- package/dist/components/bk-chart-area.d.ts +10 -0
- package/dist/components/bk-chart-bar.d.ts +17 -0
- package/dist/components/bk-chart-bar.js +25 -4
- package/dist/components/bk-chart-line.d.ts +28 -0
- package/dist/components/bk-chart-line.js +27 -7
- package/dist/components/bk-chip-group.d.ts +2 -2
- package/dist/components/bk-chip-group.js +4 -0
- package/dist/components/bk-chip.d.ts +55 -8
- package/dist/components/bk-chip.js +46 -8
- package/dist/components/bk-code.js +6 -2
- package/dist/components/bk-columns.d.ts +11 -0
- package/dist/components/bk-columns.js +8 -1
- package/dist/components/bk-combobox.d.ts +3 -3
- package/dist/components/bk-combobox.js +9 -21
- package/dist/components/bk-delta.d.ts +10 -0
- package/dist/components/bk-delta.js +8 -6
- package/dist/components/bk-dialog.d.ts +12 -5
- package/dist/components/bk-dialog.js +14 -6
- package/dist/components/bk-disclosure.js +4 -2
- package/dist/components/bk-drop-target.d.ts +7 -1
- package/dist/components/bk-drop-target.js +20 -4
- package/dist/components/bk-error-summary.d.ts +5 -0
- package/dist/components/bk-error-summary.js +13 -4
- package/dist/components/bk-facts.js +3 -2
- package/dist/components/bk-footnote.d.ts +73 -0
- package/dist/components/bk-footnote.js +97 -0
- package/dist/components/bk-footnotes-item.d.ts +92 -0
- package/dist/components/bk-footnotes-item.js +139 -0
- package/dist/components/bk-footnotes.d.ts +51 -0
- package/dist/components/bk-footnotes.js +43 -0
- package/dist/components/bk-icon.js +2 -2
- package/dist/components/bk-image-compare.d.ts +69 -6
- package/dist/components/bk-image-compare.js +116 -32
- package/dist/components/bk-image-crop.d.ts +3 -3
- package/dist/components/bk-image-editor.d.ts +1 -1
- package/dist/components/bk-image-viewer.d.ts +178 -11
- package/dist/components/bk-image-viewer.js +310 -52
- package/dist/components/bk-input-color.d.ts +2 -5
- package/dist/components/bk-input-color.js +0 -14
- package/dist/components/bk-input-file.d.ts +17 -0
- package/dist/components/bk-input-file.js +18 -8
- package/dist/components/bk-input-inline.d.ts +15 -6
- package/dist/components/bk-input-inline.js +22 -6
- package/dist/components/bk-input-number.js +2 -1
- package/dist/components/bk-input-search.d.ts +1 -1
- package/dist/components/bk-input-search.js +2 -1
- package/dist/components/bk-input-tags.d.ts +219 -0
- package/dist/components/bk-input-tags.js +293 -0
- package/dist/components/bk-input-text.d.ts +20 -0
- package/dist/components/bk-input-text.js +34 -4
- package/dist/components/bk-input-time.js +2 -1
- package/dist/components/bk-item.js +2 -1
- package/dist/components/bk-lightbox.d.ts +37 -4
- package/dist/components/bk-lightbox.js +13 -3
- package/dist/components/bk-link.d.ts +9 -1
- package/dist/components/bk-link.js +14 -4
- package/dist/components/bk-menu-item.d.ts +40 -0
- package/dist/components/bk-menu-item.js +57 -9
- package/dist/components/bk-menu-label.js +2 -1
- package/dist/components/bk-menu-list.d.ts +1 -0
- package/dist/components/bk-menu-list.js +10 -0
- package/dist/components/bk-menu.d.ts +8 -1
- package/dist/components/bk-menu.js +16 -5
- package/dist/components/bk-message-feedback.d.ts +4 -3
- package/dist/components/bk-message-feedback.js +7 -5
- package/dist/components/bk-message-list.js +2 -1
- package/dist/components/bk-message-source.d.ts +1 -2
- package/dist/components/bk-message-source.js +3 -11
- package/dist/components/bk-message.js +2 -0
- package/dist/components/bk-nav-group.js +1 -1
- package/dist/components/bk-nav-item.d.ts +18 -0
- package/dist/components/bk-nav-item.js +18 -5
- package/dist/components/bk-nav.d.ts +1 -1
- package/dist/components/bk-page-cta.d.ts +2 -0
- package/dist/components/bk-page-cta.js +10 -1
- package/dist/components/bk-page-section.d.ts +1 -1
- package/dist/components/bk-page-section.js +3 -9
- package/dist/components/bk-pane.d.ts +1 -0
- package/dist/components/bk-pane.js +7 -5
- package/dist/components/bk-panel.d.ts +1 -1
- package/dist/components/bk-panel.js +6 -5
- package/dist/components/bk-picture.d.ts +17 -4
- package/dist/components/bk-picture.js +8 -1
- package/dist/components/bk-segmented-item.d.ts +24 -4
- package/dist/components/bk-segmented-item.js +37 -5
- package/dist/components/bk-segmented.js +2 -13
- package/dist/components/bk-select-cascade.d.ts +1 -1
- package/dist/components/bk-select-tree.d.ts +1 -1
- package/dist/components/bk-select.d.ts +1 -1
- package/dist/components/bk-shell-app.d.ts +10 -4
- package/dist/components/bk-shell-app.js +32 -9
- package/dist/components/bk-shell-sites.d.ts +2 -1
- package/dist/components/bk-shell-sites.js +3 -5
- package/dist/components/bk-sortable.js +7 -17
- package/dist/components/bk-split-grid.d.ts +104 -3
- package/dist/components/bk-split-grid.js +430 -2
- package/dist/components/bk-stat-group.js +2 -1
- package/dist/components/bk-stat.d.ts +19 -0
- package/dist/components/bk-stat.js +8 -4
- package/dist/components/bk-steps.js +2 -1
- package/dist/components/bk-surface.d.ts +2 -0
- package/dist/components/bk-surface.js +6 -3
- package/dist/components/bk-table.d.ts +3 -1
- package/dist/components/bk-table.js +10 -13
- package/dist/components/bk-tabs-item.d.ts +45 -7
- package/dist/components/bk-tabs-item.js +51 -20
- package/dist/components/bk-tabs-panel.d.ts +6 -3
- package/dist/components/bk-tabs-panel.js +6 -0
- package/dist/components/bk-tabs.d.ts +52 -8
- package/dist/components/bk-tabs.js +181 -97
- package/dist/components/bk-text.js +2 -1
- package/dist/components/bk-toast-group.d.ts +3 -1
- package/dist/components/bk-toast-group.js +11 -1
- package/dist/components/bk-tooltip.d.ts +3 -1
- package/dist/components/bk-tooltip.js +2 -1
- package/dist/components/bk-video.js +2 -2
- package/dist/components/bk-zoom.d.ts +3 -1
- package/dist/components/confirm.d.ts +15 -0
- package/dist/components/confirm.js +27 -4
- package/dist/i18n/de.js +12 -1
- package/dist/i18n/en.d.ts +2 -0
- package/dist/i18n/en.js +3 -0
- package/dist/i18n.d.ts +16 -2
- package/dist/i18n.js +28 -4
- package/dist/icons/brands-static.d.ts +3 -0
- package/dist/icons/brands-static.js +5 -0
- package/dist/icons/core.d.ts +1 -0
- package/dist/icons/core.js +2 -0
- package/dist/icons/load-static.d.ts +3 -0
- package/dist/icons/load-static.js +5 -0
- package/dist/icons/load.js +1 -0
- package/dist/icons/registry.js +1 -1
- package/dist/icons/set/save-as.d.ts +3 -0
- package/dist/icons/set/save-as.js +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/internal/announcer.d.ts +14 -1
- package/dist/internal/announcer.js +33 -12
- package/dist/internal/backdrop.d.ts +19 -0
- package/dist/internal/backdrop.js +29 -0
- package/dist/internal/busy.d.ts +3 -2
- package/dist/internal/busy.js +4 -5
- package/dist/internal/choice-field.js +1 -1
- package/dist/internal/choice-item.d.ts +17 -6
- package/dist/internal/choice-item.js +20 -9
- package/dist/internal/cloak.js +4 -0
- package/dist/internal/crop-frame.d.ts +1 -1
- package/dist/internal/crop-frame.js +2 -7
- package/dist/internal/date-field.js +2 -1
- package/dist/internal/define.d.ts +9 -0
- package/dist/internal/define.js +47 -1
- package/dist/internal/drag.d.ts +11 -0
- package/dist/internal/drag.js +23 -0
- package/dist/internal/elements.d.ts +6 -0
- package/dist/internal/elements.js +5 -0
- package/dist/internal/english-static.d.ts +3 -0
- package/dist/internal/english-static.js +5 -0
- package/dist/internal/english.d.ts +8 -0
- package/dist/internal/english.js +6 -0
- package/dist/internal/footnotes.d.ts +56 -0
- package/dist/internal/footnotes.js +143 -0
- package/dist/internal/handle-menu.js +2 -5
- package/dist/internal/hue.d.ts +8 -0
- package/dist/internal/hue.js +15 -4
- package/dist/internal/late/bk-shell-app.d.ts +4 -0
- package/dist/internal/late/bk-shell-app.js +7 -0
- package/dist/internal/late/bk-table.d.ts +4 -0
- package/dist/internal/late/bk-table.js +17 -0
- package/dist/internal/late/bk-tabs.d.ts +4 -0
- package/dist/internal/late/bk-tabs.js +8 -0
- package/dist/internal/late/handle-menu.d.ts +4 -0
- package/dist/internal/late/handle-menu.js +9 -0
- package/dist/internal/late/static.d.ts +7 -0
- package/dist/internal/late/static.js +5 -0
- package/dist/internal/late.d.ts +8 -3
- package/dist/internal/late.js +19 -4
- package/dist/internal/link.d.ts +2 -0
- package/dist/internal/link.js +11 -1
- package/dist/internal/own-text.d.ts +8 -0
- package/dist/internal/own-text.js +7 -0
- package/dist/internal/scope.js +1 -1
- package/dist/internal/scroll-lock.d.ts +4 -1
- package/dist/internal/scroll-lock.js +17 -4
- package/dist/internal/slider.js +2 -1
- package/dist/internal/styles.js +3 -0
- package/dist/internal/submit.d.ts +23 -0
- package/dist/internal/submit.js +57 -0
- package/dist/internal/tags.d.ts +15 -0
- package/dist/internal/tags.js +44 -0
- package/dist/internal/text-field.d.ts +2 -0
- package/dist/internal/text-field.js +8 -0
- package/dist/internal/toggle-control.js +3 -1
- package/dist/jsx.d.ts +222 -54
- package/dist/kit.d.ts +1 -0
- package/dist/kit.js +3 -0
- package/dist/reset.css +10 -0
- package/dist/standalone/all.js +226 -221
- package/dist/standalone/appearance.js +1 -1
- package/dist/standalone/bk-accordion-item.js +4 -4
- package/dist/standalone/bk-accordion.js +2 -2
- package/dist/standalone/bk-action-bar.js +3 -3
- package/dist/standalone/bk-alert-offline.js +1 -2
- package/dist/standalone/bk-alert.js +17 -13
- package/dist/standalone/bk-app-state.js +1 -1
- package/dist/standalone/bk-attachment.js +4 -4
- package/dist/standalone/bk-avatar-group.js +12 -10
- package/dist/standalone/bk-avatar.js +15 -5
- package/dist/standalone/bk-badge.js +2 -2
- package/dist/standalone/bk-bar.js +3 -1
- package/dist/standalone/bk-brand.js +3 -3
- package/dist/standalone/bk-breadcrumbs.js +5 -5
- package/dist/standalone/bk-button-copy.js +7 -7
- package/dist/standalone/bk-button-group.js +5 -5
- package/dist/standalone/bk-button-share.js +7 -7
- package/dist/standalone/bk-button-top.js +9 -8
- package/dist/standalone/bk-button.js +74 -34
- package/dist/standalone/bk-calendar-event.js +1 -1
- package/dist/standalone/bk-calendar-week.js +3 -3
- package/dist/standalone/bk-calendar.js +4 -4
- package/dist/standalone/bk-card.js +26 -7
- package/dist/standalone/bk-carousel-controls.js +7 -6
- package/dist/standalone/bk-carousel-item.js +2 -2
- package/dist/standalone/bk-carousel.js +1 -1
- package/dist/standalone/bk-chart-area.js +1 -1
- package/dist/standalone/bk-chart-bar-list.js +8 -8
- package/dist/standalone/bk-chart-bar.js +145 -117
- package/dist/standalone/bk-chart-bridge.js +7 -7
- package/dist/standalone/bk-chart-bullet.js +6 -6
- package/dist/standalone/bk-chart-calendar.js +7 -7
- package/dist/standalone/bk-chart-heatmap.js +7 -7
- package/dist/standalone/bk-chart-histogram.js +5 -5
- package/dist/standalone/bk-chart-legend.js +6 -6
- package/dist/standalone/bk-chart-line.js +128 -107
- package/dist/standalone/bk-chart-mark.js +1 -1
- package/dist/standalone/bk-chart-scatter.js +6 -6
- package/dist/standalone/bk-chart-sparkline.js +6 -6
- package/dist/standalone/bk-chart-stacked-bar.js +7 -7
- package/dist/standalone/bk-chart-tracker.js +6 -6
- package/dist/standalone/bk-chart-waterfall.js +6 -6
- package/dist/standalone/bk-checkbox-group.js +7 -7
- package/dist/standalone/bk-checkbox.js +4 -4
- package/dist/standalone/bk-chip-group.js +11 -7
- package/dist/standalone/bk-chip.js +59 -18
- package/dist/standalone/bk-cluster.js +1 -1
- package/dist/standalone/bk-code-diff.js +4 -4
- package/dist/standalone/bk-code-stack.js +4 -4
- package/dist/standalone/bk-code.js +10 -6
- package/dist/standalone/bk-color-panel.js +5 -5
- package/dist/standalone/bk-columns.js +13 -5
- package/dist/standalone/bk-combobox.js +23 -31
- package/dist/standalone/bk-command-menu.js +6 -6
- package/dist/standalone/bk-command-palette.js +8 -7
- package/dist/standalone/bk-composer.js +6 -6
- package/dist/standalone/bk-delta.js +11 -10
- package/dist/standalone/bk-diagram.js +1 -1
- package/dist/standalone/bk-dialog.js +1 -1
- package/dist/standalone/bk-disclosure.js +7 -5
- package/dist/standalone/bk-divider.js +5 -5
- package/dist/standalone/bk-drawer.js +3 -3
- package/dist/standalone/bk-drop-target.js +12 -6
- package/dist/standalone/bk-empty-state.js +3 -3
- package/dist/standalone/bk-error-summary.js +9 -6
- package/dist/standalone/bk-facts-item.js +2 -2
- package/dist/standalone/bk-facts.js +9 -8
- package/dist/standalone/bk-feature.js +3 -3
- package/dist/standalone/bk-fieldset.js +3 -3
- package/dist/standalone/bk-filter-bar.js +4 -4
- package/dist/standalone/bk-folder-browser.js +4 -4
- package/dist/standalone/bk-footnote.js +82 -0
- package/dist/standalone/bk-footnotes-item.js +122 -0
- package/dist/standalone/bk-footnotes.js +37 -0
- package/dist/standalone/bk-form-guard.js +2 -2
- package/dist/standalone/bk-form-steps.js +3 -3
- package/dist/standalone/bk-grid.js +1 -1
- package/dist/standalone/bk-icon-tile.js +3 -3
- package/dist/standalone/bk-icon.js +1 -1
- package/dist/standalone/bk-image-compare.js +127 -58
- package/dist/standalone/bk-image-crop.js +6 -6
- package/dist/standalone/bk-image-editor.js +1 -1
- package/dist/standalone/bk-image-viewer.js +283 -92
- package/dist/standalone/bk-input-code.js +4 -4
- package/dist/standalone/bk-input-color.js +4 -14
- package/dist/standalone/bk-input-date-range.js +2 -2
- package/dist/standalone/bk-input-date.js +2 -2
- package/dist/standalone/bk-input-file.js +22 -15
- package/dist/standalone/bk-input-group.js +4 -4
- package/dist/standalone/bk-input-inline.js +17 -10
- package/dist/standalone/bk-input-number.js +9 -8
- package/dist/standalone/bk-input-rating.js +6 -6
- package/dist/standalone/bk-input-rich.js +1 -1
- package/dist/standalone/bk-input-search.js +23 -22
- package/dist/standalone/bk-input-slider-range.js +5 -5
- package/dist/standalone/bk-input-slider.js +5 -5
- package/dist/standalone/bk-input-tags.js +224 -0
- package/dist/standalone/bk-input-text.js +1 -1
- package/dist/standalone/bk-input-time-zone.js +1 -1
- package/dist/standalone/bk-input-time.js +29 -28
- package/dist/standalone/bk-item-group.js +3 -3
- package/dist/standalone/bk-item.js +12 -11
- package/dist/standalone/bk-kbd-shortcuts.js +4 -3
- package/dist/standalone/bk-kbd.js +68 -1
- package/dist/standalone/bk-lightbox.js +24 -7
- package/dist/standalone/bk-lines.js +1 -1
- package/dist/standalone/bk-link.js +33 -19
- package/dist/standalone/bk-listbox-columns.js +8 -8
- package/dist/standalone/bk-listbox-item.js +1 -1
- package/dist/standalone/bk-listbox-search.js +7 -7
- package/dist/standalone/bk-listbox-transfer.js +6 -6
- package/dist/standalone/bk-listbox.js +7 -7
- package/dist/standalone/bk-logo-wall.js +2 -2
- package/dist/standalone/bk-logo.js +4 -4
- package/dist/standalone/bk-menu-bar.js +3 -3
- package/dist/standalone/bk-menu-context.js +1 -1
- package/dist/standalone/bk-menu-divider.js +2 -2
- package/dist/standalone/bk-menu-item.js +73 -29
- package/dist/standalone/bk-menu-label.js +7 -6
- package/dist/standalone/bk-menu-list.js +10 -4
- package/dist/standalone/bk-menu.js +19 -10
- package/dist/standalone/bk-message-approval.js +4 -4
- package/dist/standalone/bk-message-branches.js +3 -3
- package/dist/standalone/bk-message-citation.js +10 -10
- package/dist/standalone/bk-message-feedback.js +10 -6
- package/dist/standalone/bk-message-list.js +6 -5
- package/dist/standalone/bk-message-reasoning.js +5 -5
- package/dist/standalone/bk-message-source.js +13 -21
- package/dist/standalone/bk-message-tool-group.js +5 -5
- package/dist/standalone/bk-message-tool.js +5 -5
- package/dist/standalone/bk-message.js +6 -4
- package/dist/standalone/bk-meter.js +3 -3
- package/dist/standalone/bk-model-viewer.js +1 -1
- package/dist/standalone/bk-nav-divider.js +2 -2
- package/dist/standalone/bk-nav-group.js +9 -9
- package/dist/standalone/bk-nav-item.js +31 -23
- package/dist/standalone/bk-nav-toc.js +3 -3
- package/dist/standalone/bk-nav.js +3 -3
- package/dist/standalone/bk-overflow.js +3 -3
- package/dist/standalone/bk-page-cta.js +13 -4
- package/dist/standalone/bk-page-footer-column.js +2 -2
- package/dist/standalone/bk-page-footer.js +3 -3
- package/dist/standalone/bk-page-header.js +3 -3
- package/dist/standalone/bk-page-hero.js +3 -3
- package/dist/standalone/bk-page-pager.js +5 -5
- package/dist/standalone/bk-page-section.js +6 -6
- package/dist/standalone/bk-pagination.js +6 -6
- package/dist/standalone/bk-pane.js +10 -9
- package/dist/standalone/bk-panel.js +9 -10
- package/dist/standalone/bk-period-nav.js +4 -4
- package/dist/standalone/bk-picture.js +1 -166
- package/dist/standalone/bk-popover-help.js +3 -3
- package/dist/standalone/bk-popover.js +2 -2
- package/dist/standalone/bk-presence-cursor.js +3 -3
- package/dist/standalone/bk-preview.js +4 -4
- package/dist/standalone/bk-progress.js +3 -3
- package/dist/standalone/bk-prose.js +3 -3
- package/dist/standalone/bk-qr-code.js +1 -1
- package/dist/standalone/bk-radio-group.js +7 -7
- package/dist/standalone/bk-radio.js +3 -3
- package/dist/standalone/bk-rating.js +5 -5
- package/dist/standalone/bk-scroll.js +3 -3
- package/dist/standalone/bk-segmented-item.js +40 -16
- package/dist/standalone/bk-segmented.js +17 -15
- package/dist/standalone/bk-select-cascade.js +3 -3
- package/dist/standalone/bk-select-tree.js +4 -4
- package/dist/standalone/bk-select.js +5 -5
- package/dist/standalone/bk-shell-app.js +1 -1221
- package/dist/standalone/bk-shell-centered.js +2 -2
- package/dist/standalone/bk-shell-sites.js +5 -7
- package/dist/standalone/bk-skeleton.js +2 -2
- package/dist/standalone/bk-sortable.js +55 -60
- package/dist/standalone/bk-spinner.js +2 -2
- package/dist/standalone/bk-split-grid.js +324 -44
- package/dist/standalone/bk-split.js +8 -8
- package/dist/standalone/bk-stack.js +1 -1
- package/dist/standalone/bk-stat-group.js +8 -7
- package/dist/standalone/bk-stat.js +12 -9
- package/dist/standalone/bk-status-dot.js +3 -3
- package/dist/standalone/bk-steps-item.js +5 -5
- package/dist/standalone/bk-steps.js +8 -7
- package/dist/standalone/bk-surface.js +1 -1
- package/dist/standalone/bk-swatch-group.js +8 -8
- package/dist/standalone/bk-swatch-palette.js +1 -1
- package/dist/standalone/bk-swatch.js +2 -2
- package/dist/standalone/bk-switch.js +4 -4
- package/dist/standalone/bk-table.js +1 -1937
- package/dist/standalone/bk-tabs-item.js +58 -35
- package/dist/standalone/bk-tabs-panel.js +7 -3
- package/dist/standalone/bk-tabs.js +3 -352
- package/dist/standalone/bk-tasks-item.js +4 -4
- package/dist/standalone/bk-tasks.js +2 -2
- package/dist/standalone/bk-testimonial.js +3 -3
- package/dist/standalone/bk-text.js +21 -20
- package/dist/standalone/bk-time-countdown.js +4 -4
- package/dist/standalone/bk-time-relative.js +3 -3
- package/dist/standalone/bk-timeline-item.js +4 -4
- package/dist/standalone/bk-timeline.js +2 -2
- package/dist/standalone/bk-toast-group.js +1 -1
- package/dist/standalone/bk-toast.js +4 -4
- package/dist/standalone/bk-toolbar.js +2 -2
- package/dist/standalone/bk-tooltip.js +8 -7
- package/dist/standalone/bk-tree-item.js +6 -6
- package/dist/standalone/bk-tree.js +5 -5
- package/dist/standalone/bk-video.js +6 -6
- package/dist/standalone/bk-visually-hidden.js +2 -2
- package/dist/standalone/bk-zoom.js +5 -5
- package/dist/standalone/chunks/announcer-6tMlCOq1.js +41 -0
- package/dist/standalone/chunks/{appearance-waHnV0kk.js → appearance-CBOJXbmC.js} +1 -1
- package/dist/standalone/chunks/{bk-alert-offline-B1bQxOZp.js → bk-alert-offline-hCLuG-RM.js} +3 -3
- package/dist/standalone/chunks/{bk-carousel-BCwIQhG5.js → bk-carousel-_dudBMVq.js} +4 -4
- package/dist/standalone/chunks/{bk-diagram-DWK8CvRZ.js → bk-diagram-BB2odomE.js} +5 -5
- package/dist/standalone/chunks/{bk-dialog-DX0cPJ1o.js → bk-dialog-DcvwnOtN.js} +59 -25
- package/dist/standalone/chunks/{bk-icon-DssFsNuB.js → bk-icon-D4kI4F18.js} +4 -3
- package/dist/standalone/chunks/{bk-image-editor-DXEj9gCu.js → bk-image-editor-SRVkHI-4.js} +5 -5
- package/dist/standalone/chunks/{bk-input-date-range-Cbx_lpf0.js → bk-input-date-range-C0Vd-p0T.js} +2 -2
- package/dist/standalone/chunks/{bk-input-rich-ZB68vziu.js → bk-input-rich-AmDv87E5.js} +6 -6
- package/dist/standalone/chunks/{bk-input-text-DD32uWNO.js → bk-input-text-2n89GDIT.js} +73 -54
- package/dist/standalone/chunks/{bk-model-viewer-Dr81ahVv.js → bk-model-viewer-BoNYBd6W.js} +4 -4
- package/dist/standalone/chunks/bk-picture-CA5gLxgZ.js +186 -0
- package/dist/standalone/chunks/{bk-qr-code-QaYvZwOR.js → bk-qr-code-CSFfc8As.js} +3 -3
- package/dist/standalone/chunks/bk-shell-app-BlCOG25y.js +1236 -0
- package/dist/standalone/chunks/{bk-surface-DkIhrWMt.js → bk-surface-BULRdKam.js} +9 -7
- package/dist/standalone/chunks/{bk-swatch-palette-BNNXTP3w.js → bk-swatch-palette-Cqj85tSW.js} +6 -6
- package/dist/standalone/chunks/bk-table-DWlD7yoM.js +1945 -0
- package/dist/standalone/chunks/bk-tabs-STkr3-E1.js +422 -0
- package/dist/standalone/chunks/{bk-toast-group-BSeO_rPs.js → bk-toast-group-5nZg7BaJ.js} +27 -24
- package/dist/standalone/chunks/{brush-Bn3lPdHN.js → brush-DALmXSru.js} +18 -2
- package/dist/standalone/chunks/{busy-B7Mxemwm.js → busy-eG3uHonz.js} +5 -4
- package/dist/standalone/chunks/{chart-tokens-D1Exf7BW.js → chart-tokens-DQ4hVSmn.js} +2 -2
- package/dist/standalone/chunks/{choice-field-CGvE4tyb.js → choice-field-B0oe_9fI.js} +6 -6
- package/dist/standalone/chunks/{choice-item-B6-9ZRlf.js → choice-item-Cx-nm1js.js} +17 -8
- package/dist/standalone/chunks/{clipboard-Crzt1Sh9.js → clipboard-RqIeP9Uz.js} +1 -1
- package/dist/standalone/chunks/{clipboard-BKlrP5rj.js → clipboard-UVLSkL4C.js} +1 -1
- package/dist/standalone/chunks/{crop-frame-poLCGrBG.js → crop-frame-Z9N0QML4.js} +1 -11
- package/dist/standalone/chunks/{date-field-BlI6grfT.js → date-field-Dy1_qxNv.js} +48 -47
- package/dist/standalone/chunks/define-6OfuRn5c.js +60 -0
- package/dist/standalone/chunks/drag-DT4__0t9.js +12 -0
- package/dist/standalone/chunks/footnotes-BeisMxLk.js +94 -0
- package/dist/standalone/chunks/{form-control-CyXQIJ2x.js → form-control-Bmk0SRDX.js} +2 -2
- package/dist/standalone/chunks/{frame-abXBnl8a.js → frame-xIMVEUCi.js} +5 -4
- package/dist/standalone/chunks/{handle-menu-ZVR_msk2.js → handle-menu-BAe9fPYJ.js} +14 -33
- package/dist/standalone/chunks/{heading-text-CV5gBf7k.js → heading-text-B2kF-b8p.js} +1 -1
- package/dist/standalone/chunks/hue-vLbNdAEl.js +20 -0
- package/dist/standalone/chunks/{i18n-B6Al9xCK.js → i18n-DFfGgd3d.js} +49 -34
- package/dist/standalone/chunks/{i18n-BI16HQmm.js → i18n-DQAcbHkY.js} +1 -1
- package/dist/standalone/chunks/late-CPQ_RbU-.js +30 -0
- package/dist/standalone/chunks/link--YWr8exL.js +69 -0
- package/dist/standalone/chunks/{marks-0kbeB4n8.js → marks-pOUDNUf1.js} +2 -2
- package/dist/standalone/chunks/{options-DMEc8rQt.js → options-ySaDL-dW.js} +2 -2
- package/dist/standalone/chunks/own-text-mpZVnMyX.js +5 -0
- package/dist/standalone/chunks/{palettes-CKLHSIPx.js → palettes-J4bQ21ks.js} +2 -2
- package/dist/standalone/chunks/{popover-base-ac49G87f.js → popover-base-hxo-Vh6E.js} +2 -2
- package/dist/standalone/chunks/{prose-BG4oQH-i.js → prose-BiuJgiah.js} +1 -1
- package/dist/standalone/chunks/{ramp-ggoyjMvC.js → ramp-CGDOcqBZ.js} +1 -1
- package/dist/standalone/chunks/save-as-DBGZjczB.js +6 -0
- package/dist/standalone/chunks/shortcuts-DPxCSO4M.js +210 -0
- package/dist/standalone/chunks/{slider-BWT8Fmwz.js → slider-jp3d-Ld-.js} +15 -14
- package/dist/standalone/chunks/{stars-BN9M_9Q1.js → stars-BAUc_LqI.js} +1 -1
- package/dist/standalone/chunks/{styles-DwSR-9a3.js → styles-CaeyhYDA.js} +3 -0
- package/dist/standalone/chunks/submit-BjBGB8OW.js +42 -0
- package/dist/standalone/chunks/{summary-BK-B4m5A.js → summary-W5s0TFqV.js} +1 -1
- package/dist/standalone/chunks/tags-CMLAGsVw.js +37 -0
- package/dist/standalone/chunks/{text-field-4IUUpRHE.js → text-field-CufOGdfr.js} +17 -11
- package/dist/standalone/chunks/{toggle-control-ioV2jhNY.js → toggle-control-Cgqp1jhf.js} +5 -3
- package/dist/standalone/chunks/{tokens-BuahF1lF.js → tokens-C_ul7pL9.js} +4 -3
- package/dist/standalone/chunks/{virtual-B-1oN14Y.js → virtual-D-qgACnE.js} +1 -1
- package/dist/standalone/confirm.js +27 -14
- package/dist/standalone/i18n-de.js +13 -2
- package/dist/standalone/icons.js +100 -98
- package/dist/standalone/links.js +1 -1
- package/dist/standalone/reset.css +10 -0
- package/dist/standalone/toast.js +1 -1
- package/dist/standalone/tokens.css +6 -5
- package/dist/tokens.css +6 -5
- package/dist/tokens.js +4 -3
- package/package.json +25 -2
- package/dist/standalone/chunks/announcer-haFcvqbe.js +0 -25
- package/dist/standalone/chunks/bk-kbd-B_TlKzWj.js +0 -275
- package/dist/standalone/chunks/define-CzVPD4Zi.js +0 -30
- package/dist/standalone/chunks/hue-Jvb-141g.js +0 -14
- package/dist/standalone/chunks/keyed-CZ2AaouM.js +0 -16
- package/dist/standalone/chunks/link-CWSMsx04.js +0 -60
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { LitElement, css, html, nothing } from "lit";
|
|
2
2
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
3
|
+
import { repeat } from "lit/directives/repeat.js";
|
|
3
4
|
import { define } from "../internal/define.js";
|
|
4
5
|
import { containsDeep, deepActiveElement } from "../internal/anchor.js";
|
|
5
6
|
import { emit, emitDetail } from "../internal/events.js";
|
|
6
7
|
import { navigateClick } from "../internal/link.js";
|
|
7
8
|
import { LocalizeController } from "../i18n.js";
|
|
8
9
|
import { StateController } from "../internal/state.js";
|
|
10
|
+
import { LateLoad } from "../internal/late.js";
|
|
11
|
+
import { lateParts } from "#bk/internal/late/bk-tabs.js";
|
|
9
12
|
import { base, interactive } from "../internal/styles.js";
|
|
10
13
|
import { BkTabsItem } from "./bk-tabs-item.js";
|
|
11
14
|
import { BkTabsPanel } from "./bk-tabs-panel.js";
|
|
12
15
|
import "./bk-button.js";
|
|
13
16
|
import "./bk-icon.js";
|
|
14
|
-
import "./bk-menu.js";
|
|
15
|
-
import "./bk-menu-item.js";
|
|
16
17
|
import { mutationObserver, resizeObserver, lightDom } from "../internal/server.js";
|
|
17
18
|
import "../icons/set/add.js";
|
|
18
19
|
import "../icons/set/more-horiz.js";
|
|
19
|
-
|
|
20
|
+
const moreParts = new LateLoad(lateParts, "bk-menu", "bk-menu-item");
|
|
20
21
|
const keyOf = (el, i) => el.value || String(i);
|
|
21
22
|
class BkTabs extends LitElement {
|
|
22
23
|
static shadowRootOptions = { ...LitElement.shadowRootOptions, slotAssignment: "manual" };
|
|
@@ -30,15 +31,25 @@ class BkTabs extends LitElement {
|
|
|
30
31
|
persistKey: { attribute: "persist-key" },
|
|
31
32
|
addable: { type: Boolean, reflect: true },
|
|
32
33
|
addLabel: { attribute: "add-label" },
|
|
33
|
-
|
|
34
|
+
overflow: { reflect: true, useDefault: true },
|
|
35
|
+
overflowed: { state: true },
|
|
36
|
+
menuOpen: { state: true }
|
|
34
37
|
};
|
|
38
|
+
/** The entries of the open "More" menu. */
|
|
39
|
+
menuTabs = [];
|
|
40
|
+
/** The tab with the roving tabindex while the focus moves without a selection (manual activation). */
|
|
41
|
+
stopKey;
|
|
42
|
+
/** overflow="scroll" showed the selected tab once (the first render). */
|
|
43
|
+
revealed = false;
|
|
44
|
+
internals = this.attachInternals();
|
|
35
45
|
i18n = new LocalizeController(this);
|
|
36
|
-
resizer = resizeObserver(() => this.
|
|
46
|
+
resizer = resizeObserver(() => this.measure());
|
|
47
|
+
/** The sizes of the row, read when one of them changes. `willUpdate` computes `overflowed` from them. */
|
|
48
|
+
sizes;
|
|
37
49
|
tabs = [];
|
|
38
50
|
panels = [];
|
|
39
51
|
others = [];
|
|
40
52
|
ends = [];
|
|
41
|
-
key = `bk-tabs-${++uid}`;
|
|
42
53
|
/** persist-key whose stored value was already applied. */
|
|
43
54
|
restored;
|
|
44
55
|
/** The `value` that the markup sets ("" = the first tab): the tabs return to it when the stored entry is removed. */
|
|
@@ -64,6 +75,8 @@ class BkTabs extends LitElement {
|
|
|
64
75
|
this.orientation = "horizontal";
|
|
65
76
|
this.activation = "automatic";
|
|
66
77
|
this.overflowed = [];
|
|
78
|
+
this.menuOpen = false;
|
|
79
|
+
this.overflow = "menu";
|
|
67
80
|
this.addable = false;
|
|
68
81
|
this.addEventListener("remove", this.onRemove);
|
|
69
82
|
this.addEventListener("click", this.onClick);
|
|
@@ -119,8 +132,15 @@ class BkTabs extends LitElement {
|
|
|
119
132
|
position: relative; overflow-x: hidden;
|
|
120
133
|
}
|
|
121
134
|
/* A tab that does not fit leaves the row but keeps its size, so the row can measure it. */
|
|
122
|
-
|
|
135
|
+
/* overflow="scroll": the row scrolls sideways, without a visible scroll bar. */
|
|
136
|
+
:host([overflow="scroll"]:not([orientation="vertical"])) .list {
|
|
137
|
+
overflow-x: auto; scrollbar-width: none; overscroll-behavior-inline: contain; scroll-snap-type: inline proximity;
|
|
138
|
+
}
|
|
139
|
+
:host([overflow="scroll"]) ::slotted(bk-tabs-item) { scroll-snap-align: start; }
|
|
140
|
+
:host([overflow="scroll"]) .more { display: none; }
|
|
123
141
|
.more { flex: none; display: flex; align-items: center; margin-inline-start: calc(var(--bk-tabs-more-gap, var(--bk-space-cluster)) - var(--bk-space-cluster)); }
|
|
142
|
+
/* Until bk-menu loads, only its trigger shows: the entries are not text in the row. */
|
|
143
|
+
.more:not(:defined) > :not([slot="trigger"]) { display: none; }
|
|
124
144
|
.more.off { position: absolute; inset-block-start: 0; inset-inline-end: 0; visibility: hidden; pointer-events: none; }
|
|
125
145
|
:host([orientation="vertical"]) .more { display: none; }
|
|
126
146
|
.end { display: flex; align-items: center; gap: var(--bk-space-cluster); flex: none; }
|
|
@@ -153,7 +173,7 @@ class BkTabs extends LitElement {
|
|
|
153
173
|
--_bk-tab-mark-gap: var(--bk-tabs-tab-gap, var(--bk-space-2));
|
|
154
174
|
--_bk-tab-column-gap: 0;
|
|
155
175
|
}
|
|
156
|
-
:host([orientation="vertical"]
|
|
176
|
+
:host([orientation="vertical"]:state(dots)) {
|
|
157
177
|
--_bk-tab-columns: calc(var(--bk-tabs-dot-size, var(--bk-space-2)) + var(--bk-tabs-tab-gap, var(--bk-space-2))) auto minmax(0, 1fr) auto;
|
|
158
178
|
--_bk-tab-dot-gap: 0;
|
|
159
179
|
}
|
|
@@ -197,7 +217,7 @@ class BkTabs extends LitElement {
|
|
|
197
217
|
else
|
|
198
218
|
this.others.push(el);
|
|
199
219
|
}
|
|
200
|
-
this.
|
|
220
|
+
this.internals.states[this.tabs.some((t) => t.dot || t.hasAttribute("dot")) ? "add" : "delete"]("dots");
|
|
201
221
|
const enabled = this.tabs.filter((t) => !t.disabled);
|
|
202
222
|
if (this.persistKey && this.persistKey !== this.restored && this.tabs.length && !this.linkMode) {
|
|
203
223
|
this.restored = this.persistKey;
|
|
@@ -208,6 +228,18 @@ class BkTabs extends LitElement {
|
|
|
208
228
|
if (!this.tabs.some((t, i) => keyOf(t, i) === this.value) && enabled.length && !this.linkMode) {
|
|
209
229
|
this.value = keyOf(enabled[0], this.tabs.indexOf(enabled[0]));
|
|
210
230
|
}
|
|
231
|
+
const hidden = this.overflowFor();
|
|
232
|
+
if (hidden.length !== this.overflowed.length || hidden.some((t, i) => t !== this.overflowed[i]))
|
|
233
|
+
this.overflowed = hidden;
|
|
234
|
+
if (this.overflowed.length)
|
|
235
|
+
void moreParts.start();
|
|
236
|
+
}
|
|
237
|
+
/** `updateComplete` includes the load of the "More" menu while tabs do not fit. */
|
|
238
|
+
async getUpdateComplete() {
|
|
239
|
+
const result = await super.getUpdateComplete();
|
|
240
|
+
if (this.overflowed.length)
|
|
241
|
+
await moreParts.start();
|
|
242
|
+
return result;
|
|
211
243
|
}
|
|
212
244
|
updated(changed) {
|
|
213
245
|
super.updated(changed);
|
|
@@ -215,60 +247,65 @@ class BkTabs extends LitElement {
|
|
|
215
247
|
root.querySelector("slot[name=tab]")?.assign(...this.tabs);
|
|
216
248
|
root.querySelector("slot[name=panel]")?.assign(...this.panels, ...this.others);
|
|
217
249
|
root.querySelector("slot[name=end]")?.assign(...this.ends);
|
|
218
|
-
const hiddenTabs = new Set(this.overflowed);
|
|
219
250
|
const bar = root.querySelector(".bar");
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
tab.toggleAttribute("data-bk-overflow", hiddenTabs.has(tab));
|
|
224
|
-
this.resizer.observe(tab);
|
|
251
|
+
for (const el of [bar, root.querySelector(".more"), root.querySelector(".end"), ...this.tabs]) {
|
|
252
|
+
if (el)
|
|
253
|
+
this.resizer.observe(el);
|
|
225
254
|
}
|
|
226
|
-
this.
|
|
255
|
+
this.syncTabs();
|
|
227
256
|
const link = this.linkMode;
|
|
228
|
-
const
|
|
229
|
-
const tabFor = /* @__PURE__ */ new Map();
|
|
230
|
-
this.tabs.forEach((tab, i) => {
|
|
231
|
-
const k = keyOf(tab, i);
|
|
232
|
-
const selected = k === this.value;
|
|
233
|
-
tabFor.set(k, tab);
|
|
234
|
-
tab.selected = selected;
|
|
235
|
-
if (link) {
|
|
236
|
-
for (const a of ["role", "tabindex", "aria-selected", "aria-controls", "aria-disabled"])
|
|
237
|
-
tab.removeAttribute(a);
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
if (!tab.id)
|
|
241
|
-
tab.id = `${this.key}-tab-${i}`;
|
|
242
|
-
const panel = panelFor.get(k);
|
|
243
|
-
if (panel && !panel.id)
|
|
244
|
-
panel.id = `${this.key}-panel-${i}`;
|
|
245
|
-
tab.setAttribute("role", "tab");
|
|
246
|
-
tab.setAttribute("aria-selected", String(selected));
|
|
247
|
-
tab.tabIndex = selected ? 0 : -1;
|
|
248
|
-
if (panel)
|
|
249
|
-
tab.setAttribute("aria-controls", panel.id);
|
|
250
|
-
else
|
|
251
|
-
tab.removeAttribute("aria-controls");
|
|
252
|
-
if (tab.disabled)
|
|
253
|
-
tab.setAttribute("aria-disabled", "true");
|
|
254
|
-
else
|
|
255
|
-
tab.removeAttribute("aria-disabled");
|
|
256
|
-
});
|
|
257
|
+
const tabFor = new Map(this.tabs.map((t, i) => [keyOf(t, i), t]));
|
|
257
258
|
this.panels.forEach((panel, i) => {
|
|
258
259
|
const k = keyOf(panel, i);
|
|
259
|
-
|
|
260
|
-
panel.setAttribute("role", "tabpanel");
|
|
260
|
+
panel.setTab(link ? null : tabFor.get(k) ?? null);
|
|
261
261
|
if (!panel.hasAttribute("tabindex"))
|
|
262
262
|
panel.tabIndex = 0;
|
|
263
|
-
if (tab && !link)
|
|
264
|
-
panel.setAttribute("aria-labelledby", tab.id);
|
|
265
|
-
else
|
|
266
|
-
panel.removeAttribute("aria-labelledby");
|
|
267
263
|
if (k === this.value)
|
|
268
264
|
panel.removeAttribute("hidden");
|
|
269
|
-
else
|
|
265
|
+
else if (panel.getAttribute("hidden") !== "until-found")
|
|
270
266
|
panel.setAttribute("hidden", "until-found");
|
|
271
267
|
});
|
|
268
|
+
const first = !this.revealed;
|
|
269
|
+
if (first || changed.has("value") || changed.has("overflow"))
|
|
270
|
+
this.revealSelected(first);
|
|
271
|
+
}
|
|
272
|
+
/** Gives each tab its state: selected, Tab stop, its panel, in the "More" menu. */
|
|
273
|
+
syncTabs() {
|
|
274
|
+
const link = this.linkMode;
|
|
275
|
+
const hidden = new Set(this.overflowed);
|
|
276
|
+
const panelFor = new Map(this.panels.map((p, i) => [keyOf(p, i), p]));
|
|
277
|
+
const stop = this.stopKey ?? this.value;
|
|
278
|
+
this.tabs.forEach((tab, i) => {
|
|
279
|
+
const k = keyOf(tab, i);
|
|
280
|
+
tab.setTabState({
|
|
281
|
+
tab: !link,
|
|
282
|
+
selected: k === this.value,
|
|
283
|
+
tabStop: !link && k === stop,
|
|
284
|
+
controls: link ? null : panelFor.get(k) ?? null,
|
|
285
|
+
overflow: hidden.has(tab)
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
/** overflow="scroll": scrolls the row so that the selected tab is in view. Runs on the first render and on a selection only. */
|
|
290
|
+
revealSelected(first) {
|
|
291
|
+
if (this.overflow !== "scroll" || this.orientation === "vertical")
|
|
292
|
+
return;
|
|
293
|
+
const tab = this.tabs.find((t, i) => keyOf(t, i) === this.value);
|
|
294
|
+
if (!tab)
|
|
295
|
+
return;
|
|
296
|
+
this.revealed = true;
|
|
297
|
+
Promise.all(this.tabs.map((t) => t.updateComplete)).then(() => {
|
|
298
|
+
const list = this.renderRoot?.querySelector(".list");
|
|
299
|
+
if (!list || !tab.isConnected || list.scrollWidth <= list.clientWidth)
|
|
300
|
+
return;
|
|
301
|
+
const box = list.getBoundingClientRect();
|
|
302
|
+
const r = tab.getBoundingClientRect();
|
|
303
|
+
const dx = r.left < box.left ? r.left - box.left : r.right > box.right ? Math.min(r.right - box.right, r.left - box.left) : 0;
|
|
304
|
+
if (!dx)
|
|
305
|
+
return;
|
|
306
|
+
const still = first || matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
307
|
+
list.scrollBy({ left: dx, behavior: still ? "instant" : "smooth" });
|
|
308
|
+
});
|
|
272
309
|
}
|
|
273
310
|
/** The direct-child tab an event target is in, if any. */
|
|
274
311
|
tabFrom(target) {
|
|
@@ -285,6 +322,7 @@ class BkTabs extends LitElement {
|
|
|
285
322
|
if (!emitDetail(this, "select", { value: k, previous: this.value }, true))
|
|
286
323
|
return false;
|
|
287
324
|
this.value = k;
|
|
325
|
+
this.stopKey = void 0;
|
|
288
326
|
if (!tab.href)
|
|
289
327
|
this.stored.set(k);
|
|
290
328
|
emit(this, "change");
|
|
@@ -333,7 +371,8 @@ class BkTabs extends LitElement {
|
|
|
333
371
|
tab.requestRemove();
|
|
334
372
|
return;
|
|
335
373
|
}
|
|
336
|
-
const
|
|
374
|
+
const hidden = new Set(this.overflowed);
|
|
375
|
+
const enabled = this.tabs.filter((t) => !t.disabled && !hidden.has(t));
|
|
337
376
|
if (!enabled.length)
|
|
338
377
|
return;
|
|
339
378
|
let target;
|
|
@@ -360,68 +399,112 @@ class BkTabs extends LitElement {
|
|
|
360
399
|
return;
|
|
361
400
|
}
|
|
362
401
|
e.preventDefault();
|
|
363
|
-
|
|
364
|
-
|
|
402
|
+
this.stopKey = keyOf(target, this.tabs.indexOf(target));
|
|
403
|
+
this.syncTabs();
|
|
365
404
|
target.focus();
|
|
366
405
|
if (this.activation !== "manual")
|
|
367
406
|
this.select(target);
|
|
368
407
|
};
|
|
369
408
|
onFocusout = (e) => {
|
|
370
|
-
if (this.linkMode || this.tabFrom(e.relatedTarget))
|
|
409
|
+
if (this.linkMode || this.tabFrom(e.relatedTarget) || this.stopKey === void 0)
|
|
371
410
|
return;
|
|
372
|
-
this.
|
|
373
|
-
|
|
374
|
-
t.tabIndex = keyOf(t, i) === this.value ? 0 : -1;
|
|
375
|
-
});
|
|
411
|
+
this.stopKey = void 0;
|
|
412
|
+
this.syncTabs();
|
|
376
413
|
};
|
|
377
|
-
/**
|
|
378
|
-
|
|
414
|
+
/** Reads the sizes of the row (in the callback of the resize observer, not during an update). */
|
|
415
|
+
measure() {
|
|
379
416
|
const root = this.renderRoot;
|
|
380
417
|
const bar = root?.querySelector(".bar");
|
|
381
418
|
const list = root?.querySelector(".list");
|
|
382
419
|
const more = root?.querySelector(".more");
|
|
383
420
|
if (!bar || !list || !more)
|
|
384
421
|
return;
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
422
|
+
const gap = parseFloat(getComputedStyle(list).columnGap) || 0;
|
|
423
|
+
const barGap = parseFloat(getComputedStyle(bar).columnGap) || 0;
|
|
424
|
+
const end = root.querySelector(".end");
|
|
425
|
+
const room = bar.clientWidth > 0 ? bar.clientWidth - (end ? end.offsetWidth + barGap : 0) : 0;
|
|
426
|
+
const widths = new Map(this.tabs.map((t) => [t, t.offsetWidth]));
|
|
427
|
+
const old = this.sizes;
|
|
428
|
+
const same = old && old.room === room && old.more === more.offsetWidth + barGap && old.gap === gap && old.widths.size === widths.size && [...widths].every(([t, w]) => old.widths.get(t) === w);
|
|
429
|
+
this.sizes = { room, more: more.offsetWidth + barGap, gap, widths };
|
|
430
|
+
if (!same)
|
|
431
|
+
this.requestUpdate();
|
|
432
|
+
}
|
|
433
|
+
/** The tabs that do not fit the row and go into the "More" menu. The selected tab stays in the row. */
|
|
434
|
+
overflowFor() {
|
|
435
|
+
const sizes = this.sizes;
|
|
436
|
+
if (!sizes || sizes.room <= 0 || this.orientation === "vertical" || this.overflow === "scroll" || this.tabs.length < 2)
|
|
437
|
+
return [];
|
|
438
|
+
const widths = this.tabs.map((t) => sizes.widths.get(t) ?? 0);
|
|
439
|
+
const total = widths.reduce((a, b) => a + b, 0) + sizes.gap * (widths.length - 1);
|
|
440
|
+
if (total <= sizes.room)
|
|
441
|
+
return [];
|
|
442
|
+
const avail = sizes.room - sizes.more;
|
|
443
|
+
const selected = this.tabs.findIndex((t, i) => keyOf(t, i) === this.value);
|
|
444
|
+
const shown = /* @__PURE__ */ new Set();
|
|
445
|
+
let used = 0;
|
|
446
|
+
if (selected >= 0) {
|
|
447
|
+
shown.add(selected);
|
|
448
|
+
used = widths[selected];
|
|
413
449
|
}
|
|
414
|
-
|
|
415
|
-
|
|
450
|
+
for (let i = 0; i < this.tabs.length; i++) {
|
|
451
|
+
if (shown.has(i))
|
|
452
|
+
continue;
|
|
453
|
+
const next = used + (shown.size ? sizes.gap : 0) + widths[i];
|
|
454
|
+
if (next > avail)
|
|
455
|
+
break;
|
|
456
|
+
shown.add(i);
|
|
457
|
+
used = next;
|
|
458
|
+
}
|
|
459
|
+
return this.tabs.filter((_, i) => !shown.has(i));
|
|
416
460
|
}
|
|
461
|
+
/** The tab of an entry of the "More" menu. */
|
|
462
|
+
tabOfEntry(e) {
|
|
463
|
+
const entry = e.composedPath().find((n) => n instanceof Element && n.localName === "bk-menu-item");
|
|
464
|
+
return entry ? this.tabs.find((t, i) => keyOf(t, i) === entry.value) : void 0;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* A click on the link of an entry (capture phase, before the link fires `navigate`): a plain click selects the tab
|
|
468
|
+
* first, as in the row. A cancelled `select` stops the link. A modified click opens the link elsewhere and selects nothing.
|
|
469
|
+
*/
|
|
470
|
+
onMoreClick = (e) => {
|
|
471
|
+
const tab = this.tabOfEntry(e);
|
|
472
|
+
if (!tab?.href || tab.disabled)
|
|
473
|
+
return;
|
|
474
|
+
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0)
|
|
475
|
+
return;
|
|
476
|
+
if (!this.select(tab))
|
|
477
|
+
e.preventDefault();
|
|
478
|
+
};
|
|
479
|
+
/** The link of an entry fires `navigate`: the tabs fire it on the tab, as a click in the row does. */
|
|
480
|
+
onMoreNavigate = (e) => {
|
|
481
|
+
const tab = this.tabOfEntry(e);
|
|
482
|
+
if (!tab)
|
|
483
|
+
return;
|
|
484
|
+
e.stopPropagation();
|
|
485
|
+
if (!emitDetail(tab, "navigate", e.detail, true))
|
|
486
|
+
e.preventDefault();
|
|
487
|
+
};
|
|
417
488
|
onMoreSelect = (e) => {
|
|
418
489
|
e.stopPropagation();
|
|
419
490
|
const tab = this.tabs.find((t, i) => keyOf(t, i) === e.detail.value);
|
|
420
491
|
if (!tab)
|
|
421
492
|
return;
|
|
422
|
-
this.select(tab)
|
|
493
|
+
if (tab.href ? keyOf(tab, this.tabs.indexOf(tab)) !== this.value : !this.select(tab))
|
|
494
|
+
return;
|
|
423
495
|
this.updateComplete.then(() => requestAnimationFrame(() => tab.focus()));
|
|
424
496
|
};
|
|
497
|
+
/** The open menu keeps its entries: a click on an entry ends on the element (and the link) that the user chose. */
|
|
498
|
+
onMoreOpen = () => {
|
|
499
|
+
this.menuTabs = this.overflowed;
|
|
500
|
+
this.menuOpen = true;
|
|
501
|
+
};
|
|
502
|
+
/** After the click that closed the menu (and the link that it follows), the entries follow the row again. */
|
|
503
|
+
onMoreClose = () => {
|
|
504
|
+
setTimeout(() => {
|
|
505
|
+
this.menuOpen = false;
|
|
506
|
+
});
|
|
507
|
+
};
|
|
425
508
|
onRemove = (e) => {
|
|
426
509
|
const tab = this.tabFrom(e.target);
|
|
427
510
|
if (!tab)
|
|
@@ -457,11 +540,12 @@ class BkTabs extends LitElement {
|
|
|
457
540
|
const vertical = this.orientation === "vertical";
|
|
458
541
|
const list = this.linkMode ? html`<nav class="list" part="tablist" aria-label=${ifDefined(this.label)}><slot name="tab"></slot></nav>` : html`<div class="list" part="tablist" role="tablist" aria-orientation=${vertical ? "vertical" : "horizontal"}
|
|
459
542
|
aria-label=${ifDefined(this.label)}><slot name="tab"></slot></div>`;
|
|
460
|
-
const
|
|
461
|
-
const more = html`<bk-menu class="more ${
|
|
543
|
+
const entries = this.menuOpen ? this.menuTabs : this.overflowed;
|
|
544
|
+
const more = html`<bk-menu class="more ${entries.length ? "" : "off"}" part="more" placement="bottom-end" @select=${this.onMoreSelect}
|
|
545
|
+
@click=${{ handleEvent: this.onMoreClick, capture: true }} @navigate=${this.onMoreNavigate} @open=${this.onMoreOpen} @close=${this.onMoreClose}>
|
|
462
546
|
<bk-button slot="trigger" variant="ghost" size=${this.size} icon="more-horiz" label=${this.i18n.t("more")}></bk-button>
|
|
463
|
-
${
|
|
464
|
-
href=${ifDefined(t.href)}>${t.text}</bk-menu-item>`)}
|
|
547
|
+
${repeat(entries, (t) => t, (t) => html`<bk-menu-item value=${keyOf(t, this.tabs.indexOf(t))} icon=${ifDefined(t.icon)} ?disabled=${t.disabled}
|
|
548
|
+
href=${ifDefined(t.href)} target=${ifDefined(t.target)} rel=${ifDefined(t.rel)} download=${ifDefined(t.download)}>${t.text}</bk-menu-item>`)}
|
|
465
549
|
</bk-menu>`;
|
|
466
550
|
const add = this.addable ? html`<button class="add interactive" part="add" type="button" title=${this.addLabel || this.i18n.t("tabAdd")}
|
|
467
551
|
aria-label=${this.addLabel || this.i18n.t("tabAdd")} @click=${() => emit(this, "add")}><bk-icon name="add"></bk-icon></button>` : nothing;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, css, html, nothing } from "lit";
|
|
2
2
|
import { define } from "../internal/define.js";
|
|
3
|
+
import { setHostVars } from "../internal/host-vars.js";
|
|
3
4
|
import { LocalizeController } from "../i18n.js";
|
|
4
5
|
import { emitToggle } from "../internal/events.js";
|
|
5
6
|
import { base, headingType, displayType } from "../internal/styles.js";
|
|
@@ -237,7 +238,7 @@ class BkText extends LitElement {
|
|
|
237
238
|
if (changed.has("level"))
|
|
238
239
|
this.syncHeading();
|
|
239
240
|
if (changed.has("lines"))
|
|
240
|
-
this
|
|
241
|
+
setHostVars(this, { "--_bk-text-lines": this.lines ? String(this.lines) : "" });
|
|
241
242
|
if (changed.has("overflow") || changed.has("expandable") || changed.has("lines") || changed.has("highlight"))
|
|
242
243
|
this.observeClamp();
|
|
243
244
|
}
|
|
@@ -50,7 +50,8 @@ export interface ToastPromiseMessages<T> {
|
|
|
50
50
|
* above open dialogs), timers that pause while the pointer or the focus is on the toasts, and one
|
|
51
51
|
* overlay surface per toast. While a modal dialog is open, everything outside it is inert. The
|
|
52
52
|
* toaster then moves into the dialog and returns to its place when the dialog closes, so toasts stay
|
|
53
|
-
* operable and announced.
|
|
53
|
+
* operable and announced. This also applies to a `<bk-dialog>` or `<bk-drawer>` in a shadow root (the navigation
|
|
54
|
+
* drawer of `<bk-shell-app>`), and to toasts that show already when the dialog opens. The content of each toast is a `<bk-toast>`, which you can also use inline.
|
|
54
55
|
*
|
|
55
56
|
* A toast can change after it shows: `toast()` returns a handle whose `update()` replaces the message, the tone
|
|
56
57
|
* and the heading in place (a pending save turns into "Saved"). The toaster announces each update once, politely
|
|
@@ -120,6 +121,7 @@ export declare class BkToastGroup extends LitElement {
|
|
|
120
121
|
/** Why the timers wait: the `pointer` or the `focus` is on the toasts, the user drags a toast (`swipe`), the tab is `hidden` (WCAG 2.2.1). */
|
|
121
122
|
private holds;
|
|
122
123
|
private stopKeyboard?;
|
|
124
|
+
private stopModals?;
|
|
123
125
|
/** Where the toaster sits while it is in a modal dialog: the way back. */
|
|
124
126
|
private home?;
|
|
125
127
|
private i18n;
|
|
@@ -3,7 +3,7 @@ import { styleMap } from "../internal/style-map.js";
|
|
|
3
3
|
import { repeat } from "lit/directives/repeat.js";
|
|
4
4
|
import { define } from "../internal/define.js";
|
|
5
5
|
import { LocalizeController } from "../i18n.js";
|
|
6
|
-
import { topModal } from "../internal/announcer.js";
|
|
6
|
+
import { topModal, watchModals } from "../internal/announcer.js";
|
|
7
7
|
import { emitLifecycle } from "../internal/events.js";
|
|
8
8
|
import { trackKeyboardInset } from "../internal/viewport.js";
|
|
9
9
|
import { base, srOnly } from "../internal/styles.js";
|
|
@@ -19,6 +19,7 @@ class BkToastGroup extends LitElement {
|
|
|
19
19
|
/** Why the timers wait: the `pointer` or the `focus` is on the toasts, the user drags a toast (`swipe`), the tab is `hidden` (WCAG 2.2.1). */
|
|
20
20
|
holds = /* @__PURE__ */ new Set();
|
|
21
21
|
stopKeyboard;
|
|
22
|
+
stopModals;
|
|
22
23
|
/** Where the toaster sits while it is in a modal dialog: the way back. */
|
|
23
24
|
home;
|
|
24
25
|
i18n = new LocalizeController(this);
|
|
@@ -48,12 +49,21 @@ class BkToastGroup extends LitElement {
|
|
|
48
49
|
if (document.hidden)
|
|
49
50
|
this.hold("hidden");
|
|
50
51
|
this.stopKeyboard = trackKeyboardInset();
|
|
52
|
+
this.stopModals = watchModals(() => {
|
|
53
|
+
if (!this.isConnected || !this.items.length)
|
|
54
|
+
return;
|
|
55
|
+
this.relocate();
|
|
56
|
+
if (!this.matches(":popover-open"))
|
|
57
|
+
this.showPopover();
|
|
58
|
+
});
|
|
51
59
|
}
|
|
52
60
|
disconnectedCallback() {
|
|
53
61
|
super.disconnectedCallback();
|
|
54
62
|
document.removeEventListener("visibilitychange", this.onVisibility);
|
|
55
63
|
this.stopKeyboard?.();
|
|
56
64
|
this.stopKeyboard = void 0;
|
|
65
|
+
this.stopModals?.();
|
|
66
|
+
this.stopModals = void 0;
|
|
57
67
|
this.holds.clear();
|
|
58
68
|
}
|
|
59
69
|
/** Moves the toaster into the open modal dialog (inert outside it); moves it back when none is open. */
|
|
@@ -16,7 +16,9 @@ import "./bk-kbd.js";
|
|
|
16
16
|
*
|
|
17
17
|
* The tooltip sets the text as the accessible description of the target (`aria-description` on the element
|
|
18
18
|
* that receives the focus, for example the inner `<button>` of a `<bk-button>`; ARIA id references cannot reach into
|
|
19
|
-
* shadow roots). The tooltip does not set the description when the text only repeats the `aria-label` of the target.
|
|
19
|
+
* shadow roots). The tooltip does not set the description when the text only repeats the `aria-label` of the target.
|
|
20
|
+
* Content of the `content` slot with `aria-hidden="true"` shows but is not part of the description (a label that the
|
|
21
|
+
* name already contains). A native `title`
|
|
20
22
|
* on that element is removed while the tooltip is attached, so the two do not duplicate each other.
|
|
21
23
|
*
|
|
22
24
|
* `shortcut` shows the keys of the action after the text, as keycaps for the platform (`Mod+K`
|
|
@@ -8,6 +8,7 @@ const HIDE_GRACE = 100;
|
|
|
8
8
|
const WARM_WINDOW = 300;
|
|
9
9
|
let current = null;
|
|
10
10
|
let lastHidden = 0;
|
|
11
|
+
const spokenText = (node) => node instanceof Element ? node.getAttribute("aria-hidden") === "true" ? "" : [...node.childNodes].map(spokenText).join("") : node.nodeType === Node.TEXT_NODE ? node.textContent ?? "" : "";
|
|
11
12
|
class BkTooltip extends LitElement {
|
|
12
13
|
static properties = {
|
|
13
14
|
content: {},
|
|
@@ -177,7 +178,7 @@ class BkTooltip extends LitElement {
|
|
|
177
178
|
}
|
|
178
179
|
/** The tooltip text as plain text. */
|
|
179
180
|
get text() {
|
|
180
|
-
const slotted = [...this.children].filter((c) => c.slot === "content").map(
|
|
181
|
+
const slotted = [...this.children].filter((c) => c.slot === "content").map(spokenText).join(" ");
|
|
181
182
|
return (this.content || slotted).replace(/\s+/g, " ").trim();
|
|
182
183
|
}
|
|
183
184
|
/** Sets the text as the description of the element that receives the focus. */
|
|
@@ -445,9 +445,9 @@ class BkVideo extends LitElement {
|
|
|
445
445
|
</div>
|
|
446
446
|
<span class="time" part="time" aria-hidden="true">${this.clock(this.duration)}</span>
|
|
447
447
|
<bk-button class="mute" variant="ghost" size="sm" icon=${this.muted ? "volume-off" : "volume-up"} label=${this.i18n.t("mute")}
|
|
448
|
-
|
|
448
|
+
.pressed=${this.muted} @click=${this.toggleMute}></bk-button>
|
|
449
449
|
${this.hasCaptions ? html`<bk-button class="cc" variant="ghost" size="sm" icon=${this.captions ? "closed-caption-fill" : "closed-caption"}
|
|
450
|
-
label=${this.i18n.t("captions")}
|
|
450
|
+
label=${this.i18n.t("captions")} .pressed=${this.captions} @click=${this.toggleCaptions}></bk-button>` : nothing}
|
|
451
451
|
${this.canFullscreen ? html`<bk-button class="fs" variant="ghost" size="sm" icon=${this.fullscreen ? "fullscreen-exit" : "fullscreen"}
|
|
452
452
|
label=${this.fullscreen ? this.i18n.t("exitFullscreen") : this.i18n.t("fullscreen")} @click=${this.toggleFullscreen}></bk-button>` : nothing}
|
|
453
453
|
</div>`;
|
|
@@ -14,7 +14,8 @@ import "../icons/set/zoom-out.js";
|
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
16
|
* **The value** is a factor: `1` is 100 %. The slider moves in `step`, counted from `min`. The buttons set the next multiple of
|
|
17
|
-
* `increment` (from 1.1 the zoom-in button sets 1.25, not 1.35). The
|
|
17
|
+
* `increment` (from 1.1 the zoom-in button sets 1.25, not 1.35). The step is additive: there is no multiplicative step (a factor
|
|
18
|
+
* of 1.25 for each press). Use a `toLevel` and `fromLevel` pair with `increment` for a logarithmic scale. The component clamps the value to
|
|
18
19
|
* `min` and `max`. At a limit, the button for that direction is off but stays focusable and shows the reason.
|
|
19
20
|
*
|
|
20
21
|
* **Orientation.** `horizontal` (default) puts the controls in a row: zoom out, slider, zoom in, level.
|
|
@@ -59,6 +60,7 @@ import "../icons/set/zoom-out.js";
|
|
|
59
60
|
* @cssprop --bk-zoom-value-size - Font size of the zoom level (default --bk-type-small).
|
|
60
61
|
* @cssprop --bk-zoom-value-min-width - Smallest width of the zoom level, so that the row does not change its width (default 5ch).
|
|
61
62
|
* @cssprop --bk-zoom-input-width - Width of the field of `editable` (default the control height of `size` plus 4ch).
|
|
63
|
+
* A press on a button fires `input` and then `change`, both for the one press, like a key on a native range. Apply the zoom in one of them.
|
|
62
64
|
* @fires {Event} input - While the value changes: on a drag of the slider, on a key, on a button, on a commit of the field.
|
|
63
65
|
* @fires {Event} change - When a change is committed: on release of a drag, on a key, on a button, on Enter or blur in the field.
|
|
64
66
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "./bk-alert.js";
|
|
1
2
|
import "./bk-button.js";
|
|
2
3
|
import "./bk-icon-tile.js";
|
|
3
4
|
import "./bk-input-text.js";
|
|
@@ -17,6 +18,13 @@ export interface ConfirmOptions {
|
|
|
17
18
|
cancelLabel?: string;
|
|
18
19
|
/** Styles the confirm button as destructive and opens an alert dialog (`role="alertdialog"`): focus starts on Cancel and a click on the backdrop does not dismiss it. */
|
|
19
20
|
danger?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* An async action that the confirm button starts. While it runs, the confirm button shows `loading`, Cancel is disabled,
|
|
23
|
+
* and Esc, the backdrop and the close button do not dismiss the dialog. When the action fulfils, the dialog closes and
|
|
24
|
+
* the promise resolves to true. When it rejects, the dialog stays open and shows the error message in a `bk-alert`
|
|
25
|
+
* (the message "Cannot complete the action." if the error has no message). The user can try again or cancel.
|
|
26
|
+
*/
|
|
27
|
+
action?: () => Promise<unknown>;
|
|
20
28
|
}
|
|
21
29
|
export interface ChooseOptions extends ConfirmOptions {
|
|
22
30
|
/** Further answers, shown between Cancel and the confirm button. */
|
|
@@ -31,6 +39,13 @@ export interface ChooseOptions extends ConfirmOptions {
|
|
|
31
39
|
* `<bk-dialog>` and `<bk-button>`, so it picks up every token override of those.
|
|
32
40
|
*
|
|
33
41
|
* if (await confirmDialog({ heading: "Delete project?", message: "This cannot be undone.", danger: true, confirmLabel: "Delete" })) { ... }
|
|
42
|
+
*
|
|
43
|
+
* With `action`, the dialog runs the async action on confirm and stays open until it fulfils (see `ConfirmOptions.action`):
|
|
44
|
+
*
|
|
45
|
+
* await confirmDialog({ heading: "Delete project?", danger: true, confirmLabel: "Delete", action: () => api.deleteProject(id) });
|
|
46
|
+
*
|
|
47
|
+
* Focus: with `danger`, the focus starts on Cancel (the safe answer); otherwise on the confirm button. The focus does not
|
|
48
|
+
* change the answer: Enter activates the focused button, as in a native dialog.
|
|
34
49
|
*/
|
|
35
50
|
export declare function confirmDialog(o: ConfirmOptions): Promise<boolean>;
|
|
36
51
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { html, nothing, render } from "lit";
|
|
2
2
|
import { styleMap } from "../internal/style-map.js";
|
|
3
3
|
import { localeOf, translate } from "../i18n.js";
|
|
4
|
+
import "./bk-alert.js";
|
|
4
5
|
import "./bk-button.js";
|
|
5
6
|
import "./bk-icon-tile.js";
|
|
6
7
|
import "./bk-input-text.js";
|
|
@@ -22,11 +23,33 @@ function confirmDialog(o) {
|
|
|
22
23
|
const host = document.createElement("div");
|
|
23
24
|
const locale = localeOf(document.body);
|
|
24
25
|
document.body.append(host);
|
|
25
|
-
|
|
26
|
+
let pending = false;
|
|
27
|
+
let error = "";
|
|
28
|
+
const view = () => html`<bk-dialog size="sm" heading=${o.heading} ?alert=${o.danger} .dismissible=${!pending}>
|
|
26
29
|
${icon(o)}${message(o.message)}
|
|
27
|
-
|
|
28
|
-
<bk-button slot="footer" data-close value="
|
|
29
|
-
|
|
30
|
+
${error ? html`<bk-alert tone="danger" variant="soft">${error}</bk-alert>` : nothing}
|
|
31
|
+
<bk-button slot="footer" data-close value="cancel" ?disabled=${pending} ?autofocus=${o.danger}>${o.cancelLabel ?? translate(locale, "cancel")}</bk-button>
|
|
32
|
+
<bk-button slot="footer" ?data-close=${!o.action} value="confirm" ?loading=${pending} @click=${o.action ? run : void 0} ?autofocus=${!o.danger} variant="solid" tone=${o.danger ? "danger" : "accent"}>${o.confirmLabel ?? translate(locale, "confirm")}</bk-button>
|
|
33
|
+
</bk-dialog>`;
|
|
34
|
+
const update = () => render(view(), host);
|
|
35
|
+
const run = async () => {
|
|
36
|
+
if (pending)
|
|
37
|
+
return;
|
|
38
|
+
pending = true;
|
|
39
|
+
error = "";
|
|
40
|
+
update();
|
|
41
|
+
try {
|
|
42
|
+
await o.action();
|
|
43
|
+
pending = false;
|
|
44
|
+
update();
|
|
45
|
+
dialog.close("confirm");
|
|
46
|
+
} catch (e) {
|
|
47
|
+
pending = false;
|
|
48
|
+
error = e instanceof Error && e.message || typeof e === "string" && e || translate(locale, "actionFailed");
|
|
49
|
+
update();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
update();
|
|
30
53
|
const dialog = host.firstElementChild;
|
|
31
54
|
return new Promise((resolve) => {
|
|
32
55
|
dialog.addEventListener("close", (e) => {
|