@esri/calcite-components 5.0.0-next.4 → 5.0.0-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calcite/{CSQVLDPF.js → 2IIGKMQ6.js} +2 -2
- package/dist/calcite/{POOH5QBE.js → 2XFESLAQ.js} +2 -2
- package/dist/calcite/{MM5GOLON.js → 3COSYM4H.js} +2 -2
- package/dist/calcite/{ALQH5DCZ.js → 3ISWQGU4.js} +2 -2
- package/dist/calcite/{VV3MILRZ.js → 3M2X4DMO.js} +2 -2
- package/dist/calcite/{XHCNKCYX.js → 3W422TPV.js} +2 -2
- package/dist/calcite/{6G3IVAVE.js → 43KOILAW.js} +2 -2
- package/dist/calcite/{XRJOD24G.js → 44XNJNTA.js} +1 -1
- package/dist/calcite/{ETHM6IZM.js → 4FSJL2OC.js} +2 -2
- package/dist/calcite/{2VXNPHIO.js → 4M5YCJ4Q.js} +2 -2
- package/dist/calcite/{WGQ2SERU.js → 4YTONN4P.js} +2 -2
- package/dist/calcite/{RPLPMP3J.js → 53JXVKUS.js} +2 -2
- package/dist/calcite/{S6HTKBNB.js → 56HP62NE.js} +1 -1
- package/dist/calcite/{FX45OPBE.js → 57TYRZR3.js} +2 -2
- package/dist/calcite/{V6JTY5IT.js → 5BQ76NQW.js} +2 -2
- package/dist/calcite/{AAV5EWQK.js → 5HV6X5DX.js} +2 -2
- package/dist/calcite/{Y6BDELTJ.js → 5T7WLABP.js} +2 -2
- package/dist/calcite/{QRBJKU6C.js → 62XLJEVX.js} +2 -2
- package/dist/calcite/{BK2W2RW3.js → 65HZ2HOS.js} +2 -2
- package/dist/calcite/{YUOVY5RN.js → 6EEMG3AJ.js} +2 -2
- package/dist/calcite/{VVCB7N7V.js → 6EKZQPKT.js} +2 -2
- package/dist/calcite/{Y7L5PL4A.js → 6FCYAKPP.js} +2 -2
- package/dist/calcite/{GTU5X7O7.js → 6GKHPG2T.js} +2 -2
- package/dist/calcite/{KSITDI7Y.js → 6OLYWF6Z.js} +2 -2
- package/dist/calcite/{D5SFHDV6.js → 6PMY6MUE.js} +2 -2
- package/dist/calcite/{SHXU5GEM.js → 6YVXONLB.js} +2 -2
- package/dist/calcite/{NPXLX7L5.js → 76DFVIQ3.js} +2 -2
- package/dist/calcite/{N7QD2WXH.js → 7AG2R6XN.js} +2 -2
- package/dist/calcite/{Z6CRZOOK.js → 7DQ4G2FS.js} +2 -2
- package/dist/calcite/{WNEJDZTS.js → 7EIPWPP6.js} +1 -1
- package/dist/calcite/{EWNCXKJC.js → 7GYHOBTA.js} +2 -2
- package/dist/calcite/{H42LHYUA.js → 7XEO6UJ3.js} +2 -2
- package/dist/calcite/{INNX6VTE.js → A6DNGYP7.js} +2 -2
- package/dist/calcite/{XYU7WBO7.js → A6ZYDDPX.js} +2 -2
- package/dist/calcite/{C3BIK3DY.js → A7OBU3ZB.js} +1 -1
- package/dist/calcite/{PWWVHZBN.js → AANSYYFF.js} +3 -3
- package/dist/calcite/{QDXVT7UF.js → ABFHGJOG.js} +2 -2
- package/dist/calcite/{63S6JWID.js → ABRDCSJF.js} +1 -1
- package/dist/calcite/{AICLNUQ5.js → AHOADFZ7.js} +2 -2
- package/dist/calcite/{JIKG4DHH.js → AIANT2RL.js} +2 -2
- package/dist/calcite/{NI3OLQU4.js → B36ZLEKI.js} +2 -2
- package/dist/calcite/{TDROT2JJ.js → B53J7Q5J.js} +2 -2
- package/dist/calcite/{R4PTX2BD.js → BKNGM5YO.js} +2 -2
- package/dist/calcite/{JRPSHIET.js → BMB7PJZB.js} +2 -2
- package/dist/calcite/{IXK4BTNI.js → BOFKO4PD.js} +2 -2
- package/dist/calcite/{FNH5JSBK.js → BTK24FM2.js} +2 -2
- package/dist/calcite/{PNBL2IVW.js → CFWXX2ZT.js} +2 -2
- package/dist/calcite/{NS7XIDPL.js → CYUZWU4F.js} +2 -2
- package/dist/calcite/{J2NLU7RP.js → CZF6KYOX.js} +1 -1
- package/dist/calcite/{QYCVH2VH.js → DATE73WS.js} +2 -2
- package/dist/calcite/{AILXQSIJ.js → DEJFI4YA.js} +2 -2
- package/dist/calcite/{H3EPIYLG.js → DN6V2M24.js} +1 -1
- package/dist/calcite/{YASA2V4I.js → DUM3R2CL.js} +2 -2
- package/dist/calcite/{RSHJ2ULC.js → E5NO42AW.js} +1 -1
- package/dist/calcite/{JBMFTM4R.js → EFDQMGZP.js} +2 -2
- package/dist/calcite/{TU2PNKWS.js → EHZXDIG5.js} +2 -2
- package/dist/calcite/{WSETKDK2.js → EOWCTVN7.js} +2 -2
- package/dist/calcite/{MDLPBZOZ.js → FHRBYILV.js} +2 -2
- package/dist/calcite/{32YCYEKN.js → FMB23RBB.js} +1 -1
- package/dist/calcite/{HZVCGOQL.js → FQKP2XIR.js} +2 -2
- package/dist/calcite/{M6OBWXQN.js → FSNEMWMV.js} +2 -2
- package/dist/calcite/{WLLFG3M7.js → FWMD4ANX.js} +2 -2
- package/dist/calcite/{EKOGELYT.js → GLUJXIHJ.js} +2 -2
- package/dist/calcite/{ZUMJB5U3.js → GS2BRYGH.js} +2 -2
- package/dist/calcite/{QSTLY3DQ.js → GSSIFYMO.js} +2 -2
- package/dist/calcite/{6OSIXZYU.js → GWC7UZVN.js} +2 -2
- package/dist/calcite/{BQI7TWVC.js → GWYUQTSG.js} +2 -2
- package/dist/calcite/{3PSVZRKA.js → H2NP25UI.js} +1 -1
- package/dist/calcite/{VZVYZPXQ.js → H3GTITDX.js} +2 -2
- package/dist/calcite/{GV755OVW.js → HBSTMWBE.js} +2 -2
- package/dist/calcite/{BG5JIUF3.js → HM4RW4PL.js} +2 -2
- package/dist/calcite/{G73EBLG4.js → HURJRVCG.js} +2 -2
- package/dist/calcite/{2CJWVM4R.js → HZJQA7EQ.js} +2 -2
- package/dist/calcite/{QWN5XHMG.js → IAOITTID.js} +2 -2
- package/dist/calcite/{A5CVK7TL.js → ID4WJFNU.js} +2 -2
- package/dist/calcite/{35DVUKKJ.js → IFQNEPTP.js} +2 -2
- package/dist/calcite/{VLOLYD36.js → IJDY7EKO.js} +2 -2
- package/dist/calcite/{QW2OFS26.js → IODUDIBK.js} +2 -2
- package/dist/calcite/{6CJF3ZME.js → JD35MQMV.js} +2 -2
- package/dist/calcite/{HPWHHEM4.js → JD5Y5FIJ.js} +2 -2
- package/dist/calcite/{M5QNDD4X.js → JJP2FEER.js} +1 -1
- package/dist/calcite/{JCGVWBAA.js → JNCHO6X5.js} +2 -2
- package/dist/calcite/{JJNFTIBI.js → JSS6WCPJ.js} +2 -2
- package/dist/calcite/{FKYJEFNP.js → JTAYXV5Y.js} +1 -1
- package/dist/calcite/{6TAH2TAT.js → JVYKUU2B.js} +2 -2
- package/dist/calcite/{5FUKNERA.js → K2RWUB5W.js} +2 -2
- package/dist/calcite/{HIB3Q63Z.js → KDHLLH5G.js} +1 -1
- package/dist/calcite/{TCB3D44T.js → KLLDUBU7.js} +2 -2
- package/dist/calcite/{AK4EMEY2.js → KR5QX3PG.js} +2 -2
- package/dist/calcite/{2GMLRXCX.js → L63HBU2O.js} +2 -2
- package/dist/calcite/{ETUOSTGW.js → LDFECFWX.js} +2 -2
- package/dist/calcite/{RBJEATU3.js → LFSTWFMB.js} +2 -2
- package/dist/calcite/{6PIHPAZF.js → LFYXGVGK.js} +2 -2
- package/dist/calcite/{ZCWFURSE.js → LNKZ4ULL.js} +2 -2
- package/dist/calcite/{2C6PV6LO.js → LX3J3Q7Q.js} +1 -1
- package/dist/calcite/{Q2KBZ6FQ.js → LX7GBILP.js} +2 -2
- package/dist/calcite/{XQGQJEI2.js → MEWZXHJ6.js} +2 -2
- package/dist/calcite/{EQC2JW3I.js → MPYXWS5E.js} +1 -1
- package/dist/calcite/{QK7SZUAI.js → MTRDCPVY.js} +2 -2
- package/dist/calcite/{CDLGLCFD.js → MYWUD5PR.js} +2 -2
- package/dist/calcite/{2J5IS422.js → N3QXJKKO.js} +2 -2
- package/dist/calcite/{WJA2X3C2.js → NHRWRXH2.js} +2 -2
- package/dist/calcite/{SQ25UCSA.js → NKMBE4R4.js} +2 -2
- package/dist/calcite/{R534LDNQ.js → NKYR42W6.js} +2 -2
- package/dist/calcite/{OTRRBSYY.js → NOOPM2CL.js} +1 -1
- package/dist/calcite/{WDKPAPPB.js → NQF73COG.js} +2 -2
- package/dist/calcite/{KCVWP63F.js → NSIT4HJE.js} +2 -2
- package/dist/calcite/{J2ACTXE5.js → O72KETNZ.js} +2 -2
- package/dist/calcite/{U3G47NPB.js → OBY2JHHI.js} +2 -2
- package/dist/calcite/{CYVISXIT.js → OD7IPBKO.js} +2 -2
- package/dist/calcite/{E3C36U7C.js → OFHMIOCW.js} +2 -2
- package/dist/calcite/{2DX2SAQ7.js → OFO7DXMT.js} +1 -1
- package/dist/calcite/{TS65SISB.js → OXZ2Y5YM.js} +1 -1
- package/dist/calcite/{TPG23UCD.js → OYVYZ6ZO.js} +2 -2
- package/dist/calcite/{C77NX62C.js → P6BUUDOL.js} +2 -2
- package/dist/calcite/{7SVIAOHO.js → PBO64SRK.js} +1 -1
- package/dist/calcite/{TLLHA7VC.js → PCGNN5RO.js} +2 -2
- package/dist/calcite/{SOFELOS3.js → PMWGEAYN.js} +2 -2
- package/dist/calcite/{JAM3DZYC.js → POOA337X.js} +1 -1
- package/dist/calcite/{TXZPVAH4.js → PPV5DY5L.js} +2 -2
- package/dist/calcite/{544AASIY.js → PQDB6CTL.js} +2 -2
- package/dist/calcite/{PQACJ4N6.js → PRLHDLWI.js} +2 -2
- package/dist/calcite/{M7H4RC23.js → Q4IQBOWU.js} +2 -2
- package/dist/calcite/{K6FTZ2ZF.js → QCGVJHJ6.js} +2 -2
- package/dist/calcite/{SLUOB5WF.js → QYN6LQ5J.js} +2 -2
- package/dist/calcite/{HOUDAAST.js → REY2OA4D.js} +2 -2
- package/dist/calcite/{7TJP2ISL.js → RLF4GWLJ.js} +2 -2
- package/dist/calcite/{JDPMMX2J.js → RW5EELAZ.js} +2 -2
- package/dist/calcite/{X7GVFGBQ.js → SHFV6LYT.js} +2 -2
- package/dist/calcite/{HKNQLLG7.js → SL3VKZG5.js} +2 -2
- package/dist/calcite/{LAAEPNIM.js → SLWHNU7X.js} +2 -2
- package/dist/calcite/{AE4AQEU5.js → SSLEHUOY.js} +2 -2
- package/dist/calcite/{HKVRX5SD.js → SXK4ATVN.js} +2 -2
- package/dist/calcite/{CAHGZMOM.js → SXMKRRD6.js} +2 -2
- package/dist/calcite/{JJOW6LLC.js → SXOKB2BX.js} +2 -2
- package/dist/calcite/{B3KV4G2W.js → SZXBPZ7S.js} +2 -2
- package/dist/calcite/{U3RNUZF6.js → T3QJCLEX.js} +2 -2
- package/dist/calcite/{26KO5WLB.js → TBM5T67T.js} +2 -2
- package/dist/calcite/{VBGPBKJL.js → TOSB6ECB.js} +2 -2
- package/dist/calcite/{WYHGKROL.js → TTLR3A5P.js} +2 -2
- package/dist/calcite/{4VQGRHEV.js → TUAQEJC4.js} +2 -2
- package/dist/calcite/{QNVFFZ3F.js → TWGPU2HX.js} +2 -2
- package/dist/calcite/{2JFH2WAM.js → TYPQP3Q3.js} +2 -2
- package/dist/calcite/{EDVRYPYX.js → U74QHS5H.js} +2 -2
- package/dist/calcite/{W2KQ3FF5.js → UCG3QU7A.js} +2 -2
- package/dist/calcite/{SBO2DPVJ.js → UKQ6KSXO.js} +2 -2
- package/dist/calcite/{HBVWYA2B.js → ULXDFGLX.js} +2 -2
- package/dist/calcite/{PRB44CR7.js → UQ4HIO7J.js} +2 -2
- package/dist/calcite/{YGYOIYMF.js → UROEAN4Q.js} +2 -2
- package/dist/calcite/{T3UNO6JW.js → VCXMHEPN.js} +2 -2
- package/dist/calcite/{XGLTZ4HO.js → VMEYQQVI.js} +2 -2
- package/dist/calcite/{AS2E2XYE.js → VS3YLYMZ.js} +1 -1
- package/dist/calcite/{PLRKNZ2Y.js → VUYRIPVA.js} +2 -2
- package/dist/calcite/{P2J4VCQF.js → VYLJCYTD.js} +2 -2
- package/dist/calcite/{C7C75GTM.js → WBXWOFF6.js} +2 -2
- package/dist/calcite/{RFA6VADW.js → WC4TGTDM.js} +2 -2
- package/dist/calcite/WXESTAXY.js +4 -0
- package/dist/calcite/{XM6I5JZM.js → WYLLIW2W.js} +2 -2
- package/dist/calcite/{MHGTLCFX.js → X46HC2YH.js} +2 -2
- package/dist/calcite/{SU2JQIB4.js → XIXFKVFZ.js} +1 -1
- package/dist/calcite/{U5ZHIRE4.js → XJ4SR7WO.js} +1 -1
- package/dist/calcite/{INNXW35W.js → XQAX6FNF.js} +2 -2
- package/dist/calcite/{GU5MLWDX.js → XTDUXEIX.js} +2 -2
- package/dist/calcite/{R2KPGC7W.js → XTYQVPDC.js} +2 -2
- package/dist/calcite/{AKR5JHPW.js → YG5VYPTQ.js} +2 -2
- package/dist/calcite/{YA3YNL2F.js → YQQN42G5.js} +2 -2
- package/dist/calcite/{MPZ73UTT.js → ZAD5LV3P.js} +2 -2
- package/dist/calcite/{DNVDDGB7.js → ZEMRH6DW.js} +2 -2
- package/dist/calcite/{A2TCAPW4.js → ZJD56MA6.js} +2 -2
- package/dist/calcite/{RUMWLVIQ.js → ZOBQ5UTK.js} +2 -2
- package/dist/calcite/{X2PZLQSO.js → ZOINAXKM.js} +2 -2
- package/dist/calcite/{GCPYRD7U.js → ZPU3MCWK.js} +2 -2
- package/dist/calcite/calcite.esm.js +2 -2
- package/dist/chunks/runtime.js +4 -4
- package/dist/chunks/useFocusTrap.js +2 -1
- package/dist/components/calcite-stepper/customElement.d.ts +0 -6
- package/dist/components/calcite-stepper/customElement.js +0 -2
- package/dist/docs/api.json +1 -10
- package/dist/docs/docs.json +1 -16
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +2 -12
- package/dist/index.d.ts +0 -1
- package/dist/types/lumina.d.ts +0 -1
- package/dist/types/preact.d.ts +0 -1
- package/dist/types/preact10.d.ts +0 -1
- package/dist/types/react.d.ts +0 -1
- package/dist/types/stencil.d.ts +0 -1
- package/package.json +2 -2
- package/dist/calcite/NFBDMCMY.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as C}from"./TS65SISB.js";import{a as H}from"./HIB3Q63Z.js";import{a as P}from"./H3EPIYLG.js";import{a as y}from"./H42LHYUA.js";import{a as O}from"./PNBL2IVW.js";import"./D5SFHDV6.js";import{D as z,e as B,t as L,u as M}from"./Z6CRZOOK.js";import"./XRJOD24G.js";import{B as R,C as $,D,E as s,J as u,L as _,M as E,P as V,g as I,h as p,o as w}from"./CSQVLDPF.js";var K=I`.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@keyframes in{0%{opacity:0}to{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0,-5px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0,5px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px,0,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px,0,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(.95,.95,1)}to{opacity:1;transform:scaleZ(1)}}`,o={container:"container",actionBarContainer:"action-bar-container",contentContainer:"content-container",content:"content",contentHeader:"content__header",contentBody:"content__body",contentOverlay:"content--overlay",floatAll:"float-all",floatContent:"float--content",resizeHandle:"resize-handle",resizeHandleBar:"resize-handle-bar"},N={actionBar:"action-bar",header:"header"},U={dragVertical:"drag-resize-vertical",dragHorizontal:"drag-resize-horizontal"},T=I`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host{pointer-events:none;position:relative;display:flex;flex:0 1 auto;align-items:stretch;z-index:var(--calcite-shell-panel-z-index, var(--calcite-z-index));--calcite-shell-panel-max-height: unset;--calcite-internal-shell-panel-shadow-block-start: 0 4px 8px -1px rgba(0, 0, 0, .08), 0 2px 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-block-end: 0 -4px 8px -1px rgba(0, 0, 0, .08), 0 -2px 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-inline-start: 4px 0 8px -1px rgba(0, 0, 0, .08), 2px 0 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-inline-end: -4px 0 8px -1px rgba(0, 0, 0, .08), -2px 0 4px -1px rgba(0, 0, 0, .04)}.calcite--rtl.content--overlay{--calcite-internal-shell-panel-shadow-inline-start: -4px 0 8px -1px rgba(0, 0, 0, .08), -2px 0 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-inline-end: 4px 0 8px -1px rgba(0, 0, 0, .08), 2px 0 4px -1px rgba(0, 0, 0, .04)}:host([layout=vertical]){z-index:var(--calcite-shell-panel-z-index, calc(var(--calcite-z-index) + 1))}:host([layout=vertical][display-mode=overlay]){z-index:var(--calcite-shell-panel-z-index, calc(var(--calcite-z-index-header) + 1))}:host([layout=vertical][display-mode=float-all]) .content{flex:2}:host([layout=vertical]:not([display-mode=float-all])) .width-s{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 12vw);--calcite-internal-shell-panel-max-width: var(--calcite-shell-panel-max-width, 300px);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 150px)}:host([layout=vertical][display-mode=float-all]) .width-s{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 12vw);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 150px)}:host([layout=vertical]:not([display-mode=float-all])) .width-m{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 20vw);--calcite-internal-shell-panel-max-width: var(--calcite-shell-panel-max-width, 420px);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 240px)}:host([layout=vertical][display-mode=float-all]) .width-m{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 20vw);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 240px)}:host([layout=vertical]:not([display-mode=float-all])) .width-l{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 45vw);--calcite-internal-shell-panel-max-width: var(--calcite-shell-panel-max-width, 680px);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 340px)}:host([layout=vertical][display-mode=float-all]) .width-l{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 45vw);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 340px)}:host([layout=horizontal]) .content{--calcite-internal-shell-panel-height: var(--calcite-shell-panel-height);--calcite-internal-shell-panel-min-height: var(--calcite-shell-panel-min-height, 5vh);--calcite-internal-shell-panel-max-height: var(--calcite-shell-panel-max-height, 30vh)}:host([layout=horizontal]) .height-s{--calcite-internal-shell-panel-height: var(--calcite-shell-panel-height);--calcite-internal-shell-panel-min-height: var(--calcite-shell-panel-min-height, 5vh);--calcite-internal-shell-panel-max-height: var(--calcite-shell-panel-max-height, 20vh)}:host([layout=horizontal]) .height-l{--calcite-internal-shell-panel-height: var(--calcite-shell-panel-height);--calcite-internal-shell-panel-min-height: var(--calcite-shell-panel-min-height, 5vh);--calcite-internal-shell-panel-max-height: var(--calcite-shell-panel-max-height, 40vh)}.container{pointer-events:none;box-sizing:border-box;display:flex;block-size:100%;flex:1 1 auto;align-items:stretch;background-color:transparent;font-size:var(--calcite-font-size--1);color:var(--calcite-shell-panel-text-color, var(--calcite-color-text-2))}.container *{box-sizing:border-box}.container.float-all{margin-block:var(--calcite-spacing-sm);margin-inline:var(--calcite-spacing-sm)}.float-all{max-block-size:var(--calcite-internal-shell-panel-max-height, calc(100% - 1rem) );box-shadow:var(--calcite-shell-panel-shadow, var(--calcite-shadow-sm));border-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round));overflow:hidden}:host([layout=vertical][position=start]) .float-all{border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-shell-panel-border-color, var(--calcite-color-border-3))}:host([layout=vertical][position=end]) .float-all{border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-shell-panel-border-color, var(--calcite-color-border-3)))}:host([layout=horizontal]) .float-all{border-inline:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-shell-panel-border-color, var(--calcite-color-border-3)))}:host([layout=horizontal]) .container{block-size:auto;inline-size:100%;flex-direction:column}.resize-handle{position:absolute;box-sizing:border-box;display:flex;-webkit-user-select:none;user-select:none;align-items:center;justify-content:center;outline:2px solid transparent;outline-offset:2px;--calcite-internal-shell-panel-resize-handle-offset: calc( (var(--calcite-size-fixed-xxl) - var(--calcite-size-fixed-sm-plus)) / 2 * -1 );z-index:var(--calcite-z-index-header)}.resize-handle:active .resize-handle-bar,.resize-handle:hover .resize-handle-bar{color:var(--calcite-shell-panel-resize-icon-color, var(--calcite-color-text-1));background-color:var(--calcite-shell-panel-resize-background-color, var(--calcite-color-foreground-3))}.resize-handle-bar{pointer-events:none;display:flex;align-items:center;justify-content:center;color:var(--calcite-shell-panel-resize-icon-color, var(--calcite-color-border-input));background-color:var(--calcite-shell-panel-resize-background-color, var(--calcite-color-background))}.resize-handle:focus .resize-handle-bar{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-color:transparent;outline:var(--calcite-border-width-md) solid var(--calcite-internal-color-focus)}:host([position=start][layout=vertical]) .resize-handle{inline-size:var(--calcite-size-fixed-xxl);inset-inline-end:var(--calcite-internal-shell-panel-resize-handle-offset);block-size:100%}:host([position=start][layout=vertical]) .resize-handle-bar{block-size:100%;inline-size:var(--calcite-size-fixed-sm-plus);border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=start][layout=vertical]):host([display-mode^=float]) .resize-handle-bar{border-start-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round));border-end-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round))}:host([position=end][layout=vertical]) .resize-handle{inline-size:var(--calcite-size-fixed-xxl);inset-inline-start:var(--calcite-internal-shell-panel-resize-handle-offset);block-size:100%}:host([position=end][layout=vertical]) .resize-handle-bar{block-size:100%;inline-size:var(--calcite-size-fixed-sm-plus);border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=end][layout=vertical]):host([display-mode^=float]) .resize-handle-bar{border-start-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round));border-end-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round))}:host([position=start][layout=horizontal]) .resize-handle{block-size:var(--calcite-size-fixed-xxl);inline-size:100%;inset-block-end:var(--calcite-internal-shell-panel-resize-handle-offset)}:host([position=start][layout=horizontal]) .resize-handle-bar{inline-size:100%;block-size:var(--calcite-size-fixed-sm-plus);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=start][layout=horizontal]):host([display-mode^=float]) .resize-handle-bar{border-end-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round));border-end-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round))}:host([position=end][layout=horizontal]) .resize-handle{block-size:var(--calcite-size-fixed-xxl);inline-size:100%;inset-block-start:var(--calcite-internal-shell-panel-resize-handle-offset)}:host([position=end][layout=horizontal]) .resize-handle-bar{inline-size:100%;block-size:var(--calcite-size-fixed-sm-plus);border-block-end:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=end][layout=horizontal]):host([display-mode^=float]) .resize-handle-bar{border-start-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round));border-start-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round))}::slotted(calcite-panel),::slotted(calcite-flow){block-size:100%;inline-size:100%;flex:1 1 auto;max-block-size:unset;max-inline-size:unset}.action-bar-container{pointer-events:auto;box-sizing:border-box;display:flex;flex:1 1 auto}.content-container{position:relative;box-sizing:border-box;display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;align-items:stretch;align-self:stretch}:host([layout=horizontal]) .action-bar-container,:host([layout=horizontal]) .content-container{flex-direction:column}.content{pointer-events:auto;position:relative;box-sizing:border-box;display:flex;flex:1 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch;align-self:stretch;padding:0;background-color:var(--calcite-shell-panel-background-color, var(--calcite-color-background));transition:max-block-size var(--calcite-animation-timing),max-inline-size var(--calcite-animation-timing)}:host([layout=vertical]:not([display-mode=float-all])) .content{inline-size:var(--calcite-internal-shell-panel-width);max-inline-size:var(--calcite-internal-shell-panel-max-width);min-inline-size:var(--calcite-internal-shell-panel-min-width)}:host([layout=vertical][display-mode=float-all]) .content{inline-size:var(--calcite-internal-shell-panel-width);min-inline-size:var(--calcite-internal-shell-panel-min-width)}:host([layout=horizontal]) .content{block-size:var(--calcite-internal-shell-panel-height);max-block-size:var(--calcite-internal-shell-panel-max-height);min-block-size:var(--calcite-internal-shell-panel-min-height)}:host([resizable][layout=vertical][position=start]) .content{padding-inline-end:var(--calcite-size-fixed-sm-plus)}:host([resizable][layout=vertical][position=end]) .content{padding-inline-start:var(--calcite-size-fixed-sm-plus)}:host([resizable][layout=horizontal][position=start]) .content{padding-block-end:var(--calcite-size-fixed-sm-plus)}:host([resizable][layout=horizontal][position=end]) .content{padding-block-start:var(--calcite-size-fixed-sm-plus)}.content__header{display:flex;flex:0 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch}.content__body{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.content--overlay{position:absolute;--tw-shadow: 0 4px 8px -1px rgba(0, 0, 0, .08), 0 2px 4px -1px rgba(0, 0, 0, .04);--tw-shadow-colored: 0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--calcite-shell-panel-shadow, var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-shadow))}:host([layout=vertical]) .content--overlay{inset-block-start:0px;block-size:100%}:host([layout=horizontal]) .content--overlay{inset-inline-start:0px;inline-size:100%}:host([layout=vertical][position=start]) .content--overlay{inset-inline-start:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-inline-start)}:host([layout=vertical][position=end]) .content--overlay{inset-inline-end:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-inline-end)}:host([layout=horizontal][position=start]) .content--overlay{inset-block-start:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-block-start)}:host([layout=horizontal][position=end]) .content--overlay{inset-block-end:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-block-end)}.float--content{margin-block-end:auto;block-size:auto;overflow:hidden;--tw-shadow: 0 4px 8px -1px rgba(0, 0, 0, .08), 0 2px 4px -1px rgba(0, 0, 0, .04);--tw-shadow-colored: 0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--calcite-shell-panel-shadow, var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-shadow));border-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round));margin-inline:var(--calcite-spacing-sm);margin-block-start:var(--calcite-spacing-sm);max-block-size:var(--calcite-internal-shell-panel-max-height, calc(100% - 1rem) )}.float--content ::slotted(calcite-panel),.float--content ::slotted(calcite-flow){max-block-size:unset}:host([layout=horizontal]) .float--content{margin-block:var(--calcite-spacing-sm)}:host([position=start]) .float--content ::slotted(calcite-panel),:host([position=start]) .float--content ::slotted(calcite-flow),:host([position=end]) .float--content ::slotted(calcite-panel),:host([position=end]) .float--content ::slotted(calcite-flow){border-style:none}slot[name=action-bar]::slotted(calcite-action-bar),.content ::slotted(calcite-flow),.content ::slotted(calcite-panel:not([closed])){border:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=start]:not([slot=panel-end])) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=start]:not([slot=panel-end])) .content ::slotted(calcite-flow),:host([position=start]:not([slot=panel-end])) .content ::slotted(calcite-panel),:host([position=end][slot=panel-start]) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=end][slot=panel-start]) .content ::slotted(calcite-flow),:host([position=end][slot=panel-start]) .content ::slotted(calcite-panel){border-inline-start:none}:host([resizable][layout=vertical]) .content ::slotted(calcite-flow),:host([resizable][layout=vertical]) .content ::slotted(calcite-panel){border-inline-start:none;border-inline-end:none}:host([resizable][layout=horizontal]) .content ::slotted(calcite-flow),:host([resizable][layout=horizontal]) .content ::slotted(calcite-panel){border-block-start:none;border-block-end:none}:host([position=end]:not([slot=panel-start])) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=end]:not([slot=panel-start])) .content ::slotted(calcite-flow),:host([position=end]:not([slot=panel-start])) .content ::slotted(calcite-panel),:host([position=start][slot=panel-end]) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=start][slot=panel-end]) .content ::slotted(calcite-flow),:host([position=start][slot=panel-end]) .content ::slotted(calcite-panel){border-inline-end:none}:host([layout=horizontal]) slot[name=action-bar]::slotted(calcite-action-bar){border-inline:0}:host([layout=horizontal][position=start]) .content ::slotted(calcite-flow),:host([layout=horizontal][position=start]) .content ::slotted(calcite-panel){border-inline:0;border-block-start:0}:host([layout=horizontal][position=end]) .content ::slotted(calcite-flow),:host([layout=horizontal][position=end]) .content ::slotted(calcite-panel){border-inline:0;border-block-end:0}:host([hidden]){display:none}[hidden]{display:none}`,A=class extends D{constructor(){super(...arguments),this.actionBars=[],this.contentRef=R(),this.messages=O(),this.resizeValues={inlineSize:null,blockSize:null,minInlineSize:null,minBlockSize:null,maxInlineSize:null,maxBlockSize:null},this.hasHeader=!1,this.collapsed=!1,this.displayMode="dock",this.layout="vertical",this.position="start",this.resizable=!1,this.widthScale="m",this.calciteInternalShellPanelResizeEnd=w({cancelable:!1}),this.calciteInternalShellPanelResizeStart=w({cancelable:!1}),this.calciteShellPanelCollapse=w({cancelable:!1}),this.calciteShellPanelExpand=w({cancelable:!1})}static{this.properties={resizeValues:[16,{},{state:!0}],hasHeader:[16,{},{state:!0}],collapsed:[7,{},{reflect:!0,type:Boolean}],displayMode:[3,{},{reflect:!0}],heightScale:[3,{},{reflect:!0}],layout:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],position:[3,{},{reflect:!0}],resizable:[7,{},{reflect:!0,type:Boolean}],height:[3,{},{reflect:!0}],widthScale:[3,{},{reflect:!0}],width:[3,{},{reflect:!0}]}}static{this.styles=[T,K]}willUpdate(e){e.has("layout")&&(this.hasUpdated||this.layout!=="vertical")&&this.setActionBarsLayout(this.actionBars),e.has("collapsed")&&this.hasUpdated&&(this.collapsed?this.calciteShellPanelCollapse.emit():this.calciteShellPanelExpand.emit())}disconnectedCallback(){super.disconnectedCallback(),this.cleanupInteractions()}getContentElDOMRect(){return this.contentRef.value.getBoundingClientRect()}handleKeyDown(e){let{key:a,defaultPrevented:r,shiftKey:l}=e,{position:i,layout:t,resizable:n,contentRef:c,el:b,resizeValues:{maxBlockSize:x,maxInlineSize:g,minBlockSize:v,minInlineSize:k}}=this,S=[...t==="horizontal"?["ArrowUp","ArrowDown"]:["ArrowLeft","ArrowRight"],"Home","End"];if(!n||!c.value||r||!S.includes(a))return;let h=this.getContentElDOMRect(),f=B(b)==="rtl"?-1:1,d=l?E:_;switch(a){case"ArrowUp":this.updateSize({size:h.height+(t==="horizontal"&&i==="end"?d:-d),type:"blockSize"}),e.preventDefault();break;case"ArrowDown":this.updateSize({size:h.height+(t==="horizontal"&&i==="end"?-d:d),type:"blockSize"}),e.preventDefault();break;case"ArrowLeft":this.updateSize({size:h.width+(t==="vertical"&&i==="end"?d:-d)*f,type:"inlineSize"}),e.preventDefault();break;case"ArrowRight":this.updateSize({size:h.width+(t==="vertical"&&i==="end"?-d:d)*f,type:"inlineSize"}),e.preventDefault();break;case"Home":this.updateSize({size:t==="horizontal"?v:k,type:t==="horizontal"?"blockSize":"inlineSize"}),e.preventDefault();break;case"End":this.updateSize({size:t==="horizontal"?x:g,type:t==="horizontal"?"blockSize":"inlineSize"}),e.preventDefault();break}}updateSize({type:e,size:a}){let{contentRef:r,resizeValues:l}=this;if(!r.value)return;let i=e==="blockSize"?"minBlockSize":"minInlineSize",t=e==="blockSize"?"maxBlockSize":"maxInlineSize",n=l[i]&&l[t]?P(a,l[i],l[t]):a,c=Math.round(n);this.resizeValues={...l,[e]:c},r.value.style[e]=a!==null?`${c}px`:null}cleanupInteractions(){this.interaction?.unset()}async setupInteractions(){this.cleanupInteractions();let{el:e,contentRef:a,resizable:r,position:l,collapsed:i,resizeHandleEl:t,layout:n}=this;if(!a.value||i||!r||!t)return;await this.el.componentOnReady();let{inlineSize:c,minInlineSize:b,blockSize:x,minBlockSize:g,maxInlineSize:v,maxBlockSize:k}=window.getComputedStyle(a.value),m={inlineSize:z(c),blockSize:z(x),minInlineSize:z(b),minBlockSize:z(g),maxInlineSize:z(v)||window.innerWidth,maxBlockSize:z(k)||window.innerHeight};this.resizeValues=m;let S=B(e)==="rtl";this.interaction=C(a.value,{context:e.ownerDocument}).resizable({edges:{top:l==="end"&&n==="horizontal"?t:!1,right:l===(S?"end":"start")&&n==="vertical"?t:!1,bottom:l==="start"&&n==="horizontal"?t:!1,left:l===(S?"start":"end")&&n==="vertical"?t:!1},modifiers:[C.modifiers.restrictSize({min:{width:m.minInlineSize,height:m.minBlockSize},max:{width:m.maxInlineSize,height:m.maxBlockSize}})],listeners:{resizestart:()=>{this.calciteInternalShellPanelResizeStart.emit()},resizeend:()=>{this.calciteInternalShellPanelResizeEnd.emit()},move:({rect:h})=>{let f=n==="horizontal";this.updateSize({size:f?h.height:h.width,type:f?"blockSize":"inlineSize"})}}})}setResizeHandleEl(e){this.resizeHandleEl=e,this.setupInteractions()}setActionBarsLayout(e){e.forEach(a=>a.layout=this.layout)}handleActionBarSlotChange(e){let a=M(e).filter(r=>r?.matches("calcite-action-bar"));this.actionBars=a,this.setActionBarsLayout(a)}handleHeaderSlotChange(e){this.hasHeader=L(e)}getResizeIcon(){let{layout:e}=this;return e==="horizontal"?U.dragVertical:U.dragHorizontal}renderHeader(){return y("header",p`<div class=${s(o.contentHeader)} .hidden=${!this.hasHeader}><slot name=${N.header} @slotchange=${this.handleHeaderSlotChange}></slot></div>`)}render(){let{collapsed:e,position:a,resizable:r,layout:l,displayMode:i,resizeValues:t}=this,n=B(this.el),c=!e&&r?y("resize-handle",p`<div .ariaLabel=${this.messages.resize} .ariaOrientation=${l==="horizontal"?"vertical":"horizontal"} .ariaValueMax=${l=="horizontal"?t.maxBlockSize:t.maxInlineSize} .ariaValueMin=${l=="horizontal"?t.minBlockSize:t.minInlineSize} .ariaValueNow=${l=="horizontal"?t.blockSize:t.inlineSize} class=${s(o.resizeHandle)} @keydown=${this.handleKeyDown} role=separator tabindex=0 touch-action=none ${$(this.setResizeHandleEl)}><div class=${s(o.resizeHandleBar)}><calcite-icon .icon=${this.getResizeIcon()} scale=s></calcite-icon></div></div>`):null,b=()=>l==="horizontal"?a==="start"?u.calciteAnimateInDown:u.calciteAnimateInUp:n==="ltr"&&a==="end"||n==="rtl"&&a==="start"?u.calciteAnimateInLeft:u.calciteAnimateInRight,x=p`<div class=${s(o.contentContainer)}>${y("content",p`<div class=${s({[u.rtl]:n==="rtl",[o.content]:!0,[o.contentOverlay]:i==="overlay",[o.floatContent]:i==="float-content"||i==="float",[u.calciteAnimate]:i==="overlay",[b()]:i==="overlay",[H("width",this.width,this.widthScale)]:!!(this.width||this.widthScale),[H("height",this.height,this.heightScale)]:!!(this.height||this.heightScale)})} .hidden=${e} ${$(this.contentRef)}>${this.renderHeader()}<div class=${s(o.contentBody)}><slot></slot></div>${c}</div>`)}</div>`,v=[y("action-bar-container",p`<div class=${s(o.actionBarContainer)}><slot name=${N.actionBar} @slotchange=${this.handleActionBarSlotChange}></slot></div>`),x];return a==="end"&&v.reverse(),p`<div class=${s({[o.container]:!0,[o.floatAll]:i==="float-all"})}>${v}</div>`}};V("calcite-shell-panel",A);export{A as ShellPanel};
|
|
3
|
+
v5.0.0-next.6 */
|
|
4
|
+
import{a as C}from"./OXZ2Y5YM.js";import{a as H}from"./KDHLLH5G.js";import{a as P}from"./DN6V2M24.js";import{a as y}from"./7XEO6UJ3.js";import{a as O}from"./CFWXX2ZT.js";import"./6PMY6MUE.js";import{D as z,e as B,t as L,u as M}from"./7DQ4G2FS.js";import"./44XNJNTA.js";import{B as R,C as $,D,E as s,J as u,L as _,M as E,P as V,g as I,h as p,o as w}from"./2IIGKMQ6.js";var K=I`.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@keyframes in{0%{opacity:0}to{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0,-5px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0,5px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px,0,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px,0,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(.95,.95,1)}to{opacity:1;transform:scaleZ(1)}}`,o={container:"container",actionBarContainer:"action-bar-container",contentContainer:"content-container",content:"content",contentHeader:"content__header",contentBody:"content__body",contentOverlay:"content--overlay",floatAll:"float-all",floatContent:"float--content",resizeHandle:"resize-handle",resizeHandleBar:"resize-handle-bar"},N={actionBar:"action-bar",header:"header"},U={dragVertical:"drag-resize-vertical",dragHorizontal:"drag-resize-horizontal"},T=I`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host{pointer-events:none;position:relative;display:flex;flex:0 1 auto;align-items:stretch;z-index:var(--calcite-shell-panel-z-index, var(--calcite-z-index));--calcite-shell-panel-max-height: unset;--calcite-internal-shell-panel-shadow-block-start: 0 4px 8px -1px rgba(0, 0, 0, .08), 0 2px 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-block-end: 0 -4px 8px -1px rgba(0, 0, 0, .08), 0 -2px 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-inline-start: 4px 0 8px -1px rgba(0, 0, 0, .08), 2px 0 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-inline-end: -4px 0 8px -1px rgba(0, 0, 0, .08), -2px 0 4px -1px rgba(0, 0, 0, .04)}.calcite--rtl.content--overlay{--calcite-internal-shell-panel-shadow-inline-start: -4px 0 8px -1px rgba(0, 0, 0, .08), -2px 0 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-inline-end: 4px 0 8px -1px rgba(0, 0, 0, .08), 2px 0 4px -1px rgba(0, 0, 0, .04)}:host([layout=vertical]){z-index:var(--calcite-shell-panel-z-index, calc(var(--calcite-z-index) + 1))}:host([layout=vertical][display-mode=overlay]){z-index:var(--calcite-shell-panel-z-index, calc(var(--calcite-z-index-header) + 1))}:host([layout=vertical][display-mode=float-all]) .content{flex:2}:host([layout=vertical]:not([display-mode=float-all])) .width-s{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 12vw);--calcite-internal-shell-panel-max-width: var(--calcite-shell-panel-max-width, 300px);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 150px)}:host([layout=vertical][display-mode=float-all]) .width-s{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 12vw);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 150px)}:host([layout=vertical]:not([display-mode=float-all])) .width-m{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 20vw);--calcite-internal-shell-panel-max-width: var(--calcite-shell-panel-max-width, 420px);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 240px)}:host([layout=vertical][display-mode=float-all]) .width-m{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 20vw);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 240px)}:host([layout=vertical]:not([display-mode=float-all])) .width-l{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 45vw);--calcite-internal-shell-panel-max-width: var(--calcite-shell-panel-max-width, 680px);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 340px)}:host([layout=vertical][display-mode=float-all]) .width-l{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 45vw);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 340px)}:host([layout=horizontal]) .content{--calcite-internal-shell-panel-height: var(--calcite-shell-panel-height);--calcite-internal-shell-panel-min-height: var(--calcite-shell-panel-min-height, 5vh);--calcite-internal-shell-panel-max-height: var(--calcite-shell-panel-max-height, 30vh)}:host([layout=horizontal]) .height-s{--calcite-internal-shell-panel-height: var(--calcite-shell-panel-height);--calcite-internal-shell-panel-min-height: var(--calcite-shell-panel-min-height, 5vh);--calcite-internal-shell-panel-max-height: var(--calcite-shell-panel-max-height, 20vh)}:host([layout=horizontal]) .height-l{--calcite-internal-shell-panel-height: var(--calcite-shell-panel-height);--calcite-internal-shell-panel-min-height: var(--calcite-shell-panel-min-height, 5vh);--calcite-internal-shell-panel-max-height: var(--calcite-shell-panel-max-height, 40vh)}.container{pointer-events:none;box-sizing:border-box;display:flex;block-size:100%;flex:1 1 auto;align-items:stretch;background-color:transparent;font-size:var(--calcite-font-size--1);color:var(--calcite-shell-panel-text-color, var(--calcite-color-text-2))}.container *{box-sizing:border-box}.container.float-all{margin-block:var(--calcite-spacing-sm);margin-inline:var(--calcite-spacing-sm)}.float-all{max-block-size:var(--calcite-internal-shell-panel-max-height, calc(100% - 1rem) );box-shadow:var(--calcite-shell-panel-shadow, var(--calcite-shadow-sm));border-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round));overflow:hidden}:host([layout=vertical][position=start]) .float-all{border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-shell-panel-border-color, var(--calcite-color-border-3))}:host([layout=vertical][position=end]) .float-all{border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-shell-panel-border-color, var(--calcite-color-border-3)))}:host([layout=horizontal]) .float-all{border-inline:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-shell-panel-border-color, var(--calcite-color-border-3)))}:host([layout=horizontal]) .container{block-size:auto;inline-size:100%;flex-direction:column}.resize-handle{position:absolute;box-sizing:border-box;display:flex;-webkit-user-select:none;user-select:none;align-items:center;justify-content:center;outline:2px solid transparent;outline-offset:2px;--calcite-internal-shell-panel-resize-handle-offset: calc( (var(--calcite-size-fixed-xxl) - var(--calcite-size-fixed-sm-plus)) / 2 * -1 );z-index:var(--calcite-z-index-header)}.resize-handle:active .resize-handle-bar,.resize-handle:hover .resize-handle-bar{color:var(--calcite-shell-panel-resize-icon-color, var(--calcite-color-text-1));background-color:var(--calcite-shell-panel-resize-background-color, var(--calcite-color-foreground-3))}.resize-handle-bar{pointer-events:none;display:flex;align-items:center;justify-content:center;color:var(--calcite-shell-panel-resize-icon-color, var(--calcite-color-border-input));background-color:var(--calcite-shell-panel-resize-background-color, var(--calcite-color-background))}.resize-handle:focus .resize-handle-bar{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-color:transparent;outline:var(--calcite-border-width-md) solid var(--calcite-internal-color-focus)}:host([position=start][layout=vertical]) .resize-handle{inline-size:var(--calcite-size-fixed-xxl);inset-inline-end:var(--calcite-internal-shell-panel-resize-handle-offset);block-size:100%}:host([position=start][layout=vertical]) .resize-handle-bar{block-size:100%;inline-size:var(--calcite-size-fixed-sm-plus);border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=start][layout=vertical]):host([display-mode^=float]) .resize-handle-bar{border-start-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round));border-end-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round))}:host([position=end][layout=vertical]) .resize-handle{inline-size:var(--calcite-size-fixed-xxl);inset-inline-start:var(--calcite-internal-shell-panel-resize-handle-offset);block-size:100%}:host([position=end][layout=vertical]) .resize-handle-bar{block-size:100%;inline-size:var(--calcite-size-fixed-sm-plus);border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=end][layout=vertical]):host([display-mode^=float]) .resize-handle-bar{border-start-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round));border-end-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round))}:host([position=start][layout=horizontal]) .resize-handle{block-size:var(--calcite-size-fixed-xxl);inline-size:100%;inset-block-end:var(--calcite-internal-shell-panel-resize-handle-offset)}:host([position=start][layout=horizontal]) .resize-handle-bar{inline-size:100%;block-size:var(--calcite-size-fixed-sm-plus);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=start][layout=horizontal]):host([display-mode^=float]) .resize-handle-bar{border-end-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round));border-end-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round))}:host([position=end][layout=horizontal]) .resize-handle{block-size:var(--calcite-size-fixed-xxl);inline-size:100%;inset-block-start:var(--calcite-internal-shell-panel-resize-handle-offset)}:host([position=end][layout=horizontal]) .resize-handle-bar{inline-size:100%;block-size:var(--calcite-size-fixed-sm-plus);border-block-end:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=end][layout=horizontal]):host([display-mode^=float]) .resize-handle-bar{border-start-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round));border-start-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round))}::slotted(calcite-panel),::slotted(calcite-flow){block-size:100%;inline-size:100%;flex:1 1 auto;max-block-size:unset;max-inline-size:unset}.action-bar-container{pointer-events:auto;box-sizing:border-box;display:flex;flex:1 1 auto}.content-container{position:relative;box-sizing:border-box;display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;align-items:stretch;align-self:stretch}:host([layout=horizontal]) .action-bar-container,:host([layout=horizontal]) .content-container{flex-direction:column}.content{pointer-events:auto;position:relative;box-sizing:border-box;display:flex;flex:1 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch;align-self:stretch;padding:0;background-color:var(--calcite-shell-panel-background-color, var(--calcite-color-background));transition:max-block-size var(--calcite-animation-timing),max-inline-size var(--calcite-animation-timing)}:host([layout=vertical]:not([display-mode=float-all])) .content{inline-size:var(--calcite-internal-shell-panel-width);max-inline-size:var(--calcite-internal-shell-panel-max-width);min-inline-size:var(--calcite-internal-shell-panel-min-width)}:host([layout=vertical][display-mode=float-all]) .content{inline-size:var(--calcite-internal-shell-panel-width);min-inline-size:var(--calcite-internal-shell-panel-min-width)}:host([layout=horizontal]) .content{block-size:var(--calcite-internal-shell-panel-height);max-block-size:var(--calcite-internal-shell-panel-max-height);min-block-size:var(--calcite-internal-shell-panel-min-height)}:host([resizable][layout=vertical][position=start]) .content{padding-inline-end:var(--calcite-size-fixed-sm-plus)}:host([resizable][layout=vertical][position=end]) .content{padding-inline-start:var(--calcite-size-fixed-sm-plus)}:host([resizable][layout=horizontal][position=start]) .content{padding-block-end:var(--calcite-size-fixed-sm-plus)}:host([resizable][layout=horizontal][position=end]) .content{padding-block-start:var(--calcite-size-fixed-sm-plus)}.content__header{display:flex;flex:0 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch}.content__body{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.content--overlay{position:absolute;--tw-shadow: 0 4px 8px -1px rgba(0, 0, 0, .08), 0 2px 4px -1px rgba(0, 0, 0, .04);--tw-shadow-colored: 0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--calcite-shell-panel-shadow, var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-shadow))}:host([layout=vertical]) .content--overlay{inset-block-start:0px;block-size:100%}:host([layout=horizontal]) .content--overlay{inset-inline-start:0px;inline-size:100%}:host([layout=vertical][position=start]) .content--overlay{inset-inline-start:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-inline-start)}:host([layout=vertical][position=end]) .content--overlay{inset-inline-end:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-inline-end)}:host([layout=horizontal][position=start]) .content--overlay{inset-block-start:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-block-start)}:host([layout=horizontal][position=end]) .content--overlay{inset-block-end:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-block-end)}.float--content{margin-block-end:auto;block-size:auto;overflow:hidden;--tw-shadow: 0 4px 8px -1px rgba(0, 0, 0, .08), 0 2px 4px -1px rgba(0, 0, 0, .04);--tw-shadow-colored: 0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--calcite-shell-panel-shadow, var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-shadow));border-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round));margin-inline:var(--calcite-spacing-sm);margin-block-start:var(--calcite-spacing-sm);max-block-size:var(--calcite-internal-shell-panel-max-height, calc(100% - 1rem) )}.float--content ::slotted(calcite-panel),.float--content ::slotted(calcite-flow){max-block-size:unset}:host([layout=horizontal]) .float--content{margin-block:var(--calcite-spacing-sm)}:host([position=start]) .float--content ::slotted(calcite-panel),:host([position=start]) .float--content ::slotted(calcite-flow),:host([position=end]) .float--content ::slotted(calcite-panel),:host([position=end]) .float--content ::slotted(calcite-flow){border-style:none}slot[name=action-bar]::slotted(calcite-action-bar),.content ::slotted(calcite-flow),.content ::slotted(calcite-panel:not([closed])){border:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=start]:not([slot=panel-end])) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=start]:not([slot=panel-end])) .content ::slotted(calcite-flow),:host([position=start]:not([slot=panel-end])) .content ::slotted(calcite-panel),:host([position=end][slot=panel-start]) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=end][slot=panel-start]) .content ::slotted(calcite-flow),:host([position=end][slot=panel-start]) .content ::slotted(calcite-panel){border-inline-start:none}:host([resizable][layout=vertical]) .content ::slotted(calcite-flow),:host([resizable][layout=vertical]) .content ::slotted(calcite-panel){border-inline-start:none;border-inline-end:none}:host([resizable][layout=horizontal]) .content ::slotted(calcite-flow),:host([resizable][layout=horizontal]) .content ::slotted(calcite-panel){border-block-start:none;border-block-end:none}:host([position=end]:not([slot=panel-start])) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=end]:not([slot=panel-start])) .content ::slotted(calcite-flow),:host([position=end]:not([slot=panel-start])) .content ::slotted(calcite-panel),:host([position=start][slot=panel-end]) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=start][slot=panel-end]) .content ::slotted(calcite-flow),:host([position=start][slot=panel-end]) .content ::slotted(calcite-panel){border-inline-end:none}:host([layout=horizontal]) slot[name=action-bar]::slotted(calcite-action-bar){border-inline:0}:host([layout=horizontal][position=start]) .content ::slotted(calcite-flow),:host([layout=horizontal][position=start]) .content ::slotted(calcite-panel){border-inline:0;border-block-start:0}:host([layout=horizontal][position=end]) .content ::slotted(calcite-flow),:host([layout=horizontal][position=end]) .content ::slotted(calcite-panel){border-inline:0;border-block-end:0}:host([hidden]){display:none}[hidden]{display:none}`,A=class extends D{constructor(){super(...arguments),this.actionBars=[],this.contentRef=R(),this.messages=O(),this.resizeValues={inlineSize:null,blockSize:null,minInlineSize:null,minBlockSize:null,maxInlineSize:null,maxBlockSize:null},this.hasHeader=!1,this.collapsed=!1,this.displayMode="dock",this.layout="vertical",this.position="start",this.resizable=!1,this.widthScale="m",this.calciteInternalShellPanelResizeEnd=w({cancelable:!1}),this.calciteInternalShellPanelResizeStart=w({cancelable:!1}),this.calciteShellPanelCollapse=w({cancelable:!1}),this.calciteShellPanelExpand=w({cancelable:!1})}static{this.properties={resizeValues:[16,{},{state:!0}],hasHeader:[16,{},{state:!0}],collapsed:[7,{},{reflect:!0,type:Boolean}],displayMode:[3,{},{reflect:!0}],heightScale:[3,{},{reflect:!0}],layout:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],position:[3,{},{reflect:!0}],resizable:[7,{},{reflect:!0,type:Boolean}],height:[3,{},{reflect:!0}],widthScale:[3,{},{reflect:!0}],width:[3,{},{reflect:!0}]}}static{this.styles=[T,K]}willUpdate(e){e.has("layout")&&(this.hasUpdated||this.layout!=="vertical")&&this.setActionBarsLayout(this.actionBars),e.has("collapsed")&&this.hasUpdated&&(this.collapsed?this.calciteShellPanelCollapse.emit():this.calciteShellPanelExpand.emit())}disconnectedCallback(){super.disconnectedCallback(),this.cleanupInteractions()}getContentElDOMRect(){return this.contentRef.value.getBoundingClientRect()}handleKeyDown(e){let{key:a,defaultPrevented:r,shiftKey:l}=e,{position:i,layout:t,resizable:n,contentRef:c,el:b,resizeValues:{maxBlockSize:x,maxInlineSize:g,minBlockSize:v,minInlineSize:k}}=this,S=[...t==="horizontal"?["ArrowUp","ArrowDown"]:["ArrowLeft","ArrowRight"],"Home","End"];if(!n||!c.value||r||!S.includes(a))return;let h=this.getContentElDOMRect(),f=B(b)==="rtl"?-1:1,d=l?E:_;switch(a){case"ArrowUp":this.updateSize({size:h.height+(t==="horizontal"&&i==="end"?d:-d),type:"blockSize"}),e.preventDefault();break;case"ArrowDown":this.updateSize({size:h.height+(t==="horizontal"&&i==="end"?-d:d),type:"blockSize"}),e.preventDefault();break;case"ArrowLeft":this.updateSize({size:h.width+(t==="vertical"&&i==="end"?d:-d)*f,type:"inlineSize"}),e.preventDefault();break;case"ArrowRight":this.updateSize({size:h.width+(t==="vertical"&&i==="end"?-d:d)*f,type:"inlineSize"}),e.preventDefault();break;case"Home":this.updateSize({size:t==="horizontal"?v:k,type:t==="horizontal"?"blockSize":"inlineSize"}),e.preventDefault();break;case"End":this.updateSize({size:t==="horizontal"?x:g,type:t==="horizontal"?"blockSize":"inlineSize"}),e.preventDefault();break}}updateSize({type:e,size:a}){let{contentRef:r,resizeValues:l}=this;if(!r.value)return;let i=e==="blockSize"?"minBlockSize":"minInlineSize",t=e==="blockSize"?"maxBlockSize":"maxInlineSize",n=l[i]&&l[t]?P(a,l[i],l[t]):a,c=Math.round(n);this.resizeValues={...l,[e]:c},r.value.style[e]=a!==null?`${c}px`:null}cleanupInteractions(){this.interaction?.unset()}async setupInteractions(){this.cleanupInteractions();let{el:e,contentRef:a,resizable:r,position:l,collapsed:i,resizeHandleEl:t,layout:n}=this;if(!a.value||i||!r||!t)return;await this.el.componentOnReady();let{inlineSize:c,minInlineSize:b,blockSize:x,minBlockSize:g,maxInlineSize:v,maxBlockSize:k}=window.getComputedStyle(a.value),m={inlineSize:z(c),blockSize:z(x),minInlineSize:z(b),minBlockSize:z(g),maxInlineSize:z(v)||window.innerWidth,maxBlockSize:z(k)||window.innerHeight};this.resizeValues=m;let S=B(e)==="rtl";this.interaction=C(a.value,{context:e.ownerDocument}).resizable({edges:{top:l==="end"&&n==="horizontal"?t:!1,right:l===(S?"end":"start")&&n==="vertical"?t:!1,bottom:l==="start"&&n==="horizontal"?t:!1,left:l===(S?"start":"end")&&n==="vertical"?t:!1},modifiers:[C.modifiers.restrictSize({min:{width:m.minInlineSize,height:m.minBlockSize},max:{width:m.maxInlineSize,height:m.maxBlockSize}})],listeners:{resizestart:()=>{this.calciteInternalShellPanelResizeStart.emit()},resizeend:()=>{this.calciteInternalShellPanelResizeEnd.emit()},move:({rect:h})=>{let f=n==="horizontal";this.updateSize({size:f?h.height:h.width,type:f?"blockSize":"inlineSize"})}}})}setResizeHandleEl(e){this.resizeHandleEl=e,this.setupInteractions()}setActionBarsLayout(e){e.forEach(a=>a.layout=this.layout)}handleActionBarSlotChange(e){let a=M(e).filter(r=>r?.matches("calcite-action-bar"));this.actionBars=a,this.setActionBarsLayout(a)}handleHeaderSlotChange(e){this.hasHeader=L(e)}getResizeIcon(){let{layout:e}=this;return e==="horizontal"?U.dragVertical:U.dragHorizontal}renderHeader(){return y("header",p`<div class=${s(o.contentHeader)} .hidden=${!this.hasHeader}><slot name=${N.header} @slotchange=${this.handleHeaderSlotChange}></slot></div>`)}render(){let{collapsed:e,position:a,resizable:r,layout:l,displayMode:i,resizeValues:t}=this,n=B(this.el),c=!e&&r?y("resize-handle",p`<div .ariaLabel=${this.messages.resize} .ariaOrientation=${l==="horizontal"?"vertical":"horizontal"} .ariaValueMax=${l=="horizontal"?t.maxBlockSize:t.maxInlineSize} .ariaValueMin=${l=="horizontal"?t.minBlockSize:t.minInlineSize} .ariaValueNow=${l=="horizontal"?t.blockSize:t.inlineSize} class=${s(o.resizeHandle)} @keydown=${this.handleKeyDown} role=separator tabindex=0 touch-action=none ${$(this.setResizeHandleEl)}><div class=${s(o.resizeHandleBar)}><calcite-icon .icon=${this.getResizeIcon()} scale=s></calcite-icon></div></div>`):null,b=()=>l==="horizontal"?a==="start"?u.calciteAnimateInDown:u.calciteAnimateInUp:n==="ltr"&&a==="end"||n==="rtl"&&a==="start"?u.calciteAnimateInLeft:u.calciteAnimateInRight,x=p`<div class=${s(o.contentContainer)}>${y("content",p`<div class=${s({[u.rtl]:n==="rtl",[o.content]:!0,[o.contentOverlay]:i==="overlay",[o.floatContent]:i==="float-content"||i==="float",[u.calciteAnimate]:i==="overlay",[b()]:i==="overlay",[H("width",this.width,this.widthScale)]:!!(this.width||this.widthScale),[H("height",this.height,this.heightScale)]:!!(this.height||this.heightScale)})} .hidden=${e} ${$(this.contentRef)}>${this.renderHeader()}<div class=${s(o.contentBody)}><slot></slot></div>${c}</div>`)}</div>`,v=[y("action-bar-container",p`<div class=${s(o.actionBarContainer)}><slot name=${N.actionBar} @slotchange=${this.handleActionBarSlotChange}></slot></div>`),x];return a==="end"&&v.reverse(),p`<div class=${s({[o.container]:!0,[o.floatAll]:i==="float-all"})}>${v}</div>`}};V("calcite-shell-panel",A);export{A as ShellPanel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as o}from"./
|
|
3
|
+
v5.0.0-next.6 */
|
|
4
|
+
import{a as o}from"./7XEO6UJ3.js";import{a as l}from"./SXK4ATVN.js";import"./6PMY6MUE.js";import"./PCGNN5RO.js";import"./H3GTITDX.js";import"./7DQ4G2FS.js";import"./44XNJNTA.js";import{D as n,E as a,P as c,g as r,h as e}from"./2IIGKMQ6.js";var t={textContainer:"text-container",fullName:"full-name",username:"username",button:"button"},u=r`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host{display:inline-flex;outline:2px solid transparent;outline-offset:2px}:host .button{margin:0;display:flex;cursor:pointer;align-items:center;justify-content:center;font-size:var(--calcite-font-size-0);line-height:1.25rem;transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;outline-color:transparent;font-family:inherit;border:none;background-color:var(--calcite-navigation-background-color, var(--calcite-internal-navigation-user-background-color, var(--calcite-color-transparent)));border-block-end:2px solid var(--calcite-color-transparent)}.text-container{margin-block-start:.125rem;display:flex;flex-direction:column;padding-inline:1rem;text-align:start}calcite-avatar{padding-inline:1rem;--calcite-avatar-corner-radius: var(--calcite-navigation-user-avatar-corner-radius);--calcite-avatar-color: var(--calcite-navigation-user-avatar-color)}calcite-avatar~.text-container{padding-inline-start:0px}.full-name{margin-inline-start:0px;font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-navigation-user-full-name-text-color, var(--calcite-color-text-1))}.username{font-size:var(--calcite-font-size--1);color:var(--calcite-navigation-user-name-text-color, var(--calcite-color-text-2))}:host(:hover) .button,:host(:focus) .button{--calcite-internal-navigation-user-background-color: var(--calcite-color-foreground-2)}:host(:focus) .button{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline:var(--calcite-border-width-md) solid var(--calcite-internal-color-focus);outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}:host(:active) .button{--calcite-internal-navigation-user-background-color: var(--calcite-color-foreground-3)}:host([active]) .button{border-block-end-color:var(--calcite-navigation-accent-color, var(--calcite-color-brand))}:host([hidden]){display:none}[hidden]{display:none}`,i=class extends n{constructor(){super(...arguments),this.focusSetter=l()(this),this.textDisabled=!1}static{this.properties={active:[7,{},{reflect:!0,type:Boolean}],fullName:1,label:1,textDisabled:[7,{},{reflect:!0,type:Boolean}],thumbnail:1,userId:1,username:1}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=u}async setFocus(s){return this.focusSetter(()=>this.el,s)}render(){return e`<button .ariaLabel=${this.label} class=${a(t.button)}><calcite-avatar .fullName=${this.fullName} .label=${this.label} .thumbnail=${this.thumbnail} .userId=${this.userId} .username=${this.username}></calcite-avatar>${(this.fullName||this.username)&&!this.textDisabled&&e`<div class=${a(t.textContainer)}>${this.fullName&&o(t.fullName,e`<span class=${a(t.fullName)}>${this.fullName}</span>`)||""}${this.username&&o(t.username,e`<span class=${a(t.username)}>${this.username}</span>`)||""}</div>`||""}</button>`}};c("calcite-navigation-user",i);export{i as NavigationUser};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as se,b as H}from"./H3EPIYLG.js";import{a as Y,k as S}from"./RUMWLVIQ.js";import{a as ie}from"./6TAH2TAT.js";import{a as ae}from"./SHXU5GEM.js";import{c as Z,d as ee,e as te}from"./J2ACTXE5.js";import{c as G,e as K,f as W,h as J}from"./U3G47NPB.js";import{a as N,b as j}from"./PRB44CR7.js";import{a as I}from"./H42LHYUA.js";import{a as Q}from"./2DX2SAQ7.js";import{a as U}from"./PNBL2IVW.js";import{a as X}from"./HKVRX5SD.js";import"./D5SFHDV6.js";import"./TLLHA7VC.js";import"./VZVYZPXQ.js";import{p as R,w as _}from"./Z6CRZOOK.js";import{a as q}from"./XRJOD24G.js";import{B,C as T,D as F,E as p,F as M,H as O,I as E,P as A,g as z,h as k,l as C,o as L}from"./CSQVLDPF.js";var l={container:"container",containerRange:"container--range",graph:"graph",handle:"handle",handleExtension:"handle-extension",handleLabel:"handle__label",handleLabelMinValue:"handle__label--minValue",handleLabelValue:"handle__label--value",hyphen:"hyphen",hyphenWrap:"hyphen--wrap",static:"static",thumb:"thumb",thumbActive:"thumb--active",thumbContainer:"thumb-container",thumbMinValue:"thumb--minValue",thumbPrecise:"thumb--precise",thumbValue:"thumb--value",tick:"tick",tickActive:"tick--active",tickLabel:"tick__label",tickMax:"tick__label--max",tickMin:"tick__label--min",ticks:"ticks",track:"track",trackRange:"track__range",transformed:"transformed",scale:$=>`scale--${$}`},le="calcite-slider",D={validationMessage:"validationMessage",host:$=>`${le}-${$}`},ne=250,re=z`@charset "UTF-8";:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}.scale--s{--calcite-slider-handle-size: .625rem;--calcite-slider-handle-extension-height: .4rem;--calcite-slider-container-font-size: var(--calcite-font-size--3)}.scale--s .handle__label,.scale--s .tick__label{line-height:.75rem}.scale--m{--calcite-slider-handle-size: .875rem;--calcite-slider-handle-extension-height: .5rem;--calcite-slider-container-font-size: var(--calcite-font-size--2)}.scale--m .handle__label,.scale--m .tick__label{line-height:1rem}.scale--l{--calcite-slider-handle-size: 1rem;--calcite-slider-handle-extension-height: .65rem;--calcite-slider-container-font-size: var(--calcite-font-size--1)}.scale--l .handle__label,.scale--l .tick__label{line-height:1rem}.handle__label,.tick__label{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-slider-text-color, var(--calcite-color-text-2));font-size:var(--calcite-slider-container-font-size)}:host{display:block}:host .validation-container{padding-block-start:0!important}.container{position:relative;display:block;overflow-wrap:normal;word-break:normal;padding-inline:calc(var(--calcite-slider-handle-size) * .5);padding-block:calc(var(--calcite-slider-handle-size) * .5);margin-block:calc(var(--calcite-slider-handle-size) * .5);margin-inline:0;--calcite-slider-full-handle-height: calc( var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height) );touch-action:none;-webkit-user-select:none;user-select:none}:host([disabled]) .track__range,:host([disabled]) .tick--active{background-color:var(--calcite-color-text-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset: -.375rem}.scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset: -.5rem}.scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset: -.55rem}:host([precise]:not([has-histogram])) .container .thumb--value{--calcite-slider-thumb-y-offset: calc(var(--calcite-slider-full-handle-height) * -1)}.thumb-container{position:relative;max-inline-size:100%}.thumb{--calcite-slider-thumb-x-offset: calc(var(--calcite-slider-handle-size) * .5);position:absolute;margin:0;display:flex;cursor:pointer;flex-direction:column;align-items:center;border-style:none;background-color:transparent;padding:0;font-family:inherit;outline:2px solid transparent;outline-offset:2px;transform:translate(var(--calcite-slider-thumb-x-offset),var(--calcite-slider-thumb-y-offset))}.thumb .handle__label{white-space:nowrap}.thumb .handle__label.static,.thumb .handle__label.transformed{position:absolute;inset-block:0px;opacity:0}.thumb .handle__label.hyphen:after{content:"—";display:inline-block;inline-size:1em}.thumb .handle__label.hyphen--wrap{display:flex}.thumb .handle{box-sizing:border-box;border-radius:9999px;outline-color:transparent;background-color:var(--calcite-slider-handle-fill-color, var(--calcite-color-foreground-1));block-size:var(--calcite-slider-handle-size);inline-size:var(--calcite-slider-handle-size);box-shadow:0 0 0 2px var(--calcite-color-text-3) inset;transition:border var(--calcite-internal-animation-timing-medium) ease,background-color var(--calcite-internal-animation-timing-medium) ease,box-shadow var(--calcite-animation-timing) ease}.thumb .handle-extension{inline-size:.125rem;block-size:var(--calcite-slider-handle-extension-height);background-color:var(--calcite-slider-handle-extension-color, var(--calcite-color-text-3))}.thumb:hover .handle{box-shadow:0 0 0 3px var(--calcite-color-brand) inset}.thumb:hover .handle-extension{background-color:var(--calcite-slider-accent-color, var(--calcite-color-brand))}.thumb:focus .handle{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline:var(--calcite-border-width-md) solid var(--calcite-internal-color-focus);outline-offset:calc(var(--calcite-spacing-base) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.thumb:focus .handle-extension{background-color:var(--calcite-slider-accent-color, var(--calcite-color-brand))}.thumb.thumb--minValue{transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1),var(--calcite-slider-thumb-y-offset))}.thumb.thumb--precise{--calcite-slider-thumb-y-offset: -.125rem}:host([label-handles]) .thumb{--calcite-slider-thumb-x-offset: 50%}:host([label-handles]):host(:not([has-histogram])) .scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset: -1.4375rem}:host([label-handles]):host(:not([has-histogram])) .scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset: -1.875rem}:host([label-handles]):host(:not([has-histogram])) .scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset: -2rem}:host([has-histogram][label-handles]) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--minValue.thumb--precise .handle__label{margin-block-start:.5em}:host(:not([has-histogram]):not([precise])) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--value .handle__label{margin-block-end:.5em}:host([label-handles][precise]):host(:not([has-histogram])) .scale--s .thumb--value{--calcite-slider-thumb-y-offset: -2.075rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--m .thumb--value{--calcite-slider-thumb-y-offset: -2.75rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--l .thumb--value{--calcite-slider-thumb-y-offset: -3.0625rem}.thumb:focus .handle,.thumb--active .handle{background-color:var(--calcite-slider-accent-color, var(--calcite-color-brand));box-shadow:0 0 8px #00000029}.thumb:hover.thumb--precise:after,.thumb:focus.thumb--precise:after,.thumb--active.thumb--precise:after{background-color:var(--calcite-slider-accent-color, var(--calcite-color-brand))}.track{position:relative;block-size:.125rem;border-radius:0;background-color:var(--calcite-slider-track-color, var(--calcite-color-border-2));transition:all var(--calcite-internal-animation-timing-medium) ease-in}.track__range{position:absolute;inset-block-start:0px;block-size:.125rem;background-color:var(--calcite-slider-track-fill-color, var(--calcite-color-brand))}.container--range .track__range:hover{cursor:ew-resize}.container--range .track__range:after{position:absolute;inline-size:100%;content:"";inset-block-start:calc(var(--calcite-slider-full-handle-height) * .5 * -1);block-size:calc(var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height))}@media(forced-colors:active){.thumb{outline-width:0;outline-offset:0}.handle{outline:2px solid transparent;outline-offset:2px}.thumb:focus .handle,.thumb .handle-extension,.thumb:hover .handle-extension,.thumb:focus .handle-extension,.thumb:active .handle-extension{background-color:canvasText}.track{background-color:canvasText}.track__range{background-color:highlight}}.tick{position:absolute;block-size:.25rem;inline-size:.125rem;border-width:1px;border-style:solid;background-color:var(--calcite-slider-tick-color, var(--calcite-color-border-input));border-color:var(--calcite-slider-tick-border-color, var(--calcite-color-foreground-1));inset-block-start:-2px;pointer-events:none;margin-inline-start:-.125rem}.tick--active{background-color:var(--calcite-slider-tick-selected-color, var(--calcite-color-brand))}.tick__label{pointer-events:none;margin-block-start:.875rem;display:flex;justify-content:center}.tick__label--min{transition:opacity var(--calcite-animation-timing)}.tick__label--max{transition:opacity var(--calcite-internal-animation-timing-fast)}:host([has-histogram][label-handles]) .tick__label--min,:host([has-histogram][label-handles]) .tick__label--max,:host([has-histogram][precise]) .tick__label--min,:host([has-histogram][precise]) .tick__label--max{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-3)}.graph{color:var(--calcite-slider-graph-color, var(--calcite-color-foreground-3));block-size:48px}:host([label-ticks][ticks]) .container{padding-block-end:calc(.875rem + var(--calcite-slider-container-font-size))}:host([has-histogram]):host([precise][label-handles]) .container{padding-block-end:calc(var(--calcite-slider-full-handle-height) + 1em)}:host([has-histogram]):host([label-handles]:not([precise])) .container{padding-block-end:calc(var(--calcite-slider-handle-size) * .5 + 1em)}:host([has-histogram]):host([precise]:not([label-handles])) .container{padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container{padding-block-start:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container--range{padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([label-handles]:not([precise])) .container{padding-block-start:calc(var(--calcite-slider-full-handle-height) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container{padding-block-start:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container--range{padding-block-end:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}.internal-label-alignment--center{align-items:center}.internal-label-alignment--end{align-items:end}.internal-label--container{display:flex;justify-content:space-between;color:var(--calcite-color-text-1)}.internal-label-required--indicator{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-status-danger);padding-inline:var(--calcite-spacing-base)}.internal-label-required--indicator:hover{cursor:help}.internal-label--text{line-height:1}:host([scale=s]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-xxs)}:host([scale=s]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label--text{font-size:var(--calcite-font-size--2)}:host([scale=m]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label--text{font-size:var(--calcite-font-size--1)}:host([scale=l]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=l]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-md)}:host([scale=l]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-md)}:host([scale=l]) .internal-label--text{font-size:var(--calcite-font-size-0)}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:.5rem}:host([scale=s]) .validation-container{padding-block-start:.25rem}::slotted(input[slot=hidden-form-input]){margin:0!important;opacity:0!important;outline:none!important;padding:0!important;position:absolute!important;inset:0!important;transform:none!important;-webkit-appearance:none!important;z-index:-1!important}:host([hidden]){display:none}[hidden]{display:none}`;function b($){return Array.isArray($)}var P=class extends F{constructor(){super(),this.dragEnd=e=>{this.disabled||(this.removeDragListeners(),this.focusActiveHandle(e.clientX),this.lastDragPropValue!=this[this.dragProp]&&this.emitChange(),this.dragProp=null,this.lastDragPropValue=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.minMaxValueRange=null)},this.dragUpdate=e=>{if(!(this.disabled||!this.trackRef.value)&&(e.preventDefault(),this.dragProp)){let t=this.mapToRange(e.clientX||e.pageX);if(b(this.value)&&this.dragProp==="minMaxValue")if(this.minValueDragRange&&this.maxValueDragRange&&this.minMaxValueRange){let i=t-this.minValueDragRange,a=t+this.maxValueDragRange;a<=this.max&&i>=this.min&&a-i===this.minMaxValueRange&&this.setValue({minValue:this.clamp(i,"minValue"),maxValue:this.clamp(a,"maxValue")})}else this.minValueDragRange=t-this.minValue,this.maxValueDragRange=this.maxValue-t,this.minMaxValueRange=this.maxValue-this.minValue;else if(b(this.value)&&b(this.previousEmittedValue)&&this.dragProp==="maxValue"){let[i,a]=this.previousEmittedValue;i===a&&t<i?(this.dragProp="minValue",this.minHandle.focus()):this.setValue({[this.dragProp]:this.clamp(t,this.dragProp)})}else this.setValue({[this.dragProp]:this.clamp(t,this.dragProp)})}},this.formatValue=e=>(S.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},S.localize(e.toString())),this.guid=D.host(q()),this.messages=U(),this.pointerUpDragEnd=e=>{this.disabled||!_(e)||this.dragEnd(e)},this.trackRef=B(),this.focusSetter=X()(this),this.activeProp="value",this.maxValueDragRange=null,this.minMaxValueRange=null,this.minValueDragRange=null,this.tickValues=[],this.disabled=!1,this.fillPlacement="start",this.groupSeparator=!1,this.hasHistogram=!1,this.labelHandles=!1,this.labelTicks=!1,this.max=100,this.min=0,this.mirrored=!1,this.precise=!1,this.required=!1,this.scale="m",this.snap=!1,this.status="idle",this.step=1,this.validity={valid:!1,badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1},this.value=0,this.calciteSliderChange=L({cancelable:!1}),this.calciteSliderInput=L({cancelable:!1}),this.listen("pointerdown",this.pointerDownHandler),this.listen("keydown",this.handleKeyDown),this.listen("touchstart",this.handleTouchStart)}static{this.properties={activeProp:[16,{},{state:!0}],maxValueDragRange:[16,{},{state:!0}],minMaxValueRange:[16,{},{state:!0}],minValueDragRange:[16,{},{state:!0}],tickValues:[16,{},{state:!0}],disabled:[7,{},{reflect:!0,type:Boolean}],fillPlacement:[3,{},{reflect:!0}],form:[3,{},{reflect:!0}],groupSeparator:[7,{},{reflect:!0,type:Boolean}],hasHistogram:[7,{},{reflect:!0,type:Boolean}],histogram:[0,{},{attribute:!1}],histogramStops:[0,{},{attribute:!1}],labelFormatter:[0,{},{attribute:!1}],labelHandles:[7,{},{reflect:!0,type:Boolean}],labelTicks:[7,{},{reflect:!0,type:Boolean}],max:[11,{},{reflect:!0,type:Number}],maxLabel:1,maxValue:[9,{},{type:Number}],min:[11,{},{reflect:!0,type:Number}],minLabel:1,labelText:1,messageOverrides:[0,{},{attribute:!1}],minValue:[9,{},{type:Number}],mirrored:[7,{},{reflect:!0,type:Boolean}],name:[3,{},{reflect:!0}],numberingSystem:1,pageStep:[11,{},{reflect:!0,type:Number}],precise:[7,{},{reflect:!0,type:Boolean}],required:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],snap:[7,{},{reflect:!0,type:Boolean}],status:[3,{},{reflect:!0}],step:[11,{},{reflect:!0,type:Number}],ticks:[11,{},{reflect:!0,type:Number}],validationIcon:[3,{converter:E,type:String},{reflect:!0}],validationMessage:1,validity:[0,{},{attribute:!1}],value:[11,{},{type:Number,reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=re}async setFocus(e){return this.focusSetter(()=>this.minHandle||this.maxHandle,e)}connectedCallback(){super.connectedCallback(),this.setMinMaxFromValue(),this.setValueFromMinMax(),Z(this),G(this),this.previousEmittedValue=this.value}load(){b(this.value)||(this.value=this.snap?this.getClosestStep(this.value):this.clamp(this.value)),W(this,this.value)}willUpdate(e){e.has("histogram")&&(this.hasHistogram=!!this.histogram),e.has("ticks")&&(this.tickValues=this.generateTickValues()),e.has("value")&&(this.hasUpdated||this.value!==0)&&this.setMinMaxFromValue(),(e.has("minValue")||e.has("maxValue"))&&this.setValueFromMinMax()}updated(){this.labelHandles&&(this.adjustHostObscuredHandleLabel("value"),b(this.value)&&(this.adjustHostObscuredHandleLabel("minValue"),this.precise&&!this.hasHistogram||this.hyphenateCollidingRangeHandleLabels())),this.hideObscuredBoundingTickLabels(),N(this)}disconnectedCallback(){super.disconnectedCallback(),ee(this),K(this),this.removeDragListeners()}handleKeyDown(e){let t=this.shouldMirror(),{activeProp:i,max:a,min:s,pageStep:n,step:o}=this,r=this[i],{key:c}=e;if(Q(c)){e.preventDefault();return}let d;if(c==="ArrowUp"||c==="ArrowRight"?d=r+o*(t&&c==="ArrowRight"?-1:1):c==="ArrowDown"||c==="ArrowLeft"?d=r-o*(t&&c==="ArrowLeft"?-1:1):c==="PageUp"?n&&(d=r+n):c==="PageDown"?n&&(d=r-n):c==="Home"?d=s:c==="End"&&(d=a),isNaN(d))return;e.preventDefault();let u=Number(d.toFixed(H(o)));this.setValue({[i]:this.clamp(u,i)})}pointerDownHandler(e){if(this.disabled||!_(e))return;let t=e.clientX||e.pageX,i=this.mapToRange(t),a="value";b(this.value)&&(i>=this.minValue&&i<=this.maxValue&&this.lastDragProp==="minMaxValue"?a="minMaxValue":a=Math.abs(this.maxValue-i)<Math.abs(this.minValue-i)||i>=this.maxValue?"maxValue":"minValue"),this.lastDragPropValue=this[a],this.dragStart(a),this.el.shadowRoot.querySelector(`.${l.thumb}:active`)||this.setValue({[a]:this.clamp(i,a)}),this.focusActiveHandle(t)}handleTouchStart(e){e.preventDefault()}buildThumbType(e){let t=[e];return this.labelHandles&&t.push("labeled"),this.precise&&t.push("precise"),this.hasHistogram&&t.push("histogram"),t.join("-")}setValueFromMinMax(){let{minValue:e,maxValue:t}=this;typeof e=="number"&&typeof t=="number"&&(this.value=[e,t])}setMinMaxFromValue(){let{value:e}=this;b(e)&&(this.minValue=e[0],this.maxValue=e[1])}onLabelClick(){this.setFocus()}shouldMirror(){return this.mirrored&&!this.hasHistogram}shouldUseMinValue(){return b(this.value)?this.hasHistogram&&this.maxValue===0||!this.hasHistogram&&this.minValue===0:!1}getTickDensity(){let e=(this.max-this.min)/this.ticks/ne;return e<1?1:e}generateTickValues(){let e=this.ticks??0;if(e<=0)return[];let t=[this.min],i=this.getTickDensity(),a=e*i,s=this.min;for(;s<this.max;)s+=a,t.push(Math.min(s,this.max));return t.includes(this.max)||t.push(this.max),t}onThumbBlur(){this.activeProp=null}onThumbFocus(e){let t=e.currentTarget;this.activeProp=t.getAttribute("data-value-prop")}onThumbPointerDown(e){let t=e.currentTarget;this.pointerDownDragStart(e,t.getAttribute("data-value-prop"))}onTrackPointerDown(e){this.pointerDownDragStart(e,"minMaxValue")}pointerDownDragStart(e,t){_(e)&&this.dragStart(t)}dragStart(e){this.dragProp=e,this.lastDragProp=this.dragProp,this.activeProp=e,window.addEventListener("pointermove",this.dragUpdate),window.addEventListener("pointerup",this.pointerUpDragEnd),window.addEventListener("pointercancel",this.dragEnd)}focusActiveHandle(e){this.dragProp==="minValue"?this.minHandle.focus():this.dragProp==="maxValue"||this.dragProp==="value"?this.maxHandle.focus():this.dragProp==="minMaxValue"&&this.getClosestHandle(e).focus()}emitInput(){this.calciteSliderInput.emit()}emitChange(){this.calciteSliderChange.emit(),this.previousEmittedValue=this.value}removeDragListeners(){window.removeEventListener("pointermove",this.dragUpdate),window.removeEventListener("pointerup",this.pointerUpDragEnd),window.removeEventListener("pointercancel",this.dragEnd)}setValue(e){let t;if(Object.keys(e).forEach(a=>{let s=e[a];t||(t=this[a]!==s),this[a]=s}),!t)return;this.dragProp||this.emitChange(),this.emitInput()}setThumbEl(e){if(!e)return;e.getAttribute("data-value-prop")==="minValue"?this.minHandle=e:this.maxHandle=e}clamp(e,t){return e=se(e,this.min,this.max),t==="maxValue"&&(e=Math.max(e,this.minValue)),t==="minValue"&&(e=Math.min(e,this.maxValue)),e}mapToRange(e){let t=this.max-this.min,{left:i,width:a}=this.trackRef.value.getBoundingClientRect()||{left:0,width:0},s=(e-i)/a,n=this.shouldMirror(),o=this.clamp(this.min+t*(n?1-s:s)),r=Number(o.toFixed(H(this.step)));return this.snap&&this.step?this.getClosestStep(r):r}getClosestStep(e){let{max:t,min:i,step:a}=this,s=new Y(`${Math.floor((e-i)/a)}`).multiply(`${a}`).add(`${i}`).toString(),n=this.clamp(Number(s));return n>t&&(n-=a),n}getClosestHandle(e){return this.getDistanceX(this.maxHandle,e)>this.getDistanceX(this.minHandle,e)?this.minHandle:this.maxHandle}getDistanceX(e,t){return Math.abs(e.getBoundingClientRect().left-t)}getFontSizeForElement(e){return Number(window.getComputedStyle(e).getPropertyValue("font-size").match(/\d+/)[0])}getUnitInterval(e){e=this.clamp(e);let t=this.max-this.min;return(e-this.min)/t}adjustHostObscuredHandleLabel(e){let t=this.el.shadowRoot.querySelector(`.handle__label--${e}`),i=this.el.shadowRoot.querySelector(`.handle__label--${e}.static`),a=this.el.shadowRoot.querySelector(`.handle__label--${e}.transformed`),s=i.getBoundingClientRect(),n=this.getHostOffset(s.left,s.right);t.style.transform=`translateX(${n}px)`,a.style.transform=`translateX(${n}px)`}hyphenateCollidingRangeHandleLabels(){let{shadowRoot:e}=this.el,t=this.shouldMirror(),i=t?"value":"minValue",a=t?"minValue":"value",s=e.querySelector(`.handle__label--${i}`),n=e.querySelector(`.handle__label--${i}.static`),o=e.querySelector(`.handle__label--${i}.transformed`),r=this.getHostOffset(n.getBoundingClientRect().left,n.getBoundingClientRect().right),c=e.querySelector(`.handle__label--${a}`),d=e.querySelector(`.handle__label--${a}.static`),u=e.querySelector(`.handle__label--${a}.transformed`),m=this.getHostOffset(d.getBoundingClientRect().left,d.getBoundingClientRect().right),v=this.getFontSizeForElement(s),f=this.getRangeLabelOverlap(o,u),x=s,g=v/2;if(f>0){if(x.classList.add(l.hyphen,l.hyphenWrap),m===0&&r===0){let h=f/2-g;h=Math.sign(h)===-1?Math.abs(h):-h;let V=this.getHostOffset(o.getBoundingClientRect().left+h-g,o.getBoundingClientRect().right+h-g),y=f/2,w=this.getHostOffset(u.getBoundingClientRect().left+y,u.getBoundingClientRect().right+y);V!==0&&(h+=V,y+=V),w!==0&&(h+=w,y+=w),s.style.transform=`translateX(${h}px)`,o.style.transform=`translateX(${h-g}px)`,c.style.transform=`translateX(${y}px)`,u.style.transform=`translateX(${y}px)`}else if(r>0||m>0)s.style.transform=`translateX(${r+g}px)`,c.style.transform=`translateX(${f+m}px)`,u.style.transform=`translateX(${f+m}px)`;else if(r<0||m<0){let h=Math.abs(r)+f-g;h=Math.sign(h)===-1?Math.abs(h):-h,s.style.transform=`translateX(${h}px)`,o.style.transform=`translateX(${h-g}px)`}}else x.classList.remove(l.hyphen,l.hyphenWrap),s.style.transform=`translateX(${r}px)`,o.style.transform=`translateX(${r}px)`,c.style.transform=`translateX(${m}px)`,u.style.transform=`translateX(${m}px)`}hideObscuredBoundingTickLabels(){let e=b(this.value);if(!this.hasHistogram&&!e&&!this.labelHandles&&!this.precise||!this.hasHistogram&&!e&&this.labelHandles&&!this.precise||!this.hasHistogram&&!e&&!this.labelHandles&&this.precise||!this.hasHistogram&&!e&&this.labelHandles&&this.precise||!this.hasHistogram&&e&&!this.precise||this.hasHistogram&&!this.precise&&!this.labelHandles)return;let t=this.el.shadowRoot.querySelector(`.${l.thumbMinValue}`),i=this.el.shadowRoot.querySelector(`.${l.thumbValue}`),a=this.el.shadowRoot.querySelector(`.${l.tickMin}`),s=this.el.shadowRoot.querySelector(`.${l.tickMax}`);!t&&i&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,i)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,i)?"0":"1"),t&&i&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,t)||this.isMinTickLabelObscured(a,i)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,t)||this.isMaxTickLabelObscured(s,i)&&this.hasHistogram?"0":"1")}getHostOffset(e,t){let{left:i,right:a}=this.el.getBoundingClientRect();return e<i?i-e:t>a?-(t-a):0}getRangeLabelOverlap(e,t){let i=e.getBoundingClientRect(),a=t.getBoundingClientRect(),s=this.getFontSizeForElement(e),n=i.right+s-a.left;return Math.max(n,0)}isMinTickLabelObscured(e,t){let i=e.getBoundingClientRect(),a=t.getBoundingClientRect();return R(i,a)}isMaxTickLabelObscured(e,t){let i=e.getBoundingClientRect(),a=t.getBoundingClientRect();return R(i,a)}internalLabelFormatter(e,t){let i=this.labelFormatter;if(!i)return this.formatValue(e);let a=i(e,t,this.formatValue);return a??this.formatValue(e)}render(){let e=this.el.id||this.guid,t=b(this.value)?this.maxValue:this.value,i=this.minValue||this.min,a=this.shouldUseMinValue(),s=this.getUnitInterval(a?this.minValue:i)*100,n=this.getUnitInterval(t)*100,o=this.shouldMirror(),r=b(this.value),c=this.buildThumbType("max"),d=this.renderThumb({type:c,thumbPlacement:c.includes("histogram")?"below":"above",maxInterval:n,minInterval:s,mirror:o}),u=this.buildThumbType("min"),m=r?this.renderThumb({type:u,thumbPlacement:u.includes("histogram")||u.includes("precise")?"below":"above",maxInterval:n,minInterval:s,mirror:o}):null,v=r?"start":this.fillPlacement,f=v==="none"?{left:"unset",right:"unset"}:v==="end"?{left:`${o?s:n}%`,right:`${o?n:s}%`}:{left:`${o?100-n:s}%`,right:`${o?s:100-n}%`};return O(this.el,"id",e),j({disabled:this.disabled,children:k`${this.labelText&&ae({labelText:this.labelText,onClick:this.onLabelClick,required:this.required,tooltipText:this.messages.required})||""}<div aria-errormessage=${D.validationMessage} .ariaInvalid=${this.status==="invalid"} .ariaLabel=${te(this)} .ariaRequired=${this.required} class=${p({[l.container]:!0,[l.containerRange]:r,[l.scale(this.scale)]:!0})}>${this.renderGraph()}<div class=${p(l.track)} ${T(this.trackRef)}><div class=${p(l.trackRange)} @pointerdown=${this.onTrackPointerDown} style=${M(f)}></div><div class=${p(l.ticks)}>${this.tickValues.map(x=>{let g=`${this.getUnitInterval(x)*100}%`,h=!1;if(v==="start"||v==="end")if(a)h=x>=this.minValue&&x<=this.maxValue;else{let V=v==="start"?i:t,y=v==="start"?t:this.max;h=x>=V&&x<=y}return k`<span class=${p({[l.tick]:!0,[l.tickActive]:h})} style=${M({left:o?"":g,right:o?g:""})}>${this.renderTickLabel(x)}</span>`})}</div></div><div class=${p(l.thumbContainer)}>${m}${d}${J({component:this})}</div></div>${this.validationMessage&&this.status==="invalid"?ie({icon:this.validationIcon,id:D.validationMessage,message:this.validationMessage,scale:this.scale,status:this.status}):null}`})}renderThumb({type:e,mirror:t,thumbPlacement:i,minInterval:a,maxInterval:s}){let n=e.includes("labeled"),o=e.includes("precise"),r=e.includes("min"),c=b(this.value),d=r?this.minValue:c?this.maxValue:this.value,u=r?"minValue":c?"maxValue":"value",m=r?this.minLabel:c?this.maxLabel:this.minLabel,v=r?this.minValue:d,f=u==="minValue"?this.internalLabelFormatter(this.minValue,"min"):u==="maxValue"?this.internalLabelFormatter(this.maxValue,"max"):this.internalLabelFormatter(d,"value"),x=r?{left:`${t?100-a:a}%`}:{right:`${t?s:100-s}%`},g=`${l.handleLabel} ${r?l.handleLabelMinValue:l.handleLabelValue}`,V=[...n?[k`<span aria-hidden=true class=${p(g)}>${f}</span>`,k`<span aria-hidden=true class=${`${g} ${l.static}`}>${f}</span>`,k`<span aria-hidden=true class=${`${g} ${l.transformed}`}>${f}</span>`]:[],k`<div class=${p(l.handle)}></div>`,o&&k`<div class=${p(l.handleExtension)}></div>`||""];return i==="below"&&V.reverse(),I(e,k`<div .ariaLabel=${m} aria-orientation=horizontal .ariaValueMax=${this.max} .ariaValueMin=${this.min} .ariaValueNow=${v} class=${p({[l.thumb]:!0,[l.thumbValue]:!r,[l.thumbActive]:this.lastDragProp!=="minMaxValue"&&this.dragProp===u,[l.thumbPrecise]:o,[l.thumbMinValue]:r})} data-value-prop=${u??C} @blur=${this.onThumbBlur} @focus=${this.onThumbFocus} @pointerdown=${this.onThumbPointerDown} role=slider style=${M(x)} tabindex=0 ${T(this.setThumbEl)}>${V}</div>`)}renderGraph(){return this.histogram?k`<calcite-graph class=${p(l.graph)} .colorStops=${this.histogramStops} .data=${this.histogram} .highlightMax=${b(this.value)?this.maxValue:this.value} .highlightMin=${b(this.value)?this.minValue:this.min} .max=${this.max} .min=${this.min}></calcite-graph>`:null}renderTickLabel(e){let{hasHistogram:t,labelHandles:i,labelTicks:a,max:s,min:n,precise:o,value:r}=this,c=b(r),d=e===n,u=e===s,m=d||u;return a&&(!t&&(m||!o||!c)||t&&(m||!o&&!i))?k`<span class=${p({[l.tickLabel]:!0,[l.tickMin]:d,[l.tickMax]:u})}>${this.internalLabelFormatter(e,"tick")}</span>`:null}};A("calcite-slider",P);export{P as Slider};
|
|
3
|
+
v5.0.0-next.6 */
|
|
4
|
+
import{a as se,b as H}from"./DN6V2M24.js";import{a as Y,k as S}from"./ZOBQ5UTK.js";import{a as ie}from"./JVYKUU2B.js";import{a as ae}from"./6YVXONLB.js";import{c as Z,d as ee,e as te}from"./O72KETNZ.js";import{c as G,e as K,f as W,h as J}from"./OBY2JHHI.js";import{a as N,b as j}from"./UQ4HIO7J.js";import{a as I}from"./7XEO6UJ3.js";import{a as Q}from"./OFO7DXMT.js";import{a as U}from"./CFWXX2ZT.js";import{a as X}from"./SXK4ATVN.js";import"./6PMY6MUE.js";import"./PCGNN5RO.js";import"./H3GTITDX.js";import{p as R,w as _}from"./7DQ4G2FS.js";import{a as q}from"./44XNJNTA.js";import{B,C as T,D as F,E as p,F as M,H as O,I as E,P as A,g as z,h as k,l as C,o as L}from"./2IIGKMQ6.js";var l={container:"container",containerRange:"container--range",graph:"graph",handle:"handle",handleExtension:"handle-extension",handleLabel:"handle__label",handleLabelMinValue:"handle__label--minValue",handleLabelValue:"handle__label--value",hyphen:"hyphen",hyphenWrap:"hyphen--wrap",static:"static",thumb:"thumb",thumbActive:"thumb--active",thumbContainer:"thumb-container",thumbMinValue:"thumb--minValue",thumbPrecise:"thumb--precise",thumbValue:"thumb--value",tick:"tick",tickActive:"tick--active",tickLabel:"tick__label",tickMax:"tick__label--max",tickMin:"tick__label--min",ticks:"ticks",track:"track",trackRange:"track__range",transformed:"transformed",scale:$=>`scale--${$}`},le="calcite-slider",D={validationMessage:"validationMessage",host:$=>`${le}-${$}`},ne=250,re=z`@charset "UTF-8";:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}.scale--s{--calcite-slider-handle-size: .625rem;--calcite-slider-handle-extension-height: .4rem;--calcite-slider-container-font-size: var(--calcite-font-size--3)}.scale--s .handle__label,.scale--s .tick__label{line-height:.75rem}.scale--m{--calcite-slider-handle-size: .875rem;--calcite-slider-handle-extension-height: .5rem;--calcite-slider-container-font-size: var(--calcite-font-size--2)}.scale--m .handle__label,.scale--m .tick__label{line-height:1rem}.scale--l{--calcite-slider-handle-size: 1rem;--calcite-slider-handle-extension-height: .65rem;--calcite-slider-container-font-size: var(--calcite-font-size--1)}.scale--l .handle__label,.scale--l .tick__label{line-height:1rem}.handle__label,.tick__label{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-slider-text-color, var(--calcite-color-text-2));font-size:var(--calcite-slider-container-font-size)}:host{display:block}:host .validation-container{padding-block-start:0!important}.container{position:relative;display:block;overflow-wrap:normal;word-break:normal;padding-inline:calc(var(--calcite-slider-handle-size) * .5);padding-block:calc(var(--calcite-slider-handle-size) * .5);margin-block:calc(var(--calcite-slider-handle-size) * .5);margin-inline:0;--calcite-slider-full-handle-height: calc( var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height) );touch-action:none;-webkit-user-select:none;user-select:none}:host([disabled]) .track__range,:host([disabled]) .tick--active{background-color:var(--calcite-color-text-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset: -.375rem}.scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset: -.5rem}.scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset: -.55rem}:host([precise]:not([has-histogram])) .container .thumb--value{--calcite-slider-thumb-y-offset: calc(var(--calcite-slider-full-handle-height) * -1)}.thumb-container{position:relative;max-inline-size:100%}.thumb{--calcite-slider-thumb-x-offset: calc(var(--calcite-slider-handle-size) * .5);position:absolute;margin:0;display:flex;cursor:pointer;flex-direction:column;align-items:center;border-style:none;background-color:transparent;padding:0;font-family:inherit;outline:2px solid transparent;outline-offset:2px;transform:translate(var(--calcite-slider-thumb-x-offset),var(--calcite-slider-thumb-y-offset))}.thumb .handle__label{white-space:nowrap}.thumb .handle__label.static,.thumb .handle__label.transformed{position:absolute;inset-block:0px;opacity:0}.thumb .handle__label.hyphen:after{content:"—";display:inline-block;inline-size:1em}.thumb .handle__label.hyphen--wrap{display:flex}.thumb .handle{box-sizing:border-box;border-radius:9999px;outline-color:transparent;background-color:var(--calcite-slider-handle-fill-color, var(--calcite-color-foreground-1));block-size:var(--calcite-slider-handle-size);inline-size:var(--calcite-slider-handle-size);box-shadow:0 0 0 2px var(--calcite-color-text-3) inset;transition:border var(--calcite-internal-animation-timing-medium) ease,background-color var(--calcite-internal-animation-timing-medium) ease,box-shadow var(--calcite-animation-timing) ease}.thumb .handle-extension{inline-size:.125rem;block-size:var(--calcite-slider-handle-extension-height);background-color:var(--calcite-slider-handle-extension-color, var(--calcite-color-text-3))}.thumb:hover .handle{box-shadow:0 0 0 3px var(--calcite-color-brand) inset}.thumb:hover .handle-extension{background-color:var(--calcite-slider-accent-color, var(--calcite-color-brand))}.thumb:focus .handle{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline:var(--calcite-border-width-md) solid var(--calcite-internal-color-focus);outline-offset:calc(var(--calcite-spacing-base) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.thumb:focus .handle-extension{background-color:var(--calcite-slider-accent-color, var(--calcite-color-brand))}.thumb.thumb--minValue{transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1),var(--calcite-slider-thumb-y-offset))}.thumb.thumb--precise{--calcite-slider-thumb-y-offset: -.125rem}:host([label-handles]) .thumb{--calcite-slider-thumb-x-offset: 50%}:host([label-handles]):host(:not([has-histogram])) .scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset: -1.4375rem}:host([label-handles]):host(:not([has-histogram])) .scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset: -1.875rem}:host([label-handles]):host(:not([has-histogram])) .scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset: -2rem}:host([has-histogram][label-handles]) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--minValue.thumb--precise .handle__label{margin-block-start:.5em}:host(:not([has-histogram]):not([precise])) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--value .handle__label{margin-block-end:.5em}:host([label-handles][precise]):host(:not([has-histogram])) .scale--s .thumb--value{--calcite-slider-thumb-y-offset: -2.075rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--m .thumb--value{--calcite-slider-thumb-y-offset: -2.75rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--l .thumb--value{--calcite-slider-thumb-y-offset: -3.0625rem}.thumb:focus .handle,.thumb--active .handle{background-color:var(--calcite-slider-accent-color, var(--calcite-color-brand));box-shadow:0 0 8px #00000029}.thumb:hover.thumb--precise:after,.thumb:focus.thumb--precise:after,.thumb--active.thumb--precise:after{background-color:var(--calcite-slider-accent-color, var(--calcite-color-brand))}.track{position:relative;block-size:.125rem;border-radius:0;background-color:var(--calcite-slider-track-color, var(--calcite-color-border-2));transition:all var(--calcite-internal-animation-timing-medium) ease-in}.track__range{position:absolute;inset-block-start:0px;block-size:.125rem;background-color:var(--calcite-slider-track-fill-color, var(--calcite-color-brand))}.container--range .track__range:hover{cursor:ew-resize}.container--range .track__range:after{position:absolute;inline-size:100%;content:"";inset-block-start:calc(var(--calcite-slider-full-handle-height) * .5 * -1);block-size:calc(var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height))}@media(forced-colors:active){.thumb{outline-width:0;outline-offset:0}.handle{outline:2px solid transparent;outline-offset:2px}.thumb:focus .handle,.thumb .handle-extension,.thumb:hover .handle-extension,.thumb:focus .handle-extension,.thumb:active .handle-extension{background-color:canvasText}.track{background-color:canvasText}.track__range{background-color:highlight}}.tick{position:absolute;block-size:.25rem;inline-size:.125rem;border-width:1px;border-style:solid;background-color:var(--calcite-slider-tick-color, var(--calcite-color-border-input));border-color:var(--calcite-slider-tick-border-color, var(--calcite-color-foreground-1));inset-block-start:-2px;pointer-events:none;margin-inline-start:-.125rem}.tick--active{background-color:var(--calcite-slider-tick-selected-color, var(--calcite-color-brand))}.tick__label{pointer-events:none;margin-block-start:.875rem;display:flex;justify-content:center}.tick__label--min{transition:opacity var(--calcite-animation-timing)}.tick__label--max{transition:opacity var(--calcite-internal-animation-timing-fast)}:host([has-histogram][label-handles]) .tick__label--min,:host([has-histogram][label-handles]) .tick__label--max,:host([has-histogram][precise]) .tick__label--min,:host([has-histogram][precise]) .tick__label--max{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-3)}.graph{color:var(--calcite-slider-graph-color, var(--calcite-color-foreground-3));block-size:48px}:host([label-ticks][ticks]) .container{padding-block-end:calc(.875rem + var(--calcite-slider-container-font-size))}:host([has-histogram]):host([precise][label-handles]) .container{padding-block-end:calc(var(--calcite-slider-full-handle-height) + 1em)}:host([has-histogram]):host([label-handles]:not([precise])) .container{padding-block-end:calc(var(--calcite-slider-handle-size) * .5 + 1em)}:host([has-histogram]):host([precise]:not([label-handles])) .container{padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container{padding-block-start:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container--range{padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([label-handles]:not([precise])) .container{padding-block-start:calc(var(--calcite-slider-full-handle-height) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container{padding-block-start:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container--range{padding-block-end:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}.internal-label-alignment--center{align-items:center}.internal-label-alignment--end{align-items:end}.internal-label--container{display:flex;justify-content:space-between;color:var(--calcite-color-text-1)}.internal-label-required--indicator{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-status-danger);padding-inline:var(--calcite-spacing-base)}.internal-label-required--indicator:hover{cursor:help}.internal-label--text{line-height:1}:host([scale=s]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-xxs)}:host([scale=s]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label--text{font-size:var(--calcite-font-size--2)}:host([scale=m]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label--text{font-size:var(--calcite-font-size--1)}:host([scale=l]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=l]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-md)}:host([scale=l]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-md)}:host([scale=l]) .internal-label--text{font-size:var(--calcite-font-size-0)}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:.5rem}:host([scale=s]) .validation-container{padding-block-start:.25rem}::slotted(input[slot=hidden-form-input]){margin:0!important;opacity:0!important;outline:none!important;padding:0!important;position:absolute!important;inset:0!important;transform:none!important;-webkit-appearance:none!important;z-index:-1!important}:host([hidden]){display:none}[hidden]{display:none}`;function b($){return Array.isArray($)}var P=class extends F{constructor(){super(),this.dragEnd=e=>{this.disabled||(this.removeDragListeners(),this.focusActiveHandle(e.clientX),this.lastDragPropValue!=this[this.dragProp]&&this.emitChange(),this.dragProp=null,this.lastDragPropValue=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.minMaxValueRange=null)},this.dragUpdate=e=>{if(!(this.disabled||!this.trackRef.value)&&(e.preventDefault(),this.dragProp)){let t=this.mapToRange(e.clientX||e.pageX);if(b(this.value)&&this.dragProp==="minMaxValue")if(this.minValueDragRange&&this.maxValueDragRange&&this.minMaxValueRange){let i=t-this.minValueDragRange,a=t+this.maxValueDragRange;a<=this.max&&i>=this.min&&a-i===this.minMaxValueRange&&this.setValue({minValue:this.clamp(i,"minValue"),maxValue:this.clamp(a,"maxValue")})}else this.minValueDragRange=t-this.minValue,this.maxValueDragRange=this.maxValue-t,this.minMaxValueRange=this.maxValue-this.minValue;else if(b(this.value)&&b(this.previousEmittedValue)&&this.dragProp==="maxValue"){let[i,a]=this.previousEmittedValue;i===a&&t<i?(this.dragProp="minValue",this.minHandle.focus()):this.setValue({[this.dragProp]:this.clamp(t,this.dragProp)})}else this.setValue({[this.dragProp]:this.clamp(t,this.dragProp)})}},this.formatValue=e=>(S.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},S.localize(e.toString())),this.guid=D.host(q()),this.messages=U(),this.pointerUpDragEnd=e=>{this.disabled||!_(e)||this.dragEnd(e)},this.trackRef=B(),this.focusSetter=X()(this),this.activeProp="value",this.maxValueDragRange=null,this.minMaxValueRange=null,this.minValueDragRange=null,this.tickValues=[],this.disabled=!1,this.fillPlacement="start",this.groupSeparator=!1,this.hasHistogram=!1,this.labelHandles=!1,this.labelTicks=!1,this.max=100,this.min=0,this.mirrored=!1,this.precise=!1,this.required=!1,this.scale="m",this.snap=!1,this.status="idle",this.step=1,this.validity={valid:!1,badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1},this.value=0,this.calciteSliderChange=L({cancelable:!1}),this.calciteSliderInput=L({cancelable:!1}),this.listen("pointerdown",this.pointerDownHandler),this.listen("keydown",this.handleKeyDown),this.listen("touchstart",this.handleTouchStart)}static{this.properties={activeProp:[16,{},{state:!0}],maxValueDragRange:[16,{},{state:!0}],minMaxValueRange:[16,{},{state:!0}],minValueDragRange:[16,{},{state:!0}],tickValues:[16,{},{state:!0}],disabled:[7,{},{reflect:!0,type:Boolean}],fillPlacement:[3,{},{reflect:!0}],form:[3,{},{reflect:!0}],groupSeparator:[7,{},{reflect:!0,type:Boolean}],hasHistogram:[7,{},{reflect:!0,type:Boolean}],histogram:[0,{},{attribute:!1}],histogramStops:[0,{},{attribute:!1}],labelFormatter:[0,{},{attribute:!1}],labelHandles:[7,{},{reflect:!0,type:Boolean}],labelTicks:[7,{},{reflect:!0,type:Boolean}],max:[11,{},{reflect:!0,type:Number}],maxLabel:1,maxValue:[9,{},{type:Number}],min:[11,{},{reflect:!0,type:Number}],minLabel:1,labelText:1,messageOverrides:[0,{},{attribute:!1}],minValue:[9,{},{type:Number}],mirrored:[7,{},{reflect:!0,type:Boolean}],name:[3,{},{reflect:!0}],numberingSystem:1,pageStep:[11,{},{reflect:!0,type:Number}],precise:[7,{},{reflect:!0,type:Boolean}],required:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],snap:[7,{},{reflect:!0,type:Boolean}],status:[3,{},{reflect:!0}],step:[11,{},{reflect:!0,type:Number}],ticks:[11,{},{reflect:!0,type:Number}],validationIcon:[3,{converter:E,type:String},{reflect:!0}],validationMessage:1,validity:[0,{},{attribute:!1}],value:[11,{},{type:Number,reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=re}async setFocus(e){return this.focusSetter(()=>this.minHandle||this.maxHandle,e)}connectedCallback(){super.connectedCallback(),this.setMinMaxFromValue(),this.setValueFromMinMax(),Z(this),G(this),this.previousEmittedValue=this.value}load(){b(this.value)||(this.value=this.snap?this.getClosestStep(this.value):this.clamp(this.value)),W(this,this.value)}willUpdate(e){e.has("histogram")&&(this.hasHistogram=!!this.histogram),e.has("ticks")&&(this.tickValues=this.generateTickValues()),e.has("value")&&(this.hasUpdated||this.value!==0)&&this.setMinMaxFromValue(),(e.has("minValue")||e.has("maxValue"))&&this.setValueFromMinMax()}updated(){this.labelHandles&&(this.adjustHostObscuredHandleLabel("value"),b(this.value)&&(this.adjustHostObscuredHandleLabel("minValue"),this.precise&&!this.hasHistogram||this.hyphenateCollidingRangeHandleLabels())),this.hideObscuredBoundingTickLabels(),N(this)}disconnectedCallback(){super.disconnectedCallback(),ee(this),K(this),this.removeDragListeners()}handleKeyDown(e){let t=this.shouldMirror(),{activeProp:i,max:a,min:s,pageStep:n,step:o}=this,r=this[i],{key:c}=e;if(Q(c)){e.preventDefault();return}let d;if(c==="ArrowUp"||c==="ArrowRight"?d=r+o*(t&&c==="ArrowRight"?-1:1):c==="ArrowDown"||c==="ArrowLeft"?d=r-o*(t&&c==="ArrowLeft"?-1:1):c==="PageUp"?n&&(d=r+n):c==="PageDown"?n&&(d=r-n):c==="Home"?d=s:c==="End"&&(d=a),isNaN(d))return;e.preventDefault();let u=Number(d.toFixed(H(o)));this.setValue({[i]:this.clamp(u,i)})}pointerDownHandler(e){if(this.disabled||!_(e))return;let t=e.clientX||e.pageX,i=this.mapToRange(t),a="value";b(this.value)&&(i>=this.minValue&&i<=this.maxValue&&this.lastDragProp==="minMaxValue"?a="minMaxValue":a=Math.abs(this.maxValue-i)<Math.abs(this.minValue-i)||i>=this.maxValue?"maxValue":"minValue"),this.lastDragPropValue=this[a],this.dragStart(a),this.el.shadowRoot.querySelector(`.${l.thumb}:active`)||this.setValue({[a]:this.clamp(i,a)}),this.focusActiveHandle(t)}handleTouchStart(e){e.preventDefault()}buildThumbType(e){let t=[e];return this.labelHandles&&t.push("labeled"),this.precise&&t.push("precise"),this.hasHistogram&&t.push("histogram"),t.join("-")}setValueFromMinMax(){let{minValue:e,maxValue:t}=this;typeof e=="number"&&typeof t=="number"&&(this.value=[e,t])}setMinMaxFromValue(){let{value:e}=this;b(e)&&(this.minValue=e[0],this.maxValue=e[1])}onLabelClick(){this.setFocus()}shouldMirror(){return this.mirrored&&!this.hasHistogram}shouldUseMinValue(){return b(this.value)?this.hasHistogram&&this.maxValue===0||!this.hasHistogram&&this.minValue===0:!1}getTickDensity(){let e=(this.max-this.min)/this.ticks/ne;return e<1?1:e}generateTickValues(){let e=this.ticks??0;if(e<=0)return[];let t=[this.min],i=this.getTickDensity(),a=e*i,s=this.min;for(;s<this.max;)s+=a,t.push(Math.min(s,this.max));return t.includes(this.max)||t.push(this.max),t}onThumbBlur(){this.activeProp=null}onThumbFocus(e){let t=e.currentTarget;this.activeProp=t.getAttribute("data-value-prop")}onThumbPointerDown(e){let t=e.currentTarget;this.pointerDownDragStart(e,t.getAttribute("data-value-prop"))}onTrackPointerDown(e){this.pointerDownDragStart(e,"minMaxValue")}pointerDownDragStart(e,t){_(e)&&this.dragStart(t)}dragStart(e){this.dragProp=e,this.lastDragProp=this.dragProp,this.activeProp=e,window.addEventListener("pointermove",this.dragUpdate),window.addEventListener("pointerup",this.pointerUpDragEnd),window.addEventListener("pointercancel",this.dragEnd)}focusActiveHandle(e){this.dragProp==="minValue"?this.minHandle.focus():this.dragProp==="maxValue"||this.dragProp==="value"?this.maxHandle.focus():this.dragProp==="minMaxValue"&&this.getClosestHandle(e).focus()}emitInput(){this.calciteSliderInput.emit()}emitChange(){this.calciteSliderChange.emit(),this.previousEmittedValue=this.value}removeDragListeners(){window.removeEventListener("pointermove",this.dragUpdate),window.removeEventListener("pointerup",this.pointerUpDragEnd),window.removeEventListener("pointercancel",this.dragEnd)}setValue(e){let t;if(Object.keys(e).forEach(a=>{let s=e[a];t||(t=this[a]!==s),this[a]=s}),!t)return;this.dragProp||this.emitChange(),this.emitInput()}setThumbEl(e){if(!e)return;e.getAttribute("data-value-prop")==="minValue"?this.minHandle=e:this.maxHandle=e}clamp(e,t){return e=se(e,this.min,this.max),t==="maxValue"&&(e=Math.max(e,this.minValue)),t==="minValue"&&(e=Math.min(e,this.maxValue)),e}mapToRange(e){let t=this.max-this.min,{left:i,width:a}=this.trackRef.value.getBoundingClientRect()||{left:0,width:0},s=(e-i)/a,n=this.shouldMirror(),o=this.clamp(this.min+t*(n?1-s:s)),r=Number(o.toFixed(H(this.step)));return this.snap&&this.step?this.getClosestStep(r):r}getClosestStep(e){let{max:t,min:i,step:a}=this,s=new Y(`${Math.floor((e-i)/a)}`).multiply(`${a}`).add(`${i}`).toString(),n=this.clamp(Number(s));return n>t&&(n-=a),n}getClosestHandle(e){return this.getDistanceX(this.maxHandle,e)>this.getDistanceX(this.minHandle,e)?this.minHandle:this.maxHandle}getDistanceX(e,t){return Math.abs(e.getBoundingClientRect().left-t)}getFontSizeForElement(e){return Number(window.getComputedStyle(e).getPropertyValue("font-size").match(/\d+/)[0])}getUnitInterval(e){e=this.clamp(e);let t=this.max-this.min;return(e-this.min)/t}adjustHostObscuredHandleLabel(e){let t=this.el.shadowRoot.querySelector(`.handle__label--${e}`),i=this.el.shadowRoot.querySelector(`.handle__label--${e}.static`),a=this.el.shadowRoot.querySelector(`.handle__label--${e}.transformed`),s=i.getBoundingClientRect(),n=this.getHostOffset(s.left,s.right);t.style.transform=`translateX(${n}px)`,a.style.transform=`translateX(${n}px)`}hyphenateCollidingRangeHandleLabels(){let{shadowRoot:e}=this.el,t=this.shouldMirror(),i=t?"value":"minValue",a=t?"minValue":"value",s=e.querySelector(`.handle__label--${i}`),n=e.querySelector(`.handle__label--${i}.static`),o=e.querySelector(`.handle__label--${i}.transformed`),r=this.getHostOffset(n.getBoundingClientRect().left,n.getBoundingClientRect().right),c=e.querySelector(`.handle__label--${a}`),d=e.querySelector(`.handle__label--${a}.static`),u=e.querySelector(`.handle__label--${a}.transformed`),m=this.getHostOffset(d.getBoundingClientRect().left,d.getBoundingClientRect().right),v=this.getFontSizeForElement(s),f=this.getRangeLabelOverlap(o,u),x=s,g=v/2;if(f>0){if(x.classList.add(l.hyphen,l.hyphenWrap),m===0&&r===0){let h=f/2-g;h=Math.sign(h)===-1?Math.abs(h):-h;let V=this.getHostOffset(o.getBoundingClientRect().left+h-g,o.getBoundingClientRect().right+h-g),y=f/2,w=this.getHostOffset(u.getBoundingClientRect().left+y,u.getBoundingClientRect().right+y);V!==0&&(h+=V,y+=V),w!==0&&(h+=w,y+=w),s.style.transform=`translateX(${h}px)`,o.style.transform=`translateX(${h-g}px)`,c.style.transform=`translateX(${y}px)`,u.style.transform=`translateX(${y}px)`}else if(r>0||m>0)s.style.transform=`translateX(${r+g}px)`,c.style.transform=`translateX(${f+m}px)`,u.style.transform=`translateX(${f+m}px)`;else if(r<0||m<0){let h=Math.abs(r)+f-g;h=Math.sign(h)===-1?Math.abs(h):-h,s.style.transform=`translateX(${h}px)`,o.style.transform=`translateX(${h-g}px)`}}else x.classList.remove(l.hyphen,l.hyphenWrap),s.style.transform=`translateX(${r}px)`,o.style.transform=`translateX(${r}px)`,c.style.transform=`translateX(${m}px)`,u.style.transform=`translateX(${m}px)`}hideObscuredBoundingTickLabels(){let e=b(this.value);if(!this.hasHistogram&&!e&&!this.labelHandles&&!this.precise||!this.hasHistogram&&!e&&this.labelHandles&&!this.precise||!this.hasHistogram&&!e&&!this.labelHandles&&this.precise||!this.hasHistogram&&!e&&this.labelHandles&&this.precise||!this.hasHistogram&&e&&!this.precise||this.hasHistogram&&!this.precise&&!this.labelHandles)return;let t=this.el.shadowRoot.querySelector(`.${l.thumbMinValue}`),i=this.el.shadowRoot.querySelector(`.${l.thumbValue}`),a=this.el.shadowRoot.querySelector(`.${l.tickMin}`),s=this.el.shadowRoot.querySelector(`.${l.tickMax}`);!t&&i&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,i)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,i)?"0":"1"),t&&i&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,t)||this.isMinTickLabelObscured(a,i)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,t)||this.isMaxTickLabelObscured(s,i)&&this.hasHistogram?"0":"1")}getHostOffset(e,t){let{left:i,right:a}=this.el.getBoundingClientRect();return e<i?i-e:t>a?-(t-a):0}getRangeLabelOverlap(e,t){let i=e.getBoundingClientRect(),a=t.getBoundingClientRect(),s=this.getFontSizeForElement(e),n=i.right+s-a.left;return Math.max(n,0)}isMinTickLabelObscured(e,t){let i=e.getBoundingClientRect(),a=t.getBoundingClientRect();return R(i,a)}isMaxTickLabelObscured(e,t){let i=e.getBoundingClientRect(),a=t.getBoundingClientRect();return R(i,a)}internalLabelFormatter(e,t){let i=this.labelFormatter;if(!i)return this.formatValue(e);let a=i(e,t,this.formatValue);return a??this.formatValue(e)}render(){let e=this.el.id||this.guid,t=b(this.value)?this.maxValue:this.value,i=this.minValue||this.min,a=this.shouldUseMinValue(),s=this.getUnitInterval(a?this.minValue:i)*100,n=this.getUnitInterval(t)*100,o=this.shouldMirror(),r=b(this.value),c=this.buildThumbType("max"),d=this.renderThumb({type:c,thumbPlacement:c.includes("histogram")?"below":"above",maxInterval:n,minInterval:s,mirror:o}),u=this.buildThumbType("min"),m=r?this.renderThumb({type:u,thumbPlacement:u.includes("histogram")||u.includes("precise")?"below":"above",maxInterval:n,minInterval:s,mirror:o}):null,v=r?"start":this.fillPlacement,f=v==="none"?{left:"unset",right:"unset"}:v==="end"?{left:`${o?s:n}%`,right:`${o?n:s}%`}:{left:`${o?100-n:s}%`,right:`${o?s:100-n}%`};return O(this.el,"id",e),j({disabled:this.disabled,children:k`${this.labelText&&ae({labelText:this.labelText,onClick:this.onLabelClick,required:this.required,tooltipText:this.messages.required})||""}<div aria-errormessage=${D.validationMessage} .ariaInvalid=${this.status==="invalid"} .ariaLabel=${te(this)} .ariaRequired=${this.required} class=${p({[l.container]:!0,[l.containerRange]:r,[l.scale(this.scale)]:!0})}>${this.renderGraph()}<div class=${p(l.track)} ${T(this.trackRef)}><div class=${p(l.trackRange)} @pointerdown=${this.onTrackPointerDown} style=${M(f)}></div><div class=${p(l.ticks)}>${this.tickValues.map(x=>{let g=`${this.getUnitInterval(x)*100}%`,h=!1;if(v==="start"||v==="end")if(a)h=x>=this.minValue&&x<=this.maxValue;else{let V=v==="start"?i:t,y=v==="start"?t:this.max;h=x>=V&&x<=y}return k`<span class=${p({[l.tick]:!0,[l.tickActive]:h})} style=${M({left:o?"":g,right:o?g:""})}>${this.renderTickLabel(x)}</span>`})}</div></div><div class=${p(l.thumbContainer)}>${m}${d}${J({component:this})}</div></div>${this.validationMessage&&this.status==="invalid"?ie({icon:this.validationIcon,id:D.validationMessage,message:this.validationMessage,scale:this.scale,status:this.status}):null}`})}renderThumb({type:e,mirror:t,thumbPlacement:i,minInterval:a,maxInterval:s}){let n=e.includes("labeled"),o=e.includes("precise"),r=e.includes("min"),c=b(this.value),d=r?this.minValue:c?this.maxValue:this.value,u=r?"minValue":c?"maxValue":"value",m=r?this.minLabel:c?this.maxLabel:this.minLabel,v=r?this.minValue:d,f=u==="minValue"?this.internalLabelFormatter(this.minValue,"min"):u==="maxValue"?this.internalLabelFormatter(this.maxValue,"max"):this.internalLabelFormatter(d,"value"),x=r?{left:`${t?100-a:a}%`}:{right:`${t?s:100-s}%`},g=`${l.handleLabel} ${r?l.handleLabelMinValue:l.handleLabelValue}`,V=[...n?[k`<span aria-hidden=true class=${p(g)}>${f}</span>`,k`<span aria-hidden=true class=${`${g} ${l.static}`}>${f}</span>`,k`<span aria-hidden=true class=${`${g} ${l.transformed}`}>${f}</span>`]:[],k`<div class=${p(l.handle)}></div>`,o&&k`<div class=${p(l.handleExtension)}></div>`||""];return i==="below"&&V.reverse(),I(e,k`<div .ariaLabel=${m} aria-orientation=horizontal .ariaValueMax=${this.max} .ariaValueMin=${this.min} .ariaValueNow=${v} class=${p({[l.thumb]:!0,[l.thumbValue]:!r,[l.thumbActive]:this.lastDragProp!=="minMaxValue"&&this.dragProp===u,[l.thumbPrecise]:o,[l.thumbMinValue]:r})} data-value-prop=${u??C} @blur=${this.onThumbBlur} @focus=${this.onThumbFocus} @pointerdown=${this.onThumbPointerDown} role=slider style=${M(x)} tabindex=0 ${T(this.setThumbEl)}>${V}</div>`)}renderGraph(){return this.histogram?k`<calcite-graph class=${p(l.graph)} .colorStops=${this.histogramStops} .data=${this.histogram} .highlightMax=${b(this.value)?this.maxValue:this.value} .highlightMin=${b(this.value)?this.minValue:this.min} .max=${this.max} .min=${this.min}></calcite-graph>`:null}renderTickLabel(e){let{hasHistogram:t,labelHandles:i,labelTicks:a,max:s,min:n,precise:o,value:r}=this,c=b(r),d=e===n,u=e===s,m=d||u;return a&&(!t&&(m||!o||!c)||t&&(m||!o&&!i))?k`<span class=${p({[l.tickLabel]:!0,[l.tickMin]:d,[l.tickMax]:u})}>${this.internalLabelFormatter(e,"tick")}</span>`:null}};A("calcite-slider",P);export{P as Slider};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as ce}from"./3PSVZRKA.js";import{a as oe}from"./PWWVHZBN.js";import{a as le,b as w}from"./TCB3D44T.js";import{a as re,b as D,c as l,d as S,g as se,h as c,i as R}from"./CDLGLCFD.js";import{g as Y,h as _,i as j,k as f}from"./RUMWLVIQ.js";import{a as ne}from"./6TAH2TAT.js";import{a as ie}from"./SHXU5GEM.js";import{c as ee,d as te,e as ae}from"./J2ACTXE5.js";import{a as K,c as P,d as Z,e as J,f as Q,g as x,h as X}from"./VLOLYD36.js";import{a as G}from"./6PIHPAZF.js";import{a as H,c as M,e as U,h as q}from"./U3G47NPB.js";import{a as N,b as W}from"./PRB44CR7.js";import"./EQC2JW3I.js";import{b as F}from"./2DX2SAQ7.js";import{a as L}from"./PNBL2IVW.js";import{a as B}from"./HKVRX5SD.js";import"./D5SFHDV6.js";import{a as C}from"./TLLHA7VC.js";import"./VZVYZPXQ.js";import"./Z6CRZOOK.js";import{a as A}from"./XRJOD24G.js";import{B as I,C as h,D as T,E as s,I as z,P as E,g as V,h as m,l as u,o as v}from"./CSQVLDPF.js";var ue=V`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host .menu-container[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}:host .menu-container:popover-open{display:block}:host .menu-container .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}:host .menu-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}:host .menu-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}:host .menu-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}:host .menu-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}:host .menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{:host .menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:0}}:host{position:relative;display:inline-block;width:100%;overflow:visible;vertical-align:top;box-shadow:var(--calcite-input-date-picker-shadow, var(--calcite-shadow-none))}:host .menu-container .calcite-floating-ui-anim{box-shadow:var(--calcite-input-date-picker-calendar-shadow, var(--calcite-shadow-sm))}:host([scale=s]){--calcite-internal-date-picker-toggle-spacing: var(--calcite-spacing-sm);--calcite-internal-input-text-input-padding-inline-end: calc(var(--calcite-internal-date-picker-toggle-spacing) + var(--calcite-spacing-lg))}:host([scale=m]){--calcite-internal-date-picker-toggle-spacing: var(--calcite-spacing-md);--calcite-internal-input-text-input-padding-inline-end: calc(var(--calcite-internal-date-picker-toggle-spacing) + var(--calcite-spacing-xxl))}:host([scale=l]){--calcite-internal-date-picker-toggle-spacing: var(--calcite-spacing-lg);--calcite-internal-input-text-input-padding-inline-end: calc(var(--calcite-internal-date-picker-toggle-spacing) + var(--calcite-spacing-xxxl))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.calendar-wrapper{box-shadow:var(--calcite-input-date-picker-calendar-shadow, var(--calcite-shadow-none));transform:translateZ(0)}.input-wrapper{position:relative}.input-wrapper .chevron-icon{color:var(--calcite-input-date-picker-actions-icon-color, var(--calcite-color-text-3))}.input-wrapper:focus-within .chevron-icon,.input-wrapper:active .chevron-icon,.input-wrapper:hover .chevron-icon{color:var(--calcite-input-date-picker-actions-icon-color-hover, var(--calcite-color-text-1))}.input-wrapper:focus-within~.input-wrapper .chevron-icon,.input-wrapper:active~.input-wrapper .chevron-icon,.input-wrapper:hover~.input-wrapper .chevron-icon{color:var(--calcite-input-date-picker-actions-icon-color-hover, var(--calcite-color-text-1))}.toggle-icon{position:absolute;display:flex;cursor:pointer;align-items:center;inset-inline-end:0;inset-block:0;padding-inline:var(--calcite-internal-date-picker-toggle-spacing)}:host([range]) .container{display:flex}:host([range]) .input-container{display:flex;flex:1 1 auto}:host([range]) .input-wrapper{flex:1 1 auto}.divider-container{display:flex;align-items:stretch;border-width:1px;border-left-width:0px;border-right-width:0px;border-style:solid;background-color:var(--calcite-input-date-picker-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-input-date-picker-border-color, var(--calcite-color-border-input))}:host([layout=horizontal]) .divider-container{inline-size:var(--calcite-spacing-px)}.divider{display:inline-block;margin-block:var(--calcite-spacing-xxs);background-color:var(--calcite-input-date-picker-divider-color, var(--calcite-color-border-2));inline-size:var(--calcite-spacing-px)}:host([layout=vertical]) .divider-container{height:1px;width:100%;border-top-width:0px;border-bottom-width:0px;border-left-width:1px;border-right-width:0px;padding-inline:var(--calcite-spacing-md)}:host([layout=vertical]) .divider-container .divider{margin-top:0;margin-bottom:0;height:1px;width:100%}:host([range][layout=vertical]) .input-wrapper{width:100%}:host([range][layout=vertical]) .input-container{flex-direction:column;align-items:flex-start}.menu-container{--calcite-floating-ui-z-index: var(--calcite-z-index-dropdown);inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0}@starting-style{.menu-container{opacity:0;inset-block-start:0;left:0}}.menu-container[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.menu-container:popover-open{display:block}.menu-container .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}.menu-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.menu-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.menu-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}.menu-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.input .calcite-input__wrapper{margin-top:0}.vertical-chevron-container{display:flex;align-items:center;border-width:1px;border-left-width:0px;border-style:solid;padding-inline:var(--calcite-spacing-md);background-color:var(--calcite-input-date-picker-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-input-date-picker-border-color, var(--calcite-color-border-input))}.vertical-chevron-container calcite-icon{color:var(--calcite-input-date-picker-actions-icon-color, var(--calcite-color-text-3))}.vertical-chevron-container calcite-icon:hover{color:var(--calcite-input-date-picker-actions-icon-color-hover, var(--calcite-color-text-1))}:host([range][layout=vertical][scale=s]) .vertical-chevron-container,:host([range][layout=vertical][scale=s]) .divider-container{padding-inline:var(--calcite-spacing-sm)}:host([range][layout=vertical][scale=l]) .vertical-chevron-container,:host([range][layout=vertical][scale=l]) .divider-container{padding-inline:var(--calcite-spacing-lg)}.container:focus-within .vertical-chevron-container calcite-icon,.container:active .vertical-chevron-container calcite-icon,.container:hover .vertical-chevron-container calcite-icon{color:var(--calcite-input-date-picker-actions-icon-color-hover, var(--calcite-color-text-1))}.input{--calcite-input-text-background-color: var(--calcite-input-date-picker-background-color);--calcite-input-text-border-color: var(--calcite-input-date-picker-border-color);--calcite-input-text-corner-radius: var(--calcite-input-date-picker-corner-radius);--calcite-input-text-shadow: var(--calcite-input-date-picker-shadow);--calcite-input-text-icon-color: var(--calcite-input-date-picker-icon-color);--calcite-input-text-text-color: var(--calcite-input-date-picker-text-color);--calcite-input-text-placeholder-text-color: var(--calcite-input-date-picker-placeholder-text-color)}calcite-date-picker{--calcite-date-picker-border-color: var(--calcite-input-date-picker-calendar-border-color);--calcite-date-picker-corner-radius: var(--calcite-input-date-picker-calendar-corner-radius);--calcite-date-picker-range-calendar-divider-color: var(--calcite-input-date-picker-calendar-range-divider-color);--calcite-date-picker-week-header-text-color: var(--calcite-input-date-picker-calendar-text-color);--calcite-date-picker-header-action-background-color: var( --calcite-input-date-picker-calendar-actions-background-color );--calcite-date-picker-header-action-background-color-hover: var( --calcite-input-date-picker-calendar-actions-background-color-hover );--calcite-date-picker-header-action-background-color-press: var( --calcite-input-date-picker-calendar-actions-background-color-press );--calcite-date-picker-header-action-text-color: var(--calcite-input-date-picker-calendar-actions-text-color);--calcite-date-picker-header-action-text-color-press: var( --calcite-input-date-picker-calendar-actions-text-color-press );--calcite-date-picker-year-text-color: var(--calcite-input-date-picker-calendar-text-color);--calcite-date-picker-month-select-text-color: var(--calcite-input-date-picker-calendar-month-select-text-color);--calcite-date-picker-month-select-icon-color: var(--calcite-input-date-picker-calendar-icon-color);--calcite-date-picker-month-select-icon-color-hover: var(--calcite-input-date-picker-calendar-icon-color-hover);--calcite-date-picker-day-background-color: var(--calcite-input-date-picker-calendar-day-background-color);--calcite-date-picker-day-background-color-hover: var( --calcite-input-date-picker-calendar-day-background-color-hover );--calcite-date-picker-day-background-color-selected: var( --calcite-input-date-picker-calendar-selected-background-color );--calcite-date-picker-day-text-color: var(--calcite-input-date-picker-calendar-day-text-color);--calcite-date-picker-day-text-color-hover: var(--calcite-input-date-picker-calendar-day-text-color-hover);--calcite-date-picker-day-text-color-selected: var(--calcite-input-date-picker-calendar-day-text-color-selected);--calcite-date-picker-current-day-text-color: var( --calcite-input-date-picker-calendar-current-day-text-color, var(--calcite-input-date-picker-calendar-day-current-text-color) );--calcite-date-picker-day-range-text-color: var(--calcite-input-date-picker-calendar-day-range-text-color);--calcite-date-picker-day-range-background-color: var(--calcite-input-date-picker-calendar-selected-background-color);--calcite-date-picker-day-outside-range-background-color-hover: var( --calcite-input-date-picker-calendar-day-outside-range-background-color-hover );--calcite-date-picker-day-outside-range-text-color-hover: var( --calcite-input-date-picker-calendar-day-outside-range-text-color-hover )}.assistive-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:.5rem}:host([scale=s]) .validation-container{padding-block-start:.25rem}::slotted(input[slot=hidden-form-input]){margin:0!important;opacity:0!important;outline:none!important;padding:0!important;position:absolute!important;inset:0!important;transform:none!important;-webkit-appearance:none!important;z-index:-1!important}.internal-label-alignment--center{align-items:center}.internal-label-alignment--end{align-items:end}.internal-label--container{display:flex;justify-content:space-between;color:var(--calcite-color-text-1)}.internal-label-required--indicator{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-status-danger);padding-inline:var(--calcite-spacing-base)}.internal-label-required--indicator:hover{cursor:help}.internal-label--text{line-height:1}:host([scale=s]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-xxs)}:host([scale=s]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label--text{font-size:var(--calcite-font-size--2)}:host([scale=m]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label--text{font-size:var(--calcite-font-size--1)}:host([scale=l]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=l]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-md)}:host([scale=l]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-md)}:host([scale=l]) .internal-label--text{font-size:var(--calcite-font-size-0)}:host([hidden]){display:none}[hidden]{display:none}`,n={assistiveText:"assistive-text",calendarWrapper:"calendar-wrapper",container:"container",dividerContainer:"divider-container",divider:"divider",inputContainer:"input-container",inputNoBottomBorder:"input--no-bottom-border",inputNoRightBorder:"input--no-right-border",inputNoTopBorder:"input--no-top-border",inputNoLeftBorder:"input--no-left-border",inputWrapper:"input-wrapper",input:"input",menu:"menu-container",toggleIcon:"toggle-icon",verticalChevronContainer:"vertical-chevron-container",chevronIcon:"chevron-icon"},he="calcite-input-date-picker",$={validationMessage:"inputDatePickerValidationMessage",dialog:d=>`date-picker-dialog--${d}`,placeholder:d=>`${he}-placeholder-${d}`},de={start:"start",end:"end"},b={calendar:"calendar",chevronDown:"chevron-down",chevronUp:"chevron-up"};function ge(d){if(!d)return!1;let{year:e}=R(d);return Number(e)<100}function me(d){let e=new Date().getFullYear();return Math.floor(e/100)*100+d}var O=class extends T{constructor(){super(),this.commonDateSeparators=[".","-","/"],this.dialogId=$.dialog(A()),this.endInputRef=I(),this.focusOnOpen=!1,this.focusTrap=oe({triggerProp:"open",focusTrapOptions:{onActivate:()=>{this.focusOnOpen&&(this.datePickerEl?.setFocus(),this.focusOnOpen=!1)},allowOutsideClick:!0,clickOutsideDeactivates:!1,initialFocus:!1,setReturnFocus:!1,onDeactivate:()=>{this.open=!1}}})(this),this.transitionProp="opacity",this.placeholderTextId=$.placeholder(A()),this.rangeStartValueChangedByUser=!1,this.startInputRef=I(),this.transitionRef=I(),this.userChangedValue=!1,this._value="",this.valueAsDateChangedExternally=!1,this.messages=L({blocking:!0}),this.focusSetter=B()(this),this.focusedInput="start",this.calendars=2,this.disabled=!1,this.focusTrapDisabled=!1,this.layout="horizontal",this.monthStyle="wide",this.open=!1,this.overlayPositioning="absolute",this.placement=K,this.proximitySelectionDisabled=!1,this.range=!1,this.readOnly=!1,this.required=!1,this.scale="m",this.status="idle",this.validity={valid:!1,badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1},this.calciteInputDatePickerBeforeClose=v({cancelable:!1}),this.calciteInputDatePickerBeforeOpen=v({cancelable:!1}),this.calciteInputDatePickerChange=v({cancelable:!1}),this.calciteInputDatePickerClose=v({cancelable:!1}),this.calciteInputDatePickerOpen=v({cancelable:!1}),this.listen("blur",this.blurHandler),this.listen("keydown",this.keyDownHandler),this.handleDateTimeFormatChange()}static{this.properties={datePickerActiveDate:[16,{},{state:!0}],focusedInput:[16,{},{state:!0}],localeData:[16,{},{state:!0}],calendars:[11,{},{type:Number,reflect:!0}],disabled:[7,{},{reflect:!0,type:Boolean}],flipPlacements:[0,{},{attribute:!1}],focusTrapDisabled:[7,{},{reflect:!0,type:Boolean}],form:[3,{},{reflect:!0}],headingLevel:[11,{},{type:Number,reflect:!0}],label:1,labelText:1,layout:[3,{},{reflect:!0}],max:[3,{},{reflect:!0}],maxAsDate:[0,{},{attribute:!1}],messageOverrides:[0,{},{attribute:!1}],min:[3,{},{reflect:!0}],minAsDate:[0,{},{attribute:!1}],monthStyle:1,name:[3,{},{reflect:!0}],numberingSystem:[3,{},{reflect:!0}],open:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],placement:[3,{},{reflect:!0}],proximitySelectionDisabled:[5,{},{type:Boolean}],range:[7,{},{reflect:!0,type:Boolean}],readOnly:[7,{},{reflect:!0,type:Boolean}],required:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],status:[3,{},{reflect:!0}],validationIcon:[3,{converter:z,type:String},{reflect:!0}],validationMessage:1,validity:[0,{},{attribute:!1}],value:1,valueAsDate:[0,{},{attribute:!1}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=ue}get value(){return this._value}set value(e){let t=e!==this._value,a=e===""&&(this.startInputRef.value?.value!==""||this.endInputRef.value?.value!=="");(t||a)&&(this._value=e,this.valueWatcher(e))}async reposition(e=!1){let{floatingEl:t,referenceEl:a,placement:i,overlayPositioning:r,filteredFlipPlacements:o}=this;return J(this,{floatingEl:t,referenceEl:a,overlayPositioning:r,placement:i,flipPlacements:o,type:"menu"},e)}async setFocus(e){return this.focusSetter(()=>this.el,e)}connectedCallback(){super.connectedCallback();let{open:e}=this;if(e&&this.openHandler(),this.min&&(this.minAsDate=l(this.min)),this.max&&(this.maxAsDate=l(this.max)),Array.isArray(this.value))this.valueAsDate=w(this.value);else if(this.value)try{let t=l(this.value),a=D(t,this.minAsDate,this.maxAsDate);this.valueAsDate=a}catch{this.warnAboutInvalidValue(this.value),this.value=""}else this.valueAsDate&&(this.range&&Array.isArray(this.valueAsDate)?this.value=[c(this.valueAsDate[0]),c(this.valueAsDate[1])]:!this.range&&!Array.isArray(this.valueAsDate)&&(this.value=c(this.valueAsDate)));ee(this),M(this),this.setFilteredPlacements(),f.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.messages._lang,useGrouping:!1},x(this)}async load(){this.handleDateTimeFormatChange(),await this.loadLocaleData(),this.onMinChanged(this.min),this.onMaxChanged(this.max)}willUpdate(e){e.has("disabled")&&(this.hasUpdated||this.disabled!==!1)&&this.handleDisabledAndReadOnlyChange(this.disabled),e.has("readOnly")&&(this.hasUpdated||this.readOnly!==!1)&&this.handleDisabledAndReadOnlyChange(this.readOnly),e.has("valueAsDate")&&this.valueAsDateWatcher(this.valueAsDate),e.has("flipPlacements")&&this.flipPlacementsHandler(),e.has("min")&&this.onMinChanged(this.min),e.has("max")&&this.onMaxChanged(this.max),e.has("open")&&(this.hasUpdated||this.open!==!1)&&this.openHandler(),e.has("overlayPositioning")&&(this.hasUpdated||this.overlayPositioning!=="absolute")&&this.reposition(!0),(e.has("numberingSystem")||e.has("messages"))&&this.handleDateTimeFormatChange(),e.has("layout")&&(this.hasUpdated||this.layout!=="horizontal")&&this.setReferenceEl(),e.has("messages")&&this.loadLocaleData()}updated(){N(this)}loaded(){this.localizeInputValues(),x(this)}disconnectedCallback(){super.disconnectedCallback(),te(this),U(this),X(this)}async handlePopover(){await this.componentOnReady(),this.floatingEl&&(this.open?this.floatingEl.showPopover():this.floatingEl.hidePopover())}handleDisabledAndReadOnlyChange(e){e||(this.open=!1)}valueWatcher(e){if(!this.userChangedValue){let t;Array.isArray(e)?t=w(e):e?t=l(e):t=void 0,!this.valueAsDateChangedExternally&&t!==this.valueAsDate&&(this.valueAsDate=t),this.localizeInputValues()}this.userChangedValue=!1}valueAsDateWatcher(e){let t=Array.isArray(e)?[c(e[0]),c(e[1])]:c(e);this.datePickerActiveDate=Array.isArray(e)?e[0]:e,this.value!==t&&(this.valueAsDateChangedExternally=!0,this.value=t,this.valueAsDateChangedExternally=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMinChanged(e){this.minAsDate=l(e)}onMaxChanged(e){this.maxAsDate=l(e)}openHandler(){G(this),!(this.disabled||this.readOnly)&&(this.reposition(!0),this.handlePopover())}calciteInternalInputInputHandler(e){let t=e.target,a=t.value,i=this.parseNumerals(a),r=this.formatNumerals(i);t.value=r;let{year:o}=se(a,this.localeData);if(o&&o.length<4)return;let p=S(a,this.localeData);re(p,this.min,this.max)&&(this.datePickerActiveDate=p)}calciteInternalInputBlurHandler(){this.commitValue()}handleDateTimeFormatChange(){let e={numberingSystem:Y(this.numberingSystem)};this.dateTimeFormat=new Intl.DateTimeFormat(j(_(this.messages._lang)),e)}setReferenceEl(){let{focusedInput:e,layout:t,endWrapper:a,startWrapper:i}=this;this.referenceEl=e==="end"||t==="vertical"?a||i:i||a,requestAnimationFrame(()=>x(this))}onInputWrapperPointerDown(){this.currentOpenInput=this.focusedInput}onInputWrapperClick(e){let{range:t,endInputRef:a,startInputRef:i,currentOpenInput:r}=this,p=e.currentTarget.getAttribute("data-position");e.composedPath().find(k=>k.classList?.contains(n.toggleIcon))&&(p==="start"?i:a).value.setFocus(),(!t||!this.open||r===p)&&(this.open=!this.open)}setFilteredPlacements(){let{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?Z(t,e):null}onLabelClick(){this.setFocus()}onBeforeOpen(){this.calciteInputDatePickerBeforeOpen.emit()}onOpen(){this.focusTrap.activate(),this.calciteInputDatePickerOpen.emit()}onBeforeClose(){this.calciteInputDatePickerBeforeClose.emit()}onClose(){this.calciteInputDatePickerClose.emit(),Q(this),this.focusTrap.deactivate(),this.focusOnOpen=!1,this.datePickerEl?.reset()}syncHiddenFormInput(e){ce("date",this,e)}blurHandler(){this.open=!1}commitValue(){let{focusedInput:e,value:t}=this,a=this.getInputRef(e),i=S(a.value.value,this.localeData),r=c(i),o=Array.isArray(t);if(this.range){let p=e==="start"?0:1;if(o){if(r===t[p])return;i?(this.setRangeValue([e==="start"?i:l(t[0]),e==="end"?i:l(t[1])]),this.localizeInputValues()):this.setRangeValue([e==="end"&&l(t[0]),e==="start"&&l(t[1])])}else i&&(this.setRangeValue([e==="start"?i:l(t[0]),e==="end"?i:l(t[1])]),this.localizeInputValues())}else{if(r===t)return;this.setValue(i),this.localizeInputValues()}}keyDownHandler(e){let{defaultPrevented:t,key:a}=e;if(t)return;let i=e.composedPath().some(r=>r.tagName==="CALCITE-SELECT");a==="Enter"?(e.preventDefault(),this.commitValue(),this.shouldFocusRangeEnd()?this.endInputRef.value?.setFocus():this.shouldFocusRangeStart()&&this.startInputRef.value?.setFocus(),H(this)&&this.restoreInputFocus(!0)):(a==="ArrowDown"||a==="ArrowUp")&&!i?(this.open=!0,this.focusOnOpen=!0,e.preventDefault()):this.open&&a==="Escape"&&(this.open=!1,e.preventDefault(),this.restoreInputFocus(!0))}startInputFocus(){this.focusedInput="start"}endInputFocus(){this.focusedInput="end"}setFloatingEl(e){this.floatingEl=e,x(this),this.handlePopover()}setStartWrapper(e){this.startWrapper=e,this.setReferenceEl()}setEndWrapper(e){this.endWrapper=e,this.setReferenceEl()}setDatePickerRef(e){this.datePickerEl=e,e&&this.focusTrap.overrideFocusTrapEl(e)}async loadLocaleData(){f.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.messages._lang,useGrouping:!1},this.localeData=await le(this.messages._lang),this.localizeInputValues()}handleDateChange(e){this.range||(e.stopPropagation(),this.setValue(e.target.valueAsDate),this.localizeInputValues(),this.restoreInputFocus())}shouldFocusRangeStart(){let e=this.value[0];return!!(this.value[1]&&!e&&this.focusedInput==="end"&&this.startInputRef)}shouldFocusRangeEnd(){let e=this.value[0],t=this.value[1];return!!(e&&!t&&this.focusedInput==="start"&&this.endInputRef)}handleDateRangeChange(e){if(!this.range)return;e.stopPropagation();let t=e.target.valueAsDate;this.setRangeValue(t),this.localizeInputValues(),this.restoreInputFocus()}restoreInputFocus(e=!1){if(!this.range){this.startInputRef.value.setFocus(),this.open=!1;return}if(e){this.focusInput();return}this.rangeStartValueChangedByUser=this.focusedInput==="start",this.focusedInput="end",!(this.shouldFocusRangeStart()||this.rangeStartValueChangedByUser)&&(this.proximitySelectionDisabled&&this.valueAsDate[1]===null||(this.open=!1,this.focusInput()))}localizeInputValues(){let e=D(this.range?Array.isArray(this.valueAsDate)&&this.valueAsDate[0]||void 0:this.valueAsDate,this.minAsDate,this.maxAsDate),t=this.range?D(Array.isArray(this.valueAsDate)&&this.valueAsDate[1]||void 0,this.minAsDate,this.maxAsDate):null;this.setInputValue((e&&this.dateTimeFormat.format(e))??"","start"),this.setInputValue((this.range&&t&&this.dateTimeFormat.format(t))??"","end")}getInputRef(e="start"){return e==="start"?this.startInputRef:this.endInputRef}setInputValue(e,t="start"){let a=this.getInputRef(t);a.value&&(a.value.value=e)}setRangeValue(e){if(!this.range)return;let{value:t}=this,a=Array.isArray(t),i=Array.isArray(e),r=i?e[0]:null,o=i?c(r):"";o&&(o=this.getNormalizedDate(o));let p=i?e[1]:null,g=i?c(p):"";g&&(g=this.getNormalizedDate(g));let y=o||g?[o,g]:"";if(y===t)return;this.userChangedValue=!0,this.value=y,this.valueAsDate=y?w(y):void 0;let k=this.calciteInputDatePickerChange.emit();k&&k.defaultPrevented&&(this.value=t,a?(this.setInputValue(t[0],"start"),this.setInputValue(t[1],"end")):(this.value=t,this.setInputValue(t)))}setValue(e){if(this.range)return;let t=this.value,a=c(e);if(a=this.getNormalizedDate(a),a===t)return;this.userChangedValue=!0,this.valueAsDate=a?l(a):void 0,this.value=a||"",this.calciteInputDatePickerChange.emit().defaultPrevented&&(this.value=t,this.setInputValue(t))}warnAboutInvalidValue(e){console.warn(`The specified value "${e}" does not conform to the required format, "YYYY-MM-DD".`)}formatNumerals(e){return e?e.split("").map(t=>this.commonDateSeparators?.includes(t)?this.localeData?.separator:F?.includes(t)?f?.numberFormatter?.format(Number(t)):t).join(""):""}parseNumerals(e){return e?e.split("").map(t=>F.includes(t)?f.delocalize(t):t).join(""):""}getNormalizedDate(e){if(!e)return"";if(!ge(e))return e;let{day:t,month:a,year:i}=R(e);return`${me(Number(i))}-${a}-${t}`}focusInput(){(this.focusedInput==="start"?this.startInputRef:this.endInputRef).value.setFocus()}render(){let{disabled:e,messages:{_lang:t},messages:a,numberingSystem:i,readOnly:r}=this;return f.numberFormatOptions={numberingSystem:i,locale:t,useGrouping:!1},W({disabled:this.disabled,children:m`${this.labelText&&ie({labelText:this.labelText,onClick:this.onLabelClick,required:this.required,tooltipText:this.messages.required})||""}<div class=${s(n.container)}><div aria-label=${ae(this)??u} .ariaRequired=${this.required} class=${s(n.inputContainer)} role=group><div class=${s(n.inputWrapper)} data-position=${de.start} @click=${this.onInputWrapperClick} @pointerdown=${this.onInputWrapperPointerDown} ${h(this.setStartWrapper)}><calcite-input-text aria-controls=${this.dialogId??u} aria-describedby=${this.placeholderTextId??u} aria-errormessage=${$.validationMessage} aria-autocomplete=none .ariaExpanded=${this.open} aria-haspopup=dialog .ariaInvalid=${this.status==="invalid"} class=${s({[n.input]:!0,[n.inputNoBottomBorder]:this.layout==="vertical"&&this.range,[n.inputNoRightBorder]:this.range})} .disabled=${e} .icon=${b.calendar} .label=${this.range?this.messages.startDate:this.messages.date} @calciteInputTextInput=${this.calciteInternalInputInputHandler} @calciteInternalInputTextBlur=${this.calciteInternalInputBlurHandler} @calciteInternalInputTextFocus=${this.startInputFocus} .placeholder=${this.localeData?.placeholder} .readOnly=${r} role=combobox .scale=${this.scale} .status=${this.status} ${h(this.startInputRef)}></calcite-input-text>${!this.readOnly&&!this.range&&this.renderToggleIcon(this.open&&this.focusedInput==="start")||""}<span aria-hidden=true class=${s(n.assistiveText)} id=${this.placeholderTextId??u}>${a.dateFormat.replace("{format}",this.localeData?.placeholder)}</span></div><div .ariaHidden=${!this.open} .ariaLabel=${a.chooseDate} aria-live=polite class=${s(n.menu)} id=${this.dialogId??u} popover=manual role=dialog ${h(this.setFloatingEl)}><div class=${s({[n.calendarWrapper]:!0,[P.animation]:!0,[P.animationActive]:this.open})} ${h(this.transitionRef)}><calcite-date-picker .activeDate=${this.datePickerActiveDate} .activeRange=${this.focusedInput} .calendars=${this.calendars} .headingLevel=${this.headingLevel} .layout=${this.layout} .max=${this.max} .maxAsDate=${this.maxAsDate} .messageOverrides=${this.messageOverrides} .min=${this.min} .minAsDate=${this.minAsDate} .monthStyle=${this.monthStyle} .numberingSystem=${i} @calciteDatePickerChange=${this.handleDateChange} @calciteDatePickerRangeChange=${this.handleDateRangeChange} .proximitySelectionDisabled=${this.proximitySelectionDisabled} .range=${this.range} .scale=${this.scale} tabindex=${(this.open?void 0:-1)??u} .valueAsDate=${this.valueAsDate} ${h(this.setDatePickerRef)}></calcite-date-picker></div></div>${this.range&&m`<div class=${s(n.dividerContainer)}><div class=${s(n.divider)}></div></div>`||""}${this.range&&m`<div class=${s(n.inputWrapper)} data-position=${de.end} @click=${this.onInputWrapperClick} @pointerdown=${this.onInputWrapperPointerDown} ${h(this.setEndWrapper)}><calcite-input-text aria-controls=${this.dialogId??u} aria-autocomplete=none .ariaExpanded=${this.open} aria-haspopup=dialog class=${s({[n.input]:!0,[n.inputNoTopBorder]:this.layout==="vertical"&&this.range,[n.inputNoLeftBorder]:this.layout==="horizontal"&&this.range,[n.inputNoRightBorder]:this.layout==="vertical"&&this.range})} .disabled=${e} .icon=${b.calendar} .label=${this.messages.endDate} @calciteInputTextInput=${this.calciteInternalInputInputHandler} @calciteInternalInputTextBlur=${this.calciteInternalInputBlurHandler} @calciteInternalInputTextFocus=${this.endInputFocus} .placeholder=${this.localeData?.placeholder} .readOnly=${r} role=combobox .scale=${this.scale} .status=${this.status} ${h(this.endInputRef)}></calcite-input-text>${!this.readOnly&&this.layout==="horizontal"&&this.renderToggleIcon(this.open)||""}</div>`||""}</div>${this.range&&this.layout==="vertical"&&m`<div class=${s(n.verticalChevronContainer)}><calcite-icon .icon=${this.open?b.chevronUp:b.chevronDown} .scale=${C(this.scale)}></calcite-icon></div>`||""}</div>${q({component:this})}${this.validationMessage&&this.status==="invalid"?ne({icon:this.validationIcon,id:$.validationMessage,message:this.validationMessage,scale:this.scale,status:this.status}):null}`})}renderToggleIcon(e){return m`<span class=${s(n.toggleIcon)} tabindex=-1><calcite-icon class=${s(n.chevronIcon)} .icon=${e?b.chevronUp:b.chevronDown} .scale=${C(this.scale)}></calcite-icon></span>`}};E("calcite-input-date-picker",O);export{O as InputDatePicker};
|
|
3
|
+
v5.0.0-next.6 */
|
|
4
|
+
import{a as ce}from"./H2NP25UI.js";import{a as oe}from"./AANSYYFF.js";import{a as le,b as w}from"./KLLDUBU7.js";import{a as re,b as D,c as l,d as S,g as se,h as c,i as R}from"./MYWUD5PR.js";import{g as Y,h as _,i as j,k as f}from"./ZOBQ5UTK.js";import{a as ne}from"./JVYKUU2B.js";import{a as ie}from"./6YVXONLB.js";import{c as ee,d as te,e as ae}from"./O72KETNZ.js";import{a as K,c as P,d as Z,e as J,f as Q,g as x,h as X}from"./IJDY7EKO.js";import{a as G}from"./LFYXGVGK.js";import{a as H,c as M,e as U,h as q}from"./OBY2JHHI.js";import{a as N,b as W}from"./UQ4HIO7J.js";import"./MPYXWS5E.js";import{b as F}from"./OFO7DXMT.js";import{a as L}from"./CFWXX2ZT.js";import{a as B}from"./SXK4ATVN.js";import"./6PMY6MUE.js";import{a as C}from"./PCGNN5RO.js";import"./H3GTITDX.js";import"./7DQ4G2FS.js";import{a as A}from"./44XNJNTA.js";import{B as I,C as h,D as T,E as s,I as z,P as E,g as V,h as m,l as u,o as v}from"./2IIGKMQ6.js";var ue=V`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host .menu-container[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}:host .menu-container:popover-open{display:block}:host .menu-container .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}:host .menu-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}:host .menu-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}:host .menu-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}:host .menu-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}:host .menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{:host .menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:0}}:host{position:relative;display:inline-block;width:100%;overflow:visible;vertical-align:top;box-shadow:var(--calcite-input-date-picker-shadow, var(--calcite-shadow-none))}:host .menu-container .calcite-floating-ui-anim{box-shadow:var(--calcite-input-date-picker-calendar-shadow, var(--calcite-shadow-sm))}:host([scale=s]){--calcite-internal-date-picker-toggle-spacing: var(--calcite-spacing-sm);--calcite-internal-input-text-input-padding-inline-end: calc(var(--calcite-internal-date-picker-toggle-spacing) + var(--calcite-spacing-lg))}:host([scale=m]){--calcite-internal-date-picker-toggle-spacing: var(--calcite-spacing-md);--calcite-internal-input-text-input-padding-inline-end: calc(var(--calcite-internal-date-picker-toggle-spacing) + var(--calcite-spacing-xxl))}:host([scale=l]){--calcite-internal-date-picker-toggle-spacing: var(--calcite-spacing-lg);--calcite-internal-input-text-input-padding-inline-end: calc(var(--calcite-internal-date-picker-toggle-spacing) + var(--calcite-spacing-xxxl))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.calendar-wrapper{box-shadow:var(--calcite-input-date-picker-calendar-shadow, var(--calcite-shadow-none));transform:translateZ(0)}.input-wrapper{position:relative}.input-wrapper .chevron-icon{color:var(--calcite-input-date-picker-actions-icon-color, var(--calcite-color-text-3))}.input-wrapper:focus-within .chevron-icon,.input-wrapper:active .chevron-icon,.input-wrapper:hover .chevron-icon{color:var(--calcite-input-date-picker-actions-icon-color-hover, var(--calcite-color-text-1))}.input-wrapper:focus-within~.input-wrapper .chevron-icon,.input-wrapper:active~.input-wrapper .chevron-icon,.input-wrapper:hover~.input-wrapper .chevron-icon{color:var(--calcite-input-date-picker-actions-icon-color-hover, var(--calcite-color-text-1))}.toggle-icon{position:absolute;display:flex;cursor:pointer;align-items:center;inset-inline-end:0;inset-block:0;padding-inline:var(--calcite-internal-date-picker-toggle-spacing)}:host([range]) .container{display:flex}:host([range]) .input-container{display:flex;flex:1 1 auto}:host([range]) .input-wrapper{flex:1 1 auto}.divider-container{display:flex;align-items:stretch;border-width:1px;border-left-width:0px;border-right-width:0px;border-style:solid;background-color:var(--calcite-input-date-picker-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-input-date-picker-border-color, var(--calcite-color-border-input))}:host([layout=horizontal]) .divider-container{inline-size:var(--calcite-spacing-px)}.divider{display:inline-block;margin-block:var(--calcite-spacing-xxs);background-color:var(--calcite-input-date-picker-divider-color, var(--calcite-color-border-2));inline-size:var(--calcite-spacing-px)}:host([layout=vertical]) .divider-container{height:1px;width:100%;border-top-width:0px;border-bottom-width:0px;border-left-width:1px;border-right-width:0px;padding-inline:var(--calcite-spacing-md)}:host([layout=vertical]) .divider-container .divider{margin-top:0;margin-bottom:0;height:1px;width:100%}:host([range][layout=vertical]) .input-wrapper{width:100%}:host([range][layout=vertical]) .input-container{flex-direction:column;align-items:flex-start}.menu-container{--calcite-floating-ui-z-index: var(--calcite-z-index-dropdown);inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0}@starting-style{.menu-container{opacity:0;inset-block-start:0;left:0}}.menu-container[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.menu-container:popover-open{display:block}.menu-container .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}.menu-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.menu-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.menu-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}.menu-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.input .calcite-input__wrapper{margin-top:0}.vertical-chevron-container{display:flex;align-items:center;border-width:1px;border-left-width:0px;border-style:solid;padding-inline:var(--calcite-spacing-md);background-color:var(--calcite-input-date-picker-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-input-date-picker-border-color, var(--calcite-color-border-input))}.vertical-chevron-container calcite-icon{color:var(--calcite-input-date-picker-actions-icon-color, var(--calcite-color-text-3))}.vertical-chevron-container calcite-icon:hover{color:var(--calcite-input-date-picker-actions-icon-color-hover, var(--calcite-color-text-1))}:host([range][layout=vertical][scale=s]) .vertical-chevron-container,:host([range][layout=vertical][scale=s]) .divider-container{padding-inline:var(--calcite-spacing-sm)}:host([range][layout=vertical][scale=l]) .vertical-chevron-container,:host([range][layout=vertical][scale=l]) .divider-container{padding-inline:var(--calcite-spacing-lg)}.container:focus-within .vertical-chevron-container calcite-icon,.container:active .vertical-chevron-container calcite-icon,.container:hover .vertical-chevron-container calcite-icon{color:var(--calcite-input-date-picker-actions-icon-color-hover, var(--calcite-color-text-1))}.input{--calcite-input-text-background-color: var(--calcite-input-date-picker-background-color);--calcite-input-text-border-color: var(--calcite-input-date-picker-border-color);--calcite-input-text-corner-radius: var(--calcite-input-date-picker-corner-radius);--calcite-input-text-shadow: var(--calcite-input-date-picker-shadow);--calcite-input-text-icon-color: var(--calcite-input-date-picker-icon-color);--calcite-input-text-text-color: var(--calcite-input-date-picker-text-color);--calcite-input-text-placeholder-text-color: var(--calcite-input-date-picker-placeholder-text-color)}calcite-date-picker{--calcite-date-picker-border-color: var(--calcite-input-date-picker-calendar-border-color);--calcite-date-picker-corner-radius: var(--calcite-input-date-picker-calendar-corner-radius);--calcite-date-picker-range-calendar-divider-color: var(--calcite-input-date-picker-calendar-range-divider-color);--calcite-date-picker-week-header-text-color: var(--calcite-input-date-picker-calendar-text-color);--calcite-date-picker-header-action-background-color: var( --calcite-input-date-picker-calendar-actions-background-color );--calcite-date-picker-header-action-background-color-hover: var( --calcite-input-date-picker-calendar-actions-background-color-hover );--calcite-date-picker-header-action-background-color-press: var( --calcite-input-date-picker-calendar-actions-background-color-press );--calcite-date-picker-header-action-text-color: var(--calcite-input-date-picker-calendar-actions-text-color);--calcite-date-picker-header-action-text-color-press: var( --calcite-input-date-picker-calendar-actions-text-color-press );--calcite-date-picker-year-text-color: var(--calcite-input-date-picker-calendar-text-color);--calcite-date-picker-month-select-text-color: var(--calcite-input-date-picker-calendar-month-select-text-color);--calcite-date-picker-month-select-icon-color: var(--calcite-input-date-picker-calendar-icon-color);--calcite-date-picker-month-select-icon-color-hover: var(--calcite-input-date-picker-calendar-icon-color-hover);--calcite-date-picker-day-background-color: var(--calcite-input-date-picker-calendar-day-background-color);--calcite-date-picker-day-background-color-hover: var( --calcite-input-date-picker-calendar-day-background-color-hover );--calcite-date-picker-day-background-color-selected: var( --calcite-input-date-picker-calendar-selected-background-color );--calcite-date-picker-day-text-color: var(--calcite-input-date-picker-calendar-day-text-color);--calcite-date-picker-day-text-color-hover: var(--calcite-input-date-picker-calendar-day-text-color-hover);--calcite-date-picker-day-text-color-selected: var(--calcite-input-date-picker-calendar-day-text-color-selected);--calcite-date-picker-current-day-text-color: var( --calcite-input-date-picker-calendar-current-day-text-color, var(--calcite-input-date-picker-calendar-day-current-text-color) );--calcite-date-picker-day-range-text-color: var(--calcite-input-date-picker-calendar-day-range-text-color);--calcite-date-picker-day-range-background-color: var(--calcite-input-date-picker-calendar-selected-background-color);--calcite-date-picker-day-outside-range-background-color-hover: var( --calcite-input-date-picker-calendar-day-outside-range-background-color-hover );--calcite-date-picker-day-outside-range-text-color-hover: var( --calcite-input-date-picker-calendar-day-outside-range-text-color-hover )}.assistive-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:.5rem}:host([scale=s]) .validation-container{padding-block-start:.25rem}::slotted(input[slot=hidden-form-input]){margin:0!important;opacity:0!important;outline:none!important;padding:0!important;position:absolute!important;inset:0!important;transform:none!important;-webkit-appearance:none!important;z-index:-1!important}.internal-label-alignment--center{align-items:center}.internal-label-alignment--end{align-items:end}.internal-label--container{display:flex;justify-content:space-between;color:var(--calcite-color-text-1)}.internal-label-required--indicator{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-status-danger);padding-inline:var(--calcite-spacing-base)}.internal-label-required--indicator:hover{cursor:help}.internal-label--text{line-height:1}:host([scale=s]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-xxs)}:host([scale=s]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label--text{font-size:var(--calcite-font-size--2)}:host([scale=m]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label--text{font-size:var(--calcite-font-size--1)}:host([scale=l]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=l]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-md)}:host([scale=l]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-md)}:host([scale=l]) .internal-label--text{font-size:var(--calcite-font-size-0)}:host([hidden]){display:none}[hidden]{display:none}`,n={assistiveText:"assistive-text",calendarWrapper:"calendar-wrapper",container:"container",dividerContainer:"divider-container",divider:"divider",inputContainer:"input-container",inputNoBottomBorder:"input--no-bottom-border",inputNoRightBorder:"input--no-right-border",inputNoTopBorder:"input--no-top-border",inputNoLeftBorder:"input--no-left-border",inputWrapper:"input-wrapper",input:"input",menu:"menu-container",toggleIcon:"toggle-icon",verticalChevronContainer:"vertical-chevron-container",chevronIcon:"chevron-icon"},he="calcite-input-date-picker",$={validationMessage:"inputDatePickerValidationMessage",dialog:d=>`date-picker-dialog--${d}`,placeholder:d=>`${he}-placeholder-${d}`},de={start:"start",end:"end"},b={calendar:"calendar",chevronDown:"chevron-down",chevronUp:"chevron-up"};function ge(d){if(!d)return!1;let{year:e}=R(d);return Number(e)<100}function me(d){let e=new Date().getFullYear();return Math.floor(e/100)*100+d}var O=class extends T{constructor(){super(),this.commonDateSeparators=[".","-","/"],this.dialogId=$.dialog(A()),this.endInputRef=I(),this.focusOnOpen=!1,this.focusTrap=oe({triggerProp:"open",focusTrapOptions:{onActivate:()=>{this.focusOnOpen&&(this.datePickerEl?.setFocus(),this.focusOnOpen=!1)},allowOutsideClick:!0,clickOutsideDeactivates:!1,initialFocus:!1,setReturnFocus:!1,onDeactivate:()=>{this.open=!1}}})(this),this.transitionProp="opacity",this.placeholderTextId=$.placeholder(A()),this.rangeStartValueChangedByUser=!1,this.startInputRef=I(),this.transitionRef=I(),this.userChangedValue=!1,this._value="",this.valueAsDateChangedExternally=!1,this.messages=L({blocking:!0}),this.focusSetter=B()(this),this.focusedInput="start",this.calendars=2,this.disabled=!1,this.focusTrapDisabled=!1,this.layout="horizontal",this.monthStyle="wide",this.open=!1,this.overlayPositioning="absolute",this.placement=K,this.proximitySelectionDisabled=!1,this.range=!1,this.readOnly=!1,this.required=!1,this.scale="m",this.status="idle",this.validity={valid:!1,badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1},this.calciteInputDatePickerBeforeClose=v({cancelable:!1}),this.calciteInputDatePickerBeforeOpen=v({cancelable:!1}),this.calciteInputDatePickerChange=v({cancelable:!1}),this.calciteInputDatePickerClose=v({cancelable:!1}),this.calciteInputDatePickerOpen=v({cancelable:!1}),this.listen("blur",this.blurHandler),this.listen("keydown",this.keyDownHandler),this.handleDateTimeFormatChange()}static{this.properties={datePickerActiveDate:[16,{},{state:!0}],focusedInput:[16,{},{state:!0}],localeData:[16,{},{state:!0}],calendars:[11,{},{type:Number,reflect:!0}],disabled:[7,{},{reflect:!0,type:Boolean}],flipPlacements:[0,{},{attribute:!1}],focusTrapDisabled:[7,{},{reflect:!0,type:Boolean}],form:[3,{},{reflect:!0}],headingLevel:[11,{},{type:Number,reflect:!0}],label:1,labelText:1,layout:[3,{},{reflect:!0}],max:[3,{},{reflect:!0}],maxAsDate:[0,{},{attribute:!1}],messageOverrides:[0,{},{attribute:!1}],min:[3,{},{reflect:!0}],minAsDate:[0,{},{attribute:!1}],monthStyle:1,name:[3,{},{reflect:!0}],numberingSystem:[3,{},{reflect:!0}],open:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],placement:[3,{},{reflect:!0}],proximitySelectionDisabled:[5,{},{type:Boolean}],range:[7,{},{reflect:!0,type:Boolean}],readOnly:[7,{},{reflect:!0,type:Boolean}],required:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],status:[3,{},{reflect:!0}],validationIcon:[3,{converter:z,type:String},{reflect:!0}],validationMessage:1,validity:[0,{},{attribute:!1}],value:1,valueAsDate:[0,{},{attribute:!1}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=ue}get value(){return this._value}set value(e){let t=e!==this._value,a=e===""&&(this.startInputRef.value?.value!==""||this.endInputRef.value?.value!=="");(t||a)&&(this._value=e,this.valueWatcher(e))}async reposition(e=!1){let{floatingEl:t,referenceEl:a,placement:i,overlayPositioning:r,filteredFlipPlacements:o}=this;return J(this,{floatingEl:t,referenceEl:a,overlayPositioning:r,placement:i,flipPlacements:o,type:"menu"},e)}async setFocus(e){return this.focusSetter(()=>this.el,e)}connectedCallback(){super.connectedCallback();let{open:e}=this;if(e&&this.openHandler(),this.min&&(this.minAsDate=l(this.min)),this.max&&(this.maxAsDate=l(this.max)),Array.isArray(this.value))this.valueAsDate=w(this.value);else if(this.value)try{let t=l(this.value),a=D(t,this.minAsDate,this.maxAsDate);this.valueAsDate=a}catch{this.warnAboutInvalidValue(this.value),this.value=""}else this.valueAsDate&&(this.range&&Array.isArray(this.valueAsDate)?this.value=[c(this.valueAsDate[0]),c(this.valueAsDate[1])]:!this.range&&!Array.isArray(this.valueAsDate)&&(this.value=c(this.valueAsDate)));ee(this),M(this),this.setFilteredPlacements(),f.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.messages._lang,useGrouping:!1},x(this)}async load(){this.handleDateTimeFormatChange(),await this.loadLocaleData(),this.onMinChanged(this.min),this.onMaxChanged(this.max)}willUpdate(e){e.has("disabled")&&(this.hasUpdated||this.disabled!==!1)&&this.handleDisabledAndReadOnlyChange(this.disabled),e.has("readOnly")&&(this.hasUpdated||this.readOnly!==!1)&&this.handleDisabledAndReadOnlyChange(this.readOnly),e.has("valueAsDate")&&this.valueAsDateWatcher(this.valueAsDate),e.has("flipPlacements")&&this.flipPlacementsHandler(),e.has("min")&&this.onMinChanged(this.min),e.has("max")&&this.onMaxChanged(this.max),e.has("open")&&(this.hasUpdated||this.open!==!1)&&this.openHandler(),e.has("overlayPositioning")&&(this.hasUpdated||this.overlayPositioning!=="absolute")&&this.reposition(!0),(e.has("numberingSystem")||e.has("messages"))&&this.handleDateTimeFormatChange(),e.has("layout")&&(this.hasUpdated||this.layout!=="horizontal")&&this.setReferenceEl(),e.has("messages")&&this.loadLocaleData()}updated(){N(this)}loaded(){this.localizeInputValues(),x(this)}disconnectedCallback(){super.disconnectedCallback(),te(this),U(this),X(this)}async handlePopover(){await this.componentOnReady(),this.floatingEl&&(this.open?this.floatingEl.showPopover():this.floatingEl.hidePopover())}handleDisabledAndReadOnlyChange(e){e||(this.open=!1)}valueWatcher(e){if(!this.userChangedValue){let t;Array.isArray(e)?t=w(e):e?t=l(e):t=void 0,!this.valueAsDateChangedExternally&&t!==this.valueAsDate&&(this.valueAsDate=t),this.localizeInputValues()}this.userChangedValue=!1}valueAsDateWatcher(e){let t=Array.isArray(e)?[c(e[0]),c(e[1])]:c(e);this.datePickerActiveDate=Array.isArray(e)?e[0]:e,this.value!==t&&(this.valueAsDateChangedExternally=!0,this.value=t,this.valueAsDateChangedExternally=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMinChanged(e){this.minAsDate=l(e)}onMaxChanged(e){this.maxAsDate=l(e)}openHandler(){G(this),!(this.disabled||this.readOnly)&&(this.reposition(!0),this.handlePopover())}calciteInternalInputInputHandler(e){let t=e.target,a=t.value,i=this.parseNumerals(a),r=this.formatNumerals(i);t.value=r;let{year:o}=se(a,this.localeData);if(o&&o.length<4)return;let p=S(a,this.localeData);re(p,this.min,this.max)&&(this.datePickerActiveDate=p)}calciteInternalInputBlurHandler(){this.commitValue()}handleDateTimeFormatChange(){let e={numberingSystem:Y(this.numberingSystem)};this.dateTimeFormat=new Intl.DateTimeFormat(j(_(this.messages._lang)),e)}setReferenceEl(){let{focusedInput:e,layout:t,endWrapper:a,startWrapper:i}=this;this.referenceEl=e==="end"||t==="vertical"?a||i:i||a,requestAnimationFrame(()=>x(this))}onInputWrapperPointerDown(){this.currentOpenInput=this.focusedInput}onInputWrapperClick(e){let{range:t,endInputRef:a,startInputRef:i,currentOpenInput:r}=this,p=e.currentTarget.getAttribute("data-position");e.composedPath().find(k=>k.classList?.contains(n.toggleIcon))&&(p==="start"?i:a).value.setFocus(),(!t||!this.open||r===p)&&(this.open=!this.open)}setFilteredPlacements(){let{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?Z(t,e):null}onLabelClick(){this.setFocus()}onBeforeOpen(){this.calciteInputDatePickerBeforeOpen.emit()}onOpen(){this.focusTrap.activate(),this.calciteInputDatePickerOpen.emit()}onBeforeClose(){this.calciteInputDatePickerBeforeClose.emit()}onClose(){this.calciteInputDatePickerClose.emit(),Q(this),this.focusTrap.deactivate(),this.focusOnOpen=!1,this.datePickerEl?.reset()}syncHiddenFormInput(e){ce("date",this,e)}blurHandler(){this.open=!1}commitValue(){let{focusedInput:e,value:t}=this,a=this.getInputRef(e),i=S(a.value.value,this.localeData),r=c(i),o=Array.isArray(t);if(this.range){let p=e==="start"?0:1;if(o){if(r===t[p])return;i?(this.setRangeValue([e==="start"?i:l(t[0]),e==="end"?i:l(t[1])]),this.localizeInputValues()):this.setRangeValue([e==="end"&&l(t[0]),e==="start"&&l(t[1])])}else i&&(this.setRangeValue([e==="start"?i:l(t[0]),e==="end"?i:l(t[1])]),this.localizeInputValues())}else{if(r===t)return;this.setValue(i),this.localizeInputValues()}}keyDownHandler(e){let{defaultPrevented:t,key:a}=e;if(t)return;let i=e.composedPath().some(r=>r.tagName==="CALCITE-SELECT");a==="Enter"?(e.preventDefault(),this.commitValue(),this.shouldFocusRangeEnd()?this.endInputRef.value?.setFocus():this.shouldFocusRangeStart()&&this.startInputRef.value?.setFocus(),H(this)&&this.restoreInputFocus(!0)):(a==="ArrowDown"||a==="ArrowUp")&&!i?(this.open=!0,this.focusOnOpen=!0,e.preventDefault()):this.open&&a==="Escape"&&(this.open=!1,e.preventDefault(),this.restoreInputFocus(!0))}startInputFocus(){this.focusedInput="start"}endInputFocus(){this.focusedInput="end"}setFloatingEl(e){this.floatingEl=e,x(this),this.handlePopover()}setStartWrapper(e){this.startWrapper=e,this.setReferenceEl()}setEndWrapper(e){this.endWrapper=e,this.setReferenceEl()}setDatePickerRef(e){this.datePickerEl=e,e&&this.focusTrap.overrideFocusTrapEl(e)}async loadLocaleData(){f.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.messages._lang,useGrouping:!1},this.localeData=await le(this.messages._lang),this.localizeInputValues()}handleDateChange(e){this.range||(e.stopPropagation(),this.setValue(e.target.valueAsDate),this.localizeInputValues(),this.restoreInputFocus())}shouldFocusRangeStart(){let e=this.value[0];return!!(this.value[1]&&!e&&this.focusedInput==="end"&&this.startInputRef)}shouldFocusRangeEnd(){let e=this.value[0],t=this.value[1];return!!(e&&!t&&this.focusedInput==="start"&&this.endInputRef)}handleDateRangeChange(e){if(!this.range)return;e.stopPropagation();let t=e.target.valueAsDate;this.setRangeValue(t),this.localizeInputValues(),this.restoreInputFocus()}restoreInputFocus(e=!1){if(!this.range){this.startInputRef.value.setFocus(),this.open=!1;return}if(e){this.focusInput();return}this.rangeStartValueChangedByUser=this.focusedInput==="start",this.focusedInput="end",!(this.shouldFocusRangeStart()||this.rangeStartValueChangedByUser)&&(this.proximitySelectionDisabled&&this.valueAsDate[1]===null||(this.open=!1,this.focusInput()))}localizeInputValues(){let e=D(this.range?Array.isArray(this.valueAsDate)&&this.valueAsDate[0]||void 0:this.valueAsDate,this.minAsDate,this.maxAsDate),t=this.range?D(Array.isArray(this.valueAsDate)&&this.valueAsDate[1]||void 0,this.minAsDate,this.maxAsDate):null;this.setInputValue((e&&this.dateTimeFormat.format(e))??"","start"),this.setInputValue((this.range&&t&&this.dateTimeFormat.format(t))??"","end")}getInputRef(e="start"){return e==="start"?this.startInputRef:this.endInputRef}setInputValue(e,t="start"){let a=this.getInputRef(t);a.value&&(a.value.value=e)}setRangeValue(e){if(!this.range)return;let{value:t}=this,a=Array.isArray(t),i=Array.isArray(e),r=i?e[0]:null,o=i?c(r):"";o&&(o=this.getNormalizedDate(o));let p=i?e[1]:null,g=i?c(p):"";g&&(g=this.getNormalizedDate(g));let y=o||g?[o,g]:"";if(y===t)return;this.userChangedValue=!0,this.value=y,this.valueAsDate=y?w(y):void 0;let k=this.calciteInputDatePickerChange.emit();k&&k.defaultPrevented&&(this.value=t,a?(this.setInputValue(t[0],"start"),this.setInputValue(t[1],"end")):(this.value=t,this.setInputValue(t)))}setValue(e){if(this.range)return;let t=this.value,a=c(e);if(a=this.getNormalizedDate(a),a===t)return;this.userChangedValue=!0,this.valueAsDate=a?l(a):void 0,this.value=a||"",this.calciteInputDatePickerChange.emit().defaultPrevented&&(this.value=t,this.setInputValue(t))}warnAboutInvalidValue(e){console.warn(`The specified value "${e}" does not conform to the required format, "YYYY-MM-DD".`)}formatNumerals(e){return e?e.split("").map(t=>this.commonDateSeparators?.includes(t)?this.localeData?.separator:F?.includes(t)?f?.numberFormatter?.format(Number(t)):t).join(""):""}parseNumerals(e){return e?e.split("").map(t=>F.includes(t)?f.delocalize(t):t).join(""):""}getNormalizedDate(e){if(!e)return"";if(!ge(e))return e;let{day:t,month:a,year:i}=R(e);return`${me(Number(i))}-${a}-${t}`}focusInput(){(this.focusedInput==="start"?this.startInputRef:this.endInputRef).value.setFocus()}render(){let{disabled:e,messages:{_lang:t},messages:a,numberingSystem:i,readOnly:r}=this;return f.numberFormatOptions={numberingSystem:i,locale:t,useGrouping:!1},W({disabled:this.disabled,children:m`${this.labelText&&ie({labelText:this.labelText,onClick:this.onLabelClick,required:this.required,tooltipText:this.messages.required})||""}<div class=${s(n.container)}><div aria-label=${ae(this)??u} .ariaRequired=${this.required} class=${s(n.inputContainer)} role=group><div class=${s(n.inputWrapper)} data-position=${de.start} @click=${this.onInputWrapperClick} @pointerdown=${this.onInputWrapperPointerDown} ${h(this.setStartWrapper)}><calcite-input-text aria-controls=${this.dialogId??u} aria-describedby=${this.placeholderTextId??u} aria-errormessage=${$.validationMessage} aria-autocomplete=none .ariaExpanded=${this.open} aria-haspopup=dialog .ariaInvalid=${this.status==="invalid"} class=${s({[n.input]:!0,[n.inputNoBottomBorder]:this.layout==="vertical"&&this.range,[n.inputNoRightBorder]:this.range})} .disabled=${e} .icon=${b.calendar} .label=${this.range?this.messages.startDate:this.messages.date} @calciteInputTextInput=${this.calciteInternalInputInputHandler} @calciteInternalInputTextBlur=${this.calciteInternalInputBlurHandler} @calciteInternalInputTextFocus=${this.startInputFocus} .placeholder=${this.localeData?.placeholder} .readOnly=${r} role=combobox .scale=${this.scale} .status=${this.status} ${h(this.startInputRef)}></calcite-input-text>${!this.readOnly&&!this.range&&this.renderToggleIcon(this.open&&this.focusedInput==="start")||""}<span aria-hidden=true class=${s(n.assistiveText)} id=${this.placeholderTextId??u}>${a.dateFormat.replace("{format}",this.localeData?.placeholder)}</span></div><div .ariaHidden=${!this.open} .ariaLabel=${a.chooseDate} aria-live=polite class=${s(n.menu)} id=${this.dialogId??u} popover=manual role=dialog ${h(this.setFloatingEl)}><div class=${s({[n.calendarWrapper]:!0,[P.animation]:!0,[P.animationActive]:this.open})} ${h(this.transitionRef)}><calcite-date-picker .activeDate=${this.datePickerActiveDate} .activeRange=${this.focusedInput} .calendars=${this.calendars} .headingLevel=${this.headingLevel} .layout=${this.layout} .max=${this.max} .maxAsDate=${this.maxAsDate} .messageOverrides=${this.messageOverrides} .min=${this.min} .minAsDate=${this.minAsDate} .monthStyle=${this.monthStyle} .numberingSystem=${i} @calciteDatePickerChange=${this.handleDateChange} @calciteDatePickerRangeChange=${this.handleDateRangeChange} .proximitySelectionDisabled=${this.proximitySelectionDisabled} .range=${this.range} .scale=${this.scale} tabindex=${(this.open?void 0:-1)??u} .valueAsDate=${this.valueAsDate} ${h(this.setDatePickerRef)}></calcite-date-picker></div></div>${this.range&&m`<div class=${s(n.dividerContainer)}><div class=${s(n.divider)}></div></div>`||""}${this.range&&m`<div class=${s(n.inputWrapper)} data-position=${de.end} @click=${this.onInputWrapperClick} @pointerdown=${this.onInputWrapperPointerDown} ${h(this.setEndWrapper)}><calcite-input-text aria-controls=${this.dialogId??u} aria-autocomplete=none .ariaExpanded=${this.open} aria-haspopup=dialog class=${s({[n.input]:!0,[n.inputNoTopBorder]:this.layout==="vertical"&&this.range,[n.inputNoLeftBorder]:this.layout==="horizontal"&&this.range,[n.inputNoRightBorder]:this.layout==="vertical"&&this.range})} .disabled=${e} .icon=${b.calendar} .label=${this.messages.endDate} @calciteInputTextInput=${this.calciteInternalInputInputHandler} @calciteInternalInputTextBlur=${this.calciteInternalInputBlurHandler} @calciteInternalInputTextFocus=${this.endInputFocus} .placeholder=${this.localeData?.placeholder} .readOnly=${r} role=combobox .scale=${this.scale} .status=${this.status} ${h(this.endInputRef)}></calcite-input-text>${!this.readOnly&&this.layout==="horizontal"&&this.renderToggleIcon(this.open)||""}</div>`||""}</div>${this.range&&this.layout==="vertical"&&m`<div class=${s(n.verticalChevronContainer)}><calcite-icon .icon=${this.open?b.chevronUp:b.chevronDown} .scale=${C(this.scale)}></calcite-icon></div>`||""}</div>${q({component:this})}${this.validationMessage&&this.status==="invalid"?ne({icon:this.validationIcon,id:$.validationMessage,message:this.validationMessage,scale:this.scale,status:this.status}):null}`})}renderToggleIcon(e){return m`<span class=${s(n.toggleIcon)} tabindex=-1><calcite-icon class=${s(n.chevronIcon)} .icon=${e?b.chevronUp:b.chevronDown} .scale=${C(this.scale)}></calcite-icon></span>`}};E("calcite-input-date-picker",O);export{O as InputDatePicker};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as S,b as g}from"./
|
|
3
|
+
v5.0.0-next.6 */
|
|
4
|
+
import{a as S,b as g}from"./UQ4HIO7J.js";import{a as f}from"./SXK4ATVN.js";import"./6PMY6MUE.js";import"./PCGNN5RO.js";import"./H3GTITDX.js";import{u,y as i}from"./7DQ4G2FS.js";import"./44XNJNTA.js";import{B as n,C as d,D as h,E as p,P as m,g as l,h as o,o as r}from"./2IIGKMQ6.js";var I={container:"container"},b=l`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}.container{display:flex;flex-wrap:wrap;gap:var(--calcite-swatch-group-space, var(--calcite-spacing-sm))}:host([scale=s]) .container{gap:var(--calcite-swatch-group-space, var(--calcite-spacing-xs))}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`,c=class extends h{constructor(){super(),this.items=[],this.slotRef=n(),this.focusSetter=f()(this),this.disabled=!1,this.scale="m",this.selectedItems=[],this.selectionMode="none",this.calciteSwatchGroupSelect=r({cancelable:!1}),this.listen("calciteInternalSwatchKeyEvent",this.calciteInternalSwatchKeyEventListener),this.listen("calciteSwatchSelect",this.calciteSwatchSelectListener),this.listen("calciteInternalSwatchSelect",this.calciteInternalSwatchSelectListener),this.listen("calciteInternalSyncSelectedSwatches",this.calciteInternalSyncSelectedSwatches)}static{this.properties={disabled:[7,{},{reflect:!0,type:Boolean}],label:1,scale:[3,{},{reflect:!0}],selectedItems:[0,{},{attribute:!1}],selectionMode:[3,{},{reflect:!0}]}}static{this.styles=b}async setFocus(e){return this.focusSetter(()=>this.el,e)}willUpdate(e){e.has("selectionMode")&&(this.hasUpdated||this.selectionMode!=="none")&&this.updateItems()}updated(){S(this)}calciteInternalSwatchKeyEventListener(e){if(e.composedPath().includes(this.el)){let s=this.items?.filter(t=>!t.disabled);switch(e.detail.key){case"ArrowRight":i(s,e.detail.target,"next");break;case"ArrowLeft":i(s,e.detail.target,"previous");break;case"Home":i(s,e.detail.target,"first");break;case"End":i(s,e.detail.target,"last");break}}e.stopPropagation()}calciteSwatchSelectListener(e){e.composedPath().includes(this.el)&&this.setSelectedItems(!0,e.target),e.stopPropagation()}calciteInternalSwatchSelectListener(e){e.composedPath().includes(this.el)&&this.setSelectedItems(!1,e.target),e.stopPropagation()}calciteInternalSyncSelectedSwatches(e){e.composedPath().includes(this.el)&&(this.updateSelectedItems(),this.selectionMode==="single"&&this.selectedItems.length>1&&this.setSelectedItems(!1,e.target)),e.stopPropagation()}updateItems(e){let s=this.slotRef.value?.assignedElements({flatten:!0}).filter(t=>t?.matches("calcite-swatch"));this.items=e?u(e):s,!(this.items?.length<1)&&(this.items?.forEach(t=>{t.interactive=!0,t.scale=this.scale,t.selectionMode=this.selectionMode,t.parentSwatchGroup=this.el}),this.setSelectedItems(!1))}updateSelectedItems(){this.selectedItems=this.items?.filter(e=>e.selected)}setSelectedItems(e,s){s&&this.items?.forEach(t=>{let a=s===t;switch(this.selectionMode){case"multiple":a&&(t.selected=!t.selected);break;case"single":t.selected=a?!t.selected:!1;break;case"single-persist":t.selected=!!a;break}}),this.updateSelectedItems(),e&&this.calciteSwatchGroupSelect.emit()}render(){let e=this.selectionMode==="none"||this.selectionMode==="multiple"?"group":"radiogroup",{disabled:s}=this;return g({disabled:s,children:o`<div .ariaLabel=${this.label} class=${p(I.container)} .role=${e}><slot @slotchange=${this.updateItems} ${d(this.slotRef)}></slot></div>`})}};m("calcite-swatch-group",c);export{c as SwatchGroup};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{c as r}from"./
|
|
3
|
+
v5.0.0-next.6 */
|
|
4
|
+
import{c as r}from"./POOA337X.js";import{a as n,b as o}from"./UQ4HIO7J.js";import{D as l,E as e,P as s,g as a,h as i,o as c}from"./2IIGKMQ6.js";var d={container:"container",heading:"heading"},p=a`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column}:host([filter-hidden]){display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{margin:0;display:flex;flex:1 1 0%;background-color:var(--calcite-list-background-color, var(--calcite-color-foreground-1));color:var(--calcite-list-color, var(--calcite-color-text-1))}.heading{font-weight:var(--calcite-font-weight-bold)}:host([scale=s]) .container{padding-inline:var(--calcite-spacing-sm)}:host([scale=s]) .heading{font-size:var(--calcite-font-size-sm);line-height:var(--calcite-font-line-height-fixed-base);padding-block:var(--calcite-spacing-sm) var(--calcite-spacing-xxs)}:host([scale=s]:not(:first-child)) .container{padding-block-start:var(--calcite-spacing-sm)}:host([scale=m]) .container{padding-inline:var(--calcite-spacing-md)}:host([scale=m]) .heading{font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-fixed-base);padding-block:var(--calcite-spacing-lg) var(--calcite-spacing-sm)}:host([scale=m]:not(:first-child)) .container{padding-block-start:var(--calcite-spacing-md)}:host([scale=l]) .container{padding-inline:var(--calcite-spacing-lg)}:host([scale=l]) .heading{font-size:var(--calcite-font-size-md);line-height:var(--calcite-font-line-height-fixed-lg);padding-block:var(--calcite-spacing-xl) var(--calcite-spacing-sm-plus, .625rem)}:host([scale=l]:not(:first-child)) .container{padding-block-start:var(--calcite-spacing-md-plus, .875rem)}.heading{padding:0}:host([hidden]){display:none}[hidden]{display:none}`,t=class extends l{constructor(){super(...arguments),this.disabled=!1,this.filterHidden=!1,this.scale="m",this.calciteInternalListItemGroupDefaultSlotChange=c({cancelable:!1})}static{this.properties={disabled:[7,{},{reflect:!0,type:Boolean}],filterHidden:[7,{},{reflect:!0,type:Boolean}],heading:[3,{},{reflect:!0}],scale:[3,{},{reflect:!0}]}}static{this.styles=p}updated(){n(this)}handleDefaultSlotChange(){this.calciteInternalListItemGroupDefaultSlotChange.emit()}render(){let{disabled:h,heading:g}=this;return o({disabled:h,children:i`<div class=${e(d.container)} role=row><div .ariaColSpan=${r} class=${e(d.heading)} role=cell>${g}</div></div><slot @slotchange=${this.handleDefaultSlotChange}></slot>`})}};s("calcite-list-item-group",t);export{t as ListItemGroup};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as N}from"./
|
|
3
|
+
v5.0.0-next.6 */
|
|
4
|
+
import{a as N}from"./CZF6KYOX.js";import{a as O}from"./44XNJNTA.js";import{D as S,E as x,G as o,P as G,g as X,h as z,i as g}from"./2IIGKMQ6.js";function I(t,s,n){let i=s[0]-t[0],c=n[0]-s[0],l=s[1]-t[1],h=n[1]-s[1],r=l/(i||c<0&&0),a=h/(c||i<0&&0),e=(r*c+a*i)/(i+c);return(Math.sign(r)+Math.sign(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(e))||0}function Y(t,s,n){let i=s[0]-t[0],c=s[1]-t[1];return i?(3*c/i-n)/2:n}function Z(t,s,n,i,c){let[l,h]=t,[r,a]=s,e=(r-l)/3,$=c([l+e,h+e*n]).join(","),d=c([r-e,a-e*i]).join(","),m=c([r,a]).join(",");return`C ${$} ${d} ${m}`}function A({width:t,height:s,min:n,max:i}){let c=i[0]-n[0],l=i[1]-n[1];return h=>{let r=(h[0]-n[0])/c*t,a=s-(h[1]-n[1])/l*s;return[r,a]}}function B(t){let[s,n]=t[0],i=[s,n],c=[s,n];return t.reduce(({min:l,max:h},[r,a])=>({min:[Math.min(l[0],r),Math.min(l[1],a)],max:[Math.max(h[0],r),Math.max(h[1],a)]}),{min:i,max:c})}function E({data:t,min:s,max:n,t:i}){if(t.length===0)return"";let[c,l]=i(t[0]),[h,r]=i(s),[a]=i(n),e,$,d,m=t.reduce((b,k,p)=>{if($=t[p-2],d=t[p-1],p>1){let u=I($,d,k),M=e===void 0?Y($,d,u):e,w=Z($,d,M,u,i);return e=u,`${b} ${w}`}return b},`M ${h},${r} L ${h},${l} L ${c},${l}`),L=t[t.length-1],v=Z(d,L,e,Y(d,L,e),i);return`${m} ${v} L ${a},${r} Z`}var R=X`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host{display:block;block-size:100%}.svg{fill:currentColor;stroke:transparent;margin:0;display:block;block-size:100%;inline-size:100%;padding:0}.svg .graph-path--highlight{fill:var(--calcite-graph-highlight-fill-color, var(--calcite-color-brand));opacity:.5}:host([hidden]){display:none}[hidden]{display:none}`,y={svg:"svg",graphPath:"graph-path",graphPathHighlight:"graph-path--highlight"},C="calcite-graph",f={host:t=>`${C}-${t}`,linearGradient:t=>`linear-gradient-${C}-${t}`,mask:(t,s)=>`${C}-${t}${s}`},P=class extends S{constructor(){super(...arguments),this.graphId=O(),this.resizeObserver=N("resize",()=>this.requestUpdate()),this.data=[]}static{this.properties={colorStops:[0,{},{attribute:!1}],data:[0,{},{attribute:!1}],highlightMax:[9,{},{type:Number}],highlightMin:[9,{},{type:Number}],max:[11,{},{reflect:!0,type:Number}],min:[11,{},{reflect:!0,type:Number}]}}static{this.styles=R}connectedCallback(){super.connectedCallback(),this.resizeObserver?.observe(this.el)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}render(){let{data:s,colorStops:n,el:i,highlightMax:c,highlightMin:l,min:h,max:r}=this,a=this.graphId,{clientHeight:e,clientWidth:$}=i;if(!s||s.length===0)return z`<svg aria-hidden=true class=${x(y.svg)} height=${e??o} preserveAspectRatio=none viewBox=${`0 0 ${$} ${e}`} width=${$??o}></svg>`;let{min:d,max:m}=B(s),L=d,v=m;(h<d[0]||h>d[0])&&(L=[h,0]),(r>m[0]||r<m[0])&&(v=[r,m[1]]);let b=A({min:L,max:v,width:$,height:e}),[k]=b([l,v[1]]),[p]=b([c,v[1]]),u=E({data:s,min:d,max:m,t:b}),M=n?`url(#${f.linearGradient(a)})`:void 0;return z`<svg aria-hidden=true class=${x(y.svg)} height=${e??o} preserveAspectRatio=none viewBox=${`0 0 ${$} ${e}`} width=${$??o}>${n?g`<defs><linearGradient id=${f.linearGradient(a)??o} x1=0 x2=1 y1=0 y2=0>${n.map(({offset:w,color:j,opacity:H})=>g`<stop offset=${`${w*100}%`} stop-color=${j??o} stop-opacity=${H??o} />`)}</linearGradient></defs>`:null}${l!==void 0?[g`<mask height=100% id=${f.mask(a,1)??o} width=100% x=0% y=0%><path d=${`
|
|
5
5
|
M 0,0
|
|
6
6
|
L ${k-1},0
|
|
7
7
|
L ${k-1},${e}
|