@getflip/swirl-components 0.456.3 → 0.457.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/components.json +37 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/swirl-components.cjs.js +1 -1
- package/dist/cjs/swirl-option-list_2.cjs.entry.js +7 -1
- package/dist/cjs/swirl-select.cjs.entry.js +103 -2
- package/dist/collection/components/swirl-option-list/swirl-option-list.js +32 -1
- package/dist/collection/components/swirl-select/swirl-select.js +103 -2
- package/dist/collection/components/swirl-select/swirl-select.stories.js +27 -7
- package/dist/components/FileSaver.min.js +1 -0
- package/dist/components/assets/pdfjs/pdf.worker.min.mjs +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/media-query.service.js +1 -0
- package/dist/components/swirl-accordion-item.js +1 -1
- package/dist/components/swirl-accordion.js +1 -1
- package/dist/components/swirl-action-list-item.js +1 -1
- package/dist/components/swirl-action-list-item2.js +1 -0
- package/dist/components/swirl-action-list-section.js +1 -1
- package/dist/components/swirl-action-list.js +1 -1
- package/dist/components/swirl-action-list2.js +1 -0
- package/dist/components/swirl-app-bar.js +1 -1
- package/dist/components/swirl-app-icon.js +1 -1
- package/dist/components/swirl-app-layout.js +1 -1
- package/dist/components/swirl-autocomplete.js +1 -1
- package/dist/components/swirl-avatar-group.js +1 -1
- package/dist/components/swirl-avatar.js +1 -1
- package/dist/components/swirl-badge.js +1 -1
- package/dist/components/swirl-badge2.js +1 -0
- package/dist/components/swirl-banner.js +1 -1
- package/dist/components/swirl-box.js +1 -1
- package/dist/components/swirl-box2.js +1 -0
- package/dist/components/swirl-button-group.js +1 -1
- package/dist/components/swirl-button-group2.js +1 -0
- package/dist/components/swirl-button.js +1 -1
- package/dist/components/swirl-button2.js +1 -0
- package/dist/components/swirl-card.js +1 -1
- package/dist/components/swirl-carousel-slide.js +1 -1
- package/dist/components/swirl-carousel.js +1 -1
- package/dist/components/swirl-checkbox.js +1 -1
- package/dist/components/swirl-chip.js +1 -1
- package/dist/components/swirl-color-input.js +1 -1
- package/dist/components/swirl-columns.js +1 -1
- package/dist/components/swirl-console-layout.js +1 -1
- package/dist/components/swirl-data-cell-stack.js +1 -1
- package/dist/components/swirl-data-cell.js +1 -1
- package/dist/components/swirl-date-input.js +1 -1
- package/dist/components/swirl-date-picker.js +1 -1
- package/dist/components/swirl-date-picker2.js +1 -0
- package/dist/components/swirl-description-list-item.js +1 -1
- package/dist/components/swirl-description-list.js +1 -1
- package/dist/components/swirl-dialog.js +1 -1
- package/dist/components/swirl-emoji-clap.js +1 -1
- package/dist/components/swirl-emoji-happy.js +1 -1
- package/dist/components/swirl-emoji-idea.js +1 -1
- package/dist/components/swirl-emoji-love.js +1 -1
- package/dist/components/swirl-emoji-sad.js +1 -1
- package/dist/components/swirl-emoji-thumbs-up.js +1 -1
- package/dist/components/swirl-emoji.js +1 -1
- package/dist/components/swirl-empty-state.js +1 -1
- package/dist/components/swirl-file-chip.js +1 -1
- package/dist/components/swirl-file-uploader.js +1 -1
- package/dist/components/swirl-file-viewer-audio.js +1 -1
- package/dist/components/swirl-file-viewer-audio2.js +1 -0
- package/dist/components/swirl-file-viewer-csv.js +1 -1
- package/dist/components/swirl-file-viewer-csv2.js +7 -0
- package/dist/components/swirl-file-viewer-fallback.js +1 -1
- package/dist/components/swirl-file-viewer-fallback2.js +1 -0
- package/dist/components/swirl-file-viewer-image.js +1 -1
- package/dist/components/swirl-file-viewer-image2.js +1 -0
- package/dist/components/swirl-file-viewer-pdf.js +1 -1
- package/dist/components/{p-CSS4_A9c.js → swirl-file-viewer-pdf2.js} +1 -1
- package/dist/components/swirl-file-viewer-text.js +1 -1
- package/dist/components/swirl-file-viewer-text2.js +1 -0
- package/dist/components/swirl-file-viewer-video.js +1 -1
- package/dist/components/swirl-file-viewer-video2.js +1 -0
- package/dist/components/swirl-file-viewer.js +1 -1
- package/dist/components/swirl-file-viewer2.js +1 -0
- package/dist/components/swirl-form-control.js +1 -1
- package/dist/components/swirl-form-group.js +1 -1
- package/dist/components/swirl-heading.js +1 -1
- package/dist/components/swirl-heading2.js +1 -0
- package/dist/components/swirl-icon-add-moderator.js +1 -1
- package/dist/components/swirl-icon-add-photo.js +1 -1
- package/dist/components/swirl-icon-add-reaction.js +1 -1
- package/dist/components/swirl-icon-add.js +1 -1
- package/dist/components/swirl-icon-add2.js +1 -0
- package/dist/components/swirl-icon-admin-panel-settings.js +1 -1
- package/dist/components/swirl-icon-ai-filled.js +1 -1
- package/dist/components/swirl-icon-ai.js +1 -1
- package/dist/components/swirl-icon-apps.js +1 -1
- package/dist/components/swirl-icon-arrow-back.js +1 -1
- package/dist/components/swirl-icon-arrow-back2.js +1 -0
- package/dist/components/swirl-icon-arrow-downward.js +1 -1
- package/dist/components/swirl-icon-arrow-downward2.js +1 -0
- package/dist/components/swirl-icon-arrow-forward.js +1 -1
- package/dist/components/swirl-icon-arrow-forward2.js +1 -0
- package/dist/components/swirl-icon-arrow-left.js +1 -1
- package/dist/components/swirl-icon-arrow-left2.js +1 -0
- package/dist/components/swirl-icon-arrow-right-small.js +1 -1
- package/dist/components/swirl-icon-arrow-right.js +1 -1
- package/dist/components/swirl-icon-arrow-right2.js +1 -0
- package/dist/components/swirl-icon-arrow-upward.js +1 -1
- package/dist/components/swirl-icon-arrow-upward2.js +1 -0
- package/dist/components/swirl-icon-aspect-ratio.js +1 -1
- package/dist/components/swirl-icon-attachment.js +1 -1
- package/dist/components/swirl-icon-attachment2.js +1 -0
- package/dist/components/swirl-icon-audio-file.js +1 -1
- package/dist/components/swirl-icon-audio-file2.js +1 -0
- package/dist/components/swirl-icon-autorenew.js +1 -1
- package/dist/components/swirl-icon-bar-chart.js +1 -1
- package/dist/components/swirl-icon-beach-access-filled.js +1 -1
- package/dist/components/swirl-icon-beach-access.js +1 -1
- package/dist/components/swirl-icon-block.js +1 -1
- package/dist/components/swirl-icon-bookmark-filled.js +1 -1
- package/dist/components/swirl-icon-bookmark.js +1 -1
- package/dist/components/swirl-icon-calendar-add-on-filled.js +1 -1
- package/dist/components/swirl-icon-calendar-respond.js +1 -1
- package/dist/components/swirl-icon-calendar-today.js +1 -1
- package/dist/components/swirl-icon-call-end.js +1 -1
- package/dist/components/swirl-icon-call.js +1 -1
- package/dist/components/swirl-icon-cancel-filled.js +1 -1
- package/dist/components/swirl-icon-cancel-outline.js +1 -1
- package/dist/components/swirl-icon-cancel.js +1 -1
- package/dist/components/swirl-icon-cancel2.js +1 -0
- package/dist/components/swirl-icon-chat-bubble.js +1 -1
- package/dist/components/swirl-icon-chats-filled.js +1 -1
- package/dist/components/swirl-icon-chats.js +1 -1
- package/dist/components/swirl-icon-check-circle-filled.js +1 -1
- package/dist/components/swirl-icon-check-circle.js +1 -1
- package/dist/components/swirl-icon-check-circle2.js +1 -0
- package/dist/components/swirl-icon-check-small.js +1 -1
- package/dist/components/swirl-icon-check-small2.js +1 -0
- package/dist/components/swirl-icon-check-strong.js +1 -1
- package/dist/components/swirl-icon-check-strong2.js +1 -0
- package/dist/components/swirl-icon-check.js +1 -1
- package/dist/components/swirl-icon-checkbox-filled.js +1 -1
- package/dist/components/swirl-icon-chevron-left.js +1 -1
- package/dist/components/swirl-icon-chevron-right.js +1 -1
- package/dist/components/swirl-icon-chevron-right2.js +1 -0
- package/dist/components/swirl-icon-close-fullscreen.js +1 -1
- package/dist/components/swirl-icon-close-small.js +1 -1
- package/dist/components/swirl-icon-close.js +1 -1
- package/dist/components/swirl-icon-close2.js +1 -0
- package/dist/components/swirl-icon-cloud-upload.js +1 -1
- package/dist/components/swirl-icon-cloud-upload2.js +1 -0
- package/dist/components/swirl-icon-column.js +1 -1
- package/dist/components/swirl-icon-comment.js +1 -1
- package/dist/components/swirl-icon-contrast.js +1 -1
- package/dist/components/swirl-icon-copy.js +1 -1
- package/dist/components/swirl-icon-crop.js +1 -1
- package/dist/components/swirl-icon-dark-mode.js +1 -1
- package/dist/components/swirl-icon-date-range.js +1 -1
- package/dist/components/swirl-icon-delete.js +1 -1
- package/dist/components/swirl-icon-deployed-code.js +1 -1
- package/dist/components/swirl-icon-description.js +1 -1
- package/dist/components/swirl-icon-desktop.js +1 -1
- package/dist/components/swirl-icon-directory-filled.js +1 -1
- package/dist/components/swirl-icon-directory.js +1 -1
- package/dist/components/swirl-icon-discover.js +1 -1
- package/dist/components/swirl-icon-dock-left-collapse.js +1 -1
- package/dist/components/swirl-icon-dock-left-collapse2.js +1 -0
- package/dist/components/swirl-icon-dock-left-expand.js +1 -1
- package/dist/components/swirl-icon-dock-left-expand2.js +1 -0
- package/dist/components/swirl-icon-dock-left.js +1 -1
- package/dist/components/swirl-icon-door-open.js +1 -1
- package/dist/components/swirl-icon-dot.js +1 -1
- package/dist/components/swirl-icon-double-arrow-left.js +1 -1
- package/dist/components/swirl-icon-double-arrow-left2.js +1 -0
- package/dist/components/swirl-icon-double-arrow-right.js +1 -1
- package/dist/components/swirl-icon-download.js +1 -1
- package/dist/components/swirl-icon-download2.js +1 -0
- package/dist/components/swirl-icon-drag-handle.js +1 -1
- package/dist/components/swirl-icon-drag-handle2.js +1 -0
- package/dist/components/swirl-icon-edit-note.js +1 -1
- package/dist/components/swirl-icon-edit.js +1 -1
- package/dist/components/swirl-icon-emoji-mood.js +1 -1
- package/dist/components/swirl-icon-emoji-satisfied.js +1 -1
- package/dist/components/swirl-icon-emoji-symbols.js +1 -1
- package/dist/components/swirl-icon-error.js +1 -1
- package/dist/components/swirl-icon-error2.js +1 -0
- package/dist/components/swirl-icon-expand-less.js +1 -1
- package/dist/components/swirl-icon-expand-less2.js +1 -0
- package/dist/components/swirl-icon-expand-more.js +1 -1
- package/dist/components/swirl-icon-expand-more2.js +1 -0
- package/dist/components/swirl-icon-experiment.js +1 -1
- package/dist/components/swirl-icon-file-copy.js +1 -1
- package/dist/components/swirl-icon-file-copy2.js +1 -0
- package/dist/components/swirl-icon-file.js +1 -1
- package/dist/components/swirl-icon-file2.js +1 -0
- package/dist/components/swirl-icon-filter.js +1 -1
- package/dist/components/swirl-icon-folder-shared.js +1 -1
- package/dist/components/swirl-icon-folder.js +1 -1
- package/dist/components/swirl-icon-folder2.js +1 -0
- package/dist/components/swirl-icon-format-h-one.js +1 -1
- package/dist/components/swirl-icon-format-list-bulleted.js +1 -1
- package/dist/components/swirl-icon-forward.js +1 -1
- package/dist/components/swirl-icon-fullscreen-exit.js +1 -1
- package/dist/components/swirl-icon-fullscreen-exit2.js +1 -0
- package/dist/components/swirl-icon-fullscreen.js +1 -1
- package/dist/components/swirl-icon-fullscreen2.js +1 -0
- package/dist/components/swirl-icon-gif.js +1 -1
- package/dist/components/swirl-icon-group-add.js +1 -1
- package/dist/components/swirl-icon-group-assign.js +1 -1
- package/dist/components/swirl-icon-groups-filled.js +1 -1
- package/dist/components/swirl-icon-groups.js +1 -1
- package/dist/components/swirl-icon-hamburger-menu.js +1 -1
- package/dist/components/swirl-icon-health-and-safety.js +1 -1
- package/dist/components/swirl-icon-help-filled.js +1 -1
- package/dist/components/swirl-icon-help.js +1 -1
- package/dist/components/swirl-icon-help2.js +1 -0
- package/dist/components/swirl-icon-highlight.js +1 -1
- package/dist/components/swirl-icon-history.js +1 -1
- package/dist/components/swirl-icon-home-filled.js +1 -1
- package/dist/components/swirl-icon-home.js +1 -1
- package/dist/components/swirl-icon-hr-resting.js +1 -1
- package/dist/components/swirl-icon-image.js +1 -1
- package/dist/components/swirl-icon-image2.js +1 -0
- package/dist/components/swirl-icon-improve-text.js +1 -1
- package/dist/components/swirl-icon-info.js +1 -1
- package/dist/components/swirl-icon-info2.js +1 -0
- package/dist/components/swirl-icon-insert-below.js +1 -1
- package/dist/components/swirl-icon-insert-chart.js +1 -1
- package/dist/components/swirl-icon-insert-on-top.js +1 -1
- package/dist/components/swirl-icon-inventory-off.js +1 -1
- package/dist/components/swirl-icon-inventory.js +1 -1
- package/dist/components/swirl-icon-iphone.js +1 -1
- package/dist/components/swirl-icon-key.js +1 -1
- package/dist/components/swirl-icon-keyboard-hide.js +1 -1
- package/dist/components/swirl-icon-keyboard.js +1 -1
- package/dist/components/swirl-icon-language.js +1 -1
- package/dist/components/swirl-icon-light-mode.js +1 -1
- package/dist/components/swirl-icon-like.js +1 -1
- package/dist/components/swirl-icon-link.js +1 -1
- package/dist/components/swirl-icon-live.js +1 -1
- package/dist/components/swirl-icon-load.js +1 -1
- package/dist/components/swirl-icon-location-on.js +1 -1
- package/dist/components/swirl-icon-lock-open.js +1 -1
- package/dist/components/swirl-icon-lock-person.js +1 -1
- package/dist/components/swirl-icon-lock.js +1 -1
- package/dist/components/swirl-icon-login.js +1 -1
- package/dist/components/swirl-icon-logout.js +1 -1
- package/dist/components/swirl-icon-long-text.js +1 -1
- package/dist/components/swirl-icon-mail.js +1 -1
- package/dist/components/swirl-icon-manage-accounts.js +1 -1
- package/dist/components/swirl-icon-mark-chat-read.js +1 -1
- package/dist/components/swirl-icon-mark-chat-unread.js +1 -1
- package/dist/components/swirl-icon-mention.js +1 -1
- package/dist/components/swirl-icon-menu-book-filled.js +1 -1
- package/dist/components/swirl-icon-menu-book.js +1 -1
- package/dist/components/swirl-icon-menu-book2.js +1 -0
- package/dist/components/swirl-icon-menu-filled.js +1 -1
- package/dist/components/swirl-icon-menu.js +1 -1
- package/dist/components/swirl-icon-message.js +1 -1
- package/dist/components/swirl-icon-mic-off.js +1 -1
- package/dist/components/swirl-icon-mic.js +1 -1
- package/dist/components/swirl-icon-more-horizontal.js +1 -1
- package/dist/components/swirl-icon-more-vertikal.js +1 -1
- package/dist/components/swirl-icon-news-filled.js +1 -1
- package/dist/components/swirl-icon-news-off.js +1 -1
- package/dist/components/swirl-icon-news.js +1 -1
- package/dist/components/swirl-icon-next-plan.js +1 -1
- package/dist/components/swirl-icon-note-stack-filled.js +1 -1
- package/dist/components/swirl-icon-note-stack.js +1 -1
- package/dist/components/swirl-icon-notifications-active.js +1 -1
- package/dist/components/swirl-icon-notifications-off.js +1 -1
- package/dist/components/swirl-icon-notifications.js +1 -1
- package/dist/components/swirl-icon-open-in-full.js +1 -1
- package/dist/components/swirl-icon-open-in-new.js +1 -1
- package/dist/components/swirl-icon-open-in-new2.js +1 -0
- package/dist/components/swirl-icon-patient-list.js +1 -1
- package/dist/components/swirl-icon-pause-circle.js +1 -1
- package/dist/components/swirl-icon-pause.js +1 -1
- package/dist/components/swirl-icon-people-alt.js +1 -1
- package/dist/components/swirl-icon-person-check.js +1 -1
- package/dist/components/swirl-icon-person-off.js +1 -1
- package/dist/components/swirl-icon-person.js +1 -1
- package/dist/components/swirl-icon-person2.js +1 -0
- package/dist/components/swirl-icon-phone.js +1 -1
- package/dist/components/swirl-icon-photo-camera.js +1 -1
- package/dist/components/swirl-icon-picture-as-pdf.js +1 -1
- package/dist/components/swirl-icon-picture-as-pdf2.js +1 -0
- package/dist/components/swirl-icon-picture-in-picture.js +1 -1
- package/dist/components/swirl-icon-pin-off.js +1 -1
- package/dist/components/swirl-icon-pin.js +1 -1
- package/dist/components/swirl-icon-place.js +1 -1
- package/dist/components/swirl-icon-play-arrow.js +1 -1
- package/dist/components/swirl-icon-poll.js +1 -1
- package/dist/components/swirl-icon-post-approval.js +1 -1
- package/dist/components/swirl-icon-present.js +1 -1
- package/dist/components/swirl-icon-preview.js +1 -1
- package/dist/components/swirl-icon-print.js +1 -1
- package/dist/components/swirl-icon-public-off.js +1 -1
- package/dist/components/swirl-icon-public.js +1 -1
- package/dist/components/swirl-icon-published-with-changes.js +1 -1
- package/dist/components/swirl-icon-ratio-four-to-three.js +1 -1
- package/dist/components/swirl-icon-ratio-freeform.js +1 -1
- package/dist/components/swirl-icon-ratio-sixteen-to-nine.js +1 -1
- package/dist/components/swirl-icon-ratio-square.js +1 -1
- package/dist/components/swirl-icon-ratio-three-to-four.js +1 -1
- package/dist/components/swirl-icon-ratio-three-to-two.js +1 -1
- package/dist/components/swirl-icon-recieved.js +1 -1
- package/dist/components/swirl-icon-refresh.js +1 -1
- package/dist/components/swirl-icon-remove-circle.js +1 -1
- package/dist/components/swirl-icon-remove-moderator.js +1 -1
- package/dist/components/swirl-icon-remove.js +1 -1
- package/dist/components/swirl-icon-remove2.js +1 -0
- package/dist/components/swirl-icon-reply.js +1 -1
- package/dist/components/swirl-icon-report.js +1 -1
- package/dist/components/swirl-icon-roadmap.js +1 -1
- package/dist/components/swirl-icon-rotate-left.js +1 -1
- package/dist/components/swirl-icon-rotate-right.js +1 -1
- package/dist/components/swirl-icon-screenshare-off.js +1 -1
- package/dist/components/swirl-icon-screenshare.js +1 -1
- package/dist/components/swirl-icon-search-strong.js +1 -1
- package/dist/components/swirl-icon-search.js +1 -1
- package/dist/components/swirl-icon-search2.js +1 -0
- package/dist/components/swirl-icon-section.js +1 -1
- package/dist/components/swirl-icon-secure.js +1 -1
- package/dist/components/swirl-icon-sell.js +1 -1
- package/dist/components/swirl-icon-send.js +1 -1
- package/dist/components/swirl-icon-settings.js +1 -1
- package/dist/components/swirl-icon-short-text.js +1 -1
- package/dist/components/swirl-icon-simplify.js +1 -1
- package/dist/components/swirl-icon-spellcheck.js +1 -1
- package/dist/components/swirl-icon-stars.js +1 -1
- package/dist/components/swirl-icon-sticky-note.js +1 -1
- package/dist/components/swirl-icon-stop-circle.js +1 -1
- package/dist/components/swirl-icon-stop.js +1 -1
- package/dist/components/swirl-icon-sunny.js +1 -1
- package/dist/components/swirl-icon-sync.js +1 -1
- package/dist/components/swirl-icon-tasks-filled.js +1 -1
- package/dist/components/swirl-icon-tasks.js +1 -1
- package/dist/components/swirl-icon-terminal.js +1 -1
- package/dist/components/swirl-icon-time-filled.js +1 -1
- package/dist/components/swirl-icon-time.js +1 -1
- package/dist/components/swirl-icon-today-filled.js +1 -1
- package/dist/components/swirl-icon-today.js +1 -1
- package/dist/components/swirl-icon-today2.js +1 -0
- package/dist/components/swirl-icon-translate.js +1 -1
- package/dist/components/swirl-icon-tree-structure.js +1 -1
- package/dist/components/swirl-icon-undo.js +1 -1
- package/dist/components/swirl-icon-unlock-person.js +1 -1
- package/dist/components/swirl-icon-upload.js +1 -1
- package/dist/components/swirl-icon-user-add.js +1 -1
- package/dist/components/swirl-icon-user-assign.js +1 -1
- package/dist/components/swirl-icon-video-camera-off.js +1 -1
- package/dist/components/swirl-icon-video-camera.js +1 -1
- package/dist/components/swirl-icon-video-library.js +1 -1
- package/dist/components/swirl-icon-video-player.js +1 -1
- package/dist/components/swirl-icon-video-player2.js +1 -0
- package/dist/components/swirl-icon-view-agenda.js +1 -1
- package/dist/components/swirl-icon-visibility-off.js +1 -1
- package/dist/components/swirl-icon-visibility-off2.js +1 -0
- package/dist/components/swirl-icon-visibility.js +1 -1
- package/dist/components/swirl-icon-visibility2.js +1 -0
- package/dist/components/swirl-icon-voice.js +1 -1
- package/dist/components/swirl-icon-volume-up.js +1 -1
- package/dist/components/swirl-icon-warning.js +1 -1
- package/dist/components/swirl-icon-warning2.js +1 -0
- package/dist/components/swirl-icon-web-asset-off.js +1 -1
- package/dist/components/swirl-icon-web-asset.js +1 -1
- package/dist/components/swirl-icon-work.js +1 -1
- package/dist/components/swirl-icon.js +1 -1
- package/dist/components/swirl-icon2.js +1 -0
- package/dist/components/swirl-image-grid-item.js +1 -1
- package/dist/components/swirl-image-grid.js +1 -1
- package/dist/components/swirl-inline-error.js +1 -1
- package/dist/components/swirl-inline-error2.js +1 -0
- package/dist/components/swirl-inline-notification.js +1 -1
- package/dist/components/swirl-inline-status.js +1 -1
- package/dist/components/swirl-lightbox.js +1 -1
- package/dist/components/swirl-link.js +1 -1
- package/dist/components/swirl-list.js +1 -1
- package/dist/components/swirl-menu-item.js +1 -1
- package/dist/components/swirl-menu.js +1 -1
- package/dist/components/swirl-modal-shell.js +1 -1
- package/dist/components/swirl-modal.js +1 -1
- package/dist/components/swirl-option-list-item.js +1 -1
- package/dist/components/swirl-option-list-item2.js +1 -0
- package/dist/components/swirl-option-list-section.js +1 -1
- package/dist/components/swirl-option-list.js +1 -1
- package/dist/components/swirl-option-list2.js +1 -0
- package/dist/components/swirl-pagination.js +1 -1
- package/dist/components/swirl-pdf-reader.js +1 -1
- package/dist/components/swirl-popover-trigger.js +1 -1
- package/dist/components/swirl-popover-trigger2.js +1 -0
- package/dist/components/swirl-popover.js +1 -1
- package/dist/components/swirl-popover2.js +1 -0
- package/dist/components/swirl-progress-indicator.js +1 -1
- package/dist/components/swirl-progress-indicator2.js +1 -0
- package/dist/components/swirl-radio-group.js +1 -1
- package/dist/components/swirl-radio.js +1 -1
- package/dist/components/swirl-resource-list-file-item.js +1 -1
- package/dist/components/swirl-resource-list-item.js +1 -1
- package/dist/components/swirl-resource-list-section.js +1 -1
- package/dist/components/swirl-resource-list.js +1 -1
- package/dist/components/swirl-search.js +1 -1
- package/dist/components/swirl-select.js +1 -1
- package/dist/components/swirl-separator.js +1 -1
- package/dist/components/swirl-separator2.js +1 -0
- package/dist/components/swirl-shell-layout.js +3 -3
- package/dist/components/swirl-shell-navigation-item.js +1 -1
- package/dist/components/swirl-skeleton-box.js +1 -1
- package/dist/components/swirl-skeleton-box2.js +1 -0
- package/dist/components/swirl-skeleton-text.js +1 -1
- package/dist/components/swirl-spinner.js +1 -1
- package/dist/components/swirl-spinner2.js +1 -0
- package/dist/components/swirl-stack.js +1 -1
- package/dist/components/swirl-stack2.js +1 -0
- package/dist/components/swirl-status-indicator.js +1 -1
- package/dist/components/swirl-switch.js +1 -1
- package/dist/components/swirl-symbol-ac-unit.js +1 -1
- package/dist/components/swirl-symbol-account-circle.js +1 -1
- package/dist/components/swirl-symbol-alternate-email.js +1 -1
- package/dist/components/swirl-symbol-android.js +1 -1
- package/dist/components/swirl-symbol-announcement.js +1 -1
- package/dist/components/swirl-symbol-autorenew.js +1 -1
- package/dist/components/swirl-symbol-backup.js +1 -1
- package/dist/components/swirl-symbol-badge.js +1 -1
- package/dist/components/swirl-symbol-barcode-reader.js +1 -1
- package/dist/components/swirl-symbol-barcode-scanner.js +1 -1
- package/dist/components/swirl-symbol-battery-horiz.js +1 -1
- package/dist/components/swirl-symbol-beach-access.js +1 -1
- package/dist/components/swirl-symbol-bolt.js +1 -1
- package/dist/components/swirl-symbol-bookmark.js +1 -1
- package/dist/components/swirl-symbol-calendar.js +1 -1
- package/dist/components/swirl-symbol-campaign.js +1 -1
- package/dist/components/swirl-symbol-cards-star.js +1 -1
- package/dist/components/swirl-symbol-cloud.js +1 -1
- package/dist/components/swirl-symbol-construction.js +1 -1
- package/dist/components/swirl-symbol-contacts.js +1 -1
- package/dist/components/swirl-symbol-coronavirus.js +1 -1
- package/dist/components/swirl-symbol-design-services.js +1 -1
- package/dist/components/swirl-symbol-desktop-windows.js +1 -1
- package/dist/components/swirl-symbol-directions-car-filled.js +1 -1
- package/dist/components/swirl-symbol-diversity.js +1 -1
- package/dist/components/swirl-symbol-draw.js +1 -1
- package/dist/components/swirl-symbol-edit-calendar.js +1 -1
- package/dist/components/swirl-symbol-email.js +1 -1
- package/dist/components/swirl-symbol-emergency.js +1 -1
- package/dist/components/swirl-symbol-emoji-food-beverage.js +1 -1
- package/dist/components/swirl-symbol-engineering.js +1 -1
- package/dist/components/swirl-symbol-event-menu.js +1 -1
- package/dist/components/swirl-symbol-explore.js +1 -1
- package/dist/components/swirl-symbol-extension.js +1 -1
- package/dist/components/swirl-symbol-facebook.js +1 -1
- package/dist/components/swirl-symbol-favorite.js +1 -1
- package/dist/components/swirl-symbol-fitness-center.js +1 -1
- package/dist/components/swirl-symbol-flag.js +1 -1
- package/dist/components/swirl-symbol-flight.js +1 -1
- package/dist/components/swirl-symbol-folder.js +1 -1
- package/dist/components/swirl-symbol-globe.js +1 -1
- package/dist/components/swirl-symbol-groups.js +1 -1
- package/dist/components/swirl-symbol-healing.js +1 -1
- package/dist/components/swirl-symbol-health-and-safety.js +1 -1
- package/dist/components/swirl-symbol-help.js +1 -1
- package/dist/components/swirl-symbol-home-repair-service.js +1 -1
- package/dist/components/swirl-symbol-home-storage.js +1 -1
- package/dist/components/swirl-symbol-id-card.js +1 -1
- package/dist/components/swirl-symbol-image.js +1 -1
- package/dist/components/swirl-symbol-info-menu.js +1 -1
- package/dist/components/swirl-symbol-instagram.js +1 -1
- package/dist/components/swirl-symbol-inventory-2.js +1 -1
- package/dist/components/swirl-symbol-inventory.js +1 -1
- package/dist/components/swirl-symbol-ios.js +1 -1
- package/dist/components/swirl-symbol-key.js +1 -1
- package/dist/components/swirl-symbol-language.js +1 -1
- package/dist/components/swirl-symbol-leaderboard.js +1 -1
- package/dist/components/swirl-symbol-lightbulb.js +1 -1
- package/dist/components/swirl-symbol-linkedin.js +1 -1
- package/dist/components/swirl-symbol-local-shipping.js +1 -1
- package/dist/components/swirl-symbol-location-on.js +1 -1
- package/dist/components/swirl-symbol-loyalty.js +1 -1
- package/dist/components/swirl-symbol-map.js +1 -1
- package/dist/components/swirl-symbol-maps-home-work.js +1 -1
- package/dist/components/swirl-symbol-menu-book.js +1 -1
- package/dist/components/swirl-symbol-mop.js +1 -1
- package/dist/components/swirl-symbol-nest-eco-leaf.js +1 -1
- package/dist/components/swirl-symbol-notifications.js +1 -1
- package/dist/components/swirl-symbol-open-in-new.js +1 -1
- package/dist/components/swirl-symbol-orders.js +1 -1
- package/dist/components/swirl-symbol-package.js +1 -1
- package/dist/components/swirl-symbol-palette.js +1 -1
- package/dist/components/swirl-symbol-partly-cloudy-day.js +1 -1
- package/dist/components/swirl-symbol-pedal-bike.js +1 -1
- package/dist/components/swirl-symbol-percent-discount.js +1 -1
- package/dist/components/swirl-symbol-pets.js +1 -1
- package/dist/components/swirl-symbol-pinterest.js +1 -1
- package/dist/components/swirl-symbol-point-of-sale.js +1 -1
- package/dist/components/swirl-symbol-policy.js +1 -1
- package/dist/components/swirl-symbol-precision-manufacturing.js +1 -1
- package/dist/components/swirl-symbol-print.js +1 -1
- package/dist/components/swirl-symbol-push-pin.js +1 -1
- package/dist/components/swirl-symbol-recycling.js +1 -1
- package/dist/components/swirl-symbol-redeem.js +1 -1
- package/dist/components/swirl-symbol-report-problem.js +1 -1
- package/dist/components/swirl-symbol-restaurant.js +1 -1
- package/dist/components/swirl-symbol-roadmap.js +1 -1
- package/dist/components/swirl-symbol-rocket-launch.js +1 -1
- package/dist/components/swirl-symbol-room.js +1 -1
- package/dist/components/swirl-symbol-savings.js +1 -1
- package/dist/components/swirl-symbol-school.js +1 -1
- package/dist/components/swirl-symbol-sell.js +1 -1
- package/dist/components/swirl-symbol-settings-voice.js +1 -1
- package/dist/components/swirl-symbol-shopping-bag.js +1 -1
- package/dist/components/swirl-symbol-shopping-cart.js +1 -1
- package/dist/components/swirl-symbol-smartphone.js +1 -1
- package/dist/components/swirl-symbol-spa.js +1 -1
- package/dist/components/swirl-symbol-sports-soccer.js +1 -1
- package/dist/components/swirl-symbol-star.js +1 -1
- package/dist/components/swirl-symbol-supervisor-account.js +1 -1
- package/dist/components/swirl-symbol-task.js +1 -1
- package/dist/components/swirl-symbol-tasks.js +1 -1
- package/dist/components/swirl-symbol-thumbs-up-down.js +1 -1
- package/dist/components/swirl-symbol-timer.js +1 -1
- package/dist/components/swirl-symbol-tools-power-drill.js +1 -1
- package/dist/components/swirl-symbol-train.js +1 -1
- package/dist/components/swirl-symbol-trophy.js +1 -1
- package/dist/components/swirl-symbol-twitter.js +1 -1
- package/dist/components/swirl-symbol-video.js +1 -1
- package/dist/components/swirl-symbol-warehouse.js +1 -1
- package/dist/components/swirl-symbol-water-drop.js +1 -1
- package/dist/components/swirl-symbol-wb-sunny.js +1 -1
- package/dist/components/swirl-symbol-wechat.js +1 -1
- package/dist/components/swirl-symbol-weibo.js +1 -1
- package/dist/components/swirl-symbol-wifi.js +1 -1
- package/dist/components/swirl-symbol-work.js +1 -1
- package/dist/components/swirl-symbol-xing.js +1 -1
- package/dist/components/swirl-symbol-youtube.js +1 -1
- package/dist/components/swirl-symbol.js +1 -1
- package/dist/components/swirl-tab-bar.js +1 -1
- package/dist/components/swirl-tab-bar2.js +1 -0
- package/dist/components/swirl-tab.js +1 -1
- package/dist/components/swirl-table-cell.js +1 -1
- package/dist/components/swirl-table-column.js +1 -1
- package/dist/components/swirl-table-row-group.js +1 -1
- package/dist/components/swirl-table-row.js +1 -1
- package/dist/components/swirl-table.js +1 -1
- package/dist/components/swirl-tabs.js +1 -1
- package/dist/components/swirl-tag.js +1 -1
- package/dist/components/swirl-tag2.js +1 -0
- package/dist/components/swirl-text-input.js +1 -1
- package/dist/components/swirl-text-input2.js +1 -0
- package/dist/components/swirl-text.js +1 -1
- package/dist/components/{p-CLL9tkCx.js → swirl-text2.js} +2 -2
- package/dist/components/swirl-theme-provider.js +1 -1
- package/dist/components/swirl-thumbnail.js +1 -1
- package/dist/components/swirl-time-input.js +1 -1
- package/dist/components/swirl-toast-provider.js +1 -1
- package/dist/components/swirl-toast.js +1 -1
- package/dist/components/swirl-toast2.js +1 -0
- package/dist/components/swirl-toggle-button.js +1 -1
- package/dist/components/swirl-toggle-group.js +1 -1
- package/dist/components/swirl-toolbar.js +1 -1
- package/dist/components/swirl-tooltip.js +1 -1
- package/dist/components/swirl-tooltip2.js +1 -0
- package/dist/components/swirl-tree-navigation-item.js +1 -1
- package/dist/components/swirl-tree-navigation.js +1 -1
- package/dist/components/swirl-tree-view-item.js +1 -1
- package/dist/components/swirl-tree-view.js +1 -1
- package/dist/components/swirl-video-thumbnail.js +1 -1
- package/dist/components/swirl-visually-hidden.js +1 -1
- package/dist/components/swirl-visually-hidden2.js +1 -0
- package/dist/components/wc-datepicker.js +1 -1
- package/dist/components/wc-datepicker2.js +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/swirl-components.js +1 -1
- package/dist/esm/swirl-option-list_2.entry.js +7 -1
- package/dist/esm/swirl-select.entry.js +103 -2
- package/dist/swirl-components/p-34b71786.entry.js +1 -0
- package/dist/swirl-components/p-e185b0d9.entry.js +1 -0
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-option-list/swirl-option-list.d.ts +1 -0
- package/dist/types/components/swirl-select/swirl-select.d.ts +35 -0
- package/dist/types/components.d.ts +1 -0
- package/package.json +2 -2
- package/dist/components/p-0aalbl4O.js +0 -1
- package/dist/components/p-AP3jliyB.js +0 -1
- package/dist/components/p-B0WN1rps.js +0 -1
- package/dist/components/p-B1lbDVkI.js +0 -7
- package/dist/components/p-B4-IcNlg.js +0 -1
- package/dist/components/p-B4Wd55DN.js +0 -1
- package/dist/components/p-B5qMvC5r.js +0 -1
- package/dist/components/p-B7F6qoij.js +0 -1
- package/dist/components/p-BEO_Ur1m.js +0 -1
- package/dist/components/p-BFpDSLqC.js +0 -1
- package/dist/components/p-BGAf4PfC.js +0 -1
- package/dist/components/p-BGcNhzCf.js +0 -1
- package/dist/components/p-BIzYxcO0.js +0 -1
- package/dist/components/p-BJvOgiIR.js +0 -1
- package/dist/components/p-BNVjmTgJ.js +0 -1
- package/dist/components/p-BPrIUuuy.js +0 -1
- package/dist/components/p-BTRrW2qG.js +0 -1
- package/dist/components/p-BeCXau-Z.js +0 -1
- package/dist/components/p-BgdSkqQE.js +0 -1
- package/dist/components/p-BhEaOHlc.js +0 -1
- package/dist/components/p-BhGrCwfI.js +0 -1
- package/dist/components/p-BhhRVGwJ.js +0 -1
- package/dist/components/p-BjsN_kp8.js +0 -1
- package/dist/components/p-Bk6G6dK-.js +0 -1
- package/dist/components/p-BoRiFGqT.js +0 -1
- package/dist/components/p-BrFFyRJi.js +0 -1
- package/dist/components/p-By1U8whi.js +0 -1
- package/dist/components/p-C7FMQE1P.js +0 -1
- package/dist/components/p-CABm247w.js +0 -1
- package/dist/components/p-CGXLsT-c.js +0 -1
- package/dist/components/p-CNFW8umP.js +0 -1
- package/dist/components/p-CNygDFNS.js +0 -1
- package/dist/components/p-CRzmGPA4.js +0 -1
- package/dist/components/p-CSrAmfZC.js +0 -1
- package/dist/components/p-CVhUr9hV.js +0 -1
- package/dist/components/p-CeFceB6s.js +0 -1
- package/dist/components/p-CkkPNPa1.js +0 -1
- package/dist/components/p-Cq-WMxvn.js +0 -1
- package/dist/components/p-Cqq2weHj.js +0 -1
- package/dist/components/p-CsgXzvRJ.js +0 -1
- package/dist/components/p-CwIjZr_u.js +0 -1
- package/dist/components/p-CxWxJaMr.js +0 -1
- package/dist/components/p-Cz9YHhEr.js +0 -1
- package/dist/components/p-CzZiJ1qc.js +0 -1
- package/dist/components/p-CzgARwlN.js +0 -1
- package/dist/components/p-D3r-p-AU.js +0 -1
- package/dist/components/p-D49fHybA.js +0 -1
- package/dist/components/p-D4WZ6faV.js +0 -1
- package/dist/components/p-D4oJmF1j.js +0 -1
- package/dist/components/p-D6_n1Szo.js +0 -1
- package/dist/components/p-D8u1hQ2f.js +0 -1
- package/dist/components/p-DAv9KTFn.js +0 -1
- package/dist/components/p-DBkxhNQs.js +0 -1
- package/dist/components/p-DCxwPw77.js +0 -1
- package/dist/components/p-DMS1jxJo.js +0 -1
- package/dist/components/p-DN7qemHl.js +0 -1
- package/dist/components/p-DNq43j9j.js +0 -1
- package/dist/components/p-DOAel0Sv.js +0 -1
- package/dist/components/p-DRB4VZpi.js +0 -1
- package/dist/components/p-DRexwmjJ.js +0 -1
- package/dist/components/p-DUOOPGWB.js +0 -1
- package/dist/components/p-DWVJBU8l.js +0 -1
- package/dist/components/p-DXnY4CJZ.js +0 -1
- package/dist/components/p-D_6CI-nU.js +0 -1
- package/dist/components/p-Df474Rg3.js +0 -1
- package/dist/components/p-DocOCmZh.js +0 -1
- package/dist/components/p-DqIJV0bj.js +0 -1
- package/dist/components/p-EssAJG_j.js +0 -1
- package/dist/components/p-NucM91d6.js +0 -1
- package/dist/components/p-Pe7RFGrP.js +0 -1
- package/dist/components/p-WUxuIVzT.js +0 -1
- package/dist/components/p-XhPQOhOB.js +0 -1
- package/dist/components/p-YuQonxPX.js +0 -1
- package/dist/components/p-_9b-fMEm.js +0 -1
- package/dist/components/p-afNp4ghl.js +0 -1
- package/dist/components/p-g-oCTzqh.js +0 -1
- package/dist/components/p-jDELUVrg.js +0 -1
- package/dist/components/p-xECPKfCZ.js +0 -1
- package/dist/components/p-zJ7MHW_r.js +0 -1
- package/dist/swirl-components/p-19563ae1.entry.js +0 -1
- package/dist/swirl-components/p-67832486.entry.js +0 -1
- /package/dist/components/{p-B0kNlhKL.js → bodyScrollLock.esm.js} +0 -0
- /package/dist/components/{p-CLsTbQHn.js → floating-ui.dom.js} +0 -0
- /package/dist/components/{p-DBTxpXCn.js → index.esm.js} +0 -0
- /package/dist/components/{p-CTIzk_ki.js → index2.js} +0 -0
- /package/dist/components/{p-D3UoejeY.js → index3.js} +0 -0
- /package/dist/components/{p-CMrz6687.js → sortable.esm.js} +0 -0
- /package/dist/components/{p-BkSXzL50.js → swirl-tree-view.config.js} +0 -0
- /package/dist/components/{p-DRAQ9S8E.js → utils.js} +0 -0
- /package/dist/components/{p-DD3477fe.js → v4.js} +0 -0
|
@@ -16,6 +16,7 @@ const SwirlSelect = class {
|
|
|
16
16
|
this.searchInputLabel = "Search options";
|
|
17
17
|
this.selectId = Math.round(Math.random() * 1000000).toString();
|
|
18
18
|
this.options = [];
|
|
19
|
+
this.typeaheadBuffer = "";
|
|
19
20
|
this.select = (event) => {
|
|
20
21
|
event.stopPropagation();
|
|
21
22
|
this.value = event.detail;
|
|
@@ -35,6 +36,8 @@ const SwirlSelect = class {
|
|
|
35
36
|
this.onOpen = (event) => {
|
|
36
37
|
this.placement = event.detail.position?.placement;
|
|
37
38
|
this.open = true;
|
|
39
|
+
this.typeaheadBuffer = "";
|
|
40
|
+
clearTimeout(this.typeaheadTimeout);
|
|
38
41
|
if (this.withSearch && Boolean(this.searchInput)) {
|
|
39
42
|
this.searchInput.focus();
|
|
40
43
|
}
|
|
@@ -47,6 +50,8 @@ const SwirlSelect = class {
|
|
|
47
50
|
this.searchInput.value = "";
|
|
48
51
|
this.searchChange.emit("");
|
|
49
52
|
}
|
|
53
|
+
this.typeaheadBuffer = "";
|
|
54
|
+
clearTimeout(this.typeaheadTimeout);
|
|
50
55
|
this.open = false;
|
|
51
56
|
this.input.focus();
|
|
52
57
|
};
|
|
@@ -62,6 +67,11 @@ const SwirlSelect = class {
|
|
|
62
67
|
event.target === this.searchInput) {
|
|
63
68
|
this.optionList.querySelector('[tabIndex="0"]')?.focus();
|
|
64
69
|
}
|
|
70
|
+
else if (this.isTypeaheadKey(event)) {
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
event.stopPropagation();
|
|
73
|
+
this.handleTypeahead(event.key);
|
|
74
|
+
}
|
|
65
75
|
};
|
|
66
76
|
this.onSearchInput = (event) => {
|
|
67
77
|
this.searchChange.emit(event.target.value);
|
|
@@ -75,6 +85,7 @@ const SwirlSelect = class {
|
|
|
75
85
|
}
|
|
76
86
|
disconnectedCallback() {
|
|
77
87
|
this.observer?.disconnect();
|
|
88
|
+
clearTimeout(this.typeaheadTimeout);
|
|
78
89
|
}
|
|
79
90
|
onWindowFocusIn(event) {
|
|
80
91
|
if (event.target === this.el.querySelector("input")) {
|
|
@@ -101,6 +112,96 @@ const SwirlSelect = class {
|
|
|
101
112
|
updateOptions() {
|
|
102
113
|
this.options = utils.querySelectorAllDeep(this.el, "swirl-option-list-item");
|
|
103
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Returns true for printable single-character keys that should trigger
|
|
117
|
+
* typeahead, excluding Space (used for selection) and keys combined with
|
|
118
|
+
* modifiers. Ignores events from the search input.
|
|
119
|
+
*/
|
|
120
|
+
isTypeaheadKey(event) {
|
|
121
|
+
if (event.target === this.searchInput) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
if (event.metaKey || event.ctrlKey || event.altKey) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
return event.key.length === 1 && event.key !== " ";
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Manages the typeahead buffer and delegates to either cycling (repeated
|
|
131
|
+
* same character) or prefix matching (different characters). Resets the
|
|
132
|
+
* buffer if transitioning out of cycling mode. The buffer auto-clears
|
|
133
|
+
* after 500ms of inactivity.
|
|
134
|
+
*/
|
|
135
|
+
handleTypeahead(key) {
|
|
136
|
+
const char = key.toLowerCase();
|
|
137
|
+
clearTimeout(this.typeaheadTimeout);
|
|
138
|
+
const allSameChar = this.typeaheadBuffer.length > 0 &&
|
|
139
|
+
[...this.typeaheadBuffer].every((c) => c === char);
|
|
140
|
+
if (allSameChar) {
|
|
141
|
+
this.typeaheadBuffer += char;
|
|
142
|
+
this.cycleTypeahead(char);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
const wasCycling = this.typeaheadBuffer.length > 1 &&
|
|
146
|
+
new Set(this.typeaheadBuffer).size === 1;
|
|
147
|
+
this.typeaheadBuffer = wasCycling ? char : this.typeaheadBuffer + char;
|
|
148
|
+
if (!this.prefixMatchTypeahead(this.typeaheadBuffer)) {
|
|
149
|
+
this.typeaheadBuffer = char;
|
|
150
|
+
this.prefixMatchTypeahead(this.typeaheadBuffer);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
this.typeaheadTimeout = setTimeout(() => {
|
|
154
|
+
this.typeaheadBuffer = "";
|
|
155
|
+
}, 500);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Cycles focus/selection through options that start with the given
|
|
159
|
+
* character, wrapping around to the first match after the last one.
|
|
160
|
+
*/
|
|
161
|
+
cycleTypeahead(char) {
|
|
162
|
+
const enabledOptions = this.options.filter((o) => !o.disabled);
|
|
163
|
+
const matching = enabledOptions.filter((o) => o.label?.toLowerCase().startsWith(char));
|
|
164
|
+
if (matching.length === 0) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const anchorValue = this.getTypeaheadAnchorValue();
|
|
168
|
+
const currentIdx = matching.findIndex((o) => o.value === anchorValue);
|
|
169
|
+
const nextIdx = (currentIdx + 1) % matching.length;
|
|
170
|
+
this.applyTypeaheadMatch(matching[nextIdx]);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Finds the first enabled option whose label starts with the given prefix
|
|
174
|
+
* (case-insensitive) and focuses/selects it. Returns whether a match was
|
|
175
|
+
* found, so the caller can fall back to a single-character retry.
|
|
176
|
+
*/
|
|
177
|
+
prefixMatchTypeahead(prefix) {
|
|
178
|
+
const enabledOptions = this.options.filter((o) => !o.disabled);
|
|
179
|
+
const match = enabledOptions.find((o) => o.label?.toLowerCase().startsWith(prefix));
|
|
180
|
+
if (match) {
|
|
181
|
+
this.applyTypeaheadMatch(match);
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Returns the value of the currently focused option (when open) or the
|
|
188
|
+
* last selected value (when closed), used as the starting point for cycling.
|
|
189
|
+
*/
|
|
190
|
+
getTypeaheadAnchorValue() {
|
|
191
|
+
if (this.open) {
|
|
192
|
+
const focused = this.options.find((o) => o.querySelector('[role="option"][tabindex="0"]'));
|
|
193
|
+
return focused?.value;
|
|
194
|
+
}
|
|
195
|
+
return this.value?.[this.value.length - 1];
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Applies a typeahead match by focusing the option in the open list.
|
|
199
|
+
*/
|
|
200
|
+
applyTypeaheadMatch(option) {
|
|
201
|
+
if (this.open) {
|
|
202
|
+
this.optionList.focusItemWithValue(option.value);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
104
205
|
getValueLabel() {
|
|
105
206
|
return Boolean(this.value)
|
|
106
207
|
? this.value
|
|
@@ -126,11 +227,11 @@ const SwirlSelect = class {
|
|
|
126
227
|
"select--search-loading": this.searchLoading,
|
|
127
228
|
"select--standalone": this.standalone,
|
|
128
229
|
});
|
|
129
|
-
return (index.h(index.Host, { key: '
|
|
230
|
+
return (index.h(index.Host, { key: 'fb5381d9847789755c891530848715a66612c73a', onKeyDown: this.onKeyDown }, index.h("div", { key: 'ec4a8fd2cf3e29ec98b4855e7962808c97232684', class: className }, index.h("swirl-popover-trigger", { key: 'd8cd5ad295b1b05175c13f5492a44b9d171f07a7', swirlPopover: this.swirlPopover, setAriaAttributes: false }, index.h("swirl-stack", { key: 'e488349fbb57486ca6916eae73fe3f222503408f', class: "select__value-container" }, this.standalone && (index.h("span", { key: 'b84c6e890d51940c32780197e1201707fdaabe84', "aria-hidden": "true", class: "select__resize-helper" }, label)), index.h("input", { key: '5e11eeaca9f63f501c0a776d79e2a920188d1f16', "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-invalid": ariaInvalid, class: "select__input", disabled: this.disabled, readOnly: true, ref: (el) => (this.input = el), type: "text", value: label }))), index.h("span", { key: '6a24242f1b1c12b79fb705e905cc56b45edccbb0', class: "select__multi-select-values" }, this.value
|
|
130
231
|
?.map((value) => this.options.find((option) => option.value === value))
|
|
131
232
|
?.map((option) => (index.h("swirl-tag", { "aria-hidden": "true", label: option?.label,
|
|
132
233
|
// eslint-disable-next-line react/jsx-no-bind
|
|
133
|
-
onRemove: () => this.unselectOption(option?.value), removable: !this.disabled && this.allowDeselect && !option?.disabled })))), index.h("span", { key: '
|
|
234
|
+
onRemove: () => this.unselectOption(option?.value), removable: !this.disabled && this.allowDeselect && !option?.disabled })))), index.h("span", { key: '1269e975efb7930b3defdc7e818d044e63bfbf31', class: "select__indicator" }, this.open ? (index.h("swirl-icon-expand-less", { size: this.standalone ? 20 : 24 })) : (index.h("swirl-icon-expand-more", { size: this.standalone ? 20 : 24 }))), index.h("swirl-popover", { key: '8807a75e712facd319f2a7d62466ea8009bf02e4', animation: "scale-in-y", class: "select__popover", id: `select-options-${this.selectId}`, label: this.label, offset: offset, onPopoverClose: this.onClose, onPopoverOpen: this.onOpen, ref: (el) => (this.swirlPopover = el), useContainerWidth: this.standalone ? false : "swirl-form-control" }, this.withSearch && (index.h("div", { key: '744926136b2d2b85623e1388e2e2bab32e5f597d', class: "select__search" }, index.h("swirl-icon-search", { key: 'fb629903439586f28dcc89cc4a13180f93d282e4', class: "select__search-icon", size: 20 }), index.h("input", { key: '7e5e6a98ac828330cb6e3bc5fb735d2bdedfc0c0', "aria-label": this.searchInputLabel, class: "select__search-input", onInput: this.onSearchInput, placeholder: this.searchPlaceholder, ref: (el) => (this.searchInput = el), type: "search" }), this.searchLoading && (index.h("swirl-spinner", { key: '180c43636f58b88658181b728dbbd40c26cd89bc', class: "select__search-spinner", size: "s" })))), index.h("swirl-option-list", { key: 'e0c3e2ec010851a20b99ae33bcff619b1f3c067f', allowDeselect: this.allowDeselect, onValueChange: this.select, multiSelect: this.multiSelect, ref: (el) => (this.optionList = el), value: this.value }, !this.searchLoading && (index.h("div", { key: '1c9712715420c7b2e390577d21cc0fa2f66e163c', "aria-disabled": "true", class: "select__empty-list-label", role: "option" }, index.h("swirl-text", { key: '8486dce94b93b2bb2471ac26a8ead72aba8b7d4b', color: "subdued", weight: "medium" }, this.emptyListLabel))), index.h("slot", { key: 'a6684b60611a1b5eab4a19e444b8d6ef113eb59c', onSlotchange: this.onSlotChange }))))));
|
|
134
235
|
}
|
|
135
236
|
get el() { return index.getElement(this); }
|
|
136
237
|
static get watchers() { return {
|
|
@@ -190,6 +190,12 @@ export class SwirlOptionList {
|
|
|
190
190
|
this.syncItemsWithValue();
|
|
191
191
|
this.setSelectAllState();
|
|
192
192
|
}
|
|
193
|
+
async focusItemWithValue(value) {
|
|
194
|
+
const index = this.items.findIndex((item) => item.value === value);
|
|
195
|
+
if (index >= 0) {
|
|
196
|
+
this.focusItem(index);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
193
199
|
observeSlotChanges() {
|
|
194
200
|
this.observer = new MutationObserver(() => {
|
|
195
201
|
this.updateItems();
|
|
@@ -431,7 +437,7 @@ export class SwirlOptionList {
|
|
|
431
437
|
const ariaMultiselectable = this.multiSelect ? "true" : undefined;
|
|
432
438
|
const tabIndex = Boolean(this.dragging) ? 0 : undefined;
|
|
433
439
|
const showSelectAll = this.multiSelect && this.showSelectAll;
|
|
434
|
-
return (h(Host, { key: '
|
|
440
|
+
return (h(Host, { key: '23dac33782dc5196ebf9ed3069911c4745499e51' }, h("swirl-visually-hidden", { key: '31f2e96b74cf92d5bb181f878e0dcbe260f96b83', role: "alert" }, this.assistiveText), h("div", { key: '468b98cde9d0dcacc7c00bacc798287a6f094281', "aria-label": this.label, "aria-multiselectable": ariaMultiselectable, class: "option-list", id: this.optionListId, onClick: this.onClick, onKeyDown: this.onKeyDown, ref: (el) => (this.listboxEl = el), role: "listbox", tabIndex: tabIndex }, showSelectAll && (h("swirl-option-list-item", { key: '5f8c970263e40980e6f5162e07ddbe03220bda54', ref: (el) => (this.selectAllEl = el), label: this.selectAllLabel, disabled: this.disabled, context: "multi-select", selected: this.selectAllState === true, indeterminate: this.selectAllState === "indeterminate", value: this.selectAllValue })), h("slot", { key: '50e6464cad68af3ba9a7ecf4a628693445e62503', onSlotchange: this.setSectionSeparator }))));
|
|
435
441
|
}
|
|
436
442
|
static get is() { return "swirl-option-list"; }
|
|
437
443
|
static get encapsulation() { return "scoped"; }
|
|
@@ -725,6 +731,31 @@ export class SwirlOptionList {
|
|
|
725
731
|
}
|
|
726
732
|
}];
|
|
727
733
|
}
|
|
734
|
+
static get methods() {
|
|
735
|
+
return {
|
|
736
|
+
"focusItemWithValue": {
|
|
737
|
+
"complexType": {
|
|
738
|
+
"signature": "(value: string) => Promise<void>",
|
|
739
|
+
"parameters": [{
|
|
740
|
+
"name": "value",
|
|
741
|
+
"type": "string",
|
|
742
|
+
"docs": ""
|
|
743
|
+
}],
|
|
744
|
+
"references": {
|
|
745
|
+
"Promise": {
|
|
746
|
+
"location": "global",
|
|
747
|
+
"id": "global::Promise"
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
"return": "Promise<void>"
|
|
751
|
+
},
|
|
752
|
+
"docs": {
|
|
753
|
+
"text": "",
|
|
754
|
+
"tags": []
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
};
|
|
758
|
+
}
|
|
728
759
|
static get elementRef() { return "el"; }
|
|
729
760
|
static get watchers() {
|
|
730
761
|
return [{
|
|
@@ -8,6 +8,7 @@ export class SwirlSelect {
|
|
|
8
8
|
this.searchInputLabel = "Search options";
|
|
9
9
|
this.selectId = Math.round(Math.random() * 1000000).toString();
|
|
10
10
|
this.options = [];
|
|
11
|
+
this.typeaheadBuffer = "";
|
|
11
12
|
this.select = (event) => {
|
|
12
13
|
event.stopPropagation();
|
|
13
14
|
this.value = event.detail;
|
|
@@ -27,6 +28,8 @@ export class SwirlSelect {
|
|
|
27
28
|
this.onOpen = (event) => {
|
|
28
29
|
this.placement = event.detail.position?.placement;
|
|
29
30
|
this.open = true;
|
|
31
|
+
this.typeaheadBuffer = "";
|
|
32
|
+
clearTimeout(this.typeaheadTimeout);
|
|
30
33
|
if (this.withSearch && Boolean(this.searchInput)) {
|
|
31
34
|
this.searchInput.focus();
|
|
32
35
|
}
|
|
@@ -39,6 +42,8 @@ export class SwirlSelect {
|
|
|
39
42
|
this.searchInput.value = "";
|
|
40
43
|
this.searchChange.emit("");
|
|
41
44
|
}
|
|
45
|
+
this.typeaheadBuffer = "";
|
|
46
|
+
clearTimeout(this.typeaheadTimeout);
|
|
42
47
|
this.open = false;
|
|
43
48
|
this.input.focus();
|
|
44
49
|
};
|
|
@@ -54,6 +59,11 @@ export class SwirlSelect {
|
|
|
54
59
|
event.target === this.searchInput) {
|
|
55
60
|
this.optionList.querySelector('[tabIndex="0"]')?.focus();
|
|
56
61
|
}
|
|
62
|
+
else if (this.isTypeaheadKey(event)) {
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
event.stopPropagation();
|
|
65
|
+
this.handleTypeahead(event.key);
|
|
66
|
+
}
|
|
57
67
|
};
|
|
58
68
|
this.onSearchInput = (event) => {
|
|
59
69
|
this.searchChange.emit(event.target.value);
|
|
@@ -67,6 +77,7 @@ export class SwirlSelect {
|
|
|
67
77
|
}
|
|
68
78
|
disconnectedCallback() {
|
|
69
79
|
this.observer?.disconnect();
|
|
80
|
+
clearTimeout(this.typeaheadTimeout);
|
|
70
81
|
}
|
|
71
82
|
onWindowFocusIn(event) {
|
|
72
83
|
if (event.target === this.el.querySelector("input")) {
|
|
@@ -93,6 +104,96 @@ export class SwirlSelect {
|
|
|
93
104
|
updateOptions() {
|
|
94
105
|
this.options = querySelectorAllDeep(this.el, "swirl-option-list-item");
|
|
95
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Returns true for printable single-character keys that should trigger
|
|
109
|
+
* typeahead, excluding Space (used for selection) and keys combined with
|
|
110
|
+
* modifiers. Ignores events from the search input.
|
|
111
|
+
*/
|
|
112
|
+
isTypeaheadKey(event) {
|
|
113
|
+
if (event.target === this.searchInput) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
if (event.metaKey || event.ctrlKey || event.altKey) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
return event.key.length === 1 && event.key !== " ";
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Manages the typeahead buffer and delegates to either cycling (repeated
|
|
123
|
+
* same character) or prefix matching (different characters). Resets the
|
|
124
|
+
* buffer if transitioning out of cycling mode. The buffer auto-clears
|
|
125
|
+
* after 500ms of inactivity.
|
|
126
|
+
*/
|
|
127
|
+
handleTypeahead(key) {
|
|
128
|
+
const char = key.toLowerCase();
|
|
129
|
+
clearTimeout(this.typeaheadTimeout);
|
|
130
|
+
const allSameChar = this.typeaheadBuffer.length > 0 &&
|
|
131
|
+
[...this.typeaheadBuffer].every((c) => c === char);
|
|
132
|
+
if (allSameChar) {
|
|
133
|
+
this.typeaheadBuffer += char;
|
|
134
|
+
this.cycleTypeahead(char);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
const wasCycling = this.typeaheadBuffer.length > 1 &&
|
|
138
|
+
new Set(this.typeaheadBuffer).size === 1;
|
|
139
|
+
this.typeaheadBuffer = wasCycling ? char : this.typeaheadBuffer + char;
|
|
140
|
+
if (!this.prefixMatchTypeahead(this.typeaheadBuffer)) {
|
|
141
|
+
this.typeaheadBuffer = char;
|
|
142
|
+
this.prefixMatchTypeahead(this.typeaheadBuffer);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
this.typeaheadTimeout = setTimeout(() => {
|
|
146
|
+
this.typeaheadBuffer = "";
|
|
147
|
+
}, 500);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Cycles focus/selection through options that start with the given
|
|
151
|
+
* character, wrapping around to the first match after the last one.
|
|
152
|
+
*/
|
|
153
|
+
cycleTypeahead(char) {
|
|
154
|
+
const enabledOptions = this.options.filter((o) => !o.disabled);
|
|
155
|
+
const matching = enabledOptions.filter((o) => o.label?.toLowerCase().startsWith(char));
|
|
156
|
+
if (matching.length === 0) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
const anchorValue = this.getTypeaheadAnchorValue();
|
|
160
|
+
const currentIdx = matching.findIndex((o) => o.value === anchorValue);
|
|
161
|
+
const nextIdx = (currentIdx + 1) % matching.length;
|
|
162
|
+
this.applyTypeaheadMatch(matching[nextIdx]);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Finds the first enabled option whose label starts with the given prefix
|
|
166
|
+
* (case-insensitive) and focuses/selects it. Returns whether a match was
|
|
167
|
+
* found, so the caller can fall back to a single-character retry.
|
|
168
|
+
*/
|
|
169
|
+
prefixMatchTypeahead(prefix) {
|
|
170
|
+
const enabledOptions = this.options.filter((o) => !o.disabled);
|
|
171
|
+
const match = enabledOptions.find((o) => o.label?.toLowerCase().startsWith(prefix));
|
|
172
|
+
if (match) {
|
|
173
|
+
this.applyTypeaheadMatch(match);
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Returns the value of the currently focused option (when open) or the
|
|
180
|
+
* last selected value (when closed), used as the starting point for cycling.
|
|
181
|
+
*/
|
|
182
|
+
getTypeaheadAnchorValue() {
|
|
183
|
+
if (this.open) {
|
|
184
|
+
const focused = this.options.find((o) => o.querySelector('[role="option"][tabindex="0"]'));
|
|
185
|
+
return focused?.value;
|
|
186
|
+
}
|
|
187
|
+
return this.value?.[this.value.length - 1];
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Applies a typeahead match by focusing the option in the open list.
|
|
191
|
+
*/
|
|
192
|
+
applyTypeaheadMatch(option) {
|
|
193
|
+
if (this.open) {
|
|
194
|
+
this.optionList.focusItemWithValue(option.value);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
96
197
|
getValueLabel() {
|
|
97
198
|
return Boolean(this.value)
|
|
98
199
|
? this.value
|
|
@@ -118,11 +219,11 @@ export class SwirlSelect {
|
|
|
118
219
|
"select--search-loading": this.searchLoading,
|
|
119
220
|
"select--standalone": this.standalone,
|
|
120
221
|
});
|
|
121
|
-
return (h(Host, { key: '
|
|
222
|
+
return (h(Host, { key: 'fb5381d9847789755c891530848715a66612c73a', onKeyDown: this.onKeyDown }, h("div", { key: 'ec4a8fd2cf3e29ec98b4855e7962808c97232684', class: className }, h("swirl-popover-trigger", { key: 'd8cd5ad295b1b05175c13f5492a44b9d171f07a7', swirlPopover: this.swirlPopover, setAriaAttributes: false }, h("swirl-stack", { key: 'e488349fbb57486ca6916eae73fe3f222503408f', class: "select__value-container" }, this.standalone && (h("span", { key: 'b84c6e890d51940c32780197e1201707fdaabe84', "aria-hidden": "true", class: "select__resize-helper" }, label)), h("input", { key: '5e11eeaca9f63f501c0a776d79e2a920188d1f16', "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-invalid": ariaInvalid, class: "select__input", disabled: this.disabled, readOnly: true, ref: (el) => (this.input = el), type: "text", value: label }))), h("span", { key: '6a24242f1b1c12b79fb705e905cc56b45edccbb0', class: "select__multi-select-values" }, this.value
|
|
122
223
|
?.map((value) => this.options.find((option) => option.value === value))
|
|
123
224
|
?.map((option) => (h("swirl-tag", { "aria-hidden": "true", label: option?.label,
|
|
124
225
|
// eslint-disable-next-line react/jsx-no-bind
|
|
125
|
-
onRemove: () => this.unselectOption(option?.value), removable: !this.disabled && this.allowDeselect && !option?.disabled })))), h("span", { key: '
|
|
226
|
+
onRemove: () => this.unselectOption(option?.value), removable: !this.disabled && this.allowDeselect && !option?.disabled })))), h("span", { key: '1269e975efb7930b3defdc7e818d044e63bfbf31', class: "select__indicator" }, this.open ? (h("swirl-icon-expand-less", { size: this.standalone ? 20 : 24 })) : (h("swirl-icon-expand-more", { size: this.standalone ? 20 : 24 }))), h("swirl-popover", { key: '8807a75e712facd319f2a7d62466ea8009bf02e4', animation: "scale-in-y", class: "select__popover", id: `select-options-${this.selectId}`, label: this.label, offset: offset, onPopoverClose: this.onClose, onPopoverOpen: this.onOpen, ref: (el) => (this.swirlPopover = el), useContainerWidth: this.standalone ? false : "swirl-form-control" }, this.withSearch && (h("div", { key: '744926136b2d2b85623e1388e2e2bab32e5f597d', class: "select__search" }, h("swirl-icon-search", { key: 'fb629903439586f28dcc89cc4a13180f93d282e4', class: "select__search-icon", size: 20 }), h("input", { key: '7e5e6a98ac828330cb6e3bc5fb735d2bdedfc0c0', "aria-label": this.searchInputLabel, class: "select__search-input", onInput: this.onSearchInput, placeholder: this.searchPlaceholder, ref: (el) => (this.searchInput = el), type: "search" }), this.searchLoading && (h("swirl-spinner", { key: '180c43636f58b88658181b728dbbd40c26cd89bc', class: "select__search-spinner", size: "s" })))), h("swirl-option-list", { key: 'e0c3e2ec010851a20b99ae33bcff619b1f3c067f', allowDeselect: this.allowDeselect, onValueChange: this.select, multiSelect: this.multiSelect, ref: (el) => (this.optionList = el), value: this.value }, !this.searchLoading && (h("div", { key: '1c9712715420c7b2e390577d21cc0fa2f66e163c', "aria-disabled": "true", class: "select__empty-list-label", role: "option" }, h("swirl-text", { key: '8486dce94b93b2bb2471ac26a8ead72aba8b7d4b', color: "subdued", weight: "medium" }, this.emptyListLabel))), h("slot", { key: 'a6684b60611a1b5eab4a19e444b8d6ef113eb59c', onSlotchange: this.onSlotChange }))))));
|
|
126
227
|
}
|
|
127
228
|
static get is() { return "swirl-select"; }
|
|
128
229
|
static get encapsulation() { return "scoped"; }
|
|
@@ -15,25 +15,45 @@ const Template = (args) => {
|
|
|
15
15
|
const element = generateStoryElement("swirl-select", args);
|
|
16
16
|
formControl.label = "Select";
|
|
17
17
|
element.innerHTML = `
|
|
18
|
-
<swirl-option-list-section label="
|
|
18
|
+
<swirl-option-list-section label="Fruits">
|
|
19
19
|
<swirl-option-list-item
|
|
20
|
-
label="
|
|
20
|
+
label="Apple"
|
|
21
21
|
value="1"
|
|
22
22
|
></swirl-option-list-item>
|
|
23
23
|
<swirl-option-list-item
|
|
24
|
-
label="
|
|
24
|
+
label="Apricot"
|
|
25
25
|
value="2"
|
|
26
26
|
></swirl-option-list-item>
|
|
27
27
|
<swirl-option-list-item
|
|
28
|
-
label="
|
|
28
|
+
label="Avocado"
|
|
29
29
|
value="3"
|
|
30
30
|
></swirl-option-list-item>
|
|
31
|
-
</swirl-option-list-section>
|
|
32
|
-
<swirl-option-list-section label="Section 2">
|
|
33
31
|
<swirl-option-list-item
|
|
34
|
-
label="
|
|
32
|
+
label="Artichoke"
|
|
35
33
|
value="4"
|
|
36
34
|
></swirl-option-list-item>
|
|
35
|
+
<swirl-option-list-item
|
|
36
|
+
label="Banana"
|
|
37
|
+
value="5"
|
|
38
|
+
></swirl-option-list-item>
|
|
39
|
+
<swirl-option-list-item
|
|
40
|
+
label="Blueberry"
|
|
41
|
+
value="6"
|
|
42
|
+
></swirl-option-list-item>
|
|
43
|
+
</swirl-option-list-section>
|
|
44
|
+
<swirl-option-list-section label="Vegetables">
|
|
45
|
+
<swirl-option-list-item
|
|
46
|
+
label="Carrot"
|
|
47
|
+
value="7"
|
|
48
|
+
></swirl-option-list-item>
|
|
49
|
+
<swirl-option-list-item
|
|
50
|
+
label="Celery"
|
|
51
|
+
value="8"
|
|
52
|
+
></swirl-option-list-item>
|
|
53
|
+
<swirl-option-list-item
|
|
54
|
+
label="Tomato"
|
|
55
|
+
value="9"
|
|
56
|
+
></swirl-option-list-item>
|
|
37
57
|
</swirl-option-list-section>
|
|
38
58
|
`;
|
|
39
59
|
formControl.append(element);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./index2.js";var o,n,e={exports:{}},i=(o||(o=1,n=e,function(){function o(t,o,n){var e=new XMLHttpRequest;e.open("GET",t),e.responseType="blob",e.onload=function(){r(e.response,o,n)},e.onerror=function(){console.error("could not download file")},e.send()}function e(t){var o=new XMLHttpRequest;o.open("HEAD",t,!1);try{o.send()}catch(t){}return 200<=o.status&&299>=o.status}function i(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var o=document.createEvent("MouseEvents");o.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(o)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof t&&t.global===t?t:void 0,c=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),r=a.saveAs||("object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!c?function(t,n,c){var r=a.URL||a.webkitURL,f=document.createElement("a");f.download=n=n||t.name||"download",f.rel="noopener","string"==typeof t?(f.href=t,f.origin===location.origin?i(f):e(f.href)?o(t,n,c):i(f,f.target="_blank")):(f.href=r.createObjectURL(t),setTimeout((function(){r.revokeObjectURL(f.href)}),4e4),setTimeout((function(){i(f)}),0))}:"msSaveOrOpenBlob"in navigator?function(t,n,a){if(n=n||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(function(t,o){return void 0===o?o={autoBom:!1}:"object"!=typeof o&&(console.warn("Deprecated: Expected third argument to be a object"),o={autoBom:!o}),o.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}(t,a),n);else if(e(t))o(t,n,a);else{var c=document.createElement("a");c.href=t,c.target="_blank",setTimeout((function(){i(c)}))}}:function(t,n,e,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof t)return o(t,n,e);var r="application/octet-stream"===t.type,f=/constructor/i.test(a.HTMLElement)||a.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||r&&f||c)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var t=u.result;t=l?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=t:location=t,i=null},u.readAsDataURL(t)}else{var d=a.URL||a.webkitURL,s=d.createObjectURL(t);i?i.location=s:location.href=s,i=null,setTimeout((function(){d.revokeObjectURL(s)}),4e4)}});a.saveAs=r.saveAs=r,n.exports=r}()),e.exports);export{i as F}
|