@webority/ui-elements 0.165.0 → 0.168.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/dist/WuiCarousel-CRx2-eKV.js +1 -0
- package/dist/WuiCodeBlock-DTckR_z3.js +1 -0
- package/dist/WuiCommandPalette-CSzl5yGf.js +2 -0
- package/dist/WuiCommentThread-AYovTYSA.js +1 -0
- package/dist/WuiConsentBanner-CWvXnwBH.js +1 -0
- package/dist/WuiContextMenu-CyejQsef.js +1 -0
- package/dist/WuiDataTable-BniN81KC.js +1 -0
- package/dist/WuiDatePicker-q0s8tL_E.js +31 -0
- package/dist/WuiDateRange-p2r5A9CY.js +25 -0
- package/dist/WuiDrawer-CQ7nRHUD.js +1 -0
- package/dist/{WuiDropdown-CeiMaiwi.js → WuiDropdown-BQC04Q48.js} +1 -1
- package/dist/WuiEntryGrid-DPAYNu1v.js +3 -0
- package/dist/{WuiHoverCard-AAXID-P3.js → WuiHoverCard-DRZh88zM.js} +1 -1
- package/dist/WuiImageCrop-BTY59Qsm.js +17 -0
- package/dist/WuiInlineEdit-CEjs5Ruk.js +1 -0
- package/dist/WuiLeadPopup-L9UCTVA5.js +382 -0
- package/dist/WuiLightbox-DDQAOabU.js +1 -0
- package/dist/WuiMentionInput-CkhrCz_2.js +1 -0
- package/dist/{WuiModal-Bz2Xg161.js → WuiModal-BRILsSMq.js} +1 -1
- package/dist/{WuiNavigationMenu-Dybw-nMb.js → WuiNavigationMenu-BCnqv7e-.js} +1 -1
- package/dist/WuiNotificationCenter-BCXT3Y7m.js +1 -0
- package/dist/WuiOrgTree-5v0vqPVk.js +1 -0
- package/dist/WuiOverflow-DtetLQHW.js +1 -0
- package/dist/WuiPhone-B6jgFRSi.js +16 -0
- package/dist/{WuiPopover-y_Vxm64z.js → WuiPopover-BzVxNSs1.js} +1 -1
- package/dist/WuiRecordPager-Dye7AfCS.js +1 -0
- package/dist/{WuiRelativeTime-CmlKD-97.js → WuiRelativeTime-DTGKGHbK.js} +1 -1
- package/dist/WuiSavedViews-BsAyuOzX.js +1 -0
- package/dist/WuiSelect-CMHoPHlx.js +9 -0
- package/dist/WuiShortcuts-DSjwaZx7.js +1 -0
- package/dist/WuiShowMore-CGhWrlmK.js +1 -0
- package/dist/WuiSlider-J9YPWu9e.js +51 -0
- package/dist/WuiSortable-BfOm57Mj.js +1 -0
- package/dist/WuiTimePicker-C5XouoR7.js +9 -0
- package/dist/WuiTour-BDOGWyNA.js +1 -0
- package/dist/WuiTree-CeYbyaCx.js +1 -0
- package/dist/{WuiWhatsNew-BdsS6MzB.js → WuiWhatsNew-DOo54GiH.js} +1 -1
- package/dist/WuiWizardStep-Ce6O_8oc.js +1 -0
- package/dist/calendarMath-CFjBxJYM.js +1 -0
- package/dist/carousel.g-Bw_pFDzc.js +1 -0
- package/dist/chips-CemguTKJ.js +2 -0
- package/dist/codeBlock.g-BCF2IlK-.js +1 -0
- package/dist/commandPalette.g-DFWnCufa.js +1 -0
- package/dist/commentText-NWsssKvj.js +1 -0
- package/dist/consentBanner.g-CZAb1BLJ.js +1 -0
- package/dist/country-B7jmc--B.js +1 -0
- package/dist/customRule-BXJdj57A.js +1 -0
- package/dist/customRule.g-Cfkl3_ZC.js +1 -0
- package/dist/dataTable-CKz4Oncc.js +1 -0
- package/dist/dataTable.g-BVxhub_d.js +1 -0
- package/dist/datePicker.g-CT9FBY21.js +1 -0
- package/dist/dateRangePicker.g-Pnc37vgX.js +1 -0
- package/dist/drawer.g-B-zYKBfQ.js +1 -0
- package/dist/drawerDiscard-BjykHS_G.js +1 -0
- package/dist/elements/carousel.js +1 -1
- package/dist/elements/code-block.js +1 -1
- package/dist/elements/command-palette.js +1 -1
- package/dist/elements/comment-thread.js +1 -1
- package/dist/elements/consent-banner.js +1 -1
- package/dist/elements/context-menu.js +1 -1
- package/dist/elements/data-table.js +1 -1
- package/dist/elements/date-range.js +1 -1
- package/dist/elements/datepicker.js +1 -1
- package/dist/elements/drawer.js +1 -1
- package/dist/elements/dropdown.js +1 -1
- package/dist/elements/entry-grid.js +1 -1
- package/dist/elements/filter-popover.js +1 -1
- package/dist/elements/hover-card.js +1 -1
- package/dist/elements/image-crop.js +1 -1
- package/dist/elements/inline-edit.js +1 -1
- package/dist/elements/kanban.js +1 -1
- package/dist/elements/lead-popup.js +1 -1
- package/dist/elements/lightbox.js +1 -1
- package/dist/elements/mention-input.js +1 -1
- package/dist/elements/modal.js +1 -1
- package/dist/elements/navigation-menu.js +1 -1
- package/dist/elements/notification-center.js +1 -1
- package/dist/elements/org-tree.js +1 -1
- package/dist/elements/overflow.js +1 -1
- package/dist/elements/phone.js +1 -1
- package/dist/elements/popover.js +1 -1
- package/dist/elements/record-pager.js +1 -1
- package/dist/elements/relative-time.js +1 -1
- package/dist/elements/saved-views.js +1 -1
- package/dist/elements/select.js +1 -1
- package/dist/elements/shortcuts.js +1 -1
- package/dist/elements/show-more.js +1 -1
- package/dist/elements/slider.js +1 -1
- package/dist/elements/sortable.js +1 -1
- package/dist/elements/timepicker.js +1 -1
- package/dist/elements/tour.js +1 -1
- package/dist/elements/tree.js +1 -1
- package/dist/elements/whats-new.js +1 -1
- package/dist/elements/wizard.js +1 -1
- package/dist/fileViewer.g-B5XQ5WKr.js +1 -0
- package/dist/fileViewerImage-B0Q9zdgW.js +3 -0
- package/dist/fileViewerMedia-D3fdG-Ti.js +1 -0
- package/dist/fileViewerPdf-DeRWa1JE.js +20 -0
- package/dist/{filterPopover-B29bt1s2.js → filterPopover-DmeVG4_N.js} +1 -1
- package/dist/formatters-Dy4kQQ_h.js +1 -0
- package/dist/formatters.g-BNAu1PMe.js +1 -0
- package/dist/helpers.js +1 -1
- package/dist/httpFailure.g-DBKzEpAf.js +1 -0
- package/dist/iconGlyphs.g-DxSJLQJ8.js +1 -0
- package/dist/imageCrop.g-BnbAeH2Q.js +1 -0
- package/dist/inlineEdit.g-ZxRNYq0t.js +1 -0
- package/dist/inlineEditText-BUO5sZxN.js +1 -0
- package/dist/kanban-CEZmyYFY.js +1 -0
- package/dist/kanban.g-dtKYyIpr.js +1 -0
- package/dist/kanbanModel-Dp5c1rTs.js +1 -0
- package/dist/leadPopup.g-BfMPz9nH.js +1 -0
- package/dist/lightbox.g-DDrycPou.js +1 -0
- package/dist/{loader-C7Ov09Bx.js → loader-CQJFj96n.js} +1 -1
- package/dist/mentionInput.g-DJo6d2Gm.js +1 -0
- package/dist/nativeOverlay-C1Rw2gIW.js +1 -0
- package/dist/notificationCentre.g-UsAurkUz.js +1 -0
- package/dist/notificationDays-B7cbYu4q.js +1 -0
- package/dist/{optionLabel-4xjXWy74.js → optionLabel-B2cU4Ax0.js} +1 -1
- package/dist/orgTree.g-CIg75quV.js +1 -0
- package/dist/overflow.g-BfcGEhwR.js +1 -0
- package/dist/passwordRules.g-CMYrohdd.js +1 -0
- package/dist/phone.g-P66U-SK5.js +1 -0
- package/dist/recents-BQ0fD7Y0.js +1 -0
- package/dist/relativeTime-CdFw-ekO.js +1 -0
- package/dist/relativeTime.g-BH90tjJM.js +1 -0
- package/dist/rowDrop.g-DQpB10Ey.js +1 -0
- package/dist/savedViews.g-CzzEliTR.js +1 -0
- package/dist/search-Cj1YQUwK.js +1 -0
- package/dist/search.g-B5d1s59A.js +1 -0
- package/dist/server.js +1 -1
- package/dist/shell.g-C2Ht5xl2.js +1 -0
- package/dist/shortcutKeys-DmPiY4T7.js +1 -0
- package/dist/shortcutKeys.g-C0TeAfYL.js +1 -0
- package/dist/showMore.g-BdQ5MUSd.js +1 -0
- package/dist/slider.g-BPNfxZEV.js +1 -0
- package/dist/sortable.g-BsTKys5-.js +1 -0
- package/dist/tableSelect.g-DKZqXQT_.js +1 -0
- package/dist/text/en.json +1278 -0
- package/dist/text.js +1 -0
- package/dist/textStore-opIEM4lu.js +1 -0
- package/dist/themeTransition-CDB0Mx61.js +1 -0
- package/dist/timePicker.g-DM61i-ZE.js +1 -0
- package/dist/tourAdvance.g-BJqDnqag.js +1 -0
- package/dist/tree.g-RId8xZSk.js +1 -0
- package/dist/ui-calendar.global.js +1 -1
- package/dist/ui-calendar.js +1 -1
- package/dist/ui-chart.global.js +2 -2
- package/dist/ui-chart.js +2 -2
- package/dist/ui-consent-banner.global.js +1 -1
- package/dist/ui-elements/carousel.global.js +1 -1
- package/dist/ui-elements/code-block.global.js +1 -1
- package/dist/ui-elements/command-palette.global.js +2 -2
- package/dist/ui-elements/comment-thread.global.js +1 -1
- package/dist/ui-elements/consent-banner.global.js +1 -1
- package/dist/ui-elements/context-menu.global.js +1 -1
- package/dist/ui-elements/date-range.global.js +12 -12
- package/dist/ui-elements/drawer.global.js +1 -1
- package/dist/ui-elements/dropdown.global.js +1 -1
- package/dist/ui-elements/entry-grid.global.js +3 -1
- package/dist/ui-elements/glyphs.global.js +1 -1
- package/dist/ui-elements/image-crop.global.js +8 -8
- package/dist/ui-elements/inline-edit.global.js +1 -1
- package/dist/ui-elements/kanban.global.js +1 -1
- package/dist/ui-elements/lead-popup.global.js +50 -50
- package/dist/ui-elements/lightbox.global.js +1 -1
- package/dist/ui-elements/markdown.global.js +1 -1
- package/dist/ui-elements/org-tree.global.js +1 -1
- package/dist/ui-elements/phone.global.js +9 -9
- package/dist/ui-elements/popover.global.js +1 -1
- package/dist/ui-elements/saved-views.global.js +1 -1
- package/dist/ui-elements/select-chips.global.js +2 -2
- package/dist/ui-elements/select-recents.global.js +1 -1
- package/dist/ui-elements/select-search.global.js +1 -1
- package/dist/ui-elements/slider.global.js +13 -13
- package/dist/ui-elements/sortable.global.js +1 -1
- package/dist/ui-elements/status-icon.global.js +1 -1
- package/dist/ui-elements/timepicker.global.js +4 -4
- package/dist/ui-elements/tour.global.js +1 -1
- package/dist/ui-elements/tree.global.js +1 -1
- package/dist/ui-elements/wizard.global.js +1 -1
- package/dist/ui-elements.global.js +21 -21
- package/dist/ui-elements.js +1 -1
- package/dist/ui-file-viewer.global.js +11 -11
- package/dist/ui-file-viewer.js +1 -1
- package/dist/ui-lead-popup.global.js +1 -1
- package/dist/ui-rich-text.global.js +8 -8
- package/dist/ui-rich-text.js +8 -8
- package/dist/ui-tour.global.js +1 -1
- package/dist/wizard.g-DOZSBUc5.js +1 -0
- package/package.json +11 -6
- package/types/WuiCarousel.d.ts +0 -8
- package/types/WuiChart.d.ts +1 -1
- package/types/WuiCommentThread.d.ts +1 -1
- package/types/WuiDrawer.d.ts +1 -1
- package/types/WuiEntryGrid.d.ts +5 -2
- package/types/WuiMentionInput.d.ts +0 -10
- package/types/WuiTour.d.ts +1 -12
- package/types/avatarPicker.d.ts +0 -13
- package/types/calendarMath.d.ts +0 -2
- package/types/chartAdapter.d.ts +1 -0
- package/types/chartSpec.d.ts +0 -4
- package/types/commentText.d.ts +0 -35
- package/types/dataTable.d.ts +6 -8
- package/types/elements/comment-thread.d.ts +2 -2
- package/types/elements/data-table.d.ts +1 -1
- package/types/elements/inline-edit.d.ts +2 -2
- package/types/elements/mention-input.d.ts +2 -2
- package/types/formatters.d.ts +15 -3
- package/types/global/core.d.ts +8 -7
- package/types/global/shared.d.ts +6 -0
- package/types/helpers.d.ts +9 -9
- package/types/inlineEditText.d.ts +0 -14
- package/types/kanbanModel.d.ts +0 -32
- package/types/notificationDays.d.ts +0 -19
- package/types/passwordRules.d.ts +0 -2
- package/types/server/drawerDiscard.d.ts +0 -5
- package/types/server/index.d.ts +3 -3
- package/types/server/remoteModal.d.ts +7 -5
- package/types/server/serverActions.d.ts +0 -9
- package/types/server/serverTable.d.ts +0 -11
- package/types/server/unsavedChanges.d.ts +0 -6
- package/types/shortcutKeys.d.ts +3 -3
- package/types/tableSelect.d.ts +0 -2
- package/types/text/index.d.ts +8 -0
- package/types/text/textStore.d.ts +19 -0
- package/types/text/web/accountSwitcher.g.d.ts +4 -0
- package/types/text/web/alert.g.d.ts +4 -0
- package/types/text/web/asyncBlock.g.d.ts +7 -0
- package/types/text/web/avatar.g.d.ts +4 -0
- package/types/text/web/avatarGroup.g.d.ts +4 -0
- package/types/text/web/banner.g.d.ts +4 -0
- package/types/text/web/breadcrumbs.g.d.ts +4 -0
- package/types/text/web/calendar.g.d.ts +20 -0
- package/types/text/web/card.g.d.ts +4 -0
- package/types/text/web/carousel.g.d.ts +13 -0
- package/types/text/web/catalogue.g.d.ts +266 -0
- package/types/text/web/chart.g.d.ts +102 -0
- package/types/text/web/chartCard.g.d.ts +13 -0
- package/types/text/web/check.g.d.ts +4 -0
- package/types/text/web/checkbox.g.d.ts +4 -0
- package/types/text/web/chip.g.d.ts +5 -0
- package/types/text/web/chipGroup.g.d.ts +4 -0
- package/types/text/web/choiceCard.g.d.ts +4 -0
- package/types/text/web/choiceChip.g.d.ts +4 -0
- package/types/text/web/codeBlock.g.d.ts +6 -0
- package/types/text/web/colourField.g.d.ts +7 -0
- package/types/text/web/columnMenu.g.d.ts +4 -0
- package/types/text/web/commandPalette.g.d.ts +12 -0
- package/types/text/web/commentThread.g.d.ts +35 -0
- package/types/text/web/compareTable.g.d.ts +7 -0
- package/types/text/web/confirmDialog.g.d.ts +10 -0
- package/types/text/web/confirmProvider.g.d.ts +4 -0
- package/types/text/web/consentBanner.g.d.ts +18 -0
- package/types/text/web/contextMenu.g.d.ts +5 -0
- package/types/text/web/copyButton.g.d.ts +5 -0
- package/types/text/web/customRule.g.d.ts +4 -0
- package/types/text/web/dataTable.g.d.ts +31 -0
- package/types/text/web/datePicker.g.d.ts +16 -0
- package/types/text/web/dateRangePicker.g.d.ts +22 -0
- package/types/text/web/drawer.g.d.ts +9 -0
- package/types/text/web/dropZone.g.d.ts +8 -0
- package/types/text/web/dropdown.g.d.ts +7 -0
- package/types/text/web/dueDate.g.d.ts +10 -0
- package/types/text/web/entryGrid.g.d.ts +16 -0
- package/types/text/web/errorBoundary.g.d.ts +4 -0
- package/types/text/web/errorSummary.g.d.ts +5 -0
- package/types/text/web/field.g.d.ts +4 -0
- package/types/text/web/fileAttachment.g.d.ts +18 -0
- package/types/text/web/filePicker.g.d.ts +20 -0
- package/types/text/web/fileValidation.g.d.ts +15 -0
- package/types/text/web/fileViewer.g.d.ts +55 -0
- package/types/text/web/filterBar.g.d.ts +15 -0
- package/types/text/web/floatingDock.g.d.ts +4 -0
- package/types/text/web/formatters.g.d.ts +49 -0
- package/types/text/web/formulaSteps.g.d.ts +9 -0
- package/types/text/web/hoverCard.g.d.ts +4 -0
- package/types/text/web/httpFailure.g.d.ts +4 -0
- package/types/text/web/imageCrop.g.d.ts +18 -0
- package/types/text/web/imagePicker.g.d.ts +22 -0
- package/types/text/web/index.g.d.ts +132 -0
- package/types/text/web/infoTip.g.d.ts +4 -0
- package/types/text/web/inlineEdit.g.d.ts +12 -0
- package/types/text/web/input.g.d.ts +11 -0
- package/types/text/web/inputMask.g.d.ts +12 -0
- package/types/text/web/kanban.g.d.ts +33 -0
- package/types/text/web/kbd.g.d.ts +6 -0
- package/types/text/web/kpiTile.g.d.ts +4 -0
- package/types/text/web/labelHelp.g.d.ts +4 -0
- package/types/text/web/leadPopup.g.d.ts +23 -0
- package/types/text/web/lightbox.g.d.ts +12 -0
- package/types/text/web/mentionInput.g.d.ts +11 -0
- package/types/text/web/modal.g.d.ts +14 -0
- package/types/text/web/modalCardRenderer.g.d.ts +5 -0
- package/types/text/web/modalContent.g.d.ts +4 -0
- package/types/text/web/modalForm.g.d.ts +5 -0
- package/types/text/web/navigationMenu.g.d.ts +4 -0
- package/types/text/web/notificationCentre.g.d.ts +24 -0
- package/types/text/web/numberInput.g.d.ts +7 -0
- package/types/text/web/onboardingChecklist.g.d.ts +10 -0
- package/types/text/web/orgTree.g.d.ts +10 -0
- package/types/text/web/otpInput.g.d.ts +5 -0
- package/types/text/web/overflow.g.d.ts +4 -0
- package/types/text/web/pageHeader.g.d.ts +5 -0
- package/types/text/web/passwordRules.g.d.ts +11 -0
- package/types/text/web/periodPicker.g.d.ts +13 -0
- package/types/text/web/person.g.d.ts +4 -0
- package/types/text/web/phone.g.d.ts +12 -0
- package/types/text/web/phoneNumberInput.g.d.ts +6 -0
- package/types/text/web/pricingCard.g.d.ts +4 -0
- package/types/text/web/qrCode.g.d.ts +4 -0
- package/types/text/web/radio.g.d.ts +4 -0
- package/types/text/web/radioGroup.g.d.ts +5 -0
- package/types/text/web/rating.g.d.ts +8 -0
- package/types/text/web/recordPager.g.d.ts +6 -0
- package/types/text/web/relativeTime.g.d.ts +16 -0
- package/types/text/web/repeater.g.d.ts +5 -0
- package/types/text/web/richText.g.d.ts +25 -0
- package/types/text/web/routeError.g.d.ts +12 -0
- package/types/text/web/rowActions.g.d.ts +4 -0
- package/types/text/web/rowDrop.g.d.ts +5 -0
- package/types/text/web/savedViews.g.d.ts +19 -0
- package/types/text/web/scoreScale.g.d.ts +4 -0
- package/types/text/web/search.g.d.ts +6 -0
- package/types/text/web/sectionLeadCapture.g.d.ts +12 -0
- package/types/text/web/segmented.g.d.ts +4 -0
- package/types/text/web/select.g.d.ts +26 -0
- package/types/text/web/shell.g.d.ts +36 -0
- package/types/text/web/shortcutKeys.g.d.ts +10 -0
- package/types/text/web/showMore.g.d.ts +5 -0
- package/types/text/web/skeletonShapes.g.d.ts +4 -0
- package/types/text/web/slider.g.d.ts +9 -0
- package/types/text/web/sortable.g.d.ts +12 -0
- package/types/text/web/sortableList.g.d.ts +4 -0
- package/types/text/web/sparkline.g.d.ts +7 -0
- package/types/text/web/spinner.g.d.ts +4 -0
- package/types/text/web/splash.g.d.ts +4 -0
- package/types/text/web/splitButton.g.d.ts +4 -0
- package/types/text/web/splitView.g.d.ts +19 -0
- package/types/text/web/stepper.g.d.ts +5 -0
- package/types/text/web/switch.g.d.ts +4 -0
- package/types/text/web/tablePagination.g.d.ts +11 -0
- package/types/text/web/tableRows.g.d.ts +4 -0
- package/types/text/web/tableSelect.g.d.ts +5 -0
- package/types/text/web/tableToolbar.g.d.ts +8 -0
- package/types/text/web/tabs.g.d.ts +6 -0
- package/types/text/web/textarea.g.d.ts +5 -0
- package/types/text/web/themeToggle.g.d.ts +10 -0
- package/types/text/web/timePicker.g.d.ts +15 -0
- package/types/text/web/timeline.g.d.ts +4 -0
- package/types/text/web/toast.g.d.ts +9 -0
- package/types/text/web/tour.g.d.ts +12 -0
- package/types/text/web/tourAdvance.g.d.ts +4 -0
- package/types/text/web/tree.g.d.ts +5 -0
- package/types/text/web/unsavedChanges.g.d.ts +6 -0
- package/types/text/web/updateBar.g.d.ts +6 -0
- package/types/text/web/value.g.d.ts +4 -0
- package/types/text/web/whatsNew.g.d.ts +7 -0
- package/types/text/web/wizard.g.d.ts +16 -0
- package/types/text/web/workspaceSwitcher.g.d.ts +8 -0
- package/dist/WuiCarousel-BdhJLo1m.js +0 -1
- package/dist/WuiCodeBlock-7O514Hqe.js +0 -1
- package/dist/WuiCommandPalette-rVScJ2Hy.js +0 -2
- package/dist/WuiCommentThread-Bkb78uhy.js +0 -1
- package/dist/WuiConsentBanner-Bm7tT3_5.js +0 -1
- package/dist/WuiContextMenu-Fc9WCgM8.js +0 -1
- package/dist/WuiDataTable-Bb5hxTfn.js +0 -1
- package/dist/WuiDatePicker-D7tOu4kV.js +0 -31
- package/dist/WuiDateRange-D0pzZeUU.js +0 -25
- package/dist/WuiDrawer-BKNcc0WX.js +0 -1
- package/dist/WuiEntryGrid-DCVSZuPc.js +0 -1
- package/dist/WuiImageCrop-ChvH8GKb.js +0 -17
- package/dist/WuiInlineEdit-DwnXChDc.js +0 -1
- package/dist/WuiLeadPopup-BmZG0Fk_.js +0 -382
- package/dist/WuiLightbox-hw48EjHj.js +0 -1
- package/dist/WuiMentionInput-BCXdub58.js +0 -1
- package/dist/WuiNotificationCenter-BRomMzI2.js +0 -1
- package/dist/WuiOrgTree-DzeLFQxy.js +0 -1
- package/dist/WuiOverflow-CV5y5zkM.js +0 -1
- package/dist/WuiPhone-BKxBok5L.js +0 -16
- package/dist/WuiRecordPager-7HVGoFlP.js +0 -1
- package/dist/WuiSavedViews-CdjavvPC.js +0 -1
- package/dist/WuiSelect-CKfM5kWG.js +0 -9
- package/dist/WuiShortcuts-Wiv_zufK.js +0 -1
- package/dist/WuiShowMore-CvdNQXrA.js +0 -1
- package/dist/WuiSlider-Cz5-zWC7.js +0 -51
- package/dist/WuiSortable-CBLMNRuZ.js +0 -1
- package/dist/WuiTimePicker-DAS2sxSH.js +0 -9
- package/dist/WuiTour-CAVM3O8-.js +0 -1
- package/dist/WuiTree-BPT9EZuw.js +0 -1
- package/dist/WuiWizardStep-Cencr-mT.js +0 -1
- package/dist/calendarMath-D6UUgYTD.js +0 -1
- package/dist/chips-DjccCG3b.js +0 -2
- package/dist/commentText-BnX7rA2-.js +0 -1
- package/dist/country-x5lqC5Xu.js +0 -1
- package/dist/customRule-Chp7YwFb.js +0 -1
- package/dist/dataTable-CcH1lBIM.js +0 -1
- package/dist/drawerDiscard-C1We4r_2.js +0 -1
- package/dist/fileViewerImage-CVHV1fBb.js +0 -3
- package/dist/fileViewerMedia-DGnbWDXP.js +0 -1
- package/dist/fileViewerPdf-BxoLE4hd.js +0 -20
- package/dist/fileViewerUi-2ZoK9uX0.js +0 -1
- package/dist/formatters-ljfITOZ3.js +0 -1
- package/dist/iconGlyphs.g-DPqoOoXy.js +0 -1
- package/dist/inlineEditText-CDptpqmI.js +0 -1
- package/dist/kanban-CDaks135.js +0 -1
- package/dist/kanbanModel-BaT75e-b.js +0 -1
- package/dist/nativeOverlay-BsVSWs1q.js +0 -1
- package/dist/notificationDays-BIWczft0.js +0 -1
- package/dist/recents-Dcw-b5cB.js +0 -1
- package/dist/relativeTime-BahImc8F.js +0 -1
- package/dist/search-Du-vK_9z.js +0 -1
- package/dist/shortcutKeys-COVLox98.js +0 -1
- package/dist/themeTransition-Dt7Br1QT.js +0 -1
- package/dist/zone-BR02ZkHF.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./elementBase-Cxeyx0tU.js";import{a as t,l as n,s as r}from"./nativeOverlay-
|
|
1
|
+
import{t as e}from"./elementBase-Cxeyx0tU.js";import{a as t,l as n,s as r}from"./nativeOverlay-C1Rw2gIW.js";var i=80,a=220,o=`:scope > [data-wui-popover-trigger]`,s=`:scope > [data-wui-popover-panel]`,c=`.popover-arrow`,l=`.popover-header`,u=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,d=[`click`,`hover`,`focus`],f=[`top`,`bottom`,`start`,`end`,`auto`],p=0;function m(e,t){let n=e.querySelector(t);return n instanceof HTMLElement?n:null}function h(e){return e.pointerType===`touch`||e.pointerType===`pen`}var g=class extends e{_open;_timer;_pressOpen;_refocusing;_awaitChildren;_onPress;_onClick;_onOver;_onOut;_onFocusIn;_onFocusOut;_onKeyDown;static get observedAttributes(){return[`open`,`trigger`,`placement`,`open-delay`,`close-delay`,`role-dialog`,`auto-focus`,`labelled-by`]}constructor(){super(),this._open=!1,this._timer=null,this._pressOpen=null,this._refocusing=!1,this._awaitChildren=null,this._onPress=e=>{this._pressOpen=this._zone(e.target)===`trigger`?this._open:null},this._onClick=e=>{if(this._zone(e.target)!==`trigger`||!this._kinds().includes(`click`))return;let t=this._pressOpen??this._open;this._pressOpen=null,this._requestOpen(!t)},this._onOver=e=>{if(h(e))return;let t=this._zone(e.target);t===`panel`?this._clear():t===`trigger`&&this._kinds().includes(`hover`)&&this._schedule(!0)},this._onOut=e=>{!h(e)&&this._kinds().includes(`hover`)&&this._zone(e.target)&&!this._zone(e.relatedTarget)&&this._schedule(!1)},this._onFocusIn=e=>{if(this._refocusing)return;let t=this._zone(e.target);t===`trigger`&&this._kinds().includes(`focus`)?this._requestOpen(!0):t===`panel`&&this._clear()},this._onFocusOut=e=>{this._kinds().includes(`focus`)&&this._zone(e.target)&&!this._zone(e.relatedTarget)&&this._requestOpen(!1)},this._onKeyDown=e=>{if(e.key!==`Escape`||!this._open)return;e.preventDefault();let t=this._zone(this.ownerDocument.activeElement)===`panel`;this._clear(),this._requestOpen(!1),t&&!this._open&&this._trigger?.focus()}}get isOpen(){return this._open}show(){this._open||(this._applyOpen(!0),this._notify(!0,!1))}hide(){this._open&&(this._applyOpen(!1),this._notify(!1,!1))}connectedCallback(){this.addEventListener(`pointerdown`,this._onPress),this.addEventListener(`click`,this._onClick),this.addEventListener(`pointerover`,this._onOver),this.addEventListener(`pointerout`,this._onOut),this.addEventListener(`focusin`,this._onFocusIn),this.addEventListener(`focusout`,this._onFocusOut),this._stampTrigger(),this._openOrAwaitChildren()}attributeChangedCallback(e){e===`open`&&this._awaitChildren?this.hasAttribute(`open`)||this._disarmAwait():e===`open`&&this.isConnected&&this._openOrAwaitChildren()}disconnectedCallback(){this._disarmAwait(),this._clear(),this.removeEventListener(`pointerdown`,this._onPress),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`pointerover`,this._onOver),this.removeEventListener(`pointerout`,this._onOut),this.removeEventListener(`focusin`,this._onFocusIn),this.removeEventListener(`focusout`,this._onFocusOut),this.ownerDocument.removeEventListener(`keydown`,this._onKeyDown),this._open=!1;let e=this._panel;e&&t(e)}get _panel(){return m(this,s)}get _trigger(){let e=m(this,o);if(e)return e;for(let e of this.children)if(e instanceof HTMLElement&&!e.hasAttribute(`data-wui-popover-panel`))return e;return null}_stampTrigger(){let e=this._trigger;e&&(e.setAttribute(`data-wui-popover-trigger`,``),(this.getAttribute(`trigger`)??`click`).split(/\s+/).includes(`click`)&&!e.hasAttribute(`aria-expanded`)&&e.setAttribute(`aria-expanded`,`false`))}_zone(e){if(!(e instanceof Node)||!this.contains(e))return null;let t=e instanceof Element?e:e.parentElement;return this._panel?.contains(t)?`panel`:this._trigger?.contains(t)?`trigger`:null}_kinds(){let e=(this.getAttribute(`trigger`)??`click`).split(/\s+/).filter(Boolean),t=[];for(let n of e){let e=d.find(e=>e===n);if(!e)throw RangeError(`<wui-popover>: trigger="${n}" is not click, hover or focus.`);t.push(e)}if(t.length===0)throw RangeError(`<wui-popover>: trigger is empty; name click, hover or focus.`);return t}_side(){let e=this.getAttribute(`placement`)??`bottom`,t=f.find(t=>t===e);if(!t)throw RangeError(`<wui-popover>: placement="${e}" is not top, bottom, start, end or auto.`);return t}_delay(e,t){if(!this.hasAttribute(e))return t;let n=this.getAttribute(e)??``,r=Number(n);if(n.trim()===``||!Number.isFinite(r)||r<0)throw RangeError(`<wui-popover>: ${e}="${n}" is not zero or more milliseconds.`);return r}_clear(){this._timer!==null&&clearTimeout(this._timer),this._timer=null}_schedule(e){if(this._clear(),this._open===e)return;let t=e?this._delay(`open-delay`,i):this._delay(`close-delay`,a);this._timer=setTimeout(()=>{this._timer=null,this._requestOpen(e)},t)}_requestOpen(e){e!==this._open&&(e&&this._ready(),this._notify(e,!0)&&this._applyOpen(e))}_notify(e,t){return this.dispatchEvent(new CustomEvent(`wui-popover-toggle`,{bubbles:!0,cancelable:t,detail:{open:e}}))}_mode(){return this._kinds().includes(`click`)?`auto`:`manual`}_ready(){let e=this._panel;if(!e)throw Error(`<wui-popover> has no panel: a child with data-wui-popover-panel is required to open.`);let t=this._trigger;if(!t)throw Error(`<wui-popover> has no trigger: a child element is required to open.`);return{panel:e,trigger:t,side:this._side(),mode:this._mode()}}_applyOpen(e){if(this._stampTrigger(),e===this._open)return;if(e){let{panel:e,trigger:i,side:a,mode:o}=this._ready();this._open=!0,this._name(e);try{n(i,e,{mode:o,side:a,align:`center`,arrow:m(e,c),onClosed:()=>this._onNativeClose()})}catch(n){throw this._open=!1,t(e),n}this.setAttribute(`open`,``),o===`manual`&&this.ownerDocument.addEventListener(`keydown`,this._onKeyDown),this.hasAttribute(`auto-focus`)&&queueMicrotask(()=>{this._open&&r(e)&&m(e,u)?.focus()}),i.hasAttribute(`aria-expanded`)&&i.setAttribute(`aria-expanded`,`true`);return}let i=this._panel;if(!i)throw Error(`<wui-popover> has no panel: a child with data-wui-popover-panel is required to close.`);let a=this._trigger;if(!a)throw Error(`<wui-popover> has no trigger: a child element is required to close.`);this._open=!1,this.ownerDocument.removeEventListener(`keydown`,this._onKeyDown),this.hasAttribute(`auto-focus`)&&this._mode()===`manual`&&i.contains(this.ownerDocument.activeElement)&&this._refocus(),t(i),this.removeAttribute(`open`),a.hasAttribute(`aria-expanded`)&&a.setAttribute(`aria-expanded`,`false`)}_openOrAwaitChildren(){if(this.hasAttribute(`open`)&&(this._panel===null||this._trigger===null)){if(this._awaitChildren)return;this._awaitChildren=new MutationObserver(()=>this._finishAwaitedOpen()),this._awaitChildren.observe(this,{childList:!0})}else this._applyOpen(this.hasAttribute(`open`))}_finishAwaitedOpen(){this._panel!==null&&this._trigger!==null&&(this._disarmAwait(),this._applyOpen(this.hasAttribute(`open`)))}_disarmAwait(){this._awaitChildren?.disconnect(),this._awaitChildren=null}_onNativeClose(){let e=this._panel;if(!this._open||!e||r(e))return;let t=e.contains(this.ownerDocument.activeElement);this._applyOpen(!1),t&&this._refocus(),this._notify(!1,!1)}_refocus(){let e=this._trigger;e&&(this._refocusing=!0,e.focus(),this._refocusing=!1)}_name(e){if(!this.hasAttribute(`role-dialog`))return;e.setAttribute(`role`,`dialog`);let t=this.getAttribute(`labelled-by`);if(t){e.setAttribute(`aria-labelledby`,t);return}let n=m(e,l);n&&(n.id||=`wui-popover-title-${++p}`,e.setAttribute(`aria-labelledby`,n.id))}};export{g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./dom-Do1pAA12.js";import{t}from"./elementBase-Cxeyx0tU.js";import{l as n,r}from"./shortcutKeys-DmPiY4T7.js";var i=class extends t{_doc;_onKeyDown;constructor(){super(),this._doc=null,this._onKeyDown=e=>{this.hasAttribute(`keys`)&&n(e,{j:()=>this._press(`.wui-record-pager-next`),k:()=>this._press(`.wui-record-pager-prev`)},this.closest(`[${r}]`))}}connectedCallback(){this._doc=this.ownerDocument,e(this._doc,`wui-record-pager has no owner document`).addEventListener(`keydown`,this._onKeyDown)}disconnectedCallback(){this._doc?.removeEventListener(`keydown`,this._onKeyDown),this._doc=null}_press(e){let t=this.querySelector(e);!(t instanceof HTMLElement)||t instanceof HTMLButtonElement&&t.disabled||t.getAttribute(`aria-disabled`)===`true`||t.click()}};export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./elementBase-Cxeyx0tU.js";import{n as t,r as n}from"./relativeTime-
|
|
1
|
+
import{t as e}from"./elementBase-Cxeyx0tU.js";import{n as t,r as n}from"./relativeTime-CdFw-ekO.js";var r=3e4,i=/* @__PURE__ */ new Set,a=null,o=()=>{if(!(typeof document<`u`&&document.hidden))for(let e of i)e.refresh()},s=e=>{i.add(e),i.size===1&&(a=setInterval(o,r),document.addEventListener(`visibilitychange`,o))},c=e=>{i.delete(e),i.size===0&&(clearInterval(a??void 0),a=null,document.removeEventListener(`visibilitychange`,o))},l=class extends e{_observer;constructor(){super(),this._observer=null}connectedCallback(){this.refresh(),s(this),this._observer=new MutationObserver(()=>this.refresh()),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`datetime`]})}disconnectedCallback(){c(this),this._observer?.disconnect(),this._observer=null}refresh(){let e=this.querySelector(`time[datetime]`);if(!(e instanceof HTMLTimeElement))return;let r=e.getAttribute(`datetime`),i=t(r);e.textContent!==i&&(e.textContent=i);let a=n(r);this.getAttribute(`data-wui-tooltip`)!==a&&this.setAttribute(`data-wui-tooltip`,a)}};export{l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./buttonClass-GtEi8hAY.js";import{t as n}from"./elementBase-Cxeyx0tU.js";import{l as r}from"./wuiHttp-DGbD7Fra.js";import{r as i,t as a}from"./textStore-opIEM4lu.js";import{t as o}from"./savedViews.g-CzzEliTR.js";var s=`wui-saved-views:`,c=20,l=0,u=()=>i(`savedViews`,o),d=e=>typeof e==`object`&&!!e&&`name`in e&&typeof e.name==`string`&&`query`in e&&typeof e.query==`string`,f=class extends n{static get observedAttributes(){return[`key`,`mode`,`action`,`can-share`]}_doc=null;_dom=null;_views;_open;_busy;_error;_trigger;_onTriggerClick;_onKeyDown;_onPointerDown;_onSubmit;constructor(){super(),this._views=[],this._open=!1,this._busy=!1,this._error=null,this._onTriggerClick=()=>this._setOpen(!this._open),this._onKeyDown=e=>{this._open&&e.target instanceof Node&&this.contains(e.target)&&(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),this._setOpen(!1),this._trigger?.focus()):(e.key===`ArrowDown`||e.key===`ArrowUp`)&&this._ui.menu.contains(e.target)&&!(e.target instanceof Element&&/input|textarea/i.test(e.target.tagName))&&(e.preventDefault(),e.stopPropagation()))},this._onPointerDown=e=>{this._open&&!e.composedPath().includes(this)&&this._setOpen(!1)},this._onSubmit=async e=>{e.preventDefault();let t=this._ui.input.value.trim();if(!t)return;if(this._server()){if(this._busy)return;let e={name:t,query:this._ownerDoc.location.search};this._canShare()&&(e.shared=String(this._ui.share.checked)),await this._request(`save`,e)&&(this._ui.input.value=``,this._ui.share.checked=!1);return}let n=this._ownerDoc.location.search;this._commit([{name:t,query:n},...this._views.filter(e=>e.name!==t)].slice(0,c)),this._ui.input.value=``}}get _ownerDoc(){if(!this._doc)throw Error(`wui-saved-views is not connected`);return this._doc}get _ui(){if(!this._dom)throw Error(`wui-saved-views is not built`);return this._dom}connectedCallback(){this._doc=this.ownerDocument,this._trigger||this._build(),window.addEventListener(`keydown`,this._onKeyDown,!0),this._reload()}disconnectedCallback(){this._setOpen(!1),window.removeEventListener(`keydown`,this._onKeyDown,!0),this._doc=null}attributeChangedCallback(){this._doc&&this._trigger&&this._reload()}_reload(){this._server()?(this._views=[],this._render(),this._request(`list`)):(this._views=this._load(),this._render())}_server(){return this.getAttribute(`mode`)===`server`&&!!this.getAttribute(`action`)&&!!this.getAttribute(`key`)}_canShare(){return this._server()&&this.getAttribute(`can-share`)===`true`}async _request(e,t={}){let n=this.getAttribute(`action`)??``,i=this.getAttribute(`key`)??``,a=n,o;e===`list`?a+=(n.includes(`?`)?`&`:`?`)+new URLSearchParams({intent:`list`,key:i}):o={method:`POST`,body:new URLSearchParams({intent:e,key:i,...t})},this._busy=!0,this._render();let s=await r(a,o);if(this._busy=!1,this._doc===null)return!1;if(s.ok){let e=new DOMParser().parseFromString(s.html,`text/html`);return this._views=[...e.querySelectorAll(`[data-wui-saved-views-items] > li`)].filter(e=>e instanceof HTMLLIElement).map(e=>({name:e.dataset.name,query:e.dataset.query,shared:e.dataset.shared===`true`})).filter(d),this._error=null,this._render(),!0}return this._error=s.message||u().viewsNotUpdatedMessage,this._render(),!1}_build(){let n=this._ownerDoc;this.classList.add(`dropdown`),this._trigger=n.createElement(`button`),this._trigger.type=`button`,this._trigger.className=e(`neutral`,`outline`,`sm`),this._trigger.dataset.wui=t,this._trigger.textContent=u().viewsLabel,this._trigger.setAttribute(`aria-haspopup`,`true`),this._trigger.setAttribute(`aria-expanded`,`false`),this._trigger.addEventListener(`click`,this._onTriggerClick);let r=n.createElement(`div`);r.className=`dropdown-menu`;let i=n.createElement(`div`);i.className=`dropdown-divider`;let a=n.createElement(`input`);a.type=`text`,a.className=`form-control form-control-sm`,a.setAttribute(`aria-label`,u().viewNameLabel),a.placeholder=u().nameViewPlaceholder;let o=n.createElement(`button`);o.type=`submit`,o.className=e(`primary`,`solid`,`sm`),o.dataset.wui=t,o.textContent=u().saveViewLabel;let s=n.createElement(`form`);s.className=`d-flex gap-2 px-3 py-2`,s.append(a,o),s.addEventListener(`submit`,this._onSubmit);let c=n.createElement(`input`);c.type=`checkbox`,c.className=`form-check-input`,c.setAttribute(`role`,`switch`),c.id=`wui-saved-views-share-${l++}`;let d=n.createElement(`label`);d.className=`form-check-label`,d.htmlFor=c.id,d.textContent=u().shareTeamLabel;let f=n.createElement(`div`);f.className=`form-check form-switch mb-0`,f.append(c,d);let p=n.createElement(`div`);p.className=`px-3 pb-2`,p.hidden=!0,p.append(f),this._dom={menu:r,divider:i,form:s,input:a,save:o,shareRow:p,share:c},this.append(this._trigger,r)}_render(){let e=this._ownerDoc,t=this._ui,n=[];for(let t of this._views){let r=e.createElement(`a`);if(r.className=`dropdown-item`,r.setAttribute(`href`,e.location.pathname+t.query),r.textContent=t.name,t.shared){let t=e.createElement(`span`);t.className=`badge text-bg-secondary ms-2`,t.textContent=u().sharedLabel,r.append(t)}let i=e.createElement(`button`);i.type=`button`,i.className=`btn btn-link btn-sm`,i.textContent=u().deleteLabel,i.setAttribute(`aria-label`,a(u().deleteText,{name:t.name})),i.disabled=this._busy,i.addEventListener(`click`,()=>this._server()?this._request(`delete`,{name:t.name}):this._commit(this._views.filter(e=>e.name!==t.name))),n.push(r,i)}if(this._error){let t=e.createElement(`div`);t.className=`dropdown-item-text text-danger small`,t.setAttribute(`role`,`alert`),t.textContent=this._error,n.push(t)}t.save.disabled=this._busy,t.share.disabled=this._busy,t.shareRow.hidden=!this._canShare(),t.menu.replaceChildren(...n,t.divider,t.form,t.shareRow)}_commit(e){this._views=e,this._write(e),this._render()}_setOpen(e){e!==this._open&&(this._open=e,this._ui.menu.classList.toggle(`show`,e),this._trigger?.setAttribute(`aria-expanded`,String(e)),e?this._ownerDoc.addEventListener(`pointerdown`,this._onPointerDown,!0):this._ownerDoc.removeEventListener(`pointerdown`,this._onPointerDown,!0))}_storage(){let e=this.getAttribute(`key`);if(!e)return null;try{let t=this._ownerDoc.defaultView;return t?{store:t.localStorage,key:s+e}:null}catch{return null}}_load(){let e=this._storage();if(!e)return[];try{let t=JSON.parse(e.store.getItem(e.key)??`[]`);return Array.isArray(t)?t.filter(d).slice(0,c):[]}catch{return[]}}_write(e){let t=this._storage();if(t)try{t.store.setItem(t.key,JSON.stringify(e))}catch(e){if(!(e instanceof DOMException))throw e}}};export{f as t};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{t as e}from"./anchorOverlay-B8fu8hjz.js";import{i as t,n,r,t as i}from"./optionLabel-B2cU4Ax0.js";import{n as a}from"./devWarn-DXdRWZs3.js";import{r as o}from"./dom-Do1pAA12.js";import{t as s}from"./elementBase-Cxeyx0tU.js";import{r as c,t as l}from"./fieldState-D-zQcXUS.js";import{n as u,t as d}from"./formMirror-9IpSgeZb.js";import{n as f}from"./loader-CQJFj96n.js";import{t as p}from"./iconGlyphs.g-DxSJLQJ8.js";import{t as m}from"./imeSafeEnter-DPs9qL3S.js";import{n as h,t as g}from"./listboxKeyNav-CF7tMDGG.js";import{a as _,l as v,s as y}from"./nativeOverlay-C1Rw2gIW.js";import{r as b}from"./textStore-opIEM4lu.js";import{n as x,r as S,t as C}from"./search.g-B5d1s59A.js";var w=e=>{let t=String(e??``).trim();return/^(https?:)?\/\//i.test(t)||/^\/(?!\/)/.test(t)||/^data:image\/(png|jpe?g|gif|webp|avif);/i.test(t)?t:``},T=(e,t=`wui-opt-avatar`)=>{let r=w(e.avatar);return!r&&!e.initials?``:`<span class="avatar ${t}" aria-hidden="true"><span class="avatar-face">${n(e.initials??``)}</span>${r?`<img class="avatar-img" src="${E(r)}" alt="" />`:``}</span>`},E=e=>String(e??``).replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`),D=()=>b(`select`,S);function O(e,n){let r=String(n??``).trim().toLowerCase();return r?e.filter(e=>[t(e),e.description,e.meta].some(e=>String(e??``).toLowerCase().includes(r))):e}var k=/* @__PURE__ */ new WeakMap;function ee(e,t,r={}){let{selected:i=[],query:a=``,status:o=`idle`,emptyText:s=D().emptyText,searchingText:c=D().searchingText,hintText:l=D().hintText,actionRow:u=[],recents:d=null}=r,f=new Set(i.map(String)),p=O(t,a),m=e.id,h=0,g=()=>`${m}-opt-${h++}`,_=e=>`<button type="button" role="option" id="${n(g())}" class="wui-select-option wui-select-add" data-value="${n(e.value)}" data-custom="true" aria-selected="false">${n(e.label)}</button>`,v=u.filter(e=>e.position===`top`).map(_).join(``),y=d?.options.length?`<div class="wui-select-group">${n(d.label)}</div>${d.options.map(e=>A(e,g(),f.has(String(e.value)))).join(``)}<div class="wui-select-sep" aria-hidden="true"></div>`:``,b=``,x=``;for(let e of p)e.group&&e.group!==b&&(x+=`<div class="wui-select-group">${n(e.group)}</div>`),b=e.group??``,x+=A(e,g(),f.has(String(e.value)));let S=u.filter(e=>e.position===`bottom`).map(_).join(``),C=``;o===`loading`?C=`<div class="wui-select-loading"><span class="wui-select-spinner spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>${n(c)}</div>`:o===`hint`?C=`<div class="wui-select-hint">${n(l)}</div>`:(o===`empty`||p.length===0&&u.length===0)&&(C=`<div class="wui-select-empty">${n(s)}</div>`);let w=v+y+x+S+C;k.get(e)!==w&&(k.set(e,w),e.innerHTML=w)}function A(e,t,i){let a=!!e.disabled,o=a&&e.disabledHint?` title="${n(e.disabledHint)}"`:``,s=`id="${n(t)}" role="option" data-value="${n(e.value)}" aria-selected="${i}"${a?` aria-disabled="true"`:``}${o}`,c=`<span class="wui-select-check" aria-hidden="true">${p(`check`)}</span>`;if(!e.description&&!e.meta)return`<button type="button" class="wui-select-option${i?` selected`:``}" ${s}>${T(e)}<span class="wui-select-opt-name">${r(e)}</span>${c}</button>`;let l=e.description?`<span class="wui-select-opt-desc">${n(e.description)}</span>`:``,u=e.meta?`<span class="wui-select-opt-meta">${n(e.meta)}</span>`:``;return`<div class="wui-select-option wui-select-option-rich${i?` selected`:``}" ${s}>${T(e)}<span class="wui-select-option-text"><span class="wui-opt-label">${r(e)}</span>${l}</span>${u}${c}</div>`}var j=Object.freeze([`single`,`multiple`,`search`,`tag`,`country`]),M=e=>e===`multiple`||e===`tag`,N={recents:()=>import(`./recents-BQ0fD7Y0.js`),chips:()=>import(`./chips-CemguTKJ.js`),search:()=>import(`./search-Cj1YQUwK.js`),country:()=>import(`./country-B7jmc--B.js`)};function P(e){let t=Object.hasOwn(N,e)?N[e]:void 0;return t?t():Promise.reject(/* @__PURE__ */ Error(`Unknown <wui-select> part: ${e}.`))}var F=e=>typeof e.loadOptions==`function`||!!e.getAttribute(`source`)||e.hasAttribute(`remote`),I=()=>b(`select`,S),L=()=>b(`search`,C),R=()=>b(`field`,x),z=class extends s{static formAssociated=!0;_internals;_value;_optionsProp;_partOptions;_known;_loadOptionsFn;_validateFn;_declared;_query;_ownsFilter;_active;_status;_error;_nav;_parts;_partSig;_partsMounted;_partToken;_rendered;_searchShown;_defaultValue;_warnedMode;_warnedDensity;_hoverTimer;_hoverOpened;_onHoverOver;_onHoverOut;_panelShown;_pressOpen;static get observedAttributes(){return/* @__PURE__ */ `mode.value.placeholder.search-placeholder.empty-text.searchable.clearable.disabled.readonly.loading.required.size.density.icon.prefix.open.open-on-hover.aria-label.aria-describedby.aria-invalid.min-chars.debounce.source.remote.allow-custom.add-label.searching-text.hint-text.value-label.value-avatar.value-initials.max-tags.allow-duplicates.separators.pattern.invalid-message.create-label.collapse-chips.selected-text.clear-all-label.countries.suggested.suggested-label.all-countries-label.recents-key.recents-limit.recents-label`.split(`.`)}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``,this._optionsProp=null,this._partOptions=null,this._known=/* @__PURE__ */ new Map,this._loadOptionsFn=null,this._validateFn=null,this._declared=void 0,this._query=``,this._ownsFilter=!1,this._active=-1,this._status=`idle`,this._error=``,this._nav=null,this._parts=null,this._partSig=``,this._partsMounted=!1,this._partToken=0,this._rendered=!1,this._searchShown=!1,this._defaultValue=void 0,this._warnedMode=null,this._hoverTimer=null,this._hoverOpened=!1,this._panelShown=!1,this._pressOpen=null,this._onHoverOver=e=>{e.pointerType===`mouse`&&this._hoverZone(e.target)&&(this._clearHover(),!this._menuOpen()&&this._hoverEligible()&&(this._hoverTimer=setTimeout(()=>{this._hoverTimer=null,!this._menuOpen()&&this._hoverEligible()&&(this._open({focus:!1}),this._hoverOpened=!0)},U)))},this._onHoverOut=e=>{e.pointerType===`mouse`&&this._hoverZone(e.target)&&!this._hoverZone(e.relatedTarget)&&(this._clearHover(),this._menuOpen()&&this.hasAttribute(`open-on-hover`)&&(this._hoverTimer=setTimeout(()=>{this._hoverTimer=null,this._close()},W)))}}connectedCallback(){this.addEventListener(`pointerover`,this._onHoverOver),this.addEventListener(`pointerout`,this._onHoverOut),this._rendered||this.render(),this._ensureParts(),this._mountParts()}disconnectedCallback(){this.removeEventListener(`pointerover`,this._onHoverOver),this.removeEventListener(`pointerout`,this._onHoverOut),this._clearHover(),this._dropMenu(),this._teardown(),this._teardownParts()}attributeChangedCallback(e,t,n){e===`value`?(this._value=Y(n,M(this.mode)),this._applyValue()):e===`aria-invalid`?this._syncInvalid():e===`open`?this._rendered&&(this.hasAttribute(`open`)?this._open({focus:!1}):this._close({force:!0})):e===`open-on-hover`?this.hasAttribute(`open-on-hover`)||this._clearHover():(e===`mode`&&(this._value=Y(this._value,M(this.mode)),this._partOptions=null,this._known.clear(),this._ensureParts()),(e===`source`||e===`remote`||e===`recents-key`)&&this._ensureParts(),J.has(e)?this._rendered&&(this._drawValue(),this.renderList()):q.has(e)?this._remountParts():this._rendered&&this.render())}formResetCallback(){if(this.value=this._defaultValue??``,!this._rendered)return;let e=this._refs();e.input&&(e.input.value=``,e.input.removeAttribute(`aria-invalid`)),e.search&&(e.search.value=``),this.setError(``),this._query!==``&&this._onQueryChange(``)}get mode(){let e=this.getAttribute(`mode`);return e===null?`single`:V(e)?e:(e!==this._warnedMode&&(this._warnedMode=e,a(`<wui-select> mode "${e}" is not one of ${j.join(`, `)}; it is treated as "single".`)),`single`)}_checkDensity(){let e=this.getAttribute(`density`);e===null||H.includes(e)||e===this._warnedDensity||(this._warnedDensity=e,a(`<wui-select> density "${e}" is not one of ${H.join(`, `)}; it is treated as "comfortable".`))}set mode(e){this.setAttribute(`mode`,String(e))}get value(){return Array.isArray(this._value)?this._value.slice():this._value}set value(e){this._value=Y(e,M(this.mode)),this._applyValue()}get options(){return this._readOptions()}set options(e){this._optionsProp=Array.isArray(e)?e:null,this.mode!==`country`&&(this._partOptions=null);for(let e of this._activePartsList())e.onOptions?.();if(this._rendered){if(this.mode===`single`&&this.getAttribute(`searchable`)===null&&this._autoSearch()!==this._searchShown){this.render();return}this._drawValue(),this.renderList()}}get loadOptions(){return this._loadOptionsFn}set loadOptions(e){this._loadOptionsFn=typeof e==`function`?e:null,this._ensureParts()}get validate(){return this._validateFn}set validate(e){this._validateFn=typeof e==`function`?e:null}commit(e,t={}){this.value=e,this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,detail:{isCustom:!!t.isCustom}}))}setPartOptions(e){this._partOptions=Array.isArray(e)?e:null,this._drawValue(),this.renderList()}setStatus(e){this._status=e,this.renderList()}setError(e){this._error=e?String(e):``,this._syncError()}openMenu(){l(this)||this._open({focus:!1})}closeMenu({focusControl:e=!1}={}){this._close(),e&&this._refs().control?.focus()}renderList(){let e=this._refs();e.list&&(ee(e.list,this._listOptions(),{selected:this._selectedValues(),query:this._ownsFilter?``:this._query,status:this._status,emptyText:this.getAttribute(`empty-text`)||I().emptyText,searchingText:this.getAttribute(`searching-text`)||I().searchingText,hintText:this.getAttribute(`hint-text`)||void 0,actionRow:this._actionRows(),recents:this._recents()}),this._active>=this._visible().length&&(this._active=-1),this._active>=0&&this._setActive(this._active,{reveal:!1}),this._anchorMenu())}render(){this._dropMenu();let e=this._carry();this._teardownParts(),this._snapshotDeclared();let t=this.mode;this._checkDensity();let r=M(t),i=t===`tag`,a=r&&(i||this.hasAttribute(`allow-custom`));this._value=Y(this._value,r),this._defaultValue===void 0&&r&&this._value.length===0&&(this._value=this._declaredSelected()),r||this._preselect(),this._defaultValue===void 0&&(this._defaultValue=Y(this._value,r));let o=this.getAttribute(`size`),s=o===`sm`?` wui-select-sm`:o===`lg`?` wui-select-lg`:o===`xl`?` wui-select-xl`:``,l=this.getAttribute(`icon`),u=this.getAttribute(`prefix`),d=this.hasAttribute(`clearable`),f=this.hasAttribute(`disabled`);this.id||=`wui-select-${Math.random().toString(36).slice(2,9)}`;let m=`${this.id}-listbox`,h=`${this.id}-entry-error`,g=this.getAttribute(`aria-describedby`)?.trim(),_=g?`${g} ${h}`:h,v=this.hasAttribute(`aria-invalid`)||this._error?` aria-invalid="true"`:``,y=this.hasAttribute(`required`)&&!a?` aria-required="true"`:``,b=` aria-label="${n(this._accessibleName())}" aria-describedby="${n(_)}"${v}${y}`,x=a?``:` role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${n(m)}"`,S=r?`<div class="input wui-select-control wui-select-multi"${x}${b}${f?` aria-disabled="true"`:i?``:` tabindex="0"`}>`:`<button type="button" class="input wui-select-control"${x}${b}${f?` disabled`:``}>`,C=`${l?p(l,{className:`wui-select-icon`}):``}${u?`<span class="wui-select-prefix">${n(u)}</span>`:``}<span class="wui-select-value" data-label></span>${d?`<span class="wui-select-reset" role="button" aria-label="${n(I().clearSelectionLabel)}" hidden>${p(`x`)}</span>`:``}${p(`chevron-down`,{className:`wui-select-caret`})}`,w=this.getAttribute(`searchable`),T=w===null?t===`multiple`||t===`country`||this._autoSearch():w!==`false`,E=t===`search`||T&&!a;this._searchShown=E;let D=this.getAttribute(`search-placeholder`)||(t===`country`?I().countrySearchPlaceholder:L().placeholder),O=E?`<div class="wui-select-search">${p(`search`)}<input class="wui-select-input" placeholder="${n(D)}" aria-label="${n(D)}" aria-autocomplete="list" /><button type="button" class="wui-select-clear" aria-label="${n(L().clearLabel)}" hidden>${p(`x`)}</button></div>`:``;this.innerHTML=`
|
|
2
|
+
<div class="wui-select${s}">
|
|
3
|
+
${S}${C}${r?`</div>`:`</button>`}
|
|
4
|
+
<div class="wui-select-menu wui-select-menu-fixed" popover="auto">
|
|
5
|
+
${O}
|
|
6
|
+
<div class="wui-select-options" role="listbox" id="${n(m)}" tabindex="-1"${r?` aria-multiselectable="true"`:``}></div>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="field-error wui-select-error" id="${n(h)}" aria-live="polite"${this._error?``:` hidden`}>${n(this._error)}</div>`,this._rendered=!0,this._syncMirror(),this._syncValidity(),this._drawValue(),this._syncReset(),this.renderList(),this._wire(),c(this,this.querySelector(`.wui-select-control`)),this._mountParts(e)}_accessibleName(){return this.getAttribute(`aria-label`)||this.getAttribute(`placeholder`)||I().fallbackName}_snapshotDeclared(){if(this._declared)return;let e=[...this.querySelectorAll(`:scope > wui-option`)];e.length&&(this._declared=e.map(e=>{let t={value:e.getAttribute(`value`)??$(e).trim(),label:e.innerHTML,[i]:!0,selected:e.hasAttribute(`selected`)};for(let[n,r]of te){let i=e.getAttribute(n);i&&(t[r]=i)}return e.hasAttribute(`disabled`)&&(t.disabled=!0),t}))}_readOptions(){return this.mode===`country`?this._partOptions||[]:this._partOptions?this._partOptions:this._optionsProp?this._optionsProp:(this._snapshotDeclared(),this._declared||[])}_listOptions(){let e=this._readOptions(),t=this.getAttribute(`value-label`);if(this.mode!==`search`||!t||this._value===``)return e;let n=String(this._value);return e.some(e=>String(e.value)===n)?e:[...e,{value:n,label:t}]}_declaredSelected(){return this._optionsProp?[]:(this._declared??[]).filter(e=>e.selected).map(e=>String(e.value))}_preselect(){let e=this._readOptions(),t=this._value!==``&&e.find(e=>String(e.value)===this._value)||e.find(e=>`selected`in e&&!!e.selected);t&&(this._value=String(t.value))}_optionFor(e){let t=String(e),n=this._readOptions().find(e=>String(e.value)===t);return n?(this._known.set(t,n),n):this._known.get(t)}_placeholder(){return this.getAttribute(`placeholder`)||K()[this.mode]}_hasValue(){return Array.isArray(this._value)?this._value.length>0:this._value!==``}_selectedValues(){return Array.isArray(this._value)?this._value:this._value===``?this._listOptions().some(e=>String(e.value)===``)?[``]:[]:[this._value]}_applyValue(){this._syncMirror(),this._syncValidity(),this._rendered&&(this._drawValue(),this._syncReset(),this.renderList())}_syncMirror(){M(this.mode)?u(this,this._selectedValues()):d(this,this._value)}_drawValue(){let e=this._refs();if(!e.value)return;let t=M(this.mode),i=t?void 0:this._optionFor(this._value);this._syncTitle(i),this._syncValueAvatar(),this._activePartsList().some(e=>e.renderValue?.()===!0)||(t?(e.value.classList.remove(`wui-select-placeholder`),e.value.textContent=``):(e.value.classList.toggle(`wui-select-placeholder`,!i),e.value.innerHTML=i?r(i):n(this._placeholder())))}_syncTitle(e){let n=this.querySelector(`.wui-select-control`);if(!n)return;let r=e&&!this.hasAttribute(`title`)?t(e).trim():``;r?n.setAttribute(`title`,r):n.removeAttribute(`title`)}_syncValueAvatar(){let e=this.querySelector(`.wui-select-control`);if(!e)return;e.querySelector(`:scope > .wui-select-value-avatar`)?.remove();let t=!M(this.mode)&&this._hasValue()?T({avatar:this.getAttribute(`value-avatar`),initials:this.getAttribute(`value-initials`)},`avatar-xs`):``;e.classList.toggle(`wui-has-value-avatar`,!!t),t&&e.insertAdjacentHTML(`afterbegin`,`<span class="wui-select-value-avatar" aria-hidden="true">${t}</span>`)}_syncValidity(){let e=this._internals;if(typeof e?.setValidity==`function`){if(this.hasAttribute(`required`)&&!this._hasValue()){let t=this.querySelector(`.wui-select-control`);e.setValidity({valueMissing:!0},R().requiredFieldMessage,t instanceof HTMLElement?t:void 0)}else e.setValidity({})}}_syncReset(){let e=Q(this,`.wui-select-reset`,HTMLElement);e&&(e.hidden=!(this.hasAttribute(`clearable`)&&this._hasValue()&&!l(this)))}_syncInvalid(){let e=this.querySelector(`.wui-select-control`);e&&(this.hasAttribute(`aria-invalid`)||this._error?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}_syncError(){let e=Q(this,`.wui-select-error`,HTMLElement);e&&(e.textContent=this._error,e.hidden=!this._error),this._syncInvalid()}_refs(){return{control:Q(this,`.wui-select-control`,HTMLElement),value:Q(this,`.wui-select-value`,HTMLElement),menu:Q(this,`.wui-select-menu`,HTMLElement),list:Q(this,`.wui-select-options`,HTMLElement),search:Q(this,`.wui-select-search input`,HTMLInputElement),input:Q(this,`.wui-select-draft`,HTMLInputElement)}}_menuOpen(){let e=Q(this,`.wui-select-menu`,HTMLElement);return e!==null&&y(e)}_hoverZone(e){if(!(e instanceof Element))return!1;let t=e.closest(`.wui-select-control, .wui-select-menu`);return t!==null&&this.contains(t)}_hoverEligible(){if(!this.hasAttribute(`open-on-hover`)||l(this)||this.mode===`tag`)return!1;let e=this._refs();return e.search===null&&e.input===null}_clearHover(){this._hoverTimer!==null&&clearTimeout(this._hoverTimer),this._hoverTimer=null}_autoSearch(){return this.mode===`single`&&this.getAttribute(`searchable`)===null&&this._readOptions().length>G}_visible(){let e=this._refs();return e.list?ie(e.list,`.wui-select-option`):[]}_setActive(e,{reveal:t=!0}={}){let n=this._refs();if(!n.list||!n.control)return;let r=this._visible();this._active=e;let i=e>=0?r[e]??null:null;h(n.list,i),i?(t&&i.scrollIntoView({block:`nearest`}),n.control.setAttribute(`aria-activedescendant`,i.id)):n.control.removeAttribute(`aria-activedescendant`)}_actionRows(){let e=[];for(let t of this._activePartsList()){let n=t.actionRow?.(this._query);n&&e.push(n)}return e}_recents(){if(this._query.trim()!==``)return null;for(let e of this._activePartsList()){let t=e.recents?.(this._listOptions());if(t)return t}return null}_menuPlacement(e,t){let n=this.hasAttribute(`open`)?{below:!0}:{};if(this.getAttribute(`density`)!==`compact`)return{matchWidth:!0,...n};let r=e.getBoundingClientRect();return t.style.width=`max-content`,t.style.minWidth=`${r.width}px`,t.style.maxWidth=`280px`,n}_anchorMenu(){let t=this._refs();t.control&&t.menu&&this._menuOpen()&&e(t.control,t.menu,this._menuPlacement(t.control,t.menu))}_showMenu(e,t){v(e,t,{...this._menuPlacement(e,t),mode:`auto`,keepOffscreen:this.hasAttribute(`open`),onClosed:()=>this._onPanelClosed()}),this._panelShown=!0}_onPanelClosed(){if(!this._panelShown)return;this._panelShown=!1;let e=this._refs();e.control&&(e.control.setAttribute(`aria-expanded`,`false`),this._setActive(-1),this._nav?.clearTypeahead(),this.dispatchEvent(new CustomEvent(`wui-select:close`,{bubbles:!0})))}_open({focus:e=!0}={}){let t=this._refs();if(!t.menu||!t.control)return;let n=this._menuOpen();this._hoverOpened=!1,t.control.setAttribute(`aria-expanded`,`true`),this._query=t.input?t.input.value:``,this._ownsFilter=this._ownsFilter&&this._query!==``;let r=Q(this,`.wui-select-search .wui-select-clear`,HTMLElement);if(r&&(r.hidden=!0),t.search&&(t.search.value=``),this.renderList(),n||this._showMenu(t.control,t.menu),e&&(t.search?.focus(),this._setActive(this._visible().findIndex(e=>e.classList.contains(`selected`)))),!n){this.dispatchEvent(new CustomEvent(`wui-select:open`,{bubbles:!0}));for(let e of this._activePartsList())e.onOpen?.()}}_close({force:e=!1}={}){if(!e&&this.hasAttribute(`open`))return;let t=this._refs();if(!t.menu||!t.control)return;this._hoverOpened=!1;let n=t.menu.contains(document.activeElement);y(t.menu)&&_(t.menu),this._onPanelClosed(),n&&t.control.focus()}_onQueryChange(e){this._query=e,this._setActive(-1);let t=Q(this,`.wui-select-search .wui-select-clear`,HTMLElement);t&&(t.hidden=!e);let n=!1;for(let t of this._activePartsList())t.onQuery?.(e)===!0&&(n=!0);this._ownsFilter=n,this.renderList()}_pick(e){if(e.getAttribute(`aria-disabled`)===`true`)return;let t=e.dataset.custom===`true`,n=e.dataset.value??``,r=t?{value:n,label:$(e).trim()}:this._listOptions().find(e=>String(e.value)===n)??{value:n,label:n},i=this._activePartsList().some(e=>e.onPick?.(r,{isCustom:t})===!0);M(this.mode)||(i||this.commit(n,{isCustom:t}),this._close(),this._refs().control?.focus())}_draftOpens(){return this.mode===`multiple`?this.hasAttribute(`allow-custom`):this.mode===`tag`&&F(this)}_onKeyDown(e){if(!l(this)){for(let t of this._activePartsList())if(t.onKey?.(e)===!0)return;if(!this._menuOpen()){if(e.target instanceof HTMLInputElement){if(e.key!==`ArrowDown`||!this._draftOpens())return;this._open({focus:!1})}else{(e.key===`ArrowDown`||m(e)||e.key===` `)&&(e.preventDefault(),this._open({focus:!0}));return}}o(this._nav,`Listbox keys are not wired.`).handler(e)}}_wire(){this._teardown();let e=this._refs(),t=e.control,n=e.list;if(!t||!e.menu||!n)return;let r=o(Q(this,`.wui-select`,HTMLElement),`The select wrapper is missing.`),i=Q(this,`.wui-select-search .wui-select-clear`,HTMLElement),a=Q(this,`.wui-select-reset`,HTMLElement);this._nav=g({getVisibleOptions:()=>this._visible(),getActive:()=>this._active,setActive:e=>this._setActive(e),onEnter:(e,t)=>{if(e)this._pick(e);else if(this._query.trim()!==``){let e=t.find(e=>e.dataset.custom===`true`);if(e)this._pick(e);else if(t.length===1){let e=t[0];e&&this._pick(e)}}},onEscape:e=>{e.preventDefault(),this._nav?.clearTypeahead(),this._close(),t.focus()}}),r.addEventListener(`keydown`,e=>this._onKeyDown(e)),r.addEventListener(`input`,e=>{let t=e.target;if(!(t instanceof HTMLInputElement)||!t.matches(`.wui-select-input, .wui-select-draft`))return;this._onQueryChange(t.value);let n=t.matches(`.wui-select-draft`),r=this._visible().length>0||this._actionRows().length>0;n&&r&&!this._menuOpen()&&!l(this)&&this._draftOpens()&&this._open({focus:!1})}),r.addEventListener(`focusout`,e=>{let t=e.relatedTarget;t instanceof Node&&this.contains(t)||!this._activePartsList().some(e=>e.onBlur?.()===!0)&&t&&this._close()}),i?.addEventListener(`click`,()=>{let t=o(e.search,`The search input is missing.`);t.value=``,this._onQueryChange(``),t.focus()}),t.addEventListener(`pointerdown`,()=>{this._pressOpen=this._menuOpen()}),t.addEventListener(`click`,e=>{if(e.target instanceof Element&&e.target.closest(`[data-remove]`))return;if(this.mode===`tag`){if(l(this))return;this._refs().input?.focus(),!this._menuOpen()&&this._draftOpens()&&this._open({focus:!1});return}if(e.target instanceof HTMLInputElement){!this._menuOpen()&&!l(this)&&this._open({focus:!1});return}let t=e.detail>0&&this._pressOpen!==null?this._pressOpen:this._menuOpen();this._pressOpen=null,this._clearHover(),this._hoverOpened&&t?(this._hoverOpened=!1,this._open({focus:!0})):t?this._close():l(this)||this._open({focus:!0})}),a?.addEventListener(`click`,e=>{e.stopPropagation(),this.commit(M(this.mode)?[]:``),this._close(),t.focus()}),n.addEventListener(`click`,n=>{let r=Z(n).closest(`.wui-select-option`);if(r instanceof HTMLElement&&(this._pick(r),M(this.mode))){let n=this.querySelector(`.wui-select-draft`);(e.search??(n instanceof HTMLElement?n:t)).focus()}}),n.addEventListener(`mousedown`,e=>{M(this.mode)&&e.target instanceof Element&&e.target.closest(`.wui-select-option`)&&e.preventDefault()}),n.addEventListener(`mousemove`,e=>{let t=Z(e).closest(`.wui-select-option`);t instanceof HTMLElement&&!t.classList.contains(`is-active`)&&this._setActive(this._visible().indexOf(t),{reveal:!1})}),n.addEventListener(`mouseleave`,()=>this._setActive(-1)),n.addEventListener(`error`,e=>{let t=e.target;t instanceof Element&&t.classList.contains(`avatar-img`)&&t.remove()},!0),this.hasAttribute(`open`)&&this._open({focus:!1})}_teardown(){this._nav?.teardown()}_dropMenu(){let e=Q(this,`.wui-select-menu`,HTMLElement);e&&_(e)}_activePartsList(){return this._partsMounted?o(this._parts,`The mounted parts are missing.`):[]}_ensureParts(){if(!this.isConnected)return;let e=ne(this,this.mode),t=e.join(`,`);if(t===this._partSig)return;this._teardownParts(),this._parts=null,this._partSig=t;let n=++this._partToken;Promise.all(e.map(e=>ae(this,e))).then(e=>{n===this._partToken&&(this._parts=e.filter(e=>e!==null),this._mountParts())})}_mountParts(e={draft:``,query:``}){if(!this._parts||this._partsMounted||!this._rendered||!this.isConnected)return;this._partsMounted=!0;let t=B(this._refs());for(let n of this._parts)n.mount(this,t,{carry:e});this._drawValue(),this.renderList()}_teardownParts(){let e=this._activePartsList();this._partsMounted=!1;for(let t of e)t.teardown()}_remountParts(){if(!this._partsMounted)return;let e=this._carry();this._teardownParts(),this._mountParts(e)}_carry(){let e=this._refs();return{draft:e.input?.value??``,query:e.search?.value??``}}},B=e=>{let{control:t,value:n,menu:r,list:i}=e;return{control:o(t,`control missing`),value:o(n,`value missing`),menu:o(r,`menu missing`),list:o(i,`list missing`),search:e.search,input:e.input}},V=e=>j.includes(e),H=[`comfortable`,`compact`],U=150,W=250,G=10,K=()=>{let e=I();return{single:e.placeholder,search:e.placeholder,multiple:e.placeholder,tag:e.tagPlaceholder,country:e.countryPlaceholder}},q=/* @__PURE__ */ new Set([`countries`,`suggested`,`suggested-label`,`all-countries-label`,`max-tags`,`pattern`,`collapse-chips`,`source`,`remote`,`min-chars`]),J=/* @__PURE__ */ new Set([`separators`,`allow-duplicates`,`invalid-message`,`create-label`,`add-label`,`selected-text`,`clear-all-label`,`value-label`,`value-avatar`,`value-initials`,`hint-text`,`recents-key`,`recents-limit`,`recents-label`]),te=[[`icon`,`icon`],[`description`,`description`],[`meta`,`meta`],[`group`,`group`],[`avatar`,`avatar`],[`initials`,`initials`],[`disabled-hint`,`disabledHint`]],Y=(e,t)=>t?Array.isArray(e)?e.map(String):e==null||e===``?[]:String(e).split(`,`).map(e=>e.trim()).filter(Boolean):Array.isArray(e)?e.length?String(e[0]):``:e==null?``:String(e),X=(e,t)=>t===`multiple`?F(e)?[`chips`,`search`]:[`chips`]:t===`search`?[`search`]:t===`country`?[`country`]:t===`tag`?F(e)?[`chips`,`search`]:[`chips`]:[],ne=(e,t)=>e.hasAttribute(`recents-key`)?[`recents`,...X(e,t)]:X(e,t),re=e=>typeof e==`object`&&!!e&&`default`in e&&typeof e.default==`function`,Z=e=>{if(e.target instanceof Element)return e.target;throw Error(`The event target is not an element.`)},Q=(e,t,n)=>{let r=e.querySelector(t);return r instanceof n?r:null},ie=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement),$=e=>{let t=e.textContent;if(t===null)throw Error(`The element has no text.`);return t},ae=(e,t)=>P(t).then(e=>{if(!re(e))throw Error(`The part ${t} has no default export.`);return e.default()}).catch(()=>(document.dispatchEvent(new CustomEvent(f,{bubbles:!0,composed:!0,detail:{chunk:t}})),e.setError(I().partLoadMessage),null));export{F as n,O as r,z as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./dom-Do1pAA12.js";import{t as n}from"./elementBase-Cxeyx0tU.js";import{a as r,l as i,s as a}from"./nativeOverlay-C1Rw2gIW.js";import{a as o,c as s,d as c,f as l,l as u,o as d,p as f,r as p}from"./shortcutKeys-DmPiY4T7.js";var m=`wui-shortcuts-open-change`;function h(e,t){let n=e.querySelector(t);return n instanceof HTMLElement?n:null}function g(e,t){return[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement)}var _=class extends n{_doc;_onKeyDown;_onClick;_onDocClick;_onPointerDown;_onPressEnd;_pressedOpen;_pinned;_mirroring;static get observedAttributes(){return[`open`,`no-trigger`]}constructor(){super(),this._doc=null,this._pressedOpen=!1,this._pinned=!1,this._mirroring=!1,this._onKeyDown=e=>this._keydown(e),this._onClick=e=>this._click(e),this._onDocClick=e=>{let n=t(e.target,`[data-wui-shortcuts-open]`)?.getAttribute(`data-wui-shortcuts-open`);n&&this.matches(n)&&this.setOpen(!0)},this._onPointerDown=e=>{t(e.target,`.wui-shortcut-toggle`)&&(this._pressedOpen=this.open)},this._onPressEnd=e=>{e.type===`pointerup`&&t(e.target,`.wui-shortcut-toggle`)||(this._pressedOpen=!1)}}connectedCallback(){this._doc=this.ownerDocument,this._doc.addEventListener(`keydown`,this._onKeyDown),this._doc.addEventListener(`click`,this._onDocClick),this._doc.addEventListener(`pointerup`,this._onPressEnd,!0),this._doc.addEventListener(`pointercancel`,this._onPressEnd,!0),this.addEventListener(`click`,this._onClick),this.addEventListener(`pointerdown`,this._onPointerDown,!0),this.hasAttribute(`open`)&&!this.open&&(this._pinned=!0,this.setOpen(!0,{focus:!1})),this._syncTrigger()}attributeChangedCallback(e,t,n){e===`no-trigger`?this._syncTrigger():(this._mirroring||(this._pinned=n!==null),this._sheet()&&n!==null!==this.open&&this.setOpen(n!==null))}disconnectedCallback(){let e=this._sheet();e&&r(e),this._doc?.removeEventListener(`keydown`,this._onKeyDown),this._doc?.removeEventListener(`click`,this._onDocClick),this._doc?.removeEventListener(`pointerup`,this._onPressEnd,!0),this._doc?.removeEventListener(`pointercancel`,this._onPressEnd,!0),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`pointerdown`,this._onPointerDown,!0),this._doc=null}get open(){let e=this._sheet();return!!(e&&a(e))}set open(e){let t=e===!0||e===``||e===`true`;this._pinned=t,this._sheet()?t!==this.open&&this.setOpen(t):this.toggleAttribute(`open`,t)}setOpen(t,{focus:n=!0}={}){let o=this._sheet();if(!o)return;let s=h(this,`.wui-shortcut-toggle`);if(t||(this._pinned=!1),t){o.removeAttribute(`hidden`);let t=this.hasAttribute(`no-trigger`)?s??this:e(s,`<wui-shortcuts> needs its toggle to anchor the sheet.`);i(t,o,{mode:`auto`,side:`top`,align:`end`,flipAlign:!0,gap:8,keepOffscreen:this._pinned,onClosed:()=>{this._pinned=!1,this._mirror(!1)}})}else r(o);this._mirror(t),n&&(t?queueMicrotask(()=>{a(o)&&h(o,`.wui-shortcut-close`)?.focus()}):s?.focus())}_mirror(e){let t=this._sheet();t&&(t.hidden=!e),h(this,`.wui-shortcut-toggle`)?.setAttribute(`aria-expanded`,String(e)),this.hasAttribute(`open`)!==e&&(this._mirroring=!0,this.toggleAttribute(`open`,e),this._mirroring=!1,this.dispatchEvent(new CustomEvent(m,{bubbles:!0,detail:{open:e}})))}_sheet(){return h(this,`.wui-shortcut-sheet`)}_syncTrigger(){let e=h(this,`.wui-shortcut-toggle`);e&&(e.hidden=this.hasAttribute(`no-trigger`))}_scope(){let e=this.closest(`[${p}]`);return e instanceof HTMLElement?e:null}_items(){let t=this.getAttribute(`items`);return t?g(e(this._scope()??this._doc,`WuiShortcuts used before it was connected`),t):[]}_click(e){let t=e.target;if(t instanceof Element){if(t.closest(`.wui-shortcut-toggle`)){let e=this._pressedOpen;this._pressedOpen=!1,this.setOpen(!e&&!this.open)}else t.closest(`.wui-shortcut-close`)&&this.setOpen(!1)}}_tickFocused(){let t=this._items(),n=e(this._doc,`WuiShortcuts used before it was connected`).activeElement,r=n?.closest?.(`li, tr`),i=t.find(e=>e===n||e.contains(n)||r?.contains(e)),a=(i?.closest(`li, tr`)??i)?.querySelector(`input[type="checkbox"]`);a instanceof HTMLInputElement&&a.click()}_focusSearch(){let t=this.getAttribute(`search`);if(!t)return;let n=e(this._doc,`WuiShortcuts used before it was connected`);(h(this._scope()??n,t)??h(n,t))?.focus()}_keydown(t){if(t.defaultPrevented)return;let n=l(t);if(!n)return;if(n===`esc`&&this.open){t.preventDefault(),this.setOpen(!1);return}let r=this._scope(),i={help:()=>this.setOpen(!this.open)};if(this.getAttribute(`items`)&&(i.j=()=>s(this._items(),1),i.k=()=>s(this._items(),-1),i.x=()=>this._tickFocused()),this.getAttribute(`search`)&&(i.slash=()=>this._focusSearch()),i[n]){u(t,i,r);return}if(n===`enter`)return;let a=e(this._doc,`WuiShortcuts used before it was connected`),p=t.target instanceof Node?t.target:null;if(f(a)||!o(p,r)||d(p))return;let m=c(n),_=g(this,`.wui-shortcut-keys [data-shortcut]`).find(e=>e.dataset.shortcut===m);if(!_)return;let v=(r??a).querySelector(`[aria-current="true"]`)?.closest(`[data-key]`),y=v instanceof HTMLElement?v.dataset.key??null:null;if(!this.dispatchEvent(new CustomEvent(`wui:shortcut`,{bubbles:!0,cancelable:!0,detail:{key:m,itemKey:y}}))){t.preventDefault();return}let b=_.dataset.target,x=b?h(a,b):null;x&&(t.preventDefault(),x.click())}};export{_ as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./dom-Do1pAA12.js";import{t}from"./elementBase-Cxeyx0tU.js";import{r as n}from"./textStore-opIEM4lu.js";import{t as r}from"./showMore.g-BdQ5MUSd.js";var i=3,a=()=>n(`showMore`,r),o=class extends t{_width;_observer;_toggle;_onClick;constructor(){super(),this._width=-1,this._observer=null,this._toggle=null,this._onClick=()=>this.toggle()}connectedCallback(){let e=this.querySelector(`.wui-show-more-toggle`);if(this._toggle=e instanceof HTMLButtonElement?e:null,!this._toggle)return;let t=Number.parseInt(this.getAttribute(`lines`)??``,10);this.style.setProperty(`--wui-show-more-lines`,String(t>=1?t:i)),this._toggle.addEventListener(`click`,this._onClick),this._sync(),this._check(),typeof ResizeObserver<`u`&&(this._observer=new ResizeObserver(()=>{this.clientWidth!==this._width&&this._check()}),this._observer.observe(this))}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._toggle?.removeEventListener(`click`,this._onClick),this._toggle=null}get expanded(){return this.hasAttribute(`expanded`)}toggle(e=!this.expanded){this.toggleAttribute(`expanded`,!!e),this._sync(),this.dispatchEvent(new CustomEvent(`wui:show-more:toggle`,{bubbles:!0,detail:{expanded:this.expanded}}))}_sync(){let t=e(this._toggle,`WuiShowMore used before it was connected`),n=this.expanded;t.setAttribute(`aria-expanded`,String(n)),t.textContent=n?this.getAttribute(`less-label`)||a().lessLabel:this.getAttribute(`more-label`)||a().moreLabel}_check(){let t=this.querySelector(`.wui-show-more-body`);if(!(t instanceof HTMLElement))return;this._width=this.clientWidth;let n=this.expanded;n&&this.removeAttribute(`expanded`);let r=t.scrollHeight>t.clientHeight+1;n&&this.setAttribute(`expanded`,``);let i=e(this._toggle,`WuiShowMore used before it was connected`);i.hidden=!r}};export{o as t};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./digitGrouping-CCPI3HK3.js";import{t as r}from"./elementBase-Cxeyx0tU.js";import{r as i,t as a}from"./fieldState-D-zQcXUS.js";import{t as o}from"./formMirror-9IpSgeZb.js";import{r as s,t as c}from"./textStore-opIEM4lu.js";import{t as l}from"./slider.g-BPNfxZEV.js";var u=()=>s(`slider`,l),d=class extends r{static formAssociated=!0;_internals;_value;_start;_end;_isDragging;_dragThumb;_pointerDownListener;_pointerMoveListener;_pointerUpListener;_thumbKeyListener;_trackClickListener;_rendered;_defaultsCaptured;_defaultValue;_defaultStart;_defaultEnd;static get observedAttributes(){return[`min`,`max`,`step`,`value`,`start`,`end`,`name`,`start-name`,`end-name`,`disabled`,`readonly`,`loading`,`size`,`show-value`,`unit`,`grouping`,`aria-label`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=50,this._start=25,this._end=75,this._isDragging=!1,this._dragThumb=null,this._pointerDownListener=null,this._pointerMoveListener=null,this._pointerUpListener=null,this._thumbKeyListener=null,this._trackClickListener=null}connectedCallback(){this._rendered?this._wire():this.render()}get value(){return this._value}set value(e){this._value=this._snapToStep(this._clamp(f(e,this._value))),this._syncValue(),this._syncMirrors()}get start(){return this._start}set start(e){this._start=Math.min(this._snapToStep(this._clamp(f(e,this._start))),this._end),this._syncValue(),this._syncMirrors()}get end(){return this._end}set end(e){this._end=Math.max(this._snapToStep(this._clamp(f(e,this._end))),this._start),this._syncValue(),this._syncMirrors()}attributeChangedCallback(e,t,n){e===`value`||e===`start`||e===`end`||e===`min`||e===`max`||e===`step`?(this._updateFromAttribute(e),this._rendered&&(this._syncValue(),this._syncMirrors())):this._rendered&&this.render()}formResetCallback(){this._isRange()?this._resetRange():this._resetSingle()}_updateFromAttribute(e){e===`value`?this._value=this._snapToStep(this._clamp(f(this.getAttribute(`value`),this._value))):e===`start`?this._start=this._snapToStep(this._clamp(f(this.getAttribute(`start`),this._start))):e===`end`&&(this._end=this._snapToStep(this._clamp(f(this.getAttribute(`end`),this._end))))}_isRange(){return this.hasAttribute(`range`)}_min(){return f(this.getAttribute(`min`),0)}_max(){return f(this.getAttribute(`max`),100)}_step(){return f(this.getAttribute(`step`),1)}_clamp(e){return Math.max(this._min(),Math.min(e,this._max()))}_snapToStep(e){let t=this._step();if(t<=0)return e;let n=this._min();return this._clamp(n+Math.round((e-n)/t)*t)}_captureDefaults(){this._defaultsCaptured||=(this._isRange()?(this._defaultStart=this._start,this._defaultEnd=this._end):this._defaultValue=this._value,!0)}_resetSingle(){this._value=this._defaultValue??50,this._syncValue(),this._syncMirrors()}_resetRange(){this._start=this._defaultStart??25,this._end=this._defaultEnd??75,this._syncValue(),this._syncMirrors()}render(){this._captureDefaults();let e=this._min(),t=this._max(),n=this._isRange(),r=this.getAttribute(`size`),a=r===`sm`?` slider-sm`:r===`lg`?` slider-lg`:``,o=this.hasAttribute(`disabled`),s=this.hasAttribute(`readonly`)?` aria-readonly="true"`:``;n?(this._start=this._clamp(this._start),this._end=this._clamp(this._end),this._start>this._end&&([this._start,this._end]=[this._end,this._start])):this._value=this._clamp(this._value),this.innerHTML=`
|
|
2
|
+
<div class="slider${a}">
|
|
3
|
+
<div class="wui-slider-rail">
|
|
4
|
+
<div class="slider-track" role="presentation"></div>
|
|
5
|
+
<div class="slider-fill" role="presentation"></div>
|
|
6
|
+
${n?`
|
|
7
|
+
<button
|
|
8
|
+
type="button"
|
|
9
|
+
role="slider"
|
|
10
|
+
class="slider-thumb"
|
|
11
|
+
data-thumb="start"
|
|
12
|
+
aria-label="${p(u().minimumLabel)}"
|
|
13
|
+
aria-valuemin="${e}"
|
|
14
|
+
aria-valuemax="${t}"
|
|
15
|
+
aria-valuenow="${this._start}"
|
|
16
|
+
aria-valuetext="${this._formatValue(this._start)}"
|
|
17
|
+
${s}
|
|
18
|
+
${o?`disabled`:``}
|
|
19
|
+
></button>
|
|
20
|
+
<button
|
|
21
|
+
type="button"
|
|
22
|
+
role="slider"
|
|
23
|
+
class="slider-thumb"
|
|
24
|
+
data-thumb="end"
|
|
25
|
+
aria-label="${p(u().maximumLabel)}"
|
|
26
|
+
aria-valuemin="${e}"
|
|
27
|
+
aria-valuemax="${t}"
|
|
28
|
+
aria-valuenow="${this._end}"
|
|
29
|
+
aria-valuetext="${this._formatValue(this._end)}"
|
|
30
|
+
${s}
|
|
31
|
+
${o?`disabled`:``}
|
|
32
|
+
></button>
|
|
33
|
+
`:`
|
|
34
|
+
<button
|
|
35
|
+
type="button"
|
|
36
|
+
role="slider"
|
|
37
|
+
class="slider-thumb"
|
|
38
|
+
data-thumb="single"
|
|
39
|
+
aria-valuemin="${e}"
|
|
40
|
+
aria-valuemax="${t}"
|
|
41
|
+
aria-valuenow="${this._value}"
|
|
42
|
+
aria-valuetext="${this._formatValue(this._value)}"
|
|
43
|
+
${s}
|
|
44
|
+
${o?`disabled`:``}
|
|
45
|
+
aria-label="${p(this.getAttribute(`aria-label`)||u().ariaLabel)}"
|
|
46
|
+
></button>
|
|
47
|
+
`}
|
|
48
|
+
</div>
|
|
49
|
+
${this.hasAttribute(`show-value`)?n?`<span class="slider-value">${c(u().rangeText,{start:this._formatValue(this._start),end:this._formatValue(this._end)})}</span>`:`<span class="slider-value">${this._formatValue(this._value)}</span>`:``}
|
|
50
|
+
</div>
|
|
51
|
+
`,this._rendered=!0,this._placeParts(),this._syncMirrors(),i(this,this.querySelector(`.slider`)),this._wire()}_formatValue(e){let t=this.getAttribute(`unit`)||``;return`${this._grouping()===`indian`?n(String(e)):String(e)}${t}`}_grouping(){let n=this.getAttribute(`grouping`)??`none`;if(!t(n))throw Error(e(n));return n}_placeParts(){let e=this._min(),t=this._max(),n=n=>t===e?0:(n-e)/(t-e),r=this._isRange(),i=r?n(this._start):0,a=n(r?this._end:this._value),o=m(this,`.slider-fill`);o&&(o.style.left=`${i*100}%`,o.style.right=`${100-a*100}%`,r&&o.style.setProperty(`--wui-fill-start`,String(i)),o.style.setProperty(`--wui-fill-end`,String(a)));let s=(e,t)=>{e&&(e.style.left=`${t*100}%`,e.style.setProperty(`--wui-t`,String(t)))};r?(s(m(this,`[data-thumb="start"]`),i),s(m(this,`[data-thumb="end"]`),a)):s(m(this,`.slider-thumb`),a)}_syncValue(){if(this._rendered){if(this._placeParts(),this._isRange()){let e=m(this,`[data-thumb="start"]`),t=m(this,`[data-thumb="end"]`);e&&(e.setAttribute(`aria-valuenow`,String(this._start)),e.setAttribute(`aria-valuetext`,this._formatValue(this._start))),t&&(t.setAttribute(`aria-valuenow`,String(this._end)),t.setAttribute(`aria-valuetext`,this._formatValue(this._end)));let n=m(this,`.slider-value`);n&&(n.textContent=c(u().rangeText,{start:this._formatValue(this._start),end:this._formatValue(this._end)}))}else{let e=m(this,`.slider-thumb`);e&&(e.setAttribute(`aria-valuenow`,String(this._value)),e.setAttribute(`aria-valuetext`,this._formatValue(this._value)));let t=m(this,`.slider-value`);t&&(t.textContent=this._formatValue(this._value))}}}_syncMirrors(){this._isRange()?this._syncRangeMirrors():this._syncSingleMirror()}_syncSingleMirror(){this.getAttribute(`name`)&&o(this,String(this._value))}_syncRangeMirrors(){let e=this.getAttribute(`start-name`)||this.getAttribute(`name`),t=this.getAttribute(`end-name`);this._mirrorRange(`start`,e,this._start),this._mirrorRange(`end`,t,this._end)}_mirrorRange(e,t,n){if(!t)return;let r=h(this,`input[type="hidden"][data-slider-mirror="${e}"]`);r||(r=document.createElement(`input`),r.type=`hidden`,r.setAttribute(`data-slider-mirror`,e),this.appendChild(r)),r.name=t,r.value=String(n),r.disabled=this.hasAttribute(`disabled`)}_valueAtPosition(e){let t=m(this,`.slider-track`);if(!t)return this._min();let n=t.getBoundingClientRect(),r=m(this,`.slider-thumb`),i=r?r.offsetWidth/2:0,a=n.width-i*2,o=a>0?Math.max(0,Math.min(1,(e-n.left-i)/a)):0,s=this._min()+o*(this._max()-this._min());return this._snapToStep(s)}_nearestThumb(e){return Math.abs(e-this._start)<=Math.abs(e-this._end)?`start`:`end`}_wire(){if(this._teardown(),a(this))return;let e=g(this,`.slider-thumb`),t=m(this,`.slider-track`),n=this._isRange(),r=e=>{if(a(this))return;let t=e.target;if(!(t instanceof Element))throw Error(`Pointer event target is not an element`);let n=t.closest(`.slider-thumb`);n&&(e.preventDefault(),this._isDragging=!0,this._dragThumb=n.getAttribute(`data-thumb`),document.addEventListener(`pointermove`,i),document.addEventListener(`pointerup`,o),document.addEventListener(`pointercancel`,o))},i=e=>{if(!this._isDragging)return;e.preventDefault();let t=this._valueAtPosition(e.clientX);if(this._dragThumb===`single`)this._value=this._clamp(t),this._syncValue(),this.dispatchEvent(new CustomEvent(`slide`,{detail:{value:this._value}}));else if(this._dragThumb===`start`){let e=Math.min(t,this._end);this._start=this._clamp(e),this._syncValue(),this.dispatchEvent(new CustomEvent(`slide`,{detail:{start:this._start,end:this._end}}))}else if(this._dragThumb===`end`){let e=Math.max(t,this._start);this._end=this._clamp(e),this._syncValue(),this.dispatchEvent(new CustomEvent(`slide`,{detail:{start:this._start,end:this._end}}))}},o=()=>{this._isDragging&&(this._isDragging=!1,this._dragThumb=null,document.removeEventListener(`pointermove`,i),document.removeEventListener(`pointerup`,o),document.removeEventListener(`pointercancel`,o),this._syncMirrors(),this.dispatchEvent(new Event(`change`,{bubbles:!0})))},s=e=>{if(!(e.currentTarget instanceof HTMLElement))throw Error(`Keyboard event target is not an element`);let t=e.currentTarget;if(a(this))return;let n=this._step(),r=n*10,i=null,o=t.getAttribute(`data-thumb`),s=o===`end`?this._end:o===`start`?this._start:this._value;e.key===`ArrowLeft`||e.key===`ArrowDown`?(e.preventDefault(),i=s-n):e.key===`ArrowRight`||e.key===`ArrowUp`?(e.preventDefault(),i=s+n):e.key===`PageDown`?(e.preventDefault(),i=s-r):e.key===`PageUp`?(e.preventDefault(),i=s+r):e.key===`Home`?(e.preventDefault(),i=this._min()):e.key===`End`&&(e.preventDefault(),i=this._max()),i!=null&&(i=this._clamp(i),o===`single`?this._value=i:o===`start`?this._start=Math.min(i,this._end):o===`end`&&(this._end=Math.max(i,this._start)),this._syncValue(),this._syncMirrors(),this.dispatchEvent(new Event(`change`,{bubbles:!0})))},c=e=>{if(a(this))return;let t=this._valueAtPosition(e.clientX);n?this._nearestThumb(t)===`start`?this._start=Math.min(this._clamp(t),this._end):this._end=Math.max(this._clamp(t),this._start):this._value=this._clamp(t),this._syncValue(),this._syncMirrors(),this.dispatchEvent(new Event(`change`,{bubbles:!0}))};this._pointerDownListener=r,this._pointerMoveListener=i,this._pointerUpListener=o,this._thumbKeyListener=s,this._trackClickListener=c,e.forEach(e=>{e.addEventListener(`pointerdown`,r),e.addEventListener(`keydown`,s)}),t?.addEventListener(`click`,c)}_teardown(){for(let e of g(this,`.slider-thumb`))this._pointerDownListener&&e.removeEventListener(`pointerdown`,this._pointerDownListener),this._thumbKeyListener&&e.removeEventListener(`keydown`,this._thumbKeyListener);this._pointerMoveListener&&document.removeEventListener(`pointermove`,this._pointerMoveListener),this._pointerUpListener&&(document.removeEventListener(`pointerup`,this._pointerUpListener),document.removeEventListener(`pointercancel`,this._pointerUpListener)),this._isDragging=!1,this._dragThumb=null;let e=m(this,`.slider-track`);e&&this._trackClickListener&&e.removeEventListener(`click`,this._trackClickListener)}disconnectedCallback(){this._teardown()}},f=(e,t)=>{let n=Number.parseFloat(String(e));return Number.isFinite(n)?n:t},p=e=>String(e??``).replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`),m=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLElement?n:null},h=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLInputElement?n:null},g=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement);export{d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./elementBase-Cxeyx0tU.js";import{n as t}from"./formMirror-9IpSgeZb.js";import{r as n,t as r}from"./textStore-opIEM4lu.js";import{t as i}from"./sortable.g-BsTKys5-.js";var a=()=>n(`sortable`,i),o=/* @__PURE__ */ new Set,s=`.wui-sortable-handle`,c=`a[href],button,input,select,textarea,label,summary,[contenteditable='true'],[role='button'],[role='link']`,l=4,u=8,d=250,f=48,p=18,m=class extends e{_drag;_kb;_moving;controlled;_observer;_onDragStart;_onDocTouchMove;_onSelectStart;static get observedAttributes(){return[`name`,`disabled`]}constructor(){super(),this._drag=null,this._kb=null,this._moving=!1,this.controlled=!1,this._observer=null,this._onPointerDown=this._onPointerDown.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onFocusOut=this._onFocusOut.bind(this),this._onDragStart=e=>e.preventDefault(),this._onDocMove=this._onDocMove.bind(this),this._onDocUp=this._onDocUp.bind(this),this._onDocCancel=this._onDocCancel.bind(this),this._onDocKey=this._onDocKey.bind(this),this._onDocTouchMove=e=>{this._drag?.started&&e.preventDefault()},this._onSelectStart=e=>e.preventDefault(),this._scrollTick=this._scrollTick.bind(this)}connectedCallback(){o.add(this),this.addEventListener(`pointerdown`,this._onPointerDown),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`focusout`,this._onFocusOut),this.addEventListener(`dragstart`,this._onDragStart),this._observer=new MutationObserver(()=>this._syncMirrors()),this._observer.observe(this,{childList:!0}),this._syncMirrors()}disconnectedCallback(){o.delete(this),this.removeEventListener(`pointerdown`,this._onPointerDown),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`focusout`,this._onFocusOut),this.removeEventListener(`dragstart`,this._onDragStart),this._observer?.disconnect(),this._observer=null,this._abort()}attributeChangedCallback(e){e===`disabled`&&this._abort(),this.isConnected&&this._syncMirrors()}get order(){return this._items().map(e=>e.getAttribute(`data-id`))}set order(e){if(this._drag?.started||this._kb)return;let t=this._items(),n=new Map(t.map(e=>[e.getAttribute(`data-id`),e])),r=[];for(let t of e??[]){let e=n.get(String(t));e&&!r.includes(e)&&r.push(e)}[...r,...t.filter(e=>!r.includes(e))].forEach((e,t)=>{let n=this._items()[t]??null;n!==e&&this.insertBefore(e,n)}),this._syncMirrors()}_items(){return[...this.querySelectorAll(`:scope > [data-id]`)].filter(e=>e instanceof HTMLElement)}_itemFrom(e){let t=e;for(;t&&t.parentElement!==this;)t=t.parentElement;return t instanceof HTMLElement&&t.hasAttribute(`data-id`)?t:null}_itemDisabled(e){return e.hasAttribute(`data-disabled`)}_horizontal(){return this.getAttribute(`orientation`)===`horizontal`}_syncMirrors(){t(this,this.order.map(e=>e??``))}_insertAt(e,t){let n=this._items();if(n.indexOf(e)===t)return;let r=n.filter(t=>t!==e),i=r[t]??null;i?this.insertBefore(e,i):r.length>0?r[r.length-1]?.after(e):this.appendChild(e)}_indexFor(e,t,n){let r=this._items().filter(t=>t!==e),i=this._horizontal();for(let[e,a]of r.entries()){let r=a.getBoundingClientRect();if(i?n<r.top||n<=r.bottom&&t<r.left+r.width/2:n<r.top+r.height/2)return e}return r.length}_peers(){let e=this.getAttribute(`group`);return[...o].filter(t=>t===this||e&&t.getAttribute(`group`)===e&&!t.hasAttribute(`disabled`))}_labelOf(e){return e.getAttribute(`data-label`)||(e.textContent??``).replace(/\s+/g,` `).trim()||e.getAttribute(`data-id`)}_announce(e){let t=this.querySelector(`:scope > .wui-sortable-live`);t||(t=document.createElement(`div`),t.className=`wui-sortable-live`,t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),t.setAttribute(`aria-atomic`,`true`),this.appendChild(t)),t.textContent=e}_position(e){let t=this._items();return r(a().positionText,{position:t.indexOf(e)+1,total:t.length})}_onPointerDown(e){if(this._drag||this._kb||this.hasAttribute(`disabled`)||e.pointerType===`mouse`&&e.button!==0)return;let t=e.target;if(!(t instanceof Element))return;let n=this._itemFrom(t);if(!n||this._itemDisabled(n))return;let r=n.querySelector(`:scope > ${s}`),i=!!r&&r.contains(t);if(this.hasAttribute(`handle`)&&!i)return;if(!i){let e=t.closest?.(c);if(e&&e!==n&&n.contains(e))return}let a=e.pointerType===`touch`&&!i,o={item:n,pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,x:e.clientX,y:e.clientY,slop:e.pointerType===`touch`?u:l,ready:!a,started:!1,timer:null,raf:0,list:this,ghost:null,offsetX:0,offsetY:0,fromIndex:0};this._drag=o,a&&(o.timer=setTimeout(()=>{o.timer=null,o.ready=!0,this._begin()},d)),document.addEventListener(`pointermove`,this._onDocMove),document.addEventListener(`pointerup`,this._onDocUp),document.addEventListener(`pointercancel`,this._onDocCancel),document.addEventListener(`keydown`,this._onDocKey,!0),document.addEventListener(`touchmove`,this._onDocTouchMove,{passive:!1})}_onDocMove(e){let t=this._drag;if(t&&e.pointerId===t.pointerId){if(t.x=e.clientX,t.y=e.clientY,!t.started){let e=Math.hypot(t.x-t.startX,t.y-t.startY);if(!t.ready){e>t.slop&&this._finish(!0);return}if(e<t.slop||(this._begin(),!this._drag?.started))return}e.preventDefault?.(),this._moveGhost(),this._update()}}_onDocUp(e){this._drag&&e.pointerId===this._drag.pointerId&&this._finish(!1)}_onDocCancel(e){this._drag&&e.pointerId===this._drag.pointerId&&this._finish(!0)}_onDocKey(e){e.key===`Escape`&&this._drag&&(e.preventDefault(),e.stopPropagation(),this._finish(!0))}_begin(){let e=this._drag;if(!e||e.started)return;e.started=!0;let t=e.item.getBoundingClientRect();e.offsetX=e.startX-t.left,e.offsetY=e.startY-t.top,e.fromIndex=this._items().indexOf(e.item);let n=e.item.cloneNode(!0);if(!(n instanceof HTMLElement))throw Error(`drag ghost is not an HTML element`);for(let e of[n,...n.querySelectorAll(`[id],[data-id]`)])e.removeAttribute(`id`),e.removeAttribute(`data-id`);n.classList.add(`wui-sortable-ghost`),n.setAttribute(`aria-hidden`,`true`),n.inert=!0,n.style.width=`${t.width}px`,n.style.height=`${t.height}px`,e.ghost=n,e.item.classList.add(`wui-sortable-dragging`),document.body.appendChild(n),document.documentElement.classList.add(`wui-sortable-active`),document.addEventListener(`selectstart`,this._onSelectStart),this._moveGhost(),e.raf=requestAnimationFrame(this._scrollTick),this._emit(this,`wui-sortable:start`,{id:e.item.getAttribute(`data-id`)})}_moveGhost(){let e=this._drag;e?.ghost&&(e.ghost.style.transform=`translate(${e.x-e.offsetX}px, ${e.y-e.offsetY}px)`)}_update(){let e=this._drag;if(!e?.started)return;let t=e.list;for(let n of this._peers()){let r=n.getBoundingClientRect();if(e.x>=r.left&&e.x<=r.right&&e.y>=r.top&&e.y<=r.bottom){t=n;break}}let n=t._indexFor(e.item,e.x,e.y);(t!==e.list||n!==t._items().indexOf(e.item))&&t._insertAt(e.item,n),e.list=t}_scrollTick(){let e=this._drag;if(!e?.started)return;let t=g(e.list),n=t?t.getBoundingClientRect():null,r=Math.max(n?.top??0,0),i=Math.min(n?.bottom??window.innerHeight,window.innerHeight),a=Math.max(n?.left??0,0),o=Math.min(n?.right??window.innerWidth,window.innerWidth),s=h(e.y,r,i),c=h(e.x,a,o);(c||s)&&(t?(t.scrollTop+=s,t.scrollLeft+=c):window.scrollBy(c,s),this._update()),e.raf=requestAnimationFrame(this._scrollTick)}_finish(e){let t=this._drag;if(!t||(this._drag=null,clearTimeout(t.timer??void 0),cancelAnimationFrame(t.raf),document.removeEventListener(`pointermove`,this._onDocMove),document.removeEventListener(`pointerup`,this._onDocUp),document.removeEventListener(`pointercancel`,this._onDocCancel),document.removeEventListener(`keydown`,this._onDocKey,!0),document.removeEventListener(`touchmove`,this._onDocTouchMove),document.removeEventListener(`selectstart`,this._onSelectStart),!t.started))return;t.ghost?.remove(),document.documentElement.classList.remove(`wui-sortable-active`),t.item.classList.remove(`wui-sortable-dragging`);let n=t.item.getAttribute(`data-id`);e?(this._insertAt(t.item,t.fromIndex),this._syncMirrors(),t.list!==this&&t.list._syncMirrors()):this._settle(t.item,this,t.fromIndex,t.list),this._emit(this,`wui-sortable:end`,{id:n,cancelled:e})}_settle(e,t,n,i){let o=i._items().indexOf(e);if(i===t&&o===n)return;let s=e.getAttribute(`data-id`),c=i.order,l=i!==t,u=t.order;l&&(t.controlled||i.controlled)&&t._insertAt(e,n),t._syncMirrors(),i._syncMirrors();let d=i._labelOf(e),f=l&&i.getAttribute(`aria-label`)?r(a().destinationText,{destination:String(i.getAttribute(`aria-label`))}):``,p={id:s,fromIndex:n,toIndex:o,from:t,to:i};l&&this._emit(t,`wui-sortable:change`,{...p,ids:u}),this._emit(i,`wui-sortable:change`,{...p,ids:c}),i._announce(r(a().movedPositionText,{label:String(d),destination:f,position:o+1,total:c.length}))}_emit(e,t,n){e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}_abort(){this._drag&&this._finish(!0),this._kb&&this._dropKeyboard(!0)}_onKeyDown(e){if(this.hasAttribute(`disabled`))return;let t=e.target;if(!(t instanceof Element))return;let n=t.closest(s),i=n instanceof HTMLElement?n:null,o=i&&i.parentElement?.parentElement===this?i.parentElement:null;if(!i||!o||this._itemDisabled(o)||this._drag)return;let c=e.key;if(!this._kb){if(c!==` `&&c!==`Enter`)return;e.preventDefault(),this._liftKeyboard(o,i)}else if(this._kb.item===o){if(c===` `||c===`Enter`)e.preventDefault(),this._dropKeyboard(!1);else if(c===`Escape`)e.preventDefault(),e.stopPropagation(),this._dropKeyboard(!0);else if([`ArrowUp`,`ArrowLeft`,`ArrowDown`,`ArrowRight`,`Home`,`End`].includes(c)){e.preventDefault();let t=this._items(),n=t.indexOf(o),s=t.length-1,l=c===`Home`?0:c===`End`?s:Math.max(0,Math.min(s,n+(c===`ArrowUp`||c===`ArrowLeft`?-1:1)));if(l===n){let e=a();this._announce(r(n===0?e.alreadyFirstText:e.alreadyLastText,{label:String(this._labelOf(o)),position:this._position(o)}));return}this._moveFocused(()=>this._insertAt(o,l),i),this._announce(r(a().movedText,{label:String(this._labelOf(o)),position:this._position(o)}))}}}_onFocusOut(e){if(!this._kb||this._moving)return;let t=e.relatedTarget;if(t&&!(t instanceof Node))throw Error(`focus moved to a non-node target`);t&&this._kb.handle.contains(t)||this._dropKeyboard(!1)}_liftKeyboard(e,t){this._kb={item:e,handle:t,fromIndex:this._items().indexOf(e)},t.setAttribute(`aria-pressed`,`true`),this._announce(r(a().liftedText,{label:String(this._labelOf(e)),position:this._position(e)}))}_dropKeyboard(e){let t=this._kb;t&&(this._kb=null,t.handle.removeAttribute(`aria-pressed`),e?(this._moveFocused(()=>this._insertAt(t.item,t.fromIndex),t.handle),this._announce(r(a().reorderCancelledText,{label:String(this._labelOf(t.item)),position:this._position(t.item)}))):this._items().indexOf(t.item)===t.fromIndex?this._announce(r(a().droppedText,{label:String(this._labelOf(t.item)),position:this._position(t.item)})):this._settle(t.item,this,t.fromIndex,this))}_moveFocused(e,t){this._moving=!0;let n=this.contains(document.activeElement);e(),n&&document.activeElement!==t&&t.focus(),this._moving=!1}};function h(e,t,n){return e<t+f?-Math.ceil(p*Math.min(1,(t+f-e)/f)):e>n-f?Math.ceil(p*Math.min(1,(e-(n-f))/f)):0}function g(e){for(let t=e.parentElement;t&&t!==document.body&&t!==document.documentElement;t=t.parentElement){let e=getComputedStyle(t),n=/(auto|scroll)/.test(e.overflowY)&&t.scrollHeight>t.clientHeight,r=/(auto|scroll)/.test(e.overflowX)&&t.scrollWidth>t.clientWidth;if(n||r)return t}return null}export{m as t};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{t as e}from"./elementBase-Cxeyx0tU.js";import{r as t,t as n}from"./fieldState-D-zQcXUS.js";import{t as r}from"./formMirror-9IpSgeZb.js";import{t as i}from"./iconGlyphs.g-DxSJLQJ8.js";import{t as a}from"./imeSafeEnter-DPs9qL3S.js";import{a as o,l as s,s as c}from"./nativeOverlay-C1Rw2gIW.js";import{n as l}from"./optionLabel-B2cU4Ax0.js";import{r as u,t as d}from"./textStore-opIEM4lu.js";import{t as f}from"./timePicker.g-DM61i-ZE.js";var p=()=>u(`timePicker`,f),m=e=>String(e).padStart(2,`0`),h=(e,t)=>`${m(e)}:${m(t)}`,g=e=>{let t=/^(\d{2}):(\d{2})$/.exec(e||``);return t?{h:Number(t[1]),m:Number(t[2])}:null},_=(e,t=`24`)=>{if(!e)return``;if(t===`24`)return h(e.h,e.m);let n=e.h%12||12,r=e.h>=12?`PM`:`AM`;return`${n}:${m(e.m)} ${r}`},v=e=>{let t=String(e||``).trim().toLowerCase(),n=/^(\d{1,2})(?:[:.](\d{2})|(\d{2}))?\s*(?:([ap])\.?\s*(?:m\.?)?)?$/.exec(t);if(!n)return null;let r=Number(n[1]),i=+(n[2]??n[3]??`0`);if(i>59)return null;if(n[4]){if(r<1||r>12)return null;r=r%12+(n[4]===`p`?12:0)}else if(r>23)return null;return{h:r,m:i}},y=(e,t,n)=>{let r=e.querySelector(t);return r instanceof n?r:null},b=(e,t,n)=>[...e.querySelectorAll(t)].filter(e=>e instanceof n),x=(e,t,n)=>{let r=e.closest(t);return r instanceof n?r:null},S=()=>{throw Error(`wui-timepicker is not rendered`)},C=0,w=class extends e{static formAssociated=!0;_internals;_value;_uid;_typedError;_typeahead;_typeaheadTimer;_rendered;_defaultValue;_isOpen;_lastPointer;_open=S;_close=S;_revertOnClose=!1;_refocusOnClose=!1;static get observedAttributes(){return[`value`,`min`,`max`,`step`,`format`,`placeholder`,`disabled`,`readonly`,`loading`,`required`,`size`,`aria-label`,`aria-describedby`,`aria-invalid`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``,this._uid=`wui-tp-${++C}`,this._typedError=``,this._typeahead=``,this._typeaheadTimer=void 0,this.addEventListener(`focusout`,e=>{this._isOpen?.()&&e.relatedTarget instanceof Node&&!this.contains(e.relatedTarget)&&this._close({commit:!0})})}connectedCallback(){this._rendered||this.render()}attributeChangedCallback(e,t,n){if(this._rendered)switch(e){case`value`:this._value=n||``,this._typedError=``,this._syncFormValue(),this._syncText(),this._syncInvalid();return;case`aria-invalid`:case`aria-describedby`:this._syncInvalid();return;case`aria-label`:case`placeholder`:case`disabled`:case`readonly`:case`loading`:case`required`:this._syncAttrs();return;default:this.render()}}formResetCallback(){this.value=this._defaultValue||``}get value(){return this._value}set value(e){this._value=e||``,this._typedError=``,r(this,this._value),this._syncText(),this._syncInvalid()}_format(){return this.getAttribute(`format`)||`24`}_step(){return Math.max(1,parseInt(this.getAttribute(`step`)||`30`,10)||30)}_bounds(){let e=g(this.getAttribute(`min`))||{h:0,m:0},t=g(this.getAttribute(`max`))||{h:23,m:59};return{min:e.h*60+e.m,max:t.h*60+t.m}}_allowed(e,t){let n=e*60+t,{min:r,max:i}=this._bounds();return n>=r&&n<=i&&n%this._step()===0}_times(){let e=[];for(let t=0;t<1440;t+=this._step()){let n=Math.floor(t/60),r=t%60;this._allowed(n,r)&&e.push({h:n,m:r})}return e}_refusal(e){if(this._allowed(e.h,e.m))return``;let t=this._format(),{min:n,max:r}=this._bounds(),i=e.h*60+e.m,a=e=>_({h:Math.floor(e/60),m:e%60},t);if(i<n||i>r){let e=!!g(this.getAttribute(`min`)),t=!!g(this.getAttribute(`max`));return e&&t?d(p().rangeText,{min:a(n),max:a(r)}):e?d(p().minText,{min:a(n)}):d(p().maxText,{max:a(r)})}return d(p().stepText,{step:this._step()})}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``,this._value=this._defaultValue||this._value),this._endOpenColumns(),this._isOpen=null;let e=this.getAttribute(`size`),t=e===`sm`?` wui-input-sm`:e===`lg`?` wui-input-lg`:e===`xl`?` wui-input-xl`:``,n=this._uid;this.innerHTML=`
|
|
2
|
+
<div class="timepicker">
|
|
3
|
+
<div class="wui-timepicker-field">
|
|
4
|
+
<input type="text" class="input timepicker-trigger${t}" id="${n}-input" role="combobox" aria-haspopup="dialog" aria-expanded="false" aria-controls="${n}-pop" aria-autocomplete="none" autocomplete="off" spellcheck="false">
|
|
5
|
+
<button type="button" class="wui-timepicker-toggle" tabindex="-1" aria-label="${l(p().chooseTimeLabel)}" aria-haspopup="dialog" aria-expanded="false" aria-controls="${n}-pop">${i(`clock`)}</button>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="timepicker-pop" id="${n}-pop" role="dialog" aria-label="${l(p().chooseTimeLabel)}" popover="auto"></div>
|
|
8
|
+
<div class="field-error wui-timepicker-error" id="${n}-error" hidden></div>
|
|
9
|
+
</div>`,this._rendered=!0,this._syncAttrs(),this._syncText(),this._syncInvalid(),r(this,this._value),this._wire()}_input(){return y(this,`.timepicker-trigger`,HTMLInputElement)}_pop(){return y(this,`.timepicker-pop`,HTMLDivElement)}_syncFormValue(){r(this,this._value)}_syncAttrs(){let e=this._input(),i=y(this,`.wui-timepicker-toggle`,HTMLButtonElement);if(!e)return;let a=this.hasAttribute(`disabled`);e.disabled=a,e.readOnly=n(this),i&&(i.disabled=a),t(this,e),e.placeholder=this.getAttribute(`placeholder`)||p().placeholder,this.hasAttribute(`required`)?e.setAttribute(`aria-required`,`true`):e.removeAttribute(`aria-required`);let o=this.getAttribute(`aria-label`);o?e.setAttribute(`aria-label`,o):e.removeAttribute(`aria-label`),r(this,this._value),n(this)&&this._isOpen?.()&&this._close({commit:!1})}_syncText(){let e=this._input();e&&(e.value=_(g(this._value),this._format()),this._isOpen?.()&&this._syncColumns())}_syncInvalid(){let e=this._input(),t=y(this,`.wui-timepicker-error`,HTMLDivElement);if(!e||!t)return;let n=this._typedError;t.textContent=n,t.hidden=!n,this.hasAttribute(`aria-invalid`)||n?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`);let r=[this.getAttribute(`aria-describedby`),n?t.id:null].filter(Boolean).join(` `);r?e.setAttribute(`aria-describedby`,r):e.removeAttribute(`aria-describedby`),e.setCustomValidity?.(n)}_commitText(){let e=this._input();if(!e||e.value===_(g(this._value),this._format()))return!0;let t=e.value.trim(),n=``;if(t){let e=v(t),r=e?this._refusal(e):d(p().refusalText,{example:this._format()===`12`?`7:45 PM`:`19:45`});if(!e||r)return this._typedError=r,this._syncInvalid(),!1;n=h(e.h,e.m)}let r=n!==this._value;return this.value=n,r&&this.dispatchEvent(new Event(`change`,{bubbles:!0})),!0}_pending(){let e=v(this._input()?.value);return e&&this._allowed(e.h,e.m)?e:null}_columnsHtml(){let e=this._format(),t=this._times(),n=(e,t,n)=>`<div class="wui-timepicker-col" role="listbox" aria-label="${l(t)}" data-col="${e}">${n.map(e=>`<button type="button" class="timepicker-option" role="option" tabindex="-1" aria-selected="false" data-v="${e.v}">${e.text}</button>`).join(``)}</div>`,r=[...new Set(t.map(e=>e.h))],i=[...new Set(t.map(e=>e.m))].sort((e,t)=>e-t),a;if(e===`12`){let e=[...new Set(r.map(e=>e%12))].sort((e,t)=>e-t),t=[...new Set(r.map(e=>e>=12?`pm`:`am`))].sort();a=n(`hour`,p().hour,e.map(e=>({v:e,text:String(e||12)})))+n(`minute`,p().minute,i.map(e=>({v:e,text:m(e)})))+n(`period`,p().periodLabel,t.map(e=>({v:e,text:e.toUpperCase()})))}else a=n(`hour`,p().hour,r.map(e=>({v:e,text:m(e)})))+n(`minute`,p().minute,i.map(e=>({v:e,text:m(e)})));return`<div class="wui-timepicker-cols">${a}</div>`}_selectedIn(e,t){return t?e===`minute`?String(t.m):e===`period`?t.h>=12?`pm`:`am`:String(this._format()===`12`?t.h%12:t.h):null}_optionEnabled(e,t,n){if(!n)return!0;let r=this._format()===`12`,i=n.h>=12,a=e=>r?[e+(i?12:0)]:[e],o=Array.from({length:60},(e,t)=>t);if(e===`hour`)return a(Number(t)).some(e=>o.some(t=>this._allowed(e,t)));if(e===`minute`)return this._allowed(n.h,Number(t));let s=t===`pm`?12:0;return Array.from({length:12},(e,t)=>s+t).some(e=>o.some(t=>this._allowed(e,t)))}_syncColumns({scroll:e=!1}={}){let t=this._pop();if(!t)return;let n=this._pending();for(let r of b(t,`.wui-timepicker-col`,HTMLElement)){let t=r.dataset.col,i=this._selectedIn(t,n),a=b(r,`.timepicker-option`,HTMLButtonElement),o=null;for(let e of a){let r=e.dataset.v===i;e.classList.toggle(`is-selected`,r),e.setAttribute(`aria-selected`,r?`true`:`false`),e.disabled=!r&&!this._optionEnabled(t,e.dataset.v,n),r&&(o=e)}o=o||a.find(e=>!e.disabled)||null;for(let e of a)e.tabIndex=e===o?0:-1;e&&o&&(r.scrollTop=o.offsetTop-(r.clientHeight-o.offsetHeight)/2)}}_pick(e,t){let n=this._times(),r=n[0];if(!r)return;let i=this._pending()||r,a=this._format()===`12`,o=i.h,s=i.m;if(e===`minute`?s=Number(t):o=e===`period`?o%12+(t===`pm`?12:0):a?Number(t)+(i.h>=12?12:0):Number(t),!this._allowed(o,s)){let t=o*60+s,r=n.filter(t=>e===`minute`?t.m===s:e===`period`?t.h>=12==o>=12:a?t.h%12==o%12&&t.h>=12==o>=12:t.h===o).sort((e,n)=>Math.abs(e.h*60+e.m-t)-Math.abs(n.h*60+n.m-t))[0];if(!r)return;o=r.h,s=r.m}let c=this._input();c&&(c.value=_({h:o,m:s},this._format()),this._typedError=``,this._syncInvalid(),this._syncColumns())}_onColumnKey(e){let t=e.target instanceof Element?x(e.target,`.timepicker-option`,HTMLButtonElement):null,n=t&&x(t,`.wui-timepicker-col`,HTMLElement);if(!t||!n)return;let r=b(n,`.timepicker-option`,HTMLButtonElement).filter(e=>!e.disabled),i=r.indexOf(t),o=this._pop();if(!o)return;let s=b(o,`.wui-timepicker-col`,HTMLElement),c=e=>{e&&(this._pick(n.dataset.col,e.dataset.v),(y(n,`.timepicker-option.is-selected`,HTMLElement)||e).focus())};switch(e.key){case`ArrowDown`:e.preventDefault(),c(r[Math.min(i+1,r.length-1)]);return;case`ArrowUp`:e.preventDefault(),c(r[Math.max(i-1,0)]);return;case`Home`:e.preventDefault(),c(r[0]);return;case`End`:e.preventDefault(),c(r[r.length-1]);return;case`PageDown`:e.preventDefault(),c(r[Math.min(i+8,r.length-1)]);return;case`PageUp`:e.preventDefault(),c(r[Math.max(i-8,0)]);return;case`ArrowRight`:case`ArrowLeft`:{e.preventDefault();let t=s[s.indexOf(n)+(e.key===`ArrowRight`?1:-1)];(t&&y(t,`.timepicker-option[tabindex="0"]`,HTMLButtonElement))?.focus();return}case`Enter`:if(!a(e))return;e.preventDefault(),this._close({commit:!0,refocus:!0});return;case` `:e.preventDefault(),c(t);return;case`Escape`:e.preventDefault(),e.stopPropagation(),this._close({commit:!1,refocus:!0});return;default:e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey||(e.preventDefault(),clearTimeout(this._typeaheadTimer),this._typeahead+=e.key.toLowerCase(),this._typeaheadTimer=window.setTimeout(()=>{this._typeahead=``,this._typeaheadTimer=void 0},500),c(r.find(e=>(e.textContent??``).trim().toLowerCase().startsWith(this._typeahead))))}}_wire(){this._teardown();let e=this._input(),t=y(this,`.wui-timepicker-toggle`,HTMLButtonElement),r=this._pop(),i=y(this,`.timepicker`,HTMLDivElement);if(!e)throw Error(`<wui-timepicker> has no .timepicker-trigger input.`);if(!r)throw Error(`<wui-timepicker> has no .timepicker-pop list.`);let l=y(this,`.wui-timepicker-field`,HTMLElement);if(!l)throw Error(`<wui-timepicker> has no .wui-timepicker-field to place its list against.`);let u=()=>c(r);this._isOpen=u;let d=()=>y(r,`.wui-timepicker-col .timepicker-option[tabindex="0"]`,HTMLElement)?.focus(),f=e=>{e.key===`Escape`&&(this._revertOnClose=!0,this._refocusOnClose=!0)};this._open=({focus:a=!1}={})=>{if(!n(this)){if(!u()){if(r.innerHTML=this._columnsHtml(),s(l,r,{mode:`auto`,onClosed:()=>{this.removeEventListener(`keydown`,f,!0);let e=this._revertOnClose,t=this._refocusOnClose;this._revertOnClose=!1,this._refocusOnClose=!1,p({commit:!e,refocus:t})}}),!u())return;i?.classList.add(`open`),e.setAttribute(`aria-expanded`,`true`),t?.setAttribute(`aria-expanded`,`true`),this.addEventListener(`keydown`,f,!0),this._syncColumns({scroll:!0})}a&&d()}};let p=({commit:n=!0,refocus:a=!1}={})=>{let o=r.contains(document.activeElement);r.innerHTML=``,i?.classList.remove(`open`),e.setAttribute(`aria-expanded`,`false`),t?.setAttribute(`aria-expanded`,`false`),clearTimeout(this._typeaheadTimer),this._typeaheadTimer=void 0,this._typeahead=``,n?this._commitText():(this._typedError=``,this._syncText(),this._syncInvalid()),(a||o)&&e.focus()};this._close=(e={})=>{if(!u())return;let{commit:t=!0,refocus:n=!1}=e;this._revertOnClose=!t,this._refocusOnClose=n,o(r)},e.addEventListener(`pointerdown`,e=>{this._lastPointer=e.pointerType}),e.addEventListener(`click`,()=>{this._lastPointer!==`touch`&&!u()&&this._open(),this._lastPointer=null}),t?.addEventListener(`click`,()=>{u()?this._close({commit:!0,refocus:!0}):this._open({focus:!0})}),t?.addEventListener(`keydown`,e=>{e.key===`Escape`&&u()&&(e.preventDefault(),e.stopPropagation(),this._close({commit:!1,refocus:!0}))}),e.addEventListener(`keydown`,e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`)e.preventDefault(),this._open({focus:!0});else if(a(e)){let t=u(),n=this._commitText();t&&n&&this._close({commit:!1}),(!n||t)&&e.preventDefault()}else e.key===`Escape`&&u()?(e.preventDefault(),e.stopPropagation(),this._close({commit:!1})):e.key===`Tab`&&u()&&this._close({commit:!0})}),e.addEventListener(`input`,e=>{e.stopPropagation(),this._typedError&&(this._typedError=``,this._syncInvalid()),u()&&this._syncColumns({scroll:!0})}),e.addEventListener(`change`,e=>{e.stopPropagation(),u()||this._commitText()}),r.addEventListener(`click`,e=>{let t=e.target instanceof Element?x(e.target,`.timepicker-option`,HTMLButtonElement):null,n=t&&x(t,`.wui-timepicker-col`,HTMLElement);t&&n&&!t.disabled&&this._pick(n.dataset.col,t.dataset.v)}),r.addEventListener(`keydown`,e=>{u()&&this._onColumnKey(e)})}_teardown(){clearTimeout(this._typeaheadTimer),this._typeaheadTimer=void 0,this._typeahead=``}_endOpenColumns(){let e=this._pop();e&&(this._revertOnClose=!0,o(e),this._revertOnClose=!1)}disconnectedCallback(){this._teardown(),this._endOpenColumns()}};export{w as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./anchorOverlay-B8fu8hjz.js";import{n,t as r}from"./buttonClass-GtEi8hAY.js";import{t as i}from"./elementBase-Cxeyx0tU.js";import{d as a,f as o,o as s,u as c}from"./nativeOverlay-C1Rw2gIW.js";import{r as l}from"./textStore-opIEM4lu.js";import{n as u,t as d}from"./tourAdvance.g-BJqDnqag.js";import{t as f}from"./imeSafeEnter-DPs9qL3S.js";import{t as p}from"./tourOpenMark-nPeAJFSo.js";import{t as m}from"./tourSeenStore-z0Y_Znzx.js";var h=`data-advance`,g=`wui-tour-hint`,_=`wui-tour-pointer`,v=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,y=()=>l(`tourAdvance`,d),b=(e,t)=>e?.advanceOn===`click`&&!!t,x=e=>(e??``).replace(/\s+/g,` `).trim(),ee=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLMeterElement||e instanceof HTMLOutputElement||e instanceof HTMLProgressElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?e.labels:null,te=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLFieldSetElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement?e.disabled:!1;function ne(e){let t=e.ownerDocument,n=(e.getAttribute(`aria-labelledby`)||``).split(/\s+/).filter(Boolean),r=e instanceof HTMLInputElement&&/^(button|submit|reset)$/.test(e.type)?e.value:``,i=[n.map(e=>t.getElementById(e)?.textContent??``).join(` `),e.getAttribute(`aria-label`),Array.from(ee(e)??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=x(e);if(t)return t}return``}function re(e){for(let t of[e,...e.querySelectorAll(v)])if((t instanceof HTMLElement||t instanceof SVGElement)&&t.tabIndex>=0&&!te(t))return t;return null}function S(e,t,n){let r=(e.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(e=>e&&e!==t);n&&r.push(t),r.length>0?e.setAttribute(`aria-describedby`,r.join(` `)):e.removeAttribute(`aria-describedby`)}function ie(e,t){let n=e.querySelector(`.${g}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;if(!t)n?.remove(),i&&S(e,i,!1);else{if(!n){n=e.ownerDocument.createElement(`p`),n.className=g,i&&(n.id=i);let t=e.querySelector(`.wui-tour-actions`);if(!t)throw Error(`Tour card has no actions row.`);t.before(n)}n.textContent=t,i&&S(e,i,!0)}}function ae(e,t){let n=e.querySelector(`.${_}`);if(!t){n?.remove();return}if(n)return;let r=e.ownerDocument.createElement(`span`);r.className=_,r.setAttribute(`aria-hidden`,`true`),e.append(r)}var oe=e=>getComputedStyle(e).animationName;function C(e,{layer:t,spot:n,card:r},i,a){let o=b(i,a);t.toggleAttribute(h,o&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(h)&&(n.removeAttribute(h),o&&oe(n)),o&&n.setAttribute(h,``),ae(n,o);let s=r.querySelector(`.wui-tour-next`);if(!(s instanceof HTMLElement))throw Error(`Tour card has no next button.`);s.classList.toggle(`btn-primary`,!o),s.classList.toggle(`btn-link`,o);let c=o?x(i?.actionLabel)||ne(a):``,l=e.getAttribute(`advance-label`)||y().advanceLabel,u=c?l.replace(/\{actionName\}/g,()=>c):``;return ie(r,u),u}function se(e,t,n){if(!b(e,t))return()=>{};let r,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function ce(e,t,n,r){return e.contains(r)||b(t,n)&&n.contains(r)}function le(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=b(r,i)?re(i):null;o&&a.push(o);let s=a.findIndex(e=>e===n||e===o&&i?.contains(n));e.preventDefault();let c=a[s===-1?e.shiftKey?a.length-1:0:(s+(e.shiftKey?-1:1)+a.length)%a.length];if(!c)throw Error(`Tour card has no focus stop.`);c.focus()}var ue=2/3,de=1e3,w=/* @__PURE__ */ new Set([`top`,`left`,`width`,`height`]),T=/* @__PURE__ */ new WeakMap,E=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],D=e=>`transitionProperty`in e&&e.transitionProperty===`opacity`,fe=e=>`transitionProperty`in e&&typeof e.transitionProperty==`string`&&w.has(e.transitionProperty),pe=e=>`animationName`in e&&typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function O(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,de);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function me(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?E(t,fe):[]){let t=e.effect?.getComputedTiming?.();if(typeof t?.duration!=`number`)continue;let r=typeof e.currentTime==`number`?e.currentTime:0;n=Math.max(n,(t.delay??0)+t.duration*ue-r)}return n}function k(e){let t=me(e);t>0?e.style.setProperty(`--wui-tour-card-delay`,`${Math.round(t)}ms`):e.style.removeProperty(`--wui-tour-card-delay`),e.dataset.state=`entering`;let n={};T.set(e,n);let r=()=>{T.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=E(e,pe);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function A(e){return e.dataset.state=`leaving`,O(E(e,D))}function he(e){let t=e.shadowRoot?.querySelector(`.wui-tour-layer`),n=e.classList.contains(`wui-tour-layer`)?e:t instanceof HTMLElement?t:null;n&&(n.dataset.state=`leaving`);let r=n?O(E(n,D)):null;r?(e.setAttribute(`inert`,``),r.then(()=>e.remove())):e.remove()}var ge=2,j=12,M=8,N=4,P=20,_e=`(max-width: 575.98px)`,ve=[`bottom`,`top`,`right`,`left`],F=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],I,L=(e,t,n)=>Math.max(t,Math.min(e,n)),R=(e,t,n,r)=>(Math.max(e,n)+Math.min(t,r))/2;function ye(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=B(e),r=e.offsetHeight+j;if(t.getBoundingClientRect().height+4+r*2<=n.bottom-n.top){t.scrollIntoView({block:`center`,inline:`nearest`});return}let i=t.style.scrollMarginTop;t.style.scrollMarginTop=`${n.top+r+ge}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function z(e,t,n){let r=e.style,i=t.style,a=we(t);if(!n){r.top=`50%`,r.left=`50%`,r.width=`0px`,r.height=`0px`,r.boxShadow=`0 0 0 100vmax var(--color-scrim-strong)`;for(let e of F)r.removeProperty(`border-${e}-radius`),r.removeProperty(`corner-${e}-shape`);t.dataset.placement=`center`,a.hidden=!0,i.position=`fixed`,i.top=`50%`,i.left=`50%`,i.transform=`translate(-50%, -50%)`,i.maxHeight=`calc(100vh - 16px)`;return}r.boxShadow=``,i.transform=``,i.position=`fixed`;let o=n.getBoundingClientRect();r.top=`${o.top}px`,r.left=`${o.left}px`,r.width=`${o.width}px`,r.height=`${o.height}px`,be(r,n);let s=t.scrollTop;i.maxHeight=``;let c={width:t.offsetWidth,height:t.offsetHeight},l=B(t),u=l.bottom-l.top,d={bottom:l.bottom-o.bottom-j,top:o.top-j-l.top,right:l.right-o.right-j,left:o.left-j-l.left},f=window.matchMedia(_e).matches,p=ve.find(e=>e===`top`||e===`bottom`?c.height<=d[e]+1:!f&&c.width<=d[e]+1&&c.height<=u+1),m=Math.min(o.bottom,l.bottom+M)-Math.max(o.top,l.top-M);p?xe(t,a,p,o,l,c):m>=Math.min(c.height,u)+8?Se(t,a,o,l,c):Ce(t,a,d.bottom>=d.top?`bottom`:`top`,o,l,c,d),t.scrollTop=s}function be(e,t){I??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of F)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),I&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function xe(e,t,n,r,i,a){let o=n===`top`||n===`bottom`,s,c,l;if(o){let e=R(r.left,r.right,i.left,i.right);s=L(e-a.width/2,i.left,i.right-a.width),c=n===`bottom`?r.bottom+j:r.top-j-a.height,l=L(e-s,P,a.width-P)}else{let e=R(r.top,r.bottom,i.top,i.bottom);c=L(e-a.height/2,i.top,i.bottom-a.height),s=n===`right`?r.right+j:r.left-j-a.width,l=L(e-c,P,a.height-P)}e.dataset.placement=n,e.style.top=`${c}px`,e.style.left=`${s}px`,t.hidden=!1,t.style.left=o?`${l-e.clientLeft-t.offsetWidth/2}px`:``,t.style.top=o?``:`${l-e.clientTop-t.offsetHeight/2}px`}function Se(e,t,n,r,i){let a=r.bottom-r.top;e.dataset.placement=`overlap`,t.hidden=!0,e.style.maxHeight=i.height>a?`${Math.max(a,0)}px`:``;let o=Math.min(n.bottom,r.bottom)-N;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${L(n.left+N,r.left,r.right-i.width)}px`}function Ce(e,t,n,r,i,a,o){let s=Math.max(o[n],0),c=Math.min(a.height,s);e.dataset.placement=n,t.hidden=!0,e.style.maxHeight=a.height>s?`${s}px`:``,e.style.top=`${n===`bottom`?r.bottom+j:r.top-j-c}px`;let l=R(r.left,r.right,i.left,i.right);e.style.left=`${L(l-a.width/2,i.left,i.right-a.width)}px`}function B(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e]??``)||0;return{top:r(`paddingTop`)+M,bottom:window.innerHeight-r(`paddingBottom`)-M,left:r(`paddingLeft`)+M,right:window.innerWidth-r(`paddingRight`)-M}}function we(e){let t=e.querySelector(`:scope > .wui-tour-arrow`);if(t instanceof HTMLElement)return t;let n=document.createElement(`span`);return n.className=`wui-tour-arrow`,n.setAttribute(`aria-hidden`,`true`),n.hidden=!0,e.append(n),n}var Te=0,Ee=`btn btn-sm btn-link`;function V(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`Expected "${t}" to match a ${n.name}.`);return r}function De(e,t,i){let a=`wui-tour-end-${++Te}`,o=!!(t.nextLabel&&t.nextHref),s=i?e.createElement(`dialog`):e.createElement(`div`);s.className=`wui-tour-card wui-tour-end`,s.dataset.layout=`center`,o&&(s.dataset.next=``),s.setAttribute(`role`,`dialog`),s.tabIndex=-1,s.setAttribute(`aria-labelledby`,`${a}-title`),s.setAttribute(`aria-describedby`,`${a}-message`),s.innerHTML=` <div class="wui-tour-end-mark" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></div> <h2 class="wui-tour-title wui-tour-end-title" id="${a}-title"></h2> <p class="wui-tour-text wui-tour-end-message" id="${a}-message"></p> <div class="wui-tour-actions">${o?`<a class="${n(`primary`,`solid`,`sm`)} wui-tour-end-next" data-wui="${r}"></a>`:``}<button type="button" class="${o?Ee:n(`primary`,`solid`,`sm`)} wui-tour-end-button" data-wui="${r}"></button></div>`,V(s,`.wui-tour-end-title`,HTMLElement).textContent=t.title,V(s,`.wui-tour-end-message`,HTMLElement).textContent=t.message,V(s,`.wui-tour-end-button`,HTMLButtonElement).textContent=t.button;let{nextLabel:c,nextHref:l}=t;if(o&&c&&l){let e=V(s,`.wui-tour-end-next`,HTMLAnchorElement);e.textContent=c,e.setAttribute(`href`,l)}return s}var Oe=e=>e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey;function ke(e,t,n){let r=e.ownerDocument,i=De(r,t,e.getRootNode()===r),a=V(i,`.wui-tour-end-button`,HTMLButtonElement),o=i.querySelector(`.wui-tour-end-next`);if(o!==null&&!(o instanceof HTMLAnchorElement))throw Error(`The end dialog's next link is not a link.`);let l=o,u=l??a,d=new AbortController,p=i instanceof HTMLDialogElement?i:null,m=null;return new Promise(o=>{let h=e=>{if(d.abort(),m&&p){let e=m;m=null,s(p).then(e)}o(e)};if(n?.aborted){h(`done`);return}let g=V(e,`.wui-tour-card:not(.wui-tour-end)`,HTMLElement),_=V(e,`.wui-tour-spot`,HTMLElement),v=V(e,`[role=status]`,HTMLElement),y={signal:d.signal};n?.addEventListener(`abort`,()=>h(`done`),y),a.addEventListener(`click`,()=>h(`done`),y),l&&l.addEventListener(`click`,e=>{Oe(e)&&(e.preventDefault(),h(`next`))},y),r.addEventListener(`keydown`,e=>{if(!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`){if(m)return;e.preventDefault(),e.stopPropagation(),h(`done`)}else f(e)&&l&&!e.shiftKey&&(e.composedPath?.()[0]??e.target)===l&&(e.preventDefault(),h(`next`))}},{capture:!0,signal:d.signal});let b=()=>{d.signal.aborted||(g.hidden=!0,z(_,g,null),e.append(i),k(i),p&&(m=c(p,{escape:!0,backdrop:!1,focus:`first-control`,onRequestClose:()=>h(`done`)})),v.textContent=[t.title,t.message].filter(Boolean).join(`. `),u.focus())},x=A(g);x?x.then(b):b()})}var Ae=` :host { all: initial; display: revert-layer; position: fixed; inset: 0; ${Object.entries({"--wui-z-tour":`1550`,"--wui-radius-sm":`8px`,"--wui-radius-lg":`14px`,"--wui-shadow-popover":`0px 8px 28px -6px rgba(7, 20, 55, 0.14)`,"--wui-ease-out":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-ease-linear":`cubic-bezier(0, 0, 1, 1)`,"--wui-duration-fast":`150ms`,"--wui-duration-default":`250ms`,"--wui-duration-slow":`400ms`,"--wui-space-xs":`4px`,"--wui-tour-motion-duration":`200ms`,"--wui-tour-motion-ease":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-tour-spot-duration":`240ms`,"--wui-tour-spot-ease":`cubic-bezier(0.32, 0.72, 0, 1)`,"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-text":`#4F46E5`,"--color-focus-ring":`#4F46E5`,"--wui-focus-ring-width":`2px`,"--wui-focus-ring-offset":`2px`,"--color-on-primary":`#FFFFFF`,"--color-success-soft":`#E8FAEE`,"--color-success-text":`#0e7531`,"--color-on-scrim":`#FFFFFF`,"--color-scrim-strong":`color-mix(in srgb, #071437 62%, transparent)`,"--color-surface":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-bg-muted":`#F5F6FA`}).map(([e,t])=>` ${e}: ${t};`).join(` `)} } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; } .btn { display: inline-block; margin: 0; padding: 0.25rem 0.5rem; border: 1px solid transparent; border-radius: 0.375rem; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; } .btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); } .btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); } .btn-outline-neutral { border-color: var(--color-text-muted); color: var(--color-text-muted); } .btn-outline-neutral:hover { background: var(--color-bg-muted); color: var(--color-text); } .btn-link { font-weight: 400; color: var(--color-primary-text); text-decoration: underline; } .btn-link:hover { color: var(--color-primary-hover); } .wui-tour-layer { pointer-events: none; font-family: "Webority Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 1.5; color: var(--color-text); text-align: start; } .wui-tour-card { pointer-events: auto; } .wui-tour-layer { position: fixed; inset: 0; z-index: var(--wui-z-tour); width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: visible; background: none; } .wui-tour-spot { position: fixed; box-shadow: 0 0 0 2px var(--color-primary), 0 0 4px 2px color-mix(in srgb, var(--color-primary) 30%, transparent), 0 0 0 100vmax var(--color-scrim-strong); pointer-events: none; } .wui-tour-card { display: flex; flex-direction: column; gap: 8px; width: min(360px, 100vw - 16px); padding: 16px; overflow-y: auto; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--wui-radius-lg); corner-shape: squircle; box-shadow: var(--wui-shadow-popover); } .wui-tour-card:focus { outline: none; } .wui-tour-card:focus-visible { outline: var(--wui-focus-ring-width) solid var(--color-focus-ring); outline-offset: var(--wui-focus-ring-offset); } .wui-tour-title { margin: 0; font-size: 16px; font-weight: 600; } .wui-tour-text { margin: 0; font-size: 14px; color: var(--color-text-muted); } .wui-tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; } .wui-tour-nav { display: flex; gap: 8px; } .wui-tour-skip { color: var(--color-text-muted); } .wui-tour-back, .wui-tour-next { min-width: 64px; } @keyframes wui-tour-fade-in { from { opacity: 0; } to { opacity: 1; } } @keyframes wui-tour-card-enter { from { opacity: 0; scale: 0.96; translate: var(--wui-tour-card-lift, 0 6px); } to { opacity: 1; scale: 1; translate: 0 0; } } .wui-tour-layer[data-state=leaving], .wui-tour-card[data-state=leaving] { opacity: 0; } .wui-tour-layer[data-state=leaving], .wui-tour-layer[data-state=leaving] * { pointer-events: none; } @media (prefers-reduced-motion: no-preference) { .wui-tour-layer { animation: wui-tour-fade-in var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-layer[data-state=leaving] { transition: opacity var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-spot { transition: top var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), left var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), width var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), height var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), border-radius var(--wui-tour-spot-duration) var(--wui-tour-spot-ease); } .wui-tour-spot[data-tracking] { transition: none; } .wui-tour-card { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=top] { --wui-tour-card-lift: 0 -6px; transform-origin: bottom center; } .wui-tour-card[data-placement=bottom] { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=left] { --wui-tour-card-lift: -6px 0; transform-origin: right center; } .wui-tour-card[data-placement=right] { --wui-tour-card-lift: 6px 0; transform-origin: left center; } .wui-tour-card[data-placement=overlap], .wui-tour-card[data-placement=center] { --wui-tour-card-lift: 0 0; transform-origin: center; } .wui-tour-card[data-state=entering] { animation: wui-tour-card-enter var(--wui-tour-motion-duration) var(--wui-tour-motion-ease) var(--wui-tour-card-delay, 0ms) both; } .wui-tour-card[data-state=leaving] { transition: opacity calc(var(--wui-tour-motion-duration) / 2) var(--wui-tour-motion-ease); } } @media (prefers-reduced-motion: reduce) { .wui-tour-layer { animation: wui-tour-fade-in var(--wui-duration-fast) var(--wui-ease-linear); } .wui-tour-layer[data-state=leaving] { transition: opacity var(--wui-duration-fast) var(--wui-ease-linear); } .wui-tour-card[data-state=entering] { animation: wui-tour-fade-in var(--wui-duration-fast) var(--wui-ease-linear) both; } } .wui-tour-progress-bar { display: flex; gap: 4px; } .wui-tour-progress-segment { flex: 1 1 0; height: 4px; border-radius: 999px; background: var(--color-border); } .wui-tour-progress-segment[data-filled] { background: var(--color-primary); } .wui-tour-position { margin: 0; font-size: 12px; color: var(--color-text-muted); } .wui-tour-layer { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); } .wui-tour-card:has(.wui-tour-arrow:not([hidden])) { overflow: visible; } .wui-tour-arrow { position: absolute; width: 8px; height: 8px; background: var(--color-surface); border: 1px solid var(--color-border); rotate: 45deg; pointer-events: none; } .wui-tour-card[data-placement=bottom] .wui-tour-arrow { top: -5px; border-right-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=top] .wui-tour-arrow { bottom: -5px; border-top-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=right] .wui-tour-arrow { left: -5px; border-top-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=left] .wui-tour-arrow { right: -5px; border-bottom-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } @media (max-width: 575.98px) { .wui-tour-card { width: calc(100vw - 16px); } .wui-tour-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; } } .wui-tour-media { position: relative; order: -1; flex: none; aspect-ratio: 16/9; margin: -16px -16px 4px; overflow: hidden; background: var(--color-border); } .wui-tour-media>img, .wui-tour-media>video { display: block; width: 100%; height: 100%; object-fit: cover; } .wui-tour-card[data-welcome] { width: min(420px, 100vw - 16px); } .wui-tour-media-toggle { position: absolute; inset-block-end: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--color-scrim-strong); color: var(--color-on-scrim); cursor: pointer; } .wui-tour-media-toggle>svg { width: 20px; height: 20px; fill: currentColor; } .wui-tour-media-toggle:focus-visible { outline: 2px solid var(--color-on-scrim); outline-offset: var(--wui-focus-ring-offset); } .wui-tour-layer[data-advance] { pointer-events: none; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-card { pointer-events: auto; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-spot::before { content: ""; position: absolute; inset: -100vmax; pointer-events: auto; clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, 100vmax 100vmax, calc(100% - 100vmax) 100vmax, calc(100% - 100vmax) calc(100% - 100vmax), 100vmax calc(100% - 100vmax), 100vmax 100vmax); } .wui-tour-hint { margin: 0; font-size: 14px; font-weight: 600; color: var(--color-text); } .wui-tour-pointer { position: absolute; top: 50%; left: 50%; width: 18px; height: 24px; pointer-events: none; } .wui-tour-pointer::before { content: ""; position: absolute; inset: 0; background: var(--color-primary); clip-path: polygon(0 0, 0 75%, 28% 58%, 46% 100%, 62% 92%, 45% 52%, 85% 52%); filter: drop-shadow(1px 0 0 var(--color-surface)) drop-shadow(-1px 0 0 var(--color-surface)) drop-shadow(0 1px 0 var(--color-surface)) drop-shadow(0 -1px 0 var(--color-surface)); } .wui-tour-pointer::after { content: ""; position: absolute; top: -16px; left: -16px; width: 32px; height: 32px; border-radius: 50%; background: var(--color-primary); opacity: 0; display: none; } @media (max-width: 575.98px) { .wui-tour-pointer { width: 24px; height: 24px; translate: -50% -50%; } .wui-tour-pointer::before { clip-path: none; border-radius: 50%; box-shadow: 0 0 0 2px var(--color-surface); filter: none; } .wui-tour-pointer::after { top: -4px; left: -4px; } } @keyframes wui-tour-tap { 0% { opacity: 0; transform: translate(56px, 44px) scale(1); } 10% { opacity: 1; transform: translate(56px, 44px) scale(1); } 45% { transform: translate(0, 0) scale(1); } 52% { transform: translate(0, 0) scale(0.86); } 60% { transform: translate(0, 0) scale(1); } 85% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(0, 0) scale(1); } } @keyframes wui-tour-ripple { 0%, 50% { opacity: 0; transform: scale(0.2); } 52% { opacity: 0.35; transform: scale(0.2); } 80%, 100% { opacity: 0; transform: scale(1); } } @media (prefers-reduced-motion: no-preference) { .wui-tour-pointer { opacity: 0; animation: wui-tour-tap calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } .wui-tour-pointer::after { display: block; animation: wui-tour-ripple calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } } @keyframes wui-tour-check { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } } .wui-tour-end[data-layout=center] { --wui-tour-card-lift: 0 0; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); transform-origin: center; align-items: center; gap: 8px; width: min(420px, 100vw - 16px); max-height: calc(100vh - 16px); padding: 24px; text-align: center; } .wui-tour-end[data-layout=center] .wui-tour-actions { justify-content: center; margin-top: 8px; } .wui-tour-end[data-layout=center][data-next] .wui-tour-actions { flex-direction: column; align-items: stretch; width: 100%; gap: var(--wui-space-xs); } .wui-tour-end-mark { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--color-success-soft); color: var(--color-success-text); } .wui-tour-end-mark>svg { width: 26px; height: 26px; } .wui-tour-end-mark path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; } .wui-tour-end-title { font-size: 18px; } .wui-tour-end-message { text-wrap: balance; } .wui-tour-end-next { text-wrap: balance; } .wui-tour-end-button { min-width: 120px; } @media (prefers-reduced-motion: no-preference) { .wui-tour-end-mark path { animation: wui-tour-check var(--wui-duration-default) var(--wui-ease-out) calc(var(--wui-tour-card-delay, 0ms) + var(--wui-duration-fast)) both; } } `,H=()=>l(`tour`,u),U=`wui-tour-media`,je=`wui-tour-media-toggle`,W=`http://www.w3.org/2000/svg`,Me=`M6 5h4v14H6zM14 5h4v14h-4z`,Ne=`M8 5v14l11-7z`,Pe=()=>({pause:H().mediaPauseLabel,play:H().mediaPlayLabel}),Fe=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function Ie(e){let t=document.createElementNS(W,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(W,`path`);return n.setAttribute(`d`,e),t.appendChild(n),t}function Le(e){let t=document.createElement(`img`);return t.setAttribute(`alt`,e.mediaAlt??``),t.setAttribute(`width`,`1280`),t.setAttribute(`height`,`720`),t.setAttribute(`loading`,`lazy`),t.setAttribute(`decoding`,`async`),t.setAttribute(`src`,e.media??``),t}function Re(e,t){let n=document.createElement(`video`);return n.muted=!0,n.setAttribute(`muted`,``),n.loop=!0,n.setAttribute(`playsinline`,``),t&&n.setAttribute(`autoplay`,``),n.setAttribute(`preload`,t?`auto`:`metadata`),e.mediaAlt&&n.setAttribute(`aria-label`,e.mediaAlt),e.mediaPoster&&n.setAttribute(`poster`,e.mediaPoster),n.setAttribute(`src`,e.media??``),n}function ze(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=je;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(Ie(r?Me:Ne))};return e.addEventListener(`play`,()=>r()),e.addEventListener(`pause`,()=>r()),n.addEventListener(`click`,()=>{e.paused?e.play()?.catch(()=>r()):e.pause()}),r(e.hasAttribute(`autoplay`)),n}function Be(e){let t=e.querySelector(`:scope > .${U}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function Ve(e,t,n=Pe()){if(Be(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=U,t.mediaType===`video`){let e=Re(t,!Fe());r.append(e,ze(e,n))}else r.appendChild(Le(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var He=()=>l(`tour`,u);function G(e){let t=/* @__PURE__ */ new Set;return{drop:e=>{t.add(e)},position:e=>{t.delete(e);let n=0;for(let r of t)r<e&&n++;return e+1-n},total:()=>e-t.size}}function Ue(e,t,n){return(e.getAttribute(`progress-label`)||He().progressLabel).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function We(e,{text:t,position:n,total:r}){let i=e.querySelector(`.wui-tour-position`);if(!(i instanceof HTMLElement))throw Error(`tour position label missing`);i.textContent=t;let a=e.querySelector(`.wui-tour-progress-bar`);if(!a){let t=e.ownerDocument,n=t.createElement(`div`);n.className=`wui-tour-progress`,n.setAttribute(`aria-hidden`,`true`),a=t.createElement(`div`),a.className=`wui-tour-progress-bar`,n.append(a),i.before(n)}let o=a.children;for(;o.length<r;){let t=e.ownerDocument.createElement(`span`);t.className=`wui-tour-progress-segment`,a.append(t)}for(;o.length>r;){let e=a.lastElementChild;if(!e)throw Error(`progress bar segment missing`);e.remove()}for(let e=0;e<o.length;e++){let t=o[e];if(!t)throw Error(`progress bar segment missing`);t.toggleAttribute(`data-filled`,e<n)}}var Ge=`wui-tour-step`,Ke=`wui-tour-host`,K=`data-tracking`,q=()=>l(`tour`,u),qe=()=>({back:q().backLabel,next:q().nextLabel,skip:q().skipLabel,done:q().doneLabel,mediaPause:q().mediaPauseLabel,mediaPlay:q().mediaPlayLabel,endTitle:q().endTitle,endMessage:q().endMessage,endButton:q().doneLabel}),Je={back:`back-label`,next:`next-label`,skip:`skip-label`,done:`done-label`,mediaPause:`media-pause-label`,mediaPlay:`media-play-label`,endTitle:`end-title`,endMessage:`end-message`,endButton:`end-button`},Ye=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],J={index:null,position:null,total:null},Xe=0,Y=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,X=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function Z(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`<wui-tour> layer has no ${t}`);return r}var Q=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},$=null;function Ze(e){$||($=new CSSStyleSheet,$.replaceSync(Ae)),e.adoptedStyleSheets=[$]}var Qe=class extends i{seenStore;onBeforeStep;_run;_running;_layer;_outer;_shadow;_unbindAdvance;_ending;_seenMark;_steps=[];_progress=G(0);_firstIndex=0;_returnFocus=null;_current=null;_moving=!1;_card=null;_spot=null;_live=null;_onKey=null;_onFocusIn=null;static get observedAttributes(){return[`open`]}constructor(){super(),this.seenStore=null,this.onBeforeStep=null,this._run=0,this._running=!1,this._layer=null,this._outer=null,this._shadow=null,this._unbindAdvance=null,this._ending=null,this._seenMark=null}connectedCallback(){this.hasAttribute(`open`)&&this.start()}disconnectedCallback(){this.stop()}attributeChangedCallback(e,t,n){e===`open`&&this.isConnected&&(n===null?this.stop():this.start())}get tourId(){return this.getAttribute(`tour-id`)||``}set tourId(e){e==null||e===``?this.removeAttribute(`tour-id`):this.setAttribute(`tour-id`,String(e))}get isolated(){return this.hasAttribute(`isolated`)}set isolated(e){this.toggleAttribute(`isolated`,e===!0||e===``||e===`true`)}_stepList(){return Array.from(this.querySelectorAll(`:scope > ${Ge}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:(e.textContent??``).trim()};for(let[n,r]of Ye)e.hasAttribute(r)&&(t[n]=e.getAttribute(r)??``);return t})}_stepAt(e){let t=this._steps[e];if(!t)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);return t}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?m():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(Je[e])||qe()[e]}_endDialogText(){if(this.getAttribute(`end-dialog`)===`false`)return null;let e=(this.getAttribute(`end-next-label`)??``).trim(),t=(this.getAttribute(`end-next-href`)??``).trim();return{title:this._label(`endTitle`),message:this._label(`endMessage`),button:this._label(`endButton`),nextLabel:e,nextHref:t}}_markSeen(e){let t=this._store();return t?t.markSeen(this.tourId,e):null}async start(){if(this._running)return;this._running=!0;let e=++this._run;this.hasAttribute(`open`)||this.setAttribute(`open`,``);try{await this._start(e)}catch(t){throw e===this._run&&(this._running=!1),t}}async _start(e){this._steps=this._stepList(),this._progress=G(this._steps.length);let t=this._store();if(t&&!this.tourId)throw Error(`<wui-tour> needs a tour-id to use a seen store.`);if(t&&await t.isSeen(this.tourId)){e===this._run&&this._finish(`alreadySeen`);return}for(let[e,t]of this._steps.entries())t.target&&!Y(document.querySelector(t.target))&&this._progress.drop(e);this._returnFocus=document.activeElement;let n=await this._locate(0,1,e);e===this._run&&(n?(this._firstIndex=n.index,this.dispatchEvent(new CustomEvent(`wui-tour:start`,{bubbles:!0,detail:{total:this._progress.total()}})),e===this._run&&(this._build(),this._show(n))):this._finish(`noTargets`))}next(){return this._move(1)}back(){return!this._current||this._current.index<=this._firstIndex?Promise.resolve():this._move(-1)}async goTo(e){if(this._current){if(!Number.isInteger(e)||e<0||e>=this._steps.length)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);await this._go(e,1)}}stop(){this._running&&(this._run++,this._teardown(),this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`))}async _locate(e,t,n){let r=this._steps;for(let i=e;i>=0&&i<r.length;i+=t){let e=r[i];if(!e)break;if(await this._beforeStep(e,i),n!==this._run)return null;if(!e.target)return{index:i,target:null};let t=document.querySelector(e.target),a=t instanceof HTMLElement||t instanceof SVGElement?t:null;if(Y(a))return this._progress.position(i),{index:i,target:a};this._progress.drop(i)}return null}async _beforeStep(e,t){let n=[];this.dispatchEvent(new CustomEvent(`wui-tour:beforestep`,{bubbles:!0,detail:{step:e,index:t,wait:e=>n.push(e)}})),await Promise.all(n),typeof this.onBeforeStep==`function`&&await this.onBeforeStep(e,t)}_build(){let t=`wui-tour-${++Xe}`,i=document.createElement(`div`);i.className=`wui-tour-layer`,i.innerHTML=` <div class="wui-tour-spot" aria-hidden="true"></div> <div class="wui-tour-card" role="dialog" tabindex="-1" aria-labelledby="${t}-title" aria-describedby="${t}-text"> <p class="wui-tour-position"></p> <h2 class="wui-tour-title" id="${t}-title"></h2> <p class="wui-tour-text" id="${t}-text"></p> <div class="wui-tour-actions"> <button type="button" class="btn btn-sm btn-link wui-tour-skip"></button> <div class="wui-tour-nav"> <button type="button" class="${n(`neutral`,`outline`,`sm`)} wui-tour-back" data-wui="${r}"></button> <button type="button" class="${n(`primary`,`solid`,`sm`)} wui-tour-next" data-wui="${r}"></button> </div> </div> </div> <div class="visually-hidden" role="status" aria-live="polite"></div>`;let o=i;this._shadow=null,this.isolated&&(o=document.createElement(Ke),this._shadow=o.attachShadow({mode:`open`}),Ze(this._shadow),this._shadow.appendChild(i)),o.setAttribute(`popover`,`manual`),a(document).appendChild(o),document.documentElement.setAttribute(p,``),this._outer=o,this._layer=i;let s=Z(i,`.wui-tour-spot`,HTMLDivElement),c=Z(i,`.wui-tour-card`,HTMLDivElement),l=Z(i,`[role=status]`,HTMLElement);this._spot=s,this._card=c,this._live=l,Z(c,`.wui-tour-skip`,HTMLElement).addEventListener(`click`,()=>this._close(`skipped`,`button`)),Z(c,`.wui-tour-back`,HTMLElement).addEventListener(`click`,()=>this._move(-1)),Z(c,`.wui-tour-next`,HTMLElement).addEventListener(`click`,()=>this._move(1));let u=e=>this._key(e);this._onKey=u;let d=e=>{let t=this._layer;if(!t||this._ending)return;let n=this._current,r=n?this._stepAt(n.index):null;if(!(e.target instanceof Node))throw Error(`<wui-tour> saw a focus change from a non-node target`);ce(t,r,n?.target??null,e.target)||c.focus()};this._onFocusIn=d,document.addEventListener(`keydown`,u,!0),this._shadow||document.addEventListener(`focusin`,d),e(o,()=>this._follow())}_active(){return this._shadow?this._shadow.activeElement:document.activeElement}_raise(){let e=this._outer;if(!e)throw Error(`<wui-tour> raises a step before its host is built`);let t=a(this.ownerDocument);e.parentElement!==t&&t.appendChild(e),o(e)}_show(e){this._current=e;let{index:t,target:n}=e,r=this._stepAt(t),i=this._layer,a=this._spot,o=this._card,s=this._live;if(!i||!a||!o||!s)throw Error(`<wui-tour> shows a step before its layer is built`);this._raise();let c=this._progress.position(t),l=this._progress.total(),u=c===l&&!this._endDialogText(),d=Ue(this,c,l);We(o,{text:d,position:c,total:l}),Ve(o,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)}),o.toggleAttribute(`data-welcome`,!n);let f=C(this,{layer:i,spot:a,card:o},r,n),p=Z(o,`.wui-tour-title`,HTMLElement);p.textContent=r.title||``,p.hidden=!r.title,Z(o,`.wui-tour-text`,HTMLElement).textContent=r.description||``,Z(o,`.wui-tour-skip`,HTMLElement).textContent=this._label(`skip`);let m=Z(o,`.wui-tour-back`,HTMLElement);m.textContent=this._label(`back`),m.hidden=t<=this._firstIndex,Z(o,`.wui-tour-next`,HTMLElement).textContent=this._label(u?`done`:`next`);let h=[d,r.title,r.description].filter(Boolean).join(`. `);s.textContent=f?[h,f].join(/[.!?]$/.test(h)?` `:`. `):h,ye(o,n),a.removeAttribute(K),this._place(),k(o),this._unbindAdvance?.(),this._unbindAdvance=se(r,n,()=>this._move(1));let g=this._active();(g!==null&&o.contains(g)?!(g instanceof HTMLElement&&g.hidden):this._shadow!==null&&X(Q()))||o.focus(),this.dispatchEvent(new CustomEvent(`wui-tour:step`,{bubbles:!0,detail:{step:r,index:t,position:c,total:l}}))}_place(){if(!this._current||!this._layer)return;let e=this._spot,t=this._card;if(!e||!t)throw Error(`<wui-tour> places a step before its layer is built`);z(e,t,this._current.target)}_follow(){if(!this._current||!this._layer||this._ending)return;let e=this._spot;if(!e)throw Error(`<wui-tour> follows a step before its spot is built`);let t=e.style.cssText;this._place(),e.style.cssText!==t&&e.setAttribute(K,``)}async _move(e){this._current&&await this._go(this._current.index+e,e)}async _go(e,t){if(!this._current||this._moving)return;this._moving=!0;let n=this._run;try{let r=await this._locate(e,t,n);if(n!==this._run)return;if(r){let e=this._card;if(!e)throw Error(`<wui-tour> moved with no card showing`);let t=A(e);if(t&&await t,n!==this._run)return;this._show(r)}else if(t>0){let e=this._endDialogText(),t=e?await this._showEnd(e):`done`;if(n!==this._run)return;let r=await this._close(t===`next`?`next`:`finished`);if(t===`next`&&r&&e){let t=this.ownerDocument.defaultView;if(!t)throw Error(`<wui-tour> has no window to follow its next link in`);t.location.assign(e.nextHref)}}}finally{this._moving=!1}}_showEnd(e){this._unbindAdvance?.(),this._unbindAdvance=null;let t=this._layer,n=this._spot,r=this._card;if(!t||!n||!r)throw Error(`<wui-tour> ends a tour before its layer is built`);return C(this,{layer:t,spot:n,card:r},null,null),n.removeAttribute(K),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),ke(t,e,this._ending.signal)}_key(e){if(!(!this._layer||this._ending||e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this._close(`skipped`,`escape`);else if(e.key===`ArrowRight`||e.key===`ArrowLeft`){if(X(e.composedPath?.()[0]??e.target))return;if(e.preventDefault(),e.key===`ArrowRight`)this._move(1);else{let e=this._current;if(!e)throw Error(`<wui-tour> moved back with no step showing`);e.index>this._firstIndex&&this._move(-1)}}else if(e.key===`Tab`&&!this._shadow){let t=this._current,n=this._card;if(!t||!n)throw Error(`<wui-tour> cycled focus with no step showing`);le(e,{card:n,active:this._active(),step:this._stepAt(t.index),target:t.target})}}}_teardown(){if(!this._layer)return;this._onKey&&document.removeEventListener(`keydown`,this._onKey,!0),this._onFocusIn&&document.removeEventListener(`focusin`,this._onFocusIn);let e=!this._shadow||this._shadow.activeElement!==null||!document.activeElement||document.activeElement===document.body;this._unbindAdvance?.(),this._unbindAdvance=null,this._ending?.abort(),this._ending=null,this._seenMark=null;let n=this._outer;if(t(n),!n)throw Error(`<wui-tour> has a layer with no host to remove`);he(n),document.documentElement.removeAttribute(p),this._outer=null,this._shadow=null,this._layer=null,this._current=null;let r=this._returnFocus;this._returnFocus=null,e&&r?.isConnected&&(r instanceof HTMLElement||r instanceof SVGElement)&&r.focus()}async _close(e,t=null){let n=this._run,r=this._current,i=r?{index:r.index,position:this._progress.position(r.index),total:this._progress.total()}:J,a=this._seenMark;this._teardown();let o=e===`next`?`finished`:e,s=!1;try{n===this._run&&await(a??this._markSeen(o)),s=n===this._run}finally{this._finish(e,i,t)}return s}_finish(e,t=J,n=null){this._run++,this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`),this.dispatchEvent(new CustomEvent(`wui-tour:close`,{bubbles:!0,detail:{reason:e,...t,via:n}}))}};export{Qe as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./devWarn-DXdRWZs3.js";import{t}from"./elementBase-Cxeyx0tU.js";import{n,t as r}from"./formMirror-9IpSgeZb.js";import{t as i}from"./iconGlyphs.g-DxSJLQJ8.js";import{t as a}from"./listboxKeyNav-CF7tMDGG.js";import{l as o}from"./wuiHttp-DGbD7Fra.js";import{r as s}from"./textStore-opIEM4lu.js";import{t as c}from"./tree.g-RId8xZSk.js";var l=()=>s(`tree`,c),u=[`none`,`single`,`multiple`],d=e=>u.some(t=>t===e),f=`parentId`,p=`:scope > input[data-wui-mirror]`,m=[`nodes`,`selection`,`selected`,`values`,`loadChildren`,`loadUrl`,`name`],h=0;function g(e,t,n){let r=document.createElement(e);t&&(r.className=t);for(let[e,t]of Object.entries(n??{}))t!=null&&r.setAttribute(e,String(t));return r}var _=class extends t{_uid;_seq;_roots;_byId;_prev;_staged;_els;_checked;_selected;_focusId;_loader;_list;_live;_ready;_nav;_onKeyDown;_onClick;_onFocusIn;static get observedAttributes(){return[`selection`,`selected`,`name`,`aria-label`,`loading-text`,`error-text`]}constructor(){super(),this._uid=`wui-tree-${++h}`,this._seq=0,this._roots=[],this._byId=/* @__PURE__ */ new Map,this._prev=null,this._staged=null,this._els=/* @__PURE__ */ new Map,this._checked=/* @__PURE__ */ new Set,this._selected=null,this._focusId=null,this._loader=null,this._list=null,this._live=null,this._ready=!1,this._nav=a({getVisibleOptions:()=>this._visible().map(e=>{let t=this._els.get(e.id)?.row;if(!t)throw Error(`Row for node "${e.id}" is not rendered.`);return t}),getActive:()=>this._visible().findIndex(e=>e.id===this._focusId),setActive:e=>this._focusNode(this._visible()[e]),onEnter:()=>{let e=this._focusId===null?void 0:this._byId.get(this._focusId);e&&this._activate(e)}}),this._onKeyDown=e=>this._handleKeyDown(e),this._onClick=e=>this._handleClick(e),this._onFocusIn=e=>{let t=this._nodeFrom(e.target);t&&t.id!==this._focusId&&this._setRoving(t)}}connectedCallback(){let e=/* @__PURE__ */ new Map;for(let t of m)Object.hasOwn(this,t)&&(e.set(t,Reflect.get(this,t)),Reflect.deleteProperty(this,t));if(!this._ready){this._ready=!0;let e=this._readScript();this.replaceChildren(),this._list=g(`ul`,`wui-tree`),this._list.setAttribute(`role`,`tree`),this._live=g(`div`,`visually-hidden`,{role:`status`,"aria-live":`polite`}),this.append(this._list,this._live),e&&this._adoptAll(e)}for(let[t,n]of e)Reflect.set(this,t,n);this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`click`,this._onClick),this.addEventListener(`focusin`,this._onFocusIn),this._render(),this._loadOpenNodes()}disconnectedCallback(){this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`focusin`,this._onFocusIn),this._nav.teardown()}attributeChangedCallback(e,t,n){e===`selected`&&(this._selected=n),this._ready&&this.isConnected&&this._render()}get nodes(){return this._roots.map(e=>e.raw)}set nodes(e){this._adoptAll(e??[]),this._render(),this._loadOpenNodes()}get selection(){let e=this.getAttribute(`selection`);return d(e)?e:`none`}set selection(e){this.setAttribute(`selection`,String(e))}get selected(){return this._selected}set selected(e){this._selected=e==null?null:String(e),this._render()}get values(){let e=[],t=n=>{for(let r of n)this._state(r)===`checked`&&e.push(r.id),r.children&&t(r.children)};return t(this._roots),[...e,...[...this._checked].filter(e=>!this._byId.has(e))]}set values(e){this._checked.clear();for(let t of e??[]){let e=this._byId.get(String(t));e?this._setChecked(e,!0):this._checked.add(String(t))}this._render()}get loadChildren(){return this._loader}set loadChildren(e){this._loader=typeof e==`function`?e:null}get loadUrl(){return this.getAttribute(`load-url`)}set loadUrl(e){e==null?this.removeAttribute(`load-url`):this.setAttribute(`load-url`,String(e))}get name(){return this.getAttribute(`name`)}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,String(e))}get loadingText(){return this.getAttribute(`loading-text`)??l().loadingText}set loadingText(e){this.setAttribute(`loading-text`,String(e??``))}get errorText(){return this.getAttribute(`error-text`)??l().errorText}set errorText(e){this.setAttribute(`error-text`,String(e??``))}_readScript(){let t=this.querySelector(`:scope > script[type='application/json']`);if(!t)return null;try{return JSON.parse(t.textContent??``)}catch(t){return e(`[@webority/ui-elements] <wui-tree> could not read its JSON nodes:`,t instanceof Error?t.message:void 0),null}}_adoptAll(e){let t=this._byId;this._prev=t,this._byId=/* @__PURE__ */ new Map;let n;try{n=this._adoptStaged(e,null,1)}catch(e){throw this._byId=t,e}finally{this._prev=null}this._roots=n;for(let e of t.keys())this._byId.has(e)||this._checked.delete(e);for(let e of this._roots)this._passChecksDown(e);this._focusId&&!this._byId.has(this._focusId)&&(this._focusId=null)}_adoptStaged(e,t,n){let r=[],i=[];this._staged={ids:r,checks:i};try{let r=this._adopt(e,t,n);for(let e of i)this._checked.add(e);return r}catch(e){for(let e of r)this._byId.delete(e);throw e}finally{this._staged=null}}_adopt(e,t,n){if(!Array.isArray(e))throw Error(`<wui-tree> nodes must be an array.`);return e.map(e=>{let r=e?.id==null?``:String(e.id);if(!r)throw Error(`<wui-tree> every node needs an id.`);if(this._byId.has(r))throw Error(`<wui-tree> node id "${r}" is used twice.`);let i=this._prev?.get(r),a={id:r,raw:e,parent:t,level:n,seq:++this._seq,label:e.label==null?r:String(e.label),icon:e.icon||null,badge:e.badge==null||e.badge===``?null:String(e.badge),badgeTone:e.badgeTone||null,disabled:!!e.disabled,hasChildren:!!e.hasChildren,children:null,expanded:i?i.expanded:!!e.expanded,loading:!1,failed:!1};this._byId.set(r,a),this._staged?.ids.push(r);let o=e.children??(e.hasChildren?i?.children?.map(e=>e.raw):void 0);return Array.isArray(o)&&(a.children=this._adopt(o,a,n+1)),a.loading=!!i?.loading&&a.children===null&&a.hasChildren,e.checked&&!i&&this._staged?.checks.push(r),a})}_passChecksDown(e){e.children?.length&&this._checked.has(e.id)&&(this._checked.delete(e.id),this._setChecked(e,!0));for(let t of e.children??[])this._passChecksDown(t)}_loadOpenNodes(){queueMicrotask(()=>{if(this.isConnected)for(let e of[...this._byId.values()])e.expanded&&e.children===null&&e.hasChildren&&!e.loading&&this._load(e)})}_isBranch(e){return e.children?e.children.length>0:e.hasChildren}_visible(){let e=[],t=n=>{for(let r of n)e.push(r),r.expanded&&r.children&&t(r.children)};return t(this._roots),e}_state(e){if(e.children?.length){let t=0,n=0;for(let r of e.children){let e=this._state(r);e===`checked`?t++:e===`unchecked`&&n++}return t===e.children.length?`checked`:n===e.children.length?`unchecked`:`mixed`}return this._checked.has(e.id)?`checked`:`unchecked`}_setChecked(e,t){if(e.children?.length)for(let n of e.children)n.disabled||this._setChecked(n,t);else t?this._checked.add(e.id):this._checked.delete(e.id)}_nodeFrom(e){if(!(e instanceof Element))return null;let t=e.closest(`li.wui-tree-item`);if(!t)return null;for(let[e,n]of this._els)if(n.li===t)return this._byId.get(e)??null;return null}_emit(e,t){this.dispatchEvent(new CustomEvent(`wui-tree:${e}`,{detail:t,bubbles:!0,composed:!0}))}_announce(e){this._live&&(this._live.textContent=e)}_setRoving(e){let t=this._focusId===null?void 0:this._els.get(this._focusId);t&&(t.li.tabIndex=-1),this._focusId=e.id;let n=this._els.get(e.id);n&&(n.li.tabIndex=0)}_focusNode(e){e&&(this._setRoving(e),this._els.get(e.id)?.li.focus())}_activate(e){e.disabled||(this.selection===`single`&&(this._selected=e.id,this._render(),this._syncForm()),this._emit(`select`,{id:e.id,node:e.raw}))}_enabledLeaves(e){return e.disabled?[]:e.children?.length?e.children.flatMap(e=>this._enabledLeaves(e)):[e]}_toggleCheck(e){let t=this._enabledLeaves(e);if(!t.length)return;let n=!t.every(e=>this._checked.has(e.id));this._setChecked(e,n),this._render(),this._syncForm(),this._emit(`check`,{id:e.id,checked:n,values:this.values})}_toggleExpand(e){!e.disabled&&this._isBranch(e)&&(e.expanded?(e.expanded=!1,this._render()):this._expand(e))}_expand(e){e.expanded=!0,e.children===null?this._load(e):this._render()}async _load(e){if(e.loading)return;e.loading=!0,e.failed=!1,this._announce(this.loadingText),this._render();let t=[],n=null;try{t=await this._fetchChildren(e)}catch(e){n=e}let r=this._byId.get(e.id);if(!r)this._announce(``);else if(r.loading){if(r.loading=!1,!n)try{r.children=this._adoptStaged(t,r,r.level+1),this._passChecksDown(r),this._announce(``)}catch(e){n=e}n&&(r.failed=!0,r.expanded=!1,this._announce(this.errorText),this._emit(`error`,{id:r.id,message:n instanceof Error?n.message:String(n)})),this._render(),this._syncForm()}}async _fetchChildren(e){if(this._loader)return this._loader(e.raw);let t=this.getAttribute(`load-url`);if(!t)throw Error(`<wui-tree> has a node with children to load but no loadChildren or load-url.`);let n=new URL(t,window.location.href);n.searchParams.set(f,e.id);let r=await o(n.href,{headers:{Accept:`application/json`}});if(!r.ok)throw Error(`Loading children answered ${r.kind}.`);return JSON.parse(r.html)}_handleClick(e){let t=e.target;if(!(t instanceof Element))return;let n=this._nodeFrom(t);n&&!n.disabled&&(this._focusNode(n),t.closest(`.wui-tree-toggle`)?this._toggleExpand(n):t.closest(`.wui-tree-check`)?(e.preventDefault(),this._toggleCheck(n)):this._activate(n))}_handleKeyDown(e){if(e.ctrlKey||e.metaKey||e.altKey)return;let t=this._nodeFrom(e.target);if(t&&e.target===this._els.get(t.id)?.li){if(e.key===`ArrowRight`){if(e.preventDefault(),!this._isBranch(t)||t.disabled)return;t.expanded?t.children?.length&&this._focusNode(t.children[0]):this._expand(t)}else e.key===`ArrowLeft`?(e.preventDefault(),t.expanded&&this._isBranch(t)&&!t.disabled?this._toggleExpand(t):t.parent&&this._focusNode(t.parent)):e.key===` `?(e.preventDefault(),this.selection===`multiple`?this._toggleCheck(t):this.selection===`single`&&this._activate(t)):this._nav.handler(e)}}_syncForm(){let e=this.selection;if(e===`multiple`)n(this,this.values);else if(e===`single`)r(this,this._selected??``);else for(let e of this.querySelectorAll(p))e.remove()}_render(){if(!this._list)return;let e=document.activeElement,t=!!e&&this._list.contains(e),n=this._visible();n.some(e=>e.id===this._focusId)||(this._focusId=(n.find(e=>e.id===this._selected)??n[0])?.id??null),this._els=/* @__PURE__ */ new Map;let r=this.getAttribute(`aria-label`);r?this._list.setAttribute(`aria-label`,r):this._list.removeAttribute(`aria-label`),this._list.replaceChildren(...this._buildLevel(this._roots)),t&&this._focusId&&this._els.get(this._focusId)?.li.focus(),this._syncForm()}_buildLevel(e){return e.map((t,n)=>this._buildItem(t,n+1,e.length))}_buildItem(e,t,n){let r=this.selection,a=this._isBranch(e),o=this._state(e),s=g(`li`,`wui-tree-item`,{role:`treeitem`,tabindex:e.id===this._focusId?0:-1,"aria-level":e.level,"aria-setsize":n,"aria-posinset":t,"aria-labelledby":`${this._uid}-${e.seq}`,"aria-describedby":e.badge?`${this._uid}-${e.seq}-badge`:null});a&&s.setAttribute(`aria-expanded`,String(e.expanded)),e.disabled&&s.setAttribute(`aria-disabled`,`true`),e.loading&&s.setAttribute(`aria-busy`,`true`),r===`single`&&s.setAttribute(`aria-selected`,String(e.id===this._selected)),r===`multiple`&&s.setAttribute(`aria-checked`,o===`mixed`?`mixed`:String(o===`checked`));let c=g(`div`,`wui-tree-row`,{role:`presentation`});c.style.setProperty(`--wui-tree-level`,String(e.level-1)),r===`single`&&e.id===this._selected&&c.classList.add(`wui-tree-row-selected`),e.failed&&c.classList.add(`wui-tree-row-error`);let l=g(`span`,a?`wui-tree-toggle`:`wui-tree-toggle wui-tree-toggle-leaf`,{"aria-hidden":`true`});if(a&&(l.innerHTML=i(`chevron-right`,{size:16})),c.append(l),r===`multiple`){let t=g(`input`,`form-check-input wui-tree-check`,{type:`checkbox`,tabindex:-1,"aria-hidden":`true`});t.checked=o===`checked`,t.indeterminate=o===`mixed`,t.disabled=e.disabled,t.addEventListener(`mousedown`,e=>e.preventDefault()),c.append(t)}if(e.icon){let t=g(`span`,`wui-tree-icon`,{"aria-hidden":`true`});t.innerHTML=i(e.icon,{size:16}),c.append(t)}let u=g(`span`,`wui-tree-label`,{id:`${this._uid}-${e.seq}`});if(u.textContent=e.label,c.append(u),e.badge){let t=g(`span`,`badge wui-tree-badge${e.badgeTone&&e.badgeTone!==`neutral`?` badge-${e.badgeTone}`:``}`,{id:`${this._uid}-${e.seq}-badge`});t.textContent=e.badge,c.append(t)}if(e.loading&&c.append(g(`span`,`wui-tree-spinner`,{"aria-hidden":`true`})),s.append(c),e.expanded&&e.children?.length){let t=g(`ul`,`wui-tree-group`,{role:`group`});t.append(...this._buildLevel(e.children)),s.append(t)}return this._els.set(e.id,{li:s,row:c}),s}};export{_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./dom-Do1pAA12.js";import{t}from"./elementBase-Cxeyx0tU.js";import{a as n,l as r,s as i}from"./nativeOverlay-
|
|
1
|
+
import{r as e}from"./dom-Do1pAA12.js";import{t}from"./elementBase-Cxeyx0tU.js";import{a as n,l as r,s as i}from"./nativeOverlay-C1Rw2gIW.js";var a=`wui-whats-new-read`,o=`wui-whats-new:`,s=`data-wui-unread`,c=0,l=e=>{let t=Date.parse(e);return Number.isNaN(t)?-1/0:t},u=(e,t)=>l(t)>l(e)?t:e,d=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLElement?n:null},f=class extends t{_doc;_stored;_observer;_onTriggerClick;_closeFocus;static get observedAttributes(){return[`storage-key`,`read-through`,`indicator`]}constructor(){super(),this._doc=null,this._stored=``,this._closeFocus=null,this._observer=null,this._onTriggerClick=()=>this.isOpen?this.close(!0):this.open()}get isOpen(){let e=this._panel;return e!==null&&i(e)}get _trigger(){return d(this,`.wui-whats-new-trigger`)}get _panel(){return d(this,`.wui-whats-new-panel`)}get _dot(){return d(this,`.wui-whats-new-dot`)}connectedCallback(){this._doc=this.ownerDocument;let e=this._panel,t=this._trigger;e&&t&&(e.id||=`wui-whats-new-${++c}`,t.setAttribute(`aria-controls`,e.id),t.setAttribute(`aria-expanded`,`false`),t.addEventListener(`click`,this._onTriggerClick),this._stored=this._load(),this._refresh(),typeof MutationObserver<`u`&&(this._observer=new MutationObserver(()=>this._refresh()),this._observer.observe(e,{childList:!0,subtree:!0})))}disconnectedCallback(){let e=this._panel;e&&(this._closeFocus=!1,n(e),this._closeFocus=null),this._observer?.disconnect(),this._observer=null,this._trigger?.removeEventListener(`click`,this._onTriggerClick),this._doc=null}attributeChangedCallback(e,t,n){t!==n&&this._doc&&(e===`storage-key`&&(this._stored=this._load()),this._refresh())}open(){let t=e(this._trigger,`<wui-whats-new> needs its trigger to open.`),n=e(this._panel,`<wui-whats-new> needs its panel to open.`);this.isOpen||(r(t,n,{mode:`auto`,clampHeight:!0,onClosed:()=>this._closed()}),t.setAttribute(`aria-expanded`,`true`),n.focus({preventScroll:!0}),this._markRead())}close(e){let t=this._panel;t&&this.isOpen&&(this._closeFocus=e,n(t))}_closed(){let e=this._closeFocus??this._panel?.contains(this.ownerDocument.activeElement)??!1;this._closeFocus=null,this._settle(e)}_settle(e){this._trigger?.setAttribute(`aria-expanded`,`false`),this._refresh(),e&&this._trigger?.focus()}_entries(){let e=[];for(let t of this.querySelectorAll(`.wui-whats-new-entry`))t instanceof HTMLElement&&e.push({entry:t,date:t.querySelector(`time[datetime]`)?.getAttribute(`datetime`)??``});return e}_newest(){return this._entries().reduce((e,{date:t})=>u(e,t),``)}_seenPoint(){return u(this._stored,this.getAttribute(`read-through`)??``)}_refresh(){let e=this._seenPoint(),t=this._entries(),n=0;for(let{entry:r,date:i}of t){let t=l(i)>l(e);t&&n++,this.isOpen&&r.hasAttribute(s)||r.toggleAttribute(s,t)}this.toggleAttribute(s,n>0);let r=this._dot;r&&(r.textContent=this.getAttribute(`indicator`)===`count`&&n>0?String(n):``)}_markRead(){let e=this._newest();!e||l(e)<=l(this._seenPoint())||(this._stored=u(this._stored,e),this._save(this._stored),this._refresh(),this.dispatchEvent(new CustomEvent(a,{bubbles:!0,detail:{through:e}})))}_storage(){let e=this.getAttribute(`storage-key`);if(!e)return null;try{let t=this.ownerDocument.defaultView;return t?{store:t.localStorage,key:o+e}:null}catch{return null}}_load(){let e=this._storage();return e?e.store.getItem(e.key)??``:this._stored}_save(e){let t=this._storage();t&&t.store.setItem(t.key,e)}};export{f as n,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./elementBase-Cxeyx0tU.js";import{r as t,t as n}from"./textStore-opIEM4lu.js";import{n as r}from"./devWarn-DXdRWZs3.js";import{n as i,t as a}from"./buttonClass-GtEi8hAY.js";import{t as o}from"./iconGlyphs.g-DxSJLQJ8.js";import{n as s}from"./stepperHeader-yinJ_7Dk.js";import{t as c}from"./wizard.g-DOZSBUc5.js";var l=()=>t(`wizard`,c),u=`wui-wizard-step`,d=`:scope > [data-wui-glyphs]`,f=()=>({done:l().doneLabel,active:l().activeLabel,pending:l().pendingLabel,error:l().errorLabel,skipped:l().skippedLabel}),p=[`data-nav`,`data-step`,`data-close`],m=/* @__PURE__ */ new WeakSet,h=class extends e{_active;_skipped;_invalid;_finished;_rendered;_reflecting;_beforeNext;_header;_footer;_chromeInserted;_topBar;_onTopBarClick;_onHeaderClick;_onFooterClick;_known;_observer;_glyphs;_glyphObserver;static get observedAttributes(){return[`active`,`variant`,`orientation`,`align`,`icon-size`,`non-linear`,`hide-stepper`,`hide-connectors`,`disabled`,`skippable`,`label`,`back-label`,`next-label`,`skip-label`,`finish-label`,`top-bar`,`bar-title`,`close-label`]}constructor(){super(),this._active=0,this._skipped=/* @__PURE__ */ new Set,this._invalid=/* @__PURE__ */ new Set,this._finished=!1,this._rendered=!1,this._reflecting=!1,this._beforeNext=null,this._header=document.createElement(`nav`),this._header.className=`stepper wizard-stepper`,this._footer=document.createElement(`div`),this._footer.className=`form-actions wizard-footer form-actions-between`,this._chromeInserted=!1,this._topBar=null,this._onTopBarClick=e=>{let t=e.target;t instanceof Element&&t.closest(`[data-close]`)&&this.dispatchEvent(new CustomEvent(`wui-wizard:close`,{detail:{index:this._active},bubbles:!0}))},this._known=[],this._observer=null,this._glyphs=null,this._glyphObserver=null}get active(){return this._active}set active(e){let t=Number.parseInt(String(e),10);Number.isFinite(t)&&this._go(t,`set`)}get beforeNext(){return this._beforeNext}set beforeNext(e){this._beforeNext=typeof e==`function`?e:null}get _steps(){return[...this.querySelectorAll(`:scope > ${u}`)].filter(e=>e instanceof HTMLElement)}refresh(){this._rendered&&this._renderChrome()}connectedCallback(){if(this._rendered)this._wire(),this._onStepsMutated();else{let e=Number.parseInt(this.getAttribute(`active`)??``,10);this._active=Number.isFinite(e)&&e>=0?e:0,this.render()}}disconnectedCallback(){this._teardown()}attributeChangedCallback(e,t,n){if(this._rendered&&!this._reflecting){if(e===`active`){let e=Number.parseInt(n??``,10);Number.isFinite(e)&&this._go(e,`set`)}else this._renderChrome()}}render(){let e=this._steps;if(!this._chromeInserted){let t=e[0],n=e[e.length-1];t&&n?(this.insertBefore(this._header,t),n.after(this._footer)):(this.prepend(this._header),this.append(this._footer)),this._chromeInserted=!0}this._known=e,this._renderChrome(),this._rendered=!0,this._wire()}_renderChrome(){let e=this._reconcileSteps();this._placeChrome(e),this._clampActive(e),this._syncPanels(e);let t=this._focusedControl();this._syncTopBar(e),this._header.innerHTML=this._headerHtml(e),this._footer.innerHTML=this._footerHtml(e),this._header.hidden=this.hasAttribute(`hide-stepper`),this._restoreFocus(t)}_focusedControl(){let e=document.activeElement;if(!e||![this._topBar,this._header,this._footer].some(t=>t?.contains(e)))return null;let t=p.find(t=>e.hasAttribute(t));return t?{attr:t,value:e.getAttribute(t)}:null}_restoreFocus(e){if(e)for(let t of[this._topBar,this._header,this._footer]){let n=t&&[...t.querySelectorAll(`[${e.attr}]`)].find(t=>t.getAttribute(e.attr)===e.value);if(n){n instanceof HTMLElement&&!(n instanceof HTMLButtonElement&&n.disabled)&&n.focus({preventScroll:!0});return}}}_syncTopBar(e){if(!this.hasAttribute(`top-bar`)){this._topBar?.removeEventListener(`click`,this._onTopBarClick),this._topBar?.remove(),this._topBar=null;return}this._topBar||(this._topBar=document.createElement(`div`),this._topBar.className=`wui-wizard-topbar`,this._rendered&&this._topBar.addEventListener(`click`,this._onTopBarClick)),this._header.previousElementSibling!==this._topBar&&this.insertBefore(this._topBar,this._header);let t=this.getAttribute(`bar-title`)||``,r=this.getAttribute(`close-label`)||l().closeLabel,i=e.length?`<span class="wui-wizard-topbar-count">${v(n(l().stepOfText,{position:this._active+1,total:e.length}))}</span>`:``;this._topBar.innerHTML=`<span class="wui-wizard-topbar-title">${v(t)}</span>${i}<button type="button" class="wui-wizard-topbar-close" data-close aria-label="${y(r)}">${this._glyph(`x`)}</button>`}_clampActive(e){let t=Math.max(0,e.length-1);this._active>t&&(this._active=t),this._active<0&&(this._active=0)}_reconcileSteps(){let e=this._steps,t=this._known;if(this._known=e,_(e,t))return e;let n=n=>new Set([...n].map(n=>{let r=t[n];return r?e.indexOf(r):-1}).filter(e=>e>=0));this._skipped=n(this._skipped),this._invalid=n(this._invalid);let r=t[this._active];if(!r)return e;let i=e.indexOf(r);if(i<0){let n=t=>e.includes(t),r=t.slice(this._active+1).find(n)??t.slice(0,this._active).reverse().find(n);i=r?e.indexOf(r):this._active}return i=Math.min(i,Math.max(0,e.length-1)),i!==this._active&&(this._active=i,this._reflectActive(i)),e}_placeChrome(e){let t=e[0],n=e[e.length-1];t&&n&&(this._header.nextElementSibling!==t&&this.insertBefore(this._header,t),this._footer.previousElementSibling!==n&&n.after(this._footer))}_onStepsMutated(){if(!this._rendered)return;let e=this._steps,t=!e.length||this._header.nextElementSibling===e[0]&&this._footer.previousElementSibling===e[e.length-1];this.querySelector(d)!==this._glyphs&&(this._watchGlyphs(),this._renderHeader()),t&&_(e,this._known)||(this._renderChrome(),this._observer?.takeRecords())}_syncPanels(e){e.forEach((e,t)=>{let n=t===this._active;e.classList.add(`wizard-panel`),e.hidden=!n,e.setAttribute(`role`,`tabpanel`),e.setAttribute(`aria-hidden`,n?`false`:`true`)})}_stepStatus(e,t){let n=e?.getAttribute(`status`);if(n){if(!g(n))throw Error(`wui-wizard: status "${n}" is not one of pending, active, done, error, skipped.`);return n}return this._invalid.has(t)?`error`:this._finished?`done`:t===this._active?`active`:t<this._active?this._skipped.has(t)?`skipped`:`done`:`pending`}_headerHtml(e){let t=this.getAttribute(`variant`)===`journey`,i=this.getAttribute(`variant`)===`icons`,a=this.getAttribute(`variant`)===`tiles`,o=this.getAttribute(`orientation`)===`vertical`,c=!this.hasAttribute(`hide-connectors`),u=this.getAttribute(`align`)===`start`;this._header.className=[`stepper`,`wizard-stepper`,t&&`stepper-journey`,i&&`stepper-icons`,a&&`wui-step-tiles`,o&&`stepper-vertical`,!c&&`wui-stepper-no-connectors`,u&&`wui-stepper-start`].filter(Boolean).join(` `),this._header.setAttribute(`aria-label`,this.getAttribute(`label`)||l().label);let d=this.hasAttribute(`non-linear`);for(let t of e)t.getAttribute(`label`)||m.has(t)||(m.add(t),r(`wui-wizard: a <wui-wizard-step> needs a label attribute; its header segment is empty.`));let p=s(e.map(e=>({label:e.getAttribute(`label`)||``,icon:e.getAttribute(`icon`)||void 0})),{statusOf:t=>this._stepStatus(e[t],t),journey:t,connectors:c}),h=f(),g=p.map(r=>{let o=r.index,s=e[o];if(!s)return``;let c=r.status,u=s.getAttribute(`label`)||``,f=s.getAttribute(`description`)||``,p=o+1,m=`icon`in r.glyph?this._glyph(r.glyph.icon):String(r.glyph.number),g=r.className,_=r.current?` aria-current="step"`:``,y=d||o<this._active;if(a){let e=`<span class="step-circle">${m}</span><span class="step-text"><span class="step-label">${v(u)}</span><span class="wui-step-tile-state">${h[c]??``}</span></span>`,t=y?`<button type="button" class="wui-step-tile-body" data-step="${o}"${_}>${e}</button>`:`<div class="wui-step-tile-body"${_}>${e}</div>`;return`<li class="${c===`pending`?`wui-step-tile`:`wui-step-tile ${c}`}">${t}</li>`}let b=f?`<span class="step-desc">${v(f)}</span>`:``,x;x=t?`<span class="step-circle">${m}</span><span class="step-text"><span class="step-index">${v(n(l().stepText,{position:p}))}</span><span class="step-label">${v(u)}</span>${b}</span>`:i?`<span class="step-circle">${m}</span><span class="step-index">${v(n(l().stepText,{position:p}))}</span><span class="step-label">${v(u)}</span>${b}`:`<span class="step-circle">${m}</span><span class="step-label">${v(u)}</span>${b}`;let S=y?`<button type="button" class="${g}" data-step="${o}"${_}>${x}</button>`:`<div class="${g}"${_}>${x}</div>`;return r.line?`${S}<span class="step-line${r.line.done?` done`:``}" aria-hidden="true"></span>`:S}).join(``);return a?`<ol>${g}</ol>`:g}_footerHtml(e){let t=this._active,n=e.length-1,r=this.hasAttribute(`disabled`)?` disabled`:``,s=e[t]?.hasAttribute(`optional`)||this.hasAttribute(`skippable`),c=this.getAttribute(`back-label`)||l().backLabel,u=this.getAttribute(`next-label`)||l().nextLabel,d=this.getAttribute(`skip-label`)||l().skipLabel,f=this.getAttribute(`finish-label`)||l().finishLabel;return`${t>0?`<button type="button" class="${i(`primary`,`soft`,`md`)}" data-nav="back"${r} data-wui="${a}">${o(`arrow-left`,{className:`me-2`})}${v(c)}</button>`:`<span></span>`}<span class="wizard-footer-actions">${s&&t<n?`<button type="button" class="${i(`neutral`,`soft`,`md`)}" data-nav="skip"${r} data-wui="${a}">${v(d)}</button>`:``}${t<n?`<button type="button" class="${i(`primary`,`solid`,`md`)}" data-nav="next"${r} data-wui="${a}">${v(u)}${o(`arrow-right`,{className:`ms-2`})}</button>`:`<button type="button" class="${i(`primary`,`solid`,`md`)}" data-nav="finish"${r} data-wui="${a}">${v(f)}</button>`}</span>`}_wire(){this._teardown(),this._onHeaderClick=e=>{let t=e.target instanceof Element?e.target.closest(`[data-step]`):null;t instanceof HTMLElement&&this.contains(t)&&this._stepTo(Number.parseInt(t.dataset.step??``,10))},this._onFooterClick=e=>{let t=e.target instanceof Element?e.target.closest(`[data-nav]`):null;if(!(t instanceof HTMLElement)||!this.contains(t)||this.hasAttribute(`disabled`))return;let n=t.dataset.nav;n===`back`?this._back():n===`skip`?this._skip():(n===`next`||n===`finish`)&&this._next()},this._header.addEventListener(`click`,this._onHeaderClick),this._footer.addEventListener(`click`,this._onFooterClick),this._topBar?.addEventListener(`click`,this._onTopBarClick),this._observer=new MutationObserver(()=>this._onStepsMutated()),this._observer.observe(this,{childList:!0}),this._watchGlyphs()}_glyph(e){let t=this.querySelector(d),n=t&&[...t.children].find(t=>t.getAttribute(`data-icon`)===e);if(n)return n.outerHTML;let r=Number.parseInt(this.getAttribute(`icon-size`)??``,10);return o(e,r>0?{size:r}:void 0)}_watchGlyphs(){this._glyphObserver?.disconnect(),this._glyphObserver=null,this._glyphs=this.querySelector(d),this._glyphs&&(this._glyphObserver=new MutationObserver(()=>this._renderHeader()),this._glyphObserver.observe(this._glyphs,{childList:!0,subtree:!0,attributes:!0,characterData:!0}))}_renderHeader(){if(!this._rendered)return;let e=this._focusedControl();this._header.innerHTML=this._headerHtml(this._steps),this._restoreFocus(e)}_teardown(){this._header&&this._onHeaderClick&&this._header.removeEventListener(`click`,this._onHeaderClick),this._footer&&this._onFooterClick&&this._footer.removeEventListener(`click`,this._onFooterClick),this._topBar?.removeEventListener(`click`,this._onTopBarClick),this._observer?.disconnect(),this._observer=null,this._glyphObserver?.disconnect(),this._glyphObserver=null}_stepTo(e){this.hasAttribute(`disabled`)||!this.hasAttribute(`non-linear`)&&e>=this._active||this._go(e,`step`)}_back(){this._active>0&&this._go(this._active-1,`back`)}async _next(){this._reconcileSteps();let e=this._active,t=this._steps,n=e>=t.length-1,r=t[e];if(!this.dispatchEvent(new CustomEvent(`wui-wizard:beforechange`,{detail:n?{index:e,next:e,reason:`finish`}:{index:e,next:e+1,reason:`next`},cancelable:!0})))return this._flagInvalid(e);if(this._beforeNext){let i;try{i=await this._beforeNext(e)}catch{i=!1}if(this._reconcileSteps(),t=this._steps,e=r?t.indexOf(r):-1,e<0)return;if(n=e>=t.length-1,i===!1)return this._flagInvalid(e)}if(this._invalid.delete(e),this._skipped.delete(e),n)return this._finish();this._go(e+1,`next`)}_skip(){let e=this._active,t=this._steps;(t[e]?.hasAttribute(`optional`)||this.hasAttribute(`skippable`))&&(this._invalid.delete(e),this._skipped.add(e),this.dispatchEvent(new CustomEvent(`wui-wizard:skip`,{detail:{index:e}})),e>=t.length-1?this._finish():this._go(e+1,`skip`))}_flagInvalid(e){this._invalid.add(e),this._renderChrome(),this.dispatchEvent(new CustomEvent(`wui-wizard:invalid`,{detail:{index:e}}))}_finish(){this._invalid.delete(this._active),this._finished=!0,this._renderChrome(),this.dispatchEvent(new CustomEvent(`wui-wizard:finish`,{detail:{index:this._active}}))}_go(e,t){let n=this._reconcileSteps(),r=Math.max(0,n.length-1),i=Math.min(Math.max(e,0),r),a=this._active;this._finished=!1,this._invalid.delete(a),this._active=i,this._reflectActive(i),this._renderChrome(),t!==`silent`&&i!==a&&this.dispatchEvent(new CustomEvent(`wui-wizard:change`,{detail:{index:i,previous:a,reason:t}}))}_reflectActive(e){this._reflecting=!0,this.setAttribute(`active`,String(e)),this._reflecting=!1}},g=e=>e===`pending`||e===`active`||e===`done`||e===`error`||e===`skipped`,_=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),v=e=>String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),y=e=>String(e??``).replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`),b=class extends e{static get observedAttributes(){return[`label`,`description`,`optional`,`icon`,`status`]}attributeChangedCallback(){let e=this.closest(`wui-wizard`);e&&`refresh`in e&&typeof e.refresh==`function`&&e.refresh()}};export{h as n,b as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,g as t}from"./formatters-Dy4kQQ_h.js";var n=e=>{let t=String(e??``).trim();return/^[0-6]$/.test(t)?Number(t):null},r=e=>n(e.getAttribute(`first-day`))??n(getComputedStyle(e).getPropertyValue(`--wui-first-day`))??1,i=e=>String(e).padStart(2,`0`),a=(e,t,n)=>`${e}-${i(t+1)}-${i(n)}`,o=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e||``);if(!t)return null;let[,n,r,i]=t;if(n===void 0||r===void 0||i===void 0)throw Error(`ISO date parts missing`);let a=+n,o=+r,s=+i;return o<1||o>12||s<1||s>l(a,o-1)?null:{y:a,m:o-1,d:s}},s=`dd-MMM-yyyy`,c=(n,r=s)=>{let a=o(n);if(!a)return``;let c={yyyy:a.y,MMMM:e(a.m),MMM:t(a.m),MM:i(a.m+1),dd:i(a.d),d:a.d};return(r||`dd-MMM-yyyy`).replace(/yyyy|MMMM|MMM|MM|dd|d/g,e=>String(c[e]))},l=(e,t)=>{let n=/* @__PURE__ */ new Date(0);return n.setFullYear(e,t+1,0),n.getDate()},u=(e,t)=>{for(;t<0;)t+=12,--e;for(;t>11;)t-=12,e+=1;return{y:e,m:t}};export{o as a,c as i,l as n,a as o,r,u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={carouselLabel:`carousel`,dotLabel:`Go to slide`,nextLabel:`Next slide`,pauseLabel:`Pause`,playLabel:`Play`,previousLabel:`Previous slide`,slideLabel:`slide`,slideText:`{n} of {total}`,statusTextOne:`Slide {first} of {total}`,statusTextOther:`Slides {first} to {last} of {total}`};export{e as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e,t}from"./fieldState-D-zQcXUS.js";import{t as n}from"./iconGlyphs.g-DxSJLQJ8.js";import{t as r}from"./imeSafeEnter-DPs9qL3S.js";import{s as i}from"./nativeOverlay-C1Rw2gIW.js";import{a,i as o,n as s,r as c}from"./optionLabel-B2cU4Ax0.js";import{r as l,t as u}from"./textStore-opIEM4lu.js";import{r as d}from"./search.g-B5d1s59A.js";import{t as ee}from"./customRule-BXJdj57A.js";import{r as f}from"./WuiSelect-CMHoPHlx.js";var p={enter:`Enter`,comma:`,`,space:` `,tab:`Tab`},m={enter:`
|
|
2
|
+
`,comma:`,`,space:` `,tab:` `},h=e=>p[e],te=e=>m[e];function g(e,t){let n=[String(e??``)];for(let e of t)n=n.flatMap(t=>t.split(e));return n.map(e=>e.trim()).filter(Boolean)}var ne=(e,t)=>t.some(t=>String(e??``).includes(t)),_=()=>l(`select`,d),v=/* @__PURE__ */ new WeakMap;function y(e,t){if(e===null)throw TypeError(`The chip row needs ${t}, and it is not mounted.`);return e}var b=(e,t)=>{let n=document.createElement(e);return n.className=t,n};function x(){let l,d,p=null,m=null,x=null,S=null,C=null,w=null,T=null,E=!1,D=()=>y(m,`the draft input`),O=()=>l.mode===`tag`,k=()=>Array.isArray(l.value)?l.value.slice():[],A=()=>(l.getAttribute(`separators`)||`enter,comma`).split(`,`).map(e=>e.trim()).filter(Boolean),re=()=>new Set(A().map(h).filter(Boolean)),j=()=>{let e=parseInt(l.getAttribute(`max-tags`)??``,10)||0;return Math.max(e,0)},ie=()=>{let e=j();return e>0&&k().length>=e},M=(e,t)=>!l.hasAttribute(`allow-duplicates`)&&e.some(e=>e.toLowerCase()===t.toLowerCase()),N=()=>{let e=v.get(l);return e||(e=/* @__PURE__ */ new Map,v.set(l,e)),e},P=e=>(l.options||[]).find(t=>String(t.value)===String(e))??N().get(String(e)),F=e=>{let t=N();for(let n of l.options||[])e.includes(String(n.value))&&t.set(String(n.value),n);for(let n of t.keys())e.includes(n)||t.delete(n)},I=e=>{let t=e.trim().toLowerCase();return(l.options||[]).find(e=>String(e.value??``).toLowerCase()===t||o(e).trim().toLowerCase()===t)},ae=e=>{for(let t of A()){let n=te(t)??t;if(ne(e,[n]))return g(e,[n])}return[e.trim()]},L=()=>m?m.value:l._query||``,oe=()=>O()||l.hasAttribute(`allow-custom`),se=()=>l.getAttribute(`placeholder`)||(O()?_().tagPlaceholder:_().placeholder),ce=()=>{let e=l.getAttribute(`aria-label`);if(e)return e;let t=l.closest(`label`)?.textContent?.trim();if(t)return t;let n=l.id;return(n?[...document.querySelectorAll(`label[for]`)].find(e=>e instanceof HTMLLabelElement&&e.htmlFor===n):void 0)?.textContent?.trim()||(O()?_().addTagsLabel:_().fallbackName)},R=()=>{m&&(m.setAttribute(`aria-expanded`,String(i(d.menu))),d.list.id&&m.setAttribute(`aria-controls`,d.list.id),m.setAttribute(`aria-label`,ce()))},le=()=>!e(l)&&!l.hasAttribute(`loading`),ue=e=>{E=!0,D().setAttribute(`aria-invalid`,`true`),l.setError(e)},z=()=>{E&&(E=!1,D().removeAttribute(`aria-invalid`),l.setError(null))},B=(e,{quiet:t=!1,strip:n=!1}={})=>{let r=k(),i=r.slice(),a=j(),o=[],s=``,c=!1;for(let t of e){let e=(n?t.trim().replace(/,+$/,``):t).trim();if(!e)continue;if(a&&i.length>=a)break;let r=I(e);if(r){if(r.disabled){o.push(e),s||=r.disabledHint||l.getAttribute(`invalid-message`)||_().invalidMessage;continue}M(i,String(r.value))||i.push(String(r.value));continue}let u=ee(l,e);u?(o.push(e),s||=u):M(i,e)||(i.push(e),c=!0)}i.length!==r.length&&(c?l.commit(i,{isCustom:!0}):l.commit(i)),D().value=o.join(`, `),s?t||ue(s):z()},V=e=>{t(l)||B([D().value],e)},H=e=>l.commit(k().filter(t=>t!==e)),de=()=>{let e=b(`span`,`wui-select-placeholder`);return e.textContent=l.getAttribute(`placeholder`)||_().placeholder,e},fe=e=>{let t=P(e),r=b(`span`,`chip chip-sm`),i=b(`span`,`chip-label`);if(i.innerHTML=t?c(t):s(e),r.append(i),le()){let i=b(`button`,`chip-remove`);i.type=`button`,i.dataset.remove=e;let s=t?o(t):a(e);i.setAttribute(`aria-label`,u(_().removeText,{text:s})),i.innerHTML=n(`x`),r.append(i)}return r};function U(){if(!p)return;p.querySelector(`:scope > .chip-more`)?.remove();let e=[...p.querySelectorAll(`:scope > .chip`)].map(e=>{if(!(e instanceof HTMLElement))throw Error(`The chip row holds a node that is not an element.`);return e});for(let t of e)t.style.display=``;let t=e.at(-1);if(!l.hasAttribute(`collapse-chips`)||!t)return;let n=p.clientWidth,r=e=>e.offsetLeft+e.offsetWidth;if(r(t)<=n)return;let i=b(`span`,`chip chip-sm chip-more`);i.textContent=`+${e.length}`,t.after(i);let a=i.offsetWidth+6,o=0;for(let t of e)if(r(t)<=n-a)o+=1;else break;o<1&&(o=1);for(let t of e.slice(o))t.style.display=`none`;i.textContent=`+${e.length-o}`}function W(){if(!p)return!1;p.parentNode!==d.value&&d.value.append(p);for(let e of p.querySelectorAll(`:scope > .chip, :scope > .wui-select-placeholder`))e.remove();let e=k();F(e);let n=p,r=e=>{m?n.insertBefore(e,m):n.append(e)};O()||m||e.length||r(de());for(let t of e)r(fe(t));return m&&(m.placeholder=O()||!e.length?se():``,m.disabled=l.hasAttribute(`disabled`),m.readOnly=t(l),R()),O()||(y(S,`the footer text`).textContent=(()=>{let t=l.getAttribute(`selected-text`);return t?t.replace(`{n}`,()=>String(e.length)):u(_().selectedText,{count:e.length})})(),y(C,`the clear-all button`).textContent=l.getAttribute(`clear-all-label`)||_().clearAllLabel),U(),!0}function pe(e){if(e.key===`Backspace`){let t=m?!L():!L()&&i(d.menu),n=k().at(-1);return!t||n===void 0?!1:(e.preventDefault(),H(n),!0)}if(!m)return!1;let t=m.value;if(e.key===`Escape`){if(!O())return!1;let n=i(d.menu);return!n&&!t?!1:(e.preventDefault(),n&&e.stopPropagation(),m.value=``,z(),l.closeMenu({focusControl:!1}),!0)}let n=!O()&&!t.trim(),a=re();return r(e)&&a.has(`Enter`)?n||d.list.querySelector(`.is-active`)?!1:(e.preventDefault(),V(),!0):e.key===`,`&&a.has(`,`)?!n&&(e.preventDefault(),V({strip:!0}),!0):e.key===` `&&a.has(` `)&&t.trim()||e.key===`Tab`&&a.has(`Tab`)&&!n?(e.preventDefault(),V(),!0):!1}function me(e){let t=String(e.value);if(O()||m&&!P(t))return B([t]),!0;let n=k();return n.includes(t)?l.commit(n.filter(e=>e!==t)):m?B([t]):l.commit([...n,t]),m?.value&&(m.value=``,z()),!0}function G(e){if(!m)return null;let t=String(e??``).trim().replace(/,+$/,``).trim();if(!t||ie()||I(t)||M(k(),t))return null;let n=l.getAttribute(`create-label`)||_().createLabel;return{position:O()?`top`:`bottom`,label:n.replace(`{text}`,()=>t),value:t}}function K(e){let n=e.target,r=n instanceof Element?n.closest(`[data-remove]`):null;if(r instanceof HTMLElement){if(t(l))return;e.stopPropagation(),H(r.dataset.remove??``),m?.focus()}else m&&!t(l)&&m.focus()}function q(){z();let e=D().value.trim();O()||!e||i(d.menu)||(G(e)||f(l.options||[],e).length)&&l.openMenu()}function J(e){e.preventDefault(),t(l)||B(ae(e.clipboardData?.getData(`text/plain`)??``))}function Y(){D().value.trim()&&V({quiet:!0,strip:!0}),l.closeMenu({focusControl:!1})}function X(e){e.relatedTarget instanceof Node&&l.contains(e.relatedTarget)||Y()}function he(){return m?(Y(),!0):!1}function Z(){D().value.trim()&&V({strip:!0})}function Q(){t(l)||l.commit([])}function $(e){e.target!==m&&e.preventDefault()}function ge(e,t,n={}){l=e,d=t,p=b(`div`,`wui-select-chips`),p.addEventListener(`click`,K),d.value.append(p),oe()&&(m=b(`input`,`wui-select-draft`),m.type=`text`,m.setAttribute(`autocomplete`,`off`),m.setAttribute(`role`,`combobox`),m.setAttribute(`aria-autocomplete`,`list`),l.hasAttribute(`required`)&&m.setAttribute(`aria-required`,`true`),d.menu.addEventListener(`toggle`,R),p.append(m),m.value=n.carry?.draft??``,d.input=m,m.addEventListener(`input`,q),m.addEventListener(`paste`,J),m.addEventListener(`blur`,X),p.addEventListener(`mousedown`,$),w=l.closest(`form`),w?.addEventListener(`submit`,Z,!0)),O()||(x=b(`div`,`wui-select-footer`),S=document.createElement(`span`),C=b(`button`,`wui-select-clear-all`),C.type=`button`,C.addEventListener(`click`,Q),x.append(S,C),d.menu.append(x)),typeof ResizeObserver<`u`&&(T=new ResizeObserver(U),T.observe(p)),W()}function _e(){p?.removeEventListener(`click`,K),p?.removeEventListener(`mousedown`,$),m&&(m.removeEventListener(`input`,q),m.removeEventListener(`paste`,J),m.removeEventListener(`blur`,X),d.input=null),C&&C.removeEventListener(`click`,Q),w?.removeEventListener(`submit`,Z,!0),w=null,T?.disconnect(),T=null,d.menu.removeEventListener(`toggle`,R),x?.remove(),p?.remove(),p=null,m=null,x=null,E=!1}return{mount:ge,onKey:pe,onPick:me,renderValue:W,actionRow:G,onQuery:()=>!1,onBlur:he,teardown:_e}}export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={copiedLabel:`Copied`,copyLabel:`Copy`,label:`Code`};export{e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={allCountText:`All ({count})`,ariaLabel:`Search`,backLabel:`Back`,emptyText:`No results`,placeholder:`Search…`,recentsLabel:`Recent`,resultGroupsLabel:`Result groups`,resultsLabel:`Results`,rootLabel:`All`};export{e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.freeze([`👍`,`❤️`,`🎉`,`😄`,`👀`,`🙏`]),t=Object.freeze([`post`,`reply`,`edit`,`delete`,`react`]);export{e as n,t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={acceptLabel:`Accept all`,analyticsDescription:`Help us understand how visitors use the site.`,analyticsLabel:`Analytics cookies`,description:`We use cookies to understand how the site is used and to measure our campaigns. You can change your choice at any time.`,essentialDescription:`Required for the site to work and stay secure. Always on.`,essentialLabel:`Essential cookies`,functionalDescription:`Remember choices you make, such as your preferences.`,functionalLabel:`Functional cookies`,heading:`Cookies on this site`,marketingDescription:`Measure how well our campaigns work.`,marketingLabel:`Marketing cookies`,policyLabel:`Cookie policy`,rejectLabel:`Reject all`,saveLabel:`Save preferences`,settingsLabel:`Cookie settings`};export{e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./countries-DQL9nAUt.js";import{r as t}from"./textStore-opIEM4lu.js";import{r as n}from"./search.g-B5d1s59A.js";var r=()=>t(`select`,n),i=/^\+?\d+$/,a=e=>String(e??``).split(`,`).map(e=>e.trim().toUpperCase()).filter(Boolean),o=t=>{let n=a(t.getAttribute(`countries`)),i=n.length?new Set(n):null,o=e.filter(([e])=>!i||i.has(e)),s=new Map(o.map(e=>[e[0],e])),c=[...new Set(a(t.getAttribute(`suggested`)))].map(e=>s.get(e)).filter(e=>e!==void 0);if(!c.length)return o.map(e=>({tuple:e,group:null}));let l=new Set(c.map(e=>e[0])),u=t.getAttribute(`suggested-label`)||r().suggestedLabel,d=t.getAttribute(`all-countries-label`)||r().allCountriesLabel;return[...c.map(e=>({tuple:e,group:u})),...o.filter(e=>!l.has(e[0])).map(e=>({tuple:e,group:d}))]},s=({tuple:[e,t,n],group:r})=>({value:e,label:t,flag:e,meta:`+${n}`,...r?{group:r}:{}}),c=([,e,t],n)=>n?i.test(n)?t.startsWith(n.replace(`+`,``)):e.toLowerCase().includes(n):!0;function l(){let e,t=[];return{mount(n){e=n,t=o(n),n.setPartOptions(t.map(s))},onQuery(n){let r=n.trim().toLowerCase();return e.setPartOptions(t.filter(e=>c(e.tuple,r)).map(s)),!0},teardown(){}}}export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./devWarn-DXdRWZs3.js";import{r as t}from"./textStore-opIEM4lu.js";import{t as n}from"./customRule.g-Cfkl3_ZC.js";var r=/* @__PURE__ */ new Map,i=t=>{if(r.has(t))return r.get(t)??null;let n=null;try{n=RegExp(`^(?:${t})$`,`u`)}catch{e(`<wui-select> pattern is not a valid regular expression and is ignored: ${t}`)}return r.set(t,n),n},a=(e,r)=>{let a=e.getAttribute(`invalid-message`)||t(`customRule`,n).invalidMessage,o=e.getAttribute(`pattern`);if(o){let e=i(o);if(e&&!e.test(r))return a}let s=e.validate;if(typeof s!=`function`)return``;let c=s(r);return c===!0?``:typeof c==`string`&&c?c:a};export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={invalidMessage:`Enter a valid value.`};export{e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e}from"./formatters-Dy4kQQ_h.js";import{n as t,r as n,t as r}from"./textStore-opIEM4lu.js";import{t as i}from"./dataTable.g-BVxhub_d.js";var a=48,o=1200,s=10,c=50,l=[`start`,`end`],u=8,d={comfortable:72,cozy:48,compact:40},f=()=>n(`dataTable`,i),p=e=>e?r(f().resizeColumnText,{label:e}):f().resizeColumnLabel,m=e=>r(f().resizeText,{px:e}),h=n=>t(f(),`groupRows`,n,{count:e(n,{decimals:0})}),g=e=>e?r(f().savedText,{label:e}):f().rowSavedText,_=t=>r(f().rowsSavedText,{n:e(t,{decimals:0})}),v=(e,t)=>`${e?r(f().wasNotSavedText,{label:e}):f().rowWasNotSavedText}${t?` ${t}`:``}`,y=t=>e(t,{decimals:0}),b=e=>Math.min(o,Math.max(48,Math.round(Number(e)||0)));function x(e,t,n=[]){let r=new Map(n.map(e=>[e,[]]));return e.forEach((e,n)=>{let i=t(e,n),a=r.get(i);a||(a=[],r.set(i,a)),a.push(e)}),[...r].filter(([,e])=>e.length>0).map(([e,t])=>({key:e,items:t}))}function S({scrollTop:e,viewport:t,rowHeight:n,count:r,overscan:i=8}){let a=n>0?n:d.comfortable,o=Math.floor(Math.max(0,e)/a),s=Math.max(0,o-i);s-=s%2;let c=Math.min(r,o+Math.ceil(Math.max(0,t)/a)+i),l=Math.min(s,c);return{start:l,end:c,before:l*a,after:Math.max(0,r-c)*a}}var C=e=>`wui-widths:${e}`;function w(e){if(!e)return{};try{let t=JSON.parse(window.localStorage.getItem(C(e))||`{}`),n={};if(t&&typeof t==`object`)for(let[e,r]of Object.entries(t))Number.isFinite(r)&&(n[e]=b(r));return n}catch{return{}}}function T(e,t){if(e)try{Object.keys(t).length?window.localStorage.setItem(C(e),JSON.stringify(t)):window.localStorage.removeItem(C(e))}catch(e){if(!(e instanceof DOMException))throw e}}var E=(e,t)=>`--wui-pin-${e}-${t}`,D=`--wui-pin-at`,O=(e,t)=>`var(${E(e,t)}, 0px)`;function k(e){let t=e.map(()=>null),n=-1;e.forEach((e,t)=>{e===`start`&&(n=t)});let r=0;for(let i=0;i<=n;i++)(e[i]===`start`||e[i]===`lead`)&&(t[i]={side:`start`,ordinal:r++,edge:!1});let i=t[n];i&&(i.edge=!0);let a=-1;r=0;for(let n=e.length-1;n>=0;n--)e[n]===`end`&&(t[n]={side:`end`,ordinal:r++,edge:!1},a=n);let o=t[a];return o&&(o.edge=!0),t}var A=e=>e?`wui-pin-${e.side}${e.edge?` wui-pin-${e.side}-edge`:``}`:``,j=200,M=220,N=`cubic-bezier(0.22, 1, 0.36, 1)`,P=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,F=e=>e.getAttribute(`data-row-key`)??e;function I(e){let t=[...e];if(t.length>200)return null;let n=/* @__PURE__ */ new Map;for(let e of t)e.hidden||n.set(F(e),e.offsetTop);return n}function L(e,t){let n=[...e];if(!t||n.length>200||P())return 0;let r=0;for(let e of n){if(e.hidden||typeof e.animate!=`function`)continue;let n=t.get(F(e));if(n===void 0)continue;let i=n-e.offsetTop;Math.abs(i)<1||(e.animate([{transform:`translateY(${i}px)`},{transform:`translateY(0)`}],{duration:220,easing:N}),r++)}return r}function R(e,t){if(!e||!t)return!1;let n=new Set(t),r=new Set(e),i=e.filter(e=>n.has(e)),a=t.filter(e=>r.has(e));return i.some((e,t)=>e!==a[t])}var z=[`saving`,`error`],B=`data-wui-save-state`,V=`wui-row-save-error`,H=e=>{let t=e.querySelector(`:scope > .wui-name-cell`);return t instanceof HTMLTableCellElement?t:[...e.cells].find(e=>!e.matches(`.wui-select-cell, .wui-expand-cell`))??null};function U(e){let t=H(e);if(!t)return``;let n=t.querySelector(`.u-name`);if(n)return(n.textContent??``).trim();let r=``;for(let e of t.childNodes)e instanceof Element&&e.classList.contains(`wui-row-save-error`)||(r+=e.textContent??``);return r.replace(/\s+/g,` `).trim()}function W(e,t,n=``){if(t!==null&&!z.includes(t))throw Error(`A row's save state is ${z.join(` or `)} (or null to clear it), not "${t}".`);e.querySelector(`:scope > * > .${V}`)?.remove(),t===null?e.removeAttribute(B):e.setAttribute(B,t),t===`saving`?e.setAttribute(`aria-busy`,`true`):e.removeAttribute(`aria-busy`);let r=t===`error`&&n?H(e):null;if(r){let t=e.ownerDocument.createElement(`span`);t.className=V,t.textContent=n,r.append(t)}}function G(e,t){let n=[];if(!e)return n;for(let[r,i]of e){let e=t.get(r);i.state===`saving`&&e&&e.state!==`saving`&&n.push({label:e.label,ok:e.state!==`error`,message:e.message||``})}return n}function K(e){let t=e.filter(e=>e.ok),n=[],[r]=t;t.length===1&&r?n.push(g(r.label)):t.length>1&&n.push(_(t.length));for(let t of e)t.ok||n.push(v(t.label,t.message));return n.join(` `)}export{K as A,E as C,p as D,w as E,m as F,T as I,W as M,G as N,U as O,S as P,A as S,L as T,h as _,s as a,v as b,j as c,V as d,z as f,x as g,y as h,l as i,g as j,R as k,M as l,b as m,a as n,c as o,u as p,D as r,d as s,o as t,B as u,H as v,k as w,O as x,I as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={actionFailedMessage:`That did not work. Try again.`,actionForbiddenMessage:`You do not have permission to do that.`,collapseRowLabel:`Collapse row`,empty:`No records found.`,emptyLabel:`No rows`,errorText:`These rows did not load. Try again.`,expandLabel:`Expand`,expandRowLabel:`Expand row`,forbiddenMessage:`You do not have access to these rows.`,groupRowsOne:`1 row`,groupRowsOther:`{count} rows`,loadingText:`Loading rows`,moreActionsForText:`More actions for {firstValue}`,networkMessage:`The connection dropped before the rows loaded. Check it and try again.`,pageTextOne:`Page {page} of {pages}, {total} row`,pageTextOther:`Page {page} of {pages}, {total} rows`,resizeColumnLabel:`Resize column`,resizeColumnText:`Resize {label} column`,resizeText:`{px} pixels`,retryLabel:`Retry`,rowActionsLabel:`Actions`,rowSavedText:`Row saved.`,rowWasNotSavedText:`Row was not saved.`,rowsSavedText:`{n} rows saved.`,savedText:`{label} saved.`,selectAllRowsLabel:`Select all rows`,selectRowLabel:`Select row`,wasNotSavedText:`{label} was not saved.`};export{e as t};
|