@getflip/swirl-components-react 0.0.0-new-shell-20231128130728
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/README.md +4 -0
- package/dist/a11y-dialog.esm-d7a94c8c.bd6ae411.js +99 -0
- package/dist/bodyScrollLock.esm-ce6356d8.2c600fb9.js +93 -0
- package/dist/file-manager.entry.38457ac1.js +57 -0
- package/dist/floating-ui.dom.esm-ac7cc24e.79b318e4.js +780 -0
- package/dist/focus-trap.esm-37cd2d2b.724cca66.js +452 -0
- package/dist/index-d280dafb.186cdb0e.js +71 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.e5965a8a.js +2915 -0
- package/dist/maska-4866b970.5336f9cb.js +5420 -0
- package/dist/sortable.esm-8c3d5856.57c4f048.js +1229 -0
- package/dist/stencil-generated/index.d.ts +306 -0
- package/dist/stencil-generated/react-component-lib/createComponent.d.ts +10 -0
- package/dist/stencil-generated/react-component-lib/createOverlayComponent.d.ts +21 -0
- package/dist/stencil-generated/react-component-lib/index.d.ts +2 -0
- package/dist/stencil-generated/react-component-lib/interfaces.d.ts +29 -0
- package/dist/stencil-generated/react-component-lib/utils/attachProps.d.ts +12 -0
- package/dist/stencil-generated/react-component-lib/utils/case.d.ts +2 -0
- package/dist/stencil-generated/react-component-lib/utils/index.d.ts +10 -0
- package/dist/swirl-accordion-item.entry.741527ea.js +38 -0
- package/dist/swirl-accordion.entry.783de61a.js +36 -0
- package/dist/swirl-action-list-section.entry.7884f6d3.js +15 -0
- package/dist/swirl-action-list_3.entry.336ba911.js +83 -0
- package/dist/swirl-app-bar.entry.1a137585.js +45 -0
- package/dist/swirl-app-icon.entry.0f5a2f97.js +23 -0
- package/dist/swirl-app-layout_6.entry.1521cc72.js +327 -0
- package/dist/swirl-autocomplete.entry.ffefda4d.js +115 -0
- package/dist/swirl-avatar-group.entry.99938460.js +28 -0
- package/dist/swirl-avatar.entry.63c9bc2f.js +48 -0
- package/dist/swirl-badge.entry.f831e3ba.js +19 -0
- package/dist/swirl-banner.entry.62b1b388.js +47 -0
- package/dist/swirl-box.entry.cef3da26.js +42 -0
- package/dist/swirl-button-group.entry.d1365437.js +19 -0
- package/dist/swirl-button.entry.6693fe19.js +61 -0
- package/dist/swirl-card.entry.139358ac.js +43 -0
- package/dist/swirl-carousel-slide.entry.e5aa75c8.js +19 -0
- package/dist/swirl-carousel.entry.022eb63c.js +69 -0
- package/dist/swirl-checkbox.entry.ac8e5f0c.js +30 -0
- package/dist/swirl-chip.entry.58d154bc.js +41 -0
- package/dist/swirl-color-input.entry.03d4a7b0.js +269 -0
- package/dist/swirl-columns.entry.af9bb8c8.js +18 -0
- package/dist/swirl-components-react.js +310 -0
- package/dist/swirl-components-react.umd.cjs +383 -0
- package/dist/swirl-console-layout.entry.da154330.js +68 -0
- package/dist/swirl-date-input.entry.be6f26aa.js +80 -0
- package/dist/swirl-date-picker_2.entry.77533bb6.js +37 -0
- package/dist/swirl-description-list-item.entry.474237ca.js +23 -0
- package/dist/swirl-description-list.entry.87bfbd2c.js +15 -0
- package/dist/swirl-dialog.entry.3406a45d.js +44 -0
- package/dist/swirl-emoji-clap.entry.dc03619c.js +17 -0
- package/dist/swirl-emoji-happy.entry.4f231b56.js +17 -0
- package/dist/swirl-emoji-idea.entry.4ec13295.js +17 -0
- package/dist/swirl-emoji-love.entry.c391767e.js +17 -0
- package/dist/swirl-emoji-sad.entry.59771260.js +17 -0
- package/dist/swirl-emoji-thumbs-up.entry.92b3728b.js +17 -0
- package/dist/swirl-emoji.entry.dcfa7e9a.js +16 -0
- package/dist/swirl-file-uploader.entry.611709a7.js +31 -0
- package/dist/swirl-file-viewer_7.entry.4256e623.js +16427 -0
- package/dist/swirl-form-control.entry.a98574c9.js +86 -0
- package/dist/swirl-form-group.entry.c0c3fc26.js +17 -0
- package/dist/swirl-heading.entry.479591c1.js +26 -0
- package/dist/swirl-icon-add-photo.entry.b56fbf0a.js +17 -0
- package/dist/swirl-icon-add-reaction.entry.bb763e26.js +17 -0
- package/dist/swirl-icon-add_6.entry.e88710ef.js +72 -0
- package/dist/swirl-icon-admin-panel-settings.entry.38529404.js +17 -0
- package/dist/swirl-icon-ai.entry.3947d9fd.js +17 -0
- package/dist/swirl-icon-apps.entry.43da29af.js +17 -0
- package/dist/swirl-icon-arrow-back_3.entry.0ec779cb.js +39 -0
- package/dist/swirl-icon-arrow-downward_2.entry.5db48d10.js +28 -0
- package/dist/swirl-icon-arrow-left_4.entry.a745156f.js +52 -0
- package/dist/swirl-icon-arrow-right-small.entry.f71957dd.js +17 -0
- package/dist/swirl-icon-attachment.entry.7ce2a377.js +17 -0
- package/dist/swirl-icon-bar-chart.entry.b6732a1c.js +17 -0
- package/dist/swirl-icon-block.entry.58cf215a.js +17 -0
- package/dist/swirl-icon-bookmark.entry.54da117b.js +17 -0
- package/dist/swirl-icon-cancel_4.entry.e736ca50.js +50 -0
- package/dist/swirl-icon-chat-bubble.entry.11e43296.js +17 -0
- package/dist/swirl-icon-chats-filled.entry.4ab449f2.js +17 -0
- package/dist/swirl-icon-chats-outlined.entry.a566fe1f.js +17 -0
- package/dist/swirl-icon-check-circle_2.entry.0916adac.js +28 -0
- package/dist/swirl-icon-check-small_3.entry.b0b595f2.js +72 -0
- package/dist/swirl-icon-check-strong.entry.fc27f45d.js +17 -0
- package/dist/swirl-icon-check.entry.1b4002c9.js +17 -0
- package/dist/swirl-icon-chevron-left.entry.1fc94453.js +17 -0
- package/dist/swirl-icon-chevron-right.entry.24f12c52.js +17 -0
- package/dist/swirl-icon-close-small.entry.c1b29419.js +17 -0
- package/dist/swirl-icon-close.entry.75c72236.js +17 -0
- package/dist/swirl-icon-cloud-upload.entry.ab76558e.js +17 -0
- package/dist/swirl-icon-column.entry.d03b751b.js +17 -0
- package/dist/swirl-icon-comment.entry.32016143.js +17 -0
- package/dist/swirl-icon-copy.entry.f61fee12.js +17 -0
- package/dist/swirl-icon-date-range.entry.361b08f0.js +17 -0
- package/dist/swirl-icon-delete.entry.30c5c1ee.js +17 -0
- package/dist/swirl-icon-description.entry.6abae0e8.js +17 -0
- package/dist/swirl-icon-discover.entry.ba59a44e.js +17 -0
- package/dist/swirl-icon-double-arrow-left.entry.a5fa2721.js +17 -0
- package/dist/swirl-icon-double-arrow-right.entry.c88ba872.js +17 -0
- package/dist/swirl-icon-download.entry.42721c06.js +17 -0
- package/dist/swirl-icon-edit.entry.27e2a29a.js +17 -0
- package/dist/swirl-icon-emoji-mood.entry.de2168fe.js +17 -0
- package/dist/swirl-icon-emoji-satisfied.entry.32e0db6e.js +17 -0
- package/dist/swirl-icon-error_3.entry.23cd435a.js +56 -0
- package/dist/swirl-icon-expand-more.entry.b3b48b42.js +17 -0
- package/dist/swirl-icon-filter.entry.03d15319.js +17 -0
- package/dist/swirl-icon-folder.entry.c6401970.js +17 -0
- package/dist/swirl-icon-format-h-one.entry.8cadd550.js +17 -0
- package/dist/swirl-icon-gif.entry.d7d560b9.js +17 -0
- package/dist/swirl-icon-group-add.entry.42f3927e.js +17 -0
- package/dist/swirl-icon-group-assign.entry.cdfc2a9a.js +17 -0
- package/dist/swirl-icon-groups-custom.entry.94cd54d4.js +17 -0
- package/dist/swirl-icon-groups-filled.entry.d2b299a0.js +17 -0
- package/dist/swirl-icon-groups-outlined.entry.68110f5f.js +17 -0
- package/dist/swirl-icon-groups.entry.7b52773f.js +17 -0
- package/dist/swirl-icon-help.entry.d117d224.js +17 -0
- package/dist/swirl-icon-highlight.entry.45458438.js +17 -0
- package/dist/swirl-icon-home.entry.ffea2643.js +17 -0
- package/dist/swirl-icon-image.entry.ebb22d57.js +17 -0
- package/dist/swirl-icon-improve-text.entry.87a5e492.js +17 -0
- package/dist/swirl-icon-info.entry.52c62ada.js +17 -0
- package/dist/swirl-icon-insert-below.entry.de696181.js +17 -0
- package/dist/swirl-icon-insert-on-top.entry.0cf765d3.js +17 -0
- package/dist/swirl-icon-inventory.entry.e7195625.js +17 -0
- package/dist/swirl-icon-like.entry.2e14ba9b.js +17 -0
- package/dist/swirl-icon-link.entry.bb5085a2.js +17 -0
- package/dist/swirl-icon-lock-person.entry.b8433731.js +17 -0
- package/dist/swirl-icon-lock.entry.d7281a35.js +17 -0
- package/dist/swirl-icon-logout.entry.a69beb85.js +17 -0
- package/dist/swirl-icon-long-text.entry.086fe906.js +17 -0
- package/dist/swirl-icon-mail.entry.90a3ccc4.js +17 -0
- package/dist/swirl-icon-manage-accounts.entry.dee2113c.js +17 -0
- package/dist/swirl-icon-mark-chat-read.entry.9498efd3.js +17 -0
- package/dist/swirl-icon-mark-chat-unread.entry.4f09c26a.js +17 -0
- package/dist/swirl-icon-mention.entry.a9f67c22.js +17 -0
- package/dist/swirl-icon-menu-filled.entry.e59223c8.js +17 -0
- package/dist/swirl-icon-menu-outlined.entry.de79a0b2.js +17 -0
- package/dist/swirl-icon-menu.entry.fc7bf22d.js +17 -0
- package/dist/swirl-icon-message.entry.b820c5a1.js +17 -0
- package/dist/swirl-icon-mic.entry.5822c59c.js +17 -0
- package/dist/swirl-icon-more-horizontal.entry.7d3a8710.js +17 -0
- package/dist/swirl-icon-news-filled.entry.4a5bf3ab.js +17 -0
- package/dist/swirl-icon-news-outlined.entry.7ac5345b.js +17 -0
- package/dist/swirl-icon-notifications-active.entry.c5e7bf02.js +17 -0
- package/dist/swirl-icon-notifications-off.entry.39f48267.js +17 -0
- package/dist/swirl-icon-notifications.entry.d1db0a12.js +17 -0
- package/dist/swirl-icon-open-in-full.entry.88f52ffe.js +17 -0
- package/dist/swirl-icon-open-in-new.entry.3c1c0e70.js +17 -0
- package/dist/swirl-icon-pause-circle.entry.cd2e5f9e.js +17 -0
- package/dist/swirl-icon-pause.entry.687dd24e.js +17 -0
- package/dist/swirl-icon-people-alt.entry.b76529d4.js +17 -0
- package/dist/swirl-icon-person-off.entry.2775268a.js +17 -0
- package/dist/swirl-icon-person.entry.57275ca5.js +17 -0
- package/dist/swirl-icon-phone.entry.c5f47f81.js +17 -0
- package/dist/swirl-icon-play-arrow.entry.26280a6b.js +17 -0
- package/dist/swirl-icon-poll.entry.24788fe9.js +17 -0
- package/dist/swirl-icon-print.entry.cf8aa941.js +17 -0
- package/dist/swirl-icon-recieved.entry.16fc1aa0.js +17 -0
- package/dist/swirl-icon-reply.entry.09bffb40.js +17 -0
- package/dist/swirl-icon-report.entry.803f0403.js +17 -0
- package/dist/swirl-icon-roadmap.entry.3ffab30d.js +17 -0
- package/dist/swirl-icon-search-strong.entry.5d2b23cb.js +17 -0
- package/dist/swirl-icon-search.entry.d68b61f9.js +17 -0
- package/dist/swirl-icon-secure.entry.8d4d2b9c.js +17 -0
- package/dist/swirl-icon-send.entry.2b82872e.js +17 -0
- package/dist/swirl-icon-settings.entry.1e929864.js +17 -0
- package/dist/swirl-icon-short-text.entry.73801734.js +17 -0
- package/dist/swirl-icon-simplify.entry.413061f3.js +17 -0
- package/dist/swirl-icon-spellcheck.entry.a946c908.js +17 -0
- package/dist/swirl-icon-stop.entry.0c8b21b3.js +17 -0
- package/dist/swirl-icon-sync.entry.6f002cab.js +17 -0
- package/dist/swirl-icon-tasks-filled.entry.905208ce.js +17 -0
- package/dist/swirl-icon-tasks-outlined.entry.69893e5a.js +17 -0
- package/dist/swirl-icon-time-filled.entry.5118c56c.js +17 -0
- package/dist/swirl-icon-time-outlined.entry.2289a356.js +17 -0
- package/dist/swirl-icon-translate.entry.bdba5fac.js +17 -0
- package/dist/swirl-icon-tree-structure.entry.43cd78ef.js +17 -0
- package/dist/swirl-icon-undo.entry.d7e7ea40.js +17 -0
- package/dist/swirl-icon-unlock-person.entry.245d9be9.js +17 -0
- package/dist/swirl-icon-user-add.entry.0054b073.js +17 -0
- package/dist/swirl-icon-user-assign.entry.d4e5543f.js +17 -0
- package/dist/swirl-icon-video-camera.entry.797b8e28.js +17 -0
- package/dist/swirl-icon-video-library.entry.4d2f0731.js +17 -0
- package/dist/swirl-icon-voice.entry.ce8471dd.js +17 -0
- package/dist/swirl-icon.entry.176c73f4.js +16 -0
- package/dist/swirl-image-grid-item.entry.1c92d9a1.js +19 -0
- package/dist/swirl-image-grid.entry.f759570d.js +25 -0
- package/dist/swirl-inline-notification.entry.2160dcb6.js +17 -0
- package/dist/swirl-inline-status.entry.5397827b.js +36 -0
- package/dist/swirl-lightbox.entry.1258a9dc.js +131 -0
- package/dist/swirl-link.entry.562be9b0.js +17 -0
- package/dist/swirl-list.entry.3533e6c1.js +18 -0
- package/dist/swirl-menu-item.entry.c987b0f9.js +76 -0
- package/dist/swirl-menu.entry.bb36d68d.js +166 -0
- package/dist/swirl-modal.entry.8545ad1c.js +118 -0
- package/dist/swirl-option-list-section.entry.c3ade3d4.js +15 -0
- package/dist/swirl-option-list_2.entry.bd00e9dc.js +210 -0
- package/dist/swirl-pagination.entry.471f5873.js +38 -0
- package/dist/swirl-pdf-reader.entry.dbd37982.js +98 -0
- package/dist/swirl-popover_2.entry.e45966ae.js +177 -0
- package/dist/swirl-progress-indicator.entry.244caaf6.js +17 -0
- package/dist/swirl-radio-group.entry.0ae54e53.js +35 -0
- package/dist/swirl-radio.entry.cdfac28b.js +29 -0
- package/dist/swirl-resource-list-file-item.entry.4c50dd4a.js +35 -0
- package/dist/swirl-search.entry.002c73f2.js +50 -0
- package/dist/swirl-select.entry.6467db20.js +79 -0
- package/dist/swirl-shell-layout.entry.62ba60c3.js +85 -0
- package/dist/swirl-shell-navigation-item.entry.91b49950.js +136 -0
- package/dist/swirl-skeleton-box.entry.5c0428ca.js +31 -0
- package/dist/swirl-skeleton-text.entry.924203e6.js +38 -0
- package/dist/swirl-stack.entry.bef2eb97.js +17 -0
- package/dist/swirl-status-indicator.entry.5fe381d5.js +17 -0
- package/dist/swirl-switch.entry.57a8e80c.js +55 -0
- package/dist/swirl-symbol-account-circle.entry.33ff8e3a.js +17 -0
- package/dist/swirl-symbol-alternate-email.entry.7da7c845.js +17 -0
- package/dist/swirl-symbol-android.entry.bf4bbe6b.js +17 -0
- package/dist/swirl-symbol-announcement.entry.8993582b.js +17 -0
- package/dist/swirl-symbol-backup.entry.8d96216d.js +17 -0
- package/dist/swirl-symbol-beach-access.entry.56b385aa.js +17 -0
- package/dist/swirl-symbol-bookmark.entry.538be734.js +17 -0
- package/dist/swirl-symbol-cloud.entry.a2e031c5.js +17 -0
- package/dist/swirl-symbol-coronavirus.entry.7b565347.js +17 -0
- package/dist/swirl-symbol-desktop-windows.entry.3b148f81.js +17 -0
- package/dist/swirl-symbol-directions-car-filled.entry.317ab14a.js +17 -0
- package/dist/swirl-symbol-edit-calendar.entry.d2a64bb9.js +17 -0
- package/dist/swirl-symbol-email.entry.9cfaa4d2.js +17 -0
- package/dist/swirl-symbol-emoji-food-beverage.entry.3f9c9e01.js +17 -0
- package/dist/swirl-symbol-event-menu.entry.54a2bf4e.js +17 -0
- package/dist/swirl-symbol-facebook.entry.4553184a.js +17 -0
- package/dist/swirl-symbol-favorite.entry.2c9c7a78.js +17 -0
- package/dist/swirl-symbol-fitness-center.entry.26364c64.js +17 -0
- package/dist/swirl-symbol-flag.entry.95bff9f4.js +17 -0
- package/dist/swirl-symbol-folder.entry.87817dd9.js +17 -0
- package/dist/swirl-symbol-globe.entry.dacfeb5a.js +17 -0
- package/dist/swirl-symbol-groups.entry.399985e4.js +17 -0
- package/dist/swirl-symbol-help.entry.d884a11e.js +17 -0
- package/dist/swirl-symbol-image.entry.a6e56ccf.js +17 -0
- package/dist/swirl-symbol-info-menu.entry.f809ed59.js +17 -0
- package/dist/swirl-symbol-instagram.entry.1512e9b3.js +17 -0
- package/dist/swirl-symbol-ios.entry.56949a46.js +17 -0
- package/dist/swirl-symbol-language.entry.b47fb5c1.js +17 -0
- package/dist/swirl-symbol-leaderboard.entry.2f74c121.js +17 -0
- package/dist/swirl-symbol-lightbulb.entry.3bb1d749.js +17 -0
- package/dist/swirl-symbol-linkedin.entry.ae55477b.js +17 -0
- package/dist/swirl-symbol-location-on.entry.ed4ba5c5.js +17 -0
- package/dist/swirl-symbol-loyalty.entry.74ef2180.js +17 -0
- package/dist/swirl-symbol-maps-home-work.entry.93df095c.js +17 -0
- package/dist/swirl-symbol-notifications.entry.d4dc1955.js +17 -0
- package/dist/swirl-symbol-open-in-new.entry.288d063a.js +17 -0
- package/dist/swirl-symbol-pedal-bike.entry.91c0a151.js +17 -0
- package/dist/swirl-symbol-pinterest.entry.6b83e6df.js +17 -0
- package/dist/swirl-symbol-policy.entry.b54305f1.js +17 -0
- package/dist/swirl-symbol-push-pin.entry.51183455.js +17 -0
- package/dist/swirl-symbol-redeem.entry.4e4e4309.js +17 -0
- package/dist/swirl-symbol-report-problem.entry.99c33202.js +17 -0
- package/dist/swirl-symbol-restaurant.entry.082d53e9.js +17 -0
- package/dist/swirl-symbol-roadmap.entry.3704828e.js +17 -0
- package/dist/swirl-symbol-room.entry.c1818bfb.js +17 -0
- package/dist/swirl-symbol-savings.entry.e881d2ac.js +17 -0
- package/dist/swirl-symbol-settings-voice.entry.47c52d64.js +17 -0
- package/dist/swirl-symbol-shopping-cart.entry.352b3b43.js +17 -0
- package/dist/swirl-symbol-smartphone.entry.9adf156e.js +17 -0
- package/dist/swirl-symbol-star.entry.bc31986d.js +17 -0
- package/dist/swirl-symbol-supervisor-account.entry.822989a8.js +17 -0
- package/dist/swirl-symbol-thumbs-up-down.entry.991030ac.js +17 -0
- package/dist/swirl-symbol-twitter.entry.cc122704.js +17 -0
- package/dist/swirl-symbol-wb-sunny.entry.85d7ceb7.js +17 -0
- package/dist/swirl-symbol-wechat.entry.d36b55ff.js +17 -0
- package/dist/swirl-symbol-weibo.entry.5e44d3d2.js +17 -0
- package/dist/swirl-symbol-work.entry.ceb7e06f.js +17 -0
- package/dist/swirl-symbol-xing.entry.c525dbdd.js +17 -0
- package/dist/swirl-symbol-youtube.entry.8e29b40e.js +17 -0
- package/dist/swirl-symbol.entry.d2bb6d18.js +16 -0
- package/dist/swirl-tab-bar.entry.5b121baa.js +33 -0
- package/dist/swirl-tab.entry.ce9ecb2f.js +17 -0
- package/dist/swirl-table-cell.entry.0786f246.js +15 -0
- package/dist/swirl-table-column.entry.d1695dea.js +28 -0
- package/dist/swirl-table-row-group.entry.847b500b.js +19 -0
- package/dist/swirl-table-row.entry.7e3632b7.js +27 -0
- package/dist/swirl-table.entry.45de7a03.js +133 -0
- package/dist/swirl-tabs.entry.fddd66a4.js +62 -0
- package/dist/swirl-text-input.entry.f491a11d.js +85 -0
- package/dist/swirl-text.entry.5dafa051.js +292 -0
- package/dist/swirl-theme-provider.entry.9e7b2687.js +89 -0
- package/dist/swirl-time-input.entry.f73e1530.js +77 -0
- package/dist/swirl-toast-provider.entry.bdedbabb.js +38 -0
- package/dist/swirl-toast.entry.da5981d7.js +50 -0
- package/dist/swirl-toolbar.entry.d3b712e4.js +56 -0
- package/dist/swirl-tooltip.entry.302000cf.js +95 -0
- package/dist/swirl-tree-navigation-item.entry.ed1a5937.js +25 -0
- package/dist/swirl-video-thumbnail.entry.370b16e1.js +88 -0
- package/dist/swirl-visually-hidden.entry.d86c6ecd.js +15 -0
- package/dist/utils-9f141e25.a4ae3adc.js +61 -0
- package/dist/v4-fa4bb814.196482d9.js +33 -0
- package/dist/vite-env.d.ts +1 -0
- package/dist/wc-datepicker.entry.0537b021.js +274 -0
- package/package.json +33 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { r as a, h as i, H as l, g as u } from "./index.e5965a8a.js";
|
|
2
|
+
import { c as d, p as h } from "./utils-9f141e25.a4ae3adc.js";
|
|
3
|
+
import { c } from "./index-d280dafb.186cdb0e.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
const p = ":host{display:block}:host *{box-sizing:border-box}.menu-item--expanded ::part(action-list-item){background-color:var(--s-surface-overlay-hovered)}", m = class {
|
|
7
|
+
constructor(e) {
|
|
8
|
+
a(this, e), this.onSlotChange = () => {
|
|
9
|
+
this.subMenu = this.el.querySelector("swirl-menu"), this.updateActionListItemProps();
|
|
10
|
+
}, this.onActionListItemClick = () => {
|
|
11
|
+
this.actionListItem.disabled || this.rootMenu.activateMenuItem(this.el);
|
|
12
|
+
}, this.onOptionListItemClick = () => {
|
|
13
|
+
this.optionListItem.disabled || this.parentMenu.updateSelection(this.optionListItem);
|
|
14
|
+
}, this.onOptionListItemKeyDown = (t) => {
|
|
15
|
+
if (t.code === "Space")
|
|
16
|
+
t.preventDefault();
|
|
17
|
+
else if (t.code === "Enter") {
|
|
18
|
+
if (this.optionListItem.disabled)
|
|
19
|
+
return;
|
|
20
|
+
t.preventDefault(), this.parentMenu.updateSelection(this.optionListItem);
|
|
21
|
+
}
|
|
22
|
+
}, this.onOptionListItemKeyUp = (t) => {
|
|
23
|
+
if (t.code === "Space") {
|
|
24
|
+
if (this.optionListItem.disabled)
|
|
25
|
+
return;
|
|
26
|
+
t.preventDefault(), this.parentMenu.updateSelection(this.optionListItem);
|
|
27
|
+
}
|
|
28
|
+
}, this.description = void 0, this.disabled = void 0, this.expanded = void 0, this.icon = void 0, this.intent = "default", this.label = void 0, this.value = void 0, this.parentMenu = void 0, this.subMenu = void 0;
|
|
29
|
+
}
|
|
30
|
+
componentWillLoad() {
|
|
31
|
+
this.parentMenu = d(this.el, "swirl-menu"), this.rootMenu = h(this.el, "swirl-menu").pop(), this.subMenu = this.el.querySelector("swirl-menu");
|
|
32
|
+
}
|
|
33
|
+
watchExpanded() {
|
|
34
|
+
this.updateActionListItemProps();
|
|
35
|
+
}
|
|
36
|
+
async getSubMenu() {
|
|
37
|
+
return this.subMenu;
|
|
38
|
+
}
|
|
39
|
+
async getParentMenu() {
|
|
40
|
+
return this.parentMenu;
|
|
41
|
+
}
|
|
42
|
+
updateActionListItemProps() {
|
|
43
|
+
!Boolean(this.actionListItem) || (this.actionListItem.swirlAriaExpanded = this.expanded ? "true" : void 0, this.actionListItem.swirlAriaHaspopup = Boolean(this.subMenu) ? "true" : void 0, this.actionListItem.suffix = Boolean(this.subMenu) ? '<swirl-icon-chevron-right size="16"></swirl-icon-chevron-right>' : void 0);
|
|
44
|
+
}
|
|
45
|
+
renderActionListItem() {
|
|
46
|
+
var t, n, o;
|
|
47
|
+
const e = Boolean((t = this.subMenu) == null ? void 0 : t.value) ? (o = Array.from(((n = this.subMenu) == null ? void 0 : n.querySelectorAll("swirl-menu-item")) || []).find((s) => {
|
|
48
|
+
var r;
|
|
49
|
+
return s.value === ((r = this.subMenu) == null ? void 0 : r.value);
|
|
50
|
+
})) == null ? void 0 : o.label : void 0;
|
|
51
|
+
return i("swirl-action-list-item", { badge: e, description: this.description, disabled: this.disabled, icon: this.icon, intent: this.intent, label: this.label, onClick: this.onActionListItemClick, ref: (s) => this.actionListItem = s });
|
|
52
|
+
}
|
|
53
|
+
renderOptionListItem() {
|
|
54
|
+
var e;
|
|
55
|
+
return i("swirl-option-list-item", { disabled: this.disabled, icon: this.icon, label: this.label, onClick: this.onOptionListItemClick, onKeyDown: this.onOptionListItemKeyDown, onKeyUp: this.onOptionListItemKeyUp, ref: (t) => this.optionListItem = t, selected: ((e = this.parentMenu) == null ? void 0 : e.value) === this.value, swirlAriaRole: "menuitemradio", value: this.value });
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
var t;
|
|
59
|
+
const e = c("menu-item", {
|
|
60
|
+
"menu-item--expanded": this.expanded
|
|
61
|
+
});
|
|
62
|
+
return i(l, null, i("div", { class: e }, ((t = this.parentMenu) == null ? void 0 : t.variant) === "selection" ? this.renderOptionListItem() : this.renderActionListItem(), i("slot", { onSlotchange: this.onSlotChange })));
|
|
63
|
+
}
|
|
64
|
+
get el() {
|
|
65
|
+
return u(this);
|
|
66
|
+
}
|
|
67
|
+
static get watchers() {
|
|
68
|
+
return {
|
|
69
|
+
expanded: ["watchExpanded"]
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
m.style = p;
|
|
74
|
+
export {
|
|
75
|
+
m as swirl_menu_item
|
|
76
|
+
};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { r as d, c as h, h as o, H as p, g as v } from "./index.e5965a8a.js";
|
|
2
|
+
import { c as b, a as f, o as w, f as g } from "./floating-ui.dom.esm-ac7cc24e.79b318e4.js";
|
|
3
|
+
import { c as M } from "./index-d280dafb.186cdb0e.js";
|
|
4
|
+
import { q as n, c as l, p as m, i as x, a as y } from "./utils-9f141e25.a4ae3adc.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "react-dom";
|
|
7
|
+
const I = ":host{display:block}:host *{box-sizing:border-box}.menu{width:100%;--swirl-ghost-button-background-default:var(--s-surface-overlay-default);--swirl-ghost-button-background-hovered:var(--s-surface-overlay-hovered);--swirl-ghost-button-background-pressed:var(--s-surface-overlay-pressed)}.menu--mobile.menu--root{position:relative}.menu--mobile.menu--root .menu__menu{top:3.5rem;transition:left 0.2s}.menu--mobile.menu--active .menu__menu{display:block}.menu--mobile .menu__menu{position:absolute;top:0;left:0;display:none;width:100%}:not(.menu--mobile).menu--root{position:relative}:not(.menu--mobile).menu--root .menu__menu{position:relative;padding-top:0;padding-bottom:0}:not(.menu--mobile):not(.menu--root) .menu__menu{z-index:1;max-width:22.5rem;border-radius:var(--s-border-radius-sm);box-shadow:var(--s-shadow-level-1)}:not(.menu--mobile).menu--active .menu__menu{display:block}:not(.menu--mobile) .menu__menu{position:fixed;display:none}.menu__mobile-header{display:flex;height:3.5rem;padding-right:var(--s-space-16);padding-left:var(--s-space-16);justify-content:space-between;align-items:center;border-bottom:var(--s-border-width-default) solid var(--s-border-default);gap:var(--s-space-8)}.menu__mobile-header>*{display:inline-flex;flex-shrink:0}.menu__title{min-width:0;flex-grow:1;flex-shrink:1}.menu__title swirl-heading{min-width:0}.menu__done-button{margin-right:calc(-1 * var(--s-space-8))}.menu__menu{padding-top:var(--s-space-8);padding-bottom:var(--s-space-8);background-color:var(--s-surface-overlay-default)}", _ = class {
|
|
8
|
+
constructor(e) {
|
|
9
|
+
d(this, e), this.done = h(this, "done", 7), this.valueChange = h(this, "valueChange", 7), this.mobileMediaQuery = window.matchMedia("(min-width: 768px)"), this.mediaQueryHandler = () => {
|
|
10
|
+
this.updateMobileState();
|
|
11
|
+
}, this.resetMenu = () => {
|
|
12
|
+
this.items.forEach((t) => {
|
|
13
|
+
t.tabIndex = -1;
|
|
14
|
+
}), !(this.level > 0) && setTimeout(() => {
|
|
15
|
+
this.activeLevel = 0, n(this.el, "swirl-menu").forEach((i) => {
|
|
16
|
+
i.active = !1, i.parentElement.expanded = !1;
|
|
17
|
+
});
|
|
18
|
+
}, this.mobile ? 200 : 60);
|
|
19
|
+
}, this.closeMenu = () => {
|
|
20
|
+
this.disableAutoUpdate && this.disableAutoUpdate(), this.popover.close(), this.resetMenu();
|
|
21
|
+
}, this.reposition = async () => {
|
|
22
|
+
if (this.mobile || this.level === 0) {
|
|
23
|
+
this.position = void 0;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const t = this.el.parentElement;
|
|
27
|
+
!Boolean(t) || !Boolean(this.menuContainer) || (this.position = await b(t, this.menuContainer, {
|
|
28
|
+
placement: "right-start",
|
|
29
|
+
strategy: "fixed",
|
|
30
|
+
middleware: [w({ mainAxis: -10, crossAxis: 0 }), g()]
|
|
31
|
+
}));
|
|
32
|
+
}, this.onKeyDown = (t) => {
|
|
33
|
+
if (t.code === "ArrowDown")
|
|
34
|
+
t.preventDefault(), t.stopPropagation(), this.focusNextItem();
|
|
35
|
+
else if (t.code === "ArrowUp")
|
|
36
|
+
t.preventDefault(), t.stopPropagation(), this.focusPreviousItem();
|
|
37
|
+
else if (t.code === "ArrowLeft")
|
|
38
|
+
t.preventDefault(), t.stopPropagation(), this.rootMenu.goBack();
|
|
39
|
+
else if (t.code === "ArrowRight") {
|
|
40
|
+
t.preventDefault();
|
|
41
|
+
const i = l(this.items[this.getActiveItemIndex()], "swirl-menu-item");
|
|
42
|
+
if (!Boolean(i))
|
|
43
|
+
return;
|
|
44
|
+
this.rootMenu.activateMenuItem(i);
|
|
45
|
+
}
|
|
46
|
+
}, this.onClose = () => {
|
|
47
|
+
this.closeMenu();
|
|
48
|
+
}, this.onDone = () => {
|
|
49
|
+
this.closeMenu(), this.done.emit();
|
|
50
|
+
}, this.onGoBack = () => {
|
|
51
|
+
this.rootMenu.goBack();
|
|
52
|
+
}, this.active = !0, this.label = void 0, this.level = 0, this.mobileBackButtonLabel = "Back", this.mobileCloseMenuButtonLabel = "Close menu", this.mobileDoneButtonLabel = "Done", this.value = void 0, this.variant = "action", this.activeLevel = 0, this.mobile = void 0, this.position = void 0;
|
|
53
|
+
}
|
|
54
|
+
componentWillLoad() {
|
|
55
|
+
this.updateMobileState(), this.updateLevel(), this.observeSlotChanges();
|
|
56
|
+
}
|
|
57
|
+
componentDidLoad() {
|
|
58
|
+
this.mobileMediaQuery.onchange = this.mediaQueryHandler, this.parentMenu = l(this.el.parentElement, "swirl-menu"), this.popover = l(this.el, "swirl-popover"), this.rootMenu = m(this.el, "swirl-menu").pop(), Boolean(this.parentMenu) && queueMicrotask(() => {
|
|
59
|
+
this.active = !1;
|
|
60
|
+
}), this.popover.addEventListener("popoverClose", this.resetMenu), this.updateItems();
|
|
61
|
+
}
|
|
62
|
+
disconnectedCallback() {
|
|
63
|
+
var e, t, i;
|
|
64
|
+
this.popover.removeEventListener("popoverClose", this.resetMenu), (t = (e = this.mobileMediaQuery).removeEventListener) == null || t.call(e, "change", this.mediaQueryHandler), (i = this.observer) == null || i.disconnect();
|
|
65
|
+
}
|
|
66
|
+
watchActive() {
|
|
67
|
+
this.reposition(), this.disableAutoUpdate && this.disableAutoUpdate(), this.disableAutoUpdate = f(this.el.parentElement, this.menuContainer, this.reposition);
|
|
68
|
+
}
|
|
69
|
+
async activateMenuItem(e) {
|
|
70
|
+
if (Boolean(this.parentMenu))
|
|
71
|
+
return;
|
|
72
|
+
const t = await e.getParentMenu();
|
|
73
|
+
n(this.el, "swirl-menu").filter((s) => s.level >= t.level && s !== t).forEach((s) => {
|
|
74
|
+
s.active = !1, s.parentElement.expanded = !1;
|
|
75
|
+
});
|
|
76
|
+
const a = await e.getSubMenu();
|
|
77
|
+
!Boolean(a) || (e.expanded = !0, a.active = !0, this.activeLevel = a.level, setTimeout(() => {
|
|
78
|
+
a.focusFirstItem();
|
|
79
|
+
}, this.mobile ? 200 : 60));
|
|
80
|
+
}
|
|
81
|
+
async close() {
|
|
82
|
+
this.closeMenu();
|
|
83
|
+
}
|
|
84
|
+
async goBack() {
|
|
85
|
+
if (Boolean(this.parentMenu) || this.activeLevel === 0)
|
|
86
|
+
return;
|
|
87
|
+
const t = (n(this.el, "swirl-menu").find((s) => s.level === this.activeLevel && s.active) || this.rootMenu).parentElement;
|
|
88
|
+
t.expanded = !1, this.activeLevel = Math.max(this.activeLevel - 1, 0), n(this.el, "swirl-menu").filter((s) => s.level > this.activeLevel).forEach((s) => {
|
|
89
|
+
s.active = !1;
|
|
90
|
+
}), (n(this.el, "swirl-menu").find((s) => s.level === this.activeLevel && s.active) || this.rootMenu).focusItemAtIndex(Array.from(t.parentElement.children).indexOf(t));
|
|
91
|
+
}
|
|
92
|
+
async focusFirstItem() {
|
|
93
|
+
this.focusItem(this.items[0]);
|
|
94
|
+
}
|
|
95
|
+
async focusItemAtIndex(e) {
|
|
96
|
+
this.focusItem(this.items[e]);
|
|
97
|
+
}
|
|
98
|
+
async updateSelection(e) {
|
|
99
|
+
this.valueChange.emit(e.value);
|
|
100
|
+
}
|
|
101
|
+
observeSlotChanges() {
|
|
102
|
+
this.observer = new MutationObserver(() => {
|
|
103
|
+
this.updateItems();
|
|
104
|
+
}), this.observer.observe(this.el, { childList: !0 });
|
|
105
|
+
}
|
|
106
|
+
updateMobileState() {
|
|
107
|
+
const e = x();
|
|
108
|
+
e !== this.mobile && (this.mobile = e);
|
|
109
|
+
}
|
|
110
|
+
updateItems() {
|
|
111
|
+
this.items = [
|
|
112
|
+
...n(this.el, '[role="menuitem"]'),
|
|
113
|
+
...n(this.el, '[role="menuitemradio"]')
|
|
114
|
+
].filter((e) => l(e, "swirl-menu") === this.el);
|
|
115
|
+
}
|
|
116
|
+
updateLevel() {
|
|
117
|
+
const e = m(this.el.parentNode, "swirl-menu");
|
|
118
|
+
this.level = e.length;
|
|
119
|
+
}
|
|
120
|
+
focusItem(e) {
|
|
121
|
+
[
|
|
122
|
+
...n(this.rootMenu, '[role="menuitem"]'),
|
|
123
|
+
...n(this.rootMenu, '[role="menuitemradio"]')
|
|
124
|
+
].forEach((i) => {
|
|
125
|
+
i.tabIndex = -1;
|
|
126
|
+
}), Boolean(e) && (e.tabIndex = 0, e.focus());
|
|
127
|
+
}
|
|
128
|
+
focusNextItem() {
|
|
129
|
+
const t = (this.getActiveItemIndex() + 1) % this.items.length, i = this.items[t];
|
|
130
|
+
this.focusItem(i);
|
|
131
|
+
}
|
|
132
|
+
focusPreviousItem() {
|
|
133
|
+
const e = this.getActiveItemIndex(), t = e === 0 ? this.items.length - 1 : e - 1, i = this.items[t];
|
|
134
|
+
this.focusItem(i);
|
|
135
|
+
}
|
|
136
|
+
getActiveItemIndex() {
|
|
137
|
+
const e = y();
|
|
138
|
+
return this.items.findIndex((t) => t === e || t === (e == null ? void 0 : e.querySelector('[role="menuitem"]')) || t === (e == null ? void 0 : e.querySelector('[role="menuitemradio"]')));
|
|
139
|
+
}
|
|
140
|
+
render() {
|
|
141
|
+
var r, u;
|
|
142
|
+
const e = !Boolean(this.parentMenu), t = e && this.mobile ? void 0 : this.label, i = e && this.mobile ? "menu-title" : void 0, a = e ? "menubar" : "menu", s = M("menu", `menu--level-${this.level}`, {
|
|
143
|
+
"menu--active": this.active,
|
|
144
|
+
"menu--mobile": this.mobile,
|
|
145
|
+
"menu--root": e
|
|
146
|
+
});
|
|
147
|
+
return o(p, null, o("div", { class: s }, this.mobile && e && o("div", { class: "menu__mobile-header" }, this.activeLevel === 0 && o("swirl-button", { hideLabel: !0, icon: "<swirl-icon-close></swirl-icon-close>", label: this.mobileCloseMenuButtonLabel, onClick: this.onClose, variant: "plain" }), this.activeLevel > 0 && o("swirl-button", { hideLabel: !0, icon: "<swirl-icon-chevron-left></swirl-icon-chevron-left>", label: this.mobileBackButtonLabel, onClick: this.onGoBack, variant: "plain" }), o("span", { class: "menu__title", id: "menu-title" }, o("swirl-heading", { align: "center", as: "span", level: 4, text: this.label, truncate: !0 })), o("swirl-button", { class: "menu__done-button", intent: "primary", label: this.mobileDoneButtonLabel, onClick: this.onDone })), o("div", { "aria-label": t, "aria-labelledby": i, "aria-orientation": "vertical", class: "menu__menu", onKeyDown: this.onKeyDown, ref: (c) => this.menuContainer = c, role: a, style: !this.mobile && this.level > 0 ? {
|
|
148
|
+
top: Boolean(this.position) ? `${(r = this.position) == null ? void 0 : r.y}px` : "",
|
|
149
|
+
left: Boolean(this.position) ? `${(u = this.position) == null ? void 0 : u.x}px` : ""
|
|
150
|
+
} : this.mobile ? {
|
|
151
|
+
left: e ? `calc(-100% * ${this.activeLevel})` : "100%"
|
|
152
|
+
} : void 0 }, o("slot", null))));
|
|
153
|
+
}
|
|
154
|
+
get el() {
|
|
155
|
+
return v(this);
|
|
156
|
+
}
|
|
157
|
+
static get watchers() {
|
|
158
|
+
return {
|
|
159
|
+
active: ["watchActive"]
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
_.style = I;
|
|
164
|
+
export {
|
|
165
|
+
_ as swirl_menu
|
|
166
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { r as h, c as d, h as o, H as p, g as u } from "./index.e5965a8a.js";
|
|
2
|
+
import { d as f, e as v } from "./bodyScrollLock.esm-ce6356d8.2c600fb9.js";
|
|
3
|
+
import { c as b } from "./focus-trap.esm-37cd2d2b.724cca66.js";
|
|
4
|
+
import { c as _ } from "./index-d280dafb.186cdb0e.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "react-dom";
|
|
7
|
+
const g = `:host{display:block}:host *{box-sizing:border-box}.modal{--swirl-ghost-button-background-default:var(--s-surface-overlay-default);--swirl-ghost-button-background-hovered:var(--s-surface-overlay-hovered);--swirl-ghost-button-background-pressed:var(--s-surface-overlay-pressed);--swirl-resource-list-item-background-default:var(
|
|
8
|
+
--s-surface-overlay-default
|
|
9
|
+
);--swirl-resource-list-item-background-hovered:var(
|
|
10
|
+
--s-surface-overlay-hovered
|
|
11
|
+
);--swirl-resource-list-item-background-pressed:var(
|
|
12
|
+
--s-surface-overlay-pressed
|
|
13
|
+
);--swirl-modal-height:auto;--swirl-modal-max-height:90vh;position:fixed;z-index:var(--s-z-40);display:flex;justify-content:center;align-items:center;inset:0}.modal[aria-hidden="true"]{display:none}.modal--variant-default.modal--closing{animation:0.15s modal-fade-out;animation-fill-mode:forwards}@media (prefers-reduced-motion){.modal--variant-default.modal--closing{animation:none}}.modal--variant-default:not(.modal--closing) .modal__backdrop{animation:0.15s modal-backdrop-fade-in}@media (prefers-reduced-motion){.modal--variant-default:not(.modal--closing) .modal__backdrop{animation:none}}.modal--variant-default:not(.modal--closing) .modal__body{animation:0.15s modal-scale-in}@media (prefers-reduced-motion){.modal--variant-default:not(.modal--closing) .modal__body{animation:none}}.modal--variant-drawer{justify-content:end;align-items:stretch}.modal--variant-drawer.modal--closing{animation:0.15s modal-drawer-slide-out;animation-fill-mode:forwards}@media (prefers-reduced-motion){.modal--variant-drawer.modal--closing{animation:none}}@media (min-width: 768px){.modal--variant-drawer.modal--hide-label .modal__header-bar{height:auto;padding-top:var(--s-space-4);padding-bottom:var(--s-space-4)}}.modal--variant-drawer .modal__backdrop{background-color:transparent;animation:none}.modal--variant-drawer .modal__body{height:100%;max-height:none;border-radius:0;animation:0.15s modal-drawer-slide-in;box-shadow:var(--s-shadow-level-3)}@media (prefers-reduced-motion){.modal--variant-drawer .modal__body{animation:none}}.modal--variant-drawer .modal__header-bar{background-color:var(--s-surface-overlay-default)}.modal--variant-drawer .modal__header-bar .modal__close-button{margin-left:calc(-1 * var(--s-space-8))}@media (min-width: 768px){.modal--variant-drawer .modal__header-bar{flex-direction:row}}.modal--variant-drawer .modal__content{min-height:100%}@media (min-width: 768px){.modal--variant-drawer.modal--padded .modal__content{padding-top:var(--s-space-8)}}.modal--padded .modal__content{padding-top:var(--s-space-24);padding-right:var(--s-space-16);padding-bottom:var(--s-space-24);padding-left:var(--s-space-16)}@media (min-width: 768px){.modal--padded .modal__content{padding-top:0;padding-right:var(--s-space-24);padding-bottom:var(--s-space-16);padding-left:var(--s-space-24)}}@media (min-width: 768px){.modal--scrollable .modal__content{padding-bottom:0}}.modal--scrollable:not(.modal--scrolled-down).modal--has-custom-footer .modal__custom-footer{border-top:var(--s-border-width-default) solid var(--s-border-default)}.modal--scrollable:not(.modal--scrolled-down):not(.modal--has-custom-footer) .modal__controls{border-top:var(--s-border-width-default) solid var(--s-border-default)}.modal--has-custom-header .modal__custom-header{display:block}.modal--has-custom-header .modal__content{padding-top:var(--s-space-16)}.modal--has-custom-footer .modal__custom-footer{padding-top:var(--s-space-16);padding-right:var(--s-space-24);padding-bottom:var(--s-space-16);padding-left:var(--s-space-24)}.modal--has-header-tools .modal__header{border-bottom-color:transparent}.modal--has-header-tools .modal__header-tools{display:block}.modal--has-secondary-content .modal__body{max-width:64rem}.modal--has-secondary-content:not(.modal--has-header-tools) .modal__header{border-bottom-color:var(--s-border-default)}.modal--has-secondary-content.modal--has-header-tools .modal__header-tools{border-bottom-color:var(--s-border-default)}.modal--has-secondary-content.modal--has-custom-footer .modal__custom-footer{border-top:var(--s-border-width-default) solid var(--s-border-default)}.modal--has-secondary-content:not(.modal--has-custom-footer) .modal__controls{border-top:var(--s-border-width-default) solid var(--s-border-default)}@media (min-width: 992px){.modal--has-secondary-content .modal__header-tools,.modal--has-secondary-content .modal__content{padding-right:0}}.modal--has-secondary-content .modal__primary-content{overflow:visible;max-height:60%;flex-basis:auto}@media (min-width: 992px){.modal--has-secondary-content .modal__primary-content{max-width:calc(100% - 24rem);max-height:none;flex-basis:calc(100% - 24rem)}}.modal--has-secondary-content .modal__secondary-content{display:block}@media (min-width: 768px){.modal--scrolled:not(.modal--has-header-tools) .modal__header{border-bottom-color:var(--s-border-default)}.modal--scrolled.modal--has-header-tools .modal__header-tools{border-bottom-color:var(--s-border-default)}}.modal__backdrop{position:fixed;background-color:rgba(0, 0, 0, 0.2);inset:0}.modal__body{--swirl-card-background-default:var(--s-surface-overlay-default);--swirl-card-background-hovered:var(--s-surface-overlay-hovered);--swirl-card-background-pressed:var(--s-surface-overlay-pressed);--swirl-accordion-item-toggle-default:var(--s-surface-overlay-default);--swirl-accordion-item-toggle-hovered:var(--s-surface-overlay-hovered);--swirl-accordion-item-toggle-pressed:var(--s-surface-overlay-pressed);position:relative;z-index:var(--s-z-40);display:flex;overflow:hidden;width:100vw;max-width:40rem;height:100vh;background-color:var(--s-surface-overlay-default);flex-direction:column}@media (min-width: 768px){.modal__body{width:90vw;max-height:var(--swirl-modal-max-height);border-radius:var(--s-border-radius-base);box-shadow:var(--s-shadow-level-3)}}@media (min-width: 992px){.modal__body{height:var(--swirl-modal-height)}}.modal__header{border-bottom:var(--s-border-width-default) solid var(--s-border-default)}@media (min-width: 768px){.modal__header{border-bottom:var(--s-border-width-default) solid transparent}}.modal__header-bar{display:flex;height:3.5rem;padding-top:var(--s-space-8);padding-right:var(--s-space-16);padding-bottom:var(--s-space-8);padding-left:var(--s-space-16);flex-shrink:0;align-items:center;gap:var(--s-space-8)}@media (min-width: 768px){.modal__header-bar{height:3.75rem;padding-top:var(--s-space-12);padding-right:var(--s-space-24);padding-bottom:var(--s-space-12);padding-left:var(--s-space-24);flex-direction:row-reverse;gap:var(--s-space-16)}}.modal__header-tools{display:none;padding-right:var(--s-space-16);padding-left:var(--s-space-16);border-bottom:var(--s-border-width-default) solid var(--s-border-default)}@media (min-width: 768px){.modal__header-tools{padding-right:var(--s-space-24);padding-left:var(--s-space-24);border-bottom-color:transparent}}.modal__custom-header{display:none;flex-shrink:0;border-bottom:var(--s-border-width-default) solid var(--s-border-default)}.modal__heading{overflow:hidden}.modal__heading .heading{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.modal__content-container{display:flex;overflow:hidden;flex-grow:1;flex-direction:column;gap:var(--s-space-24)}@media (min-width: 992px){.modal__content-container{flex-direction:row}}.modal__primary-content{display:flex;overflow:hidden;flex-basis:100%;flex-direction:column}.modal__content{overflow-x:hidden;overflow-y:auto;min-height:100%}.modal__content ::slotted(*){margin:0}.modal__secondary-content{display:none;overflow:visible;overflow-x:hidden;overflow-y:auto;max-width:none;max-height:40%;padding-right:var(--s-space-16);padding-left:var(--s-space-16)}@media (min-width: 768px){.modal__secondary-content{padding-left:var(--s-space-24)}}@media (min-width: 992px){.modal__secondary-content{overflow-x:hidden;overflow-y:auto;max-width:24rem;max-height:none;padding-right:var(--s-space-24);padding-bottom:var(--s-space-16);padding-left:0;flex-basis:50%}}.modal__custom-footer{flex-shrink:0}.modal__controls{display:flex;padding-top:var(--s-space-16);padding-right:var(--s-space-24);padding-bottom:var(--s-space-16);padding-left:var(--s-space-24);flex-shrink:0;justify-content:flex-end}@keyframes modal-scale-in{from{transform:scale(0)}to{transform:scale(1)}}@keyframes modal-backdrop-fade-in{from{opacity:0}to{opacity:1}}@keyframes modal-fade-out{from{opacity:1}to{opacity:0}}@keyframes modal-drawer-slide-in{from{transform:translate3d(100%, 0, 0)}to{transform:translate3d(0, 0, 0)}}@keyframes modal-drawer-slide-out{from{transform:translate3d(0, 0, 0)}to{transform:translate3d(100%, 0, 0)}}`, w = class {
|
|
14
|
+
constructor(a) {
|
|
15
|
+
h(this, a), this.modalClose = d(this, "modalClose", 7), this.modalOpen = d(this, "modalOpen", 7), this.primaryAction = d(this, "primaryAction", 7), this.requestModalClose = d(this, "requestModalClose", 7), this.secondaryAction = d(this, "secondaryAction", 7), this.onKeyDown = (e) => {
|
|
16
|
+
e.code === "Escape" && this.close();
|
|
17
|
+
}, this.onBackdropClick = () => {
|
|
18
|
+
this.close();
|
|
19
|
+
}, this.onCloseButtonClick = () => {
|
|
20
|
+
this.close();
|
|
21
|
+
}, this.onPrimaryAction = (e) => {
|
|
22
|
+
this.primaryAction.emit(e);
|
|
23
|
+
}, this.onSecondaryAction = (e) => {
|
|
24
|
+
this.secondaryAction.emit(e);
|
|
25
|
+
}, this.determineScrollStatus = () => {
|
|
26
|
+
var r, l, i, n, c, m;
|
|
27
|
+
const e = ((r = this.scrollContainer) == null ? void 0 : r.scrollTop) > 0, t = Math.ceil(((l = this.scrollContainer) == null ? void 0 : l.scrollTop) + ((i = this.scrollContainer) == null ? void 0 : i.offsetHeight)) >= ((n = this.scrollContainer) == null ? void 0 : n.scrollHeight), s = ((c = this.scrollContainer) == null ? void 0 : c.scrollHeight) > ((m = this.scrollContainer) == null ? void 0 : m.offsetHeight);
|
|
28
|
+
e !== this.scrolled && (this.scrolled = e), t !== this.scrolledDown && (this.scrolledDown = t), s !== this.scrollable && (this.scrollable = s);
|
|
29
|
+
}, this.closable = !0, this.closeButtonLabel = "Close modal", this.height = void 0, this.hideCloseButton = void 0, this.hideLabel = void 0, this.label = void 0, this.maxHeight = void 0, this.maxWidth = void 0, this.padded = !0, this.primaryActionLabel = void 0, this.secondaryActionLabel = void 0, this.variant = "default", this.isOpen = !1, this.closing = !1, this.hasCustomHeader = void 0, this.hasCustomFooter = void 0, this.hasHeaderTools = void 0, this.hasSecondaryContent = void 0, this.scrollable = !1, this.scrolled = !1, this.scrolledDown = !1;
|
|
30
|
+
}
|
|
31
|
+
componentDidLoad() {
|
|
32
|
+
this.focusTrap = b(this.modalEl, {
|
|
33
|
+
allowOutsideClick: !0,
|
|
34
|
+
tabbableOptions: {
|
|
35
|
+
getShadowRoot: (a) => a.shadowRoot
|
|
36
|
+
}
|
|
37
|
+
}), this.determineScrollStatus(), queueMicrotask(() => {
|
|
38
|
+
this.updateCustomFooterStatus(), this.updateCustomHeaderStatus(), this.updateHeaderToolsStatus(), this.updateSecondaryContentStatus();
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
componentDidRender() {
|
|
42
|
+
var a;
|
|
43
|
+
(a = this.focusTrap) == null || a.updateContainerElements(this.modalEl);
|
|
44
|
+
}
|
|
45
|
+
disconnectedCallback() {
|
|
46
|
+
var a;
|
|
47
|
+
(a = this.focusTrap) == null || a.deactivate(), this.unlockBodyScroll();
|
|
48
|
+
}
|
|
49
|
+
onWindowResize() {
|
|
50
|
+
this.determineScrollStatus();
|
|
51
|
+
}
|
|
52
|
+
watchIsOpen() {
|
|
53
|
+
this.isOpen ? setTimeout(() => {
|
|
54
|
+
this.focusTrap.activate(), this.handleAutoFocus();
|
|
55
|
+
}, 200) : this.focusTrap.deactivate();
|
|
56
|
+
}
|
|
57
|
+
async open() {
|
|
58
|
+
this.isOpen = !0, this.modalOpen.emit(), this.lockBodyScroll(), this.determineScrollStatus();
|
|
59
|
+
}
|
|
60
|
+
async close(a) {
|
|
61
|
+
this.closing || (this.requestModalClose.emit(), !(!this.closable && !a) && (this.closing = !0, this.unlockBodyScroll(), setTimeout(() => {
|
|
62
|
+
this.isOpen = !1, this.modalClose.emit(), this.closing = !1;
|
|
63
|
+
}, 150)));
|
|
64
|
+
}
|
|
65
|
+
updateCustomFooterStatus() {
|
|
66
|
+
this.hasCustomFooter = Boolean(this.el.querySelector('[slot="custom-footer"]'));
|
|
67
|
+
}
|
|
68
|
+
updateCustomHeaderStatus() {
|
|
69
|
+
this.hasCustomHeader = Boolean(this.el.querySelector('[slot="custom-header"]'));
|
|
70
|
+
}
|
|
71
|
+
updateHeaderToolsStatus() {
|
|
72
|
+
this.hasHeaderTools = Boolean(this.el.querySelector('[slot="header-tools"]'));
|
|
73
|
+
}
|
|
74
|
+
updateSecondaryContentStatus() {
|
|
75
|
+
this.hasSecondaryContent = Boolean(this.el.querySelector('[slot="secondary-content"]'));
|
|
76
|
+
}
|
|
77
|
+
handleAutoFocus() {
|
|
78
|
+
var a;
|
|
79
|
+
(a = this.modalEl.querySelector("input[autofocus]")) == null || a.focus();
|
|
80
|
+
}
|
|
81
|
+
lockBodyScroll() {
|
|
82
|
+
f(this.scrollContainer);
|
|
83
|
+
}
|
|
84
|
+
unlockBodyScroll() {
|
|
85
|
+
v(this.scrollContainer);
|
|
86
|
+
}
|
|
87
|
+
render() {
|
|
88
|
+
const a = Boolean(this.primaryActionLabel) || Boolean(this.secondaryActionLabel), e = _("modal", `modal--variant-${this.variant}`, {
|
|
89
|
+
"modal--closing": this.closing,
|
|
90
|
+
"modal--has-custom-footer": this.hasCustomFooter,
|
|
91
|
+
"modal--has-custom-header": this.hasCustomHeader,
|
|
92
|
+
"modal--has-header-tools": this.hasHeaderTools,
|
|
93
|
+
"modal--has-secondary-content": this.hasSecondaryContent,
|
|
94
|
+
"modal--hide-label": this.hideLabel,
|
|
95
|
+
"modal--padded": this.padded,
|
|
96
|
+
"modal--scrollable": this.scrollable,
|
|
97
|
+
"modal--scrolled": this.scrolled,
|
|
98
|
+
"modal--scrolled-down": this.scrolledDown
|
|
99
|
+
});
|
|
100
|
+
return o(p, null, o("section", { "aria-hidden": String(!this.isOpen), "aria-label": this.label, "aria-modal": "true", class: e, onKeyDown: this.onKeyDown, role: "dialog", ref: (t) => this.modalEl = t }, o("div", { class: "modal__backdrop", onClick: this.onBackdropClick }), o("div", { class: "modal__body", style: {
|
|
101
|
+
"--swirl-modal-max-height": this.maxHeight,
|
|
102
|
+
"--swirl-modal-height": this.height,
|
|
103
|
+
maxWidth: this.maxWidth
|
|
104
|
+
} }, o("header", { class: "modal__custom-header" }, o("slot", { name: "custom-header" })), (!this.hideLabel || !this.hideCloseButton) && o("header", { class: "modal__header" }, o("div", { class: "modal__header-bar" }, !this.hideCloseButton && o("swirl-button", { class: "modal__close-button", hideLabel: !0, icon: this.variant === "default" ? "<swirl-icon-close></swirl-icon-close>" : "<swirl-icon-double-arrow-right></swirl-icon-double-arrow-right>", label: this.closeButtonLabel, onClick: this.onCloseButtonClick }), !this.hideLabel && o("swirl-heading", { as: "h2", class: "modal__heading", level: 3, text: this.label }))), o("div", { class: "modal__content-container" }, o("div", { class: "modal__primary-content" }, o("div", { class: "modal__header-tools" }, o("slot", { name: "header-tools" })), o("div", { class: "modal__content", onScroll: this.determineScrollStatus, ref: (t) => this.scrollContainer = t }, o("slot", null))), o("div", { class: "modal__secondary-content" }, o("slot", { name: "secondary-content" }))), o("div", { class: "modal__custom-footer" }, o("slot", { name: "custom-footer" })), a && o("footer", { class: "modal__controls" }, o("swirl-button-group", { wrap: !0 }, this.secondaryActionLabel && o("swirl-button", { label: this.secondaryActionLabel, onClick: this.onSecondaryAction }), this.primaryActionLabel && o("swirl-button", { intent: "primary", label: this.primaryActionLabel, onClick: this.onPrimaryAction, variant: "flat" }))))));
|
|
105
|
+
}
|
|
106
|
+
get el() {
|
|
107
|
+
return u(this);
|
|
108
|
+
}
|
|
109
|
+
static get watchers() {
|
|
110
|
+
return {
|
|
111
|
+
isOpen: ["watchIsOpen"]
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
w.style = g;
|
|
116
|
+
export {
|
|
117
|
+
w as swirl_modal
|
|
118
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { r as s, h as t, H as e } from "./index.e5965a8a.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
const o = ":host{display:block}:host *{box-sizing:border-box}.option-list-section{background-color:var(--s-surface-overlay-default)}.option-list-section__label{display:block;width:100%;padding:var(--s-space-8) var(--s-space-16);border-bottom:var(--s-border-width-default) solid var(--s-border-default);color:var(--s-text-subdued);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);text-align:left}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.option-list-section__label{padding:var(--s-space-8) var(--s-space-12);font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}", l = class {
|
|
5
|
+
constructor(i) {
|
|
6
|
+
s(this, i), this.label = void 0;
|
|
7
|
+
}
|
|
8
|
+
render() {
|
|
9
|
+
return t(e, null, t("div", { "aria-labelledby": "label", class: "option-list-section", role: "group" }, t("span", { class: "option-list-section__label", id: "label", part: "option-list-section__label" }, this.label), t("div", { class: "option-list-section__items" }, t("slot", null))));
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
l.style = o;
|
|
13
|
+
export {
|
|
14
|
+
l as swirl_option_list_section
|
|
15
|
+
};
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { r as h, c as a, h as o, H as c, g as d } from "./index.e5965a8a.js";
|
|
2
|
+
import { c as l, q as n } from "./utils-9f141e25.a4ae3adc.js";
|
|
3
|
+
import { S as m } from "./sortable.esm-8c3d5856.57c4f048.js";
|
|
4
|
+
import { c as f } from "./index-d280dafb.186cdb0e.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "react-dom";
|
|
7
|
+
const b = ".sc-swirl-option-list-h{display:block}.sc-swirl-option-list-h *.sc-swirl-option-list{box-sizing:border-box}", p = class {
|
|
8
|
+
constructor(e) {
|
|
9
|
+
h(this, e), this.itemDrop = a(this, "itemDrop", 7), this.valueChange = a(this, "valueChange", 7), this.onClick = (t) => {
|
|
10
|
+
t.preventDefault();
|
|
11
|
+
const s = t.target, i = s == null ? void 0 : s.closest("swirl-option-list-item"), r = t.composedPath()[0], u = Boolean(l(r, '[role="option"]'));
|
|
12
|
+
if (!Boolean(i) || !u) {
|
|
13
|
+
t.preventDefault();
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
this.selectItem(this.items.findIndex((g) => g.value === i.value));
|
|
17
|
+
}, this.onKeyDown = (t) => {
|
|
18
|
+
if (t.code === "ArrowDown")
|
|
19
|
+
t.preventDefault(), Boolean(this.dragging) ? this.moveDraggedItemDown() : this.focusNextItem();
|
|
20
|
+
else if (t.code === "ArrowUp")
|
|
21
|
+
t.preventDefault(), Boolean(this.dragging) ? this.moveDraggedItemUp() : this.focusPreviousItem();
|
|
22
|
+
else if (t.code === "Space" || t.code === "Enter") {
|
|
23
|
+
if (!t.target.classList.contains("option-list-item__drag-handle") && Boolean(this.dragging)) {
|
|
24
|
+
t.preventDefault(), this.stopDrag(this.dragging);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const i = t.composedPath()[0];
|
|
28
|
+
if (!Boolean(l(i, '[role="option"]')))
|
|
29
|
+
return;
|
|
30
|
+
t.preventDefault(), Boolean(this.dragging) ? this.stopDrag(this.dragging) : this.selectFocusedItem();
|
|
31
|
+
} else
|
|
32
|
+
t.code === "Home" ? (t.preventDefault(), this.focusItem(0)) : t.code === "End" ? (t.preventDefault(), this.focusItem(this.items.length - 1)) : t.code === "KeyA" && (t.metaKey || t.ctrlKey) && this.multiSelect ? (t.preventDefault(), this.selectAllItems()) : t.code === "Tab" && Boolean(this.dragging) && t.preventDefault();
|
|
33
|
+
}, this.toggleDrag = (t) => {
|
|
34
|
+
const s = t.detail;
|
|
35
|
+
Boolean(this.dragging) ? this.stopDrag(s) : this.startDrag(s);
|
|
36
|
+
}, this.startDrag = (t) => {
|
|
37
|
+
this.dragging = t, this.draggingStartIndex = this.getItemIndex(this.dragging), t.setAttribute("dragging", "true");
|
|
38
|
+
const s = this.getItemIndex(this.dragging);
|
|
39
|
+
this.focusItem(s), this.assistiveText = this.assistiveTextItemGrabbed;
|
|
40
|
+
}, this.stopDrag = (t) => {
|
|
41
|
+
this.dragging = void 0, t.removeAttribute("dragging");
|
|
42
|
+
const s = this.getActiveItemIndex();
|
|
43
|
+
this.assistiveText = `${this.assistiveTextItemMoved} ${s + 1}`, this.itemDrop.emit({ item: t, oldIndex: this.draggingStartIndex, newIndex: s }), this.draggingStartIndex = void 0, this.focusItem(s);
|
|
44
|
+
}, this.allowDeselect = !0, this.allowDrag = void 0, this.assistiveTextItemGrabbed = "Item grabbed. Use arrow keys to move item up or down. Use spacebar to save position.", this.assistiveTextItemMoving = "Current position:", this.assistiveTextItemMoved = "Item moved. New position:", this.disabled = void 0, this.label = void 0, this.optionListId = void 0, this.multiSelect = void 0, this.value = [], this.assistiveText = void 0;
|
|
45
|
+
}
|
|
46
|
+
componentDidLoad() {
|
|
47
|
+
this.updateItems(), this.observeSlotChanges(), this.setItemAllowDragState(), this.setItemDisabledState(), this.setItemContext(), this.syncItemsWithValue(), this.setupDragDrop();
|
|
48
|
+
}
|
|
49
|
+
componentDidRender() {
|
|
50
|
+
this.setupDragDrop();
|
|
51
|
+
}
|
|
52
|
+
disconnectedCallback() {
|
|
53
|
+
var e, t;
|
|
54
|
+
(e = this.observer) == null || e.disconnect(), (t = this.sortable) == null || t.destroy();
|
|
55
|
+
}
|
|
56
|
+
watchAllowDrag() {
|
|
57
|
+
this.setItemAllowDragState(), this.setupDragDrop();
|
|
58
|
+
}
|
|
59
|
+
watchDisabled() {
|
|
60
|
+
this.setItemDisabledState();
|
|
61
|
+
}
|
|
62
|
+
watchMultiSelect() {
|
|
63
|
+
this.setItemContext();
|
|
64
|
+
}
|
|
65
|
+
watchValue() {
|
|
66
|
+
this.syncItemsWithValue();
|
|
67
|
+
}
|
|
68
|
+
observeSlotChanges() {
|
|
69
|
+
this.observer = new MutationObserver(() => {
|
|
70
|
+
this.updateItems(), this.setItemAllowDragState(), this.setItemDisabledState(), this.setItemContext(), this.syncItemsWithValue();
|
|
71
|
+
}), this.observer.observe(this.listboxEl, { childList: !0, subtree: !0 });
|
|
72
|
+
}
|
|
73
|
+
updateItems() {
|
|
74
|
+
var t;
|
|
75
|
+
this.items = n(this.el, "swirl-option-list-item"), this.items.forEach((s) => {
|
|
76
|
+
var i;
|
|
77
|
+
return (i = s.querySelector('[role="option"]')) == null ? void 0 : i.removeAttribute("tabIndex");
|
|
78
|
+
});
|
|
79
|
+
const e = (t = this.items[0]) == null ? void 0 : t.querySelector('[role="option"]');
|
|
80
|
+
!Boolean(e) || e.setAttribute("tabIndex", "0");
|
|
81
|
+
}
|
|
82
|
+
setItemDisabledState() {
|
|
83
|
+
this.disabled && this.items.forEach((e) => e.disabled = !0);
|
|
84
|
+
}
|
|
85
|
+
setItemContext() {
|
|
86
|
+
this.multiSelect ? this.items.forEach((e) => e.context = "multi-select") : (this.items.forEach((e) => e.context = "single-select"), this.value.length > 1 && this.updateValue([this.value[0]]));
|
|
87
|
+
}
|
|
88
|
+
setupDragDrop() {
|
|
89
|
+
Boolean(this.sortable) && this.sortable.destroy(), this.allowDrag && (this.sortable = m.create(this.listboxEl, {
|
|
90
|
+
animation: 150,
|
|
91
|
+
draggable: "swirl-option-list-item",
|
|
92
|
+
handle: ".option-list-item__drag-handle",
|
|
93
|
+
onEnd: (e) => {
|
|
94
|
+
this.itemDrop.emit({
|
|
95
|
+
item: e.item,
|
|
96
|
+
oldIndex: e.oldIndex,
|
|
97
|
+
newIndex: e.newIndex
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
setItemAllowDragState() {
|
|
103
|
+
if (this.allowDrag && !this.multiSelect) {
|
|
104
|
+
console.error("[SwirlOptionList] Drag can only be allowed for multi select lists.");
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const e = n(this.el, "swirl-option-list-section");
|
|
108
|
+
if (this.allowDrag && e.length > 0) {
|
|
109
|
+
console.error("[SwirlOptionList] Drag can only be allowed for lists without sections.");
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this.allowDrag ? this.items.forEach((t) => {
|
|
113
|
+
t.setAttribute("allow-drag", "true"), t.addEventListener("toggleDrag", this.toggleDrag);
|
|
114
|
+
}) : this.items.forEach((t) => {
|
|
115
|
+
t.removeAttribute("allow-drag"), t.removeEventListener("toggleDrag", this.toggleDrag);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
selectItem(e) {
|
|
119
|
+
if (this.disabled)
|
|
120
|
+
return;
|
|
121
|
+
const t = this.items[e];
|
|
122
|
+
if (t.disabled)
|
|
123
|
+
return;
|
|
124
|
+
const s = this.value.includes(t.value);
|
|
125
|
+
s && !this.allowDeselect || (this.multiSelect || (this.value = []), s ? this.updateValue(this.value.filter((i) => i !== t.value)) : this.updateValue([...this.value, t.value]), this.focusItem(e));
|
|
126
|
+
}
|
|
127
|
+
updateValue(e) {
|
|
128
|
+
this.value = e, this.valueChange.emit(this.value);
|
|
129
|
+
}
|
|
130
|
+
selectFocusedItem() {
|
|
131
|
+
this.disabled || this.getActiveItemIndex() === -1 || this.selectItem(this.getActiveItemIndex());
|
|
132
|
+
}
|
|
133
|
+
selectAllItems() {
|
|
134
|
+
if (this.disabled)
|
|
135
|
+
return;
|
|
136
|
+
this.items.every((t) => this.value.includes(t.value)) ? this.updateValue([]) : this.updateValue(this.items.map((t) => t.value));
|
|
137
|
+
}
|
|
138
|
+
syncItemsWithValue() {
|
|
139
|
+
var e;
|
|
140
|
+
(e = this.items) == null || e.forEach((t) => t.selected = this.value.includes(t.value));
|
|
141
|
+
}
|
|
142
|
+
focusItem(e) {
|
|
143
|
+
var s;
|
|
144
|
+
if (this.disabled)
|
|
145
|
+
return;
|
|
146
|
+
this.items.forEach((i) => i.querySelector('[role="option"]').removeAttribute("tabIndex"));
|
|
147
|
+
const t = (s = this.items[e]) == null ? void 0 : s.querySelector('[role="option"]');
|
|
148
|
+
!Boolean(t) || (t.setAttribute("tabIndex", "0"), t.focus(), this.focusedItem = t);
|
|
149
|
+
}
|
|
150
|
+
focusNextItem() {
|
|
151
|
+
if (this.disabled)
|
|
152
|
+
return;
|
|
153
|
+
const e = this.getActiveItemIndex(), t = Math.min(e + 1, this.items.length - 1);
|
|
154
|
+
this.focusItem(t);
|
|
155
|
+
}
|
|
156
|
+
focusPreviousItem() {
|
|
157
|
+
const e = this.getActiveItemIndex(), t = Math.max(e - 1, 0);
|
|
158
|
+
this.focusItem(t);
|
|
159
|
+
}
|
|
160
|
+
getActiveItemIndex() {
|
|
161
|
+
return Boolean(this.focusedItem) ? this.items.map((e) => e.querySelector('[role="option"]')).findIndex((e) => e === this.focusedItem) : 0;
|
|
162
|
+
}
|
|
163
|
+
getItemIndex(e) {
|
|
164
|
+
return this.items.map((t) => t).findIndex((t) => t === e);
|
|
165
|
+
}
|
|
166
|
+
moveDraggedItemDown() {
|
|
167
|
+
const e = this.dragging.nextElementSibling;
|
|
168
|
+
!Boolean(e) || (e.after(this.dragging), this.updateItems(), this.listboxEl.focus(), this.assistiveText = `${this.assistiveTextItemMoving} ${this.getActiveItemIndex() + 1}`);
|
|
169
|
+
}
|
|
170
|
+
moveDraggedItemUp() {
|
|
171
|
+
const e = this.dragging.previousElementSibling;
|
|
172
|
+
!Boolean(e) || (e.before(this.dragging), this.updateItems(), this.listboxEl.focus(), this.assistiveText = `${this.assistiveTextItemMoving} ${this.getItemIndex(this.dragging) + 1}`);
|
|
173
|
+
}
|
|
174
|
+
render() {
|
|
175
|
+
const e = this.multiSelect ? "true" : void 0, t = Boolean(this.dragging) ? 0 : void 0;
|
|
176
|
+
return o(c, null, o("swirl-visually-hidden", { role: "alert" }, this.assistiveText), o("div", { "aria-label": this.label, "aria-multiselectable": e, class: "option-list", id: this.optionListId, onClick: this.onClick, onKeyDown: this.onKeyDown, ref: (s) => this.listboxEl = s, role: "listbox", tabIndex: t }, o("slot", null)));
|
|
177
|
+
}
|
|
178
|
+
get el() {
|
|
179
|
+
return d(this);
|
|
180
|
+
}
|
|
181
|
+
static get watchers() {
|
|
182
|
+
return {
|
|
183
|
+
allowDrag: ["watchAllowDrag"],
|
|
184
|
+
disabled: ["watchDisabled"],
|
|
185
|
+
multiSelect: ["watchMultiSelect"],
|
|
186
|
+
value: ["watchValue"]
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
p.style = b;
|
|
191
|
+
const v = ":host{display:inline-flex;max-width:100%}:host *{box-sizing:border-box}.tag{display:inline-flex;max-width:100%;padding:var(--s-space-2) var(--s-space-8);align-items:center;border-radius:var(--s-border-radius-s);color:var(--s-text-default);background-color:var(--s-surface-neutral-subdued);font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-sm);white-space:nowrap;gap:var(--s-space-4)}.tag--intent-info{color:var(--s-text-info);background-color:var(--s-surface-info-subdued)}.tag--intent-info .tag__removal-button{color:var(--icon-info)}.tag--intent-critical{color:var(--s-text-critical);background-color:var(--s-surface-critical-subdued)}.tag--intent-critical .tag__removal-button{color:var(--icon-critical)}.tag--intent-warning{color:var(--s-text-warning);background-color:var(--s-surface-warning-subdued)}.tag--intent-warning .tag__removal-button{color:var(--icon-warning)}.tag--intent-success{color:var(--s-text-success);background-color:var(--s-surface-success-subdued)}.tag--intent-success .tag__removal-button{color:var(--icon-success)}.tag__label{overflow:hidden;min-width:0;white-space:nowrap;text-overflow:ellipsis}.tag__removal-button{display:inline-flex;margin-right:calc(-1 * var(--s-space-4));padding:0;border:none;color:var(--s-icon-strong);background-color:transparent;cursor:pointer}.tag__removal-button:focus:not(:focus-visible){outline:none}.tag__removal-button:focus-visible{outline-color:var(--s-focus-default)}", I = class {
|
|
192
|
+
constructor(e) {
|
|
193
|
+
h(this, e), this.remove = a(this, "remove", 7), this.onRemove = (t) => {
|
|
194
|
+
var s;
|
|
195
|
+
(s = this.remove) == null || s.emit(t);
|
|
196
|
+
}, this.intent = "default", this.label = void 0, this.removable = void 0, this.removalButtonLabel = "Remove";
|
|
197
|
+
}
|
|
198
|
+
render() {
|
|
199
|
+
const e = f("tag", `tag--intent-${this.intent}`);
|
|
200
|
+
return o(c, null, o("span", { class: e, part: "tag" }, o("span", { class: "tag__label" }, this.label), this.removable && o("button", { "aria-label": this.removalButtonLabel, class: "tag__removal-button", onClick: this.onRemove, tabIndex: this.el.ariaHidden === "true" ? -1 : void 0, type: "button" }, o("swirl-icon-close", { size: 16 }))));
|
|
201
|
+
}
|
|
202
|
+
get el() {
|
|
203
|
+
return d(this);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
I.style = v;
|
|
207
|
+
export {
|
|
208
|
+
p as swirl_option_list,
|
|
209
|
+
I as swirl_tag
|
|
210
|
+
};
|