@astryx-vue/core 0.40.0 → 0.41.1
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/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-McG6w72O.js → AlertDialog-DxrO48Kg.js} +7 -7
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-lv3WDlCi.js → AppShell-Y-rwHGxA.js} +2 -2
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-BY-EWaJM.js → Avatar-z50mYJor.js} +1 -1
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-BSsARmYE.js → AvatarGroup-BZ5iG7M-.js} +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +1 -1
- package/dist/{Banner-CmWBciT7.js → Banner-0YtnbBU6.js} +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-BkBRbF1_.js → BottomSheet-B8frtWqm.js} +8 -8
- package/dist/{BottomSheet-BOEmV4QT.js → BottomSheet-u57AJshc.js} +1 -1
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/{Breadcrumbs-D7dac2Vx.js → Breadcrumbs-9KMHiyXr.js} +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/{Button-pAwKXPpg.js → Button-ClyetTf6.js} +4 -4
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/{ButtonGroup-CuxHcLGQ.js → ButtonGroup-tk0H2O8q.js} +2 -2
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Carousel/index.d.ts +1 -1
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-CS2e2A7m.js → Carousel-utfvjW5p.js} +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-BpZRcgDp.js → Chat-DL583Xle.js} +6 -6
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-DhacWPUS.js → CheckboxInput-BQH87pfn.js} +4 -4
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxListItem-D7PdrL6R.js → CheckboxListItem-BL7gDglY.js} +4 -4
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/{ClickableCard-DYcn-IFI.js → ClickableCard-CdByvXDr.js} +1 -1
- package/dist/Code/index.js +2 -2
- package/dist/{Code-CpOHgCdF.js → Code-KvqZ1ZES.js} +1 -1
- package/dist/{CodeBlock-CkGp6dGF.js → CodeBlock-e2rlXQWO.js} +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-CaKmR3yE.js → Collapsible-CTc7irlw.js} +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-DiM8MlSa.js → CommandPalette-PBYSDIpx.js} +3 -3
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-BmXhD8Oe.js → ComplexSelector-CPg5jcdL.js} +2 -2
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-DcqcObzD.js → ContextMenu-DcZEviKv.js} +5 -5
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-C3KNWKD5.js → DateInput-C4qtEFDW.js} +5 -5
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-C7qeaG20.js → DateRangeInput-CGqCQAlT.js} +3 -3
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-L0EZbgPe.js → DateTimeInput-CAirxttc.js} +5 -5
- package/dist/Dialog/index.js +3 -3
- package/dist/{Dialog-DLg0POKn.js → Dialog-B2-5xYs2.js} +2 -2
- package/dist/{Dialog-iVqfWx9T.js → Dialog-CjN3cV-b.js} +1 -1
- package/dist/{DialogHeader-B0B8oATV.js → DialogHeader-BS8mjD8z.js} +2 -2
- package/dist/Drawer/index.d.ts +1 -1
- package/dist/Drawer/index.js +1 -1
- package/dist/{Drawer-C0x5HNmD.js → Drawer-Cq1Y_1iJ.js} +3 -3
- package/dist/DropdownMenu/index.js +2 -2
- package/dist/{DropdownMenu-pqhotFvD.js → DropdownMenu-CSn1OQ2D.js} +7 -7
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-BUmLBchw.js → EmptyState-uHOykbeo.js} +2 -2
- package/dist/Field/index.js +3 -3
- package/dist/{Field-D3W-qMmn.js → Field-BzGwGqwa.js} +1 -1
- package/dist/{FieldInfoTip-K-cUaCBk.js → FieldInfoTip-DqsdZxo0.js} +1 -1
- package/dist/{FieldLabel-CIe1tEyM.js → FieldLabel-DdMLaCP_.js} +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-Crb5znnx.js → FileInput-B_BXknEU.js} +3 -3
- package/dist/Heading/index.js +1 -1
- package/dist/{Heading-SdObK_xM.js → Heading-BFJhZInd.js} +1 -1
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/HoverCard/index.js +1 -1
- package/dist/{HoverCard-B7hrl0Qz.js → HoverCard-Cbxy2KEM.js} +4 -4
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-Cug4YcFk.js → IconButton-kj1M_L7a.js} +1 -1
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/InfoTip/index.js +1 -1
- package/dist/{InfoTip-Cu4a1mi4.js → InfoTip-DJIb8b29.js} +2 -2
- package/dist/{InputClearButton-CgUhJflI.js → InputClearButton-wd0VoZja.js} +1 -1
- package/dist/InputGroup/index.js +1 -1
- package/dist/{InputGroup-BRsu7Tbv.js → InputGroup-DGiF9Xaz.js} +1 -1
- package/dist/InternationalizationProvider/index.d.ts +1 -1
- package/dist/InternationalizationProvider/index.js +1 -1
- package/dist/{InternationalizationProvider-BkJ8Z7ox.js → InternationalizationProvider-C37KH-mM.js} +1 -1
- package/dist/{Item-DrV3f4fe.js → Item-DC1v56yE.js} +1 -1
- package/dist/{LayerContentBoundary-iYtfCpG9.js → LayerContentBoundary-tgsCvoNX.js} +1 -1
- package/dist/Layout/index.js +2 -2
- package/dist/{Layout-DTSKNAzq.js → Layout-C7oS06UY.js} +1 -1
- package/dist/{LayoutPanel-CH4HZGLR.js → LayoutPanel-BwvUhSM5.js} +1 -1
- package/dist/Lightbox/index.d.ts +1 -1
- package/dist/Lightbox/index.js +1 -1
- package/dist/Lightbox-Fu6RCX0k.js +2353 -0
- package/dist/Link/index.d.ts +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/{Link-BsmxrY3Y.js → Link-zPVCNAM6.js} +2 -2
- package/dist/List/index.d.ts +2 -2
- package/dist/List/index.js +4 -3
- package/dist/List-D4w6clf-.js +69 -0
- package/dist/{ListItem-DZwU5RrZ.js → ListItem-uvJaYGOJ.js} +3 -3
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-CiLkzTFi.js → Markdown-BiXz75mz.js} +3 -3
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-CiY__Fy9.js → MobileNavToggle-VB6SzHYo.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-BWuzaT3K.js → MoreMenu-CgT9SajI.js} +6 -6
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-geUPBvlE.js → MultiSelector-CaL3UDIc.js} +5 -5
- package/dist/{NavDisclosure-l2h8R_ub.js → NavDisclosure-tEaEwaA0.js} +1 -1
- package/dist/{NavHeadingSurface-C3QJ64vm.js → NavHeadingSurface-CwSYyXFb.js} +1 -1
- package/dist/NavItem/index.js +1 -1
- package/dist/{NavItem-BbnusKbo.js → NavItem-D_1ecPv_.js} +1 -1
- package/dist/NavMenu/index.js +3 -3
- package/dist/{NavMenu-BRWghdCF.js → NavMenu-CqhjkZuz.js} +2 -2
- package/dist/{NavMenuItem-BtYmdZGe.js → NavMenuItem-DqBCA1VP.js} +3 -3
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput--sai94t9.js → NumberInput-0lTA5weY.js} +4 -4
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-DGntLLCe.js → Outline-BoxN40Bd.js} +2 -2
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-DJBaY3B_.js → OverflowList-7oui4oT5.js} +2 -2
- package/dist/Overlay/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-C10gbfyv.js → Pagination-BrkX0lga.js} +2 -2
- package/dist/{PanGestureRecognizer-K-I6ORwh.js → PanGestureRecognizer-BFSO5U4N.js} +3 -3
- package/dist/{PickerWheel-CpAyp6NS.js → PickerWheel-CWT7l-9Q.js} +12 -11
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-C6_p8KAA.js → Popover-BZ4VWDtv.js} +6 -6
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-D47zbO7s.js → PowerSearch-BSoQJbHK.js} +27 -27
- package/dist/{PressTracker-Byalgid0.js → PressTracker-DDRxFc0Y.js} +2 -2
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-DJ79DNQq.js → ProgressBar-D4br-4_x.js} +2 -2
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-C1VXRBSf.js → RadioGroup-CrRm7H51.js} +5 -5
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioListItem-DrAwYoOz.js → RadioListItem-iPD3y2Eo.js} +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{ResizeHandle-ruXeaXUT.js → ResizeHandle-C7xEokaQ.js} +2 -2
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SegmentedControl/index.js +1 -1
- package/dist/{SegmentedControl-D9atngIc.js → SegmentedControl-D8A_jaFC.js} +7 -7
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/SelectableCard/index.js +1 -1
- package/dist/{SelectableCard-BSgi3FJf.js → SelectableCard-DIruuGBa.js} +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-DFTryuh1.js → Selector-CFdM10Uc.js} +3 -3
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-Bjk5ACqf.js → SideNav-Cl1H-baW.js} +7 -7
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-rOwQQK6G.js → Slider-Bd3wpFo7.js} +11 -10
- package/dist/StatusDot/index.js +1 -1
- package/dist/{StatusDot-DOf6Q4MC.js → StatusDot-arRs8rKk.js} +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-0ycdCwND.js → Stepper-CZU_Zvi5.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-BBfZ6XqA.js → Switch-BpkKyz98.js} +10 -10
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-BnLUktgm.js → TabList-DZ2i0QIt.js} +3 -3
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-D0yjxm9X.js → Table-fSipO9Ju.js} +12 -12
- package/dist/{haptics-By_893U8.js → TapGestureRecognizer-DCiP88h8.js} +4 -21
- package/dist/Text/index.js +1 -1
- package/dist/{Text-CILdp7jE.js → Text-DHm9r3Yh.js} +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-Cr00OL0D.js → TextArea-D5aDDlgr.js} +5 -5
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-CVfvRHOa.js → TextInput-CVRWRtoL.js} +5 -5
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-CJPZ299u.js → Thumbnail-zFN5p6dk.js} +3 -3
- package/dist/{TimeField-Csp1-lRo.js → TimeField-B49DgkyR.js} +4 -4
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-B4JLpJ2N.js → TimeInput-BoFij92p.js} +2 -2
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-DOoFQEBD.js → Timer-zNCSMU7S.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-BmH-CQ8p.js → Timestamp-DunFvQYG.js} +3 -3
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-Cuc1o3ph.js → Toast-BnIq3gzw.js} +3 -3
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/ToggleButton/index.js +1 -1
- package/dist/{ToggleButton-BsAi9ln1.js → ToggleButton-CLgj6yLQ.js} +3 -3
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-Di7w9Cvr.js → Token-BPjnWrHl.js} +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-CXCnZtY3.js → Tokenizer-CMv-Bi0y.js} +12 -12
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.js +2 -2
- package/dist/{Tooltip-DPiEYfao.js → Tooltip-BuPbbGtv.js} +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-GvK-XIRl.js → TopNav-DUkn4CMv.js} +5 -5
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-CfELZwbQ.js → TreeList-o5MrA7rz.js} +1 -1
- package/dist/Typeahead/index.js +2 -2
- package/dist/{Typeahead-Csob3tst.js → Typeahead-DXlsxjkQ.js} +5 -5
- package/dist/{VelocityTracker-CWqXCLNe.js → VelocityTracker-D5wT6A0d.js} +1 -1
- package/dist/{accessibleName-CYV4uRm9.js → accessibleName-9UI6HUaA.js} +1 -1
- package/dist/{animator-i7djdtNK.js → animator-D6Buqmbt.js} +1 -1
- package/dist/{boxHold-ig0sUg95.js → boxHold-DfsWCZLh.js} +1 -1
- package/dist/composables/index.js +8 -8
- package/dist/{composables-DqaKLASV.js → composables-Dzpv7G2Z.js} +13 -409
- package/dist/{decay-DGF4-sPB.js → decay-CUtQFEXK.js} +6 -2
- package/dist/{geometry-BBqUriul.js → geometry-ae8bOxQ5.js} +1 -1
- package/dist/{gestures-CP1MX1rx.js → gestures-D_ih8YYG.js} +1 -1
- package/dist/haptics-BPQp81pc.js +19 -0
- package/dist/{index-BuubzuE8.d.ts → index-BDZCJ9ri.d.ts} +2 -2
- package/dist/{index-BIcmTipH.d.ts → index-BItxjc3w.d.ts} +1 -1
- package/dist/{index-CCpcerMA.d.ts → index-BhGIK1Hz.d.ts} +4 -1
- package/dist/{index-DLPSlnXP.d.ts → index-C2dLjYoW.d.ts} +1 -1
- package/dist/{index-Ds4dOCSy.d.ts → index-CCa_dvoF.d.ts} +3 -3
- package/dist/{index-CqvIpZ-t.d.ts → index-CJT9kM7e.d.ts} +1 -1
- package/dist/{index-DPhQZXYw.d.ts → index-DYabo8TI.d.ts} +1 -1
- package/dist/{index-BtqvPjAf.d.ts → index-DofC9Rll.d.ts} +1 -1
- package/dist/{index-LvZ3vP29.d.ts → index-LYiWcVDD.d.ts} +47 -3
- package/dist/{index-DN2b-w3H.d.ts → index-uWIhWgDN.d.ts} +15 -15
- package/dist/index.d.ts +13 -13
- package/dist/index.js +104 -104
- package/dist/{layerDepth-C4altnV8.js → layerDepth-D576XVps.js} +1 -1
- package/dist/{lazyBottomSheet-0H4ih8Oh.js → lazyBottomSheet-gQtGKE8w.js} +1 -1
- package/dist/{loadCatalog-S2AgQN51.d.ts → loadCatalog-DfwwR4ox.d.ts} +2 -0
- package/dist/{loadCatalog-baFZaTpj.js → loadCatalog-Dvlsgn71.js} +6 -0
- package/dist/locale/index.d.ts +2 -2
- package/dist/locale/index.js +2 -2
- package/dist/{locale-BIyfn-cf.js → locale-BgXR3tSm.js} +1 -1
- package/dist/{position-CkZfFubr.js → position-DD8UQJ2A.js} +1 -1
- package/dist/{pressGesture-ZTBGwYpT.js → pressGesture-CwmZDuSC.js} +1 -1
- package/dist/{pressSlot-zlwhNl9N.js → pressSlot-5Bp-B175.js} +1 -1
- package/dist/{projection-DzrWyxL1.js → projection-Ccz44WX4.js} +1 -1
- package/dist/{reducedMotion-BHRhHfWB.js → reducedMotion-BcstlXZU.js} +1 -1
- package/dist/{resizableChannel-b7iQNnCj.js → resizableChannel-CABtOiJL.js} +1 -1
- package/dist/{resolveMotion-BCM4CX-R.js → resolveMotion-BHR1cz0Q.js} +1 -1
- package/dist/{resolveSnapPoint-D1yU-Z-K.js → resolveSnapPoint-C7GZY6jT.js} +1 -1
- package/dist/{rideKeyboard-BKGLLMuU.js → rideKeyboard-BldiTgxS.js} +2 -2
- package/dist/{rubberBand-C-2erWWl.js → rubberBand-Ct9HFML5.js} +1 -1
- package/dist/snapPagingCatcher-RkUaZdWD.js +407 -0
- package/dist/{stillPointerGate-DXFzBeMy.js → stillPointerGate-CCFCP1uz.js} +1 -1
- package/dist/{tooltipFocusRules-R21SPfWy.js → tooltipFocusRules-CfJwTrhE.js} +2 -2
- package/dist/{tooltipTriggerRules-CoGD2lVn.js → tooltipTriggerRules-DRhcB-wA.js} +1 -1
- package/dist/{useActionGroupTracking-SVkaaOzz.js → useActionGroupTracking-Cujjrmt3.js} +3 -3
- package/dist/{useDismiss-yu_sIa7a.js → useDismiss-Dq7HNw2m.js} +1 -1
- package/dist/{useGestureRecognizer-BKzTWKYx.js → useGestureRecognizer-CtfxP4uw.js} +1 -1
- package/dist/{useInputStatusIcon-CRG-be-K.js → useInputStatusIcon-2sRn-Nbf.js} +1 -1
- package/dist/{useMenuPress-DrrOBqjM.js → useMenuPress-B2Zt5xc5.js} +1 -1
- package/dist/{useMobileKeyboard-Cibxl8ZC.js → useMobileKeyboard-CN6o0BrJ.js} +2 -2
- package/dist/{usePressFeedback-BEY9kk8T.js → usePressFeedback-Ber7MRiI.js} +3 -3
- package/dist/{useResizable-CJQAV_tU.js → useResizable-Dme0X_ZM.js} +5 -5
- package/dist/{useTooltip-B2RrDbtI.js → useTooltip-Dg2459oV.js} +4 -4
- package/dist/{useTouchHitArea-BdpeksgK.js → useTouchHitArea-B6g7fhfF.js} +1 -1
- package/dist/{useTouchTriggerInternal-Obcx-oKN.js → useTouchTriggerInternal-DZ_e8l4G.js} +1 -1
- package/dist/{useTruncationTooltip-RUl8qSGz.js → useTruncationTooltip-CCVsMc8c.js} +3 -3
- package/dist/{useTypeaheadMenuConfig-0glQWHQd.js → useTypeaheadMenuConfig-CKEuRCOZ.js} +1 -1
- package/package.json +1 -1
- package/styles/lightbox.css +117 -33
- package/styles/list-reorder.css +6 -3
- package/dist/Lightbox-_RBPOxDZ.js +0 -545
- package/dist/{index-BqhgeAT4.d.ts → index-D8lv2BiD.d.ts} +1 -1
|
@@ -1,545 +0,0 @@
|
|
|
1
|
-
import { r as resetLayerScopedContext } from "./scopedProvide-C-Df7c15.js";
|
|
2
|
-
import { t as _sfc_main$2 } from "./Icon-BUSj1-Th.js";
|
|
3
|
-
import { o as useComponentMessages } from "./context-B8IEFCDR.js";
|
|
4
|
-
import { t as useFocusTrap } from "./useFocusTrap-Bj9GskLh.js";
|
|
5
|
-
import { t as _sfc_main$3 } from "./IconButton-Cug4YcFk.js";
|
|
6
|
-
import { t as useScrollLock } from "./scrollLock-CoVg9lLU.js";
|
|
7
|
-
import { n as restoreLayerFocus, r as trackLayerFocus, t as isLayerFocusStranded } from "./layerFocusReturn-uixUCSc8.js";
|
|
8
|
-
import { n as useTruncation } from "./useTruncation-D_T-ezdp.js";
|
|
9
|
-
import { t as lightboxMessages } from "./lightbox-BbwxSHdB.js";
|
|
10
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, ref, toDisplayString, toRef, unref, useId, useTemplateRef, watch, withCtx } from "vue";
|
|
11
|
-
import "../styles/visually-hidden-utility.css";
|
|
12
|
-
import "../styles/lightbox.css";
|
|
13
|
-
//#region src/Lightbox/LightboxCaption.vue
|
|
14
|
-
const _hoisted_1$1 = ["data-empty", "data-expanded"];
|
|
15
|
-
const _hoisted_2$1 = {
|
|
16
|
-
key: 0,
|
|
17
|
-
class: "astryx-lightbox__caption-panel"
|
|
18
|
-
};
|
|
19
|
-
const _hoisted_3$1 = ["id"];
|
|
20
|
-
const _hoisted_4$1 = ["aria-expanded", "aria-controls"];
|
|
21
|
-
const MAX_LINES = 2;
|
|
22
|
-
const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
23
|
-
name: "AstryxLightboxCaption",
|
|
24
|
-
__name: "LightboxCaption",
|
|
25
|
-
props: {
|
|
26
|
-
text: {},
|
|
27
|
-
id: {}
|
|
28
|
-
},
|
|
29
|
-
setup(__props) {
|
|
30
|
-
const messages = useComponentMessages({ lightbox: lightboxMessages });
|
|
31
|
-
/**
|
|
32
|
-
* 图注最多显示两行。超出时第二行末尾跟一个「更多」,点开后整段图注盖在照片底部,
|
|
33
|
-
* 「收起」再合上。整段文字一直在 DOM 里,所以无障碍描述总是完整的图注。
|
|
34
|
-
*/
|
|
35
|
-
const truncation = useTruncation(ref(MAX_LINES));
|
|
36
|
-
const isExpanded = ref(false);
|
|
37
|
-
/** 展开时文字不再被截断,量出来是 false;这时仍要留着「收起」。 */
|
|
38
|
-
const hasToggle = computed(() => isExpanded.value || truncation.isTruncated.value);
|
|
39
|
-
function bindText(element) {
|
|
40
|
-
truncation.bind(element instanceof Element ? element : null);
|
|
41
|
-
}
|
|
42
|
-
function toggle() {
|
|
43
|
-
isExpanded.value = !isExpanded.value;
|
|
44
|
-
}
|
|
45
|
-
return (_ctx, _cache) => {
|
|
46
|
-
return openBlock(), createElementBlock("div", {
|
|
47
|
-
class: "astryx-lightbox__caption-band",
|
|
48
|
-
"data-empty": __props.text ? void 0 : "",
|
|
49
|
-
"data-expanded": isExpanded.value || void 0
|
|
50
|
-
}, [__props.text ? (openBlock(), createElementBlock("div", _hoisted_2$1, [createElementVNode("p", {
|
|
51
|
-
id: __props.id,
|
|
52
|
-
ref: bindText,
|
|
53
|
-
class: "astryx-lightbox__caption astryx-lightbox__caption--band"
|
|
54
|
-
}, toDisplayString(__props.text), 9, _hoisted_3$1), hasToggle.value ? (openBlock(), createElementBlock("button", {
|
|
55
|
-
key: 0,
|
|
56
|
-
type: "button",
|
|
57
|
-
class: "astryx-lightbox__caption-toggle",
|
|
58
|
-
"aria-expanded": isExpanded.value,
|
|
59
|
-
"aria-controls": __props.id,
|
|
60
|
-
onClick: toggle
|
|
61
|
-
}, toDisplayString(isExpanded.value ? unref(messages).lightbox.captionLess : unref(messages).lightbox.captionMore), 9, _hoisted_4$1)) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true)], 8, _hoisted_1$1);
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region src/Lightbox/lightboxViewer.ts
|
|
67
|
-
/** 序号取整:小数四舍五入到最近的一项,NaN 当作第一项。越界由调用方再夹紧。 */
|
|
68
|
-
function toWholeIndex(value) {
|
|
69
|
-
return Number.isNaN(value) ? 0 : Math.round(value);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* 往灯箱自己的播报区域写一句话。模态 dialog 打开时外面的页面是 inert 的,
|
|
73
|
-
* 挂在 body 上的公共播报区域读屏听不到,所以灯箱在 dialog 里放一个自己的。
|
|
74
|
-
* 先清空再在下一帧写入,同一句话连着播两次也会被当成新内容。
|
|
75
|
-
*/
|
|
76
|
-
function createModalAnnouncer(getRegion) {
|
|
77
|
-
let frame;
|
|
78
|
-
return (message) => {
|
|
79
|
-
const region = getRegion();
|
|
80
|
-
if (region == null) return;
|
|
81
|
-
region.textContent = "";
|
|
82
|
-
if (frame !== void 0 && typeof cancelAnimationFrame === "function") cancelAnimationFrame(frame);
|
|
83
|
-
if (typeof requestAnimationFrame !== "function") {
|
|
84
|
-
region.textContent = message;
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
frame = requestAnimationFrame(() => {
|
|
88
|
-
frame = void 0;
|
|
89
|
-
region.textContent = message;
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region src/Lightbox/Lightbox.vue
|
|
95
|
-
const _hoisted_1 = [
|
|
96
|
-
"aria-label",
|
|
97
|
-
"aria-describedby",
|
|
98
|
-
"data-gallery",
|
|
99
|
-
"data-caption-band"
|
|
100
|
-
];
|
|
101
|
-
const _hoisted_2 = {
|
|
102
|
-
ref: "mediaBox",
|
|
103
|
-
class: "astryx-lightbox__media"
|
|
104
|
-
};
|
|
105
|
-
const _hoisted_3 = [
|
|
106
|
-
"data-zoomable",
|
|
107
|
-
"data-zoomed",
|
|
108
|
-
"data-dragging",
|
|
109
|
-
"role",
|
|
110
|
-
"tabindex",
|
|
111
|
-
"aria-pressed",
|
|
112
|
-
"aria-label"
|
|
113
|
-
];
|
|
114
|
-
const _hoisted_4 = [
|
|
115
|
-
"src",
|
|
116
|
-
"aria-label",
|
|
117
|
-
"autoplay"
|
|
118
|
-
];
|
|
119
|
-
const _hoisted_5 = [
|
|
120
|
-
"src",
|
|
121
|
-
"alt",
|
|
122
|
-
"data-dragging"
|
|
123
|
-
];
|
|
124
|
-
const _hoisted_6 = {
|
|
125
|
-
key: 2,
|
|
126
|
-
class: "astryx-lightbox__counter"
|
|
127
|
-
};
|
|
128
|
-
const _hoisted_7 = {
|
|
129
|
-
ref: "liveRegion",
|
|
130
|
-
class: "astryx-lightbox__announcer astryx-visually-hidden",
|
|
131
|
-
"aria-live": "polite",
|
|
132
|
-
"aria-atomic": "true"
|
|
133
|
-
};
|
|
134
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
135
|
-
name: "AstryxLightbox",
|
|
136
|
-
inheritAttrs: false,
|
|
137
|
-
__name: "Lightbox",
|
|
138
|
-
props: {
|
|
139
|
-
isOpen: { type: Boolean },
|
|
140
|
-
media: {},
|
|
141
|
-
index: {},
|
|
142
|
-
defaultIndex: { default: 0 },
|
|
143
|
-
hasZoom: {
|
|
144
|
-
type: Boolean,
|
|
145
|
-
default: false
|
|
146
|
-
},
|
|
147
|
-
hasAutoPlay: {
|
|
148
|
-
type: Boolean,
|
|
149
|
-
default: false
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
emits: ["update:isOpen", "update:index"],
|
|
153
|
-
setup(__props, { emit: __emit }) {
|
|
154
|
-
const props = __props;
|
|
155
|
-
const emit = __emit;
|
|
156
|
-
const messages = useComponentMessages({ lightbox: lightboxMessages });
|
|
157
|
-
const liveRegionRef = useTemplateRef("liveRegion");
|
|
158
|
-
const announce = createModalAnnouncer(() => liveRegionRef.value);
|
|
159
|
-
resetLayerScopedContext();
|
|
160
|
-
const dialogRef = useTemplateRef("dialog");
|
|
161
|
-
const containerRef = ref(null);
|
|
162
|
-
const mediaRef = useTemplateRef("mediaBox");
|
|
163
|
-
const frameRef = useTemplateRef("frame");
|
|
164
|
-
const closeRef = useTemplateRef("close");
|
|
165
|
-
const captionId = `astryx-lightbox-caption-${useId()}`;
|
|
166
|
-
useScrollLock(toRef(props, "isOpen"));
|
|
167
|
-
const mediaList = computed(() => Array.isArray(props.media) ? props.media : [props.media]);
|
|
168
|
-
const isGallery = computed(() => Array.isArray(props.media) && mediaList.value.length > 1);
|
|
169
|
-
const internalIndex = ref(props.defaultIndex);
|
|
170
|
-
const index = computed(() => {
|
|
171
|
-
const last = Math.max(0, mediaList.value.length - 1);
|
|
172
|
-
return Math.min(Math.max(0, toWholeIndex(props.index ?? internalIndex.value)), last);
|
|
173
|
-
});
|
|
174
|
-
const current = computed(() => mediaList.value[index.value]);
|
|
175
|
-
const isVideo = computed(() => current.value?.type === "video");
|
|
176
|
-
const hasCaptionBand = computed(() => isGallery.value || Boolean(current.value?.caption));
|
|
177
|
-
const canPrev = computed(() => index.value > 0);
|
|
178
|
-
const canNext = computed(() => index.value < mediaList.value.length - 1);
|
|
179
|
-
const zoom = ref(1);
|
|
180
|
-
const pan = ref({
|
|
181
|
-
x: 0,
|
|
182
|
-
y: 0
|
|
183
|
-
});
|
|
184
|
-
const dragging = ref(false);
|
|
185
|
-
const didDrag = ref(false);
|
|
186
|
-
const dragStart = {
|
|
187
|
-
x: 0,
|
|
188
|
-
y: 0,
|
|
189
|
-
panX: 0,
|
|
190
|
-
panY: 0
|
|
191
|
-
};
|
|
192
|
-
let focusRecord = null;
|
|
193
|
-
const zoomable = computed(() => props.hasZoom && !isVideo.value);
|
|
194
|
-
const imageTransform = computed(() => zoom.value === 1 ? void 0 : `scale(${zoom.value}) translate(${pan.value.x / zoom.value}px, ${pan.value.y / zoom.value}px)`);
|
|
195
|
-
function close() {
|
|
196
|
-
emit("update:isOpen", false);
|
|
197
|
-
}
|
|
198
|
-
function setIndex(next) {
|
|
199
|
-
const last = Math.max(0, mediaList.value.length - 1);
|
|
200
|
-
const clamped = Math.min(Math.max(0, toWholeIndex(next)), last);
|
|
201
|
-
internalIndex.value = clamped;
|
|
202
|
-
emit("update:index", clamped);
|
|
203
|
-
}
|
|
204
|
-
function resetZoom() {
|
|
205
|
-
zoom.value = 1;
|
|
206
|
-
pan.value = {
|
|
207
|
-
x: 0,
|
|
208
|
-
y: 0
|
|
209
|
-
};
|
|
210
|
-
dragging.value = false;
|
|
211
|
-
}
|
|
212
|
-
function applyZoom(next) {
|
|
213
|
-
if (!zoomable.value || next === zoom.value) return;
|
|
214
|
-
zoom.value = next;
|
|
215
|
-
pan.value = {
|
|
216
|
-
x: 0,
|
|
217
|
-
y: 0
|
|
218
|
-
};
|
|
219
|
-
announce(next > 1 ? messages.value.lightbox.zoomedIn : messages.value.lightbox.zoomedOut);
|
|
220
|
-
}
|
|
221
|
-
function toggleZoom() {
|
|
222
|
-
applyZoom(zoom.value === 1 ? 2 : 1);
|
|
223
|
-
}
|
|
224
|
-
function onCancel(event) {
|
|
225
|
-
if (event.target !== event.currentTarget) return;
|
|
226
|
-
event.preventDefault();
|
|
227
|
-
close();
|
|
228
|
-
}
|
|
229
|
-
function onBackdropClick(event) {
|
|
230
|
-
if (didDrag.value) {
|
|
231
|
-
didDrag.value = false;
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
const target = event.target;
|
|
235
|
-
if (target === event.currentTarget || target === containerRef.value || target === mediaRef.value) close();
|
|
236
|
-
}
|
|
237
|
-
function onKeyDown(event) {
|
|
238
|
-
if (zoomable.value) {
|
|
239
|
-
if (event.key === "+" || event.key === "=") {
|
|
240
|
-
event.preventDefault();
|
|
241
|
-
applyZoom(2);
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
if (event.key === "-" || event.key === "_") {
|
|
245
|
-
event.preventDefault();
|
|
246
|
-
applyZoom(1);
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
if (event.key === "0" && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
250
|
-
event.preventDefault();
|
|
251
|
-
applyZoom(1);
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
const step = 50;
|
|
255
|
-
const offsets = {
|
|
256
|
-
ArrowDown: [0, -50],
|
|
257
|
-
ArrowLeft: [step, 0],
|
|
258
|
-
ArrowRight: [-50, 0],
|
|
259
|
-
ArrowUp: [0, step]
|
|
260
|
-
};
|
|
261
|
-
const offset = zoom.value > 1 ? offsets[event.key] : void 0;
|
|
262
|
-
if (offset != null) {
|
|
263
|
-
event.preventDefault();
|
|
264
|
-
pan.value = {
|
|
265
|
-
x: pan.value.x + offset[0],
|
|
266
|
-
y: pan.value.y + offset[1]
|
|
267
|
-
};
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
|
|
272
|
-
const dialog = dialogRef.value;
|
|
273
|
-
const isRtl = dialog != null && getComputedStyle(dialog).direction === "rtl";
|
|
274
|
-
const towardEnd = event.key === "ArrowRight" !== isRtl;
|
|
275
|
-
if (towardEnd && canNext.value) {
|
|
276
|
-
event.preventDefault();
|
|
277
|
-
setIndex(index.value + 1);
|
|
278
|
-
} else if (!towardEnd && canPrev.value) {
|
|
279
|
-
event.preventDefault();
|
|
280
|
-
setIndex(index.value - 1);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
function onImageKeyDown(event) {
|
|
284
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
285
|
-
event.preventDefault();
|
|
286
|
-
toggleZoom();
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
function onPointerDown(event) {
|
|
290
|
-
if (!zoomable.value || zoom.value <= 1) return;
|
|
291
|
-
dragging.value = true;
|
|
292
|
-
didDrag.value = false;
|
|
293
|
-
dragStart.x = event.clientX;
|
|
294
|
-
dragStart.y = event.clientY;
|
|
295
|
-
dragStart.panX = pan.value.x;
|
|
296
|
-
dragStart.panY = pan.value.y;
|
|
297
|
-
}
|
|
298
|
-
function onPointerMove(event) {
|
|
299
|
-
if (!dragging.value) return;
|
|
300
|
-
didDrag.value = true;
|
|
301
|
-
pan.value = {
|
|
302
|
-
x: dragStart.panX + event.clientX - dragStart.x,
|
|
303
|
-
y: dragStart.panY + event.clientY - dragStart.y
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
function onPointerUp() {
|
|
307
|
-
dragging.value = false;
|
|
308
|
-
}
|
|
309
|
-
useFocusTrap({
|
|
310
|
-
container: dialogRef,
|
|
311
|
-
isEnabled: () => props.isOpen && current.value != null
|
|
312
|
-
});
|
|
313
|
-
function pauseVideos() {
|
|
314
|
-
for (const video of dialogRef.value?.querySelectorAll("video") ?? []) if (!video.paused) video.pause();
|
|
315
|
-
}
|
|
316
|
-
watch([() => props.isOpen, () => current.value != null], ([open]) => {
|
|
317
|
-
const dialog = dialogRef.value;
|
|
318
|
-
if (dialog == null) return;
|
|
319
|
-
if (open && !dialog.open) {
|
|
320
|
-
focusRecord?.stop();
|
|
321
|
-
focusRecord = trackLayerFocus({ getLayer: () => dialogRef.value });
|
|
322
|
-
dialog.showModal();
|
|
323
|
-
const video = dialog.querySelector("video");
|
|
324
|
-
if (props.hasAutoPlay && video != null && video.paused) video.play()?.catch(() => {});
|
|
325
|
-
} else if (!open && dialog.open) {
|
|
326
|
-
const record = focusRecord;
|
|
327
|
-
focusRecord = null;
|
|
328
|
-
const wasStranded = record != null && isLayerFocusStranded(record, dialog);
|
|
329
|
-
pauseVideos();
|
|
330
|
-
dialog.close();
|
|
331
|
-
resetZoom();
|
|
332
|
-
if (record != null) {
|
|
333
|
-
if (wasStranded) restoreLayerFocus(record, {
|
|
334
|
-
layer: dialog,
|
|
335
|
-
name: "Lightbox"
|
|
336
|
-
});
|
|
337
|
-
record.stop();
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}, { flush: "post" });
|
|
341
|
-
/**
|
|
342
|
-
* 从图注的「更多」「收起」上翻页时,旧图注随页面换掉,焦点会掉到 body。
|
|
343
|
-
* 这时把焦点交给新一页的照片(能缩放时),否则交给关闭按钮,方向键还能接着翻页。
|
|
344
|
-
*/
|
|
345
|
-
watch(index, () => {
|
|
346
|
-
const active = document.activeElement;
|
|
347
|
-
if (active instanceof HTMLElement && active.closest(".astryx-lightbox__caption-band") != null) nextTick(() => {
|
|
348
|
-
(zoomable.value ? frameRef.value : closeRef.value?.element)?.focus();
|
|
349
|
-
});
|
|
350
|
-
}, { flush: "pre" });
|
|
351
|
-
watch(index, () => {
|
|
352
|
-
resetZoom();
|
|
353
|
-
if (!props.isOpen) return;
|
|
354
|
-
const item = current.value;
|
|
355
|
-
if (item == null || mediaList.value.length < 2) return;
|
|
356
|
-
const position = {
|
|
357
|
-
index: index.value + 1,
|
|
358
|
-
total: mediaList.value.length
|
|
359
|
-
};
|
|
360
|
-
announce(item.alt ? messages.value.lightbox.mediaPosition(item.alt, position.index, position.total) : messages.value.lightbox.imagePosition(position.index, position.total));
|
|
361
|
-
});
|
|
362
|
-
watch([dragging], ([isDragging]) => {
|
|
363
|
-
if (!isDragging) return;
|
|
364
|
-
window.addEventListener("pointermove", onPointerMove);
|
|
365
|
-
window.addEventListener("pointerup", onPointerUp);
|
|
366
|
-
}, { flush: "post" });
|
|
367
|
-
onBeforeUnmount(() => {
|
|
368
|
-
window.removeEventListener("pointermove", onPointerMove);
|
|
369
|
-
window.removeEventListener("pointerup", onPointerUp);
|
|
370
|
-
const record = focusRecord;
|
|
371
|
-
focusRecord = null;
|
|
372
|
-
if (record == null) return;
|
|
373
|
-
const wasStranded = dialogRef.value?.open === true && isLayerFocusStranded(record, dialogRef.value);
|
|
374
|
-
queueMicrotask(() => {
|
|
375
|
-
if (wasStranded) restoreLayerFocus(record, {
|
|
376
|
-
layer: null,
|
|
377
|
-
name: "Lightbox"
|
|
378
|
-
});
|
|
379
|
-
record.stop();
|
|
380
|
-
});
|
|
381
|
-
});
|
|
382
|
-
watch(dragging, (isDragging, wasDragging) => {
|
|
383
|
-
if (wasDragging && !isDragging) {
|
|
384
|
-
window.removeEventListener("pointermove", onPointerMove);
|
|
385
|
-
window.removeEventListener("pointerup", onPointerUp);
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
return (_ctx, _cache) => {
|
|
389
|
-
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" eslint-disable-next-line vue-a11y/click-events-have-key-events, vue-a11y/no-static-element-interactions -- 点在 dialog 自身上等于点遮罩;键盘走 Escape 和方向键。 "), current.value ? (openBlock(), createElementBlock("dialog", {
|
|
390
|
-
key: 0,
|
|
391
|
-
ref: "dialog",
|
|
392
|
-
class: normalizeClass(["astryx-lightbox astryx-layer", _ctx.$attrs.class]),
|
|
393
|
-
style: normalizeStyle(_ctx.$attrs.style),
|
|
394
|
-
"aria-label": current.value.alt || unref(messages).lightbox.mediaViewer,
|
|
395
|
-
"aria-describedby": current.value.caption ? captionId : void 0,
|
|
396
|
-
"data-gallery": isGallery.value || void 0,
|
|
397
|
-
"data-caption-band": hasCaptionBand.value || void 0,
|
|
398
|
-
"data-component": "lightbox",
|
|
399
|
-
onCancel,
|
|
400
|
-
onClick: onBackdropClick,
|
|
401
|
-
onKeydown: onKeyDown
|
|
402
|
-
}, [createElementVNode("div", {
|
|
403
|
-
ref_key: "containerRef",
|
|
404
|
-
ref: containerRef,
|
|
405
|
-
class: "astryx-lightbox__container"
|
|
406
|
-
}, [
|
|
407
|
-
createVNode(_sfc_main$3, {
|
|
408
|
-
ref: "close",
|
|
409
|
-
class: "astryx-lightbox__close",
|
|
410
|
-
variant: "ghost",
|
|
411
|
-
size: "sm",
|
|
412
|
-
label: unref(messages).lightbox.close,
|
|
413
|
-
onClick: close
|
|
414
|
-
}, {
|
|
415
|
-
default: withCtx(() => [createVNode(_sfc_main$2, {
|
|
416
|
-
icon: "close",
|
|
417
|
-
size: "sm"
|
|
418
|
-
})]),
|
|
419
|
-
_: 1
|
|
420
|
-
}, 8, ["label"]),
|
|
421
|
-
isGallery.value ? (openBlock(), createBlock(_sfc_main$3, {
|
|
422
|
-
key: 0,
|
|
423
|
-
class: "astryx-lightbox__nav astryx-lightbox__nav--prev",
|
|
424
|
-
variant: "ghost",
|
|
425
|
-
size: "sm",
|
|
426
|
-
label: unref(messages).lightbox.previous,
|
|
427
|
-
"is-disabled": !canPrev.value,
|
|
428
|
-
onClick: _cache[0] || (_cache[0] = ($event) => setIndex(index.value - 1))
|
|
429
|
-
}, {
|
|
430
|
-
default: withCtx(() => [createVNode(_sfc_main$2, {
|
|
431
|
-
icon: "chevronLeft",
|
|
432
|
-
size: "sm"
|
|
433
|
-
})]),
|
|
434
|
-
_: 1
|
|
435
|
-
}, 8, ["label", "is-disabled"])) : createCommentVNode("v-if", true),
|
|
436
|
-
createElementVNode("div", _hoisted_2, [
|
|
437
|
-
createCommentVNode(" eslint-disable-next-line vue-a11y/no-static-element-interactions -- 可缩放时 role、tabindex 和 aria 从脚本绑上;视频没有这些交互。 "),
|
|
438
|
-
createElementVNode("div", {
|
|
439
|
-
ref: "frame",
|
|
440
|
-
class: "astryx-lightbox__frame",
|
|
441
|
-
"data-zoomable": zoomable.value || void 0,
|
|
442
|
-
"data-zoomed": zoom.value > 1 || void 0,
|
|
443
|
-
"data-dragging": dragging.value || void 0,
|
|
444
|
-
role: zoomable.value ? "button" : void 0,
|
|
445
|
-
tabindex: zoomable.value ? 0 : void 0,
|
|
446
|
-
"aria-pressed": zoomable.value ? zoom.value > 1 : void 0,
|
|
447
|
-
"aria-label": zoomable.value ? unref(messages).lightbox.zoom : void 0,
|
|
448
|
-
onDblclick: _cache[1] || (_cache[1] = ($event) => isVideo.value ? void 0 : toggleZoom()),
|
|
449
|
-
onKeydown: _cache[2] || (_cache[2] = ($event) => zoomable.value ? onImageKeyDown($event) : void 0),
|
|
450
|
-
onPointerdown: _cache[3] || (_cache[3] = ($event) => isVideo.value ? void 0 : onPointerDown($event))
|
|
451
|
-
}, [createCommentVNode(" eslint-disable-next-line vue-a11y/media-has-caption -- 说明文字在灯箱 caption 里;媒体文件本身不带字幕轨。 "), isVideo.value ? (openBlock(), createElementBlock("video", {
|
|
452
|
-
key: 0,
|
|
453
|
-
class: "astryx-lightbox__video",
|
|
454
|
-
src: current.value.src,
|
|
455
|
-
"aria-label": current.value.alt,
|
|
456
|
-
controls: "",
|
|
457
|
-
autoplay: __props.hasAutoPlay && __props.isOpen
|
|
458
|
-
}, null, 8, _hoisted_4)) : (openBlock(), createElementBlock("img", {
|
|
459
|
-
key: 1,
|
|
460
|
-
class: "astryx-lightbox__image",
|
|
461
|
-
src: current.value.src,
|
|
462
|
-
alt: current.value.alt,
|
|
463
|
-
draggable: "false",
|
|
464
|
-
style: normalizeStyle(imageTransform.value ? { transform: imageTransform.value } : void 0),
|
|
465
|
-
"data-dragging": dragging.value || void 0
|
|
466
|
-
}, null, 12, _hoisted_5))], 40, _hoisted_3),
|
|
467
|
-
hasCaptionBand.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
468
|
-
id: captionId,
|
|
469
|
-
key: index.value,
|
|
470
|
-
text: current.value.caption
|
|
471
|
-
}, null, 8, ["text"])) : createCommentVNode("v-if", true)
|
|
472
|
-
], 512),
|
|
473
|
-
isGallery.value ? (openBlock(), createBlock(_sfc_main$3, {
|
|
474
|
-
key: 1,
|
|
475
|
-
class: "astryx-lightbox__nav astryx-lightbox__nav--next",
|
|
476
|
-
variant: "ghost",
|
|
477
|
-
size: "sm",
|
|
478
|
-
label: unref(messages).lightbox.next,
|
|
479
|
-
"is-disabled": !canNext.value,
|
|
480
|
-
onClick: _cache[4] || (_cache[4] = ($event) => setIndex(index.value + 1))
|
|
481
|
-
}, {
|
|
482
|
-
default: withCtx(() => [createVNode(_sfc_main$2, {
|
|
483
|
-
icon: "chevronRight",
|
|
484
|
-
size: "sm"
|
|
485
|
-
})]),
|
|
486
|
-
_: 1
|
|
487
|
-
}, 8, ["label", "is-disabled"])) : createCommentVNode("v-if", true),
|
|
488
|
-
isGallery.value ? (openBlock(), createElementBlock("p", _hoisted_6, toDisplayString(index.value + 1) + " / " + toDisplayString(mediaList.value.length), 1)) : createCommentVNode("v-if", true)
|
|
489
|
-
], 512), createElementVNode("div", _hoisted_7, null, 512)], 46, _hoisted_1)) : createCommentVNode("v-if", true)], 2112);
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
});
|
|
493
|
-
//#endregion
|
|
494
|
-
//#region src/Lightbox/useLightbox.ts
|
|
495
|
-
/**
|
|
496
|
-
* Owns the open state and gallery index for a `Lightbox`.
|
|
497
|
-
* Bind `bindings` onto `Lightbox`, and call `open(index)` from a thumbnail.
|
|
498
|
-
*/
|
|
499
|
-
function useLightbox(options) {
|
|
500
|
-
const isOpen = ref(false);
|
|
501
|
-
const index = ref(0);
|
|
502
|
-
function open(next = 0) {
|
|
503
|
-
index.value = next;
|
|
504
|
-
isOpen.value = true;
|
|
505
|
-
}
|
|
506
|
-
function close() {
|
|
507
|
-
isOpen.value = false;
|
|
508
|
-
}
|
|
509
|
-
function triggerPropsFor(next) {
|
|
510
|
-
return {
|
|
511
|
-
"aria-haspopup": "dialog",
|
|
512
|
-
"onClick": () => open(next),
|
|
513
|
-
"onKeydown": (event) => {
|
|
514
|
-
if (event.key !== "Enter" && event.key !== " ") return;
|
|
515
|
-
event.preventDefault();
|
|
516
|
-
open(next);
|
|
517
|
-
},
|
|
518
|
-
"role": "button",
|
|
519
|
-
"tabindex": 0
|
|
520
|
-
};
|
|
521
|
-
}
|
|
522
|
-
return {
|
|
523
|
-
bindings: computed(() => ({
|
|
524
|
-
"hasAutoPlay": options.hasAutoPlay,
|
|
525
|
-
"hasZoom": options.hasZoom,
|
|
526
|
-
"index": index.value,
|
|
527
|
-
"isOpen": isOpen.value,
|
|
528
|
-
"media": options.media,
|
|
529
|
-
"onUpdate:index": (next) => {
|
|
530
|
-
index.value = next;
|
|
531
|
-
},
|
|
532
|
-
"onUpdate:isOpen": (next) => {
|
|
533
|
-
isOpen.value = next;
|
|
534
|
-
}
|
|
535
|
-
})),
|
|
536
|
-
close,
|
|
537
|
-
getTriggerProps: triggerPropsFor,
|
|
538
|
-
index,
|
|
539
|
-
isOpen,
|
|
540
|
-
open,
|
|
541
|
-
triggerProps: computed(() => triggerPropsFor(0))
|
|
542
|
-
};
|
|
543
|
-
}
|
|
544
|
-
//#endregion
|
|
545
|
-
export { _sfc_main as n, useLightbox as t };
|
|
@@ -43,9 +43,9 @@ declare const __VLS_base: import("vue").DefineComponent<TokenProps, {}, {}, {},
|
|
|
43
43
|
onRemove?: ((event: Event) => any) | undefined;
|
|
44
44
|
}>, {
|
|
45
45
|
size: TokenSize;
|
|
46
|
+
color: "default" | "blue" | "cyan" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow";
|
|
46
47
|
labelHidden: boolean;
|
|
47
48
|
disabled: boolean;
|
|
48
|
-
color: "default" | "blue" | "cyan" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow";
|
|
49
49
|
removable: boolean;
|
|
50
50
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
51
51
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|