@webority/ui-elements 0.148.0 → 0.150.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-DthhDxH-.js +1 -0
- package/dist/WuiCodeBlock-DHpmEskS.js +1 -0
- package/dist/WuiCommandPalette-DqHh4lH6.js +2 -0
- package/dist/WuiCommentThread-By-u3c5S.js +1 -0
- package/dist/WuiConsentBanner-Bm7tT3_5.js +1 -0
- package/dist/WuiContextMenu-sPTmEEVn.js +1 -0
- package/dist/WuiDataTable-D8UW2DMH.js +1 -0
- package/dist/WuiDatePicker-DLEsnzqG.js +31 -0
- package/dist/WuiDateRange-9Xqs5nvv.js +25 -0
- package/dist/WuiDock-d5abaLkL.js +1 -0
- package/dist/WuiDrawer-B3YFmxl2.js +1 -0
- package/dist/WuiHoverCard-CE3dHKaM.js +1 -0
- package/dist/WuiImageCrop-ChvH8GKb.js +17 -0
- package/dist/WuiInlineEdit-r55qgh8A.js +1 -0
- package/dist/WuiLeadPopup-YN4YCbOe.js +382 -0
- package/dist/WuiLightbox-D7Nf1SbH.js +1 -0
- package/dist/WuiMarkdown-N96OX-To.js +4 -0
- package/dist/WuiMentionInput-BFB57FZI.js +1 -0
- package/dist/WuiNavigationMenu-CZ3XhFam.js +1 -0
- package/dist/WuiNotificationCenter-C6e13nCh.js +1 -0
- package/dist/WuiOnboardingChecklist-Cx-TgpBY.js +1 -0
- package/dist/WuiOrgTree-DzeLFQxy.js +1 -0
- package/dist/{WuiOtp-BqWijfNj.js → WuiOtp-DonxSwVn.js} +2 -2
- package/dist/WuiOverflow-CeLUmJR-.js +1 -0
- package/dist/WuiPhone-rtex3VDC.js +16 -0
- package/dist/WuiRating-DLVduJZ_.js +1 -0
- package/dist/WuiRecordPager-7HVGoFlP.js +1 -0
- package/dist/WuiRelativeTime-RdC80Zii.js +1 -0
- package/dist/WuiResizable-DQZdQVCz.js +1 -0
- package/dist/WuiRollingNumber-YRMeRCGW.js +1 -0
- package/dist/WuiSavedViews-DtyAoZKb.js +1 -0
- package/dist/WuiSelect-D9ABfsdZ.js +9 -0
- package/dist/WuiShortcuts-D3rWkaOm.js +1 -0
- package/dist/WuiShowMore-CvdNQXrA.js +1 -0
- package/dist/WuiSlider-D33Y3_t9.js +51 -0
- package/dist/WuiSortable-CBLMNRuZ.js +1 -0
- package/dist/WuiTimePicker-DOodgU2O.js +9 -0
- package/dist/WuiTour-CrIFLmSK.js +1 -0
- package/dist/WuiTree-ZD9GGmtg.js +1 -0
- package/dist/WuiTruncate-C2WV1-NN.js +1 -0
- package/dist/WuiWhatsNew-dLGyA4g1.js +1 -0
- package/dist/WuiWizardStep-Cencr-mT.js +1 -0
- package/dist/{anchorOverlay-DDrc2k6y.js → anchorOverlay-CXnWfezA.js} +1 -1
- package/dist/buttonClass-GtEi8hAY.js +1 -0
- package/dist/calendarMath-D6UUgYTD.js +1 -0
- package/dist/chips-2yXiMhK4.js +2 -0
- package/dist/commentText-BnX7rA2-.js +1 -0
- package/dist/{countries-CvmZ2xpG.js → countries-DQL9nAUt.js} +1 -1
- package/dist/country-x5lqC5Xu.js +1 -0
- package/dist/customRule-Chp7YwFb.js +1 -0
- package/dist/dataTable-D23oUOhU.js +1 -0
- package/dist/dom-Do1pAA12.js +1 -0
- package/dist/drawerDiscard-CUN8L47U.js +1 -0
- package/dist/elementBase-Cxeyx0tU.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/dock.js +1 -1
- package/dist/elements/drawer.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/markdown.js +1 -1
- package/dist/elements/mention-input.js +1 -1
- package/dist/elements/navigation-menu.js +1 -1
- package/dist/elements/notification-center.js +1 -1
- package/dist/elements/onboarding-checklist.js +1 -1
- package/dist/elements/org-tree.js +1 -1
- package/dist/elements/otp.js +1 -1
- package/dist/elements/overflow.js +1 -1
- package/dist/elements/phone.js +1 -1
- package/dist/elements/rating.js +1 -1
- package/dist/elements/record-pager.js +1 -1
- package/dist/elements/relative-time.js +1 -1
- package/dist/elements/resizable.js +1 -1
- package/dist/elements/rolling-number.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/status-icon.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/truncate.js +1 -1
- package/dist/elements/whats-new.js +1 -1
- package/dist/elements/wizard.js +1 -1
- package/dist/{fileViewerImage-CLzN49Fd.js → fileViewerImage-tzF4DDq7.js} +2 -2
- package/dist/fileViewerMedia-Bp1uHJvC.js +1 -0
- package/dist/{fileViewerPdf-6MAAzmCM.js → fileViewerPdf-BLMhF8NT.js} +11 -11
- package/dist/fileViewerUi-ResPjO1o.js +1 -0
- package/dist/filterPopover-D8BOb-Hz.js +1 -0
- package/dist/formMirror-9IpSgeZb.js +1 -0
- package/dist/formatters-C3V6M5zV.js +1 -0
- package/dist/helpers.js +1 -1
- package/dist/iconGlyphs.g-DPqoOoXy.js +1 -0
- package/dist/inlineEditText-H7Pr8IU9.js +1 -0
- package/dist/kanban-CJ587-XT.js +1 -0
- package/dist/kanbanModel-BdqSa1lJ.js +1 -0
- package/dist/listQuery.js +1 -1
- package/dist/listboxKeyNav-4LeEjKq6.js +1 -0
- package/dist/loader-ByHAB1wi.js +1 -0
- package/dist/mentionText-BJsw_opZ.js +1 -0
- package/dist/{notificationDays-dNQZGLlB.js → notificationDays-BKVW7xYD.js} +1 -1
- package/dist/{optionLabel-CLemms21.js → optionLabel-4xjXWy74.js} +1 -1
- package/dist/recents-CmLLdV8O.js +1 -0
- package/dist/relativeTime-YTAOONRy.js +1 -0
- package/dist/search-BXcvm716.js +1 -0
- package/dist/server.js +1 -1
- package/dist/shortcutKeys-COVLox98.js +1 -0
- package/dist/{statusIcons-Dt2ZVJyk.js → statusIcons-CRtqA_1C.js} +2 -2
- package/dist/themeTransition-9LQC6fx8.js +1 -0
- package/dist/tourSeenStore-z0Y_Znzx.js +1 -0
- package/dist/ui-calendar.global.js +1 -1
- package/dist/ui-calendar.js +1 -1
- package/dist/ui-chart.global.js +15 -15
- package/dist/ui-chart.js +13 -13
- 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 +4 -4
- package/dist/ui-elements/drawer.global.js +1 -1
- package/dist/ui-elements/glyphs.global.js +1 -0
- package/dist/ui-elements/image-crop.global.js +2 -2
- 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 +3 -3
- package/dist/ui-elements/lightbox.global.js +1 -1
- package/dist/ui-elements/markdown.global.js +2 -2
- package/dist/ui-elements/org-tree.global.js +1 -1
- package/dist/ui-elements/phone.global.js +9 -9
- package/dist/ui-elements/resizable.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 +2 -2
- package/dist/ui-elements/sortable.global.js +1 -1
- package/dist/ui-elements/status-icon.global.js +2 -2
- package/dist/ui-elements/timepicker.global.js +2 -2
- 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 +18 -18
- 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-phone.global.js +8 -8
- package/dist/ui-rich-text.global.js +57 -57
- package/dist/ui-rich-text.js +56 -56
- package/dist/ui-tour.global.js +1 -1
- package/dist/wuiHttp-523iN_RF.js +1 -0
- package/dist/{zone-D82f-GU_.js → zone-BR02ZkHF.js} +1 -1
- package/package.json +207 -55
- package/types/WuiCalendar.d.ts +69 -0
- package/types/WuiCarousel.d.ts +64 -0
- package/types/WuiChart.d.ts +77 -0
- package/types/WuiCodeBlock.d.ts +27 -0
- package/types/WuiCommandPalette.d.ts +135 -0
- package/types/WuiCommentThread.d.ts +77 -0
- package/types/WuiConsentBanner.d.ts +73 -0
- package/types/WuiContextMenu.d.ts +90 -0
- package/types/WuiDataTable.d.ts +90 -0
- package/types/WuiDatePicker.d.ts +59 -0
- package/types/WuiDateRange.d.ts +61 -0
- package/types/WuiDock.d.ts +20 -0
- package/types/WuiDrawer.d.ts +65 -0
- package/types/WuiFileViewer.d.ts +111 -0
- package/types/WuiHoverCard.d.ts +29 -0
- package/types/WuiImageCrop.d.ts +119 -0
- package/types/WuiInlineEdit.d.ts +65 -0
- package/types/WuiLeadPopup.d.ts +83 -0
- package/types/WuiLightbox.d.ts +80 -0
- package/types/WuiMarkdown.d.ts +85 -0
- package/types/WuiMentionInput.d.ts +112 -0
- package/types/WuiNavigationMenu.d.ts +29 -0
- package/types/WuiNotificationCenter.d.ts +34 -0
- package/types/WuiOnboardingChecklist.d.ts +34 -0
- package/types/WuiOrgTree.d.ts +50 -0
- package/types/WuiOtp.d.ts +32 -0
- package/types/WuiOverflow.d.ts +29 -0
- package/types/WuiPhone.d.ts +37 -0
- package/types/WuiRating.d.ts +17 -0
- package/types/WuiRecordPager.d.ts +9 -0
- package/types/WuiRelativeTime.d.ts +17 -0
- package/types/WuiResizable.d.ts +79 -0
- package/types/WuiRichText.d.ts +45 -0
- package/types/WuiRollingNumber.d.ts +27 -0
- package/types/WuiSavedViews.d.ts +41 -0
- package/types/WuiSelect.d.ts +138 -0
- package/types/WuiShortcuts.d.ts +31 -0
- package/types/WuiShowMore.d.ts +16 -0
- package/types/WuiSlider.d.ts +126 -0
- package/types/WuiSortable.d.ts +127 -0
- package/types/WuiTimePicker.d.ts +68 -0
- package/types/WuiTour.d.ts +117 -0
- package/types/WuiTree.d.ts +112 -0
- package/types/WuiTruncate.d.ts +19 -0
- package/types/WuiWhatsNew.d.ts +36 -0
- package/types/WuiWizard.d.ts +78 -0
- package/types/WuiWizardStep.d.ts +5 -0
- package/types/anchorOverlay.d.ts +75 -0
- package/types/avatarHtml.d.ts +10 -0
- package/types/avatarPicker.d.ts +47 -0
- package/types/buttonClass.d.ts +8 -0
- package/types/calendar.d.ts +3 -0
- package/types/calendarAdapter.d.ts +68 -0
- package/types/calendarMath.d.ts +40 -0
- package/types/calendarModel.d.ts +78 -0
- package/types/chart.d.ts +4 -0
- package/types/chartAdapter.d.ts +160 -0
- package/types/chartSpec.d.ts +382 -0
- package/types/codeHighlight.d.ts +25 -0
- package/types/collapsibleSearch.d.ts +7 -0
- package/types/commandShortcut.d.ts +12 -0
- package/types/commentText.d.ts +40 -0
- package/types/consentBannerGlobal.d.ts +1 -0
- package/types/consentBannerStandalone.d.ts +2 -0
- package/types/copyText.d.ts +10 -0
- package/types/countries.d.ts +3 -0
- package/types/currency.d.ts +6 -0
- package/types/dataTable.d.ts +159 -0
- package/types/datePresets.d.ts +19 -0
- package/types/defaultCountry.d.ts +3 -0
- package/types/defineElement.d.ts +6 -0
- package/types/devWarn.d.ts +2 -0
- package/types/dom.d.ts +8 -0
- package/types/drawerSnap.d.ts +24 -0
- package/types/elementBase.d.ts +2 -0
- package/types/elementRegistry.d.ts +5 -0
- package/types/elements/carousel.d.ts +2 -0
- package/types/elements/code-block.d.ts +2 -0
- package/types/elements/command-palette.d.ts +2 -0
- package/types/elements/comment-thread.d.ts +4 -0
- package/types/elements/consent-banner.d.ts +2 -0
- package/types/elements/context-menu.d.ts +2 -0
- package/types/elements/data-table.d.ts +3 -0
- package/types/elements/date-range.d.ts +2 -0
- package/types/elements/datepicker.d.ts +2 -0
- package/types/elements/dock.d.ts +2 -0
- package/types/elements/drawer.d.ts +2 -0
- package/types/elements/filter-popover.d.ts +2 -0
- package/types/elements/hover-card.d.ts +2 -0
- package/types/elements/image-crop.d.ts +2 -0
- package/types/elements/inline-edit.d.ts +3 -0
- package/types/elements/kanban.d.ts +2 -0
- package/types/elements/lead-popup.d.ts +2 -0
- package/types/elements/lightbox.d.ts +2 -0
- package/types/elements/markdown.d.ts +2 -0
- package/types/elements/mention-input.d.ts +3 -5
- package/types/elements/navigation-menu.d.ts +2 -0
- package/types/elements/notification-center.d.ts +2 -0
- package/types/elements/onboarding-checklist.d.ts +2 -0
- package/types/elements/org-tree.d.ts +2 -0
- package/types/elements/otp.d.ts +2 -0
- package/types/elements/overflow.d.ts +2 -0
- package/types/elements/phone.d.ts +2 -0
- package/types/elements/rating.d.ts +2 -0
- package/types/elements/record-pager.d.ts +2 -0
- package/types/elements/relative-time.d.ts +3 -0
- package/types/elements/resizable.d.ts +2 -0
- package/types/elements/rolling-number.d.ts +2 -0
- package/types/elements/saved-views.d.ts +2 -0
- package/types/elements/select.d.ts +2 -0
- package/types/elements/shortcuts.d.ts +2 -0
- package/types/elements/show-more.d.ts +2 -0
- package/types/elements/slider.d.ts +2 -0
- package/types/elements/sortable.d.ts +2 -0
- package/types/elements/status-icon.d.ts +1 -0
- package/types/elements/timepicker.d.ts +2 -0
- package/types/elements/tour.d.ts +1 -6
- package/types/elements/tree.d.ts +2 -0
- package/types/elements/truncate.d.ts +2 -0
- package/types/elements/whats-new.d.ts +2 -0
- package/types/elements/wizard.d.ts +3 -0
- package/types/fieldState.d.ts +4 -0
- package/types/fileDrop.d.ts +31 -0
- package/types/fileValidation.d.ts +47 -0
- package/types/fileViewer.d.ts +3 -0
- package/types/fileViewerImage.d.ts +69 -0
- package/types/fileViewerMedia.d.ts +62 -0
- package/types/fileViewerPdf.d.ts +214 -0
- package/types/fileViewerSearch.d.ts +55 -0
- package/types/fileViewerUi.d.ts +33 -0
- package/types/filterPopover.d.ts +55 -0
- package/types/focusOrigin.d.ts +3 -0
- package/types/formMirror.d.ts +22 -0
- package/types/formatters.d.ts +119 -0
- package/types/global/chunks.d.ts +12 -0
- package/types/global/core.d.ts +57 -0
- package/types/global/glyphs.d.ts +10 -0
- package/types/global/loader.d.ts +16 -0
- package/types/global/parts/glyphs.d.ts +1 -0
- package/types/global/parts/select-chips.d.ts +1 -0
- package/types/global/parts/select-country.d.ts +1 -0
- package/types/global/parts/select-recents.d.ts +1 -0
- package/types/global/parts/select-search.d.ts +1 -0
- package/types/global/shared.d.ts +56 -0
- package/types/globals.d.ts +238 -0
- package/types/helpers.d.ts +29 -3
- package/types/iconGlyphs.g.d.ts +7 -0
- package/types/iconGlyphsCore.g.d.ts +1 -0
- package/types/iconGlyphsLazy.g.d.ts +1 -0
- package/types/imageCrop.d.ts +75 -0
- package/types/index.d.ts +54 -0
- package/types/inlineEditText.d.ts +47 -0
- package/types/inputMask.d.ts +70 -0
- package/types/kanban.d.ts +157 -0
- package/types/kanbanModel.d.ts +77 -0
- package/types/leadPopupGlobal.d.ts +1 -0
- package/types/leadPopupStandalone.d.ts +2 -0
- package/types/listQuery.d.ts +87 -0
- package/types/listboxKeyNav.d.ts +63 -0
- package/types/mentionText.d.ts +45 -0
- package/types/navReveal.d.ts +1 -0
- package/types/notificationDays.d.ts +50 -0
- package/types/optionLabel.d.ts +27 -0
- package/types/overlayRelease.d.ts +12 -0
- package/types/pageBarBulk.d.ts +4 -0
- package/types/passwordRules.d.ts +50 -0
- package/types/phoneData.d.ts +1 -0
- package/types/phoneLib.d.ts +15 -0
- package/types/phoneLibGlobal.d.ts +3 -0
- package/types/razor-js/modules/api.d.ts +33 -0
- package/types/razor-js/modules/avatars.d.ts +1 -0
- package/types/razor-js/modules/dropZones.d.ts +2 -0
- package/types/razor-js/modules/fileHelpers.d.ts +16 -0
- package/types/razor-js/modules/filePickers.d.ts +6 -0
- package/types/razor-js/modules/filterBars.d.ts +1 -0
- package/types/razor-js/modules/imagePickers.d.ts +1 -0
- package/types/razor-js/modules/inputs.d.ts +10 -0
- package/types/razor-js/modules/look.d.ts +6 -0
- package/types/razor-js/modules/overlays.d.ts +5 -0
- package/types/razor-js/modules/pageListeners.d.ts +1 -0
- package/types/razor-js/modules/popovers.d.ts +1 -0
- package/types/razor-js/modules/serverBridge.d.ts +13 -0
- package/types/razor-js/modules/shared.d.ts +15 -0
- package/types/razor-js/modules/shell.d.ts +1 -0
- package/types/razor-js/modules/splitView.d.ts +2 -0
- package/types/razor-js/modules/tables.d.ts +9 -0
- package/types/razor-js/modules/tabs.d.ts +1 -0
- package/types/razor-js/modules/themeCopy.d.ts +2 -0
- package/types/razor-js/modules/toast.d.ts +3 -0
- package/types/razor-js/modules/validation.d.ts +11 -0
- package/types/razor-js/modules/widgets.d.ts +9 -0
- package/types/razor-js/webority-ui.d.ts +48 -0
- package/types/relativeTime.d.ts +10 -0
- package/types/richText.d.ts +2 -0
- package/types/richTextAdapter.d.ts +54 -0
- package/types/richTextIcons.d.ts +1 -0
- package/types/rowDrop.d.ts +12 -0
- package/types/scrollEdges.d.ts +10 -0
- package/types/select/chips.d.ts +2 -0
- package/types/select/country.d.ts +2 -0
- package/types/select/customRule.d.ts +3 -0
- package/types/select/list.d.ts +32 -0
- package/types/select/option.d.ts +21 -0
- package/types/select/part.d.ts +103 -0
- package/types/select/partRegistry.d.ts +7 -0
- package/types/select/parts.d.ts +1 -0
- package/types/select/partsGlobal.d.ts +4 -0
- package/types/select/recents.d.ts +2 -0
- package/types/select/remote.d.ts +2 -0
- package/types/select/search.d.ts +5 -0
- package/types/server/drawerDiscard.d.ts +9 -0
- package/types/server/index.d.ts +9 -0
- package/types/server/remoteModal.d.ts +96 -0
- package/types/server/serverActions.d.ts +33 -0
- package/types/server/serverTable.d.ts +48 -0
- package/types/server/shellParts.d.ts +24 -0
- package/types/server/toastAction.d.ts +7 -0
- package/types/server/toastHeader.d.ts +8 -0
- package/types/server/unsavedChanges.d.ts +17 -0
- package/types/server/wuiHttp.d.ts +86 -0
- package/types/shortcutKeys.d.ts +59 -0
- package/types/statusIconImages.d.ts +1 -0
- package/types/statusIcons.d.ts +12 -0
- package/types/stepperHeader.d.ts +31 -0
- package/types/submitOnce.d.ts +3 -0
- package/types/tableSelect.d.ts +34 -0
- package/types/textMatch.d.ts +9 -0
- package/types/themeTransition.d.ts +88 -0
- package/types/toastTypes.d.ts +20 -0
- package/types/tokenCommit.d.ts +13 -0
- package/types/tourAdvance.d.ts +51 -0
- package/types/tourEnd.d.ts +17 -0
- package/types/tourGlobal.d.ts +4 -0
- package/types/tourIsolated.d.ts +2 -0
- package/types/tourMedia.d.ts +19 -0
- package/types/tourMotion.d.ts +20 -0
- package/types/tourOpenMark.d.ts +1 -0
- package/types/tourPlacement.d.ts +24 -0
- package/types/tourProgress.d.ts +29 -0
- package/types/tourSeenStore.d.ts +12 -0
- package/types/zone.d.ts +24 -0
- package/types/zoneCountries.g.d.ts +1 -0
- package/dist/WuiCarousel-C2NWcFxr.js +0 -1
- package/dist/WuiCodeBlock-CCCJwsk5.js +0 -1
- package/dist/WuiCommandPalette-Bfrbocu6.js +0 -2
- package/dist/WuiCommentThread-Dx3vvBWp.js +0 -1
- package/dist/WuiConsentBanner-jkeRiC1_.js +0 -1
- package/dist/WuiContextMenu-KXD8TFfy.js +0 -1
- package/dist/WuiDataTable-DAxAegnG.js +0 -1
- package/dist/WuiDatePicker-kEyyILbM.js +0 -31
- package/dist/WuiDateRange-B05PsdJ3.js +0 -25
- package/dist/WuiDock-Bd2ijOaJ.js +0 -1
- package/dist/WuiDrawer-SkxcDhgf.js +0 -1
- package/dist/WuiHoverCard-Bqapy8Is.js +0 -1
- package/dist/WuiImageCrop-DzzzPagi.js +0 -17
- package/dist/WuiInlineEdit-BqgKfVMy.js +0 -1
- package/dist/WuiLeadPopup-Dwmg7coE.js +0 -382
- package/dist/WuiLightbox-DCTE3ULH.js +0 -1
- package/dist/WuiMarkdown-D5vm4sp4.js +0 -4
- package/dist/WuiMentionInput-Bi3VQoKo.js +0 -1
- package/dist/WuiNavigationMenu-DmH3waKW.js +0 -1
- package/dist/WuiNotificationCenter-DawJRGBc.js +0 -1
- package/dist/WuiOnboardingChecklist-DXUETu1h.js +0 -1
- package/dist/WuiOrgTree-DuaBtFl9.js +0 -1
- package/dist/WuiOverflow-DP3qEbDp.js +0 -1
- package/dist/WuiPhone-CFne_6XG.js +0 -16
- package/dist/WuiRating-DhhqYj5Z.js +0 -1
- package/dist/WuiRecordPager-BOaFcs_W.js +0 -1
- package/dist/WuiRelativeTime-BG6rgUhw.js +0 -1
- package/dist/WuiResizable-mt9EMhjQ.js +0 -1
- package/dist/WuiRollingNumber-CF3H6l7t.js +0 -1
- package/dist/WuiSavedViews-BMBQUv2K.js +0 -1
- package/dist/WuiSelect-oSJPev4N.js +0 -9
- package/dist/WuiShortcuts-BEvFCIu9.js +0 -1
- package/dist/WuiShowMore-D3VHRZJg.js +0 -1
- package/dist/WuiSlider-2kB__6zU.js +0 -51
- package/dist/WuiSortable-r5iZtzM1.js +0 -1
- package/dist/WuiTimePicker-DqqZPv0T.js +0 -9
- package/dist/WuiTour-B-V1PZnw.js +0 -1
- package/dist/WuiTree-B3cnH1PG.js +0 -1
- package/dist/WuiTruncate-DyDQWMBu.js +0 -1
- package/dist/WuiWhatsNew-B5jK2zwZ.js +0 -1
- package/dist/WuiWizardStep-CIYuIp4a.js +0 -1
- package/dist/buttonClass-Yk0Fwgs6.js +0 -1
- package/dist/calendarMath-BC2wGCD-.js +0 -1
- package/dist/chips-DbhCYoAp.js +0 -2
- package/dist/country-3uo7no9r.js +0 -1
- package/dist/customRule-BE7CusA3.js +0 -1
- package/dist/dataTable-BoyxeUL4.js +0 -1
- package/dist/drawerDiscard-D6YgF59q.js +0 -1
- package/dist/elementBase-DV9IZZCu.js +0 -1
- package/dist/fileViewerMedia-BQ0lVXy9.js +0 -1
- package/dist/fileViewerUi-DQH6_B1a.js +0 -1
- package/dist/filterPopover-DniNyLWI.js +0 -1
- package/dist/formMirror-BMQTenSi.js +0 -1
- package/dist/formatters-Ba0CvsTs.js +0 -1
- package/dist/iconGlyphs.g-BlwTSNXS.js +0 -1
- package/dist/kanban-BtgxVDE-.js +0 -1
- package/dist/listboxKeyNav-DMIvs9d6.js +0 -1
- package/dist/loader-Dw3IkGM0.js +0 -1
- package/dist/recents-BzN7j9kV.js +0 -1
- package/dist/search-CdAH8NGK.js +0 -1
- package/dist/shortcutKeys-CvxSh3bV.js +0 -1
- package/dist/themeTransition-rHRVbhHB.js +0 -1
- package/dist/wuiHttp-BuaTcumE.js +0 -1
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import{n as e,t}from"./devWarn-DXdRWZs3.js";import{t as n}from"./elementBase-Cxeyx0tU.js";var r={"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-soft":`#E0E7FF`,"--color-primary-text":`#4F46E5`,"--color-on-primary":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-border-strong":`#C4CADA`,"--color-surface":`#FFFFFF`,"--wui-radius-sm":`8px`,"--wui-radius-lg":`14px`,"--wui-shadow-modal":`0px 24px 60px -16px rgba(7, 20, 55, 0.28)`,"--wui-z-modal":`1505`},i=e=>`var(${e}, ${r[e]})`,a=`
|
|
2
|
+
:host {
|
|
3
|
+
all: initial;
|
|
4
|
+
display: contents;
|
|
5
|
+
font-family: inherit;
|
|
6
|
+
font-size: 16px;
|
|
7
|
+
line-height: 1.5;
|
|
8
|
+
color: ${i(`--color-text`)};
|
|
9
|
+
}
|
|
10
|
+
*, *::before, *::after {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
}
|
|
13
|
+
[hidden] {
|
|
14
|
+
display: none !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
dialog {
|
|
18
|
+
z-index: ${i(`--wui-z-modal`)};
|
|
19
|
+
width: 100%;
|
|
20
|
+
max-width: none;
|
|
21
|
+
height: 100%;
|
|
22
|
+
max-height: none;
|
|
23
|
+
margin: 0;
|
|
24
|
+
padding: 0;
|
|
25
|
+
border: 0;
|
|
26
|
+
background: transparent;
|
|
27
|
+
color: inherit;
|
|
28
|
+
}
|
|
29
|
+
dialog[open] {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
}
|
|
34
|
+
:host([preview]) dialog {
|
|
35
|
+
position: static;
|
|
36
|
+
height: auto;
|
|
37
|
+
}
|
|
38
|
+
dialog::backdrop {
|
|
39
|
+
background: rgba(0, 0, 0, 0.7);
|
|
40
|
+
backdrop-filter: blur(5px);
|
|
41
|
+
}
|
|
42
|
+
dialog[open]::backdrop {
|
|
43
|
+
animation: wlp-fade 0.3s ease-out;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.wlp-card {
|
|
47
|
+
position: relative;
|
|
48
|
+
width: 90%;
|
|
49
|
+
max-width: 440px;
|
|
50
|
+
max-height: calc(100dvh - 32px);
|
|
51
|
+
overflow-y: auto;
|
|
52
|
+
padding: 24px;
|
|
53
|
+
background: ${i(`--color-surface`)};
|
|
54
|
+
color: ${i(`--color-text`)};
|
|
55
|
+
border: 1px solid ${i(`--color-border`)};
|
|
56
|
+
border-radius: ${i(`--wui-radius-lg`)};
|
|
57
|
+
box-shadow: ${i(`--wui-shadow-modal`)};
|
|
58
|
+
text-align: start;
|
|
59
|
+
}
|
|
60
|
+
dialog[open] .wlp-card {
|
|
61
|
+
animation: wlp-card-in 0.2s ease-out;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.wlp-close {
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: 12px;
|
|
67
|
+
inset-inline-end: 12px;
|
|
68
|
+
width: 32px;
|
|
69
|
+
height: 32px;
|
|
70
|
+
padding: 0;
|
|
71
|
+
border: 0;
|
|
72
|
+
border-radius: 50%;
|
|
73
|
+
background: transparent;
|
|
74
|
+
color: ${i(`--color-text-muted`)};
|
|
75
|
+
font: inherit;
|
|
76
|
+
font-size: 22px;
|
|
77
|
+
line-height: 1;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
}
|
|
80
|
+
.wlp-close:focus-visible,
|
|
81
|
+
.wlp-button:focus-visible,
|
|
82
|
+
.wlp-input:focus-visible,
|
|
83
|
+
.wlp-secondary:focus-visible {
|
|
84
|
+
outline: 2px solid ${i(`--color-primary`)};
|
|
85
|
+
outline-offset: 2px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.wlp-heading {
|
|
89
|
+
margin: 0 32px 8px 0;
|
|
90
|
+
font-size: 20px;
|
|
91
|
+
font-weight: 600;
|
|
92
|
+
line-height: 1.3;
|
|
93
|
+
color: ${i(`--color-text`)};
|
|
94
|
+
}
|
|
95
|
+
.wlp-description {
|
|
96
|
+
margin: 0 0 16px;
|
|
97
|
+
font-size: 14px;
|
|
98
|
+
color: ${i(`--color-text-muted`)};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.wlp-form {
|
|
102
|
+
display: grid;
|
|
103
|
+
gap: 14px;
|
|
104
|
+
margin: 0;
|
|
105
|
+
}
|
|
106
|
+
.wlp-field {
|
|
107
|
+
display: grid;
|
|
108
|
+
gap: 4px;
|
|
109
|
+
}
|
|
110
|
+
.wlp-label {
|
|
111
|
+
font-size: 14px;
|
|
112
|
+
font-weight: 500;
|
|
113
|
+
color: ${i(`--color-text`)};
|
|
114
|
+
}
|
|
115
|
+
.wlp-req {
|
|
116
|
+
margin-inline-start: 2px;
|
|
117
|
+
color: ${i(`--color-primary`)};
|
|
118
|
+
}
|
|
119
|
+
.wlp-input {
|
|
120
|
+
width: 100%;
|
|
121
|
+
padding: 9px 12px;
|
|
122
|
+
border: 1px solid ${i(`--color-border`)};
|
|
123
|
+
border-radius: 8px;
|
|
124
|
+
background: ${i(`--color-surface`)};
|
|
125
|
+
color: ${i(`--color-text`)};
|
|
126
|
+
font: inherit;
|
|
127
|
+
font-size: 15px;
|
|
128
|
+
}
|
|
129
|
+
textarea.wlp-input {
|
|
130
|
+
resize: vertical;
|
|
131
|
+
min-height: 96px;
|
|
132
|
+
}
|
|
133
|
+
.wlp-input[aria-invalid="true"] {
|
|
134
|
+
border-color: var(--color-danger, #B42318);
|
|
135
|
+
}
|
|
136
|
+
.wlp-error {
|
|
137
|
+
margin: 0;
|
|
138
|
+
font-size: 13px;
|
|
139
|
+
color: var(--color-danger, #B42318);
|
|
140
|
+
}
|
|
141
|
+
.wlp-form-error {
|
|
142
|
+
margin: 0;
|
|
143
|
+
font-size: 14px;
|
|
144
|
+
color: var(--color-danger, #B42318);
|
|
145
|
+
}
|
|
146
|
+
/* The consent field uses the theme's checkbox markup; its look is restated here because the
|
|
147
|
+
theme's rules cannot reach the shadow root. */
|
|
148
|
+
.form-check {
|
|
149
|
+
display: grid;
|
|
150
|
+
grid-template-columns: auto 1fr;
|
|
151
|
+
align-items: center;
|
|
152
|
+
column-gap: 12px;
|
|
153
|
+
font-size: 14px;
|
|
154
|
+
line-height: 1.4;
|
|
155
|
+
color: ${i(`--color-text`)};
|
|
156
|
+
}
|
|
157
|
+
.form-check-input {
|
|
158
|
+
flex: none;
|
|
159
|
+
width: 20px;
|
|
160
|
+
height: 20px;
|
|
161
|
+
margin: 0;
|
|
162
|
+
appearance: none;
|
|
163
|
+
-webkit-appearance: none;
|
|
164
|
+
border: 1.6px solid ${i(`--color-border-strong`)};
|
|
165
|
+
border-radius: ${i(`--wui-radius-sm`)};
|
|
166
|
+
corner-shape: squircle;
|
|
167
|
+
background-color: ${i(`--color-surface`)};
|
|
168
|
+
background-repeat: no-repeat;
|
|
169
|
+
background-position: center;
|
|
170
|
+
background-size: 15px 15px;
|
|
171
|
+
cursor: pointer;
|
|
172
|
+
transition:
|
|
173
|
+
border-color 0.15s ease,
|
|
174
|
+
background-color 0.15s ease,
|
|
175
|
+
box-shadow 0.15s ease;
|
|
176
|
+
}
|
|
177
|
+
.form-check-input:hover:not(:checked) {
|
|
178
|
+
border-color: ${i(`--color-primary`)};
|
|
179
|
+
box-shadow: 0 0 0 2px ${i(`--color-primary-soft`)};
|
|
180
|
+
}
|
|
181
|
+
.form-check-input:checked {
|
|
182
|
+
border-color: ${i(`--color-primary`)};
|
|
183
|
+
background-color: ${i(`--color-primary`)};
|
|
184
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E");
|
|
185
|
+
}
|
|
186
|
+
.form-check-input:focus-visible {
|
|
187
|
+
outline: 2px solid ${i(`--color-primary`)};
|
|
188
|
+
outline-offset: 2px;
|
|
189
|
+
box-shadow: none;
|
|
190
|
+
}
|
|
191
|
+
.form-check-input[aria-invalid="true"] {
|
|
192
|
+
border-color: var(--color-danger, #B42318);
|
|
193
|
+
}
|
|
194
|
+
.form-check-label {
|
|
195
|
+
min-width: 0;
|
|
196
|
+
cursor: pointer;
|
|
197
|
+
}
|
|
198
|
+
.wlp-field-consent .wlp-error {
|
|
199
|
+
margin-inline-start: 32px;
|
|
200
|
+
}
|
|
201
|
+
.wlp-consent-link {
|
|
202
|
+
grid-column: 2;
|
|
203
|
+
justify-self: start;
|
|
204
|
+
color: ${i(`--color-primary-text`)};
|
|
205
|
+
font-weight: 500;
|
|
206
|
+
text-decoration: underline;
|
|
207
|
+
text-underline-offset: 3px;
|
|
208
|
+
}
|
|
209
|
+
.wlp-consent-link:focus-visible {
|
|
210
|
+
outline: 2px solid ${i(`--color-primary`)};
|
|
211
|
+
outline-offset: 2px;
|
|
212
|
+
border-radius: 4px;
|
|
213
|
+
}
|
|
214
|
+
.wlp-visually-hidden {
|
|
215
|
+
position: absolute;
|
|
216
|
+
width: 1px;
|
|
217
|
+
height: 1px;
|
|
218
|
+
margin: -1px;
|
|
219
|
+
padding: 0;
|
|
220
|
+
overflow: hidden;
|
|
221
|
+
clip: rect(0, 0, 0, 0);
|
|
222
|
+
white-space: nowrap;
|
|
223
|
+
border: 0;
|
|
224
|
+
}
|
|
225
|
+
.wlp-honeypot {
|
|
226
|
+
position: absolute !important;
|
|
227
|
+
left: -9999px !important;
|
|
228
|
+
width: 1px;
|
|
229
|
+
height: 1px;
|
|
230
|
+
opacity: 0;
|
|
231
|
+
pointer-events: none;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.wlp-actions {
|
|
235
|
+
display: flex;
|
|
236
|
+
justify-content: flex-end;
|
|
237
|
+
align-items: center;
|
|
238
|
+
gap: 8px;
|
|
239
|
+
margin-top: 4px;
|
|
240
|
+
}
|
|
241
|
+
.wlp-button {
|
|
242
|
+
display: inline-flex;
|
|
243
|
+
align-items: center;
|
|
244
|
+
justify-content: center;
|
|
245
|
+
min-height: 36px;
|
|
246
|
+
padding: 8px 16px;
|
|
247
|
+
border: 1px solid ${i(`--color-primary`)};
|
|
248
|
+
border-radius: 8px;
|
|
249
|
+
background: ${i(`--color-primary`)};
|
|
250
|
+
color: ${i(`--color-on-primary`)};
|
|
251
|
+
font: inherit;
|
|
252
|
+
font-size: 15px;
|
|
253
|
+
font-weight: 500;
|
|
254
|
+
cursor: pointer;
|
|
255
|
+
}
|
|
256
|
+
.wlp-button:hover {
|
|
257
|
+
background: ${i(`--color-primary-hover`)};
|
|
258
|
+
border-color: ${i(`--color-primary-hover`)};
|
|
259
|
+
}
|
|
260
|
+
.wlp-button:disabled {
|
|
261
|
+
opacity: 0.6;
|
|
262
|
+
cursor: default;
|
|
263
|
+
}
|
|
264
|
+
.wlp-notice {
|
|
265
|
+
margin: 4px 0 0;
|
|
266
|
+
font-size: 12px;
|
|
267
|
+
line-height: 1.4;
|
|
268
|
+
color: ${i(`--color-text-muted`)};
|
|
269
|
+
}
|
|
270
|
+
.wlp-notice a {
|
|
271
|
+
color: inherit;
|
|
272
|
+
text-decoration: underline;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.wlp-secondary-row {
|
|
276
|
+
display: flex;
|
|
277
|
+
align-items: center;
|
|
278
|
+
gap: 10px;
|
|
279
|
+
margin-top: 14px;
|
|
280
|
+
font-size: 14px;
|
|
281
|
+
color: ${i(`--color-text-muted`)};
|
|
282
|
+
}
|
|
283
|
+
.wlp-secondary-row::before,
|
|
284
|
+
.wlp-secondary-row::after {
|
|
285
|
+
content: "";
|
|
286
|
+
flex: 1;
|
|
287
|
+
height: 1px;
|
|
288
|
+
background: ${i(`--color-border`)};
|
|
289
|
+
}
|
|
290
|
+
.wlp-secondary {
|
|
291
|
+
display: block;
|
|
292
|
+
margin-top: 10px;
|
|
293
|
+
text-align: center;
|
|
294
|
+
color: ${i(`--color-primary`)};
|
|
295
|
+
font-weight: 500;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.wlp-success-title {
|
|
299
|
+
margin: 0 32px 8px 0;
|
|
300
|
+
font-size: 20px;
|
|
301
|
+
font-weight: 600;
|
|
302
|
+
color: ${i(`--color-text`)};
|
|
303
|
+
}
|
|
304
|
+
.wlp-success-text {
|
|
305
|
+
margin: 0 0 16px;
|
|
306
|
+
color: ${i(`--color-text-muted`)};
|
|
307
|
+
}
|
|
308
|
+
.wlp-success-view .wlp-button {
|
|
309
|
+
width: 100%;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
@keyframes wlp-fade {
|
|
313
|
+
from { opacity: 0; }
|
|
314
|
+
to { opacity: 1; }
|
|
315
|
+
}
|
|
316
|
+
@keyframes wlp-card-in {
|
|
317
|
+
from { opacity: 0; transform: scale(0.96); }
|
|
318
|
+
to { opacity: 1; transform: scale(1); }
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
@media (max-width: 575.98px) {
|
|
322
|
+
.wlp-card {
|
|
323
|
+
width: calc(100% - 32px);
|
|
324
|
+
max-width: none;
|
|
325
|
+
padding: 20px 16px;
|
|
326
|
+
}
|
|
327
|
+
.wlp-input {
|
|
328
|
+
font-size: 16px;
|
|
329
|
+
}
|
|
330
|
+
.wlp-button,
|
|
331
|
+
.wlp-close {
|
|
332
|
+
min-height: 44px;
|
|
333
|
+
}
|
|
334
|
+
.wlp-close {
|
|
335
|
+
min-width: 44px;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
@media (prefers-reduced-motion: reduce) {
|
|
340
|
+
dialog[open]::backdrop,
|
|
341
|
+
dialog[open] .wlp-card {
|
|
342
|
+
animation: none;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
`,o=[`name`,`email`,`phone`,`company`,`message`,`consent`],s=[`name`,`email`],c={name:`Name`,email:`Email`,phone:`Phone number`,company:`Company`,message:`Message`,consent:`I agree to be contacted about my enquiry`,consentLink:`Privacy policy`},l={name:100,email:320,phone:40,company:150,message:1e3},u={name:`name`,email:`email`,phone:`tel`,company:`organization`},d=`input:not([type=hidden]), textarea, select, button, a[href]`,f=[`exit`,`delay`,`scroll`,`pages`],p=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,m=864e5,h=`comment_subject`,g=`__RequestVerificationToken`,_=`__FormStamp`,v=`__CaptchaToken`,y=`Something went wrong. Please try again or contact us directly.`,b=`Tick the box to continue`,x=/* @__PURE__ */ `action.public-form.heading.description.fields.required.field-prefix.field-names.labels.max-lengths.submit-label.success-title.success-text.error-text.close-label.secondary-label.secondary-href.secondary-divider.consent-href.triggers.delay-seconds.scroll-percent.pages-viewed.storage-key.dismiss-days.submitted-days.success-close-seconds.preview`.split(`.`),S=/* @__PURE__ */ new Set;function C(t,n){S.has(t)||(S.add(t),e(n))}var w=0;function T(e){return(e??``).split(/\s+/).map(e=>e.trim()).filter(Boolean)}function E(e){let t={};for(let n of(e??``).split(`;`)){let e=n.indexOf(`=`);if(e<0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function D(e){return String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var O=null;function k(e){O||(O=new CSSStyleSheet,O.replaceSync(a)),e.adoptedStyleSheets=[O]}function A(e,t){return e instanceof Error&&e.message?e.message:t}function j(e){return o.some(t=>t===e)}function M(e){return f.some(t=>t===e)}function N(e,t,n){if(e instanceof t)return e;throw Error(`${n} missing`)}var P=class extends n{_uid;_rendered;_open;_opened;_posting;_stale;_armed;_session;_returnTo;_prevOverflow;_delayTimer;_closeTimer;_modal;_onMouseLeave;_onVisibility;_onScroll;static get observedAttributes(){return x}constructor(){super(),w+=1,this._uid=`wlp-${w}`,this._rendered=!1,this._open=!1,this._opened=!1,this._posting=!1,this._stale=!1,this._armed=!1,this._session=null,this._returnTo=null,this._prevOverflow=``,this._delayTimer=null,this._closeTimer=null,this._onMouseLeave=e=>{!this._fine()||e.clientY>0||!this._engaged()||this.open(`exit`)},this._onVisibility=()=>{document.visibilityState===`hidden`&&!this._fine()&&this._engaged()&&this.open(`exit`)},this._onScroll=()=>this._trackScroll()}get isOpen(){return this._open}set isOpen(e){e?this.open(`manual`):this.close(`dismiss`)}connectedCallback(){this._rendered||this._render(),this._arm(),this.preview&&!this._open&&this.open(`manual`)}disconnectedCallback(){this._disarm(),this._open&&this._release()}attributeChangedCallback(){this._rendered&&(this._open?this._stale=!0:this._render())}open(e=`manual`){if(!this._open&&!(e!==`manual`&&(this._opened||this._blocked()||document.querySelector(`dialog[open], .modal.show`)))){if(this._rendered||this._render(),this._opened=!0,this._open=!0,clearTimeout(this._delayTimer??void 0),this._showForm(),this._modal=!this.preview,this._modal){let e=document.activeElement;this._returnTo=e instanceof HTMLElement||e instanceof SVGElement?e:null,this._prevOverflow=document.documentElement.style.overflow,document.documentElement.style.overflow=`hidden`;let t=this._dialog();t.showModal();let n=t.querySelector(`[data-wlp-field] [data-wlp-input]`);n instanceof HTMLElement&&n.focus()}else this._dialog().setAttribute(`open`,``);this._remember(`shown`),this._emit(`wui-lead-popup-shown`,{trigger:e})}}close(e=`dismiss`){if(!this._open)return;clearTimeout(this._closeTimer??void 0),this._release();let t=this._returnTo;this._returnTo=null,t?.isConnected&&typeof t.focus==`function`&&t.focus(),this._stale&&this._render(),this._emit(`wui-lead-popup-closed`,{reason:e})}_release(){this._open=!1,this._dialog().close(),this._modal&&(document.documentElement.style.overflow=this._prevOverflow)}_root(){return this.shadowRoot??this.attachShadow({mode:`open`})}_dialog(){return N(this._root().querySelector(`dialog`),HTMLDialogElement,`dialog`)}_emit(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}_text(e,t=``){return this.getAttribute(e)||t}_number(e,t){let n=this.getAttribute(e);if(n===null||n.trim()===``)return t;let r=Number(n);return Number.isFinite(r)&&r>=0?r:t}get preview(){return this.hasAttribute(`preview`)}set preview(e){this.toggleAttribute(`preview`,e===!0||e===``||e===`true`)}_fieldKeys(){let e=T(this.getAttribute(`fields`)).filter(e=>j(e)?!0:(C(`field:${e}`,`[@webority/ui-elements] <wui-lead-popup> has no field "${e}". It is ignored.`),!1));return e.length?e:s}_requiredKeys(){let e=this._fieldKeys();return T(this.getAttribute(`required`)).filter(t=>j(t)&&e.includes(t))}_label(e){return E(this.getAttribute(`labels`))[e]||c[e]}_postedName(e){return this._text(`field-prefix`)+(E(this.getAttribute(`field-names`))[e]||e)}_maxLength(e){let t=Number(E(this.getAttribute(`max-lengths`))[e]);return Number.isInteger(t)&&t>0?t:l[e]}_triggers(){if(this.preview)return[];let e=(this.getAttribute(`triggers`)??``).split(/\s+/).filter(M);return e.length?this.getAttribute(`storage-key`)?e:(C(`storage-key`,`[@webority/ui-elements] <wui-lead-popup> has triggers but no storage-key. The triggers are off.`),[]):[]}_render(){let e=this._root();k(e);let t=this._uid,n=this._fieldKeys(),r=new Set(this._requiredKeys()),i=this._text(`heading`),a=this._text(`description`),o=this._text(`secondary-label`),s=this._text(`secondary-href`),c=n.map(e=>this._fieldMarkup(e,r.has(e))).join(``),l=document.createElement(`template`);l.innerHTML=`
|
|
346
|
+
<dialog class="wlp-dialog" aria-labelledby="${t}-h"${a?` aria-describedby="${t}-d"`:``}>
|
|
347
|
+
<div class="wlp-card">
|
|
348
|
+
<button type="button" class="wlp-close" aria-label="${D(this._text(`close-label`,`Close`))}" data-wlp-close>×</button>
|
|
349
|
+
<div class="wlp-form-view">
|
|
350
|
+
<h2 class="wlp-heading" id="${t}-h">${D(i)}</h2>
|
|
351
|
+
${a?`<p class="wlp-description" id="${t}-d">${D(a)}</p>`:``}
|
|
352
|
+
<form class="wlp-form" novalidate data-wlp-form>
|
|
353
|
+
${c}
|
|
354
|
+
<p class="wlp-form-error" role="alert" hidden data-wlp-form-error></p>
|
|
355
|
+
<div class="wlp-actions">
|
|
356
|
+
<button type="submit" class="wlp-button" data-wlp-submit>${D(this._text(`submit-label`,`Send`))}</button>
|
|
357
|
+
</div>
|
|
358
|
+
<input type="text" name="${h}" class="wlp-honeypot" tabindex="-1" autocomplete="off" aria-hidden="true" data-wlp-honeypot>
|
|
359
|
+
<p class="wlp-notice" data-recaptcha-notice>This site is protected by reCAPTCHA and the Google <a href="https://policies.google.com/privacy" target="_blank" rel="noopener">Privacy Policy</a> and <a href="https://policies.google.com/terms" target="_blank" rel="noopener">Terms of Service</a> apply.</p>
|
|
360
|
+
</form>
|
|
361
|
+
${o&&s?`<div class="wlp-secondary-row"><span>${D(this._text(`secondary-divider`,`or`))}</span></div><a class="wlp-secondary" href="${D(s)}" data-wlp-secondary>${D(o)}</a>`:``}
|
|
362
|
+
</div>
|
|
363
|
+
<div class="wlp-success-view" hidden>
|
|
364
|
+
<h2 class="wlp-success-title" role="status" tabindex="-1" data-wlp-success-title>${D(this._text(`success-title`,`Thank you`))}</h2>
|
|
365
|
+
${this._text(`success-text`)?`<p class="wlp-success-text">${D(this._text(`success-text`))}</p>`:``}
|
|
366
|
+
<button type="button" class="wlp-button" data-wlp-done>${D(this._text(`close-label`,`Close`))}</button>
|
|
367
|
+
</div>
|
|
368
|
+
</div>
|
|
369
|
+
</dialog>`,e.replaceChildren(l.content),this._rendered=!0,this._stale=!1,this._wire()}_fieldMarkup(e,t){let n=`${this._uid}-f-${e}`,r=`${this._uid}-e-${e}`,i=this._label(e),a=D(this._postedName(e)),o=t?`<span class="wlp-req" aria-hidden="true">*</span><span class="wlp-visually-hidden">required</span>`:``,s=t?` aria-required="true"`:``;if(e===`consent`){let t=this._text(`consent-href`),c=t?`<a class="wlp-consent-link" href="${D(t)}">${D(this._label(`consentLink`))}</a>`:``;return`
|
|
370
|
+
<div class="wlp-field wlp-field-consent" data-wlp-field="${e}">
|
|
371
|
+
<div class="form-check">
|
|
372
|
+
<input class="form-check-input" type="checkbox" id="${n}" data-wlp-input="${e}" name="${a}"${s}>
|
|
373
|
+
<label class="form-check-label" for="${n}">${D(i)}${o}</label>
|
|
374
|
+
${c}
|
|
375
|
+
</div>
|
|
376
|
+
<p class="wlp-error" id="${r}" hidden></p>
|
|
377
|
+
</div>`}let c=`id="${n}" data-wlp-input="${e}" name="${a}" maxlength="${this._maxLength(e)}"${s}`,l=e===`message`?`<textarea class="wlp-input" rows="4" ${c}></textarea>`:`<input class="wlp-input" type="${e===`email`?`email`:e===`phone`?`tel`:`text`}" ${c}${u[e]?` autocomplete="${u[e]}"`:``}>`;return`
|
|
378
|
+
<div class="wlp-field" data-wlp-field="${e}">
|
|
379
|
+
<label class="wlp-label" for="${n}">${D(i)}${o}</label>
|
|
380
|
+
${l}
|
|
381
|
+
<p class="wlp-error" id="${r}" hidden></p>
|
|
382
|
+
</div>`}_wire(){let e=this._dialog();e.addEventListener(`cancel`,e=>{e.preventDefault(),this.close(`escape`)}),e.addEventListener(`click`,t=>{t.target===e&&this.close(`backdrop`)}),e.addEventListener(`keydown`,t=>{if(t.key!==`Tab`||!this._modal)return;let n=Array.from(e.querySelectorAll(d)).filter(e=>e instanceof HTMLElement&&!(`disabled`in e&&e.disabled===!0)&&e.getClientRects().length>0);if(!n.length)return;let r=this._root().activeElement,i=r instanceof HTMLElement?n.indexOf(r):-1;t.preventDefault();let a=n[i===-1?t.shiftKey?n.length-1:0:(i+(t.shiftKey?-1:1)+n.length)%n.length];if(!a)throw Error(`tab stop missing`);a.focus()});for(let t of e.querySelectorAll(`[data-wlp-close]`))t.addEventListener(`click`,()=>this.close(`dismiss`));e.querySelector(`[data-wlp-done]`)?.addEventListener(`click`,()=>this.close(`submitted`)),e.querySelector(`[data-wlp-secondary]`)?.addEventListener(`click`,()=>this.close(`secondary`)),N(e.querySelector(`[data-wlp-form]`),HTMLFormElement,`form`).addEventListener(`submit`,e=>this._onSubmit(e))}_showForm(){let e=this._root();N(e.querySelector(`.wlp-form-view`),HTMLElement,`form view`).hidden=!1,N(e.querySelector(`.wlp-success-view`),HTMLElement,`success view`).hidden=!0}_showSuccess(){let e=this._root();N(e.querySelector(`.wlp-form-view`),HTMLElement,`form view`).hidden=!0;let t=N(e.querySelector(`.wlp-success-view`),HTMLElement,`success view`);t.hidden=!1,N(e.querySelector(`[data-wlp-success-title]`),HTMLElement,`success title`).focus()}_setFieldError(e,t){let n=this._root(),r=N(n.querySelector(`[data-wlp-input="${e}"]`),HTMLElement,`${e} field`),i=N(n.querySelector(`#${this._uid}-e-${e}`),HTMLElement,`${e} error`);return i.textContent=t,i.hidden=!t,t?(r.setAttribute(`aria-invalid`,`true`),r.setAttribute(`aria-describedby`,i.id)):(r.removeAttribute(`aria-invalid`),r.removeAttribute(`aria-describedby`)),r}_validate(){let e=new Set(this._requiredKeys()),t=null,n={};for(let r of this._fieldKeys()){let i=this._root().querySelector(`[data-wlp-input="${r}"]`);if(!(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement))throw Error(`${r} field missing`);let a=r===`consent`&&i instanceof HTMLInputElement?i.checked:i.value.trim();n[r]=a;let o=``;!a&&e.has(r)?o=r===`consent`?b:`Enter your ${this._label(r).toLowerCase()}`:r===`email`&&a&&!p.test(String(a))&&(o=`Enter a valid email address`);let s=this._setFieldError(r,o);o&&!t&&(t=s)}return t?(t.focus(),null):n}_setBusy(e){this._posting=e;let t=N(this._root().querySelector(`[data-wlp-form]`),HTMLElement,`form`);e?t.setAttribute(`aria-busy`,`true`):t.removeAttribute(`aria-busy`),N(this._root().querySelector(`[data-wlp-submit]`),HTMLButtonElement,`submit button`).disabled=e}_fail(e,t){this._setBusy(!1);let n=N(this._root().querySelector(`[data-wlp-form-error]`),HTMLElement,`form error`);n.textContent=t,n.hidden=!t,this._emit(`wui-lead-popup-error`,{message:t,reason:e})}async _onSubmit(e){if(e.preventDefault(),this._posting)return;N(this._root().querySelector(`[data-wlp-form-error]`),HTMLElement,`form error`).hidden=!0;let t=this._validate();t&&!this.preview&&await this._post(t)}async _post(e){let n=globalThis.WeborityPublicForms;if(!n){C(`gate`,`[@webority/ui-elements] <wui-lead-popup> needs window.WeborityPublicForms. Load Webority.Security.Razor's public-form.js.`),this._fail(`gate`,this._text(`error-text`,y));return}let r=this._text(`error-text`,y),i=this._text(`public-form`);this._setBusy(!0);let a,o;try{a=await n.session(),o=await n.mintToken(i)}catch(e){this._fail(`gate`,A(e,r));return}let s=this._root(),c=new FormData;for(let t of this._fieldKeys())c.append(this._postedName(t),String(e[t]));c.set(g,a.token),c.set(_,a.formStamp),c.set(v,o),c.set(h,N(s.querySelector(`[data-wlp-honeypot]`),HTMLInputElement,`honeypot`).value),this._emit(`wui-lead-popup-before-submit`,{formData:c});let l;try{l=await fetch(this._text(`action`),{method:`POST`,body:c,credentials:`same-origin`,headers:{"X-Requested-With":`XMLHttpRequest`}})}catch{this._fail(`network`,r);return}let u;try{u=await this._readJson(l)}catch(e){t(`<wui-lead-popup> could not read the response body`,e),this._fail(`server`,r);return}if(l.ok)this._succeed(e,u);else{let e=typeof u==`object`&&u&&`detail`in u&&typeof u.detail==`string`?u.detail.trim():``;this._fail(`server`,e||r)}}async _readJson(e){return e.json()}_succeed(e,t){this._setBusy(!1),this._remember(`submitted`),this._emit(`wui-lead-popup-submitted`,{values:e,response:t}),this._showSuccess();let n=this._number(`success-close-seconds`,5);n>0&&(this._closeTimer=setTimeout(()=>this.close(`submitted`),n*1e3))}_arm(){if(this._armed)return;this._armed=!0;let e=this._triggers();if(!e.length)return;this._session=this._loadSession();let t=location.pathname+location.search;if(this._session.pages.includes(t)||this._session.pages.push(t),this._saveSession(),e.includes(`exit`)&&(document.documentElement.addEventListener(`mouseleave`,this._onMouseLeave),document.addEventListener(`visibilitychange`,this._onVisibility)),e.includes(`delay`)){let e=Math.max(0,this._number(`delay-seconds`,30)*1e3-(Date.now()-this._session.start));this._delayTimer=setTimeout(()=>this.open(`delay`),e)}e.includes(`scroll`)&&(window.addEventListener(`scroll`,this._onScroll,{passive:!0}),this._trackScroll()),e.includes(`pages`)&&this._session.pages.length>this._number(`pages-viewed`,2)&&this.open(`pages`)}_disarm(){this._armed=!1,clearTimeout(this._delayTimer??void 0),clearTimeout(this._closeTimer??void 0),document.documentElement.removeEventListener(`mouseleave`,this._onMouseLeave),document.removeEventListener(`visibilitychange`,this._onVisibility),window.removeEventListener(`scroll`,this._onScroll)}_trackScroll(){let e=document.documentElement.scrollHeight;if(this._session&&e>0){let t=(window.scrollY+window.innerHeight)/e*100;t>this._session.maxScroll&&(this._session.maxScroll=t,this._saveSession()),this._session.maxScroll>this._number(`scroll-percent`,50)&&this.open(`scroll`)}}_fine(){return typeof matchMedia!=`function`||matchMedia(`(pointer: fine)`).matches}_engaged(){let e=this._session;return e?Date.now()-e.start>this._number(`delay-seconds`,30)*1e3||e.maxScroll>this._number(`scroll-percent`,50)||e.pages.length>this._number(`pages-viewed`,2):!1}_sessionKey(){return`wui-lead-popup:${this.getAttribute(`storage-key`)}`}_loadSession(){let e={start:Date.now(),maxScroll:0,pages:[]};try{let e=sessionStorage.getItem(this._sessionKey());if(e){let t=JSON.parse(e);if(Number.isFinite(t.start)&&Number.isFinite(t.maxScroll)&&Array.isArray(t.pages))return t}}catch{return e}return e}_saveSession(){try{sessionStorage.setItem(this._sessionKey(),JSON.stringify(this._session))}catch{}}_readMemory(){let e=this.getAttribute(`storage-key`);if(!e)return null;try{let t=JSON.parse(localStorage.getItem(e)??`null`);if((t?.state===`shown`||t?.state===`submitted`)&&Number.isFinite(Date.parse(t.at)))return t}catch{return null}return null}_blocked(){let e=this._readMemory();if(!e)return!1;let t=e.state===`shown`?this._number(`dismiss-days`,30):this._number(`submitted-days`,365);return Date.now()-Date.parse(e.at)<t*m}_remember(e){let t=this.getAttribute(`storage-key`);if(t&&!this.preview)try{localStorage.setItem(t,JSON.stringify({state:e,at:(/* @__PURE__ */ new Date()).toISOString()}))}catch{}}};export{P as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./elementBase-Cxeyx0tU.js";import{f as t}from"./formatters-C3V6M5zV.js";import{t as n}from"./iconGlyphs.g-DPqoOoXy.js";var r=`a.wui-lightbox-item`,i=1,a=4,o=.5,s=2,c=50,l=6,u=300,d=300;function f(e){return Number.isFinite(e)?Math.min(a,Math.max(i,e)):i}function p(e,t,n,r){let i=(e,n)=>Math.max(0,(e*t-n)/2),a=i(r.width,n.width),o=i(r.height,n.height);return{x:Math.min(a,Math.max(-a,e.x)),y:Math.min(o,Math.max(-o,e.y))}}function m(e,t){return Math.abs(e)<c||Math.abs(e)<Math.abs(t)*1.5?0:e<0?1:-1}function h(e){let t=(String(e??``).split(/[?#]/)[0]??``).split(`/`).filter(Boolean).pop()??``;try{return decodeURIComponent(t)}catch{return t}}function g(e,t,n={}){let r=document.createElement(e);r.className=t;for(let[e,t]of Object.entries(n))r.setAttribute(e,t);return r}function _(e,t,r){let i=g(`button`,`u-action wui-lightbox-btn ${r}`,{type:`button`,"aria-label":t,title:t});return i.style.setProperty(`--wui-action-size`,`40px`),i.innerHTML=n(e,{size:20}),i}var v=class extends e{_ui;_index;_zoom;_pan;_pointers;_gesture;_lastTap;_returnTo;_lockedOverflow;_onClick;static get observedAttributes(){return[`open-index`]}constructor(){super(),this._ui=null,this._index=0,this._zoom=i,this._pan={x:0,y:0},this._pointers=/* @__PURE__ */ new Map,this._gesture=null,this._lastTap=-1/0,this._returnTo=null,this._lockedOverflow=null,this._onClick=e=>{if(e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let t=e.target,n=t instanceof Element?t.closest(r):null;if(!(n instanceof HTMLAnchorElement)||!this.contains(n))return;let i=this._links().indexOf(n);i<0||(e.preventDefault(),this.open(i))}}get _view(){if(!this._ui)throw Error(`<wui-lightbox> viewer is not open.`);return this._ui}get download(){return this.hasAttribute(`download`)}set download(e){this.toggleAttribute(`download`,e===!0||e===``||e===`true`)}get label(){return this.getAttribute(`label`)||`Image viewer`}set label(e){this.setAttribute(`label`,String(e??``))}get layout(){return this.getAttribute(`layout`)===`single`?`single`:`gallery`}set layout(e){if(e===`single`)this.setAttribute(`layout`,`single`);else if(e===`gallery`||e===``)this.removeAttribute(`layout`);else throw Error(`<wui-lightbox> layout must be "gallery" or "single", received "${e}".`)}get isOpen(){return this._ui!==null}connectedCallback(){this.addEventListener(`click`,this._onClick),this._syncOpenIndex()}disconnectedCallback(){this.removeEventListener(`click`,this._onClick),this._teardown()}attributeChangedCallback(){this.isConnected&&this._syncOpenIndex()}_syncOpenIndex(){let e=this.getAttribute(`open-index`);e===null?this.close():this.open(Number(e))}_links(){return[...this.querySelectorAll(r)].filter(e=>e instanceof HTMLAnchorElement)}_items(){return this._links().map(e=>{let t=e.getAttribute(`href`)??``;return{link:e,src:t,alt:e.querySelector(`img`)?.getAttribute(`alt`)??``,caption:e.dataset.caption??``,name:e.dataset.name||h(t)}})}open(e=0){let t=this._items();if(!t.length)return!1;if(!this._ui){let t=document.activeElement;this._returnTo=t instanceof HTMLElement||t instanceof SVGElement?t:null,this._build(),this.dispatchEvent(new CustomEvent(`wui-lightbox:open`,{bubbles:!0,detail:{index:e}}))}return this._show(e,t),this._view.close.focus(),!0}close(){if(!this._ui)return;let e=this._index,t=this._links()[e]??this._returnTo;this._teardown(),t?.isConnected&&t.focus(),this._returnTo=null,this.dispatchEvent(new CustomEvent(`wui-lightbox:close`,{bubbles:!0,detail:{index:e}}))}_teardown(){this._ui&&(this._ui.root.remove(),this._ui=null,this._pointers.clear(),this._gesture=null,this._lockedOverflow!==null&&(document.documentElement.style.overflow=this._lockedOverflow,this._lockedOverflow=null))}_build(){let e=g(`div`,`wui-lightbox-overlay`,{role:`dialog`,"aria-modal":`true`,"aria-label":this.label,tabindex:`-1`}),t=g(`div`,`wui-lightbox-bar`),r=g(`span`,`wui-lightbox-count`,{"aria-live":`polite`}),i=g(`div`,`wui-lightbox-tools`),a=_(`zoom-out`,`Zoom out`,`wui-lightbox-zoom-out`),s=_(`zoom-in`,`Zoom in`,`wui-lightbox-zoom-in`),c=g(`a`,`u-action wui-lightbox-btn wui-lightbox-download`,{"aria-label":`Download`,title:`Download`});c.style.setProperty(`--wui-action-size`,`40px`),c.innerHTML=n(`download`,{size:20}),c.hidden=!this.download;let l=_(`x`,`Close`,`wui-lightbox-close`);i.append(a,s,c,l),t.append(r,i);let u=g(`div`,`wui-lightbox-stage`),d=_(`chevron-left`,`Previous image`,`wui-lightbox-nav wui-lightbox-prev`),f=_(`chevron-right`,`Next image`,`wui-lightbox-nav wui-lightbox-next`),p=g(`img`,`wui-lightbox-image`,{decoding:`async`,draggable:`false`,alt:``}),m=g(`p`,`wui-lightbox-status`,{role:`status`});u.append(p,m,d,f);let h=g(`p`,`wui-lightbox-caption`);e.append(t,u,h);let v={root:e,count:r,zoomOut:a,zoomIn:s,download:c,close:l,stage:u,prev:d,next:f,image:p,status:m,caption:h};this._ui=v,l.addEventListener(`click`,()=>this.close()),d.addEventListener(`click`,()=>this.step(-1)),f.addEventListener(`click`,()=>this.step(1)),a.addEventListener(`click`,()=>this._setZoom(this._zoom-o)),s.addEventListener(`click`,()=>this._setZoom(this._zoom+o)),e.addEventListener(`keydown`,e=>this._onKeyDown(e)),u.addEventListener(`pointerdown`,e=>this._onPointerDown(e)),u.addEventListener(`pointermove`,e=>this._onPointerMove(e)),u.addEventListener(`pointerup`,e=>this._onPointerEnd(e,!0)),u.addEventListener(`pointercancel`,e=>this._onPointerEnd(e,!1)),u.addEventListener(`wheel`,e=>this._onWheel(e),{passive:!1}),p.addEventListener(`load`,()=>{this._ui===v&&(m.textContent=``,u.removeAttribute(`aria-busy`),p.hidden=!1,this._applyTransform())}),p.addEventListener(`error`,()=>{this._ui===v&&(u.removeAttribute(`aria-busy`),p.hidden=!0,m.textContent=`This image can't be shown.`)}),this.append(e),this._lockedOverflow=document.documentElement.style.overflow,document.documentElement.style.overflow=`hidden`}step(e){if(!this._ui||!e)return;let t=this._items();t.length<2||this._show((this._index+e+t.length)%t.length,t)}_show(e,n){let r=this._view,a=Math.min(n.length-1,Math.max(0,Math.trunc(Number(e))||0)),o=n[a];if(!o)throw Error(`<wui-lightbox> image missing.`);let s=a!==this._index||!r.image.getAttribute(`src`);if(this._index=a,this._zoom=i,this._pan={x:0,y:0},r.count.textContent=`${t(a+1,{decimals:0})} of ${t(n.length,{decimals:0})}`,r.caption.textContent=o.caption,r.caption.hidden=!o.caption,r.download.href=o.src,r.download.setAttribute(`download`,o.name),r.prev.hidden=r.next.hidden=n.length<2,r.stage.setAttribute(`aria-busy`,`true`),r.status.textContent=``,r.image.hidden=!1,r.image.alt=o.alt||o.caption,r.image.src=o.src,this._applyTransform(),this._syncZoomButtons(),n.length>1){let e=n[(a+1)%n.length],t=n[(a-1+n.length)%n.length];if(!e||!t)throw Error(`<wui-lightbox> neighbour image missing.`);for(let n of[e,t])new Image().src=n.src}s&&this.dispatchEvent(new CustomEvent(`wui-lightbox:change`,{bubbles:!0,detail:{index:a}}))}_syncZoomButtons(){let e=this._view;e.zoomOut.disabled=this._zoom<=i,e.zoomIn.disabled=this._zoom>=a;let t=document.activeElement;(t===e.zoomOut||t===e.zoomIn)&&t instanceof HTMLButtonElement&&t.disabled&&e.close.focus()}_setZoom(e){this._ui&&(this._zoom=f(e),this._pan=this._clampedPan(this._pan),this._applyTransform(),this._syncZoomButtons())}_clampedPan(e){let{stage:t,image:n}=this._view;return p(e,this._zoom,{width:t.clientWidth,height:t.clientHeight},{width:n.offsetWidth,height:n.offsetHeight})}_applyTransform(){let{image:e,stage:t}=this._view;e.style.transform=`translate(${this._pan.x}px, ${this._pan.y}px) scale(${this._zoom})`,t.classList.toggle(`wui-lightbox-zoomed`,this._zoom>i)}_onKeyDown(e){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this.close();else if(e.key===`Tab`)this._trapTab(e);else if(e.key===`ArrowLeft`||e.key===`ArrowRight`)e.preventDefault(),this.step(e.key===`ArrowRight`?1:-1);else if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=this._items();this._show(e.key===`Home`?0:t.length-1,t)}else e.key===`+`||e.key===`=`?(e.preventDefault(),this._setZoom(this._zoom+o)):e.key===`-`?(e.preventDefault(),this._setZoom(this._zoom-o)):e.key===`0`&&(e.preventDefault(),this._setZoom(i))}_trapTab(e){let t=this._view.root,n=[...t.querySelectorAll(`button, a[href]`)].filter(e=>e instanceof HTMLElement&&!e.hidden&&!(e instanceof HTMLButtonElement&&e.disabled));if(!n.length){e.preventDefault();return}let r=n[0],i=n[n.length-1];if(!r||!i)throw Error(`<wui-lightbox> focus stops missing.`);let a=document.activeElement;e.shiftKey&&(a===r||!t.contains(a))?(e.preventDefault(),i.focus()):e.shiftKey||a!==i&&t.contains(a)||(e.preventDefault(),r.focus())}_onWheel(e){e.preventDefault(),this._setZoom(this._zoom*(e.deltaY<0?1.15:1/1.15))}_onPointerDown(e){let t=e.target;if(t instanceof Element&&t.closest(`.wui-lightbox-nav`))return;let n=this._view;if(n.stage.setPointerCapture?.(e.pointerId),this._pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),this._pointers.size===2){let e=[...this._pointers.values()],t=e[0],n=e[1];if(!t||!n)throw Error(`<wui-lightbox> pinch needs two pointers.`);this._gesture={kind:`pinch`,distance:Math.hypot(t.x-n.x,t.y-n.y)||1,zoom:this._zoom}}else this._pointers.size===1&&(this._gesture={kind:`drag`,startX:e.clientX,startY:e.clientY,startTime:e.timeStamp,pan:{...this._pan},onImage:e.target===n.image,moved:!1})}_onPointerMove(e){let t=this._gesture;if(t&&this._pointers.has(e.pointerId)){if(this._pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),t.kind===`pinch`&&this._pointers.size===2){let e=[...this._pointers.values()],n=e[0],r=e[1];if(!n||!r)throw Error(`<wui-lightbox> pinch needs two pointers.`);this._setZoom(t.zoom*Math.hypot(n.x-r.x,n.y-r.y)/t.distance)}else if(t.kind===`drag`){let n=e.clientX-t.startX,r=e.clientY-t.startY;Math.hypot(n,r)>l&&(t.moved=!0),this._zoom>i&&(this._pan=this._clampedPan({x:t.pan.x+n,y:t.pan.y+r}),this._view.stage.classList.add(`is-dragging`),this._applyTransform())}}}_onPointerEnd(e,t){let n=this._gesture;if(this._pointers.delete(e.pointerId),this._ui?.stage.classList.remove(`is-dragging`),!n)return;if(n.kind===`pinch`){this._pointers.size<2&&(this._gesture=null);return}if(this._gesture=null,!t)return;let r=e.clientX-n.startX,a=e.clientY-n.startY;n.moved?this._zoom===i&&this.step(m(r,a)):e.timeStamp-n.startTime>u||(n.onImage?e.timeStamp-this._lastTap<d?(this._lastTap=-1/0,this._setZoom(this._zoom>i?i:s)):this._lastTap=e.timeStamp:this.close())}};export{v as t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{t as e}from"./elementBase-Cxeyx0tU.js";var t=/\[([^[\]\n]+)\](?!\()/g,n=/* @__PURE__ */ new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`),r=/\[([^\]\n]+)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,i=/!\[([^\]\n]*)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,a=new RegExp(t.source,`y`),o=e=>/[\p{L}\p{N}]/u.test(e);function s(e,t){let n=0;for(let r=t-1;r>=0&&e.charAt(r)===`\\`;--r)n+=1;return n%2==1}function c(e,t,n){let r=n.length===1;for(let i=e.indexOf(n,t);i!==-1;i=e.indexOf(n,i+1)){let a=i>t&&!/\s/.test(e.charAt(t))&&!/\s/.test(e.charAt(i-1)),c=r&&(e.charAt(i+1)===n||e.charAt(i-1)===n),l=n===`_`&&o(e.charAt(i+n.length));if(a&&!c&&!l&&!s(e,i))return i}return-1}function l(e,t){let s=t?.isCitation,u=[],d=``,f=()=>{d&&=(u.push({type:`text`,text:d}),``)},p=0;for(;p<e.length;){let m=e.charAt(p),h=e.charAt(p+1);if(m===`\\`&&n.has(h)){d+=h,p+=2;continue}if(m==="`"){let t=e.indexOf("`",p+1);if(t>p+1){f(),u.push({type:`code`,text:e.slice(p+1,t)}),p=t+1;continue}}let g=m+h;if(g===`**`||g===`__`||g===`~~`){let n=c(e,p+2,g);if(n!==-1&&!(g===`__`&&o(e.charAt(p-1)))){f();let r=l(e.slice(p+2,n),t);g===`~~`?u.push({type:`strike`,children:r}):u.push({type:`strong`,children:r}),p=n+2;continue}d+=g,p+=2}else{if(m===`*`||m===`_`){let n=c(e,p+1,m);if(n!==-1&&!(m===`_`&&o(e.charAt(p-1)))){f(),u.push({type:`em`,children:l(e.slice(p+1,n),t)}),p=n+1;continue}}if(m===`[`){r.lastIndex=p;let t=r.exec(e);if(t){let e=t[1],n=t[2];if(e===void 0||n===void 0)throw Error(`The link pattern always captures its label and href`);f(),u.push({type:`link`,href:n,children:l(e)}),p+=t[0].length;continue}if(s){a.lastIndex=p;let t=a.exec(e);if(t){let e=t[1];if(e===void 0)throw Error(`The citation pattern always captures its inner text`);if(s(e)){f(),u.push({type:`citation`,text:e}),p+=t[0].length;continue}}}}if(m===`!`){i.lastIndex=p;let t=i.exec(e);if(t){let e=t[1];if(e===void 0)throw Error(`The image pattern always captures its alt text`);f(),u.push({type:`image`,children:l(e)}),p+=t[0].length;continue}}d+=m,p+=1}}return f(),u.map((e,t)=>({...e,key:t}))}var u=/^[a-z][a-z0-9+.-]*:[a-z0-9_-]+\/[a-z0-9_.~-]+$/i,d=/^https?:/i,f=/^(mailto|tel):/i,p=/^(?:\/(?![/\\])|#|\?|\.{1,2}\/)/,m=/^https:\/\/[^/?#@\\\s]+$/i,h=/^[a-z][a-z0-9+.-]*:/i;function g(e){if(typeof e!=`string`)return null;let t=e.endsWith(`/`)?e.slice(0,-1):e;return m.test(t)?t:null}function ee(e,t,n,r,i){if(n&&(t===`page`||u.test(e))){let t=n(e);if(t!=null)return{kind:`app`,target:t}}if(t===`app`)return null;let a=i==null?null:g(i),o=a===null?e:_(e,a);return o===null?null:p.test(o)?{kind:`page`,href:o}:t===`page`&&!(d.test(o)&&r&&y(o,r))?null:d.test(o)?{kind:r&&y(o,r)?`page`:`web`,href:o}:f.test(o)?{kind:`contact`,href:o}:null}function _(e,t){if(h.test(e))return e;if(e.startsWith(`//`))return`https:${e}`;if(e===``)return null;let n=e.indexOf(`#`),r=n<0?``:e.slice(n),i=n<0?e:e.slice(0,n),a=i.indexOf(`?`),o=a<0?i:i.slice(0,a),s=a<0?``:i.slice(a);return o===``?`${t}${s}${r}`:`${t}${v(o.startsWith(`/`)?o:`/${o}`)}${s}${r}`}function v(e){let t=e.split(`/`),n=[];return t.forEach((e,r)=>{let i=r===t.length-1;e===`.`?i&&n.push(``):e===`..`?(n.length>1&&n.pop(),i&&n.push(``)):n.push(e)}),n.join(`/`)}function y(e,t){if(e.slice(0,t.length).toLowerCase()!==t.toLowerCase())return!1;let n=e[t.length];return n===void 0||n===`/`||n===`?`||n===`#`}function b(e){return typeof e!=`string`||!e.startsWith(`/`)||e[1]===`/`||e[1]===`\\`?null:e}var x=/^\s*```/,S=/^\s*```\s*(\S*)/,C=/^\s{0,3}(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/,w=/^\s*([-*_])(\s*\1){2,}\s*$/,T=/^(\s*)[-*+]\s+(.*)$/,E=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,D=/^\s*>\s?(.*)$/,O=/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)*\|?\s*$/,k=[1,2,3,4,5,6],A=e=>e.includes(`|`);function j(e){let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())}function M(e,t){let n=e[t];if(n===void 0)throw Error(`startsTable was called past the last source line`);let r=e[t+1];return r!==void 0&&A(n)&&r.includes(`|`)&&O.test(r)}function N(e,t){let n=e[t];if(n===void 0)throw Error(`startsBlock was called past the last source line`);return x.test(n)||D.test(n)||T.test(n)||E.test(n)||C.test(n)||w.test(n)||M(e,t)}function P(e){let t=e.replace(/\t/g,` `).length;return Math.min(Math.floor(t/2),4)}function F(e){let t=E.exec(e);if(t){let e=t[1],n=t[2],r=t[3];if(e===void 0||n===void 0||r===void 0)throw Error(`The ordered list pattern always captures its indent, number and text`);return{text:r,depth:P(e),ordered:!0,number:Number(n)}}let n=T.exec(e);if(n){let e=n[1],t=n[2];if(e===void 0||t===void 0)throw Error(`The bullet list pattern always captures its indent and text`);return{text:t,depth:P(e),ordered:!1,number:0}}return null}function I(e){let t=(e??``).replace(/\r\n?/g,`
|
|
2
|
+
`).split(`
|
|
3
|
+
`),n=[],r=0;for(;r<t.length;){let e=t[r];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(!e.trim()){r+=1;continue}if(x.test(e)){let i=S.exec(e)?.[1]||null,a=[];for(r+=1;r<t.length;){let e=t[r];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(x.test(e))break;a.push(e),r+=1}r+=1,n.push({type:`code`,text:a.join(`
|
|
4
|
+
`),language:i});continue}if(M(t,r)){let i=j(e),a=[];for(r+=2;r<t.length;){let e=t[r];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(!e.trim()||!A(e))break;a.push(j(e)),r+=1}n.push({type:`table`,header:i,rows:a});continue}if(w.test(e)){n.push({type:`rule`}),r+=1;continue}let i=C.exec(e);if(i){let e=i[1],t=i[2];if(e===void 0||t===void 0)throw Error(`The heading pattern always captures its hashes and text`);let a=k[e.length-1];if(a===void 0)throw Error(`The heading pattern always captures one to six hashes`);n.push({type:`heading`,level:a,text:t}),r+=1;continue}if(D.test(e)){let e=[];for(;r<t.length;){let n=t[r];if(n===void 0)throw Error(`parseMarkdown read past the last source line`);let i=D.exec(n);if(!i)break;let a=i[1];if(a===void 0)throw Error(`The quote pattern always captures its text`);e.push(a),r+=1}n.push({type:`quote`,lines:e});continue}let a=F(e);if(a){let e=[];for(;r<t.length;){let n=t[r];if(n===void 0)throw Error(`parseMarkdown read past the last source line`);if(!n.trim())break;let i=F(n);if(i){if(i.depth===0&&i.ordered!==a.ordered)break;e.push(i)}else if(N(t,r))break;else{let t=e[e.length-1];if(t===void 0)throw Error(`A list continuation line follows a list with no item`);t.text+=` ${n.trim()}`}r+=1}n.push({type:`list`,ordered:a.ordered,start:a.ordered?a.number:1,items:e});continue}let o=[e];for(r+=1;r<t.length;){let e=t[r];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(!e.trim()||N(t,r))break;o.push(e),r+=1}n.push({type:`paragraph`,lines:o})}return n.map((e,t)=>({...e,key:t}))}var L=[`text`,`json`,`js`,`cs`,`sql`,`bash`,`http`,`html`,`css`],R=[`app`,`web`,`page`],z=e=>e!==void 0&&R.includes(e);function B(e,t,n,r,i=null){let a=V(e.ownerDocument,n,r).map((e,n)=>{let r=t[n],i=r?.sig===e.sig?r.nodes:null;return{sig:e.sig,nodes:i??e.build()}}),o=new Set(a.flatMap(e=>e.nodes));for(let e of t)for(let t of e.nodes)o.has(t)||t.parentNode?.removeChild(t);let s=i;for(let t of a.flatMap(e=>e.nodes))(t.parentNode!==e||t.previousSibling!==s)&&e.insertBefore(t,s?s.nextSibling:e.firstChild),s=t;return a}function V(e,t,n){let r={doc:e,links:z(n.links)?n.links:`web`,headings:n.headings===`text`?`text`:`outline`,resolveLink:n.resolveLink,isCitation:n.isCitation,figureText:typeof n.figureText==`function`?n.figureText:void 0,base:typeof n.base==`string`?n.base:void 0},i=n.resolverGeneration??0;return I(t).map(e=>({sig:`${JSON.stringify(e)}|${r.links}|${r.headings}|${r.base??``}|${i}`,build:()=>W(r,e)}))}var H=class extends e{_drawn;_blocks;_observer;_connected;_resolveLink;_isCitation;_resolverGeneration;_figureText;static get observedAttributes(){return[`links`,`headings`,`base`]}constructor(){super(),this._drawn=[],this._blocks=[],this._observer=null,this._connected=!1,this._resolveLink=void 0,this._isCitation=void 0,this._resolverGeneration=0,this._figureText=void 0}connectedCallback(){this._connected=!0,this._render(),typeof MutationObserver<`u`&&(this._observer=new MutationObserver(e=>{e.some(e=>!this._drawn.some(t=>t.contains(e.target)))&&this._render()}),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0}))}disconnectedCallback(){this._connected=!1,this._observer?.disconnect(),this._observer=null}get resolveLink(){return this._resolveLink}set resolveLink(e){this._resolveLink=typeof e==`function`?e:void 0,this._resolverGeneration+=1,this._connected&&this._render()}get base(){return this.getAttribute(`base`)??void 0}set base(e){e==null?this.removeAttribute(`base`):this.setAttribute(`base`,String(e))}get isCitation(){return this._isCitation}set isCitation(e){this._isCitation=typeof e==`function`?e:void 0,this._resolverGeneration+=1,this._connected&&this._render()}get figureText(){return this._figureText}set figureText(e){this._figureText=typeof e==`function`?e:void 0,this._resolverGeneration+=1,this._connected&&this._render()}attributeChangedCallback(e,t,n){t!==n&&this._connected&&this._render()}_source(){return Array.from(this.children).find(e=>e instanceof HTMLPreElement&&e.classList.contains(`wui-markdown-source`))}_render(){let e=this._source();e&&(this._blocks=B(this,this._blocks,e.textContent??``,{links:this.getAttribute(`links`)??void 0,headings:this.getAttribute(`headings`)??void 0,base:this.getAttribute(`base`)??void 0,resolveLink:this._resolveLink,isCitation:this._isCitation,figureText:this._figureText,resolverGeneration:this._resolverGeneration},e),this._drawn=this._blocks.flatMap(e=>e.nodes),e.hidden=!0,this._observer?.takeRecords())}};function U(e,t,n=[]){let r=e.createElement(t);return r.append(...n),r}function W(e,t){switch(t.type){case`paragraph`:return[U(e.doc,`p`,G(e,t.lines))];case`heading`:return[K(e,t)];case`list`:return q(e,t.items);case`table`:return[Y(e,t)];case`code`:return[X(e.doc,t)];case`quote`:return[U(e.doc,`blockquote`,G(e,t.lines))];case`rule`:return[e.doc.createElement(`hr`)];default:return[]}}function G(e,t){let n=[];return t.forEach((t,r)=>{r>0&&n.push(e.doc.createElement(`br`)),n.push(...Z(e,t))}),n}function K(e,t){let n=Z(e,t.text);if(e.headings===`text`){let t=U(e.doc,`p`,n);return t.className=`fw-semibold`,t}return U(e.doc,`h2`,n)}function q(e,t){let n=[];for(let r=0;r<t.length;){let i=J(e,t,r);n.push(i.list),r=i.next}return n}function J(e,t,n){let r=t[n];if(!r)throw Error(`List run starts past its items.`);let{depth:i,ordered:a,number:o}=r,s=e.doc.createElement(a?`ol`:`ul`);a&&o!==1&&s.setAttribute(`start`,String(o));let c=null,l=n,u=t[l];for(;u&&u.depth>=i;){if(u.depth===i)c=U(e.doc,`li`,Z(e,u.text)),s.append(c),l+=1;else{let n=J(e,t,l);if(!c)throw Error(`Nested list has no item before it.`);c.append(n.list),l=n.next}u=t[l]}return{list:s,next:l}}function Y(e,t){let n=t.header.map(t=>{let n=U(e.doc,`th`,Z(e,t));return n.setAttribute(`scope`,`col`),n}),r=t.rows.map(n=>U(e.doc,`tr`,t.header.map((t,r)=>U(e.doc,`td`,Z(e,n[r]??``))))),i=U(e.doc,`table`,[U(e.doc,`thead`,[U(e.doc,`tr`,n)]),U(e.doc,`tbody`,r)]);i.className=`table`;let a=U(e.doc,`div`,[i]);return a.className=`table-responsive`,a}function X(e,t){let n=U(e,`pre`,[U(e,`code`,[e.createTextNode(t.text)])]);n.className=`wui-code-source`;let r=U(e,`wui-code-block`,[n]);return r.className=`wui-code-block`,r.setAttribute(`language`,t.language!==null&&L.includes(t.language)?t.language:`text`),r}function Z(e,t){return Q(e,l(t,{isCitation:e.isCitation}))}function Q(e,t){return t.flatMap(t=>te(e,t))}function te(e,t){let{doc:n}=e;switch(t.type){case`code`:return[U(n,`code`,[n.createTextNode(t.text)])];case`strong`:return[U(n,`strong`,Q(e,t.children))];case`em`:return[U(n,`em`,Q(e,t.children))];case`strike`:return[U(n,`del`,Q(e,t.children))];case`image`:return[n.createTextNode(`[`),...Q(e,t.children),n.createTextNode(`]`)];case`link`:return ne(e,t);case`citation`:return[ie(n,t.text)];case`text`:return e.figureText?re(e,e.figureText,t.text):[n.createTextNode(t.text)];default:{let e=Reflect.get(t,`text`);return[n.createTextNode(String(e))]}}}function ne(e,t){let n=Q(e,t.children),r=ee(t.href,e.links,e.resolveLink,globalThis.location?.origin,e.base);if(!r)return n;if(r.kind===`app`){let t=b(r.target);return t?[$(e.doc,t,n,!1)]:n}return[$(e.doc,r.href,n,r.kind===`web`)]}function re(e,t,n){return t(n).map(t=>t.kind===`sub`||t.kind===`sup`?U(e.doc,t.kind,[e.doc.createTextNode(t.text)]):e.doc.createTextNode(t.text))}function ie(e,t){let n=e.createElement(`span`);n.className=`chip primary chip-outline chip-sm chip-clickable wui-markdown-citation`,n.setAttribute(`data-wui`,`AppChip`);let r=e.createElement(`button`);r.type=`button`,r.className=`chip-body`,r.setAttribute(`aria-label`,t),r.addEventListener(`click`,()=>{r.dispatchEvent(new CustomEvent(`wui-markdown-citation`,{bubbles:!0,detail:{citation:t}}))});let i=e.createElement(`span`);return i.className=`chip-label`,i.textContent=t,r.append(i),n.append(r),n}function $(e,t,n,r){let i=U(e,`span`,n);i.className=`wui-link__label`;let a=U(e,`a`,[i]);return a.className=`wui-link wui-link--static`,a.setAttribute(`data-wui`,`AppLink`),a.setAttribute(`href`,t),r&&(a.setAttribute(`target`,`_blank`),a.setAttribute(`rel`,`noopener noreferrer`)),a}export{H as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./anchorOverlay-CXnWfezA.js";import{t as r}from"./elementBase-Cxeyx0tU.js";import{n as i,r as a,t as o}from"./fieldState-D-zQcXUS.js";import{f as s}from"./formatters-C3V6M5zV.js";import{n as c}from"./listboxKeyNav-4LeEjKq6.js";import{i as l,n as u,r as d,t as f}from"./mentionText-BJsw_opZ.js";import{l as p}from"./wuiHttp-523iN_RF.js";var m=8,h=40,g=Object.freeze({listName:`People`,searching:`Searching…`,noMatch:`No one matches`,searchFailed:`Couldn't load people. Keep typing to try again.`,found:e=>`${e===1?`1 person`:`${s(e,{decimals:0})} people`}. Up and down to choose, Enter to mention.`,mentioned:e=>`Mentioned ${e}.`}),_=`[data-wui-control]`,v=`[data-wui-field]`,y=`[data-wui-menu]`,b=`[data-wui-live]`,x=0,S=e=>!!(e&&f.test(String(e.value??``))&&u(e.label)!==``);function C(e,t){let n=e.getAttribute(`size`);t.classList.toggle(`input-sm`,n===`sm`),t.classList.toggle(`input-lg`,n===`lg`)}function w(e,t){t.readOnly=i(e)||e.hasAttribute(`loading`)}function T(e){let t=e.ownerDocument;e.id||=`wui-mention-${++x}`;let n=t.createElement(`textarea`);n.id=`${e.id}-text`,n.className=`form-control textarea wui-mention-input-text`,n.rows=Number(e.getAttribute(`rows`))>0?Number(e.getAttribute(`rows`)):3,n.setAttribute(`data-wui-control`,``),n.setAttribute(`aria-autocomplete`,`list`),n.setAttribute(`aria-controls`,`${e.id}-people`);let r=e.getAttribute(`label`);r&&n.setAttribute(`aria-label`,r);let i=e.getAttribute(`placeholder`);i&&(n.placeholder=i);for(let t of[`aria-describedby`,`aria-invalid`]){let r=e.getAttribute(t);r&&n.setAttribute(t,r)}n.disabled=e.hasAttribute(`disabled`),w(e,n),C(e,n),e.appendChild(n);let a=e.getAttribute(`name`);if(a){let n=t.createElement(`input`);n.type=`hidden`,n.name=a,n.value=e.getAttribute(`value`)??``,n.setAttribute(`data-wui-field`,``),e.appendChild(n)}let o=t.createElement(`div`);o.className=`wui-mention-menu`,o.id=`${e.id}-people`,o.setAttribute(`role`,`listbox`),o.setAttribute(`aria-label`,e.getAttribute(`people-label`)??g.listName),o.setAttribute(`data-wui-menu`,``),o.hidden=!0,e.appendChild(o);let s=t.createElement(`span`);s.className=`visually-hidden`,s.setAttribute(`data-wui-live`,``),s.setAttribute(`aria-live`,`polite`),s.setAttribute(`aria-atomic`,`true`),e.appendChild(s)}var E=class extends r{_wired;_pendingValue;_text;_mentions;_peopleProp;_declared;_loading;_searchFailed;_query;_results;_active;_timer;_searchSeq;_lastSearch;_abort;_onMenuDown;_reposition;_reanchor;_reanchorScroll;static get observedAttributes(){return[`disabled`,`readonly`,`loading`,`size`,`aria-invalid`,`aria-describedby`]}constructor(){super(),this._wired=!1,this._text=``,this._mentions=[],this._peopleProp=null,this._declared=null,this._loading=!1,this._searchFailed=!1,this._query=null,this._results=[],this._active=-1,this._timer=void 0,this._searchSeq=0,this._abort=null,this._onInput=this._onInput.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onCaret=this._onCaret.bind(this),this._onFocusOut=this._onFocusOut.bind(this),this._onMenuDown=e=>e.preventDefault(),this._onMenuClick=this._onMenuClick.bind(this),this._reposition=()=>{this._isOpen()&&this._position()}}connectedCallback(){for(let e of[`people`,`loading`,`searchFailed`,`value`])if(Object.hasOwn(this,e)){let t=Reflect.get(this,e);Reflect.deleteProperty(this,e),Reflect.set(this,e,t)}if(this._wired)return;this._wired=!0,this.querySelector(_)||T(this);let e=this._requireControl(),t=this.querySelector(v)?.value??this.getAttribute(`value`)??``;this._pendingValue===void 0?this._load(t):this._load(this._pendingValue),this._pendingValue=void 0,this._syncState(),e.addEventListener(`input`,this._onInput),e.addEventListener(`keydown`,this._onKeyDown),e.addEventListener(`click`,this._onCaret),e.addEventListener(`keyup`,this._onCaret),this.addEventListener(`focusout`,this._onFocusOut);let n=this._requireMenu();n.addEventListener(`mousedown`,this._onMenuDown),n.addEventListener(`click`,this._onMenuClick),n.addEventListener(`mousemove`,e=>{let t=e.target instanceof Element?e.target.closest(`.wui-mention-option`):null;t&&Number(t.dataset.index)!==this._active&&this._setActive(Number(t.dataset.index),{reveal:!1})})}disconnectedCallback(){this._close(),clearTimeout(this._timer),this._abort?.abort()}attributeChangedCallback(e,t,n){let r=this._control();r&&(e===`disabled`?(r.disabled=n!==null,n!==null&&this._close()):e===`readonly`?(w(this,r),n!==null&&this._close(),this._syncState()):e===`loading`?(w(this,r),this._syncState(),this._query!==null&&this._renderMenu()):e===`size`?C(this,r):n===null?r.removeAttribute(e):r.setAttribute(e,n))}get value(){return l(this._text,this._mentions)}set value(e){let t=e==null?``:String(e);this._wired?t!==this.value&&this._load(t):this._pendingValue=t}get mentions(){let e=/* @__PURE__ */ new Set,t=[];for(let n of[...this._mentions].sort((e,t)=>e.start-t.start))e.has(n.id)||(e.add(n.id),t.push({id:n.id,label:n.label}));return t}get people(){return this._peopleProp?this._peopleProp:(this._declared||=[...this.querySelectorAll(`[data-wui-people] > wui-option`)].map(e=>({value:e.getAttribute(`value`)??``,label:(e.textContent??``).trim(),description:e.getAttribute(`data-description`)||void 0,src:e.getAttribute(`data-src`)||void 0})),this._declared)}set people(e){this._peopleProp=Array.isArray(e)?e.filter(S):[],this._searchFailed=!1,(this._isOpen()||this._query!==null)&&this._refresh()}get searchFailed(){return this._searchFailed}set searchFailed(e){this._searchFailed=!!e,this._query!==null&&this._renderMenu()}get loading(){return this._loading||this.hasAttribute(`loading`)}set loading(e){this._loading=!!e,this.toggleAttribute(`loading`,this._loading),this._query!==null&&this._renderMenu()}focus(e){this._control()?.focus(e)}clear(){this._load(``),this._emit()}_control(){return this.querySelector(_)}_menu(){return this.querySelector(y)}_requireControl(){let e=this._control();if(!e)throw Error(`<wui-mention-input> has no text box.`);return e}_requireMenu(){let e=this._menu();if(!e)throw Error(`<wui-mention-input> has no people list.`);return e}_load(e){let{text:t,mentions:n}=d(e);this._text=t,this._mentions=n;let r=this._control();r&&(r.defaultValue=t,r.value=t),this._syncField(),this._close()}_syncField(){let e=this.querySelector(v);e&&(e.value=this.value)}_emit(){this._syncField(),this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,detail:{value:this.value,mentions:this.mentions}}))}_onInput(){let e=this._requireControl(),t=e.value,n=this._text,r=t.length-n.length,i=Math.min(n.length,t.length),a=Math.max(0,Math.min(i,e.selectionEnd-Math.max(r,0))),o=0;for(;o<a&&n[o]===t[o];)o++;let s=0;for(;s<i-o&&n[n.length-1-s]===t[t.length-1-s];)s++;let c=n.length-s;this._mentions=this._mentions.filter(e=>e.end<=o||e.start>=c).map(e=>e.start>=c?{...e,start:e.start+r,end:e.end+r}:e),this._text=t,this._emit(),this._onCaret()}_onCaret(e){if(e instanceof KeyboardEvent&&e.type===`keyup`&&[`ArrowUp`,`ArrowDown`,`Enter`,`Tab`,`Escape`].includes(e.key))return;let t=this._queryAtCaret();t?this._query&&t.text===this._query.text&&t.start===this._query.start||(this._query=t,this._refresh()):this._close()}_queryAtCaret(){let e=this._control();if(!e||o(this)||e.selectionStart!==e.selectionEnd)return null;let t=e.selectionStart,n=this._text,r=n.lastIndexOf(`@`,t-1);if(r<0||r>0&&!/[\s([{"'“‘]/.test(n.charAt(r-1)))return null;let i=n.slice(r+1,t);return i.length>40||/[\n@]/.test(i)||/^\s/.test(i)||/\s{2}/.test(i)||this._mentions.some(e=>r>=e.start&&r<e.end)?null:{start:r,end:t,text:i}}_refresh(){if(!this._query)return;let e=this.hasAttribute(`remote`)||this.hasAttribute(`source`);if(e&&this._query.text.length<this._minChars()){this._results=[],this._close();return}e&&!this._answered(this._query.text)&&this._search(this._query.text);let t=this._query.text.toLowerCase(),n=e?this.people:this.people.filter(e=>u(e.label).toLowerCase().includes(t));this._results=n.slice(0,8),this._renderMenu()}_answered(e){return this._lastSearch===e}_minChars(){let e=this.getAttribute(`min-chars`),t=e==null||e===``?1:Number(e);return Number.isFinite(t)&&t>=0?t:1}_debounce(){let e=this.getAttribute(`debounce`),t=e==null||e===``?250:Number(e);return Number.isFinite(t)&&t>=0?t:250}_search(e){this._lastSearch=e,clearTimeout(this._timer);let t=++this._searchSeq;this._timer=setTimeout(()=>{let n=this.getAttribute(`source`);n?this._fetchPeople(n,e,t):this.dispatchEvent(new CustomEvent(`search`,{bubbles:!0,detail:{query:e,seq:t}}))},this._debounce())}async _fetchPeople(e,t,n){this._abort?.abort();let r=new AbortController;this._abort=r,this.loading=!0;let i=`${e}${e.includes(`?`)?`&`:`?`}q=${encodeURIComponent(t)}`,a=await p(i,{signal:r.signal});if(n!==this._searchSeq)return;if(this._abort=null,!a.ok){this._peopleProp=[],this._searchFailed=!0,this.loading=!1,this._refresh();return}this._searchFailed=!1;let o=this.ownerDocument.createElement(`template`);o.innerHTML=a.html,this._peopleProp=[...o.content.querySelectorAll(`wui-option`)].map(e=>({value:e.getAttribute(`value`)??``,label:(e.textContent??``).trim(),description:e.getAttribute(`data-description`)||void 0,src:e.getAttribute(`data-src`)||void 0})).filter(S),this.loading=!1,this._refresh()}_isOpen(){let e=this._menu();return!(!e||e.hidden)}_renderMenu(){let t=this._menu(),n=this._control();if(!t||!n||!this._query)return;this._syncState();let r=this.ownerDocument;if(t.replaceChildren(),this._results.forEach((e,n)=>{let i=r.createElement(`div`);if(i.className=`wui-mention-option`,i.id=`${t.id}-${n}`,i.setAttribute(`role`,`option`),i.setAttribute(`aria-selected`,`false`),i.dataset.index=String(n),e.src){let t=r.createElement(`img`);t.className=`wui-mention-option-photo`,t.src=e.src,t.alt=``,i.appendChild(t)}let a=r.createElement(`span`);a.className=`wui-mention-option-text`;let o=r.createElement(`span`);if(o.className=`wui-mention-option-label`,o.textContent=u(e.label),a.appendChild(o),e.description){let t=r.createElement(`span`);t.className=`wui-mention-option-description`,t.textContent=String(e.description),a.appendChild(t)}i.appendChild(a),t.appendChild(i)}),!this._results.length){let e=r.createElement(`div`);e.className=`wui-mention-empty`,e.textContent=this.loading?g.searching:this._searchFailed?g.searchFailed:`${g.noMatch} “${this._query.text}”`,t.appendChild(e)}let i=this._isOpen();t.hidden=!1,i||e(this,this._reposition),this._position(),this._setActive(this._results.length?0:-1),this.loading||this._announce(this._results.length?g.found(this._results.length):this._searchFailed?g.searchFailed:`${g.noMatch}.`)}_syncState(){let e=this._control();e&&a(this,e)}_position(){n(this._control(),this._menu())}_close(){this._query=null,this._lastSearch=void 0,clearTimeout(this._timer);let e=this._menu();e&&!e.hidden&&(e.hidden=!0,e.replaceChildren()),this._active=-1,this._control()?.removeAttribute(`aria-activedescendant`),t(this)}_setActive(e,{reveal:t=!0}={}){let n=this._requireMenu(),r=[...n.querySelectorAll(`.wui-mention-option`)];this._active=e>=0&&e<r.length?e:-1;let i=this._active>=0?r[this._active]??null:null;for(let e of r)e.setAttribute(`aria-selected`,e===i?`true`:`false`);c(n,i),i?(t&&i.scrollIntoView?.({block:`nearest`}),this._requireControl().setAttribute(`aria-activedescendant`,i.id)):this._requireControl().removeAttribute(`aria-activedescendant`)}_onKeyDown(e){if(this._isOpen()&&this._query){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=this._results.length;if(!t)return;let n=e.key===`ArrowDown`?1:-1;this._setActive((this._active+n+t)%t);return}if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&this._active>=0){e.preventDefault(),this._pick(this._results[this._active]);return}if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),this._close();return}}e.key===`Enter`&&(e.ctrlKey||e.metaKey)?(e.preventDefault(),this.dispatchEvent(new CustomEvent(`wui:mention-input:submit`,{bubbles:!0,detail:{value:this.value}}))):e.key===`Backspace`&&this._removeWholeMention(e)}_removeWholeMention(e){let t=this._requireControl();if(t.selectionStart!==t.selectionEnd)return;let n=t.selectionStart,r=this._mentions.find(e=>e.end===n);r&&(e.preventDefault(),this._replace(r.start,r.end,``))}_onMenuClick(e){let t=e.target instanceof Element?e.target.closest(`.wui-mention-option`):null;t&&this._pick(this._results[Number(t.dataset.index)])}_pick(e){if(!e||!this._query)return;let t=u(e.label),{start:n,end:r}=this._query,i=this._text.slice(r),a=`@${t}${/^\s/.test(i)?``:` `}`;this._replace(n,r,a,{id:String(e.value),label:t}),this._announce(g.mentioned(t))}_replace(e,t,n,r){let i=this._requireControl(),a=n.length-(t-e);this._mentions=this._mentions.filter(n=>n.end<=e||n.start>=t).map(e=>e.start>=t?{...e,start:e.start+a,end:e.end+a}:e),r&&this._mentions.push({start:e,end:e+1+r.label.length,id:r.id,label:r.label}),this._text=this._text.slice(0,e)+n+this._text.slice(t),i.value=this._text;let o=e+n.length;i.setSelectionRange(o,o),this._close(),i.focus(),this._emit()}_onFocusOut(e){e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||this._close()}_announce(e){let t=this.querySelector(b);t&&(t.textContent=``,t.textContent=e)}};export{E as i,m as n,g as r,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./dom-Do1pAA12.js";import{t}from"./elementBase-Cxeyx0tU.js";var n=`data-open`,r=8,i=`.wui-nav-menu-link`,a=e=>e instanceof Element?e:e instanceof Node?e.parentElement:null,o=e=>[...e].filter(e=>e instanceof HTMLElement),s=e=>{let t=e.children[0];if(!(t instanceof HTMLElement))throw Error(`Navigation entry has no control.`);return t},c=(e,t,n)=>{let r=e[t];if(r===void 0)throw Error(n);return r},l=class extends t{constructor(){super(),this._onClick=e=>this._handleClick(e),this._onKeyDown=e=>this._handleKeyDown(e),this._onFocusOut=e=>{let t=this._openItem(),n=e.relatedTarget;t&&n instanceof Node&&!t.contains(n)&&this._set(t,!1)},this._onPointerDown=e=>{let t=this._openItem();t&&!e.composedPath().includes(t)&&this._set(t,!1)},this._onResize=()=>{let t=this._openItem();if(!t)return;let n=e(t.children[1],`Navigation entry has no panel.`);this._align(n)}}connectedCallback(){this._teardown(),this.addEventListener(`click`,this._onClick),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`focusout`,this._onFocusOut),document.addEventListener(`pointerdown`,this._onPointerDown,!0)}disconnectedCallback(){this._teardown()}open(e){let t=this._items().find(t=>{let n=t.children[0];return n instanceof HTMLElement&&this._isTrigger(n)&&n.dataset.key===e});t&&this._set(t,!0)}close(e=!1){let t=this._openItem();t&&(this._set(t,!1),e&&s(t).focus({preventScroll:!0}))}_items(){return o(this.querySelectorAll(`.wui-nav-menu-item`))}_openItem(){return this._items().find(e=>e.children[1]?.hasAttribute(n))??null}_isTrigger(e){return!!e?.classList.contains(`wui-nav-menu-trigger`)}_entries(){return this._items().map(s)}_links(e){let t=e.children[1];return t?o(t.querySelectorAll(i)):[]}_set(e,t){let r=e.children[1];if(!r)return;let i=s(e);if(t){let t=this._openItem();t&&t!==e&&this._set(t,!1)}r.hasAttribute(n)!==t&&(r.toggleAttribute(n,t),i.setAttribute(`aria-expanded`,String(t)),t?(this._align(r),window.addEventListener(`resize`,this._onResize)):(r.removeAttribute(`data-align`),this._openItem()||window.removeEventListener(`resize`,this._onResize)),this.dispatchEvent(new CustomEvent(`wui-navigation-menu:toggle`,{bubbles:!0,detail:{key:i.dataset.key??null,open:t}})))}_align(e){e.removeAttribute(`data-align`),e.getBoundingClientRect().right>window.innerWidth-r&&e.setAttribute(`data-align`,`end`)}_handleClick(t){let r=a(t.target),o=r?.closest(`.wui-nav-menu-trigger`);if(o&&this.contains(o)){let t=e(o.parentElement,`Navigation trigger has no entry.`),r=e(t.children[1],`Navigation entry has no panel.`);this._set(t,!r.hasAttribute(n));return}let s=r?.closest(i);s&&this.contains(s)&&this.close()}_handleKeyDown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=a(t.target)?.closest(`.wui-nav-menu-trigger, .wui-nav-menu-toplink, .wui-nav-menu-link`);if(!(n instanceof HTMLElement)||!this.contains(n))return;let r=this._openItem();if(t.key===`Escape`){if(!r)return;t.preventDefault(),t.stopPropagation();let e=r.contains(n);this._set(r,!1),e&&s(r).focus({preventScroll:!0});return}if(n.matches(i)){this._linkKey(t,n);return}let o=this._entries(),l=o.indexOf(n);if(t.key===`ArrowRight`||t.key===`ArrowLeft`||t.key===`Home`||t.key===`End`){t.preventDefault();let e=t.key===`Home`?0:t.key===`End`?o.length-1:(l+(t.key===`ArrowRight`?1:-1)+o.length)%o.length;r&&this._set(r,!1),c(o,e,`Navigation has no entry to focus.`).focus({preventScroll:!0})}else if(t.key===`ArrowDown`&&this._isTrigger(n)){t.preventDefault();let r=e(n.parentElement,`Navigation trigger has no entry.`);this._set(r,!0),c(this._links(r),0,`Navigation panel has no link to focus.`).focus({preventScroll:!0})}}_linkKey(t,n){let r=e(n.closest(`.wui-nav-menu-item`),`Navigation link has no entry.`),i=this._links(r),a=i.indexOf(n);t.key===`ArrowDown`||t.key===`ArrowUp`?(t.preventDefault(),c(i,(a+(t.key===`ArrowDown`?1:-1)+i.length)%i.length,`Navigation panel has no link to focus.`).focus({preventScroll:!0})):t.key===`Home`?(t.preventDefault(),c(i,0,`Navigation panel has no link to focus.`).focus({preventScroll:!0})):t.key===`End`&&(t.preventDefault(),c(i,i.length-1,`Navigation panel has no link to focus.`).focus({preventScroll:!0}))}_teardown(){let e=this._openItem();e&&this._set(e,!1),window.removeEventListener(`resize`,this._onResize),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`focusout`,this._onFocusOut),document.removeEventListener(`pointerdown`,this._onPointerDown,!0)}};export{l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./elementBase-Cxeyx0tU.js";import{c as t,i as n,n as r,s as i}from"./notificationDays-BKVW7xYD.js";import{l as a}from"./wuiHttp-523iN_RF.js";var o=`.wui-notification-center-trigger`,s=`.wui-notification-center-panel`,c=`.wui-notification-center-count`,l=`.wui-notification-center-live`,u=`.wui-notification-center-markall`,d=`.wui-notification-center-item`,f=`wui-notification-center-item-read`,p=`.wui-notification-center-unread-label`,m=`.app-tabs`,h=`.wui-notification-center-tabs [role='tablist']`,g=`.wui-notification-center-tabs [role='tab']`,_=`.wui-notification-center-empty`,v={ArrowDown:1,ArrowUp:-1,Home:`first`,End:`last`},y=e=>!!e,b=e=>Object.hasOwn(r.failed,e),x=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLElement?n:null},S=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement),C=class extends e{constructor(){super(),this._doc=null,this._unread=0,this._busy=!1,this._onClick=e=>this._click(e),this._onKeyDown=e=>this._key(e),this._onOutside=e=>{e.composedPath().includes(this)||this.close()},this._onFocusOut=e=>{let t=e.relatedTarget;t instanceof Node&&!this.contains(t)&&this.close()}}connectedCallback(){this._doc=this.ownerDocument,this._unread=this._initialUnread(),this.addEventListener(`click`,this._onClick),this.addEventListener(`keydown`,this._onKeyDown),this._doc.addEventListener(`mousedown`,this._onOutside),this.addEventListener(`focusout`,this._onFocusOut),this._syncOpen(),this.isOpen&&this._layoutTabs()}disconnectedCallback(){this.removeEventListener(`click`,this._onClick),this.removeEventListener(`keydown`,this._onKeyDown),this._doc?.removeEventListener(`mousedown`,this._onOutside),this.removeEventListener(`focusout`,this._onFocusOut),this._doc=null}get isOpen(){return this.hasAttribute(`open`)}open(){this.isOpen||(this.setAttribute(`open`,``),this._syncOpen(),this._layoutTabs(),x(this,s)?.focus(),this._announceToggle())}close({restoreFocus:e=!1}={}){this.isOpen&&(this.removeAttribute(`open`),this._syncOpen(),e&&x(this,o)?.focus(),this._announceToggle())}toggle(){this.isOpen?this.close():this.open()}_announceToggle(){this.dispatchEvent(new CustomEvent(`wui:notification-center:toggle`,{bubbles:!0,detail:{open:this.isOpen}}))}_syncOpen(){this.querySelector(o)?.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`)}_initialUnread(){let e=Number.parseInt(this.getAttribute(`unread`)??``,10);return Number.isInteger(e)&&e>=0?e:this.querySelectorAll(`${d}:not(.${f}):not([data-archived="true"])`).length}_click(e){let t=e.target;if(!(t instanceof Element))return;let n=t.closest(g);if(n instanceof HTMLElement&&this.contains(n)){if(this.hasAttribute(`controlled`))return;this._pickTab(n);return}let r=t.closest(`${o}, ${u}, ${d}`);r instanceof HTMLElement&&this.contains(r)&&(r.matches(o)?this.toggle():this.hasAttribute(`controlled`)||(r.matches(u)?this._markAll():this._markItem(r)))}_key(e){if(e.key===`Escape`&&this.isOpen){e.preventDefault(),e.stopPropagation(),this.close({restoreFocus:!0});return}if(!this.isOpen)return;let t=e.target;if(!(t instanceof Element))throw Error(`Keyboard event target is not an element.`);if(!this.querySelector(s)?.contains(t)||t.closest(m))return;let n=v[e.key];if(n===void 0)return;let r=S(this,d).filter(e=>!e.closest(`[hidden]`));if(r.length===0)return;let i=t.closest(d),a=i instanceof HTMLElement?r.indexOf(i):-1,o;o=n===`first`?0:n===`last`?r.length-1:a===-1?n===1?0:r.length-1:Math.min(r.length-1,Math.max(0,a+n)),e.preventDefault(),r[o]?.focus()}_markItem(e){e.classList.contains(f)||(this._applyRead(e),e.dataset.archived!==`true`&&(this._unread=Math.max(0,this._unread-1)),this._render(),this._say(t(this._unread)),this._emitRead([e.dataset.id].filter(y),!1))}async _markAll(){if(this._busy)return;let e=S(this,`${d}:not(.${f})`);if(e.length===0&&this._unread===0)return;let t=e.map(e=>e.dataset.id).filter(y),n=this.getAttribute(`read-action`);if(n){this._setBusy(!0);let e=new URLSearchParams;for(let n of t)e.append(`ids`,n);let i=await a(n,{method:`POST`,body:e});if(this._setBusy(!1),!i.ok){if(i.kind===`session`||i.kind===`aborted`)return;let e=i.kind,t=i.message||(b(e)?r.failed[e]:r.failed.server);this._say(t),this.dispatchEvent(new CustomEvent(`wui:notification-center:failed`,{bubbles:!0,detail:{kind:e,message:t}}));return}}for(let t of e)this._applyRead(t);this._unread=0,this._render(),this._say(r.allRead),this._emitRead(t,!0)}_pickTab(e){let t=e.closest(h);if(t instanceof HTMLElement){for(let n of S(t,g)){let t=n===e;n.classList.toggle(`active`,t),n.setAttribute(`aria-selected`,t?`true`:`false`),n.setAttribute(`tabindex`,t?`0`:`-1`)}this._layoutTabs(),this._filterItems(e.dataset.key)}}_layoutTabs(){for(let e of S(this,h)){let t=x(e,`.app-tab.active`);t&&(e.style.setProperty(`--wui-tab-x`,`${t.offsetLeft}px`),e.style.setProperty(`--wui-tab-w`,`${t.offsetWidth}px`)),e.setAttribute(`data-wui-tabs`,``)}}_filterItems(e){let t=!1;for(let n of S(this,d)){let r=n.dataset.archived===`true`,i=n.classList.contains(f),a=e===`archived`?r:!r&&(e!==`unread`||!i);a&&(t=!0);let o=n.closest(`li`);o&&(o.hidden=!a)}for(let e of S(this,`.wui-notification-center-list section`))e.hidden=[...e.querySelectorAll(`li`)].every(e=>e.hidden);let n=x(this,_);n&&(n.hidden=t)}_applyRead(e){e.classList.add(f),e.querySelector(p)?.remove()}_setBusy(e){this._busy=e;let t=this.querySelector(u);t instanceof HTMLButtonElement&&(t.disabled=e||this._unread===0,e?t.setAttribute(`aria-busy`,`true`):t.removeAttribute(`aria-busy`))}_render(){let e=x(this,c);e&&(e.textContent=n(this._unread),e.hidden=this._unread===0),this.querySelector(o)?.setAttribute(`aria-label`,i(this.getAttribute(`label`)||r.label,this._unread));let t=this.querySelector(u);t instanceof HTMLButtonElement&&(t.disabled=this._unread===0)}_say(e){let t=this.querySelector(l);t&&(t.textContent=e)}_emitRead(e,t){this.dispatchEvent(new CustomEvent(`wui:notification-center:read`,{bubbles:!0,detail:{ids:e,all:t}}))}};export{C as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./elementBase-Cxeyx0tU.js";var t=`.wui-onboarding-card`,n=`.wui-onboarding-steps`,r=`.wui-onboarding-toggle`,i=`.wui-onboarding-dismiss`,a=`.wui-onboarding-restore`,o=`wui-onboarding:`,s=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLElement?n:null},c=class extends e{constructor(){super(),this._onClick=e=>{let t=e.target instanceof Element?e.target:null;t&&(t.closest(i)?this.dismiss():t.closest(a)?this.restore():t.closest(r)&&this.toggle())}}connectedCallback(){this.addEventListener(`click`,this._onClick),this._stored()===`dismissed`&&this._setDismissed(!0)}disconnectedCallback(){this.removeEventListener(`click`,this._onClick)}get dismissed(){return s(this,t)?.hidden===!0}get collapsed(){return s(this,n)?.hidden===!0}dismiss(){this.dismissed||(this._setDismissed(!0),this._store(`dismissed`),s(this,a)?.focus(),this.dispatchEvent(new CustomEvent(`wui:onboarding:dismiss`,{bubbles:!0})))}restore(){this.dismissed&&(this._setDismissed(!1),this._store(null),s(this,r)?.focus(),this.dispatchEvent(new CustomEvent(`wui:onboarding:restore`,{bubbles:!0})))}toggle(){let e=s(this,n);if(!e)return;let t=!e.hidden;e.hidden=t,this.querySelector(r)?.setAttribute(`aria-expanded`,String(!t)),this.dispatchEvent(new CustomEvent(`wui:onboarding:collapse`,{bubbles:!0,detail:{collapsed:t}}))}_setDismissed(e){let n=s(this,t),r=s(this,a);n&&(n.hidden=e),r&&(r.hidden=!e)}_key(){let e=this.getAttribute(`storage-key`);return e?o+e:null}_stored(){let e=this._key();if(!e)return null;try{return window.localStorage.getItem(e)}catch{return null}}_store(e){let t=this._key();if(t)try{e?window.localStorage.setItem(t,e):window.localStorage.removeItem(t)}catch{}}};export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./devWarn-DXdRWZs3.js";import{t}from"./elementBase-Cxeyx0tU.js";var n=`li[data-wui-org-node]`,r=`:scope > .wui-org-tree-node`,i=`:scope > .wui-org-tree-node > .wui-org-tree-text > .wui-org-tree-name`,a=`:scope > .wui-org-tree-children`,o=`:scope > .wui-org-tree-node > [data-wui-org-toggle]`,s=`[data-wui-org-toggle]`,c=`a, button, input, select, textarea`,l=`.wui-org-tree-overlay`,u=`[data-wui-org-search]`,d=`[data-wui-org-canvas]`,f=`[data-wui-org-live]`,p=`--wui-org-tree-print-scale`,m=718,h=1e3,g=150,_=`Show {name}'s team`,v=`Hide {name}'s team`,y=`{count} found`,b=`No one found`,x=e=>[...e.querySelectorAll(n)].filter(e=>e instanceof HTMLElement),S=e=>e.querySelector(i)?.textContent?.trim()??``,C=e=>e.getAttribute(`data-wui-org-node`),w=e=>e.getAttribute(`aria-expanded`)===`true`,T=class extends t{static get observedAttributes(){return[`selected`,`selectable`,`expand-label`,`collapse-label`,`search-results-text`,`search-empty-text`]}constructor(){super(),this._query=``,this._snapshot=null,this._observer=null,this._announceTimer=void 0,this._onKeyDown=e=>this._handleKeyDown(e),this._onClick=e=>this._handleClick(e),this._onFocusIn=e=>this._handleFocusIn(e),this._onInput=e=>this._handleInput(e),this._onBeforePrint=()=>this._scaleForPrint(),this._onAfterPrint=()=>this.style.removeProperty(p)}connectedCallback(){this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`click`,this._onClick),this.addEventListener(`focusin`,this._onFocusIn),this.addEventListener(`input`,this._onInput),window.addEventListener(`beforeprint`,this._onBeforePrint),window.addEventListener(`afterprint`,this._onAfterPrint);let t=this.querySelector(d);t?(this._observer=new MutationObserver(()=>{this._query&&this._applySearch(this._query)}),this._observer.observe(t,{childList:!0,subtree:!0})):e(`[@webority/ui-elements] <wui-org-tree> has no [data-wui-org-canvas]; render the tree markup inside it.`)}disconnectedCallback(){this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`focusin`,this._onFocusIn),this.removeEventListener(`input`,this._onInput),window.removeEventListener(`beforeprint`,this._onBeforePrint),window.removeEventListener(`afterprint`,this._onAfterPrint),this._observer?.disconnect(),this._observer=null,clearTimeout(this._announceTimer)}attributeChangedCallback(e){e===`selected`||e===`selectable`?this._applySelected():(e===`expand-label`||e===`collapse-label`)&&this._syncToggles()}get selected(){return this.getAttribute(`selected`)}set selected(e){e==null?this.removeAttribute(`selected`):this.setAttribute(`selected`,String(e))}get selectable(){return this.hasAttribute(`selectable`)}set selectable(e){this.toggleAttribute(`selectable`,!!e)}_items(){return x(this)}_hasChildren(e){return!!e.querySelector(a)}_isVisible(e){for(let t=e;t&&t!==this;t=t.parentElement)if(t.hasAttribute(`hidden`))return!1;return!0}_visibleItems(){return this._items().filter(e=>this._isVisible(e))}_parentItem(e){let t=e.parentElement?.closest(n);return t instanceof HTMLElement&&this.contains(t)?t:null}_visibleChildren(e){let t=e.querySelector(a);return t?[...t.children].filter(e=>e.matches(n)&&this._isVisible(e)):[]}_isVisibleItem(e){return e instanceof HTMLElement&&e.matches(n)&&this._isVisible(e)}_siblingItem(e,t){let n=e[t];for(;n&&!this._isVisibleItem(n);)n=n[t];return this._isVisibleItem(n)?n:null}_setRoving(e){for(let t of this._items())t.setAttribute(`tabindex`,t===e?`0`:`-1`)}_focusItem(e){e&&(this._setRoving(e),e.focus())}_toggleLabel(e,t){return(t?this.getAttribute(`collapse-label`)??v:this.getAttribute(`expand-label`)??_).split(`{name}`).join(S(e))}_setExpanded(e,t){let n=e.querySelector(a);n instanceof HTMLElement&&(e.setAttribute(`aria-expanded`,String(t)),n.hidden=!t,e.querySelector(o)?.setAttribute(`aria-label`,this._toggleLabel(e,t)),!t&&n.contains(document.activeElement)&&this._focusItem(e))}_toggle(e){this._setExpanded(e,!w(e))}_syncToggles(){for(let e of this._items())this._hasChildren(e)&&this._setExpanded(e,w(e))}_applySelected(){for(let e of this._items())this.selectable?e.setAttribute(`aria-selected`,String(C(e)===this.selected)):e.removeAttribute(`aria-selected`)}_select(e){this.selectable&&(this.selected=C(e),this.dispatchEvent(new CustomEvent(`wui-org-tree:select`,{detail:{id:this.selected},bubbles:!0,composed:!0})))}_activate(e){this.selectable?this._select(e):this._hasChildren(e)&&this._toggle(e)}_handleFocusIn(e){let t=e.target;if(!(t instanceof Element))return;let r=t.closest(n);r instanceof HTMLElement&&this.contains(r)&&this._setRoving(r)}_handleClick(e){let t=e.target;if(!(t instanceof Element))return;let i=t.closest(n);i instanceof HTMLElement&&this.contains(i)&&(this._setRoving(i),t.closest(s)?this._hasChildren(i)&&this._toggle(i):i.querySelector(r)?.contains(t)&&(t.closest(c)?.closest(l)||this._select(i)))}_handleKeyDown(e){if(e.ctrlKey||e.metaKey||e.altKey)return;let t=e.target;if(t instanceof HTMLElement&&t.matches(n)&&this.contains(t))switch(e.key){case`ArrowDown`:if(e.preventDefault(),!this._hasChildren(t))return;w(t)||this._setExpanded(t,!0),this._focusItem(this._visibleChildren(t)[0]);return;case`ArrowUp`:e.preventDefault(),this._focusItem(this._parentItem(t));return;case`ArrowRight`:e.preventDefault(),this._focusItem(this._siblingItem(t,`nextElementSibling`));return;case`ArrowLeft`:e.preventDefault(),this._focusItem(this._siblingItem(t,`previousElementSibling`));return;case`Home`:e.preventDefault(),this._focusItem(this._visibleItems()[0]);return;case`End`:e.preventDefault(),this._focusItem(this._visibleItems().at(-1));return;case`+`:case`=`:if(!this._hasChildren(t))return;e.preventDefault(),this._setExpanded(t,!0);return;case`-`:if(!this._hasChildren(t))return;e.preventDefault(),this._setExpanded(t,!1);return;case`Enter`:case` `:e.preventDefault(),this._activate(t);return}}_handleInput(e){let t=e.target;t instanceof HTMLInputElement&&t.matches(u)&&this._search(t.value.trim().toLocaleLowerCase())}_search(e){clearTimeout(this._announceTimer),e?(this._snapshot||=this._captureExpanded(),this._query=e,this._applySearch(e),this._announceTimer=window.setTimeout(()=>this._announce(this._resultText()),g)):(this._snapshot&&this._restore(this._snapshot),this._snapshot=null,this._query=``,this._announce(``))}_captureExpanded(){return new Map(this._items().filter(e=>this._hasChildren(e)).map(e=>[C(e),w(e)]))}_restore(e){for(let t of this._items()){t.hidden=!1,t.classList.remove(`wui-org-tree-match`);let n=C(t);e.has(n)&&this._setExpanded(t,e.get(n)??!1)}}_applySearch(e){let t=this._items(),n=new Set(t.filter(t=>S(t).toLocaleLowerCase().includes(e))),r=new Set(n);for(let e of n)for(let t=this._parentItem(e);t;t=this._parentItem(t))r.add(t),w(t)||this._setExpanded(t,!0);for(let e of t)e.classList.toggle(`wui-org-tree-match`,n.has(e)),e.hidden=!r.has(e);let i=t.filter(e=>r.has(e)),a=i[0];a&&!i.some(e=>e.getAttribute(`tabindex`)===`0`)&&this._setRoving(a)}_resultText(){let e=this._items().filter(e=>e.classList.contains(`wui-org-tree-match`)).length;return e===0?this.getAttribute(`search-empty-text`)??b:(this.getAttribute(`search-results-text`)??y).split(`{count}`).join(String(e))}_announce(e){let t=this.querySelector(f);t&&(t.textContent=e)}_scaleForPrint(){let e=this.querySelector(d);if(!(e instanceof HTMLElement))return;let t=Math.min(1,m/e.scrollWidth,h/e.scrollHeight);this.style.setProperty(p,String(t))}};export{T as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./elementBase-
|
|
1
|
+
import{t as e}from"./elementBase-Cxeyx0tU.js";import{n as t,r as n,t as r}from"./fieldState-D-zQcXUS.js";import{t as i}from"./formMirror-9IpSgeZb.js";var a=/[^0-9]/g,o=/[^0-9a-zA-Z]/g,s=class extends e{static formAssociated=!0;static get observedAttributes(){return[`value`,`length`,`mode`,`disabled`,`readonly`,`loading`,`size`,`aria-label`]}get length(){let e=Number.parseInt(this.getAttribute(`length`)??`6`,10);return Number.isFinite(e)&&e>0?e:6}set length(e){this.setAttribute(`length`,String(e))}get mode(){return this.getAttribute(`mode`)===`alphanumeric`?`alphanumeric`:`numeric`}set mode(e){this.setAttribute(`mode`,String(e??`numeric`))}get value(){return this._value??``}set value(e){this._value=this._clean(e),i(this,this._value),this._paint()}_clean(e){return(e==null?``:String(e)).replace(this.mode===`alphanumeric`?o:a,``).slice(0,this.length)}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}}connectedCallback(){this._rendered?this._onSelectionChange&&document.addEventListener(`selectionchange`,this._onSelectionChange):(this._defaultCaptured||=(this._defaultValue=this._value,!0),this.render())}formResetCallback(){this._value=this._defaultValue||``,i(this,this._value),this._paint()}attributeChangedCallback(e,t,n){this._rendered&&(e===`value`?(this._value=this._clean(n),i(this,this._value),this._paint()):this.render())}render(){this._value=this._clean(this.getAttribute(`value`)??this._value);let e=this.length,r=this.mode===`numeric`,a=this.hasAttribute(`disabled`),o=t(this)||this.hasAttribute(`loading`),s=this.getAttribute(`size`),c=s===`sm`||s===`lg`?` otp-${s}`:``,l=Array.from({length:e},()=>`<span class="otp-slot" aria-hidden="true"></span>`).join(``),u=this.getAttribute(`aria-label`),d=u?` aria-label="${u.replace(/"/g,`"`)}"`:``;this.innerHTML=`
|
|
2
2
|
<div class="otp${c}">
|
|
3
3
|
<input
|
|
4
4
|
class="otp-field"
|
|
@@ -11,4 +11,4 @@ import{t as e}from"./elementBase-DV9IZZCu.js";import{n as t,r as n,t as r}from".
|
|
|
11
11
|
spellcheck="false"
|
|
12
12
|
${a?`disabled`:``}${o?` readonly`:``} />
|
|
13
13
|
<div class="otp-slots" aria-hidden="true">${l}</div>
|
|
14
|
-
</div>`,this._rendered=!0,i(this,this._value),n(this,this.querySelector(`.otp`)),this._wire(),this._paint()}_refs(){
|
|
14
|
+
</div>`,this._rendered=!0,i(this,this._value),n(this,this.querySelector(`.otp`)),this._wire(),this._paint()}_refs(){let e=this.querySelector(`.otp-field`);return{input:e instanceof HTMLInputElement?e:null,slots:[...this.querySelectorAll(`.otp-slot`)].filter(e=>e instanceof HTMLElement)}}_paint(){let{input:e,slots:t}=this._refs();if(!e||!t.length)return;e.value!==this._value&&(e.value=this._value);let n=e.selectionStart??this._value.length,r=Math.min(n,t.length-1),i=document.activeElement===e;t.forEach((e,t)=>{e.textContent=this._value[t]??``,e.classList.toggle(`filled`,!!this._value[t]),e.classList.toggle(`active`,i&&t===r)})}_wire(){let{input:e}=this._refs();if(!e)return;let t=e=>{let t=this._clean(e),n=t!==this._value;this._value=t,i(this,this._value),this._paint(),n&&this.dispatchEvent(new Event(`change`,{bubbles:!0})),n&&t.length===this.length&&this.dispatchEvent(new CustomEvent(`complete`,{bubbles:!0,detail:t}))};e.addEventListener(`input`,()=>{let n=e.value;if(this._value.length===this.length&&n.length>this._value.length&&n.startsWith(this._value)){let e=this._clean(n.slice(this._value.length));if(e){t(e);return}}t(n)}),e.addEventListener(`paste`,e=>{if(r(this))return;let n=e.clipboardData?.getData(`text`);n!=null&&(e.preventDefault(),t(n))});for(let t of[`keyup`,`click`,`blur`,`select`])e.addEventListener(t,()=>this._paint());e.addEventListener(`focus`,()=>{this._value.length===this.length&&e.select(),this._paint()}),this._onSelectionChange&&document.removeEventListener(`selectionchange`,this._onSelectionChange),this._onSelectionChange=()=>{document.activeElement===e&&this._paint()},document.addEventListener(`selectionchange`,this._onSelectionChange)}disconnectedCallback(){this._onSelectionChange&&document.removeEventListener(`selectionchange`,this._onSelectionChange)}};export{s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./anchorOverlay-CXnWfezA.js";import{t as r}from"./elementBase-Cxeyx0tU.js";var i=`data-wui-overflow-hidden`,a=`[aria-selected="true"], .active`,o=`.chip-body, input, a[href], button:not(.chip-remove)`,s=1,c=0,l=e=>Number.parseFloat(e)||0,u=e=>e.nodeType===1,d=e=>{let t=e.getAttribute(`data-overflow-label`);if(t)return t;let n=[],r=e=>{for(let t of e.childNodes)if(t.nodeType===3){let e=t.textContent?.trim();e&&n.push(e)}else u(t)&&!t.matches(`svg, img, [aria-hidden='true']`)&&r(t)};return r(e),n.join(` `)},f=e=>{if(e.matches(`button, a[href], label, input`))return e;let t=e.querySelector(o);return t instanceof HTMLElement?t:null},p=class extends r{constructor(){super(),this._hiddenKey=``,this._ro=null,this._mo=null,this._observedList=null,this._doc=null,this._onDocDown=e=>{!this._menu.hidden&&!e.composedPath().includes(this)&&this._close(!1)}}connectedCallback(){this.classList.add(`wui-overflow`),this._build(),this._doc=this.ownerDocument,this._doc.addEventListener(`pointerdown`,this._onDocDown,!0),typeof ResizeObserver<`u`&&(this._ro=new ResizeObserver(()=>this.layout()),this._ro.observe(this)),typeof MutationObserver<`u`&&(this._mo=new MutationObserver(()=>this.layout()),this._watch()),this.layout()}disconnectedCallback(){this._ro?.disconnect(),this._mo?.disconnect(),this._ro=null,this._mo=null,this._observedList=null,this._doc?.removeEventListener(`pointerdown`,this._onDocDown,!0),this._doc=null,t(this)}static get observedAttributes(){return[`label`]}attributeChangedCallback(){let e=this._more?.firstChild;e&&(e.textContent=this._label())}_label(){return this.getAttribute(`label`)||`More`}_list(){let e=this.querySelector(`[data-wui-overflow-list]`);return e instanceof HTMLElement?e:null}_items(e){return[...e.children].filter(e=>!e.hasAttribute(`data-wui-overflow-skip`))}_build(){if(this._more)return;let e=`wui-overflow-menu-${++c}`,t=this.ownerDocument.createElement(`button`);t.type=`button`,t.className=`wui-overflow-more`,t.hidden=!0,t.setAttribute(`aria-haspopup`,`menu`),t.setAttribute(`aria-expanded`,`false`),t.setAttribute(`aria-controls`,e),t.append(this._label());let n=this.ownerDocument.createElement(`div`);n.className=`wui-overflow-menu`,n.id=e,n.setAttribute(`role`,`menu`),n.hidden=!0,this.append(t,n),this._more=t,this._menu=n,t.addEventListener(`click`,()=>this._menu.hidden?this._open(!1):this._close(!0)),t.addEventListener(`keydown`,e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),this._open(!0))}),n.addEventListener(`keydown`,e=>this._onMenuKey(e))}_watch(){let e=this._list();this._mo&&e!==this._observedList&&(this._mo.disconnect(),this._observedList=e,e&&this._mo.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`class`,`aria-selected`,`disabled`,`aria-disabled`,`data-overflow-label`]}))}layout(){let e=this._list();if(this._watch(),!e||!this._more)return;let t=this._items(e);for(let e of t)e.removeAttribute(i);this._more.hidden=!0;let n=this.clientWidth,r=[];if(n>0&&t.length){let i=getComputedStyle(e),o=l(i.columnGap),c=l(i.paddingLeft)+l(i.paddingRight)+l(i.borderLeftWidth)+l(i.borderRightWidth),u=t.map(e=>e.offsetWidth);if(u.reduce((e,t)=>e+t,0)+o*(t.length-1)>n-c+s){this._more.hidden=!1;let e=n-c-this._more.offsetWidth-l(getComputedStyle(this).columnGap),i=this.hasAttribute(`keep`)?this.getAttribute(`keep`):a,s=/* @__PURE__ */ new Set,d=0,f=0,p=i?t.filter(e=>e.matches(i)):[];for(let n of p){let r=d+(u[t.indexOf(n)]??0)+(f?o:0);r>e||(s.add(n),d=r,f+=1)}for(let n=0;n<t.length;n+=1){let r=t[n];if(!r||s.has(r))continue;let i=d+(u[n]??0)+(f?o:0);if(i>e)break;s.add(r),d=i,f+=1}r=t.filter(e=>!s.has(e))}}for(let e of r)e.setAttribute(i,``);this._more.hidden=r.length===0,r.length?this._menu.hidden||this._fill(r):this._close(!1);let o=r.map(e=>t.indexOf(e)).join(`,`);o!==this._hiddenKey&&(this._hiddenKey=o,this.dispatchEvent(new CustomEvent(`wui-overflow-change`,{bubbles:!0,detail:{hidden:r.length}})))}_hiddenItems(){let e=this._list();return e?this._items(e).filter(e=>e.hasAttribute(i)):[]}_fill(e){this._menu.replaceChildren();for(let t of e){let e=this.ownerDocument.createElement(`button`);e.type=`button`,e.className=`wui-overflow-item`,e.tabIndex=-1;let n=t.querySelector(`input[type=checkbox], input[type=radio]`);n instanceof HTMLInputElement?(e.setAttribute(`role`,n.type===`radio`?`menuitemradio`:`menuitemcheckbox`),e.setAttribute(`aria-checked`,String(n.checked))):e.setAttribute(`role`,`menuitem`);let r=f(t),i=!r||`disabled`in r&&r.disabled||r.getAttribute(`aria-disabled`)===`true`||t.matches(`.disabled, [aria-disabled='true']`);i&&e.setAttribute(`aria-disabled`,`true`),e.textContent=d(t),e.addEventListener(`click`,()=>{i||r&&this._choose(t,r)}),this._menu.append(e)}}_choose(e,t){this._close(!1),t.click(),this.layout();let n=!e.hasAttribute(i)&&e.matches(`button, a[href]`)?e:this._more;n.hidden||n.focus()}_open(t){let r=this._hiddenItems();if(!r.length)return;this._fill(r),this._menu.hidden=!1,this._more.setAttribute(`aria-expanded`,`true`);let i=()=>n(this._more,this._menu);if(i(),e(this,i),t){let e=this._menu.firstElementChild;e instanceof HTMLElement&&e.focus()}}_close(e){this._menu&&!this._menu.hidden&&(this._menu.hidden=!0,this._more.setAttribute(`aria-expanded`,`false`),t(this),e&&this._more.focus())}_onMenuKey(e){let t=[...this._menu.children].filter(e=>e instanceof HTMLElement),n=this.ownerDocument.activeElement,r=n instanceof HTMLElement?t.indexOf(n):-1,i=null;if(e.key===`ArrowDown`)i=t[(r+1)%t.length];else if(e.key===`ArrowUp`)i=t[(r-1+t.length)%t.length];else if(e.key===`Home`)i=t[0];else if(e.key===`End`)i=t[t.length-1];else if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),this._close(!0);return}else if(e.key===`Tab`){this._close(!1);return}else return;e.preventDefault(),i?.focus()}};export{p as t};
|