@esri/calcite-components 5.1.0 → 5.1.1-next.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/dist/cdn/{A5L2Q32C.js → 2NMB77K5.js} +1 -1
- package/dist/cdn/{NZC2U4OU.js → 2SPMAQ5L.js} +1 -1
- package/dist/cdn/{2P5ISR6V.js → 2ZHIUXVZ.js} +1 -1
- package/dist/cdn/{NBXPROCG.js → 34KRZJL3.js} +1 -1
- package/dist/cdn/{LBFLMGFV.js → 44Z3ZTNF.js} +1 -1
- package/dist/cdn/{5C72Z4LQ.js → 4B4VLO74.js} +1 -1
- package/dist/cdn/{XMHBPNOP.js → 4K7HGXDC.js} +1 -1
- package/dist/cdn/{BONCETQ5.js → 4KLNRQPT.js} +1 -1
- package/dist/cdn/{NKYEDCKH.js → 4X26VMH5.js} +1 -1
- package/dist/cdn/{HB4MH2EZ.js → 55YDFORF.js} +1 -1
- package/dist/cdn/{X3WAJ4V4.js → 5CRWBOSC.js} +1 -1
- package/dist/cdn/{WTP5LKQS.js → 5RO62KJK.js} +1 -1
- package/dist/cdn/{UTEI7VLM.js → 5XRVSEG7.js} +1 -1
- package/dist/cdn/{LUWJNSYS.js → 5YHUPYKE.js} +1 -1
- package/dist/cdn/{ZYQDIIRU.js → 5ZZEWEIT.js} +1 -1
- package/dist/cdn/{TKHRV4GA.js → 66HZFVZ7.js} +1 -1
- package/dist/cdn/{GJL5RMPQ.js → 67BDZ5MU.js} +1 -1
- package/dist/cdn/{7OWLHFPX.js → 6HYXO4HG.js} +1 -1
- package/dist/cdn/{DMMA5ZYG.js → 6UQG2LBL.js} +1 -1
- package/dist/cdn/{KWFOKTKG.js → 6YNWDB5R.js} +1 -1
- package/dist/cdn/{LHYTGIZG.js → 7ADUVBN5.js} +1 -1
- package/dist/cdn/{PZVPEXW2.js → 7BU6MRTR.js} +1 -1
- package/dist/cdn/{2VKTPJWO.js → 7U4GZP6F.js} +1 -1
- package/dist/cdn/{XTKAAKGX.js → 7ZLXU3MF.js} +1 -1
- package/dist/cdn/{ODKPYY3R.js → A7BQRB3N.js} +1 -1
- package/dist/cdn/{Y47FX6CN.js → AAOOXSNF.js} +1 -1
- package/dist/cdn/{GEEPTD4A.js → ACSP5NAU.js} +1 -1
- package/dist/cdn/{WC3SB5B7.js → ADFVLGFH.js} +1 -1
- package/dist/cdn/{54WP47EN.js → AMBK5EQK.js} +1 -1
- package/dist/cdn/{QYODZAGH.js → AXM7XBEQ.js} +1 -1
- package/dist/cdn/{NRYIW7DB.js → B3DO2CTZ.js} +1 -1
- package/dist/cdn/{GDZAGWDU.js → BIU2FT4R.js} +1 -1
- package/dist/cdn/{D44AQ74K.js → BMOQYYKD.js} +1 -1
- package/dist/cdn/{44WHX5D3.js → BMQJGUNC.js} +1 -1
- package/dist/cdn/{OQHB5W7D.js → BQMQMPXL.js} +1 -1
- package/dist/cdn/{KTBER6SN.js → C4DKRIKN.js} +1 -1
- package/dist/cdn/{6YLT6LZJ.js → CC2NSXXJ.js} +1 -1
- package/dist/cdn/{EPNCB6OJ.js → CN5IHYVF.js} +1 -1
- package/dist/cdn/{XQXKNOUC.js → COR7OSZ4.js} +1 -1
- package/dist/cdn/{7A746NXL.js → CQN3EBLZ.js} +1 -1
- package/dist/cdn/{3GDRQKT2.js → CQY7OQCM.js} +1 -1
- package/dist/cdn/{ADH5D4IE.js → CY24CXIT.js} +1 -1
- package/dist/cdn/{EOJ2AVKD.js → DM4ZFMNJ.js} +1 -1
- package/dist/cdn/{NERFMP54.js → ED3LVXXU.js} +1 -1
- package/dist/cdn/{RYLKDSFN.js → EI7PYDCL.js} +1 -1
- package/dist/cdn/{GZHK6NCY.js → EXGMAWUU.js} +1 -1
- package/dist/cdn/{4A2BNZJW.js → EZ5445TQ.js} +1 -1
- package/dist/cdn/{I5D2AGK5.js → F3ZEJSCS.js} +1 -1
- package/dist/cdn/{JRHGPYNH.js → FE43UIZ6.js} +1 -1
- package/dist/cdn/{QSU37BPY.js → FJYOGST7.js} +1 -1
- package/dist/cdn/{BL4CROY4.js → FKTEA2XN.js} +1 -1
- package/dist/cdn/{3HTVKOWE.js → FTABOHZ5.js} +1 -1
- package/dist/cdn/{5OLLJHWT.js → GDFNVTHK.js} +1 -1
- package/dist/cdn/{6UERLWMH.js → GK3H6G2N.js} +1 -1
- package/dist/cdn/{LO5HOYI2.js → GL2JPUTY.js} +1 -1
- package/dist/cdn/{4ANP3V6G.js → GOVFVBB5.js} +1 -1
- package/dist/cdn/{XVCPLNXU.js → GQN4OXMJ.js} +1 -1
- package/dist/cdn/{K57DPE4N.js → GRUZM5ST.js} +1 -1
- package/dist/cdn/{KEAGVFG4.js → GSJSIJRA.js} +1 -1
- package/dist/cdn/{SUEXKJRG.js → GZMF6BSV.js} +1 -1
- package/dist/cdn/{NRALFORW.js → H3WM47M7.js} +1 -1
- package/dist/cdn/{R2VQIQOY.js → HAEJDZHN.js} +1 -1
- package/dist/cdn/{AYFJCHPP.js → HCDEPNE3.js} +1 -1
- package/dist/cdn/{VD7KVHE6.js → HMX6OA7N.js} +1 -1
- package/dist/cdn/{KSR5E33C.js → HSRDJS2W.js} +1 -1
- package/dist/cdn/{JZWVIZ2B.js → IDUDNWXT.js} +1 -1
- package/dist/cdn/{V5LDBUD2.js → IGF7FPF4.js} +1 -1
- package/dist/cdn/{DJTEYVEK.js → IP64EJYK.js} +1 -1
- package/dist/cdn/{GFEJFYRL.js → ITNBFIMC.js} +1 -1
- package/dist/cdn/{75ARST2G.js → JPWFFKOA.js} +1 -1
- package/dist/cdn/{UY76KLJJ.js → KTJRYASH.js} +1 -1
- package/dist/cdn/{KEFKNHSD.js → LBP5CM53.js} +1 -1
- package/dist/cdn/{XZK4WGVJ.js → LGNS77KR.js} +1 -1
- package/dist/cdn/{UWU3SSNM.js → LRR54WUD.js} +1 -1
- package/dist/cdn/{7XMGNOPQ.js → LWZL77Q7.js} +1 -1
- package/dist/cdn/{2TVQXBLD.js → M3WDJO47.js} +1 -1
- package/dist/cdn/{W753MF3U.js → MAQ6XAAT.js} +1 -1
- package/dist/cdn/{6XE2EP66.js → MNNGD3GV.js} +1 -1
- package/dist/cdn/{STAAJHPM.js → MXM2TW7T.js} +1 -1
- package/dist/cdn/{3GV45XL7.js → MYDCGCGV.js} +1 -1
- package/dist/cdn/{DYMICF33.js → NBBTFJDZ.js} +1 -1
- package/dist/cdn/{6U4CYHVA.js → NCV5JMLQ.js} +1 -1
- package/dist/cdn/{7FTYXBPX.js → NFTODSNS.js} +1 -1
- package/dist/cdn/{GCNYPWEC.js → NQN2WSJW.js} +1 -1
- package/dist/cdn/{E2T2QERX.js → NTTBV4GW.js} +1 -1
- package/dist/cdn/NUTUWAM5.js +2 -0
- package/dist/cdn/{4V5C3DSP.js → NV27VTSL.js} +1 -1
- package/dist/cdn/{46F35NGY.js → ON7SO3I7.js} +1 -1
- package/dist/cdn/{NTYYNNBV.js → OVVO7HZE.js} +1 -1
- package/dist/cdn/{JWG2PPAV.js → OWRDHRTW.js} +1 -1
- package/dist/cdn/{RRF6AKIF.js → P4JV4CYU.js} +1 -1
- package/dist/cdn/{RJTQLFW2.js → PC3TYPIR.js} +1 -1
- package/dist/cdn/{KTUCOBBY.js → PFXITFXY.js} +1 -1
- package/dist/cdn/{ZQ4VNHFE.js → PPJRU5Z5.js} +1 -1
- package/dist/cdn/{W5TINV5N.js → PUID3A5D.js} +1 -1
- package/dist/cdn/{GB2TPSAG.js → PXHXTDG5.js} +1 -1
- package/dist/cdn/{QOPSMYNJ.js → Q2A6IPFA.js} +1 -1
- package/dist/cdn/{RSCWCCYB.js → Q6CSK4RU.js} +1 -1
- package/dist/cdn/{6ZUCCZI3.js → Q6II3XTP.js} +1 -1
- package/dist/cdn/{4PUYRVNO.js → QJXY45XK.js} +1 -1
- package/dist/cdn/{R3SNXCXR.js → QYBRXLDV.js} +1 -1
- package/dist/cdn/{ISTQU57G.js → QYKX74U3.js} +1 -1
- package/dist/cdn/{LOAHLN6N.js → QYODIFMY.js} +1 -1
- package/dist/cdn/{KED2RZ42.js → R36WJ6MV.js} +1 -1
- package/dist/cdn/{USZ4G42E.js → RCMSQZVI.js} +1 -1
- package/dist/cdn/{GI6UQRPO.js → RGFCXTTU.js} +1 -1
- package/dist/cdn/{FHGV3WTN.js → RS5QYCJM.js} +1 -1
- package/dist/cdn/{5ULM4EXU.js → S4OWDKFL.js} +1 -1
- package/dist/cdn/{AFGFN5LE.js → S5F2DCHT.js} +1 -1
- package/dist/cdn/{KLW37VF4.js → SBCXLNEH.js} +1 -1
- package/dist/cdn/{JIWTOV7Q.js → SDHDHO3F.js} +1 -1
- package/dist/cdn/{YFT7U3IW.js → SJQNZIOR.js} +1 -1
- package/dist/cdn/{ZSTOD4V7.js → SYDO43IX.js} +1 -1
- package/dist/cdn/{2I4IL7KB.js → TAV73N7I.js} +1 -1
- package/dist/cdn/{CYVIISMJ.js → THG5DAAH.js} +1 -1
- package/dist/cdn/{3IM4BLOF.js → TJLEHU6N.js} +1 -1
- package/dist/cdn/{UDRFE54L.js → UITF7YEX.js} +1 -1
- package/dist/cdn/{AKKQ5DPN.js → USTJNZOH.js} +1 -1
- package/dist/cdn/{VYK6NRTI.js → UYATX7WS.js} +1 -1
- package/dist/cdn/{JITQNOBY.js → VDAQB5YL.js} +1 -1
- package/dist/cdn/{QP76SSEW.js → VG3BGZ5P.js} +1 -1
- package/dist/cdn/{RUVQ7O6L.js → VN26OZJ7.js} +1 -1
- package/dist/cdn/{EPDTHVMK.js → VQACNJVS.js} +1 -1
- package/dist/cdn/{7DBM34FB.js → VQPFO6TZ.js} +1 -1
- package/dist/cdn/{NU23JDGC.js → VR3CKV5W.js} +1 -1
- package/dist/cdn/{MJPROSY6.js → W35T3VMC.js} +1 -1
- package/dist/cdn/{GT3BV452.js → W3MDWS2O.js} +1 -1
- package/dist/cdn/{CY6G2WDI.js → WSBBZ2YL.js} +1 -1
- package/dist/cdn/{ADH55C3C.js → WXT6IRHJ.js} +1 -1
- package/dist/cdn/{BOZBB7XQ.js → X63FOM65.js} +1 -1
- package/dist/cdn/{4RELRYKX.js → X762FZFW.js} +1 -1
- package/dist/cdn/{GALIT4BA.js → XAB3X5BV.js} +1 -1
- package/dist/cdn/{ECXU6B4A.js → XDCKLXIM.js} +1 -1
- package/dist/cdn/{TSWJKW5G.js → XLSQO27P.js} +1 -1
- package/dist/cdn/{HRC6BJMW.js → XWR5YSIV.js} +1 -1
- package/dist/cdn/{FFB3HCSC.js → YATKUTSV.js} +1 -1
- package/dist/cdn/{BPVUFU5U.js → YBKBGX2I.js} +1 -1
- package/dist/cdn/{IEPYYQBO.js → YG2S6OKO.js} +1 -1
- package/dist/cdn/{TAZRZNVR.js → YP6625BH.js} +1 -1
- package/dist/cdn/{PQ5ASGHR.js → YQQET3OF.js} +1 -1
- package/dist/cdn/{J3ELP2FF.js → Z3NZFAUV.js} +1 -1
- package/dist/cdn/{YLZT3LR4.js → Z6QVKQ5S.js} +1 -1
- package/dist/cdn/{VAXAY3BK.js → ZBRRCLN2.js} +1 -1
- package/dist/cdn/{NRY3KXPN.js → ZKGAVZTU.js} +1 -1
- package/dist/cdn/{DK56URUM.js → ZYJNW6W7.js} +1 -1
- package/dist/cdn/assets/icon/orientedImageryFullSuperimpose16.json +1 -0
- package/dist/cdn/assets/icon/orientedImageryFullSuperimpose24.json +1 -0
- package/dist/cdn/assets/icon/orientedImageryFullSuperimpose32.json +1 -0
- package/dist/cdn/assets/icon/orientedImageryHalfSuperimpose16.json +1 -0
- package/dist/cdn/assets/icon/orientedImageryHalfSuperimpose24.json +1 -0
- package/dist/cdn/assets/icon/orientedImageryHalfSuperimpose32.json +1 -0
- package/dist/cdn/assets/icon/orientedImagerySceneOnly16.json +1 -0
- package/dist/cdn/assets/icon/orientedImagerySceneOnly24.json +1 -0
- package/dist/cdn/assets/icon/orientedImagerySceneOnly32.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/resources5.js +2 -1
- package/dist/chunks/runtime.js +3 -3
- package/dist/components/calcite-combobox/customElement.js +133 -33
- 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 +7 -7
- package/dist/cdn/5SDZUEAZ.js +0 -2
|
@@ -29,7 +29,7 @@ import { u as useTopLayer } from "../../chunks/useTopLayer.js";
|
|
|
29
29
|
import { u as useForm } from "../../chunks/useForm.js";
|
|
30
30
|
import { I as IDS, C as CSS, a as ComboboxItemSelector, b as ComboboxItemGroupSelector, c as ICONS } from "../../chunks/resources5.js";
|
|
31
31
|
import { h as hasActiveChildren, i as isSingleLike, g as getLabel, a as getItemAncestors, b as getItemChildren } from "../../chunks/utils2.js";
|
|
32
|
-
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}: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))}`;
|
|
32
|
+
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
33
|
class Combobox extends LitElement {
|
|
34
34
|
constructor() {
|
|
35
35
|
super();
|
|
@@ -122,6 +122,7 @@ class Combobox extends LitElement {
|
|
|
122
122
|
this.compactSelectionDisplay = false;
|
|
123
123
|
this.selectedHiddenChipsCount = 0;
|
|
124
124
|
this.selectedVisibleChipsCount = 0;
|
|
125
|
+
this.allItems = [];
|
|
125
126
|
this.items = [];
|
|
126
127
|
this.clearDisabled = false;
|
|
127
128
|
this.disabled = false;
|
|
@@ -152,7 +153,7 @@ class Combobox extends LitElement {
|
|
|
152
153
|
this.listen("click", this.comboboxFocusHandler);
|
|
153
154
|
}
|
|
154
155
|
static {
|
|
155
|
-
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 }], 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 };
|
|
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 };
|
|
156
157
|
}
|
|
157
158
|
static {
|
|
158
159
|
this.formAssociated = true;
|
|
@@ -174,10 +175,21 @@ class Combobox extends LitElement {
|
|
|
174
175
|
return !open && selectedItem ? !!selectedIcon && singleSelectionMode : !!placeholderIcon && (!selectedItem || singleSelectionMode);
|
|
175
176
|
}
|
|
176
177
|
get allSelected() {
|
|
177
|
-
|
|
178
|
+
const enabledItems = this.allItems.filter((item) => !item.disabled);
|
|
179
|
+
return enabledItems.length > 0 && enabledItems.every((item) => item.selected);
|
|
180
|
+
}
|
|
181
|
+
get hasDisabledItems() {
|
|
182
|
+
return this.allItems.some((item) => item.disabled);
|
|
183
|
+
}
|
|
184
|
+
get hasDisabledSelected() {
|
|
185
|
+
return this.allItems.some((item) => item.disabled && item.selected);
|
|
178
186
|
}
|
|
179
187
|
get indeterminate() {
|
|
180
|
-
|
|
188
|
+
const hasAnySelected = this.selectedItems.length > 0 || this.hasDisabledSelected;
|
|
189
|
+
if (!this.selectAllEnabled) {
|
|
190
|
+
return this.selectedItems.length > 0 && !this.allSelected;
|
|
191
|
+
}
|
|
192
|
+
return !this.allSelected && hasAnySelected;
|
|
181
193
|
}
|
|
182
194
|
get keyboardNavItems() {
|
|
183
195
|
const { selectAllComboboxItemRef } = this;
|
|
@@ -302,7 +314,7 @@ class Combobox extends LitElement {
|
|
|
302
314
|
}
|
|
303
315
|
valueHandler(value) {
|
|
304
316
|
if (!this.internalValueChangeFlag) {
|
|
305
|
-
this.
|
|
317
|
+
this.items.forEach((item) => {
|
|
306
318
|
item.selected = Array.isArray(value) ? value.includes(item.value) : value === item.value;
|
|
307
319
|
});
|
|
308
320
|
this.updateItems();
|
|
@@ -316,6 +328,9 @@ class Combobox extends LitElement {
|
|
|
316
328
|
this.internalValueChangeFlag = true;
|
|
317
329
|
this.value = this.getValue();
|
|
318
330
|
this.internalValueChangeFlag = false;
|
|
331
|
+
if (this.selectionDisplay === "fit" && this.isMulti()) {
|
|
332
|
+
this.refreshSelectionDisplay();
|
|
333
|
+
}
|
|
319
334
|
}
|
|
320
335
|
async documentClickHandler(event) {
|
|
321
336
|
if (this.disabled || event.composedPath().includes(this.el)) {
|
|
@@ -336,7 +351,7 @@ class Combobox extends LitElement {
|
|
|
336
351
|
if (isSelectAllTarget) {
|
|
337
352
|
this.toggleSelectAll();
|
|
338
353
|
}
|
|
339
|
-
if (this.allSelected) {
|
|
354
|
+
if (this.allSelected && (!this.hasDisabledItems || this.hasDisabledSelected)) {
|
|
340
355
|
this.selectedItems.forEach((item) => {
|
|
341
356
|
const chipEl = this.referenceEl.querySelector(`#${IDS.chip(item.guid)}`);
|
|
342
357
|
if (chipEl) {
|
|
@@ -397,8 +412,13 @@ class Combobox extends LitElement {
|
|
|
397
412
|
}
|
|
398
413
|
toggleSelectAll() {
|
|
399
414
|
const toggledValue = !this.allSelected;
|
|
400
|
-
this.
|
|
401
|
-
|
|
415
|
+
this.allItems.forEach((item) => {
|
|
416
|
+
if (item.disabled) {
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
item.selected = toggledValue;
|
|
420
|
+
});
|
|
421
|
+
this.selectedItems = this.getSelectedItems();
|
|
402
422
|
this.emitComboboxChange();
|
|
403
423
|
}
|
|
404
424
|
keyDownHandler(event) {
|
|
@@ -643,7 +663,7 @@ class Combobox extends LitElement {
|
|
|
643
663
|
inputWidth,
|
|
644
664
|
largestSelectedIndicatorChipWidth
|
|
645
665
|
});
|
|
646
|
-
if (this.allSelected && this.selectAllEnabled) {
|
|
666
|
+
if (this.allSelected && this.selectAllEnabled && (!this.hasDisabledItems || this.hasDisabledSelected)) {
|
|
647
667
|
this.selectedItems.forEach((item) => {
|
|
648
668
|
const chipEl = this.referenceEl.querySelector(`#${IDS.chip(item.guid)}`);
|
|
649
669
|
if (chipEl) {
|
|
@@ -700,7 +720,7 @@ class Combobox extends LitElement {
|
|
|
700
720
|
if (newSelectedVisibleChipsCount !== this.selectedVisibleChipsCount) {
|
|
701
721
|
this.selectedVisibleChipsCount = newSelectedVisibleChipsCount;
|
|
702
722
|
}
|
|
703
|
-
const newSelectedHiddenChipsCount = this.getSelectedItems().length - newSelectedVisibleChipsCount;
|
|
723
|
+
const newSelectedHiddenChipsCount = Math.max(0, this.getSelectedItems().length - newSelectedVisibleChipsCount);
|
|
704
724
|
if (newSelectedHiddenChipsCount !== this.selectedHiddenChipsCount) {
|
|
705
725
|
this.selectedHiddenChipsCount = newSelectedHiddenChipsCount;
|
|
706
726
|
}
|
|
@@ -784,7 +804,12 @@ class Combobox extends LitElement {
|
|
|
784
804
|
el.selected = true;
|
|
785
805
|
});
|
|
786
806
|
} else {
|
|
787
|
-
children.forEach((el) =>
|
|
807
|
+
children.forEach((el) => {
|
|
808
|
+
if (el.disabled) {
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
el.selected = false;
|
|
812
|
+
});
|
|
788
813
|
[...ancestors].forEach((el) => {
|
|
789
814
|
if (!hasActiveChildren(el)) {
|
|
790
815
|
el.selected = false;
|
|
@@ -793,7 +818,8 @@ class Combobox extends LitElement {
|
|
|
793
818
|
}
|
|
794
819
|
}
|
|
795
820
|
updateItems() {
|
|
796
|
-
this.
|
|
821
|
+
this.allItems = this.getItems(true);
|
|
822
|
+
this.items = this.allItems.filter((item) => !item.disabled);
|
|
797
823
|
this.groupItems = this.getGroupItems();
|
|
798
824
|
this.data = this.getData();
|
|
799
825
|
this.groupData = this.getGroupData();
|
|
@@ -801,7 +827,7 @@ class Combobox extends LitElement {
|
|
|
801
827
|
this.selectedItems = this.getSelectedItems();
|
|
802
828
|
}
|
|
803
829
|
updateItemProps() {
|
|
804
|
-
this.
|
|
830
|
+
this.allItems.forEach((item) => {
|
|
805
831
|
item.selectionMode = this.selectionMode;
|
|
806
832
|
item.selectionAppearance = this.selectionAppearance;
|
|
807
833
|
item.scale = this.scale;
|
|
@@ -963,40 +989,111 @@ class Combobox extends LitElement {
|
|
|
963
989
|
const value = Array.isArray(this.value) ? this.value.join(", ") : this.value;
|
|
964
990
|
return this.readOnly ? this.messages.nonEditable?.replace("{value}", `${value}`) : value;
|
|
965
991
|
}
|
|
992
|
+
getChipLabel(item, isAncestors) {
|
|
993
|
+
if (!isAncestors) {
|
|
994
|
+
return getLabel(item);
|
|
995
|
+
}
|
|
996
|
+
const ancestors = [...getItemAncestors(item)].reverse();
|
|
997
|
+
return [...ancestors, item].map((el) => getLabel(el)).join(" / ");
|
|
998
|
+
}
|
|
999
|
+
renderChip({ activeChipIndex, disabled, index, item, messages, readOnly, scale, isAncestors }) {
|
|
1000
|
+
const label = this.getChipLabel(item, isAncestors);
|
|
1001
|
+
return keyed(item.guid || item.value || label, html`<calcite-chip .appearance=${readOnly ? "outline" : "solid"} class=${safeClassMap({
|
|
1002
|
+
[CSS.chip]: true,
|
|
1003
|
+
[CSS.disabled]: disabled
|
|
1004
|
+
})} .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>`);
|
|
1005
|
+
}
|
|
1006
|
+
renderChipCount(count, scale) {
|
|
1007
|
+
const label = this.messages.disabledSelectedCount?.replace("{count}", `${count}`) ?? `+${count}`;
|
|
1008
|
+
return html`<calcite-chip appearance=solid class=${safeClassMap({
|
|
1009
|
+
[CSS.chip]: true
|
|
1010
|
+
})} .label=${label} .scale=${scale} tabindex=-1 title=${label ?? nothing}>${label}</calcite-chip>`;
|
|
1011
|
+
}
|
|
966
1012
|
renderChips() {
|
|
967
|
-
const { activeChipIndex, readOnly, scale, selectionMode, messages } = this;
|
|
968
|
-
|
|
1013
|
+
const { activeChipIndex, readOnly, scale, selectionDisplay, selectionMode, messages } = this;
|
|
1014
|
+
const chips = [];
|
|
1015
|
+
const isAncestors = selectionMode === "ancestors";
|
|
1016
|
+
const allSelectedNoDisabled = this.allSelected && !this.hasDisabledItems;
|
|
1017
|
+
const allSelectedWithDisabledSelected = this.allSelected && this.hasDisabledSelected;
|
|
1018
|
+
const disabledItems = this.allItems.filter((item) => item.disabled && item.selected && (!isAncestors || !hasActiveChildren(item)));
|
|
1019
|
+
const preserveOrder = selectionDisplay === "all";
|
|
1020
|
+
if (selectionDisplay === "fit" && (allSelectedNoDisabled || allSelectedWithDisabledSelected) || selectionDisplay === "all" && this.selectAllEnabled && allSelectedWithDisabledSelected || this.selectAllEnabled && this.allSelected && !this.hasDisabledItems) {
|
|
969
1021
|
return null;
|
|
970
1022
|
}
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
1023
|
+
let selectedIndex = 0;
|
|
1024
|
+
let disabledIndex = 0;
|
|
1025
|
+
if (preserveOrder) {
|
|
1026
|
+
this.allItems.forEach((item) => {
|
|
1027
|
+
if (item.disabled) {
|
|
1028
|
+
if (item.selected && (!isAncestors || !hasActiveChildren(item))) {
|
|
1029
|
+
chips.push(this.renderChip({
|
|
1030
|
+
activeChipIndex,
|
|
1031
|
+
disabled: true,
|
|
1032
|
+
index: disabledIndex++,
|
|
1033
|
+
item,
|
|
1034
|
+
messages,
|
|
1035
|
+
readOnly,
|
|
1036
|
+
scale,
|
|
1037
|
+
isAncestors
|
|
1038
|
+
}));
|
|
1039
|
+
}
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
if (!this.selectAllEnabled || !this.allSelected || this.hasDisabledItems) {
|
|
1043
|
+
if (item.selected && (!isAncestors || !hasActiveChildren(item))) {
|
|
1044
|
+
chips.push(this.renderChip({
|
|
1045
|
+
activeChipIndex,
|
|
1046
|
+
disabled: false,
|
|
1047
|
+
index: selectedIndex++,
|
|
1048
|
+
item,
|
|
1049
|
+
messages,
|
|
1050
|
+
readOnly,
|
|
1051
|
+
scale,
|
|
1052
|
+
isAncestors
|
|
1053
|
+
}));
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
});
|
|
1057
|
+
} else if (!this.selectAllEnabled || !this.allSelected || this.hasDisabledItems) {
|
|
1058
|
+
this.selectedItems.forEach((item) => {
|
|
1059
|
+
chips.push(this.renderChip({
|
|
1060
|
+
activeChipIndex,
|
|
1061
|
+
disabled: false,
|
|
1062
|
+
index: selectedIndex++,
|
|
1063
|
+
item,
|
|
1064
|
+
messages,
|
|
1065
|
+
readOnly,
|
|
1066
|
+
scale,
|
|
1067
|
+
isAncestors
|
|
1068
|
+
}));
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1071
|
+
if (selectionDisplay === "fit" && disabledItems.length) {
|
|
1072
|
+
chips.push(this.renderChipCount(disabledItems.length, scale));
|
|
1073
|
+
}
|
|
1074
|
+
return chips.length ? chips : null;
|
|
981
1075
|
}
|
|
982
1076
|
renderAllSelectedIndicatorChip() {
|
|
983
1077
|
const { allSelectedIndicatorChipRef, compactSelectionDisplay, scale, selectedVisibleChipsCount } = this;
|
|
984
1078
|
const label = compactSelectionDisplay ? this.messages.all : this.messages.allSelected;
|
|
1079
|
+
const showAllSelectedChip = this.allSelected && (this.selectionDisplay === "single" || !selectedVisibleChipsCount || this.selectionDisplay === "fit" && this.hasDisabledSelected || this.selectionDisplay === "all" && this.hasDisabledSelected);
|
|
985
1080
|
return html`<calcite-chip class=${safeClassMap({
|
|
986
1081
|
[CSS.chip]: true,
|
|
987
|
-
[CSS.chipInvisible]: !
|
|
1082
|
+
[CSS.chipInvisible]: !showAllSelectedChip,
|
|
988
1083
|
[CSS.allSelected]: true
|
|
989
1084
|
})} .label=${label} .scale=${scale} title=${label ?? nothing} value ${ref(allSelectedIndicatorChipRef)}>${label}</calcite-chip>`;
|
|
990
1085
|
}
|
|
991
1086
|
renderSelectedIndicatorChip() {
|
|
992
|
-
const { compactSelectionDisplay, selectionDisplay,
|
|
1087
|
+
const { compactSelectionDisplay, selectionDisplay, scale, selectedHiddenChipsCount, selectedVisibleChipsCount, selectedIndicatorChipRef } = this;
|
|
1088
|
+
const allSelectedNoDisabled = this.allSelected && !this.hasDisabledItems;
|
|
1089
|
+
const allSelectedWithDisabledSelected = this.allSelected && this.hasDisabledSelected;
|
|
993
1090
|
let chipInvisible;
|
|
994
1091
|
let label;
|
|
995
1092
|
if (compactSelectionDisplay) {
|
|
996
1093
|
chipInvisible = true;
|
|
997
1094
|
} else {
|
|
998
1095
|
if (selectionDisplay === "single") {
|
|
999
|
-
const selectedItemsCount =
|
|
1096
|
+
const selectedItemsCount = this.allItems.filter((item) => item.selected && (this.selectionMode !== "ancestors" || !hasActiveChildren(item))).length;
|
|
1000
1097
|
if (this.allSelected) {
|
|
1001
1098
|
chipInvisible = true;
|
|
1002
1099
|
} else if (selectedItemsCount > 0) {
|
|
@@ -1006,7 +1103,7 @@ class Combobox extends LitElement {
|
|
|
1006
1103
|
}
|
|
1007
1104
|
label = `${selectedItemsCount} ${this.messages.selected}`;
|
|
1008
1105
|
} else if (selectionDisplay === "fit") {
|
|
1009
|
-
chipInvisible = !!(
|
|
1106
|
+
chipInvisible = !!((allSelectedNoDisabled || allSelectedWithDisabledSelected) && selectedVisibleChipsCount === 0 || selectedHiddenChipsCount === 0);
|
|
1010
1107
|
label = selectedVisibleChipsCount > 0 ? `+${selectedHiddenChipsCount}` : `${selectedHiddenChipsCount} ${this.messages.selected}`;
|
|
1011
1108
|
}
|
|
1012
1109
|
}
|
|
@@ -1016,12 +1113,14 @@ class Combobox extends LitElement {
|
|
|
1016
1113
|
})} .label=${label} .scale=${scale} title=${label ?? nothing} value ${ref(selectedIndicatorChipRef)}>${label}</calcite-chip>`;
|
|
1017
1114
|
}
|
|
1018
1115
|
renderSelectedIndicatorChipCompact() {
|
|
1019
|
-
const { compactSelectionDisplay, selectionDisplay,
|
|
1116
|
+
const { compactSelectionDisplay, selectionDisplay, scale, selectedHiddenChipsCount } = this;
|
|
1117
|
+
const allSelectedNoDisabled = this.allSelected && !this.hasDisabledItems;
|
|
1118
|
+
const allSelectedWithDisabledSelected = this.allSelected && this.hasDisabledSelected;
|
|
1020
1119
|
let chipInvisible;
|
|
1021
1120
|
let label;
|
|
1022
1121
|
if (compactSelectionDisplay) {
|
|
1023
|
-
const selectedItemsCount =
|
|
1024
|
-
if (this.allSelected) {
|
|
1122
|
+
const selectedItemsCount = this.allItems.filter((item) => item.selected && (this.selectionMode !== "ancestors" || !hasActiveChildren(item))).length;
|
|
1123
|
+
if (allSelectedNoDisabled || allSelectedWithDisabledSelected || selectionDisplay === "single" && this.allSelected) {
|
|
1025
1124
|
chipInvisible = true;
|
|
1026
1125
|
} else if (selectionDisplay === "fit") {
|
|
1027
1126
|
chipInvisible = !(selectedHiddenChipsCount > 0);
|
|
@@ -1109,6 +1208,7 @@ class Combobox extends LitElement {
|
|
|
1109
1208
|
const singleSelectionDisplay = selectionDisplay === "single";
|
|
1110
1209
|
const fitSelectionDisplay = !singleSelectionMode && selectionDisplay === "fit";
|
|
1111
1210
|
const isClearable = !this.clearDisabled && this.selectionMode !== "single-persist" && !!this.value?.length;
|
|
1211
|
+
const hasDisabledItems = this.hasDisabledItems;
|
|
1112
1212
|
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({
|
|
1113
1213
|
[CSS.wrapper]: true,
|
|
1114
1214
|
[CSS.wrapperSingle]: singleSelectionMode || !this.selectedItems.length,
|
|
@@ -1117,7 +1217,7 @@ class Combobox extends LitElement {
|
|
|
1117
1217
|
[CSS.gridInput]: true,
|
|
1118
1218
|
[CSS.selectionDisplayFit]: fitSelectionDisplay,
|
|
1119
1219
|
[CSS.selectionDisplaySingle]: singleSelectionDisplay
|
|
1120
|
-
})} ${ref(this.setChipContainerEl)}>${!singleSelectionMode && !singleSelectionDisplay && this.renderChips() || ""}${!singleSelectionMode && !singleSelectionDisplay && this.selectAllEnabled && this.renderAllSelectedIndicatorChip() || ""}${!singleSelectionMode && !allSelectionDisplay && [
|
|
1220
|
+
})} ${ref(this.setChipContainerEl)}>${!singleSelectionMode && !singleSelectionDisplay && this.renderChips() || ""}${!singleSelectionMode && !singleSelectionDisplay && this.selectAllEnabled && allSelectionDisplay && (!hasDisabledItems || this.hasDisabledSelected) && this.renderAllSelectedIndicatorChip() || ""}${!singleSelectionMode && !allSelectionDisplay && [
|
|
1121
1221
|
this.renderSelectedIndicatorChip(),
|
|
1122
1222
|
this.renderSelectedIndicatorChipCompact(),
|
|
1123
1223
|
this.renderAllSelectedIndicatorChip()
|