@esri/calcite-components 6.0.0-next.31 → 6.0.0-next.33

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.
Files changed (160) hide show
  1. package/dist/cdn/{BUBXZ5WE.js → 2VWNFQUM.js} +1 -1
  2. package/dist/cdn/{WNN5TCEM.js → 2XRRZZNX.js} +1 -1
  3. package/dist/cdn/{LTCHWQR3.js → 2ZFHNAXZ.js} +1 -1
  4. package/dist/cdn/{LPFCI2JS.js → 35NRDMCX.js} +1 -1
  5. package/dist/cdn/{NS2YZ7ZI.js → 3C2HB7CY.js} +1 -1
  6. package/dist/cdn/{2O65CGCA.js → 3C3TBDGV.js} +1 -1
  7. package/dist/cdn/3EPPXFMX.js +2 -0
  8. package/dist/cdn/{WTEHIDO5.js → 3NPDLRO4.js} +1 -1
  9. package/dist/cdn/{N5NQSH22.js → 4FC6ZNYV.js} +1 -1
  10. package/dist/cdn/{ZTGJZPSH.js → 56F7DPON.js} +1 -1
  11. package/dist/cdn/{K7TEHKIB.js → 57JJ6ZZV.js} +1 -1
  12. package/dist/cdn/{FO6LYZW4.js → 5AWH7Z3B.js} +1 -1
  13. package/dist/cdn/{AKVVCXG3.js → 5BMXXMRC.js} +1 -1
  14. package/dist/cdn/{SOPFB2NB.js → 5GSCFOQS.js} +1 -1
  15. package/dist/cdn/{RGWCUF5I.js → 5KQ2IA3C.js} +1 -1
  16. package/dist/cdn/{JTOHE7CS.js → 5MKSLN45.js} +1 -1
  17. package/dist/cdn/{MS4WXMPW.js → 5RMWMCMK.js} +1 -1
  18. package/dist/cdn/{7IUJS4P4.js → 5SDMSGT3.js} +1 -1
  19. package/dist/cdn/{F7HJ5PLB.js → 5VP66O25.js} +1 -1
  20. package/dist/cdn/{KAS7QQXU.js → 66765WFJ.js} +1 -1
  21. package/dist/cdn/{EMABUCCR.js → 6HLLKG6Y.js} +1 -1
  22. package/dist/cdn/{XI3MOZK5.js → 6IEIN32F.js} +1 -1
  23. package/dist/cdn/{XDMYEBJH.js → 6KXXZDEC.js} +1 -1
  24. package/dist/cdn/{BATSHTK3.js → 6PIQA36G.js} +1 -1
  25. package/dist/cdn/{GMTYKXXG.js → 7FSMYW6V.js} +1 -1
  26. package/dist/cdn/{G3JKDGAW.js → 7JK6M2KQ.js} +1 -1
  27. package/dist/cdn/{XLKXI7LP.js → 7OQZCK5X.js} +1 -1
  28. package/dist/cdn/{UULWUEQO.js → A5MXGGUV.js} +1 -1
  29. package/dist/cdn/{ULJ4L2ON.js → AB6P7MSJ.js} +1 -1
  30. package/dist/cdn/{T5PNTRK7.js → AELAOQDK.js} +1 -1
  31. package/dist/cdn/{KMFBNSRF.js → AMWDZTHP.js} +1 -1
  32. package/dist/cdn/{EYH7MGST.js → B22C5ARQ.js} +1 -1
  33. package/dist/cdn/{GLTFFYAP.js → B4DKARFC.js} +1 -1
  34. package/dist/cdn/{HR7CYYBZ.js → BOSX3N3S.js} +1 -1
  35. package/dist/cdn/{2BYBUUJF.js → BPQQK2PE.js} +1 -1
  36. package/dist/cdn/{EFVTVOOR.js → BQNZBFBZ.js} +1 -1
  37. package/dist/cdn/{V6ZZ4RBL.js → BVWV6V6T.js} +1 -1
  38. package/dist/cdn/{HQQWVRW3.js → C2FSRNVO.js} +1 -1
  39. package/dist/cdn/{PV5DG5LX.js → C55GX5QU.js} +1 -1
  40. package/dist/cdn/{2PG2X6DW.js → C5KJFCKP.js} +1 -1
  41. package/dist/cdn/{SEJ76OVQ.js → CCKBSHLN.js} +1 -1
  42. package/dist/cdn/{SSGWU6YZ.js → CEKDUGEY.js} +1 -1
  43. package/dist/cdn/{53PS6CZL.js → CSEZ4GFT.js} +1 -1
  44. package/dist/cdn/{YCD5ER2N.js → DFOFJ7ZA.js} +1 -1
  45. package/dist/cdn/{C5EVZQH3.js → DQWHY52J.js} +1 -1
  46. package/dist/cdn/{QGSJUTCP.js → DR5Y35HC.js} +1 -1
  47. package/dist/cdn/{EP5LLXX4.js → DUP7FV32.js} +1 -1
  48. package/dist/cdn/{CIDG2F5F.js → ECCTAVBE.js} +1 -1
  49. package/dist/cdn/{DJCCMQ2L.js → ECMMT2MZ.js} +1 -1
  50. package/dist/cdn/{25WQLNNW.js → EDGTAZ5W.js} +1 -1
  51. package/dist/cdn/{AHYVL5HV.js → EK4CLXUZ.js} +1 -1
  52. package/dist/cdn/{KHF466WZ.js → FF5B7ZTI.js} +1 -1
  53. package/dist/cdn/{LCHQJ4MQ.js → FY4M2W2D.js} +1 -1
  54. package/dist/cdn/{CZU7XPPT.js → G7HEA6KZ.js} +1 -1
  55. package/dist/cdn/{TUD6L36C.js → GFUEZCFE.js} +1 -1
  56. package/dist/cdn/{OIJRWX3U.js → GIQ6J25X.js} +1 -1
  57. package/dist/cdn/{WZGQOKQU.js → GKTW7VMU.js} +1 -1
  58. package/dist/cdn/{EFVN7U3F.js → GQHLEO5S.js} +1 -1
  59. package/dist/cdn/{UWKNJTTT.js → HCCYK35J.js} +1 -1
  60. package/dist/cdn/{XVMK63KW.js → HCZQ3TCB.js} +1 -1
  61. package/dist/cdn/{LM44Z2YW.js → HMTZ2NNR.js} +1 -1
  62. package/dist/cdn/{52AJ3HED.js → HP327QNA.js} +1 -1
  63. package/dist/cdn/{774WPE36.js → HPGYEYX3.js} +1 -1
  64. package/dist/cdn/{LAZHNUYQ.js → I23IFMUU.js} +1 -1
  65. package/dist/cdn/{5RKUA7QO.js → IKS2OZTW.js} +1 -1
  66. package/dist/cdn/{DXQRUUGW.js → IYH3JXKS.js} +1 -1
  67. package/dist/cdn/{V3W7VRT4.js → J66LFDMN.js} +1 -1
  68. package/dist/cdn/{KN7MRVRI.js → JAZY6WI5.js} +1 -1
  69. package/dist/cdn/{VCIEHQQW.js → JB42MFYM.js} +1 -1
  70. package/dist/cdn/{AHRDMPHO.js → JIZAOJJY.js} +1 -1
  71. package/dist/cdn/JKD2MQOI.js +2 -0
  72. package/dist/cdn/{ZFFJ2OIF.js → JLHY2463.js} +1 -1
  73. package/dist/cdn/{QBSBGSTD.js → JVJOB75Y.js} +1 -1
  74. package/dist/cdn/{POITAP34.js → JZTVLSQS.js} +1 -1
  75. package/dist/cdn/{FU6NA7PB.js → K2BXNIQO.js} +1 -1
  76. package/dist/cdn/{R7E74QWO.js → KCKCV752.js} +1 -1
  77. package/dist/cdn/{TIWFUW3J.js → KP3LS4UE.js} +1 -1
  78. package/dist/cdn/{CXUJ6D3S.js → KWAIBA22.js} +1 -1
  79. package/dist/cdn/{OEIKIW4U.js → KXEAX4VX.js} +1 -1
  80. package/dist/cdn/{KTKKXZXY.js → KYLAU6IL.js} +1 -1
  81. package/dist/cdn/{N4QWOISQ.js → L2RFAHN5.js} +1 -1
  82. package/dist/cdn/{FXXU75VF.js → LAAL7KCJ.js} +1 -1
  83. package/dist/cdn/{Q7RZISPL.js → LAJTPUC3.js} +1 -1
  84. package/dist/cdn/{FV4TNNCF.js → LUBZNR4Y.js} +1 -1
  85. package/dist/cdn/{GBMQJT6W.js → MCYGB35M.js} +1 -1
  86. package/dist/cdn/{V6RZQJXC.js → MGGEICJM.js} +1 -1
  87. package/dist/cdn/{TMVYXUZN.js → N72FKUWM.js} +1 -1
  88. package/dist/cdn/{H4NA2INQ.js → NEVU5H6J.js} +1 -1
  89. package/dist/cdn/{VXLGWACB.js → NIDV4UEV.js} +1 -1
  90. package/dist/cdn/{E3CDXWJK.js → NL4MR6BH.js} +1 -1
  91. package/dist/cdn/{T4NYST7K.js → NQUV4A65.js} +1 -1
  92. package/dist/cdn/{EF3BUYJC.js → O3DJRND5.js} +1 -1
  93. package/dist/cdn/{YYI5VFC7.js → OCSQ2II3.js} +1 -1
  94. package/dist/cdn/{KXIZ5KRA.js → OIIPFKBZ.js} +1 -1
  95. package/dist/cdn/{3WAZATDE.js → OTDNC5KR.js} +1 -1
  96. package/dist/cdn/{OQP252UQ.js → OUJAE5RB.js} +1 -1
  97. package/dist/cdn/{HXCRPQGA.js → OWKELGVS.js} +1 -1
  98. package/dist/cdn/{YECKA2ZW.js → OWPXECEC.js} +1 -1
  99. package/dist/cdn/{NCFAPNW4.js → PAFJUPOZ.js} +1 -1
  100. package/dist/cdn/{VMYCDZD2.js → PHU2JCF5.js} +1 -1
  101. package/dist/cdn/{RF2ESZNB.js → PUHGVOYL.js} +1 -1
  102. package/dist/cdn/{BM7PKQEE.js → QJTUTYOH.js} +1 -1
  103. package/dist/cdn/{WVVMKG5N.js → QNAZ4SXK.js} +1 -1
  104. package/dist/cdn/{FAF6XJO6.js → QRHJ2A57.js} +1 -1
  105. package/dist/cdn/{UJXLCRG2.js → QVPPJ5MH.js} +1 -1
  106. package/dist/cdn/{XYJCBX3I.js → RIW4G62N.js} +1 -1
  107. package/dist/cdn/{OMJJIWNI.js → RMYMCVZL.js} +1 -1
  108. package/dist/cdn/{OYMO3TIV.js → SGA27RSE.js} +1 -1
  109. package/dist/cdn/{L3RIQALN.js → SOZY3VOT.js} +1 -1
  110. package/dist/cdn/{DZM2S6KB.js → T7QXXMRX.js} +1 -1
  111. package/dist/cdn/{JJPEDAA2.js → TD6RR4II.js} +1 -1
  112. package/dist/cdn/{FLIAG56H.js → TF4USKPA.js} +1 -1
  113. package/dist/cdn/{FNAH6NQG.js → TNH3QVHR.js} +1 -1
  114. package/dist/cdn/{W4TLBDYL.js → TOZDS6EO.js} +1 -1
  115. package/dist/cdn/{PRQAWGWH.js → TTODQJRR.js} +1 -1
  116. package/dist/cdn/{3KAWJG7J.js → TV44WGYF.js} +1 -1
  117. package/dist/cdn/{7JBKIZBM.js → UCPJI7AH.js} +1 -1
  118. package/dist/cdn/{54G7DTNB.js → UEZ5DNUC.js} +1 -1
  119. package/dist/cdn/{XHPNS5U2.js → UWG3CQLP.js} +1 -1
  120. package/dist/cdn/{RSWSHTGM.js → UXUBLL7B.js} +1 -1
  121. package/dist/cdn/{RSRFMRYY.js → V5EGTCRW.js} +1 -1
  122. package/dist/cdn/{R76EDXIV.js → VAF5ZWJY.js} +1 -1
  123. package/dist/cdn/{I2JJAFXF.js → VBKFLHXE.js} +1 -1
  124. package/dist/cdn/{PYIK4KHH.js → VEHPEKTJ.js} +1 -1
  125. package/dist/cdn/{SKAFRDJU.js → VPNZVJUQ.js} +1 -1
  126. package/dist/cdn/{VJU4EZTG.js → VQDYKKWG.js} +1 -1
  127. package/dist/cdn/{B3TPMDTI.js → VQISU4CH.js} +1 -1
  128. package/dist/cdn/{ZLB7L4F5.js → VWKMABNH.js} +1 -1
  129. package/dist/cdn/{VEHHJZNU.js → W3HWQYI4.js} +1 -1
  130. package/dist/cdn/{KTAZO6DU.js → WBV45A6Q.js} +1 -1
  131. package/dist/cdn/WSJYVPSL.js +2 -0
  132. package/dist/cdn/{UMVVW22N.js → X2IH4REQ.js} +1 -1
  133. package/dist/cdn/{6WV3KNMZ.js → XUBVPXWY.js} +1 -1
  134. package/dist/cdn/{Z3RAOXLB.js → YAZJPF5S.js} +1 -1
  135. package/dist/cdn/{LWFSZPRR.js → YCXXUZSU.js} +1 -1
  136. package/dist/cdn/{2EICVMIF.js → ZAL3DHIT.js} +1 -1
  137. package/dist/cdn/{LZ6OR7RA.js → ZM6DBYIT.js} +1 -1
  138. package/dist/cdn/index.js +1 -1
  139. package/dist/chunks/runtime.js +4 -4
  140. package/dist/components/calcite-action/customElement.d.ts +1 -1
  141. package/dist/components/calcite-action/customElement.js +3 -4
  142. package/dist/components/calcite-action-bar/customElement.js +371 -31
  143. package/dist/components/calcite-action-group/customElement.d.ts +7 -0
  144. package/dist/components/calcite-action-group/customElement.js +57 -27
  145. package/dist/components/calcite-action-menu/customElement.js +214 -55
  146. package/dist/components/calcite-link/customElement.d.ts +5 -1
  147. package/dist/components/calcite-link/customElement.js +2 -2
  148. package/dist/docs/api.json +1 -1
  149. package/dist/docs/docs.json +1 -1
  150. package/dist/docs/vscode.html-custom-data.json +1 -1
  151. package/dist/docs/web-types.json +1 -1
  152. package/dist/loader.js +3 -3
  153. package/dist/types/lumina.d.ts +2 -2
  154. package/dist/types/preact.d.ts +2 -2
  155. package/dist/types/react.d.ts +2 -2
  156. package/dist/types/stencil.d.ts +2 -2
  157. package/package.json +1 -1
  158. package/dist/cdn/3DV2QFJM.js +0 -2
  159. package/dist/cdn/MHP4C6M5.js +0 -2
  160. package/dist/cdn/YRWU2UTQ.js +0 -2
@@ -18,12 +18,16 @@ class ActionGroup extends LitElement {
18
18
  this.focusSetter = useFocusable()(this).setFocus;
19
19
  this.defaultSlotRef = createRef();
20
20
  this.menuActionsSlotRef = createRef();
21
+ this.menuActions = [];
22
+ this.setActionMenuEl = (actionMenu) => {
23
+ this.actionMenu = actionMenu;
24
+ };
25
+ this._overflowActionsDisabled = false;
21
26
  this.hasMenuActions = false;
22
27
  this.expanded = false;
23
28
  this.layout = "vertical";
24
29
  this.menuOpen = false;
25
30
  this.overlayPositioning = "absolute";
26
- this.overflowActionsDisabled = false;
27
31
  this.scale = "m";
28
32
  this.selectionMode = "none";
29
33
  this.topLayerDisabled = false;
@@ -35,7 +39,7 @@ class ActionGroup extends LitElement {
35
39
  this.listen("click", this.handleActionClick);
36
40
  }
37
41
  static {
38
- this.properties = { hasMenuActions: [16, {}, { state: true }], columns: [11, {}, { type: Number, reflect: true }], expanded: [7, {}, { reflect: true, type: Boolean }], label: 1, layout: [3, {}, { reflect: true }], menuFlipPlacements: [0, {}, { attribute: false }], menuOpen: [7, {}, { reflect: true, type: Boolean }], menuPlacement: [3, {}, { reflect: true }], messageOverrides: [0, {}, { attribute: false }], overlayPositioning: [3, {}, { reflect: true }], overflowActionsDisabled: [7, {}, { reflect: true, type: Boolean }], scale: [3, {}, { reflect: true }], selectionMode: [3, {}, { reflect: true }], topLayerDisabled: [7, {}, { reflect: true, type: Boolean }], actions: [32, {}, { attribute: false, readOnly: true }], selectedActions: [0, {}, { attribute: false }] };
42
+ this.properties = { hasMenuActions: [16, {}, { state: true }], columns: [11, {}, { type: Number, reflect: true }], expanded: [7, {}, { reflect: true, type: Boolean }], label: 1, layout: [3, {}, { reflect: true }], menuFlipPlacements: [0, {}, { attribute: false }], menuOpen: [7, {}, { reflect: true, type: Boolean }], menuPlacement: [3, {}, { reflect: true }], messageOverrides: [0, {}, { attribute: false }], overlayPositioning: [3, {}, { reflect: true }], overflowActionsDisabled: [7, {}, { reflect: true, type: Boolean }], scale: [3, {}, { reflect: true }], selectionMode: [3, {}, { reflect: true }], topLayerDisabled: [7, {}, { reflect: true, type: Boolean }], actions: [32, {}, { attribute: false, readOnly: true }], actionMenu: [0, {}, { attribute: false }], selectedActions: [0, {}, { attribute: false }] };
39
43
  }
40
44
  static {
41
45
  this.shadowRootOptions = { mode: "open", delegatesFocus: true };
@@ -43,6 +47,13 @@ class ActionGroup extends LitElement {
43
47
  static {
44
48
  this.styles = styles;
45
49
  }
50
+ get overflowActionsDisabled() {
51
+ const selectionMode = this.selectionMode || "none";
52
+ return selectionMode === "none" ? this._overflowActionsDisabled : true;
53
+ }
54
+ set overflowActionsDisabled(value) {
55
+ this._overflowActionsDisabled = value;
56
+ }
46
57
  get actions() {
47
58
  return this._actions;
48
59
  }
@@ -66,44 +77,55 @@ class ActionGroup extends LitElement {
66
77
  }
67
78
  }
68
79
  }
80
+ updated(changes) {
81
+ if (changes.get("selectionMode") !== void 0) {
82
+ void this.updateComplete.then(() => this.calciteInternalActionGroupActionsChange.emit());
83
+ }
84
+ }
69
85
  setActiveAction(index, active) {
70
- const nextActive = !active.active;
71
- switch (this.selectionMode) {
72
- case "multiple":
73
- this.updateAction(active, nextActive);
74
- break;
75
- case "single":
76
- this.actions.forEach((action, i) => this.updateAction(action, i === index && nextActive));
77
- break;
78
- case "single-persist":
79
- if (!this.actions[index].active) {
80
- this.actions.forEach((action, i) => this.updateAction(action, i === index));
81
- this.updateSelectedActions([active]);
82
- this.calciteActionGroupChange.emit();
83
- }
84
- return;
85
- default:
86
- return;
86
+ const actions = this.getSelectableActions();
87
+ if (this.selectionMode === "multiple") {
88
+ const nextActive = !active.active;
89
+ this.updateAction(active, nextActive);
90
+ this.updateSelectedActions(actions.filter((action) => action.active));
91
+ this.calciteActionGroupChange.emit();
92
+ return;
87
93
  }
88
- this.updateSelectedActions(this.actions.filter((action) => action.active));
94
+ if (this.selectionMode === "single") {
95
+ const nextActive = !active.active;
96
+ actions.forEach((action, i) => this.updateAction(action, i === index && nextActive));
97
+ this.updateSelectedActions(actions.filter((action) => action.active));
98
+ this.calciteActionGroupChange.emit();
99
+ return;
100
+ }
101
+ if (this.selectionMode === "single-persist") {
102
+ if (!actions[index].active) {
103
+ actions.forEach((action, i) => this.updateAction(action, i === index));
104
+ this.updateSelectedActions([active]);
105
+ this.calciteActionGroupChange.emit();
106
+ }
107
+ return;
108
+ }
109
+ this.updateSelectedActions(actions.filter((action) => action.active));
89
110
  this.calciteActionGroupChange.emit();
90
111
  }
91
112
  setMenuOpen(event) {
92
113
  this.menuOpen = !!event.currentTarget.open;
93
114
  }
94
115
  syncSelectionState() {
116
+ const selectableActions = this.getSelectableActions();
95
117
  if (this.selectionMode !== "none") {
96
118
  this.setRoleOnActions();
97
119
  } else {
98
120
  this.clearActionAriaAttributes();
99
121
  }
100
122
  if (this.selectionMode === "single" || this.selectionMode === "single-persist") {
101
- const selected = this.actions.filter((action) => action.active);
123
+ const selected = selectableActions.filter((action) => action.active);
102
124
  if (selected.length > 1) {
103
- this.actions.forEach((action) => this.updateAction(action, action === selected.at(-1)));
125
+ selectableActions.forEach((action) => this.updateAction(action, action === selected.at(-1)));
104
126
  }
105
127
  }
106
- this.updateSelectedActions(this.selectionMode === "none" ? [] : this.actions.filter((action) => action.active));
128
+ this.updateSelectedActions(this.selectionMode === "none" ? [] : selectableActions.filter((action) => action.active));
107
129
  }
108
130
  syncActions() {
109
131
  const defaultActions = this.defaultSlotRef.value ? getSlotAssignedElements(this.defaultSlotRef.value, "calcite-action") : [];
@@ -119,6 +141,8 @@ class ActionGroup extends LitElement {
119
141
  this.syncActionsAndEmitChange();
120
142
  }
121
143
  handleMenuActionsSlotChange(event) {
144
+ const menuActions = event.target.assignedElements({ flatten: true }).filter((el) => isAction(el));
145
+ this.menuActions = menuActions;
122
146
  this.hasMenuActions = slotChangeHasAssignedElement(event);
123
147
  this.syncActionsAndEmitChange();
124
148
  }
@@ -127,14 +151,17 @@ class ActionGroup extends LitElement {
127
151
  if (!target || target.disabled) {
128
152
  return;
129
153
  }
130
- const index = this.actions.indexOf(target);
154
+ if (this.menuActions.includes(target)) {
155
+ return;
156
+ }
157
+ const index = this.getSelectableActions().indexOf(target);
131
158
  if (index === -1 || this.selectionMode === "none") {
132
159
  return;
133
160
  }
134
161
  this.setActiveAction(index, target);
135
162
  }
136
163
  setRoleOnActions() {
137
- this.actions.forEach((action) => {
164
+ this.getSelectableActions().forEach((action) => {
138
165
  action.aria = {
139
166
  ...action.aria,
140
167
  role: this.selectionMode === "single" || this.selectionMode === "single-persist" ? "radio" : "checkbox"
@@ -142,6 +169,9 @@ class ActionGroup extends LitElement {
142
169
  this.setActionAriaChecked(action, action.active);
143
170
  });
144
171
  }
172
+ getSelectableActions() {
173
+ return this.actions.filter((action) => !this.menuActions.includes(action));
174
+ }
145
175
  setActionAriaChecked(action, checked) {
146
176
  action.aria = {
147
177
  ...action.aria,
@@ -150,7 +180,7 @@ class ActionGroup extends LitElement {
150
180
  }
151
181
  clearActionAriaAttributes() {
152
182
  if (this.selectionMode === "none") {
153
- this.actions.forEach((action) => {
183
+ this.getSelectableActions().forEach((action) => {
154
184
  if (action.aria) {
155
185
  action.aria.checked = void 0;
156
186
  action.aria.role = void 0;
@@ -175,7 +205,7 @@ class ActionGroup extends LitElement {
175
205
  }
176
206
  renderMenu() {
177
207
  const { expanded, menuOpen, scale, layout, messages, overlayPositioning, hasMenuActions, menuFlipPlacements, menuPlacement } = this;
178
- return html`<calcite-action-menu .expanded=${expanded} .flipPlacements=${menuFlipPlacements ?? (layout === "horizontal" ? ["top", "bottom"] : ["left", "right"])} .hidden=${!hasMenuActions} .label=${messages.more} @calciteActionMenuOpen=${this.setMenuOpen} .open=${menuOpen} .overlayPositioning=${overlayPositioning} .placement=${menuPlacement ?? (layout === "horizontal" ? "bottom-start" : "leading-start")} .scale=${scale} .topLayerDisabled=${this.topLayerDisabled}><calcite-action .aria=${{ expanded }} .icon=${ICONS.menu} .scale=${scale} slot=${SLOTS.trigger} .text=${messages.more} .textEnabled=${expanded}></calcite-action><slot name=${SLOTS$1.menuActions} @slotchange=${this.handleMenuActionsSlotChange} ${ref(this.menuActionsSlotRef)}></slot><slot name=${SLOTS$1.menuTooltip} slot=${SLOTS.tooltip}></slot></calcite-action-menu>`;
208
+ return html`<calcite-action-menu .expanded=${expanded} .flipPlacements=${menuFlipPlacements ?? (layout === "horizontal" ? ["top", "bottom"] : ["left", "right"])} .hidden=${!hasMenuActions} .label=${messages.more} @calciteActionMenuOpen=${this.setMenuOpen} .open=${menuOpen} .overlayPositioning=${overlayPositioning} .placement=${menuPlacement ?? (layout === "horizontal" ? "bottom-start" : "leading-start")} .scale=${scale} .topLayerDisabled=${this.topLayerDisabled} ${ref(this.setActionMenuEl)}><calcite-action .aria=${{ expanded: menuOpen, hasPopup: "menu" }} .icon=${ICONS.menu} .scale=${scale} slot=${SLOTS.trigger} .text=${messages.more} .textEnabled=${expanded}></calcite-action><slot name=${SLOTS$1.menuActions} @slotchange=${this.handleMenuActionsSlotChange} ${ref(this.menuActionsSlotRef)}></slot><slot name=${SLOTS$1.menuTooltip} slot=${SLOTS.tooltip}></slot></calcite-action-menu>`;
179
209
  }
180
210
  render() {
181
211
  return html`<div .ariaLabel=${this.label} class=${safeClassMap(CSS.container)} .role=${this.selectionMode === "multiple" || this.selectionMode === "none" ? "group" : "radiogroup"}><slot @slotchange=${this.handleDefaultSlotChange} ${ref(this.defaultSlotRef)}></slot>${this.renderMenu()}</div>`;
@@ -4,17 +4,21 @@ import { css, html, nothing } from "lit";
4
4
  import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
5
5
  import { createRef, ref } from "lit/directives/ref.js";
6
6
  import { g as getRoundRobinIndex } from "../../chunks/array.js";
7
- import { t as toAriaBoolean } from "../../chunks/aria.js";
8
7
  import { b as getSlotAssignedElements } from "../../chunks/dom.js";
9
8
  import { g as guid } from "../../chunks/guid.js";
10
- import { i as isActivationKey } from "../../chunks/key.js";
11
9
  import { i as isAction } from "../../chunks/resources3.js";
12
- import { i as isActionGroup } from "../../chunks/resources.js";
10
+ import { i as isActionGroup, S as SLOTS } from "../../chunks/resources.js";
11
+ import { i as isActionBar } from "../../chunks/resources12.js";
13
12
  import { i as isTooltip } from "../../chunks/resources10.js";
14
13
  import { u as useFocusable } from "../../chunks/useFocusable.js";
15
- import { I as IDS, C as CSS, S as SLOTS, a as ICONS } from "../../chunks/resources11.js";
14
+ import { I as IDS, C as CSS, S as SLOTS$1, a as ICONS } from "../../chunks/resources11.js";
16
15
  const styles = css`:host([scale=s]){--calcite-internal-action-menu-gap: var( --calcite-action-menu-items-space, var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs)) );--calcite-internal-action-menu-padding: var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs))}:host([scale=m]){--calcite-internal-action-menu-gap: var( --calcite-action-menu-items-space, var(--calcite-theme-space-sm, var(--calcite-spacing-sm)) );--calcite-internal-action-menu-padding: var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=l]){--calcite-internal-action-menu-gap: var( --calcite-action-menu-items-space, var(--calcite-theme-space-sm-plus, var(--calcite-spacing-sm-plus)) );--calcite-internal-action-menu-padding: var(--calcite-theme-space-sm-plus, var(--calcite-spacing-sm-plus))}:host{font-size:var(--calcite-font-size-relative-lg);box-sizing:border-box;display:flex;flex-direction:column}::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm);padding-block-end:var(--calcite-internal-action-menu-padding)}.default-trigger{position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}slot[name=trigger]::slotted(calcite-action),calcite-action::slotted([slot=trigger]){position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}.menu{outline:var(--calcite-border-width-md) solid transparent;outline-offset:var(--calcite-border-width-md);display:flex;flex-direction:column;flex-wrap:nowrap;overflow-y:auto;overflow-x:hidden;max-block-size:45vh;gap:var(--calcite-internal-action-menu-gap);padding:var(--calcite-internal-action-menu-padding)}:host([hidden]){display:none}[hidden]{display:none}`;
17
16
  const SUPPORTED_MENU_NAV_KEYS = ["ArrowUp", "ArrowDown", "End", "Home"];
17
+ const HORIZONTAL_MENU_OPEN_KEYS = ["ArrowLeft", "ArrowRight"];
18
+ const VERTICAL_MENU_OPEN_KEYS = ["ArrowUp", "ArrowDown"];
19
+ const MENU_OPEN_KEYS = [...HORIZONTAL_MENU_OPEN_KEYS, ...VERTICAL_MENU_OPEN_KEYS];
20
+ const HORIZONTAL_PLACEMENT_PREFIXES = ["left", "right", "leading", "trailing"];
21
+ const VERTICAL_PLACEMENT_PREFIXES = ["top", "bottom"];
18
22
  class ActionMenu extends LitElement {
19
23
  constructor() {
20
24
  super();
@@ -27,30 +31,57 @@ class ActionMenu extends LitElement {
27
31
  this.toggleOpen();
28
32
  };
29
33
  this.menuButtonId = IDS.button(this.guid);
34
+ this.handleDocumentMouseDown = (event) => {
35
+ if (this.open && !event.composedPath().includes(this.el)) {
36
+ this.focusMenuButtonOnClose = false;
37
+ }
38
+ };
39
+ this.handleDocumentFocusIn = (event) => {
40
+ const composedPath = event.composedPath();
41
+ this.menuHasFocus = this.navigableActions.some((action) => composedPath.includes(action));
42
+ };
30
43
  this.menuButtonKeyDown = (event) => {
44
+ const { defaultPrevented, key } = event;
45
+ const { navigableActions } = this;
46
+ if (defaultPrevented || !navigableActions.length) {
47
+ return;
48
+ }
49
+ if (this.isValidKey(key, MENU_OPEN_KEYS) && event.composedPath().some((element) => element instanceof Element && isActionBar(element))) {
50
+ return;
51
+ }
52
+ const placementOrientation = this.placementOrientation;
53
+ const supportedOpenKeys = placementOrientation === "horizontal" ? HORIZONTAL_MENU_OPEN_KEYS : placementOrientation === "vertical" || !placementOrientation ? VERTICAL_MENU_OPEN_KEYS : void 0;
54
+ if (!supportedOpenKeys || !this.isValidKey(key, supportedOpenKeys)) {
55
+ return;
56
+ }
57
+ event.preventDefault();
58
+ this.toggleOpen(true);
59
+ this.activeMenuItemIndex = key === "ArrowDown" || key === "ArrowRight" ? 0 : navigableActions.length - 1;
60
+ this.updateActions(navigableActions);
61
+ void this.setFocus();
62
+ };
63
+ this.menuKeyDown = (event) => {
31
64
  const { key } = event;
32
- const { activeMenuItemIndex, navigableActions, open } = this;
65
+ const { navigableActions } = this;
33
66
  if (!navigableActions.length) {
34
67
  return;
35
68
  }
36
- if (isActivationKey(key)) {
37
- event.preventDefault();
38
- if (!open) {
39
- this.toggleOpen();
40
- return;
41
- }
42
- const action = navigableActions[activeMenuItemIndex];
43
- if (action) {
44
- action.click();
45
- } else {
46
- this.toggleOpen(false);
47
- }
48
- }
49
69
  if (key === "Tab") {
70
+ this.focusMenuButtonOnClose = false;
71
+ this.restoreMenuButtonTabIndexOnClose = false;
50
72
  this.open = false;
73
+ this.menuButtonTabIndexFrame = requestAnimationFrame(() => {
74
+ this.menuButtonTabIndexFrame = void 0;
75
+ if (!this.open) {
76
+ this.restoreMenuButtonTabIndex();
77
+ }
78
+ this.restoreMenuButtonTabIndexOnClose = true;
79
+ });
51
80
  return;
52
81
  }
53
82
  if (key === "Escape") {
83
+ this.focusMenuButtonOnClose = true;
84
+ this.restoreMenuButtonTabIndexOnClose = true;
54
85
  this.toggleOpen(false);
55
86
  event.preventDefault();
56
87
  return;
@@ -60,22 +91,37 @@ class ActionMenu extends LitElement {
60
91
  this.menuId = IDS.menu(this.guid);
61
92
  this._open = false;
62
93
  this.updateAction = (action, index) => {
63
- const { guid: guid2, activeMenuItemIndex } = this;
94
+ const { guid: guid2, activeMenuItemIndex, open } = this;
64
95
  const id = IDS.action(guid2, index);
65
- action.tabIndex = -1;
66
- action.setAttribute("role", "menuitem");
96
+ action.tabIndex = open && index === activeMenuItemIndex ? 0 : -1;
97
+ action.aria = {
98
+ ...action.aria,
99
+ checked: void 0,
100
+ label: action.label || action.text,
101
+ role: "menuitem"
102
+ };
103
+ action.ariaChecked = null;
67
104
  if (!action.id) {
68
105
  action.id = id;
69
106
  }
70
- action.activeDescendant = index === activeMenuItemIndex;
71
107
  };
72
108
  this.focusSetter = useFocusable()(this).setFocus;
109
+ this.focusMenuButtonOnClose = true;
110
+ this.menuHasFocus = false;
111
+ this.restoreMenuButtonTabIndexOnClose = true;
73
112
  this.mouseDownHandler = (event) => {
74
- if (!event.composedPath().some(isAction)) {
113
+ if (!event.composedPath().some((el) => el instanceof Element && isAction(el))) {
75
114
  return;
76
115
  }
116
+ this.focusMenuButtonOnClose = false;
77
117
  this.activeMenuItemIndex = this.navigableActions.findIndex((action) => action === event.target);
78
118
  };
119
+ this.handleActionFocus = (event) => {
120
+ const focusedActionIndex = this.navigableActions.findIndex((action) => event.composedPath().includes(action));
121
+ if (focusedActionIndex !== -1) {
122
+ this.activeMenuItemIndex = focusedActionIndex;
123
+ }
124
+ };
79
125
  this.activeMenuItemIndex = -1;
80
126
  this.appearance = "solid";
81
127
  this.expanded = false;
@@ -95,6 +141,20 @@ class ActionMenu extends LitElement {
95
141
  static {
96
142
  this.styles = styles;
97
143
  }
144
+ get placementOrientation() {
145
+ const placements = this.flipPlacements?.length ? this.flipPlacements : [this.placement];
146
+ const placement = placements.find((placement2) => this.hasPlacementPrefix(placement2, HORIZONTAL_PLACEMENT_PREFIXES.concat(VERTICAL_PLACEMENT_PREFIXES)));
147
+ if (!placement) {
148
+ return;
149
+ }
150
+ if (this.hasPlacementPrefix(placement, HORIZONTAL_PLACEMENT_PREFIXES)) {
151
+ return "horizontal";
152
+ }
153
+ if (this.hasPlacementPrefix(placement, VERTICAL_PLACEMENT_PREFIXES)) {
154
+ return "vertical";
155
+ }
156
+ return void 0;
157
+ }
98
158
  get open() {
99
159
  return this._open;
100
160
  }
@@ -109,12 +169,24 @@ class ActionMenu extends LitElement {
109
169
  return this._actions;
110
170
  }
111
171
  async setFocus(options) {
112
- return this.focusSetter(() => this.menuButtonEl, options);
172
+ if (this.open) {
173
+ await this.updateComplete;
174
+ if (!this.open) {
175
+ return;
176
+ }
177
+ return this.navigableActions[this.activeMenuItemIndex]?.setFocus({
178
+ preventScroll: true,
179
+ ...options
180
+ });
181
+ }
182
+ return this.focusSetter(() => this.menuButtonEl || this.el, options);
113
183
  }
114
184
  connectedCallback() {
115
185
  super.connectedCallback();
116
186
  this.connectMenuButtonEl();
117
187
  this.listen("mousedown", this.mouseDownHandler);
188
+ this.listenOn(document, "focusin", this.handleDocumentFocusIn);
189
+ this.listenOn(document, "mousedown", this.handleDocumentMouseDown);
118
190
  }
119
191
  willUpdate(changes) {
120
192
  if (changes.has("expanded") && (this.hasUpdated || this.expanded !== false)) {
@@ -133,42 +205,61 @@ class ActionMenu extends LitElement {
133
205
  }
134
206
  disconnectedCallback() {
135
207
  super.disconnectedCallback();
208
+ if (this.menuButtonTabIndexFrame != null) {
209
+ cancelAnimationFrame(this.menuButtonTabIndexFrame);
210
+ this.menuButtonTabIndexFrame = void 0;
211
+ }
136
212
  this.disconnectMenuButtonEl();
137
213
  }
138
214
  expandedHandler() {
139
215
  this.open = false;
140
216
  this.setTooltipReferenceElement();
141
217
  }
218
+ focusMenuButton(options) {
219
+ return this.focusSetter(() => this.menuButtonEl, options);
220
+ }
142
221
  openHandler(open) {
143
222
  if (this.menuButtonEl) {
144
223
  this.menuButtonEl.active = open;
145
- this.menuButtonEl.aria = {
146
- expanded: open
147
- };
224
+ this.syncMenuButtonAria();
148
225
  }
149
226
  if (this.popoverEl) {
150
227
  this.popoverEl.open = open;
151
228
  }
152
229
  this.activeMenuItemIndex = this.open ? 0 : -1;
230
+ this.updateActions(this.navigableActions);
231
+ if (open) {
232
+ this.disableMenuButtonTabStop();
233
+ } else if (this.restoreMenuButtonTabIndexOnClose) {
234
+ this.restoreMenuButtonTabIndex();
235
+ }
153
236
  this.calciteActionMenuOpen.emit();
154
237
  this.setTooltipReferenceElement();
155
238
  }
156
239
  connectMenuButtonEl() {
157
- const { menuButtonId, menuId, open, label } = this;
240
+ const { menuButtonId, open, label } = this;
158
241
  const menuButtonEl = this.slottedMenuButtonEl || this.defaultMenuButtonEl;
159
242
  if (this.menuButtonEl === menuButtonEl) {
160
243
  return;
161
244
  }
162
245
  this.disconnectMenuButtonEl();
163
246
  this.menuButtonEl = menuButtonEl;
247
+ if (this.popoverEl && menuButtonEl) {
248
+ this.popoverEl.referenceElement = menuButtonEl;
249
+ this.popoverEl.referenceEl = menuButtonEl;
250
+ if (this.open) {
251
+ void this.popoverEl.reposition(true);
252
+ }
253
+ }
164
254
  this.setTooltipReferenceElement();
165
255
  if (!menuButtonEl) {
166
256
  return;
167
257
  }
168
258
  menuButtonEl.active = open;
169
- menuButtonEl.setAttribute("aria-controls", menuId);
170
- menuButtonEl.setAttribute("aria-expanded", toAriaBoolean(open));
171
- menuButtonEl.setAttribute("aria-haspopup", "true");
259
+ this.syncMenuButtonAria();
260
+ if (open) {
261
+ this.disableMenuButtonTabStop();
262
+ }
172
263
  if (!menuButtonEl.id) {
173
264
  menuButtonEl.id = menuButtonId;
174
265
  }
@@ -186,11 +277,37 @@ class ActionMenu extends LitElement {
186
277
  if (!menuButtonEl) {
187
278
  return;
188
279
  }
280
+ this.restoreMenuButtonTabIndex();
189
281
  menuButtonEl.removeEventListener("click", this.menuButtonClick);
190
282
  menuButtonEl.removeEventListener("keydown", this.menuButtonKeyDown);
191
283
  this.menuButtonEl = void 0;
192
284
  }
285
+ disableMenuButtonTabStop() {
286
+ const { menuButtonEl } = this;
287
+ if (!menuButtonEl) {
288
+ return;
289
+ }
290
+ if (this.menuButtonTabIndex === void 0) {
291
+ this.menuButtonTabIndex = menuButtonEl.getAttribute("tabindex");
292
+ }
293
+ menuButtonEl.tabIndex = -1;
294
+ }
295
+ restoreMenuButtonTabIndex() {
296
+ const { menuButtonEl, menuButtonTabIndex } = this;
297
+ if (!menuButtonEl || menuButtonTabIndex === void 0) {
298
+ return;
299
+ }
300
+ if (menuButtonTabIndex === null) {
301
+ menuButtonEl.removeAttribute("tabindex");
302
+ } else {
303
+ menuButtonEl.setAttribute("tabindex", menuButtonTabIndex);
304
+ }
305
+ this.menuButtonTabIndex = void 0;
306
+ }
193
307
  syncActions() {
308
+ const activeAction = this.navigableActions[this.activeMenuItemIndex];
309
+ const activeMenuItemIndex = this.activeMenuItemIndex;
310
+ const menuHadFocus = this.menuHasFocus;
194
311
  const triggerSlot = this.triggerSlotRef.value;
195
312
  const triggerActions = triggerSlot ? getSlotAssignedElements(triggerSlot, "calcite-action").filter((action) => !action.classList.contains(CSS.defaultTrigger)) : [];
196
313
  const triggerActionsSet = new Set(triggerActions);
@@ -198,6 +315,9 @@ class ActionMenu extends LitElement {
198
315
  if (isAction(element)) {
199
316
  return element;
200
317
  }
318
+ if (element instanceof HTMLSlotElement) {
319
+ return getSlotAssignedElements(element, "calcite-action");
320
+ }
201
321
  if (isActionGroup(element)) {
202
322
  return element.actions;
203
323
  }
@@ -214,17 +334,42 @@ class ActionMenu extends LitElement {
214
334
  });
215
335
  this._actions = dedupedActions;
216
336
  this.navigableActions = dedupedActions.filter((action) => !triggerActionsSet.has(action) && !action.disabled && !action.hidden);
337
+ const activeActionIndex = this.navigableActions.indexOf(activeAction);
217
338
  if (!this.open || !this.navigableActions.length) {
218
339
  this.activeMenuItemIndex = -1;
219
- } else if (this.activeMenuItemIndex < 0 || this.activeMenuItemIndex >= this.navigableActions.length) {
340
+ } else if (activeActionIndex !== -1) {
341
+ this.activeMenuItemIndex = activeActionIndex;
342
+ } else if (activeMenuItemIndex < 0) {
220
343
  this.activeMenuItemIndex = 0;
344
+ } else {
345
+ this.activeMenuItemIndex = Math.min(activeMenuItemIndex, this.navigableActions.length - 1);
221
346
  }
222
347
  this.updateActions(this.navigableActions);
348
+ if (!menuHadFocus) {
349
+ return;
350
+ }
351
+ if (this.navigableActions.length) {
352
+ void this.setFocus();
353
+ } else {
354
+ this.open = false;
355
+ void this.focusMenuButton();
356
+ }
223
357
  }
224
358
  setMenuButtonEl() {
225
359
  this.slottedMenuButtonEl = this.triggerSlotRef.value ? getSlotAssignedElements(this.triggerSlotRef.value, "calcite-action")[0] : void 0;
226
360
  this.connectMenuButtonEl();
227
361
  }
362
+ syncMenuButtonAria() {
363
+ const { menuButtonEl, open } = this;
364
+ if (!menuButtonEl) {
365
+ return;
366
+ }
367
+ menuButtonEl.aria = {
368
+ ...menuButtonEl.aria,
369
+ expanded: open,
370
+ hasPopup: "menu"
371
+ };
372
+ }
228
373
  syncActionsAndEmitChange() {
229
374
  this.syncActions();
230
375
  this.calciteInternalActionMenuActionsChange.emit();
@@ -242,12 +387,28 @@ class ActionMenu extends LitElement {
242
387
  return;
243
388
  }
244
389
  this.popoverEl = el;
390
+ if (this.menuButtonEl) {
391
+ el.referenceElement = this.menuButtonEl;
392
+ el.referenceEl = this.menuButtonEl;
393
+ }
245
394
  el.open = this.open;
246
395
  }
247
396
  handleCalciteActionClick(event) {
248
- if (this.navigableActions.some((action) => event.composedPath().includes(action))) {
249
- this.open = false;
250
- this.setFocus();
397
+ const action = this.navigableActions.find((action2) => event.composedPath().includes(action2));
398
+ if (!action) {
399
+ return;
400
+ }
401
+ this.activeMenuItemIndex = this.navigableActions.indexOf(action);
402
+ this.focusMenuButtonOnClose = false;
403
+ const actionGroup = action.closest("calcite-action-group");
404
+ const isNonSelectableActionBarOverflowAction = action.slot === SLOTS.menuActions && actionGroup?.selectionMode === "none" && !!actionGroup.closest("calcite-action-bar");
405
+ const isGroupManagedAction = !!actionGroup && actionGroup.selectionMode !== "none" && actionGroup.actions.includes(action) && action.slot !== SLOTS.menuActions;
406
+ if (!isNonSelectableActionBarOverflowAction && !isGroupManagedAction) {
407
+ action.active = !action.active;
408
+ }
409
+ this.open = false;
410
+ if (this.menuHasFocus) {
411
+ void this.setFocus();
251
412
  }
252
413
  }
253
414
  updateTooltip(event) {
@@ -264,7 +425,7 @@ class ActionMenu extends LitElement {
264
425
  }
265
426
  }
266
427
  updateActions(actions) {
267
- actions.forEach(this.updateAction);
428
+ actions?.forEach(this.updateAction);
268
429
  }
269
430
  async handleDefaultSlotChange() {
270
431
  await this.componentOnReady();
@@ -281,21 +442,14 @@ class ActionMenu extends LitElement {
281
442
  isValidKey(key, supportedKeys) {
282
443
  return !!supportedKeys.find((k) => k === key);
283
444
  }
445
+ hasPlacementPrefix(placement, prefixes) {
446
+ return prefixes.some((prefix) => placement === prefix || placement.startsWith(`${prefix}-`));
447
+ }
284
448
  handleActionNavigation(event, key, actions) {
285
- if (!this.isValidKey(key, SUPPORTED_MENU_NAV_KEYS)) {
449
+ if (!this.open || !this.isValidKey(key, SUPPORTED_MENU_NAV_KEYS)) {
286
450
  return;
287
451
  }
288
452
  event.preventDefault();
289
- if (!this.open) {
290
- this.toggleOpen();
291
- if (key === "Home" || key === "ArrowDown") {
292
- this.activeMenuItemIndex = 0;
293
- }
294
- if (key === "End" || key === "ArrowUp") {
295
- this.activeMenuItemIndex = actions.length - 1;
296
- }
297
- return;
298
- }
299
453
  if (key === "Home") {
300
454
  this.activeMenuItemIndex = 0;
301
455
  }
@@ -309,6 +463,8 @@ class ActionMenu extends LitElement {
309
463
  if (key === "ArrowDown") {
310
464
  this.activeMenuItemIndex = getRoundRobinIndex(currentIndex + 1, actions.length);
311
465
  }
466
+ this.updateActions(actions);
467
+ void this.setFocus();
312
468
  }
313
469
  toggleOpen(value = !this.open) {
314
470
  this.open = value;
@@ -316,25 +472,28 @@ class ActionMenu extends LitElement {
316
472
  handlePopoverOpen(event) {
317
473
  event.stopPropagation();
318
474
  this.open = true;
319
- this.setFocus();
475
+ void this.setFocus();
320
476
  }
321
477
  handlePopoverClose(event) {
478
+ const { focusMenuButtonOnClose, menuHasFocus } = this;
479
+ this.focusMenuButtonOnClose = true;
322
480
  event.stopPropagation();
323
481
  this.open = false;
482
+ if (focusMenuButtonOnClose && menuHasFocus) {
483
+ void this.focusMenuButton();
484
+ }
324
485
  }
325
486
  renderMenuButton() {
326
- const { appearance, label, scale, expanded } = this;
327
- const menuButtonSlot = html`<slot name=${SLOTS.trigger} @slotchange=${this.handleTriggerSlotChange} ${ref(this.triggerSlotRef)}><calcite-action .appearance=${appearance} .aria=${{ expanded }} class=${safeClassMap(CSS.defaultTrigger)} .icon=${ICONS.menu} .scale=${scale} .text=${label} .textEnabled=${expanded} ${ref(this.setDefaultMenuButtonEl)}></calcite-action></slot>`;
487
+ const { appearance, label, scale, expanded, open } = this;
488
+ const menuButtonSlot = html`<slot name=${SLOTS$1.trigger} @slotchange=${this.handleTriggerSlotChange} ${ref(this.triggerSlotRef)}><calcite-action .appearance=${appearance} .aria=${{ expanded: open, hasPopup: "menu" }} class=${safeClassMap(CSS.defaultTrigger)} .icon=${ICONS.menu} .scale=${scale} .text=${label} .textEnabled=${expanded} ${ref(this.setDefaultMenuButtonEl)}></calcite-action></slot>`;
328
489
  return menuButtonSlot;
329
490
  }
330
491
  renderMenuItems() {
331
- const { navigableActions, activeMenuItemIndex, menuId, menuButtonEl, label, placement, overlayPositioning, flipPlacements } = this;
332
- const activeAction = navigableActions[activeMenuItemIndex];
333
- const activeDescendantId = activeAction?.id || null;
334
- return html`<calcite-popover auto-close .flipPlacements=${flipPlacements} focus-trap-disabled .label=${label} offset-distance=0 @calcitePopoverClose=${this.handlePopoverClose} @calcitePopoverOpen=${this.handlePopoverOpen} .overlayPositioning=${overlayPositioning} .placement=${placement} pointer-disabled .referenceElement=${menuButtonEl} .scale=${this.scale} .topLayerDisabled=${this.topLayerDisabled} trigger-disabled ${ref(this.setPopoverEl)}><div aria-activedescendant=${activeDescendantId ?? void 0 ?? nothing} aria-labelledby=${menuButtonEl?.id ?? nothing} class=${safeClassMap(CSS.menu)} id=${menuId ?? nothing} @click=${this.handleCalciteActionClick} role=menu tabindex=-1><slot @slotchange=${this.handleDefaultSlotChange} ${ref(this.defaultSlotRef)}></slot></div></calcite-popover>`;
492
+ const { menuId, menuButtonEl, label, placement, overlayPositioning, flipPlacements } = this;
493
+ return html`<calcite-popover auto-close .flipPlacements=${flipPlacements} focus-trap-disabled .label=${label} offset-distance=0 @calcitePopoverClose=${this.handlePopoverClose} @calcitePopoverOpen=${this.handlePopoverOpen} .overlayPositioning=${overlayPositioning} .placement=${placement} pointer-disabled .referenceElement=${menuButtonEl} .scale=${this.scale} .topLayerDisabled=${this.topLayerDisabled} trigger-disabled ${ref(this.setPopoverEl)}><div aria-labelledby=${menuButtonEl?.id ?? nothing} .ariaOrientation=${this.placementOrientation === "vertical" ? "vertical" : void 0} class=${safeClassMap(CSS.menu)} id=${menuId ?? nothing} @click=${this.handleCalciteActionClick} @focusin=${this.handleActionFocus} @keydown=${this.menuKeyDown} role=menu tabindex=-1><slot @slotchange=${this.handleDefaultSlotChange} ${ref(this.defaultSlotRef)}></slot></div></calcite-popover>`;
335
494
  }
336
495
  render() {
337
- return html`${this.renderMenuButton()}${this.renderMenuItems()}<slot name=${SLOTS.tooltip} @slotchange=${this.updateTooltip}></slot>`;
496
+ return html`${this.renderMenuButton()}${this.renderMenuItems()}<slot name=${SLOTS$1.tooltip} @slotchange=${this.updateTooltip}></slot>`;
338
497
  }
339
498
  }
340
499
  customElement("calcite-action-menu", ActionMenu);
@@ -15,7 +15,9 @@ export interface DeclareCssProperties {
15
15
  *
16
16
  * Passing a 'href' allows the component to behave like a link
17
17
  *
18
- * It is the consumers responsibility to add aria information, rel, target, for links, and any link attributes for form submission
18
+ * Use the `label` property to provide a custom accessible name.
19
+ *
20
+ * Consumers are responsible for providing other link attributes such as `rel` and `target`.
19
21
  *
20
22
  * @slot - A slot for adding text.
21
23
  */
@@ -42,6 +44,8 @@ export abstract class Link extends LitElement {
42
44
  accessor iconFlipRtl: FlipContext | undefined;
43
45
  /** Specifies an icon to display at the start of the component. */
44
46
  accessor iconStart: IconName | undefined;
47
+ /** Specifies an accessible label for the component. */
48
+ accessor label: string | undefined;
45
49
  /** Specifies the relationship to the linked resource defined in `href`. */
46
50
  accessor rel: string | undefined;
47
51
  /** Specifies the frame or window to open the linked resource. */