@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
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { a as e, n as t, t as n, u as r } from "./chunks/lit-D8x-qXgH.js";
|
|
2
|
-
import { t as i } from "./chunks/
|
|
3
|
-
import { t as a } from "./chunks/
|
|
4
|
-
import {
|
|
5
|
-
import { t as c } from "./chunks/i18n-
|
|
2
|
+
import { t as i } from "./chunks/repeat-Dxf3qZZl.js";
|
|
3
|
+
import { t as a } from "./chunks/if-defined-z_20pBRr.js";
|
|
4
|
+
import { a as o, t as s } from "./chunks/define-6OfuRn5c.js";
|
|
5
|
+
import { t as c } from "./chunks/i18n-DFfGgd3d.js";
|
|
6
6
|
import { n as l, t as u } from "./chunks/events-DQ4e9cPN.js";
|
|
7
|
-
import { t as d, x as f } from "./chunks/styles-
|
|
8
|
-
import "./chunks/bk-icon-
|
|
7
|
+
import { t as d, x as f } from "./chunks/styles-CaeyhYDA.js";
|
|
8
|
+
import "./chunks/bk-icon-D4kI4F18.js";
|
|
9
9
|
import "./bk-button.js";
|
|
10
10
|
import "./bk-spinner.js";
|
|
11
11
|
import { t as p } from "./chunks/scroll-CB6-StUs.js";
|
|
12
|
-
import {
|
|
12
|
+
import { t as m } from "./chunks/loading-B37QBUkv.js";
|
|
13
|
+
import { t as h } from "./chunks/host-vars-DTKbhBPu.js";
|
|
14
|
+
import { n as g, t as _ } from "./chunks/pan-zoom-CbOGHBG7.js";
|
|
13
15
|
import "./chunks/actual-size-CtcFlQsI.js";
|
|
14
16
|
import "./chunks/chevron-down-CpVEjEyi.js";
|
|
15
17
|
import "./chunks/chevron-left-BHF34JzQ.js";
|
|
@@ -21,7 +23,7 @@ import "./chunks/group-RW5fFMy-.js";
|
|
|
21
23
|
import "./chunks/zoom-in-C934gQ2K.js";
|
|
22
24
|
import "./chunks/zoom-out-wKpHan14.js";
|
|
23
25
|
// dist/components/bk-image-viewer.js
|
|
24
|
-
var
|
|
26
|
+
var v = 8, y = 16, b = 3, x = 1.5, S = 2.5, C = 48, w = 8, T = 300, E = [2, 4], D = "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]", O = (e, t, n) => Math.min(n, Math.max(t, e)), k = class extends n {
|
|
25
27
|
static shadowRootOptions = {
|
|
26
28
|
...n.shadowRootOptions,
|
|
27
29
|
delegatesFocus: !0
|
|
@@ -33,6 +35,30 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
33
35
|
type: Boolean,
|
|
34
36
|
reflect: !0
|
|
35
37
|
},
|
|
38
|
+
loop: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
reflect: !0
|
|
41
|
+
},
|
|
42
|
+
immersive: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
reflect: !0
|
|
45
|
+
},
|
|
46
|
+
shaped: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
reflect: !0
|
|
49
|
+
},
|
|
50
|
+
pageable: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
reflect: !0
|
|
53
|
+
},
|
|
54
|
+
first: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
reflect: !0
|
|
57
|
+
},
|
|
58
|
+
last: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
reflect: !0
|
|
61
|
+
},
|
|
36
62
|
label: {},
|
|
37
63
|
prevLabel: { attribute: "prev-label" },
|
|
38
64
|
nextLabel: { attribute: "next-label" },
|
|
@@ -45,11 +71,13 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
45
71
|
loading: { state: !0 },
|
|
46
72
|
failed: { state: !0 },
|
|
47
73
|
zoomed: { state: !0 },
|
|
48
|
-
ratio: { state: !0 }
|
|
74
|
+
ratio: { state: !0 },
|
|
75
|
+
thumbRatio: { state: !0 },
|
|
76
|
+
naturalSize: { state: !0 }
|
|
49
77
|
};
|
|
50
|
-
pz = new
|
|
78
|
+
pz = new _(this, {
|
|
51
79
|
min: () => Math.min(1, this.actualScale),
|
|
52
|
-
max: () => Math.max(
|
|
80
|
+
max: () => Math.max(v, this.actualScale * y),
|
|
53
81
|
content: () => this.box.w && this.box.h ? {
|
|
54
82
|
w: this.fit.w / this.box.w,
|
|
55
83
|
h: this.fit.h / this.box.h
|
|
@@ -57,8 +85,13 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
57
85
|
w: 1,
|
|
58
86
|
h: 1
|
|
59
87
|
},
|
|
60
|
-
onChange: () =>
|
|
88
|
+
onChange: () => this.onViewChange()
|
|
61
89
|
});
|
|
90
|
+
quiet = !1;
|
|
91
|
+
viewChanged = !1;
|
|
92
|
+
pendingView = null;
|
|
93
|
+
loadedKey = "";
|
|
94
|
+
keyScope = null;
|
|
62
95
|
swipeX = 0;
|
|
63
96
|
smooth = !1;
|
|
64
97
|
raf = 0;
|
|
@@ -99,19 +132,24 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
99
132
|
};
|
|
100
133
|
preloaded = /* @__PURE__ */ new Set();
|
|
101
134
|
observed = null;
|
|
135
|
+
shot = null;
|
|
136
|
+
previousShot = null;
|
|
137
|
+
loader = new m(this);
|
|
102
138
|
resizer = o(() => {
|
|
103
139
|
this.measure(), this.clampPan(), this.apply(!1);
|
|
104
140
|
});
|
|
105
141
|
i18n = new c(this);
|
|
106
142
|
constructor() {
|
|
107
|
-
super(), this.items = [], this.index = 0, this.filmstrip = !1, this.label = "", this.prevLabel = "", this.nextLabel = "", this.zoomInLabel = "", this.zoomOutLabel = "", this.fitLabel = "", this.actualSizeLabel = "", this.errorLabel = "", this.panLabel = "", this.loading = !1, this.failed = !1, this.zoomed = !1, this.ratio = 0;
|
|
143
|
+
super(), this.items = [], this.index = 0, this.filmstrip = !1, this.loop = !1, this.immersive = !1, this.shaped = !1, this.pageable = !1, this.first = !1, this.last = !1, this.label = "", this.prevLabel = "", this.nextLabel = "", this.zoomInLabel = "", this.zoomOutLabel = "", this.fitLabel = "", this.actualSizeLabel = "", this.errorLabel = "", this.panLabel = "", this.loading = !1, this.failed = !1, this.zoomed = !1, this.ratio = 0, this.thumbRatio = 0, this.naturalSize = 0;
|
|
108
144
|
}
|
|
109
145
|
static styles = [
|
|
110
146
|
d,
|
|
111
147
|
f,
|
|
112
148
|
r`
|
|
113
|
-
:host { display: block; height: 100%; min-height: 0; }
|
|
149
|
+
:host { display: block; height: 100%; min-height: 0; max-block-size: var(--bk-image-viewer-max-height, none); }
|
|
114
150
|
.viewer {
|
|
151
|
+
/* Without a height of the host, the sizer gives the height; a maximum height of the host caps it. */
|
|
152
|
+
max-block-size: inherit;
|
|
115
153
|
color-scheme: var(--bk-image-viewer-color-scheme, dark);
|
|
116
154
|
--_bk-image-viewer-pad: var(--bk-image-viewer-padding, var(--bk-space-3));
|
|
117
155
|
--_bk-image-viewer-control: var(--bk-image-viewer-control-size, var(--bk-control-lg));
|
|
@@ -127,6 +165,25 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
127
165
|
.viewer:focus-visible { outline: var(--bk-focus-ring); outline-offset: var(--bk-focus-offset-inset); }
|
|
128
166
|
.empty { height: 100%; background: var(--bk-image-viewer-bg, var(--bk-media-backdrop)); }
|
|
129
167
|
|
|
168
|
+
/* shaped: the box takes the shape of the image. The width follows the ratio under the cap, never wider than
|
|
169
|
+
the container and never wider than the natural image. The height comes from the ratio. */
|
|
170
|
+
:host([shaped]) {
|
|
171
|
+
height: auto; max-block-size: none;
|
|
172
|
+
inline-size: min(100%, var(--_bk-image-viewer-natural, 100%), calc(var(--bk-image-viewer-max-height, calc(infinity * 1px)) * var(--_bk-image-viewer-ratio, 4 / 3)));
|
|
173
|
+
}
|
|
174
|
+
:host([shaped]) .viewer { height: auto; grid-template-rows: auto auto; container-type: inline-size; }
|
|
175
|
+
:host([shaped]) .empty { height: auto; aspect-ratio: 4 / 3; }
|
|
176
|
+
:host([shaped]) .main { aspect-ratio: var(--_bk-image-viewer-ratio, 4 / 3); }
|
|
177
|
+
:host([shaped]) .sizer { display: none; }
|
|
178
|
+
:host([shaped]) .frame { inset: 0; }
|
|
179
|
+
/* The toolbar lies over the top of the image. Only its controls take the pointer. */
|
|
180
|
+
:host([shaped]) .bar { position: absolute; z-index: 4; inset-block-start: 0; inset-inline: 0; pointer-events: none; }
|
|
181
|
+
:host([shaped]) :is(.tools, .actions) { pointer-events: auto; }
|
|
182
|
+
:host([shaped]) .counter:not(:empty) {
|
|
183
|
+
display: inline-flex; align-items: center; min-block-size: var(--_bk-image-viewer-control);
|
|
184
|
+
border-radius: var(--_bk-image-viewer-control-radius); background: var(--_bk-image-viewer-control-bg); backdrop-filter: var(--bk-glass);
|
|
185
|
+
}
|
|
186
|
+
|
|
130
187
|
.control {
|
|
131
188
|
--bk-button-ghost-bg: var(--_bk-image-viewer-control-bg);
|
|
132
189
|
--bk-button-neutral-text: var(--bk-image-viewer-control-fg, var(--_bk-image-viewer-fg));
|
|
@@ -164,7 +221,13 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
164
221
|
}
|
|
165
222
|
|
|
166
223
|
.main { position: relative; min-height: 0; }
|
|
224
|
+
/* 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). */
|
|
225
|
+
.sizer {
|
|
226
|
+
visibility: hidden; pointer-events: none; aspect-ratio: var(--_bk-image-viewer-ratio, 4 / 3);
|
|
227
|
+
margin-inline: calc(var(--_bk-image-viewer-control) + 2 * var(--_bk-image-viewer-pad)); max-block-size: 100%;
|
|
228
|
+
}
|
|
167
229
|
.stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
|
|
230
|
+
.stage.steps { cursor: zoom-in; }
|
|
168
231
|
.stage.zoomed { cursor: grab; }
|
|
169
232
|
.stage.zoomed:active { cursor: grabbing; }
|
|
170
233
|
.frame { position: absolute; inset: 0 calc(var(--_bk-image-viewer-control) + 2 * var(--_bk-image-viewer-pad)); transform-origin: 50% 50%; container-type: size; }
|
|
@@ -182,13 +245,17 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
182
245
|
width: min(100cqw, 100cqh * var(--_bk-image-viewer-ratio)); height: min(100cqh, 100cqw / var(--_bk-image-viewer-ratio));
|
|
183
246
|
}
|
|
184
247
|
.image.loaded ~ .placeholder { visibility: hidden; transition: visibility 0s var(--bk-duration); }
|
|
248
|
+
/* The last image stays in view while the next one loads; the next one fades in over it. */
|
|
249
|
+
.previous { z-index: 0; }
|
|
250
|
+
.previous.gone { visibility: hidden; transition: visibility 0s var(--bk-duration); }
|
|
251
|
+
.frame.swap .placeholder { visibility: hidden; }
|
|
252
|
+
/* The LoadingController shows it only if loading takes longer than --bk-loading-delay. */
|
|
185
253
|
.spinner {
|
|
186
254
|
position: absolute; inset: 0; margin: auto; z-index: 2; width: fit-content; height: fit-content; display: flex;
|
|
187
255
|
padding: var(--bk-space-2); border-radius: var(--bk-radius-full); background: var(--_bk-image-viewer-control-bg); color: var(--_bk-image-viewer-fg);
|
|
188
|
-
|
|
189
|
-
opacity: 0; animation: bk-image-viewer-appear var(--bk-duration) var(--bk-ease) 250ms forwards;
|
|
256
|
+
animation: bk-image-viewer-appear var(--bk-duration) var(--bk-ease);
|
|
190
257
|
}
|
|
191
|
-
@keyframes bk-image-viewer-appear {
|
|
258
|
+
@keyframes bk-image-viewer-appear { from { opacity: 0; } }
|
|
192
259
|
.error {
|
|
193
260
|
position: absolute; inset: 0; margin: auto; z-index: 2; width: fit-content; height: fit-content;
|
|
194
261
|
display: flex; align-items: center; gap: var(--bk-space-2); font-size: var(--bk-type-body);
|
|
@@ -236,11 +303,16 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
236
303
|
|
|
237
304
|
@media (max-width: 640px) {
|
|
238
305
|
.frame { inset: 0; }
|
|
306
|
+
.sizer { margin-inline: 0; }
|
|
239
307
|
}
|
|
240
308
|
@media (max-width: 480px) {
|
|
241
309
|
.level, .fit, .actual { display: none; }
|
|
242
310
|
}
|
|
243
|
-
|
|
311
|
+
/* A shaped box can be narrow on a wide screen: its own width counts. */
|
|
312
|
+
@container (max-width: 480px) {
|
|
313
|
+
:host([shaped]) :is(.level, .fit, .actual) { display: none; }
|
|
314
|
+
}
|
|
315
|
+
@media (prefers-reduced-motion: reduce) { .frame.animate, .image, .previous.gone { transition: none; } .spinner { animation: none; } }
|
|
244
316
|
@media (forced-colors: active) {
|
|
245
317
|
.viewer { background: Canvas; color: CanvasText; }
|
|
246
318
|
.spinner { background: Canvas; }
|
|
@@ -266,13 +338,39 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
266
338
|
this.go(this.index + 1);
|
|
267
339
|
}
|
|
268
340
|
resetZoom() {
|
|
341
|
+
this.silently(() => this.zoomFit());
|
|
342
|
+
}
|
|
343
|
+
get view() {
|
|
344
|
+
let { zoom: e, x: t, y: n } = this.pz.get(), { kx: r, ky: i } = this.pictureScale();
|
|
345
|
+
return {
|
|
346
|
+
zoom: e,
|
|
347
|
+
x: .5 + (t - .5) * r,
|
|
348
|
+
y: .5 + (n - .5) * i
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
set view(e) {
|
|
352
|
+
this.pendingView = {
|
|
353
|
+
...this.view,
|
|
354
|
+
...e
|
|
355
|
+
}, this.applyPendingView();
|
|
356
|
+
}
|
|
357
|
+
get naturalWidth() {
|
|
358
|
+
return this.failed ? 0 : this.image?.naturalWidth ?? 0;
|
|
359
|
+
}
|
|
360
|
+
get naturalHeight() {
|
|
361
|
+
return this.failed ? 0 : this.image?.naturalHeight ?? 0;
|
|
362
|
+
}
|
|
363
|
+
actualSize() {
|
|
364
|
+
this.silently(() => this.zoomActual());
|
|
365
|
+
}
|
|
366
|
+
zoomFit() {
|
|
269
367
|
this.pz.set({
|
|
270
368
|
zoom: 1,
|
|
271
369
|
x: .5,
|
|
272
370
|
y: .5
|
|
273
371
|
}), this.apply(!0);
|
|
274
372
|
}
|
|
275
|
-
|
|
373
|
+
zoomActual() {
|
|
276
374
|
this.box.w || this.measure(), this.zoomTo(this.actualScale);
|
|
277
375
|
}
|
|
278
376
|
get current() {
|
|
@@ -281,46 +379,112 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
281
379
|
get actualScale() {
|
|
282
380
|
return this.natural.w && this.fit.w ? this.natural.w / this.fit.w : 1;
|
|
283
381
|
}
|
|
382
|
+
connectedCallback() {
|
|
383
|
+
super.connectedCallback(), this.hasUpdated && this.bindKeyScope();
|
|
384
|
+
}
|
|
284
385
|
disconnectedCallback() {
|
|
285
|
-
super.disconnectedCallback(), this.resizer.disconnect(), this.observed = null, this.pointers.clear(), cancelAnimationFrame(this.raf), this.raf = 0, cancelAnimationFrame(this.sizeWatch), this.sizeWatch = 0;
|
|
386
|
+
super.disconnectedCallback(), this.unbindKeyScope(), this.resizer.disconnect(), this.observed = null, this.pointers.clear(), cancelAnimationFrame(this.raf), this.raf = 0, cancelAnimationFrame(this.sizeWatch), this.sizeWatch = 0;
|
|
286
387
|
}
|
|
287
388
|
willUpdate(e) {
|
|
288
389
|
let t = this.items.length;
|
|
289
|
-
|
|
290
|
-
|
|
390
|
+
this.index = O(Math.trunc(this.index) || 0, 0, Math.max(0, t - 1));
|
|
391
|
+
let n = this.hasUpdated && this.renderRoot instanceof ShadowRoot ? this.renderRoot.activeElement : null;
|
|
392
|
+
if (n && (n.matches(".prev") && !this.canStep(-1) || n.matches(".next") && !this.canStep(1)) && this.focus(), e.has("index") || e.has("items")) {
|
|
393
|
+
let e = this.items[this.index], n = e ? {
|
|
394
|
+
key: `${this.index}|${e.full || e.src}`,
|
|
395
|
+
src: e.full || e.src,
|
|
396
|
+
thumb: e.src,
|
|
397
|
+
alt: e.alt
|
|
398
|
+
} : null;
|
|
399
|
+
if (n ? this.shot && this.shot.key !== n.key && (this.failed ? this.previousShot = null : this.loading || (this.previousShot = this.shot)) : this.previousShot = null, this.previousShot?.key === n?.key && (this.previousShot = null), this.shot = n, this.loading = t > 0, this.failed = !1, this.swipeX = 0, this.silently(() => this.pz.set({
|
|
291
400
|
zoom: 1,
|
|
292
401
|
x: .5,
|
|
293
402
|
y: .5
|
|
294
|
-
}), this.zoomed = !1, this.natural = {
|
|
403
|
+
})), this.zoomed = !1, this.natural = {
|
|
295
404
|
w: 0,
|
|
296
405
|
h: 0
|
|
297
|
-
}
|
|
298
|
-
let e = this.items[this.index];
|
|
299
|
-
if (this.ratio = e?.width && e.height ? e.width / e.height : 0, e) {
|
|
406
|
+
}, this.ratio = e?.width && e.height ? e.width / e.height : 0, this.naturalSize = e?.width && e.height ? e.width : 0, this.thumbRatio = 0, e) {
|
|
300
407
|
let t = new Image();
|
|
301
|
-
t.src = e.full || e.src, t.complete && t.naturalWidth && t.naturalHeight && (this.loading = !1, this.ratio = t.naturalWidth / t.naturalHeight);
|
|
408
|
+
t.src = e.full || e.src, t.complete && t.naturalWidth && t.naturalHeight && (this.loading = !1, this.ratio = t.naturalWidth / t.naturalHeight, this.naturalSize = t.naturalWidth);
|
|
302
409
|
}
|
|
303
410
|
}
|
|
411
|
+
this.loader.set(this.loading), h(this, {
|
|
412
|
+
"--_bk-image-viewer-ratio": String(this.ratio || this.thumbRatio || ""),
|
|
413
|
+
"--_bk-image-viewer-natural": this.naturalSize && this.ratio ? `${this.naturalSize}px` : ""
|
|
414
|
+
});
|
|
304
415
|
}
|
|
305
416
|
updated(e) {
|
|
306
417
|
let t = this.frame;
|
|
307
|
-
if (t !== this.observed && (this.resizer.disconnect(), t && this.resizer.observe(t), this.observed = t), e.has("index") || e.has("items")) {
|
|
418
|
+
if (t !== this.observed && (this.resizer.disconnect(), t && this.resizer.observe(t), this.observed = t), e.has("immersive") && this.bindKeyScope(), e.has("index") || e.has("items")) {
|
|
308
419
|
let e = this.image;
|
|
309
|
-
e?.complete && e.naturalWidth && (this.loading || !this.ratio ? queueMicrotask(() => this.onImageLoad()) : this.placeImage()), this.apply(!1), this.ratio || this.watchSize(), this.preloadNeighbours(), p(this.renderRoot.querySelector(".thumb[aria-current=\"true\"]"), this);
|
|
420
|
+
e?.complete && e.naturalWidth && (this.loading || !this.ratio ? queueMicrotask(() => this.onImageLoad()) : this.placeImage()), this.apply(!1), this.ratio || this.watchSize(), this.preloadNeighbours(), p(this.renderRoot.querySelector(".thumb[aria-current=\"true\"]"), this), this.applyPendingView();
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
silently(e) {
|
|
424
|
+
let t = this.quiet;
|
|
425
|
+
this.quiet = !0;
|
|
426
|
+
try {
|
|
427
|
+
e();
|
|
428
|
+
} finally {
|
|
429
|
+
this.quiet = t;
|
|
310
430
|
}
|
|
311
431
|
}
|
|
432
|
+
onViewChange() {
|
|
433
|
+
this.quiet || (this.pendingView = null, this.viewChanged = !0);
|
|
434
|
+
}
|
|
435
|
+
pictureScale() {
|
|
436
|
+
return {
|
|
437
|
+
kx: this.fit.w ? this.box.w / this.fit.w : 1,
|
|
438
|
+
ky: this.fit.h ? this.box.h / this.fit.h : 1
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
applyPendingView() {
|
|
442
|
+
let e = this.pendingView;
|
|
443
|
+
if (!e || !this.hasUpdated || this.isUpdatePending || !this.frame) return;
|
|
444
|
+
this.measure();
|
|
445
|
+
let { kx: t, ky: n } = this.pictureScale();
|
|
446
|
+
this.silently(() => this.pz.set({
|
|
447
|
+
zoom: e.zoom,
|
|
448
|
+
x: .5 + (e.x - .5) / t,
|
|
449
|
+
y: .5 + (e.y - .5) / n
|
|
450
|
+
})), this.apply(!1), this.ratio && (this.pendingView = null);
|
|
451
|
+
}
|
|
452
|
+
bindKeyScope() {
|
|
453
|
+
if (this.unbindKeyScope(), this.immersive && this.isConnected) {
|
|
454
|
+
for (let e = this; e; e = e.parentElement ?? e.getRootNode().host ?? null) if (e !== this && (e.localName === "dialog" || e.localName === "bk-dialog" || e.getAttribute("role") === "dialog")) {
|
|
455
|
+
this.keyScope = e, e.addEventListener("keydown", this.onScopeKey);
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
unbindKeyScope() {
|
|
461
|
+
this.keyScope?.removeEventListener("keydown", this.onScopeKey), this.keyScope = null;
|
|
462
|
+
}
|
|
463
|
+
onScopeKey = (e) => {
|
|
464
|
+
let t = e;
|
|
465
|
+
if (t.defaultPrevented) return;
|
|
466
|
+
let n = t.composedPath();
|
|
467
|
+
if (!n.includes(this)) {
|
|
468
|
+
for (let e of n) {
|
|
469
|
+
if (e === this.keyScope) break;
|
|
470
|
+
if (e instanceof Element && (e.matches(D) || e.isContentEditable)) return;
|
|
471
|
+
}
|
|
472
|
+
this.onKey(t);
|
|
473
|
+
}
|
|
474
|
+
};
|
|
312
475
|
watchSize() {
|
|
313
476
|
cancelAnimationFrame(this.sizeWatch);
|
|
314
477
|
let e = () => {
|
|
315
478
|
this.sizeWatch = 0;
|
|
316
479
|
let t = this.image;
|
|
317
|
-
!t || this.failed || this.ratio || (t.naturalWidth && t.naturalHeight ? (this.ratio = t.naturalWidth / t.naturalHeight, this.measure(), this.apply(!1)) : this.sizeWatch = requestAnimationFrame(e));
|
|
480
|
+
!t || this.failed || this.ratio || (t.naturalWidth && t.naturalHeight ? (this.ratio = t.naturalWidth / t.naturalHeight, this.naturalSize = t.naturalWidth, this.measure(), this.apply(!1), this.applyPendingView()) : this.sizeWatch = requestAnimationFrame(e));
|
|
318
481
|
};
|
|
319
482
|
this.sizeWatch = requestAnimationFrame(e);
|
|
320
483
|
}
|
|
321
484
|
preloadNeighbours() {
|
|
322
485
|
let e = this.items.length;
|
|
323
486
|
if (!(e < 2)) for (let t of [this.index + 1, this.index - 1]) {
|
|
487
|
+
if (!this.loop && (t < 0 || t >= e)) continue;
|
|
324
488
|
let n = this.items[(t + e) % e], r = n.full || n.src;
|
|
325
489
|
if (this.preloaded.has(r)) continue;
|
|
326
490
|
this.preloaded.add(r);
|
|
@@ -330,9 +494,17 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
330
494
|
}
|
|
331
495
|
go(e) {
|
|
332
496
|
let t = this.items.length;
|
|
333
|
-
if (t < 2) return;
|
|
334
|
-
let n = (e % t + t) % t;
|
|
335
|
-
n !== this.index && (this.index = n, l(this, "change", { index: n }));
|
|
497
|
+
if (t < 2) return !1;
|
|
498
|
+
let n = this.loop ? (e % t + t) % t : O(e, 0, t - 1);
|
|
499
|
+
return n !== this.index && (this.index = n, l(this, "change", { index: n }), !0);
|
|
500
|
+
}
|
|
501
|
+
canStep(e) {
|
|
502
|
+
let t = this.items.length;
|
|
503
|
+
return t > 1 && (this.loop || (e < 0 ? this.index > 0 : this.index < t - 1)) ? "own" : this.pageable && !(e < 0 ? this.first : this.last) ? "app" : !1;
|
|
504
|
+
}
|
|
505
|
+
step(e) {
|
|
506
|
+
let t = this.canStep(e);
|
|
507
|
+
return t === "own" ? this.go(this.index + e) : t === "app" && l(this, "page", { direction: e < 0 ? "previous" : "next" }, !0), t;
|
|
336
508
|
}
|
|
337
509
|
get panStep() {
|
|
338
510
|
return Math.max(40, this.box.w * .1);
|
|
@@ -345,17 +517,17 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
345
517
|
ArrowUp: () => this.panBy(0, t),
|
|
346
518
|
ArrowDown: () => this.panBy(0, -t)
|
|
347
519
|
} : {
|
|
348
|
-
ArrowLeft: () => this.
|
|
349
|
-
ArrowRight: () => this.
|
|
520
|
+
ArrowLeft: () => this.step(-1),
|
|
521
|
+
ArrowRight: () => this.step(1)
|
|
350
522
|
};
|
|
351
523
|
Object.assign(n, {
|
|
352
524
|
Home: () => this.go(0),
|
|
353
525
|
End: () => this.go(this.items.length - 1),
|
|
354
|
-
"+": () => this.zoomTo(this.pz.zoom *
|
|
355
|
-
"=": () => this.zoomTo(this.pz.zoom *
|
|
356
|
-
"-": () => this.zoomTo(this.pz.zoom /
|
|
357
|
-
0: () => this.
|
|
358
|
-
1: () => this.
|
|
526
|
+
"+": () => this.zoomTo(this.pz.zoom * x),
|
|
527
|
+
"=": () => this.zoomTo(this.pz.zoom * x),
|
|
528
|
+
"-": () => this.zoomTo(this.pz.zoom / x),
|
|
529
|
+
0: () => this.zoomFit(),
|
|
530
|
+
1: () => this.zoomActual()
|
|
359
531
|
});
|
|
360
532
|
let r = n[e.key];
|
|
361
533
|
r && (e.preventDefault(), r());
|
|
@@ -363,22 +535,22 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
363
535
|
measure() {
|
|
364
536
|
let e = this.frame;
|
|
365
537
|
if (!e) return;
|
|
366
|
-
let t = e.getBoundingClientRect(), n =
|
|
538
|
+
let t = (e.parentElement ?? e).getBoundingClientRect(), n = parseFloat(getComputedStyle(e).left) || 0, r = Math.max(0, t.width - 2 * n), i = t.height;
|
|
367
539
|
this.box = {
|
|
368
|
-
x: t.left + t.width / 2
|
|
369
|
-
y: t.top + t.height / 2
|
|
540
|
+
x: t.left + t.width / 2,
|
|
541
|
+
y: t.top + t.height / 2,
|
|
370
542
|
w: r,
|
|
371
543
|
h: i
|
|
372
544
|
};
|
|
373
|
-
let
|
|
374
|
-
if (
|
|
375
|
-
let e = Math.min(r /
|
|
545
|
+
let a = this.image;
|
|
546
|
+
if (a?.naturalWidth && a.naturalHeight) {
|
|
547
|
+
let e = Math.min(r / a.naturalWidth, i / a.naturalHeight);
|
|
376
548
|
this.fit = {
|
|
377
|
-
w:
|
|
378
|
-
h:
|
|
549
|
+
w: a.naturalWidth * e,
|
|
550
|
+
h: a.naturalHeight * e
|
|
379
551
|
}, this.natural = {
|
|
380
|
-
w:
|
|
381
|
-
h:
|
|
552
|
+
w: a.naturalWidth,
|
|
553
|
+
h: a.naturalHeight
|
|
382
554
|
};
|
|
383
555
|
} else this.ratio ? (this.fit = this.ratio > r / i ? {
|
|
384
556
|
w: r,
|
|
@@ -415,9 +587,9 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
415
587
|
let { tx: t, ty: n } = this.offset();
|
|
416
588
|
e.style.transform = `translate3d(${t + this.swipeX}px, ${n}px, 0) scale(${this.pz.zoom})`;
|
|
417
589
|
let r = this.natural.w ? this.pz.zoom / this.actualScale : 0;
|
|
418
|
-
this.image?.classList.toggle("pixelated", r >=
|
|
590
|
+
this.image?.classList.toggle("pixelated", r >= b);
|
|
419
591
|
let i = this.renderRoot.querySelector(".level");
|
|
420
|
-
i && (i.textContent = r ? this.formatPercent(r) : "");
|
|
592
|
+
i && (i.textContent = r ? this.formatPercent(r) : ""), this.viewChanged && (this.viewChanged = !1, l(this, "viewchange", this.view));
|
|
421
593
|
});
|
|
422
594
|
}
|
|
423
595
|
formatPercent(e) {
|
|
@@ -428,7 +600,7 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
428
600
|
})), this.percent.format(e);
|
|
429
601
|
}
|
|
430
602
|
clampPan() {
|
|
431
|
-
this.pz.set({});
|
|
603
|
+
this.silently(() => this.pz.set({}));
|
|
432
604
|
}
|
|
433
605
|
zoomTo(e, t = this.box.x, n = this.box.y, r = !0) {
|
|
434
606
|
this.box.w || this.measure(), this.pz.zoomAt(e, .5 + (t - this.box.x) / this.box.w, .5 + (n - this.box.y) / this.box.h), this.apply(r);
|
|
@@ -442,13 +614,14 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
442
614
|
}), this.apply(!0);
|
|
443
615
|
}
|
|
444
616
|
onWheel(e) {
|
|
617
|
+
if (!this.immersive && !this.zoomed && !e.ctrlKey && !e.metaKey) return;
|
|
445
618
|
e.preventDefault();
|
|
446
619
|
let t = e.deltaMode === 1 ? e.deltaY * 16 : e.deltaY;
|
|
447
620
|
this.zoomTo(this.pz.zoom * Math.exp(-t * (e.ctrlKey ? .01 : .002)), e.clientX, e.clientY, !1);
|
|
448
621
|
}
|
|
449
622
|
onPointerDown(e) {
|
|
450
623
|
if (e.pointerType !== "mouse" || e.button === 0) {
|
|
451
|
-
if (
|
|
624
|
+
if (g(e), this.pointers.set(e.pointerId, {
|
|
452
625
|
x: e.clientX,
|
|
453
626
|
y: e.clientY
|
|
454
627
|
}), this.pointers.size === 1) {
|
|
@@ -485,14 +658,14 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
485
658
|
}
|
|
486
659
|
if (this.pointers.size !== 1) return;
|
|
487
660
|
let n = e.clientX - this.drag.x, r = e.clientY - this.drag.y;
|
|
488
|
-
if (!(!this.drag.moved && Math.hypot(n, r) <
|
|
661
|
+
if (!(!this.drag.moved && Math.hypot(n, r) < w)) {
|
|
489
662
|
if (this.drag.moved = !0, this.zoomed) {
|
|
490
663
|
let e = this.pz.zoom;
|
|
491
664
|
this.pz.set({
|
|
492
665
|
x: this.drag.vx - n / (this.box.w * e),
|
|
493
666
|
y: this.drag.vy - r / (this.box.h * e)
|
|
494
667
|
});
|
|
495
|
-
} else this.items.length > 1 && (this.swipeX = n);
|
|
668
|
+
} else (this.items.length > 1 || this.pageable) && (this.swipeX = n);
|
|
496
669
|
this.apply(!1);
|
|
497
670
|
}
|
|
498
671
|
}
|
|
@@ -511,34 +684,45 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
511
684
|
}
|
|
512
685
|
if (this.pointers.size) return;
|
|
513
686
|
let t = this.swipeX;
|
|
514
|
-
t ? (this.swipeX = 0, e.type
|
|
687
|
+
t ? (this.swipeX = 0, (e.type === "pointercancel" || Math.abs(t) <= C || this.step(t < 0 ? 1 : -1) !== "own") && this.apply(!0)) : !this.drag.moved && e.type === "pointerup" && this.onTap(e);
|
|
515
688
|
}
|
|
516
689
|
onTap(e) {
|
|
517
|
-
let t = e.
|
|
518
|
-
if (
|
|
519
|
-
this.
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
690
|
+
let t = Math.abs(e.clientX - this.box.x) > this.fit.w / 2 || Math.abs(e.clientY - this.box.y) > this.fit.h / 2;
|
|
691
|
+
if (this.immersive && e.pointerType !== "touch") {
|
|
692
|
+
if (!this.zoomed && t) {
|
|
693
|
+
u(this, "dismiss");
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
let n = E.find((e) => this.pz.zoom < e - .01);
|
|
697
|
+
n ? this.zoomTo(n, e.clientX, e.clientY) : this.zoomFit();
|
|
524
698
|
return;
|
|
525
699
|
}
|
|
526
|
-
|
|
527
|
-
|
|
700
|
+
let n = e.timeStamp, r = this.lastTap;
|
|
701
|
+
n - r.t < T && Math.hypot(e.clientX - r.x, e.clientY - r.y) < 30 ? (this.lastTap = {
|
|
702
|
+
t: 0,
|
|
703
|
+
x: 0,
|
|
704
|
+
y: 0
|
|
705
|
+
}, this.zoomed ? this.zoomFit() : this.zoomTo(S, e.clientX, e.clientY)) : (this.lastTap = {
|
|
706
|
+
t: n,
|
|
528
707
|
x: e.clientX,
|
|
529
708
|
y: e.clientY
|
|
530
|
-
};
|
|
531
|
-
let r = Math.abs(e.clientX - this.box.x) > this.fit.w / 2 || Math.abs(e.clientY - this.box.y) > this.fit.h / 2;
|
|
532
|
-
!this.zoomed && r && u(this, "dismiss");
|
|
709
|
+
}, !this.zoomed && t && u(this, "dismiss"));
|
|
533
710
|
}
|
|
534
711
|
onImageLoad(e) {
|
|
535
712
|
if (e && e.target !== this.image) return;
|
|
536
713
|
this.loading = !1;
|
|
537
714
|
let t = this.image;
|
|
538
|
-
t?.naturalWidth && t.naturalHeight && (this.ratio = t.naturalWidth / t.naturalHeight), this.placeImage();
|
|
715
|
+
t?.naturalWidth && t.naturalHeight && (this.ratio = t.naturalWidth / t.naturalHeight, this.naturalSize = t.naturalWidth), this.placeImage();
|
|
539
716
|
}
|
|
540
717
|
placeImage() {
|
|
541
|
-
this.
|
|
718
|
+
let e = this.image?.getAttribute("src") ?? "";
|
|
719
|
+
this.preloaded.add(e), this.measure(), this.apply(!1), this.applyPendingView();
|
|
720
|
+
let t = `${this.index}|${e}`;
|
|
721
|
+
t !== this.loadedKey && (this.loadedKey = t, this.dispatchEvent(new Event("load")));
|
|
722
|
+
}
|
|
723
|
+
onThumbLoad(e) {
|
|
724
|
+
let t = e.target;
|
|
725
|
+
t.naturalWidth && t.naturalHeight && (this.thumbRatio = t.naturalWidth / t.naturalHeight);
|
|
542
726
|
}
|
|
543
727
|
onImageError(e) {
|
|
544
728
|
e.target === this.image && (this.loading = !1, this.failed = !0);
|
|
@@ -548,34 +732,41 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
548
732
|
return t ? this.renderViewer(t) : e`<div class="empty" part="base"></div>`;
|
|
549
733
|
}
|
|
550
734
|
renderViewer(n) {
|
|
551
|
-
let r = this.items.length, o = r > 1, s =
|
|
735
|
+
let r = this.items.length, o = r > 1, s = this.filmstrip && o, c = this.shot ?? {
|
|
736
|
+
key: `${this.index}|${n.full || n.src}`,
|
|
737
|
+
src: n.full || n.src,
|
|
738
|
+
thumb: n.src,
|
|
739
|
+
alt: n.alt
|
|
740
|
+
}, l = this.previousShot ? [this.previousShot, c] : [c], u = !!this.previousShot && this.loading;
|
|
552
741
|
return e`<div class="viewer" part="base" role="region" tabindex="0"
|
|
553
742
|
aria-label=${this.label || this.i18n.t("imageViewer")} @keydown=${this.onKey}>
|
|
554
743
|
<div class="bar" part="toolbar">
|
|
555
744
|
<span class="counter" part="counter" aria-live="polite" aria-atomic="true">${o ? e`<span aria-hidden="true">${this.index + 1} / ${r}</span><span class="sr-only">${this.i18n.t("imageCounter", {
|
|
556
745
|
index: this.index + 1,
|
|
557
746
|
total: r
|
|
558
|
-
})}</span>` :
|
|
747
|
+
})}</span>` : t}</span>
|
|
559
748
|
<span class="tools">
|
|
560
|
-
<bk-button variant="ghost" class="control" size="lg" label=${this.zoomOutLabel || this.i18n.t("zoomOut")} icon="zoom-out" @click=${() => this.zoomTo(this.pz.zoom /
|
|
749
|
+
<bk-button variant="ghost" class="control" size="lg" label=${this.zoomOutLabel || this.i18n.t("zoomOut")} icon="zoom-out" @click=${() => this.zoomTo(this.pz.zoom / x)}></bk-button>
|
|
561
750
|
<output class="level" part="zoom-level" aria-live="off" aria-label=${this.i18n.t("zoomLevel")}></output>
|
|
562
|
-
<bk-button variant="ghost" class="control" size="lg" label=${this.zoomInLabel || this.i18n.t("zoomIn")} icon="zoom-in" @click=${() => this.zoomTo(this.pz.zoom *
|
|
563
|
-
<bk-button variant="ghost" class="control fit" size="lg" label=${this.fitLabel || this.i18n.t("zoomFit")} icon="fit-screen" @click=${() => this.
|
|
564
|
-
<bk-button variant="ghost" class="control actual" size="lg" label=${this.actualSizeLabel || this.i18n.t("zoomActual")} icon="actual-size" @click=${() => this.
|
|
751
|
+
<bk-button variant="ghost" class="control" size="lg" label=${this.zoomInLabel || this.i18n.t("zoomIn")} icon="zoom-in" @click=${() => this.zoomTo(this.pz.zoom * x)}></bk-button>
|
|
752
|
+
<bk-button variant="ghost" class="control fit" size="lg" label=${this.fitLabel || this.i18n.t("zoomFit")} icon="fit-screen" @click=${() => this.zoomFit()}></bk-button>
|
|
753
|
+
<bk-button variant="ghost" class="control actual" size="lg" label=${this.actualSizeLabel || this.i18n.t("zoomActual")} icon="actual-size" @click=${() => this.zoomActual()}></bk-button>
|
|
565
754
|
</span>
|
|
566
755
|
<span class="actions"><slot name="actions"></slot></span>
|
|
567
756
|
</div>
|
|
568
757
|
<div class="main">
|
|
569
|
-
<div class="
|
|
758
|
+
<div class="sizer" aria-hidden="true"></div>
|
|
759
|
+
<div class="stage ${this.zoomed ? "zoomed" : ""} ${this.immersive ? "steps" : ""}" part="stage" @wheel=${this.onWheel}
|
|
570
760
|
@pointerdown=${this.onPointerDown} @pointermove=${this.onPointerMove}
|
|
571
761
|
@pointerup=${this.onPointerUp} @pointercancel=${this.onPointerUp}>
|
|
572
|
-
<div class="frame">${
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
762
|
+
<div class="frame ${u ? "swap" : ""}">${i(l, (e) => e.key, (n) => {
|
|
763
|
+
let r = n === c, i = r ? `image ${this.loading ? "" : "loaded"} ${this.failed ? "failed" : ""}` : `previous ${u ? "" : "gone"}`;
|
|
764
|
+
return e`<img class=${i}
|
|
765
|
+
part=${a(r ? "image" : void 0)} src=${n.src} alt=${r ? n.alt : ""} aria-hidden=${a(r ? void 0 : "true")}
|
|
766
|
+
decoding="async" draggable="false" @load=${this.onImageLoad} @error=${this.onImageError}>${r && n.src !== n.thumb ? e`<img
|
|
767
|
+
class="placeholder ${this.ratio ? "shaped" : ""}" src=${n.thumb} alt="" aria-hidden="true" decoding="async" draggable="false" @load=${this.onThumbLoad}>` : t}`;
|
|
768
|
+
})}</div>
|
|
769
|
+
${this.loader.visible ? e`<span class="spinner"><bk-spinner size="lg"></bk-spinner></span>` : t}
|
|
579
770
|
${this.failed ? e`<p class="error" role="alert"><bk-icon name="error" size="md"></bk-icon>${this.errorLabel || this.i18n.t("imageError")}</p>` : t}
|
|
580
771
|
</div>
|
|
581
772
|
<span class="pan" part="pan" role="group" aria-label=${this.panLabel || this.i18n.t("panGroup")} ?hidden=${!this.zoomed}>
|
|
@@ -584,13 +775,13 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
584
775
|
<bk-button variant="ghost" class="control" size="sm" icon="chevron-down" label=${this.i18n.t("panDown")} @click=${() => this.panBy(0, -this.panStep)}></bk-button>
|
|
585
776
|
<bk-button variant="ghost" class="control" size="sm" icon="chevron-right" label=${this.i18n.t("panRight")} @click=${() => this.panBy(-this.panStep, 0)}></bk-button>
|
|
586
777
|
</span>
|
|
587
|
-
${o ? e`
|
|
588
|
-
<bk-button variant="ghost" class="control nav prev" part="nav" size="lg" icon="chevron-left" label=${this.prevLabel || this.i18n.t("previousImage")} @click=${() => this.
|
|
589
|
-
<bk-button variant="ghost" class="control nav next" part="nav" size="lg" icon="chevron-right" label=${this.nextLabel || this.i18n.t("nextImage")} @click=${() => this.
|
|
778
|
+
${o || this.pageable ? e`
|
|
779
|
+
<bk-button variant="ghost" class="control nav prev" part="nav" size="lg" icon="chevron-left" label=${this.prevLabel || this.i18n.t("previousImage")} ?disabled=${!this.canStep(-1)} @click=${() => this.step(-1)}></bk-button>
|
|
780
|
+
<bk-button variant="ghost" class="control nav next" part="nav" size="lg" icon="chevron-right" label=${this.nextLabel || this.i18n.t("nextImage")} ?disabled=${!this.canStep(1)} @click=${() => this.step(1)}></bk-button>` : t}
|
|
590
781
|
</div>
|
|
591
|
-
<div class="foot" ?hidden=${!n.caption && !
|
|
782
|
+
<div class="foot" ?hidden=${!n.caption && !s}>
|
|
592
783
|
${n.caption ? e`<p class="caption" part="caption">${n.caption}</p>` : t}
|
|
593
|
-
${
|
|
784
|
+
${s ? e`<div class="filmstrip" part="filmstrip">
|
|
594
785
|
${this.items.map((t, n) => e`<button type="button" class="thumb" part="thumb" aria-label=${t.alt || this.i18n.t("imageCounter", {
|
|
595
786
|
index: n + 1,
|
|
596
787
|
total: r
|
|
@@ -603,5 +794,5 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
603
794
|
</div>`;
|
|
604
795
|
}
|
|
605
796
|
};
|
|
606
|
-
s("bk-image-viewer",
|
|
607
|
-
export {
|
|
797
|
+
s("bk-image-viewer", k);
|
|
798
|
+
export { k as BkImageViewer };
|