@esri/calcite-components 5.0.0-next.4 → 5.0.0-next.5
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/{TS65SISB.js → 2GG4AF5T.js} +1 -1
- package/dist/calcite/{CDLGLCFD.js → 2HKRJLBG.js} +2 -2
- package/dist/calcite/{RBJEATU3.js → 2IWOXJH7.js} +2 -2
- package/dist/calcite/{WLLFG3M7.js → 2KH3AUCG.js} +2 -2
- package/dist/calcite/{H3EPIYLG.js → 2VKJIYLT.js} +1 -1
- package/dist/calcite/{JBMFTM4R.js → 2YBCAJSV.js} +2 -2
- package/dist/calcite/{26KO5WLB.js → 3266GV6Z.js} +2 -2
- package/dist/calcite/{WGQ2SERU.js → 3HXEF55M.js} +2 -2
- package/dist/calcite/{MHGTLCFX.js → 3KUVOQAL.js} +2 -2
- package/dist/calcite/{6OSIXZYU.js → 3NOZ7M75.js} +2 -2
- package/dist/calcite/{TLLHA7VC.js → 3YZG7MA3.js} +2 -2
- package/dist/calcite/{R2KPGC7W.js → 45F6XOYY.js} +2 -2
- package/dist/calcite/{EWNCXKJC.js → 4ARTWEEZ.js} +2 -2
- package/dist/calcite/{544AASIY.js → 4GHB4NY4.js} +2 -2
- package/dist/calcite/{ETHM6IZM.js → 4JZMONLD.js} +2 -2
- package/dist/calcite/{BG5JIUF3.js → 5AL5GWRD.js} +2 -2
- package/dist/calcite/{Z6CRZOOK.js → 5IPJANUU.js} +2 -2
- package/dist/calcite/{AK4EMEY2.js → 5K2Z2TMW.js} +2 -2
- package/dist/calcite/{VLOLYD36.js → 5LAPR75M.js} +2 -2
- package/dist/calcite/{7TJP2ISL.js → 62OUMNJ6.js} +2 -2
- package/dist/calcite/{DNVDDGB7.js → 67HVFNHP.js} +2 -2
- package/dist/calcite/{HZVCGOQL.js → 6J5W2PAJ.js} +2 -2
- package/dist/calcite/{MM5GOLON.js → 6VPACZP5.js} +2 -2
- package/dist/calcite/{Y6BDELTJ.js → 6VQ5IL36.js} +2 -2
- package/dist/calcite/{U3RNUZF6.js → 73LRFHS4.js} +2 -2
- package/dist/calcite/{QW2OFS26.js → 7DTG5KDL.js} +2 -2
- package/dist/calcite/{SBO2DPVJ.js → 7IHVHMIY.js} +2 -2
- package/dist/calcite/{QNVFFZ3F.js → 7IYAKB7Q.js} +2 -2
- package/dist/calcite/{3PSVZRKA.js → 7NUC3WBG.js} +1 -1
- package/dist/calcite/{RSHJ2ULC.js → 7PFVW4JF.js} +1 -1
- package/dist/calcite/{6CJF3ZME.js → 7QP5BUGE.js} +2 -2
- package/dist/calcite/{2J5IS422.js → 7XJU5OTS.js} +2 -2
- package/dist/calcite/{POOH5QBE.js → 7ZNR3GNI.js} +2 -2
- package/dist/calcite/{PQACJ4N6.js → A4CO6B7Z.js} +2 -2
- package/dist/calcite/{AKR5JHPW.js → AHOXXRX5.js} +2 -2
- package/dist/calcite/{J2NLU7RP.js → ALDDSDTX.js} +1 -1
- package/dist/calcite/{VV3MILRZ.js → APIFFM3O.js} +2 -2
- package/dist/calcite/{FNH5JSBK.js → AQ4DKRX6.js} +2 -2
- package/dist/calcite/{SQ25UCSA.js → AUF6YLAM.js} +2 -2
- package/dist/calcite/{CSQVLDPF.js → AUIOWPFN.js} +2 -2
- package/dist/calcite/{D5SFHDV6.js → B5JXPZDV.js} +2 -2
- package/dist/calcite/{TCB3D44T.js → BE5OB2TH.js} +2 -2
- package/dist/calcite/{PWWVHZBN.js → BEUZYBM5.js} +3 -3
- package/dist/calcite/{WYHGKROL.js → BFINWHLX.js} +2 -2
- package/dist/calcite/{QRBJKU6C.js → BHBYSC5H.js} +2 -2
- package/dist/calcite/{GTU5X7O7.js → BHU252WA.js} +2 -2
- package/dist/calcite/{NI3OLQU4.js → BNKVQYLQ.js} +2 -2
- package/dist/calcite/{P2J4VCQF.js → BYZPKQRD.js} +2 -2
- package/dist/calcite/{AAV5EWQK.js → C2X6VADY.js} +2 -2
- package/dist/calcite/{G73EBLG4.js → C3BQ4W7K.js} +2 -2
- package/dist/calcite/{YASA2V4I.js → C4S2BOWK.js} +2 -2
- package/dist/calcite/{GU5MLWDX.js → CF6DTFNX.js} +2 -2
- package/dist/calcite/{VZVYZPXQ.js → CIU4VM7X.js} +2 -2
- package/dist/calcite/{X2PZLQSO.js → CJWGQETT.js} +2 -2
- package/dist/calcite/{VBGPBKJL.js → CQMVTE7J.js} +2 -2
- package/dist/calcite/{CAHGZMOM.js → CTLGVBKW.js} +2 -2
- package/dist/calcite/{K6FTZ2ZF.js → CUL3VHSD.js} +2 -2
- package/dist/calcite/{RUMWLVIQ.js → CVLFEMH2.js} +2 -2
- package/dist/calcite/{Q2KBZ6FQ.js → DDW4WTS2.js} +2 -2
- package/dist/calcite/{WDKPAPPB.js → DDXY7TRY.js} +2 -2
- package/dist/calcite/{2C6PV6LO.js → DJVVGNTK.js} +1 -1
- package/dist/calcite/{5FUKNERA.js → DOH3ZW2R.js} +2 -2
- package/dist/calcite/{2GMLRXCX.js → DONAES6Q.js} +2 -2
- package/dist/calcite/{4VQGRHEV.js → DSEMLW7Z.js} +2 -2
- package/dist/calcite/{N7QD2WXH.js → DZWPXJWV.js} +2 -2
- package/dist/calcite/{6G3IVAVE.js → F6EDNLSI.js} +2 -2
- package/dist/calcite/{U5ZHIRE4.js → FZIUTVKD.js} +1 -1
- package/dist/calcite/{ETUOSTGW.js → GE7SQF7S.js} +2 -2
- package/dist/calcite/{BK2W2RW3.js → GUT2GKDG.js} +2 -2
- package/dist/calcite/{63S6JWID.js → H2FWQITV.js} +1 -1
- package/dist/calcite/{35DVUKKJ.js → H5ANNFJC.js} +2 -2
- package/dist/calcite/{PLRKNZ2Y.js → H5DKF7F3.js} +2 -2
- package/dist/calcite/{M5QNDD4X.js → HBHSBTMM.js} +1 -1
- package/dist/calcite/{NPXLX7L5.js → HT5KXL4J.js} +2 -2
- package/dist/calcite/{WSETKDK2.js → HU4SHWE7.js} +2 -2
- package/dist/calcite/{QYCVH2VH.js → HVF3RXXI.js} +2 -2
- package/dist/calcite/{E3C36U7C.js → HXGFAPCM.js} +2 -2
- package/dist/calcite/{XYU7WBO7.js → I53JH7YD.js} +2 -2
- package/dist/calcite/{SLUOB5WF.js → IEL7YV5C.js} +2 -2
- package/dist/calcite/{GV755OVW.js → IHEW664E.js} +2 -2
- package/dist/calcite/{NS7XIDPL.js → IKDSO2OB.js} +2 -2
- package/dist/calcite/{2VXNPHIO.js → JJWGSKGI.js} +2 -2
- package/dist/calcite/{FX45OPBE.js → K3AHNZL7.js} +2 -2
- package/dist/calcite/{BQI7TWVC.js → K5GJLIBR.js} +2 -2
- package/dist/calcite/{R534LDNQ.js → KH3UKQ2D.js} +2 -2
- package/dist/calcite/{SHXU5GEM.js → KRHM7ACI.js} +2 -2
- package/dist/calcite/{XQGQJEI2.js → KT4EQWT6.js} +2 -2
- package/dist/calcite/{PNBL2IVW.js → LH7245HX.js} +2 -2
- package/dist/calcite/{32YCYEKN.js → LJI5SYGA.js} +1 -1
- package/dist/calcite/{HBVWYA2B.js → LQ3URZCB.js} +2 -2
- package/dist/calcite/{JJNFTIBI.js → LRKWQ3C3.js} +2 -2
- package/dist/calcite/{HPWHHEM4.js → LROCCBRV.js} +2 -2
- package/dist/calcite/{JRPSHIET.js → LYDOM6VQ.js} +2 -2
- package/dist/calcite/{X7GVFGBQ.js → MEFMO7UB.js} +2 -2
- package/dist/calcite/{CYVISXIT.js → MP3OWQ2A.js} +2 -2
- package/dist/calcite/{TU2PNKWS.js → MVLJJOH2.js} +2 -2
- package/dist/calcite/{HOUDAAST.js → N5MSFOLW.js} +2 -2
- package/dist/calcite/{YGYOIYMF.js → N7OO7R2S.js} +2 -2
- package/dist/calcite/{XGLTZ4HO.js → NID6WJOW.js} +2 -2
- package/dist/calcite/{FKYJEFNP.js → NLYYOFNV.js} +1 -1
- package/dist/calcite/{RPLPMP3J.js → NQJMDHT5.js} +2 -2
- package/dist/calcite/{PRB44CR7.js → NSBK36H4.js} +2 -2
- package/dist/calcite/{AS2E2XYE.js → NU57UAAO.js} +1 -1
- package/dist/calcite/{H42LHYUA.js → NULQJBCW.js} +2 -2
- package/dist/calcite/{7SVIAOHO.js → OCT7LR2O.js} +1 -1
- package/dist/calcite/{JDPMMX2J.js → OFZACK2Y.js} +2 -2
- package/dist/calcite/{Y7L5PL4A.js → OMKDUGKV.js} +2 -2
- package/dist/calcite/{TDROT2JJ.js → PFDLGOVS.js} +2 -2
- package/dist/calcite/{AICLNUQ5.js → PFKUB7JD.js} +2 -2
- package/dist/calcite/{QSTLY3DQ.js → PJOGMC7F.js} +2 -2
- package/dist/calcite/{HKNQLLG7.js → PLD7OLLJ.js} +2 -2
- package/dist/calcite/{MPZ73UTT.js → PSCEW76J.js} +2 -2
- package/dist/calcite/{JIKG4DHH.js → PSNA5FAF.js} +2 -2
- package/dist/calcite/{SOFELOS3.js → PU5TGCQG.js} +2 -2
- package/dist/calcite/{TPG23UCD.js → PVL2DQVP.js} +2 -2
- package/dist/calcite/{GCPYRD7U.js → PZL4QWV5.js} +2 -2
- package/dist/calcite/{ZCWFURSE.js → Q23OEAP2.js} +2 -2
- package/dist/calcite/{WJA2X3C2.js → Q2GRCTSJ.js} +2 -2
- package/dist/calcite/{C7C75GTM.js → Q3MUDXRY.js} +2 -2
- package/dist/calcite/{M7H4RC23.js → QF6F6CY3.js} +2 -2
- package/dist/calcite/{T3UNO6JW.js → QFT74HW3.js} +2 -2
- package/dist/calcite/{EKOGELYT.js → R73QB7MJ.js} +2 -2
- package/dist/calcite/{ZUMJB5U3.js → RFALVOKT.js} +2 -2
- package/dist/calcite/{6TAH2TAT.js → RI3NRBMI.js} +2 -2
- package/dist/calcite/{WNEJDZTS.js → RND3V33U.js} +1 -1
- package/dist/calcite/{M6OBWXQN.js → ROWPIQLT.js} +2 -2
- package/dist/calcite/{JJOW6LLC.js → RRP2E2T3.js} +2 -2
- package/dist/calcite/{2DX2SAQ7.js → S5CLKCGJ.js} +1 -1
- package/dist/calcite/{INNXW35W.js → SGJU36YV.js} +2 -2
- package/dist/calcite/{RFA6VADW.js → SMRCCHJE.js} +2 -2
- package/dist/calcite/{R4PTX2BD.js → SXB76NOR.js} +2 -2
- package/dist/calcite/{YA3YNL2F.js → SZWYWOXZ.js} +2 -2
- package/dist/calcite/{NFBDMCMY.js → T6Y6ZTWW.js} +2 -2
- package/dist/calcite/{XHCNKCYX.js → U3KRKTQY.js} +2 -2
- package/dist/calcite/{QWN5XHMG.js → UGI3YWJM.js} +2 -2
- package/dist/calcite/{QK7SZUAI.js → UN7GLLXI.js} +2 -2
- package/dist/calcite/{W2KQ3FF5.js → UNJRBV2R.js} +2 -2
- package/dist/calcite/{YUOVY5RN.js → UOZDXXIF.js} +2 -2
- package/dist/calcite/{JAM3DZYC.js → V3ZR6RFK.js} +1 -1
- package/dist/calcite/{V6JTY5IT.js → V4NPQ4WA.js} +2 -2
- package/dist/calcite/{AILXQSIJ.js → VBRBI7IU.js} +2 -2
- package/dist/calcite/{INNX6VTE.js → VIWDW2WZ.js} +2 -2
- package/dist/calcite/{XM6I5JZM.js → VKRWRFEJ.js} +2 -2
- package/dist/calcite/{MDLPBZOZ.js → VMWAAH5B.js} +2 -2
- package/dist/calcite/{6PIHPAZF.js → VQMSSO2U.js} +2 -2
- package/dist/calcite/{OTRRBSYY.js → VYFT5EAY.js} +1 -1
- package/dist/calcite/{EQC2JW3I.js → W5OJOVZY.js} +1 -1
- package/dist/calcite/{AE4AQEU5.js → W6EWFSR3.js} +2 -2
- package/dist/calcite/{KSITDI7Y.js → W72YZH73.js} +2 -2
- package/dist/calcite/{JCGVWBAA.js → WBGRGCXR.js} +2 -2
- package/dist/calcite/{HKVRX5SD.js → WOTQIMPZ.js} +2 -2
- package/dist/calcite/{SU2JQIB4.js → WPTOKN7K.js} +1 -1
- package/dist/calcite/{2JFH2WAM.js → WTY55PPZ.js} +2 -2
- package/dist/calcite/{C77NX62C.js → WWJXVV6U.js} +2 -2
- package/dist/calcite/{VVCB7N7V.js → X374PRV7.js} +2 -2
- package/dist/calcite/{A2TCAPW4.js → XNFJXDQ6.js} +2 -2
- package/dist/calcite/{A5CVK7TL.js → XNLWKJLM.js} +2 -2
- package/dist/calcite/{HIB3Q63Z.js → XRSYDXWZ.js} +1 -1
- package/dist/calcite/{ALQH5DCZ.js → XZTRPLLK.js} +2 -2
- package/dist/calcite/{U3G47NPB.js → Y3HXK6MO.js} +2 -2
- package/dist/calcite/{QDXVT7UF.js → Y442PVMQ.js} +2 -2
- package/dist/calcite/{EDVRYPYX.js → YCLOS6NX.js} +2 -2
- package/dist/calcite/{S6HTKBNB.js → YSBWKH76.js} +1 -1
- package/dist/calcite/{C3BIK3DY.js → YSP6WWQB.js} +1 -1
- package/dist/calcite/{KCVWP63F.js → YV7DKMEQ.js} +2 -2
- package/dist/calcite/{TXZPVAH4.js → ZAQTILTS.js} +2 -2
- package/dist/calcite/{XRJOD24G.js → ZLR2B6GQ.js} +1 -1
- package/dist/calcite/{2CJWVM4R.js → ZSMNT5VS.js} +2 -2
- package/dist/calcite/{B3KV4G2W.js → ZTOBC3PN.js} +2 -2
- package/dist/calcite/{IXK4BTNI.js → ZV7YL7QG.js} +2 -2
- package/dist/calcite/{J2ACTXE5.js → ZVWKN3G7.js} +2 -2
- package/dist/calcite/{LAAEPNIM.js → ZZGPQLEW.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/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as N}from"./3PSVZRKA.js";import{k as c}from"./RUMWLVIQ.js";import{a as B}from"./6TAH2TAT.js";import{a as q}from"./SHXU5GEM.js";import{c as W,d as F,e as j}from"./J2ACTXE5.js";import{c as H,e as T,h as I}from"./U3G47NPB.js";import{a as O,b as A}from"./PRB44CR7.js";import{a as R}from"./MPZ73UTT.js";import{c as M}from"./EQC2JW3I.js";import"./2DX2SAQ7.js";import{a as k,b as L}from"./J2NLU7RP.js";import{a as C}from"./PNBL2IVW.js";import{a as $}from"./HKVRX5SD.js";import{b as E}from"./D5SFHDV6.js";import"./TLLHA7VC.js";import"./VZVYZPXQ.js";import{t as u}from"./Z6CRZOOK.js";import{a as S}from"./XRJOD24G.js";import{A as x,B as b,C as m,D as y,E as i,G as r,I as z,P as w,g as v,h as s,o as g}from"./CSQVLDPF.js";var a={assistiveText:"assistive-text",characterLimit:"character-limit",content:"content",container:"container",footer:"footer",characterOverLimit:"character--over-limit",readOnly:"readonly",textAreaInvalid:"text-area--invalid",footerSlotted:"footer--slotted",hide:"hide",footerEndSlotOnly:"footer--end-only",textArea:"text-area",textAreaOnly:"text-area--only",wrapper:"wrapper"},V={validationMessage:"textAreaValidationMessage"},D={footerStart:"footer-start",footerEnd:"footer-end"},U=100,f=Object.freeze({height:0,width:0}),_=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{position:relative;box-sizing:border-box;display:inline-block;block-size:100%;inline-size:100%;--calcite-internal-text-area-border-color: var(--calcite-text-area-border-color, var(--calcite-color-border-input));--calcite-internal-text-area-footer-border-color: var( --calcite-text-area-footer-border-color, var(--calcite-internal-text-area-border-color) );--calcite-internal-text-area-corner-radius: var( --calcite-text-area-corner-radius, var(--calcite-corner-radius-default) );--calcite-internal-text-area-shadow: var(--calcite-text-area-shadow, var(--calcite-shadow-none));--calcite-internal-text-area-footer-background-color: var( --calcite-text-area-footer-background-color, var(--calcite-text-area-background-color, var(--calcite-color-foreground-1)) );min-block-size:var(--calcite-text-area-min-height, calc(2 * var(--calcite-internal-text-area-padding-block) + 2 * var(--calcite-border-width-sm)));min-inline-size:var(--calcite-text-area-min-width, 12rem)}.wrapper{box-sizing:border-box;block-size:100%;inline-size:100%;box-shadow:var(--calcite-internal-text-area-shadow);border-radius:var(--calcite-internal-text-area-corner-radius)}.text-area,.footer{font-size:var(--calcite-text-area-font-size, var(--calcite-font-size--1));padding-block:var(--calcite-internal-text-area-padding-block);padding-inline:var(--calcite-internal-text-area-padding-inline)}.footer{background-color:var(--calcite-internal-text-area-footer-background-color);border-radius:0 0 var(--calcite-internal-text-area-corner-radius) var(--calcite-internal-text-area-corner-radius)}.text-area{position:relative;margin:0;box-sizing:border-box;display:block;inline-size:100%;--calcite-internal-text-area-border-block-end-color: var(--calcite-internal-text-area-border-color);border:var(--calcite-border-width-sm) solid var(--calcite-internal-text-area-border-color);border-block-end-color:var(--calcite-internal-text-area-border-block-end-color);color:var(--calcite-text-area-text-color, var(--calcite-color-text-1));font-family:inherit;max-block-size:var(--calcite-text-area-max-height);min-block-size:calc(var(--calcite-text-area-min-height, 0px) - var(--calcite-internal-text-area-footer-min-height, 0px));max-inline-size:var(--calcite-text-area-max-width);min-inline-size:var(--calcite-text-area-min-width, 12rem);background-color:var(--calcite-text-area-background-color, var(--calcite-color-foreground-1));border-radius:var(--calcite-internal-text-area-corner-radius) var(--calcite-internal-text-area-corner-radius) 0 0}.text-area::placeholder{font-weight:var(--calcite-font-weight-normal)}@media screen and (max-width:480px){.text-area{resize:none}}.text-area:focus{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))))}.text-area.text-area--invalid{--calcite-internal-text-area-border-color: var(--calcite-color-status-danger)}.text-area.text-area--invalid:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-status-danger);outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.text-area.footer--slotted{min-inline-size:18rem}.text-area.text-area--only{border-radius:var(--calcite-internal-text-area-corner-radius)}.text-area:not(.text-area--only,.text-area--invalid){--calcite-internal-text-area-border-block-end-color: var( --calcite-text-area-divider-color, var(--calcite-color-border-3) )}.footer{box-sizing:border-box;display:flex;align-items:center;border:var(--calcite-border-width-sm) solid var(--calcite-internal-text-area-footer-border-color);border-block-start:var(--calcite-border-width-none);min-block-size:var(--calcite-internal-text-area-footer-min-height)}.character-limit{display:flex;align-items:center;justify-content:flex-end;white-space:nowrap;font-size:var(--calcite-text-area-font-size, var(--calcite-font-size--1));font-weight:var(--calcite-font-weight-regular);color:var(--calcite-text-area-character-limit-text-color, var(--calcite-color-text-2));padding-inline-start:var(--calcite-spacing-md)}.character--over-limit{font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-status-danger)}.readonly{background-color:var(--calcite-text-area-background-color, var(--calcite-color-background));font-weight:var(--calcite-font-weight-medium)}.footer.readonly{background-color:var(--calcite-internal-text-area-footer-background-color, var(--calcite-color-background))}.content,.hide{display:none}.container{display:flex;inline-size:100%;justify-content:space-between}.footer--end-only{justify-content:flex-end}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.text-area.text-area--only{block-size:100%;min-block-size:var(--calcite-text-area-min-height, 0)}:host([resize=none]) .text-area{resize:none}:host([resize=horizontal]) .text-area{resize:horizontal}:host([resize=vertical]) .text-area{resize:vertical}:host([scale=s]){--calcite-internal-text-area-padding-block: var(--calcite-spacing-xxs);--calcite-internal-text-area-padding-inline: var(--calcite-spacing-sm);--calcite-internal-text-area-footer-min-height: 1.75rem}:host([scale=s]) .text-area,:host([scale=s]) .footer,:host([scale=s]) .character-limit{font-size:var(--calcite-text-area-font-size, var(--calcite-font-size--2))}:host([scale=s]) .character-limit{padding-inline-start:var(--calcite-spacing-sm)}:host([scale=m]){--calcite-internal-text-area-padding-block: var(--calcite-spacing-sm);--calcite-internal-text-area-padding-inline: var(--calcite-spacing-md);--calcite-internal-text-area-footer-min-height: 2.25rem}:host([scale=l]){--calcite-internal-text-area-padding-block: var(--calcite-spacing-md);--calcite-internal-text-area-padding-inline: var(--calcite-spacing-lg);--calcite-internal-text-area-footer-min-height: 2.75rem}:host([scale=l]) .text-area,:host([scale=l]) .footer,:host([scale=l]) .character-limit{font-size:var(--calcite-text-area-font-size, var(--calcite-font-size-0))}:host([scale=l]) .character-limit{padding-inline-start:var(--calcite-spacing-lg)}:host([status=invalid]){--calcite-internal-text-area-border-color: var(--calcite-color-status-danger)}:host([status=invalid]) .text-area:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-status-danger);outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}:host([disabled]) .text-area,:host([disabled]) .footer{opacity:var(--calcite-opacity-half)}.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([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}::placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-input-placeholder-text-color, var(--calcite-color-text-3))}`,p=class extends y{constructor(){super(...arguments),this.attributeWatch=E(["autofocus","spellcheck"],this.handleGlobalAttributesChanged),this.footerRef=b(),this.guid=S(),this.resizeObserver=k("resize",async()=>{await this.componentOnReady();let{textAreaHeight:e,textAreaWidth:t,elHeight:l,elWidth:n,footerHeight:d,footerWidth:o,validationMessageHeight:h}=this.getHeightAndWidthOfElements();if(o>0&&o!==t&&(this.footerRef.value.style.width=`${t}px`),this.resize==="none")return;let{width:G,height:P}=getComputedStyle(this.el);n!==t&&G!=="auto"&&this.updateSizeToAuto("width"),l!==e+d+h&&P!=="auto"&&this.updateSizeToAuto("height")}),this.cancelable=R()(this),this.updateSizeToAuto=M(e=>{this.el.style[e]="auto"},U,{edges:["trailing"]}),this.messages=C({blocking:!0}),this.focusSetter=$()(this),this.disabled=!1,this.groupSeparator=!1,this.limitText=!1,this.readOnly=!1,this.required=!1,this.resize="both",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.value="",this.wrap="soft",this.calciteTextAreaChange=g(),this.calciteTextAreaInput=g()}static{this.properties={endSlotHasElements:[16,{},{state:!0}],startSlotHasElements:[16,{},{state:!0}],columns:[11,{},{reflect:!0,type:Number}],disabled:[7,{},{reflect:!0,type:Boolean}],form:[3,{},{reflect:!0}],groupSeparator:[7,{},{reflect:!0,type:Boolean}],label:1,labelText:1,limitText:[7,{},{reflect:!0,type:Boolean}],maxLength:[11,{},{reflect:!0,type:Number}],messageOverrides:[0,{},{attribute:!1}],minLength:[11,{},{reflect:!0,type:Number}],name:[3,{},{reflect:!0}],numberingSystem:1,placeholder:1,readOnly:[7,{},{reflect:!0,type:Boolean}],required:[7,{},{reflect:!0,type:Boolean}],resize:[3,{},{reflect:!0}],rows:[11,{},{reflect:!0,type:Number}],scale:[3,{},{reflect:!0}],status:[3,{},{reflect:!0}],validationIcon:[3,{converter:z,type:String},{reflect:!0}],validationMessage:1,validity:[0,{},{attribute:!1}],value:1,wrap:[3,{},{reflect:!0}]}}static{this.styles=_}async selectText(){await this.componentOnReady(),this.textAreaEl?.select()}async setFocus(e){return this.focusSetter(()=>this.textAreaEl,e)}connectedCallback(){super.connectedCallback(),W(this),H(this),this.cancelable.add(this.updateSizeToAuto)}updated(){O(this),this.setTextAreaHeight()}disconnectedCallback(){super.disconnectedCallback(),F(this),T(this),this.resizeObserver?.disconnect()}handleGlobalAttributesChanged(){this.requestUpdate()}onLabelClick(){this.setFocus()}handleInput(e){this.value=e.target.value,this.calciteTextAreaInput.emit()}handleChange(){this.calciteTextAreaChange.emit()}contentSlotChangeHandler(){this.value||this.el.childNodes.forEach(t=>{t.nodeName==="#text"&&(this.value=t.nodeValue.trim())})}getLocalizedCharacterLength(){let e=this.value?this.value.length.toString():"0",t=this.maxLength.toString();return this.numberingSystem==="latn"?{currentLength:e,maxLength:t}:(c.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,signDisplay:"never",useGrouping:this.groupSeparator},{currentLength:c.localize(e),maxLength:c.localize(t)})}syncHiddenFormInput(e){e.setCustomValidity(""),this.isCharacterLimitExceeded()&&e.setCustomValidity(this.replacePlaceholdersInMessages()),N("textarea",this,e)}setTextAreaEl(e){L(this.resizeObserver,this.textAreaEl,e),this.textAreaEl=e}setTextAreaHeight(){let{textAreaHeight:e,elHeight:t,footerHeight:l,validationMessageHeight:n}=this.getHeightAndWidthOfElements();l>0&&e+l+n!=t&&(this.textAreaEl.style.height=`${t-l}px`)}getHeightAndWidthOfElements(){let{height:e,width:t}=this.textAreaEl?this.textAreaEl.getBoundingClientRect():f,{height:l,width:n}=this.el.getBoundingClientRect(),{height:d,width:o}=this.footerRef.value?this.footerRef.value.getBoundingClientRect():f,{height:h}=this.validationMessageEl?this.validationMessageEl.getBoundingClientRect():f;return{textAreaHeight:e,textAreaWidth:t,elHeight:l,elWidth:n,footerHeight:d,footerWidth:o,validationMessageHeight:h}}replacePlaceholdersInMessages(){return this.messages.tooLong.replace("{maxLength}",this.localizedCharacterLengthObj.maxLength).replace("{currentLength}",this.localizedCharacterLengthObj.currentLength)}isCharacterLimitExceeded(){return this.value?.length>this.maxLength}setValidationRef(e){e&&(this.validationMessageEl=e)}render(){let e=this.startSlotHasElements||this.endSlotHasElements||!!this.maxLength;return A({disabled:this.disabled,children:s`<div class=${i(a.wrapper)}>${this.labelText&&q({labelText:this.labelText,onClick:this.onLabelClick,required:this.required,tooltipText:this.messages.required})||""}<textarea aria-describedby=${this.guid??r} aria-errormessage=${V.validationMessage} .ariaInvalid=${this.status==="invalid"||this.isCharacterLimitExceeded()} .ariaLabel=${j(this)} .autofocus=${this.el.autofocus} class=${i({[a.textArea]:!0,[a.readOnly]:this.readOnly,[a.textAreaInvalid]:this.isCharacterLimitExceeded(),[a.footerSlotted]:this.endSlotHasElements&&this.startSlotHasElements,[a.textAreaOnly]:!e})} .cols=${this.columns} .disabled=${this.disabled} maxlength=${(this.limitText?this.maxLength:void 0)??r} name=${this.name??r} @change=${this.handleChange} @input=${this.handleInput} placeholder=${this.placeholder??r} .readOnly=${this.readOnly} .required=${this.required} .rows=${this.rows} spellcheck=${this.el.spellcheck??r} .value=${x(this.value??"")} wrap=${this.wrap??r} ${m(this.setTextAreaEl)}></textarea><span class=${i({[a.content]:!0})}><slot @slotchange=${this.contentSlotChangeHandler}></slot></span><footer class=${i({[a.footer]:!0,[a.readOnly]:this.readOnly,[a.hide]:!e})} ${m(this.footerRef)}><div class=${i({[a.container]:!0,[a.footerEndSlotOnly]:!this.startSlotHasElements&&this.endSlotHasElements})}><slot name=${D.footerStart} @slotchange=${t=>this.startSlotHasElements=u(t)}></slot><slot name=${D.footerEnd} @slotchange=${t=>this.endSlotHasElements=u(t)}></slot></div>${this.renderCharacterLimit()}</footer>${I({component:this})}${this.isCharacterLimitExceeded()&&s`<span aria-live=polite class=${i(a.assistiveText)} id=${this.guid??r}>${this.replacePlaceholdersInMessages()}</span>`||""}${this.validationMessage&&this.status==="invalid"?B({icon:this.validationIcon,id:V.validationMessage,message:this.validationMessage,ref:this.setValidationRef,scale:this.scale,status:this.status}):null}</div>`})}renderCharacterLimit(){return this.maxLength?(this.localizedCharacterLengthObj=this.getLocalizedCharacterLength(),s`<span class=${i(a.characterLimit)}><span class=${i({[a.characterOverLimit]:this.isCharacterLimitExceeded()})}>${this.localizedCharacterLengthObj.currentLength}</span>/${this.localizedCharacterLengthObj.maxLength}</span>`):null}};w("calcite-text-area",p);export{p as TextArea};
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a as N}from"./7NUC3WBG.js";import{k as c}from"./CVLFEMH2.js";import{a as B}from"./RI3NRBMI.js";import{a as q}from"./KRHM7ACI.js";import{c as W,d as F,e as j}from"./ZVWKN3G7.js";import{c as H,e as T,h as I}from"./Y3HXK6MO.js";import{a as O,b as A}from"./NSBK36H4.js";import{a as R}from"./PSCEW76J.js";import{c as M}from"./W5OJOVZY.js";import"./S5CLKCGJ.js";import{a as k,b as L}from"./ALDDSDTX.js";import{a as C}from"./LH7245HX.js";import{a as $}from"./WOTQIMPZ.js";import{b as E}from"./B5JXPZDV.js";import"./3YZG7MA3.js";import"./CIU4VM7X.js";import{t as u}from"./5IPJANUU.js";import{a as S}from"./ZLR2B6GQ.js";import{A as x,B as b,C as m,D as y,E as i,G as r,I as z,P as w,g as v,h as s,o as g}from"./AUIOWPFN.js";var a={assistiveText:"assistive-text",characterLimit:"character-limit",content:"content",container:"container",footer:"footer",characterOverLimit:"character--over-limit",readOnly:"readonly",textAreaInvalid:"text-area--invalid",footerSlotted:"footer--slotted",hide:"hide",footerEndSlotOnly:"footer--end-only",textArea:"text-area",textAreaOnly:"text-area--only",wrapper:"wrapper"},V={validationMessage:"textAreaValidationMessage"},D={footerStart:"footer-start",footerEnd:"footer-end"},U=100,f=Object.freeze({height:0,width:0}),_=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{position:relative;box-sizing:border-box;display:inline-block;block-size:100%;inline-size:100%;--calcite-internal-text-area-border-color: var(--calcite-text-area-border-color, var(--calcite-color-border-input));--calcite-internal-text-area-footer-border-color: var( --calcite-text-area-footer-border-color, var(--calcite-internal-text-area-border-color) );--calcite-internal-text-area-corner-radius: var( --calcite-text-area-corner-radius, var(--calcite-corner-radius-default) );--calcite-internal-text-area-shadow: var(--calcite-text-area-shadow, var(--calcite-shadow-none));--calcite-internal-text-area-footer-background-color: var( --calcite-text-area-footer-background-color, var(--calcite-text-area-background-color, var(--calcite-color-foreground-1)) );min-block-size:var(--calcite-text-area-min-height, calc(2 * var(--calcite-internal-text-area-padding-block) + 2 * var(--calcite-border-width-sm)));min-inline-size:var(--calcite-text-area-min-width, 12rem)}.wrapper{box-sizing:border-box;block-size:100%;inline-size:100%;box-shadow:var(--calcite-internal-text-area-shadow);border-radius:var(--calcite-internal-text-area-corner-radius)}.text-area,.footer{font-size:var(--calcite-text-area-font-size, var(--calcite-font-size--1));padding-block:var(--calcite-internal-text-area-padding-block);padding-inline:var(--calcite-internal-text-area-padding-inline)}.footer{background-color:var(--calcite-internal-text-area-footer-background-color);border-radius:0 0 var(--calcite-internal-text-area-corner-radius) var(--calcite-internal-text-area-corner-radius)}.text-area{position:relative;margin:0;box-sizing:border-box;display:block;inline-size:100%;--calcite-internal-text-area-border-block-end-color: var(--calcite-internal-text-area-border-color);border:var(--calcite-border-width-sm) solid var(--calcite-internal-text-area-border-color);border-block-end-color:var(--calcite-internal-text-area-border-block-end-color);color:var(--calcite-text-area-text-color, var(--calcite-color-text-1));font-family:inherit;max-block-size:var(--calcite-text-area-max-height);min-block-size:calc(var(--calcite-text-area-min-height, 0px) - var(--calcite-internal-text-area-footer-min-height, 0px));max-inline-size:var(--calcite-text-area-max-width);min-inline-size:var(--calcite-text-area-min-width, 12rem);background-color:var(--calcite-text-area-background-color, var(--calcite-color-foreground-1));border-radius:var(--calcite-internal-text-area-corner-radius) var(--calcite-internal-text-area-corner-radius) 0 0}.text-area::placeholder{font-weight:var(--calcite-font-weight-normal)}@media screen and (max-width:480px){.text-area{resize:none}}.text-area:focus{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))))}.text-area.text-area--invalid{--calcite-internal-text-area-border-color: var(--calcite-color-status-danger)}.text-area.text-area--invalid:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-status-danger);outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.text-area.footer--slotted{min-inline-size:18rem}.text-area.text-area--only{border-radius:var(--calcite-internal-text-area-corner-radius)}.text-area:not(.text-area--only,.text-area--invalid){--calcite-internal-text-area-border-block-end-color: var( --calcite-text-area-divider-color, var(--calcite-color-border-3) )}.footer{box-sizing:border-box;display:flex;align-items:center;border:var(--calcite-border-width-sm) solid var(--calcite-internal-text-area-footer-border-color);border-block-start:var(--calcite-border-width-none);min-block-size:var(--calcite-internal-text-area-footer-min-height)}.character-limit{display:flex;align-items:center;justify-content:flex-end;white-space:nowrap;font-size:var(--calcite-text-area-font-size, var(--calcite-font-size--1));font-weight:var(--calcite-font-weight-regular);color:var(--calcite-text-area-character-limit-text-color, var(--calcite-color-text-2));padding-inline-start:var(--calcite-spacing-md)}.character--over-limit{font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-status-danger)}.readonly{background-color:var(--calcite-text-area-background-color, var(--calcite-color-background));font-weight:var(--calcite-font-weight-medium)}.footer.readonly{background-color:var(--calcite-internal-text-area-footer-background-color, var(--calcite-color-background))}.content,.hide{display:none}.container{display:flex;inline-size:100%;justify-content:space-between}.footer--end-only{justify-content:flex-end}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.text-area.text-area--only{block-size:100%;min-block-size:var(--calcite-text-area-min-height, 0)}:host([resize=none]) .text-area{resize:none}:host([resize=horizontal]) .text-area{resize:horizontal}:host([resize=vertical]) .text-area{resize:vertical}:host([scale=s]){--calcite-internal-text-area-padding-block: var(--calcite-spacing-xxs);--calcite-internal-text-area-padding-inline: var(--calcite-spacing-sm);--calcite-internal-text-area-footer-min-height: 1.75rem}:host([scale=s]) .text-area,:host([scale=s]) .footer,:host([scale=s]) .character-limit{font-size:var(--calcite-text-area-font-size, var(--calcite-font-size--2))}:host([scale=s]) .character-limit{padding-inline-start:var(--calcite-spacing-sm)}:host([scale=m]){--calcite-internal-text-area-padding-block: var(--calcite-spacing-sm);--calcite-internal-text-area-padding-inline: var(--calcite-spacing-md);--calcite-internal-text-area-footer-min-height: 2.25rem}:host([scale=l]){--calcite-internal-text-area-padding-block: var(--calcite-spacing-md);--calcite-internal-text-area-padding-inline: var(--calcite-spacing-lg);--calcite-internal-text-area-footer-min-height: 2.75rem}:host([scale=l]) .text-area,:host([scale=l]) .footer,:host([scale=l]) .character-limit{font-size:var(--calcite-text-area-font-size, var(--calcite-font-size-0))}:host([scale=l]) .character-limit{padding-inline-start:var(--calcite-spacing-lg)}:host([status=invalid]){--calcite-internal-text-area-border-color: var(--calcite-color-status-danger)}:host([status=invalid]) .text-area:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-status-danger);outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}:host([disabled]) .text-area,:host([disabled]) .footer{opacity:var(--calcite-opacity-half)}.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([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}::placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-input-placeholder-text-color, var(--calcite-color-text-3))}`,p=class extends y{constructor(){super(...arguments),this.attributeWatch=E(["autofocus","spellcheck"],this.handleGlobalAttributesChanged),this.footerRef=b(),this.guid=S(),this.resizeObserver=k("resize",async()=>{await this.componentOnReady();let{textAreaHeight:e,textAreaWidth:t,elHeight:l,elWidth:n,footerHeight:d,footerWidth:o,validationMessageHeight:h}=this.getHeightAndWidthOfElements();if(o>0&&o!==t&&(this.footerRef.value.style.width=`${t}px`),this.resize==="none")return;let{width:G,height:P}=getComputedStyle(this.el);n!==t&&G!=="auto"&&this.updateSizeToAuto("width"),l!==e+d+h&&P!=="auto"&&this.updateSizeToAuto("height")}),this.cancelable=R()(this),this.updateSizeToAuto=M(e=>{this.el.style[e]="auto"},U,{edges:["trailing"]}),this.messages=C({blocking:!0}),this.focusSetter=$()(this),this.disabled=!1,this.groupSeparator=!1,this.limitText=!1,this.readOnly=!1,this.required=!1,this.resize="both",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.value="",this.wrap="soft",this.calciteTextAreaChange=g(),this.calciteTextAreaInput=g()}static{this.properties={endSlotHasElements:[16,{},{state:!0}],startSlotHasElements:[16,{},{state:!0}],columns:[11,{},{reflect:!0,type:Number}],disabled:[7,{},{reflect:!0,type:Boolean}],form:[3,{},{reflect:!0}],groupSeparator:[7,{},{reflect:!0,type:Boolean}],label:1,labelText:1,limitText:[7,{},{reflect:!0,type:Boolean}],maxLength:[11,{},{reflect:!0,type:Number}],messageOverrides:[0,{},{attribute:!1}],minLength:[11,{},{reflect:!0,type:Number}],name:[3,{},{reflect:!0}],numberingSystem:1,placeholder:1,readOnly:[7,{},{reflect:!0,type:Boolean}],required:[7,{},{reflect:!0,type:Boolean}],resize:[3,{},{reflect:!0}],rows:[11,{},{reflect:!0,type:Number}],scale:[3,{},{reflect:!0}],status:[3,{},{reflect:!0}],validationIcon:[3,{converter:z,type:String},{reflect:!0}],validationMessage:1,validity:[0,{},{attribute:!1}],value:1,wrap:[3,{},{reflect:!0}]}}static{this.styles=_}async selectText(){await this.componentOnReady(),this.textAreaEl?.select()}async setFocus(e){return this.focusSetter(()=>this.textAreaEl,e)}connectedCallback(){super.connectedCallback(),W(this),H(this),this.cancelable.add(this.updateSizeToAuto)}updated(){O(this),this.setTextAreaHeight()}disconnectedCallback(){super.disconnectedCallback(),F(this),T(this),this.resizeObserver?.disconnect()}handleGlobalAttributesChanged(){this.requestUpdate()}onLabelClick(){this.setFocus()}handleInput(e){this.value=e.target.value,this.calciteTextAreaInput.emit()}handleChange(){this.calciteTextAreaChange.emit()}contentSlotChangeHandler(){this.value||this.el.childNodes.forEach(t=>{t.nodeName==="#text"&&(this.value=t.nodeValue.trim())})}getLocalizedCharacterLength(){let e=this.value?this.value.length.toString():"0",t=this.maxLength.toString();return this.numberingSystem==="latn"?{currentLength:e,maxLength:t}:(c.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,signDisplay:"never",useGrouping:this.groupSeparator},{currentLength:c.localize(e),maxLength:c.localize(t)})}syncHiddenFormInput(e){e.setCustomValidity(""),this.isCharacterLimitExceeded()&&e.setCustomValidity(this.replacePlaceholdersInMessages()),N("textarea",this,e)}setTextAreaEl(e){L(this.resizeObserver,this.textAreaEl,e),this.textAreaEl=e}setTextAreaHeight(){let{textAreaHeight:e,elHeight:t,footerHeight:l,validationMessageHeight:n}=this.getHeightAndWidthOfElements();l>0&&e+l+n!=t&&(this.textAreaEl.style.height=`${t-l}px`)}getHeightAndWidthOfElements(){let{height:e,width:t}=this.textAreaEl?this.textAreaEl.getBoundingClientRect():f,{height:l,width:n}=this.el.getBoundingClientRect(),{height:d,width:o}=this.footerRef.value?this.footerRef.value.getBoundingClientRect():f,{height:h}=this.validationMessageEl?this.validationMessageEl.getBoundingClientRect():f;return{textAreaHeight:e,textAreaWidth:t,elHeight:l,elWidth:n,footerHeight:d,footerWidth:o,validationMessageHeight:h}}replacePlaceholdersInMessages(){return this.messages.tooLong.replace("{maxLength}",this.localizedCharacterLengthObj.maxLength).replace("{currentLength}",this.localizedCharacterLengthObj.currentLength)}isCharacterLimitExceeded(){return this.value?.length>this.maxLength}setValidationRef(e){e&&(this.validationMessageEl=e)}render(){let e=this.startSlotHasElements||this.endSlotHasElements||!!this.maxLength;return A({disabled:this.disabled,children:s`<div class=${i(a.wrapper)}>${this.labelText&&q({labelText:this.labelText,onClick:this.onLabelClick,required:this.required,tooltipText:this.messages.required})||""}<textarea aria-describedby=${this.guid??r} aria-errormessage=${V.validationMessage} .ariaInvalid=${this.status==="invalid"||this.isCharacterLimitExceeded()} .ariaLabel=${j(this)} .autofocus=${this.el.autofocus} class=${i({[a.textArea]:!0,[a.readOnly]:this.readOnly,[a.textAreaInvalid]:this.isCharacterLimitExceeded(),[a.footerSlotted]:this.endSlotHasElements&&this.startSlotHasElements,[a.textAreaOnly]:!e})} .cols=${this.columns} .disabled=${this.disabled} maxlength=${(this.limitText?this.maxLength:void 0)??r} name=${this.name??r} @change=${this.handleChange} @input=${this.handleInput} placeholder=${this.placeholder??r} .readOnly=${this.readOnly} .required=${this.required} .rows=${this.rows} spellcheck=${this.el.spellcheck??r} .value=${x(this.value??"")} wrap=${this.wrap??r} ${m(this.setTextAreaEl)}></textarea><span class=${i({[a.content]:!0})}><slot @slotchange=${this.contentSlotChangeHandler}></slot></span><footer class=${i({[a.footer]:!0,[a.readOnly]:this.readOnly,[a.hide]:!e})} ${m(this.footerRef)}><div class=${i({[a.container]:!0,[a.footerEndSlotOnly]:!this.startSlotHasElements&&this.endSlotHasElements})}><slot name=${D.footerStart} @slotchange=${t=>this.startSlotHasElements=u(t)}></slot><slot name=${D.footerEnd} @slotchange=${t=>this.endSlotHasElements=u(t)}></slot></div>${this.renderCharacterLimit()}</footer>${I({component:this})}${this.isCharacterLimitExceeded()&&s`<span aria-live=polite class=${i(a.assistiveText)} id=${this.guid??r}>${this.replacePlaceholdersInMessages()}</span>`||""}${this.validationMessage&&this.status==="invalid"?B({icon:this.validationIcon,id:V.validationMessage,message:this.validationMessage,ref:this.setValidationRef,scale:this.scale,status:this.status}):null}</div>`})}renderCharacterLimit(){return this.maxLength?(this.localizedCharacterLengthObj=this.getLocalizedCharacterLength(),s`<span class=${i(a.characterLimit)}><span class=${i({[a.characterOverLimit]:this.isCharacterLimitExceeded()})}>${this.localizedCharacterLengthObj.currentLength}</span>/${this.localizedCharacterLengthObj.maxLength}</span>`):null}};w("calcite-text-area",p);export{p as TextArea};
|
|
@@ -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,t as m}from"./
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a as C,t as m}from"./V4NPQ4WA.js";import"./FZIUTVKD.js";import{a as y}from"./NULQJBCW.js";import{d as z}from"./5IPJANUU.js";import"./ZLR2B6GQ.js";import{D as S,E as l,P as k,g,h as $,i as a,l as t}from"./AUIOWPFN.js";var h={swatch:"swatch",noColorSwatch:"swatch--no-color",checker:"checker"},x={borderLight:"rgba(0, 0, 0, 0.3)",borderDark:"rgba(255, 255, 255, 0.15)"},b=4,i={squareSize:b,size:b*2},v={checker:"checker",shape:"shape"},R=g`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host{position:relative;display:inline-flex}:host([scale=s]){block-size:1.25rem;inline-size:1.25rem}:host([scale=m]){block-size:1.5rem;inline-size:1.5rem}:host([scale=l]){block-size:2rem;inline-size:2rem}.swatch{overflow:hidden;block-size:inherit;inline-size:inherit}.swatch rect{transition-property:all;transition-duration:var(--calcite-animation-timing);transition-timing-function:cubic-bezier(.4,0,.2,1)}.swatch--no-color rect{fill:var(--calcite-color-foreground-1)}.swatch--no-color line{stroke:var(--calcite-color-status-danger)}.checker{fill:#cacaca}:host([hidden]){display:none}[hidden]{display:none}`,u=class extends S{constructor(){super(...arguments),this.active=!1,this.scale="m"}static{this.properties={active:[7,{},{reflect:!0,type:Boolean}],color:1,scale:[3,{},{reflect:!0}]}}static{this.styles=R}load(){this.handleColorChange(this.color)}willUpdate(e){e.has("color")&&this.handleColorChange(this.color)}handleColorChange(e){this.internalColor=e?C(e):null}render(){let e=!this.internalColor,c={[h.swatch]:!0,[h.noColorSwatch]:e};return $`<svg class=${l(c)} xmlns=http://www.w3.org/2000/svg>${this.renderSwatch()}</svg>`}renderSwatch(){let{active:e,el:c,internalColor:s}=this,o=e?"100%":"0",n=z(c)==="light"?x.borderLight:x.borderDark,d=!s,r={height:"100%",rx:o,stroke:n,strokeWidth:"2",width:"100%"};if(d)return a`<clipPath id=${v.shape}><rect height=100% rx=${o??t} width=100% /></clipPath>${this.renderSwatchRect({clipPath:`inset(0 round ${o})`,...r})}<line clip-path=url(#shape) stroke-width=3 x1=100% x2=0 y1=0 y2=100% />`;let p=s.alpha(),q=m(s),f=m(s,p<1);return a`<title>${f}</title><defs><pattern height=${i.size} id=${v.checker} patternUnits=userSpaceOnUse width=${i.size} x=0 y=0><rect class=${l(h.checker)} height=${i.squareSize} width=${i.squareSize} x=0 y=0 /><rect class=${l(h.checker)} height=${i.squareSize} width=${i.squareSize} x=${i.squareSize} y=${i.squareSize} /></pattern></defs>${this.renderSwatchRect({fill:"url(#checker)",rx:r.rx,height:r.height,width:r.width})}${this.renderSwatchRect({clipPath:p<1?"polygon(100% 0, 0 0, 0 100%)":`inset(0 round ${o})`,fill:q,...r})}${p<1?this.renderSwatchRect({clipPath:"polygon(100% 0, 100% 100%, 0 100%)",fill:f,key:"opacity-fill",...r}):null}`}renderSwatchRect({clipPath:e,fill:c,height:s,key:o,rx:w,stroke:n,strokeWidth:d,width:r}){return y(o,a`<rect clip-path=${e??t} fill=${c??t} height=${s??t} rx=${w??t} stroke=${n??t} stroke-width=${d??t} width=${r??t} />`)}};k("calcite-color-picker-swatch",u);export{u as ColorPickerSwatch};
|
|
@@ -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,b,c}from"./
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a,b,c}from"./NID6WJOW.js";import"./WPTOKN7K.js";export{b as extractRegion,c as getCountry,a as global};
|
|
@@ -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}from"./
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a}from"./NLYYOFNV.js";import{c as $}from"./H2FWQITV.js";import{e as S}from"./5IPJANUU.js";import{C as A,h as g,l as v}from"./AUIOWPFN.js";var b=t=>Array.from(t.querySelectorAll("calcite-action")).filter(e=>e.closest("calcite-action-menu")?e.slot===$.trigger:!0),D=({actionGroups:t,expanded:e,overflowCount:o})=>{let c=o;t.reverse().forEach(l=>{let i=0,s=b(l).reverse();s.forEach(n=>{n.slot===a.menuActions&&(n.removeAttribute("slot"),n.textEnabled=e)}),c>0&&s.some(n=>(s.filter(u=>!u.slot).length>1&&s.length>2&&!n.closest("calcite-action-menu")&&(n.textEnabled=!0,n.setAttribute("slot",a.menuActions),i++,i>1&&c--),c<1)),l.manager.component.requestUpdate()})},E={chevronsLeft:"chevrons-left",chevronsRight:"chevrons-right"};function y(t,e){return t||e.closest("calcite-shell-panel")?.position||"start"}function G({el:t,expanded:e}){b(t).filter(o=>o.slot!==a.menuActions).forEach(o=>o.textEnabled=e),t.querySelectorAll("calcite-action-group, calcite-action-menu").forEach(o=>o.expanded=e)}var L=({tooltip:t,referenceElement:e,expanded:o,ref:c})=>(t&&(t.referenceElement=!o&&e?e:null),c&&c(e),e),P=({expanded:t,expandText:e,collapseText:o,expandLabel:c,collapseLabel:l,toggle:i,el:s,position:n,tooltip:f,ref:u,scale:d})=>{let T=S(s)==="rtl",m=t?o:e,p=t?l:c,r=[E.chevronsLeft,E.chevronsRight];T&&r.reverse();let h=y(n,s)==="end",q=h?r[1]:r[0],x=h?r[0]:r[1];return g`<calcite-action .aria=${{expanded:t}} .icon=${t?q:x} id=expand-toggle .label=${p} @click=${i} .scale=${d} .text=${m} .textEnabled=${t} title=${(!t&&!f?m:null)??v} ${A(C=>L({tooltip:f,referenceElement:C,expanded:t,ref:u}))}></calcite-action>`};export{b as a,D as b,G as c,P as d};
|
|
@@ -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 d}from"./
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a as d}from"./OCT7LR2O.js";import{a as n}from"./ALDDSDTX.js";import{D as l,E as i,P as c,g as o,h as t,o as r}from"./AUIOWPFN.js";var s={title:"title",firstTitle:"first-title",separator:"separator"},h=o`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host{display:block}.container{text-align:start}.title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;font-weight:var(--calcite-font-weight-bold);color:var(--calcite-dropdown-group-title-text-color, var(--calcite-color-text-1))}.separator{display:block;block-size:1px;background-color:var(--calcite-dropdown-group-border-color, var(--calcite-color-border-3))}:host([scale=s]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .title{padding-block:var(--calcite-spacing-xxs);padding-inline:var(--calcite-spacing-sm)}:host([scale=s]) .first-title{padding-block-start:var(--calcite-spacing-sm)}:host([scale=s]) .separator{margin-block:var(--calcite-spacing-xxs);margin-inline:var(--calcite-spacing-sm)}:host([scale=m]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .title{padding-block:var(--calcite-spacing-sm);padding-inline:var(--calcite-spacing-md)}:host([scale=m]) .first-title{padding-block-start:var(--calcite-spacing-lg)}:host([scale=m]) .separator{margin-block:var(--calcite-spacing-sm);margin-inline:var(--calcite-spacing-md)}:host([scale=l]){font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .title{padding-block:var(--calcite-spacing-sm-plus);padding-inline:var(--calcite-spacing-lg)}:host([scale=l]) .first-title{padding-block-start:var(--calcite-spacing-xl)}:host([scale=l]) .separator{margin-block:var(--calcite-spacing-sm-plus);margin-inline:var(--calcite-spacing-lg)}:host([hidden]){display:none}[hidden]{display:none}`,a=class extends l{constructor(){super(),this.mutationObserver=n("mutation",()=>this.updateItems()),this.position=-1,this.scale="m",this.selectionMode="single",this.calciteInternalDropdownItemChange=r({cancelable:!1}),this.listen("calciteInternalDropdownItemSelect",this.updateActiveItemOnChange)}static{this.properties={groupTitle:[3,{},{reflect:!0}],position:[9,{},{type:Number}],scale:[3,{},{reflect:!0}],selectionMode:[3,{},{reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=h}connectedCallback(){super.connectedCallback(),this.updateItems(),this.mutationObserver?.observe(this.el,{childList:!0})}willUpdate(e){e.has("selectionMode")&&(this.hasUpdated||this.selectionMode!=="single")&&this.updateItems()}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect()}updateActiveItemOnChange(e){this.requestedDropdownGroup=e.detail.requestedDropdownGroup,this.requestedDropdownItem=e.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}updateItems(){Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach(e=>e.selectionMode=this.selectionMode)}render(){let e=this.groupTitle?t`<span aria-hidden=true class=${i({[s.title]:!0,[s.firstTitle]:this.position===0})}>${this.groupTitle}</span>`:null,p=this.position>0?t`<div class=${i(s.separator)} role=separator></div>`:null;return this.el.ariaLabel=this.groupTitle,this.el.role="group",t`<div class=${i({[d.container]:!0})}>${p}${e}<slot></slot></div>`}};c("calcite-dropdown-group",a);export{a as DropdownGroup};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{b as A}from"./2C6PV6LO.js";import{a as E,b as L,c as I,d as D,f as _,h as b}from"./32YCYEKN.js";import{k as F}from"./RUMWLVIQ.js";import{a as W,b as K}from"./WNEJDZTS.js";import{a as G,b as z}from"./PRB44CR7.js";import{a as g}from"./H42LHYUA.js";import{a as q}from"./MPZ73UTT.js";import{a as B}from"./EQC2JW3I.js";import"./2DX2SAQ7.js";import{a as T}from"./J2NLU7RP.js";import{a as N}from"./PNBL2IVW.js";import{a as U}from"./HKVRX5SD.js";import"./D5SFHDV6.js";import"./TLLHA7VC.js";import"./VZVYZPXQ.js";import{g as R,t as v}from"./Z6CRZOOK.js";import{a as H}from"./XRJOD24G.js";import{C,D as M,E as h,K as O,P as k,g as w,h as d,o as m}from"./CSQVLDPF.js";var f={container:"container",table:"table",scrim:"scrim",stack:"stack",tableContainer:"table-container",sticky:"sticky-pos",assistiveText:"assistive-text",containerHeight:"container-height"},y={filterNoResults:"filter-no-results",filterActionsStart:"filter-actions-start",filterActionsEnd:"filter-actions-end"},j=w`: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:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{position:relative;background-color:var(--calcite-list-background-color, var(--calcite-color-foreground-1))}.container-height{block-size:100%}.table-container{box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:transparent}.table-container *{box-sizing:border-box}.table{inline-size:100%}.stack{--calcite-stack-padding-inline: 0;--calcite-stack-padding-block: 0}.sticky-pos{position:sticky;inset-block-start:0px;z-index:var(--calcite-z-index-sticky);background-color:var(--calcite-list-background-color, var(--calcite-color-foreground-1))}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}`,J=`${L}, ${I}`,P=class extends M{constructor(){super(),this.dragSelector=I,this.focusableItems=[],this.handleSelector="calcite-sort-handle",this.listItems=[],this.listItemGroups=[],this.mutationObserver=T("mutation",()=>{this.willPerformFilter=!0,this.updateListItemsDebounced()}),this.cancelable=q()(this),this.updateListItemsDebounced=B(this.updateListItems,O.nextTick),this.visibleItems=[],this.willFilterEmit=!1,this.willPerformFilter=!1,this.messages=N({blocking:!0}),this.focusSetter=U()(this),this.dataForFilter=[],this.hasFilterActionsEnd=!1,this.hasFilterActionsStart=!1,this.hasFilterNoResults=!1,this.sortHandleMenuItems=[],this.disabled=!1,this.dragEnabled=!1,this.filterEnabled=!1,this.filteredData=[],this.filteredItems=[],this.interactionMode="interactive",this.loading=!1,this.displayMode="flat",this.scale="m",this.selectedItems=[],this.selectionAppearance="icon",this.selectionMode="none",this.sortDisabled=!1,this.calciteInternalListDefaultSlotChange=m({cancelable:!1}),this.calciteListChange=m({cancelable:!1}),this.calciteListDragEnd=m({cancelable:!1}),this.calciteListDragStart=m({cancelable:!1}),this.calciteListFilter=m({cancelable:!1}),this.calciteListMoveHalt=m({cancelable:!1}),this.calciteListOrderChange=m({cancelable:!1}),this.listen("calciteInternalListItemToggle",this.handleCalciteListItemToggle),this.listen("calciteInternalFocusPreviousItem",this.handleCalciteInternalFocusPreviousItem),this.listen("calciteInternalListItemActive",this.handleCalciteInternalListItemActive),this.listen("calciteListItemSelect",this.handleCalciteListItemSelect),this.listen("calciteInternalAssistiveTextChange",this.handleCalciteInternalAssistiveTextChange),this.listen("calciteListItemSortHandleBeforeOpen",this.updateListItemsDebounced),this.listen("calciteSortHandleReorder",this.handleSortReorder),this.listen("calciteSortHandleMove",this.handleSortMove),this.listen("calciteSortHandleAdd",this.handleSortAdd),this.listen("calciteInternalListItemSelect",this.handleCalciteInternalListItemSelect),this.listen("calciteInternalListItemSelectMultiple",this.handleCalciteInternalListItemSelectMultiple),this.listen("calciteInternalListItemChange",this.handleCalciteInternalListItemChange),this.listen("calciteInternalListItemGroupDefaultSlotChange",this.handleCalciteInternalListItemGroupDefaultSlotChange)}static{this.properties={assistiveText:[16,{},{state:!0}],dataForFilter:[16,{},{state:!0}],hasFilterActionsEnd:[16,{},{state:!0}],hasFilterActionsStart:[16,{},{state:!0}],hasFilterNoResults:[16,{},{state:!0}],sortHandleMenuItems:[16,{},{state:!0}],canPull:[0,{},{attribute:!1}],canPut:[0,{},{attribute:!1}],disabled:[7,{},{reflect:!0,type:Boolean}],dragEnabled:[7,{},{reflect:!0,type:Boolean}],filterEnabled:[7,{},{reflect:!0,type:Boolean}],filterPredicate:[0,{},{attribute:!1}],filterLabel:[3,{},{reflect:!0}],filterPlaceholder:[3,{},{reflect:!0}],filterProps:[0,{},{attribute:!1}],filterText:[3,{},{reflect:!0}],filteredData:[0,{},{attribute:!1}],filteredItems:[0,{},{attribute:!1}],group:[3,{},{reflect:!0}],interactionMode:[3,{},{reflect:!0}],label:1,loading:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],displayMode:[3,{},{reflect:!0}],numberingSystem:1,scale:[3,{},{reflect:!0}],selectedItems:[0,{},{attribute:!1}],selectionAppearance:[3,{},{reflect:!0}],selectionMode:[3,{},{reflect:!0}],sortDisabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=j}get hasActiveFilter(){return this.filterEnabled&&this.filterText&&this.filteredItems.length!==this.visibleItems.length}get showNoResultsContainer(){return this.filterEnabled&&this.filterText&&this.hasFilterNoResults&&this.visibleItems.length&&!this.filteredItems.length}async setFocus(e){return this.focusSetter(()=>this.filterEnabled?this.filterEl:this.focusableItems.find(t=>t.active),e)}emitOrderChangeEvent(e){this.calciteListOrderChange.emit(e)}connectedCallback(){super.connectedCallback(),this.connectObserver(),this.willPerformFilter=!0,this.updateListItemsDebounced(),this.setUpSorting(),this.setParentList(),this.setListItemGroups(),this.cancelable.add(this.updateListItemsDebounced)}async load(){this.handleInteractionModeWarning()}willUpdate(e){(e.has("filterText")||e.has("filterProps")||e.has("filterPredicate"))&&this.performFilter(),(e.has("filterEnabled")&&(this.hasUpdated||this.filterEnabled!==!1)||e.has("group")||e.has("sortDisabled")&&(this.hasUpdated||this.sortDisabled!==!1)||e.has("dragEnabled")&&(this.hasUpdated||this.dragEnabled!==!1)||e.has("selectionMode")&&(this.hasUpdated||this.selectionMode!=="none")||e.has("selectionAppearance")&&(this.hasUpdated||this.selectionAppearance!=="icon")||e.has("displayMode")&&this.hasUpdated||e.has("scale")&&this.hasUpdated||e.has("canPull")&&this.hasUpdated||e.has("canPut")&&this.hasUpdated||e.has("filterPredicate")&&this.hasUpdated)&&this.handleListItemChange()}updated(){G(this)}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObserver(),K(this)}updateListItems(){this.updateGroupItems();let{selectionAppearance:e,selectionMode:t,interactionMode:s,dragEnabled:a,el:i,filterEl:n,displayMode:l,scale:r,sortDisabled:c,sortHandleMenuItems:u}=this,p=Array.from(this.el.querySelectorAll(I)),S=i,$=Array.from(S.children).filter(b);if(p.forEach(o=>{o.scale=r,o.selectionAppearance=e,o.selectionMode=t,o.interactionMode=s,o.closest(E)===i&&(o.moveToItems=u.filter(x=>this.validateSortMenuItem({type:"move",fromEl:S,toEl:x.element,dragEl:o,newIndex:0,oldIndex:$.indexOf(o)})),o.addToItems=this.sortHandleMenuItems.filter(x=>this.validateSortMenuItem({type:"add",fromEl:S,toEl:x.element,dragEl:o,newIndex:0,oldIndex:$.indexOf(o)})),o.dragHandle=a,o.displayMode=l,o.sortDisabled=c)}),this.parentListEl){this.setUpSorting();return}this.listItems=p,this.filterEnabled&&this.willPerformFilter&&(this.willPerformFilter=!1,this.dataForFilter=this.getItemData(),n&&(n.items=this.dataForFilter,this.filterAndUpdateData())),this.visibleItems=this.listItems.filter(o=>!o.closed&&!o.hidden),this.updateFilteredItems(),this.borderItems(),this.focusableItems=this.filteredItems.filter(o=>!o.disabled),this.setActiveListItem(),this.updateSelectedItems(),this.setUpSorting()}handleListItemChange(){this.willPerformFilter=!0,this.updateListItemsDebounced()}handleCalciteListItemToggle(e){this.parentListEl||(e.stopPropagation(),this.borderItems())}handleCalciteInternalFocusPreviousItem(e){if(this.parentListEl)return;e.stopPropagation();let{focusableItems:t}=this,a=t.findIndex(i=>i.active)-1;t[a]&&this.focusRow(t[a])}handleCalciteInternalListItemActive(e){if(this.parentListEl)return;e.stopPropagation();let t=e.target,{listItems:s}=this;s.forEach(a=>{a.active=a===t})}handleCalciteListItemSelect(){this.parentListEl||this.updateSelectedItems(!0)}handleCalciteInternalAssistiveTextChange(e){this.assistiveText=e.detail.message,e.stopPropagation()}handleSortReorder(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleReorder(e))}handleSortAdd(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleAdd(e))}handleSortMove(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleMove(e))}handleCalciteInternalListItemSelect(e){if(this.parentListEl)return;e.stopPropagation();let t=e.target,{listItems:s,selectionMode:a}=this;t.selected&&(a==="single"||a==="single-persist")&&s.forEach(i=>i.selected=i===t),this.updateSelectedItems()}handleCalciteInternalListItemSelectMultiple(e){if(this.parentListEl)return;e.stopPropagation();let{target:t,detail:s}=e,{focusableItems:a,lastSelectedInfo:i}=this,n=t;if(s.selectMultiple&&i){let l=a.indexOf(n),r=a.indexOf(i.selectedItem),c=Math.min(r,l),u=Math.max(r,l);a.slice(c,u+1).forEach(p=>p.selected=i.selected)}else this.lastSelectedInfo={selectedItem:n,selected:n.selected}}handleCalciteInternalListItemChange(e){this.parentListEl||(e.stopPropagation(),this.updateListItemsDebounced())}handleCalciteInternalListItemGroupDefaultSlotChange(e){e.stopPropagation()}connectObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}disconnectObserver(){this.mutationObserver?.disconnect()}setUpSorting(){let{dragEnabled:e,defaultSlotEl:t}=this;e&&(t&&_(t),W(this))}onGlobalDragStart(){this.disconnectObserver()}onGlobalDragEnd(){this.connectObserver()}onDragEnd(e){this.calciteListDragEnd.emit(e)}onDragStart(e){e.dragEl.sortHandleOpen=!1,this.calciteListDragStart.emit(e)}onDragSort(e){this.setParentList(),this.updateListItemsDebounced(),this.calciteListOrderChange.emit(e)}setParentList(){this.parentListEl=this.el.parentElement?.closest(E)}handleDefaultSlotChange(){this.parentListEl&&this.calciteInternalListDefaultSlotChange.emit()}setListItemGroups(){this.listItemGroups=Array.from(this.el.querySelectorAll(L))}handleFilterActionsStartSlotChange(e){this.hasFilterActionsStart=v(e)}handleFilterActionsEndSlotChange(e){this.hasFilterActionsEnd=v(e)}handleFilterNoResultsSlotChange(e){this.hasFilterNoResults=v(e)}setActiveListItem(){let{focusableItems:e}=this;e.some(t=>t.active)||e[0]&&(e[0].active=!0)}async updateSelectedItems(e=!1){await this.updateComplete,this.selectedItems=this.visibleItems.filter(t=>t.selected),e&&this.calciteListChange.emit()}filterElements({el:e,filteredItems:t,visibleParents:s}){let a=!s.has(e)&&!t.includes(e);e.filterHidden=a;let i=e.parentElement.closest(J);i&&(a||s.add(i),this.filterElements({el:i,filteredItems:t,visibleParents:s}))}allParentListItemsExpanded(e){let t=e.parentElement?.closest(I);if(t){if(!t.expanded)return!1}else return!0;return this.allParentListItemsExpanded(t)}borderItems(){let e=this.visibleItems.filter(t=>!t.filterHidden&&this.allParentListItemsExpanded(t));e.forEach(t=>t.bordered=t!==e[e.length-1])}updateFilteredItems(){let{visibleItems:e,filteredData:t,filterText:s,filterPredicate:a}=this,i=e?.filter(r=>e.every(c=>c===r||!r.contains(c))),n=a?e.filter(a):s?t.map(r=>r.el):e||[],l=new WeakSet;i.forEach(r=>this.filterElements({el:r,filteredItems:n,visibleParents:l})),this.filteredItems=n,this.willFilterEmit&&(this.willFilterEmit=!1,this.calciteListFilter.emit())}updateFilteredData(){let{filterEl:e}=this;e&&(e.filteredItems&&(this.filteredData=e.filteredItems),this.updateListItemsDebounced())}async filterAndUpdateData(){await this.filterEl?.filter(this.filterText),this.updateFilteredData()}get effectiveFilterProps(){return this.filterProps?this.filterProps.filter(e=>e!=="el"):["description","label","metadata","heading"]}performFilter(){let{filterEl:e,filterText:t,effectiveFilterProps:s}=this;e&&(e.value=t,e.filterProps=s,this.filterAndUpdateData())}setDefaultSlotEl(e){this.defaultSlotEl=e}setFilterEl(e){this.filterEl=e,this.performFilter()}handleFilterChange(e){e.stopPropagation();let{value:t}=e.currentTarget;this.filterText=t,this.willFilterEmit=!0,this.updateFilteredData()}getItemData(){return this.listItems.map(e=>({label:e.label,description:e.description,metadata:e.metadata,heading:this.getGroupHeading(e),el:e}))}getGroupHeading(e){return this.listItemGroups.filter(s=>s.contains(e)).map(s=>s.heading)}updateGroupItems(){let{el:e,group:t,scale:s}=this,a=R(e),i=t?Array.from(a.querySelectorAll(`${E}[group="${t}"]`)).filter(l=>!l.disabled&&l.dragEnabled):[];this.sortHandleMenuItems=i.map(l=>({element:l,label:l.label??l.id,id:H()})),Array.from(this.el.querySelectorAll(L)).forEach(l=>{l.scale=s})}focusRow(e){let{focusableItems:t}=this;e&&(t.forEach(s=>s.active=s===e),e.setFocus())}isNavigable(e){let t=e.parentElement?.closest(I);return t?t.expanded&&this.isNavigable(t):!0}handleListKeydown(e){if(e.defaultPrevented||this.parentListEl)return;let{key:t}=e,s=this.focusableItems.filter(i=>this.isNavigable(i)),a=s.findIndex(i=>i.active);if(t==="ArrowDown"){e.preventDefault();let i=e.target===this.filterEl?0:a+1;s[i]&&this.focusRow(s[i])}else if(t==="ArrowUp"){if(e.preventDefault(),a===0&&this.filterEnabled){this.filterEl.setFocus();return}let i=a-1;s[i]&&this.focusRow(s[i])}else if(t==="Home"){e.preventDefault();let i=s[0];i&&this.focusRow(i)}else if(t==="End"){e.preventDefault();let i=s[s.length-1];i&&this.focusRow(i)}}handleInteractionModeWarning(){this.interactionMode==="static"&&this.selectionMode!=="none"&&this.selectionAppearance==="border"&&console.warn('selection-appearance="border" requires interaction-mode="interactive"')}validateSortMenuItem({fromEl:e,toEl:t,dragEl:s,newIndex:a,oldIndex:i,type:n}){if(!e||!t||t===e||s.contains(t))return!1;let l=e.canPull?.({toEl:t,fromEl:e,dragEl:s,newIndex:a,oldIndex:i})??!0,r=t.canPut?.({toEl:t,fromEl:e,dragEl:s,newIndex:a,oldIndex:i})??!0;return(n==="add"?l==="clone":l===!0)&&r}handleAdd(e){let{addTo:t}=e.detail,s=e.target,a=s?.parentElement,i=t.element,l=Array.from(a.children).filter(b).indexOf(s),r=0;if(!this.validateSortMenuItem({type:"add",fromEl:a,toEl:i,dragEl:s,newIndex:r,oldIndex:l}))return;s.sortHandleOpen=!1,this.disconnectObserver();let c=s.cloneNode();i.prepend(c),D(s),this.updateListItemsDebounced(),this.connectObserver();let u={dragEl:s,fromEl:a,toEl:i,newIndex:r,oldIndex:l};this.calciteListOrderChange.emit(u),i.emitOrderChangeEvent(u)}handleMove(e){let{moveTo:t}=e.detail,s=e.target,a=s?.parentElement,i=t.element,l=Array.from(a.children).filter(b).indexOf(s),r=0;if(!this.validateSortMenuItem({type:"move",fromEl:a,toEl:i,dragEl:s,newIndex:r,oldIndex:l}))return;s.sortHandleOpen=!1,this.disconnectObserver(),i.prepend(s),D(s),this.updateListItemsDebounced(),this.connectObserver();let c={dragEl:s,fromEl:a,toEl:i,newIndex:r,oldIndex:l};this.calciteListOrderChange.emit(c),i.emitOrderChangeEvent(c)}handleReorder(e){let{reorder:t}=e.detail,s=e.target,a=s?.parentElement;if(!a)return;s.sortHandleOpen=!1;let i=Array.from(a.children).filter(b),n=i.length-1,l=i.indexOf(s),r=l;switch(t){case"top":r=0;break;case"bottom":r=n;break;case"up":r=l===0?0:l-1;break;case"down":r=l===n?n:l+1;break}this.disconnectObserver();let c=t==="up"||t==="top"?i[r]:i[r].nextSibling;a.insertBefore(s,c),this.updateListItemsDebounced(),this.connectObserver(),this.calciteListOrderChange.emit({dragEl:s,fromEl:a,toEl:a,newIndex:r,oldIndex:l})}render(){let{loading:e,label:t,disabled:s,dataForFilter:a,filterEnabled:i,filterPlaceholder:n,filterText:l,filterLabel:r,hasFilterActionsStart:c,hasFilterActionsEnd:u,effectiveFilterProps:p}=this;return z({disabled:this.disabled,children:d`<div class=${h({[f.container]:!0,[f.containerHeight]:this.listItems.length<1&&e})}>${this.dragEnabled?d`<span aria-live=assertive class=${h(f.assistiveText)}>${this.assistiveText}</span>`:null}${this.renderItemAriaLive()}${e?d`<calcite-scrim class=${h(f.scrim)} .loading=${e}></calcite-scrim>`:null}<div .ariaBusy=${e} .ariaLabel=${t||""} class=${h(f.table)} @keydown=${this.handleListKeydown} role=treegrid>${i||c||u?d`<div class=${h(f.sticky)} role=rowgroup><div role=row><div role=columnheader><calcite-stack class=${h(f.stack)}><slot name=${y.filterActionsStart} @slotchange=${this.handleFilterActionsStartSlotChange} slot=${A.actionsStart}></slot><calcite-filter .ariaLabel=${n} .disabled=${s} .filterProps=${p} .items=${a} .label=${r} @calciteFilterChange=${this.handleFilterChange} .placeholder=${n} .scale=${this.scale} .value=${l} ${C(this.setFilterEl)}></calcite-filter><slot name=${y.filterActionsEnd} @slotchange=${this.handleFilterActionsEndSlotChange} slot=${A.actionsEnd}></slot></calcite-stack></div></div></div>`:null}<div class=${h(f.tableContainer)} role=rowgroup><slot @slotchange=${this.handleDefaultSlotChange} ${C(this.setDefaultSlotEl)}></slot></div></div><div aria-live=polite data-test-id=no-results-container .hidden=${!this.showNoResultsContainer}><slot name=${y.filterNoResults} @slotchange=${this.handleFilterNoResultsSlotChange}></slot></div></div>`})}renderItemAriaLive(){let{messages:e,filteredItems:t,parentListEl:s,messages:{_lang:a},numberingSystem:i}=this;return F.numberFormatOptions={locale:a,numberingSystem:i},s?null:d`<div aria-live=polite class=${h(f.assistiveText)}>${this.hasActiveFilter?g("aria-filter-enabled",d`<div>${e.filterEnabled}</div>`):null}${g("aria-item-count",d`<div>${e.total.replace("{count}",F.localize(t.length.toString()))}</div>`)}${t.length?g("aria-item-list",d`<ol>${t.map(n=>d`<li>${n.label}</li>`)}</ol>`):null}</div>`}};k("calcite-list",P);export{P as List};
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{b as A}from"./DJVVGNTK.js";import{a as E,b as L,c as I,d as D,f as _,h as b}from"./LJI5SYGA.js";import{k as F}from"./CVLFEMH2.js";import{a as W,b as K}from"./RND3V33U.js";import{a as G,b as z}from"./NSBK36H4.js";import{a as g}from"./NULQJBCW.js";import{a as q}from"./PSCEW76J.js";import{a as B}from"./W5OJOVZY.js";import"./S5CLKCGJ.js";import{a as T}from"./ALDDSDTX.js";import{a as N}from"./LH7245HX.js";import{a as U}from"./WOTQIMPZ.js";import"./B5JXPZDV.js";import"./3YZG7MA3.js";import"./CIU4VM7X.js";import{g as R,t as v}from"./5IPJANUU.js";import{a as H}from"./ZLR2B6GQ.js";import{C,D as M,E as h,K as O,P as k,g as w,h as d,o as m}from"./AUIOWPFN.js";var f={container:"container",table:"table",scrim:"scrim",stack:"stack",tableContainer:"table-container",sticky:"sticky-pos",assistiveText:"assistive-text",containerHeight:"container-height"},y={filterNoResults:"filter-no-results",filterActionsStart:"filter-actions-start",filterActionsEnd:"filter-actions-end"},j=w`: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:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{position:relative;background-color:var(--calcite-list-background-color, var(--calcite-color-foreground-1))}.container-height{block-size:100%}.table-container{box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:transparent}.table-container *{box-sizing:border-box}.table{inline-size:100%}.stack{--calcite-stack-padding-inline: 0;--calcite-stack-padding-block: 0}.sticky-pos{position:sticky;inset-block-start:0px;z-index:var(--calcite-z-index-sticky);background-color:var(--calcite-list-background-color, var(--calcite-color-foreground-1))}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}`,J=`${L}, ${I}`,P=class extends M{constructor(){super(),this.dragSelector=I,this.focusableItems=[],this.handleSelector="calcite-sort-handle",this.listItems=[],this.listItemGroups=[],this.mutationObserver=T("mutation",()=>{this.willPerformFilter=!0,this.updateListItemsDebounced()}),this.cancelable=q()(this),this.updateListItemsDebounced=B(this.updateListItems,O.nextTick),this.visibleItems=[],this.willFilterEmit=!1,this.willPerformFilter=!1,this.messages=N({blocking:!0}),this.focusSetter=U()(this),this.dataForFilter=[],this.hasFilterActionsEnd=!1,this.hasFilterActionsStart=!1,this.hasFilterNoResults=!1,this.sortHandleMenuItems=[],this.disabled=!1,this.dragEnabled=!1,this.filterEnabled=!1,this.filteredData=[],this.filteredItems=[],this.interactionMode="interactive",this.loading=!1,this.displayMode="flat",this.scale="m",this.selectedItems=[],this.selectionAppearance="icon",this.selectionMode="none",this.sortDisabled=!1,this.calciteInternalListDefaultSlotChange=m({cancelable:!1}),this.calciteListChange=m({cancelable:!1}),this.calciteListDragEnd=m({cancelable:!1}),this.calciteListDragStart=m({cancelable:!1}),this.calciteListFilter=m({cancelable:!1}),this.calciteListMoveHalt=m({cancelable:!1}),this.calciteListOrderChange=m({cancelable:!1}),this.listen("calciteInternalListItemToggle",this.handleCalciteListItemToggle),this.listen("calciteInternalFocusPreviousItem",this.handleCalciteInternalFocusPreviousItem),this.listen("calciteInternalListItemActive",this.handleCalciteInternalListItemActive),this.listen("calciteListItemSelect",this.handleCalciteListItemSelect),this.listen("calciteInternalAssistiveTextChange",this.handleCalciteInternalAssistiveTextChange),this.listen("calciteListItemSortHandleBeforeOpen",this.updateListItemsDebounced),this.listen("calciteSortHandleReorder",this.handleSortReorder),this.listen("calciteSortHandleMove",this.handleSortMove),this.listen("calciteSortHandleAdd",this.handleSortAdd),this.listen("calciteInternalListItemSelect",this.handleCalciteInternalListItemSelect),this.listen("calciteInternalListItemSelectMultiple",this.handleCalciteInternalListItemSelectMultiple),this.listen("calciteInternalListItemChange",this.handleCalciteInternalListItemChange),this.listen("calciteInternalListItemGroupDefaultSlotChange",this.handleCalciteInternalListItemGroupDefaultSlotChange)}static{this.properties={assistiveText:[16,{},{state:!0}],dataForFilter:[16,{},{state:!0}],hasFilterActionsEnd:[16,{},{state:!0}],hasFilterActionsStart:[16,{},{state:!0}],hasFilterNoResults:[16,{},{state:!0}],sortHandleMenuItems:[16,{},{state:!0}],canPull:[0,{},{attribute:!1}],canPut:[0,{},{attribute:!1}],disabled:[7,{},{reflect:!0,type:Boolean}],dragEnabled:[7,{},{reflect:!0,type:Boolean}],filterEnabled:[7,{},{reflect:!0,type:Boolean}],filterPredicate:[0,{},{attribute:!1}],filterLabel:[3,{},{reflect:!0}],filterPlaceholder:[3,{},{reflect:!0}],filterProps:[0,{},{attribute:!1}],filterText:[3,{},{reflect:!0}],filteredData:[0,{},{attribute:!1}],filteredItems:[0,{},{attribute:!1}],group:[3,{},{reflect:!0}],interactionMode:[3,{},{reflect:!0}],label:1,loading:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],displayMode:[3,{},{reflect:!0}],numberingSystem:1,scale:[3,{},{reflect:!0}],selectedItems:[0,{},{attribute:!1}],selectionAppearance:[3,{},{reflect:!0}],selectionMode:[3,{},{reflect:!0}],sortDisabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=j}get hasActiveFilter(){return this.filterEnabled&&this.filterText&&this.filteredItems.length!==this.visibleItems.length}get showNoResultsContainer(){return this.filterEnabled&&this.filterText&&this.hasFilterNoResults&&this.visibleItems.length&&!this.filteredItems.length}async setFocus(e){return this.focusSetter(()=>this.filterEnabled?this.filterEl:this.focusableItems.find(t=>t.active),e)}emitOrderChangeEvent(e){this.calciteListOrderChange.emit(e)}connectedCallback(){super.connectedCallback(),this.connectObserver(),this.willPerformFilter=!0,this.updateListItemsDebounced(),this.setUpSorting(),this.setParentList(),this.setListItemGroups(),this.cancelable.add(this.updateListItemsDebounced)}async load(){this.handleInteractionModeWarning()}willUpdate(e){(e.has("filterText")||e.has("filterProps")||e.has("filterPredicate"))&&this.performFilter(),(e.has("filterEnabled")&&(this.hasUpdated||this.filterEnabled!==!1)||e.has("group")||e.has("sortDisabled")&&(this.hasUpdated||this.sortDisabled!==!1)||e.has("dragEnabled")&&(this.hasUpdated||this.dragEnabled!==!1)||e.has("selectionMode")&&(this.hasUpdated||this.selectionMode!=="none")||e.has("selectionAppearance")&&(this.hasUpdated||this.selectionAppearance!=="icon")||e.has("displayMode")&&this.hasUpdated||e.has("scale")&&this.hasUpdated||e.has("canPull")&&this.hasUpdated||e.has("canPut")&&this.hasUpdated||e.has("filterPredicate")&&this.hasUpdated)&&this.handleListItemChange()}updated(){G(this)}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObserver(),K(this)}updateListItems(){this.updateGroupItems();let{selectionAppearance:e,selectionMode:t,interactionMode:s,dragEnabled:a,el:i,filterEl:n,displayMode:l,scale:r,sortDisabled:c,sortHandleMenuItems:u}=this,p=Array.from(this.el.querySelectorAll(I)),S=i,$=Array.from(S.children).filter(b);if(p.forEach(o=>{o.scale=r,o.selectionAppearance=e,o.selectionMode=t,o.interactionMode=s,o.closest(E)===i&&(o.moveToItems=u.filter(x=>this.validateSortMenuItem({type:"move",fromEl:S,toEl:x.element,dragEl:o,newIndex:0,oldIndex:$.indexOf(o)})),o.addToItems=this.sortHandleMenuItems.filter(x=>this.validateSortMenuItem({type:"add",fromEl:S,toEl:x.element,dragEl:o,newIndex:0,oldIndex:$.indexOf(o)})),o.dragHandle=a,o.displayMode=l,o.sortDisabled=c)}),this.parentListEl){this.setUpSorting();return}this.listItems=p,this.filterEnabled&&this.willPerformFilter&&(this.willPerformFilter=!1,this.dataForFilter=this.getItemData(),n&&(n.items=this.dataForFilter,this.filterAndUpdateData())),this.visibleItems=this.listItems.filter(o=>!o.closed&&!o.hidden),this.updateFilteredItems(),this.borderItems(),this.focusableItems=this.filteredItems.filter(o=>!o.disabled),this.setActiveListItem(),this.updateSelectedItems(),this.setUpSorting()}handleListItemChange(){this.willPerformFilter=!0,this.updateListItemsDebounced()}handleCalciteListItemToggle(e){this.parentListEl||(e.stopPropagation(),this.borderItems())}handleCalciteInternalFocusPreviousItem(e){if(this.parentListEl)return;e.stopPropagation();let{focusableItems:t}=this,a=t.findIndex(i=>i.active)-1;t[a]&&this.focusRow(t[a])}handleCalciteInternalListItemActive(e){if(this.parentListEl)return;e.stopPropagation();let t=e.target,{listItems:s}=this;s.forEach(a=>{a.active=a===t})}handleCalciteListItemSelect(){this.parentListEl||this.updateSelectedItems(!0)}handleCalciteInternalAssistiveTextChange(e){this.assistiveText=e.detail.message,e.stopPropagation()}handleSortReorder(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleReorder(e))}handleSortAdd(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleAdd(e))}handleSortMove(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleMove(e))}handleCalciteInternalListItemSelect(e){if(this.parentListEl)return;e.stopPropagation();let t=e.target,{listItems:s,selectionMode:a}=this;t.selected&&(a==="single"||a==="single-persist")&&s.forEach(i=>i.selected=i===t),this.updateSelectedItems()}handleCalciteInternalListItemSelectMultiple(e){if(this.parentListEl)return;e.stopPropagation();let{target:t,detail:s}=e,{focusableItems:a,lastSelectedInfo:i}=this,n=t;if(s.selectMultiple&&i){let l=a.indexOf(n),r=a.indexOf(i.selectedItem),c=Math.min(r,l),u=Math.max(r,l);a.slice(c,u+1).forEach(p=>p.selected=i.selected)}else this.lastSelectedInfo={selectedItem:n,selected:n.selected}}handleCalciteInternalListItemChange(e){this.parentListEl||(e.stopPropagation(),this.updateListItemsDebounced())}handleCalciteInternalListItemGroupDefaultSlotChange(e){e.stopPropagation()}connectObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}disconnectObserver(){this.mutationObserver?.disconnect()}setUpSorting(){let{dragEnabled:e,defaultSlotEl:t}=this;e&&(t&&_(t),W(this))}onGlobalDragStart(){this.disconnectObserver()}onGlobalDragEnd(){this.connectObserver()}onDragEnd(e){this.calciteListDragEnd.emit(e)}onDragStart(e){e.dragEl.sortHandleOpen=!1,this.calciteListDragStart.emit(e)}onDragSort(e){this.setParentList(),this.updateListItemsDebounced(),this.calciteListOrderChange.emit(e)}setParentList(){this.parentListEl=this.el.parentElement?.closest(E)}handleDefaultSlotChange(){this.parentListEl&&this.calciteInternalListDefaultSlotChange.emit()}setListItemGroups(){this.listItemGroups=Array.from(this.el.querySelectorAll(L))}handleFilterActionsStartSlotChange(e){this.hasFilterActionsStart=v(e)}handleFilterActionsEndSlotChange(e){this.hasFilterActionsEnd=v(e)}handleFilterNoResultsSlotChange(e){this.hasFilterNoResults=v(e)}setActiveListItem(){let{focusableItems:e}=this;e.some(t=>t.active)||e[0]&&(e[0].active=!0)}async updateSelectedItems(e=!1){await this.updateComplete,this.selectedItems=this.visibleItems.filter(t=>t.selected),e&&this.calciteListChange.emit()}filterElements({el:e,filteredItems:t,visibleParents:s}){let a=!s.has(e)&&!t.includes(e);e.filterHidden=a;let i=e.parentElement.closest(J);i&&(a||s.add(i),this.filterElements({el:i,filteredItems:t,visibleParents:s}))}allParentListItemsExpanded(e){let t=e.parentElement?.closest(I);if(t){if(!t.expanded)return!1}else return!0;return this.allParentListItemsExpanded(t)}borderItems(){let e=this.visibleItems.filter(t=>!t.filterHidden&&this.allParentListItemsExpanded(t));e.forEach(t=>t.bordered=t!==e[e.length-1])}updateFilteredItems(){let{visibleItems:e,filteredData:t,filterText:s,filterPredicate:a}=this,i=e?.filter(r=>e.every(c=>c===r||!r.contains(c))),n=a?e.filter(a):s?t.map(r=>r.el):e||[],l=new WeakSet;i.forEach(r=>this.filterElements({el:r,filteredItems:n,visibleParents:l})),this.filteredItems=n,this.willFilterEmit&&(this.willFilterEmit=!1,this.calciteListFilter.emit())}updateFilteredData(){let{filterEl:e}=this;e&&(e.filteredItems&&(this.filteredData=e.filteredItems),this.updateListItemsDebounced())}async filterAndUpdateData(){await this.filterEl?.filter(this.filterText),this.updateFilteredData()}get effectiveFilterProps(){return this.filterProps?this.filterProps.filter(e=>e!=="el"):["description","label","metadata","heading"]}performFilter(){let{filterEl:e,filterText:t,effectiveFilterProps:s}=this;e&&(e.value=t,e.filterProps=s,this.filterAndUpdateData())}setDefaultSlotEl(e){this.defaultSlotEl=e}setFilterEl(e){this.filterEl=e,this.performFilter()}handleFilterChange(e){e.stopPropagation();let{value:t}=e.currentTarget;this.filterText=t,this.willFilterEmit=!0,this.updateFilteredData()}getItemData(){return this.listItems.map(e=>({label:e.label,description:e.description,metadata:e.metadata,heading:this.getGroupHeading(e),el:e}))}getGroupHeading(e){return this.listItemGroups.filter(s=>s.contains(e)).map(s=>s.heading)}updateGroupItems(){let{el:e,group:t,scale:s}=this,a=R(e),i=t?Array.from(a.querySelectorAll(`${E}[group="${t}"]`)).filter(l=>!l.disabled&&l.dragEnabled):[];this.sortHandleMenuItems=i.map(l=>({element:l,label:l.label??l.id,id:H()})),Array.from(this.el.querySelectorAll(L)).forEach(l=>{l.scale=s})}focusRow(e){let{focusableItems:t}=this;e&&(t.forEach(s=>s.active=s===e),e.setFocus())}isNavigable(e){let t=e.parentElement?.closest(I);return t?t.expanded&&this.isNavigable(t):!0}handleListKeydown(e){if(e.defaultPrevented||this.parentListEl)return;let{key:t}=e,s=this.focusableItems.filter(i=>this.isNavigable(i)),a=s.findIndex(i=>i.active);if(t==="ArrowDown"){e.preventDefault();let i=e.target===this.filterEl?0:a+1;s[i]&&this.focusRow(s[i])}else if(t==="ArrowUp"){if(e.preventDefault(),a===0&&this.filterEnabled){this.filterEl.setFocus();return}let i=a-1;s[i]&&this.focusRow(s[i])}else if(t==="Home"){e.preventDefault();let i=s[0];i&&this.focusRow(i)}else if(t==="End"){e.preventDefault();let i=s[s.length-1];i&&this.focusRow(i)}}handleInteractionModeWarning(){this.interactionMode==="static"&&this.selectionMode!=="none"&&this.selectionAppearance==="border"&&console.warn('selection-appearance="border" requires interaction-mode="interactive"')}validateSortMenuItem({fromEl:e,toEl:t,dragEl:s,newIndex:a,oldIndex:i,type:n}){if(!e||!t||t===e||s.contains(t))return!1;let l=e.canPull?.({toEl:t,fromEl:e,dragEl:s,newIndex:a,oldIndex:i})??!0,r=t.canPut?.({toEl:t,fromEl:e,dragEl:s,newIndex:a,oldIndex:i})??!0;return(n==="add"?l==="clone":l===!0)&&r}handleAdd(e){let{addTo:t}=e.detail,s=e.target,a=s?.parentElement,i=t.element,l=Array.from(a.children).filter(b).indexOf(s),r=0;if(!this.validateSortMenuItem({type:"add",fromEl:a,toEl:i,dragEl:s,newIndex:r,oldIndex:l}))return;s.sortHandleOpen=!1,this.disconnectObserver();let c=s.cloneNode();i.prepend(c),D(s),this.updateListItemsDebounced(),this.connectObserver();let u={dragEl:s,fromEl:a,toEl:i,newIndex:r,oldIndex:l};this.calciteListOrderChange.emit(u),i.emitOrderChangeEvent(u)}handleMove(e){let{moveTo:t}=e.detail,s=e.target,a=s?.parentElement,i=t.element,l=Array.from(a.children).filter(b).indexOf(s),r=0;if(!this.validateSortMenuItem({type:"move",fromEl:a,toEl:i,dragEl:s,newIndex:r,oldIndex:l}))return;s.sortHandleOpen=!1,this.disconnectObserver(),i.prepend(s),D(s),this.updateListItemsDebounced(),this.connectObserver();let c={dragEl:s,fromEl:a,toEl:i,newIndex:r,oldIndex:l};this.calciteListOrderChange.emit(c),i.emitOrderChangeEvent(c)}handleReorder(e){let{reorder:t}=e.detail,s=e.target,a=s?.parentElement;if(!a)return;s.sortHandleOpen=!1;let i=Array.from(a.children).filter(b),n=i.length-1,l=i.indexOf(s),r=l;switch(t){case"top":r=0;break;case"bottom":r=n;break;case"up":r=l===0?0:l-1;break;case"down":r=l===n?n:l+1;break}this.disconnectObserver();let c=t==="up"||t==="top"?i[r]:i[r].nextSibling;a.insertBefore(s,c),this.updateListItemsDebounced(),this.connectObserver(),this.calciteListOrderChange.emit({dragEl:s,fromEl:a,toEl:a,newIndex:r,oldIndex:l})}render(){let{loading:e,label:t,disabled:s,dataForFilter:a,filterEnabled:i,filterPlaceholder:n,filterText:l,filterLabel:r,hasFilterActionsStart:c,hasFilterActionsEnd:u,effectiveFilterProps:p}=this;return z({disabled:this.disabled,children:d`<div class=${h({[f.container]:!0,[f.containerHeight]:this.listItems.length<1&&e})}>${this.dragEnabled?d`<span aria-live=assertive class=${h(f.assistiveText)}>${this.assistiveText}</span>`:null}${this.renderItemAriaLive()}${e?d`<calcite-scrim class=${h(f.scrim)} .loading=${e}></calcite-scrim>`:null}<div .ariaBusy=${e} .ariaLabel=${t||""} class=${h(f.table)} @keydown=${this.handleListKeydown} role=treegrid>${i||c||u?d`<div class=${h(f.sticky)} role=rowgroup><div role=row><div role=columnheader><calcite-stack class=${h(f.stack)}><slot name=${y.filterActionsStart} @slotchange=${this.handleFilterActionsStartSlotChange} slot=${A.actionsStart}></slot><calcite-filter .ariaLabel=${n} .disabled=${s} .filterProps=${p} .items=${a} .label=${r} @calciteFilterChange=${this.handleFilterChange} .placeholder=${n} .scale=${this.scale} .value=${l} ${C(this.setFilterEl)}></calcite-filter><slot name=${y.filterActionsEnd} @slotchange=${this.handleFilterActionsEndSlotChange} slot=${A.actionsEnd}></slot></calcite-stack></div></div></div>`:null}<div class=${h(f.tableContainer)} role=rowgroup><slot @slotchange=${this.handleDefaultSlotChange} ${C(this.setDefaultSlotEl)}></slot></div></div><div aria-live=polite data-test-id=no-results-container .hidden=${!this.showNoResultsContainer}><slot name=${y.filterNoResults} @slotchange=${this.handleFilterNoResultsSlotChange}></slot></div></div>`})}renderItemAriaLive(){let{messages:e,filteredItems:t,parentListEl:s,messages:{_lang:a},numberingSystem:i}=this;return F.numberFormatOptions={locale:a,numberingSystem:i},s?null:d`<div aria-live=polite class=${h(f.assistiveText)}>${this.hasActiveFilter?g("aria-filter-enabled",d`<div>${e.filterEnabled}</div>`):null}${g("aria-item-count",d`<div>${e.total.replace("{count}",F.localize(t.length.toString()))}</div>`)}${t.length?g("aria-item-list",d`<ol>${t.map(n=>d`<li>${n.label}</li>`)}</ol>`):null}</div>`}};k("calcite-list",P);export{P as List};
|
|
@@ -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.5 */
|
|
4
|
+
import{a as C}from"./2GG4AF5T.js";import{a as H}from"./XRSYDXWZ.js";import{a as P}from"./2VKJIYLT.js";import{a as y}from"./NULQJBCW.js";import{a as O}from"./LH7245HX.js";import"./B5JXPZDV.js";import{D as z,e as B,t as L,u as M}from"./5IPJANUU.js";import"./ZLR2B6GQ.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"./AUIOWPFN.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{c as k,d as v,e as y}from"./
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{c as k,d as v,e as y}from"./ZVWKN3G7.js";import{a as E,b as m}from"./NSBK36H4.js";import{a as f}from"./LH7245HX.js";import{a as g}from"./WOTQIMPZ.js";import"./B5JXPZDV.js";import"./3YZG7MA3.js";import"./CIU4VM7X.js";import{u as p}from"./5IPJANUU.js";import"./ZLR2B6GQ.js";import{B as c,C as o,D as b,E as i,G as s,P as h,g as u,h as a,o as l}from"./AUIOWPFN.js";var $=u`: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:block}:host([scale=s]) .controls-wrapper{block-size:1.5rem}:host([scale=m]) .controls-wrapper{block-size:2rem}:host([scale=l]) .controls-wrapper{block-size:2.75rem}.wrapper{box-sizing:border-box;display:flex;justify-content:space-between;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;background-color:var(--calcite-inline-editable-background-color, var(--calcite-color-foreground-1))}.wrapper .input-wrapper{flex:1 1 0%}:host(:not([editing-enabled]):not([disabled])) .wrapper:hover{background-color:var(--calcite-inline-editable-background-color-hover, var(--calcite-color-foreground-2))}.controls-wrapper{display:flex}.cancel-editing-button[appearance=transparent][kind=neutral]{--calcite-internal-button-text-color: var(--calcite-color-text-3);--calcite-internal-button-border-block-start-color: var(--calcite-color-border-input);--calcite-internal-button-border-block-end-color: var(--calcite-color-border-input)}.cancel-editing-button[appearance=transparent][kind=neutral]:hover{--calcite-internal-button-text-color: var(--calcite-color-text-1)}.enable-editing-button--hidden{pointer-events:none;opacity:0;inline-size:0}.enable-editing-button[appearance=transparent][kind=neutral]{--calcite-internal-button-background-color: transparent}calcite-button{--calcite-button-background-color: var(--calcite-inline-editable-button-background-color);--calcite-button-corner-radius: var(--calcite-inline-editable-button-corner-radius);--calcite-button-loader-color: var(--calcite-inline-editable-button-loader-color);--calcite-button-shadow-color: var(--calcite-inline-editable-button-shadow-color);--calcite-button-text-color: var(--calcite-inline-editable-button-text-color)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,n={wrapper:"wrapper",confirmChangesButton:"confirm-changes-button",cancelEditingButton:"cancel-editing-button",inputWrapper:"input-wrapper",cancelEditingButtonWrapper:"cancel-editing-button-wrapper",enableEditingButton:"enable-editing-button",enableEditingButtonHidden:"enable-editing-button--hidden",controlsWrapper:"controls-wrapper"},r={check:"check",close:"x",pencil:"pencil"},d=class extends b{constructor(){super(),this.cancelEditingButtonRef=c(),this._editingEnabled=!1,this.enableEditingButtonRef=c(),this.messages=f(),this.focusSetter=g()(this),this.controls=!1,this.disabled=!1,this.loading=!1,this.scale="m",this.calciteInlineEditableEditCancel=l({cancelable:!1}),this.calciteInlineEditableEditConfirm=l({cancelable:!1}),this.calciteInternalInlineEditableEnableEditingChange=l({cancelable:!1}),this.listen("calciteInternalInputBlur",this.blurHandler)}static{this.properties={afterConfirm:[0,{},{attribute:!1}],controls:[7,{},{reflect:!0,type:Boolean}],disabled:[7,{},{reflect:!0,type:Boolean}],editingEnabled:[7,{},{reflect:!0,type:Boolean}],loading:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],scale:[3,{},{reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=$}get editingEnabled(){return this._editingEnabled}set editingEnabled(t){let e=this._editingEnabled;t!==e&&(this._editingEnabled=t,this.editingEnabledWatcher(t,e))}async setFocus(t){return this.focusSetter(()=>this.inputEl,t)}connectedCallback(){super.connectedCallback(),k(this)}updated(){E(this)}disconnectedCallback(){super.disconnectedCallback(),v(this)}get shouldShowControls(){return this.editingEnabled&&this.controls}editingEnabledWatcher(t,e){this.inputEl&&(this.inputEl.editingEnabled=t),!t&&e&&(this.shouldEmitCancel=!0)}blurHandler(){this.controls||this.disableEditing()}async handleDefaultSlotChange(t){let e=p(t).filter(C=>C.matches("calcite-input"))[0];this.inputEl=e,e&&(await e.componentOnReady(),e.editingEnabled=this.editingEnabled,e.label=e.label||y(this))}onLabelClick(){this.setFocus()}enableEditing(){this.valuePriorToEditing=this.inputEl?.value,this.editingEnabled=!0,this.inputEl?.setFocus(),this.calciteInternalInlineEditableEnableEditingChange.emit()}disableEditing(){this.editingEnabled=!1}cancelEditing(){this.inputEl&&(this.inputEl.value=this.valuePriorToEditing),this.disableEditing(),this.enableEditingButtonRef.value?.setFocus(),!this.editingEnabled&&this.shouldEmitCancel&&this.calciteInlineEditableEditCancel.emit()}escapeKeyHandler(t){t.defaultPrevented||(t.key==="Escape"&&(t.preventDefault(),this.cancelEditing()),t.key==="Tab"&&this.shouldShowControls&&(!t.shiftKey&&t.target===this.inputEl&&(t.preventDefault(),this.cancelEditingButtonRef.value.setFocus()),t.shiftKey&&t.target===this.cancelEditingButtonRef.value&&(t.preventDefault(),this.inputEl?.setFocus())))}async cancelEditingHandler(t){t.preventDefault(),this.cancelEditing()}enableEditingHandler(t){this.disabled||t.target!==this.enableEditingButtonRef.value&&t.target!==this.inputEl||(t.preventDefault(),this.editingEnabled||this.enableEditing())}async confirmChangesHandler(t){t.preventDefault(),this.calciteInlineEditableEditConfirm.emit();try{this.afterConfirm&&(this.loading=!0,await this.afterConfirm(),this.disableEditing(),this.enableEditingButtonRef.value?.setFocus())}catch{}finally{this.loading=!1}}render(){return m({disabled:this.disabled,children:a`<div class=${i(n.wrapper)} @click=${this.enableEditingHandler} @keydown=${this.escapeKeyHandler}><div class=${i(n.inputWrapper)}><slot @slotchange=${this.handleDefaultSlotChange}></slot></div><div class=${i(n.controlsWrapper)}><calcite-button appearance=transparent class=${i({[n.enableEditingButton]:!0,[n.enableEditingButtonHidden]:this.editingEnabled})} .iconStart=${r.pencil} kind=neutral .label=${this.messages.enableEditing} @click=${this.enableEditingHandler} .scale=${this.scale} title=${this.messages.enableEditing??s} type=button ${o(this.enableEditingButtonRef)}></calcite-button>${this.shouldShowControls&&[a`<div class=${i(n.cancelEditingButtonWrapper)}><calcite-button appearance=transparent class=${i(n.cancelEditingButton)} .iconStart=${r.close} kind=neutral .label=${this.messages.cancelEditing} @click=${this.cancelEditingHandler} .scale=${this.scale} title=${this.messages.cancelEditing??s} type=button ${o(this.cancelEditingButtonRef)}></calcite-button></div>`,a`<calcite-button appearance=solid class=${i(n.confirmChangesButton)} .iconStart=${r.check} kind=brand .label=${this.messages.confirmChanges} .loading=${this.loading} @click=${this.confirmChangesHandler} .scale=${this.scale} title=${this.messages.confirmChanges??s} type=button></calcite-button>`]||""}</div></div>`})}};h("calcite-inline-editable",d);export{d as InlineEditable};
|
|
@@ -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 $}from"./
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a as $}from"./RI3NRBMI.js";import{a as E}from"./KRHM7ACI.js";import{c as z,d as L,e as M}from"./ZVWKN3G7.js";import{c as C,e as S,f as A,h as D}from"./Y3HXK6MO.js";import{a as x,b as k}from"./NSBK36H4.js";import{a as I}from"./LH7245HX.js";import{a as w}from"./WOTQIMPZ.js";import"./B5JXPZDV.js";import"./3YZG7MA3.js";import"./CIU4VM7X.js";import{e as v,u as y}from"./5IPJANUU.js";import"./ZLR2B6GQ.js";import{D as u,E as f,I as g,P as b,g as h,h as c,l as m,o as p}from"./AUIOWPFN.js";var F={itemWrapper:"item-wrapper"},q={validationMessage:"segmentedControlValidationMessage"},R=h`: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}.item-wrapper{display:flex;background-color:var(--calcite-color-foreground-1);inline-size:fit-content;outline:1px solid var(--calcite-segmented-control-border-color, var(--calcite-color-border-input));outline-offset:-1px}:host([appearance=outline])>.item-wrapper{background-color:transparent}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([layout=vertical])>.item-wrapper{flex-direction:column;align-items:flex-start;align-self:flex-start}:host([width=full])>.item-wrapper{inline-size:100%;min-inline-size:fit-content}:host([width=full])>.item-wrapper ::slotted(calcite-segmented-control-item){flex:1 1 auto}:host([width=full][layout=vertical])>.item-wrapper ::slotted(calcite-segmented-control-item){justify-content:flex-start}.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}`,d=class extends u{constructor(){super(),this.items=[],this.messages=I(),this.focusSetter=w()(this),this.appearance="solid",this.disabled=!1,this.layout="horizontal",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.value=null,this.width="auto",this.calciteSegmentedControlChange=p({cancelable:!1}),this.listen("calciteInternalSegmentedControlItemChange",this.handleSelected),this.listen("keydown",this.handleKeyDown),this.listen("click",this.handleClick)}static{this.properties={appearance:[3,{},{reflect:!0}],disabled:[7,{},{reflect:!0,type:Boolean}],form:[3,{},{reflect:!0}],layout:[3,{},{reflect:!0}],labelText:1,messageOverrides:[0,{},{attribute:!1}],name:[3,{},{reflect:!0}],required:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],selectedItem:[0,{},{attribute:!1}],status:[3,{},{reflect:!0}],validationIcon:[3,{converter:g,type:String},{reflect:!0}],validationMessage:1,validity:[0,{},{attribute:!1}],value:1,width:[3,{},{reflect:!0}]}}static{this.styles=R}async setFocus(e){return this.focusSetter(()=>this.selectedItem||this.items[0],e)}connectedCallback(){super.connectedCallback(),z(this),C(this)}willUpdate(e){(e.has("appearance")&&(this.hasUpdated||this.appearance!=="solid")||e.has("layout")&&(this.hasUpdated||this.layout!=="horizontal")||e.has("scale")&&(this.hasUpdated||this.scale!=="m"))&&this.handleItemPropChange(),e.has("value")&&(this.hasUpdated||this.value!==null)&&this.valueHandler(this.value),e.has("selectedItem")&&this.handleSelectedItemChange(this.selectedItem,e.get("selectedItem"))}updated(){x(this)}loaded(){A(this,this.value)}disconnectedCallback(){super.disconnectedCallback(),L(this),S(this)}valueHandler(e){let{items:t}=this;t.forEach(a=>a.checked=a.value===e)}handleSelectedItemChange(e,t){if(this.value=e?.value,e===t)return;let{items:a}=this,s=a.filter(i=>i===e).pop();s?this.selectItem(s):a[0]&&(a[0].tabIndex=0)}handleClick(e){this.disabled||e.target.localName==="calcite-segmented-control-item"&&this.selectItem(e.target,!0)}handleSelected(e){e.preventDefault();let t=e.target;t.checked&&this.selectItem(t),e.stopPropagation()}handleKeyDown(e){let t=["ArrowLeft","ArrowUp","ArrowRight","ArrowDown"," "],{key:a}=e,{el:s,selectedItem:i}=this;if(t.indexOf(a)===-1)return;let l=a;v(s)==="rtl"&&(a==="ArrowRight"&&(l="ArrowLeft"),a==="ArrowLeft"&&(l="ArrowRight"));let{items:n}=this,r=-1;switch(n.forEach((o,U)=>{o===i&&(r=U)}),l){case"ArrowLeft":case"ArrowUp":{e.preventDefault();let o=r<1?n[n.length-1]:n[r-1];this.selectItem(o,!0);return}case"ArrowRight":case"ArrowDown":{e.preventDefault();let o=r===-1?n[1]:n[r+1]||n[0];this.selectItem(o,!0);return}case" ":e.preventDefault(),this.selectItem(e.target,!0);return;default:return}}handleItemPropChange(){let{items:e}=this;e.forEach(t=>{t.appearance=this.appearance,t.layout=this.layout,t.scale=this.scale})}handleSelectedItem(){let{items:e}=this,t=e.filter(a=>a.checked).pop();t?this.selectItem(t):e[0]&&(e[0].tabIndex=0)}async handleDefaultSlotChange(e){let t=y(e).filter(a=>a.matches("calcite-segmented-control-item"));await Promise.all(t.map(a=>a.componentOnReady())),this.items=t,this.handleSelectedItem(),this.handleItemPropChange()}onLabelClick(){this.setFocus()}async selectItem(e,t=!1){if(e===this.selectedItem)return;let{items:a}=this,s=null;a.forEach(i=>{let l=i===e;(l&&!i.checked||!l&&i.checked)&&(i.checked=l),i.tabIndex=l?0:-1,l&&(s=i)}),this.selectedItem=s,s&&t&&(await this.updateComplete,this.calciteSegmentedControlChange.emit(),s.focus())}render(){return this.el.role="radiogroup",c`${this.labelText&&E({labelText:this.labelText,onClick:this.onLabelClick,required:this.required,tooltipText:this.messages.required})||""}<div aria-errormessage=${q.validationMessage} aria-label=${M(this)??m} .ariaInvalid=${this.status==="invalid"} .ariaRequired=${this.required} class=${f(F.itemWrapper)}>${k({disabled:this.disabled,children:c`<slot @slotchange=${this.handleDefaultSlotChange}></slot>${D({component:this})}`})}</div>${this.validationMessage&&this.status==="invalid"?$({icon:this.validationIcon,id:q.validationMessage,message:this.validationMessage,scale:this.scale,status:this.status}):null}`}};b("calcite-segmented-control",d);export{d as SegmentedControl};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as b,e as g}from"./
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a as b,e as g}from"./MVLJJOH2.js";import"./YSP6WWQB.js";import"./5IPJANUU.js";import{a as p}from"./ZLR2B6GQ.js";import{D as s,E as t,F as e,G as c,P as m,g as r,h as a}from"./AUIOWPFN.js";var i={firstTitle:"first-title",list:"list",label:"label",separator:"separator",title:"title",scale:l=>`scale--${l}`},x=r`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}.scale--s{font-size:var(--calcite-font-size--2);line-height:1rem;--calcite-combobox-item-horizontal-spacing-unit: var(--calcite-spacing-sm);--calcite-combobox-item-vertical-spacing-unit: var(--calcite-spacing-xxs)}.scale--s .first-title{padding-block-start:var(--calcite-spacing-sm)}.scale--s .separator{margin-block:var(--calcite-combobox-item-vertical-spacing-unit);margin-inline-start:calc(var(--calcite-combobox-item-horizontal-spacing-unit) + var(--calcite-combobox-item-horizontal-spacing-unit) * var(--calcite-combobox-item-spacing-indent-multiplier));margin-inline-end:var(--calcite-combobox-item-horizontal-spacing-unit)}.scale--m{font-size:var(--calcite-font-size--1);line-height:1rem;--calcite-combobox-item-horizontal-spacing-unit: var(--calcite-spacing-md);--calcite-combobox-item-vertical-spacing-unit: var(--calcite-spacing-xs)}.scale--m .first-title{padding-block-start:var(--calcite-spacing-md)}.scale--m .separator{margin-block:var(--calcite-combobox-item-vertical-spacing-unit);margin-inline-start:calc(var(--calcite-combobox-item-horizontal-spacing-unit) + var(--calcite-combobox-item-horizontal-spacing-unit) * var(--calcite-combobox-item-spacing-indent-multiplier));margin-inline-end:var(--calcite-combobox-item-horizontal-spacing-unit)}.scale--l{font-size:var(--calcite-font-size-0);line-height:1.25rem;--calcite-combobox-item-horizontal-spacing-unit: var(--calcite-spacing-lg);--calcite-combobox-item-vertical-spacing-unit: var(--calcite-spacing-sm-plus)}.scale--l .first-title{padding-block-start:var(--calcite-spacing-xl)}.scale--l .separator{margin-block:var(--calcite-combobox-item-vertical-spacing-unit);margin-inline-start:calc(var(--calcite-combobox-item-horizontal-spacing-unit) + var(--calcite-combobox-item-horizontal-spacing-unit) * var(--calcite-combobox-item-spacing-indent-multiplier));margin-inline-end:var(--calcite-combobox-item-horizontal-spacing-unit)}:host,.list{margin:0;display:flex;flex-direction:column;padding:0}:host(:focus),.list:focus{outline:2px solid transparent;outline-offset:2px}.separator{block-size:var(--calcite-spacing-px);background-color:var(--calcite-combobox-item-group-border-color, var(--calcite-color-border-3))}.label{box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:0px;max-inline-size:100%}.title{--calcite-combobox-item-indent-value: calc( var(--calcite-combobox-item-horizontal-spacing-unit) * var(--calcite-combobox-item-spacing-indent-multiplier) );border:0 solid;display:block;flex:1 1 0%;font-weight:var(--calcite-font-weight-bold);word-wrap:break-word;word-break:break-word;padding-block:var(--calcite-combobox-item-vertical-spacing-unit);padding-inline-start:calc(var(--calcite-combobox-item-indent-value) + var(--calcite-combobox-item-horizontal-spacing-unit));padding-inline-end:var(--calcite-combobox-item-horizontal-spacing-unit);color:var(--calcite-combobox-item-group-text-color, var(--calcite-color-text-1))}:host([hidden]){display:none}[hidden]{display:none}:host([item-hidden]){display:none}`,o=class extends s{constructor(){super(...arguments),this.guid=p(),this.afterEmptyGroup=!1,this.position=0,this.scale="m",this.itemHidden=!1}static{this.properties={afterEmptyGroup:[7,{},{reflect:!0,type:Boolean}],ancestors:[0,{},{attribute:!1}],label:1,position:[9,{},{type:Number}],scale:1,itemHidden:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=x}connectedCallback(){super.connectedCallback(),this.ancestors=b(this.el)}render(){let{el:d,scale:u}=this,n=g(d),v=this.position>0?a`<div class=${t(i.separator)} role=separator style=${e({"--calcite-combobox-item-spacing-indent-multiplier":`${n}`})}></div>`:null;return a`<ul aria-labelledby=${this.guid??c} class=${t({[i.list]:!0,[i.scale(u)]:!0})} role=group>${v}<li class=${t({[i.label]:!0})} id=${this.guid??c} role=presentation style=${e({"--calcite-combobox-item-spacing-indent-multiplier":`${n}`})}><span class=${t({[i.title]:!0,[i.firstTitle]:this.position===0})}>${this.label}</span></li><slot></slot></ul>`}};m("calcite-combobox-item-group",o);export{o as ComboboxItemGroup};
|
|
@@ -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,b as f,c as b}from"./
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a,b as f,c as b}from"./NLYYOFNV.js";import{a as g}from"./LH7245HX.js";import{c as n}from"./H2FWQITV.js";import{a as h}from"./WOTQIMPZ.js";import"./B5JXPZDV.js";import"./3YZG7MA3.js";import"./CIU4VM7X.js";import{t as m}from"./5IPJANUU.js";import"./ZLR2B6GQ.js";import{D as u,E as p,P as d,g as r,h as t,o}from"./AUIOWPFN.js";var O=r`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{display:flex;flex-direction:column;padding:0;background-color:transparent;border-color:var(--calcite-action-group-border-color, var(--calcite-color-border-3));border-style:solid;border-width:0}.container{display:flex;flex-grow:1;flex-direction:column}:host([columns="1"]){--calcite-internal-action-group-columns: 1}:host([columns="2"]){--calcite-internal-action-group-columns: 2}:host([columns="3"]){--calcite-internal-action-group-columns: 3}:host([columns="4"]){--calcite-internal-action-group-columns: 4}:host([columns="5"]){--calcite-internal-action-group-columns: 5}:host([columns="6"]){--calcite-internal-action-group-columns: 6}:host(:first-child){padding-block-start:0px}:host([layout=horizontal]),:host([layout=horizontal]) .container{flex-direction:row}:host([layout=grid]){display:grid}:host([layout=grid]) .container{display:grid;place-content:stretch;background-color:transparent;grid-template-columns:repeat(var(--calcite-action-group-columns, var(--calcite-internal-action-group-columns, 3)),auto);gap:var(--calcite-action-group-gap, 1px);padding:var(--calcite-action-group-gap, 1px)}:host([layout=horizontal]) ::slotted(calcite-action-group){border-inline-end:var(--calcite-size-px)}:host([hidden]){display:none}[hidden]{display:none}`,s=class extends u{constructor(){super(...arguments),this.messages=g(),this.focusSetter=h()(this),this.hasMenuActions=!1,this.expanded=!1,this.layout="vertical",this.menuOpen=!1,this.overlayPositioning="absolute",this.scale="m",this.calciteActionGroupCollapse=o({cancelable:!1}),this.calciteActionGroupExpand=o({cancelable:!1})}static{this.properties={hasMenuActions:[16,{},{state:!0}],columns:[11,{},{type:Number,reflect:!0}],expanded:[7,{},{reflect:!0,type:Boolean}],label:1,layout:[3,{},{reflect:!0}],menuFlipPlacements:[0,{},{attribute:!1}],menuOpen:[7,{},{reflect:!0,type:Boolean}],menuPlacement:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],overlayPositioning:[3,{},{reflect:!0}],scale:[3,{},{reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=O}async setFocus(e){return this.focusSetter(()=>this.el,e)}willUpdate(e){e.has("expanded")&&((this.hasUpdated||this.expanded!==!1)&&(this.menuOpen=!1),this.hasUpdated&&(this.expanded?this.calciteActionGroupExpand.emit():this.calciteActionGroupCollapse.emit()))}setMenuOpen(e){this.menuOpen=!!e.currentTarget.open}handleMenuActionsSlotChange(e){this.hasMenuActions=m(e)}renderMenu(){let{expanded:e,menuOpen:x,scale:i,layout:l,messages:c,overlayPositioning:y,hasMenuActions:$,menuFlipPlacements:v,menuPlacement:S}=this;return t`<calcite-action-menu .expanded=${e} .flipPlacements=${v??(l==="horizontal"?["top","bottom"]:["left","right"])} .hidden=${!$} .label=${c.more} @calciteActionMenuOpen=${this.setMenuOpen} .open=${x} .overlayPositioning=${y} .placement=${S??(l==="horizontal"?"bottom-start":"leading-start")} .scale=${i}><calcite-action .aria=${{expanded:e}} .icon=${f.menu} .scale=${i} slot=${n.trigger} .text=${c.more} .textEnabled=${e}></calcite-action><slot name=${a.menuActions} @slotchange=${this.handleMenuActionsSlotChange}></slot><slot name=${a.menuTooltip} slot=${n.tooltip}></slot></calcite-action-menu>`}render(){return t`<div .ariaLabel=${this.label} class=${p(b.container)} role=group><slot></slot>${this.renderMenu()}</div>`}};d("calcite-action-group",s);export{s as ActionGroup};
|