@bk2k/ui 0.6.7 → 0.7.0
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 +88 -2
- package/CHANGELOG.md +193 -0
- package/USAGE.md +102 -33
- 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 +4 -2
- package/dist/clipboard.js +1 -0
- package/dist/components/bk-alert.js +2 -1
- 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 +55 -17
- package/dist/components/bk-button.js +71 -24
- package/dist/components/bk-card.d.ts +4 -0
- package/dist/components/bk-card.js +15 -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 +6 -0
- package/dist/components/bk-chart-bar.d.ts +63 -9
- package/dist/components/bk-chart-bar.js +152 -41
- package/dist/components/bk-chart-line.d.ts +13 -0
- package/dist/components/bk-chart-line.js +11 -1
- 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 +53 -8
- package/dist/components/bk-chip.js +43 -7
- 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 +30 -6
- package/dist/components/bk-combobox.js +63 -20
- package/dist/components/bk-delta.d.ts +10 -0
- package/dist/components/bk-delta.js +8 -6
- package/dist/components/bk-dialog.d.ts +16 -6
- package/dist/components/bk-dialog.js +20 -8
- 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-item.js +8 -6
- package/dist/components/bk-facts.d.ts +6 -4
- package/dist/components/bk-facts.js +22 -10
- 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 +33 -5
- package/dist/components/bk-image-compare.js +72 -24
- 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 +107 -11
- package/dist/components/bk-image-viewer.js +205 -34
- 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-text.d.ts +11 -0
- package/dist/components/bk-input-text.js +17 -3
- package/dist/components/bk-input-time-zone.d.ts +3 -0
- package/dist/components/bk-input-time.js +2 -1
- package/dist/components/bk-item.js +2 -1
- package/dist/components/bk-lightbox.d.ts +12 -3
- package/dist/components/bk-lightbox.js +6 -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-model-viewer.d.ts +12 -1
- package/dist/components/bk-model-viewer.js +15 -2
- 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.js +2 -0
- 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-period-nav.d.ts +102 -0
- package/dist/components/bk-period-nav.js +69 -0
- 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-select.js +2 -1
- package/dist/components/bk-shell-app.d.ts +13 -6
- package/dist/components/bk-shell-app.js +47 -11
- package/dist/components/bk-shell-sites.d.ts +2 -1
- package/dist/components/bk-shell-sites.js +3 -5
- package/dist/components/bk-sortable.d.ts +3 -0
- package/dist/components/bk-sortable.js +10 -17
- package/dist/components/bk-split-grid.d.ts +104 -3
- package/dist/components/bk-split-grid.js +425 -2
- package/dist/components/bk-split.d.ts +3 -0
- package/dist/components/bk-split.js +3 -0
- package/dist/components/bk-stat-group.js +2 -1
- package/dist/components/bk-stat.d.ts +17 -0
- package/dist/components/bk-stat.js +7 -3
- 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 +17 -13
- package/dist/components/bk-table.js +94 -15
- 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 +50 -7
- package/dist/components/bk-tabs.js +168 -96
- 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 +19 -1
- package/dist/i18n/en.d.ts +2 -0
- package/dist/i18n/en.js +3 -0
- package/dist/i18n.d.ts +23 -2
- package/dist/i18n.js +35 -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 +8 -1
- package/dist/internal/announcer.js +26 -10
- 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.d.ts +3 -0
- package/dist/internal/cloak.js +7 -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/drag.d.ts +11 -0
- package/dist/internal/drag.js +23 -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.d.ts +2 -3
- package/dist/internal/handle-menu.js +11 -3
- 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/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 +20 -0
- package/dist/internal/late.js +45 -0
- 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/jsx.d.ts +176 -56
- 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 +13 -12
- 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 +14 -4
- 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 +5 -5
- package/dist/standalone/bk-button-group.js +5 -5
- package/dist/standalone/bk-button-share.js +5 -5
- 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 +20 -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 +253 -166
- 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 +116 -103
- 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 +4 -4
- package/dist/standalone/bk-checkbox.js +4 -4
- package/dist/standalone/bk-chip-group.js +9 -5
- package/dist/standalone/bk-chip.js +56 -17
- 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 +53 -33
- package/dist/standalone/bk-command-menu.js +6 -6
- package/dist/standalone/bk-command-palette.js +6 -5
- 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 +2 -2
- 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 +10 -8
- package/dist/standalone/bk-facts.js +28 -16
- 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 +88 -47
- package/dist/standalone/bk-image-crop.js +6 -6
- package/dist/standalone/bk-image-editor.js +2 -1
- package/dist/standalone/bk-image-viewer.js +180 -59
- package/dist/standalone/bk-input-code.js +4 -4
- package/dist/standalone/bk-input-color.js +4 -4
- 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 +5 -5
- 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-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 +11 -7
- package/dist/standalone/bk-lines.js +1 -1
- package/dist/standalone/bk-link.js +33 -19
- package/dist/standalone/bk-listbox-columns.js +6 -6
- 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 +3 -3
- 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 +6 -6
- 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 +5 -3
- 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 +69 -0
- package/dist/standalone/bk-picture.js +24 -15
- package/dist/standalone/bk-popover-help.js +3 -3
- package/dist/standalone/bk-popover.js +2 -2
- package/dist/standalone/bk-presence-cursor.js +2 -2
- 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 +4 -4
- 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 +15 -13
- package/dist/standalone/bk-select-cascade.js +3 -3
- package/dist/standalone/bk-select-tree.js +4 -4
- package/dist/standalone/bk-select.js +7 -6
- package/dist/standalone/bk-shell-app.js +1 -1217
- 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 +58 -60
- package/dist/standalone/bk-spinner.js +2 -2
- package/dist/standalone/bk-split-grid.js +318 -41
- package/dist/standalone/bk-split.js +9 -6
- package/dist/standalone/bk-stack.js +1 -1
- package/dist/standalone/bk-stat-group.js +8 -7
- package/dist/standalone/bk-stat.js +11 -8
- 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 +4 -4
- 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 -1887
- package/dist/standalone/bk-tabs-item.js +58 -35
- package/dist/standalone/bk-tabs-panel.js +7 -3
- package/dist/standalone/bk-tabs.js +160 -98
- 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 +19 -18
- 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 +3 -3
- 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-D1zrRWwO.js +36 -0
- package/dist/standalone/chunks/{appearance-waHnV0kk.js → appearance-CBOJXbmC.js} +1 -1
- package/dist/standalone/chunks/{bk-alert-offline-BoMEYxnE.js → bk-alert-offline-Clw0ZSsH.js} +3 -3
- package/dist/standalone/chunks/{bk-carousel-B7-9OanA.js → bk-carousel-Biz7t8sL.js} +4 -4
- package/dist/standalone/chunks/{bk-diagram-CpOpicmo.js → bk-diagram-D_fQf6SF.js} +5 -5
- package/dist/standalone/chunks/{bk-dialog-a2BtUBf2.js → bk-dialog-DwZyUUHh.js} +65 -27
- package/dist/standalone/chunks/{bk-icon-DssFsNuB.js → bk-icon-Bp_flKdv.js} +4 -3
- package/dist/standalone/chunks/{bk-image-editor-z_Uj83fy.js → bk-image-editor-BADsoLRL.js} +5 -5
- package/dist/standalone/chunks/{bk-input-date-range-BQkbPlSJ.js → bk-input-date-range-DHcJ8-5g.js} +2 -2
- package/dist/standalone/chunks/{bk-input-rich-Dte_b4Ev.js → bk-input-rich-CFhW6vRa.js} +6 -6
- package/dist/standalone/chunks/{bk-input-text-CUNQG1ah.js → bk-input-text-DviyLBqj.js} +63 -54
- package/dist/standalone/chunks/{bk-model-viewer-D1XJPgAG.js → bk-model-viewer-w_Ah4Tvs.js} +22 -8
- package/dist/standalone/chunks/{bk-qr-code-CbI9rdOK.js → bk-qr-code-CYMovNVl.js} +3 -3
- package/dist/standalone/chunks/bk-shell-app-B2lxHit8.js +1235 -0
- package/dist/standalone/chunks/{bk-surface-DkIhrWMt.js → bk-surface-D7e0tErs.js} +9 -7
- package/dist/standalone/chunks/{bk-swatch-palette-BNNXTP3w.js → bk-swatch-palette-x13JgJQi.js} +6 -6
- package/dist/standalone/chunks/bk-table-CP8n_jy7.js +1944 -0
- package/dist/standalone/chunks/{bk-toast-group-Cix-Urgi.js → bk-toast-group-CoL6W7uk.js} +27 -24
- package/dist/standalone/chunks/{brush-Bn3lPdHN.js → brush-DALmXSru.js} +18 -2
- package/dist/standalone/chunks/{busy-B7Mxemwm.js → busy-BUB22mGY.js} +5 -4
- package/dist/standalone/chunks/{chart-tokens-D1Exf7BW.js → chart-tokens-DQ4hVSmn.js} +2 -2
- package/dist/standalone/chunks/{choice-field-BnuK9mp_.js → choice-field-poOTerh1.js} +6 -6
- package/dist/standalone/chunks/{choice-item-B6-9ZRlf.js → choice-item-Cx-nm1js.js} +17 -8
- package/dist/standalone/chunks/clipboard-RqIeP9Uz.js +29 -0
- package/dist/standalone/chunks/clipboard-UVLSkL4C.js +34 -0
- package/dist/standalone/chunks/{crop-frame-poLCGrBG.js → crop-frame-Z9N0QML4.js} +1 -11
- package/dist/standalone/chunks/{date-field-BQ5k-DDL.js → date-field-B-fCXa2D.js} +48 -47
- package/dist/standalone/chunks/{define-CzVPD4Zi.js → define-DkVeu7e9.js} +1 -1
- 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-D7dqSP9M.js → form-control-CHpfKAKa.js} +2 -2
- package/dist/standalone/chunks/{frame-BW1nKuoM.js → frame-xIMVEUCi.js} +7 -4
- package/dist/standalone/chunks/handle-menu-BgYUbGO2.js +56 -0
- package/dist/standalone/chunks/{heading-text-CV5gBf7k.js → heading-text-CgnCa_q2.js} +1 -1
- package/dist/standalone/chunks/{i18n-CNsBRNPu.js → i18n-DFfGgd3d.js} +56 -34
- package/dist/standalone/chunks/{i18n-CrZgrRu9.js → i18n-DQAcbHkY.js} +1 -1
- package/dist/standalone/chunks/link--YWr8exL.js +69 -0
- package/dist/standalone/chunks/{marks-CdqbbJpM.js → marks-pOUDNUf1.js} +2 -2
- package/dist/standalone/chunks/{options-DMEc8rQt.js → options-BdC8-KKM.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-oDhxsYMr.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-EclrETaQ.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-BgKEjDQx.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-BwL-Gp8w.js → summary-W5s0TFqV.js} +1 -1
- package/dist/standalone/chunks/{text-field-CTp2b-Ai.js → text-field-CqhJSAwZ.js} +4 -4
- package/dist/standalone/chunks/{toggle-control-DXkgmz7R.js → toggle-control-lvZbQtGW.js} +2 -2
- package/dist/standalone/chunks/{tokens-BuahF1lF.js → tokens-C_ul7pL9.js} +4 -3
- package/dist/standalone/chunks/{virtual-B-1oN14Y.js → virtual-C_h6sHnm.js} +1 -1
- package/dist/standalone/confirm.js +27 -14
- package/dist/standalone/i18n-de.js +20 -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 +9 -5
- package/dist/tokens.css +9 -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-B7bz8hmV.js +0 -275
- package/dist/standalone/chunks/clipboard-DBGdJ-1S.js +0 -61
- package/dist/standalone/chunks/handle-menu-DsxWvv4D.js +0 -22
- package/dist/standalone/chunks/link-CWSMsx04.js +0 -60
|
@@ -4,6 +4,9 @@ import { repeat } from "lit/directives/repeat.js";
|
|
|
4
4
|
import { define } from "../internal/define.js";
|
|
5
5
|
import { emitDetail } from "../internal/events.js";
|
|
6
6
|
import { LocalizeController } from "../i18n.js";
|
|
7
|
+
import { announce } from "../internal/announcer.js";
|
|
8
|
+
import { DRAG_THRESHOLD, INTERACTIVE, preventEvent, suppressClick } from "../internal/drag.js";
|
|
9
|
+
import { adoptLightStyles } from "../internal/light-styles.js";
|
|
7
10
|
import { StateController } from "../internal/state.js";
|
|
8
11
|
import { base, grip } from "../internal/styles.js";
|
|
9
12
|
import { mutationObserver, resizeObserver, lightDom } from "../internal/server.js";
|
|
@@ -12,6 +15,13 @@ const MOVE_MS = 260;
|
|
|
12
15
|
const ENTER_MS = 220;
|
|
13
16
|
const LEAVE_MS = 150;
|
|
14
17
|
const EASE = "cubic-bezier(0.2, 0, 0, 1)";
|
|
18
|
+
const handleStyles = css`
|
|
19
|
+
@layer bk.components {
|
|
20
|
+
bk-split-grid [data-split-grid-handle] { cursor: var(--bk-split-grid-handle-cursor, grab); touch-action: none; }
|
|
21
|
+
bk-split-grid[dragging] [data-split-grid-handle] { cursor: var(--bk-split-grid-dragging-cursor, grabbing); }
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
const NATIVE_CONTROL = "a[href], button, summary, input, select, textarea";
|
|
15
25
|
const parseSizes = (v) => v ? v.split(/[\s,]+/).map((x) => parseFloat(x)).filter((x) => Number.isFinite(x)) : void 0;
|
|
16
26
|
const valid = (v, n) => Array.isArray(v) && v.length === n && v.every((x) => typeof x === "number" && x > 0);
|
|
17
27
|
const normalize = (v) => {
|
|
@@ -68,6 +78,11 @@ class BkSplitGrid extends LitElement {
|
|
|
68
78
|
this.fr = [];
|
|
69
79
|
this.rfr = [];
|
|
70
80
|
this.scrolling = false;
|
|
81
|
+
this.addEventListener("pointerdown", this.onPaneDown);
|
|
82
|
+
this.addEventListener("keydown", this.onPaneKey);
|
|
83
|
+
this.addEventListener("focusin", this.onPaneFocusIn);
|
|
84
|
+
this.addEventListener("focusout", this.onPaneFocusOut);
|
|
85
|
+
this.addEventListener("dragstart", this.onNativeDrag);
|
|
71
86
|
}
|
|
72
87
|
/** The panes: element children that are not hidden. */
|
|
73
88
|
get panes() {
|
|
@@ -209,9 +224,11 @@ class BkSplitGrid extends LitElement {
|
|
|
209
224
|
this.mutations.observe(this, { childList: true, attributes: true, subtree: false, attributeFilter: ["hidden"] });
|
|
210
225
|
this.observePanes();
|
|
211
226
|
this.sizer.observe(this);
|
|
227
|
+
adoptLightStyles(this, handleStyles);
|
|
212
228
|
}
|
|
213
229
|
disconnectedCallback() {
|
|
214
230
|
super.disconnectedCallback();
|
|
231
|
+
this.endDrag(false);
|
|
215
232
|
this.mutations.disconnect();
|
|
216
233
|
this.paneObserver.disconnect();
|
|
217
234
|
this.sizer.disconnect();
|
|
@@ -235,6 +252,8 @@ class BkSplitGrid extends LitElement {
|
|
|
235
252
|
const moved = panes.length !== this.shown.length || panes.some((t, i) => t !== this.shown[i]) || zoom !== this.shownZoom;
|
|
236
253
|
if (moved)
|
|
237
254
|
this.observePanes();
|
|
255
|
+
if (moved && this.drag)
|
|
256
|
+
this.panesChanged = true;
|
|
238
257
|
const n = this.columnCount;
|
|
239
258
|
const r = this.rowCount;
|
|
240
259
|
if (!this.resizing) {
|
|
@@ -251,6 +270,10 @@ class BkSplitGrid extends LitElement {
|
|
|
251
270
|
this.shownRows = r;
|
|
252
271
|
}
|
|
253
272
|
updated() {
|
|
273
|
+
if (this.panesChanged) {
|
|
274
|
+
this.panesChanged = false;
|
|
275
|
+
this.endDrag(false);
|
|
276
|
+
}
|
|
254
277
|
const cells = this.cells();
|
|
255
278
|
cells.forEach(([pane, cell]) => {
|
|
256
279
|
const slot = cell.querySelector("slot");
|
|
@@ -305,6 +328,382 @@ class BkSplitGrid extends LitElement {
|
|
|
305
328
|
await Promise.all(anims.map((a) => a.finished.catch(() => void 0)));
|
|
306
329
|
setTimeout(() => anims.forEach((a) => a.cancel()), 500);
|
|
307
330
|
}
|
|
331
|
+
/* ---------------------------------------------------------------- moving panes */
|
|
332
|
+
/** The move of a pane, while it lasts (also before the pointer passed the threshold). */
|
|
333
|
+
drag = null;
|
|
334
|
+
panesChanged = false;
|
|
335
|
+
restoreFocus = 0;
|
|
336
|
+
/** The pane that an event happened in: the child of the element on its path. */
|
|
337
|
+
paneOf(e) {
|
|
338
|
+
return e.composedPath().find((n) => n instanceof HTMLElement && n.parentElement === this && this.shown.includes(n)) ?? null;
|
|
339
|
+
}
|
|
340
|
+
/** The handle on the path of the event inside `pane`, unless a control lies between (it keeps its press). */
|
|
341
|
+
handleOf(e, pane) {
|
|
342
|
+
const path = e.composedPath();
|
|
343
|
+
const end = path.indexOf(pane);
|
|
344
|
+
const handle = path.slice(0, end < 0 ? path.length : end + 1).find((n) => n instanceof HTMLElement && n.hasAttribute("data-split-grid-handle"));
|
|
345
|
+
if (!handle)
|
|
346
|
+
return null;
|
|
347
|
+
for (const n of path) {
|
|
348
|
+
if (n === handle)
|
|
349
|
+
break;
|
|
350
|
+
if (n instanceof HTMLElement && n.matches(INTERACTIVE) && !handle.shadowRoot?.contains(n))
|
|
351
|
+
return null;
|
|
352
|
+
}
|
|
353
|
+
return handle;
|
|
354
|
+
}
|
|
355
|
+
nameOf(pane, handle) {
|
|
356
|
+
const text = pane.dataset.splitGridLabel || pane.getAttribute("aria-label") || (handle ?? pane.querySelector("[data-split-grid-handle]"))?.textContent || "";
|
|
357
|
+
return text.replace(/\s+/g, " ").trim().slice(0, 80);
|
|
358
|
+
}
|
|
359
|
+
say(key, d, index) {
|
|
360
|
+
announce(this.i18n.t(key, { item: this.nameOf(d.pane, d.handle), position: index + 1, total: this.shown.length }));
|
|
361
|
+
}
|
|
362
|
+
cellOf(index) {
|
|
363
|
+
return this.renderRoot.querySelectorAll(".cell")[index] ?? null;
|
|
364
|
+
}
|
|
365
|
+
/** Moves the drop mark to the pane at `to` (`from`: no mark). */
|
|
366
|
+
setTarget(d, to) {
|
|
367
|
+
if (to === d.to)
|
|
368
|
+
return;
|
|
369
|
+
if (d.to !== d.from)
|
|
370
|
+
this.cellOf(d.to)?.classList.remove("target");
|
|
371
|
+
d.to = to;
|
|
372
|
+
if (to !== d.from)
|
|
373
|
+
this.cellOf(to)?.classList.add("target");
|
|
374
|
+
}
|
|
375
|
+
onPaneDown = (e) => {
|
|
376
|
+
if (this.drag || e.button !== 0 || !e.isPrimary)
|
|
377
|
+
return;
|
|
378
|
+
const pane = this.paneOf(e);
|
|
379
|
+
const handle = pane && this.handleOf(e, pane);
|
|
380
|
+
if (!pane || !handle)
|
|
381
|
+
return;
|
|
382
|
+
const from = this.shown.indexOf(pane);
|
|
383
|
+
this.drag = {
|
|
384
|
+
keyboard: false,
|
|
385
|
+
pane,
|
|
386
|
+
handle,
|
|
387
|
+
from,
|
|
388
|
+
to: from,
|
|
389
|
+
started: false,
|
|
390
|
+
id: e.pointerId,
|
|
391
|
+
x0: e.clientX,
|
|
392
|
+
y0: e.clientY,
|
|
393
|
+
x: e.clientX,
|
|
394
|
+
y: e.clientY,
|
|
395
|
+
offX: 0,
|
|
396
|
+
offY: 0,
|
|
397
|
+
raf: 0,
|
|
398
|
+
rects: null,
|
|
399
|
+
box: null,
|
|
400
|
+
outside: false
|
|
401
|
+
};
|
|
402
|
+
window.addEventListener("pointermove", this.onDragMove, true);
|
|
403
|
+
window.addEventListener("pointerup", this.onDragUp, true);
|
|
404
|
+
window.addEventListener("pointercancel", this.onDragCancel, true);
|
|
405
|
+
};
|
|
406
|
+
/** Lifts the pane: the look, the ghost, the boxes of the cells. */
|
|
407
|
+
startDrag(d) {
|
|
408
|
+
d.started = true;
|
|
409
|
+
try {
|
|
410
|
+
d.handle.setPointerCapture(d.id);
|
|
411
|
+
} catch {
|
|
412
|
+
}
|
|
413
|
+
this.setAttribute("dragging", "");
|
|
414
|
+
this.cellOf(d.from)?.classList.add("dragging");
|
|
415
|
+
getSelection()?.removeAllRanges();
|
|
416
|
+
document.addEventListener("selectstart", preventEvent, true);
|
|
417
|
+
window.addEventListener("touchmove", preventEvent, { passive: false });
|
|
418
|
+
window.addEventListener("keydown", this.onDragKey, true);
|
|
419
|
+
window.addEventListener("scroll", this.onDragScroll, true);
|
|
420
|
+
d.handle.addEventListener("lostpointercapture", this.onDragCancel);
|
|
421
|
+
this.measureDrag(d);
|
|
422
|
+
const ghost = this.renderRoot.querySelector(".ghost");
|
|
423
|
+
if (!ghost)
|
|
424
|
+
return;
|
|
425
|
+
const h = d.handle.getBoundingClientRect();
|
|
426
|
+
ghost.textContent = this.nameOf(d.pane, d.handle);
|
|
427
|
+
ghost.style.inlineSize = `${Math.round(h.width)}px`;
|
|
428
|
+
ghost.style.minBlockSize = `${Math.round(h.height)}px`;
|
|
429
|
+
ghost.style.transform = `translate(${Math.round(h.left)}px, ${Math.round(h.top)}px)`;
|
|
430
|
+
ghost.showPopover?.();
|
|
431
|
+
const g = ghost.getBoundingClientRect();
|
|
432
|
+
d.offX = Math.min(Math.max(d.x0 - h.left, 0), g.width);
|
|
433
|
+
d.offY = Math.min(Math.max(d.y0 - h.top, 0), g.height);
|
|
434
|
+
}
|
|
435
|
+
/** The boxes of the cells and of the visible area: once at the start and after a scroll, never per move. */
|
|
436
|
+
measureDrag(d) {
|
|
437
|
+
d.rects = [...this.renderRoot.querySelectorAll(".cell")].map((c) => c.hidden ? null : c.getBoundingClientRect());
|
|
438
|
+
d.box = (this.renderRoot.querySelector(".scroller") ?? this).getBoundingClientRect();
|
|
439
|
+
}
|
|
440
|
+
onDragScroll = () => {
|
|
441
|
+
if (this.drag)
|
|
442
|
+
this.drag.rects = null;
|
|
443
|
+
};
|
|
444
|
+
onDragMove = (e) => {
|
|
445
|
+
const d = this.drag;
|
|
446
|
+
if (!d || d.keyboard || e.pointerId !== d.id)
|
|
447
|
+
return;
|
|
448
|
+
d.x = e.clientX;
|
|
449
|
+
d.y = e.clientY;
|
|
450
|
+
if (!d.started) {
|
|
451
|
+
if (Math.hypot(d.x - d.x0, d.y - d.y0) < DRAG_THRESHOLD)
|
|
452
|
+
return;
|
|
453
|
+
this.startDrag(d);
|
|
454
|
+
}
|
|
455
|
+
e.preventDefault();
|
|
456
|
+
d.raf ||= requestAnimationFrame(() => this.dragFrame(d));
|
|
457
|
+
};
|
|
458
|
+
/** One frame of a pointer drag: move the ghost, find the target, tell the app about the outside (unless `last`). */
|
|
459
|
+
dragFrame(d, last = false) {
|
|
460
|
+
d.raf = 0;
|
|
461
|
+
if (this.drag !== d)
|
|
462
|
+
return;
|
|
463
|
+
if (!d.rects)
|
|
464
|
+
this.measureDrag(d);
|
|
465
|
+
const ghost = this.renderRoot.querySelector(".ghost");
|
|
466
|
+
if (ghost)
|
|
467
|
+
ghost.style.transform = `translate(${Math.round(d.x - d.offX)}px, ${Math.round(d.y - d.offY)}px)`;
|
|
468
|
+
const b = d.box;
|
|
469
|
+
const inside = d.x >= b.left && d.x <= b.right && d.y >= b.top && d.y <= b.bottom;
|
|
470
|
+
if (!inside) {
|
|
471
|
+
this.setTarget(d, d.from);
|
|
472
|
+
d.outside = true;
|
|
473
|
+
if (!last)
|
|
474
|
+
this.emitOutside("dragoutside", d, false);
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
const at2 = d.rects.findIndex((r) => !!r && d.x >= r.left && d.x <= r.right && d.y >= r.top && d.y <= r.bottom);
|
|
478
|
+
this.setTarget(d, at2 < 0 ? d.from : at2);
|
|
479
|
+
if (d.outside) {
|
|
480
|
+
d.outside = false;
|
|
481
|
+
this.emitOutside("dragoutside", d, true);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
emitOutside(type, d, inside) {
|
|
485
|
+
const point = { pane: d.pane, clientX: d.x, clientY: d.y };
|
|
486
|
+
if (type === "dropoutside")
|
|
487
|
+
emitDetail(this, type, point);
|
|
488
|
+
else
|
|
489
|
+
emitDetail(this, type, { ...point, inside });
|
|
490
|
+
}
|
|
491
|
+
onDragUp = (e) => {
|
|
492
|
+
const d = this.drag;
|
|
493
|
+
if (!d || d.keyboard || e.pointerId !== d.id)
|
|
494
|
+
return;
|
|
495
|
+
if (!d.started) {
|
|
496
|
+
this.endDrag(false);
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
d.x = e.clientX;
|
|
500
|
+
d.y = e.clientY;
|
|
501
|
+
cancelAnimationFrame(d.raf);
|
|
502
|
+
this.dragFrame(d, true);
|
|
503
|
+
suppressClick();
|
|
504
|
+
this.endDrag(true);
|
|
505
|
+
};
|
|
506
|
+
onDragCancel = (e) => {
|
|
507
|
+
const d = this.drag;
|
|
508
|
+
if (!d || d.keyboard || e.pointerId !== d.id)
|
|
509
|
+
return;
|
|
510
|
+
this.endDrag(false);
|
|
511
|
+
};
|
|
512
|
+
/** Escape during a pointer drag. */
|
|
513
|
+
onDragKey = (e) => {
|
|
514
|
+
if (e.key !== "Escape" || !this.drag?.started || this.drag.keyboard)
|
|
515
|
+
return;
|
|
516
|
+
e.preventDefault();
|
|
517
|
+
e.stopPropagation();
|
|
518
|
+
this.endDrag(false);
|
|
519
|
+
};
|
|
520
|
+
/** A native drag of a link or an image in a handle conflicts with the pointer drag. */
|
|
521
|
+
onNativeDrag = (e) => {
|
|
522
|
+
if (this.drag && !this.drag.keyboard)
|
|
523
|
+
e.preventDefault();
|
|
524
|
+
};
|
|
525
|
+
/** Ends a move. With `commit`, a drop on another pane fires `reorder` and a drop outside fires `dropoutside`. */
|
|
526
|
+
endDrag(commit) {
|
|
527
|
+
const d = this.drag;
|
|
528
|
+
if (!d)
|
|
529
|
+
return;
|
|
530
|
+
this.drag = null;
|
|
531
|
+
cancelAnimationFrame(d.raf);
|
|
532
|
+
window.removeEventListener("pointermove", this.onDragMove, true);
|
|
533
|
+
window.removeEventListener("pointerup", this.onDragUp, true);
|
|
534
|
+
window.removeEventListener("pointercancel", this.onDragCancel, true);
|
|
535
|
+
window.removeEventListener("keydown", this.onDragKey, true);
|
|
536
|
+
window.removeEventListener("scroll", this.onDragScroll, true);
|
|
537
|
+
window.removeEventListener("touchmove", preventEvent);
|
|
538
|
+
document.removeEventListener("selectstart", preventEvent, true);
|
|
539
|
+
d.handle.removeEventListener("lostpointercapture", this.onDragCancel);
|
|
540
|
+
if (!d.started && !d.keyboard)
|
|
541
|
+
return;
|
|
542
|
+
if (d.handle.hasPointerCapture?.(d.id))
|
|
543
|
+
d.handle.releasePointerCapture(d.id);
|
|
544
|
+
this.removeAttribute("dragging");
|
|
545
|
+
for (const c of this.renderRoot.querySelectorAll(".cell"))
|
|
546
|
+
c.classList.remove("dragging", "target");
|
|
547
|
+
const ghost = this.renderRoot.querySelector(".ghost");
|
|
548
|
+
if (ghost?.matches(":popover-open"))
|
|
549
|
+
ghost.hidePopover();
|
|
550
|
+
if (d.outside) {
|
|
551
|
+
if (commit)
|
|
552
|
+
this.emitOutside("dropoutside", d, false);
|
|
553
|
+
this.emitOutside("dragoutside", d, true);
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
if (!commit || d.to === d.from) {
|
|
557
|
+
if (d.keyboard)
|
|
558
|
+
this.say(commit ? "sortableDropped" : "sortableCancelled", d, d.from);
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
const order = this.shown.filter((p) => p !== d.pane);
|
|
562
|
+
order.splice(d.to, 0, d.pane);
|
|
563
|
+
if (!emitDetail(this, "reorder", { pane: d.pane, from: d.from, to: d.to, order }, true)) {
|
|
564
|
+
this.say("sortableCancelled", d, d.from);
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
this.say("sortableDropped", d, d.to);
|
|
568
|
+
if (d.keyboard) {
|
|
569
|
+
const handle = d.handle;
|
|
570
|
+
cancelAnimationFrame(this.restoreFocus);
|
|
571
|
+
this.updateComplete.then(() => {
|
|
572
|
+
this.restoreFocus = requestAnimationFrame(() => {
|
|
573
|
+
if (handle.isConnected && !handle.matches(":focus-within"))
|
|
574
|
+
handle.focus({ preventScroll: true });
|
|
575
|
+
});
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
/* ---------------------------------------------------------------- moving panes with the keyboard */
|
|
580
|
+
/** The handle that a key or focus event comes from: a focused handle that is not a native control (it keeps its keys). */
|
|
581
|
+
keyHandle(e, pane) {
|
|
582
|
+
const handle = this.handleOf(e, pane);
|
|
583
|
+
return handle && e.composedPath()[0] === handle && !handle.matches(NATIVE_CONTROL) ? handle : null;
|
|
584
|
+
}
|
|
585
|
+
onPaneFocusIn = (e) => {
|
|
586
|
+
const pane = this.paneOf(e);
|
|
587
|
+
const handle = pane && this.keyHandle(e, pane);
|
|
588
|
+
if (handle && !handle.hasAttribute("aria-description")) {
|
|
589
|
+
handle.setAttribute("aria-description", this.i18n.t("sortableInstructions"));
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
onPaneFocusOut = (e) => {
|
|
593
|
+
const d = this.drag;
|
|
594
|
+
if (!d?.keyboard)
|
|
595
|
+
return;
|
|
596
|
+
const to = e.relatedTarget;
|
|
597
|
+
if (!to || !d.pane.contains(to))
|
|
598
|
+
this.endDrag(false);
|
|
599
|
+
};
|
|
600
|
+
onPaneKey = (e) => {
|
|
601
|
+
const d = this.drag;
|
|
602
|
+
if (!d) {
|
|
603
|
+
if (e.key !== " " && e.key !== "Enter" || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)
|
|
604
|
+
return;
|
|
605
|
+
const pane = this.paneOf(e);
|
|
606
|
+
const handle = pane && this.keyHandle(e, pane);
|
|
607
|
+
if (!pane || !handle || this.zoomedPane || this.shown.length < 2)
|
|
608
|
+
return;
|
|
609
|
+
e.preventDefault();
|
|
610
|
+
e.stopPropagation();
|
|
611
|
+
const from = this.shown.indexOf(pane);
|
|
612
|
+
this.drag = {
|
|
613
|
+
keyboard: true,
|
|
614
|
+
pane,
|
|
615
|
+
handle,
|
|
616
|
+
from,
|
|
617
|
+
to: from,
|
|
618
|
+
started: true,
|
|
619
|
+
id: -1,
|
|
620
|
+
x0: 0,
|
|
621
|
+
y0: 0,
|
|
622
|
+
x: 0,
|
|
623
|
+
y: 0,
|
|
624
|
+
offX: 0,
|
|
625
|
+
offY: 0,
|
|
626
|
+
raf: 0,
|
|
627
|
+
rects: null,
|
|
628
|
+
box: null,
|
|
629
|
+
outside: false
|
|
630
|
+
};
|
|
631
|
+
this.cellOf(from)?.classList.add("dragging");
|
|
632
|
+
this.say("sortablePickedUp", this.drag, from);
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
if (!d.keyboard)
|
|
636
|
+
return;
|
|
637
|
+
const last = this.shown.length - 1;
|
|
638
|
+
const rtl = this.matches(":dir(rtl)");
|
|
639
|
+
let to = d.to;
|
|
640
|
+
switch (e.key) {
|
|
641
|
+
case " ":
|
|
642
|
+
case "Enter":
|
|
643
|
+
e.preventDefault();
|
|
644
|
+
e.stopPropagation();
|
|
645
|
+
this.endDrag(true);
|
|
646
|
+
return;
|
|
647
|
+
case "Escape":
|
|
648
|
+
e.preventDefault();
|
|
649
|
+
e.stopPropagation();
|
|
650
|
+
this.endDrag(false);
|
|
651
|
+
return;
|
|
652
|
+
case "Tab":
|
|
653
|
+
this.endDrag(false);
|
|
654
|
+
return;
|
|
655
|
+
case (rtl ? "ArrowRight" : "ArrowLeft"):
|
|
656
|
+
to = Math.max(0, to - 1);
|
|
657
|
+
break;
|
|
658
|
+
case (rtl ? "ArrowLeft" : "ArrowRight"):
|
|
659
|
+
to = Math.min(last, to + 1);
|
|
660
|
+
break;
|
|
661
|
+
case "ArrowUp":
|
|
662
|
+
to = this.vertical(to, -1);
|
|
663
|
+
break;
|
|
664
|
+
case "ArrowDown":
|
|
665
|
+
to = this.vertical(to, 1);
|
|
666
|
+
break;
|
|
667
|
+
case "Home":
|
|
668
|
+
to = 0;
|
|
669
|
+
break;
|
|
670
|
+
case "End":
|
|
671
|
+
to = last;
|
|
672
|
+
break;
|
|
673
|
+
default:
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
e.preventDefault();
|
|
677
|
+
e.stopPropagation();
|
|
678
|
+
if (to === d.to)
|
|
679
|
+
return;
|
|
680
|
+
this.setTarget(d, to);
|
|
681
|
+
this.cellOf(to)?.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
682
|
+
this.say("sortableMoved", d, to);
|
|
683
|
+
};
|
|
684
|
+
/** The pane above (-1) or below (1) the one at index `at`: the nearest by the middle of its column. */
|
|
685
|
+
vertical(at2, dir) {
|
|
686
|
+
const boxes = [...this.renderRoot.querySelectorAll(".cell")].map((c) => c.getBoundingClientRect());
|
|
687
|
+
const from = boxes[at2];
|
|
688
|
+
if (!from)
|
|
689
|
+
return at2;
|
|
690
|
+
const mid = from.left + from.width / 2;
|
|
691
|
+
let best = at2;
|
|
692
|
+
let score = Infinity;
|
|
693
|
+
boxes.forEach((b, i) => {
|
|
694
|
+
if (i === at2 || b.width === 0)
|
|
695
|
+
return;
|
|
696
|
+
const ahead = dir < 0 ? b.bottom <= from.top + 1 : b.top >= from.bottom - 1;
|
|
697
|
+
if (!ahead)
|
|
698
|
+
return;
|
|
699
|
+
const dist = Math.abs(dir < 0 ? from.top - b.bottom : b.top - from.bottom) * 4 + Math.abs(b.left + b.width / 2 - mid);
|
|
700
|
+
if (dist < score) {
|
|
701
|
+
score = dist;
|
|
702
|
+
best = i;
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
return best;
|
|
706
|
+
}
|
|
308
707
|
emitSizes(type) {
|
|
309
708
|
emitDetail(this, type, { sizes: [...this.fr], rowSizes: [...this.rfr] });
|
|
310
709
|
}
|
|
@@ -500,8 +899,32 @@ class BkSplitGrid extends LitElement {
|
|
|
500
899
|
@media (hover: hover) { .divider:hover::after { background: var(--bk-split-grid-divider-color, var(--bk-line-hover)); } }
|
|
501
900
|
.divider.active::after, .divider:focus-visible::after { background: var(--bk-split-grid-divider-active, var(--bk-accent-solid)); }
|
|
502
901
|
@media (prefers-reduced-motion: reduce) { .divider::after { transition: none; } }
|
|
902
|
+
|
|
903
|
+
/* Moving a pane: the lifted pane, the drop mark and the ghost that follows the pointer. */
|
|
904
|
+
:host([dragging]) { user-select: none; -webkit-user-select: none; }
|
|
905
|
+
.cell.dragging { opacity: var(--bk-split-grid-drag-opacity, 0.45); }
|
|
906
|
+
.cell.target {
|
|
907
|
+
outline: var(--bk-split-grid-drop-width, var(--bk-focus-width)) solid var(--bk-split-grid-drop-color, var(--bk-accent-solid));
|
|
908
|
+
outline-offset: var(--bk-focus-offset);
|
|
909
|
+
border-radius: var(--bk-split-grid-drop-radius, var(--bk-radius-container, var(--bk-radius-lg)));
|
|
910
|
+
}
|
|
911
|
+
.ghost {
|
|
912
|
+
position: fixed; inset: 0 auto auto 0; margin: 0; pointer-events: none;
|
|
913
|
+
max-inline-size: var(--bk-split-grid-ghost-max-width, var(--bk-measure-display));
|
|
914
|
+
align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
|
|
915
|
+
padding: 0 var(--bk-split-grid-ghost-padding, var(--bk-space-3));
|
|
916
|
+
color: var(--bk-split-grid-ghost-color, var(--bk-text)); font: inherit; font-size: var(--bk-type-small); font-weight: var(--bk-weight-medium);
|
|
917
|
+
line-height: var(--bk-line-height-body);
|
|
918
|
+
background: var(--bk-split-grid-ghost-bg, var(--bk-layer-overlay-bg));
|
|
919
|
+
border: var(--bk-border-width) solid var(--bk-split-grid-ghost-border, var(--bk-layer-overlay-border));
|
|
920
|
+
border-radius: var(--bk-split-grid-ghost-radius, var(--bk-radius-md));
|
|
921
|
+
box-shadow: var(--bk-split-grid-ghost-shadow, var(--bk-layer-overlay-shadow), var(--bk-ring-focus));
|
|
922
|
+
cursor: var(--bk-split-grid-dragging-cursor, grabbing);
|
|
923
|
+
}
|
|
924
|
+
.ghost:popover-open { display: flex; }
|
|
503
925
|
@media (forced-colors: active) {
|
|
504
926
|
.divider.active::after, .divider:focus-visible::after { background: Highlight; }
|
|
927
|
+
.cell.target { outline-color: Highlight; }
|
|
505
928
|
}
|
|
506
929
|
`];
|
|
507
930
|
render() {
|
|
@@ -527,7 +950,7 @@ class BkSplitGrid extends LitElement {
|
|
|
527
950
|
const roomOf = (axis) => Math.max(1, (axis === "col" ? this.width : this.gridHeight) - this.gapPx * ((axis === "col" ? n : r) - 1));
|
|
528
951
|
const startOf = (across, k, count) => k === 0 ? "0" : trackStart(across, k, count);
|
|
529
952
|
const endOf = (across, k, count) => k === across.length - 1 && count === across.length ? "0" : `calc(100% - ${trackEnd(across, k, count)})`;
|
|
530
|
-
return html`<div class="scroller" part="scroller" role=${this.scrolling ? "region" : nothing} tabindex=${this.scrolling ? "0" : nothing}
|
|
953
|
+
return html`<div class="scroller" part="scroller" @scroll=${this.onDragScroll} role=${this.scrolling ? "region" : nothing} tabindex=${this.scrolling ? "0" : nothing}
|
|
531
954
|
aria-label=${this.scrolling ? this.label || this.i18n.t("content") : nothing}><div class="grid ${stacked ? "stacked" : ""}" style=${styleMap({ gridTemplateColumns: columns, minWidth, minHeight, ...rows, ...template })}>
|
|
532
955
|
${repeat(panes, (t) => t, (t, i) => html`<div class="cell" part="cell" style=${styleMap({ gridArea: areas ? letters[i] : void 0 })} ?hidden=${!!zoom && zoom !== t}><slot></slot></div>`)}
|
|
533
956
|
${this.segments().map(({ axis, index: i, from, to }) => {
|
|
@@ -540,7 +963,7 @@ class BkSplitGrid extends LitElement {
|
|
|
540
963
|
data-axis=${axis} data-index=${i} style=${styleMap(style)}
|
|
541
964
|
@pointerdown=${this.onDividerDown} @keydown=${this.onDividerKey} @dblclick=${this.onDividerReset}><span class="bk-grip" aria-hidden="true"></span></div>`;
|
|
542
965
|
})}
|
|
543
|
-
</div></div>`;
|
|
966
|
+
</div></div><div class="ghost" part="ghost" popover="manual" aria-hidden="true"></div>`;
|
|
544
967
|
}
|
|
545
968
|
}
|
|
546
969
|
define("bk-split-grid", BkSplitGrid);
|
|
@@ -2,6 +2,9 @@ import { LitElement, css, html, nothing } from "lit";
|
|
|
2
2
|
import { define } from "../internal/define.js";
|
|
3
3
|
import { emitDetail } from "../internal/events.js";
|
|
4
4
|
import { handleMenu, handleMenuStyles, openHandleMenu } from "../internal/handle-menu.js";
|
|
5
|
+
import "./bk-menu-context.js";
|
|
6
|
+
import "./bk-menu-divider.js";
|
|
7
|
+
import "./bk-menu-item.js";
|
|
5
8
|
import { LocalizeController } from "../i18n.js";
|
|
6
9
|
import { deepActiveElement } from "../internal/anchor.js";
|
|
7
10
|
import { StateController } from "../internal/state.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, css, html } from "lit";
|
|
2
2
|
import { define } from "../internal/define.js";
|
|
3
|
+
import { setHostVars } from "../internal/host-vars.js";
|
|
3
4
|
import { base } from "../internal/styles.js";
|
|
4
5
|
class BkStatGroup extends LitElement {
|
|
5
6
|
static properties = {
|
|
@@ -41,7 +42,7 @@ class BkStatGroup extends LitElement {
|
|
|
41
42
|
`];
|
|
42
43
|
willUpdate(changed) {
|
|
43
44
|
if (changed.has("min"))
|
|
44
|
-
this
|
|
45
|
+
setHostVars(this, { "--_bk-stat-group-min": this.min || "" });
|
|
45
46
|
}
|
|
46
47
|
render() {
|
|
47
48
|
return html`<div class="row" part="row"><slot></slot></div>`;
|
|
@@ -15,6 +15,11 @@ import "../icons/set/trending-up.js";
|
|
|
15
15
|
* delta-label="vs September"><bk-chart-sparkline slot="chart" label="Monthly active users" .values=${trend}></bk-chart-sparkline></bk-stat>
|
|
16
16
|
* ```
|
|
17
17
|
*
|
|
18
|
+
* `value-text` shows ready text instead of the formatted `value`, for a figure that the app has already formatted
|
|
19
|
+
* ("345.867"). A plain numeric string in `value` is still a number, and the stat formats it. `delta-text` does the same
|
|
20
|
+
* for the change. The text is shown as it is, and screen readers read it. `value` and `delta` still give the number,
|
|
21
|
+
* the direction and the tone.
|
|
22
|
+
*
|
|
18
23
|
* The colour of the delta shows whether the change is good. Up is good by default. Set `inverted` for
|
|
19
24
|
* measures where down is good (costs, latency, error rate). Status colours show that meaning only
|
|
20
25
|
* here, always with the icon and a word for screen readers, never with colour alone. `variant="chip"`
|
|
@@ -37,6 +42,8 @@ import "../icons/set/trending-up.js";
|
|
|
37
42
|
* @tag bk-stat
|
|
38
43
|
* @slot - Note under the value (instead of `note`).
|
|
39
44
|
* @slot start - A visual before the figures (an icon tile).
|
|
45
|
+
* @slot label - Rich label instead of the `label` attribute, for example with a footnote marker.
|
|
46
|
+
* @slot value - Rich value instead of the formatted `value`, for example "up to 155 €" with a footnote marker. `value` still gives the number.
|
|
40
47
|
* @slot chart - A sparkline or meter under the figures.
|
|
41
48
|
* @csspart start - The box around the `start` slot.
|
|
42
49
|
* @csspart label - The label.
|
|
@@ -66,6 +73,9 @@ export declare class BkStat extends LitElement {
|
|
|
66
73
|
static properties: {
|
|
67
74
|
label: {};
|
|
68
75
|
value: {};
|
|
76
|
+
valueText: {
|
|
77
|
+
attribute: string;
|
|
78
|
+
};
|
|
69
79
|
unit: {};
|
|
70
80
|
valueFormat: {
|
|
71
81
|
attribute: string;
|
|
@@ -86,6 +96,9 @@ export declare class BkStat extends LitElement {
|
|
|
86
96
|
attribute: string;
|
|
87
97
|
type: ObjectConstructor;
|
|
88
98
|
};
|
|
99
|
+
deltaText: {
|
|
100
|
+
attribute: string;
|
|
101
|
+
};
|
|
89
102
|
deltaLabel: {
|
|
90
103
|
attribute: string;
|
|
91
104
|
};
|
|
@@ -110,6 +123,8 @@ export declare class BkStat extends LitElement {
|
|
|
110
123
|
label: string;
|
|
111
124
|
/** The value: a number (formatted in full in the locale) or ready text. */
|
|
112
125
|
value: number | string | undefined;
|
|
126
|
+
/** Ready text for the value, shown as it is instead of the formatted `value` (like `aria-valuetext`). Use it for a figure that the app has formatted. */
|
|
127
|
+
valueText: string | undefined;
|
|
113
128
|
/** Unit after the value ("ms", "GB"); for currencies and percent use `value-format`. */
|
|
114
129
|
unit: string | undefined;
|
|
115
130
|
/** Intl.NumberFormat options for the value (`{"minimumFractionDigits":2}` shows 13.10). */
|
|
@@ -122,6 +137,8 @@ export declare class BkStat extends LitElement {
|
|
|
122
137
|
delta: number | undefined;
|
|
123
138
|
/** Intl.NumberFormat options for the delta (`{"style":"percent"}` reads 0.084 as +8.4 %). */
|
|
124
139
|
deltaFormat: Intl.NumberFormatOptions | undefined;
|
|
140
|
+
/** Ready text for the change, shown as it is instead of the formatted `delta`. The sign of `delta` still sets the direction and the tone. */
|
|
141
|
+
deltaText: string | undefined;
|
|
125
142
|
/** The comparison period ("vs last month"). */
|
|
126
143
|
deltaLabel: string | undefined;
|
|
127
144
|
/** Down is good (costs, latency, error rate). */
|
|
@@ -14,12 +14,14 @@ class BkStat extends LitElement {
|
|
|
14
14
|
static properties = {
|
|
15
15
|
label: {},
|
|
16
16
|
value: {},
|
|
17
|
+
valueText: { attribute: "value-text" },
|
|
17
18
|
unit: {},
|
|
18
19
|
valueFormat: { attribute: "value-format", type: Object },
|
|
19
20
|
notation: { reflect: true, useDefault: true },
|
|
20
21
|
variant: { reflect: true, useDefault: true },
|
|
21
22
|
delta: { type: Number },
|
|
22
23
|
deltaFormat: { attribute: "delta-format", type: Object },
|
|
24
|
+
deltaText: { attribute: "delta-text" },
|
|
23
25
|
deltaLabel: { attribute: "delta-label" },
|
|
24
26
|
inverted: { type: Boolean, reflect: true },
|
|
25
27
|
note: {},
|
|
@@ -85,6 +87,8 @@ class BkStat extends LitElement {
|
|
|
85
87
|
.chart { align-self: stretch; margin-block-start: auto; padding-block-start: var(--bk-space-1); min-width: 0; }
|
|
86
88
|
`];
|
|
87
89
|
formattedValue() {
|
|
90
|
+
if (this.valueText)
|
|
91
|
+
return this.valueText;
|
|
88
92
|
const v = this.value;
|
|
89
93
|
if (v === void 0 || v === null || v === "")
|
|
90
94
|
return "\u2013";
|
|
@@ -100,7 +104,7 @@ class BkStat extends LitElement {
|
|
|
100
104
|
const locale = this.i18n.locale;
|
|
101
105
|
const dir = deltaDirection(d);
|
|
102
106
|
const tone = deltaTone(dir, this.inverted);
|
|
103
|
-
const text = formatDelta(locale, d, this.deltaFormat);
|
|
107
|
+
const text = this.deltaText || formatDelta(locale, d, this.deltaFormat);
|
|
104
108
|
const word = chartT(locale, dir === "up" ? "statUp" : dir === "down" ? "statDown" : "statFlat");
|
|
105
109
|
const icon = dir === "up" ? "trending-up" : "trending-down";
|
|
106
110
|
return html`<div class="delta" part="delta">
|
|
@@ -110,8 +114,8 @@ class BkStat extends LitElement {
|
|
|
110
114
|
}
|
|
111
115
|
render() {
|
|
112
116
|
const hasNote = !!this.note || this.slots.has("");
|
|
113
|
-
const label = html`<span class="label" part="label">${this.label}</span>`;
|
|
114
|
-
const figure = html`<span class="figure"><span class="value" part="value">${this.formattedValue()}</span>${this.unit ? html`<span class="unit" part="unit">${this.unit}</span>` : nothing}</span>`;
|
|
117
|
+
const label = html`<span class="label" part="label"><slot name="label">${this.label}</slot></span>`;
|
|
118
|
+
const figure = html`<span class="figure"><span class="value" part="value"><slot name="value">${this.formattedValue()}</slot></span>${this.unit ? html`<span class="unit" part="unit">${this.unit}</span>` : nothing}</span>`;
|
|
115
119
|
const delta = this.renderDelta();
|
|
116
120
|
const rows = this.order === "value-first" ? [figure, label, delta] : this.order === "delta-first" ? [delta, figure, label] : [label, figure, delta];
|
|
117
121
|
return html`<div class="root">
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, css, html } from "lit";
|
|
2
2
|
import { define } from "../internal/define.js";
|
|
3
|
+
import { setHostVars } from "../internal/host-vars.js";
|
|
3
4
|
import { base } from "../internal/styles.js";
|
|
4
5
|
import "./bk-steps-item.js";
|
|
5
6
|
class BkSteps extends LitElement {
|
|
@@ -42,7 +43,7 @@ class BkSteps extends LitElement {
|
|
|
42
43
|
count++;
|
|
43
44
|
el.requestUpdate();
|
|
44
45
|
}
|
|
45
|
-
this
|
|
46
|
+
setHostVars(this, { "--_bk-steps-count": String(Math.max(count, 1)) });
|
|
46
47
|
}
|
|
47
48
|
render() {
|
|
48
49
|
return html`<div class="list" part="base"><slot @slotchange=${this.refreshSteps}></slot></div>`;
|
|
@@ -78,6 +78,8 @@ export declare class BkSurface extends LitElement {
|
|
|
78
78
|
selected: boolean;
|
|
79
79
|
/** Tints the surface: soft background and tone border. Unset (default): no tint. */
|
|
80
80
|
tone: "neutral" | "accent" | "info" | "success" | "warning" | "danger" | "attention" | undefined;
|
|
81
|
+
/** The state `bk-scope` of a layered surface. */
|
|
82
|
+
private internals;
|
|
81
83
|
constructor();
|
|
82
84
|
static styles: import("lit").CSSResult[];
|
|
83
85
|
protected willUpdate(changed: PropertyValues<this>): void;
|