@esri/calcite-components 5.1.0-next.25 → 5.1.0-next.27
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/{VXSL3ABN.js → 2DHM2AXA.js} +1 -1
- package/dist/cdn/{5AAKQUGR.js → 2GKBBM7Q.js} +1 -1
- package/dist/cdn/{RTOHMI5T.js → 2HB7KOBP.js} +1 -1
- package/dist/cdn/{H3SXJY5G.js → 2HIJ2TKK.js} +1 -1
- package/dist/cdn/{CQWCAFVA.js → 2ULDBE64.js} +1 -1
- package/dist/cdn/2WFS3POS.js +2 -0
- package/dist/cdn/{V7AE4QVT.js → 2YLO3Z4A.js} +1 -1
- package/dist/cdn/{6WY3IAXV.js → 34VGNW3O.js} +1 -1
- package/dist/cdn/{27U37MLJ.js → 37DOLJ2M.js} +1 -1
- package/dist/cdn/{PLBFOPEP.js → 3GGV4N3M.js} +1 -1
- package/dist/cdn/{LF73E7K2.js → 3VLZZDOB.js} +1 -1
- package/dist/cdn/{TQTCPELB.js → 472WFEW2.js} +1 -1
- package/dist/cdn/{A75HLUMG.js → 4LMKMVAS.js} +1 -1
- package/dist/cdn/{577BFHQJ.js → 4TSSRGCA.js} +1 -1
- package/dist/cdn/{NMU35ESN.js → 535HZX2R.js} +1 -1
- package/dist/cdn/{5P6Y44BI.js → 54PL5YYE.js} +1 -1
- package/dist/cdn/{LZ64DG4B.js → 5E5L2Y3U.js} +1 -1
- package/dist/cdn/{NJYUPJQW.js → 5GNMO3F5.js} +1 -1
- package/dist/cdn/{UFYSR4SD.js → 5JO6WSQD.js} +1 -1
- package/dist/cdn/{CPPQU2JT.js → 5OTQBJDU.js} +1 -1
- package/dist/cdn/{YNX3P2QU.js → 62N5UZMU.js} +1 -1
- package/dist/cdn/{USEKAAH6.js → 63LQ3N2L.js} +1 -1
- package/dist/cdn/{V7W7KW6Z.js → 65MGRH7E.js} +1 -1
- package/dist/cdn/{HFCHUSF7.js → 6DNE3XJM.js} +1 -1
- package/dist/cdn/{CZ2SSTBU.js → 6EODEWKH.js} +1 -1
- package/dist/cdn/{SJJYYNDU.js → 6KOREZVO.js} +1 -1
- package/dist/cdn/{PYI2DQHX.js → 6R6JIMH7.js} +1 -1
- package/dist/cdn/{QJRRZDAQ.js → 6V5DMSM2.js} +1 -1
- package/dist/cdn/{KBKEPXPT.js → 6XSDKI2N.js} +1 -1
- package/dist/cdn/{3NP3FX5G.js → 72U2CFXQ.js} +1 -1
- package/dist/cdn/{X6VC7UA2.js → 75BCQ3LD.js} +1 -1
- package/dist/cdn/{XYWLBGJE.js → 7IKOVEYM.js} +1 -1
- package/dist/cdn/{WFIL5VUG.js → 7IRIGYHH.js} +1 -1
- package/dist/cdn/{4AFV2RDV.js → 7KQ3RZM7.js} +1 -1
- package/dist/cdn/{5IEEZRVX.js → 7URVEN3S.js} +1 -1
- package/dist/cdn/{25Y7MBNX.js → A4EVSHBV.js} +1 -1
- package/dist/cdn/{UNXBOQC4.js → A5TNVJG6.js} +1 -1
- package/dist/cdn/{PUCSPFSE.js → A6UIXWA4.js} +1 -1
- package/dist/cdn/AE2F4BUK.js +2 -0
- package/dist/cdn/{KTGTAI63.js → ASLYOLBT.js} +1 -1
- package/dist/cdn/{WEBKTCHR.js → ATU3KAMI.js} +1 -1
- package/dist/cdn/AUAQWL4A.js +2 -0
- package/dist/cdn/{T5BNZ27P.js → AYYC7TQI.js} +1 -1
- package/dist/cdn/{FRZSW2QQ.js → BBABEQAO.js} +1 -1
- package/dist/cdn/{QWHNQJ3U.js → BOSTYDGV.js} +1 -1
- package/dist/cdn/{J5O7CVDX.js → CA3ULZR2.js} +1 -1
- package/dist/cdn/{K4GUJREQ.js → CAEHJMTO.js} +1 -1
- package/dist/cdn/{OR66TG26.js → CMCOQ2ZQ.js} +1 -1
- package/dist/cdn/{EHIAXJAL.js → DCWL5FUH.js} +1 -1
- package/dist/cdn/{3BXVECSN.js → DGHSYXZ2.js} +1 -1
- package/dist/cdn/{G2PYJN42.js → DSVF3SUP.js} +1 -1
- package/dist/cdn/DZQNDNRL.js +2 -0
- package/dist/cdn/{RYA4YDJB.js → EGS6U2LM.js} +1 -1
- package/dist/cdn/{V2VWVKOI.js → EJL6F2Z5.js} +1 -1
- package/dist/cdn/{WDAT575U.js → EW664ACU.js} +1 -1
- package/dist/cdn/{TJY5G272.js → EXJYOXYB.js} +1 -1
- package/dist/cdn/{ZW4Z3M67.js → FAR73AUB.js} +1 -1
- package/dist/cdn/{NJ5EIGGU.js → FMVAQBXX.js} +1 -1
- package/dist/cdn/{7PN6GY3K.js → FUW4XX3M.js} +1 -1
- package/dist/cdn/{WRUQJTTU.js → FXVVCB4J.js} +1 -1
- package/dist/cdn/{NLKSDE46.js → GLDDZIVB.js} +1 -1
- package/dist/cdn/{XJ43C7FS.js → GPLPESRJ.js} +1 -1
- package/dist/cdn/{FRQDF7EU.js → H3U2HAMG.js} +1 -1
- package/dist/cdn/{35B6PRMK.js → HEVPYY2V.js} +1 -1
- package/dist/cdn/{IR3ORN34.js → HHXKVWKF.js} +1 -1
- package/dist/cdn/{DBESGPPF.js → HJHCTNLQ.js} +1 -1
- package/dist/cdn/{BKNFQ6RA.js → HNX5XQV2.js} +1 -1
- package/dist/cdn/{XHHLBCKY.js → I3AADXFM.js} +1 -1
- package/dist/cdn/{XC246WT5.js → IGCKKA2J.js} +1 -1
- package/dist/cdn/{7QJOA44W.js → IPY6VPUR.js} +1 -1
- package/dist/cdn/{SYPGTFWL.js → J33LV53D.js} +1 -1
- package/dist/cdn/{MWK7IIV3.js → J65GFHTP.js} +1 -1
- package/dist/cdn/{NJDJIG2C.js → JESVG6N3.js} +1 -1
- package/dist/cdn/{7Y4MKWU4.js → JYWTNXTR.js} +1 -1
- package/dist/cdn/{PS6F5KSO.js → K3G2WW5H.js} +1 -1
- package/dist/cdn/{ETP5IHZB.js → KAYQ6NVM.js} +1 -1
- package/dist/cdn/{UBGOLRVO.js → KKJF2A4I.js} +1 -1
- package/dist/cdn/{HNNL7IUM.js → KQ3QKB3J.js} +1 -1
- package/dist/cdn/{WPOYI7P3.js → KR37VVWJ.js} +1 -1
- package/dist/cdn/{RINCAIWE.js → L2QH3NOK.js} +1 -1
- package/dist/cdn/{AHBLLAP4.js → L5DQE5BE.js} +1 -1
- package/dist/cdn/{LZSNPBAN.js → LF6RR4P6.js} +1 -1
- package/dist/cdn/{5LB4QUHD.js → LI6VB7Z4.js} +1 -1
- package/dist/cdn/{67337RAS.js → M74RGHFF.js} +1 -1
- package/dist/cdn/{W4SY6HSR.js → M7JUD3UL.js} +1 -1
- package/dist/cdn/{3HAUWY4Q.js → MA7DHKWF.js} +1 -1
- package/dist/cdn/{G4Y3MFJY.js → MBMA3BC2.js} +1 -1
- package/dist/cdn/{PX46XX3S.js → MH6TPLXN.js} +1 -1
- package/dist/cdn/{3GV45XL7.js → MYDCGCGV.js} +1 -1
- package/dist/cdn/NIYU7VI2.js +2 -0
- package/dist/cdn/{GPERYR4P.js → NM5OHTOQ.js} +1 -1
- package/dist/cdn/{XTFX7SON.js → NRHYZ6VT.js} +1 -1
- package/dist/cdn/{IHMX6KWN.js → O5TFES37.js} +1 -1
- package/dist/cdn/{4DU3OLQM.js → O5WYTBAC.js} +1 -1
- package/dist/cdn/{HOUKB4AY.js → OARZXAME.js} +1 -1
- package/dist/cdn/{4H3E7NF7.js → OB6367SJ.js} +1 -1
- package/dist/cdn/{DVAPKNWQ.js → OJ43R3W5.js} +1 -1
- package/dist/cdn/{FIQ3J5SW.js → OZNJ3QF7.js} +1 -1
- package/dist/cdn/{E5HFZKEM.js → PBAB3HRR.js} +1 -1
- package/dist/cdn/{DRFU5YEH.js → PEKJ55HR.js} +1 -1
- package/dist/cdn/{7YDSLCQ7.js → QMBMILIO.js} +1 -1
- package/dist/cdn/{AVSZOCPG.js → QRYPA4IV.js} +1 -1
- package/dist/cdn/{D6PGZUKV.js → QSKYLKVG.js} +1 -1
- package/dist/cdn/{HW3LISFQ.js → R3G44EXT.js} +1 -1
- package/dist/cdn/{GWTFOVIM.js → R4MDFTLA.js} +1 -1
- package/dist/cdn/{CC3VIJ62.js → RAFI6A4X.js} +1 -1
- package/dist/cdn/{4ZMOC4CA.js → REBQK6OW.js} +1 -1
- package/dist/cdn/{YUTLGO5O.js → RH7VDBAU.js} +1 -1
- package/dist/cdn/{T34YET4S.js → RIDZUBJV.js} +1 -1
- package/dist/cdn/{Z7B56FPG.js → RLGEEUUF.js} +1 -1
- package/dist/cdn/{7YOIWELC.js → RZ4GWURO.js} +1 -1
- package/dist/cdn/{ZIAI6P6F.js → S2QAJ6UR.js} +1 -1
- package/dist/cdn/{6MTDJPI4.js → SMPCLTYK.js} +1 -1
- package/dist/cdn/{ACEIJ36E.js → T27R25B3.js} +1 -1
- package/dist/cdn/{KRNJK2SE.js → T4YCPPXN.js} +1 -1
- package/dist/cdn/{ECJOMBVP.js → T7KI335M.js} +1 -1
- package/dist/cdn/TGNFTCWX.js +2 -0
- package/dist/cdn/{5KJHD3XL.js → TRH4ZJKL.js} +1 -1
- package/dist/cdn/{4WCAWC2W.js → TX2ZCNO3.js} +1 -1
- package/dist/cdn/{ZKJ3XVJ4.js → U3CDEKCV.js} +1 -1
- package/dist/cdn/{IPDJIOSM.js → UBOEFTP3.js} +1 -1
- package/dist/cdn/{Z2ORUZGB.js → UL2LROO7.js} +1 -1
- package/dist/cdn/{YEL53KZI.js → UM2MFHK5.js} +1 -1
- package/dist/cdn/{IDQKV7W4.js → USE5GH2O.js} +1 -1
- package/dist/cdn/{XGNORHI6.js → UTJXHCBA.js} +1 -1
- package/dist/cdn/{QL5VWWKQ.js → UV2FZ7AS.js} +1 -1
- package/dist/cdn/{6IYXEF5Q.js → UVNB2GNS.js} +1 -1
- package/dist/cdn/{43ILV2UA.js → UVX4FZFF.js} +1 -1
- package/dist/cdn/{OMXJRVXR.js → UYVL7EZJ.js} +1 -1
- package/dist/cdn/{TZFYJMOS.js → VCIM3T4Q.js} +1 -1
- package/dist/cdn/{EEB5YOG6.js → VH4YUC3H.js} +1 -1
- package/dist/cdn/{PPITNY7V.js → VPK3K5DJ.js} +1 -1
- package/dist/cdn/{TWE5YMJV.js → VQZQG7W6.js} +1 -1
- package/dist/cdn/{EUJPGQH5.js → VSMV7HZ7.js} +1 -1
- package/dist/cdn/{7OPX2QTM.js → WM6RPT5D.js} +1 -1
- package/dist/cdn/{2WTHD37G.js → WRQWMRHR.js} +1 -1
- package/dist/cdn/{A7LUSEVG.js → WSEJYHVG.js} +1 -1
- package/dist/cdn/{XOOKV5M5.js → X2YX7QA7.js} +1 -1
- package/dist/cdn/{I7D6CNIT.js → XDR673RG.js} +1 -1
- package/dist/cdn/{TYJTHC4B.js → XRVLOAEF.js} +1 -1
- package/dist/cdn/{DSDZWWPD.js → XTSWGDOV.js} +1 -1
- package/dist/cdn/{EKX7UIUS.js → Y74RG63Y.js} +1 -1
- package/dist/cdn/YKCXM6YK.js +2 -0
- package/dist/cdn/{QFZZIOMD.js → YYVB3KET.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/Heading.js +3 -3
- package/dist/chunks/dom.js +4 -3
- package/dist/chunks/resources5.js +2 -1
- package/dist/chunks/resources6.js +2 -0
- package/dist/chunks/runtime.js +4 -4
- package/dist/components/calcite-combobox/customElement.js +133 -33
- package/dist/components/calcite-dialog/customElement.d.ts +2 -0
- package/dist/components/calcite-dialog/customElement.js +3 -1
- package/dist/components/calcite-flow-item/customElement.d.ts +2 -0
- package/dist/components/calcite-flow-item/customElement.js +3 -1
- package/dist/components/calcite-panel/customElement.d.ts +2 -0
- package/dist/components/calcite-panel/customElement.js +20 -8
- package/dist/components/calcite-sheet/customElement.js +1 -1
- package/dist/components/calcite-swatch/customElement.d.ts +1 -1
- package/dist/components/calcite-tab-nav/customElement.js +1 -1
- package/dist/components/calcite-tabs/customElement.js +1 -1
- package/dist/components/calcite-tree-item/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +2 -2
- package/dist/cdn/3FTNGX3W.js +0 -2
- package/dist/cdn/ARPOHR4M.js +0 -2
- package/dist/cdn/DYKZAL43.js +0 -2
- package/dist/cdn/JP7WZFLP.js +0 -2
- package/dist/cdn/LZFMVYHL.js +0 -2
- package/dist/cdn/MLOCEBTE.js +0 -2
- package/dist/cdn/YTZXSPVU.js +0 -2
|
@@ -37,7 +37,7 @@ const XButton = ({ disabled, focusable, key, label, onClick, ref: ref$1, round =
|
|
|
37
37
|
[CSS.button]: true,
|
|
38
38
|
[CSS.buttonRound]: round
|
|
39
39
|
})} .disabled=${disabled} @click=${onClick} .tabIndex=${focusable ? 0 : -1} title=${title ?? nothing} type=button ${ref(ref$1)}><calcite-icon icon=x .scale=${getIconScale(scale)}></calcite-icon></button>`);
|
|
40
|
-
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-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=s]) .x-button{margin-inline:.5rem}: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-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=m]) .x-button{margin-inline-end:.75rem}: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-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}:host([scale=l]) .x-button{margin-inline-end:1rem}.x-button{align-self:center}.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);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);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}}@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}.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}.x-button{transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;border-style:none;cursor:pointer;outline-color:transparent;align-items:center;margin:0;background-color:var(--calcite-close-background-color, var(--calcite-color-foreground-2));-webkit-appearance:none;display:flex;align-content:center;justify-content:center;color:var(--calcite-close-icon-color, var(--calcite-color-text-3));block-size:var(--calcite-internal-close-size, 1.5rem);inline-size:var(--calcite-internal-close-size, 1.5rem);min-block-size:var(--calcite-internal-close-size, 1.5rem);min-inline-size:var(--calcite-internal-close-size, 1.5rem);padding:0}.x-button:hover,.x-button:focus{background-color:var(--calcite-close-background-color-hover, var(--calcite-color-foreground-3))}.x-button:focus{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))))}.x-button:active{background-color:var(--calcite-close-background-color-press, var(--calcite-color-transparent-press))}.x-button calcite-icon{color:inherit}.x-button--round{border-radius:9999px}.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))}`;
|
|
40
|
+
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-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=s]) .x-button{margin-inline:.5rem}: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-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=m]) .x-button{margin-inline-end:.75rem}: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-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}:host([scale=l]) .x-button{margin-inline-end:1rem}.x-button{align-self:center}.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);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);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}}@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}.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}.x-button{transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;border-style:none;cursor:pointer;outline-color:transparent;align-items:center;margin:0;background-color:var(--calcite-close-background-color, var(--calcite-color-foreground-2));-webkit-appearance:none;display:flex;align-content:center;justify-content:center;color:var(--calcite-close-icon-color, var(--calcite-color-text-3));block-size:var(--calcite-internal-close-size, 1.5rem);inline-size:var(--calcite-internal-close-size, 1.5rem);min-block-size:var(--calcite-internal-close-size, 1.5rem);min-inline-size:var(--calcite-internal-close-size, 1.5rem);padding:0}.x-button:hover,.x-button:focus{background-color:var(--calcite-close-background-color-hover, var(--calcite-color-foreground-3))}.x-button:focus{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))))}.x-button:active{background-color:var(--calcite-close-background-color-press, var(--calcite-color-transparent-press))}.x-button calcite-icon{color:inherit}.x-button--round{border-radius:9999px}.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))}`;
|
|
41
41
|
class Combobox extends LitElement {
|
|
42
42
|
constructor() {
|
|
43
43
|
super();
|
|
@@ -130,6 +130,7 @@ class Combobox extends LitElement {
|
|
|
130
130
|
this.compactSelectionDisplay = false;
|
|
131
131
|
this.selectedHiddenChipsCount = 0;
|
|
132
132
|
this.selectedVisibleChipsCount = 0;
|
|
133
|
+
this.allItems = [];
|
|
133
134
|
this.items = [];
|
|
134
135
|
this.clearDisabled = false;
|
|
135
136
|
this.disabled = false;
|
|
@@ -173,7 +174,7 @@ class Combobox extends LitElement {
|
|
|
173
174
|
this.listen("click", this.comboboxFocusHandler);
|
|
174
175
|
}
|
|
175
176
|
static {
|
|
176
|
-
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: [0, {}, { attribute: false }], value: 1 };
|
|
177
|
+
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: [0, {}, { attribute: false }], value: 1 };
|
|
177
178
|
}
|
|
178
179
|
static {
|
|
179
180
|
this.formAssociated = true;
|
|
@@ -195,10 +196,21 @@ class Combobox extends LitElement {
|
|
|
195
196
|
return !open && selectedItem ? !!selectedIcon && singleSelectionMode : !!placeholderIcon && (!selectedItem || singleSelectionMode);
|
|
196
197
|
}
|
|
197
198
|
get allSelected() {
|
|
198
|
-
|
|
199
|
+
const enabledItems = this.allItems.filter((item) => !item.disabled);
|
|
200
|
+
return enabledItems.length > 0 && enabledItems.every((item) => item.selected);
|
|
201
|
+
}
|
|
202
|
+
get hasDisabledItems() {
|
|
203
|
+
return this.allItems.some((item) => item.disabled);
|
|
204
|
+
}
|
|
205
|
+
get hasDisabledSelected() {
|
|
206
|
+
return this.allItems.some((item) => item.disabled && item.selected);
|
|
199
207
|
}
|
|
200
208
|
get indeterminate() {
|
|
201
|
-
|
|
209
|
+
const hasAnySelected = this.selectedItems.length > 0 || this.hasDisabledSelected;
|
|
210
|
+
if (!this.selectAllEnabled) {
|
|
211
|
+
return this.selectedItems.length > 0 && !this.allSelected;
|
|
212
|
+
}
|
|
213
|
+
return !this.allSelected && hasAnySelected;
|
|
202
214
|
}
|
|
203
215
|
get keyboardNavItems() {
|
|
204
216
|
const { selectAllComboboxItemRef } = this;
|
|
@@ -323,7 +335,7 @@ class Combobox extends LitElement {
|
|
|
323
335
|
}
|
|
324
336
|
valueHandler(value) {
|
|
325
337
|
if (!this.internalValueChangeFlag) {
|
|
326
|
-
this.
|
|
338
|
+
this.items.forEach((item) => {
|
|
327
339
|
item.selected = Array.isArray(value) ? value.includes(item.value) : value === item.value;
|
|
328
340
|
});
|
|
329
341
|
this.updateItems();
|
|
@@ -337,6 +349,9 @@ class Combobox extends LitElement {
|
|
|
337
349
|
this.internalValueChangeFlag = true;
|
|
338
350
|
this.value = this.getValue();
|
|
339
351
|
this.internalValueChangeFlag = false;
|
|
352
|
+
if (this.selectionDisplay === "fit" && this.isMulti()) {
|
|
353
|
+
this.refreshSelectionDisplay();
|
|
354
|
+
}
|
|
340
355
|
}
|
|
341
356
|
async documentClickHandler(event) {
|
|
342
357
|
if (this.disabled || event.composedPath().includes(this.el)) {
|
|
@@ -357,7 +372,7 @@ class Combobox extends LitElement {
|
|
|
357
372
|
if (isSelectAllTarget) {
|
|
358
373
|
this.toggleSelectAll();
|
|
359
374
|
}
|
|
360
|
-
if (this.allSelected) {
|
|
375
|
+
if (this.allSelected && (!this.hasDisabledItems || this.hasDisabledSelected)) {
|
|
361
376
|
this.selectedItems.forEach((item) => {
|
|
362
377
|
const chipEl = this.referenceEl.querySelector(`#${IDS.chip(item.guid)}`);
|
|
363
378
|
if (chipEl) {
|
|
@@ -418,8 +433,13 @@ class Combobox extends LitElement {
|
|
|
418
433
|
}
|
|
419
434
|
toggleSelectAll() {
|
|
420
435
|
const toggledValue = !this.allSelected;
|
|
421
|
-
this.
|
|
422
|
-
|
|
436
|
+
this.allItems.forEach((item) => {
|
|
437
|
+
if (item.disabled) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
item.selected = toggledValue;
|
|
441
|
+
});
|
|
442
|
+
this.selectedItems = this.getSelectedItems();
|
|
423
443
|
this.emitComboboxChange();
|
|
424
444
|
}
|
|
425
445
|
keyDownHandler(event) {
|
|
@@ -655,7 +675,7 @@ class Combobox extends LitElement {
|
|
|
655
675
|
inputWidth,
|
|
656
676
|
largestSelectedIndicatorChipWidth
|
|
657
677
|
});
|
|
658
|
-
if (this.allSelected && this.selectAllEnabled) {
|
|
678
|
+
if (this.allSelected && this.selectAllEnabled && (!this.hasDisabledItems || this.hasDisabledSelected)) {
|
|
659
679
|
this.selectedItems.forEach((item) => {
|
|
660
680
|
const chipEl = this.referenceEl.querySelector(`#${IDS.chip(item.guid)}`);
|
|
661
681
|
if (chipEl) {
|
|
@@ -712,7 +732,7 @@ class Combobox extends LitElement {
|
|
|
712
732
|
if (newSelectedVisibleChipsCount !== this.selectedVisibleChipsCount) {
|
|
713
733
|
this.selectedVisibleChipsCount = newSelectedVisibleChipsCount;
|
|
714
734
|
}
|
|
715
|
-
const newSelectedHiddenChipsCount = this.getSelectedItems().length - newSelectedVisibleChipsCount;
|
|
735
|
+
const newSelectedHiddenChipsCount = Math.max(0, this.getSelectedItems().length - newSelectedVisibleChipsCount);
|
|
716
736
|
if (newSelectedHiddenChipsCount !== this.selectedHiddenChipsCount) {
|
|
717
737
|
this.selectedHiddenChipsCount = newSelectedHiddenChipsCount;
|
|
718
738
|
}
|
|
@@ -796,7 +816,12 @@ class Combobox extends LitElement {
|
|
|
796
816
|
el.selected = true;
|
|
797
817
|
});
|
|
798
818
|
} else {
|
|
799
|
-
children.forEach((el) =>
|
|
819
|
+
children.forEach((el) => {
|
|
820
|
+
if (el.disabled) {
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
el.selected = false;
|
|
824
|
+
});
|
|
800
825
|
[...ancestors].forEach((el) => {
|
|
801
826
|
if (!hasActiveChildren(el)) {
|
|
802
827
|
el.selected = false;
|
|
@@ -805,7 +830,8 @@ class Combobox extends LitElement {
|
|
|
805
830
|
}
|
|
806
831
|
}
|
|
807
832
|
updateItems() {
|
|
808
|
-
this.
|
|
833
|
+
this.allItems = this.getItems(true);
|
|
834
|
+
this.items = this.allItems.filter((item) => !item.disabled);
|
|
809
835
|
this.groupItems = this.getGroupItems();
|
|
810
836
|
this.data = this.getData();
|
|
811
837
|
this.groupData = this.getGroupData();
|
|
@@ -813,7 +839,7 @@ class Combobox extends LitElement {
|
|
|
813
839
|
this.selectedItems = this.getSelectedItems();
|
|
814
840
|
}
|
|
815
841
|
updateItemProps() {
|
|
816
|
-
this.
|
|
842
|
+
this.allItems.forEach((item) => {
|
|
817
843
|
item.selectionMode = this.selectionMode;
|
|
818
844
|
item.selectionAppearance = this.selectionAppearance;
|
|
819
845
|
item.scale = this.scale;
|
|
@@ -975,40 +1001,111 @@ class Combobox extends LitElement {
|
|
|
975
1001
|
const value = Array.isArray(this.value) ? this.value.join(", ") : this.value;
|
|
976
1002
|
return this.readOnly ? this.messages.nonEditable?.replace("{value}", `${value}`) : value;
|
|
977
1003
|
}
|
|
1004
|
+
getChipLabel(item, isAncestors) {
|
|
1005
|
+
if (!isAncestors) {
|
|
1006
|
+
return getLabel(item);
|
|
1007
|
+
}
|
|
1008
|
+
const ancestors = [...getItemAncestors(item)].reverse();
|
|
1009
|
+
return [...ancestors, item].map((el) => getLabel(el)).join(" / ");
|
|
1010
|
+
}
|
|
1011
|
+
renderChip({ activeChipIndex, disabled, index, item, messages, readOnly, scale, isAncestors }) {
|
|
1012
|
+
const label = this.getChipLabel(item, isAncestors);
|
|
1013
|
+
return keyed(item.guid || item.value || label, html`<calcite-chip .appearance=${readOnly ? "outline" : "solid"} class=${safeClassMap({
|
|
1014
|
+
[CSS$1.chip]: true,
|
|
1015
|
+
[CSS$1.disabled]: disabled
|
|
1016
|
+
})} .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} @focusin=${!disabled ? () => this.activeChipIndex = index : null} @calciteChipClose=${!disabled ? () => this.calciteChipCloseHandler(item) : null} .scale=${scale} .selected=${item.selected} .tabIndex=${!disabled && activeChipIndex === index ? 0 : -1} title=${label ?? nothing} .value=${item.value}>${label}</calcite-chip>`);
|
|
1017
|
+
}
|
|
1018
|
+
renderChipCount(count, scale) {
|
|
1019
|
+
const label = this.messages.disabledSelectedCount?.replace("{count}", `${count}`) ?? `+${count}`;
|
|
1020
|
+
return html`<calcite-chip appearance=solid class=${safeClassMap({
|
|
1021
|
+
[CSS$1.chip]: true
|
|
1022
|
+
})} .label=${label} .scale=${scale} tabindex=-1 title=${label ?? nothing}>${label}</calcite-chip>`;
|
|
1023
|
+
}
|
|
978
1024
|
renderChips() {
|
|
979
|
-
const { activeChipIndex, readOnly, scale, selectionMode, messages } = this;
|
|
980
|
-
|
|
1025
|
+
const { activeChipIndex, readOnly, scale, selectionDisplay, selectionMode, messages } = this;
|
|
1026
|
+
const chips = [];
|
|
1027
|
+
const isAncestors = selectionMode === "ancestors";
|
|
1028
|
+
const allSelectedNoDisabled = this.allSelected && !this.hasDisabledItems;
|
|
1029
|
+
const allSelectedWithDisabledSelected = this.allSelected && this.hasDisabledSelected;
|
|
1030
|
+
const disabledItems = this.allItems.filter((item) => item.disabled && item.selected && (!isAncestors || !hasActiveChildren(item)));
|
|
1031
|
+
const preserveOrder = selectionDisplay === "all";
|
|
1032
|
+
if (selectionDisplay === "fit" && (allSelectedNoDisabled || allSelectedWithDisabledSelected) || selectionDisplay === "all" && this.selectAllEnabled && allSelectedWithDisabledSelected || this.selectAllEnabled && this.allSelected && !this.hasDisabledItems) {
|
|
981
1033
|
return null;
|
|
982
1034
|
}
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1035
|
+
let selectedIndex = 0;
|
|
1036
|
+
let disabledIndex = 0;
|
|
1037
|
+
if (preserveOrder) {
|
|
1038
|
+
this.allItems.forEach((item) => {
|
|
1039
|
+
if (item.disabled) {
|
|
1040
|
+
if (item.selected && (!isAncestors || !hasActiveChildren(item))) {
|
|
1041
|
+
chips.push(this.renderChip({
|
|
1042
|
+
activeChipIndex,
|
|
1043
|
+
disabled: true,
|
|
1044
|
+
index: disabledIndex++,
|
|
1045
|
+
item,
|
|
1046
|
+
messages,
|
|
1047
|
+
readOnly,
|
|
1048
|
+
scale,
|
|
1049
|
+
isAncestors
|
|
1050
|
+
}));
|
|
1051
|
+
}
|
|
1052
|
+
return;
|
|
1053
|
+
}
|
|
1054
|
+
if (!this.selectAllEnabled || !this.allSelected || this.hasDisabledItems) {
|
|
1055
|
+
if (item.selected && (!isAncestors || !hasActiveChildren(item))) {
|
|
1056
|
+
chips.push(this.renderChip({
|
|
1057
|
+
activeChipIndex,
|
|
1058
|
+
disabled: false,
|
|
1059
|
+
index: selectedIndex++,
|
|
1060
|
+
item,
|
|
1061
|
+
messages,
|
|
1062
|
+
readOnly,
|
|
1063
|
+
scale,
|
|
1064
|
+
isAncestors
|
|
1065
|
+
}));
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
});
|
|
1069
|
+
} else if (!this.selectAllEnabled || !this.allSelected || this.hasDisabledItems) {
|
|
1070
|
+
this.selectedItems.forEach((item) => {
|
|
1071
|
+
chips.push(this.renderChip({
|
|
1072
|
+
activeChipIndex,
|
|
1073
|
+
disabled: false,
|
|
1074
|
+
index: selectedIndex++,
|
|
1075
|
+
item,
|
|
1076
|
+
messages,
|
|
1077
|
+
readOnly,
|
|
1078
|
+
scale,
|
|
1079
|
+
isAncestors
|
|
1080
|
+
}));
|
|
1081
|
+
});
|
|
1082
|
+
}
|
|
1083
|
+
if (selectionDisplay === "fit" && disabledItems.length) {
|
|
1084
|
+
chips.push(this.renderChipCount(disabledItems.length, scale));
|
|
1085
|
+
}
|
|
1086
|
+
return chips.length ? chips : null;
|
|
993
1087
|
}
|
|
994
1088
|
renderAllSelectedIndicatorChip() {
|
|
995
1089
|
const { allSelectedIndicatorChipRef, compactSelectionDisplay, scale, selectedVisibleChipsCount } = this;
|
|
996
1090
|
const label = compactSelectionDisplay ? this.messages.all : this.messages.allSelected;
|
|
1091
|
+
const showAllSelectedChip = this.allSelected && (this.selectionDisplay === "single" || !selectedVisibleChipsCount || this.selectionDisplay === "fit" && this.hasDisabledSelected || this.selectionDisplay === "all" && this.hasDisabledSelected);
|
|
997
1092
|
return html`<calcite-chip class=${safeClassMap({
|
|
998
1093
|
[CSS$1.chip]: true,
|
|
999
|
-
[CSS$1.chipInvisible]: !
|
|
1094
|
+
[CSS$1.chipInvisible]: !showAllSelectedChip,
|
|
1000
1095
|
[CSS$1.allSelected]: true
|
|
1001
1096
|
})} .label=${label} .scale=${scale} title=${label ?? nothing} value ${ref(allSelectedIndicatorChipRef)}>${label}</calcite-chip>`;
|
|
1002
1097
|
}
|
|
1003
1098
|
renderSelectedIndicatorChip() {
|
|
1004
|
-
const { compactSelectionDisplay, selectionDisplay,
|
|
1099
|
+
const { compactSelectionDisplay, selectionDisplay, scale, selectedHiddenChipsCount, selectedVisibleChipsCount, selectedIndicatorChipRef } = this;
|
|
1100
|
+
const allSelectedNoDisabled = this.allSelected && !this.hasDisabledItems;
|
|
1101
|
+
const allSelectedWithDisabledSelected = this.allSelected && this.hasDisabledSelected;
|
|
1005
1102
|
let chipInvisible;
|
|
1006
1103
|
let label;
|
|
1007
1104
|
if (compactSelectionDisplay) {
|
|
1008
1105
|
chipInvisible = true;
|
|
1009
1106
|
} else {
|
|
1010
1107
|
if (selectionDisplay === "single") {
|
|
1011
|
-
const selectedItemsCount =
|
|
1108
|
+
const selectedItemsCount = this.allItems.filter((item) => item.selected && (this.selectionMode !== "ancestors" || !hasActiveChildren(item))).length;
|
|
1012
1109
|
if (this.allSelected) {
|
|
1013
1110
|
chipInvisible = true;
|
|
1014
1111
|
} else if (selectedItemsCount > 0) {
|
|
@@ -1018,7 +1115,7 @@ class Combobox extends LitElement {
|
|
|
1018
1115
|
}
|
|
1019
1116
|
label = `${selectedItemsCount} ${this.messages.selected}`;
|
|
1020
1117
|
} else if (selectionDisplay === "fit") {
|
|
1021
|
-
chipInvisible = !!(
|
|
1118
|
+
chipInvisible = !!((allSelectedNoDisabled || allSelectedWithDisabledSelected) && selectedVisibleChipsCount === 0 || selectedHiddenChipsCount === 0);
|
|
1022
1119
|
label = selectedVisibleChipsCount > 0 ? `+${selectedHiddenChipsCount}` : `${selectedHiddenChipsCount} ${this.messages.selected}`;
|
|
1023
1120
|
}
|
|
1024
1121
|
}
|
|
@@ -1028,12 +1125,14 @@ class Combobox extends LitElement {
|
|
|
1028
1125
|
})} .label=${label} .scale=${scale} title=${label ?? nothing} value ${ref(selectedIndicatorChipRef)}>${label}</calcite-chip>`;
|
|
1029
1126
|
}
|
|
1030
1127
|
renderSelectedIndicatorChipCompact() {
|
|
1031
|
-
const { compactSelectionDisplay, selectionDisplay,
|
|
1128
|
+
const { compactSelectionDisplay, selectionDisplay, scale, selectedHiddenChipsCount } = this;
|
|
1129
|
+
const allSelectedNoDisabled = this.allSelected && !this.hasDisabledItems;
|
|
1130
|
+
const allSelectedWithDisabledSelected = this.allSelected && this.hasDisabledSelected;
|
|
1032
1131
|
let chipInvisible;
|
|
1033
1132
|
let label;
|
|
1034
1133
|
if (compactSelectionDisplay) {
|
|
1035
|
-
const selectedItemsCount =
|
|
1036
|
-
if (this.allSelected) {
|
|
1134
|
+
const selectedItemsCount = this.allItems.filter((item) => item.selected && (this.selectionMode !== "ancestors" || !hasActiveChildren(item))).length;
|
|
1135
|
+
if (allSelectedNoDisabled || allSelectedWithDisabledSelected || selectionDisplay === "single" && this.allSelected) {
|
|
1037
1136
|
chipInvisible = true;
|
|
1038
1137
|
} else if (selectionDisplay === "fit") {
|
|
1039
1138
|
chipInvisible = !(selectedHiddenChipsCount > 0);
|
|
@@ -1121,6 +1220,7 @@ class Combobox extends LitElement {
|
|
|
1121
1220
|
const singleSelectionDisplay = selectionDisplay === "single";
|
|
1122
1221
|
const fitSelectionDisplay = !singleSelectionMode && selectionDisplay === "fit";
|
|
1123
1222
|
const isClearable = !this.clearDisabled && this.selectionMode !== "single-persist" && !!this.value?.length;
|
|
1223
|
+
const hasDisabledItems = this.hasDisabledItems;
|
|
1124
1224
|
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({
|
|
1125
1225
|
[CSS$1.wrapper]: true,
|
|
1126
1226
|
[CSS$1.wrapperSingle]: singleSelectionMode || !this.selectedItems.length,
|
|
@@ -1129,7 +1229,7 @@ class Combobox extends LitElement {
|
|
|
1129
1229
|
[CSS$1.gridInput]: true,
|
|
1130
1230
|
[CSS$1.selectionDisplayFit]: fitSelectionDisplay,
|
|
1131
1231
|
[CSS$1.selectionDisplaySingle]: singleSelectionDisplay
|
|
1132
|
-
})} ${ref(this.setChipContainerEl)}>${!singleSelectionMode && !singleSelectionDisplay && this.renderChips() || ""}${!singleSelectionMode && !singleSelectionDisplay && this.selectAllEnabled && this.renderAllSelectedIndicatorChip() || ""}${!singleSelectionMode && !allSelectionDisplay && [
|
|
1232
|
+
})} ${ref(this.setChipContainerEl)}>${!singleSelectionMode && !singleSelectionDisplay && this.renderChips() || ""}${!singleSelectionMode && !singleSelectionDisplay && this.selectAllEnabled && allSelectionDisplay && (!hasDisabledItems || this.hasDisabledSelected) && this.renderAllSelectedIndicatorChip() || ""}${!singleSelectionMode && !allSelectionDisplay && [
|
|
1133
1233
|
this.renderSelectedIndicatorChip(),
|
|
1134
1234
|
this.renderSelectedIndicatorChipCompact(),
|
|
1135
1235
|
this.renderAllSelectedIndicatorChip()
|
|
@@ -48,6 +48,8 @@ import type { DialogPlacement } from "./interfaces.js";
|
|
|
48
48
|
* @slot [header-actions-end] - A slot for adding actions or content to the ending side of the component's header.
|
|
49
49
|
* @slot [header-content] - A slot for adding custom content to the component's header.
|
|
50
50
|
* @slot [header-menu-actions] - A slot for adding an overflow menu with actions inside a `calcite-dropdown`.
|
|
51
|
+
* @slot [heading] - A slot for adding content to the heading area of the default header. Takes precedence over the `heading` property.
|
|
52
|
+
* @slot [description] - A slot for adding content to the description area of the default header. Takes precedence over the `description` property.
|
|
51
53
|
* @slot [fab] - A slot for adding a `calcite-fab` (floating action button) to perform an action.
|
|
52
54
|
* @slot [footer] - A slot for adding custom content to the component's footer. Should not be used with the `footer-start` or `footer-end` slots.
|
|
53
55
|
* @slot [footer-end] - A slot for adding a trailing footer custom content. Should not be used with the `footer` slot.
|
|
@@ -32,6 +32,8 @@ const SLOTS = {
|
|
|
32
32
|
contentBottom: "content-bottom",
|
|
33
33
|
headerActionsStart: "header-actions-start",
|
|
34
34
|
headerActionsEnd: "header-actions-end",
|
|
35
|
+
description: "description",
|
|
36
|
+
heading: "heading",
|
|
35
37
|
headerMenuActions: "header-menu-actions",
|
|
36
38
|
headerContent: "header-content",
|
|
37
39
|
fab: "fab",
|
|
@@ -492,7 +494,7 @@ class Dialog extends LitElement {
|
|
|
492
494
|
})} .popover=${!this.embedded ? "manual" : null} role=dialog ${ref(this.popoverRef)}>${this.modal ? html`<calcite-scrim class=${safeClassMap(CSS.scrim)} @click=${this.handleOutsideClose}></calcite-scrim>` : null}<div class=${safeClassMap({
|
|
493
495
|
[CSS.dialog]: true,
|
|
494
496
|
[getDimensionClass("width", this.width, this.widthScale)]: !!(this.width || this.widthScale)
|
|
495
|
-
})} @keydown=${this.handleKeyDown} ${ref(this.setTransitionEl)}>${assistiveText ? keyed("assistive-text", html`<div aria-live=polite class=${safeClassMap(CSS.assistiveText)}>${assistiveText}</div>`) : null}<slot name=${SLOTS.customContent}><calcite-panel class=${safeClassMap(CSS.panel)} .closable=${!this.closeDisabled} .description=${description} .heading=${heading} .headingLevel=${this.headingLevel} .hidden=${!this.opened} .icon=${icon} .iconFlipRtl=${iconFlipRtl} .loading=${this.loading} .menuOpen=${this.menuOpen} .messageOverrides=${this.messageOverrides} @keydown=${this.handlePanelKeyDown} @calcitePanelClose=${this.handleInternalPanelCloseClick} @calcitePanelScroll=${this.handleInternalPanelScroll} .overlayPositioning=${this.overlayPositioning} .scale=${this.scale} .topLayerDisabled=${this.topLayerDisabled} ${ref(this.panelRef)}><slot name=${SLOTS.actionBar} slot=${SLOTS$1.actionBar}></slot><slot name=${SLOTS.alerts} slot=${SLOTS$1.alerts}></slot><slot name=${SLOTS.headerActionsStart} slot=${SLOTS$1.headerActionsStart}></slot><slot name=${SLOTS.headerActionsEnd} slot=${SLOTS$1.headerActionsEnd}></slot><slot name=${SLOTS.headerContent} slot=${SLOTS$1.headerContent}></slot><slot name=${SLOTS.headerMenuActions} slot=${SLOTS$1.headerMenuActions}></slot><slot name=${SLOTS.fab} slot=${SLOTS$1.fab}></slot><slot name=${SLOTS.contentTop} slot=${SLOTS$1.contentTop}></slot><slot name=${SLOTS.contentBottom} slot=${SLOTS$1.contentBottom}></slot><slot name=${SLOTS.footerStart} slot=${SLOTS$1.footerStart}></slot><slot name=${SLOTS.footer} slot=${SLOTS$1.footer}></slot><slot name=${SLOTS.footerEnd} slot=${SLOTS$1.footerEnd}></slot><slot></slot></calcite-panel></slot></div></div>`;
|
|
497
|
+
})} @keydown=${this.handleKeyDown} ${ref(this.setTransitionEl)}>${assistiveText ? keyed("assistive-text", html`<div aria-live=polite class=${safeClassMap(CSS.assistiveText)}>${assistiveText}</div>`) : null}<slot name=${SLOTS.customContent}><calcite-panel class=${safeClassMap(CSS.panel)} .closable=${!this.closeDisabled} .description=${description} .heading=${heading} .headingLevel=${this.headingLevel} .hidden=${!this.opened} .icon=${icon} .iconFlipRtl=${iconFlipRtl} .loading=${this.loading} .menuOpen=${this.menuOpen} .messageOverrides=${this.messageOverrides} @keydown=${this.handlePanelKeyDown} @calcitePanelClose=${this.handleInternalPanelCloseClick} @calcitePanelScroll=${this.handleInternalPanelScroll} .overlayPositioning=${this.overlayPositioning} .scale=${this.scale} .topLayerDisabled=${this.topLayerDisabled} ${ref(this.panelRef)}><slot name=${SLOTS.actionBar} slot=${SLOTS$1.actionBar}></slot><slot name=${SLOTS.alerts} slot=${SLOTS$1.alerts}></slot><slot name=${SLOTS.headerActionsStart} slot=${SLOTS$1.headerActionsStart}></slot><slot name=${SLOTS.headerActionsEnd} slot=${SLOTS$1.headerActionsEnd}></slot><slot name=${SLOTS.description} slot=${SLOTS$1.description}></slot><slot name=${SLOTS.heading} slot=${SLOTS$1.heading}></slot><slot name=${SLOTS.headerContent} slot=${SLOTS$1.headerContent}></slot><slot name=${SLOTS.headerMenuActions} slot=${SLOTS$1.headerMenuActions}></slot><slot name=${SLOTS.fab} slot=${SLOTS$1.fab}></slot><slot name=${SLOTS.contentTop} slot=${SLOTS$1.contentTop}></slot><slot name=${SLOTS.contentBottom} slot=${SLOTS$1.contentBottom}></slot><slot name=${SLOTS.footerStart} slot=${SLOTS$1.footerStart}></slot><slot name=${SLOTS.footer} slot=${SLOTS$1.footer}></slot><slot name=${SLOTS.footerEnd} slot=${SLOTS$1.footerEnd}></slot><slot></slot></calcite-panel></slot></div></div>`;
|
|
496
498
|
}
|
|
497
499
|
}
|
|
498
500
|
customElement("calcite-dialog", Dialog);
|
|
@@ -42,6 +42,8 @@ import type { IconName } from "../calcite-icon/interfaces.js";
|
|
|
42
42
|
* @slot [header-actions-end] - A slot for adding `calcite-action`s or content to the end side of the component's header.
|
|
43
43
|
* @slot [header-content] - A slot for adding custom content to the component's header.
|
|
44
44
|
* @slot [header-menu-actions] - A slot for adding an overflow menu with `calcite-action`s inside a `calcite-dropdown`.
|
|
45
|
+
* @slot [heading] - A slot for adding content to the heading area of the default header. Takes precedence over the `heading` property.
|
|
46
|
+
* @slot [description] - A slot for adding content to the description area of the default header. Takes precedence over the `description` property.
|
|
45
47
|
* @slot [fab] - A slot for adding a `calcite-fab` (floating action button) to perform an action.
|
|
46
48
|
* @slot [footer] - A slot for adding custom content to the component's footer. Should not be used with the `footer-start` or `footer-end` slots.
|
|
47
49
|
* @slot [footer-end] - A slot for adding a trailing footer custom content. Should not be used with the `footer` slot.
|
|
@@ -23,6 +23,8 @@ const SLOTS = {
|
|
|
23
23
|
contentBottom: "content-bottom",
|
|
24
24
|
headerActionsStart: "header-actions-start",
|
|
25
25
|
headerActionsEnd: "header-actions-end",
|
|
26
|
+
description: "description",
|
|
27
|
+
heading: "heading",
|
|
26
28
|
headerMenuActions: "header-menu-actions",
|
|
27
29
|
headerContent: "header-content",
|
|
28
30
|
fab: "fab",
|
|
@@ -121,7 +123,7 @@ class FlowItem extends LitElement {
|
|
|
121
123
|
}
|
|
122
124
|
render() {
|
|
123
125
|
const { collapsed, collapseDirection, collapsible, closable, closed, description, disabled, heading, headingLevel, loading, menuOpen, messages, overlayPositioning, beforeClose, icon, iconFlipRtl } = this;
|
|
124
|
-
return this.interactiveContainer({ disabled, children: html`<calcite-panel .beforeClose=${beforeClose} .closable=${closable} .closed=${closed} .collapseDirection=${collapseDirection} .collapsed=${collapsed} .collapsible=${collapsible} .description=${description} .disabled=${disabled} .heading=${heading} .headingLevel=${headingLevel} .icon=${icon} .iconFlipRtl=${iconFlipRtl} .loading=${loading} .menuOpen=${menuOpen} .messageOverrides=${messages} @calcitePanelClose=${this.handleInternalPanelClose} @calcitePanelScroll=${this.handleInternalPanelScroll} @calcitePanelToggle=${this.handleInternalPanelToggle} .overlayPositioning=${overlayPositioning} .scale=${this.scale} .topLayerDisabled=${this.topLayerDisabled} ${ref(this.containerRef)}>${this.renderBackButton()}<slot name=${SLOTS.actionBar} slot=${SLOTS$1.actionBar}></slot><slot name=${SLOTS.alerts} slot=${SLOTS$1.alerts}></slot><slot name=${SLOTS.headerActionsStart} slot=${SLOTS$1.headerActionsStart}></slot><slot name=${SLOTS.headerActionsEnd} slot=${SLOTS$1.headerActionsEnd}></slot><slot name=${SLOTS.headerContent} slot=${SLOTS$1.headerContent}></slot><slot name=${SLOTS.headerMenuActions} slot=${SLOTS$1.headerMenuActions}></slot><slot name=${SLOTS.fab} slot=${SLOTS$1.fab}></slot><slot name=${SLOTS.contentTop} slot=${SLOTS$1.contentTop}></slot><slot name=${SLOTS.contentBottom} slot=${SLOTS$1.contentBottom}></slot><slot name=${SLOTS.footerStart} slot=${SLOTS$1.footerStart}></slot><slot name=${SLOTS.footer} slot=${SLOTS$1.footer}></slot><slot name=${SLOTS.footerEnd} slot=${SLOTS$1.footerEnd}></slot><slot></slot></calcite-panel>` });
|
|
126
|
+
return this.interactiveContainer({ disabled, children: html`<calcite-panel .beforeClose=${beforeClose} .closable=${closable} .closed=${closed} .collapseDirection=${collapseDirection} .collapsed=${collapsed} .collapsible=${collapsible} .description=${description} .disabled=${disabled} .heading=${heading} .headingLevel=${headingLevel} .icon=${icon} .iconFlipRtl=${iconFlipRtl} .loading=${loading} .menuOpen=${menuOpen} .messageOverrides=${messages} @calcitePanelClose=${this.handleInternalPanelClose} @calcitePanelScroll=${this.handleInternalPanelScroll} @calcitePanelToggle=${this.handleInternalPanelToggle} .overlayPositioning=${overlayPositioning} .scale=${this.scale} .topLayerDisabled=${this.topLayerDisabled} ${ref(this.containerRef)}>${this.renderBackButton()}<slot name=${SLOTS.actionBar} slot=${SLOTS$1.actionBar}></slot><slot name=${SLOTS.alerts} slot=${SLOTS$1.alerts}></slot><slot name=${SLOTS.headerActionsStart} slot=${SLOTS$1.headerActionsStart}></slot><slot name=${SLOTS.headerActionsEnd} slot=${SLOTS$1.headerActionsEnd}></slot><slot name=${SLOTS.description} slot=${SLOTS$1.description}></slot><slot name=${SLOTS.heading} slot=${SLOTS$1.heading}></slot><slot name=${SLOTS.headerContent} slot=${SLOTS$1.headerContent}></slot><slot name=${SLOTS.headerMenuActions} slot=${SLOTS$1.headerMenuActions}></slot><slot name=${SLOTS.fab} slot=${SLOTS$1.fab}></slot><slot name=${SLOTS.contentTop} slot=${SLOTS$1.contentTop}></slot><slot name=${SLOTS.contentBottom} slot=${SLOTS$1.contentBottom}></slot><slot name=${SLOTS.footerStart} slot=${SLOTS$1.footerStart}></slot><slot name=${SLOTS.footer} slot=${SLOTS$1.footer}></slot><slot name=${SLOTS.footerEnd} slot=${SLOTS$1.footerEnd}></slot><slot></slot></calcite-panel>` });
|
|
125
127
|
}
|
|
126
128
|
}
|
|
127
129
|
customElement("calcite-flow-item", FlowItem);
|
|
@@ -37,6 +37,8 @@ import type { IconName } from "../calcite-icon/interfaces.js";
|
|
|
37
37
|
* @slot [header-actions-end] - A slot for adding actions or content to the end side of the header.
|
|
38
38
|
* @slot [header-content] - A slot for adding custom content to the header.
|
|
39
39
|
* @slot [header-menu-actions] - A slot for adding an overflow menu with actions inside a `calcite-dropdown`.
|
|
40
|
+
* @slot [heading] - A slot for adding content to the heading area of the default header. Takes precedence over the `heading` property.
|
|
41
|
+
* @slot [description] - A slot for adding content to the description area of the default header. Takes precedence over the `description` property.
|
|
40
42
|
* @slot [fab] - A slot for adding a `calcite-fab` (floating action button) to perform an action.
|
|
41
43
|
* @slot [footer] - A slot for adding custom content to the component's footer. Should not be used with the `"footer-start"` or `"footer-end"` slots.
|
|
42
44
|
* @slot [footer-end] - A slot for adding custom content to a trailing footer. Should not be used with the `"footer"` slot.
|
|
@@ -4,7 +4,7 @@ import { keyed } from "lit/directives/keyed.js";
|
|
|
4
4
|
import { css, html, nothing } from "lit";
|
|
5
5
|
import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
|
|
6
6
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
7
|
-
import { s as slotChangeHasAssignedElement, a as slotChangeGetAssignedElements } from "../../chunks/dom.js";
|
|
7
|
+
import { s as slotChangeHasAssignedElement, a as slotChangeGetAssignedElements, A as slotChangeHasTextContent, h as hasVisibleContent } from "../../chunks/dom.js";
|
|
8
8
|
import { g as getIconScale } from "../../chunks/component.js";
|
|
9
9
|
import { c as createObserver, u as updateRefObserver } from "../../chunks/observers.js";
|
|
10
10
|
import { S as SLOTS$1 } from "../../chunks/resources2.js";
|
|
@@ -34,6 +34,8 @@ class Panel extends LitElement {
|
|
|
34
34
|
this.hasFooterEndContent = false;
|
|
35
35
|
this.hasFooterStartContent = false;
|
|
36
36
|
this.hasHeaderContent = false;
|
|
37
|
+
this.hasHeaderDescription = false;
|
|
38
|
+
this.hasHeaderHeading = false;
|
|
37
39
|
this.hasMenuItems = false;
|
|
38
40
|
this.hasStartActions = false;
|
|
39
41
|
this.showHeaderContent = false;
|
|
@@ -58,7 +60,7 @@ class Panel extends LitElement {
|
|
|
58
60
|
this.listen("calcitePanelClose", this.panelCloseHandler);
|
|
59
61
|
}
|
|
60
62
|
static {
|
|
61
|
-
this.properties = { hasActionBar: [16, {}, { state: true }], hasContentBottom: [16, {}, { state: true }], hasContentTop: [16, {}, { state: true }], hasEndActions: [16, {}, { state: true }], hasFab: [16, {}, { state: true }], hasFooterContent: [16, {}, { state: true }], hasFooterEndContent: [16, {}, { state: true }], hasFooterStartContent: [16, {}, { state: true }], hasHeaderContent: [16, {}, { state: true }], hasMenuItems: [16, {}, { state: true }], hasStartActions: [16, {}, { state: true }], showHeaderContent: [16, {}, { state: true }], beforeClose: [0, {}, { attribute: false }], closable: [7, {}, { reflect: true, type: Boolean }], closed: [7, {}, { reflect: true, type: Boolean }], collapseDirection: 1, collapsed: [7, {}, { reflect: true, type: Boolean }], collapsible: [7, {}, { reflect: true, type: Boolean }], description: 1, disabled: [7, {}, { reflect: true, type: Boolean }], heading: 1, headingLevel: [11, {}, { type: Number, reflect: true }], icon: [3, { type: String }, { reflect: true }], iconFlipRtl: [7, {}, { reflect: true, type: Boolean }], loading: [7, {}, { reflect: true, type: Boolean }], menuFlipPlacements: [0, {}, { attribute: false }], menuOpen: [7, {}, { reflect: true, type: Boolean }], menuPlacement: [3, {}, { reflect: true }], messageOverrides: [0, {}, { attribute: false }], overlayPositioning: [3, {}, { reflect: true }], scale: [3, {}, { reflect: true }], topLayerDisabled: [7, {}, { reflect: true, type: Boolean }] };
|
|
63
|
+
this.properties = { hasActionBar: [16, {}, { state: true }], hasContentBottom: [16, {}, { state: true }], hasContentTop: [16, {}, { state: true }], hasEndActions: [16, {}, { state: true }], hasFab: [16, {}, { state: true }], hasFooterContent: [16, {}, { state: true }], hasFooterEndContent: [16, {}, { state: true }], hasFooterStartContent: [16, {}, { state: true }], hasHeaderContent: [16, {}, { state: true }], hasHeaderDescription: [16, {}, { state: true }], hasHeaderHeading: [16, {}, { state: true }], hasMenuItems: [16, {}, { state: true }], hasStartActions: [16, {}, { state: true }], showHeaderContent: [16, {}, { state: true }], beforeClose: [0, {}, { attribute: false }], closable: [7, {}, { reflect: true, type: Boolean }], closed: [7, {}, { reflect: true, type: Boolean }], collapseDirection: 1, collapsed: [7, {}, { reflect: true, type: Boolean }], collapsible: [7, {}, { reflect: true, type: Boolean }], description: 1, disabled: [7, {}, { reflect: true, type: Boolean }], heading: 1, headingLevel: [11, {}, { type: Number, reflect: true }], icon: [3, { type: String }, { reflect: true }], iconFlipRtl: [7, {}, { reflect: true, type: Boolean }], loading: [7, {}, { reflect: true, type: Boolean }], menuFlipPlacements: [0, {}, { attribute: false }], menuOpen: [7, {}, { reflect: true, type: Boolean }], menuPlacement: [3, {}, { reflect: true }], messageOverrides: [0, {}, { attribute: false }], overlayPositioning: [3, {}, { reflect: true }], scale: [3, {}, { reflect: true }], topLayerDisabled: [7, {}, { reflect: true, type: Boolean }] };
|
|
62
64
|
}
|
|
63
65
|
static {
|
|
64
66
|
this.styles = [styles$1, styles];
|
|
@@ -155,6 +157,12 @@ class Panel extends LitElement {
|
|
|
155
157
|
handleHeaderContentSlotChange(event) {
|
|
156
158
|
this.hasHeaderContent = slotChangeHasAssignedElement(event);
|
|
157
159
|
}
|
|
160
|
+
handleHeaderDescriptionSlotChange(event) {
|
|
161
|
+
this.hasHeaderDescription = slotChangeHasTextContent(event) || slotChangeGetAssignedElements(event).some(hasVisibleContent);
|
|
162
|
+
}
|
|
163
|
+
handleHeaderHeadingSlotChange(event) {
|
|
164
|
+
this.hasHeaderHeading = slotChangeHasTextContent(event) || slotChangeGetAssignedElements(event).some(hasVisibleContent);
|
|
165
|
+
}
|
|
158
166
|
handleFabSlotChange(event) {
|
|
159
167
|
this.hasFab = slotChangeHasAssignedElement(event);
|
|
160
168
|
}
|
|
@@ -185,11 +193,14 @@ class Panel extends LitElement {
|
|
|
185
193
|
});
|
|
186
194
|
}
|
|
187
195
|
renderHeaderContent() {
|
|
188
|
-
const { heading, headingLevel, description, hasHeaderContent, icon, scale } = this;
|
|
196
|
+
const { heading, headingLevel, description, hasHeaderContent, hasHeaderDescription, hasHeaderHeading, icon, scale } = this;
|
|
197
|
+
const showHeaderHeading = !!heading || hasHeaderHeading;
|
|
198
|
+
const showHeaderDescription = !!description || hasHeaderDescription;
|
|
199
|
+
const showHeaderTextContent = showHeaderHeading || showHeaderDescription;
|
|
189
200
|
const iconNode = icon ? html`<calcite-icon class=${safeClassMap(CSS.icon)} .flipRtl=${this.iconFlipRtl} .icon=${icon} .scale=${getIconScale(scale)}></calcite-icon>` : null;
|
|
190
|
-
const headingNode =
|
|
191
|
-
const descriptionNode =
|
|
192
|
-
return
|
|
201
|
+
const headingNode = Heading({ class: CSS.heading, hidden: !showHeaderHeading, level: headingLevel, children: html`<slot .hidden=${!hasHeaderHeading} name=${SLOTS.heading} @slotchange=${this.handleHeaderHeadingSlotChange}></slot>${!hasHeaderHeading ? heading : null}` });
|
|
202
|
+
const descriptionNode = html`<span class=${safeClassMap(CSS.description)} .hidden=${!showHeaderDescription}><slot .hidden=${!hasHeaderDescription} name=${SLOTS.description} @slotchange=${this.handleHeaderDescriptionSlotChange}></slot>${!hasHeaderDescription ? description : null}</span>`;
|
|
203
|
+
return keyed("header-content", html`<div class=${safeClassMap({ [CSS.headerContent]: true, [CSS.headerNonSlottedContent]: true })} .hidden=${hasHeaderContent || !showHeaderTextContent}>${iconNode}<div class=${safeClassMap(CSS.headingTextContent)}>${headingNode}${descriptionNode}</div></div>`);
|
|
193
204
|
}
|
|
194
205
|
renderActionBar() {
|
|
195
206
|
return html`<div class=${safeClassMap(CSS.actionBarContainer)} .hidden=${!this.hasActionBar}><slot name=${SLOTS.actionBar} @slotchange=${this.handleActionBarSlotChange}></slot></div>`;
|
|
@@ -219,9 +230,10 @@ class Panel extends LitElement {
|
|
|
219
230
|
return keyed("menu", html`<calcite-action-menu .flipPlacements=${menuFlipPlacements ?? ["top", "bottom"]} .hidden=${!hasMenuItems} .label=${messages.options} .open=${menuOpen} .overlayPositioning=${this.overlayPositioning} .placement=${menuPlacement} .scale=${scale} .topLayerDisabled=${this.topLayerDisabled}><calcite-action class=${safeClassMap(CSS.menuAction)} .icon=${ICONS.menu} .scale=${scale} slot=${SLOTS$1.trigger} .text=${messages.options}></calcite-action><slot name=${SLOTS.headerMenuActions} @slotchange=${this.handleHeaderMenuActionsSlotChange}></slot></calcite-action-menu>`);
|
|
220
231
|
}
|
|
221
232
|
renderHeaderNode() {
|
|
222
|
-
const { hasHeaderContent, hasStartActions, hasEndActions, closable, collapsible, hasMenuItems, hasActionBar, hasContentTop } = this;
|
|
233
|
+
const { hasHeaderContent, hasHeaderDescription, hasHeaderHeading, hasStartActions, hasEndActions, closable, collapsible, hasMenuItems, hasActionBar, hasContentTop, heading, description } = this;
|
|
223
234
|
const headerContentNode = this.renderHeaderContent();
|
|
224
|
-
const
|
|
235
|
+
const hasDefaultHeaderContent = !!heading || !!description || hasHeaderHeading || hasHeaderDescription;
|
|
236
|
+
const showHeaderContent = hasHeaderContent || hasDefaultHeaderContent || hasStartActions || hasEndActions || collapsible || closable || hasMenuItems || hasActionBar || hasContentTop;
|
|
225
237
|
this.showHeaderContent = showHeaderContent;
|
|
226
238
|
return html`<header class=${safeClassMap(CSS.header)} .hidden=${!(showHeaderContent || hasActionBar || hasContentTop)}><div class=${safeClassMap({ [CSS.headerContainer]: true, [CSS.headerContainerBorderEnd]: hasActionBar })} .hidden=${!showHeaderContent}>${this.renderHeaderStartActions()}${this.renderHeaderSlottedContent()}${headerContentNode}${this.renderHeaderActionsEnd()}</div>${this.renderActionBar()}${this.renderContentTop()}</header>`;
|
|
227
239
|
}
|
|
@@ -6,7 +6,7 @@ import { css, html } from "lit";
|
|
|
6
6
|
import { LitElement, createEvent, setAttribute, safeClassMap } from "@arcgis/lumina";
|
|
7
7
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
8
8
|
import { useDirection } from "@arcgis/lumina/controllers";
|
|
9
|
-
import {
|
|
9
|
+
import { B as ensureId, g as getStylePixelValue } from "../../chunks/dom.js";
|
|
10
10
|
import { c as createObserver } from "../../chunks/observers.js";
|
|
11
11
|
import { t as toggleOpenClose } from "../../chunks/openCloseComponent.js";
|
|
12
12
|
import { g as getDimensionClass } from "../../chunks/dynamicClasses.js";
|
|
@@ -10,7 +10,7 @@ export abstract class Swatch extends LitElement {
|
|
|
10
10
|
/**
|
|
11
11
|
* Specifies the component's color
|
|
12
12
|
*
|
|
13
|
-
* @
|
|
13
|
+
* @mdn [Mozilla - CSS color value](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value)
|
|
14
14
|
*/
|
|
15
15
|
accessor color: string;
|
|
16
16
|
/**
|
|
@@ -6,7 +6,7 @@ import { a as calciteSize24, b as calciteSize32, d as calciteSize44 } from "../.
|
|
|
6
6
|
import { css, html } from "lit";
|
|
7
7
|
import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
|
|
8
8
|
import { useDirection } from "@arcgis/lumina/controllers";
|
|
9
|
-
import {
|
|
9
|
+
import { C as filterDirectChildren, f as focusElementInGroup, i as focusElement } from "../../chunks/dom.js";
|
|
10
10
|
import { c as createObserver } from "../../chunks/observers.js";
|
|
11
11
|
import { u as useT9n } from "../../chunks/useT9n.js";
|
|
12
12
|
const ICON = {
|
|
@@ -3,7 +3,7 @@ import { c as customElement } from "../../chunks/runtime.js";
|
|
|
3
3
|
import { css, html } from "lit";
|
|
4
4
|
import { LitElement, safeClassMap } from "@arcgis/lumina";
|
|
5
5
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
6
|
-
import { a as slotChangeGetAssignedElements,
|
|
6
|
+
import { a as slotChangeGetAssignedElements, D as getSlotAssignedElements } from "../../chunks/dom.js";
|
|
7
7
|
const CSS = {
|
|
8
8
|
section: "section"
|
|
9
9
|
};
|
|
@@ -5,7 +5,7 @@ import { css, html, nothing } from "lit";
|
|
|
5
5
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
6
6
|
import { LitElement, createEvent, safeClassMap, setAttribute } from "@arcgis/lumina";
|
|
7
7
|
import { useDirection } from "@arcgis/lumina/controllers";
|
|
8
|
-
import {
|
|
8
|
+
import { C as filterDirectChildren, a as slotChangeGetAssignedElements, s as slotChangeHasAssignedElement } from "../../chunks/dom.js";
|
|
9
9
|
import { t as toAriaBoolean } from "../../chunks/aria.js";
|
|
10
10
|
import { g as getIconScale } from "../../chunks/component.js";
|
|
11
11
|
import { u as useInteractive } from "../../chunks/useInteractive.js";
|