@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
|
@@ -2,6 +2,7 @@ import { LitElement, css, html } from "lit";
|
|
|
2
2
|
import { define } from "../internal/define.js";
|
|
3
3
|
import { base } from "../internal/styles.js";
|
|
4
4
|
import { space } from "../internal/space.js";
|
|
5
|
+
import { setHostVars } from "../internal/host-vars.js";
|
|
5
6
|
class BkSurface extends LitElement {
|
|
6
7
|
static properties = {
|
|
7
8
|
layer: { reflect: true, useDefault: true },
|
|
@@ -12,6 +13,8 @@ class BkSurface extends LitElement {
|
|
|
12
13
|
layered: { type: Boolean, reflect: true },
|
|
13
14
|
selected: { type: Boolean, reflect: true }
|
|
14
15
|
};
|
|
16
|
+
/** The state `bk-scope` of a layered surface. */
|
|
17
|
+
internals = this.attachInternals();
|
|
15
18
|
constructor() {
|
|
16
19
|
super();
|
|
17
20
|
this.layer = "raised";
|
|
@@ -69,9 +72,9 @@ class BkSurface extends LitElement {
|
|
|
69
72
|
`];
|
|
70
73
|
willUpdate(changed) {
|
|
71
74
|
if (changed.has("padding"))
|
|
72
|
-
this
|
|
73
|
-
if (changed.has("layered")
|
|
74
|
-
this.
|
|
75
|
+
setHostVars(this, { "--_bk-surface-pad": space(this.padding, "var(--bk-space-4)") });
|
|
76
|
+
if (changed.has("layered"))
|
|
77
|
+
this.layered ? this.internals.states.add("bk-scope") : this.internals.states.delete("bk-scope");
|
|
75
78
|
}
|
|
76
79
|
render() {
|
|
77
80
|
return html`<slot></slot>`;
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import { LitElement, type PropertyValues, type TemplateResult } from "lit";
|
|
2
2
|
import { LoadMoreController } from "../internal/virtual.js";
|
|
3
3
|
import "./bk-button.js";
|
|
4
|
-
import "./bk-checkbox.js";
|
|
5
|
-
import "./bk-filter-bar.js";
|
|
6
4
|
import "./bk-icon.js";
|
|
7
|
-
import "./bk-input-number.js";
|
|
8
|
-
import "./bk-input-text.js";
|
|
9
|
-
import "./bk-menu-context.js";
|
|
10
|
-
import "./bk-menu-divider.js";
|
|
11
|
-
import "./bk-menu-item.js";
|
|
12
|
-
import "./bk-menu-label.js";
|
|
13
|
-
import "./bk-popover.js";
|
|
14
|
-
import "./bk-skeleton.js";
|
|
15
5
|
import "../icons/set/add.js";
|
|
16
6
|
import "../icons/set/arrow-back.js";
|
|
17
7
|
import "../icons/set/arrow-down.js";
|
|
@@ -245,11 +235,13 @@ export type TableCSVOptions = {
|
|
|
245
235
|
* its header cell. `th[data-card="title"]` marks the column that is the title of a card (default: the row headers,
|
|
246
236
|
* `th` in the body), `th[data-card="hidden"]` leaves a column out. `th[data-card="meta"]` shows a short value (a
|
|
247
237
|
* position, a change, the disclosure button of an expandable row) in the head of the card, next to the title, without
|
|
248
|
-
* its label. A text value is at the end beside its label while it fits. A longer text wraps under its label, starts at
|
|
238
|
+
* its label. A meta value that does not fit next to the title moves under it. A text value is at the end beside its label while it fits. A longer text wraps under its label, starts at
|
|
249
239
|
* the start edge and uses the full width of the card. A
|
|
250
240
|
* number (`data-type="number"` on the header cell or the cell) and a yes/no mark always stay at the end beside their label.
|
|
251
241
|
* `th[data-card="block"]` puts the value of a column under its label in every card. The header row stays as a row of its
|
|
252
|
-
* controls (
|
|
242
|
+
* controls (select-all, filters). In a `sortable` table, one select ("Sort by") above the table sorts the cards, and a
|
|
243
|
+
* button next to it changes the direction. The select contains every sortable column, also a hidden one. The sort
|
|
244
|
+
* buttons of the header cells do not show. The table keeps its roles (set explicitly while it shows cards).
|
|
253
245
|
* The element has the custom state `cards` while it shows cards (`bk-table:state(cards)`). It sets the labels, the
|
|
254
246
|
* marks and the roles on the cells only while it shows cards, so a wide table keeps the markup of the server.
|
|
255
247
|
*
|
|
@@ -282,6 +274,7 @@ export type TableCSVOptions = {
|
|
|
282
274
|
* @csspart scroller - The scroll container around the table.
|
|
283
275
|
* @csspart state - The box of the empty and the error slot.
|
|
284
276
|
* @csspart filter-bar - The `bk-filter-bar` with the active filters.
|
|
277
|
+
* @csspart card-sort - In card mode: the box of the "Sort by" select and the direction button above the table.
|
|
285
278
|
* @csspart filter-popover - The `bk-popover` of a filter.
|
|
286
279
|
* @csspart column-menu - The menu of a column (column menu button, or a click on a resize handle).
|
|
287
280
|
* @csspart busy - The veil over the rows while `busy` reloads them.
|
|
@@ -574,8 +567,8 @@ export declare class BkTable extends LitElement {
|
|
|
574
567
|
private i18n;
|
|
575
568
|
/** Custom states (cards). */
|
|
576
569
|
private internals;
|
|
577
|
-
private slots;
|
|
578
570
|
private busyState;
|
|
571
|
+
private slots;
|
|
579
572
|
private keys;
|
|
580
573
|
private anchor;
|
|
581
574
|
private shift;
|
|
@@ -612,6 +605,13 @@ export declare class BkTable extends LitElement {
|
|
|
612
605
|
static styles: import("lit").CSSResult[];
|
|
613
606
|
connectedCallback(): void;
|
|
614
607
|
disconnectedCallback(): void;
|
|
608
|
+
/**
|
|
609
|
+
* The update waits for the elements of the features in use: the selection, the filters and the column menu
|
|
610
|
+
* render with defined elements, and `updateComplete` includes their load. Skeletons and the editors of a cell
|
|
611
|
+
* do not hold the update: the busy state starts at once, and an edit waits for its field itself.
|
|
612
|
+
*/
|
|
613
|
+
protected scheduleUpdate(): void | Promise<unknown>;
|
|
614
|
+
private lateParts;
|
|
615
615
|
protected willUpdate(changed: PropertyValues): void;
|
|
616
616
|
/** The table has no data rows. */
|
|
617
617
|
private get isEmpty();
|
|
@@ -652,6 +652,10 @@ export declare class BkTable extends LitElement {
|
|
|
652
652
|
private get sortHeaders();
|
|
653
653
|
/** Puts a sort button with its icon into each sortable header cell and sets `aria-sort` (light DOM: after updates only). */
|
|
654
654
|
private syncSort;
|
|
655
|
+
/** Card mode: the select chose a column. The column sorts in its first direction. */
|
|
656
|
+
private onCardSort;
|
|
657
|
+
/** Card mode: the button changes the direction of the sorted column. */
|
|
658
|
+
private onCardSortDir;
|
|
655
659
|
/** Asks for a sort of the column of `th`: the given direction, else the next one. */
|
|
656
660
|
private requestSort;
|
|
657
661
|
/**
|
|
@@ -14,19 +14,17 @@ import { containsDeep, deepActiveElement, setTriggerAria } from "../internal/anc
|
|
|
14
14
|
import { copyText } from "../internal/clipboard.js";
|
|
15
15
|
import { LocalizeController } from "../i18n.js";
|
|
16
16
|
import { base, gripRules, srOnlyRules } from "../internal/styles.js";
|
|
17
|
+
import { LateLoad, lateLoads } from "../internal/late.js";
|
|
18
|
+
import { lateParts as late } from "#bk/internal/late/bk-table.js";
|
|
17
19
|
import "./bk-button.js";
|
|
18
|
-
import "./bk-checkbox.js";
|
|
19
|
-
import "./bk-filter-bar.js";
|
|
20
20
|
import "./bk-icon.js";
|
|
21
|
-
import "./bk-input-number.js";
|
|
22
|
-
import "./bk-input-text.js";
|
|
23
|
-
import "./bk-menu-context.js";
|
|
24
|
-
import "./bk-menu-divider.js";
|
|
25
|
-
import "./bk-menu-item.js";
|
|
26
|
-
import "./bk-menu-label.js";
|
|
27
|
-
import "./bk-popover.js";
|
|
28
|
-
import "./bk-skeleton.js";
|
|
29
21
|
import { mutationObserver, resizeObserver, lightDom } from "../internal/server.js";
|
|
22
|
+
const selectParts = new LateLoad(late, "bk-checkbox");
|
|
23
|
+
const filterParts = new LateLoad(late, "bk-filter-bar", "bk-popover");
|
|
24
|
+
const menuParts = new LateLoad(late, "bk-menu-context", "bk-menu-item", "bk-menu-divider", "bk-menu-label");
|
|
25
|
+
const editParts = new LateLoad(late, "bk-input-number", "bk-input-text");
|
|
26
|
+
const skeletonParts = new LateLoad(late, "bk-skeleton");
|
|
27
|
+
const cardSortParts = new LateLoad(late, "bk-select");
|
|
30
28
|
import "../icons/set/add.js";
|
|
31
29
|
import "../icons/set/arrow-back.js";
|
|
32
30
|
import "../icons/set/arrow-down.js";
|
|
@@ -313,8 +311,28 @@ const tableStyles = css`
|
|
|
313
311
|
padding-block-end: var(--bk-table-card-gap, var(--bk-space-2));
|
|
314
312
|
}
|
|
315
313
|
bk-table:state(cards) > table > thead > tr > th { display: block; position: static; padding: 0; border: 0; background: none; inline-size: auto; }
|
|
316
|
-
bk-table:state(cards) > table > thead > tr > th:not(:has(>
|
|
314
|
+
bk-table:state(cards) > table > thead > tr > th:not(:has(> .bk-table-tool, > bk-checkbox)) { ${srOnlyRules} }
|
|
315
|
+
/* The select above the table sorts the cards: the sort buttons of the header cells do not show. */
|
|
316
|
+
bk-table:state(cards) > table > thead > tr > th > .bk-table-sort { ${srOnlyRules} }
|
|
317
|
+
bk-table:state(cards) > table > thead > tr:not(:has(> th > :is(.bk-table-tool, bk-checkbox))) { padding-block-end: 0; }
|
|
317
318
|
bk-table:state(cards) > table > thead > tr > th > .bk-table-resize { display: none; }
|
|
319
|
+
/*
|
|
320
|
+
* The card is the surface of the row: a selected row and the row under the pointer tint the whole card, not the
|
|
321
|
+
* cells inside its padding. The cells have no background of their own in card mode (no stripes, no pin surface).
|
|
322
|
+
*/
|
|
323
|
+
bk-table:state(cards) > table > :is(tbody, tfoot) > tr:not([data-bk-spacer]) > :is(th, td):not([data-bk-handle]) { background: none; }
|
|
324
|
+
bk-table:state(cards) > table > tbody > tr:is([data-selected], [aria-selected="true"]) {
|
|
325
|
+
background-image: linear-gradient(var(--bk-table-selected, var(--bk-selected)), var(--bk-table-selected, var(--bk-selected)));
|
|
326
|
+
}
|
|
327
|
+
@media (hover: hover) {
|
|
328
|
+
bk-table:state(cards)[hover-rows] > table > tbody > tr:hover {
|
|
329
|
+
background-image: linear-gradient(var(--bk-table-row-hover, var(--bk-hover)), var(--bk-table-row-hover, var(--bk-hover)));
|
|
330
|
+
}
|
|
331
|
+
bk-table:state(cards)[hover-rows] > table > tbody > tr:is([data-selected], [aria-selected="true"]):hover {
|
|
332
|
+
background-image: linear-gradient(var(--bk-table-row-hover, var(--bk-hover)), var(--bk-table-row-hover, var(--bk-hover))),
|
|
333
|
+
linear-gradient(var(--bk-table-selected, var(--bk-selected)), var(--bk-table-selected, var(--bk-selected)));
|
|
334
|
+
}
|
|
335
|
+
}
|
|
318
336
|
bk-table:state(cards) > table > :is(tbody, tfoot) > tr {
|
|
319
337
|
margin-block-end: var(--bk-table-card-gap, var(--bk-space-2)); padding: var(--bk-table-card-padding, var(--bk-space-3));
|
|
320
338
|
border: var(--bk-border-width) solid var(--bk-table-card-border, var(--bk-layer-raised-border));
|
|
@@ -360,10 +378,11 @@ const tableStyles = css`
|
|
|
360
378
|
flex: none; order: 0;
|
|
361
379
|
}
|
|
362
380
|
bk-table:state(cards) > table > :is(tbody, tfoot) > tr:has(> [data-bk-card="meta"]) > :is([data-bk-card="title"], th:not([data-bk-card], ${unsafeCSS(GENERATED)})) {
|
|
363
|
-
|
|
381
|
+
/* The title keeps the width of its longest word (at most the card): a meta value that does not fit then wraps under it. */
|
|
382
|
+
flex: 1 1 0; min-inline-size: min(min-content, 100%); order: 0;
|
|
364
383
|
}
|
|
365
384
|
bk-table:state(cards) > table > :is(tbody, tfoot) > tr > [data-bk-card="meta"] {
|
|
366
|
-
justify-content: start; align-items: center; gap: var(--bk-table-card-meta-gap, var(--bk-space-2));
|
|
385
|
+
justify-content: start; align-items: center; gap: var(--bk-table-card-meta-gap, var(--bk-space-2)); max-inline-size: 100%;
|
|
367
386
|
text-align: start; color: var(--bk-table-card-meta-fg, var(--bk-text-muted));
|
|
368
387
|
}
|
|
369
388
|
/* An open row and its detail form one card. The text of the detail starts at the start edge. */
|
|
@@ -426,8 +445,8 @@ class BkTable extends LitElement {
|
|
|
426
445
|
i18n = new LocalizeController(this);
|
|
427
446
|
/** Custom states (cards). */
|
|
428
447
|
internals = this.attachInternals();
|
|
448
|
+
busyState = new BusyController(this, this.i18n, this.internals);
|
|
429
449
|
slots = new SlotController(this);
|
|
430
|
-
busyState = new BusyController(this, this.i18n);
|
|
431
450
|
keys = /* @__PURE__ */ new Set();
|
|
432
451
|
anchor;
|
|
433
452
|
shift = false;
|
|
@@ -534,6 +553,9 @@ class BkTable extends LitElement {
|
|
|
534
553
|
.scroller { overflow: auto; flex: 1 1 auto; min-block-size: 0; max-block-size: inherit; overscroll-behavior-inline: contain; }
|
|
535
554
|
.scroller:focus-visible { outline: var(--bk-focus-ring); outline-offset: var(--bk-focus-offset-inset); }
|
|
536
555
|
.filter-bar { margin-block-end: var(--bk-table-filter-bar-gap, var(--bk-space-2)); }
|
|
556
|
+
/* Card mode: the sort of the cards is one select and a button for the direction, above the table. */
|
|
557
|
+
.card-sort { display: flex; align-items: end; gap: var(--bk-table-card-gap, var(--bk-space-2)); margin-block-end: var(--bk-table-card-gap, var(--bk-space-2)); }
|
|
558
|
+
.card-sort bk-select { flex: 1 1 auto; min-inline-size: 0; --bk-field-label-width: max-content; }
|
|
537
559
|
.state { padding: var(--bk-table-state-padding, var(--bk-space-4)); }
|
|
538
560
|
.sentinel { block-size: var(--bk-border-width); }
|
|
539
561
|
.probe { position: absolute; visibility: hidden; pointer-events: none; inline-size: 0; block-size: 0; margin-inline-start: var(--bk-table-cards-below, calc(var(--bk-width-panel) * 1.5)); }
|
|
@@ -555,6 +577,25 @@ class BkTable extends LitElement {
|
|
|
555
577
|
this.rowLinks.disconnect();
|
|
556
578
|
this.observedTable = null;
|
|
557
579
|
}
|
|
580
|
+
/**
|
|
581
|
+
* The update waits for the elements of the features in use: the selection, the filters and the column menu
|
|
582
|
+
* render with defined elements, and `updateComplete` includes their load. Skeletons and the editors of a cell
|
|
583
|
+
* do not hold the update: the busy state starts at once, and an edit waits for its field itself.
|
|
584
|
+
*/
|
|
585
|
+
scheduleUpdate() {
|
|
586
|
+
const wait = this.lateParts();
|
|
587
|
+
return wait ? wait.then(() => super.scheduleUpdate()) : super.scheduleUpdate();
|
|
588
|
+
}
|
|
589
|
+
lateParts() {
|
|
590
|
+
if (this.busy)
|
|
591
|
+
void skeletonParts.start();
|
|
592
|
+
if (this.navigation === "cell")
|
|
593
|
+
void editParts.start();
|
|
594
|
+
const head = filterParts.loaded && menuParts.loaded ? null : this.headRow;
|
|
595
|
+
const filters = this.filterable || Object.keys(this.filters ?? {}).length > 0 || !!head?.querySelector(":scope > [data-filter]");
|
|
596
|
+
const menu = this.columnMenu || this.resizable || this.reorderable || !!head?.querySelector(":scope > [data-resizable]");
|
|
597
|
+
return lateLoads(this.selection && selectParts.start(), filters && filterParts.start(), menu && menuParts.start());
|
|
598
|
+
}
|
|
558
599
|
willUpdate(changed) {
|
|
559
600
|
super.willUpdate(changed);
|
|
560
601
|
if (this.virtual && this.renderRow)
|
|
@@ -788,6 +829,11 @@ class BkTable extends LitElement {
|
|
|
788
829
|
icon.className = "bk-table-sort-icon";
|
|
789
830
|
button.append(icon);
|
|
790
831
|
}
|
|
832
|
+
if (this.cards) {
|
|
833
|
+
if (button.getAttribute("tabindex") !== "-1")
|
|
834
|
+
button.setAttribute("tabindex", "-1");
|
|
835
|
+
} else if (button.getAttribute("tabindex") === "-1")
|
|
836
|
+
button.removeAttribute("tabindex");
|
|
791
837
|
const sorted = th.dataset.sort === this.sortKey;
|
|
792
838
|
const name = sorted ? this.sortDir === "desc" ? "arrow-down" : "arrow-up" : "unfold-more";
|
|
793
839
|
if (icon.getAttribute("name") !== name)
|
|
@@ -799,6 +845,20 @@ class BkTable extends LitElement {
|
|
|
799
845
|
th.setAttribute("aria-sort", sort);
|
|
800
846
|
}
|
|
801
847
|
}
|
|
848
|
+
/** Card mode: the select chose a column. The column sorts in its first direction. */
|
|
849
|
+
onCardSort = (e) => {
|
|
850
|
+
e.stopPropagation();
|
|
851
|
+
const key = e.target.value;
|
|
852
|
+
const th = this.headRow && this.appCells(this.headRow).find((c) => c.dataset.sort === key);
|
|
853
|
+
if (th && key !== this.sortKey)
|
|
854
|
+
this.requestSort(th);
|
|
855
|
+
};
|
|
856
|
+
/** Card mode: the button changes the direction of the sorted column. */
|
|
857
|
+
onCardSortDir = () => {
|
|
858
|
+
const th = this.headRow && this.appCells(this.headRow).find((c) => c.dataset.sort === this.sortKey);
|
|
859
|
+
if (th)
|
|
860
|
+
this.requestSort(th, this.sortDir === "desc" ? "asc" : "desc");
|
|
861
|
+
};
|
|
802
862
|
/** Asks for a sort of the column of `th`: the given direction, else the next one. */
|
|
803
863
|
requestSort(th, want) {
|
|
804
864
|
const key = th.dataset.sort;
|
|
@@ -2244,6 +2304,12 @@ class BkTable extends LitElement {
|
|
|
2244
2304
|
async startEdit(cell) {
|
|
2245
2305
|
if (this.editing || !cell.hasAttribute("data-editable") || this.navigation !== "cell")
|
|
2246
2306
|
return;
|
|
2307
|
+
const load = editParts.start();
|
|
2308
|
+
if (load) {
|
|
2309
|
+
await load;
|
|
2310
|
+
if (this.editing)
|
|
2311
|
+
return;
|
|
2312
|
+
}
|
|
2247
2313
|
const head = this.headOf(cell);
|
|
2248
2314
|
const old = cell.dataset.value ?? this.text(cell);
|
|
2249
2315
|
const field = document.createElement(cell.dataset.field === "number" ? "bk-input-number" : "bk-input-text");
|
|
@@ -2591,6 +2657,9 @@ class BkTable extends LitElement {
|
|
|
2591
2657
|
else
|
|
2592
2658
|
this.internals.states.delete("cards");
|
|
2593
2659
|
this.syncAll();
|
|
2660
|
+
this.requestUpdate();
|
|
2661
|
+
if (cards && this.sortable)
|
|
2662
|
+
void cardSortParts.start();
|
|
2594
2663
|
}
|
|
2595
2664
|
const head = this.headRow;
|
|
2596
2665
|
if (head && head.querySelector("[data-pin]"))
|
|
@@ -2607,7 +2676,17 @@ class BkTable extends LitElement {
|
|
|
2607
2676
|
const empty = this.empty && !this.busy && !error && this.slots.has("empty");
|
|
2608
2677
|
const filterHead = this.filterKey ? this.headRow && this.appCells(this.headRow).find((c) => c.dataset.filter === this.filterKey) : null;
|
|
2609
2678
|
const filterName = this.i18n.t("tableFilterColumn", { column: filterHead ? this.text(filterHead) : "" });
|
|
2610
|
-
|
|
2679
|
+
const sorts = this.sortable && this.cards && this.headRow ? this.appCells(this.headRow).filter((th) => th.dataset.sort).map((th) => ({ key: th.dataset.sort, text: this.text(th) || th.dataset.sort })) : [];
|
|
2680
|
+
const desc = this.sortDir === "desc";
|
|
2681
|
+
return html`${sorts.length ? html`<div class="card-sort" part="card-sort">
|
|
2682
|
+
<bk-select size="sm" label-position="start" label=${this.i18n.t("tableSortBy")} placeholder=${this.sortKey ? nothing : this.i18n.t("tableSortBy")}
|
|
2683
|
+
.value=${this.sortKey ?? ""} @input=${(e) => e.stopPropagation()} @change=${this.onCardSort}>
|
|
2684
|
+
${sorts.map((c) => html`<option value=${c.key}>${c.text}</option>`)}
|
|
2685
|
+
</bk-select>
|
|
2686
|
+
<bk-button size="sm" variant="outline" icon=${desc ? "arrow-down" : "arrow-up"} ?disabled=${!this.sortKey}
|
|
2687
|
+
label=${this.i18n.t(desc ? "tableSortAscending" : "tableSortDescending")} @click=${this.onCardSortDir}></bk-button>
|
|
2688
|
+
</div>` : nothing}
|
|
2689
|
+
${filters.length ? html`<bk-filter-bar class="filter-bar" part="filter-bar" .items=${filters}
|
|
2611
2690
|
@remove=${this.onFilterRemove} @clear=${this.onFilterClear}></bk-filter-bar>` : nothing}
|
|
2612
2691
|
<div class="frame">
|
|
2613
2692
|
<div class="scroller" part="scroller" tabindex=${this.scrolling ? "0" : nothing} ?inert=${this.busyState.inert && !this.empty}
|
|
@@ -7,9 +7,24 @@ export interface TabRemoveDetail {
|
|
|
7
7
|
/** The `value` of the tab that asks to be removed. */
|
|
8
8
|
value: string;
|
|
9
9
|
}
|
|
10
|
+
/** The state of a tab in its list. `<bk-tabs>` gives it to each tab with `setTabState()`. */
|
|
11
|
+
export interface TabState {
|
|
12
|
+
/** The tab is an ARIA tab (false for link tabs). */
|
|
13
|
+
tab: boolean;
|
|
14
|
+
/** The tab is the selected one. */
|
|
15
|
+
selected: boolean;
|
|
16
|
+
/** The tab is the Tab stop of the list (roving tabindex). */
|
|
17
|
+
tabStop: boolean;
|
|
18
|
+
/** The panel that the tab controls. */
|
|
19
|
+
controls: Element | null;
|
|
20
|
+
/** The tab does not fit the row and is in the "More" menu. */
|
|
21
|
+
overflow: boolean;
|
|
22
|
+
}
|
|
10
23
|
/**
|
|
11
|
-
* One tab of a `<bk-tabs>`. Use it only as a direct child of `<bk-tabs>`. The tabs element
|
|
12
|
-
* role
|
|
24
|
+
* One tab of a `<bk-tabs>`. Use it only as a direct child of `<bk-tabs>`. The tabs element gives the tab its
|
|
25
|
+
* state (`setTabState()`). The tab renders the role `tab`, `aria-selected`, `aria-controls` and the roving
|
|
26
|
+
* `tabindex` on its inner box, so the tabs write no attributes on the element of the app (server HTML stays as it is).
|
|
27
|
+
* The custom states `:state(selected)` and `:state(overflow)` (the tab is in the "More" menu) are for the CSS of an app.
|
|
13
28
|
*
|
|
14
29
|
* With `href` the tab renders a real link (router-driven tabs): no tab panel is needed, the
|
|
15
30
|
* selected link has `aria-current="page"`.
|
|
@@ -51,6 +66,7 @@ export interface TabRemoveDetail {
|
|
|
51
66
|
* @tag bk-tabs-item
|
|
52
67
|
*/
|
|
53
68
|
export declare class BkTabsItem extends ChoiceItem {
|
|
69
|
+
static shadowRootOptions: ShadowRootInit;
|
|
54
70
|
static properties: {
|
|
55
71
|
value: {
|
|
56
72
|
reflect: boolean;
|
|
@@ -63,13 +79,23 @@ export declare class BkTabsItem extends ChoiceItem {
|
|
|
63
79
|
reflect: boolean;
|
|
64
80
|
};
|
|
65
81
|
target: {};
|
|
82
|
+
rel: {};
|
|
83
|
+
download: {};
|
|
66
84
|
disabled: {
|
|
67
85
|
type: BooleanConstructor;
|
|
68
86
|
reflect: boolean;
|
|
69
87
|
};
|
|
70
88
|
selected: {
|
|
71
89
|
type: BooleanConstructor;
|
|
72
|
-
|
|
90
|
+
};
|
|
91
|
+
tabRole: {
|
|
92
|
+
state: boolean;
|
|
93
|
+
};
|
|
94
|
+
tabStop: {
|
|
95
|
+
state: boolean;
|
|
96
|
+
};
|
|
97
|
+
controls: {
|
|
98
|
+
state: boolean;
|
|
73
99
|
};
|
|
74
100
|
removable: {
|
|
75
101
|
type: BooleanConstructor;
|
|
@@ -96,17 +122,29 @@ export declare class BkTabsItem extends ChoiceItem {
|
|
|
96
122
|
dot: boolean;
|
|
97
123
|
/** What a screen reader announces for the dot (default: i18n `tabDot`). */
|
|
98
124
|
dotLabel: string | undefined;
|
|
125
|
+
/** The tab is an ARIA tab (false while its list contains links). */
|
|
126
|
+
private tabRole;
|
|
127
|
+
/** The tab is the Tab stop of its list. */
|
|
128
|
+
private tabStop;
|
|
129
|
+
/** The panel of the tab. */
|
|
130
|
+
private controls;
|
|
99
131
|
private i18n;
|
|
100
|
-
|
|
101
|
-
private hinted;
|
|
132
|
+
private readonly internals;
|
|
102
133
|
constructor();
|
|
134
|
+
/** `<bk-tabs>` calls it on each update: the state of the tab in its list. An app does not call it. */
|
|
135
|
+
setTabState(state: TabState): void;
|
|
136
|
+
/** True while the tab does not fit the row and is in the "More" menu. */
|
|
137
|
+
get overflowed(): boolean;
|
|
138
|
+
protected get labelOnHost(): boolean;
|
|
139
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
140
|
+
/** The inner box is the tab: it has the role, the ARIA state, the name and the roving tabindex. */
|
|
141
|
+
protected renderBox(cls: string, inner: unknown): unknown;
|
|
103
142
|
protected renderMark(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
104
143
|
/** The text of the tab: its `label` or its content. */
|
|
105
144
|
get text(): string;
|
|
106
145
|
/** Asks to remove the tab: fires `remove`. Returns false when a listener cancelled it. */
|
|
107
146
|
requestRemove(): boolean;
|
|
108
|
-
|
|
109
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
147
|
+
render(): unknown;
|
|
110
148
|
protected get current(): boolean;
|
|
111
149
|
static styles: import("lit").CSSResult[];
|
|
112
150
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { css, html, nothing } from "lit";
|
|
1
|
+
import { LitElement, css, html, nothing } from "lit";
|
|
2
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
2
3
|
import { define } from "../internal/define.js";
|
|
3
4
|
import { emitDetail } from "../internal/events.js";
|
|
4
5
|
import { LocalizeController } from "../i18n.js";
|
|
@@ -8,22 +9,59 @@ import "./bk-icon.js";
|
|
|
8
9
|
import { lightDom } from "../internal/server.js";
|
|
9
10
|
import "../icons/set/close.js";
|
|
10
11
|
class BkTabsItem extends ChoiceItem {
|
|
12
|
+
static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };
|
|
11
13
|
static properties = {
|
|
12
14
|
...ChoiceItem.properties,
|
|
13
|
-
selected: { type: Boolean
|
|
15
|
+
selected: { type: Boolean },
|
|
16
|
+
tabRole: { state: true },
|
|
17
|
+
tabStop: { state: true },
|
|
18
|
+
controls: { state: true },
|
|
14
19
|
removable: { type: Boolean, reflect: true },
|
|
15
20
|
closeLabel: { attribute: "close-label" },
|
|
16
21
|
dot: { type: Boolean, reflect: true },
|
|
17
22
|
dotLabel: { attribute: "dot-label" }
|
|
18
23
|
};
|
|
19
24
|
i18n = new LocalizeController(this);
|
|
20
|
-
|
|
21
|
-
hinted = false;
|
|
25
|
+
internals = this.attachInternals();
|
|
22
26
|
constructor() {
|
|
23
27
|
super();
|
|
24
28
|
this.selected = false;
|
|
25
29
|
this.removable = false;
|
|
26
30
|
this.dot = false;
|
|
31
|
+
this.tabRole = true;
|
|
32
|
+
this.tabStop = false;
|
|
33
|
+
this.controls = null;
|
|
34
|
+
}
|
|
35
|
+
/** `<bk-tabs>` calls it on each update: the state of the tab in its list. An app does not call it. */
|
|
36
|
+
setTabState(state) {
|
|
37
|
+
this.selected = state.selected;
|
|
38
|
+
this.tabRole = state.tab;
|
|
39
|
+
this.tabStop = state.tabStop;
|
|
40
|
+
this.controls = state.controls;
|
|
41
|
+
this.internals.states[state.overflow ? "add" : "delete"]("overflow");
|
|
42
|
+
}
|
|
43
|
+
/** True while the tab does not fit the row and is in the "More" menu. */
|
|
44
|
+
get overflowed() {
|
|
45
|
+
return this.internals.states.has("overflow");
|
|
46
|
+
}
|
|
47
|
+
get labelOnHost() {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
willUpdate(changed) {
|
|
51
|
+
super.willUpdate(changed);
|
|
52
|
+
if (changed.has("selected"))
|
|
53
|
+
this.internals.states[this.selected ? "add" : "delete"]("selected");
|
|
54
|
+
}
|
|
55
|
+
/** The inner box is the tab: it has the role, the ARIA state, the name and the roving tabindex. */
|
|
56
|
+
renderBox(cls, inner) {
|
|
57
|
+
if (!this.tabRole)
|
|
58
|
+
return super.renderBox(cls, inner);
|
|
59
|
+
const hint = this.removable && !this.disabled;
|
|
60
|
+
return html`<span class=${cls} part="base" title=${ifDefined(this.tip)} role="tab" tabindex=${this.tabStop && !this.disabled ? "0" : "-1"}
|
|
61
|
+
aria-selected=${this.selected ? "true" : "false"} aria-disabled=${ifDefined(this.disabled ? "true" : void 0)}
|
|
62
|
+
aria-label=${ifDefined(this.label || void 0)} aria-keyshortcuts=${ifDefined(hint ? "Delete" : void 0)}
|
|
63
|
+
aria-description=${ifDefined(hint ? this.i18n.t("tabCloseHint") : void 0)}
|
|
64
|
+
.ariaControlsElements=${this.controls ? [this.controls] : null}>${inner}</span>`;
|
|
27
65
|
}
|
|
28
66
|
renderMark() {
|
|
29
67
|
return this.dot ? html`<span class="dot" part="dot"></span><span class="sr-only">${this.dotLabel || this.i18n.t("tabDot")}</span>` : nothing;
|
|
@@ -38,20 +76,6 @@ class BkTabsItem extends ChoiceItem {
|
|
|
38
76
|
return false;
|
|
39
77
|
return emitDetail(this, "remove", { value: this.value }, true);
|
|
40
78
|
}
|
|
41
|
-
updated(changed) {
|
|
42
|
-
super.updated(changed);
|
|
43
|
-
const hint = this.removable && !this.href && !this.disabled;
|
|
44
|
-
if (hint) {
|
|
45
|
-
this.setAttribute("aria-keyshortcuts", "Delete");
|
|
46
|
-
const text = this.i18n.t("tabCloseHint");
|
|
47
|
-
if (this.getAttribute("aria-description") !== text)
|
|
48
|
-
this.setAttribute("aria-description", text);
|
|
49
|
-
} else if (this.hinted) {
|
|
50
|
-
this.removeAttribute("aria-keyshortcuts");
|
|
51
|
-
this.removeAttribute("aria-description");
|
|
52
|
-
}
|
|
53
|
-
this.hinted = hint;
|
|
54
|
-
}
|
|
55
79
|
render() {
|
|
56
80
|
if (!this.removable || this.href)
|
|
57
81
|
return super.render();
|
|
@@ -67,6 +91,12 @@ class BkTabsItem extends ChoiceItem {
|
|
|
67
91
|
}
|
|
68
92
|
// Size- and variant-dependent values come as private --_bk-tab-* variables from <bk-tabs>.
|
|
69
93
|
static styles = [...choiceItemStyles, srOnly, css`
|
|
94
|
+
/* A tab in the "More" menu keeps its box for the measurement but takes no space. The rule is in the item:
|
|
95
|
+
Chromium crashes with :state() inside ::slotted() of the tabs. */
|
|
96
|
+
:host(:state(overflow)) {
|
|
97
|
+
position: absolute !important; inset-block-start: 0 !important; inset-inline-start: 0 !important;
|
|
98
|
+
visibility: hidden !important; pointer-events: none !important;
|
|
99
|
+
}
|
|
70
100
|
:host {
|
|
71
101
|
flex: none;
|
|
72
102
|
--_bk-ci-height: var(--_bk-tab-h, var(--bk-control-md));
|
|
@@ -132,10 +162,11 @@ class BkTabsItem extends ChoiceItem {
|
|
|
132
162
|
display: var(--_bk-tab-indicator-display, block); opacity: 0; scale: var(--_bk-tab-indicator-scale, 0.5 1);
|
|
133
163
|
transition: opacity var(--bk-duration) var(--bk-ease), scale var(--bk-duration) var(--bk-ease);
|
|
134
164
|
}
|
|
135
|
-
|
|
165
|
+
.item.current::after { opacity: 1; scale: 1; }
|
|
136
166
|
@media (forced-colors: active) {
|
|
137
167
|
.item::after { background: Highlight; }
|
|
138
|
-
|
|
168
|
+
.item.current { outline: var(--bk-border-width) solid Highlight; }
|
|
169
|
+
span.item:focus-visible { outline: var(--bk-focus-ring); }
|
|
139
170
|
}
|
|
140
171
|
`];
|
|
141
172
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
* The content for one tab of a `<bk-tabs>`. Use it only as a direct child of `<bk-tabs>`. The
|
|
4
|
-
*
|
|
5
|
-
* selected.
|
|
3
|
+
* The content for one tab of a `<bk-tabs>`. Use it only as a direct child of `<bk-tabs>`. The panel has the role
|
|
4
|
+
* `tabpanel`. The tabs element gives it its tab (`setTab()`, the name of the panel), sets `tabindex="0"` when the
|
|
5
|
+
* panel has no `tabindex`, and hides the panel while its tab is not selected.
|
|
6
6
|
*
|
|
7
7
|
* A closed panel has `hidden="until-found"`: Ctrl+F and `#fragment` links find text in it, and the tabs select its tab.
|
|
8
8
|
*
|
|
@@ -20,7 +20,10 @@ export declare class BkTabsPanel extends LitElement {
|
|
|
20
20
|
};
|
|
21
21
|
/** Value of the `<bk-tabs-item>` that shows this panel. */
|
|
22
22
|
value: string;
|
|
23
|
+
private readonly internals;
|
|
23
24
|
constructor();
|
|
25
|
+
/** `<bk-tabs>` calls it on each update: the tab that names the panel (`null`: none). An app does not call it. */
|
|
26
|
+
setTab(tab: Element | null): void;
|
|
24
27
|
static styles: import("lit").CSSResult[];
|
|
25
28
|
render(): import("lit-html").TemplateResult<1>;
|
|
26
29
|
}
|
|
@@ -5,9 +5,15 @@ class BkTabsPanel extends LitElement {
|
|
|
5
5
|
static properties = {
|
|
6
6
|
value: { reflect: true, useDefault: true }
|
|
7
7
|
};
|
|
8
|
+
internals = this.attachInternals();
|
|
8
9
|
constructor() {
|
|
9
10
|
super();
|
|
10
11
|
this.value = "";
|
|
12
|
+
this.internals.role = "tabpanel";
|
|
13
|
+
}
|
|
14
|
+
/** `<bk-tabs>` calls it on each update: the tab that names the panel (`null`: none). An app does not call it. */
|
|
15
|
+
setTab(tab) {
|
|
16
|
+
this.internals.ariaLabelledByElements = tab ? [tab] : null;
|
|
11
17
|
}
|
|
12
18
|
static styles = [base, css`
|
|
13
19
|
:host {
|