@webority/ui-elements 0.165.0 → 0.167.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WuiCarousel-CRx2-eKV.js +1 -0
- package/dist/WuiCodeBlock-DTckR_z3.js +1 -0
- package/dist/WuiCommandPalette-CSzl5yGf.js +2 -0
- package/dist/WuiCommentThread-AYovTYSA.js +1 -0
- package/dist/WuiConsentBanner-CWvXnwBH.js +1 -0
- package/dist/WuiContextMenu-CyejQsef.js +1 -0
- package/dist/WuiDataTable-BniN81KC.js +1 -0
- package/dist/WuiDatePicker-q0s8tL_E.js +31 -0
- package/dist/WuiDateRange-p2r5A9CY.js +25 -0
- package/dist/WuiDrawer-CQ7nRHUD.js +1 -0
- package/dist/{WuiDropdown-CeiMaiwi.js → WuiDropdown-BQC04Q48.js} +1 -1
- package/dist/WuiEntryGrid-DPAYNu1v.js +3 -0
- package/dist/{WuiHoverCard-AAXID-P3.js → WuiHoverCard-DRZh88zM.js} +1 -1
- package/dist/WuiImageCrop-BTY59Qsm.js +17 -0
- package/dist/WuiInlineEdit-CEjs5Ruk.js +1 -0
- package/dist/WuiLeadPopup-L9UCTVA5.js +382 -0
- package/dist/WuiLightbox-DDQAOabU.js +1 -0
- package/dist/WuiMentionInput-CkhrCz_2.js +1 -0
- package/dist/{WuiModal-Bz2Xg161.js → WuiModal-BRILsSMq.js} +1 -1
- package/dist/{WuiNavigationMenu-Dybw-nMb.js → WuiNavigationMenu-BCnqv7e-.js} +1 -1
- package/dist/WuiNotificationCenter-BCXT3Y7m.js +1 -0
- package/dist/WuiOrgTree-5v0vqPVk.js +1 -0
- package/dist/WuiOverflow-DtetLQHW.js +1 -0
- package/dist/WuiPhone-B6jgFRSi.js +16 -0
- package/dist/{WuiPopover-y_Vxm64z.js → WuiPopover-BzVxNSs1.js} +1 -1
- package/dist/WuiRecordPager-Dye7AfCS.js +1 -0
- package/dist/{WuiRelativeTime-CmlKD-97.js → WuiRelativeTime-DTGKGHbK.js} +1 -1
- package/dist/WuiSavedViews-BsAyuOzX.js +1 -0
- package/dist/WuiSelect-CMHoPHlx.js +9 -0
- package/dist/WuiShortcuts-DSjwaZx7.js +1 -0
- package/dist/WuiShowMore-CGhWrlmK.js +1 -0
- package/dist/WuiSlider-J9YPWu9e.js +51 -0
- package/dist/WuiSortable-BfOm57Mj.js +1 -0
- package/dist/WuiTimePicker-C5XouoR7.js +9 -0
- package/dist/WuiTour-BDOGWyNA.js +1 -0
- package/dist/WuiTree-CeYbyaCx.js +1 -0
- package/dist/{WuiWhatsNew-BdsS6MzB.js → WuiWhatsNew-DOo54GiH.js} +1 -1
- package/dist/WuiWizardStep-Ce6O_8oc.js +1 -0
- package/dist/calendarMath-CFjBxJYM.js +1 -0
- package/dist/carousel.g-Bw_pFDzc.js +1 -0
- package/dist/chips-CemguTKJ.js +2 -0
- package/dist/codeBlock.g-BCF2IlK-.js +1 -0
- package/dist/commandPalette.g-DFWnCufa.js +1 -0
- package/dist/commentText-NWsssKvj.js +1 -0
- package/dist/consentBanner.g-CZAb1BLJ.js +1 -0
- package/dist/country-B7jmc--B.js +1 -0
- package/dist/customRule-BXJdj57A.js +1 -0
- package/dist/customRule.g-Cfkl3_ZC.js +1 -0
- package/dist/dataTable-CKz4Oncc.js +1 -0
- package/dist/dataTable.g-BVxhub_d.js +1 -0
- package/dist/datePicker.g-CT9FBY21.js +1 -0
- package/dist/dateRangePicker.g-Pnc37vgX.js +1 -0
- package/dist/drawer.g-B-zYKBfQ.js +1 -0
- package/dist/drawerDiscard-BjykHS_G.js +1 -0
- package/dist/elements/carousel.js +1 -1
- package/dist/elements/code-block.js +1 -1
- package/dist/elements/command-palette.js +1 -1
- package/dist/elements/comment-thread.js +1 -1
- package/dist/elements/consent-banner.js +1 -1
- package/dist/elements/context-menu.js +1 -1
- package/dist/elements/data-table.js +1 -1
- package/dist/elements/date-range.js +1 -1
- package/dist/elements/datepicker.js +1 -1
- package/dist/elements/drawer.js +1 -1
- package/dist/elements/dropdown.js +1 -1
- package/dist/elements/entry-grid.js +1 -1
- package/dist/elements/filter-popover.js +1 -1
- package/dist/elements/hover-card.js +1 -1
- package/dist/elements/image-crop.js +1 -1
- package/dist/elements/inline-edit.js +1 -1
- package/dist/elements/kanban.js +1 -1
- package/dist/elements/lead-popup.js +1 -1
- package/dist/elements/lightbox.js +1 -1
- package/dist/elements/mention-input.js +1 -1
- package/dist/elements/modal.js +1 -1
- package/dist/elements/navigation-menu.js +1 -1
- package/dist/elements/notification-center.js +1 -1
- package/dist/elements/org-tree.js +1 -1
- package/dist/elements/overflow.js +1 -1
- package/dist/elements/phone.js +1 -1
- package/dist/elements/popover.js +1 -1
- package/dist/elements/record-pager.js +1 -1
- package/dist/elements/relative-time.js +1 -1
- package/dist/elements/saved-views.js +1 -1
- package/dist/elements/select.js +1 -1
- package/dist/elements/shortcuts.js +1 -1
- package/dist/elements/show-more.js +1 -1
- package/dist/elements/slider.js +1 -1
- package/dist/elements/sortable.js +1 -1
- package/dist/elements/timepicker.js +1 -1
- package/dist/elements/tour.js +1 -1
- package/dist/elements/tree.js +1 -1
- package/dist/elements/whats-new.js +1 -1
- package/dist/elements/wizard.js +1 -1
- package/dist/fileViewer.g-B5XQ5WKr.js +1 -0
- package/dist/fileViewerImage-B0Q9zdgW.js +3 -0
- package/dist/fileViewerMedia-D3fdG-Ti.js +1 -0
- package/dist/fileViewerPdf-DeRWa1JE.js +20 -0
- package/dist/{filterPopover-B29bt1s2.js → filterPopover-DmeVG4_N.js} +1 -1
- package/dist/formatters-Dy4kQQ_h.js +1 -0
- package/dist/formatters.g-BNAu1PMe.js +1 -0
- package/dist/helpers.js +1 -1
- package/dist/httpFailure.g-DBKzEpAf.js +1 -0
- package/dist/iconGlyphs.g-DxSJLQJ8.js +1 -0
- package/dist/imageCrop.g-BnbAeH2Q.js +1 -0
- package/dist/inlineEdit.g-ZxRNYq0t.js +1 -0
- package/dist/inlineEditText-BUO5sZxN.js +1 -0
- package/dist/kanban-CEZmyYFY.js +1 -0
- package/dist/kanban.g-dtKYyIpr.js +1 -0
- package/dist/kanbanModel-Dp5c1rTs.js +1 -0
- package/dist/leadPopup.g-BfMPz9nH.js +1 -0
- package/dist/lightbox.g-DDrycPou.js +1 -0
- package/dist/{loader-C7Ov09Bx.js → loader-CQJFj96n.js} +1 -1
- package/dist/mentionInput.g-DJo6d2Gm.js +1 -0
- package/dist/nativeOverlay-C1Rw2gIW.js +1 -0
- package/dist/notificationCentre.g-UsAurkUz.js +1 -0
- package/dist/notificationDays-B7cbYu4q.js +1 -0
- package/dist/{optionLabel-4xjXWy74.js → optionLabel-B2cU4Ax0.js} +1 -1
- package/dist/orgTree.g-CIg75quV.js +1 -0
- package/dist/overflow.g-BfcGEhwR.js +1 -0
- package/dist/passwordRules.g-CMYrohdd.js +1 -0
- package/dist/phone.g-P66U-SK5.js +1 -0
- package/dist/recents-BQ0fD7Y0.js +1 -0
- package/dist/relativeTime-CdFw-ekO.js +1 -0
- package/dist/relativeTime.g-BH90tjJM.js +1 -0
- package/dist/rowDrop.g-DQpB10Ey.js +1 -0
- package/dist/savedViews.g-CzzEliTR.js +1 -0
- package/dist/search-Cj1YQUwK.js +1 -0
- package/dist/search.g-B5d1s59A.js +1 -0
- package/dist/server.js +1 -1
- package/dist/shell.g-C2Ht5xl2.js +1 -0
- package/dist/shortcutKeys-DmPiY4T7.js +1 -0
- package/dist/shortcutKeys.g-C0TeAfYL.js +1 -0
- package/dist/showMore.g-BdQ5MUSd.js +1 -0
- package/dist/slider.g-BPNfxZEV.js +1 -0
- package/dist/sortable.g-BsTKys5-.js +1 -0
- package/dist/tableSelect.g-DKZqXQT_.js +1 -0
- package/dist/text/en.json +1278 -0
- package/dist/text.js +1 -0
- package/dist/textStore-opIEM4lu.js +1 -0
- package/dist/themeTransition-CDB0Mx61.js +1 -0
- package/dist/timePicker.g-DM61i-ZE.js +1 -0
- package/dist/tourAdvance.g-BJqDnqag.js +1 -0
- package/dist/tree.g-RId8xZSk.js +1 -0
- package/dist/ui-calendar.global.js +1 -1
- package/dist/ui-calendar.js +1 -1
- package/dist/ui-chart.global.js +2 -2
- package/dist/ui-chart.js +2 -2
- package/dist/ui-consent-banner.global.js +1 -1
- package/dist/ui-elements/carousel.global.js +1 -1
- package/dist/ui-elements/code-block.global.js +1 -1
- package/dist/ui-elements/command-palette.global.js +2 -2
- package/dist/ui-elements/comment-thread.global.js +1 -1
- package/dist/ui-elements/consent-banner.global.js +1 -1
- package/dist/ui-elements/context-menu.global.js +1 -1
- package/dist/ui-elements/date-range.global.js +12 -12
- package/dist/ui-elements/drawer.global.js +1 -1
- package/dist/ui-elements/dropdown.global.js +1 -1
- package/dist/ui-elements/entry-grid.global.js +3 -1
- package/dist/ui-elements/glyphs.global.js +1 -1
- package/dist/ui-elements/image-crop.global.js +8 -8
- package/dist/ui-elements/inline-edit.global.js +1 -1
- package/dist/ui-elements/kanban.global.js +1 -1
- package/dist/ui-elements/lead-popup.global.js +50 -50
- package/dist/ui-elements/lightbox.global.js +1 -1
- package/dist/ui-elements/markdown.global.js +1 -1
- package/dist/ui-elements/org-tree.global.js +1 -1
- package/dist/ui-elements/phone.global.js +9 -9
- package/dist/ui-elements/popover.global.js +1 -1
- package/dist/ui-elements/saved-views.global.js +1 -1
- package/dist/ui-elements/select-chips.global.js +2 -2
- package/dist/ui-elements/select-recents.global.js +1 -1
- package/dist/ui-elements/select-search.global.js +1 -1
- package/dist/ui-elements/slider.global.js +13 -13
- package/dist/ui-elements/sortable.global.js +1 -1
- package/dist/ui-elements/status-icon.global.js +1 -1
- package/dist/ui-elements/timepicker.global.js +4 -4
- package/dist/ui-elements/tour.global.js +1 -1
- package/dist/ui-elements/tree.global.js +1 -1
- package/dist/ui-elements/wizard.global.js +1 -1
- package/dist/ui-elements.global.js +21 -21
- package/dist/ui-elements.js +1 -1
- package/dist/ui-file-viewer.global.js +11 -11
- package/dist/ui-file-viewer.js +1 -1
- package/dist/ui-lead-popup.global.js +1 -1
- package/dist/ui-rich-text.global.js +8 -8
- package/dist/ui-rich-text.js +8 -8
- package/dist/ui-tour.global.js +1 -1
- package/dist/wizard.g-DOZSBUc5.js +1 -0
- package/package.json +11 -6
- package/types/WuiCarousel.d.ts +0 -8
- package/types/WuiChart.d.ts +1 -1
- package/types/WuiCommentThread.d.ts +1 -1
- package/types/WuiDrawer.d.ts +1 -1
- package/types/WuiEntryGrid.d.ts +5 -2
- package/types/WuiMentionInput.d.ts +0 -10
- package/types/WuiTour.d.ts +1 -12
- package/types/avatarPicker.d.ts +0 -13
- package/types/calendarMath.d.ts +0 -2
- package/types/chartAdapter.d.ts +1 -0
- package/types/chartSpec.d.ts +0 -4
- package/types/commentText.d.ts +0 -35
- package/types/dataTable.d.ts +6 -8
- package/types/elements/comment-thread.d.ts +2 -2
- package/types/elements/data-table.d.ts +1 -1
- package/types/elements/inline-edit.d.ts +2 -2
- package/types/elements/mention-input.d.ts +2 -2
- package/types/formatters.d.ts +15 -3
- package/types/global/core.d.ts +8 -7
- package/types/global/shared.d.ts +6 -0
- package/types/helpers.d.ts +9 -9
- package/types/inlineEditText.d.ts +0 -14
- package/types/kanbanModel.d.ts +0 -32
- package/types/notificationDays.d.ts +0 -19
- package/types/passwordRules.d.ts +0 -2
- package/types/server/drawerDiscard.d.ts +0 -5
- package/types/server/index.d.ts +3 -3
- package/types/server/remoteModal.d.ts +7 -5
- package/types/server/serverActions.d.ts +0 -9
- package/types/server/serverTable.d.ts +0 -11
- package/types/server/unsavedChanges.d.ts +0 -6
- package/types/shortcutKeys.d.ts +3 -3
- package/types/tableSelect.d.ts +0 -2
- package/types/text/index.d.ts +8 -0
- package/types/text/textStore.d.ts +19 -0
- package/types/text/web/accountSwitcher.g.d.ts +4 -0
- package/types/text/web/alert.g.d.ts +4 -0
- package/types/text/web/asyncBlock.g.d.ts +7 -0
- package/types/text/web/avatar.g.d.ts +4 -0
- package/types/text/web/avatarGroup.g.d.ts +4 -0
- package/types/text/web/banner.g.d.ts +4 -0
- package/types/text/web/breadcrumbs.g.d.ts +4 -0
- package/types/text/web/calendar.g.d.ts +20 -0
- package/types/text/web/card.g.d.ts +4 -0
- package/types/text/web/carousel.g.d.ts +13 -0
- package/types/text/web/catalogue.g.d.ts +266 -0
- package/types/text/web/chart.g.d.ts +102 -0
- package/types/text/web/chartCard.g.d.ts +13 -0
- package/types/text/web/check.g.d.ts +4 -0
- package/types/text/web/checkbox.g.d.ts +4 -0
- package/types/text/web/chip.g.d.ts +5 -0
- package/types/text/web/chipGroup.g.d.ts +4 -0
- package/types/text/web/choiceCard.g.d.ts +4 -0
- package/types/text/web/choiceChip.g.d.ts +4 -0
- package/types/text/web/codeBlock.g.d.ts +6 -0
- package/types/text/web/colourField.g.d.ts +7 -0
- package/types/text/web/columnMenu.g.d.ts +4 -0
- package/types/text/web/commandPalette.g.d.ts +12 -0
- package/types/text/web/commentThread.g.d.ts +35 -0
- package/types/text/web/compareTable.g.d.ts +7 -0
- package/types/text/web/confirmDialog.g.d.ts +10 -0
- package/types/text/web/confirmProvider.g.d.ts +4 -0
- package/types/text/web/consentBanner.g.d.ts +18 -0
- package/types/text/web/contextMenu.g.d.ts +5 -0
- package/types/text/web/copyButton.g.d.ts +5 -0
- package/types/text/web/customRule.g.d.ts +4 -0
- package/types/text/web/dataTable.g.d.ts +31 -0
- package/types/text/web/datePicker.g.d.ts +16 -0
- package/types/text/web/dateRangePicker.g.d.ts +22 -0
- package/types/text/web/drawer.g.d.ts +9 -0
- package/types/text/web/dropZone.g.d.ts +8 -0
- package/types/text/web/dropdown.g.d.ts +7 -0
- package/types/text/web/dueDate.g.d.ts +10 -0
- package/types/text/web/entryGrid.g.d.ts +16 -0
- package/types/text/web/errorBoundary.g.d.ts +4 -0
- package/types/text/web/errorSummary.g.d.ts +5 -0
- package/types/text/web/field.g.d.ts +4 -0
- package/types/text/web/fileAttachment.g.d.ts +18 -0
- package/types/text/web/filePicker.g.d.ts +20 -0
- package/types/text/web/fileValidation.g.d.ts +15 -0
- package/types/text/web/fileViewer.g.d.ts +55 -0
- package/types/text/web/filterBar.g.d.ts +15 -0
- package/types/text/web/floatingDock.g.d.ts +4 -0
- package/types/text/web/formatters.g.d.ts +49 -0
- package/types/text/web/formulaSteps.g.d.ts +9 -0
- package/types/text/web/hoverCard.g.d.ts +4 -0
- package/types/text/web/httpFailure.g.d.ts +4 -0
- package/types/text/web/imageCrop.g.d.ts +18 -0
- package/types/text/web/imagePicker.g.d.ts +22 -0
- package/types/text/web/index.g.d.ts +132 -0
- package/types/text/web/infoTip.g.d.ts +4 -0
- package/types/text/web/inlineEdit.g.d.ts +12 -0
- package/types/text/web/input.g.d.ts +11 -0
- package/types/text/web/inputMask.g.d.ts +12 -0
- package/types/text/web/kanban.g.d.ts +33 -0
- package/types/text/web/kbd.g.d.ts +6 -0
- package/types/text/web/kpiTile.g.d.ts +4 -0
- package/types/text/web/labelHelp.g.d.ts +4 -0
- package/types/text/web/leadPopup.g.d.ts +23 -0
- package/types/text/web/lightbox.g.d.ts +12 -0
- package/types/text/web/mentionInput.g.d.ts +11 -0
- package/types/text/web/modal.g.d.ts +14 -0
- package/types/text/web/modalCardRenderer.g.d.ts +5 -0
- package/types/text/web/modalContent.g.d.ts +4 -0
- package/types/text/web/modalForm.g.d.ts +5 -0
- package/types/text/web/navigationMenu.g.d.ts +4 -0
- package/types/text/web/notificationCentre.g.d.ts +24 -0
- package/types/text/web/numberInput.g.d.ts +7 -0
- package/types/text/web/onboardingChecklist.g.d.ts +10 -0
- package/types/text/web/orgTree.g.d.ts +10 -0
- package/types/text/web/otpInput.g.d.ts +5 -0
- package/types/text/web/overflow.g.d.ts +4 -0
- package/types/text/web/pageHeader.g.d.ts +5 -0
- package/types/text/web/passwordRules.g.d.ts +11 -0
- package/types/text/web/periodPicker.g.d.ts +13 -0
- package/types/text/web/person.g.d.ts +4 -0
- package/types/text/web/phone.g.d.ts +12 -0
- package/types/text/web/phoneNumberInput.g.d.ts +6 -0
- package/types/text/web/pricingCard.g.d.ts +4 -0
- package/types/text/web/qrCode.g.d.ts +4 -0
- package/types/text/web/radio.g.d.ts +4 -0
- package/types/text/web/radioGroup.g.d.ts +5 -0
- package/types/text/web/rating.g.d.ts +8 -0
- package/types/text/web/recordPager.g.d.ts +6 -0
- package/types/text/web/relativeTime.g.d.ts +16 -0
- package/types/text/web/repeater.g.d.ts +5 -0
- package/types/text/web/richText.g.d.ts +25 -0
- package/types/text/web/routeError.g.d.ts +12 -0
- package/types/text/web/rowActions.g.d.ts +4 -0
- package/types/text/web/rowDrop.g.d.ts +5 -0
- package/types/text/web/savedViews.g.d.ts +19 -0
- package/types/text/web/scoreScale.g.d.ts +4 -0
- package/types/text/web/search.g.d.ts +6 -0
- package/types/text/web/sectionLeadCapture.g.d.ts +12 -0
- package/types/text/web/segmented.g.d.ts +4 -0
- package/types/text/web/select.g.d.ts +26 -0
- package/types/text/web/shell.g.d.ts +36 -0
- package/types/text/web/shortcutKeys.g.d.ts +10 -0
- package/types/text/web/showMore.g.d.ts +5 -0
- package/types/text/web/skeletonShapes.g.d.ts +4 -0
- package/types/text/web/slider.g.d.ts +9 -0
- package/types/text/web/sortable.g.d.ts +12 -0
- package/types/text/web/sortableList.g.d.ts +4 -0
- package/types/text/web/sparkline.g.d.ts +7 -0
- package/types/text/web/spinner.g.d.ts +4 -0
- package/types/text/web/splash.g.d.ts +4 -0
- package/types/text/web/splitButton.g.d.ts +4 -0
- package/types/text/web/splitView.g.d.ts +19 -0
- package/types/text/web/stepper.g.d.ts +5 -0
- package/types/text/web/switch.g.d.ts +4 -0
- package/types/text/web/tablePagination.g.d.ts +11 -0
- package/types/text/web/tableRows.g.d.ts +4 -0
- package/types/text/web/tableSelect.g.d.ts +5 -0
- package/types/text/web/tableToolbar.g.d.ts +8 -0
- package/types/text/web/tabs.g.d.ts +6 -0
- package/types/text/web/textarea.g.d.ts +5 -0
- package/types/text/web/themeToggle.g.d.ts +10 -0
- package/types/text/web/timePicker.g.d.ts +15 -0
- package/types/text/web/timeline.g.d.ts +4 -0
- package/types/text/web/toast.g.d.ts +9 -0
- package/types/text/web/tour.g.d.ts +12 -0
- package/types/text/web/tourAdvance.g.d.ts +4 -0
- package/types/text/web/tree.g.d.ts +5 -0
- package/types/text/web/unsavedChanges.g.d.ts +6 -0
- package/types/text/web/updateBar.g.d.ts +6 -0
- package/types/text/web/value.g.d.ts +4 -0
- package/types/text/web/whatsNew.g.d.ts +7 -0
- package/types/text/web/wizard.g.d.ts +16 -0
- package/types/text/web/workspaceSwitcher.g.d.ts +8 -0
- package/dist/WuiCarousel-BdhJLo1m.js +0 -1
- package/dist/WuiCodeBlock-7O514Hqe.js +0 -1
- package/dist/WuiCommandPalette-rVScJ2Hy.js +0 -2
- package/dist/WuiCommentThread-Bkb78uhy.js +0 -1
- package/dist/WuiConsentBanner-Bm7tT3_5.js +0 -1
- package/dist/WuiContextMenu-Fc9WCgM8.js +0 -1
- package/dist/WuiDataTable-Bb5hxTfn.js +0 -1
- package/dist/WuiDatePicker-D7tOu4kV.js +0 -31
- package/dist/WuiDateRange-D0pzZeUU.js +0 -25
- package/dist/WuiDrawer-BKNcc0WX.js +0 -1
- package/dist/WuiEntryGrid-DCVSZuPc.js +0 -1
- package/dist/WuiImageCrop-ChvH8GKb.js +0 -17
- package/dist/WuiInlineEdit-DwnXChDc.js +0 -1
- package/dist/WuiLeadPopup-BmZG0Fk_.js +0 -382
- package/dist/WuiLightbox-hw48EjHj.js +0 -1
- package/dist/WuiMentionInput-BCXdub58.js +0 -1
- package/dist/WuiNotificationCenter-BRomMzI2.js +0 -1
- package/dist/WuiOrgTree-DzeLFQxy.js +0 -1
- package/dist/WuiOverflow-CV5y5zkM.js +0 -1
- package/dist/WuiPhone-BKxBok5L.js +0 -16
- package/dist/WuiRecordPager-7HVGoFlP.js +0 -1
- package/dist/WuiSavedViews-CdjavvPC.js +0 -1
- package/dist/WuiSelect-CKfM5kWG.js +0 -9
- package/dist/WuiShortcuts-Wiv_zufK.js +0 -1
- package/dist/WuiShowMore-CvdNQXrA.js +0 -1
- package/dist/WuiSlider-Cz5-zWC7.js +0 -51
- package/dist/WuiSortable-CBLMNRuZ.js +0 -1
- package/dist/WuiTimePicker-DAS2sxSH.js +0 -9
- package/dist/WuiTour-CAVM3O8-.js +0 -1
- package/dist/WuiTree-BPT9EZuw.js +0 -1
- package/dist/WuiWizardStep-Cencr-mT.js +0 -1
- package/dist/calendarMath-D6UUgYTD.js +0 -1
- package/dist/chips-DjccCG3b.js +0 -2
- package/dist/commentText-BnX7rA2-.js +0 -1
- package/dist/country-x5lqC5Xu.js +0 -1
- package/dist/customRule-Chp7YwFb.js +0 -1
- package/dist/dataTable-CcH1lBIM.js +0 -1
- package/dist/drawerDiscard-C1We4r_2.js +0 -1
- package/dist/fileViewerImage-CVHV1fBb.js +0 -3
- package/dist/fileViewerMedia-DGnbWDXP.js +0 -1
- package/dist/fileViewerPdf-BxoLE4hd.js +0 -20
- package/dist/fileViewerUi-2ZoK9uX0.js +0 -1
- package/dist/formatters-ljfITOZ3.js +0 -1
- package/dist/iconGlyphs.g-DPqoOoXy.js +0 -1
- package/dist/inlineEditText-CDptpqmI.js +0 -1
- package/dist/kanban-CDaks135.js +0 -1
- package/dist/kanbanModel-BaT75e-b.js +0 -1
- package/dist/nativeOverlay-BsVSWs1q.js +0 -1
- package/dist/notificationDays-BIWczft0.js +0 -1
- package/dist/recents-Dcw-b5cB.js +0 -1
- package/dist/relativeTime-BahImc8F.js +0 -1
- package/dist/search-Du-vK_9z.js +0 -1
- package/dist/shortcutKeys-COVLox98.js +0 -1
- package/dist/themeTransition-Dt7Br1QT.js +0 -1
- package/dist/zone-BR02ZkHF.js +0 -1
|
@@ -1,382 +0,0 @@
|
|
|
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(e){if(!(e instanceof DOMException))throw e}}_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(e){if(!(e instanceof DOMException))throw e}}};export{P as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./elementBase-Cxeyx0tU.js";import{f as t}from"./formatters-ljfITOZ3.js";import{t as n}from"./iconGlyphs.g-DPqoOoXy.js";import{u as r}from"./nativeOverlay-BsVSWs1q.js";var i=`a.wui-lightbox-item`,a=1,o=4,s=.5,c=2,l=50,u=6,d=300,f=300;function p(e){return Number.isFinite(e)?Math.min(o,Math.max(a,e)):a}function m(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 h(e,t){return Math.abs(e)<l||Math.abs(e)<Math.abs(t)*1.5?0:e<0?1:-1}function g(e){let t=(String(e??``).split(/[?#]/)[0]??``).split(`/`).filter(Boolean).pop()??``;try{return decodeURIComponent(t)}catch{return t}}function _(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 v(e,t,r){let i=_(`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 y=class extends e{_ui;_index;_zoom;_pan;_pointers;_gesture;_lastTap;_returnTo;_release;_onClick;static get observedAttributes(){return[`open-index`]}constructor(){super(),this._ui=null,this._index=0,this._zoom=a,this._pan={x:0,y:0},this._pointers=/* @__PURE__ */ new Map,this._gesture=null,this._lastTap=-1/0,this._returnTo=null,this._release=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(i):null;if(!(n instanceof HTMLAnchorElement)||!this.contains(n))return;let r=this._links().indexOf(n);r<0||(e.preventDefault(),this.open(r))}}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(i)].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||g(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),!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._release?.(),this._release=null,this._ui.root.open&&this._ui.root.close(),this._ui.root.remove(),this._ui=null,this._pointers.clear(),this._gesture=null)}_build(){let e=_(`dialog`,`wui-lightbox-overlay`,{role:`dialog`,"aria-label":this.label,tabindex:`-1`}),t=_(`div`,`wui-lightbox-bar`),i=_(`span`,`wui-lightbox-count`,{"aria-live":`polite`}),a=_(`div`,`wui-lightbox-tools`),o=v(`zoom-out`,`Zoom out`,`wui-lightbox-zoom-out`),c=v(`zoom-in`,`Zoom in`,`wui-lightbox-zoom-in`),l=_(`a`,`u-action wui-lightbox-btn wui-lightbox-download`,{"aria-label":`Download`,title:`Download`});l.style.setProperty(`--wui-action-size`,`40px`),l.innerHTML=n(`download`,{size:20}),l.hidden=!this.download;let u=v(`x`,`Close`,`wui-lightbox-close`);a.append(o,c,l,u),t.append(i,a);let d=_(`div`,`wui-lightbox-stage`),f=v(`chevron-left`,`Previous image`,`wui-lightbox-nav wui-lightbox-prev`),p=v(`chevron-right`,`Next image`,`wui-lightbox-nav wui-lightbox-next`),m=_(`img`,`wui-lightbox-image`,{decoding:`async`,draggable:`false`,alt:``}),h=_(`p`,`wui-lightbox-status`,{role:`status`});d.append(m,h,f,p);let g=_(`p`,`wui-lightbox-caption`);e.append(t,d,g);let y={root:e,count:i,zoomOut:o,zoomIn:c,download:l,close:u,stage:d,prev:f,next:p,image:m,status:h,caption:g};this._ui=y,u.addEventListener(`click`,()=>this.close()),f.addEventListener(`click`,()=>this.step(-1)),p.addEventListener(`click`,()=>this.step(1)),o.addEventListener(`click`,()=>this._setZoom(this._zoom-s)),c.addEventListener(`click`,()=>this._setZoom(this._zoom+s)),e.addEventListener(`keydown`,e=>this._onKeyDown(e)),d.addEventListener(`pointerdown`,e=>this._onPointerDown(e)),d.addEventListener(`pointermove`,e=>this._onPointerMove(e)),d.addEventListener(`pointerup`,e=>this._onPointerEnd(e,!0)),d.addEventListener(`pointercancel`,e=>this._onPointerEnd(e,!1)),d.addEventListener(`wheel`,e=>this._onWheel(e),{passive:!1}),m.addEventListener(`load`,()=>{this._ui===y&&(h.textContent=``,d.removeAttribute(`aria-busy`),m.hidden=!1,this._applyTransform())}),m.addEventListener(`error`,()=>{this._ui===y&&(d.removeAttribute(`aria-busy`),m.hidden=!0,h.textContent=`This image can't be shown.`)}),this.append(e),this._release=r(e,{escape:!0,backdrop:!1,focus:`panel`,onRequestClose:()=>this.close()})}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,i=Math.min(n.length-1,Math.max(0,Math.trunc(Number(e))||0)),o=n[i];if(!o)throw Error(`<wui-lightbox> image missing.`);let s=i!==this._index||!r.image.getAttribute(`src`);if(this._index=i,this._zoom=a,this._pan={x:0,y:0},r.count.textContent=`${t(i+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[(i+1)%n.length],t=n[(i-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:i}}))}_syncZoomButtons(){let e=this._view;e.zoomOut.disabled=this._zoom<=a,e.zoomIn.disabled=this._zoom>=o;let t=document.activeElement;(t===e.zoomOut||t===e.zoomIn)&&t instanceof HTMLButtonElement&&t.disabled&&e.close.focus()}_setZoom(e){this._ui&&(this._zoom=p(e),this._pan=this._clampedPan(this._pan),this._applyTransform(),this._syncZoomButtons())}_clampedPan(e){let{stage:t,image:n}=this._view;return m(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>a)}_onKeyDown(e){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+s)):e.key===`-`?(e.preventDefault(),this._setZoom(this._zoom-s)):e.key===`0`&&(e.preventDefault(),this._setZoom(a))}_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)>u&&(t.moved=!0),this._zoom>a&&(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,i=e.clientY-n.startY;n.moved?this._zoom===a&&this.step(h(r,i)):e.timeStamp-n.startTime>d||(n.onImage?e.timeStamp-this._lastTap<f?(this._lastTap=-1/0,this._setZoom(this._zoom>a?a:c)):this._lastTap=e.timeStamp:this.close())}};export{y as t};
|
|
@@ -1 +0,0 @@
|
|
|
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{f as i}from"./formatters-ljfITOZ3.js";import{t as a}from"./imeSafeEnter-DPs9qL3S.js";import{n as o}from"./listboxKeyNav-CF7tMDGG.js";import{i as s,n as c,r as l,t as u}from"./mentionText-BJsw_opZ.js";import{a as d,l as f,s as p}from"./nativeOverlay-BsVSWs1q.js";import{l as m}from"./wuiHttp-DGbD7Fra.js";var h=8,g=40,_=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`:`${i(e,{decimals:0})} people`}. Up and down to choose, Enter to mention.`,mentioned:e=>`Mentioned ${e}.`}),v=`[data-wui-control]`,y=`[data-wui-field]`,b=`[data-wui-menu]`,x=`[data-wui-live]`,S=0,C=e=>!!(e&&u.test(String(e.value??``))&&c(e.label)!==``);function w(e,t){let n=e.getAttribute(`size`);t.classList.toggle(`input-sm`,n===`sm`),t.classList.toggle(`input-lg`,n===`lg`)}function T(e,n){n.readOnly=t(e)||e.hasAttribute(`loading`)}function E(e){let t=e.ownerDocument;e.id||=`wui-mention-${++S}`;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`),T(e,n),w(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`)??_.listName),o.setAttribute(`data-wui-menu`,``),o.setAttribute(`popover`,`manual`),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 D=class extends e{_wired;_pendingValue;_text;_mentions;_peopleProp;_declared;_loading;_searchFailed;_query;_results;_active;_timer;_searchSeq;_lastSearch;_abort;_onMenuDown;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)}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(v)||E(this);let e=this._requireControl(),t=this.querySelector(y)?.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`?(T(this,r),n!==null&&this._close(),this._syncState()):e===`loading`?(T(this,r),this._syncState(),this._query!==null&&this._renderMenu()):e===`size`?w(this,r):n===null?r.removeAttribute(e):r.setAttribute(e,n))}get value(){return s(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(C):[],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(v)}_menu(){return this.querySelector(b)}_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}=l(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(y);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||r(this)||e.selectionStart!==e.selectionEnd)return null;let t=e.selectionStart,n=this._text,i=n.lastIndexOf(`@`,t-1);if(i<0||i>0&&!/[\s([{"'“‘]/.test(n.charAt(i-1)))return null;let a=n.slice(i+1,t);return a.length>40||/[\n@]/.test(a)||/^\s/.test(a)||/\s{2}/.test(a)||this._mentions.some(e=>i>=e.start&&i<e.end)?null:{start:i,end:t,text:a}}_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=>c(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 m(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(C),this.loading=!1,this._refresh()}_isOpen(){let e=this._menu();return e!==null&&p(e)}_renderMenu(){let e=this._menu(),t=this._control();if(!e||!t||!this._query)return;this._syncState();let n=this.ownerDocument;if(e.replaceChildren(),this._results.forEach((t,r)=>{let i=n.createElement(`div`);if(i.className=`wui-mention-option`,i.id=`${e.id}-${r}`,i.setAttribute(`role`,`option`),i.setAttribute(`aria-selected`,`false`),i.dataset.index=String(r),t.src){let e=n.createElement(`img`);e.className=`wui-mention-option-photo`,e.src=t.src,e.alt=``,i.appendChild(e)}let a=n.createElement(`span`);a.className=`wui-mention-option-text`;let o=n.createElement(`span`);if(o.className=`wui-mention-option-label`,o.textContent=c(t.label),a.appendChild(o),t.description){let e=n.createElement(`span`);e.className=`wui-mention-option-description`,e.textContent=String(t.description),a.appendChild(e)}i.appendChild(a),e.appendChild(i)}),!this._results.length){let t=n.createElement(`div`);t.className=`wui-mention-empty`,t.textContent=this.loading?_.searching:this._searchFailed?_.searchFailed:`${_.noMatch} “${this._query.text}”`,e.appendChild(t)}f(t,e,{mode:`manual`}),this._setActive(this._results.length?0:-1),this.loading||this._announce(this._results.length?_.found(this._results.length):this._searchFailed?_.searchFailed:`${_.noMatch}.`)}_syncState(){let e=this._control();e&&n(this,e)}_close(){this._query=null,this._lastSearch=void 0,clearTimeout(this._timer);let e=this._menu();if(e){let t=p(e);d(e),t&&e.replaceChildren()}this._active=-1,this._control()?.removeAttribute(`aria-activedescendant`)}_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`);o(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((a(e)||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}}a(e)&&(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=c(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(_.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(x);t&&(t.textContent=``,t.textContent=e)}};export{D as i,h as n,_ as r,g as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./dom-Do1pAA12.js";import{t}from"./elementBase-Cxeyx0tU.js";import{t as n}from"./isDrawn-BbF4phmB.js";import{a as r,l as i,m as a,s as o}from"./nativeOverlay-BsVSWs1q.js";import{c as s,i as c,n as l,s as u}from"./notificationDays-BIWczft0.js";import{l as d}from"./wuiHttp-DGbD7Fra.js";var f=`.wui-notification-center-trigger`,p=`.wui-notification-center-panel`,m=`.wui-notification-center-count`,h=`.wui-notification-center-live`,g=`.wui-notification-center-markall`,_=`.wui-notification-center-item`,v=`wui-notification-center-item-read`,y=`.wui-notification-center-unread-label`,b=`.app-tabs`,x=`.wui-notification-center-tabs [role='tablist']`,S=`.wui-notification-center-tabs [role='tab']`,C=`.wui-notification-center-empty`,w=`(max-width: 767.98px)`,T={ArrowDown:1,ArrowUp:-1,Home:`first`,End:`last`},E=e=>!!e,D=e=>Object.hasOwn(l.failed,e),O=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLElement?n:null},k=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement),A=class extends t{constructor(){super(),this._unread=0,this._busy=!1,this._sheet=!1,this._awaitChildren=null,this._onClick=e=>this._click(e),this._onKeyDown=e=>this._key(e),this._onToggle=e=>{e.type===`toggle`&&`newState`in e&&e.newState===`closed`&&this._closedByBrowser()},this._onFocusOut=e=>{let t=e.relatedTarget;t instanceof Node&&!this.contains(t)&&this.close()}}static get observedAttributes(){return[`open`]}connectedCallback(){this._unread=this._initialUnread(),this.addEventListener(`click`,this._onClick),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`focusout`,this._onFocusOut),this.addEventListener(`toggle`,this._onToggle,!0),this.isOpen&&(O(this,p)===null||O(this,f)===null)?(this._awaitChildren=new MutationObserver(()=>this._finishAwaitedOpen()),this._awaitChildren.observe(this,{childList:!0})):(this._syncOpen(),this.isOpen&&this._showPanel())}disconnectedCallback(){this._disarmAwait(),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`focusout`,this._onFocusOut),this.removeEventListener(`toggle`,this._onToggle,!0);let e=O(this,p);e&&r(e)}attributeChangedCallback(e,t,n){e===`open`&&t!==n&&(this._awaitChildren?n===null&&this._disarmAwait():this.isConnected&&(n===null?this._hidePanel():this._showPanel()))}_finishAwaitedOpen(){O(this,p)!==null&&O(this,f)!==null&&(this._disarmAwait(),this._syncOpen(),this._showPanel())}_disarmAwait(){this._awaitChildren?.disconnect(),this._awaitChildren=null}_showPanel(){let t=e(O(this,p),`<wui-notification-center> needs its panel to open.`),n=e(O(this,f),`<wui-notification-center> needs its trigger to open.`);o(t)||(this._sheet=window.matchMedia(w).matches,this._sheet?a(t,!0):i(n,t,{mode:`auto`,onClosed:()=>this._closedByBrowser()}),o(t)&&this._layoutTabs())}_hidePanel(){let e=O(this,p);e&&o(e)&&(this._sheet?a(e,!1):r(e))}_closedByBrowser(){if(!this.isConnected||!this.hasAttribute(`open`))return;let e=O(this,p);this.close({restoreFocus:e?.contains(this.ownerDocument.activeElement)??!1})}get isOpen(){return this.hasAttribute(`open`)}open(){this.isOpen||(e(O(this,p),`<wui-notification-center> needs its panel to open.`),e(O(this,f),`<wui-notification-center> needs its trigger to open.`),this.setAttribute(`open`,``),this._syncOpen(),O(this,p)?.focus(),this._announceToggle())}close({restoreFocus:e=!1}={}){this.isOpen&&(this.removeAttribute(`open`),this._syncOpen(),e&&O(this,f)?.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(f)?.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(`${_}:not(.${v}):not([data-archived="true"])`).length}_click(e){let t=e.target;if(!(t instanceof Element))return;let n=t.closest(S);if(n instanceof HTMLElement&&this.contains(n)){if(this.hasAttribute(`controlled`))return;this._pickTab(n);return}let r=t.closest(`${f}, ${g}, ${_}`);r instanceof HTMLElement&&this.contains(r)&&(r.matches(f)?this.toggle():this.hasAttribute(`controlled`)||(r.matches(g)?this._markAll():this._markItem(r)))}_key(e){if(!this.isOpen)return;let t=e.target;if(!(t instanceof Element))throw Error(`Keyboard event target is not an element.`);if(!this.querySelector(p)?.contains(t)||t.closest(b))return;let r=T[e.key];if(r===void 0)return;let i=k(this,_).filter(n);if(i.length===0)return;let a=t.closest(_),o=a instanceof HTMLElement?i.indexOf(a):-1,s;s=r===`first`?0:r===`last`?i.length-1:o===-1?r===1?0:i.length-1:Math.min(i.length-1,Math.max(0,o+r)),e.preventDefault(),i[s]?.focus()}_markItem(e){e.classList.contains(v)||(this._applyRead(e),e.dataset.archived!==`true`&&(this._unread=Math.max(0,this._unread-1)),this._render(),this._say(s(this._unread)),this._emitRead([e.dataset.id].filter(E),!1))}async _markAll(){if(this._busy)return;let e=k(this,`${_}:not(.${v})`);if(e.length===0&&this._unread===0)return;let t=e.map(e=>e.dataset.id).filter(E),n=this.getAttribute(`read-action`);if(n){this._setBusy(!0);let e=new URLSearchParams;for(let n of t)e.append(`ids`,n);let r=await d(n,{method:`POST`,body:e});if(this._setBusy(!1),!r.ok){if(r.kind===`session`||r.kind===`aborted`)return;let e=r.kind,t=r.message||(D(e)?l.failed[e]:l.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(l.allRead),this._emitRead(t,!0)}_pickTab(e){let t=e.closest(x);if(t instanceof HTMLElement){for(let n of k(t,S)){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 k(this,x)){let t=O(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 k(this,_)){let r=n.dataset.archived===`true`,i=n.classList.contains(v),a=e===`archived`?r:!r&&(e!==`unread`||!i);a&&(t=!0);let o=n.closest(`li`);o&&(o.hidden=!a)}for(let e of k(this,`.wui-notification-center-list section`))e.hidden=[...e.querySelectorAll(`li`)].every(e=>e.hidden);let n=O(this,C);n&&(n.hidden=t)}_applyRead(e){e.classList.add(v),e.querySelector(y)?.remove()}_setBusy(e){this._busy=e;let t=this.querySelector(g);t instanceof HTMLButtonElement&&(t.disabled=e||this._unread===0,e?t.setAttribute(`aria-busy`,`true`):t.removeAttribute(`aria-busy`))}_render(){let e=O(this,m);e&&(e.textContent=c(this._unread),e.hidden=this._unread===0),this.querySelector(f)?.setAttribute(`aria-label`,u(this.getAttribute(`label`)||l.label,this._unread));let t=this.querySelector(g);t instanceof HTMLButtonElement&&(t.disabled=this._unread===0)}_say(e){let t=this.querySelector(h);t&&(t.textContent=e)}_emitRead(e,t){this.dispatchEvent(new CustomEvent(`wui:notification-center:read`,{bubbles:!0,detail:{ids:e,all:t}}))}};export{A as t};
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./anchorOverlay-B8fu8hjz.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=`data-wui-overflow-menu`,l=`[aria-haspopup], [data-wui-dropdown-trigger]`,u=0,d=e=>Number.parseFloat(e)||0,f=e=>e.nodeType===1,p=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 f(t)&&!t.matches(`svg, img, [aria-hidden='true'], [data-wui-dropdown-menu]`)&&r(t)};if(r(e),n.length)return n.join(` `);let i=m(e)??e;return i.getAttribute(`aria-label`)||e.getAttribute(`aria-label`)||i.title||e.title},m=e=>{if(e.matches(`button, a[href], label, input`))return e;let t=e.querySelector(o);return t instanceof HTMLElement?t:null},h=e=>{let t=m(e);return t?.matches(l)?t:null},g=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-${++u}`,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),e.removeAttribute(c);this._more.hidden=!0;let n=this.clientWidth,r=[];if(t.length&&n<=0&&this.getClientRects().length>0)r=t;else if(n>0&&t.length){let i=getComputedStyle(e),o=d(i.columnGap),c=d(i.paddingLeft)+d(i.paddingRight)+d(i.borderLeftWidth)+d(i.borderRightWidth),l=t.map(e=>e.offsetWidth);if(l.reduce((e,t)=>e+t,0)+o*(t.length-1)>n-c+s){this._more.hidden=!1;let e=n-c-this._more.offsetWidth-d(getComputedStyle(this).columnGap),i=this.hasAttribute(`keep`)?this.getAttribute(`keep`):a,s=/* @__PURE__ */ new Set,u=0,f=0,p=i?t.filter(e=>e.matches(i)):[];for(let n of p){let r=u+(l[t.indexOf(n)]??0)+(f?o:0);r>e||(s.add(n),u=r,f+=1)}for(let n=0;n<t.length;n+=1){let r=t[n];if(!r||s.has(r))continue;let i=u+(l[n]??0)+(f?o:0);if(i>e)break;s.add(r),u=i,f+=1}r=t.filter(e=>!s.has(e))}}for(let e of r)e.setAttribute(i,``),h(e)&&e.setAttribute(c,``);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=m(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=p(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=h(e)?.isConnected?e.querySelector(`.dropdown-item:not([aria-disabled='true'])`):null;if(n){n.focus();return}let r=!e.hasAttribute(i)&&e.matches(`button, a[href]`)?e:this._more;r.hidden||r.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{g as t};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./countries-DQL9nAUt.js";import{t as n}from"./devWarn-DXdRWZs3.js";import{t as r}from"./elementBase-Cxeyx0tU.js";import{r as i,t as a}from"./fieldState-D-zQcXUS.js";import{t as o}from"./formMirror-9IpSgeZb.js";import{t as s}from"./iconGlyphs.g-DPqoOoXy.js";import{t as c}from"./imeSafeEnter-DPs9qL3S.js";import{n as l}from"./listboxKeyNav-CF7tMDGG.js";import{a as u,l as d,s as f}from"./nativeOverlay-BsVSWs1q.js";var p={AD:[`Europe/Andorra`],AE:[`Asia/Dubai`],AF:[`Asia/Kabul`],AG:[`America/Antigua`],AI:[`America/Anguilla`],AL:[`Europe/Tirane`],AM:[`Asia/Yerevan`],AO:[`Africa/Luanda`],AR:[`America/Argentina/Buenos_Aires`,`America/Argentina/Catamarca`,`America/Argentina/ComodRivadavia`,`America/Argentina/Cordoba`,`America/Argentina/Jujuy`,`America/Argentina/La_Rioja`,`America/Argentina/Mendoza`,`America/Argentina/Rio_Gallegos`,`America/Argentina/Salta`,`America/Argentina/San_Juan`,`America/Argentina/San_Luis`,`America/Argentina/Tucuman`,`America/Argentina/Ushuaia`,`America/Buenos_Aires`,`America/Catamarca`,`America/Cordoba`,`America/Jujuy`,`America/Mendoza`,`America/Rosario`],AS:[`Pacific/Pago_Pago`,`Pacific/Samoa`,`US/Samoa`],AT:[`Europe/Vienna`],AU:[`Antarctica/Macquarie`,`Australia/Adelaide`,`Australia/Brisbane`,`Australia/Broken_Hill`,`Australia/Canberra`,`Australia/Currie`,`Australia/Darwin`,`Australia/Eucla`,`Australia/Hobart`,`Australia/LHI`,`Australia/Lindeman`,`Australia/Lord_Howe`,`Australia/Melbourne`,`Australia/NSW`,`Australia/North`,`Australia/Perth`,`Australia/Queensland`,`Australia/South`,`Australia/Sydney`,`Australia/Tasmania`,`Australia/Victoria`,`Australia/West`,`Australia/Yancowinna`],AW:[`America/Aruba`],AX:[`Europe/Mariehamn`],AZ:[`Asia/Baku`],BA:[`Europe/Sarajevo`],BB:[`America/Barbados`],BD:[`Asia/Dacca`,`Asia/Dhaka`],BE:[`Europe/Brussels`],BF:[`Africa/Ouagadougou`],BG:[`Europe/Sofia`],BH:[`Asia/Bahrain`],BI:[`Africa/Bujumbura`],BJ:[`Africa/Porto-Novo`],BL:[`America/St_Barthelemy`],BM:[`Atlantic/Bermuda`],BN:[`Asia/Brunei`],BO:[`America/La_Paz`],BQ:[`America/Kralendijk`],BR:[`America/Araguaina`,`America/Bahia`,`America/Belem`,`America/Boa_Vista`,`America/Campo_Grande`,`America/Cuiaba`,`America/Eirunepe`,`America/Fortaleza`,`America/Maceio`,`America/Manaus`,`America/Noronha`,`America/Porto_Acre`,`America/Porto_Velho`,`America/Recife`,`America/Rio_Branco`,`America/Santarem`,`America/Sao_Paulo`,`Brazil/DeNoronha`,`Brazil/East`,`Brazil/West`],BS:[`America/Nassau`],BT:[`Asia/Thimbu`,`Asia/Thimphu`],BW:[`Africa/Gaborone`],BY:[`Europe/Minsk`],BZ:[`America/Belize`],CA:/* @__PURE__ */ `America/Atikokan.America/Blanc-Sablon.America/Cambridge_Bay.America/Coral_Harbour.America/Creston.America/Dawson.America/Dawson_Creek.America/Edmonton.America/Fort_Nelson.America/Glace_Bay.America/Goose_Bay.America/Halifax.America/Inuvik.America/Iqaluit.America/Moncton.America/Montreal.America/Nipigon.America/Pangnirtung.America/Rainy_River.America/Rankin_Inlet.America/Regina.America/Resolute.America/St_Johns.America/Swift_Current.America/Thunder_Bay.America/Toronto.America/Vancouver.America/Whitehorse.America/Winnipeg.America/Yellowknife.Canada/Atlantic.Canada/Central.Canada/Eastern.Canada/Mountain.Canada/Newfoundland.Canada/Pacific.Canada/Saskatchewan.Canada/Yukon`.split(`.`),CC:[`Indian/Cocos`],CD:[`Africa/Kinshasa`,`Africa/Lubumbashi`],CF:[`Africa/Bangui`],CG:[`Africa/Brazzaville`],CH:[`Europe/Zurich`],CI:[`Africa/Abidjan`],CK:[`Pacific/Rarotonga`],CL:[`America/Coyhaique`,`America/Punta_Arenas`,`America/Santiago`,`Chile/Continental`,`Chile/EasterIsland`,`Pacific/Easter`],CM:[`Africa/Douala`],CN:[`Asia/Chongqing`,`Asia/Harbin`,`Asia/Kashgar`,`Asia/Shanghai`,`Asia/Urumqi`],CO:[`America/Bogota`],CR:[`America/Costa_Rica`],CU:[`America/Havana`],CV:[`Atlantic/Cape_Verde`],CW:[`America/Curacao`],CX:[`Indian/Christmas`],CY:[`Asia/Famagusta`,`Asia/Nicosia`,`Europe/Nicosia`],CZ:[`Europe/Prague`],DE:[`Europe/Berlin`,`Europe/Busingen`],DJ:[`Africa/Djibouti`],DK:[`Europe/Copenhagen`],DM:[`America/Dominica`],DO:[`America/Santo_Domingo`],DZ:[`Africa/Algiers`],EC:[`America/Guayaquil`,`Pacific/Galapagos`],EE:[`Europe/Tallinn`],EG:[`Africa/Cairo`],EH:[`Africa/El_Aaiun`],ER:[`Africa/Asmara`,`Africa/Asmera`],ES:[`Africa/Ceuta`,`Atlantic/Canary`,`Europe/Madrid`],ET:[`Africa/Addis_Ababa`],FI:[`Europe/Helsinki`],FJ:[`Pacific/Fiji`],FK:[`Atlantic/Stanley`],FM:[`Pacific/Chuuk`,`Pacific/Kosrae`,`Pacific/Pohnpei`,`Pacific/Ponape`,`Pacific/Truk`,`Pacific/Yap`],FO:[`Atlantic/Faeroe`,`Atlantic/Faroe`],FR:[`Europe/Paris`],GA:[`Africa/Libreville`],GB:[`Europe/Belfast`,`Europe/London`],GD:[`America/Grenada`],GE:[`Asia/Tbilisi`],GF:[`America/Cayenne`],GG:[`Europe/Guernsey`],GH:[`Africa/Accra`],GI:[`Europe/Gibraltar`],GL:[`America/Danmarkshavn`,`America/Godthab`,`America/Nuuk`,`America/Scoresbysund`,`America/Thule`],GM:[`Africa/Banjul`],GN:[`Africa/Conakry`],GP:[`America/Guadeloupe`],GQ:[`Africa/Malabo`],GR:[`Europe/Athens`],GT:[`America/Guatemala`],GU:[`Pacific/Guam`],GW:[`Africa/Bissau`],GY:[`America/Guyana`],HK:[`Asia/Hong_Kong`],HN:[`America/Tegucigalpa`],HR:[`Europe/Zagreb`],HT:[`America/Port-au-Prince`],HU:[`Europe/Budapest`],ID:[`Asia/Jakarta`,`Asia/Jayapura`,`Asia/Makassar`,`Asia/Pontianak`,`Asia/Ujung_Pandang`],IE:[`Europe/Dublin`],IL:[`Asia/Jerusalem`,`Asia/Tel_Aviv`],IM:[`Europe/Isle_of_Man`],IN:[`Asia/Calcutta`,`Asia/Kolkata`],IO:[`Indian/Chagos`],IQ:[`Asia/Baghdad`],IR:[`Asia/Tehran`],IS:[`Atlantic/Reykjavik`],IT:[`Europe/Rome`],JE:[`Europe/Jersey`],JM:[`America/Jamaica`],JO:[`Asia/Amman`],JP:[`Asia/Tokyo`],KE:[`Africa/Nairobi`],KG:[`Asia/Bishkek`],KH:[`Asia/Phnom_Penh`],KI:[`Pacific/Enderbury`,`Pacific/Kanton`,`Pacific/Kiritimati`,`Pacific/Tarawa`],KM:[`Indian/Comoro`],KN:[`America/St_Kitts`],KP:[`Asia/Pyongyang`],KR:[`Asia/Seoul`],KW:[`Asia/Kuwait`],KY:[`America/Cayman`],KZ:[`Asia/Almaty`,`Asia/Aqtau`,`Asia/Aqtobe`,`Asia/Atyrau`,`Asia/Oral`,`Asia/Qostanay`,`Asia/Qyzylorda`],LA:[`Asia/Vientiane`],LB:[`Asia/Beirut`],LC:[`America/St_Lucia`],LI:[`Europe/Vaduz`],LK:[`Asia/Colombo`],LR:[`Africa/Monrovia`],LS:[`Africa/Maseru`],LT:[`Europe/Vilnius`],LU:[`Europe/Luxembourg`],LV:[`Europe/Riga`],LY:[`Africa/Tripoli`],MA:[`Africa/Casablanca`],MC:[`Europe/Monaco`],MD:[`Europe/Chisinau`,`Europe/Tiraspol`],ME:[`Europe/Podgorica`],MF:[`America/Marigot`],MG:[`Indian/Antananarivo`],MH:[`Pacific/Kwajalein`,`Pacific/Majuro`],MK:[`Europe/Skopje`],ML:[`Africa/Bamako`,`Africa/Timbuktu`],MM:[`Asia/Rangoon`,`Asia/Yangon`],MN:[`Asia/Choibalsan`,`Asia/Hovd`,`Asia/Ulaanbaatar`,`Asia/Ulan_Bator`],MO:[`Asia/Macao`,`Asia/Macau`],MP:[`Pacific/Saipan`],MQ:[`America/Martinique`],MR:[`Africa/Nouakchott`],MS:[`America/Montserrat`],MT:[`Europe/Malta`],MU:[`Indian/Mauritius`],MV:[`Indian/Maldives`],MW:[`Africa/Blantyre`],MX:[`America/Bahia_Banderas`,`America/Cancun`,`America/Chihuahua`,`America/Ciudad_Juarez`,`America/Ensenada`,`America/Hermosillo`,`America/Matamoros`,`America/Mazatlan`,`America/Merida`,`America/Mexico_City`,`America/Monterrey`,`America/Ojinaga`,`America/Santa_Isabel`,`America/Tijuana`,`Mexico/BajaNorte`,`Mexico/BajaSur`,`Mexico/General`],MY:[`Asia/Kuala_Lumpur`,`Asia/Kuching`],MZ:[`Africa/Maputo`],NA:[`Africa/Windhoek`],NC:[`Pacific/Noumea`],NE:[`Africa/Niamey`],NF:[`Pacific/Norfolk`],NG:[`Africa/Lagos`],NI:[`America/Managua`],NL:[`Europe/Amsterdam`],NO:[`Europe/Oslo`],NP:[`Asia/Kathmandu`,`Asia/Katmandu`],NR:[`Pacific/Nauru`],NU:[`Pacific/Niue`],NZ:[`Pacific/Auckland`,`Pacific/Chatham`],OM:[`Asia/Muscat`],PA:[`America/Panama`],PE:[`America/Lima`],PF:[`Pacific/Gambier`,`Pacific/Marquesas`,`Pacific/Tahiti`],PG:[`Pacific/Bougainville`,`Pacific/Port_Moresby`],PH:[`Asia/Manila`],PK:[`Asia/Karachi`],PL:[`Europe/Warsaw`],PM:[`America/Miquelon`],PR:[`America/Puerto_Rico`],PS:[`Asia/Gaza`,`Asia/Hebron`],PT:[`Atlantic/Azores`,`Atlantic/Madeira`,`Europe/Lisbon`],PW:[`Pacific/Palau`],PY:[`America/Asuncion`],QA:[`Asia/Qatar`],RE:[`Indian/Reunion`],RO:[`Europe/Bucharest`],RS:[`Europe/Belgrade`],RU:/* @__PURE__ */ `Asia/Anadyr.Asia/Barnaul.Asia/Chita.Asia/Irkutsk.Asia/Kamchatka.Asia/Khandyga.Asia/Krasnoyarsk.Asia/Magadan.Asia/Novokuznetsk.Asia/Novosibirsk.Asia/Omsk.Asia/Sakhalin.Asia/Srednekolymsk.Asia/Tomsk.Asia/Ust-Nera.Asia/Vladivostok.Asia/Yakutsk.Asia/Yekaterinburg.Europe/Astrakhan.Europe/Kaliningrad.Europe/Kirov.Europe/Moscow.Europe/Samara.Europe/Saratov.Europe/Ulyanovsk.Europe/Volgograd`.split(`.`),RW:[`Africa/Kigali`],SA:[`Asia/Riyadh`],SB:[`Pacific/Guadalcanal`],SC:[`Indian/Mahe`],SD:[`Africa/Khartoum`],SE:[`Europe/Stockholm`],SG:[`Asia/Singapore`],SH:[`Atlantic/St_Helena`],SI:[`Europe/Ljubljana`],SJ:[`Arctic/Longyearbyen`,`Atlantic/Jan_Mayen`],SK:[`Europe/Bratislava`],SL:[`Africa/Freetown`],SM:[`Europe/San_Marino`],SN:[`Africa/Dakar`],SO:[`Africa/Mogadishu`],SR:[`America/Paramaribo`],SS:[`Africa/Juba`],ST:[`Africa/Sao_Tome`],SV:[`America/El_Salvador`],SX:[`America/Lower_Princes`],SY:[`Asia/Damascus`],SZ:[`Africa/Mbabane`],TC:[`America/Grand_Turk`],TD:[`Africa/Ndjamena`],TG:[`Africa/Lome`],TH:[`Asia/Bangkok`],TJ:[`Asia/Dushanbe`],TK:[`Pacific/Fakaofo`],TL:[`Asia/Dili`],TM:[`Asia/Ashgabat`,`Asia/Ashkhabad`],TN:[`Africa/Tunis`],TO:[`Pacific/Tongatapu`],TR:[`Asia/Istanbul`,`Europe/Istanbul`],TT:[`America/Port_of_Spain`],TV:[`Pacific/Funafuti`],TW:[`Asia/Taipei`],TZ:[`Africa/Dar_es_Salaam`],UA:[`Europe/Kiev`,`Europe/Kyiv`,`Europe/Simferopol`,`Europe/Uzhgorod`,`Europe/Zaporozhye`],UG:[`Africa/Kampala`],US:/* @__PURE__ */ `America/Adak.America/Anchorage.America/Atka.America/Boise.America/Chicago.America/Denver.America/Detroit.America/Fort_Wayne.America/Indiana/Indianapolis.America/Indiana/Knox.America/Indiana/Marengo.America/Indiana/Petersburg.America/Indiana/Tell_City.America/Indiana/Vevay.America/Indiana/Vincennes.America/Indiana/Winamac.America/Indianapolis.America/Juneau.America/Kentucky/Louisville.America/Kentucky/Monticello.America/Knox_IN.America/Los_Angeles.America/Louisville.America/Menominee.America/Metlakatla.America/New_York.America/Nome.America/North_Dakota/Beulah.America/North_Dakota/Center.America/North_Dakota/New_Salem.America/Phoenix.America/Shiprock.America/Sitka.America/Yakutat.Pacific/Honolulu.US/Alaska.US/Aleutian.US/Arizona.US/Central.US/East-Indiana.US/Eastern.US/Hawaii.US/Indiana-Starke.US/Michigan.US/Mountain.US/Pacific`.split(`.`),UY:[`America/Montevideo`],UZ:[`Asia/Samarkand`,`Asia/Tashkent`],VA:[`Europe/Vatican`],VC:[`America/St_Vincent`],VE:[`America/Caracas`],VG:[`America/Tortola`],VI:[`America/St_Thomas`,`America/Virgin`],VN:[`Asia/Ho_Chi_Minh`,`Asia/Saigon`],VU:[`Pacific/Efate`],WF:[`Pacific/Wallis`],WS:[`Pacific/Apia`],YE:[`Asia/Aden`],YT:[`Indian/Mayotte`],ZA:[`Africa/Johannesburg`],ZM:[`Africa/Lusaka`],ZW:[`Africa/Harare`]},m=new Set(t.map(([e])=>e)),h=/* @__PURE__ */ new Map;for(let[e,t]of Object.entries(p))for(let n of t)h.set(n,e);function g(e){let t=e===void 0?void 0:h.get(e);return t&&m.has(t)?t:null}function _(e){if(!e)return null;let t;try{t=new Intl.Locale(e).region}catch{return null}return t&&m.has(t)?t:null}function v(){let e;try{e=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{e=void 0}let t=typeof navigator>`u`?void 0:navigator.language;return g(e)||_(t)||null}function y(){return Promise.all([import(`./max-ByBKGsXq.js`),import(`./examples.mobile.json-GS1_MGh9.js`)]).then(([e,t])=>b(e,t.default||t))}function b(e,t){return{AsYouType:e.AsYouType,getExampleNumber:e.getExampleNumber,isSupportedCountry:e.isSupportedCountry,isValidPhoneNumber:e.isValidPhoneNumber,parsePhoneNumber:e.parsePhoneNumber,examples:t}}function x(e,t){return e.isSupportedCountry(t)}var S=e=>e?`wui-flag wui-flag-${String(e).toLowerCase()}`:`wui-flag`,C=t=>t?`+${e(t)}`:``,w=null,T=null;function E(){return w?Promise.resolve(w):(T||=y().then(e=>(w=e,w)).catch(e=>(n(`[@webority/ui-elements] <wui-phone> could not load its phone number metadata.`,e),null)),T)}function D(t,n){let r=`+${e(t)}`;return n?.startsWith(r)?n.slice(r.length).trimStart():null}function O(t,n){if(!w||!n||!t||!x(w,t))return n;try{return D(t,new w.AsYouType(t).input(`+${e(t)}${n}`))||n}catch{return n}}function k(e,t){if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(/[0-9]/.test(e[r]??``)&&(n+=1,n===t))return r+1;return e.length}function A(e){if(!w||!e||!x(w,e))return null;try{return D(e,w.getExampleNumber(e,w.examples)?.formatInternational())||null}catch{return null}}function j(e){let t=A(e);return t?`For example ${t}`:null}function M(e){if(!w||!e)return null;try{if(!w.isValidPhoneNumber(e))return!1;let t=w.parsePhoneNumber(e)?.getType?.();return t===void 0||t===`MOBILE`||t===`FIXED_LINE_OR_MOBILE`}catch{return null}}function N(e){if(!w||!e||!x(w,e))return null;try{let t=w.getExampleNumber(e,w.examples);return t?.nationalNumber?t.nationalNumber.length:null}catch{return null}}function P(e,t,n){if(!w||!x(w,e))return null;try{let r=w.parsePhoneNumber(t,e),i=r?.nationalNumber;return!i||r.country!==e||i.length>n||!t.endsWith(i)?null:i}catch{return null}}function F(e){if(!w||!e?.trim().startsWith(`+`))return null;try{let t=new w.AsYouType;t.input(e.trim());let n=t.getCountry();return!n||!V(t)?null:{country:n,national:t.getNationalNumber()||``}}catch{return null}}function I(t,n){let r=String(n??``).trim();if(!r.startsWith(`+`))return null;let i=r.replace(/[^0-9]/g,``),a=String(e(t));return{country:t,national:i.startsWith(a)?i.slice(a.length):i}}var L=class extends r{static formAssociated=!0;static whenFormatted(){return E().then(()=>void 0)}static get observedAttributes(){return[`value`,`country`,`locked-country`,`placeholder`,`disabled`,`readonly`,`loading`,`required`,`aria-label`,`aria-describedby`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._defaultCountry=v()||``,this._country=this._defaultCountry,this._national=``,this._active=-1,this._committedValue=``,this._validateOnInput=!1}connectedCallback(){this._rendered||this.render()}disconnectedCallback(){let e=z(this.querySelector(`.country-dropdown-menu`),HTMLElement);e&&u(e)}attributeChangedCallback(e,t,n){if(e===`value`)this.value=n;else if(this._rendered){if(e===`aria-label`){let t=this.querySelector(`input[type=tel]`);t&&(n==null?t.removeAttribute(e):t.setAttribute(e,n))}else if(e===`aria-describedby`)this._syncDescribedBy();else if(e===`country`){if(this._locked)return;let e=this.value;if(this._country=n||this._defaultCountry,this._suppressCountryRender)return;this.render(),this.value!==e&&(this._emitInput(),this._emitChange())}else this.render()}}formResetCallback(){this._validateOnInput=!1,this.value=this._defaultValue||``}get _locked(){return(this.getAttribute(`locked-country`)||``).toUpperCase()||null}get value(){return this._national&&this._country?`+${e(this._country)}${this._national}`:``}set value(t){let n=String(t??``).trim();this._locked&&(this._country=this._locked);let r=this._locked?null:F(n);if(r)this._country=r.country,this._national=r.national.replace(/[^0-9]/g,``);else if(n.startsWith(`+`)){let t=n.replace(/[^0-9]/g,``),r=String(e(this._locked||this.getAttribute(`country`)||this._country));r&&t.startsWith(r)&&(t=t.slice(r.length)),this._national=t}else this._national=n.replace(/[^0-9]/g,``);r&&this.getAttribute(`country`)!==this._country?this.setAttribute(`country`,this._country):this._rendered&&this.render(),this._committedValue=this.value,this._syncMirror()}_syncMirror(){o(this,this.value)}_syncDescribedBy(){let e=this.querySelector(`input[type=tel]`);if(!e)return;let t=[this.getAttribute(`aria-describedby`),this.querySelector(`[data-phone-error]`)?.id].filter(Boolean);t.length?e.setAttribute(`aria-describedby`,t.join(` `)):e.removeAttribute(`aria-describedby`)}_emitInput(){this.dispatchEvent(new Event(`input`,{bubbles:!0}))}_emitChange(){this._committedValue=this.value,this.dispatchEvent(new Event(`change`,{bubbles:!0}))}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``),this._country=this._locked||this.getAttribute(`country`)||this._country;let e=this.getAttribute(`placeholder`)||j(this._country)||`Enter phone number`;this.id||=`wui-phone-${Math.random().toString(36).slice(2,9)}`;let t=`${this.id}-listbox`;this._listboxId=t;let n=this._locked?`<div class="phone-country-adornment"><span class="wui-phone-prefix"><span class="${S(this._country)}" data-flag aria-hidden="true"></span><span class="phone-dial" data-dial>${C(this._country)}</span></span></div>`:`<div class="phone-country-adornment">
|
|
2
|
-
<button type="button" class="country-toggle" aria-label="Choose country" aria-haspopup="listbox" aria-expanded="false" aria-controls="${H(t)}"${this.hasAttribute(`disabled`)?` disabled`:``}>
|
|
3
|
-
<span class="${S(this._country)}" data-flag aria-hidden="true"></span>
|
|
4
|
-
${s(`chevron-down`,{className:`phone-chevron`})}
|
|
5
|
-
<span class="phone-dial" data-dial>${C(this._country)}</span>
|
|
6
|
-
</button>
|
|
7
|
-
<div class="country-dropdown-menu" popover="auto">
|
|
8
|
-
<div class="dropdown-search-wrapper"><span class="dropdown-search-icon">${s(`search`)}</span><input type="text" class="dropdown-search-input" placeholder="Search country or code" aria-label="Search countries" aria-controls="${H(t)}" aria-autocomplete="list" /></div>
|
|
9
|
-
<div class="country-list-scroll" role="listbox" id="${H(t)}" tabindex="-1"></div>
|
|
10
|
-
<div class="country-empty" hidden>No countries found</div>
|
|
11
|
-
</div>
|
|
12
|
-
</div>`;this.innerHTML=`
|
|
13
|
-
<div class="phone-input-wrap">
|
|
14
|
-
${n}
|
|
15
|
-
<input type="tel" class="input" placeholder="${H(e)}" value="${H(O(this._country,this._national))}"${this.getAttribute(`aria-label`)?` aria-label="${H(this.getAttribute(`aria-label`))}"`:``}${this.getAttribute(`aria-describedby`)?` aria-describedby="${H(this.getAttribute(`aria-describedby`))}"`:``}${this.hasAttribute(`required`)?` required aria-required="true"`:``}${this.hasAttribute(`disabled`)?` disabled`:``}${a(this)?` readonly`:``} />
|
|
16
|
-
</div>`,this._rendered=!0,i(this,this.querySelector(`input.input`)),o(this,this.value),this._wire()}_ensureItems(){let e=z(this.querySelector(`.country-list-scroll`),HTMLElement);if(!e||e.querySelector(`.country-dropdown-item`))return;let n=this._listboxId,r=t.map(([e,t,r],i)=>`<button type="button" role="option" id="${H(`${n}-opt-${i}`)}" class="country-dropdown-item${e===this._country?` selected`:``}" data-iso="${e}" aria-selected="${e===this._country}"><span class="${S(e)}" aria-hidden="true"></span><span class="country-name-text">${t}<span class="country-code-text">+${r}</span></span></button>`).join(``);e.insertAdjacentHTML(`afterbegin`,r)}_itemEls(){return[...this.querySelectorAll(`.country-dropdown-item`)].filter(e=>e instanceof HTMLElement)}_visibleItems(){return this._itemEls().filter(e=>!e.hidden)}_wire(){let t=z(this.querySelector(`.country-toggle`),HTMLButtonElement),n=R(z(this.querySelector(`.phone-input-wrap`),HTMLElement),`phone input wrapper`),r=z(this.querySelector(`.country-dropdown-menu`),HTMLElement),i=z(this.querySelector(`.dropdown-search-input`),HTMLInputElement),o=z(this.querySelector(`.country-list-scroll`),HTMLElement),s=z(this.querySelector(`.country-empty`),HTMLElement),p=R(z(this.querySelector(`input[type=tel]`),HTMLInputElement),`phone input`),m=z(this.querySelector(`[data-flag]`),HTMLElement),h=z(this.querySelector(`[data-dial]`),HTMLElement),g=()=>r!==null&&f(r),_=(e,{reveal:t=!0}={})=>{let n=this._visibleItems();this._active=e,l(R(o,`country list`),e>=0&&n[e]||null);let r=e>=0?n[e]:void 0;r?(t&&r.scrollIntoView({block:`nearest`}),i?.setAttribute(`aria-activedescendant`,r.id)):i?.removeAttribute(`aria-activedescendant`)},v=()=>{g()||(R(t,`country toggle`).setAttribute(`aria-expanded`,`false`),_(-1))},y=()=>{if(a(this)||(this._ensureItems(),d(n,R(r,`country menu`),{mode:`auto`,onClosed:v}),!g()))return;R(t,`country toggle`).setAttribute(`aria-expanded`,`true`);let e=R(i,`country search`);e.value=``,x(``),e.focus(),_(this._visibleItems().findIndex(e=>e.classList.contains(`selected`)))},b=()=>{u(R(r,`country menu`))},x=e=>{let t=e.trim().toLowerCase(),n=0;for(let e of this._itemEls()){let r=!t||(e.textContent??``).toLowerCase().includes(t);e.hidden=!r,r&&(n+=1)}s&&(s.hidden=n>0)},C=t=>{this._country=t,this.getAttribute(`country`)!==t&&(this._suppressCountryRender=!0,this.setAttribute(`country`,t),this._suppressCountryRender=!1),m&&(m.className=S(t)),h&&(h.textContent=`+${e(t)}`);for(let e of this._itemEls()){let n=e.dataset.iso===t;e.classList.toggle(`selected`,n),e.setAttribute(`aria-selected`,String(n))}this.getAttribute(`placeholder`)||(p.placeholder=j(t)||`Enter phone number`),this._national&&(p.value=O(t,this._national)),b(),this._syncMirror(),this._emitChange(),this._validateOnInput&&T(D()),p.focus()},w=e=>{let n=this._visibleItems();if(e.key===`ArrowDown`){if(e.preventDefault(),!g()){y();return}_(Math.min(this._active+1,n.length-1))}else if(e.key===`ArrowUp`){if(e.preventDefault(),!g())return;_(Math.max(this._active-1,0))}else if(c(e)){e.preventDefault();let t=n[this._active];g()&&t?.dataset.iso&&C(t.dataset.iso)}else e.key===`Escape`&&g()&&(e.preventDefault(),e.stopPropagation(),b(),R(t,`country toggle`).focus())};t?.addEventListener(`click`,()=>g()?b():y()),t?.addEventListener(`keydown`,e=>{g()?w(e):(e.key===`ArrowDown`||c(e)||e.key===` `)&&(e.preventDefault(),y())}),i&&i.addEventListener(`input`,()=>{x(i.value);let e=this._visibleItems();_(e.length?0:-1)}),o?.addEventListener(`click`,e=>{let t=z(B(e).closest(`.country-dropdown-item`),HTMLElement);t?.dataset.iso&&C(t.dataset.iso)}),o?.addEventListener(`mousemove`,e=>{let t=z(B(e).closest(`.country-dropdown-item`),HTMLElement);t&&!t.classList.contains(`is-active`)&&_(this._visibleItems().indexOf(t),{reveal:!1})}),o?.addEventListener(`mouseleave`,()=>_(-1)),r?.addEventListener(`keydown`,w);let T=e=>{p.classList.toggle(`is-invalid`,e),e?p.setAttribute(`aria-invalid`,`true`):p.removeAttribute(`aria-invalid`);let t=z(this.querySelector(`[data-phone-error]`),HTMLElement);if(e&&!this.hasAttribute(`external-error`)){t||(t=document.createElement(`div`),t.className=`field-error`,t.id=`${this.id}-phone-error`,t.setAttribute(`data-phone-error`,``),n.after(t));let e=A(this._country);t.textContent=this._country?e?`Enter a valid phone number, e.g. ${e}`:`Enter a valid phone number`:`Choose a country`}else t?.remove();this._syncDescribedBy()},D=()=>this._national.length>0&&(!this._country||M(this.value)===!1);p.addEventListener(`input`,e=>{e.stopPropagation();let t=p.selectionStart??p.value.length,n=p.value.slice(0,t).replace(/[^0-9]/g,``).length,r=p.value.replace(/[^0-9]/g,``),i=N(this._country);if(i&&r.length>i){let e=P(this._country,r,i);e?(n=Math.max(0,n-(r.length-e.length)),r=e):r=r.slice(0,i)}this._national=r;let a=O(this._country,this._national);if(p.value!==a){p.value=a;let e=k(a,Math.min(n,r.length));p.setSelectionRange(e,e)}this._syncMirror(),this._emitInput(),this._validateOnInput&&T(D())}),p.addEventListener(`change`,e=>e.stopPropagation()),p.addEventListener(`blur`,()=>{let e=D();T(e),e&&(this._validateOnInput=!0),this.value!==this._committedValue&&this._emitChange()}),p.addEventListener(`paste`,e=>{let t=e.clipboardData?.getData(`text`),n=this._locked?I(this._locked,t):F(t);n&&(e.preventDefault(),this._national=n.national.replace(/[^0-9]/g,``),n.country===this._country?p.value=O(this._country,this._national):(this._country=n.country,this.setAttribute(`country`,n.country)),this._syncMirror(),this._emitInput(),this._emitChange(),this._validateOnInput&&p.isConnected&&T(D()),z(this.querySelector(`input[type=tel]`),HTMLInputElement)?.focus())}),this._validateOnInput&&T(D()),E().then(e=>{if(e&&p.isConnected){if(this._national){let e=O(this._country,this._national);p.defaultValue=e,p.value=e}if(!this.getAttribute(`placeholder`)){let e=j(this._country);e&&(p.placeholder=e)}}}),this._syncMirror()}};function R(e,t){if(e==null)throw Error(`${t} missing`);return e}function z(e,t){return e instanceof t?e:null}function B(e){if(!(e.target instanceof Element))throw Error(`Event target is not an element`);return e.target}function V(e){return`getNationalNumber`in e&&typeof e.getNationalNumber==`function`}var H=e=>String(e??``).replace(/"/g,`"`).replace(/</g,`<`);export{L as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./dom-Do1pAA12.js";import{t}from"./elementBase-Cxeyx0tU.js";import{a as n,d as r}from"./shortcutKeys-COVLox98.js";var i=class extends t{_doc;_onKeyDown;constructor(){super(),this._doc=null,this._onKeyDown=e=>{this.hasAttribute(`keys`)&&r(e,{j:()=>this._press(`.wui-record-pager-next`),k:()=>this._press(`.wui-record-pager-prev`)},this.closest(`[${n}]`))}}connectedCallback(){this._doc=this.ownerDocument,e(this._doc,`wui-record-pager has no owner document`).addEventListener(`keydown`,this._onKeyDown)}disconnectedCallback(){this._doc?.removeEventListener(`keydown`,this._onKeyDown),this._doc=null}_press(e){let t=this.querySelector(e);!(t instanceof HTMLElement)||t instanceof HTMLButtonElement&&t.disabled||t.getAttribute(`aria-disabled`)===`true`||t.click()}};export{i as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./buttonClass-GtEi8hAY.js";import{t as n}from"./elementBase-Cxeyx0tU.js";import{l as r}from"./wuiHttp-DGbD7Fra.js";var i=`wui-saved-views:`,a=20,o=0,s=e=>typeof e==`object`&&!!e&&`name`in e&&typeof e.name==`string`&&`query`in e&&typeof e.query==`string`,c=class extends n{static get observedAttributes(){return[`key`,`mode`,`action`,`can-share`]}_doc=null;_dom=null;_views;_open;_busy;_error;_trigger;_onTriggerClick;_onKeyDown;_onPointerDown;_onSubmit;constructor(){super(),this._views=[],this._open=!1,this._busy=!1,this._error=null,this._onTriggerClick=()=>this._setOpen(!this._open),this._onKeyDown=e=>{this._open&&e.target instanceof Node&&this.contains(e.target)&&(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),this._setOpen(!1),this._trigger?.focus()):(e.key===`ArrowDown`||e.key===`ArrowUp`)&&this._ui.menu.contains(e.target)&&!(e.target instanceof Element&&/input|textarea/i.test(e.target.tagName))&&(e.preventDefault(),e.stopPropagation()))},this._onPointerDown=e=>{this._open&&!e.composedPath().includes(this)&&this._setOpen(!1)},this._onSubmit=async e=>{e.preventDefault();let t=this._ui.input.value.trim();if(!t)return;if(this._server()){if(this._busy)return;let e={name:t,query:this._ownerDoc.location.search};this._canShare()&&(e.shared=String(this._ui.share.checked)),await this._request(`save`,e)&&(this._ui.input.value=``,this._ui.share.checked=!1);return}let n=this._ownerDoc.location.search;this._commit([{name:t,query:n},...this._views.filter(e=>e.name!==t)].slice(0,a)),this._ui.input.value=``}}get _ownerDoc(){if(!this._doc)throw Error(`wui-saved-views is not connected`);return this._doc}get _ui(){if(!this._dom)throw Error(`wui-saved-views is not built`);return this._dom}connectedCallback(){this._doc=this.ownerDocument,this._trigger||this._build(),window.addEventListener(`keydown`,this._onKeyDown,!0),this._reload()}disconnectedCallback(){this._setOpen(!1),window.removeEventListener(`keydown`,this._onKeyDown,!0),this._doc=null}attributeChangedCallback(){this._doc&&this._trigger&&this._reload()}_reload(){this._server()?(this._views=[],this._render(),this._request(`list`)):(this._views=this._load(),this._render())}_server(){return this.getAttribute(`mode`)===`server`&&!!this.getAttribute(`action`)&&!!this.getAttribute(`key`)}_canShare(){return this._server()&&this.getAttribute(`can-share`)===`true`}async _request(e,t={}){let n=this.getAttribute(`action`)??``,i=this.getAttribute(`key`)??``,a=n,o;e===`list`?a+=(n.includes(`?`)?`&`:`?`)+new URLSearchParams({intent:`list`,key:i}):o={method:`POST`,body:new URLSearchParams({intent:e,key:i,...t})},this._busy=!0,this._render();let c=await r(a,o);if(this._busy=!1,this._doc===null)return!1;if(c.ok){let e=new DOMParser().parseFromString(c.html,`text/html`);return this._views=[...e.querySelectorAll(`[data-wui-saved-views-items] > li`)].filter(e=>e instanceof HTMLLIElement).map(e=>({name:e.dataset.name,query:e.dataset.query,shared:e.dataset.shared===`true`})).filter(s),this._error=null,this._render(),!0}return this._error=c.message||`The views could not be updated. Try again.`,this._render(),!1}_build(){let n=this._ownerDoc;this.classList.add(`dropdown`),this._trigger=n.createElement(`button`),this._trigger.type=`button`,this._trigger.className=e(`neutral`,`outline`,`sm`),this._trigger.dataset.wui=t,this._trigger.textContent=`Views`,this._trigger.setAttribute(`aria-haspopup`,`true`),this._trigger.setAttribute(`aria-expanded`,`false`),this._trigger.addEventListener(`click`,this._onTriggerClick);let r=n.createElement(`div`);r.className=`dropdown-menu`;let i=n.createElement(`div`);i.className=`dropdown-divider`;let a=n.createElement(`input`);a.type=`text`,a.className=`form-control form-control-sm`,a.setAttribute(`aria-label`,`View name`),a.placeholder=`Name this view`;let s=n.createElement(`button`);s.type=`submit`,s.className=e(`primary`,`solid`,`sm`),s.dataset.wui=t,s.textContent=`Save this view`;let c=n.createElement(`form`);c.className=`d-flex gap-2 px-3 py-2`,c.append(a,s),c.addEventListener(`submit`,this._onSubmit);let l=n.createElement(`input`);l.type=`checkbox`,l.className=`form-check-input`,l.setAttribute(`role`,`switch`),l.id=`wui-saved-views-share-${o++}`;let u=n.createElement(`label`);u.className=`form-check-label`,u.htmlFor=l.id,u.textContent=`Share with the team`;let d=n.createElement(`div`);d.className=`form-check form-switch mb-0`,d.append(l,u);let f=n.createElement(`div`);f.className=`px-3 pb-2`,f.hidden=!0,f.append(d),this._dom={menu:r,divider:i,form:c,input:a,save:s,shareRow:f,share:l},this.append(this._trigger,r)}_render(){let e=this._ownerDoc,t=this._ui,n=[];for(let t of this._views){let r=e.createElement(`a`);if(r.className=`dropdown-item`,r.setAttribute(`href`,e.location.pathname+t.query),r.textContent=t.name,t.shared){let t=e.createElement(`span`);t.className=`badge text-bg-secondary ms-2`,t.textContent=`Shared`,r.append(t)}let i=e.createElement(`button`);i.type=`button`,i.className=`btn btn-link btn-sm`,i.textContent=`Delete`,i.setAttribute(`aria-label`,`Delete ${t.name}`),i.disabled=this._busy,i.addEventListener(`click`,()=>this._server()?this._request(`delete`,{name:t.name}):this._commit(this._views.filter(e=>e.name!==t.name))),n.push(r,i)}if(this._error){let t=e.createElement(`div`);t.className=`dropdown-item-text text-danger small`,t.setAttribute(`role`,`alert`),t.textContent=this._error,n.push(t)}t.save.disabled=this._busy,t.share.disabled=this._busy,t.shareRow.hidden=!this._canShare(),t.menu.replaceChildren(...n,t.divider,t.form,t.shareRow)}_commit(e){this._views=e,this._write(e),this._render()}_setOpen(e){e!==this._open&&(this._open=e,this._ui.menu.classList.toggle(`show`,e),this._trigger?.setAttribute(`aria-expanded`,String(e)),e?this._ownerDoc.addEventListener(`pointerdown`,this._onPointerDown,!0):this._ownerDoc.removeEventListener(`pointerdown`,this._onPointerDown,!0))}_storage(){let e=this.getAttribute(`key`);if(!e)return null;try{let t=this._ownerDoc.defaultView;return t?{store:t.localStorage,key:i+e}:null}catch{return null}}_load(){let e=this._storage();if(!e)return[];try{let t=JSON.parse(e.store.getItem(e.key)??`[]`);return Array.isArray(t)?t.filter(s).slice(0,a):[]}catch{return[]}}_write(e){let t=this._storage();if(t)try{t.store.setItem(t.key,JSON.stringify(e))}catch(e){if(!(e instanceof DOMException))throw e}}};export{c as t};
|