@getflip/swirl-components 0.12.0 → 0.13.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 +425 -84
- package/dist/cjs/balancetext-7a0bdee3.js +763 -0
- package/dist/cjs/{floating-ui.dom.esm-75453e4e.js → floating-ui.dom.esm-35943202.js} +0 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/swirl-action-list-item.cjs.entry.js +1 -1
- package/dist/cjs/swirl-action-list.cjs.entry.js +1 -1
- package/dist/cjs/swirl-app-layout_5.cjs.entry.js +1 -1
- package/dist/cjs/swirl-autocomplete.cjs.entry.js +3 -3
- package/dist/cjs/swirl-banner.cjs.entry.js +1 -1
- package/dist/cjs/swirl-button.cjs.entry.js +1 -1
- package/dist/cjs/swirl-chip.cjs.entry.js +1 -1
- package/dist/cjs/swirl-components.cjs.js +1 -1
- package/dist/cjs/swirl-console-layout.cjs.entry.js +1 -1
- package/dist/cjs/swirl-date-input.cjs.entry.js +9 -3
- package/dist/cjs/swirl-date-picker_2.cjs.entry.js +14 -81
- package/dist/cjs/swirl-file-viewer_7.cjs.entry.js +1 -1
- package/dist/cjs/swirl-form-control.cjs.entry.js +15 -1
- package/dist/cjs/swirl-heading.cjs.entry.js +15 -1
- package/dist/cjs/swirl-icon-check-small_4.cjs.entry.js +3440 -0
- package/dist/cjs/swirl-icon-error_3.cjs.entry.js +1 -1
- package/dist/cjs/swirl-lightbox.cjs.entry.js +1 -1
- package/dist/cjs/swirl-pdf-reader.cjs.entry.js +1 -1
- package/dist/cjs/swirl-popover.cjs.entry.js +2 -2
- package/dist/cjs/swirl-resource-list-file-item.cjs.entry.js +1 -1
- package/dist/cjs/swirl-search.cjs.entry.js +1 -1
- package/dist/cjs/swirl-select.cjs.entry.js +3 -2
- package/dist/cjs/swirl-table.cjs.entry.js +1 -1
- package/dist/cjs/swirl-text-input.cjs.entry.js +3 -2
- package/dist/cjs/swirl-text.cjs.entry.js +16 -2
- package/dist/cjs/swirl-toast.cjs.entry.js +1 -1
- package/dist/cjs/swirl-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/{utils-9c9476b4.js → utils-a07ee0db.js} +18 -0
- package/dist/cjs/wc-datepicker.cjs.entry.js +471 -0
- package/dist/collection/collection-manifest.json +9 -1
- package/dist/collection/components/swirl-autocomplete/swirl-autocomplete.js +35 -18
- package/dist/collection/components/swirl-date-input/swirl-date-input.css +11 -0
- package/dist/collection/components/swirl-date-input/swirl-date-input.js +77 -21
- package/dist/collection/components/swirl-date-picker/swirl-date-picker.css +168 -121
- package/dist/collection/components/swirl-date-picker/swirl-date-picker.js +28 -104
- package/dist/collection/components/swirl-date-picker/swirl-date-picker.stories.js +0 -5
- package/dist/collection/components/swirl-form-control/swirl-form-control.css +22 -0
- package/dist/collection/components/swirl-form-control/swirl-form-control.js +33 -0
- package/dist/collection/components/swirl-heading/swirl-heading.js +41 -2
- package/dist/collection/components/swirl-heading/swirl-heading.stories.js +6 -1
- package/dist/collection/components/swirl-icon/icons/swirl-icon-drag-handle.js +67 -0
- package/dist/collection/components/swirl-option-list/swirl-option-list.js +236 -13
- package/dist/collection/components/swirl-option-list/swirl-option-list.stories.js +6 -8
- package/dist/collection/components/swirl-option-list-item/swirl-option-list-item.css +64 -1
- package/dist/collection/components/swirl-option-list-item/swirl-option-list-item.js +106 -3
- package/dist/collection/components/swirl-option-list-item/swirl-option-list-item.stories.js +8 -0
- package/dist/collection/components/swirl-select/swirl-select.css +4 -0
- package/dist/collection/components/swirl-select/swirl-select.js +23 -5
- package/dist/collection/components/swirl-table/swirl-table.js +0 -1
- package/dist/collection/components/swirl-text/swirl-text.js +41 -3
- package/dist/collection/components/swirl-text/swirl-text.stories.js +5 -0
- package/dist/collection/components/swirl-text-input/swirl-text-input.css +21 -0
- package/dist/collection/components/swirl-text-input/swirl-text-input.js +18 -0
- package/dist/collection/utils.js +17 -0
- package/dist/components/balancetext.js +761 -0
- package/dist/components/file-manager.js +34 -28
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index2.js +35 -2
- package/dist/components/swirl-autocomplete.js +15 -8
- package/dist/components/swirl-date-input.js +25 -11
- package/dist/components/swirl-date-picker2.js +22 -85
- package/dist/components/swirl-file-viewer-csv2.js +1 -1
- package/dist/components/swirl-file-viewer-pdf2.js +1 -1
- package/dist/components/swirl-file-viewer2.js +1 -1
- package/dist/components/swirl-form-control.js +16 -1
- package/dist/components/swirl-heading2.js +17 -2
- package/dist/components/swirl-icon-drag-handle.d.ts +11 -0
- package/dist/components/swirl-icon-drag-handle.js +6 -0
- package/dist/components/swirl-icon-drag-handle2.js +37 -0
- package/dist/components/swirl-option-list-item2.js +30 -9
- package/dist/components/swirl-option-list2.js +3177 -15
- package/dist/components/swirl-select.js +18 -10
- package/dist/components/swirl-text-input2.js +3 -1
- package/dist/components/swirl-text2.js +19 -5
- package/dist/components/utils.js +18 -1
- package/dist/components/wc-datepicker.js +6 -0
- package/dist/components/wc-datepicker2.js +505 -0
- package/dist/esm/{_commonjsHelpers-44457d8d.js → _commonjsHelpers-10467d11.js} +1 -1
- package/dist/esm/balancetext-31f1ec68.js +761 -0
- package/dist/esm/{floating-ui.dom.esm-1a4e8b8a.js → floating-ui.dom.esm-b9f28f6d.js} +0 -0
- package/dist/esm/{index-c3028f7d.js → index-47862d62.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/swirl-action-list-item.entry.js +3 -3
- package/dist/esm/swirl-action-list.entry.js +1 -1
- package/dist/esm/swirl-app-layout_5.entry.js +3 -3
- package/dist/esm/swirl-autocomplete.entry.js +5 -5
- package/dist/esm/swirl-avatar-group.entry.js +2 -2
- package/dist/esm/swirl-avatar.entry.js +2 -2
- package/dist/esm/swirl-badge.entry.js +2 -2
- package/dist/esm/swirl-banner.entry.js +3 -3
- package/dist/esm/swirl-button-group.entry.js +2 -2
- package/dist/esm/swirl-button.entry.js +3 -3
- package/dist/esm/swirl-card.entry.js +2 -2
- package/dist/esm/swirl-checkbox.entry.js +2 -2
- package/dist/esm/swirl-chip.entry.js +3 -3
- package/dist/esm/swirl-components.js +1 -1
- package/dist/esm/swirl-console-layout.entry.js +3 -3
- package/dist/esm/swirl-date-input.entry.js +10 -4
- package/dist/esm/swirl-date-picker_2.entry.js +16 -83
- package/dist/esm/swirl-dialog.entry.js +2 -2
- package/dist/esm/swirl-file-uploader.entry.js +2 -2
- package/dist/esm/swirl-file-viewer_7.entry.js +2 -2
- package/dist/esm/swirl-form-control.entry.js +17 -3
- package/dist/esm/swirl-form-group.entry.js +2 -2
- package/dist/esm/swirl-heading.entry.js +17 -3
- package/dist/esm/swirl-icon-add-photo.entry.js +2 -2
- package/dist/esm/swirl-icon-add_4.entry.js +2 -2
- package/dist/esm/swirl-icon-admin-panel-settings.entry.js +2 -2
- package/dist/esm/swirl-icon-arrow-back.entry.js +2 -2
- package/dist/esm/swirl-icon-arrow-downward_2.entry.js +2 -2
- package/dist/esm/swirl-icon-arrow-forward.entry.js +2 -2
- package/dist/esm/swirl-icon-arrow-left_3.entry.js +2 -2
- package/dist/esm/swirl-icon-arrow-right-small.entry.js +2 -2
- package/dist/esm/swirl-icon-attachment.entry.js +2 -2
- package/dist/esm/swirl-icon-block.entry.js +2 -2
- package/dist/esm/swirl-icon-cancel_4.entry.js +2 -2
- package/dist/esm/swirl-icon-chat-bubble.entry.js +2 -2
- package/dist/esm/swirl-icon-chats-filled.entry.js +2 -2
- package/dist/esm/swirl-icon-chats-outlined.entry.js +2 -2
- package/dist/esm/swirl-icon-check-circle.entry.js +2 -2
- package/dist/esm/swirl-icon-check-small_4.entry.js +3433 -0
- package/dist/esm/swirl-icon-check-strong.entry.js +2 -2
- package/dist/esm/swirl-icon-check.entry.js +2 -2
- package/dist/esm/swirl-icon-chevron-left.entry.js +2 -2
- package/dist/esm/swirl-icon-chevron-right.entry.js +2 -2
- package/dist/esm/swirl-icon-close-small.entry.js +2 -2
- package/dist/esm/swirl-icon-close.entry.js +2 -2
- package/dist/esm/swirl-icon-cloud-upload.entry.js +2 -2
- package/dist/esm/swirl-icon-column.entry.js +2 -2
- package/dist/esm/swirl-icon-comment.entry.js +2 -2
- package/dist/esm/swirl-icon-copy.entry.js +2 -2
- package/dist/esm/swirl-icon-date-range.entry.js +2 -2
- package/dist/esm/swirl-icon-delete.entry.js +2 -2
- package/dist/esm/swirl-icon-description.entry.js +2 -2
- package/dist/esm/swirl-icon-edit.entry.js +2 -2
- package/dist/esm/swirl-icon-emoji-mood.entry.js +2 -2
- package/dist/esm/swirl-icon-emoji-satisfied.entry.js +2 -2
- package/dist/esm/swirl-icon-error_3.entry.js +3 -3
- package/dist/esm/swirl-icon-expand-more.entry.js +2 -2
- package/dist/esm/swirl-icon-file.entry.js +2 -2
- package/dist/esm/swirl-icon-filter.entry.js +2 -2
- package/dist/esm/swirl-icon-folder-shared.entry.js +2 -2
- package/dist/esm/swirl-icon-group-assign.entry.js +2 -2
- package/dist/esm/swirl-icon-groups-custom.entry.js +2 -2
- package/dist/esm/swirl-icon-groups-filled.entry.js +2 -2
- package/dist/esm/swirl-icon-groups-outlined.entry.js +2 -2
- package/dist/esm/swirl-icon-groups.entry.js +2 -2
- package/dist/esm/swirl-icon-help.entry.js +2 -2
- package/dist/esm/swirl-icon-image.entry.js +2 -2
- package/dist/esm/swirl-icon-info.entry.js +2 -2
- package/dist/esm/swirl-icon-inventory.entry.js +2 -2
- package/dist/esm/swirl-icon-like.entry.js +2 -2
- package/dist/esm/swirl-icon-link.entry.js +2 -2
- package/dist/esm/swirl-icon-lock.entry.js +2 -2
- package/dist/esm/swirl-icon-logout.entry.js +2 -2
- package/dist/esm/swirl-icon-mail.entry.js +2 -2
- package/dist/esm/swirl-icon-manage-accounts.entry.js +2 -2
- package/dist/esm/swirl-icon-mention.entry.js +2 -2
- package/dist/esm/swirl-icon-menu-filled.entry.js +2 -2
- package/dist/esm/swirl-icon-menu-outlined.entry.js +2 -2
- package/dist/esm/swirl-icon-menu.entry.js +2 -2
- package/dist/esm/swirl-icon-message.entry.js +2 -2
- package/dist/esm/swirl-icon-more-horizontal.entry.js +2 -2
- package/dist/esm/swirl-icon-more-vertikal.entry.js +2 -2
- package/dist/esm/swirl-icon-news-filled.entry.js +2 -2
- package/dist/esm/swirl-icon-news-outlined.entry.js +2 -2
- package/dist/esm/swirl-icon-notifications-active.entry.js +2 -2
- package/dist/esm/swirl-icon-notifications-off.entry.js +2 -2
- package/dist/esm/swirl-icon-notifications.entry.js +2 -2
- package/dist/esm/swirl-icon-open-in-new.entry.js +2 -2
- package/dist/esm/swirl-icon-people-alt.entry.js +2 -2
- package/dist/esm/swirl-icon-person-off.entry.js +2 -2
- package/dist/esm/swirl-icon-person.entry.js +2 -2
- package/dist/esm/swirl-icon-phone.entry.js +2 -2
- package/dist/esm/swirl-icon-poll.entry.js +2 -2
- package/dist/esm/swirl-icon-print.entry.js +2 -2
- package/dist/esm/swirl-icon-recieved.entry.js +2 -2
- package/dist/esm/swirl-icon-search-strong.entry.js +2 -2
- package/dist/esm/swirl-icon-search.entry.js +2 -2
- package/dist/esm/swirl-icon-send.entry.js +2 -2
- package/dist/esm/swirl-icon-settings.entry.js +2 -2
- package/dist/esm/swirl-icon-sync.entry.js +2 -2
- package/dist/esm/swirl-icon-tasks-filled.entry.js +2 -2
- package/dist/esm/swirl-icon-tasks-outlined.entry.js +2 -2
- package/dist/esm/swirl-icon-time-filled.entry.js +2 -2
- package/dist/esm/swirl-icon-time-outlined.entry.js +2 -2
- package/dist/esm/swirl-icon-user-assign.entry.js +2 -2
- package/dist/esm/swirl-icon-video-camera.entry.js +2 -2
- package/dist/esm/swirl-icon-warning.entry.js +2 -2
- package/dist/esm/swirl-lightbox.entry.js +3 -3
- package/dist/esm/swirl-modal.entry.js +2 -2
- package/dist/esm/swirl-pagination.entry.js +2 -2
- package/dist/esm/swirl-pdf-reader.entry.js +3 -3
- package/dist/esm/swirl-popover.entry.js +4 -4
- package/dist/esm/swirl-progress-indicator.entry.js +2 -2
- package/dist/esm/swirl-radio.entry.js +2 -2
- package/dist/esm/swirl-resource-list-file-item.entry.js +3 -3
- package/dist/esm/swirl-search.entry.js +3 -3
- package/dist/esm/swirl-select.entry.js +5 -4
- package/dist/esm/swirl-stack.entry.js +2 -2
- package/dist/esm/swirl-switch.entry.js +2 -2
- package/dist/esm/swirl-tab.entry.js +2 -2
- package/dist/esm/swirl-table-row.entry.js +2 -2
- package/dist/esm/swirl-table.entry.js +1 -1
- package/dist/esm/swirl-tabs.entry.js +2 -2
- package/dist/esm/swirl-tag.entry.js +2 -2
- package/dist/esm/swirl-text-input.entry.js +5 -4
- package/dist/esm/swirl-text.entry.js +19 -5
- package/dist/esm/swirl-thumbnail.entry.js +2 -2
- package/dist/esm/swirl-toast.entry.js +3 -3
- package/dist/esm/swirl-tooltip.entry.js +1 -1
- package/dist/esm/swirl-tree-navigation-item.entry.js +2 -2
- package/dist/esm/{utils-7efaa1c6.js → utils-33d31b58.js} +18 -1
- package/dist/esm/wc-datepicker.entry.js +467 -0
- package/dist/swirl-components/{p-17e7ea80.entry.js → p-02266563.entry.js} +1 -1
- package/dist/swirl-components/{p-31943bc0.entry.js → p-02781ffc.entry.js} +1 -1
- package/dist/swirl-components/{p-33e363ed.entry.js → p-033168e0.entry.js} +1 -1
- package/dist/swirl-components/{p-968adc69.entry.js → p-0385eb63.entry.js} +1 -1
- package/dist/swirl-components/{p-ebc078da.entry.js → p-07c4ec61.entry.js} +1 -1
- package/dist/swirl-components/{p-98827f45.entry.js → p-07e6bd5a.entry.js} +1 -1
- package/dist/swirl-components/{p-7c514ca1.entry.js → p-0855060e.entry.js} +1 -1
- package/dist/swirl-components/p-085518e9.entry.js +7 -0
- package/dist/swirl-components/{p-6043df71.entry.js → p-08a271c1.entry.js} +1 -1
- package/dist/swirl-components/{p-0924336d.entry.js → p-0ed20748.entry.js} +1 -1
- package/dist/swirl-components/p-0f33e5f9.entry.js +1 -0
- package/dist/swirl-components/p-1009db9b.entry.js +1 -0
- package/dist/swirl-components/{p-a76e4ffc.entry.js → p-1028d75e.entry.js} +1 -1
- package/dist/swirl-components/{p-ab7a08a6.entry.js → p-1586b6d7.entry.js} +1 -1
- package/dist/swirl-components/{p-67626481.entry.js → p-165b789f.entry.js} +1 -1
- package/dist/swirl-components/{p-86bd3473.js → p-16e63a98.js} +1 -1
- package/dist/swirl-components/{p-d16f5f72.entry.js → p-17df9c65.entry.js} +1 -1
- package/dist/swirl-components/{p-8cabe3e0.entry.js → p-191c1d21.entry.js} +1 -1
- package/dist/swirl-components/{p-c63c0897.entry.js → p-19def4b3.entry.js} +1 -1
- package/dist/swirl-components/{p-29e918f4.entry.js → p-1a89f98d.entry.js} +1 -1
- package/dist/swirl-components/p-1de6c923.entry.js +1 -0
- package/dist/swirl-components/p-1fa4cad9.entry.js +1 -0
- package/dist/swirl-components/{p-3991c596.entry.js → p-22eb8331.entry.js} +1 -1
- package/dist/swirl-components/{p-d46f437e.entry.js → p-252067c8.entry.js} +1 -1
- package/dist/swirl-components/{p-ffe7373d.entry.js → p-2667afa2.entry.js} +1 -1
- package/dist/swirl-components/{p-6c620f94.entry.js → p-26db1190.entry.js} +1 -1
- package/dist/swirl-components/{p-8f3d1f73.entry.js → p-26f538a6.entry.js} +1 -1
- package/dist/swirl-components/{p-659b4fcb.entry.js → p-2a973f5c.entry.js} +1 -1
- package/dist/swirl-components/{p-297800ad.entry.js → p-2ab5a45c.entry.js} +1 -1
- package/dist/swirl-components/{p-1bff5707.entry.js → p-2ce152e6.entry.js} +1 -1
- package/dist/swirl-components/{p-898341d1.entry.js → p-2e34f705.entry.js} +1 -1
- package/dist/swirl-components/{p-a61783f1.entry.js → p-30a6b367.entry.js} +1 -1
- package/dist/swirl-components/{p-409900a9.entry.js → p-322f0adb.entry.js} +1 -1
- package/dist/swirl-components/{p-f17a9780.entry.js → p-33f36ef4.entry.js} +1 -1
- package/dist/swirl-components/{p-634e09ad.entry.js → p-35cafad6.entry.js} +1 -1
- package/dist/swirl-components/{p-21267175.entry.js → p-3817b462.entry.js} +1 -1
- package/dist/swirl-components/{p-745ae10f.entry.js → p-3884afc6.entry.js} +1 -1
- package/dist/swirl-components/{p-fb50f7b6.entry.js → p-3918570b.entry.js} +1 -1
- package/dist/swirl-components/{p-f8b0f92a.entry.js → p-3f536626.entry.js} +1 -1
- package/dist/swirl-components/{p-91039432.entry.js → p-3fb70da1.entry.js} +1 -1
- package/dist/swirl-components/{p-96ac53d5.entry.js → p-4054dc61.entry.js} +1 -1
- package/dist/swirl-components/{p-5e45f6dc.entry.js → p-40ee5d5c.entry.js} +1 -1
- package/dist/swirl-components/p-40ef764d.entry.js +1 -0
- package/dist/swirl-components/p-4114d875.entry.js +1 -0
- package/dist/swirl-components/{p-733abfbd.entry.js → p-413371ca.entry.js} +1 -1
- package/dist/swirl-components/{p-ed56aa85.entry.js → p-465934b5.entry.js} +1 -1
- package/dist/swirl-components/{p-294983c3.entry.js → p-48d6ac1d.entry.js} +1 -1
- package/dist/swirl-components/{p-4268041a.entry.js → p-4ba456d3.entry.js} +1 -1
- package/dist/swirl-components/p-4ef99de5.js +1 -0
- package/dist/swirl-components/{p-f09a3f4e.entry.js → p-50b406ed.entry.js} +1 -1
- package/dist/swirl-components/{p-8157c96f.entry.js → p-51f56295.entry.js} +1 -1
- package/dist/swirl-components/{p-5612f03c.entry.js → p-5b0671a7.entry.js} +1 -1
- package/dist/swirl-components/{p-d15994cb.entry.js → p-5bea4bb0.entry.js} +1 -1
- package/dist/swirl-components/{p-4f04a176.entry.js → p-5df552ca.entry.js} +1 -1
- package/dist/swirl-components/{p-0ed40682.entry.js → p-5e639fbe.entry.js} +1 -1
- package/dist/swirl-components/{p-4a16e7e1.entry.js → p-5e7a16ad.entry.js} +1 -1
- package/dist/swirl-components/p-627c1474.entry.js +1 -0
- package/dist/swirl-components/{p-4e08d391.entry.js → p-64889756.entry.js} +1 -1
- package/dist/swirl-components/{p-e8bb09e8.js → p-6526bf3e.js} +0 -0
- package/dist/swirl-components/{p-4d7dcfee.entry.js → p-6542ad23.entry.js} +1 -1
- package/dist/swirl-components/{p-0d66f638.entry.js → p-68ae564c.entry.js} +1 -1
- package/dist/swirl-components/{p-027eabd9.entry.js → p-68ebab79.entry.js} +1 -1
- package/dist/swirl-components/{p-d69a0a99.entry.js → p-6a3e0ea9.entry.js} +1 -1
- package/dist/swirl-components/{p-170a2b48.entry.js → p-6e6e8e46.entry.js} +1 -1
- package/dist/swirl-components/{p-1391e221.entry.js → p-6ed9ab51.entry.js} +1 -1
- package/dist/swirl-components/{p-38d67d0e.entry.js → p-6ef0d4f9.entry.js} +1 -1
- package/dist/swirl-components/{p-3335383c.entry.js → p-714ad338.entry.js} +1 -1
- package/dist/swirl-components/{p-8ee094ca.entry.js → p-71732b9a.entry.js} +1 -1
- package/dist/swirl-components/{p-acd8fa1d.entry.js → p-766a7c18.entry.js} +1 -1
- package/dist/swirl-components/{p-88abc2db.entry.js → p-76b6b5e3.entry.js} +1 -1
- package/dist/swirl-components/{p-a2a3e866.entry.js → p-7825d1c5.entry.js} +1 -1
- package/dist/swirl-components/{p-70805149.entry.js → p-78e68acc.entry.js} +1 -1
- package/dist/swirl-components/{p-e8618da9.entry.js → p-7a240cf1.entry.js} +1 -1
- package/dist/swirl-components/p-7b0adf16.js +7 -0
- package/dist/swirl-components/{p-0dd24ec2.entry.js → p-7be538a8.entry.js} +1 -1
- package/dist/swirl-components/{p-d2311589.entry.js → p-7f4b8227.entry.js} +1 -1
- package/dist/swirl-components/{p-d9760e10.entry.js → p-7fa60f01.entry.js} +1 -1
- package/dist/swirl-components/{p-5af19090.entry.js → p-825c1a14.entry.js} +1 -1
- package/dist/swirl-components/{p-6e4135eb.entry.js → p-85bb5e81.entry.js} +1 -1
- package/dist/swirl-components/{p-c45a50a2.entry.js → p-86183269.entry.js} +1 -1
- package/dist/swirl-components/{p-5d0acbf4.entry.js → p-891371a2.entry.js} +1 -1
- package/dist/swirl-components/{p-708ea5cf.entry.js → p-89c23241.entry.js} +1 -1
- package/dist/swirl-components/{p-d78eb6d8.entry.js → p-89fde1cc.entry.js} +1 -1
- package/dist/swirl-components/{p-9f45803b.entry.js → p-8a590a8c.entry.js} +1 -1
- package/dist/swirl-components/{p-7a1181b5.entry.js → p-8c7bb6bc.entry.js} +1 -1
- package/dist/swirl-components/{p-0206d806.entry.js → p-8e61ba5c.entry.js} +1 -1
- package/dist/swirl-components/{p-2aaeb1e6.entry.js → p-8f9b3dda.entry.js} +1 -1
- package/dist/swirl-components/p-9142e03b.js +1 -0
- package/dist/swirl-components/{p-7602ab40.entry.js → p-920803e1.entry.js} +1 -1
- package/dist/swirl-components/p-9bf40265.entry.js +8 -0
- package/dist/swirl-components/{p-dbd1b662.entry.js → p-9c691a7b.entry.js} +1 -1
- package/dist/swirl-components/{p-32c2d812.entry.js → p-9d9088b6.entry.js} +1 -1
- package/dist/swirl-components/{p-49abf88c.entry.js → p-9e963d88.entry.js} +1 -1
- package/dist/swirl-components/{p-e7c325b7.entry.js → p-a2da04e6.entry.js} +1 -1
- package/dist/swirl-components/{p-96ee66e7.entry.js → p-a452a75d.entry.js} +1 -1
- package/dist/swirl-components/{p-e419a9cb.entry.js → p-a80a32e8.entry.js} +1 -1
- package/dist/swirl-components/{p-1253d22b.entry.js → p-aa7ea196.entry.js} +1 -1
- package/dist/swirl-components/{p-cd8446b2.entry.js → p-abc8f079.entry.js} +1 -1
- package/dist/swirl-components/p-af1ffdfc.entry.js +1 -0
- package/dist/swirl-components/{p-6baff764.entry.js → p-b0625526.entry.js} +1 -1
- package/dist/swirl-components/{p-20ac0472.entry.js → p-b1956111.entry.js} +1 -1
- package/dist/swirl-components/{p-e3293a79.entry.js → p-b590bcba.entry.js} +1 -1
- package/dist/swirl-components/{p-2bcb979a.entry.js → p-bdfb7b88.entry.js} +1 -1
- package/dist/swirl-components/{p-8d998974.entry.js → p-c34e0d50.entry.js} +1 -1
- package/dist/swirl-components/{p-043d093e.entry.js → p-c3a7a4bc.entry.js} +1 -1
- package/dist/swirl-components/{p-582364ee.entry.js → p-c467d912.entry.js} +1 -1
- package/dist/swirl-components/{p-5028921b.entry.js → p-c6578cd1.entry.js} +1 -1
- package/dist/swirl-components/{p-d730ab29.entry.js → p-cfb78d4d.entry.js} +1 -1
- package/dist/swirl-components/p-d1315bab.entry.js +1 -0
- package/dist/swirl-components/{p-c6b1fe02.entry.js → p-d30b3b0a.entry.js} +1 -1
- package/dist/swirl-components/{p-a0a3e5d3.entry.js → p-d31e7e68.entry.js} +1 -1
- package/dist/swirl-components/{p-a5497705.entry.js → p-d370621c.entry.js} +1 -1
- package/dist/swirl-components/{p-99244721.entry.js → p-d3bae550.entry.js} +1 -1
- package/dist/swirl-components/{p-0cb291d0.entry.js → p-d6de86fd.entry.js} +1 -1
- package/dist/swirl-components/{p-f06a85d3.entry.js → p-d86dbbfc.entry.js} +1 -1
- package/dist/swirl-components/{p-90559cbf.entry.js → p-df0c1b6d.entry.js} +1 -1
- package/dist/swirl-components/{p-4307ddfe.entry.js → p-e1d74bed.entry.js} +1 -1
- package/dist/swirl-components/{p-2fa4c633.entry.js → p-e43e9dc9.entry.js} +1 -1
- package/dist/swirl-components/{p-474f4c76.entry.js → p-e66cfaa4.entry.js} +1 -1
- package/dist/swirl-components/{p-692e4e5c.entry.js → p-e9c0e313.entry.js} +1 -1
- package/dist/swirl-components/{p-15b398b3.entry.js → p-eea09884.entry.js} +1 -1
- package/dist/swirl-components/{p-c9307120.entry.js → p-f18a29cb.entry.js} +1 -1
- package/dist/swirl-components/{p-c215db6a.entry.js → p-f2683c24.entry.js} +1 -1
- package/dist/swirl-components/{p-0a5d1a8f.entry.js → p-f286106d.entry.js} +1 -1
- package/dist/swirl-components/{p-13295f24.entry.js → p-f300c8c0.entry.js} +1 -1
- package/dist/swirl-components/{p-eac6d46d.entry.js → p-f575ce1b.entry.js} +1 -1
- package/dist/swirl-components/{p-06e76536.entry.js → p-f62b9110.entry.js} +1 -1
- package/dist/swirl-components/{p-92709d5b.entry.js → p-f88bf73d.entry.js} +1 -1
- package/dist/swirl-components/{p-5f461f84.entry.js → p-f8ebfb67.entry.js} +1 -1
- package/dist/swirl-components/{p-4181aa7a.entry.js → p-f95cc7e0.entry.js} +1 -1
- package/dist/swirl-components/{p-38d22e69.entry.js → p-f9f776e3.entry.js} +1 -1
- package/dist/swirl-components/{p-941e7960.entry.js → p-fa26ba4a.entry.js} +1 -1
- package/dist/swirl-components/{p-6f039422.entry.js → p-fbc2a9eb.entry.js} +1 -1
- package/dist/swirl-components/{p-1339648a.entry.js → p-fc578f42.entry.js} +1 -1
- package/dist/swirl-components/{p-f2763bd6.entry.js → p-fed1e05b.entry.js} +1 -1
- package/dist/swirl-components/swirl-components.css +1 -1
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-autocomplete/swirl-autocomplete.d.ts +2 -1
- package/dist/types/components/swirl-date-input/swirl-date-input.d.ts +6 -3
- package/dist/types/components/swirl-date-picker/swirl-date-picker.d.ts +6 -10
- package/dist/types/components/swirl-date-picker/swirl-date-picker.stories.d.ts +0 -7
- package/dist/types/components/swirl-form-control/swirl-form-control.d.ts +2 -0
- package/dist/types/components/swirl-heading/swirl-heading.d.ts +5 -0
- package/dist/types/components/swirl-heading/swirl-heading.stories.d.ts +5 -0
- package/dist/types/components/swirl-icon/icons/swirl-icon-drag-handle.d.ts +5 -0
- package/dist/types/components/swirl-option-list/swirl-option-list.d.ts +21 -0
- package/dist/types/components/swirl-option-list-item/swirl-option-list-item.d.ts +8 -0
- package/dist/types/components/swirl-option-list-item/swirl-option-list-item.stories.d.ts +8 -0
- package/dist/types/components/swirl-select/swirl-select.d.ts +2 -1
- package/dist/types/components/swirl-text/swirl-text.d.ts +6 -0
- package/dist/types/components/swirl-text/swirl-text.stories.d.ts +5 -0
- package/dist/types/components/swirl-text-input/swirl-text-input.d.ts +1 -0
- package/dist/types/components.d.ts +62 -9
- package/dist/types/index.d.ts +2 -0
- package/dist/types/utils.d.ts +1 -0
- package/dist/typings.d.ts +1 -0
- package/package.json +23 -14
- package/vscode-data.json +85 -0
- package/dist/cjs/swirl-icon-check-small_3.cjs.entry.js +0 -261
- package/dist/components/_commonjsHelpers.js +0 -36
- package/dist/esm/swirl-icon-check-small_3.entry.js +0 -255
- package/dist/swirl-components/p-0dcba8b2.entry.js +0 -1
- package/dist/swirl-components/p-36573727.entry.js +0 -1
- package/dist/swirl-components/p-51097641.entry.js +0 -1
- package/dist/swirl-components/p-6272f11a.entry.js +0 -1
- package/dist/swirl-components/p-76e4350f.entry.js +0 -1
- package/dist/swirl-components/p-9a74850d.entry.js +0 -1
- package/dist/swirl-components/p-cbd8f173.entry.js +0 -1
- package/dist/swirl-components/p-d09dc70d.entry.js +0 -7
- package/dist/swirl-components/p-d3d722dc.js +0 -7
- package/dist/swirl-components/p-d97d183f.js +0 -1
- package/dist/swirl-components/p-e0aca739.entry.js +0 -1
- package/dist/swirl-components/p-ea5e12d7.entry.js +0 -1
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-72831c5f.js');
|
|
6
|
-
const index$1 = require('./index-e038b0f7.js');
|
|
7
|
-
const utils = require('./utils-9c9476b4.js');
|
|
8
|
-
require('./_commonjsHelpers-a5111d61.js');
|
|
9
|
-
|
|
10
|
-
const swirlIconCss = ":host{display:inline-flex}";
|
|
11
|
-
|
|
12
|
-
const SwirlIconCheckSmall = class {
|
|
13
|
-
constructor(hostRef) {
|
|
14
|
-
index.registerInstance(this, hostRef);
|
|
15
|
-
this.size = 24;
|
|
16
|
-
}
|
|
17
|
-
render() {
|
|
18
|
-
const viewBoxSize = this.size === 20 ? 24 : this.size;
|
|
19
|
-
const className = index$1.classnames("swirl-icon", `swirl-icon--size-${this.size}`);
|
|
20
|
-
return (index.h("svg", { class: className, fill: "none", height: this.size, part: "icon", viewBox: `0 0 ${viewBoxSize} ${viewBoxSize}`, width: this.size, xmlns: "http://www.w3.org/2000/svg" }, this.size === 16 && (index.h(index.Fragment, null, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M12.4142 4.91924C12.8047 5.30976 12.8047 5.94293 12.4142 6.33345L7.08086 11.6667C6.69033 12.0572 6.05717 12.0572 5.66664 11.6667L3.70711 9.70707C3.31658 9.31655 3.31658 8.68338 3.70711 8.29286C4.09763 7.90233 4.7308 7.90233 5.12132 8.29286L6.37375 9.54539L11 4.91924C11.3905 4.52871 12.0237 4.52871 12.4142 4.91924Z", fill: "currentColor" }))), (this.size === 20 || this.size === 24) && (index.h(index.Fragment, null, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M18.6213 7.37879C19.2071 7.96458 19.2071 8.91433 18.6213 9.50011L10.6213 17.5C10.0355 18.0858 9.08577 18.0858 8.49998 17.5L5.56068 14.5605C4.97489 13.9748 4.97489 13.025 5.56068 12.4392C6.14646 11.8534 7.09621 11.8534 7.682 12.4392L9.56064 14.318L16.5 7.37879C17.0858 6.79301 18.0355 6.79301 18.6213 7.37879Z", fill: "currentColor" }))), this.size === 28 && (index.h(index.Fragment, null, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M21.7248 8.60863C22.4083 9.29205 22.4083 10.4001 21.7248 11.0835L12.3915 20.4167C11.7081 21.1001 10.6001 21.1001 9.91663 20.4167L6.48744 16.9873C5.80403 16.3039 5.80403 15.1959 6.48744 14.5125C7.17086 13.8291 8.2789 13.8291 8.96232 14.5125L11.1541 16.7044L19.25 8.60863C19.9334 7.92521 21.0414 7.92521 21.7248 8.60863Z", fill: "currentColor" })))));
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
SwirlIconCheckSmall.style = swirlIconCss;
|
|
24
|
-
|
|
25
|
-
const swirlOptionListCss = ".sc-swirl-option-list-h{display:block}.sc-swirl-option-list-h *.sc-swirl-option-list{box-sizing:border-box}";
|
|
26
|
-
|
|
27
|
-
const SwirlOptionList = class {
|
|
28
|
-
constructor(hostRef) {
|
|
29
|
-
index.registerInstance(this, hostRef);
|
|
30
|
-
this.valueChange = index.createEvent(this, "valueChange", 7);
|
|
31
|
-
this.value = [];
|
|
32
|
-
this.onFocus = () => {
|
|
33
|
-
if (Boolean(this.focusedItem)) {
|
|
34
|
-
this.focusItem(this.getActiveItemIndex());
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
this.focusItem(0);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
this.onClick = (event) => {
|
|
41
|
-
event.preventDefault();
|
|
42
|
-
const target = event.target;
|
|
43
|
-
const item = target === null || target === void 0 ? void 0 : target.closest("swirl-option-list-item");
|
|
44
|
-
if (!Boolean(item)) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
this.selectItem(this.items.findIndex((i) => i.value === item.value));
|
|
48
|
-
};
|
|
49
|
-
this.onKeyDown = (event) => {
|
|
50
|
-
if (event.code === "ArrowDown") {
|
|
51
|
-
event.preventDefault();
|
|
52
|
-
this.focusNextItem();
|
|
53
|
-
}
|
|
54
|
-
else if (event.code === "ArrowUp") {
|
|
55
|
-
event.preventDefault();
|
|
56
|
-
this.focusPreviousItem();
|
|
57
|
-
}
|
|
58
|
-
else if (event.code === "Space" || event.code === "Enter") {
|
|
59
|
-
event.preventDefault();
|
|
60
|
-
this.selectFocusedItem();
|
|
61
|
-
}
|
|
62
|
-
else if (event.code === "Home") {
|
|
63
|
-
event.preventDefault();
|
|
64
|
-
this.focusItem(0);
|
|
65
|
-
}
|
|
66
|
-
else if (event.code === "End") {
|
|
67
|
-
event.preventDefault();
|
|
68
|
-
this.focusItem(this.items.length - 1);
|
|
69
|
-
}
|
|
70
|
-
else if (event.code === "KeyA" &&
|
|
71
|
-
(event.metaKey || event.ctrlKey) &&
|
|
72
|
-
this.multiSelect) {
|
|
73
|
-
event.preventDefault();
|
|
74
|
-
this.selectAllItems();
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
componentDidLoad() {
|
|
79
|
-
this.updateItems();
|
|
80
|
-
this.observeSlotChanges();
|
|
81
|
-
this.setItemDisabledState();
|
|
82
|
-
this.setItemContext();
|
|
83
|
-
this.syncItemsWithValue();
|
|
84
|
-
}
|
|
85
|
-
disconnectedCallback() {
|
|
86
|
-
var _a;
|
|
87
|
-
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
88
|
-
}
|
|
89
|
-
watchDisabled() {
|
|
90
|
-
this.setItemDisabledState();
|
|
91
|
-
}
|
|
92
|
-
watchMultiSelect() {
|
|
93
|
-
this.setItemContext();
|
|
94
|
-
}
|
|
95
|
-
watchValue() {
|
|
96
|
-
this.syncItemsWithValue();
|
|
97
|
-
}
|
|
98
|
-
observeSlotChanges() {
|
|
99
|
-
this.observer = new MutationObserver(() => {
|
|
100
|
-
this.updateItems();
|
|
101
|
-
});
|
|
102
|
-
this.observer.observe(this.listboxEl, { childList: true });
|
|
103
|
-
}
|
|
104
|
-
updateItems() {
|
|
105
|
-
this.items = utils.querySelectorAllDeep(this.el, "swirl-option-list-item");
|
|
106
|
-
}
|
|
107
|
-
setItemDisabledState() {
|
|
108
|
-
this.items.forEach((item) => (item.disabled = this.disabled));
|
|
109
|
-
}
|
|
110
|
-
setItemContext() {
|
|
111
|
-
if (this.multiSelect) {
|
|
112
|
-
this.items.forEach((item) => (item.context = "multi-select"));
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
this.items.forEach((item) => (item.context = "single-select"));
|
|
116
|
-
if (this.value.length > 1) {
|
|
117
|
-
this.updateValue([this.value[0]]);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
selectItem(index) {
|
|
122
|
-
if (this.disabled) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
const item = this.items[index];
|
|
126
|
-
if (item.disabled) {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
const itemIsAlreadySelected = this.value.includes(item.value);
|
|
130
|
-
if (!this.multiSelect) {
|
|
131
|
-
this.value = [];
|
|
132
|
-
}
|
|
133
|
-
if (!itemIsAlreadySelected) {
|
|
134
|
-
this.updateValue([...this.value, item.value]);
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
this.updateValue(this.value.filter((v) => v !== item.value));
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
updateValue(value) {
|
|
141
|
-
this.value = value;
|
|
142
|
-
this.valueChange.emit(this.value);
|
|
143
|
-
}
|
|
144
|
-
selectFocusedItem() {
|
|
145
|
-
if (this.disabled || this.getActiveItemIndex() === -1) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
this.selectItem(this.getActiveItemIndex());
|
|
149
|
-
}
|
|
150
|
-
selectAllItems() {
|
|
151
|
-
if (this.disabled) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
const alreadySelected = this.items.every((item) => this.value.includes(item.value));
|
|
155
|
-
if (alreadySelected) {
|
|
156
|
-
this.updateValue([]);
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
this.updateValue(this.items.map((item) => item.value));
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
syncItemsWithValue() {
|
|
163
|
-
this.items.forEach((item) => (item.selected = this.value.includes(item.value)));
|
|
164
|
-
}
|
|
165
|
-
focusItem(index) {
|
|
166
|
-
if (this.disabled) {
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
this.items.forEach((item) => item.shadowRoot
|
|
170
|
-
.querySelector('[role="option"]')
|
|
171
|
-
.removeAttribute("tabIndex"));
|
|
172
|
-
const item = this.items[index].shadowRoot.querySelector('[role="option"]');
|
|
173
|
-
if (!Boolean(item)) {
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
item.setAttribute("tabIndex", "0");
|
|
177
|
-
item.focus();
|
|
178
|
-
this.focusedItem = item;
|
|
179
|
-
}
|
|
180
|
-
focusNextItem() {
|
|
181
|
-
if (this.disabled) {
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
const activeItemIndex = this.getActiveItemIndex();
|
|
185
|
-
const newIndex = Math.min(activeItemIndex + 1, this.items.length - 1);
|
|
186
|
-
this.focusItem(newIndex);
|
|
187
|
-
}
|
|
188
|
-
focusPreviousItem() {
|
|
189
|
-
const activeItemIndex = this.getActiveItemIndex();
|
|
190
|
-
const newIndex = Math.max(activeItemIndex - 1, 0);
|
|
191
|
-
this.focusItem(newIndex);
|
|
192
|
-
}
|
|
193
|
-
getActiveItemIndex() {
|
|
194
|
-
return this.items
|
|
195
|
-
.map((item) => item.shadowRoot.querySelector('[role="option"]'))
|
|
196
|
-
.findIndex((item) => item === this.focusedItem);
|
|
197
|
-
}
|
|
198
|
-
render() {
|
|
199
|
-
const ariaMultiselectable = this.multiSelect ? "true" : undefined;
|
|
200
|
-
const tabIndex = this.disabled ? -1 : 0;
|
|
201
|
-
return (index.h(index.Host, null, index.h("div", { "aria-label": this.label, "aria-multiselectable": ariaMultiselectable, class: "option-list", id: this.optionListId, onClick: this.onClick, onFocus: this.onFocus, onKeyDown: this.onKeyDown, ref: (el) => (this.listboxEl = el), role: "listbox", tabIndex: tabIndex }, index.h("slot", null))));
|
|
202
|
-
}
|
|
203
|
-
get el() { return index.getElement(this); }
|
|
204
|
-
static get watchers() { return {
|
|
205
|
-
"disabled": ["watchDisabled"],
|
|
206
|
-
"multiSelect": ["watchMultiSelect"],
|
|
207
|
-
"value": ["watchValue"]
|
|
208
|
-
}; }
|
|
209
|
-
};
|
|
210
|
-
SwirlOptionList.style = swirlOptionListCss;
|
|
211
|
-
|
|
212
|
-
const swirlOptionListItemCss = ":host{display:inline-flex;width:100%}:host *{box-sizing:border-box}.option-list-item{display:inline-flex;width:100%;min-height:3rem;padding:var(--s-space-12) var(--s-space-16);align-items:center;background-color:var(--s-surface-overlay-default);cursor:pointer;gap:var(--s-space-12)}.option-list-item:hover:not(.option-list-item--disabled){background-color:var(--s-surface-overlay-hovered)}.option-list-item:active:not(.option-list-item--disabled){background-color:var(--s-surface-overlay-pressed)}.option-list-item:focus{outline:none}.option-list-item:focus-visible{background-color:var(--s-surface-overlay-hovered)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.option-list-item{min-height:0;padding:var(--s-space-8) var(--s-space-12);gap:var(--s-space-8)}}.option-list-item--selected .option-list-item__label{color:var(--s-text-highlight)}.option-list-item--selected .option-list-item__icon{color:var(--s-icon-highlight)}.option-list-item--selected .option-list-item__checkbox-box{border-color:var(--s-icon-highlight);color:var(--s-text-on-status);background-color:var(--s-icon-highlight)}.option-list-item--disabled{cursor:default}.option-list-item--disabled.option-list-item--selected .option-list-item__checkbox-box{background-color:var(--s-icon-disabled)}.option-list-item--disabled.option-list-item--selected .option-list-item__checkbox-icon{color:var(--s-text-on-status)}.option-list-item--disabled .option-list-item__label{color:var(--s-text-disabled)}.option-list-item--disabled .option-list-item__icon,.option-list-item--disabled .option-list-item__selection-icon,.option-list-item--disabled .option-list-item__checkbox-icon{color:var(--s-icon-disabled)}.option-list-item--disabled .option-list-item__checkbox-box{border-color:var(--s-icon-disabled);background-color:var(--s-surface-overlay-default)}.option-list-item__label{flex-grow:1;color:var(--s-text-default);font-size:var(--s-font-size-base);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-item__label{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.option-list-item__icon{display:inline-flex;flex-shrink:0;color:var(--s-icon-default)}.option-list-item__selection-icon{display:inline-flex;flex-shrink:0;color:var(--s-icon-highlight)}.option-list-item__checkbox{display:inline-flex;width:1.5rem;height:1.5rem;padding:var(--s-space-2)}.option-list-item__checkbox-box{display:inline-flex;width:100%;height:100%;justify-content:center;align-items:center;border:0.125rem solid var(--s-icon-default);border-radius:var(--s-border-radius-s)}.option-list-item__checkbox-icon{display:inline-flex}";
|
|
213
|
-
|
|
214
|
-
const SwirlOptionListItem = class {
|
|
215
|
-
constructor(hostRef) {
|
|
216
|
-
index.registerInstance(this, hostRef);
|
|
217
|
-
this.context = "single-select";
|
|
218
|
-
this.selected = false;
|
|
219
|
-
this.iconSize = 24;
|
|
220
|
-
this.desktopMediaQuery = utils.getDesktopMediaQuery();
|
|
221
|
-
this.desktopMediaQueryHandler = (event) => {
|
|
222
|
-
this.forceIconProps(event.matches);
|
|
223
|
-
this.updateIconSize(event.matches);
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
componentDidLoad() {
|
|
227
|
-
var _a, _b;
|
|
228
|
-
this.forceIconProps(this.desktopMediaQuery.matches);
|
|
229
|
-
this.updateIconSize(this.desktopMediaQuery.matches);
|
|
230
|
-
(_b = (_a = this.desktopMediaQuery).addEventListener) === null || _b === void 0 ? void 0 : _b.call(_a, "change", this.desktopMediaQueryHandler);
|
|
231
|
-
}
|
|
232
|
-
disconnectedCallback() {
|
|
233
|
-
var _a, _b;
|
|
234
|
-
(_b = (_a = this.desktopMediaQuery).removeEventListener) === null || _b === void 0 ? void 0 : _b.call(_a, "change", this.desktopMediaQueryHandler);
|
|
235
|
-
}
|
|
236
|
-
forceIconProps(smallIcon) {
|
|
237
|
-
var _a;
|
|
238
|
-
const icon = (_a = this.iconEl) === null || _a === void 0 ? void 0 : _a.children[0];
|
|
239
|
-
icon === null || icon === void 0 ? void 0 : icon.setAttribute("size", smallIcon ? "20" : "24");
|
|
240
|
-
}
|
|
241
|
-
updateIconSize(smallIcon) {
|
|
242
|
-
this.iconSize = smallIcon ? 20 : 24;
|
|
243
|
-
}
|
|
244
|
-
render() {
|
|
245
|
-
const ariaDisabled = this.disabled ? "true" : undefined;
|
|
246
|
-
const ariaSelected = String(this.selected);
|
|
247
|
-
const showCheckbox = this.context === "multi-select";
|
|
248
|
-
const showIcon = Boolean(this.icon) && this.context === "single-select";
|
|
249
|
-
const showSelectionIcon = this.selected && this.context === "single-select";
|
|
250
|
-
const className = index$1.classnames("option-list-item", `option-list-item--context-${this.context}`, {
|
|
251
|
-
"option-list-item--disabled": this.disabled,
|
|
252
|
-
"option-list-item--selected": this.selected,
|
|
253
|
-
});
|
|
254
|
-
return (index.h(index.Host, null, index.h("div", { "aria-disabled": ariaDisabled, "aria-selected": ariaSelected, class: className, part: "option-list-item", role: "option" }, showIcon && (index.h("span", { class: "option-list-item__icon", innerHTML: this.icon, ref: (el) => (this.iconEl = el) })), showCheckbox && (index.h("span", { class: "option-list-item__checkbox" }, index.h("span", { class: "option-list-item__checkbox-box" }, this.selected && (index.h("swirl-icon-check-strong", { class: "option-list-item__checkbox-icon", size: 16 }))))), index.h("span", { class: "option-list-item__label", part: "option-list-item__label" }, this.label), showSelectionIcon && (index.h("span", { class: "option-list-item__selection-icon" }, index.h("swirl-icon-check-small", { size: this.iconSize }))))));
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
SwirlOptionListItem.style = swirlOptionListItemCss;
|
|
258
|
-
|
|
259
|
-
exports.swirl_icon_check_small = SwirlIconCheckSmall;
|
|
260
|
-
exports.swirl_option_list = SwirlOptionList;
|
|
261
|
-
exports.swirl_option_list_item = SwirlOptionListItem;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2
|
-
|
|
3
|
-
function getDefaultExportFromCjs (x) {
|
|
4
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
function createCommonjsModule(fn, basedir, module) {
|
|
8
|
-
return module = {
|
|
9
|
-
path: basedir,
|
|
10
|
-
exports: {},
|
|
11
|
-
require: function (path, base) {
|
|
12
|
-
return commonjsRequire();
|
|
13
|
-
}
|
|
14
|
-
}, fn(module, module.exports), module.exports;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function getAugmentedNamespace(n) {
|
|
18
|
-
if (n.__esModule) return n;
|
|
19
|
-
var a = Object.defineProperty({}, '__esModule', {value: true});
|
|
20
|
-
Object.keys(n).forEach(function (k) {
|
|
21
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
22
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: function () {
|
|
25
|
-
return n[k];
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
return a;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function commonjsRequire () {
|
|
33
|
-
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export { commonjsGlobal as a, getAugmentedNamespace as b, createCommonjsModule as c, commonjsRequire as d, getDefaultExportFromCjs as g };
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, F as Fragment, c as createEvent, H as Host, g as getElement } from './index-5a3b2828.js';
|
|
2
|
-
import { c as classnames } from './index-c3028f7d.js';
|
|
3
|
-
import { q as querySelectorAllDeep, g as getDesktopMediaQuery } from './utils-7efaa1c6.js';
|
|
4
|
-
import './_commonjsHelpers-44457d8d.js';
|
|
5
|
-
|
|
6
|
-
const swirlIconCss = ":host{display:inline-flex}";
|
|
7
|
-
|
|
8
|
-
const SwirlIconCheckSmall = class {
|
|
9
|
-
constructor(hostRef) {
|
|
10
|
-
registerInstance(this, hostRef);
|
|
11
|
-
this.size = 24;
|
|
12
|
-
}
|
|
13
|
-
render() {
|
|
14
|
-
const viewBoxSize = this.size === 20 ? 24 : this.size;
|
|
15
|
-
const className = classnames("swirl-icon", `swirl-icon--size-${this.size}`);
|
|
16
|
-
return (h("svg", { class: className, fill: "none", height: this.size, part: "icon", viewBox: `0 0 ${viewBoxSize} ${viewBoxSize}`, width: this.size, xmlns: "http://www.w3.org/2000/svg" }, this.size === 16 && (h(Fragment, null, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M12.4142 4.91924C12.8047 5.30976 12.8047 5.94293 12.4142 6.33345L7.08086 11.6667C6.69033 12.0572 6.05717 12.0572 5.66664 11.6667L3.70711 9.70707C3.31658 9.31655 3.31658 8.68338 3.70711 8.29286C4.09763 7.90233 4.7308 7.90233 5.12132 8.29286L6.37375 9.54539L11 4.91924C11.3905 4.52871 12.0237 4.52871 12.4142 4.91924Z", fill: "currentColor" }))), (this.size === 20 || this.size === 24) && (h(Fragment, null, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M18.6213 7.37879C19.2071 7.96458 19.2071 8.91433 18.6213 9.50011L10.6213 17.5C10.0355 18.0858 9.08577 18.0858 8.49998 17.5L5.56068 14.5605C4.97489 13.9748 4.97489 13.025 5.56068 12.4392C6.14646 11.8534 7.09621 11.8534 7.682 12.4392L9.56064 14.318L16.5 7.37879C17.0858 6.79301 18.0355 6.79301 18.6213 7.37879Z", fill: "currentColor" }))), this.size === 28 && (h(Fragment, null, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M21.7248 8.60863C22.4083 9.29205 22.4083 10.4001 21.7248 11.0835L12.3915 20.4167C11.7081 21.1001 10.6001 21.1001 9.91663 20.4167L6.48744 16.9873C5.80403 16.3039 5.80403 15.1959 6.48744 14.5125C7.17086 13.8291 8.2789 13.8291 8.96232 14.5125L11.1541 16.7044L19.25 8.60863C19.9334 7.92521 21.0414 7.92521 21.7248 8.60863Z", fill: "currentColor" })))));
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
SwirlIconCheckSmall.style = swirlIconCss;
|
|
20
|
-
|
|
21
|
-
const swirlOptionListCss = ".sc-swirl-option-list-h{display:block}.sc-swirl-option-list-h *.sc-swirl-option-list{box-sizing:border-box}";
|
|
22
|
-
|
|
23
|
-
const SwirlOptionList = class {
|
|
24
|
-
constructor(hostRef) {
|
|
25
|
-
registerInstance(this, hostRef);
|
|
26
|
-
this.valueChange = createEvent(this, "valueChange", 7);
|
|
27
|
-
this.value = [];
|
|
28
|
-
this.onFocus = () => {
|
|
29
|
-
if (Boolean(this.focusedItem)) {
|
|
30
|
-
this.focusItem(this.getActiveItemIndex());
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
this.focusItem(0);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
this.onClick = (event) => {
|
|
37
|
-
event.preventDefault();
|
|
38
|
-
const target = event.target;
|
|
39
|
-
const item = target === null || target === void 0 ? void 0 : target.closest("swirl-option-list-item");
|
|
40
|
-
if (!Boolean(item)) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
this.selectItem(this.items.findIndex((i) => i.value === item.value));
|
|
44
|
-
};
|
|
45
|
-
this.onKeyDown = (event) => {
|
|
46
|
-
if (event.code === "ArrowDown") {
|
|
47
|
-
event.preventDefault();
|
|
48
|
-
this.focusNextItem();
|
|
49
|
-
}
|
|
50
|
-
else if (event.code === "ArrowUp") {
|
|
51
|
-
event.preventDefault();
|
|
52
|
-
this.focusPreviousItem();
|
|
53
|
-
}
|
|
54
|
-
else if (event.code === "Space" || event.code === "Enter") {
|
|
55
|
-
event.preventDefault();
|
|
56
|
-
this.selectFocusedItem();
|
|
57
|
-
}
|
|
58
|
-
else if (event.code === "Home") {
|
|
59
|
-
event.preventDefault();
|
|
60
|
-
this.focusItem(0);
|
|
61
|
-
}
|
|
62
|
-
else if (event.code === "End") {
|
|
63
|
-
event.preventDefault();
|
|
64
|
-
this.focusItem(this.items.length - 1);
|
|
65
|
-
}
|
|
66
|
-
else if (event.code === "KeyA" &&
|
|
67
|
-
(event.metaKey || event.ctrlKey) &&
|
|
68
|
-
this.multiSelect) {
|
|
69
|
-
event.preventDefault();
|
|
70
|
-
this.selectAllItems();
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
componentDidLoad() {
|
|
75
|
-
this.updateItems();
|
|
76
|
-
this.observeSlotChanges();
|
|
77
|
-
this.setItemDisabledState();
|
|
78
|
-
this.setItemContext();
|
|
79
|
-
this.syncItemsWithValue();
|
|
80
|
-
}
|
|
81
|
-
disconnectedCallback() {
|
|
82
|
-
var _a;
|
|
83
|
-
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
84
|
-
}
|
|
85
|
-
watchDisabled() {
|
|
86
|
-
this.setItemDisabledState();
|
|
87
|
-
}
|
|
88
|
-
watchMultiSelect() {
|
|
89
|
-
this.setItemContext();
|
|
90
|
-
}
|
|
91
|
-
watchValue() {
|
|
92
|
-
this.syncItemsWithValue();
|
|
93
|
-
}
|
|
94
|
-
observeSlotChanges() {
|
|
95
|
-
this.observer = new MutationObserver(() => {
|
|
96
|
-
this.updateItems();
|
|
97
|
-
});
|
|
98
|
-
this.observer.observe(this.listboxEl, { childList: true });
|
|
99
|
-
}
|
|
100
|
-
updateItems() {
|
|
101
|
-
this.items = querySelectorAllDeep(this.el, "swirl-option-list-item");
|
|
102
|
-
}
|
|
103
|
-
setItemDisabledState() {
|
|
104
|
-
this.items.forEach((item) => (item.disabled = this.disabled));
|
|
105
|
-
}
|
|
106
|
-
setItemContext() {
|
|
107
|
-
if (this.multiSelect) {
|
|
108
|
-
this.items.forEach((item) => (item.context = "multi-select"));
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
this.items.forEach((item) => (item.context = "single-select"));
|
|
112
|
-
if (this.value.length > 1) {
|
|
113
|
-
this.updateValue([this.value[0]]);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
selectItem(index) {
|
|
118
|
-
if (this.disabled) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
const item = this.items[index];
|
|
122
|
-
if (item.disabled) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
const itemIsAlreadySelected = this.value.includes(item.value);
|
|
126
|
-
if (!this.multiSelect) {
|
|
127
|
-
this.value = [];
|
|
128
|
-
}
|
|
129
|
-
if (!itemIsAlreadySelected) {
|
|
130
|
-
this.updateValue([...this.value, item.value]);
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
this.updateValue(this.value.filter((v) => v !== item.value));
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
updateValue(value) {
|
|
137
|
-
this.value = value;
|
|
138
|
-
this.valueChange.emit(this.value);
|
|
139
|
-
}
|
|
140
|
-
selectFocusedItem() {
|
|
141
|
-
if (this.disabled || this.getActiveItemIndex() === -1) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
this.selectItem(this.getActiveItemIndex());
|
|
145
|
-
}
|
|
146
|
-
selectAllItems() {
|
|
147
|
-
if (this.disabled) {
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
const alreadySelected = this.items.every((item) => this.value.includes(item.value));
|
|
151
|
-
if (alreadySelected) {
|
|
152
|
-
this.updateValue([]);
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
this.updateValue(this.items.map((item) => item.value));
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
syncItemsWithValue() {
|
|
159
|
-
this.items.forEach((item) => (item.selected = this.value.includes(item.value)));
|
|
160
|
-
}
|
|
161
|
-
focusItem(index) {
|
|
162
|
-
if (this.disabled) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
this.items.forEach((item) => item.shadowRoot
|
|
166
|
-
.querySelector('[role="option"]')
|
|
167
|
-
.removeAttribute("tabIndex"));
|
|
168
|
-
const item = this.items[index].shadowRoot.querySelector('[role="option"]');
|
|
169
|
-
if (!Boolean(item)) {
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
item.setAttribute("tabIndex", "0");
|
|
173
|
-
item.focus();
|
|
174
|
-
this.focusedItem = item;
|
|
175
|
-
}
|
|
176
|
-
focusNextItem() {
|
|
177
|
-
if (this.disabled) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
const activeItemIndex = this.getActiveItemIndex();
|
|
181
|
-
const newIndex = Math.min(activeItemIndex + 1, this.items.length - 1);
|
|
182
|
-
this.focusItem(newIndex);
|
|
183
|
-
}
|
|
184
|
-
focusPreviousItem() {
|
|
185
|
-
const activeItemIndex = this.getActiveItemIndex();
|
|
186
|
-
const newIndex = Math.max(activeItemIndex - 1, 0);
|
|
187
|
-
this.focusItem(newIndex);
|
|
188
|
-
}
|
|
189
|
-
getActiveItemIndex() {
|
|
190
|
-
return this.items
|
|
191
|
-
.map((item) => item.shadowRoot.querySelector('[role="option"]'))
|
|
192
|
-
.findIndex((item) => item === this.focusedItem);
|
|
193
|
-
}
|
|
194
|
-
render() {
|
|
195
|
-
const ariaMultiselectable = this.multiSelect ? "true" : undefined;
|
|
196
|
-
const tabIndex = this.disabled ? -1 : 0;
|
|
197
|
-
return (h(Host, null, h("div", { "aria-label": this.label, "aria-multiselectable": ariaMultiselectable, class: "option-list", id: this.optionListId, onClick: this.onClick, onFocus: this.onFocus, onKeyDown: this.onKeyDown, ref: (el) => (this.listboxEl = el), role: "listbox", tabIndex: tabIndex }, h("slot", null))));
|
|
198
|
-
}
|
|
199
|
-
get el() { return getElement(this); }
|
|
200
|
-
static get watchers() { return {
|
|
201
|
-
"disabled": ["watchDisabled"],
|
|
202
|
-
"multiSelect": ["watchMultiSelect"],
|
|
203
|
-
"value": ["watchValue"]
|
|
204
|
-
}; }
|
|
205
|
-
};
|
|
206
|
-
SwirlOptionList.style = swirlOptionListCss;
|
|
207
|
-
|
|
208
|
-
const swirlOptionListItemCss = ":host{display:inline-flex;width:100%}:host *{box-sizing:border-box}.option-list-item{display:inline-flex;width:100%;min-height:3rem;padding:var(--s-space-12) var(--s-space-16);align-items:center;background-color:var(--s-surface-overlay-default);cursor:pointer;gap:var(--s-space-12)}.option-list-item:hover:not(.option-list-item--disabled){background-color:var(--s-surface-overlay-hovered)}.option-list-item:active:not(.option-list-item--disabled){background-color:var(--s-surface-overlay-pressed)}.option-list-item:focus{outline:none}.option-list-item:focus-visible{background-color:var(--s-surface-overlay-hovered)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.option-list-item{min-height:0;padding:var(--s-space-8) var(--s-space-12);gap:var(--s-space-8)}}.option-list-item--selected .option-list-item__label{color:var(--s-text-highlight)}.option-list-item--selected .option-list-item__icon{color:var(--s-icon-highlight)}.option-list-item--selected .option-list-item__checkbox-box{border-color:var(--s-icon-highlight);color:var(--s-text-on-status);background-color:var(--s-icon-highlight)}.option-list-item--disabled{cursor:default}.option-list-item--disabled.option-list-item--selected .option-list-item__checkbox-box{background-color:var(--s-icon-disabled)}.option-list-item--disabled.option-list-item--selected .option-list-item__checkbox-icon{color:var(--s-text-on-status)}.option-list-item--disabled .option-list-item__label{color:var(--s-text-disabled)}.option-list-item--disabled .option-list-item__icon,.option-list-item--disabled .option-list-item__selection-icon,.option-list-item--disabled .option-list-item__checkbox-icon{color:var(--s-icon-disabled)}.option-list-item--disabled .option-list-item__checkbox-box{border-color:var(--s-icon-disabled);background-color:var(--s-surface-overlay-default)}.option-list-item__label{flex-grow:1;color:var(--s-text-default);font-size:var(--s-font-size-base);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-item__label{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.option-list-item__icon{display:inline-flex;flex-shrink:0;color:var(--s-icon-default)}.option-list-item__selection-icon{display:inline-flex;flex-shrink:0;color:var(--s-icon-highlight)}.option-list-item__checkbox{display:inline-flex;width:1.5rem;height:1.5rem;padding:var(--s-space-2)}.option-list-item__checkbox-box{display:inline-flex;width:100%;height:100%;justify-content:center;align-items:center;border:0.125rem solid var(--s-icon-default);border-radius:var(--s-border-radius-s)}.option-list-item__checkbox-icon{display:inline-flex}";
|
|
209
|
-
|
|
210
|
-
const SwirlOptionListItem = class {
|
|
211
|
-
constructor(hostRef) {
|
|
212
|
-
registerInstance(this, hostRef);
|
|
213
|
-
this.context = "single-select";
|
|
214
|
-
this.selected = false;
|
|
215
|
-
this.iconSize = 24;
|
|
216
|
-
this.desktopMediaQuery = getDesktopMediaQuery();
|
|
217
|
-
this.desktopMediaQueryHandler = (event) => {
|
|
218
|
-
this.forceIconProps(event.matches);
|
|
219
|
-
this.updateIconSize(event.matches);
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
componentDidLoad() {
|
|
223
|
-
var _a, _b;
|
|
224
|
-
this.forceIconProps(this.desktopMediaQuery.matches);
|
|
225
|
-
this.updateIconSize(this.desktopMediaQuery.matches);
|
|
226
|
-
(_b = (_a = this.desktopMediaQuery).addEventListener) === null || _b === void 0 ? void 0 : _b.call(_a, "change", this.desktopMediaQueryHandler);
|
|
227
|
-
}
|
|
228
|
-
disconnectedCallback() {
|
|
229
|
-
var _a, _b;
|
|
230
|
-
(_b = (_a = this.desktopMediaQuery).removeEventListener) === null || _b === void 0 ? void 0 : _b.call(_a, "change", this.desktopMediaQueryHandler);
|
|
231
|
-
}
|
|
232
|
-
forceIconProps(smallIcon) {
|
|
233
|
-
var _a;
|
|
234
|
-
const icon = (_a = this.iconEl) === null || _a === void 0 ? void 0 : _a.children[0];
|
|
235
|
-
icon === null || icon === void 0 ? void 0 : icon.setAttribute("size", smallIcon ? "20" : "24");
|
|
236
|
-
}
|
|
237
|
-
updateIconSize(smallIcon) {
|
|
238
|
-
this.iconSize = smallIcon ? 20 : 24;
|
|
239
|
-
}
|
|
240
|
-
render() {
|
|
241
|
-
const ariaDisabled = this.disabled ? "true" : undefined;
|
|
242
|
-
const ariaSelected = String(this.selected);
|
|
243
|
-
const showCheckbox = this.context === "multi-select";
|
|
244
|
-
const showIcon = Boolean(this.icon) && this.context === "single-select";
|
|
245
|
-
const showSelectionIcon = this.selected && this.context === "single-select";
|
|
246
|
-
const className = classnames("option-list-item", `option-list-item--context-${this.context}`, {
|
|
247
|
-
"option-list-item--disabled": this.disabled,
|
|
248
|
-
"option-list-item--selected": this.selected,
|
|
249
|
-
});
|
|
250
|
-
return (h(Host, null, h("div", { "aria-disabled": ariaDisabled, "aria-selected": ariaSelected, class: className, part: "option-list-item", role: "option" }, showIcon && (h("span", { class: "option-list-item__icon", innerHTML: this.icon, ref: (el) => (this.iconEl = el) })), showCheckbox && (h("span", { class: "option-list-item__checkbox" }, h("span", { class: "option-list-item__checkbox-box" }, this.selected && (h("swirl-icon-check-strong", { class: "option-list-item__checkbox-icon", size: 16 }))))), h("span", { class: "option-list-item__label", part: "option-list-item__label" }, this.label), showSelectionIcon && (h("span", { class: "option-list-item__selection-icon" }, h("swirl-icon-check-small", { size: this.iconSize }))))));
|
|
251
|
-
}
|
|
252
|
-
};
|
|
253
|
-
SwirlOptionListItem.style = swirlOptionListItemCss;
|
|
254
|
-
|
|
255
|
-
export { SwirlIconCheckSmall as swirl_icon_check_small, SwirlOptionList as swirl_option_list, SwirlOptionListItem as swirl_option_list_item };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,h as t,F as s,c as e,H as o,g as l}from"./p-9fe00e8a.js";import{c as n}from"./p-d3d722dc.js";import{q as h,g as r}from"./p-d97d183f.js";import"./p-86bd3473.js";const a=class{constructor(t){i(this,t),this.size=24}render(){const i=20===this.size?24:this.size,e=n("swirl-icon",`swirl-icon--size-${this.size}`);return t("svg",{class:e,fill:"none",height:this.size,part:"icon",viewBox:`0 0 ${i} ${i}`,width:this.size,xmlns:"http://www.w3.org/2000/svg"},16===this.size&&t(s,null,t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.4142 4.91924C12.8047 5.30976 12.8047 5.94293 12.4142 6.33345L7.08086 11.6667C6.69033 12.0572 6.05717 12.0572 5.66664 11.6667L3.70711 9.70707C3.31658 9.31655 3.31658 8.68338 3.70711 8.29286C4.09763 7.90233 4.7308 7.90233 5.12132 8.29286L6.37375 9.54539L11 4.91924C11.3905 4.52871 12.0237 4.52871 12.4142 4.91924Z",fill:"currentColor"})),(20===this.size||24===this.size)&&t(s,null,t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18.6213 7.37879C19.2071 7.96458 19.2071 8.91433 18.6213 9.50011L10.6213 17.5C10.0355 18.0858 9.08577 18.0858 8.49998 17.5L5.56068 14.5605C4.97489 13.9748 4.97489 13.025 5.56068 12.4392C6.14646 11.8534 7.09621 11.8534 7.682 12.4392L9.56064 14.318L16.5 7.37879C17.0858 6.79301 18.0355 6.79301 18.6213 7.37879Z",fill:"currentColor"})),28===this.size&&t(s,null,t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M21.7248 8.60863C22.4083 9.29205 22.4083 10.4001 21.7248 11.0835L12.3915 20.4167C11.7081 21.1001 10.6001 21.1001 9.91663 20.4167L6.48744 16.9873C5.80403 16.3039 5.80403 15.1959 6.48744 14.5125C7.17086 13.8291 8.2789 13.8291 8.96232 14.5125L11.1541 16.7044L19.25 8.60863C19.9334 7.92521 21.0414 7.92521 21.7248 8.60863Z",fill:"currentColor"})))}};a.style=":host{display:inline-flex}";const c=class{constructor(t){i(this,t),this.valueChange=e(this,"valueChange",7),this.value=[],this.onFocus=()=>{Boolean(this.focusedItem)?this.focusItem(this.getActiveItemIndex()):this.focusItem(0)},this.onClick=i=>{i.preventDefault();const t=i.target,s=null==t?void 0:t.closest("swirl-option-list-item");Boolean(s)&&this.selectItem(this.items.findIndex((i=>i.value===s.value)))},this.onKeyDown=i=>{"ArrowDown"===i.code?(i.preventDefault(),this.focusNextItem()):"ArrowUp"===i.code?(i.preventDefault(),this.focusPreviousItem()):"Space"===i.code||"Enter"===i.code?(i.preventDefault(),this.selectFocusedItem()):"Home"===i.code?(i.preventDefault(),this.focusItem(0)):"End"===i.code?(i.preventDefault(),this.focusItem(this.items.length-1)):"KeyA"===i.code&&(i.metaKey||i.ctrlKey)&&this.multiSelect&&(i.preventDefault(),this.selectAllItems())}}componentDidLoad(){this.updateItems(),this.observeSlotChanges(),this.setItemDisabledState(),this.setItemContext(),this.syncItemsWithValue()}disconnectedCallback(){var i;null===(i=this.observer)||void 0===i||i.disconnect()}watchDisabled(){this.setItemDisabledState()}watchMultiSelect(){this.setItemContext()}watchValue(){this.syncItemsWithValue()}observeSlotChanges(){this.observer=new MutationObserver((()=>{this.updateItems()})),this.observer.observe(this.listboxEl,{childList:!0})}updateItems(){this.items=h(this.el,"swirl-option-list-item")}setItemDisabledState(){this.items.forEach((i=>i.disabled=this.disabled))}setItemContext(){this.multiSelect?this.items.forEach((i=>i.context="multi-select")):(this.items.forEach((i=>i.context="single-select")),this.value.length>1&&this.updateValue([this.value[0]]))}selectItem(i){if(this.disabled)return;const t=this.items[i];if(t.disabled)return;const s=this.value.includes(t.value);this.multiSelect||(this.value=[]),this.updateValue(s?this.value.filter((i=>i!==t.value)):[...this.value,t.value])}updateValue(i){this.value=i,this.valueChange.emit(this.value)}selectFocusedItem(){this.disabled||-1===this.getActiveItemIndex()||this.selectItem(this.getActiveItemIndex())}selectAllItems(){if(this.disabled)return;const i=this.items.every((i=>this.value.includes(i.value)));this.updateValue(i?[]:this.items.map((i=>i.value)))}syncItemsWithValue(){this.items.forEach((i=>i.selected=this.value.includes(i.value)))}focusItem(i){if(this.disabled)return;this.items.forEach((i=>i.shadowRoot.querySelector('[role="option"]').removeAttribute("tabIndex")));const t=this.items[i].shadowRoot.querySelector('[role="option"]');Boolean(t)&&(t.setAttribute("tabIndex","0"),t.focus(),this.focusedItem=t)}focusNextItem(){if(this.disabled)return;const i=this.getActiveItemIndex(),t=Math.min(i+1,this.items.length-1);this.focusItem(t)}focusPreviousItem(){const i=this.getActiveItemIndex(),t=Math.max(i-1,0);this.focusItem(t)}getActiveItemIndex(){return this.items.map((i=>i.shadowRoot.querySelector('[role="option"]'))).findIndex((i=>i===this.focusedItem))}render(){return t(o,null,t("div",{"aria-label":this.label,"aria-multiselectable":this.multiSelect?"true":void 0,class:"option-list",id:this.optionListId,onClick:this.onClick,onFocus:this.onFocus,onKeyDown:this.onKeyDown,ref:i=>this.listboxEl=i,role:"listbox",tabIndex:this.disabled?-1:0},t("slot",null)))}get el(){return l(this)}static get watchers(){return{disabled:["watchDisabled"],multiSelect:["watchMultiSelect"],value:["watchValue"]}}};c.style=".sc-swirl-option-list-h{display:block}.sc-swirl-option-list-h *.sc-swirl-option-list{box-sizing:border-box}";const d=class{constructor(t){i(this,t),this.context="single-select",this.selected=!1,this.iconSize=24,this.desktopMediaQuery=r(),this.desktopMediaQueryHandler=i=>{this.forceIconProps(i.matches),this.updateIconSize(i.matches)}}componentDidLoad(){var i,t;this.forceIconProps(this.desktopMediaQuery.matches),this.updateIconSize(this.desktopMediaQuery.matches),null===(t=(i=this.desktopMediaQuery).addEventListener)||void 0===t||t.call(i,"change",this.desktopMediaQueryHandler)}disconnectedCallback(){var i,t;null===(t=(i=this.desktopMediaQuery).removeEventListener)||void 0===t||t.call(i,"change",this.desktopMediaQueryHandler)}forceIconProps(i){var t;const s=null===(t=this.iconEl)||void 0===t?void 0:t.children[0];null==s||s.setAttribute("size",i?"20":"24")}updateIconSize(i){this.iconSize=i?20:24}render(){const i=this.disabled?"true":void 0,s=String(this.selected),e="multi-select"===this.context,l=Boolean(this.icon)&&"single-select"===this.context,h=this.selected&&"single-select"===this.context,r=n("option-list-item",`option-list-item--context-${this.context}`,{"option-list-item--disabled":this.disabled,"option-list-item--selected":this.selected});return t(o,null,t("div",{"aria-disabled":i,"aria-selected":s,class:r,part:"option-list-item",role:"option"},l&&t("span",{class:"option-list-item__icon",innerHTML:this.icon,ref:i=>this.iconEl=i}),e&&t("span",{class:"option-list-item__checkbox"},t("span",{class:"option-list-item__checkbox-box"},this.selected&&t("swirl-icon-check-strong",{class:"option-list-item__checkbox-icon",size:16}))),t("span",{class:"option-list-item__label",part:"option-list-item__label"},this.label),h&&t("span",{class:"option-list-item__selection-icon"},t("swirl-icon-check-small",{size:this.iconSize}))))}};d.style=":host{display:inline-flex;width:100%}:host *{box-sizing:border-box}.option-list-item{display:inline-flex;width:100%;min-height:3rem;padding:var(--s-space-12) var(--s-space-16);align-items:center;background-color:var(--s-surface-overlay-default);cursor:pointer;gap:var(--s-space-12)}.option-list-item:hover:not(.option-list-item--disabled){background-color:var(--s-surface-overlay-hovered)}.option-list-item:active:not(.option-list-item--disabled){background-color:var(--s-surface-overlay-pressed)}.option-list-item:focus{outline:none}.option-list-item:focus-visible{background-color:var(--s-surface-overlay-hovered)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.option-list-item{min-height:0;padding:var(--s-space-8) var(--s-space-12);gap:var(--s-space-8)}}.option-list-item--selected .option-list-item__label{color:var(--s-text-highlight)}.option-list-item--selected .option-list-item__icon{color:var(--s-icon-highlight)}.option-list-item--selected .option-list-item__checkbox-box{border-color:var(--s-icon-highlight);color:var(--s-text-on-status);background-color:var(--s-icon-highlight)}.option-list-item--disabled{cursor:default}.option-list-item--disabled.option-list-item--selected .option-list-item__checkbox-box{background-color:var(--s-icon-disabled)}.option-list-item--disabled.option-list-item--selected .option-list-item__checkbox-icon{color:var(--s-text-on-status)}.option-list-item--disabled .option-list-item__label{color:var(--s-text-disabled)}.option-list-item--disabled .option-list-item__icon,.option-list-item--disabled .option-list-item__selection-icon,.option-list-item--disabled .option-list-item__checkbox-icon{color:var(--s-icon-disabled)}.option-list-item--disabled .option-list-item__checkbox-box{border-color:var(--s-icon-disabled);background-color:var(--s-surface-overlay-default)}.option-list-item__label{flex-grow:1;color:var(--s-text-default);font-size:var(--s-font-size-base);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-item__label{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.option-list-item__icon{display:inline-flex;flex-shrink:0;color:var(--s-icon-default)}.option-list-item__selection-icon{display:inline-flex;flex-shrink:0;color:var(--s-icon-highlight)}.option-list-item__checkbox{display:inline-flex;width:1.5rem;height:1.5rem;padding:var(--s-space-2)}.option-list-item__checkbox-box{display:inline-flex;width:100%;height:100%;justify-content:center;align-items:center;border:0.125rem solid var(--s-icon-default);border-radius:var(--s-border-radius-s)}.option-list-item__checkbox-icon{display:inline-flex}";export{a as swirl_icon_check_small,c as swirl_option_list,d as swirl_option_list_item}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,H as e,g as o}from"./p-9fe00e8a.js";import{a,c as l,o as h}from"./p-e8bb09e8.js";import{c as n}from"./p-d3d722dc.js";import{d as r}from"./p-d97d183f.js";import"./p-86bd3473.js";const c=class{constructor(i){t(this,i),this.valueChange=s(this,"valueChange",7),this.clearable=!0,this.clearButtonLabel="Clear input",this.generateSuggestions=async()=>[],this.menuLabel="Suggestions",this.active=!1,this.loading=!1,this.suggestions=[],this.onChange=r((async t=>{this.value=t.detail,this.valueChange.emit(this.value),this.updateSuggestions(),this.open()}),250,!1),this.onSelect=t=>{var s;Boolean(t.detail[0])&&(this.value=t.detail[0],this.valueChange.emit(this.value)),null===(s=this.inputEl.querySelector("input"))||void 0===s||s.focus(),this.close()},this.onFocusOut=t=>{const s=t.relatedTarget;Boolean(s)&&!this.el.contains(s)&&this.close()},this.onFocus=()=>{this.updateSuggestions(),this.open()},this.onKeyDown=t=>{"Escape"===t.code&&(t.preventDefault(),this.inputEl.querySelector("input").focus(),this.close())},this.onInputKeyDown=t=>{"ArrowDown"===t.code&&(t.preventDefault(),this.listboxEl.querySelector('[role="listbox"]').focus())}}componentWillLoad(){const t=document.querySelectorAll("swirl-datepicker").length;this.id=`autocomplete-${t}`}onWindowClick(t){this.el.contains(t.target)||this.close()}async close(){this.active&&(this.disableAutoUpdate&&this.disableAutoUpdate(),this.active=!1)}async open(){this.active||(this.active=!0,requestAnimationFrame((async()=>{await this.reposition(),this.disableAutoUpdate&&this.disableAutoUpdate(),this.disableAutoUpdate=a(this.inputEl,this.listboxContainerEl,this.reposition.bind(this)),this.listboxContainerEl.scrollTop=0})))}async reposition(){Boolean(this.listboxContainerEl)&&(this.position=await l(this.inputEl,this.listboxContainerEl,{middleware:[h({crossAxis:-16,mainAxis:16})],placement:"bottom-start",strategy:"fixed"}))}async updateSuggestions(){this.loading=!0,this.suggestions=[],this.suggestions=await this.generateSuggestions(this.value),this.loading=!1}render(){var t,s,o;const a=`${this.id}-suggestions`,l=n("autocomplete",{"autocomplete--inactive":!this.active});return i(e,null,i("div",{class:l,onFocusout:this.onFocusOut,onKeyDown:this.onKeyDown},i("swirl-text-input",{autoSelect:this.autoSelect,class:"autocomplete__input",clearable:this.clearable,clearButtonLabel:this.clearButtonLabel,disabled:this.disabled,disableDynamicWidth:!0,swirlAriaAutocomplete:"list",swirlAriaControls:a,swirlAriaDescribedby:this.swirlAriaDescribedby,swirlAriaExpanded:String(this.active),swirlRole:"combobox",id:this.id,invalid:this.invalid,onInputFocus:this.onFocus,onKeyDown:this.onInputKeyDown,onValueChange:this.onChange,maxLength:this.maxLength,mode:this.mode,ref:t=>this.inputEl=t,required:this.required,spellCheck:this.spellCheck,value:this.value}),i("div",{class:"autocomplete__listbox-container",ref:t=>this.listboxContainerEl=t,style:{top:Boolean(this.position)?`${null===(t=this.position)||void 0===t?void 0:t.y}px`:"",left:Boolean(this.position)?`${null===(s=this.position)||void 0===s?void 0:s.x}px`:"",width:`${(null===(o=this.inputEl)||void 0===o?void 0:o.getBoundingClientRect().width)+32}px`}},this.loading&&i("div",{class:"autocomplete__spinner"},i("swirl-spinner",null)),this.suggestions.length>0&&i("swirl-option-list",{label:this.menuLabel,onValueChange:this.onSelect,optionListId:a,ref:t=>this.listboxEl=t,value:[this.value]},this.suggestions.map((t=>i("swirl-option-list-item",{selected:this.value===t.label,key:t.id,disabled:t.disabled,label:t.label,value:t.label})))))))}get el(){return o(this)}};c.style=".sc-swirl-autocomplete-h{display:block}.sc-swirl-autocomplete-h *.sc-swirl-autocomplete{box-sizing:border-box}.autocomplete--inactive.sc-swirl-autocomplete .autocomplete__listbox-container.sc-swirl-autocomplete{display:none}.autocomplete__listbox-container.sc-swirl-autocomplete{position:fixed;z-index:var(--s-z-40);overflow:hidden;padding-top:var(--s-space-8);padding-bottom:var(--s-space-8);border-radius:var(--s-border-radius-sm);background-color:var(--s-surface-overlay-default);box-shadow:var(--s-shadow-level-1)}.autocomplete__listbox-container.sc-swirl-autocomplete:empty{display:none}.autocomplete__spinner.sc-swirl-autocomplete{display:flex;padding:var(--s-space-16);justify-content:center;align-items:center}";export{c as swirl_autocomplete}
|