@bk2k/ui 0.6.8 → 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 +56 -2
- package/CHANGELOG.md +136 -0
- package/USAGE.md +89 -26
- 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.js +2 -1
- 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 +37 -14
- package/dist/components/bk-button.js +52 -16
- 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 +17 -0
- package/dist/components/bk-chart-bar.js +25 -4
- 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 +1 -1
- package/dist/components/bk-combobox.js +2 -1
- 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 +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.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-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-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 +425 -2
- 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 +1 -1
- package/dist/components/bk-table.js +9 -12
- 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 +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 +3 -0
- package/dist/index.js +3 -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.js +3 -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.js +2 -5
- 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 +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/jsx.d.ts +141 -52
- package/dist/reset.css +10 -0
- package/dist/standalone/all.js +226 -222
- 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 +62 -30
- 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 +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 +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 +9 -8
- 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 +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 +88 -47
- 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 +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 +4 -4
- 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 +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 +318 -41
- package/dist/standalone/bk-split.js +4 -4
- 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 -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 +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-B1bQxOZp.js → bk-alert-offline-Clw0ZSsH.js} +3 -3
- package/dist/standalone/chunks/{bk-carousel-BCwIQhG5.js → bk-carousel-Biz7t8sL.js} +4 -4
- package/dist/standalone/chunks/{bk-diagram-DWK8CvRZ.js → bk-diagram-D_fQf6SF.js} +5 -5
- package/dist/standalone/chunks/{bk-dialog-DX0cPJ1o.js → bk-dialog-DwZyUUHh.js} +59 -25
- package/dist/standalone/chunks/{bk-icon-DssFsNuB.js → bk-icon-Bp_flKdv.js} +4 -3
- package/dist/standalone/chunks/{bk-image-editor-DXEj9gCu.js → bk-image-editor-BADsoLRL.js} +5 -5
- package/dist/standalone/chunks/{bk-input-date-range-Cbx_lpf0.js → bk-input-date-range-DHcJ8-5g.js} +2 -2
- package/dist/standalone/chunks/{bk-input-rich-ZB68vziu.js → bk-input-rich-CFhW6vRa.js} +6 -6
- package/dist/standalone/chunks/{bk-input-text-DD32uWNO.js → bk-input-text-DviyLBqj.js} +63 -54
- package/dist/standalone/chunks/{bk-model-viewer-Dr81ahVv.js → bk-model-viewer-w_Ah4Tvs.js} +4 -4
- package/dist/standalone/chunks/{bk-qr-code-QaYvZwOR.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-BSeO_rPs.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-CGvE4tyb.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-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-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-CyXQIJ2x.js → form-control-CHpfKAKa.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-BgYUbGO2.js} +26 -19
- package/dist/standalone/chunks/{heading-text-CV5gBf7k.js → heading-text-CgnCa_q2.js} +1 -1
- 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/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-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-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-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-BK-B4m5A.js → summary-W5s0TFqV.js} +1 -1
- package/dist/standalone/chunks/{text-field-4IUUpRHE.js → text-field-CqhJSAwZ.js} +4 -4
- package/dist/standalone/chunks/{toggle-control-ioV2jhNY.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 +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/link-CWSMsx04.js +0 -60
|
@@ -29,6 +29,8 @@ const DOUBLE_TAP_ZOOM = 2.5;
|
|
|
29
29
|
const SWIPE_DISTANCE = 48;
|
|
30
30
|
const TAP_SLOP = 8;
|
|
31
31
|
const DOUBLE_TAP_MS = 300;
|
|
32
|
+
const CLICK_STEPS = [2, 4];
|
|
33
|
+
const OWN_KEYS = "input, textarea, select, [contenteditable]:not([contenteditable=false]), [role~=textbox], [role~=searchbox], [role~=combobox], [role~=spinbutton], [role~=slider], [role~=listbox], [role~=menu], [role~=menubar], [role~=radiogroup], [role~=tablist], [role~=tree], [role~=grid], [role~=treegrid]";
|
|
32
34
|
const clamp = (v, min, max) => Math.min(max, Math.max(min, v));
|
|
33
35
|
class BkImageViewer extends LitElement {
|
|
34
36
|
static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };
|
|
@@ -36,6 +38,8 @@ class BkImageViewer extends LitElement {
|
|
|
36
38
|
items: { attribute: false },
|
|
37
39
|
index: { type: Number },
|
|
38
40
|
filmstrip: { type: Boolean, reflect: true },
|
|
41
|
+
loop: { type: Boolean, reflect: true },
|
|
42
|
+
immersive: { type: Boolean, reflect: true },
|
|
39
43
|
label: {},
|
|
40
44
|
prevLabel: { attribute: "prev-label" },
|
|
41
45
|
nextLabel: { attribute: "next-label" },
|
|
@@ -48,7 +52,8 @@ class BkImageViewer extends LitElement {
|
|
|
48
52
|
loading: { state: true },
|
|
49
53
|
failed: { state: true },
|
|
50
54
|
zoomed: { state: true },
|
|
51
|
-
ratio: { state: true }
|
|
55
|
+
ratio: { state: true },
|
|
56
|
+
thumbRatio: { state: true }
|
|
52
57
|
};
|
|
53
58
|
// Zoom and pan live outside Lit's update cycle: gestures write one transform per frame.
|
|
54
59
|
pz = new PanZoom(this, {
|
|
@@ -56,8 +61,17 @@ class BkImageViewer extends LitElement {
|
|
|
56
61
|
min: () => Math.min(1, this.actualScale),
|
|
57
62
|
max: () => Math.max(MAX_SCALE, this.actualScale * MAX_PIXEL_ZOOM),
|
|
58
63
|
content: () => this.box.w && this.box.h ? { w: this.fit.w / this.box.w, h: this.fit.h / this.box.h } : { w: 1, h: 1 },
|
|
59
|
-
onChange: () =>
|
|
64
|
+
onChange: () => this.onViewChange()
|
|
60
65
|
});
|
|
66
|
+
/** While true, a change of the view is not a change of the user: no `viewchange`. */
|
|
67
|
+
quiet = false;
|
|
68
|
+
viewChanged = false;
|
|
69
|
+
/** A view that the app set before the image had its shape. The viewer applies it again when the shape is known. */
|
|
70
|
+
pendingView = null;
|
|
71
|
+
/** The image of the last `load` event (index and URL). */
|
|
72
|
+
loadedKey = "";
|
|
73
|
+
/** The surrounding dialog whose keys the viewer handles (`immersive`). */
|
|
74
|
+
keyScope = null;
|
|
61
75
|
swipeX = 0;
|
|
62
76
|
smooth = false;
|
|
63
77
|
raf = 0;
|
|
@@ -85,6 +99,8 @@ class BkImageViewer extends LitElement {
|
|
|
85
99
|
this.items = [];
|
|
86
100
|
this.index = 0;
|
|
87
101
|
this.filmstrip = false;
|
|
102
|
+
this.loop = false;
|
|
103
|
+
this.immersive = false;
|
|
88
104
|
this.label = "";
|
|
89
105
|
this.prevLabel = "";
|
|
90
106
|
this.nextLabel = "";
|
|
@@ -98,10 +114,13 @@ class BkImageViewer extends LitElement {
|
|
|
98
114
|
this.failed = false;
|
|
99
115
|
this.zoomed = false;
|
|
100
116
|
this.ratio = 0;
|
|
117
|
+
this.thumbRatio = 0;
|
|
101
118
|
}
|
|
102
119
|
static styles = [base, srOnly, css`
|
|
103
|
-
:host { display: block; height: 100%; min-height: 0; }
|
|
120
|
+
:host { display: block; height: 100%; min-height: 0; max-block-size: var(--bk-image-viewer-max-height, none); }
|
|
104
121
|
.viewer {
|
|
122
|
+
/* Without a height of the host, the sizer gives the height; a maximum height of the host caps it. */
|
|
123
|
+
max-block-size: inherit;
|
|
105
124
|
color-scheme: var(--bk-image-viewer-color-scheme, dark);
|
|
106
125
|
--_bk-image-viewer-pad: var(--bk-image-viewer-padding, var(--bk-space-3));
|
|
107
126
|
--_bk-image-viewer-control: var(--bk-image-viewer-control-size, var(--bk-control-lg));
|
|
@@ -154,7 +173,13 @@ class BkImageViewer extends LitElement {
|
|
|
154
173
|
}
|
|
155
174
|
|
|
156
175
|
.main { position: relative; min-height: 0; }
|
|
176
|
+
/* Without a height, the viewer is as high as the image at the width of the frame (the shape of the image, else of the thumbnail). */
|
|
177
|
+
.sizer {
|
|
178
|
+
visibility: hidden; pointer-events: none; aspect-ratio: var(--_bk-image-viewer-ratio, 4 / 3);
|
|
179
|
+
margin-inline: calc(var(--_bk-image-viewer-control) + 2 * var(--_bk-image-viewer-pad)); max-block-size: 100%;
|
|
180
|
+
}
|
|
157
181
|
.stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
|
|
182
|
+
.stage.steps { cursor: zoom-in; }
|
|
158
183
|
.stage.zoomed { cursor: grab; }
|
|
159
184
|
.stage.zoomed:active { cursor: grabbing; }
|
|
160
185
|
.frame { position: absolute; inset: 0 calc(var(--_bk-image-viewer-control) + 2 * var(--_bk-image-viewer-pad)); transform-origin: 50% 50%; container-type: size; }
|
|
@@ -226,6 +251,7 @@ class BkImageViewer extends LitElement {
|
|
|
226
251
|
|
|
227
252
|
@media (max-width: 640px) {
|
|
228
253
|
.frame { inset: 0; }
|
|
254
|
+
.sizer { margin-inline: 0; }
|
|
229
255
|
}
|
|
230
256
|
@media (max-width: 480px) {
|
|
231
257
|
.level, .fit, .actual { display: none; }
|
|
@@ -252,21 +278,49 @@ class BkImageViewer extends LitElement {
|
|
|
252
278
|
else
|
|
253
279
|
void this.updateComplete.then(() => this.renderRoot.querySelector(".viewer")?.focus(options));
|
|
254
280
|
}
|
|
255
|
-
/** Moves to the previous image
|
|
281
|
+
/** Moves to the previous image. It wraps around with `loop`, else it stops at the first image. */
|
|
256
282
|
previous() {
|
|
257
283
|
this.go(this.index - 1);
|
|
258
284
|
}
|
|
259
|
-
/** Moves to the next image
|
|
285
|
+
/** Moves to the next image. It wraps around with `loop`, else it stops at the last image. */
|
|
260
286
|
next() {
|
|
261
287
|
this.go(this.index + 1);
|
|
262
288
|
}
|
|
263
|
-
/** Returns to the fitted size. */
|
|
289
|
+
/** Returns to the fitted size. It fires no `viewchange`. */
|
|
264
290
|
resetZoom() {
|
|
291
|
+
this.silently(() => this.zoomFit());
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* The zoom and the visible part of the image (`ImageViewerView`). Set it to show the same part as another
|
|
295
|
+
* viewer, for example in `viewchange` of that viewer. Setting it fires no `viewchange`. A view that you set
|
|
296
|
+
* before the image has its shape applies again when the shape is known.
|
|
297
|
+
*/
|
|
298
|
+
get view() {
|
|
299
|
+
const { zoom, x, y } = this.pz.get();
|
|
300
|
+
const { kx, ky } = this.pictureScale();
|
|
301
|
+
return { zoom, x: 0.5 + (x - 0.5) * kx, y: 0.5 + (y - 0.5) * ky };
|
|
302
|
+
}
|
|
303
|
+
set view(v) {
|
|
304
|
+
this.pendingView = { ...this.view, ...v };
|
|
305
|
+
this.applyPendingView();
|
|
306
|
+
}
|
|
307
|
+
/** The width of the shown image in image pixels, as `naturalWidth` of an `<img>`. It is 0 while unknown. */
|
|
308
|
+
get naturalWidth() {
|
|
309
|
+
return this.failed ? 0 : this.image?.naturalWidth ?? 0;
|
|
310
|
+
}
|
|
311
|
+
/** The height of the shown image in image pixels, as `naturalHeight` of an `<img>`. It is 0 while unknown. */
|
|
312
|
+
get naturalHeight() {
|
|
313
|
+
return this.failed ? 0 : this.image?.naturalHeight ?? 0;
|
|
314
|
+
}
|
|
315
|
+
/** Shows the image at its actual size: one image pixel per screen pixel. It fires no `viewchange`. */
|
|
316
|
+
actualSize() {
|
|
317
|
+
this.silently(() => this.zoomActual());
|
|
318
|
+
}
|
|
319
|
+
zoomFit() {
|
|
265
320
|
this.pz.set({ zoom: 1, x: 0.5, y: 0.5 });
|
|
266
321
|
this.apply(true);
|
|
267
322
|
}
|
|
268
|
-
|
|
269
|
-
actualSize() {
|
|
323
|
+
zoomActual() {
|
|
270
324
|
if (!this.box.w)
|
|
271
325
|
this.measure();
|
|
272
326
|
this.zoomTo(this.actualScale);
|
|
@@ -279,8 +333,14 @@ class BkImageViewer extends LitElement {
|
|
|
279
333
|
get actualScale() {
|
|
280
334
|
return this.natural.w && this.fit.w ? this.natural.w / this.fit.w : 1;
|
|
281
335
|
}
|
|
336
|
+
connectedCallback() {
|
|
337
|
+
super.connectedCallback();
|
|
338
|
+
if (this.hasUpdated)
|
|
339
|
+
this.bindKeyScope();
|
|
340
|
+
}
|
|
282
341
|
disconnectedCallback() {
|
|
283
342
|
super.disconnectedCallback();
|
|
343
|
+
this.unbindKeyScope();
|
|
284
344
|
this.resizer.disconnect();
|
|
285
345
|
this.observed = null;
|
|
286
346
|
this.pointers.clear();
|
|
@@ -292,15 +352,19 @@ class BkImageViewer extends LitElement {
|
|
|
292
352
|
willUpdate(changed) {
|
|
293
353
|
const n = this.items.length;
|
|
294
354
|
this.index = clamp(Math.trunc(this.index) || 0, 0, Math.max(0, n - 1));
|
|
355
|
+
const active = this.hasUpdated && this.renderRoot instanceof ShadowRoot ? this.renderRoot.activeElement : null;
|
|
356
|
+
if (active && !this.loop && (active.matches(".prev") && this.index <= 0 || active.matches(".next") && this.index >= n - 1))
|
|
357
|
+
this.focus();
|
|
295
358
|
if (changed.has("index") || changed.has("items")) {
|
|
296
359
|
this.loading = n > 0;
|
|
297
360
|
this.failed = false;
|
|
298
361
|
this.swipeX = 0;
|
|
299
|
-
this.pz.set({ zoom: 1, x: 0.5, y: 0.5 });
|
|
362
|
+
this.silently(() => this.pz.set({ zoom: 1, x: 0.5, y: 0.5 }));
|
|
300
363
|
this.zoomed = false;
|
|
301
364
|
this.natural = { w: 0, h: 0 };
|
|
302
365
|
const item = this.items[this.index];
|
|
303
366
|
this.ratio = item?.width && item.height ? item.width / item.height : 0;
|
|
367
|
+
this.thumbRatio = 0;
|
|
304
368
|
if (item && !isServer) {
|
|
305
369
|
const probe = new Image();
|
|
306
370
|
probe.src = item.full || item.src;
|
|
@@ -319,6 +383,8 @@ class BkImageViewer extends LitElement {
|
|
|
319
383
|
this.resizer.observe(frame);
|
|
320
384
|
this.observed = frame;
|
|
321
385
|
}
|
|
386
|
+
if (changed.has("immersive"))
|
|
387
|
+
this.bindKeyScope();
|
|
322
388
|
if (changed.has("index") || changed.has("items")) {
|
|
323
389
|
const img = this.image;
|
|
324
390
|
if (img?.complete && img.naturalWidth) {
|
|
@@ -332,8 +398,73 @@ class BkImageViewer extends LitElement {
|
|
|
332
398
|
this.watchSize();
|
|
333
399
|
this.preloadNeighbours();
|
|
334
400
|
revealInside(this.renderRoot.querySelector('.thumb[aria-current="true"]'), this);
|
|
401
|
+
this.applyPendingView();
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
/** Runs `fn` without a `viewchange`: a change that the app or the viewer makes, not the user. */
|
|
405
|
+
silently(fn) {
|
|
406
|
+
const was = this.quiet;
|
|
407
|
+
this.quiet = true;
|
|
408
|
+
try {
|
|
409
|
+
fn();
|
|
410
|
+
} finally {
|
|
411
|
+
this.quiet = was;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
onViewChange() {
|
|
415
|
+
if (this.quiet)
|
|
416
|
+
return;
|
|
417
|
+
this.pendingView = null;
|
|
418
|
+
this.viewChanged = true;
|
|
419
|
+
}
|
|
420
|
+
/** The factors from fractions of the frame to fractions of the fitted image. */
|
|
421
|
+
pictureScale() {
|
|
422
|
+
return { kx: this.fit.w ? this.box.w / this.fit.w : 1, ky: this.fit.h ? this.box.h / this.fit.h : 1 };
|
|
423
|
+
}
|
|
424
|
+
applyPendingView() {
|
|
425
|
+
const v = this.pendingView;
|
|
426
|
+
if (!v || !this.hasUpdated || this.isUpdatePending || !this.frame)
|
|
427
|
+
return;
|
|
428
|
+
this.measure();
|
|
429
|
+
const { kx, ky } = this.pictureScale();
|
|
430
|
+
this.silently(() => this.pz.set({ zoom: v.zoom, x: 0.5 + (v.x - 0.5) / kx, y: 0.5 + (v.y - 0.5) / ky }));
|
|
431
|
+
this.apply(false);
|
|
432
|
+
if (this.ratio)
|
|
433
|
+
this.pendingView = null;
|
|
434
|
+
}
|
|
435
|
+
// ---- the keys of a surrounding dialog (`immersive`) ----
|
|
436
|
+
bindKeyScope() {
|
|
437
|
+
this.unbindKeyScope();
|
|
438
|
+
if (!this.immersive || !this.isConnected)
|
|
439
|
+
return;
|
|
440
|
+
for (let el = this; el; el = el.parentElement ?? (el.getRootNode().host ?? null)) {
|
|
441
|
+
if (el !== this && (el.localName === "dialog" || el.localName === "bk-dialog" || el.getAttribute("role") === "dialog")) {
|
|
442
|
+
this.keyScope = el;
|
|
443
|
+
el.addEventListener("keydown", this.onScopeKey);
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
335
446
|
}
|
|
336
447
|
}
|
|
448
|
+
unbindKeyScope() {
|
|
449
|
+
this.keyScope?.removeEventListener("keydown", this.onScopeKey);
|
|
450
|
+
this.keyScope = null;
|
|
451
|
+
}
|
|
452
|
+
/** A key in the dialog outside the viewer. A field or a widget that uses the key itself keeps it. */
|
|
453
|
+
onScopeKey = (event) => {
|
|
454
|
+
const e = event;
|
|
455
|
+
if (e.defaultPrevented)
|
|
456
|
+
return;
|
|
457
|
+
const path = e.composedPath();
|
|
458
|
+
if (path.includes(this))
|
|
459
|
+
return;
|
|
460
|
+
for (const node of path) {
|
|
461
|
+
if (node === this.keyScope)
|
|
462
|
+
break;
|
|
463
|
+
if (node instanceof Element && (node.matches(OWN_KEYS) || node.isContentEditable))
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
this.onKey(e);
|
|
467
|
+
};
|
|
337
468
|
/**
|
|
338
469
|
* Reads the size of the full image as soon as the browser knows it (from the file header, long
|
|
339
470
|
* before the whole image has loaded), so the placeholder can use its shape.
|
|
@@ -349,6 +480,7 @@ class BkImageViewer extends LitElement {
|
|
|
349
480
|
this.ratio = img.naturalWidth / img.naturalHeight;
|
|
350
481
|
this.measure();
|
|
351
482
|
this.apply(false);
|
|
483
|
+
this.applyPendingView();
|
|
352
484
|
return;
|
|
353
485
|
}
|
|
354
486
|
this.sizeWatch = requestAnimationFrame(check);
|
|
@@ -360,6 +492,8 @@ class BkImageViewer extends LitElement {
|
|
|
360
492
|
if (n < 2)
|
|
361
493
|
return;
|
|
362
494
|
for (const i of [this.index + 1, this.index - 1]) {
|
|
495
|
+
if (!this.loop && (i < 0 || i >= n))
|
|
496
|
+
continue;
|
|
363
497
|
const it = this.items[(i + n) % n];
|
|
364
498
|
const url = it.full || it.src;
|
|
365
499
|
if (this.preloaded.has(url))
|
|
@@ -371,15 +505,17 @@ class BkImageViewer extends LitElement {
|
|
|
371
505
|
}
|
|
372
506
|
}
|
|
373
507
|
// ---- navigation ----
|
|
508
|
+
/** Moves to image `i`. It wraps around with `loop`, else it stops at the ends. Returns false when the image stays. */
|
|
374
509
|
go(i) {
|
|
375
510
|
const n = this.items.length;
|
|
376
511
|
if (n < 2)
|
|
377
|
-
return;
|
|
378
|
-
const next = (i % n + n) % n;
|
|
512
|
+
return false;
|
|
513
|
+
const next = this.loop ? (i % n + n) % n : clamp(i, 0, n - 1);
|
|
379
514
|
if (next === this.index)
|
|
380
|
-
return;
|
|
515
|
+
return false;
|
|
381
516
|
this.index = next;
|
|
382
517
|
emitDetail(this, "change", { index: next });
|
|
518
|
+
return true;
|
|
383
519
|
}
|
|
384
520
|
/** How far a key or a pan button moves the image, in px. */
|
|
385
521
|
get panStep() {
|
|
@@ -401,8 +537,8 @@ class BkImageViewer extends LitElement {
|
|
|
401
537
|
"+": () => this.zoomTo(this.pz.zoom * ZOOM_STEP),
|
|
402
538
|
"=": () => this.zoomTo(this.pz.zoom * ZOOM_STEP),
|
|
403
539
|
"-": () => this.zoomTo(this.pz.zoom / ZOOM_STEP),
|
|
404
|
-
"0": () => this.
|
|
405
|
-
"1": () => this.
|
|
540
|
+
"0": () => this.zoomFit(),
|
|
541
|
+
"1": () => this.zoomActual()
|
|
406
542
|
});
|
|
407
543
|
const act = keys[e.key];
|
|
408
544
|
if (!act)
|
|
@@ -415,11 +551,10 @@ class BkImageViewer extends LitElement {
|
|
|
415
551
|
const f = this.frame;
|
|
416
552
|
if (!f)
|
|
417
553
|
return;
|
|
418
|
-
const r = f.getBoundingClientRect();
|
|
419
|
-
const
|
|
420
|
-
const w = r.width
|
|
421
|
-
|
|
422
|
-
this.box = { x: r.left + r.width / 2 - tx - this.swipeX, y: r.top + r.height / 2 - ty, w, h };
|
|
554
|
+
const r = (f.parentElement ?? f).getBoundingClientRect();
|
|
555
|
+
const inset = parseFloat(getComputedStyle(f).left) || 0;
|
|
556
|
+
const w = Math.max(0, r.width - 2 * inset), h = r.height;
|
|
557
|
+
this.box = { x: r.left + r.width / 2, y: r.top + r.height / 2, w, h };
|
|
423
558
|
const img = this.image;
|
|
424
559
|
if (img?.naturalWidth && img.naturalHeight) {
|
|
425
560
|
const k = Math.min(w / img.naturalWidth, h / img.naturalHeight);
|
|
@@ -459,6 +594,10 @@ class BkImageViewer extends LitElement {
|
|
|
459
594
|
const level = this.renderRoot.querySelector(".level");
|
|
460
595
|
if (level)
|
|
461
596
|
level.textContent = ratio ? this.formatPercent(ratio) : "";
|
|
597
|
+
if (this.viewChanged) {
|
|
598
|
+
this.viewChanged = false;
|
|
599
|
+
emitDetail(this, "viewchange", this.view);
|
|
600
|
+
}
|
|
462
601
|
});
|
|
463
602
|
}
|
|
464
603
|
formatPercent(ratio) {
|
|
@@ -470,7 +609,7 @@ class BkImageViewer extends LitElement {
|
|
|
470
609
|
}
|
|
471
610
|
/** Keeps the image in view after a change of the size of the frame or the image. */
|
|
472
611
|
clampPan() {
|
|
473
|
-
this.pz.set({});
|
|
612
|
+
this.silently(() => this.pz.set({}));
|
|
474
613
|
}
|
|
475
614
|
/** Zooms to `s`. The image point under (cx, cy) stays in place. The default point is the centre. */
|
|
476
615
|
zoomTo(s, cx = this.box.x, cy = this.box.y, animate = true) {
|
|
@@ -488,6 +627,8 @@ class BkImageViewer extends LitElement {
|
|
|
488
627
|
this.apply(true);
|
|
489
628
|
}
|
|
490
629
|
onWheel(e) {
|
|
630
|
+
if (!this.immersive && !this.zoomed && !e.ctrlKey && !e.metaKey)
|
|
631
|
+
return;
|
|
491
632
|
e.preventDefault();
|
|
492
633
|
const delta = e.deltaMode === 1 ? e.deltaY * 16 : e.deltaY;
|
|
493
634
|
this.zoomTo(this.pz.zoom * Math.exp(-delta * (e.ctrlKey ? 0.01 : 2e-3)), e.clientX, e.clientY, false);
|
|
@@ -552,29 +693,42 @@ class BkImageViewer extends LitElement {
|
|
|
552
693
|
const dx = this.swipeX;
|
|
553
694
|
if (dx) {
|
|
554
695
|
this.swipeX = 0;
|
|
555
|
-
if (e.type
|
|
556
|
-
this.go(this.index + (dx < 0 ? 1 : -1));
|
|
557
|
-
else
|
|
696
|
+
if (e.type === "pointercancel" || Math.abs(dx) <= SWIPE_DISTANCE || !this.go(this.index + (dx < 0 ? 1 : -1)))
|
|
558
697
|
this.apply(true);
|
|
559
698
|
return;
|
|
560
699
|
}
|
|
561
700
|
if (!this.drag.moved && e.type === "pointerup")
|
|
562
701
|
this.onTap(e);
|
|
563
702
|
}
|
|
564
|
-
/**
|
|
703
|
+
/**
|
|
704
|
+
* A double tap or double click toggles the zoom. A single tap beside the image closes the viewer.
|
|
705
|
+
* In an `immersive` viewer a click (mouse or pen) steps the zoom: 2×, 4×, then the fitted size.
|
|
706
|
+
*/
|
|
565
707
|
onTap(e) {
|
|
708
|
+
const outside = Math.abs(e.clientX - this.box.x) > this.fit.w / 2 || Math.abs(e.clientY - this.box.y) > this.fit.h / 2;
|
|
709
|
+
if (this.immersive && e.pointerType !== "touch") {
|
|
710
|
+
if (!this.zoomed && outside) {
|
|
711
|
+
emit(this, "dismiss");
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
const step = CLICK_STEPS.find((s) => this.pz.zoom < s - 0.01);
|
|
715
|
+
if (step)
|
|
716
|
+
this.zoomTo(step, e.clientX, e.clientY);
|
|
717
|
+
else
|
|
718
|
+
this.zoomFit();
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
566
721
|
const now = e.timeStamp;
|
|
567
722
|
const last = this.lastTap;
|
|
568
723
|
if (now - last.t < DOUBLE_TAP_MS && Math.hypot(e.clientX - last.x, e.clientY - last.y) < 30) {
|
|
569
724
|
this.lastTap = { t: 0, x: 0, y: 0 };
|
|
570
725
|
if (this.zoomed)
|
|
571
|
-
this.
|
|
726
|
+
this.zoomFit();
|
|
572
727
|
else
|
|
573
728
|
this.zoomTo(DOUBLE_TAP_ZOOM, e.clientX, e.clientY);
|
|
574
729
|
return;
|
|
575
730
|
}
|
|
576
731
|
this.lastTap = { t: now, x: e.clientX, y: e.clientY };
|
|
577
|
-
const outside = Math.abs(e.clientX - this.box.x) > this.fit.w / 2 || Math.abs(e.clientY - this.box.y) > this.fit.h / 2;
|
|
578
732
|
if (!this.zoomed && outside)
|
|
579
733
|
emit(this, "dismiss");
|
|
580
734
|
}
|
|
@@ -589,9 +743,22 @@ class BkImageViewer extends LitElement {
|
|
|
589
743
|
}
|
|
590
744
|
/** Fits the loaded image into the frame. It does not change reactive state. */
|
|
591
745
|
placeImage() {
|
|
592
|
-
this.
|
|
746
|
+
const src = this.image?.getAttribute("src") ?? "";
|
|
747
|
+
this.preloaded.add(src);
|
|
593
748
|
this.measure();
|
|
594
749
|
this.apply(false);
|
|
750
|
+
this.applyPendingView();
|
|
751
|
+
const key = `${this.index}|${src}`;
|
|
752
|
+
if (key !== this.loadedKey) {
|
|
753
|
+
this.loadedKey = key;
|
|
754
|
+
this.dispatchEvent(new Event("load"));
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
/** The thumbnail gives the height of the viewer until the shape of the full image is known. */
|
|
758
|
+
onThumbLoad(e) {
|
|
759
|
+
const img = e.target;
|
|
760
|
+
if (img.naturalWidth && img.naturalHeight)
|
|
761
|
+
this.thumbRatio = img.naturalWidth / img.naturalHeight;
|
|
595
762
|
}
|
|
596
763
|
onImageError(e) {
|
|
597
764
|
if (e.target !== this.image)
|
|
@@ -608,7 +775,10 @@ class BkImageViewer extends LitElement {
|
|
|
608
775
|
const many = n > 1;
|
|
609
776
|
const full = item.full || item.src;
|
|
610
777
|
const strip = this.filmstrip && many;
|
|
778
|
+
const atStart = !this.loop && this.index <= 0;
|
|
779
|
+
const atEnd = !this.loop && this.index >= n - 1;
|
|
611
780
|
return html`<div class="viewer" part="base" role="region" tabindex="0"
|
|
781
|
+
style=${styleMap({ "--_bk-image-viewer-ratio": this.ratio || this.thumbRatio || void 0 })}
|
|
612
782
|
aria-label=${this.label || this.i18n.t("imageViewer")} @keydown=${this.onKey}>
|
|
613
783
|
<div class="bar" part="toolbar">
|
|
614
784
|
<span class="counter" part="counter" aria-live="polite" aria-atomic="true">${many ? html`<span aria-hidden="true">${this.index + 1} / ${n}</span><span class="sr-only">${this.i18n.t("imageCounter", { index: this.index + 1, total: n })}</span>` : ""}</span>
|
|
@@ -616,20 +786,21 @@ class BkImageViewer extends LitElement {
|
|
|
616
786
|
<bk-button variant="ghost" class="control" size="lg" label=${this.zoomOutLabel || this.i18n.t("zoomOut")} icon="zoom-out" @click=${() => this.zoomTo(this.pz.zoom / ZOOM_STEP)}></bk-button>
|
|
617
787
|
<output class="level" part="zoom-level" aria-live="off" aria-label=${this.i18n.t("zoomLevel")}></output>
|
|
618
788
|
<bk-button variant="ghost" class="control" size="lg" label=${this.zoomInLabel || this.i18n.t("zoomIn")} icon="zoom-in" @click=${() => this.zoomTo(this.pz.zoom * ZOOM_STEP)}></bk-button>
|
|
619
|
-
<bk-button variant="ghost" class="control fit" size="lg" label=${this.fitLabel || this.i18n.t("zoomFit")} icon="fit-screen" @click=${() => this.
|
|
620
|
-
<bk-button variant="ghost" class="control actual" size="lg" label=${this.actualSizeLabel || this.i18n.t("zoomActual")} icon="actual-size" @click=${() => this.
|
|
789
|
+
<bk-button variant="ghost" class="control fit" size="lg" label=${this.fitLabel || this.i18n.t("zoomFit")} icon="fit-screen" @click=${() => this.zoomFit()}></bk-button>
|
|
790
|
+
<bk-button variant="ghost" class="control actual" size="lg" label=${this.actualSizeLabel || this.i18n.t("zoomActual")} icon="actual-size" @click=${() => this.zoomActual()}></bk-button>
|
|
621
791
|
</span>
|
|
622
792
|
<span class="actions"><slot name="actions"></slot></span>
|
|
623
793
|
</div>
|
|
624
794
|
<div class="main">
|
|
625
|
-
<div class="
|
|
795
|
+
<div class="sizer" aria-hidden="true"></div>
|
|
796
|
+
<div class="stage ${this.zoomed ? "zoomed" : ""} ${this.immersive ? "steps" : ""}" part="stage" @wheel=${this.onWheel}
|
|
626
797
|
@pointerdown=${this.onPointerDown} @pointermove=${this.onPointerMove}
|
|
627
798
|
@pointerup=${this.onPointerUp} @pointercancel=${this.onPointerUp}>
|
|
628
799
|
<div class="frame">${keyed(`${this.index}|${full}`, html`
|
|
629
800
|
<img class="image ${this.loading ? "" : "loaded"} ${this.failed ? "failed" : ""}" part="image" src=${full} alt=${item.alt} decoding="async"
|
|
630
801
|
draggable="false" @load=${this.onImageLoad} @error=${this.onImageError}>
|
|
631
|
-
${full !== item.src ? html`<img class="placeholder ${this.ratio ? "shaped" : ""}"
|
|
632
|
-
src=${item.src} alt="" aria-hidden="true" decoding="async" draggable="false">` : nothing}`)}
|
|
802
|
+
${full !== item.src ? html`<img class="placeholder ${this.ratio ? "shaped" : ""}"
|
|
803
|
+
src=${item.src} alt="" aria-hidden="true" decoding="async" draggable="false" @load=${this.onThumbLoad}>` : nothing}`)}
|
|
633
804
|
</div>
|
|
634
805
|
${this.loading ? html`<span class="spinner"><bk-spinner size="lg"></bk-spinner></span>` : nothing}
|
|
635
806
|
${this.failed ? html`<p class="error" role="alert"><bk-icon name="error" size="md"></bk-icon>${this.errorLabel || this.i18n.t("imageError")}</p>` : nothing}
|
|
@@ -641,8 +812,8 @@ class BkImageViewer extends LitElement {
|
|
|
641
812
|
<bk-button variant="ghost" class="control" size="sm" icon="chevron-right" label=${this.i18n.t("panRight")} @click=${() => this.panBy(-this.panStep, 0)}></bk-button>
|
|
642
813
|
</span>
|
|
643
814
|
${many ? html`
|
|
644
|
-
<bk-button variant="ghost" class="control nav prev" part="nav" size="lg" icon="chevron-left" label=${this.prevLabel || this.i18n.t("previousImage")} @click=${() => this.go(this.index - 1)}></bk-button>
|
|
645
|
-
<bk-button variant="ghost" class="control nav next" part="nav" size="lg" icon="chevron-right" label=${this.nextLabel || this.i18n.t("nextImage")} @click=${() => this.go(this.index + 1)}></bk-button>` : nothing}
|
|
815
|
+
<bk-button variant="ghost" class="control nav prev" part="nav" size="lg" icon="chevron-left" label=${this.prevLabel || this.i18n.t("previousImage")} ?disabled=${atStart} @click=${() => this.go(this.index - 1)}></bk-button>
|
|
816
|
+
<bk-button variant="ghost" class="control nav next" part="nav" size="lg" icon="chevron-right" label=${this.nextLabel || this.i18n.t("nextImage")} ?disabled=${atEnd} @click=${() => this.go(this.index + 1)}></bk-button>` : nothing}
|
|
646
817
|
</div>
|
|
647
818
|
<div class="foot" ?hidden=${!item.caption && !strip}>
|
|
648
819
|
${item.caption ? html`<p class="caption" part="caption">${item.caption}</p>` : nothing}
|
|
@@ -26,9 +26,10 @@ export interface InputInlineSaveDetail {
|
|
|
26
26
|
* With a mouse the pencil overlays the row after the text. It needs no room, so content after the
|
|
27
27
|
* element keeps the normal gap and does not move when the pencil shows. On a touch screen the pencil is in the row.
|
|
28
28
|
* A field rendered open from the start (`editing` in the markup) waits for the user. On hover the text shows a tint where
|
|
29
|
-
* the frame of the open field is. The check button replaces the pencil.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* the frame of the open field is. The check button replaces the pencil.
|
|
30
|
+
* Enter, the check, Tab out of the element and a click outside save, as in a cell of a spreadsheet. Only Esc and the
|
|
31
|
+
* cancel button of an `edit` control cancel. Esc never reaches a surrounding dialog. After Enter, the check or Esc, the
|
|
32
|
+
* focus returns to the pencil. The first Tab reaches the check. The next Tab saves and moves the focus on.
|
|
32
33
|
*
|
|
33
34
|
* Editing does not change the look of the line. The field uses the font, weight, colour and line
|
|
34
35
|
* height of the text. The text stays where it is, and the field is as wide as its text. The frame
|
|
@@ -40,7 +41,9 @@ export interface InputInlineSaveDetail {
|
|
|
40
41
|
* Saving fires `save` with `{ value, done }`. For a server round trip call `preventDefault()`,
|
|
41
42
|
* then `done()` on success or `done("Name already taken")` to keep the field open with that
|
|
42
43
|
* error (shown under the field and announced as an alert); the field is busy until then. Without `preventDefault()` the field
|
|
43
|
-
* accepts the new value right away. An unchanged value closes the field like cancel.
|
|
44
|
+
* accepts the new value right away. An unchanged value closes the field like cancel. An empty value also fires `save`
|
|
45
|
+
* (without `required`), so the app can put a default name in its place. An error keeps the field open and takes the focus
|
|
46
|
+
* back, also after Tab or a click outside.
|
|
44
47
|
*
|
|
45
48
|
* **Any field.** Put a form control in the `edit` slot to edit more than text: a select, a date, a text area, a
|
|
46
49
|
* combobox. Put the read view in the `display` slot (a badge, a formatted date, a link); without it the view shows
|
|
@@ -78,11 +81,12 @@ export interface InputInlineSaveDetail {
|
|
|
78
81
|
* @cssprop --bk-input-inline-error-bg - Background of the error under the field (default --bk-layer-overlay-bg).
|
|
79
82
|
* @cssprop --bk-input-inline-error-shadow - Shadow of the error under the field (default --bk-layer-overlay-shadow).
|
|
80
83
|
* @fires {CustomEvent<InputInlineSaveDetail>} save - The user confirms a changed value; `event.detail` is `{ value, done }`.
|
|
81
|
-
* @fires {Event} cancel - The field closes without saving: Esc or
|
|
84
|
+
* @fires {Event} cancel - The field closes without saving: Esc, the cancel button or an unchanged value (does not bubble, so dialogs around it stay open).
|
|
82
85
|
*
|
|
83
86
|
* @tag bk-input-inline
|
|
84
87
|
* @keyboard Enter, Space - On the edit button: open the field.
|
|
85
88
|
* @keyboard Enter - In the field: save. A multiline field and a list in the `edit` slot keep their own Enter.
|
|
89
|
+
* @keyboard Tab, Shift+Tab - Out of the element: save and move the focus on. Inside it, Tab reaches the check first.
|
|
86
90
|
* @keyboard Escape - Cancel and show the old value. A dialog around the field stays open.
|
|
87
91
|
* @a11y The read view is text with an edit button that names what it edits. The open field receives the focus and names the Escape key in its description. After save or cancel the focus returns to the edit button. An error is an alert.
|
|
88
92
|
*/
|
|
@@ -165,8 +169,13 @@ export declare class BkInputInline extends LitElement {
|
|
|
165
169
|
private renderSave;
|
|
166
170
|
/** A click on the read view opens the field, unless it hits a link or a button of the view. */
|
|
167
171
|
private onDisplayClick;
|
|
168
|
-
/** A press outside the element
|
|
172
|
+
/** A press outside the element saves; a save in progress stays. */
|
|
169
173
|
private onOutside;
|
|
174
|
+
/**
|
|
175
|
+
* Focus that leaves the element (Tab, Shift+Tab) saves. Focus that moves inside it (the check, the popup of a control)
|
|
176
|
+
* does not. Without a new target (the window loses the focus) the field stays open.
|
|
177
|
+
*/
|
|
178
|
+
private onFocusOut;
|
|
170
179
|
disconnectedCallback(): void;
|
|
171
180
|
render(): import("lit-html").TemplateResult<1>;
|
|
172
181
|
}
|
|
@@ -41,6 +41,7 @@ class BkInputInline extends LitElement {
|
|
|
41
41
|
this.editing = false;
|
|
42
42
|
this.busy = false;
|
|
43
43
|
this.error = "";
|
|
44
|
+
this.addEventListener("focusout", this.onFocusOut);
|
|
44
45
|
}
|
|
45
46
|
static styles = [base, srOnly, css`
|
|
46
47
|
:host {
|
|
@@ -48,7 +49,11 @@ class BkInputInline extends LitElement {
|
|
|
48
49
|
--_bk-inline-px: var(--bk-input-inline-pad-inline, var(--bk-space-1-5));
|
|
49
50
|
--_bk-inline-py: var(--bk-input-inline-pad-block, var(--bk-space-1));
|
|
50
51
|
--_bk-inline-bw: var(--bk-field-border-width, var(--bk-border-width));
|
|
52
|
+
--_bk-input-inline-ctl: var(--bk-control-md);
|
|
53
|
+
--_bk-input-inline-pencil-gap: max(var(--bk-input-inline-gap, var(--bk-space-1)), calc(var(--_bk-inline-px) + var(--_bk-inline-bw)));
|
|
51
54
|
}
|
|
55
|
+
:host([size="sm"]) { --_bk-input-inline-ctl: var(--bk-control-sm); }
|
|
56
|
+
:host([size="lg"]) { --_bk-input-inline-ctl: var(--bk-control-lg); }
|
|
52
57
|
:host([size="sm"]) :is(.text, input) { font-size: var(--bk-type-small); }
|
|
53
58
|
:host([size="lg"]) :is(.text, input) { font-size: var(--bk-type-lead); }
|
|
54
59
|
/* One line, as tall in both: with line-height normal an input and a span measure their line differently. */
|
|
@@ -73,11 +78,8 @@ class BkInputInline extends LitElement {
|
|
|
73
78
|
reach over the line by the same amount above and below instead of making the line taller, so the text stays. */
|
|
74
79
|
.pencil {
|
|
75
80
|
display: inline-flex;
|
|
76
|
-
--_bk-input-inline-ctl: var(--bk-control-md);
|
|
77
81
|
margin-block: min(0px, calc((1lh - var(--_bk-input-inline-ctl)) / 2));
|
|
78
82
|
}
|
|
79
|
-
:host([size="sm"]) .pencil { --_bk-input-inline-ctl: var(--bk-control-sm); }
|
|
80
|
-
:host([size="lg"]) .pencil { --_bk-input-inline-ctl: var(--bk-control-lg); }
|
|
81
83
|
.pencil { opacity: 0; transition: opacity var(--bk-duration-fast); }
|
|
82
84
|
/* The pencil reaches over the line: its focus ring goes inside it, so it does not touch the text around. */
|
|
83
85
|
.pencil bk-button { --bk-button-focus-offset: var(--bk-focus-offset-inset); }
|
|
@@ -126,8 +128,9 @@ class BkInputInline extends LitElement {
|
|
|
126
128
|
pointer. The check of the open field stands in the same place. With a slotted editor the check and the cancel
|
|
127
129
|
button stay in the row. */
|
|
128
130
|
@media (hover: hover) and (forced-colors: none) {
|
|
131
|
+
/* The host leaves room for the pencil in its container: a full line does not push the pencil out of it. */
|
|
132
|
+
:host { max-width: calc(100% - var(--_bk-input-inline-pencil-gap) - var(--_bk-input-inline-ctl)); }
|
|
129
133
|
:is(.text, .display, .edit:not(.slotted)) + .pencil {
|
|
130
|
-
--_bk-input-inline-pencil-gap: max(var(--bk-input-inline-gap, var(--bk-space-1)), calc(var(--_bk-inline-px) + var(--_bk-inline-bw)));
|
|
131
134
|
position: relative; z-index: 1; flex: none;
|
|
132
135
|
inline-size: calc(var(--_bk-input-inline-pencil-gap) + var(--_bk-input-inline-ctl));
|
|
133
136
|
margin-inline: calc(-1 * var(--bk-input-inline-gap, var(--bk-space-1))) calc(-1 * (var(--_bk-input-inline-pencil-gap) + var(--_bk-input-inline-ctl)));
|
|
@@ -304,11 +307,24 @@ class BkInputInline extends LitElement {
|
|
|
304
307
|
return;
|
|
305
308
|
this.edit();
|
|
306
309
|
};
|
|
307
|
-
/** A press outside the element
|
|
310
|
+
/** A press outside the element saves; a save in progress stays. */
|
|
308
311
|
onOutside = (e) => {
|
|
309
312
|
if (this.busy || e.composedPath().includes(this))
|
|
310
313
|
return;
|
|
311
|
-
this.
|
|
314
|
+
this.save();
|
|
315
|
+
};
|
|
316
|
+
/**
|
|
317
|
+
* Focus that leaves the element (Tab, Shift+Tab) saves. Focus that moves inside it (the check, the popup of a control)
|
|
318
|
+
* does not. Without a new target (the window loses the focus) the field stays open.
|
|
319
|
+
*/
|
|
320
|
+
onFocusOut = (e) => {
|
|
321
|
+
if (!this.editing || this.busy)
|
|
322
|
+
return;
|
|
323
|
+
const next = e.relatedTarget;
|
|
324
|
+
if (!next || next === this || this.contains(next) || this.renderRoot?.contains(next))
|
|
325
|
+
return;
|
|
326
|
+
this.save();
|
|
327
|
+
this.restoreFocus = false;
|
|
312
328
|
};
|
|
313
329
|
disconnectedCallback() {
|
|
314
330
|
super.disconnectedCallback();
|
|
@@ -6,6 +6,7 @@ import { emit } from "../internal/events.js";
|
|
|
6
6
|
import { parseNumber, snapToStep, stepDecimals, stepFormat } from "../internal/number.js";
|
|
7
7
|
import { TextField } from "../internal/text-field.js";
|
|
8
8
|
import "./bk-icon.js";
|
|
9
|
+
import { submitImplicitly } from "../internal/submit.js";
|
|
9
10
|
import "../icons/set/add.js";
|
|
10
11
|
import "../icons/set/remove.js";
|
|
11
12
|
class BkInputNumber extends TextField {
|
|
@@ -301,7 +302,7 @@ class BkInputNumber extends TextField {
|
|
|
301
302
|
case "Enter":
|
|
302
303
|
this.commitText(true);
|
|
303
304
|
if (this.internals.form)
|
|
304
|
-
setTimeout(() => this.internals.form
|
|
305
|
+
setTimeout(() => submitImplicitly(this.internals.form));
|
|
305
306
|
return;
|
|
306
307
|
default:
|
|
307
308
|
return;
|
|
@@ -98,7 +98,7 @@ export declare function clauseText(c: SearchClause): string;
|
|
|
98
98
|
* @cssprop --bk-input-search-input-min-width - Narrowest text field next to the tokens before it wraps (default 6ch).
|
|
99
99
|
* @cssprop --bk-input-search-popup-bg - Popup background (default --bk-layer-overlay-bg).
|
|
100
100
|
* @cssprop --bk-input-search-popup-border - Popup border colour (default --bk-layer-overlay-border).
|
|
101
|
-
* @cssprop --bk-input-search-popup-radius - Popup corner radius (default --bk-radius
|
|
101
|
+
* @cssprop --bk-input-search-popup-radius - Popup corner radius (default --bk-row-radius + the padding + the border: concentric with the rows).
|
|
102
102
|
* @cssprop --bk-input-search-popup-shadow - Popup shadow (default --bk-layer-overlay-shadow).
|
|
103
103
|
* @cssprop --bk-input-search-popup-padding - Space between popup edge and rows (default --bk-space-1).
|
|
104
104
|
* @cssprop --bk-input-search-popup-offset - Gap between box and popup (default --bk-space-1).
|
|
@@ -8,6 +8,7 @@ import { edgeOption, matchesText } from "../internal/options.js";
|
|
|
8
8
|
import "./bk-chip.js";
|
|
9
9
|
import "./bk-icon.js";
|
|
10
10
|
import "./bk-spinner.js";
|
|
11
|
+
import { submitImplicitly } from "../internal/submit.js";
|
|
11
12
|
import "../icons/set/search.js";
|
|
12
13
|
function splitWords(text) {
|
|
13
14
|
return text.match(/(?:[^\s"]|"[^"]*"?)+/g) ?? [];
|
|
@@ -299,7 +300,7 @@ class BkInputSearch extends ChoiceField {
|
|
|
299
300
|
const go = emitDetail(this, "search", detail, true);
|
|
300
301
|
const form = this.internals.form;
|
|
301
302
|
if (go && form)
|
|
302
|
-
setTimeout(() => form
|
|
303
|
+
setTimeout(() => submitImplicitly(form));
|
|
303
304
|
}
|
|
304
305
|
/* ---------- events ---------- */
|
|
305
306
|
onInput(e) {
|