@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
|
@@ -6,15 +6,18 @@ import { define } from "../internal/define.js";
|
|
|
6
6
|
import { LinkController } from "../internal/link.js";
|
|
7
7
|
import { LocalizeController } from "../i18n.js";
|
|
8
8
|
import { emitDetail, emitLifecycle } from "../internal/events.js";
|
|
9
|
-
import { handleMenu, handleMenuStyles, openHandleMenu } from "../internal/handle-menu.js";
|
|
9
|
+
import { handleMenu, handleMenuStyles, loadHandleMenu, openHandleMenu } from "../internal/handle-menu.js";
|
|
10
10
|
import { StateController } from "../internal/state.js";
|
|
11
11
|
import { onShortcut, registerShortcuts } from "../shortcuts.js";
|
|
12
12
|
import { base, countBadge, grip, interactive } from "../internal/styles.js";
|
|
13
|
-
import "
|
|
13
|
+
import { LateLoad } from "../internal/late.js";
|
|
14
|
+
import { lateParts } from "#bk/internal/late/bk-shell-app.js";
|
|
14
15
|
import "./bk-icon.js";
|
|
15
16
|
import "./bk-button.js";
|
|
16
17
|
import "./bk-nav-item.js";
|
|
17
18
|
import { mutationObserver, lightDom } from "../internal/server.js";
|
|
19
|
+
const drawerParts = new LateLoad(lateParts, "bk-drawer");
|
|
20
|
+
import { ownText } from "../internal/own-text.js";
|
|
18
21
|
import "../icons/set/close.js";
|
|
19
22
|
import "../icons/set/menu.js";
|
|
20
23
|
import "../icons/set/search.js";
|
|
@@ -73,7 +76,7 @@ class BkShellApp extends LitElement {
|
|
|
73
76
|
get sections() {
|
|
74
77
|
return this.internals.states.has("sections");
|
|
75
78
|
}
|
|
76
|
-
/** Custom states (narrow, aside-overlay, workspace, nav-center, flat-sidebar, sections): the host keeps only the attributes of the app. */
|
|
79
|
+
/** Custom states (narrow, aside-overlay, workspace, nav-center, flat-sidebar, sections, flow): the host keeps only the attributes of the app. */
|
|
77
80
|
internals = this.attachInternals();
|
|
78
81
|
/** Where the last press on the aside edge started: a click that moved is the end of a drag. */
|
|
79
82
|
pressAt = { x: 0, y: 0 };
|
|
@@ -102,6 +105,8 @@ class BkShellApp extends LitElement {
|
|
|
102
105
|
draggingAside = false;
|
|
103
106
|
resizeObserver;
|
|
104
107
|
children$ = mutationObserver(() => this.requestUpdate());
|
|
108
|
+
/** The attributes of the direct children: `slot` moves a child to another region; `mode` of a `<bk-columns>` makes the shell a page or a workspace. */
|
|
109
|
+
childAttrs$ = mutationObserver(() => this.requestUpdate());
|
|
105
110
|
/** Elements with `data-aside-toggle` / `data-sidebar-toggle` we put ARIA on. */
|
|
106
111
|
asideTriggers = [];
|
|
107
112
|
sidebarTriggers = [];
|
|
@@ -148,7 +153,7 @@ class BkShellApp extends LitElement {
|
|
|
148
153
|
};
|
|
149
154
|
connectedCallback() {
|
|
150
155
|
super.connectedCallback();
|
|
151
|
-
this.children$.observe(this, { childList: true
|
|
156
|
+
this.children$.observe(this, { childList: true });
|
|
152
157
|
if (typeof ResizeObserver !== "undefined") {
|
|
153
158
|
this.resizeObserver ??= new ResizeObserver(this.onResize);
|
|
154
159
|
this.resizeObserver.observe(this);
|
|
@@ -164,6 +169,7 @@ class BkShellApp extends LitElement {
|
|
|
164
169
|
disconnectedCallback() {
|
|
165
170
|
super.disconnectedCallback();
|
|
166
171
|
this.children$.disconnect();
|
|
172
|
+
this.childAttrs$.disconnect();
|
|
167
173
|
this.headerContent.disconnect();
|
|
168
174
|
this.watched = [];
|
|
169
175
|
this.bottomItems.disconnect();
|
|
@@ -300,8 +306,6 @@ class BkShellApp extends LitElement {
|
|
|
300
306
|
display: flex; align-items: center; height: calc(var(--_bk-shell-app-nav-row) - var(--bk-border-width));
|
|
301
307
|
max-width: var(--bk-app-frame-width); margin-inline: auto;
|
|
302
308
|
--_bk-shell-header-pad: var(--_bk-shell-app-pad);
|
|
303
|
-
/* The underline of the current item stays on the line of the header, also in a row of another height (--bk-height-header-nav). */
|
|
304
|
-
--_bk-nav-indicator-offset: calc(var(--bk-space-3) + (var(--_bk-shell-app-nav-row) - var(--_bk-shell-app-header-height)) / 2);
|
|
305
309
|
}
|
|
306
310
|
.nav-row.page-width { --_bk-shell-header-pad: max(var(--_bk-shell-app-pad), calc((100% - var(--bk-app-header-width, 100%)) / 2)); }
|
|
307
311
|
.nav-row ::slotted(*) { -webkit-app-region: no-drag; app-region: no-drag; }
|
|
@@ -340,9 +344,18 @@ class BkShellApp extends LitElement {
|
|
|
340
344
|
its width: the header measures what does not fit and moves the nav into the drawer, before a brand is cut. */
|
|
341
345
|
.header.has-nav .header-start { flex: 0 1 auto; }
|
|
342
346
|
.header.has-nav .header-start ::slotted(:not(bk-input-search, bk-input-text[type="search"], bk-combobox[type="search"], [data-header-search])) { flex-shrink: 0; }
|
|
343
|
-
.nav {
|
|
347
|
+
.nav {
|
|
348
|
+
display: flex; align-items: center; flex: 1 0 auto; min-width: 0; margin-inline-start: var(--_bk-shell-app-nav-offset);
|
|
349
|
+
/* In the header row: the line under the current item ends on the bottom edge of the header. */
|
|
350
|
+
--_bk-nav-indicator-offset: calc((var(--_bk-shell-app-hh) - var(--bk-border-width) - var(--bk-nav-horizontal-item-height, var(--bk-control-md))) / 2 + var(--bk-border-width));
|
|
351
|
+
}
|
|
344
352
|
/* The first label of the row stands on the edge of the brand: the row gives back the inner padding of the items. */
|
|
345
|
-
.nav-row .nav {
|
|
353
|
+
.nav-row .nav {
|
|
354
|
+
flex: 1 1 auto; margin-inline-start: calc(-1 * var(--bk-nav-horizontal-item-padding, var(--bk-space-3)));
|
|
355
|
+
/* The line under the current item ends on the bottom edge of the header: half the free room of the row
|
|
356
|
+
(without the border) below the item, plus the border. */
|
|
357
|
+
--_bk-nav-indicator-offset: calc((var(--_bk-shell-app-nav-row) - var(--bk-border-width) - var(--bk-nav-horizontal-item-height, var(--bk-control-md))) / 2 + var(--bk-border-width));
|
|
358
|
+
}
|
|
346
359
|
/* --bk-app-nav-align: center (the state nav-center): the outer regions have the same width, so the nav stands in the middle. */
|
|
347
360
|
:host(:state(nav-center)) .header.has-nav .header-start, :host(:state(nav-center)) .header.has-nav .header-end { flex: 1 1 0; min-width: 0; }
|
|
348
361
|
:host(:state(nav-center)) .header.has-nav .header-end { justify-content: flex-end; }
|
|
@@ -441,6 +454,9 @@ class BkShellApp extends LitElement {
|
|
|
441
454
|
/* A page of sections: each section runs edge to edge and holds its content in its width, with the
|
|
442
455
|
page padding beside it (like the footer). <main> adds no padding and no page width. */
|
|
443
456
|
:host(:state(sections)) main { padding: 0; }
|
|
457
|
+
/* Columns that flow in the document have their own padding: <main> adds no padding and no page width. */
|
|
458
|
+
:host(:state(flow)) main { padding: 0; }
|
|
459
|
+
:host(:state(flow)) .main-inner { max-width: none; }
|
|
444
460
|
:host(:state(sections)) .main-inner { max-width: none; }
|
|
445
461
|
:host(:state(sections)) .main-inner ::slotted(bk-page-section) { --bk-page-section-padding-inline: max(var(--_bk-shell-app-main-inline), var(--bk-safe-start), var(--bk-safe-end)); }
|
|
446
462
|
:host(:state(sections)) .main-inner ::slotted(bk-page-hero) { --bk-page-hero-padding-inline: max(var(--_bk-shell-app-main-inline), var(--bk-safe-start), var(--bk-safe-end)); }
|
|
@@ -522,6 +538,8 @@ class BkShellApp extends LitElement {
|
|
|
522
538
|
}
|
|
523
539
|
|
|
524
540
|
/* Drawers: bk-drawer gives surface, motion and modality; here they have square corners and a line only towards the page. */
|
|
541
|
+
/* A drawer loads late (narrow shell, aside overlay): until then its content stays out of view. */
|
|
542
|
+
bk-drawer:not(:defined) { display: none; }
|
|
525
543
|
bk-drawer { --bk-drawer-radius: 0px; --bk-drawer-size: min(var(--_bk-shell-app-drawer-width), calc(100vw - var(--bk-space-12))); }
|
|
526
544
|
bk-drawer.end { --bk-drawer-size: min(var(--_bk-shell-app-aw), calc(100vw - var(--bk-space-12))); }
|
|
527
545
|
bk-drawer::part(dialog) { border-width: 0; }
|
|
@@ -905,19 +923,29 @@ class BkShellApp extends LitElement {
|
|
|
905
923
|
const open = region === "sidebar" ? !this.sidebarCollapsed : this.asideVisible;
|
|
906
924
|
this.dispatchEvent(new ShellAppToggleEvent(region, open));
|
|
907
925
|
}
|
|
926
|
+
/** The drawers are in use: the shell is narrow, or the aside is an overlay. */
|
|
927
|
+
get drawers() {
|
|
928
|
+
return this.narrow || this.asideOverlay;
|
|
929
|
+
}
|
|
908
930
|
willUpdate(changed) {
|
|
909
931
|
super.willUpdate(changed);
|
|
932
|
+
if (this.drawers)
|
|
933
|
+
void drawerParts.start();
|
|
910
934
|
const used = /* @__PURE__ */ new Set();
|
|
911
935
|
let workspace = false;
|
|
936
|
+
let flow = false;
|
|
912
937
|
let sectionCount = 0;
|
|
913
938
|
let other = false;
|
|
914
939
|
for (const node of lightDom(this)?.childNodes ?? []) {
|
|
915
940
|
if (node instanceof Element) {
|
|
941
|
+
this.childAttrs$.observe(node, { attributes: true, attributeFilter: ["slot", "mode"] });
|
|
916
942
|
const slot = node.getAttribute("slot") || "default";
|
|
917
943
|
used.add(slot);
|
|
918
944
|
if (slot !== "default" || NOT_CONTENT.has(node.localName))
|
|
919
945
|
continue;
|
|
920
|
-
if (
|
|
946
|
+
if (node.localName === "bk-columns" && !["split", "stack"].includes(node.getAttribute("mode") ?? ""))
|
|
947
|
+
flow = true;
|
|
948
|
+
else if (FILLING.has(node.localName))
|
|
921
949
|
workspace = true;
|
|
922
950
|
if (BANDS.has(node.localName))
|
|
923
951
|
sectionCount++;
|
|
@@ -932,6 +960,7 @@ class BkShellApp extends LitElement {
|
|
|
932
960
|
if (workspace !== this.workspace)
|
|
933
961
|
this.workspace = workspace;
|
|
934
962
|
this.setState("sections", !workspace && !other && sectionCount > 0);
|
|
963
|
+
this.setState("flow", !workspace && flow);
|
|
935
964
|
if (changed.has("breakpoint") || changed.has("asideBreakpoint"))
|
|
936
965
|
this.applyWidth();
|
|
937
966
|
if (!this.narrow && this.navigationOpen)
|
|
@@ -1013,9 +1042,13 @@ class BkShellApp extends LitElement {
|
|
|
1013
1042
|
el.hidden = this.narrow && this.slotOf(el) === "sidebar-footer";
|
|
1014
1043
|
}
|
|
1015
1044
|
}
|
|
1016
|
-
/** `updateComplete` includes the drawers
|
|
1045
|
+
/** `updateComplete` includes the drawers (their load and their own update that opens and closes them) and the load of the handle menu. */
|
|
1017
1046
|
async getUpdateComplete() {
|
|
1018
1047
|
const done = await super.getUpdateComplete();
|
|
1048
|
+
if (this.drawers)
|
|
1049
|
+
await drawerParts.start();
|
|
1050
|
+
if (this.asideMoves.length)
|
|
1051
|
+
await loadHandleMenu();
|
|
1019
1052
|
await Promise.all([...this.renderRoot.querySelectorAll("bk-drawer")].map((d) => d.updateComplete));
|
|
1020
1053
|
return done;
|
|
1021
1054
|
}
|
|
@@ -1104,7 +1137,7 @@ class BkShellApp extends LitElement {
|
|
|
1104
1137
|
continue;
|
|
1105
1138
|
const items = child.matches("bk-nav-item") ? [child] : [...child.querySelectorAll("bk-nav-item:not(bk-nav-group bk-nav-item)")];
|
|
1106
1139
|
for (const el of items) {
|
|
1107
|
-
const label =
|
|
1140
|
+
const label = ownText(el).replace(/\s+/g, " ").trim();
|
|
1108
1141
|
if (label)
|
|
1109
1142
|
out.push({ el, label, icon: el.icon, href: el.href, target: el.target, rel: el.rel, count: el.count, current: el.current, disabled: el.disabled });
|
|
1110
1143
|
}
|
|
@@ -1149,6 +1182,9 @@ class BkShellApp extends LitElement {
|
|
|
1149
1182
|
part.collapsed = rail && SIDEBAR_SLOTS.includes(slot);
|
|
1150
1183
|
}
|
|
1151
1184
|
}
|
|
1185
|
+
for (const child of this.children)
|
|
1186
|
+
if (child.localName === "bk-columns" && !child.slot)
|
|
1187
|
+
child.narrow = this.narrow;
|
|
1152
1188
|
}
|
|
1153
1189
|
/** ARIA for the elements with `attr`; the method cleans up ones that lost the attribute. Returns the current set. */
|
|
1154
1190
|
syncTriggers(attr, known, aria) {
|
|
@@ -45,9 +45,10 @@ export declare class BkShellSites extends LitElement {
|
|
|
45
45
|
/** Landmark name (default: i18n `sites`). */
|
|
46
46
|
label: string;
|
|
47
47
|
private i18n;
|
|
48
|
+
/** The state `bk-scope`: the scope block of the tokens derives the dark colours inside the row (see :host). */
|
|
49
|
+
private internals;
|
|
48
50
|
constructor();
|
|
49
51
|
static styles: import("lit").CSSResult[];
|
|
50
|
-
connectedCallback(): void;
|
|
51
52
|
render(): import("lit-html").TemplateResult<1>;
|
|
52
53
|
}
|
|
53
54
|
declare global {
|
|
@@ -5,9 +5,12 @@ import { base } from "../internal/styles.js";
|
|
|
5
5
|
class BkShellSites extends LitElement {
|
|
6
6
|
static properties = { label: {} };
|
|
7
7
|
i18n = new LocalizeController(this);
|
|
8
|
+
/** The state `bk-scope`: the scope block of the tokens derives the dark colours inside the row (see :host). */
|
|
9
|
+
internals = this.attachInternals();
|
|
8
10
|
constructor() {
|
|
9
11
|
super();
|
|
10
12
|
this.label = "";
|
|
13
|
+
this.internals.states.add("bk-scope");
|
|
11
14
|
}
|
|
12
15
|
static styles = [base, css`
|
|
13
16
|
/* The row is a dark scope: the scope block derives the colours of the dark ink page inside it. */
|
|
@@ -51,11 +54,6 @@ class BkShellSites extends LitElement {
|
|
|
51
54
|
::slotted(a[aria-current]:not([aria-current="false"])) { text-decoration: underline; }
|
|
52
55
|
}
|
|
53
56
|
`];
|
|
54
|
-
connectedCallback() {
|
|
55
|
-
super.connectedCallback();
|
|
56
|
-
if (!this.hasAttribute("data-bk-scope"))
|
|
57
|
-
this.setAttribute("data-bk-scope", "");
|
|
58
|
-
}
|
|
59
57
|
render() {
|
|
60
58
|
return html`<nav part="base" aria-label=${this.label || this.i18n.t("sites")}>
|
|
61
59
|
<div class="row" part="row">
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { LitElement, type PropertyValues } from "lit";
|
|
2
2
|
import { LocalizeController } from "../i18n.js";
|
|
3
|
+
import "./bk-menu-context.js";
|
|
4
|
+
import "./bk-menu-divider.js";
|
|
5
|
+
import "./bk-menu-item.js";
|
|
3
6
|
import "../icons/set/grid.js";
|
|
4
7
|
import "../icons/set/keyboard.js";
|
|
5
8
|
/** Detail of the `reorder` event. `to` is the index in `toList` after the move. */
|
|
@@ -2,8 +2,12 @@ import { LitElement, css, html, nothing } from "lit";
|
|
|
2
2
|
import { LocalizeController } from "../i18n.js";
|
|
3
3
|
import { setTriggerAria } from "../internal/anchor.js";
|
|
4
4
|
import { define } from "../internal/define.js";
|
|
5
|
+
import { DRAG_THRESHOLD, EDITABLE, preventEvent, suppressClick } from "../internal/drag.js";
|
|
5
6
|
import { emitDetail } from "../internal/events.js";
|
|
6
7
|
import { handleMenu, handleMenuStyles, openHandleMenu } from "../internal/handle-menu.js";
|
|
8
|
+
import "./bk-menu-context.js";
|
|
9
|
+
import "./bk-menu-divider.js";
|
|
10
|
+
import "./bk-menu-item.js";
|
|
7
11
|
import { adoptLightStyles } from "../internal/light-styles.js";
|
|
8
12
|
import { base, srOnly } from "../internal/styles.js";
|
|
9
13
|
import "../icons/set/grid.js";
|
|
@@ -11,9 +15,7 @@ import "../icons/set/keyboard.js";
|
|
|
11
15
|
let active = null;
|
|
12
16
|
const lists = /* @__PURE__ */ new Set();
|
|
13
17
|
const claimed = /* @__PURE__ */ new WeakSet();
|
|
14
|
-
const EDITABLE = "input, textarea, select, [contenteditable]:not([contenteditable='false'])";
|
|
15
18
|
const FOCUSABLE = "a[href], button, input, select, textarea, [tabindex]";
|
|
16
|
-
const THRESHOLD = 4;
|
|
17
19
|
const TOUCH_SLOP = 8;
|
|
18
20
|
const LONG_PRESS = 300;
|
|
19
21
|
const EDGE = 48;
|
|
@@ -285,8 +287,8 @@ class BkSortable extends LitElement {
|
|
|
285
287
|
if (mode === "pointer") {
|
|
286
288
|
active.scrollers = scrollParents(this);
|
|
287
289
|
getSelection()?.removeAllRanges();
|
|
288
|
-
document.addEventListener("selectstart",
|
|
289
|
-
window.addEventListener("touchmove",
|
|
290
|
+
document.addEventListener("selectstart", preventEvent, true);
|
|
291
|
+
window.addEventListener("touchmove", preventEvent, { passive: false });
|
|
290
292
|
window.addEventListener("keydown", this.onDragKey, true);
|
|
291
293
|
const loop = () => {
|
|
292
294
|
if (!active || active.mode !== "pointer")
|
|
@@ -351,8 +353,8 @@ class BkSortable extends LitElement {
|
|
|
351
353
|
return;
|
|
352
354
|
active = null;
|
|
353
355
|
cancelAnimationFrame(d.raf);
|
|
354
|
-
document.removeEventListener("selectstart",
|
|
355
|
-
window.removeEventListener("touchmove",
|
|
356
|
+
document.removeEventListener("selectstart", preventEvent, true);
|
|
357
|
+
window.removeEventListener("touchmove", preventEvent);
|
|
356
358
|
window.removeEventListener("keydown", this.onDragKey, true);
|
|
357
359
|
d.item.removeAttribute("data-sortable-dragging");
|
|
358
360
|
d.origin.style.removeProperty("--_bk-sortable-x");
|
|
@@ -519,7 +521,7 @@ class BkSortable extends LitElement {
|
|
|
519
521
|
this.clearPending();
|
|
520
522
|
return;
|
|
521
523
|
}
|
|
522
|
-
if (dist <
|
|
524
|
+
if (dist < DRAG_THRESHOLD)
|
|
523
525
|
return;
|
|
524
526
|
this.begin("pointer", p.item, p.x, p.y);
|
|
525
527
|
active.x = e.clientX;
|
|
@@ -533,8 +535,7 @@ class BkSortable extends LitElement {
|
|
|
533
535
|
active.x = e.clientX;
|
|
534
536
|
active.y = e.clientY;
|
|
535
537
|
this.frame(active);
|
|
536
|
-
|
|
537
|
-
setTimeout(() => window.removeEventListener("click", stopClick, true), 0);
|
|
538
|
+
suppressClick();
|
|
538
539
|
}
|
|
539
540
|
this.clearPending();
|
|
540
541
|
if (dragged)
|
|
@@ -723,14 +724,6 @@ class BkSortable extends LitElement {
|
|
|
723
724
|
return html`<slot @slotchange=${() => this.syncItems()}></slot>${this.renderPlaceholder()}${this.renderSortable()}`;
|
|
724
725
|
}
|
|
725
726
|
}
|
|
726
|
-
function prevent(e) {
|
|
727
|
-
e.preventDefault();
|
|
728
|
-
}
|
|
729
|
-
function stopClick(e) {
|
|
730
|
-
e.preventDefault();
|
|
731
|
-
e.stopPropagation();
|
|
732
|
-
window.removeEventListener("click", stopClick, true);
|
|
733
|
-
}
|
|
734
727
|
function scrollParents(el) {
|
|
735
728
|
const out = [];
|
|
736
729
|
let n = el;
|
|
@@ -5,6 +5,29 @@ export interface SplitGridResizeDetail {
|
|
|
5
5
|
/** The row heights as fractions of the available space (adding up to 1); `[1]` for one row. */
|
|
6
6
|
rowSizes: number[];
|
|
7
7
|
}
|
|
8
|
+
/** Detail of the `reorder` event. */
|
|
9
|
+
export interface SplitGridReorderDetail {
|
|
10
|
+
/** The pane that moves. */
|
|
11
|
+
pane: HTMLElement;
|
|
12
|
+
/** Its index in `panes` before the move. */
|
|
13
|
+
from: number;
|
|
14
|
+
/** Its index after the move: it takes the place of the pane that it was dropped on. */
|
|
15
|
+
to: number;
|
|
16
|
+
/** All panes in the new order. */
|
|
17
|
+
order: HTMLElement[];
|
|
18
|
+
}
|
|
19
|
+
/** Detail of the `dropoutside` event. */
|
|
20
|
+
export interface SplitGridDropOutsideDetail {
|
|
21
|
+
/** The pane that the user drags. */
|
|
22
|
+
pane: HTMLElement;
|
|
23
|
+
clientX: number;
|
|
24
|
+
clientY: number;
|
|
25
|
+
}
|
|
26
|
+
/** Detail of the `dragoutside` event. */
|
|
27
|
+
export interface SplitGridDragOutsideDetail extends SplitGridDropOutsideDetail {
|
|
28
|
+
/** True once when the pointer comes back over the grid or the drag ends: remove the hover mark then. */
|
|
29
|
+
inside: boolean;
|
|
30
|
+
}
|
|
8
31
|
declare const parseSizes: (v: string | null) => number[] | undefined;
|
|
9
32
|
/**
|
|
10
33
|
* Split grid: panes of the same rank, side by side in columns and rows that fill the element, as a
|
|
@@ -40,6 +63,24 @@ declare const parseSizes: (v: string | null) => number[] | undefined;
|
|
|
40
63
|
* sizes do not allow that, the panes scroll. Rows are resizable while they share the height
|
|
41
64
|
* (no `rows`, or `rows` equal to the number of rows). `persist-key` saves the sizes in the app
|
|
42
65
|
* state, one entry per layout (`split-grid:<persist-key>:<areas or column count>`, `…:rows:<rows>`).
|
|
66
|
+
* - **Moving panes.** An element with `data-split-grid-handle` in a pane (a header) moves the pane. Drag the
|
|
67
|
+
* handle with the mouse, pen or finger: after 4 px the pane is lifted (`--bk-split-grid-drag-opacity`), a ghost
|
|
68
|
+
* with the name of the pane follows the pointer, and the pane under the pointer shows a drop mark. A press on a
|
|
69
|
+
* control in the handle (a button, a field, a link) does not start a drag, and a click without movement stays a
|
|
70
|
+
* click. The handle has `touch-action: none`: on touch the drag starts at once. Escape cancels.
|
|
71
|
+
* The release over another pane fires the cancelable `reorder` event with `detail`
|
|
72
|
+
* `{ pane, from, to, order }`: the pane takes the place of the pane that it was dropped on, and `order` contains
|
|
73
|
+
* all panes in the new order. The element does not move the nodes. The app changes its order and renders again.
|
|
74
|
+
* The sizes stay: `persist-key` keeps them per layout, not per pane, and a new order does not change the layout.
|
|
75
|
+
* While the pointer is outside the grid, `dragoutside` fires once per frame with `detail`
|
|
76
|
+
* `{ pane, clientX, clientY, inside: false }`. One `dragoutside` with `inside: true` follows when the pointer comes
|
|
77
|
+
* back or the drag ends (drop, Escape). The release outside fires `dropoutside` with `{ pane, clientX, clientY }`,
|
|
78
|
+
* for example to open the pane in a window of its own.
|
|
79
|
+
* For the keyboard, make the handle focusable (`tabindex="0"`) and give it a name. Space or Enter picks the pane up,
|
|
80
|
+
* the arrow keys, Home and End choose the place, Space or Enter drops, Escape or Tab cancels. A live region
|
|
81
|
+
* announces each step. The name of a pane is its `data-split-grid-label`, else its `aria-label`, else the text
|
|
82
|
+
* of the handle. A handle that is a native control (a button, a link) keeps its keys. Offer move commands in a
|
|
83
|
+
* menu as well: they need no drag.
|
|
43
84
|
* - **Zoom.** A pane with `data-zoomed` fills the element. The other panes are hidden until the pane loses `data-zoomed`.
|
|
44
85
|
* - **Motion.** Panes move to their new place when the layout or the panes change. A new pane
|
|
45
86
|
* grows in. `leave(panes)` fades panes out before the app removes them. With reduced motion there is no motion.
|
|
@@ -51,12 +92,14 @@ declare const parseSizes: (v: string | null) => number[] | undefined;
|
|
|
51
92
|
* need more room than it has; while it does, its scroll area is focusable and named (a region,
|
|
52
93
|
* `label`), so the keyboard can scroll it.
|
|
53
94
|
*
|
|
54
|
-
* i18n keys: `
|
|
95
|
+
* i18n keys: `sortableInstructions`, `sortablePickedUp`, `sortableMoved`, `sortableDropped` and `sortableCancelled`
|
|
96
|
+
* (moves of panes). `resizeColumn` and `resizeRow` (divider names, `{index}` = number of the column or the
|
|
55
97
|
* row before it); override them per instance with `resize-label` and `resize-row-label`. `content` (name of the scroll area); override it with `label`.
|
|
56
98
|
*
|
|
57
99
|
* @slot - The panes: element children that are not `hidden`.
|
|
58
100
|
* @csspart scroller - The scroll area around the panes.
|
|
59
|
-
* @csspart cell - The box of one pane (moves and
|
|
101
|
+
* @csspart cell - The box of one pane (moves, animates and shows the drop mark).
|
|
102
|
+
* @csspart ghost - The label with the name of the pane that follows the pointer during a drag.
|
|
60
103
|
* @csspart divider - Each divider between two columns or two rows (the focusable separator).
|
|
61
104
|
* @cssprop --bk-split-grid-gap - Space between panes (default --bk-space-components). The dividers are in it.
|
|
62
105
|
* @cssprop --bk-split-grid-inset - Space inside the edge, so the panes' shadows and rings are not cut off (default --bk-space-1).
|
|
@@ -65,13 +108,33 @@ declare const parseSizes: (v: string | null) => number[] | undefined;
|
|
|
65
108
|
* @cssprop --bk-split-grid-divider-active - Line of a divider while it is dragged or has keyboard focus (default --bk-accent-solid).
|
|
66
109
|
* @cssprop --bk-split-grid-divider-width - Thickness of the line (default 3px).
|
|
67
110
|
* @cssprop --bk-split-grid-divider-inset - Distance of the line from the ends of its divider (default --bk-space-5).
|
|
111
|
+
* @cssprop --bk-split-grid-drag-opacity - Opacity of the pane while the user moves it (default 0.45).
|
|
112
|
+
* @cssprop --bk-split-grid-drop-color - Outline of the pane that a moved pane drops on (default --bk-accent-solid).
|
|
113
|
+
* @cssprop --bk-split-grid-drop-width - Thickness of that outline (default --bk-focus-width).
|
|
114
|
+
* @cssprop --bk-split-grid-drop-radius - Corner radius of that outline (default --bk-radius-container, else --bk-radius-lg).
|
|
115
|
+
* @cssprop --bk-split-grid-ghost-color - Text colour of the ghost (default --bk-text).
|
|
116
|
+
* @cssprop --bk-split-grid-ghost-bg - Background of the ghost (default --bk-layer-overlay-bg).
|
|
117
|
+
* @cssprop --bk-split-grid-ghost-border - Border colour of the ghost (default --bk-layer-overlay-border).
|
|
118
|
+
* @cssprop --bk-split-grid-ghost-shadow - Shadow of the ghost (default --bk-layer-overlay-shadow and the --bk-ring-focus halo).
|
|
119
|
+
* @cssprop --bk-split-grid-ghost-radius - Corner radius of the ghost (default --bk-radius-md).
|
|
120
|
+
* @cssprop --bk-split-grid-ghost-padding - Inline padding of the ghost (default --bk-space-3).
|
|
121
|
+
* @cssprop --bk-split-grid-ghost-max-width - Largest width of the ghost (default --bk-measure-display). It starts at the width of the handle.
|
|
122
|
+
* @cssprop --bk-split-grid-handle-cursor - Cursor over a handle (default grab).
|
|
123
|
+
* @cssprop --bk-split-grid-dragging-cursor - Cursor while the user moves a pane (default grabbing).
|
|
124
|
+
* @fires {CustomEvent<SplitGridReorderDetail>} reorder - Cancelable. When the user drops a pane on another pane; `detail` `{ pane, from, to, order }`. The app renders the new order.
|
|
125
|
+
* @fires {CustomEvent<SplitGridDragOutsideDetail>} dragoutside - Once per frame while the user drags a pane outside the grid (`inside: false`), and once with `inside: true` when the pointer comes back or the drag ends; `detail` `{ pane, clientX, clientY, inside }`.
|
|
126
|
+
* @fires {CustomEvent<SplitGridDropOutsideDetail>} dropoutside - When the user releases a dragged pane outside the grid; `detail` `{ pane, clientX, clientY }`.
|
|
68
127
|
* @fires {CustomEvent<SplitGridResizeDetail>} resize - When the user moves a divider (once per frame) and when the number of columns that fit changes; `detail` `{ sizes, rowSizes }` (fractions of the available space).
|
|
69
128
|
* @fires {CustomEvent<SplitGridResizeDetail>} change - When the user finishes resizing or resets the columns or the rows; `detail` `{ sizes, rowSizes }` (fractions of the available space).
|
|
70
129
|
*
|
|
71
130
|
* @keyboard ←, → - On a divider between columns: move it by 1 % (with Shift: 10 %), in the writing direction.
|
|
72
131
|
* @keyboard ↑, ↓ - On a divider between rows: move it by 1 % (with Shift: 10 %).
|
|
73
132
|
* @keyboard Home, End - On a divider: make the column or the row before it as small or as large as `min` or `min-row` allows.
|
|
74
|
-
* @
|
|
133
|
+
* @keyboard Space, Enter - On a focusable handle: pick the pane up, then drop it.
|
|
134
|
+
* @keyboard ←, →, ↑, ↓ - With a pane picked up: choose the previous or next place (← and → in the writing direction), or the pane above or below.
|
|
135
|
+
* @keyboard Home, End - With a pane picked up: choose the first or the last place.
|
|
136
|
+
* @keyboard Escape, Tab - Cancel the move of a pane.
|
|
137
|
+
* @a11y Each divider is a focusable `separator` (`aria-orientation` `vertical` between columns, `horizontal` between rows) with a name (`resizeColumn`, `resizeRow`) and its value in percent. While the panes scroll, the scroll area is a focusable, named `region`. A focused handle gets the instructions as `aria-description` (`sortableInstructions`), unless it has one. The shared live region announces the pick-up, each place, the drop and the cancel of a pane. The ghost is `aria-hidden`.
|
|
75
138
|
*
|
|
76
139
|
* @tag bk-split-grid
|
|
77
140
|
*/
|
|
@@ -248,6 +311,44 @@ export declare class BkSplitGrid extends LitElement {
|
|
|
248
311
|
* at once with reduced motion. If a pane stays, it shows again after a moment.
|
|
249
312
|
*/
|
|
250
313
|
leave(panes: Element[]): Promise<void>;
|
|
314
|
+
/** The move of a pane, while it lasts (also before the pointer passed the threshold). */
|
|
315
|
+
private drag;
|
|
316
|
+
private panesChanged;
|
|
317
|
+
private restoreFocus;
|
|
318
|
+
/** The pane that an event happened in: the child of the element on its path. */
|
|
319
|
+
private paneOf;
|
|
320
|
+
/** The handle on the path of the event inside `pane`, unless a control lies between (it keeps its press). */
|
|
321
|
+
private handleOf;
|
|
322
|
+
private nameOf;
|
|
323
|
+
private say;
|
|
324
|
+
private cellOf;
|
|
325
|
+
/** Moves the drop mark to the pane at `to` (`from`: no mark). */
|
|
326
|
+
private setTarget;
|
|
327
|
+
private onPaneDown;
|
|
328
|
+
/** Lifts the pane: the look, the ghost, the boxes of the cells. */
|
|
329
|
+
private startDrag;
|
|
330
|
+
/** The boxes of the cells and of the visible area: once at the start and after a scroll, never per move. */
|
|
331
|
+
private measureDrag;
|
|
332
|
+
private onDragScroll;
|
|
333
|
+
private onDragMove;
|
|
334
|
+
/** One frame of a pointer drag: move the ghost, find the target, tell the app about the outside (unless `last`). */
|
|
335
|
+
private dragFrame;
|
|
336
|
+
private emitOutside;
|
|
337
|
+
private onDragUp;
|
|
338
|
+
private onDragCancel;
|
|
339
|
+
/** Escape during a pointer drag. */
|
|
340
|
+
private onDragKey;
|
|
341
|
+
/** A native drag of a link or an image in a handle conflicts with the pointer drag. */
|
|
342
|
+
private onNativeDrag;
|
|
343
|
+
/** Ends a move. With `commit`, a drop on another pane fires `reorder` and a drop outside fires `dropoutside`. */
|
|
344
|
+
private endDrag;
|
|
345
|
+
/** The handle that a key or focus event comes from: a focused handle that is not a native control (it keeps its keys). */
|
|
346
|
+
private keyHandle;
|
|
347
|
+
private onPaneFocusIn;
|
|
348
|
+
private onPaneFocusOut;
|
|
349
|
+
private onPaneKey;
|
|
350
|
+
/** The pane above (-1) or below (1) the one at index `at`: the nearest by the middle of its column. */
|
|
351
|
+
private vertical;
|
|
251
352
|
private emitSizes;
|
|
252
353
|
/** Ends a change of the sizes by the user: keep them, reflect them into `sizes` or `row-sizes`, fire `change`. */
|
|
253
354
|
private commit;
|