@esri/calcite-components 5.0.0-next.88 → 5.0.0-next.89
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/cdn/{JEKNLQYF.js → 2ONQDURU.js} +2 -2
- package/dist/cdn/{3QAVXUOG.js → 2PJCBEJA.js} +2 -2
- package/dist/cdn/{RTCV6EC7.js → 2XQ4VC3V.js} +2 -2
- package/dist/cdn/{S7I3XRAV.js → 3AZH5LXB.js} +2 -2
- package/dist/cdn/{LHAOY3CL.js → 3EMBTSOD.js} +2 -2
- package/dist/cdn/{E7QB63HE.js → 3K2QPUJI.js} +2 -2
- package/dist/cdn/{SASS5M3V.js → 3LCTRASQ.js} +2 -2
- package/dist/cdn/{LUYHYXD3.js → 3QIIUFLB.js} +2 -2
- package/dist/cdn/{HWTAELXY.js → 3UFJQU7S.js} +2 -2
- package/dist/cdn/{G3LKP2IV.js → 3UHBX53S.js} +1 -1
- package/dist/cdn/{CH2LOU5Y.js → 3UPFDFMA.js} +2 -2
- package/dist/cdn/{IMXLBS5R.js → 47UST7ZY.js} +2 -2
- package/dist/cdn/{SPM7U4QK.js → 4EB3D7ZW.js} +2 -2
- package/dist/cdn/{SOA5G6E4.js → 4JU3AKN6.js} +2 -2
- package/dist/cdn/{A5EH7UV2.js → 4QVQ6UIF.js} +2 -2
- package/dist/cdn/{XMEUPVB6.js → 4WIJPGL4.js} +2 -2
- package/dist/cdn/{U4Z6HR7Y.js → 4Z6QEXEG.js} +2 -2
- package/dist/cdn/{XIKCSTRR.js → 56RQHSBE.js} +1 -1
- package/dist/cdn/{QE2P3453.js → 577SGW7P.js} +2 -2
- package/dist/cdn/{W7BJHTOS.js → 5LBRNIGF.js} +2 -2
- package/dist/cdn/{2ZYK7TYN.js → 5MTOTLZE.js} +2 -2
- package/dist/cdn/{6YPGUB7K.js → 5UCSDXDC.js} +2 -2
- package/dist/cdn/{5CUBAP7O.js → 5WBANGJD.js} +2 -2
- package/dist/cdn/{LT5BR3RS.js → 63T4PB7U.js} +2 -2
- package/dist/cdn/{Z4ETK22W.js → 64IGPE2N.js} +2 -2
- package/dist/cdn/{TQCODZFF.js → 65VNRAW6.js} +1 -1
- package/dist/cdn/{6MGGOBIX.js → 66X2CBAY.js} +2 -2
- package/dist/cdn/{2YZLPQBK.js → 6IY4YQOR.js} +2 -2
- package/dist/cdn/{CRABNI3B.js → 6QRCN5VP.js} +2 -2
- package/dist/cdn/{IESOUZK3.js → 6USGG4G3.js} +2 -2
- package/dist/cdn/{FG4UA6D6.js → 75XGQCTC.js} +1 -1
- package/dist/cdn/{UGNSSGCY.js → 7FJDNNQH.js} +2 -2
- package/dist/cdn/{GKOCKF4A.js → 7IFGC7DV.js} +2 -2
- package/dist/cdn/{MZWMITSG.js → 7LONPDGE.js} +1 -1
- package/dist/cdn/{5TX5GQJC.js → 7NLYVILI.js} +2 -2
- package/dist/cdn/{NQH4VLLT.js → 7VN4OJKN.js} +2 -2
- package/dist/cdn/{MJKLSP2P.js → A6AXPN2G.js} +2 -2
- package/dist/cdn/{CD3J4TLI.js → AFAONIQJ.js} +1 -1
- package/dist/cdn/{JGXR5K5I.js → AFHUIPDJ.js} +2 -2
- package/dist/cdn/{Q7LYBTY6.js → AHSFENOX.js} +2 -2
- package/dist/cdn/{FEWA6LQK.js → AMZQB3ZM.js} +2 -2
- package/dist/cdn/{4YGP4R44.js → ARHGGR4I.js} +2 -2
- package/dist/cdn/{5Z432T42.js → B4UY4YMK.js} +2 -2
- package/dist/cdn/{HXY3H2PS.js → BRWGEU6Y.js} +1 -1
- package/dist/cdn/{5C4TSPFE.js → BSSCD3WV.js} +2 -2
- package/dist/cdn/{4POTSVRK.js → CAYAAWX5.js} +2 -2
- package/dist/cdn/{7O4KYDQA.js → CEFDXM74.js} +2 -2
- package/dist/cdn/{GBIZXPH6.js → CLUE7H2P.js} +2 -2
- package/dist/cdn/{YXXKVIPW.js → CLYEJI7C.js} +2 -2
- package/dist/cdn/{QETY3BCC.js → DFTYAXWD.js} +2 -2
- package/dist/cdn/{PUR5J76U.js → DKK3HA3M.js} +2 -2
- package/dist/cdn/{Y2VVECCH.js → DP2QHPW6.js} +2 -2
- package/dist/cdn/{SLOTYR4N.js → DQDEAZ6U.js} +1 -1
- package/dist/cdn/{IHTKD2WA.js → DTJGFF2V.js} +1 -1
- package/dist/cdn/{IWNKYOCT.js → DY33YGKS.js} +2 -2
- package/dist/cdn/{RQQQEPSC.js → ELBHMNN6.js} +2 -2
- package/dist/cdn/{IYI4TSIB.js → ENPUQLLO.js} +2 -2
- package/dist/cdn/{4F56XYEX.js → ENY6XTAW.js} +2 -2
- package/dist/cdn/{DO4OYFDZ.js → F24TSO2C.js} +2 -2
- package/dist/cdn/{FEUI6H35.js → F3KUY6XX.js} +2 -2
- package/dist/cdn/{YRHEFBFC.js → FEQ35Z4L.js} +2 -2
- package/dist/cdn/{7OQV6IIP.js → FHI3NK3Z.js} +2 -2
- package/dist/cdn/{WCQQMQ4U.js → FPITYS6H.js} +2 -2
- package/dist/cdn/{JYDJAZHI.js → FYRAFGUK.js} +2 -2
- package/dist/cdn/{CETKRQOK.js → G22PFYKW.js} +2 -2
- package/dist/cdn/{EOR33TW2.js → G6QH2KC4.js} +2 -2
- package/dist/cdn/{LHE7YL4K.js → GEX3NTMA.js} +2 -2
- package/dist/cdn/{H7SAPASI.js → GGEFOMIC.js} +1 -1
- package/dist/cdn/{62N2PXM7.js → GYAEPFHS.js} +2 -2
- package/dist/cdn/{Z7N7ZFPG.js → H3J6TBNK.js} +2 -2
- package/dist/cdn/{IZSXSJX2.js → H5STA2ZE.js} +2 -2
- package/dist/cdn/{T3IG7WCW.js → H6M6RHJW.js} +2 -2
- package/dist/cdn/{EMFOVAUX.js → HOZ7BHP6.js} +2 -2
- package/dist/cdn/{S24ZROAT.js → HVXCKKU3.js} +2 -2
- package/dist/cdn/{3I4NM5P2.js → HYAV36RF.js} +2 -2
- package/dist/cdn/{KPNJULQX.js → I4EONMS5.js} +2 -2
- package/dist/cdn/{7FGHJCIU.js → I67SGSCW.js} +2 -2
- package/dist/cdn/{4YGBY7AH.js → IKLHRFXD.js} +2 -2
- package/dist/cdn/{ZZO4GIL7.js → INOC7TAR.js} +2 -2
- package/dist/cdn/{ZKJUCMQI.js → IPXC7DQ7.js} +2 -2
- package/dist/cdn/{U2ACL5CX.js → IXWPX6EV.js} +2 -2
- package/dist/cdn/{QLQFPA45.js → J2HWAA7U.js} +2 -2
- package/dist/cdn/{WNKLW2QH.js → J54TNYLS.js} +2 -2
- package/dist/cdn/{OINR5OC3.js → J6WT37IC.js} +2 -2
- package/dist/cdn/{DQPCOPV3.js → J7TD5FI7.js} +2 -2
- package/dist/cdn/{PWCMPHTR.js → JC2KYX74.js} +2 -2
- package/dist/cdn/{ZHS4MHBE.js → JDSROST5.js} +2 -2
- package/dist/cdn/{MM4QCCLO.js → JHFQO64A.js} +2 -2
- package/dist/cdn/{BPBUMGVM.js → JHLO362J.js} +2 -2
- package/dist/cdn/{J7JCGVUG.js → JJIH3TDL.js} +1 -1
- package/dist/cdn/{RRPDHTEI.js → JMCQIXYL.js} +1 -1
- package/dist/cdn/{ZQBQQYRW.js → JVIAGVNJ.js} +2 -2
- package/dist/cdn/{CIO54O5A.js → JWAPYNOT.js} +2 -2
- package/dist/cdn/{VUW7L4K7.js → K4BMNII2.js} +2 -2
- package/dist/cdn/{YTQIGWYQ.js → K7FAY6OJ.js} +2 -2
- package/dist/cdn/{WPLIPWWJ.js → KDFRUQUZ.js} +2 -2
- package/dist/cdn/{ODV6CLLO.js → KYZNMOIF.js} +2 -2
- package/dist/cdn/{AIYN7HUH.js → LDHPKSGI.js} +2 -2
- package/dist/cdn/{2QZXHCFD.js → LDWZB5K4.js} +2 -2
- package/dist/cdn/{TRFLKRZ4.js → LG4WLDBJ.js} +2 -2
- package/dist/cdn/{BSGJJKF7.js → LODSUU2M.js} +2 -2
- package/dist/cdn/{W25QNUU7.js → LOEIBK34.js} +2 -2
- package/dist/cdn/{PQGEFRXW.js → LUP2IKH2.js} +2 -2
- package/dist/cdn/{4RZKXIRR.js → M46Y2CTQ.js} +2 -2
- package/dist/cdn/{AQIJUGFU.js → M5VITPPT.js} +2 -2
- package/dist/cdn/{GB3XSPDJ.js → MCHVOTKC.js} +2 -2
- package/dist/cdn/{HKC3B47J.js → MEB27SYN.js} +2 -2
- package/dist/cdn/{L4ZDCUZR.js → MLP57F7O.js} +2 -2
- package/dist/cdn/{UDZ2H2CE.js → MPXMVTUH.js} +2 -2
- package/dist/cdn/{GK2U7ESI.js → N5RT25C2.js} +2 -2
- package/dist/cdn/{JXV4E5JI.js → NFVAS5ZC.js} +1 -1
- package/dist/cdn/{RDI2S6S3.js → NFVHE6RN.js} +2 -2
- package/dist/cdn/{35AO2CZ7.js → NLHT7BPH.js} +2 -2
- package/dist/cdn/{BMTSUAAM.js → NPB7VTTN.js} +1 -1
- package/dist/cdn/{B2ZPP7JL.js → NV7E2L2T.js} +2 -2
- package/dist/cdn/{FJA7Y7VA.js → NY7QUM3V.js} +2 -2
- package/dist/cdn/{IALP5CDY.js → O3BWHAFC.js} +2 -2
- package/dist/cdn/{NVD7JPTR.js → O6UXSHGY.js} +1 -1
- package/dist/cdn/{GLMPRSV4.js → OM7XTO6J.js} +1 -1
- package/dist/cdn/{AIBB5O5P.js → OTKXQJE6.js} +2 -2
- package/dist/cdn/{5RCNA2RB.js → P2D55RG4.js} +2 -2
- package/dist/cdn/{G3CEARTA.js → P37A5TKL.js} +2 -2
- package/dist/cdn/{FSRAWGUG.js → P7PTZ5SA.js} +1 -1
- package/dist/cdn/{TBBJYCRA.js → PN24JTMZ.js} +2 -2
- package/dist/cdn/{JKUYKVTP.js → QEWDKVL7.js} +2 -2
- package/dist/cdn/{2YJHITCD.js → QFAGKUBA.js} +2 -2
- package/dist/cdn/{HH5T3FXJ.js → QJONTQZC.js} +2 -2
- package/dist/cdn/{WTUDT6B3.js → QOSSSJA2.js} +2 -2
- package/dist/cdn/{EOET2ACX.js → QSYCSKA4.js} +1 -1
- package/dist/cdn/{OZOEPKES.js → QU6HOXFQ.js} +2 -2
- package/dist/cdn/{DS7OW5PS.js → QVJA57NY.js} +2 -2
- package/dist/cdn/{TITR7KAS.js → R27SU7NH.js} +1 -1
- package/dist/cdn/{SBTAFILO.js → R3GQZCQ5.js} +2 -2
- package/dist/cdn/{6QXINKX2.js → R4I36JSJ.js} +2 -2
- package/dist/cdn/{4ISE6QSM.js → R4IG3CRO.js} +1 -1
- package/dist/cdn/{IYZNVE7O.js → R5BNTZ2Z.js} +2 -2
- package/dist/cdn/{I6ZKRGOM.js → RAHMTI7S.js} +2 -2
- package/dist/cdn/{U6QH7DFS.js → RN5C543B.js} +2 -2
- package/dist/cdn/{ZWY7TYXV.js → RPBMY35D.js} +2 -2
- package/dist/cdn/{OKSUNAK3.js → RUJ3VBQD.js} +2 -2
- package/dist/cdn/{2RA5HH5O.js → SB4EVJLV.js} +2 -2
- package/dist/cdn/{IQ22MCNH.js → SFQHS7TG.js} +2 -2
- package/dist/cdn/{HFIXWD2W.js → SL5RF7IR.js} +2 -2
- package/dist/cdn/{K6UAEBYP.js → SXAAAKMD.js} +2 -2
- package/dist/cdn/{SYR7EN3D.js → THDBITZA.js} +2 -2
- package/dist/cdn/{5DOHXWZH.js → TTZ3U6TC.js} +2 -2
- package/dist/cdn/{PTULIBMG.js → TUCJ65WL.js} +2 -2
- package/dist/cdn/{VP3E7QIB.js → UCCT5A4T.js} +2 -2
- package/dist/cdn/{3UAG7K5W.js → UKLUI5MD.js} +2 -2
- package/dist/cdn/{5FZMCWMO.js → UWCLWRMM.js} +2 -2
- package/dist/cdn/{FOT2F54U.js → UY35SRWF.js} +2 -2
- package/dist/cdn/{VF5A4CV2.js → V3VPT4RV.js} +2 -2
- package/dist/cdn/{2B7WGWZT.js → V4A6BCCI.js} +2 -2
- package/dist/cdn/{ZDTHINC7.js → V7J2MBQL.js} +2 -2
- package/dist/cdn/{QUGOJYRK.js → VANR5BQP.js} +1 -1
- package/dist/cdn/{VPW4TMKN.js → VFWQN5V7.js} +2 -2
- package/dist/cdn/{5DVDEYEI.js → VLLSU6NK.js} +2 -2
- package/dist/cdn/{NAXKTUE5.js → VR4BWV25.js} +2 -2
- package/dist/cdn/{VEF7JFQZ.js → VVYRIEY2.js} +2 -2
- package/dist/cdn/{R2FEBUQ3.js → WUKHSCUQ.js} +2 -2
- package/dist/cdn/{HGCYRFII.js → WYYELYND.js} +2 -2
- package/dist/cdn/{VO4OD52K.js → X3KIBEZG.js} +2 -2
- package/dist/cdn/{MCCZITQC.js → X6UFBNJP.js} +1 -1
- package/dist/cdn/{3VHRFRUQ.js → XOUIZFZ2.js} +2 -2
- package/dist/cdn/{IQH6DZTH.js → XPLN44LD.js} +2 -2
- package/dist/cdn/{ZCJPHXW3.js → XTKF2LXD.js} +2 -2
- package/dist/cdn/{QK5XVIUJ.js → XX4HM6H5.js} +2 -2
- package/dist/cdn/{BBRT3W3F.js → YK3CEUXV.js} +2 -2
- package/dist/cdn/{MAGCHPNI.js → YSTQVB4Y.js} +2 -2
- package/dist/cdn/{N4UEVBJV.js → Z3RRN7CA.js} +1 -1
- package/dist/cdn/{IM6OX44A.js → Z5SSVDJT.js} +1 -1
- package/dist/cdn/{WMXDO3QI.js → ZKK6UOEG.js} +1 -1
- package/dist/cdn/{7MQGQUXX.js → ZN7XBNHP.js} +2 -2
- package/dist/cdn/{AEZGDR43.js → ZPFAMUJV.js} +2 -2
- package/dist/cdn/{6ICU7CZA.js → ZVBF44M6.js} +2 -2
- package/dist/cdn/assets/icon/groupOffSetStartOfLine16.json +1 -0
- package/dist/cdn/assets/icon/groupOffSetStartOfLine24.json +1 -0
- package/dist/cdn/assets/icon/groupOffSetStartOfLine32.json +1 -0
- package/dist/cdn/assets/icon/i3DSearch16.json +1 -0
- package/dist/cdn/assets/icon/i3DSearch24.json +1 -0
- package/dist/cdn/assets/icon/i3DSearch32.json +1 -0
- package/dist/cdn/assets/icon/multiplePolygonFeature16.json +1 -0
- package/dist/cdn/assets/icon/multiplePolygonFeature24.json +1 -0
- package/dist/cdn/assets/icon/multiplePolygonFeature32.json +1 -0
- package/dist/cdn/assets/icon/orientedImageryOverlays16.json +1 -0
- package/dist/cdn/assets/icon/orientedImageryOverlays24.json +1 -0
- package/dist/cdn/assets/icon/orientedImageryOverlays32.json +1 -0
- package/dist/cdn/assets/icon/pointAtEveryIntersection16.json +1 -0
- package/dist/cdn/assets/icon/pointAtEveryIntersection24.json +1 -0
- package/dist/cdn/assets/icon/pointAtEveryIntersection32.json +1 -0
- package/dist/cdn/assets/icon/radialLines16.json +1 -0
- package/dist/cdn/assets/icon/radialLines24.json +1 -0
- package/dist/cdn/assets/icon/radialLines32.json +1 -0
- package/dist/cdn/assets/icon/showOrientedImagery16.json +1 -0
- package/dist/cdn/assets/icon/showOrientedImagery24.json +1 -0
- package/dist/cdn/assets/icon/showOrientedImagery32.json +1 -0
- package/dist/cdn/assets/icon/singleLineFeature16.json +1 -0
- package/dist/cdn/assets/icon/singleLineFeature24.json +1 -0
- package/dist/cdn/assets/icon/singleLineFeature32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAlongLine16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAlongLine24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAlongLine32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtAllVertices16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtAllVertices24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtAllVertices32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtAllVerticesButEnd16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtAllVerticesButEnd24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtAllVerticesButEnd32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtAllVerticesButStart16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtAllVerticesButStart24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtAllVerticesButStart32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtAllVerticesButStartAndEnd16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtAllVerticesButStartAndEnd24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtAllVerticesButStartAndEnd32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtEndOfLine16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtEndOfLine24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtEndOfLine32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtStartOfLine16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtStartOfLine24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupAtStartOfLine32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupCoincidentPoints16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupCoincidentPoints24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupCoincidentPoints32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupLineBuffer16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupLineBuffer24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupLineBuffer32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupMultipleLines16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupMultipleLines24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupMultipleLines32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupMultipleTwoPointLines16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupMultipleTwoPointLines24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupMultipleTwoPointLines32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPointAtCentroid16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPointAtCentroid24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPointAtCentroid32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPointAtEveryVertex16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPointAtEveryVertex24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPointAtEveryVertex32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPointAtEveryVertexButStart16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPointAtEveryVertexButStart24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPointAtEveryVertexButStart32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPointAtStart16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPointAtStart24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPointAtStart32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPointBuffer16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPointBuffer24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPointBuffer32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPolygonBuffer16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPolygonBuffer24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupPolygonBuffer32.json +1 -0
- package/dist/cdn/assets/icon/templateGroupSingleLineBoundary16.json +1 -0
- package/dist/cdn/assets/icon/templateGroupSingleLineBoundary24.json +1 -0
- package/dist/cdn/assets/icon/templateGroupSingleLineBoundary32.json +1 -0
- package/dist/cdn/assets/icon/tools16.json +1 -0
- package/dist/cdn/assets/icon/tools24.json +1 -0
- package/dist/cdn/assets/icon/tools32.json +1 -0
- package/dist/cdn/assets/icon/twoPointLines16.json +1 -0
- package/dist/cdn/assets/icon/twoPointLines24.json +1 -0
- package/dist/cdn/assets/icon/twoPointLines32.json +1 -0
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/ExpandToggle.js +1 -1
- package/dist/chunks/FloatingArrow.js +1 -1
- package/dist/chunks/Heading.js +1 -1
- package/dist/chunks/InternalLabel.js +1 -1
- package/dist/chunks/Validation.js +1 -1
- package/dist/chunks/array.js +1 -1
- package/dist/chunks/component.js +1 -1
- package/dist/chunks/core.js +1 -1
- package/dist/chunks/date.js +1 -1
- package/dist/chunks/dom.js +1 -1
- package/dist/chunks/dynamicClasses.js +1 -1
- package/dist/chunks/filter.js +1 -1
- package/dist/chunks/floating-ui.js +1 -1
- package/dist/chunks/form.js +1 -1
- package/dist/chunks/global.js +1 -1
- package/dist/chunks/guid.js +1 -1
- package/dist/chunks/header.js +1 -1
- package/dist/chunks/input.js +1 -1
- package/dist/chunks/key.js +1 -1
- package/dist/chunks/label.js +1 -1
- package/dist/chunks/locale.js +1 -1
- package/dist/chunks/logger.js +1 -1
- package/dist/chunks/math.js +1 -1
- package/dist/chunks/observers.js +1 -1
- package/dist/chunks/openCloseComponent.js +1 -1
- package/dist/chunks/resources.js +1 -1
- package/dist/chunks/resources2.js +1 -1
- package/dist/chunks/resources3.js +1 -1
- package/dist/chunks/resources4.js +1 -1
- package/dist/chunks/resources5.js +1 -1
- package/dist/chunks/resources6.js +1 -1
- package/dist/chunks/resources7.js +1 -1
- package/dist/chunks/resources8.js +1 -1
- package/dist/chunks/resources9.js +1 -1
- package/dist/chunks/responsive.js +1 -1
- package/dist/chunks/runtime.js +5 -5
- package/dist/chunks/sortable.js +1 -1
- package/dist/chunks/sortableComponent.js +1 -1
- package/dist/chunks/text.js +1 -1
- package/dist/chunks/useCancelable.js +1 -1
- package/dist/chunks/useFocusTrap.js +1 -1
- package/dist/chunks/useInteractive.js +1 -1
- package/dist/chunks/usePreventDocumentScroll.js +1 -1
- package/dist/chunks/useSetFocus.js +1 -1
- package/dist/chunks/useSizeOverride.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/chunks/useTime.js +1 -1
- package/dist/chunks/useTopLayer.js +1 -1
- package/dist/chunks/utils.js +1 -1
- package/dist/chunks/utils2.js +1 -1
- package/dist/chunks/utils3.js +1 -1
- package/dist/chunks/utils4.js +1 -1
- package/dist/components/calcite-accordion/customElement.js +1 -1
- package/dist/components/calcite-accordion-item/customElement.js +1 -1
- package/dist/components/calcite-action/customElement.js +1 -1
- package/dist/components/calcite-action-bar/customElement.js +1 -1
- package/dist/components/calcite-action-group/customElement.js +1 -1
- package/dist/components/calcite-action-menu/customElement.js +1 -1
- package/dist/components/calcite-action-pad/customElement.js +1 -1
- package/dist/components/calcite-alert/customElement.js +1 -1
- package/dist/components/calcite-autocomplete/customElement.js +1 -1
- package/dist/components/calcite-autocomplete-item/customElement.js +1 -1
- package/dist/components/calcite-autocomplete-item-group/customElement.js +1 -1
- package/dist/components/calcite-avatar/customElement.js +1 -1
- package/dist/components/calcite-block/customElement.js +1 -1
- package/dist/components/calcite-block-group/customElement.js +1 -1
- package/dist/components/calcite-block-section/customElement.js +1 -1
- package/dist/components/calcite-button/customElement.js +1 -1
- package/dist/components/calcite-card/customElement.js +1 -1
- package/dist/components/calcite-card-group/customElement.js +1 -1
- package/dist/components/calcite-carousel/customElement.js +1 -1
- package/dist/components/calcite-carousel-item/customElement.js +1 -1
- package/dist/components/calcite-checkbox/customElement.js +1 -1
- package/dist/components/calcite-chip/customElement.js +1 -1
- package/dist/components/calcite-chip-group/customElement.js +1 -1
- package/dist/components/calcite-color-picker/customElement.js +1 -1
- package/dist/components/calcite-color-picker-hex-input/customElement.js +1 -1
- package/dist/components/calcite-color-picker-swatch/customElement.js +1 -1
- package/dist/components/calcite-combobox/customElement.js +1 -1
- package/dist/components/calcite-combobox-item/customElement.js +1 -1
- package/dist/components/calcite-combobox-item-group/customElement.js +1 -1
- package/dist/components/calcite-date-picker/customElement.js +1 -1
- package/dist/components/calcite-date-picker-day/customElement.js +1 -1
- package/dist/components/calcite-date-picker-month/customElement.js +1 -1
- package/dist/components/calcite-date-picker-month-header/customElement.js +1 -1
- package/dist/components/calcite-dialog/customElement.js +1 -1
- package/dist/components/calcite-dropdown/customElement.js +1 -1
- package/dist/components/calcite-dropdown-group/customElement.js +1 -1
- package/dist/components/calcite-dropdown-item/customElement.js +1 -1
- package/dist/components/calcite-fab/customElement.js +1 -1
- package/dist/components/calcite-filter/customElement.js +1 -1
- package/dist/components/calcite-flow/customElement.js +1 -1
- package/dist/components/calcite-flow-item/customElement.js +1 -1
- package/dist/components/calcite-graph/customElement.js +1 -1
- package/dist/components/calcite-handle/customElement.js +1 -1
- package/dist/components/calcite-icon/customElement.js +1 -1
- package/dist/components/calcite-inline-editable/customElement.js +1 -1
- package/dist/components/calcite-input/customElement.js +1 -1
- package/dist/components/calcite-input-date-picker/customElement.js +1 -1
- package/dist/components/calcite-input-message/customElement.js +1 -1
- package/dist/components/calcite-input-number/customElement.js +1 -1
- package/dist/components/calcite-input-text/customElement.js +1 -1
- package/dist/components/calcite-input-time-picker/customElement.js +1 -1
- package/dist/components/calcite-input-time-zone/customElement.js +1 -1
- package/dist/components/calcite-label/customElement.js +1 -1
- package/dist/components/calcite-link/customElement.js +1 -1
- package/dist/components/calcite-list/customElement.js +1 -1
- package/dist/components/calcite-list-item/customElement.js +1 -1
- package/dist/components/calcite-list-item-group/customElement.js +1 -1
- package/dist/components/calcite-loader/customElement.js +1 -1
- package/dist/components/calcite-menu/customElement.js +1 -1
- package/dist/components/calcite-menu-item/customElement.js +1 -1
- package/dist/components/calcite-meter/customElement.js +1 -1
- package/dist/components/calcite-navigation/customElement.js +1 -1
- package/dist/components/calcite-navigation-logo/customElement.js +1 -1
- package/dist/components/calcite-navigation-user/customElement.js +1 -1
- package/dist/components/calcite-notice/customElement.js +1 -1
- package/dist/components/calcite-option/customElement.js +1 -1
- package/dist/components/calcite-option-group/customElement.js +1 -1
- package/dist/components/calcite-pagination/customElement.js +1 -1
- package/dist/components/calcite-panel/customElement.js +1 -1
- package/dist/components/calcite-popover/customElement.js +1 -1
- package/dist/components/calcite-progress/customElement.js +1 -1
- package/dist/components/calcite-radio-button/customElement.js +1 -1
- package/dist/components/calcite-radio-button-group/customElement.js +1 -1
- package/dist/components/calcite-rating/customElement.js +1 -1
- package/dist/components/calcite-scrim/customElement.js +1 -1
- package/dist/components/calcite-segmented-control/customElement.js +1 -1
- package/dist/components/calcite-segmented-control-item/customElement.js +1 -1
- package/dist/components/calcite-select/customElement.js +1 -1
- package/dist/components/calcite-sheet/customElement.js +1 -1
- package/dist/components/calcite-shell/customElement.js +1 -1
- package/dist/components/calcite-shell-panel/customElement.js +1 -1
- package/dist/components/calcite-slider/customElement.js +1 -1
- package/dist/components/calcite-sort-handle/customElement.js +1 -1
- package/dist/components/calcite-sortable-list/customElement.js +1 -1
- package/dist/components/calcite-split-button/customElement.js +1 -1
- package/dist/components/calcite-stack/customElement.js +1 -1
- package/dist/components/calcite-stepper/customElement.js +1 -1
- package/dist/components/calcite-stepper-item/customElement.js +1 -1
- package/dist/components/calcite-swatch/customElement.js +1 -1
- package/dist/components/calcite-swatch-group/customElement.js +1 -1
- package/dist/components/calcite-switch/customElement.js +1 -1
- package/dist/components/calcite-tab/customElement.js +1 -1
- package/dist/components/calcite-tab-nav/customElement.js +1 -1
- package/dist/components/calcite-tab-title/customElement.js +1 -1
- package/dist/components/calcite-table/customElement.js +1 -1
- package/dist/components/calcite-table-cell/customElement.js +1 -1
- package/dist/components/calcite-table-header/customElement.js +1 -1
- package/dist/components/calcite-table-row/customElement.js +1 -1
- package/dist/components/calcite-tabs/customElement.js +1 -1
- package/dist/components/calcite-text-area/customElement.js +1 -1
- package/dist/components/calcite-tile/customElement.js +1 -1
- package/dist/components/calcite-tile-group/customElement.js +1 -1
- package/dist/components/calcite-time-picker/customElement.js +1 -1
- package/dist/components/calcite-tooltip/customElement.js +1 -1
- package/dist/components/calcite-tree/customElement.js +1 -1
- package/dist/components/calcite-tree-item/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as b,b as v,j as l,m as F,n as C,q as w}from"./35AO2CZ7.js";import"./5RCNA2RB.js";import{a as H}from"./Z4ETK22W.js";import"./MCCZITQC.js";import"./S7I3XRAV.js";import{D as R,E as A,F as u,Q as I,g as x,h as g,p as f}from"./L4ZDCUZR.js";var h={calendar:"calendar",calendarContainer:"calendar-container",calendarStart:"calendar--start",currentDay:"current-day",dayContainer:"day-container",insideRangeHover:"inside-range--hover",month:"month",noncurrent:"noncurrent",outsideRangeHover:"outside-range--hover",weekDays:"week-days",weekHeader:"week-header",weekHeaderContainer:"week-header-container"},Y=x`:host([hidden]){display:none}[hidden]{display:none}.calendar-container{display:flex;inline-size:100%}:host([range][layout=vertical]) .calendar-container{flex-direction:column}.calendar{inline-size:100%}.week-header-container{display:flex;block-size:16px;padding-inline:var(--calcite-spacing-sm);padding-block:var(--calcite-spacing-md)}.week-header{display:flex;align-items:center;justify-content:center;text-align:center;font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);font-weight:var(--calcite-font-weight-bold);inline-size:14.2857142857%;color:var(--calcite-date-picker-week-header-text-color, var(--calcite-color-text-2))}.day-container{display:flex;inline-size:100%;min-inline-size:0px;justify-content:center}.day-container calcite-date-picker-day{inline-size:100%}.week-days{display:grid;grid-template-columns:repeat(7,1fr);grid-auto-rows:1fr;padding-inline:var(--calcite-spacing-sm);padding-block-end:var(--calcite-spacing-sm)}.month-header{display:flex;inline-size:100%;justify-content:space-between}.month{display:flex;inline-size:100%;flex-direction:column;justify-content:space-between}.day{font-size:var(--calcite-font-size)}:host([scale=s]) .week-days{padding-inline:var(--calcite-spacing-xs);padding-block-end:var(--calcite-spacing-xs)}:host([scale=s]) .week-header-container{padding-inline:var(--calcite-spacing-xs);padding-block:var(--calcite-spacing-sm)}:host([scale=s]) .day{font-size:var(--calcite-font-size-sm)}:host([scale=l]) .week-header{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base)}:host([scale=l]) .week-days{padding-inline:var(--calcite-spacing-md);padding-block-end:var(--calcite-spacing-md)}:host([scale=l]) .week-header-container{padding-inline:var(--calcite-spacing-md);padding-block:var(--calcite-spacing-md-plus)}:host([scale=l]) .day{font-size:var(--calcite-font-size-md)}.calendar--start{border-width:0px;border-style:solid;border-color:var(--calcite-date-picker-range-calendar-divider-color, var(--calcite-color-border-1))}:host([range][layout=horizontal][calendars="2"]) .calendar--start{border-inline-end-width:var(--calcite-border-width-sm)}:host([range][layout=vertical][calendars="2"]) .calendar--start{border-block-end-width:var(--calcite-border-width-sm)}.noncurrent{pointer-events:none;opacity:0}`,p=7,M=6,P=42,S=class extends A{constructor(){super(),this.storeDayRef=e=>{e?.active&&this.activeFocus&&e.setFocus()},this.activeDate=new Date,this.calendars=2,this.range=!1,this.calciteInternalDatePickerDayHover=f({cancelable:!1}),this.calciteInternalDatePickerDaySelect=f({cancelable:!1}),this.calciteInternalDatePickerMonthActiveDateChange=f({cancelable:!1}),this.calciteInternalDatePickerMonthChange=f({cancelable:!1}),this.calciteInternalDatePickerMonthMouseOut=f({cancelable:!1}),this.listen("pointerout",this.pointerOutHandler),this.listen("focusout",this.disableActiveFocus)}static{this.properties={focusedDate:[16,{},{state:!0}],activeDate:[0,{},{attribute:!1}],calendars:[11,{},{type:Number,reflect:!0}],dateTimeFormat:[0,{},{attribute:!1}],endDate:[0,{},{attribute:!1}],headingLevel:[11,{},{type:Number,reflect:!0}],hoverRange:[0,{},{attribute:!1}],layout:[3,{},{reflect:!0}],localeData:[0,{},{attribute:!1}],max:[0,{},{attribute:!1}],messages:[0,{},{attribute:!1}],min:[0,{},{attribute:!1}],monthStyle:1,range:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],selectedDate:[0,{},{attribute:!1}],startDate:[0,{},{attribute:!1}]}}static{this.styles=Y}load(){this.focusedDate=this.selectedDate||this.activeDate}willUpdate(e){e.has("activeDate")&&this.updateFocusedDateWithActive(this.activeDate),e.has("selectedDate")&&(this.focusedDate=this.selectedDate)}updateFocusedDateWithActive(e){this.selectedDate||(this.focusedDate=b(e,this.min,this.max)?e:v(e,this.min,this.max))}keyDownHandler(e){if(e.defaultPrevented)return;let a=this.el.dir==="rtl",t=e.target.value;switch(e.key){case"ArrowUp":e.preventDefault(),this.addDays(-7,t);break;case"ArrowRight":e.preventDefault(),this.addDays(a?-1:1,t);break;case"ArrowDown":e.preventDefault(),this.addDays(7,t);break;case"ArrowLeft":e.preventDefault(),this.addDays(a?1:-1,t);break;case"PageUp":e.preventDefault(),this.addMonths(-1,t);break;case"PageDown":e.preventDefault(),this.addMonths(1,t);break;case"Home":e.preventDefault(),this.activeDate.setDate(1),this.addDays(0,t);break;case"End":e.preventDefault(),this.activeDate.setDate(new Date(this.activeDate.getFullYear(),this.activeDate.getMonth()+1,0).getDate()),this.addDays(0,t);break;case"Enter":case" ":e.preventDefault();break;case"Tab":this.activeFocus=!1}}disableActiveFocus(){this.activeFocus=!1}pointerOutHandler(){this.calciteInternalDatePickerMonthMouseOut.emit()}addMonths(e,a){let t=new Date(a);t.setMonth(a.getMonth()+e),this.calciteInternalDatePickerMonthActiveDateChange.emit(v(t,this.min,this.max)),this.focusedDate=v(t,this.min,this.max),this.activeFocus=!0,this.calciteInternalDatePickerDayHover.emit(t)}addDays(e=0,a){let t=new Date(a);t.setDate(a.getDate()+e),this.calciteInternalDatePickerMonthActiveDateChange.emit(v(t,this.min,this.max)),this.focusedDate=v(t,this.min,this.max),this.activeFocus=!0,this.calciteInternalDatePickerDayHover.emit(t)}getPreviousMonthDays(e,a,t){let s=new Date(a,e,0),i=s.getDate(),n=s.getDay(),o=[];if(n===(t+M)%p)return o;if(n===t)return[i];for(let r=(p+n-t)%p;r>=0;r--)o.push(i-r);return o}getCurrentMonthDays(e,a){let t=new Date(a,e+1,0).getDate(),s=[];for(let i=0;i<t;i++)s.push(i+1);return s}getNextMonthDays(e,a,t){let s=new Date(a,e+1,0).getDay(),i=[];if(s===(t+M)%p)return i;for(let n=0;n<(M-(s-t))%p;n++)i.push(n+1);return i}betweenSelectedRange(e){return!!(this.startDate&&this.endDate&&e>this.startDate&&e<this.endDate&&!this.isRangeHover(e))}isSelected(e){return!!(l(e,this.selectedDate)||this.startDate&&l(e,this.startDate)||this.endDate&&l(e,this.endDate))}isStartOfRange(e){return!!(this.startDate&&!l(this.startDate,this.endDate)&&l(this.startDate,e)&&!this.isEndOfRange(e))}isEndOfRange(e){return!!(this.endDate&&!l(this.startDate,this.endDate)&&l(this.endDate,e)||!this.endDate&&this.hoverRange&&l(this.startDate,this.hoverRange.end)&&l(e,this.hoverRange.end))}dayHover(e){let a=e.target;a.disabled?this.calciteInternalDatePickerMonthMouseOut.emit():this.calciteInternalDatePickerDayHover.emit(a.value),e.stopPropagation()}daySelect(e){let a=e.target;this.activeFocus=!1,this.calciteInternalDatePickerDaySelect.emit(a.value),e.stopPropagation()}isFocusedOnStart(){return this.hoverRange?.focused==="start"}isHoverInRange(){if(!this.hoverRange||!this.startDate)return!1;let{start:e,end:a}=this.hoverRange,t=this.isFocusedOnStart(),s=this.startDate&&a>this.startDate,i=this.endDate&&a<this.endDate,n=this.startDate&&e>this.startDate,o=this.endDate&&e<this.endDate,r=!t&&this.startDate&&s&&(!this.endDate||i),D=t&&this.startDate&&n&&o;return r||D}isRangeHover(e){if(!this.hoverRange)return!1;let{start:a,end:t}=this.hoverRange,s=this.isFocusedOnStart(),i=this.isHoverInRange(),n=e>a&&e<this.startDate,o=e<t&&e>this.endDate,r=e>t&&e<this.endDate,D=e<a&&e>this.startDate,y=e<t&&e>this.startDate,c=e>a&&e<this.endDate,d=this.startDate&&this.endDate;if(i){if(d)return s?e<this.endDate&&(D||n):r||o;if(this.startDate&&!this.endDate)return s?n:y;if(!this.startDate&&this.endDate)return s?c:o}else if(d)return s?n:o}getDays(e,a,t,s="start"){let i=this.activeDate.getMonth(),n=i+1;i=s==="end"?n:i;let o=0,r=()=>o++%7,D=this.activeDate.getFullYear();return[...e.map(c=>({active:!1,day:c,dayInWeek:r(),date:new Date(D,i-1,c)})),...a.map(c=>{let d=new Date(D,i,c),m=l(d,new Date);return{active:this.focusedDate&&this.focusedDate!==this.startDate&&this.focusedDate!==this.endDate?l(d,this.focusedDate):l(d,this.startDate)||l(d,this.endDate),currentMonth:!0,currentDay:m,day:c,dayInWeek:r(),date:d}}),...t.map(c=>({active:!1,day:c,dayInWeek:r(),date:new Date(D,n,c)}))]}monthHeaderSelectChange(e){let a=new Date(e.detail),t=e.target;this.updateFocusableDate(a),e.stopPropagation(),this.calciteInternalDatePickerMonthChange.emit({date:a,position:t.position})}updateFocusableDate(e){!this.selectedDate||!this.range?this.focusedDate=this.getFirstValidDateOfMonth(e):this.selectedDate&&this.range&&(!w(this.startDate,e)||!w(this.endDate,e))&&(this.focusedDate=this.getFirstValidDateOfMonth(e))}getFirstValidDateOfMonth(e){return e.getDate()===1?e:F(e,this.min,this.max)}render(){let e=this.activeDate.getMonth(),a=this.activeDate.getFullYear(),t=this.localeData.weekStart%7,{abbreviated:s,short:i,narrow:n}=this.localeData.days,o=this.scale==="s"?n||i||s:i||s||n,r=[...o.slice(t,7),...o.slice(0,t)],D=this.getCurrentMonthDays(e,a),y=this.getPreviousMonthDays(e,a,t),c=this.getNextMonthDays(e,a,t),d=D.length+y.length+c.length;if(d<P){let N=c.length?c[c.length-1]:0;for(let k=1;k<=P-d;k++)c.push(N+k)}let m=e+1,$=this.getPreviousMonthDays(m,a,t),E=this.getCurrentMonthDays(m,a),z=this.getNextMonthDays(m,a,t),O=this.getDays(y,D,c),B=this.getDays($,E,z,"end");return g`<div class=${u({[h.calendarContainer]:!0})} role=grid>${this.renderCalendar(r,O)}${this.range&&this.calendars===2&&this.renderCalendar(r,B,!0)||""}</div>`}renderDateDay({active:e,currentMonth:a,currentDay:t,date:s,day:i,dayInWeek:n},o){let r=b(s,this.min,this.max);return H(o,g`<div class=${u({[h.dayContainer]:!0})} role=gridcell><calcite-date-picker-day .active=${e} class=${u({[h.currentDay]:t,[h.insideRangeHover]:this.isHoverInRange(),[h.outsideRangeHover]:!this.isHoverInRange(),[h.noncurrent]:this.range&&!a})} .currentMonth=${a} .dateTimeFormat=${this.dateTimeFormat} .day=${i} .disabled=${!r} .endOfRange=${this.isEndOfRange(s)} .highlighted=${this.betweenSelectedRange(s)} @calciteInternalDayHover=${this.dayHover} @calciteInternalDaySelect=${this.daySelect} .range=${!!this.startDate&&!!this.endDate&&!l(this.startDate,this.endDate)} .rangeEdge=${n===0?"start":n===6?"end":void 0} .rangeHover=${r&&this.isRangeHover(s)} .scale=${this.scale} .selected=${this.isSelected(s)} .startOfRange=${this.isStartOfRange(s)} .value=${s} ${R(this.storeDayRef)}></calcite-date-picker-day></div>`)}renderCalendar(e,a,t=!1){return g`<div class=${u({[h.calendar]:!0,[h.calendarStart]:!t})}><calcite-date-picker-month-header .activeDate=${t?C(this.activeDate):this.activeDate} .headingLevel=${this.headingLevel} .localeData=${this.localeData} .max=${this.max} .messages=${this.messages} .min=${this.min} .monthStyle=${this.monthStyle} @calciteInternalDatePickerMonthHeaderSelectChange=${this.monthHeaderSelectChange} .position=${t?"end":this.range&&this.calendars===2?"start":null} .scale=${this.scale} .selectedDate=${this.selectedDate}></calcite-date-picker-month-header>${this.renderMonthCalendar(e,a,t)}</div>`}renderMonthCalendar(e,a,t=!1){return g`<div class=${u({[h.month]:!0})} @keydown=${this.keyDownHandler}><div class=${u({[h.weekHeaderContainer]:!0})} role=row>${e.map(i=>g`<span class=${u({[h.weekHeader]:!0})} role=columnheader>${i}</span>`)}</div><div class=${u({[h.weekDays]:!0})} role=row>${a.map((i,n)=>this.renderDateDay(i,t?50+n:n))}</div></div>`}};I("calcite-date-picker-month",S);export{S as DatePickerMonth};
|
|
3
|
+
v5.0.0-next.89 */
|
|
4
|
+
import{a as b,b as v,j as l,m as F,n as C,q as w}from"./NLHT7BPH.js";import"./P2D55RG4.js";import{a as H}from"./64IGPE2N.js";import"./X6UFBNJP.js";import"./3AZH5LXB.js";import{D as R,E as A,F as u,Q as I,g as x,h as g,p as f}from"./MLP57F7O.js";var h={calendar:"calendar",calendarContainer:"calendar-container",calendarStart:"calendar--start",currentDay:"current-day",dayContainer:"day-container",insideRangeHover:"inside-range--hover",month:"month",noncurrent:"noncurrent",outsideRangeHover:"outside-range--hover",weekDays:"week-days",weekHeader:"week-header",weekHeaderContainer:"week-header-container"},Y=x`:host([hidden]){display:none}[hidden]{display:none}.calendar-container{display:flex;inline-size:100%}:host([range][layout=vertical]) .calendar-container{flex-direction:column}.calendar{inline-size:100%}.week-header-container{display:flex;block-size:16px;padding-inline:var(--calcite-spacing-sm);padding-block:var(--calcite-spacing-md)}.week-header{display:flex;align-items:center;justify-content:center;text-align:center;font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);font-weight:var(--calcite-font-weight-bold);inline-size:14.2857142857%;color:var(--calcite-date-picker-week-header-text-color, var(--calcite-color-text-2))}.day-container{display:flex;inline-size:100%;min-inline-size:0px;justify-content:center}.day-container calcite-date-picker-day{inline-size:100%}.week-days{display:grid;grid-template-columns:repeat(7,1fr);grid-auto-rows:1fr;padding-inline:var(--calcite-spacing-sm);padding-block-end:var(--calcite-spacing-sm)}.month-header{display:flex;inline-size:100%;justify-content:space-between}.month{display:flex;inline-size:100%;flex-direction:column;justify-content:space-between}.day{font-size:var(--calcite-font-size)}:host([scale=s]) .week-days{padding-inline:var(--calcite-spacing-xs);padding-block-end:var(--calcite-spacing-xs)}:host([scale=s]) .week-header-container{padding-inline:var(--calcite-spacing-xs);padding-block:var(--calcite-spacing-sm)}:host([scale=s]) .day{font-size:var(--calcite-font-size-sm)}:host([scale=l]) .week-header{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base)}:host([scale=l]) .week-days{padding-inline:var(--calcite-spacing-md);padding-block-end:var(--calcite-spacing-md)}:host([scale=l]) .week-header-container{padding-inline:var(--calcite-spacing-md);padding-block:var(--calcite-spacing-md-plus)}:host([scale=l]) .day{font-size:var(--calcite-font-size-md)}.calendar--start{border-width:0px;border-style:solid;border-color:var(--calcite-date-picker-range-calendar-divider-color, var(--calcite-color-border-1))}:host([range][layout=horizontal][calendars="2"]) .calendar--start{border-inline-end-width:var(--calcite-border-width-sm)}:host([range][layout=vertical][calendars="2"]) .calendar--start{border-block-end-width:var(--calcite-border-width-sm)}.noncurrent{pointer-events:none;opacity:0}`,p=7,M=6,P=42,S=class extends A{constructor(){super(),this.storeDayRef=e=>{e?.active&&this.activeFocus&&e.setFocus()},this.activeDate=new Date,this.calendars=2,this.range=!1,this.calciteInternalDatePickerDayHover=f({cancelable:!1}),this.calciteInternalDatePickerDaySelect=f({cancelable:!1}),this.calciteInternalDatePickerMonthActiveDateChange=f({cancelable:!1}),this.calciteInternalDatePickerMonthChange=f({cancelable:!1}),this.calciteInternalDatePickerMonthMouseOut=f({cancelable:!1}),this.listen("pointerout",this.pointerOutHandler),this.listen("focusout",this.disableActiveFocus)}static{this.properties={focusedDate:[16,{},{state:!0}],activeDate:[0,{},{attribute:!1}],calendars:[11,{},{type:Number,reflect:!0}],dateTimeFormat:[0,{},{attribute:!1}],endDate:[0,{},{attribute:!1}],headingLevel:[11,{},{type:Number,reflect:!0}],hoverRange:[0,{},{attribute:!1}],layout:[3,{},{reflect:!0}],localeData:[0,{},{attribute:!1}],max:[0,{},{attribute:!1}],messages:[0,{},{attribute:!1}],min:[0,{},{attribute:!1}],monthStyle:1,range:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],selectedDate:[0,{},{attribute:!1}],startDate:[0,{},{attribute:!1}]}}static{this.styles=Y}load(){this.focusedDate=this.selectedDate||this.activeDate}willUpdate(e){e.has("activeDate")&&this.updateFocusedDateWithActive(this.activeDate),e.has("selectedDate")&&(this.focusedDate=this.selectedDate)}updateFocusedDateWithActive(e){this.selectedDate||(this.focusedDate=b(e,this.min,this.max)?e:v(e,this.min,this.max))}keyDownHandler(e){if(e.defaultPrevented)return;let a=this.el.dir==="rtl",t=e.target.value;switch(e.key){case"ArrowUp":e.preventDefault(),this.addDays(-7,t);break;case"ArrowRight":e.preventDefault(),this.addDays(a?-1:1,t);break;case"ArrowDown":e.preventDefault(),this.addDays(7,t);break;case"ArrowLeft":e.preventDefault(),this.addDays(a?1:-1,t);break;case"PageUp":e.preventDefault(),this.addMonths(-1,t);break;case"PageDown":e.preventDefault(),this.addMonths(1,t);break;case"Home":e.preventDefault(),this.activeDate.setDate(1),this.addDays(0,t);break;case"End":e.preventDefault(),this.activeDate.setDate(new Date(this.activeDate.getFullYear(),this.activeDate.getMonth()+1,0).getDate()),this.addDays(0,t);break;case"Enter":case" ":e.preventDefault();break;case"Tab":this.activeFocus=!1}}disableActiveFocus(){this.activeFocus=!1}pointerOutHandler(){this.calciteInternalDatePickerMonthMouseOut.emit()}addMonths(e,a){let t=new Date(a);t.setMonth(a.getMonth()+e),this.calciteInternalDatePickerMonthActiveDateChange.emit(v(t,this.min,this.max)),this.focusedDate=v(t,this.min,this.max),this.activeFocus=!0,this.calciteInternalDatePickerDayHover.emit(t)}addDays(e=0,a){let t=new Date(a);t.setDate(a.getDate()+e),this.calciteInternalDatePickerMonthActiveDateChange.emit(v(t,this.min,this.max)),this.focusedDate=v(t,this.min,this.max),this.activeFocus=!0,this.calciteInternalDatePickerDayHover.emit(t)}getPreviousMonthDays(e,a,t){let s=new Date(a,e,0),i=s.getDate(),n=s.getDay(),o=[];if(n===(t+M)%p)return o;if(n===t)return[i];for(let r=(p+n-t)%p;r>=0;r--)o.push(i-r);return o}getCurrentMonthDays(e,a){let t=new Date(a,e+1,0).getDate(),s=[];for(let i=0;i<t;i++)s.push(i+1);return s}getNextMonthDays(e,a,t){let s=new Date(a,e+1,0).getDay(),i=[];if(s===(t+M)%p)return i;for(let n=0;n<(M-(s-t))%p;n++)i.push(n+1);return i}betweenSelectedRange(e){return!!(this.startDate&&this.endDate&&e>this.startDate&&e<this.endDate&&!this.isRangeHover(e))}isSelected(e){return!!(l(e,this.selectedDate)||this.startDate&&l(e,this.startDate)||this.endDate&&l(e,this.endDate))}isStartOfRange(e){return!!(this.startDate&&!l(this.startDate,this.endDate)&&l(this.startDate,e)&&!this.isEndOfRange(e))}isEndOfRange(e){return!!(this.endDate&&!l(this.startDate,this.endDate)&&l(this.endDate,e)||!this.endDate&&this.hoverRange&&l(this.startDate,this.hoverRange.end)&&l(e,this.hoverRange.end))}dayHover(e){let a=e.target;a.disabled?this.calciteInternalDatePickerMonthMouseOut.emit():this.calciteInternalDatePickerDayHover.emit(a.value),e.stopPropagation()}daySelect(e){let a=e.target;this.activeFocus=!1,this.calciteInternalDatePickerDaySelect.emit(a.value),e.stopPropagation()}isFocusedOnStart(){return this.hoverRange?.focused==="start"}isHoverInRange(){if(!this.hoverRange||!this.startDate)return!1;let{start:e,end:a}=this.hoverRange,t=this.isFocusedOnStart(),s=this.startDate&&a>this.startDate,i=this.endDate&&a<this.endDate,n=this.startDate&&e>this.startDate,o=this.endDate&&e<this.endDate,r=!t&&this.startDate&&s&&(!this.endDate||i),D=t&&this.startDate&&n&&o;return r||D}isRangeHover(e){if(!this.hoverRange)return!1;let{start:a,end:t}=this.hoverRange,s=this.isFocusedOnStart(),i=this.isHoverInRange(),n=e>a&&e<this.startDate,o=e<t&&e>this.endDate,r=e>t&&e<this.endDate,D=e<a&&e>this.startDate,y=e<t&&e>this.startDate,c=e>a&&e<this.endDate,d=this.startDate&&this.endDate;if(i){if(d)return s?e<this.endDate&&(D||n):r||o;if(this.startDate&&!this.endDate)return s?n:y;if(!this.startDate&&this.endDate)return s?c:o}else if(d)return s?n:o}getDays(e,a,t,s="start"){let i=this.activeDate.getMonth(),n=i+1;i=s==="end"?n:i;let o=0,r=()=>o++%7,D=this.activeDate.getFullYear();return[...e.map(c=>({active:!1,day:c,dayInWeek:r(),date:new Date(D,i-1,c)})),...a.map(c=>{let d=new Date(D,i,c),m=l(d,new Date);return{active:this.focusedDate&&this.focusedDate!==this.startDate&&this.focusedDate!==this.endDate?l(d,this.focusedDate):l(d,this.startDate)||l(d,this.endDate),currentMonth:!0,currentDay:m,day:c,dayInWeek:r(),date:d}}),...t.map(c=>({active:!1,day:c,dayInWeek:r(),date:new Date(D,n,c)}))]}monthHeaderSelectChange(e){let a=new Date(e.detail),t=e.target;this.updateFocusableDate(a),e.stopPropagation(),this.calciteInternalDatePickerMonthChange.emit({date:a,position:t.position})}updateFocusableDate(e){!this.selectedDate||!this.range?this.focusedDate=this.getFirstValidDateOfMonth(e):this.selectedDate&&this.range&&(!w(this.startDate,e)||!w(this.endDate,e))&&(this.focusedDate=this.getFirstValidDateOfMonth(e))}getFirstValidDateOfMonth(e){return e.getDate()===1?e:F(e,this.min,this.max)}render(){let e=this.activeDate.getMonth(),a=this.activeDate.getFullYear(),t=this.localeData.weekStart%7,{abbreviated:s,short:i,narrow:n}=this.localeData.days,o=this.scale==="s"?n||i||s:i||s||n,r=[...o.slice(t,7),...o.slice(0,t)],D=this.getCurrentMonthDays(e,a),y=this.getPreviousMonthDays(e,a,t),c=this.getNextMonthDays(e,a,t),d=D.length+y.length+c.length;if(d<P){let N=c.length?c[c.length-1]:0;for(let k=1;k<=P-d;k++)c.push(N+k)}let m=e+1,$=this.getPreviousMonthDays(m,a,t),E=this.getCurrentMonthDays(m,a),z=this.getNextMonthDays(m,a,t),O=this.getDays(y,D,c),B=this.getDays($,E,z,"end");return g`<div class=${u({[h.calendarContainer]:!0})} role=grid>${this.renderCalendar(r,O)}${this.range&&this.calendars===2&&this.renderCalendar(r,B,!0)||""}</div>`}renderDateDay({active:e,currentMonth:a,currentDay:t,date:s,day:i,dayInWeek:n},o){let r=b(s,this.min,this.max);return H(o,g`<div class=${u({[h.dayContainer]:!0})} role=gridcell><calcite-date-picker-day .active=${e} class=${u({[h.currentDay]:t,[h.insideRangeHover]:this.isHoverInRange(),[h.outsideRangeHover]:!this.isHoverInRange(),[h.noncurrent]:this.range&&!a})} .currentMonth=${a} .dateTimeFormat=${this.dateTimeFormat} .day=${i} .disabled=${!r} .endOfRange=${this.isEndOfRange(s)} .highlighted=${this.betweenSelectedRange(s)} @calciteInternalDayHover=${this.dayHover} @calciteInternalDaySelect=${this.daySelect} .range=${!!this.startDate&&!!this.endDate&&!l(this.startDate,this.endDate)} .rangeEdge=${n===0?"start":n===6?"end":void 0} .rangeHover=${r&&this.isRangeHover(s)} .scale=${this.scale} .selected=${this.isSelected(s)} .startOfRange=${this.isStartOfRange(s)} .value=${s} ${R(this.storeDayRef)}></calcite-date-picker-day></div>`)}renderCalendar(e,a,t=!1){return g`<div class=${u({[h.calendar]:!0,[h.calendarStart]:!t})}><calcite-date-picker-month-header .activeDate=${t?C(this.activeDate):this.activeDate} .headingLevel=${this.headingLevel} .localeData=${this.localeData} .max=${this.max} .messages=${this.messages} .min=${this.min} .monthStyle=${this.monthStyle} @calciteInternalDatePickerMonthHeaderSelectChange=${this.monthHeaderSelectChange} .position=${t?"end":this.range&&this.calendars===2?"start":null} .scale=${this.scale} .selectedDate=${this.selectedDate}></calcite-date-picker-month-header>${this.renderMonthCalendar(e,a,t)}</div>`}renderMonthCalendar(e,a,t=!1){return g`<div class=${u({[h.month]:!0})} @keydown=${this.keyDownHandler}><div class=${u({[h.weekHeaderContainer]:!0})} role=row>${e.map(i=>g`<span class=${u({[h.weekHeader]:!0})} role=columnheader>${i}</span>`)}</div><div class=${u({[h.weekDays]:!0})} role=row>${a.map((i,n)=>this.renderDateDay(i,t?50+n:n))}</div></div>`}};I("calcite-date-picker-month",S);export{S as DatePickerMonth};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as W,b as F,c as z}from"./IM6OX44A.js";import{a as y}from"./Z4ETK22W.js";import{a as g}from"./JXV4E5JI.js";import{a as O}from"./MAGCHPNI.js";import"./SBTAFILO.js";import"./S7I3XRAV.js";import{e as k,l as B,n as p,y as E}from"./JEKNLQYF.js";import"./HXY3H2PS.js";import{D as w,E as C,F as b,K as x,Q as S,g as I,h as u,p as T}from"./L4ZDCUZR.js";var $={chevronRight:"chevron-right",chevronLeft:"chevron-left"},c={container:"container",scrollButton:"scroll-button",scrollButtonContainer:"scroll-button-container",scrollBackwardButton:"scroll-button--backward",scrollForwardButton:"scroll-button--forward",tabTitleSlotWrapper:"tab-titles-slot-wrapper",scale:h=>`scale-${h}`,position:h=>`position-${h}`},V=I`:host{position:relative;display:flex}:host([bordered]) .scroll-button--forward calcite-button{--calcite-internal-button-border-inline-end-color: var(--calcite-tab-border-color, var(--calcite-color-border-1))}:host([bordered]) .scroll-button--backward calcite-button{--calcite-internal-button-border-inline-start-color: var( --calcite-tab-border-color, var(--calcite-color-border-1) )}.scale-s{--calcite-internal-tab-nav-button-width: 24px;min-block-size:1.5rem}.scale-m{--calcite-internal-tab-nav-button-width: 32px;min-block-size:2rem}.scale-l{--calcite-internal-tab-nav-button-width: 44px;min-block-size:2.75rem}.container::-webkit-scrollbar{display:none;-ms-overflow-style:none;scrollbar-width:none}:host([layout=center]) ::slotted(calcite-tab-title){display:flex;flex-grow:1;flex-shrink:0;min-inline-size:auto;white-space:nowrap}:host([layout=center]) ::slotted(calcite-tab-title[selected]){overflow:unset}:host(:not([bordered])) .scale-l{--calcite-internal-tab-nav-gap: var(--calcite-spacing-xxl)}:host(:not([bordered])) .scale-m{--calcite-internal-tab-nav-gap: var(--calcite-spacing-xl)}:host(:not([bordered])) .scale-s{--calcite-internal-tab-nav-gap: var(--calcite-spacing-lg)}:host(:not([bordered])) .tab-titles-slot-wrapper{gap:var(--calcite-internal-tab-nav-gap)}:host([layout=center]:not([bordered])) .tab-titles-slot-wrapper{padding-inline:var(--calcite-spacing-xl)}.tab-titles-slot-wrapper{flex:1 1 0%}.container,.tab-titles-slot-wrapper{display:flex;inline-size:100%;justify-content:flex-start;overflow:hidden;white-space:nowrap}.scroll-button{position:absolute;inset-block:0px}.scroll-button calcite-button{--calcite-button-text-color: var(--calcite-tab-text-color, var(--calcite-color-text-3));--calcite-button-background-color: var(--calcite-color-transparent);--calcite-offset-invert-focus: 1;block-size:var(--calcite-container-size-content-fluid)}.scroll-button-container{display:flex;inset-block-start:var(--calcite-border-width-md);inset-block-end:var(--calcite-border-width-md);inset-inline-end:0;inline-size:calc(2 * var(--calcite-internal-tab-nav-button-width))}.scroll-button--forward{inset-inline-end:0;z-index:var(--calcite-z-index)}.scroll-button--backward{inset-inline-end:var(--calcite-internal-tab-nav-button-width);z-index:var(--calcite-z-index)}:host(:not([bordered])) .scroll-button--backward:before{background-color:var(--calcite-tab-border-color, var(--calcite-color-border-3));content:"";inline-size:var(--calcite-border-width-sm);inset-block-start:var(--calcite-border-width-md);inset-block-end:var(--calcite-border-width-md);position:absolute;inset-inline-start:0}:host([hidden]){display:none}[hidden]{display:none}`,v=class extends C{constructor(){super(),this.effectiveDir="ltr",this.lastScrollWheelAxis="x",this.resizeObserver=g("resize",()=>{this.updateScrollingState()}),this.makeFirstVisibleTabClosable=!1,this.messages=O(),this.hasOverflowingEndTabTitle=!1,this.hasOverflowingStartTabTitle=!1,this.bordered=!1,this.layout="inline",this.position="bottom",this.scale="m",this.selectedTitle=null,this.calciteInternalTabChange=T({cancelable:!1}),this.calciteInternalTabNavSlotChange=T(),this.calciteTabChange=T({cancelable:!1}),this.listen("calciteInternalTabsFocusPrevious",this.focusPreviousTabHandler),this.listen("calciteInternalTabsFocusNext",this.focusNextTabHandler),this.listen("calciteInternalTabsFocusFirst",this.focusFirstTabHandler),this.listen("calciteInternalTabsFocusLast",this.focusLastTabHandler),this.listen("calciteInternalTabsActivate",this.internalActivateTabHandler),this.listen("calciteInternalTabsClose",this.internalCloseTabHandler),this.listen("calciteInternalTabTitleRegister",this.updateTabTitles),this.listenOn(document.body,"calciteInternalTabChange",this.globalInternalTabChangeHandler)}static{this.properties={hasOverflowingEndTabTitle:[16,{},{state:!0}],hasOverflowingStartTabTitle:[16,{},{state:!0}],selectedTabId:[16,{},{state:!0}],bordered:[7,{},{reflect:!0,type:Boolean}],layout:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],position:1,scale:1,selectedTitle:[0,{},{attribute:!1}],storageId:[3,{},{reflect:!0}],syncId:[3,{},{reflect:!0}]}}static{this.styles=V}connectedCallback(){super.connectedCallback(),this.parentTabsEl=this.el.closest("calcite-tabs"),this.resizeObserver?.observe(this.el)}async load(){let t=`calcite-tab-nav-${this.storageId}`;if(localStorage&&this.storageId&&localStorage.getItem(t)){let e=JSON.parse(localStorage.getItem(t));this.selectedTabId=e}}willUpdate(t){t.has("selectedTitle")&&(this.hasUpdated||this.selectedTitle!==null)&&this.calciteInternalTabChange.emit({tab:this.selectedTabId}),t.has("selectedTabId")&&this.selectedTabIdChanged();let{parentTabsEl:e}=this;this.layout=e?.layout,this.bordered=e?.bordered,this.effectiveDir=k(this.el)}loaded(){this.scrollTabTitleIntoView(this.selectedTitle,"instant"),this.tabTitles.length&&this.tabTitles.every(t=>!t.selected)&&!this.selectedTabId&&this.tabTitles[0].getTabIdentifier().then(t=>{this.calciteInternalTabChange.emit({tab:t})})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}get enabledTabTitles(){return p(this.el,"calcite-tab-title:not([disabled])").filter(t=>!t.closed)}get scrollerButtonWidth(){let{scale:t}=this;return parseInt(t==="s"?W:t==="m"?F:z)}get tabTitles(){return p(this.el,"calcite-tab-title")}focusPreviousTabHandler(t){this.handleTabFocus(t,t.target,"previous")}focusNextTabHandler(t){this.handleTabFocus(t,t.target,"next")}focusFirstTabHandler(t){this.handleTabFocus(t,t.target,"first")}focusLastTabHandler(t){this.handleTabFocus(t,t.target,"last")}internalActivateTabHandler(t){let e=t.target,i=this.selectedTitle;this.selectedTabId=t.detail.tab?t.detail.tab:this.getIndexOfTabTitle(e),t.stopPropagation(),this.selectedTitle=e,i?.id!==e.id&&t.detail.userTriggered&&this.calciteTabChange.emit(),this.scrollTabTitleIntoView(e)}scrollTabTitleIntoView(t,e="smooth"){t&&requestAnimationFrame(()=>{let i=this.tabTitleContainerEl;if(!i)return;let l=i.getBoundingClientRect(),a=t.getBoundingClientRect(),s=i.scrollLeft;if(a.left<l.left){let o=s+(a.left-l.left);i.scrollTo({left:o,behavior:e})}else if(a.right>l.right){let o=s+(a.right-l.right);i.scrollTo({left:o,behavior:e})}})}internalCloseTabHandler(t){let e=t.target;this.handleTabTitleClose(e),t.stopPropagation()}async updateTabTitles(t){t.target.selected&&(this.selectedTabId=t.detail,this.selectedTitle=await this.getTabTitleById(this.selectedTabId))}globalInternalTabChangeHandler(t){this.syncId&&t.target!==this.el&&t.target.syncId===this.syncId&&this.selectedTabId!==t.detail.tab&&(this.selectedTabId=t.detail.tab),t.stopPropagation()}async selectedTabIdChanged(){await this.componentOnReady(),localStorage&&this.storageId&&this.selectedTabId!==void 0&&this.selectedTabId!==null&&localStorage.setItem(`calcite-tab-nav-${this.storageId}`,JSON.stringify(this.selectedTabId)),this.calciteInternalTabChange.emit({tab:this.selectedTabId})}onTabTitleWheel(t){t.preventDefault();let{deltaX:e,deltaY:i}=t,l=Math.abs(e),a=Math.abs(i),s;l===a?s=this.lastScrollWheelAxis==="x"?e:i:l>a?(s=e,this.lastScrollWheelAxis="x"):(s=i,this.lastScrollWheelAxis="y");let o=(this.effectiveDir==="rtl"?-1:1)*s;t.currentTarget.scrollBy(o,0)}onSlotChange(){this.intersectionObserver?.disconnect();let t=this.tabTitles;t.forEach(l=>{this.intersectionObserver?.observe(l)});let e=this.getVisibleTabTitlesIndices(t);e.length>1&&this.makeFirstVisibleTabClosable&&(t[e[0]].closable=!0,this.makeFirstVisibleTabClosable=!1),this.calciteInternalTabNavSlotChange.emit(t)}setTabTitleContainerEl(t){this.tabTitleContainerEl=t,this.intersectionObserver?.disconnect(),t&&(this.intersectionObserver=g("intersection",()=>this.updateScrollingState(),{root:t,threshold:[0,.5,1]}))}updateScrollingState(){let t=this.tabTitleContainerEl;if(!t)return;let e,i,l=t.scrollLeft,a=t.clientWidth,s=t.scrollWidth;this.effectiveDir==="ltr"?(e=l>0,i=l+a<s):(e=l<0,i=l!==-(s-a)),this.hasOverflowingStartTabTitle=e,this.hasOverflowingEndTabTitle=i}scrollToTabTitles(t){requestAnimationFrame(()=>{let e=this.tabTitleContainerEl;if(!e)return;let i=e.getBoundingClientRect(),l=Array.from(this.el.querySelectorAll("calcite-tab-title")),{effectiveDir:a}=this;t==="forward"&&l.reverse();let s=null;l.forEach(n=>{let r=n.getBoundingClientRect(),f=i.x+i.width,d=r.x+r.width;t==="forward"&&a==="ltr"||t==="backward"&&a==="rtl"?(r.x>f||d>f&&r.x>i.x)&&(s=n):(d<i.x||r.x<i.x&&d>i.x)&&(s=n)});let o;if(s){let n=2*this.scrollerButtonWidth,r=t==="forward"&&a==="ltr"||t==="backward"&&a==="rtl"?-n:s.offsetWidth-(e.clientWidth+n);o=s.offsetLeft+r}else{let n=e.scrollLeft,r=i.width,d=e.scrollWidth-(r+Math.abs(n));d>0&&(o=n+(a==="ltr"?1:-1)*d)}e.scrollTo({left:o,behavior:"smooth"})})}scrollToNextTabTitles(){this.scrollToTabTitles("forward")}scrollToPreviousTabTitles(){this.scrollToTabTitles("backward")}handleTabFocus(t,e,i){let l=E(this.enabledTabTitles,e,i);this.scrollTabTitleIntoView(l,"instant"),t.stopPropagation()}getIndexOfTabTitle(t,e=this.tabTitles){return e.indexOf(t)}onTabTitleScroll(){this.updateScrollingState()}async getTabTitleById(t){return Promise.all(this.tabTitles.map(e=>e.getTabIdentifier())).then(e=>this.tabTitles[e.indexOf(t)])}getVisibleTabTitlesIndices(t){return t.reduce((e,i,l)=>i.closed?e:[...e,l],[])}handleTabTitleClose(t){let{tabTitles:e}=this,i=t.selected,l=this.getVisibleTabTitlesIndices(e),a=l.length;if(a===1&&e[l[0]].closable)this.makeFirstVisibleTabClosable=!0,e[l[0]].closable=!1,this.selectedTabId=l[0],i&&e[l[0]].activateTab();else if(a>1){let s=e.findIndex(n=>n===t),o=l.find(n=>n>s);this.selectedTabId===s&&(this.selectedTabId=o||a-1,e[this.selectedTabId].activateTab())}requestAnimationFrame(()=>{B(e[this.selectedTabId])})}render(){return this.el.role="tablist",u`<div class=${b({[c.container]:!0,[c.scale(this.scale)]:!0,[c.position(this.position)]:!0,[x.rtl]:this.effectiveDir==="rtl"})}><div class=${b({[c.tabTitleSlotWrapper]:!0})} @scroll=${this.onTabTitleScroll} @wheel=${this.onTabTitleWheel} ${w(this.setTabTitleContainerEl)}><slot @slotchange=${this.onSlotChange}></slot></div><div class=${b(c.scrollButtonContainer)} .hidden=${!this.hasOverflowingEndTabTitle&&!this.hasOverflowingStartTabTitle}>${this.renderScrollButton("start")}${this.renderScrollButton("end")}</div></div>`}renderScrollButton(t){let{messages:e,scale:i,hasOverflowingEndTabTitle:l,hasOverflowingStartTabTitle:a}=this,s=t==="end";return y(t,u`<div class=${b({[c.scrollButton]:!0,[c.scrollBackwardButton]:!s,[c.scrollForwardButton]:s})}><calcite-button .ariaLabel=${s?e.nextTabTitles:e.previousTabTitles} .disabled=${s?!l:!a} icon-flip-rtl=both .iconStart=${s?$.chevronRight:$.chevronLeft} kind=neutral @click=${s?this.scrollToNextTabTitles:this.scrollToPreviousTabTitles} .scale=${i} tabindex=-1></calcite-button></div>`)}};S("calcite-tab-nav",v);export{v as TabNav};
|
|
3
|
+
v5.0.0-next.89 */
|
|
4
|
+
import{a as W,b as F,c as z}from"./Z5SSVDJT.js";import{a as y}from"./64IGPE2N.js";import{a as g}from"./NFVAS5ZC.js";import{a as O}from"./YSTQVB4Y.js";import"./R3GQZCQ5.js";import"./3AZH5LXB.js";import{e as k,l as B,n as p,y as E}from"./2ONQDURU.js";import"./BRWGEU6Y.js";import{D as w,E as C,F as b,K as x,Q as S,g as I,h as u,p as T}from"./MLP57F7O.js";var $={chevronRight:"chevron-right",chevronLeft:"chevron-left"},c={container:"container",scrollButton:"scroll-button",scrollButtonContainer:"scroll-button-container",scrollBackwardButton:"scroll-button--backward",scrollForwardButton:"scroll-button--forward",tabTitleSlotWrapper:"tab-titles-slot-wrapper",scale:h=>`scale-${h}`,position:h=>`position-${h}`},V=I`:host{position:relative;display:flex}:host([bordered]) .scroll-button--forward calcite-button{--calcite-internal-button-border-inline-end-color: var(--calcite-tab-border-color, var(--calcite-color-border-1))}:host([bordered]) .scroll-button--backward calcite-button{--calcite-internal-button-border-inline-start-color: var( --calcite-tab-border-color, var(--calcite-color-border-1) )}.scale-s{--calcite-internal-tab-nav-button-width: 24px;min-block-size:1.5rem}.scale-m{--calcite-internal-tab-nav-button-width: 32px;min-block-size:2rem}.scale-l{--calcite-internal-tab-nav-button-width: 44px;min-block-size:2.75rem}.container::-webkit-scrollbar{display:none;-ms-overflow-style:none;scrollbar-width:none}:host([layout=center]) ::slotted(calcite-tab-title){display:flex;flex-grow:1;flex-shrink:0;min-inline-size:auto;white-space:nowrap}:host([layout=center]) ::slotted(calcite-tab-title[selected]){overflow:unset}:host(:not([bordered])) .scale-l{--calcite-internal-tab-nav-gap: var(--calcite-spacing-xxl)}:host(:not([bordered])) .scale-m{--calcite-internal-tab-nav-gap: var(--calcite-spacing-xl)}:host(:not([bordered])) .scale-s{--calcite-internal-tab-nav-gap: var(--calcite-spacing-lg)}:host(:not([bordered])) .tab-titles-slot-wrapper{gap:var(--calcite-internal-tab-nav-gap)}:host([layout=center]:not([bordered])) .tab-titles-slot-wrapper{padding-inline:var(--calcite-spacing-xl)}.tab-titles-slot-wrapper{flex:1 1 0%}.container,.tab-titles-slot-wrapper{display:flex;inline-size:100%;justify-content:flex-start;overflow:hidden;white-space:nowrap}.scroll-button{position:absolute;inset-block:0px}.scroll-button calcite-button{--calcite-button-text-color: var(--calcite-tab-text-color, var(--calcite-color-text-3));--calcite-button-background-color: var(--calcite-color-transparent);--calcite-offset-invert-focus: 1;block-size:var(--calcite-container-size-content-fluid)}.scroll-button-container{display:flex;inset-block-start:var(--calcite-border-width-md);inset-block-end:var(--calcite-border-width-md);inset-inline-end:0;inline-size:calc(2 * var(--calcite-internal-tab-nav-button-width))}.scroll-button--forward{inset-inline-end:0;z-index:var(--calcite-z-index)}.scroll-button--backward{inset-inline-end:var(--calcite-internal-tab-nav-button-width);z-index:var(--calcite-z-index)}:host(:not([bordered])) .scroll-button--backward:before{background-color:var(--calcite-tab-border-color, var(--calcite-color-border-3));content:"";inline-size:var(--calcite-border-width-sm);inset-block-start:var(--calcite-border-width-md);inset-block-end:var(--calcite-border-width-md);position:absolute;inset-inline-start:0}:host([hidden]){display:none}[hidden]{display:none}`,v=class extends C{constructor(){super(),this.effectiveDir="ltr",this.lastScrollWheelAxis="x",this.resizeObserver=g("resize",()=>{this.updateScrollingState()}),this.makeFirstVisibleTabClosable=!1,this.messages=O(),this.hasOverflowingEndTabTitle=!1,this.hasOverflowingStartTabTitle=!1,this.bordered=!1,this.layout="inline",this.position="bottom",this.scale="m",this.selectedTitle=null,this.calciteInternalTabChange=T({cancelable:!1}),this.calciteInternalTabNavSlotChange=T(),this.calciteTabChange=T({cancelable:!1}),this.listen("calciteInternalTabsFocusPrevious",this.focusPreviousTabHandler),this.listen("calciteInternalTabsFocusNext",this.focusNextTabHandler),this.listen("calciteInternalTabsFocusFirst",this.focusFirstTabHandler),this.listen("calciteInternalTabsFocusLast",this.focusLastTabHandler),this.listen("calciteInternalTabsActivate",this.internalActivateTabHandler),this.listen("calciteInternalTabsClose",this.internalCloseTabHandler),this.listen("calciteInternalTabTitleRegister",this.updateTabTitles),this.listenOn(document.body,"calciteInternalTabChange",this.globalInternalTabChangeHandler)}static{this.properties={hasOverflowingEndTabTitle:[16,{},{state:!0}],hasOverflowingStartTabTitle:[16,{},{state:!0}],selectedTabId:[16,{},{state:!0}],bordered:[7,{},{reflect:!0,type:Boolean}],layout:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],position:1,scale:1,selectedTitle:[0,{},{attribute:!1}],storageId:[3,{},{reflect:!0}],syncId:[3,{},{reflect:!0}]}}static{this.styles=V}connectedCallback(){super.connectedCallback(),this.parentTabsEl=this.el.closest("calcite-tabs"),this.resizeObserver?.observe(this.el)}async load(){let t=`calcite-tab-nav-${this.storageId}`;if(localStorage&&this.storageId&&localStorage.getItem(t)){let e=JSON.parse(localStorage.getItem(t));this.selectedTabId=e}}willUpdate(t){t.has("selectedTitle")&&(this.hasUpdated||this.selectedTitle!==null)&&this.calciteInternalTabChange.emit({tab:this.selectedTabId}),t.has("selectedTabId")&&this.selectedTabIdChanged();let{parentTabsEl:e}=this;this.layout=e?.layout,this.bordered=e?.bordered,this.effectiveDir=k(this.el)}loaded(){this.scrollTabTitleIntoView(this.selectedTitle,"instant"),this.tabTitles.length&&this.tabTitles.every(t=>!t.selected)&&!this.selectedTabId&&this.tabTitles[0].getTabIdentifier().then(t=>{this.calciteInternalTabChange.emit({tab:t})})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}get enabledTabTitles(){return p(this.el,"calcite-tab-title:not([disabled])").filter(t=>!t.closed)}get scrollerButtonWidth(){let{scale:t}=this;return parseInt(t==="s"?W:t==="m"?F:z)}get tabTitles(){return p(this.el,"calcite-tab-title")}focusPreviousTabHandler(t){this.handleTabFocus(t,t.target,"previous")}focusNextTabHandler(t){this.handleTabFocus(t,t.target,"next")}focusFirstTabHandler(t){this.handleTabFocus(t,t.target,"first")}focusLastTabHandler(t){this.handleTabFocus(t,t.target,"last")}internalActivateTabHandler(t){let e=t.target,i=this.selectedTitle;this.selectedTabId=t.detail.tab?t.detail.tab:this.getIndexOfTabTitle(e),t.stopPropagation(),this.selectedTitle=e,i?.id!==e.id&&t.detail.userTriggered&&this.calciteTabChange.emit(),this.scrollTabTitleIntoView(e)}scrollTabTitleIntoView(t,e="smooth"){t&&requestAnimationFrame(()=>{let i=this.tabTitleContainerEl;if(!i)return;let l=i.getBoundingClientRect(),a=t.getBoundingClientRect(),s=i.scrollLeft;if(a.left<l.left){let o=s+(a.left-l.left);i.scrollTo({left:o,behavior:e})}else if(a.right>l.right){let o=s+(a.right-l.right);i.scrollTo({left:o,behavior:e})}})}internalCloseTabHandler(t){let e=t.target;this.handleTabTitleClose(e),t.stopPropagation()}async updateTabTitles(t){t.target.selected&&(this.selectedTabId=t.detail,this.selectedTitle=await this.getTabTitleById(this.selectedTabId))}globalInternalTabChangeHandler(t){this.syncId&&t.target!==this.el&&t.target.syncId===this.syncId&&this.selectedTabId!==t.detail.tab&&(this.selectedTabId=t.detail.tab),t.stopPropagation()}async selectedTabIdChanged(){await this.componentOnReady(),localStorage&&this.storageId&&this.selectedTabId!==void 0&&this.selectedTabId!==null&&localStorage.setItem(`calcite-tab-nav-${this.storageId}`,JSON.stringify(this.selectedTabId)),this.calciteInternalTabChange.emit({tab:this.selectedTabId})}onTabTitleWheel(t){t.preventDefault();let{deltaX:e,deltaY:i}=t,l=Math.abs(e),a=Math.abs(i),s;l===a?s=this.lastScrollWheelAxis==="x"?e:i:l>a?(s=e,this.lastScrollWheelAxis="x"):(s=i,this.lastScrollWheelAxis="y");let o=(this.effectiveDir==="rtl"?-1:1)*s;t.currentTarget.scrollBy(o,0)}onSlotChange(){this.intersectionObserver?.disconnect();let t=this.tabTitles;t.forEach(l=>{this.intersectionObserver?.observe(l)});let e=this.getVisibleTabTitlesIndices(t);e.length>1&&this.makeFirstVisibleTabClosable&&(t[e[0]].closable=!0,this.makeFirstVisibleTabClosable=!1),this.calciteInternalTabNavSlotChange.emit(t)}setTabTitleContainerEl(t){this.tabTitleContainerEl=t,this.intersectionObserver?.disconnect(),t&&(this.intersectionObserver=g("intersection",()=>this.updateScrollingState(),{root:t,threshold:[0,.5,1]}))}updateScrollingState(){let t=this.tabTitleContainerEl;if(!t)return;let e,i,l=t.scrollLeft,a=t.clientWidth,s=t.scrollWidth;this.effectiveDir==="ltr"?(e=l>0,i=l+a<s):(e=l<0,i=l!==-(s-a)),this.hasOverflowingStartTabTitle=e,this.hasOverflowingEndTabTitle=i}scrollToTabTitles(t){requestAnimationFrame(()=>{let e=this.tabTitleContainerEl;if(!e)return;let i=e.getBoundingClientRect(),l=Array.from(this.el.querySelectorAll("calcite-tab-title")),{effectiveDir:a}=this;t==="forward"&&l.reverse();let s=null;l.forEach(n=>{let r=n.getBoundingClientRect(),f=i.x+i.width,d=r.x+r.width;t==="forward"&&a==="ltr"||t==="backward"&&a==="rtl"?(r.x>f||d>f&&r.x>i.x)&&(s=n):(d<i.x||r.x<i.x&&d>i.x)&&(s=n)});let o;if(s){let n=2*this.scrollerButtonWidth,r=t==="forward"&&a==="ltr"||t==="backward"&&a==="rtl"?-n:s.offsetWidth-(e.clientWidth+n);o=s.offsetLeft+r}else{let n=e.scrollLeft,r=i.width,d=e.scrollWidth-(r+Math.abs(n));d>0&&(o=n+(a==="ltr"?1:-1)*d)}e.scrollTo({left:o,behavior:"smooth"})})}scrollToNextTabTitles(){this.scrollToTabTitles("forward")}scrollToPreviousTabTitles(){this.scrollToTabTitles("backward")}handleTabFocus(t,e,i){let l=E(this.enabledTabTitles,e,i);this.scrollTabTitleIntoView(l,"instant"),t.stopPropagation()}getIndexOfTabTitle(t,e=this.tabTitles){return e.indexOf(t)}onTabTitleScroll(){this.updateScrollingState()}async getTabTitleById(t){return Promise.all(this.tabTitles.map(e=>e.getTabIdentifier())).then(e=>this.tabTitles[e.indexOf(t)])}getVisibleTabTitlesIndices(t){return t.reduce((e,i,l)=>i.closed?e:[...e,l],[])}handleTabTitleClose(t){let{tabTitles:e}=this,i=t.selected,l=this.getVisibleTabTitlesIndices(e),a=l.length;if(a===1&&e[l[0]].closable)this.makeFirstVisibleTabClosable=!0,e[l[0]].closable=!1,this.selectedTabId=l[0],i&&e[l[0]].activateTab();else if(a>1){let s=e.findIndex(n=>n===t),o=l.find(n=>n>s);this.selectedTabId===s&&(this.selectedTabId=o||a-1,e[this.selectedTabId].activateTab())}requestAnimationFrame(()=>{B(e[this.selectedTabId])})}render(){return this.el.role="tablist",u`<div class=${b({[c.container]:!0,[c.scale(this.scale)]:!0,[c.position(this.position)]:!0,[x.rtl]:this.effectiveDir==="rtl"})}><div class=${b({[c.tabTitleSlotWrapper]:!0})} @scroll=${this.onTabTitleScroll} @wheel=${this.onTabTitleWheel} ${w(this.setTabTitleContainerEl)}><slot @slotchange=${this.onSlotChange}></slot></div><div class=${b(c.scrollButtonContainer)} .hidden=${!this.hasOverflowingEndTabTitle&&!this.hasOverflowingStartTabTitle}>${this.renderScrollButton("start")}${this.renderScrollButton("end")}</div></div>`}renderScrollButton(t){let{messages:e,scale:i,hasOverflowingEndTabTitle:l,hasOverflowingStartTabTitle:a}=this,s=t==="end";return y(t,u`<div class=${b({[c.scrollButton]:!0,[c.scrollBackwardButton]:!s,[c.scrollForwardButton]:s})}><calcite-button .ariaLabel=${s?e.nextTabTitles:e.previousTabTitles} .disabled=${s?!l:!a} icon-flip-rtl=both .iconStart=${s?$.chevronRight:$.chevronLeft} kind=neutral @click=${s?this.scrollToNextTabTitles:this.scrollToPreviousTabTitles} .scale=${i} tabindex=-1></calcite-button></div>`)}};S("calcite-tab-nav",v);export{v as TabNav};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as n}from"./
|
|
3
|
+
v5.0.0-next.89 */
|
|
4
|
+
import{a as n}from"./64IGPE2N.js";import{t as s,u as i}from"./2ONQDURU.js";import"./BRWGEU6Y.js";import{E as g,F as r,Q as u,g as f,h as a}from"./MLP57F7O.js";var b=f`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{position:absolute;inset:0;display:flex;block-size:100%;inline-size:100%;flex-direction:column;overflow:hidden}.main{position:relative;display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;flex-direction:row;justify-content:space-between;overflow:hidden}.content{display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap;overflow:auto;justify-content:space-between}.content ::slotted(calcite-panel),.content ::slotted(calcite-flow){flex:1 1 auto;align-self:stretch;max-block-size:unset}.content--behind{position:absolute;inset:0;border-width:0px;z-index:calc(var(--calcite-z-index) - 1);display:initial}.content--non-interactive{pointer-events:none;display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap}::slotted(calcite-shell-panel){inline-size:unset}::slotted(.header .heading){font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-relative-snug);font-weight:var(--calcite-font-weight-normal)}slot[name=panel-start]::slotted(calcite-shell-panel),slot[name=panel-end]::slotted(calcite-shell-panel){position:relative;z-index:calc(var(--calcite-z-index) + 1)}slot[name=panel-end]::slotted(calcite-shell-panel){margin-inline-start:auto}::slotted(calcite-panel),::slotted(calcite-flow){border-width:var(--calcite-border-width-sm);border-color:var(--calcite-shell-border-color, var(--calcite-color-border-3));border-inline-start-width:var(--calcite-border-width-none);border-inline-end-width:var(--calcite-border-width-none);border-style:solid}slot[name=panel-top]::slotted(calcite-shell-panel:not([display-mode^=float])),slot[name=panel-bottom]::slotted(calcite-shell-panel:not([display-mode^=float])){border-color:var(--calcite-shell-border-color, var(--calcite-color-border-3));border-inline-start-width:var(--calcite-border-width-sm);border-inline-end-width:var(--calcite-border-width-sm)}.center-content{display:flex;flex-direction:column;justify-content:space-between;block-size:100%;inline-size:100%;min-inline-size:0}.content-bottom{justify-content:flex-end}::slotted(calcite-shell-panel){flex:none;align-self:stretch}::slotted(calcite-tip-manager){position:absolute;z-index:var(--calcite-z-index-toast);box-sizing:border-box}@keyframes in-up{0%{opacity:0;transform:translate3D(0,5px,0)}to{opacity:1;transform:translateZ(0)}}::slotted(calcite-tip-manager){animation:in-up var(--calcite-internal-animation-timing-slow) ease-in-out;border-radius:.25rem;--tw-shadow: 0 6px 20px -4px rgba(0, 0, 0, .1), 0 4px 12px -2px rgba(0, 0, 0, .08);--tw-shadow-colored: 0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);inset-block-end:.5rem;inset-inline:var(--calcite-shell-tip-spacing, 26vw)}slot[name=panel-bottom]::slotted(calcite-shell-panel){margin-block-start:auto}slot[name=panel-top]::slotted(calcite-shell-panel){margin-block-end:auto}.position-wrapper{position:absolute;pointer-events:none;inset:0}:host([hidden]){display:none}[hidden]{display:none}`,o={main:"main",content:"content",contentBehind:"content--behind",contentBottom:"content-bottom",contentNonInteractive:"content--non-interactive",footer:"footer",positionedSlotWrapper:"positioned-slot-wrapper",contentBehindCenterContent:"center-content"},l={panelStart:"panel-start",panelEnd:"panel-end",panelTop:"panel-top",panelBottom:"panel-bottom",header:"header",footer:"footer",alerts:"alerts",sheets:"sheets",modals:"modals",dialogs:"dialogs"},h=class extends g{constructor(){super(),this.hasAlerts=!1,this.hasDialogs=!1,this.hasFooter=!1,this.hasHeader=!1,this.hasModals=!1,this.hasOnlyPanelBottom=!1,this.hasPanelBottom=!1,this.hasPanelTop=!1,this.hasSheets=!1,this.panelIsResizing=!1,this.contentBehind=!1,this.listen("calciteInternalShellPanelResizeStart",this.handleCalciteInternalShellPanelResizeStart),this.listen("calciteInternalShellPanelResizeEnd",this.handleCalciteInternalShellPanelResizeEnd)}static{this.properties={hasAlerts:[16,{},{state:!0}],hasDialogs:[16,{},{state:!0}],hasFooter:[16,{},{state:!0}],hasHeader:[16,{},{state:!0}],hasModals:[16,{},{state:!0}],hasOnlyPanelBottom:[16,{},{state:!0}],hasPanelBottom:[16,{},{state:!0}],hasPanelTop:[16,{},{state:!0}],hasSheets:[16,{},{state:!0}],panelIsResizing:[16,{},{state:!0}],contentBehind:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=b}willUpdate(t){(t.has("hasPanelTop")&&(this.hasUpdated||this.hasPanelTop!==!1)||t.has("hasPanelBottom")&&(this.hasUpdated||this.hasPanelBottom!==!1))&&(this.hasOnlyPanelBottom=!this.hasPanelTop&&this.hasPanelBottom)}handleCalciteInternalShellPanelResizeStart(t){this.panelIsResizing=!0,t.stopPropagation()}handleCalciteInternalShellPanelResizeEnd(t){this.panelIsResizing=!1,t.stopPropagation()}handleHeaderSlotChange(t){this.hasHeader=!!s(t)}handleFooterSlotChange(t){this.hasFooter=!!s(t)}handleAlertsSlotChange(t){this.hasAlerts=!!s(t),i(t).filter(e=>e?.matches("calcite-alert")).forEach(e=>{e.embedded=!0})}handleSheetsSlotChange(t){this.hasSheets=!!s(t),i(t).filter(e=>e?.matches("calcite-sheet")).forEach(e=>{e.embedded=!0})}handleModalsSlotChange(t){this.hasModals=!!s(t),i(t)?.filter(e=>e?.matches("calcite-modal")).forEach(e=>{e.embedded=!0})}handlePanelTopChange(t){this.hasPanelTop=s(t),i(t).filter(e=>e?.matches("calcite-shell-panel")).forEach(e=>{e.layout="horizontal",e.position="start"})}handlePanelBottomChange(t){this.hasPanelBottom=s(t),i(t).filter(e=>e?.matches("calcite-shell-panel")).forEach(e=>{e.layout="horizontal",e.position="end"})}handlePanelStartChange(t){i(t).filter(e=>e?.matches("calcite-shell-panel")).forEach(e=>{e.layout="vertical",e.position="start"})}handlePanelEndChange(t){i(t).filter(e=>e?.matches("calcite-shell-panel")).forEach(e=>{e.layout="vertical",e.position="end"})}handleDialogsSlotChange(t){this.hasDialogs=!!s(t),i(t).filter(e=>e?.matches("calcite-dialog")).forEach(e=>{e.embedded=!0})}renderHeader(){return a`<div .hidden=${!this.hasHeader}>${n("header",a`<slot name=${l.header} @slotchange=${this.handleHeaderSlotChange}></slot>`)}</div>`}renderFooter(){return n("footer",a`<div class=${r(o.footer)} .hidden=${!this.hasFooter}><slot name=${l.footer} @slotchange=${this.handleFooterSlotChange}></slot></div>`)}renderAlerts(){return a`<div .hidden=${!this.hasAlerts}>${n("alerts",a`<slot name=${l.alerts} @slotchange=${this.handleAlertsSlotChange}></slot>`)}</div>`}renderSheets(){return a`<div .hidden=${!this.hasSheets}>${n("sheets",a`<slot name=${l.sheets} @slotchange=${this.handleSheetsSlotChange}></slot>`)}</div>`}renderModals(){return a`<div .hidden=${!this.hasModals}>${n("modals",a`<slot name=${l.modals} @slotchange=${this.handleModalsSlotChange}></slot>`)}</div>`}renderDialogs(){return a`<div .hidden=${!this.hasDialogs}>${n("dialogs",a`<slot name=${l.dialogs} @slotchange=${this.handleDialogsSlotChange}></slot>`)}</div>`}renderContent(){let{panelIsResizing:t}=this,e=n("default-slot",a`<slot></slot>`),d=t?a`<div class=${r(o.contentNonInteractive)}>${e}</div>`:e,c=n("panel-bottom-slot",a`<slot name=${l.panelBottom} @slotchange=${this.handlePanelBottomChange}></slot>`),p=n("panel-top-slot",a`<slot name=${l.panelTop} @slotchange=${this.handlePanelTopChange}></slot>`),m="content-container";return this.contentBehind?[n(m,a`<div class=${r({[o.content]:!0,[o.contentBehind]:!0})}>${d}</div>`),a`<div class=${r({[o.contentBehindCenterContent]:!0,[o.contentBottom]:this.hasOnlyPanelBottom})}>${p}${c}</div>`]:[n(m,a`<div class=${r({[o.content]:!0,[o.contentBottom]:this.hasOnlyPanelBottom})}>${p}${d}${c}</div>`)]}renderMain(){return a`<div class=${r(o.main)}><slot name=${l.panelStart} @slotchange=${this.handlePanelStartChange}></slot>${this.renderContent()}<slot name=${l.panelEnd} @slotchange=${this.handlePanelEndChange}></slot></div>`}renderPositionedSlots(){return a`<div class=${r(o.positionedSlotWrapper)}>${this.renderAlerts()}${this.renderModals()}${this.renderDialogs()}${this.renderSheets()}</div>`}render(){return a`${this.renderHeader()}${this.renderMain()}${this.renderFooter()}${this.renderPositionedSlots()}`}};u("calcite-shell",h);export{h as Shell};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as v,b as h,e as O,f as W,k as x,l as b,n as y,o as F,q as p}from"./35AO2CZ7.js";import{j as d}from"./5RCNA2RB.js";import{h as I,i as P,j as A}from"./TQCODZFF.js";import{a as u}from"./MCCZITQC.js";import"./S7I3XRAV.js";import{i as S,k as R}from"./JEKNLQYF.js";import"./HXY3H2PS.js";import{B as z,C as f,D as g,E as Y,F as r,Q as w,g as D,h as l,l as $,p as C}from"./L4ZDCUZR.js";var E=D`:host{display:block}.header{display:flex;block-size:100%;align-items:center;justify-content:space-between}.chevron-container{display:flex;align-items:center}:host([scale=s]){block-size:24px;margin:var(--calcite-spacing-xs);margin-inline-start:var(--calcite-spacing-sm)}:host([scale=s]) .chevron-container,:host([scale=s]) .chevron{min-inline-size:24px;block-size:24px}:host([scale=m]){block-size:32px;margin:var(--calcite-spacing-sm);margin-inline-start:var(--calcite-spacing-sm-plus)}:host([scale=m]) .chevron-container,:host([scale=m]) .chevron{min-inline-size:32px;block-size:32px;--calcite-internal-action-padding-block: var(--calcite-spacing-xxs)}:host([scale=l]){block-size:44px;margin:var(--calcite-spacing-xs);margin-inline-start:var(--calcite-spacing-sm)}:host([scale=l]) .chevron-container,:host([scale=l]) .chevron{min-inline-size:44px;block-size:44px;--calcite-internal-action-padding-block: var(--calcite-spacing-sm-plus)}.chevron{box-sizing:content-box;display:flex;block-size:100%;inline-size:100%;flex-grow:0;cursor:pointer;align-items:center;justify-content:center;border-style:none;outline-color:transparent;transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;--calcite-internal-action-padding-block: 0;--calcite-action-background-color: var(--calcite-date-picker-header-action-background-color);--calcite-action-background-color-hover: var(--calcite-date-picker-header-action-background-color-hover);--calcite-action-background-color-press: var(--calcite-date-picker-header-action-background-color-press);--calcite-action-text-color: var(--calcite-date-picker-header-action-text-color);--calcite-action-text-color-press: var(--calcite-date-picker-header-action-text-color-press)}.chevron:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.chevron[aria-disabled=true]{pointer-events:none}.month-year-container{display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;align-items:center;justify-content:flex-start;text-align:center;line-height:1;gap:var(--calcite-spacing-xxs)}.month-year-container.range-calendar{justify-content:center}.year-container{position:relative;display:flex;block-size:100%}.suffix{display:flex;align-items:center}.year,.suffix{margin-inline:var(--calcite-spacing-xxs);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-date-picker-year-text-color, var(--calcite-color-text-1));font-size:var(--calcite-font-size-md);line-height:var(--calcite-font-line-height-fixed-lg)}.year{position:relative;display:inline-block;border-style:none;background-color:transparent;text-align:center;font-family:inherit;outline-color:transparent;inline-size:44px}.year:hover{transition-timing-function:cubic-bezier(.4,0,.2,1);transition-property:outline-color;outline:2px solid var(--calcite-color-border-2);outline-offset:-2px}.year:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.month-select{--calcite-select-internal-border-width: 0;--calcite-select-internal-icon-border-inline-end-width: 0;--calcite-select-spacing-inline: var(--calcite-spacing-xxs);--calcite-select-font-size: var(--calcite-date-picker-month-select-font-size, var(--calcite-font-size-md));--calcite-select-text-color: var(--calcite-date-picker-month-select-text-color, var(--calcite-color-text-1));--calcite-select-icon-color: var(--calcite-date-picker-month-select-icon-color);--calcite-select-icon-color-hover: var(--calcite-date-picker-month-select-icon-color-hover);--calcite-internal-select-spacing-block: var(--calcite-spacing-xxs);--calcite-internal-select-icon-container-padding-inline: var(--calcite-spacing-xxs);--calcite-internal-select-line-height: var(--calcite-font-line-height-fixed-lg);--calcite-internal-select-font-weight: var(--calcite-font-weight-medium)}:host([scale=s]) .month-year-container .month-select{--calcite-select-spacing-inline: var(--calcite-spacing-base);--calcite-select-font-size: var(--calcite-date-picker-month-select-font-size, var(--calcite-font-size));--calcite-internal-select-spacing-block: var(--calcite-spacing-base);--calcite-internal-select-icon-container-padding-inline: var(--calcite-spacing-base);--calcite-internal-select-block-size: 24px;--calcite-internal-select-line-height: var(--calcite-font-line-height-fixed-base)}:host([scale=s]) .month-year-container .year{inline-size:40px}:host([scale=s]) .month-year-container .year,:host([scale=s]) .month-year-container .suffix{font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-fixed-base)}:host([scale=l]) .month-year-container .month-select{--calcite-select-spacing-inline: var(--calcite-spacing-sm);--calcite-select-font-size: var(--calcite-date-picker-month-select-font-size, var(--calcite-font-size-lg));--calcite-internal-select-spacing-block: var(--calcite-spacing-sm);--calcite-internal-select-icon-container-padding-inline: var(--calcite-spacing-sm);--calcite-internal-select-block-size: 44px;--calcite-internal-select-line-height: var(--calcite-font-line-height-fixed-xl)}:host([scale=l]) .month-year-container .year{inline-size:48px}:host([scale=l]) .month-year-container .year,:host([scale=l]) .month-year-container .suffix{font-size:var(--calcite-font-size-lg);line-height:var(--calcite-font-line-height-fixed-xl)}:host([hidden]){display:none}[hidden]{display:none}`,s={header:"header",chevron:"chevron",chevronContainer:"chevron-container",monthYearContainer:"month-year-container",monthPicker:"month-select",rangeCalendar:"range-calendar",suffix:"suffix",yearContainer:"year-container",year:"year"},N={chevronLeft:"chevron-left",chevronRight:"chevron-right"},K=16,k=class extends Y{constructor(){super(...arguments),this.monthPickerRef=f(),this.nextMonthActionRef=f(),this.prevMonthActionRef=f(),this.yearInputRef=f(),this.calciteInternalDatePickerMonthHeaderSelectChange=C({cancelable:!1})}static{this.properties={nextMonthDate:[16,{},{state:!0}],prevMonthDate:[16,{},{state:!0}],activeDate:[0,{},{attribute:!1}],headingLevel:[9,{},{type:Number}],localeData:[0,{},{attribute:!1}],max:[0,{},{attribute:!1}],messages:[0,{},{attribute:!1}],min:[0,{},{attribute:!1}],monthStyle:1,position:1,scale:[3,{},{reflect:!0}],selectedDate:[0,{},{attribute:!1}]}}static{this.styles=E}connectedCallback(){super.connectedCallback(),this.setNextPrevMonthDates()}load(){this.parentDatePickerEl=R(this.el,"calcite-date-picker")}willUpdate(e){this.hasUpdated&&(e.has("activeDate")||e.has("localeData"))&&this.setYearSelectMenuWidth(),this.hasUpdated&&e.has("scale")&&this.setYearSelectWidthOffset(),(e.has("min")||e.has("max")||e.has("activeDate"))&&this.setNextPrevMonthDates()}loaded(){this.setYearSelectWidthOffset()}setNextPrevMonthDates(){this.activeDate&&(this.nextMonthDate=h(y(this.activeDate),this.min,this.max),this.prevMonthDate=h(x(this.activeDate),this.min,this.max))}onYearKey(e){let t=this.parseCalendarYear(e.target.value);switch(e.key){case"ArrowDown":e.preventDefault(),this.setYear({localizedYear:t,offset:-1});break;case"ArrowUp":e.preventDefault(),this.setYear({localizedYear:t,offset:1});break}}formatCalendarYear(e){return d.localize(`${W(e,this.localeData)}`)}parseCalendarYear(e){return d.localize(`${O(Number(d.delocalize(e)),this.localeData)}`)}onYearChange(e){this.setYear({localizedYear:this.parseCalendarYear(e.target.value)})}onYearInput(e){this.setYear({localizedYear:this.parseCalendarYear(e.target.value),commit:!1})}prevMonthClick(e){this.handleArrowClick(e,this.prevMonthDate)}prevMonthKeydown(e){u(e.key)&&this.prevMonthClick(e)}nextMonthClick(e){this.handleArrowClick(e,this.nextMonthDate)}nextMonthKeydown(e){u(e.key)&&this.nextMonthClick(e)}async handleArrowClick(e,t){e.preventDefault(),await this.handlePenultimateValidMonth(e),this.calciteInternalDatePickerMonthHeaderSelectChange.emit(t)}handleMonthChange(e){let t=e.target,{abbreviated:a,wide:n}=this.localeData.months,i=(this.monthStyle==="wide"?n:a).indexOf(t.value),o=b(this.activeDate,i);v(o,this.min,this.max)||(o=h(o,this.min,this.max)),this.calciteInternalDatePickerMonthHeaderSelectChange.emit(o),this.setYearSelectMenuWidth()}getInRangeDate({localizedYear:e,offset:t=0}){let{min:a,max:n,activeDate:c}=this,i=Number(d.delocalize(e)),o=i.toString().length,m=isNaN(i)?!1:i+t,L=m&&(!a||a.getFullYear()<=m)&&(!n||n.getFullYear()>=m);if(m&&L&&o===e.length){let M=new Date(c);return M.setFullYear(m),h(M,a,n)}}setYear({localizedYear:e,commit:t=!0,offset:a=0}){let{yearInputRef:n,activeDate:c}=this,i=this.getInRangeDate({localizedYear:e,offset:a});i&&this.calciteInternalDatePickerMonthHeaderSelectChange.emit(i),t&&(n.value.value=this.formatCalendarYear((i||c).getFullYear()))}setYearSelectWidthOffset(){this.yearSelectWidthOffset=K+3*parseInt(this.getYearSelectPadding()),this.setYearSelectMenuWidth()}setYearSelectMenuWidth(){let e=this.monthPickerRef.value;e&&requestAnimationFrame(()=>{let t=getComputedStyle(e),a=`${t.fontStyle} ${t.fontVariant} ${t.fontWeight} ${t.fontSize}/${t.lineHeight} ${t.fontFamily}`,c=this.localeData.months[this.monthStyle][this.activeDate.getMonth()],i=Math.ceil(S(c,a));e.style.width=`${i+this.yearSelectWidthOffset}px`})}isMonthInRange(e){let t=b(this.activeDate,e);return!this.min&&!this.max||v(t,this.min,this.max)?!0:p(t,this.max)||p(t,this.min)}async handlePenultimateValidMonth(e){let n=e.target.getAttribute("data-direction")==="left",c;if(n&&this.min){let i=h(x(this.activeDate),this.min,this.max);c=p(i,this.min)}else if(this.max){let i=h(y(this.activeDate),this.min,this.max);c=p(i,this.max)}if(c)if(this.position)this.yearInputRef.value?.focus();else{let o=(n?this.nextMonthActionRef:this.prevMonthActionRef).value;if(!o)return;o.disabled=!1,await o.setFocus()}}getPx(e){let t=Number(e.replace(/[rem|px]/g,"")),a=16;return e.includes("rem")?`${t*a}px`:`${t}px`}getYearSelectPadding(){let e;switch(this.scale){case"l":e=A;break;case"s":e=I;break;default:e=P;break}return this.getPx(e)}render(){return l`<div class=${r(s.header)}>${this.renderContent()}</div>`}renderContent(){let{localeData:e,activeDate:t}=this;if(!t||!e)return null;if(this.parentDatePickerEl){let{numberingSystem:c,lang:i}=this.parentDatePickerEl;d.numberFormatOptions={useGrouping:!1,...c&&{numberingSystem:c},...i&&{locale:i}}}let a=F(e.unitOrder),n=a.indexOf("y")<a.indexOf("m");return l`${this.position&&l`<div class=${r({[s.chevronContainer]:!0})}>${this.position==="start"&&this.renderChevron("left")||""}</div>`||""}<div class=${r({[s.monthYearContainer]:!0,[s.rangeCalendar]:!!this.position})}>${this.renderMonthYearContainer(n)}</div>${!this.position&&l`<div class=${r({[s.chevronContainer]:!0})}>${this.renderChevron("left")}</div>`||""}<div class=${r({[s.chevronContainer]:!0})}>${this.position!=="start"&&this.renderChevron("right")||""}</div>`}renderMonthYearContainer(e){return e?[this.renderYearInput(),this.renderMonthPicker()]:[this.renderMonthPicker(),this.renderYearInput()]}renderMonthPicker(){let e=this.activeDate.getMonth(),t=this.localeData.months[this.monthStyle];return l`<calcite-select class=${r(s.monthPicker)} .label=${this.messages.monthMenu} @calciteSelectChange=${this.handleMonthChange} width=auto ${g(this.monthPickerRef)}>${t.map((a,n)=>l`<calcite-option .disabled=${!this.isMonthInRange(n)} .selected=${n===e} .value=${a}>${a}</calcite-option>`)}</calcite-select>`}renderYearInput(){let e=this.localeData.year?.suffix,t=this.formatCalendarYear(this.activeDate.getFullYear());return l`<span class=${r(s.yearContainer)}><input .ariaLabel=${this.messages.year} class=${r({[s.year]:!0})} inputmode=numeric maxlength=4 minlength=1 @change=${this.onYearChange} @input=${this.onYearInput} @keydown=${this.onYearKey} pattern=\\d* type=text .value=${z(t??"")} ${g(this.yearInputRef)}>${e&&l`<span class=${r(s.suffix)}>${e}</span>`||""}</span>`}renderChevron(e){let t=e==="right",a=p(t?this.nextMonthDate:this.prevMonthDate,this.activeDate)||!v(this.activeDate,this.min,this.max);return l`<calcite-action alignment=center .ariaDisabled=${a} .ariaLabel=${t?this.messages.nextMonth:this.messages.prevMonth} class=${r(s.chevron)} compact data-direction=${e??$} .disabled=${a} .icon=${t?N.chevronRight:N.chevronLeft} icon-flip-rtl @click=${t?this.nextMonthClick:this.prevMonthClick} @keydown=${t?this.nextMonthKeydown:this.prevMonthKeydown} role=button .scale=${this.scale==="l"?"l":"m"} .text=${t?this.messages.nextMonth:this.messages.prevMonth} ${g(t?this.nextMonthActionRef:this.prevMonthActionRef)}></calcite-action>`}};w("calcite-date-picker-month-header",k);export{k as DatePickerMonthHeader};
|
|
3
|
+
v5.0.0-next.89 */
|
|
4
|
+
import{a as v,b as h,e as O,f as W,k as x,l as b,n as y,o as F,q as p}from"./NLHT7BPH.js";import{j as d}from"./P2D55RG4.js";import{h as I,i as P,j as A}from"./65VNRAW6.js";import{a as u}from"./X6UFBNJP.js";import"./3AZH5LXB.js";import{i as S,k as R}from"./2ONQDURU.js";import"./BRWGEU6Y.js";import{B as z,C as f,D as g,E as Y,F as r,Q as w,g as D,h as l,l as $,p as C}from"./MLP57F7O.js";var E=D`:host{display:block}.header{display:flex;block-size:100%;align-items:center;justify-content:space-between}.chevron-container{display:flex;align-items:center}:host([scale=s]){block-size:24px;margin:var(--calcite-spacing-xs);margin-inline-start:var(--calcite-spacing-sm)}:host([scale=s]) .chevron-container,:host([scale=s]) .chevron{min-inline-size:24px;block-size:24px}:host([scale=m]){block-size:32px;margin:var(--calcite-spacing-sm);margin-inline-start:var(--calcite-spacing-sm-plus)}:host([scale=m]) .chevron-container,:host([scale=m]) .chevron{min-inline-size:32px;block-size:32px;--calcite-internal-action-padding-block: var(--calcite-spacing-xxs)}:host([scale=l]){block-size:44px;margin:var(--calcite-spacing-xs);margin-inline-start:var(--calcite-spacing-sm)}:host([scale=l]) .chevron-container,:host([scale=l]) .chevron{min-inline-size:44px;block-size:44px;--calcite-internal-action-padding-block: var(--calcite-spacing-sm-plus)}.chevron{box-sizing:content-box;display:flex;block-size:100%;inline-size:100%;flex-grow:0;cursor:pointer;align-items:center;justify-content:center;border-style:none;outline-color:transparent;transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;--calcite-internal-action-padding-block: 0;--calcite-action-background-color: var(--calcite-date-picker-header-action-background-color);--calcite-action-background-color-hover: var(--calcite-date-picker-header-action-background-color-hover);--calcite-action-background-color-press: var(--calcite-date-picker-header-action-background-color-press);--calcite-action-text-color: var(--calcite-date-picker-header-action-text-color);--calcite-action-text-color-press: var(--calcite-date-picker-header-action-text-color-press)}.chevron:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.chevron[aria-disabled=true]{pointer-events:none}.month-year-container{display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;align-items:center;justify-content:flex-start;text-align:center;line-height:1;gap:var(--calcite-spacing-xxs)}.month-year-container.range-calendar{justify-content:center}.year-container{position:relative;display:flex;block-size:100%}.suffix{display:flex;align-items:center}.year,.suffix{margin-inline:var(--calcite-spacing-xxs);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-date-picker-year-text-color, var(--calcite-color-text-1));font-size:var(--calcite-font-size-md);line-height:var(--calcite-font-line-height-fixed-lg)}.year{position:relative;display:inline-block;border-style:none;background-color:transparent;text-align:center;font-family:inherit;outline-color:transparent;inline-size:44px}.year:hover{transition-timing-function:cubic-bezier(.4,0,.2,1);transition-property:outline-color;outline:2px solid var(--calcite-color-border-2);outline-offset:-2px}.year:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.month-select{--calcite-select-internal-border-width: 0;--calcite-select-internal-icon-border-inline-end-width: 0;--calcite-select-spacing-inline: var(--calcite-spacing-xxs);--calcite-select-font-size: var(--calcite-date-picker-month-select-font-size, var(--calcite-font-size-md));--calcite-select-text-color: var(--calcite-date-picker-month-select-text-color, var(--calcite-color-text-1));--calcite-select-icon-color: var(--calcite-date-picker-month-select-icon-color);--calcite-select-icon-color-hover: var(--calcite-date-picker-month-select-icon-color-hover);--calcite-internal-select-spacing-block: var(--calcite-spacing-xxs);--calcite-internal-select-icon-container-padding-inline: var(--calcite-spacing-xxs);--calcite-internal-select-line-height: var(--calcite-font-line-height-fixed-lg);--calcite-internal-select-font-weight: var(--calcite-font-weight-medium)}:host([scale=s]) .month-year-container .month-select{--calcite-select-spacing-inline: var(--calcite-spacing-base);--calcite-select-font-size: var(--calcite-date-picker-month-select-font-size, var(--calcite-font-size));--calcite-internal-select-spacing-block: var(--calcite-spacing-base);--calcite-internal-select-icon-container-padding-inline: var(--calcite-spacing-base);--calcite-internal-select-block-size: 24px;--calcite-internal-select-line-height: var(--calcite-font-line-height-fixed-base)}:host([scale=s]) .month-year-container .year{inline-size:40px}:host([scale=s]) .month-year-container .year,:host([scale=s]) .month-year-container .suffix{font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-fixed-base)}:host([scale=l]) .month-year-container .month-select{--calcite-select-spacing-inline: var(--calcite-spacing-sm);--calcite-select-font-size: var(--calcite-date-picker-month-select-font-size, var(--calcite-font-size-lg));--calcite-internal-select-spacing-block: var(--calcite-spacing-sm);--calcite-internal-select-icon-container-padding-inline: var(--calcite-spacing-sm);--calcite-internal-select-block-size: 44px;--calcite-internal-select-line-height: var(--calcite-font-line-height-fixed-xl)}:host([scale=l]) .month-year-container .year{inline-size:48px}:host([scale=l]) .month-year-container .year,:host([scale=l]) .month-year-container .suffix{font-size:var(--calcite-font-size-lg);line-height:var(--calcite-font-line-height-fixed-xl)}:host([hidden]){display:none}[hidden]{display:none}`,s={header:"header",chevron:"chevron",chevronContainer:"chevron-container",monthYearContainer:"month-year-container",monthPicker:"month-select",rangeCalendar:"range-calendar",suffix:"suffix",yearContainer:"year-container",year:"year"},N={chevronLeft:"chevron-left",chevronRight:"chevron-right"},K=16,k=class extends Y{constructor(){super(...arguments),this.monthPickerRef=f(),this.nextMonthActionRef=f(),this.prevMonthActionRef=f(),this.yearInputRef=f(),this.calciteInternalDatePickerMonthHeaderSelectChange=C({cancelable:!1})}static{this.properties={nextMonthDate:[16,{},{state:!0}],prevMonthDate:[16,{},{state:!0}],activeDate:[0,{},{attribute:!1}],headingLevel:[9,{},{type:Number}],localeData:[0,{},{attribute:!1}],max:[0,{},{attribute:!1}],messages:[0,{},{attribute:!1}],min:[0,{},{attribute:!1}],monthStyle:1,position:1,scale:[3,{},{reflect:!0}],selectedDate:[0,{},{attribute:!1}]}}static{this.styles=E}connectedCallback(){super.connectedCallback(),this.setNextPrevMonthDates()}load(){this.parentDatePickerEl=R(this.el,"calcite-date-picker")}willUpdate(e){this.hasUpdated&&(e.has("activeDate")||e.has("localeData"))&&this.setYearSelectMenuWidth(),this.hasUpdated&&e.has("scale")&&this.setYearSelectWidthOffset(),(e.has("min")||e.has("max")||e.has("activeDate"))&&this.setNextPrevMonthDates()}loaded(){this.setYearSelectWidthOffset()}setNextPrevMonthDates(){this.activeDate&&(this.nextMonthDate=h(y(this.activeDate),this.min,this.max),this.prevMonthDate=h(x(this.activeDate),this.min,this.max))}onYearKey(e){let t=this.parseCalendarYear(e.target.value);switch(e.key){case"ArrowDown":e.preventDefault(),this.setYear({localizedYear:t,offset:-1});break;case"ArrowUp":e.preventDefault(),this.setYear({localizedYear:t,offset:1});break}}formatCalendarYear(e){return d.localize(`${W(e,this.localeData)}`)}parseCalendarYear(e){return d.localize(`${O(Number(d.delocalize(e)),this.localeData)}`)}onYearChange(e){this.setYear({localizedYear:this.parseCalendarYear(e.target.value)})}onYearInput(e){this.setYear({localizedYear:this.parseCalendarYear(e.target.value),commit:!1})}prevMonthClick(e){this.handleArrowClick(e,this.prevMonthDate)}prevMonthKeydown(e){u(e.key)&&this.prevMonthClick(e)}nextMonthClick(e){this.handleArrowClick(e,this.nextMonthDate)}nextMonthKeydown(e){u(e.key)&&this.nextMonthClick(e)}async handleArrowClick(e,t){e.preventDefault(),await this.handlePenultimateValidMonth(e),this.calciteInternalDatePickerMonthHeaderSelectChange.emit(t)}handleMonthChange(e){let t=e.target,{abbreviated:a,wide:n}=this.localeData.months,i=(this.monthStyle==="wide"?n:a).indexOf(t.value),o=b(this.activeDate,i);v(o,this.min,this.max)||(o=h(o,this.min,this.max)),this.calciteInternalDatePickerMonthHeaderSelectChange.emit(o),this.setYearSelectMenuWidth()}getInRangeDate({localizedYear:e,offset:t=0}){let{min:a,max:n,activeDate:c}=this,i=Number(d.delocalize(e)),o=i.toString().length,m=isNaN(i)?!1:i+t,L=m&&(!a||a.getFullYear()<=m)&&(!n||n.getFullYear()>=m);if(m&&L&&o===e.length){let M=new Date(c);return M.setFullYear(m),h(M,a,n)}}setYear({localizedYear:e,commit:t=!0,offset:a=0}){let{yearInputRef:n,activeDate:c}=this,i=this.getInRangeDate({localizedYear:e,offset:a});i&&this.calciteInternalDatePickerMonthHeaderSelectChange.emit(i),t&&(n.value.value=this.formatCalendarYear((i||c).getFullYear()))}setYearSelectWidthOffset(){this.yearSelectWidthOffset=K+3*parseInt(this.getYearSelectPadding()),this.setYearSelectMenuWidth()}setYearSelectMenuWidth(){let e=this.monthPickerRef.value;e&&requestAnimationFrame(()=>{let t=getComputedStyle(e),a=`${t.fontStyle} ${t.fontVariant} ${t.fontWeight} ${t.fontSize}/${t.lineHeight} ${t.fontFamily}`,c=this.localeData.months[this.monthStyle][this.activeDate.getMonth()],i=Math.ceil(S(c,a));e.style.width=`${i+this.yearSelectWidthOffset}px`})}isMonthInRange(e){let t=b(this.activeDate,e);return!this.min&&!this.max||v(t,this.min,this.max)?!0:p(t,this.max)||p(t,this.min)}async handlePenultimateValidMonth(e){let n=e.target.getAttribute("data-direction")==="left",c;if(n&&this.min){let i=h(x(this.activeDate),this.min,this.max);c=p(i,this.min)}else if(this.max){let i=h(y(this.activeDate),this.min,this.max);c=p(i,this.max)}if(c)if(this.position)this.yearInputRef.value?.focus();else{let o=(n?this.nextMonthActionRef:this.prevMonthActionRef).value;if(!o)return;o.disabled=!1,await o.setFocus()}}getPx(e){let t=Number(e.replace(/[rem|px]/g,"")),a=16;return e.includes("rem")?`${t*a}px`:`${t}px`}getYearSelectPadding(){let e;switch(this.scale){case"l":e=A;break;case"s":e=I;break;default:e=P;break}return this.getPx(e)}render(){return l`<div class=${r(s.header)}>${this.renderContent()}</div>`}renderContent(){let{localeData:e,activeDate:t}=this;if(!t||!e)return null;if(this.parentDatePickerEl){let{numberingSystem:c,lang:i}=this.parentDatePickerEl;d.numberFormatOptions={useGrouping:!1,...c&&{numberingSystem:c},...i&&{locale:i}}}let a=F(e.unitOrder),n=a.indexOf("y")<a.indexOf("m");return l`${this.position&&l`<div class=${r({[s.chevronContainer]:!0})}>${this.position==="start"&&this.renderChevron("left")||""}</div>`||""}<div class=${r({[s.monthYearContainer]:!0,[s.rangeCalendar]:!!this.position})}>${this.renderMonthYearContainer(n)}</div>${!this.position&&l`<div class=${r({[s.chevronContainer]:!0})}>${this.renderChevron("left")}</div>`||""}<div class=${r({[s.chevronContainer]:!0})}>${this.position!=="start"&&this.renderChevron("right")||""}</div>`}renderMonthYearContainer(e){return e?[this.renderYearInput(),this.renderMonthPicker()]:[this.renderMonthPicker(),this.renderYearInput()]}renderMonthPicker(){let e=this.activeDate.getMonth(),t=this.localeData.months[this.monthStyle];return l`<calcite-select class=${r(s.monthPicker)} .label=${this.messages.monthMenu} @calciteSelectChange=${this.handleMonthChange} width=auto ${g(this.monthPickerRef)}>${t.map((a,n)=>l`<calcite-option .disabled=${!this.isMonthInRange(n)} .selected=${n===e} .value=${a}>${a}</calcite-option>`)}</calcite-select>`}renderYearInput(){let e=this.localeData.year?.suffix,t=this.formatCalendarYear(this.activeDate.getFullYear());return l`<span class=${r(s.yearContainer)}><input .ariaLabel=${this.messages.year} class=${r({[s.year]:!0})} inputmode=numeric maxlength=4 minlength=1 @change=${this.onYearChange} @input=${this.onYearInput} @keydown=${this.onYearKey} pattern=\\d* type=text .value=${z(t??"")} ${g(this.yearInputRef)}>${e&&l`<span class=${r(s.suffix)}>${e}</span>`||""}</span>`}renderChevron(e){let t=e==="right",a=p(t?this.nextMonthDate:this.prevMonthDate,this.activeDate)||!v(this.activeDate,this.min,this.max);return l`<calcite-action alignment=center .ariaDisabled=${a} .ariaLabel=${t?this.messages.nextMonth:this.messages.prevMonth} class=${r(s.chevron)} compact data-direction=${e??$} .disabled=${a} .icon=${t?N.chevronRight:N.chevronLeft} icon-flip-rtl @click=${t?this.nextMonthClick:this.prevMonthClick} @keydown=${t?this.nextMonthKeydown:this.prevMonthKeydown} role=button .scale=${this.scale==="l"?"l":"m"} .text=${t?this.messages.nextMonth:this.messages.prevMonth} ${g(t?this.nextMonthActionRef:this.prevMonthActionRef)}></calcite-action>`}};w("calcite-date-picker-month-header",k);export{k as DatePickerMonthHeader};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
3
|
+
v5.0.0-next.89 */
|
|
4
4
|
function e(r){return r.map(o=>{let t="";for(let n=0;n<o;n++)t+=((1+Math.random())*65536|0).toString(16).substring(1);return t}).join("-")}var i=()=>e([2,1,1,1,3]);export{i as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as o}from"./
|
|
3
|
+
v5.0.0-next.89 */
|
|
4
|
+
import{a as o}from"./X3KIBEZG.js";import"./NPB7VTTN.js";async function m(){return o.sort().map(r=>({label:r}))}export{m as groupByName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as L}from"./ZZO4GIL7.js";import{a as z,b as R}from"./T3IG7WCW.js";import{d as r}from"./TITR7KAS.js";import{a as M}from"./7O4KYDQA.js";import{a as A}from"./QUGOJYRK.js";import{a as I}from"./HH5T3FXJ.js";import{a as P}from"./4YGBY7AH.js";import{a as E}from"./Z4ETK22W.js";import{a as C}from"./JXV4E5JI.js";import{a as B}from"./MAGCHPNI.js";import{a as O}from"./JGXR5K5I.js";import"./XIKCSTRR.js";import"./SBTAFILO.js";import"./S7I3XRAV.js";import{D as f}from"./JEKNLQYF.js";import"./HXY3H2PS.js";import{C as k,D as w,E as $,F as b,N as l,Q as T,g as D,h as y,p as g}from"./L4ZDCUZR.js";var m={dialog:"dialog",panel:"panel",scrim:"scrim",container:"container",containerOpen:"container--open",containerEmbedded:"container--embedded",assistiveText:"assistive-text",openingActive:"dialog--opening-active"},c={actionBar:"action-bar",alerts:"alerts",customContent:"custom-content",contentTop:"content-top",contentBottom:"content-bottom",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerStart:"footer-start",footerEnd:"footer-end"},F={x:null,y:null},U={top:null,right:null,bottom:null,left:null},V=D`:host{--calcite-dialog-scrim-background-color: rgba(0, 0, 0, .85);pointer-events:none;inset:0;display:flex;--calcite-internal-dialog-animation-offset: 20px}:host([top-layer-disabled]),:host([top-layer-disabled]) .container,:host([embedded]),.container--embedded{z-index:var(--calcite-z-index-overlay)}:host([embedded][modal]){position:absolute}.container{pointer-events:auto;position:fixed;inset:0;display:flex;block-size:100%;inline-size:100%;align-items:center;justify-content:center;overflow:hidden;color:var(--calcite-color-text-2);opacity:0;visibility:hidden;transition:visibility 0ms linear var(--calcite-internal-animation-timing-slow),opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88)}:host([placement=top]) .container{align-items:flex-start;justify-content:center}:host([placement=top-start]) .container{align-items:flex-start;justify-content:flex-start}:host([placement=top-end]) .container{align-items:flex-start;justify-content:flex-end}:host([placement=bottom]) .container{align-items:flex-end;justify-content:center}:host([placement=bottom-start]) .container{align-items:flex-end;justify-content:flex-start}:host([placement=bottom-end]) .container{align-items:flex-end;justify-content:flex-end}:host(:not([modal])) .container{pointer-events:none}:host([scale=s]){--calcite-internal-dialog-content-padding: var(--calcite-dialog-content-space, var(--calcite-spacing-sm));--calcite-internal-dialog-min-size-x: 198px;--calcite-internal-dialog-min-size-y: 140px}:host([scale=m]){--calcite-internal-dialog-content-padding: var(--calcite-dialog-content-space, var(--calcite-spacing-md));--calcite-internal-dialog-min-size-x: 288px;--calcite-internal-dialog-min-size-y: 180px}:host([scale=l]){--calcite-internal-dialog-content-padding: var(--calcite-dialog-content-space, var(--calcite-spacing-md-plus));--calcite-internal-dialog-min-size-x: 388px;--calcite-internal-dialog-min-size-y: 220px}.scrim{--calcite-scrim-background: var(--calcite-dialog-scrim-background-color, var(--calcite-color-transparent-scrim));--calcite-scrim-background-color: var( --calcite-dialog-scrim-background-color, var(--calcite-color-transparent-scrim) );position:fixed;inset:0;display:flex;overflow-y:hidden;z-index:calc(var(--calcite-z-index) * -1)}:host([top-layer-disabled]) .scrim{z-index:unset}calcite-panel{--calcite-panel-content-space: var(--calcite-dialog-content-space, var(--calcite-internal-dialog-content-padding));--calcite-panel-footer-space: var(--calcite-dialog-footer-space);--calcite-panel-border-color: var(--calcite-dialog-border-color);--calcite-panel-background-color: var(--calcite-dialog-background-color, var(--calcite-color-foreground-1));--calcite-panel-icon-color: var(--calcite-dialog-icon-color);--calcite-panel-heading-text-color: var(--calcite-dialog-heading-text-color);--calcite-panel-description-text-color: var(--calcite-dialog-description-text-color);--calcite-panel-header-background-color: var(--calcite-dialog-header-background-color);--calcite-panel-header-action-background-color: var(--calcite-dialog-header-action-background-color);--calcite-panel-header-action-background-color-hover: var(--calcite-dialog-header-action-background-color-hover);--calcite-panel-header-action-background-color-press: var(--calcite-dialog-header-action-background-color-press);--calcite-panel-header-action-text-color: var(--calcite-dialog-header-action-text-color);--calcite-panel-header-action-text-color-press: var(--calcite-dialog-header-action-text-color-press);--calcite-panel-footer-background-color: var(--calcite-dialog-footer-background-color);--calcite-panel-space: var(--calcite-dialog-space, var(--calcite-internal-dialog-content-padding));--calcite-panel-header-content-space: var(--calcite-dialog-header-content-space, var(--calcite-dialog-content-space));--calcite-popover-border-color: var(--calcite-dialog-action-menu-border-color, var(--calcite-color-border-1));--calcite-panel-corner-radius: var(--calcite-dialog-corner-radius)}:host([kind=brand]) calcite-panel{--calcite-panel-icon-color: var(--calcite-dialog-icon-color, var(--calcite-color-brand))}:host([kind=danger]) calcite-panel{--calcite-panel-icon-color: var(--calcite-dialog-icon-color, var(--calcite-color-status-danger))}:host([kind=info]) calcite-panel{--calcite-panel-icon-color: var(--calcite-dialog-icon-color, var(--calcite-color-status-info))}:host([kind=success]) calcite-panel{--calcite-panel-icon-color: var(--calcite-dialog-icon-color, var(--calcite-color-status-success))}:host([kind=warning]) calcite-panel{--calcite-panel-icon-color: var(--calcite-dialog-icon-color, var(--calcite-color-status-warning))}::slotted(*){--calcite-panel-background-color: initial}[popover]{padding:0;border:none;background-color:transparent;position:fixed;display:flex}[popover]:popover-open{display:flex}.dialog{pointer-events:none;position:relative;margin:1.5rem;box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;opacity:0;--tw-shadow: 0 2px 12px -4px rgba(0, 0, 0, .2), 0 2px 4px -2px rgba(0, 0, 0, .16);--tw-shadow-colored: 0 2px 12px -4px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);-webkit-overflow-scrolling:touch;visibility:hidden;transition:inset-block var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88),opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88);border-radius:var(--calcite-dialog-corner-radius, var(--calcite-corner-radius-sm));min-inline-size:var(--calcite-dialog-min-size-x, var(--calcite-internal-dialog-min-size-x));max-inline-size:var(--calcite-dialog-max-size-x, 100%);min-block-size:var(--calcite-dialog-min-size-y, var(--calcite-internal-dialog-min-size-y));max-block-size:var(--calcite-dialog-max-size-y, 100%);--calcite-internal-dialog-hidden-position: calc( var(--calcite-dialog-offset-y, 0px) + var(--calcite-internal-dialog-animation-offset) );--calcite-internal-dialog-shown-position: var(--calcite-dialog-offset-y, 0);inset-inline-start:var(--calcite-dialog-offset-x, 0);inset-block-start:var(--calcite-internal-dialog-hidden-position)}.dialog--opening-active{inset-block-start:var(--calcite-internal-dialog-shown-position)}:host([top-layer-disabled]) .dialog,:host([embedded]) .dialog{z-index:var(--calcite-z-index-modal)}:host([menu-open]) .dialog{transition:visibility 0ms linear var(--calcite-internal-animation-timing-slow),opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88)}.panel{visibility:hidden;opacity:0;border-radius:var(--calcite-dialog-corner-radius, var(--calcite-corner-radius-sm));transition:visibility 0ms linear var(--calcite-internal-animation-timing-slow),opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88)}.container--open .panel{visibility:visible;opacity:1;transition:visibility 0ms linear,opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88)}.container--open{opacity:1;visibility:visible;transition-delay:0ms}.container--open .dialog{pointer-events:auto;visibility:visible;opacity:1;transition:inset-block var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88),opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88);transition-delay:0ms}.width-s{inline-size:auto;inline-size:var(--calcite-dialog-size-x, 32rem);block-size:var(--calcite-dialog-size-y, auto)}@media screen and (max-width:35rem){:host(:not([fullscreen-disabled])) .width-s{margin:0;block-size:100%;max-block-size:100%;inline-size:100%;max-inline-size:100%;inset-inline-start:0;inset-block-start:var(--calcite-internal-dialog-animation-offset)}}:host(:not([fullscreen-disabled])) .width-s.dialog--opening-active{inset-block-start:0}.width-m{inline-size:var(--calcite-dialog-size-x, 48rem);block-size:var(--calcite-dialog-size-y, auto)}@media screen and (max-width:51rem){:host(:not([fullscreen-disabled])) .width-m{margin:0;block-size:100%;max-block-size:100%;inline-size:100%;max-inline-size:100%;inset-inline-start:0;inset-block-start:var(--calcite-internal-dialog-animation-offset)}}:host(:not([fullscreen-disabled])) .width-m.dialog--opening-active{inset-block-start:0}.width-l{inline-size:var(--calcite-dialog-size-x, 94rem);block-size:var(--calcite-dialog-size-y, auto)}@media screen and (max-width:97rem){:host(:not([fullscreen-disabled])) .width-l{margin:0;block-size:100%;max-block-size:100%;inline-size:100%;max-inline-size:100%;inset-inline-start:0;inset-block-start:var(--calcite-internal-dialog-animation-offset)}}:host(:not([fullscreen-disabled])) .width-l.dialog--opening-active{inset-block-start:0}:host([placement=cover]) .dialog{margin:0;block-size:100%;max-block-size:100%;inline-size:100%;max-inline-size:100%;border-radius:0}:host([placement=cover]) .panel{border-radius:0}:host([kind]) .panel{border-start-start-radius:0px;border-start-end-radius:0px}:host([kind]) .dialog{overflow:hidden}:host([kind=brand]) .dialog{border-color:var(--calcite-color-brand)}:host([kind=danger]) .dialog{border-color:var(--calcite-dialog-accent-color, var(--calcite-color-status-danger))}:host([kind=info]) .dialog{border-color:var(--calcite-dialog-accent-color, var(--calcite-color-status-info))}:host([kind=success]) .dialog{border-color:var(--calcite-dialog-accent-color, var(--calcite-color-status-success))}:host([kind=warning]) .dialog{border-color:var(--calcite-dialog-accent-color, var(--calcite-color-status-warning))}:host([kind=brand][open]) .dialog,:host([kind=danger][open]) .dialog,:host([kind=info][open]) .dialog,:host([kind=success][open]) .dialog,:host([kind=warning][open]) .dialog{border-width:0px;border-block-start-width:4px;border-style:solid}.container--embedded{position:absolute;pointer-events:auto}.container--embedded calcite-scrim{position:absolute}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}`,S=class extends ${constructor(){super(...arguments),this.dragPosition={...F},this.focusTrap=M({triggerProp:"open",focusTrapOptions:{clickOutsideDeactivates:()=>!this.modal||this.embedded,escapeDeactivates:e=>(!e.defaultPrevented&&!this.escapeDisabled&&(this.open=!1,e.preventDefault()),!1)}})(this),this.usePreventDocumentScroll=L()(this),this.mutationObserver=C("mutation",()=>this.handleMutationObserver()),this._open=!1,this.openProp="opened",this.transitionProp="opacity",this.panelRef=k(),this.popoverRef=k(),this.resizePosition={...U},this.transitionEl=null,this.messages=B(),this.focusSetter=O()(this),this.sizeOverride=R({targetElement:()=>({value:this.transitionEl}),getBounds:()=>({inline:{min:this.resizeValues.minInlineSize,max:this.resizeValues.maxInlineSize},block:{min:this.resizeValues.minBlockSize,max:this.resizeValues.maxBlockSize}}),fullscreenDisabled:()=>this.fullscreenDisabled}),this.topLayer=I({disabledOverride:()=>this.embedded,target:this.popoverRef})(this),this.assistiveText=null,this.hasContentBottom=!1,this.hasContentTop=!1,this.hasFooter=!0,this.opened=!1,this.resizeValues={inlineSize:null,blockSize:null,minInlineSize:null,minBlockSize:null,maxInlineSize:null,maxBlockSize:null},this.closeDisabled=!1,this.dragEnabled=!1,this.embedded=!1,this.escapeDisabled=!1,this.fullscreenDisabled=!1,this.iconFlipRtl=!1,this.loading=!1,this.menuOpen=!1,this.modal=!1,this.focusTrapDisabled=!1,this.outsideCloseDisabled=!1,this.overlayPositioning="absolute",this.placement="center",this.resizable=!1,this.scale="m",this.topLayerDisabled=!1,this.widthScale="m",this.calciteDialogBeforeClose=g({cancelable:!1}),this.calciteDialogBeforeOpen=g({cancelable:!1}),this.calciteDialogClose=g({cancelable:!1}),this.calciteDialogOpen=g({cancelable:!1}),this.calciteDialogScroll=g({cancelable:!1})}static{this.properties={assistiveText:[16,{},{state:!0}],hasContentBottom:[16,{},{state:!0}],hasContentTop:[16,{},{state:!0}],hasFooter:[16,{},{state:!0}],opened:[16,{},{state:!0}],resizeValues:[16,{},{state:!0}],beforeClose:[0,{},{attribute:!1}],closeDisabled:[7,{},{reflect:!0,type:Boolean}],description:1,dragEnabled:[7,{},{reflect:!0,type:Boolean}],embedded:[7,{},{reflect:!0,type:Boolean}],escapeDisabled:[7,{},{reflect:!0,type:Boolean}],focusTrapOptions:[0,{},{attribute:!1}],fullscreenDisabled:[7,{},{reflect:!0,type:Boolean}],heading:1,headingLevel:[11,{},{type:Number,reflect:!0}],kind:[3,{},{reflect:!0}],icon:[3,{type:String},{reflect:!0}],iconFlipRtl:[7,{},{reflect:!0,type:Boolean}],loading:[7,{},{reflect:!0,type:Boolean}],menuOpen:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],modal:[7,{},{reflect:!0,type:Boolean}],focusTrapDisabled:[7,{},{reflect:!0,type:Boolean}],open:[7,{},{reflect:!0,type:Boolean}],outsideCloseDisabled:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],placement:[3,{},{reflect:!0}],resizable:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],topLayerDisabled:[7,{},{reflect:!0,type:Boolean}],widthScale:[3,{},{reflect:!0}],width:[3,{},{reflect:!0}]}}static{this.styles=V}get preventDocumentScroll(){return!this.embedded&&this.modal}get open(){return this._open}set open(e){let i=this._open;e!==i&&this.setOpenState(e)}async scrollContentTo(e){await this.panelRef.value?.scrollContentTo(e)}async setFocus(e){return this.focusSetter(()=>this.panelRef.value??this.el,e)}async updateFocusTrapElements(e){this.focusTrap.setExtraContainers(e),this.focusTrap.updateContainerElements()}async updateSize(e){this.updateSizeInternal(e)}connectedCallback(){super.connectedCallback(),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setupInteractions()}willUpdate(e){(e.has("open")&&(this.hasUpdated||this.open!==!1)||e.has("placement")&&(this.hasUpdated||this.placement!=="center")||e.has("resizable")&&(this.hasUpdated||this.resizable!==!1)||e.has("dragEnabled")&&(this.hasUpdated||this.dragEnabled!==!1))&&this.setupInteractions(),(e.has("messages")||e.has("dragEnabled")&&(this.hasUpdated||this.dragEnabled!==!1)||e.has("resizable")&&(this.hasUpdated||this.resizable!==!1))&&this.updateAssistiveText(),e.has("opened")&&(this.hasUpdated||this.opened!==!1)&&this.handleOpenedChange(this.opened)}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.embedded=!1,this.cleanupInteractions()}focusTrapDisabledOverride(){return!this.modal&&this.focusTrapDisabled}updateAssistiveText(){let{messages:e}=this;this.assistiveText=e&&(this.dragEnabled||this.resizable)?`${this.dragEnabled?e.dragEnabled:""} ${this.resizable?e.resizeEnabled:""}`:null}onBeforeOpen(){this.calciteDialogBeforeOpen.emit(),this.topLayer.show()}onOpen(){this.focusTrapDisabled&&this.setFocus(),this.focusTrap.activate(),this.calciteDialogOpen.emit()}onBeforeClose(){this.calciteDialogBeforeClose.emit()}onClose(){this.focusTrap.deactivate(),this.calciteDialogClose.emit(),this.topLayer.hide()}async setOpenState(e){if(this.beforeClose&&!e)try{await this.beforeClose?.()}catch{return}this._open=e,e&&await this.componentOnReady(),this.opened=e}handleOpenedChange(e){let{transitionEl:i}=this;i&&(i.classList.toggle(m.openingActive,e),P(this))}async triggerInteractModifiers(){let{interaction:e}=this;e&&(await e.reflow({name:"drag"}),await e.reflow({name:"resize"}))}getTransitionRefDOMRect(){return this.transitionEl.getBoundingClientRect()}handleKeyDown(e){let{key:i,shiftKey:t,defaultPrevented:s}=e,{dragEnabled:a,resizable:o,resizePosition:d,dragPosition:n,transitionEl:p}=this;if(!(s||!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(i)))switch(i){case"ArrowUp":if(t&&o&&p){let{minBlockSize:u}=window.getComputedStyle(p),h=f(u),v=this.getTransitionRefDOMRect().height;if(v<=h)return;this.updateSizeInternal({block:v-l}),d.bottom-=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault()}else a&&(n.y-=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault());break;case"ArrowDown":t&&o&&p?(this.updateSizeInternal({block:this.getTransitionRefDOMRect().height+l}),d.bottom+=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault()):a&&(n.y+=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault());break;case"ArrowLeft":if(t&&o&&p){let{minInlineSize:u}=window.getComputedStyle(p),h=f(u),v=this.getTransitionRefDOMRect().width;if(v<=h)return;this.updateSizeInternal({inline:v-l}),d.right-=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault()}else a&&(n.x-=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault());break;case"ArrowRight":t&&o&&p?(this.updateSizeInternal({inline:this.getTransitionRefDOMRect().width+l}),d.right+=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault()):a&&(n.x+=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault());break}}updateTransform(){let{dragPosition:{x:e,y:i},resizePosition:t,transitionEl:s,dragEnabled:a,resizable:o}=this;if(!s)return;if(!a&&!o){s.style.transform=null;return}let{top:d,right:n,bottom:p,left:x}=this.getAdjustedResizePosition(t),u=Math.round(e+x+n),h=Math.round(i+d+p);this.transitionEl.style.transform=u||h?`translate(${u}px, ${h}px)`:null}cleanupInteractions(){this.interaction?.unset(),this.updateSizeInternal({inline:null,block:null}),this.dragPosition={...F},this.resizePosition={...U},this.updateTransform()}async setupInteractions(){this.cleanupInteractions();let{el:e,transitionEl:i,resizable:t,dragEnabled:s,resizePosition:a,dragPosition:o}=this;if(!(!i||!this.open)){if((t||s)&&(this.interaction=z(i,{context:e.ownerDocument})),t){await this.el.componentOnReady();let{minInlineSize:d,minBlockSize:n,maxInlineSize:p,maxBlockSize:x}=window.getComputedStyle(this.transitionEl);this.interaction.resizable({edges:{top:!0,right:!0,bottom:!0,left:!0},modifiers:[z.modifiers.restrictSize({min:{width:f(d),height:f(n)},max:{width:f(p)||window.innerWidth,height:f(x)||window.innerHeight}}),z.modifiers.restrict({restriction:"parent"})],listeners:{move:({rect:u,deltaRect:h})=>{h&&(a.top+=h.top,a.right+=h.right,a.bottom+=h.bottom,a.left+=h.left),this.updateSizeInternal({inline:u.width,block:u.height}),this.updateTransform()}}})}s&&this.interaction.draggable({modifiers:[z.modifiers.restrictRect({restriction:"parent"})],listeners:{move:({dx:d,dy:n})=>{o.x+=d,o.y+=n,this.updateTransform()}}})}}getAdjustedResizePosition({top:e,right:i,bottom:t,left:s}){let a=e/2,o=i/2,d=t/2,n=s/2;switch(this.placement){case"top":return{top:e,right:o,bottom:0,left:n};case"top-start":return{top:e,right:0,bottom:0,left:s};case"top-end":return{top:e,right:i,bottom:0,left:0};case"bottom":return{top:0,right:o,bottom:t,left:n};case"bottom-start":return{top:0,right:0,bottom:t,left:s};case"bottom-end":return{top:0,right:i,bottom:t,left:0};case"cover":case"center":default:return{top:a,right:o,bottom:d,left:n}}}setTransitionEl(e){e&&(this.transitionEl=e,this.setupInteractions())}handleInternalPanelScroll(e){e.target===this.panelRef.value&&(e.stopPropagation(),this.calciteDialogScroll.emit())}handleInternalPanelCloseClick(e){e.target===this.panelRef.value&&(e.preventDefault(),e.stopPropagation(),this.open=!1)}handlePanelKeyDown(e){this.escapeDisabled&&e.key==="Escape"&&!e.defaultPrevented&&e.preventDefault()}handleOutsideClose(){this.outsideCloseDisabled||(this.open=!1)}handleMutationObserver(){this.focusTrap.updateContainerElements()}updateSizeInternal(e){if(!this.transitionEl)return;let t=this.sizeOverride.resize(e);this.resizeValues={...this.resizeValues,...t.inline!==void 0&&{inlineSize:t.inline},...t.block!==void 0&&{blockSize:t.block}}}render(){let{assistiveText:e,description:i,heading:t,opened:s,icon:a,iconFlipRtl:o}=this;return y`<div .ariaDescription=${i} .ariaLabel=${t} .ariaModal=${this.modal} class=${b({[m.container]:!0,[m.containerOpen]:s,[m.containerEmbedded]:this.embedded})} .popover=${this.embedded?null:"manual"} role=dialog ${w(this.popoverRef)}>${this.modal?y`<calcite-scrim class=${b(m.scrim)} @click=${this.handleOutsideClose}></calcite-scrim>`:null}<div class=${b({[m.dialog]:!0,[A("width",this.width,this.widthScale)]:!!(this.width||this.widthScale)})} @keydown=${this.handleKeyDown} ${w(this.setTransitionEl)}>${e?E("assistive-text",y`<div aria-live=polite class=${b(m.assistiveText)}>${e}</div>`):null}<slot name=${c.customContent}><calcite-panel class=${b(m.panel)} .closable=${!this.closeDisabled} .description=${i} .heading=${t} .headingLevel=${this.headingLevel} .hidden=${!this.opened} .icon=${a} .iconFlipRtl=${o} .loading=${this.loading} .menuOpen=${this.menuOpen} .messageOverrides=${this.messageOverrides} @keydown=${this.handlePanelKeyDown} @calcitePanelClose=${this.handleInternalPanelCloseClick} @calcitePanelScroll=${this.handleInternalPanelScroll} .overlayPositioning=${this.overlayPositioning} .scale=${this.scale} .topLayerDisabled=${this.topLayerDisabled} ${w(this.panelRef)}><slot name=${c.actionBar} slot=${r.actionBar}></slot><slot name=${c.alerts} slot=${r.alerts}></slot><slot name=${c.headerActionsStart} slot=${r.headerActionsStart}></slot><slot name=${c.headerActionsEnd} slot=${r.headerActionsEnd}></slot><slot name=${c.headerContent} slot=${r.headerContent}></slot><slot name=${c.headerMenuActions} slot=${r.headerMenuActions}></slot><slot name=${c.fab} slot=${r.fab}></slot><slot name=${c.contentTop} slot=${r.contentTop}></slot><slot name=${c.contentBottom} slot=${r.contentBottom}></slot><slot name=${c.footerStart} slot=${r.footerStart}></slot><slot name=${c.footer} slot=${r.footer}></slot><slot name=${c.footerEnd} slot=${r.footerEnd}></slot><slot></slot></calcite-panel></slot></div></div>`}};T("calcite-dialog",S);export{S as Dialog};
|
|
3
|
+
v5.0.0-next.89 */
|
|
4
|
+
import{a as L}from"./INOC7TAR.js";import{a as z,b as R}from"./H6M6RHJW.js";import{d as r}from"./R27SU7NH.js";import{a as M}from"./CEFDXM74.js";import{a as A}from"./VANR5BQP.js";import{a as I}from"./QJONTQZC.js";import{a as P}from"./IKLHRFXD.js";import{a as E}from"./64IGPE2N.js";import{a as C}from"./NFVAS5ZC.js";import{a as B}from"./YSTQVB4Y.js";import{a as O}from"./AFHUIPDJ.js";import"./56RQHSBE.js";import"./R3GQZCQ5.js";import"./3AZH5LXB.js";import{D as f}from"./2ONQDURU.js";import"./BRWGEU6Y.js";import{C as k,D as w,E as $,F as b,N as l,Q as T,g as D,h as y,p as g}from"./MLP57F7O.js";var m={dialog:"dialog",panel:"panel",scrim:"scrim",container:"container",containerOpen:"container--open",containerEmbedded:"container--embedded",assistiveText:"assistive-text",openingActive:"dialog--opening-active"},c={actionBar:"action-bar",alerts:"alerts",customContent:"custom-content",contentTop:"content-top",contentBottom:"content-bottom",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerStart:"footer-start",footerEnd:"footer-end"},F={x:null,y:null},U={top:null,right:null,bottom:null,left:null},V=D`:host{--calcite-dialog-scrim-background-color: rgba(0, 0, 0, .85);pointer-events:none;inset:0;display:flex;--calcite-internal-dialog-animation-offset: 20px}:host([top-layer-disabled]),:host([top-layer-disabled]) .container,:host([embedded]),.container--embedded{z-index:var(--calcite-z-index-overlay)}:host([embedded][modal]){position:absolute}.container{pointer-events:auto;position:fixed;inset:0;display:flex;block-size:100%;inline-size:100%;align-items:center;justify-content:center;overflow:hidden;color:var(--calcite-color-text-2);opacity:0;visibility:hidden;transition:visibility 0ms linear var(--calcite-internal-animation-timing-slow),opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88)}:host([placement=top]) .container{align-items:flex-start;justify-content:center}:host([placement=top-start]) .container{align-items:flex-start;justify-content:flex-start}:host([placement=top-end]) .container{align-items:flex-start;justify-content:flex-end}:host([placement=bottom]) .container{align-items:flex-end;justify-content:center}:host([placement=bottom-start]) .container{align-items:flex-end;justify-content:flex-start}:host([placement=bottom-end]) .container{align-items:flex-end;justify-content:flex-end}:host(:not([modal])) .container{pointer-events:none}:host([scale=s]){--calcite-internal-dialog-content-padding: var(--calcite-dialog-content-space, var(--calcite-spacing-sm));--calcite-internal-dialog-min-size-x: 198px;--calcite-internal-dialog-min-size-y: 140px}:host([scale=m]){--calcite-internal-dialog-content-padding: var(--calcite-dialog-content-space, var(--calcite-spacing-md));--calcite-internal-dialog-min-size-x: 288px;--calcite-internal-dialog-min-size-y: 180px}:host([scale=l]){--calcite-internal-dialog-content-padding: var(--calcite-dialog-content-space, var(--calcite-spacing-md-plus));--calcite-internal-dialog-min-size-x: 388px;--calcite-internal-dialog-min-size-y: 220px}.scrim{--calcite-scrim-background: var(--calcite-dialog-scrim-background-color, var(--calcite-color-transparent-scrim));--calcite-scrim-background-color: var( --calcite-dialog-scrim-background-color, var(--calcite-color-transparent-scrim) );position:fixed;inset:0;display:flex;overflow-y:hidden;z-index:calc(var(--calcite-z-index) * -1)}:host([top-layer-disabled]) .scrim{z-index:unset}calcite-panel{--calcite-panel-content-space: var(--calcite-dialog-content-space, var(--calcite-internal-dialog-content-padding));--calcite-panel-footer-space: var(--calcite-dialog-footer-space);--calcite-panel-border-color: var(--calcite-dialog-border-color);--calcite-panel-background-color: var(--calcite-dialog-background-color, var(--calcite-color-foreground-1));--calcite-panel-icon-color: var(--calcite-dialog-icon-color);--calcite-panel-heading-text-color: var(--calcite-dialog-heading-text-color);--calcite-panel-description-text-color: var(--calcite-dialog-description-text-color);--calcite-panel-header-background-color: var(--calcite-dialog-header-background-color);--calcite-panel-header-action-background-color: var(--calcite-dialog-header-action-background-color);--calcite-panel-header-action-background-color-hover: var(--calcite-dialog-header-action-background-color-hover);--calcite-panel-header-action-background-color-press: var(--calcite-dialog-header-action-background-color-press);--calcite-panel-header-action-text-color: var(--calcite-dialog-header-action-text-color);--calcite-panel-header-action-text-color-press: var(--calcite-dialog-header-action-text-color-press);--calcite-panel-footer-background-color: var(--calcite-dialog-footer-background-color);--calcite-panel-space: var(--calcite-dialog-space, var(--calcite-internal-dialog-content-padding));--calcite-panel-header-content-space: var(--calcite-dialog-header-content-space, var(--calcite-dialog-content-space));--calcite-popover-border-color: var(--calcite-dialog-action-menu-border-color, var(--calcite-color-border-1));--calcite-panel-corner-radius: var(--calcite-dialog-corner-radius)}:host([kind=brand]) calcite-panel{--calcite-panel-icon-color: var(--calcite-dialog-icon-color, var(--calcite-color-brand))}:host([kind=danger]) calcite-panel{--calcite-panel-icon-color: var(--calcite-dialog-icon-color, var(--calcite-color-status-danger))}:host([kind=info]) calcite-panel{--calcite-panel-icon-color: var(--calcite-dialog-icon-color, var(--calcite-color-status-info))}:host([kind=success]) calcite-panel{--calcite-panel-icon-color: var(--calcite-dialog-icon-color, var(--calcite-color-status-success))}:host([kind=warning]) calcite-panel{--calcite-panel-icon-color: var(--calcite-dialog-icon-color, var(--calcite-color-status-warning))}::slotted(*){--calcite-panel-background-color: initial}[popover]{padding:0;border:none;background-color:transparent;position:fixed;display:flex}[popover]:popover-open{display:flex}.dialog{pointer-events:none;position:relative;margin:1.5rem;box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;opacity:0;--tw-shadow: 0 2px 12px -4px rgba(0, 0, 0, .2), 0 2px 4px -2px rgba(0, 0, 0, .16);--tw-shadow-colored: 0 2px 12px -4px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);-webkit-overflow-scrolling:touch;visibility:hidden;transition:inset-block var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88),opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88);border-radius:var(--calcite-dialog-corner-radius, var(--calcite-corner-radius-sm));min-inline-size:var(--calcite-dialog-min-size-x, var(--calcite-internal-dialog-min-size-x));max-inline-size:var(--calcite-dialog-max-size-x, 100%);min-block-size:var(--calcite-dialog-min-size-y, var(--calcite-internal-dialog-min-size-y));max-block-size:var(--calcite-dialog-max-size-y, 100%);--calcite-internal-dialog-hidden-position: calc( var(--calcite-dialog-offset-y, 0px) + var(--calcite-internal-dialog-animation-offset) );--calcite-internal-dialog-shown-position: var(--calcite-dialog-offset-y, 0);inset-inline-start:var(--calcite-dialog-offset-x, 0);inset-block-start:var(--calcite-internal-dialog-hidden-position)}.dialog--opening-active{inset-block-start:var(--calcite-internal-dialog-shown-position)}:host([top-layer-disabled]) .dialog,:host([embedded]) .dialog{z-index:var(--calcite-z-index-modal)}:host([menu-open]) .dialog{transition:visibility 0ms linear var(--calcite-internal-animation-timing-slow),opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88)}.panel{visibility:hidden;opacity:0;border-radius:var(--calcite-dialog-corner-radius, var(--calcite-corner-radius-sm));transition:visibility 0ms linear var(--calcite-internal-animation-timing-slow),opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88)}.container--open .panel{visibility:visible;opacity:1;transition:visibility 0ms linear,opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88)}.container--open{opacity:1;visibility:visible;transition-delay:0ms}.container--open .dialog{pointer-events:auto;visibility:visible;opacity:1;transition:inset-block var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88),opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(.215,.44,.42,.88);transition-delay:0ms}.width-s{inline-size:auto;inline-size:var(--calcite-dialog-size-x, 32rem);block-size:var(--calcite-dialog-size-y, auto)}@media screen and (max-width:35rem){:host(:not([fullscreen-disabled])) .width-s{margin:0;block-size:100%;max-block-size:100%;inline-size:100%;max-inline-size:100%;inset-inline-start:0;inset-block-start:var(--calcite-internal-dialog-animation-offset)}}:host(:not([fullscreen-disabled])) .width-s.dialog--opening-active{inset-block-start:0}.width-m{inline-size:var(--calcite-dialog-size-x, 48rem);block-size:var(--calcite-dialog-size-y, auto)}@media screen and (max-width:51rem){:host(:not([fullscreen-disabled])) .width-m{margin:0;block-size:100%;max-block-size:100%;inline-size:100%;max-inline-size:100%;inset-inline-start:0;inset-block-start:var(--calcite-internal-dialog-animation-offset)}}:host(:not([fullscreen-disabled])) .width-m.dialog--opening-active{inset-block-start:0}.width-l{inline-size:var(--calcite-dialog-size-x, 94rem);block-size:var(--calcite-dialog-size-y, auto)}@media screen and (max-width:97rem){:host(:not([fullscreen-disabled])) .width-l{margin:0;block-size:100%;max-block-size:100%;inline-size:100%;max-inline-size:100%;inset-inline-start:0;inset-block-start:var(--calcite-internal-dialog-animation-offset)}}:host(:not([fullscreen-disabled])) .width-l.dialog--opening-active{inset-block-start:0}:host([placement=cover]) .dialog{margin:0;block-size:100%;max-block-size:100%;inline-size:100%;max-inline-size:100%;border-radius:0}:host([placement=cover]) .panel{border-radius:0}:host([kind]) .panel{border-start-start-radius:0px;border-start-end-radius:0px}:host([kind]) .dialog{overflow:hidden}:host([kind=brand]) .dialog{border-color:var(--calcite-color-brand)}:host([kind=danger]) .dialog{border-color:var(--calcite-dialog-accent-color, var(--calcite-color-status-danger))}:host([kind=info]) .dialog{border-color:var(--calcite-dialog-accent-color, var(--calcite-color-status-info))}:host([kind=success]) .dialog{border-color:var(--calcite-dialog-accent-color, var(--calcite-color-status-success))}:host([kind=warning]) .dialog{border-color:var(--calcite-dialog-accent-color, var(--calcite-color-status-warning))}:host([kind=brand][open]) .dialog,:host([kind=danger][open]) .dialog,:host([kind=info][open]) .dialog,:host([kind=success][open]) .dialog,:host([kind=warning][open]) .dialog{border-width:0px;border-block-start-width:4px;border-style:solid}.container--embedded{position:absolute;pointer-events:auto}.container--embedded calcite-scrim{position:absolute}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}`,S=class extends ${constructor(){super(...arguments),this.dragPosition={...F},this.focusTrap=M({triggerProp:"open",focusTrapOptions:{clickOutsideDeactivates:()=>!this.modal||this.embedded,escapeDeactivates:e=>(!e.defaultPrevented&&!this.escapeDisabled&&(this.open=!1,e.preventDefault()),!1)}})(this),this.usePreventDocumentScroll=L()(this),this.mutationObserver=C("mutation",()=>this.handleMutationObserver()),this._open=!1,this.openProp="opened",this.transitionProp="opacity",this.panelRef=k(),this.popoverRef=k(),this.resizePosition={...U},this.transitionEl=null,this.messages=B(),this.focusSetter=O()(this),this.sizeOverride=R({targetElement:()=>({value:this.transitionEl}),getBounds:()=>({inline:{min:this.resizeValues.minInlineSize,max:this.resizeValues.maxInlineSize},block:{min:this.resizeValues.minBlockSize,max:this.resizeValues.maxBlockSize}}),fullscreenDisabled:()=>this.fullscreenDisabled}),this.topLayer=I({disabledOverride:()=>this.embedded,target:this.popoverRef})(this),this.assistiveText=null,this.hasContentBottom=!1,this.hasContentTop=!1,this.hasFooter=!0,this.opened=!1,this.resizeValues={inlineSize:null,blockSize:null,minInlineSize:null,minBlockSize:null,maxInlineSize:null,maxBlockSize:null},this.closeDisabled=!1,this.dragEnabled=!1,this.embedded=!1,this.escapeDisabled=!1,this.fullscreenDisabled=!1,this.iconFlipRtl=!1,this.loading=!1,this.menuOpen=!1,this.modal=!1,this.focusTrapDisabled=!1,this.outsideCloseDisabled=!1,this.overlayPositioning="absolute",this.placement="center",this.resizable=!1,this.scale="m",this.topLayerDisabled=!1,this.widthScale="m",this.calciteDialogBeforeClose=g({cancelable:!1}),this.calciteDialogBeforeOpen=g({cancelable:!1}),this.calciteDialogClose=g({cancelable:!1}),this.calciteDialogOpen=g({cancelable:!1}),this.calciteDialogScroll=g({cancelable:!1})}static{this.properties={assistiveText:[16,{},{state:!0}],hasContentBottom:[16,{},{state:!0}],hasContentTop:[16,{},{state:!0}],hasFooter:[16,{},{state:!0}],opened:[16,{},{state:!0}],resizeValues:[16,{},{state:!0}],beforeClose:[0,{},{attribute:!1}],closeDisabled:[7,{},{reflect:!0,type:Boolean}],description:1,dragEnabled:[7,{},{reflect:!0,type:Boolean}],embedded:[7,{},{reflect:!0,type:Boolean}],escapeDisabled:[7,{},{reflect:!0,type:Boolean}],focusTrapOptions:[0,{},{attribute:!1}],fullscreenDisabled:[7,{},{reflect:!0,type:Boolean}],heading:1,headingLevel:[11,{},{type:Number,reflect:!0}],kind:[3,{},{reflect:!0}],icon:[3,{type:String},{reflect:!0}],iconFlipRtl:[7,{},{reflect:!0,type:Boolean}],loading:[7,{},{reflect:!0,type:Boolean}],menuOpen:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],modal:[7,{},{reflect:!0,type:Boolean}],focusTrapDisabled:[7,{},{reflect:!0,type:Boolean}],open:[7,{},{reflect:!0,type:Boolean}],outsideCloseDisabled:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],placement:[3,{},{reflect:!0}],resizable:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],topLayerDisabled:[7,{},{reflect:!0,type:Boolean}],widthScale:[3,{},{reflect:!0}],width:[3,{},{reflect:!0}]}}static{this.styles=V}get preventDocumentScroll(){return!this.embedded&&this.modal}get open(){return this._open}set open(e){let i=this._open;e!==i&&this.setOpenState(e)}async scrollContentTo(e){await this.panelRef.value?.scrollContentTo(e)}async setFocus(e){return this.focusSetter(()=>this.panelRef.value??this.el,e)}async updateFocusTrapElements(e){this.focusTrap.setExtraContainers(e),this.focusTrap.updateContainerElements()}async updateSize(e){this.updateSizeInternal(e)}connectedCallback(){super.connectedCallback(),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setupInteractions()}willUpdate(e){(e.has("open")&&(this.hasUpdated||this.open!==!1)||e.has("placement")&&(this.hasUpdated||this.placement!=="center")||e.has("resizable")&&(this.hasUpdated||this.resizable!==!1)||e.has("dragEnabled")&&(this.hasUpdated||this.dragEnabled!==!1))&&this.setupInteractions(),(e.has("messages")||e.has("dragEnabled")&&(this.hasUpdated||this.dragEnabled!==!1)||e.has("resizable")&&(this.hasUpdated||this.resizable!==!1))&&this.updateAssistiveText(),e.has("opened")&&(this.hasUpdated||this.opened!==!1)&&this.handleOpenedChange(this.opened)}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.embedded=!1,this.cleanupInteractions()}focusTrapDisabledOverride(){return!this.modal&&this.focusTrapDisabled}updateAssistiveText(){let{messages:e}=this;this.assistiveText=e&&(this.dragEnabled||this.resizable)?`${this.dragEnabled?e.dragEnabled:""} ${this.resizable?e.resizeEnabled:""}`:null}onBeforeOpen(){this.calciteDialogBeforeOpen.emit(),this.topLayer.show()}onOpen(){this.focusTrapDisabled&&this.setFocus(),this.focusTrap.activate(),this.calciteDialogOpen.emit()}onBeforeClose(){this.calciteDialogBeforeClose.emit()}onClose(){this.focusTrap.deactivate(),this.calciteDialogClose.emit(),this.topLayer.hide()}async setOpenState(e){if(this.beforeClose&&!e)try{await this.beforeClose?.()}catch{return}this._open=e,e&&await this.componentOnReady(),this.opened=e}handleOpenedChange(e){let{transitionEl:i}=this;i&&(i.classList.toggle(m.openingActive,e),P(this))}async triggerInteractModifiers(){let{interaction:e}=this;e&&(await e.reflow({name:"drag"}),await e.reflow({name:"resize"}))}getTransitionRefDOMRect(){return this.transitionEl.getBoundingClientRect()}handleKeyDown(e){let{key:i,shiftKey:t,defaultPrevented:s}=e,{dragEnabled:a,resizable:o,resizePosition:d,dragPosition:n,transitionEl:p}=this;if(!(s||!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(i)))switch(i){case"ArrowUp":if(t&&o&&p){let{minBlockSize:u}=window.getComputedStyle(p),h=f(u),v=this.getTransitionRefDOMRect().height;if(v<=h)return;this.updateSizeInternal({block:v-l}),d.bottom-=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault()}else a&&(n.y-=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault());break;case"ArrowDown":t&&o&&p?(this.updateSizeInternal({block:this.getTransitionRefDOMRect().height+l}),d.bottom+=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault()):a&&(n.y+=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault());break;case"ArrowLeft":if(t&&o&&p){let{minInlineSize:u}=window.getComputedStyle(p),h=f(u),v=this.getTransitionRefDOMRect().width;if(v<=h)return;this.updateSizeInternal({inline:v-l}),d.right-=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault()}else a&&(n.x-=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault());break;case"ArrowRight":t&&o&&p?(this.updateSizeInternal({inline:this.getTransitionRefDOMRect().width+l}),d.right+=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault()):a&&(n.x+=l,this.updateTransform(),this.triggerInteractModifiers(),e.preventDefault());break}}updateTransform(){let{dragPosition:{x:e,y:i},resizePosition:t,transitionEl:s,dragEnabled:a,resizable:o}=this;if(!s)return;if(!a&&!o){s.style.transform=null;return}let{top:d,right:n,bottom:p,left:x}=this.getAdjustedResizePosition(t),u=Math.round(e+x+n),h=Math.round(i+d+p);this.transitionEl.style.transform=u||h?`translate(${u}px, ${h}px)`:null}cleanupInteractions(){this.interaction?.unset(),this.updateSizeInternal({inline:null,block:null}),this.dragPosition={...F},this.resizePosition={...U},this.updateTransform()}async setupInteractions(){this.cleanupInteractions();let{el:e,transitionEl:i,resizable:t,dragEnabled:s,resizePosition:a,dragPosition:o}=this;if(!(!i||!this.open)){if((t||s)&&(this.interaction=z(i,{context:e.ownerDocument})),t){await this.el.componentOnReady();let{minInlineSize:d,minBlockSize:n,maxInlineSize:p,maxBlockSize:x}=window.getComputedStyle(this.transitionEl);this.interaction.resizable({edges:{top:!0,right:!0,bottom:!0,left:!0},modifiers:[z.modifiers.restrictSize({min:{width:f(d),height:f(n)},max:{width:f(p)||window.innerWidth,height:f(x)||window.innerHeight}}),z.modifiers.restrict({restriction:"parent"})],listeners:{move:({rect:u,deltaRect:h})=>{h&&(a.top+=h.top,a.right+=h.right,a.bottom+=h.bottom,a.left+=h.left),this.updateSizeInternal({inline:u.width,block:u.height}),this.updateTransform()}}})}s&&this.interaction.draggable({modifiers:[z.modifiers.restrictRect({restriction:"parent"})],listeners:{move:({dx:d,dy:n})=>{o.x+=d,o.y+=n,this.updateTransform()}}})}}getAdjustedResizePosition({top:e,right:i,bottom:t,left:s}){let a=e/2,o=i/2,d=t/2,n=s/2;switch(this.placement){case"top":return{top:e,right:o,bottom:0,left:n};case"top-start":return{top:e,right:0,bottom:0,left:s};case"top-end":return{top:e,right:i,bottom:0,left:0};case"bottom":return{top:0,right:o,bottom:t,left:n};case"bottom-start":return{top:0,right:0,bottom:t,left:s};case"bottom-end":return{top:0,right:i,bottom:t,left:0};case"cover":case"center":default:return{top:a,right:o,bottom:d,left:n}}}setTransitionEl(e){e&&(this.transitionEl=e,this.setupInteractions())}handleInternalPanelScroll(e){e.target===this.panelRef.value&&(e.stopPropagation(),this.calciteDialogScroll.emit())}handleInternalPanelCloseClick(e){e.target===this.panelRef.value&&(e.preventDefault(),e.stopPropagation(),this.open=!1)}handlePanelKeyDown(e){this.escapeDisabled&&e.key==="Escape"&&!e.defaultPrevented&&e.preventDefault()}handleOutsideClose(){this.outsideCloseDisabled||(this.open=!1)}handleMutationObserver(){this.focusTrap.updateContainerElements()}updateSizeInternal(e){if(!this.transitionEl)return;let t=this.sizeOverride.resize(e);this.resizeValues={...this.resizeValues,...t.inline!==void 0&&{inlineSize:t.inline},...t.block!==void 0&&{blockSize:t.block}}}render(){let{assistiveText:e,description:i,heading:t,opened:s,icon:a,iconFlipRtl:o}=this;return y`<div .ariaDescription=${i} .ariaLabel=${t} .ariaModal=${this.modal} class=${b({[m.container]:!0,[m.containerOpen]:s,[m.containerEmbedded]:this.embedded})} .popover=${this.embedded?null:"manual"} role=dialog ${w(this.popoverRef)}>${this.modal?y`<calcite-scrim class=${b(m.scrim)} @click=${this.handleOutsideClose}></calcite-scrim>`:null}<div class=${b({[m.dialog]:!0,[A("width",this.width,this.widthScale)]:!!(this.width||this.widthScale)})} @keydown=${this.handleKeyDown} ${w(this.setTransitionEl)}>${e?E("assistive-text",y`<div aria-live=polite class=${b(m.assistiveText)}>${e}</div>`):null}<slot name=${c.customContent}><calcite-panel class=${b(m.panel)} .closable=${!this.closeDisabled} .description=${i} .heading=${t} .headingLevel=${this.headingLevel} .hidden=${!this.opened} .icon=${a} .iconFlipRtl=${o} .loading=${this.loading} .menuOpen=${this.menuOpen} .messageOverrides=${this.messageOverrides} @keydown=${this.handlePanelKeyDown} @calcitePanelClose=${this.handleInternalPanelCloseClick} @calcitePanelScroll=${this.handleInternalPanelScroll} .overlayPositioning=${this.overlayPositioning} .scale=${this.scale} .topLayerDisabled=${this.topLayerDisabled} ${w(this.panelRef)}><slot name=${c.actionBar} slot=${r.actionBar}></slot><slot name=${c.alerts} slot=${r.alerts}></slot><slot name=${c.headerActionsStart} slot=${r.headerActionsStart}></slot><slot name=${c.headerActionsEnd} slot=${r.headerActionsEnd}></slot><slot name=${c.headerContent} slot=${r.headerContent}></slot><slot name=${c.headerMenuActions} slot=${r.headerMenuActions}></slot><slot name=${c.fab} slot=${r.fab}></slot><slot name=${c.contentTop} slot=${r.contentTop}></slot><slot name=${c.contentBottom} slot=${r.contentBottom}></slot><slot name=${c.footerStart} slot=${r.footerStart}></slot><slot name=${c.footer} slot=${r.footer}></slot><slot name=${c.footerEnd} slot=${r.footerEnd}></slot><slot></slot></calcite-panel></slot></div></div>`}};T("calcite-dialog",S);export{S as Dialog};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{b as oe}from"./
|
|
3
|
+
v5.0.0-next.89 */
|
|
4
|
+
import{b as oe}from"./R3GQZCQ5.js";import{a as ne,l as ie}from"./2ONQDURU.js";import{O as re}from"./MLP57F7O.js";var se=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],B=se.join(","),ce=typeof Element>"u",D=ce?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,j=!ce&&Element.prototype.getRootNode?function(a){var e;return a==null||(e=a.getRootNode)===null||e===void 0?void 0:e.call(a)}:function(a){return a?.ownerDocument},K=function a(e,t){var r;t===void 0&&(t=!0);var u=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=u===""||u==="true",n=s||t&&e&&a(e.parentNode);return n},Se=function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"},le=function(e,t,r){if(K(e))return[];var u=Array.prototype.slice.apply(e.querySelectorAll(B));return t&&D.call(e,B)&&u.unshift(e),u=u.filter(r),u},fe=function a(e,t,r){for(var u=[],s=Array.from(e);s.length;){var n=s.shift();if(!K(n,!1))if(n.tagName==="SLOT"){var d=n.assignedElements(),l=d.length?d:n.children,y=a(l,!0,r);r.flatten?u.push.apply(u,y):u.push({scopeParent:n,candidates:y})}else{var T=D.call(n,B);T&&r.filter(n)&&(t||!e.includes(n))&&u.push(n);var w=n.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(n),S=!K(w,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(n));if(w&&S){var C=a(w===!0?n.children:w.children,!0,r);r.flatten?u.push.apply(u,C):u.push({scopeParent:n,candidates:C})}else s.unshift.apply(s,n.children)}}return u},de=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},E=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Se(e))&&!de(e)?0:e.tabIndex},ke=function(e,t){var r=E(e);return r<0&&t&&!de(e)?0:r},De=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ve=function(e){return e.tagName==="INPUT"},Re=function(e){return ve(e)&&e.type==="hidden"},Ce=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return t},Oe=function(e,t){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===t)return e[r]},Ae=function(e){if(!e.name)return!0;var t=e.form||j(e),r=function(d){return t.querySelectorAll('input[type="radio"][name="'+d+'"]')},u;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")u=r(window.CSS.escape(e.name));else try{u=r(e.name)}catch(n){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",n.message),!1}var s=Oe(u,e.form);return!s||s===e},Ie=function(e){return ve(e)&&e.type==="radio"},Pe=function(e){return Ie(e)&&!Ae(e)},xe=function(e){var t,r=e&&j(e),u=(t=r)===null||t===void 0?void 0:t.host,s=!1;if(r&&r!==e){var n,d,l;for(s=!!((n=u)!==null&&n!==void 0&&(d=n.ownerDocument)!==null&&d!==void 0&&d.contains(u)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!s&&u;){var y,T,w;r=j(u),u=(y=r)===null||y===void 0?void 0:y.host,s=!!((T=u)!==null&&T!==void 0&&(w=T.ownerDocument)!==null&&w!==void 0&&w.contains(u))}}return s},ue=function(e){var t=e.getBoundingClientRect(),r=t.width,u=t.height;return r===0&&u===0},Le=function(e,t){var r=t.displayCheck,u=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var s=D.call(e,"details>summary:first-of-type"),n=s?e.parentElement:e;if(D.call(n,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof u=="function"){for(var d=e;e;){var l=e.parentElement,y=j(e);if(l&&!l.shadowRoot&&u(l)===!0)return ue(e);e.assignedSlot?e=e.assignedSlot:!l&&y!==e.ownerDocument?e=y.host:e=l}e=d}if(xe(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return ue(e);return!1},Be=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var r=0;r<t.children.length;r++){var u=t.children.item(r);if(u.tagName==="LEGEND")return D.call(t,"fieldset[disabled] *")?!0:!u.contains(e)}return!0}t=t.parentElement}return!1},M=function(e,t){return!(t.disabled||K(t)||Re(t)||Le(t,e)||Ce(t)||Be(t))},$=function(e,t){return!(Pe(t)||E(t)<0||!M(e,t))},je=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ke=function a(e){var t=[],r=[];return e.forEach(function(u,s){var n=!!u.scopeParent,d=n?u.scopeParent:u,l=ke(d,n),y=n?a(u.candidates):d;l===0?n?t.push.apply(t,y):t.push(d):r.push({documentOrder:s,tabIndex:l,item:u,isScope:n,content:y})}),r.sort(De).reduce(function(u,s){return s.isScope?u.push.apply(u,s.content):u.push(s.content),u},[]).concat(t)},be=function(e,t){t=t||{};var r;return t.getShadowRoot?r=fe([e],t.includeContainer,{filter:$.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:je}):r=le(e,t.includeContainer,$.bind(null,t)),Ke(r)},he=function(e,t){t=t||{};var r;return t.getShadowRoot?r=fe([e],t.includeContainer,{filter:M.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):r=le(e,t.includeContainer,M.bind(null,t)),r},R=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return D.call(e,B)===!1?!1:$(t,e)},Me=se.concat("iframe").join(","),G=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return D.call(e,Me)===!1?!1:M(t,e)};function Y(a,e){(e==null||e>a.length)&&(e=a.length);for(var t=0,r=Array(e);t<e;t++)r[t]=a[t];return r}function Ge(a){if(Array.isArray(a))return Y(a)}function _e(a,e,t){return(e=$e(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function qe(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function Ve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
5
5
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pe(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);e&&(r=r.filter(function(u){return Object.getOwnPropertyDescriptor(a,u).enumerable})),t.push.apply(t,r)}return t}function ye(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pe(Object(t),!0).forEach(function(r){_e(a,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):pe(Object(t)).forEach(function(r){Object.defineProperty(a,r,Object.getOwnPropertyDescriptor(t,r))})}return a}function Ue(a){return Ge(a)||qe(a)||Ye(a)||Ve()}function We(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var r=t.call(a,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function $e(a){var e=We(a,"string");return typeof e=="symbol"?e:e+""}function Ye(a,e){if(a){if(typeof a=="string")return Y(a,e);var t={}.toString.call(a).slice(8,-1);return t==="Object"&&a.constructor&&(t=a.constructor.name),t==="Map"||t==="Set"?Array.from(a):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Y(a,e):void 0}}var ge={activateTrap:function(e,t){if(e.length>0){var r=e[e.length-1];r!==t&&r._setPausedState(!0)}var u=e.indexOf(t);u===-1||e.splice(u,1),e.push(t)},deactivateTrap:function(e,t){var r=e.indexOf(t);r!==-1&&e.splice(r,1),e.length>0&&!e[e.length-1]._isManuallyPaused()&&e[e.length-1]._setPausedState(!1)}},Ze=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},ze=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},x=function(e){return e?.key==="Tab"||e?.keyCode===9},Xe=function(e){return x(e)&&!e.shiftKey},He=function(e){return x(e)&&e.shiftKey},me=function(e){return setTimeout(e,0)},P=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),u=1;u<t;u++)r[u-1]=arguments[u];return typeof e=="function"?e.apply(void 0,r):e},_=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},Je=[],we=function(e,t){var r=t?.document||document,u=t?.trapStack||Je,s=ye({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Xe,isKeyBackward:He},t),n={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},d,l=function(i,o,c){return i&&i[o]!==void 0?i[o]:s[c||o]},y=function(i,o){var c=typeof o?.composedPath=="function"?o.composedPath():void 0;return n.containerGroups.findIndex(function(v){var b=v.container,p=v.tabbableNodes;return b.contains(i)||c?.includes(b)||p.find(function(f){return f===i})})},T=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=o.hasFallback,v=c===void 0?!1:c,b=o.params,p=b===void 0?[]:b,f=s[i];if(typeof f=="function"&&(f=f.apply(void 0,Ue(p))),f===!0&&(f=void 0),!f){if(f===void 0||f===!1)return f;throw new Error("`".concat(i,"` was specified but was not a node, or did not return a node"))}var g=f;if(typeof f=="string"){try{g=r.querySelector(f)}catch(m){throw new Error("`".concat(i,'` appears to be an invalid selector; error="').concat(m.message,'"'))}if(!g&&!v)throw new Error("`".concat(i,"` as selector refers to no known node"))}return g},w=function(){var i=T("initialFocus",{hasFallback:!0});if(i===!1)return!1;if(i===void 0||i&&!G(i,s.tabbableOptions))if(y(r.activeElement)>=0)i=r.activeElement;else{var o=n.tabbableGroups[0],c=o&&o.firstTabbableNode;i=c||T("fallbackFocus")}else i===null&&(i=T("fallbackFocus"));if(!i)throw new Error("Your focus-trap needs to have at least one focusable element");return i},S=function(){if(n.containerGroups=n.containers.map(function(i){var o=be(i,s.tabbableOptions),c=he(i,s.tabbableOptions),v=o.length>0?o[0]:void 0,b=o.length>0?o[o.length-1]:void 0,p=c.find(function(m){return R(m)}),f=c.slice().reverse().find(function(m){return R(m)}),g=!!o.find(function(m){return E(m)>0});return{container:i,tabbableNodes:o,focusableNodes:c,posTabIndexesFound:g,firstTabbableNode:v,lastTabbableNode:b,firstDomTabbableNode:p,lastDomTabbableNode:f,nextTabbableNode:function(k){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,N=o.indexOf(k);return N<0?A?c.slice(c.indexOf(k)+1).find(function(I){return R(I)}):c.slice(0,c.indexOf(k)).reverse().find(function(I){return R(I)}):o[N+(A?1:-1)]}}}),n.tabbableGroups=n.containerGroups.filter(function(i){return i.tabbableNodes.length>0}),n.tabbableGroups.length<=0&&!T("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(n.containerGroups.find(function(i){return i.posTabIndexesFound})&&n.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},C=function(i){var o=i.activeElement;if(o)return o.shadowRoot&&o.shadowRoot.activeElement!==null?C(o.shadowRoot):o},F=function(i){if(i!==!1&&i!==C(document)){if(!i||!i.focus){F(w());return}i.focus({preventScroll:!!s.preventScroll}),n.mostRecentlyFocusedNode=i,Ze(i)&&i.select()}},Z=function(i){var o=T("setReturnFocus",{params:[i]});return o||(o===!1?!1:i)},z=function(i){var o=i.target,c=i.event,v=i.isBackward,b=v===void 0?!1:v;o=o||_(c),S();var p=null;if(n.tabbableGroups.length>0){var f=y(o,c),g=f>=0?n.containerGroups[f]:void 0;if(f<0)b?p=n.tabbableGroups[n.tabbableGroups.length-1].lastTabbableNode:p=n.tabbableGroups[0].firstTabbableNode;else if(b){var m=n.tabbableGroups.findIndex(function(U){var W=U.firstTabbableNode;return o===W});if(m<0&&(g.container===o||G(o,s.tabbableOptions)&&!R(o,s.tabbableOptions)&&!g.nextTabbableNode(o,!1))&&(m=f),m>=0){var k=m===0?n.tabbableGroups.length-1:m-1,A=n.tabbableGroups[k];p=E(o)>=0?A.lastTabbableNode:A.lastDomTabbableNode}else x(c)||(p=g.nextTabbableNode(o,!1))}else{var N=n.tabbableGroups.findIndex(function(U){var W=U.lastTabbableNode;return o===W});if(N<0&&(g.container===o||G(o,s.tabbableOptions)&&!R(o,s.tabbableOptions)&&!g.nextTabbableNode(o))&&(N=f),N>=0){var I=N===n.tabbableGroups.length-1?0:N+1,ae=n.tabbableGroups[I];p=E(o)>=0?ae.firstTabbableNode:ae.firstDomTabbableNode}else x(c)||(p=g.nextTabbableNode(o))}}else p=T("fallbackFocus");return p},L=function(i){var o=_(i);if(!(y(o,i)>=0)){if(P(s.clickOutsideDeactivates,i)){d.deactivate({returnFocus:s.returnFocusOnDeactivate});return}P(s.allowOutsideClick,i)||i.preventDefault()}},X=function(i){var o=_(i),c=y(o,i)>=0;if(c||o instanceof Document)c&&(n.mostRecentlyFocusedNode=o);else{i.stopImmediatePropagation();var v,b=!0;if(n.mostRecentlyFocusedNode)if(E(n.mostRecentlyFocusedNode)>0){var p=y(n.mostRecentlyFocusedNode),f=n.containerGroups[p].tabbableNodes;if(f.length>0){var g=f.findIndex(function(m){return m===n.mostRecentlyFocusedNode});g>=0&&(s.isKeyForward(n.recentNavEvent)?g+1<f.length&&(v=f[g+1],b=!1):g-1>=0&&(v=f[g-1],b=!1))}}else n.containerGroups.some(function(m){return m.tabbableNodes.some(function(k){return E(k)>0})})||(b=!1);else b=!1;b&&(v=z({target:n.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(n.recentNavEvent)})),F(v||n.mostRecentlyFocusedNode||w())}n.recentNavEvent=void 0},Ne=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;n.recentNavEvent=i;var c=z({event:i,isBackward:o});c&&(x(i)&&i.preventDefault(),F(c))},H=function(i){(s.isKeyForward(i)||s.isKeyBackward(i))&&Ne(i,s.isKeyBackward(i))},J=function(i){ze(i)&&P(s.escapeDeactivates,i)!==!1&&(i.preventDefault(),d.deactivate())},Q=function(i){var o=_(i);y(o,i)>=0||P(s.clickOutsideDeactivates,i)||P(s.allowOutsideClick,i)||(i.preventDefault(),i.stopImmediatePropagation())},ee=function(){if(n.active)return ge.activateTrap(u,d),n.delayInitialFocusTimer=s.delayInitialFocus?me(function(){F(w())}):F(w()),r.addEventListener("focusin",X,!0),r.addEventListener("mousedown",L,{capture:!0,passive:!1}),r.addEventListener("touchstart",L,{capture:!0,passive:!1}),r.addEventListener("click",Q,{capture:!0,passive:!1}),r.addEventListener("keydown",H,{capture:!0,passive:!1}),r.addEventListener("keydown",J),d},te=function(){if(n.active)return r.removeEventListener("focusin",X,!0),r.removeEventListener("mousedown",L,!0),r.removeEventListener("touchstart",L,!0),r.removeEventListener("click",Q,!0),r.removeEventListener("keydown",H,!0),r.removeEventListener("keydown",J),d},Ee=function(i){var o=i.some(function(c){var v=Array.from(c.removedNodes);return v.some(function(b){return b===n.mostRecentlyFocusedNode})});o&&F(w())},V=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(Ee):void 0,O=function(){V&&(V.disconnect(),n.active&&!n.paused&&n.containers.map(function(i){V.observe(i,{subtree:!0,childList:!0})}))};return d={get active(){return n.active},get paused(){return n.paused},activate:function(i){if(n.active)return this;var o=l(i,"onActivate"),c=l(i,"onPostActivate"),v=l(i,"checkCanFocusTrap");v||S(),n.active=!0,n.paused=!1,n.nodeFocusedBeforeActivation=C(r),o?.();var b=function(){v&&S(),ee(),O(),c?.()};return v?(v(n.containers.concat()).then(b,b),this):(b(),this)},deactivate:function(i){if(!n.active)return this;var o=ye({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},i);clearTimeout(n.delayInitialFocusTimer),n.delayInitialFocusTimer=void 0,te(),n.active=!1,n.paused=!1,O(),ge.deactivateTrap(u,d);var c=l(o,"onDeactivate"),v=l(o,"onPostDeactivate"),b=l(o,"checkCanReturnFocus"),p=l(o,"returnFocus","returnFocusOnDeactivate");c?.();var f=function(){me(function(){p&&F(Z(n.nodeFocusedBeforeActivation)),v?.()})};return p&&b?(b(Z(n.nodeFocusedBeforeActivation)).then(f,f),this):(f(),this)},pause:function(i){return n.active?(n.manuallyPaused=!0,this._setPausedState(!0,i)):this},unpause:function(i){return n.active?(n.manuallyPaused=!1,u[u.length-1]!==this?this:this._setPausedState(!1,i)):this},updateContainerElements:function(i){var o=[].concat(i).filter(Boolean);return n.containers=o.map(function(c){return typeof c=="string"?r.querySelector(c):c}),n.active&&S(),O(),this}},Object.defineProperties(d,{_isManuallyPaused:{value:function(){return n.manuallyPaused}},_setPausedState:{value:function(i,o){if(n.paused===i)return this;if(n.paused=i,i){var c=l(o,"onPause"),v=l(o,"onPostPause");c?.(),te(),O(),v?.()}else{var b=l(o,"onUnpause"),p=l(o,"onPostUnpause");b?.(),S(),ee(),O(),p?.()}return this}}}),d.updateContainerElements(e),d};function Te(a,{focusTrapOptions:e},t){return!e?.extraContainers&&!t?a:[a,...Fe(e?.extraContainers),...Fe(t)]}function Fe(a=[]){return Array.isArray(a)?a:[a]}var q=new WeakSet;function Qe(a,e){let t=e&&e!==document.body&&e!==document.documentElement;return!q.has(a)&&t&&ie(e),!1}function et(a,e){let t=e?.fallbackFocus||a,r=e?.clickOutsideDeactivates??!0;return{fallbackFocus:t,...e,document:a.ownerDocument,tabbableOptions:ne,trapStack:re().focusTrapStack,clickOutsideDeactivates:u=>(q.has(a)||q.add(a),typeof r=="function"?r(u):r),onPostDeactivate:()=>{q.delete(a)},setReturnFocus:u=>{let s=typeof e?.setReturnFocus=="function"?e.setReturnFocus(u):e?.setReturnFocus;return s===void 0?Qe(a,u):s}}}var st=a=>oe((e,t)=>{let r,u,s,n=a.focusTrapOptions;t.onConnected(()=>{e[a.triggerProp]&&r&&d.activate()}),t.onUpdate(l=>{e.hasUpdated&&l.has("focusTrapDisabled")&&(e.focusTrapDisabled?d.deactivate():d.activate())}),t.onDisconnected(()=>d.deactivate());let d={get _instance(){},activate:()=>{let l=u||e.el;l.isConnected&&(r||(s||=Te(l,e),r=we(s,et(l,{...n,...e.focusTrapOptions}))),(typeof e.focusTrapDisabledOverride=="function"?!e.focusTrapDisabledOverride():!e.focusTrapDisabled)&&r.activate())},deactivate:()=>r?.deactivate(),overrideFocusTrapEl:l=>{if(r)throw new Error("Focus trap already created");u=l},setExtraContainers:l=>{let y=u||e.el;s=Te(y,e,l)},updateContainerElements:()=>r?.updateContainerElements(s)};return d});export{st as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{b as l}from"./
|
|
3
|
+
v5.0.0-next.89 */
|
|
4
|
+
import{b as l}from"./RPBMY35D.js";import{a as g}from"./MPXMVTUH.js";import{a as f}from"./56RQHSBE.js";import"./R3GQZCQ5.js";import"./3AZH5LXB.js";import{a as v}from"./BRWGEU6Y.js";import{E as u,F as i,Q as h,g as p,h as o,p as m}from"./MLP57F7O.js";var t={container:"container",containerActive:"container--active",contentCenter:"content-center",description:"description",heading:"heading",iconEnd:"icon-end",iconStart:"icon-start",scale:c=>`scale--${c}`},b={contentEnd:"content-end",contentStart:"content-start"},x="autocomplete-item",y={host:c=>`${x}-${c}`},S=p`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}.scale--s{font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);--calcite-internal-autocomplete-item-spacing-unit-l: .5rem;--calcite-internal-autocomplete-item-spacing-unit-s: .25rem;--calcite-internal-autocomplete-item-description-font-size: var(--calcite-font-size-xs)}.scale--m{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);--calcite-internal-autocomplete-item-spacing-unit-l: .75rem;--calcite-internal-autocomplete-item-spacing-unit-s: .375rem;--calcite-internal-autocomplete-item-description-font-size: var(--calcite-font-size-sm)}.scale--l{font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);--calcite-internal-autocomplete-item-spacing-unit-l: 1rem;--calcite-internal-autocomplete-item-spacing-unit-s: .625rem;--calcite-internal-autocomplete-item-description-font-size: var(--calcite-font-size)}:host{display:flex}.container{position:relative;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:100%;cursor:pointer;align-items:center;outline-color:transparent;background-color:var(--calcite-autocomplete-background-color, var(--calcite-color-foreground-1));color:var(--calcite-autocomplete-text-color, var(--calcite-color-text-3));gap:var(--calcite-internal-autocomplete-item-spacing-unit-l);padding-inline:var(--calcite-internal-autocomplete-item-spacing-unit-l);padding-block:var(--calcite-internal-autocomplete-item-spacing-unit-s);word-wrap:break-word;word-break:break-word;justify-content:space-around}.description{color:var(--calcite-autocomplete-description-text-color);font-size:var(--calcite-internal-autocomplete-item-description-font-size)}.heading{color:var(--calcite-autocomplete-heading-text-color, var(--calcite-color-text-1))}.heading,.description{line-height:var(--calcite-font-line-height-relative-snug)}:host(:hover:not([disabled])) .container{background-color:var(--calcite-autocomplete-background-color, var(--calcite-color-foreground-2))}:host(:hover:not([disabled])) .container .description{color:var(--calcite-autocomplete-description-text-color, var(--calcite-color-text-2))}.container--active{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.content-center{display:flex;flex-direction:column;flex-grow:1;padding-block:0}.text-match{background-color:transparent;color:inherit;font-weight:var(--calcite-font-weight-bold)}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`,r=class extends u{constructor(){super(...arguments),this.interactiveContainer=g(this),this.active=!1,this.disabled=!1,this.guid=y.host(v()),this.scale="m",this.calciteAutocompleteItemSelect=m({cancelable:!1})}static{this.properties={active:[5,{},{type:Boolean}],description:1,disabled:[7,{},{reflect:!0,type:Boolean}],guid:1,heading:1,iconEnd:[3,{type:String},{reflect:!0}],iconFlipRtl:[3,{},{reflect:!0}],iconStart:[3,{type:String},{reflect:!0}],inputValueMatchPattern:[3,{},{reflect:!0}],label:1,scale:1,value:1}}static{this.styles=S}emitSelectEvent(){this.calciteAutocompleteItemSelect.emit()}handleClick(e){e.preventDefault(),this.emitSelectEvent()}render(){let{active:e,description:a,heading:n,disabled:s,inputValueMatchPattern:d}=this;return this.interactiveContainer({disabled:s,children:o`<div class=${i({[t.container]:!0,[t.containerActive]:e&&!s,[t.scale(this.scale)]:!0})} @click=${this.handleClick}>${this.renderIcon("start")}<slot name=${b.contentStart}></slot><div class=${i(t.contentCenter)}><div class=${i(t.heading)}>${l({text:n,pattern:d})}</div><div class=${i(t.description)}>${l({text:a,pattern:d})}</div></div><slot name=${b.contentEnd}></slot>${this.renderIcon("end")}</div>`})}renderIcon(e){let{iconFlipRtl:a}=this,n=e==="start"?this.iconStart:this.iconEnd;return n?o`<calcite-icon class=${i(e==="start"?t.iconStart:t.iconEnd)} .flipRtl=${a===e||a==="both"} .icon=${n} .scale=${f(this.scale)}></calcite-icon>`:null}};h("calcite-autocomplete-item",r);export{r as AutocompleteItem};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as X}from"./IALP5CDY.js";import{a as _}from"./7O4KYDQA.js";import{a as T}from"./HH5T3FXJ.js";import{c as g,d as U,e as S,f as I,g as N,h as q,i as v}from"./LUYHYXD3.js";import{a as R}from"./4YGBY7AH.js";import{a as $}from"./VPW4TMKN.js";import"./WTUDT6B3.js";import{a as c}from"./Z4ETK22W.js";import"./H7SAPASI.js";import{a as O}from"./MCCZITQC.js";import{a as C}from"./JXV4E5JI.js";import{a as z}from"./MAGCHPNI.js";import{a as H}from"./JGXR5K5I.js";import"./XIKCSTRR.js";import"./SBTAFILO.js";import"./S7I3XRAV.js";import{j as L,q as A,w as B,x as F}from"./JEKNLQYF.js";import{a as D}from"./HXY3H2PS.js";import{C as E,D as m,E as k,F as s,I as x,Q as P,g as w,h as l,p as n}from"./L4ZDCUZR.js";var G=5;function J({startX:d,startY:e,endX:t,endY:i}){return Math.hypot(t-d,i-e)>G}var b=class{constructor(){this.registeredElements=new Map,this.registeredElementCount=0,this.queryPopover=e=>{let{registeredElements:t}=this,i=e.find(o=>t.has(o));return t.get(i)},this.togglePopovers=e=>{let t=e.composedPath(),i=this.queryPopover(t);i&&!i.triggerDisabled&&(i.open=!i.open),Array.from(this.registeredElements.values()).filter(o=>o!==i&&o.autoClose&&o.open&&!t.includes(o)).forEach(o=>o.open=!1)},this.keyDownHandler=e=>{e.defaultPrevented||(e.key==="Escape"?this.closeAllPopovers():O(e.key)&&this.togglePopovers(e))},this.pointerDownHandler=e=>{if(e.defaultPrevented||!B(e))return;let{clientX:t,clientY:i}=e;this.pointerDownPosition={x:t,y:i}},this.clickHandler=e=>{F(e)||e.defaultPrevented||this.pointerDownPosition&&J({endY:e.clientY,endX:e.clientX,startY:this.pointerDownPosition.y,startX:this.pointerDownPosition.x})||(this.pointerDownPosition=void 0,this.togglePopovers(e))}}registerElement(e,t){this.registeredElementCount++,this.registeredElements.set(e,t),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}closeAllPopovers(){Array.from(this.registeredElements.values()).forEach(e=>e.open=!1)}addListeners(){window.addEventListener("pointerdown",this.pointerDownHandler),window.addEventListener("click",this.clickHandler),window.addEventListener("keydown",this.keyDownHandler)}removeListeners(){window.removeEventListener("pointerdown",this.pointerDownHandler),window.removeEventListener("click",this.clickHandler),window.removeEventListener("keydown",this.keyDownHandler)}},r={positionContainer:"position-container",container:"container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContainer:"header-container",heading:"heading"},Y="auto",K="aria-controls",M="aria-expanded",Q=w`:host{display:contents}:host([top-layer-disabled]){--calcite-floating-ui-z-index: var(--calcite-z-index-popup)}.position-container{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0;z-index:var(--calcite-floating-ui-z-index)}@starting-style{.position-container{opacity:0;inset-block-start:0;left:0}}.position-container{max-inline-size:var(--calcite-popover-max-size-x, 100vw)}.position-container[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.position-container:popover-open{display:block}.position-container .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}.position-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.position-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.position-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}.position-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.position-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.position-container[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}:host([scale=s]) .heading{padding:.5rem .75rem;font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-relative-snug)}:host(:is([scale=s],[scale=m])){--calcite-internal-popover-close-spacing: var(--calcite-spacing-xs)}:host([scale=m]) .heading{padding:.75rem 1rem;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-relative-snug)}:host([scale=l]){--calcite-internal-popover-close-spacing: var(--calcite-spacing-sm)}:host([scale=l]) .heading{padding:1rem 1.25rem;font-size:var(--calcite-font-size-relative-lg);line-height:var(--calcite-font-line-height-relative-snug)}.position-container .calcite-floating-ui-anim{border-width:1px;border-style:solid;background-color:var(--calcite-popover-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-popover-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round))}.calcite-floating-ui-arrow{fill:var(--calcite-popover-background-color, var(--calcite-color-foreground-1))}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-bottom-width:1px;border-style:solid;border-block-end-color:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.heading{margin:0;display:block;flex:1 1 auto;align-self:center;white-space:normal;font-weight:var(--calcite-font-weight-medium);word-wrap:break-word;word-break:break-word;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.header-container{position:relative;display:flex;height:100%;flex-direction:row;flex-wrap:nowrap;border-radius:.25rem;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.header-container.has-header{flex-direction:column}.content{display:flex;height:100%;width:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button{margin:auto;margin-inline-end:var(--calcite-internal-popover-close-spacing)}.close-button-container{display:flex;flex:0 0 auto}::slotted(calcite-panel),::slotted(calcite-flow){height:100%}:host([hidden]){display:none}[hidden]{display:none}`,j=new b,y=class extends k{constructor(){super(...arguments),this.focusTrap=_({triggerProp:"open",focusTrapOptions:{allowOutsideClick:!0,escapeDeactivates:e=>(e.defaultPrevented||(this.open=!1,e.preventDefault()),!1)}})(this),this.guid=`calcite-popover-${D()}`,this.hasLoaded=!1,this.mutationObserver=C("mutation",()=>this.focusTrap.updateContainerElements()),this.transitionProp="opacity",this.transitionRef=E(),this.messages=z(),this.focusSetter=H()(this),this.topLayer=T({disabledOverride:()=>this.open&&!this.referenceEl,target:()=>this.floatingEl})(this),this.floatingLayout="vertical",this.autoClose=!1,this.closable=!1,this.flipDisabled=!1,this.focusTrapDisabled=!1,this.offsetDistance=v,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=Y,this.pointerDisabled=!1,this.scale="m",this.topLayerDisabled=!1,this.triggerDisabled=!1,this.calcitePopoverBeforeClose=n({cancelable:!1}),this.calcitePopoverBeforeOpen=n({cancelable:!1}),this.calcitePopoverClose=n({cancelable:!1}),this.calcitePopoverOpen=n({cancelable:!1})}static{this.properties={floatingLayout:[16,{},{state:!0}],referenceEl:[16,{},{state:!0}],autoClose:[7,{},{reflect:!0,type:Boolean}],closable:[7,{},{reflect:!0,type:Boolean}],flipDisabled:[7,{},{reflect:!0,type:Boolean}],flipPlacements:[0,{},{attribute:!1}],focusTrapDisabled:[7,{},{reflect:!0,type:Boolean}],focusTrapOptions:[0,{},{attribute:!1}],heading:1,headingLevel:[11,{},{type:Number,reflect:!0}],label:1,messageOverrides:[0,{},{attribute:!1}],offsetDistance:[11,{},{type:Number,reflect:!0}],offsetSkidding:[11,{},{reflect:!0,type:Number}],open:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],placement:[3,{},{reflect:!0}],pointerDisabled:[7,{},{reflect:!0,type:Boolean}],referenceElement:1,scale:[3,{},{reflect:!0}],topLayerDisabled:[7,{},{reflect:!0,type:Boolean}],triggerDisabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=Q}async reposition(e=!1){let{referenceEl:t,placement:i,overlayPositioning:o,flipDisabled:p,filteredFlipPlacements:h,offsetDistance:a,offsetSkidding:f,arrowEl:u,floatingEl:V}=this;return S(this,{floatingEl:V,referenceEl:t,overlayPositioning:o,placement:i,flipDisabled:p,flipPlacements:h,offsetDistance:a,offsetSkidding:f,arrowEl:u,type:"popover"},e)}async setFocus(e){return this.focusSetter(()=>this.el,e)}async updateFocusTrapElements(){this.focusTrap.updateContainerElements()}connectedCallback(){super.connectedCallback(),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),requestAnimationFrame(()=>this.setUpReferenceElement(this.hasLoaded))}willUpdate(e){e.has("flipPlacements")&&this.flipPlacementsHandler(),e.has("open")&&(this.hasUpdated||this.open!==!1)&&this.openHandler(),(e.has("offsetDistance")&&(this.hasUpdated||this.offsetDistance!==v)||e.has("offsetSkidding")&&(this.hasUpdated||this.offsetSkidding!==0)||e.has("overlayPositioning")&&(this.hasUpdated||this.overlayPositioning!=="absolute")||e.has("placement")&&(this.hasUpdated||this.placement!==Y))&&this.reposition(!0),e.has("referenceElement")&&(this.referenceElementHandler(),!this.referenceElement&&this.open&&this.topLayer.hide())}loaded(){this.referenceElement&&!this.referenceEl&&this.setUpReferenceElement(),this.hasLoaded=!0}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.removeReferences(),q(this)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}openHandler(){R(this),this.reposition(!0),this.setExpandedAttr()}referenceElementHandler(){this.setUpReferenceElement(),this.reposition(!0)}setFloatingEl(e){this.floatingEl=e,e&&requestAnimationFrame(()=>this.setUpReferenceElement())}setFilteredPlacements(){let{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?U(t,e):null}setUpReferenceElement(e=!0){this.removeReferences(),this.referenceEl=this.getReferenceElement(),N(this);let{el:t,referenceElement:i,referenceEl:o}=this;e&&i&&!o&&console.warn(`${t.tagName}: reference-element id "${i}" was not found.`,{el:t}),this.addReferences()}getId(){return this.el.id||this.guid}setExpandedAttr(){let{referenceEl:e,open:t}=this;e&&"setAttribute"in e&&e.setAttribute(M,A(t))}addReferences(){let{referenceEl:e}=this;if(!e)return;let t=this.getId();"setAttribute"in e&&e.setAttribute(K,t),j.registerElement(e,this.el),this.setExpandedAttr()}removeReferences(){let{referenceEl:e}=this;e&&("removeAttribute"in e&&(e.removeAttribute(K),e.removeAttribute(M)),j.unregisterElement(e))}getReferenceElement(){let{referenceElement:e,el:t}=this;return(typeof e=="string"?L(t,{id:e}):e)||null}hide(){this.open=!1}onBeforeOpen(){this.calcitePopoverBeforeOpen.emit(),this.topLayer.show()}onOpen(){this.calcitePopoverOpen.emit(),this.focusTrap.activate()}onBeforeClose(){this.calcitePopoverBeforeClose.emit()}onClose(){this.calcitePopoverClose.emit(),I(this),this.focusTrap.deactivate(),this.topLayer.hide()}setArrowEl(e){this.arrowEl=e,this.reposition(!0)}renderCloseButton(){let{messages:e,closable:t}=this;return t?c(r.closeButtonContainer,l`<div class=${s(r.closeButtonContainer)}><calcite-action class=${s(r.closeButton)} icon=x @click=${this.hide} .scale=${this.scale} .text=${e.close}></calcite-action></div>`):null}renderHeader(){let{heading:e,headingLevel:t}=this,i=e?$({class:r.heading,level:t,children:e}):null;return i?c(r.header,l`<div class=${s(r.header)}>${i}${this.renderCloseButton()}</div>`):null}render(){let{referenceEl:e,heading:t,label:i,open:o,pointerDisabled:p,floatingLayout:h}=this,a=e&&o,f=!a,u=p?null:c("floating-arrow",X({floatingLayout:h,ref:this.setArrowEl}));return this.el.inert=f,this.el.ariaLabel=i,this.el.ariaLive="polite",x(this.el,"id",this.getId()),this.el.role="dialog",l`<div class=${s(r.positionContainer)} popover=manual ${m(this.setFloatingEl)}><div class=${s({[r.container]:!0,[g.animation]:!0,[g.animationActive]:a})} ${m(this.transitionRef)}>${u}<div class=${s({[r.hasHeader]:!!t,[r.headerContainer]:!0})}>${this.renderHeader()}<div class=${s(r.content)}><slot></slot></div>${t?null:this.renderCloseButton()}</div></div></div>`}};P("calcite-popover",y);export{y as Popover};
|
|
3
|
+
v5.0.0-next.89 */
|
|
4
|
+
import{a as X}from"./O3BWHAFC.js";import{a as _}from"./CEFDXM74.js";import{a as T}from"./QJONTQZC.js";import{c as g,d as U,e as S,f as I,g as N,h as q,i as v}from"./3QIIUFLB.js";import{a as R}from"./IKLHRFXD.js";import{a as $}from"./VFWQN5V7.js";import"./QOSSSJA2.js";import{a as c}from"./64IGPE2N.js";import"./GGEFOMIC.js";import{a as O}from"./X6UFBNJP.js";import{a as C}from"./NFVAS5ZC.js";import{a as z}from"./YSTQVB4Y.js";import{a as H}from"./AFHUIPDJ.js";import"./56RQHSBE.js";import"./R3GQZCQ5.js";import"./3AZH5LXB.js";import{j as L,q as A,w as B,x as F}from"./2ONQDURU.js";import{a as D}from"./BRWGEU6Y.js";import{C as E,D as m,E as k,F as s,I as x,Q as P,g as w,h as l,p as n}from"./MLP57F7O.js";var G=5;function J({startX:d,startY:e,endX:t,endY:i}){return Math.hypot(t-d,i-e)>G}var b=class{constructor(){this.registeredElements=new Map,this.registeredElementCount=0,this.queryPopover=e=>{let{registeredElements:t}=this,i=e.find(o=>t.has(o));return t.get(i)},this.togglePopovers=e=>{let t=e.composedPath(),i=this.queryPopover(t);i&&!i.triggerDisabled&&(i.open=!i.open),Array.from(this.registeredElements.values()).filter(o=>o!==i&&o.autoClose&&o.open&&!t.includes(o)).forEach(o=>o.open=!1)},this.keyDownHandler=e=>{e.defaultPrevented||(e.key==="Escape"?this.closeAllPopovers():O(e.key)&&this.togglePopovers(e))},this.pointerDownHandler=e=>{if(e.defaultPrevented||!B(e))return;let{clientX:t,clientY:i}=e;this.pointerDownPosition={x:t,y:i}},this.clickHandler=e=>{F(e)||e.defaultPrevented||this.pointerDownPosition&&J({endY:e.clientY,endX:e.clientX,startY:this.pointerDownPosition.y,startX:this.pointerDownPosition.x})||(this.pointerDownPosition=void 0,this.togglePopovers(e))}}registerElement(e,t){this.registeredElementCount++,this.registeredElements.set(e,t),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}closeAllPopovers(){Array.from(this.registeredElements.values()).forEach(e=>e.open=!1)}addListeners(){window.addEventListener("pointerdown",this.pointerDownHandler),window.addEventListener("click",this.clickHandler),window.addEventListener("keydown",this.keyDownHandler)}removeListeners(){window.removeEventListener("pointerdown",this.pointerDownHandler),window.removeEventListener("click",this.clickHandler),window.removeEventListener("keydown",this.keyDownHandler)}},r={positionContainer:"position-container",container:"container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContainer:"header-container",heading:"heading"},Y="auto",K="aria-controls",M="aria-expanded",Q=w`:host{display:contents}:host([top-layer-disabled]){--calcite-floating-ui-z-index: var(--calcite-z-index-popup)}.position-container{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0;z-index:var(--calcite-floating-ui-z-index)}@starting-style{.position-container{opacity:0;inset-block-start:0;left:0}}.position-container{max-inline-size:var(--calcite-popover-max-size-x, 100vw)}.position-container[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.position-container:popover-open{display:block}.position-container .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}.position-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.position-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.position-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}.position-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.position-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.position-container[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}:host([scale=s]) .heading{padding:.5rem .75rem;font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-relative-snug)}:host(:is([scale=s],[scale=m])){--calcite-internal-popover-close-spacing: var(--calcite-spacing-xs)}:host([scale=m]) .heading{padding:.75rem 1rem;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-relative-snug)}:host([scale=l]){--calcite-internal-popover-close-spacing: var(--calcite-spacing-sm)}:host([scale=l]) .heading{padding:1rem 1.25rem;font-size:var(--calcite-font-size-relative-lg);line-height:var(--calcite-font-line-height-relative-snug)}.position-container .calcite-floating-ui-anim{border-width:1px;border-style:solid;background-color:var(--calcite-popover-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-popover-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round))}.calcite-floating-ui-arrow{fill:var(--calcite-popover-background-color, var(--calcite-color-foreground-1))}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-bottom-width:1px;border-style:solid;border-block-end-color:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.heading{margin:0;display:block;flex:1 1 auto;align-self:center;white-space:normal;font-weight:var(--calcite-font-weight-medium);word-wrap:break-word;word-break:break-word;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.header-container{position:relative;display:flex;height:100%;flex-direction:row;flex-wrap:nowrap;border-radius:.25rem;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.header-container.has-header{flex-direction:column}.content{display:flex;height:100%;width:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button{margin:auto;margin-inline-end:var(--calcite-internal-popover-close-spacing)}.close-button-container{display:flex;flex:0 0 auto}::slotted(calcite-panel),::slotted(calcite-flow){height:100%}:host([hidden]){display:none}[hidden]{display:none}`,j=new b,y=class extends k{constructor(){super(...arguments),this.focusTrap=_({triggerProp:"open",focusTrapOptions:{allowOutsideClick:!0,escapeDeactivates:e=>(e.defaultPrevented||(this.open=!1,e.preventDefault()),!1)}})(this),this.guid=`calcite-popover-${D()}`,this.hasLoaded=!1,this.mutationObserver=C("mutation",()=>this.focusTrap.updateContainerElements()),this.transitionProp="opacity",this.transitionRef=E(),this.messages=z(),this.focusSetter=H()(this),this.topLayer=T({disabledOverride:()=>this.open&&!this.referenceEl,target:()=>this.floatingEl})(this),this.floatingLayout="vertical",this.autoClose=!1,this.closable=!1,this.flipDisabled=!1,this.focusTrapDisabled=!1,this.offsetDistance=v,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=Y,this.pointerDisabled=!1,this.scale="m",this.topLayerDisabled=!1,this.triggerDisabled=!1,this.calcitePopoverBeforeClose=n({cancelable:!1}),this.calcitePopoverBeforeOpen=n({cancelable:!1}),this.calcitePopoverClose=n({cancelable:!1}),this.calcitePopoverOpen=n({cancelable:!1})}static{this.properties={floatingLayout:[16,{},{state:!0}],referenceEl:[16,{},{state:!0}],autoClose:[7,{},{reflect:!0,type:Boolean}],closable:[7,{},{reflect:!0,type:Boolean}],flipDisabled:[7,{},{reflect:!0,type:Boolean}],flipPlacements:[0,{},{attribute:!1}],focusTrapDisabled:[7,{},{reflect:!0,type:Boolean}],focusTrapOptions:[0,{},{attribute:!1}],heading:1,headingLevel:[11,{},{type:Number,reflect:!0}],label:1,messageOverrides:[0,{},{attribute:!1}],offsetDistance:[11,{},{type:Number,reflect:!0}],offsetSkidding:[11,{},{reflect:!0,type:Number}],open:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],placement:[3,{},{reflect:!0}],pointerDisabled:[7,{},{reflect:!0,type:Boolean}],referenceElement:1,scale:[3,{},{reflect:!0}],topLayerDisabled:[7,{},{reflect:!0,type:Boolean}],triggerDisabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=Q}async reposition(e=!1){let{referenceEl:t,placement:i,overlayPositioning:o,flipDisabled:p,filteredFlipPlacements:h,offsetDistance:a,offsetSkidding:f,arrowEl:u,floatingEl:V}=this;return S(this,{floatingEl:V,referenceEl:t,overlayPositioning:o,placement:i,flipDisabled:p,flipPlacements:h,offsetDistance:a,offsetSkidding:f,arrowEl:u,type:"popover"},e)}async setFocus(e){return this.focusSetter(()=>this.el,e)}async updateFocusTrapElements(){this.focusTrap.updateContainerElements()}connectedCallback(){super.connectedCallback(),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),requestAnimationFrame(()=>this.setUpReferenceElement(this.hasLoaded))}willUpdate(e){e.has("flipPlacements")&&this.flipPlacementsHandler(),e.has("open")&&(this.hasUpdated||this.open!==!1)&&this.openHandler(),(e.has("offsetDistance")&&(this.hasUpdated||this.offsetDistance!==v)||e.has("offsetSkidding")&&(this.hasUpdated||this.offsetSkidding!==0)||e.has("overlayPositioning")&&(this.hasUpdated||this.overlayPositioning!=="absolute")||e.has("placement")&&(this.hasUpdated||this.placement!==Y))&&this.reposition(!0),e.has("referenceElement")&&(this.referenceElementHandler(),!this.referenceElement&&this.open&&this.topLayer.hide())}loaded(){this.referenceElement&&!this.referenceEl&&this.setUpReferenceElement(),this.hasLoaded=!0}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.removeReferences(),q(this)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}openHandler(){R(this),this.reposition(!0),this.setExpandedAttr()}referenceElementHandler(){this.setUpReferenceElement(),this.reposition(!0)}setFloatingEl(e){this.floatingEl=e,e&&requestAnimationFrame(()=>this.setUpReferenceElement())}setFilteredPlacements(){let{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?U(t,e):null}setUpReferenceElement(e=!0){this.removeReferences(),this.referenceEl=this.getReferenceElement(),N(this);let{el:t,referenceElement:i,referenceEl:o}=this;e&&i&&!o&&console.warn(`${t.tagName}: reference-element id "${i}" was not found.`,{el:t}),this.addReferences()}getId(){return this.el.id||this.guid}setExpandedAttr(){let{referenceEl:e,open:t}=this;e&&"setAttribute"in e&&e.setAttribute(M,A(t))}addReferences(){let{referenceEl:e}=this;if(!e)return;let t=this.getId();"setAttribute"in e&&e.setAttribute(K,t),j.registerElement(e,this.el),this.setExpandedAttr()}removeReferences(){let{referenceEl:e}=this;e&&("removeAttribute"in e&&(e.removeAttribute(K),e.removeAttribute(M)),j.unregisterElement(e))}getReferenceElement(){let{referenceElement:e,el:t}=this;return(typeof e=="string"?L(t,{id:e}):e)||null}hide(){this.open=!1}onBeforeOpen(){this.calcitePopoverBeforeOpen.emit(),this.topLayer.show()}onOpen(){this.calcitePopoverOpen.emit(),this.focusTrap.activate()}onBeforeClose(){this.calcitePopoverBeforeClose.emit()}onClose(){this.calcitePopoverClose.emit(),I(this),this.focusTrap.deactivate(),this.topLayer.hide()}setArrowEl(e){this.arrowEl=e,this.reposition(!0)}renderCloseButton(){let{messages:e,closable:t}=this;return t?c(r.closeButtonContainer,l`<div class=${s(r.closeButtonContainer)}><calcite-action class=${s(r.closeButton)} icon=x @click=${this.hide} .scale=${this.scale} .text=${e.close}></calcite-action></div>`):null}renderHeader(){let{heading:e,headingLevel:t}=this,i=e?$({class:r.heading,level:t,children:e}):null;return i?c(r.header,l`<div class=${s(r.header)}>${i}${this.renderCloseButton()}</div>`):null}render(){let{referenceEl:e,heading:t,label:i,open:o,pointerDisabled:p,floatingLayout:h}=this,a=e&&o,f=!a,u=p?null:c("floating-arrow",X({floatingLayout:h,ref:this.setArrowEl}));return this.el.inert=f,this.el.ariaLabel=i,this.el.ariaLive="polite",x(this.el,"id",this.getId()),this.el.role="dialog",l`<div class=${s(r.positionContainer)} popover=manual ${m(this.setFloatingEl)}><div class=${s({[r.container]:!0,[g.animation]:!0,[g.animationActive]:a})} ${m(this.transitionRef)}>${u}<div class=${s({[r.hasHeader]:!!t,[r.headerContainer]:!0})}>${this.renderHeader()}<div class=${s(r.content)}><slot></slot></div>${t?null:this.renderCloseButton()}</div></div></div>`}};P("calcite-popover",y);export{y as Popover};
|