@tylertech/forge 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -13
- package/dist/esm/accordion/index.js +39 -0
- package/dist/esm/accordion/index.js.map +7 -0
- package/dist/esm/app-bar/help-button/index.js +58 -0
- package/dist/esm/app-bar/help-button/index.js.map +7 -0
- package/dist/esm/app-bar/index.js +136 -0
- package/dist/esm/app-bar/index.js.map +7 -0
- package/dist/esm/app-bar/menu-button/index.js +41 -0
- package/dist/esm/app-bar/menu-button/index.js.map +7 -0
- package/dist/esm/app-bar/notification-button/index.js +46 -0
- package/dist/esm/app-bar/notification-button/index.js.map +7 -0
- package/dist/esm/app-bar/profile-button/index.js +51 -0
- package/dist/esm/app-bar/profile-button/index.js.map +7 -0
- package/dist/esm/app-bar/search/index.js +43 -0
- package/dist/esm/app-bar/search/index.js.map +7 -0
- package/dist/esm/autocomplete/index.js +77 -0
- package/dist/esm/autocomplete/index.js.map +7 -0
- package/dist/esm/avatar/index.js +33 -0
- package/dist/esm/avatar/index.js.map +7 -0
- package/dist/esm/backdrop/index.js +28 -0
- package/dist/esm/backdrop/index.js.map +7 -0
- package/dist/esm/badge/index.js +31 -0
- package/dist/esm/badge/index.js.map +7 -0
- package/dist/esm/banner/index.js +45 -0
- package/dist/esm/banner/index.js.map +7 -0
- package/dist/esm/bottom-sheet/index.js +45 -0
- package/dist/esm/bottom-sheet/index.js.map +7 -0
- package/dist/esm/busy-indicator/index.js +37 -0
- package/dist/esm/busy-indicator/index.js.map +7 -0
- package/dist/esm/button/index.js +29 -0
- package/dist/esm/button/index.js.map +7 -0
- package/dist/esm/button-toggle/button-toggle/index.js +33 -0
- package/dist/esm/button-toggle/button-toggle/index.js.map +7 -0
- package/dist/esm/button-toggle/button-toggle-group/index.js +32 -0
- package/dist/esm/button-toggle/button-toggle-group/index.js.map +7 -0
- package/dist/esm/button-toggle/index.js +46 -0
- package/dist/esm/button-toggle/index.js.map +7 -0
- package/dist/esm/calendar/calendar-dropdown/index.js +35 -0
- package/dist/esm/calendar/calendar-dropdown/index.js.map +7 -0
- package/dist/esm/calendar/calendar-menu/index.js +48 -0
- package/dist/esm/calendar/calendar-menu/index.js.map +7 -0
- package/dist/esm/calendar/core/index.js +13 -0
- package/dist/esm/calendar/core/index.js.map +7 -0
- package/dist/esm/calendar/index.js +199 -0
- package/dist/esm/calendar/index.js.map +7 -0
- package/dist/esm/card/index.js +22 -0
- package/dist/esm/card/index.js.map +7 -0
- package/dist/esm/checkbox/index.js +44 -0
- package/dist/esm/checkbox/index.js.map +7 -0
- package/dist/esm/chip-field/index.js +51 -0
- package/dist/esm/chip-field/index.js.map +7 -0
- package/dist/esm/chips/chip/index.js +42 -0
- package/dist/esm/chips/chip/index.js.map +7 -0
- package/dist/esm/chips/chip-set/index.js +42 -0
- package/dist/esm/chips/chip-set/index.js.map +7 -0
- package/dist/esm/chips/index.js +55 -0
- package/dist/esm/chips/index.js.map +7 -0
- package/dist/esm/chunks/chunk.2F6PST3N.js +476 -0
- package/dist/esm/chunks/chunk.2F6PST3N.js.map +7 -0
- package/dist/esm/chunks/chunk.2FXYTBYG.js +1450 -0
- package/dist/esm/chunks/chunk.2FXYTBYG.js.map +7 -0
- package/dist/esm/chunks/chunk.2LQMHAC7.js +187 -0
- package/dist/esm/chunks/chunk.2LQMHAC7.js.map +7 -0
- package/dist/esm/chunks/chunk.2LSEVYAC.js +342 -0
- package/dist/esm/chunks/chunk.2LSEVYAC.js.map +7 -0
- package/dist/esm/chunks/chunk.2NUAEZY7.js +221 -0
- package/dist/esm/chunks/chunk.2NUAEZY7.js.map +7 -0
- package/dist/esm/chunks/chunk.35U3UPDV.js +70 -0
- package/dist/esm/chunks/chunk.35U3UPDV.js.map +7 -0
- package/dist/esm/chunks/chunk.3KCCCXWS.js +344 -0
- package/dist/esm/chunks/chunk.3KCCCXWS.js.map +7 -0
- package/dist/esm/chunks/chunk.3NOZRZ7R.js +145 -0
- package/dist/esm/chunks/chunk.3NOZRZ7R.js.map +7 -0
- package/dist/esm/chunks/chunk.3ZKORL4I.js +212 -0
- package/dist/esm/chunks/chunk.3ZKORL4I.js.map +7 -0
- package/dist/esm/chunks/chunk.4BG22DGY.js +317 -0
- package/dist/esm/chunks/chunk.4BG22DGY.js.map +7 -0
- package/dist/esm/chunks/chunk.4HQ5VELO.js +793 -0
- package/dist/esm/chunks/chunk.4HQ5VELO.js.map +7 -0
- package/dist/esm/chunks/chunk.4JURZYE4.js +410 -0
- package/dist/esm/chunks/chunk.4JURZYE4.js.map +7 -0
- package/dist/esm/chunks/chunk.4UKSUUTX.js +296 -0
- package/dist/esm/chunks/chunk.4UKSUUTX.js.map +7 -0
- package/dist/esm/chunks/chunk.4V5O2CPU.js +417 -0
- package/dist/esm/chunks/chunk.4V5O2CPU.js.map +7 -0
- package/dist/esm/chunks/chunk.52F6VUCF.js +273 -0
- package/dist/esm/chunks/chunk.52F6VUCF.js.map +7 -0
- package/dist/esm/chunks/chunk.5EEEKOOK.js +552 -0
- package/dist/esm/chunks/chunk.5EEEKOOK.js.map +7 -0
- package/dist/esm/chunks/chunk.5NXVVSTU.js +243 -0
- package/dist/esm/chunks/chunk.5NXVVSTU.js.map +7 -0
- package/dist/esm/chunks/chunk.5VKAVHLM.js +610 -0
- package/dist/esm/chunks/chunk.5VKAVHLM.js.map +7 -0
- package/dist/esm/chunks/chunk.6KTLOA7V.js +6 -0
- package/dist/esm/chunks/chunk.6KTLOA7V.js.map +7 -0
- package/dist/esm/chunks/chunk.6V463G4I.js +105 -0
- package/dist/esm/chunks/chunk.6V463G4I.js.map +7 -0
- package/dist/esm/chunks/chunk.7FC5CPLE.js +603 -0
- package/dist/esm/chunks/chunk.7FC5CPLE.js.map +7 -0
- package/dist/esm/chunks/chunk.7G2S3DCM.js +458 -0
- package/dist/esm/chunks/chunk.7G2S3DCM.js.map +7 -0
- package/dist/esm/chunks/chunk.7I2XNJBL.js +593 -0
- package/dist/esm/chunks/chunk.7I2XNJBL.js.map +7 -0
- package/dist/esm/chunks/chunk.7KILTPJ6.js +72 -0
- package/dist/esm/chunks/chunk.7KILTPJ6.js.map +7 -0
- package/dist/esm/chunks/chunk.7XGNGXLR.js +648 -0
- package/dist/esm/chunks/chunk.7XGNGXLR.js.map +7 -0
- package/dist/esm/chunks/chunk.7Y4NHCJH.js +338 -0
- package/dist/esm/chunks/chunk.7Y4NHCJH.js.map +7 -0
- package/dist/esm/chunks/chunk.AHQ6QX3J.js +716 -0
- package/dist/esm/chunks/chunk.AHQ6QX3J.js.map +7 -0
- package/dist/esm/chunks/chunk.AYOZGYGO.js +21 -0
- package/dist/esm/chunks/chunk.AYOZGYGO.js.map +7 -0
- package/dist/esm/chunks/chunk.BKMWXPAS.js +439 -0
- package/dist/esm/chunks/chunk.BKMWXPAS.js.map +7 -0
- package/dist/esm/chunks/chunk.BOWCSPCH.js +2428 -0
- package/dist/esm/chunks/chunk.BOWCSPCH.js.map +7 -0
- package/dist/esm/chunks/chunk.BYN27JXZ.js +51 -0
- package/dist/esm/chunks/chunk.BYN27JXZ.js.map +7 -0
- package/dist/esm/chunks/chunk.BZPQIDQP.js +602 -0
- package/dist/esm/chunks/chunk.BZPQIDQP.js.map +7 -0
- package/dist/esm/chunks/chunk.C2MR3RDF.js +202 -0
- package/dist/esm/chunks/chunk.C2MR3RDF.js.map +7 -0
- package/dist/esm/chunks/chunk.C64YUJHS.js +55 -0
- package/dist/esm/chunks/chunk.C64YUJHS.js.map +7 -0
- package/dist/esm/chunks/chunk.CGHKW6S6.js +683 -0
- package/dist/esm/chunks/chunk.CGHKW6S6.js.map +7 -0
- package/dist/esm/chunks/chunk.CKS5A4YN.js +6 -0
- package/dist/esm/chunks/chunk.CKS5A4YN.js.map +7 -0
- package/dist/esm/chunks/chunk.COF6DD6T.js +293 -0
- package/dist/esm/chunks/chunk.COF6DD6T.js.map +7 -0
- package/dist/esm/chunks/chunk.D4XU5MZN.js +1203 -0
- package/dist/esm/chunks/chunk.D4XU5MZN.js.map +7 -0
- package/dist/esm/chunks/chunk.D5DMZ7ZG.js +350 -0
- package/dist/esm/chunks/chunk.D5DMZ7ZG.js.map +7 -0
- package/dist/esm/chunks/chunk.DB7ZQBES.js +244 -0
- package/dist/esm/chunks/chunk.DB7ZQBES.js.map +7 -0
- package/dist/esm/chunks/chunk.E4NCI7MS.js +6 -0
- package/dist/esm/chunks/chunk.E4NCI7MS.js.map +7 -0
- package/dist/esm/chunks/chunk.EA7XMXI5.js +200 -0
- package/dist/esm/chunks/chunk.EA7XMXI5.js.map +7 -0
- package/dist/esm/chunks/chunk.EARNUKJ2.js +401 -0
- package/dist/esm/chunks/chunk.EARNUKJ2.js.map +7 -0
- package/dist/esm/chunks/chunk.EKIW7VYG.js +419 -0
- package/dist/esm/chunks/chunk.EKIW7VYG.js.map +7 -0
- package/dist/esm/chunks/chunk.EL6B2ODN.js +52 -0
- package/dist/esm/chunks/chunk.EL6B2ODN.js.map +7 -0
- package/dist/esm/chunks/chunk.ETP6HSXO.js +513 -0
- package/dist/esm/chunks/chunk.ETP6HSXO.js.map +7 -0
- package/dist/esm/chunks/chunk.ETQIBLKP.js +978 -0
- package/dist/esm/chunks/chunk.ETQIBLKP.js.map +7 -0
- package/dist/esm/chunks/chunk.EWQENJ4W.js +505 -0
- package/dist/esm/chunks/chunk.EWQENJ4W.js.map +7 -0
- package/dist/esm/chunks/chunk.EY57VTRF.js +33 -0
- package/dist/esm/chunks/chunk.EY57VTRF.js.map +7 -0
- package/dist/esm/chunks/chunk.FBUQQD2T.js +732 -0
- package/dist/esm/chunks/chunk.FBUQQD2T.js.map +7 -0
- package/dist/esm/chunks/chunk.FMMPWQKC.js +439 -0
- package/dist/esm/chunks/chunk.FMMPWQKC.js.map +7 -0
- package/dist/esm/chunks/chunk.FWJ7SIFA.js +433 -0
- package/dist/esm/chunks/chunk.FWJ7SIFA.js.map +7 -0
- package/dist/esm/chunks/chunk.FZQCBRPK.js +6 -0
- package/dist/esm/chunks/chunk.FZQCBRPK.js.map +7 -0
- package/dist/esm/chunks/chunk.G6FY472A.js +658 -0
- package/dist/esm/chunks/chunk.G6FY472A.js.map +7 -0
- package/dist/esm/chunks/chunk.GS2AXUCN.js +150 -0
- package/dist/esm/chunks/chunk.GS2AXUCN.js.map +7 -0
- package/dist/esm/chunks/chunk.HHHMDDTU.js +297 -0
- package/dist/esm/chunks/chunk.HHHMDDTU.js.map +7 -0
- package/dist/esm/chunks/chunk.HZISALRH.js +20 -0
- package/dist/esm/chunks/chunk.HZISALRH.js.map +7 -0
- package/dist/esm/chunks/chunk.IBH5GL7A.js +258 -0
- package/dist/esm/chunks/chunk.IBH5GL7A.js.map +7 -0
- package/dist/esm/chunks/chunk.IWXT6VVJ.js +222 -0
- package/dist/esm/chunks/chunk.IWXT6VVJ.js.map +7 -0
- package/dist/esm/chunks/chunk.J6LOWXOG.js +654 -0
- package/dist/esm/chunks/chunk.J6LOWXOG.js.map +7 -0
- package/dist/esm/chunks/chunk.JICZQ2BO.js +168 -0
- package/dist/esm/chunks/chunk.JICZQ2BO.js.map +7 -0
- package/dist/esm/chunks/chunk.JKC5PU23.js +42 -0
- package/dist/esm/chunks/chunk.JKC5PU23.js.map +7 -0
- package/dist/esm/chunks/chunk.JQQOZMKQ.js +2994 -0
- package/dist/esm/chunks/chunk.JQQOZMKQ.js.map +7 -0
- package/dist/esm/chunks/chunk.JVQP6BJ3.js +1591 -0
- package/dist/esm/chunks/chunk.JVQP6BJ3.js.map +7 -0
- package/dist/esm/chunks/chunk.K2PCTUVN.js +139 -0
- package/dist/esm/chunks/chunk.K2PCTUVN.js.map +7 -0
- package/dist/esm/chunks/chunk.KCK3G74Y.js +634 -0
- package/dist/esm/chunks/chunk.KCK3G74Y.js.map +7 -0
- package/dist/esm/chunks/chunk.KI3IHPS2.js +801 -0
- package/dist/esm/chunks/chunk.KI3IHPS2.js.map +7 -0
- package/dist/esm/chunks/chunk.KRW2IAIU.js +445 -0
- package/dist/esm/chunks/chunk.KRW2IAIU.js.map +7 -0
- package/dist/esm/chunks/chunk.KZ2QNQK2.js +21 -0
- package/dist/esm/chunks/chunk.KZ2QNQK2.js.map +7 -0
- package/dist/esm/chunks/chunk.KZATVOA6.js +68 -0
- package/dist/esm/chunks/chunk.KZATVOA6.js.map +7 -0
- package/dist/esm/chunks/chunk.LCWRP2UI.js +59 -0
- package/dist/esm/chunks/chunk.LCWRP2UI.js.map +7 -0
- package/dist/esm/chunks/chunk.LM5TVNZY.js +71 -0
- package/dist/esm/chunks/chunk.LM5TVNZY.js.map +7 -0
- package/dist/esm/chunks/chunk.MAGJQ2PP.js +964 -0
- package/dist/esm/chunks/chunk.MAGJQ2PP.js.map +7 -0
- package/dist/esm/chunks/chunk.MEFT5FQC.js +158 -0
- package/dist/esm/chunks/chunk.MEFT5FQC.js.map +7 -0
- package/dist/esm/chunks/chunk.MHEJZJT3.js +6 -0
- package/dist/esm/chunks/chunk.MHEJZJT3.js.map +7 -0
- package/dist/esm/chunks/chunk.MMIZOYAS.js +147 -0
- package/dist/esm/chunks/chunk.MMIZOYAS.js.map +7 -0
- package/dist/esm/chunks/chunk.MNFGVNDI.js +6 -0
- package/dist/esm/chunks/chunk.MNFGVNDI.js.map +7 -0
- package/dist/esm/chunks/chunk.NQOD2XB3.js +840 -0
- package/dist/esm/chunks/chunk.NQOD2XB3.js.map +7 -0
- package/dist/esm/chunks/chunk.NRI7SWVX.js +1347 -0
- package/dist/esm/chunks/chunk.NRI7SWVX.js.map +7 -0
- package/dist/esm/chunks/chunk.NX5SKZLU.js +50 -0
- package/dist/esm/chunks/chunk.NX5SKZLU.js.map +7 -0
- package/dist/esm/chunks/chunk.O6UHX6FK.js +463 -0
- package/dist/esm/chunks/chunk.O6UHX6FK.js.map +7 -0
- package/dist/esm/chunks/chunk.OJI6ZRYW.js +561 -0
- package/dist/esm/chunks/chunk.OJI6ZRYW.js.map +7 -0
- package/dist/esm/chunks/chunk.OQRMHHPB.js +1335 -0
- package/dist/esm/chunks/chunk.OQRMHHPB.js.map +7 -0
- package/dist/esm/chunks/chunk.OYO6NUZY.js +52 -0
- package/dist/esm/chunks/chunk.OYO6NUZY.js.map +7 -0
- package/dist/esm/chunks/chunk.P43Z3YAS.js +507 -0
- package/dist/esm/chunks/chunk.P43Z3YAS.js.map +7 -0
- package/dist/esm/chunks/chunk.P7NOYP4O.js +73 -0
- package/dist/esm/chunks/chunk.P7NOYP4O.js.map +7 -0
- package/dist/esm/chunks/chunk.PBGL3BRX.js +27 -0
- package/dist/esm/chunks/chunk.PBGL3BRX.js.map +7 -0
- package/dist/esm/chunks/chunk.PCYIY5OY.js +461 -0
- package/dist/esm/chunks/chunk.PCYIY5OY.js.map +7 -0
- package/dist/esm/chunks/chunk.Q4YMHFRY.js +155 -0
- package/dist/esm/chunks/chunk.Q4YMHFRY.js.map +7 -0
- package/dist/esm/chunks/chunk.QD7EPCL6.js +144 -0
- package/dist/esm/chunks/chunk.QD7EPCL6.js.map +7 -0
- package/dist/esm/chunks/chunk.QQDDGRY6.js +6 -0
- package/dist/esm/chunks/chunk.QQDDGRY6.js.map +7 -0
- package/dist/esm/chunks/chunk.RNPIV3BY.js +540 -0
- package/dist/esm/chunks/chunk.RNPIV3BY.js.map +7 -0
- package/dist/esm/chunks/chunk.RR7HDQU6.js +236 -0
- package/dist/esm/chunks/chunk.RR7HDQU6.js.map +7 -0
- package/dist/esm/chunks/chunk.RV3E762Y.js +73 -0
- package/dist/esm/chunks/chunk.RV3E762Y.js.map +7 -0
- package/dist/esm/chunks/chunk.RWCC6E4O.js +52 -0
- package/dist/esm/chunks/chunk.RWCC6E4O.js.map +7 -0
- package/dist/esm/chunks/chunk.SJZ54RE3.js +56 -0
- package/dist/esm/chunks/chunk.SJZ54RE3.js.map +7 -0
- package/dist/esm/chunks/chunk.SKISCNSC.js +559 -0
- package/dist/esm/chunks/chunk.SKISCNSC.js.map +7 -0
- package/dist/esm/chunks/chunk.SKLCDWYQ.js +6 -0
- package/dist/esm/chunks/chunk.SKLCDWYQ.js.map +7 -0
- package/dist/esm/chunks/chunk.SNAZ6JSS.js +22 -0
- package/dist/esm/chunks/chunk.SNAZ6JSS.js.map +7 -0
- package/dist/esm/chunks/chunk.ST3R6JEE.js +73 -0
- package/dist/esm/chunks/chunk.ST3R6JEE.js.map +7 -0
- package/dist/esm/chunks/chunk.TLCGGWBO.js +6 -0
- package/dist/esm/chunks/chunk.TLCGGWBO.js.map +7 -0
- package/dist/esm/chunks/chunk.U35QQZVK.js +422 -0
- package/dist/esm/chunks/chunk.U35QQZVK.js.map +7 -0
- package/dist/esm/chunks/chunk.U6FJJGO3.js +6 -0
- package/dist/esm/chunks/chunk.U6FJJGO3.js.map +7 -0
- package/dist/esm/chunks/chunk.VAPJ75PS.js +21 -0
- package/dist/esm/chunks/chunk.VAPJ75PS.js.map +7 -0
- package/dist/esm/chunks/chunk.VHO7NUMI.js +37 -0
- package/dist/esm/chunks/chunk.VHO7NUMI.js.map +7 -0
- package/dist/esm/chunks/chunk.VK6LIH3B.js +13 -0
- package/dist/esm/chunks/chunk.VK6LIH3B.js.map +7 -0
- package/dist/esm/chunks/chunk.VTXXZ5KT.js +450 -0
- package/dist/esm/chunks/chunk.VTXXZ5KT.js.map +7 -0
- package/dist/esm/chunks/chunk.WAJDLUSQ.js +56 -0
- package/dist/esm/chunks/chunk.WAJDLUSQ.js.map +7 -0
- package/dist/esm/chunks/chunk.WF2MFLG4.js +6 -0
- package/dist/esm/chunks/chunk.WF2MFLG4.js.map +7 -0
- package/dist/esm/chunks/chunk.WINL2C7Q.js +6 -0
- package/dist/esm/chunks/chunk.WINL2C7Q.js.map +7 -0
- package/dist/esm/chunks/chunk.WIYLQTSX.js +3550 -0
- package/dist/esm/chunks/chunk.WIYLQTSX.js.map +7 -0
- package/dist/esm/chunks/chunk.WT4W2IFT.js +92 -0
- package/dist/esm/chunks/chunk.WT4W2IFT.js.map +7 -0
- package/dist/esm/chunks/chunk.WXFCZJJI.js +52 -0
- package/dist/esm/chunks/chunk.WXFCZJJI.js.map +7 -0
- package/dist/esm/chunks/chunk.XEF6G5NS.js +248 -0
- package/dist/esm/chunks/chunk.XEF6G5NS.js.map +7 -0
- package/dist/esm/chunks/chunk.XGMOOPIE.js +136 -0
- package/dist/esm/chunks/chunk.XGMOOPIE.js.map +7 -0
- package/dist/esm/chunks/chunk.XIDZXGD4.js +912 -0
- package/dist/esm/chunks/chunk.XIDZXGD4.js.map +7 -0
- package/dist/esm/chunks/chunk.XJVLHRVJ.js +59 -0
- package/dist/esm/chunks/chunk.XJVLHRVJ.js.map +7 -0
- package/dist/esm/chunks/chunk.XO3XVXWW.js +72 -0
- package/dist/esm/chunks/chunk.XO3XVXWW.js.map +7 -0
- package/dist/esm/chunks/chunk.XY3ZHN7Y.js +649 -0
- package/dist/esm/chunks/chunk.XY3ZHN7Y.js.map +7 -0
- package/dist/esm/chunks/chunk.Y2TDQIA4.js +307 -0
- package/dist/esm/chunks/chunk.Y2TDQIA4.js.map +7 -0
- package/dist/esm/chunks/chunk.YCW56AVX.js +176 -0
- package/dist/esm/chunks/chunk.YCW56AVX.js.map +7 -0
- package/dist/esm/chunks/chunk.YDPSV74L.js +742 -0
- package/dist/esm/chunks/chunk.YDPSV74L.js.map +7 -0
- package/dist/esm/chunks/chunk.YJ5X3WZ4.js +110 -0
- package/dist/esm/chunks/chunk.YJ5X3WZ4.js.map +7 -0
- package/dist/esm/chunks/chunk.ZABF5CI6.js +760 -0
- package/dist/esm/chunks/chunk.ZABF5CI6.js.map +7 -0
- package/dist/esm/chunks/chunk.ZG4NZM2P.js +173 -0
- package/dist/esm/chunks/chunk.ZG4NZM2P.js.map +7 -0
- package/dist/esm/chunks/chunk.ZUM5YLB2.js +291 -0
- package/dist/esm/chunks/chunk.ZUM5YLB2.js.map +7 -0
- package/dist/esm/circular-progress/index.js +28 -0
- package/dist/esm/circular-progress/index.js.map +7 -0
- package/dist/esm/color-picker/index.js +49 -0
- package/dist/esm/color-picker/index.js.map +7 -0
- package/dist/esm/core/base/index.js +21 -0
- package/dist/esm/core/base/index.js.map +7 -0
- package/dist/esm/core/delegates/index.js +20 -0
- package/dist/esm/core/delegates/index.js.map +7 -0
- package/dist/esm/core/index.js +83 -0
- package/dist/esm/core/index.js.map +7 -0
- package/dist/esm/core/mask/index.js +26 -0
- package/dist/esm/core/mask/index.js.map +7 -0
- package/dist/esm/core/utils/index.js +46 -0
- package/dist/esm/core/utils/index.js.map +7 -0
- package/dist/esm/date-picker/index.js +62 -0
- package/dist/esm/date-picker/index.js.map +7 -0
- package/dist/esm/date-range-picker/index.js +64 -0
- package/dist/esm/date-range-picker/index.js.map +7 -0
- package/dist/esm/dialog/index.js +44 -0
- package/dist/esm/dialog/index.js.map +7 -0
- package/dist/esm/divider/index.js +22 -0
- package/dist/esm/divider/index.js.map +7 -0
- package/dist/esm/drawer/base/index.js +25 -0
- package/dist/esm/drawer/base/index.js.map +7 -0
- package/dist/esm/drawer/drawer/index.js +25 -0
- package/dist/esm/drawer/drawer/index.js.map +7 -0
- package/dist/esm/drawer/index.js +56 -0
- package/dist/esm/drawer/index.js.map +7 -0
- package/dist/esm/drawer/mini-drawer/index.js +25 -0
- package/dist/esm/drawer/mini-drawer/index.js.map +7 -0
- package/dist/esm/drawer/modal-drawer/index.js +30 -0
- package/dist/esm/drawer/modal-drawer/index.js.map +7 -0
- package/dist/esm/expansion-panel/index.js +38 -0
- package/dist/esm/expansion-panel/index.js.map +7 -0
- package/dist/esm/file-picker/index.js +41 -0
- package/dist/esm/file-picker/index.js.map +7 -0
- package/dist/esm/floating-action-button/index.js +29 -0
- package/dist/esm/floating-action-button/index.js.map +7 -0
- package/dist/esm/floating-label/index.js +23 -0
- package/dist/esm/floating-label/index.js.map +7 -0
- package/dist/esm/icon/index.js +53 -0
- package/dist/esm/icon/index.js.map +7 -0
- package/dist/esm/icon-button/index.js +37 -0
- package/dist/esm/icon-button/index.js.map +7 -0
- package/dist/esm/index.js +1275 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/inline-message/index.js +22 -0
- package/dist/esm/inline-message/index.js.map +7 -0
- package/dist/esm/keyboard-shortcut/index.js +41 -0
- package/dist/esm/keyboard-shortcut/index.js.map +7 -0
- package/dist/esm/label-value/index.js +32 -0
- package/dist/esm/label-value/index.js.map +7 -0
- package/dist/esm/linear-progress/index.js +24 -0
- package/dist/esm/linear-progress/index.js.map +7 -0
- package/dist/esm/list/index.js +44 -0
- package/dist/esm/list/index.js.map +7 -0
- package/dist/esm/list/list/index.js +33 -0
- package/dist/esm/list/list/index.js.map +7 -0
- package/dist/esm/list/list-item/index.js +31 -0
- package/dist/esm/list/list-item/index.js.map +7 -0
- package/dist/esm/list-dropdown/index.js +55 -0
- package/dist/esm/list-dropdown/index.js.map +7 -0
- package/dist/esm/menu/index.js +53 -0
- package/dist/esm/menu/index.js.map +7 -0
- package/dist/esm/open-icon/index.js +37 -0
- package/dist/esm/open-icon/index.js.map +7 -0
- package/dist/esm/page-state/index.js +22 -0
- package/dist/esm/page-state/index.js.map +7 -0
- package/dist/esm/paginator/index.js +66 -0
- package/dist/esm/paginator/index.js.map +7 -0
- package/dist/esm/popup/index.js +31 -0
- package/dist/esm/popup/index.js.map +7 -0
- package/dist/esm/product-icon/index.js +29 -0
- package/dist/esm/product-icon/index.js.map +7 -0
- package/dist/esm/profile-card/index.js +37 -0
- package/dist/esm/profile-card/index.js.map +7 -0
- package/dist/esm/quantity-field/index.js +46 -0
- package/dist/esm/quantity-field/index.js.map +7 -0
- package/dist/esm/radio/index.js +26 -0
- package/dist/esm/radio/index.js.map +7 -0
- package/dist/esm/ripple/index.js +32 -0
- package/dist/esm/ripple/index.js.map +7 -0
- package/dist/esm/scaffold/index.js +22 -0
- package/dist/esm/scaffold/index.js.map +7 -0
- package/dist/esm/select/core/index.js +60 -0
- package/dist/esm/select/core/index.js.map +7 -0
- package/dist/esm/select/index.js +114 -0
- package/dist/esm/select/index.js.map +7 -0
- package/dist/esm/select/option/index.js +28 -0
- package/dist/esm/select/option/index.js.map +7 -0
- package/dist/esm/select/option-group/index.js +22 -0
- package/dist/esm/select/option-group/index.js.map +7 -0
- package/dist/esm/select/select/index.js +63 -0
- package/dist/esm/select/select/index.js.map +7 -0
- package/dist/esm/select/select-dropdown/index.js +59 -0
- package/dist/esm/select/select-dropdown/index.js.map +7 -0
- package/dist/esm/skeleton/index.js +22 -0
- package/dist/esm/skeleton/index.js.map +7 -0
- package/dist/esm/slider/index.js +35 -0
- package/dist/esm/slider/index.js.map +7 -0
- package/dist/esm/stepper/index.js +55 -0
- package/dist/esm/stepper/index.js.map +7 -0
- package/dist/esm/stepper/step/index.js +40 -0
- package/dist/esm/stepper/step/index.js.map +7 -0
- package/dist/esm/stepper/stepper/index.js +43 -0
- package/dist/esm/stepper/stepper/index.js.map +7 -0
- package/dist/esm/switch/index.js +34 -0
- package/dist/esm/switch/index.js.map +7 -0
- package/dist/esm/table/index.js +57 -0
- package/dist/esm/table/index.js.map +7 -0
- package/dist/esm/tabs/index.js +61 -0
- package/dist/esm/tabs/index.js.map +7 -0
- package/dist/esm/tabs/tab/index.js +33 -0
- package/dist/esm/tabs/tab/index.js.map +7 -0
- package/dist/esm/tabs/tab-bar/index.js +47 -0
- package/dist/esm/tabs/tab-bar/index.js.map +7 -0
- package/dist/esm/text-field/index.js +39 -0
- package/dist/esm/text-field/index.js.map +7 -0
- package/dist/esm/theme/index.js +17 -0
- package/dist/esm/theme/index.js.map +7 -0
- package/dist/esm/time-picker/index.js +92 -0
- package/dist/esm/time-picker/index.js.map +7 -0
- package/dist/esm/toast/index.js +42 -0
- package/dist/esm/toast/index.js.map +7 -0
- package/dist/esm/toolbar/index.js +22 -0
- package/dist/esm/toolbar/index.js.map +7 -0
- package/dist/esm/tooltip/index.js +34 -0
- package/dist/esm/tooltip/index.js.map +7 -0
- package/dist/esm/utils/index.js +17 -0
- package/dist/esm/utils/index.js.map +7 -0
- package/dist/esm/view-switcher/index.js +40 -0
- package/dist/esm/view-switcher/index.js.map +7 -0
- package/dist/esm/view-switcher/view/index.js +22 -0
- package/dist/esm/view-switcher/view/index.js.map +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,2994 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Tyler Technologies, Inc.
|
|
4
|
+
* License: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import {
|
|
7
|
+
CALENDAR_CONSTANTS,
|
|
8
|
+
eventIncludesDate,
|
|
9
|
+
eventIncludesElement,
|
|
10
|
+
getAccessibleHeader,
|
|
11
|
+
getClearButton,
|
|
12
|
+
getDateElement,
|
|
13
|
+
getDateId,
|
|
14
|
+
getDateRow,
|
|
15
|
+
getDateSpacerElement,
|
|
16
|
+
getDayElement,
|
|
17
|
+
getEventElement,
|
|
18
|
+
getEventWrapperElement,
|
|
19
|
+
getEventWrapperId,
|
|
20
|
+
getFirstDayOfWeekForLocale,
|
|
21
|
+
getFooter,
|
|
22
|
+
getHeader,
|
|
23
|
+
getLocalizedMonth,
|
|
24
|
+
getLocalizedYear,
|
|
25
|
+
getMonthButtonContent,
|
|
26
|
+
getTodayButton,
|
|
27
|
+
getTooltip,
|
|
28
|
+
getWeekendDaysForLocale,
|
|
29
|
+
getYearButtonContent,
|
|
30
|
+
isRtlLocale,
|
|
31
|
+
setTabindexOnElement
|
|
32
|
+
} from "./chunk.YDPSV74L.js";
|
|
33
|
+
import {
|
|
34
|
+
CALENDAR_MENU_CONSTANTS,
|
|
35
|
+
CalendarMenuComponent
|
|
36
|
+
} from "./chunk.XY3ZHN7Y.js";
|
|
37
|
+
import {
|
|
38
|
+
DateRange
|
|
39
|
+
} from "./chunk.SNAZ6JSS.js";
|
|
40
|
+
import {
|
|
41
|
+
getEventPath
|
|
42
|
+
} from "./chunk.EY57VTRF.js";
|
|
43
|
+
import {
|
|
44
|
+
ButtonComponent
|
|
45
|
+
} from "./chunk.5NXVVSTU.js";
|
|
46
|
+
import {
|
|
47
|
+
IconButtonComponent
|
|
48
|
+
} from "./chunk.7Y4NHCJH.js";
|
|
49
|
+
import {
|
|
50
|
+
tylIconAdd,
|
|
51
|
+
tylIconArrowDropDown,
|
|
52
|
+
tylIconKeyboardArrowLeft,
|
|
53
|
+
tylIconKeyboardArrowRight,
|
|
54
|
+
tylIconLens
|
|
55
|
+
} from "./chunk.GS2AXUCN.js";
|
|
56
|
+
import {
|
|
57
|
+
TooltipComponent
|
|
58
|
+
} from "./chunk.2F6PST3N.js";
|
|
59
|
+
import {
|
|
60
|
+
IconComponent,
|
|
61
|
+
IconRegistry
|
|
62
|
+
} from "./chunk.P43Z3YAS.js";
|
|
63
|
+
import {
|
|
64
|
+
getLastDateOfMonth,
|
|
65
|
+
getMonthLength,
|
|
66
|
+
isSameDate
|
|
67
|
+
} from "./chunk.52F6VUCF.js";
|
|
68
|
+
import {
|
|
69
|
+
BaseComponentDelegate
|
|
70
|
+
} from "./chunk.WT4W2IFT.js";
|
|
71
|
+
import {
|
|
72
|
+
BaseAdapter
|
|
73
|
+
} from "./chunk.KZATVOA6.js";
|
|
74
|
+
import {
|
|
75
|
+
FoundationProperty
|
|
76
|
+
} from "./chunk.MMIZOYAS.js";
|
|
77
|
+
import {
|
|
78
|
+
CustomElement
|
|
79
|
+
} from "./chunk.35U3UPDV.js";
|
|
80
|
+
import {
|
|
81
|
+
attachShadowTemplate,
|
|
82
|
+
defineCustomElement,
|
|
83
|
+
getShadowElement
|
|
84
|
+
} from "./chunk.K2PCTUVN.js";
|
|
85
|
+
import {
|
|
86
|
+
appendToAttribute,
|
|
87
|
+
elementParents,
|
|
88
|
+
removeAllChildren,
|
|
89
|
+
toggleAttribute,
|
|
90
|
+
toggleOnAttribute
|
|
91
|
+
} from "./chunk.4JURZYE4.js";
|
|
92
|
+
import {
|
|
93
|
+
coerceBoolean,
|
|
94
|
+
coerceNumber,
|
|
95
|
+
isArray,
|
|
96
|
+
isDefined,
|
|
97
|
+
isValidDate
|
|
98
|
+
} from "./chunk.MEFT5FQC.js";
|
|
99
|
+
import {
|
|
100
|
+
__decorateClass
|
|
101
|
+
} from "./chunk.LM5TVNZY.js";
|
|
102
|
+
|
|
103
|
+
// dist/build/lib/staging/src/calendar/calendar-utils.ts
|
|
104
|
+
function getMonthDates(month, year, firstDayOfWeek = 0 /* Sunday */) {
|
|
105
|
+
const dates = [];
|
|
106
|
+
const startDate = getFirstDateOfWeek(new Date(year, month, 1), firstDayOfWeek);
|
|
107
|
+
const endDate = new Date(startDate);
|
|
108
|
+
endDate.setDate(startDate.getDate() + CALENDAR_CONSTANTS.numbers.MONTH_LENGTH);
|
|
109
|
+
for (const d = startDate; d < endDate; d.setDate(d.getDate() + 1)) {
|
|
110
|
+
dates.push(new Date(d));
|
|
111
|
+
}
|
|
112
|
+
return dates;
|
|
113
|
+
}
|
|
114
|
+
function getWeekDates(date, firstDayOfWeek = 0 /* Sunday */) {
|
|
115
|
+
const dates = [];
|
|
116
|
+
const startDate = getFirstDateOfWeek(date, firstDayOfWeek);
|
|
117
|
+
const endDate = new Date(startDate);
|
|
118
|
+
endDate.setDate(startDate.getDate() + 7);
|
|
119
|
+
for (const d = startDate; d < endDate; d.setDate(d.getDate() + 1)) {
|
|
120
|
+
dates.push(new Date(d));
|
|
121
|
+
}
|
|
122
|
+
return dates;
|
|
123
|
+
}
|
|
124
|
+
function getFirstDateOfWeek(date, firstDayOfWeek = 0 /* Sunday */) {
|
|
125
|
+
const day = date.getDay();
|
|
126
|
+
const firstDate = new Date(date);
|
|
127
|
+
const diff = day >= firstDayOfWeek ? day - firstDayOfWeek : 7 + (day - firstDayOfWeek);
|
|
128
|
+
firstDate.setDate(date.getDate() - diff);
|
|
129
|
+
firstDate.setHours(0, 0, 0, 0);
|
|
130
|
+
return firstDate;
|
|
131
|
+
}
|
|
132
|
+
function getLastDateOfWeek(date, firstDayOfWeek = 0 /* Sunday */) {
|
|
133
|
+
const lastDate = getFirstDateOfWeek(date, firstDayOfWeek);
|
|
134
|
+
lastDate.setDate(lastDate.getDate() + 6);
|
|
135
|
+
return lastDate;
|
|
136
|
+
}
|
|
137
|
+
function getFirstDayOfMonth(month, year) {
|
|
138
|
+
const date = new Date(year, month, 1);
|
|
139
|
+
return date.getDay();
|
|
140
|
+
}
|
|
141
|
+
function getSortedDaysOfWeek(firstDayOfWeek = 0 /* Sunday */) {
|
|
142
|
+
const days = [];
|
|
143
|
+
let day = firstDayOfWeek;
|
|
144
|
+
do {
|
|
145
|
+
days.push(day);
|
|
146
|
+
day += 1;
|
|
147
|
+
day %= 7;
|
|
148
|
+
} while (day !== firstDayOfWeek);
|
|
149
|
+
return days;
|
|
150
|
+
}
|
|
151
|
+
function isToday(date) {
|
|
152
|
+
return isSameDate(new Date(), date);
|
|
153
|
+
}
|
|
154
|
+
function isInMonth(date, month, year) {
|
|
155
|
+
return date.getMonth() === month && date.getFullYear() === year;
|
|
156
|
+
}
|
|
157
|
+
function isInRange(date, start, end) {
|
|
158
|
+
return date > start && date < end || isSameDate(date, start) || isSameDate(date, end);
|
|
159
|
+
}
|
|
160
|
+
function sortDates(dates) {
|
|
161
|
+
return dates.sort((a, b) => a.getTime() - b.getTime());
|
|
162
|
+
}
|
|
163
|
+
function splitIntoWeeks(array) {
|
|
164
|
+
const result = [];
|
|
165
|
+
for (let i = 0; i < array.length; i += 7) {
|
|
166
|
+
const chunk = array.slice(i, i + 7);
|
|
167
|
+
result.push(chunk);
|
|
168
|
+
}
|
|
169
|
+
return result;
|
|
170
|
+
}
|
|
171
|
+
function getDateRangeFromDates(dates) {
|
|
172
|
+
if (!dates.length) {
|
|
173
|
+
return new DateRange();
|
|
174
|
+
}
|
|
175
|
+
if (dates.length === 1) {
|
|
176
|
+
return new DateRange({ from: new Date(dates[0]) });
|
|
177
|
+
}
|
|
178
|
+
const minAndMax = getMinAndMaxDates(dates);
|
|
179
|
+
return new DateRange({ from: minAndMax[0], to: minAndMax[minAndMax.length - 1] });
|
|
180
|
+
}
|
|
181
|
+
function getDatesFromDateRange(range) {
|
|
182
|
+
const dates = [];
|
|
183
|
+
if (range.from) {
|
|
184
|
+
dates.push(new Date(range.from));
|
|
185
|
+
}
|
|
186
|
+
if (range.to) {
|
|
187
|
+
dates.push(new Date(range.to));
|
|
188
|
+
}
|
|
189
|
+
return dates;
|
|
190
|
+
}
|
|
191
|
+
function getMinAndMaxDates(dates) {
|
|
192
|
+
if (!dates.length) {
|
|
193
|
+
return [];
|
|
194
|
+
}
|
|
195
|
+
if (dates.length === 1) {
|
|
196
|
+
return [new Date(dates[0])];
|
|
197
|
+
}
|
|
198
|
+
const sortedDates = sortDates(dates.slice().map((d) => new Date(d)));
|
|
199
|
+
return [new Date(sortedDates[0]), new Date(sortedDates[sortedDates.length - 1])];
|
|
200
|
+
}
|
|
201
|
+
function getDatesInRange(dates, start, end) {
|
|
202
|
+
if (!start || !end) {
|
|
203
|
+
return [];
|
|
204
|
+
}
|
|
205
|
+
return dates.filter((d) => {
|
|
206
|
+
return isInRange(d, start, end);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
function getEventDescriptions(events) {
|
|
210
|
+
let description = `${events.length} event${events.length === 1 ? "" : "s"}`;
|
|
211
|
+
const labels = events.map((e) => e.label).join(", ");
|
|
212
|
+
if (labels == null ? void 0 : labels.length) {
|
|
213
|
+
description += `: ${labels}`;
|
|
214
|
+
}
|
|
215
|
+
return description;
|
|
216
|
+
}
|
|
217
|
+
function parseDateOffset(offset) {
|
|
218
|
+
var _a, _b;
|
|
219
|
+
const date = new Date();
|
|
220
|
+
const parts = (_b = (_a = offset.match(/-?[0-9]*[a-zA-Z]/g)) == null ? void 0 : _a.map((p) => p.trim())) != null ? _b : [];
|
|
221
|
+
parts.forEach((p) => {
|
|
222
|
+
const postfix = p.slice(-1);
|
|
223
|
+
const value = +p.slice(0, -1);
|
|
224
|
+
switch (postfix) {
|
|
225
|
+
case "y":
|
|
226
|
+
date.setFullYear(date.getFullYear() + value);
|
|
227
|
+
break;
|
|
228
|
+
case "m":
|
|
229
|
+
date.setMonth(date.getMonth() + value);
|
|
230
|
+
break;
|
|
231
|
+
case "w":
|
|
232
|
+
date.setDate(date.getDate() + value * 7);
|
|
233
|
+
break;
|
|
234
|
+
case "d":
|
|
235
|
+
date.setDate(date.getDate() + value);
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
date.setHours(0, 0, 0, 0);
|
|
240
|
+
return date;
|
|
241
|
+
}
|
|
242
|
+
function parseYearRange(range) {
|
|
243
|
+
const parts = range.split(":");
|
|
244
|
+
if ((parts == null ? void 0 : parts.length) < 2) {
|
|
245
|
+
return { min: 1970, max: 1970 };
|
|
246
|
+
}
|
|
247
|
+
const thisYear = new Date().getFullYear();
|
|
248
|
+
const parsedParts = parts.slice(0, 2).map((p) => {
|
|
249
|
+
if (p.startsWith("-")) {
|
|
250
|
+
return thisYear - +p.substring(1);
|
|
251
|
+
} else if (p.startsWith("+")) {
|
|
252
|
+
return thisYear + +p.substring(1);
|
|
253
|
+
}
|
|
254
|
+
return +p;
|
|
255
|
+
});
|
|
256
|
+
return { min: parsedParts[0], max: parsedParts[1] };
|
|
257
|
+
}
|
|
258
|
+
function getMonthOptions(config) {
|
|
259
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
260
|
+
const minYear = (_b = (_a = config.min) == null ? void 0 : _a.getFullYear()) != null ? _b : 0;
|
|
261
|
+
const maxYear = (_d = (_c = config.max) == null ? void 0 : _c.getFullYear()) != null ? _d : 0;
|
|
262
|
+
const minMonth = (_f = (_e = config.min) == null ? void 0 : _e.getMonth()) != null ? _f : -1;
|
|
263
|
+
const maxMonth = (_h = (_g = config.max) == null ? void 0 : _g.getMonth()) != null ? _h : 12;
|
|
264
|
+
return [...Array(12).keys()].map((k) => {
|
|
265
|
+
const lessThanMin = config.min ? config.selectedYear < minYear || config.selectedYear === minYear && k < minMonth : false;
|
|
266
|
+
const greaterThanMax = config.max ? config.selectedYear > maxYear || config.selectedYear === maxYear && k > maxMonth : false;
|
|
267
|
+
return {
|
|
268
|
+
value: k,
|
|
269
|
+
label: getLocalizedMonth(k, "long", config.locale),
|
|
270
|
+
selected: k === config.selectedMonth,
|
|
271
|
+
disabled: lessThanMin || greaterThanMax
|
|
272
|
+
};
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
function getYearOptions(config) {
|
|
276
|
+
const menuOptions = [];
|
|
277
|
+
const offset = config.yearInView % CALENDAR_CONSTANTS.numbers.YEARS_IN_VIEW;
|
|
278
|
+
const start = config.yearInView - offset;
|
|
279
|
+
for (let i = start; i < start + CALENDAR_CONSTANTS.numbers.YEARS_IN_VIEW; i++) {
|
|
280
|
+
menuOptions.push({
|
|
281
|
+
value: i,
|
|
282
|
+
label: getLocalizedYear(i, "numeric", config.locale),
|
|
283
|
+
selected: i === config.selectedYear,
|
|
284
|
+
disabled: i < config.min || i > config.max
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
return menuOptions;
|
|
288
|
+
}
|
|
289
|
+
function getAllYearOptions(config) {
|
|
290
|
+
const menuOptions = [];
|
|
291
|
+
for (let i = config.min; i <= config.max; i++) {
|
|
292
|
+
menuOptions.push({
|
|
293
|
+
value: i,
|
|
294
|
+
label: getLocalizedYear(i, "numeric", config.locale),
|
|
295
|
+
selected: i === config.selectedYear
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
return menuOptions;
|
|
299
|
+
}
|
|
300
|
+
function isSelected(date, values) {
|
|
301
|
+
return values.some((d) => isSameDate(d, date));
|
|
302
|
+
}
|
|
303
|
+
function isDisabled(date, params) {
|
|
304
|
+
if (params.minDate && date < params.minDate || params.maxDate && date > params.maxDate) {
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
if (params.otherMonth) {
|
|
308
|
+
return true;
|
|
309
|
+
}
|
|
310
|
+
if (params.disabledDates.some((d) => isSameDate(d, date))) {
|
|
311
|
+
return true;
|
|
312
|
+
}
|
|
313
|
+
if (params.disabledDaysOfWeek.includes(date.getDay())) {
|
|
314
|
+
return true;
|
|
315
|
+
}
|
|
316
|
+
if (params.builder && params.builder(date)) {
|
|
317
|
+
return true;
|
|
318
|
+
}
|
|
319
|
+
return false;
|
|
320
|
+
}
|
|
321
|
+
function getIndexOfDate(date, dates) {
|
|
322
|
+
return dates.findIndex((d) => isSameDate(d, date));
|
|
323
|
+
}
|
|
324
|
+
function getEventsOnDate(date, events, builder) {
|
|
325
|
+
const eventsOnDate = events.filter((e) => isSameDate(e.date, date));
|
|
326
|
+
if (builder) {
|
|
327
|
+
const builtEvents = builder(date);
|
|
328
|
+
if (builtEvents) {
|
|
329
|
+
if (isArray(builtEvents)) {
|
|
330
|
+
eventsOnDate.push(...builtEvents);
|
|
331
|
+
} else {
|
|
332
|
+
eventsOnDate.push(builtEvents);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return eventsOnDate;
|
|
337
|
+
}
|
|
338
|
+
function getMultipleFromRange(dates, disabledParams) {
|
|
339
|
+
if (!dates.length) {
|
|
340
|
+
return [];
|
|
341
|
+
}
|
|
342
|
+
const current = new Date(dates[0]);
|
|
343
|
+
const last = dates[dates.length - 1];
|
|
344
|
+
const array = [];
|
|
345
|
+
while (current <= last) {
|
|
346
|
+
if (!disabledParams || !isDisabled(current, disabledParams)) {
|
|
347
|
+
array.push(new Date(current));
|
|
348
|
+
}
|
|
349
|
+
current.setDate(current.getDate() + 1);
|
|
350
|
+
}
|
|
351
|
+
return array;
|
|
352
|
+
}
|
|
353
|
+
function coerceDateFromValue(value) {
|
|
354
|
+
let date = null;
|
|
355
|
+
if (typeof value === "string" && !value.length) {
|
|
356
|
+
value = null;
|
|
357
|
+
}
|
|
358
|
+
if (value !== null && value !== void 0) {
|
|
359
|
+
if (isValidDate(new Date(value))) {
|
|
360
|
+
date = new Date(value);
|
|
361
|
+
} else if (value.length) {
|
|
362
|
+
date = parseDateOffset(value);
|
|
363
|
+
}
|
|
364
|
+
date == null ? void 0 : date.setHours(0, 0, 0, 0);
|
|
365
|
+
}
|
|
366
|
+
return date;
|
|
367
|
+
}
|
|
368
|
+
function shouldHandleEvent(evt, view, preventFocus) {
|
|
369
|
+
return preventFocus || !getEventPath(evt).length || !!(view === "date" && eventIncludesDate(evt)) || !!(view !== "date" && eventIncludesElement(evt, CALENDAR_CONSTANTS.ids.MENU));
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// dist/build/lib/staging/src/calendar/calendar-adapter.ts
|
|
373
|
+
var CalendarAdapter = class extends BaseAdapter {
|
|
374
|
+
constructor(component) {
|
|
375
|
+
super(component);
|
|
376
|
+
this._container = getShadowElement(component, CALENDAR_CONSTANTS.selectors.CALENDAR);
|
|
377
|
+
this._dateView = getShadowElement(component, CALENDAR_CONSTANTS.selectors.DATE_VIEW);
|
|
378
|
+
this._dayRow = getShadowElement(component, CALENDAR_CONSTANTS.selectors.DAY_ROW);
|
|
379
|
+
this._dateGrid = getShadowElement(component, CALENDAR_CONSTANTS.selectors.DATE_GRID);
|
|
380
|
+
this._menu = getShadowElement(component, CALENDAR_CONSTANTS.selectors.MENU);
|
|
381
|
+
}
|
|
382
|
+
toggleContainerAttribute(hasAttribute, name, value) {
|
|
383
|
+
toggleAttribute(this._container, hasAttribute, name, value);
|
|
384
|
+
}
|
|
385
|
+
registerMonthButtonListener(listener) {
|
|
386
|
+
const monthButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.MONTH_BUTTON);
|
|
387
|
+
monthButton == null ? void 0 : monthButton.addEventListener("click", listener);
|
|
388
|
+
}
|
|
389
|
+
unregisterMonthButtonListener(listener) {
|
|
390
|
+
const monthButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.MONTH_BUTTON);
|
|
391
|
+
monthButton == null ? void 0 : monthButton.removeEventListener("click", listener);
|
|
392
|
+
}
|
|
393
|
+
registerYearButtonListener(listener) {
|
|
394
|
+
const yearButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.YEAR_BUTTON);
|
|
395
|
+
yearButton == null ? void 0 : yearButton.addEventListener("click", listener);
|
|
396
|
+
}
|
|
397
|
+
unregisterYearButtonListener(listener) {
|
|
398
|
+
const yearButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.YEAR_BUTTON);
|
|
399
|
+
yearButton == null ? void 0 : yearButton.removeEventListener("click", listener);
|
|
400
|
+
}
|
|
401
|
+
registerMenuListener(listener) {
|
|
402
|
+
this._menu.addEventListener(CALENDAR_MENU_CONSTANTS.events.SELECT, listener);
|
|
403
|
+
}
|
|
404
|
+
unregisterMenuListener(listener) {
|
|
405
|
+
this._menu.removeEventListener(CALENDAR_MENU_CONSTANTS.events.SELECT, listener);
|
|
406
|
+
}
|
|
407
|
+
registerMenuFocusChangeEventListener(listener) {
|
|
408
|
+
this._menu.addEventListener(CALENDAR_MENU_CONSTANTS.events.FOCUS_CHANGE, listener);
|
|
409
|
+
}
|
|
410
|
+
unregisterMenuFocusChangeEventListener(listener) {
|
|
411
|
+
this._menu.addEventListener(CALENDAR_MENU_CONSTANTS.events.FOCUS_CHANGE, listener);
|
|
412
|
+
}
|
|
413
|
+
registerNextButtonListener(listener) {
|
|
414
|
+
const nextButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.NEXT_BUTTON);
|
|
415
|
+
nextButton == null ? void 0 : nextButton.addEventListener("click", listener);
|
|
416
|
+
}
|
|
417
|
+
unregisterNextButtonListener(listener) {
|
|
418
|
+
const nextButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.NEXT_BUTTON);
|
|
419
|
+
nextButton == null ? void 0 : nextButton.removeEventListener("click", listener);
|
|
420
|
+
}
|
|
421
|
+
registerPreviousButtonListener(listener) {
|
|
422
|
+
const previousButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.PREVIOUS_BUTTON);
|
|
423
|
+
previousButton == null ? void 0 : previousButton.addEventListener("click", listener);
|
|
424
|
+
}
|
|
425
|
+
unregisterPreviousButtonListener(listener) {
|
|
426
|
+
const previousButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.PREVIOUS_BUTTON);
|
|
427
|
+
previousButton == null ? void 0 : previousButton.removeEventListener("click", listener);
|
|
428
|
+
}
|
|
429
|
+
registerClearButtonListener(listener) {
|
|
430
|
+
const clearButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.CLEAR_BUTTON);
|
|
431
|
+
clearButton == null ? void 0 : clearButton.addEventListener("click", listener);
|
|
432
|
+
}
|
|
433
|
+
unregisterClearButtonListener(listener) {
|
|
434
|
+
const clearButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.CLEAR_BUTTON);
|
|
435
|
+
clearButton == null ? void 0 : clearButton.removeEventListener("click", listener);
|
|
436
|
+
}
|
|
437
|
+
registerTodayButtonListener(listener) {
|
|
438
|
+
const todayButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.TODAY_BUTTON);
|
|
439
|
+
todayButton == null ? void 0 : todayButton.addEventListener("click", listener);
|
|
440
|
+
}
|
|
441
|
+
unregisterTodayButtonListener(listener) {
|
|
442
|
+
const todayButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.TODAY_BUTTON);
|
|
443
|
+
todayButton == null ? void 0 : todayButton.removeEventListener("click", listener);
|
|
444
|
+
}
|
|
445
|
+
registerDateClickListener(listener) {
|
|
446
|
+
this._dateGrid.addEventListener("click", listener);
|
|
447
|
+
}
|
|
448
|
+
unregisterDateClickListener(listener) {
|
|
449
|
+
this._dateGrid.removeEventListener("click", listener);
|
|
450
|
+
}
|
|
451
|
+
registerKeydownListener(listener) {
|
|
452
|
+
this._container.addEventListener("keydown", listener);
|
|
453
|
+
}
|
|
454
|
+
registerHoverListener(listener) {
|
|
455
|
+
this._dateGrid.addEventListener("mouseover", listener);
|
|
456
|
+
}
|
|
457
|
+
unregisterHoverListener(listener) {
|
|
458
|
+
this._dateGrid.removeEventListener("mouseover", listener);
|
|
459
|
+
}
|
|
460
|
+
registerPreventFocusListener(listener) {
|
|
461
|
+
this._container.addEventListener("mousedown", listener);
|
|
462
|
+
}
|
|
463
|
+
unregisterPreventFocusListener(listener) {
|
|
464
|
+
this._container.removeEventListener("mousedown", listener);
|
|
465
|
+
}
|
|
466
|
+
setContainerClass(name, value) {
|
|
467
|
+
this._container.classList.toggle(name, value);
|
|
468
|
+
}
|
|
469
|
+
setHeader() {
|
|
470
|
+
const accessibleHeader = this._container.querySelector(CALENDAR_CONSTANTS.selectors.ACCESSIBLE_HEADER);
|
|
471
|
+
accessibleHeader == null ? void 0 : accessibleHeader.remove();
|
|
472
|
+
const header = this._container.querySelector(CALENDAR_CONSTANTS.selectors.HEADER);
|
|
473
|
+
if (header) {
|
|
474
|
+
header.replaceWith(getHeader());
|
|
475
|
+
} else {
|
|
476
|
+
this._container.prepend(getHeader());
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
removeHeader() {
|
|
480
|
+
const header = this._container.querySelector(CALENDAR_CONSTANTS.selectors.HEADER);
|
|
481
|
+
header == null ? void 0 : header.remove();
|
|
482
|
+
const accessibleHeader = this._container.querySelector(CALENDAR_CONSTANTS.selectors.ACCESSIBLE_HEADER);
|
|
483
|
+
if (accessibleHeader) {
|
|
484
|
+
accessibleHeader.replaceWith(getAccessibleHeader());
|
|
485
|
+
} else {
|
|
486
|
+
this._container.prepend(getAccessibleHeader());
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
setNextButtonDisabled(value) {
|
|
490
|
+
const nextButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.NEXT_BUTTON);
|
|
491
|
+
nextButton == null ? void 0 : nextButton.toggleAttribute("disabled", value);
|
|
492
|
+
}
|
|
493
|
+
setPreviousButtonDisabled(value) {
|
|
494
|
+
const previousButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.PREVIOUS_BUTTON);
|
|
495
|
+
previousButton == null ? void 0 : previousButton.toggleAttribute("disabled", value);
|
|
496
|
+
}
|
|
497
|
+
setNextButtonLabel(label) {
|
|
498
|
+
const nextButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.NEXT_BUTTON);
|
|
499
|
+
nextButton == null ? void 0 : nextButton.setAttribute("aria-label", label);
|
|
500
|
+
const nextTooltip = this._container.querySelector(CALENDAR_CONSTANTS.selectors.NEXT_BUTTON_TOOLTIP);
|
|
501
|
+
if (nextTooltip) {
|
|
502
|
+
nextTooltip.innerHTML = label;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
setPreviousButtonLabel(label) {
|
|
506
|
+
const previousButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.PREVIOUS_BUTTON);
|
|
507
|
+
previousButton == null ? void 0 : previousButton.setAttribute("aria-label", label);
|
|
508
|
+
const previousTooltip = this._container.querySelector(CALENDAR_CONSTANTS.selectors.PREVIOUS_BUTTON_TOOLTIP);
|
|
509
|
+
if (previousTooltip) {
|
|
510
|
+
previousTooltip.innerHTML = label;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
setMonthButtonPressed(value) {
|
|
514
|
+
const monthButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.MONTH_BUTTON);
|
|
515
|
+
if (monthButton) {
|
|
516
|
+
monthButton.setAttribute("aria-pressed", value.toString());
|
|
517
|
+
this._container.classList.toggle(CALENDAR_CONSTANTS.classes.MONTH_MENU_OPEN, value);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
setYearButtonPressed(value) {
|
|
521
|
+
const yearButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.YEAR_BUTTON);
|
|
522
|
+
if (yearButton) {
|
|
523
|
+
yearButton.setAttribute("aria-pressed", value.toString());
|
|
524
|
+
this._container.classList.toggle(CALENDAR_CONSTANTS.classes.YEAR_MENU_OPEN, value);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
setMonth(month, locale) {
|
|
528
|
+
const monthButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.MONTH_BUTTON);
|
|
529
|
+
if (monthButton) {
|
|
530
|
+
const content = getMonthButtonContent(month, locale);
|
|
531
|
+
monthButton.replaceChildren(content[0], content[1]);
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
const accessibleMonth = this._container.querySelector(CALENDAR_CONSTANTS.selectors.ACCESSIBLE_MONTH);
|
|
535
|
+
if (accessibleMonth) {
|
|
536
|
+
accessibleMonth.textContent = getLocalizedMonth(month, "long", locale);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
setYear(year, locale) {
|
|
540
|
+
const yearButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.YEAR_BUTTON);
|
|
541
|
+
if (yearButton) {
|
|
542
|
+
const content = getYearButtonContent(year, locale);
|
|
543
|
+
yearButton.replaceChildren(content[0], content[1]);
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
const accessibleYear = this._container.querySelector(CALENDAR_CONSTANTS.selectors.ACCESSIBLE_YEAR);
|
|
547
|
+
if (accessibleYear) {
|
|
548
|
+
accessibleYear.textContent = getLocalizedYear(year, "numeric", locale);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
setFooter() {
|
|
552
|
+
const footer = this._container.querySelector(CALENDAR_CONSTANTS.selectors.FOOTER);
|
|
553
|
+
if (!footer) {
|
|
554
|
+
this._container.appendChild(getFooter());
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
removeFooter() {
|
|
558
|
+
var _a;
|
|
559
|
+
const footer = this._container.querySelector(CALENDAR_CONSTANTS.selectors.FOOTER);
|
|
560
|
+
(_a = footer == null ? void 0 : footer.parentNode) == null ? void 0 : _a.removeChild(footer);
|
|
561
|
+
}
|
|
562
|
+
setClearButton() {
|
|
563
|
+
const footer = this._container.querySelector(CALENDAR_CONSTANTS.selectors.FOOTER);
|
|
564
|
+
if (!footer) {
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
const clearButton = footer.querySelector(CALENDAR_CONSTANTS.selectors.CLEAR_BUTTON);
|
|
568
|
+
if (!clearButton) {
|
|
569
|
+
footer.prepend(getClearButton());
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
removeClearButton() {
|
|
573
|
+
var _a;
|
|
574
|
+
const clearButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.CLEAR_BUTTON);
|
|
575
|
+
(_a = clearButton == null ? void 0 : clearButton.parentNode) == null ? void 0 : _a.removeChild(clearButton);
|
|
576
|
+
}
|
|
577
|
+
setTodayButton() {
|
|
578
|
+
const footer = this._container.querySelector(CALENDAR_CONSTANTS.selectors.FOOTER);
|
|
579
|
+
if (!footer) {
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
const todayButton = footer.querySelector(CALENDAR_CONSTANTS.selectors.TODAY_BUTTON);
|
|
583
|
+
if (!todayButton) {
|
|
584
|
+
footer.appendChild(getTodayButton());
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
removeTodayButton() {
|
|
588
|
+
var _a;
|
|
589
|
+
const todayButton = this._container.querySelector(CALENDAR_CONSTANTS.selectors.TODAY_BUTTON);
|
|
590
|
+
(_a = todayButton == null ? void 0 : todayButton.parentNode) == null ? void 0 : _a.removeChild(todayButton);
|
|
591
|
+
}
|
|
592
|
+
setDays(days, options) {
|
|
593
|
+
removeAllChildren(this._dayRow);
|
|
594
|
+
days.forEach((d) => {
|
|
595
|
+
let element = getDayElement(d, options == null ? void 0 : options.locale);
|
|
596
|
+
if (options == null ? void 0 : options.builder) {
|
|
597
|
+
element = options.builder(d, element);
|
|
598
|
+
}
|
|
599
|
+
this._dayRow.appendChild(element);
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
setDates(dates, options) {
|
|
603
|
+
removeAllChildren(this._dateGrid);
|
|
604
|
+
splitIntoWeeks(dates).forEach((w, i) => {
|
|
605
|
+
const dateRow = getDateRow(w, i, options);
|
|
606
|
+
this._dateGrid.appendChild(dateRow);
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
replaceDate(date, options) {
|
|
610
|
+
const dateElement = this._dateGrid.querySelector(`#${getDateId(date.date)}`);
|
|
611
|
+
if (dateElement) {
|
|
612
|
+
const element = getDateElement(date, options == null ? void 0 : options.locale);
|
|
613
|
+
if (options == null ? void 0 : options.builder) {
|
|
614
|
+
dateElement.replaceWith(options.builder(date, element));
|
|
615
|
+
} else {
|
|
616
|
+
dateElement.replaceWith(element);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
replaceDateWithSpacer(date) {
|
|
621
|
+
const dateElement = this._dateGrid.querySelector(`#${getDateId(date)}`);
|
|
622
|
+
dateElement == null ? void 0 : dateElement.replaceWith(getDateSpacerElement(date));
|
|
623
|
+
}
|
|
624
|
+
setDateDisabled(date, value) {
|
|
625
|
+
const element = this._dateGrid.querySelector(`#${getDateId(date)}`);
|
|
626
|
+
if (element) {
|
|
627
|
+
element.toggleAttribute("disabled", value);
|
|
628
|
+
element.setAttribute("aria-disabled", value.toString());
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
setDateSelected(date, value) {
|
|
632
|
+
const element = this._dateGrid.querySelector(`#${getDateId(date)}`);
|
|
633
|
+
if (element) {
|
|
634
|
+
element.classList.toggle(CALENDAR_CONSTANTS.classes.DATE_SELECTED, value);
|
|
635
|
+
element.setAttribute("aria-selected", value.toString());
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
setWeekend(date, value) {
|
|
639
|
+
const element = this._dateGrid.querySelector(`#${getDateId(date)}`);
|
|
640
|
+
const innerElement = element == null ? void 0 : element.querySelector(CALENDAR_CONSTANTS.selectors.DATE_INNER);
|
|
641
|
+
if (!innerElement) {
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
toggleOnAttribute(innerElement, "part", CALENDAR_CONSTANTS.parts.WEEKEND, value);
|
|
645
|
+
}
|
|
646
|
+
appendDateAttribute(date, name, value) {
|
|
647
|
+
const element = this._dateGrid.querySelector(`#${getDateId(date)}`);
|
|
648
|
+
if (element) {
|
|
649
|
+
appendToAttribute(element, name, value);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
setMultiple(value) {
|
|
653
|
+
this._dateView.setAttribute("aria-multiselectable", value.toString());
|
|
654
|
+
}
|
|
655
|
+
setDateViewHidden(value) {
|
|
656
|
+
toggleAttribute(this._dateView, value, "aria-hidden", value.toString());
|
|
657
|
+
this.setAllDatesUnfocusable();
|
|
658
|
+
}
|
|
659
|
+
setRange(dates) {
|
|
660
|
+
const oldDateElements = this._dateGrid.querySelectorAll(CALENDAR_CONSTANTS.selectors.RANGE);
|
|
661
|
+
oldDateElements.forEach((e) => e.classList.remove(CALENDAR_CONSTANTS.classes.RANGE));
|
|
662
|
+
if (!dates) {
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
dates.forEach((d) => {
|
|
666
|
+
const dateElement = this._dateGrid.querySelector(`#${getDateId(d)}`);
|
|
667
|
+
dateElement == null ? void 0 : dateElement.classList.add(CALENDAR_CONSTANTS.classes.RANGE);
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
setRangeStart(date) {
|
|
671
|
+
const oldDateElement = this._dateGrid.querySelector(CALENDAR_CONSTANTS.selectors.RANGE_START);
|
|
672
|
+
oldDateElement == null ? void 0 : oldDateElement.classList.remove(CALENDAR_CONSTANTS.classes.RANGE_START);
|
|
673
|
+
if (!date) {
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
const newDateElement = this._dateGrid.querySelector(`#${getDateId(date)}`);
|
|
677
|
+
newDateElement == null ? void 0 : newDateElement.classList.add(CALENDAR_CONSTANTS.classes.RANGE_START);
|
|
678
|
+
}
|
|
679
|
+
setRangeEnd(date) {
|
|
680
|
+
const oldDateElement = this._dateGrid.querySelector(CALENDAR_CONSTANTS.selectors.RANGE_END);
|
|
681
|
+
oldDateElement == null ? void 0 : oldDateElement.classList.remove(CALENDAR_CONSTANTS.classes.RANGE_END);
|
|
682
|
+
if (!date) {
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
const newDateElement = this._dateGrid.querySelector(`#${getDateId(date)}`);
|
|
686
|
+
newDateElement == null ? void 0 : newDateElement.classList.add(CALENDAR_CONSTANTS.classes.RANGE_END);
|
|
687
|
+
}
|
|
688
|
+
setActiveDate(date, setFocus, preventFocus) {
|
|
689
|
+
const dateString = date.toDateString();
|
|
690
|
+
const elements = this._dateGrid.querySelectorAll(CALENDAR_CONSTANTS.selectors.DATE);
|
|
691
|
+
elements.forEach((e) => {
|
|
692
|
+
const shouldFocus = e.getAttribute(CALENDAR_CONSTANTS.attributes.DATA_DATE) === dateString;
|
|
693
|
+
setTabindexOnElement(e, shouldFocus ? 0 : -1, setFocus, preventFocus);
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
setAllDatesUnfocusable() {
|
|
697
|
+
const elements = this._dateGrid.querySelectorAll(CALENDAR_CONSTANTS.selectors.DATE);
|
|
698
|
+
elements.forEach((e) => setTabindexOnElement(e, -1, false, true));
|
|
699
|
+
}
|
|
700
|
+
setDateDescription(date, value) {
|
|
701
|
+
const dateElement = this._dateGrid.querySelector(`#${getDateId(date)}`);
|
|
702
|
+
if (!dateElement) {
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
toggleAttribute(dateElement, !!value, value);
|
|
706
|
+
}
|
|
707
|
+
setDateTooltip(date, value) {
|
|
708
|
+
const dateElement = this._dateGrid.querySelector(`#${getDateId(date)}`);
|
|
709
|
+
if (!dateElement) {
|
|
710
|
+
return;
|
|
711
|
+
}
|
|
712
|
+
const tooltip = dateElement.querySelector(CALENDAR_CONSTANTS.selectors.TOOLTIP);
|
|
713
|
+
if (tooltip) {
|
|
714
|
+
if (value == null ? void 0 : value.length) {
|
|
715
|
+
tooltip.textContent = value;
|
|
716
|
+
} else {
|
|
717
|
+
tooltip.remove();
|
|
718
|
+
}
|
|
719
|
+
} else if (value == null ? void 0 : value.length) {
|
|
720
|
+
dateElement.prepend(getTooltip(value));
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
setEventWrapperOnDate(date, value) {
|
|
724
|
+
const dateElement = this._dateGrid.querySelector(`#${getDateId(date)}`);
|
|
725
|
+
if (!dateElement) {
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
const eventWrapper = dateElement.querySelector(CALENDAR_CONSTANTS.selectors.EVENT_WRAPPER);
|
|
729
|
+
if (eventWrapper) {
|
|
730
|
+
if (value) {
|
|
731
|
+
removeAllChildren(eventWrapper);
|
|
732
|
+
} else {
|
|
733
|
+
eventWrapper.remove();
|
|
734
|
+
}
|
|
735
|
+
} else if (value) {
|
|
736
|
+
dateElement.appendChild(getEventWrapperElement(date));
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
setEvent(event, overflow) {
|
|
740
|
+
const eventWrapper = this._dateGrid.querySelector(`#${getEventWrapperId(event.date)}`);
|
|
741
|
+
eventWrapper == null ? void 0 : eventWrapper.appendChild(getEventElement(event, overflow));
|
|
742
|
+
}
|
|
743
|
+
openMenuAsGrid(options, setFocus) {
|
|
744
|
+
this._menu.openAsGrid(options, setFocus);
|
|
745
|
+
}
|
|
746
|
+
openMenuAsList(options, setFocus) {
|
|
747
|
+
this._menu.openAsList(options, setFocus);
|
|
748
|
+
}
|
|
749
|
+
closeMenu() {
|
|
750
|
+
this._menu.close();
|
|
751
|
+
}
|
|
752
|
+
setMenuAnimation(value) {
|
|
753
|
+
this._menu.animationType = value;
|
|
754
|
+
}
|
|
755
|
+
animateIntoSelectionMenu(options, direction, setFocus) {
|
|
756
|
+
this._menu.animateIn(options, direction, setFocus);
|
|
757
|
+
}
|
|
758
|
+
moveMenuFocusDown() {
|
|
759
|
+
this._menu.moveFocusDown();
|
|
760
|
+
}
|
|
761
|
+
moveMenuFocusBackward() {
|
|
762
|
+
return this._menu.moveFocusBackward();
|
|
763
|
+
}
|
|
764
|
+
moveMenuFocusForward() {
|
|
765
|
+
return this._menu.moveFocusForward();
|
|
766
|
+
}
|
|
767
|
+
moveMenuFocusUp() {
|
|
768
|
+
this._menu.moveFocusUp();
|
|
769
|
+
}
|
|
770
|
+
selectFocusedMenuItem() {
|
|
771
|
+
this._menu.selectFocusedItem();
|
|
772
|
+
}
|
|
773
|
+
setPreventFocusOnMenu(value) {
|
|
774
|
+
this._menu.preventFocus = value;
|
|
775
|
+
}
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
// dist/build/lib/staging/src/calendar/calendar-foundation.ts
|
|
779
|
+
var CalendarFoundation = class {
|
|
780
|
+
constructor(_adapter) {
|
|
781
|
+
this._adapter = _adapter;
|
|
782
|
+
this._dates = [];
|
|
783
|
+
this._month = new Date().getMonth();
|
|
784
|
+
this._year = new Date().getFullYear();
|
|
785
|
+
this._showToday = true;
|
|
786
|
+
this._showOtherMonths = false;
|
|
787
|
+
this._fixedHeight = false;
|
|
788
|
+
this._events = [];
|
|
789
|
+
this._value = [];
|
|
790
|
+
this._mode = "single";
|
|
791
|
+
this._readonly = false;
|
|
792
|
+
this._selectionFollowsMonth = false;
|
|
793
|
+
this._rangeSelectionState = "none";
|
|
794
|
+
this._allowSingleDateRange = true;
|
|
795
|
+
this._min = null;
|
|
796
|
+
this._max = null;
|
|
797
|
+
this._minAttribute = null;
|
|
798
|
+
this._maxAttribute = null;
|
|
799
|
+
this._disabledDates = [];
|
|
800
|
+
this._disabledDaysOfWeek = [];
|
|
801
|
+
this._constrainToEnabled = true;
|
|
802
|
+
this._showHeader = true;
|
|
803
|
+
this._clearButton = false;
|
|
804
|
+
this._todayButton = false;
|
|
805
|
+
this._view = "date";
|
|
806
|
+
this._menuAnimation = "scale";
|
|
807
|
+
this._menuYear = null;
|
|
808
|
+
this._listYears = true;
|
|
809
|
+
this._menuIncludedYear = new Date().getFullYear();
|
|
810
|
+
this._menuYearsInView = null;
|
|
811
|
+
this._yearRange = `-${CALENDAR_CONSTANTS.numbers.DEFAULT_MIN_YEAR_OFFSET}:+${CALENDAR_CONSTANTS.numbers.DEFAULT_MAX_YEAR_OFFSET}`;
|
|
812
|
+
this._weekendDays = null;
|
|
813
|
+
this._localeFirstDayOfWeek = 0 /* Sunday */;
|
|
814
|
+
this._localeWeekendDays = [];
|
|
815
|
+
this._rtl = false;
|
|
816
|
+
this._preventFocus = false;
|
|
817
|
+
this._isInitialized = false;
|
|
818
|
+
this._clearButtonListener = () => this._onClearClicked();
|
|
819
|
+
this._dateClickListener = (evt) => this._onDateClick(evt);
|
|
820
|
+
this._keydownListener = (evt) => this._onKeydown(evt);
|
|
821
|
+
this._hoverListener = (evt) => this._onHover(evt);
|
|
822
|
+
this._menuFocusChangeListener = (evt) => this._onMenuFocusChange(evt);
|
|
823
|
+
this._menuListener = (evt) => this._onMenuSelect(evt);
|
|
824
|
+
this._monthButtonListener = () => this._onMonthButtonClicked();
|
|
825
|
+
this._nextButtonListener = () => this._onNextButtonClicked();
|
|
826
|
+
this._preventFocusListener = (evt) => evt.preventDefault();
|
|
827
|
+
this._previousButtonListener = () => this._onPreviousButtonClicked();
|
|
828
|
+
this._todayButtonListener = () => this._onTodayClicked();
|
|
829
|
+
this._yearButtonListener = () => this._onYearButtonClicked();
|
|
830
|
+
}
|
|
831
|
+
initialize() {
|
|
832
|
+
this._adapter.registerMenuListener(this._menuListener);
|
|
833
|
+
this._adapter.registerMenuFocusChangeEventListener(this._menuFocusChangeListener);
|
|
834
|
+
this._adapter.registerKeydownListener(this._keydownListener);
|
|
835
|
+
this._applyMin();
|
|
836
|
+
this._applyMax();
|
|
837
|
+
this._applyFixedHeight();
|
|
838
|
+
this._applyReadOnly();
|
|
839
|
+
this._applyShowToday();
|
|
840
|
+
this._applyPreventFocus();
|
|
841
|
+
this._applyShowHeader();
|
|
842
|
+
this._applyMonth();
|
|
843
|
+
this._applyYear();
|
|
844
|
+
this._applyListYears();
|
|
845
|
+
this._applyMenuAnimation();
|
|
846
|
+
this._applyLocale();
|
|
847
|
+
this._applyClearButton();
|
|
848
|
+
this._applyTodayButton();
|
|
849
|
+
this._applyFirstDayOfWeek();
|
|
850
|
+
this._applyShowOtherMonths();
|
|
851
|
+
this._createDateView();
|
|
852
|
+
this._applyConstrainToEnabled();
|
|
853
|
+
this._applyAllowSingleDateRange();
|
|
854
|
+
this._applyMode();
|
|
855
|
+
this._applyYearRange();
|
|
856
|
+
this._applySelectionFollowsMonth();
|
|
857
|
+
this._isInitialized = true;
|
|
858
|
+
}
|
|
859
|
+
disconnect() {
|
|
860
|
+
this._isInitialized = false;
|
|
861
|
+
}
|
|
862
|
+
_onMonthButtonClicked() {
|
|
863
|
+
this._toggleMonthMenu();
|
|
864
|
+
}
|
|
865
|
+
_toggleMonthMenu(setFocus = false) {
|
|
866
|
+
if (this._view !== "month") {
|
|
867
|
+
this._openMonthMenu(setFocus);
|
|
868
|
+
} else {
|
|
869
|
+
this._closeMenu(false, setFocus);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
_onYearButtonClicked() {
|
|
873
|
+
this._toggleYearMenu();
|
|
874
|
+
}
|
|
875
|
+
_toggleYearMenu(setFocus = false) {
|
|
876
|
+
if (this._view !== "year") {
|
|
877
|
+
this._openYearMenu(setFocus);
|
|
878
|
+
} else {
|
|
879
|
+
this._closeMenu(false, setFocus);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
_onMenuFocusChange(evt) {
|
|
883
|
+
this._emitFocusChangeEvent(evt.detail);
|
|
884
|
+
}
|
|
885
|
+
_onMenuSelect(evt) {
|
|
886
|
+
switch (this._view) {
|
|
887
|
+
case "month":
|
|
888
|
+
this._onMonthSelected(evt.detail);
|
|
889
|
+
break;
|
|
890
|
+
case "year":
|
|
891
|
+
this._onYearSelected(evt.detail);
|
|
892
|
+
break;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
_onNextButtonClicked() {
|
|
896
|
+
if (this._view === "date") {
|
|
897
|
+
this._goToNextMonth();
|
|
898
|
+
this._setFocusInMonth(1 /* First */, false);
|
|
899
|
+
} else if (this._view === "month") {
|
|
900
|
+
this._goToNextYear();
|
|
901
|
+
} else {
|
|
902
|
+
this._goToNextSetOfYears();
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
_onPreviousButtonClicked() {
|
|
906
|
+
if (this._view === "date") {
|
|
907
|
+
this._goToPreviousMonth();
|
|
908
|
+
this._setFocusInMonth(2 /* Last */, false);
|
|
909
|
+
} else if (this._view === "month") {
|
|
910
|
+
this._goToPreviousYear();
|
|
911
|
+
} else {
|
|
912
|
+
this._goToPreviousSetOfYears();
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
_onHover(evt) {
|
|
916
|
+
if (this._mode === "range") {
|
|
917
|
+
const element = eventIncludesDate(evt, false);
|
|
918
|
+
if (!element) {
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
const date = new Date(Date.parse(element.getAttribute(CALENDAR_CONSTANTS.attributes.DATA_DATE)));
|
|
922
|
+
if (isInMonth(date, this._month, this._year)) {
|
|
923
|
+
this._setRangePreview(date);
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
_onDateClick(evt) {
|
|
928
|
+
const element = eventIncludesDate(evt, false);
|
|
929
|
+
if (!element) {
|
|
930
|
+
return;
|
|
931
|
+
}
|
|
932
|
+
const dateString = element.getAttribute(CALENDAR_CONSTANTS.attributes.DATA_DATE);
|
|
933
|
+
if (!dateString) {
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
936
|
+
const date = new Date(dateString);
|
|
937
|
+
if (isInMonth(date, this._month, this._year)) {
|
|
938
|
+
this._focusedDate = date;
|
|
939
|
+
this._beforeDateSelected(date);
|
|
940
|
+
}
|
|
941
|
+
this._resumeTabindexOnDate(false);
|
|
942
|
+
}
|
|
943
|
+
_onKeydown(evt) {
|
|
944
|
+
switch (evt.key) {
|
|
945
|
+
case "ArrowLeft":
|
|
946
|
+
case "ArrowRight":
|
|
947
|
+
case "ArrowUp":
|
|
948
|
+
case "ArrowDown":
|
|
949
|
+
this._handleArrowKey(evt);
|
|
950
|
+
break;
|
|
951
|
+
case "Home":
|
|
952
|
+
case "End":
|
|
953
|
+
case "PageUp":
|
|
954
|
+
case "PageDown":
|
|
955
|
+
this._handleNavigationKey(evt);
|
|
956
|
+
break;
|
|
957
|
+
case " ":
|
|
958
|
+
case "Enter":
|
|
959
|
+
this._handleEnterOrSpaceKey(evt);
|
|
960
|
+
break;
|
|
961
|
+
case "m":
|
|
962
|
+
case "M":
|
|
963
|
+
evt.preventDefault();
|
|
964
|
+
this._toggleMonthMenu(true);
|
|
965
|
+
break;
|
|
966
|
+
case "y":
|
|
967
|
+
case "Y":
|
|
968
|
+
evt.preventDefault();
|
|
969
|
+
this._toggleYearMenu(true);
|
|
970
|
+
break;
|
|
971
|
+
case "t":
|
|
972
|
+
case "T":
|
|
973
|
+
case "n":
|
|
974
|
+
case "N":
|
|
975
|
+
evt.preventDefault();
|
|
976
|
+
this.today();
|
|
977
|
+
break;
|
|
978
|
+
case "Delete":
|
|
979
|
+
case "Backspace":
|
|
980
|
+
evt.preventDefault();
|
|
981
|
+
this._deselectAllDates();
|
|
982
|
+
break;
|
|
983
|
+
case "Escape":
|
|
984
|
+
if (this._view !== "date") {
|
|
985
|
+
evt.preventDefault();
|
|
986
|
+
this._closeMenu(false, true);
|
|
987
|
+
}
|
|
988
|
+
break;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
_handleArrowKey(evt) {
|
|
992
|
+
if (!shouldHandleEvent(evt, this._view, this._preventFocus)) {
|
|
993
|
+
return;
|
|
994
|
+
}
|
|
995
|
+
evt.preventDefault();
|
|
996
|
+
let direction;
|
|
997
|
+
switch (evt.key) {
|
|
998
|
+
case "ArrowLeft":
|
|
999
|
+
direction = this._rtl ? "next" : "previous";
|
|
1000
|
+
break;
|
|
1001
|
+
case "ArrowRight":
|
|
1002
|
+
direction = this._rtl ? "previous" : "next";
|
|
1003
|
+
break;
|
|
1004
|
+
case "ArrowUp":
|
|
1005
|
+
direction = "up";
|
|
1006
|
+
break;
|
|
1007
|
+
case "ArrowDown":
|
|
1008
|
+
direction = "down";
|
|
1009
|
+
break;
|
|
1010
|
+
}
|
|
1011
|
+
switch (direction) {
|
|
1012
|
+
case "previous":
|
|
1013
|
+
if (this._view === "date") {
|
|
1014
|
+
this._moveFocusToPreviousDate(true);
|
|
1015
|
+
} else if (!this._adapter.moveMenuFocusBackward() && this._canGoBackward()) {
|
|
1016
|
+
if (this._view === "month") {
|
|
1017
|
+
this._goToPreviousYear(true);
|
|
1018
|
+
} else {
|
|
1019
|
+
this._goToPreviousSetOfYears(true);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
break;
|
|
1023
|
+
case "next":
|
|
1024
|
+
if (this._view === "date") {
|
|
1025
|
+
this._moveFocusToNextDate(true);
|
|
1026
|
+
} else if (!this._adapter.moveMenuFocusForward() && this._canGoForward()) {
|
|
1027
|
+
if (this._view === "month") {
|
|
1028
|
+
this._goToNextYear(true);
|
|
1029
|
+
} else {
|
|
1030
|
+
this._goToNextSetOfYears(true);
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
break;
|
|
1034
|
+
case "up":
|
|
1035
|
+
if (this._view === "date") {
|
|
1036
|
+
this._moveFocusToPreviousWeek(true);
|
|
1037
|
+
} else {
|
|
1038
|
+
this._adapter.moveMenuFocusUp();
|
|
1039
|
+
}
|
|
1040
|
+
break;
|
|
1041
|
+
case "down":
|
|
1042
|
+
if (this._view === "date") {
|
|
1043
|
+
this._moveFocusToNextWeek(true);
|
|
1044
|
+
} else {
|
|
1045
|
+
this._adapter.moveMenuFocusDown();
|
|
1046
|
+
}
|
|
1047
|
+
break;
|
|
1048
|
+
}
|
|
1049
|
+
if (this._mode === "range") {
|
|
1050
|
+
this._setRangePreview(this._focusedDate);
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
_handleNavigationKey(evt) {
|
|
1054
|
+
evt.preventDefault();
|
|
1055
|
+
switch (evt.key) {
|
|
1056
|
+
case "Home":
|
|
1057
|
+
if (this._view !== "date") {
|
|
1058
|
+
break;
|
|
1059
|
+
}
|
|
1060
|
+
if (evt.shiftKey) {
|
|
1061
|
+
this._moveFocusToFirstOfMonth(true);
|
|
1062
|
+
} else {
|
|
1063
|
+
this._moveFocusToFirstOfWeek(true);
|
|
1064
|
+
}
|
|
1065
|
+
break;
|
|
1066
|
+
case "End":
|
|
1067
|
+
if (this._view !== "date") {
|
|
1068
|
+
break;
|
|
1069
|
+
}
|
|
1070
|
+
if (evt.shiftKey) {
|
|
1071
|
+
this._moveFocusToLastOfMonth(true);
|
|
1072
|
+
} else {
|
|
1073
|
+
this._moveFocusToLastOfWeek(true);
|
|
1074
|
+
}
|
|
1075
|
+
break;
|
|
1076
|
+
case "PageUp":
|
|
1077
|
+
if (this._view === "date") {
|
|
1078
|
+
if (evt.shiftKey) {
|
|
1079
|
+
this._moveFocusToPreviousYear(true);
|
|
1080
|
+
} else {
|
|
1081
|
+
this._moveFocusToPreviousMonth(true);
|
|
1082
|
+
}
|
|
1083
|
+
} else if (this._view === "month" && !evt.shiftKey && this._canGoBackward()) {
|
|
1084
|
+
this._goToPreviousYear(true);
|
|
1085
|
+
} else if (this._view === "year" && !evt.shiftKey && this._canGoBackward()) {
|
|
1086
|
+
this._goToPreviousSetOfYears(true);
|
|
1087
|
+
}
|
|
1088
|
+
break;
|
|
1089
|
+
case "PageDown":
|
|
1090
|
+
if (this._view === "date") {
|
|
1091
|
+
if (evt.shiftKey) {
|
|
1092
|
+
this._moveFocusToNextYear(true);
|
|
1093
|
+
} else {
|
|
1094
|
+
this._moveFocusToNextMonth(true);
|
|
1095
|
+
}
|
|
1096
|
+
} else if (this._view === "month" && !evt.shiftKey && this._canGoForward()) {
|
|
1097
|
+
this._goToNextYear(true);
|
|
1098
|
+
} else if (this._view === "year" && !evt.shiftKey && this._canGoForward()) {
|
|
1099
|
+
this._goToNextSetOfYears(true);
|
|
1100
|
+
}
|
|
1101
|
+
break;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
_handleEnterOrSpaceKey(evt) {
|
|
1105
|
+
if (!shouldHandleEvent(evt, this._view, this._preventFocus)) {
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
evt.preventDefault();
|
|
1109
|
+
switch (this._view) {
|
|
1110
|
+
case "date":
|
|
1111
|
+
if (this._readonly) {
|
|
1112
|
+
break;
|
|
1113
|
+
}
|
|
1114
|
+
this._setSelectOnFocusedDate();
|
|
1115
|
+
break;
|
|
1116
|
+
case "month":
|
|
1117
|
+
case "year":
|
|
1118
|
+
this._adapter.selectFocusedMenuItem();
|
|
1119
|
+
break;
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
_onMonthSelected(month) {
|
|
1123
|
+
const yearChanged = this._year !== this._menuYear;
|
|
1124
|
+
if (yearChanged && this._menuYear !== null) {
|
|
1125
|
+
this._year = this._menuYear;
|
|
1126
|
+
this._setYear();
|
|
1127
|
+
}
|
|
1128
|
+
this._month = month;
|
|
1129
|
+
this._setMonth(true);
|
|
1130
|
+
this._trySetValueMonthAndYear(this._month, this._year, "month");
|
|
1131
|
+
this._closeMenu(true);
|
|
1132
|
+
}
|
|
1133
|
+
_onYearSelected(year) {
|
|
1134
|
+
this._year = year;
|
|
1135
|
+
this._setYear(true);
|
|
1136
|
+
this._trySetValueMonthAndYear(this._month, this._year, "year");
|
|
1137
|
+
this._closeMenu(true);
|
|
1138
|
+
}
|
|
1139
|
+
_onClearClicked() {
|
|
1140
|
+
this.clear();
|
|
1141
|
+
}
|
|
1142
|
+
_onTodayClicked() {
|
|
1143
|
+
this.today();
|
|
1144
|
+
}
|
|
1145
|
+
_trySetValueMonthAndYear(month, year, type = "date") {
|
|
1146
|
+
var _a;
|
|
1147
|
+
if (!this.selectionFollowsMonth || this._mode !== "single" || !((_a = this._value) == null ? void 0 : _a.length)) {
|
|
1148
|
+
return;
|
|
1149
|
+
}
|
|
1150
|
+
const newDate = new Date(this._value[0]);
|
|
1151
|
+
const lastDay = getMonthLength(month, year);
|
|
1152
|
+
newDate.setDate(Math.min(newDate.getDate(), lastDay));
|
|
1153
|
+
newDate.setFullYear(year);
|
|
1154
|
+
newDate.setMonth(month);
|
|
1155
|
+
if (isDisabled(newDate, this._getDisabledDateParams())) {
|
|
1156
|
+
return;
|
|
1157
|
+
}
|
|
1158
|
+
this._beforeDateSelected(newDate, type);
|
|
1159
|
+
}
|
|
1160
|
+
_setInitialDateFocus(setFocus = false) {
|
|
1161
|
+
const today = new Date();
|
|
1162
|
+
if (isInMonth(today, this._month, this._year) && !isDisabled(today, this._getDisabledDateParams(false))) {
|
|
1163
|
+
this._setFocusedDate(today, setFocus);
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
const firstDay = new Date(this._year, this._month, 1);
|
|
1167
|
+
this._setFocusedDate(this._getNextEnabledDate(firstDay, 1, false, true, true), setFocus);
|
|
1168
|
+
}
|
|
1169
|
+
_resumeTabindexOnDate(setFocus) {
|
|
1170
|
+
if (isInMonth(this._focusedDate, this._month, this._year)) {
|
|
1171
|
+
this._adapter.setActiveDate(this._focusedDate, setFocus, this._preventFocus);
|
|
1172
|
+
this._emitFocusChangeEvent(this._focusedDate);
|
|
1173
|
+
return true;
|
|
1174
|
+
}
|
|
1175
|
+
return false;
|
|
1176
|
+
}
|
|
1177
|
+
_moveFocusToNextDate(setFocus) {
|
|
1178
|
+
this._setFocusedDate(this._getNextEnabledDate(this._focusedDate), setFocus);
|
|
1179
|
+
}
|
|
1180
|
+
_moveFocusToPreviousDate(setFocus) {
|
|
1181
|
+
this._setFocusedDate(this._getPreviousEnabledDate(this._focusedDate), setFocus);
|
|
1182
|
+
}
|
|
1183
|
+
_moveFocusToNextWeek(setFocus) {
|
|
1184
|
+
this._setFocusedDate(this._getNextEnabledDate(this._focusedDate, 7, true), setFocus);
|
|
1185
|
+
}
|
|
1186
|
+
_moveFocusToPreviousWeek(setFocus) {
|
|
1187
|
+
this._setFocusedDate(this._getPreviousEnabledDate(this._focusedDate, 7, true), setFocus);
|
|
1188
|
+
}
|
|
1189
|
+
_moveFocusToFirstOfWeek(setFocus) {
|
|
1190
|
+
this._setFocusedDate(this._getFirstEnabledDayOfWeek(this._focusedDate, true), setFocus);
|
|
1191
|
+
}
|
|
1192
|
+
_moveFocusToLastOfWeek(setFocus) {
|
|
1193
|
+
this._setFocusedDate(this._getLastEnabledDayOfWeek(this._focusedDate, true), setFocus);
|
|
1194
|
+
}
|
|
1195
|
+
_moveFocusToFirstOfMonth(setFocus) {
|
|
1196
|
+
const firstOfMonth = new Date(this._year, this._month, 1);
|
|
1197
|
+
this._setFocusedDate(this._getNextEnabledDate(firstOfMonth, 1, false, true), setFocus);
|
|
1198
|
+
}
|
|
1199
|
+
_moveFocusToLastOfMonth(setFocus) {
|
|
1200
|
+
const lastOfMonth = new Date(this._year, this._month + 1, 0);
|
|
1201
|
+
this._setFocusedDate(this._getPreviousEnabledDate(lastOfMonth, 1, false, true), setFocus);
|
|
1202
|
+
}
|
|
1203
|
+
_moveFocusToNextMonth(setFocus) {
|
|
1204
|
+
const index = getIndexOfDate(this._focusedDate, this._dates);
|
|
1205
|
+
const destinationMonth = (this._month + 1) % 12;
|
|
1206
|
+
const destinationYear = destinationMonth === 0 ? this._year + 1 : this._year;
|
|
1207
|
+
this._setFocusedDate(this._getDateAtIndexInMonth(index, destinationMonth, destinationYear), setFocus);
|
|
1208
|
+
}
|
|
1209
|
+
_moveFocusToPreviousMonth(setFocus) {
|
|
1210
|
+
const index = getIndexOfDate(this._focusedDate, this._dates);
|
|
1211
|
+
const destinationMonth = this._month === 0 ? 11 : this._month - 1;
|
|
1212
|
+
const destinationYear = destinationMonth === 11 ? this._year - 1 : this._year;
|
|
1213
|
+
this._setFocusedDate(this._getDateAtIndexInMonth(index, destinationMonth, destinationYear), setFocus);
|
|
1214
|
+
}
|
|
1215
|
+
_moveFocusToNextYear(setFocus) {
|
|
1216
|
+
const index = getIndexOfDate(this._focusedDate, this._dates);
|
|
1217
|
+
this._setFocusedDate(this._getDateAtIndexInMonth(index, this._month, this._year + 1), setFocus);
|
|
1218
|
+
}
|
|
1219
|
+
_moveFocusToPreviousYear(setFocus) {
|
|
1220
|
+
const index = getIndexOfDate(this._focusedDate, this._dates);
|
|
1221
|
+
this._setFocusedDate(this._getDateAtIndexInMonth(index, this._month, this._year - 1), setFocus);
|
|
1222
|
+
}
|
|
1223
|
+
_setFocusInMonth(focus, setFocus) {
|
|
1224
|
+
switch (focus) {
|
|
1225
|
+
case 1 /* First */:
|
|
1226
|
+
this._moveFocusToFirstOfMonth(setFocus);
|
|
1227
|
+
break;
|
|
1228
|
+
case 2 /* Last */:
|
|
1229
|
+
this._moveFocusToLastOfMonth(setFocus);
|
|
1230
|
+
break;
|
|
1231
|
+
default:
|
|
1232
|
+
this._resumeTabindexOnDate(setFocus);
|
|
1233
|
+
break;
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
_setSelectOnFocusedDate() {
|
|
1237
|
+
if (isInMonth(this._focusedDate, this._month, this._year) && !isDisabled(this._focusedDate, this._getDisabledDateParams(false))) {
|
|
1238
|
+
this._beforeDateSelected(this._focusedDate);
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
_emitFocusChangeEvent(value) {
|
|
1242
|
+
const eventData = {
|
|
1243
|
+
type: this._view,
|
|
1244
|
+
value
|
|
1245
|
+
};
|
|
1246
|
+
switch (this._view) {
|
|
1247
|
+
case "date":
|
|
1248
|
+
eventData.selected = isSelected(value, this._value);
|
|
1249
|
+
eventData.text = value.toLocaleDateString(this.locale, { month: "long", day: "2-digit", year: "numeric" });
|
|
1250
|
+
break;
|
|
1251
|
+
case "month":
|
|
1252
|
+
eventData.selected = this._month === value;
|
|
1253
|
+
eventData.text = getLocalizedMonth(value, "long");
|
|
1254
|
+
break;
|
|
1255
|
+
case "year":
|
|
1256
|
+
eventData.selected = this._year === value;
|
|
1257
|
+
eventData.text = getLocalizedYear(value, "numeric");
|
|
1258
|
+
break;
|
|
1259
|
+
}
|
|
1260
|
+
this._adapter.emitHostEvent(CALENDAR_CONSTANTS.events.FOCUS_CHANGE, eventData);
|
|
1261
|
+
}
|
|
1262
|
+
_getPreviousEnabledDate(start, step = 1, stepOnce = false, includeStart = false, inMonth = false) {
|
|
1263
|
+
const disabledParams = this._getDisabledDateParams();
|
|
1264
|
+
const current = new Date(start);
|
|
1265
|
+
if (includeStart && !isDisabled(current, disabledParams)) {
|
|
1266
|
+
return current;
|
|
1267
|
+
}
|
|
1268
|
+
const month = start.getMonth();
|
|
1269
|
+
let outsideBounds = false;
|
|
1270
|
+
do {
|
|
1271
|
+
current.setDate(current.getDate() - step);
|
|
1272
|
+
if (stepOnce) {
|
|
1273
|
+
step = 1;
|
|
1274
|
+
}
|
|
1275
|
+
if (inMonth && current.getMonth() !== month || this._min && current < this._min) {
|
|
1276
|
+
outsideBounds = true;
|
|
1277
|
+
}
|
|
1278
|
+
} while (!outsideBounds && isDisabled(current, disabledParams));
|
|
1279
|
+
return outsideBounds ? null : current;
|
|
1280
|
+
}
|
|
1281
|
+
_getNextEnabledDate(start, step = 1, stepOnce = false, includeStart = false, inMonth = false) {
|
|
1282
|
+
const disabledParams = this._getDisabledDateParams();
|
|
1283
|
+
const current = new Date(start);
|
|
1284
|
+
if (includeStart && !isDisabled(current, disabledParams)) {
|
|
1285
|
+
return current;
|
|
1286
|
+
}
|
|
1287
|
+
const month = start.getMonth();
|
|
1288
|
+
let outsideBounds = false;
|
|
1289
|
+
do {
|
|
1290
|
+
current.setDate(current.getDate() + step);
|
|
1291
|
+
if (stepOnce) {
|
|
1292
|
+
step = 1;
|
|
1293
|
+
}
|
|
1294
|
+
if (inMonth && current.getMonth() !== month || this._max && current > this._max) {
|
|
1295
|
+
outsideBounds = true;
|
|
1296
|
+
}
|
|
1297
|
+
} while (!outsideBounds && isDisabled(current, disabledParams));
|
|
1298
|
+
return outsideBounds ? null : current;
|
|
1299
|
+
}
|
|
1300
|
+
_getClosestEnabledDate(start, inMonth = false, includeStart = false) {
|
|
1301
|
+
if (this._min && start < this._min) {
|
|
1302
|
+
return this._getFirstEnabledDate();
|
|
1303
|
+
} else if (this._max && start > this._max) {
|
|
1304
|
+
return this._getLastEnabledDate();
|
|
1305
|
+
}
|
|
1306
|
+
const disabledParams = this._getDisabledDateParams();
|
|
1307
|
+
if (includeStart && !isDisabled(start, disabledParams)) {
|
|
1308
|
+
return new Date(start);
|
|
1309
|
+
}
|
|
1310
|
+
const startDate = start.getDate();
|
|
1311
|
+
let current;
|
|
1312
|
+
let overMax = false;
|
|
1313
|
+
let underMin = false;
|
|
1314
|
+
let index = 1;
|
|
1315
|
+
while (!overMax || !underMin) {
|
|
1316
|
+
if (!overMax) {
|
|
1317
|
+
current = new Date(start);
|
|
1318
|
+
current.setDate(startDate + index);
|
|
1319
|
+
overMax = !isInMonth(current, start.getMonth(), start.getFullYear());
|
|
1320
|
+
if (!overMax && !isDisabled(current, disabledParams)) {
|
|
1321
|
+
return current;
|
|
1322
|
+
} else if (this._max && current > this._max) {
|
|
1323
|
+
overMax = true;
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
if (!underMin) {
|
|
1327
|
+
current = new Date(start);
|
|
1328
|
+
current.setDate(startDate - index);
|
|
1329
|
+
underMin = !isInMonth(current, start.getMonth(), start.getFullYear());
|
|
1330
|
+
if (!underMin && !isDisabled(current, disabledParams)) {
|
|
1331
|
+
return current;
|
|
1332
|
+
} else if (this._min && current < this._min) {
|
|
1333
|
+
underMin = true;
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
index += 1;
|
|
1337
|
+
}
|
|
1338
|
+
return null;
|
|
1339
|
+
}
|
|
1340
|
+
_getFirstEnabledDayOfWeek(date, inMonth = true) {
|
|
1341
|
+
const current = getFirstDateOfWeek(date);
|
|
1342
|
+
const disabledParams = this._getDisabledDateParams(inMonth ? current.getMonth() !== date.getMonth() || current.getFullYear() !== date.getFullYear() : void 0);
|
|
1343
|
+
let index = 0;
|
|
1344
|
+
while (index < 7 && isDisabled(current, disabledParams)) {
|
|
1345
|
+
current.setDate(current.getDate() + 1);
|
|
1346
|
+
disabledParams.otherMonth = inMonth ? current.getMonth() !== date.getMonth() || current.getFullYear() !== date.getFullYear() : void 0;
|
|
1347
|
+
index += 1;
|
|
1348
|
+
}
|
|
1349
|
+
return index < 7 ? current : null;
|
|
1350
|
+
}
|
|
1351
|
+
_getLastEnabledDayOfWeek(date, inMonth = true) {
|
|
1352
|
+
const current = getLastDateOfWeek(date);
|
|
1353
|
+
const disabledParams = this._getDisabledDateParams(inMonth ? current.getMonth() !== date.getMonth() || current.getFullYear() !== date.getFullYear() : void 0);
|
|
1354
|
+
let index = 0;
|
|
1355
|
+
while (index < 7 && isDisabled(current, disabledParams)) {
|
|
1356
|
+
current.setDate(current.getDate() - 1);
|
|
1357
|
+
disabledParams.otherMonth = inMonth ? current.getMonth() !== date.getMonth() || current.getFullYear() !== date.getFullYear() : void 0;
|
|
1358
|
+
index += 1;
|
|
1359
|
+
}
|
|
1360
|
+
return index < 7 ? current : null;
|
|
1361
|
+
}
|
|
1362
|
+
_getDateAtIndexInMonth(index, month, year) {
|
|
1363
|
+
var _a;
|
|
1364
|
+
const monthDates = getMonthDates(month, year, (_a = this._firstDayOfWeek) != null ? _a : this._localeFirstDayOfWeek);
|
|
1365
|
+
if (this._min && monthDates[index] < this._min) {
|
|
1366
|
+
return this._getFirstEnabledDate();
|
|
1367
|
+
} else if (this._max && monthDates[index] > this._max) {
|
|
1368
|
+
return this._getLastEnabledDate();
|
|
1369
|
+
}
|
|
1370
|
+
if (isInMonth(monthDates[index], month, year)) {
|
|
1371
|
+
return this._getClosestEnabledDate(monthDates[index], true);
|
|
1372
|
+
}
|
|
1373
|
+
return index < 20 ? this._getNextEnabledDate(monthDates[index], 7, true) : this._getPreviousEnabledDate(monthDates[index], 7, true);
|
|
1374
|
+
}
|
|
1375
|
+
_getFirstEnabledDate() {
|
|
1376
|
+
if (!this._min) {
|
|
1377
|
+
return null;
|
|
1378
|
+
}
|
|
1379
|
+
return this._getNextEnabledDate(this._min, 1, false, true);
|
|
1380
|
+
}
|
|
1381
|
+
_getLastEnabledDate() {
|
|
1382
|
+
if (!this._max) {
|
|
1383
|
+
return null;
|
|
1384
|
+
}
|
|
1385
|
+
return this._getPreviousEnabledDate(this._max, 1, false, true);
|
|
1386
|
+
}
|
|
1387
|
+
_setFocusedDate(date, setFocus) {
|
|
1388
|
+
if (!date) {
|
|
1389
|
+
return;
|
|
1390
|
+
}
|
|
1391
|
+
const monthChanged = this._month !== date.getMonth();
|
|
1392
|
+
const yearChanged = this._year !== date.getFullYear();
|
|
1393
|
+
if (monthChanged || yearChanged) {
|
|
1394
|
+
if (monthChanged) {
|
|
1395
|
+
this._month = date.getMonth();
|
|
1396
|
+
this._setMonth();
|
|
1397
|
+
}
|
|
1398
|
+
if (yearChanged) {
|
|
1399
|
+
this._year = date.getFullYear();
|
|
1400
|
+
this._setYear();
|
|
1401
|
+
}
|
|
1402
|
+
this._resetDateGrid();
|
|
1403
|
+
}
|
|
1404
|
+
this._focusedDate = date;
|
|
1405
|
+
this._adapter.setActiveDate(this._focusedDate, setFocus, this._preventFocus);
|
|
1406
|
+
this._emitFocusChangeEvent(this._focusedDate);
|
|
1407
|
+
}
|
|
1408
|
+
_getDisabledDateParams(otherMonth) {
|
|
1409
|
+
return {
|
|
1410
|
+
builder: this._disabledDateBuilder,
|
|
1411
|
+
disabledDates: this._disabledDates,
|
|
1412
|
+
disabledDaysOfWeek: this._disabledDaysOfWeek,
|
|
1413
|
+
maxDate: this._max,
|
|
1414
|
+
minDate: this._min,
|
|
1415
|
+
otherMonth
|
|
1416
|
+
};
|
|
1417
|
+
}
|
|
1418
|
+
_createDateView() {
|
|
1419
|
+
this._resetDateGrid();
|
|
1420
|
+
if (!this._focusedDate || !this._resumeTabindexOnDate(false)) {
|
|
1421
|
+
this._setInitialDateFocus();
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
_openMonthMenu(setFocus = false) {
|
|
1425
|
+
this._view = "month";
|
|
1426
|
+
if (this._menuYear === null) {
|
|
1427
|
+
this._menuYear = this._year;
|
|
1428
|
+
}
|
|
1429
|
+
if (this._showHeader) {
|
|
1430
|
+
this._setNavButtonLabels();
|
|
1431
|
+
this._adapter.setMonthButtonPressed(true);
|
|
1432
|
+
this._adapter.setYearButtonPressed(false);
|
|
1433
|
+
}
|
|
1434
|
+
this._adapter.openMenuAsGrid(this._getMonthsForMenu(), setFocus);
|
|
1435
|
+
this._adapter.setDateViewHidden(true);
|
|
1436
|
+
this._setNavigationButtonStates();
|
|
1437
|
+
this._adapter.emitHostEvent(CALENDAR_CONSTANTS.events.VIEW_CHANGE, this._view);
|
|
1438
|
+
}
|
|
1439
|
+
_openYearMenu(setFocus = false) {
|
|
1440
|
+
var _a;
|
|
1441
|
+
this._view = "year";
|
|
1442
|
+
this._menuIncludedYear = (_a = this._menuYear) != null ? _a : this._year;
|
|
1443
|
+
if (this._showHeader) {
|
|
1444
|
+
this._setNavButtonLabels();
|
|
1445
|
+
this._adapter.setMonthButtonPressed(false);
|
|
1446
|
+
this._adapter.setYearButtonPressed(true);
|
|
1447
|
+
}
|
|
1448
|
+
if (this._listYears) {
|
|
1449
|
+
this._adapter.openMenuAsList(this._getYearsForMenu(), setFocus);
|
|
1450
|
+
} else {
|
|
1451
|
+
this._adapter.openMenuAsGrid(this._getYearsForMenu(), setFocus);
|
|
1452
|
+
}
|
|
1453
|
+
this._adapter.setDateViewHidden(true);
|
|
1454
|
+
this._setNavigationButtonStates();
|
|
1455
|
+
this._adapter.emitHostEvent(CALENDAR_CONSTANTS.events.VIEW_CHANGE, this._view);
|
|
1456
|
+
}
|
|
1457
|
+
_getMonthsForMenu() {
|
|
1458
|
+
var _a;
|
|
1459
|
+
const config = {
|
|
1460
|
+
locale: this._locale,
|
|
1461
|
+
max: this._max,
|
|
1462
|
+
min: this._min,
|
|
1463
|
+
selectedMonth: this._year === this._menuYear ? this._month : -1,
|
|
1464
|
+
selectedYear: (_a = this._menuYear) != null ? _a : this._year
|
|
1465
|
+
};
|
|
1466
|
+
return getMonthOptions(config);
|
|
1467
|
+
}
|
|
1468
|
+
_getYearsForMenu() {
|
|
1469
|
+
const min = this._min ? this._min.getFullYear() : this._minYear;
|
|
1470
|
+
const max = this._max ? this._max.getFullYear() : this._maxYear;
|
|
1471
|
+
const config = {
|
|
1472
|
+
locale: this._locale,
|
|
1473
|
+
max,
|
|
1474
|
+
min,
|
|
1475
|
+
selectedYear: this._year,
|
|
1476
|
+
yearInView: this._menuIncludedYear
|
|
1477
|
+
};
|
|
1478
|
+
const options = this._listYears ? getAllYearOptions(config) : getYearOptions(config);
|
|
1479
|
+
this._menuYearsInView = { min: options[0].value, max: options[options.length - 1].value };
|
|
1480
|
+
return options;
|
|
1481
|
+
}
|
|
1482
|
+
_closeMenu(valueSelected, setFocus = false) {
|
|
1483
|
+
this._view = "date";
|
|
1484
|
+
this._menuYear = null;
|
|
1485
|
+
this._adapter.closeMenu();
|
|
1486
|
+
this._adapter.setDateViewHidden(false);
|
|
1487
|
+
this._adapter.setYear(this._year, this._locale);
|
|
1488
|
+
if (valueSelected) {
|
|
1489
|
+
this._resetDateGrid();
|
|
1490
|
+
}
|
|
1491
|
+
if (this._showHeader) {
|
|
1492
|
+
this._setNavButtonLabels();
|
|
1493
|
+
this._setNavigationButtonStates();
|
|
1494
|
+
this._adapter.setMonthButtonPressed(false);
|
|
1495
|
+
this._adapter.setYearButtonPressed(false);
|
|
1496
|
+
}
|
|
1497
|
+
if (!this._resumeTabindexOnDate(setFocus)) {
|
|
1498
|
+
this._setInitialDateFocus(setFocus);
|
|
1499
|
+
}
|
|
1500
|
+
this._adapter.emitHostEvent(CALENDAR_CONSTANTS.events.VIEW_CHANGE, this._view);
|
|
1501
|
+
}
|
|
1502
|
+
_setNavButtonLabels() {
|
|
1503
|
+
switch (this._view) {
|
|
1504
|
+
case "date":
|
|
1505
|
+
this._adapter.setPreviousButtonLabel("Previous month");
|
|
1506
|
+
this._adapter.setNextButtonLabel("Next month");
|
|
1507
|
+
break;
|
|
1508
|
+
case "month":
|
|
1509
|
+
this._adapter.setPreviousButtonLabel("Previous year");
|
|
1510
|
+
this._adapter.setNextButtonLabel("Next year");
|
|
1511
|
+
break;
|
|
1512
|
+
case "year":
|
|
1513
|
+
this._adapter.setPreviousButtonLabel("Previous years");
|
|
1514
|
+
this._adapter.setNextButtonLabel("Next years");
|
|
1515
|
+
break;
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
_resetDateGrid() {
|
|
1519
|
+
var _a;
|
|
1520
|
+
this._dates = getMonthDates(this._month, this._year, (_a = this._firstDayOfWeek) != null ? _a : this._localeFirstDayOfWeek);
|
|
1521
|
+
const dateConfigs = this._dates.map((d) => this._getDateConfig(d));
|
|
1522
|
+
this._adapter.setDates(dateConfigs, { builder: this._dateBuilder, locale: this._locale, showOtherMonths: this._showOtherMonths });
|
|
1523
|
+
this._setNavigationButtonStates();
|
|
1524
|
+
this._applyWeekendDays();
|
|
1525
|
+
this._applyEvents();
|
|
1526
|
+
if (this._mode === "range") {
|
|
1527
|
+
this._adapter.setRangeStart(this._value[0]);
|
|
1528
|
+
this._setRangePreview();
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
_getDateConfig(date) {
|
|
1532
|
+
const thisMonth = isInMonth(date, this._month, this._year);
|
|
1533
|
+
const config = {
|
|
1534
|
+
date: new Date(date),
|
|
1535
|
+
selected: isSelected(date, this._value),
|
|
1536
|
+
today: isToday(date),
|
|
1537
|
+
thisMonth,
|
|
1538
|
+
disabled: isDisabled(date, this._getDisabledDateParams(!thisMonth))
|
|
1539
|
+
};
|
|
1540
|
+
return config;
|
|
1541
|
+
}
|
|
1542
|
+
_getCalendarDate(date) {
|
|
1543
|
+
return {
|
|
1544
|
+
date: new Date(date),
|
|
1545
|
+
selected: isSelected(date, this._value),
|
|
1546
|
+
events: getEventsOnDate(date, this._events, this._eventBuilder)
|
|
1547
|
+
};
|
|
1548
|
+
}
|
|
1549
|
+
_setEventsOnDate(date) {
|
|
1550
|
+
var _a;
|
|
1551
|
+
if (!this._showOtherMonths && !isInMonth(date, this._month, this._year)) {
|
|
1552
|
+
this._adapter.setEventWrapperOnDate(date, false);
|
|
1553
|
+
return;
|
|
1554
|
+
}
|
|
1555
|
+
const events = getEventsOnDate(date, this._events, this._eventBuilder);
|
|
1556
|
+
this._adapter.setEventWrapperOnDate(date, !!events.length);
|
|
1557
|
+
events.forEach((e, i) => {
|
|
1558
|
+
if (i > 2) {
|
|
1559
|
+
return;
|
|
1560
|
+
}
|
|
1561
|
+
this._adapter.setEvent(e, i === 2 && events.length > 3);
|
|
1562
|
+
});
|
|
1563
|
+
let description = events.length ? getEventDescriptions(events) : "";
|
|
1564
|
+
if (this._tooltipBuilder) {
|
|
1565
|
+
description = (_a = this._tooltipBuilder(this._getCalendarDate(date), description)) != null ? _a : "";
|
|
1566
|
+
}
|
|
1567
|
+
this._adapter.setDateTooltip(date, description);
|
|
1568
|
+
}
|
|
1569
|
+
_beforeDateSelected(date, type = "date") {
|
|
1570
|
+
if (this._dateSelectCallback) {
|
|
1571
|
+
Promise.resolve(this._dateSelectCallback(this._getCalendarDate(date))).then((res) => {
|
|
1572
|
+
if (res) {
|
|
1573
|
+
this._onDateSelected(date, void 0, type);
|
|
1574
|
+
}
|
|
1575
|
+
});
|
|
1576
|
+
} else {
|
|
1577
|
+
this._onDateSelected(date, void 0, type);
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
_onDateSelected(date, force, type = "date") {
|
|
1581
|
+
if (this._mode === "range" && this._emitRangeSelectionEvent(date)) {
|
|
1582
|
+
this._applyRangeSelection(date);
|
|
1583
|
+
this._rangeSelectionStore = void 0;
|
|
1584
|
+
return;
|
|
1585
|
+
}
|
|
1586
|
+
const selected = isSelected(date, this._value);
|
|
1587
|
+
const event = {
|
|
1588
|
+
date: new Date(date),
|
|
1589
|
+
selected,
|
|
1590
|
+
type
|
|
1591
|
+
};
|
|
1592
|
+
const isAllowed = this._adapter.emitHostEvent(CALENDAR_CONSTANTS.events.DATE_SELECT, event, true, true);
|
|
1593
|
+
if (!isAllowed) {
|
|
1594
|
+
return;
|
|
1595
|
+
}
|
|
1596
|
+
this._rangeSelectionStore = void 0;
|
|
1597
|
+
if (this._mode === "single") {
|
|
1598
|
+
if (selected && !force || force === false) {
|
|
1599
|
+
this._deselectDate(date);
|
|
1600
|
+
} else if (force === void 0 || force === true) {
|
|
1601
|
+
if (this._value.length) {
|
|
1602
|
+
this._deselectDate(this._value[0]);
|
|
1603
|
+
}
|
|
1604
|
+
this._selectDate(date);
|
|
1605
|
+
}
|
|
1606
|
+
} else {
|
|
1607
|
+
if (selected && !force || force === false) {
|
|
1608
|
+
this._deselectDate(date);
|
|
1609
|
+
} else if (force === void 0 || force === true) {
|
|
1610
|
+
this._selectDate(date);
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
sortDates(this._value);
|
|
1614
|
+
}
|
|
1615
|
+
_emitRangeSelectionEvent(date) {
|
|
1616
|
+
const event = {
|
|
1617
|
+
date: new Date(date),
|
|
1618
|
+
selected: isSelected(date, this._value),
|
|
1619
|
+
type: "date"
|
|
1620
|
+
};
|
|
1621
|
+
switch (this._rangeSelectionState) {
|
|
1622
|
+
case "none":
|
|
1623
|
+
case "to":
|
|
1624
|
+
event.range = getDateRangeFromDates([date]);
|
|
1625
|
+
event.rangeSelectionState = "from";
|
|
1626
|
+
break;
|
|
1627
|
+
case "from":
|
|
1628
|
+
if (isSameDate(date, this._value[0])) {
|
|
1629
|
+
if (this._allowSingleDateRange) {
|
|
1630
|
+
event.range = getDateRangeFromDates([this._value[0], date]);
|
|
1631
|
+
event.rangeSelectionState = "to";
|
|
1632
|
+
} else {
|
|
1633
|
+
event.range = getDateRangeFromDates([]);
|
|
1634
|
+
event.rangeSelectionState = "none";
|
|
1635
|
+
}
|
|
1636
|
+
} else if (date < this._value[0]) {
|
|
1637
|
+
event.range = getDateRangeFromDates([date]);
|
|
1638
|
+
event.rangeSelectionState = "from";
|
|
1639
|
+
} else {
|
|
1640
|
+
event.range = getDateRangeFromDates([this._value[0], date]);
|
|
1641
|
+
event.rangeSelectionState = "to";
|
|
1642
|
+
}
|
|
1643
|
+
break;
|
|
1644
|
+
}
|
|
1645
|
+
return this._adapter.emitHostEvent(CALENDAR_CONSTANTS.events.DATE_SELECT, event, true, true);
|
|
1646
|
+
}
|
|
1647
|
+
_applyRangeSelection(date) {
|
|
1648
|
+
switch (this._rangeSelectionState) {
|
|
1649
|
+
case "none":
|
|
1650
|
+
case "to":
|
|
1651
|
+
this._deselectAllDates();
|
|
1652
|
+
this._selectDate(date);
|
|
1653
|
+
this._adapter.setRange(null);
|
|
1654
|
+
this._adapter.setRangeStart(date);
|
|
1655
|
+
this._rangeSelectionState = "from";
|
|
1656
|
+
break;
|
|
1657
|
+
case "from":
|
|
1658
|
+
if (isSameDate(date, this._value[0])) {
|
|
1659
|
+
if (this._allowSingleDateRange) {
|
|
1660
|
+
this._value.push(date);
|
|
1661
|
+
this._rangeSelectionState = "to";
|
|
1662
|
+
} else {
|
|
1663
|
+
this._deselectDate(date);
|
|
1664
|
+
this._rangeSelectionState = "none";
|
|
1665
|
+
}
|
|
1666
|
+
} else if (date < this._value[0]) {
|
|
1667
|
+
this._deselectDate(this._value[0]);
|
|
1668
|
+
this._selectDate(date);
|
|
1669
|
+
this._adapter.setRangeStart(date);
|
|
1670
|
+
} else {
|
|
1671
|
+
this._selectDate(date);
|
|
1672
|
+
this._setRangePreview(date);
|
|
1673
|
+
this._rangeSelectionState = "to";
|
|
1674
|
+
}
|
|
1675
|
+
break;
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
_setRangePreview(toDate) {
|
|
1679
|
+
switch (this._rangeSelectionState) {
|
|
1680
|
+
case "from":
|
|
1681
|
+
if (!toDate) {
|
|
1682
|
+
return;
|
|
1683
|
+
}
|
|
1684
|
+
if (toDate < this._value[0]) {
|
|
1685
|
+
this._adapter.setRange(null);
|
|
1686
|
+
} else {
|
|
1687
|
+
this._adapter.setRange(getDatesInRange(this._dates, this._value[0], toDate));
|
|
1688
|
+
this._adapter.setRangeEnd(toDate);
|
|
1689
|
+
}
|
|
1690
|
+
break;
|
|
1691
|
+
case "to":
|
|
1692
|
+
this._adapter.setRange(getDatesInRange(this._dates, this._value[0], this._value[1]));
|
|
1693
|
+
this._adapter.setRangeEnd(this._value[1]);
|
|
1694
|
+
break;
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
_clearRangePreview() {
|
|
1698
|
+
this._adapter.setRange(null);
|
|
1699
|
+
this._adapter.setRangeStart(null);
|
|
1700
|
+
this._adapter.setRangeEnd(null);
|
|
1701
|
+
}
|
|
1702
|
+
_selectDate(date) {
|
|
1703
|
+
this._value.push(date);
|
|
1704
|
+
this._focusedDate = date;
|
|
1705
|
+
this._adapter.setDateSelected(date, true);
|
|
1706
|
+
}
|
|
1707
|
+
_deselectDate(date) {
|
|
1708
|
+
const index = this._value.findIndex((d) => isSameDate(d, date));
|
|
1709
|
+
if (index > -1) {
|
|
1710
|
+
this._value.splice(index, 1);
|
|
1711
|
+
}
|
|
1712
|
+
this._adapter.setDateSelected(date, false);
|
|
1713
|
+
}
|
|
1714
|
+
_deselectAllDates() {
|
|
1715
|
+
this._value.forEach((d) => this._adapter.setDateSelected(d, false));
|
|
1716
|
+
this._clearRangePreview();
|
|
1717
|
+
this._value = [];
|
|
1718
|
+
}
|
|
1719
|
+
_goToDate(date, setFocus) {
|
|
1720
|
+
const year = date.getFullYear();
|
|
1721
|
+
const month = date.getMonth();
|
|
1722
|
+
this._focusedDate = date;
|
|
1723
|
+
if (this._year !== year || this._month !== month) {
|
|
1724
|
+
this._month = month;
|
|
1725
|
+
this._setMonth();
|
|
1726
|
+
this._year = year;
|
|
1727
|
+
this._setYear();
|
|
1728
|
+
if (this._view !== "date") {
|
|
1729
|
+
this._closeMenu(false, setFocus);
|
|
1730
|
+
} else {
|
|
1731
|
+
this._resetDateGrid();
|
|
1732
|
+
}
|
|
1733
|
+
} else if (this._view !== "date") {
|
|
1734
|
+
this._closeMenu(false, setFocus);
|
|
1735
|
+
}
|
|
1736
|
+
this._adapter.setActiveDate(date, setFocus, this._preventFocus);
|
|
1737
|
+
this._emitFocusChangeEvent(this._focusedDate);
|
|
1738
|
+
}
|
|
1739
|
+
_goToNextMonth() {
|
|
1740
|
+
if (this._month < 11) {
|
|
1741
|
+
this._month += 1;
|
|
1742
|
+
} else {
|
|
1743
|
+
this._month = 0;
|
|
1744
|
+
this._year += 1;
|
|
1745
|
+
this._setYear();
|
|
1746
|
+
}
|
|
1747
|
+
this._setMonth();
|
|
1748
|
+
this._resetDateGrid();
|
|
1749
|
+
}
|
|
1750
|
+
_goToPreviousMonth() {
|
|
1751
|
+
if (this._month > 0) {
|
|
1752
|
+
this._month -= 1;
|
|
1753
|
+
} else {
|
|
1754
|
+
this._month = 11;
|
|
1755
|
+
this._year -= 1;
|
|
1756
|
+
this._setYear();
|
|
1757
|
+
}
|
|
1758
|
+
this._setMonth();
|
|
1759
|
+
this._resetDateGrid();
|
|
1760
|
+
}
|
|
1761
|
+
_goToNextYear(setFocus = false) {
|
|
1762
|
+
if (this._view === "month") {
|
|
1763
|
+
if (this._menuYear) {
|
|
1764
|
+
this._menuYear += 1;
|
|
1765
|
+
this._setMenuYear();
|
|
1766
|
+
}
|
|
1767
|
+
this._adapter.animateIntoSelectionMenu(this._getMonthsForMenu(), this._rtl ? "left" : "right", setFocus);
|
|
1768
|
+
} else {
|
|
1769
|
+
this._year += 1;
|
|
1770
|
+
this._setYear();
|
|
1771
|
+
this._resetDateGrid();
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
_goToPreviousYear(setFocus = false) {
|
|
1775
|
+
if (this._view === "month") {
|
|
1776
|
+
if (this._menuYear) {
|
|
1777
|
+
this._menuYear -= 1;
|
|
1778
|
+
this._setMenuYear();
|
|
1779
|
+
}
|
|
1780
|
+
this._adapter.animateIntoSelectionMenu(this._getMonthsForMenu(), this._rtl ? "right" : "left", setFocus);
|
|
1781
|
+
} else {
|
|
1782
|
+
this._year -= 1;
|
|
1783
|
+
this._setYear();
|
|
1784
|
+
this._resetDateGrid();
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
_goToNextSetOfYears(setFocus = false) {
|
|
1788
|
+
this._menuIncludedYear += CALENDAR_CONSTANTS.numbers.YEARS_IN_VIEW;
|
|
1789
|
+
this._adapter.animateIntoSelectionMenu(this._getYearsForMenu(), this._rtl ? "left" : "right", setFocus);
|
|
1790
|
+
this._setNavigationButtonStates();
|
|
1791
|
+
}
|
|
1792
|
+
_goToPreviousSetOfYears(setFocus = false) {
|
|
1793
|
+
this._menuIncludedYear -= CALENDAR_CONSTANTS.numbers.YEARS_IN_VIEW;
|
|
1794
|
+
this._adapter.animateIntoSelectionMenu(this._getYearsForMenu(), this._rtl ? "right" : "left", setFocus);
|
|
1795
|
+
this._setNavigationButtonStates();
|
|
1796
|
+
}
|
|
1797
|
+
_canGoBackward(forceConstrain) {
|
|
1798
|
+
var _a;
|
|
1799
|
+
if (!forceConstrain && !this._constrainToEnabled) {
|
|
1800
|
+
return true;
|
|
1801
|
+
}
|
|
1802
|
+
switch (this._view) {
|
|
1803
|
+
case "date":
|
|
1804
|
+
return !this._min || this._min < new Date(this._year, this._month, 1);
|
|
1805
|
+
case "month":
|
|
1806
|
+
const minDateYear = (_a = this._min) == null ? void 0 : _a.getFullYear();
|
|
1807
|
+
return this._menuYear !== null && (minDateYear === void 0 || minDateYear < this._menuYear);
|
|
1808
|
+
case "year":
|
|
1809
|
+
return !!this._menuYearsInView && this._minYear < this._menuYearsInView.min;
|
|
1810
|
+
default:
|
|
1811
|
+
return false;
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
_canGoForward(forceConstrain) {
|
|
1815
|
+
var _a;
|
|
1816
|
+
if (!forceConstrain && !this._constrainToEnabled) {
|
|
1817
|
+
return true;
|
|
1818
|
+
}
|
|
1819
|
+
switch (this._view) {
|
|
1820
|
+
case "date":
|
|
1821
|
+
return !this._max || this._max > getLastDateOfMonth(this._month, this._year);
|
|
1822
|
+
case "month":
|
|
1823
|
+
const maxDateYear = (_a = this._max) == null ? void 0 : _a.getFullYear();
|
|
1824
|
+
return this._menuYear !== null && (maxDateYear === void 0 || maxDateYear > this._menuYear);
|
|
1825
|
+
case "year":
|
|
1826
|
+
return !!this._menuYearsInView && this._maxYear > this._menuYearsInView.max;
|
|
1827
|
+
default:
|
|
1828
|
+
return false;
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
_setNavigationButtonStates() {
|
|
1832
|
+
if (!this._showHeader) {
|
|
1833
|
+
return;
|
|
1834
|
+
}
|
|
1835
|
+
if (!this._constrainToEnabled) {
|
|
1836
|
+
this._adapter.setPreviousButtonDisabled(false);
|
|
1837
|
+
this._adapter.setNextButtonDisabled(false);
|
|
1838
|
+
return;
|
|
1839
|
+
}
|
|
1840
|
+
this._adapter.setPreviousButtonDisabled(!this._canGoBackward());
|
|
1841
|
+
this._adapter.setNextButtonDisabled(!this._canGoForward());
|
|
1842
|
+
}
|
|
1843
|
+
_setMonth(userSelected) {
|
|
1844
|
+
this._adapter.setMonth(this._month, this._locale);
|
|
1845
|
+
this._adapter.setHostAttribute(CALENDAR_CONSTANTS.attributes.MONTH, this._month.toString());
|
|
1846
|
+
if (this._isInitialized) {
|
|
1847
|
+
this._setNavigationButtonStates();
|
|
1848
|
+
this._adapter.emitHostEvent(CALENDAR_CONSTANTS.events.MONTH_CHANGE, { month: this._month, userSelected: userSelected != null ? userSelected : false, year: this._year });
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
_setYear(userSelected) {
|
|
1852
|
+
this._adapter.setYear(this._year, this._locale);
|
|
1853
|
+
this._adapter.setHostAttribute(CALENDAR_CONSTANTS.attributes.YEAR, this._year.toString());
|
|
1854
|
+
if (this._isInitialized) {
|
|
1855
|
+
this._setNavigationButtonStates();
|
|
1856
|
+
this._adapter.emitHostEvent(CALENDAR_CONSTANTS.events.MONTH_CHANGE, { month: this._month, userSelected: userSelected != null ? userSelected : false, year: this._year });
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
_setMenuYear() {
|
|
1860
|
+
if (this._menuYear !== null) {
|
|
1861
|
+
this._setNavigationButtonStates();
|
|
1862
|
+
this._adapter.setYear(this._menuYear, this._locale);
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
_applyAllowSingleDateRange() {
|
|
1866
|
+
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.ALLOW_SINGLE_DATE_RANGE, this._allowSingleDateRange);
|
|
1867
|
+
this._adapter.setContainerClass(CALENDAR_CONSTANTS.classes.ALLOW_SINGLE_DATE_RANGE, this._allowSingleDateRange);
|
|
1868
|
+
}
|
|
1869
|
+
_applyClearButton() {
|
|
1870
|
+
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.CLEAR_BUTTON, true, this._clearButton.toString());
|
|
1871
|
+
if (!this._clearButton) {
|
|
1872
|
+
this._adapter.unregisterClearButtonListener(this._clearButtonListener);
|
|
1873
|
+
this._adapter.removeClearButton();
|
|
1874
|
+
if (!this._todayButton) {
|
|
1875
|
+
this._adapter.removeFooter();
|
|
1876
|
+
}
|
|
1877
|
+
} else {
|
|
1878
|
+
this._adapter.setFooter();
|
|
1879
|
+
this._adapter.setClearButton();
|
|
1880
|
+
this._adapter.registerClearButtonListener(this._clearButtonListener);
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
_applyConstrainToEnabled() {
|
|
1884
|
+
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.CONSTRAIN_TO_ENABLED, true, this._constrainToEnabled.toString());
|
|
1885
|
+
if (this._isInitialized) {
|
|
1886
|
+
this._setNavigationButtonStates();
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
_applyDateBuilder() {
|
|
1890
|
+
if (this._view === "date") {
|
|
1891
|
+
this._resetDateGrid();
|
|
1892
|
+
this._resumeTabindexOnDate(false);
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
_applyDayBuilder() {
|
|
1896
|
+
var _a;
|
|
1897
|
+
this._adapter.setDays(getSortedDaysOfWeek((_a = this._firstDayOfWeek) != null ? _a : this._localeFirstDayOfWeek), { builder: this._dayBuilder, locale: this._locale });
|
|
1898
|
+
}
|
|
1899
|
+
_applyDisabledDates() {
|
|
1900
|
+
switch (this._view) {
|
|
1901
|
+
case "date":
|
|
1902
|
+
this._dates.forEach((d) => {
|
|
1903
|
+
const inMonth = isInMonth(d, this._month, this._year);
|
|
1904
|
+
const disabledParams = this._getDisabledDateParams(!inMonth);
|
|
1905
|
+
this._adapter.setDateDisabled(d, isDisabled(d, disabledParams));
|
|
1906
|
+
});
|
|
1907
|
+
break;
|
|
1908
|
+
case "month":
|
|
1909
|
+
this._openMonthMenu();
|
|
1910
|
+
break;
|
|
1911
|
+
case "year":
|
|
1912
|
+
this._openYearMenu();
|
|
1913
|
+
break;
|
|
1914
|
+
}
|
|
1915
|
+
this._setNavigationButtonStates();
|
|
1916
|
+
}
|
|
1917
|
+
_applyEvents() {
|
|
1918
|
+
if (this._view !== "date") {
|
|
1919
|
+
return;
|
|
1920
|
+
}
|
|
1921
|
+
this._dates.forEach((d) => {
|
|
1922
|
+
this._setEventsOnDate(d);
|
|
1923
|
+
});
|
|
1924
|
+
}
|
|
1925
|
+
_applyFirstDayOfWeek() {
|
|
1926
|
+
var _a, _b;
|
|
1927
|
+
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.FIRST_DAY_OF_WEEK, isDefined(this._firstDayOfWeek), ((_a = this._firstDayOfWeek) != null ? _a : 0).toString());
|
|
1928
|
+
this._adapter.setDays(getSortedDaysOfWeek((_b = this._firstDayOfWeek) != null ? _b : this._localeFirstDayOfWeek), { builder: this._dayBuilder, locale: this._locale });
|
|
1929
|
+
if (this._isInitialized && this._view === "date") {
|
|
1930
|
+
this._resetDateGrid();
|
|
1931
|
+
this._resumeTabindexOnDate(false);
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
_applyFixedHeight() {
|
|
1935
|
+
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.FIXED_HEIGHT, this._fixedHeight);
|
|
1936
|
+
this._adapter.setContainerClass(CALENDAR_CONSTANTS.classes.FIXED_HEIGHT, this._fixedHeight);
|
|
1937
|
+
}
|
|
1938
|
+
_applyListYears() {
|
|
1939
|
+
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.LIST_YEARS, this._listYears);
|
|
1940
|
+
if (this._isInitialized && this._view === "year") {
|
|
1941
|
+
this._openYearMenu();
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
_applyLocale() {
|
|
1945
|
+
var _a;
|
|
1946
|
+
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.LOCALE, !!this._locale, this._locale);
|
|
1947
|
+
this._adapter.toggleContainerAttribute(!!this._locale, "lang", this._locale);
|
|
1948
|
+
this._localeFirstDayOfWeek = getFirstDayOfWeekForLocale(this._locale);
|
|
1949
|
+
this._localeWeekendDays = getWeekendDaysForLocale(this._locale);
|
|
1950
|
+
this._applyRtl();
|
|
1951
|
+
if (this._isInitialized) {
|
|
1952
|
+
this._adapter.setMonth(this._month, this._locale);
|
|
1953
|
+
this._adapter.setYear(this._year, this._locale);
|
|
1954
|
+
switch (this._view) {
|
|
1955
|
+
case "date":
|
|
1956
|
+
this._adapter.setDays(getSortedDaysOfWeek((_a = this._firstDayOfWeek) != null ? _a : this._localeFirstDayOfWeek), { builder: this._dayBuilder, locale: this._locale });
|
|
1957
|
+
this._resetDateGrid();
|
|
1958
|
+
this._resumeTabindexOnDate(false);
|
|
1959
|
+
break;
|
|
1960
|
+
case "month":
|
|
1961
|
+
this._openMonthMenu();
|
|
1962
|
+
break;
|
|
1963
|
+
case "year":
|
|
1964
|
+
this._openYearMenu();
|
|
1965
|
+
break;
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
_applyMenuAnimation() {
|
|
1970
|
+
this._adapter.setHostAttribute(CALENDAR_CONSTANTS.attributes.MENU_ANIMATION, this._menuAnimation);
|
|
1971
|
+
this._adapter.setMenuAnimation(this._menuAnimation);
|
|
1972
|
+
}
|
|
1973
|
+
_applyMin() {
|
|
1974
|
+
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.MIN, !!this._minAttribute, this._minAttribute);
|
|
1975
|
+
if (this._isInitialized) {
|
|
1976
|
+
this._applyDisabledDates();
|
|
1977
|
+
if (this._min && this._min > this._focusedDate) {
|
|
1978
|
+
const firstEnabledDate = this._getFirstEnabledDate();
|
|
1979
|
+
if (firstEnabledDate) {
|
|
1980
|
+
this._goToDate(firstEnabledDate, false);
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
_applyMax() {
|
|
1986
|
+
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.MAX, !!this._maxAttribute, this._maxAttribute);
|
|
1987
|
+
if (this._isInitialized) {
|
|
1988
|
+
this._applyDisabledDates();
|
|
1989
|
+
if (this._max && this._max < this._focusedDate) {
|
|
1990
|
+
const lastEnabledDate = this._getLastEnabledDate();
|
|
1991
|
+
if (lastEnabledDate) {
|
|
1992
|
+
this._goToDate(lastEnabledDate, false);
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
_applyMode(oldMode) {
|
|
1998
|
+
switch (this._mode) {
|
|
1999
|
+
case "single":
|
|
2000
|
+
this._applySingleMode();
|
|
2001
|
+
break;
|
|
2002
|
+
case "multiple":
|
|
2003
|
+
this._applyMultipleMode(oldMode === "range");
|
|
2004
|
+
break;
|
|
2005
|
+
case "range":
|
|
2006
|
+
this._applyRangeMode();
|
|
2007
|
+
break;
|
|
2008
|
+
}
|
|
2009
|
+
if (this._mode !== "range") {
|
|
2010
|
+
this._rangeSelectionState = "none";
|
|
2011
|
+
this._adapter.unregisterHoverListener(this._hoverListener);
|
|
2012
|
+
this._clearRangePreview();
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2015
|
+
_applySingleMode() {
|
|
2016
|
+
this._adapter.setHostAttribute(CALENDAR_CONSTANTS.attributes.MODE, "single");
|
|
2017
|
+
this._adapter.setMultiple(false);
|
|
2018
|
+
if (this._value.length > 1) {
|
|
2019
|
+
for (let i = this._value.length - 2; i >= 0; i -= 1) {
|
|
2020
|
+
this._deselectDate(this._value[i]);
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
_applyMultipleMode(fromRange = false) {
|
|
2025
|
+
this._adapter.setHostAttribute(CALENDAR_CONSTANTS.attributes.MODE, "multiple");
|
|
2026
|
+
this._adapter.setMultiple(true);
|
|
2027
|
+
if (fromRange) {
|
|
2028
|
+
const newDates = getMultipleFromRange(this._value, this._getDisabledDateParams());
|
|
2029
|
+
this._deselectAllDates();
|
|
2030
|
+
newDates.forEach((d) => {
|
|
2031
|
+
this._selectDate(d);
|
|
2032
|
+
});
|
|
2033
|
+
}
|
|
2034
|
+
}
|
|
2035
|
+
_applyRangeMode() {
|
|
2036
|
+
var _a, _b;
|
|
2037
|
+
this._adapter.setHostAttribute(CALENDAR_CONSTANTS.attributes.MODE, "range");
|
|
2038
|
+
this._adapter.setMultiple(false);
|
|
2039
|
+
const newValue = getMinAndMaxDates(this._value);
|
|
2040
|
+
this._deselectAllDates();
|
|
2041
|
+
newValue.forEach((d) => {
|
|
2042
|
+
this._selectDate(d);
|
|
2043
|
+
});
|
|
2044
|
+
this._rangeSelectionState = this._value[0] ? this._value[1] ? "to" : "from" : "none";
|
|
2045
|
+
this._adapter.registerHoverListener(this._hoverListener);
|
|
2046
|
+
this._adapter.setRange(getDatesInRange(this._dates, this._value[0], this._value[1]));
|
|
2047
|
+
this._adapter.setRangeStart((_a = this._value[0]) != null ? _a : null);
|
|
2048
|
+
this._adapter.setRangeEnd((_b = this._value[1]) != null ? _b : null);
|
|
2049
|
+
}
|
|
2050
|
+
_applyMonth() {
|
|
2051
|
+
this._setMonth();
|
|
2052
|
+
if (this._isInitialized && this._view === "date") {
|
|
2053
|
+
this._resetDateGrid();
|
|
2054
|
+
this._moveFocusToFirstOfMonth(false);
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
_applyPreventFocus() {
|
|
2058
|
+
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.PREVENT_FOCUS, this._preventFocus);
|
|
2059
|
+
this._adapter.setContainerClass(CALENDAR_CONSTANTS.classes.PREVENT_FOCUS, this._preventFocus);
|
|
2060
|
+
this._adapter.setPreventFocusOnMenu(this._preventFocus);
|
|
2061
|
+
if (this._preventFocus) {
|
|
2062
|
+
this._adapter.registerPreventFocusListener(this._preventFocusListener);
|
|
2063
|
+
} else {
|
|
2064
|
+
this._adapter.unregisterPreventFocusListener(this._preventFocusListener);
|
|
2065
|
+
}
|
|
2066
|
+
if (this._isInitialized && this._view === "date") {
|
|
2067
|
+
this._resumeTabindexOnDate(false);
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
_applyReadOnly() {
|
|
2071
|
+
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.READONLY, this._readonly);
|
|
2072
|
+
this._adapter.toggleHostAttribute("aria-readonly", this._readonly, "true");
|
|
2073
|
+
this._adapter.setContainerClass(CALENDAR_CONSTANTS.classes.READONLY, this._readonly);
|
|
2074
|
+
if (this._readonly) {
|
|
2075
|
+
this._adapter.unregisterDateClickListener(this._dateClickListener);
|
|
2076
|
+
this._adapter.unregisterHoverListener(this._hoverListener);
|
|
2077
|
+
} else {
|
|
2078
|
+
this._adapter.registerDateClickListener(this._dateClickListener);
|
|
2079
|
+
if (this._mode === "range") {
|
|
2080
|
+
this._adapter.registerHoverListener(this._hoverListener);
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2084
|
+
_applyRtl() {
|
|
2085
|
+
this._rtl = isRtlLocale(this._locale);
|
|
2086
|
+
this._adapter.setContainerClass(CALENDAR_CONSTANTS.classes.RTL, this._rtl);
|
|
2087
|
+
this._adapter.toggleContainerAttribute(this._rtl, "dir", "rtl");
|
|
2088
|
+
}
|
|
2089
|
+
_applySelectionFollowsMonth() {
|
|
2090
|
+
this._adapter.setHostAttribute(CALENDAR_CONSTANTS.attributes.SELECTION_FOLLOWS_MONTH, this._selectionFollowsMonth.toString());
|
|
2091
|
+
}
|
|
2092
|
+
_applyShowHeader() {
|
|
2093
|
+
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.SHOW_HEADER, this._showHeader, this._showHeader.toString());
|
|
2094
|
+
if (this._showHeader) {
|
|
2095
|
+
this._adapter.setHeader();
|
|
2096
|
+
this._adapter.registerMonthButtonListener(this._monthButtonListener);
|
|
2097
|
+
this._adapter.registerNextButtonListener(this._nextButtonListener);
|
|
2098
|
+
this._adapter.registerPreviousButtonListener(this._previousButtonListener);
|
|
2099
|
+
this._adapter.registerYearButtonListener(this._yearButtonListener);
|
|
2100
|
+
this._setNavButtonLabels();
|
|
2101
|
+
} else {
|
|
2102
|
+
this._adapter.unregisterMonthButtonListener(this._monthButtonListener);
|
|
2103
|
+
this._adapter.unregisterNextButtonListener(this._nextButtonListener);
|
|
2104
|
+
this._adapter.unregisterPreviousButtonListener(this._previousButtonListener);
|
|
2105
|
+
this._adapter.unregisterYearButtonListener(this._yearButtonListener);
|
|
2106
|
+
this._adapter.removeHeader();
|
|
2107
|
+
}
|
|
2108
|
+
if (this._isInitialized) {
|
|
2109
|
+
this._adapter.setMonth(this._month, this._locale);
|
|
2110
|
+
this._adapter.setYear(this._year, this._locale);
|
|
2111
|
+
this._setNavigationButtonStates();
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
_applyShowOtherMonths() {
|
|
2115
|
+
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.SHOW_OTHER_MONTHS, this._showOtherMonths);
|
|
2116
|
+
if (this._isInitialized && this._view === "date") {
|
|
2117
|
+
let skipFinalWeek = false;
|
|
2118
|
+
this._dates.forEach((d, i) => {
|
|
2119
|
+
if (isInMonth(d, this._month, this._year)) {
|
|
2120
|
+
return;
|
|
2121
|
+
}
|
|
2122
|
+
if (i === CALENDAR_CONSTANTS.numbers.PENULTIMATE_WEEK_BEGIN_INDEX || i === CALENDAR_CONSTANTS.numbers.FINAL_WEEK_BEGIN_INDEX) {
|
|
2123
|
+
skipFinalWeek = true;
|
|
2124
|
+
}
|
|
2125
|
+
if (this._showOtherMonths && !skipFinalWeek) {
|
|
2126
|
+
this._adapter.replaceDate(this._getDateConfig(d), { builder: this._dateBuilder, locale: this._locale });
|
|
2127
|
+
} else {
|
|
2128
|
+
this._adapter.replaceDateWithSpacer(d);
|
|
2129
|
+
}
|
|
2130
|
+
this._setEventsOnDate(d);
|
|
2131
|
+
this._applyWeekendDays();
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
_applyShowToday() {
|
|
2136
|
+
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.SHOW_TODAY, this._showToday);
|
|
2137
|
+
this._adapter.setContainerClass(CALENDAR_CONSTANTS.classes.SHOW_TODAY, this._showToday);
|
|
2138
|
+
}
|
|
2139
|
+
_applyTodayButton() {
|
|
2140
|
+
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.TODAY_BUTTON, true, this._todayButton.toString());
|
|
2141
|
+
if (!this._todayButton) {
|
|
2142
|
+
this._adapter.unregisterTodayButtonListener(this._todayButtonListener);
|
|
2143
|
+
this._adapter.removeTodayButton();
|
|
2144
|
+
if (!this._clearButton) {
|
|
2145
|
+
this._adapter.removeFooter();
|
|
2146
|
+
}
|
|
2147
|
+
} else {
|
|
2148
|
+
this._adapter.setFooter();
|
|
2149
|
+
this._adapter.setTodayButton();
|
|
2150
|
+
this._adapter.registerTodayButtonListener(this._todayButtonListener);
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
_applyTooltipBuilder() {
|
|
2154
|
+
if (this._view === "date") {
|
|
2155
|
+
this._dates.forEach((d) => {
|
|
2156
|
+
var _a;
|
|
2157
|
+
if (!this._showOtherMonths && !isInMonth(d, this._month, this._year)) {
|
|
2158
|
+
return;
|
|
2159
|
+
}
|
|
2160
|
+
const events = getEventsOnDate(d, this._events, this._eventBuilder);
|
|
2161
|
+
let tooltipContent = getEventDescriptions(events);
|
|
2162
|
+
if (this._tooltipBuilder) {
|
|
2163
|
+
tooltipContent = (_a = this._tooltipBuilder(this._getCalendarDate(d), tooltipContent)) != null ? _a : "";
|
|
2164
|
+
}
|
|
2165
|
+
this._adapter.setDateTooltip(d, tooltipContent);
|
|
2166
|
+
});
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
2169
|
+
_applyWeekendDays() {
|
|
2170
|
+
var _a;
|
|
2171
|
+
const weekendDays = (_a = this._weekendDays) != null ? _a : this._localeWeekendDays;
|
|
2172
|
+
if (this._view === "date") {
|
|
2173
|
+
this._dates.forEach((d) => {
|
|
2174
|
+
const day = d.getDay();
|
|
2175
|
+
this._adapter.setWeekend(d, (this._showOtherMonths || isInMonth(d, this._month, this._year)) && weekendDays.includes(day));
|
|
2176
|
+
});
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
_applyValue(newValue) {
|
|
2180
|
+
newValue = newValue.map((d) => new Date(d));
|
|
2181
|
+
sortDates(newValue);
|
|
2182
|
+
this._deselectAllDates();
|
|
2183
|
+
newValue.forEach((d) => this._selectDate(d));
|
|
2184
|
+
if (this._mode === "range") {
|
|
2185
|
+
this._rangeSelectionState = this._value.length === 2 ? "to" : this._value.length === 1 ? "from" : "none";
|
|
2186
|
+
this._clearRangePreview();
|
|
2187
|
+
this._adapter.setRangeStart(this._value[0]);
|
|
2188
|
+
this._setRangePreview();
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
_applyView() {
|
|
2192
|
+
this._adapter.setHostAttribute(CALENDAR_CONSTANTS.attributes.VIEW, this._view);
|
|
2193
|
+
switch (this._view) {
|
|
2194
|
+
case "date":
|
|
2195
|
+
this._closeMenu();
|
|
2196
|
+
break;
|
|
2197
|
+
case "month":
|
|
2198
|
+
this._openMonthMenu();
|
|
2199
|
+
break;
|
|
2200
|
+
case "year":
|
|
2201
|
+
this._openYearMenu();
|
|
2202
|
+
break;
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
_applyYear() {
|
|
2206
|
+
this._setYear();
|
|
2207
|
+
if (this._isInitialized && this._view === "date") {
|
|
2208
|
+
this._resetDateGrid();
|
|
2209
|
+
this._moveFocusToFirstOfMonth(false);
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
_applyYearRange() {
|
|
2213
|
+
this._adapter.setHostAttribute(CALENDAR_CONSTANTS.attributes.YEAR_RANGE, this._yearRange);
|
|
2214
|
+
const range = parseYearRange(this._yearRange);
|
|
2215
|
+
this._minYear = range.min;
|
|
2216
|
+
this._maxYear = range.max;
|
|
2217
|
+
if (this._view === "year") {
|
|
2218
|
+
this._openYearMenu();
|
|
2219
|
+
this._setNavigationButtonStates();
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
get activeDate() {
|
|
2223
|
+
return new Date(this._focusedDate);
|
|
2224
|
+
}
|
|
2225
|
+
get allowSingleDateRange() {
|
|
2226
|
+
return this._allowSingleDateRange;
|
|
2227
|
+
}
|
|
2228
|
+
set allowSingleDateRange(value) {
|
|
2229
|
+
if (this._allowSingleDateRange !== value) {
|
|
2230
|
+
this._allowSingleDateRange = value;
|
|
2231
|
+
this._applyAllowSingleDateRange();
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
get clearButton() {
|
|
2235
|
+
return this._clearButton;
|
|
2236
|
+
}
|
|
2237
|
+
set clearButton(value) {
|
|
2238
|
+
if (this._clearButton !== value) {
|
|
2239
|
+
this._clearButton = value;
|
|
2240
|
+
if (this._isInitialized) {
|
|
2241
|
+
this._applyClearButton();
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
get clearCallback() {
|
|
2246
|
+
return this._clearCallback;
|
|
2247
|
+
}
|
|
2248
|
+
set clearCallback(value) {
|
|
2249
|
+
this._clearCallback = value;
|
|
2250
|
+
}
|
|
2251
|
+
get constrainToEnabled() {
|
|
2252
|
+
return this._constrainToEnabled;
|
|
2253
|
+
}
|
|
2254
|
+
set constrainToEnabled(value) {
|
|
2255
|
+
if (this._constrainToEnabled !== value) {
|
|
2256
|
+
this._constrainToEnabled = value;
|
|
2257
|
+
if (this._isInitialized) {
|
|
2258
|
+
this._applyConstrainToEnabled();
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
get dateBuilder() {
|
|
2263
|
+
return this._dateBuilder;
|
|
2264
|
+
}
|
|
2265
|
+
set dateBuilder(value) {
|
|
2266
|
+
this._dateBuilder = value;
|
|
2267
|
+
if (this._isInitialized) {
|
|
2268
|
+
this._applyDateBuilder();
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
get dateSelectCallback() {
|
|
2272
|
+
return this._dateSelectCallback;
|
|
2273
|
+
}
|
|
2274
|
+
set dateSelectCallback(value) {
|
|
2275
|
+
this._dateSelectCallback = value;
|
|
2276
|
+
}
|
|
2277
|
+
get dayBuilder() {
|
|
2278
|
+
return this.dayBuilder;
|
|
2279
|
+
}
|
|
2280
|
+
set dayBuilder(value) {
|
|
2281
|
+
this._dayBuilder = value;
|
|
2282
|
+
if (this._isInitialized) {
|
|
2283
|
+
this._applyDayBuilder();
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
get disabledDateBuilder() {
|
|
2287
|
+
return this._disabledDateBuilder;
|
|
2288
|
+
}
|
|
2289
|
+
set disabledDateBuilder(value) {
|
|
2290
|
+
this._disabledDateBuilder = value;
|
|
2291
|
+
if (this._isInitialized) {
|
|
2292
|
+
this._applyDisabledDates();
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
get disabledDates() {
|
|
2296
|
+
const dates = this._disabledDates.map((d) => new Date(d));
|
|
2297
|
+
return dates.length ? dates : null;
|
|
2298
|
+
}
|
|
2299
|
+
set disabledDates(value) {
|
|
2300
|
+
const dates = value ? isArray(value) ? value : [value] : [];
|
|
2301
|
+
this._disabledDates = dates.map((d) => {
|
|
2302
|
+
const date = new Date(d);
|
|
2303
|
+
date.setHours(0, 0, 0, 0);
|
|
2304
|
+
return date;
|
|
2305
|
+
});
|
|
2306
|
+
if (this._isInitialized) {
|
|
2307
|
+
this._applyDisabledDates();
|
|
2308
|
+
}
|
|
2309
|
+
}
|
|
2310
|
+
get disabledDaysOfWeek() {
|
|
2311
|
+
return this._disabledDaysOfWeek.length ? [...this._disabledDaysOfWeek] : null;
|
|
2312
|
+
}
|
|
2313
|
+
set disabledDaysOfWeek(value) {
|
|
2314
|
+
this._disabledDaysOfWeek = isDefined(value) ? isArray(value) ? value : [value] : [];
|
|
2315
|
+
if (this._isInitialized) {
|
|
2316
|
+
this._applyDisabledDates();
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
get eventBuilder() {
|
|
2320
|
+
return this._eventBuilder;
|
|
2321
|
+
}
|
|
2322
|
+
set eventBuilder(value) {
|
|
2323
|
+
this._eventBuilder = value;
|
|
2324
|
+
if (this._isInitialized) {
|
|
2325
|
+
this._applyEvents();
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
get events() {
|
|
2329
|
+
return this._events ? [...this._events] : null;
|
|
2330
|
+
}
|
|
2331
|
+
set events(value) {
|
|
2332
|
+
this._events = (value == null ? void 0 : value.length) ? [...value] : [];
|
|
2333
|
+
if (this._isInitialized) {
|
|
2334
|
+
this._applyEvents();
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
get firstDayOfWeek() {
|
|
2338
|
+
return this._firstDayOfWeek;
|
|
2339
|
+
}
|
|
2340
|
+
set firstDayOfWeek(value) {
|
|
2341
|
+
if (this._firstDayOfWeek !== value) {
|
|
2342
|
+
this._firstDayOfWeek = isDefined(value) ? +value : value;
|
|
2343
|
+
if (this._isInitialized) {
|
|
2344
|
+
this._applyFirstDayOfWeek();
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
get fixedHeight() {
|
|
2349
|
+
return this._fixedHeight;
|
|
2350
|
+
}
|
|
2351
|
+
set fixedHeight(value) {
|
|
2352
|
+
if (this._fixedHeight !== value) {
|
|
2353
|
+
this._fixedHeight = value;
|
|
2354
|
+
if (this._isInitialized) {
|
|
2355
|
+
this._applyFixedHeight();
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
get listYears() {
|
|
2360
|
+
return this._listYears;
|
|
2361
|
+
}
|
|
2362
|
+
set listYears(value) {
|
|
2363
|
+
if (this._listYears !== value) {
|
|
2364
|
+
this._listYears = value;
|
|
2365
|
+
this._applyListYears();
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
get locale() {
|
|
2369
|
+
return this._locale;
|
|
2370
|
+
}
|
|
2371
|
+
set locale(value) {
|
|
2372
|
+
if (typeof value === "string" && !value.length) {
|
|
2373
|
+
value = void 0;
|
|
2374
|
+
}
|
|
2375
|
+
if (this._locale !== value) {
|
|
2376
|
+
this._locale = value;
|
|
2377
|
+
if (this._isInitialized) {
|
|
2378
|
+
this._applyLocale();
|
|
2379
|
+
}
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
get max() {
|
|
2383
|
+
return this._max;
|
|
2384
|
+
}
|
|
2385
|
+
set max(value) {
|
|
2386
|
+
var _a;
|
|
2387
|
+
if (this._maxAttribute !== value) {
|
|
2388
|
+
this._maxAttribute = (_a = value == null ? void 0 : value.toString()) != null ? _a : null;
|
|
2389
|
+
this._max = coerceDateFromValue(value);
|
|
2390
|
+
this._applyMax();
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
get menuAnimation() {
|
|
2394
|
+
return this._menuAnimation;
|
|
2395
|
+
}
|
|
2396
|
+
set menuAnimation(value) {
|
|
2397
|
+
if (this._menuAnimation !== value) {
|
|
2398
|
+
this._menuAnimation = value;
|
|
2399
|
+
if (this._isInitialized) {
|
|
2400
|
+
this._applyMenuAnimation();
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
get min() {
|
|
2405
|
+
return this._min;
|
|
2406
|
+
}
|
|
2407
|
+
set min(value) {
|
|
2408
|
+
var _a;
|
|
2409
|
+
if (this._minAttribute !== value) {
|
|
2410
|
+
this._minAttribute = (_a = value == null ? void 0 : value.toString()) != null ? _a : null;
|
|
2411
|
+
this._min = coerceDateFromValue(value);
|
|
2412
|
+
this._applyMin();
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
get mode() {
|
|
2416
|
+
return this._mode;
|
|
2417
|
+
}
|
|
2418
|
+
set mode(value) {
|
|
2419
|
+
if (this._mode !== value) {
|
|
2420
|
+
const oldMode = this._mode;
|
|
2421
|
+
this._mode = value;
|
|
2422
|
+
if (this._isInitialized) {
|
|
2423
|
+
this._applyMode(oldMode);
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
get month() {
|
|
2428
|
+
return this._month;
|
|
2429
|
+
}
|
|
2430
|
+
set month(value) {
|
|
2431
|
+
if (this._month !== value) {
|
|
2432
|
+
const newValue = isNaN(+value) ? this._month : +value;
|
|
2433
|
+
if (this._month === newValue) {
|
|
2434
|
+
return;
|
|
2435
|
+
}
|
|
2436
|
+
this._month = +value;
|
|
2437
|
+
if (this._isInitialized) {
|
|
2438
|
+
this._applyMonth();
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
get preventFocus() {
|
|
2443
|
+
return this._preventFocus;
|
|
2444
|
+
}
|
|
2445
|
+
set preventFocus(value) {
|
|
2446
|
+
if (this._preventFocus !== value) {
|
|
2447
|
+
this._preventFocus = value;
|
|
2448
|
+
if (this._isInitialized) {
|
|
2449
|
+
this._applyPreventFocus();
|
|
2450
|
+
}
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
get readonly() {
|
|
2454
|
+
return this._readonly;
|
|
2455
|
+
}
|
|
2456
|
+
set readonly(value) {
|
|
2457
|
+
if (this._readonly !== value) {
|
|
2458
|
+
this._readonly = value;
|
|
2459
|
+
if (this._isInitialized) {
|
|
2460
|
+
this._applyReadOnly();
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
get selectionFollowsMonth() {
|
|
2465
|
+
return this._selectionFollowsMonth;
|
|
2466
|
+
}
|
|
2467
|
+
set selectionFollowsMonth(value) {
|
|
2468
|
+
if (this._selectionFollowsMonth !== value) {
|
|
2469
|
+
this._selectionFollowsMonth = value;
|
|
2470
|
+
if (this._isInitialized) {
|
|
2471
|
+
this._applySelectionFollowsMonth();
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
get showHeader() {
|
|
2476
|
+
return this._showHeader;
|
|
2477
|
+
}
|
|
2478
|
+
set showHeader(value) {
|
|
2479
|
+
if (this._showHeader !== value) {
|
|
2480
|
+
this._showHeader = value;
|
|
2481
|
+
if (this._isInitialized) {
|
|
2482
|
+
this._applyShowHeader();
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
get showOtherMonths() {
|
|
2487
|
+
return this._showOtherMonths;
|
|
2488
|
+
}
|
|
2489
|
+
set showOtherMonths(value) {
|
|
2490
|
+
if (this._showOtherMonths !== value) {
|
|
2491
|
+
this._showOtherMonths = value;
|
|
2492
|
+
if (this._isInitialized) {
|
|
2493
|
+
this._applyShowOtherMonths();
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
get showToday() {
|
|
2498
|
+
return this._showToday;
|
|
2499
|
+
}
|
|
2500
|
+
set showToday(value) {
|
|
2501
|
+
if (this._showToday !== value) {
|
|
2502
|
+
this._showToday = value;
|
|
2503
|
+
if (this._isInitialized) {
|
|
2504
|
+
this._applyShowToday();
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
get todayButton() {
|
|
2509
|
+
return this._todayButton;
|
|
2510
|
+
}
|
|
2511
|
+
set todayButton(value) {
|
|
2512
|
+
if (this._todayButton !== value) {
|
|
2513
|
+
this._todayButton = value;
|
|
2514
|
+
if (this._isInitialized) {
|
|
2515
|
+
this._applyTodayButton();
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2518
|
+
}
|
|
2519
|
+
get todayCallback() {
|
|
2520
|
+
return this._todayCallback;
|
|
2521
|
+
}
|
|
2522
|
+
set todayCallback(value) {
|
|
2523
|
+
this._todayCallback = value;
|
|
2524
|
+
}
|
|
2525
|
+
get tooltipBuilder() {
|
|
2526
|
+
return this._tooltipBuilder;
|
|
2527
|
+
}
|
|
2528
|
+
set tooltipBuilder(value) {
|
|
2529
|
+
this._tooltipBuilder = value;
|
|
2530
|
+
if (this._isInitialized) {
|
|
2531
|
+
this._applyTooltipBuilder();
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
get value() {
|
|
2535
|
+
var _a;
|
|
2536
|
+
if (this._mode === "range") {
|
|
2537
|
+
return (_a = this._rangeSelectionStore) != null ? _a : getDateRangeFromDates(this._value);
|
|
2538
|
+
}
|
|
2539
|
+
const dates = this._value.map((d) => new Date(d));
|
|
2540
|
+
return this._mode === "multiple" ? dates : dates.length ? dates[0] : null;
|
|
2541
|
+
}
|
|
2542
|
+
set value(value) {
|
|
2543
|
+
let dates = [];
|
|
2544
|
+
this._rangeSelectionStore = void 0;
|
|
2545
|
+
if (!value || Array.isArray(value) && !value.length) {
|
|
2546
|
+
this._value = [];
|
|
2547
|
+
} else if (Array.isArray(value)) {
|
|
2548
|
+
switch (this._mode) {
|
|
2549
|
+
case "single":
|
|
2550
|
+
dates = [value[0]];
|
|
2551
|
+
break;
|
|
2552
|
+
case "multiple":
|
|
2553
|
+
dates = value;
|
|
2554
|
+
break;
|
|
2555
|
+
case "range":
|
|
2556
|
+
const minAndMax = getMinAndMaxDates(value);
|
|
2557
|
+
dates.push(minAndMax[0]);
|
|
2558
|
+
if (minAndMax.length > 1) {
|
|
2559
|
+
dates.push(minAndMax[1]);
|
|
2560
|
+
}
|
|
2561
|
+
break;
|
|
2562
|
+
}
|
|
2563
|
+
} else if (isValidDate(new Date(value))) {
|
|
2564
|
+
dates = [value];
|
|
2565
|
+
} else {
|
|
2566
|
+
this._rangeSelectionStore = new DateRange(value);
|
|
2567
|
+
dates = getDatesFromDateRange(value);
|
|
2568
|
+
}
|
|
2569
|
+
this._applyValue(dates);
|
|
2570
|
+
}
|
|
2571
|
+
get view() {
|
|
2572
|
+
return this._view;
|
|
2573
|
+
}
|
|
2574
|
+
set view(value) {
|
|
2575
|
+
if (this._view !== value) {
|
|
2576
|
+
this._view = value;
|
|
2577
|
+
this._applyView();
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
get weekendDays() {
|
|
2581
|
+
return this._weekendDays ? [...this._weekendDays] : null;
|
|
2582
|
+
}
|
|
2583
|
+
set weekendDays(value) {
|
|
2584
|
+
var _a;
|
|
2585
|
+
this._weekendDays = (_a = value == null ? void 0 : value.map((v) => +v)) != null ? _a : null;
|
|
2586
|
+
if (this._isInitialized) {
|
|
2587
|
+
this._applyWeekendDays();
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
get year() {
|
|
2591
|
+
return this._year;
|
|
2592
|
+
}
|
|
2593
|
+
set year(value) {
|
|
2594
|
+
if (this._year !== value) {
|
|
2595
|
+
const newValue = isNaN(+value) ? this._year : +value;
|
|
2596
|
+
if (this._year === newValue) {
|
|
2597
|
+
return;
|
|
2598
|
+
}
|
|
2599
|
+
this._year = newValue;
|
|
2600
|
+
if (this._isInitialized) {
|
|
2601
|
+
this._applyYear();
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
get yearRange() {
|
|
2606
|
+
return this._yearRange;
|
|
2607
|
+
}
|
|
2608
|
+
set yearRange(value) {
|
|
2609
|
+
if (this._yearRange !== value) {
|
|
2610
|
+
this._yearRange = value;
|
|
2611
|
+
if (this._isInitialized) {
|
|
2612
|
+
this._applyYearRange();
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
clear() {
|
|
2617
|
+
this._deselectAllDates();
|
|
2618
|
+
if (this._clearCallback) {
|
|
2619
|
+
this._clearCallback();
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
deselectDate(date, setFocus) {
|
|
2623
|
+
this._onDateSelected(date, false);
|
|
2624
|
+
if (setFocus) {
|
|
2625
|
+
this._focusedDate = date;
|
|
2626
|
+
this._resumeTabindexOnDate(true);
|
|
2627
|
+
}
|
|
2628
|
+
}
|
|
2629
|
+
goToDate(date, setFocus) {
|
|
2630
|
+
this._goToDate(date, setFocus != null ? setFocus : false);
|
|
2631
|
+
}
|
|
2632
|
+
handleExternalKeyEvent(evt) {
|
|
2633
|
+
this._onKeydown(evt);
|
|
2634
|
+
}
|
|
2635
|
+
layout() {
|
|
2636
|
+
this._applyFirstDayOfWeek();
|
|
2637
|
+
this._createDateView();
|
|
2638
|
+
this._applyShowHeader();
|
|
2639
|
+
this._applyConstrainToEnabled();
|
|
2640
|
+
}
|
|
2641
|
+
selectDate(date, setFocus) {
|
|
2642
|
+
this._onDateSelected(date, true);
|
|
2643
|
+
if (setFocus) {
|
|
2644
|
+
this._focusedDate = date;
|
|
2645
|
+
this._resumeTabindexOnDate(true);
|
|
2646
|
+
}
|
|
2647
|
+
}
|
|
2648
|
+
setActiveDate(date, setFocus) {
|
|
2649
|
+
if (this._dates.some((d) => isSameDate(d, date) && (this._showOtherMonths || isInMonth(d, this._month, this._year)))) {
|
|
2650
|
+
this._goToDate(date, setFocus != null ? setFocus : false);
|
|
2651
|
+
return true;
|
|
2652
|
+
}
|
|
2653
|
+
return false;
|
|
2654
|
+
}
|
|
2655
|
+
today() {
|
|
2656
|
+
const today = new Date();
|
|
2657
|
+
today.setHours(0, 0, 0, 0);
|
|
2658
|
+
this._goToDate(today, true);
|
|
2659
|
+
if (this._todayCallback) {
|
|
2660
|
+
this._todayCallback();
|
|
2661
|
+
}
|
|
2662
|
+
}
|
|
2663
|
+
toggleDate(date, force) {
|
|
2664
|
+
this._onDateSelected(date);
|
|
2665
|
+
}
|
|
2666
|
+
};
|
|
2667
|
+
|
|
2668
|
+
// dist/build/lib/staging/src/calendar/calendar.ts
|
|
2669
|
+
var template = '<template><div class="forge-calendar" part="root"><div id="view" class="forge-calendar__view" part="view"><div id="date-view" class="forge-calendar__date-view" role="grid" part="date-view"><div role="rowgroup" part="date-view-container"><div id="day-row" class="forge-calendar__date-view__row" role="row" part="date-view-row"></div></div><div id="date-grid" class="forge-calendar__date-grid" role="rowgroup" part="date-grid-container"></div></div><forge-calendar-menu id="menu" part="calendar-menu"></forge-calendar-menu></div></div></template>';
|
|
2670
|
+
var styles = '.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:0;opacity:var(--mdc-elevation-overlay-opacity, 0);-webkit-transition:opacity 280ms cubic-bezier(.4, 0, .2, 1);transition:opacity 280ms cubic-bezier(.4, 0, .2, 1);background-color:#fff;background-color:var(--mdc-elevation-overlay-color,#fff)}.forge-button{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-button-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-button-font-size, .875rem);line-height:2.25rem;line-height:var(--mdc-typography-button-line-height, 2.25rem);font-weight:500;font-weight:var(--mdc-typography-button-font-weight,500);letter-spacing:.0892857143em;letter-spacing:var(--mdc-typography-button-letter-spacing, .0892857143em);text-decoration:none;-webkit-text-decoration:var(--mdc-typography-button-text-decoration,none);text-decoration:var(--mdc-typography-button-text-decoration,none);text-transform:uppercase;text-transform:var(--mdc-typography-button-text-transform,uppercase);position:relative;display:-webkit-inline-box;display:inline-flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;min-width:64px;border:none;outline:0;line-height:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;overflow:visible;vertical-align:middle}.forge-button .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.forge-button::-moz-focus-inner{padding:0;border:0}.forge-button:active{outline:0}.forge-button:hover{cursor:pointer}.forge-button:disabled{cursor:default;pointer-events:none}.forge-button .forge-button__icon{margin-left:0;margin-right:8px;display:inline-block;font-size:1.125rem;height:1.125rem;vertical-align:top;width:1.125rem}.forge-button .forge-button__icon[dir=rtl],[dir=rtl] .forge-button .forge-button__icon{margin-left:8px;margin-right:0}.forge-button__label~.forge-button__icon{margin-left:8px;margin-right:0}.forge-button__label~.forge-button__icon[dir=rtl],[dir=rtl] .forge-button__label~.forge-button__icon{margin-left:0;margin-right:8px}svg.forge-button__icon{fill:currentColor}.forge-button--outlined .forge-button__icon,.forge-button--raised .forge-button__icon,.forge-button--unelevated .forge-button__icon{margin-right:8px}.forge-button--outlined .forge-button__icon[dir=rtl],.forge-button--raised .forge-button__icon[dir=rtl],.forge-button--unelevated .forge-button__icon[dir=rtl],[dir=rtl] .forge-button--outlined .forge-button__icon,[dir=rtl] .forge-button--raised .forge-button__icon,[dir=rtl] .forge-button--unelevated .forge-button__icon{margin-right:-4px}.forge-button--outlined .forge-button__label~.forge-button__icon,.forge-button--raised .forge-button__label~.forge-button__icon,.forge-button--unelevated .forge-button__label~.forge-button__icon{margin-right:-4px}.forge-button--outlined .forge-button__label~.forge-button__icon[dir=rtl],.forge-button--raised .forge-button__label~.forge-button__icon[dir=rtl],.forge-button--unelevated .forge-button__label~.forge-button__icon[dir=rtl],[dir=rtl] .forge-button--outlined .forge-button__label~.forge-button__icon,[dir=rtl] .forge-button--raised .forge-button__label~.forge-button__icon,[dir=rtl] .forge-button--unelevated .forge-button__label~.forge-button__icon{margin-right:8px}@-webkit-keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@-webkit-keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@-webkit-keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}@keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.forge-button{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:transparent;will-change:transform,opacity}.forge-button .forge-button__ripple::after,.forge-button .forge-button__ripple::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.forge-button .forge-button__ripple::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.forge-button .forge-button__ripple::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.forge-button.mdc-ripple-upgraded .forge-button__ripple::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.forge-button.mdc-ripple-upgraded .forge-button__ripple::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.forge-button.mdc-ripple-upgraded--unbounded .forge-button__ripple::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.forge-button.mdc-ripple-upgraded--foreground-activation .forge-button__ripple::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.forge-button.mdc-ripple-upgraded--foreground-deactivation .forge-button__ripple::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}.forge-button .forge-button__ripple::after,.forge-button .forge-button__ripple::before{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.forge-button.mdc-ripple-upgraded .forge-button__ripple::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.forge-button .forge-button__ripple{position:absolute;-webkit-box-sizing:content-box;box-sizing:content-box;width:100%;height:100%;overflow:hidden}.forge-button:not(.forge-button--outlined) .forge-button__ripple{top:0;left:0}.forge-button--raised{box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12);-webkit-transition:-webkit-box-shadow 280ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-box-shadow 280ms cubic-bezier(.4, 0, .2, 1);transition:box-shadow 280ms cubic-bezier(.4, 0, .2, 1);transition:box-shadow 280ms cubic-bezier(.4, 0, .2, 1),-webkit-box-shadow 280ms cubic-bezier(.4, 0, .2, 1)}.forge-button--raised:focus,.forge-button--raised:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.forge-button--raised:active{box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.forge-button--raised:disabled{box-shadow:0 0 0 0 rgba(0,0,0,.2),0 0 0 0 rgba(0,0,0,.14),0 0 0 0 rgba(0,0,0,.12)}.forge-button--outlined{border-style:solid}.forge-button{height:36px;border-radius:4px;border-radius:var(--mdc-shape-small,4px);padding:0 8px 0 8px}.forge-button:not(:disabled){background-color:transparent}.forge-button:disabled{background-color:transparent}.forge-button:not(:disabled){color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-button:disabled{color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38))}.forge-button .forge-button__ripple::after,.forge-button .forge-button__ripple::before{background-color:#3f51b5;background-color:var(--mdc-ripple-color,var(--mdc-theme-primary,#3f51b5))}.forge-button.mdc-ripple-surface--hover .forge-button__ripple::before,.forge-button:hover .forge-button__ripple::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.forge-button.mdc-ripple-upgraded--background-focused .forge-button__ripple::before,.forge-button:not(.mdc-ripple-upgraded):focus .forge-button__ripple::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.forge-button:not(.mdc-ripple-upgraded) .forge-button__ripple::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-button:not(.mdc-ripple-upgraded):active .forge-button__ripple::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.forge-button.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.forge-button .forge-button__ripple{border-radius:4px;border-radius:var(--mdc-shape-small,4px)}.forge-button--unelevated{padding:0 16px 0 16px;height:36px;border-radius:4px;border-radius:var(--mdc-shape-small,4px)}.forge-button--unelevated:not(:disabled){background-color:#3f51b5;background-color:var(--mdc-theme-primary,#3f51b5)}.forge-button--unelevated:disabled{background-color:rgba(0,0,0,.12);background-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-button--unelevated:not(:disabled){color:#fff;color:var(--mdc-theme-on-primary,#fff)}.forge-button--unelevated:disabled{color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38))}.forge-button--unelevated .forge-button__ripple::after,.forge-button--unelevated .forge-button__ripple::before{background-color:#fff;background-color:var(--mdc-ripple-color,var(--mdc-theme-on-primary,#fff))}.forge-button--unelevated.mdc-ripple-surface--hover .forge-button__ripple::before,.forge-button--unelevated:hover .forge-button__ripple::before{opacity:.08;opacity:var(--mdc-ripple-hover-opacity, .08)}.forge-button--unelevated.mdc-ripple-upgraded--background-focused .forge-button__ripple::before,.forge-button--unelevated:not(.mdc-ripple-upgraded):focus .forge-button__ripple::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.24;opacity:var(--mdc-ripple-focus-opacity, .24)}.forge-button--unelevated:not(.mdc-ripple-upgraded) .forge-button__ripple::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-button--unelevated:not(.mdc-ripple-upgraded):active .forge-button__ripple::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.24;opacity:var(--mdc-ripple-press-opacity, .24)}.forge-button--unelevated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.forge-button--unelevated .forge-button__ripple{border-radius:4px;border-radius:var(--mdc-shape-small,4px)}.forge-button--raised{padding:0 16px 0 16px;height:36px;border-radius:4px;border-radius:var(--mdc-shape-small,4px)}.forge-button--raised:not(:disabled){background-color:#3f51b5;background-color:var(--mdc-theme-primary,#3f51b5)}.forge-button--raised:disabled{background-color:rgba(0,0,0,.12);background-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-button--raised:not(:disabled){color:#fff;color:var(--mdc-theme-on-primary,#fff)}.forge-button--raised:disabled{color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38))}.forge-button--raised .forge-button__ripple::after,.forge-button--raised .forge-button__ripple::before{background-color:#fff;background-color:var(--mdc-ripple-color,var(--mdc-theme-on-primary,#fff))}.forge-button--raised.mdc-ripple-surface--hover .forge-button__ripple::before,.forge-button--raised:hover .forge-button__ripple::before{opacity:.08;opacity:var(--mdc-ripple-hover-opacity, .08)}.forge-button--raised.mdc-ripple-upgraded--background-focused .forge-button__ripple::before,.forge-button--raised:not(.mdc-ripple-upgraded):focus .forge-button__ripple::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.24;opacity:var(--mdc-ripple-focus-opacity, .24)}.forge-button--raised:not(.mdc-ripple-upgraded) .forge-button__ripple::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-button--raised:not(.mdc-ripple-upgraded):active .forge-button__ripple::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.24;opacity:var(--mdc-ripple-press-opacity, .24)}.forge-button--raised.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.forge-button--raised .forge-button__ripple{border-radius:4px;border-radius:var(--mdc-shape-small,4px)}.forge-button--outlined{height:36px;border-radius:4px;border-radius:var(--mdc-shape-small,4px);padding:0 15px 0 15px;border-width:1px}.forge-button--outlined:not(:disabled){background-color:transparent}.forge-button--outlined:disabled{background-color:transparent}.forge-button--outlined:not(:disabled){color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-button--outlined:disabled{color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38))}.forge-button--outlined .forge-button__ripple::after,.forge-button--outlined .forge-button__ripple::before{background-color:#3f51b5;background-color:var(--mdc-ripple-color,var(--mdc-theme-primary,#3f51b5))}.forge-button--outlined.mdc-ripple-surface--hover .forge-button__ripple::before,.forge-button--outlined:hover .forge-button__ripple::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.forge-button--outlined.mdc-ripple-upgraded--background-focused .forge-button__ripple::before,.forge-button--outlined:not(.mdc-ripple-upgraded):focus .forge-button__ripple::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.forge-button--outlined:not(.mdc-ripple-upgraded) .forge-button__ripple::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-button--outlined:not(.mdc-ripple-upgraded):active .forge-button__ripple::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.forge-button--outlined.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.forge-button--outlined .forge-button__ripple{border-radius:4px;border-radius:var(--mdc-shape-small,4px)}.forge-button--outlined:not(:disabled){border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5)}.forge-button--outlined:disabled{border-color:rgba(0,0,0,.12);border-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-button--outlined .forge-button__ripple{top:-1px;left:-1px;border:1px solid transparent}.forge-button--dense{height:24px;margin-top:0;margin-bottom:0;height:1.5rem}forge-button{display:inline-block}forge-button[hidden]{display:none}forge-button[disabled]{cursor:not-allowed}a.forge-hyperlink{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5);text-decoration:none}a.forge-hyperlink:visited{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}a.forge-hyperlink[disabled]{pointer-events:none;cursor:default}a.forge-hyperlink:focus,a.forge-hyperlink:hover:not([disabled]){text-decoration:underline}button.forge-hyperlink{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5);cursor:pointer;border:none;background-color:transparent;font-size:inherit;padding:0;outline:0;text-align:left}button.forge-hyperlink[disabled]{pointer-events:none;cursor:default}button.forge-hyperlink:hover:not([disabled]){text-decoration:underline}.forge-icon-button{display:-webkit-inline-box;display:inline-flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;border:none;outline:0;background-color:transparent;fill:currentColor;color:inherit;font-size:24px;text-decoration:none;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:48px;height:48px;padding:12px}.forge-icon-button forge-icon,.forge-icon-button img,.forge-icon-button svg{width:24px;height:24px}.forge-icon-button:disabled{color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38))}.forge-icon-button:disabled{cursor:default;pointer-events:none}.forge-icon-button__icon{display:inline-block}.forge-icon-button__icon.forge-icon-button__icon--on{display:none}.forge-icon-button--on .forge-icon-button__icon{display:none}.forge-icon-button--on .forge-icon-button__icon.forge-icon-button__icon--on{display:inline-block}.forge-icon-button{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:transparent;will-change:transform,opacity}.forge-icon-button::after,.forge-icon-button::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.forge-icon-button::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.forge-icon-button::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.forge-icon-button.mdc-ripple-upgraded::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.forge-icon-button.mdc-ripple-upgraded::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.forge-icon-button.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.forge-icon-button.mdc-ripple-upgraded--foreground-activation::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.forge-icon-button.mdc-ripple-upgraded--foreground-deactivation::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}.forge-icon-button::after,.forge-icon-button::before{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.forge-icon-button.mdc-ripple-upgraded::after,.forge-icon-button.mdc-ripple-upgraded::before{top:var(--mdc-ripple-top,calc(50% - 50%));left:var(--mdc-ripple-left,calc(50% - 50%));width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.forge-icon-button.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.forge-icon-button::after,.forge-icon-button::before{background-color:#000;background-color:var(--mdc-ripple-color,var(--mdc-theme-on-surface,#000))}.forge-icon-button.mdc-ripple-surface--hover::before,.forge-icon-button:hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.forge-icon-button.mdc-ripple-upgraded--background-focused::before,.forge-icon-button:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.forge-icon-button:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-icon-button:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.forge-icon-button.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}forge-icon-button{position:relative;display:inline-block;overflow:visible}.forge-icon-button--on{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-icon-button--on::after,.forge-icon-button--on::before{background-color:#3f51b5;background-color:var(--mdc-ripple-color,var(--mdc-theme-primary,#3f51b5))}.forge-icon-button--on.mdc-ripple-surface--hover::before,.forge-icon-button--on:hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.forge-icon-button--on.mdc-ripple-upgraded--background-focused::before,.forge-icon-button--on:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.forge-icon-button--on:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-icon-button--on:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.forge-icon-button--on.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.forge-icon-button--on::before{background-color:#3f51b5;background-color:var(--mdc-theme-primary,#3f51b5);opacity:.08}.forge-icon-button--dense{width:28px;height:28px;padding:2px;padding:0}.forge-icon-button--dense-1{width:44px;height:44px;padding:10px}.forge-icon-button--dense-2{width:40px;height:40px;padding:8px}.forge-icon-button--dense-3{width:36px;height:36px;padding:6px}.forge-icon-button--dense-4{width:32px;height:32px;padding:4px}.forge-icon-button--dense-5{width:28px;height:28px;padding:2px}.forge-icon-button--dense-6{width:24px;height:24px;padding:0}.forge-icon-button--with-badge forge-badge{z-index:1;z-index:var(--forge-z-index-surface,1);pointer-events:none;--forge-badge-max-width:32px;--forge-badge-border:1px solid transparent}.forge-icon-button--with-badge forge-badge[app-bar-context]{--forge-badge-border:2px solid var(--forge-app-bar-theme-background)}.forge-calendar{width:100%;width:var(--forge-calendar-width,100%);height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;position:relative}.forge-calendar__header{padding:0;padding:var(--forge-calendar-controls-padding,0);display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:justify;justify-content:space-between}.forge-calendar__footer{padding:0;padding:var(--forge-calendar-controls-padding,0);display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:justify;justify-content:space-between}.forge-calendar__view{position:relative}.forge-calendar__date-view{display:block}.forge-calendar__date-view__row{display:grid;grid-template-columns:repeat(7,1fr)}.forge-calendar__date-grid{display:grid}.forge-calendar__day{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;min-width:0;padding:0;font-weight:700;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.forge-calendar__day::after{float:left;padding-top:100%;content:""}.forge-calendar__date{margin-top:2px;margin-top:var(--forge-calendar-row-gap,2px);min-width:0;padding:0;border-radius:50%;position:relative;outline:0;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.forge-calendar__date::after{float:left;padding-top:100%;content:""}.forge-calendar__date .mdc-ripple-surface{border-radius:inherit}.forge-calendar__date .mdc-ripple-surface::after,.forge-calendar__date .mdc-ripple-surface::before{position:absolute;width:calc(100% - 2px)!important;height:calc(100% - 2px)!important;top:calc(2px / 2)!important;left:calc(2px / 2)!important;border-radius:inherit!important}.forge-calendar__date__inner{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);position:absolute;width:calc(100% - 2px);height:calc(100% - 2px);top:calc(2px / 2);left:calc(2px / 2);display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;border-radius:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}.forge-calendar--show-today .forge-calendar__date--today:not([disabled]){color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5);border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5)}.forge-calendar--show-today .forge-calendar__date--today .forge-calendar__date__inner{border-color:inherit;border-width:1px;border-style:solid;font-weight:700}.forge-calendar--show-today .forge-calendar__date--today.forge-calendar__date--selected{color:#fff;color:var(--mdc-theme-on-primary,#fff)}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]){--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:transparent;cursor:pointer}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]) .mdc-ripple-surface::after,.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]) .mdc-ripple-surface::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]) .mdc-ripple-surface::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]) .mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]).mdc-ripple-upgraded .mdc-ripple-surface::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]).mdc-ripple-upgraded .mdc-ripple-surface::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]).mdc-ripple-upgraded--unbounded .mdc-ripple-surface::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]).mdc-ripple-upgraded--foreground-activation .mdc-ripple-surface::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]).mdc-ripple-upgraded--foreground-deactivation .mdc-ripple-surface::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]) .mdc-ripple-surface::after,.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]) .mdc-ripple-surface::before{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]).mdc-ripple-upgraded .mdc-ripple-surface::after,.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]).mdc-ripple-upgraded .mdc-ripple-surface::before{top:var(--mdc-ripple-top,calc(50% - 50%));left:var(--mdc-ripple-left,calc(50% - 50%));width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]).mdc-ripple-upgraded .mdc-ripple-surface::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]) .mdc-ripple-surface::after,.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]) .mdc-ripple-surface::before{background-color:#000;background-color:var(--mdc-ripple-color,var(--mdc-theme-on-surface,#000))}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]).mdc-ripple-surface--hover .mdc-ripple-surface::before,.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]):hover .mdc-ripple-surface::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]).mdc-ripple-upgraded--background-focused .mdc-ripple-surface::before,.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]):not(.mdc-ripple-upgraded):focus .mdc-ripple-surface::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]):not(.mdc-ripple-upgraded) .mdc-ripple-surface::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]):not(.mdc-ripple-upgraded):active .mdc-ripple-surface::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]).mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.forge-calendar__date--selected:not([disabled]) .forge-calendar__date__inner{background-color:#3f51b5;background-color:var(--mdc-theme-primary,#3f51b5);color:#fff;color:var(--mdc-theme-on-primary,#fff)}.forge-calendar__date--selected[disabled] .forge-calendar__date__inner{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5);color:rgba(0,0,0,.12);color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date--selected:hover .forge-calendar__date__inner{opacity:.87}.forge-calendar__date--selected.mdc-ripple-upgraded--background-focused .forge-calendar__date__inner,.forge-calendar__date--selected:focus .forge-calendar__date__inner{opacity:.54}.forge-calendar__date[disabled]{color:rgba(0,0,0,.12);color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-calendar__date-spacer{pointer-events:none}.forge-calendar--fixed-height .forge-calendar__date-spacer{margin-top:2px;margin-top:var(--forge-calendar-row-gap,2px)}.forge-calendar--fixed-height .forge-calendar__date-spacer::after{float:left;padding-top:100%;content:""}.forge-calendar__range:not(.forge-calendar__date-spacer) .forge-calendar__range__target{background-color:#3f51b5;background-color:var(--mdc-theme-primary,#3f51b5);position:absolute;width:100%;height:100%;opacity:.14;border-radius:0}.forge-calendar__range:not(.forge-calendar__date-spacer).forge-calendar__range--start .forge-calendar__range__target{border-top-left-radius:50%;border-bottom-left-radius:50%}.forge-calendar__range:not(.forge-calendar__date-spacer).forge-calendar__range--end .forge-calendar__range__target{border-top-right-radius:50%;border-bottom-right-radius:50%}.forge-calendar__range:not(.forge-calendar__range--start):first-of-type .forge-calendar__range__target{border-top-left-radius:4px;border-bottom-left-radius:4px}.forge-calendar__range:not(.forge-calendar__range--end):last-of-type .forge-calendar__range__target{border-top-right-radius:4px;border-bottom-right-radius:4px}.forge-calendar--allow-single-date-range .forge-calendar__range--start.forge-calendar__range--end .forge-calendar__range__target{-webkit-transition:-webkit-transform .2s;transition:-webkit-transform .2s;transition:transform .2s;transition:transform .2s,-webkit-transform .2s;-webkit-transform:scale(1.15);transform:scale(1.15);-webkit-transform-origin:center;transform-origin:center}.forge-calendar__event{font-size:12px;font-size:var(--forge-calendar-event-dot-size, 12px)}.forge-calendar__event[data-event-theme=primary]{color:#3f51b5;color:var(--forge-calendar-theme-event-primary-accent,#3f51b5)}.forge-calendar__event[data-event-theme=secondary]{color:#ffc107;color:var(--forge-calendar-theme-event-secondary-accent,#ffc107)}.forge-calendar__event[data-event-theme=blue]{color:#2196f3;color:var(--forge-calendar-theme-event-blue-accent,#2196f3)}.forge-calendar__event[data-event-theme=light-green]{color:#8bc34a;color:var(--forge-calendar-theme-event-light-green-accent,#8bc34a)}.forge-calendar__event[data-event-theme=cyan]{color:#00bcd4;color:var(--forge-calendar-theme-event-cyan-accent,#00bcd4)}.forge-calendar__event[data-event-theme=teal]{color:#009688;color:var(--forge-calendar-theme-event-teal-accent,#009688)}.forge-calendar__event[data-event-theme=orange]{color:#ff9800;color:var(--forge-calendar-theme-event-orange-accent,#ff9800)}.forge-calendar__event[data-event-theme=blue-grey]{color:#607d8b;color:var(--forge-calendar-theme-event-blue-grey-accent,#607d8b)}.forge-calendar__event[data-event-theme=grey]{color:#9e9e9e;color:var(--forge-calendar-theme-event-grey-accent,#9e9e9e)}.forge-calendar__event[data-event-theme=red]{color:#f44336;color:var(--forge-calendar-theme-event-red-accent,#f44336)}.forge-calendar__event[data-event-theme=pink]{color:#e91e63;color:var(--forge-calendar-theme-event-pink-accent,#e91e63)}.forge-calendar__event[data-event-theme=purple]{color:#9c27b0;color:var(--forge-calendar-theme-event-purple-accent,#9c27b0)}.forge-calendar__event[data-event-theme=light-blue]{color:#03a9f4;color:var(--forge-calendar-theme-event-light-blue-accent,#03a9f4)}.forge-calendar__event[data-event-theme=deep-purple]{color:#673ab7;color:var(--forge-calendar-theme-event-deep-purple-accent,#673ab7)}.forge-calendar__event[data-event-theme=green]{color:#4caf50;color:var(--forge-calendar-theme-event-green-accent,#4caf50)}.forge-calendar__event[data-event-theme=lime]{color:#cddc39;color:var(--forge-calendar-theme-event-lime-accent,#cddc39)}.forge-calendar__event[data-event-theme=yellow]{color:#ffeb3b;color:var(--forge-calendar-theme-event-yellow-accent,#ffeb3b)}.forge-calendar__event[data-event-theme=brown]{color:#795548;color:var(--forge-calendar-theme-event-brown-accent,#795548)}.forge-calendar__event[data-event-theme=deep-orange]{color:#ff5722;color:var(--forge-calendar-theme-event-deep-orange-accent,#ff5722)}.forge-calendar__date[disabled] .forge-calendar__event{opacity:.14}.forge-calendar__event--overflow{color:#000;color:var(--mdc-theme-on-surface,#000);background-color:var(--mdc-theme-surface);border-radius:50%}.forge-calendar__event__wrapper{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;gap:2px;position:absolute;bottom:0;left:0;width:100%;padding-bottom:2px;pointer-events:none}.forge-calendar__date-spacer .forge-calendar__event__wrapper{display:none}.forge-calendar--rtl .forge-calendar__header forge-icon-button forge-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}#accessible-header{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;outline:0;-webkit-appearance:none;-moz-appearance:none}#month-button forge-icon{-webkit-transition:-webkit-transform .2s;transition:-webkit-transform .2s;transition:transform .2s;transition:transform .2s,-webkit-transform .2s}.forge-calendar--month-menu-open #month-button forge-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}#year-button forge-icon{-webkit-transition:-webkit-transform .2s;transition:-webkit-transform .2s;transition:transform .2s;transition:transform .2s,-webkit-transform .2s}.forge-calendar--year-menu-open #year-button forge-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host{--forge-calendar-event-stroke-color:#ffffff;--forge-calendar-event-stroke-color:var(--mdc-theme-surface, #ffffff);display:inline-block}:host([hidden]){display:none}:host([forge-popup-context=true]){--forge-calendar-event-stroke-color:#ffffff;--forge-calendar-event-stroke-color:var(--forge-theme-elevated-surface, #ffffff)}';
|
|
2671
|
+
var CalendarComponent = class extends HTMLElement {
|
|
2672
|
+
constructor() {
|
|
2673
|
+
super();
|
|
2674
|
+
IconRegistry.define([tylIconKeyboardArrowLeft, tylIconKeyboardArrowRight, tylIconArrowDropDown, tylIconLens, tylIconAdd]);
|
|
2675
|
+
attachShadowTemplate(this, template, styles);
|
|
2676
|
+
this._foundation = new CalendarFoundation(new CalendarAdapter(this));
|
|
2677
|
+
}
|
|
2678
|
+
static get observedAttributes() {
|
|
2679
|
+
return [
|
|
2680
|
+
CALENDAR_CONSTANTS.attributes.ALLOW_SINGLE_DATE_RANGE,
|
|
2681
|
+
CALENDAR_CONSTANTS.attributes.CLEAR_BUTTON,
|
|
2682
|
+
CALENDAR_CONSTANTS.attributes.CONSTRAIN_TO_ENABLED,
|
|
2683
|
+
CALENDAR_CONSTANTS.attributes.FIRST_DAY_OF_WEEK,
|
|
2684
|
+
CALENDAR_CONSTANTS.attributes.FIXED_HEIGHT,
|
|
2685
|
+
CALENDAR_CONSTANTS.attributes.LIST_YEARS,
|
|
2686
|
+
CALENDAR_CONSTANTS.attributes.LOCALE,
|
|
2687
|
+
CALENDAR_CONSTANTS.attributes.MAX,
|
|
2688
|
+
CALENDAR_CONSTANTS.attributes.MENU_ANIMATION,
|
|
2689
|
+
CALENDAR_CONSTANTS.attributes.MIN,
|
|
2690
|
+
CALENDAR_CONSTANTS.attributes.MODE,
|
|
2691
|
+
CALENDAR_CONSTANTS.attributes.MONTH,
|
|
2692
|
+
CALENDAR_CONSTANTS.attributes.PREVENT_FOCUS,
|
|
2693
|
+
CALENDAR_CONSTANTS.attributes.READONLY,
|
|
2694
|
+
CALENDAR_CONSTANTS.attributes.SELECTION_FOLLOWS_MONTH,
|
|
2695
|
+
CALENDAR_CONSTANTS.attributes.SHOW_HEADER,
|
|
2696
|
+
CALENDAR_CONSTANTS.attributes.SHOW_OTHER_MONTHS,
|
|
2697
|
+
CALENDAR_CONSTANTS.attributes.SHOW_TODAY,
|
|
2698
|
+
CALENDAR_CONSTANTS.attributes.TODAY_BUTTON,
|
|
2699
|
+
CALENDAR_CONSTANTS.attributes.VIEW,
|
|
2700
|
+
CALENDAR_CONSTANTS.attributes.YEAR,
|
|
2701
|
+
CALENDAR_CONSTANTS.attributes.YEAR_RANGE
|
|
2702
|
+
];
|
|
2703
|
+
}
|
|
2704
|
+
connectedCallback() {
|
|
2705
|
+
if (!this.hasAttribute(CALENDAR_CONSTANTS.attributes.POPUP_CONTEXT) && elementParents(this).some((el) => el.tagName.toLowerCase() === "forge-popup")) {
|
|
2706
|
+
this.setAttribute(CALENDAR_CONSTANTS.attributes.POPUP_CONTEXT, "true");
|
|
2707
|
+
}
|
|
2708
|
+
this._foundation.initialize();
|
|
2709
|
+
}
|
|
2710
|
+
disconnectedCallback() {
|
|
2711
|
+
this._foundation.disconnect();
|
|
2712
|
+
}
|
|
2713
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
2714
|
+
switch (name) {
|
|
2715
|
+
case CALENDAR_CONSTANTS.attributes.ALLOW_SINGLE_DATE_RANGE:
|
|
2716
|
+
this.allowSingleDateRange = coerceBoolean(newValue);
|
|
2717
|
+
break;
|
|
2718
|
+
case CALENDAR_CONSTANTS.attributes.CLEAR_BUTTON:
|
|
2719
|
+
this.clearButton = coerceBoolean(newValue);
|
|
2720
|
+
break;
|
|
2721
|
+
case CALENDAR_CONSTANTS.attributes.CONSTRAIN_TO_ENABLED:
|
|
2722
|
+
this.constrainToEnabled = coerceBoolean(newValue);
|
|
2723
|
+
break;
|
|
2724
|
+
case CALENDAR_CONSTANTS.attributes.FIRST_DAY_OF_WEEK:
|
|
2725
|
+
this.firstDayOfWeek = coerceNumber(newValue);
|
|
2726
|
+
break;
|
|
2727
|
+
case CALENDAR_CONSTANTS.attributes.FIXED_HEIGHT:
|
|
2728
|
+
this.fixedHeight = coerceBoolean(newValue);
|
|
2729
|
+
break;
|
|
2730
|
+
case CALENDAR_CONSTANTS.attributes.LIST_YEARS:
|
|
2731
|
+
this.listYears = coerceBoolean(newValue);
|
|
2732
|
+
break;
|
|
2733
|
+
case CALENDAR_CONSTANTS.attributes.LOCALE:
|
|
2734
|
+
this.locale = newValue;
|
|
2735
|
+
break;
|
|
2736
|
+
case CALENDAR_CONSTANTS.attributes.MAX:
|
|
2737
|
+
this.max = newValue;
|
|
2738
|
+
break;
|
|
2739
|
+
case CALENDAR_CONSTANTS.attributes.MENU_ANIMATION:
|
|
2740
|
+
this.menuAnimation = newValue;
|
|
2741
|
+
break;
|
|
2742
|
+
case CALENDAR_CONSTANTS.attributes.MIN:
|
|
2743
|
+
this.min = newValue;
|
|
2744
|
+
break;
|
|
2745
|
+
case CALENDAR_CONSTANTS.attributes.MODE:
|
|
2746
|
+
this.mode = newValue;
|
|
2747
|
+
break;
|
|
2748
|
+
case CALENDAR_CONSTANTS.attributes.MONTH:
|
|
2749
|
+
this.month = coerceNumber(newValue);
|
|
2750
|
+
break;
|
|
2751
|
+
case CALENDAR_CONSTANTS.attributes.PREVENT_FOCUS:
|
|
2752
|
+
this.preventFocus = coerceBoolean(newValue);
|
|
2753
|
+
break;
|
|
2754
|
+
case CALENDAR_CONSTANTS.attributes.READONLY:
|
|
2755
|
+
this.readonly = coerceBoolean(newValue);
|
|
2756
|
+
break;
|
|
2757
|
+
case CALENDAR_CONSTANTS.attributes.SELECTION_FOLLOWS_MONTH:
|
|
2758
|
+
this.selectionFollowsMonth = coerceBoolean(newValue);
|
|
2759
|
+
break;
|
|
2760
|
+
case CALENDAR_CONSTANTS.attributes.SHOW_HEADER:
|
|
2761
|
+
this.showHeader = coerceBoolean(newValue);
|
|
2762
|
+
break;
|
|
2763
|
+
case CALENDAR_CONSTANTS.attributes.SHOW_OTHER_MONTHS:
|
|
2764
|
+
this.showOtherMonths = coerceBoolean(newValue);
|
|
2765
|
+
break;
|
|
2766
|
+
case CALENDAR_CONSTANTS.attributes.SHOW_TODAY:
|
|
2767
|
+
this.showToday = coerceBoolean(newValue);
|
|
2768
|
+
break;
|
|
2769
|
+
case CALENDAR_CONSTANTS.attributes.TODAY_BUTTON:
|
|
2770
|
+
this.todayButton = coerceBoolean(newValue);
|
|
2771
|
+
break;
|
|
2772
|
+
case CALENDAR_CONSTANTS.attributes.VIEW:
|
|
2773
|
+
this.view = newValue;
|
|
2774
|
+
break;
|
|
2775
|
+
case CALENDAR_CONSTANTS.attributes.YEAR:
|
|
2776
|
+
this.year = coerceNumber(newValue);
|
|
2777
|
+
break;
|
|
2778
|
+
case CALENDAR_CONSTANTS.attributes.YEAR_RANGE:
|
|
2779
|
+
this.yearRange = newValue;
|
|
2780
|
+
break;
|
|
2781
|
+
}
|
|
2782
|
+
}
|
|
2783
|
+
clear() {
|
|
2784
|
+
this._foundation.clear();
|
|
2785
|
+
}
|
|
2786
|
+
deselectDate(date) {
|
|
2787
|
+
this._foundation.deselectDate(new Date(date));
|
|
2788
|
+
}
|
|
2789
|
+
goToDate(date, setFocus) {
|
|
2790
|
+
this._foundation.goToDate(new Date(date), setFocus);
|
|
2791
|
+
}
|
|
2792
|
+
handleKey(evt) {
|
|
2793
|
+
this._foundation.handleExternalKeyEvent(evt);
|
|
2794
|
+
}
|
|
2795
|
+
layout() {
|
|
2796
|
+
this._foundation.layout();
|
|
2797
|
+
}
|
|
2798
|
+
selectDate(date) {
|
|
2799
|
+
this._foundation.selectDate(new Date(date));
|
|
2800
|
+
}
|
|
2801
|
+
setActiveDate(date, setFocus) {
|
|
2802
|
+
return this._foundation.setActiveDate(new Date(date), setFocus);
|
|
2803
|
+
}
|
|
2804
|
+
today() {
|
|
2805
|
+
this._foundation.today();
|
|
2806
|
+
}
|
|
2807
|
+
toggleDate(date, force) {
|
|
2808
|
+
this._foundation.toggleDate(new Date(date), force);
|
|
2809
|
+
}
|
|
2810
|
+
};
|
|
2811
|
+
__decorateClass([
|
|
2812
|
+
FoundationProperty({ set: false })
|
|
2813
|
+
], CalendarComponent.prototype, "activeDate", 2);
|
|
2814
|
+
__decorateClass([
|
|
2815
|
+
FoundationProperty()
|
|
2816
|
+
], CalendarComponent.prototype, "allowSingleDateRange", 2);
|
|
2817
|
+
__decorateClass([
|
|
2818
|
+
FoundationProperty()
|
|
2819
|
+
], CalendarComponent.prototype, "clearButton", 2);
|
|
2820
|
+
__decorateClass([
|
|
2821
|
+
FoundationProperty()
|
|
2822
|
+
], CalendarComponent.prototype, "clearCallback", 2);
|
|
2823
|
+
__decorateClass([
|
|
2824
|
+
FoundationProperty()
|
|
2825
|
+
], CalendarComponent.prototype, "constrainToEnabled", 2);
|
|
2826
|
+
__decorateClass([
|
|
2827
|
+
FoundationProperty()
|
|
2828
|
+
], CalendarComponent.prototype, "dateBuilder", 2);
|
|
2829
|
+
__decorateClass([
|
|
2830
|
+
FoundationProperty()
|
|
2831
|
+
], CalendarComponent.prototype, "dateSelectCallback", 2);
|
|
2832
|
+
__decorateClass([
|
|
2833
|
+
FoundationProperty()
|
|
2834
|
+
], CalendarComponent.prototype, "dayBuilder", 2);
|
|
2835
|
+
__decorateClass([
|
|
2836
|
+
FoundationProperty()
|
|
2837
|
+
], CalendarComponent.prototype, "disabledDateBuilder", 2);
|
|
2838
|
+
__decorateClass([
|
|
2839
|
+
FoundationProperty()
|
|
2840
|
+
], CalendarComponent.prototype, "disabledDates", 2);
|
|
2841
|
+
__decorateClass([
|
|
2842
|
+
FoundationProperty()
|
|
2843
|
+
], CalendarComponent.prototype, "disabledDaysOfWeek", 2);
|
|
2844
|
+
__decorateClass([
|
|
2845
|
+
FoundationProperty()
|
|
2846
|
+
], CalendarComponent.prototype, "eventBuilder", 2);
|
|
2847
|
+
__decorateClass([
|
|
2848
|
+
FoundationProperty()
|
|
2849
|
+
], CalendarComponent.prototype, "events", 2);
|
|
2850
|
+
__decorateClass([
|
|
2851
|
+
FoundationProperty()
|
|
2852
|
+
], CalendarComponent.prototype, "firstDayOfWeek", 2);
|
|
2853
|
+
__decorateClass([
|
|
2854
|
+
FoundationProperty()
|
|
2855
|
+
], CalendarComponent.prototype, "fixedHeight", 2);
|
|
2856
|
+
__decorateClass([
|
|
2857
|
+
FoundationProperty()
|
|
2858
|
+
], CalendarComponent.prototype, "listYears", 2);
|
|
2859
|
+
__decorateClass([
|
|
2860
|
+
FoundationProperty()
|
|
2861
|
+
], CalendarComponent.prototype, "locale", 2);
|
|
2862
|
+
__decorateClass([
|
|
2863
|
+
FoundationProperty()
|
|
2864
|
+
], CalendarComponent.prototype, "max", 2);
|
|
2865
|
+
__decorateClass([
|
|
2866
|
+
FoundationProperty()
|
|
2867
|
+
], CalendarComponent.prototype, "menuAnimation", 2);
|
|
2868
|
+
__decorateClass([
|
|
2869
|
+
FoundationProperty()
|
|
2870
|
+
], CalendarComponent.prototype, "min", 2);
|
|
2871
|
+
__decorateClass([
|
|
2872
|
+
FoundationProperty()
|
|
2873
|
+
], CalendarComponent.prototype, "mode", 2);
|
|
2874
|
+
__decorateClass([
|
|
2875
|
+
FoundationProperty()
|
|
2876
|
+
], CalendarComponent.prototype, "month", 2);
|
|
2877
|
+
__decorateClass([
|
|
2878
|
+
FoundationProperty()
|
|
2879
|
+
], CalendarComponent.prototype, "preventFocus", 2);
|
|
2880
|
+
__decorateClass([
|
|
2881
|
+
FoundationProperty()
|
|
2882
|
+
], CalendarComponent.prototype, "readonly", 2);
|
|
2883
|
+
__decorateClass([
|
|
2884
|
+
FoundationProperty()
|
|
2885
|
+
], CalendarComponent.prototype, "selectionFollowsMonth", 2);
|
|
2886
|
+
__decorateClass([
|
|
2887
|
+
FoundationProperty()
|
|
2888
|
+
], CalendarComponent.prototype, "showHeader", 2);
|
|
2889
|
+
__decorateClass([
|
|
2890
|
+
FoundationProperty()
|
|
2891
|
+
], CalendarComponent.prototype, "showOtherMonths", 2);
|
|
2892
|
+
__decorateClass([
|
|
2893
|
+
FoundationProperty()
|
|
2894
|
+
], CalendarComponent.prototype, "showToday", 2);
|
|
2895
|
+
__decorateClass([
|
|
2896
|
+
FoundationProperty()
|
|
2897
|
+
], CalendarComponent.prototype, "todayButton", 2);
|
|
2898
|
+
__decorateClass([
|
|
2899
|
+
FoundationProperty()
|
|
2900
|
+
], CalendarComponent.prototype, "todayCallback", 2);
|
|
2901
|
+
__decorateClass([
|
|
2902
|
+
FoundationProperty()
|
|
2903
|
+
], CalendarComponent.prototype, "tooltipBuilder", 2);
|
|
2904
|
+
__decorateClass([
|
|
2905
|
+
FoundationProperty()
|
|
2906
|
+
], CalendarComponent.prototype, "value", 2);
|
|
2907
|
+
__decorateClass([
|
|
2908
|
+
FoundationProperty()
|
|
2909
|
+
], CalendarComponent.prototype, "view", 2);
|
|
2910
|
+
__decorateClass([
|
|
2911
|
+
FoundationProperty()
|
|
2912
|
+
], CalendarComponent.prototype, "weekendDays", 2);
|
|
2913
|
+
__decorateClass([
|
|
2914
|
+
FoundationProperty()
|
|
2915
|
+
], CalendarComponent.prototype, "year", 2);
|
|
2916
|
+
__decorateClass([
|
|
2917
|
+
FoundationProperty()
|
|
2918
|
+
], CalendarComponent.prototype, "yearRange", 2);
|
|
2919
|
+
CalendarComponent = __decorateClass([
|
|
2920
|
+
CustomElement({
|
|
2921
|
+
name: CALENDAR_CONSTANTS.elementName,
|
|
2922
|
+
dependencies: [
|
|
2923
|
+
ButtonComponent,
|
|
2924
|
+
CalendarMenuComponent,
|
|
2925
|
+
IconButtonComponent,
|
|
2926
|
+
IconComponent,
|
|
2927
|
+
TooltipComponent
|
|
2928
|
+
]
|
|
2929
|
+
})
|
|
2930
|
+
], CalendarComponent);
|
|
2931
|
+
|
|
2932
|
+
// dist/build/lib/staging/src/calendar/calendar-component-delegate.ts
|
|
2933
|
+
var CalendarComponentDelegate = class extends BaseComponentDelegate {
|
|
2934
|
+
constructor(config) {
|
|
2935
|
+
super(config);
|
|
2936
|
+
}
|
|
2937
|
+
_build() {
|
|
2938
|
+
return document.createElement(CALENDAR_CONSTANTS.elementName);
|
|
2939
|
+
}
|
|
2940
|
+
onDateSelect(listener) {
|
|
2941
|
+
this._element.addEventListener(CALENDAR_CONSTANTS.events.DATE_SELECT, listener);
|
|
2942
|
+
}
|
|
2943
|
+
onFocusChange(listener) {
|
|
2944
|
+
this._element.addEventListener(CALENDAR_CONSTANTS.events.FOCUS_CHANGE, listener);
|
|
2945
|
+
}
|
|
2946
|
+
onMonthChange(listener) {
|
|
2947
|
+
this._element.addEventListener(CALENDAR_CONSTANTS.events.MONTH_CHANGE, listener);
|
|
2948
|
+
}
|
|
2949
|
+
onViewChange(listener) {
|
|
2950
|
+
this._element.addEventListener(CALENDAR_CONSTANTS.events.VIEW_CHANGE, listener);
|
|
2951
|
+
}
|
|
2952
|
+
};
|
|
2953
|
+
|
|
2954
|
+
// dist/build/lib/staging/src/calendar/index.ts
|
|
2955
|
+
function defineCalendarComponent() {
|
|
2956
|
+
defineCustomElement(CalendarComponent);
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
export {
|
|
2960
|
+
getMonthDates,
|
|
2961
|
+
getWeekDates,
|
|
2962
|
+
getFirstDateOfWeek,
|
|
2963
|
+
getLastDateOfWeek,
|
|
2964
|
+
getFirstDayOfMonth,
|
|
2965
|
+
getSortedDaysOfWeek,
|
|
2966
|
+
isToday,
|
|
2967
|
+
isInMonth,
|
|
2968
|
+
isInRange,
|
|
2969
|
+
sortDates,
|
|
2970
|
+
splitIntoWeeks,
|
|
2971
|
+
getDateRangeFromDates,
|
|
2972
|
+
getDatesFromDateRange,
|
|
2973
|
+
getMinAndMaxDates,
|
|
2974
|
+
getDatesInRange,
|
|
2975
|
+
getEventDescriptions,
|
|
2976
|
+
parseDateOffset,
|
|
2977
|
+
parseYearRange,
|
|
2978
|
+
getMonthOptions,
|
|
2979
|
+
getYearOptions,
|
|
2980
|
+
getAllYearOptions,
|
|
2981
|
+
isSelected,
|
|
2982
|
+
isDisabled,
|
|
2983
|
+
getIndexOfDate,
|
|
2984
|
+
getEventsOnDate,
|
|
2985
|
+
getMultipleFromRange,
|
|
2986
|
+
coerceDateFromValue,
|
|
2987
|
+
shouldHandleEvent,
|
|
2988
|
+
CalendarAdapter,
|
|
2989
|
+
CalendarFoundation,
|
|
2990
|
+
CalendarComponent,
|
|
2991
|
+
CalendarComponentDelegate,
|
|
2992
|
+
defineCalendarComponent
|
|
2993
|
+
};
|
|
2994
|
+
//# sourceMappingURL=chunk.JQQOZMKQ.js.map
|