@bk2k/ui 0.6.8 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BUILDING.md +56 -2
- package/CHANGELOG.md +199 -0
- package/USAGE.md +102 -28
- package/custom-elements.json +1 -1
- package/dist/charts/chart-tokens.js +1 -1
- package/dist/charts/fields.d.ts +20 -0
- package/dist/charts/fields.js +27 -0
- package/dist/charts/frame.d.ts +2 -0
- package/dist/charts/frame.js +2 -1
- package/dist/clipboard.js +1 -0
- package/dist/components/bk-alert.js +3 -2
- package/dist/components/bk-avatar-group.js +4 -6
- package/dist/components/bk-avatar.d.ts +10 -0
- package/dist/components/bk-avatar.js +17 -0
- package/dist/components/bk-bar.js +2 -0
- package/dist/components/bk-button-group.js +1 -1
- package/dist/components/bk-button-top.js +2 -1
- package/dist/components/bk-button.d.ts +42 -14
- package/dist/components/bk-button.js +67 -20
- package/dist/components/bk-card.d.ts +7 -0
- package/dist/components/bk-card.js +21 -2
- package/dist/components/bk-carousel-controls.d.ts +2 -0
- package/dist/components/bk-carousel-controls.js +4 -2
- package/dist/components/bk-chart-area.d.ts +10 -0
- package/dist/components/bk-chart-bar.d.ts +17 -0
- package/dist/components/bk-chart-bar.js +25 -4
- package/dist/components/bk-chart-line.d.ts +28 -0
- package/dist/components/bk-chart-line.js +27 -7
- package/dist/components/bk-chip-group.d.ts +2 -2
- package/dist/components/bk-chip-group.js +4 -0
- package/dist/components/bk-chip.d.ts +55 -8
- package/dist/components/bk-chip.js +46 -8
- package/dist/components/bk-code.js +6 -2
- package/dist/components/bk-columns.d.ts +11 -0
- package/dist/components/bk-columns.js +8 -1
- package/dist/components/bk-combobox.d.ts +3 -3
- package/dist/components/bk-combobox.js +9 -21
- package/dist/components/bk-delta.d.ts +10 -0
- package/dist/components/bk-delta.js +8 -6
- package/dist/components/bk-dialog.d.ts +12 -5
- package/dist/components/bk-dialog.js +14 -6
- package/dist/components/bk-disclosure.js +4 -2
- package/dist/components/bk-drop-target.d.ts +7 -1
- package/dist/components/bk-drop-target.js +20 -4
- package/dist/components/bk-error-summary.d.ts +5 -0
- package/dist/components/bk-error-summary.js +13 -4
- package/dist/components/bk-facts.js +3 -2
- package/dist/components/bk-footnote.d.ts +73 -0
- package/dist/components/bk-footnote.js +97 -0
- package/dist/components/bk-footnotes-item.d.ts +92 -0
- package/dist/components/bk-footnotes-item.js +139 -0
- package/dist/components/bk-footnotes.d.ts +51 -0
- package/dist/components/bk-footnotes.js +43 -0
- package/dist/components/bk-icon.js +2 -2
- package/dist/components/bk-image-compare.d.ts +69 -6
- package/dist/components/bk-image-compare.js +116 -32
- package/dist/components/bk-image-crop.d.ts +3 -3
- package/dist/components/bk-image-editor.d.ts +1 -1
- package/dist/components/bk-image-viewer.d.ts +178 -11
- package/dist/components/bk-image-viewer.js +310 -52
- package/dist/components/bk-input-color.d.ts +2 -5
- package/dist/components/bk-input-color.js +0 -14
- package/dist/components/bk-input-file.d.ts +17 -0
- package/dist/components/bk-input-file.js +18 -8
- package/dist/components/bk-input-inline.d.ts +15 -6
- package/dist/components/bk-input-inline.js +22 -6
- package/dist/components/bk-input-number.js +2 -1
- package/dist/components/bk-input-search.d.ts +1 -1
- package/dist/components/bk-input-search.js +2 -1
- package/dist/components/bk-input-tags.d.ts +219 -0
- package/dist/components/bk-input-tags.js +293 -0
- package/dist/components/bk-input-text.d.ts +20 -0
- package/dist/components/bk-input-text.js +34 -4
- package/dist/components/bk-input-time.js +2 -1
- package/dist/components/bk-item.js +2 -1
- package/dist/components/bk-lightbox.d.ts +37 -4
- package/dist/components/bk-lightbox.js +13 -3
- package/dist/components/bk-link.d.ts +9 -1
- package/dist/components/bk-link.js +14 -4
- package/dist/components/bk-menu-item.d.ts +40 -0
- package/dist/components/bk-menu-item.js +57 -9
- package/dist/components/bk-menu-label.js +2 -1
- package/dist/components/bk-menu-list.d.ts +1 -0
- package/dist/components/bk-menu-list.js +10 -0
- package/dist/components/bk-menu.d.ts +8 -1
- package/dist/components/bk-menu.js +16 -5
- package/dist/components/bk-message-feedback.d.ts +4 -3
- package/dist/components/bk-message-feedback.js +7 -5
- package/dist/components/bk-message-list.js +2 -1
- package/dist/components/bk-message-source.d.ts +1 -2
- package/dist/components/bk-message-source.js +3 -11
- package/dist/components/bk-message.js +2 -0
- package/dist/components/bk-nav-group.js +1 -1
- package/dist/components/bk-nav-item.d.ts +18 -0
- package/dist/components/bk-nav-item.js +18 -5
- package/dist/components/bk-nav.d.ts +1 -1
- package/dist/components/bk-page-cta.d.ts +2 -0
- package/dist/components/bk-page-cta.js +10 -1
- package/dist/components/bk-page-section.d.ts +1 -1
- package/dist/components/bk-page-section.js +3 -9
- package/dist/components/bk-pane.d.ts +1 -0
- package/dist/components/bk-pane.js +7 -5
- package/dist/components/bk-panel.d.ts +1 -1
- package/dist/components/bk-panel.js +6 -5
- package/dist/components/bk-picture.d.ts +17 -4
- package/dist/components/bk-picture.js +8 -1
- package/dist/components/bk-segmented-item.d.ts +24 -4
- package/dist/components/bk-segmented-item.js +37 -5
- package/dist/components/bk-segmented.js +2 -13
- package/dist/components/bk-select-cascade.d.ts +1 -1
- package/dist/components/bk-select-tree.d.ts +1 -1
- package/dist/components/bk-select.d.ts +1 -1
- package/dist/components/bk-shell-app.d.ts +10 -4
- package/dist/components/bk-shell-app.js +32 -9
- package/dist/components/bk-shell-sites.d.ts +2 -1
- package/dist/components/bk-shell-sites.js +3 -5
- package/dist/components/bk-sortable.js +7 -17
- package/dist/components/bk-split-grid.d.ts +104 -3
- package/dist/components/bk-split-grid.js +430 -2
- package/dist/components/bk-stat-group.js +2 -1
- package/dist/components/bk-stat.d.ts +19 -0
- package/dist/components/bk-stat.js +8 -4
- package/dist/components/bk-steps.js +2 -1
- package/dist/components/bk-surface.d.ts +2 -0
- package/dist/components/bk-surface.js +6 -3
- package/dist/components/bk-table.d.ts +3 -1
- package/dist/components/bk-table.js +10 -13
- package/dist/components/bk-tabs-item.d.ts +45 -7
- package/dist/components/bk-tabs-item.js +51 -20
- package/dist/components/bk-tabs-panel.d.ts +6 -3
- package/dist/components/bk-tabs-panel.js +6 -0
- package/dist/components/bk-tabs.d.ts +52 -8
- package/dist/components/bk-tabs.js +181 -97
- package/dist/components/bk-text.js +2 -1
- package/dist/components/bk-toast-group.d.ts +3 -1
- package/dist/components/bk-toast-group.js +11 -1
- package/dist/components/bk-tooltip.d.ts +3 -1
- package/dist/components/bk-tooltip.js +2 -1
- package/dist/components/bk-video.js +2 -2
- package/dist/components/bk-zoom.d.ts +3 -1
- package/dist/components/confirm.d.ts +15 -0
- package/dist/components/confirm.js +27 -4
- package/dist/i18n/de.js +12 -1
- package/dist/i18n/en.d.ts +2 -0
- package/dist/i18n/en.js +3 -0
- package/dist/i18n.d.ts +16 -2
- package/dist/i18n.js +28 -4
- package/dist/icons/brands-static.d.ts +3 -0
- package/dist/icons/brands-static.js +5 -0
- package/dist/icons/core.d.ts +1 -0
- package/dist/icons/core.js +2 -0
- package/dist/icons/load-static.d.ts +3 -0
- package/dist/icons/load-static.js +5 -0
- package/dist/icons/load.js +1 -0
- package/dist/icons/registry.js +1 -1
- package/dist/icons/set/save-as.d.ts +3 -0
- package/dist/icons/set/save-as.js +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/internal/announcer.d.ts +14 -1
- package/dist/internal/announcer.js +33 -12
- package/dist/internal/backdrop.d.ts +19 -0
- package/dist/internal/backdrop.js +29 -0
- package/dist/internal/busy.d.ts +3 -2
- package/dist/internal/busy.js +4 -5
- package/dist/internal/choice-field.js +1 -1
- package/dist/internal/choice-item.d.ts +17 -6
- package/dist/internal/choice-item.js +20 -9
- package/dist/internal/cloak.js +4 -0
- package/dist/internal/crop-frame.d.ts +1 -1
- package/dist/internal/crop-frame.js +2 -7
- package/dist/internal/date-field.js +2 -1
- package/dist/internal/define.d.ts +9 -0
- package/dist/internal/define.js +47 -1
- package/dist/internal/drag.d.ts +11 -0
- package/dist/internal/drag.js +23 -0
- package/dist/internal/elements.d.ts +6 -0
- package/dist/internal/elements.js +5 -0
- package/dist/internal/english-static.d.ts +3 -0
- package/dist/internal/english-static.js +5 -0
- package/dist/internal/english.d.ts +8 -0
- package/dist/internal/english.js +6 -0
- package/dist/internal/footnotes.d.ts +56 -0
- package/dist/internal/footnotes.js +143 -0
- package/dist/internal/handle-menu.js +2 -5
- package/dist/internal/hue.d.ts +8 -0
- package/dist/internal/hue.js +15 -4
- package/dist/internal/late/bk-shell-app.d.ts +4 -0
- package/dist/internal/late/bk-shell-app.js +7 -0
- package/dist/internal/late/bk-table.d.ts +4 -0
- package/dist/internal/late/bk-table.js +17 -0
- package/dist/internal/late/bk-tabs.d.ts +4 -0
- package/dist/internal/late/bk-tabs.js +8 -0
- package/dist/internal/late/handle-menu.d.ts +4 -0
- package/dist/internal/late/handle-menu.js +9 -0
- package/dist/internal/late/static.d.ts +7 -0
- package/dist/internal/late/static.js +5 -0
- package/dist/internal/late.d.ts +8 -3
- package/dist/internal/late.js +19 -4
- package/dist/internal/link.d.ts +2 -0
- package/dist/internal/link.js +11 -1
- package/dist/internal/own-text.d.ts +8 -0
- package/dist/internal/own-text.js +7 -0
- package/dist/internal/scope.js +1 -1
- package/dist/internal/scroll-lock.d.ts +4 -1
- package/dist/internal/scroll-lock.js +17 -4
- package/dist/internal/slider.js +2 -1
- package/dist/internal/styles.js +3 -0
- package/dist/internal/submit.d.ts +23 -0
- package/dist/internal/submit.js +57 -0
- package/dist/internal/tags.d.ts +15 -0
- package/dist/internal/tags.js +44 -0
- package/dist/internal/text-field.d.ts +2 -0
- package/dist/internal/text-field.js +8 -0
- package/dist/internal/toggle-control.js +3 -1
- package/dist/jsx.d.ts +222 -54
- package/dist/kit.d.ts +1 -0
- package/dist/kit.js +3 -0
- package/dist/reset.css +10 -0
- package/dist/standalone/all.js +226 -221
- package/dist/standalone/appearance.js +1 -1
- package/dist/standalone/bk-accordion-item.js +4 -4
- package/dist/standalone/bk-accordion.js +2 -2
- package/dist/standalone/bk-action-bar.js +3 -3
- package/dist/standalone/bk-alert-offline.js +1 -2
- package/dist/standalone/bk-alert.js +17 -13
- package/dist/standalone/bk-app-state.js +1 -1
- package/dist/standalone/bk-attachment.js +4 -4
- package/dist/standalone/bk-avatar-group.js +12 -10
- package/dist/standalone/bk-avatar.js +15 -5
- package/dist/standalone/bk-badge.js +2 -2
- package/dist/standalone/bk-bar.js +3 -1
- package/dist/standalone/bk-brand.js +3 -3
- package/dist/standalone/bk-breadcrumbs.js +5 -5
- package/dist/standalone/bk-button-copy.js +7 -7
- package/dist/standalone/bk-button-group.js +5 -5
- package/dist/standalone/bk-button-share.js +7 -7
- package/dist/standalone/bk-button-top.js +9 -8
- package/dist/standalone/bk-button.js +74 -34
- package/dist/standalone/bk-calendar-event.js +1 -1
- package/dist/standalone/bk-calendar-week.js +3 -3
- package/dist/standalone/bk-calendar.js +4 -4
- package/dist/standalone/bk-card.js +26 -7
- package/dist/standalone/bk-carousel-controls.js +7 -6
- package/dist/standalone/bk-carousel-item.js +2 -2
- package/dist/standalone/bk-carousel.js +1 -1
- package/dist/standalone/bk-chart-area.js +1 -1
- package/dist/standalone/bk-chart-bar-list.js +8 -8
- package/dist/standalone/bk-chart-bar.js +145 -117
- package/dist/standalone/bk-chart-bridge.js +7 -7
- package/dist/standalone/bk-chart-bullet.js +6 -6
- package/dist/standalone/bk-chart-calendar.js +7 -7
- package/dist/standalone/bk-chart-heatmap.js +7 -7
- package/dist/standalone/bk-chart-histogram.js +5 -5
- package/dist/standalone/bk-chart-legend.js +6 -6
- package/dist/standalone/bk-chart-line.js +128 -107
- package/dist/standalone/bk-chart-mark.js +1 -1
- package/dist/standalone/bk-chart-scatter.js +6 -6
- package/dist/standalone/bk-chart-sparkline.js +6 -6
- package/dist/standalone/bk-chart-stacked-bar.js +7 -7
- package/dist/standalone/bk-chart-tracker.js +6 -6
- package/dist/standalone/bk-chart-waterfall.js +6 -6
- package/dist/standalone/bk-checkbox-group.js +7 -7
- package/dist/standalone/bk-checkbox.js +4 -4
- package/dist/standalone/bk-chip-group.js +11 -7
- package/dist/standalone/bk-chip.js +59 -18
- package/dist/standalone/bk-cluster.js +1 -1
- package/dist/standalone/bk-code-diff.js +4 -4
- package/dist/standalone/bk-code-stack.js +4 -4
- package/dist/standalone/bk-code.js +10 -6
- package/dist/standalone/bk-color-panel.js +5 -5
- package/dist/standalone/bk-columns.js +13 -5
- package/dist/standalone/bk-combobox.js +23 -31
- package/dist/standalone/bk-command-menu.js +6 -6
- package/dist/standalone/bk-command-palette.js +8 -7
- package/dist/standalone/bk-composer.js +6 -6
- package/dist/standalone/bk-delta.js +11 -10
- package/dist/standalone/bk-diagram.js +1 -1
- package/dist/standalone/bk-dialog.js +1 -1
- package/dist/standalone/bk-disclosure.js +7 -5
- package/dist/standalone/bk-divider.js +5 -5
- package/dist/standalone/bk-drawer.js +3 -3
- package/dist/standalone/bk-drop-target.js +12 -6
- package/dist/standalone/bk-empty-state.js +3 -3
- package/dist/standalone/bk-error-summary.js +9 -6
- package/dist/standalone/bk-facts-item.js +2 -2
- package/dist/standalone/bk-facts.js +9 -8
- package/dist/standalone/bk-feature.js +3 -3
- package/dist/standalone/bk-fieldset.js +3 -3
- package/dist/standalone/bk-filter-bar.js +4 -4
- package/dist/standalone/bk-folder-browser.js +4 -4
- package/dist/standalone/bk-footnote.js +82 -0
- package/dist/standalone/bk-footnotes-item.js +122 -0
- package/dist/standalone/bk-footnotes.js +37 -0
- package/dist/standalone/bk-form-guard.js +2 -2
- package/dist/standalone/bk-form-steps.js +3 -3
- package/dist/standalone/bk-grid.js +1 -1
- package/dist/standalone/bk-icon-tile.js +3 -3
- package/dist/standalone/bk-icon.js +1 -1
- package/dist/standalone/bk-image-compare.js +127 -58
- package/dist/standalone/bk-image-crop.js +6 -6
- package/dist/standalone/bk-image-editor.js +1 -1
- package/dist/standalone/bk-image-viewer.js +283 -92
- package/dist/standalone/bk-input-code.js +4 -4
- package/dist/standalone/bk-input-color.js +4 -14
- package/dist/standalone/bk-input-date-range.js +2 -2
- package/dist/standalone/bk-input-date.js +2 -2
- package/dist/standalone/bk-input-file.js +22 -15
- package/dist/standalone/bk-input-group.js +4 -4
- package/dist/standalone/bk-input-inline.js +17 -10
- package/dist/standalone/bk-input-number.js +9 -8
- package/dist/standalone/bk-input-rating.js +6 -6
- package/dist/standalone/bk-input-rich.js +1 -1
- package/dist/standalone/bk-input-search.js +23 -22
- package/dist/standalone/bk-input-slider-range.js +5 -5
- package/dist/standalone/bk-input-slider.js +5 -5
- package/dist/standalone/bk-input-tags.js +224 -0
- package/dist/standalone/bk-input-text.js +1 -1
- package/dist/standalone/bk-input-time-zone.js +1 -1
- package/dist/standalone/bk-input-time.js +29 -28
- package/dist/standalone/bk-item-group.js +3 -3
- package/dist/standalone/bk-item.js +12 -11
- package/dist/standalone/bk-kbd-shortcuts.js +4 -3
- package/dist/standalone/bk-kbd.js +68 -1
- package/dist/standalone/bk-lightbox.js +24 -7
- package/dist/standalone/bk-lines.js +1 -1
- package/dist/standalone/bk-link.js +33 -19
- package/dist/standalone/bk-listbox-columns.js +8 -8
- package/dist/standalone/bk-listbox-item.js +1 -1
- package/dist/standalone/bk-listbox-search.js +7 -7
- package/dist/standalone/bk-listbox-transfer.js +6 -6
- package/dist/standalone/bk-listbox.js +7 -7
- package/dist/standalone/bk-logo-wall.js +2 -2
- package/dist/standalone/bk-logo.js +4 -4
- package/dist/standalone/bk-menu-bar.js +3 -3
- package/dist/standalone/bk-menu-context.js +1 -1
- package/dist/standalone/bk-menu-divider.js +2 -2
- package/dist/standalone/bk-menu-item.js +73 -29
- package/dist/standalone/bk-menu-label.js +7 -6
- package/dist/standalone/bk-menu-list.js +10 -4
- package/dist/standalone/bk-menu.js +19 -10
- package/dist/standalone/bk-message-approval.js +4 -4
- package/dist/standalone/bk-message-branches.js +3 -3
- package/dist/standalone/bk-message-citation.js +10 -10
- package/dist/standalone/bk-message-feedback.js +10 -6
- package/dist/standalone/bk-message-list.js +6 -5
- package/dist/standalone/bk-message-reasoning.js +5 -5
- package/dist/standalone/bk-message-source.js +13 -21
- package/dist/standalone/bk-message-tool-group.js +5 -5
- package/dist/standalone/bk-message-tool.js +5 -5
- package/dist/standalone/bk-message.js +6 -4
- package/dist/standalone/bk-meter.js +3 -3
- package/dist/standalone/bk-model-viewer.js +1 -1
- package/dist/standalone/bk-nav-divider.js +2 -2
- package/dist/standalone/bk-nav-group.js +9 -9
- package/dist/standalone/bk-nav-item.js +31 -23
- package/dist/standalone/bk-nav-toc.js +3 -3
- package/dist/standalone/bk-nav.js +3 -3
- package/dist/standalone/bk-overflow.js +3 -3
- package/dist/standalone/bk-page-cta.js +13 -4
- package/dist/standalone/bk-page-footer-column.js +2 -2
- package/dist/standalone/bk-page-footer.js +3 -3
- package/dist/standalone/bk-page-header.js +3 -3
- package/dist/standalone/bk-page-hero.js +3 -3
- package/dist/standalone/bk-page-pager.js +5 -5
- package/dist/standalone/bk-page-section.js +6 -6
- package/dist/standalone/bk-pagination.js +6 -6
- package/dist/standalone/bk-pane.js +10 -9
- package/dist/standalone/bk-panel.js +9 -10
- package/dist/standalone/bk-period-nav.js +4 -4
- package/dist/standalone/bk-picture.js +1 -166
- package/dist/standalone/bk-popover-help.js +3 -3
- package/dist/standalone/bk-popover.js +2 -2
- package/dist/standalone/bk-presence-cursor.js +3 -3
- package/dist/standalone/bk-preview.js +4 -4
- package/dist/standalone/bk-progress.js +3 -3
- package/dist/standalone/bk-prose.js +3 -3
- package/dist/standalone/bk-qr-code.js +1 -1
- package/dist/standalone/bk-radio-group.js +7 -7
- package/dist/standalone/bk-radio.js +3 -3
- package/dist/standalone/bk-rating.js +5 -5
- package/dist/standalone/bk-scroll.js +3 -3
- package/dist/standalone/bk-segmented-item.js +40 -16
- package/dist/standalone/bk-segmented.js +17 -15
- package/dist/standalone/bk-select-cascade.js +3 -3
- package/dist/standalone/bk-select-tree.js +4 -4
- package/dist/standalone/bk-select.js +5 -5
- package/dist/standalone/bk-shell-app.js +1 -1221
- package/dist/standalone/bk-shell-centered.js +2 -2
- package/dist/standalone/bk-shell-sites.js +5 -7
- package/dist/standalone/bk-skeleton.js +2 -2
- package/dist/standalone/bk-sortable.js +55 -60
- package/dist/standalone/bk-spinner.js +2 -2
- package/dist/standalone/bk-split-grid.js +324 -44
- package/dist/standalone/bk-split.js +8 -8
- package/dist/standalone/bk-stack.js +1 -1
- package/dist/standalone/bk-stat-group.js +8 -7
- package/dist/standalone/bk-stat.js +12 -9
- package/dist/standalone/bk-status-dot.js +3 -3
- package/dist/standalone/bk-steps-item.js +5 -5
- package/dist/standalone/bk-steps.js +8 -7
- package/dist/standalone/bk-surface.js +1 -1
- package/dist/standalone/bk-swatch-group.js +8 -8
- package/dist/standalone/bk-swatch-palette.js +1 -1
- package/dist/standalone/bk-swatch.js +2 -2
- package/dist/standalone/bk-switch.js +4 -4
- package/dist/standalone/bk-table.js +1 -1937
- package/dist/standalone/bk-tabs-item.js +58 -35
- package/dist/standalone/bk-tabs-panel.js +7 -3
- package/dist/standalone/bk-tabs.js +3 -352
- package/dist/standalone/bk-tasks-item.js +4 -4
- package/dist/standalone/bk-tasks.js +2 -2
- package/dist/standalone/bk-testimonial.js +3 -3
- package/dist/standalone/bk-text.js +21 -20
- package/dist/standalone/bk-time-countdown.js +4 -4
- package/dist/standalone/bk-time-relative.js +3 -3
- package/dist/standalone/bk-timeline-item.js +4 -4
- package/dist/standalone/bk-timeline.js +2 -2
- package/dist/standalone/bk-toast-group.js +1 -1
- package/dist/standalone/bk-toast.js +4 -4
- package/dist/standalone/bk-toolbar.js +2 -2
- package/dist/standalone/bk-tooltip.js +8 -7
- package/dist/standalone/bk-tree-item.js +6 -6
- package/dist/standalone/bk-tree.js +5 -5
- package/dist/standalone/bk-video.js +6 -6
- package/dist/standalone/bk-visually-hidden.js +2 -2
- package/dist/standalone/bk-zoom.js +5 -5
- package/dist/standalone/chunks/announcer-6tMlCOq1.js +41 -0
- package/dist/standalone/chunks/{appearance-waHnV0kk.js → appearance-CBOJXbmC.js} +1 -1
- package/dist/standalone/chunks/{bk-alert-offline-B1bQxOZp.js → bk-alert-offline-hCLuG-RM.js} +3 -3
- package/dist/standalone/chunks/{bk-carousel-BCwIQhG5.js → bk-carousel-_dudBMVq.js} +4 -4
- package/dist/standalone/chunks/{bk-diagram-DWK8CvRZ.js → bk-diagram-BB2odomE.js} +5 -5
- package/dist/standalone/chunks/{bk-dialog-DX0cPJ1o.js → bk-dialog-DcvwnOtN.js} +59 -25
- package/dist/standalone/chunks/{bk-icon-DssFsNuB.js → bk-icon-D4kI4F18.js} +4 -3
- package/dist/standalone/chunks/{bk-image-editor-DXEj9gCu.js → bk-image-editor-SRVkHI-4.js} +5 -5
- package/dist/standalone/chunks/{bk-input-date-range-Cbx_lpf0.js → bk-input-date-range-C0Vd-p0T.js} +2 -2
- package/dist/standalone/chunks/{bk-input-rich-ZB68vziu.js → bk-input-rich-AmDv87E5.js} +6 -6
- package/dist/standalone/chunks/{bk-input-text-DD32uWNO.js → bk-input-text-2n89GDIT.js} +73 -54
- package/dist/standalone/chunks/{bk-model-viewer-Dr81ahVv.js → bk-model-viewer-BoNYBd6W.js} +4 -4
- package/dist/standalone/chunks/bk-picture-CA5gLxgZ.js +186 -0
- package/dist/standalone/chunks/{bk-qr-code-QaYvZwOR.js → bk-qr-code-CSFfc8As.js} +3 -3
- package/dist/standalone/chunks/bk-shell-app-BlCOG25y.js +1236 -0
- package/dist/standalone/chunks/{bk-surface-DkIhrWMt.js → bk-surface-BULRdKam.js} +9 -7
- package/dist/standalone/chunks/{bk-swatch-palette-BNNXTP3w.js → bk-swatch-palette-Cqj85tSW.js} +6 -6
- package/dist/standalone/chunks/bk-table-DWlD7yoM.js +1945 -0
- package/dist/standalone/chunks/bk-tabs-STkr3-E1.js +422 -0
- package/dist/standalone/chunks/{bk-toast-group-BSeO_rPs.js → bk-toast-group-5nZg7BaJ.js} +27 -24
- package/dist/standalone/chunks/{brush-Bn3lPdHN.js → brush-DALmXSru.js} +18 -2
- package/dist/standalone/chunks/{busy-B7Mxemwm.js → busy-eG3uHonz.js} +5 -4
- package/dist/standalone/chunks/{chart-tokens-D1Exf7BW.js → chart-tokens-DQ4hVSmn.js} +2 -2
- package/dist/standalone/chunks/{choice-field-CGvE4tyb.js → choice-field-B0oe_9fI.js} +6 -6
- package/dist/standalone/chunks/{choice-item-B6-9ZRlf.js → choice-item-Cx-nm1js.js} +17 -8
- package/dist/standalone/chunks/{clipboard-Crzt1Sh9.js → clipboard-RqIeP9Uz.js} +1 -1
- package/dist/standalone/chunks/{clipboard-BKlrP5rj.js → clipboard-UVLSkL4C.js} +1 -1
- package/dist/standalone/chunks/{crop-frame-poLCGrBG.js → crop-frame-Z9N0QML4.js} +1 -11
- package/dist/standalone/chunks/{date-field-BlI6grfT.js → date-field-Dy1_qxNv.js} +48 -47
- package/dist/standalone/chunks/define-6OfuRn5c.js +60 -0
- package/dist/standalone/chunks/drag-DT4__0t9.js +12 -0
- package/dist/standalone/chunks/footnotes-BeisMxLk.js +94 -0
- package/dist/standalone/chunks/{form-control-CyXQIJ2x.js → form-control-Bmk0SRDX.js} +2 -2
- package/dist/standalone/chunks/{frame-abXBnl8a.js → frame-xIMVEUCi.js} +5 -4
- package/dist/standalone/chunks/{handle-menu-ZVR_msk2.js → handle-menu-BAe9fPYJ.js} +14 -33
- package/dist/standalone/chunks/{heading-text-CV5gBf7k.js → heading-text-B2kF-b8p.js} +1 -1
- package/dist/standalone/chunks/hue-vLbNdAEl.js +20 -0
- package/dist/standalone/chunks/{i18n-B6Al9xCK.js → i18n-DFfGgd3d.js} +49 -34
- package/dist/standalone/chunks/{i18n-BI16HQmm.js → i18n-DQAcbHkY.js} +1 -1
- package/dist/standalone/chunks/late-CPQ_RbU-.js +30 -0
- package/dist/standalone/chunks/link--YWr8exL.js +69 -0
- package/dist/standalone/chunks/{marks-0kbeB4n8.js → marks-pOUDNUf1.js} +2 -2
- package/dist/standalone/chunks/{options-DMEc8rQt.js → options-ySaDL-dW.js} +2 -2
- package/dist/standalone/chunks/own-text-mpZVnMyX.js +5 -0
- package/dist/standalone/chunks/{palettes-CKLHSIPx.js → palettes-J4bQ21ks.js} +2 -2
- package/dist/standalone/chunks/{popover-base-ac49G87f.js → popover-base-hxo-Vh6E.js} +2 -2
- package/dist/standalone/chunks/{prose-BG4oQH-i.js → prose-BiuJgiah.js} +1 -1
- package/dist/standalone/chunks/{ramp-ggoyjMvC.js → ramp-CGDOcqBZ.js} +1 -1
- package/dist/standalone/chunks/save-as-DBGZjczB.js +6 -0
- package/dist/standalone/chunks/shortcuts-DPxCSO4M.js +210 -0
- package/dist/standalone/chunks/{slider-BWT8Fmwz.js → slider-jp3d-Ld-.js} +15 -14
- package/dist/standalone/chunks/{stars-BN9M_9Q1.js → stars-BAUc_LqI.js} +1 -1
- package/dist/standalone/chunks/{styles-DwSR-9a3.js → styles-CaeyhYDA.js} +3 -0
- package/dist/standalone/chunks/submit-BjBGB8OW.js +42 -0
- package/dist/standalone/chunks/{summary-BK-B4m5A.js → summary-W5s0TFqV.js} +1 -1
- package/dist/standalone/chunks/tags-CMLAGsVw.js +37 -0
- package/dist/standalone/chunks/{text-field-4IUUpRHE.js → text-field-CufOGdfr.js} +17 -11
- package/dist/standalone/chunks/{toggle-control-ioV2jhNY.js → toggle-control-Cgqp1jhf.js} +5 -3
- package/dist/standalone/chunks/{tokens-BuahF1lF.js → tokens-C_ul7pL9.js} +4 -3
- package/dist/standalone/chunks/{virtual-B-1oN14Y.js → virtual-D-qgACnE.js} +1 -1
- package/dist/standalone/confirm.js +27 -14
- package/dist/standalone/i18n-de.js +13 -2
- package/dist/standalone/icons.js +100 -98
- package/dist/standalone/links.js +1 -1
- package/dist/standalone/reset.css +10 -0
- package/dist/standalone/toast.js +1 -1
- package/dist/standalone/tokens.css +6 -5
- package/dist/tokens.css +6 -5
- package/dist/tokens.js +4 -3
- package/package.json +25 -2
- package/dist/standalone/chunks/announcer-haFcvqbe.js +0 -25
- package/dist/standalone/chunks/bk-kbd-B_TlKzWj.js +0 -275
- package/dist/standalone/chunks/define-CzVPD4Zi.js +0 -30
- package/dist/standalone/chunks/hue-Jvb-141g.js +0 -14
- package/dist/standalone/chunks/keyed-CZ2AaouM.js +0 -16
- package/dist/standalone/chunks/link-CWSMsx04.js +0 -60
|
@@ -30,7 +30,8 @@ class BkCard extends LitElement {
|
|
|
30
30
|
};
|
|
31
31
|
slots = new SlotController(this);
|
|
32
32
|
i18n = new LocalizeController(this);
|
|
33
|
-
|
|
33
|
+
internals = this.attachInternals();
|
|
34
|
+
busyState = new BusyController(this, this.i18n, this.internals);
|
|
34
35
|
links = new LinkController(this);
|
|
35
36
|
sizes = resizeObserver(([entry]) => {
|
|
36
37
|
const size = entry.borderBoxSize?.[0]?.inlineSize ?? 0;
|
|
@@ -80,8 +81,20 @@ class BkCard extends LitElement {
|
|
|
80
81
|
--bk-ground: var(--bk-card-bg, var(--bk-layer-raised-bg)); --bk-ground-tint: transparent;
|
|
81
82
|
border: var(--bk-card-border-width, var(--bk-border-width)) solid var(--bk-card-border, var(--bk-layer-raised-border));
|
|
82
83
|
border-radius: var(--bk-card-radius, var(--bk-radius-container, var(--bk-radius-lg))); box-shadow: var(--bk-card-shadow, var(--bk-layer-raised-shadow));
|
|
83
|
-
text-decoration: none; transition: box-shadow var(--bk-duration), border-color var(--bk-duration);
|
|
84
|
+
text-decoration: none; transition: box-shadow var(--bk-duration), border-color var(--bk-duration), translate var(--bk-duration) var(--bk-ease);
|
|
84
85
|
}
|
|
86
|
+
/* The rings: an image over the border, cut to a ring in the radius of the card. ::before is the ring at rest,
|
|
87
|
+
::after the ring of a card with href on hover. The card clips its content, so the rings are on the host. */
|
|
88
|
+
:host { position: relative; }
|
|
89
|
+
:host::before, :host([href])::after {
|
|
90
|
+
content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
|
|
91
|
+
padding: var(--bk-card-border-width, var(--bk-border-width));
|
|
92
|
+
mask: linear-gradient(currentColor 0 0) content-box exclude, linear-gradient(currentColor 0 0);
|
|
93
|
+
transition: opacity var(--bk-duration), translate var(--bk-duration) var(--bk-ease);
|
|
94
|
+
}
|
|
95
|
+
:host::before { background: var(--bk-card-ring, none); }
|
|
96
|
+
:host([selected])::before { display: none; }
|
|
97
|
+
:host([href])::after { background: var(--bk-card-ring-hover, linear-gradient(135deg, var(--bk-accent-solid), var(--bk-info-solid))); opacity: 0; }
|
|
85
98
|
:host([variant="elevated"]) .card { border-color: transparent; box-shadow: var(--bk-card-shadow, var(--bk-layer-overlay-shadow)); }
|
|
86
99
|
:host([variant="flat"]) .card { border-color: transparent; box-shadow: none; background: var(--bk-card-bg, var(--bk-layer-sunken-bg)); --bk-ground: var(--bk-card-bg, var(--bk-layer-sunken-bg)); }
|
|
87
100
|
/* Tone: the tint lies over the layer background, so --bk-card-bg stays the base. */
|
|
@@ -100,7 +113,13 @@ class BkCard extends LitElement {
|
|
|
100
113
|
:host([href]) .overlay { z-index: 2; }
|
|
101
114
|
@media (hover: hover) {
|
|
102
115
|
:host([href]) .card:hover { box-shadow: var(--bk-card-shadow-hover, var(--bk-layer-overlay-shadow)); border-color: var(--bk-card-border-hover, var(--bk-line-mid)); }
|
|
116
|
+
:host([href]:not([selected]):hover)::after { opacity: 1; }
|
|
117
|
+
:host([href]:not([selected]):hover) .card, :host([href]:not([selected]):hover)::before, :host([href]:not([selected]):hover)::after {
|
|
118
|
+
translate: 0 calc(-1 * var(--bk-card-lift-hover, round(var(--bk-space-0), 1px)));
|
|
119
|
+
}
|
|
103
120
|
}
|
|
121
|
+
@media (prefers-reduced-motion: reduce) { :host([href]:hover) .card, :host([href]:hover)::before, :host([href]:hover)::after { translate: none; } }
|
|
122
|
+
@media (forced-colors: active) { :host::before, :host([href])::after { display: none; } }
|
|
104
123
|
.card:has(> .cover:active) { box-shadow: var(--bk-card-shadow, var(--bk-layer-raised-shadow)); background-image: linear-gradient(var(--bk-pressed), var(--bk-pressed)); }
|
|
105
124
|
:host([tone]) .card:has(> .cover:active) { background-image: linear-gradient(var(--bk-pressed), var(--bk-pressed)), linear-gradient(var(--_bk-card-tint), var(--_bk-card-tint)); }
|
|
106
125
|
/* Selected after hover: the choice stays visible under the pointer. */
|
|
@@ -44,6 +44,8 @@ export declare class BkCarouselControls extends LitElement {
|
|
|
44
44
|
/** Size of the buttons. */
|
|
45
45
|
size: "sm" | "md" | "lg";
|
|
46
46
|
private readonly i18n;
|
|
47
|
+
/** The state `linked`: the controls are connected to a carousel with more than one page. */
|
|
48
|
+
private readonly internals;
|
|
47
49
|
constructor();
|
|
48
50
|
static styles: import("lit").CSSResult[];
|
|
49
51
|
connectedCallback(): void;
|
|
@@ -14,13 +14,15 @@ class BkCarouselControls extends LitElement {
|
|
|
14
14
|
size: { reflect: true, useDefault: true }
|
|
15
15
|
};
|
|
16
16
|
i18n = new LocalizeController(this);
|
|
17
|
+
/** The state `linked`: the controls are connected to a carousel with more than one page. */
|
|
18
|
+
internals = this.attachInternals();
|
|
17
19
|
constructor() {
|
|
18
20
|
super();
|
|
19
21
|
this.size = "md";
|
|
20
22
|
}
|
|
21
23
|
static styles = [base, css`
|
|
22
24
|
:host { display: inline-flex; align-items: center; gap: var(--bk-carousel-controls-spacing, var(--bk-space-1)); }
|
|
23
|
-
:host(:not(
|
|
25
|
+
:host(:not(:state(linked))) { display: none; }
|
|
24
26
|
`];
|
|
25
27
|
connectedCallback() {
|
|
26
28
|
super.connectedCallback();
|
|
@@ -43,7 +45,7 @@ class BkCarouselControls extends LitElement {
|
|
|
43
45
|
if (changed.has("htmlFor") && changed.get("htmlFor") !== void 0)
|
|
44
46
|
this.link();
|
|
45
47
|
const linked = carouselOf(this);
|
|
46
|
-
|
|
48
|
+
!!linked && linked.link.state().multiple ? this.internals.states.add("linked") : this.internals.states.delete("linked");
|
|
47
49
|
}
|
|
48
50
|
updated(changed) {
|
|
49
51
|
super.updated(changed);
|
|
@@ -88,6 +88,12 @@ export declare class BkChartArea extends BkChartLine {
|
|
|
88
88
|
attribute: string;
|
|
89
89
|
type: ObjectConstructor;
|
|
90
90
|
};
|
|
91
|
+
tooltipFields: {
|
|
92
|
+
attribute: string;
|
|
93
|
+
converter: {
|
|
94
|
+
fromAttribute(value: string | null): import("../charts/fields.js").ChartField[];
|
|
95
|
+
};
|
|
96
|
+
};
|
|
91
97
|
yDirection: {
|
|
92
98
|
attribute: string;
|
|
93
99
|
reflect: boolean;
|
|
@@ -103,6 +109,10 @@ export declare class BkChartArea extends BkChartLine {
|
|
|
103
109
|
persistKey: {
|
|
104
110
|
attribute: string;
|
|
105
111
|
};
|
|
112
|
+
gaps: {
|
|
113
|
+
reflect: boolean;
|
|
114
|
+
useDefault: boolean;
|
|
115
|
+
};
|
|
106
116
|
variant: {
|
|
107
117
|
reflect: boolean;
|
|
108
118
|
useDefault: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LitElement, type PropertyValues, type TemplateResult } from "lit";
|
|
2
|
+
import { type ChartField } from "../charts/fields.js";
|
|
2
3
|
import { type ChartRow, type ChartSeries } from "../charts/frame.js";
|
|
3
4
|
import "./bk-chart-legend.js";
|
|
4
5
|
import "../icons/set/grid.js";
|
|
@@ -204,6 +205,12 @@ export declare class BkChartBar extends LitElement {
|
|
|
204
205
|
attribute: string;
|
|
205
206
|
type: ObjectConstructor;
|
|
206
207
|
};
|
|
208
|
+
tooltipFields: {
|
|
209
|
+
attribute: string;
|
|
210
|
+
converter: {
|
|
211
|
+
fromAttribute(value: string | null): ChartField[];
|
|
212
|
+
};
|
|
213
|
+
};
|
|
207
214
|
};
|
|
208
215
|
/** Rows, one per category. */
|
|
209
216
|
data: ChartRow[];
|
|
@@ -274,6 +281,12 @@ export declare class BkChartBar extends LitElement {
|
|
|
274
281
|
variant: "default" | "minimal";
|
|
275
282
|
/** Intl.NumberFormat options for values (`{"style":"currency","currency":"EUR"}`). */
|
|
276
283
|
valueFormat: Intl.NumberFormatOptions | undefined;
|
|
284
|
+
/**
|
|
285
|
+
* Fields of the row that the tooltip, the data table and the name of each bar list without drawing them.
|
|
286
|
+
* The attribute lists the keys (`tooltip-fields="prints likes"`). The property takes keys or
|
|
287
|
+
* `{ key, label, format }` objects, where `label` names the field and `format` are `Intl.NumberFormat` options.
|
|
288
|
+
*/
|
|
289
|
+
tooltipFields: (string | ChartField)[] | undefined;
|
|
277
290
|
private i18n;
|
|
278
291
|
private chart;
|
|
279
292
|
private hot;
|
|
@@ -318,6 +331,10 @@ export declare class BkChartBar extends LitElement {
|
|
|
318
331
|
protected willUpdate(changed: PropertyValues): void;
|
|
319
332
|
private layout;
|
|
320
333
|
private markLabel;
|
|
334
|
+
/** The extra fields of the tooltip (`tooltip-fields`). */
|
|
335
|
+
private get extraFields();
|
|
336
|
+
/** The extra fields of a row as one text: "Prints 12, Likes 3". */
|
|
337
|
+
private extraText;
|
|
321
338
|
private tooltipFor;
|
|
322
339
|
private enter;
|
|
323
340
|
private onFocus;
|
|
@@ -8,6 +8,7 @@ import { emitDetail } from "../internal/events.js";
|
|
|
8
8
|
import { LinkController } from "../internal/link.js";
|
|
9
9
|
import { adoptChartTokens } from "../charts/chart-tokens.js";
|
|
10
10
|
import { chartT } from "../charts/i18n.js";
|
|
11
|
+
import { resolveFields, fieldLabel, fieldValue, tooltipFieldsConverter } from "../charts/fields.js";
|
|
11
12
|
import { axisFormatter, formatPercent, formatTime, formatValue } from "../charts/format.js";
|
|
12
13
|
import { bandScale, linearScale, niceTicks } from "../charts/scale.js";
|
|
13
14
|
import { Brush } from "../charts/brush.js";
|
|
@@ -47,7 +48,8 @@ class BkChartBar extends LitElement {
|
|
|
47
48
|
table: { type: Boolean, reflect: true },
|
|
48
49
|
bare: { type: Boolean, reflect: true },
|
|
49
50
|
variant: { reflect: true, useDefault: true },
|
|
50
|
-
valueFormat: { attribute: "value-format", type: Object }
|
|
51
|
+
valueFormat: { attribute: "value-format", type: Object },
|
|
52
|
+
tooltipFields: { attribute: "tooltip-fields", converter: tooltipFieldsConverter }
|
|
51
53
|
};
|
|
52
54
|
i18n = new LocalizeController(this);
|
|
53
55
|
chart = new ChartController(this);
|
|
@@ -170,7 +172,8 @@ class BkChartBar extends LitElement {
|
|
|
170
172
|
/** The name of the link or button of a category: the category and its values. */
|
|
171
173
|
categoryLabel(i) {
|
|
172
174
|
const bars = this.layoutCache?.bars.filter((b) => b.i === i) ?? [];
|
|
173
|
-
|
|
175
|
+
const text = bars.map((b) => this.markLabel(b, false)).join("; ");
|
|
176
|
+
return this.extraFields.length && bars.length ? `${text}; ${this.extraText(this.viewRows[i])}` : text;
|
|
174
177
|
}
|
|
175
178
|
static styles = [base, ...chartStyles, css`
|
|
176
179
|
.plot { height: var(--bk-chart-height); }
|
|
@@ -326,6 +329,8 @@ class BkChartBar extends LitElement {
|
|
|
326
329
|
seriesLabels = series.map((se, j) => ({ j, y: 0, text: se.label }));
|
|
327
330
|
}
|
|
328
331
|
}
|
|
332
|
+
if (this.variant === "minimal" && !percent && hi > lo)
|
|
333
|
+
ticks = { ...ticks, min: Math.min(0, lo), max: Math.max(0, hi) };
|
|
329
334
|
const valueScale = horizontal ? linearScale([ticks.min, ticks.max], [x0, x1]) : linearScale([ticks.min, ticks.max], [y1, y0]);
|
|
330
335
|
const bands = horizontal ? bandScale(n, [y0, y1]) : bandScale(n, [x0, x1]);
|
|
331
336
|
const { t, groupW } = groupThick(bands.width);
|
|
@@ -410,11 +415,20 @@ class BkChartBar extends LitElement {
|
|
|
410
415
|
return { H, x0, x1, y0, y1, ticks, fmtTick, valueScale, bands, bars, ghosts, marks, cmp: !!cmpRows, t, zero, cats, details, hasDetail, empty, lineStep, values, totals, seriesLabels, horizontal, stacked, percent, series, n, k };
|
|
411
416
|
}
|
|
412
417
|
/* ---------------------------------------------------------------- interaction */
|
|
413
|
-
markLabel(b) {
|
|
418
|
+
markLabel(b, extras = true) {
|
|
414
419
|
const se = this.effectiveSeries[b.j];
|
|
415
420
|
const cat = this.categoryName(this.viewRows[b.i]);
|
|
416
421
|
const value = b.value === null ? chartT(this.i18n.locale, "chartNoValue") : this.mode === "percent" ? `${formatPercent(this.i18n.locale, b.share, 1)} (${this.fmt(b.value)})` : this.fmt(b.value);
|
|
417
|
-
|
|
422
|
+
const text = chartT(this.i18n.locale, "chartMark", { category: cat, series: se?.label ?? "", value });
|
|
423
|
+
return extras && this.extraFields.length ? `${text}; ${this.extraText(this.viewRows[b.i])}` : text;
|
|
424
|
+
}
|
|
425
|
+
/** The extra fields of the tooltip (`tooltip-fields`). */
|
|
426
|
+
get extraFields() {
|
|
427
|
+
return resolveFields(this.tooltipFields);
|
|
428
|
+
}
|
|
429
|
+
/** The extra fields of a row as one text: "Prints 12, Likes 3". */
|
|
430
|
+
extraText(row) {
|
|
431
|
+
return this.extraFields.map((f) => `${fieldLabel(f)} ${fieldValue(this.i18n.locale, row, f)}`).join(", ");
|
|
418
432
|
}
|
|
419
433
|
tooltipFor(b) {
|
|
420
434
|
const series = this.effectiveSeries;
|
|
@@ -437,6 +451,8 @@ class BkChartBar extends LitElement {
|
|
|
437
451
|
}
|
|
438
452
|
if (this.mode !== "grouped" && series.length > 1)
|
|
439
453
|
rows.push({ label: chartT(locale, "chartTotal"), value: this.fmt(total), color: "", marker: "rect", active: false });
|
|
454
|
+
for (const f of this.extraFields)
|
|
455
|
+
rows.push({ label: fieldLabel(f), value: fieldValue(locale, row, f), color: "", marker: "rect", active: false });
|
|
440
456
|
return { title: this.categoryName(row), rows, x: b.ax, y: b.ay };
|
|
441
457
|
}
|
|
442
458
|
enter(b) {
|
|
@@ -603,6 +619,9 @@ class BkChartBar extends LitElement {
|
|
|
603
619
|
columns.push(se.label, ...cmp ? [`${se.label} \xB7 ${cmpLabel}`, `${se.label} \xB7 ${chartT(locale, "chartChange")}`] : []);
|
|
604
620
|
if (stacked)
|
|
605
621
|
columns.push(chartT(locale, "chartTotal"));
|
|
622
|
+
const extra = this.extraFields;
|
|
623
|
+
for (const f of extra)
|
|
624
|
+
columns.push(fieldLabel(f));
|
|
606
625
|
const rows = (this.data ?? []).map((r, i) => {
|
|
607
626
|
const vs = series.map((s) => num(r[s.key]));
|
|
608
627
|
const cells = [this.category(r)];
|
|
@@ -617,6 +636,8 @@ class BkChartBar extends LitElement {
|
|
|
617
636
|
});
|
|
618
637
|
if (stacked)
|
|
619
638
|
cells.push(this.fmt(vs.reduce((a, v) => a + (v ?? 0), 0)));
|
|
639
|
+
for (const f of extra)
|
|
640
|
+
cells.push(fieldValue(locale, r, f));
|
|
620
641
|
return cells;
|
|
621
642
|
});
|
|
622
643
|
return { caption: this.heading || chartT(locale, "chartData"), columns, rows };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LitElement, type PropertyValues, type TemplateResult } from "lit";
|
|
2
|
+
import { type ChartField } from "../charts/fields.js";
|
|
2
3
|
import { type ChartRow, type ChartSeries } from "../charts/frame.js";
|
|
3
4
|
import "./bk-chart-legend.js";
|
|
4
5
|
import "../icons/set/compare.js";
|
|
@@ -60,6 +61,12 @@ export interface ChartMarkDetail {
|
|
|
60
61
|
* Whole numbers get whole ticks, and the axis starts at the best value (or at `min`, for example `min="1"`).
|
|
61
62
|
* The summary and the tooltip show a smaller value as better ("2 better").
|
|
62
63
|
*
|
|
64
|
+
* A missing value (null, or no field in the row) breaks the line. `gaps="connect"` bridges the gap: a straight
|
|
65
|
+
* segment goes from the last real point to the next real point of the series. `--bk-chart-line-gap-dash` gives the segment
|
|
66
|
+
* a dash pattern that shows where the data has no value. The chart adds no values: the tooltip says "no value", and the table and the summary list only real values.
|
|
67
|
+
* The chart does not bridge before the first or after the last real point. `gaps` in a series sets the mode of that series.
|
|
68
|
+
* Use it for series that the app measures at different times (one row per time, each series with a value in some rows).
|
|
69
|
+
*
|
|
63
70
|
* With `toggleable`, the legend entries are toggle buttons. The user shows and hides the series, and the
|
|
64
71
|
* value axis fits the visible series. A series with `hidden: true` starts hidden. At least one series stays
|
|
65
72
|
* visible. The chart fires `change` with the visible keys and stores them with `persist-key`. The data table
|
|
@@ -91,6 +98,7 @@ export interface ChartMarkDetail {
|
|
|
91
98
|
* @cssprop --bk-chart-marker-size - Hover marker diameter (default 8px).
|
|
92
99
|
* @cssprop --bk-chart-ring - Surface ring around markers (default 2px).
|
|
93
100
|
* @cssprop --bk-chart-surface - Colour of the marker ring: the surface that the chart is on (default --bk-ground, the background of its card or panel).
|
|
101
|
+
* @cssprop --bk-chart-line-gap-dash - Dash pattern of a bridged gap (`gaps="connect"`). The default is none: the bridge is solid. Set a pattern to show where no value was measured, for example `var(--bk-chart-line-width) calc(var(--bk-chart-line-width) * 3)` (with the round caps, a dotted line).
|
|
94
102
|
* @cssprop --bk-chart-area-opacity - Area wash opacity (default 0.1).
|
|
95
103
|
* @cssprop --bk-chart-band-opacity - Opacity of a shaded `bk-chart-mark` band and of the selection (default 0.12).
|
|
96
104
|
* @cssprop --bk-chart-compare-opacity - Opacity of the dashed comparison line (default 0.6).
|
|
@@ -197,6 +205,12 @@ export declare class BkChartLine extends LitElement {
|
|
|
197
205
|
attribute: string;
|
|
198
206
|
type: ObjectConstructor;
|
|
199
207
|
};
|
|
208
|
+
tooltipFields: {
|
|
209
|
+
attribute: string;
|
|
210
|
+
converter: {
|
|
211
|
+
fromAttribute(value: string | null): ChartField[];
|
|
212
|
+
};
|
|
213
|
+
};
|
|
200
214
|
yDirection: {
|
|
201
215
|
attribute: string;
|
|
202
216
|
reflect: boolean;
|
|
@@ -212,6 +226,10 @@ export declare class BkChartLine extends LitElement {
|
|
|
212
226
|
persistKey: {
|
|
213
227
|
attribute: string;
|
|
214
228
|
};
|
|
229
|
+
gaps: {
|
|
230
|
+
reflect: boolean;
|
|
231
|
+
useDefault: boolean;
|
|
232
|
+
};
|
|
215
233
|
};
|
|
216
234
|
/** Rows, one per x position. */
|
|
217
235
|
data: ChartRow[];
|
|
@@ -257,6 +275,12 @@ export declare class BkChartLine extends LitElement {
|
|
|
257
275
|
bare: boolean;
|
|
258
276
|
/** Intl.NumberFormat options for values. */
|
|
259
277
|
valueFormat: Intl.NumberFormatOptions | undefined;
|
|
278
|
+
/**
|
|
279
|
+
* Fields of the row that the tooltip, the data table and the name of each point list without drawing them.
|
|
280
|
+
* The attribute lists the keys (`tooltip-fields="prints likes"`). The property takes keys or
|
|
281
|
+
* `{ key, label, format }` objects, where `label` names the field and `format` are `Intl.NumberFormat` options.
|
|
282
|
+
*/
|
|
283
|
+
tooltipFields: (string | ChartField)[] | undefined;
|
|
260
284
|
/** `up` (default): larger values are higher. `down`: the value axis runs down. The smallest value is at the top and is the best (a rank). Lines only. */
|
|
261
285
|
yDirection: "up" | "down";
|
|
262
286
|
/** The start of the value axis, for example `1` for ranks. Default: a round value below the data (zero with `zero`). With `y-direction="down"` and whole numbers, the default is the smallest value. */
|
|
@@ -265,6 +289,8 @@ export declare class BkChartLine extends LitElement {
|
|
|
265
289
|
toggleable: boolean;
|
|
266
290
|
/** With `toggleable`: stores the visible series in the app state (entry `chart-series:<persist-key>`, see `<bk-app-state>`). */
|
|
267
291
|
persistKey: string | undefined;
|
|
292
|
+
/** `break` (default): a missing value breaks the line. `connect`: a straight segment bridges the gap between two real points. `gaps` in a series overrides it. Lines only: a stacked layer counts a missing value as 0. */
|
|
293
|
+
gaps: "break" | "connect";
|
|
268
294
|
private i18n;
|
|
269
295
|
private chart;
|
|
270
296
|
private hot;
|
|
@@ -313,6 +339,8 @@ export declare class BkChartLine extends LitElement {
|
|
|
313
339
|
private computeSubDay;
|
|
314
340
|
private xText;
|
|
315
341
|
private fmt;
|
|
342
|
+
/** A value for the tooltip and the name of a point: a missing value is "no value", not a dash. */
|
|
343
|
+
private valueText;
|
|
316
344
|
protected willUpdate(changed: PropertyValues): void;
|
|
317
345
|
/** The compared value of series `j` at point `p` of the view. */
|
|
318
346
|
private compareAt;
|
|
@@ -6,6 +6,7 @@ import { base } from "../internal/styles.js";
|
|
|
6
6
|
import { emitDetail } from "../internal/events.js";
|
|
7
7
|
import { adoptChartTokens } from "../charts/chart-tokens.js";
|
|
8
8
|
import { chartT } from "../charts/i18n.js";
|
|
9
|
+
import { resolveFields, fieldLabel, fieldValue, tooltipFieldsConverter } from "../charts/fields.js";
|
|
9
10
|
import { axisFormatter, formatPercent, formatTime, formatValue, timeTickFormatter } from "../charts/format.js";
|
|
10
11
|
import { linearScale, nearestIndex, niceTicks, ticksFrom, timeTicks } from "../charts/scale.js";
|
|
11
12
|
import { Brush } from "../charts/brush.js";
|
|
@@ -50,10 +51,12 @@ class BkChartLine extends LitElement {
|
|
|
50
51
|
table: { type: Boolean, reflect: true },
|
|
51
52
|
bare: { type: Boolean, reflect: true },
|
|
52
53
|
valueFormat: { attribute: "value-format", type: Object },
|
|
54
|
+
tooltipFields: { attribute: "tooltip-fields", converter: tooltipFieldsConverter },
|
|
53
55
|
yDirection: { attribute: "y-direction", reflect: true, useDefault: true },
|
|
54
56
|
min: { type: Number },
|
|
55
57
|
toggleable: { type: Boolean, reflect: true },
|
|
56
|
-
persistKey: { attribute: "persist-key" }
|
|
58
|
+
persistKey: { attribute: "persist-key" },
|
|
59
|
+
gaps: { reflect: true, useDefault: true }
|
|
57
60
|
};
|
|
58
61
|
i18n = new LocalizeController(this);
|
|
59
62
|
chart = new ChartController(this);
|
|
@@ -95,6 +98,7 @@ class BkChartLine extends LitElement {
|
|
|
95
98
|
this.range = null;
|
|
96
99
|
this.yDirection = "up";
|
|
97
100
|
this.toggleable = false;
|
|
101
|
+
this.gaps = "break";
|
|
98
102
|
}
|
|
99
103
|
/** The keys that the user chooses to show. Null: the series without `hidden`. */
|
|
100
104
|
shown = null;
|
|
@@ -169,6 +173,7 @@ class BkChartLine extends LitElement {
|
|
|
169
173
|
.area { fill: var(--_bk-chart-c); opacity: var(--bk-chart-area-opacity); stroke: none; }
|
|
170
174
|
.dot { fill: var(--_bk-chart-c); stroke: var(--bk-chart-surface, var(--bk-ground, var(--bk-layer-raised-bg))); stroke-width: var(--bk-chart-ring); }
|
|
171
175
|
.crosshair { stroke: var(--bk-chart-axis); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }
|
|
176
|
+
.gap { stroke-dasharray: var(--bk-chart-line-gap-dash, none); }
|
|
172
177
|
.compare { stroke-dasharray: 6 4; opacity: var(--bk-chart-compare-opacity); }
|
|
173
178
|
.layer { fill: var(--_bk-chart-c); stroke: var(--bk-chart-surface, var(--bk-ground, var(--bk-layer-raised-bg))); stroke-width: var(--bk-chart-surface-gap); stroke-linejoin: round; }
|
|
174
179
|
.selection { fill: var(--bk-accent-solid); fill-opacity: var(--bk-chart-band-opacity); stroke: var(--bk-accent-solid); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }
|
|
@@ -240,6 +245,10 @@ class BkChartLine extends LitElement {
|
|
|
240
245
|
fmt(v) {
|
|
241
246
|
return formatValue(this.i18n.locale, v, this.valueFormat);
|
|
242
247
|
}
|
|
248
|
+
/** A value for the tooltip and the name of a point: a missing value is "no value", not a dash. */
|
|
249
|
+
valueText(v) {
|
|
250
|
+
return v === null ? chartT(this.i18n.locale, "chartNoValue") : this.fmt(v);
|
|
251
|
+
}
|
|
243
252
|
willUpdate(changed) {
|
|
244
253
|
const dataChanged = changed.has("data") || changed.has("x") || changed.has("xType");
|
|
245
254
|
if (dataChanged) {
|
|
@@ -434,8 +443,9 @@ class BkChartLine extends LitElement {
|
|
|
434
443
|
pointLabel(idx) {
|
|
435
444
|
const row = this.data[this.view[idx]];
|
|
436
445
|
const shown = new Set(this.visibleKeys);
|
|
437
|
-
const parts = this.effectiveSeries.filter((se) => shown.has(se.key)).map((se) => `${se.label} ${this.
|
|
438
|
-
|
|
446
|
+
const parts = this.effectiveSeries.filter((se) => shown.has(se.key)).map((se) => `${se.label} ${this.valueText(num(row[se.key]))}`);
|
|
447
|
+
const extra = resolveFields(this.tooltipFields).map((f) => `${fieldLabel(f)} ${fieldValue(this.i18n.locale, row, f)}`);
|
|
448
|
+
return `${this.xText(row)}: ${parts.concat(extra).join(", ")}`;
|
|
439
449
|
}
|
|
440
450
|
tooltipAt(idx, L) {
|
|
441
451
|
const locale = this.i18n.locale;
|
|
@@ -451,15 +461,17 @@ class BkChartLine extends LitElement {
|
|
|
451
461
|
const share = L.stack === "percent" && v !== null && L.totals[idx] ? ` \xB7 ${formatPercent(locale, Math.max(0, v) / L.totals[idx], 1)}` : "";
|
|
452
462
|
const prev = L.down && !L.cmp && idx > 0 ? L.raw[j][idx - 1] : null;
|
|
453
463
|
const step = v !== null && prev !== null ? ` (${delta(v, prev)})` : "";
|
|
454
|
-
rows.push({ label: se.label, value: this.
|
|
464
|
+
rows.push({ label: se.label, value: this.valueText(v) + share + step, color, marker: L.stack === "none" ? "line" : "rect" });
|
|
455
465
|
const before = L.cmp?.[j][idx];
|
|
456
466
|
if (L.cmp && before !== void 0) {
|
|
457
467
|
const change = v !== null && before !== null ? ` (${delta(v, before)})` : "";
|
|
458
|
-
rows.push({ label: `${series.length > 1 ? `${se.label} \xB7 ` : ""}${this.compareLabel || chartT(locale, "chartPrevious")}`, value: this.
|
|
468
|
+
rows.push({ label: `${series.length > 1 ? `${se.label} \xB7 ` : ""}${this.compareLabel || chartT(locale, "chartPrevious")}`, value: this.valueText(before) + change, color, marker: "line" });
|
|
459
469
|
}
|
|
460
470
|
});
|
|
461
471
|
if (L.stack !== "none" && series.length > 1)
|
|
462
472
|
rows.push({ label: chartT(locale, "chartTotal"), value: this.fmt(L.totals[idx]) });
|
|
473
|
+
for (const f of resolveFields(this.tooltipFields))
|
|
474
|
+
rows.push({ label: fieldLabel(f), value: fieldValue(locale, row, f) });
|
|
463
475
|
return { title: this.xText(row), rows, x: L.xScale(L.xs[idx]), y: L.y0, placement: "beside" };
|
|
464
476
|
}
|
|
465
477
|
/** The point index nearest to a pointer event. */
|
|
@@ -688,6 +700,9 @@ class BkChartLine extends LitElement {
|
|
|
688
700
|
}
|
|
689
701
|
if (stacked)
|
|
690
702
|
columns.push(chartT(locale, "chartTotal"));
|
|
703
|
+
const extra = resolveFields(this.tooltipFields);
|
|
704
|
+
for (const f of extra)
|
|
705
|
+
columns.push(fieldLabel(f));
|
|
691
706
|
const rows = this.order.map((i, p) => {
|
|
692
707
|
const cells = [this.xText(this.data[i])];
|
|
693
708
|
series.forEach((se, j) => {
|
|
@@ -700,6 +715,8 @@ class BkChartLine extends LitElement {
|
|
|
700
715
|
});
|
|
701
716
|
if (stacked)
|
|
702
717
|
cells.push(this.fmt(series.reduce((a, se) => a + Math.max(0, num(this.data[i][se.key]) ?? 0), 0)));
|
|
718
|
+
for (const f of extra)
|
|
719
|
+
cells.push(fieldValue(locale, this.data[i], f));
|
|
703
720
|
return cells;
|
|
704
721
|
});
|
|
705
722
|
return { caption: this.heading || chartT(locale, "chartData"), columns, rows };
|
|
@@ -750,10 +767,13 @@ class BkChartLine extends LitElement {
|
|
|
750
767
|
}
|
|
751
768
|
const segs = segments(L.vals[j]);
|
|
752
769
|
const d = segs.filter((p) => p.length > 1).map((p) => `M${pathD(p)}`).join("");
|
|
753
|
-
const
|
|
770
|
+
const connect = (se.gaps ?? this.gaps) === "connect";
|
|
771
|
+
const gaps = connect ? segs.slice(1).map((p, k) => `M${pathD([segs[k][segs[k].length - 1], p[0]])}`).join("") : "";
|
|
772
|
+
const runs = connect && segs.length > 1 ? [segs.flat()] : segs.filter((p) => p.length > 1);
|
|
773
|
+
const area = this.filled ? runs.map((p) => `M${p[0][0].toFixed(1)},${base0}L${pathD(p)}L${p[p.length - 1][0].toFixed(1)},${base0}Z`).join("") : "";
|
|
754
774
|
const singles = segs.filter((p) => p.length === 1).map(([[x, y]]) => svg`<circle class="dot" cx=${x} cy=${y} r=${s.marker / 2}></circle>`);
|
|
755
775
|
const before = L.cmp ? segments(L.cmp[j]).filter((p) => p.length > 1).map((p) => `M${pathD(p)}`).join("") : "";
|
|
756
|
-
return svg`<g style=${styleMap(style)}>${area ? svg`<path class="area" d=${area}></path>` : nothing}${before ? svg`<path class="line compare" d=${before}></path>` : nothing}<path class="line" data-slot=${slot} d=${d}></path>${singles}</g>`;
|
|
776
|
+
return svg`<g style=${styleMap(style)}>${area ? svg`<path class="area" d=${area}></path>` : nothing}${before ? svg`<path class="line compare" d=${before}></path>` : nothing}<path class="line" data-slot=${slot} d=${d}></path>${gaps ? svg`<path class="line gap" d=${gaps}></path>` : nothing}${singles}</g>`;
|
|
757
777
|
});
|
|
758
778
|
const type = L.type;
|
|
759
779
|
const labels = type === "category" ? this.view.map((i) => this.xText(this.data[i])) : [];
|
|
@@ -15,7 +15,7 @@ import "./bk-button.js";
|
|
|
15
15
|
* - **Keyboard**: Tab enters the group at the chosen chip (otherwise the chip used last, otherwise the first) and leaves
|
|
16
16
|
* the group. ←/→ (and ↑/↓) move between the chips. Home/End move to the first and last chip.
|
|
17
17
|
* Backspace or Delete on a `removable` chip fires the `remove` event of that chip. The app removes the chip then,
|
|
18
|
-
* and the focus moves to the next chip. Without `selection` and without a removable chip the
|
|
18
|
+
* and the focus moves to the next chip. On a `removed` chip the same keys fire `restore`. Without `selection` and without a removable chip the
|
|
19
19
|
* chips are not focusable. They are a list (`role="list"`).
|
|
20
20
|
* - **Filter chips**: `selection="multiple"` makes every chip a toggle button (`aria-pressed`, the
|
|
21
21
|
* group a `role="toolbar"`). `selection="single"` makes the group a listbox and every chip an
|
|
@@ -52,7 +52,7 @@ import "./bk-button.js";
|
|
|
52
52
|
* @keyboard ←, →, ↑, ↓ - Move to the previous or next chip. ← and → follow the writing direction.
|
|
53
53
|
* @keyboard Home, End - Move to the first or last chip.
|
|
54
54
|
* @keyboard Space, Enter - With `selection`: choose the focused chip.
|
|
55
|
-
* @keyboard Backspace, Delete - Remove a removable chip. The focus moves to the next chip.
|
|
55
|
+
* @keyboard Backspace, Delete - Remove a removable chip. The focus moves to the next chip. On a `removed` chip they restore it (`restore`), and the focus stays.
|
|
56
56
|
* @a11y With a removable chip or `selection` the group is one stop in the tab order. `selection="single"` makes it a `listbox` and each chip an `option` with `aria-selected`; `selection="multiple"` makes it a `toolbar` of toggle buttons (`aria-pressed`). Without both, the group is a `list` and the chips are not focusable.
|
|
57
57
|
*/
|
|
58
58
|
export declare class BkChipGroup extends FormControl {
|
|
@@ -284,6 +284,10 @@ class BkChipGroup extends FormControl {
|
|
|
284
284
|
if (!chip.removable)
|
|
285
285
|
return;
|
|
286
286
|
e.preventDefault();
|
|
287
|
+
if (chip.removed) {
|
|
288
|
+
emit(chip, "restore");
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
287
291
|
this.removedAt = at;
|
|
288
292
|
emit(chip, "remove");
|
|
289
293
|
queueMicrotask(() => {
|
|
@@ -8,6 +8,7 @@ import "../icons/set/error.js";
|
|
|
8
8
|
import "../icons/set/info.js";
|
|
9
9
|
import "../icons/set/label.js";
|
|
10
10
|
import "../icons/set/remove.js";
|
|
11
|
+
import "../icons/set/undo.js";
|
|
11
12
|
import "../icons/set/warning.js";
|
|
12
13
|
export type ChipTone = "neutral" | "accent" | "success" | "warning" | "danger" | "attention" | "info";
|
|
13
14
|
/**
|
|
@@ -27,29 +28,55 @@ export type ChipTone = "neutral" | "accent" | "success" | "warning" | "danger" |
|
|
|
27
28
|
*
|
|
28
29
|
* With `copy` the chip is a copy button. A click, Enter or Space copies `copy-text` (default: the text of the chip) to the
|
|
29
30
|
* clipboard, with the fallback of `bk-button-copy`. The icon changes to a check for two seconds, and screen readers announce
|
|
30
|
-
* "Copied". A failed copy shows an error mark, announces "Cannot copy." and fires `copyfailed`. `count` shows a number
|
|
31
|
+
* "Copied". A failed copy shows an error mark, announces "Cannot copy." and fires `copyfailed`. `count` shows a number after the text.
|
|
31
32
|
* `variant="dashed"` marks a suggestion that nobody has accepted yet.
|
|
32
33
|
*
|
|
33
34
|
* ```html
|
|
34
|
-
* <bk-chip copy count="12" variant="dashed">
|
|
35
|
+
* <bk-chip copy count="12" variant="dashed">Bracket</bk-chip>
|
|
35
36
|
* ```
|
|
36
37
|
*
|
|
37
|
-
*
|
|
38
|
+
* `removed` marks a chip that the user took out but the page still shows, for example in a diff of tags. The text is struck
|
|
39
|
+
* through in a muted look, and a screen reader hears "Removed". With `removable`, the button then restores the chip: it shows the `undo`
|
|
40
|
+
* icon, is named "Restore {item}" and fires `restore` instead of `remove`. The app clears `removed`. It works with every variant.
|
|
41
|
+
*
|
|
42
|
+
* ```html
|
|
43
|
+
* <bk-chip removable removed>design</bk-chip>
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* `variant="text"` is a plain status label: no fill, no border and no inline padding, only the tone colour as text.
|
|
47
|
+
* The dot, `count`, the `end` slot, the remove button and `copy` work as in the other variants. A `copy` chip, a chip with
|
|
48
|
+
* `href` and a removable chip keep a hit area of at least `--bk-target-min` and the visible focus ring.
|
|
49
|
+
*
|
|
50
|
+
* `count` and the `end` slot both come after the text, and `count` comes first. Use `count` for a number or a short text.
|
|
51
|
+
* Use the `end` slot for rich content, for example a coloured `<span>` with a rank. A `copy` chip includes the text of
|
|
52
|
+
* the `end` slot in its accessible name, after the text and the count, and does not copy it.
|
|
53
|
+
*
|
|
54
|
+
* ```html
|
|
55
|
+
* <bk-chip tone="success" variant="text" dot>Online</bk-chip>
|
|
56
|
+
* <bk-chip>Bracket <span slot="end">#3</span></bk-chip>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* i18n keys: `copyItem` (name, "Copy {item}"), `copied`, `copyFailed`, `removed`, `restoreItem`. `copy-label` overrides the name of a copy chip, `restore-label` the name of the restore button.
|
|
38
60
|
*
|
|
39
61
|
* @slot - Text.
|
|
40
62
|
* @slot start - Leading content, for example a `<bk-icon>` or `<bk-avatar>`.
|
|
63
|
+
* @slot end - Trailing content after the text and the `count`, before the remove button, for example a coloured rank. An empty slot uses no space.
|
|
41
64
|
* @csspart base - The chip box.
|
|
42
65
|
* @csspart link - The `<a>` with `href`.
|
|
43
|
-
* @csspart
|
|
66
|
+
* @csspart end - The wrapper of the `end` slot.
|
|
67
|
+
* @csspart remove - The remove button, or the restore button of a `removed` chip.
|
|
44
68
|
* @cssprop --bk-chip-accent-fill - Background of a solid accent chip, any background value (default: flat, or a gradient to --bk-accent-2 with the gradient knob).
|
|
45
69
|
* @cssprop --bk-chip-gradient - The gradient knob for chips only (default --bk-gradient).
|
|
46
70
|
* @cssprop --bk-chip-radius - Corner radius (default --bk-radius-chip, else --bk-radius-sm).
|
|
47
71
|
* @cssprop --bk-chip-height - Height at every size (overrides the per-size tokens).
|
|
48
72
|
* @cssprop --bk-chip-height-{sm|md|lg} - Height per size, derived from the control scale (default 20px / 24px / --bk-control-sm at text scale 1).
|
|
49
73
|
* @cssprop --bk-chip-padding-{sm|md|lg} - Inline padding per size (default --bk-space-1-5 / --bk-space-2 / --bk-space-2-5).
|
|
74
|
+
* @cssprop --bk-chip-text-padding-inline - Inline padding of variant `text` at every size (default 0).
|
|
50
75
|
* @cssprop --bk-chip-border - Border colour (default transparent; `outline`: the text colour at 40%).
|
|
51
76
|
* @cssprop --bk-chip-gap - Space between dot, icon, text and remove button (default --bk-space-1).
|
|
52
77
|
* @cssprop --bk-chip-font-size - Text size at every size (default --bk-text-2xs / --bk-text-xs / --bk-text-sm by size).
|
|
78
|
+
* @cssprop --bk-chip-transform - Text transform (default none).
|
|
79
|
+
* @cssprop --bk-chip-tracking - Letter spacing, a length (default 0em; for uppercase use --bk-tracking-label). The chip takes the space after the last letter back, so the text stays centred.
|
|
53
80
|
* @cssprop --bk-chip-font-weight - Text weight (default --bk-weight-medium).
|
|
54
81
|
* @cssprop --bk-chip-dot-size - Diameter of the `dot` (default --bk-space-1-5).
|
|
55
82
|
* @cssprop --bk-chip-remove-size - Visible size of the remove button; its target is at least --bk-target-min (default --bk-icon-sm).
|
|
@@ -64,13 +91,17 @@ export type ChipTone = "neutral" | "accent" | "success" | "warning" | "danger" |
|
|
|
64
91
|
* @cssprop --bk-chip-pressed-bg - Pressed tint of a chip with `href` (default --bk-pressed).
|
|
65
92
|
* @cssprop --bk-chip-on - Text colour on solid chips (default --bk-on-solid; warning: --bk-chip-warning-on / --bk-on-warning; accent: --bk-chip-accent-on / --bk-on-accent).
|
|
66
93
|
* @cssprop --bk-chip-{accent|warning}-on - Text colour on a solid accent or warning chip (default --bk-on-accent, --bk-on-warning).
|
|
94
|
+
* @cssprop --bk-chip-removed-fg - Text colour of a `removed` chip (default --bk-text-muted).
|
|
95
|
+
* @cssprop --bk-chip-removed-bg - Background of a `removed` chip (default transparent).
|
|
96
|
+
* @cssprop --bk-chip-removed-decoration - Text decoration of a `removed` chip (default line-through).
|
|
67
97
|
* @cssprop --bk-chip-count-fg - Colour of the `count` (default: the chip text colour).
|
|
68
98
|
* @fires {CustomEvent<CopyFailedDetail>} copyfailed - The copy of a `copy` chip failed. The event bubbles and is composed. `detail.error` is the reason.
|
|
69
99
|
* @fires {Event} remove - The element fires this event when the user clicks the remove button.
|
|
100
|
+
* @fires {Event} restore - The element fires this event when the user clicks the restore button of a `removed` chip. The event bubbles and is composed. The app clears `removed`.
|
|
70
101
|
*
|
|
71
102
|
* @fires {CustomEvent<NavigateDetail>} navigate - A plain click on the link (primary button, no modifier key, no other `target`, no `download`); `detail.href` is the resolved address. The event bubbles, is composed and is cancelable: `preventDefault()` stops the browser, and the router of the app handles the navigation.
|
|
72
103
|
* @tag bk-chip
|
|
73
|
-
* @a11y Static text. The remove button of `removable` is a native button whose name includes the chip that it removes. A `copy` chip is a native button named "Copy {text} {count}", and a live region announces the result. A status dot is decoration: the label gives the meaning.
|
|
104
|
+
* @a11y Static text. The remove button of `removable` is a native button whose name includes the chip that it removes. A `copy` chip is a native button named "Copy {text} {count} {end text}", and a live region announces the result. A status dot is decoration: the label gives the meaning.
|
|
74
105
|
*/
|
|
75
106
|
export declare class BkChip extends LitElement {
|
|
76
107
|
static properties: {
|
|
@@ -122,6 +153,13 @@ export declare class BkChip extends LitElement {
|
|
|
122
153
|
removeLabel: {
|
|
123
154
|
attribute: string;
|
|
124
155
|
};
|
|
156
|
+
removed: {
|
|
157
|
+
type: BooleanConstructor;
|
|
158
|
+
reflect: boolean;
|
|
159
|
+
};
|
|
160
|
+
restoreLabel: {
|
|
161
|
+
attribute: string;
|
|
162
|
+
};
|
|
125
163
|
href: {};
|
|
126
164
|
target: {};
|
|
127
165
|
rel: {};
|
|
@@ -131,8 +169,8 @@ export declare class BkChip extends LitElement {
|
|
|
131
169
|
tone: ChipTone;
|
|
132
170
|
/** Category colour `1` to `8` (identity: a label, a project, a person), from `--bk-hue-N-*`. It has priority over `tone` for the colour. */
|
|
133
171
|
hue: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | undefined;
|
|
134
|
-
/** Weight: `soft` (default, tinted), `solid` (filled), `outline`, `dashed` (outline with a dashed border: a suggestion). */
|
|
135
|
-
variant: "soft" | "solid" | "outline" | "dashed";
|
|
172
|
+
/** Weight: `soft` (default, tinted), `solid` (filled), `outline`, `dashed` (outline with a dashed border: a suggestion), `text` (no fill, no border, no inline padding: the tone colour as text). */
|
|
173
|
+
variant: "soft" | "solid" | "outline" | "dashed" | "text";
|
|
136
174
|
/** `ellipsis`: the chip can become narrower than its text, and the text then ends in an ellipsis. In a `bk-cluster nowrap` the chip shrinks first and the other items keep their width. It has the same name and value as `bk-text`. */
|
|
137
175
|
overflow: "ellipsis" | undefined;
|
|
138
176
|
/** `sm`, `md` (default) or `lg`. */
|
|
@@ -151,7 +189,7 @@ export declare class BkChip extends LitElement {
|
|
|
151
189
|
copyText: string | undefined;
|
|
152
190
|
/** Accessible name of a `copy` chip (default: i18n `copyItem`, "Copy {item}" with the chip text and the count). */
|
|
153
191
|
copyLabel: string | undefined;
|
|
154
|
-
/** A number or short text
|
|
192
|
+
/** A number or short text after the text of the chip, for example the uses of a tag. It comes before the `end` slot. */
|
|
155
193
|
count: string | undefined;
|
|
156
194
|
/** The chip is in a `bk-chip-group`: its remove button is not a Tab stop. */
|
|
157
195
|
protected grouped: boolean;
|
|
@@ -163,20 +201,29 @@ export declare class BkChip extends LitElement {
|
|
|
163
201
|
rel: string | undefined;
|
|
164
202
|
/** File name for a download. The chip passes it to the inner `<a>` when `href` is set. */
|
|
165
203
|
download: string | undefined;
|
|
204
|
+
/** Shows the chip as taken out: struck-through, muted text and a hidden "Removed". With `removable`, the button restores the chip and fires `restore`. */
|
|
205
|
+
removed: boolean;
|
|
206
|
+
/** Accessible name of the restore button of a `removed` chip (default: i18n `restoreItem`, "Restore {item}" with the chip text). */
|
|
207
|
+
restoreLabel: string;
|
|
166
208
|
/** Accessible name of the remove button (default: i18n `removeItem`, "Remove {item}" with the chip text). */
|
|
167
209
|
removeLabel: string;
|
|
210
|
+
private slots;
|
|
168
211
|
private links;
|
|
169
212
|
private clip;
|
|
170
213
|
constructor();
|
|
171
214
|
connectedCallback(): void;
|
|
172
215
|
static styles: import("lit").CSSResult[];
|
|
173
216
|
private i18n;
|
|
217
|
+
private get restoreName();
|
|
174
218
|
private get removeName();
|
|
219
|
+
/** The text of the chip: the default slot, without the `start` and `end` slots. */
|
|
220
|
+
private slotText;
|
|
175
221
|
private get itemText();
|
|
176
222
|
/** Copies `copy-text`, or the text of the chip. Resolves `true` when the copy succeeds. */
|
|
177
223
|
copyToClipboard(text?: string): Promise<boolean>;
|
|
178
224
|
private renderCopy;
|
|
179
225
|
private renderCount;
|
|
226
|
+
private renderEnd;
|
|
180
227
|
private renderLink;
|
|
181
228
|
render(): import("lit-html").TemplateResult<1>;
|
|
182
229
|
}
|