@esri/calcite-components 5.1.1-next.6 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cdn/{BTSHRUHD.js → 2J4U5E4U.js} +1 -1
- package/dist/cdn/{FZTLSQJL.js → 2JJ5YBBT.js} +1 -1
- package/dist/cdn/{KQGUXAM6.js → 2P3LOGHK.js} +1 -1
- package/dist/cdn/{RIEKXKB2.js → 34ENIUR5.js} +1 -1
- package/dist/cdn/{YNG6JO67.js → 3KWJQXAT.js} +1 -1
- package/dist/cdn/{E4MGJ47Y.js → 3RRY5HHA.js} +1 -1
- package/dist/cdn/{MD2UCHOX.js → 3TYJSBP3.js} +1 -1
- package/dist/cdn/44HFP2I6.js +2 -0
- package/dist/cdn/44VCOKJX.js +2 -0
- package/dist/cdn/{CUSR767T.js → 47Q2AE5B.js} +1 -1
- package/dist/cdn/{CDGEWGDD.js → 4NUFBGFK.js} +1 -1
- package/dist/cdn/{7YNDWV76.js → 4UHTWXNV.js} +1 -1
- package/dist/cdn/{72EJ64LI.js → 524MMG22.js} +1 -1
- package/dist/cdn/{Y6WCKCHJ.js → 5D7IEY6J.js} +1 -1
- package/dist/cdn/{CUTXFNYN.js → 5O6YGOJE.js} +1 -1
- package/dist/cdn/{VCDOY22T.js → 5VAPN2S2.js} +1 -1
- package/dist/cdn/{ZEEFJOPQ.js → 6HRHKHF5.js} +1 -1
- package/dist/cdn/6S3G75WP.js +2 -0
- package/dist/cdn/6SZY5PY7.js +2 -0
- package/dist/cdn/{GEKASHNF.js → 6V3FX2W2.js} +1 -1
- package/dist/cdn/{FE3TGEP7.js → 6VDGKXTH.js} +1 -1
- package/dist/cdn/{HQHM5NWX.js → 6VP3K6WL.js} +1 -1
- package/dist/cdn/{6N246L5H.js → 6X3QWKZL.js} +1 -1
- package/dist/cdn/{ERBKUSSX.js → 6XMUSNRS.js} +1 -1
- package/dist/cdn/{773VWCGD.js → 7B4FOF3S.js} +1 -1
- package/dist/cdn/{SBQVCX2M.js → 7QS3Z4ZJ.js} +1 -1
- package/dist/cdn/{34WAUXUE.js → 7SDGC2RW.js} +1 -1
- package/dist/cdn/A6V4I2J3.js +2 -0
- package/dist/cdn/{QN4XN67Z.js → ALLL4LZ4.js} +1 -1
- package/dist/cdn/BCRYMNH7.js +2 -0
- package/dist/cdn/{CBUNIAKL.js → BSMPD6VA.js} +1 -1
- package/dist/cdn/C462ZIJD.js +2 -0
- package/dist/cdn/{QABVNEOF.js → C4DW27AP.js} +1 -1
- package/dist/cdn/C4OX3FC4.js +2 -0
- package/dist/cdn/{RZR44QGM.js → CDNETLLO.js} +1 -1
- package/dist/cdn/{NDVX6CLP.js → CENYPZ3Y.js} +1 -1
- package/dist/cdn/{RVXZUGJA.js → CEWOZ7LP.js} +1 -1
- package/dist/cdn/{WVJUNLFN.js → CM45J66U.js} +1 -1
- package/dist/cdn/{VYXKMJSU.js → COXLBEPM.js} +1 -1
- package/dist/cdn/CVJBK7K3.js +2 -0
- package/dist/cdn/{RUNWK23I.js → DDUIHGBF.js} +1 -1
- package/dist/cdn/{XCNAJ4XA.js → DK3SDSZL.js} +1 -1
- package/dist/cdn/{DJMAPSDY.js → DP2TY4KH.js} +1 -1
- package/dist/cdn/{TPML2DIA.js → E6X6BQLH.js} +1 -1
- package/dist/cdn/{JMKB4CRU.js → E7GXKIIO.js} +1 -1
- package/dist/cdn/{3XFDQDVC.js → ECVX7SVS.js} +1 -1
- package/dist/cdn/{UE4QYUAU.js → ELXBBUY5.js} +1 -1
- package/dist/cdn/{F5MS5PBN.js → EQKCU4NC.js} +1 -1
- package/dist/cdn/{SH7DQCS7.js → ETEMG44R.js} +1 -1
- package/dist/cdn/{MWMTHMMN.js → G2G6FHMB.js} +1 -1
- package/dist/cdn/{VVJGLEIA.js → GCAYSD7G.js} +1 -1
- package/dist/cdn/{YBFI2FQL.js → GDFQSWZ7.js} +1 -1
- package/dist/cdn/{72XY7IDN.js → GDYGEN45.js} +1 -1
- package/dist/cdn/{G62VTWNT.js → GTH6QFMV.js} +1 -1
- package/dist/cdn/{WAXTXFBL.js → HA65OOQD.js} +1 -1
- package/dist/cdn/HYIVUAZU.js +2 -0
- package/dist/cdn/{UIFHJ5IO.js → I4IDQ735.js} +1 -1
- package/dist/cdn/{O6PZKJ7R.js → ICGT7C6U.js} +1 -1
- package/dist/cdn/{3BUDIEL3.js → ID2LCYSN.js} +1 -1
- package/dist/cdn/{5RJTKL4J.js → IEWVQCQW.js} +1 -1
- package/dist/cdn/{3H6RVKMN.js → IHYNJVS4.js} +1 -1
- package/dist/cdn/{5N32D533.js → IMUM436K.js} +1 -1
- package/dist/cdn/{PJSI5N6F.js → IRANNKJ2.js} +1 -1
- package/dist/cdn/{C4DX6ZIA.js → JCVLN6XL.js} +1 -1
- package/dist/cdn/{5QXKHC54.js → JDVSVNSE.js} +1 -1
- package/dist/cdn/{6MUZLYOR.js → JGCJVDJA.js} +1 -1
- package/dist/cdn/{6UM5PQBD.js → JPPCKAMD.js} +1 -1
- package/dist/cdn/{OWJYARYV.js → JSXQ6NFN.js} +1 -1
- package/dist/cdn/KCN4PBFZ.js +2 -0
- package/dist/cdn/{7M4ANW77.js → KJCVGOXF.js} +1 -1
- package/dist/cdn/{OXKGEAUB.js → KLNQGCK2.js} +1 -1
- package/dist/cdn/KOWFGIAY.js +2 -0
- package/dist/cdn/{Y44WJ7Z2.js → KXD6O3ZI.js} +1 -1
- package/dist/cdn/{TFTS26NS.js → L3D2OBOR.js} +1 -1
- package/dist/cdn/L5IKT3WY.js +2 -0
- package/dist/cdn/LGB6OAXT.js +2 -0
- package/dist/cdn/{3NNR2AZU.js → LI2CATYC.js} +1 -1
- package/dist/cdn/{4NYY44U4.js → LJSR66HF.js} +1 -1
- package/dist/cdn/{YFUBBPNI.js → LKYA2H2B.js} +1 -1
- package/dist/cdn/{MRRVOAJL.js → LOJBKHVF.js} +1 -1
- package/dist/cdn/{A332WZ6V.js → MHE72N53.js} +1 -1
- package/dist/cdn/{REW7C42W.js → MW5MGBT4.js} +1 -1
- package/dist/cdn/{5SYOHCLD.js → NBAYHB3K.js} +1 -1
- package/dist/cdn/{3VNZC64N.js → NCSMOKFP.js} +1 -1
- package/dist/cdn/{XTGDCTQE.js → NG7BG3QY.js} +1 -1
- package/dist/cdn/NL77UDLL.js +2 -0
- package/dist/cdn/{D2HPEC7F.js → NTD2BJWG.js} +1 -1
- package/dist/cdn/{FKX46Z6K.js → ODGJXDZK.js} +1 -1
- package/dist/cdn/{OGNY6ZIB.js → ORIGVFX7.js} +1 -1
- package/dist/cdn/{N6V2UT62.js → OWIJSXYV.js} +1 -1
- package/dist/cdn/{EJUEMY56.js → OXCL3M4W.js} +1 -1
- package/dist/cdn/{I2DNOFC6.js → PB3LTBSS.js} +1 -1
- package/dist/cdn/{PW2XM5HR.js → PHEMAFCT.js} +1 -1
- package/dist/cdn/{FKPCRFUW.js → PIR7PWBO.js} +1 -1
- package/dist/cdn/PM5MZR4Z.js +2 -0
- package/dist/cdn/{TQJK5WF5.js → Q4V5DVKS.js} +1 -1
- package/dist/cdn/{YI3ZMHS5.js → Q56UST3A.js} +1 -1
- package/dist/cdn/{TMWGSGAP.js → QC5NB4VL.js} +1 -1
- package/dist/cdn/{5L5RJCKK.js → QEJBAQOY.js} +1 -1
- package/dist/cdn/{JDAOWOTY.js → QGF4JJQO.js} +1 -1
- package/dist/cdn/{DZSC3TJX.js → QZJ7GLQ3.js} +1 -1
- package/dist/cdn/RK2LH73E.js +2 -0
- package/dist/cdn/{5CBFI2KM.js → ROJYTRK6.js} +1 -1
- package/dist/cdn/{DAXLXKIY.js → RRKFBHMW.js} +1 -1
- package/dist/cdn/{KCENWQ6Z.js → RUUD543Z.js} +1 -1
- package/dist/cdn/{N3YQ6P66.js → S2BIRHQ7.js} +1 -1
- package/dist/cdn/{CQYI4Z2Z.js → SJCWFQNF.js} +1 -1
- package/dist/cdn/SNJLHXVG.js +2 -0
- package/dist/cdn/{IXQQO6HC.js → SNY2QKQJ.js} +1 -1
- package/dist/cdn/{27MK2V4G.js → ST6WRTR2.js} +1 -1
- package/dist/cdn/{WYGNUS2B.js → SW5TNX5V.js} +1 -1
- package/dist/cdn/SXXFODM6.js +2 -0
- package/dist/cdn/{4Q7PL2KY.js → TKK3AWQJ.js} +1 -1
- package/dist/cdn/{45C4ENM6.js → TTCZVBEF.js} +1 -1
- package/dist/cdn/TV47CRME.js +2 -0
- package/dist/cdn/{DEQNFOAS.js → TVU7KEKM.js} +1 -1
- package/dist/cdn/{C4PPQBLW.js → TVYIJRI2.js} +1 -1
- package/dist/cdn/{3XMNPYNB.js → TWVXE232.js} +1 -1
- package/dist/cdn/{32QFEQZS.js → TYQB2FN4.js} +1 -1
- package/dist/cdn/{ZBN5LXKS.js → U4GRIQVY.js} +1 -1
- package/dist/cdn/{Z2GSU7Q2.js → U7OJQ4EC.js} +1 -1
- package/dist/cdn/UCWB5EGV.js +2 -0
- package/dist/cdn/{CZPSEMDH.js → UTVGUMUM.js} +1 -1
- package/dist/cdn/{NAJTDRNC.js → V3X47NBI.js} +1 -1
- package/dist/cdn/{R4C3WA5S.js → V7PYDILT.js} +1 -1
- package/dist/cdn/{5JIKOOZ6.js → V7YPIVAX.js} +1 -1
- package/dist/cdn/{ROY5CHB3.js → VDJMOKVP.js} +1 -1
- package/dist/cdn/{2MRL4RKW.js → VEZBAZZG.js} +1 -1
- package/dist/cdn/VXBJOP6X.js +2 -0
- package/dist/cdn/{74UIHSVE.js → VZ2YR2UG.js} +1 -1
- package/dist/cdn/{KB2WIMAL.js → W57IL7KF.js} +1 -1
- package/dist/cdn/{5WFJNGXP.js → WCUO6JQN.js} +1 -1
- package/dist/cdn/{F3E7QPPC.js → WER7FADP.js} +1 -1
- package/dist/cdn/{F7RQCNJ4.js → WQCT4VLB.js} +1 -1
- package/dist/cdn/X3HV2NYH.js +2 -0
- package/dist/cdn/{SGZ3IG5W.js → XRUJ4D7O.js} +1 -1
- package/dist/cdn/{EHS7L663.js → XT4GLBAQ.js} +1 -1
- package/dist/cdn/{GYYFBZS2.js → Y7O6UR4T.js} +1 -1
- package/dist/cdn/{IHGSINVA.js → YHAJICJ2.js} +1 -1
- package/dist/cdn/{IRDSJTUK.js → YKL7MIG5.js} +1 -1
- package/dist/cdn/YYAYEKGB.js +2 -0
- package/dist/cdn/{TRN7FUFM.js → Z3IP3JBL.js} +1 -1
- package/dist/cdn/ZK2W2KJX.js +2 -0
- package/dist/cdn/ZOEJDQXA.js +2 -0
- package/dist/cdn/{RDOHAXOA.js → ZRMTOZ3B.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/ExpandToggle.js +1 -1
- package/dist/chunks/date.js +3 -3
- package/dist/chunks/dom.js +3 -15
- package/dist/chunks/floating-ui.js +1 -1
- package/dist/chunks/label.js +6 -6
- package/dist/chunks/locale.js +6 -3
- package/dist/chunks/manager.js +5 -5
- package/dist/chunks/resources10.js +63 -0
- package/dist/chunks/resources5.js +27 -52
- package/dist/chunks/resources6.js +48 -45
- package/dist/chunks/resources7.js +49 -7
- package/dist/chunks/resources8.js +9 -11
- package/dist/chunks/resources9.js +4 -48
- package/dist/chunks/runtime.js +4 -4
- package/dist/chunks/useTime.js +45 -40
- package/dist/chunks/utils2.js +59 -6
- package/dist/components/calcite-accordion-item/customElement.d.ts +6 -6
- package/dist/components/calcite-accordion-item/customElement.js +1 -1
- package/dist/components/calcite-alert/customElement.d.ts +2 -2
- package/dist/components/calcite-alert/customElement.js +4 -6
- package/dist/components/calcite-autocomplete/customElement.d.ts +16 -16
- package/dist/components/calcite-autocomplete/customElement.js +4 -4
- package/dist/components/calcite-autocomplete-item/customElement.d.ts +5 -5
- package/dist/components/calcite-avatar/customElement.d.ts +5 -5
- package/dist/components/calcite-card/customElement.d.ts +1 -1
- package/dist/components/calcite-carousel/customElement.js +6 -5
- package/dist/components/calcite-checkbox/customElement.d.ts +4 -4
- package/dist/components/calcite-checkbox/customElement.js +1 -1
- package/dist/components/calcite-chip/customElement.js +1 -27
- package/dist/components/calcite-chip-group/customElement.js +1 -1
- package/dist/components/calcite-color-picker/customElement.js +1 -1
- package/dist/components/calcite-color-picker-hex-input/customElement.js +1 -1
- package/dist/components/calcite-combobox/customElement.js +292 -143
- package/dist/components/calcite-combobox-item/customElement.js +1 -1
- package/dist/components/calcite-combobox-item-group/customElement.js +1 -1
- package/dist/components/calcite-date-picker/customElement.js +1 -1
- package/dist/components/calcite-date-picker-day/customElement.js +1 -1
- package/dist/components/calcite-date-picker-month/customElement.js +11 -2
- package/dist/components/calcite-dialog/customElement.js +8 -8
- package/dist/components/calcite-dropdown-group/customElement.js +1 -1
- package/dist/components/calcite-dropdown-item/customElement.js +1 -1
- package/dist/components/calcite-flow/customElement.d.ts +2 -2
- package/dist/components/calcite-flow/customElement.js +1 -1
- package/dist/components/calcite-flow-item/customElement.js +2 -2
- package/dist/components/calcite-input/customElement.js +5 -2
- package/dist/components/calcite-input-date-picker/customElement.js +5 -10
- package/dist/components/calcite-input-text/customElement.js +2 -2
- package/dist/components/calcite-input-time-zone/customElement.js +1 -1
- package/dist/components/calcite-list/customElement.d.ts +4 -4
- package/dist/components/calcite-list/customElement.js +6 -5
- package/dist/components/calcite-list-item/customElement.d.ts +6 -6
- package/dist/components/calcite-list-item/customElement.js +16 -13
- package/dist/components/calcite-list-item-group/customElement.d.ts +1 -1
- package/dist/components/calcite-list-item-group/customElement.js +1 -1
- package/dist/components/calcite-loader/customElement.js +3 -3
- package/dist/components/calcite-menu-item/customElement.d.ts +7 -7
- package/dist/components/calcite-menu-item/customElement.js +0 -3
- package/dist/components/calcite-meter/customElement.d.ts +6 -6
- package/dist/components/calcite-meter/customElement.js +7 -14
- package/dist/components/calcite-pagination/customElement.d.ts +1 -1
- package/dist/components/calcite-pagination/customElement.js +0 -3
- package/dist/components/calcite-panel/customElement.d.ts +6 -6
- package/dist/components/calcite-panel/customElement.js +1 -1
- package/dist/components/calcite-popover/customElement.d.ts +4 -4
- package/dist/components/calcite-popover/customElement.js +1 -1
- package/dist/components/calcite-progress/customElement.d.ts +2 -2
- package/dist/components/calcite-radio-button/customElement.d.ts +5 -5
- package/dist/components/calcite-radio-button/customElement.js +1 -1
- package/dist/components/calcite-radio-button-group/customElement.d.ts +4 -4
- package/dist/components/calcite-radio-button-group/customElement.js +3 -3
- package/dist/components/calcite-rating/customElement.d.ts +7 -7
- package/dist/components/calcite-rating/customElement.js +9 -13
- package/dist/components/calcite-sheet/customElement.js +27 -32
- package/dist/components/calcite-stack/customElement.js +1 -1
- package/dist/components/calcite-tab/customElement.d.ts +1 -1
- package/dist/components/calcite-tab/customElement.js +1 -2
- package/dist/components/calcite-tab-nav/customElement.d.ts +3 -3
- package/dist/components/calcite-tab-nav/customElement.js +7 -12
- package/dist/components/calcite-tab-title/customElement.d.ts +3 -3
- package/dist/components/calcite-tab-title/customElement.js +0 -2
- package/dist/components/calcite-table/customElement.js +14 -22
- package/dist/components/calcite-table-cell/customElement.d.ts +2 -2
- package/dist/components/calcite-table-cell/customElement.js +0 -6
- package/dist/components/calcite-table-header/customElement.d.ts +4 -4
- package/dist/components/calcite-table-header/customElement.js +0 -2
- package/dist/components/calcite-table-row/customElement.js +3 -5
- package/dist/components/calcite-tabs/customElement.js +2 -3
- package/dist/components/calcite-text-area/customElement.d.ts +12 -12
- package/dist/components/calcite-text-area/customElement.js +3 -5
- package/dist/components/calcite-tile/customElement.d.ts +6 -6
- package/dist/components/calcite-time-picker/customElement.d.ts +1 -1
- package/dist/components/calcite-time-picker/customElement.js +15 -35
- package/dist/components/calcite-tooltip/customElement.d.ts +2 -2
- package/dist/components/calcite-tooltip/customElement.js +1 -1
- package/dist/components/calcite-tree/customElement.js +6 -7
- package/dist/components/calcite-tree-item/customElement.d.ts +3 -3
- package/dist/components/calcite-tree-item/customElement.js +6 -12
- package/dist/controllers/useSortable.d.ts +2 -2
- package/dist/controllers/useTime.d.ts +20 -20
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/supported-browsers.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +2 -2
- package/dist/utils/dom.d.ts +1 -1
- package/package.json +9 -8
- package/dist/cdn/2PEF7GQE.js +0 -2
- package/dist/cdn/2VL3OCAZ.js +0 -2
- package/dist/cdn/6W4CWLXH.js +0 -2
- package/dist/cdn/73EQ5TEB.js +0 -2
- package/dist/cdn/74CLXGQH.js +0 -2
- package/dist/cdn/7AOQ4FPG.js +0 -2
- package/dist/cdn/ATWAUE4R.js +0 -2
- package/dist/cdn/BZJYGCDK.js +0 -2
- package/dist/cdn/C2BK5CUC.js +0 -2
- package/dist/cdn/I5HZNPIE.js +0 -2
- package/dist/cdn/JQIHTMWX.js +0 -2
- package/dist/cdn/KJNTF66K.js +0 -2
- package/dist/cdn/M2TFDONT.js +0 -2
- package/dist/cdn/OB3Z74X6.js +0 -2
- package/dist/cdn/OJO5NPP3.js +0 -2
- package/dist/cdn/QXPWDVC2.js +0 -2
- package/dist/cdn/SS4J7QES.js +0 -2
- package/dist/cdn/U6NA5WAH.js +0 -2
- package/dist/cdn/UOSSQPFY.js +0 -2
- package/dist/cdn/VWQPK5JA.js +0 -2
- package/dist/cdn/VYZ6WAWT.js +0 -2
- package/dist/cdn/W3N2DKPC.js +0 -2
- package/dist/cdn/WRQD4O6A.js +0 -2
- package/dist/cdn/WUBPEGFV.js +0 -2
- package/dist/cdn/Z7NNDJEN.js +0 -2
- package/dist/cdn/assets/icon/orientedImageryFullSuperimpose16.json +0 -1
- package/dist/cdn/assets/icon/orientedImageryFullSuperimpose24.json +0 -1
- package/dist/cdn/assets/icon/orientedImageryFullSuperimpose32.json +0 -1
- package/dist/cdn/assets/icon/orientedImageryHalfSuperimpose16.json +0 -1
- package/dist/cdn/assets/icon/orientedImageryHalfSuperimpose24.json +0 -1
- package/dist/cdn/assets/icon/orientedImageryHalfSuperimpose32.json +0 -1
- package/dist/cdn/assets/icon/orientedImagerySceneOnly16.json +0 -1
- package/dist/cdn/assets/icon/orientedImagerySceneOnly24.json +0 -1
- package/dist/cdn/assets/icon/orientedImagerySceneOnly32.json +0 -1
- package/dist/cdn/assets/icon/parquetFeatureLayer16.json +0 -1
- package/dist/cdn/assets/icon/parquetFeatureLayer24.json +0 -1
- package/dist/cdn/assets/icon/parquetFeatureLayer32.json +0 -1
- /package/dist/cdn/{IYGANVDT.js → 72YUATHS.js} +0 -0
- /package/dist/cdn/{MYDCGCGV.js → IIA2H2SU.js} +0 -0
- /package/dist/cdn/{DCWL5FUH.js → LKL63VXR.js} +0 -0
- /package/dist/cdn/{UM6KICQF.js → MO64UYDH.js} +0 -0
- /package/dist/cdn/{R6HABYRV.js → Q55YTOMB.js} +0 -0
|
@@ -27,8 +27,9 @@ import { u as useCancelable } from "../../chunks/useCancelable.js";
|
|
|
27
27
|
import { u as useInteractive } from "../../chunks/useInteractive.js";
|
|
28
28
|
import { u as useTopLayer } from "../../chunks/useTopLayer.js";
|
|
29
29
|
import { u as useForm } from "../../chunks/useForm.js";
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
30
|
+
import { i as isChip } from "../../chunks/resources5.js";
|
|
31
|
+
import { I as IDS, C as CSS, a as ComboboxItemSelector, b as ComboboxItemGroupSelector, c as ICONS } from "../../chunks/resources6.js";
|
|
32
|
+
import { h as hasActiveChildren, i as isSingleLike, o as orderValuesByPrevious, a as orderByPrevious, g as getLabel, b as getItemAncestors, c as getItemChildren } from "../../chunks/utils2.js";
|
|
32
33
|
const styles = css`: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;display:block}:host([scale=s]){font-size:var(--calcite-font-size-relative-sm);--calcite-internal-combobox-spacing-unit-l: .5rem;--calcite-internal-combobox-spacing-unit-s: .25rem;--calcite-internal-combobox-padding-inline-end: var(--calcite-space-2xs);--calcite-internal-combobox-no-matches-spacing-unit-s: .25rem;--calcite-combobox-input-height: 1rem;--calcite-internal-combobox-input-margin-block: calc(.25rem - 1px) ;--calcite-internal-close-size: 1rem}:host([scale=m]){font-size:var(--calcite-font-size-relative-base);--calcite-internal-combobox-spacing-unit-l: .75rem;--calcite-internal-combobox-spacing-unit-s: .5rem;--calcite-internal-combobox-padding-inline-end: var(--calcite-space-sm);--calcite-internal-combobox-no-matches-spacing-unit-s: .375rem;--calcite-combobox-input-height: 1rem;--calcite-internal-combobox-input-margin-block: calc(.5rem - 1px) ;--calcite-internal-close-size: 1.5rem}:host([scale=l]){font-size:var(--calcite-font-size-relative-md);--calcite-internal-combobox-spacing-unit-l: 1rem;--calcite-internal-combobox-spacing-unit-s: .75rem;--calcite-internal-combobox-padding-inline-end: var(--calcite-space-sm-plus);--calcite-internal-combobox-no-matches-spacing-unit-s: var(--calcite-space-sm-plus);--calcite-combobox-input-height: 1.5rem;--calcite-internal-combobox-input-margin-block: calc(var(--calcite-space-sm-plus) - 1px);--calcite-internal-close-size: 2rem}.wrapper{display:flex;border-width:1px;border-style:solid;outline-color:transparent;padding-block:calc(var(--calcite-internal-combobox-spacing-unit-s) / 4);padding-inline:var(--calcite-internal-combobox-spacing-unit-l) var(--calcite-internal-combobox-padding-inline-end);background-color:var(--calcite-combobox-input-background-color, var(--calcite-color-foreground-1));color:var(--calcite-combobox-input-text-color, var(--calcite-color-text-1));border-color:var(--calcite-combobox-input-border-color, var(--calcite-color-border-input))}.wrapper:hover .icon{color:var(--calcite-combobox-icon-color-hover, var(--calcite-color-text-1))}:host(:focus-within) .wrapper,.wrapper--active{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}:host([read-only]) .wrapper{background-color:var(--calcite-color-background)}:host([read-only]) .label{font-weight:var(--calcite-font-weight-medium)}:host([status=invalid]) .wrapper{border-color:var(--calcite-color-status-danger)}:host([status=invalid]:focus-within) .wrapper{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))))}.wrapper--single{padding-block:0;padding-inline:var(--calcite-internal-combobox-spacing-unit-l) var(--calcite-internal-combobox-padding-inline-end);cursor:pointer;flex-wrap:nowrap}.grid-input{position:relative;display:flex;flex-grow:1;flex-wrap:wrap;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0;gap:var(--calcite-internal-combobox-spacing-unit-s);margin-inline-end:var(--calcite-internal-combobox-spacing-unit-s)}.grid-input.selection-display--fit,.grid-input.selection-display--single{flex-wrap:nowrap;overflow:hidden}.input{flex-grow:1;appearance:none;overflow:hidden;text-overflow:ellipsis;border-style:none;background-color:transparent;padding:0;font-family:inherit;color:var(--calcite-color-text-1);font-size:inherit;block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height);inline-size:100%;margin-block-end:var(--calcite-internal-combobox-spacing-unit-s);min-inline-size:4.8125rem}.input:focus{outline:2px solid transparent;outline-offset:2px}.input:placeholder-shown{text-overflow:ellipsis}.input--single{padding:0;margin-block:var(--calcite-internal-combobox-input-margin-block)}.wrapper--active .input-single{cursor:text}.input--hidden{pointer-events:none;width:0px;min-width:0px;opacity:0}.input--icon{padding-block:0;padding-inline:var(--calcite-internal-combobox-spacing-unit-l)}.placeholder-icon{color:var(--calcite-combobox-icon-color, var(--calcite-color-text-3))}.input-wrap{display:flex;flex-grow:1;align-items:center}.input-wrap--single{flex:1 1 0%;overflow:hidden}.label{pointer-events:none;max-width:100%;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0;font-weight:var(--calcite-font-weight-normal);block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height)}.label--icon{padding-inline:var(--calcite-internal-combobox-spacing-unit-l)}.icon-end,.icon-start{display:flex;cursor:pointer;align-items:center}.icon-end{flex:none}.icon-end .icon{color:var(--calcite-combobox-icon-color, var(--calcite-color-text-3))}.floating-ui-container{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0;z-index:var(--calcite-floating-ui-z-index)}@starting-style{.floating-ui-container{opacity:0;inset-block-start:0;left:0}}:host([top-layer-disabled]) .floating-ui-container{--calcite-floating-ui-z-index: var(--calcite-z-index-dropdown)}.floating-ui-container[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.floating-ui-container:popover-open{display:block}.floating-ui-container .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}.floating-ui-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.floating-ui-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.floating-ui-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}.floating-ui-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.floating-ui-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.floating-ui-container[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.floating-ui-container .calcite-floating-ui-anim{box-shadow:var(--calcite-shadow-md)}@media(forced-colors:active){.wrapper,.floating-ui-container{border:1px solid canvasText}}.screen-readers-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.list-container{max-height:45vh;overflow-y:auto;inline-size:var(--calcite-dropdown-width, 100%);background-color:var(--calcite-combobox-background-color, var(--calcite-color-foreground-1))}.list{margin:0;display:block;padding:0;line-height:var(--calcite-font-line-height-relative-snug)}.list--hide{height:0px;overflow:hidden}calcite-chip{--calcite-animation-timing: 0}.chip{margin-block:calc(var(--calcite-internal-combobox-spacing-unit-s) / 4);max-inline-size:100%}.chip--invisible{visibility:hidden;position:absolute}.item{display:block}.select-all{background-color:var(--calcite-combobox-item-background-color-active, var(--calcite-color-foreground-1));border-block-end-color:var(--calcite-combobox-divider-color, var(--calcite-combobox-item-border-color, var(--calcite-color-border-3)));border-block-end-style:solid;border-block-end-width:var(--calcite-border-width-sm);inset-block-start:0;position:sticky;z-index:var(--calcite-z-index-sticky)}.no-matches{padding-block:var(--calcite-internal-combobox-no-matches-spacing-unit-s);padding-inline:var(--calcite-internal-combobox-spacing-unit-l);color:var(--calcite-combobox-input-text-color, var(--calcite-color-text-1));background:var(--calcite-combobox-background-color, var(--calcite-color-foreground-1));cursor:pointer}.no-matches-placeholder{color:var(--calcite-combobox-icon-color, var(--calcite-color-text-3));cursor:default}.disabled{opacity:.5}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.clear-button--container{display:flex;cursor:pointer;align-items:center}.clear-button--container:hover calcite-action{--calcite-action-background-color: var(--calcite-clear-button-background-color-hover, var(--calcite-color-foreground-3));--calcite-action-text-color: var(--calcite-clear-button-icon-color-hover, var(--calcite-color-text-1))}.clear-button--container:active calcite-action{--calcite-action-background-color: var(--calcite-clear-button-background-color-press, var(--calcite-color-border-2));--calcite-action-text-color: var(--calcite-clear-button-icon-color-press, var(--calcite-color-text-1))}.clear-button--container calcite-action{--calcite-internal-action-height: 100%;--calcite-internal-action-padding-inline: var(--calcite-spacing-none);--calcite-internal-action-padding-block: var(--calcite-spacing-none);--calcite-action-background-color: var(--calcite-clear-button-background-color, var(--calcite-color-foreground-2));--calcite-action-text-color: var(--calcite-clear-button-icon-color)}.clear-button--container calcite-action:hover{--calcite-action-background-color-hover: var(--calcite-clear-button-background-color-hover, var(--calcite-color-foreground-3));--calcite-action-text-color-press: var(--calcite-clear-button-icon-color-hover)}.clear-button--container calcite-action:active{--calcite-action-background-color-press: var(--calcite-clear-button-background-color-press, var(--calcite-color-border-2));--calcite-action-text-color-press: var(--calcite-clear-button-icon-color-press)}:host([scale=s]) .clear-button--container{padding:var(--calcite-spacing-xxs)}:host([scale=m]) .clear-button--container{padding:var(--calcite-spacing-xxs);padding-inline-end:var(--calcite-space-sm)}:host([scale=l]) .clear-button--container{padding-inline-end:var(--calcite-spacing-sm-plus)}.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}.text-match{background-color:transparent;color:inherit;font-weight:var(--calcite-font-weight-bold)}.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)}::placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-input-placeholder-text-color, var(--calcite-color-text-3))}`;
|
|
33
34
|
class Combobox extends LitElement {
|
|
34
35
|
constructor() {
|
|
@@ -77,32 +78,38 @@ class Combobox extends LitElement {
|
|
|
77
78
|
this._filterText = "";
|
|
78
79
|
this.getSelectedItems = () => {
|
|
79
80
|
if (!this.isMulti()) {
|
|
80
|
-
const match = this.
|
|
81
|
+
const match = this.allItems.find(({ selected }) => selected);
|
|
81
82
|
return match ? [match] : [];
|
|
82
83
|
}
|
|
83
|
-
return this.
|
|
84
|
-
const aIdx = this.selectedItems.indexOf(a);
|
|
85
|
-
const bIdx = this.selectedItems.indexOf(b);
|
|
86
|
-
if (aIdx > -1 && bIdx > -1) {
|
|
87
|
-
return aIdx - bIdx;
|
|
88
|
-
}
|
|
89
|
-
return bIdx - aIdx;
|
|
90
|
-
});
|
|
84
|
+
return this.allItems.filter((item) => item.selected && (this.selectionMode !== "ancestors" || !hasActiveChildren(item)));
|
|
91
85
|
};
|
|
92
86
|
this.groupItems = [];
|
|
93
87
|
this.guid = guid();
|
|
94
88
|
this.ignoreSelectedEventsFlag = false;
|
|
95
89
|
this.internalValueChangeFlag = false;
|
|
90
|
+
this.previousAllSelected = false;
|
|
91
|
+
this.refreshingSelectionDisplay = false;
|
|
96
92
|
this.mutationObserver = createObserver("mutation", () => this.updateItems());
|
|
97
93
|
this.onLabelClick = () => {
|
|
98
94
|
this.setFocus();
|
|
99
95
|
};
|
|
100
96
|
this.transitionProp = "opacity";
|
|
101
|
-
this.resizeObserver =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
this.resizeObserver = (() => {
|
|
98
|
+
let resizeWorkQueued = false;
|
|
99
|
+
return createObserver("resize", () => {
|
|
100
|
+
if (resizeWorkQueued) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
resizeWorkQueued = true;
|
|
104
|
+
requestAnimationFrame(() => {
|
|
105
|
+
resizeWorkQueued = false;
|
|
106
|
+
this.setMaxScrollerHeight();
|
|
107
|
+
this.refreshSelectionDisplay();
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
})();
|
|
105
111
|
this.selectedIndicatorChipRef = createRef();
|
|
112
|
+
this.selectedChipCountRef = createRef();
|
|
106
113
|
this.clearButtonRef = createRef();
|
|
107
114
|
this._selectedItems = [];
|
|
108
115
|
this.textInputRef = createRef();
|
|
@@ -120,8 +127,10 @@ class Combobox extends LitElement {
|
|
|
120
127
|
this.activeDescendant = "";
|
|
121
128
|
this.activeItemIndex = -1;
|
|
122
129
|
this.compactSelectionDisplay = false;
|
|
130
|
+
this.deferFitChipCountRender = false;
|
|
123
131
|
this.selectedHiddenChipsCount = 0;
|
|
124
132
|
this.selectedVisibleChipsCount = 0;
|
|
133
|
+
this.fitUsingCompactCountLabel = false;
|
|
125
134
|
this.allItems = [];
|
|
126
135
|
this.items = [];
|
|
127
136
|
this.clearDisabled = false;
|
|
@@ -153,7 +162,7 @@ class Combobox extends LitElement {
|
|
|
153
162
|
this.listen("click", this.comboboxFocusHandler);
|
|
154
163
|
}
|
|
155
164
|
static {
|
|
156
|
-
this.properties = { activeChipIndex: [16, {}, { state: true }], activeDescendant: [16, {}, { state: true }], activeItemIndex: [16, {}, { state: true }], compactSelectionDisplay: [16, {}, { state: true }], selectedHiddenChipsCount: [16, {}, { state: true }], selectedVisibleChipsCount: [16, {}, { state: true }], allItems: [16, {}, { state: true }], items: [16, {}, { state: true }], noMatchesFound: [16, {}, { state: true }], allowCustomValues: [7, {}, { reflect: true, type: Boolean }], clearDisabled: [7, {}, { reflect: true, type: Boolean }], disabled: [7, {}, { reflect: true, type: Boolean }], filterText: [3, {}, { reflect: true }], filterProps: [0, {}, { attribute: false }], filteredItems: [32, {}, { attribute: false, readOnly: true }], flipPlacements: [0, {}, { attribute: false }], form: [3, {}, { reflect: true }], label: 1, labelText: 1, maxItems: [11, {}, { reflect: true, type: Number }], messageOverrides: [0, {}, { attribute: false }], name: [3, {}, { reflect: true }], open: [7, {}, { reflect: true, type: Boolean }], overlayPositioning: [3, {}, { reflect: true }], placeholder: 1, placeholderIcon: [3, { type: String }, { reflect: true }], placeholderIconFlipRtl: [7, {}, { reflect: true, type: Boolean }], placement: [3, {}, { reflect: true }], readOnly: [7, {}, { reflect: true, type: Boolean }], required: [7, {}, { reflect: true, type: Boolean }], scale: [3, {}, { reflect: true }], selectAllEnabled: [7, {}, { reflect: true, type: Boolean }], selectedItems: [0, {}, { attribute: false }], selectionDisplay: [3, {}, { reflect: true }], selectionAppearance: [3, {}, { reflect: true }], selectionMode: [3, {}, { reflect: true }], status: [3, {}, { reflect: true }], topLayerDisabled: [7, {}, { reflect: true, type: Boolean }], validationIcon: [3, { converter: stringOrBoolean, type: String }, { reflect: true }], validationMessage: 1, validity: [32, {}, { readOnly: true, attribute: false }], value: 1 };
|
|
165
|
+
this.properties = { activeChipIndex: [16, {}, { state: true }], activeDescendant: [16, {}, { state: true }], activeItemIndex: [16, {}, { state: true }], compactSelectionDisplay: [16, {}, { state: true }], deferFitChipCountRender: [16, {}, { state: true }], selectedHiddenChipsCount: [16, {}, { state: true }], selectedVisibleChipsCount: [16, {}, { state: true }], fitUsingCompactCountLabel: [16, {}, { state: true }], allItems: [16, {}, { state: true }], items: [16, {}, { state: true }], noMatchesFound: [16, {}, { state: true }], allowCustomValues: [7, {}, { reflect: true, type: Boolean }], clearDisabled: [7, {}, { reflect: true, type: Boolean }], disabled: [7, {}, { reflect: true, type: Boolean }], filterText: [3, {}, { reflect: true }], filterProps: [0, {}, { attribute: false }], filteredItems: [32, {}, { attribute: false, readOnly: true }], flipPlacements: [0, {}, { attribute: false }], form: [3, {}, { reflect: true }], label: 1, labelText: 1, maxItems: [11, {}, { reflect: true, type: Number }], messageOverrides: [0, {}, { attribute: false }], name: [3, {}, { reflect: true }], open: [7, {}, { reflect: true, type: Boolean }], overlayPositioning: [3, {}, { reflect: true }], placeholder: 1, placeholderIcon: [3, { type: String }, { reflect: true }], placeholderIconFlipRtl: [7, {}, { reflect: true, type: Boolean }], placement: [3, {}, { reflect: true }], readOnly: [7, {}, { reflect: true, type: Boolean }], required: [7, {}, { reflect: true, type: Boolean }], scale: [3, {}, { reflect: true }], selectAllEnabled: [7, {}, { reflect: true, type: Boolean }], selectedItems: [0, {}, { attribute: false }], selectionDisplay: [3, {}, { reflect: true }], selectionAppearance: [3, {}, { reflect: true }], selectionMode: [3, {}, { reflect: true }], status: [3, {}, { reflect: true }], topLayerDisabled: [7, {}, { reflect: true, type: Boolean }], validationIcon: [3, { converter: stringOrBoolean, type: String }, { reflect: true }], validationMessage: 1, validity: [32, {}, { readOnly: true, attribute: false }], value: 1 };
|
|
157
166
|
}
|
|
158
167
|
static {
|
|
159
168
|
this.formAssociated = true;
|
|
@@ -178,9 +187,6 @@ class Combobox extends LitElement {
|
|
|
178
187
|
const enabledItems = this.allItems.filter((item) => !item.disabled);
|
|
179
188
|
return enabledItems.length > 0 && enabledItems.every((item) => item.selected);
|
|
180
189
|
}
|
|
181
|
-
get hasDisabledItems() {
|
|
182
|
-
return this.allItems.some((item) => item.disabled);
|
|
183
|
-
}
|
|
184
190
|
get hasDisabledSelected() {
|
|
185
191
|
return this.allItems.some((item) => item.disabled && item.selected);
|
|
186
192
|
}
|
|
@@ -325,11 +331,33 @@ class Combobox extends LitElement {
|
|
|
325
331
|
this.reposition(true);
|
|
326
332
|
}
|
|
327
333
|
selectedItemsHandler() {
|
|
334
|
+
const wasAllSelected = this.previousAllSelected;
|
|
335
|
+
const isAllSelected = this.allSelected;
|
|
336
|
+
this.previousAllSelected = isAllSelected;
|
|
328
337
|
this.internalValueChangeFlag = true;
|
|
329
338
|
this.value = this.getValue();
|
|
330
339
|
this.internalValueChangeFlag = false;
|
|
331
340
|
if (this.selectionDisplay === "fit" && this.isMulti()) {
|
|
332
|
-
|
|
341
|
+
const transitioningFromAllSelected = wasAllSelected && !isAllSelected;
|
|
342
|
+
if (wasAllSelected && !isAllSelected) {
|
|
343
|
+
this.selectedHiddenChipsCount = 0;
|
|
344
|
+
this.selectedItems.forEach((item) => {
|
|
345
|
+
const chipEl = this.referenceEl?.querySelector(`#${IDS.chip(item.guid)}`);
|
|
346
|
+
if (chipEl) {
|
|
347
|
+
this.showChip(chipEl);
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
this.updateComplete.then(async () => {
|
|
352
|
+
if (transitioningFromAllSelected) {
|
|
353
|
+
await this.updateComplete;
|
|
354
|
+
}
|
|
355
|
+
await this.refreshSelectionDisplay();
|
|
356
|
+
if (this.fitFollowUpRefreshPromise) {
|
|
357
|
+
await this.fitFollowUpRefreshPromise;
|
|
358
|
+
}
|
|
359
|
+
this.deferFitChipCountRender = false;
|
|
360
|
+
});
|
|
333
361
|
}
|
|
334
362
|
}
|
|
335
363
|
async documentClickHandler(event) {
|
|
@@ -348,10 +376,11 @@ class Combobox extends LitElement {
|
|
|
348
376
|
this.open = false;
|
|
349
377
|
}
|
|
350
378
|
handleSelectAll(isSelectAllTarget) {
|
|
351
|
-
if (isSelectAllTarget) {
|
|
352
|
-
|
|
379
|
+
if (!isSelectAllTarget) {
|
|
380
|
+
return;
|
|
353
381
|
}
|
|
354
|
-
|
|
382
|
+
this.toggleSelectAll();
|
|
383
|
+
if (this.selectionDisplay !== "fit" && this.allSelected) {
|
|
355
384
|
this.selectedItems.forEach((item) => {
|
|
356
385
|
const chipEl = this.referenceEl.querySelector(`#${IDS.chip(item.guid)}`);
|
|
357
386
|
if (chipEl) {
|
|
@@ -360,6 +389,9 @@ class Combobox extends LitElement {
|
|
|
360
389
|
});
|
|
361
390
|
}
|
|
362
391
|
}
|
|
392
|
+
updateSelectedItems() {
|
|
393
|
+
this.selectedItems = this.getOrderedSelectedItems(this.getSelectedItems());
|
|
394
|
+
}
|
|
363
395
|
calciteComboboxItemChangeHandler(event) {
|
|
364
396
|
if (this.ignoreSelectedEventsFlag) {
|
|
365
397
|
return;
|
|
@@ -372,7 +404,6 @@ class Combobox extends LitElement {
|
|
|
372
404
|
const newIndex = this.keyboardNavItems.indexOf(isSelectAllTarget ? this.selectAllComboboxItemRef.value : target);
|
|
373
405
|
this.updateActiveItemIndex(newIndex);
|
|
374
406
|
this.toggleSelection(target, target.selected);
|
|
375
|
-
this.selectedItems = this.getSelectedItems();
|
|
376
407
|
}
|
|
377
408
|
calciteInternalComboboxItemChangeHandler(event) {
|
|
378
409
|
event.stopPropagation();
|
|
@@ -381,11 +412,14 @@ class Combobox extends LitElement {
|
|
|
381
412
|
}
|
|
382
413
|
}
|
|
383
414
|
clearValue() {
|
|
384
|
-
this.
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
415
|
+
const enabledSelectedItems = this.items.filter((item) => item.selected && !item.disabled);
|
|
416
|
+
if (enabledSelectedItems.length) {
|
|
417
|
+
this.ignoreSelectedEventsFlag = true;
|
|
418
|
+
enabledSelectedItems.forEach((el) => el.selected = false);
|
|
419
|
+
this.ignoreSelectedEventsFlag = false;
|
|
420
|
+
this.updateSelectedItems();
|
|
421
|
+
this.emitComboboxChange();
|
|
422
|
+
}
|
|
389
423
|
this.open = false;
|
|
390
424
|
this.updateActiveItemIndex(-1);
|
|
391
425
|
this.resetText();
|
|
@@ -403,9 +437,19 @@ class Combobox extends LitElement {
|
|
|
403
437
|
this.filteredFlipPlacements = flipPlacements ? filterValidFlipPlacements(flipPlacements, el) : null;
|
|
404
438
|
}
|
|
405
439
|
getValue() {
|
|
406
|
-
const items = this.selectedItems.map((item) => item.value?.toString());
|
|
440
|
+
const items = this.getOrderedSelectedValues(this.selectedItems.map((item) => item.value?.toString()));
|
|
407
441
|
return items.length ? items.length > 1 ? items : items[0] : "";
|
|
408
442
|
}
|
|
443
|
+
getOrderedSelectedValues(selectedValues) {
|
|
444
|
+
if (!this.isMulti()) {
|
|
445
|
+
return selectedValues;
|
|
446
|
+
}
|
|
447
|
+
const previousValues = Array.isArray(this.value) ? this.value : this.value ? [this.value] : [];
|
|
448
|
+
return orderValuesByPrevious(selectedValues, previousValues);
|
|
449
|
+
}
|
|
450
|
+
getOrderedSelectedItems(selectedItems) {
|
|
451
|
+
return this.isMulti() ? orderByPrevious(selectedItems, this.selectedItems) : selectedItems;
|
|
452
|
+
}
|
|
409
453
|
comboboxInViewport() {
|
|
410
454
|
const bounding = this.el.getBoundingClientRect();
|
|
411
455
|
return bounding.top >= 0 && bounding.left >= 0 && bounding.right <= (window.innerWidth || document.documentElement.clientWidth) && bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight);
|
|
@@ -418,9 +462,16 @@ class Combobox extends LitElement {
|
|
|
418
462
|
}
|
|
419
463
|
item.selected = toggledValue;
|
|
420
464
|
});
|
|
421
|
-
this.
|
|
465
|
+
this.updateSelectedItems();
|
|
422
466
|
this.emitComboboxChange();
|
|
423
467
|
}
|
|
468
|
+
hasHiddenSelectedFitChips() {
|
|
469
|
+
if (this.selectionDisplay !== "fit" || !this.isMulti()) {
|
|
470
|
+
return false;
|
|
471
|
+
}
|
|
472
|
+
const hiddenCountChip = this.selectedChipCountRef.value;
|
|
473
|
+
return !!hiddenCountChip && !hiddenCountChip.classList.contains(CSS.chipInvisible);
|
|
474
|
+
}
|
|
424
475
|
keyDownHandler(event) {
|
|
425
476
|
if (this.readOnly) {
|
|
426
477
|
return;
|
|
@@ -484,9 +535,9 @@ class Combobox extends LitElement {
|
|
|
484
535
|
break;
|
|
485
536
|
case " ":
|
|
486
537
|
if (!this.textInputRef.value.value && !event.defaultPrevented) {
|
|
487
|
-
if (!this.open
|
|
538
|
+
if (!this.open) {
|
|
488
539
|
this.open = true;
|
|
489
|
-
this.
|
|
540
|
+
this.shiftActiveItemIndex(1);
|
|
490
541
|
}
|
|
491
542
|
event.preventDefault();
|
|
492
543
|
}
|
|
@@ -547,13 +598,16 @@ class Combobox extends LitElement {
|
|
|
547
598
|
break;
|
|
548
599
|
case "Delete":
|
|
549
600
|
case "Backspace": {
|
|
550
|
-
const
|
|
601
|
+
const fitDeleteBlockedByOverflow = this.hasHiddenSelectedFitChips();
|
|
602
|
+
const overflowDeleteBlocked = fitDeleteBlockedByOverflow && this.activeChipIndex === -1;
|
|
603
|
+
const notDeletable = this.selectionDisplay === "single" || overflowDeleteBlocked;
|
|
551
604
|
if (notDeletable) {
|
|
552
605
|
return;
|
|
553
606
|
}
|
|
554
|
-
|
|
607
|
+
const deleteTargetChip = event.composedPath().find((node) => isChip(node));
|
|
608
|
+
if (this.activeChipIndex > -1 && deleteTargetChip) {
|
|
555
609
|
event.preventDefault();
|
|
556
|
-
this.removeActiveChip(
|
|
610
|
+
this.removeActiveChip(deleteTargetChip);
|
|
557
611
|
} else if (!this.filterText && this.isMulti()) {
|
|
558
612
|
event.preventDefault();
|
|
559
613
|
this.removeLastChip();
|
|
@@ -566,7 +620,7 @@ class Combobox extends LitElement {
|
|
|
566
620
|
this.topLayer.show();
|
|
567
621
|
this.reposition();
|
|
568
622
|
this.calciteComboboxBeforeOpen.emit();
|
|
569
|
-
setTimeout(() => this.scrollToActiveOrSelectedItem(
|
|
623
|
+
setTimeout(() => this.scrollToActiveOrSelectedItem(true), 0);
|
|
570
624
|
}
|
|
571
625
|
onOpen() {
|
|
572
626
|
this.calciteComboboxOpen.emit();
|
|
@@ -601,7 +655,7 @@ class Combobox extends LitElement {
|
|
|
601
655
|
return;
|
|
602
656
|
}
|
|
603
657
|
const composedPath = event.composedPath();
|
|
604
|
-
if (composedPath.some((node) => node
|
|
658
|
+
if (composedPath.some((node) => isChip(node))) {
|
|
605
659
|
this.open = false;
|
|
606
660
|
event.preventDefault();
|
|
607
661
|
return;
|
|
@@ -615,14 +669,9 @@ class Combobox extends LitElement {
|
|
|
615
669
|
this.ensureRecentSelectedItemIsActive();
|
|
616
670
|
}
|
|
617
671
|
ensureRecentSelectedItemIsActive() {
|
|
618
|
-
const {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
return;
|
|
622
|
-
}
|
|
623
|
-
const selectedItem = selectedItems[selectedItems.length - 1];
|
|
624
|
-
const targetIndex = selectedItem ? keyboardNavItems.indexOf(selectedItem) : keyboardNavItems.length ? 0 : -1;
|
|
625
|
-
this.updateActiveItemIndex(targetIndex > -1 ? targetIndex : keyboardNavItems.length ? 0 : -1);
|
|
672
|
+
const { selectedItems } = this;
|
|
673
|
+
const targetIndex = selectedItems.length === 0 ? 0 : this.items.indexOf(selectedItems[selectedItems.length - 1]);
|
|
674
|
+
this.updateActiveItemIndex(targetIndex);
|
|
626
675
|
}
|
|
627
676
|
hideChip(chipEl) {
|
|
628
677
|
chipEl.classList.add(CSS.chipInvisible);
|
|
@@ -630,35 +679,63 @@ class Combobox extends LitElement {
|
|
|
630
679
|
showChip(chipEl) {
|
|
631
680
|
chipEl.classList.remove(CSS.chipInvisible);
|
|
632
681
|
}
|
|
633
|
-
refreshChipDisplay({ chipEls, availableHorizontalChipElSpace, chipContainerElGap }) {
|
|
682
|
+
refreshChipDisplay({ chipEls, availableHorizontalChipElSpace, chipContainerElGap, hideSelectedChips }) {
|
|
683
|
+
const selectedChipEls = chipEls.filter((chipEl) => chipEl.selected);
|
|
684
|
+
const enabledSelectedChipEls = selectedChipEls.filter((chipEl) => !chipEl.disabled);
|
|
685
|
+
const disabledSelectedChipEls = selectedChipEls.filter((chipEl) => chipEl.disabled);
|
|
686
|
+
const getChipWidth = (chipEl) => {
|
|
687
|
+
const computedWidth = getElementWidth(chipEl);
|
|
688
|
+
const fallbackWidth = chipEl.getBoundingClientRect().width;
|
|
689
|
+
return Number.isFinite(computedWidth) && computedWidth > 0 ? computedWidth : fallbackWidth;
|
|
690
|
+
};
|
|
691
|
+
selectedChipEls.forEach((chipEl) => getChipWidth(chipEl));
|
|
634
692
|
chipEls.forEach((chipEl) => {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
693
|
+
this.hideChip(chipEl);
|
|
694
|
+
});
|
|
695
|
+
if (hideSelectedChips) {
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
const renderFittingChips = (chips) => {
|
|
699
|
+
let visibleChipsCount = 0;
|
|
700
|
+
chips.forEach((chipEl) => {
|
|
701
|
+
const chipElWidth = getChipWidth(chipEl);
|
|
702
|
+
if (chipElWidth && chipElWidth <= availableHorizontalChipElSpace) {
|
|
640
703
|
availableHorizontalChipElSpace -= chipElWidth + chipContainerElGap;
|
|
641
704
|
this.showChip(chipEl);
|
|
642
|
-
|
|
705
|
+
visibleChipsCount++;
|
|
643
706
|
}
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
}
|
|
707
|
+
});
|
|
708
|
+
return visibleChipsCount;
|
|
709
|
+
};
|
|
710
|
+
const visibleEnabledChipsCount = renderFittingChips(enabledSelectedChipEls);
|
|
711
|
+
if (visibleEnabledChipsCount <= 1) {
|
|
712
|
+
renderFittingChips(disabledSelectedChipEls);
|
|
713
|
+
}
|
|
647
714
|
}
|
|
648
|
-
async refreshSelectionDisplay() {
|
|
649
|
-
this.
|
|
715
|
+
async refreshSelectionDisplay(followUpRefresh = true) {
|
|
716
|
+
if (this.refreshingSelectionDisplay) {
|
|
717
|
+
return;
|
|
718
|
+
}
|
|
719
|
+
this.refreshingSelectionDisplay = true;
|
|
720
|
+
await this.componentOnReady();
|
|
650
721
|
if (isSingleLike(this.selectionMode)) {
|
|
722
|
+
this.refreshingSelectionDisplay = false;
|
|
651
723
|
return;
|
|
652
724
|
}
|
|
653
725
|
if (!this.textInputRef.value || !this.chipContainerEl) {
|
|
726
|
+
this.refreshingSelectionDisplay = false;
|
|
654
727
|
return;
|
|
655
728
|
}
|
|
656
729
|
const { allSelectedIndicatorChipRef, chipContainerEl, selectionDisplay, placeholder, selectedIndicatorChipRef, textInputRef } = this;
|
|
657
|
-
const chipContainerElGap = parseInt(getComputedStyle(chipContainerEl).gap
|
|
730
|
+
const chipContainerElGap = parseInt(getComputedStyle(chipContainerEl).gap);
|
|
658
731
|
const chipContainerElWidth = getElementWidth(chipContainerEl);
|
|
659
|
-
const { fontSize, fontFamily } = getComputedStyle(textInputRef.value);
|
|
660
|
-
const
|
|
661
|
-
const
|
|
732
|
+
const { fontSize, fontFamily, minInlineSize } = getComputedStyle(textInputRef.value);
|
|
733
|
+
const placeholderWidthMultiplier = 0.55;
|
|
734
|
+
const inputMinWidth = parseFloat(minInlineSize) || parseInt(calciteSize48);
|
|
735
|
+
const measuredPlaceholderWidth = getTextWidth(placeholder, `${fontSize} ${fontFamily}`);
|
|
736
|
+
const placeholderWidth = measuredPlaceholderWidth > 0 ? measuredPlaceholderWidth : Math.max(inputMinWidth, Math.round((placeholder?.length || 0) * (parseFloat(fontSize) || parseInt(calciteSize48)) * placeholderWidthMultiplier));
|
|
737
|
+
const fitInputWidth = Math.max(inputMinWidth, placeholderWidth);
|
|
738
|
+
const inputWidth = (selectionDisplay === "fit" ? fitInputWidth : placeholderWidth) + chipContainerElGap;
|
|
662
739
|
const allSelectedIndicatorChipElWidth = getElementWidth(allSelectedIndicatorChipRef.value);
|
|
663
740
|
const selectedIndicatorChipElWidth = getElementWidth(selectedIndicatorChipRef.value);
|
|
664
741
|
const largestSelectedIndicatorChipWidth = Math.max(allSelectedIndicatorChipElWidth, selectedIndicatorChipElWidth);
|
|
@@ -668,7 +745,7 @@ class Combobox extends LitElement {
|
|
|
668
745
|
inputWidth,
|
|
669
746
|
largestSelectedIndicatorChipWidth
|
|
670
747
|
});
|
|
671
|
-
if (
|
|
748
|
+
if (selectionDisplay !== "fit" && this.allSelected && this.selectAllEnabled) {
|
|
672
749
|
this.selectedItems.forEach((item) => {
|
|
673
750
|
const chipEl = this.referenceEl.querySelector(`#${IDS.chip(item.guid)}`);
|
|
674
751
|
if (chipEl) {
|
|
@@ -685,16 +762,64 @@ class Combobox extends LitElement {
|
|
|
685
762
|
});
|
|
686
763
|
}
|
|
687
764
|
if (selectionDisplay === "fit") {
|
|
688
|
-
const chipEls = Array.from(this.el.shadowRoot.querySelectorAll("calcite-chip")).filter((chipEl) =>
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
765
|
+
const chipEls = Array.from(this.el.shadowRoot.querySelectorAll("calcite-chip")).filter((chipEl) => {
|
|
766
|
+
const chipValue = chipEl.value;
|
|
767
|
+
const hasValue = chipValue != null && `${chipValue}` !== "";
|
|
768
|
+
return chipEl.disabled || hasValue;
|
|
769
|
+
});
|
|
770
|
+
const { hiddenChipIndicatorWidth, hideSelectedChips, reservedPlaceholderInputWidth } = this.getFitCompactDisplayState({
|
|
771
|
+
chipContainerElGap,
|
|
772
|
+
chipContainerElWidth,
|
|
773
|
+
inputMinWidth,
|
|
774
|
+
placeholderWidth,
|
|
775
|
+
selectedIndicatorChipElWidth
|
|
776
|
+
});
|
|
777
|
+
this.fitUsingCompactCountLabel = hideSelectedChips;
|
|
778
|
+
const availableHorizontalChipElSpace = Math.round(chipContainerElWidth - (hiddenChipIndicatorWidth + chipContainerElGap + reservedPlaceholderInputWidth + chipContainerElGap));
|
|
779
|
+
this.refreshChipDisplay({
|
|
780
|
+
availableHorizontalChipElSpace,
|
|
781
|
+
chipContainerElGap,
|
|
782
|
+
chipEls,
|
|
783
|
+
hideSelectedChips
|
|
784
|
+
});
|
|
785
|
+
const previousHiddenChipsCount = this.selectedHiddenChipsCount;
|
|
786
|
+
this.syncChipVisibilityCounts(chipEls);
|
|
787
|
+
const didHiddenCountChange = previousHiddenChipsCount !== this.selectedHiddenChipsCount;
|
|
788
|
+
if (didHiddenCountChange && followUpRefresh) {
|
|
789
|
+
this.fitFollowUpRefreshPromise = this.updateComplete.then(() => this.refreshSelectionDisplay(false)).then(() => {
|
|
790
|
+
this.fitFollowUpRefreshPromise = null;
|
|
791
|
+
});
|
|
792
|
+
}
|
|
692
793
|
}
|
|
794
|
+
this.refreshingSelectionDisplay = false;
|
|
693
795
|
}
|
|
694
796
|
setFloatingEl(el) {
|
|
695
797
|
this.floatingEl = el;
|
|
696
798
|
connectFloatingUI(this);
|
|
697
799
|
}
|
|
800
|
+
shouldUseFitCompactDisplay({ chipContainerElGap, chipContainerElWidth, hiddenChipIndicatorWidth, inputMinWidth, placeholderWidth, reservedPlaceholderInputWidth }) {
|
|
801
|
+
const availableHorizontalChipElSpaceWithPlaceholder = Math.round(chipContainerElWidth - (hiddenChipIndicatorWidth + chipContainerElGap + reservedPlaceholderInputWidth + chipContainerElGap));
|
|
802
|
+
const placeholderIsReallyLong = placeholderWidth > inputMinWidth * 2;
|
|
803
|
+
return placeholderIsReallyLong && availableHorizontalChipElSpaceWithPlaceholder <= 0;
|
|
804
|
+
}
|
|
805
|
+
getFitCompactDisplayState({ chipContainerElGap, chipContainerElWidth, inputMinWidth, placeholderWidth, selectedIndicatorChipElWidth }) {
|
|
806
|
+
const selectedChipCountElWidth = getElementWidth(this.selectedChipCountRef.value);
|
|
807
|
+
const hiddenChipIndicatorWidth = this.deferFitChipCountRender || this.selectedHiddenChipsCount <= 0 ? 0 : selectedChipCountElWidth || selectedIndicatorChipElWidth;
|
|
808
|
+
const reservedPlaceholderInputWidth = Math.max(inputMinWidth, placeholderWidth);
|
|
809
|
+
const hideSelectedChips = this.shouldUseFitCompactDisplay({
|
|
810
|
+
chipContainerElGap,
|
|
811
|
+
chipContainerElWidth,
|
|
812
|
+
hiddenChipIndicatorWidth,
|
|
813
|
+
inputMinWidth,
|
|
814
|
+
placeholderWidth,
|
|
815
|
+
reservedPlaceholderInputWidth
|
|
816
|
+
});
|
|
817
|
+
return {
|
|
818
|
+
hiddenChipIndicatorWidth,
|
|
819
|
+
hideSelectedChips,
|
|
820
|
+
reservedPlaceholderInputWidth
|
|
821
|
+
};
|
|
822
|
+
}
|
|
698
823
|
setCompactSelectionDisplay({ chipContainerElGap, chipContainerElWidth, inputWidth, largestSelectedIndicatorChipWidth }) {
|
|
699
824
|
const newCompactBreakpoint = Math.round(largestSelectedIndicatorChipWidth + chipContainerElGap + inputWidth);
|
|
700
825
|
if (!this.maxCompactBreakpoint || this.maxCompactBreakpoint < newCompactBreakpoint) {
|
|
@@ -715,17 +840,21 @@ class Combobox extends LitElement {
|
|
|
715
840
|
this.referenceEl = el;
|
|
716
841
|
connectFloatingUI(this);
|
|
717
842
|
}
|
|
718
|
-
|
|
843
|
+
syncChipVisibilityCounts(chipEls) {
|
|
719
844
|
let newSelectedVisibleChipsCount = 0;
|
|
845
|
+
let selectedChipCount = 0;
|
|
720
846
|
chipEls.forEach((chipEl) => {
|
|
721
|
-
if (chipEl.selected
|
|
722
|
-
|
|
847
|
+
if (chipEl.selected) {
|
|
848
|
+
selectedChipCount++;
|
|
849
|
+
if (!chipEl.classList.contains(CSS.chipInvisible)) {
|
|
850
|
+
newSelectedVisibleChipsCount++;
|
|
851
|
+
}
|
|
723
852
|
}
|
|
724
853
|
});
|
|
725
854
|
if (newSelectedVisibleChipsCount !== this.selectedVisibleChipsCount) {
|
|
726
855
|
this.selectedVisibleChipsCount = newSelectedVisibleChipsCount;
|
|
727
856
|
}
|
|
728
|
-
const newSelectedHiddenChipsCount = Math.max(0,
|
|
857
|
+
const newSelectedHiddenChipsCount = Math.max(0, selectedChipCount - newSelectedVisibleChipsCount);
|
|
729
858
|
if (newSelectedHiddenChipsCount !== this.selectedHiddenChipsCount) {
|
|
730
859
|
this.selectedHiddenChipsCount = newSelectedHiddenChipsCount;
|
|
731
860
|
}
|
|
@@ -770,6 +899,9 @@ class Combobox extends LitElement {
|
|
|
770
899
|
if (!item || this.selectionMode === "single-persist" && item.selected && item.value === this.value && !value) {
|
|
771
900
|
return;
|
|
772
901
|
}
|
|
902
|
+
if (this.selectionDisplay === "fit" && this.isMulti()) {
|
|
903
|
+
this.deferFitChipCountRender = true;
|
|
904
|
+
}
|
|
773
905
|
if (this.isMulti()) {
|
|
774
906
|
this.handleMultiSelection(item, value);
|
|
775
907
|
} else {
|
|
@@ -779,7 +911,7 @@ class Combobox extends LitElement {
|
|
|
779
911
|
handleMultiSelection(item, value) {
|
|
780
912
|
item.selected = value;
|
|
781
913
|
this.updateAncestors(item);
|
|
782
|
-
this.
|
|
914
|
+
this.updateSelectedItems();
|
|
783
915
|
this.emitComboboxChange();
|
|
784
916
|
this.resetText();
|
|
785
917
|
this.filterItems("");
|
|
@@ -788,7 +920,7 @@ class Combobox extends LitElement {
|
|
|
788
920
|
this.ignoreSelectedEventsFlag = true;
|
|
789
921
|
this.items.forEach((el) => el.selected = el === item ? value : false);
|
|
790
922
|
this.ignoreSelectedEventsFlag = false;
|
|
791
|
-
this.
|
|
923
|
+
this.updateSelectedItems();
|
|
792
924
|
this.emitComboboxChange();
|
|
793
925
|
if (this.textInputRef.value) {
|
|
794
926
|
this.textInputRef.value.value = getLabel(item);
|
|
@@ -805,11 +937,14 @@ class Combobox extends LitElement {
|
|
|
805
937
|
const ancestors = getItemAncestors(item);
|
|
806
938
|
const children = getItemChildren(item);
|
|
807
939
|
if (item.selected) {
|
|
808
|
-
ancestors.forEach((el) => {
|
|
940
|
+
[...children, ...ancestors].forEach((el) => {
|
|
941
|
+
if (el.disabled) {
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
809
944
|
el.selected = true;
|
|
810
945
|
});
|
|
811
946
|
} else {
|
|
812
|
-
children.forEach((el) => {
|
|
947
|
+
[...children].forEach((el) => {
|
|
813
948
|
if (el.disabled) {
|
|
814
949
|
return;
|
|
815
950
|
}
|
|
@@ -829,7 +964,8 @@ class Combobox extends LitElement {
|
|
|
829
964
|
this.data = this.getData();
|
|
830
965
|
this.groupData = this.getGroupData();
|
|
831
966
|
this.updateItemProps();
|
|
832
|
-
this.
|
|
967
|
+
this.updateSelectedItems();
|
|
968
|
+
this.previousAllSelected = this.allSelected;
|
|
833
969
|
}
|
|
834
970
|
updateItemProps() {
|
|
835
971
|
this.allItems.forEach((item) => {
|
|
@@ -903,13 +1039,17 @@ class Combobox extends LitElement {
|
|
|
903
1039
|
}
|
|
904
1040
|
removeActiveChip(chip) {
|
|
905
1041
|
const activeItem = this.selectedItems[this.activeChipIndex];
|
|
906
|
-
if (activeItem && `${IDS.chip(activeItem.guid)}` === chip.id) {
|
|
1042
|
+
if (activeItem && !activeItem.disabled && `${IDS.chip(activeItem.guid)}` === chip.id) {
|
|
907
1043
|
this.toggleSelection(activeItem, false);
|
|
908
1044
|
}
|
|
909
1045
|
this.setFocus();
|
|
910
1046
|
}
|
|
911
1047
|
removeLastChip() {
|
|
912
|
-
this.
|
|
1048
|
+
const lastEnabledSelectedItem = this.selectedItems.findLast((item) => !item.disabled);
|
|
1049
|
+
if (!lastEnabledSelectedItem) {
|
|
1050
|
+
return;
|
|
1051
|
+
}
|
|
1052
|
+
this.toggleSelection(lastEnabledSelectedItem, false);
|
|
913
1053
|
this.setFocus();
|
|
914
1054
|
}
|
|
915
1055
|
previousChip() {
|
|
@@ -980,7 +1120,11 @@ class Combobox extends LitElement {
|
|
|
980
1120
|
if (this.disabled) {
|
|
981
1121
|
return;
|
|
982
1122
|
}
|
|
1123
|
+
this.activeChipIndex = -1;
|
|
983
1124
|
this.textInputRef.value.focus();
|
|
1125
|
+
if (this.open && this.selectionDisplay === "fit" && this.isMulti()) {
|
|
1126
|
+
void this.refreshSelectionDisplay();
|
|
1127
|
+
}
|
|
984
1128
|
}
|
|
985
1129
|
createScreenReaderItem({ ariaLabel, ariaSelected, id, textContent }) {
|
|
986
1130
|
return html`<li aria-label=${ariaLabel ?? nothing} aria-selected=${ariaSelected ?? nothing} id=${id ?? nothing} role=option tabindex=-1>${textContent}</li>`;
|
|
@@ -1006,64 +1150,58 @@ class Combobox extends LitElement {
|
|
|
1006
1150
|
return keyed(item.guid || item.value || label, html`<calcite-chip .appearance=${readOnly ? "outline" : "solid"} class=${safeClassMap({
|
|
1007
1151
|
[CSS.chip]: true,
|
|
1008
1152
|
[CSS.disabled]: disabled
|
|
1009
|
-
})} .closable=${!disabled && !readOnly} .disabled=${disabled} .icon=${item.icon} .iconFlipRtl=${item.iconFlipRtl} id=${(!disabled && item.guid ? `${IDS.chip(item.guid)}` : null) ?? nothing} .label=${label} .messageOverrides=${!disabled ? { dismissLabel: messages.removeTag } : null} @calciteChipClose=${!disabled ? () => this.calciteChipCloseHandler(item) : null} @focusin=${!disabled ? () => this.activeChipIndex = index : null} .scale=${scale} .selected=${item.selected} .tabIndex=${!disabled && activeChipIndex === index ? 0 : -1} title=${label ?? nothing} .value=${item.value}>${label}</calcite-chip>`);
|
|
1153
|
+
})} .closable=${!disabled && !readOnly} data-testid=${`${disabled ? "disabled-chip" : "chip"}-${index}`} .disabled=${disabled} .icon=${item.icon} .iconFlipRtl=${item.iconFlipRtl} id=${(!disabled && item.guid ? `${IDS.chip(item.guid)}` : null) ?? nothing} .label=${label} .messageOverrides=${!disabled ? { dismissLabel: messages.removeTag } : null} @calciteChipClose=${!disabled ? () => this.calciteChipCloseHandler(item) : null} @focusin=${!disabled ? () => this.activeChipIndex = index : null} .scale=${scale} .selected=${item.selected} .tabIndex=${!disabled && activeChipIndex === index ? 0 : -1} title=${label ?? nothing} .value=${item.value}>${label}</calcite-chip>`);
|
|
1010
1154
|
}
|
|
1011
1155
|
renderChipCount(count, scale) {
|
|
1012
|
-
const label = this.messages.disabledSelectedCount?.replace("{count}", `${count}`) ?? `+${count}`;
|
|
1156
|
+
const label = this.fitUsingCompactCountLabel ? `${count}` : this.messages.disabledSelectedCount?.replace("{count}", `${count}`) ?? `+${count}`;
|
|
1013
1157
|
return html`<calcite-chip appearance=solid class=${safeClassMap({
|
|
1014
1158
|
[CSS.chip]: true
|
|
1015
|
-
})} .label=${label} .scale=${scale} tabindex=-1 title=${label ?? nothing}>${label}</calcite-chip>`;
|
|
1159
|
+
})} data-testid=selected-chip-count id=selected-chip-count .label=${label} .scale=${scale} tabindex=-1 title=${label ?? nothing} ${ref(this.selectedChipCountRef)}>${label}</calcite-chip>`;
|
|
1016
1160
|
}
|
|
1017
1161
|
renderChips() {
|
|
1018
1162
|
const { activeChipIndex, readOnly, scale, selectionDisplay, selectionMode, messages } = this;
|
|
1019
1163
|
const chips = [];
|
|
1020
1164
|
const isAncestors = selectionMode === "ancestors";
|
|
1021
|
-
const
|
|
1022
|
-
const allSelectedWithDisabledSelected = this.allSelected && this.hasDisabledSelected;
|
|
1023
|
-
const disabledItems = this.allItems.filter((item) => item.disabled && item.selected && (!isAncestors || !hasActiveChildren(item)));
|
|
1165
|
+
const hideSelectedChipsForSelectAll = this.selectAllEnabled && this.allSelected;
|
|
1024
1166
|
const preserveOrder = selectionDisplay === "all";
|
|
1025
|
-
if (
|
|
1167
|
+
if (hideSelectedChipsForSelectAll) {
|
|
1026
1168
|
return null;
|
|
1027
1169
|
}
|
|
1028
1170
|
let selectedIndex = 0;
|
|
1029
1171
|
let disabledIndex = 0;
|
|
1030
1172
|
if (preserveOrder) {
|
|
1031
|
-
this.allItems.
|
|
1173
|
+
const selectedChipItems = this.allItems.filter((item) => item.selected && (!isAncestors || !hasActiveChildren(item)));
|
|
1174
|
+
const orderedSelectedChipItems = orderByPrevious(selectedChipItems, this.selectedItems);
|
|
1175
|
+
orderedSelectedChipItems.forEach((item) => {
|
|
1032
1176
|
if (item.disabled) {
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
}));
|
|
1044
|
-
}
|
|
1177
|
+
chips.push(this.renderChip({
|
|
1178
|
+
activeChipIndex,
|
|
1179
|
+
disabled: true,
|
|
1180
|
+
index: disabledIndex++,
|
|
1181
|
+
item,
|
|
1182
|
+
messages,
|
|
1183
|
+
readOnly,
|
|
1184
|
+
scale,
|
|
1185
|
+
isAncestors
|
|
1186
|
+
}));
|
|
1045
1187
|
return;
|
|
1046
1188
|
}
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
isAncestors
|
|
1058
|
-
}));
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1189
|
+
chips.push(this.renderChip({
|
|
1190
|
+
activeChipIndex,
|
|
1191
|
+
disabled: false,
|
|
1192
|
+
index: selectedIndex++,
|
|
1193
|
+
item,
|
|
1194
|
+
messages,
|
|
1195
|
+
readOnly,
|
|
1196
|
+
scale,
|
|
1197
|
+
isAncestors
|
|
1198
|
+
}));
|
|
1061
1199
|
});
|
|
1062
|
-
} else if (!
|
|
1200
|
+
} else if (!hideSelectedChipsForSelectAll) {
|
|
1063
1201
|
this.selectedItems.forEach((item) => {
|
|
1064
1202
|
chips.push(this.renderChip({
|
|
1065
1203
|
activeChipIndex,
|
|
1066
|
-
disabled:
|
|
1204
|
+
disabled: item.disabled,
|
|
1067
1205
|
index: selectedIndex++,
|
|
1068
1206
|
item,
|
|
1069
1207
|
messages,
|
|
@@ -1073,32 +1211,53 @@ class Combobox extends LitElement {
|
|
|
1073
1211
|
}));
|
|
1074
1212
|
});
|
|
1075
1213
|
}
|
|
1076
|
-
if (selectionDisplay === "fit"
|
|
1077
|
-
|
|
1214
|
+
if (selectionDisplay === "fit") {
|
|
1215
|
+
const hiddenSelectedCount = this.selectedHiddenChipsCount;
|
|
1216
|
+
const countChipValue = this.selectedVisibleChipsCount === 0 ? this.selectedItems.length : hiddenSelectedCount;
|
|
1217
|
+
if (hiddenSelectedCount > 0 && !this.deferFitChipCountRender) {
|
|
1218
|
+
chips.push(this.renderChipCount(countChipValue, scale));
|
|
1219
|
+
}
|
|
1078
1220
|
}
|
|
1079
1221
|
return chips.length ? chips : null;
|
|
1080
1222
|
}
|
|
1081
1223
|
renderAllSelectedIndicatorChip() {
|
|
1082
1224
|
const { allSelectedIndicatorChipRef, compactSelectionDisplay, scale, selectedVisibleChipsCount } = this;
|
|
1083
|
-
|
|
1084
|
-
|
|
1225
|
+
let useFitCompactLabel = false;
|
|
1226
|
+
if (this.selectionDisplay === "fit" && this.textInputRef.value && this.chipContainerEl) {
|
|
1227
|
+
const chipContainerElGap = parseInt(getComputedStyle(this.chipContainerEl).gap);
|
|
1228
|
+
const chipContainerElWidth = getElementWidth(this.chipContainerEl);
|
|
1229
|
+
const { fontSize, fontFamily, minInlineSize } = getComputedStyle(this.textInputRef.value);
|
|
1230
|
+
const placeholderWidthMultiplier = 0.55;
|
|
1231
|
+
const inputMinWidth = parseFloat(minInlineSize) || parseInt(calciteSize48);
|
|
1232
|
+
const measuredPlaceholderWidth = getTextWidth(this.placeholder, `${fontSize} ${fontFamily}`);
|
|
1233
|
+
const placeholderWidth = measuredPlaceholderWidth > 0 ? measuredPlaceholderWidth : Math.max(inputMinWidth, Math.round((this.placeholder?.length || 0) * (parseFloat(fontSize) || parseInt(calciteSize48)) * placeholderWidthMultiplier));
|
|
1234
|
+
const selectedIndicatorChipElWidth = getElementWidth(this.selectedIndicatorChipRef.value);
|
|
1235
|
+
useFitCompactLabel = this.getFitCompactDisplayState({
|
|
1236
|
+
chipContainerElGap,
|
|
1237
|
+
chipContainerElWidth,
|
|
1238
|
+
inputMinWidth,
|
|
1239
|
+
placeholderWidth,
|
|
1240
|
+
selectedIndicatorChipElWidth
|
|
1241
|
+
}).hideSelectedChips;
|
|
1242
|
+
}
|
|
1243
|
+
const useCompactAllLabel = compactSelectionDisplay || useFitCompactLabel;
|
|
1244
|
+
const label = useCompactAllLabel ? this.messages.all : this.messages.allSelected;
|
|
1245
|
+
const showAllSelectedChip = this.allSelected && (this.selectionDisplay === "single" || !selectedVisibleChipsCount || this.selectionDisplay === "all");
|
|
1085
1246
|
return html`<calcite-chip class=${safeClassMap({
|
|
1086
1247
|
[CSS.chip]: true,
|
|
1087
1248
|
[CSS.chipInvisible]: !showAllSelectedChip,
|
|
1088
1249
|
[CSS.allSelected]: true
|
|
1089
|
-
})} .label=${label} .scale=${scale} title=${label ?? nothing} value ${ref(allSelectedIndicatorChipRef)}>${label}</calcite-chip>`;
|
|
1250
|
+
})} data-testid=all-selected-indicator-chip .label=${label} .scale=${scale} title=${label ?? nothing} value ${ref(allSelectedIndicatorChipRef)}>${label}</calcite-chip>`;
|
|
1090
1251
|
}
|
|
1091
1252
|
renderSelectedIndicatorChip() {
|
|
1092
|
-
const { compactSelectionDisplay, selectionDisplay, scale,
|
|
1093
|
-
const allSelectedNoDisabled = this.allSelected && !this.hasDisabledItems;
|
|
1094
|
-
const allSelectedWithDisabledSelected = this.allSelected && this.hasDisabledSelected;
|
|
1253
|
+
const { compactSelectionDisplay, selectionDisplay, scale, selectedIndicatorChipRef } = this;
|
|
1095
1254
|
let chipInvisible;
|
|
1096
1255
|
let label;
|
|
1256
|
+
const selectedItemsCount = this.getSelectedItems().length;
|
|
1097
1257
|
if (compactSelectionDisplay) {
|
|
1098
1258
|
chipInvisible = true;
|
|
1099
1259
|
} else {
|
|
1100
1260
|
if (selectionDisplay === "single") {
|
|
1101
|
-
const selectedItemsCount = this.allItems.filter((item) => item.selected && (this.selectionMode !== "ancestors" || !hasActiveChildren(item))).length;
|
|
1102
1261
|
if (this.allSelected) {
|
|
1103
1262
|
chipInvisible = true;
|
|
1104
1263
|
} else if (selectedItemsCount > 0) {
|
|
@@ -1107,9 +1266,6 @@ class Combobox extends LitElement {
|
|
|
1107
1266
|
chipInvisible = true;
|
|
1108
1267
|
}
|
|
1109
1268
|
label = `${selectedItemsCount} ${this.messages.selected}`;
|
|
1110
|
-
} else if (selectionDisplay === "fit") {
|
|
1111
|
-
chipInvisible = !!((allSelectedNoDisabled || allSelectedWithDisabledSelected) && selectedVisibleChipsCount === 0 || selectedHiddenChipsCount === 0);
|
|
1112
|
-
label = selectedVisibleChipsCount > 0 ? `+${selectedHiddenChipsCount}` : `${selectedHiddenChipsCount} ${this.messages.selected}`;
|
|
1113
1269
|
}
|
|
1114
1270
|
}
|
|
1115
1271
|
return html`<calcite-chip class=${safeClassMap({
|
|
@@ -1118,18 +1274,13 @@ class Combobox extends LitElement {
|
|
|
1118
1274
|
})} .label=${label} .scale=${scale} title=${label ?? nothing} value ${ref(selectedIndicatorChipRef)}>${label}</calcite-chip>`;
|
|
1119
1275
|
}
|
|
1120
1276
|
renderSelectedIndicatorChipCompact() {
|
|
1121
|
-
const { compactSelectionDisplay, selectionDisplay, scale
|
|
1122
|
-
const allSelectedNoDisabled = this.allSelected && !this.hasDisabledItems;
|
|
1123
|
-
const allSelectedWithDisabledSelected = this.allSelected && this.hasDisabledSelected;
|
|
1277
|
+
const { compactSelectionDisplay, selectionDisplay, scale } = this;
|
|
1124
1278
|
let chipInvisible;
|
|
1125
1279
|
let label;
|
|
1280
|
+
const selectedItemsCount = this.getSelectedItems().length;
|
|
1126
1281
|
if (compactSelectionDisplay) {
|
|
1127
|
-
|
|
1128
|
-
if (allSelectedNoDisabled || allSelectedWithDisabledSelected || selectionDisplay === "single" && this.allSelected) {
|
|
1282
|
+
if (this.allSelected) {
|
|
1129
1283
|
chipInvisible = true;
|
|
1130
|
-
} else if (selectionDisplay === "fit") {
|
|
1131
|
-
chipInvisible = !(selectedHiddenChipsCount > 0);
|
|
1132
|
-
label = `${selectedHiddenChipsCount || 0}`;
|
|
1133
1284
|
} else if (selectionDisplay === "single") {
|
|
1134
1285
|
chipInvisible = !(selectedItemsCount > 0);
|
|
1135
1286
|
label = `${selectedItemsCount}`;
|
|
@@ -1158,7 +1309,7 @@ class Combobox extends LitElement {
|
|
|
1158
1309
|
[CSS.inputSingle]: true,
|
|
1159
1310
|
[CSS.inputHidden]: showLabel,
|
|
1160
1311
|
[CSS.inputIcon]: this.showingInlineIcon && !!this.placeholderIcon
|
|
1161
|
-
})} .disabled=${disabled} .id=${`${IDS.input(guid2)}`} @focus=${this.comboboxFocusHandler} @input=${this.inputHandler} placeholder=${placeholder ?? nothing} .readOnly=${this.readOnly} .required=${this.required} role=combobox .tabIndex=${this.activeChipIndex === -1 ? 0 : -1} type=text .value=${live(this.filterText ?? "")} ${ref(this.textInputRef)}>`)}</span>`;
|
|
1312
|
+
})} data-testid=input .disabled=${disabled} .id=${`${IDS.input(guid2)}`} @focus=${this.comboboxFocusHandler} @input=${this.inputHandler} placeholder=${placeholder ?? nothing} .readOnly=${this.readOnly} .required=${this.required} role=combobox .tabIndex=${this.activeChipIndex === -1 ? 0 : -1} type=text .value=${live(this.filterText ?? "")} ${ref(this.textInputRef)}>`)}</span>`;
|
|
1162
1313
|
}
|
|
1163
1314
|
renderListBoxOptions() {
|
|
1164
1315
|
const mappedListBoxOptions = this.keyboardNavItems.map((item) => this.createScreenReaderItem({
|
|
@@ -1187,7 +1338,7 @@ class Combobox extends LitElement {
|
|
|
1187
1338
|
[FloatingCSS.animationActive]: open
|
|
1188
1339
|
};
|
|
1189
1340
|
const label = (this.filterText && messages.add?.replace("{text}", `${this.filterText}`)) ?? "";
|
|
1190
|
-
return html`<div aria-hidden=true class=${safeClassMap(CSS.floatingUIContainer)} popover=manual ${ref(setFloatingEl)}><div class=${safeClassMap(classes)} ${ref(setContainerEl)}><ul class=${safeClassMap({ [CSS.list]: true, [CSS.listHide]: !open })}>${this.selectAllEnabled && this.selectionMode !== "single" && this.selectionMode !== "single-persist" && html`<calcite-combobox-item class=${safeClassMap(CSS.selectAll)} .heading=${messages.selectAll} .id=${`${this.guid}-select-all-enabled-interactive`} .indeterminate=${this.indeterminate} .label=${messages.selectAll} .scale=${scale} .selected=${this.allSelected} tabindex=-1 value=select-all ${ref(this.selectAllComboboxItemRef)}></calcite-combobox-item>` || ""}<slot></slot>${this.noMatchesFound && (this.allowCustomValues ? html`<li aria-label=${label ?? nothing} class=${safeClassMap(CSS.noMatches)} @click=${this.customChipAddHandler} role=option tabindex=0>${highlightText({
|
|
1341
|
+
return html`<div aria-hidden=true class=${safeClassMap(CSS.floatingUIContainer)} popover=manual ${ref(setFloatingEl)}><div class=${safeClassMap(classes)} ${ref(setContainerEl)}><ul class=${safeClassMap({ [CSS.list]: true, [CSS.listHide]: !open })}>${this.selectAllEnabled && this.selectionMode !== "single" && this.selectionMode !== "single-persist" && html`<calcite-combobox-item class=${safeClassMap(CSS.selectAll)} data-testid=select-all-item .heading=${messages.selectAll} .id=${`${this.guid}-select-all-enabled-interactive`} .indeterminate=${this.indeterminate} .label=${messages.selectAll} .scale=${scale} .selected=${this.allSelected} tabindex=-1 value=select-all ${ref(this.selectAllComboboxItemRef)}></calcite-combobox-item>` || ""}<slot></slot>${this.noMatchesFound && (this.allowCustomValues ? html`<li aria-label=${label ?? nothing} class=${safeClassMap(CSS.noMatches)} @click=${this.customChipAddHandler} role=option tabindex=0>${highlightText({
|
|
1191
1342
|
text: label,
|
|
1192
1343
|
pattern: new RegExp(`(${escapeRegExp(this.filterText)})`, "i")
|
|
1193
1344
|
})}</li>` : html`<li class=${safeClassMap({ [CSS.noMatchesPlaceholder]: true, [CSS.noMatches]: true })}>${messages.noMatches}</li>`) || ""}</ul></div></div>`;
|
|
@@ -1212,8 +1363,10 @@ class Combobox extends LitElement {
|
|
|
1212
1363
|
const allSelectionDisplay = selectionDisplay === "all";
|
|
1213
1364
|
const singleSelectionDisplay = selectionDisplay === "single";
|
|
1214
1365
|
const fitSelectionDisplay = !singleSelectionMode && selectionDisplay === "fit";
|
|
1215
|
-
const
|
|
1216
|
-
const
|
|
1366
|
+
const showIndicatorChips = !singleSelectionMode && !allSelectionDisplay;
|
|
1367
|
+
const showSingleIndicatorChips = showIndicatorChips && !fitSelectionDisplay;
|
|
1368
|
+
const hasClearableSelection = this.items.some((item) => item.selected && !item.disabled);
|
|
1369
|
+
const isClearable = !this.clearDisabled && this.selectionMode !== "single-persist" && !!this.value?.length && hasClearableSelection;
|
|
1217
1370
|
return this.interactiveContainer({ disabled: this.disabled, children: html`${this.labelText && InternalLabel({ labelText: this.labelText, onClick: this.onLabelClick, required: this.required, tooltipText: this.messages.required }) || ""}<div aria-live=polite class=${safeClassMap({
|
|
1218
1371
|
[CSS.wrapper]: true,
|
|
1219
1372
|
[CSS.wrapperSingle]: singleSelectionMode || !this.selectedItems.length,
|
|
@@ -1222,11 +1375,7 @@ class Combobox extends LitElement {
|
|
|
1222
1375
|
[CSS.gridInput]: true,
|
|
1223
1376
|
[CSS.selectionDisplayFit]: fitSelectionDisplay,
|
|
1224
1377
|
[CSS.selectionDisplaySingle]: singleSelectionDisplay
|
|
1225
|
-
})} ${ref(this.setChipContainerEl)}>${!singleSelectionMode && !singleSelectionDisplay && this.renderChips() || ""}${!singleSelectionMode && !singleSelectionDisplay && this.selectAllEnabled && allSelectionDisplay && (
|
|
1226
|
-
this.renderSelectedIndicatorChip(),
|
|
1227
|
-
this.renderSelectedIndicatorChipCompact(),
|
|
1228
|
-
this.renderAllSelectedIndicatorChip()
|
|
1229
|
-
] || ""}<label class=${safeClassMap(CSS.screenReadersOnly)} .htmlFor=${`${IDS.input(guid2)}`} .id=${`${IDS.label(guid2)}`}>${label}</label>${this.renderInput()}</div>`)}${!readOnly && isClearable ? ClearButton({ ariaLabel: this.messages.clear, disabled: this.disabled, ref: this.clearButtonRef, scale: this.scale, title: this.messages.clear }) : null}${!readOnly && this.renderChevronIcon() || ""}</div><ul aria-labelledby=${`${IDS.label(guid2)}`} aria-multiselectable=true class=${safeClassMap(CSS.screenReadersOnly)} .id=${`${IDS.listbox(guid2)}`} role=listbox tabindex=-1>${this.renderListBoxOptions()}</ul>${this.renderFloatingUIContainer()}${this.validationMessage && this.status === "invalid" ? Validation({ icon: this.validationIcon, id: IDS.validationMessage, message: this.validationMessage, scale: this.scale, status: this.status }) : null}` });
|
|
1378
|
+
})} ${ref(this.setChipContainerEl)}>${!singleSelectionMode && !singleSelectionDisplay && this.renderChips() || ""}${!singleSelectionMode && !singleSelectionDisplay && this.selectAllEnabled && allSelectionDisplay && this.renderAllSelectedIndicatorChip() || ""}${showSingleIndicatorChips && this.renderSelectedIndicatorChip() || ""}${showSingleIndicatorChips && this.renderSelectedIndicatorChipCompact() || ""}${showIndicatorChips && this.renderAllSelectedIndicatorChip() || ""}<label class=${safeClassMap(CSS.screenReadersOnly)} .htmlFor=${`${IDS.input(guid2)}`} .id=${`${IDS.label(guid2)}`}>${label}</label>${this.renderInput()}</div>`)}${!readOnly && isClearable ? ClearButton({ ariaLabel: this.messages.clear, disabled: this.disabled, ref: this.clearButtonRef, scale: this.scale, title: this.messages.clear }) : null}${!readOnly && this.renderChevronIcon() || ""}</div><ul aria-labelledby=${`${IDS.label(guid2)}`} aria-multiselectable=true class=${safeClassMap(CSS.screenReadersOnly)} .id=${`${IDS.listbox(guid2)}`} role=listbox tabindex=-1>${this.renderListBoxOptions()}</ul>${this.renderFloatingUIContainer()}${this.validationMessage && this.status === "invalid" ? Validation({ icon: this.validationIcon, id: IDS.validationMessage, message: this.validationMessage, scale: this.scale, status: this.status }) : null}` });
|
|
1230
1379
|
}
|
|
1231
1380
|
}
|
|
1232
1381
|
customElement("calcite-combobox", Combobox);
|