@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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a as e, n as t, t as n, u as r } from "./chunks/lit-D8x-qXgH.js";
|
|
2
2
|
import { t as i } from "./chunks/style-map-BMvn17E7.js";
|
|
3
3
|
import { t as a } from "./chunks/keyed-CZ2AaouM.js";
|
|
4
|
-
import { i as o, t as s } from "./chunks/define-
|
|
5
|
-
import { t as c } from "./chunks/i18n-
|
|
4
|
+
import { i as o, t as s } from "./chunks/define-DkVeu7e9.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-Bp_flKdv.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";
|
|
@@ -21,7 +21,7 @@ import "./chunks/group-RW5fFMy-.js";
|
|
|
21
21
|
import "./chunks/zoom-in-C934gQ2K.js";
|
|
22
22
|
import "./chunks/zoom-out-wKpHan14.js";
|
|
23
23
|
// dist/components/bk-image-viewer.js
|
|
24
|
-
var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n) => Math.min(n, Math.max(t, e)),
|
|
24
|
+
var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = [2, 4], T = "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]", E = (e, t, n) => Math.min(n, Math.max(t, e)), D = class extends n {
|
|
25
25
|
static shadowRootOptions = {
|
|
26
26
|
...n.shadowRootOptions,
|
|
27
27
|
delegatesFocus: !0
|
|
@@ -33,6 +33,14 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
33
33
|
type: Boolean,
|
|
34
34
|
reflect: !0
|
|
35
35
|
},
|
|
36
|
+
loop: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
reflect: !0
|
|
39
|
+
},
|
|
40
|
+
immersive: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
reflect: !0
|
|
43
|
+
},
|
|
36
44
|
label: {},
|
|
37
45
|
prevLabel: { attribute: "prev-label" },
|
|
38
46
|
nextLabel: { attribute: "next-label" },
|
|
@@ -45,7 +53,8 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
45
53
|
loading: { state: !0 },
|
|
46
54
|
failed: { state: !0 },
|
|
47
55
|
zoomed: { state: !0 },
|
|
48
|
-
ratio: { state: !0 }
|
|
56
|
+
ratio: { state: !0 },
|
|
57
|
+
thumbRatio: { state: !0 }
|
|
49
58
|
};
|
|
50
59
|
pz = new h(this, {
|
|
51
60
|
min: () => Math.min(1, this.actualScale),
|
|
@@ -57,8 +66,13 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
57
66
|
w: 1,
|
|
58
67
|
h: 1
|
|
59
68
|
},
|
|
60
|
-
onChange: () =>
|
|
69
|
+
onChange: () => this.onViewChange()
|
|
61
70
|
});
|
|
71
|
+
quiet = !1;
|
|
72
|
+
viewChanged = !1;
|
|
73
|
+
pendingView = null;
|
|
74
|
+
loadedKey = "";
|
|
75
|
+
keyScope = null;
|
|
62
76
|
swipeX = 0;
|
|
63
77
|
smooth = !1;
|
|
64
78
|
raf = 0;
|
|
@@ -104,14 +118,16 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
104
118
|
});
|
|
105
119
|
i18n = new c(this);
|
|
106
120
|
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;
|
|
121
|
+
super(), this.items = [], this.index = 0, this.filmstrip = !1, this.loop = !1, this.immersive = !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;
|
|
108
122
|
}
|
|
109
123
|
static styles = [
|
|
110
124
|
d,
|
|
111
125
|
f,
|
|
112
126
|
r`
|
|
113
|
-
:host { display: block; height: 100%; min-height: 0; }
|
|
127
|
+
:host { display: block; height: 100%; min-height: 0; max-block-size: var(--bk-image-viewer-max-height, none); }
|
|
114
128
|
.viewer {
|
|
129
|
+
/* Without a height of the host, the sizer gives the height; a maximum height of the host caps it. */
|
|
130
|
+
max-block-size: inherit;
|
|
115
131
|
color-scheme: var(--bk-image-viewer-color-scheme, dark);
|
|
116
132
|
--_bk-image-viewer-pad: var(--bk-image-viewer-padding, var(--bk-space-3));
|
|
117
133
|
--_bk-image-viewer-control: var(--bk-image-viewer-control-size, var(--bk-control-lg));
|
|
@@ -164,7 +180,13 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
164
180
|
}
|
|
165
181
|
|
|
166
182
|
.main { position: relative; min-height: 0; }
|
|
183
|
+
/* 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). */
|
|
184
|
+
.sizer {
|
|
185
|
+
visibility: hidden; pointer-events: none; aspect-ratio: var(--_bk-image-viewer-ratio, 4 / 3);
|
|
186
|
+
margin-inline: calc(var(--_bk-image-viewer-control) + 2 * var(--_bk-image-viewer-pad)); max-block-size: 100%;
|
|
187
|
+
}
|
|
167
188
|
.stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
|
|
189
|
+
.stage.steps { cursor: zoom-in; }
|
|
168
190
|
.stage.zoomed { cursor: grab; }
|
|
169
191
|
.stage.zoomed:active { cursor: grabbing; }
|
|
170
192
|
.frame { position: absolute; inset: 0 calc(var(--_bk-image-viewer-control) + 2 * var(--_bk-image-viewer-pad)); transform-origin: 50% 50%; container-type: size; }
|
|
@@ -236,6 +258,7 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
236
258
|
|
|
237
259
|
@media (max-width: 640px) {
|
|
238
260
|
.frame { inset: 0; }
|
|
261
|
+
.sizer { margin-inline: 0; }
|
|
239
262
|
}
|
|
240
263
|
@media (max-width: 480px) {
|
|
241
264
|
.level, .fit, .actual { display: none; }
|
|
@@ -266,13 +289,39 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
266
289
|
this.go(this.index + 1);
|
|
267
290
|
}
|
|
268
291
|
resetZoom() {
|
|
292
|
+
this.silently(() => this.zoomFit());
|
|
293
|
+
}
|
|
294
|
+
get view() {
|
|
295
|
+
let { zoom: e, x: t, y: n } = this.pz.get(), { kx: r, ky: i } = this.pictureScale();
|
|
296
|
+
return {
|
|
297
|
+
zoom: e,
|
|
298
|
+
x: .5 + (t - .5) * r,
|
|
299
|
+
y: .5 + (n - .5) * i
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
set view(e) {
|
|
303
|
+
this.pendingView = {
|
|
304
|
+
...this.view,
|
|
305
|
+
...e
|
|
306
|
+
}, this.applyPendingView();
|
|
307
|
+
}
|
|
308
|
+
get naturalWidth() {
|
|
309
|
+
return this.failed ? 0 : this.image?.naturalWidth ?? 0;
|
|
310
|
+
}
|
|
311
|
+
get naturalHeight() {
|
|
312
|
+
return this.failed ? 0 : this.image?.naturalHeight ?? 0;
|
|
313
|
+
}
|
|
314
|
+
actualSize() {
|
|
315
|
+
this.silently(() => this.zoomActual());
|
|
316
|
+
}
|
|
317
|
+
zoomFit() {
|
|
269
318
|
this.pz.set({
|
|
270
319
|
zoom: 1,
|
|
271
320
|
x: .5,
|
|
272
321
|
y: .5
|
|
273
322
|
}), this.apply(!0);
|
|
274
323
|
}
|
|
275
|
-
|
|
324
|
+
zoomActual() {
|
|
276
325
|
this.box.w || this.measure(), this.zoomTo(this.actualScale);
|
|
277
326
|
}
|
|
278
327
|
get current() {
|
|
@@ -281,22 +330,27 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
281
330
|
get actualScale() {
|
|
282
331
|
return this.natural.w && this.fit.w ? this.natural.w / this.fit.w : 1;
|
|
283
332
|
}
|
|
333
|
+
connectedCallback() {
|
|
334
|
+
super.connectedCallback(), this.hasUpdated && this.bindKeyScope();
|
|
335
|
+
}
|
|
284
336
|
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;
|
|
337
|
+
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
338
|
}
|
|
287
339
|
willUpdate(e) {
|
|
288
340
|
let t = this.items.length;
|
|
289
|
-
|
|
290
|
-
|
|
341
|
+
this.index = E(Math.trunc(this.index) || 0, 0, Math.max(0, t - 1));
|
|
342
|
+
let n = this.hasUpdated && this.renderRoot instanceof ShadowRoot ? this.renderRoot.activeElement : null;
|
|
343
|
+
if (n && !this.loop && (n.matches(".prev") && this.index <= 0 || n.matches(".next") && this.index >= t - 1) && this.focus(), e.has("index") || e.has("items")) {
|
|
344
|
+
this.loading = t > 0, this.failed = !1, this.swipeX = 0, this.silently(() => this.pz.set({
|
|
291
345
|
zoom: 1,
|
|
292
346
|
x: .5,
|
|
293
347
|
y: .5
|
|
294
|
-
}), this.zoomed = !1, this.natural = {
|
|
348
|
+
})), this.zoomed = !1, this.natural = {
|
|
295
349
|
w: 0,
|
|
296
350
|
h: 0
|
|
297
351
|
};
|
|
298
352
|
let e = this.items[this.index];
|
|
299
|
-
if (this.ratio = e?.width && e.height ? e.width / e.height : 0, e) {
|
|
353
|
+
if (this.ratio = e?.width && e.height ? e.width / e.height : 0, this.thumbRatio = 0, e) {
|
|
300
354
|
let t = new Image();
|
|
301
355
|
t.src = e.full || e.src, t.complete && t.naturalWidth && t.naturalHeight && (this.loading = !1, this.ratio = t.naturalWidth / t.naturalHeight);
|
|
302
356
|
}
|
|
@@ -304,23 +358,76 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
304
358
|
}
|
|
305
359
|
updated(e) {
|
|
306
360
|
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")) {
|
|
361
|
+
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
362
|
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);
|
|
363
|
+
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();
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
silently(e) {
|
|
367
|
+
let t = this.quiet;
|
|
368
|
+
this.quiet = !0;
|
|
369
|
+
try {
|
|
370
|
+
e();
|
|
371
|
+
} finally {
|
|
372
|
+
this.quiet = t;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
onViewChange() {
|
|
376
|
+
this.quiet || (this.pendingView = null, this.viewChanged = !0);
|
|
377
|
+
}
|
|
378
|
+
pictureScale() {
|
|
379
|
+
return {
|
|
380
|
+
kx: this.fit.w ? this.box.w / this.fit.w : 1,
|
|
381
|
+
ky: this.fit.h ? this.box.h / this.fit.h : 1
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
applyPendingView() {
|
|
385
|
+
let e = this.pendingView;
|
|
386
|
+
if (!e || !this.hasUpdated || this.isUpdatePending || !this.frame) return;
|
|
387
|
+
this.measure();
|
|
388
|
+
let { kx: t, ky: n } = this.pictureScale();
|
|
389
|
+
this.silently(() => this.pz.set({
|
|
390
|
+
zoom: e.zoom,
|
|
391
|
+
x: .5 + (e.x - .5) / t,
|
|
392
|
+
y: .5 + (e.y - .5) / n
|
|
393
|
+
})), this.apply(!1), this.ratio && (this.pendingView = null);
|
|
394
|
+
}
|
|
395
|
+
bindKeyScope() {
|
|
396
|
+
if (this.unbindKeyScope(), this.immersive && this.isConnected) {
|
|
397
|
+
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")) {
|
|
398
|
+
this.keyScope = e, e.addEventListener("keydown", this.onScopeKey);
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
310
401
|
}
|
|
311
402
|
}
|
|
403
|
+
unbindKeyScope() {
|
|
404
|
+
this.keyScope?.removeEventListener("keydown", this.onScopeKey), this.keyScope = null;
|
|
405
|
+
}
|
|
406
|
+
onScopeKey = (e) => {
|
|
407
|
+
let t = e;
|
|
408
|
+
if (t.defaultPrevented) return;
|
|
409
|
+
let n = t.composedPath();
|
|
410
|
+
if (!n.includes(this)) {
|
|
411
|
+
for (let e of n) {
|
|
412
|
+
if (e === this.keyScope) break;
|
|
413
|
+
if (e instanceof Element && (e.matches(T) || e.isContentEditable)) return;
|
|
414
|
+
}
|
|
415
|
+
this.onKey(t);
|
|
416
|
+
}
|
|
417
|
+
};
|
|
312
418
|
watchSize() {
|
|
313
419
|
cancelAnimationFrame(this.sizeWatch);
|
|
314
420
|
let e = () => {
|
|
315
421
|
this.sizeWatch = 0;
|
|
316
422
|
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));
|
|
423
|
+
!t || this.failed || this.ratio || (t.naturalWidth && t.naturalHeight ? (this.ratio = t.naturalWidth / t.naturalHeight, this.measure(), this.apply(!1), this.applyPendingView()) : this.sizeWatch = requestAnimationFrame(e));
|
|
318
424
|
};
|
|
319
425
|
this.sizeWatch = requestAnimationFrame(e);
|
|
320
426
|
}
|
|
321
427
|
preloadNeighbours() {
|
|
322
428
|
let e = this.items.length;
|
|
323
429
|
if (!(e < 2)) for (let t of [this.index + 1, this.index - 1]) {
|
|
430
|
+
if (!this.loop && (t < 0 || t >= e)) continue;
|
|
324
431
|
let n = this.items[(t + e) % e], r = n.full || n.src;
|
|
325
432
|
if (this.preloaded.has(r)) continue;
|
|
326
433
|
this.preloaded.add(r);
|
|
@@ -330,9 +437,9 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
330
437
|
}
|
|
331
438
|
go(e) {
|
|
332
439
|
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 }));
|
|
440
|
+
if (t < 2) return !1;
|
|
441
|
+
let n = this.loop ? (e % t + t) % t : E(e, 0, t - 1);
|
|
442
|
+
return n !== this.index && (this.index = n, l(this, "change", { index: n }), !0);
|
|
336
443
|
}
|
|
337
444
|
get panStep() {
|
|
338
445
|
return Math.max(40, this.box.w * .1);
|
|
@@ -354,8 +461,8 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
354
461
|
"+": () => this.zoomTo(this.pz.zoom * y),
|
|
355
462
|
"=": () => this.zoomTo(this.pz.zoom * y),
|
|
356
463
|
"-": () => this.zoomTo(this.pz.zoom / y),
|
|
357
|
-
0: () => this.
|
|
358
|
-
1: () => this.
|
|
464
|
+
0: () => this.zoomFit(),
|
|
465
|
+
1: () => this.zoomActual()
|
|
359
466
|
});
|
|
360
467
|
let r = n[e.key];
|
|
361
468
|
r && (e.preventDefault(), r());
|
|
@@ -363,22 +470,22 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
363
470
|
measure() {
|
|
364
471
|
let e = this.frame;
|
|
365
472
|
if (!e) return;
|
|
366
|
-
let t = e.getBoundingClientRect(), n =
|
|
473
|
+
let t = (e.parentElement ?? e).getBoundingClientRect(), n = parseFloat(getComputedStyle(e).left) || 0, r = Math.max(0, t.width - 2 * n), i = t.height;
|
|
367
474
|
this.box = {
|
|
368
|
-
x: t.left + t.width / 2
|
|
369
|
-
y: t.top + t.height / 2
|
|
475
|
+
x: t.left + t.width / 2,
|
|
476
|
+
y: t.top + t.height / 2,
|
|
370
477
|
w: r,
|
|
371
478
|
h: i
|
|
372
479
|
};
|
|
373
|
-
let
|
|
374
|
-
if (
|
|
375
|
-
let e = Math.min(r /
|
|
480
|
+
let a = this.image;
|
|
481
|
+
if (a?.naturalWidth && a.naturalHeight) {
|
|
482
|
+
let e = Math.min(r / a.naturalWidth, i / a.naturalHeight);
|
|
376
483
|
this.fit = {
|
|
377
|
-
w:
|
|
378
|
-
h:
|
|
484
|
+
w: a.naturalWidth * e,
|
|
485
|
+
h: a.naturalHeight * e
|
|
379
486
|
}, this.natural = {
|
|
380
|
-
w:
|
|
381
|
-
h:
|
|
487
|
+
w: a.naturalWidth,
|
|
488
|
+
h: a.naturalHeight
|
|
382
489
|
};
|
|
383
490
|
} else this.ratio ? (this.fit = this.ratio > r / i ? {
|
|
384
491
|
w: r,
|
|
@@ -417,7 +524,7 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
417
524
|
let r = this.natural.w ? this.pz.zoom / this.actualScale : 0;
|
|
418
525
|
this.image?.classList.toggle("pixelated", r >= v);
|
|
419
526
|
let i = this.renderRoot.querySelector(".level");
|
|
420
|
-
i && (i.textContent = r ? this.formatPercent(r) : "");
|
|
527
|
+
i && (i.textContent = r ? this.formatPercent(r) : ""), this.viewChanged && (this.viewChanged = !1, l(this, "viewchange", this.view));
|
|
421
528
|
});
|
|
422
529
|
}
|
|
423
530
|
formatPercent(e) {
|
|
@@ -428,7 +535,7 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
428
535
|
})), this.percent.format(e);
|
|
429
536
|
}
|
|
430
537
|
clampPan() {
|
|
431
|
-
this.pz.set({});
|
|
538
|
+
this.silently(() => this.pz.set({}));
|
|
432
539
|
}
|
|
433
540
|
zoomTo(e, t = this.box.x, n = this.box.y, r = !0) {
|
|
434
541
|
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,6 +549,7 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
442
549
|
}), this.apply(!0);
|
|
443
550
|
}
|
|
444
551
|
onWheel(e) {
|
|
552
|
+
if (!this.immersive && !this.zoomed && !e.ctrlKey && !e.metaKey) return;
|
|
445
553
|
e.preventDefault();
|
|
446
554
|
let t = e.deltaMode === 1 ? e.deltaY * 16 : e.deltaY;
|
|
447
555
|
this.zoomTo(this.pz.zoom * Math.exp(-t * (e.ctrlKey ? .01 : .002)), e.clientX, e.clientY, !1);
|
|
@@ -511,25 +619,29 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
511
619
|
}
|
|
512
620
|
if (this.pointers.size) return;
|
|
513
621
|
let t = this.swipeX;
|
|
514
|
-
t ? (this.swipeX = 0, e.type
|
|
622
|
+
t ? (this.swipeX = 0, (e.type === "pointercancel" || Math.abs(t) <= x || !this.go(this.index + (t < 0 ? 1 : -1))) && this.apply(!0)) : !this.drag.moved && e.type === "pointerup" && this.onTap(e);
|
|
515
623
|
}
|
|
516
624
|
onTap(e) {
|
|
517
|
-
let t = e.
|
|
518
|
-
if (
|
|
519
|
-
this.
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
625
|
+
let t = Math.abs(e.clientX - this.box.x) > this.fit.w / 2 || Math.abs(e.clientY - this.box.y) > this.fit.h / 2;
|
|
626
|
+
if (this.immersive && e.pointerType !== "touch") {
|
|
627
|
+
if (!this.zoomed && t) {
|
|
628
|
+
u(this, "dismiss");
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
let n = w.find((e) => this.pz.zoom < e - .01);
|
|
632
|
+
n ? this.zoomTo(n, e.clientX, e.clientY) : this.zoomFit();
|
|
524
633
|
return;
|
|
525
634
|
}
|
|
526
|
-
|
|
527
|
-
|
|
635
|
+
let n = e.timeStamp, r = this.lastTap;
|
|
636
|
+
n - r.t < C && Math.hypot(e.clientX - r.x, e.clientY - r.y) < 30 ? (this.lastTap = {
|
|
637
|
+
t: 0,
|
|
638
|
+
x: 0,
|
|
639
|
+
y: 0
|
|
640
|
+
}, this.zoomed ? this.zoomFit() : this.zoomTo(b, e.clientX, e.clientY)) : (this.lastTap = {
|
|
641
|
+
t: n,
|
|
528
642
|
x: e.clientX,
|
|
529
643
|
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");
|
|
644
|
+
}, !this.zoomed && t && u(this, "dismiss"));
|
|
533
645
|
}
|
|
534
646
|
onImageLoad(e) {
|
|
535
647
|
if (e && e.target !== this.image) return;
|
|
@@ -538,7 +650,14 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
538
650
|
t?.naturalWidth && t.naturalHeight && (this.ratio = t.naturalWidth / t.naturalHeight), this.placeImage();
|
|
539
651
|
}
|
|
540
652
|
placeImage() {
|
|
541
|
-
this.
|
|
653
|
+
let e = this.image?.getAttribute("src") ?? "";
|
|
654
|
+
this.preloaded.add(e), this.measure(), this.apply(!1), this.applyPendingView();
|
|
655
|
+
let t = `${this.index}|${e}`;
|
|
656
|
+
t !== this.loadedKey && (this.loadedKey = t, this.dispatchEvent(new Event("load")));
|
|
657
|
+
}
|
|
658
|
+
onThumbLoad(e) {
|
|
659
|
+
let t = e.target;
|
|
660
|
+
t.naturalWidth && t.naturalHeight && (this.thumbRatio = t.naturalWidth / t.naturalHeight);
|
|
542
661
|
}
|
|
543
662
|
onImageError(e) {
|
|
544
663
|
e.target === this.image && (this.loading = !1, this.failed = !0);
|
|
@@ -548,8 +667,9 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
548
667
|
return t ? this.renderViewer(t) : e`<div class="empty" part="base"></div>`;
|
|
549
668
|
}
|
|
550
669
|
renderViewer(n) {
|
|
551
|
-
let r = this.items.length, o = r > 1, s = n.full || n.src, c = this.filmstrip && o;
|
|
670
|
+
let r = this.items.length, o = r > 1, s = n.full || n.src, c = this.filmstrip && o, l = !this.loop && this.index <= 0, u = !this.loop && this.index >= r - 1;
|
|
552
671
|
return e`<div class="viewer" part="base" role="region" tabindex="0"
|
|
672
|
+
style=${i({ "--_bk-image-viewer-ratio": this.ratio || this.thumbRatio || void 0 })}
|
|
553
673
|
aria-label=${this.label || this.i18n.t("imageViewer")} @keydown=${this.onKey}>
|
|
554
674
|
<div class="bar" part="toolbar">
|
|
555
675
|
<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", {
|
|
@@ -560,20 +680,21 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
560
680
|
<bk-button variant="ghost" class="control" size="lg" label=${this.zoomOutLabel || this.i18n.t("zoomOut")} icon="zoom-out" @click=${() => this.zoomTo(this.pz.zoom / y)}></bk-button>
|
|
561
681
|
<output class="level" part="zoom-level" aria-live="off" aria-label=${this.i18n.t("zoomLevel")}></output>
|
|
562
682
|
<bk-button variant="ghost" class="control" size="lg" label=${this.zoomInLabel || this.i18n.t("zoomIn")} icon="zoom-in" @click=${() => this.zoomTo(this.pz.zoom * y)}></bk-button>
|
|
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.
|
|
683
|
+
<bk-button variant="ghost" class="control fit" size="lg" label=${this.fitLabel || this.i18n.t("zoomFit")} icon="fit-screen" @click=${() => this.zoomFit()}></bk-button>
|
|
684
|
+
<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
685
|
</span>
|
|
566
686
|
<span class="actions"><slot name="actions"></slot></span>
|
|
567
687
|
</div>
|
|
568
688
|
<div class="main">
|
|
569
|
-
<div class="
|
|
689
|
+
<div class="sizer" aria-hidden="true"></div>
|
|
690
|
+
<div class="stage ${this.zoomed ? "zoomed" : ""} ${this.immersive ? "steps" : ""}" part="stage" @wheel=${this.onWheel}
|
|
570
691
|
@pointerdown=${this.onPointerDown} @pointermove=${this.onPointerMove}
|
|
571
692
|
@pointerup=${this.onPointerUp} @pointercancel=${this.onPointerUp}>
|
|
572
693
|
<div class="frame">${a(`${this.index}|${s}`, e`
|
|
573
694
|
<img class="image ${this.loading ? "" : "loaded"} ${this.failed ? "failed" : ""}" part="image" src=${s} alt=${n.alt} decoding="async"
|
|
574
695
|
draggable="false" @load=${this.onImageLoad} @error=${this.onImageError}>
|
|
575
|
-
${s === n.src ? t : e`<img class="placeholder ${this.ratio ? "shaped" : ""}"
|
|
576
|
-
src=${n.src} alt="" aria-hidden="true" decoding="async" draggable="false">`}`)}
|
|
696
|
+
${s === n.src ? t : e`<img class="placeholder ${this.ratio ? "shaped" : ""}"
|
|
697
|
+
src=${n.src} alt="" aria-hidden="true" decoding="async" draggable="false" @load=${this.onThumbLoad}>`}`)}
|
|
577
698
|
</div>
|
|
578
699
|
${this.loading ? e`<span class="spinner"><bk-spinner size="lg"></bk-spinner></span>` : t}
|
|
579
700
|
${this.failed ? e`<p class="error" role="alert"><bk-icon name="error" size="md"></bk-icon>${this.errorLabel || this.i18n.t("imageError")}</p>` : t}
|
|
@@ -585,8 +706,8 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
585
706
|
<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
707
|
</span>
|
|
587
708
|
${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.go(this.index - 1)}></bk-button>
|
|
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.go(this.index + 1)}></bk-button>` : t}
|
|
709
|
+
<bk-button variant="ghost" class="control nav prev" part="nav" size="lg" icon="chevron-left" label=${this.prevLabel || this.i18n.t("previousImage")} ?disabled=${l} @click=${() => this.go(this.index - 1)}></bk-button>
|
|
710
|
+
<bk-button variant="ghost" class="control nav next" part="nav" size="lg" icon="chevron-right" label=${this.nextLabel || this.i18n.t("nextImage")} ?disabled=${u} @click=${() => this.go(this.index + 1)}></bk-button>` : t}
|
|
590
711
|
</div>
|
|
591
712
|
<div class="foot" ?hidden=${!n.caption && !c}>
|
|
592
713
|
${n.caption ? e`<p class="caption" part="caption">${n.caption}</p>` : t}
|
|
@@ -603,5 +724,5 @@ var g = 8, _ = 16, v = 3, y = 1.5, b = 2.5, x = 48, S = 8, C = 300, w = (e, t, n
|
|
|
603
724
|
</div>`;
|
|
604
725
|
}
|
|
605
726
|
};
|
|
606
|
-
s("bk-image-viewer",
|
|
607
|
-
export {
|
|
727
|
+
s("bk-image-viewer", D);
|
|
728
|
+
export { D as BkImageViewer };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as e, n as t, u as n } from "./chunks/lit-D8x-qXgH.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as o } from "./chunks/define-
|
|
2
|
+
import { o as r, r as i, t as a } from "./chunks/i18n-DFfGgd3d.js";
|
|
3
|
+
import { t as o } from "./chunks/define-DkVeu7e9.js";
|
|
4
4
|
import { t as s } from "./chunks/events-DQ4e9cPN.js";
|
|
5
5
|
import { n as c, t as l } from "./chunks/field-DkBkSgJI.js";
|
|
6
|
-
import { t as u } from "./chunks/form-control-
|
|
7
|
-
import { c as d, r as f, s as p, t as m } from "./chunks/styles-
|
|
6
|
+
import { t as u } from "./chunks/form-control-CHpfKAKa.js";
|
|
7
|
+
import { c as d, r as f, s as p, t as m } from "./chunks/styles-CaeyhYDA.js";
|
|
8
8
|
// dist/components/bk-input-code.js
|
|
9
9
|
var h = class extends u {
|
|
10
10
|
static properties = {
|
|
@@ -2,12 +2,12 @@ import { a as e, n as t, u as n } from "./chunks/lit-D8x-qXgH.js";
|
|
|
2
2
|
import { t as r } from "./chunks/if-defined-z_20pBRr.js";
|
|
3
3
|
import { t as i } from "./chunks/live-CgLyfc6z.js";
|
|
4
4
|
import { n as a, o, t as s } from "./chunks/anchor-CNX3nt2F.js";
|
|
5
|
-
import { t as c } from "./chunks/define-
|
|
5
|
+
import { t as c } from "./chunks/define-DkVeu7e9.js";
|
|
6
6
|
import { t as l } from "./chunks/events-DQ4e9cPN.js";
|
|
7
|
-
import { b as u, y as d } from "./chunks/styles-
|
|
8
|
-
import { t as f } from "./chunks/text-field-
|
|
7
|
+
import { b as u, y as d } from "./chunks/styles-CaeyhYDA.js";
|
|
8
|
+
import { t as f } from "./chunks/text-field-CqhJSAwZ.js";
|
|
9
9
|
import { allowedFormats as p, normalizeColor as m } from "./bk-color-panel.js";
|
|
10
|
-
import "./chunks/bk-icon-
|
|
10
|
+
import "./chunks/bk-icon-Bp_flKdv.js";
|
|
11
11
|
import "./bk-swatch.js";
|
|
12
12
|
import "./chunks/chevron-down-CpVEjEyi.js";
|
|
13
13
|
// dist/components/bk-input-color.js
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, c as t, l as n } from "./chunks/date-field-
|
|
2
|
-
import { t as r } from "./chunks/bk-input-date-range-
|
|
1
|
+
import { a as e, c as t, l as n } from "./chunks/date-field-B-fCXa2D.js";
|
|
2
|
+
import { t as r } from "./chunks/bk-input-date-range-DHcJ8-5g.js";
|
|
3
3
|
import "./bk-input-time.js";
|
|
4
4
|
export { r as BkInputDateRange, e as parseDateRange, t as parseRelative, n as resolveRelative };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as e, u as t } from "./chunks/lit-D8x-qXgH.js";
|
|
2
|
-
import { t as n } from "./chunks/define-
|
|
3
|
-
import { i as r, t as i } from "./chunks/date-field-
|
|
2
|
+
import { t as n } from "./chunks/define-DkVeu7e9.js";
|
|
3
|
+
import { i as r, t as i } from "./chunks/date-field-B-fCXa2D.js";
|
|
4
4
|
import { fromUtc as a, utc as o, validIso as s } from "./bk-calendar.js";
|
|
5
5
|
// dist/components/bk-input-date.js
|
|
6
6
|
var c, l = class extends i {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { a as e, n as t, u as n } from "./chunks/lit-D8x-qXgH.js";
|
|
2
2
|
import { t as r } from "./chunks/if-defined-z_20pBRr.js";
|
|
3
3
|
import { t as i } from "./chunks/repeat-Dxf3qZZl.js";
|
|
4
|
-
import { t as a } from "./chunks/i18n-
|
|
5
|
-
import { t as o } from "./chunks/define-
|
|
4
|
+
import { t as a } from "./chunks/i18n-DFfGgd3d.js";
|
|
5
|
+
import { t as o } from "./chunks/define-DkVeu7e9.js";
|
|
6
6
|
import { n as s, t as c } from "./chunks/events-DQ4e9cPN.js";
|
|
7
7
|
import { t as l } from "./chunks/format-Dj4SzErj.js";
|
|
8
8
|
import { n as u } from "./chunks/format-DEwvmPPd.js";
|
|
9
9
|
import { n as d, t as f } from "./chunks/field-DkBkSgJI.js";
|
|
10
|
-
import { t as p } from "./chunks/form-control-
|
|
10
|
+
import { t as p } from "./chunks/form-control-CHpfKAKa.js";
|
|
11
11
|
import { t as m } from "./chunks/slots-BHTtBbPo.js";
|
|
12
|
-
import { c as h, s as g, t as _ } from "./chunks/styles-
|
|
12
|
+
import { c as h, s as g, t as _ } from "./chunks/styles-CaeyhYDA.js";
|
|
13
13
|
import "./bk-bar.js";
|
|
14
|
-
import "./chunks/bk-icon-
|
|
14
|
+
import "./chunks/bk-icon-Bp_flKdv.js";
|
|
15
15
|
import "./bk-button.js";
|
|
16
16
|
import "./bk-progress.js";
|
|
17
17
|
import "./bk-sortable.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a as e, u as t } from "./chunks/lit-D8x-qXgH.js";
|
|
2
2
|
import { t as n } from "./chunks/if-defined-z_20pBRr.js";
|
|
3
|
-
import { t as r } from "./chunks/i18n-
|
|
4
|
-
import { t as i } from "./chunks/define-
|
|
3
|
+
import { t as r } from "./chunks/i18n-DFfGgd3d.js";
|
|
4
|
+
import { t as i } from "./chunks/define-DkVeu7e9.js";
|
|
5
5
|
import { t as a } from "./chunks/events-DQ4e9cPN.js";
|
|
6
6
|
import { n as o, t as s } from "./chunks/field-DkBkSgJI.js";
|
|
7
|
-
import { t as c } from "./chunks/form-control-
|
|
8
|
-
import { c as l, s as u, t as d } from "./chunks/styles-
|
|
7
|
+
import { t as c } from "./chunks/form-control-CHpfKAKa.js";
|
|
8
|
+
import { c as l, s as u, t as d } from "./chunks/styles-CaeyhYDA.js";
|
|
9
9
|
// dist/components/bk-input-group.js
|
|
10
10
|
var f = "bk-input-text, bk-input-number, bk-input-date, bk-input-time, bk-input-date-range, bk-input-color, bk-input-code, bk-select, bk-combobox, bk-input-time-zone", p = class extends c {
|
|
11
11
|
static properties = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as e, n as t, t as n, u as r } from "./chunks/lit-D8x-qXgH.js";
|
|
2
2
|
import { t as i } from "./chunks/style-map-BMvn17E7.js";
|
|
3
|
-
import { n as a, t as o } from "./chunks/define-
|
|
4
|
-
import { t as s } from "./chunks/i18n-
|
|
3
|
+
import { n as a, t as o } from "./chunks/define-DkVeu7e9.js";
|
|
4
|
+
import { t as s } from "./chunks/i18n-DFfGgd3d.js";
|
|
5
5
|
import { n as c, r as l } from "./chunks/events-DQ4e9cPN.js";
|
|
6
|
-
import { t as u, x as d } from "./chunks/styles-
|
|
7
|
-
import {
|
|
6
|
+
import { t as u, x as d } from "./chunks/styles-CaeyhYDA.js";
|
|
7
|
+
import { h as f } from "./chunks/shortcuts-DPxCSO4M.js";
|
|
8
8
|
import "./bk-button.js";
|
|
9
9
|
import "./chunks/check-BkWcIJJJ.js";
|
|
10
10
|
import "./chunks/close-CcDDKPf9.js";
|
|
@@ -39,7 +39,7 @@ var p = class extends n {
|
|
|
39
39
|
customEdit = !1;
|
|
40
40
|
adopted = !1;
|
|
41
41
|
constructor() {
|
|
42
|
-
super(), this.value = "", this.label = "", this.placeholder = "", this.size = "md", this.disabledReason = "", this.required = !1, this.editLabel = "", this.editing = !1, this.busy = !1, this.error = "";
|
|
42
|
+
super(), this.value = "", this.label = "", this.placeholder = "", this.size = "md", this.disabledReason = "", this.required = !1, this.editLabel = "", this.editing = !1, this.busy = !1, this.error = "", this.addEventListener("focusout", this.onFocusOut);
|
|
43
43
|
}
|
|
44
44
|
static styles = [
|
|
45
45
|
u,
|
|
@@ -50,7 +50,11 @@ var p = class extends n {
|
|
|
50
50
|
--_bk-inline-px: var(--bk-input-inline-pad-inline, var(--bk-space-1-5));
|
|
51
51
|
--_bk-inline-py: var(--bk-input-inline-pad-block, var(--bk-space-1));
|
|
52
52
|
--_bk-inline-bw: var(--bk-field-border-width, var(--bk-border-width));
|
|
53
|
+
--_bk-input-inline-ctl: var(--bk-control-md);
|
|
54
|
+
--_bk-input-inline-pencil-gap: max(var(--bk-input-inline-gap, var(--bk-space-1)), calc(var(--_bk-inline-px) + var(--_bk-inline-bw)));
|
|
53
55
|
}
|
|
56
|
+
:host([size="sm"]) { --_bk-input-inline-ctl: var(--bk-control-sm); }
|
|
57
|
+
:host([size="lg"]) { --_bk-input-inline-ctl: var(--bk-control-lg); }
|
|
54
58
|
:host([size="sm"]) :is(.text, input) { font-size: var(--bk-type-small); }
|
|
55
59
|
:host([size="lg"]) :is(.text, input) { font-size: var(--bk-type-lead); }
|
|
56
60
|
/* One line, as tall in both: with line-height normal an input and a span measure their line differently. */
|
|
@@ -75,11 +79,8 @@ var p = class extends n {
|
|
|
75
79
|
reach over the line by the same amount above and below instead of making the line taller, so the text stays. */
|
|
76
80
|
.pencil {
|
|
77
81
|
display: inline-flex;
|
|
78
|
-
--_bk-input-inline-ctl: var(--bk-control-md);
|
|
79
82
|
margin-block: min(0px, calc((1lh - var(--_bk-input-inline-ctl)) / 2));
|
|
80
83
|
}
|
|
81
|
-
:host([size="sm"]) .pencil { --_bk-input-inline-ctl: var(--bk-control-sm); }
|
|
82
|
-
:host([size="lg"]) .pencil { --_bk-input-inline-ctl: var(--bk-control-lg); }
|
|
83
84
|
.pencil { opacity: 0; transition: opacity var(--bk-duration-fast); }
|
|
84
85
|
/* The pencil reaches over the line: its focus ring goes inside it, so it does not touch the text around. */
|
|
85
86
|
.pencil bk-button { --bk-button-focus-offset: var(--bk-focus-offset-inset); }
|
|
@@ -128,8 +129,9 @@ var p = class extends n {
|
|
|
128
129
|
pointer. The check of the open field stands in the same place. With a slotted editor the check and the cancel
|
|
129
130
|
button stay in the row. */
|
|
130
131
|
@media (hover: hover) and (forced-colors: none) {
|
|
132
|
+
/* The host leaves room for the pencil in its container: a full line does not push the pencil out of it. */
|
|
133
|
+
:host { max-width: calc(100% - var(--_bk-input-inline-pencil-gap) - var(--_bk-input-inline-ctl)); }
|
|
131
134
|
:is(.text, .display, .edit:not(.slotted)) + .pencil {
|
|
132
|
-
--_bk-input-inline-pencil-gap: max(var(--bk-input-inline-gap, var(--bk-space-1)), calc(var(--_bk-inline-px) + var(--_bk-inline-bw)));
|
|
133
135
|
position: relative; z-index: 1; flex: none;
|
|
134
136
|
inline-size: calc(var(--_bk-input-inline-pencil-gap) + var(--_bk-input-inline-ctl));
|
|
135
137
|
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)));
|
|
@@ -240,7 +242,12 @@ var p = class extends n {
|
|
|
240
242
|
e.composedPath().some((e) => e !== this && e.matches?.("a[href], button, bk-button, input, select")) || this.edit();
|
|
241
243
|
};
|
|
242
244
|
onOutside = (e) => {
|
|
243
|
-
this.busy || e.composedPath().includes(this) || this.
|
|
245
|
+
this.busy || e.composedPath().includes(this) || this.save();
|
|
246
|
+
};
|
|
247
|
+
onFocusOut = (e) => {
|
|
248
|
+
if (!this.editing || this.busy) return;
|
|
249
|
+
let t = e.relatedTarget;
|
|
250
|
+
!t || t === this || this.contains(t) || this.renderRoot?.contains(t) || (this.save(), this.restoreFocus = !1);
|
|
244
251
|
};
|
|
245
252
|
disconnectedCallback() {
|
|
246
253
|
super.disconnectedCallback(), document.removeEventListener("pointerdown", this.onOutside, !0);
|