@everymatrix/player-account-controller 1.54.11 → 1.55.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/components/GeneralLogout-BW6b3iuS.cjs +8 -0
- package/components/{GeneralLogout-BO_iHKNr.js → GeneralLogout-DMvKimEo.js} +735 -713
- package/components/{GeneralLogout-CwSCMNgW.js → GeneralLogout-GS7gE3LI.js} +610 -588
- package/components/{PlayerAccountBettingHistory-Cb8OMNy9.cjs → PlayerAccountBettingHistory-BsFzBNDY.cjs} +1 -1
- package/components/{PlayerAccountBettingHistory-BoeZFFFu.js → PlayerAccountBettingHistory-DUgPRDra.js} +24 -24
- package/components/{PlayerAccountBettingHistory-C6G8D9gE.js → PlayerAccountBettingHistory-YNLbWHxl.js} +24 -24
- package/components/{PlayerAccountBiometrics-DbzqR4YB.cjs → PlayerAccountBiometrics-BrlNlZ5N.cjs} +1 -1
- package/components/{PlayerAccountBiometrics-TQaVyCUp.js → PlayerAccountBiometrics-CARn4eVu.js} +26 -26
- package/components/{PlayerAccountBiometrics-C6n6AU67.js → PlayerAccountBiometrics-CXLK5_xT.js} +26 -26
- package/components/{PlayerAccountClosure-mb6TcNFj.js → PlayerAccountClosure-BQsYcTs7.js} +13 -13
- package/components/{PlayerAccountClosure-RO3lnj8F.js → PlayerAccountClosure-BkKcpa4J.js} +13 -13
- package/components/{PlayerAccountClosure-CoKkAlIq.cjs → PlayerAccountClosure-DfJc6Ip_.cjs} +1 -1
- package/components/{PlayerAccountController-DYgabEdS.js → PlayerAccountController-5iMZlx1a.js} +128 -128
- package/components/{PlayerAccountController-BuXBBarM.cjs → PlayerAccountController-7FPLehfk.cjs} +1 -1
- package/components/{PlayerAccountController-B1T1aFdb.js → PlayerAccountController-BhRqOpNe.js} +126 -126
- package/components/{PlayerAccountGamingLimits-Bc6vqzq1.js → PlayerAccountGamingLimits-B2-Mgazd.js} +19 -19
- package/components/{PlayerAccountGamingLimits-DbX9_Kpb.cjs → PlayerAccountGamingLimits-BPQrptbd.cjs} +1 -1
- package/components/{PlayerAccountGamingLimits-DiyC185P.js → PlayerAccountGamingLimits-DwpArRnO.js} +19 -19
- package/components/{PlayerAccountGamingLimitsConfirmationModal-BnOXTUlS.js → PlayerAccountGamingLimitsConfirmationModal-CNTlXu7V.js} +30 -30
- package/components/{PlayerAccountGamingLimitsConfirmationModal-x0MkZXMQ.js → PlayerAccountGamingLimitsConfirmationModal-DefxnTKN.js} +30 -30
- package/components/{PlayerAccountGamingLimitsConfirmationModal-CnGLRHzu.cjs → PlayerAccountGamingLimitsConfirmationModal-IgBYV9F2.cjs} +1 -1
- package/components/{PlayerAccountGamingLimitsGroupEdit-dprcKEZC.js → PlayerAccountGamingLimitsGroupEdit-CDY-ylK7.js} +51 -51
- package/components/{PlayerAccountGamingLimitsGroupEdit-Crmi-e6x.js → PlayerAccountGamingLimitsGroupEdit-Cj7PXLH2.js} +51 -51
- package/components/{PlayerAccountGamingLimitsGroupEdit-DYe0OoaG.cjs → PlayerAccountGamingLimitsGroupEdit-DrkoLne8.cjs} +2 -2
- package/components/{PlayerAccountGamingLimitsHistory2-DiAUM6kQ.js → PlayerAccountGamingLimitsHistory2-2NpX8p0k.js} +44 -44
- package/components/{PlayerAccountGamingLimitsHistory2-CS4fpWhH.cjs → PlayerAccountGamingLimitsHistory2-B_7Y0DgS.cjs} +1 -1
- package/components/{PlayerAccountGamingLimitsHistory2-Dt9CSOvf.js → PlayerAccountGamingLimitsHistory2-DF8kvIf6.js} +46 -46
- package/components/{PlayerAccountGamingLimitsInfoCard-DFsD9RSx.cjs → PlayerAccountGamingLimitsInfoCard-BOls7ahz.cjs} +1 -1
- package/components/{PlayerAccountGamingLimitsInfoCard-D9MKGXei.js → PlayerAccountGamingLimitsInfoCard-CNvQOw3A.js} +95 -95
- package/components/{PlayerAccountGamingLimitsInfoCard-Bd4vV7fT.js → PlayerAccountGamingLimitsInfoCard-D3sJXuZa.js} +95 -95
- package/components/{PlayerAccountGamingLimitsPage2Gm16-8-RWZDSp.cjs → PlayerAccountGamingLimitsPage2Gm16-BiFzgvUx.cjs} +1 -1
- package/components/{PlayerAccountGamingLimitsPage2Gm16-C9VhT1ek.js → PlayerAccountGamingLimitsPage2Gm16-C7_DGAt1.js} +72 -72
- package/components/{PlayerAccountGamingLimitsPage2Gm16-WSk66pxJ.js → PlayerAccountGamingLimitsPage2Gm16-Dz6knJ_h.js} +122 -122
- package/components/{PlayerAccountGamingLimitsPopup-C2R4OzUK.js → PlayerAccountGamingLimitsPopup-BlCz3nIH.js} +17 -17
- package/components/{PlayerAccountGamingLimitsPopup-DLqNpo7V.js → PlayerAccountGamingLimitsPopup-Bt4YlCWi.js} +17 -17
- package/components/{PlayerAccountGamingLimitsPopup-zTXU7ohP.cjs → PlayerAccountGamingLimitsPopup-ChBLdQR7.cjs} +1 -1
- package/components/{PlayerAccountGamingLimitsWrapper2-D3NmPjvT.js → PlayerAccountGamingLimitsWrapper2-D3tW5CCc.js} +8 -8
- package/components/{PlayerAccountGamingLimitsWrapper2-CXP2X7Lk.cjs → PlayerAccountGamingLimitsWrapper2-Dg6CwNyN.cjs} +1 -1
- package/components/{PlayerAccountGamingLimitsWrapper2-Cr1xbzbX.js → PlayerAccountGamingLimitsWrapper2-RnvNKSgN.js} +8 -8
- package/components/{PlayerAccountGeneralConfirmationModal-CnGS36kY.cjs → PlayerAccountGeneralConfirmationModal-BpTCzpiW.cjs} +1 -1
- package/components/{PlayerAccountGeneralConfirmationModal-BrcO0n_o.js → PlayerAccountGeneralConfirmationModal-D3u9X3Q6.js} +39 -39
- package/components/{PlayerAccountGeneralConfirmationModal-DHuSzGQn.js → PlayerAccountGeneralConfirmationModal-SjPp-PVG.js} +39 -39
- package/components/{PlayerAccountMenu-VCDFEkVV.js → PlayerAccountMenu-5esyJ_VN.js} +20 -20
- package/components/{PlayerAccountMenu-kULPvwXH.cjs → PlayerAccountMenu-C704oUrC.cjs} +1 -1
- package/components/{PlayerAccountMenu-Bnj75Pyr.js → PlayerAccountMenu-DgptA72k.js} +17 -17
- package/components/{PlayerAccountModal-BGNjm-FU.js → PlayerAccountModal-BnWL5726.js} +28 -28
- package/components/{PlayerAccountModal-DLxnK5Aq.cjs → PlayerAccountModal-C7aZZlBw.cjs} +1 -1
- package/components/{PlayerAccountModal-d2eY7pgp.js → PlayerAccountModal-CbLpkfXY.js} +28 -28
- package/components/{PlayerAccountNotifications-BkPn9o0x.js → PlayerAccountNotifications-B02Ownhe.js} +16 -16
- package/components/{PlayerAccountNotifications-DwHaboef.js → PlayerAccountNotifications-C-lyz5dM.js} +16 -16
- package/components/{PlayerAccountNotifications-DLpnh54-.cjs → PlayerAccountNotifications-DkgHtUGj.cjs} +1 -1
- package/components/PlayerAccountSelfExclusion-BS89T7sZ.cjs +4171 -0
- package/components/{PlayerAccountSelfExclusion-Dsc1c5ET.js → PlayerAccountSelfExclusion-BkK_LRpi.js} +9840 -9439
- package/components/{PlayerAccountSelfExclusion-C-Gq5xhb.js → PlayerAccountSelfExclusion-D6Kby-08.js} +9320 -8965
- package/components/{PlayerAccountTimeout-DX8TE-kL.cjs → PlayerAccountTimeout-DMbUPtRy.cjs} +1 -1
- package/components/{PlayerAccountTimeout-DPGSPm6O.js → PlayerAccountTimeout-DWNG3Mes.js} +25 -25
- package/components/{PlayerAccountTimeout-BrX6tkl3.js → PlayerAccountTimeout-tPNVqlAT.js} +25 -25
- package/components/PlayerActiveBonuses-B9jz3QD8.cjs +1 -0
- package/components/{PlayerActiveBonuses-DZ1TuekM.js → PlayerActiveBonuses-SCbHFBuw.js} +392 -443
- package/components/{PlayerActiveBonuses-WBu-rYFj.js → PlayerActiveBonuses-dRIcHoZG.js} +415 -466
- package/components/{PlayerBonusCard-BtSC36hN.js → PlayerBonusCard-8uOU9OLG.js} +50 -50
- package/components/{PlayerBonusCard-DqHyFS9o.cjs → PlayerBonusCard-BC8FfHZz.cjs} +1 -1
- package/components/{PlayerBonusCard-Ci1k7NFv.js → PlayerBonusCard-Cppd6wFF.js} +50 -50
- package/components/{PlayerBonusHistory-C7m0o7Yl.js → PlayerBonusHistory-44sPM1i7.js} +30 -30
- package/components/{PlayerBonusHistory-D-qDx10G.cjs → PlayerBonusHistory-D2YSJiqi.cjs} +1 -1
- package/components/{PlayerBonusHistory-DDNLaEBO.js → PlayerBonusHistory-DWvXjCPO.js} +30 -30
- package/components/{PlayerChangePassword-B4VW3taV.cjs → PlayerChangePassword-CzR4Xz0H.cjs} +1 -1
- package/components/{PlayerChangePassword-Bhfh3D2M.js → PlayerChangePassword-N_UEFJNT.js} +103 -103
- package/components/{PlayerChangePassword-Dk7vlEEM.js → PlayerChangePassword-OM9U8MSx.js} +103 -103
- package/components/PlayerDeposit-CwMvcnsj.js +414 -0
- package/components/PlayerDeposit-D_78W5GC.cjs +1 -0
- package/components/PlayerDeposit-Q2N0Y2_v.js +414 -0
- package/components/{PlayerGamingHistory-CaYFZtwD.js → PlayerGamingHistory-BLQD-WyT.js} +54 -54
- package/components/{PlayerGamingHistory-CcFH-mIk.cjs → PlayerGamingHistory-DRkPp9aG.cjs} +1 -1
- package/components/{PlayerGamingHistory-BPF2pyCO.js → PlayerGamingHistory-XiAb60Gu.js} +59 -59
- package/components/{PlayerPendingWithdrawals-BvhoX5n1.cjs → PlayerPendingWithdrawals-BG3I8ifu.cjs} +1 -1
- package/components/{PlayerPendingWithdrawals-DQ_Nh38H.js → PlayerPendingWithdrawals-BSTgce9H.js} +33 -33
- package/components/{PlayerPendingWithdrawals-DabTg_Hg.js → PlayerPendingWithdrawals-BsCRRPqb.js} +33 -33
- package/components/{PlayerProfileInfo-B6I2vv_G.js → PlayerProfileInfo-C7zRlD3p.js} +163 -159
- package/components/{PlayerProfileInfo-Bx9bKldG.cjs → PlayerProfileInfo-CGsJydqv.cjs} +1 -1
- package/components/{PlayerProfileInfo-Baoz1CHE.js → PlayerProfileInfo-zmbAMe_l.js} +154 -150
- package/components/{PlayerRealityCheck-6ZyJUl5U.js → PlayerRealityCheck-A_mZq3YZ.js} +27 -27
- package/components/{PlayerRealityCheck-DMI_8YfG.cjs → PlayerRealityCheck-C26ZBWae.cjs} +1 -1
- package/components/{PlayerRealityCheck-CzPyJQgR.js → PlayerRealityCheck-D7u9BzPV.js} +26 -26
- package/components/{PlayerTransactionHistory-Dj8ABxFp.cjs → PlayerTransactionHistory-CJqhYnbs.cjs} +1 -1
- package/components/{PlayerTransactionHistory-CSK3J3Na.js → PlayerTransactionHistory-DllIB_qE.js} +23 -23
- package/components/{PlayerTransactionHistory-DmTfwUdw.js → PlayerTransactionHistory-DsRmd4u6.js} +23 -23
- package/components/{PlayerWithdrawal-BrqShTsy.js → PlayerWithdrawal-CGSnHppy.js} +20 -20
- package/components/{PlayerWithdrawal-BwymNFiL.cjs → PlayerWithdrawal-GDc_7hZX.cjs} +1 -1
- package/components/{PlayerWithdrawal-ct79yXDc.js → PlayerWithdrawal-t5mlX5CD.js} +20 -20
- package/es2015/player-account-controller.cjs +1 -1
- package/es2015/player-account-controller.js +1 -1
- package/esnext/player-account-controller.js +1 -1
- package/package.json +1 -1
- package/stencil/{checkbox-group-input_9-9b62GyCW.js → checkbox-group-input_9-Cny9rOs9.js} +2490 -3376
- package/stencil/{checkbox-group-input_9-BDryW6Wx.js → checkbox-group-input_9-DZvX2H_r.js} +2434 -3306
- package/stencil/checkbox-group-input_9-FLO2Qa5Y.cjs +2104 -0
- package/stencil/{general-input-BXIgsD0E.js → general-input-Yj_LRx0v.js} +6 -6
- package/stencil/{general-input-CwyM4h8z.js → general-input-d5RULL12.js} +6 -6
- package/stencil/general-input-igTYIJ6W.cjs +1 -0
- package/stencil/index-0437c9c0-BwGFk0Yq.js +565 -0
- package/stencil/index-0437c9c0-C_oD9Yfn.js +592 -0
- package/stencil/index-0437c9c0-oCxuDVFQ.cjs +1 -0
- package/stencil/index-657e7a14-B7-RqEpB.js +572 -0
- package/stencil/index-657e7a14-CrrA_w_5.cjs +1 -0
- package/stencil/index-657e7a14-DW4SbCqy.js +588 -0
- package/stencil/index-72d2f0c7--qtpsDOz.js +642 -0
- package/stencil/index-72d2f0c7-DldCMjBJ.cjs +1 -0
- package/stencil/index-72d2f0c7-DyMEJXra.js +626 -0
- package/stencil/index-e8249896-BjtvOmsZ.cjs +1 -0
- package/stencil/index-e8249896-CM_igLvD.js +658 -0
- package/stencil/index-e8249896-DW1YiUqn.js +631 -0
- package/stencil/password-input_2-CHOu4hgw.js +1420 -0
- package/stencil/password-input_2-DQAgV1SZ.cjs +896 -0
- package/stencil/password-input_2-DaiHlKbQ.js +1420 -0
- package/stencil/{player-change-password-gm2-2de114b8-j-W8UbVm.cjs → player-change-password-gm2-780eb445-CdItmoKI.cjs} +1 -1
- package/stencil/{player-change-password-gm2-2de114b8-BXdScOXy.js → player-change-password-gm2-780eb445-Cg8Z75Vz.js} +3 -3
- package/stencil/{player-change-password-gm2-2de114b8-D375sYxZ.js → player-change-password-gm2-780eb445-DEjz9Jjk.js} +3 -3
- package/stencil/{player-change-password-gm2-DLw7pfT_.cjs → player-change-password-gm2-BR82_Y4L.cjs} +1 -1
- package/stencil/{player-change-password-gm2-BDCYchnQ.js → player-change-password-gm2-DlMNv4hv.js} +1 -1
- package/stencil/{player-change-password-gm2-CQtvRl58.js → player-change-password-gm2-FHUeecdE.js} +1 -1
- package/stencil/{player-kyc-verification-KcMUMtzd.js → player-kyc-verification-CZy8RShe.js} +43 -43
- package/stencil/{player-kyc-verification-BZX3owFI.js → player-kyc-verification-DuUII5AF.js} +39 -39
- package/stencil/{player-kyc-verification-CnOn9bB_.cjs → player-kyc-verification-DxpMnJ6t.cjs} +2 -2
- package/stencil/{toggle-checkbox-input-BqotLJuA.js → toggle-checkbox-input-Co64_7cm.js} +7 -7
- package/stencil/{toggle-checkbox-input-DFpk-vL2.js → toggle-checkbox-input-ErX2Ngat.js} +7 -7
- package/stencil/toggle-checkbox-input-a_0w-Y0n.cjs +1 -0
- package/stencil/{user-deposit-withdrawal-BZXlCCQr.cjs → user-deposit-withdrawal-Cum51n64.cjs} +2 -2
- package/stencil/{user-deposit-withdrawal-6RE0dcHP.js → user-deposit-withdrawal-DRo4MaOR.js} +24 -24
- package/stencil/{user-deposit-withdrawal-D7AuBXPO.js → user-deposit-withdrawal-DsEm--6b.js} +24 -24
- package/stencil/{user-transaction-history-DW482EoT.js → user-transaction-history-BpBJPUwq.js} +10 -10
- package/stencil/{user-transaction-history-CLdEzp7O.cjs → user-transaction-history-C3_7vgUY.cjs} +1 -1
- package/stencil/{user-transaction-history-CtDvqHoF.js → user-transaction-history-ClGHRdoQ.js} +7 -7
- package/stencil/vaadin-button-6001b2a6-C6xw53k5.cjs +3018 -0
- package/stencil/{vaadin-button-mixin-b8087c3c-DMeIIR12.js → vaadin-button-6001b2a6-CZwj1qjO.js} +5818 -5228
- package/stencil/{vaadin-button-mixin-b8087c3c-DTenw4S9.js → vaadin-button-6001b2a6-Dqz5Vp8D.js} +3935 -3299
- package/components/GeneralLogout-CMYMtWfC.cjs +0 -8
- package/components/PlayerAccountSelfExclusion-Dlkeebgy.cjs +0 -3557
- package/components/PlayerActiveBonuses-T1itpvjq.cjs +0 -1
- package/components/PlayerDeposit-B04mpHHT.js +0 -395
- package/components/PlayerDeposit-CH0pw_GN.cjs +0 -1
- package/components/PlayerDeposit-DJXOEJyq.js +0 -395
- package/stencil/checkbox-group-input_9-B0JD93gn.cjs +0 -2045
- package/stencil/general-input-BL1L8PI-.cjs +0 -1
- package/stencil/index-0a27499c-BaAMIKJI.js +0 -724
- package/stencil/index-0a27499c-DaAhyku1.js +0 -697
- package/stencil/index-0a27499c-vG7Av-0V.cjs +0 -1
- package/stencil/index-1d58b17d-BREebYgt.js +0 -658
- package/stencil/index-1d58b17d-CY3tvLdR.js +0 -631
- package/stencil/index-1d58b17d-oagDV-gC.cjs +0 -1
- package/stencil/index-45f4006f-CL2s7me-.cjs +0 -1
- package/stencil/index-45f4006f-D9GyS-vs.js +0 -638
- package/stencil/index-45f4006f-DKAxZFDZ.js +0 -654
- package/stencil/index-92b64862-Bnmv00O2.js +0 -708
- package/stencil/index-92b64862-CK1ANWGa.cjs +0 -1
- package/stencil/index-92b64862-CO3_TP5h.js +0 -692
- package/stencil/password-input_2-B5ePukhS.js +0 -569
- package/stencil/password-input_2-D3ziy4Iu.cjs +0 -105
- package/stencil/password-input_2-ZN0C3aqj.js +0 -569
- package/stencil/toggle-checkbox-input-n5b3s-CU.cjs +0 -1
- package/stencil/vaadin-button-mixin-b8087c3c-BzMgQwsM.cjs +0 -2385
|
@@ -1,2045 +0,0 @@
|
|
|
1
|
-
"use strict";var Ti=Object.defineProperty;var pt=Object.getOwnPropertySymbols;var Di=Object.prototype.hasOwnProperty,Ii=Object.prototype.propertyIsEnumerable;var Oe=(a,i,e)=>i in a?Ti(a,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[i]=e,be=(a,i)=>{for(var e in i||(i={}))Di.call(i,e)&&Oe(a,e,i[e]);if(pt)for(var e of pt(i))Ii.call(i,e)&&Oe(a,e,i[e]);return a};var L=(a,i,e)=>Oe(a,typeof i!="symbol"?i+"":i,e);var Ve=(a,i,e)=>new Promise((t,r)=>{var s=d=>{try{l(e.next(d))}catch(h){r(h)}},n=d=>{try{l(e.throw(d))}catch(h){r(h)}},l=d=>d.done?t(d.value):Promise.resolve(d.value).then(s,n);l((e=e.apply(a,i)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-92b64862-CK1ANWGa.cjs"),T=require("./locale-B5abSHU_.cjs"),K=require("./tooltipIcon-ee9760a8-Bd9l1O5C.cjs"),o=require("./vaadin-button-mixin-b8087c3c-BzMgQwsM.cjs");o.registerStyles("vaadin-checkbox",o.i$3`
|
|
2
|
-
:host {
|
|
3
|
-
color: var(--vaadin-checkbox-label-color, var(--lumo-body-text-color));
|
|
4
|
-
font-size: var(--vaadin-checkbox-label-font-size, var(--lumo-font-size-m));
|
|
5
|
-
font-family: var(--lumo-font-family);
|
|
6
|
-
line-height: var(--lumo-line-height-s);
|
|
7
|
-
-webkit-font-smoothing: antialiased;
|
|
8
|
-
-moz-osx-font-smoothing: grayscale;
|
|
9
|
-
-webkit-tap-highlight-color: transparent;
|
|
10
|
-
-webkit-user-select: none;
|
|
11
|
-
-moz-user-select: none;
|
|
12
|
-
user-select: none;
|
|
13
|
-
cursor: default;
|
|
14
|
-
outline: none;
|
|
15
|
-
--_checkbox-size: var(--vaadin-checkbox-size, calc(var(--lumo-size-m) / 2));
|
|
16
|
-
--_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
|
|
17
|
-
--_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
|
|
18
|
-
--_selection-color: var(--vaadin-selection-color, var(--lumo-primary-color));
|
|
19
|
-
--_invalid-background: var(--vaadin-input-field-invalid-background, var(--lumo-error-color-10pct));
|
|
20
|
-
--_disabled-checkmark-color: var(--vaadin-checkbox-disabled-checkmark-color, var(--lumo-contrast-30pct));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
[part='label'] {
|
|
24
|
-
display: flex;
|
|
25
|
-
position: relative;
|
|
26
|
-
max-width: max-content;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
:host([has-label]) ::slotted(label) {
|
|
30
|
-
padding: var(
|
|
31
|
-
--vaadin-checkbox-label-padding,
|
|
32
|
-
var(--lumo-space-xs) var(--lumo-space-s) var(--lumo-space-xs) var(--lumo-space-xs)
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
:host([dir='rtl'][has-label]) ::slotted(label) {
|
|
37
|
-
padding: var(--lumo-space-xs) var(--lumo-space-xs) var(--lumo-space-xs) var(--lumo-space-s);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
:host([has-label][required]) ::slotted(label) {
|
|
41
|
-
padding-inline-end: var(--lumo-space-m);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
[part='checkbox'] {
|
|
45
|
-
width: var(--_checkbox-size);
|
|
46
|
-
height: var(--_checkbox-size);
|
|
47
|
-
margin: var(--lumo-space-xs);
|
|
48
|
-
position: relative;
|
|
49
|
-
border-radius: var(--vaadin-checkbox-border-radius, var(--lumo-border-radius-s));
|
|
50
|
-
background: var(--vaadin-checkbox-background, var(--lumo-contrast-20pct));
|
|
51
|
-
transition:
|
|
52
|
-
transform 0.2s cubic-bezier(0.12, 0.32, 0.54, 2),
|
|
53
|
-
background-color 0.15s;
|
|
54
|
-
cursor: var(--lumo-clickable-cursor);
|
|
55
|
-
/* Default field border color */
|
|
56
|
-
--_input-border-color: var(--vaadin-input-field-border-color, var(--lumo-contrast-50pct));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
:host([indeterminate]),
|
|
60
|
-
:host([checked]) {
|
|
61
|
-
--vaadin-input-field-border-color: transparent;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
:host([indeterminate]) [part='checkbox'],
|
|
65
|
-
:host([checked]) [part='checkbox'] {
|
|
66
|
-
background-color: var(--_selection-color);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/* Checkmark */
|
|
70
|
-
[part='checkbox']::after {
|
|
71
|
-
pointer-events: none;
|
|
72
|
-
font-family: 'lumo-icons';
|
|
73
|
-
content: var(--vaadin-checkbox-checkmark-char, var(--lumo-icons-checkmark));
|
|
74
|
-
color: var(--vaadin-checkbox-checkmark-color, var(--lumo-primary-contrast-color));
|
|
75
|
-
font-size: var(--vaadin-checkbox-checkmark-size, calc(var(--_checkbox-size) + 2px));
|
|
76
|
-
line-height: 1;
|
|
77
|
-
position: absolute;
|
|
78
|
-
top: -1px;
|
|
79
|
-
left: -1px;
|
|
80
|
-
contain: content;
|
|
81
|
-
opacity: 0;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
:host([checked]) [part='checkbox']::after {
|
|
85
|
-
opacity: 1;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
:host([readonly]:not([checked]):not([indeterminate])) {
|
|
89
|
-
color: var(--lumo-secondary-text-color);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
:host([readonly]:not([checked]):not([indeterminate])) [part='checkbox'] {
|
|
93
|
-
background: transparent;
|
|
94
|
-
box-shadow: none;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
:host([readonly]:not([checked]):not([indeterminate])) [part='checkbox']::after {
|
|
98
|
-
content: '';
|
|
99
|
-
box-sizing: border-box;
|
|
100
|
-
width: 100%;
|
|
101
|
-
height: 100%;
|
|
102
|
-
border-radius: inherit;
|
|
103
|
-
top: 0;
|
|
104
|
-
left: 0;
|
|
105
|
-
opacity: 1;
|
|
106
|
-
border: var(--vaadin-input-field-readonly-border, 1px dashed var(--lumo-contrast-50pct));
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/* Indeterminate checkmark */
|
|
110
|
-
:host([indeterminate]) [part='checkbox']::after {
|
|
111
|
-
content: var(--vaadin-checkbox-checkmark-char-indeterminate, '');
|
|
112
|
-
opacity: 1;
|
|
113
|
-
top: 45%;
|
|
114
|
-
height: 10%;
|
|
115
|
-
left: 22%;
|
|
116
|
-
right: 22%;
|
|
117
|
-
width: auto;
|
|
118
|
-
border: 0;
|
|
119
|
-
background-color: var(--lumo-primary-contrast-color);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/* Focus ring */
|
|
123
|
-
:host([focus-ring]) [part='checkbox'] {
|
|
124
|
-
box-shadow:
|
|
125
|
-
0 0 0 1px var(--lumo-base-color),
|
|
126
|
-
0 0 0 calc(var(--_focus-ring-width) + 1px) var(--_focus-ring-color),
|
|
127
|
-
inset 0 0 0 var(--_input-border-width, 0) var(--_input-border-color);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
:host([focus-ring][readonly]:not([checked]):not([indeterminate])) [part='checkbox'] {
|
|
131
|
-
box-shadow:
|
|
132
|
-
0 0 0 1px var(--lumo-base-color),
|
|
133
|
-
0 0 0 calc(var(--_focus-ring-width) + 1px) var(--_focus-ring-color);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/* Disabled */
|
|
137
|
-
:host([disabled]) {
|
|
138
|
-
pointer-events: none;
|
|
139
|
-
--vaadin-input-field-border-color: var(--lumo-contrast-20pct);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
:host([disabled]) ::slotted(label) {
|
|
143
|
-
color: inherit;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
:host([disabled]) [part='checkbox'] {
|
|
147
|
-
background-color: var(--vaadin-checkbox-disabled-background, var(--lumo-contrast-10pct));
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
:host([disabled]) [part='checkbox']::after {
|
|
151
|
-
color: var(--_disabled-checkmark-color);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
:host([disabled]) [part='label'],
|
|
155
|
-
:host([disabled]) [part='helper-text'] {
|
|
156
|
-
color: var(--lumo-disabled-text-color);
|
|
157
|
-
-webkit-text-fill-color: var(--lumo-disabled-text-color);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
:host([indeterminate][disabled]) [part='checkbox']::after {
|
|
161
|
-
background-color: var(--_disabled-checkmark-color);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
:host([readonly][checked]:not([disabled])) [part='checkbox'],
|
|
165
|
-
:host([readonly][indeterminate]:not([disabled])) [part='checkbox'] {
|
|
166
|
-
background-color: var(--vaadin-checkbox-readonly-checked-background, var(--lumo-contrast-70pct));
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/* Used for activation "halo" */
|
|
170
|
-
[part='checkbox']::before {
|
|
171
|
-
pointer-events: none;
|
|
172
|
-
color: transparent;
|
|
173
|
-
width: 100%;
|
|
174
|
-
height: 100%;
|
|
175
|
-
line-height: var(--_checkbox-size);
|
|
176
|
-
border-radius: inherit;
|
|
177
|
-
background-color: inherit;
|
|
178
|
-
transform: scale(1.4);
|
|
179
|
-
opacity: 0;
|
|
180
|
-
transition:
|
|
181
|
-
transform 0.1s,
|
|
182
|
-
opacity 0.8s;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/* Hover */
|
|
186
|
-
:host(:not([checked]):not([indeterminate]):not([disabled]):not([readonly]):not([invalid]):hover) [part='checkbox'] {
|
|
187
|
-
background: var(--vaadin-checkbox-background-hover, var(--lumo-contrast-30pct));
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/* Disable hover for touch devices */
|
|
191
|
-
@media (pointer: coarse) {
|
|
192
|
-
/* prettier-ignore */
|
|
193
|
-
:host(:not([checked]):not([indeterminate]):not([disabled]):not([readonly]):not([invalid]):hover) [part='checkbox'] {
|
|
194
|
-
background: var(--vaadin-checkbox-background, var(--lumo-contrast-20pct));
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/* Active */
|
|
199
|
-
:host([active]) [part='checkbox'] {
|
|
200
|
-
transform: scale(0.9);
|
|
201
|
-
transition-duration: 0.05s;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
:host([active][checked]) [part='checkbox'] {
|
|
205
|
-
transform: scale(1.1);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
:host([active]:not([checked])) [part='checkbox']::before {
|
|
209
|
-
transition-duration: 0.01s, 0.01s;
|
|
210
|
-
transform: scale(0);
|
|
211
|
-
opacity: 0.4;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/* Required */
|
|
215
|
-
:host([required]) [part='required-indicator'] {
|
|
216
|
-
position: absolute;
|
|
217
|
-
top: var(--lumo-space-xs);
|
|
218
|
-
right: var(--lumo-space-xs);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
:host([required][dir='rtl']) [part='required-indicator'] {
|
|
222
|
-
right: auto;
|
|
223
|
-
left: var(--lumo-space-xs);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
:host([required]) [part='required-indicator']::after {
|
|
227
|
-
content: var(--lumo-required-field-indicator, '\\2022');
|
|
228
|
-
transition: opacity 0.2s;
|
|
229
|
-
color: var(--lumo-required-field-indicator-color, var(--lumo-primary-text-color));
|
|
230
|
-
width: 1em;
|
|
231
|
-
text-align: center;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
:host(:not([has-label])) [part='required-indicator'] {
|
|
235
|
-
display: none;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
/* Invalid */
|
|
239
|
-
:host([invalid]) {
|
|
240
|
-
--vaadin-input-field-border-color: var(--lumo-error-color);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
:host([invalid]) [part='checkbox'] {
|
|
244
|
-
background: var(--_invalid-background);
|
|
245
|
-
background-image: linear-gradient(var(--_invalid-background) 0%, var(--_invalid-background) 100%);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
:host([invalid]:hover) [part='checkbox'] {
|
|
249
|
-
background-image: linear-gradient(var(--_invalid-background) 0%, var(--_invalid-background) 100%),
|
|
250
|
-
linear-gradient(var(--_invalid-background) 0%, var(--_invalid-background) 100%);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
:host([invalid][focus-ring]) {
|
|
254
|
-
--_focus-ring-color: var(--lumo-error-color-50pct);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
:host([invalid]) [part='required-indicator']::after {
|
|
258
|
-
color: var(--lumo-required-field-indicator-color, var(--lumo-error-text-color));
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/* Error message */
|
|
262
|
-
[part='error-message'] {
|
|
263
|
-
font-size: var(--vaadin-input-field-error-font-size, var(--lumo-font-size-xs));
|
|
264
|
-
line-height: var(--lumo-line-height-xs);
|
|
265
|
-
font-weight: var(--vaadin-input-field-error-font-weight, 400);
|
|
266
|
-
color: var(--vaadin-input-field-error-color, var(--lumo-error-text-color));
|
|
267
|
-
will-change: max-height;
|
|
268
|
-
transition: 0.4s max-height;
|
|
269
|
-
max-height: 5em;
|
|
270
|
-
padding-inline-start: var(--lumo-space-xs);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
:host([has-error-message]) [part='error-message']::after,
|
|
274
|
-
:host([has-helper]) [part='helper-text']::after {
|
|
275
|
-
content: '';
|
|
276
|
-
display: block;
|
|
277
|
-
height: 0.4em;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
:host(:not([invalid])) [part='error-message'] {
|
|
281
|
-
max-height: 0;
|
|
282
|
-
overflow: hidden;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
/* Helper */
|
|
286
|
-
[part='helper-text'] {
|
|
287
|
-
display: block;
|
|
288
|
-
color: var(--vaadin-input-field-helper-color, var(--lumo-secondary-text-color));
|
|
289
|
-
font-size: var(--vaadin-input-field-helper-font-size, var(--lumo-font-size-xs));
|
|
290
|
-
line-height: var(--lumo-line-height-xs);
|
|
291
|
-
font-weight: var(--vaadin-input-field-helper-font-weight, 400);
|
|
292
|
-
margin-left: calc(var(--lumo-border-radius-m) / 4);
|
|
293
|
-
transition: color 0.2s;
|
|
294
|
-
padding-inline-start: var(--lumo-space-xs);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
:host(:hover:not([readonly])) [part='helper-text'] {
|
|
298
|
-
color: var(--lumo-body-text-color);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
:host([has-error-message]) ::slotted(label),
|
|
302
|
-
:host([has-helper]) ::slotted(label) {
|
|
303
|
-
padding-bottom: 0;
|
|
304
|
-
}
|
|
305
|
-
`,{moduleId:"lumo-checkbox"});/**
|
|
306
|
-
* @license
|
|
307
|
-
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
308
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
309
|
-
*/const Ei=o.dedupingMixin(a=>class extends o.DelegateStateMixin(o.DisabledMixin(o.InputMixin(a))){static get properties(){return{checked:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0,sync:!0}}}static get delegateProps(){return[...super.delegateProps,"checked"]}_onChange(e){const t=e.target;this._toggleChecked(t.checked)}_toggleChecked(e){this.checked=e}});/**
|
|
310
|
-
* @license
|
|
311
|
-
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
312
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
313
|
-
*/const Si=a=>class extends o.FieldMixin(Ei(o.DelegateFocusMixin(o.ActiveMixin(a)))){static get properties(){return{indeterminate:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0},name:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},tabindex:{type:Number,value:0,reflectToAttribute:!0}}}static get observers(){return["__readonlyChanged(readonly, inputElement)"]}static get delegateProps(){return[...super.delegateProps,"indeterminate"]}static get delegateAttrs(){return[...super.delegateAttrs,"name","invalid","required"]}constructor(){super(),this._setType("checkbox"),this._boundOnInputClick=this._onInputClick.bind(this),this.value="on"}ready(){super.ready(),this.addController(new o.InputController(this,e=>{this._setInputElement(e),this._setFocusElement(e),this.stateTarget=e,this.ariaTarget=e})),this.addController(new o.LabelledInputController(this.inputElement,this._labelController)),this._createMethodObserver("_checkedChanged(checked)")}_shouldSetActive(e){return this.readonly||e.target.localName==="a"||e.target===this._helperNode||e.target===this._errorNode?!1:super._shouldSetActive(e)}_addInputListeners(e){super._addInputListeners(e),e.addEventListener("click",this._boundOnInputClick)}_removeInputListeners(e){super._removeInputListeners(e),e.removeEventListener("click",this._boundOnInputClick)}_onInputClick(e){this.readonly&&e.preventDefault()}__readonlyChanged(e,t){t&&(e?t.setAttribute("aria-readonly","true"):t.removeAttribute("aria-readonly"))}_toggleChecked(e){this.indeterminate&&(this.indeterminate=!1),super._toggleChecked(e)}checkValidity(){return!this.required||!!this.checked}_setFocused(e){super._setFocused(e),!e&&document.hasFocus()&&this._requestValidation()}_checkedChanged(e){(e||this.__oldChecked)&&this._requestValidation(),this.__oldChecked=e}_requiredChanged(e){super._requiredChanged(e),e===!1&&this._requestValidation()}_onRequiredIndicatorClick(){this._labelNode.click()}};/**
|
|
314
|
-
* @license
|
|
315
|
-
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
316
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
317
|
-
*/const Pi=o.i$3`
|
|
318
|
-
:host {
|
|
319
|
-
display: inline-block;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
:host([hidden]) {
|
|
323
|
-
display: none !important;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
:host([disabled]) {
|
|
327
|
-
-webkit-tap-highlight-color: transparent;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
.vaadin-checkbox-container {
|
|
331
|
-
display: grid;
|
|
332
|
-
grid-template-columns: auto 1fr;
|
|
333
|
-
align-items: baseline;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
[part='checkbox'],
|
|
337
|
-
::slotted(input),
|
|
338
|
-
[part='label'] {
|
|
339
|
-
grid-row: 1;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
[part='checkbox'],
|
|
343
|
-
::slotted(input) {
|
|
344
|
-
grid-column: 1;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
[part='helper-text'],
|
|
348
|
-
[part='error-message'] {
|
|
349
|
-
grid-column: 2;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
:host(:not([has-helper])) [part='helper-text'],
|
|
353
|
-
:host(:not([has-error-message])) [part='error-message'] {
|
|
354
|
-
display: none;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
[part='checkbox'] {
|
|
358
|
-
width: var(--vaadin-checkbox-size, 1em);
|
|
359
|
-
height: var(--vaadin-checkbox-size, 1em);
|
|
360
|
-
--_input-border-width: var(--vaadin-input-field-border-width, 0);
|
|
361
|
-
--_input-border-color: var(--vaadin-input-field-border-color, transparent);
|
|
362
|
-
box-shadow: inset 0 0 0 var(--_input-border-width, 0) var(--_input-border-color);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
[part='checkbox']::before {
|
|
366
|
-
display: block;
|
|
367
|
-
content: '\\202F';
|
|
368
|
-
line-height: var(--vaadin-checkbox-size, 1em);
|
|
369
|
-
contain: paint;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
/* visually hidden */
|
|
373
|
-
::slotted(input) {
|
|
374
|
-
opacity: 0;
|
|
375
|
-
cursor: inherit;
|
|
376
|
-
margin: 0;
|
|
377
|
-
align-self: stretch;
|
|
378
|
-
-webkit-appearance: none;
|
|
379
|
-
width: initial;
|
|
380
|
-
height: initial;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
@media (forced-colors: active) {
|
|
384
|
-
[part='checkbox'] {
|
|
385
|
-
outline: 1px solid;
|
|
386
|
-
outline-offset: -1px;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
:host([disabled]) [part='checkbox'],
|
|
390
|
-
:host([disabled]) [part='checkbox']::after {
|
|
391
|
-
outline-color: GrayText;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
:host(:is([checked], [indeterminate])) [part='checkbox']::after {
|
|
395
|
-
outline: 1px solid;
|
|
396
|
-
outline-offset: -1px;
|
|
397
|
-
border-radius: inherit;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
:host([focused]) [part='checkbox'],
|
|
401
|
-
:host([focused]) [part='checkbox']::after {
|
|
402
|
-
outline-width: 2px;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
`;/**
|
|
406
|
-
* @license
|
|
407
|
-
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
408
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
409
|
-
*/o.registerStyles("vaadin-checkbox",Pi,{moduleId:"vaadin-checkbox-styles"});class Mi extends Si(o.ElementMixin(o.ThemableMixin(o.PolymerElement))){static get is(){return"vaadin-checkbox"}static get template(){return o.html`
|
|
410
|
-
<div class="vaadin-checkbox-container">
|
|
411
|
-
<div part="checkbox" aria-hidden="true"></div>
|
|
412
|
-
<slot name="input"></slot>
|
|
413
|
-
<div part="label">
|
|
414
|
-
<slot name="label"></slot>
|
|
415
|
-
<div part="required-indicator" on-click="_onRequiredIndicatorClick"></div>
|
|
416
|
-
</div>
|
|
417
|
-
<div part="helper-text">
|
|
418
|
-
<slot name="helper"></slot>
|
|
419
|
-
</div>
|
|
420
|
-
<div part="error-message">
|
|
421
|
-
<slot name="error-message"></slot>
|
|
422
|
-
</div>
|
|
423
|
-
</div>
|
|
424
|
-
<slot name="tooltip"></slot>
|
|
425
|
-
`}ready(){super.ready(),this._tooltipController=new o.TooltipController(this),this._tooltipController.setAriaTarget(this.inputElement),this.addController(this._tooltipController)}}o.defineCustomElement(Mi);const Oi=o.i$3`
|
|
426
|
-
:host {
|
|
427
|
-
color: var(--lumo-body-text-color);
|
|
428
|
-
font-size: var(--lumo-font-size-m);
|
|
429
|
-
font-family: var(--lumo-font-family);
|
|
430
|
-
-webkit-font-smoothing: antialiased;
|
|
431
|
-
-moz-osx-font-smoothing: grayscale;
|
|
432
|
-
-webkit-tap-highlight-color: transparent;
|
|
433
|
-
padding: var(--lumo-space-xs) 0;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
:host::before {
|
|
437
|
-
/* Effective height of vaadin-checkbox */
|
|
438
|
-
height: var(--lumo-size-s);
|
|
439
|
-
box-sizing: border-box;
|
|
440
|
-
display: inline-flex;
|
|
441
|
-
align-items: center;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
:host([theme~='vertical']) [part='group-field'] {
|
|
445
|
-
flex-direction: column;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
:host([disabled]) [part='label'] {
|
|
449
|
-
color: var(--lumo-disabled-text-color);
|
|
450
|
-
-webkit-text-fill-color: var(--lumo-disabled-text-color);
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
:host([focused]:not([readonly])) [part='label'] {
|
|
454
|
-
color: var(--lumo-primary-text-color);
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
:host(:hover:not([readonly]):not([disabled]):not([focused])) [part='label'],
|
|
458
|
-
:host(:hover:not([readonly]):not([disabled]):not([focused])) [part='helper-text'] {
|
|
459
|
-
color: var(--lumo-body-text-color);
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
/* Touch device adjustment */
|
|
463
|
-
@media (pointer: coarse) {
|
|
464
|
-
:host(:hover:not([readonly]):not([disabled]):not([focused])) [part='label'] {
|
|
465
|
-
color: var(--lumo-secondary-text-color);
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
`;o.registerStyles("vaadin-checkbox-group",[o.requiredField,o.helper,Oi],{moduleId:"lumo-checkbox-group"});/**
|
|
469
|
-
* @license
|
|
470
|
-
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
471
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
472
|
-
*/const Vi=a=>class extends o.FieldMixin(o.FocusMixin(o.DisabledMixin(a))){static get properties(){return{value:{type:Array,value:()=>[],notify:!0,sync:!0,observer:"__valueChanged"},readonly:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"__readonlyChanged"}}}constructor(){super(),this.__registerCheckbox=this.__registerCheckbox.bind(this),this.__unregisterCheckbox=this.__unregisterCheckbox.bind(this),this.__onCheckboxCheckedChanged=this.__onCheckboxCheckedChanged.bind(this),this._tooltipController=new o.TooltipController(this),this._tooltipController.addEventListener("tooltip-changed",e=>{const t=e.detail.node;if(t&&t.isConnected){const r=this.__checkboxes.map(s=>s.inputElement);this._tooltipController.setAriaTarget(r)}else this._tooltipController.setAriaTarget([])})}get __checkboxes(){return this.__filterCheckboxes([...this.children])}ready(){super.ready(),this.ariaTarget=this,this.setAttribute("role","group");const e=this.shadowRoot.querySelector("slot:not([name])");this._observer=new o.SlotObserver(e,({addedNodes:t,removedNodes:r})=>{const s=this.__filterCheckboxes(t),n=this.__filterCheckboxes(r);s.forEach(this.__registerCheckbox),n.forEach(this.__unregisterCheckbox);const l=this.__checkboxes.map(d=>d.inputElement);this._tooltipController.setAriaTarget(l),this.__warnOfCheckboxesWithoutValue(s)}),this.addController(this._tooltipController)}checkValidity(){return!this.required||!!(this.value&&this.value.length>0)}__filterCheckboxes(e){return e.filter(t=>t.nodeType===Node.ELEMENT_NODE&&t.localName==="vaadin-checkbox")}__warnOfCheckboxesWithoutValue(e){e.some(r=>{const{value:s}=r;return!r.hasAttribute("value")&&(!s||s==="on")})&&console.warn("Please provide the value attribute to all the checkboxes inside the checkbox group.")}__registerCheckbox(e){e.addEventListener("checked-changed",this.__onCheckboxCheckedChanged),this.disabled&&(e.disabled=!0),this.readonly&&(e.readonly=!0),e.checked?this.__addCheckboxToValue(e.value):this.value&&this.value.includes(e.value)&&(e.checked=!0)}__unregisterCheckbox(e){e.removeEventListener("checked-changed",this.__onCheckboxCheckedChanged),e.checked&&this.__removeCheckboxFromValue(e.value)}_disabledChanged(e,t){super._disabledChanged(e,t),!(!e&&t===void 0)&&t!==e&&this.__checkboxes.forEach(r=>{r.disabled=e})}__addCheckboxToValue(e){this.value?this.value.includes(e)||(this.value=[...this.value,e]):this.value=[e]}__removeCheckboxFromValue(e){this.value&&this.value.includes(e)&&(this.value=this.value.filter(t=>t!==e))}__onCheckboxCheckedChanged(e){const t=e.target;t.checked?this.__addCheckboxToValue(t.value):this.__removeCheckboxFromValue(t.value)}__valueChanged(e,t){e&&e.length===0&&t===void 0||(this.toggleAttribute("has-value",e&&e.length>0),this.__checkboxes.forEach(r=>{r.checked=e&&e.includes(r.value)}),t!==void 0&&this._requestValidation())}__readonlyChanged(e,t){(e||t)&&this.__checkboxes.forEach(r=>{r.readonly=e})}_shouldRemoveFocus(e){return!this.contains(e.relatedTarget)}_setFocused(e){super._setFocused(e),!e&&document.hasFocus()&&this._requestValidation()}};/**
|
|
473
|
-
* @license
|
|
474
|
-
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
475
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
476
|
-
*/const Fi=o.i$3`
|
|
477
|
-
:host {
|
|
478
|
-
display: inline-flex;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
:host::before {
|
|
482
|
-
content: '\\2003';
|
|
483
|
-
width: 0;
|
|
484
|
-
display: inline-block;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
:host([hidden]) {
|
|
488
|
-
display: none !important;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
.vaadin-group-field-container {
|
|
492
|
-
display: flex;
|
|
493
|
-
flex-direction: column;
|
|
494
|
-
width: 100%;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
[part='group-field'] {
|
|
498
|
-
display: flex;
|
|
499
|
-
flex-wrap: wrap;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
:host(:not([has-label])) [part='label'] {
|
|
503
|
-
display: none;
|
|
504
|
-
}
|
|
505
|
-
`;/**
|
|
506
|
-
* @license
|
|
507
|
-
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
508
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
509
|
-
*/o.registerStyles("vaadin-checkbox-group",Fi,{moduleId:"vaadin-checkbox-group-styles"});class Ai extends Vi(o.ElementMixin(o.ThemableMixin(o.PolymerElement))){static get is(){return"vaadin-checkbox-group"}static get template(){return o.html`
|
|
510
|
-
<div class="vaadin-group-field-container">
|
|
511
|
-
<div part="label">
|
|
512
|
-
<slot name="label"></slot>
|
|
513
|
-
<span part="required-indicator" aria-hidden="true"></span>
|
|
514
|
-
</div>
|
|
515
|
-
|
|
516
|
-
<div part="group-field">
|
|
517
|
-
<slot></slot>
|
|
518
|
-
</div>
|
|
519
|
-
|
|
520
|
-
<div part="helper-text">
|
|
521
|
-
<slot name="helper"></slot>
|
|
522
|
-
</div>
|
|
523
|
-
|
|
524
|
-
<div part="error-message">
|
|
525
|
-
<slot name="error-message"></slot>
|
|
526
|
-
</div>
|
|
527
|
-
</div>
|
|
528
|
-
|
|
529
|
-
<slot name="tooltip"></slot>
|
|
530
|
-
`}}o.defineCustomElement(Ai);const Hi='*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}vaadin-checkbox-group{margin-top:5px;margin-left:40px}.checkboxgroup{font-family:"Roboto";font-style:normal;font-size:15px}.checkboxgroup__wrapper{position:relative}.checkboxgroup__wrapper--flex{display:flex;gap:5px;align-content:flex-start}.checkboxgroup__wrapper--relative{position:relative;display:inline}.checkboxgroup__input{vertical-align:baseline}.checkboxgroup__input[indeterminate]::part(checkbox)::after,.checkboxgroup__input[indeterminate]::part(checkbox),.checkboxgroup__input[checked]::part(checkbox){background-color:var(--emw--login-color-primary, var(--emw--color-primary, #D0046C))}.checkboxgroup__label{font-style:inherit;font-family:inherit;font-weight:400;font-size:16px;color:var(--emw--registration-typography, var(--emw--color-black, #000000));line-height:1.5;padding-left:10px;vertical-align:baseline}.checkboxgroup__label-text{font-size:16px}.checkboxgroup__label a{color:var(--emw--login-color-primary, var(--emw--color-primary, #D0046C))}.checkboxgroup__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.checkboxgroup__tooltip-icon{width:16px;height:auto}.checkboxgroup__tooltip{position:absolute;top:0;right:0;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.checkboxgroup__tooltip.visible{opacity:1}.checkbox__input::part(checkbox){background-color:var(--emw--color-white, #FFFFFF)}.checkbox__input[indeterminate]::part(checkbox),.checkbox__input[checked]::part(checkbox){background-color:var(--emw--login-color-primary, var(--emw--color-primary, #D0046C))}',Li=Hi,Pt=class{constructor(a){c.registerInstance(this,a),this.sendValidityState=c.createEvent(this,"sendValidityState"),this.sendInputValue=c.createEvent(this,"sendInputValue"),this.defaultValue="",this.clientStyling="",this.limitStylingAppends=!1,this.showTooltip=!1,this.selectedValues=[],this.value=null,this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.prepend(i)}}validityChanged(){this.validityStateHandler({valid:this.isValid,name:this.name}),this.emitValue==!0&&this.valueHandler({name:this.name,value:this.value,type:"checkboxgroup"})}setValue(){this.value=this.options.reduce((a,i)=>(a[i.name]=this.selectedValues.includes(i.name),a),{}),this.emitValueHandler(!0)}validityStateHandler(a){this.sendValidityState.emit(a)}emitValueHandler(a){a==!0&&this.isValid&&this.valueHandler({name:this.name,value:this.value,type:"checkboxgroup"})}valueHandler(a){this.sendInputValue.emit(a)}handleClickOutside(a){a.composedPath()[0]!==this.tooltipIconReference&&a.composedPath()[0]!==this.tooltipReference&&(this.showTooltip=!1)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}componentDidLoad(){this.inputReference=this.element.shadowRoot.querySelector("input"),this.isValid=this.setValidity(),this.defaultValue&&(this.selectedValues=this.options.map(a=>a.name),this.value=this.defaultValue,this.valueHandler({name:this.name,value:this.value}))}setValidity(){return this.inputReference.validity.valid}setErrorMessage(){if(this.inputReference.validity.valueMissing)return T.translate("requiredError",this.language)}renderTooltip(){return this.showTooltip?c.h("div",{class:`checkboxgroup__tooltip ${this.showTooltip?"visible":""}`,ref:a=>this.tooltipReference=a,innerHTML:this.tooltip}):null}handleParentCheckbox(a){this.selectedValues=a.target.checked?this.options.map(i=>i.name):[]}renderLabel(){return c.h("label",{class:"checkbox__label",htmlFor:`${this.name}__input`,slot:"label"},c.h("div",{class:"checkbox__label-text",innerHTML:`${this.displayName} ${this.validation.mandatory?"*":""}`}))}render(){return c.h("div",{key:"fa45026502fd8d46aa537aee03210ad68d30e577",class:`checkboxgroup__wrapper ${this.name}__input`,ref:a=>this.stylingContainer=a},c.h("div",{key:"15ded4fd896920c6244806e49f300c124c27186d",class:"checkboxgroup__wrapper--flex"},c.h("vaadin-checkbox",{key:"d7eaa205877f8f12c9ef7d4f77018665806f5c7c",class:"checkbox__input",checked:this.selectedValues.length===this.options.length||this.defaultValue==="true",indeterminate:this.selectedValues.length>0&&this.selectedValues.length<this.options.length,onChange:a=>this.handleParentCheckbox(a)},this.renderLabel()),this.tooltip&&c.h("img",{key:"aca39ed398415a6e2cef861be40dad33e0398759",class:"checkboxgroup__tooltip-icon",src:K.tooltipIconSvg,alt:"",ref:a=>this.tooltipIconReference=a,onClick:()=>this.showTooltip=!this.showTooltip}),this.renderTooltip()),c.h("small",{key:"a1a6e1c3c02edcca572b8826ffba06835ca451c3",class:"checkboxgroup__error-message"},this.errorMessage),c.h("vaadin-checkbox-group",{key:"9f5f8a945e4ba13d7d0da6d362c15d00a7796b71",theme:"vertical",value:this.selectedValues,"on-value-changed":a=>{this.selectedValues=a.detail.value}},this.options.map(a=>c.h("vaadin-checkbox",{class:"checkbox__input",name:a.name,value:a.name,label:a.displayName}))))}get element(){return c.getElement(this)}static get watchers(){return{isValid:["validityChanged"],selectedValues:["setValue"],emitValue:["emitValueHandler"]}}};Pt.style=Li;const zi='*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.checkbox{font-family:"Roboto";font-style:normal}.checkbox__wrapper{display:flex;gap:10px;position:relative;align-items:baseline}.checkbox__wrapper--relative{position:relative}.checkbox__input{transform:scale(1.307, 1.307);margin-left:2px;accent-color:var(--emw--login-color-primary, var(--emw--color-primary, #D0046C))}.checkbox__label{font-style:inherit;font-family:inherit;font-weight:400;font-size:16px;color:var(--emw--registration-typography, var(--emw--color-black, #000000));line-height:1.5;cursor:pointer;padding:0}.checkbox__label-text{font-size:16px}.checkbox__label a{color:var(--emw--login-color-primary, var(--emw--color-primary, #D0046C))}.checkbox__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.checkbox__tooltip-icon{width:16px;height:auto}.checkbox__tooltip{position:absolute;top:0;right:20px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.checkbox__tooltip.visible{opacity:1}',Ri=zi,Mt=class{constructor(a){c.registerInstance(this,a),this.sendValidityState=c.createEvent(this,"sendValidityState"),this.sendInputValue=c.createEvent(this,"sendInputValue"),this.defaultValue="",this.clientStyling="",this.limitStylingAppends=!1,this.showTooltip=!1,this.value="",this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.prepend(i)}}validityChanged(){this.validityStateHandler({valid:this.isValid,name:this.name}),this.emitValue==!0&&this.valueHandler({name:this.name,value:this.value})}validityStateHandler(a){this.sendValidityState.emit(a)}emitValueHandler(a){a==!0&&this.isValid&&this.valueHandler({name:this.name,value:this.value})}valueHandler(a){this.sendInputValue.emit(a)}handleClickOutside(a){a.composedPath()[0]!==this.tooltipIconReference&&a.composedPath()[0]!==this.tooltipReference&&(this.showTooltip=!1)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}componentDidLoad(){this.defaultValue&&(this.value=this.defaultValue,this.valueHandler({name:this.name,value:this.value}))}handleClick(){this.value=this.inputReference.checked.toString(),this.errorMessage=this.setErrorMessage(),this.isValid=this.setValidity(),this.emitValueHandler(!0)}setValidity(){return this.inputReference.validity.valid}setErrorMessage(){if(this.inputReference.validity.valueMissing)return T.translate("requiredError",this.language)}renderLabel(){return c.h("label",{class:"checkbox__label",htmlFor:`${this.name}__input`},c.h("div",{class:"checkbox__label-text",innerHTML:`${this.displayName} ${this.validation.mandatory?"*":""}`}))}renderTooltip(){return this.showTooltip?c.h("div",{class:`checkbox__tooltip ${this.showTooltip?"visible":""}`,ref:a=>this.tooltipReference=a,innerHTML:this.tooltip}):null}render(){return c.h("div",{key:"0aae00d291d1da02adae1bc91e79ccd579aa5c7f",class:`checkbox__wrapper ${this.name}__input`,ref:a=>this.stylingContainer=a},c.h("input",{key:"4b8c61d322b5065d8abe4e2687e270511fadc97f",class:"checkbox__input",type:"checkbox",id:`${this.name}__input`,ref:a=>this.inputReference=a,name:this.name,checked:this.defaultValue==="true",readOnly:this.autofilled,required:this.validation.mandatory,value:this.value,onClick:()=>this.handleClick()}),this.renderLabel(),c.h("small",{key:"934263cb58a0d379e8b7dc1f5004ad7e61c63ce0",class:"checkbox__error-message"},this.errorMessage),c.h("div",{key:"88cc71329d88b6325d792226e64ff7f93e940178",class:"checkbox__wrapper--relative"},this.tooltip&&c.h("img",{key:"3708dc613dc920bac6557f2a8020bbafd97d9127",class:"checkbox__tooltip-icon",src:K.tooltipIconSvg,alt:"",ref:a=>this.tooltipIconReference=a,onClick:()=>this.showTooltip=!this.showTooltip}),this.renderTooltip()))}static get watchers(){return{isValid:["validityChanged"],emitValue:["emitValueHandler"]}}};Mt.style=Ri;/**
|
|
531
|
-
* @license
|
|
532
|
-
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
533
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
534
|
-
*/const Ge=o.i$3`
|
|
535
|
-
:host {
|
|
536
|
-
top: var(--lumo-space-m);
|
|
537
|
-
right: var(--lumo-space-m);
|
|
538
|
-
bottom: var(--lumo-space-m);
|
|
539
|
-
left: var(--lumo-space-m);
|
|
540
|
-
/* Workaround for Edge issue (only on Surface), where an overflowing vaadin-list-box inside vaadin-select-overlay makes the overlay transparent */
|
|
541
|
-
/* stylelint-disable-next-line */
|
|
542
|
-
outline: 0px solid transparent;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
[part='overlay'] {
|
|
546
|
-
background-color: var(--lumo-base-color);
|
|
547
|
-
background-image: linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
|
|
548
|
-
border-radius: var(--lumo-border-radius-m);
|
|
549
|
-
box-shadow:
|
|
550
|
-
0 0 0 1px var(--lumo-shade-5pct),
|
|
551
|
-
var(--lumo-box-shadow-m);
|
|
552
|
-
color: var(--lumo-body-text-color);
|
|
553
|
-
font-family: var(--lumo-font-family);
|
|
554
|
-
font-size: var(--lumo-font-size-m);
|
|
555
|
-
font-weight: 400;
|
|
556
|
-
line-height: var(--lumo-line-height-m);
|
|
557
|
-
letter-spacing: 0;
|
|
558
|
-
text-transform: none;
|
|
559
|
-
-webkit-text-size-adjust: 100%;
|
|
560
|
-
-webkit-font-smoothing: antialiased;
|
|
561
|
-
-moz-osx-font-smoothing: grayscale;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
[part='content'] {
|
|
565
|
-
padding: var(--lumo-space-xs);
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
[part='backdrop'] {
|
|
569
|
-
background-color: var(--lumo-shade-20pct);
|
|
570
|
-
animation: 0.2s lumo-overlay-backdrop-enter both;
|
|
571
|
-
will-change: opacity;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
@keyframes lumo-overlay-backdrop-enter {
|
|
575
|
-
0% {
|
|
576
|
-
opacity: 0;
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
:host([closing]) [part='backdrop'] {
|
|
581
|
-
animation: 0.2s lumo-overlay-backdrop-exit both;
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
@keyframes lumo-overlay-backdrop-exit {
|
|
585
|
-
100% {
|
|
586
|
-
opacity: 0;
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
@keyframes lumo-overlay-dummy-animation {
|
|
591
|
-
0% {
|
|
592
|
-
opacity: 1;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
100% {
|
|
596
|
-
opacity: 1;
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
`;o.registerStyles("",Ge,{moduleId:"lumo-overlay"});/**
|
|
600
|
-
* @license
|
|
601
|
-
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
602
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
603
|
-
*/const Ke=o.i$3`
|
|
604
|
-
:host([opening]),
|
|
605
|
-
:host([closing]) {
|
|
606
|
-
animation: 0.14s lumo-overlay-dummy-animation;
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
[part='overlay'] {
|
|
610
|
-
will-change: opacity, transform;
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
:host([opening]) [part='overlay'] {
|
|
614
|
-
animation: 0.1s lumo-menu-overlay-enter ease-out both;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
@keyframes lumo-menu-overlay-enter {
|
|
618
|
-
0% {
|
|
619
|
-
opacity: 0;
|
|
620
|
-
transform: translateY(-4px);
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
:host([closing]) [part='overlay'] {
|
|
625
|
-
animation: 0.1s lumo-menu-overlay-exit both;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
@keyframes lumo-menu-overlay-exit {
|
|
629
|
-
100% {
|
|
630
|
-
opacity: 0;
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
`;o.registerStyles("",Ke,{moduleId:"lumo-menu-overlay-core"});const $i=o.i$3`
|
|
634
|
-
/* Small viewport (bottom sheet) styles */
|
|
635
|
-
/* Use direct media queries instead of the state attributes ([phone] and [fullscreen]) provided by the elements */
|
|
636
|
-
@media (max-width: 450px), (max-height: 450px) {
|
|
637
|
-
:host {
|
|
638
|
-
top: 0 !important;
|
|
639
|
-
right: 0 !important;
|
|
640
|
-
bottom: var(--vaadin-overlay-viewport-bottom, 0) !important;
|
|
641
|
-
left: 0 !important;
|
|
642
|
-
align-items: stretch !important;
|
|
643
|
-
justify-content: flex-end !important;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
[part='overlay'] {
|
|
647
|
-
max-height: 50vh;
|
|
648
|
-
width: 100vw;
|
|
649
|
-
border-radius: 0;
|
|
650
|
-
box-shadow: var(--lumo-box-shadow-xl);
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
/* The content part scrolls instead of the overlay part, because of the gradient fade-out */
|
|
654
|
-
[part='content'] {
|
|
655
|
-
padding: 30px var(--lumo-space-m);
|
|
656
|
-
max-height: inherit;
|
|
657
|
-
box-sizing: border-box;
|
|
658
|
-
-webkit-overflow-scrolling: touch;
|
|
659
|
-
overflow: auto;
|
|
660
|
-
-webkit-mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
|
|
661
|
-
mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
[part='backdrop'] {
|
|
665
|
-
display: block;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
/* Animations */
|
|
669
|
-
|
|
670
|
-
:host([opening]) [part='overlay'] {
|
|
671
|
-
animation: 0.2s lumo-mobile-menu-overlay-enter cubic-bezier(0.215, 0.61, 0.355, 1) both;
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
:host([closing]),
|
|
675
|
-
:host([closing]) [part='backdrop'] {
|
|
676
|
-
animation-delay: 0.14s;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
:host([closing]) [part='overlay'] {
|
|
680
|
-
animation: 0.14s 0.14s lumo-mobile-menu-overlay-exit cubic-bezier(0.55, 0.055, 0.675, 0.19) both;
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
@keyframes lumo-mobile-menu-overlay-enter {
|
|
685
|
-
0% {
|
|
686
|
-
transform: translateY(150%);
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
@keyframes lumo-mobile-menu-overlay-exit {
|
|
691
|
-
100% {
|
|
692
|
-
transform: translateY(150%);
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
`,Ot=[Ge,Ke,$i];o.registerStyles("",Ot,{moduleId:"lumo-menu-overlay"});const Bi=o.i$3`
|
|
696
|
-
[part='overlay'] {
|
|
697
|
-
/*
|
|
698
|
-
Width:
|
|
699
|
-
date cell widths
|
|
700
|
-
+ month calendar side padding
|
|
701
|
-
+ year scroller width
|
|
702
|
-
*/
|
|
703
|
-
/* prettier-ignore */
|
|
704
|
-
width:
|
|
705
|
-
calc(
|
|
706
|
-
var(--lumo-size-m) * 7
|
|
707
|
-
+ var(--lumo-space-xs) * 2
|
|
708
|
-
+ 57px
|
|
709
|
-
);
|
|
710
|
-
height: 100%;
|
|
711
|
-
max-height: calc(var(--lumo-size-m) * 14);
|
|
712
|
-
overflow: hidden;
|
|
713
|
-
-webkit-tap-highlight-color: transparent;
|
|
714
|
-
flex-direction: column;
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
[part='content'] {
|
|
718
|
-
padding: 0;
|
|
719
|
-
height: 100%;
|
|
720
|
-
overflow: hidden;
|
|
721
|
-
-webkit-mask-image: none;
|
|
722
|
-
mask-image: none;
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
:host([top-aligned]) [part~='overlay'] {
|
|
726
|
-
margin-top: var(--lumo-space-xs);
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
:host([bottom-aligned]) [part~='overlay'] {
|
|
730
|
-
margin-bottom: var(--lumo-space-xs);
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
@media (max-width: 450px), (max-height: 450px) {
|
|
734
|
-
[part='overlay'] {
|
|
735
|
-
width: 100vw;
|
|
736
|
-
height: 70vh;
|
|
737
|
-
max-height: 70vh;
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
`;o.registerStyles("vaadin-date-picker-overlay",[Ot,Bi],{moduleId:"lumo-date-picker-overlay"});o.registerStyles("vaadin-date-picker-year",o.i$3`
|
|
741
|
-
:host([current]) [part='year-number'] {
|
|
742
|
-
color: var(--lumo-primary-text-color);
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
:host(:not([current])) [part='year-number'],
|
|
746
|
-
[part='year-separator'] {
|
|
747
|
-
opacity: var(--_lumo-date-picker-year-opacity, 0.7);
|
|
748
|
-
transition: 0.2s opacity;
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
[part='year-number'],
|
|
752
|
-
[part='year-separator'] {
|
|
753
|
-
display: flex;
|
|
754
|
-
align-items: center;
|
|
755
|
-
justify-content: center;
|
|
756
|
-
height: 50%;
|
|
757
|
-
transform: translateY(-50%);
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
[part='year-separator']::after {
|
|
761
|
-
color: var(--lumo-disabled-text-color);
|
|
762
|
-
content: '\\2022';
|
|
763
|
-
}
|
|
764
|
-
`,{moduleId:"lumo-date-picker-year"});o.registerStyles("vaadin-date-picker-overlay-content",o.i$3`
|
|
765
|
-
:host {
|
|
766
|
-
position: relative;
|
|
767
|
-
/* Background for the year scroller, placed here as we are using a mask image on the actual years part */
|
|
768
|
-
background-image: linear-gradient(var(--lumo-shade-5pct), var(--lumo-shade-5pct));
|
|
769
|
-
background-size: 57px 100%;
|
|
770
|
-
background-position: top right;
|
|
771
|
-
background-repeat: no-repeat;
|
|
772
|
-
cursor: default;
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
::slotted([slot='months']) {
|
|
776
|
-
/* Month calendar height:
|
|
777
|
-
header height + margin-bottom
|
|
778
|
-
+ weekdays height + margin-bottom
|
|
779
|
-
+ date cell heights
|
|
780
|
-
+ small margin between month calendars
|
|
781
|
-
*/
|
|
782
|
-
/* prettier-ignore */
|
|
783
|
-
--vaadin-infinite-scroller-item-height:
|
|
784
|
-
calc(
|
|
785
|
-
var(--lumo-font-size-l) + var(--lumo-space-m)
|
|
786
|
-
+ var(--lumo-font-size-xs) + var(--lumo-space-s)
|
|
787
|
-
+ var(--lumo-size-m) * 6
|
|
788
|
-
+ var(--lumo-space-s)
|
|
789
|
-
);
|
|
790
|
-
--vaadin-infinite-scroller-buffer-offset: 10%;
|
|
791
|
-
-webkit-mask-image: linear-gradient(transparent, #000 10%, #000 85%, transparent);
|
|
792
|
-
mask-image: linear-gradient(transparent, #000 10%, #000 85%, transparent);
|
|
793
|
-
position: relative;
|
|
794
|
-
margin-right: 57px;
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
::slotted([slot='years']) {
|
|
798
|
-
/* TODO get rid of fixed magic number */
|
|
799
|
-
--vaadin-infinite-scroller-buffer-width: 97px;
|
|
800
|
-
width: 57px;
|
|
801
|
-
height: auto;
|
|
802
|
-
top: 0;
|
|
803
|
-
bottom: 0;
|
|
804
|
-
font-size: var(--lumo-font-size-s);
|
|
805
|
-
box-shadow: inset 2px 0 4px 0 var(--lumo-shade-5pct);
|
|
806
|
-
-webkit-mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
|
|
807
|
-
mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
|
|
808
|
-
cursor: var(--lumo-clickable-cursor);
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
::slotted([slot='years']:hover) {
|
|
812
|
-
--_lumo-date-picker-year-opacity: 1;
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
/* TODO unsupported selector */
|
|
816
|
-
#scrollers {
|
|
817
|
-
position: static;
|
|
818
|
-
display: block;
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
/* TODO fix this in vaadin-date-picker that it adapts to the width of the year scroller */
|
|
822
|
-
:host([desktop]) ::slotted([slot='months']) {
|
|
823
|
-
right: auto;
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
/* Year scroller position indicator */
|
|
827
|
-
::slotted([slot='years'])::before {
|
|
828
|
-
border: none;
|
|
829
|
-
width: 1em;
|
|
830
|
-
height: 1em;
|
|
831
|
-
background-color: var(--lumo-base-color);
|
|
832
|
-
background-image: linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
|
|
833
|
-
transform: translate(-75%, -50%) rotate(45deg);
|
|
834
|
-
border-top-right-radius: var(--lumo-border-radius-s);
|
|
835
|
-
box-shadow: 2px -2px 6px 0 var(--lumo-shade-5pct);
|
|
836
|
-
z-index: 1;
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
[part='toolbar'] {
|
|
840
|
-
padding: var(--lumo-space-s);
|
|
841
|
-
border-bottom-left-radius: var(--lumo-border-radius-l);
|
|
842
|
-
margin-right: 57px;
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
[part='toolbar'] ::slotted(vaadin-button) {
|
|
846
|
-
margin: 0;
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
/* Narrow viewport mode (fullscreen) */
|
|
850
|
-
|
|
851
|
-
:host([fullscreen]) [part='toolbar'] {
|
|
852
|
-
order: -1;
|
|
853
|
-
background-color: var(--lumo-base-color);
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
:host([fullscreen]) [part='overlay-header'] {
|
|
857
|
-
order: -2;
|
|
858
|
-
height: var(--lumo-size-m);
|
|
859
|
-
padding: var(--lumo-space-s);
|
|
860
|
-
position: absolute;
|
|
861
|
-
left: 0;
|
|
862
|
-
right: 0;
|
|
863
|
-
justify-content: center;
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
:host([fullscreen]) [part='toggle-button'],
|
|
867
|
-
:host([fullscreen]) [part='clear-button'],
|
|
868
|
-
[part='overlay-header'] [part='label'] {
|
|
869
|
-
display: none;
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
/* Very narrow screen (year scroller initially hidden) */
|
|
873
|
-
|
|
874
|
-
[part='years-toggle-button'] {
|
|
875
|
-
display: flex;
|
|
876
|
-
align-items: center;
|
|
877
|
-
height: var(--lumo-size-s);
|
|
878
|
-
padding: 0 0.5em;
|
|
879
|
-
border-radius: var(--lumo-border-radius-m);
|
|
880
|
-
z-index: 3;
|
|
881
|
-
color: var(--lumo-primary-text-color);
|
|
882
|
-
font-weight: 500;
|
|
883
|
-
-webkit-font-smoothing: antialiased;
|
|
884
|
-
-moz-osx-font-smoothing: grayscale;
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
:host([years-visible]) [part='years-toggle-button'] {
|
|
888
|
-
background-color: var(--lumo-primary-color);
|
|
889
|
-
color: var(--lumo-primary-contrast-color);
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
/* TODO magic number (same as used for media-query in vaadin-date-picker-overlay-content) */
|
|
893
|
-
@media screen and (max-width: 374px) {
|
|
894
|
-
:host {
|
|
895
|
-
background-image: none;
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
[part='toolbar'],
|
|
899
|
-
::slotted([slot='months']) {
|
|
900
|
-
margin-right: 0;
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
/* TODO make date-picker adapt to the width of the years part */
|
|
904
|
-
::slotted([slot='years']) {
|
|
905
|
-
--vaadin-infinite-scroller-buffer-width: 90px;
|
|
906
|
-
width: 50px;
|
|
907
|
-
background-color: var(--lumo-shade-5pct);
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
:host([years-visible]) ::slotted([slot='months']) {
|
|
911
|
-
padding-left: 50px;
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
`,{moduleId:"lumo-date-picker-overlay-content"});o.registerStyles("vaadin-month-calendar",o.i$3`
|
|
915
|
-
:host {
|
|
916
|
-
-moz-user-select: none;
|
|
917
|
-
-webkit-user-select: none;
|
|
918
|
-
-webkit-tap-highlight-color: transparent;
|
|
919
|
-
user-select: none;
|
|
920
|
-
font-size: var(--lumo-font-size-m);
|
|
921
|
-
color: var(--lumo-body-text-color);
|
|
922
|
-
text-align: center;
|
|
923
|
-
padding: 0 var(--lumo-space-xs);
|
|
924
|
-
--_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
|
|
925
|
-
--_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
|
|
926
|
-
--_selection-color: var(--vaadin-selection-color, var(--lumo-primary-color));
|
|
927
|
-
--_selection-color-text: var(--vaadin-selection-color-text, var(--lumo-primary-text-color));
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
/* Month header */
|
|
931
|
-
|
|
932
|
-
[part='month-header'] {
|
|
933
|
-
color: var(--lumo-header-text-color);
|
|
934
|
-
font-size: var(--lumo-font-size-l);
|
|
935
|
-
line-height: 1;
|
|
936
|
-
font-weight: 500;
|
|
937
|
-
margin-bottom: var(--lumo-space-m);
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
/* Week days and numbers */
|
|
941
|
-
|
|
942
|
-
[part='weekdays'],
|
|
943
|
-
[part='weekday'],
|
|
944
|
-
[part='week-number'] {
|
|
945
|
-
font-size: var(--lumo-font-size-xxs);
|
|
946
|
-
line-height: 1;
|
|
947
|
-
color: var(--lumo-secondary-text-color);
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
[part='weekdays'] {
|
|
951
|
-
margin-bottom: var(--lumo-space-s);
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
[part='weekday']:empty,
|
|
955
|
-
[part='week-number'] {
|
|
956
|
-
width: var(--lumo-size-xs);
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
/* Date and week number cells */
|
|
960
|
-
|
|
961
|
-
[part~='date'],
|
|
962
|
-
[part='week-number'] {
|
|
963
|
-
box-sizing: border-box;
|
|
964
|
-
display: inline-flex;
|
|
965
|
-
align-items: center;
|
|
966
|
-
justify-content: center;
|
|
967
|
-
height: var(--lumo-size-m);
|
|
968
|
-
position: relative;
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
[part~='date'] {
|
|
972
|
-
transition: color 0.1s;
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
[part~='date']:not(:empty) {
|
|
976
|
-
cursor: var(--lumo-clickable-cursor);
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
:host([week-numbers]) [part='weekday']:not(:empty),
|
|
980
|
-
:host([week-numbers]) [part~='date'] {
|
|
981
|
-
width: calc((100% - var(--lumo-size-xs)) / 7);
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
/* Today date */
|
|
985
|
-
|
|
986
|
-
[part~='date'][part~='today'] {
|
|
987
|
-
color: var(--_selection-color-text);
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
/* Focused date */
|
|
991
|
-
|
|
992
|
-
[part~='date']::before {
|
|
993
|
-
content: '';
|
|
994
|
-
position: absolute;
|
|
995
|
-
z-index: -1;
|
|
996
|
-
top: 50%;
|
|
997
|
-
left: 50%;
|
|
998
|
-
transform: translate(-50%, -50%);
|
|
999
|
-
min-width: 2em;
|
|
1000
|
-
min-height: 2em;
|
|
1001
|
-
width: 80%;
|
|
1002
|
-
height: 80%;
|
|
1003
|
-
max-height: 100%;
|
|
1004
|
-
max-width: 100%;
|
|
1005
|
-
border-radius: var(--lumo-border-radius-m);
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
[part~='date'][part~='focused']::before {
|
|
1009
|
-
box-shadow:
|
|
1010
|
-
0 0 0 1px var(--lumo-base-color),
|
|
1011
|
-
0 0 0 calc(var(--_focus-ring-width) + 1px) var(--_focus-ring-color);
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
:host(:not([focused])) [part~='date'][part~='focused']::before {
|
|
1015
|
-
animation: vaadin-date-picker-month-calendar-focus-date 1.4s infinite;
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
@keyframes vaadin-date-picker-month-calendar-focus-date {
|
|
1019
|
-
50% {
|
|
1020
|
-
box-shadow:
|
|
1021
|
-
0 0 0 1px var(--lumo-base-color),
|
|
1022
|
-
0 0 0 calc(var(--_focus-ring-width) + 1px) transparent;
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
[part~='date']:not(:empty):not([part~='disabled']):not([part~='selected']):hover::before {
|
|
1027
|
-
background-color: var(--lumo-primary-color-10pct);
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
[part~='date'][part~='selected'] {
|
|
1031
|
-
color: var(--lumo-primary-contrast-color);
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
[part~='date'][part~='selected']::before {
|
|
1035
|
-
background-color: var(--_selection-color);
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
[part~='date'][part~='disabled'] {
|
|
1039
|
-
color: var(--lumo-disabled-text-color);
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
@media (pointer: coarse) {
|
|
1043
|
-
[part~='date']:hover:not([part~='selected'])::before,
|
|
1044
|
-
:host(:not([focus-ring])) [part~='focused']:not([part~='selected'])::before {
|
|
1045
|
-
display: none;
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
[part~='date']:not(:empty):not([part~='disabled']):active::before {
|
|
1049
|
-
display: block;
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
:host(:not([focus-ring])) [part~='date'][part~='selected']::before {
|
|
1053
|
-
box-shadow: none;
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
1056
|
-
/* Disabled */
|
|
1057
|
-
|
|
1058
|
-
:host([disabled]) * {
|
|
1059
|
-
color: var(--lumo-disabled-text-color) !important;
|
|
1060
|
-
}
|
|
1061
|
-
`,{moduleId:"lumo-month-calendar"});const Ni=o.i$3`
|
|
1062
|
-
[part='toggle-button']::before {
|
|
1063
|
-
content: var(--lumo-icons-calendar);
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
[part='clear-button']::before {
|
|
1067
|
-
content: var(--lumo-icons-cross);
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
@media (max-width: 450px), (max-height: 450px) {
|
|
1071
|
-
[part='overlay-content'] {
|
|
1072
|
-
height: 70vh;
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
:host([dir='rtl']) [part='input-field'] ::slotted(input) {
|
|
1077
|
-
--_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent, #000 1.25em);
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
:host([dir='rtl']) [part='input-field'] ::slotted(input:placeholder-shown) {
|
|
1081
|
-
--_lumo-text-field-overflow-mask-image: none;
|
|
1082
|
-
}
|
|
1083
|
-
`;o.registerStyles("vaadin-date-picker",[o.inputFieldShared$1,Ni],{moduleId:"lumo-date-picker"});/**
|
|
1084
|
-
* @license
|
|
1085
|
-
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
1086
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1087
|
-
*/const Vt=o.i$3`
|
|
1088
|
-
:host {
|
|
1089
|
-
z-index: 200;
|
|
1090
|
-
position: fixed;
|
|
1091
|
-
|
|
1092
|
-
/* Despite of what the names say, <vaadin-overlay> is just a container
|
|
1093
|
-
for position/sizing/alignment. The actual overlay is the overlay part. */
|
|
1094
|
-
|
|
1095
|
-
/* Default position constraints: the entire viewport. Note: themes can
|
|
1096
|
-
override this to introduce gaps between the overlay and the viewport. */
|
|
1097
|
-
inset: 0;
|
|
1098
|
-
bottom: var(--vaadin-overlay-viewport-bottom);
|
|
1099
|
-
|
|
1100
|
-
/* Use flexbox alignment for the overlay part. */
|
|
1101
|
-
display: flex;
|
|
1102
|
-
flex-direction: column; /* makes dropdowns sizing easier */
|
|
1103
|
-
/* Align to center by default. */
|
|
1104
|
-
align-items: center;
|
|
1105
|
-
justify-content: center;
|
|
1106
|
-
|
|
1107
|
-
/* Allow centering when max-width/max-height applies. */
|
|
1108
|
-
margin: auto;
|
|
1109
|
-
|
|
1110
|
-
/* The host is not clickable, only the overlay part is. */
|
|
1111
|
-
pointer-events: none;
|
|
1112
|
-
|
|
1113
|
-
/* Remove tap highlight on touch devices. */
|
|
1114
|
-
-webkit-tap-highlight-color: transparent;
|
|
1115
|
-
|
|
1116
|
-
/* CSS API for host */
|
|
1117
|
-
--vaadin-overlay-viewport-bottom: 0;
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
:host([hidden]),
|
|
1121
|
-
:host(:not([opened]):not([closing])),
|
|
1122
|
-
:host(:not([opened]):not([closing])) [part='overlay'] {
|
|
1123
|
-
display: none !important;
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
[part='overlay'] {
|
|
1127
|
-
-webkit-overflow-scrolling: touch;
|
|
1128
|
-
overflow: auto;
|
|
1129
|
-
pointer-events: auto;
|
|
1130
|
-
|
|
1131
|
-
/* Prevent overflowing the host */
|
|
1132
|
-
max-width: 100%;
|
|
1133
|
-
box-sizing: border-box;
|
|
1134
|
-
|
|
1135
|
-
-webkit-tap-highlight-color: initial; /* reenable tap highlight inside */
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
[part='backdrop'] {
|
|
1139
|
-
z-index: -1;
|
|
1140
|
-
content: '';
|
|
1141
|
-
background: rgba(0, 0, 0, 0.5);
|
|
1142
|
-
position: fixed;
|
|
1143
|
-
inset: 0;
|
|
1144
|
-
pointer-events: auto;
|
|
1145
|
-
}
|
|
1146
|
-
`;/**
|
|
1147
|
-
@license
|
|
1148
|
-
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
1149
|
-
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
1150
|
-
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
1151
|
-
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
1152
|
-
Code distributed by Google as part of the polymer project is also
|
|
1153
|
-
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1154
|
-
*/let Be=!1,qi=[],Ft=[];function Ui(){Be=!0,requestAnimationFrame(function(){Be=!1,Yi(qi),setTimeout(function(){Wi(Ft)})})}function Yi(a){for(;a.length;)At(a.shift())}function Wi(a){for(let i=0,e=a.length;i<e;i++)At(a.shift())}function At(a){const i=a[0],e=a[1],t=a[2];try{e.apply(i,t)}catch(r){setTimeout(()=>{throw r})}}function Ht(a,i,e){Be||Ui(),Ft.push([a,i,e])}/**
|
|
1155
|
-
* @license
|
|
1156
|
-
* Copyright (c) 2017 Anton Korzunov
|
|
1157
|
-
* SPDX-License-Identifier: MIT
|
|
1158
|
-
*/let ie=new WeakMap,ye=new WeakMap,we={},Fe=0;const ft=a=>a&&a.nodeType===Node.ELEMENT_NODE,Ae=(...a)=>{console.error(`Error: ${a.join(" ")}. Skip setting aria-hidden.`)},ji=(a,i)=>ft(a)?i.map(e=>{if(!ft(e))return Ae(e,"is not a valid element"),null;let t=e;for(;t&&t!==a;){if(a.contains(t))return e;t=t.getRootNode().host}return Ae(e,"is not contained inside",a),null}).filter(e=>!!e):(Ae(a,"is not a valid element"),[]),Qi=(a,i,e,t)=>{const r=ji(i,Array.isArray(a)?a:[a]);we[e]||(we[e]=new WeakMap);const s=we[e],n=[],l=new Set,d=new Set(r),h=u=>{if(!u||l.has(u))return;l.add(u);const v=u.assignedSlot;v&&h(v),h(u.parentNode||u.host)};r.forEach(h);const m=u=>{if(!u||d.has(u))return;const v=u.shadowRoot;(v?[...u.children,...v.children]:[...u.children]).forEach(y=>{if(!["template","script","style"].includes(y.localName))if(l.has(y))m(y);else{const z=y.getAttribute(t),A=z!==null&&z!=="false",R=(ie.get(y)||0)+1,E=(s.get(y)||0)+1;ie.set(y,R),s.set(y,E),n.push(y),R===1&&A&&ye.set(y,!0),E===1&&y.setAttribute(e,"true"),A||y.setAttribute(t,"true")}})};return m(i),l.clear(),Fe+=1,()=>{n.forEach(u=>{const v=ie.get(u)-1,_=s.get(u)-1;ie.set(u,v),s.set(u,_),v||(ye.has(u)?ye.delete(u):u.removeAttribute(t)),_||u.removeAttribute(e)}),Fe-=1,Fe||(ie=new WeakMap,ie=new WeakMap,ye=new WeakMap,we={})}},Lt=(a,i=document.body,e="data-aria-hidden")=>{const t=Array.from(Array.isArray(a)?a:[a]);return i&&t.push(...Array.from(i.querySelectorAll("[aria-live]"))),Qi(t,i,e,"aria-hidden")};/**
|
|
1159
|
-
* @license
|
|
1160
|
-
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1161
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1162
|
-
*/class Gi{constructor(i,e){this.host=i,this.callback=typeof e=="function"?e:()=>i}showModal(){const i=this.callback();this.__showOthers=Lt(i)}close(){this.__showOthers&&(this.__showOthers(),this.__showOthers=null)}}/**
|
|
1163
|
-
* @license
|
|
1164
|
-
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1165
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1166
|
-
*/class Ki{saveFocus(i){this.focusNode=i||o.getDeepActiveElement()}restoreFocus(i){const e=this.focusNode;if(!e)return;const t=i?i.preventScroll:!1;o.getDeepActiveElement()===document.body?setTimeout(()=>e.focus({preventScroll:t})):e.focus({preventScroll:t}),this.focusNode=null}}/**
|
|
1167
|
-
* @license
|
|
1168
|
-
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1169
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1170
|
-
*/const He=[];class Xi{constructor(i){this.host=i,this.__trapNode=null,this.__onKeyDown=this.__onKeyDown.bind(this)}get __focusableElements(){return o.getFocusableElements(this.__trapNode)}get __focusedElementIndex(){const i=this.__focusableElements;return i.indexOf(i.filter(o.isElementFocused).pop())}hostConnected(){document.addEventListener("keydown",this.__onKeyDown)}hostDisconnected(){document.removeEventListener("keydown",this.__onKeyDown)}trapFocus(i){if(this.__trapNode=i,this.__focusableElements.length===0)throw this.__trapNode=null,new Error("The trap node should have at least one focusable descendant or be focusable itself.");He.push(this),this.__focusedElementIndex===-1&&this.__focusableElements[0].focus()}releaseFocus(){this.__trapNode=null,He.pop()}__onKeyDown(i){if(this.__trapNode&&this===Array.from(He).pop()&&i.key==="Tab"){i.preventDefault();const e=i.shiftKey;this.__focusNextElement(e)}}__focusNextElement(i=!1){const e=this.__focusableElements,t=i?-1:1,r=this.__focusedElementIndex,s=(e.length+r+t)%e.length,n=e[s];n.focus(),n.localName==="input"&&n.select()}}/**
|
|
1171
|
-
* @license
|
|
1172
|
-
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
1173
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1174
|
-
*/const Ji=a=>class extends o.ControllerMixin(a){static get properties(){return{focusTrap:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!1},restoreFocusNode:{type:HTMLElement}}}constructor(){super(),this.__ariaModalController=new Gi(this),this.__focusTrapController=new Xi(this),this.__focusRestorationController=new Ki}ready(){super.ready(),this.addController(this.__ariaModalController),this.addController(this.__focusTrapController),this.addController(this.__focusRestorationController)}_resetFocus(){if(this.focusTrap&&(this.__ariaModalController.close(),this.__focusTrapController.releaseFocus()),this.restoreFocusOnClose&&this._shouldRestoreFocus()){const e=!o.isKeyboardActive();this.__focusRestorationController.restoreFocus({preventScroll:e})}}_saveFocus(){this.restoreFocusOnClose&&this.__focusRestorationController.saveFocus(this.restoreFocusNode)}_trapFocus(){this.focusTrap&&(this.__ariaModalController.showModal(),this.__focusTrapController.trapFocus(this.$.overlay))}_shouldRestoreFocus(){const e=o.getDeepActiveElement();return e===document.body||this._deepContains(e)}_deepContains(e){if(this.contains(e))return!0;let t=e;const r=e.ownerDocument;for(;t&&t!==r&&t!==this;)t=t.parentNode||t.host;return t===this}};/**
|
|
1175
|
-
* @license
|
|
1176
|
-
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
1177
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1178
|
-
*/const zt=()=>Array.from(document.body.children).filter(a=>a instanceof HTMLElement&&a._hasOverlayStackMixin&&!a.hasAttribute("closing")).sort((a,i)=>a.__zIndex-i.__zIndex||0),Ne=()=>zt().filter(a=>a.$.overlay),Zi=a=>a===Ne().pop(),er=a=>class extends a{constructor(){super(),this._hasOverlayStackMixin=!0}get _last(){return Zi(this)}bringToFront(){let e="";const t=zt().filter(r=>r!==this).pop();t&&(e=t.__zIndex+1),this.style.zIndex=e,this.__zIndex=e||parseFloat(getComputedStyle(this).zIndex)}_enterModalState(){document.body.style.pointerEvents!=="none"&&(this._previousDocumentPointerEvents=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),Ne().forEach(e=>{e!==this&&(e.$.overlay.style.pointerEvents="none")})}_exitModalState(){this._previousDocumentPointerEvents!==void 0&&(document.body.style.pointerEvents=this._previousDocumentPointerEvents,delete this._previousDocumentPointerEvents);const e=Ne();let t;for(;(t=e.pop())&&!(t!==this&&(t.$.overlay.style.removeProperty("pointer-events"),!t.modeless)););}};/**
|
|
1179
|
-
* @license
|
|
1180
|
-
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
1181
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1182
|
-
*/const Rt=a=>class extends Ji(er(a)){static get properties(){return{opened:{type:Boolean,notify:!0,observer:"_openedChanged",reflectToAttribute:!0,sync:!0},owner:{type:Object,sync:!0},model:{type:Object,sync:!0},renderer:{type:Object,sync:!0},modeless:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_modelessChanged",sync:!0},hidden:{type:Boolean,reflectToAttribute:!0,observer:"_hiddenChanged",sync:!0},withBackdrop:{type:Boolean,value:!1,reflectToAttribute:!0,sync:!0}}}static get observers(){return["_rendererOrDataChanged(renderer, owner, model, opened)"]}constructor(){super(),this._boundMouseDownListener=this._mouseDownListener.bind(this),this._boundMouseUpListener=this._mouseUpListener.bind(this),this._boundOutsideClickListener=this._outsideClickListener.bind(this),this._boundKeydownListener=this._keydownListener.bind(this),o.isIOS&&(this._boundIosResizeListener=()=>this._detectIosNavbar())}ready(){super.ready(),this.addEventListener("click",()=>{}),this.$.backdrop.addEventListener("click",()=>{}),this.addEventListener("mouseup",()=>{document.activeElement===document.body&&this.$.overlay.getAttribute("tabindex")==="0"&&this.$.overlay.focus()})}connectedCallback(){super.connectedCallback(),this._boundIosResizeListener&&(this._detectIosNavbar(),window.addEventListener("resize",this._boundIosResizeListener))}disconnectedCallback(){super.disconnectedCallback(),this._boundIosResizeListener&&window.removeEventListener("resize",this._boundIosResizeListener)}requestContentUpdate(){this.renderer&&this.renderer.call(this.owner,this,this.owner,this.model)}close(e){const t=new CustomEvent("vaadin-overlay-close",{bubbles:!0,cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),t.defaultPrevented||(this.opened=!1)}_detectIosNavbar(){if(!this.opened)return;const e=window.innerHeight,r=window.innerWidth>e,s=document.documentElement.clientHeight;r&&s>e?this.style.setProperty("--vaadin-overlay-viewport-bottom",`${s-e}px`):this.style.setProperty("--vaadin-overlay-viewport-bottom","0")}_addGlobalListeners(){document.addEventListener("mousedown",this._boundMouseDownListener),document.addEventListener("mouseup",this._boundMouseUpListener),document.documentElement.addEventListener("click",this._boundOutsideClickListener,!0)}_removeGlobalListeners(){document.removeEventListener("mousedown",this._boundMouseDownListener),document.removeEventListener("mouseup",this._boundMouseUpListener),document.documentElement.removeEventListener("click",this._boundOutsideClickListener,!0)}_rendererOrDataChanged(e,t,r,s){const n=this._oldOwner!==t||this._oldModel!==r;this._oldModel=r,this._oldOwner=t;const l=this._oldRenderer!==e,d=this._oldRenderer!==void 0;this._oldRenderer=e;const h=this._oldOpened!==s;this._oldOpened=s,l&&d&&(this.innerHTML="",delete this._$litPart$),s&&e&&(l||h||n)&&this.requestContentUpdate()}_modelessChanged(e){e?(this._removeGlobalListeners(),this._exitModalState()):this.opened&&(this._addGlobalListeners(),this._enterModalState())}_openedChanged(e,t){e?(this._saveFocus(),this._animatedOpening(),Ht(this,()=>{this._trapFocus();const r=new CustomEvent("vaadin-overlay-open",{bubbles:!0});this.dispatchEvent(r)}),document.addEventListener("keydown",this._boundKeydownListener),this.modeless||this._addGlobalListeners()):t&&(this._resetFocus(),this._animatedClosing(),document.removeEventListener("keydown",this._boundKeydownListener),this.modeless||this._removeGlobalListeners())}_hiddenChanged(e){e&&this.hasAttribute("closing")&&this._flushAnimation("closing")}_shouldAnimate(){const e=getComputedStyle(this),t=e.getPropertyValue("animation-name");return!(e.getPropertyValue("display")==="none")&&t&&t!=="none"}_enqueueAnimation(e,t){const r=`__${e}Handler`,s=n=>{n&&n.target!==this||(t(),this.removeEventListener("animationend",s),delete this[r])};this[r]=s,this.addEventListener("animationend",s)}_flushAnimation(e){const t=`__${e}Handler`;typeof this[t]=="function"&&this[t]()}_animatedOpening(){this.parentNode===document.body&&this.hasAttribute("closing")&&this._flushAnimation("closing"),this._attachOverlay(),this.modeless||this._enterModalState(),this.setAttribute("opening",""),this._shouldAnimate()?this._enqueueAnimation("opening",()=>{this._finishOpening()}):this._finishOpening()}_attachOverlay(){this._placeholder=document.createComment("vaadin-overlay-placeholder"),this.parentNode.insertBefore(this._placeholder,this),document.body.appendChild(this),this.bringToFront()}_finishOpening(){this.removeAttribute("opening")}_finishClosing(){this._detachOverlay(),this.$.overlay.style.removeProperty("pointer-events"),this.removeAttribute("closing"),this.dispatchEvent(new CustomEvent("vaadin-overlay-closed"))}_animatedClosing(){this.hasAttribute("opening")&&this._flushAnimation("opening"),this._placeholder&&(this._exitModalState(),this.setAttribute("closing",""),this.dispatchEvent(new CustomEvent("vaadin-overlay-closing")),this._shouldAnimate()?this._enqueueAnimation("closing",()=>{this._finishClosing()}):this._finishClosing())}_detachOverlay(){this._placeholder.parentNode.insertBefore(this,this._placeholder),this._placeholder.parentNode.removeChild(this._placeholder)}_mouseDownListener(e){this._mouseDownInside=e.composedPath().indexOf(this.$.overlay)>=0}_mouseUpListener(e){this._mouseUpInside=e.composedPath().indexOf(this.$.overlay)>=0}_shouldCloseOnOutsideClick(e){return this._last}_outsideClickListener(e){if(e.composedPath().includes(this.$.overlay)||this._mouseDownInside||this._mouseUpInside){this._mouseDownInside=!1,this._mouseUpInside=!1;return}if(!this._shouldCloseOnOutsideClick(e))return;const t=new CustomEvent("vaadin-overlay-outside-click",{bubbles:!0,cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),this.opened&&!t.defaultPrevented&&this.close(e)}_keydownListener(e){if(this._last&&!(this.modeless&&!e.composedPath().includes(this.$.overlay))&&e.key==="Escape"){const t=new CustomEvent("vaadin-overlay-escape-press",{bubbles:!0,cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),this.opened&&!t.defaultPrevented&&this.close(e)}}};/**
|
|
1183
|
-
* @license
|
|
1184
|
-
* Copyright (c) 2024 Vaadin Ltd.
|
|
1185
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1186
|
-
*/function tr(a,i){let e=null;const t=document.documentElement;function r(){e&&e.disconnect(),e=null}function s(n=!1,l=1){r();const{left:d,top:h,width:m,height:u}=a.getBoundingClientRect();if(n||i(),!m||!u)return;const v=Math.floor(h),_=Math.floor(t.clientWidth-(d+m)),y=Math.floor(t.clientHeight-(h+u)),z=Math.floor(d),R={rootMargin:`${-v}px ${-_}px ${-y}px ${-z}px`,threshold:Math.max(0,Math.min(1,l))||1};let E=!0;function q(W){let B=W[0].intersectionRatio;if(B!==l){if(!E)return s();B===0&&(B=1e-7),s(!1,B)}E=!1}e=new IntersectionObserver(q,R),e.observe(a)}return s(!0),r}/**
|
|
1187
|
-
* @license
|
|
1188
|
-
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
1189
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1190
|
-
*/const Le={start:"top",end:"bottom"},ze={start:"left",end:"right"},mt=new ResizeObserver(a=>{setTimeout(()=>{a.forEach(i=>{i.target.__overlay&&i.target.__overlay._updatePosition()})})}),$t=a=>class extends a{static get properties(){return{positionTarget:{type:Object,value:null,sync:!0},horizontalAlign:{type:String,value:"start",sync:!0},verticalAlign:{type:String,value:"top",sync:!0},noHorizontalOverlap:{type:Boolean,value:!1,sync:!0},noVerticalOverlap:{type:Boolean,value:!1,sync:!0},requiredVerticalSpace:{type:Number,value:0,sync:!0}}}static get observers(){return["__positionSettingsChanged(horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap, requiredVerticalSpace)","__overlayOpenedChanged(opened, positionTarget)"]}constructor(){super(),this.__onScroll=this.__onScroll.bind(this),this._updatePosition=this._updatePosition.bind(this)}connectedCallback(){super.connectedCallback(),this.opened&&this.__addUpdatePositionEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.__removeUpdatePositionEventListeners()}__addUpdatePositionEventListeners(){window.visualViewport.addEventListener("resize",this._updatePosition),window.visualViewport.addEventListener("scroll",this.__onScroll,!0),this.__positionTargetAncestorRootNodes=o.getAncestorRootNodes(this.positionTarget),this.__positionTargetAncestorRootNodes.forEach(e=>{e.addEventListener("scroll",this.__onScroll,!0)}),this.positionTarget&&(this.__observePositionTargetMove=tr(this.positionTarget,()=>{this._updatePosition()}))}__removeUpdatePositionEventListeners(){window.visualViewport.removeEventListener("resize",this._updatePosition),window.visualViewport.removeEventListener("scroll",this.__onScroll,!0),this.__positionTargetAncestorRootNodes&&(this.__positionTargetAncestorRootNodes.forEach(e=>{e.removeEventListener("scroll",this.__onScroll,!0)}),this.__positionTargetAncestorRootNodes=null),this.__observePositionTargetMove&&(this.__observePositionTargetMove(),this.__observePositionTargetMove=null)}__overlayOpenedChanged(e,t){if(this.__removeUpdatePositionEventListeners(),t&&(t.__overlay=null,mt.unobserve(t),e&&(this.__addUpdatePositionEventListeners(),t.__overlay=this,mt.observe(t))),e){const r=getComputedStyle(this);this.__margins||(this.__margins={},["top","bottom","left","right"].forEach(s=>{this.__margins[s]=parseInt(r[s],10)})),this._updatePosition(),requestAnimationFrame(()=>this._updatePosition())}}__positionSettingsChanged(){this._updatePosition()}__onScroll(e){e.target instanceof Node&&this.contains(e.target)||this._updatePosition()}_updatePosition(){if(!this.positionTarget||!this.opened||!this.__margins)return;const e=this.positionTarget.getBoundingClientRect();if(e.width===0&&e.height===0&&this.opened){this.opened=!1;return}const t=this.__shouldAlignStartVertically(e);this.style.justifyContent=t?"flex-start":"flex-end";const r=this.__isRTL,s=this.__shouldAlignStartHorizontally(e,r),n=!r&&s||r&&!s;this.style.alignItems=n?"flex-start":"flex-end";const l=this.getBoundingClientRect(),d=this.__calculatePositionInOneDimension(e,l,this.noVerticalOverlap,Le,this,t),h=this.__calculatePositionInOneDimension(e,l,this.noHorizontalOverlap,ze,this,s);Object.assign(this.style,d,h),this.toggleAttribute("bottom-aligned",!t),this.toggleAttribute("top-aligned",t),this.toggleAttribute("end-aligned",!n),this.toggleAttribute("start-aligned",n)}__shouldAlignStartHorizontally(e,t){const r=Math.max(this.__oldContentWidth||0,this.$.overlay.offsetWidth);this.__oldContentWidth=this.$.overlay.offsetWidth;const s=Math.min(window.innerWidth,document.documentElement.clientWidth),n=!t&&this.horizontalAlign==="start"||t&&this.horizontalAlign==="end";return this.__shouldAlignStart(e,r,s,this.__margins,n,this.noHorizontalOverlap,ze)}__shouldAlignStartVertically(e){const t=this.requiredVerticalSpace||Math.max(this.__oldContentHeight||0,this.$.overlay.offsetHeight);this.__oldContentHeight=this.$.overlay.offsetHeight;const r=Math.min(window.innerHeight,document.documentElement.clientHeight),s=this.verticalAlign==="top";return this.__shouldAlignStart(e,t,r,this.__margins,s,this.noVerticalOverlap,Le)}__shouldAlignStart(e,t,r,s,n,l,d){const h=r-e[l?d.end:d.start]-s[d.end],m=e[l?d.start:d.end]-s[d.start],u=n?h:m,_=u>(n?m:h)||u>t;return n===_}__adjustBottomProperty(e,t,r){let s;if(e===t.end){if(t.end===Le.end){const n=Math.min(window.innerHeight,document.documentElement.clientHeight);if(r>n&&this.__oldViewportHeight){const l=this.__oldViewportHeight-n;s=r-l}this.__oldViewportHeight=n}if(t.end===ze.end){const n=Math.min(window.innerWidth,document.documentElement.clientWidth);if(r>n&&this.__oldViewportWidth){const l=this.__oldViewportWidth-n;s=r-l}this.__oldViewportWidth=n}}return s}__calculatePositionInOneDimension(e,t,r,s,n,l){const d=l?s.start:s.end,h=l?s.end:s.start,m=parseFloat(n.style[d]||getComputedStyle(n)[d]),u=this.__adjustBottomProperty(d,s,m),v=t[l?s.start:s.end]-e[r===l?s.end:s.start],_=u?`${u}px`:`${m+v*(l?-1:1)}px`;return{[d]:_,[h]:""}}};/**
|
|
1191
|
-
* @license
|
|
1192
|
-
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
1193
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1194
|
-
*/const ir=a=>class extends $t(Rt(a)){_shouldCloseOnOutsideClick(e){return!e.composedPath().includes(this.positionTarget)}_mouseDownListener(e){super._mouseDownListener(e),this._shouldCloseOnOutsideClick(e)&&!o.isElementFocusable(e.composedPath()[0])&&e.preventDefault()}};/**
|
|
1195
|
-
* @license
|
|
1196
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1197
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1198
|
-
*/const rr=o.i$3`
|
|
1199
|
-
[part='overlay'] {
|
|
1200
|
-
display: flex;
|
|
1201
|
-
flex: auto;
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
[part~='content'] {
|
|
1205
|
-
flex: auto;
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
@media (forced-colors: active) {
|
|
1209
|
-
[part='overlay'] {
|
|
1210
|
-
outline: 3px solid;
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
`;/**
|
|
1214
|
-
* @license
|
|
1215
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1216
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1217
|
-
*/o.registerStyles("vaadin-date-picker-overlay",[Vt,rr],{moduleId:"vaadin-date-picker-overlay-styles"});class ar extends ir(o.DirMixin(o.ThemableMixin(o.PolymerElement))){static get is(){return"vaadin-date-picker-overlay"}static get template(){return o.html`
|
|
1218
|
-
<div id="backdrop" part="backdrop" hidden$="[[!withBackdrop]]"></div>
|
|
1219
|
-
<div part="overlay" id="overlay">
|
|
1220
|
-
<div part="content" id="content">
|
|
1221
|
-
<slot></slot>
|
|
1222
|
-
</div>
|
|
1223
|
-
</div>
|
|
1224
|
-
`}}o.defineCustomElement(ar);/**
|
|
1225
|
-
* @license
|
|
1226
|
-
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
1227
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1228
|
-
*/o.registerStyles("vaadin-button",o.buttonStyles,{moduleId:"vaadin-button-styles"});class sr extends o.ButtonMixin(o.ElementMixin(o.ThemableMixin(o.ControllerMixin(o.PolymerElement)))){static get is(){return"vaadin-button"}static get template(){return o.buttonTemplate(o.html)}ready(){super.ready(),this._tooltipController=new o.TooltipController(this),this.addController(this._tooltipController)}}o.defineCustomElement(sr);/**
|
|
1229
|
-
* @license
|
|
1230
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1231
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1232
|
-
*/function nr(a){let i=a.getDay();i===0&&(i=7);const e=4-i,t=new Date(a.getTime()+e*24*3600*1e3),r=new Date(0,0);r.setFullYear(t.getFullYear());const s=t.getTime()-r.getTime(),n=Math.round(s/(24*3600*1e3));return Math.floor(n/7+1)}function qe(a){const i=new Date(a);return i.setHours(0,0,0,0),i}function Y(a,i,e=qe){return a instanceof Date&&i instanceof Date&&e(a).getTime()===e(i).getTime()}function Xe(a){return{day:a.getDate(),month:a.getMonth(),year:a.getFullYear()}}function ae(a,i,e,t){let r=!1;if(typeof t=="function"&&a){const s=Xe(a);r=t(s)}return(!i||a>=i)&&(!e||a<=e)&&!r}function Bt(a,i){return i.filter(e=>e!==void 0).reduce((e,t)=>{if(!t)return e;if(!e)return t;const r=Math.abs(a.getTime()-t.getTime()),s=Math.abs(e.getTime()-a.getTime());return r<s?t:e})}function Nt(a){const i=new Date,e=new Date(i);return e.setDate(1),e.setMonth(parseInt(a)+i.getMonth()),e}function or(a,i,e=0,t=1){if(i>99)throw new Error("The provided year cannot have more than 2 digits.");if(i<0)throw new Error("The provided year cannot be negative.");let r=i+Math.floor(a.getFullYear()/100)*100;return a<new Date(r-50,e,t)?r-=100:a>new Date(r+50,e,t)&&(r+=100),r}function fe(a){const i=/^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/u.exec(a);if(!i)return;const e=new Date(0,0);return e.setFullYear(parseInt(i[1],10)),e.setMonth(parseInt(i[2],10)-1),e.setDate(parseInt(i[3],10)),e}function lr(a){const i=(d,h="00")=>(h+d).substr((h+d).length-h.length);let e="",t="0000",r=a.year;r<0?(r=-r,e="-",t="000000"):a.year>=1e4&&(e="+",t="000000");const s=e+i(r,t),n=i(a.month+1),l=i(a.day);return[s,n,l].join("-")}function dr(a){return a instanceof Date?lr({year:a.getFullYear(),month:a.getMonth(),day:a.getDate()}):""}/**
|
|
1233
|
-
@license
|
|
1234
|
-
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
1235
|
-
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
1236
|
-
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
1237
|
-
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
1238
|
-
Code distributed by Google as part of the polymer project is also
|
|
1239
|
-
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1240
|
-
*/class Ce{constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(i,e){this._asyncModule=i,this._callback=e,this._timer=this._asyncModule.run(()=>{this._timer=null,me.delete(this),this._callback()})}cancel(){this.isActive()&&(this._cancelAsync(),me.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return this._timer!=null}static debounce(i,e,t){return i instanceof Ce?i._cancelAsync():i=new Ce,i.setConfig(e,t),i}}let me=new Set;const hr=function(a){me.add(a)},cr=function(){const a=!!me.size;return me.forEach(i=>{try{i.flush()}catch(e){setTimeout(()=>{throw e})}}),a};/**
|
|
1241
|
-
@license
|
|
1242
|
-
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
1243
|
-
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
1244
|
-
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
1245
|
-
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
1246
|
-
Code distributed by Google as part of the polymer project is also
|
|
1247
|
-
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1248
|
-
*/const Je=function(){let a,i;do a=window.ShadyDOM&&ShadyDOM.flush(),window.ShadyCSS&&window.ShadyCSS.ScopingShim&&window.ShadyCSS.ScopingShim.flush(),i=cr();while(a||i)};/**
|
|
1249
|
-
* @license
|
|
1250
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1251
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1252
|
-
*/const qt=document.createElement("template");qt.innerHTML=`
|
|
1253
|
-
<style>
|
|
1254
|
-
:host {
|
|
1255
|
-
display: block;
|
|
1256
|
-
overflow: hidden;
|
|
1257
|
-
height: 500px;
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
#scroller {
|
|
1261
|
-
position: relative;
|
|
1262
|
-
height: 100%;
|
|
1263
|
-
overflow: auto;
|
|
1264
|
-
outline: none;
|
|
1265
|
-
margin-right: -40px;
|
|
1266
|
-
-webkit-overflow-scrolling: touch;
|
|
1267
|
-
overflow-x: hidden;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
#scroller.notouchscroll {
|
|
1271
|
-
-webkit-overflow-scrolling: auto;
|
|
1272
|
-
}
|
|
1273
|
-
|
|
1274
|
-
#scroller::-webkit-scrollbar {
|
|
1275
|
-
display: none;
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
.buffer {
|
|
1279
|
-
position: absolute;
|
|
1280
|
-
width: var(--vaadin-infinite-scroller-buffer-width, 100%);
|
|
1281
|
-
box-sizing: border-box;
|
|
1282
|
-
padding-right: 40px;
|
|
1283
|
-
top: var(--vaadin-infinite-scroller-buffer-offset, 0);
|
|
1284
|
-
animation: fadein 0.2s;
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
@keyframes fadein {
|
|
1288
|
-
from {
|
|
1289
|
-
opacity: 0;
|
|
1290
|
-
}
|
|
1291
|
-
to {
|
|
1292
|
-
opacity: 1;
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
</style>
|
|
1296
|
-
|
|
1297
|
-
<div id="scroller" tabindex="-1">
|
|
1298
|
-
<div class="buffer"></div>
|
|
1299
|
-
<div class="buffer"></div>
|
|
1300
|
-
<div id="fullHeight"></div>
|
|
1301
|
-
</div>
|
|
1302
|
-
`;class Ut extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).appendChild(qt.content.cloneNode(!0)),this.bufferSize=20,this._initialScroll=5e5,this._initialIndex=0,this._activated=!1}get active(){return this._activated}set active(i){i&&!this._activated&&(this._createPool(),this._activated=!0)}get bufferOffset(){return this._buffers[0].offsetTop}get itemHeight(){if(!this._itemHeightVal){const i=getComputedStyle(this).getPropertyValue("--vaadin-infinite-scroller-item-height"),e="background-position";this.$.fullHeight.style.setProperty(e,i);const t=getComputedStyle(this.$.fullHeight).getPropertyValue(e);this.$.fullHeight.style.removeProperty(e),this._itemHeightVal=parseFloat(t)}return this._itemHeightVal}get _bufferHeight(){return this.itemHeight*this.bufferSize}get position(){return(this.$.scroller.scrollTop-this._buffers[0].translateY)/this.itemHeight+this._firstIndex}set position(i){this._preventScrollEvent=!0,i>this._firstIndex&&i<this._firstIndex+this.bufferSize*2?this.$.scroller.scrollTop=this.itemHeight*(i-this._firstIndex)+this._buffers[0].translateY:(this._initialIndex=~~i,this._reset(),this._scrollDisabled=!0,this.$.scroller.scrollTop+=i%1*this.itemHeight,this._scrollDisabled=!1),this._mayHaveMomentum&&(this.$.scroller.classList.add("notouchscroll"),this._mayHaveMomentum=!1,setTimeout(()=>{this.$.scroller.classList.remove("notouchscroll")},10))}connectedCallback(){this._ready||(this._ready=!0,this.$={},this.shadowRoot.querySelectorAll("[id]").forEach(i=>{this.$[i.id]=i}),this.$.scroller.addEventListener("scroll",()=>this._scroll()),this._buffers=[...this.shadowRoot.querySelectorAll(".buffer")],this.$.fullHeight.style.height=`${this._initialScroll*2}px`)}disconnectedCallback(){this._debouncerScrollFinish&&this._debouncerScrollFinish.cancel(),this._debouncerUpdateClones&&this._debouncerUpdateClones.cancel(),this.__pendingFinishInit&&cancelAnimationFrame(this.__pendingFinishInit)}forceUpdate(){this._debouncerScrollFinish&&this._debouncerScrollFinish.flush(),this._debouncerUpdateClones&&(this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(),this._debouncerUpdateClones.cancel()),Je()}_createElement(){}_updateElement(i,e){}_finishInit(){this._initDone||(this._buffers.forEach(i=>{[...i.children].forEach(e=>{this._ensureStampedInstance(e._itemWrapper)})}),this._buffers[0].translateY||this._reset(),this._initDone=!0,this.dispatchEvent(new CustomEvent("init-done")))}_translateBuffer(i){const e=i?1:0;this._buffers[e].translateY=this._buffers[e?0:1].translateY+this._bufferHeight*(e?-1:1),this._buffers[e].style.transform=`translate3d(0, ${this._buffers[e].translateY}px, 0)`,this._buffers[e].updated=!1,this._buffers.reverse()}_scroll(){if(this._scrollDisabled)return;const i=this.$.scroller.scrollTop;(i<this._bufferHeight||i>this._initialScroll*2-this._bufferHeight)&&(this._initialIndex=~~this.position,this._reset());const e=this.itemHeight+this.bufferOffset,t=i>this._buffers[1].translateY+e,r=i<this._buffers[0].translateY+e;(t||r)&&(this._translateBuffer(r),this._updateClones()),this._preventScrollEvent||(this.dispatchEvent(new CustomEvent("custom-scroll",{bubbles:!1,composed:!0})),this._mayHaveMomentum=!0),this._preventScrollEvent=!1,this._debouncerScrollFinish=o.Debouncer.debounce(this._debouncerScrollFinish,o.timeOut.after(200),()=>{const s=this.$.scroller.getBoundingClientRect();!this._isVisible(this._buffers[0],s)&&!this._isVisible(this._buffers[1],s)&&(this.position=this.position)})}_reset(){this._scrollDisabled=!0,this.$.scroller.scrollTop=this._initialScroll,this._buffers[0].translateY=this._initialScroll-this._bufferHeight,this._buffers[1].translateY=this._initialScroll,this._buffers.forEach(i=>{i.style.transform=`translate3d(0, ${i.translateY}px, 0)`}),this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(!0),this._debouncerUpdateClones=o.Debouncer.debounce(this._debouncerUpdateClones,o.timeOut.after(200),()=>{this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones()}),this._scrollDisabled=!1}_createPool(){const i=this.getBoundingClientRect();this._buffers.forEach(e=>{for(let t=0;t<this.bufferSize;t++){const r=document.createElement("div");r.style.height=`${this.itemHeight}px`,r.instance={};const s=`vaadin-infinite-scroller-item-content-${o.generateUniqueId()}`,n=document.createElement("slot");n.setAttribute("name",s),n._itemWrapper=r,e.appendChild(n),r.setAttribute("slot",s),this.appendChild(r),this._isVisible(r,i)&&this._ensureStampedInstance(r)}}),this.__pendingFinishInit=requestAnimationFrame(()=>{this._finishInit(),this.__pendingFinishInit=null})}_ensureStampedInstance(i){if(i.firstElementChild)return;const e=i.instance;i.instance=this._createElement(),i.appendChild(i.instance),i.instance.performUpdate&&i.instance.performUpdate(),Object.keys(e).forEach(t=>{i.instance[t]=e[t]})}_updateClones(i){this._firstIndex=Math.round((this._buffers[0].translateY-this._initialScroll)/this.itemHeight)+this._initialIndex;const e=i?this.$.scroller.getBoundingClientRect():void 0;this._buffers.forEach((t,r)=>{if(!t.updated){const s=this._firstIndex+this.bufferSize*r;[...t.children].forEach((n,l)=>{const d=n._itemWrapper;(!i||this._isVisible(d,e))&&this._updateElement(d.instance,s+l)}),t.updated=!0}})}_isVisible(i,e){const t=i.getBoundingClientRect();return t.bottom>e.top&&t.top<e.bottom}}/**
|
|
1303
|
-
* @license
|
|
1304
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1305
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1306
|
-
*/const Yt=document.createElement("template");Yt.innerHTML=`
|
|
1307
|
-
<style>
|
|
1308
|
-
:host {
|
|
1309
|
-
--vaadin-infinite-scroller-item-height: 270px;
|
|
1310
|
-
position: absolute;
|
|
1311
|
-
top: 0;
|
|
1312
|
-
left: 0;
|
|
1313
|
-
right: 0;
|
|
1314
|
-
bottom: 0;
|
|
1315
|
-
height: 100%;
|
|
1316
|
-
}
|
|
1317
|
-
</style>
|
|
1318
|
-
`;class ur extends Ut{static get is(){return"vaadin-date-picker-month-scroller"}constructor(){super(),this.bufferSize=3,this.shadowRoot.appendChild(Yt.content.cloneNode(!0))}_createElement(){return document.createElement("vaadin-month-calendar")}_updateElement(i,e){i.month=Nt(e)}}o.defineCustomElement(ur);/**
|
|
1319
|
-
* @license
|
|
1320
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1321
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1322
|
-
*/const Wt=document.createElement("template");Wt.innerHTML=`
|
|
1323
|
-
<style>
|
|
1324
|
-
:host {
|
|
1325
|
-
--vaadin-infinite-scroller-item-height: 80px;
|
|
1326
|
-
width: 50px;
|
|
1327
|
-
display: block;
|
|
1328
|
-
height: 100%;
|
|
1329
|
-
position: absolute;
|
|
1330
|
-
right: 0;
|
|
1331
|
-
transform: translateX(100%);
|
|
1332
|
-
-webkit-tap-highlight-color: transparent;
|
|
1333
|
-
-webkit-user-select: none;
|
|
1334
|
-
-moz-user-select: none;
|
|
1335
|
-
user-select: none;
|
|
1336
|
-
/* Center the year scroller position. */
|
|
1337
|
-
--vaadin-infinite-scroller-buffer-offset: 50%;
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
:host::before {
|
|
1341
|
-
content: '';
|
|
1342
|
-
display: block;
|
|
1343
|
-
background: transparent;
|
|
1344
|
-
width: 0;
|
|
1345
|
-
height: 0;
|
|
1346
|
-
position: absolute;
|
|
1347
|
-
left: 0;
|
|
1348
|
-
top: 50%;
|
|
1349
|
-
transform: translateY(-50%);
|
|
1350
|
-
border-width: 6px;
|
|
1351
|
-
border-style: solid;
|
|
1352
|
-
border-color: transparent;
|
|
1353
|
-
border-left-color: #000;
|
|
1354
|
-
}
|
|
1355
|
-
</style>
|
|
1356
|
-
`;class pr extends Ut{static get is(){return"vaadin-date-picker-year-scroller"}constructor(){super(),this.bufferSize=12,this.shadowRoot.appendChild(Wt.content.cloneNode(!0))}_createElement(){return document.createElement("vaadin-date-picker-year")}_updateElement(i,e){i.year=this._yearAfterXYears(e)}_yearAfterXYears(i){const e=new Date,t=new Date(e);return t.setFullYear(parseInt(i)+e.getFullYear()),t.getFullYear()}}o.defineCustomElement(pr);/**
|
|
1357
|
-
* @license
|
|
1358
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1359
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1360
|
-
*/const fr=a=>class extends a{static get properties(){return{year:{type:String,sync:!0},selectedDate:{type:Object,sync:!0}}}static get observers(){return["__updateSelected(year, selectedDate)"]}__updateSelected(e,t){this.toggleAttribute("selected",t&&t.getFullYear()===e),this.toggleAttribute("current",e===new Date().getFullYear())}};/**
|
|
1361
|
-
* @license
|
|
1362
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1363
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1364
|
-
*/class mr extends o.ThemableMixin(fr(o.PolymerElement)){static get is(){return"vaadin-date-picker-year"}static get template(){return o.html`
|
|
1365
|
-
<style>
|
|
1366
|
-
:host {
|
|
1367
|
-
display: block;
|
|
1368
|
-
height: 100%;
|
|
1369
|
-
}
|
|
1370
|
-
</style>
|
|
1371
|
-
<div part="year-number">[[year]]</div>
|
|
1372
|
-
<div part="year-separator" aria-hidden="true"></div>
|
|
1373
|
-
`}}o.defineCustomElement(mr);/**
|
|
1374
|
-
@license
|
|
1375
|
-
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
1376
|
-
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
1377
|
-
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
1378
|
-
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
1379
|
-
Code distributed by Google as part of the polymer project is also
|
|
1380
|
-
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1381
|
-
*/function Ze(a,i,e,t,r){let s;r&&(s=typeof e=="object"&&e!==null,s&&(t=a.__dataTemp[i]));let n=t!==e&&(t===t||e===e);return s&&n&&(a.__dataTemp[i]=e),n}const et=o.dedupingMixin(a=>{class i extends a{_shouldPropertyChange(t,r,s){return Ze(this,t,r,s,!0)}}return i}),_r=o.dedupingMixin(a=>{class i extends a{static get properties(){return{mutableData:Boolean}}_shouldPropertyChange(t,r,s){return Ze(this,t,r,s,this.mutableData)}}return i});et._mutablePropertyChange=Ze;/**
|
|
1382
|
-
@license
|
|
1383
|
-
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
1384
|
-
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
1385
|
-
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
1386
|
-
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
1387
|
-
Code distributed by Google as part of the polymer project is also
|
|
1388
|
-
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1389
|
-
*/let Ue=null;function Ye(){return Ue}Ye.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:Ye,writable:!0}});const jt=o.PropertyEffects(Ye),vr=et(jt);function gr(a,i){Ue=a,Object.setPrototypeOf(a,i.prototype),new i,Ue=null}const br=o.PropertyEffects(class{});function yr(a,i){for(let e=0;e<i.length;e++){let t=i[e];if(!!a!=!!t.__hideTemplateChildren__)if(t.nodeType===Node.TEXT_NODE)a?(t.__polymerTextContent__=t.textContent,t.textContent=""):t.textContent=t.__polymerTextContent__;else if(t.localName==="slot")if(a)t.__polymerReplaced__=document.createComment("hidden-slot"),o.wrap$1(o.wrap$1(t).parentNode).replaceChild(t.__polymerReplaced__,t);else{const r=t.__polymerReplaced__;r&&o.wrap$1(o.wrap$1(r).parentNode).replaceChild(t,r)}else t.style&&(a?(t.__polymerDisplay__=t.style.display,t.style.display="none"):t.style.display=t.__polymerDisplay__);t.__hideTemplateChildren__=a,t._showHideChildren&&t._showHideChildren(a)}}class tt extends br{constructor(i){super(),this._configureProperties(i),this.root=this._stampTemplate(this.__dataHost);let e=[];this.children=e;for(let r=this.root.firstChild;r;r=r.nextSibling)e.push(r),r.__templatizeInstance=this;this.__templatizeOwner&&this.__templatizeOwner.__hideTemplateChildren__&&this._showHideChildren(!0);let t=this.__templatizeOptions;(i&&t.instanceProps||!t.instanceProps)&&this._enableProperties()}_configureProperties(i){if(this.__templatizeOptions.forwardHostProp)for(let t in this.__hostProps)this._setPendingProperty(t,this.__dataHost["_host_"+t]);for(let t in i)this._setPendingProperty(t,i[t])}forwardHostProp(i,e){this._setPendingPropertyOrPath(i,e,!1,!0)&&this.__dataHost._enqueueClient(this)}_addEventListenerToNode(i,e,t){if(this._methodHost&&this.__templatizeOptions.parentModel)this._methodHost._addEventListenerToNode(i,e,r=>{r.model=this,t(r)});else{let r=this.__dataHost.__dataHost;r&&r._addEventListenerToNode(i,e,t)}}_showHideChildren(i){yr(i,this.children)}_setUnmanagedPropertyToNode(i,e,t){i.__hideTemplateChildren__&&i.nodeType==Node.TEXT_NODE&&e=="textContent"?i.__polymerTextContent__=t:super._setUnmanagedPropertyToNode(i,e,t)}get parentModel(){let i=this.__parentModel;if(!i){let e;i=this;do i=i.__dataHost.__dataHost;while((e=i.__templatizeOptions)&&!e.parentModel);this.__parentModel=i}return i}dispatchEvent(i){return!0}}const wr=et(tt);function _t(a){let i=a.__dataHost;return i&&i._methodHost||i}function xr(a,i,e){let t=e.mutableData?wr:tt;We.mixin&&(t=We.mixin(t));let r=class extends t{};return r.prototype.__templatizeOptions=e,r.prototype._bindTemplate(a),Tr(r,a,i,e),r}function Cr(a,i,e,t){let r=e.forwardHostProp;if(r&&i.hasHostProps){const s=a.localName=="template";let n=i.templatizeTemplateClass;if(!n){if(s){let d=e.mutableData?vr:jt;class h extends d{}n=i.templatizeTemplateClass=h}else{const d=a.constructor;class h extends d{}n=i.templatizeTemplateClass=h}let l=i.hostProps;for(let d in l)n.prototype._addPropertyEffect("_host_"+d,n.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:kr(d,r)}),n.prototype._createNotifyingProperty("_host_"+d);o.legacyWarnings&&t&&Er(i,e,t)}if(a.__dataProto&&Object.assign(a.__data,a.__dataProto),s)gr(a,n),a.__dataTemp={},a.__dataPending=null,a.__dataOld=null,a._enableProperties();else{Object.setPrototypeOf(a,n.prototype);const l=i.hostProps;for(let d in l)if(d="_host_"+d,d in a){const h=a[d];delete a[d],a.__data[d]=h}}}}function kr(a,i){return function(t,r,s){i.call(t.__templatizeOwner,r.substring(6),s[r])}}function Tr(a,i,e,t){let r=e.hostProps||{};for(let s in t.instanceProps){delete r[s];let n=t.notifyInstanceProp;n&&a.prototype._addPropertyEffect(s,a.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:Dr(s,n)})}if(t.forwardHostProp&&i.__dataHost)for(let s in r)e.hasHostProps||(e.hasHostProps=!0),a.prototype._addPropertyEffect(s,a.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:Ir()})}function Dr(a,i){return function(t,r,s){i.call(t.__templatizeOwner,t,r,s[r])}}function Ir(){return function(i,e,t){i.__dataHost._setPendingPropertyOrPath("_host_"+e,t[e],!0,!0)}}function We(a,i,e){if(o.strictTemplatePolicy&&!_t(a))throw new Error("strictTemplatePolicy: template owner not trusted");if(e=e||{},a.__templatizeOwner)throw new Error("A <template> can only be templatized once");a.__templatizeOwner=i;let r=(i?i.constructor:tt)._parseTemplate(a),s=r.templatizeInstanceClass;s||(s=xr(a,r,e),r.templatizeInstanceClass=s);const n=_t(a);Cr(a,r,e,n);let l=class extends s{};return l.prototype._methodHost=n,l.prototype.__dataHost=a,l.prototype.__templatizeOwner=i,l.prototype.__hostProps=r.hostProps,l=l,l}function Er(a,i,e){const t=e.constructor._properties,{propertyEffects:r}=a,{instanceProps:s}=i;for(let n in r)if(!t[n]&&!(s&&s[n])){const l=r[n];for(let d=0;d<l.length;d++){const{part:h}=l[d].info;if(!(h.signature&&h.signature.static)){console.warn(`Property '${n}' used in template but not declared in 'properties'; attribute will not be observed.`);break}}}}function Sr(a,i){let e;for(;i;)if(e=i.__dataHost?i:i.__templatizeInstance)if(e.__dataHost!=a)i=e.__dataHost;else return e;else i=o.wrap$1(i).parentNode;return null}/**
|
|
1390
|
-
@license
|
|
1391
|
-
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
1392
|
-
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
1393
|
-
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
1394
|
-
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
1395
|
-
Code distributed by Google as part of the polymer project is also
|
|
1396
|
-
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1397
|
-
*/let vt=!1;function Pr(){if(o.legacyOptimizations&&!o.useShadow){if(!vt){vt=!0;const a=document.createElement("style");a.textContent="dom-bind,dom-if,dom-repeat{display:none;}",document.head.appendChild(a)}return!0}return!1}/**
|
|
1398
|
-
@license
|
|
1399
|
-
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
1400
|
-
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
1401
|
-
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
1402
|
-
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
1403
|
-
Code distributed by Google as part of the polymer project is also
|
|
1404
|
-
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1405
|
-
*/const Mr=_r(o.PolymerElement);class gt extends Mr{static get is(){return"dom-repeat"}static get template(){return null}static get properties(){return{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},itemsIndexAs:{type:String,value:"itemsIndex"},sort:{type:Function,observer:"__sortChanged"},filter:{type:Function,observer:"__filterChanged"},observe:{type:String,observer:"__observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:!o.suppressTemplateNotifications,readOnly:!0},initialCount:{type:Number},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"__computeFrameTime(targetFramerate)"},notifyDomChange:{type:Boolean},reuseChunkedInstances:{type:Boolean}}}static get observers(){return["__itemsChanged(items.*)"]}constructor(){super(),this.__instances=[],this.__renderDebouncer=null,this.__itemsIdxToInstIdx={},this.__chunkCount=null,this.__renderStartTime=null,this.__itemsArrayChanged=!1,this.__shouldMeasureChunk=!1,this.__shouldContinueChunking=!1,this.__chunkingId=0,this.__sortFn=null,this.__filterFn=null,this.__observePaths=null,this.__ctor=null,this.__isDetached=!0,this.template=null}disconnectedCallback(){super.disconnectedCallback(),this.__isDetached=!0;for(let i=0;i<this.__instances.length;i++)this.__detachInstance(i);this.__chunkingId&&cancelAnimationFrame(this.__chunkingId)}connectedCallback(){if(super.connectedCallback(),Pr()||(this.style.display="none"),this.__isDetached){this.__isDetached=!1;let i=o.wrap$1(o.wrap$1(this).parentNode);for(let e=0;e<this.__instances.length;e++)this.__attachInstance(e,i);this.__chunkingId&&this.__render()}}__ensureTemplatized(){if(!this.__ctor){const i=this;let e=this.template=i._templateInfo?i:this.querySelector("template");if(!e){let r=new MutationObserver(()=>{if(this.querySelector("template"))r.disconnect(),this.__render();else throw new Error("dom-repeat requires a <template> child")});return r.observe(this,{childList:!0}),!1}let t={};t[this.as]=!0,t[this.indexAs]=!0,t[this.itemsIndexAs]=!0,this.__ctor=We(e,this,{mutableData:this.mutableData,parentModel:!0,instanceProps:t,forwardHostProp:function(r,s){let n=this.__instances;for(let l=0,d;l<n.length&&(d=n[l]);l++)d.forwardHostProp(r,s)},notifyInstanceProp:function(r,s,n){if(o.matches(this.as,s)){let l=r[this.itemsIndexAs];s==this.as&&(this.items[l]=n);let d=o.translate(this.as,`${JSCompiler_renameProperty("items",this)}.${l}`,s);this.notifyPath(d,n)}}})}return!0}__getMethodHost(){return this.__dataHost._methodHost||this.__dataHost}__functionFromPropertyValue(i){if(typeof i=="string"){let e=i,t=this.__getMethodHost();return function(){return t[e].apply(t,arguments)}}return i}__sortChanged(i){this.__sortFn=this.__functionFromPropertyValue(i),this.items&&this.__debounceRender(this.__render)}__filterChanged(i){this.__filterFn=this.__functionFromPropertyValue(i),this.items&&this.__debounceRender(this.__render)}__computeFrameTime(i){return Math.ceil(1e3/i)}__observeChanged(){this.__observePaths=this.observe&&this.observe.replace(".*",".").split(" ")}__handleObservedPaths(i){if(this.__sortFn||this.__filterFn){if(!i)this.__debounceRender(this.__render,this.delay);else if(this.__observePaths){let e=this.__observePaths;for(let t=0;t<e.length;t++)i.indexOf(e[t])===0&&this.__debounceRender(this.__render,this.delay)}}}__itemsChanged(i){this.items&&!Array.isArray(this.items)&&console.warn("dom-repeat expected array for `items`, found",this.items),this.__handleItemPath(i.path,i.value)||(i.path==="items"&&(this.__itemsArrayChanged=!0),this.__debounceRender(this.__render))}__debounceRender(i,e=0){this.__renderDebouncer=Ce.debounce(this.__renderDebouncer,e>0?o.timeOut$1.after(e):o.microTask$1,i.bind(this)),hr(this.__renderDebouncer)}render(){this.__debounceRender(this.__render),Je()}__render(){if(!this.__ensureTemplatized())return;let i=this.items||[];const e=this.__sortAndFilterItems(i),t=this.__calculateLimit(e.length);this.__updateInstances(i,t,e),this.initialCount&&(this.__shouldMeasureChunk||this.__shouldContinueChunking)&&(cancelAnimationFrame(this.__chunkingId),this.__chunkingId=requestAnimationFrame(()=>{this.__chunkingId=null,this.__continueChunking()})),this._setRenderedItemCount(this.__instances.length),(!o.suppressTemplateNotifications||this.notifyDomChange)&&this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0}))}__sortAndFilterItems(i){let e=new Array(i.length);for(let t=0;t<i.length;t++)e[t]=t;return this.__filterFn&&(e=e.filter((t,r,s)=>this.__filterFn(i[t],r,s))),this.__sortFn&&e.sort((t,r)=>this.__sortFn(i[t],i[r])),e}__calculateLimit(i){let e=i;const t=this.__instances.length;if(this.initialCount){let r;!this.__chunkCount||this.__itemsArrayChanged&&!this.reuseChunkedInstances?(e=Math.min(i,this.initialCount),r=Math.max(e-t,0),this.__chunkCount=r||1):(r=Math.min(Math.max(i-t,0),this.__chunkCount),e=Math.min(t+r,i)),this.__shouldMeasureChunk=r===this.__chunkCount,this.__shouldContinueChunking=e<i,this.__renderStartTime=performance.now()}return this.__itemsArrayChanged=!1,e}__continueChunking(){if(this.__shouldMeasureChunk){const i=performance.now()-this.__renderStartTime,e=this._targetFrameTime/i;this.__chunkCount=Math.round(this.__chunkCount*e)||1}this.__shouldContinueChunking&&this.__debounceRender(this.__render)}__updateInstances(i,e,t){const r=this.__itemsIdxToInstIdx={};let s;for(s=0;s<e;s++){let n=this.__instances[s],l=t[s],d=i[l];r[l]=s,n?(n._setPendingProperty(this.as,d),n._setPendingProperty(this.indexAs,s),n._setPendingProperty(this.itemsIndexAs,l),n._flushProperties()):this.__insertInstance(d,s,l)}for(let n=this.__instances.length-1;n>=s;n--)this.__detachAndRemoveInstance(n)}__detachInstance(i){let e=this.__instances[i];const t=o.wrap$1(e.root);for(let r=0;r<e.children.length;r++){let s=e.children[r];t.appendChild(s)}return e}__attachInstance(i,e){let t=this.__instances[i];e.insertBefore(t.root,this)}__detachAndRemoveInstance(i){this.__detachInstance(i),this.__instances.splice(i,1)}__stampInstance(i,e,t){let r={};return r[this.as]=i,r[this.indexAs]=e,r[this.itemsIndexAs]=t,new this.__ctor(r)}__insertInstance(i,e,t){const r=this.__stampInstance(i,e,t);let s=this.__instances[e+1],n=s?s.children[0]:this;return o.wrap$1(o.wrap$1(this).parentNode).insertBefore(r.root,n),this.__instances[e]=r,r}_showHideChildren(i){for(let e=0;e<this.__instances.length;e++)this.__instances[e]._showHideChildren(i)}__handleItemPath(i,e){let t=i.slice(6),r=t.indexOf("."),s=r<0?t:t.substring(0,r);if(s==parseInt(s,10)){let n=r<0?"":t.substring(r+1);this.__handleObservedPaths(n);let l=this.__itemsIdxToInstIdx[s],d=this.__instances[l];if(d){let h=this.as+(n?"."+n:"");d._setPendingPropertyOrPath(h,e,!1,!0),d._flushProperties()}return!0}}itemForElement(i){let e=this.modelForElement(i);return e&&e[this.as]}indexForElement(i){let e=this.modelForElement(i);return e&&e[this.indexAs]}modelForElement(i){return Sr(this.template,i)}}customElements.define(gt.is,gt);/**
|
|
1406
|
-
* @license
|
|
1407
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1408
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1409
|
-
*/const Or=a=>class extends o.FocusMixin(a){static get properties(){return{month:{type:Object,value:new Date,sync:!0},selectedDate:{type:Object,notify:!0,sync:!0},focusedDate:{type:Object},showWeekNumbers:{type:Boolean,value:!1},i18n:{type:Object},ignoreTaps:{type:Boolean},minDate:{type:Date,value:null,sync:!0},maxDate:{type:Date,value:null,sync:!0},isDateDisabled:{type:Function,value:()=>!1},enteredDate:{type:Date},disabled:{type:Boolean,reflectToAttribute:!0},_days:{type:Array},_weeks:{type:Array},_notTapping:{type:Boolean},__hasFocus:{type:Boolean}}}static get observers(){return["__focusedDateChanged(focusedDate, _days)"]}get focusableDateElement(){return[...this.shadowRoot.querySelectorAll("[part~=date]")].find(e=>Y(e.date,this.focusedDate))}ready(){super.ready(),o.addListener(this.$.monthGrid,"tap",this._handleTap.bind(this))}_setFocused(e){super._setFocused(e),this.__hasFocus=e}_isDisabled(e,t,r){const s=new Date(0,0);s.setFullYear(e.getFullYear()),s.setMonth(e.getMonth()),s.setDate(1);const n=new Date(0,0);return n.setFullYear(e.getFullYear()),n.setMonth(e.getMonth()+1),n.setDate(0),t&&r&&t.getMonth()===r.getMonth()&&t.getMonth()===e.getMonth()&&r.getDate()-t.getDate()>=0?!1:!ae(s,t,r)&&!ae(n,t,r)}_getTitle(e,t){if(!(e===void 0||t===void 0))return t.formatTitle(t.monthNames[e.getMonth()],e.getFullYear())}_onMonthGridTouchStart(){this._notTapping=!1,setTimeout(()=>{this._notTapping=!0},300)}_dateAdd(e,t){e.setDate(e.getDate()+t)}_applyFirstDayOfWeek(e,t){if(!(e===void 0||t===void 0))return e.slice(t).concat(e.slice(0,t))}_getWeekDayNames(e,t){if(e===void 0||t===void 0)return[];const{weekdays:r,weekdaysShort:s,firstDayOfWeek:n}=e,l=this._applyFirstDayOfWeek(s,n);return this._applyFirstDayOfWeek(r,n).map((h,m)=>({weekDay:h,weekDayShort:l[m]})).slice(0,7)}__focusedDateChanged(e,t){Array.isArray(t)&&t.some(r=>Y(r,e))?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true")}_getDate(e){return e?e.getDate():""}_showWeekSeparator(e,t){return e&&t&&t.firstDayOfWeek===1}_isToday(e){return Y(new Date,e)}_getDays(e,t){if(e===void 0||t===void 0)return[];const r=new Date(0,0);for(r.setFullYear(e.getFullYear()),r.setMonth(e.getMonth()),r.setDate(1);r.getDay()!==t.firstDayOfWeek;)this._dateAdd(r,-1);const s=[],n=r.getMonth(),l=e.getMonth();for(;r.getMonth()===l||r.getMonth()===n;)s.push(r.getMonth()===l?new Date(r.getTime()):null),this._dateAdd(r,1);return s}_getWeeks(e){return e.reduce((t,r,s)=>(s%7===0&&t.push([]),t[t.length-1].push(r),t),[])}_handleTap(e){!this.ignoreTaps&&!this._notTapping&&e.target.date&&!e.target.hasAttribute("disabled")&&(this.selectedDate=e.target.date,this.dispatchEvent(new CustomEvent("date-tap",{detail:{date:e.target.date},bubbles:!0,composed:!0})))}_preventDefault(e){e.preventDefault()}__getWeekNumber(e){const t=e.reduce((r,s)=>!r&&s?s:r);return nr(t)}__getDayAriaLabel(e){if(!e)return"";let t=`${this._getDate(e)} ${this.i18n.monthNames[e.getMonth()]} ${e.getFullYear()}, ${this.i18n.weekdays[e.getDay()]}`;return this._isToday(e)&&(t+=`, ${this.i18n.today}`),t}};/**
|
|
1410
|
-
* @license
|
|
1411
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1412
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1413
|
-
*/const Vr=o.i$3`
|
|
1414
|
-
:host {
|
|
1415
|
-
display: block;
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
|
-
#monthGrid {
|
|
1419
|
-
width: 100%;
|
|
1420
|
-
border-collapse: collapse;
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1423
|
-
#days-container tr,
|
|
1424
|
-
#weekdays-container tr {
|
|
1425
|
-
display: flex;
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
|
-
[part~='date'] {
|
|
1429
|
-
outline: none;
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
[part~='disabled'] {
|
|
1433
|
-
pointer-events: none;
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
[part='week-number'][hidden],
|
|
1437
|
-
[part='weekday'][hidden] {
|
|
1438
|
-
display: none;
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
[part='weekday'],
|
|
1442
|
-
[part~='date'] {
|
|
1443
|
-
width: calc(100% / 7);
|
|
1444
|
-
padding: 0;
|
|
1445
|
-
font-weight: normal;
|
|
1446
|
-
}
|
|
1447
|
-
|
|
1448
|
-
[part='weekday']:empty,
|
|
1449
|
-
[part='week-number'] {
|
|
1450
|
-
width: 12.5%;
|
|
1451
|
-
flex-shrink: 0;
|
|
1452
|
-
padding: 0;
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
|
-
:host([week-numbers]) [part='weekday']:not(:empty),
|
|
1456
|
-
:host([week-numbers]) [part~='date'] {
|
|
1457
|
-
width: 12.5%;
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
@media (forced-colors: active) {
|
|
1461
|
-
[part~='date'][part~='focused'] {
|
|
1462
|
-
outline: 1px solid;
|
|
1463
|
-
}
|
|
1464
|
-
|
|
1465
|
-
[part~='date'][part~='selected'] {
|
|
1466
|
-
outline: 3px solid;
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
`;/**
|
|
1470
|
-
* @license
|
|
1471
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1472
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1473
|
-
*/o.registerStyles("vaadin-month-calendar",Vr,{moduleId:"vaadin-month-calendar-styles"});class Fr extends Or(o.ThemableMixin(o.PolymerElement)){static get template(){return o.html`
|
|
1474
|
-
<div part="month-header" id="month-header" aria-hidden="true">[[_getTitle(month, i18n)]]</div>
|
|
1475
|
-
<table
|
|
1476
|
-
id="monthGrid"
|
|
1477
|
-
role="grid"
|
|
1478
|
-
aria-labelledby="month-header"
|
|
1479
|
-
on-touchend="_preventDefault"
|
|
1480
|
-
on-touchstart="_onMonthGridTouchStart"
|
|
1481
|
-
>
|
|
1482
|
-
<thead id="weekdays-container">
|
|
1483
|
-
<tr role="row" part="weekdays">
|
|
1484
|
-
<th part="weekday" aria-hidden="true" hidden$="[[!_showWeekSeparator(showWeekNumbers, i18n)]]"></th>
|
|
1485
|
-
<template is="dom-repeat" items="[[_getWeekDayNames(i18n, showWeekNumbers)]]">
|
|
1486
|
-
<th role="columnheader" part="weekday" scope="col" abbr$="[[item.weekDay]]" aria-hidden="true">
|
|
1487
|
-
[[item.weekDayShort]]
|
|
1488
|
-
</th>
|
|
1489
|
-
</template>
|
|
1490
|
-
</tr>
|
|
1491
|
-
</thead>
|
|
1492
|
-
<tbody id="days-container">
|
|
1493
|
-
<template is="dom-repeat" items="[[_weeks]]" as="week">
|
|
1494
|
-
<tr role="row">
|
|
1495
|
-
<td part="week-number" aria-hidden="true" hidden$="[[!_showWeekSeparator(showWeekNumbers, i18n)]]">
|
|
1496
|
-
[[__getWeekNumber(week)]]
|
|
1497
|
-
</td>
|
|
1498
|
-
<template is="dom-repeat" items="[[week]]">
|
|
1499
|
-
<td
|
|
1500
|
-
role="gridcell"
|
|
1501
|
-
part$="[[__getDatePart(item, focusedDate, selectedDate, minDate, maxDate, isDateDisabled, enteredDate, __hasFocus)]]"
|
|
1502
|
-
date="[[item]]"
|
|
1503
|
-
tabindex$="[[__getDayTabindex(item, focusedDate)]]"
|
|
1504
|
-
disabled$="[[__isDayDisabled(item, minDate, maxDate, isDateDisabled)]]"
|
|
1505
|
-
aria-selected$="[[__getDayAriaSelected(item, selectedDate)]]"
|
|
1506
|
-
aria-disabled$="[[__getDayAriaDisabled(item, minDate, maxDate, isDateDisabled)]]"
|
|
1507
|
-
aria-label$="[[__getDayAriaLabel(item)]]"
|
|
1508
|
-
>[[_getDate(item)]]</td
|
|
1509
|
-
>
|
|
1510
|
-
</template>
|
|
1511
|
-
</tr>
|
|
1512
|
-
</template>
|
|
1513
|
-
</tbody>
|
|
1514
|
-
</table>
|
|
1515
|
-
`}static get is(){return"vaadin-month-calendar"}static get properties(){return{_days:{type:Array,computed:"_getDays(month, i18n, minDate, maxDate, isDateDisabled)"},_weeks:{type:Array,computed:"_getWeeks(_days)"},disabled:{type:Boolean,reflectToAttribute:!0,computed:"_isDisabled(month, minDate, maxDate)"}}}static get observers(){return["_showWeekNumbersChanged(showWeekNumbers, i18n)"]}_showWeekNumbersChanged(i,e){i&&e&&e.firstDayOfWeek===1?this.setAttribute("week-numbers",""):this.removeAttribute("week-numbers")}__getDatePart(i,e,t,r,s,n,l,d){const h=["date"],m=i>qe(new Date),u=i<qe(new Date);return this.__isDayDisabled(i,r,s,n)&&h.push("disabled"),Y(i,e)&&(d||Y(i,l))&&h.push("focused"),this.__isDaySelected(i,t)&&h.push("selected"),this._isToday(i)&&h.push("today"),u&&h.push("past"),m&&h.push("future"),h.join(" ")}__isDaySelected(i,e){return Y(i,e)}__getDayAriaSelected(i,e){if(this.__isDaySelected(i,e))return"true"}__isDayDisabled(i,e,t,r){return!ae(i,e,t,r)}__getDayAriaDisabled(i,e,t,r){if(!(i===void 0||e===void 0&&t===void 0&&r===void 0)&&this.__isDayDisabled(i,e,t,r))return"true"}__getDayTabindex(i,e){return Y(i,e)?"0":"-1"}}o.defineCustomElement(Fr);/**
|
|
1516
|
-
* @license
|
|
1517
|
-
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1518
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1519
|
-
*/class Qt{constructor(i,e){this.query=i,this.callback=e,this._boundQueryHandler=this._queryHandler.bind(this)}hostConnected(){this._removeListener(),this._mediaQuery=window.matchMedia(this.query),this._addListener(),this._queryHandler(this._mediaQuery)}hostDisconnected(){this._removeListener()}_addListener(){this._mediaQuery&&this._mediaQuery.addListener(this._boundQueryHandler)}_removeListener(){this._mediaQuery&&this._mediaQuery.removeListener(this._boundQueryHandler),this._mediaQuery=null}_queryHandler(i){typeof this.callback=="function"&&this.callback(i.matches)}}/**
|
|
1520
|
-
* @license
|
|
1521
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1522
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1523
|
-
*/const Ar=a=>class extends a{static get properties(){return{scrollDuration:{type:Number,value:300},selectedDate:{type:Object,value:null,sync:!0},focusedDate:{type:Object,notify:!0,observer:"_focusedDateChanged",sync:!0},_focusedMonthDate:Number,initialPosition:{type:Object,observer:"_initialPositionChanged",sync:!0},_originDate:{type:Object,value:new Date},_visibleMonthIndex:Number,_desktopMode:{type:Boolean,observer:"_desktopModeChanged"},_desktopMediaQuery:{type:String,value:"(min-width: 375px)"},_translateX:{observer:"_translateXChanged"},_yearScrollerWidth:{value:50},i18n:{type:Object},showWeekNumbers:{type:Boolean,value:!1},_ignoreTaps:Boolean,_notTapping:Boolean,minDate:{type:Object,sync:!0},maxDate:{type:Object,sync:!0},isDateDisabled:{type:Function},enteredDate:{type:Date,sync:!0},label:String,_cancelButton:{type:Object},_todayButton:{type:Object},calendars:{type:Array,value:()=>[]},years:{type:Array,value:()=>[]}}}static get observers(){return["__updateCalendars(calendars, i18n, minDate, maxDate, selectedDate, focusedDate, showWeekNumbers, _ignoreTaps, _theme, isDateDisabled, enteredDate)","__updateCancelButton(_cancelButton, i18n)","__updateTodayButton(_todayButton, i18n, minDate, maxDate, isDateDisabled)","__updateYears(years, selectedDate, _theme)"]}get __useSubMonthScrolling(){return this._monthScroller.clientHeight<this._monthScroller.itemHeight+this._monthScroller.bufferOffset}get focusableDateElement(){return this.calendars.map(e=>e.focusableDateElement).find(Boolean)}_addListeners(){o.setTouchAction(this.$.scrollers,"pan-y"),o.addListener(this.$.scrollers,"track",this._track.bind(this)),o.addListener(this.shadowRoot.querySelector('[part="clear-button"]'),"tap",this._clear.bind(this)),o.addListener(this.shadowRoot.querySelector('[part="toggle-button"]'),"tap",this._cancel.bind(this)),o.addListener(this.shadowRoot.querySelector('[part="years-toggle-button"]'),"tap",this._toggleYearScroller.bind(this))}_initControllers(){this.addController(new Qt(this._desktopMediaQuery,e=>{this._desktopMode=e})),this.addController(new o.SlotController(this,"today-button","vaadin-button",{observe:!1,initializer:e=>{e.setAttribute("theme","tertiary"),e.addEventListener("keydown",t=>this.__onTodayButtonKeyDown(t)),o.addListener(e,"tap",this._onTodayTap.bind(this)),this._todayButton=e}})),this.addController(new o.SlotController(this,"cancel-button","vaadin-button",{observe:!1,initializer:e=>{e.setAttribute("theme","tertiary"),e.addEventListener("keydown",t=>this.__onCancelButtonKeyDown(t)),o.addListener(e,"tap",this._cancel.bind(this)),this._cancelButton=e}})),this.__initMonthScroller(),this.__initYearScroller()}reset(){this._closeYearScroller(),this._toggleAnimateClass(!0)}focusCancel(){this._cancelButton.focus()}scrollToDate(e,t){const r=this.__useSubMonthScrolling?this._calculateWeekScrollOffset(e):0;this._scrollToPosition(this._differenceInMonths(e,this._originDate)+r,t),this._monthScroller.forceUpdate()}__initMonthScroller(){this.addController(new o.SlotController(this,"months","vaadin-date-picker-month-scroller",{observe:!1,initializer:e=>{e.addEventListener("custom-scroll",()=>{this._onMonthScroll()}),e.addEventListener("touchstart",()=>{this._onMonthScrollTouchStart()}),e.addEventListener("keydown",t=>{this.__onMonthCalendarKeyDown(t)}),e.addEventListener("init-done",()=>{const t=[...this.querySelectorAll("vaadin-month-calendar")];t.forEach(r=>{r.addEventListener("selected-date-changed",s=>{this.selectedDate=s.detail.value})}),this.calendars=t}),this._monthScroller=e}}))}__initYearScroller(){this.addController(new o.SlotController(this,"years","vaadin-date-picker-year-scroller",{observe:!1,initializer:e=>{e.setAttribute("aria-hidden","true"),o.addListener(e,"tap",t=>{this._onYearTap(t)}),e.addEventListener("custom-scroll",()=>{this._onYearScroll()}),e.addEventListener("touchstart",()=>{this._onYearScrollTouchStart()}),e.addEventListener("init-done",()=>{this.years=[...this.querySelectorAll("vaadin-date-picker-year")]}),this._yearScroller=e}}))}__updateCancelButton(e,t){e&&(e.textContent=t&&t.cancel)}__updateTodayButton(e,t,r,s,n){e&&(e.textContent=t&&t.today,e.disabled=!this._isTodayAllowed(r,s,n))}__updateCalendars(e,t,r,s,n,l,d,h,m,u,v){e&&e.length&&e.forEach(_=>{_.i18n=t,_.minDate=r,_.maxDate=s,_.isDateDisabled=u,_.focusedDate=l,_.selectedDate=n,_.showWeekNumbers=d,_.ignoreTaps=h,_.enteredDate=v,m?_.setAttribute("theme",m):_.removeAttribute("theme")})}__updateYears(e,t,r){e&&e.length&&e.forEach(s=>{s.selectedDate=t,r?s.setAttribute("theme",r):s.removeAttribute("theme")})}_selectDate(e){return this._dateAllowed(e)?(this.selectedDate=e,this.dispatchEvent(new CustomEvent("date-selected",{detail:{date:e},bubbles:!0,composed:!0})),!0):!1}_desktopModeChanged(e){this.toggleAttribute("desktop",e)}_focusedDateChanged(e){this.revealDate(e)}revealDate(e,t=!0){if(!e)return;const r=this._differenceInMonths(e,this._originDate);if(this.__useSubMonthScrolling){const h=this._calculateWeekScrollOffset(e);this._scrollToPosition(r+h,t);return}const s=this._monthScroller.position>r,l=Math.max(this._monthScroller.itemHeight,this._monthScroller.clientHeight-this._monthScroller.bufferOffset*2)/this._monthScroller.itemHeight,d=this._monthScroller.position+l-1<r;s?this._scrollToPosition(r,t):d&&this._scrollToPosition(r-l+1,t)}_calculateWeekScrollOffset(e){const t=new Date(0,0);t.setFullYear(e.getFullYear()),t.setMonth(e.getMonth()),t.setDate(1);let r=0;for(;t.getDate()<e.getDate();)t.setDate(t.getDate()+1),t.getDay()===this.i18n.firstDayOfWeek&&(r+=1);return r/6}_initialPositionChanged(e){this._monthScroller&&this._yearScroller&&(this._monthScroller.active=!0,this._yearScroller.active=!0),this.scrollToDate(e)}_repositionYearScroller(){const e=this._monthScroller.position;this._visibleMonthIndex=Math.floor(e),this._yearScroller.position=(e+this._originDate.getMonth())/12}_repositionMonthScroller(){this._monthScroller.position=this._yearScroller.position*12-this._originDate.getMonth(),this._visibleMonthIndex=Math.floor(this._monthScroller.position)}_onMonthScroll(){this._repositionYearScroller(),this._doIgnoreTaps()}_onYearScroll(){this._repositionMonthScroller(),this._doIgnoreTaps()}_onYearScrollTouchStart(){this._notTapping=!1,setTimeout(()=>{this._notTapping=!0},300),this._repositionMonthScroller()}_onMonthScrollTouchStart(){this._repositionYearScroller()}_doIgnoreTaps(){this._ignoreTaps=!0,this._debouncer=o.Debouncer.debounce(this._debouncer,o.timeOut.after(300),()=>{this._ignoreTaps=!1})}_formatDisplayed(e,t,r){return e&&t&&typeof t.formatDate=="function"?t.formatDate(Xe(e)):r}_onTodayTap(){const e=this._getTodayMidnight();Math.abs(this._monthScroller.position-this._differenceInMonths(e,this._originDate))<.001?(this._selectDate(e),this._close()):this._scrollToCurrentMonth()}_scrollToCurrentMonth(){this.focusedDate&&(this.focusedDate=new Date),this.scrollToDate(new Date,!0)}_onYearTap(e){if(!this._ignoreTaps&&!this._notTapping){const r=(e.detail.y-(this._yearScroller.getBoundingClientRect().top+this._yearScroller.clientHeight/2))/this._yearScroller.itemHeight;this._scrollToPosition(this._monthScroller.position+r*12,!0)}}_scrollToPosition(e,t){if(this._targetPosition!==void 0){this._targetPosition=e;return}if(!t){this._monthScroller.position=e,this._monthScroller.forceUpdate(),this._targetPosition=void 0,this._repositionYearScroller(),this.__tryFocusDate();return}this._targetPosition=e;let r;this._revealPromise=new Promise(h=>{r=h});const s=(h,m,u,v)=>(h/=v/2,h<1?u/2*h*h+m:(h-=1,-u/2*(h*(h-2)-1)+m));let n=0;const l=this._monthScroller.position,d=h=>{n||(n=h);const m=h-n;if(m<this.scrollDuration){const u=s(m,l,this._targetPosition-l,this.scrollDuration);this._monthScroller.position=u,window.requestAnimationFrame(d)}else this.dispatchEvent(new CustomEvent("scroll-animation-finished",{bubbles:!0,composed:!0,detail:{position:this._targetPosition,oldPosition:l}})),this._monthScroller.position=this._targetPosition,this._monthScroller.forceUpdate(),this._targetPosition=void 0,r(),this._revealPromise=void 0;setTimeout(this._repositionYearScroller.bind(this),1)};window.requestAnimationFrame(d)}_limit(e,t){return Math.min(t.max,Math.max(t.min,e))}_handleTrack(e){if(Math.abs(e.detail.dx)<10||Math.abs(e.detail.ddy)>10)return;Math.abs(e.detail.ddx)>this._yearScrollerWidth/3&&this._toggleAnimateClass(!0);const t=this._translateX+e.detail.ddx;this._translateX=this._limit(t,{min:0,max:this._yearScrollerWidth})}_track(e){if(!this._desktopMode)switch(e.detail.state){case"start":this._toggleAnimateClass(!1);break;case"track":this._handleTrack(e);break;case"end":this._toggleAnimateClass(!0),this._translateX>=this._yearScrollerWidth/2?this._closeYearScroller():this._openYearScroller();break}}_toggleAnimateClass(e){e?this.classList.add("animate"):this.classList.remove("animate")}_toggleYearScroller(){this._isYearScrollerVisible()?this._closeYearScroller():this._openYearScroller()}_openYearScroller(){this._translateX=0,this.setAttribute("years-visible","")}_closeYearScroller(){this.removeAttribute("years-visible"),this._translateX=this._yearScrollerWidth}_isYearScrollerVisible(){return this._translateX<this._yearScrollerWidth/2}_translateXChanged(e){this._desktopMode||(this._monthScroller.style.transform=`translateX(${e-this._yearScrollerWidth}px)`,this._yearScroller.style.transform=`translateX(${e}px)`)}_yearAfterXMonths(e){return Nt(e).getFullYear()}_differenceInMonths(e,t){return(e.getFullYear()-t.getFullYear())*12-t.getMonth()+e.getMonth()}_clear(){this._selectDate("")}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}_cancel(){this.focusedDate=this.selectedDate,this._close()}_preventDefault(e){e.preventDefault()}__toggleDate(e){Y(e,this.selectedDate)?(this._clear(),this.focusedDate=e):this._selectDate(e)}__onMonthCalendarKeyDown(e){let t=!1;switch(e.key){case"ArrowDown":this._moveFocusByDays(7),t=!0;break;case"ArrowUp":this._moveFocusByDays(-7),t=!0;break;case"ArrowRight":this._moveFocusByDays(this.__isRTL?-1:1),t=!0;break;case"ArrowLeft":this._moveFocusByDays(this.__isRTL?1:-1),t=!0;break;case"Enter":this._selectDate(this.focusedDate)&&(this._close(),t=!0);break;case" ":this.__toggleDate(this.focusedDate),t=!0;break;case"Home":this._moveFocusInsideMonth(this.focusedDate,"minDate"),t=!0;break;case"End":this._moveFocusInsideMonth(this.focusedDate,"maxDate"),t=!0;break;case"PageDown":this._moveFocusByMonths(e.shiftKey?12:1),t=!0;break;case"PageUp":this._moveFocusByMonths(e.shiftKey?-12:-1),t=!0;break;case"Tab":this._onTabKeyDown(e,"calendar");break}t&&(e.preventDefault(),e.stopPropagation())}_onTabKeyDown(e,t){switch(e.stopPropagation(),t){case"calendar":e.shiftKey&&(e.preventDefault(),this.hasAttribute("fullscreen")?this.focusCancel():this.__focusInput());break;case"today":e.shiftKey&&(e.preventDefault(),this.focusDateElement());break;case"cancel":e.shiftKey||(e.preventDefault(),this.hasAttribute("fullscreen")?this.focusDateElement():this.__focusInput());break}}__onTodayButtonKeyDown(e){e.key==="Tab"&&this._onTabKeyDown(e,"today")}__onCancelButtonKeyDown(e){e.key==="Tab"&&this._onTabKeyDown(e,"cancel")}__focusInput(){this.dispatchEvent(new CustomEvent("focus-input",{bubbles:!0,composed:!0}))}__tryFocusDate(){if(this.__pendingDateFocus){const t=this.focusableDateElement;t&&Y(t.date,this.__pendingDateFocus)&&(delete this.__pendingDateFocus,t.focus())}}focusDate(e,t){return Ve(this,null,function*(){const r=e||this.selectedDate||this.initialPosition||new Date;this.focusedDate=r,t||(this._focusedMonthDate=r.getDate()),yield this.focusDateElement(!1)})}focusDateElement(e=!0){return Ve(this,null,function*(){this.__pendingDateFocus=this.focusedDate,this.calendars.length||(yield new Promise(t=>{Ht(this,()=>{Je(),t()})})),e&&this.revealDate(this.focusedDate),this._revealPromise&&(yield this._revealPromise),this.__tryFocusDate()})}_focusClosestDate(e){this.focusDate(Bt(e,[this.minDate,this.maxDate]))}_focusAllowedDate(e,t,r){this._dateAllowed(e,void 0,void 0,()=>!1)?this.focusDate(e,r):this._dateAllowed(this.focusedDate)?t>0?this.focusDate(this.maxDate):this.focusDate(this.minDate):this._focusClosestDate(this.focusedDate)}_getDateDiff(e,t){const r=new Date(0,0);return r.setFullYear(this.focusedDate.getFullYear()),r.setMonth(this.focusedDate.getMonth()+e),t&&r.setDate(this.focusedDate.getDate()+t),r}_moveFocusByDays(e){const t=this._getDateDiff(0,e);this._focusAllowedDate(t,e,!1)}_moveFocusByMonths(e){const t=this._getDateDiff(e),r=t.getMonth();this._focusedMonthDate||(this._focusedMonthDate=this.focusedDate.getDate()),t.setDate(this._focusedMonthDate),t.getMonth()!==r&&t.setDate(0),this._focusAllowedDate(t,e,!0)}_moveFocusInsideMonth(e,t){const r=new Date(0,0);r.setFullYear(e.getFullYear()),t==="minDate"?(r.setMonth(e.getMonth()),r.setDate(1)):(r.setMonth(e.getMonth()+1),r.setDate(0)),this._dateAllowed(r)?this.focusDate(r):this._dateAllowed(e)?this.focusDate(this[t]):this._focusClosestDate(e)}_dateAllowed(e,t=this.minDate,r=this.maxDate,s=this.isDateDisabled){return ae(e,t,r,s)}_isTodayAllowed(e,t,r){return this._dateAllowed(this._getTodayMidnight(),e,t,r)}_getTodayMidnight(){const e=new Date,t=new Date(0,0);return t.setFullYear(e.getFullYear()),t.setMonth(e.getMonth()),t.setDate(e.getDate()),t}};/**
|
|
1524
|
-
* @license
|
|
1525
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1526
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1527
|
-
*/const Hr=o.i$3`
|
|
1528
|
-
:host {
|
|
1529
|
-
display: flex;
|
|
1530
|
-
flex-direction: column;
|
|
1531
|
-
height: 100%;
|
|
1532
|
-
width: 100%;
|
|
1533
|
-
outline: none;
|
|
1534
|
-
}
|
|
1535
|
-
|
|
1536
|
-
[part='overlay-header'] {
|
|
1537
|
-
display: flex;
|
|
1538
|
-
flex-shrink: 0;
|
|
1539
|
-
flex-wrap: nowrap;
|
|
1540
|
-
align-items: center;
|
|
1541
|
-
}
|
|
1542
|
-
|
|
1543
|
-
:host(:not([fullscreen])) [part='overlay-header'] {
|
|
1544
|
-
display: none;
|
|
1545
|
-
}
|
|
1546
|
-
|
|
1547
|
-
[part='label'] {
|
|
1548
|
-
flex-grow: 1;
|
|
1549
|
-
}
|
|
1550
|
-
|
|
1551
|
-
[hidden] {
|
|
1552
|
-
display: none !important;
|
|
1553
|
-
}
|
|
1554
|
-
|
|
1555
|
-
[part='years-toggle-button'] {
|
|
1556
|
-
display: flex;
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
|
-
#scrollers {
|
|
1560
|
-
display: flex;
|
|
1561
|
-
height: 100%;
|
|
1562
|
-
width: 100%;
|
|
1563
|
-
position: relative;
|
|
1564
|
-
overflow: hidden;
|
|
1565
|
-
}
|
|
1566
|
-
|
|
1567
|
-
:host([desktop]) ::slotted([slot='months']) {
|
|
1568
|
-
right: 50px;
|
|
1569
|
-
transform: none !important;
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1572
|
-
:host([desktop]) ::slotted([slot='years']) {
|
|
1573
|
-
transform: none !important;
|
|
1574
|
-
}
|
|
1575
|
-
|
|
1576
|
-
:host(.animate) ::slotted([slot='months']),
|
|
1577
|
-
:host(.animate) ::slotted([slot='years']) {
|
|
1578
|
-
transition: all 200ms;
|
|
1579
|
-
}
|
|
1580
|
-
|
|
1581
|
-
[part='toolbar'] {
|
|
1582
|
-
display: flex;
|
|
1583
|
-
justify-content: space-between;
|
|
1584
|
-
z-index: 2;
|
|
1585
|
-
flex-shrink: 0;
|
|
1586
|
-
}
|
|
1587
|
-
`;/**
|
|
1588
|
-
* @license
|
|
1589
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1590
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1591
|
-
*/o.registerStyles("vaadin-date-picker-overlay-content",Hr,{moduleId:"vaadin-date-picker-overlay-content-styles"});class Lr extends Ar(o.ControllerMixin(o.ThemableMixin(o.DirMixin(o.PolymerElement)))){static get template(){return o.html`
|
|
1592
|
-
<div part="overlay-header" on-touchend="_preventDefault" aria-hidden="true">
|
|
1593
|
-
<div part="label">[[_formatDisplayed(selectedDate, i18n, label)]]</div>
|
|
1594
|
-
<div part="clear-button" hidden$="[[!selectedDate]]"></div>
|
|
1595
|
-
<div part="toggle-button"></div>
|
|
1596
|
-
|
|
1597
|
-
<div part="years-toggle-button" hidden$="[[_desktopMode]]" aria-hidden="true">
|
|
1598
|
-
[[_yearAfterXMonths(_visibleMonthIndex)]]
|
|
1599
|
-
</div>
|
|
1600
|
-
</div>
|
|
1601
|
-
|
|
1602
|
-
<div id="scrollers">
|
|
1603
|
-
<slot name="months"></slot>
|
|
1604
|
-
<slot name="years"></slot>
|
|
1605
|
-
</div>
|
|
1606
|
-
|
|
1607
|
-
<div on-touchend="_preventDefault" role="toolbar" part="toolbar">
|
|
1608
|
-
<slot name="today-button"></slot>
|
|
1609
|
-
<slot name="cancel-button"></slot>
|
|
1610
|
-
</div>
|
|
1611
|
-
`}static get is(){return"vaadin-date-picker-overlay-content"}ready(){super.ready(),this.setAttribute("role","dialog"),this._addListeners(),this._initControllers()}}o.defineCustomElement(Lr);/**
|
|
1612
|
-
* @license
|
|
1613
|
-
* Copyright (c) 2023 - 2024 Vaadin Ltd.
|
|
1614
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1615
|
-
*/const Gt=a=>class extends a{static get properties(){return{overlayClass:{type:String},_overlayElement:{type:Object}}}static get observers(){return["__updateOverlayClassNames(overlayClass, _overlayElement)"]}__updateOverlayClassNames(e,t){if(!t||e===void 0)return;const{classList:r}=t;if(this.__initialClasses||(this.__initialClasses=new Set(r)),Array.isArray(this.__previousClasses)){const n=this.__previousClasses.filter(l=>!this.__initialClasses.has(l));n.length>0&&r.remove(...n)}const s=typeof e=="string"?e.split(" ").filter(Boolean):[];s.length>0&&r.add(...s),this.__previousClasses=s}};/**
|
|
1616
|
-
* @license
|
|
1617
|
-
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1618
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1619
|
-
*/class Kt{constructor(i){this.host=i,i.addEventListener("opened-changed",()=>{i.opened||this.__setVirtualKeyboardEnabled(!1)}),i.addEventListener("blur",()=>this.__setVirtualKeyboardEnabled(!0)),i.addEventListener("touchstart",()=>this.__setVirtualKeyboardEnabled(!0))}__setVirtualKeyboardEnabled(i){this.host.inputElement&&(this.host.inputElement.inputMode=i?"":"none")}}/**
|
|
1620
|
-
* @license
|
|
1621
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1622
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1623
|
-
*/const zr=Object.freeze({monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDayOfWeek:0,today:"Today",cancel:"Cancel",referenceDate:"",formatDate(a){const i=String(a.year).replace(/\d+/u,e=>"0000".substr(e.length)+e);return[a.month+1,a.day,i].join("/")},parseDate(a){const i=a.split("/"),e=new Date;let t,r=e.getMonth(),s=e.getFullYear();if(i.length===3){if(r=parseInt(i[0])-1,t=parseInt(i[1]),s=parseInt(i[2]),i[2].length<3&&s>=0){const n=this.referenceDate?fe(this.referenceDate):new Date;s=or(n,s,r,t)}}else i.length===2?(r=parseInt(i[0])-1,t=parseInt(i[1])):i.length===1&&(t=parseInt(i[0]));if(t!==void 0)return{day:t,month:r,year:s}},formatTitle:(a,i)=>`${a} ${i}`}),Rr=a=>class extends Gt(o.ControllerMixin(o.DelegateFocusMixin(o.InputConstraintsMixin(o.KeyboardMixin(a))))){static get properties(){return{_selectedDate:{type:Object,sync:!0},_focusedDate:{type:Object,sync:!0},value:{type:String,notify:!0,value:"",sync:!0},initialPosition:String,opened:{type:Boolean,reflectToAttribute:!0,notify:!0,observer:"_openedChanged",sync:!0},autoOpenDisabled:{type:Boolean,sync:!0},showWeekNumbers:{type:Boolean,value:!1,sync:!0},_fullscreen:{type:Boolean,value:!1,sync:!0},_fullscreenMediaQuery:{value:"(max-width: 450px), (max-height: 450px)"},i18n:{type:Object,sync:!0,value:()=>be({},zr)},min:{type:String,sync:!0},max:{type:String,sync:!0},isDateDisabled:{type:Function},_minDate:{type:Date,computed:"__computeMinOrMaxDate(min)",sync:!0},_maxDate:{type:Date,computed:"__computeMinOrMaxDate(max)",sync:!0},_noInput:{type:Boolean,computed:"_isNoInput(inputElement, _fullscreen, _ios, i18n, opened, autoOpenDisabled)"},_ios:{type:Boolean,value:o.isIOS},_focusOverlayOnOpen:Boolean,_overlayContent:{type:Object,sync:!0},__enteredDate:{type:Date,sync:!0}}}static get observers(){return["_selectedDateChanged(_selectedDate, i18n)","_focusedDateChanged(_focusedDate, i18n)","__updateOverlayContent(_overlayContent, i18n, label, _minDate, _maxDate, _focusedDate, _selectedDate, showWeekNumbers, isDateDisabled, __enteredDate)","__updateOverlayContentTheme(_overlayContent, _theme)","__updateOverlayContentFullScreen(_overlayContent, _fullscreen)"]}static get constraints(){return[...super.constraints,"min","max"]}constructor(){super(),this._boundOnClick=this._onClick.bind(this),this._boundOnScroll=this._onScroll.bind(this),this._boundOverlayRenderer=this._overlayRenderer.bind(this)}get _inputElementValue(){return super._inputElementValue}set _inputElementValue(e){super._inputElementValue=e;const t=this.__parseDate(e);this.__setEnteredDate(t)}get clearElement(){return null}get _nativeInput(){return this.inputElement?this.inputElement.focusElement||this.inputElement:null}get __unparsableValue(){return!this._inputElementValue||this.__parseDate(this._inputElementValue)?"":this._inputElementValue}_onFocus(e){super._onFocus(e),this._noInput&&!o.isKeyboardActive()&&e.target.blur()}_onBlur(e){super._onBlur(e),this.opened||(this.__commitParsedOrFocusedDate(),document.hasFocus()&&this._requestValidation())}ready(){super.ready(),this.addEventListener("click",this._boundOnClick),this.addController(new Qt(this._fullscreenMediaQuery,t=>{this._fullscreen=t})),this.addController(new Kt(this));const e=this.$.overlay;this._overlayElement=e,e.renderer=this._boundOverlayRenderer,this.addEventListener("mousedown",()=>this.__bringToFront()),this.addEventListener("touchstart",()=>this.__bringToFront())}disconnectedCallback(){super.disconnectedCallback(),this.opened=!1}open(){!this.disabled&&!this.readonly&&(this.opened=!0)}close(){this.$.overlay.close()}_overlayRenderer(e){if(e.firstChild)return;const t=document.createElement("vaadin-date-picker-overlay-content");e.appendChild(t),this._overlayContent=t,t.addEventListener("close",()=>{this._close()}),t.addEventListener("focus-input",this._focusAndSelect.bind(this)),t.addEventListener("date-tap",r=>{this.__commitDate(r.detail.date),this._close()}),t.addEventListener("date-selected",r=>{this.__commitDate(r.detail.date)}),t.addEventListener("focusin",()=>{this._keyboardActive&&this._setFocused(!0)}),t.addEventListener("focusout",r=>{this._shouldRemoveFocus(r)&&this._setFocused(!1)}),t.addEventListener("focused-date-changed",r=>{this._focusedDate=r.detail.value}),t.addEventListener("click",r=>r.stopPropagation())}__parseDate(e){if(!this.i18n.parseDate)return;let t=this.i18n.parseDate(e);if(t&&(t=fe(`${t.year}-${t.month+1}-${t.day}`)),t&&!isNaN(t.getTime()))return t}__formatDate(e){if(this.i18n.formatDate)return this.i18n.formatDate(Xe(e))}checkValidity(){const e=this._inputElementValue,t=!e||!!this._selectedDate&&e===this.__formatDate(this._selectedDate),r=!this._selectedDate||ae(this._selectedDate,this._minDate,this._maxDate,this.isDateDisabled);let s=!0;return this.inputElement&&this.inputElement.checkValidity&&(s=this.inputElement.checkValidity()),t&&r&&s}_shouldSetFocus(e){return!this._shouldKeepFocusRing}_shouldRemoveFocus(e){const{relatedTarget:t}=e;return this.opened&&t!==null&&t!==document.body&&!this.contains(t)&&!this._overlayContent.contains(t)?!0:!this.opened}_setFocused(e){super._setFocused(e),this._shouldKeepFocusRing=e&&this._keyboardActive}__commitValueChange(){const e=this.__unparsableValue;this.__committedValue!==this.value?(this._requestValidation(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))):this.__committedUnparsableValue!==e&&(this._requestValidation(),this.dispatchEvent(new CustomEvent("unparsable-change"))),this.__committedValue=this.value,this.__committedUnparsableValue=e}__commitDate(e){this.__keepCommittedValue=!0,this._selectedDate=e,this.__keepCommittedValue=!1,this.__commitValueChange()}_close(){this._focus(),this.close()}__bringToFront(){requestAnimationFrame(()=>{this.$.overlay.bringToFront()})}_isNoInput(e,t,r,s,n,l){return!e||t&&(!l||n)||r&&n||!s.parseDate}_formatISO(e){return dr(e)}_inputElementChanged(e){super._inputElementChanged(e),e&&(e.autocomplete="off",e.setAttribute("role","combobox"),e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded",!!this.opened),this._applyInputValue(this._selectedDate))}_openedChanged(e){this.inputElement&&this.inputElement.setAttribute("aria-expanded",e)}_selectedDateChanged(e,t){e===void 0||t===void 0||(this.__keepInputValue||this._applyInputValue(e),this.value=this._formatISO(e),this._ignoreFocusedDateChange=!0,this._focusedDate=e,this._ignoreFocusedDateChange=!1)}_focusedDateChanged(e,t){e===void 0||t===void 0||!this._ignoreFocusedDateChange&&!this._noInput&&this._applyInputValue(e)}_valueChanged(e,t){const r=fe(e);if(e&&!r){this.value=t;return}e?Y(this._selectedDate,r)||(this._selectedDate=r,t!==void 0&&this._requestValidation()):this._selectedDate=null,this.__keepCommittedValue||(this.__committedValue=this.value,this.__committedUnparsableValue=""),this._toggleHasValue(this._hasValue)}__updateOverlayContent(e,t,r,s,n,l,d,h,m,u){e&&(e.i18n=t,e.label=r,e.minDate=s,e.maxDate=n,e.focusedDate=l,e.selectedDate=d,e.showWeekNumbers=h,e.isDateDisabled=m,e.enteredDate=u)}__updateOverlayContentTheme(e,t){e&&(t?e.setAttribute("theme",t):e.removeAttribute("theme"))}__updateOverlayContentFullScreen(e,t){e&&e.toggleAttribute("fullscreen",t)}_onOverlayEscapePress(){this._focusedDate=this._selectedDate,this._closedByEscape=!0,this._close(),this._closedByEscape=!1}_onOverlayOpened(){const e=this._overlayContent;e.reset();const t=this._getInitialPosition();e.initialPosition=t;const r=e.focusedDate||t;e.scrollToDate(r),this._ignoreFocusedDateChange=!0,e.focusedDate=r,this._ignoreFocusedDateChange=!1,window.addEventListener("scroll",this._boundOnScroll,!0),this._focusOverlayOnOpen?(e.focusDateElement(),this._focusOverlayOnOpen=!1):this._focus();const s=this._nativeInput;this._noInput&&s&&(s.blur(),this._overlayContent.focusDateElement());const n=this._noInput?e:[s,e];this.__showOthers=Lt(n)}_getInitialPosition(){const e=fe(this.initialPosition),t=this._selectedDate||this._overlayContent.initialPosition||e||new Date;return e||ae(t,this._minDate,this._maxDate,this.isDateDisabled)?t:this._minDate||this._maxDate?Bt(t,[this._minDate,this._maxDate]):new Date}__commitParsedOrFocusedDate(){if(this._ignoreFocusedDateChange=!0,this.i18n.parseDate){const e=this._inputElementValue||"",t=this.__parseDate(e);t?this.__commitDate(t):(this.__keepInputValue=!0,this.__commitDate(null),this.__keepInputValue=!1)}else this._focusedDate&&this.__commitDate(this._focusedDate);this._ignoreFocusedDateChange=!1}_onOverlayClosed(){this.__showOthers&&(this.__showOthers(),this.__showOthers=null),window.removeEventListener("scroll",this._boundOnScroll,!0),this._closedByEscape&&this._applyInputValue(this._selectedDate),this.__commitParsedOrFocusedDate(),this._nativeInput&&this._nativeInput.selectionStart&&(this._nativeInput.selectionStart=this._nativeInput.selectionEnd),!this.value&&!this._keyboardActive&&this._requestValidation()}_onScroll(e){(e.target===window||!this._overlayContent.contains(e.target))&&this._overlayContent._repositionYearScroller()}_focus(){this._noInput||this.inputElement.focus()}_focusAndSelect(){this._focus(),this._setSelectionRange(0,this._inputElementValue.length)}_applyInputValue(e){this._inputElementValue=e?this.__formatDate(e):""}_setSelectionRange(e,t){this._nativeInput&&this._nativeInput.setSelectionRange&&this._nativeInput.setSelectionRange(e,t)}_onChange(e){e.stopPropagation()}_onClick(e){this._isClearButton(e)||this._onHostClick(e)}_onHostClick(e){(!this.autoOpenDisabled||this._noInput)&&(e.preventDefault(),this.open())}_onClearButtonClick(e){e.preventDefault(),this.__commitDate(null)}_onKeyDown(e){switch(super._onKeyDown(e),this._noInput&&[9].indexOf(e.keyCode)===-1&&e.preventDefault(),e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this.opened?this._overlayContent.focusDateElement():(this._focusOverlayOnOpen=!0,this.open());break;case"Tab":this.opened&&(e.preventDefault(),e.stopPropagation(),this._setSelectionRange(0,0),e.shiftKey?this._overlayContent.focusCancel():this._overlayContent.focusDateElement());break}}_onEnter(e){this.opened?this.close():this.__commitParsedOrFocusedDate()}_onEscape(e){if(!this.opened){if(this.clearButtonVisible&&this.value&&!this.readonly){e.stopPropagation(),this._onClearButtonClick(e);return}this.inputElement.value===""?this.__commitDate(null):this._applyInputValue(this._selectedDate)}}_isClearButton(e){return e.composedPath()[0]===this.clearElement}_onInput(){!this.opened&&this._inputElementValue&&!this.autoOpenDisabled&&this.open();const e=this.__parseDate(this._inputElementValue||"");e&&(this._ignoreFocusedDateChange=!0,Y(e,this._focusedDate)||(this._focusedDate=e),this._ignoreFocusedDateChange=!1),this.__setEnteredDate(e)}__setEnteredDate(e){e?Y(this.__enteredDate,e)||(this.__enteredDate=e):this.__enteredDate!=null&&(this.__enteredDate=null)}__computeMinOrMaxDate(e){return fe(e)}};/**
|
|
1624
|
-
* @license
|
|
1625
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1626
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1627
|
-
*/const $r=o.i$3`
|
|
1628
|
-
:host([opened]) {
|
|
1629
|
-
pointer-events: auto;
|
|
1630
|
-
}
|
|
1631
|
-
|
|
1632
|
-
:host([dir='rtl']) [part='input-field'] {
|
|
1633
|
-
direction: ltr;
|
|
1634
|
-
}
|
|
1635
|
-
|
|
1636
|
-
:host([dir='rtl']) [part='input-field'] ::slotted(input)::placeholder {
|
|
1637
|
-
direction: rtl;
|
|
1638
|
-
text-align: left;
|
|
1639
|
-
}
|
|
1640
|
-
`;/**
|
|
1641
|
-
* @license
|
|
1642
|
-
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
1643
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1644
|
-
*/o.registerStyles("vaadin-date-picker",[o.inputFieldShared,$r],{moduleId:"vaadin-date-picker-styles"});class Br extends Rr(o.InputControlMixin(o.ThemableMixin(o.ElementMixin(o.PolymerElement)))){static get is(){return"vaadin-date-picker"}static get template(){return o.html`
|
|
1645
|
-
<div class="vaadin-date-picker-container">
|
|
1646
|
-
<div part="label">
|
|
1647
|
-
<slot name="label"></slot>
|
|
1648
|
-
<span part="required-indicator" aria-hidden="true" on-click="focus"></span>
|
|
1649
|
-
</div>
|
|
1650
|
-
|
|
1651
|
-
<vaadin-input-container
|
|
1652
|
-
part="input-field"
|
|
1653
|
-
readonly="[[readonly]]"
|
|
1654
|
-
disabled="[[disabled]]"
|
|
1655
|
-
invalid="[[invalid]]"
|
|
1656
|
-
theme$="[[_theme]]"
|
|
1657
|
-
>
|
|
1658
|
-
<slot name="prefix" slot="prefix"></slot>
|
|
1659
|
-
<slot name="input"></slot>
|
|
1660
|
-
<div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
|
|
1661
|
-
<div part="toggle-button" slot="suffix" aria-hidden="true" on-click="_toggle"></div>
|
|
1662
|
-
</vaadin-input-container>
|
|
1663
|
-
|
|
1664
|
-
<div part="helper-text">
|
|
1665
|
-
<slot name="helper"></slot>
|
|
1666
|
-
</div>
|
|
1667
|
-
|
|
1668
|
-
<div part="error-message">
|
|
1669
|
-
<slot name="error-message"></slot>
|
|
1670
|
-
</div>
|
|
1671
|
-
</div>
|
|
1672
|
-
|
|
1673
|
-
<vaadin-date-picker-overlay
|
|
1674
|
-
id="overlay"
|
|
1675
|
-
fullscreen$="[[_fullscreen]]"
|
|
1676
|
-
theme$="[[_theme]]"
|
|
1677
|
-
opened="{{opened}}"
|
|
1678
|
-
on-vaadin-overlay-escape-press="_onOverlayEscapePress"
|
|
1679
|
-
on-vaadin-overlay-open="_onOverlayOpened"
|
|
1680
|
-
on-vaadin-overlay-closing="_onOverlayClosed"
|
|
1681
|
-
restore-focus-on-close
|
|
1682
|
-
restore-focus-node="[[inputElement]]"
|
|
1683
|
-
></vaadin-date-picker-overlay>
|
|
1684
|
-
|
|
1685
|
-
<slot name="tooltip"></slot>
|
|
1686
|
-
`}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new o.InputController(this,e=>{this._setInputElement(e),this._setFocusElement(e),this.stateTarget=e,this.ariaTarget=e},{uniqueIdPrefix:"search-input"})),this.addController(new o.LabelledInputController(this.inputElement,this._labelController)),this._tooltipController=new o.TooltipController(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow(e=>!e.opened),this.shadowRoot.querySelector('[part="toggle-button"]').addEventListener("mousedown",e=>e.preventDefault()),this.$.overlay.addEventListener("vaadin-overlay-close",this._onVaadinOverlayClose.bind(this))}_onVaadinOverlayClose(i){i.detail.sourceEvent&&i.detail.sourceEvent.composedPath().includes(this)&&i.preventDefault()}_toggle(i){i.stopPropagation(),this.$.overlay.opened?this.close():this.open()}_openedChanged(i){super._openedChanged(i),this.$.overlay.positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this.$.overlay.noVerticalOverlap=!0}}o.defineCustomElement(Br);function G(a){"@babel/helpers - typeof";return G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},G(a)}function P(a,i){if(i.length<a)throw new TypeError(a+" argument"+(a>1?"s":"")+" required, but only "+i.length+" present")}function Nr(a){return P(1,arguments),a instanceof Date||G(a)==="object"&&Object.prototype.toString.call(a)==="[object Date]"}function V(a){P(1,arguments);var i=Object.prototype.toString.call(a);return a instanceof Date||G(a)==="object"&&i==="[object Date]"?new Date(a.getTime()):typeof a=="number"||i==="[object Number]"?new Date(a):((typeof a=="string"||i==="[object String]")&&typeof console!="undefined"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function qr(a){if(P(1,arguments),!Nr(a)&&typeof a!="number")return!1;var i=V(a);return!isNaN(Number(i))}function $(a){if(a===null||a===!0||a===!1)return NaN;var i=Number(a);return isNaN(i)?i:i<0?Math.ceil(i):Math.floor(i)}function Ur(a,i){P(2,arguments);var e=V(a).getTime(),t=$(i);return new Date(e+t)}function Xt(a,i){P(2,arguments);var e=$(i);return Ur(a,-e)}var Yr=864e5;function Wr(a){P(1,arguments);var i=V(a),e=i.getTime();i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0);var t=i.getTime(),r=e-t;return Math.floor(r/Yr)+1}function se(a){P(1,arguments);var i=1,e=V(a),t=e.getUTCDay(),r=(t<i?7:0)+t-i;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function Jt(a){P(1,arguments);var i=V(a),e=i.getUTCFullYear(),t=new Date(0);t.setUTCFullYear(e+1,0,4),t.setUTCHours(0,0,0,0);var r=se(t),s=new Date(0);s.setUTCFullYear(e,0,4),s.setUTCHours(0,0,0,0);var n=se(s);return i.getTime()>=r.getTime()?e+1:i.getTime()>=n.getTime()?e:e-1}function jr(a){P(1,arguments);var i=Jt(a),e=new Date(0);e.setUTCFullYear(i,0,4),e.setUTCHours(0,0,0,0);var t=se(e);return t}var Qr=6048e5;function Zt(a){P(1,arguments);var i=V(a),e=se(i).getTime()-jr(i).getTime();return Math.round(e/Qr)+1}var Gr={};function oe(){return Gr}function te(a,i){var e,t,r,s,n,l,d,h;P(1,arguments);var m=oe(),u=$((e=(t=(r=(s=i==null?void 0:i.weekStartsOn)!==null&&s!==void 0?s:i==null||(n=i.locale)===null||n===void 0||(l=n.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&r!==void 0?r:m.weekStartsOn)!==null&&t!==void 0?t:(d=m.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.weekStartsOn)!==null&&e!==void 0?e:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=V(a),_=v.getUTCDay(),y=(_<u?7:0)+_-u;return v.setUTCDate(v.getUTCDate()-y),v.setUTCHours(0,0,0,0),v}function it(a,i){var e,t,r,s,n,l,d,h;P(1,arguments);var m=V(a),u=m.getUTCFullYear(),v=oe(),_=$((e=(t=(r=(s=i==null?void 0:i.firstWeekContainsDate)!==null&&s!==void 0?s:i==null||(n=i.locale)===null||n===void 0||(l=n.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&r!==void 0?r:v.firstWeekContainsDate)!==null&&t!==void 0?t:(d=v.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(_>=1&&_<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(u+1,0,_),y.setUTCHours(0,0,0,0);var z=te(y,i),A=new Date(0);A.setUTCFullYear(u,0,_),A.setUTCHours(0,0,0,0);var R=te(A,i);return m.getTime()>=z.getTime()?u+1:m.getTime()>=R.getTime()?u:u-1}function Kr(a,i){var e,t,r,s,n,l,d,h;P(1,arguments);var m=oe(),u=$((e=(t=(r=(s=i==null?void 0:i.firstWeekContainsDate)!==null&&s!==void 0?s:i==null||(n=i.locale)===null||n===void 0||(l=n.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&r!==void 0?r:m.firstWeekContainsDate)!==null&&t!==void 0?t:(d=m.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&e!==void 0?e:1),v=it(a,i),_=new Date(0);_.setUTCFullYear(v,0,u),_.setUTCHours(0,0,0,0);var y=te(_,i);return y}var Xr=6048e5;function ei(a,i){P(1,arguments);var e=V(a),t=te(e,i).getTime()-Kr(e,i).getTime();return Math.round(t/Xr)+1}function k(a,i){for(var e=a<0?"-":"",t=Math.abs(a).toString();t.length<i;)t="0"+t;return e+t}var Jr={y:function(i,e){var t=i.getUTCFullYear(),r=t>0?t:1-t;return k(e==="yy"?r%100:r,e.length)},M:function(i,e){var t=i.getUTCMonth();return e==="M"?String(t+1):k(t+1,2)},d:function(i,e){return k(i.getUTCDate(),e.length)},a:function(i,e){var t=i.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h:function(i,e){return k(i.getUTCHours()%12||12,e.length)},H:function(i,e){return k(i.getUTCHours(),e.length)},m:function(i,e){return k(i.getUTCMinutes(),e.length)},s:function(i,e){return k(i.getUTCSeconds(),e.length)},S:function(i,e){var t=e.length,r=i.getUTCMilliseconds(),s=Math.floor(r*Math.pow(10,t-3));return k(s,e.length)}};const J=Jr;var re={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Zr={G:function(i,e,t){var r=i.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(r,{width:"abbreviated"});case"GGGGG":return t.era(r,{width:"narrow"});case"GGGG":default:return t.era(r,{width:"wide"})}},y:function(i,e,t){if(e==="yo"){var r=i.getUTCFullYear(),s=r>0?r:1-r;return t.ordinalNumber(s,{unit:"year"})}return J.y(i,e)},Y:function(i,e,t,r){var s=it(i,r),n=s>0?s:1-s;if(e==="YY"){var l=n%100;return k(l,2)}return e==="Yo"?t.ordinalNumber(n,{unit:"year"}):k(n,e.length)},R:function(i,e){var t=Jt(i);return k(t,e.length)},u:function(i,e){var t=i.getUTCFullYear();return k(t,e.length)},Q:function(i,e,t){var r=Math.ceil((i.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return k(r,2);case"Qo":return t.ordinalNumber(r,{unit:"quarter"});case"QQQ":return t.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(r,{width:"wide",context:"formatting"})}},q:function(i,e,t){var r=Math.ceil((i.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return k(r,2);case"qo":return t.ordinalNumber(r,{unit:"quarter"});case"qqq":return t.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(r,{width:"wide",context:"standalone"})}},M:function(i,e,t){var r=i.getUTCMonth();switch(e){case"M":case"MM":return J.M(i,e);case"Mo":return t.ordinalNumber(r+1,{unit:"month"});case"MMM":return t.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(r,{width:"wide",context:"formatting"})}},L:function(i,e,t){var r=i.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return k(r+1,2);case"Lo":return t.ordinalNumber(r+1,{unit:"month"});case"LLL":return t.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(r,{width:"wide",context:"standalone"})}},w:function(i,e,t,r){var s=ei(i,r);return e==="wo"?t.ordinalNumber(s,{unit:"week"}):k(s,e.length)},I:function(i,e,t){var r=Zt(i);return e==="Io"?t.ordinalNumber(r,{unit:"week"}):k(r,e.length)},d:function(i,e,t){return e==="do"?t.ordinalNumber(i.getUTCDate(),{unit:"date"}):J.d(i,e)},D:function(i,e,t){var r=Wr(i);return e==="Do"?t.ordinalNumber(r,{unit:"dayOfYear"}):k(r,e.length)},E:function(i,e,t){var r=i.getUTCDay();switch(e){case"E":case"EE":case"EEE":return t.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(r,{width:"short",context:"formatting"});case"EEEE":default:return t.day(r,{width:"wide",context:"formatting"})}},e:function(i,e,t,r){var s=i.getUTCDay(),n=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(n);case"ee":return k(n,2);case"eo":return t.ordinalNumber(n,{unit:"day"});case"eee":return t.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(s,{width:"short",context:"formatting"});case"eeee":default:return t.day(s,{width:"wide",context:"formatting"})}},c:function(i,e,t,r){var s=i.getUTCDay(),n=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(n);case"cc":return k(n,e.length);case"co":return t.ordinalNumber(n,{unit:"day"});case"ccc":return t.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(s,{width:"narrow",context:"standalone"});case"cccccc":return t.day(s,{width:"short",context:"standalone"});case"cccc":default:return t.day(s,{width:"wide",context:"standalone"})}},i:function(i,e,t){var r=i.getUTCDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return k(s,e.length);case"io":return t.ordinalNumber(s,{unit:"day"});case"iii":return t.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(r,{width:"short",context:"formatting"});case"iiii":default:return t.day(r,{width:"wide",context:"formatting"})}},a:function(i,e,t){var r=i.getUTCHours(),s=r/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(i,e,t){var r=i.getUTCHours(),s;switch(r===12?s=re.noon:r===0?s=re.midnight:s=r/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(i,e,t){var r=i.getUTCHours(),s;switch(r>=17?s=re.evening:r>=12?s=re.afternoon:r>=4?s=re.morning:s=re.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(i,e,t){if(e==="ho"){var r=i.getUTCHours()%12;return r===0&&(r=12),t.ordinalNumber(r,{unit:"hour"})}return J.h(i,e)},H:function(i,e,t){return e==="Ho"?t.ordinalNumber(i.getUTCHours(),{unit:"hour"}):J.H(i,e)},K:function(i,e,t){var r=i.getUTCHours()%12;return e==="Ko"?t.ordinalNumber(r,{unit:"hour"}):k(r,e.length)},k:function(i,e,t){var r=i.getUTCHours();return r===0&&(r=24),e==="ko"?t.ordinalNumber(r,{unit:"hour"}):k(r,e.length)},m:function(i,e,t){return e==="mo"?t.ordinalNumber(i.getUTCMinutes(),{unit:"minute"}):J.m(i,e)},s:function(i,e,t){return e==="so"?t.ordinalNumber(i.getUTCSeconds(),{unit:"second"}):J.s(i,e)},S:function(i,e){return J.S(i,e)},X:function(i,e,t,r){var s=r._originalDate||i,n=s.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return yt(n);case"XXXX":case"XX":return ee(n);case"XXXXX":case"XXX":default:return ee(n,":")}},x:function(i,e,t,r){var s=r._originalDate||i,n=s.getTimezoneOffset();switch(e){case"x":return yt(n);case"xxxx":case"xx":return ee(n);case"xxxxx":case"xxx":default:return ee(n,":")}},O:function(i,e,t,r){var s=r._originalDate||i,n=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+bt(n,":");case"OOOO":default:return"GMT"+ee(n,":")}},z:function(i,e,t,r){var s=r._originalDate||i,n=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+bt(n,":");case"zzzz":default:return"GMT"+ee(n,":")}},t:function(i,e,t,r){var s=r._originalDate||i,n=Math.floor(s.getTime()/1e3);return k(n,e.length)},T:function(i,e,t,r){var s=r._originalDate||i,n=s.getTime();return k(n,e.length)}};function bt(a,i){var e=a>0?"-":"+",t=Math.abs(a),r=Math.floor(t/60),s=t%60;if(s===0)return e+String(r);var n=i;return e+String(r)+n+k(s,2)}function yt(a,i){if(a%60===0){var e=a>0?"-":"+";return e+k(Math.abs(a)/60,2)}return ee(a,i)}function ee(a,i){var e=i||"",t=a>0?"-":"+",r=Math.abs(a),s=k(Math.floor(r/60),2),n=k(r%60,2);return t+s+e+n}const ea=Zr;var wt=function(i,e){switch(i){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},ti=function(i,e){switch(i){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},ta=function(i,e){var t=i.match(/(P+)(p+)?/)||[],r=t[1],s=t[2];if(!s)return wt(i,e);var n;switch(r){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;case"PPPP":default:n=e.dateTime({width:"full"});break}return n.replace("{{date}}",wt(r,e)).replace("{{time}}",ti(s,e))},ia={p:ti,P:ta};const je=ia;function ii(a){var i=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return i.setUTCFullYear(a.getFullYear()),a.getTime()-i.getTime()}var ra=["D","DD"],aa=["YY","YYYY"];function ri(a){return ra.indexOf(a)!==-1}function ai(a){return aa.indexOf(a)!==-1}function ke(a,i,e){if(a==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(i,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(a==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(i,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(a==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(i,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(a==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(i,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var sa={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},na=function(i,e,t){var r,s=sa[i];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+r:r+" ago":r};const oa=na;function Re(a){return function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=i.width?String(i.width):a.defaultWidth,t=a.formats[e]||a.formats[a.defaultWidth];return t}}var la={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},da={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ha={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ca={date:Re({formats:la,defaultWidth:"full"}),time:Re({formats:da,defaultWidth:"full"}),dateTime:Re({formats:ha,defaultWidth:"full"})};const ua=ca;var pa={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},fa=function(i,e,t,r){return pa[i]};const ma=fa;function ue(a){return function(i,e){var t=e!=null&&e.context?String(e.context):"standalone",r;if(t==="formatting"&&a.formattingValues){var s=a.defaultFormattingWidth||a.defaultWidth,n=e!=null&&e.width?String(e.width):s;r=a.formattingValues[n]||a.formattingValues[s]}else{var l=a.defaultWidth,d=e!=null&&e.width?String(e.width):a.defaultWidth;r=a.values[d]||a.values[l]}var h=a.argumentCallback?a.argumentCallback(i):i;return r[h]}}var _a={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},va={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ga={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ba={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ya={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},wa={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},xa=function(i,e){var t=Number(i),r=t%100;if(r>20||r<10)switch(r%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},Ca={ordinalNumber:xa,era:ue({values:_a,defaultWidth:"wide"}),quarter:ue({values:va,defaultWidth:"wide",argumentCallback:function(i){return i-1}}),month:ue({values:ga,defaultWidth:"wide"}),day:ue({values:ba,defaultWidth:"wide"}),dayPeriod:ue({values:ya,defaultWidth:"wide",formattingValues:wa,defaultFormattingWidth:"wide"})};const ka=Ca;function pe(a){return function(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.width,r=t&&a.matchPatterns[t]||a.matchPatterns[a.defaultMatchWidth],s=i.match(r);if(!s)return null;var n=s[0],l=t&&a.parsePatterns[t]||a.parsePatterns[a.defaultParseWidth],d=Array.isArray(l)?Da(l,function(u){return u.test(n)}):Ta(l,function(u){return u.test(n)}),h;h=a.valueCallback?a.valueCallback(d):d,h=e.valueCallback?e.valueCallback(h):h;var m=i.slice(n.length);return{value:h,rest:m}}}function Ta(a,i){for(var e in a)if(a.hasOwnProperty(e)&&i(a[e]))return e}function Da(a,i){for(var e=0;e<a.length;e++)if(i(a[e]))return e}function Ia(a){return function(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=i.match(a.matchPattern);if(!t)return null;var r=t[0],s=i.match(a.parsePattern);if(!s)return null;var n=a.valueCallback?a.valueCallback(s[0]):s[0];n=e.valueCallback?e.valueCallback(n):n;var l=i.slice(r.length);return{value:n,rest:l}}}var Ea=/^(\d+)(th|st|nd|rd)?/i,Sa=/\d+/i,Pa={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ma={any:[/^b/i,/^(a|c)/i]},Oa={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Va={any:[/1/i,/2/i,/3/i,/4/i]},Fa={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Aa={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ha={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},La={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},za={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ra={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},$a={ordinalNumber:Ia({matchPattern:Ea,parsePattern:Sa,valueCallback:function(i){return parseInt(i,10)}}),era:pe({matchPatterns:Pa,defaultMatchWidth:"wide",parsePatterns:Ma,defaultParseWidth:"any"}),quarter:pe({matchPatterns:Oa,defaultMatchWidth:"wide",parsePatterns:Va,defaultParseWidth:"any",valueCallback:function(i){return i+1}}),month:pe({matchPatterns:Fa,defaultMatchWidth:"wide",parsePatterns:Aa,defaultParseWidth:"any"}),day:pe({matchPatterns:Ha,defaultMatchWidth:"wide",parsePatterns:La,defaultParseWidth:"any"}),dayPeriod:pe({matchPatterns:za,defaultMatchWidth:"any",parsePatterns:Ra,defaultParseWidth:"any"})};const Ba=$a;var Na={code:"en-US",formatDistance:oa,formatLong:ua,formatRelative:ma,localize:ka,match:Ba,options:{weekStartsOn:0,firstWeekContainsDate:1}};const si=Na;var qa=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ua=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ya=/^'([^]*?)'?$/,Wa=/''/g,ja=/[a-zA-Z]/;function Qa(a,i,e){var t,r,s,n,l,d,h,m,u,v,_,y,z,A;P(2,arguments);var R=String(i),E=oe(),q=(t=(r=void 0)!==null&&r!==void 0?r:E.locale)!==null&&t!==void 0?t:si,W=$((s=(n=(l=(d=void 0)!==null&&d!==void 0?d:void 0)!==null&&l!==void 0?l:E.firstWeekContainsDate)!==null&&n!==void 0?n:(h=E.locale)===null||h===void 0||(m=h.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(W>=1&&W<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var B=$((u=(v=(_=(y=void 0)!==null&&y!==void 0?y:void 0)!==null&&_!==void 0?_:E.weekStartsOn)!==null&&v!==void 0?v:(z=E.locale)===null||z===void 0||(A=z.options)===null||A===void 0?void 0:A.weekStartsOn)!==null&&u!==void 0?u:0);if(!(B>=0&&B<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!q.localize)throw new RangeError("locale must contain localize property");if(!q.formatLong)throw new RangeError("locale must contain formatLong property");var X=V(a);if(!qr(X))throw new RangeError("Invalid time value");var le=ii(X),de=Xt(X,le),he={firstWeekContainsDate:W,weekStartsOn:B,locale:q,_originalDate:X},Se=R.match(Ua).map(function(H){var N=H[0];if(N==="p"||N==="P"){var Z=je[N];return Z(H,q.formatLong)}return H}).join("").match(qa).map(function(H){if(H==="''")return"'";var N=H[0];if(N==="'")return Ga(H);var Z=ea[N];if(Z)return ai(H)&&ke(H,i,String(a)),ri(H)&&ke(H,i,String(a)),Z(de,H,q.localize,he);if(N.match(ja))throw new RangeError("Format string contains an unescaped latin alphabet character `"+N+"`");return H}).join("");return Se}function Ga(a){var i=a.match(Ya);return i?i[1].replace(Wa,"'"):a}function xt(a,i){(i==null||i>a.length)&&(i=a.length);for(var e=0,t=Array(i);e<i;e++)t[e]=a[e];return t}function Ka(a,i){if(a){if(typeof a=="string")return xt(a,i);var e={}.toString.call(a).slice(8,-1);return e==="Object"&&a.constructor&&(e=a.constructor.name),e==="Map"||e==="Set"?Array.from(a):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?xt(a,i):void 0}}function Ct(a,i){var e=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(!e){if(Array.isArray(a)||(e=Ka(a))||i){e&&(a=e);var t=0,r=function(){};return{s:r,n:function(){return t>=a.length?{done:!0}:{done:!1,value:a[t++]}},e:function(h){throw h},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1687
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,n=!0,l=!1;return{s:function(){e=e.call(a)},n:function(){var h=e.next();return n=h.done,h},e:function(h){l=!0,s=h},f:function(){try{n||e.return==null||e.return()}finally{if(l)throw s}}}}function Xa(a,i){if(a==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(a[e]=i[e]);return a}function f(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function Qe(a,i){return Qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Qe(a,i)}function w(a,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(i&&i.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),i&&Qe(a,i)}function Te(a){return Te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},Te(a)}function ni(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(i){}return(ni=function(){return!!a})()}function Ja(a,i){if(i&&(G(i)=="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(a)}function x(a){var i=ni();return function(){var e,t=Te(a);if(i){var r=Te(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return Ja(this,e)}}function g(a,i){if(!(a instanceof i))throw new TypeError("Cannot call a class as a function")}function Za(a,i){if(G(a)!="object"||!a)return a;var e=a[Symbol.toPrimitive];if(e!==void 0){var t=e.call(a,i);if(G(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(a)}function oi(a){var i=Za(a,"string");return G(i)=="symbol"?i:i+""}function es(a,i){for(var e=0;e<i.length;e++){var t=i[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,oi(t.key),t)}}function b(a,i,e){return i&&es(a.prototype,i),Object.defineProperty(a,"prototype",{writable:!1}),a}function p(a,i,e){return(i=oi(i))in a?Object.defineProperty(a,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):a[i]=e,a}var ts=10,li=function(){function a(){g(this,a),p(this,"priority",void 0),p(this,"subPriority",0)}return b(a,[{key:"validate",value:function(e,t){return!0}}]),a}(),is=function(a){w(e,a);var i=x(e);function e(t,r,s,n,l){var d;return g(this,e),d=i.call(this),d.value=t,d.validateValue=r,d.setValue=s,d.priority=n,l&&(d.subPriority=l),d}return b(e,[{key:"validate",value:function(r,s){return this.validateValue(r,this.value,s)}},{key:"set",value:function(r,s,n){return this.setValue(r,s,this.value,n)}}]),e}(li),rs=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",ts),p(f(t),"subPriority",-1),t}return b(e,[{key:"set",value:function(r,s){if(s.timestampIsSet)return r;var n=new Date(0);return n.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),n.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),n}}]),e}(li),C=function(){function a(){g(this,a),p(this,"incompatibleTokens",void 0),p(this,"priority",void 0),p(this,"subPriority",void 0)}return b(a,[{key:"run",value:function(e,t,r,s){var n=this.parse(e,t,r,s);return n?{setter:new is(n.value,this.validate,this.set,this.priority,this.subPriority),rest:n.rest}:null}},{key:"validate",value:function(e,t,r){return!0}}]),a}(),as=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",140),p(f(t),"incompatibleTokens",["R","u","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"})||n.era(r,{width:"narrow"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})||n.era(r,{width:"abbreviated"})||n.era(r,{width:"narrow"})}}},{key:"set",value:function(r,s,n){return s.era=n,r.setUTCFullYear(n,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(C),ss=6e4,ns=36e5,os=1e3,M={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},j={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function O(a,i){return a&&{value:i(a.value),rest:a.rest}}function I(a,i){var e=i.match(a);return e?{value:parseInt(e[0],10),rest:i.slice(e[0].length)}:null}function Q(a,i){var e=i.match(a);if(!e)return null;if(e[0]==="Z")return{value:0,rest:i.slice(1)};var t=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,s=e[3]?parseInt(e[3],10):0,n=e[5]?parseInt(e[5],10):0;return{value:t*(r*ns+s*ss+n*os),rest:i.slice(e[0].length)}}function di(a){return I(M.anyDigitsSigned,a)}function S(a,i){switch(a){case 1:return I(M.singleDigit,i);case 2:return I(M.twoDigits,i);case 3:return I(M.threeDigits,i);case 4:return I(M.fourDigits,i);default:return I(new RegExp("^\\d{1,"+a+"}"),i)}}function De(a,i){switch(a){case 1:return I(M.singleDigitSigned,i);case 2:return I(M.twoDigitsSigned,i);case 3:return I(M.threeDigitsSigned,i);case 4:return I(M.fourDigitsSigned,i);default:return I(new RegExp("^-?\\d{1,"+a+"}"),i)}}function rt(a){switch(a){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function hi(a,i){var e=i>0,t=e?i:1-i,r;if(t<=50)r=a||100;else{var s=t+50,n=Math.floor(s/100)*100,l=a>=s%100;r=a+n-(l?100:0)}return e?r:1-r}function ci(a){return a%400===0||a%4===0&&a%100!==0}var ls=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",130),p(f(t),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){var l=function(h){return{year:h,isTwoDigitYear:s==="yy"}};switch(s){case"y":return O(S(4,r),l);case"yo":return O(n.ordinalNumber(r,{unit:"year"}),l);default:return O(S(s.length,r),l)}}},{key:"validate",value:function(r,s){return s.isTwoDigitYear||s.year>0}},{key:"set",value:function(r,s,n){var l=r.getUTCFullYear();if(n.isTwoDigitYear){var d=hi(n.year,l);return r.setUTCFullYear(d,0,1),r.setUTCHours(0,0,0,0),r}var h=!("era"in s)||s.era===1?n.year:1-n.year;return r.setUTCFullYear(h,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(C),ds=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",130),p(f(t),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){var l=function(h){return{year:h,isTwoDigitYear:s==="YY"}};switch(s){case"Y":return O(S(4,r),l);case"Yo":return O(n.ordinalNumber(r,{unit:"year"}),l);default:return O(S(s.length,r),l)}}},{key:"validate",value:function(r,s){return s.isTwoDigitYear||s.year>0}},{key:"set",value:function(r,s,n,l){var d=it(r,l);if(n.isTwoDigitYear){var h=hi(n.year,d);return r.setUTCFullYear(h,0,l.firstWeekContainsDate),r.setUTCHours(0,0,0,0),te(r,l)}var m=!("era"in s)||s.era===1?n.year:1-n.year;return r.setUTCFullYear(m,0,l.firstWeekContainsDate),r.setUTCHours(0,0,0,0),te(r,l)}}]),e}(C),hs=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",130),p(f(t),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),t}return b(e,[{key:"parse",value:function(r,s){return De(s==="R"?4:s.length,r)}},{key:"set",value:function(r,s,n){var l=new Date(0);return l.setUTCFullYear(n,0,4),l.setUTCHours(0,0,0,0),se(l)}}]),e}(C),cs=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",130),p(f(t),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),t}return b(e,[{key:"parse",value:function(r,s){return De(s==="u"?4:s.length,r)}},{key:"set",value:function(r,s,n){return r.setUTCFullYear(n,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(C),us=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",120),p(f(t),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"Q":case"QQ":return S(s.length,r);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"})||n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})||n.quarter(r,{width:"abbreviated",context:"formatting"})||n.quarter(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,s){return s>=1&&s<=4}},{key:"set",value:function(r,s,n){return r.setUTCMonth((n-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),e}(C),ps=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",120),p(f(t),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"q":case"qq":return S(s.length,r);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"})||n.quarter(r,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})||n.quarter(r,{width:"abbreviated",context:"standalone"})||n.quarter(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,s){return s>=1&&s<=4}},{key:"set",value:function(r,s,n){return r.setUTCMonth((n-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),e}(C),fs=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),p(f(t),"priority",110),t}return b(e,[{key:"parse",value:function(r,s,n){var l=function(h){return h-1};switch(s){case"M":return O(I(M.month,r),l);case"MM":return O(S(2,r),l);case"Mo":return O(n.ordinalNumber(r,{unit:"month"}),l);case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"})||n.month(r,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})||n.month(r,{width:"abbreviated",context:"formatting"})||n.month(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,s){return s>=0&&s<=11}},{key:"set",value:function(r,s,n){return r.setUTCMonth(n,1),r.setUTCHours(0,0,0,0),r}}]),e}(C),ms=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",110),p(f(t),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){var l=function(h){return h-1};switch(s){case"L":return O(I(M.month,r),l);case"LL":return O(S(2,r),l);case"Lo":return O(n.ordinalNumber(r,{unit:"month"}),l);case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"})||n.month(r,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})||n.month(r,{width:"abbreviated",context:"standalone"})||n.month(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,s){return s>=0&&s<=11}},{key:"set",value:function(r,s,n){return r.setUTCMonth(n,1),r.setUTCHours(0,0,0,0),r}}]),e}(C);function _s(a,i,e){P(2,arguments);var t=V(a),r=$(i),s=ei(t,e)-r;return t.setUTCDate(t.getUTCDate()-s*7),t}var vs=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",100),p(f(t),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"w":return I(M.week,r);case"wo":return n.ordinalNumber(r,{unit:"week"});default:return S(s.length,r)}}},{key:"validate",value:function(r,s){return s>=1&&s<=53}},{key:"set",value:function(r,s,n,l){return te(_s(r,n,l),l)}}]),e}(C);function gs(a,i){P(2,arguments);var e=V(a),t=$(i),r=Zt(e)-t;return e.setUTCDate(e.getUTCDate()-r*7),e}var bs=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",100),p(f(t),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"I":return I(M.week,r);case"Io":return n.ordinalNumber(r,{unit:"week"});default:return S(s.length,r)}}},{key:"validate",value:function(r,s){return s>=1&&s<=53}},{key:"set",value:function(r,s,n){return se(gs(r,n))}}]),e}(C),ys=[31,28,31,30,31,30,31,31,30,31,30,31],ws=[31,29,31,30,31,30,31,31,30,31,30,31],xs=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",90),p(f(t),"subPriority",1),p(f(t),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"d":return I(M.date,r);case"do":return n.ordinalNumber(r,{unit:"date"});default:return S(s.length,r)}}},{key:"validate",value:function(r,s){var n=r.getUTCFullYear(),l=ci(n),d=r.getUTCMonth();return l?s>=1&&s<=ws[d]:s>=1&&s<=ys[d]}},{key:"set",value:function(r,s,n){return r.setUTCDate(n),r.setUTCHours(0,0,0,0),r}}]),e}(C),Cs=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",90),p(f(t),"subpriority",1),p(f(t),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"D":case"DD":return I(M.dayOfYear,r);case"Do":return n.ordinalNumber(r,{unit:"date"});default:return S(s.length,r)}}},{key:"validate",value:function(r,s){var n=r.getUTCFullYear(),l=ci(n);return l?s>=1&&s<=366:s>=1&&s<=365}},{key:"set",value:function(r,s,n){return r.setUTCMonth(0,n),r.setUTCHours(0,0,0,0),r}}]),e}(C);function at(a,i,e){var t,r,s,n,l,d,h,m;P(2,arguments);var u=oe(),v=$((t=(r=(s=(n=e==null?void 0:e.weekStartsOn)!==null&&n!==void 0?n:e==null||(l=e.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&s!==void 0?s:u.weekStartsOn)!==null&&r!==void 0?r:(h=u.locale)===null||h===void 0||(m=h.options)===null||m===void 0?void 0:m.weekStartsOn)!==null&&t!==void 0?t:0);if(!(v>=0&&v<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var _=V(a),y=$(i),z=_.getUTCDay(),A=y%7,R=(A+7)%7,E=(R<v?7:0)+y-z;return _.setUTCDate(_.getUTCDate()+E),_}var ks=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",90),p(f(t),"incompatibleTokens",["D","i","e","c","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"})||n.day(r,{width:"short",context:"formatting"})||n.day(r,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"})||n.day(r,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})||n.day(r,{width:"abbreviated",context:"formatting"})||n.day(r,{width:"short",context:"formatting"})||n.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,s){return s>=0&&s<=6}},{key:"set",value:function(r,s,n,l){return r=at(r,n,l),r.setUTCHours(0,0,0,0),r}}]),e}(C),Ts=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",90),p(f(t),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n,l){var d=function(m){var u=Math.floor((m-1)/7)*7;return(m+l.weekStartsOn+6)%7+u};switch(s){case"e":case"ee":return O(S(s.length,r),d);case"eo":return O(n.ordinalNumber(r,{unit:"day"}),d);case"eee":return n.day(r,{width:"abbreviated",context:"formatting"})||n.day(r,{width:"short",context:"formatting"})||n.day(r,{width:"narrow",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"})||n.day(r,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})||n.day(r,{width:"abbreviated",context:"formatting"})||n.day(r,{width:"short",context:"formatting"})||n.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,s){return s>=0&&s<=6}},{key:"set",value:function(r,s,n,l){return r=at(r,n,l),r.setUTCHours(0,0,0,0),r}}]),e}(C),Ds=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",90),p(f(t),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n,l){var d=function(m){var u=Math.floor((m-1)/7)*7;return(m+l.weekStartsOn+6)%7+u};switch(s){case"c":case"cc":return O(S(s.length,r),d);case"co":return O(n.ordinalNumber(r,{unit:"day"}),d);case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"})||n.day(r,{width:"short",context:"standalone"})||n.day(r,{width:"narrow",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"})||n.day(r,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})||n.day(r,{width:"abbreviated",context:"standalone"})||n.day(r,{width:"short",context:"standalone"})||n.day(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,s){return s>=0&&s<=6}},{key:"set",value:function(r,s,n,l){return r=at(r,n,l),r.setUTCHours(0,0,0,0),r}}]),e}(C);function Is(a,i){P(2,arguments);var e=$(i);e%7===0&&(e=e-7);var t=1,r=V(a),s=r.getUTCDay(),n=e%7,l=(n+7)%7,d=(l<t?7:0)+e-s;return r.setUTCDate(r.getUTCDate()+d),r}var Es=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",90),p(f(t),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){var l=function(h){return h===0?7:h};switch(s){case"i":case"ii":return S(s.length,r);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return O(n.day(r,{width:"abbreviated",context:"formatting"})||n.day(r,{width:"short",context:"formatting"})||n.day(r,{width:"narrow",context:"formatting"}),l);case"iiiii":return O(n.day(r,{width:"narrow",context:"formatting"}),l);case"iiiiii":return O(n.day(r,{width:"short",context:"formatting"})||n.day(r,{width:"narrow",context:"formatting"}),l);case"iiii":default:return O(n.day(r,{width:"wide",context:"formatting"})||n.day(r,{width:"abbreviated",context:"formatting"})||n.day(r,{width:"short",context:"formatting"})||n.day(r,{width:"narrow",context:"formatting"}),l)}}},{key:"validate",value:function(r,s){return s>=1&&s<=7}},{key:"set",value:function(r,s,n){return r=Is(r,n),r.setUTCHours(0,0,0,0),r}}]),e}(C),Ss=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",80),p(f(t),"incompatibleTokens",["b","B","H","k","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"a":case"aa":case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"})||n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})||n.dayPeriod(r,{width:"abbreviated",context:"formatting"})||n.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,s,n){return r.setUTCHours(rt(n),0,0,0),r}}]),e}(C),Ps=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",80),p(f(t),"incompatibleTokens",["a","B","H","k","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"b":case"bb":case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"})||n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})||n.dayPeriod(r,{width:"abbreviated",context:"formatting"})||n.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,s,n){return r.setUTCHours(rt(n),0,0,0),r}}]),e}(C),Ms=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",80),p(f(t),"incompatibleTokens",["a","b","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"})||n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})||n.dayPeriod(r,{width:"abbreviated",context:"formatting"})||n.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,s,n){return r.setUTCHours(rt(n),0,0,0),r}}]),e}(C),Os=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",70),p(f(t),"incompatibleTokens",["H","K","k","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"h":return I(M.hour12h,r);case"ho":return n.ordinalNumber(r,{unit:"hour"});default:return S(s.length,r)}}},{key:"validate",value:function(r,s){return s>=1&&s<=12}},{key:"set",value:function(r,s,n){var l=r.getUTCHours()>=12;return l&&n<12?r.setUTCHours(n+12,0,0,0):!l&&n===12?r.setUTCHours(0,0,0,0):r.setUTCHours(n,0,0,0),r}}]),e}(C),Vs=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",70),p(f(t),"incompatibleTokens",["a","b","h","K","k","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"H":return I(M.hour23h,r);case"Ho":return n.ordinalNumber(r,{unit:"hour"});default:return S(s.length,r)}}},{key:"validate",value:function(r,s){return s>=0&&s<=23}},{key:"set",value:function(r,s,n){return r.setUTCHours(n,0,0,0),r}}]),e}(C),Fs=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",70),p(f(t),"incompatibleTokens",["h","H","k","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"K":return I(M.hour11h,r);case"Ko":return n.ordinalNumber(r,{unit:"hour"});default:return S(s.length,r)}}},{key:"validate",value:function(r,s){return s>=0&&s<=11}},{key:"set",value:function(r,s,n){var l=r.getUTCHours()>=12;return l&&n<12?r.setUTCHours(n+12,0,0,0):r.setUTCHours(n,0,0,0),r}}]),e}(C),As=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",70),p(f(t),"incompatibleTokens",["a","b","h","H","K","t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"k":return I(M.hour24h,r);case"ko":return n.ordinalNumber(r,{unit:"hour"});default:return S(s.length,r)}}},{key:"validate",value:function(r,s){return s>=1&&s<=24}},{key:"set",value:function(r,s,n){var l=n<=24?n%24:n;return r.setUTCHours(l,0,0,0),r}}]),e}(C),Hs=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",60),p(f(t),"incompatibleTokens",["t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"m":return I(M.minute,r);case"mo":return n.ordinalNumber(r,{unit:"minute"});default:return S(s.length,r)}}},{key:"validate",value:function(r,s){return s>=0&&s<=59}},{key:"set",value:function(r,s,n){return r.setUTCMinutes(n,0,0),r}}]),e}(C),Ls=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",50),p(f(t),"incompatibleTokens",["t","T"]),t}return b(e,[{key:"parse",value:function(r,s,n){switch(s){case"s":return I(M.second,r);case"so":return n.ordinalNumber(r,{unit:"second"});default:return S(s.length,r)}}},{key:"validate",value:function(r,s){return s>=0&&s<=59}},{key:"set",value:function(r,s,n){return r.setUTCSeconds(n,0),r}}]),e}(C),zs=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",30),p(f(t),"incompatibleTokens",["t","T"]),t}return b(e,[{key:"parse",value:function(r,s){var n=function(d){return Math.floor(d*Math.pow(10,-s.length+3))};return O(S(s.length,r),n)}},{key:"set",value:function(r,s,n){return r.setUTCMilliseconds(n),r}}]),e}(C),Rs=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",10),p(f(t),"incompatibleTokens",["t","T","x"]),t}return b(e,[{key:"parse",value:function(r,s){switch(s){case"X":return Q(j.basicOptionalMinutes,r);case"XX":return Q(j.basic,r);case"XXXX":return Q(j.basicOptionalSeconds,r);case"XXXXX":return Q(j.extendedOptionalSeconds,r);case"XXX":default:return Q(j.extended,r)}}},{key:"set",value:function(r,s,n){return s.timestampIsSet?r:new Date(r.getTime()-n)}}]),e}(C),$s=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",10),p(f(t),"incompatibleTokens",["t","T","X"]),t}return b(e,[{key:"parse",value:function(r,s){switch(s){case"x":return Q(j.basicOptionalMinutes,r);case"xx":return Q(j.basic,r);case"xxxx":return Q(j.basicOptionalSeconds,r);case"xxxxx":return Q(j.extendedOptionalSeconds,r);case"xxx":default:return Q(j.extended,r)}}},{key:"set",value:function(r,s,n){return s.timestampIsSet?r:new Date(r.getTime()-n)}}]),e}(C),Bs=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",40),p(f(t),"incompatibleTokens","*"),t}return b(e,[{key:"parse",value:function(r){return di(r)}},{key:"set",value:function(r,s,n){return[new Date(n*1e3),{timestampIsSet:!0}]}}]),e}(C),Ns=function(a){w(e,a);var i=x(e);function e(){var t;g(this,e);for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=i.call.apply(i,[this].concat(s)),p(f(t),"priority",20),p(f(t),"incompatibleTokens","*"),t}return b(e,[{key:"parse",value:function(r){return di(r)}},{key:"set",value:function(r,s,n){return[new Date(n),{timestampIsSet:!0}]}}]),e}(C),qs={G:new as,y:new ls,Y:new ds,R:new hs,u:new cs,Q:new us,q:new ps,M:new fs,L:new ms,w:new vs,I:new bs,d:new xs,D:new Cs,E:new ks,e:new Ts,c:new Ds,i:new Es,a:new Ss,b:new Ps,B:new Ms,h:new Os,H:new Vs,K:new Fs,k:new As,m:new Hs,s:new Ls,S:new zs,X:new Rs,x:new $s,t:new Bs,T:new Ns},Us=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ys=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ws=/^'([^]*?)'?$/,js=/''/g,Qs=/\S/,Gs=/[a-zA-Z]/;function xe(a,i,e,t){var r,s,n,l,d,h,m,u,v,_,y,z,A,R;P(3,arguments);var E=String(a),q=String(i),W=oe(),B=(r=(s=void 0)!==null&&s!==void 0?s:W.locale)!==null&&r!==void 0?r:si;if(!B.match)throw new RangeError("locale must contain match property");var X=$((n=(l=(d=(h=void 0)!==null&&h!==void 0?h:void 0)!==null&&d!==void 0?d:W.firstWeekContainsDate)!==null&&l!==void 0?l:(m=W.locale)===null||m===void 0||(u=m.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(X>=1&&X<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var le=$((v=(_=(y=(z=void 0)!==null&&z!==void 0?z:void 0)!==null&&y!==void 0?y:W.weekStartsOn)!==null&&_!==void 0?_:(A=W.locale)===null||A===void 0||(R=A.options)===null||R===void 0?void 0:R.weekStartsOn)!==null&&v!==void 0?v:0);if(!(le>=0&&le<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(q==="")return E===""?V(e):new Date(NaN);var de={firstWeekContainsDate:X,weekStartsOn:le,locale:B},he=[new rs],Se=q.match(Ys).map(function(F){var D=F[0];if(D in je){var U=je[D];return U(F,B.formatLong)}return F}).join("").match(Us),H=[],N=Ct(Se),Z;try{var Ci=function(){var D=Z.value;!(t!=null&&t.useAdditionalWeekYearTokens)&&ai(D)&&ke(D,q,a),!(t!=null&&t.useAdditionalDayOfYearTokens)&&ri(D)&&ke(D,q,a);var U=D[0],ge=qs[U];if(ge){var ht=ge.incompatibleTokens;if(Array.isArray(ht)){var ct=H.find(function(ut){return ht.includes(ut.token)||ut.token===U});if(ct)throw new RangeError("The format string mustn't contain `".concat(ct.fullToken,"` and `").concat(D,"` at the same time"))}else if(ge.incompatibleTokens==="*"&&H.length>0)throw new RangeError("The format string mustn't contain `".concat(D,"` and any other token at the same time"));H.push({token:U,fullToken:D});var Me=ge.run(E,D,B.match,de);if(!Me)return{v:new Date(NaN)};he.push(Me.setter),E=Me.rest}else{if(U.match(Gs))throw new RangeError("Format string contains an unescaped latin alphabet character `"+U+"`");if(D==="''"?D="'":U==="'"&&(D=Ks(D)),E.indexOf(D)===0)E=E.slice(D.length);else return{v:new Date(NaN)}}};for(N.s();!(Z=N.n()).done;){var nt=Ci();if(G(nt)==="object")return nt.v}}catch(F){N.e(F)}finally{N.f()}if(E.length>0&&Qs.test(E))return new Date(NaN);var ki=he.map(function(F){return F.priority}).sort(function(F,D){return D-F}).filter(function(F,D,U){return U.indexOf(F)===D}).map(function(F){return he.filter(function(D){return D.priority===F}).sort(function(D,U){return U.subPriority-D.subPriority})}).map(function(F){return F[0]}),Pe=V(e);if(isNaN(Pe.getTime()))return new Date(NaN);var ce=Xt(Pe,ii(Pe)),ot={},_e=Ct(ki),lt;try{for(_e.s();!(lt=_e.n()).done;){var dt=lt.value;if(!dt.validate(ce,de))return new Date(NaN);var ve=dt.set(ce,ot,de);Array.isArray(ve)?(ce=ve[0],Xa(ot,ve[1])):ce=ve}}catch(F){_e.e(F)}finally{_e.f()}return ce}function Ks(a){return a.match(Ws)[1].replace(js,"'")}function kt(a,i){P(2,arguments);var e=V(a),t=V(i);return e.getTime()>t.getTime()}function Tt(a,i){P(2,arguments);var e=V(a),t=V(i);return e.getTime()<t.getTime()}const Xs='*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.date{font-family:"Roboto";font-style:normal}.date__wrapper{position:relative;width:100%;display:flex;flex-direction:column;gap:5px;height:100%}.date__wrapper--autofilled{pointer-events:none}.date__wrapper--autofilled .date__label{color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.date__wrapper--autofilled .date__input::part(input-field){color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.date__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.date__label--required::after{content:"*";font-family:inherit;color:var(--emw--login-color-primary, var(--emw--color-primary, #D0046C));margin-left:2px}.date__input{border:none;width:inherit;position:relative}.date__input[focused]::part(input-field){border-color:var(--emw--login-color-primary, var(--emw--color-primary, #D0046C))}.date__input[invalid]::part(input-field){border:1px solid var(--emw--color-error, var(--emw--color-red, #ed0909))}.date__input::part(input-field){border-radius:4px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));font-family:inherit;font-style:normal;font-size:16px;font-weight:300;line-height:1.5;padding:0;height:44px}.date__input>input{padding:5px 15px}.date__input::part(toggle-button){position:relative;right:10px}.date__error-message{position:absolute;top:calc(100% + 5px);left:0;color:rgba(204, 0, 0, 0.7019607843)}.date__tooltip-icon{position:absolute;right:0;bottom:10px}.date__tooltip{position:absolute;bottom:35px;right:10px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.date__tooltip.visible{opacity:1}',Js=Xs,ui=class{constructor(a){c.registerInstance(this,a),this.sendValidityState=c.createEvent(this,"sendValidityState"),this.sendInputValue=c.createEvent(this,"sendInputValue"),this.clientStyling="",this.emitOnClick=!1,this.limitStylingAppends=!1,this.showTooltip=!1,this.touched=!1,this.formatDate=i=>{const{year:e,month:t,day:r}=i,s=new Date(e,t,r);return Qa(s,this.dateFormat||"yyyy-MM-dd")},this.parseDate=i=>{const e=xe(i,this.dateFormat||"yyyy-MM-dd",new Date);return{year:e.getFullYear(),month:e.getMonth(),day:e.getDate()}},this.handleBlur=()=>{this.isValid=this.setValidity(),this.errorMessage=this.setErrorMessage(),this.touched=!0},this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.prepend(i)}}validityChanged(){this.validityStateHandler({valid:this.isValid,name:this.name}),this.emitValue==!0&&this.valueHandler({name:this.name,value:this.value})}validityStateHandler(a){this.sendValidityState.emit(a)}emitValueHandler(a){a==!0&&this.isValid&&this.valueHandler({name:this.name,value:this.value})}valueHandler(a){this.sendInputValue.emit(a)}handleClickOutside(a){a.composedPath()[0]!==this.tooltipIconReference&&a.composedPath()[0]!==this.tooltipReference&&(this.showTooltip=!1)}connectedCallback(){var a,i;this.minDate=xe(((a=this.validation.min)===null||a===void 0?void 0:a.toString())||"","yyyy-MM-dd",new Date),this.maxDate=xe(((i=this.validation.max)===null||i===void 0?void 0:i.toString())||"","yyyy-MM-dd",new Date)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}componentDidLoad(){if(this.datePicker=this.element.shadowRoot.querySelector("vaadin-date-picker"),this.inputReference=this.element.shadowRoot.querySelector("input"),this.datePicker){const a=this.datePicker.shadowRoot.querySelector('[part="toggle-button"]');a&&a.addEventListener("click",()=>this.handleCalendarIconClick())}this.datePicker.i18n=Object.assign(Object.assign({},this.datePicker.i18n),{formatDate:this.formatDate,parseDate:this.parseDate}),this.isValid=this.setValidity(),this.defaultValue&&(this.value=this.defaultValue,this.valueHandler({name:this.name,value:this.value}))}handleCalendarIconClick(){this.datePicker.opened&&this.emitOnClick&&window.postMessage({type:`registration${this.name}Clicked`},window.location.href)}handleInput(a){this.value=a.target.value,this.touched=!0,this.valueAsDate=xe(this.value||"","yyyy-MM-dd",new Date),this.isValid=this.setValidity(),this.errorMessage=this.setErrorMessage(),this.emitValueHandler(!0)}setValidity(){return Tt(this.valueAsDate,this.minDate)||kt(this.valueAsDate,this.maxDate)?!1:this.inputReference.validity.valid}setErrorMessage(){if(Tt(this.valueAsDate,this.minDate)||kt(this.valueAsDate,this.maxDate))return T.translate("dateError2",this.language);if(this.inputReference.validity.rangeUnderflow||this.inputReference.validity.rangeOverflow)return T.translate("dateError",this.language,{values:{min:this.validation.min,max:this.validation.max}});if(this.inputReference.validity.valueMissing)return T.translate("requiredError",this.language)}renderTooltip(){return this.showTooltip?c.h("div",{class:`date__tooltip ${this.showTooltip?"visible":""}`,ref:a=>this.tooltipReference=a,innerHTML:this.tooltip}):null}render(){let a="";return this.touched&&(a=this.isValid==!0||this.isValid==null?"":"text__input--invalid"),c.h("div",{key:"fc9cd0a618c7b6e62962c0800399a470fffa1fc4",class:`date__wrapper ${this.autofilled?"date__wrapper--autofilled":""} ${this.name}__input`,ref:i=>this.stylingContainer=i},c.h("label",{key:"abc7c1715dd2d0c60dd2ac6d028355de910be501",class:`date__label ${this.validation.mandatory?"date__label--required":""}}`,htmlFor:`${this.name}__input`},this.displayName," ",this.validation.mandatory?"*":""),c.h("vaadin-date-picker",{key:"a6b40a978b573d41490457d708f9a7ac78622a6f",id:`${this.name}__input`,type:"date",class:`date__input ${a}`,value:this.defaultValue,readOnly:this.autofilled,placeholder:`${this.placeholder}`,required:this.validation.mandatory,max:this.validation.max,min:this.validation.min,onChange:i=>this.handleInput(i),onBlur:this.handleBlur}),c.h("small",{key:"d802ea7b25a64802aca3a7491107fcee7af2a23c",class:"date__error-message"},this.errorMessage),this.tooltip&&c.h("img",{key:"46edd200a9ce9eba27414a6434c6b3d5e9dc9964",class:"date__tooltip-icon",src:K.tooltipIconSvg,alt:"",ref:i=>this.tooltipIconReference=i,onClick:()=>this.showTooltip=!this.showTooltip}),this.renderTooltip())}get element(){return c.getElement(this)}static get watchers(){return{isValid:["validityChanged"],emitValue:["emitValueHandler"]}}};ui.style=Js;const Zs='*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.email{font-family:"Roboto";font-style:normal}.email__wrapper{position:relative;width:100%}.email__wrapper--autofilled{pointer-events:none}.email__wrapper--autofilled .email__label{color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.email__wrapper--autofilled .email__input{color:var(--emw--color-black, #000000)}.email__wrapper--flex{display:flex;gap:5px}.email__wrapper--relative{position:relative}.email__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.email__label--required::after{content:"*";font-family:inherit;color:var(--emw--login-color-primary, var(--emw--color-primary, #D0046C));margin-left:2px}.email__input{font-family:inherit;border-radius:4px;width:100%;height:40px;border:2px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--color-black, #000000);border-radius:5px;box-sizing:border-box;font-size:16px;font-weight:300;line-height:1.5;padding:10px}.email__input:focus{outline-color:var(--emw--login-color-primary, var(--emw--color-primary, #D0046C))}.email__input--invalid{border:1px solid var(--emw--color-error, var(--emw--color-red, #ed0909))}.email__input::placeholder{color:var(--emw--color-gray-150, #828282)}.email__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.email__tooltip-icon{width:16px;height:auto}.email__tooltip{position:absolute;top:0;left:20px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.email__tooltip.visible{opacity:1}',en=Zs,pi=class{constructor(a){c.registerInstance(this,a),this.sendValidityState=c.createEvent(this,"sendValidityState"),this.sendInputValue=c.createEvent(this,"sendInputValue"),this.clientStyling="",this.limitStylingAppends=!1,this.showTooltip=!1,this.validationPattern="",this.touched=!1,this.handleInput=i=>{this.value=i.target.value,this.touched=!0,this.debounceTime&&clearTimeout(this.debounceTime),this.debounceTime=setTimeout(()=>{this.isValid=this.setValidity(),this.errorMessage=this.setErrorMessage(),this.emitValueHandler(!0)},500)},this.handleBlur=()=>{this.isValid=this.setValidity(),this.errorMessage=this.setErrorMessage(),this.touched=!0},this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.prepend(i)}}validityChanged(){this.validityStateHandler({valid:this.isValid,name:this.name}),this.emitValue==!0&&this.valueHandler({name:this.name,value:this.value})}emitValueHandler(a){a==!0&&this.isValid&&this.valueHandler({name:this.name,value:this.value})}validityStateHandler(a){this.sendValidityState.emit(a)}valueHandler(a){this.sendInputValue.emit(a)}handleClickOutside(a){a.composedPath()[0]!==this.tooltipIconReference&&a.composedPath()[0]!==this.tooltipReference&&(this.showTooltip=!1)}valueChangedHandler(a){this.isDuplicateInput&&this.name===a.detail.name+"Duplicate"&&(this.duplicateInputValue=a.detail.value)}connectedCallback(){this.validationPattern=this.setPattern()}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}componentDidLoad(){this.isValid=this.setValidity(),this.defaultValue&&(this.value=this.defaultValue,this.valueHandler({name:this.name,value:this.value}))}setValidity(){return this.inputReference.validity.valid}setPattern(){var a,i;if(((a=this.validation.custom)===null||a===void 0?void 0:a.length)>0)return(i=this.validation.custom.find(e=>e.rule==="regex"))===null||i===void 0?void 0:i.pattern}setErrorMessage(){var a,i,e,t;if(this.inputReference.validity.patternMismatch){const r=(a=this.validation.custom.find(n=>n.rule==="regex"))===null||a===void 0?void 0:a.errorKey,s=(i=this.validation.custom.find(n=>n.rule==="regex"))===null||i===void 0?void 0:i.errorMessage;return T.translate(`${r}`,this.language)?T.translate(`${r}`,this.language):s}if(this.inputReference.validity.tooShort||this.inputReference.validity.tooLong)return T.translate("lengthError",this.language,{values:{minLength:this.validation.minLength,maxLength:this.validation.maxLength}});if(this.inputReference.validity.valueMissing)return T.translate("requiredError",this.language);if(this.isDuplicateInput&&this.duplicateInputValue!==this.value){const r=(e=this.validation.custom.find(n=>n.rule==="duplicate-input"))===null||e===void 0?void 0:e.errorKey,s=(t=this.validation.custom.find(n=>n.rule==="duplicate-input"))===null||t===void 0?void 0:t.errorMessage;return T.translate(`${r}`,this.language)?T.translate(`${r}`,this.language):s}}renderTooltip(){return this.showTooltip?c.h("div",{class:`email__tooltip ${this.showTooltip?"visible":""}`,ref:a=>this.tooltipReference=a,innerHTML:this.tooltip}):null}render(){let a="";return this.touched&&(a=this.isValid==!0||this.isValid==null?"":"text__input--invalid"),c.h("div",{key:"23ac67984ab7a0f4db01e5fe01f4f326b4c6a912",class:`email__wrapper ${this.autofilled?"number__wrapper--autofilled":""} ${this.name}__input`,ref:i=>this.stylingContainer=i},c.h("div",{key:"aa2405e435aea20f1678dd74776a8ce4094bc95b",class:"email__wrapper--flex"},c.h("label",{key:"970b83bbcf082d1721c1647993fecd076939b65d",class:`email__label ${this.validation.mandatory?"email__label--required":""}`,htmlFor:`${this.name}__input`},this.displayName),c.h("div",{key:"2f03eaf161aab9b45282c1bc0de15bea8455427c",class:"email__wrapper--relative"},this.tooltip&&c.h("img",{key:"3c34b91f0b478cf04f5aabc5fdd33a8ed73d091b",class:"email__tooltip-icon",src:K.tooltipIconSvg,alt:"",ref:i=>this.tooltipIconReference=i,onClick:()=>this.showTooltip=!this.showTooltip}),this.renderTooltip())),c.h("input",{key:"491f83c0f562893c02e3425b4d54eecc214e3c95",id:`${this.name}__input`,type:"email",class:`email__input ${a}`,value:this.defaultValue,readOnly:this.autofilled,placeholder:`${this.placeholder}`,ref:i=>this.inputReference=i,pattern:this.validationPattern,required:this.validation.mandatory,minlength:this.validation.minLength,maxlength:this.validation.maxLength,onInput:this.handleInput,onBlur:this.handleBlur}),c.h("small",{key:"edb6660d958cc5d0cb41b0db195bd7e847ecbefe",class:"email__error-message"},this.errorMessage))}static get watchers(){return{isValid:["validityChanged"],emitValue:["emitValueHandler"]}}};pi.style=en;const tn='*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.number{font-family:"Roboto";font-style:normal}.number__wrapper{position:relative;width:100%}.number__wrapper--autofilled{pointer-events:none}.number__wrapper--autofilled .number__label{color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.number__wrapper--autofilled .number__input{color:var(--emw--color-black, #000000)}.number__wrapper--flex{display:flex;gap:5px}.number__wrapper--relative{position:relative}.number__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.number__label--required::after{content:"*";font-family:inherit;color:var(--emw--login-color-primary, var(--emw--color-primary, #D0046C));margin-left:2px}.number__input{font-family:inherit;border-radius:5px;width:100%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--color-black, #000000);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;line-height:18px;position:relative;-moz-appearance:textfield;}.number__input:focus{outline-color:#3E3E3E}.number__input::-webkit-outer-spin-button,.number__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.number__input--invalid{border:1px solid var(--emw--color-error, var(--emw--color-red, #ed0909))}.number__input::placeholder{color:#979797}.number__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.number__tooltip-icon{width:16px;height:auto}.number__tooltip{position:absolute;top:0;left:20px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.number__tooltip.visible{opacity:1}',rn=tn,fi=class{constructor(a){c.registerInstance(this,a),this.sendValidityState=c.createEvent(this,"sendValidityState"),this.sendInputValue=c.createEvent(this,"sendInputValue"),this.clientStyling="",this.limitStylingAppends=!1,this.showTooltip=!1,this.validationPattern="",this.touched=!1,this.handleInput=i=>{this.value=i.target.value,this.touched=!0,this.debounceTime&&clearTimeout(this.debounceTime),this.debounceTime=setTimeout(()=>{this.isValid=this.setValidity(),this.errorMessage=this.setErrorMessage(),this.emitValueHandler(!0)},500)},this.handleBlur=()=>{this.isValid=this.setValidity(),this.errorMessage=this.setErrorMessage(),this.touched=!0},this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.prepend(i)}}validityChanged(){this.validityStateHandler({valid:this.isValid,name:this.name}),this.emitValue==!0&&this.valueHandler({name:this.name,value:this.value})}validityStateHandler(a){this.sendValidityState.emit(a)}emitValueHandler(a){a==!0&&this.isValid&&this.valueHandler({name:this.name,value:this.value})}valueHandler(a){this.sendInputValue.emit(a)}handleClickOutside(a){a.composedPath()[0]!==this.tooltipIconReference&&a.composedPath()[0]!==this.tooltipReference&&(this.showTooltip=!1)}connectedCallback(){this.validationPattern=this.setPattern()}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}componentDidLoad(){this.isValid=this.setValidity(),this.defaultValue&&(this.value=this.defaultValue,this.valueHandler({name:this.name,value:this.value}))}setValidity(){return this.inputReference.validity.valid}setPattern(){var a,i;if(((a=this.validation.custom)===null||a===void 0?void 0:a.length)>0)return(i=this.validation.custom.find(e=>e.rule==="regex"))===null||i===void 0?void 0:i.pattern}setErrorMessage(){var a,i;if(this.inputReference.validity.patternMismatch){const e=(a=this.validation.custom.find(r=>r.rule==="regex"))===null||a===void 0?void 0:a.errorKey,t=(i=this.validation.custom.find(r=>r.rule==="regex"))===null||i===void 0?void 0:i.errorMessage;return T.translate(`${e}`,this.language)?T.translate(`${e}`,this.language):t}if(this.inputReference.validity.rangeUnderflow||this.inputReference.validity.rangeOverflow)return T.translate("numberLengthError",this.language,{values:{min:this.validation.min,max:this.validation.max}});if(this.inputReference.validity.valueMissing)return T.translate("requiredError",this.language)}renderTooltip(){return this.showTooltip?c.h("div",{class:`number__tooltip ${this.showTooltip?"visible":""}`,ref:a=>this.tooltipReference=a,innerHTML:this.tooltip}):null}render(){let a="";return this.touched&&(a=this.isValid==!0||this.isValid==null?"":"text__input--invalid"),c.h("div",{key:"2032f77ca52b330ae2e8f484d7a0aba60ee7b9d5",class:`number__wrapper ${this.autofilled?"number__wrapper--autofilled":""} ${this.name}__input`,ref:i=>this.stylingContainer=i},c.h("div",{key:"0786901cd928bba86597180f058bff43fba522b6",class:"number__wrapper--flex"},c.h("label",{key:"ff7f39306cef7aeba3e0e4508df03c5a945e748b",class:`number__label ${this.validation.mandatory?"number__label--required":""}`,htmlFor:`${this.name}__input`},this.displayName),c.h("div",{key:"dced91223621551472fee374d56f1ad7476f4191",class:"number__wrapper--relative"},this.tooltip&&c.h("img",{key:"a804a983e342e4d117126720a32c4c34a2b267dc",class:"number__tooltip-icon",src:K.tooltipIconSvg,alt:"",ref:i=>this.tooltipIconReference=i,onClick:()=>this.showTooltip=!this.showTooltip}),this.renderTooltip())),c.h("input",{key:"fd59afaedf7d9f761684b057a1809474d735cc26",ref:i=>this.inputReference=i,type:"number",value:this.defaultValue,readOnly:this.autofilled,id:`${this.name}__input`,class:`number__input ${a}`,pattern:this.validationPattern,placeholder:`${this.placeholder}`,required:this.validation.mandatory,max:this.validation.max,min:this.validation.min,onInput:this.handleInput,onBlur:this.handleBlur}),c.h("small",{key:"ca11558b5704b69311626736ab84a298449b98d7",class:"number__error-message"},this.errorMessage))}static get watchers(){return{isValid:["validityChanged"],emitValue:["emitValueHandler"]}}};fi.style=rn;const an="*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.radio__fieldset{border:none;position:relative}.radio__wrapper{display:flex;gap:5px}.radio__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.radio__tooltip-icon{position:absolute;right:0;bottom:10px}.radio__tooltip{position:absolute;bottom:35px;right:10px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.radio__tooltip.visible{opacity:1}",sn=an,mi=class{constructor(a){c.registerInstance(this,a),this.sendInputValue=c.createEvent(this,"sendInputValue"),this.sendValidityState=c.createEvent(this,"sendValidityState"),this.clientStyling="",this.limitStylingAppends=!1,this.showTooltip=!1,this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.prepend(i)}}validityChanged(){this.validityStateHandler({valid:this.isValid,name:this.name}),this.emitValue==!0&&this.valueHandler({name:this.name,value:this.value})}emitValueHandler(a){a==!0&&this.isValid&&this.valueHandler({name:this.name,value:this.value})}valueHandler(a){this.sendInputValue.emit(a)}validityStateHandler(a){this.sendValidityState.emit(a)}handleClickOutside(a){a.composedPath()[0]!==this.tooltipIconReference&&a.composedPath()[0]!==this.tooltipReference&&(this.showTooltip=!1)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}handleClick(a){this.value=a.target.value,this.isValid=this.setValidity(),this.errorMessage=this.setErrorMessage(),this.emitValueHandler(!0)}setValidity(){return this.inputReference.validity.valid}setErrorMessage(){if(this.inputReference.validity.valueMissing)return T.translate("requiredError",this.language)}renderTooltip(){return this.showTooltip?c.h("div",{class:`radio__tooltip ${this.showTooltip?"visible":""}`,ref:a=>this.tooltipReference=a,innerHTML:this.tooltip}):null}render(){return c.h("fieldset",{key:"3d90735f7dc8fef6a96dc85b8f9ba22880cb205f",class:`radio__fieldset ${this.name}__input`,ref:a=>this.stylingContainer=a},c.h("legend",{key:"9472ed76f5c7fabb90d2b3d39eeb9e18f05a30dd",class:"radio__legend"},this.displayName,":"),this.optionsGroup.map(a=>c.h("div",{class:"radio__wrapper"},c.h("input",{type:"radio",class:"radio__input",id:`${a.label}__input`,ref:i=>this.inputReference=i,value:a.value,name:this.name,required:this.validation.mandatory,onClick:i=>this.handleClick(i)}),c.h("label",{htmlFor:`${a.label}__input`},a.label))),c.h("small",{key:"2ae0947580bb8a0a3d889a2d9ebd0b82458fdfd2",class:"radio__error-message"},this.errorMessage),this.tooltip&&c.h("img",{key:"4f3cbf341f1c559bbdf44ca5d169be7a64d46e97",class:"radio__tooltip-icon",src:K.tooltipIconSvg,alt:"",ref:a=>this.tooltipIconReference=a,onClick:()=>this.showTooltip=!this.showTooltip}),this.renderTooltip())}static get watchers(){return{isValid:["validityChanged"],emitValue:["emitValueHandler"]}}};mi.style=sn;const _i=o.i$3`
|
|
1688
|
-
:host {
|
|
1689
|
-
display: flex;
|
|
1690
|
-
align-items: center;
|
|
1691
|
-
box-sizing: border-box;
|
|
1692
|
-
font-family: var(--lumo-font-family);
|
|
1693
|
-
font-size: var(--lumo-font-size-m);
|
|
1694
|
-
line-height: var(--lumo-line-height-xs);
|
|
1695
|
-
padding: 0.5em calc(var(--lumo-space-l) + var(--lumo-border-radius-m) / 4) 0.5em
|
|
1696
|
-
var(--_lumo-list-box-item-padding-left, calc(var(--lumo-border-radius-m) / 4));
|
|
1697
|
-
min-height: var(--lumo-size-m);
|
|
1698
|
-
outline: none;
|
|
1699
|
-
border-radius: var(--lumo-border-radius-m);
|
|
1700
|
-
cursor: var(--lumo-clickable-cursor);
|
|
1701
|
-
-webkit-font-smoothing: antialiased;
|
|
1702
|
-
-moz-osx-font-smoothing: grayscale;
|
|
1703
|
-
-webkit-tap-highlight-color: var(--lumo-primary-color-10pct);
|
|
1704
|
-
--_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
|
|
1705
|
-
--_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
|
|
1706
|
-
--_selection-color-text: var(--vaadin-selection-color-text, var(--lumo-primary-text-color));
|
|
1707
|
-
}
|
|
1708
|
-
|
|
1709
|
-
/* Checkmark */
|
|
1710
|
-
[part='checkmark']::before {
|
|
1711
|
-
display: var(--_lumo-item-selected-icon-display, none);
|
|
1712
|
-
content: var(--lumo-icons-checkmark);
|
|
1713
|
-
font-family: lumo-icons;
|
|
1714
|
-
font-size: var(--lumo-icon-size-m);
|
|
1715
|
-
line-height: 1;
|
|
1716
|
-
font-weight: normal;
|
|
1717
|
-
width: 1em;
|
|
1718
|
-
height: 1em;
|
|
1719
|
-
margin: calc((1 - var(--lumo-line-height-xs)) * var(--lumo-font-size-m) / 2) 0;
|
|
1720
|
-
color: var(--_selection-color-text);
|
|
1721
|
-
flex: none;
|
|
1722
|
-
opacity: 0;
|
|
1723
|
-
transition:
|
|
1724
|
-
transform 0.2s cubic-bezier(0.12, 0.32, 0.54, 2),
|
|
1725
|
-
opacity 0.1s;
|
|
1726
|
-
}
|
|
1727
|
-
|
|
1728
|
-
:host([selected]) [part='checkmark']::before {
|
|
1729
|
-
opacity: 1;
|
|
1730
|
-
}
|
|
1731
|
-
|
|
1732
|
-
:host([active]:not([selected])) [part='checkmark']::before {
|
|
1733
|
-
transform: scale(0.8);
|
|
1734
|
-
opacity: 0;
|
|
1735
|
-
transition-duration: 0s;
|
|
1736
|
-
}
|
|
1737
|
-
|
|
1738
|
-
[part='content'] {
|
|
1739
|
-
flex: auto;
|
|
1740
|
-
}
|
|
1741
|
-
|
|
1742
|
-
/* Disabled */
|
|
1743
|
-
:host([disabled]) {
|
|
1744
|
-
color: var(--lumo-disabled-text-color);
|
|
1745
|
-
cursor: default;
|
|
1746
|
-
pointer-events: none;
|
|
1747
|
-
}
|
|
1748
|
-
|
|
1749
|
-
/* TODO a workaround until we have "focus-follows-mouse". After that, use the hover style for focus-ring as well */
|
|
1750
|
-
@media (any-hover: hover) {
|
|
1751
|
-
:host(:hover:not([disabled])) {
|
|
1752
|
-
background-color: var(--lumo-primary-color-10pct);
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
|
-
:host([focus-ring]:not([disabled])) {
|
|
1757
|
-
box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
|
|
1758
|
-
}
|
|
1759
|
-
|
|
1760
|
-
/* RTL specific styles */
|
|
1761
|
-
:host([dir='rtl']) {
|
|
1762
|
-
padding-left: calc(var(--lumo-space-l) + var(--lumo-border-radius-m) / 4);
|
|
1763
|
-
padding-right: var(--_lumo-list-box-item-padding-left, calc(var(--lumo-border-radius-m) / 4));
|
|
1764
|
-
}
|
|
1765
|
-
|
|
1766
|
-
/* Slotted icons */
|
|
1767
|
-
:host ::slotted(vaadin-icon) {
|
|
1768
|
-
width: var(--lumo-icon-size-m);
|
|
1769
|
-
height: var(--lumo-icon-size-m);
|
|
1770
|
-
}
|
|
1771
|
-
`;o.registerStyles("vaadin-item",_i,{moduleId:"lumo-item"});const nn=o.i$3`
|
|
1772
|
-
:host {
|
|
1773
|
-
transition: background-color 100ms;
|
|
1774
|
-
overflow: hidden;
|
|
1775
|
-
--_lumo-item-selected-icon-display: block;
|
|
1776
|
-
--_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
|
|
1777
|
-
--_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
|
|
1778
|
-
}
|
|
1779
|
-
|
|
1780
|
-
:host([focused]:not([disabled])) {
|
|
1781
|
-
box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
|
|
1782
|
-
}
|
|
1783
|
-
`;o.registerStyles("vaadin-combo-box-item",[_i,nn],{moduleId:"lumo-combo-box-item"});/**
|
|
1784
|
-
* @license
|
|
1785
|
-
* Copyright (c) 2022 - 2024 Vaadin Ltd.
|
|
1786
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1787
|
-
*/const on=o.i$3`
|
|
1788
|
-
[part~='loader'] {
|
|
1789
|
-
box-sizing: border-box;
|
|
1790
|
-
width: var(--lumo-icon-size-s);
|
|
1791
|
-
height: var(--lumo-icon-size-s);
|
|
1792
|
-
border: 2px solid transparent;
|
|
1793
|
-
border-color: var(--lumo-primary-color-10pct) var(--lumo-primary-color-10pct) var(--lumo-primary-color)
|
|
1794
|
-
var(--lumo-primary-color);
|
|
1795
|
-
border-radius: calc(0.5 * var(--lumo-icon-size-s));
|
|
1796
|
-
opacity: 0;
|
|
1797
|
-
pointer-events: none;
|
|
1798
|
-
}
|
|
1799
|
-
|
|
1800
|
-
:host(:not([loading])) [part~='loader'] {
|
|
1801
|
-
display: none;
|
|
1802
|
-
}
|
|
1803
|
-
|
|
1804
|
-
:host([loading]) [part~='loader'] {
|
|
1805
|
-
animation:
|
|
1806
|
-
1s linear infinite lumo-loader-rotate,
|
|
1807
|
-
0.3s 0.1s lumo-loader-fade-in both;
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
@keyframes lumo-loader-fade-in {
|
|
1811
|
-
0% {
|
|
1812
|
-
opacity: 0;
|
|
1813
|
-
}
|
|
1814
|
-
|
|
1815
|
-
100% {
|
|
1816
|
-
opacity: 1;
|
|
1817
|
-
}
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
@keyframes lumo-loader-rotate {
|
|
1821
|
-
0% {
|
|
1822
|
-
transform: rotate(0deg);
|
|
1823
|
-
}
|
|
1824
|
-
|
|
1825
|
-
100% {
|
|
1826
|
-
transform: rotate(360deg);
|
|
1827
|
-
}
|
|
1828
|
-
}
|
|
1829
|
-
`,ln=o.i$3`
|
|
1830
|
-
[part='content'] {
|
|
1831
|
-
padding: 0;
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
/* When items are empty, the spinner needs some room */
|
|
1835
|
-
:host(:not([closing])) [part~='content'] {
|
|
1836
|
-
min-height: calc(2 * var(--lumo-space-s) + var(--lumo-icon-size-s));
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1839
|
-
[part~='overlay'] {
|
|
1840
|
-
position: relative;
|
|
1841
|
-
}
|
|
1842
|
-
|
|
1843
|
-
:host([top-aligned]) [part~='overlay'] {
|
|
1844
|
-
margin-top: var(--lumo-space-xs);
|
|
1845
|
-
}
|
|
1846
|
-
|
|
1847
|
-
:host([bottom-aligned]) [part~='overlay'] {
|
|
1848
|
-
margin-bottom: var(--lumo-space-xs);
|
|
1849
|
-
}
|
|
1850
|
-
`,dn=o.i$3`
|
|
1851
|
-
[part~='loader'] {
|
|
1852
|
-
position: absolute;
|
|
1853
|
-
z-index: 1;
|
|
1854
|
-
inset-inline: var(--lumo-space-s);
|
|
1855
|
-
top: var(--lumo-space-s);
|
|
1856
|
-
margin-inline: auto 0;
|
|
1857
|
-
}
|
|
1858
|
-
`;o.registerStyles("vaadin-combo-box-overlay",[Ge,Ke,ln,on,dn,o.i$3`
|
|
1859
|
-
:host {
|
|
1860
|
-
--_vaadin-combo-box-items-container-border-width: var(--lumo-space-xs);
|
|
1861
|
-
--_vaadin-combo-box-items-container-border-style: solid;
|
|
1862
|
-
}
|
|
1863
|
-
`],{moduleId:"lumo-combo-box-overlay"});const hn=o.i$3`
|
|
1864
|
-
[part='toggle-button']::before {
|
|
1865
|
-
content: var(--lumo-icons-dropdown);
|
|
1866
|
-
}
|
|
1867
|
-
`;o.registerStyles("vaadin-combo-box",[o.inputFieldShared$1,hn],{moduleId:"lumo-combo-box"});/**
|
|
1868
|
-
* @license
|
|
1869
|
-
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
1870
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1871
|
-
*/const cn=a=>class extends a{static get properties(){return{index:{type:Number},item:{type:Object},label:{type:String},selected:{type:Boolean,value:!1,reflectToAttribute:!0},focused:{type:Boolean,value:!1,reflectToAttribute:!0},renderer:{type:Function}}}static get observers(){return["__rendererOrItemChanged(renderer, index, item, selected, focused)","__updateLabel(label, renderer)"]}static get observedAttributes(){return[...super.observedAttributes,"hidden"]}attributeChangedCallback(e,t,r){e==="hidden"&&r!==null?this.index=void 0:super.attributeChangedCallback(e,t,r)}connectedCallback(){super.connectedCallback(),this._owner=this.parentNode.owner;const e=this._owner.getAttribute("dir");e&&this.setAttribute("dir",e)}requestContentUpdate(){if(!this.renderer||this.hidden)return;const e={index:this.index,item:this.item,focused:this.focused,selected:this.selected};this.renderer(this,this._owner,e)}__rendererOrItemChanged(e,t,r){r===void 0||t===void 0||(this._oldRenderer!==e&&(this.innerHTML="",delete this._$litPart$),e&&(this._oldRenderer=e,this.requestContentUpdate()))}__updateLabel(e,t){t||(this.textContent=e)}};/**
|
|
1872
|
-
* @license
|
|
1873
|
-
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
1874
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1875
|
-
*/class un extends cn(o.ThemableMixin(o.DirMixin(o.PolymerElement))){static get template(){return o.html`
|
|
1876
|
-
<style>
|
|
1877
|
-
:host {
|
|
1878
|
-
display: block;
|
|
1879
|
-
}
|
|
1880
|
-
|
|
1881
|
-
:host([hidden]) {
|
|
1882
|
-
display: none;
|
|
1883
|
-
}
|
|
1884
|
-
</style>
|
|
1885
|
-
<span part="checkmark" aria-hidden="true"></span>
|
|
1886
|
-
<div part="content">
|
|
1887
|
-
<slot></slot>
|
|
1888
|
-
</div>
|
|
1889
|
-
`}static get is(){return"vaadin-combo-box-item"}}o.defineCustomElement(un);/**
|
|
1890
|
-
* @license
|
|
1891
|
-
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
1892
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1893
|
-
*/const pn=a=>class extends $t(a){static get observers(){return["_setOverlayWidth(positionTarget, opened)"]}constructor(){super(),this.requiredVerticalSpace=200}connectedCallback(){super.connectedCallback();const e=this._comboBox,t=e&&e.getAttribute("dir");t&&this.setAttribute("dir",t)}_shouldCloseOnOutsideClick(e){const t=e.composedPath();return!t.includes(this.positionTarget)&&!t.includes(this)}_mouseDownListener(e){super._mouseDownListener(e),this._shouldCloseOnOutsideClick(e)&&!o.isElementFocusable(e.composedPath()[0])&&e.preventDefault()}_updateOverlayWidth(){const e=this.localName;this.style.setProperty(`--_${e}-default-width`,`${this.positionTarget.clientWidth}px`);const t=getComputedStyle(this._comboBox).getPropertyValue(`--${e}-width`);t===""?this.style.removeProperty(`--${e}-width`):this.style.setProperty(`--${e}-width`,t)}_setOverlayWidth(e,t){e&&t&&(this._updateOverlayWidth(),this._updatePosition())}};/**
|
|
1894
|
-
* @license
|
|
1895
|
-
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
1896
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1897
|
-
*/const fn=o.i$3`
|
|
1898
|
-
#overlay {
|
|
1899
|
-
width: var(--vaadin-combo-box-overlay-width, var(--_vaadin-combo-box-overlay-default-width, auto));
|
|
1900
|
-
}
|
|
1901
|
-
|
|
1902
|
-
[part='content'] {
|
|
1903
|
-
display: flex;
|
|
1904
|
-
flex-direction: column;
|
|
1905
|
-
height: 100%;
|
|
1906
|
-
}
|
|
1907
|
-
`;o.registerStyles("vaadin-combo-box-overlay",[Vt,fn],{moduleId:"vaadin-combo-box-overlay-styles"});class mn extends pn(Rt(o.DirMixin(o.ThemableMixin(o.PolymerElement)))){static get is(){return"vaadin-combo-box-overlay"}static get template(){return o.html`
|
|
1908
|
-
<div id="backdrop" part="backdrop" hidden></div>
|
|
1909
|
-
<div part="overlay" id="overlay">
|
|
1910
|
-
<div part="loader"></div>
|
|
1911
|
-
<div part="content" id="content"><slot></slot></div>
|
|
1912
|
-
</div>
|
|
1913
|
-
`}}o.defineCustomElement(mn);/**
|
|
1914
|
-
* @license
|
|
1915
|
-
* Copyright (c) 2023 - 2024 Vaadin Ltd.
|
|
1916
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1917
|
-
*/function Ie(a,i){return a.split(".").reduce((e,t)=>e?e[t]:void 0,i)}/**
|
|
1918
|
-
* @license
|
|
1919
|
-
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
1920
|
-
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
1921
|
-
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
1922
|
-
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
1923
|
-
* Code distributed by Google as part of the polymer project is also
|
|
1924
|
-
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1925
|
-
*/const Dt=navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/u),_n=Dt&&Dt[1]>=8,It=3,vn={_ratio:.5,_scrollerPaddingTop:0,_scrollPosition:0,_physicalSize:0,_physicalAverage:0,_physicalAverageCount:0,_physicalTop:0,_virtualCount:0,_estScrollHeight:0,_scrollHeight:0,_viewportHeight:0,_viewportWidth:0,_physicalItems:null,_physicalSizes:null,_firstVisibleIndexVal:null,_lastVisibleIndexVal:null,_maxPages:2,_templateCost:0,get _physicalBottom(){return this._physicalTop+this._physicalSize},get _scrollBottom(){return this._scrollPosition+this._viewportHeight},get _virtualEnd(){return this._virtualStart+this._physicalCount-1},get _hiddenContentSize(){return this._physicalSize-this._viewportHeight},get _maxScrollTop(){return this._estScrollHeight-this._viewportHeight+this._scrollOffset},get _maxVirtualStart(){const a=this._virtualCount;return Math.max(0,a-this._physicalCount)},get _virtualStart(){return this._virtualStartVal||0},set _virtualStart(a){a=this._clamp(a,0,this._maxVirtualStart),this._virtualStartVal=a},get _physicalStart(){return this._physicalStartVal||0},set _physicalStart(a){a%=this._physicalCount,a<0&&(a=this._physicalCount+a),this._physicalStartVal=a},get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount},get _physicalCount(){return this._physicalCountVal||0},set _physicalCount(a){this._physicalCountVal=a},get _optPhysicalSize(){return this._viewportHeight===0?1/0:this._viewportHeight*this._maxPages},get _isVisible(){return!!(this.offsetWidth||this.offsetHeight)},get firstVisibleIndex(){let a=this._firstVisibleIndexVal;if(a==null){let i=this._physicalTop+this._scrollOffset;a=this._iterateItems((e,t)=>{if(i+=this._getPhysicalSizeIncrement(e),i>this._scrollPosition)return t})||0,this._firstVisibleIndexVal=a}return a},get lastVisibleIndex(){let a=this._lastVisibleIndexVal;if(a==null){let i=this._physicalTop+this._scrollOffset;this._iterateItems((e,t)=>{i<this._scrollBottom&&(a=t),i+=this._getPhysicalSizeIncrement(e)}),this._lastVisibleIndexVal=a}return a},get _scrollOffset(){return this._scrollerPaddingTop+this.scrollOffset},_scrollHandler(){const a=Math.max(0,Math.min(this._maxScrollTop,this._scrollTop));let i=a-this._scrollPosition;const e=i>=0;if(this._scrollPosition=a,this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,Math.abs(i)>this._physicalSize&&this._physicalSize>0){i-=this._scrollOffset;const t=Math.round(i/this._physicalAverage);this._virtualStart+=t,this._physicalStart+=t,this._physicalTop=Math.min(Math.floor(this._virtualStart)*this._physicalAverage,this._scrollPosition),this._update()}else if(this._physicalCount>0){const t=this._getReusables(e);e?(this._physicalTop=t.physicalTop,this._virtualStart+=t.indexes.length,this._physicalStart+=t.indexes.length):(this._virtualStart-=t.indexes.length,this._physicalStart-=t.indexes.length),this._update(t.indexes,e?null:t.indexes),this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,0),o.microTask)}},_getReusables(a){let i,e,t;const r=[],s=this._hiddenContentSize*this._ratio,n=this._virtualStart,l=this._virtualEnd,d=this._physicalCount;let h=this._physicalTop+this._scrollOffset;const m=this._physicalBottom+this._scrollOffset,u=this._scrollPosition,v=this._scrollBottom;for(a?(i=this._physicalStart,e=u-h):(i=this._physicalEnd,e=m-v);t=this._getPhysicalSizeIncrement(i),e-=t,!(r.length>=d||e<=s);)if(a){if(l+r.length+1>=this._virtualCount||h+t>=u-this._scrollOffset)break;r.push(i),h+=t,i=(i+1)%d}else{if(n-r.length<=0||h+this._physicalSize-t<=v)break;r.push(i),h-=t,i=i===0?d-1:i-1}return{indexes:r,physicalTop:h-this._scrollOffset}},_update(a,i){if(!(a&&a.length===0||this._physicalCount===0)){if(this._assignModels(a),this._updateMetrics(a),i)for(;i.length;){const e=i.pop();this._physicalTop-=this._getPhysicalSizeIncrement(e)}this._positionItems(),this._updateScrollerSize()}},_isClientFull(){return this._scrollBottom!==0&&this._physicalBottom-1>=this._scrollBottom&&this._physicalTop<=this._scrollPosition},_increasePoolIfNeeded(a){const e=this._clamp(this._physicalCount+a,It,this._virtualCount-this._virtualStart)-this._physicalCount;let t=Math.round(this._physicalCount*.5);if(!(e<0)){if(e>0){const r=window.performance.now();[].push.apply(this._physicalItems,this._createPool(e));for(let s=0;s<e;s++)this._physicalSizes.push(0);this._physicalCount+=e,this._physicalStart>this._physicalEnd&&this._isIndexRendered(this._focusedVirtualIndex)&&this._getPhysicalIndex(this._focusedVirtualIndex)<this._physicalEnd&&(this._physicalStart+=e),this._update(),this._templateCost=(window.performance.now()-r)/e,t=Math.round(this._physicalCount*.5)}this._virtualEnd>=this._virtualCount-1||t===0||(this._isClientFull()?this._physicalSize<this._optPhysicalSize&&this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,this._clamp(Math.round(50/this._templateCost),1,t)),o.idlePeriod):this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,t),o.microTask))}},_render(){if(!(!this.isAttached||!this._isVisible))if(this._physicalCount!==0){const a=this._getReusables(!0);this._physicalTop=a.physicalTop,this._virtualStart+=a.indexes.length,this._physicalStart+=a.indexes.length,this._update(a.indexes),this._update(),this._increasePoolIfNeeded(0)}else this._virtualCount>0&&(this.updateViewportBoundaries(),this._increasePoolIfNeeded(It))},_itemsChanged(a){a.path==="items"&&(this._virtualStart=0,this._physicalTop=0,this._virtualCount=this.items?this.items.length:0,this._physicalIndexForKey={},this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,this._physicalItems||(this._physicalItems=[]),this._physicalSizes||(this._physicalSizes=[]),this._physicalStart=0,this._scrollTop>this._scrollOffset&&this._resetScrollPosition(0),this._debounce("_render",this._render,o.animationFrame))},_iterateItems(a,i){let e,t,r,s;if(arguments.length===2&&i){for(s=0;s<i.length;s++)if(e=i[s],t=this._computeVidx(e),(r=a.call(this,e,t))!=null)return r}else{for(e=this._physicalStart,t=this._virtualStart;e<this._physicalCount;e++,t++)if((r=a.call(this,e,t))!=null)return r;for(e=0;e<this._physicalStart;e++,t++)if((r=a.call(this,e,t))!=null)return r}},_computeVidx(a){return a>=this._physicalStart?this._virtualStart+(a-this._physicalStart):this._virtualStart+(this._physicalCount-this._physicalStart)+a},_positionItems(){this._adjustScrollPosition();let a=this._physicalTop;this._iterateItems(i=>{this.translate3d(0,`${a}px`,0,this._physicalItems[i]),a+=this._physicalSizes[i]})},_getPhysicalSizeIncrement(a){return this._physicalSizes[a]},_adjustScrollPosition(){const a=this._virtualStart===0?this._physicalTop:Math.min(this._scrollPosition+this._physicalTop,0);if(a!==0){this._physicalTop-=a;const i=this._scrollPosition;!_n&&i>0&&this._resetScrollPosition(i-a)}},_resetScrollPosition(a){this.scrollTarget&&a>=0&&(this._scrollTop=a,this._scrollPosition=this._scrollTop)},_updateScrollerSize(a){const i=this._physicalBottom+Math.max(this._virtualCount-this._physicalCount-this._virtualStart,0)*this._physicalAverage;this._estScrollHeight=i,(a||this._scrollHeight===0||this._scrollPosition>=i-this._physicalSize||Math.abs(i-this._scrollHeight)>=this._viewportHeight)&&(this.$.items.style.height=`${i}px`,this._scrollHeight=i)},scrollToIndex(a){if(typeof a!="number"||a<0||a>this.items.length-1||(o.flush(),this._physicalCount===0))return;a=this._clamp(a,0,this._virtualCount-1),(!this._isIndexRendered(a)||a>=this._maxVirtualStart)&&(this._virtualStart=a-1),this._assignModels(),this._updateMetrics(),this._physicalTop=this._virtualStart*this._physicalAverage;let i=this._physicalStart,e=this._virtualStart,t=0;const r=this._hiddenContentSize;for(;e<a&&t<=r;)t+=this._getPhysicalSizeIncrement(i),i=(i+1)%this._physicalCount,e+=1;this._updateScrollerSize(!0),this._positionItems(),this._resetScrollPosition(this._physicalTop+this._scrollOffset+t),this._increasePoolIfNeeded(0),this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null},_resetAverage(){this._physicalAverage=0,this._physicalAverageCount=0},_resizeHandler(){this._debounce("_render",()=>{this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,this._isVisible?(this.updateViewportBoundaries(),this.toggleScrollListener(!0),this._resetAverage(),this._render()):this.toggleScrollListener(!1)},o.animationFrame)},_isIndexRendered(a){return a>=this._virtualStart&&a<=this._virtualEnd},_getPhysicalIndex(a){return(this._physicalStart+(a-this._virtualStart))%this._physicalCount},_clamp(a,i,e){return Math.min(e,Math.max(i,a))},_debounce(a,i,e){this._debouncers||(this._debouncers={}),this._debouncers[a]=o.Debouncer.debounce(this._debouncers[a],e,i.bind(this)),o.enqueueDebouncer(this._debouncers[a])}};/**
|
|
1926
|
-
* @license
|
|
1927
|
-
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1928
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1929
|
-
*/const gn=1e5,$e=1e3;class vi{constructor({createElements:i,updateElement:e,scrollTarget:t,scrollContainer:r,elementsContainer:s,reorderElements:n}){this.isAttached=!0,this._vidxOffset=0,this.createElements=i,this.updateElement=e,this.scrollTarget=t,this.scrollContainer=r,this.elementsContainer=s||r,this.reorderElements=n,this._maxPages=1.3,this.__placeholderHeight=200,this.__elementHeightQueue=Array(10),this.timeouts={SCROLL_REORDER:500,IGNORE_WHEEL:500,FIX_INVALID_ITEM_POSITIONING:100},this.__resizeObserver=new ResizeObserver(()=>this._resizeHandler()),getComputedStyle(this.scrollTarget).overflow==="visible"&&(this.scrollTarget.style.overflow="auto"),getComputedStyle(this.scrollContainer).position==="static"&&(this.scrollContainer.style.position="relative"),this.__resizeObserver.observe(this.scrollTarget),this.scrollTarget.addEventListener("scroll",()=>this._scrollHandler()),this._scrollLineHeight=this._getScrollLineHeight(),this.scrollTarget.addEventListener("wheel",l=>this.__onWheel(l)),this.scrollTarget.addEventListener("virtualizer-element-focused",l=>this.__onElementFocused(l)),this.elementsContainer.addEventListener("focusin",()=>{this.scrollTarget.dispatchEvent(new CustomEvent("virtualizer-element-focused",{detail:{element:this.__getFocusedElement()}}))}),this.reorderElements&&(this.scrollTarget.addEventListener("mousedown",()=>{this.__mouseDown=!0}),this.scrollTarget.addEventListener("mouseup",()=>{this.__mouseDown=!1,this.__pendingReorder&&this.__reorderElements()}))}get scrollOffset(){return 0}get adjustedFirstVisibleIndex(){return this.firstVisibleIndex+this._vidxOffset}get adjustedLastVisibleIndex(){return this.lastVisibleIndex+this._vidxOffset}get _maxVirtualIndexOffset(){return this.size-this._virtualCount}__hasPlaceholders(){return this.__getVisibleElements().some(i=>i.__virtualizerPlaceholder)}scrollToIndex(i){if(typeof i!="number"||isNaN(i)||this.size===0||!this.scrollTarget.offsetHeight)return;delete this.__pendingScrollToIndex,this._physicalCount<=3&&this.flush(),i=this._clamp(i,0,this.size-1);const e=this.__getVisibleElements().length;let t=Math.floor(i/this.size*this._virtualCount);this._virtualCount-t<e?(t=this._virtualCount-(this.size-i),this._vidxOffset=this._maxVirtualIndexOffset):t<e?i<$e?(t=i,this._vidxOffset=0):(t=$e,this._vidxOffset=i-t):this._vidxOffset=i-t,this.__skipNextVirtualIndexAdjust=!0,super.scrollToIndex(t),this.adjustedFirstVisibleIndex!==i&&this._scrollTop<this._maxScrollTop&&!this.grid&&(this._scrollTop-=this.__getIndexScrollOffset(i)||0),this._scrollHandler(),this.__hasPlaceholders()&&(this.__pendingScrollToIndex=i)}flush(){this.scrollTarget.offsetHeight!==0&&(this._resizeHandler(),o.flush(),this._scrollHandler(),this.__fixInvalidItemPositioningDebouncer&&this.__fixInvalidItemPositioningDebouncer.flush(),this.__scrollReorderDebouncer&&this.__scrollReorderDebouncer.flush(),this.__debouncerWheelAnimationFrame&&this.__debouncerWheelAnimationFrame.flush())}update(i=0,e=this.size-1){const t=[];this.__getVisibleElements().forEach(r=>{r.__virtualIndex>=i&&r.__virtualIndex<=e&&(this.__updateElement(r,r.__virtualIndex,!0),t.push(r))}),this.__afterElementsUpdated(t)}_updateMetrics(i){o.flush();let e=0,t=0;const r=this._physicalAverageCount,s=this._physicalAverage;this._iterateItems((n,l)=>{t+=this._physicalSizes[n],this._physicalSizes[n]=Math.ceil(this.__getBorderBoxHeight(this._physicalItems[n])),e+=this._physicalSizes[n],this._physicalAverageCount+=this._physicalSizes[n]?1:0},i),this._physicalSize=this._physicalSize+e-t,this._physicalAverageCount!==r&&(this._physicalAverage=Math.round((s*r+e)/this._physicalAverageCount))}__getBorderBoxHeight(i){const e=getComputedStyle(i),t=parseFloat(e.height)||0;if(e.boxSizing==="border-box")return t;const r=parseFloat(e.paddingBottom)||0,s=parseFloat(e.paddingTop)||0,n=parseFloat(e.borderBottomWidth)||0,l=parseFloat(e.borderTopWidth)||0;return t+r+s+n+l}__updateElement(i,e,t){i.__virtualizerPlaceholder&&(i.style.paddingTop="",i.style.opacity="",i.__virtualizerPlaceholder=!1),!this.__preventElementUpdates&&(i.__lastUpdatedIndex!==e||t)&&(this.updateElement(i,e),i.__lastUpdatedIndex=e)}__afterElementsUpdated(i){i.forEach(e=>{const t=e.offsetHeight;if(t===0)e.style.paddingTop=`${this.__placeholderHeight}px`,e.style.opacity="0",e.__virtualizerPlaceholder=!0,this.__placeholderClearDebouncer=o.Debouncer.debounce(this.__placeholderClearDebouncer,o.animationFrame,()=>this._resizeHandler());else{this.__elementHeightQueue.push(t),this.__elementHeightQueue.shift();const r=this.__elementHeightQueue.filter(s=>s!==void 0);this.__placeholderHeight=Math.round(r.reduce((s,n)=>s+n,0)/r.length)}}),this.__pendingScrollToIndex!==void 0&&!this.__hasPlaceholders()&&this.scrollToIndex(this.__pendingScrollToIndex)}__getIndexScrollOffset(i){const e=this.__getVisibleElements().find(t=>t.__virtualIndex===i);return e?this.scrollTarget.getBoundingClientRect().top-e.getBoundingClientRect().top:void 0}get size(){return this.__size}set size(i){if(i===this.size)return;this.__fixInvalidItemPositioningDebouncer&&this.__fixInvalidItemPositioningDebouncer.cancel(),this._debouncers&&this._debouncers._increasePoolIfNeeded&&this._debouncers._increasePoolIfNeeded.cancel(),this.__preventElementUpdates=!0;let e,t;if(i>0&&(e=this.adjustedFirstVisibleIndex,t=this.__getIndexScrollOffset(e)),this.__size=i,this._itemsChanged({path:"items"}),o.flush(),i>0){e=Math.min(e,i-1),this.scrollToIndex(e);const r=this.__getIndexScrollOffset(e);t!==void 0&&r!==void 0&&(this._scrollTop+=t-r)}this.__preventElementUpdates=!1,this._isVisible||this._assignModels(),this.elementsContainer.children.length||requestAnimationFrame(()=>this._resizeHandler()),this._resizeHandler(),o.flush(),this._debounce("_update",this._update,o.microTask)}get _scrollTop(){return this.scrollTarget.scrollTop}set _scrollTop(i){this.scrollTarget.scrollTop=i}get items(){return{length:Math.min(this.size,gn)}}get offsetHeight(){return this.scrollTarget.offsetHeight}get $(){return{items:this.scrollContainer}}updateViewportBoundaries(){const i=window.getComputedStyle(this.scrollTarget);this._scrollerPaddingTop=this.scrollTarget===this?0:parseInt(i["padding-top"],10),this._isRTL=i.direction==="rtl",this._viewportWidth=this.elementsContainer.offsetWidth,this._viewportHeight=this.scrollTarget.offsetHeight,this._scrollPageHeight=this._viewportHeight-this._scrollLineHeight,this.grid&&this._updateGridMetrics()}setAttribute(){}_createPool(i){const e=this.createElements(i),t=document.createDocumentFragment();return e.forEach(r=>{r.style.position="absolute",t.appendChild(r),this.__resizeObserver.observe(r)}),this.elementsContainer.appendChild(t),e}_assignModels(i){const e=[];this._iterateItems((t,r)=>{const s=this._physicalItems[t];s.hidden=r>=this.size,s.hidden?delete s.__lastUpdatedIndex:(s.__virtualIndex=r+(this._vidxOffset||0),this.__updateElement(s,s.__virtualIndex),e.push(s))},i),this.__afterElementsUpdated(e)}_isClientFull(){return setTimeout(()=>{this.__clientFull=!0}),this.__clientFull||super._isClientFull()}translate3d(i,e,t,r){r.style.transform=`translateY(${e})`}toggleScrollListener(){}__getFocusedElement(i=this.__getVisibleElements()){return i.find(e=>e.contains(this.elementsContainer.getRootNode().activeElement)||e.contains(this.scrollTarget.getRootNode().activeElement))}__nextFocusableSiblingMissing(i,e){return e.indexOf(i)===e.length-1&&this.size>i.__virtualIndex+1}__previousFocusableSiblingMissing(i,e){return e.indexOf(i)===0&&i.__virtualIndex>0}__onElementFocused(i){if(!this.reorderElements)return;const e=i.detail.element;if(!e)return;const t=this.__getVisibleElements();(this.__previousFocusableSiblingMissing(e,t)||this.__nextFocusableSiblingMissing(e,t))&&this.flush();const r=this.__getVisibleElements();this.__nextFocusableSiblingMissing(e,r)?(this._scrollTop+=Math.ceil(e.getBoundingClientRect().bottom)-Math.floor(this.scrollTarget.getBoundingClientRect().bottom-1),this.flush()):this.__previousFocusableSiblingMissing(e,r)&&(this._scrollTop-=Math.ceil(this.scrollTarget.getBoundingClientRect().top+1)-Math.floor(e.getBoundingClientRect().top),this.flush())}_scrollHandler(){if(this.scrollTarget.offsetHeight===0)return;this._adjustVirtualIndexOffset(this._scrollTop-(this.__previousScrollTop||0));const i=this.scrollTarget.scrollTop-this._scrollPosition;if(super._scrollHandler(),this._physicalCount!==0){const e=i>=0,t=this._getReusables(!e);t.indexes.length&&(this._physicalTop=t.physicalTop,e?(this._virtualStart-=t.indexes.length,this._physicalStart-=t.indexes.length):(this._virtualStart+=t.indexes.length,this._physicalStart+=t.indexes.length),this._resizeHandler())}i&&(this.__fixInvalidItemPositioningDebouncer=o.Debouncer.debounce(this.__fixInvalidItemPositioningDebouncer,o.timeOut.after(this.timeouts.FIX_INVALID_ITEM_POSITIONING),()=>this.__fixInvalidItemPositioning())),this.reorderElements&&(this.__scrollReorderDebouncer=o.Debouncer.debounce(this.__scrollReorderDebouncer,o.timeOut.after(this.timeouts.SCROLL_REORDER),()=>this.__reorderElements())),this.__previousScrollTop=this._scrollTop,this._scrollTop===0&&this.firstVisibleIndex!==0&&Math.abs(i)>0&&this.scrollToIndex(0)}__fixInvalidItemPositioning(){if(!this.scrollTarget.isConnected)return;const i=this._physicalTop>this._scrollTop,e=this._physicalBottom<this._scrollBottom,t=this.adjustedFirstVisibleIndex===0,r=this.adjustedLastVisibleIndex===this.size-1;if(i&&!t||e&&!r){const s=e,n=this._ratio;this._ratio=0,this._scrollPosition=this._scrollTop+(s?-1:1),this._scrollHandler(),this._ratio=n}}__onWheel(i){if(i.ctrlKey||this._hasScrolledAncestor(i.target,i.deltaX,i.deltaY))return;let e=i.deltaY;if(i.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._scrollLineHeight:i.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._scrollPageHeight),this._deltaYAcc||(this._deltaYAcc=0),this._wheelAnimationFrame){this._deltaYAcc+=e,i.preventDefault();return}e+=this._deltaYAcc,this._deltaYAcc=0,this._wheelAnimationFrame=!0,this.__debouncerWheelAnimationFrame=o.Debouncer.debounce(this.__debouncerWheelAnimationFrame,o.animationFrame,()=>{this._wheelAnimationFrame=!1});const t=Math.abs(i.deltaX)+Math.abs(e);this._canScroll(this.scrollTarget,i.deltaX,e)?(i.preventDefault(),this.scrollTarget.scrollTop+=e,this.scrollTarget.scrollLeft+=i.deltaX,this._hasResidualMomentum=!0,this._ignoreNewWheel=!0,this._debouncerIgnoreNewWheel=o.Debouncer.debounce(this._debouncerIgnoreNewWheel,o.timeOut.after(this.timeouts.IGNORE_WHEEL),()=>{this._ignoreNewWheel=!1})):this._hasResidualMomentum&&t<=this._previousMomentum||this._ignoreNewWheel?i.preventDefault():t>this._previousMomentum&&(this._hasResidualMomentum=!1),this._previousMomentum=t}_hasScrolledAncestor(i,e,t){if(i===this.scrollTarget||i===this.scrollTarget.getRootNode().host)return!1;if(this._canScroll(i,e,t)&&["auto","scroll"].indexOf(getComputedStyle(i).overflow)!==-1)return!0;if(i!==this&&i.parentElement)return this._hasScrolledAncestor(i.parentElement,e,t)}_canScroll(i,e,t){return t>0&&i.scrollTop<i.scrollHeight-i.offsetHeight||t<0&&i.scrollTop>0||e>0&&i.scrollLeft<i.scrollWidth-i.offsetWidth||e<0&&i.scrollLeft>0}_increasePoolIfNeeded(i){if(this._physicalCount>2&&i){const t=Math.ceil(this._optPhysicalSize/this._physicalAverage)-this._physicalCount;super._increasePoolIfNeeded(Math.max(i,Math.min(100,t)))}else super._increasePoolIfNeeded(i)}get _optPhysicalSize(){const i=super._optPhysicalSize;return i<=0||this.__hasPlaceholders()?i:i+this.__getItemHeightBuffer()}__getItemHeightBuffer(){if(this._physicalCount===0)return 0;const i=Math.ceil(this._viewportHeight*(this._maxPages-1)/2),e=Math.max(...this._physicalSizes);return e>Math.min(...this._physicalSizes)?Math.max(0,e-i):0}_getScrollLineHeight(){const i=document.createElement("div");i.style.fontSize="initial",i.style.display="none",document.body.appendChild(i);const e=window.getComputedStyle(i).fontSize;return document.body.removeChild(i),e?window.parseInt(e):void 0}__getVisibleElements(){return Array.from(this.elementsContainer.children).filter(i=>!i.hidden)}__reorderElements(){if(this.__mouseDown){this.__pendingReorder=!0;return}this.__pendingReorder=!1;const i=this._virtualStart+(this._vidxOffset||0),e=this.__getVisibleElements(),t=this.__getFocusedElement(e)||e[0];if(!t)return;const r=t.__virtualIndex-i,s=e.indexOf(t)-r;if(s>0)for(let n=0;n<s;n++)this.elementsContainer.appendChild(e[n]);else if(s<0)for(let n=e.length+s;n<e.length;n++)this.elementsContainer.insertBefore(e[n],e[0]);if(o.isSafari){const{transform:n}=this.scrollTarget.style;this.scrollTarget.style.transform="translateZ(0)",setTimeout(()=>{this.scrollTarget.style.transform=n})}}_adjustVirtualIndexOffset(i){const e=this._maxVirtualIndexOffset;if(this._virtualCount>=this.size)this._vidxOffset=0;else if(this.__skipNextVirtualIndexAdjust)this.__skipNextVirtualIndexAdjust=!1;else if(Math.abs(i)>1e4){const t=this._scrollTop/(this.scrollTarget.scrollHeight-this.scrollTarget.clientHeight);this._vidxOffset=Math.round(t*e)}else{const t=this._vidxOffset,r=$e,s=100;this._scrollTop===0?(this._vidxOffset=0,t!==this._vidxOffset&&super.scrollToIndex(0)):this.firstVisibleIndex<r&&this._vidxOffset>0&&(this._vidxOffset-=Math.min(this._vidxOffset,s),super.scrollToIndex(this.firstVisibleIndex+(t-this._vidxOffset))),this._scrollTop>=this._maxScrollTop&&this._maxScrollTop>0?(this._vidxOffset=e,t!==this._vidxOffset&&super.scrollToIndex(this._virtualCount-1)):this.firstVisibleIndex>this._virtualCount-r&&this._vidxOffset<e&&(this._vidxOffset+=Math.min(e-this._vidxOffset,s),super.scrollToIndex(this.firstVisibleIndex-(this._vidxOffset-t)))}}}Object.setPrototypeOf(vi.prototype,vn);class bn{constructor(i){this.__adapter=new vi(i)}get firstVisibleIndex(){return this.__adapter.adjustedFirstVisibleIndex}get lastVisibleIndex(){return this.__adapter.adjustedLastVisibleIndex}get size(){return this.__adapter.size}set size(i){this.__adapter.size=i}scrollToIndex(i){this.__adapter.scrollToIndex(i)}update(i=0,e=this.size-1){this.__adapter.update(i,e)}flush(){this.__adapter.flush()}}/**
|
|
1930
|
-
* @license
|
|
1931
|
-
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
1932
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1933
|
-
*/const ne=class{toString(){return""}};/**
|
|
1934
|
-
* @license
|
|
1935
|
-
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
1936
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1937
|
-
*/const yn=a=>class extends a{static get properties(){return{items:{type:Array,sync:!0,observer:"__itemsChanged"},focusedIndex:{type:Number,sync:!0,observer:"__focusedIndexChanged"},loading:{type:Boolean,sync:!0,observer:"__loadingChanged"},opened:{type:Boolean,sync:!0,observer:"__openedChanged"},selectedItem:{type:Object,sync:!0,observer:"__selectedItemChanged"},itemClassNameGenerator:{type:Object,observer:"__itemClassNameGeneratorChanged"},itemIdPath:{type:String},owner:{type:Object},getItemLabel:{type:Object},renderer:{type:Object,sync:!0,observer:"__rendererChanged"},theme:{type:String}}}constructor(){super(),this.__boundOnItemClick=this.__onItemClick.bind(this)}get _viewportTotalPaddingBottom(){if(this._cachedViewportTotalPaddingBottom===void 0){const e=window.getComputedStyle(this.$.selector);this._cachedViewportTotalPaddingBottom=[e.paddingBottom,e.borderBottomWidth].map(t=>parseInt(t,10)).reduce((t,r)=>t+r)}return this._cachedViewportTotalPaddingBottom}ready(){super.ready(),this.setAttribute("role","listbox"),this.id=`${this.localName}-${o.generateUniqueId()}`,this.__hostTagName=this.constructor.is.replace("-scroller",""),this.addEventListener("click",e=>e.stopPropagation()),this.__patchWheelOverScrolling()}requestContentUpdate(){this.__virtualizer&&(this.items&&(this.__virtualizer.size=this.items.length),this.opened&&this.__virtualizer.update())}scrollIntoView(e){if(!this.__virtualizer||!(this.opened&&e>=0))return;const t=this._visibleItemsCount();let r=e;e>this.__virtualizer.lastVisibleIndex-1?(this.__virtualizer.scrollToIndex(e),r=e-t+1):e>this.__virtualizer.firstVisibleIndex&&(r=this.__virtualizer.firstVisibleIndex),this.__virtualizer.scrollToIndex(Math.max(0,r));const s=[...this.children].find(h=>!h.hidden&&h.index===this.__virtualizer.lastVisibleIndex);if(!s||e!==s.index)return;const n=s.getBoundingClientRect(),l=this.getBoundingClientRect(),d=n.bottom-l.bottom+this._viewportTotalPaddingBottom;d>0&&(this.scrollTop+=d)}_isItemSelected(e,t,r){return e instanceof ne?!1:r&&e!==void 0&&t!==void 0?Ie(r,e)===Ie(r,t):e===t}__initVirtualizer(){this.__virtualizer=new bn({createElements:this.__createElements.bind(this),updateElement:this._updateElement.bind(this),elementsContainer:this,scrollTarget:this,scrollContainer:this.$.selector,reorderElements:!0})}__itemsChanged(e){e&&this.__virtualizer&&this.requestContentUpdate()}__loadingChanged(){this.requestContentUpdate()}__openedChanged(e){e&&(this.__virtualizer||this.__initVirtualizer(),this.requestContentUpdate())}__selectedItemChanged(){this.requestContentUpdate()}__itemClassNameGeneratorChanged(e,t){(e||t)&&this.requestContentUpdate()}__focusedIndexChanged(e,t){e!==t&&this.requestContentUpdate(),e>=0&&!this.loading&&this.scrollIntoView(e)}__rendererChanged(e,t){(e||t)&&this.requestContentUpdate()}__createElements(e){return[...Array(e)].map(()=>{const t=document.createElement(`${this.__hostTagName}-item`);return t.addEventListener("click",this.__boundOnItemClick),t.tabIndex="-1",t.style.width="100%",t})}_updateElement(e,t){const r=this.items[t],s=this.focusedIndex,n=this._isItemSelected(r,this.selectedItem,this.itemIdPath);e.setProperties({item:r,index:t,label:this.getItemLabel(r),selected:n,renderer:this.renderer,focused:!this.loading&&s===t}),typeof this.itemClassNameGenerator=="function"?e.className=this.itemClassNameGenerator(r):e.className!==""&&(e.className=""),e.performUpdate&&!e.hasUpdated&&e.performUpdate(),e.id=`${this.__hostTagName}-item-${t}`,e.setAttribute("role",t!==void 0?"option":!1),e.setAttribute("aria-selected",n.toString()),e.setAttribute("aria-posinset",t+1),e.setAttribute("aria-setsize",this.items.length),this.theme?e.setAttribute("theme",this.theme):e.removeAttribute("theme"),r instanceof ne&&this.__requestItemByIndex(t)}__onItemClick(e){this.dispatchEvent(new CustomEvent("selection-changed",{detail:{item:e.currentTarget.item}}))}__patchWheelOverScrolling(){this.$.selector.addEventListener("wheel",e=>{const t=this.scrollTop===0,r=this.scrollHeight-this.scrollTop-this.clientHeight<=1;(t&&e.deltaY<0||r&&e.deltaY>0)&&e.preventDefault()})}__requestItemByIndex(e){requestAnimationFrame(()=>{this.dispatchEvent(new CustomEvent("index-requested",{detail:{index:e}}))})}_visibleItemsCount(){return this.__virtualizer.scrollToIndex(this.__virtualizer.firstVisibleIndex),this.__virtualizer.size>0?this.__virtualizer.lastVisibleIndex-this.__virtualizer.firstVisibleIndex+1:0}};/**
|
|
1938
|
-
* @license
|
|
1939
|
-
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
1940
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1941
|
-
*/class wn extends yn(o.PolymerElement){static get is(){return"vaadin-combo-box-scroller"}static get template(){return o.html`
|
|
1942
|
-
<style>
|
|
1943
|
-
:host {
|
|
1944
|
-
display: block;
|
|
1945
|
-
min-height: 1px;
|
|
1946
|
-
overflow: auto;
|
|
1947
|
-
|
|
1948
|
-
/* Fixes item background from getting on top of scrollbars on Safari */
|
|
1949
|
-
transform: translate3d(0, 0, 0);
|
|
1950
|
-
|
|
1951
|
-
/* Enable momentum scrolling on iOS */
|
|
1952
|
-
-webkit-overflow-scrolling: touch;
|
|
1953
|
-
|
|
1954
|
-
/* Fixes scrollbar disappearing when 'Show scroll bars: Always' enabled in Safari */
|
|
1955
|
-
box-shadow: 0 0 0 white;
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
#selector {
|
|
1959
|
-
border-width: var(--_vaadin-combo-box-items-container-border-width);
|
|
1960
|
-
border-style: var(--_vaadin-combo-box-items-container-border-style);
|
|
1961
|
-
border-color: var(--_vaadin-combo-box-items-container-border-color, transparent);
|
|
1962
|
-
position: relative;
|
|
1963
|
-
}
|
|
1964
|
-
</style>
|
|
1965
|
-
<div id="selector">
|
|
1966
|
-
<slot></slot>
|
|
1967
|
-
</div>
|
|
1968
|
-
`}}o.defineCustomElement(wn);/**
|
|
1969
|
-
* @license
|
|
1970
|
-
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1971
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1972
|
-
*/const xn=a=>class extends o.InputConstraintsMixin(a){static get properties(){return{pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"pattern"]}static get constraints(){return[...super.constraints,"pattern"]}};/**
|
|
1973
|
-
* @license
|
|
1974
|
-
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1975
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1976
|
-
*/function Ee(a,i,e=0){let t=i;for(const r of a.subCaches){const s=r.parentCacheIndex;if(t<=s)break;if(t<=s+r.flatSize)return Ee(r,t-s-1,e+1);t-=r.flatSize}return{cache:a,item:a.items[t],index:t,page:Math.floor(t/a.pageSize),level:e}}function gi({getItemId:a},i,e,t=0,r=0){for(let s=0;s<i.items.length;s++){const n=i.items[s];if(n&&a(n)===a(e))return{cache:i,level:t,item:n,index:s,page:Math.floor(s/i.pageSize),subCache:i.getSubCache(s),flatIndex:r+i.getFlatIndex(s)}}for(const s of i.subCaches){const n=r+i.getFlatIndex(s.parentCacheIndex),l=gi({getItemId:a},s,e,t+1,n+1);if(l)return l}}function bi(a,[i,...e],t=0){i===1/0&&(i=a.size-1);const r=a.getFlatIndex(i),s=a.getSubCache(i);return s&&s.flatSize>0&&e.length?bi(s,e,t+r+1):t+r}/**
|
|
1977
|
-
* @license
|
|
1978
|
-
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1979
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1980
|
-
*/class st{constructor(i,e,t,r,s){L(this,"context");L(this,"pageSize");L(this,"items",[]);L(this,"pendingRequests",{});L(this,"__subCacheByIndex",{});L(this,"__size",0);L(this,"__flatSize",0);this.context=i,this.pageSize=e,this.size=t,this.parentCache=r,this.parentCacheIndex=s,this.__flatSize=t||0}get parentItem(){return this.parentCache&&this.parentCache.items[this.parentCacheIndex]}get subCaches(){return Object.values(this.__subCacheByIndex)}get isLoading(){return Object.keys(this.pendingRequests).length>0?!0:this.subCaches.some(i=>i.isLoading)}get flatSize(){return this.__flatSize}get effectiveSize(){return console.warn("<vaadin-grid> The `effectiveSize` property of ItemCache is deprecated and will be removed in Vaadin 25."),this.flatSize}get size(){return this.__size}set size(i){var t;if(this.__size!==i){if(this.__size=i,this.context.placeholder!==void 0){this.items.length=i||0;for(let r=0;r<i;r++)(t=this.items)[r]||(t[r]=this.context.placeholder)}Object.keys(this.pendingRequests).forEach(r=>{parseInt(r)*this.pageSize>=this.size&&delete this.pendingRequests[r]})}}recalculateFlatSize(){this.__flatSize=!this.parentItem||this.context.isExpanded(this.parentItem)?this.size+this.subCaches.reduce((i,e)=>(e.recalculateFlatSize(),i+e.flatSize),0):0}setPage(i,e){const t=i*this.pageSize;e.forEach((r,s)=>{const n=t+s;(this.size===void 0||n<this.size)&&(this.items[n]=r)})}getSubCache(i){return this.__subCacheByIndex[i]}removeSubCache(i){delete this.__subCacheByIndex[i]}removeSubCaches(){this.__subCacheByIndex={}}createSubCache(i){const e=new st(this.context,this.pageSize,0,this,i);return this.__subCacheByIndex[i]=e,e}getFlatIndex(i){const e=Math.max(0,Math.min(this.size-1,i));return this.subCaches.reduce((t,r)=>{const s=r.parentCacheIndex;return e>s?t+r.flatSize:t},e)}getItemForIndex(i){console.warn("<vaadin-grid> The `getItemForIndex` method of ItemCache is deprecated and will be removed in Vaadin 25.");const{item:e}=Ee(this,i);return e}getCacheAndIndex(i){console.warn("<vaadin-grid> The `getCacheAndIndex` method of ItemCache is deprecated and will be removed in Vaadin 25.");const{cache:e,index:t}=Ee(this,i);return{cache:e,scaledIndex:t}}updateSize(){console.warn("<vaadin-grid> The `updateSize` method of ItemCache is deprecated and will be removed in Vaadin 25."),this.recalculateFlatSize()}ensureSubCacheForScaledIndex(i){if(console.warn("<vaadin-grid> The `ensureSubCacheForScaledIndex` method of ItemCache is deprecated and will be removed in Vaadin 25."),!this.getSubCache(i)){const e=this.createSubCache(i);this.context.__controller.__loadCachePage(e,0)}}get grid(){return console.warn("<vaadin-grid> The `grid` property of ItemCache is deprecated and will be removed in Vaadin 25."),this.context.__controller.host}get itemCaches(){return console.warn("<vaadin-grid> The `itemCaches` property of ItemCache is deprecated and will be removed in Vaadin 25."),this.__subCacheByIndex}}/**
|
|
1981
|
-
* @license
|
|
1982
|
-
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1983
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1984
|
-
*/class Cn extends EventTarget{constructor(e,{size:t,pageSize:r,isExpanded:s,getItemId:n,isPlaceholder:l,placeholder:d,dataProvider:h,dataProviderParams:m}){super();L(this,"host");L(this,"dataProvider");L(this,"dataProviderParams");L(this,"pageSize");L(this,"isExpanded");L(this,"getItemId");L(this,"rootCache");L(this,"placeholder");L(this,"isPlaceholder");this.host=e,this.pageSize=r,this.getItemId=n,this.isExpanded=s,this.placeholder=d,this.isPlaceholder=l,this.dataProvider=h,this.dataProviderParams=m,this.rootCache=this.__createRootCache(t)}get flatSize(){return this.rootCache.flatSize}get __cacheContext(){return{isExpanded:this.isExpanded,placeholder:this.placeholder,__controller:this}}isLoading(){return this.rootCache.isLoading}setPageSize(e){this.pageSize=e,this.clearCache()}setDataProvider(e){this.dataProvider=e,this.clearCache()}recalculateFlatSize(){this.rootCache.recalculateFlatSize()}clearCache(){this.rootCache=this.__createRootCache(this.rootCache.size)}getFlatIndexContext(e){return Ee(this.rootCache,e)}getItemContext(e){return gi({getItemId:this.getItemId},this.rootCache,e)}getFlatIndexByPath(e){return bi(this.rootCache,e)}ensureFlatIndexLoaded(e){const{cache:t,page:r,item:s}=this.getFlatIndexContext(e);this.__isItemLoaded(s)||this.__loadCachePage(t,r)}ensureFlatIndexHierarchy(e){const{cache:t,item:r,index:s}=this.getFlatIndexContext(e);if(this.__isItemLoaded(r)&&this.isExpanded(r)&&!t.getSubCache(s)){const n=t.createSubCache(s);this.__loadCachePage(n,0)}}loadFirstPage(){this.__loadCachePage(this.rootCache,0)}__createRootCache(e){return new st(this.__cacheContext,this.pageSize,e)}__loadCachePage(e,t){if(!this.dataProvider||e.pendingRequests[t])return;let r={page:t,pageSize:this.pageSize,parentItem:e.parentItem};this.dataProviderParams&&(r=be(be({},r),this.dataProviderParams()));const s=(n,l)=>{e.pendingRequests[t]===s&&(l!==void 0?e.size=l:r.parentItem&&(e.size=n.length),e.setPage(t,n),this.recalculateFlatSize(),this.dispatchEvent(new CustomEvent("page-received")),delete e.pendingRequests[t],this.dispatchEvent(new CustomEvent("page-loaded")))};e.pendingRequests[t]=s,this.dispatchEvent(new CustomEvent("page-requested")),this.dataProvider(r,s)}__isItemLoaded(e){return this.isPlaceholder?!this.isPlaceholder(e):this.placeholder?e!==this.placeholder:!!e}}/**
|
|
1985
|
-
* @license
|
|
1986
|
-
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
1987
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1988
|
-
*/const kn=a=>class extends a{static get properties(){return{pageSize:{type:Number,value:50,observer:"_pageSizeChanged",sync:!0},size:{type:Number,observer:"_sizeChanged",sync:!0},dataProvider:{type:Object,observer:"_dataProviderChanged",sync:!0},__dataProviderInitialized:{type:Boolean,value:!1},__previousDataProviderFilter:{type:String}}}static get observers(){return["_dataProviderFilterChanged(filter)","_warnDataProviderValue(dataProvider, value)","_ensureFirstPage(opened)"]}constructor(){super(),this.__dataProviderController=new Cn(this,{placeholder:new ne,isPlaceholder:e=>e instanceof ne,dataProviderParams:()=>({filter:this.filter})}),this.__dataProviderController.addEventListener("page-requested",this.__onDataProviderPageRequested.bind(this)),this.__dataProviderController.addEventListener("page-loaded",this.__onDataProviderPageLoaded.bind(this))}ready(){super.ready(),this._scroller.addEventListener("index-requested",e=>{if(!this._shouldFetchData())return;const t=e.detail.index;t!==void 0&&this.__dataProviderController.ensureFlatIndexLoaded(t)}),this.__dataProviderInitialized=!0,this.dataProvider&&this.__synchronizeControllerState()}_dataProviderFilterChanged(e){if(this.__previousDataProviderFilter===void 0&&e===""){this.__previousDataProviderFilter=e;return}this.__previousDataProviderFilter!==e&&(this.__previousDataProviderFilter=e,this.__keepOverlayOpened=!0,this.size=void 0,this.clearCache(),this.__keepOverlayOpened=!1)}_shouldFetchData(){return this.dataProvider?this.opened||this.filter&&this.filter.length:!1}_ensureFirstPage(e){!this._shouldFetchData()||!e||(this._forceNextRequest||this.size===void 0?(this._forceNextRequest=!1,this.__dataProviderController.loadFirstPage()):this.size>0&&this.__dataProviderController.ensureFlatIndexLoaded(0))}__onDataProviderPageRequested(){this.loading=!0}__onDataProviderPageLoaded(){const{rootCache:e}=this.__dataProviderController;e.items=[...e.items],this.__synchronizeControllerState(),!this.opened&&!this._isInputFocused()&&this._commitValue()}clearCache(){this.dataProvider&&(this.__dataProviderController.clearCache(),this.__synchronizeControllerState(),this._shouldFetchData()?(this._forceNextRequest=!1,this.__dataProviderController.loadFirstPage()):this._forceNextRequest=!0)}_sizeChanged(e){const{rootCache:t}=this.__dataProviderController;t.size!==e&&(t.size=e,t.items=[...t.items],this.__synchronizeControllerState())}_filteredItemsChanged(e){if(super._filteredItemsChanged(e),this.dataProvider&&e){const{rootCache:t}=this.__dataProviderController;t.items!==e&&(t.items=e,this.__synchronizeControllerState())}}__synchronizeControllerState(){if(this.__dataProviderInitialized&&this.dataProvider){const{rootCache:e}=this.__dataProviderController;this.size=e.size,this.filteredItems=e.items,this.loading=this.__dataProviderController.isLoading()}}_pageSizeChanged(e,t){if(Math.floor(e)!==e||e<1)throw this.pageSize=t,new Error("`pageSize` value must be an integer > 0");this.__dataProviderController.setPageSize(e),this.clearCache()}_dataProviderChanged(e,t){this._ensureItemsOrDataProvider(()=>{this.dataProvider=t}),this.__dataProviderController.setDataProvider(e),this.clearCache()}_ensureItemsOrDataProvider(e){if(this.items!==void 0&&this.dataProvider!==void 0)throw e(),new Error("Using `items` and `dataProvider` together is not supported")}_warnDataProviderValue(e,t){if(e&&t!==""&&(this.selectedItem===void 0||this.selectedItem===null)){const r=this.__getItemIndexByValue(this.filteredItems,t);(r<0||!this._getItemLabel(this.filteredItems[r]))&&console.warn("Warning: unable to determine the label for the provided `value`. Nothing to display in the text field. This usually happens when setting an initial `value` before any items are returned from the `dataProvider` callback. Consider setting `selectedItem` instead of `value`")}}};/**
|
|
1989
|
-
* @license
|
|
1990
|
-
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1991
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1992
|
-
*/function Tn(a){if(window.Vaadin&&window.Vaadin.templateRendererCallback){window.Vaadin.templateRendererCallback(a);return}a.querySelector("template")&&console.warn(`WARNING: <template> inside <${a.localName}> is no longer supported. Import @vaadin/polymer-legacy-adapter/template-renderer.js to enable compatibility.`)}/**
|
|
1993
|
-
* @license
|
|
1994
|
-
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
1995
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1996
|
-
*/function Et(a){return a!=null}function St(a,i){return a.findIndex(e=>e instanceof ne?!1:i(e))}const Dn=a=>class extends Gt(o.ControllerMixin(o.ValidateMixin(o.FocusMixin(o.KeyboardMixin(o.InputMixin(o.DisabledMixin(a))))))){static get properties(){return{opened:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0,sync:!0,observer:"_openedChanged"},autoOpenDisabled:{type:Boolean,sync:!0},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},renderer:{type:Object,sync:!0},items:{type:Array,sync:!0,observer:"_itemsChanged"},allowCustomValue:{type:Boolean,value:!1},filteredItems:{type:Array,observer:"_filteredItemsChanged",sync:!0},_lastCommittedValue:String,loading:{type:Boolean,value:!1,reflectToAttribute:!0,sync:!0},_focusedIndex:{type:Number,observer:"_focusedIndexChanged",value:-1,sync:!0},filter:{type:String,value:"",notify:!0,sync:!0},selectedItem:{type:Object,notify:!0,sync:!0},itemClassNameGenerator:{type:Object},itemLabelPath:{type:String,value:"label",observer:"_itemLabelPathChanged",sync:!0},itemValuePath:{type:String,value:"value",sync:!0},itemIdPath:{type:String,sync:!0},_toggleElement:{type:Object,observer:"_toggleElementChanged"},_dropdownItems:{type:Array,sync:!0},_closeOnBlurIsPrevented:Boolean,_scroller:{type:Object,sync:!0},_overlayOpened:{type:Boolean,sync:!0,observer:"_overlayOpenedChanged"},__keepOverlayOpened:{type:Boolean,sync:!0}}}static get observers(){return["_selectedItemChanged(selectedItem, itemValuePath, itemLabelPath)","_openedOrItemsChanged(opened, _dropdownItems, loading, __keepOverlayOpened)","_updateScroller(_scroller, _dropdownItems, opened, loading, selectedItem, itemIdPath, _focusedIndex, renderer, _theme, itemClassNameGenerator)"]}constructor(){super(),this._boundOverlaySelectedItemChanged=this._overlaySelectedItemChanged.bind(this),this._boundOnClearButtonMouseDown=this.__onClearButtonMouseDown.bind(this),this._boundOnClick=this._onClick.bind(this),this._boundOnOverlayTouchAction=this._onOverlayTouchAction.bind(this),this._boundOnTouchend=this._onTouchend.bind(this)}get _tagNamePrefix(){return"vaadin-combo-box"}get _nativeInput(){return this.inputElement}_inputElementChanged(e){super._inputElementChanged(e);const t=this._nativeInput;t&&(t.autocomplete="off",t.autocapitalize="off",t.setAttribute("role","combobox"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-expanded",!!this.opened),t.setAttribute("spellcheck","false"),t.setAttribute("autocorrect","off"),this._revertInputValueToValue(),this.clearElement&&this.clearElement.addEventListener("mousedown",this._boundOnClearButtonMouseDown))}ready(){super.ready(),this._initOverlay(),this._initScroller(),this._lastCommittedValue=this.value,this.addEventListener("click",this._boundOnClick),this.addEventListener("touchend",this._boundOnTouchend);const e=()=>{requestAnimationFrame(()=>{this._overlayElement.bringToFront()})};this.addEventListener("mousedown",e),this.addEventListener("touchstart",e),Tn(this),this.addController(new Kt(this))}disconnectedCallback(){super.disconnectedCallback(),this.close()}requestContentUpdate(){this._scroller&&(this._scroller.requestContentUpdate(),this._getItemElements().forEach(e=>{e.requestContentUpdate()}))}open(){!this.disabled&&!this.readonly&&(this.opened=!0)}close(){this.opened=!1}_propertiesChanged(e,t,r){super._propertiesChanged(e,t,r),t.filter!==void 0&&this._filterChanged(t.filter)}updated(e){super.updated(e),e.has("filter")&&this._filterChanged(this.filter)}_initOverlay(){const e=this.$.overlay;e._comboBox=this,e.addEventListener("touchend",this._boundOnOverlayTouchAction),e.addEventListener("touchmove",this._boundOnOverlayTouchAction),e.addEventListener("mousedown",t=>t.preventDefault()),e.addEventListener("opened-changed",t=>{this._overlayOpened=t.detail.value}),this._overlayElement=e}_initScroller(e){const t=document.createElement(`${this._tagNamePrefix}-scroller`);t.owner=e||this,t.getItemLabel=this._getItemLabel.bind(this),t.addEventListener("selection-changed",this._boundOverlaySelectedItemChanged);const r=this._overlayElement;r.renderer=s=>{s.innerHTML||s.appendChild(t)},r.requestContentUpdate(),this._scroller=t}_updateScroller(e,t,r,s,n,l,d,h,m,u){if(e&&(r&&(e.style.maxHeight=getComputedStyle(this).getPropertyValue(`--${this._tagNamePrefix}-overlay-max-height`)||"65vh"),e.setProperties({items:r?t:[],opened:r,loading:s,selectedItem:n,itemIdPath:l,focusedIndex:d,renderer:h,theme:m,itemClassNameGenerator:u}),e.performUpdate&&!e.hasUpdated))try{e.performUpdate()}catch(v){}}_openedOrItemsChanged(e,t,r,s){this._overlayOpened=e&&(s||r||!!(t&&t.length))}_overlayOpenedChanged(e,t){e?(this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-opened",{bubbles:!0,composed:!0})),this._onOpened()):t&&this._dropdownItems&&this._dropdownItems.length&&(this.close(),this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-closed",{bubbles:!0,composed:!0})))}_focusedIndexChanged(e,t){t!==void 0&&this._updateActiveDescendant(e)}_isInputFocused(){return this.inputElement&&o.isElementFocused(this.inputElement)}_updateActiveDescendant(e){const t=this._nativeInput;if(!t)return;const r=this._getItemElements().find(s=>s.index===e);r?t.setAttribute("aria-activedescendant",r.id):t.removeAttribute("aria-activedescendant")}_openedChanged(e,t){if(t===void 0)return;e?!this._isInputFocused()&&!o.isTouch&&this.inputElement&&this.inputElement.focus():this._onClosed();const r=this._nativeInput;r&&(r.setAttribute("aria-expanded",!!e),e?r.setAttribute("aria-controls",this._scroller.id):r.removeAttribute("aria-controls"))}_onOverlayTouchAction(){this._closeOnBlurIsPrevented=!0,this.inputElement.blur(),this._closeOnBlurIsPrevented=!1}_isClearButton(e){return e.composedPath()[0]===this.clearElement}__onClearButtonMouseDown(e){e.preventDefault(),this.inputElement.focus()}_onClearButtonClick(e){e.preventDefault(),this._onClearAction(),this.opened&&this.requestContentUpdate()}_onToggleButtonClick(e){e.preventDefault(),this.opened?this.close():this.open()}_onHostClick(e){this.autoOpenDisabled||(e.preventDefault(),this.open())}_onClick(e){this._isClearButton(e)?this._onClearButtonClick(e):e.composedPath().includes(this._toggleElement)?this._onToggleButtonClick(e):this._onHostClick(e)}_onKeyDown(e){super._onKeyDown(e),e.key==="ArrowDown"?(this._onArrowDown(),e.preventDefault()):e.key==="ArrowUp"&&(this._onArrowUp(),e.preventDefault())}_getItemLabel(e){let t=e&&this.itemLabelPath?Ie(this.itemLabelPath,e):void 0;return t==null&&(t=e?e.toString():""),t}_getItemValue(e){let t=e&&this.itemValuePath?Ie(this.itemValuePath,e):void 0;return t===void 0&&(t=e?e.toString():""),t}_onArrowDown(){if(this.opened){const e=this._dropdownItems;e&&(this._focusedIndex=Math.min(e.length-1,this._focusedIndex+1),this._prefillFocusedItemLabel())}else this.open()}_onArrowUp(){if(this.opened){if(this._focusedIndex>-1)this._focusedIndex=Math.max(0,this._focusedIndex-1);else{const e=this._dropdownItems;e&&(this._focusedIndex=e.length-1)}this._prefillFocusedItemLabel()}else this.open()}_prefillFocusedItemLabel(){if(this._focusedIndex>-1){const e=this._dropdownItems[this._focusedIndex];this._inputElementValue=this._getItemLabel(e),this._markAllSelectionRange()}}_setSelectionRange(e,t){this._isInputFocused()&&this.inputElement.setSelectionRange&&this.inputElement.setSelectionRange(e,t)}_markAllSelectionRange(){this._inputElementValue!==void 0&&this._setSelectionRange(0,this._inputElementValue.length)}_clearSelectionRange(){if(this._inputElementValue!==void 0){const e=this._inputElementValue?this._inputElementValue.length:0;this._setSelectionRange(e,e)}}_closeOrCommit(){!this.opened&&!this.loading?this._commitValue():this.close()}_onEnter(e){if(!this._hasValidInputValue()){e.preventDefault(),e.stopPropagation();return}this.opened&&(e.preventDefault(),e.stopPropagation()),this._closeOrCommit()}_hasValidInputValue(){const e=this._focusedIndex<0&&this._inputElementValue!==""&&this._getItemLabel(this.selectedItem)!==this._inputElementValue;return this.allowCustomValue||!e}_onEscape(e){this.autoOpenDisabled&&(this.opened||this.value!==this._inputElementValue&&this._inputElementValue.length>0)?(e.stopPropagation(),this._focusedIndex=-1,this.cancel()):this.opened?(e.stopPropagation(),this._focusedIndex>-1?(this._focusedIndex=-1,this._revertInputValue()):this.cancel()):this.clearButtonVisible&&this.value&&!this.readonly&&(e.stopPropagation(),this._onClearAction())}_toggleElementChanged(e){e&&(e.addEventListener("mousedown",t=>t.preventDefault()),e.addEventListener("click",()=>{o.isTouch&&!this._isInputFocused()&&document.activeElement.blur()}))}_onClearAction(){this.selectedItem=null,this.allowCustomValue&&(this.value=""),this._detectAndDispatchChange()}_clearFilter(){this.filter=""}cancel(){this._revertInputValueToValue(),this._lastCommittedValue=this.value,this._closeOrCommit()}_onOpened(){this._lastCommittedValue=this.value}_onClosed(){(!this.loading||this.allowCustomValue)&&this._commitValue()}_commitValue(){if(this._focusedIndex>-1){const e=this._dropdownItems[this._focusedIndex];this.selectedItem!==e&&(this.selectedItem=e),this._inputElementValue=this._getItemLabel(this.selectedItem),this._focusedIndex=-1}else if(this._inputElementValue===""||this._inputElementValue===void 0)this.selectedItem=null,this.allowCustomValue&&(this.value="");else{const e=[this.selectedItem,...this._dropdownItems||[]],t=e[this.__getItemIndexByLabel(e,this._inputElementValue)];if(this.allowCustomValue&&!t){const r=this._inputElementValue;this._lastCustomValue=r;const s=new CustomEvent("custom-value-set",{detail:r,composed:!0,cancelable:!0,bubbles:!0});this.dispatchEvent(s),s.defaultPrevented||(this.value=r)}else!this.allowCustomValue&&!this.opened&&t?this.value=this._getItemValue(t):this._revertInputValueToValue()}this._detectAndDispatchChange(),this._clearSelectionRange(),this._clearFilter()}_onInput(e){const t=this._inputElementValue,r={};this.filter===t?this._filterChanged(this.filter):r.filter=t,!this.opened&&!this._isClearButton(e)&&!this.autoOpenDisabled&&(r.opened=!0),this.setProperties(r)}_onChange(e){e.stopPropagation()}_itemLabelPathChanged(e){typeof e!="string"&&console.error("You should set itemLabelPath to a valid string")}_filterChanged(e){this._scrollIntoView(0),this._focusedIndex=-1,this.items?this.filteredItems=this._filterItems(this.items,e):this._filteredItemsChanged(this.filteredItems)}_revertInputValue(){this.filter!==""?this._inputElementValue=this.filter:this._revertInputValueToValue(),this._clearSelectionRange()}_revertInputValueToValue(){this.allowCustomValue&&!this.selectedItem?this._inputElementValue=this.value:this._inputElementValue=this._getItemLabel(this.selectedItem)}_selectedItemChanged(e){if(e==null)this.filteredItems&&(this.allowCustomValue||(this.value=""),this._toggleHasValue(this._hasValue),this._inputElementValue=this.value);else{const t=this._getItemValue(e);if(this.value!==t&&(this.value=t,this.value!==t))return;this._toggleHasValue(!0),this._inputElementValue=this._getItemLabel(e)}}_valueChanged(e,t){e===""&&t===void 0||(Et(e)?(this._getItemValue(this.selectedItem)!==e&&this._selectItemForValue(e),!this.selectedItem&&this.allowCustomValue&&(this._inputElementValue=e),this._toggleHasValue(this._hasValue)):this.selectedItem=null,this._clearFilter(),this._lastCommittedValue=void 0)}_detectAndDispatchChange(){document.hasFocus()&&this._requestValidation(),this.value!==this._lastCommittedValue&&(this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this._lastCommittedValue=this.value)}_itemsChanged(e,t){this._ensureItemsOrDataProvider(()=>{this.items=t}),e?this.filteredItems=e.slice(0):t&&(this.filteredItems=null)}_filteredItemsChanged(e){this._setDropdownItems(e)}_filterItems(e,t){return e&&e.filter(s=>(t=t?t.toString().toLowerCase():"",this._getItemLabel(s).toString().toLowerCase().indexOf(t)>-1))}_selectItemForValue(e){const t=this.__getItemIndexByValue(this.filteredItems,e),r=this.selectedItem;t>=0?this.selectedItem=this.filteredItems[t]:this.dataProvider&&this.selectedItem===void 0?this.selectedItem=void 0:this.selectedItem=null,this.selectedItem===null&&r===null&&this._selectedItemChanged(this.selectedItem)}_setDropdownItems(e){const t=this._dropdownItems;this._dropdownItems=e;const r=t?t[this._focusedIndex]:null,s=this.__getItemIndexByValue(e,this.value);(this.selectedItem===null||this.selectedItem===void 0)&&s>=0&&(this.selectedItem=e[s]);const n=this.__getItemIndexByValue(e,this._getItemValue(r));n>-1?this._focusedIndex=n:this._focusedIndex=this.__getItemIndexByLabel(e,this.filter)}_getItemElements(){return Array.from(this._scroller.querySelectorAll(`${this._tagNamePrefix}-item`))}_scrollIntoView(e){this._scroller&&this._scroller.scrollIntoView(e)}__getItemIndexByValue(e,t){return!e||!Et(t)?-1:St(e,r=>this._getItemValue(r)===t)}__getItemIndexByLabel(e,t){return!e||!t?-1:St(e,r=>this._getItemLabel(r).toString().toLowerCase()===t.toString().toLowerCase())}_overlaySelectedItemChanged(e){e.stopPropagation(),!(e.detail.item instanceof ne)&&this.opened&&(this._focusedIndex=this.filteredItems.indexOf(e.detail.item),this.close())}_setFocused(e){if(super._setFocused(e),!e&&!this.readonly&&!this._closeOnBlurIsPrevented){if(!this.opened&&this.allowCustomValue&&this._inputElementValue===this._lastCustomValue){delete this._lastCustomValue;return}if(o.isKeyboardActive()){this._closeOrCommit();return}this.opened?this._overlayOpened||this.close():this._commitValue()}}_shouldRemoveFocus(e){return e.relatedTarget&&e.relatedTarget.localName===`${this._tagNamePrefix}-item`?!1:e.relatedTarget===this._overlayElement?(e.composedPath()[0].focus(),!1):!0}_onTouchend(e){!this.clearElement||e.composedPath()[0]!==this.clearElement||(e.preventDefault(),this._onClearAction())}};/**
|
|
1997
|
-
* @license
|
|
1998
|
-
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
1999
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
2000
|
-
*/o.registerStyles("vaadin-combo-box",o.inputFieldShared,{moduleId:"vaadin-combo-box-styles"});class In extends kn(Dn(xn(o.InputControlMixin(o.ThemableMixin(o.ElementMixin(o.PolymerElement)))))){static get is(){return"vaadin-combo-box"}static get template(){return o.html`
|
|
2001
|
-
<style>
|
|
2002
|
-
:host([opened]) {
|
|
2003
|
-
pointer-events: auto;
|
|
2004
|
-
}
|
|
2005
|
-
</style>
|
|
2006
|
-
|
|
2007
|
-
<div class="vaadin-combo-box-container">
|
|
2008
|
-
<div part="label">
|
|
2009
|
-
<slot name="label"></slot>
|
|
2010
|
-
<span part="required-indicator" aria-hidden="true" on-click="focus"></span>
|
|
2011
|
-
</div>
|
|
2012
|
-
|
|
2013
|
-
<vaadin-input-container
|
|
2014
|
-
part="input-field"
|
|
2015
|
-
readonly="[[readonly]]"
|
|
2016
|
-
disabled="[[disabled]]"
|
|
2017
|
-
invalid="[[invalid]]"
|
|
2018
|
-
theme$="[[_theme]]"
|
|
2019
|
-
>
|
|
2020
|
-
<slot name="prefix" slot="prefix"></slot>
|
|
2021
|
-
<slot name="input"></slot>
|
|
2022
|
-
<div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
|
|
2023
|
-
<div id="toggleButton" part="toggle-button" slot="suffix" aria-hidden="true"></div>
|
|
2024
|
-
</vaadin-input-container>
|
|
2025
|
-
|
|
2026
|
-
<div part="helper-text">
|
|
2027
|
-
<slot name="helper"></slot>
|
|
2028
|
-
</div>
|
|
2029
|
-
|
|
2030
|
-
<div part="error-message">
|
|
2031
|
-
<slot name="error-message"></slot>
|
|
2032
|
-
</div>
|
|
2033
|
-
</div>
|
|
2034
|
-
|
|
2035
|
-
<vaadin-combo-box-overlay
|
|
2036
|
-
id="overlay"
|
|
2037
|
-
opened="[[_overlayOpened]]"
|
|
2038
|
-
loading$="[[loading]]"
|
|
2039
|
-
theme$="[[_theme]]"
|
|
2040
|
-
position-target="[[_positionTarget]]"
|
|
2041
|
-
no-vertical-overlap
|
|
2042
|
-
></vaadin-combo-box-overlay>
|
|
2043
|
-
|
|
2044
|
-
<slot name="tooltip"></slot>
|
|
2045
|
-
`}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new o.InputController(this,i=>{this._setInputElement(i),this._setFocusElement(i),this.stateTarget=i,this.ariaTarget=i})),this.addController(new o.LabelledInputController(this.inputElement,this._labelController)),this._tooltipController=new o.TooltipController(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow(i=>!i.opened),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this._toggleElement=this.$.toggleButton}_onClearButtonClick(i){i.stopPropagation(),super._onClearButtonClick(i)}_onHostClick(i){const e=i.composedPath();(e.includes(this._labelNode)||e.includes(this._positionTarget))&&super._onHostClick(i)}}o.defineCustomElement(In);const En='*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}:host{height:100%}vaadin-combo-box>input{background-color:var(--emw--color-white, #FFFFFF);color:var(--emw--registration-typography, var(--emw--color-black, #000000));font-weight:300;font-size:16px;-webkit-font-smoothing:initial;}.select{font-family:"Roboto";font-style:normal}.select__wrapper{position:relative;width:100%;display:flex;flex-direction:column;gap:5px}.select__wrapper--autofilled{pointer-events:none}.select__wrapper--autofilled .select__label{color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.select__wrapper--autofilled .select__input::part(input-field){color:var(--emw--color-black, #000000)}.select__wrapper--flex{display:flex;gap:5px}.select__wrapper--relative{position:relative}.select__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.select__label--required::after{content:"*";font-family:inherit;color:var(--emw--login-color-primary, var(--emw--color-primary, #D0046C));margin-left:2px}.select__input{border:none;width:inherit;position:relative}.select__input[focused]::part(input-field){border-color:var(--emw--login-color-primary, var(--emw--color-primary, #D0046C))}.select__input[invalid]::part(input-field){border:1px solid var(--emw--color-error, var(--emw--color-red, #ed0909))}.select__input vaadin-date-picker-overlay-content>vaadin-button{color:var(--emw--color-black, #000000)}.select__input::part(input-field){border-radius:4px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--color-black, #000000);font-family:inherit;font-style:normal;font-size:16px;font-weight:300;line-height:1.5;padding:0;height:44px}.select__input::part(toggle-button){position:relative;right:10px}.select__input>input{padding:5px 15px}.select__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.select__tooltip-icon{width:16px;height:auto}.select__tooltip{position:absolute;top:0;left:20px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.select__tooltip.visible{opacity:1}',Sn=En,yi=class{constructor(a){c.registerInstance(this,a),this.sendValidityState=c.createEvent(this,"sendValidityState"),this.sendInputValue=c.createEvent(this,"sendInputValue"),this.defaultValue="",this.options=[],this.clientStyling="",this.limitStylingAppends=!1,this.showTooltip=!1,this.touched=!1,this.handleChange=i=>{this.touched=!0;const e=i.target.value,t=this.options.find(r=>r.value.toLowerCase()===e.toLowerCase());t?this.value=t.value:this.value=e,this.isValid=this.setValidity(),this.errorMessage=this.setErrorMessage(),this.emitValueHandler(!0)},this.handleBlur=i=>{this.value=i.target.value,this.touched=!0,this.isValid=this.setValidity(),this.errorMessage=this.setErrorMessage(),this.validityStateHandler({valid:this.isValid,name:this.name})},this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.prepend(i)}}validityChanged(){this.validityStateHandler({valid:this.isValid,name:this.name}),this.emitValue==!0&&this.valueHandler({name:this.name,value:this.value})}validityStateHandler(a){this.sendValidityState.emit(a)}emitValueHandler(a){a==!0&&this.isValid&&this.valueHandler({name:this.name,value:this.value})}valueHandler(a){this.sendInputValue.emit(a)}handleClickOutside(a){a.composedPath()[0]!==this.tooltipIconReference&&a.composedPath()[0]!==this.tooltipReference&&(this.showTooltip=!1)}connectedCallback(){this.displayedOptions=this.options.map(a=>({label:a.label,value:a.value.toUpperCase()}))}componentWillLoad(){if(this.action&&!this.options.length&&this.action.split(" ")[0]=="GET"){const a=this.action.split(" ")[1];return this.getOptions(a).then(i=>{const e=Object.keys(i)[0];this.displayedOptions=i[e].map(t=>({label:t.Name,value:t.Alpha2Code}))})}}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}componentDidLoad(){this.inputReference=this.element.shadowRoot.querySelector("input"),this.isValid=this.setValidity(),this.defaultValue&&(this.value=this.defaultValue.toUpperCase(),this.valueHandler({name:this.name,value:this.value}))}getOptions(a){const i=new URL(a);return new Promise((e,t)=>{fetch(i.href).then(r=>r.json()).then(r=>{e(r)}).catch(r=>{console.error(r),t(r)})})}setValidity(){return this.inputReference.validity.valid}setErrorMessage(){if(this.inputReference.validity.valueMissing)return T.translate("requiredError",this.language)}renderTooltip(){return this.showTooltip?c.h("div",{class:`select__tooltip ${this.showTooltip?"visible":""}`,ref:a=>this.tooltipReference=a,innerHTML:this.tooltip}):null}render(){let a="";return this.touched&&(a=this.isValid==!0||this.isValid==null?"":"text__input--invalid"),c.h("div",{key:"3d298b9709617233adacd88b8acb7d6298d35627",class:`select__wrapper ${this.autofilled?"select__wrapper--autofilled":""} ${this.name}__input`,ref:i=>this.stylingContainer=i},c.h("div",{key:"9ba53148a200b925da11ad0dea5589e9634ffb03",class:"select__wrapper--flex"},c.h("label",{key:"eb2fa2233926ada4da750e47304325d0d7ea3985",class:"select__label",htmlFor:`${this.name}__input`},`${this.displayName} ${this.validation.mandatory?"*":""}`),c.h("div",{key:"3cbe968f9a7c612d0b8d0517621a933cccd1bd58",class:"select__wrapper--relative"},this.tooltip&&c.h("img",{key:"9fa9be645ed72897a95705b0e17b3aee855eb6d4",class:"select__tooltip-icon",src:K.tooltipIconSvg,alt:"",ref:i=>this.tooltipIconReference=i,onClick:()=>this.showTooltip=!this.showTooltip}),this.renderTooltip())),c.h("vaadin-combo-box",{key:"f596a5fa5b480791080dfa63359ed30eeabfaa02",name:this.name,id:`${this.name}__input`,class:`select__input ${a} ${this.autofilled?"select__input--autofilled":""}`,"item-label-path":"label","item-value-path":"value",readOnly:this.autofilled,required:this.validation.mandatory,value:this.defaultValue,placeholder:`${this.placeholder}`,items:this.displayedOptions,onChange:this.handleChange,onBlur:this.handleBlur}),c.h("small",{key:"a9c652406489ba1d23497c55aa14e7b67fa701bd",class:"select__error-message"},this.errorMessage))}get element(){return c.getElement(this)}static get watchers(){return{isValid:["validityChanged"],emitValue:["emitValueHandler"]}}};yi.style=Sn;const Pn='*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.tel{font-family:"Roboto";font-style:normal}.tel__wrapper{position:relative;width:100%;display:flex;flex-direction:column;gap:5px}.tel__wrapper--autofilled{pointer-events:none}.tel__wrapper--autofilled .tel__label{color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.tel__wrapper--autofilled .tel__input::part(input-field){color:var(--emw--color-black, #000000)}.tel__wrapper--flex{width:inherit;display:flex;align-items:center;border-radius:4px;border:1px solid var(--emw--color-gray-100, #E6E6E6);background-color:var(--emw--color-white, #FFFFFF);overflow:hidden}.tel__wrapper--flex:focus-within{border-color:var(--emw--login-color-primary, var(--emw--color-primary, #D0046C))}.tel__wrapper--flex--invalid{border:1px solid var(--emw--color-error, var(--emw--color-red, #ed0909))}.tel__wrapper--flex-label{display:flex;gap:5px}.tel__wrapper--flex--relative{position:relative}.tel__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.tel__label--required::after{content:"*";font-family:inherit;color:var(--emw--login-color-primary, var(--emw--color-primary, #D0046C));margin-left:2px}.tel__prefix{--vaadin-field-default-width:90px}.tel__prefix[focus]{outline:none}.tel__prefix::part(input-field){border-radius:0 5px 5px 0;background-color:var(--emw--color-white, #FFFFFF);color:var(--emw--color-black, #000000);font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:1.5;border:none;border-right:2px solid #DDE0EE;border-image-source:linear-gradient(to bottom, rgba(221, 224, 238, 0) 25%, rgb(221, 224, 238) 25%, rgb(221, 224, 238) 75%, rgba(221, 224, 238, 0) 75%);border-image-slice:1;border-image-repeat:round}.tel__prefix::part(input-field):hover{background-color:var(--emw--color-white, #FFFFFF)}.tel__prefix::part(toggle-button){color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.tel__input{font-family:inherit;border-radius:5px;width:100%;color:var(--emw--registration-typography, var(--emw--color-black, #000000));background-color:var(--emw--color-white, #FFFFFF);border:none;width:inherit;position:relative;font-size:16px;font-weight:300;line-height:1.5;padding:5px 15px;height:42px;-moz-appearance:textfield;}.tel__input:focus{outline:none}.tel__input::-webkit-outer-spin-button,.tel__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.tel__input::placeholder{color:var(--emw--color-gray-150, #979797)}.tel__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.tel__tooltip-icon{width:16px;height:auto}.tel__tooltip{position:absolute;top:0;left:20px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.tel__tooltip.visible{opacity:1}',Mn=Pn,wi=class{constructor(a){c.registerInstance(this,a),this.sendValidityState=c.createEvent(this,"sendValidityState"),this.sendInputValue=c.createEvent(this,"sendInputValue"),this.clientStyling="",this.limitStylingAppends=!1,this.showTooltip=!1,this.validationPattern="",this.touched=!1,this.handleInput=i=>{this.phoneValue=i.target.value,this.value={prefix:this.prefixValue,phone:this.phoneValue},this.touched=!0,this.debounceTime&&clearTimeout(this.debounceTime),this.debounceTime=setTimeout(()=>{this.isValid=this.setValidity(),this.errorMessage=this.setErrorMessage(),this.emitValueHandler(!0)},500)},this.handleBlur=()=>{this.isValid=this.setValidity(),this.touched=!0,this.errorMessage=this.setErrorMessage()},this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.prepend(i)}}validityChanged(){this.validityStateHandler({valid:this.isValid,name:this.name}),this.emitValue==!0&&this.valueHandler({name:this.name,value:this.value,type:"tel"})}validityStateHandler(a){this.sendValidityState.emit(a)}emitValueHandler(a){a==!0&&this.isValid&&this.valueHandler({name:this.name,value:this.value,type:"tel"})}valueHandler(a){this.sendInputValue.emit(a)}handleClickOutside(a){a.composedPath()[0]!==this.tooltipIconReference&&a.composedPath()[0]!==this.tooltipReference&&(this.showTooltip=!1)}connectedCallback(){this.validationPattern=this.setPattern(),this.defaultValue&&(this.prefixValue=this.defaultValue.prefix?this.defaultValue.prefix:this.defaultValue,this.phoneValue=this.defaultValue.phone||null)}componentWillLoad(){if(this.action&&this.action.split(" ")[0]=="GET"){const a=this.action.split(" ")[1];return this.getPhoneCodes(a).then(i=>{this.phoneCodesOptions=i.phoneCodes.map(e=>({label:e.Prefix,value:e.Prefix}))})}}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}componentDidLoad(){this.isValid=this.setValidity(),this.defaultValue&&(this.value=this.defaultValue,this.valueHandler({name:this.name,value:this.value,type:"tel"}))}getPhoneCodes(a){const i=new URL(a);return new Promise((e,t)=>{fetch(i.href).then(r=>r.json()).then(r=>{e(r)}).catch(r=>{console.error(r),t(r)})})}handlePrefixInput(a){this.prefixValue=a.target.value,this.value={prefix:this.prefixValue,phone:this.phoneValue},this.emitValueHandler(!0)}setValidity(){return this.inputReference.validity.valid}setPattern(){var a,i;if(((a=this.validation.custom)===null||a===void 0?void 0:a.length)>0)return(i=this.validation.custom.find(e=>e.rule==="regex"))===null||i===void 0?void 0:i.pattern}setErrorMessage(){var a,i;if(this.inputReference.validity.patternMismatch){const e=(a=this.validation.custom.find(r=>r.rule==="regex"))===null||a===void 0?void 0:a.errorKey,t=(i=this.validation.custom.find(r=>r.rule==="regex"))===null||i===void 0?void 0:i.errorMessage;return T.translate(`${e}`,this.language)?T.translate(`${e}`,this.language):t}if(this.inputReference.validity.tooShort||this.inputReference.validity.tooLong)return T.translate("lengthError",this.language,{values:{minLength:this.validation.minLength,maxLength:this.validation.maxLength}});if(this.inputReference.validity.valueMissing)return T.translate("requiredError",this.language)}renderTooltip(){return this.showTooltip?c.h("div",{class:`tel__tooltip ${this.showTooltip?"visible":""}`,ref:a=>this.tooltipReference=a,innerHTML:this.tooltip}):null}render(){let a="";return this.touched&&(a=this.isValid==!0||this.isValid==null?"":"text__input--invalid"),c.h("div",{key:"5febd36c339710683111039d477196daac87853c",class:`tel__wrapper ${this.autofilled?"tel__wrapper--autofilled":""} ${this.name}__input`,ref:i=>this.stylingContainer=i},c.h("div",{key:"fb779beee03992b23478ffcaac85095420048ceb",class:"tel__wrapper--flex-label"},c.h("label",{key:"5b69271c1c8bf403a003d765adb40a553e09466e",class:`tel__label ${this.validation.mandatory?"tel__label--required":""}`,htmlFor:`${this.name}__input`},this.displayName),c.h("div",{key:"040c487308231459fc92eba2e643a80639df09d6",class:"tel__wrapper--relative"},this.tooltip&&c.h("img",{key:"91efd4656c718c75e5047413daf10c22c37e8f93",class:"tel__tooltip-icon",src:K.tooltipIconSvg,alt:"",ref:i=>this.tooltipIconReference=i,onClick:()=>this.showTooltip=!this.showTooltip}),this.renderTooltip())),c.h("div",{key:"6215f80b6bccb3dfb03dbbc485c850725633627c",class:`tel__wrapper--flex ${a}`},c.h("vaadin-combo-box",{key:"3b7b1ef3415619c51d74f5fc7c5e034acb8f037f",class:"tel__prefix",items:this.phoneCodesOptions,value:this.prefixValue,readOnly:this.autofilled,onChange:i=>this.handlePrefixInput(i)}),c.h("input",{key:"886553206896c367ba96f015d81b44ea86f741ea",type:"tel",ref:i=>this.inputReference=i,id:`${this.name}__input`,readOnly:this.autofilled,class:"tel__input",value:this.phoneValue,placeholder:`${this.placeholder}`,required:this.validation.mandatory,minlength:this.validation.minLength,maxlength:this.validation.maxLength,pattern:this.validationPattern,onInput:this.handleInput,onBlur:this.handleBlur})),c.h("small",{key:"d4c88d386c3342c789527d925e9cd061494b785c",class:"tel__error-message"},this.errorMessage))}static get watchers(){return{isValid:["validityChanged"],emitValue:["emitValueHandler"]}}};wi.style=Mn;const On='*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.text{font-family:"Roboto";font-style:normal}.text__wrapper{position:relative;width:100%;display:flex;flex-direction:column;gap:5px;height:100%}.text__wrapper--autofilled{pointer-events:none}.text__wrapper--autofilled .text__label{color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.text__wrapper--autofilled .text__input::part(input-field){color:var(--emw--color-black, #000000)}.text__wrapper--flex{display:flex;gap:5px}.text__wrapper--relative{position:relative}.text__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.text__label--required::after{content:"*";font-family:inherit;color:var(--emw--login-color-primary, var(--emw--color-primary, #D0046C));margin-left:2px}.text__input{font-family:inherit;width:100%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);background-color:var(--emw--color-white, #FFFFFF);color:var(--emw--color-black, #000000);border-radius:5px;font-size:16px;font-weight:300;line-height:1.5;padding:5px 15px}.text__input:focus{border:1px solid var(--emw--login-color-primary, var(--emw--color-primary, #D0046C))}.text__input--invalid{border:1px solid var(--emw--color-error, var(--emw--color-red, #ed0909))}.text__input::placeholder{color:var(--emw--color-gray-150, #828282)}.text__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.text__tooltip-icon{width:16px;height:auto}.text__tooltip{position:absolute;top:0;left:20px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.text__tooltip.visible{opacity:1}',Vn=On,xi=class{constructor(a){c.registerInstance(this,a),this.sendValidityState=c.createEvent(this,"sendValidityState"),this.sendInputValue=c.createEvent(this,"sendInputValue"),this.defaultValue="",this.clientStyling="",this.errorMessage="",this.limitStylingAppends=!1,this.showTooltip=!1,this.value="",this.validationPattern="",this.duplicateInputValue=null,this.touched=!1,this.handleInput=i=>{this.value=i.target.value,this.touched=!0,this.debounceTime&&clearTimeout(this.debounceTime),this.debounceTime=setTimeout(()=>{this.isValid=this.setValidity(),this.errorMessage=this.setErrorMessage(),this.validityStateHandler({valid:this.isValid,name:this.name}),this.emitValueHandler(!0)},500)},this.handleBlur=i=>{this.value=i.target.value,this.touched=!0,this.isValid=this.setValidity(),this.errorMessage=this.setErrorMessage(),this.validityStateHandler({valid:this.isValid,name:this.name})},this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.prepend(i)}}validityChanged(){this.validityStateHandler({valid:this.isValid,name:this.name}),this.emitValue==!0&&this.valueHandler({name:this.name,value:this.value})}emitValueHandler(a){a==!0&&this.isValid&&this.valueHandler({name:this.name,value:this.value})}validityStateHandler(a){this.sendValidityState.emit(a)}valueHandler(a){this.sendInputValue.emit(a)}handleClickOutside(a){a.composedPath()[0]!==this.tooltipIconReference&&a.composedPath()[0]!==this.tooltipReference&&(this.showTooltip=!1)}valueChangedHandler(a){this.isDuplicateInput&&this.name===a.detail.name+"Duplicate"&&(this.duplicateInputValue=a.detail.value,this.touched&&(this.isValid=this.setValidity(),this.errorMessage=this.setErrorMessage())),this.name===a.detail.name+"Duplicate"&&this.name.replace("Duplicate","")===a.detail.name&&this.touched===!0&&(this.isValid=this.setValidity(),this.errorMessage=this.setErrorMessage())}connectedCallback(){this.validationPattern=this.setPattern()}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}componentDidLoad(){this.defaultValue&&(this.value=this.defaultValue,this.valueHandler({name:this.name,value:this.value}),this.isDuplicateInput&&(this.touched=!0)),this.isValid=this.setValidity()}setValidity(){var a;return this.isDuplicateInput&&this.duplicateInputValue!==this.value?!1:(a=this.inputReference)===null||a===void 0?void 0:a.validity.valid}setPattern(){var a,i;if(((a=this.validation.custom)===null||a===void 0?void 0:a.length)>0)return(i=this.validation.custom.find(e=>e.rule==="regex"))===null||i===void 0?void 0:i.pattern}setErrorMessage(){var a,i,e,t;if(this.inputReference.validity.patternMismatch){const r=(a=this.validation.custom.find(n=>n.rule==="regex"))===null||a===void 0?void 0:a.errorKey,s=(i=this.validation.custom.find(n=>n.rule==="regex"))===null||i===void 0?void 0:i.errorMessage;return T.translate(`${r}`,this.language)?T.translate(`${r}`,this.language):s}if(this.inputReference.validity.tooShort||this.inputReference.validity.tooLong)return T.translate("lengthError",this.language,{values:{minLength:this.validation.minLength,maxLength:this.validation.maxLength}});if(this.inputReference.validity.valueMissing)return T.translate("requiredError",this.language);if(this.isDuplicateInput&&this.duplicateInputValue!==this.value){const r=(e=this.validation.custom.find(n=>n.rule==="duplicate-input"))===null||e===void 0?void 0:e.errorKey,s=(t=this.validation.custom.find(n=>n.rule==="duplicate-input"))===null||t===void 0?void 0:t.errorMessage;return T.translate(`${r}`,this.language)?T.translate(`${r}`,this.language):s}}renderTooltip(){return this.showTooltip?c.h("div",{class:`text__tooltip ${this.showTooltip?"visible":""}`,ref:a=>this.tooltipReference=a,innerHTML:this.tooltip}):null}render(){let a="";return this.touched&&(a=this.isValid==!0||this.isValid==null?"":"text__input--invalid"),c.h("div",{key:"bfb803110a70b89dd484e993c204b572f0115a17",class:`text__wrapper ${this.name}__input ${this.autofilled?"text__wrapper--autofilled":""}`,ref:i=>this.stylingContainer=i},c.h("div",{key:"6e9f8f5aada98821d5dc78ccb8b1431ba23b81ab",class:"text__wrapper--flex"},c.h("label",{key:"05cf07855121a79641475a5b020774cf8120d1ed",class:`text__label ${this.validation.mandatory?"text__label--required":""}`,htmlFor:`${this.name}__input`},this.displayName),c.h("div",{key:"f8c48a999f6827a61ec392ce99858c19559c77d2",class:"text__wrapper--relative"},this.tooltip&&c.h("img",{key:"e866f1df104ce57c29164e73b4ad4d017c7201cd",class:"text__tooltip-icon",src:K.tooltipIconSvg,alt:"",ref:i=>this.tooltipIconReference=i,onClick:()=>this.showTooltip=!this.showTooltip}),this.renderTooltip())),c.h("input",{key:"d761c265b1487fe73af54568b6da7fed82656b8d",name:this.name,id:`${this.name}__input`,value:this.defaultValue,type:"text",class:`text__input ${a}`,placeholder:`${this.placeholder}`,ref:i=>this.inputReference=i,readOnly:this.autofilled,pattern:this.validationPattern,required:this.validation.mandatory,minlength:this.validation.minLength,maxlength:this.validation.maxLength,onInput:this.handleInput,onBlur:this.handleBlur}),c.h("small",{key:"5c8df34dd47959eb1668cdf389524d145c69fa84",class:"text__error-message"},this.errorMessage))}static get watchers(){return{isValid:["validityChanged"],emitValue:["emitValueHandler"]}}};xi.style=Vn;exports.checkbox_group_input=Pt;exports.checkbox_input=Mt;exports.date_input=ui;exports.email_input=pi;exports.number_input=fi;exports.radio_input=mi;exports.select_input=yi;exports.tel_input=wi;exports.text_input=xi;
|