@esri/calcite-components 5.2.0-next.30 → 5.2.0-next.32
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/{KVL67YS2.js → 2ALI4ENC.js} +1 -1
- package/dist/cdn/{HZR6NCWA.js → 34LN2LJS.js} +1 -1
- package/dist/cdn/{DXNQDJIF.js → 34S4GEZH.js} +1 -1
- package/dist/cdn/{CUZA2JG2.js → 3DWN3FBO.js} +1 -1
- package/dist/cdn/{VMCOZ3HV.js → 3I2SZUSI.js} +1 -1
- package/dist/cdn/{ILOVG2ER.js → 3KPB5ZG3.js} +1 -1
- package/dist/cdn/{7HJVRNDA.js → 3NZLINPY.js} +1 -1
- package/dist/cdn/{TJUGLK7F.js → 3UEVPCND.js} +1 -1
- package/dist/cdn/{GL4HAMBI.js → 4CJPVAV6.js} +1 -1
- package/dist/cdn/{O6JGN5I7.js → 4OTPD46Y.js} +1 -1
- package/dist/cdn/{N37CYE3C.js → 4PRZO5FL.js} +1 -1
- package/dist/cdn/{TN5VSQFI.js → 4XKPZDWA.js} +1 -1
- package/dist/cdn/{ZFAINRBG.js → 5D5KWSRU.js} +1 -1
- package/dist/cdn/{B6YEVWZC.js → 5PO5KWY4.js} +1 -1
- package/dist/cdn/{DNJWLEZW.js → 5T7XXZVM.js} +1 -1
- package/dist/cdn/{IUPRTI22.js → 5TAEPFKA.js} +1 -1
- package/dist/cdn/{SVZ3IFYS.js → 6BBTSWZJ.js} +1 -1
- package/dist/cdn/{7CNQUYOT.js → 6MJGHCHL.js} +1 -1
- package/dist/cdn/{RIRQHOBE.js → 6QTMT3BR.js} +1 -1
- package/dist/cdn/{ZM4UKWZJ.js → 6UAE7TVW.js} +1 -1
- package/dist/cdn/{R434GHPA.js → 6ZJIHGRE.js} +1 -1
- package/dist/cdn/{H4KOQ3P3.js → 7CJ5CM4O.js} +1 -1
- package/dist/cdn/{2JUKL5RZ.js → 7H6JEAAY.js} +1 -1
- package/dist/cdn/{OWGPSQUW.js → 7HUQTHRG.js} +1 -1
- package/dist/cdn/{GYLPLFN5.js → 7NGKKXBY.js} +1 -1
- package/dist/cdn/{P5V7JFB5.js → 7NMYOO4C.js} +1 -1
- package/dist/cdn/{NFQVM6G3.js → 7VJQDFM5.js} +1 -1
- package/dist/cdn/{JHYELFTN.js → 7XLKMGMO.js} +1 -1
- package/dist/cdn/{A3QXPEE3.js → 7YKEDO2W.js} +1 -1
- package/dist/cdn/{LP3TELFB.js → A4JYA56A.js} +1 -1
- package/dist/cdn/{Y3WHK3EI.js → A5XRC6GV.js} +1 -1
- package/dist/cdn/{OUL6IB3V.js → AD6N6O57.js} +1 -1
- package/dist/cdn/{CIXBCLNA.js → AGS5VTQ7.js} +1 -1
- package/dist/cdn/{KM4ZA4CE.js → AVIL7OG7.js} +1 -1
- package/dist/cdn/{TYUT2PCJ.js → BRLCJYRS.js} +1 -1
- package/dist/cdn/{6QWNCW32.js → BRQQDHKC.js} +1 -1
- package/dist/cdn/{744ICFOB.js → BTQF7UHA.js} +1 -1
- package/dist/cdn/{RW4M5CR6.js → BY7EPIAJ.js} +1 -1
- package/dist/cdn/{FXRJYL3C.js → C23B3A4Z.js} +1 -1
- package/dist/cdn/{7Z4FHAX2.js → C6GZFOWX.js} +1 -1
- package/dist/cdn/{WF4T4755.js → CE6DVH5U.js} +1 -1
- package/dist/cdn/{2Q5EZYJY.js → CJ2SUM7M.js} +1 -1
- package/dist/cdn/{WOQEDKPR.js → CLDDWBPJ.js} +1 -1
- package/dist/cdn/{XRJY4MG7.js → COEPTSMJ.js} +1 -1
- package/dist/cdn/{H6W4S4LE.js → CWZ74ACK.js} +1 -1
- package/dist/cdn/{A5J4D5E4.js → CZ6EC5N6.js} +1 -1
- package/dist/cdn/DGP7CLGV.js +2 -0
- package/dist/cdn/DMK27J6W.js +2 -0
- package/dist/cdn/{KE4B2YVK.js → DQ3PCOCG.js} +1 -1
- package/dist/cdn/{PIRO2BNM.js → DYNPRZCV.js} +1 -1
- package/dist/cdn/{PNWVAEZN.js → E4NELUHA.js} +1 -1
- package/dist/cdn/{MXIWNVFP.js → EEHJN6D5.js} +1 -1
- package/dist/cdn/{AGDLGJ6L.js → EI4TFI4G.js} +1 -1
- package/dist/cdn/{UG4WZLVD.js → EL3MWVTU.js} +1 -1
- package/dist/cdn/{7BMELRUN.js → EL4KJ476.js} +1 -1
- package/dist/cdn/{QOK4W2DZ.js → EMK36YXI.js} +1 -1
- package/dist/cdn/{3QCZXBFB.js → F3KQEYE7.js} +1 -1
- package/dist/cdn/{RIY7L66T.js → F6RUE2M2.js} +1 -1
- package/dist/cdn/{ECBRRRYY.js → FIMDUKAT.js} +1 -1
- package/dist/cdn/{NNVHBWZN.js → FJGZSA3T.js} +1 -1
- package/dist/cdn/{OTWUFKKP.js → FNFMG4OS.js} +1 -1
- package/dist/cdn/{2TYJA7ZA.js → FRPHXRCY.js} +1 -1
- package/dist/cdn/G7GMQSWX.js +2 -0
- package/dist/cdn/{TIZK2BII.js → GBA56KXZ.js} +1 -1
- package/dist/cdn/{XZ3AWUYG.js → GINPHCKX.js} +1 -1
- package/dist/cdn/{V7E67VOT.js → GMGUT6R2.js} +1 -1
- package/dist/cdn/{I72HA7SW.js → GQZX6FJD.js} +1 -1
- package/dist/cdn/{WJE5Q74F.js → GSZ5XODZ.js} +1 -1
- package/dist/cdn/{WSGPRBXQ.js → H5F5TKSQ.js} +1 -1
- package/dist/cdn/{CBALBCOP.js → H5JD4SSM.js} +1 -1
- package/dist/cdn/{MHRIRXTX.js → HBFKOP4O.js} +1 -1
- package/dist/cdn/HKLXMKWW.js +2 -0
- package/dist/cdn/{YIG7OHCG.js → HLXJR3SQ.js} +1 -1
- package/dist/cdn/{7JP2QDSY.js → I2GT4O6W.js} +1 -1
- package/dist/cdn/{YSMLTX25.js → IELIVXOH.js} +1 -1
- package/dist/cdn/{PX6LQKUI.js → INB4ESKN.js} +1 -1
- package/dist/cdn/{7VCES7OE.js → INPOEQLV.js} +1 -1
- package/dist/cdn/{E4TKILOL.js → INZFPRLC.js} +1 -1
- package/dist/cdn/{B4CZNDF3.js → IOHWA5AF.js} +1 -1
- package/dist/cdn/IZS3M5HV.js +2 -0
- package/dist/cdn/{AVCX74DP.js → J5RTSFH2.js} +1 -1
- package/dist/cdn/J7GLTPOG.js +2 -0
- package/dist/cdn/{USCBNO6D.js → JDS4Q3DQ.js} +1 -1
- package/dist/cdn/{IV6LNHPU.js → JPP57EQ2.js} +1 -1
- package/dist/cdn/{IAFVBT32.js → JTPCZIUB.js} +1 -1
- package/dist/cdn/{3AXZKAYQ.js → JZDX222C.js} +1 -1
- package/dist/cdn/{76ACXAF3.js → K4BDB233.js} +1 -1
- package/dist/cdn/{C67GL2CA.js → KDYHO3DX.js} +1 -1
- package/dist/cdn/{UXTQJCNN.js → KHVPREQL.js} +1 -1
- package/dist/cdn/{7TZ6KD4O.js → KKFKA36R.js} +1 -1
- package/dist/cdn/{JR5WU7IG.js → KPLMTG7M.js} +1 -1
- package/dist/cdn/{HFGCBOA6.js → KTMPQFXM.js} +1 -1
- package/dist/cdn/{C3WONRU7.js → KYNFC67E.js} +1 -1
- package/dist/cdn/{S75DSAHG.js → KYYFCGSM.js} +1 -1
- package/dist/cdn/{KQ7JODBH.js → LKHNWV7H.js} +1 -1
- package/dist/cdn/{GPVRWYQF.js → LM5344X3.js} +1 -1
- package/dist/cdn/{L4JBLHJP.js → LMVGXCUB.js} +1 -1
- package/dist/cdn/{WEC4V5A4.js → M5CAMUJA.js} +1 -1
- package/dist/cdn/{VLGXJHJZ.js → M7ZWJ3WS.js} +1 -1
- package/dist/cdn/{JWCIDZM4.js → MEVB3IC5.js} +1 -1
- package/dist/cdn/{L6XXOKYW.js → MO5B4VX7.js} +1 -1
- package/dist/cdn/{JLVQUTEE.js → MQZF7GBV.js} +1 -1
- package/dist/cdn/{U4CNMRWE.js → MUQLRK7U.js} +1 -1
- package/dist/cdn/{MQSF7LRG.js → MYV5GGZF.js} +1 -1
- package/dist/cdn/{SDSIO47V.js → OSK3U7WF.js} +1 -1
- package/dist/cdn/{HYONXP3Q.js → OSV7CFKC.js} +1 -1
- package/dist/cdn/{XVKFFHIM.js → OV4L7Y2U.js} +1 -1
- package/dist/cdn/{OIHVLKPK.js → PCDEZQ5O.js} +1 -1
- package/dist/cdn/{GNXXWAUU.js → PMMNGLYO.js} +1 -1
- package/dist/cdn/{S5NVS4GZ.js → POIX33V2.js} +1 -1
- package/dist/cdn/PUAN7SC7.js +2 -0
- package/dist/cdn/{OTHJKEUE.js → QS7YJ7ID.js} +1 -1
- package/dist/cdn/{O2TWSKJQ.js → QYPBF7SX.js} +1 -1
- package/dist/cdn/{DQIOK5E6.js → RCGGD4VD.js} +1 -1
- package/dist/cdn/RIWCMIVC.js +2 -0
- package/dist/cdn/{P6VCN6MX.js → RQNCEP7V.js} +1 -1
- package/dist/cdn/{YVPTOJ5A.js → RX7LNL6H.js} +1 -1
- package/dist/cdn/{GYGYZGV2.js → SBCMJF3D.js} +1 -1
- package/dist/cdn/{UCKR6SFU.js → SIQA2PBC.js} +1 -1
- package/dist/cdn/{4F7RPBMC.js → SP5D6SJ2.js} +1 -1
- package/dist/cdn/{IPPUJ4XV.js → STG4CABT.js} +1 -1
- package/dist/cdn/{XCQQISIF.js → SWO5BPAD.js} +1 -1
- package/dist/cdn/{G2G2EWKP.js → T6HVZ47J.js} +1 -1
- package/dist/cdn/{YVJQNMYJ.js → TBYUWYMH.js} +1 -1
- package/dist/cdn/{QUZYKERC.js → TCSXUTNB.js} +1 -1
- package/dist/cdn/{I7EE4WLX.js → TE36HTKY.js} +1 -1
- package/dist/cdn/{HQAF5VNB.js → TFCDXEXM.js} +1 -1
- package/dist/cdn/{WWITNWC2.js → TNAV4Y7T.js} +1 -1
- package/dist/cdn/{SVU2DXVH.js → UIRLGHFP.js} +1 -1
- package/dist/cdn/{NYRH26AX.js → UPBB5BK5.js} +1 -1
- package/dist/cdn/{TUU23R4U.js → US7R2KAH.js} +1 -1
- package/dist/cdn/{HHB75VAP.js → W7WKPRBR.js} +1 -1
- package/dist/cdn/{UDBL4JHQ.js → WJ725XFM.js} +1 -1
- package/dist/cdn/{KUWM3KH7.js → WMKL773C.js} +1 -1
- package/dist/cdn/{UESRXLZE.js → X4X4FZMJ.js} +1 -1
- package/dist/cdn/{FEEM36AX.js → X6FZGCQO.js} +1 -1
- package/dist/cdn/{GQQAD4CY.js → XCC7RZKY.js} +1 -1
- package/dist/cdn/{3ULD6GMI.js → XF7AZMTR.js} +1 -1
- package/dist/cdn/{BFU36GZX.js → YFNGK3IC.js} +1 -1
- package/dist/cdn/{FPFNNOM4.js → YJDVSJI7.js} +1 -1
- package/dist/cdn/{V7CTUOE3.js → YQLZIZEE.js} +1 -1
- package/dist/cdn/{YLLHGJB3.js → YRRWAHXD.js} +1 -1
- package/dist/cdn/{II6DZIXM.js → YX2464BY.js} +1 -1
- package/dist/cdn/{KNG2XVTR.js → Z5RHXMLK.js} +1 -1
- package/dist/cdn/{DCV7F4JX.js → ZTWTNJJ6.js} +1 -1
- package/dist/cdn/{G2VMVWVC.js → ZVP3ZHJW.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/ExpandToggle.js +11 -45
- package/dist/chunks/dom.js +23 -23
- package/dist/chunks/manager.js +1 -1
- package/dist/chunks/openCloseComponent.js +1 -1
- package/dist/chunks/resources2.js +10 -14
- package/dist/chunks/resources3.js +17 -9
- package/dist/chunks/runtime.js +4 -4
- package/dist/chunks/useFocusTrap.js +1 -1
- package/dist/chunks/useForm.js +1 -1
- package/dist/chunks/useLabel.js +1 -1
- package/dist/chunks/useSetFocus.js +1 -1
- package/dist/chunks/utils2.js +1 -1
- package/dist/components/calcite-accordion-item/customElement.d.ts +5 -1
- package/dist/components/calcite-action/customElement.d.ts +5 -1
- package/dist/components/calcite-action-bar/customElement.d.ts +8 -2
- package/dist/components/calcite-action-bar/customElement.js +252 -55
- package/dist/components/calcite-action-group/customElement.d.ts +14 -1
- package/dist/components/calcite-action-group/customElement.js +61 -51
- package/dist/components/calcite-action-menu/customElement.d.ts +10 -0
- package/dist/components/calcite-action-menu/customElement.js +78 -36
- package/dist/components/calcite-action-pad/customElement.d.ts +5 -1
- package/dist/components/calcite-action-pad/customElement.js +2 -2
- package/dist/components/calcite-alert/customElement.d.ts +5 -1
- package/dist/components/calcite-alert/customElement.js +1 -1
- package/dist/components/calcite-autocomplete/customElement.d.ts +5 -1
- package/dist/components/calcite-avatar/customElement.js +1 -1
- package/dist/components/calcite-block/customElement.d.ts +5 -1
- package/dist/components/calcite-block-group/customElement.js +1 -1
- package/dist/components/calcite-block-section/customElement.d.ts +5 -1
- package/dist/components/calcite-button/customElement.d.ts +5 -1
- package/dist/components/calcite-button/customElement.js +1 -1
- package/dist/components/calcite-card/customElement.d.ts +5 -1
- package/dist/components/calcite-carousel/customElement.d.ts +5 -1
- package/dist/components/calcite-checkbox/customElement.d.ts +5 -1
- package/dist/components/calcite-chip/customElement.d.ts +5 -1
- package/dist/components/calcite-chip/customElement.js +1 -1
- package/dist/components/calcite-color-picker/customElement.d.ts +5 -1
- package/dist/components/calcite-color-picker/customElement.js +1 -1
- package/dist/components/calcite-color-picker-swatch/customElement.js +1 -1
- package/dist/components/calcite-combobox/customElement.d.ts +5 -1
- package/dist/components/calcite-combobox/customElement.js +1 -1
- package/dist/components/calcite-combobox-item/customElement.js +1 -1
- package/dist/components/calcite-date-picker/customElement.d.ts +6 -2
- package/dist/components/calcite-date-picker/customElement.js +27 -5
- package/dist/components/calcite-date-picker-month-header/customElement.js +1 -1
- package/dist/components/calcite-dialog/customElement.d.ts +5 -1
- package/dist/components/calcite-dropdown/customElement.js +1 -1
- package/dist/components/calcite-filter/customElement.d.ts +5 -1
- package/dist/components/calcite-flow-item/customElement.d.ts +5 -1
- package/dist/components/calcite-handle/customElement.d.ts +5 -1
- package/dist/components/calcite-inline-editable/customElement.d.ts +5 -1
- package/dist/components/calcite-input/customElement.d.ts +5 -1
- package/dist/components/calcite-input/customElement.js +1 -1
- package/dist/components/calcite-input-date-picker/customElement.d.ts +5 -1
- package/dist/components/calcite-input-message/customElement.js +1 -1
- package/dist/components/calcite-input-number/customElement.d.ts +5 -1
- package/dist/components/calcite-input-number/customElement.js +1 -1
- package/dist/components/calcite-input-text/customElement.d.ts +5 -1
- package/dist/components/calcite-input-text/customElement.js +1 -1
- package/dist/components/calcite-input-time-picker/customElement.d.ts +5 -1
- package/dist/components/calcite-input-time-zone/customElement.d.ts +5 -1
- package/dist/components/calcite-list/customElement.d.ts +5 -1
- package/dist/components/calcite-list/customElement.js +1 -1
- package/dist/components/calcite-list-item/customElement.d.ts +5 -1
- package/dist/components/calcite-list-item/customElement.js +1 -1
- package/dist/components/calcite-menu/customElement.d.ts +5 -1
- package/dist/components/calcite-menu/customElement.js +1 -1
- package/dist/components/calcite-menu-item/customElement.d.ts +5 -1
- package/dist/components/calcite-meter/customElement.js +1 -1
- package/dist/components/calcite-notice/customElement.d.ts +5 -1
- package/dist/components/calcite-notice/customElement.js +1 -1
- package/dist/components/calcite-pagination/customElement.d.ts +5 -1
- package/dist/components/calcite-panel/customElement.d.ts +5 -1
- package/dist/components/calcite-panel/customElement.js +2 -2
- package/dist/components/calcite-popover/customElement.d.ts +5 -1
- package/dist/components/calcite-radio-button-group/customElement.d.ts +5 -1
- package/dist/components/calcite-rating/customElement.d.ts +5 -1
- package/dist/components/calcite-scrim/customElement.d.ts +5 -1
- package/dist/components/calcite-scrim/customElement.js +1 -1
- package/dist/components/calcite-segmented-control/customElement.d.ts +5 -1
- package/dist/components/calcite-segmented-control-item/customElement.js +1 -1
- package/dist/components/calcite-select/customElement.d.ts +5 -1
- package/dist/components/calcite-sheet/customElement.d.ts +5 -1
- package/dist/components/calcite-shell/customElement.js +75 -5
- package/dist/components/calcite-shell-panel/customElement.d.ts +15 -2
- package/dist/components/calcite-shell-panel/customElement.js +75 -12
- package/dist/components/calcite-slider/customElement.d.ts +5 -1
- package/dist/components/calcite-slider/customElement.js +1 -1
- package/dist/components/calcite-sort-handle/customElement.d.ts +5 -1
- package/dist/components/calcite-sortable-list/customElement.js +1 -1
- package/dist/components/calcite-stepper/customElement.d.ts +5 -1
- package/dist/components/calcite-stepper-item/customElement.d.ts +5 -1
- package/dist/components/calcite-stepper-item/customElement.js +1 -1
- package/dist/components/calcite-tab/customElement.js +1 -1
- package/dist/components/calcite-tab-nav/customElement.d.ts +5 -1
- package/dist/components/calcite-tab-nav/customElement.js +1 -1
- package/dist/components/calcite-tab-title/customElement.d.ts +5 -1
- package/dist/components/calcite-tab-title/customElement.js +1 -1
- package/dist/components/calcite-table/customElement.d.ts +5 -1
- package/dist/components/calcite-table-cell/customElement.d.ts +5 -1
- package/dist/components/calcite-table-header/customElement.d.ts +5 -1
- package/dist/components/calcite-table-row/customElement.js +1 -1
- package/dist/components/calcite-tabs/customElement.js +1 -1
- package/dist/components/calcite-text-area/customElement.d.ts +5 -1
- package/dist/components/calcite-time-picker/customElement.d.ts +5 -1
- package/dist/components/calcite-tree/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/dist/loader.js +3 -3
- package/dist/types/lumina.d.ts +3 -1
- package/dist/types/preact.d.ts +3 -1
- package/dist/types/react.d.ts +3 -1
- package/dist/types/stencil.d.ts +3 -1
- package/package.json +2 -2
- package/dist/cdn/B5BPICM5.js +0 -2
- package/dist/cdn/IZ7RXFUG.js +0 -2
- package/dist/cdn/KLSU556M.js +0 -2
- package/dist/cdn/LIAKX4W7.js +0 -2
- package/dist/cdn/RYOYQ7JI.js +0 -2
- package/dist/cdn/U6XLKGTJ.js +0 -2
- package/dist/cdn/UHCJZSPT.js +0 -2
- package/dist/cdn/VVXGJ5AX.js +0 -2
- /package/dist/cdn/{WXZMRXAK.js → 5IJ25RMA.js} +0 -0
|
@@ -5,14 +5,16 @@ 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
7
|
import { useDirection } from "@arcgis/lumina/controllers";
|
|
8
|
-
import { g as getStylePixelValue,
|
|
8
|
+
import { g as getStylePixelValue, a as slotChangeGetAssignedElements, b as getSlotAssignedElements, f as focusElementInGroup } from "../../chunks/dom.js";
|
|
9
9
|
import { c as createObserver } from "../../chunks/observers.js";
|
|
10
|
-
import {
|
|
10
|
+
import { t as toggleActionBarChildActionText, E as ExpandToggle } from "../../chunks/ExpandToggle.js";
|
|
11
11
|
import { u as useT9n } from "../../chunks/useT9n.js";
|
|
12
12
|
import { u as useCancelable } from "../../chunks/useCancelable.js";
|
|
13
13
|
import { l as logger } from "../../chunks/logger.js";
|
|
14
14
|
import { u as useSetFocus } from "../../chunks/useSetFocus.js";
|
|
15
15
|
import { i as isAction } from "../../chunks/resources.js";
|
|
16
|
+
import { S as SLOTS$1, i as isActionGroup } from "../../chunks/resources2.js";
|
|
17
|
+
import { i as isActionMenu, S as SLOTS$2 } from "../../chunks/resources3.js";
|
|
16
18
|
const calculateMaxItems = ({
|
|
17
19
|
bufferSize = 0,
|
|
18
20
|
containerSize,
|
|
@@ -49,15 +51,68 @@ const SLOTS = {
|
|
|
49
51
|
actionsStart: "actions-start",
|
|
50
52
|
expandTooltip: "expand-tooltip"
|
|
51
53
|
};
|
|
54
|
+
const queryActions = (items) => items.flatMap((item) => {
|
|
55
|
+
if (isActionGroup(item)) {
|
|
56
|
+
return item.actions;
|
|
57
|
+
}
|
|
58
|
+
if (isActionMenu(item)) {
|
|
59
|
+
return item.actions.filter((action) => action.slot === SLOTS$2.trigger);
|
|
60
|
+
}
|
|
61
|
+
return item;
|
|
62
|
+
}).filter((action) => !!action);
|
|
63
|
+
const overflowActions = ({
|
|
64
|
+
actionGroups,
|
|
65
|
+
expanded,
|
|
66
|
+
overflowCount
|
|
67
|
+
}) => {
|
|
68
|
+
let needToSlotCount = overflowCount;
|
|
69
|
+
[...actionGroups].reverse().forEach((group) => {
|
|
70
|
+
let slottedWithinGroupCount = 0;
|
|
71
|
+
const directGroupActions = group.actions.filter((action) => action.parentElement === group).reverse();
|
|
72
|
+
directGroupActions.forEach((groupAction) => {
|
|
73
|
+
if (groupAction.slot === SLOTS$1.menuActions) {
|
|
74
|
+
groupAction.removeAttribute("slot");
|
|
75
|
+
groupAction.textEnabled = expanded;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
if (needToSlotCount > 0 && !group.overflowActionsDisabled) {
|
|
79
|
+
directGroupActions.some((groupAction) => {
|
|
80
|
+
const unslottedActions = directGroupActions.filter((action) => !action.slot);
|
|
81
|
+
if (unslottedActions.length > 1 && directGroupActions.length > 2 && !groupAction.closest("calcite-action-menu") && !groupAction.overflowDisabled) {
|
|
82
|
+
groupAction.textEnabled = true;
|
|
83
|
+
groupAction.setAttribute("slot", SLOTS$1.menuActions);
|
|
84
|
+
slottedWithinGroupCount++;
|
|
85
|
+
if (slottedWithinGroupCount > 1) {
|
|
86
|
+
needToSlotCount--;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return needToSlotCount < 1;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
group.manager.component.requestUpdate();
|
|
93
|
+
});
|
|
94
|
+
};
|
|
52
95
|
const styles = css`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([scale=s]){--calcite-internal-action-bar-gap: var(--calcite-action-bar-items-space, var(--calcite-spacing-xxs));--calcite-internal-action-bar-padding: var(--calcite-spacing-xxs)}:host([scale=m]){--calcite-internal-action-bar-gap: var(--calcite-action-bar-items-space, var(--calcite-spacing-sm));--calcite-internal-action-bar-padding: var(--calcite-spacing-sm)}:host([scale=l]){--calcite-internal-action-bar-gap: var(--calcite-action-bar-items-space, var(--calcite-space-sm-plus));--calcite-internal-action-bar-padding: var(--calcite-spacing-sm-plus)}:host{display:inline-flex;align-self:stretch;background:transparent;--calcite-internal-action-group-dividing-border-margin: calc(var(--calcite-spacing-base) + 1px)}.container{display:inline-flex;flex:1 1 auto;flex-direction:column;background-color:var(--calcite-action-bar-background-color, var(--calcite-color-foreground-1));gap:var(--calcite-internal-action-bar-gap);padding:var(--calcite-internal-action-bar-padding)}@keyframes in{0%{opacity:0}to{opacity:1}}:host([floating]) .container{animation:in var(--calcite-internal-animation-timing-slow) ease-in-out;overflow:hidden;border-radius:var(--calcite-action-bar-corner-radius, var(--calcite-corner-radius-round));box-shadow:var(--calcite-action-bar-shadow, var(--calcite-shadow-md))}:host([layout=vertical]){flex-direction:column}:host([layout=vertical]):host([overflow-actions-disabled]) .container{overflow-y:auto}:host([layout=vertical]):host([expanded]) .container{max-inline-size:var(--calcite-action-bar-expanded-max-width, auto)}:host([layout=vertical]) .action-group--end{margin-block-start:auto}:host([layout=vertical]) ::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm);border-image:linear-gradient(to right,transparent var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) calc(100% - var(--calcite-internal-action-group-dividing-border-margin)),transparent var(--calcite-internal-action-group-dividing-border-margin));border-image-slice:1;padding-block-end:var(--calcite-internal-action-bar-padding)}:host([layout=horizontal]){flex-direction:row}:host([layout=horizontal]) .container{flex-direction:row}:host([layout=horizontal]):host([overflow-actions-disabled]) .container{overflow-x:auto}:host([layout=horizontal]) .action-group--end{margin-inline-start:auto}:host([layout=horizontal]) ::slotted(calcite-action-group:not(:last-of-type)){border-image:linear-gradient(transparent var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) calc(100% - var(--calcite-internal-action-group-dividing-border-margin)),transparent var(--calcite-internal-action-group-dividing-border-margin));border-image-slice:1;border-inline-end-width:var(--calcite-border-width-sm);padding-inline-end:var(--calcite-internal-action-bar-padding)}.action-group--end{justify-content:flex-end}:host([hidden]){display:none}[hidden]{display:none}`;
|
|
53
96
|
class ActionBar extends LitElement {
|
|
54
97
|
constructor() {
|
|
55
98
|
super();
|
|
56
99
|
this.actions = [];
|
|
57
100
|
this.containerRef = createRef();
|
|
101
|
+
this.defaultSlotRef = createRef();
|
|
102
|
+
this.actionsStartSlotRef = createRef();
|
|
103
|
+
this.actionsEndSlotRef = createRef();
|
|
104
|
+
this.actionsStartGroupRef = createRef();
|
|
105
|
+
this.actionsEndGroupRef = createRef();
|
|
58
106
|
this.direction = useDirection();
|
|
107
|
+
this.defaultSlotItems = [];
|
|
59
108
|
this.actionGroups = [];
|
|
60
|
-
this.
|
|
109
|
+
this.actionMenus = [];
|
|
110
|
+
this.actionsStart = [];
|
|
111
|
+
this.actionsStartGroups = [];
|
|
112
|
+
this.actionsEnd = [];
|
|
113
|
+
this.actionsEndGroups = [];
|
|
114
|
+
this.overflowPassId = 0;
|
|
115
|
+
this.suppressedActionGroupActionsChange = /* @__PURE__ */ new WeakMap();
|
|
61
116
|
this.cancelable = useCancelable()(this);
|
|
62
117
|
this.resize = debounce(({ width, height }) => {
|
|
63
118
|
const { expanded, expandToggleDisabled, layout, overflowActionsDisabled, expandPosition } = this;
|
|
@@ -66,37 +121,57 @@ class ActionBar extends LitElement {
|
|
|
66
121
|
}
|
|
67
122
|
this.updateGroups();
|
|
68
123
|
const itemSizes = this.getItemSizes();
|
|
69
|
-
const { actionGroups } = this;
|
|
124
|
+
const { actionGroups: defaultActionGroups, actionsEnd, actionsEndGroups, actionsStart, actionsStartGroups, defaultSlotItems } = this;
|
|
125
|
+
const slottedActionGroups = [
|
|
126
|
+
...actionsStartGroups,
|
|
127
|
+
...defaultActionGroups,
|
|
128
|
+
...actionsEndGroups
|
|
129
|
+
];
|
|
70
130
|
const actionsEndCount = this.hasActionsEnd || !expandToggleDisabled && expandPosition === "end" ? 1 : 0;
|
|
71
131
|
const actionsStartCount = this.hasActionsStart || !expandToggleDisabled && expandPosition === "start" ? 1 : 0;
|
|
72
|
-
const
|
|
73
|
-
let bufferSize =
|
|
132
|
+
const visibleSectionCount = defaultSlotItems.length + actionsEndCount + actionsStartCount;
|
|
133
|
+
let bufferSize = visibleSectionCount;
|
|
74
134
|
const actionBarContainerStyle = getComputedStyle(this.containerRef.value);
|
|
75
135
|
bufferSize += getStylePixelValue(layout === "horizontal" ? actionBarContainerStyle.paddingInlineStart : actionBarContainerStyle.paddingBlockStart) + getStylePixelValue(layout === "horizontal" ? actionBarContainerStyle.paddingInlineEnd : actionBarContainerStyle.paddingBlockEnd);
|
|
76
|
-
if (
|
|
77
|
-
|
|
136
|
+
if (slottedActionGroups.length > 0) {
|
|
137
|
+
const lastSlottedActionGroupIndex = slottedActionGroups.length - 1;
|
|
138
|
+
slottedActionGroups.forEach((actionGroup, index) => {
|
|
78
139
|
const actionGroupStyle = getComputedStyle(actionGroup);
|
|
79
140
|
const actionGroupGap = getStylePixelValue(actionGroupStyle.gap);
|
|
80
|
-
const
|
|
141
|
+
const defaultActionsCount = actionGroup.actions.filter((action) => action.slot !== SLOTS$1.menuActions).length;
|
|
142
|
+
const hasMenuActions = actionGroup.actions.some((action) => action.slot === SLOTS$1.menuActions);
|
|
143
|
+
const actionGroupItemCount = defaultActionsCount + (hasMenuActions ? 1 : 0);
|
|
144
|
+
const actionGroupGapQuantity = Math.max(actionGroupItemCount - 1, 0);
|
|
81
145
|
bufferSize += actionGroupGap * actionGroupGapQuantity;
|
|
82
|
-
if (
|
|
146
|
+
if (index !== lastSlottedActionGroupIndex) {
|
|
83
147
|
bufferSize += getStylePixelValue(layout === "horizontal" ? actionGroupStyle.paddingInlineEnd : actionGroupStyle.paddingBlockEnd);
|
|
84
148
|
bufferSize += getStylePixelValue(layout === "horizontal" ? actionGroupStyle.borderInlineEndWidth : actionGroupStyle.borderBlockEndWidth);
|
|
85
149
|
}
|
|
86
150
|
});
|
|
87
151
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
152
|
+
const addWrappedSectionGap = (items, wrapper, hasExpandToggle) => {
|
|
153
|
+
if (!wrapper || items.length < 1) {
|
|
154
|
+
return;
|
|
91
155
|
}
|
|
156
|
+
const wrapperStyle = getComputedStyle(wrapper);
|
|
157
|
+
const wrapperGap = getStylePixelValue(wrapperStyle.gap);
|
|
158
|
+
const wrapperItemCount = items.length + (hasExpandToggle ? 1 : 0);
|
|
159
|
+
bufferSize += wrapperGap * Math.max(wrapperItemCount - 1, 0);
|
|
160
|
+
};
|
|
161
|
+
const hasExpandToggleAtStart = !expandToggleDisabled && expandPosition === "start";
|
|
162
|
+
const hasExpandToggleAtEnd = !expandToggleDisabled && expandPosition === "end";
|
|
163
|
+
addWrappedSectionGap(actionsStart, this.actionsStartGroupRef.value, hasExpandToggleAtStart);
|
|
164
|
+
addWrappedSectionGap(actionsEnd, this.actionsEndGroupRef.value, hasExpandToggleAtEnd);
|
|
165
|
+
if (visibleSectionCount > 1) {
|
|
166
|
+
bufferSize += getStylePixelValue(actionBarContainerStyle.gap) * (visibleSectionCount - 1);
|
|
92
167
|
}
|
|
93
168
|
const overflowCount = getOverflowCount({
|
|
94
169
|
bufferSize,
|
|
95
170
|
containerSize: layout === "horizontal" ? width : height,
|
|
96
171
|
itemSizes
|
|
97
172
|
});
|
|
98
|
-
|
|
99
|
-
actionGroups,
|
|
173
|
+
this.runOverflowActions({
|
|
174
|
+
actionGroups: slottedActionGroups,
|
|
100
175
|
expanded,
|
|
101
176
|
overflowCount
|
|
102
177
|
});
|
|
@@ -130,6 +205,8 @@ class ActionBar extends LitElement {
|
|
|
130
205
|
this.calciteActionBarExpand = createEvent({ cancelable: false });
|
|
131
206
|
this.calciteActionBarToggle = createEvent({ cancelable: false });
|
|
132
207
|
this.listen("calciteActionMenuOpen", this.actionMenuOpenHandler);
|
|
208
|
+
this.listen("calciteInternalActionGroupActionsChange", this.handleActionGroupActionsChange);
|
|
209
|
+
this.listen("calciteInternalActionMenuActionsChange", this.handleActionMenuActionsChange);
|
|
133
210
|
this.listen("keydown", this.handleKeyDown);
|
|
134
211
|
}
|
|
135
212
|
static {
|
|
@@ -158,10 +235,6 @@ class ActionBar extends LitElement {
|
|
|
158
235
|
}
|
|
159
236
|
connectedCallback() {
|
|
160
237
|
super.connectedCallback();
|
|
161
|
-
this.updateGroups();
|
|
162
|
-
this.overflowActions();
|
|
163
|
-
this.updateActions();
|
|
164
|
-
this.mutationObserver?.observe(this.el, { childList: true, subtree: true });
|
|
165
238
|
this.overflowActionsDisabledHandler(this.overflowActionsDisabled);
|
|
166
239
|
this.cancelable.add(this.resize);
|
|
167
240
|
}
|
|
@@ -188,16 +261,19 @@ class ActionBar extends LitElement {
|
|
|
188
261
|
}
|
|
189
262
|
}
|
|
190
263
|
loaded() {
|
|
264
|
+
this.syncDefaultSlot();
|
|
265
|
+
this.syncActionsStartSlot();
|
|
266
|
+
this.syncActionsEndSlot();
|
|
267
|
+
this.syncActionsState();
|
|
191
268
|
this.overflowActions();
|
|
192
269
|
}
|
|
193
270
|
disconnectedCallback() {
|
|
194
271
|
super.disconnectedCallback();
|
|
195
|
-
this.mutationObserver?.disconnect();
|
|
196
272
|
this.resizeObserver?.disconnect();
|
|
197
273
|
}
|
|
198
274
|
getItemSizes() {
|
|
199
|
-
const {
|
|
200
|
-
const actions =
|
|
275
|
+
const { layout, expandToggleEl } = this;
|
|
276
|
+
const actions = [...this.actions];
|
|
201
277
|
if (expandToggleEl) {
|
|
202
278
|
actions.push(expandToggleEl);
|
|
203
279
|
}
|
|
@@ -206,8 +282,7 @@ class ActionBar extends LitElement {
|
|
|
206
282
|
return actions.map((action) => action[clientSize] || fallbackSize);
|
|
207
283
|
}
|
|
208
284
|
expandedHandler() {
|
|
209
|
-
|
|
210
|
-
toggleChildActionText({ el, expanded });
|
|
285
|
+
this.syncActionsState(true);
|
|
211
286
|
this.overflowActions();
|
|
212
287
|
}
|
|
213
288
|
overflowActionsDisabledHandler(overflowActionsDisabled) {
|
|
@@ -219,60 +294,177 @@ class ActionBar extends LitElement {
|
|
|
219
294
|
this.overflowActions();
|
|
220
295
|
}
|
|
221
296
|
actionMenuOpenHandler(event) {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
group.menuOpen = false;
|
|
227
|
-
}
|
|
228
|
-
});
|
|
297
|
+
const composedPath = event.composedPath();
|
|
298
|
+
const source = composedPath.find((element) => isActionGroup(element) || isActionMenu(element));
|
|
299
|
+
if (!source) {
|
|
300
|
+
return;
|
|
229
301
|
}
|
|
302
|
+
if (isActionGroup(source) && !source.menuOpen || isActionMenu(source) && !source.open) {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
this.getTrackedActionGroups().forEach((group) => {
|
|
306
|
+
if (!composedPath.includes(group)) {
|
|
307
|
+
group.menuOpen = false;
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
this.getTrackedActionMenus().forEach((menu) => {
|
|
311
|
+
if (!composedPath.includes(menu)) {
|
|
312
|
+
menu.open = false;
|
|
313
|
+
}
|
|
314
|
+
});
|
|
230
315
|
}
|
|
231
|
-
|
|
232
|
-
this.
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
316
|
+
runOverflowActions({ actionGroups, expanded, overflowCount }) {
|
|
317
|
+
const overflowPassId = ++this.overflowPassId;
|
|
318
|
+
const slotStateByGroup = /* @__PURE__ */ new Map();
|
|
319
|
+
actionGroups.forEach((group) => {
|
|
320
|
+
const directActions = group.actions.filter((action) => action.parentElement === group);
|
|
321
|
+
slotStateByGroup.set(group, directActions.map((action) => action.slot ?? "").join("|"));
|
|
322
|
+
});
|
|
323
|
+
overflowActions({
|
|
324
|
+
actionGroups,
|
|
325
|
+
expanded,
|
|
326
|
+
overflowCount
|
|
327
|
+
});
|
|
328
|
+
actionGroups.forEach((group) => {
|
|
329
|
+
const directActions = group.actions.filter((action) => action.parentElement === group);
|
|
330
|
+
const nextSlotState = directActions.map((action) => action.slot ?? "").join("|");
|
|
331
|
+
if (slotStateByGroup.get(group) !== nextSlotState) {
|
|
332
|
+
this.suppressedActionGroupActionsChange.set(group, overflowPassId);
|
|
333
|
+
this.queueSuppressedActionGroupActionsChangeCleanup(group, overflowPassId);
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
queueSuppressedActionGroupActionsChangeCleanup(group, overflowPassId) {
|
|
338
|
+
queueMicrotask(() => {
|
|
339
|
+
if (this.suppressedActionGroupActionsChange.get(group) === overflowPassId) {
|
|
340
|
+
this.suppressedActionGroupActionsChange.delete(group);
|
|
341
|
+
}
|
|
342
|
+
});
|
|
236
343
|
}
|
|
237
344
|
resizeHandlerEntries(entries) {
|
|
238
345
|
entries.forEach(this.resizeHandler);
|
|
239
346
|
}
|
|
347
|
+
getSectionWrapperGroups() {
|
|
348
|
+
return [this.actionsStartGroupRef.value, this.actionsEndGroupRef.value].filter((group) => !!group);
|
|
349
|
+
}
|
|
240
350
|
updateGroups() {
|
|
241
|
-
const groups =
|
|
242
|
-
|
|
351
|
+
const groups = [
|
|
352
|
+
...this.actionGroups,
|
|
353
|
+
...this.actionsStartGroups,
|
|
354
|
+
...this.actionsEndGroups,
|
|
355
|
+
...this.getSectionWrapperGroups()
|
|
356
|
+
];
|
|
243
357
|
groups.forEach((group) => {
|
|
244
358
|
group.layout = this.layout;
|
|
245
359
|
group.scale = this.scale;
|
|
246
360
|
});
|
|
247
361
|
}
|
|
248
362
|
handleDefaultSlotChange() {
|
|
249
|
-
this.
|
|
250
|
-
this.queryAndStoreActions();
|
|
251
|
-
this.updateActions();
|
|
363
|
+
this.syncSlotAndActions(() => this.syncDefaultSlot());
|
|
252
364
|
}
|
|
253
|
-
handleActionsEndSlotChange(
|
|
254
|
-
this.
|
|
255
|
-
this.overflowActions();
|
|
365
|
+
handleActionsEndSlotChange() {
|
|
366
|
+
this.syncSlotAndActions(() => this.syncActionsEndSlot());
|
|
256
367
|
}
|
|
257
|
-
handleActionsStartSlotChange(
|
|
258
|
-
this.
|
|
259
|
-
this.overflowActions();
|
|
368
|
+
handleActionsStartSlotChange() {
|
|
369
|
+
this.syncSlotAndActions(() => this.syncActionsStartSlot());
|
|
260
370
|
}
|
|
261
371
|
handleTooltipSlotChange(event) {
|
|
262
372
|
const tooltips = slotChangeGetAssignedElements(event).filter((el) => el?.matches("calcite-tooltip"));
|
|
263
373
|
this.expandTooltip = tooltips[0];
|
|
264
374
|
}
|
|
265
375
|
updateActions() {
|
|
266
|
-
this.actions
|
|
376
|
+
const actions = new Set(this.actions);
|
|
377
|
+
this.getTrackedActionMenus().forEach((menu) => {
|
|
378
|
+
menu.actions.forEach((action) => actions.add(action));
|
|
379
|
+
});
|
|
380
|
+
actions.forEach((action) => {
|
|
267
381
|
action.selectionAppearance = this.selectionAppearance;
|
|
268
382
|
});
|
|
269
383
|
}
|
|
270
|
-
|
|
271
|
-
this.actions =
|
|
384
|
+
syncActions() {
|
|
385
|
+
this.actions = queryActions([
|
|
386
|
+
...this.actionsStart,
|
|
387
|
+
...this.defaultSlotItems,
|
|
388
|
+
...this.actionsEnd
|
|
389
|
+
]);
|
|
390
|
+
}
|
|
391
|
+
syncActionsAndOverflow() {
|
|
392
|
+
this.syncActionsState();
|
|
393
|
+
this.overflowActions();
|
|
394
|
+
}
|
|
395
|
+
syncSlotAndActions(syncSlot) {
|
|
396
|
+
syncSlot();
|
|
397
|
+
this.syncActionsAndOverflow();
|
|
398
|
+
}
|
|
399
|
+
syncActionsState(syncExpandedState = false) {
|
|
400
|
+
this.syncActions();
|
|
401
|
+
this.updateActions();
|
|
402
|
+
if (!syncExpandedState) {
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
toggleActionBarChildActionText({
|
|
406
|
+
actions: this.actions,
|
|
407
|
+
expandables: [
|
|
408
|
+
...this.getTrackedActionGroups(),
|
|
409
|
+
...this.getTrackedActionMenus(),
|
|
410
|
+
...this.getSectionWrapperGroups()
|
|
411
|
+
],
|
|
412
|
+
expanded: this.expanded
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
getTrackedActionGroups() {
|
|
416
|
+
return [...this.actionGroups, ...this.actionsStartGroups, ...this.actionsEndGroups];
|
|
417
|
+
}
|
|
418
|
+
getTrackedActionMenus() {
|
|
419
|
+
return [...this.actionMenus, ...this.actionsStart, ...this.actionsEnd].filter((item) => isActionMenu(item));
|
|
420
|
+
}
|
|
421
|
+
getAssignedActionBarItems(slot) {
|
|
422
|
+
if (!slot) {
|
|
423
|
+
return [];
|
|
424
|
+
}
|
|
425
|
+
return getSlotAssignedElements(slot).filter((element) => isAction(element) || isActionGroup(element) || isActionMenu(element));
|
|
426
|
+
}
|
|
427
|
+
syncDefaultSlot() {
|
|
428
|
+
this.defaultSlotItems = this.getAssignedActionBarItems(this.defaultSlotRef.value);
|
|
429
|
+
this.actionGroups = this.defaultSlotItems.filter((item) => isActionGroup(item));
|
|
430
|
+
this.actionMenus = this.defaultSlotItems.filter((item) => isActionMenu(item));
|
|
431
|
+
this.updateGroups();
|
|
432
|
+
}
|
|
433
|
+
syncActionsStartSlot() {
|
|
434
|
+
this.actionsStart = this.getAssignedActionBarItems(this.actionsStartSlotRef.value);
|
|
435
|
+
this.actionsStartGroups = this.actionsStart.filter((item) => isActionGroup(item));
|
|
436
|
+
this.hasActionsStart = this.actionsStart.length > 0;
|
|
437
|
+
this.updateGroups();
|
|
438
|
+
}
|
|
439
|
+
syncActionsEndSlot() {
|
|
440
|
+
this.actionsEnd = this.getAssignedActionBarItems(this.actionsEndSlotRef.value);
|
|
441
|
+
this.actionsEndGroups = this.actionsEnd.filter((item) => isActionGroup(item));
|
|
442
|
+
this.hasActionsEnd = this.actionsEnd.length > 0;
|
|
443
|
+
this.updateGroups();
|
|
444
|
+
}
|
|
445
|
+
handleActionGroupActionsChange(event) {
|
|
446
|
+
const group = event.target;
|
|
447
|
+
const trackedGroups = this.getTrackedActionGroups();
|
|
448
|
+
if (!trackedGroups.includes(group)) {
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
if (this.suppressedActionGroupActionsChange.has(group)) {
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
this.syncActionsAndOverflow();
|
|
455
|
+
}
|
|
456
|
+
handleActionMenuActionsChange(event) {
|
|
457
|
+
const menu = event.target;
|
|
458
|
+
if (!this.getTrackedActionMenus().includes(menu)) {
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
this.syncActionsAndOverflow();
|
|
462
|
+
}
|
|
463
|
+
getNavigableActions() {
|
|
464
|
+
return this.actions.filter((action) => !action.disabled && action.slot !== SLOTS$1.menuActions);
|
|
272
465
|
}
|
|
273
466
|
handleKeyDown(event) {
|
|
274
|
-
this.
|
|
275
|
-
const actions = this.actions.filter((action) => !action.disabled);
|
|
467
|
+
const actions = this.getNavigableActions();
|
|
276
468
|
const current = document.activeElement;
|
|
277
469
|
if (!isAction(current) || !actions.includes(current)) {
|
|
278
470
|
return;
|
|
@@ -322,15 +514,20 @@ class ActionBar extends LitElement {
|
|
|
322
514
|
const { expandToggleDisabled, scale, layout, overlayPositioning, expandPosition } = this;
|
|
323
515
|
const isStart = position === "start";
|
|
324
516
|
const hasExpandToggle = !expandToggleDisabled && expandPosition === position;
|
|
517
|
+
const hasActions = isStart ? this.hasActionsStart : this.hasActionsEnd;
|
|
325
518
|
const slotName = isStart ? SLOTS.actionsStart : SLOTS.actionsEnd;
|
|
326
519
|
const onSlotChange = isStart ? this.handleActionsStartSlotChange : this.handleActionsEndSlotChange;
|
|
327
520
|
const label = isStart ? this.actionsStartGroupLabel : this.actionsEndGroupLabel;
|
|
328
|
-
const hidden = !hasExpandToggle && !
|
|
521
|
+
const hidden = !hasExpandToggle && !hasActions;
|
|
329
522
|
const className = isStart ? CSS.actionGroupStart : CSS.actionGroupEnd;
|
|
330
|
-
|
|
523
|
+
const actionGroupRef = isStart ? this.actionsStartGroupRef : this.actionsEndGroupRef;
|
|
524
|
+
const slotRef = isStart ? this.actionsStartSlotRef : this.actionsEndSlotRef;
|
|
525
|
+
const expandToggle = hasExpandToggle ? this.renderExpandToggle() : null;
|
|
526
|
+
return html`<calcite-action-group class=${safeClassMap(className)} .hidden=${hidden} .label=${label} .layout=${layout} .overlayPositioning=${overlayPositioning} .scale=${scale} ${ref(actionGroupRef)}>${isStart ? expandToggle : null}<slot name=${slotName ?? nothing} @slotchange=${onSlotChange} ${ref(slotRef)}></slot>${hasExpandToggle ? this.renderExpandTooltipSlot() : null}${isStart ? null : expandToggle}</calcite-action-group>`;
|
|
331
527
|
}
|
|
332
528
|
render() {
|
|
333
|
-
|
|
529
|
+
const ariaOrientation = this.layout === "horizontal" ? "horizontal" : "vertical";
|
|
530
|
+
return html`<div .ariaOrientation=${ariaOrientation} class=${safeClassMap(CSS.container)} role=toolbar ${ref(this.containerRef)}>${this.renderActionsGroup("start")}<slot @slotchange=${this.handleDefaultSlotChange} ${ref(this.defaultSlotRef)}></slot>${this.renderActionsGroup("end")}</div>`;
|
|
334
531
|
}
|
|
335
532
|
}
|
|
336
533
|
customElement("calcite-action-bar", ActionBar);
|
|
@@ -15,6 +15,12 @@ import type { Columns } from "./interfaces.js";
|
|
|
15
15
|
* @slot [menu-tooltip] - A slot for adding a `calcite-tooltip` for the menu.
|
|
16
16
|
*/
|
|
17
17
|
export abstract class ActionGroup extends LitElement {
|
|
18
|
+
/**
|
|
19
|
+
* Specifies the `calcite-action`s in the group.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
get actions(): Action[];
|
|
18
24
|
/** Specifies the number of columns. */
|
|
19
25
|
accessor columns: Columns | undefined;
|
|
20
26
|
/**
|
|
@@ -42,7 +48,11 @@ export abstract class ActionGroup extends LitElement {
|
|
|
42
48
|
accessor menuOpen: boolean;
|
|
43
49
|
/** Specifies the position of the action menu. */
|
|
44
50
|
accessor menuPlacement: LogicalPlacement | undefined;
|
|
45
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Replace localized message strings with your own strings.
|
|
53
|
+
*
|
|
54
|
+
* _**Note**: Individual message keys may change between releases._
|
|
55
|
+
*/
|
|
46
56
|
accessor messageOverrides: { more?: string | undefined; };
|
|
47
57
|
/**
|
|
48
58
|
* When `true`, the component's actions will not be overflowed into a menu by a parent `calcite-action-bar`.
|
|
@@ -102,9 +112,12 @@ export abstract class ActionGroup extends LitElement {
|
|
|
102
112
|
readonly calciteActionGroupCollapse: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
103
113
|
/** Fires when the component's content area is expanded. */
|
|
104
114
|
readonly calciteActionGroupExpand: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
115
|
+
/** Fires after the component's slotted `calcite-action`s change. */
|
|
116
|
+
readonly calciteInternalActionGroupActionsChange: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
105
117
|
readonly "@eventTypes": {
|
|
106
118
|
calciteActionGroupChange: ActionGroup["calciteActionGroupChange"]["detail"];
|
|
107
119
|
calciteActionGroupCollapse: ActionGroup["calciteActionGroupCollapse"]["detail"];
|
|
108
120
|
calciteActionGroupExpand: ActionGroup["calciteActionGroupExpand"]["detail"];
|
|
121
|
+
calciteInternalActionGroupActionsChange: ActionGroup["calciteInternalActionGroupActionsChange"]["detail"];
|
|
109
122
|
};
|
|
110
123
|
}
|