@genesislcap/foundation-ui 15.58.0 → 15.58.1-FUI-2629.4

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.
@@ -1493,6 +1493,37 @@
1493
1493
  }
1494
1494
  ]
1495
1495
  },
1496
+ {
1497
+ "kind": "javascript-module",
1498
+ "path": "src/_config/index.ts",
1499
+ "declarations": [],
1500
+ "exports": [
1501
+ {
1502
+ "kind": "js",
1503
+ "name": "*",
1504
+ "declaration": {
1505
+ "name": "*",
1506
+ "package": "./styles"
1507
+ }
1508
+ },
1509
+ {
1510
+ "kind": "js",
1511
+ "name": "*",
1512
+ "declaration": {
1513
+ "name": "*",
1514
+ "package": "./tokens"
1515
+ }
1516
+ },
1517
+ {
1518
+ "kind": "js",
1519
+ "name": "*",
1520
+ "declaration": {
1521
+ "name": "*",
1522
+ "package": "./values"
1523
+ }
1524
+ }
1525
+ ]
1526
+ },
1496
1527
  {
1497
1528
  "kind": "javascript-module",
1498
1529
  "path": "src/accordion-item/accordion-item.styles.ts",
@@ -1887,37 +1918,6 @@
1887
1918
  }
1888
1919
  ]
1889
1920
  },
1890
- {
1891
- "kind": "javascript-module",
1892
- "path": "src/_config/index.ts",
1893
- "declarations": [],
1894
- "exports": [
1895
- {
1896
- "kind": "js",
1897
- "name": "*",
1898
- "declaration": {
1899
- "name": "*",
1900
- "package": "./styles"
1901
- }
1902
- },
1903
- {
1904
- "kind": "js",
1905
- "name": "*",
1906
- "declaration": {
1907
- "name": "*",
1908
- "package": "./tokens"
1909
- }
1910
- },
1911
- {
1912
- "kind": "js",
1913
- "name": "*",
1914
- "declaration": {
1915
- "name": "*",
1916
- "package": "./values"
1917
- }
1918
- }
1919
- ]
1920
- },
1921
1921
  {
1922
1922
  "kind": "javascript-module",
1923
1923
  "path": "src/actions-menu/actions-menu.styles.ts",
@@ -2065,7 +2065,7 @@
2065
2065
  "kind": "field",
2066
2066
  "name": "actions",
2067
2067
  "type": {
2068
- "text": "ActionMenuItem[]"
2068
+ "text": "ActionMenuItems"
2069
2069
  }
2070
2070
  },
2071
2071
  {
@@ -2114,6 +2114,14 @@
2114
2114
  },
2115
2115
  "default": "'Actions'"
2116
2116
  },
2117
+ {
2118
+ "kind": "field",
2119
+ "name": "iconName",
2120
+ "type": {
2121
+ "text": "string"
2122
+ },
2123
+ "description": "When set, the opener renders this icon instead of the `name` text (e.g. `ellipsis`\nfor an icon-only \"kebab\" opener)."
2124
+ },
2117
2125
  {
2118
2126
  "kind": "field",
2119
2127
  "name": "open",
@@ -2166,11 +2174,29 @@
2166
2174
  "text": "HTMLElement"
2167
2175
  }
2168
2176
  },
2177
+ {
2178
+ "kind": "field",
2179
+ "name": "positionTracker",
2180
+ "type": {
2181
+ "text": "AnchoredPopoverPositionTracker | undefined"
2182
+ },
2183
+ "privacy": "private"
2184
+ },
2169
2185
  {
2170
2186
  "kind": "method",
2171
2187
  "name": "updateMenuPosition",
2172
2188
  "privacy": "private"
2173
2189
  },
2190
+ {
2191
+ "kind": "method",
2192
+ "name": "startTrackingPosition",
2193
+ "privacy": "private"
2194
+ },
2195
+ {
2196
+ "kind": "method",
2197
+ "name": "stopTrackingPosition",
2198
+ "privacy": "private"
2199
+ },
2174
2200
  {
2175
2201
  "kind": "method",
2176
2202
  "name": "definitionChanged",
@@ -2199,6 +2225,37 @@
2199
2225
  "kind": "method",
2200
2226
  "name": "toggleActionsMenuVisibility"
2201
2227
  },
2228
+ {
2229
+ "kind": "method",
2230
+ "name": "onPopoverToggle",
2231
+ "parameters": [
2232
+ {
2233
+ "name": "event",
2234
+ "type": {
2235
+ "text": "Event"
2236
+ }
2237
+ }
2238
+ ],
2239
+ "description": "Syncs `open` when the native `popover=\"auto\"` light-dismiss (outside click / Escape) closes\nthe vertical menu without going through `toggleActionsMenuVisibility()`."
2240
+ },
2241
+ {
2242
+ "kind": "method",
2243
+ "name": "onIconOpenerKeydown",
2244
+ "return": {
2245
+ "type": {
2246
+ "text": "boolean"
2247
+ }
2248
+ },
2249
+ "parameters": [
2250
+ {
2251
+ "name": "event",
2252
+ "type": {
2253
+ "text": "KeyboardEvent"
2254
+ }
2255
+ }
2256
+ ],
2257
+ "description": "Opens the icon-only opener from the keyboard, as a native button would."
2258
+ },
2202
2259
  {
2203
2260
  "kind": "method",
2204
2261
  "name": "onActionMenuItemClick",
@@ -2211,6 +2268,32 @@
2211
2268
  }
2212
2269
  ]
2213
2270
  },
2271
+ {
2272
+ "kind": "method",
2273
+ "name": "isActionDisabled",
2274
+ "return": {
2275
+ "type": {
2276
+ "text": "boolean"
2277
+ }
2278
+ },
2279
+ "parameters": [
2280
+ {
2281
+ "name": "action",
2282
+ "type": {
2283
+ "text": "ActionMenuItem"
2284
+ }
2285
+ }
2286
+ ],
2287
+ "description": "Resolves an action's `isDisabled` flag or row-data function for the current row."
2288
+ },
2289
+ {
2290
+ "kind": "field",
2291
+ "name": "resolvedActions",
2292
+ "type": {
2293
+ "text": "ActionMenuItem[]"
2294
+ },
2295
+ "readonly": true
2296
+ },
2214
2297
  {
2215
2298
  "kind": "field",
2216
2299
  "name": "allActions",
@@ -2393,6 +2476,14 @@
2393
2476
  "default": "'Actions'",
2394
2477
  "fieldName": "name"
2395
2478
  },
2479
+ {
2480
+ "name": "icon-name",
2481
+ "type": {
2482
+ "text": "string"
2483
+ },
2484
+ "description": "When set, the opener renders this icon instead of the `name` text (e.g. `ellipsis`\nfor an icon-only \"kebab\" opener).",
2485
+ "fieldName": "iconName"
2486
+ },
2396
2487
  {
2397
2488
  "name": "open",
2398
2489
  "type": {
@@ -59561,6 +59652,14 @@
59561
59652
  "package": "./options-datasource-utils"
59562
59653
  }
59563
59654
  },
59655
+ {
59656
+ "kind": "js",
59657
+ "name": "*",
59658
+ "declaration": {
59659
+ "name": "*",
59660
+ "package": "./popover-position"
59661
+ }
59662
+ },
59564
59663
  {
59565
59664
  "kind": "js",
59566
59665
  "name": "*",
@@ -59694,6 +59793,89 @@
59694
59793
  }
59695
59794
  ]
59696
59795
  },
59796
+ {
59797
+ "kind": "javascript-module",
59798
+ "path": "src/utils/popover-position.ts",
59799
+ "declarations": [
59800
+ {
59801
+ "kind": "function",
59802
+ "name": "findScrollableAncestors",
59803
+ "return": {
59804
+ "type": {
59805
+ "text": "(HTMLElement | Document)[]"
59806
+ }
59807
+ },
59808
+ "parameters": [
59809
+ {
59810
+ "name": "element",
59811
+ "type": {
59812
+ "text": "HTMLElement"
59813
+ }
59814
+ }
59815
+ ],
59816
+ "description": "Walks up from `element`, crossing shadow-root boundaries via `.host`, collecting every\nscrollable ancestor (including the anchor's own document).",
59817
+ "privacy": "public"
59818
+ },
59819
+ {
59820
+ "kind": "class",
59821
+ "description": "Keeps a Popover-API element anchored to its trigger while any of the trigger's scrollable\nancestors scroll, and reports back when the trigger has been removed from the DOM (e.g. AG\nGrid row virtualization recycling the row that owns it).",
59822
+ "name": "AnchoredPopoverPositionTracker",
59823
+ "members": [
59824
+ {
59825
+ "kind": "field",
59826
+ "name": "ancestors",
59827
+ "type": {
59828
+ "text": "(HTMLElement | Document)[]"
59829
+ },
59830
+ "privacy": "private",
59831
+ "default": "[]"
59832
+ },
59833
+ {
59834
+ "kind": "field",
59835
+ "name": "handleScroll",
59836
+ "privacy": "private",
59837
+ "readonly": true
59838
+ },
59839
+ {
59840
+ "kind": "method",
59841
+ "name": "start",
59842
+ "return": {
59843
+ "type": {
59844
+ "text": "void"
59845
+ }
59846
+ }
59847
+ },
59848
+ {
59849
+ "kind": "method",
59850
+ "name": "stop",
59851
+ "return": {
59852
+ "type": {
59853
+ "text": "void"
59854
+ }
59855
+ }
59856
+ }
59857
+ ]
59858
+ }
59859
+ ],
59860
+ "exports": [
59861
+ {
59862
+ "kind": "js",
59863
+ "name": "findScrollableAncestors",
59864
+ "declaration": {
59865
+ "name": "findScrollableAncestors",
59866
+ "module": "src/utils/popover-position.ts"
59867
+ }
59868
+ },
59869
+ {
59870
+ "kind": "js",
59871
+ "name": "AnchoredPopoverPositionTracker",
59872
+ "declaration": {
59873
+ "name": "AnchoredPopoverPositionTracker",
59874
+ "module": "src/utils/popover-position.ts"
59875
+ }
59876
+ }
59877
+ ]
59878
+ },
59697
59879
  {
59698
59880
  "kind": "javascript-module",
59699
59881
  "path": "src/utils/tooltip.ts",
@@ -1,4 +1,6 @@
1
+ import type { IconStyle } from '@fortawesome/fontawesome-svg-core';
1
2
  import { FoundationElement } from '@microsoft/fast-foundation';
3
+ import type { FaSize } from '../icon';
2
4
  /**
3
5
  * The Action Menu Item component.
4
6
  * @remarks Used within the Action Menu component.
@@ -7,20 +9,37 @@ import { FoundationElement } from '@microsoft/fast-foundation';
7
9
  export type ActionMenuItem = {
8
10
  name: string | ((rowData: any) => string);
9
11
  callback: (rowData: any) => void | any;
10
- isDisabled?: (rowData: any) => boolean;
12
+ /** A fixed flag, or a function of the row data (the grid row from the cell params). */
13
+ isDisabled?: boolean | ((rowData: any) => boolean);
11
14
  color?: string;
15
+ icon?: {
16
+ variant?: IconStyle;
17
+ name: string;
18
+ size?: FaSize;
19
+ };
12
20
  };
21
+ /**
22
+ * The actions shown by the Actions Menu: a fixed array, or a function of the row data returning
23
+ * one (for row-scoped eligibility/permission filtering).
24
+ * @public
25
+ */
26
+ export type ActionMenuItems = ActionMenuItem[] | ((rowData: any) => ActionMenuItem[]);
13
27
  /**
14
28
  * @tagname %%prefix%%-actions-menu
15
29
  */
16
30
  export declare class ActionsMenu extends FoundationElement {
17
- actions: ActionMenuItem[];
31
+ actions: ActionMenuItems;
18
32
  isVertical: boolean;
19
33
  addDefaultActions: boolean;
20
34
  autoCloseOnAction: boolean;
21
35
  classNames: string;
22
36
  definition: any;
23
37
  name: string;
38
+ /**
39
+ * When set, the opener renders this icon instead of the `name` text (e.g. `ellipsis`
40
+ * for an icon-only "kebab" opener).
41
+ */
42
+ iconName: string;
24
43
  open: boolean;
25
44
  buttonAppearance: string;
26
45
  hideDisabled: boolean;
@@ -28,12 +47,25 @@ export declare class ActionsMenu extends FoundationElement {
28
47
  singleOption: ActionMenuItem;
29
48
  actionsMenu: HTMLElement;
30
49
  actionsOpener: HTMLElement;
50
+ private positionTracker?;
31
51
  disconnectedCallback(): void;
32
52
  private updateMenuPosition;
53
+ private startTrackingPosition;
54
+ private stopTrackingPosition;
33
55
  protected definitionChanged(oldValue: any, newValue: any): void;
34
56
  protected openChanged(): void;
35
57
  toggleActionsMenuVisibility(): void;
58
+ /**
59
+ * Syncs `open` when the native `popover="auto"` light-dismiss (outside click / Escape) closes
60
+ * the vertical menu without going through `toggleActionsMenuVisibility()`.
61
+ */
62
+ onPopoverToggle(event: Event): void;
63
+ /** Opens the icon-only opener from the keyboard, as a native button would. */
64
+ onIconOpenerKeydown(event: KeyboardEvent): boolean;
36
65
  onActionMenuItemClick(callback: (rowData: any) => void | any): void;
66
+ /** Resolves an action's `isDisabled` flag or row-data function for the current row. */
67
+ isActionDisabled(action: ActionMenuItem): boolean;
68
+ get resolvedActions(): ActionMenuItem[];
37
69
  get allActions(): ActionMenuItem[];
38
70
  get rowData(): any;
39
71
  getLabel(name: string | ((rowData: any) => string)): string;
@@ -1 +1 @@
1
- {"version":3,"file":"actions-menu.d.ts","sourceRoot":"","sources":["../../../src/actions-menu/actions-menu.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAS/D;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC;IAC1C,QAAQ,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,GAAG,GAAG,CAAC;IACvC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;IACpC,OAAO,EAAE,cAAc,EAAE,CAAC;IACe,UAAU,EAAE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AAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IA0CxD,SAAS,CAAC,WAAW;IAerB,2BAA2B;IAI3B;;;OAGG;IACH,eAAe,CAAC,KAAK,EAAE,KAAK;IAO5B,8EAA8E;IAC9E,mBAAmB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IAMlD,qBAAqB,CAAC,QAAQ,EAAE,CAAC,OAAO,KAAA,KAAK,IAAI,GAAG,GAAG;IAKvD,uFAAuF;IACvF,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO;IAKjD,IAAI,eAAe,IAAI,cAAc,EAAE,CAGtC;IAED,IAAI,UAAU,IAAI,cAAc,EAAE,CAWjC;IAED,IAAI,OAAO,QAKV;IAED,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,MAAM,CAAC;IAQlD,WAAW,CAAC,MAAM,EAAE,MAAM;CAyB3B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,2TAIhC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"actions-menu.styles.d.ts","sourceRoot":"","sources":["../../../src/actions-menu/actions-menu.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,KAAK,EACV,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,4BAA4B,CAAC;AAEpC,eAAO,MAAM,qBAAqB,GAChC,SAAS,wBAAwB,EACjC,YAAY,2BAA2B,KACtC,aA4FF,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,SAAS,wBAAwB,EACjC,YAAY,2BAA2B,KACtC,aAEF,CAAC"}
1
+ {"version":3,"file":"actions-menu.styles.d.ts","sourceRoot":"","sources":["../../../src/actions-menu/actions-menu.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,KAAK,EACV,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,4BAA4B,CAAC;AAEpC,eAAO,MAAM,qBAAqB,GAChC,SAAS,wBAAwB,EACjC,YAAY,2BAA2B,KACtC,aAiKF,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,SAAS,wBAAwB,EACjC,YAAY,2BAA2B,KACtC,aAEF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"actions-menu.template.d.ts","sourceRoot":"","sources":["../../../src/actions-menu/actions-menu.template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,mCAoD1C,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,mCAclD,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,YAAY,CAAC,WAAW,CAOnE,CAAC"}
1
+ {"version":3,"file":"actions-menu.template.d.ts","sourceRoot":"","sources":["../../../src/actions-menu/actions-menu.template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAwClD,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,mCAiE1C,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,mCAclD,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,YAAY,CAAC,WAAW,CAOnE,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const mapType: (TYPE: string) => "boolean" | "number" | "date" | "text" | "enum";
1
+ export declare const mapType: (TYPE: string) => "boolean" | "number" | "text" | "date" | "enum";
2
2
  //# sourceMappingURL=filter-bar.utils.d.ts.map
@@ -3,5 +3,6 @@ export * from './dom';
3
3
  export * from './event-types';
4
4
  export * from './logger';
5
5
  export * from './options-datasource-utils';
6
+ export * from './popover-position';
6
7
  export * from './tooltip';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Walks up from `element`, crossing shadow-root boundaries via `.host`, collecting every
3
+ * scrollable ancestor (including the anchor's own document).
4
+ * @remarks Native `scroll` events are not `composed`, so they don't cross shadow-DOM boundaries
5
+ * the way `click`/`keydown` do — a listener on `document` never sees a shadow-DOM-nested
6
+ * viewport's own scroll. Callers must listen on each returned ancestor directly.
7
+ * @public
8
+ */
9
+ export declare function findScrollableAncestors(element: HTMLElement): (HTMLElement | Document)[];
10
+ /**
11
+ * Keeps a Popover-API element anchored to its trigger while any of the trigger's scrollable
12
+ * ancestors scroll, and reports back when the trigger has been removed from the DOM (e.g. AG
13
+ * Grid row virtualization recycling the row that owns it).
14
+ * @public
15
+ */
16
+ export declare class AnchoredPopoverPositionTracker {
17
+ private readonly anchor;
18
+ private readonly onReposition;
19
+ private readonly onAnchorDetached;
20
+ private ancestors;
21
+ private readonly handleScroll;
22
+ constructor(anchor: HTMLElement, onReposition: () => void, onAnchorDetached: () => void);
23
+ start(): void;
24
+ stop(): void;
25
+ }
26
+ //# sourceMappingURL=popover-position.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover-position.d.ts","sourceRoot":"","sources":["../../../src/utils/popover-position.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,WAAW,GAAG,CAAC,WAAW,GAAG,QAAQ,CAAC,EAAE,CA8BxF;AAED;;;;;GAKG;AACH,qBAAa,8BAA8B;IAYvC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAbnC,OAAO,CAAC,SAAS,CAAkC;IAEnD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAM3B;gBAGiB,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE,MAAM,IAAI,EACxB,gBAAgB,EAAE,MAAM,IAAI;IAG/C,KAAK,IAAI,IAAI;IAQb,IAAI,IAAI,IAAI;CAMb"}
@@ -2,6 +2,7 @@ import { __decorate } from "tslib";
2
2
  import { attr, observable } from '@microsoft/fast-element';
3
3
  import { FoundationElement } from '@microsoft/fast-foundation';
4
4
  import { classNames } from '@microsoft/fast-web-utilities';
5
+ import { AnchoredPopoverPositionTracker } from '../utils';
5
6
  import { foundationActionsMenuStyles as styles } from './actions-menu.styles';
6
7
  import { singleOptionTemplate, menuTemplate, foundationActionsMenuTemplate as template, } from './actions-menu.template';
7
8
  /**
@@ -20,6 +21,7 @@ export class ActionsMenu extends FoundationElement {
20
21
  }
21
22
  disconnectedCallback() {
22
23
  var _a;
24
+ this.stopTrackingPosition();
23
25
  if ((_a = this.actionsMenu) === null || _a === void 0 ? void 0 : _a.matches(':popover-open')) {
24
26
  this.actionsMenu.hidePopover();
25
27
  }
@@ -28,13 +30,25 @@ export class ActionsMenu extends FoundationElement {
28
30
  updateMenuPosition() {
29
31
  const rect = this.actionsOpener.getBoundingClientRect();
30
32
  this.actionsMenu.style.position = 'fixed';
31
- this.actionsMenu.style.top = `${rect.top}px`;
33
+ // The vertical menu drops down below its opener; the horizontal one overlays it.
34
+ this.actionsMenu.style.top = `${this.isVertical ? rect.bottom : rect.top}px`;
32
35
  this.actionsMenu.style.left = 'auto';
33
36
  this.actionsMenu.style.right = `${window.innerWidth - rect.right}px`;
34
37
  }
38
+ startTrackingPosition() {
39
+ this.positionTracker = new AnchoredPopoverPositionTracker(this.actionsOpener, () => this.updateMenuPosition(), () => (this.open = false));
40
+ this.positionTracker.start();
41
+ }
42
+ stopTrackingPosition() {
43
+ var _a;
44
+ (_a = this.positionTracker) === null || _a === void 0 ? void 0 : _a.stop();
45
+ this.positionTracker = undefined;
46
+ }
35
47
  definitionChanged(oldValue, newValue) {
36
48
  var _a;
37
- this.actions = (_a = newValue === null || newValue === void 0 ? void 0 : newValue.actions) !== null && _a !== void 0 ? _a : [];
49
+ if (!newValue)
50
+ return;
51
+ this.actions = (_a = newValue.actions) !== null && _a !== void 0 ? _a : [];
38
52
  delete this.definition.actions;
39
53
  if (newValue.buttonText) {
40
54
  this.name = newValue.buttonText;
@@ -44,6 +58,18 @@ export class ActionsMenu extends FoundationElement {
44
58
  this.isVertical = newValue.isVertical;
45
59
  delete this.definition.isVertical;
46
60
  }
61
+ if (newValue.iconName) {
62
+ this.iconName = newValue.iconName;
63
+ delete this.definition.iconName;
64
+ }
65
+ if (newValue.addDefaultActions !== undefined) {
66
+ this.addDefaultActions = newValue.addDefaultActions;
67
+ delete this.definition.addDefaultActions;
68
+ }
69
+ if (newValue.hideDisabled !== undefined) {
70
+ this.hideDisabled = newValue.hideDisabled;
71
+ delete this.definition.hideDisabled;
72
+ }
47
73
  if (newValue.buttonAppearance) {
48
74
  this.buttonAppearance = newValue.buttonAppearance;
49
75
  delete this.definition.buttonAppearance;
@@ -59,28 +85,59 @@ export class ActionsMenu extends FoundationElement {
59
85
  if (this.open) {
60
86
  this.updateMenuPosition();
61
87
  this.actionsMenu.showPopover();
88
+ this.startTrackingPosition();
62
89
  }
63
- else if ((_a = this.actionsMenu) === null || _a === void 0 ? void 0 : _a.matches(':popover-open')) {
64
- this.actionsMenu.hidePopover();
90
+ else {
91
+ this.stopTrackingPosition();
92
+ if ((_a = this.actionsMenu) === null || _a === void 0 ? void 0 : _a.matches(':popover-open')) {
93
+ this.actionsMenu.hidePopover();
94
+ }
65
95
  }
66
96
  }
67
97
  toggleActionsMenuVisibility() {
68
98
  this.open = !this.open;
69
99
  }
100
+ /**
101
+ * Syncs `open` when the native `popover="auto"` light-dismiss (outside click / Escape) closes
102
+ * the vertical menu without going through `toggleActionsMenuVisibility()`.
103
+ */
104
+ onPopoverToggle(event) {
105
+ const newState = event.newState;
106
+ if (newState) {
107
+ this.open = newState === 'open';
108
+ }
109
+ }
110
+ /** Opens the icon-only opener from the keyboard, as a native button would. */
111
+ onIconOpenerKeydown(event) {
112
+ if (event.key !== 'Enter' && event.key !== ' ')
113
+ return true;
114
+ this.toggleActionsMenuVisibility();
115
+ return false;
116
+ }
70
117
  onActionMenuItemClick(callback) {
71
118
  if (this.autoCloseOnAction)
72
119
  this.open = false;
73
120
  callback(this.rowData);
74
121
  }
122
+ /** Resolves an action's `isDisabled` flag or row-data function for the current row. */
123
+ isActionDisabled(action) {
124
+ const { isDisabled } = action;
125
+ return typeof isDisabled === 'function' ? !!isDisabled(this.rowData) : !!isDisabled;
126
+ }
127
+ get resolvedActions() {
128
+ const actions = typeof this.actions === 'function' ? this.actions(this.rowData) : this.actions;
129
+ return actions !== null && actions !== void 0 ? actions : [];
130
+ }
75
131
  get allActions() {
76
- var _a;
77
132
  const defaultActions = [
78
133
  {
79
134
  name: '✖',
80
135
  callback: () => (this.open = false),
81
136
  },
82
137
  ];
83
- return this.addDefaultActions ? [...((_a = this.actions) !== null && _a !== void 0 ? _a : []), ...defaultActions] : this.actions;
138
+ return this.addDefaultActions
139
+ ? [...this.resolvedActions, ...defaultActions]
140
+ : this.resolvedActions;
84
141
  }
85
142
  get rowData() {
86
143
  if (!this.definition)
@@ -95,15 +152,17 @@ export class ActionsMenu extends FoundationElement {
95
152
  return name;
96
153
  }
97
154
  getTemplate(prefix) {
155
+ const enabledRows = this.resolvedActions.filter((action) => !this.isActionDisabled(action));
156
+ // The vertical menu hides its opener entirely rather than open onto nothing actionable.
157
+ const hasVisibleActions = this.hideDisabled
158
+ ? enabledRows.length > 0
159
+ : this.resolvedActions.length > 0;
160
+ if (this.isVertical && !hasVisibleActions) {
161
+ return;
162
+ }
98
163
  if (!this.hideMenuSingleOption) {
99
164
  return menuTemplate(prefix);
100
165
  }
101
- const enabledRows = this.actions.filter((action) => {
102
- if (!action.isDisabled) {
103
- return true;
104
- }
105
- return !action.isDisabled(this.rowData);
106
- });
107
166
  this.singleOption = null;
108
167
  if (enabledRows.length === 0) {
109
168
  return;
@@ -136,6 +195,9 @@ __decorate([
136
195
  __decorate([
137
196
  attr
138
197
  ], ActionsMenu.prototype, "name", void 0);
198
+ __decorate([
199
+ attr({ attribute: 'icon-name' })
200
+ ], ActionsMenu.prototype, "iconName", void 0);
139
201
  __decorate([
140
202
  attr({ attribute: 'open', mode: 'boolean' })
141
203
  ], ActionsMenu.prototype, "open", void 0);